@codragraph/cli 2.1.0 → 2.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (156) hide show
  1. package/README.md +62 -21
  2. package/dist/_shared/cgdb/schema-constants.d.ts +2 -2
  3. package/dist/_shared/cgdb/schema-constants.d.ts.map +1 -1
  4. package/dist/_shared/cgdb/schema-constants.js +3 -0
  5. package/dist/_shared/cgdb/schema-constants.js.map +1 -1
  6. package/dist/_shared/feature-clusters.d.ts +99 -0
  7. package/dist/_shared/feature-clusters.d.ts.map +1 -0
  8. package/dist/_shared/feature-clusters.js +2 -0
  9. package/dist/_shared/feature-clusters.js.map +1 -0
  10. package/dist/_shared/graph/types.d.ts +16 -2
  11. package/dist/_shared/graph/types.d.ts.map +1 -1
  12. package/dist/_shared/index.d.ts +1 -0
  13. package/dist/_shared/index.d.ts.map +1 -1
  14. package/dist/_shared/index.js.map +1 -1
  15. package/dist/_shared/pipeline.d.ts +1 -1
  16. package/dist/_shared/pipeline.d.ts.map +1 -1
  17. package/dist/cli/ai-context.js +4 -0
  18. package/dist/cli/analyze.js +46 -26
  19. package/dist/cli/index.js +39 -1
  20. package/dist/cli/serve.d.ts +1 -0
  21. package/dist/cli/serve.js +3 -1
  22. package/dist/cli/setup.js +42 -21
  23. package/dist/cli/status.d.ts +13 -0
  24. package/dist/cli/status.js +99 -0
  25. package/dist/cli/tool.d.ts +25 -0
  26. package/dist/cli/tool.js +74 -0
  27. package/dist/config/ignore-service.js +2 -0
  28. package/dist/config/supported-languages.d.ts +3 -3
  29. package/dist/config/supported-languages.js +3 -3
  30. package/dist/core/cgdb/cgdb-adapter.js +19 -3
  31. package/dist/core/cgdb/csv-generator.js +33 -2
  32. package/dist/core/cgdb/schema.d.ts +2 -1
  33. package/dist/core/cgdb/schema.js +55 -0
  34. package/dist/core/embeddings/embedder.js +4 -2
  35. package/dist/core/graphstore/cgdb-row-source.js +3 -2
  36. package/dist/core/graphstore/index.d.ts +1 -1
  37. package/dist/core/graphstore/index.js +1 -1
  38. package/dist/core/group/bridge-db.js +42 -10
  39. package/dist/core/group/service.d.ts +16 -0
  40. package/dist/core/group/service.js +360 -0
  41. package/dist/core/ingestion/emit-references.d.ts +1 -1
  42. package/dist/core/ingestion/emit-references.js +1 -1
  43. package/dist/core/ingestion/feature-cluster-processor.d.ts +62 -0
  44. package/dist/core/ingestion/feature-cluster-processor.js +626 -0
  45. package/dist/core/ingestion/finalize-orchestrator.js +1 -1
  46. package/dist/core/ingestion/model/registration-table.js +1 -0
  47. package/dist/core/ingestion/model/resolve.d.ts +2 -2
  48. package/dist/core/ingestion/model/resolve.js +3 -3
  49. package/dist/core/ingestion/model/semantic-model.d.ts +1 -1
  50. package/dist/core/ingestion/model/semantic-model.js +1 -1
  51. package/dist/core/ingestion/model/symbol-table.d.ts +1 -1
  52. package/dist/core/ingestion/model/symbol-table.js +1 -1
  53. package/dist/core/ingestion/pipeline-phases/feature-clusters.d.ts +17 -0
  54. package/dist/core/ingestion/pipeline-phases/feature-clusters.js +88 -0
  55. package/dist/core/ingestion/pipeline-phases/index.d.ts +1 -0
  56. package/dist/core/ingestion/pipeline-phases/index.js +1 -0
  57. package/dist/core/ingestion/pipeline.d.ts +4 -0
  58. package/dist/core/ingestion/pipeline.js +9 -5
  59. package/dist/core/run-analyze.d.ts +21 -0
  60. package/dist/core/run-analyze.js +213 -6
  61. package/dist/core/search/hybrid-search.js +11 -3
  62. package/dist/mcp/core/embedder.js +5 -2
  63. package/dist/mcp/local/local-backend.d.ts +12 -0
  64. package/dist/mcp/local/local-backend.js +381 -3
  65. package/dist/mcp/resources.js +139 -0
  66. package/dist/mcp/tools.js +174 -2
  67. package/dist/server/api.d.ts +14 -2
  68. package/dist/server/api.js +206 -7
  69. package/dist/server/mcp-http.d.ts +22 -0
  70. package/dist/server/mcp-http.js +21 -2
  71. package/dist/server/web-dashboard.d.ts +28 -0
  72. package/dist/server/web-dashboard.js +61 -0
  73. package/dist/storage/repo-manager.d.ts +6 -1
  74. package/dist/storage/repo-manager.js +5 -1
  75. package/dist/types/pipeline.d.ts +2 -0
  76. package/dist/web/assets/agent-D5lb0zXz.js +1089 -0
  77. package/dist/web/assets/architectureDiagram-EMZXCZ2Q-CZtc99v_.js +36 -0
  78. package/dist/web/assets/blockDiagram-IGV67L2C-BtoUp-6Y.js +132 -0
  79. package/dist/web/assets/c4Diagram-DFAF54RM-C4Hl3J2U.js +10 -0
  80. package/dist/web/assets/chunk-3GS5O3IE-DkUjU0WD.js +231 -0
  81. package/dist/web/assets/chunk-3YCYZ6SJ-CQkVgT_z.js +1 -0
  82. package/dist/web/assets/chunk-7RZVMHOQ-BitYcNVR.js +338 -0
  83. package/dist/web/assets/chunk-AEOMTBSW-BgTIXPsY.js +1 -0
  84. package/dist/web/assets/chunk-H3VCZNTA-Cx5XV_aC.js +13 -0
  85. package/dist/web/assets/chunk-HN6EAY2L-BBnyTNdB.js +1 -0
  86. package/dist/web/assets/chunk-KSICW3F5-BYzvDLNI.js +15 -0
  87. package/dist/web/assets/chunk-O5ABG6QK-dHwHzA6n.js +1 -0
  88. package/dist/web/assets/chunk-PK6DOVAG-CvsEnugt.js +206 -0
  89. package/dist/web/assets/chunk-RWUO3TPN-BgRTY0_k.js +1 -0
  90. package/dist/web/assets/chunk-TBF5ZNIQ-DL5stGM1.js +1 -0
  91. package/dist/web/assets/chunk-TU3PZOEN-RLyvLcv-.js +1 -0
  92. package/dist/web/assets/classDiagram-PPOCWD7C-DTr8QIOf.js +1 -0
  93. package/dist/web/assets/classDiagram-v2-23LJLIIU-DTr8QIOf.js +1 -0
  94. package/dist/web/assets/context-builder-22jU3V56.js +16 -0
  95. package/dist/web/assets/cose-bilkent-PNC4W37J-DVhePRYg.js +1 -0
  96. package/dist/web/assets/dagre-E77IOHMT-Dzx0A6ZU.js +4 -0
  97. package/dist/web/assets/diagram-H7BISOXX-CC9pRew1.js +43 -0
  98. package/dist/web/assets/diagram-JC5VWROH-Bau_i9tf.js +24 -0
  99. package/dist/web/assets/diagram-LXUTUG65-D9_FM2Gt.js +10 -0
  100. package/dist/web/assets/diagram-WEHSV5V5-BMlayouL.js +24 -0
  101. package/dist/web/assets/erDiagram-GCSMX5X6-C3dhDFA8.js +85 -0
  102. package/dist/web/assets/flowDiagram-OTCZ4VVT-CWSFWmhr.js +162 -0
  103. package/dist/web/assets/ganttDiagram-MUNLMDZQ-D3a67Yol.js +292 -0
  104. package/dist/web/assets/gitGraphDiagram-3HKGZ4G3-7jmry-vM.js +106 -0
  105. package/dist/web/assets/index-BgeqpYgd.js +1415 -0
  106. package/dist/web/assets/index-CT0GtFLZ.css +1 -0
  107. package/dist/web/assets/infoDiagram-MN7RKWGX-G7lhP0Ib.js +2 -0
  108. package/dist/web/assets/ishikawaDiagram-YMYX4NHK-DUoJvNP2.js +70 -0
  109. package/dist/web/assets/journeyDiagram-SO5T7YLQ-RMFPNNqz.js +139 -0
  110. package/dist/web/assets/kanban-definition-LJHFXRCJ-BzpDs1K9.js +89 -0
  111. package/dist/web/assets/katex-GD7MH7QM-DBQvrix-.js +261 -0
  112. package/dist/web/assets/mindmap-definition-2EUWGEK5-Bk0O4roa.js +96 -0
  113. package/dist/web/assets/pieDiagram-3IATQBI2-DKU7kpgS.js +30 -0
  114. package/dist/web/assets/quadrantDiagram-E256RVCF-BY0TGWCS.js +7 -0
  115. package/dist/web/assets/requirementDiagram-M5DCFWZL-DLHOVTSv.js +84 -0
  116. package/dist/web/assets/sankeyDiagram-L3NBLAOT-DVMj5rX2.js +10 -0
  117. package/dist/web/assets/sequenceDiagram-ZOUHS735-CJC73bV-.js +157 -0
  118. package/dist/web/assets/stateDiagram-MLPALWAM-BCFyESls.js +1 -0
  119. package/dist/web/assets/stateDiagram-v2-B5LQ5ZB2-DahzzIca.js +1 -0
  120. package/dist/web/assets/timeline-definition-5SPVSISX-TRSDRgPw.js +120 -0
  121. package/dist/web/assets/vennDiagram-IE5QUKF5-DNy7HRBM.js +34 -0
  122. package/dist/web/assets/wardley-RL74JXVD-BCRCBASE-B-eZEzf9.js +161 -0
  123. package/dist/web/assets/wardleyDiagram-XU3VSMPF-BP-r1xzR.js +20 -0
  124. package/dist/web/assets/xychartDiagram-ZHJ5623Y-Dr9r7a35.js +7 -0
  125. package/dist/web/codragraph-logo-512.png +0 -0
  126. package/dist/web/codragraph-logo.png +0 -0
  127. package/dist/web/favicon.png +0 -0
  128. package/dist/web/index.html +36 -0
  129. package/hooks/claude/codragraph-hook.cjs +24 -9
  130. package/hooks/claude/pre-tool-use.sh +6 -1
  131. package/package.json +15 -4
  132. package/scripts/build.js +75 -16
  133. package/scripts/patch-tree-sitter-swift.cjs +0 -1
  134. package/skills/codragraph-cli.md +17 -1
  135. package/skills/codragraph-guide.md +6 -2
  136. package/skills/codragraph-onboarding.md +2 -2
  137. package/vendor/leiden/index.cjs +272 -285
  138. package/vendor/leiden/utils.cjs +264 -274
  139. package/dist/_shared/lbug/schema-constants.d.ts +0 -16
  140. package/dist/_shared/lbug/schema-constants.d.ts.map +0 -1
  141. package/dist/_shared/lbug/schema-constants.js +0 -67
  142. package/dist/_shared/lbug/schema-constants.js.map +0 -1
  143. package/dist/core/graphstore/lbug-row-source.d.ts +0 -19
  144. package/dist/core/graphstore/lbug-row-source.js +0 -141
  145. package/dist/core/lbug/content-read.d.ts +0 -46
  146. package/dist/core/lbug/content-read.js +0 -64
  147. package/dist/core/lbug/csv-generator.d.ts +0 -29
  148. package/dist/core/lbug/csv-generator.js +0 -492
  149. package/dist/core/lbug/lbug-adapter.d.ts +0 -176
  150. package/dist/core/lbug/lbug-adapter.js +0 -1320
  151. package/dist/core/lbug/pool-adapter.d.ts +0 -93
  152. package/dist/core/lbug/pool-adapter.js +0 -550
  153. package/dist/core/lbug/schema.d.ts +0 -62
  154. package/dist/core/lbug/schema.js +0 -502
  155. package/dist/mcp/core/lbug-adapter.d.ts +0 -5
  156. package/dist/mcp/core/lbug-adapter.js +0 -5
@@ -0,0 +1,132 @@
1
+ import{m as ge}from"./chunk-HN6EAY2L-BBnyTNdB.js";import{o as ue}from"./chunk-KSICW3F5-BYzvDLNI.js";import{m as u,O as lt,i as C,b as ye,p as k,o as pe,R as xe,u as fe,az as be,af as me,am as we,q as A,aj as ke,aA as X,aB as _t,aC as at,aD as Le,U as it,C as Se,c as Bt,aE as Ot,aF as _e,aG as Ee}from"./index-BgeqpYgd.js";import{_ as De}from"./chunk-H3VCZNTA-Cx5XV_aC.js";var mt=function(){var e=u(function(N,h,y,b){for(y=y||{},b=N.length;b--;y[N[b]]=h);return y},"o"),t=[1,15],a=[1,7],s=[1,13],l=[1,14],i=[1,19],r=[1,16],n=[1,17],o=[1,18],x=[8,30],d=[8,10,21,28,29,30,31,39,43,46],p=[1,23],m=[1,24],f=[8,10,15,16,21,28,29,30,31,39,43,46],w=[8,10,15,16,21,27,28,29,30,31,39,43,46],E=[1,49],L={trace:u(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:u(function(N,h,y,b,D,c,_){var g=c.length-1;switch(D){case 4:b.getLogger().debug("Rule: separator (NL) ");break;case 5:b.getLogger().debug("Rule: separator (Space) ");break;case 6:b.getLogger().debug("Rule: separator (EOF) ");break;case 7:b.getLogger().debug("Rule: hierarchy: ",c[g-1]),b.setHierarchy(c[g-1]);break;case 8:b.getLogger().debug("Stop NL ");break;case 9:b.getLogger().debug("Stop EOF ");break;case 10:b.getLogger().debug("Stop NL2 ");break;case 11:b.getLogger().debug("Stop EOF2 ");break;case 12:b.getLogger().debug("Rule: statement: ",c[g]),typeof c[g].length=="number"?this.$=c[g]:this.$=[c[g]];break;case 13:b.getLogger().debug("Rule: statement #2: ",c[g-1]),this.$=[c[g-1]].concat(c[g]);break;case 14:b.getLogger().debug("Rule: link: ",c[g],N),this.$={edgeTypeStr:c[g],label:""};break;case 15:b.getLogger().debug("Rule: LABEL link: ",c[g-3],c[g-1],c[g]),this.$={edgeTypeStr:c[g],label:c[g-1]};break;case 18:let S=parseInt(c[g]),v=b.generateId();this.$={id:v,type:"space",label:"",width:S,children:[]};break;case 23:b.getLogger().debug("Rule: (nodeStatement link node) ",c[g-2],c[g-1],c[g]," typestr: ",c[g-1].edgeTypeStr);let T=b.edgeStrToEdgeData(c[g-1].edgeTypeStr);this.$=[{id:c[g-2].id,label:c[g-2].label,type:c[g-2].type,directions:c[g-2].directions},{id:c[g-2].id+"-"+c[g].id,start:c[g-2].id,end:c[g].id,label:c[g-1].label,type:"edge",directions:c[g].directions,arrowTypeEnd:T,arrowTypeStart:"arrow_open"},{id:c[g].id,label:c[g].label,type:b.typeStr2Type(c[g].typeStr),directions:c[g].directions}];break;case 24:b.getLogger().debug("Rule: nodeStatement (abc88 node size) ",c[g-1],c[g]),this.$={id:c[g-1].id,label:c[g-1].label,type:b.typeStr2Type(c[g-1].typeStr),directions:c[g-1].directions,widthInColumns:parseInt(c[g],10)};break;case 25:b.getLogger().debug("Rule: nodeStatement (node) ",c[g]),this.$={id:c[g].id,label:c[g].label,type:b.typeStr2Type(c[g].typeStr),directions:c[g].directions,widthInColumns:1};break;case 26:b.getLogger().debug("APA123",this?this:"na"),b.getLogger().debug("COLUMNS: ",c[g]),this.$={type:"column-setting",columns:c[g]==="auto"?-1:parseInt(c[g])};break;case 27:b.getLogger().debug("Rule: id-block statement : ",c[g-2],c[g-1]),b.generateId(),this.$={...c[g-2],type:"composite",children:c[g-1]};break;case 28:b.getLogger().debug("Rule: blockStatement : ",c[g-2],c[g-1],c[g]);let F=b.generateId();this.$={id:F,type:"composite",label:"",children:c[g-1]};break;case 29:b.getLogger().debug("Rule: node (NODE_ID separator): ",c[g]),this.$={id:c[g]};break;case 30:b.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",c[g-1],c[g]),this.$={id:c[g-1],label:c[g].label,typeStr:c[g].typeStr,directions:c[g].directions};break;case 31:b.getLogger().debug("Rule: dirList: ",c[g]),this.$=[c[g]];break;case 32:b.getLogger().debug("Rule: dirList: ",c[g-1],c[g]),this.$=[c[g-1]].concat(c[g]);break;case 33:b.getLogger().debug("Rule: nodeShapeNLabel: ",c[g-2],c[g-1],c[g]),this.$={typeStr:c[g-2]+c[g],label:c[g-1]};break;case 34:b.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",c[g-3],c[g-2]," #3:",c[g-1],c[g]),this.$={typeStr:c[g-3]+c[g],label:c[g-2],directions:c[g-1]};break;case 35:case 36:this.$={type:"classDef",id:c[g-1].trim(),css:c[g].trim()};break;case 37:this.$={type:"applyClass",id:c[g-1].trim(),styleClass:c[g].trim()};break;case 38:this.$={type:"applyStyles",id:c[g-1].trim(),stylesStr:c[g].trim()};break}},"anonymous"),table:[{9:1,10:[1,2]},{1:[3]},{10:t,11:3,13:4,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:s,29:l,31:i,39:r,43:n,46:o},{8:[1,20]},e(x,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,10:t,21:a,28:s,29:l,31:i,39:r,43:n,46:o}),e(d,[2,16],{14:22,15:p,16:m}),e(d,[2,17]),e(d,[2,18]),e(d,[2,19]),e(d,[2,20]),e(d,[2,21]),e(d,[2,22]),e(f,[2,25],{27:[1,25]}),e(d,[2,26]),{19:26,26:12,31:i},{10:t,11:27,13:4,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:s,29:l,31:i,39:r,43:n,46:o},{40:[1,28],42:[1,29]},{44:[1,30]},{47:[1,31]},e(w,[2,29],{32:32,35:[1,33],37:[1,34]}),{1:[2,7]},e(x,[2,13]),{26:35,31:i},{31:[2,14]},{17:[1,36]},e(f,[2,24]),{10:t,11:37,13:4,14:22,15:p,16:m,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:s,29:l,31:i,39:r,43:n,46:o},{30:[1,38]},{41:[1,39]},{41:[1,40]},{45:[1,41]},{48:[1,42]},e(w,[2,30]),{18:[1,43]},{18:[1,44]},e(f,[2,23]),{18:[1,45]},{30:[1,46]},e(d,[2,28]),e(d,[2,35]),e(d,[2,36]),e(d,[2,37]),e(d,[2,38]),{36:[1,47]},{33:48,34:E},{15:[1,50]},e(d,[2,27]),e(w,[2,33]),{38:[1,51]},{33:52,34:E,38:[2,31]},{31:[2,15]},e(w,[2,34]),{38:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:u(function(N,h){if(h.recoverable)this.trace(N);else{var y=new Error(N);throw y.hash=h,y}},"parseError"),parse:u(function(N){var h=this,y=[0],b=[],D=[null],c=[],_=this.table,g="",S=0,v=0,T=0,F=2,W=1,G=c.slice.call(arguments,1),O=Object.create(this.lexer),K={yy:{}};for(var et in this.yy)Object.prototype.hasOwnProperty.call(this.yy,et)&&(K.yy[et]=this.yy[et]);O.setInput(N,K.yy),K.yy.lexer=O,K.yy.parser=this,typeof O.yylloc>"u"&&(O.yylloc={});var rt=O.yylloc;c.push(rt);var he=O.options&&O.options.ranges;typeof K.yy.parseError=="function"?this.parseError=K.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function de(U){y.length=y.length-2*U,D.length=D.length-U,c.length=c.length-U}u(de,"popStack");function It(){var U;return U=b.pop()||O.lex()||W,typeof U!="number"&&(U instanceof Array&&(b=U,U=b.pop()),U=h.symbols_[U]||U),U}u(It,"lex");for(var Y,pt,Q,Z,Qr,xt,tt={},ot,V,Ct,ct;;){if(Q=y[y.length-1],this.defaultActions[Q]?Z=this.defaultActions[Q]:((Y===null||typeof Y>"u")&&(Y=It()),Z=_[Q]&&_[Q][Y]),typeof Z>"u"||!Z.length||!Z[0]){var ft="";ct=[];for(ot in _[Q])this.terminals_[ot]&&ot>F&&ct.push("'"+this.terminals_[ot]+"'");O.showPosition?ft="Parse error on line "+(S+1)+`:
2
+ `+O.showPosition()+`
3
+ Expecting `+ct.join(", ")+", got '"+(this.terminals_[Y]||Y)+"'":ft="Parse error on line "+(S+1)+": Unexpected "+(Y==W?"end of input":"'"+(this.terminals_[Y]||Y)+"'"),this.parseError(ft,{text:O.match,token:this.terminals_[Y]||Y,line:O.yylineno,loc:rt,expected:ct})}if(Z[0]instanceof Array&&Z.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Q+", token: "+Y);switch(Z[0]){case 1:y.push(Y),D.push(O.yytext),c.push(O.yylloc),y.push(Z[1]),Y=null,pt?(Y=pt,pt=null):(v=O.yyleng,g=O.yytext,S=O.yylineno,rt=O.yylloc,T>0);break;case 2:if(V=this.productions_[Z[1]][1],tt.$=D[D.length-V],tt._$={first_line:c[c.length-(V||1)].first_line,last_line:c[c.length-1].last_line,first_column:c[c.length-(V||1)].first_column,last_column:c[c.length-1].last_column},he&&(tt._$.range=[c[c.length-(V||1)].range[0],c[c.length-1].range[1]]),xt=this.performAction.apply(tt,[g,v,S,K.yy,Z[1],D,c].concat(G)),typeof xt<"u")return xt;V&&(y=y.slice(0,-1*V*2),D=D.slice(0,-1*V),c=c.slice(0,-1*V)),y.push(this.productions_[Z[1]][0]),D.push(tt.$),c.push(tt._$),Ct=_[y[y.length-2]][y[y.length-1]],y.push(Ct);break;case 3:return!0}}return!0},"parse")},I=function(){var N={EOF:1,parseError:u(function(h,y){if(this.yy.parser)this.yy.parser.parseError(h,y);else throw new Error(h)},"parseError"),setInput:u(function(h,y){return this.yy=y||this.yy||{},this._input=h,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:u(function(){var h=this._input[0];this.yytext+=h,this.yyleng++,this.offset++,this.match+=h,this.matched+=h;var y=h.match(/(?:\r\n?|\n).*/g);return y?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),h},"input"),unput:u(function(h){var y=h.length,b=h.split(/(?:\r\n?|\n)/g);this._input=h+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-y),this.offset-=y;var D=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),b.length-1&&(this.yylineno-=b.length-1);var c=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:b?(b.length===D.length?this.yylloc.first_column:0)+D[D.length-b.length].length-b[0].length:this.yylloc.first_column-y},this.options.ranges&&(this.yylloc.range=[c[0],c[0]+this.yyleng-y]),this.yyleng=this.yytext.length,this},"unput"),more:u(function(){return this._more=!0,this},"more"),reject:u(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
+ `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:u(function(h){this.unput(this.match.slice(h))},"less"),pastInput:u(function(){var h=this.matched.substr(0,this.matched.length-this.match.length);return(h.length>20?"...":"")+h.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:u(function(){var h=this.match;return h.length<20&&(h+=this._input.substr(0,20-h.length)),(h.substr(0,20)+(h.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:u(function(){var h=this.pastInput(),y=new Array(h.length+1).join("-");return h+this.upcomingInput()+`
5
+ `+y+"^"},"showPosition"),test_match:u(function(h,y){var b,D,c;if(this.options.backtrack_lexer&&(c={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&&(c.yylloc.range=this.yylloc.range.slice(0))),D=h[0].match(/(?:\r\n?|\n).*/g),D&&(this.yylineno+=D.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:D?D[D.length-1].length-D[D.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+h[0].length},this.yytext+=h[0],this.match+=h[0],this.matches=h,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(h[0].length),this.matched+=h[0],b=this.performAction.call(this,this.yy,this,y,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),b)return b;if(this._backtrack){for(var _ in c)this[_]=c[_];return!1}return!1},"test_match"),next:u(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var h,y,b,D;this._more||(this.yytext="",this.match="");for(var c=this._currentRules(),_=0;_<c.length;_++)if(b=this._input.match(this.rules[c[_]]),b&&(!y||b[0].length>y[0].length)){if(y=b,D=_,this.options.backtrack_lexer){if(h=this.test_match(b,c[_]),h!==!1)return h;if(this._backtrack){y=!1;continue}else return!1}else if(!this.options.flex)break}return y?(h=this.test_match(y,c[D]),h!==!1?h:!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:u(function(){var h=this.next();return h||this.lex()},"lex"),begin:u(function(h){this.conditionStack.push(h)},"begin"),popState:u(function(){var h=this.conditionStack.length-1;return h>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:u(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:u(function(h){return h=this.conditionStack.length-1-Math.abs(h||0),h>=0?this.conditionStack[h]:"INITIAL"},"topState"),pushState:u(function(h){this.begin(h)},"pushState"),stateStackSize:u(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:u(function(h,y,b,D){switch(b){case 0:return h.getLogger().debug("Found block-beta"),10;case 1:return h.getLogger().debug("Found id-block"),29;case 2:return h.getLogger().debug("Found block"),10;case 3:h.getLogger().debug(".",y.yytext);break;case 4:h.getLogger().debug("_",y.yytext);break;case 5:return 5;case 6:return y.yytext=-1,28;case 7:return y.yytext=y.yytext.replace(/columns\s+/,""),h.getLogger().debug("COLUMNS (LEX)",y.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:h.getLogger().debug("LEX: POPPING STR:",y.yytext),this.popState();break;case 13:return h.getLogger().debug("LEX: STR end:",y.yytext),"STR";case 14:return y.yytext=y.yytext.replace(/space\:/,""),h.getLogger().debug("SPACE NUM (LEX)",y.yytext),21;case 15:return y.yytext="1",h.getLogger().debug("COLUMNS (LEX)",y.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(),h.getLogger().debug("Lex: (("),"NODE_DEND";case 38:return this.popState(),h.getLogger().debug("Lex: (("),"NODE_DEND";case 39:return this.popState(),h.getLogger().debug("Lex: ))"),"NODE_DEND";case 40:return this.popState(),h.getLogger().debug("Lex: (("),"NODE_DEND";case 41:return this.popState(),h.getLogger().debug("Lex: (("),"NODE_DEND";case 42:return this.popState(),h.getLogger().debug("Lex: (-"),"NODE_DEND";case 43:return this.popState(),h.getLogger().debug("Lex: -)"),"NODE_DEND";case 44:return this.popState(),h.getLogger().debug("Lex: (("),"NODE_DEND";case 45:return this.popState(),h.getLogger().debug("Lex: ]]"),"NODE_DEND";case 46:return this.popState(),h.getLogger().debug("Lex: ("),"NODE_DEND";case 47:return this.popState(),h.getLogger().debug("Lex: ])"),"NODE_DEND";case 48:return this.popState(),h.getLogger().debug("Lex: /]"),"NODE_DEND";case 49:return this.popState(),h.getLogger().debug("Lex: /]"),"NODE_DEND";case 50:return this.popState(),h.getLogger().debug("Lex: )]"),"NODE_DEND";case 51:return this.popState(),h.getLogger().debug("Lex: )"),"NODE_DEND";case 52:return this.popState(),h.getLogger().debug("Lex: ]>"),"NODE_DEND";case 53:return this.popState(),h.getLogger().debug("Lex: ]"),"NODE_DEND";case 54:return h.getLogger().debug("Lexa: -)"),this.pushState("NODE"),35;case 55:return h.getLogger().debug("Lexa: (-"),this.pushState("NODE"),35;case 56:return h.getLogger().debug("Lexa: ))"),this.pushState("NODE"),35;case 57:return h.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 58:return h.getLogger().debug("Lex: ((("),this.pushState("NODE"),35;case 59:return h.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 60:return h.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 61:return h.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 62:return h.getLogger().debug("Lexc: >"),this.pushState("NODE"),35;case 63:return h.getLogger().debug("Lexa: (["),this.pushState("NODE"),35;case 64:return h.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 h.getLogger().debug("Lexa: ["),this.pushState("NODE"),35;case 73:return this.pushState("BLOCK_ARROW"),h.getLogger().debug("LEX ARR START"),37;case 74:return h.getLogger().debug("Lex: NODE_ID",y.yytext),31;case 75:return h.getLogger().debug("Lex: EOF",y.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:h.getLogger().debug("Lex: Starting string"),this.pushState("string");break;case 81:h.getLogger().debug("LEX ARR: Starting string"),this.pushState("string");break;case 82:return h.getLogger().debug("LEX: NODE_DESCR:",y.yytext),"NODE_DESCR";case 83:h.getLogger().debug("LEX POPPING"),this.popState();break;case 84:h.getLogger().debug("Lex: =>BAE"),this.pushState("ARROW_DIR");break;case 85:return y.yytext=y.yytext.replace(/^,\s*/,""),h.getLogger().debug("Lex (right): dir:",y.yytext),"DIR";case 86:return y.yytext=y.yytext.replace(/^,\s*/,""),h.getLogger().debug("Lex (left):",y.yytext),"DIR";case 87:return y.yytext=y.yytext.replace(/^,\s*/,""),h.getLogger().debug("Lex (x):",y.yytext),"DIR";case 88:return y.yytext=y.yytext.replace(/^,\s*/,""),h.getLogger().debug("Lex (y):",y.yytext),"DIR";case 89:return y.yytext=y.yytext.replace(/^,\s*/,""),h.getLogger().debug("Lex (up):",y.yytext),"DIR";case 90:return y.yytext=y.yytext.replace(/^,\s*/,""),h.getLogger().debug("Lex (down):",y.yytext),"DIR";case 91:return y.yytext="]>",h.getLogger().debug("Lex (ARROW_DIR end):",y.yytext),this.popState(),this.popState(),"BLOCK_ARROW_END";case 92:return h.getLogger().debug("Lex: LINK","#"+y.yytext+"#"),15;case 93:return h.getLogger().debug("Lex: LINK",y.yytext),15;case 94:return h.getLogger().debug("Lex: LINK",y.yytext),15;case 95:return h.getLogger().debug("Lex: LINK",y.yytext),15;case 96:return h.getLogger().debug("Lex: START_LINK",y.yytext),this.pushState("LLABEL"),16;case 97:return h.getLogger().debug("Lex: START_LINK",y.yytext),this.pushState("LLABEL"),16;case 98:return h.getLogger().debug("Lex: START_LINK",y.yytext),this.pushState("LLABEL"),16;case 99:this.pushState("md_string");break;case 100:return h.getLogger().debug("Lex: Starting string"),this.pushState("string"),"LINK_LABEL";case 101:return this.popState(),h.getLogger().debug("Lex: LINK","#"+y.yytext+"#"),15;case 102:return this.popState(),h.getLogger().debug("Lex: LINK",y.yytext),15;case 103:return this.popState(),h.getLogger().debug("Lex: LINK",y.yytext),15;case 104:return h.getLogger().debug("Lex: COLON",y.yytext),y.yytext=y.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 N}();L.lexer=I;function $(){this.yy={}}return u($,"Parser"),$.prototype=L,L.Parser=$,new $}();mt.parser=mt;var ve=mt,j=new Map,Et=[],wt=new Map,Rt="color",zt="fill",Ne="bgFill",Ht=",",Te=A(),dt=new Map,Dt="",$e=u(e=>Se.sanitizeText(e,Te),"sanitizeText"),Ie=u(function(e,t=""){let a=dt.get(e);a||(a={id:e,styles:[],textStyles:[]},dt.set(e,a)),t==null||t.split(Ht).forEach(s=>{let l=s.replace(/([^;]*);/,"$1").trim();if(RegExp(Rt).exec(s)){let i=l.replace(zt,Ne).replace(Rt,zt);a.textStyles.push(i)}a.styles.push(l)})},"addStyleClass"),Ce=u(function(e,t=""){let a=j.get(e);t!=null&&(a.styles=t.split(Ht))},"addStyle2Node"),Be=u(function(e,t){e.split(",").forEach(function(a){let s=j.get(a);if(s===void 0){let l=a.trim();s={id:l,type:"na",children:[]},j.set(l,s)}s.classes||(s.classes=[]),s.classes.push(t)})},"setCssClass"),Zt=u((e,t)=>{var i;let a=e.flat(),s=[],l=((i=a.find(r=>(r==null?void 0:r.type)==="column-setting"))==null?void 0:i.columns)??-1;for(let r of a){if(typeof l=="number"&&l>0&&r.type!=="column-setting"&&typeof r.widthInColumns=="number"&&r.widthInColumns>l&&k.warn(`Block ${r.id} width ${r.widthInColumns} exceeds configured column width ${l}`),r.label&&(r.label=$e(r.label)),r.type==="classDef"){Ie(r.id,r.css);continue}if(r.type==="applyClass"){Be(r.id,(r==null?void 0:r.styleClass)??"");continue}if(r.type==="applyStyles"){r!=null&&r.stylesStr&&Ce(r.id,r==null?void 0:r.stylesStr);continue}if(r.type==="column-setting")t.columns=r.columns??-1;else if(r.type==="edge"){let n=(wt.get(r.id)??0)+1;wt.set(r.id,n),r.id=n+"-"+r.id,Et.push(r)}else{r.label||(r.type==="composite"?r.label="":r.label=r.id);let n=j.get(r.id);if(n===void 0?j.set(r.id,r):(r.type!=="na"&&(n.type=r.type),r.label!==r.id&&(n.label=r.label)),r.children&&Zt(r.children,r),r.type==="space"){let o=r.width??1;for(let x=0;x<o;x++){let d=De(r);d.id=d.id+"-"+x,j.set(d.id,d),s.push(d)}}else n===void 0&&s.push(r)}}t.children=s},"populateBlockDatabase"),vt=[],nt={id:"root",type:"composite",children:[],columns:-1},Oe=u(()=>{k.debug("Clear called"),pe(),nt={id:"root",type:"composite",children:[],columns:-1},j=new Map([["root",nt]]),vt=[],dt=new Map,Et=[],wt=new Map,Dt=""},"clear");function qt(e){switch(k.debug("typeStr2Type",e),e){case"[]":return"square";case"()":return k.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"}}u(qt,"typeStr2Type");function jt(e){switch(k.debug("typeStr2Type",e),e){case"==":return"thick";default:return"normal"}}u(jt,"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""}}u(Jt,"edgeStrToEdgeData");var At=0,Re=u(()=>(At++,"id-"+Math.random().toString(36).substr(2,12)+"-"+At),"generateId"),ze=u(e=>{nt.children=e,Zt(e,nt),vt=nt.children},"setHierarchy"),Ae=u(e=>{let t=j.get(e);return t?t.columns?t.columns:t.children?t.children.length:-1:-1},"getColumns"),Me=u(()=>[...j.values()],"getBlocksFlat"),Pe=u(()=>vt||[],"getBlocks"),Ye=u(()=>Et,"getEdges"),Xe=u(e=>j.get(e),"getBlock"),We=u(e=>{j.set(e.id,e)},"setBlock"),Fe=u(e=>{Dt=e},"setDiagramId"),Ke=u(()=>Dt,"getDiagramId"),Ue=u(()=>k,"getLogger"),He=u(function(){return dt},"getClasses"),Ze={getConfig:u(()=>lt().block,"getConfig"),typeStr2Type:qt,edgeTypeStr2Type:jt,edgeStrToEdgeData:Jt,getLogger:Ue,getBlocksFlat:Me,getBlocks:Pe,getEdges:Ye,setHierarchy:ze,getBlock:Xe,setBlock:We,getColumns:Ae,getClasses:He,clear:Oe,generateId:Re,setDiagramId:Fe,getDiagramId:Ke},qe=Ze,bt=u((e,t)=>{let a=fe,s=a(e,"r"),l=a(e,"g"),i=a(e,"b");return xe(s,l,i,t)},"fade"),je=u(e=>`.label {
7
+ font-family: ${e.fontFamily};
8
+ color: ${e.nodeTextColor||e.textColor};
9
+ }
10
+ .cluster-label text {
11
+ fill: ${e.titleColor};
12
+ }
13
+ .cluster-label span,p {
14
+ color: ${e.titleColor};
15
+ }
16
+
17
+
18
+
19
+ .label text,span,p {
20
+ fill: ${e.nodeTextColor||e.textColor};
21
+ color: ${e.nodeTextColor||e.textColor};
22
+ }
23
+
24
+ .node rect,
25
+ .node circle,
26
+ .node ellipse,
27
+ .node polygon,
28
+ .node path {
29
+ fill: ${e.mainBkg};
30
+ stroke: ${e.nodeBorder};
31
+ stroke-width: 1px;
32
+ }
33
+ .flowchart-label text {
34
+ text-anchor: middle;
35
+ }
36
+ // .flowchart-label .text-outer-tspan {
37
+ // text-anchor: middle;
38
+ // }
39
+ // .flowchart-label .text-inner-tspan {
40
+ // text-anchor: start;
41
+ // }
42
+
43
+ .node .label {
44
+ text-align: center;
45
+ }
46
+ .node.clickable {
47
+ cursor: pointer;
48
+ }
49
+
50
+ .arrowheadPath {
51
+ fill: ${e.arrowheadColor};
52
+ }
53
+
54
+ .edgePath .path {
55
+ stroke: ${e.lineColor};
56
+ stroke-width: 2.0px;
57
+ }
58
+
59
+ .flowchart-link {
60
+ stroke: ${e.lineColor};
61
+ fill: none;
62
+ }
63
+
64
+ .edgeLabel {
65
+ background-color: ${e.edgeLabelBackground};
66
+ /*
67
+ * This is for backward compatibility with existing code that didn't
68
+ * add a \`<p>\` around edge labels.
69
+ *
70
+ * TODO: We should probably remove this in a future release.
71
+ */
72
+ p {
73
+ margin: 0;
74
+ padding: 0;
75
+ display: inline;
76
+ }
77
+ rect {
78
+ opacity: 0.5;
79
+ background-color: ${e.edgeLabelBackground};
80
+ fill: ${e.edgeLabelBackground};
81
+ }
82
+ text-align: center;
83
+ }
84
+
85
+ /* For html labels only */
86
+ .labelBkg {
87
+ background-color: ${e.edgeLabelBackground};
88
+ }
89
+
90
+ .node .cluster {
91
+ // fill: ${bt(e.mainBkg,.5)};
92
+ fill: ${bt(e.clusterBkg,.5)};
93
+ stroke: ${bt(e.clusterBorder,.2)};
94
+ box-shadow: rgba(50, 50, 93, 0.25) 0px 13px 27px -5px, rgba(0, 0, 0, 0.3) 0px 8px 16px -8px;
95
+ stroke-width: 1px;
96
+ }
97
+
98
+ .cluster text {
99
+ fill: ${e.titleColor};
100
+ }
101
+
102
+ .cluster span,p {
103
+ color: ${e.titleColor};
104
+ }
105
+ /* .cluster div {
106
+ color: ${e.titleColor};
107
+ } */
108
+
109
+ div.mermaidTooltip {
110
+ position: absolute;
111
+ text-align: center;
112
+ max-width: 200px;
113
+ padding: 2px;
114
+ font-family: ${e.fontFamily};
115
+ font-size: 12px;
116
+ background: ${e.tertiaryColor};
117
+ border: 1px solid ${e.border2};
118
+ border-radius: 2px;
119
+ pointer-events: none;
120
+ z-index: 100;
121
+ }
122
+
123
+ .flowchartTitleText {
124
+ text-anchor: middle;
125
+ font-size: 18px;
126
+ fill: ${e.textColor};
127
+ }
128
+ ${ue()}
129
+ `,"getStyles"),Je=je,Ve=u((e,t,a,s)=>{t.forEach(l=>{lr[l](e,a,s)})},"insertMarkers"),Ge=u((e,t,a)=>{k.trace("Making markers for ",a),e.append("defs").append("marker").attr("id",a+"_"+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",a+"_"+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"),Qe=u((e,t,a)=>{e.append("defs").append("marker").attr("id",a+"_"+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",a+"_"+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"),tr=u((e,t,a)=>{e.append("defs").append("marker").attr("id",a+"_"+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",a+"_"+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"),er=u((e,t,a)=>{e.append("defs").append("marker").attr("id",a+"_"+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",a+"_"+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"),rr=u((e,t,a)=>{e.append("defs").append("marker").attr("id",a+"_"+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",a+"_"+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"),ar=u((e,t,a)=>{e.append("marker").attr("id",a+"_"+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",a+"_"+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"),ir=u((e,t,a)=>{e.append("marker").attr("id",a+"_"+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",a+"_"+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"),sr=u((e,t,a)=>{e.append("marker").attr("id",a+"_"+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",a+"_"+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"),nr=u((e,t,a)=>{e.append("defs").append("marker").attr("id",a+"_"+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"),lr={extension:Ge,composition:Qe,aggregation:tr,dependency:er,lollipop:rr,point:ar,circle:ir,cross:sr,barb:nr},or=Ve,Kt,Ut,z=((Ut=(Kt=A())==null?void 0:Kt.block)==null?void 0:Ut.padding)??8;function kt(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};let a=t%e,s=Math.floor(t/e);return{px:a,py:s}}u(kt,"calculateBlockPosition");var cr=u(e=>{let t=0,a=0;for(let s of e.children){let{width:l,height:i,x:r,y:n}=s.size??{width:0,height:0,x:0,y:0};k.debug("getMaxChildSize abc95 child:",s.id,"width:",l,"height:",i,"x:",r,"y:",n,s.type),s.type!=="space"&&(l>t&&(t=l/(s.widthInColumns??1)),i>a&&(a=i))}return{width:t,height:a}},"getMaxChildSize");function gt(e,t,a=0,s=0){var r,n,o,x,d,p,m,f,w,E,L;k.debug("setBlockSizes abc95 (start)",e.id,(r=e==null?void 0:e.size)==null?void 0:r.x,"block width =",e==null?void 0:e.size,"siblingWidth",a),(n=e==null?void 0:e.size)!=null&&n.width||(e.size={width:a,height:s,x:0,y:0});let l=0,i=0;if(((o=e.children)==null?void 0:o.length)>0){for(let c of e.children)gt(c,t);let I=cr(e);l=I.width,i=I.height,k.debug("setBlockSizes abc95 maxWidth of",e.id,":s children is ",l,i);for(let c of e.children)c.size&&(k.debug(`abc95 Setting size of children of ${e.id} id=${c.id} ${l} ${i} ${JSON.stringify(c.size)}`),c.size.width=l*(c.widthInColumns??1)+z*((c.widthInColumns??1)-1),c.size.height=i,c.size.x=0,c.size.y=0,k.debug(`abc95 updating size of ${e.id} children child:${c.id} maxWidth:${l} maxHeight:${i}`));for(let c of e.children)gt(c,t,l,i);let $=e.columns??-1,N=0;for(let c of e.children)N+=c.widthInColumns??1;let h=e.children.length;$>0&&$<N&&(h=$);let y=Math.ceil(N/h),b=h*(l+z)+z,D=y*(i+z)+z;if(b<a){k.debug(`Detected to small sibling: abc95 ${e.id} siblingWidth ${a} siblingHeight ${s} width ${b}`),b=a,D=s;let c=(a-h*z-z)/h,_=(s-y*z-z)/y;k.debug("Size indata abc88",e.id,"childWidth",c,"maxWidth",l),k.debug("Size indata abc88",e.id,"childHeight",_,"maxHeight",i),k.debug("Size indata abc88 xSize",h,"padding",z);for(let g of e.children)g.size&&(g.size.width=c,g.size.height=_,g.size.x=0,g.size.y=0)}if(k.debug(`abc95 (finale calc) ${e.id} xSize ${h} ySize ${y} columns ${$}${e.children.length} width=${Math.max(b,((x=e.size)==null?void 0:x.width)||0)}`),b<(((d=e==null?void 0:e.size)==null?void 0:d.width)||0)){b=((p=e==null?void 0:e.size)==null?void 0:p.width)||0;let c=$>0?Math.min(e.children.length,$):e.children.length;if(c>0){let _=(b-c*z-z)/c;k.debug("abc95 (growing to fit) width",e.id,b,(m=e.size)==null?void 0:m.width,_);for(let g of e.children)g.size&&(g.size.width=_)}}e.size={width:b,height:D,x:0,y:0}}k.debug("setBlockSizes abc94 (done)",e.id,(f=e==null?void 0:e.size)==null?void 0:f.x,(w=e==null?void 0:e.size)==null?void 0:w.width,(E=e==null?void 0:e.size)==null?void 0:E.y,(L=e==null?void 0:e.size)==null?void 0:L.height)}u(gt,"setBlockSizes");function Nt(e,t){var s,l,i,r,n,o,x,d,p,m,f,w,E,L,I,$,N;k.debug(`abc85 layout blocks (=>layoutBlocks) ${e.id} x: ${(s=e==null?void 0:e.size)==null?void 0:s.x} y: ${(l=e==null?void 0:e.size)==null?void 0:l.y} width: ${(i=e==null?void 0:e.size)==null?void 0:i.width}`);let a=e.columns??-1;if(k.debug("layoutBlocks columns abc95",e.id,"=>",a,e),e.children&&e.children.length>0){let h=((n=(r=e==null?void 0:e.children[0])==null?void 0:r.size)==null?void 0:n.width)??0,y=e.children.length*h+(e.children.length-1)*z;k.debug("widthOfChildren 88",y,"posX");let b=new Map;{let S=0;for(let v of e.children){if(!v.size)continue;let{py:T}=kt(a,S),F=b.get(T)??0;v.size.height>F&&b.set(T,v.size.height);let W=(v==null?void 0:v.widthInColumns)??1;a>0&&(W=Math.min(W,a-S%a)),S+=W}}let D=new Map;{let S=0,v=[...b.keys()].sort((T,F)=>T-F);for(let T of v)D.set(T,S),S+=(b.get(T)??0)+z}let c=0;k.debug("abc91 block?.size?.x",e.id,(o=e==null?void 0:e.size)==null?void 0:o.x);let _=(x=e==null?void 0:e.size)!=null&&x.x?((d=e==null?void 0:e.size)==null?void 0:d.x)+(-((p=e==null?void 0:e.size)==null?void 0:p.width)/2||0):-z,g=0;for(let S of e.children){let v=e;if(!S.size)continue;let{width:T,height:F}=S.size,{px:W,py:G}=kt(a,c);if(G!=g&&(g=G,_=(m=e==null?void 0:e.size)!=null&&m.x?((f=e==null?void 0:e.size)==null?void 0:f.x)+(-((w=e==null?void 0:e.size)==null?void 0:w.width)/2||0):-z,k.debug("New row in layout for block",e.id," and child ",S.id,g)),k.debug(`abc89 layout blocks (child) id: ${S.id} Pos: ${c} (px, py) ${W},${G} (${(E=v==null?void 0:v.size)==null?void 0:E.x},${(L=v==null?void 0:v.size)==null?void 0:L.y}) parent: ${v.id} width: ${T}${z}`),v.size){let K=T/2;S.size.x=_+z+K,k.debug(`abc91 layout blocks (calc) px, pyid:${S.id} startingPos=X${_} new startingPosX${S.size.x} ${K} padding=${z} width=${T} halfWidth=${K} => x:${S.size.x} y:${S.size.y} ${S.widthInColumns} (width * (child?.w || 1)) / 2 ${T*((S==null?void 0:S.widthInColumns)??1)/2}`),_=S.size.x+K;let et=D.get(G)??0,rt=b.get(G)??F;S.size.y=v.size.y-v.size.height/2+et+rt/2+z,k.debug(`abc88 layout blocks (calc) px, pyid:${S.id}startingPosX${_}${z}${K}=>x:${S.size.x}y:${S.size.y}${S.widthInColumns}(width * (child?.w || 1)) / 2${T*((S==null?void 0:S.widthInColumns)??1)/2}`)}S.children&&Nt(S);let O=(S==null?void 0:S.widthInColumns)??1;a>0&&(O=Math.min(O,a-c%a)),c+=O,k.debug("abc88 columnsPos",S,c)}}k.debug(`layout blocks (<==layoutBlocks) ${e.id} x: ${(I=e==null?void 0:e.size)==null?void 0:I.x} y: ${($=e==null?void 0:e.size)==null?void 0:$.y} width: ${(N=e==null?void 0:e.size)==null?void 0:N.width}`)}u(Nt,"layoutBlocks");function Tt(e,{minX:t,minY:a,maxX:s,maxY:l}={minX:0,minY:0,maxX:0,maxY:0}){if(e.size&&e.id!=="root"){let{x:i,y:r,width:n,height:o}=e.size;i-n/2<t&&(t=i-n/2),r-o/2<a&&(a=r-o/2),i+n/2>s&&(s=i+n/2),r+o/2>l&&(l=r+o/2)}if(e.children)for(let i of e.children)({minX:t,minY:a,maxX:s,maxY:l}=Tt(i,{minX:t,minY:a,maxX:s,maxY:l}));return{minX:t,minY:a,maxX:s,maxY:l}}u(Tt,"findBounds");function Vt(e){let t=e.getBlock("root");if(!t)return;gt(t,e,0,0),Nt(t),k.debug("getBlocks",JSON.stringify(t,null,2));let{minX:a,minY:s,maxX:l,maxY:i}=Tt(t),r=i-s,n=l-a;return{x:a,y:s,width:n,height:r}}u(Vt,"layout");var hr=u(async(e,t,a,s=!1,l=!1)=>{let i=t||"";typeof i=="object"&&(i=i[0]);let r=A(),n=X(r);return await _t(e,i,{style:a,isTitle:s,useHtmlLabels:n,markdown:!1,isNode:l,width:Number.POSITIVE_INFINITY},r)},"createLabel"),q=hr,dr=u((e,t,a,s,l)=>{t.arrowTypeStart&&Mt(e,"start",t.arrowTypeStart,a,s,l),t.arrowTypeEnd&&Mt(e,"end",t.arrowTypeEnd,a,s,l)},"addEdgeMarkers"),gr={arrow_cross:"cross",arrow_point:"point",arrow_barb:"barb",arrow_circle:"circle",aggregation:"aggregation",extension:"extension",composition:"composition",dependency:"dependency",lollipop:"lollipop"},Mt=u((e,t,a,s,l,i)=>{let r=gr[a];if(!r){k.warn(`Unknown arrow type: ${a}`);return}let n=t==="start"?"Start":"End";e.attr(`marker-${t}`,`url(${s}#${l}_${i}-${r}${n})`)},"addEdgeMarker"),Lt={},P={},ur=u(async(e,t)=>{let a=A(),s=X(a),l=e.insert("g").attr("class","edgeLabel"),i=l.insert("g").attr("class","label"),r=t.labelType==="markdown",n=await _t(e,t.label,{style:t.labelStyle,useHtmlLabels:s,addSvgBackground:r,isNode:!1,markdown:r,width:r?void 0:Number.POSITIVE_INFINITY},a);i.node().appendChild(n);let o=n.getBBox(),x=o;if(s){let p=n.children[0],m=C(n);o=p.getBoundingClientRect(),x=o,m.attr("width",o.width),m.attr("height",o.height)}else{let p=C(n).select("text").node();p&&typeof p.getBBox=="function"&&(x=p.getBBox())}i.attr("transform",at(x,s)),Lt[t.id]=l,t.width=o.width,t.height=o.height;let d;if(t.startLabelLeft){let p=e.insert("g").attr("class","edgeTerminals"),m=p.insert("g").attr("class","inner"),f=await q(m,t.startLabelLeft,t.labelStyle);d=f;let w=f.getBBox();if(s){let E=f.children[0],L=C(f);w=E.getBoundingClientRect(),L.attr("width",w.width),L.attr("height",w.height)}m.attr("transform",at(w,s)),P[t.id]||(P[t.id]={}),P[t.id].startLeft=p,st(d,t.startLabelLeft)}if(t.startLabelRight){let p=e.insert("g").attr("class","edgeTerminals"),m=p.insert("g").attr("class","inner"),f=await q(p,t.startLabelRight,t.labelStyle);d=f,m.node().appendChild(f);let w=f.getBBox();if(s){let E=f.children[0],L=C(f);w=E.getBoundingClientRect(),L.attr("width",w.width),L.attr("height",w.height)}m.attr("transform",at(w,s)),P[t.id]||(P[t.id]={}),P[t.id].startRight=p,st(d,t.startLabelRight)}if(t.endLabelLeft){let p=e.insert("g").attr("class","edgeTerminals"),m=p.insert("g").attr("class","inner"),f=await q(m,t.endLabelLeft,t.labelStyle);d=f;let w=f.getBBox();if(s){let E=f.children[0],L=C(f);w=E.getBoundingClientRect(),L.attr("width",w.width),L.attr("height",w.height)}m.attr("transform",at(w,s)),p.node().appendChild(f),P[t.id]||(P[t.id]={}),P[t.id].endLeft=p,st(d,t.endLabelLeft)}if(t.endLabelRight){let p=e.insert("g").attr("class","edgeTerminals"),m=p.insert("g").attr("class","inner"),f=await q(m,t.endLabelRight,t.labelStyle);d=f;let w=f.getBBox();if(s){let E=f.children[0],L=C(f);w=E.getBoundingClientRect(),L.attr("width",w.width),L.attr("height",w.height)}m.attr("transform",at(w,s)),p.node().appendChild(f),P[t.id]||(P[t.id]={}),P[t.id].endRight=p,st(d,t.endLabelRight)}return n},"insertEdgeLabel");function st(e,t){X(A())&&e&&(e.style.width=t.length*9+"px",e.style.height="12px")}u(st,"setTerminalWidth");var yr=u((e,t)=>{k.debug("Moving label abc88 ",e.id,e.label,Lt[e.id],t);let a=t.updatedPath?t.updatedPath:t.originalPath,s=A(),{subGraphTitleTotalMargin:l}=Le(s);if(e.label){let i=Lt[e.id],r=e.x,n=e.y;if(a){let o=it.calcLabelPosition(a);k.debug("Moving label "+e.label+" from (",r,",",n,") to (",o.x,",",o.y,") abc88"),t.updatedPath&&(r=o.x,n=o.y)}i.attr("transform",`translate(${r}, ${n+l/2})`)}if(e.startLabelLeft){let i=P[e.id].startLeft,r=e.x,n=e.y;if(a){let o=it.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_left",a);r=o.x,n=o.y}i.attr("transform",`translate(${r}, ${n})`)}if(e.startLabelRight){let i=P[e.id].startRight,r=e.x,n=e.y;if(a){let o=it.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_right",a);r=o.x,n=o.y}i.attr("transform",`translate(${r}, ${n})`)}if(e.endLabelLeft){let i=P[e.id].endLeft,r=e.x,n=e.y;if(a){let o=it.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_left",a);r=o.x,n=o.y}i.attr("transform",`translate(${r}, ${n})`)}if(e.endLabelRight){let i=P[e.id].endRight,r=e.x,n=e.y;if(a){let o=it.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_right",a);r=o.x,n=o.y}i.attr("transform",`translate(${r}, ${n})`)}},"positionEdgeLabel"),pr=u((e,t)=>{let a=e.x,s=e.y,l=Math.abs(t.x-a),i=Math.abs(t.y-s),r=e.width/2,n=e.height/2;return l>=r||i>=n},"outsideNode"),xr=u((e,t,a)=>{k.debug(`intersection calc abc89:
130
+ outsidePoint: ${JSON.stringify(t)}
131
+ insidePoint : ${JSON.stringify(a)}
132
+ node : x:${e.x} y:${e.y} w:${e.width} h:${e.height}`);let s=e.x,l=e.y,i=Math.abs(s-a.x),r=e.width/2,n=a.x<t.x?r-i:r+i,o=e.height/2,x=Math.abs(t.y-a.y),d=Math.abs(t.x-a.x);if(Math.abs(l-t.y)*r>Math.abs(s-t.x)*o){let p=a.y<t.y?t.y-o-l:l-o-t.y;n=d*p/x;let m={x:a.x<t.x?a.x+n:a.x-d+n,y:a.y<t.y?a.y+x-p:a.y-x+p};return n===0&&(m.x=t.x,m.y=t.y),d===0&&(m.x=t.x),x===0&&(m.y=t.y),k.debug(`abc89 topp/bott calc, Q ${x}, q ${p}, R ${d}, r ${n}`,m),m}else{a.x<t.x?n=t.x-r-s:n=s-r-t.x;let p=x*n/d,m=a.x<t.x?a.x+d-n:a.x-d+n,f=a.y<t.y?a.y+p:a.y-p;return k.debug(`sides calc abc89, Q ${x}, q ${p}, R ${d}, r ${n}`,{_x:m,_y:f}),n===0&&(m=t.x,f=t.y),d===0&&(m=t.x),x===0&&(f=t.y),{x:m,y:f}}},"intersection"),Pt=u((e,t)=>{k.debug("abc88 cutPathAtIntersect",e,t);let a=[],s=e[0],l=!1;return e.forEach(i=>{if(!pr(t,i)&&!l){let r=xr(t,s,i),n=!1;a.forEach(o=>{n=n||o.x===r.x&&o.y===r.y}),a.some(o=>o.x===r.x&&o.y===r.y)||a.push(r),l=!0}else s=i,l||a.push(i)}),a},"cutPathAtIntersect"),fr=u(function(e,t,a,s,l,i,r){let n=a.points;k.debug("abc88 InsertEdge: edge=",a,"e=",t);let o=!1,x=i.node(t.v);var d=i.node(t.w);d!=null&&d.intersect&&(x!=null&&x.intersect)&&(n=n.slice(1,a.points.length-1),n.unshift(x.intersect(n[0])),n.push(d.intersect(n[n.length-1]))),a.toCluster&&(k.debug("to cluster abc88",s[a.toCluster]),n=Pt(a.points,s[a.toCluster].node),o=!0),a.fromCluster&&(k.debug("from cluster abc88",s[a.fromCluster]),n=Pt(n.reverse(),s[a.fromCluster].node).reverse(),o=!0);let p=n.filter(h=>!Number.isNaN(h.y)),m=we;a.curve&&(l==="graph"||l==="flowchart")&&(m=a.curve);let{x:f,y:w}=be(a),E=me().x(f).y(w).curve(m),L;switch(a.thickness){case"normal":L="edge-thickness-normal";break;case"thick":L="edge-thickness-thick";break;case"invisible":L="edge-thickness-thick";break;default:L=""}switch(a.pattern){case"solid":L+=" edge-pattern-solid";break;case"dotted":L+=" edge-pattern-dotted";break;case"dashed":L+=" edge-pattern-dashed";break}let I=e.append("path").attr("d",E(p)).attr("id",a.id).attr("class"," "+L+(a.classes?" "+a.classes:"")).attr("style",a.style),$="";(A().flowchart.arrowMarkerAbsolute||A().state.arrowMarkerAbsolute)&&($=ke(!0)),dr(I,a,$,r,l);let N={};return o&&(N.updatedPath=n),N.originalPath=a.points,N},"insertEdge"),br=u(e=>{let t=new Set;for(let a of e)switch(a){case"x":t.add("right"),t.add("left");break;case"y":t.add("up"),t.add("down");break;default:t.add(a);break}return t},"expandAndDeduplicateDirections"),mr=u((e,t,a)=>{let s=br(e),l=2,i=t.height+2*a.padding,r=i/l,n=t.width+2*r+a.padding,o=a.padding/2;return s.has("right")&&s.has("left")&&s.has("up")&&s.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:-i/3},{x:n+2*o,y:-i/2},{x:n,y:-2*i/3},{x:n,y:-i},{x:n-r,y:-i},{x:n/2,y:-i-2*o},{x:r,y:-i},{x:0,y:-i},{x:0,y:-2*i/3},{x:-2*o,y:-i/2},{x:0,y:-i/3}]:s.has("right")&&s.has("left")&&s.has("up")?[{x:r,y:0},{x:n-r,y:0},{x:n,y:-i/2},{x:n-r,y:-i},{x:r,y:-i},{x:0,y:-i/2}]:s.has("right")&&s.has("left")&&s.has("down")?[{x:0,y:0},{x:r,y:-i},{x:n-r,y:-i},{x:n,y:0}]:s.has("right")&&s.has("up")&&s.has("down")?[{x:0,y:0},{x:n,y:-r},{x:n,y:-i+r},{x:0,y:-i}]:s.has("left")&&s.has("up")&&s.has("down")?[{x:n,y:0},{x:0,y:-r},{x:0,y:-i+r},{x:n,y:-i}]:s.has("right")&&s.has("left")?[{x:r,y:0},{x:r,y:-o},{x:n-r,y:-o},{x:n-r,y:0},{x:n,y:-i/2},{x:n-r,y:-i},{x:n-r,y:-i+o},{x:r,y:-i+o},{x:r,y:-i},{x:0,y:-i/2}]:s.has("up")&&s.has("down")?[{x:n/2,y:0},{x:0,y:-o},{x:r,y:-o},{x:r,y:-i+o},{x:0,y:-i+o},{x:n/2,y:-i},{x:n,y:-i+o},{x:n-r,y:-i+o},{x:n-r,y:-o},{x:n,y:-o}]:s.has("right")&&s.has("up")?[{x:0,y:0},{x:n,y:-r},{x:0,y:-i}]:s.has("right")&&s.has("down")?[{x:0,y:0},{x:n,y:0},{x:0,y:-i}]:s.has("left")&&s.has("up")?[{x:n,y:0},{x:0,y:-r},{x:n,y:-i}]:s.has("left")&&s.has("down")?[{x:n,y:0},{x:0,y:0},{x:n,y:-i}]:s.has("right")?[{x:r,y:-o},{x:r,y:-o},{x:n-r,y:-o},{x:n-r,y:0},{x:n,y:-i/2},{x:n-r,y:-i},{x:n-r,y:-i+o},{x:r,y:-i+o},{x:r,y:-i+o}]:s.has("left")?[{x:r,y:0},{x:r,y:-o},{x:n-r,y:-o},{x:n-r,y:-i+o},{x:r,y:-i+o},{x:r,y:-i},{x:0,y:-i/2}]:s.has("up")?[{x:r,y:-o},{x:r,y:-i+o},{x:0,y:-i+o},{x:n/2,y:-i},{x:n,y:-i+o},{x:n-r,y:-i+o},{x:n-r,y:-o}]:s.has("down")?[{x:n/2,y:0},{x:0,y:-o},{x:r,y:-o},{x:r,y:-i+o},{x:n-r,y:-i+o},{x:n-r,y:-o},{x:n,y:-o}]:[{x:0,y:0}]},"getArrowPoints");function Gt(e,t){return e.intersect(t)}u(Gt,"intersectNode");var wr=Gt;function Qt(e,t,a,s){var l=e.x,i=e.y,r=l-s.x,n=i-s.y,o=Math.sqrt(t*t*n*n+a*a*r*r),x=Math.abs(t*a*r/o);s.x<l&&(x=-x);var d=Math.abs(t*a*n/o);return s.y<i&&(d=-d),{x:l+x,y:i+d}}u(Qt,"intersectEllipse");var te=Qt;function ee(e,t,a){return te(e,t,t,a)}u(ee,"intersectCircle");var kr=ee;function re(e,t,a,s){var l,i,r,n,o,x,d,p,m,f,w,E,L,I,$;if(l=t.y-e.y,r=e.x-t.x,o=t.x*e.y-e.x*t.y,m=l*a.x+r*a.y+o,f=l*s.x+r*s.y+o,!(m!==0&&f!==0&&St(m,f))&&(i=s.y-a.y,n=a.x-s.x,x=s.x*a.y-a.x*s.y,d=i*e.x+n*e.y+x,p=i*t.x+n*t.y+x,!(d!==0&&p!==0&&St(d,p))&&(w=l*n-i*r,w!==0)))return E=Math.abs(w/2),L=r*x-n*o,I=L<0?(L-E)/w:(L+E)/w,L=i*o-l*x,$=L<0?(L-E)/w:(L+E)/w,{x:I,y:$}}u(re,"intersectLine");function St(e,t){return e*t>0}u(St,"sameSign");var Lr=re,Sr=ae;function ae(e,t,a){var s=e.x,l=e.y,i=[],r=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY;typeof t.forEach=="function"?t.forEach(function(w){r=Math.min(r,w.x),n=Math.min(n,w.y)}):(r=Math.min(r,t.x),n=Math.min(n,t.y));for(var o=s-e.width/2-r,x=l-e.height/2-n,d=0;d<t.length;d++){var p=t[d],m=t[d<t.length-1?d+1:0],f=Lr(e,a,{x:o+p.x,y:x+p.y},{x:o+m.x,y:x+m.y});f&&i.push(f)}return i.length?(i.length>1&&i.sort(function(w,E){var L=w.x-a.x,I=w.y-a.y,$=Math.sqrt(L*L+I*I),N=E.x-a.x,h=E.y-a.y,y=Math.sqrt(N*N+h*h);return $<y?-1:$===y?0:1}),i[0]):e}u(ae,"intersectPolygon");var _r=u((e,t)=>{var a=e.x,s=e.y,l=t.x-a,i=t.y-s,r=e.width/2,n=e.height/2,o,x;return Math.abs(i)*r>Math.abs(l)*n?(i<0&&(n=-n),o=i===0?0:n*l/i,x=n):(l<0&&(r=-r),o=r,x=l===0?0:r*i/l),{x:a+o,y:s+x}},"intersectRect"),Er=_r,B={node:wr,circle:kr,ellipse:te,polygon:Sr,rect:Er},M=u(async(e,t,a,s)=>{let l=A(),i,r=t.useHtmlLabels||X(l);a?i=a:i="node default";let n=e.insert("g").attr("class",i).attr("id",t.domId||t.id),o=n.insert("g").attr("class","label").attr("style",t.labelStyle),x;t.labelText===void 0?x="":x=typeof t.labelText=="string"?t.labelText:t.labelText[0];let d;t.labelType==="markdown"?d=_t(o,Bt(Ot(x),l),{useHtmlLabels:r,width:t.width||l.flowchart.wrappingWidth,classes:"markdown-node-label"},l):d=await q(o,Bt(Ot(x),l),t.labelStyle,!1,s);let p=d.getBBox(),m=t.padding/2;if(X(l)){let f=d.children[0],w=C(d);await _e(f,x),p=f.getBoundingClientRect(),w.attr("width",p.width),w.attr("height",p.height)}return r?o.attr("transform","translate("+-p.width/2+", "+-p.height/2+")"):o.attr("transform","translate(0, "+-p.height/2+")"),t.centerLabel&&o.attr("transform","translate("+-p.width/2+", "+-p.height/2+")"),o.insert("rect",":first-child"),{shapeSvg:n,bbox:p,halfPadding:m,label:o}},"labelHelper"),R=u((e,t)=>{let a=t.node().getBBox();e.width=a.width,e.height=a.height},"updateNodeBounds");function J(e,t,a,s){return e.insert("polygon",":first-child").attr("points",s.map(function(l){return l.x+","+l.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-t/2+","+a/2+")")}u(J,"insertPolygonShape");var Dr=u(async(e,t)=>{t.useHtmlLabels||X(A())||(t.centerLabel=!0);let{shapeSvg:a,bbox:s,halfPadding:l}=await M(e,t,"node "+t.classes,!0);k.info("Classes = ",t.classes);let i=a.insert("rect",":first-child");return i.attr("rx",t.rx).attr("ry",t.ry).attr("x",-s.width/2-l).attr("y",-s.height/2-l).attr("width",s.width+t.padding).attr("height",s.height+t.padding),R(t,i),t.intersect=function(r){return B.rect(t,r)},a},"note"),vr=Dr,Yt=u(e=>e?" "+e:"","formatClass"),H=u((e,t)=>`${t||"node default"}${Yt(e.classes)} ${Yt(e.class)}`,"getClassesFromNode"),Xt=u(async(e,t)=>{let{shapeSvg:a,bbox:s}=await M(e,t,H(t,void 0),!0),l=s.width+t.padding,i=s.height+t.padding,r=l+i,n=[{x:r/2,y:0},{x:r,y:-r/2},{x:r/2,y:-r},{x:0,y:-r/2}];k.info("Question main (Circle)");let o=J(a,r,r,n);return o.attr("style",t.style),R(t,o),t.intersect=function(x){return k.warn("Intersect called"),B.polygon(t,n,x)},a},"question"),Nr=u((e,t)=>{let a=e.insert("g").attr("class","node default").attr("id",t.domId||t.id),s=28,l=[{x:0,y:s/2},{x:s/2,y:0},{x:0,y:-s/2},{x:-s/2,y:0}];return a.insert("polygon",":first-child").attr("points",l.map(function(i){return i.x+","+i.y}).join(" ")).attr("class","state-start").attr("r",7).attr("width",28).attr("height",28),t.width=28,t.height=28,t.intersect=function(i){return B.circle(t,14,i)},a},"choice"),Tr=u(async(e,t)=>{let{shapeSvg:a,bbox:s}=await M(e,t,H(t,void 0),!0),l=4,i=s.height+t.padding,r=i/l,n=s.width+2*r+t.padding,o=[{x:r,y:0},{x:n-r,y:0},{x:n,y:-i/2},{x:n-r,y:-i},{x:r,y:-i},{x:0,y:-i/2}],x=J(a,n,i,o);return x.attr("style",t.style),R(t,x),t.intersect=function(d){return B.polygon(t,o,d)},a},"hexagon"),$r=u(async(e,t)=>{let{shapeSvg:a,bbox:s}=await M(e,t,void 0,!0),l=2,i=s.height+2*t.padding,r=i/l,n=s.width+2*r+t.padding,o=mr(t.directions,s,t),x=J(a,n,i,o);return x.attr("style",t.style),R(t,x),t.intersect=function(d){return B.polygon(t,o,d)},a},"block_arrow"),Ir=u(async(e,t)=>{let{shapeSvg:a,bbox:s}=await M(e,t,H(t,void 0),!0),l=s.width+t.padding,i=s.height+t.padding,r=[{x:-i/2,y:0},{x:l,y:0},{x:l,y:-i},{x:-i/2,y:-i},{x:0,y:-i/2}];return J(a,l,i,r).attr("style",t.style),t.width=l+i,t.height=i,t.intersect=function(n){return B.polygon(t,r,n)},a},"rect_left_inv_arrow"),Cr=u(async(e,t)=>{let{shapeSvg:a,bbox:s}=await M(e,t,H(t),!0),l=s.width+t.padding,i=s.height+t.padding,r=[{x:-2*i/6,y:0},{x:l-i/6,y:0},{x:l+2*i/6,y:-i},{x:i/6,y:-i}],n=J(a,l,i,r);return n.attr("style",t.style),R(t,n),t.intersect=function(o){return B.polygon(t,r,o)},a},"lean_right"),Br=u(async(e,t)=>{let{shapeSvg:a,bbox:s}=await M(e,t,H(t,void 0),!0),l=s.width+t.padding,i=s.height+t.padding,r=[{x:2*i/6,y:0},{x:l+i/6,y:0},{x:l-2*i/6,y:-i},{x:-i/6,y:-i}],n=J(a,l,i,r);return n.attr("style",t.style),R(t,n),t.intersect=function(o){return B.polygon(t,r,o)},a},"lean_left"),Or=u(async(e,t)=>{let{shapeSvg:a,bbox:s}=await M(e,t,H(t,void 0),!0),l=s.width+t.padding,i=s.height+t.padding,r=[{x:-2*i/6,y:0},{x:l+2*i/6,y:0},{x:l-i/6,y:-i},{x:i/6,y:-i}],n=J(a,l,i,r);return n.attr("style",t.style),R(t,n),t.intersect=function(o){return B.polygon(t,r,o)},a},"trapezoid"),Rr=u(async(e,t)=>{let{shapeSvg:a,bbox:s}=await M(e,t,H(t,void 0),!0),l=s.width+t.padding,i=s.height+t.padding,r=[{x:i/6,y:0},{x:l-i/6,y:0},{x:l+2*i/6,y:-i},{x:-2*i/6,y:-i}],n=J(a,l,i,r);return n.attr("style",t.style),R(t,n),t.intersect=function(o){return B.polygon(t,r,o)},a},"inv_trapezoid"),zr=u(async(e,t)=>{let{shapeSvg:a,bbox:s}=await M(e,t,H(t,void 0),!0),l=s.width+t.padding,i=s.height+t.padding,r=[{x:0,y:0},{x:l+i/2,y:0},{x:l,y:-i/2},{x:l+i/2,y:-i},{x:0,y:-i}],n=J(a,l,i,r);return n.attr("style",t.style),R(t,n),t.intersect=function(o){return B.polygon(t,r,o)},a},"rect_right_inv_arrow"),Ar=u(async(e,t)=>{let{shapeSvg:a,bbox:s}=await M(e,t,H(t,void 0),!0),l=s.width+t.padding,i=l/2,r=i/(2.5+l/50),n=s.height+r+t.padding,o="M 0,"+r+" a "+i+","+r+" 0,0,0 "+l+" 0 a "+i+","+r+" 0,0,0 "+-l+" 0 l 0,"+n+" a "+i+","+r+" 0,0,0 "+l+" 0 l 0,"+-n,x=a.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 R(t,x),t.intersect=function(d){let p=B.rect(t,d),m=p.x-t.x;if(i!=0&&(Math.abs(m)<t.width/2||Math.abs(m)==t.width/2&&Math.abs(p.y-t.y)>t.height/2-r)){let f=r*r*(1-m*m/(i*i));f!=0&&(f=Math.sqrt(f)),f=r-f,d.y-t.y>0&&(f=-f),p.y+=f}return p},a},"cylinder"),Mr=u(async(e,t)=>{let{shapeSvg:a,bbox:s,halfPadding:l}=await M(e,t,"node "+t.classes+" "+t.class,!0),i=a.insert("rect",":first-child"),r=t.positioned?t.width:s.width+t.padding,n=t.positioned?t.height:s.height+t.padding,o=t.positioned?-r/2:-s.width/2-l,x=t.positioned?-n/2:-s.height/2-l;if(i.attr("class","basic label-container").attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("x",o).attr("y",x).attr("width",r).attr("height",n),t.props){let d=new Set(Object.keys(t.props));t.props.borders&&(ut(i,t.props.borders,r,n),d.delete("borders")),d.forEach(p=>{k.warn(`Unknown node property ${p}`)})}return R(t,i),t.intersect=function(d){return B.rect(t,d)},a},"rect"),Pr=u(async(e,t)=>{let{shapeSvg:a,bbox:s,halfPadding:l}=await M(e,t,"node "+t.classes,!0),i=a.insert("rect",":first-child"),r=t.positioned?t.width:s.width+t.padding,n=t.positioned?t.height:s.height+t.padding,o=t.positioned?-r/2:-s.width/2-l,x=t.positioned?-n/2:-s.height/2-l;if(i.attr("class","basic cluster composite label-container").attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("x",o).attr("y",x).attr("width",r).attr("height",n),t.props){let d=new Set(Object.keys(t.props));t.props.borders&&(ut(i,t.props.borders,r,n),d.delete("borders")),d.forEach(p=>{k.warn(`Unknown node property ${p}`)})}return R(t,i),t.intersect=function(d){return B.rect(t,d)},a},"composite"),Yr=u(async(e,t)=>{let{shapeSvg:a}=await M(e,t,"label",!0);k.trace("Classes = ",t.class);let s=a.insert("rect",":first-child"),l=0,i=0;if(s.attr("width",l).attr("height",i),a.attr("class","label edgeLabel"),t.props){let r=new Set(Object.keys(t.props));t.props.borders&&(ut(s,t.props.borders,l,i),r.delete("borders")),r.forEach(n=>{k.warn(`Unknown node property ${n}`)})}return R(t,s),t.intersect=function(r){return B.rect(t,r)},a},"labelRect");function ut(e,t,a,s){let l=[],i=u(n=>{l.push(n,0)},"addBorder"),r=u(n=>{l.push(0,n)},"skipBorder");t.includes("t")?(k.debug("add top border"),i(a)):r(a),t.includes("r")?(k.debug("add right border"),i(s)):r(s),t.includes("b")?(k.debug("add bottom border"),i(a)):r(a),t.includes("l")?(k.debug("add left border"),i(s)):r(s),e.attr("stroke-dasharray",l.join(" "))}u(ut,"applyNodePropertyBorders");var Xr=u(async(e,t)=>{let a;t.classes?a="node "+t.classes:a="node default";let s=e.insert("g").attr("class",a).attr("id",t.domId||t.id),l=s.insert("rect",":first-child"),i=s.insert("line"),r=s.insert("g").attr("class","label"),n=t.labelText.flat?t.labelText.flat():t.labelText,o="";typeof n=="object"?o=n[0]:o=n,k.info("Label text abc79",o,n,typeof n=="object");let x=await q(r,o,t.labelStyle,!0,!0),d={width:0,height:0};if(X(A())){let E=x.children[0],L=C(x);d=E.getBoundingClientRect(),L.attr("width",d.width),L.attr("height",d.height)}k.info("Text 2",n);let p=n.slice(1,n.length),m=x.getBBox(),f=await q(r,p.join?p.join("<br/>"):p,t.labelStyle,!0,!0);if(X(A())){let E=f.children[0],L=C(f);d=E.getBoundingClientRect(),L.attr("width",d.width),L.attr("height",d.height)}let w=t.padding/2;return C(f).attr("transform","translate( "+(d.width>m.width?0:(m.width-d.width)/2)+", "+(m.height+w+5)+")"),C(x).attr("transform","translate( "+(d.width<m.width?0:-(m.width-d.width)/2)+", 0)"),d=r.node().getBBox(),r.attr("transform","translate("+-d.width/2+", "+(-d.height/2-w+3)+")"),l.attr("class","outer title-state").attr("x",-d.width/2-w).attr("y",-d.height/2-w).attr("width",d.width+t.padding).attr("height",d.height+t.padding),i.attr("class","divider").attr("x1",-d.width/2-w).attr("x2",d.width/2+w).attr("y1",-d.height/2-w+m.height+w).attr("y2",-d.height/2-w+m.height+w),R(t,l),t.intersect=function(E){return B.rect(t,E)},s},"rectWithTitle"),Wr=u(async(e,t)=>{let{shapeSvg:a,bbox:s}=await M(e,t,H(t,void 0),!0),l=s.height+t.padding,i=s.width+l/4+t.padding,r=a.insert("rect",":first-child").attr("style",t.style).attr("rx",l/2).attr("ry",l/2).attr("x",-i/2).attr("y",-l/2).attr("width",i).attr("height",l);return R(t,r),t.intersect=function(n){return B.rect(t,n)},a},"stadium"),Fr=u(async(e,t)=>{let{shapeSvg:a,bbox:s,halfPadding:l}=await M(e,t,H(t,void 0),!0),i=a.insert("circle",":first-child");return i.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("r",s.width/2+l).attr("width",s.width+t.padding).attr("height",s.height+t.padding),k.info("Circle main"),R(t,i),t.intersect=function(r){return k.info("Circle intersect",t,s.width/2+l,r),B.circle(t,s.width/2+l,r)},a},"circle"),Kr=u(async(e,t)=>{let{shapeSvg:a,bbox:s,halfPadding:l}=await M(e,t,H(t,void 0),!0),i=5,r=a.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",s.width/2+l+i).attr("width",s.width+t.padding+i*2).attr("height",s.height+t.padding+i*2),o.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("r",s.width/2+l).attr("width",s.width+t.padding).attr("height",s.height+t.padding),k.info("DoubleCircle main"),R(t,n),t.intersect=function(x){return k.info("DoubleCircle intersect",t,s.width/2+l+i,x),B.circle(t,s.width/2+l+i,x)},a},"doublecircle"),Ur=u(async(e,t)=>{let{shapeSvg:a,bbox:s}=await M(e,t,H(t,void 0),!0),l=s.width+t.padding,i=s.height+t.padding,r=[{x:0,y:0},{x:l,y:0},{x:l,y:-i},{x:0,y:-i},{x:0,y:0},{x:-8,y:0},{x:l+8,y:0},{x:l+8,y:-i},{x:-8,y:-i},{x:-8,y:0}],n=J(a,l,i,r);return n.attr("style",t.style),R(t,n),t.intersect=function(o){return B.polygon(t,r,o)},a},"subroutine"),Hr=u((e,t)=>{let a=e.insert("g").attr("class","node default").attr("id",t.domId||t.id),s=a.insert("circle",":first-child");return s.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),R(t,s),t.intersect=function(l){return B.circle(t,7,l)},a},"start"),Wt=u((e,t,a)=>{let s=e.insert("g").attr("class","node default").attr("id",t.domId||t.id),l=70,i=10;a==="LR"&&(l=10,i=70);let r=s.append("rect").attr("x",-1*l/2).attr("y",-1*i/2).attr("width",l).attr("height",i).attr("class","fork-join");return R(t,r),t.height=t.height+t.padding/2,t.width=t.width+t.padding/2,t.intersect=function(n){return B.rect(t,n)},s},"forkJoin"),Zr=u((e,t)=>{let a=e.insert("g").attr("class","node default").attr("id",t.domId||t.id),s=a.insert("circle",":first-child"),l=a.insert("circle",":first-child");return l.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),s.attr("class","state-end").attr("r",5).attr("width",10).attr("height",10),R(t,l),t.intersect=function(i){return B.circle(t,7,i)},a},"end"),qr=u(async(e,t)=>{var c;let a=t.padding/2,s=4,l=8,i;t.classes?i="node "+t.classes:i="node default";let r=e.insert("g").attr("class",i).attr("id",t.domId||t.id),n=r.insert("rect",":first-child"),o=r.insert("line"),x=r.insert("line"),d=0,p=s,m=r.insert("g").attr("class","label"),f=0,w=(c=t.classData.annotations)==null?void 0:c[0],E=t.classData.annotations[0]?"«"+t.classData.annotations[0]+"»":"",L=await q(m,E,t.labelStyle,!0,!0),I=L.getBBox();if(X(A())){let _=L.children[0],g=C(L);I=_.getBoundingClientRect(),g.attr("width",I.width),g.attr("height",I.height)}t.classData.annotations[0]&&(p+=I.height+s,d+=I.width);let $=t.classData.label;t.classData.type!==void 0&&t.classData.type!==""&&(X(A())?$+="&lt;"+t.classData.type+"&gt;":$+="<"+t.classData.type+">");let N=await q(m,$,t.labelStyle,!0,!0);C(N).attr("class","classTitle");let h=N.getBBox();if(X(A())){let _=N.children[0],g=C(N);h=_.getBoundingClientRect(),g.attr("width",h.width),g.attr("height",h.height)}p+=h.height+s,h.width>d&&(d=h.width);let y=[];t.classData.members.forEach(async _=>{let g=_.getDisplayDetails(),S=g.displayText;X(A())&&(S=S.replace(/</g,"&lt;").replace(/>/g,"&gt;"));let v=await q(m,S,g.cssStyle?g.cssStyle:t.labelStyle,!0,!0),T=v.getBBox();if(X(A())){let F=v.children[0],W=C(v);T=F.getBoundingClientRect(),W.attr("width",T.width),W.attr("height",T.height)}T.width>d&&(d=T.width),p+=T.height+s,y.push(v)}),p+=l;let b=[];if(t.classData.methods.forEach(async _=>{let g=_.getDisplayDetails(),S=g.displayText;X(A())&&(S=S.replace(/</g,"&lt;").replace(/>/g,"&gt;"));let v=await q(m,S,g.cssStyle?g.cssStyle:t.labelStyle,!0,!0),T=v.getBBox();if(X(A())){let F=v.children[0],W=C(v);T=F.getBoundingClientRect(),W.attr("width",T.width),W.attr("height",T.height)}T.width>d&&(d=T.width),p+=T.height+s,b.push(v)}),p+=l,w){let _=(d-I.width)/2;C(L).attr("transform","translate( "+(-1*d/2+_)+", "+-1*p/2+")"),f=I.height+s}let D=(d-h.width)/2;return C(N).attr("transform","translate( "+(-1*d/2+D)+", "+(-1*p/2+f)+")"),f+=h.height+s,o.attr("class","divider").attr("x1",-d/2-a).attr("x2",d/2+a).attr("y1",-p/2-a+l+f).attr("y2",-p/2-a+l+f),f+=l,y.forEach(_=>{C(_).attr("transform","translate( "+-d/2+", "+(-1*p/2+f+l/2)+")");let g=_==null?void 0:_.getBBox();f+=((g==null?void 0:g.height)??0)+s}),f+=l,x.attr("class","divider").attr("x1",-d/2-a).attr("x2",d/2+a).attr("y1",-p/2-a+l+f).attr("y2",-p/2-a+l+f),f+=l,b.forEach(_=>{C(_).attr("transform","translate( "+-d/2+", "+(-1*p/2+f)+")");let g=_==null?void 0:_.getBBox();f+=((g==null?void 0:g.height)??0)+s}),n.attr("style",t.style).attr("class","outer title-state").attr("x",-d/2-a).attr("y",-(p/2)-a).attr("width",d+t.padding).attr("height",p+t.padding),R(t,n),t.intersect=function(_){return B.rect(t,_)},r},"class_box"),Ft={rhombus:Xt,composite:Pr,question:Xt,rect:Mr,labelRect:Yr,rectWithTitle:Xr,choice:Nr,circle:Fr,doublecircle:Kr,stadium:Wr,hexagon:Tr,block_arrow:$r,rect_left_inv_arrow:Ir,lean_right:Cr,lean_left:Br,trapezoid:Or,inv_trapezoid:Rr,rect_right_inv_arrow:zr,cylinder:Ar,start:Hr,end:Zr,note:vr,subroutine:Ur,fork:Wt,join:Wt,class_box:qr},ht={},ie=u(async(e,t,a)=>{let s,l;if(t.link){let i;A().securityLevel==="sandbox"?i="_top":t.linkTarget&&(i=t.linkTarget||"_blank"),s=e.insert("svg:a").attr("xlink:href",t.link).attr("target",i),l=await Ft[t.shape](s,t,a)}else l=await Ft[t.shape](e,t,a),s=l;return t.tooltip&&l.attr("title",t.tooltip),t.class&&l.attr("class","node default "+t.class),ht[t.id]=s,t.haveCallback&&ht[t.id].attr("class",ht[t.id].attr("class")+" clickable"),s},"insertNode"),jr=u(e=>{let t=ht[e.id];k.trace("Transforming node",e.diff,e,"translate("+(e.x-e.width/2-5)+", "+e.width/2+")");let a=8,s=e.diff||0;return e.clusterNode?t.attr("transform","translate("+(e.x+s-e.width/2)+", "+(e.y-e.height/2-a)+")"):t.attr("transform","translate("+e.x+", "+e.y+")"),s},"positionNode");function $t(e,t,a=!1){var m,f,w;let s=e,l="default";(((m=s==null?void 0:s.classes)==null?void 0:m.length)||0)>0&&(l=((s==null?void 0:s.classes)??[]).join(" ")),l=l+" flowchart-label";let i=0,r="",n;switch(s.type){case"round":i=5,r="rect";break;case"composite":i=0,r="composite",n=0;break;case"square":r="rect";break;case"diamond":r="question";break;case"hexagon":r="hexagon";break;case"block_arrow":r="block_arrow";break;case"odd":r="rect_left_inv_arrow";break;case"lean_right":r="lean_right";break;case"lean_left":r="lean_left";break;case"trapezoid":r="trapezoid";break;case"inv_trapezoid":r="inv_trapezoid";break;case"rect_left_inv_arrow":r="rect_left_inv_arrow";break;case"circle":r="circle";break;case"ellipse":r="ellipse";break;case"stadium":r="stadium";break;case"subroutine":r="subroutine";break;case"cylinder":r="cylinder";break;case"group":r="rect";break;case"doublecircle":r="doublecircle";break;default:r="rect"}let o=Ee((s==null?void 0:s.styles)??[]),x=s.label,d=s.size??{width:0,height:0,x:0,y:0},p=t.getDiagramId();return{labelStyle:o.labelStyle,shape:r,labelText:x,rx:i,ry:i,class:l,style:o.style,id:s.id,domId:p?`${p}-${s.id}`:s.id,directions:s.directions,width:d.width,height:d.height,x:d.x,y:d.y,positioned:a,intersect:void 0,type:s.type,padding:n??((w=(f=lt())==null?void 0:f.block)==null?void 0:w.padding)??0}}u($t,"getNodeFromBlock");async function se(e,t,a){let s=$t(t,a,!1);if(s.type==="group")return;let l=lt(),i=await ie(e,s,{config:l}),r=i.node().getBBox(),n=a.getBlock(s.id);n.size={width:r.width,height:r.height,x:0,y:0,node:i},a.setBlock(n),i.remove()}u(se,"calculateBlockSize");async function ne(e,t,a){let s=$t(t,a,!0);if(a.getBlock(s.id).type!=="space"){let l=lt();await ie(e,s,{config:l}),t.intersect=s==null?void 0:s.intersect,jr(s)}}u(ne,"insertBlockPositioned");async function yt(e,t,a,s){for(let l of t)await s(e,l,a),l.children&&await yt(e,l.children,a,s)}u(yt,"performOperations");async function le(e,t,a){await yt(e,t,a,se)}u(le,"calculateBlockSizes");async function oe(e,t,a){await yt(e,t,a,ne)}u(oe,"insertBlocks");async function ce(e,t,a,s,l){let i=new ge({multigraph:!0,compound:!0});i.setGraph({rankdir:"TB",nodesep:10,ranksep:10,marginx:8,marginy:8});for(let r of a)r.size&&i.setNode(r.id,{width:r.size.width,height:r.size.height,intersect:r.intersect});for(let r of t)if(r.start&&r.end){let n=s.getBlock(r.start),o=s.getBlock(r.end);if(n!=null&&n.size&&(o!=null&&o.size)){let x=n.size,d=o.size,p=[{x:x.x,y:x.y},{x:x.x+(d.x-x.x)/2,y:x.y+(d.y-x.y)/2},{x:d.x,y:d.y}],m=l?`${l}-${r.id}`:r.id;fr(e,{v:r.start,w:r.end,name:m},{...r,id:m,arrowTypeEnd:r.arrowTypeEnd,arrowTypeStart:r.arrowTypeStart,points:p,classes:"edge-thickness-normal edge-pattern-solid flowchart-link LS-a1 LE-b1"},void 0,"block",i,l),r.label&&(await ur(e,{...r,label:r.label,labelStyle:"stroke: #333; stroke-width: 1.5px;fill:none;",arrowTypeEnd:r.arrowTypeEnd,arrowTypeStart:r.arrowTypeStart,points:p,classes:"edge-thickness-normal edge-pattern-solid flowchart-link LS-a1 LE-b1"}),yr({...r,x:p[1].x,y:p[1].y},{originalPath:p}))}}}u(ce,"insertEdges");var Jr=u(function(e,t){return t.db.getClasses()},"getClasses"),Vr=u(async function(e,t,a,s){let{securityLevel:l,block:i}=lt(),r=s.db;r.setDiagramId(t);let n;l==="sandbox"&&(n=C("#i"+t));let o=l==="sandbox"?C(n.nodes()[0].contentDocument.body):C("body"),x=l==="sandbox"?o.select(`[id="${t}"]`):C(`[id="${t}"]`);or(x,["point","circle","cross"],s.type,t);let d=r.getBlocks(),p=r.getBlocksFlat(),m=r.getEdges(),f=x.insert("g").attr("class","block");await le(f,d,r);let w=Vt(r);if(await oe(f,d,r),await ce(f,m,p,r,t),w){let E=w,L=Math.max(1,Math.round(.125*(E.width/E.height))),I=E.height+L+10,$=E.width+10,{useMaxWidth:N}=i;ye(x,I,$,!!N),k.debug("Here Bounds",w,E),x.attr("viewBox",`${E.x-5} ${E.y-5} ${E.width+10} ${E.height+10}`)}},"draw"),Gr={draw:Vr,getClasses:Jr},ia={parser:ve,db:qe,renderer:Gr,styles:Je};export{ia as diagram};
@@ -0,0 +1,10 @@
1
+ import{u as Dt,x as Nt}from"./chunk-O5ABG6QK-dHwHzA6n.js";import{a as Pt,l as Bt,s as jt,e as Lt,m as f,q as Ne,i as Me,p as ut,b as Yt,w as Mt,M as Oe,c as bt,S as It,C as Ze,W as pt,r as Ut,f as Ft}from"./index-BgeqpYgd.js";var Ue=function(){var a=f(function(z,m,E,g){for(E=E||{},g=z.length;g--;E[z[g]]=m);return E},"o"),e=[1,24],s=[1,25],h=[1,26],l=[1,27],r=[1,28],t=[1,63],n=[1,64],i=[1,65],d=[1,66],u=[1,67],p=[1,68],b=[1,69],x=[1,29],T=[1,30],v=[1,31],B=[1,32],X=[1,33],I=[1,34],H=[1,35],V=[1,36],G=[1,37],K=[1,38],J=[1,39],Z=[1,40],ee=[1,41],te=[1,42],ae=[1,43],ie=[1,44],ne=[1,45],se=[1,46],re=[1,47],le=[1,48],oe=[1,50],ce=[1,51],he=[1,52],de=[1,53],ue=[1,54],pe=[1,55],ye=[1,56],fe=[1,57],be=[1,58],ge=[1,59],me=[1,60],ke=[14,42],$e=[14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],Re=[12,14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],S=[1,82],A=[1,83],C=[1,84],k=[1,85],w=[12,14,42],lt=[12,14,33,42],Be=[12,14,33,42,76,77,79,80],Ee=[12,33],We=[34,36,37,38,39,40,41,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],qe={trace:f(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,direction:5,direction_tb:6,direction_bt:7,direction_rl:8,direction_lr:9,graphConfig:10,C4_CONTEXT:11,NEWLINE:12,statements:13,EOF:14,C4_CONTAINER:15,C4_COMPONENT:16,C4_DYNAMIC:17,C4_DEPLOYMENT:18,otherStatements:19,diagramStatements:20,otherStatement:21,title:22,accDescription:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,boundaryStatement:29,boundaryStartStatement:30,boundaryStopStatement:31,boundaryStart:32,LBRACE:33,ENTERPRISE_BOUNDARY:34,attributes:35,SYSTEM_BOUNDARY:36,BOUNDARY:37,CONTAINER_BOUNDARY:38,NODE:39,NODE_L:40,NODE_R:41,RBRACE:42,diagramStatement:43,PERSON:44,PERSON_EXT:45,SYSTEM:46,SYSTEM_DB:47,SYSTEM_QUEUE:48,SYSTEM_EXT:49,SYSTEM_EXT_DB:50,SYSTEM_EXT_QUEUE:51,CONTAINER:52,CONTAINER_DB:53,CONTAINER_QUEUE:54,CONTAINER_EXT:55,CONTAINER_EXT_DB:56,CONTAINER_EXT_QUEUE:57,COMPONENT:58,COMPONENT_DB:59,COMPONENT_QUEUE:60,COMPONENT_EXT:61,COMPONENT_EXT_DB:62,COMPONENT_EXT_QUEUE:63,REL:64,BIREL:65,REL_U:66,REL_D:67,REL_L:68,REL_R:69,REL_B:70,REL_INDEX:71,UPDATE_EL_STYLE:72,UPDATE_REL_STYLE:73,UPDATE_LAYOUT_CONFIG:74,attribute:75,STR:76,STR_KEY:77,STR_VALUE:78,ATTRIBUTE:79,ATTRIBUTE_EMPTY:80,$accept:0,$end:1},terminals_:{2:"error",6:"direction_tb",7:"direction_bt",8:"direction_rl",9:"direction_lr",11:"C4_CONTEXT",12:"NEWLINE",14:"EOF",15:"C4_CONTAINER",16:"C4_COMPONENT",17:"C4_DYNAMIC",18:"C4_DEPLOYMENT",22:"title",23:"accDescription",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"LBRACE",34:"ENTERPRISE_BOUNDARY",36:"SYSTEM_BOUNDARY",37:"BOUNDARY",38:"CONTAINER_BOUNDARY",39:"NODE",40:"NODE_L",41:"NODE_R",42:"RBRACE",44:"PERSON",45:"PERSON_EXT",46:"SYSTEM",47:"SYSTEM_DB",48:"SYSTEM_QUEUE",49:"SYSTEM_EXT",50:"SYSTEM_EXT_DB",51:"SYSTEM_EXT_QUEUE",52:"CONTAINER",53:"CONTAINER_DB",54:"CONTAINER_QUEUE",55:"CONTAINER_EXT",56:"CONTAINER_EXT_DB",57:"CONTAINER_EXT_QUEUE",58:"COMPONENT",59:"COMPONENT_DB",60:"COMPONENT_QUEUE",61:"COMPONENT_EXT",62:"COMPONENT_EXT_DB",63:"COMPONENT_EXT_QUEUE",64:"REL",65:"BIREL",66:"REL_U",67:"REL_D",68:"REL_L",69:"REL_R",70:"REL_B",71:"REL_INDEX",72:"UPDATE_EL_STYLE",73:"UPDATE_REL_STYLE",74:"UPDATE_LAYOUT_CONFIG",76:"STR",77:"STR_KEY",78:"STR_VALUE",79:"ATTRIBUTE",80:"ATTRIBUTE_EMPTY"},productions_:[0,[3,1],[3,1],[5,1],[5,1],[5,1],[5,1],[4,1],[10,4],[10,4],[10,4],[10,4],[10,4],[13,1],[13,1],[13,2],[19,1],[19,2],[19,3],[21,1],[21,1],[21,2],[21,2],[21,1],[29,3],[30,3],[30,3],[30,4],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[31,1],[20,1],[20,2],[20,3],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,1],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[35,1],[35,2],[75,1],[75,2],[75,1],[75,1]],performAction:f(function(z,m,E,g,O,o,P){var y=o.length-1;switch(O){case 3:g.setDirection("TB");break;case 4:g.setDirection("BT");break;case 5:g.setDirection("RL");break;case 6:g.setDirection("LR");break;case 8:case 9:case 10:case 11:case 12:g.setC4Type(o[y-3]);break;case 19:g.setTitle(o[y].substring(6)),this.$=o[y].substring(6);break;case 20:g.setAccDescription(o[y].substring(15)),this.$=o[y].substring(15);break;case 21:this.$=o[y].trim(),g.setTitle(this.$);break;case 22:case 23:this.$=o[y].trim(),g.setAccDescription(this.$);break;case 28:o[y].splice(2,0,"ENTERPRISE"),g.addPersonOrSystemBoundary(...o[y]),this.$=o[y];break;case 29:o[y].splice(2,0,"SYSTEM"),g.addPersonOrSystemBoundary(...o[y]),this.$=o[y];break;case 30:g.addPersonOrSystemBoundary(...o[y]),this.$=o[y];break;case 31:o[y].splice(2,0,"CONTAINER"),g.addContainerBoundary(...o[y]),this.$=o[y];break;case 32:g.addDeploymentNode("node",...o[y]),this.$=o[y];break;case 33:g.addDeploymentNode("nodeL",...o[y]),this.$=o[y];break;case 34:g.addDeploymentNode("nodeR",...o[y]),this.$=o[y];break;case 35:g.popBoundaryParseStack();break;case 39:g.addPersonOrSystem("person",...o[y]),this.$=o[y];break;case 40:g.addPersonOrSystem("external_person",...o[y]),this.$=o[y];break;case 41:g.addPersonOrSystem("system",...o[y]),this.$=o[y];break;case 42:g.addPersonOrSystem("system_db",...o[y]),this.$=o[y];break;case 43:g.addPersonOrSystem("system_queue",...o[y]),this.$=o[y];break;case 44:g.addPersonOrSystem("external_system",...o[y]),this.$=o[y];break;case 45:g.addPersonOrSystem("external_system_db",...o[y]),this.$=o[y];break;case 46:g.addPersonOrSystem("external_system_queue",...o[y]),this.$=o[y];break;case 47:g.addContainer("container",...o[y]),this.$=o[y];break;case 48:g.addContainer("container_db",...o[y]),this.$=o[y];break;case 49:g.addContainer("container_queue",...o[y]),this.$=o[y];break;case 50:g.addContainer("external_container",...o[y]),this.$=o[y];break;case 51:g.addContainer("external_container_db",...o[y]),this.$=o[y];break;case 52:g.addContainer("external_container_queue",...o[y]),this.$=o[y];break;case 53:g.addComponent("component",...o[y]),this.$=o[y];break;case 54:g.addComponent("component_db",...o[y]),this.$=o[y];break;case 55:g.addComponent("component_queue",...o[y]),this.$=o[y];break;case 56:g.addComponent("external_component",...o[y]),this.$=o[y];break;case 57:g.addComponent("external_component_db",...o[y]),this.$=o[y];break;case 58:g.addComponent("external_component_queue",...o[y]),this.$=o[y];break;case 60:g.addRel("rel",...o[y]),this.$=o[y];break;case 61:g.addRel("birel",...o[y]),this.$=o[y];break;case 62:g.addRel("rel_u",...o[y]),this.$=o[y];break;case 63:g.addRel("rel_d",...o[y]),this.$=o[y];break;case 64:g.addRel("rel_l",...o[y]),this.$=o[y];break;case 65:g.addRel("rel_r",...o[y]),this.$=o[y];break;case 66:g.addRel("rel_b",...o[y]),this.$=o[y];break;case 67:o[y].splice(0,1),g.addRel("rel",...o[y]),this.$=o[y];break;case 68:g.updateElStyle("update_el_style",...o[y]),this.$=o[y];break;case 69:g.updateRelStyle("update_rel_style",...o[y]),this.$=o[y];break;case 70:g.updateLayoutConfig("update_layout_config",...o[y]),this.$=o[y];break;case 71:this.$=[o[y]];break;case 72:o[y].unshift(o[y-1]),this.$=o[y];break;case 73:case 75:this.$=o[y].trim();break;case 74:let Se={};Se[o[y-1].trim()]=o[y].trim(),this.$=Se;break;case 76:this.$="";break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],7:[1,6],8:[1,7],9:[1,8],10:4,11:[1,9],15:[1,10],16:[1,11],17:[1,12],18:[1,13]},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,7]},{1:[2,3]},{1:[2,4]},{1:[2,5]},{1:[2,6]},{12:[1,14]},{12:[1,15]},{12:[1,16]},{12:[1,17]},{12:[1,18]},{13:19,19:20,20:21,21:22,22:e,23:s,24:h,26:l,28:r,29:49,30:61,32:62,34:t,36:n,37:i,38:d,39:u,40:p,41:b,43:23,44:x,45:T,46:v,47:B,48:X,49:I,50:H,51:V,52:G,53:K,54:J,55:Z,56:ee,57:te,58:ae,59:ie,60:ne,61:se,62:re,63:le,64:oe,65:ce,66:he,67:de,68:ue,69:pe,70:ye,71:fe,72:be,73:ge,74:me},{13:70,19:20,20:21,21:22,22:e,23:s,24:h,26:l,28:r,29:49,30:61,32:62,34:t,36:n,37:i,38:d,39:u,40:p,41:b,43:23,44:x,45:T,46:v,47:B,48:X,49:I,50:H,51:V,52:G,53:K,54:J,55:Z,56:ee,57:te,58:ae,59:ie,60:ne,61:se,62:re,63:le,64:oe,65:ce,66:he,67:de,68:ue,69:pe,70:ye,71:fe,72:be,73:ge,74:me},{13:71,19:20,20:21,21:22,22:e,23:s,24:h,26:l,28:r,29:49,30:61,32:62,34:t,36:n,37:i,38:d,39:u,40:p,41:b,43:23,44:x,45:T,46:v,47:B,48:X,49:I,50:H,51:V,52:G,53:K,54:J,55:Z,56:ee,57:te,58:ae,59:ie,60:ne,61:se,62:re,63:le,64:oe,65:ce,66:he,67:de,68:ue,69:pe,70:ye,71:fe,72:be,73:ge,74:me},{13:72,19:20,20:21,21:22,22:e,23:s,24:h,26:l,28:r,29:49,30:61,32:62,34:t,36:n,37:i,38:d,39:u,40:p,41:b,43:23,44:x,45:T,46:v,47:B,48:X,49:I,50:H,51:V,52:G,53:K,54:J,55:Z,56:ee,57:te,58:ae,59:ie,60:ne,61:se,62:re,63:le,64:oe,65:ce,66:he,67:de,68:ue,69:pe,70:ye,71:fe,72:be,73:ge,74:me},{13:73,19:20,20:21,21:22,22:e,23:s,24:h,26:l,28:r,29:49,30:61,32:62,34:t,36:n,37:i,38:d,39:u,40:p,41:b,43:23,44:x,45:T,46:v,47:B,48:X,49:I,50:H,51:V,52:G,53:K,54:J,55:Z,56:ee,57:te,58:ae,59:ie,60:ne,61:se,62:re,63:le,64:oe,65:ce,66:he,67:de,68:ue,69:pe,70:ye,71:fe,72:be,73:ge,74:me},{14:[1,74]},a(ke,[2,13],{43:23,29:49,30:61,32:62,20:75,34:t,36:n,37:i,38:d,39:u,40:p,41:b,44:x,45:T,46:v,47:B,48:X,49:I,50:H,51:V,52:G,53:K,54:J,55:Z,56:ee,57:te,58:ae,59:ie,60:ne,61:se,62:re,63:le,64:oe,65:ce,66:he,67:de,68:ue,69:pe,70:ye,71:fe,72:be,73:ge,74:me}),a(ke,[2,14]),a($e,[2,16],{12:[1,76]}),a(ke,[2,36],{12:[1,77]}),a(Re,[2,19]),a(Re,[2,20]),{25:[1,78]},{27:[1,79]},a(Re,[2,23]),{35:80,75:81,76:S,77:A,79:C,80:k},{35:86,75:81,76:S,77:A,79:C,80:k},{35:87,75:81,76:S,77:A,79:C,80:k},{35:88,75:81,76:S,77:A,79:C,80:k},{35:89,75:81,76:S,77:A,79:C,80:k},{35:90,75:81,76:S,77:A,79:C,80:k},{35:91,75:81,76:S,77:A,79:C,80:k},{35:92,75:81,76:S,77:A,79:C,80:k},{35:93,75:81,76:S,77:A,79:C,80:k},{35:94,75:81,76:S,77:A,79:C,80:k},{35:95,75:81,76:S,77:A,79:C,80:k},{35:96,75:81,76:S,77:A,79:C,80:k},{35:97,75:81,76:S,77:A,79:C,80:k},{35:98,75:81,76:S,77:A,79:C,80:k},{35:99,75:81,76:S,77:A,79:C,80:k},{35:100,75:81,76:S,77:A,79:C,80:k},{35:101,75:81,76:S,77:A,79:C,80:k},{35:102,75:81,76:S,77:A,79:C,80:k},{35:103,75:81,76:S,77:A,79:C,80:k},{35:104,75:81,76:S,77:A,79:C,80:k},a(w,[2,59]),{35:105,75:81,76:S,77:A,79:C,80:k},{35:106,75:81,76:S,77:A,79:C,80:k},{35:107,75:81,76:S,77:A,79:C,80:k},{35:108,75:81,76:S,77:A,79:C,80:k},{35:109,75:81,76:S,77:A,79:C,80:k},{35:110,75:81,76:S,77:A,79:C,80:k},{35:111,75:81,76:S,77:A,79:C,80:k},{35:112,75:81,76:S,77:A,79:C,80:k},{35:113,75:81,76:S,77:A,79:C,80:k},{35:114,75:81,76:S,77:A,79:C,80:k},{35:115,75:81,76:S,77:A,79:C,80:k},{20:116,29:49,30:61,32:62,34:t,36:n,37:i,38:d,39:u,40:p,41:b,43:23,44:x,45:T,46:v,47:B,48:X,49:I,50:H,51:V,52:G,53:K,54:J,55:Z,56:ee,57:te,58:ae,59:ie,60:ne,61:se,62:re,63:le,64:oe,65:ce,66:he,67:de,68:ue,69:pe,70:ye,71:fe,72:be,73:ge,74:me},{12:[1,118],33:[1,117]},{35:119,75:81,76:S,77:A,79:C,80:k},{35:120,75:81,76:S,77:A,79:C,80:k},{35:121,75:81,76:S,77:A,79:C,80:k},{35:122,75:81,76:S,77:A,79:C,80:k},{35:123,75:81,76:S,77:A,79:C,80:k},{35:124,75:81,76:S,77:A,79:C,80:k},{35:125,75:81,76:S,77:A,79:C,80:k},{14:[1,126]},{14:[1,127]},{14:[1,128]},{14:[1,129]},{1:[2,8]},a(ke,[2,15]),a($e,[2,17],{21:22,19:130,22:e,23:s,24:h,26:l,28:r}),a(ke,[2,37],{19:20,20:21,21:22,43:23,29:49,30:61,32:62,13:131,22:e,23:s,24:h,26:l,28:r,34:t,36:n,37:i,38:d,39:u,40:p,41:b,44:x,45:T,46:v,47:B,48:X,49:I,50:H,51:V,52:G,53:K,54:J,55:Z,56:ee,57:te,58:ae,59:ie,60:ne,61:se,62:re,63:le,64:oe,65:ce,66:he,67:de,68:ue,69:pe,70:ye,71:fe,72:be,73:ge,74:me}),a(Re,[2,21]),a(Re,[2,22]),a(w,[2,39]),a(lt,[2,71],{75:81,35:132,76:S,77:A,79:C,80:k}),a(Be,[2,73]),{78:[1,133]},a(Be,[2,75]),a(Be,[2,76]),a(w,[2,40]),a(w,[2,41]),a(w,[2,42]),a(w,[2,43]),a(w,[2,44]),a(w,[2,45]),a(w,[2,46]),a(w,[2,47]),a(w,[2,48]),a(w,[2,49]),a(w,[2,50]),a(w,[2,51]),a(w,[2,52]),a(w,[2,53]),a(w,[2,54]),a(w,[2,55]),a(w,[2,56]),a(w,[2,57]),a(w,[2,58]),a(w,[2,60]),a(w,[2,61]),a(w,[2,62]),a(w,[2,63]),a(w,[2,64]),a(w,[2,65]),a(w,[2,66]),a(w,[2,67]),a(w,[2,68]),a(w,[2,69]),a(w,[2,70]),{31:134,42:[1,135]},{12:[1,136]},{33:[1,137]},a(Ee,[2,28]),a(Ee,[2,29]),a(Ee,[2,30]),a(Ee,[2,31]),a(Ee,[2,32]),a(Ee,[2,33]),a(Ee,[2,34]),{1:[2,9]},{1:[2,10]},{1:[2,11]},{1:[2,12]},a($e,[2,18]),a(ke,[2,38]),a(lt,[2,72]),a(Be,[2,74]),a(w,[2,24]),a(w,[2,35]),a(We,[2,25]),a(We,[2,26],{12:[1,138]}),a(We,[2,27])],defaultActions:{2:[2,1],3:[2,2],4:[2,7],5:[2,3],6:[2,4],7:[2,5],8:[2,6],74:[2,8],126:[2,9],127:[2,10],128:[2,11],129:[2,12]},parseError:f(function(z,m){if(m.recoverable)this.trace(z);else{var E=new Error(z);throw E.hash=m,E}},"parseError"),parse:f(function(z){var m=this,E=[0],g=[],O=[null],o=[],P=this.table,y="",Se=0,ot=0,wt=0,Ot=2,ct=1,Tt=o.slice.call(arguments,1),R=Object.create(this.lexer),Ae={yy:{}};for(var He in this.yy)Object.prototype.hasOwnProperty.call(this.yy,He)&&(Ae.yy[He]=this.yy[He]);R.setInput(z,Ae.yy),Ae.yy.lexer=R,Ae.yy.parser=this,typeof R.yylloc>"u"&&(R.yylloc={});var Ve=R.yylloc;o.push(Ve);var vt=R.options&&R.options.ranges;typeof Ae.yy.parseError=="function"?this.parseError=Ae.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Rt(j){E.length=E.length-2*j,O.length=O.length-j,o.length=o.length-j}f(Rt,"popStack");function ht(){var j;return j=g.pop()||R.lex()||ct,typeof j!="number"&&(j instanceof Array&&(g=j,j=g.pop()),j=m.symbols_[j]||j),j}f(ht,"lex");for(var D,Ge,Ce,L,j0,Ke,we={},Le,W,dt,Ye;;){if(Ce=E[E.length-1],this.defaultActions[Ce]?L=this.defaultActions[Ce]:((D===null||typeof D>"u")&&(D=ht()),L=P[Ce]&&P[Ce][D]),typeof L>"u"||!L.length||!L[0]){var Je="";Ye=[];for(Le in P[Ce])this.terminals_[Le]&&Le>Ot&&Ye.push("'"+this.terminals_[Le]+"'");R.showPosition?Je="Parse error on line "+(Se+1)+`:
2
+ `+R.showPosition()+`
3
+ Expecting `+Ye.join(", ")+", got '"+(this.terminals_[D]||D)+"'":Je="Parse error on line "+(Se+1)+": Unexpected "+(D==ct?"end of input":"'"+(this.terminals_[D]||D)+"'"),this.parseError(Je,{text:R.match,token:this.terminals_[D]||D,line:R.yylineno,loc:Ve,expected:Ye})}if(L[0]instanceof Array&&L.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Ce+", token: "+D);switch(L[0]){case 1:E.push(D),O.push(R.yytext),o.push(R.yylloc),E.push(L[1]),D=null,Ge?(D=Ge,Ge=null):(ot=R.yyleng,y=R.yytext,Se=R.yylineno,Ve=R.yylloc,wt>0);break;case 2:if(W=this.productions_[L[1]][1],we.$=O[O.length-W],we._$={first_line:o[o.length-(W||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(W||1)].first_column,last_column:o[o.length-1].last_column},vt&&(we._$.range=[o[o.length-(W||1)].range[0],o[o.length-1].range[1]]),Ke=this.performAction.apply(we,[y,ot,Se,Ae.yy,L[1],O,o].concat(Tt)),typeof Ke<"u")return Ke;W&&(E=E.slice(0,-1*W*2),O=O.slice(0,-1*W),o=o.slice(0,-1*W)),E.push(this.productions_[L[1]][0]),O.push(we.$),o.push(we._$),dt=P[E[E.length-2]][E[E.length-1]],E.push(dt);break;case 3:return!0}}return!0},"parse")},kt=function(){var z={EOF:1,parseError:f(function(m,E){if(this.yy.parser)this.yy.parser.parseError(m,E);else throw new Error(m)},"parseError"),setInput:f(function(m,E){return this.yy=E||this.yy||{},this._input=m,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:f(function(){var m=this._input[0];this.yytext+=m,this.yyleng++,this.offset++,this.match+=m,this.matched+=m;var E=m.match(/(?:\r\n?|\n).*/g);return E?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),m},"input"),unput:f(function(m){var E=m.length,g=m.split(/(?:\r\n?|\n)/g);this._input=m+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-E),this.offset-=E;var O=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),g.length-1&&(this.yylineno-=g.length-1);var o=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:g?(g.length===O.length?this.yylloc.first_column:0)+O[O.length-g.length].length-g[0].length:this.yylloc.first_column-E},this.options.ranges&&(this.yylloc.range=[o[0],o[0]+this.yyleng-E]),this.yyleng=this.yytext.length,this},"unput"),more:f(function(){return this._more=!0,this},"more"),reject:f(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
+ `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:f(function(m){this.unput(this.match.slice(m))},"less"),pastInput:f(function(){var m=this.matched.substr(0,this.matched.length-this.match.length);return(m.length>20?"...":"")+m.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:f(function(){var m=this.match;return m.length<20&&(m+=this._input.substr(0,20-m.length)),(m.substr(0,20)+(m.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:f(function(){var m=this.pastInput(),E=new Array(m.length+1).join("-");return m+this.upcomingInput()+`
5
+ `+E+"^"},"showPosition"),test_match:f(function(m,E){var g,O,o;if(this.options.backtrack_lexer&&(o={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(o.yylloc.range=this.yylloc.range.slice(0))),O=m[0].match(/(?:\r\n?|\n).*/g),O&&(this.yylineno+=O.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:O?O[O.length-1].length-O[O.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+m[0].length},this.yytext+=m[0],this.match+=m[0],this.matches=m,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(m[0].length),this.matched+=m[0],g=this.performAction.call(this,this.yy,this,E,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),g)return g;if(this._backtrack){for(var P in o)this[P]=o[P];return!1}return!1},"test_match"),next:f(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var m,E,g,O;this._more||(this.yytext="",this.match="");for(var o=this._currentRules(),P=0;P<o.length;P++)if(g=this._input.match(this.rules[o[P]]),g&&(!E||g[0].length>E[0].length)){if(E=g,O=P,this.options.backtrack_lexer){if(m=this.test_match(g,o[P]),m!==!1)return m;if(this._backtrack){E=!1;continue}else return!1}else if(!this.options.flex)break}return E?(m=this.test_match(E,o[O]),m!==!1?m:!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:f(function(){var m=this.next();return m||this.lex()},"lex"),begin:f(function(m){this.conditionStack.push(m)},"begin"),popState:f(function(){var m=this.conditionStack.length-1;return m>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:f(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:f(function(m){return m=this.conditionStack.length-1-Math.abs(m||0),m>=0?this.conditionStack[m]:"INITIAL"},"topState"),pushState:f(function(m){this.begin(m)},"pushState"),stateStackSize:f(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:f(function(m,E,g,O){switch(g){case 0:return 6;case 1:return 7;case 2:return 8;case 3:return 9;case 4:return 22;case 5:return 23;case 6:return this.begin("acc_title"),24;case 7:return this.popState(),"acc_title_value";case 8:return this.begin("acc_descr"),26;case 9:return this.popState(),"acc_descr_value";case 10:this.begin("acc_descr_multiline");break;case 11:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:break;case 14:c;break;case 15:return 12;case 16:break;case 17:return 11;case 18:return 15;case 19:return 16;case 20:return 17;case 21:return 18;case 22:return this.begin("person_ext"),45;case 23:return this.begin("person"),44;case 24:return this.begin("system_ext_queue"),51;case 25:return this.begin("system_ext_db"),50;case 26:return this.begin("system_ext"),49;case 27:return this.begin("system_queue"),48;case 28:return this.begin("system_db"),47;case 29:return this.begin("system"),46;case 30:return this.begin("boundary"),37;case 31:return this.begin("enterprise_boundary"),34;case 32:return this.begin("system_boundary"),36;case 33:return this.begin("container_ext_queue"),57;case 34:return this.begin("container_ext_db"),56;case 35:return this.begin("container_ext"),55;case 36:return this.begin("container_queue"),54;case 37:return this.begin("container_db"),53;case 38:return this.begin("container"),52;case 39:return this.begin("container_boundary"),38;case 40:return this.begin("component_ext_queue"),63;case 41:return this.begin("component_ext_db"),62;case 42:return this.begin("component_ext"),61;case 43:return this.begin("component_queue"),60;case 44:return this.begin("component_db"),59;case 45:return this.begin("component"),58;case 46:return this.begin("node"),39;case 47:return this.begin("node"),39;case 48:return this.begin("node_l"),40;case 49:return this.begin("node_r"),41;case 50:return this.begin("rel"),64;case 51:return this.begin("birel"),65;case 52:return this.begin("rel_u"),66;case 53:return this.begin("rel_u"),66;case 54:return this.begin("rel_d"),67;case 55:return this.begin("rel_d"),67;case 56:return this.begin("rel_l"),68;case 57:return this.begin("rel_l"),68;case 58:return this.begin("rel_r"),69;case 59:return this.begin("rel_r"),69;case 60:return this.begin("rel_b"),70;case 61:return this.begin("rel_index"),71;case 62:return this.begin("update_el_style"),72;case 63:return this.begin("update_rel_style"),73;case 64:return this.begin("update_layout_config"),74;case 65:return"EOF_IN_STRUCT";case 66:return this.begin("attribute"),"ATTRIBUTE_EMPTY";case 67:this.begin("attribute");break;case 68:this.popState(),this.popState();break;case 69:return 80;case 70:break;case 71:return 80;case 72:this.begin("string");break;case 73:this.popState();break;case 74:return"STR";case 75:this.begin("string_kv");break;case 76:return this.begin("string_kv_key"),"STR_KEY";case 77:this.popState(),this.begin("string_kv_value");break;case 78:return"STR_VALUE";case 79:this.popState(),this.popState();break;case 80:return"STR";case 81:return"LBRACE";case 82:return"RBRACE";case 83:return"SPACE";case 84:return"EOL";case 85:return 14}},"anonymous"),rules:[/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:title\s[^#\n;]+)/,/^(?:accDescription\s[^#\n;]+)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/,/^(?:%%[^\n]*(\r?\n)*)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:C4Context\b)/,/^(?:C4Container\b)/,/^(?:C4Component\b)/,/^(?:C4Dynamic\b)/,/^(?:C4Deployment\b)/,/^(?:Person_Ext\b)/,/^(?:Person\b)/,/^(?:SystemQueue_Ext\b)/,/^(?:SystemDb_Ext\b)/,/^(?:System_Ext\b)/,/^(?:SystemQueue\b)/,/^(?:SystemDb\b)/,/^(?:System\b)/,/^(?:Boundary\b)/,/^(?:Enterprise_Boundary\b)/,/^(?:System_Boundary\b)/,/^(?:ContainerQueue_Ext\b)/,/^(?:ContainerDb_Ext\b)/,/^(?:Container_Ext\b)/,/^(?:ContainerQueue\b)/,/^(?:ContainerDb\b)/,/^(?:Container\b)/,/^(?:Container_Boundary\b)/,/^(?:ComponentQueue_Ext\b)/,/^(?:ComponentDb_Ext\b)/,/^(?:Component_Ext\b)/,/^(?:ComponentQueue\b)/,/^(?:ComponentDb\b)/,/^(?:Component\b)/,/^(?:Deployment_Node\b)/,/^(?:Node\b)/,/^(?:Node_L\b)/,/^(?:Node_R\b)/,/^(?:Rel\b)/,/^(?:BiRel\b)/,/^(?:Rel_Up\b)/,/^(?:Rel_U\b)/,/^(?:Rel_Down\b)/,/^(?:Rel_D\b)/,/^(?:Rel_Left\b)/,/^(?:Rel_L\b)/,/^(?:Rel_Right\b)/,/^(?:Rel_R\b)/,/^(?:Rel_Back\b)/,/^(?:RelIndex\b)/,/^(?:UpdateElementStyle\b)/,/^(?:UpdateRelStyle\b)/,/^(?:UpdateLayoutConfig\b)/,/^(?:$)/,/^(?:[(][ ]*[,])/,/^(?:[(])/,/^(?:[)])/,/^(?:,,)/,/^(?:,)/,/^(?:[ ]*["]["])/,/^(?:[ ]*["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:[ ]*[\$])/,/^(?:[^=]*)/,/^(?:[=][ ]*["])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:[^,]+)/,/^(?:\{)/,/^(?:\})/,/^(?:[\s]+)/,/^(?:[\n\r]+)/,/^(?:$)/],conditions:{acc_descr_multiline:{rules:[11,12],inclusive:!1},acc_descr:{rules:[9],inclusive:!1},acc_title:{rules:[7],inclusive:!1},string_kv_value:{rules:[78,79],inclusive:!1},string_kv_key:{rules:[77],inclusive:!1},string_kv:{rules:[76],inclusive:!1},string:{rules:[73,74],inclusive:!1},attribute:{rules:[68,69,70,71,72,75,80],inclusive:!1},update_layout_config:{rules:[65,66,67,68],inclusive:!1},update_rel_style:{rules:[65,66,67,68],inclusive:!1},update_el_style:{rules:[65,66,67,68],inclusive:!1},rel_b:{rules:[65,66,67,68],inclusive:!1},rel_r:{rules:[65,66,67,68],inclusive:!1},rel_l:{rules:[65,66,67,68],inclusive:!1},rel_d:{rules:[65,66,67,68],inclusive:!1},rel_u:{rules:[65,66,67,68],inclusive:!1},rel_bi:{rules:[],inclusive:!1},rel:{rules:[65,66,67,68],inclusive:!1},node_r:{rules:[65,66,67,68],inclusive:!1},node_l:{rules:[65,66,67,68],inclusive:!1},node:{rules:[65,66,67,68],inclusive:!1},index:{rules:[],inclusive:!1},rel_index:{rules:[65,66,67,68],inclusive:!1},component_ext_queue:{rules:[65,66,67,68],inclusive:!1},component_ext_db:{rules:[65,66,67,68],inclusive:!1},component_ext:{rules:[65,66,67,68],inclusive:!1},component_queue:{rules:[65,66,67,68],inclusive:!1},component_db:{rules:[65,66,67,68],inclusive:!1},component:{rules:[65,66,67,68],inclusive:!1},container_boundary:{rules:[65,66,67,68],inclusive:!1},container_ext_queue:{rules:[65,66,67,68],inclusive:!1},container_ext_db:{rules:[65,66,67,68],inclusive:!1},container_ext:{rules:[65,66,67,68],inclusive:!1},container_queue:{rules:[65,66,67,68],inclusive:!1},container_db:{rules:[65,66,67,68],inclusive:!1},container:{rules:[65,66,67,68],inclusive:!1},birel:{rules:[65,66,67,68],inclusive:!1},system_boundary:{rules:[65,66,67,68],inclusive:!1},enterprise_boundary:{rules:[65,66,67,68],inclusive:!1},boundary:{rules:[65,66,67,68],inclusive:!1},system_ext_queue:{rules:[65,66,67,68],inclusive:!1},system_ext_db:{rules:[65,66,67,68],inclusive:!1},system_ext:{rules:[65,66,67,68],inclusive:!1},system_queue:{rules:[65,66,67,68],inclusive:!1},system_db:{rules:[65,66,67,68],inclusive:!1},system:{rules:[65,66,67,68],inclusive:!1},person_ext:{rules:[65,66,67,68],inclusive:!1},person:{rules:[65,66,67,68],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,8,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,81,82,83,84,85],inclusive:!0}}};return z}();qe.lexer=kt;function je(){this.yy={}}return f(je,"Parser"),je.prototype=qe,qe.Parser=je,new je}();Ue.parser=Ue;var Xt=Ue,F=[],_e=[""],N="global",U="",$=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}],Pe=[],it="",nt=!1,Fe=4,Xe=2,gt,zt=f(function(){return gt},"getC4Type"),Qt=f(function(a){gt=bt(a,Ne())},"setC4Type"),$t=f(function(a,e,s,h,l,r,t,n,i){if(a==null||e===void 0||e===null||s===void 0||s===null||h===void 0||h===null)return;let d={},u=Pe.find(p=>p.from===e&&p.to===s);if(u?d=u:Pe.push(d),d.type=a,d.from=e,d.to=s,d.label={text:h},l==null)d.techn={text:""};else if(typeof l=="object"){let[p,b]=Object.entries(l)[0];d[p]={text:b}}else d.techn={text:l};if(r==null)d.descr={text:""};else if(typeof r=="object"){let[p,b]=Object.entries(r)[0];d[p]={text:b}}else d.descr={text:r};if(typeof t=="object"){let[p,b]=Object.entries(t)[0];d[p]=b}else d.sprite=t;if(typeof n=="object"){let[p,b]=Object.entries(n)[0];d[p]=b}else d.tags=n;if(typeof i=="object"){let[p,b]=Object.entries(i)[0];d[p]=b}else d.link=i;d.wrap=xe()},"addRel"),Wt=f(function(a,e,s,h,l,r,t){if(e===null||s===null)return;let n={},i=F.find(d=>d.alias===e);if(i&&e===i.alias?n=i:(n.alias=e,F.push(n)),s==null?n.label={text:""}:n.label={text:s},h==null)n.descr={text:""};else if(typeof h=="object"){let[d,u]=Object.entries(h)[0];n[d]={text:u}}else n.descr={text:h};if(typeof l=="object"){let[d,u]=Object.entries(l)[0];n[d]=u}else n.sprite=l;if(typeof r=="object"){let[d,u]=Object.entries(r)[0];n[d]=u}else n.tags=r;if(typeof t=="object"){let[d,u]=Object.entries(t)[0];n[d]=u}else n.link=t;n.typeC4Shape={text:a},n.parentBoundary=N,n.wrap=xe()},"addPersonOrSystem"),qt=f(function(a,e,s,h,l,r,t,n){if(e===null||s===null)return;let i={},d=F.find(u=>u.alias===e);if(d&&e===d.alias?i=d:(i.alias=e,F.push(i)),s==null?i.label={text:""}:i.label={text:s},h==null)i.techn={text:""};else if(typeof h=="object"){let[u,p]=Object.entries(h)[0];i[u]={text:p}}else i.techn={text:h};if(l==null)i.descr={text:""};else if(typeof l=="object"){let[u,p]=Object.entries(l)[0];i[u]={text:p}}else i.descr={text:l};if(typeof r=="object"){let[u,p]=Object.entries(r)[0];i[u]=p}else i.sprite=r;if(typeof t=="object"){let[u,p]=Object.entries(t)[0];i[u]=p}else i.tags=t;if(typeof n=="object"){let[u,p]=Object.entries(n)[0];i[u]=p}else i.link=n;i.wrap=xe(),i.typeC4Shape={text:a},i.parentBoundary=N},"addContainer"),Ht=f(function(a,e,s,h,l,r,t,n){if(e===null||s===null)return;let i={},d=F.find(u=>u.alias===e);if(d&&e===d.alias?i=d:(i.alias=e,F.push(i)),s==null?i.label={text:""}:i.label={text:s},h==null)i.techn={text:""};else if(typeof h=="object"){let[u,p]=Object.entries(h)[0];i[u]={text:p}}else i.techn={text:h};if(l==null)i.descr={text:""};else if(typeof l=="object"){let[u,p]=Object.entries(l)[0];i[u]={text:p}}else i.descr={text:l};if(typeof r=="object"){let[u,p]=Object.entries(r)[0];i[u]=p}else i.sprite=r;if(typeof t=="object"){let[u,p]=Object.entries(t)[0];i[u]=p}else i.tags=t;if(typeof n=="object"){let[u,p]=Object.entries(n)[0];i[u]=p}else i.link=n;i.wrap=xe(),i.typeC4Shape={text:a},i.parentBoundary=N},"addComponent"),Vt=f(function(a,e,s,h,l){if(a===null||e===null)return;let r={},t=$.find(n=>n.alias===a);if(t&&a===t.alias?r=t:(r.alias=a,$.push(r)),e==null?r.label={text:""}:r.label={text:e},s==null)r.type={text:"system"};else if(typeof s=="object"){let[n,i]=Object.entries(s)[0];r[n]={text:i}}else r.type={text:s};if(typeof h=="object"){let[n,i]=Object.entries(h)[0];r[n]=i}else r.tags=h;if(typeof l=="object"){let[n,i]=Object.entries(l)[0];r[n]=i}else r.link=l;r.parentBoundary=N,r.wrap=xe(),U=N,N=a,_e.push(U)},"addPersonOrSystemBoundary"),Gt=f(function(a,e,s,h,l){if(a===null||e===null)return;let r={},t=$.find(n=>n.alias===a);if(t&&a===t.alias?r=t:(r.alias=a,$.push(r)),e==null?r.label={text:""}:r.label={text:e},s==null)r.type={text:"container"};else if(typeof s=="object"){let[n,i]=Object.entries(s)[0];r[n]={text:i}}else r.type={text:s};if(typeof h=="object"){let[n,i]=Object.entries(h)[0];r[n]=i}else r.tags=h;if(typeof l=="object"){let[n,i]=Object.entries(l)[0];r[n]=i}else r.link=l;r.parentBoundary=N,r.wrap=xe(),U=N,N=a,_e.push(U)},"addContainerBoundary"),Kt=f(function(a,e,s,h,l,r,t,n){if(e===null||s===null)return;let i={},d=$.find(u=>u.alias===e);if(d&&e===d.alias?i=d:(i.alias=e,$.push(i)),s==null?i.label={text:""}:i.label={text:s},h==null)i.type={text:"node"};else if(typeof h=="object"){let[u,p]=Object.entries(h)[0];i[u]={text:p}}else i.type={text:h};if(l==null)i.descr={text:""};else if(typeof l=="object"){let[u,p]=Object.entries(l)[0];i[u]={text:p}}else i.descr={text:l};if(typeof t=="object"){let[u,p]=Object.entries(t)[0];i[u]=p}else i.tags=t;if(typeof n=="object"){let[u,p]=Object.entries(n)[0];i[u]=p}else i.link=n;i.nodeType=a,i.parentBoundary=N,i.wrap=xe(),U=N,N=e,_e.push(U)},"addDeploymentNode"),Jt=f(function(){N=U,_e.pop(),U=_e.pop(),_e.push(U)},"popBoundaryParseStack"),Zt=f(function(a,e,s,h,l,r,t,n,i,d,u){let p=F.find(b=>b.alias===e);if(!(p===void 0&&(p=$.find(b=>b.alias===e),p===void 0))){if(s!=null)if(typeof s=="object"){let[b,x]=Object.entries(s)[0];p[b]=x}else p.bgColor=s;if(h!=null)if(typeof h=="object"){let[b,x]=Object.entries(h)[0];p[b]=x}else p.fontColor=h;if(l!=null)if(typeof l=="object"){let[b,x]=Object.entries(l)[0];p[b]=x}else p.borderColor=l;if(r!=null)if(typeof r=="object"){let[b,x]=Object.entries(r)[0];p[b]=x}else p.shadowing=r;if(t!=null)if(typeof t=="object"){let[b,x]=Object.entries(t)[0];p[b]=x}else p.shape=t;if(n!=null)if(typeof n=="object"){let[b,x]=Object.entries(n)[0];p[b]=x}else p.sprite=n;if(i!=null)if(typeof i=="object"){let[b,x]=Object.entries(i)[0];p[b]=x}else p.techn=i;if(d!=null)if(typeof d=="object"){let[b,x]=Object.entries(d)[0];p[b]=x}else p.legendText=d;if(u!=null)if(typeof u=="object"){let[b,x]=Object.entries(u)[0];p[b]=x}else p.legendSprite=u}},"updateElStyle"),e0=f(function(a,e,s,h,l,r,t){let n=Pe.find(i=>i.from===e&&i.to===s);if(n!==void 0){if(h!=null)if(typeof h=="object"){let[i,d]=Object.entries(h)[0];n[i]=d}else n.textColor=h;if(l!=null)if(typeof l=="object"){let[i,d]=Object.entries(l)[0];n[i]=d}else n.lineColor=l;if(r!=null)if(typeof r=="object"){let[i,d]=Object.entries(r)[0];n[i]=parseInt(d)}else n.offsetX=parseInt(r);if(t!=null)if(typeof t=="object"){let[i,d]=Object.entries(t)[0];n[i]=parseInt(d)}else n.offsetY=parseInt(t)}},"updateRelStyle"),t0=f(function(a,e,s){let h=Fe,l=Xe;if(typeof e=="object"){let r=Object.values(e)[0];h=parseInt(r)}else h=parseInt(e);if(typeof s=="object"){let r=Object.values(s)[0];l=parseInt(r)}else l=parseInt(s);h>=1&&(Fe=h),l>=1&&(Xe=l)},"updateLayoutConfig"),a0=f(function(){return Fe},"getC4ShapeInRow"),i0=f(function(){return Xe},"getC4BoundaryInRow"),n0=f(function(){return N},"getCurrentBoundaryParse"),s0=f(function(){return U},"getParentBoundaryParse"),mt=f(function(a){return a==null?F:F.filter(e=>e.parentBoundary===a)},"getC4ShapeArray"),r0=f(function(a){return F.find(e=>e.alias===a)},"getC4Shape"),l0=f(function(a){return Object.keys(mt(a))},"getC4ShapeKeys"),_t=f(function(a){return a==null?$:$.filter(e=>e.parentBoundary===a)},"getBoundaries"),o0=_t,c0=f(function(){return Pe},"getRels"),h0=f(function(){return it},"getTitle"),d0=f(function(a){nt=a},"setWrap"),xe=f(function(){return nt},"autoWrap"),u0=f(function(){F=[],$=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}],U="",N="global",_e=[""],Pe=[],_e=[""],it="",nt=!1,Fe=4,Xe=2},"clear"),p0={SOLID:0,DOTTED:1,NOTE:2,SOLID_CROSS:3,DOTTED_CROSS:4,SOLID_OPEN:5,DOTTED_OPEN:6,LOOP_START:10,LOOP_END:11,ALT_START:12,ALT_ELSE:13,ALT_END:14,OPT_START:15,OPT_END:16,ACTIVE_START:17,ACTIVE_END:18,PAR_START:19,PAR_AND:20,PAR_END:21,RECT_START:22,RECT_END:23,SOLID_POINT:24,DOTTED_POINT:25},y0={FILLED:0,OPEN:1},f0={LEFTOF:0,RIGHTOF:1,OVER:2},b0=f(function(a){it=bt(a,Ne())},"setTitle"),et={addPersonOrSystem:Wt,addPersonOrSystemBoundary:Vt,addContainer:qt,addContainerBoundary:Gt,addComponent:Ht,addDeploymentNode:Kt,popBoundaryParseStack:Jt,addRel:$t,updateElStyle:Zt,updateRelStyle:e0,updateLayoutConfig:t0,autoWrap:xe,setWrap:d0,getC4ShapeArray:mt,getC4Shape:r0,getC4ShapeKeys:l0,getBoundaries:_t,getBoundarys:o0,getCurrentBoundaryParse:n0,getParentBoundaryParse:s0,getRels:c0,getTitle:h0,getC4Type:zt,getC4ShapeInRow:a0,getC4BoundaryInRow:i0,setAccTitle:Lt,getAccTitle:jt,getAccDescription:Bt,setAccDescription:Pt,getConfig:f(()=>Ne().c4,"getConfig"),clear:u0,LINETYPE:p0,ARROWTYPE:y0,PLACEMENT:f0,setTitle:b0,setC4Type:Qt},g0=Ut(Ft()),st=f(function(a,e){return Nt(a,e)},"drawRect"),xt=f(function(a,e,s,h,l,r){let t=a.append("image");t.attr("width",e),t.attr("height",s),t.attr("x",h),t.attr("y",l);let n=r.startsWith("data:image/png;base64")?r:(0,g0.sanitizeUrl)(r);t.attr("xlink:href",n)},"drawImage"),m0=f((a,e,s,h)=>{let l=a.append("g"),r=0;for(let t of e){let n=t.textColor?t.textColor:"#444444",i=t.lineColor?t.lineColor:"#444444",d=t.offsetX?parseInt(t.offsetX):0,u=t.offsetY?parseInt(t.offsetY):0,p="";if(r===0){let x=l.append("line");x.attr("x1",t.startPoint.x),x.attr("y1",t.startPoint.y),x.attr("x2",t.endPoint.x),x.attr("y2",t.endPoint.y),x.attr("stroke-width","1"),x.attr("stroke",i),x.style("fill","none"),t.type!=="rel_b"&&x.attr("marker-end","url("+p+"#"+h+"-arrowhead)"),(t.type==="birel"||t.type==="rel_b")&&x.attr("marker-start","url("+p+"#"+h+"-arrowend)"),r=-1}else{let x=l.append("path");x.attr("fill","none").attr("stroke-width","1").attr("stroke",i).attr("d","Mstartx,starty Qcontrolx,controly stopx,stopy ".replaceAll("startx",t.startPoint.x).replaceAll("starty",t.startPoint.y).replaceAll("controlx",t.startPoint.x+(t.endPoint.x-t.startPoint.x)/2-(t.endPoint.x-t.startPoint.x)/4).replaceAll("controly",t.startPoint.y+(t.endPoint.y-t.startPoint.y)/2).replaceAll("stopx",t.endPoint.x).replaceAll("stopy",t.endPoint.y)),t.type!=="rel_b"&&x.attr("marker-end","url("+p+"#"+h+"-arrowhead)"),(t.type==="birel"||t.type==="rel_b")&&x.attr("marker-start","url("+p+"#"+h+"-arrowend)")}let b=s.messageFont();q(s)(t.label.text,l,Math.min(t.startPoint.x,t.endPoint.x)+Math.abs(t.endPoint.x-t.startPoint.x)/2+d,Math.min(t.startPoint.y,t.endPoint.y)+Math.abs(t.endPoint.y-t.startPoint.y)/2+u,t.label.width,t.label.height,{fill:n},b),t.techn&&t.techn.text!==""&&(b=s.messageFont(),q(s)("["+t.techn.text+"]",l,Math.min(t.startPoint.x,t.endPoint.x)+Math.abs(t.endPoint.x-t.startPoint.x)/2+d,Math.min(t.startPoint.y,t.endPoint.y)+Math.abs(t.endPoint.y-t.startPoint.y)/2+s.messageFontSize+5+u,Math.max(t.label.width,t.techn.width),t.techn.height,{fill:n,"font-style":"italic"},b))}},"drawRels"),_0=f(function(a,e,s){let h=a.append("g"),l=e.bgColor?e.bgColor:"none",r=e.borderColor?e.borderColor:"#444444",t=e.fontColor?e.fontColor:"black",n={"stroke-width":1,"stroke-dasharray":"7.0,7.0"};e.nodeType&&(n={"stroke-width":1});let i={x:e.x,y:e.y,fill:l,stroke:r,width:e.width,height:e.height,rx:2.5,ry:2.5,attrs:n};st(h,i);let d=s.boundaryFont();d.fontWeight="bold",d.fontSize=d.fontSize+2,d.fontColor=t,q(s)(e.label.text,h,e.x,e.y+e.label.Y,e.width,e.height,{fill:"#444444"},d),e.type&&e.type.text!==""&&(d=s.boundaryFont(),d.fontColor=t,q(s)(e.type.text,h,e.x,e.y+e.type.Y,e.width,e.height,{fill:"#444444"},d)),e.descr&&e.descr.text!==""&&(d=s.boundaryFont(),d.fontSize=d.fontSize-2,d.fontColor=t,q(s)(e.descr.text,h,e.x,e.y+e.descr.Y,e.width,e.height,{fill:"#444444"},d))},"drawBoundary"),x0=f(function(a,e,s){var p;let h=e.bgColor?e.bgColor:s[e.typeC4Shape.text+"_bg_color"],l=e.borderColor?e.borderColor:s[e.typeC4Shape.text+"_border_color"],r=e.fontColor?e.fontColor:"#FFFFFF",t="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACD0lEQVR4Xu2YoU4EMRCGT+4j8Ai8AhaH4QHgAUjQuFMECUgMIUgwJAgMhgQsAYUiJCiQIBBY+EITsjfTdme6V24v4c8vyGbb+ZjOtN0bNcvjQXmkH83WvYBWto6PLm6v7p7uH1/w2fXD+PBycX1Pv2l3IdDm/vn7x+dXQiAubRzoURa7gRZWd0iGRIiJbOnhnfYBQZNJjNbuyY2eJG8fkDE3bbG4ep6MHUAsgYxmE3nVs6VsBWJSGccsOlFPmLIViMzLOB7pCVO2AtHJMohH7Fh6zqitQK7m0rJvAVYgGcEpe//PLdDz65sM4pF9N7ICcXDKIB5Nv6j7tD0NoSdM2QrU9Gg0ewE1LqBhHR3BBdvj2vapnidjHxD/q6vd7Pvhr31AwcY8eXMTXAKECZZJFXuEq27aLgQK5uLMohCenGGuGewOxSjBvYBqeG6B+Nqiblggdjnc+ZXDy+FNFpFzw76O3UBAROuXh6FoiAcf5g9eTvUgzy0nWg6I8cXHRUpg5bOVBCo+KDpFajOf23GgPme7RSQ+lacIENUgJ6gg1k6HjgOlqnLqip4tEuhv0hNEMXUD0clyXE3p6pZA0S2nnvTlXwLJEZWlb7cTQH1+USgTN4VhAenm/wea1OCAOmqo6fE1WCb9WSKBah+rbUWPWAmE2Rvk0ApiB45eOyNAzU8xcTvj8KvkKEoOaIYeHNA3ZuygAvFMUO0AAAAASUVORK5CYII=";switch(e.typeC4Shape.text){case"person":t="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACD0lEQVR4Xu2YoU4EMRCGT+4j8Ai8AhaH4QHgAUjQuFMECUgMIUgwJAgMhgQsAYUiJCiQIBBY+EITsjfTdme6V24v4c8vyGbb+ZjOtN0bNcvjQXmkH83WvYBWto6PLm6v7p7uH1/w2fXD+PBycX1Pv2l3IdDm/vn7x+dXQiAubRzoURa7gRZWd0iGRIiJbOnhnfYBQZNJjNbuyY2eJG8fkDE3bbG4ep6MHUAsgYxmE3nVs6VsBWJSGccsOlFPmLIViMzLOB7pCVO2AtHJMohH7Fh6zqitQK7m0rJvAVYgGcEpe//PLdDz65sM4pF9N7ICcXDKIB5Nv6j7tD0NoSdM2QrU9Gg0ewE1LqBhHR3BBdvj2vapnidjHxD/q6vd7Pvhr31AwcY8eXMTXAKECZZJFXuEq27aLgQK5uLMohCenGGuGewOxSjBvYBqeG6B+Nqiblggdjnc+ZXDy+FNFpFzw76O3UBAROuXh6FoiAcf5g9eTvUgzy0nWg6I8cXHRUpg5bOVBCo+KDpFajOf23GgPme7RSQ+lacIENUgJ6gg1k6HjgOlqnLqip4tEuhv0hNEMXUD0clyXE3p6pZA0S2nnvTlXwLJEZWlb7cTQH1+USgTN4VhAenm/wea1OCAOmqo6fE1WCb9WSKBah+rbUWPWAmE2Rvk0ApiB45eOyNAzU8xcTvj8KvkKEoOaIYeHNA3ZuygAvFMUO0AAAAASUVORK5CYII=";break;case"external_person":t="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAAB6ElEQVR4Xu2YLY+EMBCG9+dWr0aj0Wg0Go1Go0+j8Xdv2uTCvv1gpt0ebHKPuhDaeW4605Z9mJvx4AdXUyTUdd08z+u6flmWZRnHsWkafk9DptAwDPu+f0eAYtu2PEaGWuj5fCIZrBAC2eLBAnRCsEkkxmeaJp7iDJ2QMDdHsLg8SxKFEJaAo8lAXnmuOFIhTMpxxKATebo4UiFknuNo4OniSIXQyRxEA3YsnjGCVEjVXD7yLUAqxBGUyPv/Y4W2beMgGuS7kVQIBycH0fD+oi5pezQETxdHKmQKGk1eQEYldK+jw5GxPfZ9z7Mk0Qnhf1W1m3w//EUn5BDmSZsbR44QQLBEqrBHqOrmSKaQAxdnLArCrxZcM7A7ZKs4ioRq8LFC+NpC3WCBJsvpVw5edm9iEXFuyNfxXAgSwfrFQ1c0iNda8AdejvUgnktOtJQQxmcfFzGglc5WVCj7oDgFqU18boeFSs52CUh8LE8BIVQDT1ABrB0HtgSEYlX5doJnCwv9TXocKCaKbnwhdDKPq4lf3SwU3HLq4V/+WYhHVMa/3b4IlfyikAduCkcBc7mQ3/z/Qq/cTuikhkzB12Ae/mcJC9U+Vo8Ej1gWAtgbeGgFsAMHr50BIWOLCbezvhpBFUdY6EJuJ/QDW0XoMX60zZ0AAAAASUVORK5CYII=";break}let n=a.append("g");n.attr("class","person-man");let i=Dt();switch(e.typeC4Shape.text){case"person":case"external_person":case"system":case"external_system":case"container":case"external_container":case"component":case"external_component":i.x=e.x,i.y=e.y,i.fill=h,i.width=e.width,i.height=e.height,i.stroke=l,i.rx=2.5,i.ry=2.5,i.attrs={"stroke-width":.5},st(n,i);break;case"system_db":case"external_system_db":case"container_db":case"external_container_db":case"component_db":case"external_component_db":n.append("path").attr("fill",h).attr("stroke-width","0.5").attr("stroke",l).attr("d","Mstartx,startyc0,-10 half,-10 half,-10c0,0 half,0 half,10l0,heightc0,10 -half,10 -half,10c0,0 -half,0 -half,-10l0,-height".replaceAll("startx",e.x).replaceAll("starty",e.y).replaceAll("half",e.width/2).replaceAll("height",e.height)),n.append("path").attr("fill","none").attr("stroke-width","0.5").attr("stroke",l).attr("d","Mstartx,startyc0,10 half,10 half,10c0,0 half,0 half,-10".replaceAll("startx",e.x).replaceAll("starty",e.y).replaceAll("half",e.width/2));break;case"system_queue":case"external_system_queue":case"container_queue":case"external_container_queue":case"component_queue":case"external_component_queue":n.append("path").attr("fill",h).attr("stroke-width","0.5").attr("stroke",l).attr("d","Mstartx,startylwidth,0c5,0 5,half 5,halfc0,0 0,half -5,halfl-width,0c-5,0 -5,-half -5,-halfc0,0 0,-half 5,-half".replaceAll("startx",e.x).replaceAll("starty",e.y).replaceAll("width",e.width).replaceAll("half",e.height/2)),n.append("path").attr("fill","none").attr("stroke-width","0.5").attr("stroke",l).attr("d","Mstartx,startyc-5,0 -5,half -5,halfc0,half 5,half 5,half".replaceAll("startx",e.x+e.width).replaceAll("starty",e.y).replaceAll("half",e.height/2));break}let d=T0(s,e.typeC4Shape.text);switch(n.append("text").attr("fill",r).attr("font-family",d.fontFamily).attr("font-size",d.fontSize-2).attr("font-style","italic").attr("lengthAdjust","spacing").attr("textLength",e.typeC4Shape.width).attr("x",e.x+e.width/2-e.typeC4Shape.width/2).attr("y",e.y+e.typeC4Shape.Y).text("<<"+e.typeC4Shape.text+">>"),e.typeC4Shape.text){case"person":case"external_person":xt(n,48,48,e.x+e.width/2-24,e.y+e.image.Y,t);break}let u=s[e.typeC4Shape.text+"Font"]();return u.fontWeight="bold",u.fontSize=u.fontSize+2,u.fontColor=r,q(s)(e.label.text,n,e.x,e.y+e.label.Y,e.width,e.height,{fill:r},u),u=s[e.typeC4Shape.text+"Font"](),u.fontColor=r,e.techn&&((p=e.techn)==null?void 0:p.text)!==""?q(s)(e.techn.text,n,e.x,e.y+e.techn.Y,e.width,e.height,{fill:r,"font-style":"italic"},u):e.type&&e.type.text!==""&&q(s)(e.type.text,n,e.x,e.y+e.type.Y,e.width,e.height,{fill:r,"font-style":"italic"},u),e.descr&&e.descr.text!==""&&(u=s.personFont(),u.fontColor=r,q(s)(e.descr.text,n,e.x,e.y+e.descr.Y,e.width,e.height,{fill:r},u)),e.height},"drawC4Shape"),E0=f(function(a,e){a.append("defs").append("symbol").attr("id",e+"-database").attr("fill-rule","evenodd").attr("clip-rule","evenodd").append("path").attr("transform","scale(.5)").attr("d","M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z")},"insertDatabaseIcon"),S0=f(function(a,e){a.append("defs").append("symbol").attr("id",e+"-computer").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z")},"insertComputerIcon"),A0=f(function(a,e){a.append("defs").append("symbol").attr("id",e+"-clock").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z")},"insertClockIcon"),C0=f(function(a,e){a.append("defs").append("marker").attr("id",e+"-arrowhead").attr("refX",9).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")},"insertArrowHead"),k0=f(function(a,e){a.append("defs").append("marker").attr("id",e+"-arrowend").attr("refX",1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 z")},"insertArrowEnd"),w0=f(function(a,e){a.append("defs").append("marker").attr("id",e+"-filled-head").attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"insertArrowFilledHead"),O0=f(function(a,e){let s=a.append("defs").append("marker").attr("id",e+"-crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",16).attr("refY",4);s.append("path").attr("fill","black").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1px").attr("d","M 9,2 V 6 L16,4 Z"),s.append("path").attr("fill","none").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1px").attr("d","M 0,1 L 6,7 M 6,1 L 0,7")},"insertArrowCrossHead"),T0=f((a,e)=>({fontFamily:a[e+"FontFamily"],fontSize:a[e+"FontSize"],fontWeight:a[e+"FontWeight"]}),"getC4ShapeFont"),q=function(){function a(l,r,t,n,i,d,u){let p=r.append("text").attr("x",t+i/2).attr("y",n+d/2+5).style("text-anchor","middle").text(l);h(p,u)}f(a,"byText");function e(l,r,t,n,i,d,u,p){let{fontSize:b,fontFamily:x,fontWeight:T}=p,v=l.split(Ze.lineBreakRegex);for(let B=0;B<v.length;B++){let X=B*b-b*(v.length-1)/2,I=r.append("text").attr("x",t+i/2).attr("y",n).style("text-anchor","middle").attr("dominant-baseline","middle").style("font-size",b).style("font-weight",T).style("font-family",x);I.append("tspan").attr("dy",X).text(v[B]).attr("alignment-baseline","mathematical"),h(I,u)}}f(e,"byTspan");function s(l,r,t,n,i,d,u,p){let b=r.append("switch"),x=b.append("foreignObject").attr("x",t).attr("y",n).attr("width",i).attr("height",d).append("xhtml:div").style("display","table").style("height","100%").style("width","100%");x.append("div").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(l),e(l,b,t,n,i,d,u,p),h(x,u)}f(s,"byFo");function h(l,r){for(let t in r)r.hasOwnProperty(t)&&l.attr(t,r[t])}return f(h,"_setTextAttrs"),function(l){return l.textPlacement==="fo"?s:l.textPlacement==="old"?a:e}}(),Q={drawRect:st,drawBoundary:_0,drawC4Shape:x0,drawRels:m0,drawImage:xt,insertArrowHead:C0,insertArrowEnd:k0,insertArrowFilledHead:w0,insertArrowCrossHead:O0,insertDatabaseIcon:E0,insertComputerIcon:S0,insertClockIcon:A0},ze=0,Qe=0,Et=4,tt=2;Ue.yy=et;var _={},Te,St=(Te=class{constructor(e){this.name="",this.data={},this.data.startx=void 0,this.data.stopx=void 0,this.data.starty=void 0,this.data.stopy=void 0,this.data.widthLimit=void 0,this.nextData={},this.nextData.startx=void 0,this.nextData.stopx=void 0,this.nextData.starty=void 0,this.nextData.stopy=void 0,this.nextData.cnt=0,at(e.db.getConfig())}setData(e,s,h,l){this.nextData.startx=this.data.startx=e,this.nextData.stopx=this.data.stopx=s,this.nextData.starty=this.data.starty=h,this.nextData.stopy=this.data.stopy=l}updateVal(e,s,h,l){e[s]===void 0?e[s]=h:e[s]=l(h,e[s])}insert(e){this.nextData.cnt=this.nextData.cnt+1;let s=this.nextData.startx===this.nextData.stopx?this.nextData.stopx+e.margin:this.nextData.stopx+e.margin*2,h=s+e.width,l=this.nextData.starty+e.margin*2,r=l+e.height;(s>=this.data.widthLimit||h>=this.data.widthLimit||this.nextData.cnt>Et)&&(s=this.nextData.startx+e.margin+_.nextLinePaddingX,l=this.nextData.stopy+e.margin*2,this.nextData.stopx=h=s+e.width,this.nextData.starty=this.nextData.stopy,this.nextData.stopy=r=l+e.height,this.nextData.cnt=1),e.x=s,e.y=l,this.updateVal(this.data,"startx",s,Math.min),this.updateVal(this.data,"starty",l,Math.min),this.updateVal(this.data,"stopx",h,Math.max),this.updateVal(this.data,"stopy",r,Math.max),this.updateVal(this.nextData,"startx",s,Math.min),this.updateVal(this.nextData,"starty",l,Math.min),this.updateVal(this.nextData,"stopx",h,Math.max),this.updateVal(this.nextData,"stopy",r,Math.max)}init(e){this.name="",this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0,widthLimit:void 0},this.nextData={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0,cnt:0},at(e.db.getConfig())}bumpLastMargin(e){this.data.stopx+=e,this.data.stopy+=e}},f(Te,"Bounds"),Te),at=f(function(a){Mt(_,a),a.fontFamily&&(_.personFontFamily=_.systemFontFamily=_.messageFontFamily=a.fontFamily),a.fontSize&&(_.personFontSize=_.systemFontSize=_.messageFontSize=a.fontSize),a.fontWeight&&(_.personFontWeight=_.systemFontWeight=_.messageFontWeight=a.fontWeight)},"setConf"),De=f((a,e)=>({fontFamily:a[e+"FontFamily"],fontSize:a[e+"FontSize"],fontWeight:a[e+"FontWeight"]}),"c4ShapeFont"),Ie=f(a=>({fontFamily:a.boundaryFontFamily,fontSize:a.boundaryFontSize,fontWeight:a.boundaryFontWeight}),"boundaryFont"),v0=f(a=>({fontFamily:a.messageFontFamily,fontSize:a.messageFontSize,fontWeight:a.messageFontWeight}),"messageFont");function M(a,e,s,h,l){if(!e[a].width)if(s)e[a].text=It(e[a].text,l,h),e[a].textLines=e[a].text.split(Ze.lineBreakRegex).length,e[a].width=l,e[a].height=pt(e[a].text,h);else{let r=e[a].text.split(Ze.lineBreakRegex);e[a].textLines=r.length;let t=0;e[a].height=0,e[a].width=0;for(let n of r)e[a].width=Math.max(Oe(n,h),e[a].width),t=pt(n,h),e[a].height=e[a].height+t}}f(M,"calcC4ShapeTextWH");var At=f(function(a,e,s){e.x=s.data.startx,e.y=s.data.starty,e.width=s.data.stopx-s.data.startx,e.height=s.data.stopy-s.data.starty,e.label.y=_.c4ShapeMargin-35;let h=e.wrap&&_.wrap,l=Ie(_);l.fontSize=l.fontSize+2,l.fontWeight="bold";let r=Oe(e.label.text,l);M("label",e,h,l,r),Q.drawBoundary(a,e,_)},"drawBoundary"),Ct=f(function(a,e,s,h){let l=0;for(let r of h){l=0;let t=s[r],n=De(_,t.typeC4Shape.text);switch(n.fontSize=n.fontSize-2,t.typeC4Shape.width=Oe("«"+t.typeC4Shape.text+"»",n),t.typeC4Shape.height=n.fontSize+2,t.typeC4Shape.Y=_.c4ShapePadding,l=t.typeC4Shape.Y+t.typeC4Shape.height-4,t.image={width:0,height:0,Y:0},t.typeC4Shape.text){case"person":case"external_person":t.image.width=48,t.image.height=48,t.image.Y=l,l=t.image.Y+t.image.height;break}t.sprite&&(t.image.width=48,t.image.height=48,t.image.Y=l,l=t.image.Y+t.image.height);let i=t.wrap&&_.wrap,d=_.width-_.c4ShapePadding*2,u=De(_,t.typeC4Shape.text);if(u.fontSize=u.fontSize+2,u.fontWeight="bold",M("label",t,i,u,d),t.label.Y=l+8,l=t.label.Y+t.label.height,t.type&&t.type.text!==""){t.type.text="["+t.type.text+"]";let x=De(_,t.typeC4Shape.text);M("type",t,i,x,d),t.type.Y=l+5,l=t.type.Y+t.type.height}else if(t.techn&&t.techn.text!==""){t.techn.text="["+t.techn.text+"]";let x=De(_,t.techn.text);M("techn",t,i,x,d),t.techn.Y=l+5,l=t.techn.Y+t.techn.height}let p=l,b=t.label.width;if(t.descr&&t.descr.text!==""){let x=De(_,t.typeC4Shape.text);M("descr",t,i,x,d),t.descr.Y=l+20,l=t.descr.Y+t.descr.height,b=Math.max(t.label.width,t.descr.width),p=l-t.descr.textLines*5}b=b+_.c4ShapePadding,t.width=Math.max(t.width||_.width,b,_.width),t.height=Math.max(t.height||_.height,p,_.height),t.margin=t.margin||_.c4ShapeMargin,a.insert(t),Q.drawC4Shape(e,t,_)}a.bumpLastMargin(_.c4ShapeMargin)},"drawC4ShapeArray"),ve,Y=(ve=class{constructor(e,s){this.x=e,this.y=s}},f(ve,"Point"),ve),yt=f(function(a,e){let s=a.x,h=a.y,l=e.x,r=e.y,t=s+a.width/2,n=h+a.height/2,i=Math.abs(s-l),d=Math.abs(h-r),u=d/i,p=a.height/a.width,b=null;return h==r&&s<l?b=new Y(s+a.width,n):h==r&&s>l?b=new Y(s,n):s==l&&h<r?b=new Y(t,h+a.height):s==l&&h>r&&(b=new Y(t,h)),s>l&&h<r?p>=u?b=new Y(s,n+u*a.width/2):b=new Y(t-i/d*a.height/2,h+a.height):s<l&&h<r?p>=u?b=new Y(s+a.width,n+u*a.width/2):b=new Y(t+i/d*a.height/2,h+a.height):s<l&&h>r?p>=u?b=new Y(s+a.width,n-u*a.width/2):b=new Y(t+a.height/2*i/d,h):s>l&&h>r&&(p>=u?b=new Y(s,n-a.width/2*u):b=new Y(t-a.height/2*i/d,h)),b},"getIntersectPoint"),R0=f(function(a,e){let s={x:0,y:0};s.x=e.x+e.width/2,s.y=e.y+e.height/2;let h=yt(a,s);s.x=a.x+a.width/2,s.y=a.y+a.height/2;let l=yt(e,s);return{startPoint:h,endPoint:l}},"getIntersectPoints"),D0=f(function(a,e,s,h,l){let r=0;for(let t of e){r=r+1;let n=t.wrap&&_.wrap,i=v0(_);h.db.getC4Type()==="C4Dynamic"&&(t.label.text=r+": "+t.label.text);let d=Oe(t.label.text,i);M("label",t,n,i,d),t.techn&&t.techn.text!==""&&(d=Oe(t.techn.text,i),M("techn",t,n,i,d)),t.descr&&t.descr.text!==""&&(d=Oe(t.descr.text,i),M("descr",t,n,i,d));let u=s(t.from),p=s(t.to),b=R0(u,p);t.startPoint=b.startPoint,t.endPoint=b.endPoint}Q.drawRels(a,e,_,l)},"drawRels");function rt(a,e,s,h,l){let r=new St(l);r.data.widthLimit=s.data.widthLimit/Math.min(tt,h.length);for(let[t,n]of h.entries()){let i=0;n.image={width:0,height:0,Y:0},n.sprite&&(n.image.width=48,n.image.height=48,n.image.Y=i,i=n.image.Y+n.image.height);let d=n.wrap&&_.wrap,u=Ie(_);if(u.fontSize=u.fontSize+2,u.fontWeight="bold",M("label",n,d,u,r.data.widthLimit),n.label.Y=i+8,i=n.label.Y+n.label.height,n.type&&n.type.text!==""){n.type.text="["+n.type.text+"]";let T=Ie(_);M("type",n,d,T,r.data.widthLimit),n.type.Y=i+5,i=n.type.Y+n.type.height}if(n.descr&&n.descr.text!==""){let T=Ie(_);T.fontSize=T.fontSize-2,M("descr",n,d,T,r.data.widthLimit),n.descr.Y=i+20,i=n.descr.Y+n.descr.height}if(t==0||t%tt===0){let T=s.data.startx+_.diagramMarginX,v=s.data.stopy+_.diagramMarginY+i;r.setData(T,T,v,v)}else{let T=r.data.stopx!==r.data.startx?r.data.stopx+_.diagramMarginX:r.data.startx,v=r.data.starty;r.setData(T,T,v,v)}r.name=n.alias;let p=l.db.getC4ShapeArray(n.alias),b=l.db.getC4ShapeKeys(n.alias);b.length>0&&Ct(r,a,p,b),e=n.alias;let x=l.db.getBoundaries(e);x.length>0&&rt(a,e,r,x,l),n.alias!=="global"&&At(a,n,r),s.data.stopy=Math.max(r.data.stopy+_.c4ShapeMargin,s.data.stopy),s.data.stopx=Math.max(r.data.stopx+_.c4ShapeMargin,s.data.stopx),ze=Math.max(ze,s.data.stopx),Qe=Math.max(Qe,s.data.stopy)}}f(rt,"drawInsideBoundary");var N0=f(function(a,e,s,h){_=Ne().c4;let l=Ne().securityLevel,r;l==="sandbox"&&(r=Me("#i"+e));let t=l==="sandbox"?Me(r.nodes()[0].contentDocument.body):Me("body"),n=h.db;h.db.setWrap(_.wrap),Et=n.getC4ShapeInRow(),tt=n.getC4BoundaryInRow(),ut.debug(`C:${JSON.stringify(_,null,2)}`);let i=l==="sandbox"?t.select(`[id="${e}"]`):Me(`[id="${e}"]`);Q.insertComputerIcon(i,e),Q.insertDatabaseIcon(i,e),Q.insertClockIcon(i,e);let d=new St(h);d.setData(_.diagramMarginX,_.diagramMarginX,_.diagramMarginY,_.diagramMarginY),d.data.widthLimit=screen.availWidth,ze=_.diagramMarginX,Qe=_.diagramMarginY;let u=h.db.getTitle(),p=h.db.getBoundaries("");rt(i,"",d,p,h),Q.insertArrowHead(i,e),Q.insertArrowEnd(i,e),Q.insertArrowCrossHead(i,e),Q.insertArrowFilledHead(i,e),D0(i,h.db.getRels(),h.db.getC4Shape,h,e),d.data.stopx=ze,d.data.stopy=Qe;let b=d.data,x=b.stopy-b.starty+2*_.diagramMarginY,T=b.stopx-b.startx+2*_.diagramMarginX;u&&i.append("text").text(u).attr("x",(b.stopx-b.startx)/2-4*_.diagramMarginX).attr("y",b.starty+_.diagramMarginY),Yt(i,x,T,_.useMaxWidth);let v=u?60:0;i.attr("viewBox",b.startx-_.diagramMarginX+" -"+(_.diagramMarginY+v)+" "+T+" "+(x+v)),ut.debug("models:",b)},"draw"),ft={drawPersonOrSystemArray:Ct,drawBoundary:At,setConf:at,draw:N0},P0=f(a=>`.person {
7
+ stroke: ${a.personBorder};
8
+ fill: ${a.personBkg};
9
+ }
10
+ `,"getStyles"),B0=P0,M0={parser:Xt,db:et,renderer:ft,styles:B0,init:f(({c4:a,wrap:e})=>{ft.setConf(a),et.setWrap(e)},"init")};export{M0 as diagram};