@shaohui_jin/git-cockpit-mcp-server 0.1.25 → 0.1.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-QPNAXPTK.js → chunk-3ALI2CBW.js} +3 -3
- package/dist/{chunk-563C4WZJ.js → chunk-G6SEOLMU.js} +2 -2
- package/dist/{chunk-FDPM74UE.js → chunk-HWO2V3M5.js} +2 -2
- package/dist/{chunk-FDPM74UE.js.map → chunk-HWO2V3M5.js.map} +1 -1
- package/dist/cli-entry.js +3 -3
- package/dist/cli.js +3 -3
- package/dist/index.js +3 -3
- package/dist/mcpServer.js +1 -1
- package/dist/web/assets/abnfDiagram-O67JEVCF-Cpmc29Vo.js +1 -0
- package/dist/web/assets/arc-C4CdJ3cz.js +1 -0
- package/dist/web/assets/architectureDiagram-NJMV4G6O-D-3EH44b.js +36 -0
- package/dist/web/assets/blockDiagram-BEXU5L5S-4o8DaZHq.js +140 -0
- package/dist/web/assets/c4Diagram-YGBWAQC7-DLufKbff.js +38 -0
- package/dist/web/assets/channel-D3CmON_0.js +1 -0
- package/dist/web/assets/chunk-2Q5K7J3B-dEtvq-Sm.js +1 -0
- package/dist/web/assets/chunk-3FUC2YCW-D8IY6i0n.js +2 -0
- package/dist/web/assets/chunk-5VM5RSS4-DTtnT10M.js +15 -0
- package/dist/web/assets/chunk-GTNCS2PH-CRKiRt85.js +88 -0
- package/dist/web/assets/chunk-GWA4HPMP-CapkHNd2.js +1 -0
- package/dist/web/assets/chunk-JWPE2WC7-D1qG9232.js +1 -0
- package/dist/web/assets/chunk-NETBCI7D-Cf5bzyqy.js +1 -0
- package/dist/web/assets/chunk-WEXAMYUT-aMK135IE.js +1 -0
- package/dist/web/assets/chunk-XXDRQBXY-DKObcU_j.js +1 -0
- package/dist/web/assets/classDiagram-v2-NBCMYWYE-BFKjdANY.js +217 -0
- package/dist/web/assets/cose-bilkent-JH36ORCC-Bbl702qf.js +1 -0
- package/dist/web/assets/cynefin-OW5HDTMX-BwkqOigD.js +178 -0
- package/dist/web/assets/cynefinDiagram-VND7K2PF-C032B141.js +62 -0
- package/dist/web/assets/cytoscape.esm-Ix0LnXOy.js +331 -0
- package/dist/web/assets/dagre-6A5THRUB-mtU2etOs.js +4 -0
- package/dist/web/assets/defaultLocale-DX6XiGOO.js +1 -0
- package/dist/web/assets/diagram-22UHCM2B-Bhef_gli.js +200 -0
- package/dist/web/assets/diagram-3UASUU5V-Bt5jGMJj.js +24 -0
- package/dist/web/assets/diagram-ATOU4E4O-E9OEgrvO.js +3 -0
- package/dist/web/assets/diagram-CDSNMT55-Ev4KURRW.js +30 -0
- package/dist/web/assets/diagram-MLGK6HIB-VyRxPiEM.js +24 -0
- package/dist/web/assets/diagram-MPIPVDR6-NZUHIzSK.js +41 -0
- package/dist/web/assets/ebnfDiagram-ZINNZB2B-BWrpXmAB.js +1 -0
- package/dist/web/assets/{element-plus-DqfuixMM.js → element-plus-IBMLLhb-.js} +16 -16
- package/dist/web/assets/elk-276RUBZZ-BGHyKt3X.js +27 -0
- package/dist/web/assets/erDiagram-OPXOYQCR-GrSAUtcQ.js +99 -0
- package/dist/web/assets/flowDiagram-KWPJA3E3-B_WVUUVf.js +213 -0
- package/dist/web/assets/ganttDiagram-FUAMR5RP-DajvFrX3.js +292 -0
- package/dist/web/assets/gitGraphDiagram-X574FWY7-CrHV5Rvk.js +106 -0
- package/dist/web/assets/graph-DcfhsBxO.js +1 -0
- package/dist/web/assets/{index-CcJ_rkpc.css → index-COls5qGF.css} +1 -1
- package/dist/web/assets/index-DNSP9H_v.js +733 -0
- package/dist/web/assets/infoDiagram-VRGFBTTK-BVr7SUMq.js +2 -0
- package/dist/web/assets/init-Gi6I4Gst.js +1 -0
- package/dist/web/assets/ishikawaDiagram-OU5B5YK6-Clo1T4Ou.js +70 -0
- package/dist/web/assets/journeyDiagram-ZHPQQLJL-BJJiqW1W.js +139 -0
- package/dist/web/assets/kanban-definition-PNTS6WVX-FIP6aaWx.js +89 -0
- package/dist/web/assets/katex-C5jXJg4s.js +257 -0
- package/dist/web/assets/linear-gNF2RYPF.js +1 -0
- package/dist/web/assets/mindmap-definition-NLK3R4M7-U9ZgUluP.js +96 -0
- package/dist/web/assets/ordinal-Cboi1Yqb.js +1 -0
- package/dist/web/assets/pegDiagram-GJSIUBJH-kqET45uW.js +1 -0
- package/dist/web/assets/pieDiagram-5QR66LMP-0Vfqg8YJ.js +39 -0
- package/dist/web/assets/quadrantDiagram-O4NWA36T-BwbgrFii.js +7 -0
- package/dist/web/assets/railroadDiagram-XR7U4H2S-AQGvMbOL.js +1 -0
- package/dist/web/assets/requirementDiagram-PLB6GJNP-WJNa_ucq.js +84 -0
- package/dist/web/assets/sankeyDiagram-IPEJSGJF-DTOl4R33.js +40 -0
- package/dist/web/assets/sequenceDiagram-PO4LG4MO-4xQidS78.js +169 -0
- package/dist/web/assets/sizeCapture-INFHLROL--JObXzuK.js +1 -0
- package/dist/web/assets/stateDiagram-v2-GCMORJYK-DO54xQHQ.js +291 -0
- package/dist/web/assets/swimlanes-2SLR337P-D2RfEaDP.js +1 -0
- package/dist/web/assets/swimlanesDiagram-TC7HE7FX-BTVqf00K.js +8 -0
- package/dist/web/assets/timeline-definition-EJHVYXUP-CjEGHstB.js +120 -0
- package/dist/web/assets/usecaseDiagram-POWQR4AR-B_QSF3HN.js +370 -0
- package/dist/web/assets/vennDiagram-UO4OBE2U-DaXBK4lA.js +34 -0
- package/dist/web/assets/wardleyDiagram-VNRHLVJA-DAcGG1ul.js +78 -0
- package/dist/web/assets/xychartDiagram-PMCCYNJV-C9NMkFcl.js +7 -0
- package/dist/web/index.html +3 -3
- package/dist/webServer.js +2 -2
- package/package.json +2 -2
- package/dist/web/assets/index-DFpy0R8H.js +0 -413
- /package/dist/{chunk-QPNAXPTK.js.map → chunk-3ALI2CBW.js.map} +0 -0
- /package/dist/{chunk-563C4WZJ.js.map → chunk-G6SEOLMU.js.map} +0 -0
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{s as K,a as Ae,c as Fe,b as Ye,f as oe,e as N,i as Ve}from"./chunk-3FUC2YCW-D8IY6i0n.js";import{_ as y,c as ze,l as b,bw as qe,bx as We,aE as He,aC as ie,an as se,al as $e,az as Je,b7 as Ue}from"./index-DNSP9H_v.js";import{G as k}from"./graph-DcfhsBxO.js";import{m as T,n as E,a as l,o as R,c as Ke,p as Q,q as _,s as O,b as L,t as Ee,w as Z,x as Qe,y as ee,f as X,v as C,r as F,z as Ze,A as B,B as G,C as A,D as en,E as J,F as Y,G as nn,H as rn,I as tn}from"./element-plus-IBMLLhb-.js";import"./vue-BhwNxZ68.js";class an{constructor(){var n={};n._next=n._prev=n,this._sentinel=n}dequeue(){var n=this._sentinel,r=n._prev;if(r!==n)return de(r),r}enqueue(n){var r=this._sentinel;n._prev&&n._next&&de(n),n._next=r._next,r._next._prev=n,r._next=n,n._prev=r}toString(){for(var n=[],r=this._sentinel,t=r._prev;t!==r;)n.push(JSON.stringify(t,on)),t=t._prev;return"["+n.join(", ")+"]"}}function de(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function on(e,n){if(e!=="_next"&&e!=="_prev")return n}var sn=Ke(1);function dn(e,n){if(e.nodeCount()<=1)return[];var r=fn(e,n||sn),t=un(r.graph,r.buckets,r.zeroIdx);return T(E(t,function(a){return e.outEdges(a.v,a.w)}))}function un(e,n,r){for(var t=[],a=n[n.length-1],o=n[0],i;e.nodeCount();){for(;i=o.dequeue();)z(e,n,r,i);for(;i=a.dequeue();)z(e,n,r,i);if(e.nodeCount()){for(var s=n.length-2;s>0;--s)if(i=n[s].dequeue(),i){t=t.concat(z(e,n,r,i,!0));break}}}return t}function z(e,n,r,t,a){var o=a?[]:void 0;return l(e.inEdges(t.v),function(i){var s=e.edge(i),u=e.node(i.v);a&&o.push({v:i.v,w:i.w}),u.out-=s,U(n,r,u)}),l(e.outEdges(t.v),function(i){var s=e.edge(i),u=i.w,d=e.node(u);d.in-=s,U(n,r,d)}),e.removeNode(t.v),o}function fn(e,n){var r=new k,t=0,a=0;l(e.nodes(),function(s){r.setNode(s,{v:s,in:0,out:0})}),l(e.edges(),function(s){var u=r.edge(s.v,s.w)||0,d=n(s),c=u+d;r.setEdge(s.v,s.w,c),a=Math.max(a,r.node(s.v).out+=d),t=Math.max(t,r.node(s.w).in+=d)});var o=R(a+t+3).map(function(){return new an}),i=t+1;return l(r.nodes(),function(s){U(o,i,r.node(s))}),{graph:r,buckets:o,zeroIdx:i}}function U(e,n,r){r.out?r.in?e[r.out-r.in+n].enqueue(r):e[e.length-1].enqueue(r):e[0].enqueue(r)}function cn(e){var n=e.graph().acyclicer==="greedy"?dn(e,r(e)):ln(e);l(n,function(t){var a=e.edge(t);e.removeEdge(t),a.forwardName=t.name,a.reversed=!0,e.setEdge(t.w,t.v,a,Q("rev"))});function r(t){return function(a){return t.edge(a).weight}}}function ln(e){var n=[],r={},t={};function a(o){Object.prototype.hasOwnProperty.call(t,o)||(t[o]=!0,r[o]=!0,l(e.outEdges(o),function(i){Object.prototype.hasOwnProperty.call(r,i.w)?n.push(i):a(i.w)}),delete r[o])}return l(e.nodes(),a),n}function hn(e){l(e.edges(),function(n){var r=e.edge(n);if(r.reversed){e.removeEdge(n);var t=r.forwardName;delete r.reversed,delete r.forwardName,e.setEdge(n.w,n.v,r,t)}})}function I(e,n,r,t){var a;do a=Q(t);while(e.hasNode(a));return r.dummy=n,e.setNode(a,r),a}function pn(e){var n=new k().setGraph(e.graph());return l(e.nodes(),function(r){n.setNode(r,e.node(r))}),l(e.edges(),function(r){var t=n.edge(r.v,r.w)||{weight:0,minlen:1},a=e.edge(r);n.setEdge(r.v,r.w,{weight:t.weight+a.weight,minlen:Math.max(t.minlen,a.minlen)})}),n}function xe(e){var n=new k({multigraph:e.isMultigraph()}).setGraph(e.graph());return l(e.nodes(),function(r){e.children(r).length||n.setNode(r,e.node(r))}),l(e.edges(),function(r){n.setEdge(r,e.edge(r))}),n}function ue(e,n){var r=e.x,t=e.y,a=n.x-r,o=n.y-t,i=e.width/2,s=e.height/2;if(!a&&!o)throw new Error("Not possible to find intersection inside of the rectangle");var u,d;return Math.abs(o)*i>Math.abs(a)*s?(o<0&&(s=-s),u=s*a/o,d=s):(a<0&&(i=-i),u=i,d=i*o/a),{x:r+u,y:t+d}}function V(e){var n=E(R(Le(e)+1),function(){return[]});return l(e.nodes(),function(r){var t=e.node(r),a=t.rank;L(a)||(n[a][t.order]=r)}),n}function vn(e){var n=_(E(e.nodes(),function(r){return e.node(r).rank}));l(e.nodes(),function(r){var t=e.node(r);Ee(t,"rank")&&(t.rank-=n)})}function gn(e){var n=_(E(e.nodes(),function(o){return e.node(o).rank})),r=[];l(e.nodes(),function(o){var i=e.node(o).rank-n;r[i]||(r[i]=[]),r[i].push(o)});var t=0,a=e.graph().nodeRankFactor;l(r,function(o,i){L(o)&&i%a!==0?--t:t&&l(o,function(s){e.node(s).rank+=t})})}function fe(e,n,r,t){var a={width:0,height:0};return arguments.length>=4&&(a.rank=r,a.order=t),I(e,"border",a,n)}function Le(e){return O(E(e.nodes(),function(n){var r=e.node(n).rank;if(!L(r))return r}))}function wn(e,n){var r={lhs:[],rhs:[]};return l(e,function(t){n(t)?r.lhs.push(t):r.rhs.push(t)}),r}function mn(e,n){return n()}function bn(e){function n(r){var t=e.children(r),a=e.node(r);if(t.length&&l(t,n),Object.prototype.hasOwnProperty.call(a,"minRank")){a.borderLeft=[],a.borderRight=[];for(var o=a.minRank,i=a.maxRank+1;o<i;++o)ce(e,"borderLeft","_bl",r,a,o),ce(e,"borderRight","_br",r,a,o)}}l(e.children(),n)}function ce(e,n,r,t,a,o){var i={width:0,height:0,rank:o,borderType:n},s=a[n][o-1],u=I(e,"border",i,r);a[n][o]=u,e.setParent(u,t),s&&e.setEdge(s,u,{weight:1})}function yn(e){var n=e.graph().rankdir.toLowerCase();(n==="lr"||n==="rl")&&ke(e)}function En(e){var n=e.graph().rankdir.toLowerCase();(n==="bt"||n==="rl")&&xn(e),(n==="lr"||n==="rl")&&(Ln(e),ke(e))}function ke(e){l(e.nodes(),function(n){le(e.node(n))}),l(e.edges(),function(n){le(e.edge(n))})}function le(e){var n=e.width;e.width=e.height,e.height=n}function xn(e){l(e.nodes(),function(n){q(e.node(n))}),l(e.edges(),function(n){var r=e.edge(n);l(r.points,q),Object.prototype.hasOwnProperty.call(r,"y")&&q(r)})}function q(e){e.y=-e.y}function Ln(e){l(e.nodes(),function(n){W(e.node(n))}),l(e.edges(),function(n){var r=e.edge(n);l(r.points,W),Object.prototype.hasOwnProperty.call(r,"x")&&W(r)})}function W(e){var n=e.x;e.x=e.y,e.y=n}function kn(e){e.graph().dummyChains=[],l(e.edges(),function(n){Nn(e,n)})}function Nn(e,n){var r=n.v,t=e.node(r).rank,a=n.w,o=e.node(a).rank,i=n.name,s=e.edge(n),u=s.labelRank;if(o!==t+1){e.removeEdge(n);var d=void 0,c,f;for(f=0,++t;t<o;++f,++t)s.points=[],d={width:0,height:0,edgeLabel:s,edgeObj:n,rank:t},c=I(e,"edge",d,"_d"),t===u&&(d.width=s.width,d.height=s.height,d.dummy="edge-label",d.labelpos=s.labelpos),e.setEdge(r,c,{weight:s.weight},i),f===0&&e.graph().dummyChains.push(c),r=c;e.setEdge(r,a,{weight:s.weight},i)}}function Sn(e){l(e.graph().dummyChains,function(n){var r=e.node(n),t=r.edgeLabel,a;for(e.setEdge(r.edgeObj,t);r.dummy;)a=e.successors(n)[0],e.removeNode(n),t.points.push({x:r.x,y:r.y}),r.dummy==="edge-label"&&(t.x=r.x,t.y=r.y,t.width=r.width,t.height=r.height),n=a,r=e.node(n)})}function ne(e){var n={};function r(t){var a=e.node(t);if(Object.prototype.hasOwnProperty.call(n,t))return a.rank;n[t]=!0;var o=_(E(e.outEdges(t),function(i){return r(i.w)-e.edge(i).minlen}));return(o===Number.POSITIVE_INFINITY||o===void 0||o===null)&&(o=0),a.rank=o}l(e.sources(),r)}function M(e,n){return e.node(n.w).rank-e.node(n.v).rank-e.edge(n).minlen}function Ne(e){var n=new k({directed:!1}),r=e.nodes()[0],t=e.nodeCount();n.setNode(r,{});for(var a,o;On(n,e)<t;)a=Pn(n,e),o=n.hasNode(a.v)?M(e,a):-M(e,a),Rn(n,e,o);return n}function On(e,n){function r(t){l(n.nodeEdges(t),function(a){var o=a.v,i=t===o?a.w:o;!e.hasNode(i)&&!M(n,a)&&(e.setNode(i,{}),e.setEdge(t,i,{}),r(i))})}return l(e.nodes(),r),e.nodeCount()}function Pn(e,n){return Z(n.edges(),function(r){if(e.hasNode(r.v)!==e.hasNode(r.w))return M(n,r)})}function Rn(e,n,r){l(e.nodes(),function(t){n.node(t).rank+=r})}function Cn(){}Cn.prototype=new Error;function Se(e,n,r){Qe(n)||(n=[n]);var t=(e.isDirected()?e.successors:e.neighbors).bind(e),a=[],o={};return l(n,function(i){if(!e.hasNode(i))throw new Error("Graph does not have node: "+i);Oe(e,i,r==="post",o,t,a)}),a}function Oe(e,n,r,t,a,o){Object.prototype.hasOwnProperty.call(t,n)||(t[n]=!0,r||o.push(n),l(a(n),function(i){Oe(e,i,r,t,a,o)}),r&&o.push(n))}function In(e,n){return Se(e,n,"post")}function Dn(e,n){return Se(e,n,"pre")}P.initLowLimValues=te;P.initCutValues=re;P.calcCutValue=Pe;P.leaveEdge=Ce;P.enterEdge=Ie;P.exchangeEdges=De;function P(e){e=pn(e),ne(e);var n=Ne(e);te(n),re(n,e);for(var r,t;r=Ce(n);)t=Ie(n,e,r),De(n,e,r,t)}function re(e,n){var r=In(e,e.nodes());r=r.slice(0,r.length-1),l(r,function(t){_n(e,n,t)})}function _n(e,n,r){var t=e.node(r),a=t.parent;e.edge(r,a).cutvalue=Pe(e,n,r)}function Pe(e,n,r){var t=e.node(r),a=t.parent,o=!0,i=n.edge(r,a),s=0;return i||(o=!1,i=n.edge(a,r)),s=i.weight,l(n.nodeEdges(r),function(u){var d=u.v===r,c=d?u.w:u.v;if(c!==a){var f=d===o,h=n.edge(u).weight;if(s+=f?h:-h,Tn(e,r,c)){var w=e.edge(r,c).cutvalue;s+=f?-w:w}}}),s}function te(e,n){arguments.length<2&&(n=e.nodes()[0]),Re(e,{},1,n)}function Re(e,n,r,t,a){var o=r,i=e.node(t);return n[t]=!0,l(e.neighbors(t),function(s){Object.prototype.hasOwnProperty.call(n,s)||(r=Re(e,n,r,s,t))}),i.low=o,i.lim=r++,a?i.parent=a:delete i.parent,r}function Ce(e){return ee(e.edges(),function(n){return e.edge(n).cutvalue<0})}function Ie(e,n,r){var t=r.v,a=r.w;n.hasEdge(t,a)||(t=r.w,a=r.v);var o=e.node(t),i=e.node(a),s=o,u=!1;o.lim>i.lim&&(s=i,u=!0);var d=X(n.edges(),function(c){return u===he(e,e.node(c.v),s)&&u!==he(e,e.node(c.w),s)});return Z(d,function(c){return M(n,c)})}function De(e,n,r,t){var a=r.v,o=r.w;e.removeEdge(a,o),e.setEdge(t.v,t.w,{}),te(e),re(e,n),Mn(e,n)}function Mn(e,n){var r=ee(e.nodes(),function(a){return!n.node(a).parent}),t=Dn(e,r);t=t.slice(1),l(t,function(a){var o=e.node(a).parent,i=n.edge(a,o),s=!1;i||(i=n.edge(o,a),s=!0),n.node(a).rank=n.node(o).rank+(s?i.minlen:-i.minlen)})}function Tn(e,n,r){return e.hasEdge(n,r)}function he(e,n,r){return r.low<=n.lim&&n.lim<=r.lim}function Xn(e){switch(e.graph().ranker){case"network-simplex":pe(e);break;case"tight-tree":jn(e);break;case"longest-path":Bn(e);break;default:pe(e)}}var Bn=ne;function jn(e){ne(e),Ne(e)}function pe(e){P(e)}function Gn(e){var n=I(e,"root",{},"_root"),r=An(e),t=O(C(r))-1,a=2*t+1;e.graph().nestingRoot=n,l(e.edges(),function(i){e.edge(i).minlen*=a});var o=Fn(e)+1;l(e.children(),function(i){_e(e,n,a,o,t,r,i)}),e.graph().nodeRankFactor=a}function _e(e,n,r,t,a,o,i){var s=e.children(i);if(!s.length){i!==n&&e.setEdge(n,i,{weight:0,minlen:r});return}var u=fe(e,"_bt"),d=fe(e,"_bb"),c=e.node(i);e.setParent(u,i),c.borderTop=u,e.setParent(d,i),c.borderBottom=d,l(s,function(f){_e(e,n,r,t,a,o,f);var h=e.node(f),w=h.borderTop?h.borderTop:f,v=h.borderBottom?h.borderBottom:f,g=h.borderTop?t:2*t,p=w!==v?1:a-o[i]+1;e.setEdge(u,w,{weight:g,minlen:p,nestingEdge:!0}),e.setEdge(v,d,{weight:g,minlen:p,nestingEdge:!0})}),e.parent(i)||e.setEdge(n,u,{weight:0,minlen:a+o[i]})}function An(e){var n={};function r(t,a){var o=e.children(t);o&&o.length&&l(o,function(i){r(i,a+1)}),n[t]=a}return l(e.children(),function(t){r(t,1)}),n}function Fn(e){return F(e.edges(),function(n,r){return n+e.edge(r).weight},0)}function Yn(e){var n=e.graph();e.removeNode(n.nestingRoot),delete n.nestingRoot,l(e.edges(),function(r){var t=e.edge(r);t.nestingEdge&&e.removeEdge(r)})}function Vn(e,n,r){var t={},a;l(r,function(o){for(var i=e.parent(o),s,u;i;){if(s=e.parent(i),s?(u=t[s],t[s]=i):(u=a,a=i),u&&u!==i){n.setEdge(u,i);return}i=s}})}function zn(e,n,r){var t=qn(e),a=new k({compound:!0}).setGraph({root:t}).setDefaultNodeLabel(function(o){return e.node(o)});return l(e.nodes(),function(o){var i=e.node(o),s=e.parent(o);(i.rank===n||i.minRank<=n&&n<=i.maxRank)&&(a.setNode(o),a.setParent(o,s||t),l(e[r](o),function(u){var d=u.v===o?u.w:u.v,c=a.edge(d,o),f=L(c)?0:c.weight;a.setEdge(d,o,{weight:e.edge(u).weight+f})}),Object.prototype.hasOwnProperty.call(i,"minRank")&&a.setNode(o,{borderLeft:i.borderLeft[n],borderRight:i.borderRight[n]}))}),a}function qn(e){for(var n;e.hasNode(n=Q("_root")););return n}function Wn(e,n){for(var r=0,t=1;t<n.length;++t)r+=Hn(e,n[t-1],n[t]);return r}function Hn(e,n,r){for(var t=Ze(r,E(r,function(d,c){return c})),a=T(E(n,function(d){return B(E(e.outEdges(d),function(c){return{pos:t[c.w],weight:e.edge(c).weight}}),"pos")})),o=1;o<r.length;)o<<=1;var i=2*o-1;o-=1;var s=E(new Array(i),function(){return 0}),u=0;return l(a.forEach(function(d){var c=d.pos+o;s[c]+=d.weight;for(var f=0;c>0;)c%2&&(f+=s[c+1]),c=c-1>>1,s[c]+=d.weight;u+=d.weight*f})),u}function $n(e){var n={},r=X(e.nodes(),function(s){return!e.children(s).length}),t=O(E(r,function(s){return e.node(s).rank})),a=E(R(t+1),function(){return[]});function o(s){if(!Ee(n,s)){n[s]=!0;var u=e.node(s);a[u.rank].push(s),l(e.successors(s),o)}}var i=B(r,function(s){return e.node(s).rank});return l(i,o),a}function Jn(e,n){return E(n,function(r){var t=e.inEdges(r);if(t.length){var a=F(t,function(o,i){var s=e.edge(i),u=e.node(i.v);return{sum:o.sum+s.weight*u.order,weight:o.weight+s.weight}},{sum:0,weight:0});return{v:r,barycenter:a.sum/a.weight,weight:a.weight}}else return{v:r}})}function Un(e,n){var r={};l(e,function(a,o){var i=r[a.v]={indegree:0,in:[],out:[],vs:[a.v],i:o};L(a.barycenter)||(i.barycenter=a.barycenter,i.weight=a.weight)}),l(n.edges(),function(a){var o=r[a.v],i=r[a.w];!L(o)&&!L(i)&&(i.indegree++,o.out.push(r[a.w]))});var t=X(r,function(a){return!a.indegree});return Kn(t)}function Kn(e){var n=[];function r(o){return function(i){i.merged||(L(i.barycenter)||L(o.barycenter)||i.barycenter>=o.barycenter)&&Qn(o,i)}}function t(o){return function(i){i.in.push(o),--i.indegree===0&&e.push(i)}}for(;e.length;){var a=e.pop();n.push(a),l(a.in.reverse(),r(a)),l(a.out,t(a))}return E(X(n,function(o){return!o.merged}),function(o){return G(o,["vs","i","barycenter","weight"])})}function Qn(e,n){var r=0,t=0;e.weight&&(r+=e.barycenter*e.weight,t+=e.weight),n.weight&&(r+=n.barycenter*n.weight,t+=n.weight),e.vs=n.vs.concat(e.vs),e.barycenter=r/t,e.weight=t,e.i=Math.min(n.i,e.i),n.merged=!0}function Zn(e,n){var r=wn(e,function(c){return Object.prototype.hasOwnProperty.call(c,"barycenter")}),t=r.lhs,a=B(r.rhs,function(c){return-c.i}),o=[],i=0,s=0,u=0;t.sort(er(!!n)),u=ve(o,a,u),l(t,function(c){u+=c.vs.length,o.push(c.vs),i+=c.barycenter*c.weight,s+=c.weight,u=ve(o,a,u)});var d={vs:T(o)};return s&&(d.barycenter=i/s,d.weight=s),d}function ve(e,n,r){for(var t;n.length&&(t=A(n)).i<=r;)n.pop(),e.push(t.vs),r++;return r}function er(e){return function(n,r){return n.barycenter<r.barycenter?-1:n.barycenter>r.barycenter?1:e?r.i-n.i:n.i-r.i}}function Me(e,n,r,t){var a=e.children(n),o=e.node(n),i=o?o.borderLeft:void 0,s=o?o.borderRight:void 0,u={};i&&(a=X(a,function(v){return v!==i&&v!==s}));var d=Jn(e,a);l(d,function(v){if(e.children(v.v).length){var g=Me(e,v.v,r,t);u[v.v]=g,Object.prototype.hasOwnProperty.call(g,"barycenter")&&rr(v,g)}});var c=Un(d,r);nr(c,u);var f=Zn(c,t);if(i&&(f.vs=T([i,f.vs,s]),e.predecessors(i).length)){var h=e.node(e.predecessors(i)[0]),w=e.node(e.predecessors(s)[0]);Object.prototype.hasOwnProperty.call(f,"barycenter")||(f.barycenter=0,f.weight=0),f.barycenter=(f.barycenter*f.weight+h.order+w.order)/(f.weight+2),f.weight+=2}return f}function nr(e,n){l(e,function(r){r.vs=T(r.vs.map(function(t){return n[t]?n[t].vs:t}))})}function rr(e,n){L(e.barycenter)?(e.barycenter=n.barycenter,e.weight=n.weight):(e.barycenter=(e.barycenter*e.weight+n.barycenter*n.weight)/(e.weight+n.weight),e.weight+=n.weight)}function tr(e){var n=Le(e),r=ge(e,R(1,n+1),"inEdges"),t=ge(e,R(n-1,-1,-1),"outEdges"),a=$n(e);we(e,a);for(var o=Number.POSITIVE_INFINITY,i,s=0,u=0;u<4;++s,++u){ar(s%2?r:t,s%4>=2),a=V(e);var d=Wn(e,a);d<o&&(u=0,i=en(a),o=d)}we(e,i)}function ge(e,n,r){return E(n,function(t){return zn(e,t,r)})}function ar(e,n){var r=new k;l(e,function(t){var a=t.graph().root,o=Me(t,a,r,n);l(o.vs,function(i,s){t.node(i).order=s}),Vn(t,r,o.vs)})}function we(e,n){l(n,function(r){l(r,function(t,a){e.node(t).order=a})})}function or(e){var n=sr(e);l(e.graph().dummyChains,function(r){for(var t=e.node(r),a=t.edgeObj,o=ir(e,n,a.v,a.w),i=o.path,s=o.lca,u=0,d=i[u],c=!0;r!==a.w;){if(t=e.node(r),c){for(;(d=i[u])!==s&&e.node(d).maxRank<t.rank;)u++;d===s&&(c=!1)}if(!c){for(;u<i.length-1&&e.node(d=i[u+1]).minRank<=t.rank;)u++;d=i[u]}e.setParent(r,d),r=e.successors(r)[0]}})}function ir(e,n,r,t){var a=[],o=[],i=Math.min(n[r].low,n[t].low),s=Math.max(n[r].lim,n[t].lim),u,d;u=r;do u=e.parent(u),a.push(u);while(u&&(n[u].low>i||s>n[u].lim));for(d=u,u=t;(u=e.parent(u))!==d;)o.push(u);return{path:a.concat(o.reverse()),lca:d}}function sr(e){var n={},r=0;function t(a){var o=r;l(e.children(a),t),n[a]={low:o,lim:r++}}return l(e.children(),t),n}function dr(e,n){var r={};function t(a,o){var i=0,s=0,u=a.length,d=A(o);return l(o,function(c,f){var h=fr(e,c),w=h?e.node(h).order:u;(h||c===d)&&(l(o.slice(s,f+1),function(v){l(e.predecessors(v),function(g){var p=e.node(g),m=p.order;(m<i||w<m)&&!(p.dummy&&e.node(v).dummy)&&Te(r,g,v)})}),s=f+1,i=w)}),o}return F(n,t),r}function ur(e,n){var r={};function t(o,i,s,u,d){var c;l(R(i,s),function(f){c=o[f],e.node(c).dummy&&l(e.predecessors(c),function(h){var w=e.node(h);w.dummy&&(w.order<u||w.order>d)&&Te(r,h,c)})})}function a(o,i){var s=-1,u,d=0;return l(i,function(c,f){if(e.node(c).dummy==="border"){var h=e.predecessors(c);h.length&&(u=e.node(h[0]).order,t(i,d,f,s,u),d=f,s=u)}t(i,d,i.length,u,o.length)}),i}return F(n,a),r}function fr(e,n){if(e.node(n).dummy)return ee(e.predecessors(n),function(r){return e.node(r).dummy})}function Te(e,n,r){if(n>r){var t=n;n=r,r=t}Object.prototype.hasOwnProperty.call(e,n)||Object.defineProperty(e,n,{enumerable:!0,configurable:!0,value:{},writable:!0});var a=e[n];Object.defineProperty(a,r,{enumerable:!0,configurable:!0,value:!0,writable:!0})}function cr(e,n,r){if(n>r){var t=n;n=r,r=t}return!!e[n]&&Object.prototype.hasOwnProperty.call(e[n],r)}function lr(e,n,r,t){var a={},o={},i={};return l(n,function(s){l(s,function(u,d){a[u]=u,o[u]=u,i[u]=d})}),l(n,function(s){var u=-1;l(s,function(d){var c=t(d);if(c.length){c=B(c,function(g){return i[g]});for(var f=(c.length-1)/2,h=Math.floor(f),w=Math.ceil(f);h<=w;++h){var v=c[h];o[d]===d&&u<i[v]&&!cr(r,d,v)&&(o[v]=d,o[d]=a[d]=a[v],u=i[v])}}})}),{root:a,align:o}}function hr(e,n,r,t,a){var o={},i=pr(e,n,r,a),s=a?"borderLeft":"borderRight";function u(f,h){for(var w=i.nodes(),v=w.pop(),g={};v;)g[v]?f(v):(g[v]=!0,w.push(v),w=w.concat(h(v))),v=w.pop()}function d(f){o[f]=i.inEdges(f).reduce(function(h,w){return Math.max(h,o[w.v]+i.edge(w))},0)}function c(f){var h=i.outEdges(f).reduce(function(v,g){return Math.min(v,o[g.w]-i.edge(g))},Number.POSITIVE_INFINITY),w=e.node(f);h!==Number.POSITIVE_INFINITY&&w.borderType!==s&&(o[f]=Math.max(o[f],h))}return u(d,i.predecessors.bind(i)),u(c,i.successors.bind(i)),l(t,function(f){o[f]=o[r[f]]}),o}function pr(e,n,r,t){var a=new k,o=e.graph(),i=br(o.nodesep,o.edgesep,t);return l(n,function(s){var u;l(s,function(d){var c=r[d];if(a.setNode(c),u){var f=r[u],h=a.edge(f,c);a.setEdge(f,c,Math.max(i(e,d,u),h||0))}u=d})}),a}function vr(e,n){return Z(C(n),function(r){var t=Number.NEGATIVE_INFINITY,a=Number.POSITIVE_INFINITY;return nn(r,function(o,i){var s=yr(e,i)/2;t=Math.max(o+s,t),a=Math.min(o-s,a)}),t-a})}function gr(e,n){var r=C(n),t=_(r),a=O(r);l(["u","d"],function(o){l(["l","r"],function(i){var s=o+i,u=e[s],d;if(u!==n){var c=C(u);d=i==="l"?t-_(c):a-O(c),d&&(e[s]=Y(u,function(f){return f+d}))}})})}function wr(e,n){return Y(e.ul,function(r,t){if(n)return e[n.toLowerCase()][t];var a=B(E(e,t));return(a[1]+a[2])/2})}function mr(e){var n=V(e),r=J(dr(e,n),ur(e,n)),t={},a;l(["u","d"],function(i){a=i==="u"?n:C(n).reverse(),l(["l","r"],function(s){s==="r"&&(a=E(a,function(f){return C(f).reverse()}));var u=(i==="u"?e.predecessors:e.successors).bind(e),d=lr(e,a,r,u),c=hr(e,a,d.root,d.align,s==="r");s==="r"&&(c=Y(c,function(f){return-f})),t[i+s]=c})});var o=vr(e,t);return gr(t,o),wr(t,e.graph().align)}function br(e,n,r){return function(t,a,o){var i=t.node(a),s=t.node(o),u=0,d;if(u+=i.width/2,Object.prototype.hasOwnProperty.call(i,"labelpos"))switch(i.labelpos.toLowerCase()){case"l":d=-i.width/2;break;case"r":d=i.width/2;break}if(d&&(u+=r?d:-d),d=0,u+=(i.dummy?n:e)/2,u+=(s.dummy?n:e)/2,u+=s.width/2,Object.prototype.hasOwnProperty.call(s,"labelpos"))switch(s.labelpos.toLowerCase()){case"l":d=s.width/2;break;case"r":d=-s.width/2;break}return d&&(u+=r?d:-d),d=0,u}}function yr(e,n){return e.node(n).width}function Er(e){e=xe(e),xr(e),rn(mr(e),function(n,r){e.node(r).x=n})}function xr(e){var n=V(e),r=e.graph().ranksep,t=0;l(n,function(a){var o=O(E(a,function(i){return e.node(i).height}));l(a,function(i){e.node(i).y=t+o/2}),t+=o+r})}function Lr(e,n){var r=mn;r("layout",()=>{var t=r(" buildLayoutGraph",()=>Mr(e));r(" runLayout",()=>kr(t,r)),r(" updateInputGraph",()=>Nr(e,t))})}function kr(e,n){n(" makeSpaceForEdgeLabels",()=>Tr(e)),n(" removeSelfEdges",()=>zr(e)),n(" acyclic",()=>cn(e)),n(" nestingGraph.run",()=>Gn(e)),n(" rank",()=>Xn(xe(e))),n(" injectEdgeLabelProxies",()=>Xr(e)),n(" removeEmptyRanks",()=>gn(e)),n(" nestingGraph.cleanup",()=>Yn(e)),n(" normalizeRanks",()=>vn(e)),n(" assignRankMinMax",()=>Br(e)),n(" removeEdgeLabelProxies",()=>jr(e)),n(" normalize.run",()=>kn(e)),n(" parentDummyChains",()=>or(e)),n(" addBorderSegments",()=>bn(e)),n(" order",()=>tr(e)),n(" insertSelfEdges",()=>qr(e)),n(" adjustCoordinateSystem",()=>yn(e)),n(" position",()=>Er(e)),n(" positionSelfEdges",()=>Wr(e)),n(" removeBorderNodes",()=>Vr(e)),n(" normalize.undo",()=>Sn(e)),n(" fixupEdgeLabelCoords",()=>Fr(e)),n(" undoCoordinateSystem",()=>En(e)),n(" translateGraph",()=>Gr(e)),n(" assignNodeIntersects",()=>Ar(e)),n(" reversePoints",()=>Yr(e)),n(" acyclic.undo",()=>hn(e))}function Nr(e,n){l(e.nodes(),function(r){var t=e.node(r),a=n.node(r);t&&(t.x=a.x,t.y=a.y,n.children(r).length&&(t.width=a.width,t.height=a.height))}),l(e.edges(),function(r){var t=e.edge(r),a=n.edge(r);t.points=a.points,Object.prototype.hasOwnProperty.call(a,"x")&&(t.x=a.x,t.y=a.y)}),e.graph().width=n.graph().width,e.graph().height=n.graph().height}var Sr=["nodesep","edgesep","ranksep","marginx","marginy"],Or={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},Pr=["acyclicer","ranker","rankdir","align"],Rr=["width","height"],Cr={width:0,height:0},Ir=["minlen","weight","width","height","labeloffset"],Dr={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},_r=["labelpos"];function Mr(e){var n=new k({multigraph:!0,compound:!0}),r=$(e.graph());return n.setGraph(J({},Or,H(r,Sr),G(r,Pr))),l(e.nodes(),function(t){var a=$(e.node(t));n.setNode(t,tn(H(a,Rr),Cr)),n.setParent(t,e.parent(t))}),l(e.edges(),function(t){var a=$(e.edge(t));n.setEdge(t,J({},Dr,H(a,Ir),G(a,_r)))}),n}function Tr(e){var n=e.graph();n.ranksep/=2,l(e.edges(),function(r){var t=e.edge(r);t.minlen*=2,t.labelpos.toLowerCase()!=="c"&&(n.rankdir==="TB"||n.rankdir==="BT"?t.width+=t.labeloffset:t.height+=t.labeloffset)})}function Xr(e){l(e.edges(),function(n){var r=e.edge(n);if(r.width&&r.height){var t=e.node(n.v),a=e.node(n.w),o={rank:(a.rank-t.rank)/2+t.rank,e:n};I(e,"edge-proxy",o,"_ep")}})}function Br(e){var n=0;l(e.nodes(),function(r){var t=e.node(r);t.borderTop&&(t.minRank=e.node(t.borderTop).rank,t.maxRank=e.node(t.borderBottom).rank,n=O(n,t.maxRank))}),e.graph().maxRank=n}function jr(e){l(e.nodes(),function(n){var r=e.node(n);r.dummy==="edge-proxy"&&(e.edge(r.e).labelRank=r.rank,e.removeNode(n))})}function Gr(e){var n=Number.POSITIVE_INFINITY,r=0,t=Number.POSITIVE_INFINITY,a=0,o=e.graph(),i=o.marginx||0,s=o.marginy||0;function u(d){var c=d.x,f=d.y,h=d.width,w=d.height;n=Math.min(n,c-h/2),r=Math.max(r,c+h/2),t=Math.min(t,f-w/2),a=Math.max(a,f+w/2)}l(e.nodes(),function(d){u(e.node(d))}),l(e.edges(),function(d){var c=e.edge(d);Object.prototype.hasOwnProperty.call(c,"x")&&u(c)}),n-=i,t-=s,l(e.nodes(),function(d){var c=e.node(d);c.x-=n,c.y-=t}),l(e.edges(),function(d){var c=e.edge(d);l(c.points,function(f){f.x-=n,f.y-=t}),Object.prototype.hasOwnProperty.call(c,"x")&&(c.x-=n),Object.prototype.hasOwnProperty.call(c,"y")&&(c.y-=t)}),o.width=r-n+i,o.height=a-t+s}function Ar(e){l(e.edges(),function(n){var r=e.edge(n),t=e.node(n.v),a=e.node(n.w),o,i;r.points?(o=r.points[0],i=r.points[r.points.length-1]):(r.points=[],o=a,i=t),r.points.unshift(ue(t,o)),r.points.push(ue(a,i))})}function Fr(e){l(e.edges(),function(n){var r=e.edge(n);if(Object.prototype.hasOwnProperty.call(r,"x"))switch((r.labelpos==="l"||r.labelpos==="r")&&(r.width-=r.labeloffset),r.labelpos){case"l":r.x-=r.width/2+r.labeloffset;break;case"r":r.x+=r.width/2+r.labeloffset;break}})}function Yr(e){l(e.edges(),function(n){var r=e.edge(n);r.reversed&&r.points.reverse()})}function Vr(e){l(e.nodes(),function(n){if(e.children(n).length){var r=e.node(n),t=e.node(r.borderTop),a=e.node(r.borderBottom),o=e.node(A(r.borderLeft)),i=e.node(A(r.borderRight));r.width=Math.abs(i.x-o.x),r.height=Math.abs(a.y-t.y),r.x=o.x+r.width/2,r.y=t.y+r.height/2}}),l(e.nodes(),function(n){e.node(n).dummy==="border"&&e.removeNode(n)})}function zr(e){l(e.edges(),function(n){if(n.v===n.w){var r=e.node(n.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e:n,label:e.edge(n)}),e.removeEdge(n)}})}function qr(e){var n=V(e);l(n,function(r){var t=0;l(r,function(a,o){var i=e.node(a);i.order=o+t,l(i.selfEdges,function(s){I(e,"selfedge",{width:s.label.width,height:s.label.height,rank:i.rank,order:o+ ++t,e:s.e,label:s.label},"_se")}),delete i.selfEdges})})}function Wr(e){l(e.nodes(),function(n){var r=e.node(n);if(r.dummy==="selfedge"){var t=e.node(r.e.v),a=t.x+t.width/2,o=t.y,i=r.x-a,s=t.height/2;e.setEdge(r.e,r.label),e.removeNode(n),r.label.points=[{x:a+2*i/3,y:o-s},{x:a+5*i/6,y:o-s},{x:a+i,y:o},{x:a+5*i/6,y:o+s},{x:a+2*i/3,y:o+s}],r.label.x=r.x,r.label.y=r.y}})}function H(e,n){return Y(G(e,n),Number)}function $(e){var n={};return l(e,function(r,t){n[t.toLowerCase()]=r}),n}var me=y((e,n,r)=>Math.max(n,Math.min(r,e)),"clamp"),be=y((e="TB")=>{switch(e){case"BT":return"bottom";case"LR":return"right";case"RL":return"left";case"TB":default:return"top"}},"getDefaultSelfLoopSide"),Hr=y(e=>e==="flowchart"||e==="flowchart-v2"||e==="stateDiagram"||e==="er"||e==="classDiagram","shouldMergeSelfLoopSegments"),$r=["x","y","width","height","labelBBox","intersect","calcIntersect","diff","clusterNode"],Jr=y((e,n,r,t,a)=>{const o=[],i=new Set;if(r.forEach(({start:c,end:f})=>{c!==t&&i.add(c),f!==t&&i.add(f)}),i.forEach(c=>{const f=e.node(c);typeof(f==null?void 0:f.x)=="number"&&typeof(f==null?void 0:f.y)=="number"&&o.push(f)}),o.length===0&&r.forEach(({edge:c})=>{(c.points??[]).forEach(f=>{typeof(f==null?void 0:f.x)=="number"&&typeof(f==null?void 0:f.y)=="number"&&o.push(f)})}),o.length===0)return be(a);const s=o.reduce((c,f)=>({x:c.x+f.x/o.length,y:c.y+f.y/o.length}),{x:0,y:0}),u=s.x-n.x,d=s.y-n.y;return Math.abs(u)>Math.abs(d)?u>0?"right":"left":Math.abs(d)>0?d>0?"bottom":"top":be(a)},"getSelfLoopSide"),Ur=y((e,n="top",r=0,t=0)=>{const a=e.x,o=e.y-r,i=e.width/2,s=e.height/2,u=Math.max(36,Math.min(100,e.width*.8)),d=me(Math.max(t,e.width*.35),36,u),c=me(Math.min(e.width,e.height)*.45,24,48);switch(n){case"bottom":{const f=o+s;return[{x:a-d/2,y:f},{x:a-d/2,y:f+c},{x:a+d/2,y:f+c},{x:a+d/2,y:f}]}case"right":{const f=a+i;return[{x:f,y:o-d/2},{x:f+c,y:o-d/2},{x:f+c,y:o+d/2},{x:f,y:o+d/2}]}case"left":{const f=a-i;return[{x:f,y:o-d/2},{x:f-c,y:o-d/2},{x:f-c,y:o+d/2},{x:f,y:o+d/2}]}case"top":default:{const f=o-s;return[{x:a-d/2,y:f},{x:a-d/2,y:f-c},{x:a+d/2,y:f-c},{x:a+d/2,y:f}]}}},"getSelfLoopPoints"),Kr=y((e,n,r="top",t=0,a={})=>{const i=e.x,s=e.y-t,u=a.width??0,d=a.height??0;switch(r){case"bottom":return{x:i,y:Math.max(...n.map(c=>c.y))+d/2+4};case"right":return{x:Math.max(...n.map(c=>c.x))+u/2+4,y:s};case"left":return{x:Math.min(...n.map(c=>c.x))-u/2-4,y:s};case"top":default:return{x:i,y:Math.min(...n.map(c=>c.y))-d/2-4}}},"getSelfLoopLabelPosition"),Xe=y((e,n=0,{mergeSelfLoops:r=!0}={})=>{var i;const t=new Map,a=[],o=(i=e.graph())==null?void 0:i.rankdir;return e.edges().forEach(s=>{const u=e.edge(s);if(r&&u.selfLoop){const d=u.selfLoop.id;t.has(d)||t.set(d,[]),t.get(d).push({edge:u,start:s.v,end:s.w})}else a.push({edge:u,start:s.v,end:s.w})}),t.forEach(s=>{if(s.length!==3){s.forEach(x=>a.push(x));return}s.sort((x,S)=>x.edge.selfLoop.order-S.edge.selfLoop.order);const[u,d,c]=s,f=u.edge.originalEdge??d.edge.originalEdge??c.edge.originalEdge??d.edge,h=e.node(f.start);if(!h){s.forEach(x=>a.push(x));return}const w={width:d.edge.width,height:d.edge.height},v=Jr(e,h,s,f.start,o),g=Ur(h,v,n,w.width??0),p=Kr(h,g,v,n,w),m={...d.edge,...f,id:f.id,points:g,start:f.start,end:f.end,x:p.x,y:p.y,width:w.width,height:w.height,labelStyle:d.edge.labelStyle,fromCluster:u.edge.fromCluster??d.edge.fromCluster??c.edge.fromCluster,toCluster:u.edge.toCluster??d.edge.toCluster??c.edge.toCluster};delete m.selfLoop,delete m.originalEdge,a.push({edge:m,start:m.start,end:m.end})}),a},"getEdgesToRender"),Be=y(async({element:e,graph:n,diagramType:r,id:t,parentCluster:a,siteConfig:o})=>{const i=n.graph().rankdir;b.trace("Dir in recursive render - dir:",i);const{clusters:s,edgePaths:u,edgeLabels:d,nodes:c,rootGroups:f}=Ye(e,{edgePathsClass:"edgePaths"});n.nodes()?b.info("Recursive render XXX",n.nodes()):b.info("No nodes found for",n),n.edges().length>0&&b.info("Recursive edges",n.edge(n.edges()[0]));const h=Hr(r);await Promise.all(n.nodes().map(async function(g){const p=n.node(g);if(a!==void 0){const m=JSON.parse(JSON.stringify(a.clusterData));b.trace(`Setting data for parent cluster XXX
|
|
2
|
+
Node.id = `,g,`
|
|
3
|
+
data=`,m.height,`
|
|
4
|
+
Parent cluster`,a.height),n.setNode(a.id,m),n.parent(g)||(b.trace("Setting parent",g,a.id),n.setParent(g,a.id,m))}if(b.info("(Insert) Node XXX"+g+": "+JSON.stringify(n.node(g))),p!=null&&p.clusterNode){b.info("Cluster identified XBX",g,p.width,n.node(g));const{ranksep:m,nodesep:x}=n.graph();p.graph.setGraph({...p.graph.graph(),ranksep:m+25,nodesep:x});const S=await rt({element:c,graph:p.graph,diagramType:r,id:t,parentCluster:n.node(g),siteConfig:o}),D=S.elem;qe(p,D),p.diff=S.diff||0,b.info("New compound node after recursive render XAX",g,"width",p.width,"height",p.height),We(D,p)}else n.children(g).length>0?(b.trace("Cluster - the non recursive path XBX",g,p.id,p,p.width,"Graph:",n),b.trace(oe(p.id,n)),N.set(p.id,{id:oe(p.id,n),node:p})):(b.trace("Node - the non recursive path XAX",g,c,n.node(g),i),await Ve(c,n.node(g),{config:o,dir:i}))})),await y(async()=>{const g=n.edges().map(async function(p){var x,S,D,ae;const m=n.edge(p.v,p.w,p.name);if(b.info("Edge "+p.v+" -> "+p.w+": "+JSON.stringify(p)),b.info("Edge "+p.v+" -> "+p.w+": ",p," ",JSON.stringify(n.edge(p))),b.info("Fix",N,"ids:",p.v,p.w,"Translating: ",N.get(p.v),N.get(p.w)),h&&m.selfLoop){if(m.selfLoop.order!==1)return;const j={...m.originalEdge,...m,id:m.selfLoop.id,startLabelLeft:((x=m.originalEdge)==null?void 0:x.startLabelLeft)??m.startLabelLeft,startLabelRight:((S=m.originalEdge)==null?void 0:S.startLabelRight)??m.startLabelRight,endLabelLeft:((D=m.originalEdge)==null?void 0:D.endLabelLeft)??m.endLabelLeft,endLabelRight:((ae=m.originalEdge)==null?void 0:ae.endLabelRight)??m.endLabelRight};await ie(d,j),m.width=j.width,m.height=j.height,m.labelStyle=j.labelStyle;return}await ie(d,m)});await Promise.all(g)},"processEdges")();const{subGraphTitleTotalMargin:v}=He(o);return{elem:f,graph:n,groups:{clusters:s,edgePaths:u,edgeLabels:d,nodes:c,rootGroups:f},diagramType:r,id:t,mergeSelfLoops:h,subGraphTitleTotalMargin:v}},"measureDagreGraph"),je=y(e=>{b.info("############################################# XXX"),b.info("### Layout ### XXX"),b.info("############################################# XXX"),Lr(e)},"runDagreGraphLayout"),Qr=y((e,n,r)=>{const t=e.node(n);if(!t)return;const a={...t};return t!=null&&t.clusterNode?a.y=(t.y??0)+r:e.children(n).length>0?a.height=(t.height??0)+r:a.y=(t.y??0)+r/2,a},"normalizeDagreNode"),ye=y((e,n)=>{$r.forEach(r=>{n[r]!==void 0&&(e[r]=n[r])})},"applyDagreNodeLayout"),Zr=y((e,n,r,t)=>({...e,start:e.start??n,end:e.end??r,points:(e.points??[]).map(a=>({...a,y:typeof a.y=="number"?a.y+t:a.y}))}),"normalizeDagreEdge"),et=y((e,n)=>{const{graph:r,mergeSelfLoops:t,subGraphTitleTotalMargin:a=0}=n,o=new Map(e.nodes.map(s=>[s.id,s]));K(r).forEach(s=>{const u=Qr(r,s,a);if(!u)return;ye(r.node(s),u);const d=o.get(s);d&&ye(d,u)});const i=a/2;return e.edges=Xe(r,i,{mergeSelfLoops:t}).map(({edge:s,start:u,end:d})=>Zr(s,u,d,i)),e},"applyDagreLayoutResult"),nt=y(async({elem:e,graph:n,groups:{clusters:r,edgePaths:t},diagramType:a,id:o,mergeSelfLoops:i,subGraphTitleTotalMargin:s})=>{let u=0;await Promise.all(K(n).map(async function(f){var w;const h=n.node(f);if(b.info("Position XBX => "+f+": ("+h.x,","+h.y,") width: ",h.width," height: ",h.height),h!=null&&h.clusterNode)h.y+=s,b.info("A tainted cluster node XBX1",f,h.id,h.width,h.height,h.x,h.y,n.parent(f)),N.get(h.id).node=h,se(h);else if(n.children(f).length>0){b.info("A pure cluster node XBX1",f,h.id,h.x,h.y,h.width,h.height,n.parent(f)),h.height+=s,n.node(h.parentId);const v=(h==null?void 0:h.padding)/2||0,g=((w=h==null?void 0:h.labelBBox)==null?void 0:w.height)||0,p=g-v||0;b.debug("OffsetY",p,"labelHeight",g,"halfPadding",v),await $e(r,h),N.get(h.id).node=h}else{const v=n.node(h.parentId);h.y+=s/2,b.info("A regular node XBX1 - using the padding",h.id,"parent",h.parentId,h.width,h.height,h.x,h.y,"offsetY",h.offsetY,"parent",v,v==null?void 0:v.offsetY,h),se(h)}}));const d=s/2;return Xe(n,d,{mergeSelfLoops:i}).forEach(function({edge:f,start:h,end:w}){b.info("Edge "+h+" -> "+w+": "+JSON.stringify(f),f),f.points.forEach(m=>m.y+=d);const v=n.node(h),g=n.node(w),p=Je(t,f,N,a,v,g,o);Ue(f,p)}),n.nodes().forEach(function(f){const h=n.node(f);b.info(f,h.type,h.diff),h.isGroup&&(u=h.diff)}),b.warn("Returning from recursive render XAX",e,u),{elem:e,diff:u}},"paintDagreLayoutCore"),rt=y(async e=>{const n=await Be(e);return je(n.graph),await nt(n)},"renderDagreSubgraph"),Ge=y(e=>{var r,t,a,o,i,s;const n=new k({multigraph:!0,compound:!0}).setGraph({rankdir:e.direction,nodesep:((r=e.config)==null?void 0:r.nodeSpacing)||e.nodeSpacing||((a=(t=e.config)==null?void 0:t.flowchart)==null?void 0:a.nodeSpacing),ranksep:((o=e.config)==null?void 0:o.rankSpacing)||e.rankSpacing||((s=(i=e.config)==null?void 0:i.flowchart)==null?void 0:s.rankSpacing),marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});return e.nodes.forEach(u=>{n.setNode(u.id,{...u}),u.parentId&&n.setParent(u.id,u.parentId)}),b.debug("Edges:",e.edges),e.edges.forEach(u=>{if(u.start===u.end){const d=u.start,c=d+"---"+d+"---1",f=d+"---"+d+"---2",h=n.node(d);n.setNode(c,{domId:c,id:c,parentId:h.parentId,labelStyle:"",label:"",padding:0,shape:"labelRect",style:"",width:10,height:10}),n.setParent(c,h.parentId),n.setNode(f,{domId:f,id:f,parentId:h.parentId,labelStyle:"",padding:0,shape:"labelRect",label:"",style:"",width:10,height:10}),n.setParent(f,h.parentId);const w=structuredClone(u),v=structuredClone(u),g=structuredClone(u),p=structuredClone(u);v.originalEdge=w,v.selfLoop={id:w.id,order:0},g.originalEdge=w,g.selfLoop={id:w.id,order:1},p.originalEdge=w,p.selfLoop={id:w.id,order:2},v.label="",v.arrowTypeEnd="none",v.endLabelLeft="",v.endLabelRight="",v.startLabelLeft="",v.id=d+"-cyclic-special-1",g.startLabelRight="",g.startLabelLeft="",g.endLabelLeft="",g.endLabelRight="",g.arrowTypeStart="none",g.arrowTypeEnd="none",g.id=d+"-cyclic-special-mid",p.label="",p.startLabelRight="",p.startLabelLeft="",p.arrowTypeStart="none",h.isGroup&&(v.fromCluster=d,p.toCluster=d),p.id=d+"-cyclic-special-2",p.arrowTypeStart="none",n.setEdge(d,c,v,d+"-cyclic-special-0"),n.setEdge(c,f,g,d+"-cyclic-special-1"),n.setEdge(f,d,p,d+"-cyclic-special-2")}else n.setEdge(u.start,u.end,{...u},u.id)}),Ae(n),{graph:n}},"prepareLayoutForDagre"),tt=y(async(e,{element:n,preparedLayout:r})=>{const t=r??Ge(e),a=ze(),o=await Be({element:n,graph:t.graph,diagramType:e.type,id:e.diagramId,parentCluster:void 0,siteConfig:a});return t.measuredLayout=o,o},"measureDagreLayout"),at=y((e,n)=>{var t;const r=(t=n.preparedLayout)==null?void 0:t.measuredLayout;if(!r)throw new Error("runDagreLayoutCore requires measureDagreLayout to run first");return je(r.graph),et(e,r),r},"runDagreLayoutCore"),ot=y((e,{measure:n})=>K(n.graph).map(r=>n.graph.node(r)).filter(Boolean),"getDagrePaintNodes"),it=y((e,n,{measure:r})=>e?r.graph.node(e):void 0,"getDagreEdgeNode"),lt=Fe({prepareLayout:Ge,measureLayout:tt,runLayoutCore:at,paintOptions:{clusterDb:N,getNodes:ot,getEdgeNode:it,skipNode:y((e,{measure:n})=>!n.graph.hasNode(e.id),"skipNode"),isCluster:y((e,{measure:n})=>n.graph.hasNode(e.id)&&(n.graph.children(e.id)??[]).length>0,"isCluster")}});export{et as applyDagreLayoutResult,Xe as getEdgesToRender,tt as measureDagreLayout,Ge as prepareLayoutForDagre,lt as render,at as runDagreLayoutCore};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function J(n){return Math.abs(n=Math.round(n))>=1e21?n.toLocaleString("en").replace(/,/g,""):n.toString(10)}function j(n,t){if(!isFinite(n)||n===0)return null;var e=(n=t?n.toExponential(t-1):n.toExponential()).indexOf("e"),i=n.slice(0,e);return[i.length>1?i[0]+i.slice(2):i,+n.slice(e+1)]}function K(n){return n=j(Math.abs(n)),n?n[1]:NaN}function Q(n,t){return function(e,i){for(var o=e.length,a=[],c=0,h=n[0],M=0;o>0&&h>0&&(M+h+1>i&&(h=Math.max(1,i-M)),a.push(e.substring(o-=h,o+h)),!((M+=h+1)>i));)h=n[c=(c+1)%n.length];return a.reverse().join(t)}}function V(n){return function(t){return t.replace(/[0-9]/g,function(e){return n[+e]})}}var W=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function $(n){if(!(t=W.exec(n)))throw new Error("invalid format: "+n);var t;return new L({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}$.prototype=L.prototype;function L(n){this.fill=n.fill===void 0?" ":n.fill+"",this.align=n.align===void 0?">":n.align+"",this.sign=n.sign===void 0?"-":n.sign+"",this.symbol=n.symbol===void 0?"":n.symbol+"",this.zero=!!n.zero,this.width=n.width===void 0?void 0:+n.width,this.comma=!!n.comma,this.precision=n.precision===void 0?void 0:+n.precision,this.trim=!!n.trim,this.type=n.type===void 0?"":n.type+""}L.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function _(n){n:for(var t=n.length,e=1,i=-1,o;e<t;++e)switch(n[e]){case".":i=o=e;break;case"0":i===0&&(i=e),o=e;break;default:if(!+n[e])break n;i>0&&(i=0);break}return i>0?n.slice(0,i)+n.slice(o+1):n}var N;function v(n,t){var e=j(n,t);if(!e)return N=void 0,n.toPrecision(t);var i=e[0],o=e[1],a=o-(N=Math.max(-8,Math.min(8,Math.floor(o/3)))*3)+1,c=i.length;return a===c?i:a>c?i+new Array(a-c+1).join("0"):a>0?i.slice(0,a)+"."+i.slice(a):"0."+new Array(1-a).join("0")+j(n,Math.max(0,t+a-1))[0]}function X(n,t){var e=j(n,t);if(!e)return n+"";var i=e[0],o=e[1];return o<0?"0."+new Array(-o).join("0")+i:i.length>o+1?i.slice(0,o+1)+"."+i.slice(o+1):i+new Array(o-i.length+2).join("0")}const O={"%":(n,t)=>(n*100).toFixed(t),b:n=>Math.round(n).toString(2),c:n=>n+"",d:J,e:(n,t)=>n.toExponential(t),f:(n,t)=>n.toFixed(t),g:(n,t)=>n.toPrecision(t),o:n=>Math.round(n).toString(8),p:(n,t)=>X(n*100,t),r:X,s:v,X:n=>Math.round(n).toString(16).toUpperCase(),x:n=>Math.round(n).toString(16)};function R(n){return n}var U=Array.prototype.map,Y=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function nn(n){var t=n.grouping===void 0||n.thousands===void 0?R:Q(U.call(n.grouping,Number),n.thousands+""),e=n.currency===void 0?"":n.currency[0]+"",i=n.currency===void 0?"":n.currency[1]+"",o=n.decimal===void 0?".":n.decimal+"",a=n.numerals===void 0?R:V(U.call(n.numerals,String)),c=n.percent===void 0?"%":n.percent+"",h=n.minus===void 0?"−":n.minus+"",M=n.nan===void 0?"NaN":n.nan+"";function T(f,g){f=$(f);var b=f.fill,p=f.align,m=f.sign,w=f.symbol,S=f.zero,E=f.width,F=f.comma,y=f.precision,C=f.trim,d=f.type;d==="n"?(F=!0,d="g"):O[d]||(y===void 0&&(y=12),C=!0,d="g"),(S||b==="0"&&p==="=")&&(S=!0,b="0",p="=");var q=(g&&g.prefix!==void 0?g.prefix:"")+(w==="$"?e:w==="#"&&/[boxX]/.test(d)?"0"+d.toLowerCase():""),B=(w==="$"?i:/[%p]/.test(d)?c:"")+(g&&g.suffix!==void 0?g.suffix:""),D=O[d],H=/[defgprs%]/.test(d);y=y===void 0?6:/[gprs]/.test(d)?Math.max(1,Math.min(21,y)):Math.max(0,Math.min(20,y));function G(r){var l=q,u=B,x,I,k;if(d==="c")u=D(r)+u,r="";else{r=+r;var P=r<0||1/r<0;if(r=isNaN(r)?M:D(Math.abs(r),y),C&&(r=_(r)),P&&+r==0&&m!=="+"&&(P=!1),l=(P?m==="("?m:h:m==="-"||m==="("?"":m)+l,u=(d==="s"&&!isNaN(r)&&N!==void 0?Y[8+N/3]:"")+u+(P&&m==="("?")":""),H){for(x=-1,I=r.length;++x<I;)if(k=r.charCodeAt(x),48>k||k>57){u=(k===46?o+r.slice(x+1):r.slice(x))+u,r=r.slice(0,x);break}}}F&&!S&&(r=t(r,1/0));var z=l.length+r.length+u.length,s=z<E?new Array(E-z+1).join(b):"";switch(F&&S&&(r=t(s+r,s.length?E-u.length:1/0),s=""),p){case"<":r=l+r+u+s;break;case"=":r=l+s+r+u;break;case"^":r=s.slice(0,z=s.length>>1)+l+r+u+s.slice(z);break;default:r=s+l+r+u;break}return a(r)}return G.toString=function(){return f+""},G}function Z(f,g){var b=Math.max(-8,Math.min(8,Math.floor(K(g)/3)))*3,p=Math.pow(10,-b),m=T((f=$(f),f.type="f",f),{suffix:Y[8+b/3]});return function(w){return m(p*w)}}return{format:T,formatPrefix:Z}}var A,tn,rn;en({thousands:",",grouping:[3],currency:["$",""]});function en(n){return A=nn(n),tn=A.format,rn=A.formatPrefix,A}export{rn as a,tn as b,K as e,$ as f};
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
import{g as k1}from"./chunk-5VM5RSS4-DTtnT10M.js";import{g as E1}from"./chunk-XXDRQBXY-DKObcU_j.js";import{s as C1}from"./chunk-WEXAMYUT-aMK135IE.js";import{_ as k,o as t1,l as le,c as Ce,p as S1,r as x1,u as Gt,b as T1,s as D1,q as v1,a as _1,g as F1,t as V1,m as I1,v as s1,J as i1,x as L1,y as wt,k as Ot,z as B1,A as M1,B as y1,C as N1,D as R1,E as w1,F as O1,G as P1}from"./index-DNSP9H_v.js";import{c as G1}from"./chunk-GWA4HPMP-CapkHNd2.js";import{c as U1}from"./channel-D3CmON_0.js";import"./vue-BhwNxZ68.js";import"./element-plus-IBMLLhb-.js";var tt={SHAPE_UNSUPPORTED:"SHAPE_UNSUPPORTED",SHAPE_REMOVED:"SHAPE_REMOVED",EDGE_OPERATOR_UNSUPPORTED:"EDGE_OPERATOR_UNSUPPORTED",REFERENCE_EDGE_LABEL_REJECTED:"REFERENCE_EDGE_LABEL_REJECTED",CONNECTOR_REF_UNRESOLVED:"CONNECTOR_REF_UNRESOLVED",CONNECTOR_REF_NOT_A_CONNECTOR:"CONNECTOR_REF_NOT_A_CONNECTOR",METADATA_KEY_MISAPPLIED:"METADATA_KEY_MISAPPLIED",DUPLICATE_ID_NODE:"DUPLICATE_ID_NODE",RESERVED_SYNTHETIC_ID:"RESERVED_SYNTHETIC_ID",CONTAINMENT_VIOLATION:"CONTAINMENT_VIOLATION",EDGE_SEMANTIC_CONTRADICTION:"EDGE_SEMANTIC_CONTRADICTION",FLOW_NO_INPUT:"FLOW_NO_INPUT"},z1=new Set([tt.SHAPE_UNSUPPORTED,tt.SHAPE_REMOVED,tt.CONTAINMENT_VIOLATION]);new Set(Object.values(tt).filter(s=>!z1.has(s)));var W1=new Map([["task","roundedRect"],["tool","subroutine"],["input","lean-right"],["decision","diamond"],["refdoc","lin-doc"],["action","hexagon"],["round","rect"]]),K1=new Set(["doc","stadium","terminal","circle","trapezoid","inv_trapezoid","inv-trapezoid","doublecircle","double-circle","typeDeclaration","procs","lean_left","lean-left","in-out","cylinder","ellipse","odd","tag-rect","tagged-rectangle","delay","half-rounded-rectangle","lin-rect","lined-rectangle","win-pane","window-pane","curv-trap","curved-trapezoid"]),H1=new Set(["roundedRect","subroutine","subprocess","subproc","framed-rectangle","lean-right","diamond","lin-doc","lined-document","hexagon","hex","connector","collapsedGroup"]),$e="roundedRect";function et(s){return s&&(W1.get(s)??s)}k(et,"resolveShapeAlias");function r1(s,i){for(const n of s)if(!n.isGroup){if((!n.shape||n.shape==="squareRect"||n.shape==="rect")&&(n.shape=$e),K1.has(n.shape)){const r=`shape "${n.shape}" was removed in v0.8.1, using "${$e}"`;i!=null&&i.emitError?i.emitError("SHAPE_REMOVED",r,{nodeId:n.id}):le.warn(`agentflow: ${r}`),n.shape=$e;continue}if(!H1.has(n.shape)){const r=`shape "${n.shape}" is not supported, using "${$e}"`;i!=null&&i.emitWarning?i.emitWarning("SHAPE_UNSUPPORTED",r,{nodeId:n.id}):le.warn(`agentflow: ${r}`),n.shape=$e}}}k(r1,"normaliseNodeShapes");var Lt=new Map([["tool",0],["task",1],["decision",2],["input",3],["refdoc",4],["connector",5],["action",6]]),a1=Lt.size,o1=k(s=>`af-kind-${s}`,"kindClass"),Y1=[...Lt.keys()],u1=k(s=>Math.max(1,s-a1),"containerSlotCount"),l1=k((s,i)=>{const n=a1+s%u1(i);return i>0?n%i:n},"containerSlot");function c1(s,i,n){var c;const r=(c=Ce().themeVariables)==null?void 0:c.borderColorArray,o=Array.isArray(r)?r.length:0;let u=n.size;for(const a of s??[]){if(a.isGroup||a.shape==="collapsedGroup"){const f=n.get(String(a.id))??u++;a.colorIndex=l1(f,o);continue}const d=i(String(a.id));d&&Lt.has(d)&&(a.cssClasses=`${a.cssClasses??""} ${o1(d)}`.replace(/\s+/g," ").trim())}}k(c1,"assignColorSlots");var n1="agentflow-",Pt=new Set(["shape","view","icon","img","form","pos","w","h","class","style","labelType"]),j1=new Set(["subroutine","subprocess","subproc","framed-rectangle","tool"]),q1={flow:"flowGroup"};function It(s){if(Array.isArray(s))return s.map(n=>It(n));if(s===null||typeof s!="object")return s;const i={};for(const n of Object.keys(s))n==="__proto__"||n==="constructor"||n==="prototype"||(i[n]=It(s[n]));return i}k(It,"stripPrototypeKeys");function d1(s){let i=!1,n=!1,r=0,o;const u=[];for(const c of s.split(`
|
|
2
|
+
`)){if(o!==void 0){const h=c.length-c.trimStart().length;if(c.trim()===""||h>o){u.push(c);continue}o=void 0}let a=-1;for(let h=0;h<c.length;h++){const b=c[h];if(n)b==="\\"?h++:b==='"'&&(n=!1);else if(i)b==="'"&&(i=!1);else if(b==='"')n=!0;else if(b==="'")i=!0;else if(b==="#"&&(h===0||c[h-1]===" "||c[h-1]===" ")){a=h;break}else b==="["||b==="{"?r++:(b==="]"||b==="}")&&(r=Math.max(0,r-1))}if(i||n||r>0){u.push(c);continue}const d=a>=0?c.slice(0,a):c,f=a>=0?c.slice(a):"";if(/:\s*[>|][\d+-]*\s*$/.test(d)){o=c.length-c.trimStart().length,u.push(c);continue}u.push(d.replace(/,([\t ]*)$/,"$1")+f)}return u.join(`
|
|
3
|
+
`)}k(d1,"stripLineTrailingCommas");var Ze,X1=(Ze=class{constructor(){this.vertexCounter=0,this.config=Ce(),this.vertices=new Map,this.edges=[],this.classes=new Map,this.subGraphs=[],this.subGraphLookup=new Map,this.globalNodes=new Set,this.connectors=new Map,this.tooltips=new Map,this.subCount=0,this.firstGraphFlag=!0,this.secCount=-1,this.posCrossRef=[],this.diagramId="",this.preserveCommentsWhenParsing=!0,this.frontmatterLineOffset=0,this.elementMappings=[],this.bareVertexMappings=new WeakSet,this.diagnostics=[],this.postParseValidationRun=!1,this.funs=[],this.setAccTitle=T1,this.setAccDescription=D1,this.setDiagramTitle=v1,this.getAccTitle=_1,this.getAccDescription=F1,this.getDiagramTitle=V1,this.funs.push(this.setupToolTips.bind(this)),this.addVertex=this.addVertex.bind(this),this.firstGraph=this.firstGraph.bind(this),this.setDirection=this.setDirection.bind(this),this.addSubGraph=this.addSubGraph.bind(this),this.addGlobal=this.addGlobal.bind(this),this.addConnector=this.addConnector.bind(this),this.addConnectorMapping=this.addConnectorMapping.bind(this),this.addLink=this.addLink.bind(this),this.setLink=this.setLink.bind(this),this.updateLink=this.updateLink.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.destructLink=this.destructLink.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setTooltip=this.setTooltip.bind(this),this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this),this.setClickFun=this.setClickFun.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.setFrontmatterLineOffset=this.setFrontmatterLineOffset.bind(this),this.addVertexMapping=this.addVertexMapping.bind(this),this.extendVertexMapping=this.extendVertexMapping.bind(this),this.addEdgeMapping=this.addEdgeMapping.bind(this),this.addSubgraphMapping=this.addSubgraphMapping.bind(this),this.emitWarning=this.emitWarning.bind(this),this.emitError=this.emitError.bind(this),this.getDiagnostics=this.getDiagnostics.bind(this),this.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen("gen-2")}sanitizeText(i){return I1.sanitizeText(i,this.config)}sanitizeNodeLabelType(i){switch(i){case"markdown":case"string":case"text":return i;default:return"markdown"}}setDiagramId(i){this.diagramId=i}lookUpDomId(i){for(const n of this.vertices.values())if(n.id===i)return this.diagramId?`${this.diagramId}-${n.domId}`:n.domId;return this.diagramId?`${this.diagramId}-${i}`:i}addVertex(i,n,r,o,u,c,a={},d,f){if(!i||i.trim().length===0)return;let h;if(d!==void 0){let g;d.includes(`
|
|
4
|
+
`)?g=d+`
|
|
5
|
+
`:g=`{
|
|
6
|
+
`+d+`
|
|
7
|
+
}`;try{h=s1(g,{schema:i1})??{}}catch(T){const y=d.includes(`
|
|
8
|
+
`)?d1(d):d;if(y!==d)try{h=s1(y+`
|
|
9
|
+
`,{schema:i1})??{}}catch{this.rethrowMetadataYamlError(T,d,f)}else this.rethrowMetadataYamlError(T,d,f)}h=It(h)}let b;if(h&&typeof h.shape=="string"){const g=h;b=g.shape;const T=et(b);T&&T!==b&&(g.shape=T)}const C=this.subGraphLookup.get(i);if(C&&h){C.metadata={...C.metadata,...h};return}const L=this.connectors.get(i);if(L&&h){L.metadata={...L.metadata,...h};return}if(i==="connectors")return;const M=this.edges.find(g=>g.id===i);if(M){const g=h;(g==null?void 0:g.animate)!==void 0&&(M.animate=g.animate),(g==null?void 0:g.animation)!==void 0&&(M.animation=g.animation),(g==null?void 0:g.curve)!==void 0&&(M.interpolate=g.curve),h&&(M.metadata={...M.metadata,...h});return}let D,x=this.vertices.get(i);if(x===void 0&&(x={id:i,labelType:"text",domId:n1+i+"-"+this.vertexCounter,styles:[],classes:[]},this.vertices.set(i,x)),this.vertexCounter++,n!==void 0?(this.config=Ce(),D=this.sanitizeText(n.text.trim()),x.labelType=n.type,D.startsWith('"')&&D.endsWith('"')&&(D=D.substring(1,D.length-1)),x.text=D):x.text===void 0&&(x.text=i),r!==void 0&&(x.type=r),o!=null&&o.forEach(g=>{x.styles.push(g)}),u!=null&&u.forEach(g=>{x.classes.push(g)}),c!==void 0&&(x.dir=c),x.props===void 0?x.props=a:a!==void 0&&Object.assign(x.props,a),h){if(x.metadata={...x.metadata,...h},h.shape){const g=b??h.shape;if(typeof g!="string")throw this.positionedShapeError(`No such shape: ${JSON.stringify(g)}.`,f);if(g!==g.toLowerCase()||g.includes("_"))throw this.positionedShapeError(`No such shape: ${g}. Shape names should be lowercase.`,f);if(!L1(h.shape))throw this.positionedShapeError(`No such shape: ${h.shape}.`,f);x.type=h==null?void 0:h.shape}h!=null&&h.label&&(x.text=this.sanitizeText(h.label),x.labelType=this.sanitizeNodeLabelType(h==null?void 0:h.labelType))}}positionedShapeError(i,n){const r=new Error(i);if(!n)return r;const o=n.first_line+this.frontmatterLineOffset;return Object.assign(r,{hash:{text:"",token:null,line:o-1,loc:{first_line:o,last_line:n.last_line+this.frontmatterLineOffset,first_column:n.first_column,last_column:n.last_column},expected:[]}}),r}rethrowMetadataYamlError(i,n,r){const o=i;if(!o||o.name!=="YAMLException"||!o.mark||!r)throw i;let u;try{const c=!n.includes(`
|
|
10
|
+
`),a=c?`{
|
|
11
|
+
`+n+`
|
|
12
|
+
}`:n+`
|
|
13
|
+
`,d=r.first_line+this.frontmatterLineOffset,f=r.first_column+2,h=k((g,T)=>c?{line:d,column:f+(g===1?T:0)}:{line:d+g,column:g===0?f+T:T},"toSource"),b=h(o.mark.line,o.mark.column),C=o.reason??(o.message??"").split(`
|
|
14
|
+
`)[0].replace(/\s*\(\d+:\d+\)\s*$/,""),L=a.split(`
|
|
15
|
+
`),M=[];if(c)M.push(1);else for(let g=o.mark.line-1;g<=o.mark.line+1;g++)g<0||g>=L.length||g===L.length-1&&L[g]===""&&g!==o.mark.line||M.push(g);const D=Math.max(...M.map(g=>String(h(g,0).line).length)),x=[];for(const g of M){const T=h(g,0).line,y=` ${String(T).padStart(D)} | `;x.push(y+L[g].replace(/\t/g,"→")),g===o.mark.line&&x.push("-".repeat(y.length+o.mark.column)+"^")}u={message:`${C} (${b.line}:${b.column+1})
|
|
16
|
+
|
|
17
|
+
${x.join(`
|
|
18
|
+
`)}`,markLine:b.line-1,markColumn:b.column,hash:{text:"",token:null,line:b.line-1,loc:{first_line:b.line,last_line:b.line,first_column:b.column,last_column:b.column+1},expected:[]}}}catch{}throw u&&(o.message=u.message,o.mark.line=u.markLine,o.mark.column=u.markColumn,o.hash=u.hash),o}addSingleLink(i,n,r,o){const a={start:i,end:n,type:void 0,text:"",labelType:"text",classes:[],isUserDefinedId:!1,interpolate:this.edges.defaultInterpolate};le.info("abc78 Got edge...",a);const d=r.text;if(d!==void 0&&(a.text=this.sanitizeText(d.text.trim()),a.text.startsWith('"')&&a.text.endsWith('"')&&(a.text=a.text.substring(1,a.text.length-1)),a.labelType=this.sanitizeNodeLabelType(d.type)),r!==void 0&&(a.type=r.type,a.stroke=r.stroke,a.length=r.length>10?10:r.length,r.edgeSemantic&&(a.edgeSemantic=r.edgeSemantic)),o&&!this.edges.some(f=>f.id===o))a.id=o,a.isUserDefinedId=!0;else{const f=this.edges.filter(h=>h.start===a.start&&h.end===a.end);f.length===0?a.id=wt(a.start,a.end,{counter:0,prefix:"L"}):a.id=wt(a.start,a.end,{counter:f.length+1,prefix:"L"})}if(this.edges.length<(this.config.maxEdges??500))le.info("Pushing edge..."),this.edges.push(a);else throw new Error(`Edge limit exceeded. ${this.edges.length} edges found, but the limit is ${this.config.maxEdges}.
|
|
19
|
+
|
|
20
|
+
Initialize mermaid with maxEdges set to a higher number to allow more edges.
|
|
21
|
+
You cannot set this config via configuration inside the diagram as it is a secure config.
|
|
22
|
+
You have to call mermaid.initialize.`)}isLinkData(i){return i!==null&&typeof i=="object"&&"id"in i&&typeof i.id=="string"}addLink(i,n,r){const o=this.isLinkData(r)?r.id.replace("@",""):void 0;le.info("addLink",i,n,o);for(const u of i)for(const c of n){const a=u===i[i.length-1],d=c===n[0];a&&d?this.addSingleLink(u,c,r,o):this.addSingleLink(u,c,r,void 0)}}updateLinkInterpolate(i,n){i.forEach(r=>{if(r==="default"){this.edges.defaultInterpolate=n;return}if(typeof r=="number"&&r>=this.edges.length)throw new Error(`The index ${r} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${this.edges.length-1}. (Help: Ensure that the index is within the range of existing edges.)`);this.edges[r].interpolate=n})}updateLink(i,n){i.forEach(r=>{var o,u,c,a,d,f;if(typeof r=="number"&&r>=this.edges.length)throw new Error(`The index ${r} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${this.edges.length-1}. (Help: Ensure that the index is within the range of existing edges.)`);r==="default"?this.edges.defaultStyle=n:(this.edges[r].style=n,(((u=(o=this.edges[r])==null?void 0:o.style)==null?void 0:u.length)??0)>0&&!((a=(c=this.edges[r])==null?void 0:c.style)!=null&&a.some(h=>h==null?void 0:h.startsWith("fill")))&&((f=(d=this.edges[r])==null?void 0:d.style)==null||f.push("fill:none")))})}addClass(i,n){const r=n.join().replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");i.split(",").forEach(o=>{let u=this.classes.get(o);u===void 0&&(u={id:o,styles:[],textStyles:[]},this.classes.set(o,u)),r!=null&&r.forEach(c=>{if(/color/.exec(c)){const a=c.replace("fill","bgFill");u.textStyles.push(a)}u.styles.push(c)})})}setDirection(i){this.direction=i.trim(),/.*</.exec(this.direction)&&(this.direction="RL"),/.*\^/.exec(this.direction)&&(this.direction="BT"),/.*>/.exec(this.direction)&&(this.direction="LR"),/.*v/.exec(this.direction)&&(this.direction="TB"),this.direction==="TD"&&(this.direction="TB")}setClass(i,n){for(const r of i.split(",")){const o=this.vertices.get(r);o&&o.classes.push(n);const u=this.edges.find(a=>a.id===r);u&&u.classes.push(n);const c=this.subGraphLookup.get(r);c&&c.classes.push(n)}}setTooltip(i,n){if(n!==void 0){n=this.sanitizeText(n);for(const r of i.split(","))this.tooltips.set(this.version==="gen-1"?this.lookUpDomId(r):r,n)}}setClickFun(i,n,r){if(Ce().securityLevel!=="loose"||n===void 0)return;let o=[];if(typeof r=="string"){o=r.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let c=0;c<o.length;c++){let a=o[c].trim();a.startsWith('"')&&a.endsWith('"')&&(a=a.substr(1,a.length-2)),o[c]=a}}o.length===0&&o.push(i);const u=this.vertices.get(i);u&&(u.haveCallback=!0,this.funs.push(()=>{const c=this.lookUpDomId(i),a=document.querySelector(`[id="${c}"]`);a!==null&&a.addEventListener("click",()=>{Gt.runFunc(n,...o)},!1)}))}setLink(i,n,r){i.split(",").forEach(o=>{const u=this.vertices.get(o);u!==void 0&&(u.link=Gt.formatUrl(n,this.config),u.linkTarget=r)}),this.setClass(i,"clickable")}getTooltip(i){return this.tooltips.get(i)}setClickEvent(i,n,r){i.split(",").forEach(o=>{this.setClickFun(o,n,r)}),this.setClass(i,"clickable")}bindFunctions(i){this.funs.forEach(n=>{n(i)})}getDirection(){var i;return(i=this.direction)==null?void 0:i.trim()}getVertices(){return this.vertices}getEdges(){return this.edges}isToolDefinition(i){return j1.has(i.type)}getTools(){const i=[];for(const n of this.vertices.values())this.isToolDefinition(n)&&i.push(n);return i}getClasses(){return this.classes}setupToolTips(i){const n=G1();Ot(i).select("svg").selectAll("g.node").on("mouseover",u=>{var f;const c=Ot(u.currentTarget),a=c.attr("title");if(a===null)return;const d=(f=u.currentTarget)==null?void 0:f.getBoundingClientRect();n.transition().duration(200).style("opacity",".9"),n.text(c.attr("title")).style("left",window.scrollX+d.left+(d.right-d.left)/2+"px").style("top",window.scrollY+d.bottom+"px"),n.html(B1.sanitize(a)),c.classed("hover",!0)}).on("mouseout",u=>{n.transition().duration(500).style("opacity",0),Ot(u.currentTarget).classed("hover",!1)})}clear(i="gen-2"){this.vertices=new Map,this.classes=new Map,this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.subGraphs=[],this.subGraphLookup=new Map,this.globalNodes=new Set,this.connectors=new Map,this.subCount=0,this.tooltips=new Map,this.firstGraphFlag=!0,this.version=i,this.config=Ce(),this.diagramId="",this.vertexCounter=0,this.direction=void 0,this.secCount=-1,this.posCrossRef=[],this.frontmatterLineOffset=0,this.elementMappings=[],this.bareVertexMappings=new WeakSet,this.diagnostics=[],this.postParseValidationRun=!1,M1()}setGen(i){this.version=i||"gen-2"}defaultStyle(){return"fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;"}addSubGraph(i,n,r,o){var M;let u=(M=i==null?void 0:i.text)==null?void 0:M.trim(),c=r==null?void 0:r.text;i===r&&(r!=null&&r.text)&&/\s/.exec(r.text)&&(u=void 0);const d=k(D=>{const x={boolean:{},number:{},string:{}},g=[];let T;return{nodeList:D.filter(function(p){const m=typeof p;return p.stmt&&p.stmt==="dir"?(T=p.value,!1):p.trim()===""?!1:m in x?x[m].hasOwnProperty(p)?!1:x[m][p]=!0:g.includes(p)?!1:g.push(p)}),dir:T}},"uniq")(n.flat()),f=d.nodeList;let h=d.dir;const b=Ce().flowchart??{};if(h=h??(b.inheritDir?this.getDirection()??Ce().direction??void 0:void 0),this.version==="gen-1")for(let D=0;D<f.length;D++)f[D]=this.lookUpDomId(f[D]);u=u??"subGraph"+this.subCount,c=c||"",c=this.sanitizeText(c),this.subCount=this.subCount+1;const C={id:u,nodes:f.filter(D=>D!==u&&!this.globalNodes.has(D)),title:c.trim(),classes:[],dir:h,labelType:this.sanitizeNodeLabelType(r==null?void 0:r.type),type:o??"flow"};le.info("Adding",C.id,C.nodes,C.dir),C.nodes=this.makeUniq(C,this.subGraphs).nodes;const L=this.getPosForId(u);if(L!==-1){const D=this.subGraphs[L];for(const x of C.nodes)D.nodes.includes(x)||D.nodes.push(x);C.title&&(D.title=C.title),C.dir&&(D.dir=C.dir),C.type&&(D.type=C.type),this.subGraphLookup.set(u,D)}else this.subGraphs.push(C),this.subGraphLookup.set(u,C);return u}addGlobal(i){for(const n of i.flat()){if(typeof n!="string")continue;const r=n.trim();r!==""&&this.globalNodes.add(r)}for(const n of this.subGraphs)n.nodes=n.nodes.filter(r=>!this.globalNodes.has(r))}getPosForId(i){for(const[n,r]of this.subGraphs.entries())if(r.id===i)return n;return-1}indexNodes2(i,n){const r=this.subGraphs[n].nodes;if(this.secCount=this.secCount+1,this.secCount>2e3)return{result:!1,count:0};if(this.posCrossRef[this.secCount]=n,this.subGraphs[n].id===i)return{result:!0,count:0};let o=0,u=1;for(;o<r.length;){const c=this.getPosForId(r[o]);if(c>=0){const a=this.indexNodes2(i,c);if(a.result)return{result:!0,count:u+a.count};u=u+a.count}o=o+1}return{result:!1,count:u}}getDepthFirstPos(i){return this.posCrossRef[i]}indexNodes(){this.secCount=-1,this.subGraphs.length>0&&this.indexNodes2("none",this.subGraphs.length-1)}addConnector(i,n){var a,d;const r=(a=i==null?void 0:i.text)==null?void 0:a.trim();if(!r)return"";const o=((d=n==null?void 0:n.text)==null?void 0:d.trim())??"",u=o.length>0?this.sanitizeText(o):r;let c=this.connectors.get(r);return c?o.length>0&&(c.text=u):(c={id:r,labelType:"text",domId:n1+r+"-"+this.vertexCounter,styles:[],classes:[],isConnector:!0,text:u},this.connectors.set(r,c),this.vertices.set(r,c),this.vertexCounter++),r}getSubGraphs(){return this.subGraphs}getConnectors(){return[...this.connectors.values()]}firstGraph(){return this.firstGraphFlag?(this.firstGraphFlag=!1,!0):!1}computeEdgeSemantic(i,n){if(i==="arrow_point"&&n==="normal")return"sequence";if(i==="arrow_cross"&&n==="normal")return"failure";if(i==="arrow_open"&&n==="dotted")return"reference"}destructStartLink(i){const n=i.trim(),r="arrow_open";let o="normal";return n.includes(".")&&(o="dotted"),{type:r,stroke:o}}countChar(i,n){const r=n.length;let o=0;for(let u=0;u<r;++u)n[u]===i&&++o;return o}destructEndLink(i){const n=i.trim();let r=n.slice(0,-1),o="arrow_open";switch(n.slice(-1)){case"x":o="arrow_cross";break;case">":o="arrow_point";break;case"-":case".":o="arrow_open",r=n;break}let u="normal",c=r.length-1;const a=this.countChar(".",r);return a>0&&(u="dotted",c=a),{type:o,stroke:u,length:c}}destructLink(i,n){const r=this.destructEndLink(i);let o;return n?(o=this.destructStartLink(n),o.stroke!==r.stroke?{type:"INVALID",stroke:"INVALID"}:(o.type=r.type,o.length=r.length,{...o,edgeSemantic:this.computeEdgeSemantic(o.type,o.stroke)})):{...r,edgeSemantic:this.computeEdgeSemantic(r.type,r.stroke)}}exists(i,n){for(const r of i)if(r.nodes.includes(n))return!0;return!1}makeUniq(i,n){const r=[];return i.nodes.forEach((o,u)=>{this.exists(n,o)||r.push(i.nodes[u])}),{nodes:r}}getTypeFromVertex(i){const n=typeof i.type=="string"?et(i.type):i.type;switch(n){case"square":case void 0:return"squareRect";case"round":return"roundedRect";case"ellipse":return"ellipse";default:return n}}findNode(i,n){return i.find(r=>r.id===n)}destructEdgeType(i){let n="none",r="arrow_point";switch(i){case"arrow_point":case"arrow_circle":case"arrow_cross":case"arrow_hierarchy":r=i;break;case"double_arrow_point":case"double_arrow_circle":case"double_arrow_cross":n=i.replace("double_",""),r=n;break}return{arrowTypeStart:n,arrowTypeEnd:r}}addNodeFromVertex(i,n,r,o,u,c){var h,b,C;const a=r.get(i.id),d=o.get(i.id)??!1,f=this.findNode(n,i.id);if(f)f.cssStyles=i.styles,f.cssCompiledStyles=this.getCompiledStyles(i.classes),f.cssClasses=i.classes.join(" ");else{const L={id:i.id,label:i.text,labelType:i.labelType,labelStyle:"",parentId:a,padding:((h=u.flowchart)==null?void 0:h.padding)||8,cssStyles:i.styles,cssCompiledStyles:this.getCompiledStyles(["default","node",...i.classes]),cssClasses:"default "+i.classes.join(" "),dir:i.dir,domId:i.domId,look:c,link:i.link,linkTarget:i.linkTarget,tooltip:this.getTooltip(i.id),metadata:i.metadata};d?n.push({...L,isGroup:!0,shape:"rect"}):n.push({...L,isGroup:!1,shape:this.getTypeFromVertex(i),wrappingWidth:(b=u.agentflow)==null?void 0:b.wrappingWidth,minWidth:(C=u.agentflow)==null?void 0:C.minNodeWidth})}}getCompiledStyles(i){let n=[];for(const r of i){const o=this.classes.get(r);o!=null&&o.styles&&(n=[...n,...o.styles??[]].map(u=>u.trim())),o!=null&&o.textStyles&&(n=[...n,...o.textStyles??[]].map(u=>u.trim()))}return n}runPostParseValidators(){this.postParseValidationRun||(this.postParseValidationRun=!0)}getData(){var T,y;this.runPostParseValidators();const i=Ce(),n=[],r=[],o=this.getSubGraphs(),u=new Map,c=new Map,a=new Set,d=new Map,f=k((p,m,R=new Set)=>{if(R.has(p))return;R.add(p);const U=this.subGraphLookup.get(p);if(U)for(const ne of U.nodes)ne===m||R.has(ne)||(a.add(ne),d.set(ne,m),f(ne,m,R))},"collectDescendants");for(const p of o)((T=p.metadata)==null?void 0:T.view)==="collapsed"&&!a.has(p.id)&&f(p.id,p.id);const h=k((p,m)=>{const R=new Set;let U=m;for(;U!==void 0&&!R.has(U);){if(U===p)return!0;R.add(U),U=u.get(U)}return!1},"wouldCloseContainmentCycle");for(let p=o.length-1;p>=0;p--){const m=o[p];if(!a.has(m.id)){m.nodes.length>0&&c.set(m.id,!0);for(const R of m.nodes){if(h(R,m.id)){this.emitWarning(tt.CONTAINMENT_VIOLATION,`Container "${m.id}" cannot contain "${R}" because "${R}" already contains it. The nesting that would close the loop is dropped.`,{nodeId:R});continue}u.set(R,m.id)}}}for(let p=o.length-1;p>=0;p--){const m=o[p];if(a.has(m.id))continue;if(((y=m.metadata)==null?void 0:y.view)==="collapsed"){const U={...m.metadata,containerType:m.type};n.push({id:m.id,label:m.title,labelStyle:"",labelType:m.labelType,parentId:u.get(m.id),padding:8,cssCompiledStyles:this.getCompiledStyles(m.classes),cssClasses:m.classes.join(" "),shape:"collapsedGroup",dir:m.dir,isGroup:!1,look:i.look,metadata:U})}else n.push({id:m.id,label:m.title,labelStyle:"",labelType:m.labelType,parentId:u.get(m.id),padding:8,cssCompiledStyles:this.getCompiledStyles(m.classes),cssClasses:m.classes.join(" "),shape:q1[m.type??"flow"],dir:m.dir,isGroup:!0,look:i.look,metadata:m.metadata})}this.getVertices().forEach(p=>{a.has(p.id)||this.addNodeFromVertex(p,n,u,c,i,i.look||"classic")});const C=this.getEdges();C.forEach((p,m)=>{var P;const R=d.get(p.start)??p.start,U=d.get(p.end)??p.end;if(R===U&&p.start!==p.end)return;const{arrowTypeStart:ne,arrowTypeEnd:z}=this.destructEdgeType(p.type),w=[...C.defaultStyle??[]];p.style&&w.push(...p.style);const W={id:wt(R,U,{counter:m,prefix:"L"},p.id),isUserDefinedId:p.isUserDefinedId,start:R,end:U,type:p.type??"normal",label:p.text,labelType:p.labelType,labelpos:"c",thickness:p.stroke,minlen:p.length,classes:(p==null?void 0:p.stroke)==="invisible"?"":"edge-thickness-normal edge-pattern-solid flowchart-link",arrowTypeStart:(p==null?void 0:p.stroke)==="invisible"||(p==null?void 0:p.type)==="arrow_open"?"none":ne,arrowTypeEnd:(p==null?void 0:p.stroke)==="invisible"||(p==null?void 0:p.type)==="arrow_open"?"none":z,arrowheadStyle:"fill: #333",cssCompiledStyles:this.getCompiledStyles(p.classes),labelStyle:w,style:w,pattern:p.stroke,look:i.look,animate:p.animate,animation:p.animation,curve:p.interpolate||this.edges.defaultInterpolate||((P=i.flowchart)==null?void 0:P.curve),metadata:p.metadata};r.push(W)}),r1(n,this);const L=new Map,M=new Map;for(const p of o){const m=u.get(p.id);m!==void 0&&M.set(m,[...M.get(m)??[],p.id])}let D=0;const x=k(p=>{if(!L.has(p)){L.set(p,D++);for(const m of M.get(p)??[])x(m)}},"walkContainers");for(const p of o)u.get(p.id)===void 0&&x(p.id);const g=new Set(this.getConnectors().map(p=>p.id));return c1(n,p=>{if(g.has(p))return"connector";const m=this.vertices.get(p);return m?this.deriveVertexKind(m,et(m.type)):void 0},L),{nodes:n,edges:r,other:{},config:i,connectors:this.getConnectors()}}defaultConfig(){return y1.flowchart}deriveVertexKind(i,n){return this.isToolDefinition(i)?"tool":n==="hexagon"||n==="hex"?"action":n==="lean-right"||n==="lean_right"?"input":n==="lin-doc"||n==="lined-document"?"refdoc":n==="diamond"?"decision":"task"}getSemanticModel(){this.runPostParseValidators();const i=new Set(this.subGraphs.map(a=>a.id)),n=[],r=[];for(const[a,d]of this.vertices){if(i.has(a))continue;if(d.isConnector){const b={id:a};if(d.text!==void 0&&d.text!==a&&(b.title=d.text),d.metadata&&Object.keys(d.metadata).length>0){const C={};for(const[L,M]of Object.entries(d.metadata))Pt.has(L)||(C[L]=M);Object.keys(C).length>0&&(b.metadata=C)}r.push(b);continue}const f={id:a};d.text!==void 0&&(f.label=d.text);const h=typeof d.type=="string"?et(d.type):d.type;if(h!==void 0&&(f.shape=h),f.vertexKind=this.deriveVertexKind(d,h),d.metadata&&Object.keys(d.metadata).length>0){const b={};for(const[C,L]of Object.entries(d.metadata))Pt.has(C)||(b[C]=L);Object.keys(b).length>0&&(f.metadata=b)}n.push(f)}const o=this.edges.map(a=>{const d={start:a.start,end:a.end};return a.id!==void 0&&(d.id=a.id),typeof a.text=="string"&&a.text.length>0&&(d.label=a.text),a.type!==void 0&&(d.type=a.type),a.stroke!==void 0&&(d.stroke=a.stroke),a.edgeSemantic!==void 0&&(d.edgeSemantic=a.edgeSemantic),a.length!==void 0&&(d.length=a.length),a.metadata&&Object.keys(a.metadata).length>0&&(d.metadata={...a.metadata}),d}),u=this.subGraphs.map(a=>{const d={id:a.id,nodes:[...a.nodes]};if(a.type!==void 0&&(d.type=a.type),a.title!==void 0&&(d.title=a.title),a.dir!==void 0&&(d.direction=a.dir),a.metadata&&Object.keys(a.metadata).length>0){const f={};for(const[h,b]of Object.entries(a.metadata))Pt.has(h)||(f[h]=b);Object.keys(f).length>0&&(d.metadata=f)}return d}),c={vertices:n,edges:o,subGraphs:u,connectors:r,diagnostics:this.diagnostics};return this.direction!==void 0&&(c.direction=this.direction),c}setFrontmatterLineOffset(i){this.frontmatterLineOffset=i??0}toElementPosition(i){const n=(i==null?void 0:i.first_line)??0,r=(i==null?void 0:i.first_column)??0,o=(i==null?void 0:i.last_line)??n,u=(i==null?void 0:i.last_column)??r,[c,a]=(i==null?void 0:i.range)??[0,0];return{startLine:n+this.frontmatterLineOffset,startColumn:r,endLine:o+this.frontmatterLineOffset,endColumn:u,startIndex:c,endIndex:a}}pushMapping(i,n,r){if(!i)return;const o={id:i,type:n,position:this.toElementPosition(r)};return this.elementMappings.push(o),o}addVertexMapping(i,n,r,o){const u=this.pushMapping(i,"vertex",o);u&&r==null&&this.bareVertexMappings.add(u)}extendVertexMapping(i,n){if(!i||!n)return;const r=this.toElementPosition(n);for(let o=this.elementMappings.length-1;o>=0;o--){const u=this.elementMappings[o];if(u.type==="vertex"&&u.id===i){this.bareVertexMappings.has(u)&&(u.type="attachment",this.bareVertexMappings.delete(u)),(r.endLine>u.position.endLine||r.endLine===u.position.endLine&&r.endColumn>u.position.endColumn)&&(u.position.endLine=r.endLine,u.position.endColumn=r.endColumn,u.position.endIndex=r.endIndex);return}}this.pushMapping(i,"attachment",n)}addEdgeMapping(i,n,r,o){const u=Array.isArray(n)?n.map(a=>typeof a=="string"?a:(a==null?void 0:a.id)??"").filter(Boolean):[],c=u.length>0?u.join(">"):"edge";this.pushMapping(c,"edge",o)}addSubgraphMapping(i,n,r,o){const u=(typeof i=="string"?i:i==null?void 0:i.text)??"",c=this.toElementPosition(r),a=o?this.toElementPosition(o):c;u&&this.elementMappings.push({id:u,type:"subgraph",position:{startLine:c.startLine,startColumn:c.startColumn,endLine:a.endLine,endColumn:a.endColumn,startIndex:c.startIndex,endIndex:a.endIndex}})}addConnectorMapping(i,n,r,o){var d;const u=((d=i==null?void 0:i.text)==null?void 0:d.trim())??"";if(!u)return;const c=this.toElementPosition(r),a=o?this.toElementPosition(o):c;this.elementMappings.push({id:u,type:"connector",position:{startLine:c.startLine,startColumn:c.startColumn,endLine:a.endLine,endColumn:a.endColumn,startIndex:c.startIndex,endIndex:a.endIndex}})}getElementMappings(){return[...this.elementMappings]}getElementById(i){return this.elementMappings.find(n=>n.id===i)}getElementsOnLine(i){return this.elementMappings.filter(n=>i>=n.position.startLine&&i<=n.position.endLine)}getElementAtPosition(i,n){const r=this.elementMappings.filter(u=>{const{startLine:c,startColumn:a,endLine:d,endColumn:f}=u.position;return!(i<c||i>d||i===c&&n<a||i===d&&n>f)});if(r.length===0)return;const o=k(({position:u})=>[u.endLine-u.startLine,u.endColumn-u.startColumn],"span");return r.reduce((u,c)=>{const[a,d]=o(u),[f,h]=o(c);return f!==a?f<a?c:u:h<d?c:u})}getMappingStats(){let i=0,n=0,r=0,o=0,u=0;for(const c of this.elementMappings)c.type==="vertex"?i++:c.type==="edge"?n++:c.type==="subgraph"?r++:c.type==="connector"?o++:c.type==="attachment"&&u++;return{vertices:i,edges:n,subgraphs:r,connectors:o,attachments:u,totalElements:this.elementMappings.length}}emitDiagnostic(i,n,r,o){const u=(o==null?void 0:o.nodeId)??(o==null?void 0:o.edgeId),c=u?this.getElementById(u):void 0,a={id:i,severity:n,message:r,...o!=null&&o.nodeId?{nodeId:o.nodeId}:{},...o!=null&&o.edgeId&&!(o!=null&&o.nodeId)?{edgeId:o.edgeId}:{},...c?{position:c.position}:{}};if(this.diagnostics.some(h=>h.id===a.id&&h.severity===a.severity&&h.message===a.message&&h.nodeId===a.nodeId&&h.edgeId===a.edgeId))return;this.diagnostics.push(a);const f=`agentflow[${i}]: ${r}`;n==="error"?le.error(f):le.warn(f)}emitWarning(i,n,r){this.emitDiagnostic(i,"warning",n,r)}emitError(i,n,r){this.emitDiagnostic(i,"error",n,r)}getDiagnostics(){return[...this.diagnostics]}},k(Ze,"AgentFlowDB"),Ze),J1=k(function(s,i){return i.db.getClasses()},"getClasses"),Q1=k(async function(s,i,n,r){le.debug("Drawing agentflow diagram",i);const{securityLevel:o,agentflow:u,layout:c}=Ce();r.db.setDiagramId(i),le.debug("Before getData: ");const a=r.db.getData();le.debug("Data: ",a);const d=E1(i,o),f=r.db.getDirection();a.type=r.type,a.layoutAlgorithm=S1(c),a.layoutAlgorithm==="dagre"&&c==="elk"&&le.warn("flowchart-elk was moved to an external package in Mermaid v11. Please refer [release notes](https://github.com/mermaid-js/mermaid/releases/tag/v11.0.0) for more details. This diagram will be rendered using `dagre` layout as a fallback."),a.direction=f,a.nodeSpacing=(u==null?void 0:u.nodeSpacing)||50,a.rankSpacing=(u==null?void 0:u.rankSpacing)||50,a.markers=["point","circle","cross","hierarchy"],a.diagramId=i,le.debug("REF1:",a),await x1(a,d);const h=(u==null?void 0:u.diagramPadding)??8;Gt.insertTitle(d,"agentflowTitleText",(u==null?void 0:u.titleTopMargin)??0,r.db.getDiagramTitle()),C1(d,h,"agentflow",(u==null?void 0:u.useMaxWidth)??!0)},"draw"),Z1={getClasses:J1,draw:Q1},Ut=(function(){var s=k(function(Te,A,E,S){for(E=E||{},S=Te.length;S--;E[Te[S]]=A);return E},"o"),i=[1,5],n=[1,4],r=[1,3],o=[1,6],u=[1,8,9,10,11,12,28,35,36,38,40,42,47,63,87,88,89,90,91,92,105,108,109,112,114,117,118,119,124,125,126,127,128],c=[2,2],a=[1,15],d=[1,16],f=[1,17],h=[1,18],b=[1,19],C=[1,26],L=[1,27],M=[1,28],D=[1,30],x=[1,31],g=[1,32],T=[1,55],y=[1,54],p=[1,34],m=[1,35],R=[1,36],U=[1,37],ne=[1,38],z=[1,50],w=[1,52],W=[1,48],P=[1,53],H=[1,49],Y=[1,56],j=[1,51],q=[1,57],X=[1,58],De=[1,39],ve=[1,40],_e=[1,41],Fe=[1,42],Ve=[1,43],Se=[1,64],v=[1,8,9,10,11,12,28,33,35,36,38,40,42,47,63,87,88,89,90,91,92,105,108,109,112,114,117,118,119,124,125,126,127,128],ee=[1,70],te=[1,68],se=[1,67],ie=[1,69],Me=[8,9,10,12,78,80,81],ye=[1,88],Ne=[1,101],Re=[1,106],we=[1,105],Oe=[1,102],Pe=[1,98],Ge=[1,104],Ue=[1,100],ze=[1,107],We=[1,103],Ke=[1,108],He=[1,99],Ie=[8,9,10,11,12,43,78,80,81],Q=[8,9,10,11,12,43,49,78,80,81],ae=[8,9,10,11,12,30,43,47,49,51,53,55,57,59,61,63,66,68,70,71,73,78,80,81,92,105,108,109,112,114,117,118,119],zt=[8,9,10,12,47,63,78,80,81,92,105,108,109,112,114,117,118,119],Ye=[47,63,92,105,108,109,112,114,117,118,119],Wt=[1,131],Kt=[1,132],st=[1,134],it=[1,133],Ht=[47,63,65,77,92,105,108,109,112,114,117,118,119],nt=[1,143],rt=[1,157],at=[1,158],ot=[1,159],ut=[1,162],lt=[1,161],ct=[1,160],dt=[1,145],ht=[1,147],pt=[1,151],Yt=[1,139],jt=[1,140],ft=[1,152],gt=[1,153],mt=[1,154],bt=[1,155],At=[1,156],kt=[1,163],Et=[1,164],Ct=[1,141],St=[1,142],xt=[1,149],Tt=[1,144],Dt=[1,148],vt=[1,146],je=[8,9,10,11,12,28,33,35,36,38,40,42,47,63,87,88,89,90,91,92,105,108,109,112,114,117,118,119,124,125,126,127,128],qt=[1,168],qe=[1,170],K=[8,9,10,12],oe=[8,9,10,11,12,15,47,63,92,108,109,112,114,117,118,119],_=[1,190],Z=[1,186],$=[1,187],F=[1,191],V=[1,188],I=[1,189],Xe=[80,119,122],N=[8,9,10,11,12,13,15,28,30,33,35,36,43,47,63,78,87,88,89,90,91,92,93,108,112,114,117,118,119],Xt=[11,109],xe=[32,52,54,56,58,60,65,67,69,70,72,74,119,120,121],he=[1,269],pe=[1,267],fe=[1,271],ge=[1,265],me=[1,266],be=[1,268],Ae=[1,270],ke=[1,272],Je=[1,292],Jt=[8,9,10,12,109],de=[8,9,10,11,12,63,87,108,109,112,113,114,115],Bt={trace:k(function(){},"trace"),yy:{},symbols_:{error:2,start:3,graphConfig:4,document:5,line:6,statement:7,COMMENT:8,SEMI:9,NEWLINE:10,SPACE:11,EOF:12,GRAPH:13,NODIR:14,DIR:15,FirstStmtSeparator:16,ending:17,endToken:18,spaceList:19,spaceListNewline:20,vertexStatement:21,separator:22,styleStatement:23,linkStyleStatement:24,classDefStatement:25,classStatement:26,clickStatement:27,flow:28,textNoTags:29,SQS:30,text:31,SQE:32,end:33,shapeData:34,global:35,connector:36,direction:37,acc_title:38,acc_title_value:39,acc_descr:40,acc_descr_value:41,acc_descr_multiline_value:42,SHAPE_DATA:43,link:44,node:45,styledVertex:46,AMP:47,vertex:48,STYLE_SEPARATOR:49,idString:50,DOUBLECIRCLESTART:51,DOUBLECIRCLEEND:52,PS:53,PE:54,"(-":55,"-)":56,STADIUMSTART:57,STADIUMEND:58,SUBROUTINESTART:59,SUBROUTINEEND:60,VERTEX_WITH_PROPS_START:61,"NODE_STRING[field]":62,COLON:63,"NODE_STRING[value]":64,PIPE:65,CYLINDERSTART:66,CYLINDEREND:67,DIAMOND_START:68,DIAMOND_STOP:69,TAGEND:70,TRAPSTART:71,TRAPEND:72,INVTRAPSTART:73,INVTRAPEND:74,linkStatement:75,arrowText:76,TESTSTR:77,START_LINK:78,edgeText:79,LINK:80,LINK_ID:81,edgeTextToken:82,STR:83,MD_STR:84,textToken:85,keywords:86,STYLE:87,LINKSTYLE:88,CLASSDEF:89,CLASS:90,CLICK:91,DOWN:92,UP:93,textNoTagsToken:94,stylesOpt:95,"idString[vertex]":96,"idString[class]":97,CALLBACKNAME:98,CALLBACKARGS:99,HREF:100,LINK_TARGET:101,"STR[link]":102,"STR[tooltip]":103,alphaNum:104,DEFAULT:105,numList:106,INTERPOLATE:107,NUM:108,COMMA:109,style:110,styleComponent:111,NODE_STRING:112,UNIT:113,BRKT:114,PCT:115,idStringToken:116,MINUS:117,MULT:118,UNICODE_TEXT:119,TEXT:120,TAGSTART:121,EDGE_TEXT:122,alphaNumToken:123,direction_tb:124,direction_bt:125,direction_rl:126,direction_lr:127,direction_td:128,$accept:0,$end:1},terminals_:{2:"error",8:"COMMENT",9:"SEMI",10:"NEWLINE",11:"SPACE",12:"EOF",13:"GRAPH",14:"NODIR",15:"DIR",28:"flow",30:"SQS",32:"SQE",33:"end",35:"global",36:"connector",38:"acc_title",39:"acc_title_value",40:"acc_descr",41:"acc_descr_value",42:"acc_descr_multiline_value",43:"SHAPE_DATA",47:"AMP",49:"STYLE_SEPARATOR",51:"DOUBLECIRCLESTART",52:"DOUBLECIRCLEEND",53:"PS",54:"PE",55:"(-",56:"-)",57:"STADIUMSTART",58:"STADIUMEND",59:"SUBROUTINESTART",60:"SUBROUTINEEND",61:"VERTEX_WITH_PROPS_START",62:"NODE_STRING[field]",63:"COLON",64:"NODE_STRING[value]",65:"PIPE",66:"CYLINDERSTART",67:"CYLINDEREND",68:"DIAMOND_START",69:"DIAMOND_STOP",70:"TAGEND",71:"TRAPSTART",72:"TRAPEND",73:"INVTRAPSTART",74:"INVTRAPEND",77:"TESTSTR",78:"START_LINK",80:"LINK",81:"LINK_ID",83:"STR",84:"MD_STR",87:"STYLE",88:"LINKSTYLE",89:"CLASSDEF",90:"CLASS",91:"CLICK",92:"DOWN",93:"UP",96:"idString[vertex]",97:"idString[class]",98:"CALLBACKNAME",99:"CALLBACKARGS",100:"HREF",101:"LINK_TARGET",102:"STR[link]",103:"STR[tooltip]",105:"DEFAULT",107:"INTERPOLATE",108:"NUM",109:"COMMA",112:"NODE_STRING",113:"UNIT",114:"BRKT",115:"PCT",117:"MINUS",118:"MULT",119:"UNICODE_TEXT",120:"TEXT",121:"TAGSTART",122:"EDGE_TEXT",124:"direction_tb",125:"direction_bt",126:"direction_rl",127:"direction_lr",128:"direction_td"},productions_:[0,[3,2],[5,0],[5,2],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[4,2],[4,2],[4,2],[4,2],[4,3],[17,2],[17,1],[18,1],[18,1],[18,1],[16,1],[16,1],[16,2],[16,1],[20,2],[20,2],[20,2],[20,1],[20,1],[20,1],[19,2],[19,1],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,9],[7,10],[7,6],[7,7],[7,4],[7,4],[7,7],[7,8],[7,4],[7,5],[7,1],[7,2],[7,2],[7,1],[22,1],[22,1],[22,1],[22,1],[34,2],[34,1],[21,4],[21,3],[21,4],[21,2],[21,2],[21,1],[45,1],[45,6],[45,5],[46,1],[46,3],[48,4],[48,4],[48,6],[48,4],[48,4],[48,4],[48,8],[48,4],[48,4],[48,4],[48,6],[48,4],[48,4],[48,4],[48,4],[48,4],[48,1],[44,2],[44,3],[44,3],[44,1],[44,3],[44,4],[79,1],[79,2],[79,1],[79,1],[75,1],[75,2],[76,3],[31,1],[31,2],[31,1],[31,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[29,1],[29,2],[29,1],[29,1],[25,5],[26,5],[27,2],[27,4],[27,3],[27,5],[27,3],[27,5],[27,5],[27,7],[27,2],[27,4],[27,2],[27,4],[27,4],[27,6],[23,5],[24,5],[24,5],[24,9],[24,9],[24,7],[24,7],[106,1],[106,3],[95,1],[95,3],[110,1],[110,2],[111,1],[111,1],[111,1],[111,1],[111,1],[111,1],[111,1],[111,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[85,1],[85,1],[85,1],[85,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[82,1],[82,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[50,1],[50,2],[104,1],[104,2],[37,1],[37,1],[37,1],[37,1],[37,1]],performAction:k(function(A,E,S,l,O,e,B){var t=e.length-1;switch(O){case 2:this.$=[];break;case 3:(!Array.isArray(e[t])||e[t].length>0)&&e[t-1].push(e[t]),this.$=e[t-1];break;case 4:case 198:this.$=e[t];break;case 5:case 33:case 34:case 35:case 36:case 37:this.$=[];break;case 13:l.setDirection("TB"),this.$="TB";break;case 14:l.setDirection(e[t-1]),this.$=e[t-1];break;case 32:this.$=e[t-1].nodes;break;case 38:this.$=l.addSubGraph(e[t-6],e[t-1],e[t-4],"flow"),l.addSubgraphMapping&&l.addSubgraphMapping(e[t-6],e[t-4],B[t-8],B[t]);break;case 39:this.$=l.addSubGraph(e[t-7],e[t-1],e[t-5],"flow"),l.addVertex(this.$,void 0,void 0,void 0,void 0,void 0,void 0,e[t-3],B[t-3]),l.addSubgraphMapping&&l.addSubgraphMapping(e[t-7],e[t-5],B[t-9],B[t]);break;case 40:this.$=l.addSubGraph(e[t-3],e[t-1],{text:"",type:"text"},"flow"),l.addSubgraphMapping&&l.addSubgraphMapping(e[t-3],{text:"",type:"text"},B[t-5],B[t]);break;case 41:this.$=l.addSubGraph(e[t-4],e[t-1],{text:"",type:"text"},"flow"),l.addVertex(this.$,void 0,void 0,void 0,void 0,void 0,void 0,e[t-3],B[t-3]),l.addSubgraphMapping&&l.addSubgraphMapping(e[t-4],{text:"",type:"text"},B[t-6],B[t]);break;case 42:this.$=l.addSubGraph(void 0,e[t-1],void 0,"flow"),l.addSubgraphMapping&&l.addSubgraphMapping(void 0,void 0,B[t-3],B[t]);break;case 43:l.addGlobal(e[t-1]),this.$=[];break;case 44:this.$=l.addConnector(e[t-4],e[t-2]),l.addConnectorMapping&&l.addConnectorMapping(e[t-4],e[t-2],B[t-6],B[t]);break;case 45:this.$=l.addConnector(e[t-5],e[t-3]),l.addVertex(this.$,void 0,void 0,void 0,void 0,void 0,void 0,e[t-1],B[t-1]),l.addConnectorMapping&&l.addConnectorMapping(e[t-5],e[t-3],B[t-7],B[t]);break;case 46:this.$=l.addConnector(e[t-1],{text:"",type:"text"}),l.addConnectorMapping&&l.addConnectorMapping(e[t-1],{text:"",type:"text"},B[t-3],B[t]);break;case 47:this.$=l.addConnector(e[t-2],{text:"",type:"text"}),l.addVertex(this.$,void 0,void 0,void 0,void 0,void 0,void 0,e[t-1],B[t-1]),l.addConnectorMapping&&l.addConnectorMapping(e[t-2],{text:"",type:"text"},B[t-4],B[t]);break;case 49:this.$=e[t].trim(),l.setAccTitle(this.$);break;case 50:case 51:this.$=e[t].trim(),l.setAccDescription(this.$);break;case 56:this.$=e[t-1]+e[t];break;case 57:this.$=e[t];break;case 58:l.addVertex(e[t-1][e[t-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,e[t],B[t]),l.extendVertexMapping&&l.extendVertexMapping(e[t-1][e[t-1].length-1],B[t]),l.addLink(e[t-3].stmt,e[t-1],e[t-2]),l.addEdgeMapping&&l.addEdgeMapping(e[t-3].stmt,e[t-1],e[t-2],this._$),this.$={stmt:e[t-1],nodes:e[t-1].concat(e[t-3].nodes)};break;case 59:l.addLink(e[t-2].stmt,e[t],e[t-1]),l.addEdgeMapping&&l.addEdgeMapping(e[t-2].stmt,e[t],e[t-1],this._$),this.$={stmt:e[t],nodes:e[t].concat(e[t-2].nodes)};break;case 60:l.addLink(e[t-3].stmt,e[t-1],e[t-2]),l.addEdgeMapping&&l.addEdgeMapping(e[t-3].stmt,e[t-1],e[t-2],this._$),this.$={stmt:e[t-1],nodes:e[t-1].concat(e[t-3].nodes)};break;case 61:this.$={stmt:e[t-1],nodes:e[t-1]};break;case 62:l.addVertex(e[t-1][e[t-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,e[t],B[t]),l.extendVertexMapping&&l.extendVertexMapping(e[t-1][e[t-1].length-1],B[t]),this.$={stmt:e[t-1],nodes:e[t-1],shapeData:e[t]};break;case 63:this.$={stmt:e[t],nodes:e[t]};break;case 64:this.$=[e[t]];break;case 65:l.addVertex(e[t-5][e[t-5].length-1],void 0,void 0,void 0,void 0,void 0,void 0,e[t-4],B[t-4]),l.extendVertexMapping&&l.extendVertexMapping(e[t-5][e[t-5].length-1],B[t-4]),this.$=e[t-5].concat(e[t]);break;case 66:this.$=e[t-4].concat(e[t]);break;case 67:this.$=e[t];break;case 68:this.$=e[t-2],l.setClass(e[t-2],e[t]);break;case 69:this.$=e[t-3],l.addVertex(e[t-3],e[t-1],"square"),l.addVertexMapping&&l.addVertexMapping(e[t-3],e[t-1],"square",this._$);break;case 70:this.$=e[t-3],l.addVertex(e[t-3],e[t-1],"doublecircle"),l.addVertexMapping&&l.addVertexMapping(e[t-3],e[t-1],"doublecircle",this._$);break;case 71:this.$=e[t-5],l.addVertex(e[t-5],e[t-2],"circle"),l.addVertexMapping&&l.addVertexMapping(e[t-5],e[t-2],"circle",this._$);break;case 72:this.$=e[t-3],l.addVertex(e[t-3],e[t-1],"ellipse"),l.addVertexMapping&&l.addVertexMapping(e[t-3],e[t-1],"ellipse",this._$);break;case 73:this.$=e[t-3],l.addVertex(e[t-3],e[t-1],"stadium"),l.addVertexMapping&&l.addVertexMapping(e[t-3],e[t-1],"stadium",this._$);break;case 74:this.$=e[t-3],l.addVertex(e[t-3],e[t-1],"subroutine"),l.addVertexMapping&&l.addVertexMapping(e[t-3],e[t-1],"subroutine",this._$);break;case 75:this.$=e[t-7],l.addVertex(e[t-7],e[t-1],"rect",void 0,void 0,void 0,Object.fromEntries([[e[t-5],e[t-3]]])),l.addVertexMapping&&l.addVertexMapping(e[t-7],e[t-1],"rect",this._$);break;case 76:this.$=e[t-3],l.addVertex(e[t-3],e[t-1],"cylinder"),l.addVertexMapping&&l.addVertexMapping(e[t-3],e[t-1],"cylinder",this._$);break;case 77:this.$=e[t-3],l.addVertex(e[t-3],e[t-1],"round"),l.addVertexMapping&&l.addVertexMapping(e[t-3],e[t-1],"round",this._$);break;case 78:this.$=e[t-3],l.addVertex(e[t-3],e[t-1],"diamond"),l.addVertexMapping&&l.addVertexMapping(e[t-3],e[t-1],"diamond",this._$);break;case 79:this.$=e[t-5],l.addVertex(e[t-5],e[t-2],"hexagon"),l.addVertexMapping&&l.addVertexMapping(e[t-5],e[t-2],"hexagon",this._$);break;case 80:this.$=e[t-3],l.addVertex(e[t-3],e[t-1],"odd"),l.addVertexMapping&&l.addVertexMapping(e[t-3],e[t-1],"odd",this._$);break;case 81:this.$=e[t-3],l.addVertex(e[t-3],e[t-1],"trapezoid"),l.addVertexMapping&&l.addVertexMapping(e[t-3],e[t-1],"trapezoid",this._$);break;case 82:this.$=e[t-3],l.addVertex(e[t-3],e[t-1],"inv_trapezoid"),l.addVertexMapping&&l.addVertexMapping(e[t-3],e[t-1],"inv_trapezoid",this._$);break;case 83:this.$=e[t-3],l.addVertex(e[t-3],e[t-1],"lean_right"),l.addVertexMapping&&l.addVertexMapping(e[t-3],e[t-1],"lean_right",this._$);break;case 84:this.$=e[t-3],l.addVertex(e[t-3],e[t-1],"lean_left"),l.addVertexMapping&&l.addVertexMapping(e[t-3],e[t-1],"lean_left",this._$);break;case 85:this.$=e[t],l.addVertex(e[t]),l.addVertexMapping&&l.addVertexMapping(e[t],void 0,void 0,this._$);break;case 86:e[t-1].text=e[t],this.$=e[t-1];break;case 87:case 88:e[t-2].text=e[t-1],this.$=e[t-2];break;case 89:this.$=e[t];break;case 90:var G=l.destructLink(e[t],e[t-2]);this.$={type:G.type,stroke:G.stroke,length:G.length,edgeSemantic:G.edgeSemantic,text:e[t-1]};break;case 91:var G=l.destructLink(e[t],e[t-2]);this.$={type:G.type,stroke:G.stroke,length:G.length,edgeSemantic:G.edgeSemantic,text:e[t-1],id:e[t-3]};break;case 92:this.$={text:e[t],type:"text"};break;case 93:this.$={text:e[t-1].text+""+e[t],type:e[t-1].type};break;case 94:this.$={text:e[t],type:"string"};break;case 95:this.$={text:e[t],type:"markdown"};break;case 96:var G=l.destructLink(e[t]);this.$={type:G.type,stroke:G.stroke,length:G.length,edgeSemantic:G.edgeSemantic};break;case 97:var G=l.destructLink(e[t]);this.$={type:G.type,stroke:G.stroke,length:G.length,edgeSemantic:G.edgeSemantic,id:e[t-1]};break;case 98:this.$=e[t-1];break;case 99:this.$={text:e[t],type:"text"};break;case 100:this.$={text:e[t-1].text+""+e[t],type:e[t-1].type};break;case 101:this.$={text:e[t],type:"string"};break;case 102:case 119:this.$={text:e[t],type:"markdown"};break;case 116:this.$={text:e[t],type:"text"};break;case 117:this.$={text:e[t-1].text+""+e[t],type:e[t-1].type};break;case 118:this.$={text:e[t],type:"text"};break;case 120:this.$=e[t-4],l.addClass(e[t-2],e[t]);break;case 121:this.$=e[t-4],l.setClass(e[t-2],e[t]);break;case 122:case 130:this.$=e[t-1],l.setClickEvent(e[t-1],e[t]);break;case 123:case 131:this.$=e[t-3],l.setClickEvent(e[t-3],e[t-2]),l.setTooltip(e[t-3],e[t]);break;case 124:this.$=e[t-2],l.setClickEvent(e[t-2],e[t-1],e[t]);break;case 125:this.$=e[t-4],l.setClickEvent(e[t-4],e[t-3],e[t-2]),l.setTooltip(e[t-4],e[t]);break;case 126:this.$=e[t-2],l.setLink(e[t-2],e[t]);break;case 127:this.$=e[t-4],l.setLink(e[t-4],e[t-2]),l.setTooltip(e[t-4],e[t]);break;case 128:this.$=e[t-4],l.setLink(e[t-4],e[t-2],e[t]);break;case 129:this.$=e[t-6],l.setLink(e[t-6],e[t-4],e[t]),l.setTooltip(e[t-6],e[t-2]);break;case 132:this.$=e[t-1],l.setLink(e[t-1],e[t]);break;case 133:this.$=e[t-3],l.setLink(e[t-3],e[t-2]),l.setTooltip(e[t-3],e[t]);break;case 134:this.$=e[t-3],l.setLink(e[t-3],e[t-2],e[t]);break;case 135:this.$=e[t-5],l.setLink(e[t-5],e[t-4],e[t]),l.setTooltip(e[t-5],e[t-2]);break;case 136:this.$=e[t-4],l.addVertex(e[t-2],void 0,void 0,e[t]);break;case 137:this.$=e[t-4],l.updateLink([e[t-2]],e[t]);break;case 138:this.$=e[t-4],l.updateLink(e[t-2],e[t]);break;case 139:this.$=e[t-8],l.updateLinkInterpolate([e[t-6]],e[t-2]),l.updateLink([e[t-6]],e[t]);break;case 140:this.$=e[t-8],l.updateLinkInterpolate(e[t-6],e[t-2]),l.updateLink(e[t-6],e[t]);break;case 141:this.$=e[t-6],l.updateLinkInterpolate([e[t-4]],e[t]);break;case 142:this.$=e[t-6],l.updateLinkInterpolate(e[t-4],e[t]);break;case 143:case 145:this.$=[e[t]];break;case 144:case 146:e[t-2].push(e[t]),this.$=e[t-2];break;case 148:this.$=e[t-1]+e[t];break;case 196:this.$=e[t];break;case 197:this.$=e[t-1]+""+e[t];break;case 199:this.$=e[t-1]+""+e[t];break;case 200:this.$={stmt:"dir",value:"TB"};break;case 201:this.$={stmt:"dir",value:"BT"};break;case 202:this.$={stmt:"dir",value:"RL"};break;case 203:this.$={stmt:"dir",value:"LR"};break;case 204:this.$={stmt:"dir",value:"TD"};break}},"anonymous"),table:[{3:1,4:2,8:i,10:n,11:r,13:o},{1:[3]},s(u,c,{5:7}),{4:8,8:i,10:n,11:r,13:o},{4:9,8:i,10:n,11:r,13:o},{4:10,8:i,10:n,11:r,13:o},{14:[1,11],15:[1,12]},{1:[2,1],6:13,7:14,8:a,9:d,10:f,11:h,12:b,21:20,23:21,24:22,25:23,26:24,27:25,28:C,35:L,36:M,37:29,38:D,40:x,42:g,45:33,46:44,47:T,48:45,50:46,63:y,87:p,88:m,89:R,90:U,91:ne,92:z,105:w,108:W,109:P,112:H,114:Y,116:47,117:j,118:q,119:X,124:De,125:ve,126:_e,127:Fe,128:Ve},s(u,[2,10]),s(u,[2,11]),s(u,[2,12]),s(u,[2,13]),{8:[1,63],9:[1,60],10:[1,61],11:Se,16:59,19:62},s(v,[2,3]),s(v,[2,4]),s(v,[2,5]),s(v,[2,6]),s(v,[2,7]),s(v,[2,8]),s(v,[2,9]),{8:ee,9:te,10:se,12:ie,22:65,44:66,75:71,78:[1,72],80:[1,74],81:[1,73]},{8:ee,9:te,10:se,12:ie,22:75},{8:ee,9:te,10:se,12:ie,22:76},{8:ee,9:te,10:se,12:ie,22:77},{8:ee,9:te,10:se,12:ie,22:78},{8:ee,9:te,10:se,12:ie,22:79},{8:ee,9:te,10:se,11:[1,80],12:ie,22:81},{8:ee,9:te,10:se,12:ie,22:82},{11:[1,83]},s(v,[2,48]),{39:[1,84]},{41:[1,85]},s(v,[2,51]),s(Me,[2,63],{19:86,34:87,11:Se,43:ye}),{11:[1,89]},{11:[1,90]},{11:[1,91]},{11:[1,92]},{15:Ne,47:Re,63:we,83:[1,96],92:Oe,98:[1,93],100:[1,94],104:95,108:Pe,109:Ge,112:Ue,114:ze,117:We,118:Ke,119:He,123:97},s(v,[2,200]),s(v,[2,201]),s(v,[2,202]),s(v,[2,203]),s(v,[2,204]),s(Ie,[2,64]),s(Ie,[2,67],{49:[1,109]}),s(Q,[2,85],{116:122,30:[1,110],47:T,51:[1,111],53:[1,112],55:[1,113],57:[1,114],59:[1,115],61:[1,116],63:y,66:[1,117],68:[1,118],70:[1,119],71:[1,120],73:[1,121],92:z,105:w,108:W,109:P,112:H,114:Y,117:j,118:q,119:X}),s(ae,[2,196]),s(ae,[2,157]),s(ae,[2,158]),s(ae,[2,159]),s(ae,[2,160]),s(ae,[2,161]),s(ae,[2,162]),s(ae,[2,163]),s(ae,[2,164]),s(ae,[2,165]),s(ae,[2,166]),s(ae,[2,167]),s(u,[2,14]),s(u,[2,20]),s(u,[2,21]),{10:[1,123]},s(u,[2,23]),s(zt,[2,31],{19:124,11:Se}),s(v,[2,32]),{45:125,46:44,47:T,48:45,50:46,63:y,92:z,105:w,108:W,109:P,112:H,114:Y,116:47,117:j,118:q,119:X},s(v,[2,52]),s(v,[2,53]),s(v,[2,54]),s(v,[2,55]),s(Ye,[2,89],{76:126,65:[1,128],77:[1,127]}),{79:129,82:130,83:Wt,84:Kt,119:st,122:it},{78:[1,135],80:[1,136]},s(Ht,[2,96]),s(v,[2,33]),s(v,[2,34]),s(v,[2,35]),s(v,[2,36]),s(v,[2,37]),{11:nt,13:rt,15:at,28:ot,29:137,33:ut,35:lt,36:ct,47:dt,63:ht,78:pt,83:Yt,84:jt,86:150,87:ft,88:gt,89:mt,90:bt,91:At,92:kt,93:Et,94:138,108:Ct,112:St,114:xt,117:Tt,118:Dt,119:vt},s(je,c,{5:165}),s(je,c,{5:166}),{11:nt,13:rt,15:at,28:ot,29:167,33:ut,35:lt,36:ct,47:dt,63:ht,78:pt,83:Yt,84:jt,86:150,87:ft,88:gt,89:mt,90:bt,91:At,92:kt,93:Et,94:138,108:Ct,112:St,114:xt,117:Tt,118:Dt,119:vt},s(v,[2,49]),s(v,[2,50]),s(Me,[2,61],{47:qt}),s(Me,[2,62],{19:169,11:Se,43:qe}),s(Ie,[2,57]),{47:T,50:171,63:y,92:z,105:w,108:W,109:P,112:H,114:Y,116:47,117:j,118:q,119:X},{105:[1,172],106:173,108:[1,174]},{47:T,50:175,63:y,92:z,105:w,108:W,109:P,112:H,114:Y,116:47,117:j,118:q,119:X},{47:T,50:176,63:y,92:z,105:w,108:W,109:P,112:H,114:Y,116:47,117:j,118:q,119:X},s(K,[2,122],{11:[1,177],99:[1,178]}),{83:[1,179]},s(K,[2,130],{123:181,11:[1,180],15:Ne,47:Re,63:we,92:Oe,108:Pe,109:Ge,112:Ue,114:ze,117:We,118:Ke,119:He}),s(K,[2,132],{11:[1,182]}),s(oe,[2,198]),s(oe,[2,185]),s(oe,[2,186]),s(oe,[2,187]),s(oe,[2,188]),s(oe,[2,189]),s(oe,[2,190]),s(oe,[2,191]),s(oe,[2,192]),s(oe,[2,193]),s(oe,[2,194]),s(oe,[2,195]),{47:T,50:183,63:y,92:z,105:w,108:W,109:P,112:H,114:Y,116:47,117:j,118:q,119:X},{31:184,70:_,83:Z,84:$,85:185,119:F,120:V,121:I},{31:192,70:_,83:Z,84:$,85:185,119:F,120:V,121:I},{31:194,53:[1,193],70:_,83:Z,84:$,85:185,119:F,120:V,121:I},{31:195,70:_,83:Z,84:$,85:185,119:F,120:V,121:I},{31:196,70:_,83:Z,84:$,85:185,119:F,120:V,121:I},{31:197,70:_,83:Z,84:$,85:185,119:F,120:V,121:I},{112:[1,198]},{31:199,70:_,83:Z,84:$,85:185,119:F,120:V,121:I},{31:200,68:[1,201],70:_,83:Z,84:$,85:185,119:F,120:V,121:I},{31:202,70:_,83:Z,84:$,85:185,119:F,120:V,121:I},{31:203,70:_,83:Z,84:$,85:185,119:F,120:V,121:I},{31:204,70:_,83:Z,84:$,85:185,119:F,120:V,121:I},s(ae,[2,197]),s(u,[2,22]),s(zt,[2,30]),s(Me,[2,59],{34:205,19:206,11:Se,43:ye}),s(Ye,[2,86],{11:[1,207]}),{11:[1,208]},{31:209,70:_,83:Z,84:$,85:185,119:F,120:V,121:I},{80:[1,210],82:211,119:st,122:it},s(Xe,[2,92]),s(Xe,[2,94]),s(Xe,[2,95]),s(Xe,[2,183]),s(Xe,[2,184]),{79:212,82:130,83:Wt,84:Kt,119:st,122:it},s(Ht,[2,97]),{8:ee,9:te,10:se,11:nt,12:ie,13:rt,15:at,22:214,28:ot,30:[1,213],33:ut,34:215,35:lt,36:ct,43:ye,47:dt,63:ht,78:pt,86:150,87:ft,88:gt,89:mt,90:bt,91:At,92:kt,93:Et,94:216,108:Ct,112:St,114:xt,117:Tt,118:Dt,119:vt},s(N,[2,116]),s(N,[2,118]),s(N,[2,119]),s(N,[2,172]),s(N,[2,173]),s(N,[2,174]),s(N,[2,175]),s(N,[2,176]),s(N,[2,177]),s(N,[2,178]),s(N,[2,179]),s(N,[2,180]),s(N,[2,181]),s(N,[2,182]),s(N,[2,103]),s(N,[2,104]),s(N,[2,105]),s(N,[2,106]),s(N,[2,107]),s(N,[2,108]),s(N,[2,109]),s(N,[2,110]),s(N,[2,111]),s(N,[2,112]),s(N,[2,113]),s(N,[2,114]),s(N,[2,115]),{6:13,7:14,8:a,9:d,10:f,11:h,12:b,21:20,23:21,24:22,25:23,26:24,27:25,28:C,33:[1,217],35:L,36:M,37:29,38:D,40:x,42:g,45:33,46:44,47:T,48:45,50:46,63:y,87:p,88:m,89:R,90:U,91:ne,92:z,105:w,108:W,109:P,112:H,114:Y,116:47,117:j,118:q,119:X,124:De,125:ve,126:_e,127:Fe,128:Ve},{6:13,7:14,8:a,9:d,10:f,11:h,12:b,21:20,23:21,24:22,25:23,26:24,27:25,28:C,33:[1,218],35:L,36:M,37:29,38:D,40:x,42:g,45:33,46:44,47:T,48:45,50:46,63:y,87:p,88:m,89:R,90:U,91:ne,92:z,105:w,108:W,109:P,112:H,114:Y,116:47,117:j,118:q,119:X,124:De,125:ve,126:_e,127:Fe,128:Ve},{8:ee,9:te,10:se,11:nt,12:ie,13:rt,15:at,22:220,28:ot,30:[1,219],33:ut,34:221,35:lt,36:ct,43:ye,47:dt,63:ht,78:pt,86:150,87:ft,88:gt,89:mt,90:bt,91:At,92:kt,93:Et,94:216,108:Ct,112:St,114:xt,117:Tt,118:Dt,119:vt},{11:Se,19:222},{47:[1,223]},s(Ie,[2,56]),{11:[1,224],47:T,63:y,92:z,105:w,108:W,109:P,112:H,114:Y,116:122,117:j,118:q,119:X},{11:[1,225]},{11:[1,226],109:[1,227]},s(Xt,[2,143]),{11:[1,228],47:T,63:y,92:z,105:w,108:W,109:P,112:H,114:Y,116:122,117:j,118:q,119:X},{11:[1,229],47:T,63:y,92:z,105:w,108:W,109:P,112:H,114:Y,116:122,117:j,118:q,119:X},{83:[1,230]},s(K,[2,124],{11:[1,231]}),s(K,[2,126],{11:[1,232]}),{83:[1,233]},s(oe,[2,199]),{83:[1,234],101:[1,235]},s(Ie,[2,68],{116:122,47:T,63:y,92:z,105:w,108:W,109:P,112:H,114:Y,117:j,118:q,119:X}),{32:[1,236],70:_,85:237,119:F,120:V,121:I},s(xe,[2,99]),s(xe,[2,101]),s(xe,[2,102]),s(xe,[2,168]),s(xe,[2,169]),s(xe,[2,170]),s(xe,[2,171]),{52:[1,238],70:_,85:237,119:F,120:V,121:I},{31:239,70:_,83:Z,84:$,85:185,119:F,120:V,121:I},{54:[1,240],70:_,85:237,119:F,120:V,121:I},{56:[1,241],70:_,85:237,119:F,120:V,121:I},{58:[1,242],70:_,85:237,119:F,120:V,121:I},{60:[1,243],70:_,85:237,119:F,120:V,121:I},{63:[1,244]},{67:[1,245],70:_,85:237,119:F,120:V,121:I},{69:[1,246],70:_,85:237,119:F,120:V,121:I},{31:247,70:_,83:Z,84:$,85:185,119:F,120:V,121:I},{32:[1,248],70:_,85:237,119:F,120:V,121:I},{70:_,72:[1,249],74:[1,250],85:237,119:F,120:V,121:I},{70:_,72:[1,252],74:[1,251],85:237,119:F,120:V,121:I},s(Me,[2,58],{19:169,11:Se,43:qe}),s(Me,[2,60],{47:qt}),s(Ye,[2,88]),s(Ye,[2,87]),{65:[1,253],70:_,85:237,119:F,120:V,121:I},s(Ye,[2,90]),s(Xe,[2,93]),{80:[1,254],82:211,119:st,122:it},{31:255,70:_,83:Z,84:$,85:185,119:F,120:V,121:I},s(je,c,{5:256}),{8:ee,9:te,10:se,12:ie,22:257,43:qe},s(N,[2,117]),s(v,[2,42]),s(v,[2,43]),{31:258,70:_,83:Z,84:$,85:185,119:F,120:V,121:I},s(v,[2,46]),{8:ee,9:te,10:se,12:ie,22:259,43:qe},{46:260,47:T,48:45,50:46,63:y,92:z,105:w,108:W,109:P,112:H,114:Y,116:47,117:j,118:q,119:X},{11:Se,19:261},{11:he,63:pe,87:fe,95:262,108:ge,110:263,111:264,112:me,113:be,114:Ae,115:ke},{11:he,63:pe,87:fe,95:273,107:[1,274],108:ge,110:263,111:264,112:me,113:be,114:Ae,115:ke},{11:he,63:pe,87:fe,95:275,107:[1,276],108:ge,110:263,111:264,112:me,113:be,114:Ae,115:ke},{108:[1,277]},{11:he,63:pe,87:fe,95:278,108:ge,110:263,111:264,112:me,113:be,114:Ae,115:ke},{47:T,50:279,63:y,92:z,105:w,108:W,109:P,112:H,114:Y,116:47,117:j,118:q,119:X},s(K,[2,123]),{83:[1,280]},{83:[1,281],101:[1,282]},s(K,[2,131]),s(K,[2,133],{11:[1,283]}),s(K,[2,134]),s(Q,[2,69]),s(xe,[2,100]),s(Q,[2,70]),{54:[1,284],70:_,85:237,119:F,120:V,121:I},s(Q,[2,77]),s(Q,[2,72]),s(Q,[2,73]),s(Q,[2,74]),{112:[1,285]},s(Q,[2,76]),s(Q,[2,78]),{69:[1,286],70:_,85:237,119:F,120:V,121:I},s(Q,[2,80]),s(Q,[2,81]),s(Q,[2,83]),s(Q,[2,82]),s(Q,[2,84]),s([11,47,63,92,105,108,109,112,114,117,118,119],[2,98]),s(Ye,[2,91]),{32:[1,287],70:_,85:237,119:F,120:V,121:I},{6:13,7:14,8:a,9:d,10:f,11:h,12:b,21:20,23:21,24:22,25:23,26:24,27:25,28:C,33:[1,288],35:L,36:M,37:29,38:D,40:x,42:g,45:33,46:44,47:T,48:45,50:46,63:y,87:p,88:m,89:R,90:U,91:ne,92:z,105:w,108:W,109:P,112:H,114:Y,116:47,117:j,118:q,119:X,124:De,125:ve,126:_e,127:Fe,128:Ve},s(je,c,{5:289}),{32:[1,290],70:_,85:237,119:F,120:V,121:I},s(v,[2,47]),s(Ie,[2,66]),{46:291,47:T,48:45,50:46,63:y,92:z,105:w,108:W,109:P,112:H,114:Y,116:47,117:j,118:q,119:X},s(K,[2,136],{109:Je}),s(Jt,[2,145],{111:293,11:he,63:pe,87:fe,108:ge,112:me,113:be,114:Ae,115:ke}),s(de,[2,147]),s(de,[2,149]),s(de,[2,150]),s(de,[2,151]),s(de,[2,152]),s(de,[2,153]),s(de,[2,154]),s(de,[2,155]),s(de,[2,156]),s(K,[2,137],{109:Je}),{11:[1,294]},s(K,[2,138],{109:Je}),{11:[1,295]},s(Xt,[2,144]),s(K,[2,120],{109:Je}),s(K,[2,121],{116:122,47:T,63:y,92:z,105:w,108:W,109:P,112:H,114:Y,117:j,118:q,119:X}),s(K,[2,125]),s(K,[2,127],{11:[1,296]}),s(K,[2,128]),{101:[1,297]},{54:[1,298]},{65:[1,299]},{69:[1,300]},{8:ee,9:te,10:se,12:ie,22:301,34:302,43:ye},s(v,[2,40]),{6:13,7:14,8:a,9:d,10:f,11:h,12:b,21:20,23:21,24:22,25:23,26:24,27:25,28:C,33:[1,303],35:L,36:M,37:29,38:D,40:x,42:g,45:33,46:44,47:T,48:45,50:46,63:y,87:p,88:m,89:R,90:U,91:ne,92:z,105:w,108:W,109:P,112:H,114:Y,116:47,117:j,118:q,119:X,124:De,125:ve,126:_e,127:Fe,128:Ve},{8:ee,9:te,10:se,12:ie,22:304,34:305,43:ye},s(Ie,[2,65]),{11:he,63:pe,87:fe,108:ge,110:306,111:264,112:me,113:be,114:Ae,115:ke},s(de,[2,148]),{15:Ne,47:Re,63:we,92:Oe,104:307,108:Pe,109:Ge,112:Ue,114:ze,117:We,118:Ke,119:He,123:97},{15:Ne,47:Re,63:we,92:Oe,104:308,108:Pe,109:Ge,112:Ue,114:ze,117:We,118:Ke,119:He,123:97},{101:[1,309]},s(K,[2,135]),s(Q,[2,71]),{31:310,70:_,83:Z,84:$,85:185,119:F,120:V,121:I},s(Q,[2,79]),s(je,c,{5:311}),{8:ee,9:te,10:se,12:ie,22:312,43:qe},s(v,[2,41]),s(v,[2,44]),{8:ee,9:te,10:se,12:ie,22:313,43:qe},s(Jt,[2,146],{111:293,11:he,63:pe,87:fe,108:ge,112:me,113:be,114:Ae,115:ke}),s(K,[2,141],{123:181,11:[1,314],15:Ne,47:Re,63:we,92:Oe,108:Pe,109:Ge,112:Ue,114:ze,117:We,118:Ke,119:He}),s(K,[2,142],{123:181,11:[1,315],15:Ne,47:Re,63:we,92:Oe,108:Pe,109:Ge,112:Ue,114:ze,117:We,118:Ke,119:He}),s(K,[2,129]),{32:[1,316],70:_,85:237,119:F,120:V,121:I},{6:13,7:14,8:a,9:d,10:f,11:h,12:b,21:20,23:21,24:22,25:23,26:24,27:25,28:C,33:[1,317],35:L,36:M,37:29,38:D,40:x,42:g,45:33,46:44,47:T,48:45,50:46,63:y,87:p,88:m,89:R,90:U,91:ne,92:z,105:w,108:W,109:P,112:H,114:Y,116:47,117:j,118:q,119:X,124:De,125:ve,126:_e,127:Fe,128:Ve},s(je,c,{5:318}),s(v,[2,45]),{11:he,63:pe,87:fe,95:319,108:ge,110:263,111:264,112:me,113:be,114:Ae,115:ke},{11:he,63:pe,87:fe,95:320,108:ge,110:263,111:264,112:me,113:be,114:Ae,115:ke},s(Q,[2,75]),s(v,[2,38]),{6:13,7:14,8:a,9:d,10:f,11:h,12:b,21:20,23:21,24:22,25:23,26:24,27:25,28:C,33:[1,321],35:L,36:M,37:29,38:D,40:x,42:g,45:33,46:44,47:T,48:45,50:46,63:y,87:p,88:m,89:R,90:U,91:ne,92:z,105:w,108:W,109:P,112:H,114:Y,116:47,117:j,118:q,119:X,124:De,125:ve,126:_e,127:Fe,128:Ve},s(K,[2,139],{109:Je}),s(K,[2,140],{109:Je}),s(v,[2,39])],defaultActions:{},parseError:k(function(A,E){if(E.recoverable)this.trace(A);else{var S=new Error(A);throw S.hash=E,S}},"parseError"),parse:k(function(A){var E=this,S=[0],l=[],O=[null],e=[],B=this.table,t="",G=0,Qt=0,g1=2,Zt=1,m1=e.slice.call(arguments,1),J=Object.create(this.lexer),Le={yy:{}};for(var Mt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Mt)&&(Le.yy[Mt]=this.yy[Mt]);J.setInput(A,Le.yy),Le.yy.lexer=J,Le.yy.parser=this,typeof J.yylloc>"u"&&(J.yylloc={});var yt=J.yylloc;e.push(yt);var b1=J.options&&J.options.ranges;typeof Le.yy.parseError=="function"?this.parseError=Le.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function A1(ue){S.length=S.length-2*ue,O.length=O.length-ue,e.length=e.length-ue}k(A1,"popStack");function $t(){var ue;return ue=l.pop()||J.lex()||Zt,typeof ue!="number"&&(ue instanceof Array&&(l=ue,ue=l.pop()),ue=E.symbols_[ue]||ue),ue}k($t,"lex");for(var re,Be,ce,Nt,Qe={},Ft,Ee,e1,Vt;;){if(Be=S[S.length-1],this.defaultActions[Be]?ce=this.defaultActions[Be]:((re===null||typeof re>"u")&&(re=$t()),ce=B[Be]&&B[Be][re]),typeof ce>"u"||!ce.length||!ce[0]){var Rt="";Vt=[];for(Ft in B[Be])this.terminals_[Ft]&&Ft>g1&&Vt.push("'"+this.terminals_[Ft]+"'");J.showPosition?Rt="Parse error on line "+(G+1)+`:
|
|
23
|
+
`+J.showPosition()+`
|
|
24
|
+
Expecting `+Vt.join(", ")+", got '"+(this.terminals_[re]||re)+"'":Rt="Parse error on line "+(G+1)+": Unexpected "+(re==Zt?"end of input":"'"+(this.terminals_[re]||re)+"'"),this.parseError(Rt,{text:J.match,token:this.terminals_[re]||re,line:J.yylineno,loc:yt,expected:Vt})}if(ce[0]instanceof Array&&ce.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Be+", token: "+re);switch(ce[0]){case 1:S.push(re),O.push(J.yytext),e.push(J.yylloc),S.push(ce[1]),re=null,Qt=J.yyleng,t=J.yytext,G=J.yylineno,yt=J.yylloc;break;case 2:if(Ee=this.productions_[ce[1]][1],Qe.$=O[O.length-Ee],Qe._$={first_line:e[e.length-(Ee||1)].first_line,last_line:e[e.length-1].last_line,first_column:e[e.length-(Ee||1)].first_column,last_column:e[e.length-1].last_column},b1&&(Qe._$.range=[e[e.length-(Ee||1)].range[0],e[e.length-1].range[1]]),Nt=this.performAction.apply(Qe,[t,Qt,G,Le.yy,ce[1],O,e].concat(m1)),typeof Nt<"u")return Nt;Ee&&(S=S.slice(0,-1*Ee*2),O=O.slice(0,-1*Ee),e=e.slice(0,-1*Ee)),S.push(this.productions_[ce[1]][0]),O.push(Qe.$),e.push(Qe._$),e1=B[S[S.length-2]][S[S.length-1]],S.push(e1);break;case 3:return!0}}return!0},"parse")},f1=(function(){var Te={EOF:1,parseError:k(function(E,S){if(this.yy.parser)this.yy.parser.parseError(E,S);else throw new Error(E)},"parseError"),setInput:k(function(A,E){return this.yy=E||this.yy||{},this._input=A,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:k(function(){var A=this._input[0];this.yytext+=A,this.yyleng++,this.offset++,this.match+=A,this.matched+=A;var E=A.match(/(?:\r\n?|\n).*/g);return E?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),A},"input"),unput:k(function(A){var E=A.length,S=A.split(/(?:\r\n?|\n)/g);this._input=A+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-E),this.offset-=E;var l=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),S.length-1&&(this.yylineno-=S.length-1);var O=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:S?(S.length===l.length?this.yylloc.first_column:0)+l[l.length-S.length].length-S[0].length:this.yylloc.first_column-E},this.options.ranges&&(this.yylloc.range=[O[0],O[0]+this.yyleng-E]),this.yyleng=this.yytext.length,this},"unput"),more:k(function(){return this._more=!0,this},"more"),reject:k(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
25
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:k(function(A){this.unput(this.match.slice(A))},"less"),pastInput:k(function(){var A=this.matched.substr(0,this.matched.length-this.match.length);return(A.length>20?"...":"")+A.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:k(function(){var A=this.match;return A.length<20&&(A+=this._input.substr(0,20-A.length)),(A.substr(0,20)+(A.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:k(function(){var A=this.pastInput(),E=new Array(A.length+1).join("-");return A+this.upcomingInput()+`
|
|
26
|
+
`+E+"^"},"showPosition"),test_match:k(function(A,E){var S,l,O;if(this.options.backtrack_lexer&&(O={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(O.yylloc.range=this.yylloc.range.slice(0))),l=A[0].match(/(?:\r\n?|\n).*/g),l&&(this.yylineno+=l.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:l?l[l.length-1].length-l[l.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+A[0].length},this.yytext+=A[0],this.match+=A[0],this.matches=A,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(A[0].length),this.matched+=A[0],S=this.performAction.call(this,this.yy,this,E,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),S)return S;if(this._backtrack){for(var e in O)this[e]=O[e];return!1}return!1},"test_match"),next:k(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var A,E,S,l;this._more||(this.yytext="",this.match="");for(var O=this._currentRules(),e=0;e<O.length;e++)if(S=this._input.match(this.rules[O[e]]),S&&(!E||S[0].length>E[0].length)){if(E=S,l=e,this.options.backtrack_lexer){if(A=this.test_match(S,O[e]),A!==!1)return A;if(this._backtrack){E=!1;continue}else return!1}else if(!this.options.flex)break}return E?(A=this.test_match(E,O[l]),A!==!1?A:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
|
|
27
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:k(function(){var E=this.next();return E||this.lex()},"lex"),begin:k(function(E){this.conditionStack.push(E)},"begin"),popState:k(function(){var E=this.conditionStack.length-1;return E>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:k(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:k(function(E){return E=this.conditionStack.length-1-Math.abs(E||0),E>=0?this.conditionStack[E]:"INITIAL"},"topState"),pushState:k(function(E){this.begin(E)},"pushState"),stateStackSize:k(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:k(function(E,S,l,O){switch(l){case 0:return this.begin("acc_title"),38;case 1:return this.popState(),"acc_title_value";case 2:return this.begin("acc_descr"),40;case 3:return this.popState(),"acc_descr_value";case 4:this.begin("acc_descr_multiline");break;case 5:this.popState();break;case 6:return"acc_descr_multiline_value";case 7:return this.pushState("shapeData"),S.yytext="",43;case 8:return this.pushState("shapeDataStr"),43;case 9:return this.popState(),43;case 10:const e=/\n\s*/g;return S.yytext=S.yytext.replace(e,"<br/>"),43;case 11:return 43;case 12:this.popState();break;case 13:this.begin("callbackname");break;case 14:this.popState();break;case 15:this.popState(),this.begin("callbackargs");break;case 16:return 98;case 17:this.popState();break;case 18:return 99;case 19:return"MD_STR";case 20:this.popState();break;case 21:this.begin("md_string");break;case 22:return"STR";case 23:this.popState();break;case 24:this.pushState("string");break;case 25:return 87;case 26:return 105;case 27:return 88;case 28:return 107;case 29:return 89;case 30:return 90;case 31:return 100;case 32:this.begin("click");break;case 33:this.popState();break;case 34:return 91;case 35:return E.lex.firstGraph()&&this.begin("dir"),13;case 36:return 28;case 37:return 36;case 38:return 35;case 39:return 33;case 40:return 101;case 41:return 101;case 42:return 101;case 43:return 101;case 44:return this.popState(),14;case 45:return this.popState(),15;case 46:return this.popState(),15;case 47:return this.popState(),15;case 48:return this.popState(),15;case 49:return this.popState(),15;case 50:return this.popState(),15;case 51:return this.popState(),15;case 52:return this.popState(),15;case 53:return this.popState(),15;case 54:return this.popState(),15;case 55:return 124;case 56:return 125;case 57:return 126;case 58:return 127;case 59:return 128;case 60:return 81;case 61:return 108;case 62:return 114;case 63:return 49;case 64:return 63;case 65:return 47;case 66:return 9;case 67:return 109;case 68:return 118;case 69:return this.popState(),80;case 70:return this.pushState("edgeText"),78;case 71:return 122;case 72:return 80;case 73:break;case 74:return this.popState(),56;case 75:return"TEXT";case 76:return this.pushState("ellipseText"),55;case 77:return this.popState(),58;case 78:return this.pushState("text"),57;case 79:return this.popState(),60;case 80:return this.pushState("text"),59;case 81:return 61;case 82:return this.pushState("text"),70;case 83:return this.popState(),67;case 84:return this.pushState("text"),66;case 85:return this.popState(),52;case 86:return this.pushState("text"),51;case 87:break;case 88:return this.popState(),72;case 89:return this.popState(),74;case 90:return 120;case 91:return this.pushState("trapText"),71;case 92:return this.pushState("trapText"),73;case 93:return 121;case 94:return 70;case 95:return 93;case 96:return"SEP";case 97:return 92;case 98:return 118;case 99:return 114;case 100:return 47;case 101:return 8;case 102:return 112;case 103:return 117;case 104:return 119;case 105:return this.popState(),65;case 106:return this.pushState("text"),65;case 107:return this.popState(),54;case 108:return this.pushState("text"),53;case 109:return this.popState(),32;case 110:return this.pushState("text"),30;case 111:return this.popState(),69;case 112:return this.pushState("text"),68;case 113:break;case 114:return"TEXT";case 115:return"QUOTE";case 116:return 10;case 117:return 11;case 118:return 12}},"anonymous"),rules:[/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:@\{)/,/^(?:["])/,/^(?:["])/,/^(?:[^\"]+)/,/^(?:[^}^"]+)/,/^(?:\})/,/^(?:call[\s]+)/,/^(?:\([\s]*\))/,/^(?:\()/,/^(?:[^(]*)/,/^(?:\))/,/^(?:[^)]*)/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["][`])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:["])/,/^(?:style\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\b)/,/^(?:class\b)/,/^(?:href[\s])/,/^(?:click[\s]+)/,/^(?:[\s\n])/,/^(?:[^\s\n]*)/,/^(?:agentflow-beta\b)/,/^(?:flow\b)/,/^(?:connector\b)/,/^(?:global\b[ \t]*)/,/^(?:end\b[ \t]*)/,/^(?:_self\b)/,/^(?:_blank\b)/,/^(?:_parent\b)/,/^(?:_top\b)/,/^(?:(\r?\n)*\s*\n)/,/^(?:\s*LR\b)/,/^(?:\s*RL\b)/,/^(?:\s*TB\b)/,/^(?:\s*BT\b)/,/^(?:\s*TD\b)/,/^(?:\s*BR\b)/,/^(?:\s*<)/,/^(?:\s*>)/,/^(?:\s*\^)/,/^(?:\s*v\b)/,/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:.*direction\s+TD[^\n]*)/,/^(?:[^\s\"]+@(?=[^\{\"]))/,/^(?:[0-9]+)/,/^(?:#)/,/^(?::::)/,/^(?::)/,/^(?:&)/,/^(?:;)/,/^(?:,)/,/^(?:\*)/,/^(?:\s*--+[x>]\s*)/,/^(?:\s*--\s*)/,/^(?:[^-]|-(?!-)+)/,/^(?:\s*-\.+-\s*)/,/^(?:%%(?!\{)[^\n]*)/,/^(?:[-/\)][\)])/,/^(?:[^\(\)\[\]\{\}]|!\)+)/,/^(?:\(-)/,/^(?:\]\))/,/^(?:\(\[)/,/^(?:\]\])/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:>)/,/^(?:\)\])/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\(\(\()/,/^(?:%%(?!\{)[^\n]*)/,/^(?:[\\(?=\])][\]])/,/^(?:\/(?=\])\])/,/^(?:\/(?!\])|\\(?!\])|(?:[^\\\[\]\(\)\{\}\/%]+|(?!))+)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:<)/,/^(?:>)/,/^(?:\^)/,/^(?:\\\|)/,/^(?:v\b)/,/^(?:\*)/,/^(?:#)/,/^(?:&)/,/^(?:[ \t]*%%(?!\{)[^\n]*)/,/^(?:([A-Za-z0-9!"\#$%&'*+\.`?\\_\/]|-(?=[^\>\-\.])|(?!))+)/,/^(?:-)/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/,/^(?:\|)/,/^(?:\|)/,/^(?:\))/,/^(?:\()/,/^(?:\])/,/^(?:\[)/,/^(?:(\}))/,/^(?:\{)/,/^(?:%%(?!\{)[^\n]*)/,/^(?:(?:[^\[\]\(\)\{\}\|\"%]+|(?!))+)/,/^(?:")/,/^(?:(\r?\n)+)/,/^(?:\s)/,/^(?:$)/],conditions:{shapeDataEndBracket:{rules:[21,24,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},shapeDataStr:{rules:[9,10,21,24,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},shapeData:{rules:[8,11,12,21,24,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},callbackargs:{rules:[17,18,21,24,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},callbackname:{rules:[14,15,16,21,24,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},href:{rules:[21,24,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},click:{rules:[21,24,33,34,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},edgeText:{rules:[21,24,69,71,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},trapText:{rules:[21,24,76,78,80,84,86,87,88,89,90,91,92,106,108,110,112],inclusive:!1},ellipseText:{rules:[21,24,73,74,75,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},text:{rules:[21,24,76,77,78,79,80,83,84,85,86,91,92,105,106,107,108,109,110,111,112,113,114],inclusive:!1},vertex:{rules:[21,24,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},dir:{rules:[21,24,44,45,46,47,48,49,50,51,52,53,54,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},acc_descr_multiline:{rules:[5,6,21,24,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},acc_descr:{rules:[3,21,24,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},acc_title:{rules:[1,21,24,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},md_string:{rules:[19,20,21,24,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},string:{rules:[21,22,23,24,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},INITIAL:{rules:[0,2,4,7,13,21,24,25,26,27,28,29,30,31,32,35,36,37,38,39,40,41,42,43,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,72,76,78,80,81,82,84,86,91,92,93,94,95,96,97,98,99,100,101,102,103,104,106,108,110,112,115,116,117,118],inclusive:!0}}};return Te})();Bt.lexer=f1;function _t(){this.yy={}}return k(_t,"Parser"),_t.prototype=Bt,Bt.Parser=_t,new _t})();Ut.parser=Ut;var h1=Ut,p1=Object.assign({},h1);p1.parse=s=>{const i=s.replace(/}[^\S\n]*\n/g,`}
|
|
28
|
+
`);return h1.parse(i)};var $1=p1,es=k(s=>{const{theme:i,bkgColorArray:n,borderColorArray:r}=s;if(!N1(i,r))return"";const o=R1(s.look),u=w1(n),c=O1(s.THEME_COLOR_LIMIT,r),a=k(h=>r[h%r.length],"border"),d=k(h=>u?`fill: ${n[h%n.length]};`:"","fill");let f="";for(const h of Y1){const b=Lt.get(h),C=`[data-look="${o}"].node.${o1(h)}`;f+=`
|
|
29
|
+
|
|
30
|
+
${C} rect,
|
|
31
|
+
${C} path,
|
|
32
|
+
${C} polygon {
|
|
33
|
+
stroke: ${a(b)};
|
|
34
|
+
${d(b)}
|
|
35
|
+
}
|
|
36
|
+
`}for(let h=0;h<u1(c);h++){const b=l1(h,c),C=`[data-look="${o}"][data-color-id="color-${b}"].cluster`,L=`[data-look="${o}"][data-color-id="color-${b}"].node`,M=k(D=>`${C} ${D}, ${L} ${D}`,"rule");f+=`
|
|
37
|
+
|
|
38
|
+
${M("rect")},
|
|
39
|
+
${M("path")} {
|
|
40
|
+
stroke: ${a(b)};
|
|
41
|
+
${d(b)}
|
|
42
|
+
}
|
|
43
|
+
`}return f},"genColor"),ts=k((s,i)=>{const n=U1,r=n(s,"r"),o=n(s,"g"),u=n(s,"b");return P1(r,o,u,i)},"fade"),ss=k(s=>`${es(s)}
|
|
44
|
+
.label {
|
|
45
|
+
font-family: ${s.fontFamily};
|
|
46
|
+
color: ${s.nodeTextColor||s.textColor};
|
|
47
|
+
}
|
|
48
|
+
.cluster-label text {
|
|
49
|
+
fill: ${s.titleColor};
|
|
50
|
+
}
|
|
51
|
+
.cluster-label span {
|
|
52
|
+
color: ${s.titleColor};
|
|
53
|
+
}
|
|
54
|
+
.cluster-label span p {
|
|
55
|
+
background-color: transparent;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.label text,span {
|
|
59
|
+
fill: ${s.nodeTextColor||s.textColor};
|
|
60
|
+
color: ${s.nodeTextColor||s.textColor};
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.node rect,
|
|
64
|
+
.node circle,
|
|
65
|
+
.node ellipse,
|
|
66
|
+
.node polygon,
|
|
67
|
+
.node path {
|
|
68
|
+
fill: ${s.mainBkg};
|
|
69
|
+
stroke: ${s.nodeBorder};
|
|
70
|
+
stroke-width: ${s.strokeWidth??1}px;
|
|
71
|
+
}
|
|
72
|
+
.rough-node .label text , .node .label text, .image-shape .label, .icon-shape .label {
|
|
73
|
+
text-anchor: middle;
|
|
74
|
+
}
|
|
75
|
+
.node .katex path {
|
|
76
|
+
fill: ${s.nodeTextColor||s.textColor};
|
|
77
|
+
stroke: ${s.nodeTextColor||s.textColor};
|
|
78
|
+
stroke-width: 1px;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.rough-node .label,.node .label, .image-shape .label, .icon-shape .label {
|
|
82
|
+
text-align: center;
|
|
83
|
+
}
|
|
84
|
+
.node.clickable {
|
|
85
|
+
cursor: pointer;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
.root .anchor path {
|
|
90
|
+
fill: ${s.lineColor} !important;
|
|
91
|
+
stroke-width: 0;
|
|
92
|
+
stroke: ${s.lineColor};
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.arrowheadPath {
|
|
96
|
+
fill: ${s.arrowheadColor};
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.edgePaths .path {
|
|
100
|
+
stroke: ${s.lineColor};
|
|
101
|
+
stroke-width: ${s.strokeWidth??2}px;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.flowchart-link {
|
|
105
|
+
stroke: ${s.lineColor};
|
|
106
|
+
fill: none;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.edgeLabel {
|
|
110
|
+
background-color: ${s.edgeLabelBackground};
|
|
111
|
+
p {
|
|
112
|
+
background-color: ${s.edgeLabelBackground};
|
|
113
|
+
}
|
|
114
|
+
rect {
|
|
115
|
+
opacity: 0.5;
|
|
116
|
+
background-color: ${s.edgeLabelBackground};
|
|
117
|
+
fill: ${s.edgeLabelBackground};
|
|
118
|
+
}
|
|
119
|
+
text-align: center;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/* For html labels only */
|
|
123
|
+
.labelBkg {
|
|
124
|
+
background-color: ${ts(s.edgeLabelBackground,.5)};
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.cluster rect {
|
|
128
|
+
fill: ${s.clusterBkg};
|
|
129
|
+
stroke: ${s.clusterBorder};
|
|
130
|
+
stroke-width: 1px;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.flow-cluster rect {
|
|
134
|
+
fill: none;
|
|
135
|
+
stroke: ${s.clusterBorder};
|
|
136
|
+
stroke-width: 0.75px;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.node .collapsed-indicator {
|
|
140
|
+
fill: ${s.nodeBorder};
|
|
141
|
+
stroke: none;
|
|
142
|
+
stroke-width: 0;
|
|
143
|
+
opacity: 0.5;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.node .collapsed-separator {
|
|
147
|
+
stroke-width: 0.75px;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.cluster text {
|
|
151
|
+
fill: ${s.titleColor};
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.cluster span {
|
|
155
|
+
color: ${s.titleColor};
|
|
156
|
+
}
|
|
157
|
+
/* .cluster div {
|
|
158
|
+
color: ${s.titleColor};
|
|
159
|
+
} */
|
|
160
|
+
|
|
161
|
+
div.mermaidTooltip {
|
|
162
|
+
position: absolute;
|
|
163
|
+
text-align: center;
|
|
164
|
+
max-width: 200px;
|
|
165
|
+
padding: 2px;
|
|
166
|
+
font-family: ${s.fontFamily};
|
|
167
|
+
font-size: 12px;
|
|
168
|
+
background: ${s.tertiaryColor};
|
|
169
|
+
border: 1px solid ${s.border2};
|
|
170
|
+
border-radius: 2px;
|
|
171
|
+
pointer-events: none;
|
|
172
|
+
z-index: 100;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.agentflowTitleText {
|
|
176
|
+
text-anchor: middle;
|
|
177
|
+
font-size: 18px;
|
|
178
|
+
fill: ${s.textColor};
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
rect.text {
|
|
182
|
+
fill: none;
|
|
183
|
+
stroke-width: 0;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.icon-shape, .image-shape {
|
|
187
|
+
background-color: ${s.edgeLabelBackground};
|
|
188
|
+
p {
|
|
189
|
+
background-color: ${s.edgeLabelBackground};
|
|
190
|
+
padding: 2px;
|
|
191
|
+
}
|
|
192
|
+
.label rect {
|
|
193
|
+
opacity: 0.5;
|
|
194
|
+
background-color: ${s.edgeLabelBackground};
|
|
195
|
+
fill: ${s.edgeLabelBackground};
|
|
196
|
+
}
|
|
197
|
+
text-align: center;
|
|
198
|
+
}
|
|
199
|
+
${k1()}
|
|
200
|
+
`,"getStyles"),is=ss,hs={parser:$1,get db(){return new X1},renderer:Z1,styles:is,init:k(s=>{s.agentflow??(s.agentflow={}),s.layout&&t1({layout:s.layout}),s.flowchart??(s.flowchart={}),s.flowchart.arrowMarkerAbsolute=s.arrowMarkerAbsolute,t1({flowchart:{arrowMarkerAbsolute:s.arrowMarkerAbsolute}})},"init")};export{hs as diagram};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import{p as ge}from"./chunk-JWPE2WC7-D1qG9232.js";import{_ as w,R as ye,L as ae,N as ee,Q as Se,d as ve,l as te,bn as B,k as Q,b as xe,a as be,q as we,t as Ce,g as Te,s as Le,O as $e,bo as Ae,A as Fe}from"./index-DNSP9H_v.js";import{s as Ne}from"./chunk-WEXAMYUT-aMK135IE.js";import{p as Me}from"./cynefin-OW5HDTMX-BwkqOigD.js";import{b as O}from"./defaultLocale-DX6XiGOO.js";import{o as K}from"./ordinal-Cboi1Yqb.js";import"./vue-BhwNxZ68.js";import"./element-plus-IBMLLhb-.js";import"./init-Gi6I4Gst.js";function _e(t){var a=0,l=t.children,n=l&&l.length;if(!n)a=1;else for(;--n>=0;)a+=l[n].value;t.value=a}function ke(){return this.eachAfter(_e)}function ze(t,a){let l=-1;for(const n of this)t.call(a,n,++l,this);return this}function Ve(t,a){for(var l=this,n=[l],r,s,h=-1;l=n.pop();)if(t.call(a,l,++h,this),r=l.children)for(s=r.length-1;s>=0;--s)n.push(r[s]);return this}function De(t,a){for(var l=this,n=[l],r=[],s,h,d,g=-1;l=n.pop();)if(r.push(l),s=l.children)for(h=0,d=s.length;h<d;++h)n.push(s[h]);for(;l=r.pop();)t.call(a,l,++g,this);return this}function Pe(t,a){let l=-1;for(const n of this)if(t.call(a,n,++l,this))return n}function Be(t){return this.eachAfter(function(a){for(var l=+t(a.data)||0,n=a.children,r=n&&n.length;--r>=0;)l+=n[r].value;a.value=l})}function Re(t){return this.eachBefore(function(a){a.children&&a.children.sort(t)})}function Ee(t){for(var a=this,l=We(a,t),n=[a];a!==l;)a=a.parent,n.push(a);for(var r=n.length;t!==l;)n.splice(r,0,t),t=t.parent;return n}function We(t,a){if(t===a)return t;var l=t.ancestors(),n=a.ancestors(),r=null;for(t=l.pop(),a=n.pop();t===a;)r=t,t=l.pop(),a=n.pop();return r}function He(){for(var t=this,a=[t];t=t.parent;)a.push(t);return a}function Ie(){return Array.from(this)}function Oe(){var t=[];return this.eachBefore(function(a){a.children||t.push(a)}),t}function qe(){var t=this,a=[];return t.each(function(l){l!==t&&a.push({source:l.parent,target:l})}),a}function*Ge(){var t=this,a,l=[t],n,r,s;do for(a=l.reverse(),l=[];t=a.pop();)if(yield t,n=t.children)for(r=0,s=n.length;r<s;++r)l.push(n[r]);while(l.length)}function ne(t,a){t instanceof Map?(t=[void 0,t],a===void 0&&(a=je)):a===void 0&&(a=Ye);for(var l=new U(t),n,r=[l],s,h,d,g;n=r.pop();)if((h=a(n.data))&&(g=(h=Array.from(h)).length))for(n.children=h,d=g-1;d>=0;--d)r.push(s=h[d]=new U(h[d])),s.parent=n,s.depth=n.depth+1;return l.eachBefore(Ue)}function Xe(){return ne(this).eachBefore(Qe)}function Ye(t){return t.children}function je(t){return Array.isArray(t)?t[1]:null}function Qe(t){t.data.value!==void 0&&(t.value=t.data.value),t.data=t.data.data}function Ue(t){var a=0;do t.height=a;while((t=t.parent)&&t.height<++a)}function U(t){this.data=t,this.depth=this.height=0,this.parent=null}U.prototype=ne.prototype={constructor:U,count:ke,each:ze,eachAfter:De,eachBefore:Ve,find:Pe,sum:Be,sort:Re,path:Ee,ancestors:He,descendants:Ie,leaves:Oe,links:qe,copy:Xe,[Symbol.iterator]:Ge};function Ze(t){if(typeof t!="function")throw new Error;return t}function q(){return 0}function G(t){return function(){return t}}function Je(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}function Ke(t,a,l,n,r){for(var s=t.children,h,d=-1,g=s.length,c=t.value&&(n-a)/t.value;++d<g;)h=s[d],h.y0=l,h.y1=r,h.x0=a,h.x1=a+=h.value*c}function et(t,a,l,n,r){for(var s=t.children,h,d=-1,g=s.length,c=t.value&&(r-l)/t.value;++d<g;)h=s[d],h.x0=a,h.x1=n,h.y0=l,h.y1=l+=h.value*c}var tt=(1+Math.sqrt(5))/2;function at(t,a,l,n,r,s){for(var h=[],d=a.children,g,c,p=0,b=0,i=d.length,x,S,v=a.value,u,y,N,$,V,W,M;p<i;){x=r-l,S=s-n;do u=d[b++].value;while(!u&&b<i);for(y=N=u,W=Math.max(S/x,x/S)/(v*t),M=u*u*W,V=Math.max(N/M,M/y);b<i;++b){if(u+=c=d[b].value,c<y&&(y=c),c>N&&(N=c),M=u*u*W,$=Math.max(N/M,M/y),$>V){u-=c;break}V=$}h.push(g={value:u,dice:x<S,children:d.slice(p,b)}),g.dice?Ke(g,l,n,r,v?n+=S*u/v:s):et(g,l,n,v?l+=x*u/v:r,s),v-=u,p=b}return h}const nt=(function t(a){function l(n,r,s,h,d){at(a,n,r,s,h,d)}return l.ratio=function(n){return t((n=+n)>1?n:1)},l})(tt);function lt(){var t=nt,a=!1,l=1,n=1,r=[0],s=q,h=q,d=q,g=q,c=q;function p(i){return i.x0=i.y0=0,i.x1=l,i.y1=n,i.eachBefore(b),r=[0],a&&i.eachBefore(Je),i}function b(i){var x=r[i.depth],S=i.x0+x,v=i.y0+x,u=i.x1-x,y=i.y1-x;u<S&&(S=u=(S+u)/2),y<v&&(v=y=(v+y)/2),i.x0=S,i.y0=v,i.x1=u,i.y1=y,i.children&&(x=r[i.depth+1]=s(i)/2,S+=c(i)-x,v+=h(i)-x,u-=d(i)-x,y-=g(i)-x,u<S&&(S=u=(S+u)/2),y<v&&(v=y=(v+y)/2),t(i,S,v,u,y))}return p.round=function(i){return arguments.length?(a=!!i,p):a},p.size=function(i){return arguments.length?(l=+i[0],n=+i[1],p):[l,n]},p.tile=function(i){return arguments.length?(t=Ze(i),p):t},p.padding=function(i){return arguments.length?p.paddingInner(i).paddingOuter(i):p.paddingInner()},p.paddingInner=function(i){return arguments.length?(s=typeof i=="function"?i:G(+i),p):s},p.paddingOuter=function(i){return arguments.length?p.paddingTop(i).paddingRight(i).paddingBottom(i).paddingLeft(i):p.paddingTop()},p.paddingTop=function(i){return arguments.length?(h=typeof i=="function"?i:G(+i),p):h},p.paddingRight=function(i){return arguments.length?(d=typeof i=="function"?i:G(+i),p):d},p.paddingBottom=function(i){return arguments.length?(g=typeof i=="function"?i:G(+i),p):g},p.paddingLeft=function(i){return arguments.length?(c=typeof i=="function"?i:G(+i),p):c},p}var E,oe=(E=class{constructor(){this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.setAccTitle=xe,this.getAccTitle=be,this.setDiagramTitle=we,this.getDiagramTitle=Ce,this.getAccDescription=Te,this.setAccDescription=Le}getNodes(){return this.nodes}getConfig(){const a=$e,l=ae();return ee({...a.treemap,...l.treemap??{}})}addNode(a,l){this.nodes.push(a),this.levels.set(a,l),l===0&&(this.outerNodes.push(a),this.root??(this.root=a))}getRoot(){return{name:"",children:this.outerNodes}}addClass(a,l){const n=this.classes.get(a)??{id:a,styles:[],textStyles:[]},r=l.replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");r&&r.forEach(s=>{Ae(s)&&(n!=null&&n.textStyles?n.textStyles.push(s):n.textStyles=[s]),n!=null&&n.styles?n.styles.push(s):n.styles=[s]}),this.classes.set(a,n)}getClasses(){return this.classes}getStylesForClass(a){var l;return((l=this.classes.get(a))==null?void 0:l.styles)??[]}clear(){Fe(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}},w(E,"TreeMapDB"),E);function ce(t){if(!t.length)return[];const a=[],l=[];return t.forEach(n=>{const r={name:n.name,children:n.type==="Leaf"?void 0:[]};for(r.classSelector=n==null?void 0:n.classSelector,n!=null&&n.cssCompiledStyles&&(r.cssCompiledStyles=n.cssCompiledStyles),n.type==="Leaf"&&n.value!==void 0&&(r.value=n.value);l.length>0&&l[l.length-1].level>=n.level;)l.pop();if(l.length===0)a.push(r);else{const s=l[l.length-1].node;s.children?s.children.push(r):s.children=[r]}n.type!=="Leaf"&&l.push({node:r,level:n.level})}),a}w(ce,"buildHierarchy");var rt=w((t,a)=>{ge(t,a);const l=[];for(const s of t.TreemapRows??[])s.$type==="ClassDefStatement"&&a.addClass(s.className??"",s.styleText??"");for(const s of t.TreemapRows??[]){const h=s.item;if(!h)continue;const d=s.indent?parseInt(s.indent):0,g=st(h),c=h.classSelector?a.getStylesForClass(h.classSelector):[],p=c.length>0?c:void 0,b={level:d,name:g,type:h.$type,value:h.value,classSelector:h.classSelector,cssCompiledStyles:p};l.push(b)}const n=ce(l),r=w((s,h)=>{for(const d of s)a.addNode(d,h),d.children&&d.children.length>0&&r(d.children,h+1)},"addNodesRecursively");r(n,0)},"populate"),st=w(t=>t.name?String(t.name):"","getItemName"),he={parser:{yy:void 0},parse:w(async t=>{var a;try{const n=await Me("treemap",t);te.debug("Treemap AST:",n);const r=(a=he.parser)==null?void 0:a.yy;if(!(r instanceof oe))throw new Error("parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");rt(n,r)}catch(l){throw te.error("Error parsing treemap:",l),l}},"parse")},it=10,R=10,X=25,ot=w((t,a,l,n)=>{const r=n.db,s=r.getConfig(),h=s.padding??it,d=r.getDiagramTitle(),g=r.getRoot(),{themeVariables:c}=ae();if(!g)return;const p=d?30:0,b=Se(a),i=s.nodeWidth?s.nodeWidth*R:960,x=s.nodeHeight?s.nodeHeight*R:500,S=i,v=x+p;b.attr("viewBox",`0 0 ${S} ${v}`),ve(b,v,S,s.useMaxWidth);let u;try{const e=s.valueFormat||",";if(e==="$0,0")u=w(o=>"$"+O(",")(o),"valueFormat");else if(e.startsWith("$")&&e.includes(",")){const o=/\.\d+/.exec(e),f=o?o[0]:"";u=w(C=>"$"+O(","+f)(C),"valueFormat")}else if(e.startsWith("$")){const o=e.substring(1);u=w(f=>"$"+O(o||"")(f),"valueFormat")}else u=O(e)}catch(e){te.error("Error creating format function:",e),u=O(",")}const y=K().range(["transparent",c.cScale0,c.cScale1,c.cScale2,c.cScale3,c.cScale4,c.cScale5,c.cScale6,c.cScale7,c.cScale8,c.cScale9,c.cScale10,c.cScale11]),N=K().range(["transparent",c.cScalePeer0,c.cScalePeer1,c.cScalePeer2,c.cScalePeer3,c.cScalePeer4,c.cScalePeer5,c.cScalePeer6,c.cScalePeer7,c.cScalePeer8,c.cScalePeer9,c.cScalePeer10,c.cScalePeer11]),$=K().range([c.cScaleLabel0,c.cScaleLabel1,c.cScaleLabel2,c.cScaleLabel3,c.cScaleLabel4,c.cScaleLabel5,c.cScaleLabel6,c.cScaleLabel7,c.cScaleLabel8,c.cScaleLabel9,c.cScaleLabel10,c.cScaleLabel11]);d&&b.append("text").attr("x",S/2).attr("y",p/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(d);const V=b.append("g").attr("transform",`translate(0, ${p})`).attr("class","treemapContainer"),W=ne(g).sum(e=>e.value??0).sort((e,o)=>(o.value??0)-(e.value??0)),le=lt().size([i,x]).paddingTop(e=>e.children&&e.children.length>0?X+R:0).paddingInner(h).paddingLeft(e=>e.children&&e.children.length>0?R:0).paddingRight(e=>e.children&&e.children.length>0?R:0).paddingBottom(e=>e.children&&e.children.length>0?R:0).round(!0)(W),de=le.descendants().filter(e=>e.children&&e.children.length>0),H=V.selectAll(".treemapSection").data(de).enter().append("g").attr("class","treemapSection").attr("transform",e=>`translate(${e.x0},${e.y0})`);H.append("rect").attr("width",e=>e.x1-e.x0).attr("height",X).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",.6).attr("stroke-width",.6).attr("style",e=>e.depth===0?"display: none;":""),H.append("clipPath").attr("id",(e,o)=>`clip-section-${a}-${o}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-12)).attr("height",X),H.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class",(e,o)=>`treemapSection section${o}`).attr("fill",e=>y(e.data.name)).attr("fill-opacity",.6).attr("stroke",e=>N(e.data.name)).attr("stroke-width",2).attr("stroke-opacity",.4).attr("style",e=>{if(e.depth===0)return"display: none;";const o=B({cssCompiledStyles:e.data.cssCompiledStyles});return o.nodeStyles+";"+o.borderStyles.join(";")}),H.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",X/2).attr("dominant-baseline","middle").text(e=>e.depth===0?"":e.data.name).attr("font-weight","bold").attr("clip-path",(e,o)=>`url(#clip-section-${a}-${o})`).attr("style",e=>{if(e.depth===0)return"display: none;";const o="dominant-baseline: middle; font-size: 12px; fill:"+$(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",f=B({cssCompiledStyles:e.data.cssCompiledStyles});return o+f.labelStyles.replace("color:","fill:")}).each(function(e){if(e.depth===0)return;const o=Q(this),f=e.data.name;o.text(f);const C=e.x1-e.x0,L=6;let T;s.showValues!==!1&&e.value?T=C-10-30-10-L:T=C-L-6;const m=Math.max(15,T),_=o.node();if(_.getComputedTextLength()>m){let z=f;for(;z.length>0;){if(z=f.substring(0,z.length-1),z.length===0){o.text("..."),_.getComputedTextLength()>m&&o.text("");break}if(o.text(z+"..."),_.getComputedTextLength()<=m)break}}}),s.showValues!==!1&&H.append("text").attr("class","treemapSectionValue").attr("x",e=>e.x1-e.x0-10).attr("y",X/2).attr("text-anchor","end").attr("dominant-baseline","middle").text(e=>e.value?u(e.value):"").attr("font-style","italic").attr("style",e=>{if(e.depth===0)return"display: none;";const o="text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+$(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",f=B({cssCompiledStyles:e.data.cssCompiledStyles});return o+f.labelStyles.replace("color:","fill:")});const re=le.leaves(),A=re.length>20,pe=A?16:38,Y=A?14:28,D=A?4:8,I=A?4:6,Z=A?2:4,se=A?8:10,J=A?1:2,j=V.selectAll(".treemapLeafGroup").data(re).enter().append("g").attr("class",(e,o)=>`treemapNode treemapLeafGroup leaf${o}${e.data.classSelector?` ${e.data.classSelector}`:""}x`).attr("transform",e=>`translate(${e.x0},${e.y0})`);j.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class","treemapLeaf").attr("fill",e=>e.parent?y(e.parent.data.name):y(e.data.name)).attr("style",e=>B({cssCompiledStyles:e.data.cssCompiledStyles}).nodeStyles).attr("fill-opacity",.3).attr("stroke",e=>e.parent?y(e.parent.data.name):y(e.data.name)).attr("stroke-width",3),j.append("clipPath").attr("id",(e,o)=>`clip-${a}-${o}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-4)).attr("height",e=>Math.max(0,e.y1-e.y0-4)),j.append("text").attr("class","treemapLabel").attr("x",e=>(e.x1-e.x0)/2).attr("y",e=>(e.y1-e.y0)/2).attr("style",e=>{const o=`text-anchor: middle; dominant-baseline: middle; font-size: ${pe}px;fill:`+$(e.data.name)+";",f=B({cssCompiledStyles:e.data.cssCompiledStyles});return o+f.labelStyles.replace("color:","fill:")}).attr("clip-path",(e,o)=>`url(#clip-${a}-${o})`).text(e=>e.data.name).each(function(e){const o=Q(this),f=e.x1-e.x0,C=e.y1-e.y0,L=o.node(),T=f-2*Z,P=C-2*Z;if(T<se||P<se){o.style("display","none");return}let m=parseInt(o.style("font-size"),10);const _=.6;for(;L.getComputedTextLength()>T&&m>D;)m--,o.style("font-size",`${m}px`);let F=Math.max(I,Math.min(Y,Math.round(m*_))),k=m+J+F;for(;k>P&&m>D&&(m--,F=Math.max(I,Math.min(Y,Math.round(m*_))),!(F<I&&m===D));)o.style("font-size",`${m}px`),k=m+J+F;o.style("font-size",`${m}px`),A?(m<D||P<D)&&o.style("display","none"):(L.getComputedTextLength()>T||m<D||P<m)&&o.style("display","none")}),s.showValues!==!1&&j.append("text").attr("class","treemapValue").attr("x",o=>(o.x1-o.x0)/2).attr("y",function(o){return(o.y1-o.y0)/2}).attr("style",o=>{const f=`text-anchor: middle; dominant-baseline: hanging; font-size: ${Y}px;fill:`+$(o.data.name)+";",C=B({cssCompiledStyles:o.data.cssCompiledStyles});return f+C.labelStyles.replace("color:","fill:")}).attr("clip-path",(o,f)=>`url(#clip-${a}-${f})`).text(o=>o.value?u(o.value):"").each(function(o){const f=Q(this),C=this.parentNode;if(!C){f.style("display","none");return}const L=Q(C).select(".treemapLabel");if(L.empty()||L.style("display")==="none"){f.style("display","none");return}const T=parseFloat(L.style("font-size")),m=Math.max(I,Math.min(Y,Math.round(T*.6)));f.style("font-size",`${m}px`);const F=(o.y1-o.y0)/2+T/2+J;f.attr("y",F);const k=o.x1-o.x0,ie=o.y1-o.y0-4,me=k-2*Z;f.node().getComputedTextLength()>me||F+m>ie||m<I?f.style("display","none"):f.style("display",null)});const ue=s.diagramPadding??8;Ne(b,ue,"flowchart",(s==null?void 0:s.useMaxWidth)||!1)},"draw"),ct=w(function(t,a){return a.db.getClasses()},"getClasses"),ht={draw:ot,getClasses:ct},dt={sectionStrokeColor:"black",sectionStrokeWidth:"1",sectionFillColor:"#efefef",leafStrokeColor:"black",leafStrokeWidth:"1",leafFillColor:"#efefef",labelFontSize:"12px",valueFontSize:"10px",titleFontSize:"14px"},pt=w(({treemap:t}={})=>{const a=ye(),l=ae(),n=ee(a,l.themeVariables),r=ee(dt,t),s=r.titleColor??n.titleColor,h=r.labelColor??n.textColor,d=r.valueColor??n.textColor;return`
|
|
2
|
+
.treemapNode.section {
|
|
3
|
+
stroke: ${r.sectionStrokeColor};
|
|
4
|
+
stroke-width: ${r.sectionStrokeWidth};
|
|
5
|
+
fill: ${r.sectionFillColor};
|
|
6
|
+
}
|
|
7
|
+
.treemapNode.leaf {
|
|
8
|
+
stroke: ${r.leafStrokeColor};
|
|
9
|
+
stroke-width: ${r.leafStrokeWidth};
|
|
10
|
+
fill: ${r.leafFillColor};
|
|
11
|
+
}
|
|
12
|
+
.treemapLabel {
|
|
13
|
+
fill: ${h};
|
|
14
|
+
font-size: ${r.labelFontSize};
|
|
15
|
+
}
|
|
16
|
+
.treemapValue {
|
|
17
|
+
fill: ${d};
|
|
18
|
+
font-size: ${r.valueFontSize};
|
|
19
|
+
}
|
|
20
|
+
.treemapTitle {
|
|
21
|
+
fill: ${s};
|
|
22
|
+
font-size: ${r.titleFontSize};
|
|
23
|
+
}
|
|
24
|
+
`},"getStyles"),ut=pt,Tt={parser:he,get db(){return new oe},renderer:ht,styles:ut};export{Tt as diagram};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{p as oe}from"./chunk-JWPE2WC7-D1qG9232.js";import{t as se,q as de,s as le,g as ce,a as me,b as ue,_ as o,l as g,c as N,k as xe,M as fe,A as ge,N as he,L as E,O as pe,j as P,w as S,as as be}from"./index-DNSP9H_v.js";import{p as ve,i as we}from"./cynefin-OW5HDTMX-BwkqOigD.js";import"./vue-BhwNxZ68.js";import"./element-plus-IBMLLhb-.js";var T="position frame",D="frame positioned",M="position relation",C="relation positioned",ye=o(function(e){g.debug("options str",e)},"setOptions"),Pe=o(function(){return{}},"getOptions"),Se=o(function(){O(),ge()},"clear");function O(){A={}}o(O,"reset");var ke=pe.eventmodeling,Me=o(()=>he({...ke,...E().eventmodeling}),"getConfig"),A={};function W(){let e=Be;const{ast:n}=A,t=R();if(!n)throw new Error("No data for EventModel");return n.frames.forEach((i,a)=>{const r=X(i,n.dataEntities,t);e=w(e,{$kind:T,index:a,frame:i,textProps:r});let d;q(i)?(g.debug("source frame",i.sourceFrames),d=n.frames.filter(l=>i.sourceFrames.some(c=>c.$refText===l.name)),d.forEach(l=>{e=w(e,{$kind:M,index:a,frame:i,sourceFrame:l})})):e=w(e,{$kind:M,index:a,frame:i})}),e={...e,sortedSwimlanesArray:$(e.swimlanes)},e}o(W,"getState");function I(e){A.ast=e}o(I,"setAst");var s={swimlaneMinHeight:70,swimlanePadding:15,swimlaneGap:10,boxPadding:10,boxOverlap:90,boxDefaultY:0,boxMinWidth:80,boxMaxWidth:450,boxMinHeight:80,boxMaxHeight:750,contentStartX:250,textMaxWidth:430,boxTextFontWeight:"bold",boxTextPadding:10,swimlaneTextFontWeight:"bold",labelUiAutomation:"UI/Automation",labelUiAutomationPrefix:"UI/A: ",labelCommandReadModel:"Command/Read Model",labelCommandReadModelPrefix:"C/RM: ",labelEvents:"Events",labelEventsPrefix:"Stream: "};function R(){return s}o(R,"getDiagramProps");var Be={boxes:[],swimlanes:{},relations:[],maxR:0,sortedSwimlanesArray:[]};function H(e){const n=e.split(".");if(n.length===2)return n[0]}o(H,"extractNamespace");function U(e){const n=e.split(".");return n.length===2?n[1]:e}o(U,"extractName");function _(e,n){if(!(!n||n.length===0))return Object.values(e).find(t=>t.namespace===n)}o(_,"findSwimlaneByNamespace");function v(e,n,t){return Math.max(n,...Object.keys(e).filter(i=>{const a=Number.parseInt(i);return a>n&&a<t}).map(i=>Number.parseInt(i)))+1}o(v,"findNextAvailableIndex");function L(e,n){const t=H(e.entityIdentifier),i=_(n,t);switch(e.modelEntityType){case"ui":case"pcr":case"processor":return i?{index:i.index,label:i.namespace||s.labelUiAutomation}:t?{index:v(n,0,100),label:s.labelUiAutomationPrefix+t}:{index:0,label:s.labelUiAutomation};case"rmo":case"readmodel":case"cmd":case"command":return i?{index:i.index,label:i.namespace||s.labelCommandReadModel}:t?{index:v(n,100,200),label:s.labelCommandReadModelPrefix+t}:{index:100,label:s.labelCommandReadModel};case"evt":case"event":default:return i?{index:i.index,label:i.namespace||s.labelEvents}:t?{index:v(n,200,300),label:s.labelEventsPrefix+t}:{index:200,label:s.labelEvents}}}o(L,"calculateSwimlaneProps");function V(e){const{themeVariables:n}=E();switch(e.modelEntityType){case"ui":return{fill:n.emUiFill??"white",stroke:n.emUiStroke??"#dbdada"};case"pcr":case"processor":return{fill:n.emProcessorFill??"#edb3f6",stroke:n.emProcessorStroke??"#b88cbf"};case"rmo":case"readmodel":return{fill:n.emReadModelFill??"#d3f1a2",stroke:n.emReadModelStroke??"#a3b732"};case"cmd":case"command":return{fill:n.emCommandFill??"#bcd6fe",stroke:n.emCommandStroke??"#679ac3"};case"evt":case"event":return{fill:n.emEventFill??"#ffb778",stroke:n.emEventStroke??"#c19a0f"};default:return{fill:"red",stroke:"black"}}}o(V,"calculateEntityVisualProps");function X(e,n,t){const i=E(),a=P(U(e.entityIdentifier)??"",i);let r;const d={fontSize:16,fontWeight:700,fontFamily:'"trebuchet ms", verdana, arial, sans-serif',joinWith:"<br/>"};let c=`<b>${S(a,t.textMaxWidth,d)}</b>`;if(e.dataInlineValue&&(r=e.dataInlineValue,r=r.substring(r.indexOf("{")+1),r=r.substring(0,r.lastIndexOf("}")-1),r=P(r,i),r=S(r,t.textMaxWidth,d),r=r.replaceAll(" "," ")),e.dataReference){const p=n.find(y=>{var b;return y.name===((b=e.dataReference)==null?void 0:b.$refText)});p&&(r=p.dataBlockValue,r=r.substring(r.indexOf(`{
|
|
2
|
+
`)+2),r=r.substring(0,r.lastIndexOf("}")-1),r=P(r,i),r=S(r,t.textMaxWidth,d),r=r.replaceAll(" "," "),r+="<br/>")}const m=r!==void 0;m&&(c+=`<br/><br/><code style="text-align: left; display: block;max-width:${t.textMaxWidth}px">${r}</code>`);const x={fontSize:d.fontSize,fontWeight:d.fontWeight,fontFamily:d.fontFamily},u=be(c,x),h=m?u.width/3:u.width,f={content:c,width:h,height:u.height};return g.debug(`[${e.name}] ${e.entityIdentifier} text`,f),f}o(X,"calculateTextProps");function j(e,n){const t=n,i=V(t.frame),a={width:t.textProps.width+2*s.boxTextPadding,height:t.textProps.height+2*s.boxTextPadding};return[{$kind:D,frame:t.frame,index:t.index,visual:i,dimension:a,textProps:t.textProps}]}o(j,"decidePositionFrame");function G(e,n,t){return n===void 0?s.contentStartX:n.index===e.index&&e.r?e.r+s.boxPadding:t===void 0?s.contentStartX:t.r-s.boxOverlap+s.boxPadding}o(G,"calculateX");function Y(e,n){const t=[...e.map(i=>i.r),n];return Math.max(...t)}o(Y,"calculateMaxRight");function $(e){return Object.values(e).sort((n,t)=>n.index-t.index)}o($,"sortedSwimlanesArray");function z(e,n){const t=n,i=L(t.frame,e.swimlanes);let a;i.index in e.swimlanes?a=e.swimlanes[i.index]:a={index:i.index,label:i.label,r:0,y:i.index*s.swimlaneMinHeight+s.swimlaneGap,height:s.swimlaneMinHeight,maxHeight:s.swimlaneMinHeight};const r=e.boxes.length>0?e.boxes[e.boxes.length-1]:void 0,d=e.previousSwimlaneNumber!==void 0?e.swimlanes[e.previousSwimlaneNumber]:void 0,l={width:Math.max(s.boxMinWidth,Math.min(s.boxMaxWidth,t.dimension.width))+2*s.boxPadding,height:Math.max(s.boxMinHeight,Math.min(s.boxMaxHeight,t.dimension.height))+2*s.boxPadding},c=G(a,d,r),m=c+l.width+s.boxPadding,x=Y(Object.values(e.swimlanes),m);a.r=c+l.width,a.maxHeight=Math.max(a.maxHeight,l.height),a.height=Math.max(s.swimlaneMinHeight,a.maxHeight)+2*s.swimlanePadding;const u={x:c,y:s.swimlanePadding+a.y,r:m,dimension:l,leftSibling:!1,swimlane:a,visual:t.visual,text:t.textProps.content,frame:t.frame,index:t.index},h={...e,boxes:[...e.boxes,u],swimlanes:{...e.swimlanes,[`${a.index}`]:a},previousSwimlaneNumber:i.index,previousFrame:t.frame,maxR:x},f=$(h.swimlanes);f.length>0&&(f[0].y=0);for(let p=1;p<f.length;p++){const y=f[p],b=f[p-1];y.y=b.y+b.height+s.swimlaneGap}return h}o(z,"evolveFramePositioned");function K(e,n){return e===0&&n.sourceFrames.length===0}o(K,"isFirstFrame");function q(e){return e.sourceFrames!==void 0&&e.sourceFrames!==null&&e.sourceFrames.length>0}o(q,"hasSourceFrame");function B(e,n){if(n!=null)return e.find(t=>t.frame.name===n.name)}o(B,"findBoxByFrame");function J(e,n,t){if(!(t<0))for(let i=t;i>=0;i--){const a=e[i];if(a.swimlane.index!==n)return a}}o(J,"findBoxByLineIndex");function Q(e,n){const t=n;if(we(t.frame)||K(t.index,t.frame))return[];const i=B(e.boxes,t.frame);if(i===void 0)throw new Error(`Target box not found for frame ${t.frame.name}`);let a;return t.sourceFrame?a=B(e.boxes,t.sourceFrame):a=J(e.boxes,i.swimlane.index,t.index-1),a===void 0?[]:[{$kind:C,frame:t.frame,index:t.index,sourceBox:a,targetBox:i}]}o(Q,"decidePositionRelation");function Z(e,n){const t=n,i={visual:{fill:"none",stroke:"#000"},source:{x:t.sourceBox.x,y:t.sourceBox.y},target:{x:t.targetBox.x,y:t.targetBox.y},sourceBox:t.sourceBox,targetBox:t.targetBox};return{...e,relations:[...e.relations,i]}}o(Z,"evolveRelationPositioned");var Fe={[T]:j,[M]:Q},Ee={[D]:z,[C]:Z};function ee(e,n){const t=Fe[n.$kind];if(t==null)return[];const i=t(e,n);return g.debug("decided events",i),i}o(ee,"decide");function te(e,n){const t=n.reduce((i,a)=>{const r=Ee[a.$kind];return r==null?i:r(i,a)},e);return g.debug("evolve events",{state:e,newState:t,events:n}),t}o(te,"evolve");function w(e,n){const t=ee(e,n);return te(e,t)}o(w,"dispatch");var F={getConfig:Me,setOptions:ye,getOptions:Pe,clear:Se,setAccTitle:ue,getAccTitle:me,getAccDescription:ce,setAccDescription:le,setDiagramTitle:de,getDiagramTitle:se,setAst:I,getDiagramProps:R,getState:W},Ae={parse:o(async e=>{const n=await ve("eventmodeling",e);g.debug(n),F.setAst(n),oe(n,F)},"parse")},k=N(),Re=k==null?void 0:k.eventmodeling;function ne(e,n){return t=>{const i=t.swimlane.y+n.swimlanePadding,a=e.append("g").attr("class","em-box");a.append("rect").attr("x",t.x).attr("y",i).attr("rx","3").attr("width",t.dimension.width).attr("height",t.dimension.height).attr("stroke",t.visual.stroke).attr("fill",t.visual.fill),a.append("foreignObject").attr("x",t.x+n.boxPadding).attr("y",i+10).attr("width",t.dimension.width-2*n.boxPadding).attr("height",t.dimension.height-2*n.boxPadding).append("xhtml:div").style("display","table").style("height","100%").style("width","100%").append("span").style("display","table-cell").style("text-align","center").style("vertical-align","middle").html(t.text)}}o(ne,"renderD3Box");function ie(e,n){return e>n}o(ie,"dirUpwards");function ae(e,n,t,i){return a=>{const r=a.sourceBox.swimlane.y+n.swimlanePadding,d=a.targetBox.swimlane.y+n.swimlanePadding,l=ie(r,d),c=a.sourceBox.x+a.sourceBox.dimension.width*2/3,m=a.targetBox.x+a.targetBox.dimension.width/3;let x,u;g.debug(`rendering relation up=${l} for `,{sourceBox:a.sourceBox,targetBox:a.targetBox}),l?(x=r,u=d+a.targetBox.dimension.height):(x=r+a.sourceBox.dimension.height,u=d);const h=i.emRelationStroke??a.visual.stroke;e.append("path").attr("class","em-relation").attr("fill",a.visual.fill).attr("stroke",h).attr("stroke-width","1").attr("marker-end",`url(#${t})`).attr("d",`M${c} ${x} L${m} ${u}`)}}o(ae,"renderD3Relation");function re(e,n,t,i){return a=>{const r=e.append("g").attr("class","em-swimlane"),d=i.emSwimlaneBackgroundOdd??"rgb(250,250,250)",l=i.emSwimlaneBackgroundStroke??"rgb(240,240,240)";r.append("rect").attr("x",0).attr("y",a.y).attr("rx","3").attr("width",n+t.swimlanePadding).attr("height",a.height).attr("fill",d).attr("stroke",l),r.append("text").attr("font-weight",t.swimlaneTextFontWeight).attr("x",30).attr("y",a.y+30).text(a.label)}}o(re,"renderD3Swimlane");var $e=o(function(e,n,t,i){if(g.debug("in eventmodeling renderer",e+`
|
|
3
|
+
`,"id:",n,t),!Re)throw new Error("EventModeling config not found");const a=i.db,{themeVariables:r,eventmodeling:d}=N(),l=xe(`[id="${n}"]`),c=a.getDiagramProps(),m=a.getState(),x=`em-arrowhead-${n}`,u=r.emArrowhead??"#000000";m.sortedSwimlanesArray.forEach(re(l,m.maxR,c,r)),m.boxes.forEach(ne(l,c)),m.relations.forEach(ae(l,c,x,r)),l.append("defs").append("marker").attr("id",x).attr("markerWidth","10").attr("markerHeight","7").attr("refX","10").attr("refY","3.5").attr("orient","auto").append("polygon").attr("points","0 0, 10 3.5, 0 7").attr("fill",u),fe(void 0,l,(d==null?void 0:d.padding)??30,d==null?void 0:d.useMaxWidth)},"draw"),Ne={draw:$e},Te=o(e=>"","getStyles"),De=Te,Ue={parser:Ae,db:F,renderer:Ne,styles:De};export{Ue as diagram};
|