mermaid
Version:
Markdown-ish syntax for generating flowcharts, mindmaps, sequence diagrams, class diagrams, gantt charts, git graphs and more.
63 lines • 124 kB
JavaScript
import{a as k}from"./chunk-JENJ2NYI.mjs";import{a as De,b as ut,d as D,e as v}from"./chunk-FRYFDGAD.mjs";import{c as Wt,e as it}from"./chunk-KNGDTZMA.mjs";import{b as Se,c as we,d as Ne,e as lt}from"./chunk-UCIVM6JH.mjs";import{g as ct}from"./chunk-PNVTB6QF.mjs";import{k as At,o as $e,s as Nt,u as q}from"./chunk-EB7S5WDG.mjs";import{$ as U,B as Vt,D as oe,E as xe,ca as Ut,j as be,n as mt,u as kt,y as dt}from"./chunk-VLFMOWSA.mjs";import{b as X,h as J}from"./chunk-NXZFCOWJ.mjs";import{a as b}from"./chunk-V3YWWTDH.mjs";var Xr=1,Ur=3;async function qt(i){let t=i.getElementsByTagName("img");if(!t||t.length===0)return;let r=!Pe(i);await Promise.all([...t].map(n=>new Promise(c=>{function l(){if(n.style.display="flex",n.style.flexDirection="column",r){let d=U().fontSize?U().fontSize:window.getComputedStyle(document.body).fontSize,o=5,[h=be.fontSize]=$e(d),a=h*o+"px";n.style.minWidth=a,n.style.maxWidth=a}else n.style.width="100%";c(n)}b(l,"setupImage"),setTimeout(()=>{n.complete&&l()}),n.addEventListener("error",l),n.addEventListener("load",l)})))}b(qt,"configureLabelImages");function Pe(i){return i.nodeType===Ur?i.textContent?.trim()!=="":i.nodeType!==Xr||i.tagName.toLowerCase()==="img"?!1:[...i.childNodes].some(Pe)}b(Pe,"hasTextBesidesImages");var ve=3,qr=32,ke=b(async(i,t,r)=>{let n=U(),c=i.insert("g").attr("class",r??"node default").attr("id",t.domId||t.id),l=c.insert("g").attr("class","label").attr("style",q(t.labelStyle)),o=[{text:typeof t.label=="string"?t.label:t.label?.[0]??"",cssClass:"c4-name"},{text:t.stereotype,cssClass:"c4-type"},...(t.description??[]).map(y=>({text:y,cssClass:"c4-descr"}))].filter(y=>y.text),h=t.width?Math.max(t.width-2*(t.padding??0),qr):U().flowchart?.wrappingWidth??200,e=n.c4?.wrap??!0?h:Number.POSITIVE_INFINITY,s=await Promise.all(o.map(async y=>{let x=l.append("g").attr("class",y.cssClass),S=await it(x,Vt(Nt(y.text??""),n),{useHtmlLabels:!1,markdown:!1,isNode:!0,width:e,style:t.labelStyle},n);return J(S).selectAll("tspan.text-outer-tspan").attr("text-anchor","middle"),J(S).selectAll("tspan.text-inner-tspan").attr("font-weight",null).attr("font-style",null),{el:x,box:x.node().getBBox()}})),p=Math.max(...s.map(({box:y})=>y.width),0),m=0;for(let{el:y,box:x}of s)y.attr("transform",`translate(${p/2-x.x-x.width/2}, ${m-x.y})`),m+=x.height+ve;let f=s.length>0?m-ve:0;l.insert("rect",":first-child"),l.attr("transform",`translate(${-p/2}, ${-f/2})`);let g=l.node().getBBox(),u=(t.padding??0)/2;return{shapeSvg:c,bbox:g,halfPadding:u,label:l}},"c4LabelHelper");var Te=b((i,t)=>{let{x:r,y:n,width:c,height:l}=i;return c>=t?i:"left"in i?{x:r,y:n,width:t,height:l,top:n,left:r,bottom:n+l,right:r+t,toJSON:b(()=>({}),"toJSON")}:{x:r-(t-c)/2,y:n,width:t,height:l}},"withMinWidth"),G=b(async(i,t,r,{ignoreMinWidth:n=!1}={})=>{if(t.stereotype!==void 0)return ke(i,t,r);let c,l=t.useHtmlLabels||mt(U()?.htmlLabels);r?c=r:c="node default";let d=i.insert("g").attr("class",c).attr("id",t.domId||t.id),o=d.insert("g").attr("class","label").attr("style",q(t.labelStyle)),h;t.label===void 0?h="":h=typeof t.label=="string"?t.label:t.label[0];let a=!!t.icon||!!t.img,e=t.labelType==="markdown",s=h&&!t.width&&!n?t.minWidth??0:0,p=await it(o,Vt(Nt(h),U()),{useHtmlLabels:l,width:t.width||t.wrappingWidth||U().flowchart?.wrappingWidth,minWidth:s,classes:e?"markdown-node-label":"",style:t.labelStyle,addSvgBackground:a,markdown:e},U()),m=(t?.padding??0)/2,f;if(l){let g=p.children[0],u=J(p);await qt(g),f=await Wt.measure(()=>g.getBoundingClientRect()),f=Te(f,s),u.attr("width",f.width),u.attr("height",f.height)}else f=await Wt.measure(()=>p.getBBox()),f=Te(f,s);return l?o.attr("transform","translate("+-f.width/2+", "+-f.height/2+")"):o.attr("transform","translate(0, "+-f.height/2+")"),t.centerLabel&&o.attr("transform","translate("+-f.width/2+", "+-f.height/2+")"),o.insert("rect",":first-child"),{shapeSvg:d,bbox:f,halfPadding:m,label:o}},"labelHelper"),ft=b(async(i,t,r)=>{let n=r.useHtmlLabels??dt(U()),c=i.insert("g").attr("class","label").attr("style",r.labelStyle||""),l=await it(c,Vt(Nt(t),U()),{useHtmlLabels:n,width:r.width||U()?.flowchart?.wrappingWidth,style:r.labelStyle,addSvgBackground:!!r.icon||!!r.img}),d=r.padding/2,o;if(dt(U())){let h=l.children[0],a=J(l);o=await Wt.measure(()=>h.getBoundingClientRect()),a.attr("width",o.width),a.attr("height",o.height)}else o=await Wt.measure(()=>l.getBBox());return n?c.attr("transform","translate("+-o.width/2+", "+-o.height/2+")"):c.attr("transform","translate(0, "+-o.height/2+")"),r.centerLabel&&c.attr("transform","translate("+-o.width/2+", "+-o.height/2+")"),c.insert("rect",":first-child"),{shapeSvg:i,bbox:o,halfPadding:d,label:c}},"insertLabel"),P=b((i,t,r)=>{if(r){i.width=r.width,i.height=r.height;return}let n=t.node().getBBox();i.width=n.width,i.height=n.height},"updateNodeBounds");var T=b((i,t)=>(i.look==="handDrawn"?"rough-node":"node")+" "+i.cssClasses+" "+(t||""),"getNodeClasses");function _(i){let t=i.map((r,n)=>`${n===0?"M":"L"}${r.x},${r.y}`);return t.push("Z"),t.join(" ")}b(_,"createPathFromPoints");function ht(i,t,r,n,c,l){let d=[],h=r-i,a=n-t,e=h/l,s=2*Math.PI/e,p=t+a/2;for(let m=0;m<=50;m++){let f=m/50,g=i+f*h,u=p+c*Math.sin(s*(g-i));d.push({x:g,y:u})}return d}b(ht,"generateFullSineWavePoints");function nt(i,t,r,n,c,l){let d=[],o=c*Math.PI/180,e=(l*Math.PI/180-o)/(n-1);for(let s=0;s<n;s++){let p=o+s*e,m=i+r*Math.cos(p),f=t+r*Math.sin(p);d.push({x:-m,y:-f})}return d}b(nt,"generateCirclePoints");function ae(i){let t=Array.from(i.childNodes).filter(h=>h.tagName==="path"),r=document.createElementNS("http://www.w3.org/2000/svg","path"),n=t.map(h=>h.getAttribute("d")).filter(h=>h!==null).join(" ");r.setAttribute("d",n);let c=t.find(h=>h.getAttribute("fill")!=="none"),l=t.find(h=>h.getAttribute("stroke")!=="none"),d=b((h,a)=>h?.getAttribute(a)??void 0,"getAttr");if(c){let h={fill:d(c,"fill"),"fill-opacity":d(c,"fill-opacity")??"1"};Object.entries(h).forEach(([a,e])=>{e&&r.setAttribute(a,e)})}if(l){let h={stroke:d(l,"stroke"),"stroke-width":d(l,"stroke-width")??"1","stroke-opacity":d(l,"stroke-opacity")??"1"};Object.entries(h).forEach(([a,e])=>{e&&r.setAttribute(a,e)})}let o=document.createElementNS("http://www.w3.org/2000/svg","g");return o.appendChild(r),o}b(ae,"mergePaths");var Zr=b((i,t)=>{var r=i.x,n=i.y,c=t.x-r,l=t.y-n,d=i.width/2,o=i.height/2,h,a;return Math.abs(l)*d>Math.abs(c)*o?(l<0&&(o=-o),h=l===0?0:o*c/l,a=o):(c<0&&(d=-d),h=d,a=c===0?0:d*l/c),{x:r+h,y:n+a}},"intersectRect"),Ge=Zr;function zr(i,t){return i.intersect(t)}b(zr,"intersectNode");var Me=zr;function Jr(i,t,r,n){var c=i.x,l=i.y,d=c-n.x,o=l-n.y,h=Math.sqrt(t*t*o*o+r*r*d*d),a=Math.abs(t*r*d/h);n.x<c&&(a=-a);var e=Math.abs(t*r*o/h);return n.y<l&&(e=-e),{x:c+a,y:l+e}}b(Jr,"intersectEllipse");var Zt=Jr;function Kr(i,t,r){return Zt(i,t,t,r)}b(Kr,"intersectCircle");var Ee=Kr;function Qr(i,t,r,n){{let c=t.y-i.y,l=i.x-t.x,d=t.x*i.y-i.x*t.y,o=c*r.x+l*r.y+d,h=c*n.x+l*n.y+d,a=1e-6;if(o!==0&&h!==0&&Be(o,h))return;let e=n.y-r.y,s=r.x-n.x,p=n.x*r.y-r.x*n.y,m=e*i.x+s*i.y+p,f=e*t.x+s*t.y+p;if(Math.abs(m)<a&&Math.abs(f)<a&&Be(m,f))return;let g=c*s-e*l;if(g===0)return;let u=(l*p-s*d)/g,y=(e*d-c*p)/g;return{x:u,y}}}b(Qr,"intersectLine");function Be(i,t){return i*t>0}b(Be,"sameSign");var Ce=Qr;function to(i,t,r){let n=i.x,c=i.y,l=[],d=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY;typeof t.forEach=="function"?t.forEach(function(e){d=Math.min(d,e.x),o=Math.min(o,e.y)}):(d=Math.min(d,t.x),o=Math.min(o,t.y));let h=n-i.width/2-d,a=c-i.height/2-o;for(let e=0;e<t.length;e++){let s=t[e],p=t[e<t.length-1?e+1:0],m=Ce(i,r,{x:h+s.x,y:a+s.y},{x:h+p.x,y:a+p.y});m&&l.push(m)}return l.length?(l.length>1&&l.sort(function(e,s){let p=e.x-r.x,m=e.y-r.y,f=Math.sqrt(p*p+m*m),g=s.x-r.x,u=s.y-r.y,y=Math.sqrt(g*g+u*u);return f<y?-1:f===y?0:1}),l[0]):i}b(to,"intersectPolygon");var Ae=to;var N={node:Me,circle:Ee,ellipse:Zt,polygon:Ae,rect:Ge};var tt=b((i,t,r,n,c)=>["M",i+c,t,"H",i+r-c,"A",c,c,0,0,1,i+r,t+c,"V",t+n-c,"A",c,c,0,0,1,i+r-c,t+n,"H",i+c,"A",c,c,0,0,1,i,t+n-c,"V",t+c,"A",c,c,0,0,1,i+c,t,"Z"].join(" "),"createRoundedRectPathD");var eo=b(async(i,t,r,n=!1,c=!1)=>{let l=t||"";typeof l=="object"&&(l=l[0]);let d=U(),o=dt(d);return await it(i,l,{style:r,isTitle:n,useHtmlLabels:o,markdown:!1,isNode:c,width:Number.POSITIVE_INFINITY},d)},"createLabel"),ie=eo;function Re(i,t){let{labelStyles:r}=D(t);t.labelStyle=r;let n=T(t),c=n;n||(c="anchor");let l=i.insert("g").attr("class",c).attr("id",t.domId||t.id),d=1,{cssStyles:o}=t,h=k.svg(l),a=v(t,{fill:"black",stroke:"none",fillStyle:"solid"});t.look!=="handDrawn"&&(a.roughness=0);let e=h.circle(0,0,d*2,a),s=l.insert(()=>e,":first-child");return s.attr("class","anchor").attr("style",q(o)),P(t,s),t.intersect=function(p){return X.info("Circle intersect",t,d,p),N.circle(t,d,p)},l}b(Re,"anchor");function He(i,t,r,n,c,l,d){let h=(i+r)/2,a=(t+n)/2,e=Math.atan2(n-t,r-i),s=(r-i)/2,p=(n-t)/2,m=s/c,f=p/l,g=Math.sqrt(m**2+f**2);if(g>1)throw new Error("The given radii are too small to create an arc between the points.");let u=Math.sqrt(1-g**2),y=h+u*l*Math.sin(e)*(d?-1:1),x=a-u*c*Math.cos(e)*(d?-1:1),S=Math.atan2((t-x)/l,(i-y)/c),$=Math.atan2((n-x)/l,(r-y)/c)-S;d&&$<0&&($+=2*Math.PI),!d&&$>0&&($-=2*Math.PI);let E=[];for(let M=0;M<20;M++){let B=M/19,V=S+B*$,R=y+c*Math.cos(V),A=x+l*Math.sin(V);E.push({x:R,y:A})}return E}b(He,"generateArcPoints");function so(i,t,r){let[n,c]=[t,r].sort((l,d)=>d-l);return c*(1-Math.sqrt(1-(i/n/2)**2))}b(so,"calculateArcSagitta");async function je(i,t){let{labelStyles:r,nodeStyles:n}=D(t);t.labelStyle=r;let c=t.padding??0,l=t.look==="neo"?16:c,d=t.look==="neo"?12:c,o=b(V=>V+d,"calcTotalHeight"),h=b(V=>{let R=V/2;return[R/(2.5+V/50),R]},"calcEllipseRadius"),{shapeSvg:a,bbox:e}=await G(i,t,T(t)),s=o(t?.height?t?.height:e.height),[p,m]=h(s),f=so(s,p,m),u=(t?.width?t?.width:e.width)+l*2+f-f,y=s,{cssStyles:x}=t,S=[{x:u/2,y:-y/2},{x:-u/2,y:-y/2},...He(-u/2,-y/2,-u/2,y/2,p,m,!1),{x:u/2,y:y/2},...He(u/2,y/2,u/2,-y/2,p,m,!0)],w=k.svg(a),$=v(t,{});t.look!=="handDrawn"&&($.roughness=0,$.fillStyle="solid");let E=_(S),M=w.path(E,$),B=a.insert(()=>M,":first-child");return B.attr("class","basic label-container outer-path"),x&&t.look!=="handDrawn"&&B.selectAll("path").attr("style",x),n&&t.look!=="handDrawn"&&B.selectAll("path").attr("style",n),B.attr("transform",`translate(${p/2}, 0)`),P(t,B),t.intersect=function(V){return N.polygon(t,S,V)},a}b(je,"bowTieRect");async function Ie(i,t,{config:{themeVariables:r}}){let{labelStyles:n,nodeStyles:c}=D(t);t.labelStyle=n;let{shapeSvg:l,bbox:d,label:o}=await G(i,t,T(t)),h=r?.nodeBorder??r?.lineColor??"currentColor",a=t.padding??12,e=Math.max(d.width+a*2,t.width??0,80),s=Math.max(Math.min(e*.08,12),5),p=Math.max(d.height+a*2+s,t.height??0),m=-p/2+s,f=p/2,g=e*.72,u=[`M${-e/2},${m}`,`L${-g/2},${f}`,`A${g/2},${s} 0 0 0 ${g/2},${f}`,`L${e/2},${m}`,`A${e/2},${s} 0 0 0 ${-e/2},${m}`,"Z"].join(" "),{cssStyles:y}=t,x=l.insert("g",":first-child").attr("class","basic label-container");if(t.look==="handDrawn"){let B=k.svg(l).path(u,v(t,{}));x.node()?.appendChild(B),y&&x.attr("style",y)}else x.append("path").attr("d",u).attr("style",c);x.append("ellipse").attr("cx",0).attr("cy",m).attr("rx",e/2).attr("ry",s).attr("style",`fill:none;stroke:${h};stroke-width:1px`),P(t,x);let S=m+(f-m)/2;o.attr("transform",`translate(${-(d.width/2)-(d.x-(d.left??0))}, ${S-d.height/2-(d.y-(d.top??0))})`);let w=12,$=b((M,B,V)=>Array.from({length:w+1},(R,A)=>{let j=Math.PI-A*Math.PI/w;return{x:M*Math.cos(j),y:B+V*s*Math.sin(j)}}),"arc"),E=[...$(e/2,m,-1),...$(g/2,f,1).reverse()];return t.intersect=function(M){return N.polygon(t,E,M)},l}b(Ie,"bucket");var ne=20,le=8,ro=80,oo=8;function ao(i){let{themeVariables:t}=U(),r=t.clusterBkg,n=t.clusterBorder;return i==="flow"?{rx:10,fill:"none",stroke:t.flowContainerStroke||t.secondaryBorderColor,strokeWidth:.75,cssClass:"flow-collapsed"}:{rx:oo,fill:r,stroke:n,cssClass:"collapsed-group"}}b(ao,"getCollapsedStyle");async function Le(i,t){let r=ao(t.metadata?.containerType),{fill:n,stroke:c}=r,{nodeStyles:l}=D(t),{shapeSvg:d,bbox:o}=await G(i,t,T(t)),{theme:h,themeVariables:a}=U();ct(d,t.colorIndex,h,a.borderColorArray);let e=t.padding??8,s=o.height,p=Math.max(o.width+e*2,ro,t?.width??0),m=Math.max(s+le+ne+e*2,t?.height??0),f=-p/2,g=-m/2,u=-(le+ne)/2,y=d.select(".label");y&&(t.useHtmlLabels??dt(U())?y.attr("transform",`translate(${-o.width/2}, ${-o.height/2+u})`):y.attr("transform",`translate(0, ${-o.height/2+u})`));let x;if(t.look==="handDrawn"){let M=k.svg(d),B=v(t,{fill:n,stroke:c,...r.strokeWidth===void 0?{}:{strokeWidth:r.strokeWidth},...n==="none"?{fillWeight:0}:{fillStyle:"solid"}}),V=M.path(tt(f,g,p,m,r.rx),B);x=d.insert(()=>V,":first-child"),x.attr("class","basic label-container "+r.cssClass).attr("style",q(t.cssStyles))}else x=d.insert("rect",":first-child"),x.attr("class","basic label-container "+r.cssClass).attr("style",l).attr("rx",r.rx).attr("ry",r.rx).attr("x",f).attr("y",g).attr("width",p).attr("height",m).attr("fill",n).attr("stroke",c),r.strokeWidth!==void 0&&x.attr("stroke-width",r.strokeWidth+"px");let S=g+e+s+le;d.append("line").attr("class","collapsed-separator").attr("x1",f+8).attr("y1",S).attr("x2",f+p-8).attr("y2",S).attr("stroke",c).attr("stroke-dasharray","3, 3");let w=S+ne/2,$=2.5,E=10;for(let M=-1;M<=1;M++)d.append("circle").attr("class","collapsed-indicator").attr("cx",M*E).attr("cy",w).attr("r",$).attr("fill",c);return P(t,x),t.calcIntersect=function(M,B){return N.rect(M,B)},t.intersect=function(M){return N.rect(t,M)},d}b(Le,"collapsedGroup");function et(i,t,r,n){return i.insert("polygon",":first-child").attr("points",n.map(function(c){return c.x+","+c.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-t/2+","+r/2+")")}b(et,"insertPolygonShape");var io=["right","left","up","down"],ce="point",no=b(i=>{let t=new Set;for(let r of i)switch(r){case"x":t.add("right"),t.add("left");break;case"y":t.add("up"),t.add("down");break;default:t.add(r);break}return t},"expandAndDeduplicateDirections"),lo=b(i=>io.filter(t=>i.has(t)).join("|")||ce,"getDirectionKey"),Oe={"right|left|up|down":b(({height:i,midpoint:t,padding:r,width:n})=>[{x:0,y:0},{x:t,y:0},{x:n/2,y:2*r},{x:n-t,y:0},{x:n,y:0},{x:n,y:-i/3},{x:n+2*r,y:-i/2},{x:n,y:-2*i/3},{x:n,y:-i},{x:n-t,y:-i},{x:n/2,y:-i-2*r},{x:t,y:-i},{x:0,y:-i},{x:0,y:-2*i/3},{x:-2*r,y:-i/2},{x:0,y:-i/3}],"right|left|up|down"),"right|left|up":b(({height:i,midpoint:t,width:r})=>[{x:t,y:0},{x:r-t,y:0},{x:r,y:-i/2},{x:r-t,y:-i},{x:t,y:-i},{x:0,y:-i/2}],"right|left|up"),"right|left|down":b(({height:i,midpoint:t,width:r})=>[{x:0,y:0},{x:t,y:-i},{x:r-t,y:-i},{x:r,y:0}],"right|left|down"),"right|up|down":b(({height:i,midpoint:t,width:r})=>[{x:0,y:0},{x:r,y:-t},{x:r,y:-i+t},{x:0,y:-i}],"right|up|down"),"left|up|down":b(({height:i,midpoint:t,width:r})=>[{x:r,y:0},{x:0,y:-t},{x:0,y:-i+t},{x:r,y:-i}],"left|up|down"),"right|left":b(({height:i,midpoint:t,padding:r,width:n})=>[{x:t,y:0},{x:t,y:-r},{x:n-t,y:-r},{x:n-t,y:0},{x:n,y:-i/2},{x:n-t,y:-i},{x:n-t,y:-i+r},{x:t,y:-i+r},{x:t,y:-i},{x:0,y:-i/2}],"right|left"),"up|down":b(({height:i,midpoint:t,padding:r,width:n})=>[{x:n/2,y:0},{x:0,y:-r},{x:t,y:-r},{x:t,y:-i+r},{x:0,y:-i+r},{x:n/2,y:-i},{x:n,y:-i+r},{x:n-t,y:-i+r},{x:n-t,y:-r},{x:n,y:-r}],"up|down"),"right|up":b(({height:i,midpoint:t,width:r})=>[{x:0,y:0},{x:r,y:-t},{x:0,y:-i}],"right|up"),"right|down":b(({height:i,width:t})=>[{x:0,y:0},{x:t,y:0},{x:0,y:-i}],"right|down"),"left|up":b(({height:i,midpoint:t,width:r})=>[{x:r,y:0},{x:0,y:-t},{x:r,y:-i}],"left|up"),"left|down":b(({height:i,width:t})=>[{x:t,y:0},{x:0,y:0},{x:t,y:-i}],"left|down"),right:b(({height:i,midpoint:t,padding:r,width:n})=>[{x:t,y:-r},{x:t,y:-r},{x:n-t,y:-r},{x:n-t,y:0},{x:n,y:-i/2},{x:n-t,y:-i},{x:n-t,y:-i+r},{x:t,y:-i+r},{x:t,y:-i+r}],"right"),left:b(({height:i,midpoint:t,padding:r,width:n})=>[{x:t,y:0},{x:t,y:-r},{x:n-t,y:-r},{x:n-t,y:-i+r},{x:t,y:-i+r},{x:t,y:-i},{x:0,y:-i/2}],"left"),up:b(({height:i,midpoint:t,padding:r,width:n})=>[{x:t,y:-r},{x:t,y:-i+r},{x:0,y:-i+r},{x:n/2,y:-i},{x:n,y:-i+r},{x:n-t,y:-i+r},{x:n-t,y:-r}],"up"),down:b(({height:i,midpoint:t,padding:r,width:n})=>[{x:n/2,y:0},{x:0,y:-r},{x:t,y:-r},{x:t,y:-i+r},{x:n-t,y:-i+r},{x:n-t,y:-r},{x:n,y:-r}],"down"),[ce]:()=>[{x:0,y:0}]},co=b((i,t,r,n)=>{let c=no(i),l=(r.padding??0)/2,d=t.height+4*l,o=d/2,h=n??t.width+2*o+2*l,a=lo(c);return(Oe[a]??Oe[ce])({height:d,midpoint:o,padding:l,width:h})},"getArrowPoints");async function Ve(i,t){let r=t,{shapeSvg:n,bbox:c}=await G(i,r,T(r)),l=r.padding??0,d=c.height+2*l,o=d/2,h=c.width+2*o+l,a=r.width??0,s=r.positioned&&(r.widthInColumns??1)>1&&a>h?a:h,p=co(r.directions??[],c,r,s),m=et(n,s,d,p);return m.attr("style",r.style??null),P(r,m),r.intersect=function(f){return N.polygon(r,p,f)},n}b(Ve,"block_arrow");async function We(i,t,{config:{themeVariables:r}}){let{labelStyles:n,nodeStyles:c}=D(t);t.labelStyle=n;let{shapeSvg:l,bbox:d,label:o}=await G(i,t,T(t)),h=r?.nodeBorder??r?.lineColor??"currentColor",a=t.padding??12,e=18,s=12,p=Math.max(d.width+a*2,t.width??0,90),m=Math.max(d.height+a*2+e,t.height??0),f=-m/2,{cssStyles:g}=t,u=l.insert("g",":first-child").attr("class","basic label-container");if(t.look==="handDrawn"){let S=k.svg(l).path(tt(-p/2,f,p,m,s),v(t,{}));u.node()?.appendChild(S),g&&u.attr("style",g)}else u.append("rect").attr("x",-p/2).attr("y",f).attr("width",p).attr("height",m).attr("rx",s).attr("ry",s).attr("style",c);u.append("line").attr("x1",-p/2).attr("y1",f+e).attr("x2",p/2).attr("y2",f+e).attr("style",`stroke:${h};stroke-width:1px`);for(let x=0;x<3;x++)u.append("circle").attr("cx",-p/2+12+x*9).attr("cy",f+e/2).attr("r",2.5).attr("style",`fill:${h};stroke:none`);u.append("rect").attr("class","browser-address-bar").attr("x",-p/2+44).attr("y",f+4).attr("width",Math.max(p-56,10)).attr("height",e-8).attr("rx",3).attr("ry",3).attr("style",`fill:none;stroke:${h};stroke-width:1px;opacity:0.6`),P(t,u);let y=f+e+(m-e)/2;return o.attr("transform",`translate(${-(d.width/2)-(d.x-(d.left??0))}, ${y-d.height/2-(d.y-(d.top??0))})`),t.intersect=function(x){return N.rect(t,x)},l}b(We,"browser");var zt=12;async function _e(i,t){let{labelStyles:r,nodeStyles:n}=D(t);t.labelStyle=r;let c=t.padding??0,l=t.look==="neo"?28:c,d=t.look==="neo"?24:c,{shapeSvg:o,bbox:h}=await G(i,t,T(t)),a=(t?.width??h.width)+(t.look==="neo"?l*2:l+zt),e=(t?.height??h.height)+(t.look==="neo"?d*2:d),s=0,p=a,m=-e,f=0,g=[{x:s+zt,y:m},{x:p,y:m},{x:p,y:f},{x:s,y:f},{x:s,y:m+zt},{x:s+zt,y:m}],u,{cssStyles:y}=t;if(t.look==="handDrawn"){let x=k.svg(o),S=v(t,{}),w=_(g),$=x.path(w,S);u=o.insert(()=>$,":first-child").attr("transform",`translate(${-a/2}, ${e/2})`),y&&u.attr("style",y)}else u=et(o,a,e,g);return n&&u.attr("style",n),P(t,u),t.intersect=function(x){return N.polygon(t,g,x)},o}b(_e,"card");function Ye(i,t){let{nodeStyles:r}=D(t);t.label="";let n=i.insert("g").attr("class",T(t)).attr("id",t.domId??t.id),{cssStyles:c}=t,l=Math.max(28,t.width??0),d=[{x:0,y:l/2},{x:l/2,y:0},{x:0,y:-l/2},{x:-l/2,y:0}],o=k.svg(n),h=v(t,{});t.look!=="handDrawn"&&(h.roughness=0,h.fillStyle="solid");let a=_(d),e=o.path(a,h),s=n.insert(()=>e,":first-child");return c&&t.look!=="handDrawn"&&s.selectAll("path").attr("style",c),r&&t.look!=="handDrawn"&&s.selectAll("path").attr("style",r),t.width=28,t.height=28,t.intersect=function(p){return N.polygon(t,d,p)},n}b(Ye,"choice");async function Jt(i,t,r){let{labelStyles:n,nodeStyles:c}=D(t);t.labelStyle=n;let{shapeSvg:l,bbox:d,halfPadding:o}=await G(i,t,T(t),{ignoreMinWidth:!0}),h=16,a=r?.padding??o,e=Math.sqrt(d.width**2+d.height**2)/2,s=t.look==="neo"?e+h:e+a,p,{cssStyles:m}=t;if(t.look==="handDrawn"){let f=k.svg(l),g=v(t,{}),u=f.circle(0,0,s*2,g);p=l.insert(()=>u,":first-child"),p.attr("class","basic label-container").attr("style",q(m))}else p=l.insert("circle",":first-child").attr("class","basic label-container").attr("style",c).attr("r",s).attr("cx",0).attr("cy",0);return P(t,p),t.calcIntersect=function(f,g){let u=f.width/2;return N.circle(f,u,g)},t.intersect=function(f){return X.info("Circle intersect",t,s,f),N.circle(t,s,f)},l}b(Jt,"circle");async function Fe(i,t){let r=t,n=["node",r.cssClasses,r.class].filter(Boolean).join(" "),{shapeSvg:c,bbox:l,halfPadding:d}=await G(i,r,n),o=c.insert("rect",":first-child"),h=r.padding??0,a=r.positioned?r.width??0:l.width+h,e=r.positioned?r.height??0:l.height+h,s=r.positioned?-a/2:-l.width/2-d,p=r.positioned?-e/2:-l.height/2-d;return o.attr("class","basic cluster composite label-container").attr("style",r.style??null).attr("rx",r.rx??null).attr("ry",r.ry??null).attr("x",s).attr("y",p).attr("width",a).attr("height",e),P(r,o),r.intersect=function(m){return N.rect(r,m)},c}b(Fe,"composite");async function Xe(i,t,{config:{themeVariables:r}}){let{labelStyles:n,nodeStyles:c}=D(t);t.labelStyle=n;let{shapeSvg:l,bbox:d,label:o}=await G(i,t,T(t)),h=r?.nodeBorder??r?.lineColor??"currentColor",a=t.padding??12,e=20,s=12,p=Math.max(d.width+a*2,t.width??0,90),m=Math.max(d.height+a*2+e,t.height??0),f=-m/2,{cssStyles:g}=t,u=l.insert("g",":first-child").attr("class","basic label-container");if(t.look==="handDrawn"){let S=k.svg(l).path(tt(-p/2,f,p,m,s),v(t,{}));u.node()?.appendChild(S),g&&u.attr("style",g)}else u.append("rect").attr("x",-p/2).attr("y",f).attr("width",p).attr("height",m).attr("rx",s).attr("ry",s).attr("style",c);u.append("text").attr("x",-p/2+12).attr("y",f+16).attr("class","console-glyph").attr("style",`font-family:monospace;font-weight:bold;font-size:14px;fill:${h}`).text(">_"),P(t,u);let y=f+e+(m-e)/2;return o.attr("transform",`translate(${-(d.width/2)-(d.x-(d.left??0))}, ${y-d.height/2-(d.y-(d.top??0))})`),t.intersect=function(x){return N.rect(t,x)},l}b(Xe,"consoleWindow");function ho(i){let t=Math.cos(Math.PI/4),r=Math.sin(Math.PI/4),n=i*2,c={x:n/2*t,y:n/2*r},l={x:-(n/2)*t,y:n/2*r},d={x:-(n/2)*t,y:-(n/2)*r},o={x:n/2*t,y:-(n/2)*r};return`M ${l.x},${l.y} L ${o.x},${o.y}
M ${c.x},${c.y} L ${d.x},${d.y}`}b(ho,"createLine");function Ue(i,t){let{labelStyles:r,nodeStyles:n}=D(t);t.labelStyle=r,t.label="";let c=i.insert("g").attr("class",T(t)).attr("id",t.domId??t.id),l=Math.max(30,t?.width??0),{cssStyles:d}=t,o=k.svg(c),h=v(t,{});t.look!=="handDrawn"&&(h.roughness=0,h.fillStyle="solid");let a=o.circle(0,0,l*2,h),e=ho(l),s=o.path(e,h),p=c.insert(()=>a,":first-child");return p.insert(()=>s),p.attr("class","outer-path"),d&&t.look!=="handDrawn"&&p.selectAll("path").attr("style",d),n&&t.look!=="handDrawn"&&p.selectAll("path").attr("style",n),P(t,p),t.intersect=function(m){return X.info("crossedCircle intersect",t,{radius:l,point:m}),N.circle(t,l,m)},c}b(Ue,"crossedCircle");function Tt(i,t,r,n=100,c=0,l=180){let d=[],o=c*Math.PI/180,e=(l*Math.PI/180-o)/(n-1);for(let s=0;s<n;s++){let p=o+s*e,m=i+r*Math.cos(p),f=t+r*Math.sin(p);d.push({x:-m,y:-f})}return d}b(Tt,"generateCirclePoints");async function qe(i,t){let{labelStyles:r,nodeStyles:n}=D(t);t.labelStyle=r;let{shapeSvg:c,bbox:l,label:d}=await G(i,t,T(t)),o=t.look==="neo"?18:t.padding??0,h=t.look==="neo"?12:t.padding??0,a=l.width+o,e=l.height+h,s=Math.max(5,e*.1),{cssStyles:p}=t,m=[...Tt(a/2,-e/2,s,30,-90,0),{x:-a/2-s,y:s},...Tt(a/2+s*2,-s,s,20,-180,-270),...Tt(a/2+s*2,s,s,20,-90,-180),{x:-a/2-s,y:-e/2},...Tt(a/2,e/2,s,20,0,90)],f=[{x:a/2,y:-e/2-s},{x:-a/2,y:-e/2-s},...Tt(a/2,-e/2,s,20,-90,0),{x:-a/2-s,y:-s},...Tt(a/2+a*.1,-s,s,20,-180,-270),...Tt(a/2+a*.1,s,s,20,-90,-180),{x:-a/2-s,y:e/2},...Tt(a/2,e/2,s,20,0,90),{x:-a/2,y:e/2+s},{x:a/2,y:e/2+s}],g=k.svg(c),u=v(t,{fill:"none"});t.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");let x=_(m).replace("Z",""),S=g.path(x,u),w=_(f),$=g.path(w,{...u}),E=c.insert("g",":first-child");return E.insert(()=>$,":first-child").attr("stroke-opacity",0),E.insert(()=>S,":first-child"),E.attr("class","text"),p&&t.look!=="handDrawn"&&E.selectAll("path").attr("style",p),n&&t.look!=="handDrawn"&&E.selectAll("path").attr("style",n),E.attr("transform",`translate(${s}, 0)`),d.attr("transform",`translate(${-a/2+s-(l.x-(l.left??0))},${-e/2+(t.padding??0)/2-(l.y-(l.top??0))})`),P(t,E),t.intersect=function(M){return N.polygon(t,f,M)},c}b(qe,"curlyBraceLeft");function Gt(i,t,r,n=100,c=0,l=180){let d=[],o=c*Math.PI/180,e=(l*Math.PI/180-o)/(n-1);for(let s=0;s<n;s++){let p=o+s*e,m=i+r*Math.cos(p),f=t+r*Math.sin(p);d.push({x:m,y:f})}return d}b(Gt,"generateCirclePoints");async function Ze(i,t){let{labelStyles:r,nodeStyles:n}=D(t);t.labelStyle=r;let{shapeSvg:c,bbox:l,label:d}=await G(i,t,T(t)),o=t.look==="neo"?18:t.padding??0,h=t.look==="neo"?12:t.padding??0,a=l.width+(t.look==="neo"?o*2:o),e=l.height+(t.look==="neo"?h*2:h),s=Math.max(5,e*.1),{cssStyles:p}=t,m=[...Gt(a/2,-e/2,s,20,-90,0),{x:a/2+s,y:-s},...Gt(a/2+s*2,-s,s,20,-180,-270),...Gt(a/2+s*2,s,s,20,-90,-180),{x:a/2+s,y:e/2},...Gt(a/2,e/2,s,20,0,90)],f=[{x:-a/2,y:-e/2-s},{x:a/2,y:-e/2-s},...Gt(a/2,-e/2,s,20,-90,0),{x:a/2+s,y:-s},...Gt(a/2+s*2,-s,s,20,-180,-270),...Gt(a/2+s*2,s,s,20,-90,-180),{x:a/2+s,y:e/2},...Gt(a/2,e/2,s,20,0,90),{x:a/2,y:e/2+s},{x:-a/2,y:e/2+s}],g=k.svg(c),u=v(t,{fill:"none"});t.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");let x=_(m).replace("Z",""),S=g.path(x,u),w=_(f),$=g.path(w,{...u}),E=c.insert("g",":first-child");return E.insert(()=>$,":first-child").attr("stroke-opacity",0),E.insert(()=>S,":first-child"),E.attr("class","text"),p&&t.look!=="handDrawn"&&E.selectAll("path").attr("style",p),n&&t.look!=="handDrawn"&&E.selectAll("path").attr("style",n),E.attr("transform",`translate(${-s}, 0)`),d.attr("transform",`translate(${-a/2+(t.padding??0)/2-(l.x-(l.left??0))},${-e/2+(t.padding??0)/2-(l.y-(l.top??0))})`),P(t,E),t.intersect=function(M){return N.polygon(t,f,M)},c}b(Ze,"curlyBraceRight");function st(i,t,r,n=100,c=0,l=180){let d=[],o=c*Math.PI/180,e=(l*Math.PI/180-o)/(n-1);for(let s=0;s<n;s++){let p=o+s*e,m=i+r*Math.cos(p),f=t+r*Math.sin(p);d.push({x:-m,y:-f})}return d}b(st,"generateCirclePoints");async function ze(i,t){let{labelStyles:r,nodeStyles:n}=D(t);t.labelStyle=r;let{shapeSvg:c,bbox:l,label:d}=await G(i,t,T(t)),o=t.look==="neo"?18:t.padding??0,h=t.look==="neo"?12:t.padding??0,a=l.width+(t.look==="neo"?o*2:o),e=l.height+(t.look==="neo"?h*2:h),s=Math.max(5,e*.1),{cssStyles:p}=t,m=[...st(a/2,-e/2,s,30,-90,0),{x:-a/2-s,y:s},...st(a/2+s*2,-s,s,20,-180,-270),...st(a/2+s*2,s,s,20,-90,-180),{x:-a/2-s,y:-e/2},...st(a/2,e/2,s,20,0,90)],f=[...st(-a/2+s+s/2,-e/2,s,20,-90,-180),{x:a/2-s/2,y:s},...st(-a/2-s/2,-s,s,20,0,90),...st(-a/2-s/2,s,s,20,-90,0),{x:a/2-s/2,y:-s},...st(-a/2+s+s/2,e/2,s,30,-180,-270)],g=[{x:a/2,y:-e/2-s},{x:-a/2,y:-e/2-s},...st(a/2,-e/2,s,20,-90,0),{x:-a/2-s,y:-s},...st(a/2+s*2,-s,s,20,-180,-270),...st(a/2+s*2,s,s,20,-90,-180),{x:-a/2-s,y:e/2},...st(a/2,e/2,s,20,0,90),{x:-a/2,y:e/2+s},{x:a/2-s-s/2,y:e/2+s},...st(-a/2+s+s/2,-e/2,s,20,-90,-180),{x:a/2-s/2,y:s},...st(-a/2-s/2,-s,s,20,0,90),...st(-a/2-s/2,s,s,20,-90,0),{x:a/2-s/2,y:-s},...st(-a/2+s+s/2,e/2,s,30,-180,-270)],u=k.svg(c),y=v(t,{fill:"none"});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");let S=_(m).replace("Z",""),w=u.path(S,y),E=_(f).replace("Z",""),M=u.path(E,y),B=_(g),V=u.path(B,{...y}),R=c.insert("g",":first-child");return R.insert(()=>V,":first-child").attr("stroke-opacity",0),R.insert(()=>w,":first-child"),R.insert(()=>M,":first-child"),R.attr("class","text"),p&&t.look!=="handDrawn"&&R.selectAll("path").attr("style",p),n&&t.look!=="handDrawn"&&R.selectAll("path").attr("style",n),R.attr("transform",`translate(${s-s/4}, 0)`),d.attr("transform",`translate(${-a/2+(t.padding??0)/2-(l.x-(l.left??0))},${-e/2+(t.padding??0)/2-(l.y-(l.top??0))})`),P(t,R),t.intersect=function(A){return N.polygon(t,g,A)},c}b(ze,"curlyBraces");async function Je(i,t){let{labelStyles:r,nodeStyles:n}=D(t);t.labelStyle=r;let c=t.padding??0,l=t.look==="neo"?16:c,d=t.look==="neo"?12:c,o=20,h=5,{shapeSvg:a,bbox:e}=await G(i,t,T(t)),s=Math.max(h,e.height+d*2,t?.height??0),p=s/2,m=p-Math.sqrt(Math.max(0,p**2-(e.height/2)**2)),f=Math.max(s/4,m),g=Math.max(o,e.width+l*2+f*2,(e.width+l*2)*1.25,t?.width??0),{cssStyles:u}=t,y=k.svg(a),x=v(t,{});t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");let S=g,w=s,$=S-p,E=w/4,M=[{x:$,y:0},{x:E,y:0},{x:0,y:w/2},{x:E,y:w},{x:$,y:w},...nt(-$,-w/2,p,50,270,90)],B=_(M),V=y.path(B,x),R=a.insert(()=>V,":first-child");return R.attr("class","basic label-container outer-path"),u&&t.look!=="handDrawn"&&R.selectChildren("path").attr("style",u),n&&t.look!=="handDrawn"&&R.selectChildren("path").attr("style",n),R.attr("transform",`translate(${-g/2}, ${-s/2})`),P(t,R),t.intersect=function(A){return N.polygon(t,M,A)},a}b(Je,"curvedTrapezoid");async function Ke(i,t){let{labelStyles:r,nodeStyles:n}=D(t);t.labelStyle=r;let{shapeSvg:c,bbox:l,label:d}=await G(i,t,T(t)),o=t.padding??20,h=Math.max(l.width+o*2,t.width??0,100),a=Math.min(Math.max(h*.23,16),56),e=a*.27,s=Math.max(l.height+o*2,t.height?t.height-(2*a-e):0),p=Math.min(h*.177,s*.45),m=s+2*a-e,f=-m/2,g=f+2*a-e,u=c.insert("g",":first-child").attr("class","basic label-container"),{cssStyles:y}=t;if(t.look==="handDrawn"){let B=k.svg(c),V=v(t,{}),R=B.path(tt(-h/2,g,h,s,p),V),A=B.circle(0,f+a,a*2,V);u.insert(()=>A,":first-child"),u.insert(()=>R,":first-child"),y&&u.attr("style",y)}else u.append("rect").attr("x",-h/2).attr("y",g).attr("width",h).attr("height",s).attr("rx",p).attr("ry",p).attr("style",n),u.append("circle").attr("cx",0).attr("cy",f+a).attr("r",a).attr("style",n);P(t,u);let x=g+s/2;d.attr("transform",`translate(${-(l.width/2)-(l.x-(l.left??0))}, ${x-l.height/2-(l.y-(l.top??0))})`);let S=f+a,w=Math.asin(Math.min(1,(g-S)/a))*180/Math.PI,M=[...nt(0,-S,a,24,180+w,-w),...nt(-(-h/2+p),-(g+p),p,12,90,0),...nt(-(-h/2+p),-(m/2-p),p,12,360,270),...nt(-(h/2-p),-(m/2-p),p,12,270,180),...nt(-(h/2-p),-(g+p),p,12,180,90)];return t.intersect=function(B){return N.polygon(t,M,B)},c}b(Ke,"person");var po=b((i,t,r,n,c,l)=>[`M${i},${t+l}`,`a${c},${l} 0,0,0 ${r},0`,`a${c},${l} 0,0,0 ${-r},0`,`l0,${n}`,`a${c},${l} 0,0,0 ${r},0`,`l0,${-n}`].join(" "),"createCylinderPathD"),mo=b((i,t,r,n,c,l)=>[`M${i},${t+l}`,`M${i+r},${t+l}`,`a${c},${l} 0,0,0 ${-r},0`,`l0,${n}`,`a${c},${l} 0,0,0 ${r},0`,`l0,${-n}`].join(" "),"createOuterCylinderPathD"),fo=b((i,t,r,n,c,l)=>[`M${i-r/2},${-n/2}`,`a${c},${l} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),Qe=8,ts=8;async function es(i,t){let{labelStyles:r,nodeStyles:n}=D(t);t.labelStyle=r;let c=t.padding??0,l=t.look==="neo"?24:c,d=t.look==="neo"?24:c,o=t.width??0;if(t.width&&(t.width=t.width-d,t.width<ts&&(t.width=ts)),t.height){let x=o/2/(2.5+o/50);t.height=t.height-l-x*3,t.height<Qe&&(t.height=Qe)}let{shapeSvg:h,bbox:a,label:e}=await G(i,t,T(t)),s=Math.max(t.width??0,a.width)+d,p=s/2,m=p/(2.5+s/50),f=Math.max(t.height??0,a.height)+l+m,g,{cssStyles:u}=t;if(t.look==="handDrawn"){let y=k.svg(h),x=mo(0,0,s,f,p,m),S=fo(0,m,s,f,p,m),w=v(t,{}),$=y.path(x,w),E=y.path(S,v(t,{fill:"none"}));g=h.insert(()=>E,":first-child"),g=h.insert(()=>$,":first-child"),g.attr("class","basic label-container"),u&&g.attr("style",u)}else{let y=po(0,0,s,f,p,m);g=h.insert("path",":first-child").attr("d",y).attr("class","basic label-container outer-path").attr("style",q(u)).attr("style",n)}return g.attr("label-offset-y",m),g.attr("transform",`translate(${-s/2}, ${-(f/2+m)})`),P(t,g),e.attr("transform",`translate(${-(a.width/2)-(a.x-(a.left??0))}, ${-(a.height/2)+(t.padding??0)/1.5-(a.y-(a.top??0))})`),t.intersect=function(y){let x=N.rect(t,y),S=x.x-(t.x??0);if(p!=0&&(Math.abs(S)<(t.width??0)/2||Math.abs(S)==(t.width??0)/2&&Math.abs(x.y-(t.y??0))>(t.height??0)/2-m)){let w=m*m*(1-S*S/(p*p));w>0&&(w=Math.sqrt(w)),w=m-w,y.y-(t.y??0)>0&&(w=-w),x.y+=w}return x},h}b(es,"cylinder");async function gt(i,t,r){let{labelStyles:n,nodeStyles:c}=D(t);t.labelStyle=n;let{shapeSvg:l,bbox:d}=await G(i,t,T(t)),o=Math.max(d.width+r.labelPaddingX*2,t?.width||0),h=Math.max(d.height+r.labelPaddingY*2,t?.height||0),a=-o/2,e=-h/2,s,{rx:p,ry:m}=t,{cssStyles:f}=t;if(r?.rx&&r.ry&&(p=r.rx,m=r.ry),t.look==="handDrawn"){let g=k.svg(l),u=v(t,{}),y=p||m?g.path(tt(a,e,o,h,p||0),u):g.rectangle(a,e,o,h,u);s=l.insert(()=>y,":first-child"),s.attr("class","basic label-container").attr("style",q(f))}else s=l.insert("rect",":first-child"),s.attr("class","basic label-container").attr("style",c).attr("rx",q(p)).attr("ry",q(m)).attr("x",a).attr("y",e).attr("width",o).attr("height",h);return P(t,s,t.look==="handDrawn"?void 0:{width:o,height:h}),t.calcIntersect=function(g,u){return N.rect(g,u)},t.intersect=function(g){return N.rect(t,g)},l}b(gt,"drawRect");async function ss(i,t){let{cssClasses:r,labelPaddingX:n,labelPaddingY:c,padding:l,width:d,height:o}=t,h={rx:0,ry:0,classes:r??"",labelPaddingX:n??(l??0)*2,labelPaddingY:c??l??0},a=await gt(i,t,h);if(t.look==="handDrawn"){let m=k.svg(a),f=v(t,{}),g=a.select(".basic.label-container > path:nth-child(2)"),u=g.node();if(!u)return a;let y=null;if(u instanceof SVGGraphicsElement)y=u.getBBox();else return a;return a.insert(()=>m.line(y.x,y.y,y.x+y.width,y.y,f),".basic.label-container g.label"),a.insert(()=>m.line(y.x,y.y+y.height,y.x+y.width,y.y+y.height,f),".basic.label-container g.label"),g.remove(),a}let e=a.select(".basic.label-container"),s=(Number(e.attr("width"))||d)??0,p=(Number(e.attr("height"))||o)??0;return s>0&&p>0&&e.attr("stroke-dasharray",`${s} ${p}`),a}b(ss,"datastore");async function rs(i,t){let{labelStyles:r,nodeStyles:n}=D(t);t.labelStyle=r;let c=t.look==="neo"?16:t.padding??0,l=t.look==="neo"?16:t.padding??0,{shapeSvg:d,bbox:o,label:h}=await G(i,t,T(t)),a=o.width+c,e=o.height+l,s=e*.2,p=-a/2,m=-e/2-s/2,{cssStyles:f}=t,g=k.svg(d),u=v(t,{});t.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");let y=[{x:p,y:m+s},{x:-p,y:m+s},{x:-p,y:-m},{x:p,y:-m},{x:p,y:m},{x:-p,y:m},{x:-p,y:m+s}],x=g.polygon(y.map(w=>[w.x,w.y]),u),S=d.insert(()=>x,":first-child");return S.attr("class","basic label-container outer-path"),f&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",f),n&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",n),h.attr("transform",`translate(${p+(t.padding??0)/2-(o.x-(o.left??0))}, ${m+s+(t.padding??0)/2-(o.y-(o.top??0))})`),P(t,S),t.intersect=function(w){return N.rect(t,w)},d}b(rs,"dividedRectangle");async function os(i,t){let{labelStyles:r,nodeStyles:n}=D(t),c=t.look==="neo"?12:5;t.labelStyle=r;let l=t.padding??0,d=t.look==="neo"?16:l,{shapeSvg:o,bbox:h}=await G(i,t,T(t),{ignoreMinWidth:!0}),a=Math.sqrt(h.width**2+h.height**2)/2,e=(t?.width?t?.width/2:a)+(d??0),s=e+c,p,{cssStyles:m}=t;if(t.look==="handDrawn"){let f=k.svg(o),g=v(t,{roughness:.2,strokeWidth:2.5}),u=v(t,{roughness:.2,strokeWidth:1.5}),y=f.circle(0,0,s*2,g),x=f.circle(0,0,e*2,u);p=o.insert("g",":first-child"),p.attr("class",q(t.cssClasses)).attr("style",q(m)),p.node()?.appendChild(y),p.node()?.appendChild(x)}else{p=o.insert("g",":first-child");let f=p.insert("circle",":first-child"),g=p.insert("circle");p.attr("class","basic label-container").attr("style",n),f.attr("class","outer-circle").attr("style",n).attr("r",s).attr("cx",0).attr("cy",0),g.attr("class","inner-circle").attr("style",n).attr("r",e).attr("cx",0).attr("cy",0)}return P(t,p),t.intersect=function(f){return X.info("DoubleCircle intersect",t,s,f),N.circle(t,s,f)},o}b(os,"doublecircle");async function as(i,t){let{labelStyles:r,nodeStyles:n}=D(t);t.labelStyle=r;let{shapeSvg:c,bbox:l,halfPadding:d}=await G(i,t,T(t)),{theme:o,themeVariables:h}=U();ct(c,t.colorIndex,o,h.borderColorArray);let a=d??10,e=l.width/2+a*2,s=l.height/2+a*2,p,{cssStyles:m}=t;if(t.look==="handDrawn"){let f=k.svg(c),g=v(t,{}),u=f.ellipse(0,0,e*2,s*2,g);p=c.insert(()=>u,":first-child"),p.attr("class","basic label-container"),m&&p.attr("style",m)}else p=c.insert("ellipse",":first-child").attr("class","basic label-container").attr("style",n).attr("rx",e).attr("ry",s).attr("cx",0).attr("cy",0);return t.width=e*2,t.height=s*2,P(t,p),t.calcIntersect=function(f,g){let u=f.width/2,y=f.height/2;return N.ellipse(f,u,y,g)},t.intersect=function(f){return N.ellipse(t,e,s,f)},c}b(as,"usecaseEllipse");function is(i,t,{config:{themeVariables:r}}){let{labelStyles:n,nodeStyles:c}=D(t);t.label="",t.labelStyle=n;let l=i.insert("g").attr("class",T(t)).attr("id",t.domId??t.id),d=7,{cssStyles:o}=t,h=k.svg(l),{nodeBorder:a}=r,e=v(t,{fillStyle:"solid"});t.look!=="handDrawn"&&(e.roughness=0);let s=h.circle(0,0,d*2,e),p=l.insert(()=>s,":first-child");return p.selectAll("path").attr("style",`fill: ${a} !important;`),o&&o.length>0&&t.look!=="handDrawn"&&p.selectAll("path").attr("style",o),c&&t.look!=="handDrawn"&&p.selectAll("path").attr("style",c),P(t,p),t.intersect=function(m){return X.info("filledCircle intersect",t,{radius:d,point:m}),N.circle(t,d,m)},l}b(is,"filledCircle");var ns=10,ls=10;async function cs(i,t){let{labelStyles:r,nodeStyles:n}=D(t);t.labelStyle=r;let c=t.padding??0,l=t.look==="neo"?c*2:c;(t.width||t.height)&&(t.height=t?.height??0,t.height<ns&&(t.height=ns),t.width=(t?.width??0)-l-l/2,t.width<ls&&(t.width=ls));let{shapeSvg:d,bbox:o,label:h}=await G(i,t,T(t)),a=(t?.width?t?.width:o.width)+(l??0),e=t?.height?t?.height:a+o.height,s=e,p=[{x:0,y:-e},{x:s,y:-e},{x:s/2,y:0}],{cssStyles:m}=t,f=k.svg(d),g=v(t,{});t.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");let u=_(p),y=f.path(u,g),x=d.insert(()=>y,":first-child").attr("transform",`translate(${-e/2}, ${e/2})`).attr("class","outer-path");return m&&t.look!=="handDrawn"&&x.selectChildren("path").attr("style",m),n&&t.look!=="handDrawn"&&x.selectChildren("path").attr("style",n),t.width=a,t.height=e,P(t,x),h.attr("transform",`translate(${-o.width/2-(o.x-(o.left??0))}, ${-e/2+(t.padding??0)/2+(o.y-(o.top??0))})`),t.intersect=function(S){return X.info("Triangle intersect",t,p,S),N.polygon(t,p,S)},d}b(cs,"flippedTriangle");async function hs(i,t){let{labelStyles:r,nodeStyles:n}=D(t);t.labelStyle=r;let{shapeSvg:c,bbox:l,label:d}=await G(i,t,T(t)),o=t.padding??12,h=Math.max(l.width+o*2,t.width??0,90),a=l.height+o*2,e=Math.max(Math.min(a*.16,14),8),s=Math.max(a+e,t.height??0),p=s-e,m=Math.max(h*.38,28),f=-s/2,g=[{x:-h/2,y:f},{x:-h/2+m,y:f},{x:-h/2+m,y:f+e},{x:h/2,y:f+e},{x:h/2,y:s/2},{x:-h/2,y:s/2}],u=[`M${g[0].x},${g[0].y}`,...g.slice(1).map(w=>`L${w.x},${w.y}`),"Z"].join(" "),{cssStyles:y}=t,x;if(t.look==="handDrawn"){let $=k.svg(c).path(u,v(t,{}));x=c.insert(()=>$,":first-child").attr("class","basic label-container"),y&&x.attr("style",y)}else x=c.insert("path",":first-child").attr("d",u).attr("class","basic label-container").attr("style",n);t.look==="handDrawn"?P(t,x):P(t,x,{width:h,height:s});let S=f+e+p/2;return d.attr("transform",`translate(${-(l.width/2)-(l.x-(l.left??0))}, ${S-l.height/2-(l.y-(l.top??0))})`),t.intersect=function(w){return N.polygon(t,g,w)},c}b(hs,"folder");function ps(i,t,{dir:r,config:{state:n,themeVariables:c}}){let{nodeStyles:l}=D(t);t.label="";let d=i.insert("g").attr("class",T(t)).attr("id",t.domId??t.id),{cssStyles:o}=t,h=Math.max(70,t?.width??0),a=Math.max(10,t?.height??0);(r==="LR"||r==="RL")&&(h=Math.max(10,t?.width??0),a=Math.max(70,t?.height??0));let e=-1*h/2,s=-1*a/2,p=k.svg(d),m=v(t,{stroke:c.lineColor,fill:c.lineColor});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");let f=p.rectangle(e,s,h,a,m),g=d.insert(()=>f,":first-child");o&&t.look!=="handDrawn"&&g.selectAll("path").attr("style",o),l&&t.look!=="handDrawn"&&g.selectAll("path").attr("style",l),P(t,g);let u=n?.padding??0;return t.width&&t.height&&(t.width+=u/2||0,t.height+=u/2||0),t.intersect=function(y){return N.rect(t,y)},d}b(ps,"forkJoin");async function ms(i,t){let{labelStyles:r,nodeStyles:n}=D(t);t.labelStyle=r;let c=15,l=10,d=t.look==="neo"?16:t.padding??0,o=t.look==="neo"?12:t.padding??0;(t.width||t.height)&&(t.height=(t?.height??0)-o*2,t.height<l&&(t.height=l),t.width=(t?.width??0)-d*2,t.width<c&&(t.width=c));let{shapeSvg:h,bbox:a}=await G(i,t,T(t)),e=(t?.height?t?.height:Math.max(l,a.height))+o*2,s=e/2,p=s-Math.sqrt(Math.max(0,s**2-(a.height/2)**2)),m=(t?.width?t?.width:Math.max(c,a.width)+p*2)+d*2,{cssStyles:f}=t,g=k.svg(h),u=v(t,{});t.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");let y=[{x:-m/2,y:-e/2},{x:m/2-s,y:-e/2},...nt(-m/2+s,0,s,50,90,270),{x:m/2-s,y:e/2},{x:-m/2,y:e/2}],x=_(y),S=g.path(x,u),w=h.insert(()=>S,":first-child");return w.attr("class","basic label-container outer-path"),f&&t.look!=="handDrawn"&&w.selectChildren("path").attr("style",f),n&&t.look!=="handDrawn"&&w.selectChildren("path").attr("style",n),P(t,w),t.intersect=function($){return X.info("Pill intersect",t,{radius:s,point:$}),N.polygon(t,y,$)},h}b(ms,"halfRoundedRectangle");var go=b((i,t,r,n,c)=>[`M${i+c},${t}`,`L${i+r-c},${t}`,`L${i+r},${t-n/2}`,`L${i+r-c},${t-n}`,`L${i+c},${t-n}`,`L${i},${t-n/2}`,"Z"].join(" "),"createHexagonPathD");async function ds(i,t){let{labelStyles:r,nodeStyles:n}=D(t),c=t.look==="neo"?3.5:4;t.labelStyle=r;let l=t.padding??0,d=70,o=32,h=t.look==="neo"?d:l,a=t.look==="neo"?o:l;if(t.width||t.height){let S=(t.height??0)/c;t.width=(t?.width??0)-2*S-a,t.height=(t.height??0)-h}let{shapeSvg:e,bbox:s}=await G(i,t,T(t)),p=(t?.height?t?.height:s.height)+h,m=p/c,f=(t?.width?t?.width:s.width)+2*m+a,g=[{x:m,y:0},{x:f-m,y:0},{x:f,y:-p/2},{x:f-m,y:-p},{x:m,y:-p},{x:0,y:-p/2}],u,{cssStyles:y}=t;if(t.look==="handDrawn"){let x=k.svg(e),S=v(t,{}),w=go(0,0,f,p,m),$=x.path(w,S);u=e.insert(()=>$,":first-child").attr("transform",`translate(${-f/2}, ${p/2})`),y&&u.attr("style",y)}else u=et(e,f,p,g);return n&&u.attr("style",n),t.width=f,t.height=p,P(t,u),t.intersect=function(x){return N.polygon(t,g,x)},e}b(ds,"hexagon");async function fs(i,t){let{labelStyles:r,nodeStyles:n}=D(t);t.label="",t.labelStyle=r;let{shapeSvg:c}=await G(i,t,T(t)),l=Math.max(30,t?.width??0),d=Math.max(30,t?.height??0),{cssStyles:o}=t,h=k.svg(c),a=v(t,{});t.look!=="handDrawn"&&(a.roughness=0,a.fillStyle="solid");let e=[{x:0,y:0},{x:l,y:0},{x:0,y:d},{x:l,y:d}],s=_(e),p=h.path(s,a),m=c.insert(()=>p,":first-child");return m.attr("class","basic label-container outer-path"),o&&t.look!=="handDrawn"&&m.selectChildren("path").attr("style",o),n&&t.look!=="handDrawn"&&m.selectChildren("path").attr("style",n),m.attr("transform",`translate(${-l/2}, ${-d/2})`),P(t,m),t.intersect=function(f){return X.info("Pill intersect",t,{points:e}),N.polygon(t,e,f)},c}b(fs,"hourglass");async function gs(i,t,{config:{themeVariables:r,flowchart:n}}){let{labelStyles:c}=D(t);t.labelStyle=c;let l=t.assetHeight??48,d=t.assetWidth??48,o=Math.max(l,d),h=n?.wrappingWidth;t.width=Math.max(o,h??0);let{shapeSvg:a,bbox:e,label:s}=await G(i,t,"icon-shape default"),p=t.pos==="t",m=o,f=o,{nodeBorder:g}=r,{stylesMap:u}=ut(t),y=-f/2,x=-m/2,S=t.label?8:0,w=k.svg(a),$=v(t,{stroke:"none",fill:"none"});t.look!=="handDrawn"&&($.roughness=0,$.fillStyle="solid");let E=w.rectangle(y,x,f,m,$),M=Math.max(f,e.width),B=m+e.height+S,V=w.rectangle(-M/2,-B/2,M,B,{...$,fill:"transparent",stroke:"none"}),R=a.insert(()=>E,":first-child"),A=a.insert(()=>V);if(t.icon){let j=a.append("g");j.html(`<g>${await lt(t.icon,{height:o,width:o,fallbackPrefix:""})}</g>`);let C=j.node().getBBox(),I=C.width,L=C.height,H=C.x,O=C.y;j.attr("transform",`translate(${-I/2-H},${p?e.height/2+S/2-L/2-O:-e.height/2-S/2-L/2-O})`),j.attr("style",`color: ${u.get("stroke")??g};`)}return s.attr("transform",`translate(${-e.width/2-(e.x-(e.left??0))},${p?-B/2:B/2-e.height})`),R.attr("transform",`translate(0,${p?e.height/2+S/2:-e.height/2-S/2})`),P(t,A),t.intersect=function(j){if(X.info("iconSquare intersect",t,j),!t.label)return N.rect(t,j);let C=t.x??0,I=t.y??0,L=t.height??0,H=[];return p?H=[{x:C-e.width/2,y:I-L/2},{x:C+e.width/2,y:I-L/2},{x:C+e.width/2,y:I-L/2+e.height+S},{x:C+f/2,y:I-L/2+e.height+S},{x:C+f/2,y:I+L/2},{x:C-f/2,y:I+L/2},{x:C-f/2,y:I-L/2+e.height+S},{x:C-e.width/2,y:I-L/2+e.height+S}]:H=[{x:C-f/2,y:I-L/2},{x:C+f/2,y:I-L/2},{x:C+f/2,y:I-L/2+m},{x:C+e.width/2,y:I-L/2+m},{x:C+e.width/2/2,y:I+L/2},{x:C-e.width/2,y:I+L/2},{x:C-e.width/2,y:I-L/2+m},{x:C-f/2,y:I-L/2+m}],N.polygon(t,H,j)},a}b(gs,"icon");async function ys(i,t,{config:{themeVariables:r,flowchart:n}}){let{labelStyles:c}=D(t);t.labelStyle=c;let l=t.assetHeight??48,d=t.assetWidth??48,o=Math.max(l,d),h=n?.wrappingWidth;t.width=Math.max(o,h??0);let{shapeSvg:a,bbox:e,label:s}=await G(i,t,"icon-shape default"),p=20,m=t.label?8:0,f=t.pos==="t",{nodeBorder:g,mainBkg:u}=r,{stylesMap:y}=ut(t),x=k.svg(a),S=v(t,{});t.look!=="handDrawn"&&(S.roughness=0,S.fillStyle="solid");let w=y.get("fill");S.stroke=w??u;let $=a.append("g");t.icon&&$.html(`<g>${await lt(t.icon,{height:o,width:o,fallbackPrefix:""})}</g>`);let E=$.node().getBBox(),M=E.width,B=E.height,V=E.x,R=E.y,A=Math.max(M,B)*Math.SQRT2+p*2,j=x.circle(0,0,A,S),C=Math.max(A,e.width),I=A+e.height+m,L=x.rectangle(-C/2,-I/2,C,I,{...S,fill:"transparent",stroke:"none"}),H=a.insert(()=>j,":first-child"),O=a.insert(()=>L);return $.attr("transform",`translate(${-M/2-V},${f?e.height/2+m/2-B/2-R:-e.height/2-m/2-B/2-R})`),$.attr("style",`color: ${y.get("stroke")??g};`),s.attr("transform",`translate(${-e.width/2-(e.x-(e.left??0))},${f?-I/2:I/2-e.height})`),H.attr("transform",`translate(0,${f?e.height/2+m/2:-e.height/2-m/2})`),P(t,O),t.intersect=function(W){return X.info("iconSquare intersect",t,W),N.rect(t,W)},a}b(ys,"iconCircle");async function us(i,t,{config:{themeVariables:r,flowchart:n}}){let{labelStyles:c}=D(t);t.labelStyle=c;let l=t.assetHeight??48,d=t.assetWidth??48,o=Math.max(l,d),h=n?.wrappingWidth;t.width=Math.max(o,h??0);let{shapeSvg:a,bbox:e,halfPadding:s,label:p}=await G(i,t,"icon-shape default"),m=t.pos==="t",f=o+s*2,g=o+s*2,{nodeBorder:u,mainBkg:y}=r,{stylesMap:x}=ut(t),S=-g/2,w=-f/2,$=t.label?8:0,E=k.svg(a),M=v(t,{});t.look!=="handDrawn"&&(M.roughness=0,M.fillStyle="solid");let B=x.get("fill");M.stroke=B??y;let V=E.path(tt(S,w,g,f,5),M),R=Math.max(g,e.width),A=f+e.height+$,j=E.rectangle(-R/2,-A/2,R,A,{...M,fill:"transparent",stroke:"none"}),C=a.insert(()=>V,":first-child").attr("class","icon-shape2"),I=a.insert(()=>j);if(t.icon){let L=a.append("g");L.html(`<g>${await lt(t.icon,{height:o,width:o,fallbackPrefix:""})}</g>`);let H=L.node().getBBox(),O=H.width,W=H.height,F=H.x,z=H.y;L.attr("transform",`translate(${-O/2-F},${m?e.height/2+$/2-W/2-z:-e.height/2-$/2-W/2-z})`),L.attr("style",`color: ${x.get("stroke")??u};`)}return p.attr("transform",`translate(${-e.width/2-(e.x-(e.left??0))},${m?-A/2:A/2-e.height})`),C.attr("transform",`translate(0,${m?e.height/2+$/2:-e.height/2-$/2})`),P(t,I),t.intersect=function(L){if(X.info("iconSquare intersect",t,L),!t.label)return N.rect(t,L);let H=t.x??0,O=t.y??0,W=t.height??0,F=[];return m?F=[{x:H-e.width/2,y:O-W/2},{x:H+e.width/2,y:O-W/2},{x:H+e.width/2,y:O-W/2+e.height+$},{x:H+g/2,y:O-W/2+e.height+$},{x:H+g/2,y:O+W/2},{x:H-g/2,y:O+W/2},{x:H-g/2,y:O-W/2+e.height+$},{x:H-e.width/2,y:O-W/2+e.height+$}]:F=[{x:H-g/2,y:O-W/2},{x:H+g/2,y:O-W/2},{x:H+g/2,y:O-W/2+f},{x:H+e.width/2,y:O-W/2+f},{x:H+e.width/2/2,y:O+W/2},{x:H-e.width/2,y:O+W/2},{x:H-e.width/2,y:O-W/2+f},{x:H-g/2,y:O-W/2+f}],N.polygon(t,F,L)},a}b(us,"iconRounded");async function bs(i,t,{config:{themeVariables:r,flowchart:n}}){let{labelStyles:c}=D(t);t.labelStyle=c;let l=t.assetHeight??48,d=t.assetWidth??48,o=Math.max(l,d),h=n?.wrappingWidth;t.width=Math.max(o,h??0);let{shapeSvg:a,bbox:e,halfPadding:s,label:p}=await G(i,t,"icon-shape default"),m=t.pos==="t",f=o+s*2,g=o+s*2,{nodeBorder:u,mainBkg:y}=r,{stylesMap:x}=ut(t),S=-g/2,w=-f/2,$=t.label?8:0,E=k.svg(a),M=v(t,{});t.look!=="handDrawn"&&(M.roughness=0,M.fillStyle="solid");let B=x.get("fill");M.stroke=B??y;let V=E.path(tt(S,w,g,f,.1),M),R=Math.max(g,e.width),A=f+e.height+$,j=E.rectangle(-R/2,-A/2,R,A,{...M,fill:"transparent",stroke:"none"}),C=a.insert(()=>V,":first-child"),I=a.insert(()=>j);if(t.icon){let L=a.append("g");L.html(`<g>${await lt(t.icon,{height:o,width:o,fallbackPrefix:""})}</g>`);let H=L.node().getBBox(),O=H.width,W=H.height,F=H.x,z=H.y;L.attr("transform",`translate(${-O/2-F},${m?e.height/2+$/2-W/2-z:-e.height/2-$/2-W/2-z})`),L.attr("style",`color: ${x.get("stroke")??u};`)}return p.attr("transform",`translate(${-e.width/2-(e.x-(e.left??0))},${m?-A/2:A/2-e.height})`),C.attr("transform",`translate(0,${m?e.height/2+$/2:-e.height/2-$/2})`),P(t,I),t.intersect=function(L){if(X.info("iconSquare intersect",t,L),!t.label)return N.rect(t,L);let H=t.x??0,O=t.y??0,W=t.height??0,F=[];return m?F=[{x:H-e.width/2,y:O-W/2},{x:H+e.width/2,y:O-W/2},{x:H+e.width/2,y:O-W/2+e.height+$},{x:H+g/2,y:O-W/2+e.height+$},{x:H+g/2,y:O+W/2},{x:H-g/2,y:O+W/2},{x:H-g/2,y:O-W/2+e.height+$},{x:H-e.width/2,y:O-W/2+e.height+$}]:F=[{x:H-g/2,y:O-W/2},{x:H+g/2,y:O-W/2},{x:H+g/2,y:O-W/2+f},{x:H+e.width/2,y:O-W/2+f},{x:H+e.width/2/2,y:O+W/2},{x:H-e.width/2,y:O+W/2},{x:H-e.width/2,y:O-W/2+f},{x:H-g/2,y:O-W/2+f}],N.polygon(t,F,L)},a}b(bs,"iconSquare");async function xs(i,t,{config:{flowchart:r}}){let n=new Image;n.src=t?.img??"",await n.decode();let c=Number(n.naturalWidth.toString().replace("px","")),l=Number(n.naturalHeight.toString().replace("px",""));t.imageAspectRatio=c/l;let{labelStyles:d}=D(t);t.labelStyle=d;let o=r?.wrappingWidth;t.defaultWidth=r?.wrappingWidth;let h=Math.max(t.label?o??0:0,t?.assetWidth??c),a=t.constraint==="on"&&t?.assetHeight?t.assetHeight*t.imageAspectRatio:h,e=t.constraint==="on"?a/t.imageAspectRatio:t?.assetHeight??l;t.width=Math.max(a,o??0);let{shapeSvg:s,bbox:p,label:m}=await G(i,t,"image-shape default"),f=t.pos==="t",g=-a/2,u=-e/2,y=t.label?8:0,x=k.svg(s),S=v(t,{});t.look!=="handDrawn"&&(S.roughness=0,S.fillStyle="solid");let w=x.rectangle(g,u,a,e,S),$=Math.max(a,p.width),E=e+p.height+y,M=x.rectangle(-$/2,-E/2,$,E,{...S,fill:"none",stroke:"none"}),B=s.insert(()=>w,":first-child"),V=s.insert(()=>M);if(t.img){let R=s.append("image");R.attr("href",t.img),R.attr("width",a),R.attr("height",e),R.attr("preserveAspectRatio","none"),R.attr("transform",`translate(${-a/2},${f?E/2-e:-E/2})`)}return m.attr("transform",`translate(${-p.width/2-(p.x-(p.left??0))},${f?-e/2-p.height/2-y/2:e/2-p.height/2+y/2})`),B.attr("transform",`translate(0,${f?p.height/2+y/2:-p.height/2-y/2})`),P(t,V),t.intersect=function(R){if(X.info("iconSquare intersect",t,R),!t.label)return N.rect(t,R);let A=t.x??0,j=t.y??0,C=t.height??0,I=[];return f?I=[{x:A-p.width/2,y:j-C/2},{x:A+p.width/2,y:j-C/2},{x:A+p.width/2,y:j-C/2+p.height+y},{x:A+a/2,y:j-C/2+p.height+y},{x:A+a/2,y:j+C/2},{x:A-a/2,y:j+C/2},{x:A-a/2,y:j-C/2+p.height+y},{x:A-p.width/2,y:j-C/2+p.height+y}]:I=[{x:A-a/2,y:j-C/2},{x:A+a/2,y:j-C/2},{x:A+a/2,y:j-C/2+e},{x:A+p.width/2,y:j-C/2+e},{x:A+p.width/2/2,y:j+C/2},{x:A-p.width/2,y:j+C/2},{x:A-p.width/2,y:j-C/2+e},{x:A-a/2,y:j-C/2+e}],N.polygon(t,I,R)},s}b(xs,"imageSquare");async function Ss(i,t){let{labelStyles:r,nodeStyles:n}=D(t);t.labelStyle=r;let c=t.padding??0,l=c,d=t.look==="neo"?c*2:c,{shapeSvg:o,bbox:h}=await G(i,t,T(t)),a=Math.max(h.height+l*2,t.height??0),e=Math.max(h.width+d*2,(t.width??0)-a),s=[{x:0,y:0},{x:e,y:0},{x:e+3*a/6,y:-a},{x:-3*a/6,y:-a}],p,{cssStyles:m}=t;if(t.look==="handDrawn"){let f=k.svg(o),g=v(t,{}),u=_(s),y=f.path(u,g);p=o.insert(()=>y,":first-child").attr("transform",`translate(${-e/2}, ${a/2})`),m&&p.attr("style",m)}else p=et(o,e,a,s);return n&&p.attr("style",n),t.width=e,t.height=a,P(t,p),t.intersect=function(f){return N.polygon(t,s,f)},o}b(Ss,"inv_trapezoid");async function ws(i,t){let{shapeSvg:r,bbox:n,label:c}=await G(i,t,"label"),l=r.insert("rect",":first-child");return l.attr("width",.1).attr("height",.1),r.attr("class","label edgeLabel"),c.attr("transform",`translate(${-(n.width/2)-(n.x-(n.left??0))}, ${-(n.height/2)-(n.y-(n.top??0))})`),P(t,l),t.intersect=function(h){return N.rect(t,h)},r}b(ws,"labelRect");async function Ns(i,t){let{labelStyles:r,nodeStyles:n}=D(t);t.labelStyle=r;let c=t.padding??0,l=c,d=t.look==="neo"?c*2:c,{shapeSvg:o,bbox:h}=await G(i,t,T(t)),a=Math.max(h.height+l,t.height??0),e=Math.max(h.width+d,(t.width??0)-a),s=[{x:0,y:0},{x:e+3*a/6,y:0},{x:e,y:-a},{x:-(3*a)/6,y:-a}],p,{cssStyles:m}=t;if(t.look==="handDrawn"){let f=k.svg(o),g=v(t,{}),u=_(s),y=f.path(u,g);p=o.insert(()=>y,":first-child").attr("transform",`translate(${-e/2}, ${a/2})`),m&&p.attr("style",m)}else p=et(o,e,a,s);return n&&p.attr("style",n),t.width=e,t.height=a,P(t,p),t.intersect=function(f){return N.polygon(t,s,f)},o}b(Ns,"lean_left");async function $s(i,t){let{labelStyles:r,nodeStyles:n}=D(t);t.labelStyle=r;let c=t.padding??0,l=c,d=t.look==="neo"?c*2:c,{shapeSvg:o,bbox:h}=await G(i,t,T(t)),a=Math.max(h.height+l,t.height??0),e=Math.max(h.width+d,(t.width??0)-a),s=[{x:-3*a/6,y:0},{x:e,y:0},{x:e+3*a/6,y:-a},{x:0,y:-a}],p,{cssStyles:m}=t;if(t.look==="handDrawn"){let f=k.svg(o),g=v(t,{}),u=_(s),y=f.path(u,g);p=o.insert(()=>y,":first-child").attr("transform",`translate(${-e/2}, ${a/2})`),m&&p.attr("style",m)}else p=et(o,e,a,s);return n&&p.attr("style",n),t.width=e,t.height=a,P(t,p),t.intersect=function(f){return N.polygon(t,s,f)},o}b($s,"lean_right");function Ds(i,t){let{labelStyles:r,nodeStyles:n}=D(t);t.label="",t.labelStyle=r;let c=i.insert("g").attr("class",T(t)).attr("id",t.domId??t.id),{cssStyles:l}=t,d=Math.max(35,t?.width??0),o=Math.max(35,t?.height??0),h=7,a=[{x:d,y:0},{x:0,y:o+h/2},{x:d-2*h,y:o+h/2},{x:0,y:2*o},{x:d,y:o-h/2},{x:2*h,y:o-h/2}],e=k.svg(c),s=v(t,{});t.look!=="handDrawn"&&(s.roughness=0,s.fillStyle="solid");let p=_(a),m=e.path(p,s),f=c.insert(()=>m,":first-child");return f.attr("class","outer-path"),l&&t.look!=="handDrawn"&&f.selectAll("path").attr("style",l),n&&t.look!=="handDrawn"&&f.selectAll("path").attr("style",n),f.attr("transform",`translate(-${d/2},${-o})`),P(t,f),t.intersect=function(g){return X.info("lightningBolt intersect",t,g),N.polygon(t,a,g)},c}b(Ds,"lightningBolt");var yo=b((i,t,r,n,c,l,d)=>[`M${i},${t+l}`,`a${c},${l} 0,0,0 ${r},0`,`a${c},${l} 0,0,0 ${-r},0`,`l0,${n}`,`a${c},${l} 0,0,0 ${r},0`,`l0,${-n}`,`M${i},${t+l+d}`,`a${c},${l} 0,0,0 ${r},0`].join(" "),"createCylinderPathD"),uo=b((i,t,r,n,c,l,d)=>[`M${i},${t+l}`,`M${i+r},${t+l}`,`a${c},${l} 0,0,0 ${-r},0`,`l0,${n}`,`a${c},${l} 0,0,0 ${r},0`,`l0,${-n}`,`M${i},${t+l+d}`,`a${c},${l} 0,0,0 ${r},0`].join(" "),"createOuterCylinderPathD"),bo=b((i,t,r,n,c,l)=>[`M${i-r/2},${-n/2}`,`a${c},${l} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),Ps=10,vs=10;async function ks(i,t){let{labelStyles:r,nodeStyles:n}=D(t);t.labelStyle=r;let c=t.padding??0,l=t.look==="neo"?16:c,d=t.look==="neo"?24:c;if(t.width||t.height){let y=t.width??0;t.width=(t.width??0)-l,t.width<vs&&(t.width=vs);let S=y/2/(2.5+y/50);t.height=(t.height??0)-d-S*3,t.height<Ps&&(t.height=Ps)}let{shapeSvg:o,bbox:h,label:a}=await G(i,t,T(t)),e=(t?.width?t?.width:h.width)+l*2,s=e/2,p=s/(2.5+e/50),m=(t?.height?t?.height:h.height)+p+d*2,f=m*.1,g,{cssStyles:u}=t;if(t.look==="handDrawn"){let y=k.svg(o),x=uo(0,0,e,m,s,p,f),S=bo(0,p,e,m,s,p),w=v(t,{}),$=y.path(x,w),E=y.path(S,w);o.insert(()=>E,":first-child").attr("class","line"),g=o.insert(()=>$,":first-child"),g.attr("class","basic label-container"),u&&g.attr("style",u)}else{let y=yo(0,0,e,m,s,p,f);g=o.insert("path",":first-child").attr("d",y).attr("class","basic label-container outer-path").attr("style",q(u)).attr("style",n)}return g.attr("label-offset-y",p),g.attr("transform",`translate(${-e/2}, ${-(m/2+p)})`),P(t,g),a.attr("transform",`translate(${-(h.width/2)-(h.x-(h.left??0))}, ${-(h.height/2)+p-(h.y-(h.top??0))})`),t.intersect=function(y){let x=N.rect(t,y),S=x.x-(t.x??0);if(s!=0&&(Math.abs(S)<(t.width??0)/2||Math.abs(S)==(t.width??0)/2&&Math.abs(x.y-(t.y??0))>(t.height??0)/2-p)){let w=p*p*(1-S*S/(s*s));w>0&&(w=Math.sqrt(w)),w=p-w,y.y-(t.y??0)>0&&(w=-w),x.y+=w}return x},o}b(ks,"linedCylinder");async function Ts(i,t){let{labelStyles:r,nodeStyles:n}=D(t);t.labelStyle=r;let c=t.padding??0,l=t.look==="neo"?16:c,d=t.look==="neo"?12:c;if(t.width||t.height){let w=t.width;t.width=(w??0)*10/11-l*2,t.width<10&&(t.width=10),t.height=(t?.height??0)-d*2,t.height<10&&(t.height=10)}let{shapeSvg:o,bbox:h,label:a}=await G(i,t,T(t)),e=(t?.width?t?.width:h.width)+(l??0)*2,s=(t?.height?t?.height:h.height)+(d??0)*2,p=t.look==="neo"?s/4:s/8,m=s+p,{cssStyles:f}=t,g=k.svg(o),u=v(t,{});t.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");let y=[{x:-e/2-e/2*.1,y:-m/2},{x:-e/2-e/2*.1,y:m/2},...ht(-e/2-e/2*.1,m/2,e/2+e/2*.1,m/2,p,.8),{x:e/2+e/2*.1,y:-m/2},{x:-e/2-e/2*.1,y:-m/2},{x:-e/2,y:-m/2},{x:-e/2,y:m/2*1.1},{x:-e/2,y:-m/2}],x=g.polygon(y.map(w=>[w.x,w.y]),u),S=o.insert(()=>x,":first-child");return S.attr("class","basic label-container outer-path"),f&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",f),n&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",n),S.attr("transform",`translate(0,${-p/2})`),a.attr("transform",`translate(${-e/2+(t.padding??0)+e/2*.1/2-(h.x-(h.left??0))},${-s/2+(t.padding??0)-p-(h.y-(h.top??0))})`),P(t,S),t.intersect=function(w){return N.polygon(t,y,w)},o}b(Ts,"linedWaveEdgedRect");var xo=56,he=72,Gs=8,Ms=2,So=8,wo={normal:"usecase-actor-shape usecase-actor-normal",hollow:"usecase-actor-hollow",awesome:"usecase-actor-awesome",icon:"usecase-actor-icon"},Es=Math.PI/3,Bs=.6,pe=b((i,t)=>{let r=t*Bs,n=t*Math.sqrt(1-Bs**2),c=Math.cos(Es),l=-Math.sin(Es),d=r*-l,o=i+r*c,h=n*c,a=n*l;return`M ${d-h} ${o-a} L ${d+h} ${o+a}`},"businessMarkerPathForCircle"),No={normal:pe(-24,12),hollow:pe(-23,9),awesome:pe(-21,13),icon:"M 12 -8 L 26 -26"},Cs=b((i,t,r)=>{let n=(t.x??0)-(t.left??0),c=(t.y??0)-(t.top??0);i.attr("transform",`translate(${-t.width/2-n},${r-t.height/2-c})`)},"positionLabel"),_t=b((i,t,r,n,c=!1)=>{if(t.look==="handDrawn"){let o=k.svg(i).path(r,v(t,c?{fill:"none"}:{}));return i.insert(()=>o,":first-child").attr("class",n)}let l=i.append("path").attr("class",n).attr("d",r);return c&&l.attr("fill","none"),l},"appendActorPath"),As=b((i,t,r,n,c,l,d=!1)=>{if(t.look==="handDrawn"){let a=k.svg(i).circle(r,n,c*2,v(t,d?{fill:"none"}:{}));return i.insert(()=>a,":first-child").attr("class",l)}let o=i.append("circle").attr("class",l).attr("cx",r).attr("cy",n).attr("r",c);return d&&o.attr("fill","none"),o},"appendActorCircle"),$o=b((i,t,r)=>{t.business&&i.append("path").attr("class","usecase-business-marker usecase-actor-business-marker").attr("d",No[r]).attr("fill","none").attr("style","stroke: inherit !important; stroke-width: inherit !important")},"appendBusinessActorMarker");async function Rt(i,t,r,n){let{labelStyles:c,nodeStyles:l}=D(t);t.labelStyle=c;let d=r==="icon"||t.stereotype!==void 0?{...t,icon:r==="icon"?void 0:t.icon,stereotype:void 0}:t,{shapeSvg:o,bbox:h,label:a}=await G(i,d,T(t,`usecase-actor-variant usecase-actor-${r}`)),e=t.accessibleName??t.label;e&&o.attr("role","img").attr("aria-label",e),a.attr("class","label actor-label usecase-actor-label");let{theme:s,themeVariables:p}=U();ct(o,t.colorIndex,s,p.borderColorArray);let m,f;if(t.stereotype){let B=await ft(o,`\xAB${t.stereotype}\xBB`,{labelStyle:c,useHtmlLabels:t.useHtmlLabels,padding:0,centerLabel:!0,width:t.wrappingWidth});m=B.label.attr("class","label usecase-stereotype"),f=B.bbox}let g=o.append("g").attr("class",`usecase-actor-glyph ${wo[r]}`).attr("style",l||null);await n(g,t),$o(g,t,r);let u=t.padding??So,y=f?.height??0,x=he+Gs+h.height+(f?y+Ms:0),S=Math.max(xo,h.width,f?.width??0)+u*2,w=x+u*2,$=-x/2;g.attr("transform",`translate(0,${$+he/2})`);let E=$+he+Gs;m&&f&&(E+=y/2,Cs(m,f,E),E+=y/2+Ms),Cs(a,h,E+h.height/2);let M=o.insert("rect",":first-child").attr("class","usecase-actor-outline").attr("x",-S/2).attr("y",-w/2).attr("width",S).attr("height",w).attr("opacity",0).attr("aria-hidden","true");return P(t,M),t.intersect=B=>N.rect(t,B),o}b(Rt,"renderUsecaseActor");var Do=["M 0 -12","C 6.627 -12 12 -17.373 12 -24","C 12 -30.627 6.627 -36 0 -36","C -6.627 -36 -12 -30.627 -12 -24","C -12 -17.373 -6.627 -12 0 -12 Z","M 0 -12 V 8","M -17 -5 H 17","M 0 8 L -15 28","M 0 8 L 15 28"].join(" ");async function Rs(i,t){return Rt(i,t,"normal",(r,n)=>{_t(r,n,Do,"usecase-actor-stick")})}b(Rs,"usecaseActor");var Po=["M 0 -34","C 7.18 -34 13 -28.18 13 -21","C 13 -13.82 7.18 -8 0 -8","C -7.18 -8 -13 -13.82 -13 -21","C -13 -28.18 -7.18 -34 0 -34 Z","M -24 25","C -24 7 -14 -3 0 -3","C 14 -3 24 7 24 25","C 24 28 21 30 18 30","H -18","C -21 30 -24 28 -24 25 Z"].join(" ");async function Hs(i,t){return Rt(i,t,"awesome",(r,n)=>{_t(r,n,Po,"usecase-actor-awesome-silhouette")})}b(Hs,"usecaseActorAwesome");var vo=["M -22 -10","H 22","V 0","H 6","L 22 17","L 13 28","L 0 13","L -13 28","L -22 17","L -6 0","H -22","Z"].join(" ");async function js(i,t){return Rt(i,t,"hollow",(r,n)=>{As(r,n,0,-23,9,"usecase-actor-hollow-head",!0),_t(r,n,vo,"usecase-actor-hollow-body",!0)})}b(js,"usecaseActorHollow");var It=52,Is=42,Ls=-2,ko=b(async(i,t)=>{let r=-It/2,n=Ls-It/2;if(t.look==="handDrawn"){let e=k.svg(i).rectangle(r,n,It,It,v(t,{}));i.insert(()=>e,":first-child").attr("class","usecase-actor-icon-frame")}else i.append("rect").attr("class","usecase-actor-icon-frame").attr("x",r).attr("y",n).attr("width",It).attr("height",It).attr("rx",4).attr("ry",4);let c=t.icon??"",l=await Ne(c.includes(":")?c:`fa:${c}`),d=await lt(c,{height:Is,width:Is,fallbackPrefix:"fa"}),o=i.append("g").attr("class",`usecase-actor-icon-symbol${l?"":" usecase-actor-icon-fallback"}`).attr("aria-hidden","true").html(`<g>${d}</g>`),h=o.node()?.getBBox();h&&o.attr("transform",`translate(${-h.width/2-h.x},${Ls-h.height/2-h.y})`)},"drawIconActor");async function Os(i,t){return Rt(i,t,"icon",ko)}b(Os,"usecaseActorIcon");var Vs=b((i,t,r)=>{let n=(t.x??0)-(t.left??0),c=(t.y??0)-(t.top??0);i.attr("transform",`translate(${-t.width/2-n},${r-t.height/2-c})`)},"positionLabel");async function Ws(i,t){let r=t,{labelStyles:n,nodeStyles:c}=D(t);t.labelStyle=n;let l=r.stereotype?{...t,stereotype:void 0}:t,{shapeSvg:d,bbox:o,halfPadding:h,label:a}=await G(i,l,T(t,"usecase-business-shape"));a.attr("class","label usecase-label");let{theme:e,themeVariables:s}=U();ct(d,t.colorIndex,e,s.borderColorArray);let p,m;if(r.stereotype){let C=await ft(d,`\xAB${r.stereotype}\xBB`,{labelStyle:n,useHtmlLabels:t.useHtmlLabels,padding:0,centerLabel:!0,width:t.wrappingWidth});p=C.label.attr("class","label usecase-stereotype"),m=C.bbox}let f=m?2:0,g=o.height+(m?.height??0)+f,u=Math.max(o.width,m?.width??0),y=h??10,x=u/2+y*2,S=g/2+y*2,w=Math.min(Math.max(y/5,1),y/2),$=u/2+w,E=x-w,M=$/x,B=E/x,V=S*Math.sqrt(Math.max(0,1-M*M)),R=-S*Math.sqrt(Math.max(0,1-B*B));p&&m&&Vs(p,m,-g/2+m.height/2),Vs(a,o,g/2-o.height/2);let A;if(t.look==="handDrawn"){let I=k.svg(d).ellipse(0,0,x*2,S*2,v(t,{}));A=d.insert(()=>I,":first-child").attr("class","basic label-container usecase-business-ellipse")}else A=d.insert("ellipse",":first-child").attr("class","basic label-container usecase-business-ellipse").attr("style",c).attr("rx",x).attr("ry",S).attr("cx",0).attr("cy",0);d.append("path").attr("class","usecase-business-marker").attr("d",`M ${$} ${V} L ${E} ${R}`).attr("fill","none").attr("style",c||null);let j=r.accessibleName??r.label;return j&&d.attr("role","img").attr("aria-label",j),P(t,A),t.calcIntersect=(C,I)=>N.ellipse(C,C.width/2,C.height/2,I),t.intersect=C=>N.ellipse(t,x,S,C),d}b(Ws,"usecaseBusiness");var me=8,_s=4,To=1,de=b((i,t,r,n)=>{let c=(t.x??0)-(t.left??0),l=(t.y??0)-(t.top??0);i.attr("transform",`translate(${r-t.width/2-c},${n-t.height/2-l})`)},"positionLabel"),Go=b(i=>{let t=Number.parseFloat(i??"");return Number.isFinite(t)&&t>=0?t:To},"numericStrokeWidth");async function Ys(i,t){let r=t,{labelStyles:n,nodeStyles:c}=D(t),{stylesMap:l}=ut(t);t.labelStyle=n;let{shapeSvg:d,bbox:o,label:h}=await G(i,t,T(t,"usecase-json-table"));d.attr("role","img"),r.accessibleName&&d.attr("aria-label",r.accessibleName),h.attr("class","label usecase-json-title");let a=d.append("g").attr("class","usecase-json-table-grid"),e=[];for(let C of r.jsonRows??[]){let I=await ft(a,C.key,{labelStyle:n,useHtmlLabels:t.useHtmlLabels,padding:0,centerLabel:!0}),L=await ft(a,C.value,{labelStyle:n,useHtmlLabels:t.useHtmlLabels,padding:0,centerLabel:!0});e.push({key:{label:I.label.attr("class","label usecase-json-key"),bbox:I.bbox},value:{label:L.label.attr("class","label usecase-json-value"),bbox:L.bbox}})}let s=Math.max(0,...e.map(({key:C})=>C.bbox.width))+me*2,p=Math.max(0,...e.map(({value:C})=>C.bbox.width))+me*2,m=o.width+me*2,f=Math.max(m,s+p),g=p+Math.max(0,f-s-p),u=o.height+_s*2,y=e.map(({key:C,value:I})=>Math.max(C.bbox.height,I.bbox.height)+_s*2),x=u+y.reduce((C,I)=>C+I,0),S=Go(l.get("stroke-width")),w=f+S*2,$=x+S*2,E=-f/2,M=-x/2,B=t.look==="handDrawn"?k.svg(d):void 0,V=B?v(t,{}):void 0,R=b((C,I,L,H,O,W)=>{if(B&&V){let F=B.rectangle(L,H,O,W,V);return C.insert(()=>F,":first-child").attr("class",I)}return C.insert("rect",":first-child").attr("class",I).attr("x",L).attr("y",H).attr("width",O).attr("height",W).attr("style",c)},"insertCell"),A=R(d,"label-container usecase-json-border",-w/2,-$/2,w,$);R(a,"usecase-json-cell usecase-json-title-cell",E,M,f,u),a.node()?.append(h.node()),de(h,o,0,M+u/2);let j=M+u;return e.forEach(({key:C,value:I},L)=>{let H=y[L],O=a.append("g").attr("class","usecase-json-row").attr("data-row-index",L).attr("transform",`translate(0,${j})`);R(O,"usecase-json-cell usecase-json-key-cell",E,0,s,H),R(O,"usecase-json-cell usecase-json-value-cell",E+s,0,g,H),O.node()?.append(C.label.node(),I.label.node()),de(C.label,C.bbox,E+s/2,H/2),de(I.label,I.bbox,E+s+g/2,H/2),j+=H}),P(t,A),t.intersect=C=>N.rect(t,C),d}b(Ys,"usecaseJsonTable");async function Fs(i,t){let{labelStyles:r,nodeStyles:n}=D(t);t.labelStyle=r;let c=t.padding??0,l=t.look==="neo"?16:c,d=t.look==="neo"?12:c,o=t.look==="neo"?10:5;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-l*2-2*o,10),t.height=Math.max((t?.height??0)-d*2-2*o,10));let{shapeSvg:h,bbox:a,label:e}=await G(i,t,T(t)),s=(t?.width?t?.width:a.width)+l*2+2*o,p=(t?.height?t?.height:a.height)+d*2+2*o,m=s-2*o,f=p-2*o,g=-m/2,u=-f/2,{cssStyles:y}=t,x=k.svg(h),S=v(t,{}),w=[{x:g-o,y:u+o},{x:g-o,y:u+f+o},{x:g+m-o,y:u+f+o},{x:g+m-o,y:u+f},{x:g+m,y:u+f},{x:g+m,y:u+f-o},{x:g+m+o,y:u+f-o},{x:g+m+o,y:u-o},{x:g+o,y:u-o},{x:g+o,y:u},{x:g,y:u},{x:g,y:u+o}],$=[{x:g,y:u+o},{x:g+m-o,y:u+o},{x:g+m-o,y:u+f},{x:g+m,y:u+f},{x:g+m,y:u},{x:g,y:u}];t.look!=="handDrawn"&&(S.roughness=0,S.fillStyle="solid");let E=_(w),M=x.path(E,S),B=_($),V=x.path(B,S);t.look!=="handDrawn"&&(M=ae(M),V=ae(V));let R=h.insert("g",":first-child");return R.insert(()=>M),R.insert(()=>V),R.attr("class","basic label-container outer-path"),y&&t.look!=="handDrawn"&&R.selectAll("path").attr("style",y),n&&t.look!=="handDrawn"&&R.selectAll("path").attr("style",n),e.attr("transform",`translate(${-(a.width/2)-o-(a.x-(a.left??0))}, ${-(a.height/2)+o-(a.y-(a.top??0))})`),P(t,R),t.intersect=function(A){return N.polygon(t,w,A)},h}b(Fs,"multiRect");async function Xs(i,t){let{labelStyles:r,nodeStyles:n}=D(t);t.labelStyle=r;let{shapeSvg:c,bbox:l,label:d}=await G(i,t,T(t)),o=t.padding??0,h=t.look==="neo"?16:o,a=t.look==="neo"?12:o,e=!0;(t.width||t.height)&&(e=!1,t.width=(t?.width??0)-h*2,t.height=(t?.height??0)-a*3);let s=Math.max(l.width,t?.width??0)+h*2,p=Math.max(l.height,t?.height??0)+a*3,m=t.look==="neo"?p/4:p/8,f=p+(e?m/2:-m/2),g=-s/2,u=-f/2,y=10,{cssStyles:x}=t,S=ht(g-y,u+f+y,g+s-y,u+f+y,m,.8),w=S?.[S.length-1],$=[{x:g-y,y:u+y},{x:g-y,y:u+f+y},...S,{x:g+s-y,y:w.y-y},{x:g+s,y:w.y-y},{x:g+s,y:w.y-2*y},{x:g+s+y,y:w.y-2*y},{x:g+s+y,y:u-y},{x:g+y,y:u-y},{x:g+y,y:u},{x:g,y:u},{x:g,y:u+y}],E=[{x:g,y:u+y},{x:g+s-y,y:u+y},{x:g+s-y,y:w.y-y},{x:g+s,y:w.y-y},{x:g+s,y:u},{x:g,y:u}],M=k.svg(c),B=v(t,{});t.look!=="handDrawn"&&(B.roughness=0,B.fillStyle="solid");let V=_($),R=M.path(V,B),A=_(E),j=M.path(A,B),C=c.insert(()=>R,":first-child");return C.insert(()=>j),C.attr("class","basic label-container outer-path"),x&&t.look!=="handDrawn"&&C.selectAll("path").attr("style",x),n&&t.look!=="handDrawn"&&C.selectAll("path").attr("style",n),C.attr("transform",`translate(0,${-m/2})`),d.attr("transform",`translate(${-(l.width/2)-y-(l.x-(l.left??0))}, ${-(l.height/2)+y-m-(l.y-(l.top??0))})`),P(t,C),t.intersect=function(I){return N.polygon(t,$,I)},c}b(Xs,"multiWaveEdgedRectangle");async function Us(i,t,{config:{themeVariables:r}}){let{labelStyles:n,nodeStyles:c}=D(t);t.labelStyle=n,t.useHtmlLabels||dt(kt())||(t.centerLabel=!0);let{shapeSvg:d,bbox:o,label:h}=await G(i,t,T(t)),a=Math.max(o.width+(t.padding??0)*2,t?.width??0),e=Math.max(o.height+(t.padding??0)*2,t?.height??0),s=-a/2,p=-e/2,{cssStyles:m}=t,f=k.svg(d),g=v(t,{fill:r.noteBkgColor,stroke:r.noteBorderColor});t.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");let u=f.rectangle(s,p,a,e,g),y=d.insert(()=>u,":first-child");return y.attr("class","basic label-container outer-path"),h.attr("class","label noteLabel"),m&&t.look!=="handDrawn"&&y.selectAll("path").attr("style",m),c&&t.look!=="handDrawn"&&y.selectAll("path").attr("style",c),h.attr("transform",`translate(${-o.width/2-(o.x-(o.left??0))}, ${-(o.height/2)-(o.y-(o.top??0))})`),P(t,y),t.intersect=function(x){return N.rect(t,x)},d}b(Us,"note");var Mo=b((i,t,r)=>[`M${i+r/2},${t}`,`L${i+r},${t-r/2}`,`L${i+r/2},${t-r}`,`L${i},${t-r/2}`,"Z"].join(" "),"createDecisionBoxPathD");async function qs(i,t){let{labelStyles:r,nodeStyles:n}=D(t);t.labelStyle=r;let{shapeSvg:c,bbox:l}=await G(i,t,T(t)),d=l.width+(t.padding??0),o=l.height+(t.padding??0),h=d+o,a=.5,e=[{x:h/2,y:0},{x:h,y:-h/2},{x:h/2,y:-h},{x:0,y:-h/2}],s,{cssStyles:p}=t;if(t.look==="handDrawn"){let m=k.svg(c),f=v(t,{}),g=Mo(0,0,h),u=m.path(g,f);s=c.insert(()=>u,":first-child").attr("transform",`translate(${-h/2+a}, ${h/2})`),p&&s.attr("style",p)}else s=et(c,h,h,e),s.attr("transform",`translate(${-h/2+a}, ${h/2})`);return n&&s.attr("style",n),P(t,s),t.calcIntersect=function(m,f){let g=m.width,u=[{x:g/2,y:0},{x:g,y:-g/2},{x:g/2,y:-g},{x:0,y:-g/2}];return N.polygon(m,u,f)},t.intersect=function(m){return this.calcIntersect(t,m)},c}b(qs,"question");async function Zs(i,t){let{labelStyles:r,nodeStyles:n}=D(t);t.labelStyle=r;let c=t.padding??0,l=t.look==="neo"?21:c??0,d=t.look==="neo"?12:c??0,{shapeSvg:o,bbox:h,label:a}=await G(i,t,T(t)),e=h.width+(t.look==="neo"?l*2:l),s=Math.max(h.height+(t.look==="neo"?d*2:d),t.height??0),p=s/4,f=-Math.max(e,(t.width??0)-p)/2,g=-s/2,u=g/2,y=[{x:f+u,y:g},{x:f,y:0},{x:f+u,y:-g},{x:-f,y:-g},{x:-f,y:g}],{cssStyles:x}=t,S=k.svg(o),w=v(t,{});t.look!=="handDrawn"&&(w.roughness=0,w.fillStyle="solid");let $=_(y),E=S.path($,w),M=o.insert(()=>E,":first-child");return M.attr("class","basic label-container outer-path"),x&&t.look!=="handDrawn"&&M.selectAll("path").attr("style",x),n&&t.look!=="handDrawn"&&M.selectAll("path").attr("style",n),M.attr("transform",`translate(${-u/2},0)`),a.attr("transform",`translate(${-u/2-h.width/2-(h.x-(h.left??0))}, ${-(h.height/2)-(h.y-(h.top??0))})`),P(t,M),t.intersect=function(B){return N.polygon(t,y,B)},o}b(Zs,"rect_left_inv_arrow");async function zs(i,t){let{labelStyles:r,nodeStyles:n}=D(t);t.labelStyle=r;let c;t.cssClasses?c="node "+t.cssClasses:c="node default";let l=i.insert("g").attr("class",c).attr("id",t.domId||t.id),d=l.insert("g"),o=l.insert("g").attr("class","label").attr("style",n),h=t.description,a=t.label,e=await ie(o,a,t.labelStyle,!0,!0),s={width:0,height:0};if(dt(U())){let B=e.children[0],V=J(e);s=B.getBoundingClientRect(),V.attr("width",s.width),V.attr("height",s.height)}X.info("Text 2",h);let p=h||[],m=e.getBBox(),f=await ie(o,Array.isArray(p)?p.join("<br/>"):p,t.labelStyle,!0,!0),g=f.children[0],u=J(f);s=g.getBoundingClientRect(),u.attr("width",s.width),u.attr("height",s.height);let y=(t.padding||0)/2;J(f).attr("transform","translate( "+(s.width>m.width?0:(m.width-s.width)/2)+", "+(m.height+y+5)+")"),J(e).attr("transform","translate( "+(s.width<m.width?0:-(m.width-s.width)/2)+", 0)"),s=o.node().getBBox(),o.attr("transform","translate("+-s.width/2+", "+(-s.height/2-y+3)+")");let x=s.width+(t.padding||0),S=s.height+(t.padding||0),w=-s.width/2-y,$=-s.height/2-y,E,M;if(t.look==="handDrawn"){let B=k.svg(l),V=v(t,{}),R=B.path(tt(w,$,x,S,t.rx||0),V),A=B.line(-s.width/2-y,-s.height/2-y+m.height+y,s.width/2+y,-s.height/2-y+m.height+y,V);M=l.insert(()=>(X.debug("Rough node insert CXC",R),A),":first-child"),E=l.insert(()=>(X.debug("Rough node insert CXC",R),R),":first-child")}else E=d.insert("rect",":first-child"),M=d.insert("line"),E.attr("class","outer title-state").attr("style",n).attr("x",-s.width/2-y).attr("y",-s.height/2-y).attr("width",s.width+(t.padding||0)).attr("height",s.height+(t.padding||0)),M.attr("class","divider").attr("x1",-s.width/2-y).attr("x2",s.width/2+y).attr("y1",-s.height/2-y+m.height+y).attr("y2",-s.height/2-y+m.height+y);return P(t,E),t.intersect=function(B){return N.rect(t,B)},l}b(zs,"rectWithTitle");async function Js(i,t,{config:{themeVariables:r}}){let n=r?.radius??5,c={rx:n,ry:n,classes:"",labelPaddingX:(t?.padding??0)*1,labelPaddingY:(t?.padding??0)*1};return gt(i,t,c)}b(Js,"roundedRect");var Ht=8;async function Ks(i,t){let{labelStyles:r,nodeStyles:n}=D(t);t.labelStyle=r;let c=t.look==="neo"?16:t.padding??0,l=t.look==="neo"?12:t.padding??0,{shapeSvg:d,bbox:o,label:h}=await G(i,t,T(t)),a=(t?.width??o.width)+c*2+(t.look==="neo"?Ht:Ht*2),e=(t?.height??o.height)+l*2,s=a-Ht,p=e,m=Ht-a/2,f=-e/2,{cssStyles:g}=t,u=k.svg(d),y=v(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");let x=[{x:m,y:f},{x:m+s,y:f},{x:m+s,y:f+p},{x:m-Ht,y:f+p},{x:m-Ht,y:f},{x:m,y:f},{x:m,y:f+p}],S=u.polygon(x.map($=>[$.x,$.y]),y),w=d.insert(()=>S,":first-child");return w.attr("class","basic label-container outer-path").attr("style",q(g)),n&&t.look!=="handDrawn"&&w.selectAll("path").attr("style",n),g&&t.look!=="handDrawn"&&w.selectAll("path").attr("style",n),h.attr("transform",`translate(${Ht/2-o.width/2-(o.x-(o.left??0))}, ${-(o.height/2)-(o.y-(o.top??0))})`),P(t,w),t.intersect=function($){return N.rect(t,$)},d}b(Ks,"shadedProcess");async function Qs(i,t){let{labelStyles:r,nodeStyles:n}=D(t);t.labelStyle=r;let c=t.padding??0,l=t.look==="neo"?16:c,d=t.look==="neo"?12:c;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-l*2,10),t.height=Math.max((t?.height??0)/1.5-d*2,10));let{shapeSvg:o,bbox:h,label:a}=await G(i,t,T(t)),e=(t?.width?t?.width:h.width)+l*2,s=((t?.height?t?.height:h.height)+d*2)*1.5,p=e,m=s/1.5,f=-p/2,g=-m/2,{cssStyles:u}=t,y=k.svg(o),x=v(t,{});t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");let S=[{x:f,y:g},{x:f,y:g+m},{x:f+p,y:g+m},{x:f+p,y:g-m/2}],w=_(S),$=y.path(w,x),E=o.insert(()=>$,":first-child");return E.attr("class","basic label-container outer-path"),u&&t.look!=="handDrawn"&&E.selectChildren("path").attr("style",u),n&&t.look!=="handDrawn"&&E.selectChildren("path").attr("style",n),E.attr("transform",`translate(0, ${m/4})`),a.attr("transform",`translate(${-p/2+(t.padding??0)-(h.x-(h.left??0))}, ${-m/4+(t.padding??0)-(h.y-(h.top??0))})`),P(t,E),t.intersect=function(M){return N.polygon(t,S,M)},o}b(Qs,"slopedRect");async function tr(i,t){let r=t.padding??0,n=t.look==="neo"?16:r*2,c=t.look==="neo"?12:r,l={rx:0,ry:0,classes:"",labelPaddingX:t.labelPaddingX??n,labelPaddingY:c},d=await gt(i,t,l);if(t.colorIndex!==void 0){let{theme:o,themeVariables:h}=U();ct(d,t.colorIndex,o,h.borderColorArray)}return d}b(tr,"squareRect");var fe=50,Eo=b((i,t,r)=>{let n=i.height+r,c=n*Math.cos(Math.PI/(2*(fe-1))),l=Math.sqrt(Math.max(0,c**2-i.height**2));return{w:Math.max(i.width+n/4+t,1.5*n+(n-c),i.width+t+n-l),h:n}},"stadiumDimensions");async function er(i,t){let{labelStyles:r,nodeStyles:n}=D(t);t.labelStyle=r;let c=t.padding??0,l=t.look==="neo"?40:c,d=t.look==="neo"?24:c,{shapeSvg:o,bbox:h}=await G(i,t,T(t)),{w:a,h:e}=Eo(h,l,d),s=e/2,{cssStyles:p}=t,m=k.svg(o),f=v(t,{});t.look!=="handDrawn"&&(f.roughness=0,f.fillStyle="solid");let g=[{x:-a/2+s,y:-e/2},{x:a/2-s,y:-e/2},...nt(-a/2+s,0,s,fe,90,270),{x:a/2-s,y:e/2},...nt(a/2-s,0,s,fe,270,450)],u=_(g),y=m.path(u,f),x=o.insert(()=>y,":first-child");return x.attr("class","basic label-container outer-path"),p&&t.look!=="handDrawn"&&x.selectChildren("path").attr("style",p),n&&t.look!=="handDrawn"&&x.selectChildren("path").attr("style",n),P(t,x),t.intersect=function(S){return N.polygon(t,g,S)},o}b(er,"stadium");async function sr(i,t){let r={rx:t.look==="neo"?3:5,ry:t.look==="neo"?3:5,classes:"flowchart-node"};return gt(i,t,r)}b(sr,"state");function rr(i,t,{config:{themeVariables:r}}){let{labelStyles:n,nodeStyles:c}=D(t);t.labelStyle=n;let{cssStyles:l}=t,{lineColor:d,stateBorder:o,nodeBorder:h,nodeShadow:a}=r;(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=i.insert("g").attr("class","node default").attr("id",t.domId??t.id),s=k.svg(e),p=v(t,{});t.look!=="handDrawn"&&(p.roughness=0,p.fillStyle="solid");let m=s.circle(0,0,t.width,{...p,stroke:d,strokeWidth:2}),f=o??h,g=(t.width??0)*5/14,u=s.circle(0,0,g,{...p,fill:f,stroke:f,strokeWidth:2,fillStyle:"solid"}),y=e.insert(()=>m,":first-child");if(y.insert(()=>u),t.look!=="handDrawn"&&y.attr("class","outer-path"),l&&y.selectAll("path").attr("style",l),c&&y.selectAll("path").attr("style",c),t.width<25&&a&&t.look!=="handDrawn"){let x=i.node()?.ownerSVGElement?.id??"",S=x?`${x}-drop-shadow-small`:"drop-shadow-small";y.attr("style",`filter:url(#${S})`)}return P(t,y),t.intersect=function(x){return N.circle(t,(t.width??0)/2,x)},e}b(rr,"stateEnd");function or(i,t,{config:{themeVariables:r}}){let{lineColor:n,nodeShadow:c}=r;(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 l=i.insert("g").attr("class","node default").attr("id",t.domId||t.id),d;if(t.look==="handDrawn"){let h=k.svg(l).circle(0,0,t.width,De(n));d=l.insert(()=>h),d.attr("class","state-start").attr("r",(t.width??7)/2).attr("width",t.width??14).attr("height",t.height??14)}else d=l.insert("circle",":first-child"),d.attr("class","state-start").attr("r",(t.width??7)/2).attr("width",t.width??14).attr("height",t.height??14);if(t.width<25&&c&&t.look!=="handDrawn"){let o=i.node()?.ownerSVGElement?.id??"",h=o?`${o}-drop-shadow-small`:"drop-shadow-small";d.attr("style",`filter:url(#${h})`)}return P(t,d),t.intersect=function(o){return N.circle(t,(t.width??7)/2,o)},l}b(or,"stateStart");var Lt=8;async function ar(i,t){let{labelStyles:r,nodeStyles:n}=D(t);t.labelStyle=r;let c=t?.padding??8,l=t.look==="neo"?28:c,d=t.look==="neo"?12:c,{shapeSvg:o,bbox:h}=await G(i,t,T(t)),a=Math.max(h.width+2*Lt+l,t.width??0),e=Math.max(h.height+d,t.height??0),s=a-2*Lt,p=e,m=-a/2,f=-e/2,g=[{x:0,y:0},{x:s,y:0},{x:s,y:-p},{x:0,y:-p},{x:0,y:0},{x:-8,y:0},{x:s+8,y:0},{x:s+8,y:-p},{x:-8,y:-p},{x:-8,y:0}];if(t.look==="handDrawn"){let u=k.svg(o),y=v(t,{}),x=u.rectangle(m,f,s+16,p,y),S=u.line(m+Lt,f,m+Lt,f+p,y),w=u.line(m+Lt+s,f,m+Lt+s,f+p,y);o.insert(()=>S,":first-child"),o.insert(()=>w,":first-child");let $=o.insert(()=>x,":first-child"),{cssStyles:E}=t;$.attr("class","basic label-container").attr("style",q(E)),P(t,$)}else{let u=et(o,s,p,g);n&&u.attr("style",n),P(t,u)}return t.intersect=function(u){return N.polygon(t,g,u)},o}b(ar,"subroutine");var ge=.2;async function ir(i,t){let{labelStyles:r,nodeStyles:n}=D(t);t.labelStyle=r;let c=t.padding??0,l=t.look==="neo"?16:c,d=t.look==="neo"?12:c;(t.width||t.height)&&(t.height=Math.max((t?.height??0)-d*2,10),t.width=Math.max((t?.width??0)-l*2-ge*(t.height+d*2),10));let{shapeSvg:o,bbox:h}=await G(i,t,T(t)),a=(t?.height?t?.height:h.height)+d*2,e=ge*a,s=ge*a,m=(t?.width?t?.width:h.width)+l*2+e-e,f=a,g=-m/2,u=-f/2,{cssStyles:y}=t,x=k.svg(o),S=v(t,{}),w=[{x:g-e/2,y:u},{x:g+m+e/2,y:u},{x:g+m+e/2,y:u+f},{x:g-e/2,y:u+f}],$=[{x:g+m-e/2,y:u+f},{x:g+m+e/2,y:u+f},{x:g+m+e/2,y:u+f-s}];t.look!=="handDrawn"&&(S.roughness=0,S.fillStyle="solid");let E=_(w),M=x.path(E,S),B=_($),V=x.path(B,{...S,fillStyle:"solid"}),R=o.insert(()=>V,":first-child");return R.insert(()=>M,":first-child"),R.attr("class","basic label-container outer-path"),y&&t.look!=="handDrawn"&&R.selectAll("path").attr("style",y),n&&t.look!=="handDrawn"&&R.selectAll("path").attr("style",n),P(t,R),t.intersect=function(A){return N.polygon(t,w,A)},o}b(ir,"taggedRect");async function nr(i,t){let{labelStyles:r,nodeStyles:n}=D(t);t.labelStyle=r;let{shapeSvg:c,bbox:l,label:d}=await G(i,t,T(t)),o=Math.max(l.width+(t.padding??0)*2,t?.width??0),h=Math.max(l.height+(t.padding??0)*2,t?.height??0),a=h/8,e=.2*o,s=.2*h,p=h+a,{cssStyles:m}=t,f=k.svg(c),g=v(t,{});t.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");let u=[{x:-o/2-o/2*.1,y:p/2},...ht(-o/2-o/2*.1,p/2,o/2+o/2*.1,p/2,a,.8),{x:o/2+o/2*.1,y:-p/2},{x:-o/2-o/2*.1,y:-p/2}],y=-o/2+o/2*.1,x=-p/2-s*.4,S=[{x:y+o-e,y:(x+h)*1.3},{x:y+o,y:x+h-s},{x:y+o,y:(x+h)*.9},...ht(y+o,(x+h)*1.25,y+o-e,(x+h)*1.3,-h*.02,.5)],w=_(u),$=f.path(w,g),E=_(S),M=f.path(E,{...g,fillStyle:"solid"}),B=c.insert(()=>M,":first-child");return B.insert(()=>$,":first-child"),B.attr("class","basic label-container outer-path"),m&&t.look!=="handDrawn"&&B.selectAll("path").attr("style",m),n&&t.look!=="handDrawn"&&B.selectAll("path").attr("style",n),B.attr("transform",`translate(0,${-a/2})`),d.attr("transform",`translate(${-o/2+(t.padding??0)-(l.x-(l.left??0))},${-h/2+(t.padding??0)-a/2-(l.y-(l.top??0))})`),P(t,B),t.intersect=function(V){return N.polygon(t,u,V)},c}b(nr,"taggedWaveEdgedRectangle");async function lr(i,t){let{labelStyles:r,nodeStyles:n}=D(t);t.labelStyle=r;let{shapeSvg:c,bbox:l}=await G(i,t,T(t)),d=Math.max(l.width+(t.padding??0),t?.width||0),o=Math.max(l.height+(t.padding??0),t?.height||0),h=-d/2,a=-o/2,e=c.insert("rect",":first-child");return e.attr("class","text").attr("style",n).attr("rx",0).attr("ry",0).attr("x",h).attr("y",a).attr("width",d).attr("height",o),P(t,e),t.intersect=function(s){return N.rect(t,s)},c}b(lr,"text");var Bo=b((i,t,r,n,c,l)=>`M${i},${t}
a${c},${l} 0,0,1 0,${-n}
l${r},0
a${c},${l} 0,0,1 0,${n}
M${r},${-n}
a${c},${l} 0,0,0 0,${n}
l${-r},0`,"createCylinderPathD"),Co=b((i,t,r,n,c,l)=>[`M${i},${t}`,`M${i+r},${t}`,`a${c},${l} 0,0,0 0,${-n}`,`l${-r},0`,`a${c},${l} 0,0,0 0,${n}`,`l${r},0`].join(" "),"createOuterCylinderPathD"),Ao=b((i,t,r,n,c,l)=>[`M${i+r/2},${-n/2}`,`a${c},${l} 0,0,0 0,${n}`].join(" "),"createInnerCylinderPathD"),cr=5,hr=10;async function pr(i,t){let{labelStyles:r,nodeStyles:n}=D(t);t.labelStyle=r;let c=t.padding??0,l=t.look==="neo"?12:c/2,d=t.height??0;if(t.height&&(t.height=t.height-l,t.height<cr&&(t.height=cr)),t.width){let y=d/2/(2.5+d/50);t.width=t.width-l-y*3,t.width<hr&&(t.width=hr)}let{shapeSvg:o,bbox:h,label:a}=await G(i,t,T(t)),e=Math.max(t.height??0,h.height)+l,s=e/2,p=s/(2.5+e/50),m=Math.max(t.width??0,h.width)+p+l,{cssStyles:f}=t,g;if(t.look==="handDrawn"){let u=k.svg(o),y=Co(0,0,m,e,p,s),x=Ao(0,0,m,e,p,s),S=u.path(y,v(t,{})),w=u.path(x,v(t,{fill:"none"}));g=o.insert(()=>w,":first-child"),g=o.insert(()=>S,":first-child"),g.attr("class","basic label-container"),f&&g.attr("style",f)}else{let u=Bo(0,0,m,e,p,s);g=o.insert("path",":first-child").attr("d",u).attr("class","basic label-container").attr("style",q(f)).attr("style",n),g.attr("class","basic label-container outer-path"),f&&g.selectAll("path").attr("style",f),n&&g.selectAll("path").attr("style",n)}return g.attr("label-offset-x",p),g.attr("transform",`translate(${-m/2}, ${e/2} )`),a.attr("transform",`translate(${-(h.width/2)-p-(h.x-(h.left??0))}, ${-(h.height/2)-(h.y-(h.top??0))})`),P(t,g),t.intersect=function(u){let y=N.rect(t,u),x=y.y-(t.y??0);if(s!=0&&(Math.abs(x)<(t.height??0)/2||Math.abs(x)==(t.height??0)/2&&Math.abs(y.x-(t.x??0))>(t.width??0)/2-p)){let S=p*p*(1-x*x/(s*s));S!=0&&(S=Math.sqrt(Math.abs(S))),S=p-S,u.x-(t.x??0)>0&&(S=-S),y.x+=S}return y},o}b(pr,"tiltedCylinder");async function mr(i,t){let{labelStyles:r,nodeStyles:n}=D(t);t.labelStyle=r;let c=t.padding??0,l=(t.look==="neo",c),d=t.look==="neo"?c*2:c,{shapeSvg:o,bbox:h}=await G(i,t,T(t)),a=Math.max(h.height+l,t.height??0),e=Math.max(h.width+d,(t.width??0)-a),s=[{x:-3*a/6,y:0},{x:e+3*a/6,y:0},{x:e,y:-a},{x:0,y:-a}],p,{cssStyles:m}=t;if(t.look==="handDrawn"){let f=k.svg(o),g=v(t,{}),u=_(s),y=f.path(u,g);p=o.insert(()=>y,":first-child").attr("transform",`translate(${-e/2}, ${a/2})`),m&&p.attr("style",m)}else p=et(o,e,a,s);return n&&p.attr("style",n),t.width=e,t.height=a,P(t,p),t.intersect=function(f){return N.polygon(t,s,f)},o}b(mr,"trapezoid");async function dr(i,t){let{labelStyles:r,nodeStyles:n}=D(t);t.labelStyle=r;let c=t.padding??0,l=t.look==="neo"?16:c,d=t.look==="neo"?12:c,o=15,h=5;(t.width||t.height)&&(t.height=(t.height??0)-d*2,t.height<h&&(t.height=h),t.width=(t.width??0)-l*2,t.width<o&&(t.width=o));let{shapeSvg:a,bbox:e}=await G(i,t,T(t)),s=(t?.width?t?.width:e.width)+l*2,p=(t?.height?t?.height:e.height)+d*2,{cssStyles:m}=t,f=k.svg(a),g=v(t,{});t.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");let u=[{x:-s/2*.8,y:-p/2},{x:s/2*.8,y:-p/2},{x:s/2,y:-p/2*.6},{x:s/2,y:p/2},{x:-s/2,y:p/2},{x:-s/2,y:-p/2*.6}],y=_(u),x=f.path(y,g),S=a.insert(()=>x,":first-child");return S.attr("class","basic label-container outer-path"),m&&t.look!=="handDrawn"&&S.selectChildren("path").attr("style",m),n&&t.look!=="handDrawn"&&S.selectChildren("path").attr("style",n),P(t,S),t.intersect=function(w){return N.polygon(t,u,w)},a}b(dr,"trapezoidalPentagon");var fr=10,gr=10;async function yr(i,t){let{labelStyles:r,nodeStyles:n}=D(t);t.labelStyle=r;let c=t.padding??0,l=t.look==="neo"?c*2:c;(t.width||t.height)&&(t.width=((t?.width??0)-l)/2,t.width<gr&&(t.width=gr),t.height=t?.height??0,t.height<fr&&(t.height=fr));let{shapeSvg:d,bbox:o,label:h}=await G(i,t,T(t)),a=mt(U().flowchart?.htmlLabels),e=(t?.width?t?.width:o.width)+l,s=t?.height?t?.height:e+o.height,p=s,m=[{x:0,y:0},{x:p,y:0},{x:p/2,y:-s}],{cssStyles:f}=t,g=k.svg(d),u=v(t,{});t.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");let y=_(m),x=g.path(y,u),S=d.insert(()=>x,":first-child").attr("transform",`translate(${-s/2}, ${s/2})`).attr("class","outer-path");return f&&t.look!=="handDrawn"&&S.selectChildren("path").attr("style",f),n&&t.look!=="handDrawn"&&S.selectChildren("path").attr("style",n),t.width=e,t.height=s,P(t,S),h.attr("transform",`translate(${-o.width/2-(o.x-(o.left??0))}, ${s/2-(o.height+(t.padding??0)/(a?2:1)-(o.y-(o.top??0)))})`),t.intersect=function(w){return X.info("Triangle intersect",t,m,w),N.polygon(t,m,w)},d}b(yr,"triangle");async function ur(i,t){let{labelStyles:r,nodeStyles:n}=D(t);t.labelStyle=r;let c=t.padding??0,l=t.look==="neo"?16:c,d=t.look==="neo"?12:c,o=!0;(t.width||t.height)&&(o=!1,t.width=(t?.width??0)-l*2,t.width<10&&(t.width=10),t.height=(t?.height??0)-d*2,t.height<10&&(t.height=10));let{shapeSvg:h,bbox:a,label:e}=await G(i,t,T(t)),s=(t?.width?t?.width:a.width)+(l??0)*2,p=(t?.height?t?.height:a.height)+(d??0)*2,m=t.look==="neo"?p/4:p/8,f=p+(o?m:-m),{cssStyles:g}=t,y=14-s,x=y>0?y/2:0,S=k.svg(h),w=v(t,{});t.look!=="handDrawn"&&(w.roughness=0,w.fillStyle="solid");let $=[{x:-s/2-x,y:f/2},...ht(-s/2-x,f/2,s/2+x,f/2,m,.8),{x:s/2+x,y:-f/2},{x:-s/2-x,y:-f/2}],E=_($),M=S.path(E,w),B=h.insert(()=>M,":first-child");return B.attr("class","basic label-container outer-path"),g&&t.look!=="handDrawn"&&B.selectAll("path").attr("style",g),n&&t.look!=="handDrawn"&&B.selectAll("path").attr("style",n),B.attr("transform",`translate(0,${-m/2})`),e.attr("transform",`translate(${-s/2+(t.padding??0)-(a.x-(a.left??0))},${-p/2+(t.padding??0)-m-(a.y-(a.top??0))})`),P(t,B),t.intersect=function(V){return N.polygon(t,$,V)},h}b(ur,"waveEdgedRectangle");async function br(i,t){let{labelStyles:r,nodeStyles:n}=D(t);t.labelStyle=r;let c=t.padding??0,l=t.look==="neo"?16:c,d=t.look==="neo"?20:c;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 w=Math.min(t.height*.2,t.height/4);t.height=Math.ceil(t.height-d-w*(20/9)),t.width=t.width-l*2}let{shapeSvg:o,bbox:h}=await G(i,t,T(t)),a=(t?.width?t?.width:h.width)+l*2,e=(t?.height?t?.height:h.height)+d,s=e/8,p=e+s*2,{cssStyles:m}=t,f=k.svg(o),g=v(t,{});t.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");let u=[{x:-a/2,y:p/2},...ht(-a/2,p/2,a/2,p/2,s,1),{x:a/2,y:-p/2},...ht(a/2,-p/2,-a/2,-p/2,s,-1)],y=_(u),x=f.path(y,g),S=o.insert(()=>x,":first-child");return S.attr("class","basic label-container"),m&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",m),n&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",n),P(t,S),t.intersect=function(w){return N.polygon(t,u,w)},o}b(br,"waveRectangle");var K=10;async function xr(i,t){let{labelStyles:r,nodeStyles:n}=D(t);t.labelStyle=r;let c=t.look==="neo"?16:t.padding??0,l=t.look==="neo"?12:t.padding??0;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-c*2-K,10),t.height=Math.max((t?.height??0)-l*2-K,10));let{shapeSvg:d,bbox:o,label:h}=await G(i,t,T(t)),a=(t?.width?t?.width:o.width)+c*2+K,e=(t?.height?t?.height:o.height)+l*2+K,s=a-K,p=e-K,m=-s/2,f=-p/2,{cssStyles:g}=t,u=k.svg(d),y=v(t,{}),x=[{x:m-K,y:f-K},{x:m-K,y:f+p},{x:m+s,y:f+p},{x:m+s,y:f-K}],S=`M${m-K},${f-K} L${m+s},${f-K} L${m+s},${f+p} L${m-K},${f+p} L${m-K},${f-K}
M${m-K},${f} L${m+s},${f}
M${m},${f-K} L${m},${f+p}`;t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");let w=u.path(S,y),$=d.insert(()=>w,":first-child");return $.attr("transform",`translate(${K/2}, ${K/2})`),$.attr("class","basic label-container outer-path"),g&&t.look!=="handDrawn"&&$.selectAll("path").attr("style",g),n&&t.look!=="handDrawn"&&$.selectAll("path").attr("style",n),h.attr("transform",`translate(${-(o.width/2)+K/2-(o.x-(o.left??0))}, ${-(o.height/2)+K/2-(o.y-(o.top??0))})`),P(t,$),t.intersect=function(E){return N.polygon(t,x,E)},d}b(xr,"windowPane");var Sr=new Set(["redux-color","redux-dark-color"]),Ro=new Set(["redux","redux-dark","redux-color","redux-dark-color"]);async function ye(i,t){let r=t;r.alias&&(t.label=r.alias);let{theme:n,themeVariables:c}=kt(),{rowEven:l,rowOdd:d,nodeBorder:o,borderColorArray:h}=c;if(t.look==="handDrawn"){let{themeVariables:Y}=kt(),{background:Z}=Y,Q={...t,id:t.id+"-background",domId:(t.domId||t.id)+"-background",look:"default",cssStyles:["stroke: none",`fill: ${Z}`]};await ye(i,Q)}let a=kt();t.useHtmlLabels=a.htmlLabels;let e=a.er?.diagramPadding??10,s=a.er?.entityPadding??6,{cssStyles:p}=t,{labelStyles:m,nodeStyles:f}=D(t);if(r.attributes.length===0&&t.label){let Y={rx:0,ry:0,labelPaddingX:e,labelPaddingY:e*1.5,classes:""};At(t.label,a)+Y.labelPaddingX*2<a.er.minEntityWidth&&(t.width=a.er.minEntityWidth);let Z=await gt(i,t,Y);if(n!=null&&Sr.has(n)){let Q=r.colorIndex??0;Z.attr("data-color-id",`color-${Q%h.length}`)}if(!mt(a.htmlLabels)){let Q=Z.select("text"),at=Q.node()?.getBBox();Q.attr("transform",`translate(${-at.width/2}, 0)`)}return Z}a.htmlLabels||(e*=1.25,s*=1.25);let g=T(t);g||(g="node default");let u=i.insert("g").attr("class",g).attr("id",t.domId||t.id),y=await Yt(u,t.label??"",a,0,0,["name"],m);y.height+=s;let x=0,S=[],w=[],$=0,E=0,M=0,B=0,V=!0,R=!0;for(let Y of r.attributes){let Z=await Yt(u,Y.type,a,0,x,["attribute-type"],m);$=Math.max($,Z.width+e);let Q=await Yt(u,Y.name,a,0,x,["attribute-name"],m);E=Math.max(E,Q.width+e);let at=await Yt(u,Y.keys.join(),a,0,x,["attribute-keys"],m);M=Math.max(M,at.width+e);let Ct=await Yt(u,Y.comment,a,0,x,["attribute-comment"],m);B=Math.max(B,Ct.width+e);let vt=Math.max(Z.height,Q.height,at.height,Ct.height)+s;w.push({yOffset:x,rowHeight:vt}),x+=vt}let A=4;M<=e&&(V=!1,M=0,A--),B<=e&&(R=!1,B=0,A--);let j=u.node().getBBox();if(y.width+e*2-($+E+M+B)>0){let Y=y.width+e*2-($+E+M+B);$+=Y/A,E+=Y/A,M>0&&(M+=Y/A),B>0&&(B+=Y/A)}let C=$+E+M+B,I=k.svg(u),L=v(t,{});t.look!=="handDrawn"&&(L.roughness=0,L.fillStyle="solid");let H=0;w.length>0&&(H=w.reduce((Y,Z)=>Y+(Z?.rowHeight??0),0));let O=Math.max(j.width+e*2,t?.width||0,C),W=Math.max((H??0)+y.height,t?.height||0),F=-O/2,z=-W/2;if(u.selectAll("g:not(:first-child)").each((Y,Z,Q)=>{let at=J(Q[Z]),Ct=at.attr("transform"),vt=0,ue=0;if(Ct){let re=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(Ct);re&&(vt=parseFloat(re[1]),ue=parseFloat(re[2]),at.attr("class").includes("attribute-name")?vt+=$:at.attr("class").includes("attribute-keys")?vt+=$+E:at.attr("class").includes("attribute-comment")&&(vt+=$+E+M))}at.attr("transform",`translate(${F+e/2+vt}, ${ue+z+y.height+s/2})`)}),u.select(".name").attr("transform","translate("+-y.width/2+", "+(z+s/2)+")"),n!=null&&Sr.has(n)){let Y=r.colorIndex??0;u.attr("data-color-id",`color-${Y%h.length}`)}let yt=I.rectangle(F,z,O,W,L),Pt=u.insert(()=>yt,":first-child").attr("class","outer-path").attr("style",p.join(""));S.push(0);for(let[Y,Z]of w.entries()){let at=(Y+1)%2===0&&Z.yOffset!==0,Ct=I.rectangle(F,y.height+z+Z?.yOffset,O,Z?.rowHeight,{...L,fill:at?l:d,stroke:o});u.insert(()=>Ct,"g.label").attr("style",p.join("")).attr("class",`row-rect-${at?"even":"odd"}`)}let wt=1e-4,rt=Ft(F,y.height+z,O+F,y.height+z,wt),ot=I.polygon(rt.map(Y=>[Y.x,Y.y]),L);if(u.insert(()=>ot).attr("class","divider"),rt=Ft($+F,y.height+z,$+F,W+z,wt),ot=I.polygon(rt.map(Y=>[Y.x,Y.y]),L),u.insert(()=>ot).attr("class","divider"),V){let Y=$+E+F;rt=Ft(Y,y.height+z,Y,W+z,wt),ot=I.polygon(rt.map(Z=>[Z.x,Z.y]),L),u.insert(()=>ot).attr("class","divider")}if(R){let Y=$+E+M+F;rt=Ft(Y,y.height+z,Y,W+z,wt),ot=I.polygon(rt.map(Z=>[Z.x,Z.y]),L),u.insert(()=>ot).attr("class","divider")}for(let Y of S){let Z=y.height+z+Y;rt=Ft(F,Z,O+F,Z,wt),ot=I.polygon(rt.map(Q=>[Q.x,Q.y]),L),u.insert(()=>ot).attr("class","divider")}if(P(t,Pt),f&&t.look!=="handDrawn")if(n!=null&&Ro.has(n))u.selectAll("path").attr("style",f);else{let Z=f.split(";")?.filter(Q=>Q.includes("stroke"))?.map(Q=>`${Q}`).join("; ");u.selectAll("path").attr("style",Z??""),u.selectAll(".row-rect-even path").attr("style",f)}return t.intersect=function(Y){return N.rect(t,Y)},u}b(ye,"erBox");async function Yt(i,t,r,n=0,c=0,l=[],d=""){let o=i.insert("g").attr("class",`label ${l.join(" ")}`).attr("transform",`translate(${n}, ${c})`).attr("style",d);t!==oe(t)&&(t=oe(t),t=t.replaceAll("<","<").replaceAll(">",">"));let h=o.node().appendChild(await it(o,t,{width:At(t,r)+100,style:d,useHtmlLabels:r.htmlLabels},r));if(t.includes("<")||t.includes(">")){let e=h.children[0];for(e.textContent=e.textContent.replaceAll("<","<").replaceAll(">",">");e.childNodes[0];)e=e.childNodes[0],e.textContent=e.textContent.replaceAll("<","<").replaceAll(">",">")}let a=h.getBBox();if(mt(r.htmlLabels)){let e=h.children[0];e.style.textAlign="start";let s=J(h);a=e.getBoundingClientRect(),s.attr("width",a.width),s.attr("height",a.height)}return a}b(Yt,"addText");function Ft(i,t,r,n,c){return i===r?[{x:i-c/2,y:t},{x:i+c/2,y:t},{x:r+c/2,y:n},{x:r-c/2,y:n}]:[{x:i,y:t-c/2},{x:i,y:t+c/2},{x:r,y:n+c/2},{x:r,y:n-c/2}]}b(Ft,"lineToPolygon");async function wr(i,t,r,n,c=r.class.padding??12){let l=n?0:3,d=i.insert("g").attr("class",T(t)).attr("id",t.domId||t.id),o=null,h=null,a=null,e=null,s=0,p=0,m=0;if(o=d.insert("g").attr("class","annotation-group text"),t.annotations.length>0){let x=t.annotations[0];await Kt(o,{text:`\xAB${x}\xBB`},0),s=o.node().getBBox().height}h=d.insert("g").attr("class","label-group text"),await Kt(h,t,0,["font-weight: bolder"]);let f=h.node().getBBox();p=f.height,a=d.insert("g").attr("class","members-group text");let g=0;for(let x of t.members){let S=await Kt(a,x,g,[x.parseClassifier()]);g+=S+l}m=a.node().getBBox().height,m<=0&&(m=c/2),e=d.insert("g").attr("class","methods-group text");let u=0;for(let x of t.methods){let S=await Kt(e,x,u,[x.parseClassifier()]);u+=S+l}let y=d.node().getBBox();if(o!==null){let x=o.node().getBBox();o.attr("transform",`translate(${-x.width/2})`)}return h.attr("transform",`translate(${-f.width/2}, ${s})`),y=d.node().getBBox(),a.attr("transform",`translate(0, ${s+p+c*2})`),y=d.node().getBBox(),e.attr("transform",`translate(0, ${s+p+(m?m+c*4:c*2)})`),y=d.node().getBBox(),{shapeSvg:d,bbox:y}}b(wr,"textHelper");async function Kt(i,t,r,n=[]){let c=i.insert("g").attr("class","label").attr("style",n.join("; ")),l=kt(),d="useHtmlLabels"in t?t.useHtmlLabels:mt(l.htmlLabels)??!0,o="";"text"in t?o=t.text:o=t.label,!d&&o.startsWith("\\")&&(o=o.substring(1)),xe(o)&&(d=!0);let h=await it(c,Ut(Nt(o)),{width:At(o,l)+50,classes:"markdown-node-label",useHtmlLabels:d},l),a,e=1;if(d){let s=h.children[0],p=J(h);e=s.innerHTML.split("<br>").length,s.innerHTML.includes("</math>")&&(e+=s.innerHTML.split("<mrow>").length-1),await qt(s),a=s.getBoundingClientRect(),p.attr("width",a.width),p.attr("height",a.height)}else{n.includes("font-weight: bolder")&&J(h).selectAll("tspan").attr("font-weight",""),e=h.children.length;let s=h.children[0];(h.textContent===""||h.textContent.includes(">"))&&(s.textContent=o[0]+o.substring(1).replaceAll(">",">").replaceAll("<","<").trim(),o[1]===" "&&(s.textContent=s.textContent[0]+" "+s.textContent.substring(1))),s.textContent==="undefined"&&(s.textContent=""),a=h.getBBox()}return c.attr("transform","translate(0,"+(-a.height/(2*e)+r)+")"),a.height}b(Kt,"addText");async function Nr(i,t){let r=U(),{theme:n,themeVariables:c}=r,{useGradient:l,borderColorArray:d}=c,o=r.class.padding??12,h=o,a=t.useHtmlLabels??mt(r.htmlLabels)??!0,e=t;e.annotations=e.annotations??[],e.members=e.members??[],e.methods=e.methods??[];let{shapeSvg:s,bbox:p}=await wr(i,t,r,a,h);ct(s,t.colorIndex,n,d);let{labelStyles:m,nodeStyles:f}=D(t);t.labelStyle=m,t.cssStyles=e.styles||"";let g=e.styles?.join(";")||f||"";t.cssStyles||(t.cssStyles=g.replaceAll("!important","").split(";"));let u=e.members.length===0&&e.methods.length===0&&!r.class?.hideEmptyMembersBox,y=k.svg(s),x=v(t,{});t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");let S=Math.max(t.width??0,p.width),w=Math.max(t.height??0,p.height),$=(t.height??0)>p.height;e.members.length===0&&e.methods.length===0?w+=h:e.members.length>0&&e.methods.length===0&&(w+=h*2);let E=-S/2,M=-w/2,B=u?o*2:e.members.length===0&&e.methods.length===0?-o:0;$&&(B=o*2);let V=y.rectangle(E-o,M-o-(u?o:e.members.length===0&&e.methods.length===0?-o/2:0),S+2*o,w+2*o+B,x),R=s.insert(()=>V,":first-child");R.attr("class","basic label-container outer-path");let A=R.node().getBBox(),j=s.select(".annotation-group").node().getBBox().height-(u?o/2:0)||0,C=s.select(".label-group").node().getBBox().height-(u?o/2:0)||0,I=s.select(".members-group").node().getBBox().height-(u?o/2:0)||0,L=(j+C+M+o-(M-o-(u?o:e.members.length===0&&e.methods.length===0?-o/2:0)))/2;if(s.selectAll(".text").each((H,O,W)=>{let F=J(W[O]),z=F.attr("transform"),yt=0;if(z){let ot=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(z);ot&&(yt=parseFloat(ot[2]))}let Pt=yt+M+o-(u?o:e.members.length===0&&e.methods.length===0?-o/2:0);if(F.attr("class").includes("methods-group")){let rt=Math.max(I,h/2);$?Pt=Math.max(L,j+C+rt+M+h*2+o)+h*2:Pt=j+C+rt+M+h*4+o}e.members.length===0&&e.methods.length===0&&r.class?.hideEmptyMembersBox&&(e.annotations.length>0?Pt=yt-h:Pt=yt),a||(Pt-=4);let wt=E;(F.attr("class").includes("label-group")||F.attr("class").includes("annotation-group"))&&(wt=-F.node()?.getBBox().width/2||0,s.selectAll("text").each(function(rt,ot,Y){window.getComputedStyle(Y[ot]).textAnchor==="middle"&&(wt=0)})),F.attr("transform",`translate(${wt}, ${Pt})`)}),e.members.length>0||e.methods.length>0||u){let H=j+C+M+o,O=y.line(A.x,H,A.x+A.width,H+.001,x);s.insert(()=>O).attr("class",`divider${t.look==="neo"&&!l?" neo-line":""}`).attr("style",g)}if(u||e.members.length>0||e.methods.length>0){let H=j+C+I+M+h*2+o,O=y.line(A.x,$?Math.max(L,H):H,A.x+A.width,($?Math.max(L,H):H)+.001,x);s.insert(()=>O).attr("class",`divider${t.look==="neo"&&!l?" neo-line":""}`).attr("style",g)}if(e.look!=="handDrawn"&&s.selectAll("path").attr("style",g),R.select(":nth-child(2)").attr("style",g),s.selectAll(".divider").select("path").attr("style",g),t.labelStyle?s.selectAll("span").attr("style",t.labelStyle):s.selectAll("span").attr("style",g),!a){let H=RegExp(/color\s*:\s*([^;]*)/),O=H.exec(g);if(O){let W=O[0].replace("color","fill");s.selectAll("tspan").attr("style",W)}else if(m){let W=H.exec(m);if(W){let F=W[0].replace("color","fill");s.selectAll("tspan").attr("style",F)}}}return P(t,R),t.intersect=function(H){return N.rect(t,H)},s}b(Nr,"classBox");async function $r(i,t){let{labelStyles:r,nodeStyles:n}=D(t);t.labelStyle=r;let c=t,l=t,d=20,o=20,h="verifyMethod"in t,a=T(t),e=U(),{themeVariables:s}=e,{borderColorArray:p,requirementEdgeLabelBackground:m}=s,f=e.layout==="elk"?"start":"center",g=i.insert("g").attr("class",a).attr("id",t.domId??t.id),u;h?u=await $t(g,`<<${c.type}>>`,0,t.labelStyle):u=await $t(g,"<<Element>>",0,t.labelStyle);let y=u,x=await $t(g,c.name,y,t.labelStyle+"; font-weight: bold;");if(y+=x+o,h){let A=await $t(g,`${c.requirementId?`ID: ${c.requirementId}`:""}`,y,t.labelStyle,f);y+=A;let j=await $t(g,`${c.text?`Text: ${c.text}`:""}`,y,t.labelStyle,f);y+=j;let C=await $t(g,`${c.risk?`Risk: ${c.risk}`:""}`,y,t.labelStyle,f);y+=C,await $t(g,`${c.verifyMethod?`Verification: ${c.verifyMethod}`:""}`,y,t.labelStyle,f)}else{let A=await $t(g,`${l.type?`Type: ${l.type}`:""}`,y,t.labelStyle,f);y+=A,await $t(g,`${l.docRef?`Doc Ref: ${l.docRef}`:""}`,y,t.labelStyle,f)}let S=(g.node()?.getBBox().width??200)+d,w=(g.node()?.getBBox().height??200)+d,$=-S/2,E=-w/2,M=k.svg(g),B=v(t,{});t.look!=="handDrawn"&&(B.roughness=0,B.fillStyle="solid");let V=M.rectangle($,E,S,w,B),R=g.insert(()=>V,":first-child");if(R.attr("class","basic label-container outer-path").attr("style",n),p?.length){let A=t.colorIndex??0;g.attr("data-color-id",`color-${A%p.length}`)}if(g.selectAll(".label").each((A,j,C)=>{let I=J(C[j]),L=I.attr("transform"),H=0,O=0;if(L){let yt=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(L);yt&&(H=parseFloat(yt[1]),O=parseFloat(yt[2]))}let W=O-w/2,F=$+d/2;(j===0||j===1)&&(F=H),I.attr("transform",`translate(${F}, ${W+d})`)}),y>u+x+o){let A=E+u+x+o,j;if(t.look==="neo"){let L=[[$,A],[$+S,A],[$+S,A+.001],[$,A+.001]];j=M.polygon(L,B)}else j=M.line($,A,$+S,A,B);g.insert(()=>j).attr("class","divider")}return P(t,R),t.intersect=function(A){return N.rect(t,A)},n&&t.look!=="handDrawn"&&(m||p?.length)&&g.selectAll("path").attr("style",n),g}b($r,"requirementBox");async function $t(i,t,r,n="",c="center"){if(t==="")return 0;let l=i.insert("g").attr("class","label").attr("style",n),d=U(),o=d.htmlLabels??!0,h=await it(l,Ut(Nt(t)),{width:At(t,d)+50,classes:"markdown-node-label",useHtmlLabels:o,style:n},d),a;if(o){let e=h.children[0],s=J(h);c==="start"&&J(e).style("text-align","left"),a=e.getBoundingClientRect(),s.attr("width",a.width),s.attr("height",a.height)}else{let e=h.children[0];for(let s of e.children)n&&s.setAttribute("style",n);if(c==="start"){e.setAttribute("text-anchor","start");for(let s of e.children)s.setAttribute("text-anchor","start")}a=h.getBBox(),a.height+=6}return l.attr("transform",`translate(${-a.width/2},${-a.height/2+r})`),a.height}b($t,"addText");var Ho=b(i=>{switch(i){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 Dr(i,t,{config:r}){let{labelStyles:n,nodeStyles:c}=D(t);t.labelStyle=n||"";let l=10,d=t.width;t.width=(t.width??200)-10;let{shapeSvg:o,bbox:h,label:a}=await G(i,t,T(t)),e=t.padding||10,s="",p;"ticket"in t&&t.ticket&&r?.kanban?.ticketBaseUrl&&(s=r?.kanban?.ticketBaseUrl.replace("#TICKET#",t.ticket),p=o.insert("svg:a",":first-child").attr("class","kanban-ticket-link").attr("xlink:href",s).attr("target","_blank"));let m={useHtmlLabels:t.useHtmlLabels,labelStyle:t.labelStyle||"",width:t.width,img:t.img,padding:t.padding||8,centerLabel:!1},f,g;p?{label:f,bbox:g}=await ft(p,"ticket"in t&&t.ticket||"",m):{label:f,bbox:g}=await ft(o,"ticket"in t&&t.ticket||"",m);let{label:u,bbox:y}=await ft(o,"assigned"in t&&t.assigned||"",m);t.width=d;let x=10,S=t?.width||0,w=Math.max(g.height,y.height)/2,$=Math.max(h.height+x*2,t?.height||0)+w,E=-S/2,M=-$/2;a.attr("transform","translate("+(e-S/2)+", "+(-w-h.height/2)+")"),f.attr("transform","translate("+(e-S/2)+", "+(-w+h.height/2)+")"),u.attr("transform","translate("+(e+S/2-y.width-2*l)+", "+(-w+h.height/2)+")");let B,{rx:V,ry:R}=t,{cssStyles:A}=t;if(t.look==="handDrawn"){let j=k.svg(o),C=v(t,{}),I=V||R?j.path(tt(E,M,S,$,V||0),C):j.rectangle(E,M,S,$,C);B=o.insert(()=>I,":first-child"),B.attr("class","basic label-container").attr("style",A||null)}else{B=o.insert("rect",":first-child"),B.attr("class","basic label-container __APA__").attr("style",c).attr("rx",V??5).attr("ry",R??5).attr("x",E).attr("y",M).attr("width",S).attr("height",$);let j="priority"in t&&t.priority;if(j){let C=o.append("line"),I=E+2,L=M+Math.floor((V??0)/2),H=M+$-Math.floor((V??0)/2);C.attr("x1",I).attr("y1",L).attr("x2",I).attr("y2",H).attr("stroke-width","4").attr("stroke",Ho(j))}}return P(t,B),t.height=$,t.intersect=function(j){return N.rect(t,j)},o}b(Dr,"kanbanItem");async function Pr(i,t){let{labelStyles:r,nodeStyles:n}=D(t);t.labelStyle=r;let{shapeSvg:c,bbox:l,halfPadding:d,label:o}=await G(i,t,T(t)),h=l.width+10*d,a=l.height+8*d,e=.15*h,{cssStyles:s}=t,p=l.width+20,m=l.height+20,f=Math.max(h,p),g=Math.max(a,m);o.attr("transform",`translate(${-l.width/2}, ${-l.height/2})`);let u,y=`M0 0
a${e},${e} 1 0,0 ${f*.25},${-1*g*.1}
a${e},${e} 1 0,0 ${f*.25},0
a${e},${e} 1 0,0 ${f*.25},0
a${e},${e} 1 0,0 ${f*.25},${g*.1}
a${e},${e} 1 0,0 ${f*.15},${g*.33}
a${e*.8},${e*.8} 1 0,0 0,${g*.34}
a${e},${e} 1 0,0 ${-1*f*.15},${g*.33}
a${e},${e} 1 0,0 ${-1*f*.25},${g*.15}
a${e},${e} 1 0,0 ${-1*f*.25},0
a${e},${e} 1 0,0 ${-1*f*.25},0
a${e},${e} 1 0,0 ${-1*f*.25},${-1*g*.15}
a${e},${e} 1 0,0 ${-1*f*.1},${-1*g*.33}
a${e*.8},${e*.8} 1 0,0 0,${-1*g*.34}
a${e},${e} 1 0,0 ${f*.1},${-1*g*.33}
H0 V0 Z`;if(t.look==="handDrawn"){let x=k.svg(c),S=v(t,{}),w=x.path(y,S);u=c.insert(()=>w,":first-child"),u.attr("class","basic label-container").attr("style",q(s))}else u=c.insert("path",":first-child").attr("class","basic label-container").attr("style",n).attr("d",y);return u.attr("transform",`translate(${-f/2}, ${-g/2})`),P(t,u),t.calcIntersect=function(x,S){return N.rect(x,S)},t.intersect=function(x){return X.info("Bang intersect",t,x),N.rect(t,x)},c}b(Pr,"bang");async function vr(i,t){let{labelStyles:r,nodeStyles:n}=D(t);t.labelStyle=r;let{shapeSvg:c,bbox:l,halfPadding:d,label:o}=await G(i,t,T(t)),h=l.width+2*d,a=l.height+2*d,e=.15*h,s=.25*h,p=.35*h,m=.2*h,{cssStyles:f}=t,g,u=`M0 0
a${e},${e} 0 0,1 ${h*.25},${-1*h*.1}
a${p},${p} 1 0,1 ${h*.4},${-1*h*.1}
a${s},${s} 1 0,1 ${h*.35},${h*.2}
a${e},${e} 1 0,1 ${h*.15},${a*.35}
a${m},${m} 1 0,1 ${-1*h*.15},${a*.65}
a${s},${e} 1 0,1 ${-1*h*.25},${h*.15}
a${p},${p} 1 0,1 ${-1*h*.5},0
a${e},${e} 1 0,1 ${-1*h*.25},${-1*h*.15}
a${e},${e} 1 0,1 ${-1*h*.1},${-1*a*.35}
a${m},${m} 1 0,1 ${h*.1},${-1*a*.65}
H0 V0 Z`;if(t.look==="handDrawn"){let y=k.svg(c),x=v(t,{}),S=y.path(u,x);g=c.insert(()=>S,":first-child"),g.attr("class","basic label-container").attr("style",q(f))}else g=c.insert("path",":first-child").attr("class","basic label-container").attr("style",n).attr("d",u);return o.attr("transform",`translate(${-l.width/2}, ${-l.height/2})`),g.attr("transform",`translate(${-h/2}, ${-a/2})`),P(t,g),t.calcIntersect=function(y,x){return N.rect(y,x)},t.intersect=function(y){return X.info("Cloud intersect",t,y),N.rect(t,y)},c}b(vr,"cloud");async function kr(i,t){let{labelStyles:r,nodeStyles:n}=D(t);t.labelStyle=r;let{shapeSvg:c,bbox:l,halfPadding:d,label:o}=await G(i,t,T(t)),h=l.width+8*d,a=l.height+2*d,e=5,s=t.look==="neo"?`
M${-h/2} ${a/2-e}
v${-a+2*e}
q0,-${e} ${e},-${e}
h${h-2*e}
q${e},0 ${e},${e}
v${a-e}
H${-h/2}
Z
`:`
M${-h/2} ${a/2-e}
v${-a+2*e}
q0,-${e} ${e},-${e}
h${h-2*e}
q${e},0 ${e},${e}
v${a-2*e}
q0,${e} ${-e},${e}
h${-(h-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 p=c.append("path").attr("id",t.domId).attr("class","node-bkg node-"+t.type).attr("style",n).attr("d",s);return c.append("line").attr("class","node-line-").attr("x1",-h/2).attr("y1",a/2).attr("x2",h/2).attr("y2",a/2),o.attr("transform",`translate(${-l.width/2}, ${-l.height/2})`),c.append(()=>o.node()),P(t,p),t.calcIntersect=function(m,f){return N.rect(m,f)},t.intersect=function(m){return N.rect(t,m)},c}b(kr,"defaultMindmapNode");async function Tr(i,t){let r={padding:t.padding??0};return Jt(i,t,r)}b(Tr,"mindmapCircle");var jt=36,Mt=50,Mr=100,Er=80,pt=6,Dt=16,jo="bpmn",Br={start:{rings:1,strokeWidth:1.6},intermediate:{rings:2,strokeWidth:1.4},boundary:{rings:2,strokeWidth:1.4},end:{rings:1,strokeWidth:3.4}},Gr;async function Io(){return Gr??=import("./bpmnIcons-YJSSVMIT.mjs").then(({bpmnIcons:i})=>{we(i.prefix)||Se([{name:i.prefix,icons:i}])}),Gr}b(Io,"ensureBpmnIcons");function Cr(i){let t=i.metadata?.dataDirection;return t==="input"||t==="output"?t:void 0}b(Cr,"dataDirectionOf");function Ar(i){return i.metadata?.isCollection===!0}b(Ar,"isCollectionData");async function te(i,t){return await Io(),lt(i,{height:t,width:t,fallbackPrefix:jo})}b(te,"glyphSvg");var bt=b((i,t,r)=>{let n=(t.x??0)-(t.left??0),c=(t.y??0)-(t.top??0);i.attr("transform",`translate(${-t.width/2-n},${r-t.height/2-c})`)},"positionLabelBelow"),ee=b(async(i,t,r)=>{if(!t)return;let n=i.append("g").attr("class","bpmn-glyph");n.html(`<g>${await te(t,r)}</g>`),n.attr("transform",`translate(${-r/2}, ${-r/2})`)},"appendGlyph"),xt=b((i,t,r,n,c)=>{c&&(t.metadata={...t.metadata??{},drawnExtent:c});let l=i.insert("rect",":first-child").attr("class","bpmn-bounds").attr("x",-r/2).attr("y",-n/2).attr("width",r).attr("height",n).attr("opacity",0).attr("aria-hidden","true");return P(t,l),l},"reserveBounds"),Lo=8,Qt=b((i,t,r)=>Math.min(Math.max(i,t),r),"clamp"),Et=b((i,t,r,n,c)=>{let l=i.x??0,d=i.y??0,o=t/2,h=r/2,a=n.x-l,e=n.y-d,s=c??(Math.abs(a)*h>Math.abs(e)*o?a>=0?"right":"left":e>=0?"bottom":"top"),p=b(m=>Math.max(0,m-Math.min(Lo,m/2)),"reach");return s==="left"||s==="right"?{x:l+(s==="right"?o:-o),y:Qt(n.y,d-p(h),d+p(h))}:{x:Qt(n.x,l-p(o),l+p(o)),y:d+(s==="bottom"?h:-h)}},"faceProjectIntersect"),Rr=b((i,t,r)=>{let n=i.x??0,c=i.y??0,l=t/2,d=r.x-n,o=r.y-c,h=l*.85;if(Math.abs(o)>=Math.abs(d)){let e=Qt(d,-h,h);return{x:n+e,y:c+Math.sign(o||1)*Math.sqrt(l*l-e*e)}}let a=Qt(o,-h,h);return{x:n+Math.sign(d||1)*Math.sqrt(l*l-a*a),y:c+a}},"ringIntersect"),Hr=b((i,t,r,n)=>{let c=i.x??0,l=i.y??0,d=t/2,o=r/2,h=n.x-c,a=n.y-l;return Math.abs(h)*o>Math.abs(a)*d?{x:c+Math.sign(h)*d,y:l}:{x:c,y:l+Math.sign(a||1)*o}},"faceCentreIntersect");async function Bt(i,t,r){let n=t,{labelStyles:c,nodeStyles:l}=D(t);t.labelStyle=c;let{rings:d,strokeWidth:o}=Br[r],h=jt/2,{shapeSvg:a,bbox:e,label:s}=await G(i,t,T(t,`bpmn-event bpmn-event-${r}`)),p=a.insert("g",":first-child").attr("class","bpmn-event-body");p.attr("style",l);for(let y=0;y<d;y++)p.append("circle").attr("class",y===0?"bpmn-event-ring":"bpmn-event-ring bpmn-event-ring-inner").attr("r",h-y*3).style("stroke-width",`${o}px`);await ee(p,n.icon,Dt);let m=e.height>0&&!!t.label,f=m?pt+e.height:0,g=jt+2*f,u=Math.max(jt,m?e.width:0);return m&&bt(s,e,h+pt+e.height/2),xt(a,t,u,g,{width:jt,height:jt}),t.intersect=function(y){return Rr(t,jt,y)},a}b(Bt,"renderBpmnEvent");async function jr(i,t){return Bt(i,t,"start")}b(jr,"bpmnStart");async function Ir(i,t){return Bt(i,t,"intermediate")}b(Ir,"bpmnIntermediate");async function Lr(i,t){return Bt(i,t,"boundary")}b(Lr,"bpmnBoundary");async function Or(i,t){return Bt(i,t,"end")}b(Or,"bpmnEnd");async function Vr(i,t){let r=t,{labelStyles:n,nodeStyles:c}=D(t);t.labelStyle=n;let l=Mt/2,{shapeSvg:d,bbox:o,label:h}=await G(i,t,T(t,"bpmn-gateway")),a=d.insert("g",":first-child").attr("class","bpmn-gateway-body");a.append("polygon").attr("class","bpmn-gateway-diamond").attr("points",`0,${-l} ${l},0 0,${l} ${-l},0`).attr("style",c),await ee(a,r.icon,Dt+2);let e=o.height>0&&!!t.label,s=e?pt+o.height:0,p=Mt+2*s,m=Math.max(Mt,e?o.width:0);return e&&bt(h,o,l+pt+o.height/2),xt(d,t,m,p,{width:Mt,height:Mt}),t.intersect=function(f){return Hr(t,Mt,Mt,f)},d}b(Vr,"bpmnGateway");async function Wr(i,t){let r=t,{labelStyles:n,nodeStyles:c}=D(t);t.labelStyle=n;let{shapeSvg:l,bbox:d,label:o}=await G(i,t,T(t,"bpmn-activity")),h=r.markers??[],a=r.icon,e=a?Dt+6:10,s=h.length>0?Dt+4:10,p=Math.max(Mr,d.width+16),m=Math.max(Er,d.height+e+s),f=l.insert("g",":first-child").attr("class","bpmn-activity-body");if(f.append("rect").attr("class","bpmn-activity-rect").attr("x",-p/2).attr("y",-m/2).attr("width",p).attr("height",m).attr("rx",10).attr("ry",10).attr("style",c),a){let g=f.append("g").attr("class","bpmn-activity-icon");g.html(`<g>${await te(a,Dt)}</g>`),g.attr("transform",`translate(${-p/2+6}, ${-m/2+6})`)}if(h.length>0){let g=f.append("g").attr("class","bpmn-activity-markers"),u=Dt-2,y=h.length*u;for(let[x,S]of h.entries()){let w=g.append("g");w.html(`<g>${await te(S,u)}</g>`),w.attr("transform",`translate(${-y/2+x*u}, 0)`)}g.attr("transform",`translate(0, ${m/2-u-3})`)}if(d.height>0){let g=-m/2+e,u=m/2-s;bt(o,d,(g+u)/2)}return P(t,f),t.intersect=function(g){return Et(t,p,m,g)},l}b(Wr,"bpmnActivity");var Xt=36,Ot=50,se=10;async function _r(i,t){let{labelStyles:r,nodeStyles:n}=D(t);t.labelStyle=r;let{shapeSvg:c,bbox:l,label:d}=await G(i,t,T(t,"bpmn-data-object")),o=c.insert("g",":first-child").attr("class","bpmn-data-body"),h=-Xt/2,a=-Ot/2,e=Xt/2,s=Ot/2;o.append("path").attr("class","bpmn-data-page").attr("d",`M${h},${a} H${e-se} L${e},${a+se} V${s} H${h} Z`).attr("style",n),o.append("path").attr("class","bpmn-data-fold").attr("d",`M${e-se},${a} V${a+se} H${e}`);let p=Cr(t);p&&o.append("path").attr("class",`bpmn-data-arrow bpmn-data-arrow-${p}`).attr("d",`M${h+4},${a+9} h7 v-3 l5,4.5 -5,4.5 v-3 h-7 Z`),Ar(t)&&o.append("path").attr("class","bpmn-data-collection").attr("d",`M-4,${s-11} v9 M0,${s-11} v9 M4,${s-11} v9`);let m=l.height>0&&!!t.label,f=m?pt+l.height:0,g=Ot+2*f,u=Math.max(Xt,m?l.width:0);return m&&bt(d,l,Ot/2+pt+l.height/2),xt(c,t,u,g,{width:Xt,height:Ot}),t.intersect=function(y){return Et(t,Xt,Ot,y)},c}b(_r,"bpmnDataObject");var St=50;async function Yr(i,t){let{labelStyles:r,nodeStyles:n}=D(t);t.labelStyle=r;let{shapeSvg:c,bbox:l,label:d}=await G(i,t,T(t,"bpmn-data-store")),o=c.insert("g",":first-child").attr("class","bpmn-data-body"),h=St/2,a=6;o.append("path").attr("class","bpmn-store-body").attr("d",`M${-h},${-h+a} a${h},${a} 0 0 1 ${St},0 V${h-a} a${h},${a} 0 0 1 ${-St},0 Z`).attr("style",n);for(let f of[0,5,10])o.append("path").attr("class","bpmn-store-rings").attr("d",`M${-h},${-h+a+f} a${h},${a} 0 0 0 ${St},0`);let e=l.height>0&&!!t.label,s=e?pt+l.height:0,p=St+2*s,m=Math.max(St,e?l.width:0);return e&&bt(d,l,h+pt+l.height/2),xt(c,t,m,p,{width:St,height:St}),t.intersect=function(f){return Et(t,St,St,f)},c}b(Yr,"bpmnDataStore");async function Fr(i,t){let{labelStyles:r}=D(t);t.labelStyle=r,t.wrappingWidth=160;let{shapeSvg:n,bbox:c,label:l}=await G(i,t,T(t,"bpmn-annotation")),d=8,o=Math.max(28,c.height+d*2),h=c.width+d*2+6,a=t.metadata?.attachFace==="right"?"right":"left";n.insert("g",":first-child").attr("class","bpmn-annotation-body").append("path").attr("class","bpmn-annotation-bracket").attr("d",a==="right"?`M${h/2-6},${-o/2} h6 V${o/2} h-6`:`M${-h/2+6},${-o/2} h-6 V${o/2} h6`);let s=a==="right"?-h/2+d:-h/2+d+6;return l.attr("transform",`translate(${s-(c.x??0)+(c.left??0)},${-c.height/2-((c.y??0)-(c.top??0))})`),xt(n,t,h,o),t.intersect=function(p){return Et(t,h,o,p,a)},n}b(Fr,"bpmnAnnotation");var Oo=[{semanticName:"Process",name:"Rectangle",shortName:"rect",description:"Standard process shape",aliases:["proc","process","rectangle"],internalAliases:["squareRect"],handler:tr},{semanticName:"Event",name:"Rounded Rectangle",shortName:"rounded",description:"Represents an event",aliases:["event"],internalAliases:["roundedRect"],handler:Js},{semanticName:"Terminal Point",name:"Stadium",shortName:"stadium",description:"Terminal point",aliases:["terminal","pill"],handler:er},{semanticName:"Subprocess",name:"Framed Rectangle",shortName:"fr-rect",description:"Subprocess",aliases:["subprocess","subproc","framed-rectangle","subroutine"],handler:ar},{semanticName:"Database",name:"Cylinder",shortName:"cyl",description:"Database storage",aliases:["db","database","cylinder"],handler:es},{semanticName:"Data Store",name:"Data Store",shortName:"datastore",description:"Data flow diagram data store",aliases:["data-store"],handler:ss},{semanticName:"Folder",name:"Folder",shortName:"folder",description:"Folder or directory",aliases:["directory"],handler:hs},{semanticName:"Bucket",name:"Bucket",shortName:"bucket",description:"Object storage bucket",handler:Ie},{semanticName:"Console",name:"Console (terminal window)",shortName:"console",description:"Terminal or console window",handler:Xe},{semanticName:"Browser",name:"Browser",shortName:"browser",description:"Browser window",handler:We},{semanticName:"Person",name:"Person",shortName:"person",description:"Person (circular head above a rounded body)",handler:Ke},{semanticName:"Start",name:"Circle",shortName:"circle",description:"Starting point",aliases:["circ"],handler:Jt},{semanticName:"Bang",name:"Bang",shortName:"bang",description:"Bang",aliases:["bang"],handler:Pr},{semanticName:"Cloud",name:"Cloud",shortName:"cloud",description:"cloud",aliases:["cloud"],handler:vr},{semanticName:"Decision",name:"Diamond",shortName:"diam",description:"Decision-making step",aliases:["decision","diamond","question"],handler:qs},{semanticName:"Prepare Conditional",name:"Hexagon",shortName:"hex",description:"Preparation or condition step",aliases:["hexagon","prepare"],handler:ds},{semanticName:"Data Input/Output",name:"Lean Right",shortName:"lean-r",description:"Represents input or output",aliases:["lean-right","in-out"],internalAliases:["lean_right"],handler:$s},{semanticName:"Data Input/Output",name:"Lean Left",shortName:"lean-l",description:"Represents output or input",aliases:["lean-left","out-in"],internalAliases:["lean_left"],handler:Ns},{semanticName:"Priority Action",name:"Trapezoid Base Bottom",shortName:"trap-b",description:"Priority action",aliases:["priority","trapezoid-bottom","trapezoid"],handler:mr},{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:Ss},{semanticName:"Stop",name:"Double Circle",shortName:"dbl-circ",description:"Represents a stop point",aliases:["double-circle"],internalAliases:["doublecircle"],handler:os},{semanticName:"Text Block",name:"Text Block",shortName:"text",description:"Text block",handler:lr},{semanticName:"Card",name:"Notched Rectangle",shortName:"notch-rect",description:"Represents a card",aliases:["card","notched-rectangle"],handler:_e},{semanticName:"Lined/Shaded Process",name:"Lined Rectangle",shortName:"lin-rect",description:"Lined process shape",aliases:["lined-rectangle","lined-process","lin-proc","shaded-process"],handler:Ks},{semanticName:"Start",name:"Small Circle",shortName:"sm-circ",description:"Small starting point",aliases:["start","small-circle"],internalAliases:["stateStart"],handler:or},{semanticName:"Stop",name:"Framed Circle",shortName:"fr-circ",description:"Stop point",aliases:["stop","framed-circle"],internalAliases:["stateEnd"],handler:rr},{semanticName:"Fork/Join",name:"Filled Rectangle",shortName:"fork",description:"Fork or join in process flow",aliases:["join"],internalAliases:["forkJoin"],handler:ps},{semanticName:"Collate",name:"Hourglass",shortName:"hourglass",description:"Represents a collate operation",aliases:["hourglass","collate"],handler:fs},{semanticName:"Comment",name:"Curly Brace",shortName:"brace",description:"Adds a comment",aliases:["comment","brace-l"],handler:qe},{semanticName:"Comment Right",name:"Curly Brace",shortName:"brace-r",description:"Adds a comment",handler:Ze},{semanticName:"Comment with braces on both sides",name:"Curly Braces",shortName:"braces",description:"Adds a comment",handler:ze},{semanticName:"Com Link",name:"Lightning Bolt",shortName:"bolt",description:"Communication link",aliases:["com-link","lightning-bolt"],handler:Ds},{semanticName:"Document",name:"Document",shortName:"doc",description:"Represents a document",aliases:["doc","document"],handler:ur},{semanticName:"Delay",name:"Half-Rounded Rectangle",shortName:"delay",description:"Represents a delay",aliases:["half-rounded-rectangle"],handler:ms},{semanticName:"Direct Access Storage",name:"Horizontal Cylinder",shortName:"h-cyl",description:"Direct access storage",aliases:["das","horizontal-cylinder"],handler:pr},{semanticName:"Disk Storage",name:"Lined Cylinder",shortName:"lin-cyl",description:"Disk storage",aliases:["disk","lined-cylinder"],handler:ks},{semanticName:"Display",name:"Curved Trapezoid",shortName:"curv-trap",description:"Represents a display",aliases:["curved-trapezoid","display"],handler:Je},{semanticName:"Divided Process",name:"Divided Rectangle",shortName:"div-rect",description:"Divided process shape",aliases:["div-proc","divided-rectangle","divided-process"],handler:rs},{semanticName:"Extract",name:"Triangle",shortName:"tri",description:"Extraction process",aliases:["extract","triangle"],handler:yr},{semanticName:"Internal Storage",name:"Window Pane",shortName:"win-pane",description:"Internal storage",aliases:["internal-storage","window-pane"],handler:xr},{semanticName:"Junction",name:"Filled Circle",shortName:"f-circ",description:"Junction point",aliases:["junction","filled-circle"],handler:is},{semanticName:"Loop Limit",name:"Trapezoidal Pentagon",shortName:"notch-pent",description:"Loop limit step",aliases:["loop-limit","notched-pentagon"],handler:dr},{semanticName:"Manual File",name:"Flipped Triangle",shortName:"flip-tri",description:"Manual file operation",aliases:["manual-file","flipped-triangle"],handler:cs},{semanticName:"Manual Input",name:"Sloped Rectangle",shortName:"sl-rect",description:"Manual input step",aliases:["manual-input","sloped-rectangle"],handler:Qs},{semanticName:"Multi-Document",name:"Stacked Document",shortName:"docs",description:"Multiple documents",aliases:["documents","st-doc","stacked-document"],handler:Xs},{semanticName:"Multi-Process",name:"Stacked Rectangle",shortName:"st-rect",description:"Multiple processes",aliases:["procs","processes","stacked-rectangle"],handler:Fs},{semanticName:"Stored Data",name:"Bow Tie Rectangle",shortName:"bow-rect",description:"Stored data",aliases:["stored-data","bow-tie-rectangle"],handler:je},{semanticName:"Summary",name:"Crossed Circle",shortName:"cross-circ",description:"Summary",aliases:["summary","crossed-circle"],handler:Ue},{semanticName:"Tagged Document",name:"Tagged Document",shortName:"tag-doc",description:"Tagged document",aliases:["tag-doc","tagged-document"],handler:nr},{semanticName:"Tagged Process",name:"Tagged Rectangle",shortName:"tag-rect",description:"Tagged process",aliases:["tagged-rectangle","tag-proc","tagged-process"],handler:ir},{semanticName:"Paper Tape",name:"Flag",shortName:"flag",description:"Paper tape",aliases:["paper-tape"],handler:br},{semanticName:"Odd",name:"Odd",shortName:"odd",description:"Odd shape",internalAliases:["rect_left_inv_arrow"],handler:Zs},{semanticName:"Lined Document",name:"Lined Document",shortName:"lin-doc",description:"Lined document",aliases:["lined-document"],handler:Ts}],Vo=b(()=>{let t=[...Object.entries({state:sr,choice:Ye,note:Us,composite:Fe,rectWithTitle:zs,labelRect:ws,block_arrow:Ve,collapsedGroup:Le,iconSquare:bs,iconCircle:ys,icon:gs,iconRounded:us,imageSquare:xs,anchor:Re,kanbanItem:Dr,mindmapCircle:Tr,defaultMindmapNode:kr,classBox:Nr,erBox:ye,requirementBox:$r,usecaseActor:Rs,usecaseActorHollow:js,usecaseActorAwesome:Hs,usecaseActorIcon:Os,usecaseBusiness:Ws,usecaseEllipse:as,usecaseJsonTable:Ys,"bpmn-start":jr,"bpmn-intermediate":Ir,"bpmn-boundary":Lr,"bpmn-end":Or,"bpmn-gateway":Vr,"bpmn-activity":Wr,"bpmn-data":_r,"bpmn-data-store":Yr,"bpmn-annotation":Fr}),...Oo.flatMap(r=>[r.shortName,..."aliases"in r?r.aliases:[],..."internalAliases"in r?r.internalAliases:[]].map(c=>[c,r.handler]))];return Object.fromEntries(t)},"generateShapeMap"),Wo=Vo();function L2(i){return i in Wo}b(L2,"isValidShape");export{G as a,P as b,Ge as c,N as d,tt as e,ie as f,Wo as g,L2 as h};