Xdg.Directories/public/flowDiagram-d949d7c1-YPEXTM...

6 lines
21 KiB
JavaScript
Executable File

import{a as H,b as Y,c as _,d as X,e as b,f as F,g as bt,h as kt}from"./chunk-VANA6GB5.min.js";import"./chunk-OTWBH354.min.js";import{a as mt,b as z}from"./chunk-5R3XQX22.min.js";import"./chunk-A72RGWO6.min.js";import"./chunk-ICFROH4Y.min.js";import{a as wt}from"./chunk-ULAEXCMJ.min.js";import{A as xt,e as R,g as ot,m as w,t as yt,u as vt,y as gt}from"./chunk-GT3P3F7J.min.js";import{F as P,G as ft,Ga as G,J as ee,Ja as lt,La as ct,Qa as q,Ra as Q,b as jt,bb as St,c as te,h as y,i as ut,k as ht,kb as J}from"./chunk-L5V3YLAC.min.js";import{d as it}from"./chunk-P42HNYSU.min.js";var K={normal:re,vee:ae,undirected:ne};function _t(r){K=r}function re(r,e,t,n){var a=r.append("marker").attr("id",e).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerUnits","strokeWidth").attr("markerWidth",8).attr("markerHeight",6).attr("orient","auto"),s=a.append("path").attr("d","M 0 0 L 10 5 L 0 10 z").style("stroke-width",1).style("stroke-dasharray","1,0");_(s,t[n+"Style"]),t[n+"Class"]&&s.attr("class",t[n+"Class"])}function ae(r,e,t,n){var a=r.append("marker").attr("id",e).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerUnits","strokeWidth").attr("markerWidth",8).attr("markerHeight",6).attr("orient","auto"),s=a.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");_(s,t[n+"Style"]),t[n+"Class"]&&s.attr("class",t[n+"Class"])}function ne(r,e,t,n){var a=r.append("marker").attr("id",e).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerUnits","strokeWidth").attr("markerWidth",8).attr("markerHeight",6).attr("orient","auto"),s=a.append("path").attr("d","M 0 5 L 10 5").style("stroke-width",1).style("stroke-dasharray","1,0");_(s,t[n+"Style"]),t[n+"Class"]&&s.attr("class",t[n+"Class"])}function Lt(r,e){var t=r;return t.node().appendChild(e.label),_(t,e.labelStyle),t}function Et(r,e){for(var t=r.append("text"),n=se(e.label).split(`
`),a=0;a<n.length;a++)t.append("tspan").attr("xml:space","preserve").attr("dy","1em").attr("x","1").text(n[a]);return _(t,e.labelStyle),t}function se(r){for(var e="",t=!1,n,a=0;a<r.length;++a)if(n=r[a],t){switch(n){case"n":e+=`
`;break;default:e+=n}t=!1}else n==="\\"?t=!0:e+=n;return e}function U(r,e,t){var n=e.label,a=r.append("g");e.labelType==="svg"?Lt(a,e):typeof n!="string"||e.labelType==="html"?F(a,e):Et(a,e);var s=a.node().getBBox(),i;switch(t){case"top":i=-e.height/2;break;case"bottom":i=e.height/2-s.height;break;default:i=-s.height/2}return a.attr("transform","translate("+-s.width/2+","+i+")"),a}var Z=function(r,e){var t=e.nodes().filter(function(s){return H(e,s)}),n=r.selectAll("g.cluster").data(t,function(s){return s});b(n.exit(),e).style("opacity",0).remove();var a=n.enter().append("g").attr("class","cluster").attr("id",function(s){var i=e.node(s);return i.id}).style("opacity",0).each(function(s){var i=e.node(s),o=y(this);y(this).append("rect");var c=o.append("g").attr("class","label");U(c,i,i.clusterLabelPos)});return n=n.merge(a),n=b(n,e).style("opacity",1),n.selectAll("rect").each(function(s){var i=e.node(s),o=y(this);_(o,i.style)}),n};function Tt(r){Z=r}var j=function(r,e){var t=r.selectAll("g.edgeLabel").data(e.edges(),function(a){return Y(a)}).classed("update",!0);t.exit().remove(),t.enter().append("g").classed("edgeLabel",!0).style("opacity",0),t=r.selectAll("g.edgeLabel"),t.each(function(a){var s=y(this);s.select(".label").remove();var i=e.edge(a),o=U(s,e.edge(a),0).classed("label",!0),c=o.node().getBBox();i.labelId&&o.attr("id",i.labelId),w(i,"width")||(i.width=c.width),w(i,"height")||(i.height=c.height)});var n;return t.exit?n=t.exit():n=t.selectAll(null),b(n,e).style("opacity",0).remove(),t};function Nt(r){j=r}function dt(r,e){return r.intersect(e)}var tt=function(r,e,t){var n=r.selectAll("g.edgePath").data(e.edges(),function(i){return Y(i)}).classed("update",!0),a=de(n,e);pe(n,e);var s=n.merge!==void 0?n.merge(a):n;return b(s,e).style("opacity",1),s.each(function(i){var o=y(this),c=e.edge(i);c.elem=this,c.id&&o.attr("id",c.id),X(o,c.class,(o.classed("update")?"update ":"")+"edgePath")}),s.selectAll("path.path").each(function(i){var o=e.edge(i);o.arrowheadId=gt("arrowhead");var c=y(this).attr("marker-end",function(){return"url("+oe(location.href,o.arrowheadId)+")"}).style("fill","none");b(c,e).attr("d",function(d){return le(e,d)}),_(c,o.style)}),s.selectAll("defs *").remove(),s.selectAll("defs").each(function(i){var o=e.edge(i),c=t[o.arrowhead];c(y(this),o.arrowheadId,o,"arrowhead")}),s};function Ct(r){tt=r}function oe(r,e){var t=r.split("#")[0];return t+"#"+e}function le(r,e){var t=r.edge(e),n=r.node(e.v),a=r.node(e.w),s=t.points.slice(1,t.points.length-1);return s.unshift(dt(n,s[0])),s.push(dt(a,s[s.length-1])),At(t,s)}function At(r,e){var t=(ft||ht.line)().x(function(n){return n.x}).y(function(n){return n.y});return(t.curve||t.interpolate)(r.curve),t(e)}function ce(r){var e=r.getBBox(),t=r.ownerSVGElement.getScreenCTM().inverse().multiply(r.getScreenCTM()).translate(e.width/2,e.height/2);return{x:t.e,y:t.f}}function de(r,e){var t=r.enter().append("g").attr("class","edgePath").style("opacity",0);return t.append("path").attr("class","path").attr("d",function(n){var a=e.edge(n),s=e.node(n.v).elem,i=vt(a.points.length).map(function(){return ce(s)});return At(a,i)}),t.append("defs"),t}function pe(r,e){var t=r.exit();b(t,e).style("opacity",0).remove()}var et=function(r,e,t){var n=e.nodes().filter(function(i){return!H(e,i)}),a=r.selectAll("g.node").data(n,function(i){return i}).classed("update",!0);a.exit().remove(),a.enter().append("g").attr("class","node").style("opacity",0),a=r.selectAll("g.node"),a.each(function(i){var o=e.node(i),c=y(this);X(c,o.class,(c.classed("update")?"update ":"")+"node"),c.select("g.label").remove();var d=c.append("g").attr("class","label"),l=U(d,o),m=t[o.shape],p=yt(l.node().getBBox(),"width","height");o.elem=this,o.id&&c.attr("id",o.id),o.labelId&&d.attr("id",o.labelId),w(o,"width")&&(p.width=o.width),w(o,"height")&&(p.height=o.height),p.width+=o.paddingLeft+o.paddingRight,p.height+=o.paddingTop+o.paddingBottom,d.attr("transform","translate("+(o.paddingLeft-o.paddingRight)/2+","+(o.paddingTop-o.paddingBottom)/2+")");var u=y(this);u.select(".label-container").remove();var f=m(u,p,o).classed("label-container",!0);_(f,o.style);var g=f.node().getBBox();o.width=g.width,o.height=g.height});var s;return a.exit?s=a.exit():s=a.selectAll(null),b(s,e).style("opacity",0).remove(),a};function It(r){et=r}function Bt(r,e){var t=r.filter(function(){return!y(this).classed("update")});function n(a){var s=e.node(a);return"translate("+s.x+","+s.y+")"}t.attr("transform",n),b(r,e).style("opacity",1).attr("transform",n),b(t.selectAll("rect"),e).attr("width",function(a){return e.node(a).width}).attr("height",function(a){return e.node(a).height}).attr("x",function(a){var s=e.node(a);return-s.width/2}).attr("y",function(a){var s=e.node(a);return-s.height/2})}function Mt(r,e){var t=r.filter(function(){return!y(this).classed("update")});function n(a){var s=e.edge(a);return w(s,"x")?"translate("+s.x+","+s.y+")":""}t.attr("transform",n),b(r,e).style("opacity",1).attr("transform",n)}function Dt(r,e){var t=r.filter(function(){return!y(this).classed("update")});function n(a){var s=e.node(a);return"translate("+s.x+","+s.y+")"}t.attr("transform",n),b(r,e).style("opacity",1).attr("transform",n)}function rt(r,e,t,n){var a=r.x,s=r.y,i=a-n.x,o=s-n.y,c=Math.sqrt(e*e*o*o+t*t*i*i),d=Math.abs(e*t*i/c);n.x<a&&(d=-d);var l=Math.abs(e*t*o/c);return n.y<s&&(l=-l),{x:a+d,y:s+l}}function Pt(r,e,t){return rt(r,e,e,t)}function Gt(r,e,t,n){var a,s,i,o,c,d,l,m,p,u,f,g,h,v,L;if(a=e.y-r.y,i=r.x-e.x,c=e.x*r.y-r.x*e.y,p=a*t.x+i*t.y+c,u=a*n.x+i*n.y+c,!(p!==0&&u!==0&&Rt(p,u))&&(s=n.y-t.y,o=t.x-n.x,d=n.x*t.y-t.x*n.y,l=s*r.x+o*r.y+d,m=s*e.x+o*e.y+d,!(l!==0&&m!==0&&Rt(l,m))&&(f=a*o-s*i,f!==0)))return g=Math.abs(f/2),h=i*d-o*c,v=h<0?(h-g)/f:(h+g)/f,h=s*c-a*d,L=h<0?(h-g)/f:(h+g)/f,{x:v,y:L}}function Rt(r,e){return r*e>0}function T(r,e,t){var n=r.x,a=r.y,s=[],i=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY;e.forEach(function(f){i=Math.min(i,f.x),o=Math.min(o,f.y)});for(var c=n-r.width/2-i,d=a-r.height/2-o,l=0;l<e.length;l++){var m=e[l],p=e[l<e.length-1?l+1:0],u=Gt(r,t,{x:c+m.x,y:d+m.y},{x:c+p.x,y:d+p.y});u&&s.push(u)}return s.length?(s.length>1&&s.sort(function(f,g){var h=f.x-t.x,v=f.y-t.y,L=Math.sqrt(h*h+v*v),M=g.x-t.x,N=g.y-t.y,nt=Math.sqrt(M*M+N*N);return L<nt?-1:L===nt?0:1}),s[0]):(console.log("NO INTERSECTION FOUND, RETURN NODE CENTER",r),r)}function W(r,e){var t=r.x,n=r.y,a=e.x-t,s=e.y-n,i=r.width/2,o=r.height/2,c,d;return Math.abs(s)*i>Math.abs(a)*o?(s<0&&(o=-o),c=s===0?0:o*a/s,d=o):(a<0&&(i=-i),c=i,d=a===0?0:i*s/a),{x:t+c,y:n+d}}var at={rect:ye,ellipse:ve,circle:ge,diamond:xe};function Ut(r){at=r}function ye(r,e,t){var n=r.insert("rect",":first-child").attr("rx",t.rx).attr("ry",t.ry).attr("x",-e.width/2).attr("y",-e.height/2).attr("width",e.width).attr("height",e.height);return t.intersect=function(a){return W(t,a)},n}function ve(r,e,t){var n=e.width/2,a=e.height/2,s=r.insert("ellipse",":first-child").attr("x",-e.width/2).attr("y",-e.height/2).attr("rx",n).attr("ry",a);return t.intersect=function(i){return rt(t,n,a,i)},s}function ge(r,e,t){var n=Math.max(e.width,e.height)/2,a=r.insert("circle",":first-child").attr("x",-e.width/2).attr("y",-e.height/2).attr("r",n);return t.intersect=function(s){return Pt(t,n,s)},a}function xe(r,e,t){var n=e.width*Math.SQRT2/2,a=e.height*Math.SQRT2/2,s=[{x:0,y:-a},{x:-n,y:0},{x:0,y:a},{x:n,y:0}],i=r.insert("polygon",":first-child").attr("points",s.map(function(o){return o.x+","+o.y}).join(" "));return t.intersect=function(o){return T(t,s,o)},i}function pt(){var r=function(e,t){ke(t);var n=V(e,"output"),a=V(n,"clusters"),s=V(n,"edgePaths"),i=j(V(n,"edgeLabels"),t),o=et(V(n,"nodes"),t,at);wt(t),Dt(o,t),Mt(i,t),tt(s,t,K);var c=Z(a,t);Bt(c,t),Se(t)};return r.createNodes=function(e){return arguments.length?(It(e),r):et},r.createClusters=function(e){return arguments.length?(Tt(e),r):Z},r.createEdgeLabels=function(e){return arguments.length?(Nt(e),r):j},r.createEdgePaths=function(e){return arguments.length?(Ct(e),r):tt},r.shapes=function(e){return arguments.length?(Ut(e),r):at},r.arrows=function(e){return arguments.length?(_t(e),r):K},r}var we={paddingLeft:10,paddingRight:10,paddingTop:10,paddingBottom:10,rx:0,ry:0,shape:"rect"},be={arrowhead:"normal",curve:P};function ke(r){r.nodes().forEach(function(e){var t=r.node(e);!w(t,"label")&&!r.children(e).length&&(t.label=e),w(t,"paddingX")&&R(t,{paddingLeft:t.paddingX,paddingRight:t.paddingX}),w(t,"paddingY")&&R(t,{paddingTop:t.paddingY,paddingBottom:t.paddingY}),w(t,"padding")&&R(t,{paddingLeft:t.padding,paddingRight:t.padding,paddingTop:t.padding,paddingBottom:t.padding}),R(t,we),ot(["paddingLeft","paddingRight","paddingTop","paddingBottom"],function(n){t[n]=Number(t[n])}),w(t,"width")&&(t._prevWidth=t.width),w(t,"height")&&(t._prevHeight=t.height)}),r.edges().forEach(function(e){var t=r.edge(e);w(t,"label")||(t.label=""),R(t,be)})}function Se(r){ot(r.nodes(),function(e){var t=r.node(e);w(t,"_prevWidth")?t.width=t._prevWidth:delete t.width,w(t,"_prevHeight")?t.height=t._prevHeight:delete t.height,delete t._prevWidth,delete t._prevHeight})}function V(r,e){var t=r.select("g."+e);return t.empty()&&(t=r.append("g").attr("class",e)),t}var Nr=it(jt(),1),Cr=it(te(),1),Ar=it(ee(),1);function Wt(r,e,t){let n=e.width,a=e.height,s=(n+a)*.9,i=[{x:s/2,y:0},{x:s,y:-s/2},{x:s/2,y:-s},{x:0,y:-s/2}],o=A(r,s,s,i);return t.intersect=function(c){return T(t,i,c)},o}function Vt(r,e,t){let a=e.height,s=a/4,i=e.width+2*s,o=[{x:s,y:0},{x:i-s,y:0},{x:i,y:-a/2},{x:i-s,y:-a},{x:s,y:-a},{x:0,y:-a/2}],c=A(r,i,a,o);return t.intersect=function(d){return T(t,o,d)},c}function $t(r,e,t){let n=e.width,a=e.height,s=[{x:-a/2,y:0},{x:n,y:0},{x:n,y:-a},{x:-a/2,y:-a},{x:0,y:-a/2}],i=A(r,n,a,s);return t.intersect=function(o){return T(t,s,o)},i}function zt(r,e,t){let n=e.width,a=e.height,s=[{x:-2*a/6,y:0},{x:n-a/6,y:0},{x:n+2*a/6,y:-a},{x:a/6,y:-a}],i=A(r,n,a,s);return t.intersect=function(o){return T(t,s,o)},i}function Ht(r,e,t){let n=e.width,a=e.height,s=[{x:2*a/6,y:0},{x:n+a/6,y:0},{x:n-2*a/6,y:-a},{x:-a/6,y:-a}],i=A(r,n,a,s);return t.intersect=function(o){return T(t,s,o)},i}function Yt(r,e,t){let n=e.width,a=e.height,s=[{x:-2*a/6,y:0},{x:n+2*a/6,y:0},{x:n-a/6,y:-a},{x:a/6,y:-a}],i=A(r,n,a,s);return t.intersect=function(o){return T(t,s,o)},i}function Xt(r,e,t){let n=e.width,a=e.height,s=[{x:a/6,y:0},{x:n-a/6,y:0},{x:n+2*a/6,y:-a},{x:-2*a/6,y:-a}],i=A(r,n,a,s);return t.intersect=function(o){return T(t,s,o)},i}function Ft(r,e,t){let n=e.width,a=e.height,s=[{x:0,y:0},{x:n+a/2,y:0},{x:n,y:-a/2},{x:n+a/2,y:-a},{x:0,y:-a}],i=A(r,n,a,s);return t.intersect=function(o){return T(t,s,o)},i}function qt(r,e,t){let n=e.height,a=e.width+n/4,s=r.insert("rect",":first-child").attr("rx",n/2).attr("ry",n/2).attr("x",-a/2).attr("y",-n/2).attr("width",a).attr("height",n);return t.intersect=function(i){return W(t,i)},s}function Qt(r,e,t){let n=e.width,a=e.height,s=[{x:0,y:0},{x:n,y:0},{x:n,y:-a},{x:0,y:-a},{x:0,y:0},{x:-8,y:0},{x:n+8,y:0},{x:n+8,y:-a},{x:-8,y:-a},{x:-8,y:0}],i=A(r,n,a,s);return t.intersect=function(o){return T(t,s,o)},i}function Jt(r,e,t){let n=e.width,a=n/2,s=a/(2.5+n/50),i=e.height+s,o="M 0,"+s+" a "+a+","+s+" 0,0,0 "+n+" 0 a "+a+","+s+" 0,0,0 "+-n+" 0 l 0,"+i+" a "+a+","+s+" 0,0,0 "+n+" 0 l 0,"+-i,c=r.attr("label-offset-y",s).insert("path",":first-child").attr("d",o).attr("transform","translate("+-n/2+","+-(i/2+s)+")");return t.intersect=function(d){let l=W(t,d),m=l.x-t.x;if(a!=0&&(Math.abs(m)<t.width/2||Math.abs(m)==t.width/2&&Math.abs(l.y-t.y)>t.height/2-s)){let p=s*s*(1-m*m/(a*a));p!=0&&(p=Math.sqrt(p)),p=s-p,d.y-t.y>0&&(p=-p),l.y+=p}return l},c}function Ee(r){r.shapes().question=Wt,r.shapes().hexagon=Vt,r.shapes().stadium=qt,r.shapes().subroutine=Qt,r.shapes().cylinder=Jt,r.shapes().rect_left_inv_arrow=$t,r.shapes().lean_right=zt,r.shapes().lean_left=Ht,r.shapes().trapezoid=Yt,r.shapes().inv_trapezoid=Xt,r.shapes().rect_right_inv_arrow=Ft}function Te(r){r({question:Wt}),r({hexagon:Vt}),r({stadium:qt}),r({subroutine:Qt}),r({cylinder:Jt}),r({rect_left_inv_arrow:$t}),r({lean_right:zt}),r({lean_left:Ht}),r({trapezoid:Yt}),r({inv_trapezoid:Xt}),r({rect_right_inv_arrow:Ft})}function A(r,e,t,n){return r.insert("polygon",":first-child").attr("points",n.map(function(a){return a.x+","+a.y}).join(" ")).attr("transform","translate("+-e/2+","+t/2+")")}var Ne={addToRender:Ee,addToRenderV2:Te},Kt={},Ce=function(r){let e=Object.keys(r);for(let t of e)Kt[t]=r[t]},Zt=function(r,e,t,n,a,s){let i=n?n.select(`[id="${t}"]`):y(`[id="${t}"]`),o=a||document;Object.keys(r).forEach(function(d){let l=r[d],m="default";l.classes.length>0&&(m=l.classes.join(" "));let p=Q(l.styles),u=l.text!==void 0?l.text:l.id,f;if(lt(J().flowchart.htmlLabels)){let v={label:u.replace(/fa[blrs]?:fa-[\w-]+/g,L=>`<i class='${L.replace(":"," ")}'></i>`)};f=F(i,v).node(),f.parentNode.removeChild(f)}else{let v=o.createElementNS("http://www.w3.org/2000/svg","text");v.setAttribute("style",p.labelStyle.replace("color:","fill:"));let L=u.split(ct.lineBreakRegex);for(let M of L){let N=o.createElementNS("http://www.w3.org/2000/svg","tspan");N.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),N.setAttribute("dy","1em"),N.setAttribute("x","1"),N.textContent=M,v.appendChild(N)}f=v}let g=0,h="";switch(l.type){case"round":g=5,h="rect";break;case"square":h="rect";break;case"diamond":h="question";break;case"hexagon":h="hexagon";break;case"odd":h="rect_left_inv_arrow";break;case"lean_right":h="lean_right";break;case"lean_left":h="lean_left";break;case"trapezoid":h="trapezoid";break;case"inv_trapezoid":h="inv_trapezoid";break;case"odd_right":h="rect_left_inv_arrow";break;case"circle":h="circle";break;case"ellipse":h="ellipse";break;case"stadium":h="stadium";break;case"subroutine":h="subroutine";break;case"cylinder":h="cylinder";break;case"group":h="rect";break;default:h="rect"}G.warn("Adding node",l.id,l.domId),e.setNode(s.db.lookUpDomId(l.id),{labelType:"svg",labelStyle:p.labelStyle,shape:h,label:f,rx:g,ry:g,class:m,style:p.style,id:s.db.lookUpDomId(l.id)})})},Ot=function(r,e,t){let n=0,a,s;if(r.defaultStyle!==void 0){let i=Q(r.defaultStyle);a=i.style,s=i.labelStyle}r.forEach(function(i){n++;let o="L-"+i.start+"-"+i.end,c="LS-"+i.start,d="LE-"+i.end,l={};i.type==="arrow_open"?l.arrowhead="none":l.arrowhead="normal";let m="",p="";if(i.style!==void 0){let u=Q(i.style);m=u.style,p=u.labelStyle}else switch(i.stroke){case"normal":m="fill:none",a!==void 0&&(m=a),s!==void 0&&(p=s);break;case"dotted":m="fill:none;stroke-width:2px;stroke-dasharray:3;";break;case"thick":m=" stroke-width: 3.5px;fill:none";break}l.style=m,l.labelStyle=p,i.interpolate!==void 0?l.curve=q(i.interpolate,P):r.defaultInterpolate!==void 0?l.curve=q(r.defaultInterpolate,P):l.curve=q(Kt.curve,P),i.text===void 0?i.style!==void 0&&(l.arrowheadStyle="fill: #333"):(l.arrowheadStyle="fill: #333",l.labelpos="c",lt(J().flowchart.htmlLabels)?(l.labelType="html",l.label=`<span id="L-${o}" class="edgeLabel L-${c}' L-${d}" style="${l.labelStyle}">${i.text.replace(/fa[blrs]?:fa-[\w-]+/g,u=>`<i class='${u.replace(":"," ")}'></i>`)}</span>`):(l.labelType="text",l.label=i.text.replace(ct.lineBreakRegex,`
`),i.style===void 0&&(l.style=l.style||"stroke: #333; stroke-width: 1.5px;fill:none"),l.labelStyle=l.labelStyle.replace("color:","fill:"))),l.id=o,l.class=c+" "+d,l.minlen=i.length||1,e.setEdge(t.db.lookUpDomId(i.start),t.db.lookUpDomId(i.end),l,n)})},Ae=function(r,e){return G.info("Extracting classes"),e.db.getClasses()},Ie=function(r,e,t,n){G.info("Drawing flowchart");let{securityLevel:a,flowchart:s}=J(),i;a==="sandbox"&&(i=y("#i"+e));let o=a==="sandbox"?y(i.nodes()[0].contentDocument.body):y("body"),c=a==="sandbox"?i.nodes()[0].contentDocument:document,d=n.db.getDirection();d===void 0&&(d="TD");let l=s.nodeSpacing||50,m=s.rankSpacing||50,p=new xt({multigraph:!0,compound:!0}).setGraph({rankdir:d,nodesep:l,ranksep:m,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}}),u,f=n.db.getSubGraphs();for(let x=f.length-1;x>=0;x--)u=f[x],n.db.addVertex(u.id,u.title,"group",void 0,u.classes);let g=n.db.getVertices();G.warn("Get vertices",g);let h=n.db.getEdges(),v=0;for(v=f.length-1;v>=0;v--){u=f[v],ut("cluster").append("text");for(let x=0;x<u.nodes.length;x++)G.warn("Setting subgraph",u.nodes[x],n.db.lookUpDomId(u.nodes[x]),n.db.lookUpDomId(u.id)),p.setParent(n.db.lookUpDomId(u.nodes[x]),n.db.lookUpDomId(u.id))}Zt(g,p,e,o,c,n),Ot(h,p,n);let L=new pt;Ne.addToRender(L),L.arrows().none=function(S,E,k,D){let I=S.append("marker").attr("id",E).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");_(I,k[D+"Style"])},L.arrows().normal=function(S,E){S.append("marker").attr("id",E).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 M=o.select(`[id="${e}"]`),N=o.select("#"+e+" g");for(L(N,p),N.selectAll("g.node").attr("title",function(){return n.db.getTooltip(this.id)}),n.db.indexNodes("subGraph"+v),v=0;v<f.length;v++)if(u=f[v],u.title!=="undefined"){let x=c.querySelectorAll("#"+e+' [id="'+n.db.lookUpDomId(u.id)+'"] rect'),S=c.querySelectorAll("#"+e+' [id="'+n.db.lookUpDomId(u.id)+'"]'),E=x[0].x.baseVal.value,k=x[0].y.baseVal.value,D=x[0].width.baseVal.value,I=y(S[0]).select(".label");I.attr("transform",`translate(${E+D/2}, ${k+14})`),I.attr("id",e+"Text");for(let st=0;st<u.classes.length;st++)S[0].classList.add(u.classes[st])}if(!s.htmlLabels){let x=c.querySelectorAll('[id="'+e+'"] .edgeLabel .label');for(let S of x){let E=S.getBBox(),k=c.createElementNS("http://www.w3.org/2000/svg","rect");k.setAttribute("rx",0),k.setAttribute("ry",0),k.setAttribute("width",E.width),k.setAttribute("height",E.height),S.insertBefore(k,S.firstChild)}}St(p,M,s.diagramPadding,s.useMaxWidth),Object.keys(g).forEach(function(x){let S=g[x];if(S.link){let E=o.select("#"+e+' [id="'+n.db.lookUpDomId(x)+'"]');if(E){let k=c.createElementNS("http://www.w3.org/2000/svg","a");k.setAttributeNS("http://www.w3.org/2000/svg","class",S.classes.join(" ")),k.setAttributeNS("http://www.w3.org/2000/svg","href",S.link),k.setAttributeNS("http://www.w3.org/2000/svg","rel","noopener"),a==="sandbox"?k.setAttributeNS("http://www.w3.org/2000/svg","target","_top"):S.linkTarget&&k.setAttributeNS("http://www.w3.org/2000/svg","target",S.linkTarget);let D=E.insert(function(){return k},":first-child"),$=E.select(".label-container");$&&D.append(function(){return $.node()});let I=E.select(".label");I&&D.append(function(){return I.node()})}}})},Be={setConf:Ce,addVertices:Zt,addEdges:Ot,getClasses:Ae,draw:Ie},Mr={parser:mt,db:z,renderer:bt,styles:kt,init:r=>{r.flowchart||(r.flowchart={}),r.flowchart.arrowMarkerAbsolute=r.arrowMarkerAbsolute,Be.setConf(r.flowchart),z.clear(),z.setGen("gen-1")}};export{Mr as diagram};
//# sourceMappingURL=flowDiagram-d949d7c1-YPEXTMAV.min.js.map