@agent-link/server 0.1.533 → 0.1.534
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/web/dist/assets/{abnfDiagram-VRR7QNED-DTqibD6g.js → abnfDiagram-VRR7QNED-uLfBG5c2.js} +1 -1
- package/web/dist/assets/{arc-C3eew4e6.js → arc-BGdjQ00R.js} +1 -1
- package/web/dist/assets/{architectureDiagram-ZJ3FMSHR-uRA0GwvC.js → architectureDiagram-ZJ3FMSHR-BRmwabaw.js} +1 -1
- package/web/dist/assets/{blockDiagram-677ZJIJ3-BfGl7qbg.js → blockDiagram-677ZJIJ3-Cp9eKgeI.js} +1 -1
- package/web/dist/assets/{c4Diagram-LMCZKHZV-1hm38Bwl.js → c4Diagram-LMCZKHZV-DW44Do52.js} +1 -1
- package/web/dist/assets/channel-BnqCG-Dw.js +1 -0
- package/web/dist/assets/{chunk-2Q5K7J3B-BUP52oYq.js → chunk-2Q5K7J3B-mMG9woD0.js} +1 -1
- package/web/dist/assets/{chunk-32BRIVSS-yQKEtQBT.js → chunk-32BRIVSS-DDfrCQ0o.js} +1 -1
- package/web/dist/assets/{chunk-5VM5RSS4-Cz5gzMlS.js → chunk-5VM5RSS4-B2vAHhDa.js} +1 -1
- package/web/dist/assets/{chunk-EX3LRPZG-rI_5p8L1.js → chunk-EX3LRPZG-Bsa_N4JZ.js} +1 -1
- package/web/dist/assets/{chunk-JWPE2WC7-DdFuOOTn.js → chunk-JWPE2WC7-JtFBx531.js} +1 -1
- package/web/dist/assets/{chunk-MOJQB5TN-C7pc0vwS.js → chunk-MOJQB5TN-D4mPG2GA.js} +1 -1
- package/web/dist/assets/{chunk-RYQCIY6F-B3lsjb_M.js → chunk-RYQCIY6F-Bxkw-otg.js} +1 -1
- package/web/dist/assets/{chunk-V7JOEXUC-D06UIgKi.js → chunk-V7JOEXUC-DTg4cVok.js} +1 -1
- package/web/dist/assets/{chunk-VR4S4FIN-W4KDoSuZ.js → chunk-VR4S4FIN-CldJRvUx.js} +1 -1
- package/web/dist/assets/{chunk-XXDRQBXY-DzYnzvEh.js → chunk-XXDRQBXY-BbuoW-HE.js} +1 -1
- package/web/dist/assets/classDiagram-OUVF2IWQ-6ZJ2_-kS.js +1 -0
- package/web/dist/assets/classDiagram-v2-EOCWNBFH-6ZJ2_-kS.js +1 -0
- package/web/dist/assets/{cose-bilkent-JH36ORCC-CLRpdoFA.js → cose-bilkent-JH36ORCC-GXxoB8zB.js} +1 -1
- package/web/dist/assets/{cssMode-0qcDWPvz.js → cssMode-BDcr5m9Y.js} +1 -1
- package/web/dist/assets/{cynefin-VYW2F7L2-D6nSGz8H.js → cynefin-VYW2F7L2-CLr3PsBp.js} +1 -1
- package/web/dist/assets/{cynefinDiagram-TSTJHNR4-9SSw1ZA7.js → cynefinDiagram-TSTJHNR4-mbHs6Rho.js} +1 -1
- package/web/dist/assets/{dagre-VKFMJZFB-CZQ-wTmp.js → dagre-VKFMJZFB-DuDbL3gl.js} +1 -1
- package/web/dist/assets/{diagram-FQU43EPY-CGfxGAx4.js → diagram-FQU43EPY-BMp5tGK_.js} +1 -1
- package/web/dist/assets/{diagram-G47NLZAW-iy9kh8dP.js → diagram-G47NLZAW-BVKirJR6.js} +1 -1
- package/web/dist/assets/{diagram-NH7WQ7WH-DYHISN3A.js → diagram-NH7WQ7WH-CnYm-gBy.js} +1 -1
- package/web/dist/assets/{diagram-OA4YK3LP-DHXgq-9w.js → diagram-OA4YK3LP-fSgXprAV.js} +1 -1
- package/web/dist/assets/{diagram-WEI45ONY-tzoJ1nXV.js → diagram-WEI45ONY-BL7Kl_pL.js} +1 -1
- package/web/dist/assets/{ebnfDiagram-CCIWWBDH-B-Ad4Y1C.js → ebnfDiagram-CCIWWBDH-B8X3ln_M.js} +1 -1
- package/web/dist/assets/{editor.main-CRrZGcc8.js → editor.main-C3pE_nrh.js} +3 -3
- package/web/dist/assets/{erDiagram-Q63AITRT-aiuxwx7u.js → erDiagram-Q63AITRT-CP8Ec_sU.js} +1 -1
- package/web/dist/assets/{flowDiagram-23GEKE2U-HsTatdI5.js → flowDiagram-23GEKE2U-CEiDjGfC.js} +1 -1
- package/web/dist/assets/{freemarker2-DJDpp-Fv.js → freemarker2-6_SeDtB6.js} +1 -1
- package/web/dist/assets/{ganttDiagram-NO4QXBWP-QNOROSP_.js → ganttDiagram-NO4QXBWP-CbRlidH9.js} +1 -1
- package/web/dist/assets/{gitGraphDiagram-IHSO6WYX-D7txQhQa.js → gitGraphDiagram-IHSO6WYX-D459Frpo.js} +1 -1
- package/web/dist/assets/{handlebars-CWDbpKYW.js → handlebars-D25l3den.js} +1 -1
- package/web/dist/assets/{html-BS45kqgL.js → html-Cjn0AvI2.js} +1 -1
- package/web/dist/assets/{htmlMode-CAnCR40m.js → htmlMode-CDXy_C_Y.js} +1 -1
- package/web/dist/assets/{index-DxesAJ2s.js → index-DJJA3FVt.js} +4 -4
- package/web/dist/assets/{infoDiagram-FWYZ7A6U-DWu6EBgQ.js → infoDiagram-FWYZ7A6U-D0IyhKxc.js} +1 -1
- package/web/dist/assets/{ishikawaDiagram-FXEZZL3T-DwEW4qqa.js → ishikawaDiagram-FXEZZL3T-ELjzMu8n.js} +1 -1
- package/web/dist/assets/{javascript-BF80ERom.js → javascript-n3m-HtNS.js} +1 -1
- package/web/dist/assets/{journeyDiagram-5HDEW3XC-O_oDrYzt.js → journeyDiagram-5HDEW3XC-DBsE5JH2.js} +1 -1
- package/web/dist/assets/{jsonMode-D1HXiMjp.js → jsonMode--h0vTBJ0.js} +1 -1
- package/web/dist/assets/{kanban-definition-HUTT4EX6-DIJ6SMSe.js → kanban-definition-HUTT4EX6-87vQac5H.js} +1 -1
- package/web/dist/assets/{linear-CmbVRcR_.js → linear-B1ObPt43.js} +1 -1
- package/web/dist/assets/{liquid-Dr7uz6WX.js → liquid-CA1UG9mx.js} +1 -1
- package/web/dist/assets/{lspLanguageFeatures-CdykXsuW.js → lspLanguageFeatures-BfcSvoZS.js} +1 -1
- package/web/dist/assets/{mdx-Yx41ZcrW.js → mdx-pxp0to6M.js} +1 -1
- package/web/dist/assets/{mermaid.core-CXWrxBgC.js → mermaid.core-FH1Glzn5.js} +2 -2
- package/web/dist/assets/{mindmap-definition-LN4V7U3C-DwxZKA6c.js → mindmap-definition-LN4V7U3C-BqRqeCBc.js} +1 -1
- package/web/dist/assets/{pegDiagram-2B236MQR-D8-bMh8z.js → pegDiagram-2B236MQR-BetC0mJ9.js} +1 -1
- package/web/dist/assets/{pieDiagram-ENE6RG2P-Dgk7sruZ.js → pieDiagram-ENE6RG2P--r8Rf9_F.js} +1 -1
- package/web/dist/assets/{python-B6tr8PTH.js → python-8ven4zNJ.js} +1 -1
- package/web/dist/assets/{quadrantDiagram-ABIIQ3AL-CODtFODk.js → quadrantDiagram-ABIIQ3AL-C3_N5i1Q.js} +1 -1
- package/web/dist/assets/{railroadDiagram-RFXS5EU6-DAe_gRtf.js → railroadDiagram-RFXS5EU6-DX0xwbU5.js} +1 -1
- package/web/dist/assets/{razor-CEKCSzig.js → razor-CI3lhkTW.js} +1 -1
- package/web/dist/assets/{requirementDiagram-TGXJPOKE-CY--9zSb.js → requirementDiagram-TGXJPOKE-t3uaSgTN.js} +1 -1
- package/web/dist/assets/{sankeyDiagram-HTMAVEWB-Ct9U2-g_.js → sankeyDiagram-HTMAVEWB-ClHSrQ4f.js} +1 -1
- package/web/dist/assets/{sequenceDiagram-DBY2YBRQ-DIqIRBpX.js → sequenceDiagram-DBY2YBRQ-C9hP2q9Q.js} +1 -1
- package/web/dist/assets/{sizeCapture-X5ZJPWSS-DrnpGiKz.js → sizeCapture-X5ZJPWSS-BQqeSWmg.js} +1 -1
- package/web/dist/assets/{stateDiagram-2N3HPSRC-X95EIyN0.js → stateDiagram-2N3HPSRC-BhC-Ti_v.js} +1 -1
- package/web/dist/assets/stateDiagram-v2-6OUMAXLB-DxTA5CHv.js +1 -0
- package/web/dist/assets/{swimlanes-5IMT3BWC-BeOG0dPV.js → swimlanes-5IMT3BWC-AfBpXIRF.js} +2 -2
- package/web/dist/assets/swimlanesDiagram-G3AALYLV-Ca6EAEHk.js +1 -0
- package/web/dist/assets/{timeline-definition-FHXFAJF6-BQ5Vnv63.js → timeline-definition-FHXFAJF6-BalMKLTj.js} +1 -1
- package/web/dist/assets/{tsMode-EwiMaZm0.js → tsMode-BC5ZW692.js} +1 -1
- package/web/dist/assets/{typescript-CBmYQinx.js → typescript-coiKehfO.js} +1 -1
- package/web/dist/assets/{vennDiagram-L72KCM5P-CEgiFAHT.js → vennDiagram-L72KCM5P-BouefLEQ.js} +1 -1
- package/web/dist/assets/{wardleyDiagram-EHGQE667-D7ypEdSe.js → wardleyDiagram-EHGQE667-CvijjHdM.js} +1 -1
- package/web/dist/assets/{xml-CyQ2wxNX.js → xml-C-tWnJ-Z.js} +1 -1
- package/web/dist/assets/{xychartDiagram-FW5EYKEG-IaYJgy1U.js → xychartDiagram-FW5EYKEG-DR-h_2AG.js} +1 -1
- package/web/dist/assets/{yaml-DEs_nBjf.js → yaml-Da9wIz5H.js} +1 -1
- package/web/dist/index.html +1 -1
- package/web/dist/assets/channel-DOciy6CL.js +0 -1
- package/web/dist/assets/classDiagram-OUVF2IWQ-D8vBbsZC.js +0 -1
- package/web/dist/assets/classDiagram-v2-EOCWNBFH-D8vBbsZC.js +0 -1
- package/web/dist/assets/stateDiagram-v2-6OUMAXLB-DRdWHuhY.js +0 -1
- package/web/dist/assets/swimlanesDiagram-G3AALYLV-HQ82s869.js +0 -1
package/web/dist/assets/{blockDiagram-677ZJIJ3-BfGl7qbg.js → blockDiagram-677ZJIJ3-Cp9eKgeI.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as t}from"./chunk-5VM5RSS4-Cz5gzMlS.js";import{az as e,aA as r,aB as a,aC as i,aD as n,aE as s,aF as o,aG as l,aH as c,aI as d,aJ as h,aK as g,aL as u,aM as y,aN as p,aO as x,aP as b,aQ as f,aR as m,aS as w,aT as k,aU as S,aV as L,aW as _,aX as v,_ as E,z as T,d as D,e as $,l as I,q as N,t as C,c as B,aY as O,a6 as R,a7 as z,a3 as A,aZ as M,a_ as P,a$ as Y,ar as j,y as F,k as W,b0 as X,i as H,b1 as U,b2 as K}from"./mermaid.core-CXWrxBgC.js";import{G as q}from"./graph-DaY0Al7L.js";import{c as Z}from"./channel-DOciy6CL.js";import"./index-DxesAJ2s.js";function V(t){if(e(t))return t;const E=r(t);if(!function(t){switch(r(t)){case v:case _:case L:case S:case k:case w:case m:case f:case b:case x:case p:case y:case u:case g:case h:case d:case c:case l:case o:case s:case n:case i:return!0;default:return!1}}(t))return{};if(T=t,Array.isArray(T)){const e=Array.from(t);return t.length>0&&"string"==typeof t[0]&&Object.hasOwn(t,"index")&&(e.index=t.index,e.input=t.input),e}var T;if(a(t)){const e=t;return new(0,e.constructor)(e.buffer,e.byteOffset,e.length)}if("[object ArrayBuffer]"===E)return new ArrayBuffer(t.byteLength);if("[object DataView]"===E){const e=t,r=e.buffer,a=e.byteOffset,i=e.byteLength,n=new ArrayBuffer(i),s=new Uint8Array(r,a,i);return new Uint8Array(n).set(s),new DataView(n)}if("[object Boolean]"===E||"[object Number]"===E||"[object String]"===E){const e=new(0,t.constructor)(t.valueOf());return"[object String]"===E?function(t,e){const r=e.valueOf().length;for(const a in e)Object.hasOwn(e,a)&&(Number.isNaN(Number(a))||Number(a)>=r)&&(t[a]=e[a])}(e,t):G(e,t),e}if("[object Date]"===E)return new Date(Number(t));if("[object RegExp]"===E){const e=t,r=new RegExp(e.source,e.flags);return r.lastIndex=e.lastIndex,r}if("[object Symbol]"===E)return Object(Symbol.prototype.valueOf.call(t));if("[object Map]"===E){const e=t,r=new Map;return e.forEach((t,e)=>{r.set(e,t)}),r}if("[object Set]"===E){const e=t,r=new Set;return e.forEach(t=>{r.add(t)}),r}if("[object Arguments]"===E){const e=t,r={};return G(r,e),r.length=e.length,r[Symbol.iterator]=e[Symbol.iterator],r}const D={};return function(t,e){const r=Object.getPrototypeOf(e);null!==r&&"function"==typeof e.constructor&&Object.setPrototypeOf(t,r)}(D,t),G(D,t),function(t,e){const r=Object.getOwnPropertySymbols(e);for(let a=0;a<r.length;a++){const i=r[a];Object.prototype.propertyIsEnumerable.call(e,i)&&(t[i]=e[i])}}(D,t),D}function G(t,e){for(const r in e)Object.hasOwn(e,r)&&(t[r]=e[r])}var J=function(){var t=E(function(t,e,r,a){for(r=r||{},a=t.length;a--;r[t[a]]=e);return r},"o"),e=[1,15],r=[1,7],a=[1,13],i=[1,14],n=[1,19],s=[1,16],o=[1,17],l=[1,18],c=[8,30],d=[8,10,21,28,29,30,31,39,43,46],h=[1,23],g=[1,24],u=[8,10,15,16,21,28,29,30,31,39,43,46],y=[8,10,15,16,21,27,28,29,30,31,39,43,46],p=[1,49],x={trace:E(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:E(function(t,e,r,a,i,n,s){var o=n.length-1;switch(i){case 4:a.getLogger().debug("Rule: separator (NL) ");break;case 5:a.getLogger().debug("Rule: separator (Space) ");break;case 6:a.getLogger().debug("Rule: separator (EOF) ");break;case 7:a.getLogger().debug("Rule: hierarchy: ",n[o-1]),a.setHierarchy(n[o-1]);break;case 8:a.getLogger().debug("Stop NL ");break;case 9:a.getLogger().debug("Stop EOF ");break;case 10:a.getLogger().debug("Stop NL2 ");break;case 11:a.getLogger().debug("Stop EOF2 ");break;case 12:a.getLogger().debug("Rule: statement: ",n[o]),"number"==typeof n[o].length?this.$=n[o]:this.$=[n[o]];break;case 13:a.getLogger().debug("Rule: statement #2: ",n[o-1]),this.$=[n[o-1]].concat(n[o]);break;case 14:a.getLogger().debug("Rule: link: ",n[o],t),this.$={edgeTypeStr:n[o],label:""};break;case 15:a.getLogger().debug("Rule: LABEL link: ",n[o-3],n[o-1],n[o]),this.$={edgeTypeStr:n[o],label:n[o-1]};break;case 18:const e=parseInt(n[o]),r=a.generateId();this.$={id:r,type:"space",label:"",width:e,children:[]};break;case 23:a.getLogger().debug("Rule: (nodeStatement link node) ",n[o-2],n[o-1],n[o]," typestr: ",n[o-1].edgeTypeStr);const i=a.edgeStrToEdgeData(n[o-1].edgeTypeStr),s=a.edgeStrToEdgeStartData(n[o-1].edgeTypeStr),l=a.edgeStrToThickness(n[o-1].edgeTypeStr),c=a.edgeStrToPattern(n[o-1].edgeTypeStr);this.$=[{id:n[o-2].id,label:n[o-2].label,type:n[o-2].type,directions:n[o-2].directions},{id:n[o-2].id+"-"+n[o].id,start:n[o-2].id,end:n[o].id,label:n[o-1].label,type:"edge",thickness:l,pattern:c,directions:n[o].directions,arrowTypeEnd:i,arrowTypeStart:s},{id:n[o].id,label:n[o].label,type:a.typeStr2Type(n[o].typeStr),directions:n[o].directions}];break;case 24:a.getLogger().debug("Rule: nodeStatement (abc88 node size) ",n[o-1],n[o]),this.$={id:n[o-1].id,label:n[o-1].label,type:a.typeStr2Type(n[o-1].typeStr),directions:n[o-1].directions,widthInColumns:parseInt(n[o],10)};break;case 25:a.getLogger().debug("Rule: nodeStatement (node) ",n[o]),this.$={id:n[o].id,label:n[o].label,type:a.typeStr2Type(n[o].typeStr),directions:n[o].directions,widthInColumns:1};break;case 26:a.getLogger().debug("APA123",this?this:"na"),a.getLogger().debug("COLUMNS: ",n[o]),this.$={type:"column-setting",columns:"auto"===n[o]?-1:parseInt(n[o])};break;case 27:a.getLogger().debug("Rule: id-block statement : ",n[o-2],n[o-1]),a.generateId(),this.$={...n[o-2],type:"composite",children:n[o-1]};break;case 28:a.getLogger().debug("Rule: blockStatement : ",n[o-2],n[o-1],n[o]);const d=a.generateId();this.$={id:d,type:"composite",label:"",children:n[o-1]};break;case 29:a.getLogger().debug("Rule: node (NODE_ID separator): ",n[o]),this.$={id:n[o]};break;case 30:a.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",n[o-1],n[o]),this.$={id:n[o-1],label:n[o].label,typeStr:n[o].typeStr,directions:n[o].directions};break;case 31:a.getLogger().debug("Rule: dirList: ",n[o]),this.$=[n[o]];break;case 32:a.getLogger().debug("Rule: dirList: ",n[o-1],n[o]),this.$=[n[o-1]].concat(n[o]);break;case 33:a.getLogger().debug("Rule: nodeShapeNLabel: ",n[o-2],n[o-1],n[o]),this.$={typeStr:n[o-2]+n[o],label:n[o-1]};break;case 34:a.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",n[o-3],n[o-2]," #3:",n[o-1],n[o]),this.$={typeStr:n[o-3]+n[o],label:n[o-2],directions:n[o-1]};break;case 35:case 36:this.$={type:"classDef",id:n[o-1].trim(),css:n[o].trim()};break;case 37:this.$={type:"applyClass",id:n[o-1].trim(),styleClass:n[o].trim()};break;case 38:this.$={type:"applyStyles",id:n[o-1].trim(),stylesStr:n[o].trim()}}},"anonymous"),table:[{9:1,10:[1,2]},{1:[3]},{10:e,11:3,13:4,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:a,29:i,31:n,39:s,43:o,46:l},{8:[1,20]},t(c,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,10:e,21:r,28:a,29:i,31:n,39:s,43:o,46:l}),t(d,[2,16],{14:22,15:h,16:g}),t(d,[2,17]),t(d,[2,18]),t(d,[2,19]),t(d,[2,20]),t(d,[2,21]),t(d,[2,22]),t(u,[2,25],{27:[1,25]}),t(d,[2,26]),{19:26,26:12,31:n},{10:e,11:27,13:4,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:a,29:i,31:n,39:s,43:o,46:l},{40:[1,28],42:[1,29]},{44:[1,30]},{47:[1,31]},t(y,[2,29],{32:32,35:[1,33],37:[1,34]}),{1:[2,7]},t(c,[2,13]),{26:35,31:n},{31:[2,14]},{17:[1,36]},t(u,[2,24]),{10:e,11:37,13:4,14:22,15:h,16:g,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:a,29:i,31:n,39:s,43:o,46:l},{30:[1,38]},{41:[1,39]},{41:[1,40]},{45:[1,41]},{48:[1,42]},t(y,[2,30]),{18:[1,43]},{18:[1,44]},t(u,[2,23]),{18:[1,45]},{30:[1,46]},t(d,[2,28]),t(d,[2,35]),t(d,[2,36]),t(d,[2,37]),t(d,[2,38]),{36:[1,47]},{33:48,34:p},{15:[1,50]},t(d,[2,27]),t(y,[2,33]),{38:[1,51]},{33:52,34:p,38:[2,31]},{31:[2,15]},t(y,[2,34]),{38:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:E(function(t,e){if(!e.recoverable){var r=new Error(t);throw r.hash=e,r}this.trace(t)},"parseError"),parse:E(function(t){var e=this,r=[0],a=[],i=[null],n=[],s=this.table,o="",l=0,c=0,d=n.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var u in this.yy)Object.prototype.hasOwnProperty.call(this.yy,u)&&(g.yy[u]=this.yy[u]);h.setInput(t,g.yy),g.yy.lexer=h,g.yy.parser=this,void 0===h.yylloc&&(h.yylloc={});var y=h.yylloc;n.push(y);var p=h.options&&h.options.ranges;function x(){var t;return"number"!=typeof(t=a.pop()||h.lex()||1)&&(t instanceof Array&&(t=(a=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof g.yy.parseError?this.parseError=g.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,E(function(t){r.length=r.length-2*t,i.length=i.length-t,n.length=n.length-t},"popStack"),E(x,"lex");for(var b,f,m,w,k,S,L,_,v={};;){if(f=r[r.length-1],this.defaultActions[f]?m=this.defaultActions[f]:(null==b&&(b=x()),m=s[f]&&s[f][b]),void 0===m||!m.length||!m[0]){var T="";for(k in _=[],s[f])this.terminals_[k]&&k>2&&_.push("'"+this.terminals_[k]+"'");T=h.showPosition?"Parse error on line "+(l+1)+":\n"+h.showPosition()+"\nExpecting "+_.join(", ")+", got '"+(this.terminals_[b]||b)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==b?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(T,{text:h.match,token:this.terminals_[b]||b,line:h.yylineno,loc:y,expected:_})}if(m[0]instanceof Array&&m.length>1)throw new Error("Parse Error: multiple actions possible at state: "+f+", token: "+b);switch(m[0]){case 1:r.push(b),i.push(h.yytext),n.push(h.yylloc),r.push(m[1]),b=null,c=h.yyleng,o=h.yytext,l=h.yylineno,y=h.yylloc;break;case 2:if(S=this.productions_[m[1]][1],v.$=i[i.length-S],v._$={first_line:n[n.length-(S||1)].first_line,last_line:n[n.length-1].last_line,first_column:n[n.length-(S||1)].first_column,last_column:n[n.length-1].last_column},p&&(v._$.range=[n[n.length-(S||1)].range[0],n[n.length-1].range[1]]),void 0!==(w=this.performAction.apply(v,[o,c,l,g.yy,m[1],i,n].concat(d))))return w;S&&(r=r.slice(0,-1*S*2),i=i.slice(0,-1*S),n=n.slice(0,-1*S)),r.push(this.productions_[m[1]][0]),i.push(v.$),n.push(v._$),L=s[r[r.length-2]][r[r.length-1]],r.push(L);break;case 3:return!0}}return!0},"parse")},b=function(){return{EOF:1,parseError:E(function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},"parseError"),setInput:E(function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:E(function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},"input"),unput:E(function(t){var e=t.length,r=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var a=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),r.length-1&&(this.yylineno-=r.length-1);var i=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:r?(r.length===a.length?this.yylloc.first_column:0)+a[a.length-r.length].length-r[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},"unput"),more:E(function(){return this._more=!0,this},"more"),reject:E(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:E(function(t){this.unput(this.match.slice(t))},"less"),pastInput:E(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:E(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:E(function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},"showPosition"),test_match:E(function(t,e){var r,a,i;if(this.options.backtrack_lexer&&(i={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&&(i.yylloc.range=this.yylloc.range.slice(0))),(a=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=a.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:a?a[a.length-1].length-a[a.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],r=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack){for(var n in i)this[n]=i[n];return!1}return!1},"test_match"),next:E(function(){if(this.done)return this.EOF;var t,e,r,a;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),n=0;n<i.length;n++)if((r=this._input.match(this.rules[i[n]]))&&(!e||r[0].length>e[0].length)){if(e=r,a=n,this.options.backtrack_lexer){if(!1!==(t=this.test_match(r,i[n])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,i[a]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:E(function(){var t=this.next();return t||this.lex()},"lex"),begin:E(function(t){this.conditionStack.push(t)},"begin"),popState:E(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:E(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:E(function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},"topState"),pushState:E(function(t){this.begin(t)},"pushState"),stateStackSize:E(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:E(function(t,e,r,a){switch(r){case 0:return t.getLogger().debug("Found block-beta"),10;case 1:return t.getLogger().debug("Found id-block"),29;case 2:return t.getLogger().debug("Found block"),10;case 3:t.getLogger().debug(".",e.yytext);break;case 4:t.getLogger().debug("_",e.yytext);break;case 5:return 5;case 6:return e.yytext=-1,28;case 7:return e.yytext=e.yytext.replace(/columns\s+/,""),t.getLogger().debug("COLUMNS (LEX)",e.yytext),28;case 8:case 76:case 77:case 99:this.pushState("md_string");break;case 9:return"MD_STR";case 10:case 34:case 79:this.popState();break;case 11:this.pushState("string");break;case 12:t.getLogger().debug("LEX: POPPING STR:",e.yytext),this.popState();break;case 13:return t.getLogger().debug("LEX: STR end:",e.yytext),"STR";case 14:return e.yytext=e.yytext.replace(/space\:/,""),t.getLogger().debug("SPACE NUM (LEX)",e.yytext),21;case 15:return e.yytext="1",t.getLogger().debug("COLUMNS (LEX)",e.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 35:return"acc_descr_multiline_value";case 36:return 30;case 37:case 38:case 40:case 41:case 44:return this.popState(),t.getLogger().debug("Lex: (("),"NODE_DEND";case 39:return this.popState(),t.getLogger().debug("Lex: ))"),"NODE_DEND";case 42:return this.popState(),t.getLogger().debug("Lex: (-"),"NODE_DEND";case 43:return this.popState(),t.getLogger().debug("Lex: -)"),"NODE_DEND";case 45:return this.popState(),t.getLogger().debug("Lex: ]]"),"NODE_DEND";case 46:return this.popState(),t.getLogger().debug("Lex: ("),"NODE_DEND";case 47:return this.popState(),t.getLogger().debug("Lex: ])"),"NODE_DEND";case 48:case 49:return this.popState(),t.getLogger().debug("Lex: /]"),"NODE_DEND";case 50:return this.popState(),t.getLogger().debug("Lex: )]"),"NODE_DEND";case 51:return this.popState(),t.getLogger().debug("Lex: )"),"NODE_DEND";case 52:return this.popState(),t.getLogger().debug("Lex: ]>"),"NODE_DEND";case 53:return this.popState(),t.getLogger().debug("Lex: ]"),"NODE_DEND";case 54:return t.getLogger().debug("Lexa: -)"),this.pushState("NODE"),35;case 55:return t.getLogger().debug("Lexa: (-"),this.pushState("NODE"),35;case 56:return t.getLogger().debug("Lexa: ))"),this.pushState("NODE"),35;case 57:case 59:case 60:case 61:case 64:return t.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 58:return t.getLogger().debug("Lex: ((("),this.pushState("NODE"),35;case 62:return t.getLogger().debug("Lexc: >"),this.pushState("NODE"),35;case 63:return t.getLogger().debug("Lexa: (["),this.pushState("NODE"),35;case 65:case 66:case 67:case 68:case 69:case 70:case 71:return this.pushState("NODE"),35;case 72:return t.getLogger().debug("Lexa: ["),this.pushState("NODE"),35;case 73:return this.pushState("BLOCK_ARROW"),t.getLogger().debug("LEX ARR START"),37;case 74:return t.getLogger().debug("Lex: NODE_ID",e.yytext),31;case 75:return t.getLogger().debug("Lex: EOF",e.yytext),8;case 78:return"NODE_DESCR";case 80:t.getLogger().debug("Lex: Starting string"),this.pushState("string");break;case 81:t.getLogger().debug("LEX ARR: Starting string"),this.pushState("string");break;case 82:return t.getLogger().debug("LEX: NODE_DESCR:",e.yytext),"NODE_DESCR";case 83:t.getLogger().debug("LEX POPPING"),this.popState();break;case 84:t.getLogger().debug("Lex: =>BAE"),this.pushState("ARROW_DIR");break;case 85:return e.yytext=e.yytext.replace(/^,\s*/,""),t.getLogger().debug("Lex (right): dir:",e.yytext),"DIR";case 86:return e.yytext=e.yytext.replace(/^,\s*/,""),t.getLogger().debug("Lex (left):",e.yytext),"DIR";case 87:return e.yytext=e.yytext.replace(/^,\s*/,""),t.getLogger().debug("Lex (x):",e.yytext),"DIR";case 88:return e.yytext=e.yytext.replace(/^,\s*/,""),t.getLogger().debug("Lex (y):",e.yytext),"DIR";case 89:return e.yytext=e.yytext.replace(/^,\s*/,""),t.getLogger().debug("Lex (up):",e.yytext),"DIR";case 90:return e.yytext=e.yytext.replace(/^,\s*/,""),t.getLogger().debug("Lex (down):",e.yytext),"DIR";case 91:return e.yytext="]>",t.getLogger().debug("Lex (ARROW_DIR end):",e.yytext),this.popState(),this.popState(),"BLOCK_ARROW_END";case 92:return t.getLogger().debug("Lex: LINK","#"+e.yytext+"#"),15;case 93:case 94:case 95:return t.getLogger().debug("Lex: LINK",e.yytext),15;case 96:case 97:case 98:return t.getLogger().debug("Lex: START_LINK",e.yytext),this.pushState("LLABEL"),16;case 100:return t.getLogger().debug("Lex: Starting string"),this.pushState("string"),"LINK_LABEL";case 101:return this.popState(),t.getLogger().debug("Lex: LINK","#"+e.yytext+"#"),15;case 102:case 103:return this.popState(),t.getLogger().debug("Lex: LINK",e.yytext),15;case 104:return t.getLogger().debug("Lex: COLON",e.yytext),e.yytext=e.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}}}}();function f(){this.yy={}}return x.lexer=b,E(f,"Parser"),f.prototype=x,x.Parser=f,new f}();J.parser=J;var Q=J,tt=new Map,et=[],rt=new Map,at="color",it="fill",nt=new Map,st="",ot=E(t=>W.sanitizeText(t,B()),"sanitizeText"),lt=E(function(t,e=""){let r=nt.get(t);r||(r={id:t,styles:[],textStyles:[]},nt.set(t,r)),null!=e&&e.split(",").forEach(t=>{const e=t.replace(/([^;]*);/,"$1").trim();if(RegExp(at).exec(t)){const t=e.replace(it,"bgFill").replace(at,it);r.textStyles.push(t)}r.styles.push(e)})},"addStyleClass"),ct=E(function(t,e=""){const r=tt.get(t);null!=e&&(r.styles=e.split(","))},"addStyle2Node"),dt=E(function(t,e){t.split(",").forEach(function(t){let r=tt.get(t);if(void 0===r){const e=t.trim();r={id:e,type:"na",children:[]},tt.set(e,r)}r.classes||(r.classes=[]),r.classes.push(e)})},"setCssClass"),ht=E((t,e)=>{const r=t.flat(),a=[],i=r.find(t=>"column-setting"===(null==t?void 0:t.type)),n=(null==i?void 0:i.columns)??-1;for(const s of r)if("number"==typeof n&&n>0&&"column-setting"!==s.type&&"number"==typeof s.widthInColumns&&s.widthInColumns>n&&I.warn(`Block ${s.id} width ${s.widthInColumns} exceeds configured column width ${n}`),s.label&&(s.label=ot(s.label)),"classDef"!==s.type)if("applyClass"!==s.type)if("applyStyles"!==s.type)if("column-setting"===s.type)e.columns=s.columns??-1;else if("edge"===s.type){const t=(rt.get(s.id)??0)+1;rt.set(s.id,t),s.id=t+"-"+s.id,et.push(s)}else{s.label||("composite"===s.type?s.label="":s.label=s.id);const t=tt.get(s.id);if(void 0===t?tt.set(s.id,s):("na"!==s.type&&(t.type=s.type),s.label!==s.id&&(t.label=s.label)),s.children&&ht(s.children,s),"space"===s.type){const t=s.width??1;for(let e=0;e<t;e++){const t=V(s);t.id=t.id+"-"+e,tt.set(t.id,t),a.push(t)}}else void 0===t&&a.push(s)}else(null==s?void 0:s.stylesStr)&&ct(s.id,null==s?void 0:s.stylesStr);else dt(s.id,(null==s?void 0:s.styleClass)??"");else lt(s.id,s.css);e.children=a},"populateBlockDatabase"),gt=[],ut={id:"root",type:"composite",children:[],columns:-1},yt=E(()=>{I.debug("Clear called"),N(),ut={id:"root",type:"composite",children:[],columns:-1},tt=new Map([["root",ut]]),gt=[],nt=new Map,et=[],rt=new Map,st=""},"clear");function pt(t){switch(I.debug("typeStr2Type",t),t){case"[]":return"square";case"()":return I.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"}}function xt(t){return I.debug("typeStr2Type",t),"=="===t?"thick":"normal"}function bt(t){switch(t.trim().slice(-1)){case"x":return"arrow_cross";case"o":return"arrow_circle";case">":return"arrow_point";default:return""}}function ft(t){switch(t.trim().charAt(0)){case"x":return"arrow_cross";case"o":return"arrow_circle";case"<":return"arrow_point";default:return"arrow_open"}}function mt(t){return t.includes("==")?"thick":"normal"}function wt(t){return t.includes(".-")?"dotted":"solid"}E(pt,"typeStr2Type"),E(xt,"edgeTypeStr2Type"),E(bt,"edgeStrToEdgeData"),E(ft,"edgeStrToEdgeStartData"),E(mt,"edgeStrToThickness"),E(wt,"edgeStrToPattern");var kt=0,St=E(()=>(kt++,"id-"+Math.random().toString(36).substr(2,12)+"-"+kt),"generateId"),Lt=E(t=>{ut.children=t,ht(t,ut),gt=ut.children},"setHierarchy"),_t=E(t=>{const e=tt.get(t);return e?e.columns?e.columns:e.children?e.children.length:-1:-1},"getColumns"),vt=E(()=>[...tt.values()],"getBlocksFlat"),Et=E(()=>gt||[],"getBlocks"),Tt=E(()=>et,"getEdges"),Dt=E(t=>tt.get(t),"getBlock"),$t=E(t=>{tt.set(t.id,t)},"setBlock"),It=E(t=>{st=t},"setDiagramId"),Nt=E(()=>st,"getDiagramId"),Ct=E(()=>I,"getLogger"),Bt=E(function(){return nt},"getClasses"),Ot={getConfig:E(()=>T().block,"getConfig"),typeStr2Type:pt,edgeTypeStr2Type:xt,edgeStrToEdgeData:bt,edgeStrToEdgeStartData:ft,edgeStrToThickness:mt,edgeStrToPattern:wt,getLogger:Ct,getBlocksFlat:vt,getBlocks:Et,getEdges:Tt,setHierarchy:Lt,getBlock:Dt,setBlock:$t,getColumns:_t,getClasses:Bt,clear:yt,generateId:St,setDiagramId:It,getDiagramId:Nt},Rt=E((t,e)=>{const r=Z,a=r(t,"r"),i=r(t,"g"),n=r(t,"b");return C(a,i,n,e)},"fade"),zt=E(e=>`.label {\n font-family: ${e.fontFamily};\n color: ${e.nodeTextColor||e.textColor};\n }\n .cluster-label text {\n fill: ${e.titleColor};\n }\n .cluster-label span,p {\n color: ${e.titleColor};\n }\n\n\n\n .label text,span,p {\n fill: ${e.nodeTextColor||e.textColor};\n color: ${e.nodeTextColor||e.textColor};\n }\n\n .node rect,\n .node circle,\n .node ellipse,\n .node polygon,\n .node path {\n fill: ${e.mainBkg};\n stroke: ${e.nodeBorder};\n stroke-width: 1px;\n }\n .flowchart-label text {\n text-anchor: middle;\n }\n // .flowchart-label .text-outer-tspan {\n // text-anchor: middle;\n // }\n // .flowchart-label .text-inner-tspan {\n // text-anchor: start;\n // }\n\n .node .label {\n text-align: center;\n }\n .node.clickable {\n cursor: pointer;\n }\n\n .arrowheadPath {\n fill: ${e.arrowheadColor};\n }\n\n .edgePath .path {\n stroke: ${e.lineColor};\n stroke-width: 2.0px;\n }\n\n .flowchart-link {\n stroke: ${e.lineColor};\n fill: none;\n }\n\n .edgeLabel {\n background-color: ${e.edgeLabelBackground};\n /*\n * This is for backward compatibility with existing code that didn't\n * add a \`<p>\` around edge labels.\n *\n * TODO: We should probably remove this in a future release.\n */\n p {\n margin: 0;\n padding: 0;\n display: inline;\n }\n rect {\n opacity: 0.5;\n background-color: ${e.edgeLabelBackground};\n fill: ${e.edgeLabelBackground};\n }\n text-align: center;\n }\n\n /* For html labels only */\n .labelBkg {\n background-color: ${e.edgeLabelBackground};\n }\n\n .node .cluster {\n // fill: ${Rt(e.mainBkg,.5)};\n fill: ${Rt(e.clusterBkg,.5)};\n stroke: ${Rt(e.clusterBorder,.2)};\n box-shadow: rgba(50, 50, 93, 0.25) 0px 13px 27px -5px, rgba(0, 0, 0, 0.3) 0px 8px 16px -8px;\n stroke-width: 1px;\n }\n\n .cluster text {\n fill: ${e.titleColor};\n }\n\n .cluster span,p {\n color: ${e.titleColor};\n }\n /* .cluster div {\n color: ${e.titleColor};\n } */\n\n div.mermaidTooltip {\n position: absolute;\n text-align: center;\n max-width: 200px;\n padding: 2px;\n font-family: ${e.fontFamily};\n font-size: 12px;\n background: ${e.tertiaryColor};\n border: 1px solid ${e.border2};\n border-radius: 2px;\n pointer-events: none;\n z-index: 100;\n }\n\n .flowchartTitleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ${e.textColor};\n }\n ${t()}\n`,"getStyles"),At=E((t,e,r,a)=>{e.forEach(e=>{Mt[e](t,r,a)})},"insertMarkers"),Mt={extension:E((t,e,r)=>{I.trace("Making markers for ",r),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionStart").attr("class","marker extension "+e).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"),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionEnd").attr("class","marker extension "+e).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"),composition:E((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionStart").attr("class","marker composition "+e).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"),t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionEnd").attr("class","marker composition "+e).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"),aggregation:E((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationStart").attr("class","marker aggregation "+e).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"),t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationEnd").attr("class","marker aggregation "+e).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"),dependency:E((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyStart").attr("class","marker dependency "+e).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"),t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyEnd").attr("class","marker dependency "+e).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"),lollipop:E((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopStart").attr("class","marker lollipop "+e).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),t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopEnd").attr("class","marker lollipop "+e).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"),point:E((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-pointEnd").attr("class","marker "+e).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"),t.append("marker").attr("id",r+"_"+e+"-pointStart").attr("class","marker "+e).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"),circle:E((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-circleEnd").attr("class","marker "+e).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"),t.append("marker").attr("id",r+"_"+e+"-circleStart").attr("class","marker "+e).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"),cross:E((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-crossEnd").attr("class","marker cross "+e).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"),t.append("marker").attr("id",r+"_"+e+"-crossStart").attr("class","marker cross "+e).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"),barb:E((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-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")},Pt=At;function Yt(t,e){if(0===t||!Number.isInteger(t))throw new Error("Columns must be an integer !== 0.");if(e<0||!Number.isInteger(e))throw new Error("Position must be a non-negative integer."+e);if(t<0)return{px:e,py:0};if(1===t)return{px:0,py:e};return{px:e%t,py:Math.floor(e/t)}}E(Yt,"calculateBlockPosition");var jt=E(t=>{let e=0,r=0;for(const a of t.children){const{width:t,height:i,x:n,y:s}=a.size??{width:0,height:0,x:0,y:0};if(I.debug("getMaxChildSize abc95 child:",a.id,"width:",t,"height:",i,"x:",n,"y:",s,a.type),"space"===a.type)continue;const o=t/(a.widthInColumns??1);o>e&&(e=o),i>r&&(r=i)}return{width:e,height:r}},"getMaxChildSize");function Ft(t,e,r=0,a=0,i=8){var n,s,o,l,c,d,h,g,u,y,p;I.debug("setBlockSizes abc95 (start)",t.id,null==(n=null==t?void 0:t.size)?void 0:n.x,"block width =",null==t?void 0:t.size,"siblingWidth",r),(null==(s=null==t?void 0:t.size)?void 0:s.width)||(t.size={width:r,height:a,x:0,y:0});let x=0,b=0;if((null==(o=t.children)?void 0:o.length)>0){for(const r of t.children)Ft(r,e,0,0,i);const n=jt(t);x=n.width,b=n.height,I.debug("setBlockSizes abc95 maxWidth of",t.id,":s children is ",x,b);for(const e of t.children)e.size&&(I.debug(`abc95 Setting size of children of ${t.id} id=${e.id} ${x} ${b} ${JSON.stringify(e.size)}`),e.size.width=x*(e.widthInColumns??1)+i*((e.widthInColumns??1)-1),e.size.height=b,e.size.x=0,e.size.y=0,I.debug(`abc95 updating size of ${t.id} children child:${e.id} maxWidth:${x} maxHeight:${b}`));for(const r of t.children)Ft(r,e,x,b,i);const s=t.columns??-1;let o=0;for(const e of t.children)o+=e.widthInColumns??1;let g=t.children.length;s>0&&s<o&&(g=s);const u=Math.ceil(o/g);let y=g*(x+i)+i,p=u*(b+i)+i;if(y<r){I.debug(`Detected to small sibling: abc95 ${t.id} siblingWidth ${r} siblingHeight ${a} width ${y}`),y=r,p=a;const e=(r-g*i-i)/g,n=(a-u*i-i)/u;I.debug("Size indata abc88",t.id,"childWidth",e,"maxWidth",x),I.debug("Size indata abc88",t.id,"childHeight",n,"maxHeight",b),I.debug("Size indata abc88 xSize",g,"padding",i);for(const r of t.children)r.size&&(r.size.width=e,r.size.height=n,r.size.x=0,r.size.y=0)}if(I.debug(`abc95 (finale calc) ${t.id} xSize ${g} ySize ${u} columns ${s}${t.children.length} width=${Math.max(y,(null==(l=t.size)?void 0:l.width)||0)}`),y<((null==(c=null==t?void 0:t.size)?void 0:c.width)||0)){y=(null==(d=null==t?void 0:t.size)?void 0:d.width)||0;const e=s>0?Math.min(t.children.length,s):t.children.length;if(e>0){const r=(y-e*i-i)/e;I.debug("abc95 (growing to fit) width",t.id,y,null==(h=t.size)?void 0:h.width,r);for(const e of t.children)e.size&&(e.size.width=r)}}t.size={width:y,height:p,x:0,y:0}}I.debug("setBlockSizes abc94 (done)",t.id,null==(g=null==t?void 0:t.size)?void 0:g.x,null==(u=null==t?void 0:t.size)?void 0:u.width,null==(y=null==t?void 0:t.size)?void 0:y.y,null==(p=null==t?void 0:t.size)?void 0:p.height)}function Wt(t,e,r=8){var a,i,n,s,o,l,c,d,h,g,u,y,p,x,b,f,m;I.debug(`abc85 layout blocks (=>layoutBlocks) ${t.id} x: ${null==(a=null==t?void 0:t.size)?void 0:a.x} y: ${null==(i=null==t?void 0:t.size)?void 0:i.y} width: ${null==(n=null==t?void 0:t.size)?void 0:n.width}`);const w=t.columns??-1;if(I.debug("layoutBlocks columns abc95",t.id,"=>",w,t),t.children&&t.children.length>0){const a=(null==(o=null==(s=null==t?void 0:t.children[0])?void 0:s.size)?void 0:o.width)??0,i=t.children.length*a+(t.children.length-1)*r;I.debug("widthOfChildren 88",i,"posX");const n=new Map;{let e=0;for(const r of t.children){if(!r.size)continue;const{py:t}=Yt(w,e),a=n.get(t)??0;r.size.height>a&&n.set(t,r.size.height);let i=(null==r?void 0:r.widthInColumns)??1;w>0&&(i=Math.min(i,w-e%w)),e+=i}}const b=new Map;{let t=0;const e=[...n.keys()].sort((t,e)=>t-e);for(const a of e)b.set(a,t),t+=(n.get(a)??0)+r}let f=0;I.debug("abc91 block?.size?.x",t.id,null==(l=null==t?void 0:t.size)?void 0:l.x);let m=(null==(c=null==t?void 0:t.size)?void 0:c.x)?(null==(d=null==t?void 0:t.size)?void 0:d.x)+(-(null==(h=null==t?void 0:t.size)?void 0:h.width)/2||0):-r,k=0;for(const s of t.children){const a=t;if(!s.size)continue;const{width:i,height:o}=s.size,{px:l,py:c}=Yt(w,f);if(c!=k&&(k=c,m=(null==(g=null==t?void 0:t.size)?void 0:g.x)?(null==(u=null==t?void 0:t.size)?void 0:u.x)+(-(null==(y=null==t?void 0:t.size)?void 0:y.width)/2||0):-r,I.debug("New row in layout for block",t.id," and child ",s.id,k)),I.debug(`abc89 layout blocks (child) id: ${s.id} Pos: ${f} (px, py) ${l},${c} (${null==(p=null==a?void 0:a.size)?void 0:p.x},${null==(x=null==a?void 0:a.size)?void 0:x.y}) parent: ${a.id} width: ${i}${r}`),a.size){const t=i/2;s.size.x=m+r+t,I.debug(`abc91 layout blocks (calc) px, pyid:${s.id} startingPos=X${m} new startingPosX${s.size.x} ${t} padding=${r} width=${i} halfWidth=${t} => x:${s.size.x} y:${s.size.y} ${s.widthInColumns} (width * (child?.w || 1)) / 2 ${i*((null==s?void 0:s.widthInColumns)??1)/2}`),m=s.size.x+t;const e=b.get(c)??0,l=n.get(c)??o;s.size.y=a.size.y-a.size.height/2+e+l/2+r,I.debug(`abc88 layout blocks (calc) px, pyid:${s.id}startingPosX${m}${r}${t}=>x:${s.size.x}y:${s.size.y}${s.widthInColumns}(width * (child?.w || 1)) / 2${i*((null==s?void 0:s.widthInColumns)??1)/2}`)}s.children&&Wt(s,e,r);let d=(null==s?void 0:s.widthInColumns)??1;w>0&&(d=Math.min(d,w-f%w)),f+=d,I.debug("abc88 columnsPos",s,f)}}I.debug(`layout blocks (<==layoutBlocks) ${t.id} x: ${null==(b=null==t?void 0:t.size)?void 0:b.x} y: ${null==(f=null==t?void 0:t.size)?void 0:f.y} width: ${null==(m=null==t?void 0:t.size)?void 0:m.width}`)}function Xt(t,{minX:e,minY:r,maxX:a,maxY:i}={minX:0,minY:0,maxX:0,maxY:0}){if(t.size&&"root"!==t.id){const{x:n,y:s,width:o,height:l}=t.size;n-o/2<e&&(e=n-o/2),s-l/2<r&&(r=s-l/2),n+o/2>a&&(a=n+o/2),s+l/2>i&&(i=s+l/2)}if(t.children)for(const n of t.children)({minX:e,minY:r,maxX:a,maxY:i}=Xt(n,{minX:e,minY:r,maxX:a,maxY:i}));return{minX:e,minY:r,maxX:a,maxY:i}}function Ht(t){var e,r;const a=t.getBlock("root");if(!a)return;const i=(null==(r=null==(e=B())?void 0:e.block)?void 0:r.padding)??8;Ft(a,t,0,0,i),Wt(a,t,i),I.debug("getBlocks",JSON.stringify(a,null,2));const{minX:n,minY:s,maxX:o,maxY:l}=Xt(a);return{x:n,y:s,width:o-n,height:l-s}}E(Ft,"setBlockSizes"),E(Wt,"layoutBlocks"),E(Xt,"findBounds"),E(Ht,"layout");var Ut=E(async(t,e,r,a=!1,i=!1)=>{let n=e||"";"object"==typeof n&&(n=n[0]);const s=B(),o=M(s);return await P(t,n,{style:r,isTitle:a,useHtmlLabels:o,markdown:!1,isNode:i,width:Number.POSITIVE_INFINITY},s)},"createLabel"),Kt=E((t,e,r,a,i)=>{e.arrowTypeStart&&Zt(t,"start",e.arrowTypeStart,r,a,i),e.arrowTypeEnd&&Zt(t,"end",e.arrowTypeEnd,r,a,i)},"addEdgeMarkers"),qt={arrow_cross:"cross",arrow_point:"point",arrow_barb:"barb",arrow_circle:"circle",aggregation:"aggregation",extension:"extension",composition:"composition",dependency:"dependency",lollipop:"lollipop"},Zt=E((t,e,r,a,i,n)=>{const s=qt[r];if(!s)return void I.warn(`Unknown arrow type: ${r}`);const o="start"===e?"Start":"End";t.attr(`marker-${e}`,`url(${a}#${i}_${n}-${s}${o})`)},"addEdgeMarker"),Vt={},Gt={},Jt=E(async(t,e)=>{const r=B(),a=M(r),i=t.insert("g").attr("class","edgeLabel"),n=i.insert("g").attr("class","label"),s="markdown"===e.labelType,o=await P(t,e.label,{style:e.labelStyle,useHtmlLabels:a,addSvgBackground:s,isNode:!1,markdown:s,width:s?void 0:Number.POSITIVE_INFINITY},r);n.node().appendChild(o);let l,c=o.getBBox(),d=c;if(a){const t=o.children[0],e=D(o);c=t.getBoundingClientRect(),d=c,e.attr("width",c.width),e.attr("height",c.height)}else{const t=D(o).select("text").node();t&&"function"==typeof t.getBBox&&(d=t.getBBox())}if(n.attr("transform",Y(d,a)),Vt[e.id]=i,e.width=c.width,e.height=c.height,e.startLabelLeft){const r=t.insert("g").attr("class","edgeTerminals"),i=r.insert("g").attr("class","inner"),n=await Ut(i,e.startLabelLeft,e.labelStyle);l=n;let s=n.getBBox();if(a){const t=n.children[0],e=D(n);s=t.getBoundingClientRect(),e.attr("width",s.width),e.attr("height",s.height)}i.attr("transform",Y(s,a)),Gt[e.id]||(Gt[e.id]={}),Gt[e.id].startLeft=r,Qt(l,e.startLabelLeft)}if(e.startLabelRight){const r=t.insert("g").attr("class","edgeTerminals"),i=r.insert("g").attr("class","inner"),n=await Ut(i,e.startLabelRight,e.labelStyle);l=n;let s=n.getBBox();if(a){const t=n.children[0],e=D(n);s=t.getBoundingClientRect(),e.attr("width",s.width),e.attr("height",s.height)}i.attr("transform",Y(s,a)),Gt[e.id]||(Gt[e.id]={}),Gt[e.id].startRight=r,Qt(l,e.startLabelRight)}if(e.endLabelLeft){const r=t.insert("g").attr("class","edgeTerminals"),i=r.insert("g").attr("class","inner"),n=await Ut(r,e.endLabelLeft,e.labelStyle);l=n;let s=n.getBBox();if(a){const t=n.children[0],e=D(n);s=t.getBoundingClientRect(),e.attr("width",s.width),e.attr("height",s.height)}i.attr("transform",Y(s,a)),Gt[e.id]||(Gt[e.id]={}),Gt[e.id].endLeft=r,Qt(l,e.endLabelLeft)}if(e.endLabelRight){const r=t.insert("g").attr("class","edgeTerminals"),i=r.insert("g").attr("class","inner"),n=await Ut(r,e.endLabelRight,e.labelStyle);l=n;let s=n.getBBox();if(a){const t=n.children[0],e=D(n);s=t.getBoundingClientRect(),e.attr("width",s.width),e.attr("height",s.height)}i.attr("transform",Y(s,a)),Gt[e.id]||(Gt[e.id]={}),Gt[e.id].endRight=r,Qt(l,e.endLabelRight)}return o},"insertEdgeLabel");function Qt(t,e){M(B())&&t&&(t.style.width=9*e.length+"px",t.style.height="12px")}E(Qt,"setTerminalWidth");var te=E((t,e)=>{I.debug("Moving label abc88 ",t.id,t.label,Vt[t.id],e);let r=e.updatedPath?e.updatedPath:e.originalPath;const a=B(),{subGraphTitleTotalMargin:i}=j(a);if(t.label){const a=Vt[t.id];let n=t.x,s=t.y;if(r){const a=F.calcLabelPosition(r);I.debug("Moving label "+t.label+" from (",n,",",s,") to (",a.x,",",a.y,") abc88"),e.updatedPath&&(n=a.x,s=a.y)}a.attr("transform",`translate(${n}, ${s+i/2})`)}if(t.startLabelLeft){const e=Gt[t.id].startLeft;let a=t.x,i=t.y;if(r){const e=F.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_left",r);a=e.x,i=e.y}e.attr("transform",`translate(${a}, ${i})`)}if(t.startLabelRight){const e=Gt[t.id].startRight;let a=t.x,i=t.y;if(r){const e=F.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_right",r);a=e.x,i=e.y}e.attr("transform",`translate(${a}, ${i})`)}if(t.endLabelLeft){const e=Gt[t.id].endLeft;let a=t.x,i=t.y;if(r){const e=F.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_left",r);a=e.x,i=e.y}e.attr("transform",`translate(${a}, ${i})`)}if(t.endLabelRight){const e=Gt[t.id].endRight;let a=t.x,i=t.y;if(r){const e=F.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_right",r);a=e.x,i=e.y}e.attr("transform",`translate(${a}, ${i})`)}},"positionEdgeLabel"),ee=E((t,e)=>{const r=t.x,a=t.y,i=Math.abs(e.x-r),n=Math.abs(e.y-a),s=t.width/2,o=t.height/2;return i>=s||n>=o},"outsideNode"),re=E((t,e,r)=>{I.debug(`intersection calc abc89:\n outsidePoint: ${JSON.stringify(e)}\n insidePoint : ${JSON.stringify(r)}\n node : x:${t.x} y:${t.y} w:${t.width} h:${t.height}`);const a=t.x,i=t.y,n=Math.abs(a-r.x),s=t.width/2;let o=r.x<e.x?s-n:s+n;const l=t.height/2,c=Math.abs(e.y-r.y),d=Math.abs(e.x-r.x);if(Math.abs(i-e.y)*s>Math.abs(a-e.x)*l){let t=r.y<e.y?e.y-l-i:i-l-e.y;o=d*t/c;const a={x:r.x<e.x?r.x+o:r.x-d+o,y:r.y<e.y?r.y+c-t:r.y-c+t};return 0===o&&(a.x=e.x,a.y=e.y),0===d&&(a.x=e.x),0===c&&(a.y=e.y),I.debug(`abc89 topp/bott calc, Q ${c}, q ${t}, R ${d}, r ${o}`,a),a}{o=r.x<e.x?e.x-s-a:a-s-e.x;let t=c*o/d,i=r.x<e.x?r.x+d-o:r.x-d+o,n=r.y<e.y?r.y+t:r.y-t;return I.debug(`sides calc abc89, Q ${c}, q ${t}, R ${d}, r ${o}`,{_x:i,_y:n}),0===o&&(i=e.x,n=e.y),0===d&&(i=e.x),0===c&&(n=e.y),{x:i,y:n}}},"intersection"),ae=E((t,e)=>{I.debug("abc88 cutPathAtIntersect",t,e);let r=[],a=t[0],i=!1;return t.forEach(t=>{if(ee(e,t)||i)a=t,i||r.push(t);else{const n=re(e,a,t);let s=!1;r.forEach(t=>{s=s||t.x===n.x&&t.y===n.y}),r.some(t=>t.x===n.x&&t.y===n.y)||r.push(n),i=!0}}),r},"cutPathAtIntersect"),ie=E(function(t,e,r,a,i,n,s){let o=r.points;I.debug("abc88 InsertEdge: edge=",r,"e=",e);let l=!1;const c=n.node(e.v);var d=n.node(e.w);(null==d?void 0:d.intersect)&&(null==c?void 0:c.intersect)&&(o=o.slice(1,r.points.length-1),o.unshift(c.intersect(o[0])),o.push(d.intersect(o[o.length-1]))),r.toCluster&&(I.debug("to cluster abc88",a[r.toCluster]),o=ae(r.points,a[r.toCluster].node),l=!0),r.fromCluster&&(I.debug("from cluster abc88",a[r.fromCluster]),o=ae(o.reverse(),a[r.fromCluster].node).reverse(),l=!0);const h=o.filter(t=>!Number.isNaN(t.y));let g=z;!r.curve||"graph"!==i&&"flowchart"!==i||(g=r.curve);const{x:u,y:y}=O(r),p=R().x(u).y(y).curve(g);let x;switch(r.thickness){case"normal":x="edge-thickness-normal";break;case"thick":case"invisible":x="edge-thickness-thick";break;default:x=""}switch(r.pattern){case"solid":x+=" edge-pattern-solid";break;case"dotted":x+=" edge-pattern-dotted";break;case"dashed":x+=" edge-pattern-dashed"}const b=t.append("path").attr("d",p(h)).attr("id",r.id).attr("class"," "+x+(r.classes?" "+r.classes:"")).attr("style",r.style);let f="";(B().flowchart.arrowMarkerAbsolute||B().state.arrowMarkerAbsolute)&&(f=A(!0)),Kt(b,r,f,s,i);let m={};return l&&(m.updatedPath=o),m.originalPath=r.points,m},"insertEdge"),ne=E(t=>{const e=new Set;for(const r of t)switch(r){case"x":e.add("right"),e.add("left");break;case"y":e.add("up"),e.add("down");break;default:e.add(r)}return e},"expandAndDeduplicateDirections"),se=E((t,e,r,a)=>{const i=ne(t),n=e.height+2*r.padding,s=n/2,o=a??e.width+2*s+r.padding,l=r.padding/2;return i.has("right")&&i.has("left")&&i.has("up")&&i.has("down")?[{x:0,y:0},{x:s,y:0},{x:o/2,y:2*l},{x:o-s,y:0},{x:o,y:0},{x:o,y:-n/3},{x:o+2*l,y:-n/2},{x:o,y:-2*n/3},{x:o,y:-n},{x:o-s,y:-n},{x:o/2,y:-n-2*l},{x:s,y:-n},{x:0,y:-n},{x:0,y:-2*n/3},{x:-2*l,y:-n/2},{x:0,y:-n/3}]:i.has("right")&&i.has("left")&&i.has("up")?[{x:s,y:0},{x:o-s,y:0},{x:o,y:-n/2},{x:o-s,y:-n},{x:s,y:-n},{x:0,y:-n/2}]:i.has("right")&&i.has("left")&&i.has("down")?[{x:0,y:0},{x:s,y:-n},{x:o-s,y:-n},{x:o,y:0}]:i.has("right")&&i.has("up")&&i.has("down")?[{x:0,y:0},{x:o,y:-s},{x:o,y:-n+s},{x:0,y:-n}]:i.has("left")&&i.has("up")&&i.has("down")?[{x:o,y:0},{x:0,y:-s},{x:0,y:-n+s},{x:o,y:-n}]:i.has("right")&&i.has("left")?[{x:s,y:0},{x:s,y:-l},{x:o-s,y:-l},{x:o-s,y:0},{x:o,y:-n/2},{x:o-s,y:-n},{x:o-s,y:-n+l},{x:s,y:-n+l},{x:s,y:-n},{x:0,y:-n/2}]:i.has("up")&&i.has("down")?[{x:o/2,y:0},{x:0,y:-l},{x:s,y:-l},{x:s,y:-n+l},{x:0,y:-n+l},{x:o/2,y:-n},{x:o,y:-n+l},{x:o-s,y:-n+l},{x:o-s,y:-l},{x:o,y:-l}]:i.has("right")&&i.has("up")?[{x:0,y:0},{x:o,y:-s},{x:0,y:-n}]:i.has("right")&&i.has("down")?[{x:0,y:0},{x:o,y:0},{x:0,y:-n}]:i.has("left")&&i.has("up")?[{x:o,y:0},{x:0,y:-s},{x:o,y:-n}]:i.has("left")&&i.has("down")?[{x:o,y:0},{x:0,y:0},{x:o,y:-n}]:i.has("right")?[{x:s,y:-l},{x:s,y:-l},{x:o-s,y:-l},{x:o-s,y:0},{x:o,y:-n/2},{x:o-s,y:-n},{x:o-s,y:-n+l},{x:s,y:-n+l},{x:s,y:-n+l}]:i.has("left")?[{x:s,y:0},{x:s,y:-l},{x:o-s,y:-l},{x:o-s,y:-n+l},{x:s,y:-n+l},{x:s,y:-n},{x:0,y:-n/2}]:i.has("up")?[{x:s,y:-l},{x:s,y:-n+l},{x:0,y:-n+l},{x:o/2,y:-n},{x:o,y:-n+l},{x:o-s,y:-n+l},{x:o-s,y:-l}]:i.has("down")?[{x:o/2,y:0},{x:0,y:-l},{x:s,y:-l},{x:s,y:-n+l},{x:o-s,y:-n+l},{x:o-s,y:-l},{x:o,y:-l}]:[{x:0,y:0}]},"getArrowPoints");function oe(t,e){return t.intersect(e)}E(oe,"intersectNode");var le=oe;function ce(t,e,r,a){var i=t.x,n=t.y,s=i-a.x,o=n-a.y,l=Math.sqrt(e*e*o*o+r*r*s*s),c=Math.abs(e*r*s/l);a.x<i&&(c=-c);var d=Math.abs(e*r*o/l);return a.y<n&&(d=-d),{x:i+c,y:n+d}}E(ce,"intersectEllipse");var de=ce;function he(t,e,r){return de(t,e,e,r)}E(he,"intersectCircle");var ge=he;function ue(t,e,r,a){var i,n,s,o,l,c,d,h,g,u,y,p,x;if(i=e.y-t.y,s=t.x-e.x,l=e.x*t.y-t.x*e.y,g=i*r.x+s*r.y+l,u=i*a.x+s*a.y+l,!(0!==g&&0!==u&&ye(g,u)||(n=a.y-r.y,o=r.x-a.x,c=a.x*r.y-r.x*a.y,d=n*t.x+o*t.y+c,h=n*e.x+o*e.y+c,0!==d&&0!==h&&ye(d,h)||0===(y=i*o-n*s))))return p=Math.abs(y/2),{x:(x=s*c-o*l)<0?(x-p)/y:(x+p)/y,y:(x=n*l-i*c)<0?(x-p)/y:(x+p)/y}}function ye(t,e){return t*e>0}E(ue,"intersectLine"),E(ye,"sameSign");var pe=ue,xe=be;function be(t,e,r){var a=t.x,i=t.y,n=[],s=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY;"function"==typeof e.forEach?e.forEach(function(t){s=Math.min(s,t.x),o=Math.min(o,t.y)}):(s=Math.min(s,e.x),o=Math.min(o,e.y));for(var l=a-t.width/2-s,c=i-t.height/2-o,d=0;d<e.length;d++){var h=e[d],g=e[d<e.length-1?d+1:0],u=pe(t,r,{x:l+h.x,y:c+h.y},{x:l+g.x,y:c+g.y});u&&n.push(u)}return n.length?(n.length>1&&n.sort(function(t,e){var a=t.x-r.x,i=t.y-r.y,n=Math.sqrt(a*a+i*i),s=e.x-r.x,o=e.y-r.y,l=Math.sqrt(s*s+o*o);return n<l?-1:n===l?0:1}),n[0]):t}E(be,"intersectPolygon");var fe={node:le,circle:ge,ellipse:de,polygon:xe,rect:E((t,e)=>{var r,a,i=t.x,n=t.y,s=e.x-i,o=e.y-n,l=t.width/2,c=t.height/2;return Math.abs(o)*l>Math.abs(s)*c?(o<0&&(c=-c),r=0===o?0:c*s/o,a=c):(s<0&&(l=-l),r=l,a=0===s?0:l*o/s),{x:i+r,y:n+a}},"intersectRect")},me=E(async(t,e,r,a)=>{const i=B();let n;const s=e.useHtmlLabels||M(i);n=r||"node default";const o=t.insert("g").attr("class",n).attr("id",e.domId||e.id),l=o.insert("g").attr("class","label").attr("style",e.labelStyle);let c,d;c=void 0===e.labelText?"":"string"==typeof e.labelText?e.labelText:e.labelText[0],d="markdown"===e.labelType?P(l,H(U(c),i),{useHtmlLabels:s,width:e.width||i.flowchart.wrappingWidth,classes:"markdown-node-label"},i):await Ut(l,H(U(c),i),e.labelStyle,!1,a);let h=d.getBBox();const g=e.padding/2;if(M(i)){const t=d.children[0],e=D(d);await K(t,c),h=t.getBoundingClientRect(),e.attr("width",h.width),e.attr("height",h.height)}return s?l.attr("transform","translate("+-h.width/2+", "+-h.height/2+")"):l.attr("transform","translate(0, "+-h.height/2+")"),e.centerLabel&&l.attr("transform","translate("+-h.width/2+", "+-h.height/2+")"),l.insert("rect",":first-child"),{shapeSvg:o,bbox:h,halfPadding:g,label:l}},"labelHelper"),we=E((t,e)=>{const r=e.node().getBBox();t.width=r.width,t.height=r.height},"updateNodeBounds");function ke(t,e,r,a){return t.insert("polygon",":first-child").attr("points",a.map(function(t){return t.x+","+t.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-e/2+","+r/2+")")}E(ke,"insertPolygonShape");var Se=E(async(t,e)=>{e.useHtmlLabels||M(B())||(e.centerLabel=!0);const{shapeSvg:r,bbox:a,halfPadding:i}=await me(t,e,"node "+e.classes,!0);I.info("Classes = ",e.classes);const n=r.insert("rect",":first-child");return n.attr("rx",e.rx).attr("ry",e.ry).attr("x",-a.width/2-i).attr("y",-a.height/2-i).attr("width",a.width+e.padding).attr("height",a.height+e.padding),we(e,n),e.intersect=function(t){return fe.rect(e,t)},r},"note"),Le=E(t=>t?" "+t:"","formatClass"),_e=E((t,e)=>`${e||"node default"}${Le(t.classes)} ${Le(t.class)}`,"getClassesFromNode"),ve=E(async(t,e)=>{const{shapeSvg:r,bbox:a}=await me(t,e,_e(e,void 0),!0),i=a.width+e.padding+(a.height+e.padding),n=[{x:i/2,y:0},{x:i,y:-i/2},{x:i/2,y:-i},{x:0,y:-i/2}];I.info("Question main (Circle)");const s=ke(r,i,i,n);return s.attr("style",e.style),we(e,s),e.intersect=function(t){return I.warn("Intersect called"),fe.polygon(e,n,t)},r},"question"),Ee=E((t,e)=>{const r=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),a=[{x:0,y:14},{x:14,y:0},{x:0,y:-14},{x:-14,y:0}];return r.insert("polygon",":first-child").attr("points",a.map(function(t){return t.x+","+t.y}).join(" ")).attr("class","state-start").attr("r",7).attr("width",28).attr("height",28),e.width=28,e.height=28,e.intersect=function(t){return fe.circle(e,14,t)},r},"choice"),Te=E(async(t,e)=>{const{shapeSvg:r,bbox:a}=await me(t,e,_e(e,void 0),!0),i=e.positioned?e.height:a.height+e.padding,n=i/4,s=e.positioned?e.width:a.width+2*n+e.padding,o=[{x:n,y:0},{x:s-n,y:0},{x:s,y:-i/2},{x:s-n,y:-i},{x:n,y:-i},{x:0,y:-i/2}],l=ke(r,s,i,o);return l.attr("style",e.style),we(e,l),e.intersect=function(t){return fe.polygon(e,o,t)},r},"hexagon"),De=E(async(t,e)=>{const{shapeSvg:r,bbox:a}=await me(t,e,void 0,!0),i=a.height+2*e.padding,n=i/2,s=a.width+2*n+e.padding,o=e.positioned&&(e.widthInColumns??1)>1&&e.width>s?e.width:s,l=se(e.directions,a,e,o),c=ke(r,o,i,l);return c.attr("style",e.style),we(e,c),e.intersect=function(t){return fe.polygon(e,l,t)},r},"block_arrow"),$e=E(async(t,e)=>{const{shapeSvg:r,bbox:a}=await me(t,e,_e(e,void 0),!0),i=a.width+e.padding,n=a.height+e.padding,s=[{x:-n/2,y:0},{x:i,y:0},{x:i,y:-n},{x:-n/2,y:-n},{x:0,y:-n/2}];return ke(r,i,n,s).attr("style",e.style),e.width=i+n,e.height=n,e.intersect=function(t){return fe.polygon(e,s,t)},r},"rect_left_inv_arrow"),Ie=E(async(t,e)=>{const{shapeSvg:r,bbox:a}=await me(t,e,_e(e),!0),i=a.width+e.padding,n=a.height+e.padding,s=[{x:-2*n/6,y:0},{x:i-n/6,y:0},{x:i+2*n/6,y:-n},{x:n/6,y:-n}],o=ke(r,i,n,s);return o.attr("style",e.style),we(e,o),e.intersect=function(t){return fe.polygon(e,s,t)},r},"lean_right"),Ne=E(async(t,e)=>{const{shapeSvg:r,bbox:a}=await me(t,e,_e(e,void 0),!0),i=a.width+e.padding,n=a.height+e.padding,s=[{x:2*n/6,y:0},{x:i+n/6,y:0},{x:i-2*n/6,y:-n},{x:-n/6,y:-n}],o=ke(r,i,n,s);return o.attr("style",e.style),we(e,o),e.intersect=function(t){return fe.polygon(e,s,t)},r},"lean_left"),Ce=E(async(t,e)=>{const{shapeSvg:r,bbox:a}=await me(t,e,_e(e,void 0),!0),i=a.width+e.padding,n=a.height+e.padding,s=[{x:-2*n/6,y:0},{x:i+2*n/6,y:0},{x:i-n/6,y:-n},{x:n/6,y:-n}],o=ke(r,i,n,s);return o.attr("style",e.style),we(e,o),e.intersect=function(t){return fe.polygon(e,s,t)},r},"trapezoid"),Be=E(async(t,e)=>{const{shapeSvg:r,bbox:a}=await me(t,e,_e(e,void 0),!0),i=a.width+e.padding,n=a.height+e.padding,s=[{x:n/6,y:0},{x:i-n/6,y:0},{x:i+2*n/6,y:-n},{x:-2*n/6,y:-n}],o=ke(r,i,n,s);return o.attr("style",e.style),we(e,o),e.intersect=function(t){return fe.polygon(e,s,t)},r},"inv_trapezoid"),Oe=E(async(t,e)=>{const{shapeSvg:r,bbox:a}=await me(t,e,_e(e,void 0),!0),i=a.width+e.padding,n=a.height+e.padding,s=[{x:0,y:0},{x:i+n/2,y:0},{x:i,y:-n/2},{x:i+n/2,y:-n},{x:0,y:-n}],o=ke(r,i,n,s);return o.attr("style",e.style),we(e,o),e.intersect=function(t){return fe.polygon(e,s,t)},r},"rect_right_inv_arrow"),Re=E(async(t,e)=>{const{shapeSvg:r,bbox:a}=await me(t,e,_e(e,void 0),!0),i=a.width+e.padding,n=i/2,s=n/(2.5+i/50),o=a.height+s+e.padding,l="M 0,"+s+" a "+n+","+s+" 0,0,0 "+i+" 0 a "+n+","+s+" 0,0,0 "+-i+" 0 l 0,"+o+" a "+n+","+s+" 0,0,0 "+i+" 0 l 0,"+-o,c=r.attr("label-offset-y",s).insert("path",":first-child").attr("style",e.style).attr("d",l).attr("transform","translate("+-i/2+","+-(o/2+s)+")");return we(e,c),e.intersect=function(t){const r=fe.rect(e,t),a=r.x-e.x;if(0!=n&&(Math.abs(a)<e.width/2||Math.abs(a)==e.width/2&&Math.abs(r.y-e.y)>e.height/2-s)){let i=s*s*(1-a*a/(n*n));0!=i&&(i=Math.sqrt(i)),i=s-i,t.y-e.y>0&&(i=-i),r.y+=i}return r},r},"cylinder"),ze=E(async(t,e)=>{const{shapeSvg:r,bbox:a,halfPadding:i}=await me(t,e,"node "+e.classes+" "+e.class,!0),n=r.insert("rect",":first-child"),s=e.positioned?e.width:a.width+e.padding,o=e.positioned?e.height:a.height+e.padding,l=e.positioned?-s/2:-a.width/2-i,c=e.positioned?-o/2:-a.height/2-i;if(n.attr("class","basic label-container").attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("x",l).attr("y",c).attr("width",s).attr("height",o),e.props){const t=new Set(Object.keys(e.props));e.props.borders&&(Pe(n,e.props.borders,s,o),t.delete("borders")),t.forEach(t=>{I.warn(`Unknown node property ${t}`)})}return we(e,n),e.intersect=function(t){return fe.rect(e,t)},r},"rect"),Ae=E(async(t,e)=>{const{shapeSvg:r,bbox:a,halfPadding:i}=await me(t,e,"node "+e.classes,!0),n=r.insert("rect",":first-child"),s=e.positioned?e.width:a.width+e.padding,o=e.positioned?e.height:a.height+e.padding,l=e.positioned?-s/2:-a.width/2-i,c=e.positioned?-o/2:-a.height/2-i;if(n.attr("class","basic cluster composite label-container").attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("x",l).attr("y",c).attr("width",s).attr("height",o),e.props){const t=new Set(Object.keys(e.props));e.props.borders&&(Pe(n,e.props.borders,s,o),t.delete("borders")),t.forEach(t=>{I.warn(`Unknown node property ${t}`)})}return we(e,n),e.intersect=function(t){return fe.rect(e,t)},r},"composite"),Me=E(async(t,e)=>{const{shapeSvg:r}=await me(t,e,"label",!0);I.trace("Classes = ",e.class);const a=r.insert("rect",":first-child");if(a.attr("width",0).attr("height",0),r.attr("class","label edgeLabel"),e.props){const t=new Set(Object.keys(e.props));e.props.borders&&(Pe(a,e.props.borders,0,0),t.delete("borders")),t.forEach(t=>{I.warn(`Unknown node property ${t}`)})}return we(e,a),e.intersect=function(t){return fe.rect(e,t)},r},"labelRect");function Pe(t,e,r,a){const i=[],n=E(t=>{i.push(t,0)},"addBorder"),s=E(t=>{i.push(0,t)},"skipBorder");e.includes("t")?(I.debug("add top border"),n(r)):s(r),e.includes("r")?(I.debug("add right border"),n(a)):s(a),e.includes("b")?(I.debug("add bottom border"),n(r)):s(r),e.includes("l")?(I.debug("add left border"),n(a)):s(a),t.attr("stroke-dasharray",i.join(" "))}E(Pe,"applyNodePropertyBorders");var Ye=E(async(t,e)=>{let r;r=e.classes?"node "+e.classes:"node default";const a=t.insert("g").attr("class",r).attr("id",e.domId||e.id),i=a.insert("rect",":first-child"),n=a.insert("line"),s=a.insert("g").attr("class","label"),o=e.labelText.flat?e.labelText.flat():e.labelText;let l="";l="object"==typeof o?o[0]:o,I.info("Label text abc79",l,o,"object"==typeof o);const c=await Ut(s,l,e.labelStyle,!0,!0);let d={width:0,height:0};if(M(B())){const t=c.children[0],e=D(c);d=t.getBoundingClientRect(),e.attr("width",d.width),e.attr("height",d.height)}I.info("Text 2",o);const h=o.slice(1,o.length);let g=c.getBBox();const u=await Ut(s,h.join?h.join("<br/>"):h,e.labelStyle,!0,!0);if(M(B())){const t=u.children[0],e=D(u);d=t.getBoundingClientRect(),e.attr("width",d.width),e.attr("height",d.height)}const y=e.padding/2;return D(u).attr("transform","translate( "+(d.width>g.width?0:(g.width-d.width)/2)+", "+(g.height+y+5)+")"),D(c).attr("transform","translate( "+(d.width<g.width?0:-(g.width-d.width)/2)+", 0)"),d=s.node().getBBox(),s.attr("transform","translate("+-d.width/2+", "+(-d.height/2-y+3)+")"),i.attr("class","outer title-state").attr("x",-d.width/2-y).attr("y",-d.height/2-y).attr("width",d.width+e.padding).attr("height",d.height+e.padding),n.attr("class","divider").attr("x1",-d.width/2-y).attr("x2",d.width/2+y).attr("y1",-d.height/2-y+g.height+y).attr("y2",-d.height/2-y+g.height+y),we(e,i),e.intersect=function(t){return fe.rect(e,t)},a},"rectWithTitle"),je=E(async(t,e)=>{const{shapeSvg:r,bbox:a}=await me(t,e,_e(e,void 0),!0),i=a.height+e.padding,n=a.width+i/4+e.padding,s=r.insert("rect",":first-child").attr("style",e.style).attr("rx",i/2).attr("ry",i/2).attr("x",-n/2).attr("y",-i/2).attr("width",n).attr("height",i);return we(e,s),e.intersect=function(t){return fe.rect(e,t)},r},"stadium"),Fe=E(async(t,e)=>{const{shapeSvg:r,bbox:a,halfPadding:i}=await me(t,e,_e(e,void 0),!0),n=r.insert("circle",":first-child");return n.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",a.width/2+i).attr("width",a.width+e.padding).attr("height",a.height+e.padding),I.info("Circle main"),we(e,n),e.intersect=function(t){return I.info("Circle intersect",e,a.width/2+i,t),fe.circle(e,a.width/2+i,t)},r},"circle"),We=E(async(t,e)=>{const{shapeSvg:r,bbox:a,halfPadding:i}=await me(t,e,_e(e,void 0),!0),n=r.insert("g",":first-child"),s=n.insert("circle"),o=n.insert("circle");return n.attr("class",e.class),s.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",a.width/2+i+5).attr("width",a.width+e.padding+10).attr("height",a.height+e.padding+10),o.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",a.width/2+i).attr("width",a.width+e.padding).attr("height",a.height+e.padding),I.info("DoubleCircle main"),we(e,s),e.intersect=function(t){return I.info("DoubleCircle intersect",e,a.width/2+i+5,t),fe.circle(e,a.width/2+i+5,t)},r},"doublecircle"),Xe=E(async(t,e)=>{const{shapeSvg:r,bbox:a}=await me(t,e,_e(e,void 0),!0),i=a.width+e.padding,n=a.height+e.padding,s=[{x:0,y:0},{x:i,y:0},{x:i,y:-n},{x:0,y:-n},{x:0,y:0},{x:-8,y:0},{x:i+8,y:0},{x:i+8,y:-n},{x:-8,y:-n},{x:-8,y:0}],o=ke(r,i,n,s);return o.attr("style",e.style),we(e,o),e.intersect=function(t){return fe.polygon(e,s,t)},r},"subroutine"),He=E((t,e)=>{const r=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),a=r.insert("circle",":first-child");return a.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),we(e,a),e.intersect=function(t){return fe.circle(e,7,t)},r},"start"),Ue=E((t,e,r)=>{const a=t.insert("g").attr("class","node default").attr("id",e.domId||e.id);let i=70,n=10;"LR"===r&&(i=10,n=70);const s=a.append("rect").attr("x",-1*i/2).attr("y",-1*n/2).attr("width",i).attr("height",n).attr("class","fork-join");return we(e,s),e.height=e.height+e.padding/2,e.width=e.width+e.padding/2,e.intersect=function(t){return fe.rect(e,t)},a},"forkJoin"),Ke={rhombus:ve,composite:Ae,question:ve,rect:ze,labelRect:Me,rectWithTitle:Ye,choice:Ee,circle:Fe,doublecircle:We,stadium:je,hexagon:Te,block_arrow:De,rect_left_inv_arrow:$e,lean_right:Ie,lean_left:Ne,trapezoid:Ce,inv_trapezoid:Be,rect_right_inv_arrow:Oe,cylinder:Re,start:He,end:E((t,e)=>{const r=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),a=r.insert("circle",":first-child"),i=r.insert("circle",":first-child");return i.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),a.attr("class","state-end").attr("r",5).attr("width",10).attr("height",10),we(e,i),e.intersect=function(t){return fe.circle(e,7,t)},r},"end"),note:Se,subroutine:Xe,fork:Ue,join:Ue,class_box:E(async(t,e)=>{var r;const a=e.padding/2;let i;i=e.classes?"node "+e.classes:"node default";const n=t.insert("g").attr("class",i).attr("id",e.domId||e.id),s=n.insert("rect",":first-child"),o=n.insert("line"),l=n.insert("line");let c=0,d=4;const h=n.insert("g").attr("class","label");let g=0;const u=null==(r=e.classData.annotations)?void 0:r[0],y=e.classData.annotations[0]?"«"+e.classData.annotations[0]+"»":"",p=await Ut(h,y,e.labelStyle,!0,!0);let x=p.getBBox();if(M(B())){const t=p.children[0],e=D(p);x=t.getBoundingClientRect(),e.attr("width",x.width),e.attr("height",x.height)}e.classData.annotations[0]&&(d+=x.height+4,c+=x.width);let b=e.classData.label;void 0!==e.classData.type&&""!==e.classData.type&&(M(B())?b+="<"+e.classData.type+">":b+="<"+e.classData.type+">");const f=await Ut(h,b,e.labelStyle,!0,!0);D(f).attr("class","classTitle");let m=f.getBBox();if(M(B())){const t=f.children[0],e=D(f);m=t.getBoundingClientRect(),e.attr("width",m.width),e.attr("height",m.height)}d+=m.height+4,m.width>c&&(c=m.width);const w=[];e.classData.members.forEach(async t=>{const r=t.getDisplayDetails();let a=r.displayText;M(B())&&(a=a.replace(/</g,"<").replace(/>/g,">"));const i=await Ut(h,a,r.cssStyle?r.cssStyle:e.labelStyle,!0,!0);let n=i.getBBox();if(M(B())){const t=i.children[0],e=D(i);n=t.getBoundingClientRect(),e.attr("width",n.width),e.attr("height",n.height)}n.width>c&&(c=n.width),d+=n.height+4,w.push(i)}),d+=8;const k=[];if(e.classData.methods.forEach(async t=>{const r=t.getDisplayDetails();let a=r.displayText;M(B())&&(a=a.replace(/</g,"<").replace(/>/g,">"));const i=await Ut(h,a,r.cssStyle?r.cssStyle:e.labelStyle,!0,!0);let n=i.getBBox();if(M(B())){const t=i.children[0],e=D(i);n=t.getBoundingClientRect(),e.attr("width",n.width),e.attr("height",n.height)}n.width>c&&(c=n.width),d+=n.height+4,k.push(i)}),d+=8,u){let t=(c-x.width)/2;D(p).attr("transform","translate( "+(-1*c/2+t)+", "+-1*d/2+")"),g=x.height+4}let S=(c-m.width)/2;return D(f).attr("transform","translate( "+(-1*c/2+S)+", "+(-1*d/2+g)+")"),g+=m.height+4,o.attr("class","divider").attr("x1",-c/2-a).attr("x2",c/2+a).attr("y1",-d/2-a+8+g).attr("y2",-d/2-a+8+g),g+=8,w.forEach(t=>{D(t).attr("transform","translate( "+-c/2+", "+(-1*d/2+g+4)+")");const e=null==t?void 0:t.getBBox();g+=((null==e?void 0:e.height)??0)+4}),g+=8,l.attr("class","divider").attr("x1",-c/2-a).attr("x2",c/2+a).attr("y1",-d/2-a+8+g).attr("y2",-d/2-a+8+g),g+=8,k.forEach(t=>{D(t).attr("transform","translate( "+-c/2+", "+(-1*d/2+g)+")");const e=null==t?void 0:t.getBBox();g+=((null==e?void 0:e.height)??0)+4}),s.attr("style",e.style).attr("class","outer title-state").attr("x",-c/2-a).attr("y",-d/2-a).attr("width",c+e.padding).attr("height",d+e.padding),we(e,s),e.intersect=function(t){return fe.rect(e,t)},n},"class_box")},qe={},Ze=E(async(t,e,r)=>{let a,i;if(e.link){let n;"sandbox"===B().securityLevel?n="_top":e.linkTarget&&(n=e.linkTarget||"_blank"),a=t.insert("svg:a").attr("xlink:href",e.link).attr("target",n),i=await Ke[e.shape](a,e,r)}else i=await Ke[e.shape](t,e,r),a=i;return e.tooltip&&i.attr("title",e.tooltip),e.class&&i.attr("class","node default "+e.class),qe[e.id]=a,e.haveCallback&&qe[e.id].attr("class",qe[e.id].attr("class")+" clickable"),a},"insertNode"),Ve=E(t=>{const e=qe[t.id];I.trace("Transforming node",t.diff,t,"translate("+(t.x-t.width/2-5)+", "+t.width/2+")");const r=t.diff||0;return t.clusterNode?e.attr("transform","translate("+(t.x+r-t.width/2)+", "+(t.y-t.height/2-8)+")"):e.attr("transform","translate("+t.x+", "+t.y+")"),r},"positionNode");function Ge(t,e,r=!1){var a,i,n;const s=t;let o="default";((null==(a=null==s?void 0:s.classes)?void 0:a.length)||0)>0&&(o=((null==s?void 0:s.classes)??[]).join(" ")),o+=" flowchart-label";let l,c=0,d="";switch(s.type){case"round":c=5,d="rect";break;case"composite":c=0,d="composite",l=0;break;case"square":case"group":default:d="rect";break;case"diamond":d="question";break;case"hexagon":d="hexagon";break;case"block_arrow":d="block_arrow";break;case"odd":case"rect_left_inv_arrow":d="rect_left_inv_arrow";break;case"lean_right":d="lean_right";break;case"lean_left":d="lean_left";break;case"trapezoid":d="trapezoid";break;case"inv_trapezoid":d="inv_trapezoid";break;case"circle":d="circle";break;case"ellipse":d="ellipse";break;case"stadium":d="stadium";break;case"subroutine":d="subroutine";break;case"cylinder":d="cylinder";break;case"doublecircle":d="doublecircle"}const h=X((null==s?void 0:s.styles)??[]),g=s.label,u=s.size??{width:0,height:0,x:0,y:0},y=e.getDiagramId();return{labelStyle:h.labelStyle,shape:d,labelText:g,rx:c,ry:c,class:o,style:h.style,id:s.id,domId:y?`${y}-${s.id}`:s.id,directions:s.directions,width:u.width,height:u.height,x:u.x,y:u.y,positioned:r,intersect:void 0,type:s.type,padding:l??(null==(n=null==(i=T())?void 0:i.block)?void 0:n.padding)??0,widthInColumns:s.widthInColumns??1}}async function Je(t,e,r){const a=Ge(e,r,!1);if("group"===a.type)return;const i=T(),n=await Ze(t,a,{config:i}),s=n.node().getBBox(),o=r.getBlock(a.id);o.size={width:s.width,height:s.height,x:0,y:0,node:n},r.setBlock(o),n.remove()}async function Qe(t,e,r){const a=Ge(e,r,!0);if("space"!==r.getBlock(a.id).type){const r=T();await Ze(t,a,{config:r}),e.intersect=null==a?void 0:a.intersect,Ve(a)}}async function tr(t,e,r,a){for(const i of e)await a(t,i,r),i.children&&await tr(t,i.children,r,a)}async function er(t,e,r){await tr(t,e,r,Je)}async function rr(t,e,r){await tr(t,e,r,Qe)}async function ar(t,e,r,a,i){const n=new q({multigraph:!0,compound:!0});n.setGraph({rankdir:"TB",nodesep:10,ranksep:10,marginx:8,marginy:8});for(const s of r)s.size&&n.setNode(s.id,{width:s.size.width,height:s.size.height,intersect:s.intersect});for(const s of e)if(s.start&&s.end){const e=a.getBlock(s.start),r=a.getBlock(s.end);if((null==e?void 0:e.size)&&(null==r?void 0:r.size)){const a=e.size,o=r.size,l=[{x:a.x,y:a.y},{x:a.x+(o.x-a.x)/2,y:a.y+(o.y-a.y)/2},{x:o.x,y:o.y}],c=i?`${i}-${s.id}`:s.id,d=`${"thick"===s.thickness?"edge-thickness-thick":"edge-thickness-normal"} ${"dotted"===s.pattern?"edge-pattern-dotted":"edge-pattern-solid"} flowchart-link LS-a1 LE-b1`;ie(t,{v:s.start,w:s.end,name:c},{...s,id:c,arrowTypeEnd:s.arrowTypeEnd,arrowTypeStart:s.arrowTypeStart,points:l,classes:d},void 0,"block",n,i),s.label&&(await Jt(t,{...s,label:s.label,labelStyle:"stroke: #333; stroke-width: 1.5px;fill:none;",arrowTypeEnd:s.arrowTypeEnd,arrowTypeStart:s.arrowTypeStart,points:l,classes:d}),te({...s,x:l[1].x,y:l[1].y},{originalPath:l}))}}}E(Ge,"getNodeFromBlock"),E(Je,"calculateBlockSize"),E(Qe,"insertBlockPositioned"),E(tr,"performOperations"),E(er,"calculateBlockSizes"),E(rr,"insertBlocks"),E(ar,"insertEdges");var ir=E(function(t,e){return e.db.getClasses()},"getClasses"),nr={parser:Q,db:Ot,renderer:{draw:E(async function(t,e,r,a){const{securityLevel:i,block:n}=T(),s=a.db;let o;s.setDiagramId(e),"sandbox"===i&&(o=D("#i"+e));const l=D("sandbox"===i?o.nodes()[0].contentDocument.body:"body"),c="sandbox"===i?l.select(`[id="${e}"]`):D(`[id="${e}"]`);Pt(c,["point","circle","cross"],a.type,e);const d=s.getBlocks(),h=s.getBlocksFlat(),g=s.getEdges(),u=c.insert("g").attr("class","block");await er(u,d,s);const y=Ht(s);if(await rr(u,d,s),await ar(u,g,h,s,e),y){const t=y,e=Math.max(1,Math.round(t.width/t.height*.125)),r=t.height+e+10,a=t.width+10,{useMaxWidth:i}=n;$(c,r,a,!!i),I.debug("Here Bounds",y,t),c.attr("viewBox",`${t.x-5} ${t.y-5} ${t.width+10} ${t.height+10}`)}},"draw"),getClasses:ir},styles:zt};export{nr as diagram};
|
|
1
|
+
import{g as t}from"./chunk-5VM5RSS4-B2vAHhDa.js";import{az as e,aA as r,aB as a,aC as i,aD as n,aE as s,aF as o,aG as l,aH as c,aI as d,aJ as h,aK as g,aL as u,aM as y,aN as p,aO as x,aP as b,aQ as f,aR as m,aS as w,aT as k,aU as S,aV as L,aW as _,aX as v,_ as E,z as T,d as D,e as $,l as I,q as N,t as C,c as B,aY as O,a6 as R,a7 as z,a3 as A,aZ as M,a_ as P,a$ as Y,ar as j,y as F,k as W,b0 as X,i as H,b1 as U,b2 as K}from"./mermaid.core-FH1Glzn5.js";import{G as q}from"./graph-DaY0Al7L.js";import{c as Z}from"./channel-BnqCG-Dw.js";import"./index-DJJA3FVt.js";function V(t){if(e(t))return t;const E=r(t);if(!function(t){switch(r(t)){case v:case _:case L:case S:case k:case w:case m:case f:case b:case x:case p:case y:case u:case g:case h:case d:case c:case l:case o:case s:case n:case i:return!0;default:return!1}}(t))return{};if(T=t,Array.isArray(T)){const e=Array.from(t);return t.length>0&&"string"==typeof t[0]&&Object.hasOwn(t,"index")&&(e.index=t.index,e.input=t.input),e}var T;if(a(t)){const e=t;return new(0,e.constructor)(e.buffer,e.byteOffset,e.length)}if("[object ArrayBuffer]"===E)return new ArrayBuffer(t.byteLength);if("[object DataView]"===E){const e=t,r=e.buffer,a=e.byteOffset,i=e.byteLength,n=new ArrayBuffer(i),s=new Uint8Array(r,a,i);return new Uint8Array(n).set(s),new DataView(n)}if("[object Boolean]"===E||"[object Number]"===E||"[object String]"===E){const e=new(0,t.constructor)(t.valueOf());return"[object String]"===E?function(t,e){const r=e.valueOf().length;for(const a in e)Object.hasOwn(e,a)&&(Number.isNaN(Number(a))||Number(a)>=r)&&(t[a]=e[a])}(e,t):G(e,t),e}if("[object Date]"===E)return new Date(Number(t));if("[object RegExp]"===E){const e=t,r=new RegExp(e.source,e.flags);return r.lastIndex=e.lastIndex,r}if("[object Symbol]"===E)return Object(Symbol.prototype.valueOf.call(t));if("[object Map]"===E){const e=t,r=new Map;return e.forEach((t,e)=>{r.set(e,t)}),r}if("[object Set]"===E){const e=t,r=new Set;return e.forEach(t=>{r.add(t)}),r}if("[object Arguments]"===E){const e=t,r={};return G(r,e),r.length=e.length,r[Symbol.iterator]=e[Symbol.iterator],r}const D={};return function(t,e){const r=Object.getPrototypeOf(e);null!==r&&"function"==typeof e.constructor&&Object.setPrototypeOf(t,r)}(D,t),G(D,t),function(t,e){const r=Object.getOwnPropertySymbols(e);for(let a=0;a<r.length;a++){const i=r[a];Object.prototype.propertyIsEnumerable.call(e,i)&&(t[i]=e[i])}}(D,t),D}function G(t,e){for(const r in e)Object.hasOwn(e,r)&&(t[r]=e[r])}var J=function(){var t=E(function(t,e,r,a){for(r=r||{},a=t.length;a--;r[t[a]]=e);return r},"o"),e=[1,15],r=[1,7],a=[1,13],i=[1,14],n=[1,19],s=[1,16],o=[1,17],l=[1,18],c=[8,30],d=[8,10,21,28,29,30,31,39,43,46],h=[1,23],g=[1,24],u=[8,10,15,16,21,28,29,30,31,39,43,46],y=[8,10,15,16,21,27,28,29,30,31,39,43,46],p=[1,49],x={trace:E(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:E(function(t,e,r,a,i,n,s){var o=n.length-1;switch(i){case 4:a.getLogger().debug("Rule: separator (NL) ");break;case 5:a.getLogger().debug("Rule: separator (Space) ");break;case 6:a.getLogger().debug("Rule: separator (EOF) ");break;case 7:a.getLogger().debug("Rule: hierarchy: ",n[o-1]),a.setHierarchy(n[o-1]);break;case 8:a.getLogger().debug("Stop NL ");break;case 9:a.getLogger().debug("Stop EOF ");break;case 10:a.getLogger().debug("Stop NL2 ");break;case 11:a.getLogger().debug("Stop EOF2 ");break;case 12:a.getLogger().debug("Rule: statement: ",n[o]),"number"==typeof n[o].length?this.$=n[o]:this.$=[n[o]];break;case 13:a.getLogger().debug("Rule: statement #2: ",n[o-1]),this.$=[n[o-1]].concat(n[o]);break;case 14:a.getLogger().debug("Rule: link: ",n[o],t),this.$={edgeTypeStr:n[o],label:""};break;case 15:a.getLogger().debug("Rule: LABEL link: ",n[o-3],n[o-1],n[o]),this.$={edgeTypeStr:n[o],label:n[o-1]};break;case 18:const e=parseInt(n[o]),r=a.generateId();this.$={id:r,type:"space",label:"",width:e,children:[]};break;case 23:a.getLogger().debug("Rule: (nodeStatement link node) ",n[o-2],n[o-1],n[o]," typestr: ",n[o-1].edgeTypeStr);const i=a.edgeStrToEdgeData(n[o-1].edgeTypeStr),s=a.edgeStrToEdgeStartData(n[o-1].edgeTypeStr),l=a.edgeStrToThickness(n[o-1].edgeTypeStr),c=a.edgeStrToPattern(n[o-1].edgeTypeStr);this.$=[{id:n[o-2].id,label:n[o-2].label,type:n[o-2].type,directions:n[o-2].directions},{id:n[o-2].id+"-"+n[o].id,start:n[o-2].id,end:n[o].id,label:n[o-1].label,type:"edge",thickness:l,pattern:c,directions:n[o].directions,arrowTypeEnd:i,arrowTypeStart:s},{id:n[o].id,label:n[o].label,type:a.typeStr2Type(n[o].typeStr),directions:n[o].directions}];break;case 24:a.getLogger().debug("Rule: nodeStatement (abc88 node size) ",n[o-1],n[o]),this.$={id:n[o-1].id,label:n[o-1].label,type:a.typeStr2Type(n[o-1].typeStr),directions:n[o-1].directions,widthInColumns:parseInt(n[o],10)};break;case 25:a.getLogger().debug("Rule: nodeStatement (node) ",n[o]),this.$={id:n[o].id,label:n[o].label,type:a.typeStr2Type(n[o].typeStr),directions:n[o].directions,widthInColumns:1};break;case 26:a.getLogger().debug("APA123",this?this:"na"),a.getLogger().debug("COLUMNS: ",n[o]),this.$={type:"column-setting",columns:"auto"===n[o]?-1:parseInt(n[o])};break;case 27:a.getLogger().debug("Rule: id-block statement : ",n[o-2],n[o-1]),a.generateId(),this.$={...n[o-2],type:"composite",children:n[o-1]};break;case 28:a.getLogger().debug("Rule: blockStatement : ",n[o-2],n[o-1],n[o]);const d=a.generateId();this.$={id:d,type:"composite",label:"",children:n[o-1]};break;case 29:a.getLogger().debug("Rule: node (NODE_ID separator): ",n[o]),this.$={id:n[o]};break;case 30:a.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",n[o-1],n[o]),this.$={id:n[o-1],label:n[o].label,typeStr:n[o].typeStr,directions:n[o].directions};break;case 31:a.getLogger().debug("Rule: dirList: ",n[o]),this.$=[n[o]];break;case 32:a.getLogger().debug("Rule: dirList: ",n[o-1],n[o]),this.$=[n[o-1]].concat(n[o]);break;case 33:a.getLogger().debug("Rule: nodeShapeNLabel: ",n[o-2],n[o-1],n[o]),this.$={typeStr:n[o-2]+n[o],label:n[o-1]};break;case 34:a.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",n[o-3],n[o-2]," #3:",n[o-1],n[o]),this.$={typeStr:n[o-3]+n[o],label:n[o-2],directions:n[o-1]};break;case 35:case 36:this.$={type:"classDef",id:n[o-1].trim(),css:n[o].trim()};break;case 37:this.$={type:"applyClass",id:n[o-1].trim(),styleClass:n[o].trim()};break;case 38:this.$={type:"applyStyles",id:n[o-1].trim(),stylesStr:n[o].trim()}}},"anonymous"),table:[{9:1,10:[1,2]},{1:[3]},{10:e,11:3,13:4,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:a,29:i,31:n,39:s,43:o,46:l},{8:[1,20]},t(c,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,10:e,21:r,28:a,29:i,31:n,39:s,43:o,46:l}),t(d,[2,16],{14:22,15:h,16:g}),t(d,[2,17]),t(d,[2,18]),t(d,[2,19]),t(d,[2,20]),t(d,[2,21]),t(d,[2,22]),t(u,[2,25],{27:[1,25]}),t(d,[2,26]),{19:26,26:12,31:n},{10:e,11:27,13:4,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:a,29:i,31:n,39:s,43:o,46:l},{40:[1,28],42:[1,29]},{44:[1,30]},{47:[1,31]},t(y,[2,29],{32:32,35:[1,33],37:[1,34]}),{1:[2,7]},t(c,[2,13]),{26:35,31:n},{31:[2,14]},{17:[1,36]},t(u,[2,24]),{10:e,11:37,13:4,14:22,15:h,16:g,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:a,29:i,31:n,39:s,43:o,46:l},{30:[1,38]},{41:[1,39]},{41:[1,40]},{45:[1,41]},{48:[1,42]},t(y,[2,30]),{18:[1,43]},{18:[1,44]},t(u,[2,23]),{18:[1,45]},{30:[1,46]},t(d,[2,28]),t(d,[2,35]),t(d,[2,36]),t(d,[2,37]),t(d,[2,38]),{36:[1,47]},{33:48,34:p},{15:[1,50]},t(d,[2,27]),t(y,[2,33]),{38:[1,51]},{33:52,34:p,38:[2,31]},{31:[2,15]},t(y,[2,34]),{38:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:E(function(t,e){if(!e.recoverable){var r=new Error(t);throw r.hash=e,r}this.trace(t)},"parseError"),parse:E(function(t){var e=this,r=[0],a=[],i=[null],n=[],s=this.table,o="",l=0,c=0,d=n.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var u in this.yy)Object.prototype.hasOwnProperty.call(this.yy,u)&&(g.yy[u]=this.yy[u]);h.setInput(t,g.yy),g.yy.lexer=h,g.yy.parser=this,void 0===h.yylloc&&(h.yylloc={});var y=h.yylloc;n.push(y);var p=h.options&&h.options.ranges;function x(){var t;return"number"!=typeof(t=a.pop()||h.lex()||1)&&(t instanceof Array&&(t=(a=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof g.yy.parseError?this.parseError=g.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,E(function(t){r.length=r.length-2*t,i.length=i.length-t,n.length=n.length-t},"popStack"),E(x,"lex");for(var b,f,m,w,k,S,L,_,v={};;){if(f=r[r.length-1],this.defaultActions[f]?m=this.defaultActions[f]:(null==b&&(b=x()),m=s[f]&&s[f][b]),void 0===m||!m.length||!m[0]){var T="";for(k in _=[],s[f])this.terminals_[k]&&k>2&&_.push("'"+this.terminals_[k]+"'");T=h.showPosition?"Parse error on line "+(l+1)+":\n"+h.showPosition()+"\nExpecting "+_.join(", ")+", got '"+(this.terminals_[b]||b)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==b?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(T,{text:h.match,token:this.terminals_[b]||b,line:h.yylineno,loc:y,expected:_})}if(m[0]instanceof Array&&m.length>1)throw new Error("Parse Error: multiple actions possible at state: "+f+", token: "+b);switch(m[0]){case 1:r.push(b),i.push(h.yytext),n.push(h.yylloc),r.push(m[1]),b=null,c=h.yyleng,o=h.yytext,l=h.yylineno,y=h.yylloc;break;case 2:if(S=this.productions_[m[1]][1],v.$=i[i.length-S],v._$={first_line:n[n.length-(S||1)].first_line,last_line:n[n.length-1].last_line,first_column:n[n.length-(S||1)].first_column,last_column:n[n.length-1].last_column},p&&(v._$.range=[n[n.length-(S||1)].range[0],n[n.length-1].range[1]]),void 0!==(w=this.performAction.apply(v,[o,c,l,g.yy,m[1],i,n].concat(d))))return w;S&&(r=r.slice(0,-1*S*2),i=i.slice(0,-1*S),n=n.slice(0,-1*S)),r.push(this.productions_[m[1]][0]),i.push(v.$),n.push(v._$),L=s[r[r.length-2]][r[r.length-1]],r.push(L);break;case 3:return!0}}return!0},"parse")},b=function(){return{EOF:1,parseError:E(function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},"parseError"),setInput:E(function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:E(function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},"input"),unput:E(function(t){var e=t.length,r=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var a=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),r.length-1&&(this.yylineno-=r.length-1);var i=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:r?(r.length===a.length?this.yylloc.first_column:0)+a[a.length-r.length].length-r[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},"unput"),more:E(function(){return this._more=!0,this},"more"),reject:E(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:E(function(t){this.unput(this.match.slice(t))},"less"),pastInput:E(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:E(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:E(function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},"showPosition"),test_match:E(function(t,e){var r,a,i;if(this.options.backtrack_lexer&&(i={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&&(i.yylloc.range=this.yylloc.range.slice(0))),(a=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=a.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:a?a[a.length-1].length-a[a.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],r=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack){for(var n in i)this[n]=i[n];return!1}return!1},"test_match"),next:E(function(){if(this.done)return this.EOF;var t,e,r,a;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),n=0;n<i.length;n++)if((r=this._input.match(this.rules[i[n]]))&&(!e||r[0].length>e[0].length)){if(e=r,a=n,this.options.backtrack_lexer){if(!1!==(t=this.test_match(r,i[n])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,i[a]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:E(function(){var t=this.next();return t||this.lex()},"lex"),begin:E(function(t){this.conditionStack.push(t)},"begin"),popState:E(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:E(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:E(function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},"topState"),pushState:E(function(t){this.begin(t)},"pushState"),stateStackSize:E(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:E(function(t,e,r,a){switch(r){case 0:return t.getLogger().debug("Found block-beta"),10;case 1:return t.getLogger().debug("Found id-block"),29;case 2:return t.getLogger().debug("Found block"),10;case 3:t.getLogger().debug(".",e.yytext);break;case 4:t.getLogger().debug("_",e.yytext);break;case 5:return 5;case 6:return e.yytext=-1,28;case 7:return e.yytext=e.yytext.replace(/columns\s+/,""),t.getLogger().debug("COLUMNS (LEX)",e.yytext),28;case 8:case 76:case 77:case 99:this.pushState("md_string");break;case 9:return"MD_STR";case 10:case 34:case 79:this.popState();break;case 11:this.pushState("string");break;case 12:t.getLogger().debug("LEX: POPPING STR:",e.yytext),this.popState();break;case 13:return t.getLogger().debug("LEX: STR end:",e.yytext),"STR";case 14:return e.yytext=e.yytext.replace(/space\:/,""),t.getLogger().debug("SPACE NUM (LEX)",e.yytext),21;case 15:return e.yytext="1",t.getLogger().debug("COLUMNS (LEX)",e.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 35:return"acc_descr_multiline_value";case 36:return 30;case 37:case 38:case 40:case 41:case 44:return this.popState(),t.getLogger().debug("Lex: (("),"NODE_DEND";case 39:return this.popState(),t.getLogger().debug("Lex: ))"),"NODE_DEND";case 42:return this.popState(),t.getLogger().debug("Lex: (-"),"NODE_DEND";case 43:return this.popState(),t.getLogger().debug("Lex: -)"),"NODE_DEND";case 45:return this.popState(),t.getLogger().debug("Lex: ]]"),"NODE_DEND";case 46:return this.popState(),t.getLogger().debug("Lex: ("),"NODE_DEND";case 47:return this.popState(),t.getLogger().debug("Lex: ])"),"NODE_DEND";case 48:case 49:return this.popState(),t.getLogger().debug("Lex: /]"),"NODE_DEND";case 50:return this.popState(),t.getLogger().debug("Lex: )]"),"NODE_DEND";case 51:return this.popState(),t.getLogger().debug("Lex: )"),"NODE_DEND";case 52:return this.popState(),t.getLogger().debug("Lex: ]>"),"NODE_DEND";case 53:return this.popState(),t.getLogger().debug("Lex: ]"),"NODE_DEND";case 54:return t.getLogger().debug("Lexa: -)"),this.pushState("NODE"),35;case 55:return t.getLogger().debug("Lexa: (-"),this.pushState("NODE"),35;case 56:return t.getLogger().debug("Lexa: ))"),this.pushState("NODE"),35;case 57:case 59:case 60:case 61:case 64:return t.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 58:return t.getLogger().debug("Lex: ((("),this.pushState("NODE"),35;case 62:return t.getLogger().debug("Lexc: >"),this.pushState("NODE"),35;case 63:return t.getLogger().debug("Lexa: (["),this.pushState("NODE"),35;case 65:case 66:case 67:case 68:case 69:case 70:case 71:return this.pushState("NODE"),35;case 72:return t.getLogger().debug("Lexa: ["),this.pushState("NODE"),35;case 73:return this.pushState("BLOCK_ARROW"),t.getLogger().debug("LEX ARR START"),37;case 74:return t.getLogger().debug("Lex: NODE_ID",e.yytext),31;case 75:return t.getLogger().debug("Lex: EOF",e.yytext),8;case 78:return"NODE_DESCR";case 80:t.getLogger().debug("Lex: Starting string"),this.pushState("string");break;case 81:t.getLogger().debug("LEX ARR: Starting string"),this.pushState("string");break;case 82:return t.getLogger().debug("LEX: NODE_DESCR:",e.yytext),"NODE_DESCR";case 83:t.getLogger().debug("LEX POPPING"),this.popState();break;case 84:t.getLogger().debug("Lex: =>BAE"),this.pushState("ARROW_DIR");break;case 85:return e.yytext=e.yytext.replace(/^,\s*/,""),t.getLogger().debug("Lex (right): dir:",e.yytext),"DIR";case 86:return e.yytext=e.yytext.replace(/^,\s*/,""),t.getLogger().debug("Lex (left):",e.yytext),"DIR";case 87:return e.yytext=e.yytext.replace(/^,\s*/,""),t.getLogger().debug("Lex (x):",e.yytext),"DIR";case 88:return e.yytext=e.yytext.replace(/^,\s*/,""),t.getLogger().debug("Lex (y):",e.yytext),"DIR";case 89:return e.yytext=e.yytext.replace(/^,\s*/,""),t.getLogger().debug("Lex (up):",e.yytext),"DIR";case 90:return e.yytext=e.yytext.replace(/^,\s*/,""),t.getLogger().debug("Lex (down):",e.yytext),"DIR";case 91:return e.yytext="]>",t.getLogger().debug("Lex (ARROW_DIR end):",e.yytext),this.popState(),this.popState(),"BLOCK_ARROW_END";case 92:return t.getLogger().debug("Lex: LINK","#"+e.yytext+"#"),15;case 93:case 94:case 95:return t.getLogger().debug("Lex: LINK",e.yytext),15;case 96:case 97:case 98:return t.getLogger().debug("Lex: START_LINK",e.yytext),this.pushState("LLABEL"),16;case 100:return t.getLogger().debug("Lex: Starting string"),this.pushState("string"),"LINK_LABEL";case 101:return this.popState(),t.getLogger().debug("Lex: LINK","#"+e.yytext+"#"),15;case 102:case 103:return this.popState(),t.getLogger().debug("Lex: LINK",e.yytext),15;case 104:return t.getLogger().debug("Lex: COLON",e.yytext),e.yytext=e.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}}}}();function f(){this.yy={}}return x.lexer=b,E(f,"Parser"),f.prototype=x,x.Parser=f,new f}();J.parser=J;var Q=J,tt=new Map,et=[],rt=new Map,at="color",it="fill",nt=new Map,st="",ot=E(t=>W.sanitizeText(t,B()),"sanitizeText"),lt=E(function(t,e=""){let r=nt.get(t);r||(r={id:t,styles:[],textStyles:[]},nt.set(t,r)),null!=e&&e.split(",").forEach(t=>{const e=t.replace(/([^;]*);/,"$1").trim();if(RegExp(at).exec(t)){const t=e.replace(it,"bgFill").replace(at,it);r.textStyles.push(t)}r.styles.push(e)})},"addStyleClass"),ct=E(function(t,e=""){const r=tt.get(t);null!=e&&(r.styles=e.split(","))},"addStyle2Node"),dt=E(function(t,e){t.split(",").forEach(function(t){let r=tt.get(t);if(void 0===r){const e=t.trim();r={id:e,type:"na",children:[]},tt.set(e,r)}r.classes||(r.classes=[]),r.classes.push(e)})},"setCssClass"),ht=E((t,e)=>{const r=t.flat(),a=[],i=r.find(t=>"column-setting"===(null==t?void 0:t.type)),n=(null==i?void 0:i.columns)??-1;for(const s of r)if("number"==typeof n&&n>0&&"column-setting"!==s.type&&"number"==typeof s.widthInColumns&&s.widthInColumns>n&&I.warn(`Block ${s.id} width ${s.widthInColumns} exceeds configured column width ${n}`),s.label&&(s.label=ot(s.label)),"classDef"!==s.type)if("applyClass"!==s.type)if("applyStyles"!==s.type)if("column-setting"===s.type)e.columns=s.columns??-1;else if("edge"===s.type){const t=(rt.get(s.id)??0)+1;rt.set(s.id,t),s.id=t+"-"+s.id,et.push(s)}else{s.label||("composite"===s.type?s.label="":s.label=s.id);const t=tt.get(s.id);if(void 0===t?tt.set(s.id,s):("na"!==s.type&&(t.type=s.type),s.label!==s.id&&(t.label=s.label)),s.children&&ht(s.children,s),"space"===s.type){const t=s.width??1;for(let e=0;e<t;e++){const t=V(s);t.id=t.id+"-"+e,tt.set(t.id,t),a.push(t)}}else void 0===t&&a.push(s)}else(null==s?void 0:s.stylesStr)&&ct(s.id,null==s?void 0:s.stylesStr);else dt(s.id,(null==s?void 0:s.styleClass)??"");else lt(s.id,s.css);e.children=a},"populateBlockDatabase"),gt=[],ut={id:"root",type:"composite",children:[],columns:-1},yt=E(()=>{I.debug("Clear called"),N(),ut={id:"root",type:"composite",children:[],columns:-1},tt=new Map([["root",ut]]),gt=[],nt=new Map,et=[],rt=new Map,st=""},"clear");function pt(t){switch(I.debug("typeStr2Type",t),t){case"[]":return"square";case"()":return I.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"}}function xt(t){return I.debug("typeStr2Type",t),"=="===t?"thick":"normal"}function bt(t){switch(t.trim().slice(-1)){case"x":return"arrow_cross";case"o":return"arrow_circle";case">":return"arrow_point";default:return""}}function ft(t){switch(t.trim().charAt(0)){case"x":return"arrow_cross";case"o":return"arrow_circle";case"<":return"arrow_point";default:return"arrow_open"}}function mt(t){return t.includes("==")?"thick":"normal"}function wt(t){return t.includes(".-")?"dotted":"solid"}E(pt,"typeStr2Type"),E(xt,"edgeTypeStr2Type"),E(bt,"edgeStrToEdgeData"),E(ft,"edgeStrToEdgeStartData"),E(mt,"edgeStrToThickness"),E(wt,"edgeStrToPattern");var kt=0,St=E(()=>(kt++,"id-"+Math.random().toString(36).substr(2,12)+"-"+kt),"generateId"),Lt=E(t=>{ut.children=t,ht(t,ut),gt=ut.children},"setHierarchy"),_t=E(t=>{const e=tt.get(t);return e?e.columns?e.columns:e.children?e.children.length:-1:-1},"getColumns"),vt=E(()=>[...tt.values()],"getBlocksFlat"),Et=E(()=>gt||[],"getBlocks"),Tt=E(()=>et,"getEdges"),Dt=E(t=>tt.get(t),"getBlock"),$t=E(t=>{tt.set(t.id,t)},"setBlock"),It=E(t=>{st=t},"setDiagramId"),Nt=E(()=>st,"getDiagramId"),Ct=E(()=>I,"getLogger"),Bt=E(function(){return nt},"getClasses"),Ot={getConfig:E(()=>T().block,"getConfig"),typeStr2Type:pt,edgeTypeStr2Type:xt,edgeStrToEdgeData:bt,edgeStrToEdgeStartData:ft,edgeStrToThickness:mt,edgeStrToPattern:wt,getLogger:Ct,getBlocksFlat:vt,getBlocks:Et,getEdges:Tt,setHierarchy:Lt,getBlock:Dt,setBlock:$t,getColumns:_t,getClasses:Bt,clear:yt,generateId:St,setDiagramId:It,getDiagramId:Nt},Rt=E((t,e)=>{const r=Z,a=r(t,"r"),i=r(t,"g"),n=r(t,"b");return C(a,i,n,e)},"fade"),zt=E(e=>`.label {\n font-family: ${e.fontFamily};\n color: ${e.nodeTextColor||e.textColor};\n }\n .cluster-label text {\n fill: ${e.titleColor};\n }\n .cluster-label span,p {\n color: ${e.titleColor};\n }\n\n\n\n .label text,span,p {\n fill: ${e.nodeTextColor||e.textColor};\n color: ${e.nodeTextColor||e.textColor};\n }\n\n .node rect,\n .node circle,\n .node ellipse,\n .node polygon,\n .node path {\n fill: ${e.mainBkg};\n stroke: ${e.nodeBorder};\n stroke-width: 1px;\n }\n .flowchart-label text {\n text-anchor: middle;\n }\n // .flowchart-label .text-outer-tspan {\n // text-anchor: middle;\n // }\n // .flowchart-label .text-inner-tspan {\n // text-anchor: start;\n // }\n\n .node .label {\n text-align: center;\n }\n .node.clickable {\n cursor: pointer;\n }\n\n .arrowheadPath {\n fill: ${e.arrowheadColor};\n }\n\n .edgePath .path {\n stroke: ${e.lineColor};\n stroke-width: 2.0px;\n }\n\n .flowchart-link {\n stroke: ${e.lineColor};\n fill: none;\n }\n\n .edgeLabel {\n background-color: ${e.edgeLabelBackground};\n /*\n * This is for backward compatibility with existing code that didn't\n * add a \`<p>\` around edge labels.\n *\n * TODO: We should probably remove this in a future release.\n */\n p {\n margin: 0;\n padding: 0;\n display: inline;\n }\n rect {\n opacity: 0.5;\n background-color: ${e.edgeLabelBackground};\n fill: ${e.edgeLabelBackground};\n }\n text-align: center;\n }\n\n /* For html labels only */\n .labelBkg {\n background-color: ${e.edgeLabelBackground};\n }\n\n .node .cluster {\n // fill: ${Rt(e.mainBkg,.5)};\n fill: ${Rt(e.clusterBkg,.5)};\n stroke: ${Rt(e.clusterBorder,.2)};\n box-shadow: rgba(50, 50, 93, 0.25) 0px 13px 27px -5px, rgba(0, 0, 0, 0.3) 0px 8px 16px -8px;\n stroke-width: 1px;\n }\n\n .cluster text {\n fill: ${e.titleColor};\n }\n\n .cluster span,p {\n color: ${e.titleColor};\n }\n /* .cluster div {\n color: ${e.titleColor};\n } */\n\n div.mermaidTooltip {\n position: absolute;\n text-align: center;\n max-width: 200px;\n padding: 2px;\n font-family: ${e.fontFamily};\n font-size: 12px;\n background: ${e.tertiaryColor};\n border: 1px solid ${e.border2};\n border-radius: 2px;\n pointer-events: none;\n z-index: 100;\n }\n\n .flowchartTitleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ${e.textColor};\n }\n ${t()}\n`,"getStyles"),At=E((t,e,r,a)=>{e.forEach(e=>{Mt[e](t,r,a)})},"insertMarkers"),Mt={extension:E((t,e,r)=>{I.trace("Making markers for ",r),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionStart").attr("class","marker extension "+e).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"),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionEnd").attr("class","marker extension "+e).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"),composition:E((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionStart").attr("class","marker composition "+e).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"),t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionEnd").attr("class","marker composition "+e).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"),aggregation:E((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationStart").attr("class","marker aggregation "+e).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"),t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationEnd").attr("class","marker aggregation "+e).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"),dependency:E((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyStart").attr("class","marker dependency "+e).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"),t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyEnd").attr("class","marker dependency "+e).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"),lollipop:E((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopStart").attr("class","marker lollipop "+e).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),t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopEnd").attr("class","marker lollipop "+e).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"),point:E((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-pointEnd").attr("class","marker "+e).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"),t.append("marker").attr("id",r+"_"+e+"-pointStart").attr("class","marker "+e).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"),circle:E((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-circleEnd").attr("class","marker "+e).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"),t.append("marker").attr("id",r+"_"+e+"-circleStart").attr("class","marker "+e).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"),cross:E((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-crossEnd").attr("class","marker cross "+e).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"),t.append("marker").attr("id",r+"_"+e+"-crossStart").attr("class","marker cross "+e).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"),barb:E((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-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")},Pt=At;function Yt(t,e){if(0===t||!Number.isInteger(t))throw new Error("Columns must be an integer !== 0.");if(e<0||!Number.isInteger(e))throw new Error("Position must be a non-negative integer."+e);if(t<0)return{px:e,py:0};if(1===t)return{px:0,py:e};return{px:e%t,py:Math.floor(e/t)}}E(Yt,"calculateBlockPosition");var jt=E(t=>{let e=0,r=0;for(const a of t.children){const{width:t,height:i,x:n,y:s}=a.size??{width:0,height:0,x:0,y:0};if(I.debug("getMaxChildSize abc95 child:",a.id,"width:",t,"height:",i,"x:",n,"y:",s,a.type),"space"===a.type)continue;const o=t/(a.widthInColumns??1);o>e&&(e=o),i>r&&(r=i)}return{width:e,height:r}},"getMaxChildSize");function Ft(t,e,r=0,a=0,i=8){var n,s,o,l,c,d,h,g,u,y,p;I.debug("setBlockSizes abc95 (start)",t.id,null==(n=null==t?void 0:t.size)?void 0:n.x,"block width =",null==t?void 0:t.size,"siblingWidth",r),(null==(s=null==t?void 0:t.size)?void 0:s.width)||(t.size={width:r,height:a,x:0,y:0});let x=0,b=0;if((null==(o=t.children)?void 0:o.length)>0){for(const r of t.children)Ft(r,e,0,0,i);const n=jt(t);x=n.width,b=n.height,I.debug("setBlockSizes abc95 maxWidth of",t.id,":s children is ",x,b);for(const e of t.children)e.size&&(I.debug(`abc95 Setting size of children of ${t.id} id=${e.id} ${x} ${b} ${JSON.stringify(e.size)}`),e.size.width=x*(e.widthInColumns??1)+i*((e.widthInColumns??1)-1),e.size.height=b,e.size.x=0,e.size.y=0,I.debug(`abc95 updating size of ${t.id} children child:${e.id} maxWidth:${x} maxHeight:${b}`));for(const r of t.children)Ft(r,e,x,b,i);const s=t.columns??-1;let o=0;for(const e of t.children)o+=e.widthInColumns??1;let g=t.children.length;s>0&&s<o&&(g=s);const u=Math.ceil(o/g);let y=g*(x+i)+i,p=u*(b+i)+i;if(y<r){I.debug(`Detected to small sibling: abc95 ${t.id} siblingWidth ${r} siblingHeight ${a} width ${y}`),y=r,p=a;const e=(r-g*i-i)/g,n=(a-u*i-i)/u;I.debug("Size indata abc88",t.id,"childWidth",e,"maxWidth",x),I.debug("Size indata abc88",t.id,"childHeight",n,"maxHeight",b),I.debug("Size indata abc88 xSize",g,"padding",i);for(const r of t.children)r.size&&(r.size.width=e,r.size.height=n,r.size.x=0,r.size.y=0)}if(I.debug(`abc95 (finale calc) ${t.id} xSize ${g} ySize ${u} columns ${s}${t.children.length} width=${Math.max(y,(null==(l=t.size)?void 0:l.width)||0)}`),y<((null==(c=null==t?void 0:t.size)?void 0:c.width)||0)){y=(null==(d=null==t?void 0:t.size)?void 0:d.width)||0;const e=s>0?Math.min(t.children.length,s):t.children.length;if(e>0){const r=(y-e*i-i)/e;I.debug("abc95 (growing to fit) width",t.id,y,null==(h=t.size)?void 0:h.width,r);for(const e of t.children)e.size&&(e.size.width=r)}}t.size={width:y,height:p,x:0,y:0}}I.debug("setBlockSizes abc94 (done)",t.id,null==(g=null==t?void 0:t.size)?void 0:g.x,null==(u=null==t?void 0:t.size)?void 0:u.width,null==(y=null==t?void 0:t.size)?void 0:y.y,null==(p=null==t?void 0:t.size)?void 0:p.height)}function Wt(t,e,r=8){var a,i,n,s,o,l,c,d,h,g,u,y,p,x,b,f,m;I.debug(`abc85 layout blocks (=>layoutBlocks) ${t.id} x: ${null==(a=null==t?void 0:t.size)?void 0:a.x} y: ${null==(i=null==t?void 0:t.size)?void 0:i.y} width: ${null==(n=null==t?void 0:t.size)?void 0:n.width}`);const w=t.columns??-1;if(I.debug("layoutBlocks columns abc95",t.id,"=>",w,t),t.children&&t.children.length>0){const a=(null==(o=null==(s=null==t?void 0:t.children[0])?void 0:s.size)?void 0:o.width)??0,i=t.children.length*a+(t.children.length-1)*r;I.debug("widthOfChildren 88",i,"posX");const n=new Map;{let e=0;for(const r of t.children){if(!r.size)continue;const{py:t}=Yt(w,e),a=n.get(t)??0;r.size.height>a&&n.set(t,r.size.height);let i=(null==r?void 0:r.widthInColumns)??1;w>0&&(i=Math.min(i,w-e%w)),e+=i}}const b=new Map;{let t=0;const e=[...n.keys()].sort((t,e)=>t-e);for(const a of e)b.set(a,t),t+=(n.get(a)??0)+r}let f=0;I.debug("abc91 block?.size?.x",t.id,null==(l=null==t?void 0:t.size)?void 0:l.x);let m=(null==(c=null==t?void 0:t.size)?void 0:c.x)?(null==(d=null==t?void 0:t.size)?void 0:d.x)+(-(null==(h=null==t?void 0:t.size)?void 0:h.width)/2||0):-r,k=0;for(const s of t.children){const a=t;if(!s.size)continue;const{width:i,height:o}=s.size,{px:l,py:c}=Yt(w,f);if(c!=k&&(k=c,m=(null==(g=null==t?void 0:t.size)?void 0:g.x)?(null==(u=null==t?void 0:t.size)?void 0:u.x)+(-(null==(y=null==t?void 0:t.size)?void 0:y.width)/2||0):-r,I.debug("New row in layout for block",t.id," and child ",s.id,k)),I.debug(`abc89 layout blocks (child) id: ${s.id} Pos: ${f} (px, py) ${l},${c} (${null==(p=null==a?void 0:a.size)?void 0:p.x},${null==(x=null==a?void 0:a.size)?void 0:x.y}) parent: ${a.id} width: ${i}${r}`),a.size){const t=i/2;s.size.x=m+r+t,I.debug(`abc91 layout blocks (calc) px, pyid:${s.id} startingPos=X${m} new startingPosX${s.size.x} ${t} padding=${r} width=${i} halfWidth=${t} => x:${s.size.x} y:${s.size.y} ${s.widthInColumns} (width * (child?.w || 1)) / 2 ${i*((null==s?void 0:s.widthInColumns)??1)/2}`),m=s.size.x+t;const e=b.get(c)??0,l=n.get(c)??o;s.size.y=a.size.y-a.size.height/2+e+l/2+r,I.debug(`abc88 layout blocks (calc) px, pyid:${s.id}startingPosX${m}${r}${t}=>x:${s.size.x}y:${s.size.y}${s.widthInColumns}(width * (child?.w || 1)) / 2${i*((null==s?void 0:s.widthInColumns)??1)/2}`)}s.children&&Wt(s,e,r);let d=(null==s?void 0:s.widthInColumns)??1;w>0&&(d=Math.min(d,w-f%w)),f+=d,I.debug("abc88 columnsPos",s,f)}}I.debug(`layout blocks (<==layoutBlocks) ${t.id} x: ${null==(b=null==t?void 0:t.size)?void 0:b.x} y: ${null==(f=null==t?void 0:t.size)?void 0:f.y} width: ${null==(m=null==t?void 0:t.size)?void 0:m.width}`)}function Xt(t,{minX:e,minY:r,maxX:a,maxY:i}={minX:0,minY:0,maxX:0,maxY:0}){if(t.size&&"root"!==t.id){const{x:n,y:s,width:o,height:l}=t.size;n-o/2<e&&(e=n-o/2),s-l/2<r&&(r=s-l/2),n+o/2>a&&(a=n+o/2),s+l/2>i&&(i=s+l/2)}if(t.children)for(const n of t.children)({minX:e,minY:r,maxX:a,maxY:i}=Xt(n,{minX:e,minY:r,maxX:a,maxY:i}));return{minX:e,minY:r,maxX:a,maxY:i}}function Ht(t){var e,r;const a=t.getBlock("root");if(!a)return;const i=(null==(r=null==(e=B())?void 0:e.block)?void 0:r.padding)??8;Ft(a,t,0,0,i),Wt(a,t,i),I.debug("getBlocks",JSON.stringify(a,null,2));const{minX:n,minY:s,maxX:o,maxY:l}=Xt(a);return{x:n,y:s,width:o-n,height:l-s}}E(Ft,"setBlockSizes"),E(Wt,"layoutBlocks"),E(Xt,"findBounds"),E(Ht,"layout");var Ut=E(async(t,e,r,a=!1,i=!1)=>{let n=e||"";"object"==typeof n&&(n=n[0]);const s=B(),o=M(s);return await P(t,n,{style:r,isTitle:a,useHtmlLabels:o,markdown:!1,isNode:i,width:Number.POSITIVE_INFINITY},s)},"createLabel"),Kt=E((t,e,r,a,i)=>{e.arrowTypeStart&&Zt(t,"start",e.arrowTypeStart,r,a,i),e.arrowTypeEnd&&Zt(t,"end",e.arrowTypeEnd,r,a,i)},"addEdgeMarkers"),qt={arrow_cross:"cross",arrow_point:"point",arrow_barb:"barb",arrow_circle:"circle",aggregation:"aggregation",extension:"extension",composition:"composition",dependency:"dependency",lollipop:"lollipop"},Zt=E((t,e,r,a,i,n)=>{const s=qt[r];if(!s)return void I.warn(`Unknown arrow type: ${r}`);const o="start"===e?"Start":"End";t.attr(`marker-${e}`,`url(${a}#${i}_${n}-${s}${o})`)},"addEdgeMarker"),Vt={},Gt={},Jt=E(async(t,e)=>{const r=B(),a=M(r),i=t.insert("g").attr("class","edgeLabel"),n=i.insert("g").attr("class","label"),s="markdown"===e.labelType,o=await P(t,e.label,{style:e.labelStyle,useHtmlLabels:a,addSvgBackground:s,isNode:!1,markdown:s,width:s?void 0:Number.POSITIVE_INFINITY},r);n.node().appendChild(o);let l,c=o.getBBox(),d=c;if(a){const t=o.children[0],e=D(o);c=t.getBoundingClientRect(),d=c,e.attr("width",c.width),e.attr("height",c.height)}else{const t=D(o).select("text").node();t&&"function"==typeof t.getBBox&&(d=t.getBBox())}if(n.attr("transform",Y(d,a)),Vt[e.id]=i,e.width=c.width,e.height=c.height,e.startLabelLeft){const r=t.insert("g").attr("class","edgeTerminals"),i=r.insert("g").attr("class","inner"),n=await Ut(i,e.startLabelLeft,e.labelStyle);l=n;let s=n.getBBox();if(a){const t=n.children[0],e=D(n);s=t.getBoundingClientRect(),e.attr("width",s.width),e.attr("height",s.height)}i.attr("transform",Y(s,a)),Gt[e.id]||(Gt[e.id]={}),Gt[e.id].startLeft=r,Qt(l,e.startLabelLeft)}if(e.startLabelRight){const r=t.insert("g").attr("class","edgeTerminals"),i=r.insert("g").attr("class","inner"),n=await Ut(i,e.startLabelRight,e.labelStyle);l=n;let s=n.getBBox();if(a){const t=n.children[0],e=D(n);s=t.getBoundingClientRect(),e.attr("width",s.width),e.attr("height",s.height)}i.attr("transform",Y(s,a)),Gt[e.id]||(Gt[e.id]={}),Gt[e.id].startRight=r,Qt(l,e.startLabelRight)}if(e.endLabelLeft){const r=t.insert("g").attr("class","edgeTerminals"),i=r.insert("g").attr("class","inner"),n=await Ut(r,e.endLabelLeft,e.labelStyle);l=n;let s=n.getBBox();if(a){const t=n.children[0],e=D(n);s=t.getBoundingClientRect(),e.attr("width",s.width),e.attr("height",s.height)}i.attr("transform",Y(s,a)),Gt[e.id]||(Gt[e.id]={}),Gt[e.id].endLeft=r,Qt(l,e.endLabelLeft)}if(e.endLabelRight){const r=t.insert("g").attr("class","edgeTerminals"),i=r.insert("g").attr("class","inner"),n=await Ut(r,e.endLabelRight,e.labelStyle);l=n;let s=n.getBBox();if(a){const t=n.children[0],e=D(n);s=t.getBoundingClientRect(),e.attr("width",s.width),e.attr("height",s.height)}i.attr("transform",Y(s,a)),Gt[e.id]||(Gt[e.id]={}),Gt[e.id].endRight=r,Qt(l,e.endLabelRight)}return o},"insertEdgeLabel");function Qt(t,e){M(B())&&t&&(t.style.width=9*e.length+"px",t.style.height="12px")}E(Qt,"setTerminalWidth");var te=E((t,e)=>{I.debug("Moving label abc88 ",t.id,t.label,Vt[t.id],e);let r=e.updatedPath?e.updatedPath:e.originalPath;const a=B(),{subGraphTitleTotalMargin:i}=j(a);if(t.label){const a=Vt[t.id];let n=t.x,s=t.y;if(r){const a=F.calcLabelPosition(r);I.debug("Moving label "+t.label+" from (",n,",",s,") to (",a.x,",",a.y,") abc88"),e.updatedPath&&(n=a.x,s=a.y)}a.attr("transform",`translate(${n}, ${s+i/2})`)}if(t.startLabelLeft){const e=Gt[t.id].startLeft;let a=t.x,i=t.y;if(r){const e=F.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_left",r);a=e.x,i=e.y}e.attr("transform",`translate(${a}, ${i})`)}if(t.startLabelRight){const e=Gt[t.id].startRight;let a=t.x,i=t.y;if(r){const e=F.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_right",r);a=e.x,i=e.y}e.attr("transform",`translate(${a}, ${i})`)}if(t.endLabelLeft){const e=Gt[t.id].endLeft;let a=t.x,i=t.y;if(r){const e=F.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_left",r);a=e.x,i=e.y}e.attr("transform",`translate(${a}, ${i})`)}if(t.endLabelRight){const e=Gt[t.id].endRight;let a=t.x,i=t.y;if(r){const e=F.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_right",r);a=e.x,i=e.y}e.attr("transform",`translate(${a}, ${i})`)}},"positionEdgeLabel"),ee=E((t,e)=>{const r=t.x,a=t.y,i=Math.abs(e.x-r),n=Math.abs(e.y-a),s=t.width/2,o=t.height/2;return i>=s||n>=o},"outsideNode"),re=E((t,e,r)=>{I.debug(`intersection calc abc89:\n outsidePoint: ${JSON.stringify(e)}\n insidePoint : ${JSON.stringify(r)}\n node : x:${t.x} y:${t.y} w:${t.width} h:${t.height}`);const a=t.x,i=t.y,n=Math.abs(a-r.x),s=t.width/2;let o=r.x<e.x?s-n:s+n;const l=t.height/2,c=Math.abs(e.y-r.y),d=Math.abs(e.x-r.x);if(Math.abs(i-e.y)*s>Math.abs(a-e.x)*l){let t=r.y<e.y?e.y-l-i:i-l-e.y;o=d*t/c;const a={x:r.x<e.x?r.x+o:r.x-d+o,y:r.y<e.y?r.y+c-t:r.y-c+t};return 0===o&&(a.x=e.x,a.y=e.y),0===d&&(a.x=e.x),0===c&&(a.y=e.y),I.debug(`abc89 topp/bott calc, Q ${c}, q ${t}, R ${d}, r ${o}`,a),a}{o=r.x<e.x?e.x-s-a:a-s-e.x;let t=c*o/d,i=r.x<e.x?r.x+d-o:r.x-d+o,n=r.y<e.y?r.y+t:r.y-t;return I.debug(`sides calc abc89, Q ${c}, q ${t}, R ${d}, r ${o}`,{_x:i,_y:n}),0===o&&(i=e.x,n=e.y),0===d&&(i=e.x),0===c&&(n=e.y),{x:i,y:n}}},"intersection"),ae=E((t,e)=>{I.debug("abc88 cutPathAtIntersect",t,e);let r=[],a=t[0],i=!1;return t.forEach(t=>{if(ee(e,t)||i)a=t,i||r.push(t);else{const n=re(e,a,t);let s=!1;r.forEach(t=>{s=s||t.x===n.x&&t.y===n.y}),r.some(t=>t.x===n.x&&t.y===n.y)||r.push(n),i=!0}}),r},"cutPathAtIntersect"),ie=E(function(t,e,r,a,i,n,s){let o=r.points;I.debug("abc88 InsertEdge: edge=",r,"e=",e);let l=!1;const c=n.node(e.v);var d=n.node(e.w);(null==d?void 0:d.intersect)&&(null==c?void 0:c.intersect)&&(o=o.slice(1,r.points.length-1),o.unshift(c.intersect(o[0])),o.push(d.intersect(o[o.length-1]))),r.toCluster&&(I.debug("to cluster abc88",a[r.toCluster]),o=ae(r.points,a[r.toCluster].node),l=!0),r.fromCluster&&(I.debug("from cluster abc88",a[r.fromCluster]),o=ae(o.reverse(),a[r.fromCluster].node).reverse(),l=!0);const h=o.filter(t=>!Number.isNaN(t.y));let g=z;!r.curve||"graph"!==i&&"flowchart"!==i||(g=r.curve);const{x:u,y:y}=O(r),p=R().x(u).y(y).curve(g);let x;switch(r.thickness){case"normal":x="edge-thickness-normal";break;case"thick":case"invisible":x="edge-thickness-thick";break;default:x=""}switch(r.pattern){case"solid":x+=" edge-pattern-solid";break;case"dotted":x+=" edge-pattern-dotted";break;case"dashed":x+=" edge-pattern-dashed"}const b=t.append("path").attr("d",p(h)).attr("id",r.id).attr("class"," "+x+(r.classes?" "+r.classes:"")).attr("style",r.style);let f="";(B().flowchart.arrowMarkerAbsolute||B().state.arrowMarkerAbsolute)&&(f=A(!0)),Kt(b,r,f,s,i);let m={};return l&&(m.updatedPath=o),m.originalPath=r.points,m},"insertEdge"),ne=E(t=>{const e=new Set;for(const r of t)switch(r){case"x":e.add("right"),e.add("left");break;case"y":e.add("up"),e.add("down");break;default:e.add(r)}return e},"expandAndDeduplicateDirections"),se=E((t,e,r,a)=>{const i=ne(t),n=e.height+2*r.padding,s=n/2,o=a??e.width+2*s+r.padding,l=r.padding/2;return i.has("right")&&i.has("left")&&i.has("up")&&i.has("down")?[{x:0,y:0},{x:s,y:0},{x:o/2,y:2*l},{x:o-s,y:0},{x:o,y:0},{x:o,y:-n/3},{x:o+2*l,y:-n/2},{x:o,y:-2*n/3},{x:o,y:-n},{x:o-s,y:-n},{x:o/2,y:-n-2*l},{x:s,y:-n},{x:0,y:-n},{x:0,y:-2*n/3},{x:-2*l,y:-n/2},{x:0,y:-n/3}]:i.has("right")&&i.has("left")&&i.has("up")?[{x:s,y:0},{x:o-s,y:0},{x:o,y:-n/2},{x:o-s,y:-n},{x:s,y:-n},{x:0,y:-n/2}]:i.has("right")&&i.has("left")&&i.has("down")?[{x:0,y:0},{x:s,y:-n},{x:o-s,y:-n},{x:o,y:0}]:i.has("right")&&i.has("up")&&i.has("down")?[{x:0,y:0},{x:o,y:-s},{x:o,y:-n+s},{x:0,y:-n}]:i.has("left")&&i.has("up")&&i.has("down")?[{x:o,y:0},{x:0,y:-s},{x:0,y:-n+s},{x:o,y:-n}]:i.has("right")&&i.has("left")?[{x:s,y:0},{x:s,y:-l},{x:o-s,y:-l},{x:o-s,y:0},{x:o,y:-n/2},{x:o-s,y:-n},{x:o-s,y:-n+l},{x:s,y:-n+l},{x:s,y:-n},{x:0,y:-n/2}]:i.has("up")&&i.has("down")?[{x:o/2,y:0},{x:0,y:-l},{x:s,y:-l},{x:s,y:-n+l},{x:0,y:-n+l},{x:o/2,y:-n},{x:o,y:-n+l},{x:o-s,y:-n+l},{x:o-s,y:-l},{x:o,y:-l}]:i.has("right")&&i.has("up")?[{x:0,y:0},{x:o,y:-s},{x:0,y:-n}]:i.has("right")&&i.has("down")?[{x:0,y:0},{x:o,y:0},{x:0,y:-n}]:i.has("left")&&i.has("up")?[{x:o,y:0},{x:0,y:-s},{x:o,y:-n}]:i.has("left")&&i.has("down")?[{x:o,y:0},{x:0,y:0},{x:o,y:-n}]:i.has("right")?[{x:s,y:-l},{x:s,y:-l},{x:o-s,y:-l},{x:o-s,y:0},{x:o,y:-n/2},{x:o-s,y:-n},{x:o-s,y:-n+l},{x:s,y:-n+l},{x:s,y:-n+l}]:i.has("left")?[{x:s,y:0},{x:s,y:-l},{x:o-s,y:-l},{x:o-s,y:-n+l},{x:s,y:-n+l},{x:s,y:-n},{x:0,y:-n/2}]:i.has("up")?[{x:s,y:-l},{x:s,y:-n+l},{x:0,y:-n+l},{x:o/2,y:-n},{x:o,y:-n+l},{x:o-s,y:-n+l},{x:o-s,y:-l}]:i.has("down")?[{x:o/2,y:0},{x:0,y:-l},{x:s,y:-l},{x:s,y:-n+l},{x:o-s,y:-n+l},{x:o-s,y:-l},{x:o,y:-l}]:[{x:0,y:0}]},"getArrowPoints");function oe(t,e){return t.intersect(e)}E(oe,"intersectNode");var le=oe;function ce(t,e,r,a){var i=t.x,n=t.y,s=i-a.x,o=n-a.y,l=Math.sqrt(e*e*o*o+r*r*s*s),c=Math.abs(e*r*s/l);a.x<i&&(c=-c);var d=Math.abs(e*r*o/l);return a.y<n&&(d=-d),{x:i+c,y:n+d}}E(ce,"intersectEllipse");var de=ce;function he(t,e,r){return de(t,e,e,r)}E(he,"intersectCircle");var ge=he;function ue(t,e,r,a){var i,n,s,o,l,c,d,h,g,u,y,p,x;if(i=e.y-t.y,s=t.x-e.x,l=e.x*t.y-t.x*e.y,g=i*r.x+s*r.y+l,u=i*a.x+s*a.y+l,!(0!==g&&0!==u&&ye(g,u)||(n=a.y-r.y,o=r.x-a.x,c=a.x*r.y-r.x*a.y,d=n*t.x+o*t.y+c,h=n*e.x+o*e.y+c,0!==d&&0!==h&&ye(d,h)||0===(y=i*o-n*s))))return p=Math.abs(y/2),{x:(x=s*c-o*l)<0?(x-p)/y:(x+p)/y,y:(x=n*l-i*c)<0?(x-p)/y:(x+p)/y}}function ye(t,e){return t*e>0}E(ue,"intersectLine"),E(ye,"sameSign");var pe=ue,xe=be;function be(t,e,r){var a=t.x,i=t.y,n=[],s=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY;"function"==typeof e.forEach?e.forEach(function(t){s=Math.min(s,t.x),o=Math.min(o,t.y)}):(s=Math.min(s,e.x),o=Math.min(o,e.y));for(var l=a-t.width/2-s,c=i-t.height/2-o,d=0;d<e.length;d++){var h=e[d],g=e[d<e.length-1?d+1:0],u=pe(t,r,{x:l+h.x,y:c+h.y},{x:l+g.x,y:c+g.y});u&&n.push(u)}return n.length?(n.length>1&&n.sort(function(t,e){var a=t.x-r.x,i=t.y-r.y,n=Math.sqrt(a*a+i*i),s=e.x-r.x,o=e.y-r.y,l=Math.sqrt(s*s+o*o);return n<l?-1:n===l?0:1}),n[0]):t}E(be,"intersectPolygon");var fe={node:le,circle:ge,ellipse:de,polygon:xe,rect:E((t,e)=>{var r,a,i=t.x,n=t.y,s=e.x-i,o=e.y-n,l=t.width/2,c=t.height/2;return Math.abs(o)*l>Math.abs(s)*c?(o<0&&(c=-c),r=0===o?0:c*s/o,a=c):(s<0&&(l=-l),r=l,a=0===s?0:l*o/s),{x:i+r,y:n+a}},"intersectRect")},me=E(async(t,e,r,a)=>{const i=B();let n;const s=e.useHtmlLabels||M(i);n=r||"node default";const o=t.insert("g").attr("class",n).attr("id",e.domId||e.id),l=o.insert("g").attr("class","label").attr("style",e.labelStyle);let c,d;c=void 0===e.labelText?"":"string"==typeof e.labelText?e.labelText:e.labelText[0],d="markdown"===e.labelType?P(l,H(U(c),i),{useHtmlLabels:s,width:e.width||i.flowchart.wrappingWidth,classes:"markdown-node-label"},i):await Ut(l,H(U(c),i),e.labelStyle,!1,a);let h=d.getBBox();const g=e.padding/2;if(M(i)){const t=d.children[0],e=D(d);await K(t,c),h=t.getBoundingClientRect(),e.attr("width",h.width),e.attr("height",h.height)}return s?l.attr("transform","translate("+-h.width/2+", "+-h.height/2+")"):l.attr("transform","translate(0, "+-h.height/2+")"),e.centerLabel&&l.attr("transform","translate("+-h.width/2+", "+-h.height/2+")"),l.insert("rect",":first-child"),{shapeSvg:o,bbox:h,halfPadding:g,label:l}},"labelHelper"),we=E((t,e)=>{const r=e.node().getBBox();t.width=r.width,t.height=r.height},"updateNodeBounds");function ke(t,e,r,a){return t.insert("polygon",":first-child").attr("points",a.map(function(t){return t.x+","+t.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-e/2+","+r/2+")")}E(ke,"insertPolygonShape");var Se=E(async(t,e)=>{e.useHtmlLabels||M(B())||(e.centerLabel=!0);const{shapeSvg:r,bbox:a,halfPadding:i}=await me(t,e,"node "+e.classes,!0);I.info("Classes = ",e.classes);const n=r.insert("rect",":first-child");return n.attr("rx",e.rx).attr("ry",e.ry).attr("x",-a.width/2-i).attr("y",-a.height/2-i).attr("width",a.width+e.padding).attr("height",a.height+e.padding),we(e,n),e.intersect=function(t){return fe.rect(e,t)},r},"note"),Le=E(t=>t?" "+t:"","formatClass"),_e=E((t,e)=>`${e||"node default"}${Le(t.classes)} ${Le(t.class)}`,"getClassesFromNode"),ve=E(async(t,e)=>{const{shapeSvg:r,bbox:a}=await me(t,e,_e(e,void 0),!0),i=a.width+e.padding+(a.height+e.padding),n=[{x:i/2,y:0},{x:i,y:-i/2},{x:i/2,y:-i},{x:0,y:-i/2}];I.info("Question main (Circle)");const s=ke(r,i,i,n);return s.attr("style",e.style),we(e,s),e.intersect=function(t){return I.warn("Intersect called"),fe.polygon(e,n,t)},r},"question"),Ee=E((t,e)=>{const r=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),a=[{x:0,y:14},{x:14,y:0},{x:0,y:-14},{x:-14,y:0}];return r.insert("polygon",":first-child").attr("points",a.map(function(t){return t.x+","+t.y}).join(" ")).attr("class","state-start").attr("r",7).attr("width",28).attr("height",28),e.width=28,e.height=28,e.intersect=function(t){return fe.circle(e,14,t)},r},"choice"),Te=E(async(t,e)=>{const{shapeSvg:r,bbox:a}=await me(t,e,_e(e,void 0),!0),i=e.positioned?e.height:a.height+e.padding,n=i/4,s=e.positioned?e.width:a.width+2*n+e.padding,o=[{x:n,y:0},{x:s-n,y:0},{x:s,y:-i/2},{x:s-n,y:-i},{x:n,y:-i},{x:0,y:-i/2}],l=ke(r,s,i,o);return l.attr("style",e.style),we(e,l),e.intersect=function(t){return fe.polygon(e,o,t)},r},"hexagon"),De=E(async(t,e)=>{const{shapeSvg:r,bbox:a}=await me(t,e,void 0,!0),i=a.height+2*e.padding,n=i/2,s=a.width+2*n+e.padding,o=e.positioned&&(e.widthInColumns??1)>1&&e.width>s?e.width:s,l=se(e.directions,a,e,o),c=ke(r,o,i,l);return c.attr("style",e.style),we(e,c),e.intersect=function(t){return fe.polygon(e,l,t)},r},"block_arrow"),$e=E(async(t,e)=>{const{shapeSvg:r,bbox:a}=await me(t,e,_e(e,void 0),!0),i=a.width+e.padding,n=a.height+e.padding,s=[{x:-n/2,y:0},{x:i,y:0},{x:i,y:-n},{x:-n/2,y:-n},{x:0,y:-n/2}];return ke(r,i,n,s).attr("style",e.style),e.width=i+n,e.height=n,e.intersect=function(t){return fe.polygon(e,s,t)},r},"rect_left_inv_arrow"),Ie=E(async(t,e)=>{const{shapeSvg:r,bbox:a}=await me(t,e,_e(e),!0),i=a.width+e.padding,n=a.height+e.padding,s=[{x:-2*n/6,y:0},{x:i-n/6,y:0},{x:i+2*n/6,y:-n},{x:n/6,y:-n}],o=ke(r,i,n,s);return o.attr("style",e.style),we(e,o),e.intersect=function(t){return fe.polygon(e,s,t)},r},"lean_right"),Ne=E(async(t,e)=>{const{shapeSvg:r,bbox:a}=await me(t,e,_e(e,void 0),!0),i=a.width+e.padding,n=a.height+e.padding,s=[{x:2*n/6,y:0},{x:i+n/6,y:0},{x:i-2*n/6,y:-n},{x:-n/6,y:-n}],o=ke(r,i,n,s);return o.attr("style",e.style),we(e,o),e.intersect=function(t){return fe.polygon(e,s,t)},r},"lean_left"),Ce=E(async(t,e)=>{const{shapeSvg:r,bbox:a}=await me(t,e,_e(e,void 0),!0),i=a.width+e.padding,n=a.height+e.padding,s=[{x:-2*n/6,y:0},{x:i+2*n/6,y:0},{x:i-n/6,y:-n},{x:n/6,y:-n}],o=ke(r,i,n,s);return o.attr("style",e.style),we(e,o),e.intersect=function(t){return fe.polygon(e,s,t)},r},"trapezoid"),Be=E(async(t,e)=>{const{shapeSvg:r,bbox:a}=await me(t,e,_e(e,void 0),!0),i=a.width+e.padding,n=a.height+e.padding,s=[{x:n/6,y:0},{x:i-n/6,y:0},{x:i+2*n/6,y:-n},{x:-2*n/6,y:-n}],o=ke(r,i,n,s);return o.attr("style",e.style),we(e,o),e.intersect=function(t){return fe.polygon(e,s,t)},r},"inv_trapezoid"),Oe=E(async(t,e)=>{const{shapeSvg:r,bbox:a}=await me(t,e,_e(e,void 0),!0),i=a.width+e.padding,n=a.height+e.padding,s=[{x:0,y:0},{x:i+n/2,y:0},{x:i,y:-n/2},{x:i+n/2,y:-n},{x:0,y:-n}],o=ke(r,i,n,s);return o.attr("style",e.style),we(e,o),e.intersect=function(t){return fe.polygon(e,s,t)},r},"rect_right_inv_arrow"),Re=E(async(t,e)=>{const{shapeSvg:r,bbox:a}=await me(t,e,_e(e,void 0),!0),i=a.width+e.padding,n=i/2,s=n/(2.5+i/50),o=a.height+s+e.padding,l="M 0,"+s+" a "+n+","+s+" 0,0,0 "+i+" 0 a "+n+","+s+" 0,0,0 "+-i+" 0 l 0,"+o+" a "+n+","+s+" 0,0,0 "+i+" 0 l 0,"+-o,c=r.attr("label-offset-y",s).insert("path",":first-child").attr("style",e.style).attr("d",l).attr("transform","translate("+-i/2+","+-(o/2+s)+")");return we(e,c),e.intersect=function(t){const r=fe.rect(e,t),a=r.x-e.x;if(0!=n&&(Math.abs(a)<e.width/2||Math.abs(a)==e.width/2&&Math.abs(r.y-e.y)>e.height/2-s)){let i=s*s*(1-a*a/(n*n));0!=i&&(i=Math.sqrt(i)),i=s-i,t.y-e.y>0&&(i=-i),r.y+=i}return r},r},"cylinder"),ze=E(async(t,e)=>{const{shapeSvg:r,bbox:a,halfPadding:i}=await me(t,e,"node "+e.classes+" "+e.class,!0),n=r.insert("rect",":first-child"),s=e.positioned?e.width:a.width+e.padding,o=e.positioned?e.height:a.height+e.padding,l=e.positioned?-s/2:-a.width/2-i,c=e.positioned?-o/2:-a.height/2-i;if(n.attr("class","basic label-container").attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("x",l).attr("y",c).attr("width",s).attr("height",o),e.props){const t=new Set(Object.keys(e.props));e.props.borders&&(Pe(n,e.props.borders,s,o),t.delete("borders")),t.forEach(t=>{I.warn(`Unknown node property ${t}`)})}return we(e,n),e.intersect=function(t){return fe.rect(e,t)},r},"rect"),Ae=E(async(t,e)=>{const{shapeSvg:r,bbox:a,halfPadding:i}=await me(t,e,"node "+e.classes,!0),n=r.insert("rect",":first-child"),s=e.positioned?e.width:a.width+e.padding,o=e.positioned?e.height:a.height+e.padding,l=e.positioned?-s/2:-a.width/2-i,c=e.positioned?-o/2:-a.height/2-i;if(n.attr("class","basic cluster composite label-container").attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("x",l).attr("y",c).attr("width",s).attr("height",o),e.props){const t=new Set(Object.keys(e.props));e.props.borders&&(Pe(n,e.props.borders,s,o),t.delete("borders")),t.forEach(t=>{I.warn(`Unknown node property ${t}`)})}return we(e,n),e.intersect=function(t){return fe.rect(e,t)},r},"composite"),Me=E(async(t,e)=>{const{shapeSvg:r}=await me(t,e,"label",!0);I.trace("Classes = ",e.class);const a=r.insert("rect",":first-child");if(a.attr("width",0).attr("height",0),r.attr("class","label edgeLabel"),e.props){const t=new Set(Object.keys(e.props));e.props.borders&&(Pe(a,e.props.borders,0,0),t.delete("borders")),t.forEach(t=>{I.warn(`Unknown node property ${t}`)})}return we(e,a),e.intersect=function(t){return fe.rect(e,t)},r},"labelRect");function Pe(t,e,r,a){const i=[],n=E(t=>{i.push(t,0)},"addBorder"),s=E(t=>{i.push(0,t)},"skipBorder");e.includes("t")?(I.debug("add top border"),n(r)):s(r),e.includes("r")?(I.debug("add right border"),n(a)):s(a),e.includes("b")?(I.debug("add bottom border"),n(r)):s(r),e.includes("l")?(I.debug("add left border"),n(a)):s(a),t.attr("stroke-dasharray",i.join(" "))}E(Pe,"applyNodePropertyBorders");var Ye=E(async(t,e)=>{let r;r=e.classes?"node "+e.classes:"node default";const a=t.insert("g").attr("class",r).attr("id",e.domId||e.id),i=a.insert("rect",":first-child"),n=a.insert("line"),s=a.insert("g").attr("class","label"),o=e.labelText.flat?e.labelText.flat():e.labelText;let l="";l="object"==typeof o?o[0]:o,I.info("Label text abc79",l,o,"object"==typeof o);const c=await Ut(s,l,e.labelStyle,!0,!0);let d={width:0,height:0};if(M(B())){const t=c.children[0],e=D(c);d=t.getBoundingClientRect(),e.attr("width",d.width),e.attr("height",d.height)}I.info("Text 2",o);const h=o.slice(1,o.length);let g=c.getBBox();const u=await Ut(s,h.join?h.join("<br/>"):h,e.labelStyle,!0,!0);if(M(B())){const t=u.children[0],e=D(u);d=t.getBoundingClientRect(),e.attr("width",d.width),e.attr("height",d.height)}const y=e.padding/2;return D(u).attr("transform","translate( "+(d.width>g.width?0:(g.width-d.width)/2)+", "+(g.height+y+5)+")"),D(c).attr("transform","translate( "+(d.width<g.width?0:-(g.width-d.width)/2)+", 0)"),d=s.node().getBBox(),s.attr("transform","translate("+-d.width/2+", "+(-d.height/2-y+3)+")"),i.attr("class","outer title-state").attr("x",-d.width/2-y).attr("y",-d.height/2-y).attr("width",d.width+e.padding).attr("height",d.height+e.padding),n.attr("class","divider").attr("x1",-d.width/2-y).attr("x2",d.width/2+y).attr("y1",-d.height/2-y+g.height+y).attr("y2",-d.height/2-y+g.height+y),we(e,i),e.intersect=function(t){return fe.rect(e,t)},a},"rectWithTitle"),je=E(async(t,e)=>{const{shapeSvg:r,bbox:a}=await me(t,e,_e(e,void 0),!0),i=a.height+e.padding,n=a.width+i/4+e.padding,s=r.insert("rect",":first-child").attr("style",e.style).attr("rx",i/2).attr("ry",i/2).attr("x",-n/2).attr("y",-i/2).attr("width",n).attr("height",i);return we(e,s),e.intersect=function(t){return fe.rect(e,t)},r},"stadium"),Fe=E(async(t,e)=>{const{shapeSvg:r,bbox:a,halfPadding:i}=await me(t,e,_e(e,void 0),!0),n=r.insert("circle",":first-child");return n.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",a.width/2+i).attr("width",a.width+e.padding).attr("height",a.height+e.padding),I.info("Circle main"),we(e,n),e.intersect=function(t){return I.info("Circle intersect",e,a.width/2+i,t),fe.circle(e,a.width/2+i,t)},r},"circle"),We=E(async(t,e)=>{const{shapeSvg:r,bbox:a,halfPadding:i}=await me(t,e,_e(e,void 0),!0),n=r.insert("g",":first-child"),s=n.insert("circle"),o=n.insert("circle");return n.attr("class",e.class),s.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",a.width/2+i+5).attr("width",a.width+e.padding+10).attr("height",a.height+e.padding+10),o.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",a.width/2+i).attr("width",a.width+e.padding).attr("height",a.height+e.padding),I.info("DoubleCircle main"),we(e,s),e.intersect=function(t){return I.info("DoubleCircle intersect",e,a.width/2+i+5,t),fe.circle(e,a.width/2+i+5,t)},r},"doublecircle"),Xe=E(async(t,e)=>{const{shapeSvg:r,bbox:a}=await me(t,e,_e(e,void 0),!0),i=a.width+e.padding,n=a.height+e.padding,s=[{x:0,y:0},{x:i,y:0},{x:i,y:-n},{x:0,y:-n},{x:0,y:0},{x:-8,y:0},{x:i+8,y:0},{x:i+8,y:-n},{x:-8,y:-n},{x:-8,y:0}],o=ke(r,i,n,s);return o.attr("style",e.style),we(e,o),e.intersect=function(t){return fe.polygon(e,s,t)},r},"subroutine"),He=E((t,e)=>{const r=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),a=r.insert("circle",":first-child");return a.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),we(e,a),e.intersect=function(t){return fe.circle(e,7,t)},r},"start"),Ue=E((t,e,r)=>{const a=t.insert("g").attr("class","node default").attr("id",e.domId||e.id);let i=70,n=10;"LR"===r&&(i=10,n=70);const s=a.append("rect").attr("x",-1*i/2).attr("y",-1*n/2).attr("width",i).attr("height",n).attr("class","fork-join");return we(e,s),e.height=e.height+e.padding/2,e.width=e.width+e.padding/2,e.intersect=function(t){return fe.rect(e,t)},a},"forkJoin"),Ke={rhombus:ve,composite:Ae,question:ve,rect:ze,labelRect:Me,rectWithTitle:Ye,choice:Ee,circle:Fe,doublecircle:We,stadium:je,hexagon:Te,block_arrow:De,rect_left_inv_arrow:$e,lean_right:Ie,lean_left:Ne,trapezoid:Ce,inv_trapezoid:Be,rect_right_inv_arrow:Oe,cylinder:Re,start:He,end:E((t,e)=>{const r=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),a=r.insert("circle",":first-child"),i=r.insert("circle",":first-child");return i.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),a.attr("class","state-end").attr("r",5).attr("width",10).attr("height",10),we(e,i),e.intersect=function(t){return fe.circle(e,7,t)},r},"end"),note:Se,subroutine:Xe,fork:Ue,join:Ue,class_box:E(async(t,e)=>{var r;const a=e.padding/2;let i;i=e.classes?"node "+e.classes:"node default";const n=t.insert("g").attr("class",i).attr("id",e.domId||e.id),s=n.insert("rect",":first-child"),o=n.insert("line"),l=n.insert("line");let c=0,d=4;const h=n.insert("g").attr("class","label");let g=0;const u=null==(r=e.classData.annotations)?void 0:r[0],y=e.classData.annotations[0]?"«"+e.classData.annotations[0]+"»":"",p=await Ut(h,y,e.labelStyle,!0,!0);let x=p.getBBox();if(M(B())){const t=p.children[0],e=D(p);x=t.getBoundingClientRect(),e.attr("width",x.width),e.attr("height",x.height)}e.classData.annotations[0]&&(d+=x.height+4,c+=x.width);let b=e.classData.label;void 0!==e.classData.type&&""!==e.classData.type&&(M(B())?b+="<"+e.classData.type+">":b+="<"+e.classData.type+">");const f=await Ut(h,b,e.labelStyle,!0,!0);D(f).attr("class","classTitle");let m=f.getBBox();if(M(B())){const t=f.children[0],e=D(f);m=t.getBoundingClientRect(),e.attr("width",m.width),e.attr("height",m.height)}d+=m.height+4,m.width>c&&(c=m.width);const w=[];e.classData.members.forEach(async t=>{const r=t.getDisplayDetails();let a=r.displayText;M(B())&&(a=a.replace(/</g,"<").replace(/>/g,">"));const i=await Ut(h,a,r.cssStyle?r.cssStyle:e.labelStyle,!0,!0);let n=i.getBBox();if(M(B())){const t=i.children[0],e=D(i);n=t.getBoundingClientRect(),e.attr("width",n.width),e.attr("height",n.height)}n.width>c&&(c=n.width),d+=n.height+4,w.push(i)}),d+=8;const k=[];if(e.classData.methods.forEach(async t=>{const r=t.getDisplayDetails();let a=r.displayText;M(B())&&(a=a.replace(/</g,"<").replace(/>/g,">"));const i=await Ut(h,a,r.cssStyle?r.cssStyle:e.labelStyle,!0,!0);let n=i.getBBox();if(M(B())){const t=i.children[0],e=D(i);n=t.getBoundingClientRect(),e.attr("width",n.width),e.attr("height",n.height)}n.width>c&&(c=n.width),d+=n.height+4,k.push(i)}),d+=8,u){let t=(c-x.width)/2;D(p).attr("transform","translate( "+(-1*c/2+t)+", "+-1*d/2+")"),g=x.height+4}let S=(c-m.width)/2;return D(f).attr("transform","translate( "+(-1*c/2+S)+", "+(-1*d/2+g)+")"),g+=m.height+4,o.attr("class","divider").attr("x1",-c/2-a).attr("x2",c/2+a).attr("y1",-d/2-a+8+g).attr("y2",-d/2-a+8+g),g+=8,w.forEach(t=>{D(t).attr("transform","translate( "+-c/2+", "+(-1*d/2+g+4)+")");const e=null==t?void 0:t.getBBox();g+=((null==e?void 0:e.height)??0)+4}),g+=8,l.attr("class","divider").attr("x1",-c/2-a).attr("x2",c/2+a).attr("y1",-d/2-a+8+g).attr("y2",-d/2-a+8+g),g+=8,k.forEach(t=>{D(t).attr("transform","translate( "+-c/2+", "+(-1*d/2+g)+")");const e=null==t?void 0:t.getBBox();g+=((null==e?void 0:e.height)??0)+4}),s.attr("style",e.style).attr("class","outer title-state").attr("x",-c/2-a).attr("y",-d/2-a).attr("width",c+e.padding).attr("height",d+e.padding),we(e,s),e.intersect=function(t){return fe.rect(e,t)},n},"class_box")},qe={},Ze=E(async(t,e,r)=>{let a,i;if(e.link){let n;"sandbox"===B().securityLevel?n="_top":e.linkTarget&&(n=e.linkTarget||"_blank"),a=t.insert("svg:a").attr("xlink:href",e.link).attr("target",n),i=await Ke[e.shape](a,e,r)}else i=await Ke[e.shape](t,e,r),a=i;return e.tooltip&&i.attr("title",e.tooltip),e.class&&i.attr("class","node default "+e.class),qe[e.id]=a,e.haveCallback&&qe[e.id].attr("class",qe[e.id].attr("class")+" clickable"),a},"insertNode"),Ve=E(t=>{const e=qe[t.id];I.trace("Transforming node",t.diff,t,"translate("+(t.x-t.width/2-5)+", "+t.width/2+")");const r=t.diff||0;return t.clusterNode?e.attr("transform","translate("+(t.x+r-t.width/2)+", "+(t.y-t.height/2-8)+")"):e.attr("transform","translate("+t.x+", "+t.y+")"),r},"positionNode");function Ge(t,e,r=!1){var a,i,n;const s=t;let o="default";((null==(a=null==s?void 0:s.classes)?void 0:a.length)||0)>0&&(o=((null==s?void 0:s.classes)??[]).join(" ")),o+=" flowchart-label";let l,c=0,d="";switch(s.type){case"round":c=5,d="rect";break;case"composite":c=0,d="composite",l=0;break;case"square":case"group":default:d="rect";break;case"diamond":d="question";break;case"hexagon":d="hexagon";break;case"block_arrow":d="block_arrow";break;case"odd":case"rect_left_inv_arrow":d="rect_left_inv_arrow";break;case"lean_right":d="lean_right";break;case"lean_left":d="lean_left";break;case"trapezoid":d="trapezoid";break;case"inv_trapezoid":d="inv_trapezoid";break;case"circle":d="circle";break;case"ellipse":d="ellipse";break;case"stadium":d="stadium";break;case"subroutine":d="subroutine";break;case"cylinder":d="cylinder";break;case"doublecircle":d="doublecircle"}const h=X((null==s?void 0:s.styles)??[]),g=s.label,u=s.size??{width:0,height:0,x:0,y:0},y=e.getDiagramId();return{labelStyle:h.labelStyle,shape:d,labelText:g,rx:c,ry:c,class:o,style:h.style,id:s.id,domId:y?`${y}-${s.id}`:s.id,directions:s.directions,width:u.width,height:u.height,x:u.x,y:u.y,positioned:r,intersect:void 0,type:s.type,padding:l??(null==(n=null==(i=T())?void 0:i.block)?void 0:n.padding)??0,widthInColumns:s.widthInColumns??1}}async function Je(t,e,r){const a=Ge(e,r,!1);if("group"===a.type)return;const i=T(),n=await Ze(t,a,{config:i}),s=n.node().getBBox(),o=r.getBlock(a.id);o.size={width:s.width,height:s.height,x:0,y:0,node:n},r.setBlock(o),n.remove()}async function Qe(t,e,r){const a=Ge(e,r,!0);if("space"!==r.getBlock(a.id).type){const r=T();await Ze(t,a,{config:r}),e.intersect=null==a?void 0:a.intersect,Ve(a)}}async function tr(t,e,r,a){for(const i of e)await a(t,i,r),i.children&&await tr(t,i.children,r,a)}async function er(t,e,r){await tr(t,e,r,Je)}async function rr(t,e,r){await tr(t,e,r,Qe)}async function ar(t,e,r,a,i){const n=new q({multigraph:!0,compound:!0});n.setGraph({rankdir:"TB",nodesep:10,ranksep:10,marginx:8,marginy:8});for(const s of r)s.size&&n.setNode(s.id,{width:s.size.width,height:s.size.height,intersect:s.intersect});for(const s of e)if(s.start&&s.end){const e=a.getBlock(s.start),r=a.getBlock(s.end);if((null==e?void 0:e.size)&&(null==r?void 0:r.size)){const a=e.size,o=r.size,l=[{x:a.x,y:a.y},{x:a.x+(o.x-a.x)/2,y:a.y+(o.y-a.y)/2},{x:o.x,y:o.y}],c=i?`${i}-${s.id}`:s.id,d=`${"thick"===s.thickness?"edge-thickness-thick":"edge-thickness-normal"} ${"dotted"===s.pattern?"edge-pattern-dotted":"edge-pattern-solid"} flowchart-link LS-a1 LE-b1`;ie(t,{v:s.start,w:s.end,name:c},{...s,id:c,arrowTypeEnd:s.arrowTypeEnd,arrowTypeStart:s.arrowTypeStart,points:l,classes:d},void 0,"block",n,i),s.label&&(await Jt(t,{...s,label:s.label,labelStyle:"stroke: #333; stroke-width: 1.5px;fill:none;",arrowTypeEnd:s.arrowTypeEnd,arrowTypeStart:s.arrowTypeStart,points:l,classes:d}),te({...s,x:l[1].x,y:l[1].y},{originalPath:l}))}}}E(Ge,"getNodeFromBlock"),E(Je,"calculateBlockSize"),E(Qe,"insertBlockPositioned"),E(tr,"performOperations"),E(er,"calculateBlockSizes"),E(rr,"insertBlocks"),E(ar,"insertEdges");var ir=E(function(t,e){return e.db.getClasses()},"getClasses"),nr={parser:Q,db:Ot,renderer:{draw:E(async function(t,e,r,a){const{securityLevel:i,block:n}=T(),s=a.db;let o;s.setDiagramId(e),"sandbox"===i&&(o=D("#i"+e));const l=D("sandbox"===i?o.nodes()[0].contentDocument.body:"body"),c="sandbox"===i?l.select(`[id="${e}"]`):D(`[id="${e}"]`);Pt(c,["point","circle","cross"],a.type,e);const d=s.getBlocks(),h=s.getBlocksFlat(),g=s.getEdges(),u=c.insert("g").attr("class","block");await er(u,d,s);const y=Ht(s);if(await rr(u,d,s),await ar(u,g,h,s,e),y){const t=y,e=Math.max(1,Math.round(t.width/t.height*.125)),r=t.height+e+10,a=t.width+10,{useMaxWidth:i}=n;$(c,r,a,!!i),I.debug("Here Bounds",y,t),c.attr("viewBox",`${t.x-5} ${t.y-5} ${t.width+10} ${t.height+10}`)}},"draw"),getClasses:ir},styles:zt};export{nr as diagram};
|