mermaid
Version:
Markdown-ish syntax for generating flowcharts, mindmaps, sequence diagrams, class diagrams, gantt charts, git graphs and more.
63 lines • 103 kB
JavaScript
import{a as k}from"./chunk-5IMINLNL.mjs";import{a as Ut,b as bt,d as v,e as D}from"./chunk-WJBAP47W.mjs";import{a as zt,b as It}from"./chunk-UAT7B5JY.mjs";import{c as et}from"./chunk-SZD42YQK.mjs";import{d as xt}from"./chunk-2SREHG4O.mjs";import{k as $t,r as Dt,t as z}from"./chunk-7CWYLC5S.mjs";import{A as Lt,C as Vt,D as qt,_ as Z,ba as Rt,n as nt,t as ut,x as tt}from"./chunk-2AEHWXPW.mjs";import{b as Y,h as J}from"./chunk-LIEV3EAG.mjs";import{a as x}from"./chunk-AQ6EADP3.mjs";var M=x(async(y,t,h)=>{let p,a=t.useHtmlLabels||nt(Z()?.htmlLabels);h?p=h:p="node default";let o=y.insert("g").attr("class",p).attr("id",t.domId||t.id),f=o.insert("g").attr("class","label").attr("style",z(t.labelStyle)),i;t.label===void 0?i="":i=typeof t.label=="string"?t.label:t.label[0];let n=!!t.icon||!!t.img,r=t.labelType==="markdown",e=await et(f,Lt(Dt(i),Z()),{useHtmlLabels:a,width:t.width||Z().flowchart?.wrappingWidth,classes:r?"markdown-node-label":"",style:t.labelStyle,addSvgBackground:n,markdown:r},Z()),s=e.getBBox(),c=(t?.padding??0)/2;if(a){let l=e.children[0],g=J(e);await zt(l,i),s=l.getBoundingClientRect(),g.attr("width",s.width),g.attr("height",s.height)}return a?f.attr("transform","translate("+-s.width/2+", "+-s.height/2+")"):f.attr("transform","translate(0, "+-s.height/2+")"),t.centerLabel&&f.attr("transform","translate("+-s.width/2+", "+-s.height/2+")"),f.insert("rect",":first-child"),{shapeSvg:o,bbox:s,halfPadding:c,label:f}},"labelHelper"),Mt=x(async(y,t,h)=>{let p=h.useHtmlLabels??tt(Z()),a=y.insert("g").attr("class","label").attr("style",h.labelStyle||""),o=await et(a,Lt(Dt(t),Z()),{useHtmlLabels:p,width:h.width||Z()?.flowchart?.wrappingWidth,style:h.labelStyle,addSvgBackground:!!h.icon||!!h.img}),f=o.getBBox(),i=h.padding/2;if(tt(Z())){let n=o.children[0],r=J(o);f=n.getBoundingClientRect(),r.attr("width",f.width),r.attr("height",f.height)}return p?a.attr("transform","translate("+-f.width/2+", "+-f.height/2+")"):a.attr("transform","translate(0, "+-f.height/2+")"),h.centerLabel&&a.attr("transform","translate("+-f.width/2+", "+-f.height/2+")"),a.insert("rect",":first-child"),{shapeSvg:y,bbox:f,halfPadding:i,label:a}},"insertLabel"),P=x((y,t)=>{let h=t.node().getBBox();y.width=h.width,y.height=h.height},"updateNodeBounds");var C=x((y,t)=>(y.look==="handDrawn"?"rough-node":"node")+" "+y.cssClasses+" "+(t||""),"getNodeClasses");function W(y){let t=y.map((h,p)=>`${p===0?"M":"L"}${h.x},${h.y}`);return t.push("Z"),t.join(" ")}x(W,"createPathFromPoints");function ct(y,t,h,p,a,o){let f=[],n=h-y,r=p-t,e=n/o,s=2*Math.PI/e,c=t+r/2;for(let l=0;l<=50;l++){let g=l/50,m=y+g*n,u=c+a*Math.sin(s*(m-y));f.push({x:m,y:u})}return f}x(ct,"generateFullSineWavePoints");function kt(y,t,h,p,a,o){let f=[],i=a*Math.PI/180,e=(o*Math.PI/180-i)/(p-1);for(let s=0;s<p;s++){let c=i+s*e,l=y+h*Math.cos(c),g=t+h*Math.sin(c);f.push({x:-l,y:-g})}return f}x(kt,"generateCirclePoints");function Wt(y){let t=Array.from(y.childNodes).filter(n=>n.tagName==="path"),h=document.createElementNS("http://www.w3.org/2000/svg","path"),p=t.map(n=>n.getAttribute("d")).filter(n=>n!==null).join(" ");h.setAttribute("d",p);let a=t.find(n=>n.getAttribute("fill")!=="none"),o=t.find(n=>n.getAttribute("stroke")!=="none"),f=x((n,r)=>n?.getAttribute(r)??void 0,"getAttr");if(a){let n={fill:f(a,"fill"),"fill-opacity":f(a,"fill-opacity")??"1"};Object.entries(n).forEach(([r,e])=>{e&&h.setAttribute(r,e)})}if(o){let n={stroke:f(o,"stroke"),"stroke-width":f(o,"stroke-width")??"1","stroke-opacity":f(o,"stroke-opacity")??"1"};Object.entries(n).forEach(([r,e])=>{e&&h.setAttribute(r,e)})}let i=document.createElementNS("http://www.w3.org/2000/svg","g");return i.appendChild(h),i}x(Wt,"mergePaths");var vs=x((y,t)=>{var h=y.x,p=y.y,a=t.x-h,o=t.y-p,f=y.width/2,i=y.height/2,n,r;return Math.abs(o)*f>Math.abs(a)*i?(o<0&&(i=-i),n=o===0?0:i*a/o,r=i):(a<0&&(f=-f),n=f,r=a===0?0:f*o/a),{x:h+n,y:p+r}},"intersectRect"),mt=vs;var Ps=x(async(y,t,h,p=!1,a=!1)=>{let o=t||"";typeof o=="object"&&(o=o[0]);let f=Z(),i=tt(f);return await et(y,o,{style:h,isTitle:p,useHtmlLabels:i,markdown:!1,isNode:a,width:Number.POSITIVE_INFINITY},f)},"createLabel"),Pt=Ps;var it=x((y,t,h,p,a)=>["M",y+a,t,"H",y+h-a,"A",a,a,0,0,1,y+h,t+a,"V",t+p-a,"A",a,a,0,0,1,y+h-a,t+p,"H",y+a,"A",a,a,0,0,1,y,t+p-a,"V",t+a,"A",a,a,0,0,1,y+a,t,"Z"].join(" "),"createRoundedRectPathD");var Zt=x(async(y,t)=>{let h=Z(),{themeVariables:p,handDrawnSeed:a}=h,{clusterBkg:o,clusterBorder:f}=p,i=f,{labelStyles:n,nodeStyles:r,borderStyles:e,backgroundStyles:s}=v(t),c=y.insert("g").attr("class","cluster swimlane "+(t.cssClasses||"")).attr("id",t.id).attr("data-id",t.id).attr("data-et","cluster").attr("data-look",t.look),l=nt(h.flowchart.htmlLabels),g=t.direction==="LR",m=c.insert("g").attr("class","cluster-label swimlane-label"),u=await et(m,t.label,{style:t.labelStyle,useHtmlLabels:l,isNode:!0,width:t.width}),d=u.getBBox();if(l){let H=u.children[0],A=J(u);d=H.getBoundingClientRect(),A.attr("width",d.width),A.attr("height",d.height)}let b=t.padding??0,S=t.width<=d.width+b?d.width+b:t.width;t.width<=d.width+b?t.diff=(S-t.width)/2-b:t.diff=-b;let N=t.height,w=t.y-N/2,B=t.y+N/2,T=t.x-S/2,R=t.swimlaneContentTop!==void 0?t.swimlaneContentTop:w+N/3,G=g?4:0,E=d.height+2*G,j,I;if(g){let H=Math.max(E,d.height+2*G),A=T+H,O=Math.max(0,S-H);if(t.look==="handDrawn"){let X=k.svg(c),_=D(t,{roughness:.7,fill:o,stroke:i,fillWeight:3,seed:a}),q=D(t,{roughness:.7,fill:"none",stroke:i,seed:a}),gt=X.rectangle(T,w,H,N,_);j=c.insert(()=>gt,":first-child");let pt=X.rectangle(A,w,O,N,q);I=c.insert(()=>pt,":first-child"),j.select("path:nth-child(2)").attr("style",e.join(";")),j.select("path").attr("style",s.join(";").replace("fill","stroke"))}else j=c.insert("rect",":first-child"),I=c.insert("rect",":first-child"),j.attr("class","swimlane-title").attr("style",r).attr("x",T).attr("y",w).attr("width",H).attr("height",N).attr("fill",o).attr("stroke",i),I.attr("class","swimlane-body").attr("style",r).attr("x",A).attr("y",w).attr("width",O).attr("height",N).attr("fill","none").attr("stroke",i);let L=T+H/2,V=t.y;m.attr("transform",`translate(${L}, ${V}) rotate(-90) translate(${-d.width/2}, ${-d.height/2})`)}else{let H=Math.max(0,R-w),A=Math.min(E,H),O=w+A,L=Math.max(0,B-O),V=t.x-S/2;if(t.look==="handDrawn"){let q=k.svg(c),gt=D(t,{roughness:.7,fill:o,stroke:i,fillWeight:3,seed:a}),pt=D(t,{roughness:.7,fill:"none",stroke:i,seed:a}),lt=q.rectangle(V,w,S,A,gt);j=c.insert(()=>lt,":first-child");let ot=q.rectangle(V,O,S,L,pt);I=c.insert(()=>ot,":first-child"),j.select("path:nth-child(2)").attr("style",e.join(";")),j.select("path").attr("style",s.join(";").replace("fill","stroke"))}else j=c.insert("rect",":first-child"),I=c.insert("rect",":first-child"),j.attr("class","swimlane-title").attr("style",r).attr("x",V).attr("y",w).attr("width",S).attr("height",A).attr("fill",o).attr("stroke",i),I.attr("class","swimlane-body").attr("style",r).attr("x",V).attr("y",O).attr("width",S).attr("height",L).attr("fill","none").attr("stroke",i);let X=t.x-d.width/2,_=w+(A-d.height)/2;m.attr("transform",`translate(${X}, ${_})`)}if(Y.trace("Swimlane data ",t,JSON.stringify(t)),n){let H=m.select("span");H&&H.attr("style",n)}return t.offsetX=0,t.width=S,t.height=N,t.offsetY=d.height-b/2,t.intersect=function(H){return mt(t,H)},{cluster:c,labelBBox:d}},"swimlane");var Jt=x(async(y,t)=>{Y.info("Creating subgraph rect for ",t.id,t);let h=Z(),{themeVariables:p,handDrawnSeed:a}=h,{clusterBkg:o,clusterBorder:f}=p,{labelStyles:i,nodeStyles:n,borderStyles:r,backgroundStyles:e}=v(t),s=y.insert("g").attr("class","cluster "+t.cssClasses).attr("id",t.domId).attr("data-look",t.look),c=tt(h),l=s.insert("g").attr("class","cluster-label "),g;t.labelType==="markdown"?g=await et(l,t.label,{style:t.labelStyle,useHtmlLabels:c,isNode:!0,width:t.width}):g=await Pt(l,t.label,t.labelStyle||"",!1,!0);let m=g.getBBox();if(tt(h)){let T=g.children[0],R=J(g);m=T.getBoundingClientRect(),R.attr("width",m.width),R.attr("height",m.height)}let u=t.width<=m.width+t.padding?m.width+t.padding:t.width;t.width<=m.width+t.padding?t.diff=(u-t.width)/2-t.padding:t.diff=-t.padding;let d=t.height,b=t.x-u/2,S=t.y-d/2;Y.trace("Data ",t,JSON.stringify(t));let N;if(t.look==="handDrawn"){let T=k.svg(s),R=D(t,{roughness:.7,fill:o,stroke:f,fillWeight:3,seed:a}),G=T.path(it(b,S,u,d,0),R);N=s.insert(()=>(Y.debug("Rough node insert CXC",G),G),":first-child"),N.select("path:nth-child(2)").attr("style",r.join(";")),N.select("path").attr("style",e.join(";").replace("fill","stroke"))}else N=s.insert("rect",":first-child"),N.attr("style",n).attr("rx",t.rx).attr("ry",t.ry).attr("x",b).attr("y",S).attr("width",u).attr("height",d);let{subGraphTitleTopMargin:w}=It(h);if(l.attr("transform",`translate(${t.x-m.width/2}, ${t.y-t.height/2+w})`),i){let T=l.select("span");T&&T.attr("style",i)}let B=N.node().getBBox();return t.offsetX=0,t.width=B.width,t.height=B.height,t.offsetY=m.height-t.padding/2,t.intersect=function(T){return mt(t,T)},{cluster:s,labelBBox:m}},"rect"),Bs=x((y,t)=>{let h=y.insert("g").attr("class","note-cluster").attr("id",t.domId),p=h.insert("rect",":first-child"),a=0*t.padding,o=a/2;p.attr("rx",t.rx).attr("ry",t.ry).attr("x",t.x-t.width/2-o).attr("y",t.y-t.height/2-o).attr("width",t.width+a).attr("height",t.height+a).attr("fill","none");let f=p.node().getBBox();return t.width=f.width,t.height=f.height,t.intersect=function(i){return mt(t,i)},{cluster:h,labelBBox:{width:0,height:0}}},"noteGroup"),Ts=x(async(y,t)=>{let h=Z(),{themeVariables:p,handDrawnSeed:a}=h,{altBackground:o,compositeBackground:f,compositeTitleBackground:i,nodeBorder:n}=p,r=y.insert("g").attr("class",t.cssClasses).attr("id",t.domId).attr("data-id",t.id).attr("data-look",t.look),e=r.insert("g",":first-child"),s=r.insert("g").attr("class","cluster-label"),c=r.append("rect"),l=await Pt(s,t.label,t.labelStyle,void 0,!0),g=l.getBBox();if(tt(h)){let G=l.children[0],E=J(l);g=G.getBoundingClientRect(),E.attr("width",g.width),E.attr("height",g.height)}let m=0*t.padding,u=m/2,d=(t.width<=g.width+t.padding?g.width+t.padding:t.width)+m;t.width<=g.width+t.padding?t.diff=(d-t.width)/2-t.padding:t.diff=-t.padding;let b=t.height+m,S=t.height+m-g.height-6,N=t.x-d/2,w=t.y-b/2;t.width=d;let B=t.y-t.height/2-u+g.height+2,T;if(t.look==="handDrawn"){let G=t.cssClasses.includes("statediagram-cluster-alt"),E=k.svg(r),j=t.rx||t.ry?E.path(it(N,w,d,b,10),{roughness:.7,fill:i,fillStyle:"solid",stroke:n,seed:a}):E.rectangle(N,w,d,b,{seed:a});T=r.insert(()=>j,":first-child");let I=E.rectangle(N,B,d,S,{fill:G?o:f,fillStyle:G?"hachure":"solid",stroke:n,seed:a});T=r.insert(()=>j,":first-child"),c=r.insert(()=>I)}else T=e.insert("rect",":first-child"),T.attr("class","outer").attr("x",N).attr("y",w).attr("width",d).attr("height",b).attr("data-look",t.look),c.attr("class","inner").attr("x",N).attr("y",B).attr("width",d).attr("height",S);s.attr("transform",`translate(${t.x-g.width/2}, ${w+1-(tt(h)?0:3)})`);let R=T.node().getBBox();return t.height=R.height,t.offsetX=0,t.offsetY=g.height-t.padding/2,t.labelBBox=g,t.intersect=function(G){return mt(t,G)},{cluster:r,labelBBox:g}},"roundedWithTitle"),Cs=x(async(y,t)=>{Y.info("Creating subgraph rect for ",t.id,t);let h=Z(),{themeVariables:p,handDrawnSeed:a}=h,{clusterBkg:o,clusterBorder:f}=p,{labelStyles:i,nodeStyles:n,borderStyles:r,backgroundStyles:e}=v(t),s=y.insert("g").attr("class","cluster "+t.cssClasses).attr("id",t.domId).attr("data-look",t.look),c=tt(h),l=s.insert("g").attr("class","cluster-label "),g=await et(l,t.label,{style:t.labelStyle,useHtmlLabels:c,isNode:!0,width:t.width}),m=g.getBBox();if(tt(h)){let T=g.children[0],R=J(g);m=T.getBoundingClientRect(),R.attr("width",m.width),R.attr("height",m.height)}let u=t.width<=m.width+t.padding?m.width+t.padding:t.width;t.width<=m.width+t.padding?t.diff=(u-t.width)/2-t.padding:t.diff=-t.padding;let d=t.height,b=t.x-u/2,S=t.y-d/2;Y.trace("Data ",t,JSON.stringify(t));let N;if(t.look==="handDrawn"){let T=k.svg(s),R=D(t,{roughness:.7,fill:o,stroke:f,fillWeight:4,seed:a}),G=T.path(it(b,S,u,d,t.rx),R);N=s.insert(()=>(Y.debug("Rough node insert CXC",G),G),":first-child"),N.select("path:nth-child(2)").attr("style",r.join(";")),N.select("path").attr("style",e.join(";").replace("fill","stroke"))}else N=s.insert("rect",":first-child"),N.attr("style",n).attr("rx",t.rx).attr("ry",t.ry).attr("x",b).attr("y",S).attr("width",u).attr("height",d);let{subGraphTitleTopMargin:w}=It(h);if(l.attr("transform",`translate(${t.x-m.width/2}, ${t.y-t.height/2+w})`),i){let T=l.select("span");T&&T.attr("style",i)}let B=N.node().getBBox();return t.offsetX=0,t.width=B.width,t.height=B.height,t.offsetY=m.height-t.padding/2,t.intersect=function(T){return mt(t,T)},{cluster:s,labelBBox:m}},"kanbanSection"),Rs=x((y,t)=>{let h=Z(),{themeVariables:p,handDrawnSeed:a}=h,{nodeBorder:o}=p,f=y.insert("g").attr("class",t.cssClasses).attr("id",t.domId).attr("data-look",t.look),i=f.insert("g",":first-child"),n=0*t.padding,r=t.width+n;t.diff=-t.padding;let e=t.height+n,s=t.x-r/2,c=t.y-e/2;t.width=r;let l;if(t.look==="handDrawn"){let u=k.svg(f).rectangle(s,c,r,e,{fill:"lightgrey",roughness:.5,strokeLineDash:[5],stroke:o,seed:a});l=f.insert(()=>u,":first-child")}else{l=i.insert("rect",":first-child");let m="outer";t.look,m="divider",l.attr("class",m).attr("x",s).attr("y",c).attr("width",r).attr("height",e).attr("data-look",t.look)}let g=l.node().getBBox();return t.height=g.height,t.offsetX=0,t.offsetY=0,t.intersect=function(m){return mt(t,m)},{cluster:f,labelBBox:{}}},"divider"),Ms=Jt,Gs={rect:Jt,squareRect:Ms,roundedWithTitle:Ts,noteGroup:Bs,divider:Rs,kanbanSection:Cs,swimlane:Zt},Kt=new Map,Xr=x(async(y,t)=>{let h=t.shape||"rect",p=await Gs[h](y,t);return Kt.set(t.id,p),p},"insertCluster");var Yr=x(()=>{Kt=new Map},"clear");function Es(y,t){return y.intersect(t)}x(Es,"intersectNode");var Qt=Es;function Hs(y,t,h,p){var a=y.x,o=y.y,f=a-p.x,i=o-p.y,n=Math.sqrt(t*t*i*i+h*h*f*f),r=Math.abs(t*h*f/n);p.x<a&&(r=-r);var e=Math.abs(t*h*i/n);return p.y<o&&(e=-e),{x:a+r,y:o+e}}x(Hs,"intersectEllipse");var Gt=Hs;function js(y,t,h){return Gt(y,t,t,h)}x(js,"intersectCircle");var te=js;function As(y,t,h,p){{let a=t.y-y.y,o=y.x-t.x,f=t.x*y.y-y.x*t.y,i=a*h.x+o*h.y+f,n=a*p.x+o*p.y+f,r=1e-6;if(i!==0&&n!==0&&ee(i,n))return;let e=p.y-h.y,s=h.x-p.x,c=p.x*h.y-h.x*p.y,l=e*y.x+s*y.y+c,g=e*t.x+s*t.y+c;if(Math.abs(l)<r&&Math.abs(g)<r&&ee(l,g))return;let m=a*s-e*o;if(m===0)return;let u=Math.abs(m/2),d=o*c-s*f,b=d<0?(d-u)/m:(d+u)/m;d=e*f-a*c;let S=d<0?(d-u)/m:(d+u)/m;return{x:b,y:S}}}x(As,"intersectLine");function ee(y,t){return y*t>0}x(ee,"sameSign");var se=As;function Os(y,t,h){let p=y.x,a=y.y,o=[],f=Number.POSITIVE_INFINITY,i=Number.POSITIVE_INFINITY;typeof t.forEach=="function"?t.forEach(function(e){f=Math.min(f,e.x),i=Math.min(i,e.y)}):(f=Math.min(f,t.x),i=Math.min(i,t.y));let n=p-y.width/2-f,r=a-y.height/2-i;for(let e=0;e<t.length;e++){let s=t[e],c=t[e<t.length-1?e+1:0],l=se(y,h,{x:n+s.x,y:r+s.y},{x:n+c.x,y:r+c.y});l&&o.push(l)}return o.length?(o.length>1&&o.sort(function(e,s){let c=e.x-h.x,l=e.y-h.y,g=Math.sqrt(c*c+l*l),m=s.x-h.x,u=s.y-h.y,d=Math.sqrt(m*m+u*u);return g<d?-1:g===d?0:1}),o[0]):y}x(Os,"intersectPolygon");var re=Os;var $={node:Qt,circle:te,ellipse:Gt,polygon:re,rect:mt};function ie(y,t){let{labelStyles:h}=v(t);t.labelStyle=h;let p=C(t),a=p;p||(a="anchor");let o=y.insert("g").attr("class",a).attr("id",t.domId||t.id),f=1,{cssStyles:i}=t,n=k.svg(o),r=D(t,{fill:"black",stroke:"none",fillStyle:"solid"});t.look!=="handDrawn"&&(r.roughness=0);let e=n.circle(0,0,f*2,r),s=o.insert(()=>e,":first-child");return s.attr("class","anchor").attr("style",z(i)),P(t,s),t.intersect=function(c){return Y.info("Circle intersect",t,f,c),$.circle(t,f,c)},o}x(ie,"anchor");function oe(y,t,h,p,a,o,f){let n=(y+h)/2,r=(t+p)/2,e=Math.atan2(p-t,h-y),s=(h-y)/2,c=(p-t)/2,l=s/a,g=c/o,m=Math.sqrt(l**2+g**2);if(m>1)throw new Error("The given radii are too small to create an arc between the points.");let u=Math.sqrt(1-m**2),d=n+u*o*Math.sin(e)*(f?-1:1),b=r-u*a*Math.cos(e)*(f?-1:1),S=Math.atan2((t-b)/o,(y-d)/a),w=Math.atan2((p-b)/o,(h-d)/a)-S;f&&w<0&&(w+=2*Math.PI),!f&&w>0&&(w-=2*Math.PI);let B=[];for(let T=0;T<20;T++){let R=T/19,G=S+R*w,E=d+a*Math.cos(G),j=b+o*Math.sin(G);B.push({x:E,y:j})}return B}x(oe,"generateArcPoints");function Ls(y,t,h){let[p,a]=[t,h].sort((o,f)=>f-o);return a*(1-Math.sqrt(1-(y/p/2)**2))}x(Ls,"calculateArcSagitta");async function ae(y,t){let{labelStyles:h,nodeStyles:p}=v(t);t.labelStyle=h;let a=t.padding??0,o=t.look==="neo"?16:a,f=t.look==="neo"?12:a,i=x(G=>G+f,"calcTotalHeight"),n=x(G=>{let E=G/2;return[E/(2.5+G/50),E]},"calcEllipseRadius"),{shapeSvg:r,bbox:e}=await M(y,t,C(t)),s=i(t?.height?t?.height:e.height),[c,l]=n(s),g=Ls(s,c,l),u=(t?.width?t?.width:e.width)+o*2+g-g,d=s,{cssStyles:b}=t,S=[{x:u/2,y:-d/2},{x:-u/2,y:-d/2},...oe(-u/2,-d/2,-u/2,d/2,c,l,!1),{x:u/2,y:d/2},...oe(u/2,d/2,u/2,-d/2,c,l,!0)],N=k.svg(r),w=D(t,{});t.look!=="handDrawn"&&(w.roughness=0,w.fillStyle="solid");let B=W(S),T=N.path(B,w),R=r.insert(()=>T,":first-child");return R.attr("class","basic label-container outer-path"),b&&t.look!=="handDrawn"&&R.selectAll("path").attr("style",b),p&&t.look!=="handDrawn"&&R.selectAll("path").attr("style",p),R.attr("transform",`translate(${c/2}, 0)`),P(t,R),t.intersect=function(G){return $.polygon(t,S,G)},r}x(ae,"bowTieRect");function st(y,t,h,p){return y.insert("polygon",":first-child").attr("points",p.map(function(a){return a.x+","+a.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-t/2+","+h/2+")")}x(st,"insertPolygonShape");var Et=12;async function ne(y,t){let{labelStyles:h,nodeStyles:p}=v(t);t.labelStyle=h;let a=t.padding??0,o=t.look==="neo"?28:a,f=t.look==="neo"?24:a,{shapeSvg:i,bbox:n}=await M(y,t,C(t)),r=(t?.width??n.width)+(t.look==="neo"?o*2:o+Et),e=(t?.height??n.height)+(t.look==="neo"?f*2:f),s=0,c=r,l=-e,g=0,m=[{x:s+Et,y:l},{x:c,y:l},{x:c,y:g},{x:s,y:g},{x:s,y:l+Et},{x:s+Et,y:l}],u,{cssStyles:d}=t;if(t.look==="handDrawn"){let b=k.svg(i),S=D(t,{}),N=W(m),w=b.path(N,S);u=i.insert(()=>w,":first-child").attr("transform",`translate(${-r/2}, ${e/2})`),d&&u.attr("style",d)}else u=st(i,r,e,m);return p&&u.attr("style",p),P(t,u),t.intersect=function(b){return $.polygon(t,m,b)},i}x(ne,"card");function le(y,t){let{nodeStyles:h}=v(t);t.label="";let p=y.insert("g").attr("class",C(t)).attr("id",t.domId??t.id),{cssStyles:a}=t,o=Math.max(28,t.width??0),f=[{x:0,y:o/2},{x:o/2,y:0},{x:0,y:-o/2},{x:-o/2,y:0}],i=k.svg(p),n=D(t,{});t.look!=="handDrawn"&&(n.roughness=0,n.fillStyle="solid");let r=W(f),e=i.path(r,n),s=p.insert(()=>e,":first-child");return a&&t.look!=="handDrawn"&&s.selectAll("path").attr("style",a),h&&t.look!=="handDrawn"&&s.selectAll("path").attr("style",h),t.width=28,t.height=28,t.intersect=function(c){return $.polygon(t,f,c)},p}x(le,"choice");async function Ht(y,t,h){let{labelStyles:p,nodeStyles:a}=v(t);t.labelStyle=p;let{shapeSvg:o,bbox:f,halfPadding:i}=await M(y,t,C(t)),n=16,r=h?.padding??i,e=t.look==="neo"?f.width/2+n*2:f.width/2+r,s,{cssStyles:c}=t;if(t.look==="handDrawn"){let l=k.svg(o),g=D(t,{}),m=l.circle(0,0,e*2,g);s=o.insert(()=>m,":first-child"),s.attr("class","basic label-container").attr("style",z(c))}else s=o.insert("circle",":first-child").attr("class","basic label-container").attr("style",a).attr("r",e).attr("cx",0).attr("cy",0);return P(t,s),t.calcIntersect=function(l,g){let m=l.width/2;return $.circle(l,m,g)},t.intersect=function(l){return Y.info("Circle intersect",t,e,l),$.circle(t,e,l)},o}x(Ht,"circle");function Vs(y){let t=Math.cos(Math.PI/4),h=Math.sin(Math.PI/4),p=y*2,a={x:p/2*t,y:p/2*h},o={x:-(p/2)*t,y:p/2*h},f={x:-(p/2)*t,y:-(p/2)*h},i={x:p/2*t,y:-(p/2)*h};return`M ${o.x},${o.y} L ${i.x},${i.y}
M ${a.x},${a.y} L ${f.x},${f.y}`}x(Vs,"createLine");function ce(y,t){let{labelStyles:h,nodeStyles:p}=v(t);t.labelStyle=h,t.label="";let a=y.insert("g").attr("class",C(t)).attr("id",t.domId??t.id),o=Math.max(30,t?.width??0),{cssStyles:f}=t,i=k.svg(a),n=D(t,{});t.look!=="handDrawn"&&(n.roughness=0,n.fillStyle="solid");let r=i.circle(0,0,o*2,n),e=Vs(o),s=i.path(e,n),c=a.insert(()=>r,":first-child");return c.insert(()=>s),c.attr("class","outer-path"),f&&t.look!=="handDrawn"&&c.selectAll("path").attr("style",f),p&&t.look!=="handDrawn"&&c.selectAll("path").attr("style",p),P(t,c),t.intersect=function(l){return Y.info("crossedCircle intersect",t,{radius:o,point:l}),$.circle(t,o,l)},a}x(ce,"crossedCircle");function St(y,t,h,p=100,a=0,o=180){let f=[],i=a*Math.PI/180,e=(o*Math.PI/180-i)/(p-1);for(let s=0;s<p;s++){let c=i+s*e,l=y+h*Math.cos(c),g=t+h*Math.sin(c);f.push({x:-l,y:-g})}return f}x(St,"generateCirclePoints");async function he(y,t){let{labelStyles:h,nodeStyles:p}=v(t);t.labelStyle=h;let{shapeSvg:a,bbox:o,label:f}=await M(y,t,C(t)),i=t.look==="neo"?18:t.padding??0,n=t.look==="neo"?12:t.padding??0,r=o.width+i,e=o.height+n,s=Math.max(5,e*.1),{cssStyles:c}=t,l=[...St(r/2,-e/2,s,30,-90,0),{x:-r/2-s,y:s},...St(r/2+s*2,-s,s,20,-180,-270),...St(r/2+s*2,s,s,20,-90,-180),{x:-r/2-s,y:-e/2},...St(r/2,e/2,s,20,0,90)],g=[{x:r/2,y:-e/2-s},{x:-r/2,y:-e/2-s},...St(r/2,-e/2,s,20,-90,0),{x:-r/2-s,y:-s},...St(r/2+r*.1,-s,s,20,-180,-270),...St(r/2+r*.1,s,s,20,-90,-180),{x:-r/2-s,y:e/2},...St(r/2,e/2,s,20,0,90),{x:-r/2,y:e/2+s},{x:r/2,y:e/2+s}],m=k.svg(a),u=D(t,{fill:"none"});t.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");let b=W(l).replace("Z",""),S=m.path(b,u),N=W(g),w=m.path(N,{...u}),B=a.insert("g",":first-child");return B.insert(()=>w,":first-child").attr("stroke-opacity",0),B.insert(()=>S,":first-child"),B.attr("class","text"),c&&t.look!=="handDrawn"&&B.selectAll("path").attr("style",c),p&&t.look!=="handDrawn"&&B.selectAll("path").attr("style",p),B.attr("transform",`translate(${s}, 0)`),f.attr("transform",`translate(${-r/2+s-(o.x-(o.left??0))},${-e/2+(t.padding??0)/2-(o.y-(o.top??0))})`),P(t,B),t.intersect=function(T){return $.polygon(t,g,T)},a}x(he,"curlyBraceLeft");function wt(y,t,h,p=100,a=0,o=180){let f=[],i=a*Math.PI/180,e=(o*Math.PI/180-i)/(p-1);for(let s=0;s<p;s++){let c=i+s*e,l=y+h*Math.cos(c),g=t+h*Math.sin(c);f.push({x:l,y:g})}return f}x(wt,"generateCirclePoints");async function pe(y,t){let{labelStyles:h,nodeStyles:p}=v(t);t.labelStyle=h;let{shapeSvg:a,bbox:o,label:f}=await M(y,t,C(t)),i=t.look==="neo"?18:t.padding??0,n=t.look==="neo"?12:t.padding??0,r=o.width+(t.look==="neo"?i*2:i),e=o.height+(t.look==="neo"?n*2:n),s=Math.max(5,e*.1),{cssStyles:c}=t,l=[...wt(r/2,-e/2,s,20,-90,0),{x:r/2+s,y:-s},...wt(r/2+s*2,-s,s,20,-180,-270),...wt(r/2+s*2,s,s,20,-90,-180),{x:r/2+s,y:e/2},...wt(r/2,e/2,s,20,0,90)],g=[{x:-r/2,y:-e/2-s},{x:r/2,y:-e/2-s},...wt(r/2,-e/2,s,20,-90,0),{x:r/2+s,y:-s},...wt(r/2+s*2,-s,s,20,-180,-270),...wt(r/2+s*2,s,s,20,-90,-180),{x:r/2+s,y:e/2},...wt(r/2,e/2,s,20,0,90),{x:r/2,y:e/2+s},{x:-r/2,y:e/2+s}],m=k.svg(a),u=D(t,{fill:"none"});t.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");let b=W(l).replace("Z",""),S=m.path(b,u),N=W(g),w=m.path(N,{...u}),B=a.insert("g",":first-child");return B.insert(()=>w,":first-child").attr("stroke-opacity",0),B.insert(()=>S,":first-child"),B.attr("class","text"),c&&t.look!=="handDrawn"&&B.selectAll("path").attr("style",c),p&&t.look!=="handDrawn"&&B.selectAll("path").attr("style",p),B.attr("transform",`translate(${-s}, 0)`),f.attr("transform",`translate(${-r/2+(t.padding??0)/2-(o.x-(o.left??0))},${-e/2+(t.padding??0)/2-(o.y-(o.top??0))})`),P(t,B),t.intersect=function(T){return $.polygon(t,g,T)},a}x(pe,"curlyBraceRight");function rt(y,t,h,p=100,a=0,o=180){let f=[],i=a*Math.PI/180,e=(o*Math.PI/180-i)/(p-1);for(let s=0;s<p;s++){let c=i+s*e,l=y+h*Math.cos(c),g=t+h*Math.sin(c);f.push({x:-l,y:-g})}return f}x(rt,"generateCirclePoints");async function me(y,t){let{labelStyles:h,nodeStyles:p}=v(t);t.labelStyle=h;let{shapeSvg:a,bbox:o,label:f}=await M(y,t,C(t)),i=t.look==="neo"?18:t.padding??0,n=t.look==="neo"?12:t.padding??0,r=o.width+(t.look==="neo"?i*2:i),e=o.height+(t.look==="neo"?n*2:n),s=Math.max(5,e*.1),{cssStyles:c}=t,l=[...rt(r/2,-e/2,s,30,-90,0),{x:-r/2-s,y:s},...rt(r/2+s*2,-s,s,20,-180,-270),...rt(r/2+s*2,s,s,20,-90,-180),{x:-r/2-s,y:-e/2},...rt(r/2,e/2,s,20,0,90)],g=[...rt(-r/2+s+s/2,-e/2,s,20,-90,-180),{x:r/2-s/2,y:s},...rt(-r/2-s/2,-s,s,20,0,90),...rt(-r/2-s/2,s,s,20,-90,0),{x:r/2-s/2,y:-s},...rt(-r/2+s+s/2,e/2,s,30,-180,-270)],m=[{x:r/2,y:-e/2-s},{x:-r/2,y:-e/2-s},...rt(r/2,-e/2,s,20,-90,0),{x:-r/2-s,y:-s},...rt(r/2+s*2,-s,s,20,-180,-270),...rt(r/2+s*2,s,s,20,-90,-180),{x:-r/2-s,y:e/2},...rt(r/2,e/2,s,20,0,90),{x:-r/2,y:e/2+s},{x:r/2-s-s/2,y:e/2+s},...rt(-r/2+s+s/2,-e/2,s,20,-90,-180),{x:r/2-s/2,y:s},...rt(-r/2-s/2,-s,s,20,0,90),...rt(-r/2-s/2,s,s,20,-90,0),{x:r/2-s/2,y:-s},...rt(-r/2+s+s/2,e/2,s,30,-180,-270)],u=k.svg(a),d=D(t,{fill:"none"});t.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");let S=W(l).replace("Z",""),N=u.path(S,d),B=W(g).replace("Z",""),T=u.path(B,d),R=W(m),G=u.path(R,{...d}),E=a.insert("g",":first-child");return E.insert(()=>G,":first-child").attr("stroke-opacity",0),E.insert(()=>N,":first-child"),E.insert(()=>T,":first-child"),E.attr("class","text"),c&&t.look!=="handDrawn"&&E.selectAll("path").attr("style",c),p&&t.look!=="handDrawn"&&E.selectAll("path").attr("style",p),E.attr("transform",`translate(${s-s/4}, 0)`),f.attr("transform",`translate(${-r/2+(t.padding??0)/2-(o.x-(o.left??0))},${-e/2+(t.padding??0)/2-(o.y-(o.top??0))})`),P(t,E),t.intersect=function(j){return $.polygon(t,m,j)},a}x(me,"curlyBraces");async function ge(y,t){let{labelStyles:h,nodeStyles:p}=v(t);t.labelStyle=h;let a=t.padding??0,o=t.look==="neo"?16:a,f=t.look==="neo"?12:a,i=20,n=5,{shapeSvg:r,bbox:e}=await M(y,t,C(t)),s=Math.max(i,(e.width+o*2)*1.25,t?.width??0),c=Math.max(n,e.height+f*2,t?.height??0),l=c/2,{cssStyles:g}=t,m=k.svg(r),u=D(t,{});t.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");let d=s,b=c,S=d-l,N=b/4,w=[{x:S,y:0},{x:N,y:0},{x:0,y:b/2},{x:N,y:b},{x:S,y:b},...kt(-S,-b/2,l,50,270,90)],B=W(w),T=m.path(B,u),R=r.insert(()=>T,":first-child");return R.attr("class","basic label-container outer-path"),g&&t.look!=="handDrawn"&&R.selectChildren("path").attr("style",g),p&&t.look!=="handDrawn"&&R.selectChildren("path").attr("style",p),R.attr("transform",`translate(${-s/2}, ${-c/2})`),P(t,R),t.intersect=function(G){return $.polygon(t,w,G)},r}x(ge,"curvedTrapezoid");var Is=x((y,t,h,p,a,o)=>[`M${y},${t+o}`,`a${a},${o} 0,0,0 ${h},0`,`a${a},${o} 0,0,0 ${-h},0`,`l0,${p}`,`a${a},${o} 0,0,0 ${h},0`,`l0,${-p}`].join(" "),"createCylinderPathD"),Ws=x((y,t,h,p,a,o)=>[`M${y},${t+o}`,`M${y+h},${t+o}`,`a${a},${o} 0,0,0 ${-h},0`,`l0,${p}`,`a${a},${o} 0,0,0 ${h},0`,`l0,${-p}`].join(" "),"createOuterCylinderPathD"),Xs=x((y,t,h,p,a,o)=>[`M${y-h/2},${-p/2}`,`a${a},${o} 0,0,0 ${h},0`].join(" "),"createInnerCylinderPathD"),fe=8,de=8;async function ye(y,t){let{labelStyles:h,nodeStyles:p}=v(t);t.labelStyle=h;let a=t.padding??0,o=t.look==="neo"?24:a,f=t.look==="neo"?24:a;if(t.width||t.height){let u=t.width??0;t.width=(t.width??0)-f,t.width<de&&(t.width=de);let b=u/2/(2.5+u/50);t.height=(t.height??0)-o-b*3,t.height<fe&&(t.height=fe)}let{shapeSvg:i,bbox:n,label:r}=await M(y,t,C(t)),e=(t.width?t.width:n.width)+f,s=e/2,c=s/(2.5+e/50),l=(t.height?t.height:n.height)+o+c,g,{cssStyles:m}=t;if(t.look==="handDrawn"){let u=k.svg(i),d=Ws(0,0,e,l,s,c),b=Xs(0,c,e,l,s,c),S=D(t,{}),N=u.path(d,S),w=u.path(b,D(t,{fill:"none"}));g=i.insert(()=>w,":first-child"),g=i.insert(()=>N,":first-child"),g.attr("class","basic label-container"),m&&g.attr("style",m)}else{let u=Is(0,0,e,l,s,c);g=i.insert("path",":first-child").attr("d",u).attr("class","basic label-container outer-path").attr("style",z(m)).attr("style",p)}return g.attr("label-offset-y",c),g.attr("transform",`translate(${-e/2}, ${-(l/2+c)})`),P(t,g),r.attr("transform",`translate(${-(n.width/2)-(n.x-(n.left??0))}, ${-(n.height/2)+(t.padding??0)/1.5-(n.y-(n.top??0))})`),t.intersect=function(u){let d=$.rect(t,u),b=d.x-(t.x??0);if(s!=0&&(Math.abs(b)<(t.width??0)/2||Math.abs(b)==(t.width??0)/2&&Math.abs(d.y-(t.y??0))>(t.height??0)/2-c)){let S=c*c*(1-b*b/(s*s));S>0&&(S=Math.sqrt(S)),S=c-S,u.y-(t.y??0)>0&&(S=-S),d.y+=S}return d},i}x(ye,"cylinder");async function ht(y,t,h){let{labelStyles:p,nodeStyles:a}=v(t);t.labelStyle=p;let{shapeSvg:o,bbox:f}=await M(y,t,C(t)),i=Math.max(f.width+h.labelPaddingX*2,t?.width||0),n=Math.max(f.height+h.labelPaddingY*2,t?.height||0),r=-i/2,e=-n/2,s,{rx:c,ry:l}=t,{cssStyles:g}=t;if(h?.rx&&h.ry&&(c=h.rx,l=h.ry),t.look==="handDrawn"){let m=k.svg(o),u=D(t,{}),d=c||l?m.path(it(r,e,i,n,c||0),u):m.rectangle(r,e,i,n,u);s=o.insert(()=>d,":first-child"),s.attr("class","basic label-container").attr("style",z(g))}else s=o.insert("rect",":first-child"),s.attr("class","basic label-container").attr("style",a).attr("rx",z(c)).attr("ry",z(l)).attr("x",r).attr("y",e).attr("width",i).attr("height",n);return P(t,s),t.calcIntersect=function(m,u){return $.rect(m,u)},t.intersect=function(m){return $.rect(t,m)},o}x(ht,"drawRect");async function ue(y,t){let{cssClasses:h,labelPaddingX:p,labelPaddingY:a,padding:o,width:f,height:i}=t,n={rx:0,ry:0,classes:h??"",labelPaddingX:p??(o??0)*2,labelPaddingY:a??o??0},r=await ht(y,t,n);if(t.look==="handDrawn"){let l=k.svg(r),g=D(t,{}),m=r.select(".basic.label-container > path:nth-child(2)"),u=m.node();if(!u)return r;let d=null;if(u instanceof SVGGraphicsElement)d=u.getBBox();else return r;return r.insert(()=>l.line(d.x,d.y,d.x+d.width,d.y,g),".basic.label-container g.label"),r.insert(()=>l.line(d.x,d.y+d.height,d.x+d.width,d.y+d.height,g),".basic.label-container g.label"),m.remove(),r}let e=r.select(".basic.label-container"),s=(Number(e.attr("width"))||f)??0,c=(Number(e.attr("height"))||i)??0;return s>0&&c>0&&e.attr("stroke-dasharray",`${s} ${c}`),r}x(ue,"datastore");async function xe(y,t){let{labelStyles:h,nodeStyles:p}=v(t);t.labelStyle=h;let a=t.look==="neo"?16:t.padding??0,o=t.look==="neo"?16:t.padding??0,{shapeSvg:f,bbox:i,label:n}=await M(y,t,C(t)),r=i.width+a,e=i.height+o,s=e*.2,c=-r/2,l=-e/2-s/2,{cssStyles:g}=t,m=k.svg(f),u=D(t,{});t.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");let d=[{x:c,y:l+s},{x:-c,y:l+s},{x:-c,y:-l},{x:c,y:-l},{x:c,y:l},{x:-c,y:l},{x:-c,y:l+s}],b=m.polygon(d.map(N=>[N.x,N.y]),u),S=f.insert(()=>b,":first-child");return S.attr("class","basic label-container outer-path"),g&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",g),p&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",p),n.attr("transform",`translate(${c+(t.padding??0)/2-(i.x-(i.left??0))}, ${l+s+(t.padding??0)/2-(i.y-(i.top??0))})`),P(t,S),t.intersect=function(N){return $.rect(t,N)},f}x(xe,"dividedRectangle");async function be(y,t){let{labelStyles:h,nodeStyles:p}=v(t),a=t.look==="neo"?12:5;t.labelStyle=h;let o=t.padding??0,f=t.look==="neo"?16:o,{shapeSvg:i,bbox:n}=await M(y,t,C(t)),r=(t?.width?t?.width/2:n.width/2)+(f??0),e=r-a,s,{cssStyles:c}=t;if(t.look==="handDrawn"){let l=k.svg(i),g=D(t,{roughness:.2,strokeWidth:2.5}),m=D(t,{roughness:.2,strokeWidth:1.5}),u=l.circle(0,0,r*2,g),d=l.circle(0,0,e*2,m);s=i.insert("g",":first-child"),s.attr("class",z(t.cssClasses)).attr("style",z(c)),s.node()?.appendChild(u),s.node()?.appendChild(d)}else{s=i.insert("g",":first-child");let l=s.insert("circle",":first-child"),g=s.insert("circle");s.attr("class","basic label-container").attr("style",p),l.attr("class","outer-circle").attr("style",p).attr("r",r).attr("cx",0).attr("cy",0),g.attr("class","inner-circle").attr("style",p).attr("r",e).attr("cx",0).attr("cy",0)}return P(t,s),t.intersect=function(l){return Y.info("DoubleCircle intersect",t,r,l),$.circle(t,r,l)},i}x(be,"doublecircle");function Se(y,t,{config:{themeVariables:h}}){let{labelStyles:p,nodeStyles:a}=v(t);t.label="",t.labelStyle=p;let o=y.insert("g").attr("class",C(t)).attr("id",t.domId??t.id),f=7,{cssStyles:i}=t,n=k.svg(o),{nodeBorder:r}=h,e=D(t,{fillStyle:"solid"});t.look!=="handDrawn"&&(e.roughness=0);let s=n.circle(0,0,f*2,e),c=o.insert(()=>s,":first-child");return c.selectAll("path").attr("style",`fill: ${r} !important;`),i&&i.length>0&&t.look!=="handDrawn"&&c.selectAll("path").attr("style",i),a&&t.look!=="handDrawn"&&c.selectAll("path").attr("style",a),P(t,c),t.intersect=function(l){return Y.info("filledCircle intersect",t,{radius:f,point:l}),$.circle(t,f,l)},o}x(Se,"filledCircle");var we=10,Ne=10;async function $e(y,t){let{labelStyles:h,nodeStyles:p}=v(t);t.labelStyle=h;let a=t.padding??0,o=t.look==="neo"?a*2:a;(t.width||t.height)&&(t.height=t?.height??0,t.height<we&&(t.height=we),t.width=(t?.width??0)-o-o/2,t.width<Ne&&(t.width=Ne));let{shapeSvg:f,bbox:i,label:n}=await M(y,t,C(t)),r=(t?.width?t?.width:i.width)+(o??0),e=t?.height?t?.height:r+i.height,s=e,c=[{x:0,y:-e},{x:s,y:-e},{x:s/2,y:0}],{cssStyles:l}=t,g=k.svg(f),m=D(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");let u=W(c),d=g.path(u,m),b=f.insert(()=>d,":first-child").attr("transform",`translate(${-e/2}, ${e/2})`).attr("class","outer-path");return l&&t.look!=="handDrawn"&&b.selectChildren("path").attr("style",l),p&&t.look!=="handDrawn"&&b.selectChildren("path").attr("style",p),t.width=r,t.height=e,P(t,b),n.attr("transform",`translate(${-i.width/2-(i.x-(i.left??0))}, ${-e/2+(t.padding??0)/2+(i.y-(i.top??0))})`),t.intersect=function(S){return Y.info("Triangle intersect",t,c,S),$.polygon(t,c,S)},f}x($e,"flippedTriangle");function De(y,t,{dir:h,config:{state:p,themeVariables:a}}){let{nodeStyles:o}=v(t);t.label="";let f=y.insert("g").attr("class",C(t)).attr("id",t.domId??t.id),{cssStyles:i}=t,n=Math.max(70,t?.width??0),r=Math.max(10,t?.height??0);h==="LR"&&(n=Math.max(10,t?.width??0),r=Math.max(70,t?.height??0));let e=-1*n/2,s=-1*r/2,c=k.svg(f),l=D(t,{stroke:a.lineColor,fill:a.lineColor});t.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");let g=c.rectangle(e,s,n,r,l),m=f.insert(()=>g,":first-child");i&&t.look!=="handDrawn"&&m.selectAll("path").attr("style",i),o&&t.look!=="handDrawn"&&m.selectAll("path").attr("style",o),P(t,m);let u=p?.padding??0;return t.width&&t.height&&(t.width+=u/2||0,t.height+=u/2||0),t.intersect=function(d){return $.rect(t,d)},f}x(De,"forkJoin");async function ke(y,t){let{labelStyles:h,nodeStyles:p}=v(t);t.labelStyle=h;let a=15,o=10,f=t.look==="neo"?16:t.padding??0,i=t.look==="neo"?12:t.padding??0;(t.width||t.height)&&(t.height=(t?.height??0)-i*2,t.height<o&&(t.height=o),t.width=(t?.width??0)-f*2,t.width<a&&(t.width=a));let{shapeSvg:n,bbox:r}=await M(y,t,C(t)),e=(t?.width?t?.width:Math.max(a,r.width))+f*2,s=(t?.height?t?.height:Math.max(o,r.height))+i*2,c=s/2,{cssStyles:l}=t,g=k.svg(n),m=D(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");let u=[{x:-e/2,y:-s/2},{x:e/2-c,y:-s/2},...kt(-e/2+c,0,c,50,90,270),{x:e/2-c,y:s/2},{x:-e/2,y:s/2}],d=W(u),b=g.path(d,m),S=n.insert(()=>b,":first-child");return S.attr("class","basic label-container outer-path"),l&&t.look!=="handDrawn"&&S.selectChildren("path").attr("style",l),p&&t.look!=="handDrawn"&&S.selectChildren("path").attr("style",p),P(t,S),t.intersect=function(N){return Y.info("Pill intersect",t,{radius:c,point:N}),$.polygon(t,u,N)},n}x(ke,"halfRoundedRectangle");var Ys=x((y,t,h,p,a)=>[`M${y+a},${t}`,`L${y+h-a},${t}`,`L${y+h},${t-p/2}`,`L${y+h-a},${t-p}`,`L${y+a},${t-p}`,`L${y},${t-p/2}`,"Z"].join(" "),"createHexagonPathD");async function ve(y,t){let{labelStyles:h,nodeStyles:p}=v(t),a=t.look==="neo"?3.5:4;t.labelStyle=h;let o=t.padding??0,f=70,i=32,n=t.look==="neo"?f:o,r=t.look==="neo"?i:o;if(t.width||t.height){let S=(t.height??0)/a;t.width=(t?.width??0)-2*S-r,t.height=(t.height??0)-n}let{shapeSvg:e,bbox:s}=await M(y,t,C(t)),c=(t?.height?t?.height:s.height)+n,l=c/a,g=(t?.width?t?.width:s.width)+2*l+r,m=[{x:l,y:0},{x:g-l,y:0},{x:g,y:-c/2},{x:g-l,y:-c},{x:l,y:-c},{x:0,y:-c/2}],u,{cssStyles:d}=t;if(t.look==="handDrawn"){let b=k.svg(e),S=D(t,{}),N=Ys(0,0,g,c,l),w=b.path(N,S);u=e.insert(()=>w,":first-child").attr("transform",`translate(${-g/2}, ${c/2})`),d&&u.attr("style",d)}else u=st(e,g,c,m);return p&&u.attr("style",p),t.width=g,t.height=c,P(t,u),t.intersect=function(b){return $.polygon(t,m,b)},e}x(ve,"hexagon");async function Pe(y,t){let{labelStyles:h,nodeStyles:p}=v(t);t.label="",t.labelStyle=h;let{shapeSvg:a}=await M(y,t,C(t)),o=Math.max(30,t?.width??0),f=Math.max(30,t?.height??0),{cssStyles:i}=t,n=k.svg(a),r=D(t,{});t.look!=="handDrawn"&&(r.roughness=0,r.fillStyle="solid");let e=[{x:0,y:0},{x:o,y:0},{x:0,y:f},{x:o,y:f}],s=W(e),c=n.path(s,r),l=a.insert(()=>c,":first-child");return l.attr("class","basic label-container outer-path"),i&&t.look!=="handDrawn"&&l.selectChildren("path").attr("style",i),p&&t.look!=="handDrawn"&&l.selectChildren("path").attr("style",p),l.attr("transform",`translate(${-o/2}, ${-f/2})`),P(t,l),t.intersect=function(g){return Y.info("Pill intersect",t,{points:e}),$.polygon(t,e,g)},a}x(Pe,"hourglass");async function Be(y,t,{config:{themeVariables:h,flowchart:p}}){let{labelStyles:a}=v(t);t.labelStyle=a;let o=t.assetHeight??48,f=t.assetWidth??48,i=Math.max(o,f),n=p?.wrappingWidth;t.width=Math.max(i,n??0);let{shapeSvg:r,bbox:e,label:s}=await M(y,t,"icon-shape default"),c=t.pos==="t",l=i,g=i,{nodeBorder:m}=h,{stylesMap:u}=bt(t),d=-g/2,b=-l/2,S=t.label?8:0,N=k.svg(r),w=D(t,{stroke:"none",fill:"none"});t.look!=="handDrawn"&&(w.roughness=0,w.fillStyle="solid");let B=N.rectangle(d,b,g,l,w),T=Math.max(g,e.width),R=l+e.height+S,G=N.rectangle(-T/2,-R/2,T,R,{...w,fill:"transparent",stroke:"none"}),E=r.insert(()=>B,":first-child"),j=r.insert(()=>G);if(t.icon){let I=r.append("g");I.html(`<g>${await xt(t.icon,{height:i,width:i,fallbackPrefix:""})}</g>`);let H=I.node().getBBox(),A=H.width,O=H.height,L=H.x,V=H.y;I.attr("transform",`translate(${-A/2-L},${c?e.height/2+S/2-O/2-V:-e.height/2-S/2-O/2-V})`),I.attr("style",`color: ${u.get("stroke")??m};`)}return s.attr("transform",`translate(${-e.width/2-(e.x-(e.left??0))},${c?-R/2:R/2-e.height})`),E.attr("transform",`translate(0,${c?e.height/2+S/2:-e.height/2-S/2})`),P(t,j),t.intersect=function(I){if(Y.info("iconSquare intersect",t,I),!t.label)return $.rect(t,I);let H=t.x??0,A=t.y??0,O=t.height??0,L=[];return c?L=[{x:H-e.width/2,y:A-O/2},{x:H+e.width/2,y:A-O/2},{x:H+e.width/2,y:A-O/2+e.height+S},{x:H+g/2,y:A-O/2+e.height+S},{x:H+g/2,y:A+O/2},{x:H-g/2,y:A+O/2},{x:H-g/2,y:A-O/2+e.height+S},{x:H-e.width/2,y:A-O/2+e.height+S}]:L=[{x:H-g/2,y:A-O/2},{x:H+g/2,y:A-O/2},{x:H+g/2,y:A-O/2+l},{x:H+e.width/2,y:A-O/2+l},{x:H+e.width/2/2,y:A+O/2},{x:H-e.width/2,y:A+O/2},{x:H-e.width/2,y:A-O/2+l},{x:H-g/2,y:A-O/2+l}],$.polygon(t,L,I)},r}x(Be,"icon");async function Te(y,t,{config:{themeVariables:h,flowchart:p}}){let{labelStyles:a}=v(t);t.labelStyle=a;let o=t.assetHeight??48,f=t.assetWidth??48,i=Math.max(o,f),n=p?.wrappingWidth;t.width=Math.max(i,n??0);let{shapeSvg:r,bbox:e,label:s}=await M(y,t,"icon-shape default"),c=20,l=t.label?8:0,g=t.pos==="t",{nodeBorder:m,mainBkg:u}=h,{stylesMap:d}=bt(t),b=k.svg(r),S=D(t,{});t.look!=="handDrawn"&&(S.roughness=0,S.fillStyle="solid");let N=d.get("fill");S.stroke=N??u;let w=r.append("g");t.icon&&w.html(`<g>${await xt(t.icon,{height:i,width:i,fallbackPrefix:""})}</g>`);let B=w.node().getBBox(),T=B.width,R=B.height,G=B.x,E=B.y,j=Math.max(T,R)*Math.SQRT2+c*2,I=b.circle(0,0,j,S),H=Math.max(j,e.width),A=j+e.height+l,O=b.rectangle(-H/2,-A/2,H,A,{...S,fill:"transparent",stroke:"none"}),L=r.insert(()=>I,":first-child"),V=r.insert(()=>O);return w.attr("transform",`translate(${-T/2-G},${g?e.height/2+l/2-R/2-E:-e.height/2-l/2-R/2-E})`),w.attr("style",`color: ${d.get("stroke")??m};`),s.attr("transform",`translate(${-e.width/2-(e.x-(e.left??0))},${g?-A/2:A/2-e.height})`),L.attr("transform",`translate(0,${g?e.height/2+l/2:-e.height/2-l/2})`),P(t,V),t.intersect=function(X){return Y.info("iconSquare intersect",t,X),$.rect(t,X)},r}x(Te,"iconCircle");async function Ce(y,t,{config:{themeVariables:h,flowchart:p}}){let{labelStyles:a}=v(t);t.labelStyle=a;let o=t.assetHeight??48,f=t.assetWidth??48,i=Math.max(o,f),n=p?.wrappingWidth;t.width=Math.max(i,n??0);let{shapeSvg:r,bbox:e,halfPadding:s,label:c}=await M(y,t,"icon-shape default"),l=t.pos==="t",g=i+s*2,m=i+s*2,{nodeBorder:u,mainBkg:d}=h,{stylesMap:b}=bt(t),S=-m/2,N=-g/2,w=t.label?8:0,B=k.svg(r),T=D(t,{});t.look!=="handDrawn"&&(T.roughness=0,T.fillStyle="solid");let R=b.get("fill");T.stroke=R??d;let G=B.path(it(S,N,m,g,5),T),E=Math.max(m,e.width),j=g+e.height+w,I=B.rectangle(-E/2,-j/2,E,j,{...T,fill:"transparent",stroke:"none"}),H=r.insert(()=>G,":first-child").attr("class","icon-shape2"),A=r.insert(()=>I);if(t.icon){let O=r.append("g");O.html(`<g>${await xt(t.icon,{height:i,width:i,fallbackPrefix:""})}</g>`);let L=O.node().getBBox(),V=L.width,X=L.height,_=L.x,q=L.y;O.attr("transform",`translate(${-V/2-_},${l?e.height/2+w/2-X/2-q:-e.height/2-w/2-X/2-q})`),O.attr("style",`color: ${b.get("stroke")??u};`)}return c.attr("transform",`translate(${-e.width/2-(e.x-(e.left??0))},${l?-j/2:j/2-e.height})`),H.attr("transform",`translate(0,${l?e.height/2+w/2:-e.height/2-w/2})`),P(t,A),t.intersect=function(O){if(Y.info("iconSquare intersect",t,O),!t.label)return $.rect(t,O);let L=t.x??0,V=t.y??0,X=t.height??0,_=[];return l?_=[{x:L-e.width/2,y:V-X/2},{x:L+e.width/2,y:V-X/2},{x:L+e.width/2,y:V-X/2+e.height+w},{x:L+m/2,y:V-X/2+e.height+w},{x:L+m/2,y:V+X/2},{x:L-m/2,y:V+X/2},{x:L-m/2,y:V-X/2+e.height+w},{x:L-e.width/2,y:V-X/2+e.height+w}]:_=[{x:L-m/2,y:V-X/2},{x:L+m/2,y:V-X/2},{x:L+m/2,y:V-X/2+g},{x:L+e.width/2,y:V-X/2+g},{x:L+e.width/2/2,y:V+X/2},{x:L-e.width/2,y:V+X/2},{x:L-e.width/2,y:V-X/2+g},{x:L-m/2,y:V-X/2+g}],$.polygon(t,_,O)},r}x(Ce,"iconRounded");async function Re(y,t,{config:{themeVariables:h,flowchart:p}}){let{labelStyles:a}=v(t);t.labelStyle=a;let o=t.assetHeight??48,f=t.assetWidth??48,i=Math.max(o,f),n=p?.wrappingWidth;t.width=Math.max(i,n??0);let{shapeSvg:r,bbox:e,halfPadding:s,label:c}=await M(y,t,"icon-shape default"),l=t.pos==="t",g=i+s*2,m=i+s*2,{nodeBorder:u,mainBkg:d}=h,{stylesMap:b}=bt(t),S=-m/2,N=-g/2,w=t.label?8:0,B=k.svg(r),T=D(t,{});t.look!=="handDrawn"&&(T.roughness=0,T.fillStyle="solid");let R=b.get("fill");T.stroke=R??d;let G=B.path(it(S,N,m,g,.1),T),E=Math.max(m,e.width),j=g+e.height+w,I=B.rectangle(-E/2,-j/2,E,j,{...T,fill:"transparent",stroke:"none"}),H=r.insert(()=>G,":first-child"),A=r.insert(()=>I);if(t.icon){let O=r.append("g");O.html(`<g>${await xt(t.icon,{height:i,width:i,fallbackPrefix:""})}</g>`);let L=O.node().getBBox(),V=L.width,X=L.height,_=L.x,q=L.y;O.attr("transform",`translate(${-V/2-_},${l?e.height/2+w/2-X/2-q:-e.height/2-w/2-X/2-q})`),O.attr("style",`color: ${b.get("stroke")??u};`)}return c.attr("transform",`translate(${-e.width/2-(e.x-(e.left??0))},${l?-j/2:j/2-e.height})`),H.attr("transform",`translate(0,${l?e.height/2+w/2:-e.height/2-w/2})`),P(t,A),t.intersect=function(O){if(Y.info("iconSquare intersect",t,O),!t.label)return $.rect(t,O);let L=t.x??0,V=t.y??0,X=t.height??0,_=[];return l?_=[{x:L-e.width/2,y:V-X/2},{x:L+e.width/2,y:V-X/2},{x:L+e.width/2,y:V-X/2+e.height+w},{x:L+m/2,y:V-X/2+e.height+w},{x:L+m/2,y:V+X/2},{x:L-m/2,y:V+X/2},{x:L-m/2,y:V-X/2+e.height+w},{x:L-e.width/2,y:V-X/2+e.height+w}]:_=[{x:L-m/2,y:V-X/2},{x:L+m/2,y:V-X/2},{x:L+m/2,y:V-X/2+g},{x:L+e.width/2,y:V-X/2+g},{x:L+e.width/2/2,y:V+X/2},{x:L-e.width/2,y:V+X/2},{x:L-e.width/2,y:V-X/2+g},{x:L-m/2,y:V-X/2+g}],$.polygon(t,_,O)},r}x(Re,"iconSquare");async function Me(y,t,{config:{flowchart:h}}){let p=new Image;p.src=t?.img??"",await p.decode();let a=Number(p.naturalWidth.toString().replace("px","")),o=Number(p.naturalHeight.toString().replace("px",""));t.imageAspectRatio=a/o;let{labelStyles:f}=v(t);t.labelStyle=f;let i=h?.wrappingWidth;t.defaultWidth=h?.wrappingWidth;let n=Math.max(t.label?i??0:0,t?.assetWidth??a),r=t.constraint==="on"&&t?.assetHeight?t.assetHeight*t.imageAspectRatio:n,e=t.constraint==="on"?r/t.imageAspectRatio:t?.assetHeight??o;t.width=Math.max(r,i??0);let{shapeSvg:s,bbox:c,label:l}=await M(y,t,"image-shape default"),g=t.pos==="t",m=-r/2,u=-e/2,d=t.label?8:0,b=k.svg(s),S=D(t,{});t.look!=="handDrawn"&&(S.roughness=0,S.fillStyle="solid");let N=b.rectangle(m,u,r,e,S),w=Math.max(r,c.width),B=e+c.height+d,T=b.rectangle(-w/2,-B/2,w,B,{...S,fill:"none",stroke:"none"}),R=s.insert(()=>N,":first-child"),G=s.insert(()=>T);if(t.img){let E=s.append("image");E.attr("href",t.img),E.attr("width",r),E.attr("height",e),E.attr("preserveAspectRatio","none"),E.attr("transform",`translate(${-r/2},${g?B/2-e:-B/2})`)}return l.attr("transform",`translate(${-c.width/2-(c.x-(c.left??0))},${g?-e/2-c.height/2-d/2:e/2-c.height/2+d/2})`),R.attr("transform",`translate(0,${g?c.height/2+d/2:-c.height/2-d/2})`),P(t,G),t.intersect=function(E){if(Y.info("iconSquare intersect",t,E),!t.label)return $.rect(t,E);let j=t.x??0,I=t.y??0,H=t.height??0,A=[];return g?A=[{x:j-c.width/2,y:I-H/2},{x:j+c.width/2,y:I-H/2},{x:j+c.width/2,y:I-H/2+c.height+d},{x:j+r/2,y:I-H/2+c.height+d},{x:j+r/2,y:I+H/2},{x:j-r/2,y:I+H/2},{x:j-r/2,y:I-H/2+c.height+d},{x:j-c.width/2,y:I-H/2+c.height+d}]:A=[{x:j-r/2,y:I-H/2},{x:j+r/2,y:I-H/2},{x:j+r/2,y:I-H/2+e},{x:j+c.width/2,y:I-H/2+e},{x:j+c.width/2/2,y:I+H/2},{x:j-c.width/2,y:I+H/2},{x:j-c.width/2,y:I-H/2+e},{x:j-r/2,y:I-H/2+e}],$.polygon(t,A,E)},s}x(Me,"imageSquare");async function Ge(y,t){let{labelStyles:h,nodeStyles:p}=v(t);t.labelStyle=h;let a=t.padding??0,o=a,f=t.look==="neo"?a*2:a,{shapeSvg:i,bbox:n}=await M(y,t,C(t)),r=Math.max(n.width+(f??0)*2,t?.width??0),e=Math.max(n.height+(o??0)*2,t?.height??0),s=[{x:0,y:0},{x:r,y:0},{x:r+3*e/6,y:-e},{x:-3*e/6,y:-e}],c,{cssStyles:l}=t;if(t.look==="handDrawn"){let g=k.svg(i),m=D(t,{}),u=W(s),d=g.path(u,m);c=i.insert(()=>d,":first-child").attr("transform",`translate(${-r/2}, ${e/2})`),l&&c.attr("style",l)}else c=st(i,r,e,s);return p&&c.attr("style",p),t.width=r,t.height=e,P(t,c),t.intersect=function(g){return $.polygon(t,s,g)},i}x(Ge,"inv_trapezoid");async function Ee(y,t){let{shapeSvg:h,bbox:p,label:a}=await M(y,t,"label"),o=h.insert("rect",":first-child");return o.attr("width",.1).attr("height",.1),h.attr("class","label edgeLabel"),a.attr("transform",`translate(${-(p.width/2)-(p.x-(p.left??0))}, ${-(p.height/2)-(p.y-(p.top??0))})`),P(t,o),t.intersect=function(n){return $.rect(t,n)},h}x(Ee,"labelRect");async function He(y,t){let{labelStyles:h,nodeStyles:p}=v(t);t.labelStyle=h;let a=t.padding??0,o=a,f=t.look==="neo"?a*2:a,{shapeSvg:i,bbox:n}=await M(y,t,C(t)),r=(t?.height??n.height)+o,e=(t?.width??n.width)+f,s=[{x:0,y:0},{x:e+3*r/6,y:0},{x:e,y:-r},{x:-(3*r)/6,y:-r}],c,{cssStyles:l}=t;if(t.look==="handDrawn"){let g=k.svg(i),m=D(t,{}),u=W(s),d=g.path(u,m);c=i.insert(()=>d,":first-child").attr("transform",`translate(${-e/2}, ${r/2})`),l&&c.attr("style",l)}else c=st(i,e,r,s);return p&&c.attr("style",p),t.width=e,t.height=r,P(t,c),t.intersect=function(g){return $.polygon(t,s,g)},i}x(He,"lean_left");async function je(y,t){let{labelStyles:h,nodeStyles:p}=v(t);t.labelStyle=h;let a=t.padding??0,o=a,f=t.look==="neo"?a*2:a,{shapeSvg:i,bbox:n}=await M(y,t,C(t)),r=(t?.height??n.height)+o,e=(t?.width??n.width)+f,s=[{x:-3*r/6,y:0},{x:e,y:0},{x:e+3*r/6,y:-r},{x:0,y:-r}],c,{cssStyles:l}=t;if(t.look==="handDrawn"){let g=k.svg(i),m=D(t,{}),u=W(s),d=g.path(u,m);c=i.insert(()=>d,":first-child").attr("transform",`translate(${-e/2}, ${r/2})`),l&&c.attr("style",l)}else c=st(i,e,r,s);return p&&c.attr("style",p),t.width=e,t.height=r,P(t,c),t.intersect=function(g){return $.polygon(t,s,g)},i}x(je,"lean_right");function Ae(y,t){let{labelStyles:h,nodeStyles:p}=v(t);t.label="",t.labelStyle=h;let a=y.insert("g").attr("class",C(t)).attr("id",t.domId??t.id),{cssStyles:o}=t,f=Math.max(35,t?.width??0),i=Math.max(35,t?.height??0),n=7,r=[{x:f,y:0},{x:0,y:i+n/2},{x:f-2*n,y:i+n/2},{x:0,y:2*i},{x:f,y:i-n/2},{x:2*n,y:i-n/2}],e=k.svg(a),s=D(t,{});t.look!=="handDrawn"&&(s.roughness=0,s.fillStyle="solid");let c=W(r),l=e.path(c,s),g=a.insert(()=>l,":first-child");return g.attr("class","outer-path"),o&&t.look!=="handDrawn"&&g.selectAll("path").attr("style",o),p&&t.look!=="handDrawn"&&g.selectAll("path").attr("style",p),g.attr("transform",`translate(-${f/2},${-i})`),P(t,g),t.intersect=function(m){return Y.info("lightningBolt intersect",t,m),$.polygon(t,r,m)},a}x(Ae,"lightningBolt");var Fs=x((y,t,h,p,a,o,f)=>[`M${y},${t+o}`,`a${a},${o} 0,0,0 ${h},0`,`a${a},${o} 0,0,0 ${-h},0`,`l0,${p}`,`a${a},${o} 0,0,0 ${h},0`,`l0,${-p}`,`M${y},${t+o+f}`,`a${a},${o} 0,0,0 ${h},0`].join(" "),"createCylinderPathD"),_s=x((y,t,h,p,a,o,f)=>[`M${y},${t+o}`,`M${y+h},${t+o}`,`a${a},${o} 0,0,0 ${-h},0`,`l0,${p}`,`a${a},${o} 0,0,0 ${h},0`,`l0,${-p}`,`M${y},${t+o+f}`,`a${a},${o} 0,0,0 ${h},0`].join(" "),"createOuterCylinderPathD"),qs=x((y,t,h,p,a,o)=>[`M${y-h/2},${-p/2}`,`a${a},${o} 0,0,0 ${h},0`].join(" "),"createInnerCylinderPathD"),Oe=10,Le=10;async function Ve(y,t){let{labelStyles:h,nodeStyles:p}=v(t);t.labelStyle=h;let a=t.padding??0,o=t.look==="neo"?16:a,f=t.look==="neo"?24:a;if(t.width||t.height){let d=t.width??0;t.width=(t.width??0)-o,t.width<Le&&(t.width=Le);let S=d/2/(2.5+d/50);t.height=(t.height??0)-f-S*3,t.height<Oe&&(t.height=Oe)}let{shapeSvg:i,bbox:n,label:r}=await M(y,t,C(t)),e=(t?.width?t?.width:n.width)+o*2,s=e/2,c=s/(2.5+e/50),l=(t?.height?t?.height:n.height)+c+f*2,g=l*.1,m,{cssStyles:u}=t;if(t.look==="handDrawn"){let d=k.svg(i),b=_s(0,0,e,l,s,c,g),S=qs(0,c,e,l,s,c),N=D(t,{}),w=d.path(b,N),B=d.path(S,N);i.insert(()=>B,":first-child").attr("class","line"),m=i.insert(()=>w,":first-child"),m.attr("class","basic label-container"),u&&m.attr("style",u)}else{let d=Fs(0,0,e,l,s,c,g);m=i.insert("path",":first-child").attr("d",d).attr("class","basic label-container outer-path").attr("style",z(u)).attr("style",p)}return m.attr("label-offset-y",c),m.attr("transform",`translate(${-e/2}, ${-(l/2+c)})`),P(t,m),r.attr("transform",`translate(${-(n.width/2)-(n.x-(n.left??0))}, ${-(n.height/2)+c-(n.y-(n.top??0))})`),t.intersect=function(d){let b=$.rect(t,d),S=b.x-(t.x??0);if(s!=0&&(Math.abs(S)<(t.width??0)/2||Math.abs(S)==(t.width??0)/2&&Math.abs(b.y-(t.y??0))>(t.height??0)/2-c)){let N=c*c*(1-S*S/(s*s));N>0&&(N=Math.sqrt(N)),N=c-N,d.y-(t.y??0)>0&&(N=-N),b.y+=N}return b},i}x(Ve,"linedCylinder");async function Ie(y,t){let{labelStyles:h,nodeStyles:p}=v(t);t.labelStyle=h;let a=t.padding??0,o=t.look==="neo"?16:a,f=t.look==="neo"?12:a;if(t.width||t.height){let N=t.width;t.width=(N??0)*10/11-o*2,t.width<10&&(t.width=10),t.height=(t?.height??0)-f*2,t.height<10&&(t.height=10)}let{shapeSvg:i,bbox:n,label:r}=await M(y,t,C(t)),e=(t?.width?t?.width:n.width)+(o??0)*2,s=(t?.height?t?.height:n.height)+(f??0)*2,c=t.look==="neo"?s/4:s/8,l=s+c,{cssStyles:g}=t,m=k.svg(i),u=D(t,{});t.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");let d=[{x:-e/2-e/2*.1,y:-l/2},{x:-e/2-e/2*.1,y:l/2},...ct(-e/2-e/2*.1,l/2,e/2+e/2*.1,l/2,c,.8),{x:e/2+e/2*.1,y:-l/2},{x:-e/2-e/2*.1,y:-l/2},{x:-e/2,y:-l/2},{x:-e/2,y:l/2*1.1},{x:-e/2,y:-l/2}],b=m.polygon(d.map(N=>[N.x,N.y]),u),S=i.insert(()=>b,":first-child");return S.attr("class","basic label-container outer-path"),g&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",g),p&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",p),S.attr("transform",`translate(0,${-c/2})`),r.attr("transform",`translate(${-e/2+(t.padding??0)+e/2*.1/2-(n.x-(n.left??0))},${-s/2+(t.padding??0)-c/2-(n.y-(n.top??0))})`),P(t,S),t.intersect=function(N){return $.polygon(t,d,N)},i}x(Ie,"linedWaveEdgedRect");async function We(y,t){let{labelStyles:h,nodeStyles:p}=v(t);t.labelStyle=h;let a=t.padding??0,o=t.look==="neo"?16:a,f=t.look==="neo"?12:a,i=t.look==="neo"?10:5;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-o*2-2*i,10),t.height=Math.max((t?.height??0)-f*2-2*i,10));let{shapeSvg:n,bbox:r,label:e}=await M(y,t,C(t)),s=(t?.width?t?.width:r.width)+o*2+2*i,c=(t?.height?t?.height:r.height)+f*2+2*i,l=s-2*i,g=c-2*i,m=-l/2,u=-g/2,{cssStyles:d}=t,b=k.svg(n),S=D(t,{}),N=[{x:m-i,y:u+i},{x:m-i,y:u+g+i},{x:m+l-i,y:u+g+i},{x:m+l-i,y:u+g},{x:m+l,y:u+g},{x:m+l,y:u+g-i},{x:m+l+i,y:u+g-i},{x:m+l+i,y:u-i},{x:m+i,y:u-i},{x:m+i,y:u},{x:m,y:u},{x:m,y:u+i}],w=[{x:m,y:u+i},{x:m+l-i,y:u+i},{x:m+l-i,y:u+g},{x:m+l,y:u+g},{x:m+l,y:u},{x:m,y:u}];t.look!=="handDrawn"&&(S.roughness=0,S.fillStyle="solid");let B=W(N),T=b.path(B,S),R=W(w),G=b.path(R,S);t.look!=="handDrawn"&&(T=Wt(T),G=Wt(G));let E=n.insert("g",":first-child");return E.insert(()=>T),E.insert(()=>G),E.attr("class","basic label-container outer-path"),d&&t.look!=="handDrawn"&&E.selectAll("path").attr("style",d),p&&t.look!=="handDrawn"&&E.selectAll("path").attr("style",p),e.attr("transform",`translate(${-(r.width/2)-i-(r.x-(r.left??0))}, ${-(r.height/2)+i-(r.y-(r.top??0))})`),P(t,E),t.intersect=function(j){return $.polygon(t,N,j)},n}x(We,"multiRect");async function Xe(y,t){let{labelStyles:h,nodeStyles:p}=v(t);t.labelStyle=h;let{shapeSvg:a,bbox:o,label:f}=await M(y,t,C(t)),i=t.padding??0,n=t.look==="neo"?16:i,r=t.look==="neo"?12:i,e=!0;(t.width||t.height)&&(e=!1,t.width=(t?.width??0)-n*2,t.height=(t?.height??0)-r*3);let s=Math.max(o.width,t?.width??0)+n*2,c=Math.max(o.height,t?.height??0)+r*3,l=t.look==="neo"?c/4:c/8,g=c+(e?l/2:-l/2),m=-s/2,u=-g/2,d=10,{cssStyles:b}=t,S=ct(m-d,u+g+d,m+s-d,u+g+d,l,.8),N=S?.[S.length-1],w=[{x:m-d,y:u+d},{x:m-d,y:u+g+d},...S,{x:m+s-d,y:N.y-d},{x:m+s,y:N.y-d},{x:m+s,y:N.y-2*d},{x:m+s+d,y:N.y-2*d},{x:m+s+d,y:u-d},{x:m+d,y:u-d},{x:m+d,y:u},{x:m,y:u},{x:m,y:u+d}],B=[{x:m,y:u+d},{x:m+s-d,y:u+d},{x:m+s-d,y:N.y-d},{x:m+s,y:N.y-d},{x:m+s,y:u},{x:m,y:u}],T=k.svg(a),R=D(t,{});t.look!=="handDrawn"&&(R.roughness=0,R.fillStyle="solid");let G=W(w),E=T.path(G,R),j=W(B),I=T.path(j,R),H=a.insert(()=>E,":first-child");return H.insert(()=>I),H.attr("class","basic label-container outer-path"),b&&t.look!=="handDrawn"&&H.selectAll("path").attr("style",b),p&&t.look!=="handDrawn"&&H.selectAll("path").attr("style",p),H.attr("transform",`translate(0,${-l/2})`),f.attr("transform",`translate(${-(o.width/2)-d-(o.x-(o.left??0))}, ${-(o.height/2)+d-l/2-(o.y-(o.top??0))})`),P(t,H),t.intersect=function(A){return $.polygon(t,w,A)},a}x(Xe,"multiWaveEdgedRectangle");async function Ye(y,t,{config:{themeVariables:h}}){let{labelStyles:p,nodeStyles:a}=v(t);t.labelStyle=p,t.useHtmlLabels||tt(ut())||(t.centerLabel=!0);let{shapeSvg:f,bbox:i,label:n}=await M(y,t,C(t)),r=Math.max(i.width+(t.padding??0)*2,t?.width??0),e=Math.max(i.height+(t.padding??0)*2,t?.height??0),s=-r/2,c=-e/2,{cssStyles:l}=t,g=k.svg(f),m=D(t,{fill:h.noteBkgColor,stroke:h.noteBorderColor});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");let u=g.rectangle(s,c,r,e,m),d=f.insert(()=>u,":first-child");return d.attr("class","basic label-container outer-path"),n.attr("class","label noteLabel"),l&&t.look!=="handDrawn"&&d.selectAll("path").attr("style",l),a&&t.look!=="handDrawn"&&d.selectAll("path").attr("style",a),n.attr("transform",`translate(${-i.width/2-(i.x-(i.left??0))}, ${-(i.height/2)-(i.y-(i.top??0))})`),P(t,d),t.intersect=function(b){return $.rect(t,b)},f}x(Ye,"note");var zs=x((y,t,h)=>[`M${y+h/2},${t}`,`L${y+h},${t-h/2}`,`L${y+h/2},${t-h}`,`L${y},${t-h/2}`,"Z"].join(" "),"createDecisionBoxPathD");async function Fe(y,t){let{labelStyles:h,nodeStyles:p}=v(t);t.labelStyle=h;let{shapeSvg:a,bbox:o}=await M(y,t,C(t)),f=o.width+(t.padding??0),i=o.height+(t.padding??0),n=f+i,r=.5,e=[{x:n/2,y:0},{x:n,y:-n/2},{x:n/2,y:-n},{x:0,y:-n/2}],s,{cssStyles:c}=t;if(t.look==="handDrawn"){let l=k.svg(a),g=D(t,{}),m=zs(0,0,n),u=l.path(m,g);s=a.insert(()=>u,":first-child").attr("transform",`translate(${-n/2+r}, ${n/2})`),c&&s.attr("style",c)}else s=st(a,n,n,e),s.attr("transform",`translate(${-n/2+r}, ${n/2})`);return p&&s.attr("style",p),P(t,s),t.calcIntersect=function(l,g){let m=l.width,u=[{x:m/2,y:0},{x:m,y:-m/2},{x:m/2,y:-m},{x:0,y:-m/2}],d=$.polygon(l,u,g);return{x:d.x-.5,y:d.y-.5}},t.intersect=function(l){return this.calcIntersect(t,l)},a}x(Fe,"question");async function _e(y,t){let{labelStyles:h,nodeStyles:p}=v(t);t.labelStyle=h;let a=t.padding??0,o=t.look==="neo"?21:a??0,f=t.look==="neo"?12:a??0,{shapeSvg:i,bbox:n,label:r}=await M(y,t,C(t)),e=(t?.width??n.width)+(t.look==="neo"?o*2:o),s=(t?.height??n.height)+(t.look==="neo"?f*2:f),c=-e/2,l=-s/2,g=l/2,m=[{x:c+g,y:l},{x:c,y:0},{x:c+g,y:-l},{x:-c,y:-l},{x:-c,y:l}],{cssStyles:u}=t,d=k.svg(i),b=D(t,{});t.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");let S=W(m),N=d.path(S,b),w=i.insert(()=>N,":first-child");return w.attr("class","basic label-container outer-path"),u&&t.look!=="handDrawn"&&w.selectAll("path").attr("style",u),p&&t.look!=="handDrawn"&&w.selectAll("path").attr("style",p),w.attr("transform",`translate(${-g/2},0)`),r.attr("transform",`translate(${-g/2-n.width/2-(n.x-(n.left??0))}, ${-(n.height/2)-(n.y-(n.top??0))})`),P(t,w),t.intersect=function(B){return $.polygon(t,m,B)},i}x(_e,"rect_left_inv_arrow");async function qe(y,t){let{labelStyles:h,nodeStyles:p}=v(t);t.labelStyle=h;let a;t.cssClasses?a="node "+t.cssClasses:a="node default";let o=y.insert("g").attr("class",a).attr("id",t.domId||t.id),f=o.insert("g"),i=o.insert("g").attr("class","label").attr("style",p),n=t.description,r=t.label,e=await Pt(i,r,t.labelStyle,!0,!0),s={width:0,height:0};if(tt(Z())){let R=e.children[0],G=J(e);s=R.getBoundingClientRect(),G.attr("width",s.width),G.attr("height",s.height)}Y.info("Text 2",n);let c=n||[],l=e.getBBox(),g=await Pt(i,Array.isArray(c)?c.join("<br/>"):c,t.labelStyle,!0,!0),m=g.children[0],u=J(g);s=m.getBoundingClientRect(),u.attr("width",s.width),u.attr("height",s.height);let d=(t.padding||0)/2;J(g).attr("transform","translate( "+(s.width>l.width?0:(l.width-s.width)/2)+", "+(l.height+d+5)+")"),J(e).attr("transform","translate( "+(s.width<l.width?0:-(l.width-s.width)/2)+", 0)"),s=i.node().getBBox(),i.attr("transform","translate("+-s.width/2+", "+(-s.height/2-d+3)+")");let b=s.width+(t.padding||0),S=s.height+(t.padding||0),N=-s.width/2-d,w=-s.height/2-d,B,T;if(t.look==="handDrawn"){let R=k.svg(o),G=D(t,{}),E=R.path(it(N,w,b,S,t.rx||0),G),j=R.line(-s.width/2-d,-s.height/2-d+l.height+d,s.width/2+d,-s.height/2-d+l.height+d,G);T=o.insert(()=>(Y.debug("Rough node insert CXC",E),j),":first-child"),B=o.insert(()=>(Y.debug("Rough node insert CXC",E),E),":first-child")}else B=f.insert("rect",":first-child"),T=f.insert("line"),B.attr("class","outer title-state").attr("style",p).attr("x",-s.width/2-d).attr("y",-s.height/2-d).attr("width",s.width+(t.padding||0)).attr("height",s.height+(t.padding||0)),T.attr("class","divider").attr("x1",-s.width/2-d).attr("x2",s.width/2+d).attr("y1",-s.height/2-d+l.height+d).attr("y2",-s.height/2-d+l.height+d);return P(t,B),t.intersect=function(R){return $.rect(t,R)},o}x(qe,"rectWithTitle");async function ze(y,t,{config:{themeVariables:h}}){let p=h?.radius??5,a={rx:p,ry:p,classes:"",labelPaddingX:(t?.padding??0)*1,labelPaddingY:(t?.padding??0)*1};return ht(y,t,a)}x(ze,"roundedRect");var vt=8;async function Ue(y,t){let{labelStyles:h,nodeStyles:p}=v(t);t.labelStyle=h;let a=t.look==="neo"?16:t.padding??0,o=t.look==="neo"?12:t.padding??0,{shapeSvg:f,bbox:i,label:n}=await M(y,t,C(t)),r=(t?.width??i.width)+a*2+(t.look==="neo"?vt:vt*2),e=(t?.height??i.height)+o*2,s=r-vt,c=e,l=vt-r/2,g=-e/2,{cssStyles:m}=t,u=k.svg(f),d=D(t,{});t.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");let b=[{x:l,y:g},{x:l+s,y:g},{x:l+s,y:g+c},{x:l-vt,y:g+c},{x:l-vt,y:g},{x:l,y:g},{x:l,y:g+c}],S=u.polygon(b.map(w=>[w.x,w.y]),d),N=f.insert(()=>S,":first-child");return N.attr("class","basic label-container outer-path").attr("style",z(m)),p&&t.look!=="handDrawn"&&N.selectAll("path").attr("style",p),m&&t.look!=="handDrawn"&&N.selectAll("path").attr("style",p),n.attr("transform",`translate(${vt/2-i.width/2-(i.x-(i.left??0))}, ${-(i.height/2)-(i.y-(i.top??0))})`),P(t,N),t.intersect=function(w){return $.rect(t,w)},f}x(Ue,"shadedProcess");async function Ze(y,t){let{labelStyles:h,nodeStyles:p}=v(t);t.labelStyle=h;let a=t.padding??0,o=t.look==="neo"?16:a,f=t.look==="neo"?12:a;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-o*2,10),t.height=Math.max((t?.height??0)/1.5-f*2,10));let{shapeSvg:i,bbox:n,label:r}=await M(y,t,C(t)),e=(t?.width?t?.width:n.width)+o*2,s=((t?.height?t?.height:n.height)+f*2)*1.5,c=e,l=s/1.5,g=-c/2,m=-l/2,{cssStyles:u}=t,d=k.svg(i),b=D(t,{});t.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");let S=[{x:g,y:m},{x:g,y:m+l},{x:g+c,y:m+l},{x:g+c,y:m-l/2}],N=W(S),w=d.path(N,b),B=i.insert(()=>w,":first-child");return B.attr("class","basic label-container outer-path"),u&&t.look!=="handDrawn"&&B.selectChildren("path").attr("style",u),p&&t.look!=="handDrawn"&&B.selectChildren("path").attr("style",p),B.attr("transform",`translate(0, ${l/4})`),r.attr("transform",`translate(${-c/2+(t.padding??0)-(n.x-(n.left??0))}, ${-l/4+(t.padding??0)-(n.y-(n.top??0))})`),P(t,B),t.intersect=function(T){return $.polygon(t,S,T)},i}x(Ze,"slopedRect");async function Je(y,t){let h=t.padding??0,p=t.look==="neo"?16:h*2,a=t.look==="neo"?12:h,o={rx:0,ry:0,classes:"",labelPaddingX:t.labelPaddingX??p,labelPaddingY:a};return ht(y,t,o)}x(Je,"squareRect");async function Ke(y,t){let{labelStyles:h,nodeStyles:p}=v(t);t.labelStyle=h;let a=t.padding??0,o=t.look==="neo"?20:a,f=t.look==="neo"?12:a,{shapeSvg:i,bbox:n}=await M(y,t,C(t)),r=n.height+(t.look==="neo"?f*2:f),e=n.width+r/4+(t.look==="neo"?o*2:o),s=r/2,{cssStyles:c}=t,l=k.svg(i),g=D(t,{});t.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");let m=[{x:-e/2+s,y:-r/2},{x:e/2-s,y:-r/2},...kt(-e/2+s,0,s,50,90,270),{x:e/2-s,y:r/2},...kt(e/2-s,0,s,50,270,450)],u=W(m),d=l.path(u,g),b=i.insert(()=>d,":first-child");return b.attr("class","basic label-container outer-path"),c&&t.look!=="handDrawn"&&b.selectChildren("path").attr("style",c),p&&t.look!=="handDrawn"&&b.selectChildren("path").attr("style",p),P(t,b),t.intersect=function(S){return $.polygon(t,m,S)},i}x(Ke,"stadium");async function Qe(y,t){let h={rx:t.look==="neo"?3:5,ry:t.look==="neo"?3:5,classes:"flowchart-node"};return ht(y,t,h)}x(Qe,"state");function ts(y,t,{config:{themeVariables:h}}){let{labelStyles:p,nodeStyles:a}=v(t);t.labelStyle=p;let{cssStyles:o}=t,{lineColor:f,stateBorder:i,nodeBorder:n,nodeShadow:r}=h;(t.width||t.height)&&((t.width??0)<14&&(t.width=14),(t.height??0)<14&&(t.height=14)),t.width||(t.width=14),t.height||(t.height=14);let e=y.insert("g").attr("class","node default").attr("id",t.domId??t.id),s=k.svg(e),c=D(t,{});t.look!=="handDrawn"&&(c.roughness=0,c.fillStyle="solid");let l=s.circle(0,0,t.width,{...c,stroke:f,strokeWidth:2}),g=i??n,m=(t.width??0)*5/14,u=s.circle(0,0,m,{...c,fill:g,stroke:g,strokeWidth:2,fillStyle:"solid"}),d=e.insert(()=>l,":first-child");if(d.insert(()=>u),t.look!=="handDrawn"&&d.attr("class","outer-path"),o&&d.selectAll("path").attr("style",o),a&&d.selectAll("path").attr("style",a),t.width<25&&r&&t.look!=="handDrawn"){let b=y.node()?.ownerSVGElement?.id??"",S=b?`${b}-drop-shadow-small`:"drop-shadow-small";d.attr("style",`filter:url(#${S})`)}return P(t,d),t.intersect=function(b){return $.circle(t,(t.width??0)/2,b)},e}x(ts,"stateEnd");function es(y,t,{config:{themeVariables:h}}){let{lineColor:p,nodeShadow:a}=h;(t.width||t.height)&&((t.width??0)<14&&(t.width=14),(t.height??0)<14&&(t.height=14)),t.width||(t.width=14),t.height||(t.height=14);let o=y.insert("g").attr("class","node default").attr("id",t.domId||t.id),f;if(t.look==="handDrawn"){let n=k.svg(o).circle(0,0,t.width,Ut(p));f=o.insert(()=>n),f.attr("class","state-start").attr("r",(t.width??7)/2).attr("width",t.width??14).attr("height",t.height??14)}else f=o.insert("circle",":first-child"),f.attr("class","state-start").attr("r",(t.width??7)/2).attr("width",t.width??14).attr("height",t.height??14);if(t.width<25&&a&&t.look!=="handDrawn"){let i=y.node()?.ownerSVGElement?.id??"",n=i?`${i}-drop-shadow-small`:"drop-shadow-small";f.attr("style",`filter:url(#${n})`)}return P(t,f),t.intersect=function(i){return $.circle(t,(t.width??7)/2,i)},o}x(es,"stateStart");var Bt=8;async function ss(y,t){let{labelStyles:h,nodeStyles:p}=v(t);t.labelStyle=h;let a=t?.padding??8,o=t.look==="neo"?28:a,f=t.look==="neo"?12:a,{shapeSvg:i,bbox:n}=await M(y,t,C(t)),r=(t?.width??n.width)+2*Bt+o,e=(t?.height??n.height)+f,s=r-2*Bt,c=e,l=-r/2,g=-e/2,m=[{x:0,y:0},{x:s,y:0},{x:s,y:-c},{x:0,y:-c},{x:0,y:0},{x:-8,y:0},{x:s+8,y:0},{x:s+8,y:-c},{x:-8,y:-c},{x:-8,y:0}];if(t.look==="handDrawn"){let u=k.svg(i),d=D(t,{}),b=u.rectangle(l,g,s+16,c,d),S=u.line(l+Bt,g,l+Bt,g+c,d),N=u.line(l+Bt+s,g,l+Bt+s,g+c,d);i.insert(()=>S,":first-child"),i.insert(()=>N,":first-child");let w=i.insert(()=>b,":first-child"),{cssStyles:B}=t;w.attr("class","basic label-container").attr("style",z(B)),P(t,w)}else{let u=st(i,s,c,m);p&&u.attr("style",p),P(t,u)}return t.intersect=function(u){return $.polygon(t,m,u)},i}x(ss,"subroutine");var Xt=.2;async function rs(y,t){let{labelStyles:h,nodeStyles:p}=v(t);t.labelStyle=h;let a=t.padding??0,o=t.look==="neo"?16:a,f=t.look==="neo"?12:a;(t.width||t.height)&&(t.height=Math.max((t?.height??0)-f*2,10),t.width=Math.max((t?.width??0)-o*2-Xt*(t.height+f*2),10));let{shapeSvg:i,bbox:n}=await M(y,t,C(t)),r=(t?.height?t?.height:n.height)+f*2,e=Xt*r,s=Xt*r,l=(t?.width?t?.width:n.width)+o*2+e-e,g=r,m=-l/2,u=-g/2,{cssStyles:d}=t,b=k.svg(i),S=D(t,{}),N=[{x:m-e/2,y:u},{x:m+l+e/2,y:u},{x:m+l+e/2,y:u+g},{x:m-e/2,y:u+g}],w=[{x:m+l-e/2,y:u+g},{x:m+l+e/2,y:u+g},{x:m+l+e/2,y:u+g-s}];t.look!=="handDrawn"&&(S.roughness=0,S.fillStyle="solid");let B=W(N),T=b.path(B,S),R=W(w),G=b.path(R,{...S,fillStyle:"solid"}),E=i.insert(()=>G,":first-child");return E.insert(()=>T,":first-child"),E.attr("class","basic label-container outer-path"),d&&t.look!=="handDrawn"&&E.selectAll("path").attr("style",d),p&&t.look!=="handDrawn"&&E.selectAll("path").attr("style",p),P(t,E),t.intersect=function(j){return $.polygon(t,N,j)},i}x(rs,"taggedRect");async function is(y,t){let{labelStyles:h,nodeStyles:p}=v(t);t.labelStyle=h;let{shapeSvg:a,bbox:o,label:f}=await M(y,t,C(t)),i=Math.max(o.width+(t.padding??0)*2,t?.width??0),n=Math.max(o.height+(t.padding??0)*2,t?.height??0),r=n/8,e=.2*i,s=.2*n,c=n+r,{cssStyles:l}=t,g=k.svg(a),m=D(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");let u=[{x:-i/2-i/2*.1,y:c/2},...ct(-i/2-i/2*.1,c/2,i/2+i/2*.1,c/2,r,.8),{x:i/2+i/2*.1,y:-c/2},{x:-i/2-i/2*.1,y:-c/2}],d=-i/2+i/2*.1,b=-c/2-s*.4,S=[{x:d+i-e,y:(b+n)*1.3},{x:d+i,y:b+n-s},{x:d+i,y:(b+n)*.9},...ct(d+i,(b+n)*1.25,d+i-e,(b+n)*1.3,-n*.02,.5)],N=W(u),w=g.path(N,m),B=W(S),T=g.path(B,{...m,fillStyle:"solid"}),R=a.insert(()=>T,":first-child");return R.insert(()=>w,":first-child"),R.attr("class","basic label-container outer-path"),l&&t.look!=="handDrawn"&&R.selectAll("path").attr("style",l),p&&t.look!=="handDrawn"&&R.selectAll("path").attr("style",p),R.attr("transform",`translate(0,${-r/2})`),f.attr("transform",`translate(${-i/2+(t.padding??0)-(o.x-(o.left??0))},${-n/2+(t.padding??0)-r/2-(o.y-(o.top??0))})`),P(t,R),t.intersect=function(G){return $.polygon(t,u,G)},a}x(is,"taggedWaveEdgedRectangle");async function os(y,t){let{labelStyles:h,nodeStyles:p}=v(t);t.labelStyle=h;let{shapeSvg:a,bbox:o}=await M(y,t,C(t)),f=Math.max(o.width+(t.padding??0),t?.width||0),i=Math.max(o.height+(t.padding??0),t?.height||0),n=-f/2,r=-i/2,e=a.insert("rect",":first-child");return e.attr("class","text").attr("style",p).attr("rx",0).attr("ry",0).attr("x",n).attr("y",r).attr("width",f).attr("height",i),P(t,e),t.intersect=function(s){return $.rect(t,s)},a}x(os,"text");var Us=x((y,t,h,p,a,o)=>`M${y},${t}
a${a},${o} 0,0,1 0,${-p}
l${h},0
a${a},${o} 0,0,1 0,${p}
M${h},${-p}
a${a},${o} 0,0,0 0,${p}
l${-h},0`,"createCylinderPathD"),Zs=x((y,t,h,p,a,o)=>[`M${y},${t}`,`M${y+h},${t}`,`a${a},${o} 0,0,0 0,${-p}`,`l${-h},0`,`a${a},${o} 0,0,0 0,${p}`,`l${h},0`].join(" "),"createOuterCylinderPathD"),Js=x((y,t,h,p,a,o)=>[`M${y+h/2},${-p/2}`,`a${a},${o} 0,0,0 0,${p}`].join(" "),"createInnerCylinderPathD"),as=5,ns=10;async function ls(y,t){let{labelStyles:h,nodeStyles:p}=v(t);t.labelStyle=h;let a=t.padding??0,o=t.look==="neo"?12:a/2;if(t.width||t.height){let m=t.height??0;t.height=(t.height??0)-o,t.height<as&&(t.height=as);let d=m/2/(2.5+m/50);t.width=(t.width??0)-o-d*3,t.width<ns&&(t.width=ns)}let{shapeSvg:f,bbox:i,label:n}=await M(y,t,C(t)),r=(t.height?t.height:i.height)+o,e=r/2,s=e/(2.5+r/50),c=(t.width?t.width:i.width)+s+o,{cssStyles:l}=t,g;if(t.look==="handDrawn"){let m=k.svg(f),u=Zs(0,0,c,r,s,e),d=Js(0,0,c,r,s,e),b=m.path(u,D(t,{})),S=m.path(d,D(t,{fill:"none"}));g=f.insert(()=>S,":first-child"),g=f.insert(()=>b,":first-child"),g.attr("class","basic label-container"),l&&g.attr("style",l)}else{let m=Us(0,0,c,r,s,e);g=f.insert("path",":first-child").attr("d",m).attr("class","basic label-container").attr("style",z(l)).attr("style",p),g.attr("class","basic label-container outer-path"),l&&g.selectAll("path").attr("style",l),p&&g.selectAll("path").attr("style",p)}return g.attr("label-offset-x",s),g.attr("transform",`translate(${-c/2}, ${r/2} )`),n.attr("transform",`translate(${-(i.width/2)-s-(i.x-(i.left??0))}, ${-(i.height/2)-(i.y-(i.top??0))})`),P(t,g),t.intersect=function(m){let u=$.rect(t,m),d=u.y-(t.y??0);if(e!=0&&(Math.abs(d)<(t.height??0)/2||Math.abs(d)==(t.height??0)/2&&Math.abs(u.x-(t.x??0))>(t.width??0)/2-s)){let b=s*s*(1-d*d/(e*e));b!=0&&(b=Math.sqrt(Math.abs(b))),b=s-b,m.x-(t.x??0)>0&&(b=-b),u.x+=b}return u},f}x(ls,"tiltedCylinder");async function cs(y,t){let{labelStyles:h,nodeStyles:p}=v(t);t.labelStyle=h;let a=t.padding??0,o=(t.look==="neo",a),f=t.look==="neo"?a*2:a,{shapeSvg:i,bbox:n}=await M(y,t,C(t)),r=(t?.height??n.height)+o,e=(t?.width??n.width)+f,s=[{x:-3*r/6,y:0},{x:e+3*r/6,y:0},{x:e,y:-r},{x:0,y:-r}],c,{cssStyles:l}=t;if(t.look==="handDrawn"){let g=k.svg(i),m=D(t,{}),u=W(s),d=g.path(u,m);c=i.insert(()=>d,":first-child").attr("transform",`translate(${-e/2}, ${r/2})`),l&&c.attr("style",l)}else c=st(i,e,r,s);return p&&c.attr("style",p),t.width=e,t.height=r,P(t,c),t.intersect=function(g){return $.polygon(t,s,g)},i}x(cs,"trapezoid");async function hs(y,t){let{labelStyles:h,nodeStyles:p}=v(t);t.labelStyle=h;let a=t.padding??0,o=t.look==="neo"?16:a,f=t.look==="neo"?12:a,i=15,n=5;(t.width||t.height)&&(t.height=(t.height??0)-f*2,t.height<n&&(t.height=n),t.width=(t.width??0)-o*2,t.width<i&&(t.width=i));let{shapeSvg:r,bbox:e}=await M(y,t,C(t)),s=(t?.width?t?.width:e.width)+o*2,c=(t?.height?t?.height:e.height)+f*2,{cssStyles:l}=t,g=k.svg(r),m=D(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");let u=[{x:-s/2*.8,y:-c/2},{x:s/2*.8,y:-c/2},{x:s/2,y:-c/2*.6},{x:s/2,y:c/2},{x:-s/2,y:c/2},{x:-s/2,y:-c/2*.6}],d=W(u),b=g.path(d,m),S=r.insert(()=>b,":first-child");return S.attr("class","basic label-container outer-path"),l&&t.look!=="handDrawn"&&S.selectChildren("path").attr("style",l),p&&t.look!=="handDrawn"&&S.selectChildren("path").attr("style",p),P(t,S),t.intersect=function(N){return $.polygon(t,u,N)},r}x(hs,"trapezoidalPentagon");var ps=10,ms=10;async function gs(y,t){let{labelStyles:h,nodeStyles:p}=v(t);t.labelStyle=h;let a=t.padding??0,o=t.look==="neo"?a*2:a;(t.width||t.height)&&(t.width=((t?.width??0)-o)/2,t.width<ms&&(t.width=ms),t.height=t?.height??0,t.height<ps&&(t.height=ps));let{shapeSvg:f,bbox:i,label:n}=await M(y,t,C(t)),r=nt(Z().flowchart?.htmlLabels),e=(t?.width?t?.width:i.width)+o,s=t?.height?t?.height:e+i.height,c=s,l=[{x:0,y:0},{x:c,y:0},{x:c/2,y:-s}],{cssStyles:g}=t,m=k.svg(f),u=D(t,{});t.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");let d=W(l),b=m.path(d,u),S=f.insert(()=>b,":first-child").attr("transform",`translate(${-s/2}, ${s/2})`).attr("class","outer-path");return g&&t.look!=="handDrawn"&&S.selectChildren("path").attr("style",g),p&&t.look!=="handDrawn"&&S.selectChildren("path").attr("style",p),t.width=e,t.height=s,P(t,S),n.attr("transform",`translate(${-i.width/2-(i.x-(i.left??0))}, ${s/2-(i.height+(t.padding??0)/(r?2:1)-(i.y-(i.top??0)))})`),t.intersect=function(N){return Y.info("Triangle intersect",t,l,N),$.polygon(t,l,N)},f}x(gs,"triangle");async function fs(y,t){let{labelStyles:h,nodeStyles:p}=v(t);t.labelStyle=h;let a=t.padding??0,o=t.look==="neo"?16:a,f=t.look==="neo"?12:a,i=!0;(t.width||t.height)&&(i=!1,t.width=(t?.width??0)-o*2,t.width<10&&(t.width=10),t.height=(t?.height??0)-f*2,t.height<10&&(t.height=10));let{shapeSvg:n,bbox:r,label:e}=await M(y,t,C(t)),s=(t?.width?t?.width:r.width)+(o??0)*2,c=(t?.height?t?.height:r.height)+(f??0)*2,l=t.look==="neo"?c/4:c/8,g=c+(i?l:-l),{cssStyles:m}=t,d=14-s,b=d>0?d/2:0,S=k.svg(n),N=D(t,{});t.look!=="handDrawn"&&(N.roughness=0,N.fillStyle="solid");let w=[{x:-s/2-b,y:g/2},...ct(-s/2-b,g/2,s/2+b,g/2,l,.8),{x:s/2+b,y:-g/2},{x:-s/2-b,y:-g/2}],B=W(w),T=S.path(B,N),R=n.insert(()=>T,":first-child");return R.attr("class","basic label-container outer-path"),m&&t.look!=="handDrawn"&&R.selectAll("path").attr("style",m),p&&t.look!=="handDrawn"&&R.selectAll("path").attr("style",p),R.attr("transform",`translate(0,${-l/2})`),e.attr("transform",`translate(${-s/2+(t.padding??0)-(r.x-(r.left??0))},${-c/2+(t.padding??0)-l-(r.y-(r.top??0))})`),P(t,R),t.intersect=function(G){return $.polygon(t,w,G)},n}x(fs,"waveEdgedRectangle");async function ds(y,t){let{labelStyles:h,nodeStyles:p}=v(t);t.labelStyle=h;let a=t.padding??0,o=t.look==="neo"?16:a,f=t.look==="neo"?20:a;if(t.width||t.height){t.width=t?.width??0,t.width<20&&(t.width=20),t.height=t?.height??0,t.height<10&&(t.height=10);let N=Math.min(t.height*.2,t.height/4);t.height=Math.ceil(t.height-f-N*(20/9)),t.width=t.width-o*2}let{shapeSvg:i,bbox:n}=await M(y,t,C(t)),r=(t?.width?t?.width:n.width)+o*2,e=(t?.height?t?.height:n.height)+f,s=e/8,c=e+s*2,{cssStyles:l}=t,g=k.svg(i),m=D(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");let u=[{x:-r/2,y:c/2},...ct(-r/2,c/2,r/2,c/2,s,1),{x:r/2,y:-c/2},...ct(r/2,-c/2,-r/2,-c/2,s,-1)],d=W(u),b=g.path(d,m),S=i.insert(()=>b,":first-child");return S.attr("class","basic label-container"),l&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",l),p&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",p),P(t,S),t.intersect=function(N){return $.polygon(t,u,N)},i}x(ds,"waveRectangle");var K=10;async function ys(y,t){let{labelStyles:h,nodeStyles:p}=v(t);t.labelStyle=h;let a=t.look==="neo"?16:t.padding??0,o=t.look==="neo"?12:t.padding??0;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-a*2-K,10),t.height=Math.max((t?.height??0)-o*2-K,10));let{shapeSvg:f,bbox:i,label:n}=await M(y,t,C(t)),r=(t?.width?t?.width:i.width)+a*2+K,e=(t?.height?t?.height:i.height)+o*2+K,s=r-K,c=e-K,l=-s/2,g=-c/2,{cssStyles:m}=t,u=k.svg(f),d=D(t,{}),b=[{x:l-K,y:g-K},{x:l-K,y:g+c},{x:l+s,y:g+c},{x:l+s,y:g-K}],S=`M${l-K},${g-K} L${l+s},${g-K} L${l+s},${g+c} L${l-K},${g+c} L${l-K},${g-K}
M${l-K},${g} L${l+s},${g}
M${l},${g-K} L${l},${g+c}`;t.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");let N=u.path(S,d),w=f.insert(()=>N,":first-child");return w.attr("transform",`translate(${K/2}, ${K/2})`),w.attr("class","basic label-container outer-path"),m&&t.look!=="handDrawn"&&w.selectAll("path").attr("style",m),p&&t.look!=="handDrawn"&&w.selectAll("path").attr("style",p),n.attr("transform",`translate(${-(i.width/2)+K/2-(i.x-(i.left??0))}, ${-(i.height/2)+K/2-(i.y-(i.top??0))})`),P(t,w),t.intersect=function(B){return $.polygon(t,b,B)},f}x(ys,"windowPane");var us=new Set(["redux-color","redux-dark-color"]),Ks=new Set(["redux","redux-dark","redux-color","redux-dark-color"]);async function Yt(y,t){let h=t;h.alias&&(t.label=h.alias);let{theme:p,themeVariables:a}=ut(),{rowEven:o,rowOdd:f,nodeBorder:i,borderColorArray:n}=a;if(t.look==="handDrawn"){let{themeVariables:F}=ut(),{background:U}=F,Q={...t,id:t.id+"-background",domId:(t.domId||t.id)+"-background",look:"default",cssStyles:["stroke: none",`fill: ${U}`]};await Yt(y,Q)}let r=ut();t.useHtmlLabels=r.htmlLabels;let e=r.er?.diagramPadding??10,s=r.er?.entityPadding??6,{cssStyles:c}=t,{labelStyles:l,nodeStyles:g}=v(t);if(h.attributes.length===0&&t.label){let F={rx:0,ry:0,labelPaddingX:e,labelPaddingY:e*1.5,classes:""};$t(t.label,r)+F.labelPaddingX*2<r.er.minEntityWidth&&(t.width=r.er.minEntityWidth);let U=await ht(y,t,F);if(p!=null&&us.has(p)){let Q=h.colorIndex??0;U.attr("data-color-id",`color-${Q%n.length}`)}if(!nt(r.htmlLabels)){let Q=U.select("text"),at=Q.node()?.getBBox();Q.attr("transform",`translate(${-at.width/2}, 0)`)}return U}r.htmlLabels||(e*=1.25,s*=1.25);let m=C(t);m||(m="node default");let u=y.insert("g").attr("class",m).attr("id",t.domId||t.id),d=await Tt(u,t.label??"",r,0,0,["name"],l);d.height+=s;let b=0,S=[],N=[],w=0,B=0,T=0,R=0,G=!0,E=!0;for(let F of h.attributes){let U=await Tt(u,F.type,r,0,b,["attribute-type"],l);w=Math.max(w,U.width+e);let Q=await Tt(u,F.name,r,0,b,["attribute-name"],l);B=Math.max(B,Q.width+e);let at=await Tt(u,F.keys.join(),r,0,b,["attribute-keys"],l);T=Math.max(T,at.width+e);let Nt=await Tt(u,F.comment,r,0,b,["attribute-comment"],l);R=Math.max(R,Nt.width+e);let yt=Math.max(U.height,Q.height,at.height,Nt.height)+s;N.push({yOffset:b,rowHeight:yt}),b+=yt}let j=4;T<=e&&(G=!1,T=0,j--),R<=e&&(E=!1,R=0,j--);let I=u.node().getBBox();if(d.width+e*2-(w+B+T+R)>0){let F=d.width+e*2-(w+B+T+R);w+=F/j,B+=F/j,T>0&&(T+=F/j),R>0&&(R+=F/j)}let H=w+B+T+R,A=k.svg(u),O=D(t,{});t.look!=="handDrawn"&&(O.roughness=0,O.fillStyle="solid");let L=0;N.length>0&&(L=N.reduce((F,U)=>F+(U?.rowHeight??0),0));let V=Math.max(I.width+e*2,t?.width||0,H),X=Math.max((L??0)+d.height,t?.height||0),_=-V/2,q=-X/2;if(u.selectAll("g:not(:first-child)").each((F,U,Q)=>{let at=J(Q[U]),Nt=at.attr("transform"),yt=0,_t=0;if(Nt){let Ot=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(Nt);Ot&&(yt=parseFloat(Ot[1]),_t=parseFloat(Ot[2]),at.attr("class").includes("attribute-name")?yt+=w:at.attr("class").includes("attribute-keys")?yt+=w+B:at.attr("class").includes("attribute-comment")&&(yt+=w+B+T))}at.attr("transform",`translate(${_+e/2+yt}, ${_t+q+d.height+s/2})`)}),u.select(".name").attr("transform","translate("+-d.width/2+", "+(q+s/2)+")"),p!=null&&us.has(p)){let F=h.colorIndex??0;u.attr("data-color-id",`color-${F%n.length}`)}let gt=A.rectangle(_,q,V,X,O),pt=u.insert(()=>gt,":first-child").attr("class","outer-path").attr("style",c.join(""));S.push(0);for(let[F,U]of N.entries()){let at=(F+1)%2===0&&U.yOffset!==0,Nt=A.rectangle(_,d.height+q+U?.yOffset,V,U?.rowHeight,{...O,fill:at?o:f,stroke:i});u.insert(()=>Nt,"g.label").attr("style",c.join("")).attr("class",`row-rect-${at?"even":"odd"}`)}let lt=1e-4,ot=Ct(_,d.height+q,V+_,d.height+q,lt),ft=A.polygon(ot.map(F=>[F.x,F.y]),O);if(u.insert(()=>ft).attr("class","divider"),ot=Ct(w+_,d.height+q,w+_,X+q,lt),ft=A.polygon(ot.map(F=>[F.x,F.y]),O),u.insert(()=>ft).attr("class","divider"),G){let F=w+B+_;ot=Ct(F,d.height+q,F,X+q,lt),ft=A.polygon(ot.map(U=>[U.x,U.y]),O),u.insert(()=>ft).attr("class","divider")}if(E){let F=w+B+T+_;ot=Ct(F,d.height+q,F,X+q,lt),ft=A.polygon(ot.map(U=>[U.x,U.y]),O),u.insert(()=>ft).attr("class","divider")}for(let F of S){let U=d.height+q+F;ot=Ct(_,U,V+_,U,lt),ft=A.polygon(ot.map(Q=>[Q.x,Q.y]),O),u.insert(()=>ft).attr("class","divider")}if(P(t,pt),g&&t.look!=="handDrawn")if(p!=null&&Ks.has(p))u.selectAll("path").attr("style",g);else{let U=g.split(";")?.filter(Q=>Q.includes("stroke"))?.map(Q=>`${Q}`).join("; ");u.selectAll("path").attr("style",U??""),u.selectAll(".row-rect-even path").attr("style",g)}return t.intersect=function(F){return $.rect(t,F)},u}x(Yt,"erBox");async function Tt(y,t,h,p=0,a=0,o=[],f=""){let i=y.insert("g").attr("class",`label ${o.join(" ")}`).attr("transform",`translate(${p}, ${a})`).attr("style",f);t!==Vt(t)&&(t=Vt(t),t=t.replaceAll("<","<").replaceAll(">",">"));let n=i.node().appendChild(await et(i,t,{width:$t(t,h)+100,style:f,useHtmlLabels:h.htmlLabels},h));if(t.includes("<")||t.includes(">")){let e=n.children[0];for(e.textContent=e.textContent.replaceAll("<","<").replaceAll(">",">");e.childNodes[0];)e=e.childNodes[0],e.textContent=e.textContent.replaceAll("<","<").replaceAll(">",">")}let r=n.getBBox();if(nt(h.htmlLabels)){let e=n.children[0];e.style.textAlign="start";let s=J(n);r=e.getBoundingClientRect(),s.attr("width",r.width),s.attr("height",r.height)}return r}x(Tt,"addText");function Ct(y,t,h,p,a){return y===h?[{x:y-a/2,y:t},{x:y+a/2,y:t},{x:h+a/2,y:p},{x:h-a/2,y:p}]:[{x:y,y:t-a/2},{x:y,y:t+a/2},{x:h,y:p+a/2},{x:h,y:p-a/2}]}x(Ct,"lineToPolygon");async function xs(y,t,h,p,a=h.class.padding??12){let o=p?0:3,f=y.insert("g").attr("class",C(t)).attr("id",t.domId||t.id),i=null,n=null,r=null,e=null,s=0,c=0,l=0;if(i=f.insert("g").attr("class","annotation-group text"),t.annotations.length>0){let b=t.annotations[0];await jt(i,{text:`\xAB${b}\xBB`},0),s=i.node().getBBox().height}n=f.insert("g").attr("class","label-group text"),await jt(n,t,0,["font-weight: bolder"]);let g=n.node().getBBox();c=g.height,r=f.insert("g").attr("class","members-group text");let m=0;for(let b of t.members){let S=await jt(r,b,m,[b.parseClassifier()]);m+=S+o}l=r.node().getBBox().height,l<=0&&(l=a/2),e=f.insert("g").attr("class","methods-group text");let u=0;for(let b of t.methods){let S=await jt(e,b,u,[b.parseClassifier()]);u+=S+o}let d=f.node().getBBox();if(i!==null){let b=i.node().getBBox();i.attr("transform",`translate(${-b.width/2})`)}return n.attr("transform",`translate(${-g.width/2}, ${s})`),d=f.node().getBBox(),r.attr("transform",`translate(0, ${s+c+a*2})`),d=f.node().getBBox(),e.attr("transform",`translate(0, ${s+c+(l?l+a*4:a*2)})`),d=f.node().getBBox(),{shapeSvg:f,bbox:d}}x(xs,"textHelper");async function jt(y,t,h,p=[]){let a=y.insert("g").attr("class","label").attr("style",p.join("; ")),o=ut(),f="useHtmlLabels"in t?t.useHtmlLabels:nt(o.htmlLabels)??!0,i="";"text"in t?i=t.text:i=t.label,!f&&i.startsWith("\\")&&(i=i.substring(1)),qt(i)&&(f=!0);let n=await et(a,Rt(Dt(i)),{width:$t(i,o)+50,classes:"markdown-node-label",useHtmlLabels:f},o),r,e=1;if(f){let s=n.children[0],c=J(n);e=s.innerHTML.split("<br>").length,s.innerHTML.includes("</math>")&&(e+=s.innerHTML.split("<mrow>").length-1);let l=s.getElementsByTagName("img");if(l){let g=i.replace(/<img[^>]*>/g,"").trim()==="";await Promise.all([...l].map(m=>new Promise(u=>{function d(){if(m.style.display="flex",m.style.flexDirection="column",g){let b=o.fontSize?.toString()??window.getComputedStyle(document.body).fontSize,N=parseInt(b,10)*5+"px";m.style.minWidth=N,m.style.maxWidth=N}else m.style.width="100%";u(m)}x(d,"setupImage"),setTimeout(()=>{m.complete&&d()}),m.addEventListener("error",d),m.addEventListener("load",d)})))}r=s.getBoundingClientRect(),c.attr("width",r.width),c.attr("height",r.height)}else{p.includes("font-weight: bolder")&&J(n).selectAll("tspan").attr("font-weight",""),e=n.children.length;let s=n.children[0];(n.textContent===""||n.textContent.includes(">"))&&(s.textContent=i[0]+i.substring(1).replaceAll(">",">").replaceAll("<","<").trim(),i[1]===" "&&(s.textContent=s.textContent[0]+" "+s.textContent.substring(1))),s.textContent==="undefined"&&(s.textContent=""),r=n.getBBox()}return a.attr("transform","translate(0,"+(-r.height/(2*e)+h)+")"),r.height}x(jt,"addText");async function bs(y,t){let h=Z(),{themeVariables:p}=h,{useGradient:a}=p,o=h.class.padding??12,f=o,i=t.useHtmlLabels??nt(h.htmlLabels)??!0,n=t;n.annotations=n.annotations??[],n.members=n.members??[],n.methods=n.methods??[];let{shapeSvg:r,bbox:e}=await xs(y,t,h,i,f),{labelStyles:s,nodeStyles:c}=v(t);t.labelStyle=s,t.cssStyles=n.styles||"";let l=n.styles?.join(";")||c||"";t.cssStyles||(t.cssStyles=l.replaceAll("!important","").split(";"));let g=n.members.length===0&&n.methods.length===0&&!h.class?.hideEmptyMembersBox,m=k.svg(r),u=D(t,{});t.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");let d=Math.max(t.width??0,e.width),b=Math.max(t.height??0,e.height),S=(t.height??0)>e.height;n.members.length===0&&n.methods.length===0?b+=f:n.members.length>0&&n.methods.length===0&&(b+=f*2);let N=-d/2,w=-b/2,B=g?o*2:n.members.length===0&&n.methods.length===0?-o:0;S&&(B=o*2);let T=m.rectangle(N-o,w-o-(g?o:n.members.length===0&&n.methods.length===0?-o/2:0),d+2*o,b+2*o+B,u),R=r.insert(()=>T,":first-child");R.attr("class","basic label-container outer-path");let G=R.node().getBBox(),E=r.select(".annotation-group").node().getBBox().height-(g?o/2:0)||0,j=r.select(".label-group").node().getBBox().height-(g?o/2:0)||0,I=r.select(".members-group").node().getBBox().height-(g?o/2:0)||0,H=(E+j+w+o-(w-o-(g?o:n.members.length===0&&n.methods.length===0?-o/2:0)))/2;if(r.selectAll(".text").each((A,O,L)=>{let V=J(L[O]),X=V.attr("transform"),_=0;if(X){let lt=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(X);lt&&(_=parseFloat(lt[2]))}let q=_+w+o-(g?o:n.members.length===0&&n.methods.length===0?-o/2:0);if(V.attr("class").includes("methods-group")){let pt=Math.max(I,f/2);S?q=Math.max(H,E+j+pt+w+f*2+o)+f*2:q=E+j+pt+w+f*4+o}n.members.length===0&&n.methods.length===0&&h.class?.hideEmptyMembersBox&&(n.annotations.length>0?q=_-f:q=_),i||(q-=4);let gt=N;(V.attr("class").includes("label-group")||V.attr("class").includes("annotation-group"))&&(gt=-V.node()?.getBBox().width/2||0,r.selectAll("text").each(function(pt,lt,ot){window.getComputedStyle(ot[lt]).textAnchor==="middle"&&(gt=0)})),V.attr("transform",`translate(${gt}, ${q})`)}),n.members.length>0||n.methods.length>0||g){let A=E+j+w+o,O=m.line(G.x,A,G.x+G.width,A+.001,u);r.insert(()=>O).attr("class",`divider${t.look==="neo"&&!a?" neo-line":""}`).attr("style",l)}if(g||n.members.length>0||n.methods.length>0){let A=E+j+I+w+f*2+o,O=m.line(G.x,S?Math.max(H,A):A,G.x+G.width,(S?Math.max(H,A):A)+.001,u);r.insert(()=>O).attr("class",`divider${t.look==="neo"&&!a?" neo-line":""}`).attr("style",l)}if(n.look!=="handDrawn"&&r.selectAll("path").attr("style",l),R.select(":nth-child(2)").attr("style",l),r.selectAll(".divider").select("path").attr("style",l),t.labelStyle?r.selectAll("span").attr("style",t.labelStyle):r.selectAll("span").attr("style",l),!i){let A=RegExp(/color\s*:\s*([^;]*)/),O=A.exec(l);if(O){let L=O[0].replace("color","fill");r.selectAll("tspan").attr("style",L)}else if(s){let L=A.exec(s);if(L){let V=L[0].replace("color","fill");r.selectAll("tspan").attr("style",V)}}}return P(t,R),t.intersect=function(A){return $.rect(t,A)},r}x(bs,"classBox");async function Ss(y,t){let{labelStyles:h,nodeStyles:p}=v(t);t.labelStyle=h;let a=t,o=t,f=20,i=20,n="verifyMethod"in t,r=C(t),{themeVariables:e}=Z(),{borderColorArray:s,requirementEdgeLabelBackground:c}=e,l=y.insert("g").attr("class",r).attr("id",t.domId??t.id),g;n?g=await dt(l,`<<${a.type}>>`,0,t.labelStyle):g=await dt(l,"<<Element>>",0,t.labelStyle);let m=g,u=await dt(l,a.name,m,t.labelStyle+"; font-weight: bold;");if(m+=u+i,n){let G=await dt(l,`${a.requirementId?`ID: ${a.requirementId}`:""}`,m,t.labelStyle);m+=G;let E=await dt(l,`${a.text?`Text: ${a.text}`:""}`,m,t.labelStyle);m+=E;let j=await dt(l,`${a.risk?`Risk: ${a.risk}`:""}`,m,t.labelStyle);m+=j,await dt(l,`${a.verifyMethod?`Verification: ${a.verifyMethod}`:""}`,m,t.labelStyle)}else{let G=await dt(l,`${o.type?`Type: ${o.type}`:""}`,m,t.labelStyle);m+=G,await dt(l,`${o.docRef?`Doc Ref: ${o.docRef}`:""}`,m,t.labelStyle)}let d=(l.node()?.getBBox().width??200)+f,b=(l.node()?.getBBox().height??200)+f,S=-d/2,N=-b/2,w=k.svg(l),B=D(t,{});t.look!=="handDrawn"&&(B.roughness=0,B.fillStyle="solid");let T=w.rectangle(S,N,d,b,B),R=l.insert(()=>T,":first-child");if(R.attr("class","basic label-container outer-path").attr("style",p),s?.length){let G=t.colorIndex??0;l.attr("data-color-id",`color-${G%s.length}`)}if(l.selectAll(".label").each((G,E,j)=>{let I=J(j[E]),H=I.attr("transform"),A=0,O=0;if(H){let _=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(H);_&&(A=parseFloat(_[1]),O=parseFloat(_[2]))}let L=O-b/2,V=S+f/2;(E===0||E===1)&&(V=A),I.attr("transform",`translate(${V}, ${L+f})`)}),m>g+u+i){let G=N+g+u+i,E;if(t.look==="neo"){let H=[[S,G],[S+d,G],[S+d,G+.001],[S,G+.001]];E=w.polygon(H,B)}else E=w.line(S,G,S+d,G,B);l.insert(()=>E).attr("class","divider")}return P(t,R),t.intersect=function(G){return $.rect(t,G)},p&&t.look!=="handDrawn"&&(c||s?.length)&&l.selectAll("path").attr("style",p),l}x(Ss,"requirementBox");async function dt(y,t,h,p=""){if(t==="")return 0;let a=y.insert("g").attr("class","label").attr("style",p),o=Z(),f=o.htmlLabels??!0,i=await et(a,Rt(Dt(t)),{width:$t(t,o)+50,classes:"markdown-node-label",useHtmlLabels:f,style:p},o),n;if(f){let r=i.children[0],e=J(i);n=r.getBoundingClientRect(),e.attr("width",n.width),e.attr("height",n.height)}else{let r=i.children[0];for(let e of r.children)p&&e.setAttribute("style",p);n=i.getBBox(),n.height+=6}return a.attr("transform",`translate(${-n.width/2},${-n.height/2+h})`),n.height}x(dt,"addText");var Qs=x(y=>{switch(y){case"Very High":return"red";case"High":return"orange";case"Medium":return null;case"Low":return"blue";case"Very Low":return"lightblue"}},"colorFromPriority");async function ws(y,t,{config:h}){let{labelStyles:p,nodeStyles:a}=v(t);t.labelStyle=p||"";let o=10,f=t.width;t.width=(t.width??200)-10;let{shapeSvg:i,bbox:n,label:r}=await M(y,t,C(t)),e=t.padding||10,s="",c;"ticket"in t&&t.ticket&&h?.kanban?.ticketBaseUrl&&(s=h?.kanban?.ticketBaseUrl.replace("#TICKET#",t.ticket),c=i.insert("svg:a",":first-child").attr("class","kanban-ticket-link").attr("xlink:href",s).attr("target","_blank"));let l={useHtmlLabels:t.useHtmlLabels,labelStyle:t.labelStyle||"",width:t.width,img:t.img,padding:t.padding||8,centerLabel:!1},g,m;c?{label:g,bbox:m}=await Mt(c,"ticket"in t&&t.ticket||"",l):{label:g,bbox:m}=await Mt(i,"ticket"in t&&t.ticket||"",l);let{label:u,bbox:d}=await Mt(i,"assigned"in t&&t.assigned||"",l);t.width=f;let b=10,S=t?.width||0,N=Math.max(m.height,d.height)/2,w=Math.max(n.height+b*2,t?.height||0)+N,B=-S/2,T=-w/2;r.attr("transform","translate("+(e-S/2)+", "+(-N-n.height/2)+")"),g.attr("transform","translate("+(e-S/2)+", "+(-N+n.height/2)+")"),u.attr("transform","translate("+(e+S/2-d.width-2*o)+", "+(-N+n.height/2)+")");let R,{rx:G,ry:E}=t,{cssStyles:j}=t;if(t.look==="handDrawn"){let I=k.svg(i),H=D(t,{}),A=G||E?I.path(it(B,T,S,w,G||0),H):I.rectangle(B,T,S,w,H);R=i.insert(()=>A,":first-child"),R.attr("class","basic label-container").attr("style",j||null)}else{R=i.insert("rect",":first-child"),R.attr("class","basic label-container __APA__").attr("style",a).attr("rx",G??5).attr("ry",E??5).attr("x",B).attr("y",T).attr("width",S).attr("height",w);let I="priority"in t&&t.priority;if(I){let H=i.append("line"),A=B+2,O=T+Math.floor((G??0)/2),L=T+w-Math.floor((G??0)/2);H.attr("x1",A).attr("y1",O).attr("x2",A).attr("y2",L).attr("stroke-width","4").attr("stroke",Qs(I))}}return P(t,R),t.height=w,t.intersect=function(I){return $.rect(t,I)},i}x(ws,"kanbanItem");async function Ns(y,t){let{labelStyles:h,nodeStyles:p}=v(t);t.labelStyle=h;let{shapeSvg:a,bbox:o,halfPadding:f,label:i}=await M(y,t,C(t)),n=o.width+10*f,r=o.height+8*f,e=.15*n,{cssStyles:s}=t,c=o.width+20,l=o.height+20,g=Math.max(n,c),m=Math.max(r,l);i.attr("transform",`translate(${-o.width/2}, ${-o.height/2})`);let u,d=`M0 0
a${e},${e} 1 0,0 ${g*.25},${-1*m*.1}
a${e},${e} 1 0,0 ${g*.25},0
a${e},${e} 1 0,0 ${g*.25},0
a${e},${e} 1 0,0 ${g*.25},${m*.1}
a${e},${e} 1 0,0 ${g*.15},${m*.33}
a${e*.8},${e*.8} 1 0,0 0,${m*.34}
a${e},${e} 1 0,0 ${-1*g*.15},${m*.33}
a${e},${e} 1 0,0 ${-1*g*.25},${m*.15}
a${e},${e} 1 0,0 ${-1*g*.25},0
a${e},${e} 1 0,0 ${-1*g*.25},0
a${e},${e} 1 0,0 ${-1*g*.25},${-1*m*.15}
a${e},${e} 1 0,0 ${-1*g*.1},${-1*m*.33}
a${e*.8},${e*.8} 1 0,0 0,${-1*m*.34}
a${e},${e} 1 0,0 ${g*.1},${-1*m*.33}
H0 V0 Z`;if(t.look==="handDrawn"){let b=k.svg(a),S=D(t,{}),N=b.path(d,S);u=a.insert(()=>N,":first-child"),u.attr("class","basic label-container").attr("style",z(s))}else u=a.insert("path",":first-child").attr("class","basic label-container").attr("style",p).attr("d",d);return u.attr("transform",`translate(${-g/2}, ${-m/2})`),P(t,u),t.calcIntersect=function(b,S){return $.rect(b,S)},t.intersect=function(b){return Y.info("Bang intersect",t,b),$.rect(t,b)},a}x(Ns,"bang");async function $s(y,t){let{labelStyles:h,nodeStyles:p}=v(t);t.labelStyle=h;let{shapeSvg:a,bbox:o,halfPadding:f,label:i}=await M(y,t,C(t)),n=o.width+2*f,r=o.height+2*f,e=.15*n,s=.25*n,c=.35*n,l=.2*n,{cssStyles:g}=t,m,u=`M0 0
a${e},${e} 0 0,1 ${n*.25},${-1*n*.1}
a${c},${c} 1 0,1 ${n*.4},${-1*n*.1}
a${s},${s} 1 0,1 ${n*.35},${n*.2}
a${e},${e} 1 0,1 ${n*.15},${r*.35}
a${l},${l} 1 0,1 ${-1*n*.15},${r*.65}
a${s},${e} 1 0,1 ${-1*n*.25},${n*.15}
a${c},${c} 1 0,1 ${-1*n*.5},0
a${e},${e} 1 0,1 ${-1*n*.25},${-1*n*.15}
a${e},${e} 1 0,1 ${-1*n*.1},${-1*r*.35}
a${l},${l} 1 0,1 ${n*.1},${-1*r*.65}
H0 V0 Z`;if(t.look==="handDrawn"){let d=k.svg(a),b=D(t,{}),S=d.path(u,b);m=a.insert(()=>S,":first-child"),m.attr("class","basic label-container").attr("style",z(g))}else m=a.insert("path",":first-child").attr("class","basic label-container").attr("style",p).attr("d",u);return i.attr("transform",`translate(${-o.width/2}, ${-o.height/2})`),m.attr("transform",`translate(${-n/2}, ${-r/2})`),P(t,m),t.calcIntersect=function(d,b){return $.rect(d,b)},t.intersect=function(d){return Y.info("Cloud intersect",t,d),$.rect(t,d)},a}x($s,"cloud");async function Ds(y,t){let{labelStyles:h,nodeStyles:p}=v(t);t.labelStyle=h;let{shapeSvg:a,bbox:o,halfPadding:f,label:i}=await M(y,t,C(t)),n=o.width+8*f,r=o.height+2*f,e=5,s=t.look==="neo"?`
M${-n/2} ${r/2-e}
v${-r+2*e}
q0,-${e} ${e},-${e}
h${n-2*e}
q${e},0 ${e},${e}
v${r-e}
H${-n/2}
Z
`:`
M${-n/2} ${r/2-e}
v${-r+2*e}
q0,-${e} ${e},-${e}
h${n-2*e}
q${e},0 ${e},${e}
v${r-2*e}
q0,${e} ${-e},${e}
h${-(n-2*e)}
q${-e},0 ${-e},${-e}
Z
`;if(!t.domId)throw new Error(`defaultMindmapNode: node "${t.id}" is missing a domId \u2014 was render.ts domId prefixing skipped?`);let c=a.append("path").attr("id",t.domId).attr("class","node-bkg node-"+t.type).attr("style",p).attr("d",s);return a.append("line").attr("class","node-line-").attr("x1",-n/2).attr("y1",r/2).attr("x2",n/2).attr("y2",r/2),i.attr("transform",`translate(${-o.width/2}, ${-o.height/2})`),a.append(()=>i.node()),P(t,c),t.calcIntersect=function(l,g){return $.rect(l,g)},t.intersect=function(l){return $.rect(t,l)},a}x(Ds,"defaultMindmapNode");async function ks(y,t){let h={padding:t.padding??0};return Ht(y,t,h)}x(ks,"mindmapCircle");var tr=[{semanticName:"Process",name:"Rectangle",shortName:"rect",description:"Standard process shape",aliases:["proc","process","rectangle"],internalAliases:["squareRect"],handler:Je},{semanticName:"Event",name:"Rounded Rectangle",shortName:"rounded",description:"Represents an event",aliases:["event"],internalAliases:["roundedRect"],handler:ze},{semanticName:"Terminal Point",name:"Stadium",shortName:"stadium",description:"Terminal point",aliases:["terminal","pill"],handler:Ke},{semanticName:"Subprocess",name:"Framed Rectangle",shortName:"fr-rect",description:"Subprocess",aliases:["subprocess","subproc","framed-rectangle","subroutine"],handler:ss},{semanticName:"Database",name:"Cylinder",shortName:"cyl",description:"Database storage",aliases:["db","database","cylinder"],handler:ye},{semanticName:"Data Store",name:"Data Store",shortName:"datastore",description:"Data flow diagram data store",aliases:["data-store"],handler:ue},{semanticName:"Start",name:"Circle",shortName:"circle",description:"Starting point",aliases:["circ"],handler:Ht},{semanticName:"Bang",name:"Bang",shortName:"bang",description:"Bang",aliases:["bang"],handler:Ns},{semanticName:"Cloud",name:"Cloud",shortName:"cloud",description:"cloud",aliases:["cloud"],handler:$s},{semanticName:"Decision",name:"Diamond",shortName:"diam",description:"Decision-making step",aliases:["decision","diamond","question"],handler:Fe},{semanticName:"Prepare Conditional",name:"Hexagon",shortName:"hex",description:"Preparation or condition step",aliases:["hexagon","prepare"],handler:ve},{semanticName:"Data Input/Output",name:"Lean Right",shortName:"lean-r",description:"Represents input or output",aliases:["lean-right","in-out"],internalAliases:["lean_right"],handler:je},{semanticName:"Data Input/Output",name:"Lean Left",shortName:"lean-l",description:"Represents output or input",aliases:["lean-left","out-in"],internalAliases:["lean_left"],handler:He},{semanticName:"Priority Action",name:"Trapezoid Base Bottom",shortName:"trap-b",description:"Priority action",aliases:["priority","trapezoid-bottom","trapezoid"],handler:cs},{semanticName:"Manual Operation",name:"Trapezoid Base Top",shortName:"trap-t",description:"Represents a manual task",aliases:["manual","trapezoid-top","inv-trapezoid"],internalAliases:["inv_trapezoid"],handler:Ge},{semanticName:"Stop",name:"Double Circle",shortName:"dbl-circ",description:"Represents a stop point",aliases:["double-circle"],internalAliases:["doublecircle"],handler:be},{semanticName:"Text Block",name:"Text Block",shortName:"text",description:"Text block",handler:os},{semanticName:"Card",name:"Notched Rectangle",shortName:"notch-rect",description:"Represents a card",aliases:["card","notched-rectangle"],handler:ne},{semanticName:"Lined/Shaded Process",name:"Lined Rectangle",shortName:"lin-rect",description:"Lined process shape",aliases:["lined-rectangle","lined-process","lin-proc","shaded-process"],handler:Ue},{semanticName:"Start",name:"Small Circle",shortName:"sm-circ",description:"Small starting point",aliases:["start","small-circle"],internalAliases:["stateStart"],handler:es},{semanticName:"Stop",name:"Framed Circle",shortName:"fr-circ",description:"Stop point",aliases:["stop","framed-circle"],internalAliases:["stateEnd"],handler:ts},{semanticName:"Fork/Join",name:"Filled Rectangle",shortName:"fork",description:"Fork or join in process flow",aliases:["join"],internalAliases:["forkJoin"],handler:De},{semanticName:"Collate",name:"Hourglass",shortName:"hourglass",description:"Represents a collate operation",aliases:["hourglass","collate"],handler:Pe},{semanticName:"Comment",name:"Curly Brace",shortName:"brace",description:"Adds a comment",aliases:["comment","brace-l"],handler:he},{semanticName:"Comment Right",name:"Curly Brace",shortName:"brace-r",description:"Adds a comment",handler:pe},{semanticName:"Comment with braces on both sides",name:"Curly Braces",shortName:"braces",description:"Adds a comment",handler:me},{semanticName:"Com Link",name:"Lightning Bolt",shortName:"bolt",description:"Communication link",aliases:["com-link","lightning-bolt"],handler:Ae},{semanticName:"Document",name:"Document",shortName:"doc",description:"Represents a document",aliases:["doc","document"],handler:fs},{semanticName:"Delay",name:"Half-Rounded Rectangle",shortName:"delay",description:"Represents a delay",aliases:["half-rounded-rectangle"],handler:ke},{semanticName:"Direct Access Storage",name:"Horizontal Cylinder",shortName:"h-cyl",description:"Direct access storage",aliases:["das","horizontal-cylinder"],handler:ls},{semanticName:"Disk Storage",name:"Lined Cylinder",shortName:"lin-cyl",description:"Disk storage",aliases:["disk","lined-cylinder"],handler:Ve},{semanticName:"Display",name:"Curved Trapezoid",shortName:"curv-trap",description:"Represents a display",aliases:["curved-trapezoid","display"],handler:ge},{semanticName:"Divided Process",name:"Divided Rectangle",shortName:"div-rect",description:"Divided process shape",aliases:["div-proc","divided-rectangle","divided-process"],handler:xe},{semanticName:"Extract",name:"Triangle",shortName:"tri",description:"Extraction process",aliases:["extract","triangle"],handler:gs},{semanticName:"Internal Storage",name:"Window Pane",shortName:"win-pane",description:"Internal storage",aliases:["internal-storage","window-pane"],handler:ys},{semanticName:"Junction",name:"Filled Circle",shortName:"f-circ",description:"Junction point",aliases:["junction","filled-circle"],handler:Se},{semanticName:"Loop Limit",name:"Trapezoidal Pentagon",shortName:"notch-pent",description:"Loop limit step",aliases:["loop-limit","notched-pentagon"],handler:hs},{semanticName:"Manual File",name:"Flipped Triangle",shortName:"flip-tri",description:"Manual file operation",aliases:["manual-file","flipped-triangle"],handler:$e},{semanticName:"Manual Input",name:"Sloped Rectangle",shortName:"sl-rect",description:"Manual input step",aliases:["manual-input","sloped-rectangle"],handler:Ze},{semanticName:"Multi-Document",name:"Stacked Document",shortName:"docs",description:"Multiple documents",aliases:["documents","st-doc","stacked-document"],handler:Xe},{semanticName:"Multi-Process",name:"Stacked Rectangle",shortName:"st-rect",description:"Multiple processes",aliases:["procs","processes","stacked-rectangle"],handler:We},{semanticName:"Stored Data",name:"Bow Tie Rectangle",shortName:"bow-rect",description:"Stored data",aliases:["stored-data","bow-tie-rectangle"],handler:ae},{semanticName:"Summary",name:"Crossed Circle",shortName:"cross-circ",description:"Summary",aliases:["summary","crossed-circle"],handler:ce},{semanticName:"Tagged Document",name:"Tagged Document",shortName:"tag-doc",description:"Tagged document",aliases:["tag-doc","tagged-document"],handler:is},{semanticName:"Tagged Process",name:"Tagged Rectangle",shortName:"tag-rect",description:"Tagged process",aliases:["tagged-rectangle","tag-proc","tagged-process"],handler:rs},{semanticName:"Paper Tape",name:"Flag",shortName:"flag",description:"Paper tape",aliases:["paper-tape"],handler:ds},{semanticName:"Odd",name:"Odd",shortName:"odd",description:"Odd shape",internalAliases:["rect_left_inv_arrow"],handler:_e},{semanticName:"Lined Document",name:"Lined Document",shortName:"lin-doc",description:"Lined document",aliases:["lined-document"],handler:Ie}],er=x(()=>{let t=[...Object.entries({state:Qe,choice:le,note:Ye,rectWithTitle:qe,labelRect:Ee,iconSquare:Re,iconCircle:Te,icon:Be,iconRounded:Ce,imageSquare:Me,anchor:ie,kanbanItem:ws,mindmapCircle:ks,defaultMindmapNode:Ds,classBox:bs,erBox:Yt,requirementBox:Ss}),...tr.flatMap(h=>[h.shortName,..."aliases"in h?h.aliases:[],..."internalAliases"in h?h.internalAliases:[]].map(a=>[a,h.handler]))];return Object.fromEntries(t)},"generateShapeMap"),Ft=er();function ef(y){return y in Ft}x(ef,"isValidShape");var At=new Map;async function lf(y,t,h){let p,a;t.shape==="rect"&&(t.rx&&t.ry?t.shape="roundedRect":t.shape="squareRect");let o=t.shape?Ft[t.shape]:void 0;if(!o)throw new Error(`No such shape: ${t.shape}. Please check your syntax.`);if(t.link){let f;h.config.securityLevel==="sandbox"?f="_top":t.linkTarget&&(f=t.linkTarget||"_blank"),p=y.insert("svg:a").attr("xlink:href",t.link).attr("target",f??null),a=await o(p,t,h)}else a=await o(y,t,h),p=a;return p.attr("data-look",z(t.look)),t.tooltip&&a.attr("title",t.tooltip),At.set(t.id,p),t.haveCallback&&p.attr("class",p.attr("class")+" clickable"),p}x(lf,"insertNode");var cf=x((y,t)=>{At.set(t.id,y)},"setNodeElem"),hf=x(()=>{At.clear()},"clear"),pf=x(y=>{let t=At.get(y.id);Y.trace("Transforming node",y.diff,y,"translate("+(y.x-y.width/2-5)+", "+y.width/2+")");let h=8,p=y.diff||0;return y.clusterNode?t.attr("transform","translate("+(y.x+p-y.width/2)+", "+(y.y-y.height/2-h)+")"):t.attr("transform","translate("+y.x+", "+y.y+")"),p},"positionNode");export{M as a,P as b,Pt as c,ef as d,Xr as e,Yr as f,lf as g,cf as h,hf as i,pf as j};