1import{Y as _t,K as W}from"./flowDb-c1833063.KZQL7ELU-DPo-YzRQ-Cu8XXdJJ.js";import{R as St,m as _,O as Z}from"./graph.Doj0trym-SuC8wTcv-CQlFUdjs.js";import{fU as R,fT as b,f$ as Y,g0 as tt,fP as U,g1 as et,fX as rt,g2 as z,g3 as P,g4 as Lt}from"./errorMonitor-Cf5wXY6C.js";import{r as At,N as It,F as Tt,L as Nt,x as C}from"./layout.oaZJmusP-Dl_umbZp-DBrHefVn.js";import{u as Mt,f as $t,Q as nt,H as Bt,K as T,c as at,b as A,d as it,p as st}from"./styles-483fbfea.DCbF-KD0-Dl6h9wxP-I3_918Xb.js";import{C as Et}from"./line.D8WlrxM0-C-sCIaQ9-CLJVhqW9.js";import"./html-r4eYa5OA.js";import"./index-01f381cb.BJqK_LXQ-lyhf6H1N-BkQ5VB8v.js";import"./clone.Djf8k5jk-tcd5583d-CWlr3nqr.js";import"./edges-066a5561.DGXaydv9-CCuBZQ_D-DBIK1Box.js";import"./createText-ca0c5216.CuEfW_ss-Ccr39xhx-BbB41oO4.js";import"./channel.Bspr3FLs-S1jrALoK-CAi1-StU.js";import"./array.CqVTtuYm-fKLgkG2b-BzrFf4n-.js";import"./path.C0NDTjT5-CTuRNnpz-BGLZK2l_.js";var F=(r,e,t)=>new Promise((n,a)=>{var i=l=>{try{o(t.next(l))}catch(c){a(c)}},s=l=>{try{o(t.throw(l))}catch(c){a(c)}},o=l=>l.done?n(l.value):Promise.resolve(l.value).then(i,s);o((t=t.apply(r,e)).next())});function Ct(r){if(!r.ok)throw new Error(r.status+" "+r.statusText);return r.text()}function Dt(r,e){return fetch(r,e).then(Ct)}function Rt(r){return(e,t)=>Dt(e,t).then(n=>new DOMParser().parseFromString(n,r))}var Ut=Rt("image/svg+xml"),q={normal:Wt,vee:zt,undirected:Yt};function Pt(r){q=r}function Wt(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"),i=a.append("path").attr("d","M 0 0 L 10 5 L 0 10 z").style("stroke-width",1).style("stroke-dasharray","1,0");T(i,t[n+"Style"]),t[n+"Class"]&&i.attr("class",t[n+"Class"])}function zt(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"),i=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");T(i,t[n+"Style"]),t[n+"Class"]&&i.attr("class",t[n+"Class"])}function Yt(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"),i=a.append("path").attr("d","M 0 5 L 10 5").style("stroke-width",1).style("stroke-dasharray","1,0");T(i,t[n+"Style"]),t[n+"Class"]&&i.attr("class",t[n+"Class"])}function qt(r,e){var t=r;return t.node().appendChild(e.label),T(t,e.labelStyle),t}function Ht(r,e){for(var t=r.append("text"),n=Ot(e.label).split(` 2`),a=0;a<n.length;a++)t.append("tspan").attr("xml:space","preserve").attr("dy","1em").attr("x","1").text(n[a]);return T(t,e.labelStyle),t}function Ot(r){for(var e="",t=!1,n,a=0;a<r.length;++a)if(n=r[a],t){switch(n){case"n":e+=` 3`;break;default:e+=n}t=!1}else n==="\\"?t=!0:e+=n;return e}function G(r,e,t){var n=e.label,a=r.append("g");e.labelType==="svg"?qt(a,e):typeof n!="string"||e.labelType==="html"?nt(a,e):Ht(a,e);var i=a.node().getBBox(),s;switch(t){case"top":s=-e.height/2;break;case"bottom":s=e.height/2-i.height;break;default:s=-i.height/2}return a.attr("transform","translate("+-i.width/2+","+s+")"),a}var H=function(r,e){var t=e.nodes().filter(function(i){return at(e,i)}),n=r.selectAll("g.cluster").data(t,function(i){return i});A(n.exit(),e).style("opacity",0).remove();var a=n.enter().append("g").attr("class","cluster").attr("id",function(i){var s=e.node(i);return s.id}).style("opacity",0).each(function(i){var s=e.node(i),o=b(this);b(this).append("rect");var l=o.append("g").attr("class","label");G(l,s,s.clusterLabelPos)});return n=n.merge(a),n=A(n,e).style("opacity",1),n.selectAll("rect").each(function(i){var s=e.node(i),o=b(this);T(o,s.style)}),n};function Vt(r){H=r}let O=function(r,e){var t=r.selectAll("g.edgeLabel").data(e.edges(),function(a){return it(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 i=b(this);i.select(".label").remove();var s=e.edge(a),o=G(i,e.edge(a),0).classed("label",!0),l=o.node().getBBox();s.labelId&&o.attr("id",s.labelId),_(s,"width")||(s.width=l.width),_(s,"height")||(s.height=l.height)});var n;return t.exit?n=t.exit():n=t.selectAll(null),A(n,e).style("opacity",0).remove(),t};function Xt(r){O=r}function K(r,e){return r.intersect(e)}var V=function(r,e,t){var n=r.selectAll("g.edgePath").data(e.edges(),function(s){return it(s)}).classed("update",!0),a=Kt(n,e);Jt(n,e);var i=n.merge!==void 0?n.merge(a):n;return A(i,e).style("opacity",1),i.each(function(s){var o=b(this),l=e.edge(s);l.elem=this,l.id&&o.attr("id",l.id),st(o,l.class,(o.classed("update")?"update ":"")+"edgePath")}),i.selectAll("path.path").each(function(s){var o=e.edge(s);o.arrowheadId=At("arrowhead");
3var l=b(this).attr("marker-end",function(){return"url("+Ft(location.href,o.arrowheadId)+")"}).style("fill","none");A(l,e).attr("d",function(c){return Gt(e,c)}),T(l,o.style)}),i.selectAll("defs *").remove(),i.selectAll("defs").each(function(s){var o=e.edge(s),l=t[o.arrowhead];l(b(this),o.arrowheadId,o,"arrowhead")}),i};function jt(r){V=r}function Ft(r,e){var t=r.split("#")[0];return t+"#"+e}function Gt(r,e){var t=r.edge(e),n=r.node(e.v),a=r.node(e.w),i=t.points.slice(1,t.points.length-1);return i.unshift(K(n,i[0])),i.push(K(a,i[i.length-1])),ot(t,i)}function ot(r,e){var t=(Et||Ut.line)().x(function(n){return n.x}).y(function(n){return n.y});return(t.curve||t.interpolate)(r.curve),t(e)}function Qt(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 Kt(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),i=e.node(n.v).elem,s=It(a.points.length).map(function(){return Qt(i)});return ot(a,s)}),t.append("defs"),t}function Jt(r,e){var t=r.exit();A(t,e).style("opacity",0).remove()}var X=function(r,e,t){var n=e.nodes().filter(function(s){return!at(e,s)}),a=r.selectAll("g.node").data(n,function(s){return s}).classed("update",!0);a.exit().remove(),a.enter().append("g").attr("class","node").style("opacity",0),a=r.selectAll("g.node"),a.each(function(s){var o=e.node(s),l=b(this);st(l,o.class,(l.classed("update")?"update ":"")+"node"),l.select("g.label").remove();var c=l.append("g").attr("class","label"),d=G(c,o),g=t[o.shape],h=Tt(d.node().getBBox(),"width","height");o.elem=this,o.id&&l.attr("id",o.id),o.labelId&&c.attr("id",o.labelId),_(o,"width")&&(h.width=o.width),_(o,"height")&&(h.height=o.height),h.width+=o.paddingLeft+o.paddingRight,h.height+=o.paddingTop+o.paddingBottom,c.attr("transform","translate("+(o.paddingLeft-o.paddingRight)/2+","+(o.paddingTop-o.paddingBottom)/2+")");var u=b(this);u.select(".label-container").remove();var p=g(u,h,o).classed("label-container",!0);T(p,o.style);var v=p.node().getBBox();o.width=v.width,o.height=v.height});var i;return a.exit?i=a.exit():i=a.selectAll(null),A(i,e).style("opacity",0).remove(),a};function Zt(r){X=r}function te(r,e){var t=r.filter(function(){return!b(this).classed("update")});function n(a){var i=e.node(a);return"translate("+i.x+","+i.y+")"}t.attr("transform",n),A(r,e).style("opacity",1).attr("transform",n),A(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 i=e.node(a);return-i.width/2}).attr("y",function(a){var i=e.node(a);return-i.height/2})}function ee(r,e){var t=r.filter(function(){return!b(this).classed("update")});function n(a){var i=e.edge(a);return _(i,"x")?"translate("+i.x+","+i.y+")":""}t.attr("transform",n),A(r,e).style("opacity",1).attr("transform",n)}function re(r,e){var t=r.filter(function(){return!b(this).classed("update")});function n(a){var i=e.node(a);return"translate("+i.x+","+i.y+")"}t.attr("transform",n),A(r,e).style("opacity",1).attr("transform",n)}function lt(r,e,t,n){var a=r.x,i=r.y,s=a-n.x,o=i-n.y,l=Math.sqrt(e*e*o*o+t*t*s*s),c=Math.abs(e*t*s/l);n.x<a&&(c=-c);var d=Math.abs(e*t*o/l);return n.y<i&&(d=-d),{x:a+c,y:i+d}}function ne(r,e,t){return lt(r,e,e,t)}function ae(r,e,t,n){var a,i,s,o,l,c,d,g,h,u,p,v,f,x,k;if(a=e.y-r.y,s=r.x-e.x,l=e.x*r.y-r.x*e.y,h=a*t.x+s*t.y+l,u=a*n.x+s*n.y+l,!(h!==0&&u!==0&&J(h,u))&&(i=n.y-t.y,o=t.x-n.x,c=n.x*t.y-t.x*n.y,d=i*r.x+o*r.y+c,g=i*e.x+o*e.y+c,!(d!==0&&g!==0&&J(d,g))&&(p=a*o-i*s,p!==0)))return v=Math.abs(p/2),f=s*c-o*l,x=f<0?(f-v)/p:(f+v)/p,f=i*l-a*c,k=f<0?(f-v)/p:(f+v)/p,{x,y:k}}function J(r,e){return r*e>0}function I(r,e,t){var n=r.x,a=r.y,i=[],s=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY;e.forEach(function(p){s=Math.min(s,p.x),o=Math.min(o,p.y)});for(var l=n-r.width/2-s,c=a-r.height/2-o,d=0;d<e.length;d++){var g=e[d],h=e[d<e.length-1?d+1:0],u=ae(r,t,{x:l+g.x,y:c+g.y},{x:l+h.x,y:c+h.y});u&&i.push(u)}return i.length?(i.length>1&&i.sort(function(p,v){var f=p.x-t.x,x=p.y-t.y,k=Math.sqrt(f*f+x*x),M=v.x-t.x,S=v.y-t.y,y=Math.sqrt(M*M+S*S);return k<y?-1:k===y?0:1}),i[0]):r}function Q(r,e){var t=r.x,n=r.y,a=e.x-t,i=e.y-n,s=r.width/2,o=r.height/2,l,c;return Math.abs(i)*s>Math.abs(a)*o?(i<0&&(o=-o),l=i===0?0:o*a/i,c=o):(a<0&&(s=-s),l=s,c=a===0?0:s*i/a),{x:t+l,y:n+c}}var j={rect:se,ellipse:oe,circle:le,diamond:de};function ie(r){j=r}function se(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 Q(t,a)},n}function oe(r,e,t){var n=e.width/2,a=e.height/2,i=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(s){return lt(t,n,a,s)},i}function le(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(i){return ne(t,n,i)},a}function de(r,e,t){var n=e.width*Math.SQRT2/2,a=e.height*Math.SQRT2/2,i=[{x:0,y:-a},{x:-n,y:0},{x:0,y:a},{x:n,y:0}],s=r.insert("polygon",":first-child").attr("points",i.map(function(o){return o.x+","+o.y}).join(" "));return t.intersect=function(o){return I(t,i,o)},s}function ce(){var r=function(e,t){fe(t);var n=D(e,"output"),a=D(n,"clusters"),i=D(n,"edgePaths"),s=O(D(n,"edgeLabels"),t),o=X(D(n,"nodes"),t,j);Nt(t),re(o,t),ee(s,t),V(i,t,q);var l=H(a,t);te(l,t),pe(t)};return r.createNodes=function(e){return arguments.length?(Zt(e),r):X}
3,r.createClusters=function(e){return arguments.length?(Vt(e),r):H},r.createEdgeLabels=function(e){return arguments.length?(Xt(e),r):O},r.createEdgePaths=function(e){return arguments.length?(jt(e),r):V},r.shapes=function(e){return arguments.length?(ie(e),r):j},r.arrows=function(e){return arguments.length?(Pt(e),r):q},r}var he={paddingLeft:10,paddingRight:10,paddingTop:10,paddingBottom:10,rx:0,ry:0,shape:"rect"},ue={arrowhead:"normal",curve:P};function fe(r){r.nodes().forEach(function(e){var t=r.node(e);!_(t,"label")&&!r.children(e).length&&(t.label=e),_(t,"paddingX")&&C(t,{paddingLeft:t.paddingX,paddingRight:t.paddingX}),_(t,"paddingY")&&C(t,{paddingTop:t.paddingY,paddingBottom:t.paddingY}),_(t,"padding")&&C(t,{paddingLeft:t.padding,paddingRight:t.padding,paddingTop:t.padding,paddingBottom:t.padding}),C(t,he),Z(["paddingLeft","paddingRight","paddingTop","paddingBottom"],function(n){t[n]=Number(t[n])}),_(t,"width")&&(t._prevWidth=t.width),_(t,"height")&&(t._prevHeight=t.height)}),r.edges().forEach(function(e){var t=r.edge(e);_(t,"label")||(t.label=""),C(t,ue)})}function pe(r){Z(r.nodes(),function(e){var t=r.node(e);_(t,"_prevWidth")?t.width=t._prevWidth:delete t.width,_(t,"_prevHeight")?t.height=t._prevHeight:delete t.height,delete t._prevWidth,delete t._prevHeight})}function D(r,e){var t=r.select("g."+e);return t.empty()&&(t=r.append("g").attr("class",e)),t}function dt(r,e,t){const n=e.width,a=e.height,i=(n+a)*.9,s=[{x:i/2,y:0},{x:i,y:-i/2},{x:i/2,y:-i},{x:0,y:-i/2}],o=N(r,i,i,s);return t.intersect=function(l){return I(t,s,l)},o}function ct(r,e,t){const n=e.height,a=n/4,i=e.width+2*a,s=[{x:a,y:0},{x:i-a,y:0},{x:i,y:-n/2},{x:i-a,y:-n},{x:a,y:-n},{x:0,y:-n/2}],o=N(r,i,n,s);return t.intersect=function(l){return I(t,s,l)},o}function ht(r,e,t){const n=e.width,a=e.height,i=[{x:-a/2,y:0},{x:n,y:0},{x:n,y:-a},{x:-a/2,y:-a},{x:0,y:-a/2}],s=N(r,n,a,i);return t.intersect=function(o){return I(t,i,o)},s}function ut(r,e,t){const n=e.width,a=e.height,i=[{x:-2*a/6,y:0},{x:n-a/6,y:0},{x:n+2*a/6,y:-a},{x:a/6,y:-a}],s=N(r,n,a,i);return t.intersect=function(o){return I(t,i,o)},s}function ft(r,e,t){const n=e.width,a=e.height,i=[{x:2*a/6,y:0},{x:n+a/6,y:0},{x:n-2*a/6,y:-a},{x:-a/6,y:-a}],s=N(r,n,a,i);return t.intersect=function(o){return I(t,i,o)},s}function pt(r,e,t){const n=e.width,a=e.height,i=[{x:-2*a/6,y:0},{x:n+2*a/6,y:0},{x:n-a/6,y:-a},{x:a/6,y:-a}],s=N(r,n,a,i);return t.intersect=function(o){return I(t,i,o)},s}function gt(r,e,t){const n=e.width,a=e.height,i=[{x:a/6,y:0},{x:n-a/6,y:0},{x:n+2*a/6,y:-a},{x:-2*a/6,y:-a}],s=N(r,n,a,i);return t.intersect=function(o){return I(t,i,o)},s}function yt(r,e,t){const n=e.width,a=e.height,i=[{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}],s=N(r,n,a,i);return t.intersect=function(o){return I(t,i,o)},s}function xt(r,e,t){const n=e.height,a=e.width+n/4,i=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(s){return Q(t,s)},i}function vt(r,e,t){const n=e.width,a=e.height,i=[{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}],s=N(r,n,a,i);return t.intersect=function(o){return I(t,i,o)},s}function bt(r,e,t){const n=e.width,a=n/2,i=a/(2.5+n/50),s=e.height+i,o="M 0,"+i+" a "+a+","+i+" 0,0,0 "+n+" 0 a "+a+","+i+" 0,0,0 "+-n+" 0 l 0,"+s+" a "+a+","+i+" 0,0,0 "+n+" 0 l 0,"+-s,l=r.attr("label-offset-y",i).insert("path",":first-child").attr("d",o).attr("transform","translate("+-n/2+","+-(s/2+i)+")");return t.intersect=function(c){const d=Q(t,c),g=d.x-t.x;if(a!=0&&(Math.abs(g)<t.width/2||Math.abs(g)==t.width/2&&Math.abs(d.y-t.y)>t.height/2-i)){let h=i*i*(1-g*g/(a*a));h!=0&&(h=Math.sqrt(h)),h=i-h,c.y-t.y>0&&(h=-h),d.y+=h}return d},l}function ge(r){r.shapes().question=dt,r.shapes().hexagon=ct,r.shapes().stadium=xt,r.shapes().subroutine=vt,r.shapes().cylinder=bt,r.shapes().rect_left_inv_arrow=ht,r.shapes().lean_right=ut,r.shapes().lean_left=ft,r.shapes().trapezoid=pt,r.shapes().inv_trapezoid=gt,r.shapes().rect_right_inv_arrow=yt}function ye(r){r({question:dt}),r({hexagon:ct}),r({stadium:xt}
3),r({subroutine:vt}),r({cylinder:bt}),r({rect_left_inv_arrow:ht}),r({lean_right:ut}),r({lean_left:ft}),r({trapezoid:pt}),r({inv_trapezoid:gt}),r({rect_right_inv_arrow:yt})}function N(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+")")}const xe={addToRender:ge,addToRenderV2:ye},mt={},ve=function(r){const e=Object.keys(r);for(const t of e)mt[t]=r[t]},wt=function(r,e,t,n,a,i){return F(this,null,function*(){const s=n?n.select(`[id="${t}"]`):b(`[id="${t}"]`),o=a||document,l=Object.keys(r);for(const c of l){const d=r[c];let g="default";d.classes.length>0&&(g=d.classes.join(" "));const h=Y(d.styles);let u=d.text!==void 0?d.text:d.id,p;if(tt(U().flowchart.htmlLabels)){const x={label:yield et(u.replace(/fa[blrs]?:fa-[\w-]+/g,k=>`<i class='${k.replace(":"," ")}'></i>`),U())};p=nt(s,x).node(),p.parentNode.removeChild(p)}else{const x=o.createElementNS("http://www.w3.org/2000/svg","text");x.setAttribute("style",h.labelStyle.replace("color:","fill:"));const k=u.split(rt.lineBreakRegex);for(const M of k){const S=o.createElementNS("http://www.w3.org/2000/svg","tspan");S.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),S.setAttribute("dy","1em"),S.setAttribute("x","1"),S.textContent=M,x.appendChild(S)}p=x}let v=0,f="";switch(d.type){case"round":v=5,f="rect";break;case"square":f="rect";break;case"diamond":f="question";break;case"hexagon":f="hexagon";break;case"odd":f="rect_left_inv_arrow";break;case"lean_right":f="lean_right";break;case"lean_left":f="lean_left";break;case"trapezoid":f="trapezoid";break;case"inv_trapezoid":f="inv_trapezoid";break;case"odd_right":f="rect_left_inv_arrow";break;case"circle":f="circle";break;case"ellipse":f="ellipse";break;case"stadium":f="stadium";break;case"subroutine":f="subroutine";break;case"cylinder":f="cylinder";break;case"group":f="rect";break;default:f="rect"}R.warn("Adding node",d.id,d.domId),e.setNode(i.db.lookUpDomId(d.id),{labelType:"svg",labelStyle:h.labelStyle,shape:f,label:p,rx:v,ry:v,class:g,style:h.style,id:i.db.lookUpDomId(d.id)})}})},kt=function(r,e,t){return F(this,null,function*(){let n=0,a,i;if(r.defaultStyle!==void 0){const s=Y(r.defaultStyle);a=s.style,i=s.labelStyle}for(const s of r){n++;const o="L-"+s.start+"-"+s.end,l="LS-"+s.start,c="LE-"+s.end,d={};s.type==="arrow_open"?d.arrowhead="none":d.arrowhead="normal";let g="",h="";if(s.style!==void 0){const u=Y(s.style);g=u.style,h=u.labelStyle}else switch(s.stroke){case"normal":g="fill:none",a!==void 0&&(g=a),i!==void 0&&(h=i);break;case"dotted":g="fill:none;stroke-width:2px;stroke-dasharray:3;";break;case"thick":g=" stroke-width: 3.5px;fill:none";break}d.style=g,d.labelStyle=h,s.interpolate!==void 0?d.curve=z(s.interpolate,P):r.defaultInterpolate!==void 0?d.curve=z(r.defaultInterpolate,P):d.curve=z(mt.curve,P),s.text===void 0?s.style!==void 0&&(d.arrowheadStyle="fill: #333"):(d.arrowheadStyle="fill: #333",d.labelpos="c",tt(U().flowchart.htmlLabels)?(d.labelType="html",d.label=`<span id="L-${o}" class="edgeLabel L-${l}' L-${c}" style="${d.labelStyle}">${yield et(s.text.replace(/fa[blrs]?:fa-[\w-]+/g,u=>`<i class='${u.replace(":"," ")}'></i>`),U())}</span>`):(d.labelType="text",d.label=s.text.replace(rt.lineBreakRegex,` 4`),s.style===void 0&&(d.style=d.style||"stroke: #333; stroke-width: 1.5px;fill:none"),d.labelStyle=d.labelStyle.replace("color:","fill:"))),d.id=o,d.class=l+" "+c,d.minlen=s.length||1,e.setEdge(t.db.lookUpDomId(s.start),t.db.lookUpDomId(s.end),d,n)}})},be=function(r,e){return R.info("Extracting classes"),e.db.getClasses()},me=function(r,e,t,n){return F(this,null,function*(){R.info("Drawing flowchart");const{securityLevel:a,flowchart:i}=U();let s;a==="sandbox"&&(s=b("#i"+e));const o=a==="sandbox"?b(s.nodes()[0].contentDocument.body):b("body"),l=a==="sandbox"?s.nodes()[0].contentDocument:document;let c=n.db.getDirection();c===void 0&&(c="TD");const d=i.nodeSpacing||50,g=i.rankSpacing||50,h=new St({multigraph:!0,compound:!0}).setGraph({rankdir:c,nodesep:d,ranksep:g,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});let u;const p=n.db.getSubGraphs();for(let y=p.length-1;y>=0;y--)u=p[y],n.db.addVertex(u.id,u.title,"group",void 0,u.classes);const v=n.db.getVertices();R.warn("Get vertices",v);const f=n.db.getEdges();let x=0;for(x=p.length-1;x>=0;x--){u=p[x],Bt("cluster").append("text");for(let y=0;y<u.nodes.length;y++)R.warn("Setting subgraph",u.nodes[y],n.db.lookUpDomId(u.nodes[y]),n.db.lookUpDomId(u.id)),h.setParent(n.db.lookUpDomId(u.nodes[y]),n.db.lookUpDomId(u.id))}yield wt(v,h,e,o,l,n),yield kt(f,h,n);const k=new ce;xe.addToRender(k),k.arrows().none=function(y,m,L,w){const $=y.append("marker").attr("id",m).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");T($,L[w+"Style"])},k.arrows().normal=function(y,m){y.append("marker").attr("id",m).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")};const M=o.select(`[id="${e}"]`),S=o.select("#"+e+" g");for(k(S,h),S.selectAll("g.node").attr("title",function(){return n.db.getTooltip(this.id)}),n.db.indexNodes("subGraph"+x),x=0;x<p.length;x++)if(u=p[x],u.title!=="undefined"){const y=l.querySelectorAll("#"+e+' [id="'+n.db.lookUpDomId(u.id)+'"] rect'),m=l.querySelectorAll("#"+e+' [id="'+n.db.lookUpDomId(u.id)+'"]'),L=y[0].x.baseVal.value,w=y[0].y.baseVal.value,$=y[0].width.baseVal.value,E=b(m[0]).select(".label");E.attr("transform",`translate(${L+$/2}, ${w+14})`),E.attr("id",e+"Text");for(let B=0;B<u.classes.length;B++)m[0].classList.add(u.classes[B])}if(!i.htmlLabels){const y=l.querySelectorAll('[id="'+e+'"] .edgeLabel .label');for(const m of y){const L=m.getBBox(),w=l.createElementNS("http://www.w3.org/2000/svg","rect");w.setAttribute("rx",0),w.setAttribute("ry",0),w.setAttribute("width",L.width),w.setAttribute("height",L.height),m.insertBefore(w,m.firstChild)}}Lt(h,M,i.diagramPadding,i.useMaxWidth),Object.keys(v).forEach(function(y){const m=v[y];if(m.link){const L=o.select("#"+e+' [id="'+n.db.lookUpDomId(y)+'"]');if(L){const w=l.createElementNS("http://www.w3.org/2000/svg","a");w.setAttributeNS("http://www.w3.org/2000/svg","class",m.classes.join(" ")),w.setAttributeNS("http://www.w3.org/2000/svg","href",m.link),w.setAttributeNS("http://www.w3.org/2000/svg","rel","noopener"),a==="sandbox"?w.setAttributeNS("http://www.w3.org/2000/svg","target","_top"):m.linkTarget&&w.setAttributeNS("http://www.w3.org/2000/svg","target",m.linkTarget);const $=L.insert(function(){return w},":first-child"),E=L.select(".label-container");E&&$.append(function(){return E.node()});const B=L.select(".label");B&&$.append(function(){return B.node()})}}})})},we={setConf:ve,addVertices:wt,addEdges:kt,getClasses:be,draw:me},Re={parser:_t,db:W,renderer:Mt,styles:$t,init:r=>{r.flowchart||(r.flowchart={}),r.flowchart.arrowMarkerAbsolute=r.arrowMarkerAbsolute,we.setConf(r.flowchart),W.clear(),W.setGen("gen-1")}};export{Re as diagram};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.