You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
109 lines
30 KiB
JavaScript
109 lines
30 KiB
JavaScript
"use strict";exports.id=500,exports.ids=[500],exports.modules={82657:(e,t,r)=>{r.d(t,{a:()=>l});var a=r(70110);function l(e,t){var r=e.append("foreignObject").attr("width","100000"),l=r.append("xhtml:div");l.attr("xmlns","http://www.w3.org/1999/xhtml");var n=t.label;switch(typeof n){case"function":l.insert(n);break;case"object":l.insert(function(){return n});break;default:l.html(n)}a.bg(l,t.labelStyle),l.style("display","inline-block"),l.style("white-space","nowrap");var i=l.node().getBoundingClientRect();return r.attr("width",i.width).attr("height",i.height),r}},70110:(e,t,r)=>{r.d(t,{$p:()=>c,O1:()=>i,WR:()=>h,bF:()=>n,bg:()=>d});var a=r(56058),l=r(32620);function n(e,t){return!!e.children(t).length}function i(e){return s(e.v)+":"+s(e.w)+":"+s(e.name)}var o=/:/g;function s(e){return e?String(e).replace(o,"\\:"):""}function d(e,t){t&&e.attr("style",t)}function c(e,t,r){t&&e.attr("class",t).attr("class",r+" "+e.attr("class"))}function h(e,t){var r=t.graph();if(a.Z(r)){var n=r.transition;if(l.Z(n))return n(e)}return e}},59500:(e,t,r)=>{r.d(t,{diagram:()=>H});var a=r(3016),l=r(38601),n=r(3896),i=r(15537),o=r(54030),s=r(46260),d=r(41115),c=r(348),h=r(70110),p={normal:function(e,t,r,a){var l=e.append("marker").attr("id",t).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerUnits","strokeWidth").attr("markerWidth",8).attr("markerHeight",6).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").style("stroke-width",1).style("stroke-dasharray","1,0");h.bg(l,r[a+"Style"]),r[a+"Class"]&&l.attr("class",r[a+"Class"])},vee:function(e,t,r,a){var l=e.append("marker").attr("id",t).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerUnits","strokeWidth").attr("markerWidth",8).attr("markerHeight",6).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 L 4 5 z").style("stroke-width",1).style("stroke-dasharray","1,0");h.bg(l,r[a+"Style"]),r[a+"Class"]&&l.attr("class",r[a+"Class"])},undirected:function(e,t,r,a){var l=e.append("marker").attr("id",t).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerUnits","strokeWidth").attr("markerWidth",8).attr("markerHeight",6).attr("orient","auto").append("path").attr("d","M 0 5 L 10 5").style("stroke-width",1).style("stroke-dasharray","1,0");h.bg(l,r[a+"Style"]),r[a+"Class"]&&l.attr("class",r[a+"Class"])}},u=r(82657);function g(e,t,r){var a,l=t.label,n=e.append("g");"svg"===t.labelType?(n.node().appendChild(t.label),h.bg(n,t.labelStyle)):"string"!=typeof l||"html"===t.labelType?(0,u.a)(n,t):function(e,t){for(var r=e.append("text"),a=(function(e){for(var t,r="",a=!1,l=0;l<e.length;++l)(t=e[l],a)?("n"===t?r+="\n":r+=t,a=!1):"\\"===t?a=!0:r+=t;return r})(t.label).split("\n"),l=0;l<a.length;l++)r.append("tspan").attr("xml:space","preserve").attr("dy","1em").attr("x","1").text(a[l]);return h.bg(r,t.labelStyle),r}(n,t);var i=n.node().getBBox();switch(r){case"top":a=-t.height/2;break;case"bottom":a=t.height/2-i.height;break;default:a=-i.height/2}return n.attr("transform","translate("+-i.width/2+","+a+")"),n}var f=function(e,t){var r=t.nodes().filter(function(e){return h.bF(t,e)}),a=e.selectAll("g.cluster").data(r,function(e){return e});h.WR(a.exit(),t).style("opacity",0).remove();var l=a.enter().append("g").attr("class","cluster").attr("id",function(e){return t.node(e).id}).style("opacity",0).each(function(e){var r=t.node(e),a=n.Ys(this);n.Ys(this).append("rect"),g(a.append("g").attr("class","label"),r,r.clusterLabelPos)});return a=a.merge(l),(a=h.WR(a,t).style("opacity",1)).selectAll("rect").each(function(e){var r=t.node(e),a=n.Ys(this);h.bg(a,r.style)}),a};let y=function(e,t){var r,a=e.selectAll("g.edgeLabel").data(t.edges(),function(e){return h.O1(e)}).classed("update",!0);return a.exit().remove(),a.enter().append("g").classed("edgeLabel",!0).style("opacity",0),(a=e.selectAll("g.edgeLabel")).each(function(e){var r=n.Ys(this);r.select(".label").remove();var a=t.edge(e),l=g(r,t.edge(e),0).classed("label",!0),i=l.node().getBBox();a.labelId&&l.attr("id",a.labelId),o.Z(a,"width")||(a.width=i.width),o.Z(a,"height")||(a.height=i.height)}),r=a.exit?a.exit():a.selectAll(null),h.WR(r,t).style("opacity",0).remove(),a};var b=r(31631),w=r(77879);function x(e,t){return e.intersect(t)}var v=function(e,t,r){var a,l=e.selectAll("g.edgePath").data(t.edges(),function(e){return h.O1(e)}).classed("update",!0),i=((a=l.enter().append("g").attr("class","edgePath").style("opacity",0)).append("path").attr("class","path").attr("d",function(e){var r=t.edge(e),a=t.node(e.v).elem,l=w.Z(r.points.length).map(function(){var e,t;return e=a.getBBox(),{x:(t=a.ownerSVGElement.getScreenCTM().inverse().multiply(a.getScreenCTM()).translate(e.width/2,e.height/2)).e,y:t.f}});return k(r,l)}),a.append("defs"),a);(function(e,t){var r=e.exit();h.WR(r,t).style("opacity",0).remove()})(l,t);var o=void 0!==l.merge?l.merge(i):l;return h.WR(o,t).style("opacity",1),o.each(function(e){var r=n.Ys(this),a=t.edge(e);a.elem=this,a.id&&r.attr("id",a.id),h.$p(r,a.class,(r.classed("update")?"update ":"")+"edgePath")}),o.selectAll("path.path").each(function(e){var r=t.edge(e);r.arrowheadId=b.Z("arrowhead");var a=n.Ys(this).attr("marker-end",function(){var e,t;return"url("+(e=location.href,t=r.arrowheadId,e.split("#")[0]+"#"+t)+")"}).style("fill","none");h.WR(a,t).attr("d",function(e){var r,a,l,n;return r=t.edge(e),a=t.node(e.v),l=t.node(e.w),(n=r.points.slice(1,r.points.length-1)).unshift(x(a,n[0])),n.push(x(l,n[n.length-1])),k(r,n)}),h.bg(a,r.style)}),o.selectAll("defs *").remove(),o.selectAll("defs").each(function(e){var a=t.edge(e);(0,r[a.arrowhead])(n.Ys(this),a.arrowheadId,a,"arrowhead")}),o};function k(e,t){var r=(n.jvg||n.YPS.line)().x(function(e){return e.x}).y(function(e){return e.y});return(r.curve||r.interpolate)(e.curve),r(t)}var m=r(40721),S=function(e,t,r){var a,l=t.nodes().filter(function(e){return!h.bF(t,e)}),i=e.selectAll("g.node").data(l,function(e){return e}).classed("update",!0);return i.exit().remove(),i.enter().append("g").attr("class","node").style("opacity",0),(i=e.selectAll("g.node")).each(function(e){var a=t.node(e),l=n.Ys(this);h.$p(l,a.class,(l.classed("update")?"update ":"")+"node"),l.select("g.label").remove();var i=l.append("g").attr("class","label"),s=g(i,a),d=r[a.shape],c=m.Z(s.node().getBBox(),"width","height");a.elem=this,a.id&&l.attr("id",a.id),a.labelId&&i.attr("id",a.labelId),o.Z(a,"width")&&(c.width=a.width),o.Z(a,"height")&&(c.height=a.height),c.width+=a.paddingLeft+a.paddingRight,c.height+=a.paddingTop+a.paddingBottom,i.attr("transform","translate("+(a.paddingLeft-a.paddingRight)/2+","+(a.paddingTop-a.paddingBottom)/2+")");var p=n.Ys(this);p.select(".label-container").remove();var u=d(p,c,a).classed("label-container",!0);h.bg(u,a.style);var f=u.node().getBBox();a.width=f.width,a.height=f.height}),a=i.exit?i.exit():i.selectAll(null),h.WR(a,t).style("opacity",0).remove(),i};function _(e,t,r,a){var l=e.x,n=e.y,i=l-a.x,o=n-a.y,s=Math.sqrt(t*t*o*o+r*r*i*i),d=Math.abs(t*r*i/s);a.x<l&&(d=-d);var c=Math.abs(t*r*o/s);return a.y<n&&(c=-c),{x:l+d,y:n+c}}function T(e,t,r){var a=e.x,l=e.y,n=[],i=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY;t.forEach(function(e){i=Math.min(i,e.x),o=Math.min(o,e.y)});for(var s=a-e.width/2-i,d=l-e.height/2-o,c=0;c<t.length;c++){var h=t[c],p=t[c<t.length-1?c+1:0],u=function(e,t,r,a){var l,n,i,o,s,d,c,h,p,u,g,f,y;if(l=t.y-e.y,i=e.x-t.x,s=t.x*e.y-e.x*t.y,p=l*r.x+i*r.y+s,u=l*a.x+i*a.y+s,(0===p||0===u||!(p*u>0))&&(n=a.y-r.y,o=r.x-a.x,d=a.x*r.y-r.x*a.y,c=n*e.x+o*e.y+d,h=n*t.x+o*t.y+d,!(0!==c&&0!==h&&c*h>0)&&0!=(g=l*o-n*i)))return f=Math.abs(g/2),{x:(y=i*d-o*s)<0?(y-f)/g:(y+f)/g,y:(y=n*s-l*d)<0?(y-f)/g:(y+f)/g}}(e,r,{x:s+h.x,y:d+h.y},{x:s+p.x,y:d+p.y});u&&n.push(u)}return n.length?(n.length>1&&n.sort(function(e,t){var a=e.x-r.x,l=e.y-r.y,n=Math.sqrt(a*a+l*l),i=t.x-r.x,o=t.y-r.y,s=Math.sqrt(i*i+o*o);return n<s?-1:n===s?0:1}),n[0]):(console.log("NO INTERSECTION FOUND, RETURN NODE CENTER",e),e)}function L(e,t){var r,a,l=e.x,n=e.y,i=t.x-l,o=t.y-n,s=e.width/2,d=e.height/2;return Math.abs(o)*s>Math.abs(i)*d?(o<0&&(d=-d),r=0===o?0:d*i/o,a=d):(i<0&&(s=-s),r=s,a=0===i?0:s*o/i),{x:l+r,y:n+a}}var A={rect:function(e,t,r){var a=e.insert("rect",":first-child").attr("rx",r.rx).attr("ry",r.ry).attr("x",-t.width/2).attr("y",-t.height/2).attr("width",t.width).attr("height",t.height);return r.intersect=function(e){return L(r,e)},a},ellipse:function(e,t,r){var a=t.width/2,l=t.height/2,n=e.insert("ellipse",":first-child").attr("x",-t.width/2).attr("y",-t.height/2).attr("rx",a).attr("ry",l);return r.intersect=function(e){return _(r,a,l,e)},n},circle:function(e,t,r){var a=Math.max(t.width,t.height)/2,l=e.insert("circle",":first-child").attr("x",-t.width/2).attr("y",-t.height/2).attr("r",a);return r.intersect=function(e){return _(r,a,a,e)},l},diamond:function(e,t,r){var a=t.width*Math.SQRT2/2,l=t.height*Math.SQRT2/2,n=[{x:0,y:-l},{x:-a,y:0},{x:0,y:l},{x:a,y:0}],i=e.insert("polygon",":first-child").attr("points",n.map(function(e){return e.x+","+e.y}).join(" "));return r.intersect=function(e){return T(r,n,e)},i}};function C(){var e=function(e,t){t.nodes().forEach(function(e){var r=t.node(e);o.Z(r,"label")||t.children(e).length||(r.label=e),o.Z(r,"paddingX")&&s.Z(r,{paddingLeft:r.paddingX,paddingRight:r.paddingX}),o.Z(r,"paddingY")&&s.Z(r,{paddingTop:r.paddingY,paddingBottom:r.paddingY}),o.Z(r,"padding")&&s.Z(r,{paddingLeft:r.padding,paddingRight:r.padding,paddingTop:r.padding,paddingBottom:r.padding}),s.Z(r,E),d.Z(["paddingLeft","paddingRight","paddingTop","paddingBottom"],function(e){r[e]=Number(r[e])}),o.Z(r,"width")&&(r._prevWidth=r.width),o.Z(r,"height")&&(r._prevHeight=r.height)}),t.edges().forEach(function(e){var r=t.edge(e);o.Z(r,"label")||(r.label=""),s.Z(r,N)});var r=$(e,"output"),a=$(r,"clusters"),l=$(r,"edgePaths"),i=y($(r,"edgeLabels"),t),u=S($(r,"nodes"),t,A);(0,c.bK)(t),function(e,t){function r(e){var r=t.node(e);return"translate("+r.x+","+r.y+")"}e.filter(function(){return!n.Ys(this).classed("update")}).attr("transform",r),h.WR(e,t).style("opacity",1).attr("transform",r)}(u,t),function(e,t){function r(e){var r=t.edge(e);return o.Z(r,"x")?"translate("+r.x+","+r.y+")":""}e.filter(function(){return!n.Ys(this).classed("update")}).attr("transform",r),h.WR(e,t).style("opacity",1).attr("transform",r)}(i,t),v(l,t,p),function(e,t){var r=e.filter(function(){return!n.Ys(this).classed("update")});function a(e){var r=t.node(e);return"translate("+r.x+","+r.y+")"}r.attr("transform",a),h.WR(e,t).style("opacity",1).attr("transform",a),h.WR(r.selectAll("rect"),t).attr("width",function(e){return t.node(e).width}).attr("height",function(e){return t.node(e).height}).attr("x",function(e){return-t.node(e).width/2}).attr("y",function(e){return-t.node(e).height/2})}(f(a,t),t),d.Z(t.nodes(),function(e){var r=t.node(e);o.Z(r,"_prevWidth")?r.width=r._prevWidth:delete r.width,o.Z(r,"_prevHeight")?r.height=r._prevHeight:delete r.height,delete r._prevWidth,delete r._prevHeight})};return e.createNodes=function(t){return arguments.length?(S=t,e):S},e.createClusters=function(t){return arguments.length?(f=t,e):f},e.createEdgeLabels=function(t){return arguments.length?(y=t,e):y},e.createEdgePaths=function(t){return arguments.length?(v=t,e):v},e.shapes=function(t){return arguments.length?(A=t,e):A},e.arrows=function(t){return arguments.length?(p=t,e):p},e}var E={paddingLeft:10,paddingRight:10,paddingTop:10,paddingBottom:10,rx:0,ry:0,shape:"rect"},N={arrowhead:"normal",curve:n.c_6};function $(e,t){var r=e.select("g."+t);return r.empty()&&(r=e.append("g").attr("class",t)),r}var B=r(3480);function I(e,t,r){let a=(t.width+t.height)*.9,l=[{x:a/2,y:0},{x:a,y:-a/2},{x:a/2,y:-a},{x:0,y:-a/2}],n=j(e,a,a,l);return r.intersect=function(e){return T(r,l,e)},n}function M(e,t,r){let a=t.height,l=a/4,n=t.width+2*l,i=[{x:l,y:0},{x:n-l,y:0},{x:n,y:-a/2},{x:n-l,y:-a},{x:l,y:-a},{x:0,y:-a/2}],o=j(e,n,a,i);return r.intersect=function(e){return T(r,i,e)},o}function R(e,t,r){let a=t.width,l=t.height,n=[{x:-l/2,y:0},{x:a,y:0},{x:a,y:-l},{x:-l/2,y:-l},{x:0,y:-l/2}],i=j(e,a,l,n);return r.intersect=function(e){return T(r,n,e)},i}function Y(e,t,r){let a=t.width,l=t.height,n=[{x:-2*l/6,y:0},{x:a-l/6,y:0},{x:a+2*l/6,y:-l},{x:l/6,y:-l}],i=j(e,a,l,n);return r.intersect=function(e){return T(r,n,e)},i}function Z(e,t,r){let a=t.width,l=t.height,n=[{x:2*l/6,y:0},{x:a+l/6,y:0},{x:a-2*l/6,y:-l},{x:-l/6,y:-l}],i=j(e,a,l,n);return r.intersect=function(e){return T(r,n,e)},i}function D(e,t,r){let a=t.width,l=t.height,n=[{x:-2*l/6,y:0},{x:a+2*l/6,y:0},{x:a-l/6,y:-l},{x:l/6,y:-l}],i=j(e,a,l,n);return r.intersect=function(e){return T(r,n,e)},i}function W(e,t,r){let a=t.width,l=t.height,n=[{x:l/6,y:0},{x:a-l/6,y:0},{x:a+2*l/6,y:-l},{x:-2*l/6,y:-l}],i=j(e,a,l,n);return r.intersect=function(e){return T(r,n,e)},i}function U(e,t,r){let a=t.width,l=t.height,n=[{x:0,y:0},{x:a+l/2,y:0},{x:a,y:-l/2},{x:a+l/2,y:-l},{x:0,y:-l}],i=j(e,a,l,n);return r.intersect=function(e){return T(r,n,e)},i}function z(e,t,r){let a=t.height,l=t.width+a/4,n=e.insert("rect",":first-child").attr("rx",a/2).attr("ry",a/2).attr("x",-l/2).attr("y",-a/2).attr("width",l).attr("height",a);return r.intersect=function(e){return L(r,e)},n}function O(e,t,r){let a=t.width,l=t.height,n=[{x:0,y:0},{x:a,y:0},{x:a,y:-l},{x:0,y:-l},{x:0,y:0},{x:-8,y:0},{x:a+8,y:0},{x:a+8,y:-l},{x:-8,y:-l},{x:-8,y:0}],i=j(e,a,l,n);return r.intersect=function(e){return T(r,n,e)},i}function P(e,t,r){let a=t.width,l=a/2,n=l/(2.5+a/50),i=t.height+n,o=e.attr("label-offset-y",n).insert("path",":first-child").attr("d","M 0,"+n+" a "+l+","+n+" 0,0,0 "+a+" 0 a "+l+","+n+" 0,0,0 "+-a+" 0 l 0,"+i+" a "+l+","+n+" 0,0,0 "+a+" 0 l 0,"+-i).attr("transform","translate("+-a/2+","+-(i/2+n)+")");return r.intersect=function(e){let t=L(r,e),a=t.x-r.x;if(0!=l&&(Math.abs(a)<r.width/2||Math.abs(a)==r.width/2&&Math.abs(t.y-r.y)>r.height/2-n)){let i=n*n*(1-a*a/(l*l));0!=i&&(i=Math.sqrt(i)),i=n-i,e.y-r.y>0&&(i=-i),t.y+=i}return t},o}function j(e,t,r,a){return e.insert("polygon",":first-child").attr("points",a.map(function(e){return e.x+","+e.y}).join(" ")).attr("transform","translate("+-t/2+","+r/2+")")}r(48869),r(43795),r(57581),r(40113);let q={addToRender:function(e){e.shapes().question=I,e.shapes().hexagon=M,e.shapes().stadium=z,e.shapes().subroutine=O,e.shapes().cylinder=P,e.shapes().rect_left_inv_arrow=R,e.shapes().lean_right=Y,e.shapes().lean_left=Z,e.shapes().trapezoid=D,e.shapes().inv_trapezoid=W,e.shapes().rect_right_inv_arrow=U},addToRenderV2:function(e){e({question:I}),e({hexagon:M}),e({stadium:z}),e({subroutine:O}),e({cylinder:P}),e({rect_left_inv_arrow:R}),e({lean_right:Y}),e({lean_left:Z}),e({trapezoid:D}),e({inv_trapezoid:W}),e({rect_right_inv_arrow:U})}},V={},X=function(e,t,r,a,l,o){let s=a?a.select(`[id="${r}"]`):(0,n.Ys)(`[id="${r}"]`),d=l||document;Object.keys(e).forEach(function(r){let a;let l=e[r],n="default";l.classes.length>0&&(n=l.classes.join(" "));let c=(0,i.k)(l.styles),h=void 0!==l.text?l.text:l.id;if((0,i.m)((0,i.c)().flowchart.htmlLabels)){let e={label:h.replace(/fa[blrs]?:fa-[\w-]+/g,e=>`<i class='${e.replace(":"," ")}'></i>`)};(a=(0,u.a)(s,e).node()).parentNode.removeChild(a)}else{let e=d.createElementNS("http://www.w3.org/2000/svg","text");for(let t of(e.setAttribute("style",c.labelStyle.replace("color:","fill:")),h.split(i.e.lineBreakRegex))){let r=d.createElementNS("http://www.w3.org/2000/svg","tspan");r.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),r.setAttribute("dy","1em"),r.setAttribute("x","1"),r.textContent=t,e.appendChild(r)}a=e}let p=0,g="";switch(l.type){case"round":p=5,g="rect";break;case"square":case"group":default:g="rect";break;case"diamond":g="question";break;case"hexagon":g="hexagon";break;case"odd":case"odd_right":g="rect_left_inv_arrow";break;case"lean_right":g="lean_right";break;case"lean_left":g="lean_left";break;case"trapezoid":g="trapezoid";break;case"inv_trapezoid":g="inv_trapezoid";break;case"circle":g="circle";break;case"ellipse":g="ellipse";break;case"stadium":g="stadium";break;case"subroutine":g="subroutine";break;case"cylinder":g="cylinder"}i.l.warn("Adding node",l.id,l.domId),t.setNode(o.db.lookUpDomId(l.id),{labelType:"svg",labelStyle:c.labelStyle,shape:g,label:a,rx:p,ry:p,class:n,style:c.style,id:o.db.lookUpDomId(l.id)})})},F=function(e,t,r){let a,l,o=0;if(void 0!==e.defaultStyle){let t=(0,i.k)(e.defaultStyle);a=t.style,l=t.labelStyle}e.forEach(function(s){o++;let d="L-"+s.start+"-"+s.end,c="LS-"+s.start,h="LE-"+s.end,p={};"arrow_open"===s.type?p.arrowhead="none":p.arrowhead="normal";let u="",g="";if(void 0!==s.style){let e=(0,i.k)(s.style);u=e.style,g=e.labelStyle}else switch(s.stroke){case"normal":u="fill:none",void 0!==a&&(u=a),void 0!==l&&(g=l);break;case"dotted":u="fill:none;stroke-width:2px;stroke-dasharray:3;";break;case"thick":u=" stroke-width: 3.5px;fill:none"}p.style=u,p.labelStyle=g,void 0!==s.interpolate?p.curve=(0,i.n)(s.interpolate,n.c_6):void 0!==e.defaultInterpolate?p.curve=(0,i.n)(e.defaultInterpolate,n.c_6):p.curve=(0,i.n)(V.curve,n.c_6),void 0===s.text?void 0!==s.style&&(p.arrowheadStyle="fill: #333"):(p.arrowheadStyle="fill: #333",p.labelpos="c",(0,i.m)((0,i.c)().flowchart.htmlLabels)?(p.labelType="html",p.label=`<span id="L-${d}" class="edgeLabel L-${c}' L-${h}" style="${p.labelStyle}">${s.text.replace(/fa[blrs]?:fa-[\w-]+/g,e=>`<i class='${e.replace(":"," ")}'></i>`)}</span>`):(p.labelType="text",p.label=s.text.replace(i.e.lineBreakRegex,"\n"),void 0===s.style&&(p.style=p.style||"stroke: #333; stroke-width: 1.5px;fill:none"),p.labelStyle=p.labelStyle.replace("color:","fill:"))),p.id=d,p.class=c+" "+h,p.minlen=s.length||1,t.setEdge(r.db.lookUpDomId(s.start),r.db.lookUpDomId(s.end),p,o)})},G={setConf:function(e){for(let t of Object.keys(e))V[t]=e[t]},addVertices:X,addEdges:F,getClasses:function(e,t){return i.l.info("Extracting classes"),t.db.getClasses()},draw:function(e,t,r,a){let o,s;i.l.info("Drawing flowchart");let{securityLevel:d,flowchart:c}=(0,i.c)();"sandbox"===d&&(o=(0,n.Ys)("#i"+t));let p="sandbox"===d?(0,n.Ys)(o.nodes()[0].contentDocument.body):(0,n.Ys)("body"),u="sandbox"===d?o.nodes()[0].contentDocument:document,g=a.db.getDirection();void 0===g&&(g="TD");let f=c.nodeSpacing||50,y=c.rankSpacing||50,b=new l.k({multigraph:!0,compound:!0}).setGraph({rankdir:g,nodesep:f,ranksep:y,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}}),w=a.db.getSubGraphs();for(let e=w.length-1;e>=0;e--)s=w[e],a.db.addVertex(s.id,s.title,"group",void 0,s.classes);let x=a.db.getVertices();i.l.warn("Get vertices",x);let v=a.db.getEdges(),k=0;for(k=w.length-1;k>=0;k--){s=w[k],(0,n.td_)("cluster").append("text");for(let e=0;e<s.nodes.length;e++)i.l.warn("Setting subgraph",s.nodes[e],a.db.lookUpDomId(s.nodes[e]),a.db.lookUpDomId(s.id)),b.setParent(a.db.lookUpDomId(s.nodes[e]),a.db.lookUpDomId(s.id))}X(x,b,t,p,u,a),F(v,b,a);let m=new C;q.addToRender(m),m.arrows().none=function(e,t,r,a){let l=e.append("marker").attr("id",t).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerUnits","strokeWidth").attr("markerWidth",8).attr("markerHeight",6).attr("orient","auto").append("path").attr("d","M 0 0 L 0 0 L 0 0 z");(0,h.bg)(l,r[a+"Style"])},m.arrows().normal=function(e,t){e.append("marker").attr("id",t).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerUnits","strokeWidth").attr("markerWidth",8).attr("markerHeight",6).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowheadPath").style("stroke-width",1).style("stroke-dasharray","1,0")};let S=p.select(`[id="${t}"]`),_=p.select("#"+t+" g");for(m(_,b),_.selectAll("g.node").attr("title",function(){return a.db.getTooltip(this.id)}),a.db.indexNodes("subGraph"+k),k=0;k<w.length;k++)if("undefined"!==(s=w[k]).title){let e=u.querySelectorAll("#"+t+' [id="'+a.db.lookUpDomId(s.id)+'"] rect'),r=u.querySelectorAll("#"+t+' [id="'+a.db.lookUpDomId(s.id)+'"]'),l=e[0].x.baseVal.value,i=e[0].y.baseVal.value,o=e[0].width.baseVal.value,d=(0,n.Ys)(r[0]).select(".label");d.attr("transform",`translate(${l+o/2}, ${i+14})`),d.attr("id",t+"Text");for(let e=0;e<s.classes.length;e++)r[0].classList.add(s.classes[e])}if(!c.htmlLabels)for(let e of u.querySelectorAll('[id="'+t+'"] .edgeLabel .label')){let t=e.getBBox(),r=u.createElementNS("http://www.w3.org/2000/svg","rect");r.setAttribute("rx",0),r.setAttribute("ry",0),r.setAttribute("width",t.width),r.setAttribute("height",t.height),e.insertBefore(r,e.firstChild)}(0,i.o)(b,S,c.diagramPadding,c.useMaxWidth),Object.keys(x).forEach(function(e){let r=x[e];if(r.link){let l=p.select("#"+t+' [id="'+a.db.lookUpDomId(e)+'"]');if(l){let e=u.createElementNS("http://www.w3.org/2000/svg","a");e.setAttributeNS("http://www.w3.org/2000/svg","class",r.classes.join(" ")),e.setAttributeNS("http://www.w3.org/2000/svg","href",r.link),e.setAttributeNS("http://www.w3.org/2000/svg","rel","noopener"),"sandbox"===d?e.setAttributeNS("http://www.w3.org/2000/svg","target","_top"):r.linkTarget&&e.setAttributeNS("http://www.w3.org/2000/svg","target",r.linkTarget);let t=l.insert(function(){return e},":first-child"),a=l.select(".label-container");a&&t.append(function(){return a.node()});let n=l.select(".label");n&&t.append(function(){return n.node()})}}})}},H={parser:a.p,db:a.f,renderer:B.f,styles:B.a,init:e=>{e.flowchart||(e.flowchart={}),e.flowchart.arrowMarkerAbsolute=e.arrowMarkerAbsolute,G.setConf(e.flowchart),a.f.clear(),a.f.setGen("gen-1")}}},3480:(e,t,r)=>{r.d(t,{a:()=>w,f:()=>y});var a=r(38601),l=r(3896),n=r(15537),i=r(77339),o=r(82657),s=r(28777),d=r(49678);let c=(e,t)=>s.Z.lang.round(d.Z.parse(e)[t]);var h=r(60027);let p={},u=function(e,t,r,a,l,i){let s=a.select(`[id="${r}"]`);Object.keys(e).forEach(function(r){let a;let d=e[r],c="default";d.classes.length>0&&(c=d.classes.join(" ")),c+=" flowchart-label";let h=(0,n.k)(d.styles),p=void 0!==d.text?d.text:d.id;if(n.l.info("vertex",d,d.labelType),"markdown"===d.labelType)n.l.info("vertex",d,d.labelType);else if((0,n.m)((0,n.c)().flowchart.htmlLabels)){let e={label:p.replace(/fa[blrs]?:fa-[\w-]+/g,e=>`<i class='${e.replace(":"," ")}'></i>`)};(a=(0,o.a)(s,e).node()).parentNode.removeChild(a)}else{let e=l.createElementNS("http://www.w3.org/2000/svg","text");for(let t of(e.setAttribute("style",h.labelStyle.replace("color:","fill:")),p.split(n.e.lineBreakRegex))){let r=l.createElementNS("http://www.w3.org/2000/svg","tspan");r.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),r.setAttribute("dy","1em"),r.setAttribute("x","1"),r.textContent=t,e.appendChild(r)}a=e}let u=0,g="";switch(d.type){case"round":u=5,g="rect";break;case"square":case"group":default:g="rect";break;case"diamond":g="question";break;case"hexagon":g="hexagon";break;case"odd":case"odd_right":g="rect_left_inv_arrow";break;case"lean_right":g="lean_right";break;case"lean_left":g="lean_left";break;case"trapezoid":g="trapezoid";break;case"inv_trapezoid":g="inv_trapezoid";break;case"circle":g="circle";break;case"ellipse":g="ellipse";break;case"stadium":g="stadium";break;case"subroutine":g="subroutine";break;case"cylinder":g="cylinder";break;case"doublecircle":g="doublecircle"}t.setNode(d.id,{labelStyle:h.labelStyle,shape:g,labelText:p,labelType:d.labelType,rx:u,ry:u,class:c,style:h.style,id:d.id,link:d.link,linkTarget:d.linkTarget,tooltip:i.db.getTooltip(d.id)||"",domId:i.db.lookUpDomId(d.id),haveCallback:d.haveCallback,width:"group"===d.type?500:void 0,dir:d.dir,type:d.type,props:d.props,padding:(0,n.c)().flowchart.padding}),n.l.info("setNode",{labelStyle:h.labelStyle,labelType:d.labelType,shape:g,labelText:p,rx:u,ry:u,class:c,style:h.style,id:d.id,domId:i.db.lookUpDomId(d.id),width:"group"===d.type?500:void 0,type:d.type,dir:d.dir,props:d.props,padding:(0,n.c)().flowchart.padding})})},g=function(e,t,r){let a,i;n.l.info("abc78 edges = ",e);let o=0,s={};if(void 0!==e.defaultStyle){let t=(0,n.k)(e.defaultStyle);a=t.style,i=t.labelStyle}e.forEach(function(r){o++;let d="L-"+r.start+"-"+r.end;void 0===s[d]?s[d]=0:s[d]++,n.l.info("abc78 new entry",d,s[d]);let c=d+"-"+s[d];n.l.info("abc78 new link id to be used is",d,c,s[d]);let h="LS-"+r.start,u="LE-"+r.end,g={style:"",labelStyle:""};switch(g.minlen=r.length||1,"arrow_open"===r.type?g.arrowhead="none":g.arrowhead="normal",g.arrowTypeStart="arrow_open",g.arrowTypeEnd="arrow_open",r.type){case"double_arrow_cross":g.arrowTypeStart="arrow_cross";case"arrow_cross":g.arrowTypeEnd="arrow_cross";break;case"double_arrow_point":g.arrowTypeStart="arrow_point";case"arrow_point":g.arrowTypeEnd="arrow_point";break;case"double_arrow_circle":g.arrowTypeStart="arrow_circle";case"arrow_circle":g.arrowTypeEnd="arrow_circle"}let f="",y="";switch(r.stroke){case"normal":f="fill:none;",void 0!==a&&(f=a),void 0!==i&&(y=i),g.thickness="normal",g.pattern="solid";break;case"dotted":g.thickness="normal",g.pattern="dotted",g.style="fill:none;stroke-width:2px;stroke-dasharray:3;";break;case"thick":g.thickness="thick",g.pattern="solid",g.style="stroke-width: 3.5px;fill:none;";break;case"invisible":g.thickness="invisible",g.pattern="solid",g.style="stroke-width: 0;fill:none;"}if(void 0!==r.style){let e=(0,n.k)(r.style);f=e.style,y=e.labelStyle}g.style=g.style+=f,g.labelStyle=g.labelStyle+=y,void 0!==r.interpolate?g.curve=(0,n.n)(r.interpolate,l.c_6):void 0!==e.defaultInterpolate?g.curve=(0,n.n)(e.defaultInterpolate,l.c_6):g.curve=(0,n.n)(p.curve,l.c_6),void 0===r.text?void 0!==r.style&&(g.arrowheadStyle="fill: #333"):(g.arrowheadStyle="fill: #333",g.labelpos="c"),g.labelType=r.labelType,g.label=r.text.replace(n.e.lineBreakRegex,"\n"),void 0===r.style&&(g.style=g.style||"stroke: #333; stroke-width: 1.5px;fill:none;"),g.labelStyle=g.labelStyle.replace("color:","fill:"),g.id=c,g.classes="flowchart-link "+h+" "+u,t.setEdge(r.start,r.end,g,o)})},f=async function(e,t,r,o){let s,d;n.l.info("Drawing flowchart");let c=o.db.getDirection();void 0===c&&(c="TD");let{securityLevel:h,flowchart:p}=(0,n.c)(),f=p.nodeSpacing||50,y=p.rankSpacing||50;"sandbox"===h&&(s=(0,l.Ys)("#i"+t));let b="sandbox"===h?(0,l.Ys)(s.nodes()[0].contentDocument.body):(0,l.Ys)("body"),w="sandbox"===h?s.nodes()[0].contentDocument:document,x=new a.k({multigraph:!0,compound:!0}).setGraph({rankdir:c,nodesep:f,ranksep:y,marginx:0,marginy:0}).setDefaultEdgeLabel(function(){return{}}),v=o.db.getSubGraphs();n.l.info("Subgraphs - ",v);for(let e=v.length-1;e>=0;e--)d=v[e],n.l.info("Subgraph - ",d),o.db.addVertex(d.id,{text:d.title,type:d.labelType},"group",void 0,d.classes,d.dir);let k=o.db.getVertices(),m=o.db.getEdges();n.l.info("Edges",m);let S=0;for(S=v.length-1;S>=0;S--){d=v[S],(0,l.td_)("cluster").append("text");for(let e=0;e<d.nodes.length;e++)n.l.info("Setting up subgraphs",d.nodes[e],d.id),x.setParent(d.nodes[e],d.id)}u(k,x,t,b,w,o),g(m,x);let _=b.select(`[id="${t}"]`),T=b.select("#"+t+" g");if(await (0,i.r)(T,x,["point","circle","cross"],"flowchart",t),n.u.insertTitle(_,"flowchartTitleText",p.titleTopMargin,o.db.getDiagramTitle()),(0,n.o)(x,_,p.diagramPadding,p.useMaxWidth),o.db.indexNodes("subGraph"+S),!p.htmlLabels)for(let e of w.querySelectorAll('[id="'+t+'"] .edgeLabel .label')){let t=e.getBBox(),r=w.createElementNS("http://www.w3.org/2000/svg","rect");r.setAttribute("rx",0),r.setAttribute("ry",0),r.setAttribute("width",t.width),r.setAttribute("height",t.height),e.insertBefore(r,e.firstChild)}Object.keys(k).forEach(function(e){let r=k[e];if(r.link){let a=(0,l.Ys)("#"+t+' [id="'+e+'"]');if(a){let e=w.createElementNS("http://www.w3.org/2000/svg","a");e.setAttributeNS("http://www.w3.org/2000/svg","class",r.classes.join(" ")),e.setAttributeNS("http://www.w3.org/2000/svg","href",r.link),e.setAttributeNS("http://www.w3.org/2000/svg","rel","noopener"),"sandbox"===h?e.setAttributeNS("http://www.w3.org/2000/svg","target","_top"):r.linkTarget&&e.setAttributeNS("http://www.w3.org/2000/svg","target",r.linkTarget);let t=a.insert(function(){return e},":first-child"),l=a.select(".label-container");l&&t.append(function(){return l.node()});let n=a.select(".label");n&&t.append(function(){return n.node()})}}})},y={setConf:function(e){for(let t of Object.keys(e))p[t]=e[t]},addVertices:u,addEdges:g,getClasses:function(e,t){return t.db.getClasses()},draw:f},b=(e,t)=>{let r=c(e,"r"),a=c(e,"g"),l=c(e,"b");return h.Z(r,a,l,t)},w=e=>`.label {
|
|
font-family: ${e.fontFamily};
|
|
color: ${e.nodeTextColor||e.textColor};
|
|
}
|
|
.cluster-label text {
|
|
fill: ${e.titleColor};
|
|
}
|
|
.cluster-label span,p {
|
|
color: ${e.titleColor};
|
|
}
|
|
|
|
.label text,span,p {
|
|
fill: ${e.nodeTextColor||e.textColor};
|
|
color: ${e.nodeTextColor||e.textColor};
|
|
}
|
|
|
|
.node rect,
|
|
.node circle,
|
|
.node ellipse,
|
|
.node polygon,
|
|
.node path {
|
|
fill: ${e.mainBkg};
|
|
stroke: ${e.nodeBorder};
|
|
stroke-width: 1px;
|
|
}
|
|
.flowchart-label text {
|
|
text-anchor: middle;
|
|
}
|
|
// .flowchart-label .text-outer-tspan {
|
|
// text-anchor: middle;
|
|
// }
|
|
// .flowchart-label .text-inner-tspan {
|
|
// text-anchor: start;
|
|
// }
|
|
|
|
.node .label {
|
|
text-align: center;
|
|
}
|
|
.node.clickable {
|
|
cursor: pointer;
|
|
}
|
|
|
|
.arrowheadPath {
|
|
fill: ${e.arrowheadColor};
|
|
}
|
|
|
|
.edgePath .path {
|
|
stroke: ${e.lineColor};
|
|
stroke-width: 2.0px;
|
|
}
|
|
|
|
.flowchart-link {
|
|
stroke: ${e.lineColor};
|
|
fill: none;
|
|
}
|
|
|
|
.edgeLabel {
|
|
background-color: ${e.edgeLabelBackground};
|
|
rect {
|
|
opacity: 0.5;
|
|
background-color: ${e.edgeLabelBackground};
|
|
fill: ${e.edgeLabelBackground};
|
|
}
|
|
text-align: center;
|
|
}
|
|
|
|
/* For html labels only */
|
|
.labelBkg {
|
|
background-color: ${b(e.edgeLabelBackground,.5)};
|
|
// background-color:
|
|
}
|
|
|
|
.cluster rect {
|
|
fill: ${e.clusterBkg};
|
|
stroke: ${e.clusterBorder};
|
|
stroke-width: 1px;
|
|
}
|
|
|
|
.cluster text {
|
|
fill: ${e.titleColor};
|
|
}
|
|
|
|
.cluster span,p {
|
|
color: ${e.titleColor};
|
|
}
|
|
/* .cluster div {
|
|
color: ${e.titleColor};
|
|
} */
|
|
|
|
div.mermaidTooltip {
|
|
position: absolute;
|
|
text-align: center;
|
|
max-width: 200px;
|
|
padding: 2px;
|
|
font-family: ${e.fontFamily};
|
|
font-size: 12px;
|
|
background: ${e.tertiaryColor};
|
|
border: 1px solid ${e.border2};
|
|
border-radius: 2px;
|
|
pointer-events: none;
|
|
z-index: 100;
|
|
}
|
|
|
|
.flowchartTitleText {
|
|
text-anchor: middle;
|
|
font-size: 18px;
|
|
fill: ${e.textColor};
|
|
}
|
|
`}}; |