Files
zen-code-docs/_next/static/chunks/42e3ff10.104a8ba062fc61c9.js
2026-02-14 13:32:31 +00:00

10 lines
89 KiB
JavaScript

"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5085],{75349:function(t,e,a){a.d(e,{C1:function(){return d},Lf:function(){return ei},XO:function(){return b},Yn:function(){return en},ZH:function(){return B},aH:function(){return eh},dW:function(){return el},gU:function(){return es},jr:function(){return g},us:function(){return C}});var l=a(76238),r=a(46299),i=a(43952),n=a(48588),s=a(39216),h=a(84370),o=a(90705),d=(0,s.eW)(async(t,e,a)=>{let l,r;let o=e.useHtmlLabels||(0,s.ku)(s.nV()?.htmlLabels);l=a||"node default";let d=t.insert("g").attr("class",l).attr("id",e.domId||e.id),c=d.insert("g").attr("class","label").attr("style",(0,n.R7)(e.labelStyle));r=void 0===e.label?"":"string"==typeof e.label?e.label:e.label[0];let g=await (0,i.rw)(c,(0,s.oO)((0,n.SH)(r),(0,s.nV)()),{useHtmlLabels:o,width:e.width||s.nV().flowchart?.wrappingWidth,cssClasses:"markdown-node-label",style:e.labelStyle,addSvgBackground:!!e.icon||!!e.img}),y=g.getBBox(),f=(e?.padding??0)/2;if(o){let t=g.children[0],e=(0,h.Ys)(g),a=t.getElementsByTagName("img");if(a){let t=""===r.replace(/<img[^>]*>/g,"").trim();await Promise.all([...a].map(e=>new Promise(a=>{function l(){if(e.style.display="flex",e.style.flexDirection="column",t){let t=(0,s.nV)().fontSize?(0,s.nV)().fontSize:window.getComputedStyle(document.body).fontSize,[a=s.vZ.fontSize]=(0,n.VG)(t),l=5*a+"px";e.style.minWidth=l,e.style.maxWidth=l}else e.style.width="100%";a(e)}(0,s.eW)(l,"setupImage"),setTimeout(()=>{e.complete&&l()}),e.addEventListener("error",l),e.addEventListener("load",l)})))}y=t.getBoundingClientRect(),e.attr("width",y.width),e.attr("height",y.height)}return o?c.attr("transform","translate("+-y.width/2+", "+-y.height/2+")"):c.attr("transform","translate(0, "+-y.height/2+")"),e.centerLabel&&c.attr("transform","translate("+-y.width/2+", "+-y.height/2+")"),c.insert("rect",":first-child"),{shapeSvg:d,bbox:y,halfPadding:f,label:c}},"labelHelper"),c=(0,s.eW)(async(t,e,a)=>{let l=a.useHtmlLabels||(0,s.ku)(s.nV()?.flowchart?.htmlLabels),r=t.insert("g").attr("class","label").attr("style",a.labelStyle||""),o=await (0,i.rw)(r,(0,s.oO)((0,n.SH)(e),(0,s.nV)()),{useHtmlLabels:l,width:a.width||s.nV()?.flowchart?.wrappingWidth,style:a.labelStyle,addSvgBackground:!!a.icon||!!a.img}),d=o.getBBox(),c=a.padding/2;if((0,s.ku)(s.nV()?.flowchart?.htmlLabels)){let t=o.children[0],e=(0,h.Ys)(o);d=t.getBoundingClientRect(),e.attr("width",d.width),e.attr("height",d.height)}return l?r.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"):r.attr("transform","translate(0, "+-d.height/2+")"),a.centerLabel&&r.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"),r.insert("rect",":first-child"),{shapeSvg:t,bbox:d,halfPadding:c,label:r}},"insertLabel"),g=(0,s.eW)((t,e)=>{let a=e.node().getBBox();t.width=a.width,t.height=a.height},"updateNodeBounds"),y=(0,s.eW)((t,e)=>("handDrawn"===t.look?"rough-node":"node")+" "+t.cssClasses+" "+(e||""),"getNodeClasses");function f(t){let e=t.map((t,e)=>`${0===e?"M":"L"}${t.x},${t.y}`);return e.push("Z"),e.join(" ")}function p(t,e,a,l,r,i){let n=[],s=a-t,h=2*Math.PI/(s/i),o=e+(l-e)/2;for(let e=0;e<=50;e++){let a=t+e/50*s,l=o+r*Math.sin(h*(a-t));n.push({x:a,y:l})}return n}function u(t,e,a,l,r,i){let n=[],s=r*Math.PI/180,h=(i*Math.PI/180-s)/(l-1);for(let r=0;r<l;r++){let l=s+r*h,i=t+a*Math.cos(l),o=e+a*Math.sin(l);n.push({x:-i,y:-o})}return n}(0,s.eW)(f,"createPathFromPoints"),(0,s.eW)(p,"generateFullSineWavePoints"),(0,s.eW)(u,"generateCirclePoints");var m=(0,s.eW)((t,e)=>{var a,l,r=t.x,i=t.y,n=e.x-r,s=e.y-i,h=t.width/2,o=t.height/2;return Math.abs(s)*h>Math.abs(n)*o?(s<0&&(o=-o),a=0===s?0:o*n/s,l=o):(n<0&&(h=-h),a=h,l=0===n?0:h*s/n),{x:r+a,y:i+l}},"intersectRect");function x(t,e){e&&t.attr("style",e)}async function w(t){let e=(0,h.Ys)(document.createElementNS("http://www.w3.org/2000/svg","foreignObject")),a=e.append("xhtml:div"),l=(0,s.nV)(),r=t.label;t.label&&(0,s.l0)(t.label)&&(r=await (0,s.ur)(t.label.replace(s.SY.lineBreakRegex,"\n"),l));let i='<span class="'+(t.isNode?"nodeLabel":"edgeLabel")+'" '+(t.labelStyle?'style="'+t.labelStyle+'"':"")+">"+r+"</span>";return a.html((0,s.oO)(i,l)),x(a,t.labelStyle),a.style("display","inline-block"),a.style("padding-right","1px"),a.style("white-space","nowrap"),a.attr("xmlns","http://www.w3.org/1999/xhtml"),e.node()}(0,s.eW)(x,"applyStyle"),(0,s.eW)(w,"addHtmlLabel");var b=(0,s.eW)(async(t,e,a,l)=>{let r=t||"";if("object"==typeof r&&(r=r[0]),(0,s.ku)((0,s.nV)().flowchart.htmlLabels)){r=r.replace(/\\n|\n/g,"<br />"),s.cM.info("vertexText"+r);let t={isNode:l,label:(0,n.SH)(r).replace(/fa[blrs]?:fa-[\w-]+/g,t=>`<i class='${t.replace(":"," ")}'></i>`),labelStyle:e?e.replace("fill:","color:"):e};return await w(t)}{let t=document.createElementNS("http://www.w3.org/2000/svg","text");t.setAttribute("style",e.replace("color:","fill:"));for(let e of"string"==typeof r?r.split(/\\n|\n|<br\s*\/?>/gi):Array.isArray(r)?r:[]){let l=document.createElementNS("http://www.w3.org/2000/svg","tspan");l.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),l.setAttribute("dy","1em"),l.setAttribute("x","0"),a?l.setAttribute("class","title-row"):l.setAttribute("class","row"),l.textContent=e.trim(),t.appendChild(l)}return t}},"createLabel"),$=(0,s.eW)((t,e,a,l,r)=>["M",t+r,e,"H",t+a-r,"A",r,r,0,0,1,t+a,e+r,"V",e+l-r,"A",r,r,0,0,1,t+a-r,e+l,"H",t+r,"A",r,r,0,0,1,t,e+l-r,"V",e+r,"A",r,r,0,0,1,t+r,e,"Z"].join(" "),"createRoundedRectPathD"),k=(0,s.eW)(async(t,e)=>{let a;s.cM.info("Creating subgraph rect for ",e.id,e);let n=(0,s.nV)(),{themeVariables:d,handDrawnSeed:c}=n,{clusterBkg:g,clusterBorder:y}=d,{labelStyles:f,nodeStyles:p,borderStyles:u,backgroundStyles:x}=(0,r.UG)(e),w=t.insert("g").attr("class","cluster "+e.cssClasses).attr("id",e.id).attr("data-look",e.look),b=(0,s.ku)(n.flowchart.htmlLabels),k=w.insert("g").attr("class","cluster-label "),M=await (0,i.rw)(k,e.label,{style:e.labelStyle,useHtmlLabels:b,isNode:!0}),S=M.getBBox();if((0,s.ku)(n.flowchart.htmlLabels)){let t=M.children[0],e=(0,h.Ys)(M);S=t.getBoundingClientRect(),e.attr("width",S.width),e.attr("height",S.height)}let D=e.width<=S.width+e.padding?S.width+e.padding:e.width;e.width<=S.width+e.padding?e.diff=(D-e.width)/2-e.padding:e.diff=-e.padding;let W=e.height,v=e.x-D/2,C=e.y-W/2;if(s.cM.trace("Data ",e,JSON.stringify(e)),"handDrawn"===e.look){let t=o.Z.svg(w),l=(0,r._q)(e,{roughness:.7,fill:g,stroke:y,fillWeight:3,seed:c}),i=t.path($(v,C,D,W,0),l);(a=w.insert(()=>(s.cM.debug("Rough node insert CXC",i),i),":first-child")).select("path:nth-child(2)").attr("style",u.join(";")),a.select("path").attr("style",x.join(";").replace("fill","stroke"))}else(a=w.insert("rect",":first-child")).attr("style",p).attr("rx",e.rx).attr("ry",e.ry).attr("x",v).attr("y",C).attr("width",D).attr("height",W);let{subGraphTitleTopMargin:B}=(0,l.L)(n);if(k.attr("transform",`translate(${e.x-S.width/2}, ${e.y-e.height/2+B})`),f){let t=k.select("span");t&&t.attr("style",f)}let N=a.node().getBBox();return e.offsetX=0,e.width=N.width,e.height=N.height,e.offsetY=S.height-e.padding/2,e.intersect=function(t){return m(e,t)},{cluster:w,labelBBox:S}},"rect"),M=(0,s.eW)((t,e)=>{let a=t.insert("g").attr("class","note-cluster").attr("id",e.id),l=a.insert("rect",":first-child"),r=0*e.padding,i=r/2;l.attr("rx",e.rx).attr("ry",e.ry).attr("x",e.x-e.width/2-i).attr("y",e.y-e.height/2-i).attr("width",e.width+r).attr("height",e.height+r).attr("fill","none");let n=l.node().getBBox();return e.width=n.width,e.height=n.height,e.intersect=function(t){return m(e,t)},{cluster:a,labelBBox:{width:0,height:0}}},"noteGroup"),S=(0,s.eW)(async(t,e)=>{let a;let l=(0,s.nV)(),{themeVariables:r,handDrawnSeed:i}=l,{altBackground:n,compositeBackground:d,compositeTitleBackground:c,nodeBorder:g}=r,y=t.insert("g").attr("class",e.cssClasses).attr("id",e.id).attr("data-id",e.id).attr("data-look",e.look),f=y.insert("g",":first-child"),p=y.insert("g").attr("class","cluster-label"),u=y.append("rect"),x=p.node().appendChild(await b(e.label,e.labelStyle,void 0,!0)),w=x.getBBox();if((0,s.ku)(l.flowchart.htmlLabels)){let t=x.children[0],e=(0,h.Ys)(x);w=t.getBoundingClientRect(),e.attr("width",w.width),e.attr("height",w.height)}let k=0*e.padding,M=(e.width<=w.width+e.padding?w.width+e.padding:e.width)+k;e.width<=w.width+e.padding?e.diff=(M-e.width)/2-e.padding:e.diff=-e.padding;let S=e.height+k,D=e.height+k-w.height-6,W=e.x-M/2,v=e.y-S/2;e.width=M;let C=e.y-e.height/2-k/2+w.height+2;if("handDrawn"===e.look){let t=e.cssClasses.includes("statediagram-cluster-alt"),l=o.Z.svg(y),r=e.rx||e.ry?l.path($(W,v,M,S,10),{roughness:.7,fill:c,fillStyle:"solid",stroke:g,seed:i}):l.rectangle(W,v,M,S,{seed:i});a=y.insert(()=>r,":first-child");let s=l.rectangle(W,C,M,D,{fill:t?n:d,fillStyle:t?"hachure":"solid",stroke:g,seed:i});a=y.insert(()=>r,":first-child"),u=y.insert(()=>s)}else(a=f.insert("rect",":first-child")).attr("class","outer").attr("x",W).attr("y",v).attr("width",M).attr("height",S).attr("data-look",e.look),u.attr("class","inner").attr("x",W).attr("y",C).attr("width",M).attr("height",D);p.attr("transform",`translate(${e.x-w.width/2}, ${v+1-((0,s.ku)(l.flowchart.htmlLabels)?0:3)})`);let B=a.node().getBBox();return e.height=B.height,e.offsetX=0,e.offsetY=w.height-e.padding/2,e.labelBBox=w,e.intersect=function(t){return m(e,t)},{cluster:y,labelBBox:w}},"roundedWithTitle"),D=(0,s.eW)(async(t,e)=>{let a;s.cM.info("Creating subgraph rect for ",e.id,e);let n=(0,s.nV)(),{themeVariables:d,handDrawnSeed:c}=n,{clusterBkg:g,clusterBorder:y}=d,{labelStyles:f,nodeStyles:p,borderStyles:u,backgroundStyles:x}=(0,r.UG)(e),w=t.insert("g").attr("class","cluster "+e.cssClasses).attr("id",e.id).attr("data-look",e.look),b=(0,s.ku)(n.flowchart.htmlLabels),k=w.insert("g").attr("class","cluster-label "),M=await (0,i.rw)(k,e.label,{style:e.labelStyle,useHtmlLabels:b,isNode:!0,width:e.width}),S=M.getBBox();if((0,s.ku)(n.flowchart.htmlLabels)){let t=M.children[0],e=(0,h.Ys)(M);S=t.getBoundingClientRect(),e.attr("width",S.width),e.attr("height",S.height)}let D=e.width<=S.width+e.padding?S.width+e.padding:e.width;e.width<=S.width+e.padding?e.diff=(D-e.width)/2-e.padding:e.diff=-e.padding;let W=e.height,v=e.x-D/2,C=e.y-W/2;if(s.cM.trace("Data ",e,JSON.stringify(e)),"handDrawn"===e.look){let t=o.Z.svg(w),l=(0,r._q)(e,{roughness:.7,fill:g,stroke:y,fillWeight:4,seed:c}),i=t.path($(v,C,D,W,e.rx),l);(a=w.insert(()=>(s.cM.debug("Rough node insert CXC",i),i),":first-child")).select("path:nth-child(2)").attr("style",u.join(";")),a.select("path").attr("style",x.join(";").replace("fill","stroke"))}else(a=w.insert("rect",":first-child")).attr("style",p).attr("rx",e.rx).attr("ry",e.ry).attr("x",v).attr("y",C).attr("width",D).attr("height",W);let{subGraphTitleTopMargin:B}=(0,l.L)(n);if(k.attr("transform",`translate(${e.x-S.width/2}, ${e.y-e.height/2+B})`),f){let t=k.select("span");t&&t.attr("style",f)}let N=a.node().getBBox();return e.offsetX=0,e.width=N.width,e.height=N.height,e.offsetY=S.height-e.padding/2,e.intersect=function(t){return m(e,t)},{cluster:w,labelBBox:S}},"kanbanSection"),W={rect:k,squareRect:k,roundedWithTitle:S,noteGroup:M,divider:(0,s.eW)((t,e)=>{let a;let{themeVariables:l,handDrawnSeed:r}=(0,s.nV)(),{nodeBorder:i}=l,n=t.insert("g").attr("class",e.cssClasses).attr("id",e.id).attr("data-look",e.look),h=n.insert("g",":first-child"),d=0*e.padding,c=e.width+d;e.diff=-e.padding;let g=e.height+d,y=e.x-c/2,f=e.y-g/2;if(e.width=c,"handDrawn"===e.look){let t=o.Z.svg(n).rectangle(y,f,c,g,{fill:"lightgrey",roughness:.5,strokeLineDash:[5],stroke:i,seed:r});a=n.insert(()=>t,":first-child")}else(a=h.insert("rect",":first-child")).attr("class","divider").attr("x",y).attr("y",f).attr("width",c).attr("height",g).attr("data-look",e.look);let p=a.node().getBBox();return e.height=p.height,e.offsetX=0,e.offsetY=0,e.intersect=function(t){return m(e,t)},{cluster:n,labelBBox:{}}},"divider"),kanbanSection:D},v=new Map,C=(0,s.eW)(async(t,e)=>{let a=e.shape||"rect",l=await W[a](t,e);return v.set(e.id,l),l},"insertCluster"),B=(0,s.eW)(()=>{v=new Map},"clear");function N(t,e,a,l){var r=t.x,i=t.y,n=r-l.x,s=i-l.y,h=Math.sqrt(e*e*s*s+a*a*n*n),o=Math.abs(e*a*n/h);l.x<r&&(o=-o);var d=Math.abs(e*a*s/h);return l.y<i&&(d=-d),{x:r+o,y:i+d}}function A(t,e,a){return N(t,e,e,a)}function R(t,e,a,l){var r,i,n,s,h,o,d,c,g,y,f,p,u;if(r=e.y-t.y,n=t.x-e.x,h=e.x*t.y-t.x*e.y,g=r*a.x+n*a.y+h,y=r*l.x+n*l.y+h,!(0!==g&&0!==y&&q(g,y))&&(i=l.y-a.y,s=a.x-l.x,o=l.x*a.y-a.x*l.y,d=i*t.x+s*t.y+o,c=i*e.x+s*e.y+o,!(0!==d&&0!==c&&q(d,c))&&0!=(f=r*s-i*n)))return p=Math.abs(f/2),{x:(u=n*o-s*h)<0?(u-p)/f:(u+p)/f,y:(u=i*h-r*o)<0?(u-p)/f:(u+p)/f}}function q(t,e){return t*e>0}function L(t,e,a){let l=t.x,r=t.y,i=[],n=Number.POSITIVE_INFINITY,s=Number.POSITIVE_INFINITY;"function"==typeof e.forEach?e.forEach(function(t){n=Math.min(n,t.x),s=Math.min(s,t.y)}):(n=Math.min(n,e.x),s=Math.min(s,e.y));let h=l-t.width/2-n,o=r-t.height/2-s;for(let l=0;l<e.length;l++){let r=e[l],n=e[l<e.length-1?l+1:0],s=R(t,a,{x:h+r.x,y:o+r.y},{x:h+n.x,y:o+n.y});s&&i.push(s)}return i.length?(i.length>1&&i.sort(function(t,e){let l=t.x-a.x,r=t.y-a.y,i=Math.sqrt(l*l+r*r),n=e.x-a.x,s=e.y-a.y,h=Math.sqrt(n*n+s*s);return i<h?-1:i===h?0:1}),i[0]):t}(0,s.eW)(function(t,e){return t.intersect(e)},"intersectNode"),(0,s.eW)(N,"intersectEllipse"),(0,s.eW)(A,"intersectCircle"),(0,s.eW)(R,"intersectLine"),(0,s.eW)(q,"sameSign"),(0,s.eW)(L,"intersectPolygon");var _={circle:A,polygon:L,rect:m};function P(t,e){let{labelStyles:a}=(0,r.UG)(e);e.labelStyle=a;let l=y(e),i=l;l||(i="anchor");let h=t.insert("g").attr("class",i).attr("id",e.domId||e.id),{cssStyles:d}=e,c=o.Z.svg(h),f=(0,r._q)(e,{fill:"black",stroke:"none",fillStyle:"solid"});"handDrawn"!==e.look&&(f.roughness=0);let p=c.circle(0,0,2,f),u=h.insert(()=>p,":first-child");return u.attr("class","anchor").attr("style",(0,n.R7)(d)),g(e,u),e.intersect=function(t){return s.cM.info("Circle intersect",e,1,t),_.circle(e,1,t)},h}function Z(t,e,a,l,r,i,n){let s=Math.atan2(l-e,a-t),h=Math.sqrt(((a-t)/2/r)**2+((l-e)/2/i)**2);if(h>1)throw Error("The given radii are too small to create an arc between the points.");let o=Math.sqrt(1-h**2),d=(t+a)/2+o*i*Math.sin(s)*(n?-1:1),c=(e+l)/2-o*r*Math.cos(s)*(n?-1:1),g=Math.atan2((e-c)/i,(t-d)/r),y=Math.atan2((l-c)/i,(a-d)/r)-g;n&&y<0&&(y+=2*Math.PI),!n&&y>0&&(y-=2*Math.PI);let f=[];for(let t=0;t<20;t++){let e=g+t/19*y,a=d+r*Math.cos(e),l=c+i*Math.sin(e);f.push({x:a,y:l})}return f}async function U(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.UG)(e);e.labelStyle=a;let{shapeSvg:i,bbox:n}=await d(t,e,y(e)),s=n.width+e.padding+20,h=n.height+e.padding,c=h/2,p=c/(2.5+h/50),{cssStyles:u}=e,m=[{x:s/2,y:-h/2},{x:-s/2,y:-h/2},...Z(-s/2,-h/2,-s/2,h/2,p,c,!1),{x:s/2,y:h/2},...Z(s/2,h/2,s/2,-h/2,p,c,!0)],x=o.Z.svg(i),w=(0,r._q)(e,{});"handDrawn"!==e.look&&(w.roughness=0,w.fillStyle="solid");let b=f(m),$=x.path(b,w),k=i.insert(()=>$,":first-child");return k.attr("class","basic label-container"),u&&"handDrawn"!==e.look&&k.selectAll("path").attr("style",u),l&&"handDrawn"!==e.look&&k.selectAll("path").attr("style",l),k.attr("transform",`translate(${p/2}, 0)`),g(e,k),e.intersect=function(t){return _.polygon(e,m,t)},i}function G(t,e,a,l){return t.insert("polygon",":first-child").attr("points",l.map(function(t){return t.x+","+t.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-e/2+","+a/2+")")}async function T(t,e){let a;let{labelStyles:l,nodeStyles:i}=(0,r.UG)(e);e.labelStyle=l;let{shapeSvg:n,bbox:s}=await d(t,e,y(e)),h=s.height+e.padding,c=s.width+e.padding+12,p=-h,u=[{x:12,y:p},{x:c,y:p},{x:c,y:0},{x:0,y:0},{x:0,y:p+12},{x:12,y:p}],{cssStyles:m}=e;if("handDrawn"===e.look){let t=o.Z.svg(n),l=(0,r._q)(e,{}),i=f(u),s=t.path(i,l);a=n.insert(()=>s,":first-child").attr("transform",`translate(${-c/2}, ${h/2})`),m&&a.attr("style",m)}else a=G(n,c,h,u);return i&&a.attr("style",i),g(e,a),e.intersect=function(t){return _.polygon(e,u,t)},n}function I(t,e){let{nodeStyles:a}=(0,r.UG)(e);e.label="";let l=t.insert("g").attr("class",y(e)).attr("id",e.domId??e.id),{cssStyles:i}=e,n=Math.max(28,e.width??0),s=[{x:0,y:n/2},{x:n/2,y:0},{x:0,y:-n/2},{x:-n/2,y:0}],h=o.Z.svg(l),d=(0,r._q)(e,{});"handDrawn"!==e.look&&(d.roughness=0,d.fillStyle="solid");let c=f(s),g=h.path(c,d),p=l.insert(()=>g,":first-child");return i&&"handDrawn"!==e.look&&p.selectAll("path").attr("style",i),a&&"handDrawn"!==e.look&&p.selectAll("path").attr("style",a),e.width=28,e.height=28,e.intersect=function(t){return _.polygon(e,s,t)},l}async function E(t,e){let a;let{labelStyles:l,nodeStyles:i}=(0,r.UG)(e);e.labelStyle=l;let{shapeSvg:h,bbox:c,halfPadding:f}=await d(t,e,y(e)),p=c.width/2+f,{cssStyles:u}=e;if("handDrawn"===e.look){let t=o.Z.svg(h),l=(0,r._q)(e,{}),i=t.circle(0,0,2*p,l);(a=h.insert(()=>i,":first-child")).attr("class","basic label-container").attr("style",(0,n.R7)(u))}else a=h.insert("circle",":first-child").attr("class","basic label-container").attr("style",i).attr("r",p).attr("cx",0).attr("cy",0);return g(e,a),e.intersect=function(t){return s.cM.info("Circle intersect",e,p,t),_.circle(e,p,t)},h}function H(t){let e=Math.cos(Math.PI/4),a=Math.sin(Math.PI/4),l=2*t,r={x:l/2*e,y:l/2*a},i={x:-(l/2)*e,y:l/2*a},n={x:-(l/2)*e,y:-(l/2)*a},s={x:l/2*e,y:-(l/2)*a};return`M ${i.x},${i.y} L ${s.x},${s.y}
M ${r.x},${r.y} L ${n.x},${n.y}`}function V(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.UG)(e);e.labelStyle=a,e.label="";let i=t.insert("g").attr("class",y(e)).attr("id",e.domId??e.id),n=Math.max(30,e?.width??0),{cssStyles:h}=e,d=o.Z.svg(i),c=(0,r._q)(e,{});"handDrawn"!==e.look&&(c.roughness=0,c.fillStyle="solid");let f=d.circle(0,0,2*n,c),p=H(n),u=d.path(p,c),m=i.insert(()=>f,":first-child");return m.insert(()=>u),h&&"handDrawn"!==e.look&&m.selectAll("path").attr("style",h),l&&"handDrawn"!==e.look&&m.selectAll("path").attr("style",l),g(e,m),e.intersect=function(t){return s.cM.info("crossedCircle intersect",e,{radius:n,point:t}),_.circle(e,n,t)},i}function Y(t,e,a,l=100,r=0,i=180){let n=[],s=r*Math.PI/180,h=(i*Math.PI/180-s)/(l-1);for(let r=0;r<l;r++){let l=s+r*h,i=t+a*Math.cos(l),o=e+a*Math.sin(l);n.push({x:-i,y:-o})}return n}async function j(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.UG)(e);e.labelStyle=a;let{shapeSvg:i,bbox:n,label:s}=await d(t,e,y(e)),h=n.width+(e.padding??0),c=n.height+(e.padding??0),p=Math.max(5,.1*c),{cssStyles:u}=e,m=[...Y(h/2,-c/2,p,30,-90,0),{x:-h/2-p,y:p},...Y(h/2+2*p,-p,p,20,-180,-270),...Y(h/2+2*p,p,p,20,-90,-180),{x:-h/2-p,y:-c/2},...Y(h/2,c/2,p,20,0,90)],x=[{x:h/2,y:-c/2-p},{x:-h/2,y:-c/2-p},...Y(h/2,-c/2,p,20,-90,0),{x:-h/2-p,y:-p},...Y(h/2+.1*h,-p,p,20,-180,-270),...Y(h/2+.1*h,p,p,20,-90,-180),{x:-h/2-p,y:c/2},...Y(h/2,c/2,p,20,0,90),{x:-h/2,y:c/2+p},{x:h/2,y:c/2+p}],w=o.Z.svg(i),b=(0,r._q)(e,{fill:"none"});"handDrawn"!==e.look&&(b.roughness=0,b.fillStyle="solid");let $=f(m).replace("Z",""),k=w.path($,b),M=f(x),S=w.path(M,{...b}),D=i.insert("g",":first-child");return D.insert(()=>S,":first-child").attr("stroke-opacity",0),D.insert(()=>k,":first-child"),D.attr("class","text"),u&&"handDrawn"!==e.look&&D.selectAll("path").attr("style",u),l&&"handDrawn"!==e.look&&D.selectAll("path").attr("style",l),D.attr("transform",`translate(${p}, 0)`),s.attr("transform",`translate(${-h/2+p-(n.x-(n.left??0))},${-c/2+(e.padding??0)/2-(n.y-(n.top??0))})`),g(e,D),e.intersect=function(t){return _.polygon(e,x,t)},i}function O(t,e,a,l=100,r=0,i=180){let n=[],s=r*Math.PI/180,h=(i*Math.PI/180-s)/(l-1);for(let r=0;r<l;r++){let l=s+r*h,i=t+a*Math.cos(l),o=e+a*Math.sin(l);n.push({x:i,y:o})}return n}async function z(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.UG)(e);e.labelStyle=a;let{shapeSvg:i,bbox:n,label:s}=await d(t,e,y(e)),h=n.width+(e.padding??0),c=n.height+(e.padding??0),p=Math.max(5,.1*c),{cssStyles:u}=e,m=[...O(h/2,-c/2,p,20,-90,0),{x:h/2+p,y:-p},...O(h/2+2*p,-p,p,20,-180,-270),...O(h/2+2*p,p,p,20,-90,-180),{x:h/2+p,y:c/2},...O(h/2,c/2,p,20,0,90)],x=[{x:-h/2,y:-c/2-p},{x:h/2,y:-c/2-p},...O(h/2,-c/2,p,20,-90,0),{x:h/2+p,y:-p},...O(h/2+2*p,-p,p,20,-180,-270),...O(h/2+2*p,p,p,20,-90,-180),{x:h/2+p,y:c/2},...O(h/2,c/2,p,20,0,90),{x:h/2,y:c/2+p},{x:-h/2,y:c/2+p}],w=o.Z.svg(i),b=(0,r._q)(e,{fill:"none"});"handDrawn"!==e.look&&(b.roughness=0,b.fillStyle="solid");let $=f(m).replace("Z",""),k=w.path($,b),M=f(x),S=w.path(M,{...b}),D=i.insert("g",":first-child");return D.insert(()=>S,":first-child").attr("stroke-opacity",0),D.insert(()=>k,":first-child"),D.attr("class","text"),u&&"handDrawn"!==e.look&&D.selectAll("path").attr("style",u),l&&"handDrawn"!==e.look&&D.selectAll("path").attr("style",l),D.attr("transform",`translate(${-p}, 0)`),s.attr("transform",`translate(${-h/2+(e.padding??0)/2-(n.x-(n.left??0))},${-c/2+(e.padding??0)/2-(n.y-(n.top??0))})`),g(e,D),e.intersect=function(t){return _.polygon(e,x,t)},i}function F(t,e,a,l=100,r=0,i=180){let n=[],s=r*Math.PI/180,h=(i*Math.PI/180-s)/(l-1);for(let r=0;r<l;r++){let l=s+r*h,i=t+a*Math.cos(l),o=e+a*Math.sin(l);n.push({x:-i,y:-o})}return n}async function X(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.UG)(e);e.labelStyle=a;let{shapeSvg:i,bbox:n,label:s}=await d(t,e,y(e)),h=n.width+(e.padding??0),c=n.height+(e.padding??0),p=Math.max(5,.1*c),{cssStyles:u}=e,m=[...F(h/2,-c/2,p,30,-90,0),{x:-h/2-p,y:p},...F(h/2+2*p,-p,p,20,-180,-270),...F(h/2+2*p,p,p,20,-90,-180),{x:-h/2-p,y:-c/2},...F(h/2,c/2,p,20,0,90)],x=[...F(-h/2+p+p/2,-c/2,p,20,-90,-180),{x:h/2-p/2,y:p},...F(-h/2-p/2,-p,p,20,0,90),...F(-h/2-p/2,p,p,20,-90,0),{x:h/2-p/2,y:-p},...F(-h/2+p+p/2,c/2,p,30,-180,-270)],w=[{x:h/2,y:-c/2-p},{x:-h/2,y:-c/2-p},...F(h/2,-c/2,p,20,-90,0),{x:-h/2-p,y:-p},...F(h/2+2*p,-p,p,20,-180,-270),...F(h/2+2*p,p,p,20,-90,-180),{x:-h/2-p,y:c/2},...F(h/2,c/2,p,20,0,90),{x:-h/2,y:c/2+p},{x:h/2-p-p/2,y:c/2+p},...F(-h/2+p+p/2,-c/2,p,20,-90,-180),{x:h/2-p/2,y:p},...F(-h/2-p/2,-p,p,20,0,90),...F(-h/2-p/2,p,p,20,-90,0),{x:h/2-p/2,y:-p},...F(-h/2+p+p/2,c/2,p,30,-180,-270)],b=o.Z.svg(i),$=(0,r._q)(e,{fill:"none"});"handDrawn"!==e.look&&($.roughness=0,$.fillStyle="solid");let k=f(m).replace("Z",""),M=b.path(k,$),S=f(x).replace("Z",""),D=b.path(S,$),W=f(w),v=b.path(W,{...$}),C=i.insert("g",":first-child");return C.insert(()=>v,":first-child").attr("stroke-opacity",0),C.insert(()=>M,":first-child"),C.insert(()=>D,":first-child"),C.attr("class","text"),u&&"handDrawn"!==e.look&&C.selectAll("path").attr("style",u),l&&"handDrawn"!==e.look&&C.selectAll("path").attr("style",l),C.attr("transform",`translate(${p-p/4}, 0)`),s.attr("transform",`translate(${-h/2+(e.padding??0)/2-(n.x-(n.left??0))},${-c/2+(e.padding??0)/2-(n.y-(n.top??0))})`),g(e,C),e.intersect=function(t){return _.polygon(e,w,t)},i}async function J(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.UG)(e);e.labelStyle=a;let{shapeSvg:i,bbox:n}=await d(t,e,y(e)),s=Math.max(80,(n.width+(e.padding??0)*2)*1.25,e?.width??0),h=Math.max(20,n.height+(e.padding??0)*2,e?.height??0),c=h/2,{cssStyles:p}=e,m=o.Z.svg(i),x=(0,r._q)(e,{});"handDrawn"!==e.look&&(x.roughness=0,x.fillStyle="solid");let w=s-c,b=h/4,$=[{x:w,y:0},{x:b,y:0},{x:0,y:h/2},{x:b,y:h},{x:w,y:h},...u(-w,-h/2,c,50,270,90)],k=f($),M=m.path(k,x),S=i.insert(()=>M,":first-child");return S.attr("class","basic label-container"),p&&"handDrawn"!==e.look&&S.selectChildren("path").attr("style",p),l&&"handDrawn"!==e.look&&S.selectChildren("path").attr("style",l),S.attr("transform",`translate(${-s/2}, ${-h/2})`),g(e,S),e.intersect=function(t){return _.polygon(e,$,t)},i}(0,s.eW)(P,"anchor"),(0,s.eW)(Z,"generateArcPoints"),(0,s.eW)(U,"bowTieRect"),(0,s.eW)(G,"insertPolygonShape"),(0,s.eW)(T,"card"),(0,s.eW)(I,"choice"),(0,s.eW)(E,"circle"),(0,s.eW)(H,"createLine"),(0,s.eW)(V,"crossedCircle"),(0,s.eW)(Y,"generateCirclePoints"),(0,s.eW)(j,"curlyBraceLeft"),(0,s.eW)(O,"generateCirclePoints"),(0,s.eW)(z,"curlyBraceRight"),(0,s.eW)(F,"generateCirclePoints"),(0,s.eW)(X,"curlyBraces"),(0,s.eW)(J,"curvedTrapezoid");var K=(0,s.eW)((t,e,a,l,r,i)=>`M${t},${e+i} a${r},${i} 0,0,0 ${a},0 a${r},${i} 0,0,0 ${-a},0 l0,${l} a${r},${i} 0,0,0 ${a},0 l0,${-l}`,"createCylinderPathD"),Q=(0,s.eW)((t,e,a,l,r,i)=>`M${t},${e+i} M${t+a},${e+i} a${r},${i} 0,0,0 ${-a},0 l0,${l} a${r},${i} 0,0,0 ${a},0 l0,${-l}`,"createOuterCylinderPathD"),tt=(0,s.eW)((t,e,a,l,r,i)=>`M${t-a/2},${-l/2} a${r},${i} 0,0,0 ${a},0`,"createInnerCylinderPathD");async function te(t,e){let a;let{labelStyles:l,nodeStyles:i}=(0,r.UG)(e);e.labelStyle=l;let{shapeSvg:s,bbox:h,label:c}=await d(t,e,y(e)),f=Math.max(h.width+e.padding,e.width??0),p=f/2,u=p/(2.5+f/50),m=Math.max(h.height+u+e.padding,e.height??0),{cssStyles:x}=e;if("handDrawn"===e.look){let t=o.Z.svg(s),l=Q(0,0,f,m,p,u),i=tt(0,u,f,m,p,u),n=t.path(l,(0,r._q)(e,{})),h=t.path(i,(0,r._q)(e,{fill:"none"}));a=s.insert(()=>h,":first-child"),(a=s.insert(()=>n,":first-child")).attr("class","basic label-container"),x&&a.attr("style",x)}else{let t=K(0,0,f,m,p,u);a=s.insert("path",":first-child").attr("d",t).attr("class","basic label-container").attr("style",(0,n.R7)(x)).attr("style",i)}return a.attr("label-offset-y",u),a.attr("transform",`translate(${-f/2}, ${-(m/2+u)})`),g(e,a),c.attr("transform",`translate(${-(h.width/2)-(h.x-(h.left??0))}, ${-(h.height/2)+(e.padding??0)/1.5-(h.y-(h.top??0))})`),e.intersect=function(t){let a=_.rect(e,t),l=a.x-(e.x??0);if(0!=p&&(Math.abs(l)<(e.width??0)/2||Math.abs(l)==(e.width??0)/2&&Math.abs(a.y-(e.y??0))>(e.height??0)/2-u)){let r=u*u*(1-l*l/(p*p));r>0&&(r=Math.sqrt(r)),r=u-r,t.y-(e.y??0)>0&&(r=-r),a.y+=r}return a},s}async function ta(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.UG)(e);e.labelStyle=a;let{shapeSvg:i,bbox:n,label:s}=await d(t,e,y(e)),h=n.width+e.padding,c=n.height+e.padding,f=.2*c,p=-h/2,u=-c/2-f/2,{cssStyles:m}=e,x=o.Z.svg(i),w=(0,r._q)(e,{});"handDrawn"!==e.look&&(w.roughness=0,w.fillStyle="solid");let b=x.polygon([{x:p,y:u+f},{x:-p,y:u+f},{x:-p,y:-u},{x:p,y:-u},{x:p,y:u},{x:-p,y:u},{x:-p,y:u+f}].map(t=>[t.x,t.y]),w),$=i.insert(()=>b,":first-child");return $.attr("class","basic label-container"),m&&"handDrawn"!==e.look&&$.selectAll("path").attr("style",m),l&&"handDrawn"!==e.look&&$.selectAll("path").attr("style",l),s.attr("transform",`translate(${p+(e.padding??0)/2-(n.x-(n.left??0))}, ${u+f+(e.padding??0)/2-(n.y-(n.top??0))})`),g(e,$),e.intersect=function(t){return _.rect(e,t)},i}async function tl(t,e){let a;let{labelStyles:l,nodeStyles:i}=(0,r.UG)(e);e.labelStyle=l;let{shapeSvg:h,bbox:c,halfPadding:f}=await d(t,e,y(e)),p=c.width/2+f+5,u=c.width/2+f,{cssStyles:m}=e;if("handDrawn"===e.look){let t=o.Z.svg(h),l=(0,r._q)(e,{roughness:.2,strokeWidth:2.5}),i=(0,r._q)(e,{roughness:.2,strokeWidth:1.5}),s=t.circle(0,0,2*p,l),d=t.circle(0,0,2*u,i);(a=h.insert("g",":first-child")).attr("class",(0,n.R7)(e.cssClasses)).attr("style",(0,n.R7)(m)),a.node()?.appendChild(s),a.node()?.appendChild(d)}else{let t=(a=h.insert("g",":first-child")).insert("circle",":first-child"),e=a.insert("circle");a.attr("class","basic label-container").attr("style",i),t.attr("class","outer-circle").attr("style",i).attr("r",p).attr("cx",0).attr("cy",0),e.attr("class","inner-circle").attr("style",i).attr("r",u).attr("cx",0).attr("cy",0)}return g(e,a),e.intersect=function(t){return s.cM.info("DoubleCircle intersect",e,p,t),_.circle(e,p,t)},h}function tr(t,e,{config:{themeVariables:a}}){let{labelStyles:l,nodeStyles:i}=(0,r.UG)(e);e.label="",e.labelStyle=l;let n=t.insert("g").attr("class",y(e)).attr("id",e.domId??e.id),{cssStyles:h}=e,d=o.Z.svg(n),{nodeBorder:c}=a,f=(0,r._q)(e,{fillStyle:"solid"});"handDrawn"!==e.look&&(f.roughness=0);let p=d.circle(0,0,14,f),u=n.insert(()=>p,":first-child");return u.selectAll("path").attr("style",`fill: ${c} !important;`),h&&h.length>0&&"handDrawn"!==e.look&&u.selectAll("path").attr("style",h),i&&"handDrawn"!==e.look&&u.selectAll("path").attr("style",i),g(e,u),e.intersect=function(t){return s.cM.info("filledCircle intersect",e,{radius:7,point:t}),_.circle(e,7,t)},n}async function ti(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.UG)(e);e.labelStyle=a;let{shapeSvg:i,bbox:n,label:h}=await d(t,e,y(e)),c=n.width+(e.padding??0),p=c+n.height,u=c+n.height,m=[{x:0,y:-p},{x:u,y:-p},{x:u/2,y:0}],{cssStyles:x}=e,w=o.Z.svg(i),b=(0,r._q)(e,{});"handDrawn"!==e.look&&(b.roughness=0,b.fillStyle="solid");let $=f(m),k=w.path($,b),M=i.insert(()=>k,":first-child").attr("transform",`translate(${-p/2}, ${p/2})`);return x&&"handDrawn"!==e.look&&M.selectChildren("path").attr("style",x),l&&"handDrawn"!==e.look&&M.selectChildren("path").attr("style",l),e.width=c,e.height=p,g(e,M),h.attr("transform",`translate(${-n.width/2-(n.x-(n.left??0))}, ${-p/2+(e.padding??0)/2+(n.y-(n.top??0))})`),e.intersect=function(t){return s.cM.info("Triangle intersect",e,m,t),_.polygon(e,m,t)},i}function tn(t,e,{dir:a,config:{state:l,themeVariables:i}}){let{nodeStyles:n}=(0,r.UG)(e);e.label="";let s=t.insert("g").attr("class",y(e)).attr("id",e.domId??e.id),{cssStyles:h}=e,d=Math.max(70,e?.width??0),c=Math.max(10,e?.height??0);"LR"===a&&(d=Math.max(10,e?.width??0),c=Math.max(70,e?.height??0));let f=-1*d/2,p=-1*c/2,u=o.Z.svg(s),m=(0,r._q)(e,{stroke:i.lineColor,fill:i.lineColor});"handDrawn"!==e.look&&(m.roughness=0,m.fillStyle="solid");let x=u.rectangle(f,p,d,c,m),w=s.insert(()=>x,":first-child");h&&"handDrawn"!==e.look&&w.selectAll("path").attr("style",h),n&&"handDrawn"!==e.look&&w.selectAll("path").attr("style",n),g(e,w);let b=l?.padding??0;return e.width&&e.height&&(e.width+=b/2||0,e.height+=b/2||0),e.intersect=function(t){return _.rect(e,t)},s}async function ts(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.UG)(e);e.labelStyle=a;let{shapeSvg:i,bbox:n}=await d(t,e,y(e)),h=Math.max(80,n.width+(e.padding??0)*2,e?.width??0),c=Math.max(50,n.height+(e.padding??0)*2,e?.height??0),p=c/2,{cssStyles:m}=e,x=o.Z.svg(i),w=(0,r._q)(e,{});"handDrawn"!==e.look&&(w.roughness=0,w.fillStyle="solid");let b=[{x:-h/2,y:-c/2},{x:h/2-p,y:-c/2},...u(-h/2+p,0,p,50,90,270),{x:h/2-p,y:c/2},{x:-h/2,y:c/2}],$=f(b),k=x.path($,w),M=i.insert(()=>k,":first-child");return M.attr("class","basic label-container"),m&&"handDrawn"!==e.look&&M.selectChildren("path").attr("style",m),l&&"handDrawn"!==e.look&&M.selectChildren("path").attr("style",l),g(e,M),e.intersect=function(t){return s.cM.info("Pill intersect",e,{radius:p,point:t}),_.polygon(e,b,t)},i}async function th(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.UG)(e);e.labelStyle=a;let{shapeSvg:i,bbox:n}=await d(t,e,y(e)),s=n.height+(e.padding??0),h=n.width+(e.padding??0)*2.5,{cssStyles:c}=e,p=o.Z.svg(i),u=(0,r._q)(e,{});"handDrawn"!==e.look&&(u.roughness=0,u.fillStyle="solid");let m=h/2,x=m/6,w=s/2,b=(m+=x)-w/2,$=[{x:-b,y:-w},{x:0,y:-w},{x:b,y:-w},{x:m,y:0},{x:b,y:w},{x:0,y:w},{x:-b,y:w},{x:-m,y:0}],k=f($),M=p.path(k,u),S=i.insert(()=>M,":first-child");return S.attr("class","basic label-container"),c&&"handDrawn"!==e.look&&S.selectChildren("path").attr("style",c),l&&"handDrawn"!==e.look&&S.selectChildren("path").attr("style",l),e.width=h,e.height=s,g(e,S),e.intersect=function(t){return _.polygon(e,$,t)},i}async function to(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.UG)(e);e.label="",e.labelStyle=a;let{shapeSvg:i}=await d(t,e,y(e)),n=Math.max(30,e?.width??0),h=Math.max(30,e?.height??0),{cssStyles:c}=e,p=o.Z.svg(i),u=(0,r._q)(e,{});"handDrawn"!==e.look&&(u.roughness=0,u.fillStyle="solid");let m=[{x:0,y:0},{x:n,y:0},{x:0,y:h},{x:n,y:h}],x=f(m),w=p.path(x,u),b=i.insert(()=>w,":first-child");return b.attr("class","basic label-container"),c&&"handDrawn"!==e.look&&b.selectChildren("path").attr("style",c),l&&"handDrawn"!==e.look&&b.selectChildren("path").attr("style",l),b.attr("transform",`translate(${-n/2}, ${-h/2})`),g(e,b),e.intersect=function(t){return s.cM.info("Pill intersect",e,{points:m}),_.polygon(e,m,t)},i}async function td(t,e,{config:{themeVariables:a,flowchart:l}}){let{labelStyles:n}=(0,r.UG)(e);e.labelStyle=n;let h=Math.max(e.assetHeight??48,e.assetWidth??48),c=l?.wrappingWidth;e.width=Math.max(h,c??0);let{shapeSvg:y,bbox:f,label:p}=await d(t,e,"icon-shape default"),u="t"===e.pos,{nodeBorder:m}=a,{stylesMap:x}=(0,r.dT)(e),w=-h/2,b=-h/2,$=e.label?8:0,k=o.Z.svg(y),M=(0,r._q)(e,{stroke:"none",fill:"none"});"handDrawn"!==e.look&&(M.roughness=0,M.fillStyle="solid");let S=k.rectangle(w,b,h,h,M),D=Math.max(h,f.width),W=h+f.height+$,v=k.rectangle(-D/2,-W/2,D,W,{...M,fill:"transparent",stroke:"none"}),C=y.insert(()=>S,":first-child"),B=y.insert(()=>v);if(e.icon){let t=y.append("g");t.html(`<g>${await (0,i.s4)(e.icon,{height:h,width:h,fallbackPrefix:""})}</g>`);let a=t.node().getBBox(),l=a.width,r=a.height,n=a.x,s=a.y;t.attr("transform",`translate(${-l/2-n},${u?f.height/2+$/2-r/2-s:-f.height/2-$/2-r/2-s})`),t.attr("style",`color: ${x.get("stroke")??m};`)}return p.attr("transform",`translate(${-f.width/2-(f.x-(f.left??0))},${u?-W/2:W/2-f.height})`),C.attr("transform",`translate(0,${u?f.height/2+$/2:-f.height/2-$/2})`),g(e,B),e.intersect=function(t){if(s.cM.info("iconSquare intersect",e,t),!e.label)return _.rect(e,t);let a=e.x??0,l=e.y??0,r=e.height??0,i=[];return i=u?[{x:a-f.width/2,y:l-r/2},{x:a+f.width/2,y:l-r/2},{x:a+f.width/2,y:l-r/2+f.height+$},{x:a+h/2,y:l-r/2+f.height+$},{x:a+h/2,y:l+r/2},{x:a-h/2,y:l+r/2},{x:a-h/2,y:l-r/2+f.height+$},{x:a-f.width/2,y:l-r/2+f.height+$}]:[{x:a-h/2,y:l-r/2},{x:a+h/2,y:l-r/2},{x:a+h/2,y:l-r/2+h},{x:a+f.width/2,y:l-r/2+h},{x:a+f.width/2/2,y:l+r/2},{x:a-f.width/2,y:l+r/2},{x:a-f.width/2,y:l-r/2+h},{x:a-h/2,y:l-r/2+h}],_.polygon(e,i,t)},y}async function tc(t,e,{config:{themeVariables:a,flowchart:l}}){let{labelStyles:n}=(0,r.UG)(e);e.labelStyle=n;let h=Math.max(e.assetHeight??48,e.assetWidth??48),c=l?.wrappingWidth;e.width=Math.max(h,c??0);let{shapeSvg:y,bbox:f,label:p}=await d(t,e,"icon-shape default"),u=e.label?8:0,m="t"===e.pos,{nodeBorder:x,mainBkg:w}=a,{stylesMap:b}=(0,r.dT)(e),$=o.Z.svg(y),k=(0,r._q)(e,{});"handDrawn"!==e.look&&(k.roughness=0,k.fillStyle="solid");let M=b.get("fill");k.stroke=M??w;let S=y.append("g");e.icon&&S.html(`<g>${await (0,i.s4)(e.icon,{height:h,width:h,fallbackPrefix:""})}</g>`);let D=S.node().getBBox(),W=D.width,v=D.height,C=D.x,B=D.y,N=Math.max(W,v)*Math.SQRT2+40,A=$.circle(0,0,N,k),R=Math.max(N,f.width),q=N+f.height+u,L=$.rectangle(-R/2,-q/2,R,q,{...k,fill:"transparent",stroke:"none"}),P=y.insert(()=>A,":first-child"),Z=y.insert(()=>L);return S.attr("transform",`translate(${-W/2-C},${m?f.height/2+u/2-v/2-B:-f.height/2-u/2-v/2-B})`),S.attr("style",`color: ${b.get("stroke")??x};`),p.attr("transform",`translate(${-f.width/2-(f.x-(f.left??0))},${m?-q/2:q/2-f.height})`),P.attr("transform",`translate(0,${m?f.height/2+u/2:-f.height/2-u/2})`),g(e,Z),e.intersect=function(t){return s.cM.info("iconSquare intersect",e,t),_.rect(e,t)},y}async function tg(t,e,{config:{themeVariables:a,flowchart:l}}){let{labelStyles:n}=(0,r.UG)(e);e.labelStyle=n;let h=Math.max(e.assetHeight??48,e.assetWidth??48),c=l?.wrappingWidth;e.width=Math.max(h,c??0);let{shapeSvg:y,bbox:f,halfPadding:p,label:u}=await d(t,e,"icon-shape default"),m="t"===e.pos,x=h+2*p,w=h+2*p,{nodeBorder:b,mainBkg:k}=a,{stylesMap:M}=(0,r.dT)(e),S=e.label?8:0,D=o.Z.svg(y),W=(0,r._q)(e,{});"handDrawn"!==e.look&&(W.roughness=0,W.fillStyle="solid");let v=M.get("fill");W.stroke=v??k;let C=D.path($(-w/2,-x/2,w,x,5),W),B=Math.max(w,f.width),N=x+f.height+S,A=D.rectangle(-B/2,-N/2,B,N,{...W,fill:"transparent",stroke:"none"}),R=y.insert(()=>C,":first-child").attr("class","icon-shape2"),q=y.insert(()=>A);if(e.icon){let t=y.append("g");t.html(`<g>${await (0,i.s4)(e.icon,{height:h,width:h,fallbackPrefix:""})}</g>`);let a=t.node().getBBox(),l=a.width,r=a.height,n=a.x,s=a.y;t.attr("transform",`translate(${-l/2-n},${m?f.height/2+S/2-r/2-s:-f.height/2-S/2-r/2-s})`),t.attr("style",`color: ${M.get("stroke")??b};`)}return u.attr("transform",`translate(${-f.width/2-(f.x-(f.left??0))},${m?-N/2:N/2-f.height})`),R.attr("transform",`translate(0,${m?f.height/2+S/2:-f.height/2-S/2})`),g(e,q),e.intersect=function(t){if(s.cM.info("iconSquare intersect",e,t),!e.label)return _.rect(e,t);let a=e.x??0,l=e.y??0,r=e.height??0,i=[];return i=m?[{x:a-f.width/2,y:l-r/2},{x:a+f.width/2,y:l-r/2},{x:a+f.width/2,y:l-r/2+f.height+S},{x:a+w/2,y:l-r/2+f.height+S},{x:a+w/2,y:l+r/2},{x:a-w/2,y:l+r/2},{x:a-w/2,y:l-r/2+f.height+S},{x:a-f.width/2,y:l-r/2+f.height+S}]:[{x:a-w/2,y:l-r/2},{x:a+w/2,y:l-r/2},{x:a+w/2,y:l-r/2+x},{x:a+f.width/2,y:l-r/2+x},{x:a+f.width/2/2,y:l+r/2},{x:a-f.width/2,y:l+r/2},{x:a-f.width/2,y:l-r/2+x},{x:a-w/2,y:l-r/2+x}],_.polygon(e,i,t)},y}async function ty(t,e,{config:{themeVariables:a,flowchart:l}}){let{labelStyles:n}=(0,r.UG)(e);e.labelStyle=n;let h=Math.max(e.assetHeight??48,e.assetWidth??48),c=l?.wrappingWidth;e.width=Math.max(h,c??0);let{shapeSvg:y,bbox:f,halfPadding:p,label:u}=await d(t,e,"icon-shape default"),m="t"===e.pos,x=h+2*p,w=h+2*p,{nodeBorder:b,mainBkg:k}=a,{stylesMap:M}=(0,r.dT)(e),S=e.label?8:0,D=o.Z.svg(y),W=(0,r._q)(e,{});"handDrawn"!==e.look&&(W.roughness=0,W.fillStyle="solid");let v=M.get("fill");W.stroke=v??k;let C=D.path($(-w/2,-x/2,w,x,.1),W),B=Math.max(w,f.width),N=x+f.height+S,A=D.rectangle(-B/2,-N/2,B,N,{...W,fill:"transparent",stroke:"none"}),R=y.insert(()=>C,":first-child"),q=y.insert(()=>A);if(e.icon){let t=y.append("g");t.html(`<g>${await (0,i.s4)(e.icon,{height:h,width:h,fallbackPrefix:""})}</g>`);let a=t.node().getBBox(),l=a.width,r=a.height,n=a.x,s=a.y;t.attr("transform",`translate(${-l/2-n},${m?f.height/2+S/2-r/2-s:-f.height/2-S/2-r/2-s})`),t.attr("style",`color: ${M.get("stroke")??b};`)}return u.attr("transform",`translate(${-f.width/2-(f.x-(f.left??0))},${m?-N/2:N/2-f.height})`),R.attr("transform",`translate(0,${m?f.height/2+S/2:-f.height/2-S/2})`),g(e,q),e.intersect=function(t){if(s.cM.info("iconSquare intersect",e,t),!e.label)return _.rect(e,t);let a=e.x??0,l=e.y??0,r=e.height??0,i=[];return i=m?[{x:a-f.width/2,y:l-r/2},{x:a+f.width/2,y:l-r/2},{x:a+f.width/2,y:l-r/2+f.height+S},{x:a+w/2,y:l-r/2+f.height+S},{x:a+w/2,y:l+r/2},{x:a-w/2,y:l+r/2},{x:a-w/2,y:l-r/2+f.height+S},{x:a-f.width/2,y:l-r/2+f.height+S}]:[{x:a-w/2,y:l-r/2},{x:a+w/2,y:l-r/2},{x:a+w/2,y:l-r/2+x},{x:a+f.width/2,y:l-r/2+x},{x:a+f.width/2/2,y:l+r/2},{x:a-f.width/2,y:l+r/2},{x:a-f.width/2,y:l-r/2+x},{x:a-w/2,y:l-r/2+x}],_.polygon(e,i,t)},y}async function tf(t,e,{config:{flowchart:a}}){let l=new Image;l.src=e?.img??"",await l.decode();let i=Number(l.naturalWidth.toString().replace("px","")),n=Number(l.naturalHeight.toString().replace("px",""));e.imageAspectRatio=i/n;let{labelStyles:h}=(0,r.UG)(e);e.labelStyle=h;let c=a?.wrappingWidth;e.defaultWidth=a?.wrappingWidth;let y=Math.max(e.label?c??0:0,e?.assetWidth??i),f="on"===e.constraint&&e?.assetHeight?e.assetHeight*e.imageAspectRatio:y,p="on"===e.constraint?f/e.imageAspectRatio:e?.assetHeight??n;e.width=Math.max(f,c??0);let{shapeSvg:u,bbox:m,label:x}=await d(t,e,"image-shape default"),w="t"===e.pos,b=-f/2,$=e.label?8:0,k=o.Z.svg(u),M=(0,r._q)(e,{});"handDrawn"!==e.look&&(M.roughness=0,M.fillStyle="solid");let S=k.rectangle(b,-p/2,f,p,M),D=Math.max(f,m.width),W=p+m.height+$,v=k.rectangle(-D/2,-W/2,D,W,{...M,fill:"none",stroke:"none"}),C=u.insert(()=>S,":first-child"),B=u.insert(()=>v);if(e.img){let t=u.append("image");t.attr("href",e.img),t.attr("width",f),t.attr("height",p),t.attr("preserveAspectRatio","none"),t.attr("transform",`translate(${-f/2},${w?W/2-p:-W/2})`)}return x.attr("transform",`translate(${-m.width/2-(m.x-(m.left??0))},${w?-p/2-m.height/2-$/2:p/2-m.height/2+$/2})`),C.attr("transform",`translate(0,${w?m.height/2+$/2:-m.height/2-$/2})`),g(e,B),e.intersect=function(t){if(s.cM.info("iconSquare intersect",e,t),!e.label)return _.rect(e,t);let a=e.x??0,l=e.y??0,r=e.height??0,i=[];return i=w?[{x:a-m.width/2,y:l-r/2},{x:a+m.width/2,y:l-r/2},{x:a+m.width/2,y:l-r/2+m.height+$},{x:a+f/2,y:l-r/2+m.height+$},{x:a+f/2,y:l+r/2},{x:a-f/2,y:l+r/2},{x:a-f/2,y:l-r/2+m.height+$},{x:a-m.width/2,y:l-r/2+m.height+$}]:[{x:a-f/2,y:l-r/2},{x:a+f/2,y:l-r/2},{x:a+f/2,y:l-r/2+p},{x:a+m.width/2,y:l-r/2+p},{x:a+m.width/2/2,y:l+r/2},{x:a-m.width/2,y:l+r/2},{x:a-m.width/2,y:l-r/2+p},{x:a-f/2,y:l-r/2+p}],_.polygon(e,i,t)},u}async function tp(t,e){let a;let{labelStyles:l,nodeStyles:i}=(0,r.UG)(e);e.labelStyle=l;let{shapeSvg:n,bbox:s}=await d(t,e,y(e)),h=Math.max(s.width+(e.padding??0)*2,e?.width??0),c=Math.max(s.height+(e.padding??0)*2,e?.height??0),p=[{x:0,y:0},{x:h,y:0},{x:h+3*c/6,y:-c},{x:-3*c/6,y:-c}],{cssStyles:u}=e;if("handDrawn"===e.look){let t=o.Z.svg(n),l=(0,r._q)(e,{}),i=f(p),s=t.path(i,l);a=n.insert(()=>s,":first-child").attr("transform",`translate(${-h/2}, ${c/2})`),u&&a.attr("style",u)}else a=G(n,h,c,p);return i&&a.attr("style",i),e.width=h,e.height=c,g(e,a),e.intersect=function(t){return _.polygon(e,p,t)},n}async function tu(t,e,a){let l;let{labelStyles:i,nodeStyles:s}=(0,r.UG)(e);e.labelStyle=i;let{shapeSvg:h,bbox:c}=await d(t,e,y(e)),f=Math.max(c.width+2*a.labelPaddingX,e?.width||0),p=Math.max(c.height+2*a.labelPaddingY,e?.height||0),u=-f/2,m=-p/2,{rx:x,ry:w}=e,{cssStyles:b}=e;if(a?.rx&&a.ry&&(x=a.rx,w=a.ry),"handDrawn"===e.look){let t=o.Z.svg(h),a=(0,r._q)(e,{}),i=x||w?t.path($(u,m,f,p,x||0),a):t.rectangle(u,m,f,p,a);(l=h.insert(()=>i,":first-child")).attr("class","basic label-container").attr("style",(0,n.R7)(b))}else(l=h.insert("rect",":first-child")).attr("class","basic label-container").attr("style",s).attr("rx",(0,n.R7)(x)).attr("ry",(0,n.R7)(w)).attr("x",u).attr("y",m).attr("width",f).attr("height",p);return g(e,l),e.intersect=function(t){return _.rect(e,t)},h}async function tm(t,e){let{shapeSvg:a,bbox:l,label:r}=await d(t,e,"label"),i=a.insert("rect",":first-child");return i.attr("width",.1).attr("height",.1),a.attr("class","label edgeLabel"),r.attr("transform",`translate(${-(l.width/2)-(l.x-(l.left??0))}, ${-(l.height/2)-(l.y-(l.top??0))})`),g(e,i),e.intersect=function(t){return _.rect(e,t)},a}async function tx(t,e){let a;let{labelStyles:l,nodeStyles:i}=(0,r.UG)(e);e.labelStyle=l;let{shapeSvg:n,bbox:s}=await d(t,e,y(e)),h=Math.max(s.width+(e.padding??0),e?.width??0),c=Math.max(s.height+(e.padding??0),e?.height??0),p=[{x:0,y:0},{x:h+3*c/6,y:0},{x:h,y:-c},{x:-(3*c)/6,y:-c}],{cssStyles:u}=e;if("handDrawn"===e.look){let t=o.Z.svg(n),l=(0,r._q)(e,{}),i=f(p),s=t.path(i,l);a=n.insert(()=>s,":first-child").attr("transform",`translate(${-h/2}, ${c/2})`),u&&a.attr("style",u)}else a=G(n,h,c,p);return i&&a.attr("style",i),e.width=h,e.height=c,g(e,a),e.intersect=function(t){return _.polygon(e,p,t)},n}async function tw(t,e){let a;let{labelStyles:l,nodeStyles:i}=(0,r.UG)(e);e.labelStyle=l;let{shapeSvg:n,bbox:s}=await d(t,e,y(e)),h=Math.max(s.width+(e.padding??0),e?.width??0),c=Math.max(s.height+(e.padding??0),e?.height??0),p=[{x:-3*c/6,y:0},{x:h,y:0},{x:h+3*c/6,y:-c},{x:0,y:-c}],{cssStyles:u}=e;if("handDrawn"===e.look){let t=o.Z.svg(n),l=(0,r._q)(e,{}),i=f(p),s=t.path(i,l);a=n.insert(()=>s,":first-child").attr("transform",`translate(${-h/2}, ${c/2})`),u&&a.attr("style",u)}else a=G(n,h,c,p);return i&&a.attr("style",i),e.width=h,e.height=c,g(e,a),e.intersect=function(t){return _.polygon(e,p,t)},n}function tb(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.UG)(e);e.label="",e.labelStyle=a;let i=t.insert("g").attr("class",y(e)).attr("id",e.domId??e.id),{cssStyles:n}=e,h=Math.max(35,e?.width??0),d=Math.max(35,e?.height??0),c=[{x:h,y:0},{x:0,y:d+3.5},{x:h-14,y:d+3.5},{x:0,y:2*d},{x:h,y:d-3.5},{x:14,y:d-3.5}],p=o.Z.svg(i),u=(0,r._q)(e,{});"handDrawn"!==e.look&&(u.roughness=0,u.fillStyle="solid");let m=f(c),x=p.path(m,u),w=i.insert(()=>x,":first-child");return n&&"handDrawn"!==e.look&&w.selectAll("path").attr("style",n),l&&"handDrawn"!==e.look&&w.selectAll("path").attr("style",l),w.attr("transform",`translate(-${h/2},${-d})`),g(e,w),e.intersect=function(t){return s.cM.info("lightningBolt intersect",e,t),_.polygon(e,c,t)},i}(0,s.eW)(te,"cylinder"),(0,s.eW)(ta,"dividedRectangle"),(0,s.eW)(tl,"doublecircle"),(0,s.eW)(tr,"filledCircle"),(0,s.eW)(ti,"flippedTriangle"),(0,s.eW)(tn,"forkJoin"),(0,s.eW)(ts,"halfRoundedRectangle"),(0,s.eW)(th,"hexagon"),(0,s.eW)(to,"hourglass"),(0,s.eW)(td,"icon"),(0,s.eW)(tc,"iconCircle"),(0,s.eW)(tg,"iconRounded"),(0,s.eW)(ty,"iconSquare"),(0,s.eW)(tf,"imageSquare"),(0,s.eW)(tp,"inv_trapezoid"),(0,s.eW)(tu,"drawRect"),(0,s.eW)(tm,"labelRect"),(0,s.eW)(tx,"lean_left"),(0,s.eW)(tw,"lean_right"),(0,s.eW)(tb,"lightningBolt");var t$=(0,s.eW)((t,e,a,l,r,i,n)=>`M${t},${e+i} a${r},${i} 0,0,0 ${a},0 a${r},${i} 0,0,0 ${-a},0 l0,${l} a${r},${i} 0,0,0 ${a},0 l0,${-l} M${t},${e+i+n} a${r},${i} 0,0,0 ${a},0`,"createCylinderPathD"),tk=(0,s.eW)((t,e,a,l,r,i,n)=>`M${t},${e+i} M${t+a},${e+i} a${r},${i} 0,0,0 ${-a},0 l0,${l} a${r},${i} 0,0,0 ${a},0 l0,${-l} M${t},${e+i+n} a${r},${i} 0,0,0 ${a},0`,"createOuterCylinderPathD"),tM=(0,s.eW)((t,e,a,l,r,i)=>`M${t-a/2},${-l/2} a${r},${i} 0,0,0 ${a},0`,"createInnerCylinderPathD");async function tS(t,e){let a;let{labelStyles:l,nodeStyles:i}=(0,r.UG)(e);e.labelStyle=l;let{shapeSvg:s,bbox:h,label:c}=await d(t,e,y(e)),f=Math.max(h.width+(e.padding??0),e.width??0),p=f/2,u=p/(2.5+f/50),m=Math.max(h.height+u+(e.padding??0),e.height??0),x=.1*m,{cssStyles:w}=e;if("handDrawn"===e.look){let t=o.Z.svg(s),l=tk(0,0,f,m,p,u,x),i=tM(0,u,f,m,p,u),n=(0,r._q)(e,{}),h=t.path(l,n),d=t.path(i,n);s.insert(()=>d,":first-child").attr("class","line"),(a=s.insert(()=>h,":first-child")).attr("class","basic label-container"),w&&a.attr("style",w)}else{let t=t$(0,0,f,m,p,u,x);a=s.insert("path",":first-child").attr("d",t).attr("class","basic label-container").attr("style",(0,n.R7)(w)).attr("style",i)}return a.attr("label-offset-y",u),a.attr("transform",`translate(${-f/2}, ${-(m/2+u)})`),g(e,a),c.attr("transform",`translate(${-(h.width/2)-(h.x-(h.left??0))}, ${-(h.height/2)+u-(h.y-(h.top??0))})`),e.intersect=function(t){let a=_.rect(e,t),l=a.x-(e.x??0);if(0!=p&&(Math.abs(l)<(e.width??0)/2||Math.abs(l)==(e.width??0)/2&&Math.abs(a.y-(e.y??0))>(e.height??0)/2-u)){let r=u*u*(1-l*l/(p*p));r>0&&(r=Math.sqrt(r)),r=u-r,t.y-(e.y??0)>0&&(r=-r),a.y+=r}return a},s}async function tD(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.UG)(e);e.labelStyle=a;let{shapeSvg:i,bbox:n,label:s}=await d(t,e,y(e)),h=Math.max(n.width+(e.padding??0)*2,e?.width??0),c=Math.max(n.height+(e.padding??0)*2,e?.height??0),f=c/4,u=c+f,{cssStyles:m}=e,x=o.Z.svg(i),w=(0,r._q)(e,{});"handDrawn"!==e.look&&(w.roughness=0,w.fillStyle="solid");let b=[{x:-h/2-h/2*.1,y:-u/2},{x:-h/2-h/2*.1,y:u/2},...p(-h/2-h/2*.1,u/2,h/2+h/2*.1,u/2,f,.8),{x:h/2+h/2*.1,y:-u/2},{x:-h/2-h/2*.1,y:-u/2},{x:-h/2,y:-u/2},{x:-h/2,y:u/2*1.1},{x:-h/2,y:-u/2}],$=x.polygon(b.map(t=>[t.x,t.y]),w),k=i.insert(()=>$,":first-child");return k.attr("class","basic label-container"),m&&"handDrawn"!==e.look&&k.selectAll("path").attr("style",m),l&&"handDrawn"!==e.look&&k.selectAll("path").attr("style",l),k.attr("transform",`translate(0,${-f/2})`),s.attr("transform",`translate(${-h/2+(e.padding??0)+h/2*.1/2-(n.x-(n.left??0))},${-c/2+(e.padding??0)-f/2-(n.y-(n.top??0))})`),g(e,k),e.intersect=function(t){return _.polygon(e,b,t)},i}async function tW(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.UG)(e);e.labelStyle=a;let{shapeSvg:i,bbox:n,label:s}=await d(t,e,y(e)),h=Math.max(n.width+(e.padding??0)*2,e?.width??0),c=Math.max(n.height+(e.padding??0)*2,e?.height??0),p=-h/2,u=-c/2,{cssStyles:m}=e,x=o.Z.svg(i),w=(0,r._q)(e,{}),b=[{x:p-5,y:u+5},{x:p-5,y:u+c+5},{x:p+h-5,y:u+c+5},{x:p+h-5,y:u+c},{x:p+h,y:u+c},{x:p+h,y:u+c-5},{x:p+h+5,y:u+c-5},{x:p+h+5,y:u-5},{x:p+5,y:u-5},{x:p+5,y:u},{x:p,y:u},{x:p,y:u+5}];"handDrawn"!==e.look&&(w.roughness=0,w.fillStyle="solid");let $=f(b),k=x.path($,w),M=f([{x:p,y:u+5},{x:p+h-5,y:u+5},{x:p+h-5,y:u+c},{x:p+h,y:u+c},{x:p+h,y:u},{x:p,y:u}]),S=x.path(M,{...w,fill:"none"}),D=i.insert(()=>S,":first-child");return D.insert(()=>k,":first-child"),D.attr("class","basic label-container"),m&&"handDrawn"!==e.look&&D.selectAll("path").attr("style",m),l&&"handDrawn"!==e.look&&D.selectAll("path").attr("style",l),s.attr("transform",`translate(${-(n.width/2)-5-(n.x-(n.left??0))}, ${-(n.height/2)+5-(n.y-(n.top??0))})`),g(e,D),e.intersect=function(t){return _.polygon(e,b,t)},i}async function tv(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.UG)(e);e.labelStyle=a;let{shapeSvg:i,bbox:n,label:s}=await d(t,e,y(e)),h=Math.max(n.width+(e.padding??0)*2,e?.width??0),c=Math.max(n.height+(e.padding??0)*2,e?.height??0),u=c/4,m=c+u,x=-h/2,w=-m/2,{cssStyles:b}=e,$=p(x-5,w+m+5,x+h-5,w+m+5,u,.8),k=$?.[$.length-1],M=[{x:x-5,y:w+5},{x:x-5,y:w+m+5},...$,{x:x+h-5,y:k.y-5},{x:x+h,y:k.y-5},{x:x+h,y:k.y-10},{x:x+h+5,y:k.y-10},{x:x+h+5,y:w-5},{x:x+5,y:w-5},{x:x+5,y:w},{x,y:w},{x,y:w+5}],S=[{x,y:w+5},{x:x+h-5,y:w+5},{x:x+h-5,y:k.y-5},{x:x+h,y:k.y-5},{x:x+h,y:w},{x,y:w}],D=o.Z.svg(i),W=(0,r._q)(e,{});"handDrawn"!==e.look&&(W.roughness=0,W.fillStyle="solid");let v=f(M),C=D.path(v,W),B=f(S),N=D.path(B,W),A=i.insert(()=>C,":first-child");return A.insert(()=>N),A.attr("class","basic label-container"),b&&"handDrawn"!==e.look&&A.selectAll("path").attr("style",b),l&&"handDrawn"!==e.look&&A.selectAll("path").attr("style",l),A.attr("transform",`translate(0,${-u/2})`),s.attr("transform",`translate(${-(n.width/2)-5-(n.x-(n.left??0))}, ${-(n.height/2)+5-u/2-(n.y-(n.top??0))})`),g(e,A),e.intersect=function(t){return _.polygon(e,M,t)},i}async function tC(t,e,{config:{themeVariables:a}}){let{labelStyles:l,nodeStyles:i}=(0,r.UG)(e);e.labelStyle=l,e.useHtmlLabels||s.iE().flowchart?.htmlLabels!==!1||(e.centerLabel=!0);let{shapeSvg:n,bbox:h,label:c}=await d(t,e,y(e)),f=Math.max(h.width+(e.padding??0)*2,e?.width??0),p=Math.max(h.height+(e.padding??0)*2,e?.height??0),{cssStyles:u}=e,m=o.Z.svg(n),x=(0,r._q)(e,{fill:a.noteBkgColor,stroke:a.noteBorderColor});"handDrawn"!==e.look&&(x.roughness=0,x.fillStyle="solid");let w=m.rectangle(-f/2,-p/2,f,p,x),b=n.insert(()=>w,":first-child");return b.attr("class","basic label-container"),u&&"handDrawn"!==e.look&&b.selectAll("path").attr("style",u),i&&"handDrawn"!==e.look&&b.selectAll("path").attr("style",i),c.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))}, ${-(h.height/2)-(h.y-(h.top??0))})`),g(e,b),e.intersect=function(t){return _.rect(e,t)},n}(0,s.eW)(tS,"linedCylinder"),(0,s.eW)(tD,"linedWaveEdgedRect"),(0,s.eW)(tW,"multiRect"),(0,s.eW)(tv,"multiWaveEdgedRectangle"),(0,s.eW)(tC,"note");var tB=(0,s.eW)((t,e,a)=>`M${t+a/2},${e} L${t+a},${e-a/2} L${t+a/2},${e-a} L${t},${e-a/2} Z`,"createDecisionBoxPathD");async function tN(t,e){let a;let{labelStyles:l,nodeStyles:i}=(0,r.UG)(e);e.labelStyle=l;let{shapeSvg:n,bbox:h}=await d(t,e,y(e)),c=h.width+e.padding+(h.height+e.padding),f=[{x:c/2,y:0},{x:c,y:-c/2},{x:c/2,y:-c},{x:0,y:-c/2}],{cssStyles:p}=e;if("handDrawn"===e.look){let t=o.Z.svg(n),l=(0,r._q)(e,{}),i=tB(0,0,c),s=t.path(i,l);a=n.insert(()=>s,":first-child").attr("transform",`translate(${-c/2+.5}, ${c/2})`),p&&a.attr("style",p)}else(a=G(n,c,c,f)).attr("transform",`translate(${-c/2+.5}, ${c/2})`);return i&&a.attr("style",i),g(e,a),e.intersect=function(t){return s.cM.debug("APA12 Intersect called SPLIT\npoint:",t,"\nnode:\n",e,"\nres:",_.polygon(e,f,t)),_.polygon(e,f,t)},n}async function tA(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.UG)(e);e.labelStyle=a;let{shapeSvg:i,bbox:n,label:s}=await d(t,e,y(e)),h=Math.max(n.width+(e.padding??0),e?.width??0),c=Math.max(n.height+(e.padding??0),e?.height??0),p=-h/2,u=-c/2,m=u/2,x=[{x:p+m,y:u},{x:p,y:0},{x:p+m,y:-u},{x:-p,y:-u},{x:-p,y:u}],{cssStyles:w}=e,b=o.Z.svg(i),$=(0,r._q)(e,{});"handDrawn"!==e.look&&($.roughness=0,$.fillStyle="solid");let k=f(x),M=b.path(k,$),S=i.insert(()=>M,":first-child");return S.attr("class","basic label-container"),w&&"handDrawn"!==e.look&&S.selectAll("path").attr("style",w),l&&"handDrawn"!==e.look&&S.selectAll("path").attr("style",l),S.attr("transform",`translate(${-m/2},0)`),s.attr("transform",`translate(${-m/2-n.width/2-(n.x-(n.left??0))}, ${-(n.height/2)-(n.y-(n.top??0))})`),g(e,S),e.intersect=function(t){return _.polygon(e,x,t)},i}async function tR(t,e){let a,l,i;let{labelStyles:n,nodeStyles:d}=(0,r.UG)(e);e.labelStyle=n,a=e.cssClasses?"node "+e.cssClasses:"node default";let c=t.insert("g").attr("class",a).attr("id",e.domId||e.id),y=c.insert("g"),f=c.insert("g").attr("class","label").attr("style",d),p=e.description,u=e.label,m=f.node().appendChild(await b(u,e.labelStyle,!0,!0)),x={width:0,height:0};if((0,s.ku)(s.nV()?.flowchart?.htmlLabels)){let t=m.children[0],e=(0,h.Ys)(m);x=t.getBoundingClientRect(),e.attr("width",x.width),e.attr("height",x.height)}s.cM.info("Text 2",p);let w=p||[],k=m.getBBox(),M=f.node().appendChild(await b(w.join?w.join("<br/>"):w,e.labelStyle,!0,!0)),S=M.children[0],D=(0,h.Ys)(M);x=S.getBoundingClientRect(),D.attr("width",x.width),D.attr("height",x.height);let W=(e.padding||0)/2;(0,h.Ys)(M).attr("transform","translate( "+(x.width>k.width?0:(k.width-x.width)/2)+", "+(k.height+W+5)+")"),(0,h.Ys)(m).attr("transform","translate( "+(x.width<k.width?0:-(k.width-x.width)/2)+", 0)"),x=f.node().getBBox(),f.attr("transform","translate("+-x.width/2+", "+(-x.height/2-W+3)+")");let v=x.width+(e.padding||0),C=x.height+(e.padding||0),B=-x.width/2-W,N=-x.height/2-W;if("handDrawn"===e.look){let t=o.Z.svg(c),a=(0,r._q)(e,{}),n=t.path($(B,N,v,C,e.rx||0),a),h=t.line(-x.width/2-W,-x.height/2-W+k.height+W,x.width/2+W,-x.height/2-W+k.height+W,a);i=c.insert(()=>(s.cM.debug("Rough node insert CXC",n),h),":first-child"),l=c.insert(()=>(s.cM.debug("Rough node insert CXC",n),n),":first-child")}else l=y.insert("rect",":first-child"),i=y.insert("line"),l.attr("class","outer title-state").attr("style",d).attr("x",-x.width/2-W).attr("y",-x.height/2-W).attr("width",x.width+(e.padding||0)).attr("height",x.height+(e.padding||0)),i.attr("class","divider").attr("x1",-x.width/2-W).attr("x2",x.width/2+W).attr("y1",-x.height/2-W+k.height+W).attr("y2",-x.height/2-W+k.height+W);return g(e,l),e.intersect=function(t){return _.rect(e,t)},c}function tq(t,e,a,l,r,i,n){let s=Math.atan2(l-e,a-t),h=Math.sqrt(((a-t)/2/r)**2+((l-e)/2/i)**2);if(h>1)throw Error("The given radii are too small to create an arc between the points.");let o=Math.sqrt(1-h**2),d=(t+a)/2+o*i*Math.sin(s)*(n?-1:1),c=(e+l)/2-o*r*Math.cos(s)*(n?-1:1),g=Math.atan2((e-c)/i,(t-d)/r),y=Math.atan2((l-c)/i,(a-d)/r)-g;n&&y<0&&(y+=2*Math.PI),!n&&y>0&&(y-=2*Math.PI);let f=[];for(let t=0;t<20;t++){let e=g+t/19*y,a=d+r*Math.cos(e),l=c+i*Math.sin(e);f.push({x:a,y:l})}return f}async function tL(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.UG)(e);e.labelStyle=a;let{shapeSvg:i,bbox:n}=await d(t,e,y(e)),s=e?.padding??0,h=e?.padding??0,c=(e?.width?e?.width:n.width)+2*s,p=(e?.height?e?.height:n.height)+2*h,{cssStyles:u}=e,m=o.Z.svg(i),x=(0,r._q)(e,{});"handDrawn"!==e.look&&(x.roughness=0,x.fillStyle="solid");let w=[{x:-c/2+5,y:-p/2},{x:c/2-5,y:-p/2},...tq(c/2-5,-p/2,c/2,-p/2+5,5,5,!0),{x:c/2,y:-p/2+5},{x:c/2,y:p/2-5},...tq(c/2,p/2-5,c/2-5,p/2,5,5,!0),{x:c/2-5,y:p/2},{x:-c/2+5,y:p/2},...tq(-c/2+5,p/2,-c/2,p/2-5,5,5,!0),{x:-c/2,y:p/2-5},{x:-c/2,y:-p/2+5},...tq(-c/2,-p/2+5,-c/2+5,-p/2,5,5,!0)],b=f(w),$=m.path(b,x),k=i.insert(()=>$,":first-child");return k.attr("class","basic label-container outer-path"),u&&"handDrawn"!==e.look&&k.selectChildren("path").attr("style",u),l&&"handDrawn"!==e.look&&k.selectChildren("path").attr("style",l),g(e,k),e.intersect=function(t){return _.polygon(e,w,t)},i}async function t_(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.UG)(e);e.labelStyle=a;let{shapeSvg:i,bbox:s,label:h}=await d(t,e,y(e)),c=e?.padding??0,f=Math.max(s.width+(e.padding??0)*2,e?.width??0),p=Math.max(s.height+(e.padding??0)*2,e?.height??0),u=-s.width/2-c,m=-s.height/2-c,{cssStyles:x}=e,w=o.Z.svg(i),b=(0,r._q)(e,{});"handDrawn"!==e.look&&(b.roughness=0,b.fillStyle="solid");let $=w.polygon([{x:u,y:m},{x:u+f+8,y:m},{x:u+f+8,y:m+p},{x:u-8,y:m+p},{x:u-8,y:m},{x:u,y:m},{x:u,y:m+p}].map(t=>[t.x,t.y]),b),k=i.insert(()=>$,":first-child");return k.attr("class","basic label-container").attr("style",(0,n.R7)(x)),l&&"handDrawn"!==e.look&&k.selectAll("path").attr("style",l),x&&"handDrawn"!==e.look&&k.selectAll("path").attr("style",l),h.attr("transform",`translate(${-f/2+4+(e.padding??0)-(s.x-(s.left??0))},${-p/2+(e.padding??0)-(s.y-(s.top??0))})`),g(e,k),e.intersect=function(t){return _.rect(e,t)},i}async function tP(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.UG)(e);e.labelStyle=a;let{shapeSvg:i,bbox:n,label:s}=await d(t,e,y(e)),h=Math.max(n.width+(e.padding??0)*2,e?.width??0),c=Math.max(n.height+(e.padding??0)*2,e?.height??0),p=-h/2,u=-c/2,{cssStyles:m}=e,x=o.Z.svg(i),w=(0,r._q)(e,{});"handDrawn"!==e.look&&(w.roughness=0,w.fillStyle="solid");let b=[{x:p,y:u},{x:p,y:u+c},{x:p+h,y:u+c},{x:p+h,y:u-c/2}],$=f(b),k=x.path($,w),M=i.insert(()=>k,":first-child");return M.attr("class","basic label-container"),m&&"handDrawn"!==e.look&&M.selectChildren("path").attr("style",m),l&&"handDrawn"!==e.look&&M.selectChildren("path").attr("style",l),M.attr("transform",`translate(0, ${c/4})`),s.attr("transform",`translate(${-h/2+(e.padding??0)-(n.x-(n.left??0))}, ${-c/4+(e.padding??0)-(n.y-(n.top??0))})`),g(e,M),e.intersect=function(t){return _.polygon(e,b,t)},i}async function tZ(t,e){let a={rx:0,ry:0,classes:"",labelPaddingX:2*(e?.padding||0),labelPaddingY:1*(e?.padding||0)};return tu(t,e,a)}async function tU(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.UG)(e);e.labelStyle=a;let{shapeSvg:i,bbox:n}=await d(t,e,y(e)),s=n.height+e.padding,h=n.width+s/4+e.padding,c=s/2,{cssStyles:p}=e,m=o.Z.svg(i),x=(0,r._q)(e,{});"handDrawn"!==e.look&&(x.roughness=0,x.fillStyle="solid");let w=[{x:-h/2+c,y:-s/2},{x:h/2-c,y:-s/2},...u(-h/2+c,0,c,50,90,270),{x:h/2-c,y:s/2},...u(h/2-c,0,c,50,270,450)],b=f(w),$=m.path(b,x),k=i.insert(()=>$,":first-child");return k.attr("class","basic label-container outer-path"),p&&"handDrawn"!==e.look&&k.selectChildren("path").attr("style",p),l&&"handDrawn"!==e.look&&k.selectChildren("path").attr("style",l),g(e,k),e.intersect=function(t){return _.polygon(e,w,t)},i}async function tG(t,e){return tu(t,e,{rx:5,ry:5,classes:"flowchart-node"})}function tT(t,e,{config:{themeVariables:a}}){let{labelStyles:l,nodeStyles:i}=(0,r.UG)(e);e.labelStyle=l;let{cssStyles:n}=e,{lineColor:s,stateBorder:h,nodeBorder:d}=a,c=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),y=o.Z.svg(c),f=(0,r._q)(e,{});"handDrawn"!==e.look&&(f.roughness=0,f.fillStyle="solid");let p=y.circle(0,0,14,{...f,stroke:s,strokeWidth:2}),u=h??d,m=y.circle(0,0,5,{...f,fill:u,stroke:u,strokeWidth:2,fillStyle:"solid"}),x=c.insert(()=>p,":first-child");return x.insert(()=>m),n&&x.selectAll("path").attr("style",n),i&&x.selectAll("path").attr("style",i),g(e,x),e.intersect=function(t){return _.circle(e,7,t)},c}function tI(t,e,{config:{themeVariables:a}}){let l;let{lineColor:i}=a,n=t.insert("g").attr("class","node default").attr("id",e.domId||e.id);if("handDrawn"===e.look){let t=o.Z.svg(n).circle(0,0,14,(0,r.TA)(i));(l=n.insert(()=>t)).attr("class","state-start").attr("r",7).attr("width",14).attr("height",14)}else(l=n.insert("circle",":first-child")).attr("class","state-start").attr("r",7).attr("width",14).attr("height",14);return g(e,l),e.intersect=function(t){return _.circle(e,7,t)},n}async function tE(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.UG)(e);e.labelStyle=a;let{shapeSvg:i,bbox:s}=await d(t,e,y(e)),h=(e?.padding||0)/2,c=s.width+e.padding,f=s.height+e.padding,p=-s.width/2-h,u=-s.height/2-h,m=[{x:0,y:0},{x:c,y:0},{x:c,y:-f},{x:0,y:-f},{x:0,y:0},{x:-8,y:0},{x:c+8,y:0},{x:c+8,y:-f},{x:-8,y:-f},{x:-8,y:0}];if("handDrawn"===e.look){let t=o.Z.svg(i),a=(0,r._q)(e,{}),l=t.rectangle(p-8,u,c+16,f,a),s=t.line(p,u,p,u+f,a),h=t.line(p+c,u,p+c,u+f,a);i.insert(()=>s,":first-child"),i.insert(()=>h,":first-child");let d=i.insert(()=>l,":first-child"),{cssStyles:y}=e;d.attr("class","basic label-container").attr("style",(0,n.R7)(y)),g(e,d)}else{let t=G(i,c,f,m);l&&t.attr("style",l),g(e,t)}return e.intersect=function(t){return _.polygon(e,m,t)},i}async function tH(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.UG)(e);e.labelStyle=a;let{shapeSvg:i,bbox:n}=await d(t,e,y(e)),s=Math.max(n.width+(e.padding??0)*2,e?.width??0),h=Math.max(n.height+(e.padding??0)*2,e?.height??0),c=-s/2,p=-h/2,u=.2*h,{cssStyles:m}=e,x=o.Z.svg(i),w=(0,r._q)(e,{}),b=[{x:c-u/2,y:p},{x:c+s+u/2,y:p},{x:c+s+u/2,y:p+h},{x:c-u/2,y:p+h}];"handDrawn"!==e.look&&(w.roughness=0,w.fillStyle="solid");let $=f(b),k=x.path($,w),M=f([{x:c+s-u/2,y:p+h},{x:c+s+u/2,y:p+h},{x:c+s+u/2,y:p+h-.2*h}]),S=x.path(M,{...w,fillStyle:"solid"}),D=i.insert(()=>S,":first-child");return D.insert(()=>k,":first-child"),D.attr("class","basic label-container"),m&&"handDrawn"!==e.look&&D.selectAll("path").attr("style",m),l&&"handDrawn"!==e.look&&D.selectAll("path").attr("style",l),g(e,D),e.intersect=function(t){return _.polygon(e,b,t)},i}async function tV(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.UG)(e);e.labelStyle=a;let{shapeSvg:i,bbox:n,label:s}=await d(t,e,y(e)),h=Math.max(n.width+(e.padding??0)*2,e?.width??0),c=Math.max(n.height+(e.padding??0)*2,e?.height??0),u=c/4,m=.2*h,x=.2*c,w=c+u,{cssStyles:b}=e,$=o.Z.svg(i),k=(0,r._q)(e,{});"handDrawn"!==e.look&&(k.roughness=0,k.fillStyle="solid");let M=[{x:-h/2-h/2*.1,y:w/2},...p(-h/2-h/2*.1,w/2,h/2+h/2*.1,w/2,u,.8),{x:h/2+h/2*.1,y:-w/2},{x:-h/2-h/2*.1,y:-w/2}],S=-h/2+h/2*.1,D=-w/2-.4*x,W=[{x:S+h-m,y:(D+c)*1.4},{x:S+h,y:D+c-x},{x:S+h,y:(D+c)*.9},...p(S+h,(D+c)*1.3,S+h-m,(D+c)*1.5,-(.03*c),.5)],v=f(M),C=$.path(v,k),B=f(W),N=$.path(B,{...k,fillStyle:"solid"}),A=i.insert(()=>N,":first-child");return A.insert(()=>C,":first-child"),A.attr("class","basic label-container"),b&&"handDrawn"!==e.look&&A.selectAll("path").attr("style",b),l&&"handDrawn"!==e.look&&A.selectAll("path").attr("style",l),A.attr("transform",`translate(0,${-u/2})`),s.attr("transform",`translate(${-h/2+(e.padding??0)-(n.x-(n.left??0))},${-c/2+(e.padding??0)-u/2-(n.y-(n.top??0))})`),g(e,A),e.intersect=function(t){return _.polygon(e,M,t)},i}async function tY(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.UG)(e);e.labelStyle=a;let{shapeSvg:i,bbox:n}=await d(t,e,y(e)),s=Math.max(n.width+e.padding,e?.width||0),h=Math.max(n.height+e.padding,e?.height||0),o=i.insert("rect",":first-child");return o.attr("class","text").attr("style",l).attr("rx",0).attr("ry",0).attr("x",-s/2).attr("y",-h/2).attr("width",s).attr("height",h),g(e,o),e.intersect=function(t){return _.rect(e,t)},i}(0,s.eW)(tN,"question"),(0,s.eW)(tA,"rect_left_inv_arrow"),(0,s.eW)(tR,"rectWithTitle"),(0,s.eW)(tq,"generateArcPoints"),(0,s.eW)(tL,"roundedRect"),(0,s.eW)(t_,"shadedProcess"),(0,s.eW)(tP,"slopedRect"),(0,s.eW)(tZ,"squareRect"),(0,s.eW)(tU,"stadium"),(0,s.eW)(tG,"state"),(0,s.eW)(tT,"stateEnd"),(0,s.eW)(tI,"stateStart"),(0,s.eW)(tE,"subroutine"),(0,s.eW)(tH,"taggedRect"),(0,s.eW)(tV,"taggedWaveEdgedRectangle"),(0,s.eW)(tY,"text");var tj=(0,s.eW)((t,e,a,l,r,i)=>`M${t},${e}
a${r},${i} 0,0,1 0,${-l}
l${a},0
a${r},${i} 0,0,1 0,${l}
M${a},${-l}
a${r},${i} 0,0,0 0,${l}
l${-a},0`,"createCylinderPathD"),tO=(0,s.eW)((t,e,a,l,r,i)=>`M${t},${e} M${t+a},${e} a${r},${i} 0,0,0 0,${-l} l${-a},0 a${r},${i} 0,0,0 0,${l} l${a},0`,"createOuterCylinderPathD"),tz=(0,s.eW)((t,e,a,l,r,i)=>`M${t+a/2},${-l/2} a${r},${i} 0,0,0 0,${l}`,"createInnerCylinderPathD");async function tF(t,e){let a;let{labelStyles:l,nodeStyles:i}=(0,r.UG)(e);e.labelStyle=l;let{shapeSvg:s,bbox:h,label:c,halfPadding:f}=await d(t,e,y(e)),p="neo"===e.look?2*f:f,u=h.height+p,m=u/2,x=m/(2.5+u/50),w=h.width+x+p,{cssStyles:b}=e;if("handDrawn"===e.look){let t=o.Z.svg(s),l=tO(0,0,w,u,x,m),i=tz(0,0,w,u,x,m),n=t.path(l,(0,r._q)(e,{})),h=t.path(i,(0,r._q)(e,{fill:"none"}));a=s.insert(()=>h,":first-child"),(a=s.insert(()=>n,":first-child")).attr("class","basic label-container"),b&&a.attr("style",b)}else{let t=tj(0,0,w,u,x,m);(a=s.insert("path",":first-child").attr("d",t).attr("class","basic label-container").attr("style",(0,n.R7)(b)).attr("style",i)).attr("class","basic label-container"),b&&a.selectAll("path").attr("style",b),i&&a.selectAll("path").attr("style",i)}return a.attr("label-offset-x",x),a.attr("transform",`translate(${-w/2}, ${u/2} )`),c.attr("transform",`translate(${-(h.width/2)-x-(h.x-(h.left??0))}, ${-(h.height/2)-(h.y-(h.top??0))})`),g(e,a),e.intersect=function(t){let a=_.rect(e,t),l=a.y-(e.y??0);if(0!=m&&(Math.abs(l)<(e.height??0)/2||Math.abs(l)==(e.height??0)/2&&Math.abs(a.x-(e.x??0))>(e.width??0)/2-x)){let r=x*x*(1-l*l/(m*m));0!=r&&(r=Math.sqrt(Math.abs(r))),r=x-r,t.x-(e.x??0)>0&&(r=-r),a.x+=r}return a},s}async function tX(t,e){let a;let{labelStyles:l,nodeStyles:i}=(0,r.UG)(e);e.labelStyle=l;let{shapeSvg:n,bbox:s}=await d(t,e,y(e)),h=s.width+e.padding,c=s.height+e.padding,p=[{x:-3*c/6,y:0},{x:h+3*c/6,y:0},{x:h,y:-c},{x:0,y:-c}],{cssStyles:u}=e;if("handDrawn"===e.look){let t=o.Z.svg(n),l=(0,r._q)(e,{}),i=f(p),s=t.path(i,l);a=n.insert(()=>s,":first-child").attr("transform",`translate(${-h/2}, ${c/2})`),u&&a.attr("style",u)}else a=G(n,h,c,p);return i&&a.attr("style",i),e.width=h,e.height=c,g(e,a),e.intersect=function(t){return _.polygon(e,p,t)},n}async function tJ(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.UG)(e);e.labelStyle=a;let{shapeSvg:i,bbox:n}=await d(t,e,y(e)),s=Math.max(60,n.width+(e.padding??0)*2,e?.width??0),h=Math.max(20,n.height+(e.padding??0)*2,e?.height??0),{cssStyles:c}=e,p=o.Z.svg(i),u=(0,r._q)(e,{});"handDrawn"!==e.look&&(u.roughness=0,u.fillStyle="solid");let m=[{x:-s/2*.8,y:-h/2},{x:s/2*.8,y:-h/2},{x:s/2,y:-h/2*.6},{x:s/2,y:h/2},{x:-s/2,y:h/2},{x:-s/2,y:-h/2*.6}],x=f(m),w=p.path(x,u),b=i.insert(()=>w,":first-child");return b.attr("class","basic label-container"),c&&"handDrawn"!==e.look&&b.selectChildren("path").attr("style",c),l&&"handDrawn"!==e.look&&b.selectChildren("path").attr("style",l),g(e,b),e.intersect=function(t){return _.polygon(e,m,t)},i}async function tK(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.UG)(e);e.labelStyle=a;let{shapeSvg:i,bbox:n,label:h}=await d(t,e,y(e)),c=(0,s.ku)(s.nV().flowchart?.htmlLabels),p=n.width+(e.padding??0),u=p+n.height,m=p+n.height,x=[{x:0,y:0},{x:m,y:0},{x:m/2,y:-u}],{cssStyles:w}=e,b=o.Z.svg(i),$=(0,r._q)(e,{});"handDrawn"!==e.look&&($.roughness=0,$.fillStyle="solid");let k=f(x),M=b.path(k,$),S=i.insert(()=>M,":first-child").attr("transform",`translate(${-u/2}, ${u/2})`);return w&&"handDrawn"!==e.look&&S.selectChildren("path").attr("style",w),l&&"handDrawn"!==e.look&&S.selectChildren("path").attr("style",l),e.width=p,e.height=u,g(e,S),h.attr("transform",`translate(${-n.width/2-(n.x-(n.left??0))}, ${u/2-(n.height+(e.padding??0)/(c?2:1)-(n.y-(n.top??0)))})`),e.intersect=function(t){return s.cM.info("Triangle intersect",e,x,t),_.polygon(e,x,t)},i}async function tQ(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.UG)(e);e.labelStyle=a;let{shapeSvg:i,bbox:n,label:s}=await d(t,e,y(e)),h=Math.max(n.width+(e.padding??0)*2,e?.width??0),c=Math.max(n.height+(e.padding??0)*2,e?.height??0),u=c/8,m=c+u,{cssStyles:x}=e,w=70-h,b=w>0?w/2:0,$=o.Z.svg(i),k=(0,r._q)(e,{});"handDrawn"!==e.look&&(k.roughness=0,k.fillStyle="solid");let M=[{x:-h/2-b,y:m/2},...p(-h/2-b,m/2,h/2+b,m/2,u,.8),{x:h/2+b,y:-m/2},{x:-h/2-b,y:-m/2}],S=f(M),D=$.path(S,k),W=i.insert(()=>D,":first-child");return W.attr("class","basic label-container"),x&&"handDrawn"!==e.look&&W.selectAll("path").attr("style",x),l&&"handDrawn"!==e.look&&W.selectAll("path").attr("style",l),W.attr("transform",`translate(0,${-u/2})`),s.attr("transform",`translate(${-h/2+(e.padding??0)-(n.x-(n.left??0))},${-c/2+(e.padding??0)-u-(n.y-(n.top??0))})`),g(e,W),e.intersect=function(t){return _.polygon(e,M,t)},i}async function t0(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.UG)(e);e.labelStyle=a;let{shapeSvg:i,bbox:n}=await d(t,e,y(e)),s=Math.max(n.width+(e.padding??0)*2,e?.width??0),h=Math.max(n.height+(e.padding??0)*2,e?.height??0),c=s/h,u=s,m=h;u>m*c?m=u/c:u=m*c,u=Math.max(u,100);let x=Math.min(.2*(m=Math.max(m,50)),m/4),w=m+2*x,{cssStyles:b}=e,$=o.Z.svg(i),k=(0,r._q)(e,{});"handDrawn"!==e.look&&(k.roughness=0,k.fillStyle="solid");let M=[{x:-u/2,y:w/2},...p(-u/2,w/2,u/2,w/2,x,1),{x:u/2,y:-w/2},...p(u/2,-w/2,-u/2,-w/2,x,-1)],S=f(M),D=$.path(S,k),W=i.insert(()=>D,":first-child");return W.attr("class","basic label-container"),b&&"handDrawn"!==e.look&&W.selectAll("path").attr("style",b),l&&"handDrawn"!==e.look&&W.selectAll("path").attr("style",l),g(e,W),e.intersect=function(t){return _.polygon(e,M,t)},i}async function t2(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.UG)(e);e.labelStyle=a;let{shapeSvg:i,bbox:n,label:s}=await d(t,e,y(e)),h=Math.max(n.width+(e.padding??0)*2,e?.width??0),c=Math.max(n.height+(e.padding??0)*2,e?.height??0),f=-h/2,p=-c/2,{cssStyles:u}=e,m=o.Z.svg(i),x=(0,r._q)(e,{}),w=[{x:f-5,y:p-5},{x:f-5,y:p+c},{x:f+h,y:p+c},{x:f+h,y:p-5}],b=`M${f-5},${p-5} L${f+h},${p-5} L${f+h},${p+c} L${f-5},${p+c} L${f-5},${p-5}
M${f-5},${p} L${f+h},${p}
M${f},${p-5} L${f},${p+c}`;"handDrawn"!==e.look&&(x.roughness=0,x.fillStyle="solid");let $=m.path(b,x),k=i.insert(()=>$,":first-child");return k.attr("transform","translate(2.5, 2.5)"),k.attr("class","basic label-container"),u&&"handDrawn"!==e.look&&k.selectAll("path").attr("style",u),l&&"handDrawn"!==e.look&&k.selectAll("path").attr("style",l),s.attr("transform",`translate(${-(n.width/2)+2.5-(n.x-(n.left??0))}, ${-(n.height/2)+2.5-(n.y-(n.top??0))})`),g(e,k),e.intersect=function(t){return _.polygon(e,w,t)},i}async function t1(t,e){if(e.alias&&(e.label=e.alias),"handDrawn"===e.look){let{themeVariables:a}=(0,s.iE)(),{background:l}=a,r={...e,id:e.id+"-background",look:"default",cssStyles:["stroke: none",`fill: ${l}`]};await t1(t,r)}let a=(0,s.iE)();e.useHtmlLabels=a.htmlLabels;let l=a.er?.diagramPadding??10,i=a.er?.entityPadding??6,{cssStyles:d}=e,{labelStyles:c,nodeStyles:f}=(0,r.UG)(e);if(0===e.attributes.length&&e.label){let r={rx:0,ry:0,labelPaddingX:l,labelPaddingY:1.5*l,classes:""};(0,n.Cq)(e.label,a)+2*r.labelPaddingX<a.er.minEntityWidth&&(e.width=a.er.minEntityWidth);let i=await tu(t,e,r);if(!(0,s.ku)(a.htmlLabels)){let t=i.select("text"),e=t.node()?.getBBox();t.attr("transform",`translate(${-e.width/2}, 0)`)}return i}a.htmlLabels||(l*=1.25,i*=1.25);let p=y(e);p||(p="node default");let u=t.insert("g").attr("class",p).attr("id",e.domId||e.id),m=await t5(u,e.label??"",a,0,0,["name"],c);m.height+=i;let x=0,w=[],b=[],$=0,k=0,M=0,S=0,D=!0,W=!0;for(let t of e.attributes){let e=await t5(u,t.type,a,0,x,["attribute-type"],c);$=Math.max($,e.width+l);let r=await t5(u,t.name,a,0,x,["attribute-name"],c);k=Math.max(k,r.width+l);let n=await t5(u,t.keys.join(),a,0,x,["attribute-keys"],c);M=Math.max(M,n.width+l);let s=await t5(u,t.comment,a,0,x,["attribute-comment"],c);S=Math.max(S,s.width+l);let h=Math.max(e.height,r.height,n.height,s.height)+i;b.push({yOffset:x,rowHeight:h}),x+=h}let v=4;M<=l&&(D=!1,M=0,v--),S<=l&&(W=!1,S=0,v--);let C=u.node().getBBox();if(m.width+2*l-($+k+M+S)>0){let t=m.width+2*l-($+k+M+S);$+=t/v,k+=t/v,M>0&&(M+=t/v),S>0&&(S+=t/v)}let B=$+k+M+S,N=o.Z.svg(u),A=(0,r._q)(e,{});"handDrawn"!==e.look&&(A.roughness=0,A.fillStyle="solid");let R=0;b.length>0&&(R=b.reduce((t,e)=>t+(e?.rowHeight??0),0));let q=Math.max(C.width+2*l,e?.width||0,B),L=Math.max((R??0)+m.height,e?.height||0),P=-q/2,Z=-L/2;u.selectAll("g:not(:first-child)").each((t,e,a)=>{let r=(0,h.Ys)(a[e]),n=r.attr("transform"),s=0,o=0;if(n){let t=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(n);t&&(s=parseFloat(t[1]),o=parseFloat(t[2]),r.attr("class").includes("attribute-name")?s+=$:r.attr("class").includes("attribute-keys")?s+=$+k:r.attr("class").includes("attribute-comment")&&(s+=$+k+M))}r.attr("transform",`translate(${P+l/2+s}, ${o+Z+m.height+i/2})`)}),u.select(".name").attr("transform","translate("+-m.width/2+", "+(Z+i/2)+")");let U=N.rectangle(P,Z,q,L,A),G=u.insert(()=>U,":first-child").attr("style",d.join("")),{themeVariables:T}=(0,s.iE)(),{rowEven:I,rowOdd:E,nodeBorder:H}=T;for(let[t,e]of(w.push(0),b.entries())){let a=(t+1)%2==0&&0!==e.yOffset,l=N.rectangle(P,m.height+Z+e?.yOffset,q,e?.rowHeight,{...A,fill:a?I:E,stroke:H});u.insert(()=>l,"g.label").attr("style",d.join("")).attr("class",`row-rect-${a?"even":"odd"}`)}let V=N.line(P,m.height+Z,q+P,m.height+Z,A);for(let t of(u.insert(()=>V).attr("class","divider"),V=N.line($+P,m.height+Z,$+P,L+Z,A),u.insert(()=>V).attr("class","divider"),D&&(V=N.line($+k+P,m.height+Z,$+k+P,L+Z,A),u.insert(()=>V).attr("class","divider")),W&&(V=N.line($+k+M+P,m.height+Z,$+k+M+P,L+Z,A),u.insert(()=>V).attr("class","divider")),w))V=N.line(P,m.height+Z+t,q+P,m.height+Z+t,A),u.insert(()=>V).attr("class","divider");if(g(e,G),f&&"handDrawn"!==e.look){let t=f.split(";"),e=t?.filter(t=>t.includes("stroke"))?.map(t=>`${t}`).join("; ");u.selectAll("path").attr("style",e??""),u.selectAll(".row-rect-even path").attr("style",f)}return e.intersect=function(t){return _.rect(e,t)},u}async function t5(t,e,a,l=0,r=0,o=[],d=""){let c=t.insert("g").attr("class",`label ${o.join(" ")}`).attr("transform",`translate(${l}, ${r})`).attr("style",d);e!==(0,s.UO)(e)&&(e=(e=(0,s.UO)(e)).replaceAll("<","&lt;").replaceAll(">","&gt;"));let g=c.node().appendChild(await (0,i.rw)(c,e,{width:(0,n.Cq)(e,a)+100,style:d,useHtmlLabels:a.htmlLabels},a));if(e.includes("&lt;")||e.includes("&gt;")){let t=g.children[0];for(t.textContent=t.textContent.replaceAll("&lt;","<").replaceAll("&gt;",">");t.childNodes[0];)(t=t.childNodes[0]).textContent=t.textContent.replaceAll("&lt;","<").replaceAll("&gt;",">")}let y=g.getBBox();if((0,s.ku)(a.htmlLabels)){let t=g.children[0];t.style.textAlign="start";let e=(0,h.Ys)(g);y=t.getBoundingClientRect(),e.attr("width",y.width),e.attr("height",y.height)}return y}async function t8(t,e,a,l,r=a.class.padding??12){let i=l?0:3,n=t.insert("g").attr("class",y(e)).attr("id",e.domId||e.id),s=null,h=null,o=null,d=null,c=0,g=0,f=0;if(s=n.insert("g").attr("class","annotation-group text"),e.annotations.length>0){let t=e.annotations[0];await t4(s,{text:`\xab${t}\xbb`},0),c=s.node().getBBox().height}h=n.insert("g").attr("class","label-group text"),await t4(h,e,0,["font-weight: bolder"]);let p=h.node().getBBox();g=p.height,o=n.insert("g").attr("class","members-group text");let u=0;for(let t of e.members){let e=await t4(o,t,u,[t.parseClassifier()]);u+=e+i}(f=o.node().getBBox().height)<=0&&(f=r/2),d=n.insert("g").attr("class","methods-group text");let m=0;for(let t of e.methods){let e=await t4(d,t,m,[t.parseClassifier()]);m+=e+i}let x=n.node().getBBox();if(null!==s){let t=s.node().getBBox();s.attr("transform",`translate(${-t.width/2})`)}return h.attr("transform",`translate(${-p.width/2}, ${c})`),x=n.node().getBBox(),o.attr("transform",`translate(0, ${c+g+2*r})`),x=n.node().getBBox(),d.attr("transform",`translate(0, ${c+g+(f?f+4*r:2*r)})`),x=n.node().getBBox(),{shapeSvg:n,bbox:x}}async function t4(t,e,a,l=[]){let r;let o=t.insert("g").attr("class","label").attr("style",l.join("; ")),d=(0,s.iE)(),c="useHtmlLabels"in e?e.useHtmlLabels:(0,s.ku)(d.htmlLabels)??!0,g="";g="text"in e?e.text:e.label,!c&&g.startsWith("\\")&&(g=g.substring(1)),(0,s.l0)(g)&&(c=!0);let y=await (0,i.rw)(o,(0,s.uX)((0,n.SH)(g)),{width:(0,n.Cq)(g,d)+50,classes:"markdown-node-label",useHtmlLabels:c},d),f=1;if(c){let t=y.children[0],e=(0,h.Ys)(y);f=t.innerHTML.split("<br>").length,t.innerHTML.includes("</math>")&&(f+=t.innerHTML.split("<mrow>").length-1);let a=t.getElementsByTagName("img");if(a){let t=""===g.replace(/<img[^>]*>/g,"").trim();await Promise.all([...a].map(e=>new Promise(a=>{function l(){if(e.style.display="flex",e.style.flexDirection="column",t){let t=5*parseInt(d.fontSize?.toString()??window.getComputedStyle(document.body).fontSize,10)+"px";e.style.minWidth=t,e.style.maxWidth=t}else e.style.width="100%";a(e)}(0,s.eW)(l,"setupImage"),setTimeout(()=>{e.complete&&l()}),e.addEventListener("error",l),e.addEventListener("load",l)})))}r=t.getBoundingClientRect(),e.attr("width",r.width),e.attr("height",r.height)}else{l.includes("font-weight: bolder")&&(0,h.Ys)(y).selectAll("tspan").attr("font-weight",""),f=y.children.length;let t=y.children[0];(""===y.textContent||y.textContent.includes("&gt"))&&(t.textContent=g[0]+g.substring(1).replaceAll("&gt;",">").replaceAll("&lt;","<").trim()," "===g[1]&&(t.textContent=t.textContent[0]+" "+t.textContent.substring(1))),"undefined"===t.textContent&&(t.textContent=""),r=y.getBBox()}return o.attr("transform","translate(0,"+(-r.height/(2*f)+a)+")"),r.height}async function t7(t,e){let a=(0,s.nV)(),l=a.class.padding??12,i=e.useHtmlLabels??(0,s.ku)(a.htmlLabels)??!0;e.annotations=e.annotations??[],e.members=e.members??[],e.methods=e.methods??[];let{shapeSvg:n,bbox:d}=await t8(t,e,a,i,l),{labelStyles:c,nodeStyles:y}=(0,r.UG)(e);e.labelStyle=c,e.cssStyles=e.styles||"";let f=e.styles?.join(";")||y||"";e.cssStyles||(e.cssStyles=f.replaceAll("!important","").split(";"));let p=0===e.members.length&&0===e.methods.length&&!a.class?.hideEmptyMembersBox,u=o.Z.svg(n),m=(0,r._q)(e,{});"handDrawn"!==e.look&&(m.roughness=0,m.fillStyle="solid");let x=d.width,w=d.height;0===e.members.length&&0===e.methods.length?w+=l:e.members.length>0&&0===e.methods.length&&(w+=2*l);let b=-x/2,$=-w/2,k=u.rectangle(b-l,$-l-(p?l:0===e.members.length&&0===e.methods.length?-l/2:0),x+2*l,w+2*l+(p?2*l:0===e.members.length&&0===e.methods.length?-l:0),m),M=n.insert(()=>k,":first-child");M.attr("class","basic label-container");let S=M.node().getBBox();n.selectAll(".text").each((t,a,r)=>{let s=(0,h.Ys)(r[a]),o=s.attr("transform"),d=0;if(o){let t=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(o);t&&(d=parseFloat(t[2]))}let c=d+$+l-(p?l:0===e.members.length&&0===e.methods.length?-l/2:0);i||(c-=4);let g=b;(s.attr("class").includes("label-group")||s.attr("class").includes("annotation-group"))&&(g=-s.node()?.getBBox().width/2||0,n.selectAll("text").each(function(t,e,a){"middle"===window.getComputedStyle(a[e]).textAnchor&&(g=0)})),s.attr("transform",`translate(${g}, ${c})`)});let D=n.select(".annotation-group").node().getBBox().height-(p?l/2:0)||0,W=n.select(".label-group").node().getBBox().height-(p?l/2:0)||0,v=n.select(".members-group").node().getBBox().height-(p?l/2:0)||0;if(e.members.length>0||e.methods.length>0||p){let t=u.line(S.x,D+W+$+l,S.x+S.width,D+W+$+l,m);n.insert(()=>t).attr("class","divider").attr("style",f)}if(p||e.members.length>0||e.methods.length>0){let t=u.line(S.x,D+W+v+$+2*l+l,S.x+S.width,D+W+v+$+l+2*l,m);n.insert(()=>t).attr("class","divider").attr("style",f)}if("handDrawn"!==e.look&&n.selectAll("path").attr("style",f),M.select(":nth-child(2)").attr("style",f),n.selectAll(".divider").select("path").attr("style",f),e.labelStyle?n.selectAll("span").attr("style",e.labelStyle):n.selectAll("span").attr("style",f),!i){let t=RegExp(/color\s*:\s*([^;]*)/),e=t.exec(f);if(e){let t=e[0].replace("color","fill");n.selectAll("tspan").attr("style",t)}else if(c){let e=t.exec(c);if(e){let t=e[0].replace("color","fill");n.selectAll("tspan").attr("style",t)}}}return g(e,M),e.intersect=function(t){return _.rect(e,t)},n}async function t9(t,e){let a;let{labelStyles:l,nodeStyles:i}=(0,r.UG)(e);e.labelStyle=l;let n="verifyMethod"in e,s=y(e),d=t.insert("g").attr("class",s).attr("id",e.domId??e.id),c=a=n?await t3(d,`&lt;&lt;${e.type}&gt;&gt;`,0,e.labelStyle):await t3(d,"&lt;&lt;Element&gt;&gt;",0,e.labelStyle),f=await t3(d,e.name,c,e.labelStyle+"; font-weight: bold;");if(c+=f+20,n){let t=await t3(d,`${e.requirementId?`ID: ${e.requirementId}`:""}`,c,e.labelStyle);c+=t;let a=await t3(d,`${e.text?`Text: ${e.text}`:""}`,c,e.labelStyle);c+=a;let l=await t3(d,`${e.risk?`Risk: ${e.risk}`:""}`,c,e.labelStyle);c+=l,await t3(d,`${e.verifyMethod?`Verification: ${e.verifyMethod}`:""}`,c,e.labelStyle)}else{let t=await t3(d,`${e.type?`Type: ${e.type}`:""}`,c,e.labelStyle);c+=t,await t3(d,`${e.docRef?`Doc Ref: ${e.docRef}`:""}`,c,e.labelStyle)}let p=(d.node()?.getBBox().width??200)+20,u=(d.node()?.getBBox().height??200)+20,m=-p/2,x=-u/2,w=o.Z.svg(d),b=(0,r._q)(e,{});"handDrawn"!==e.look&&(b.roughness=0,b.fillStyle="solid");let $=w.rectangle(m,x,p,u,b),k=d.insert(()=>$,":first-child");if(k.attr("class","basic label-container").attr("style",i),d.selectAll(".label").each((t,e,a)=>{let l=(0,h.Ys)(a[e]),r=l.attr("transform"),i=0,n=0;if(r){let t=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(r);t&&(i=parseFloat(t[1]),n=parseFloat(t[2]))}let s=n-u/2,o=m+10;(0===e||1===e)&&(o=i),l.attr("transform",`translate(${o}, ${s+20})`)}),c>a+f+20){let t=w.line(m,x+a+f+20,m+p,x+a+f+20,b);d.insert(()=>t).attr("style",i)}return g(e,k),e.intersect=function(t){return _.rect(e,t)},d}async function t3(t,e,a,l=""){let r;if(""===e)return 0;let o=t.insert("g").attr("class","label").attr("style",l),d=(0,s.nV)(),c=d.htmlLabels??!0,g=await (0,i.rw)(o,(0,s.uX)((0,n.SH)(e)),{width:(0,n.Cq)(e,d)+50,classes:"markdown-node-label",useHtmlLabels:c,style:l},d);if(c){let t=g.children[0],e=(0,h.Ys)(g);r=t.getBoundingClientRect(),e.attr("width",r.width),e.attr("height",r.height)}else{for(let t of g.children[0].children)t.textContent=t.textContent.replaceAll("&gt;",">").replaceAll("&lt;","<"),l&&t.setAttribute("style",l);r=g.getBBox(),r.height+=6}return o.attr("transform",`translate(${-r.width/2},${-r.height/2+a})`),r.height}(0,s.eW)(tF,"tiltedCylinder"),(0,s.eW)(tX,"trapezoid"),(0,s.eW)(tJ,"trapezoidalPentagon"),(0,s.eW)(tK,"triangle"),(0,s.eW)(tQ,"waveEdgedRectangle"),(0,s.eW)(t0,"waveRectangle"),(0,s.eW)(t2,"windowPane"),(0,s.eW)(t1,"erBox"),(0,s.eW)(t5,"addText"),(0,s.eW)(t8,"textHelper"),(0,s.eW)(t4,"addText"),(0,s.eW)(t7,"classBox"),(0,s.eW)(t9,"requirementBox"),(0,s.eW)(t3,"addText");var t6=(0,s.eW)(t=>{switch(t){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 et(t,e,{config:a}){let l,i,n,s;let{labelStyles:h,nodeStyles:f}=(0,r.UG)(e);e.labelStyle=h||"";let p=e.width;e.width=(e.width??200)-10;let{shapeSvg:u,bbox:m,label:x}=await d(t,e,y(e)),w=e.padding||10,b="";"ticket"in e&&e.ticket&&a?.kanban?.ticketBaseUrl&&(b=a?.kanban?.ticketBaseUrl.replace("#TICKET#",e.ticket),l=u.insert("svg:a",":first-child").attr("class","kanban-ticket-link").attr("xlink:href",b).attr("target","_blank"));let k={useHtmlLabels:e.useHtmlLabels,labelStyle:e.labelStyle||"",width:e.width,img:e.img,padding:e.padding||8,centerLabel:!1};l?{label:i,bbox:n}=await c(l,"ticket"in e&&e.ticket||"",k):{label:i,bbox:n}=await c(u,"ticket"in e&&e.ticket||"",k);let{label:M,bbox:S}=await c(u,"assigned"in e&&e.assigned||"",k);e.width=p;let D=e?.width||0,W=Math.max(n.height,S.height)/2,v=Math.max(m.height+20,e?.height||0)+W,C=-D/2,B=-v/2;x.attr("transform","translate("+(w-D/2)+", "+(-W-m.height/2)+")"),i.attr("transform","translate("+(w-D/2)+", "+(-W+m.height/2)+")"),M.attr("transform","translate("+(w+D/2-S.width-20)+", "+(-W+m.height/2)+")");let{rx:N,ry:A}=e,{cssStyles:R}=e;if("handDrawn"===e.look){let t=o.Z.svg(u),a=(0,r._q)(e,{}),l=N||A?t.path($(C,B,D,v,N||0),a):t.rectangle(C,B,D,v,a);(s=u.insert(()=>l,":first-child")).attr("class","basic label-container").attr("style",R||null)}else{(s=u.insert("rect",":first-child")).attr("class","basic label-container __APA__").attr("style",f).attr("rx",N??5).attr("ry",A??5).attr("x",C).attr("y",B).attr("width",D).attr("height",v);let t="priority"in e&&e.priority;if(t){let e=u.append("line"),a=C+2,l=B+Math.floor((N??0)/2),r=B+v-Math.floor((N??0)/2);e.attr("x1",a).attr("y1",l).attr("x2",a).attr("y2",r).attr("stroke-width","4").attr("stroke",t6(t))}}return g(e,s),e.height=v,e.intersect=function(t){return _.rect(e,t)},u}(0,s.eW)(et,"kanbanItem");var ee=[{semanticName:"Process",name:"Rectangle",shortName:"rect",description:"Standard process shape",aliases:["proc","process","rectangle"],internalAliases:["squareRect"],handler:tZ},{semanticName:"Event",name:"Rounded Rectangle",shortName:"rounded",description:"Represents an event",aliases:["event"],internalAliases:["roundedRect"],handler:tL},{semanticName:"Terminal Point",name:"Stadium",shortName:"stadium",description:"Terminal point",aliases:["terminal","pill"],handler:tU},{semanticName:"Subprocess",name:"Framed Rectangle",shortName:"fr-rect",description:"Subprocess",aliases:["subprocess","subproc","framed-rectangle","subroutine"],handler:tE},{semanticName:"Database",name:"Cylinder",shortName:"cyl",description:"Database storage",aliases:["db","database","cylinder"],handler:te},{semanticName:"Start",name:"Circle",shortName:"circle",description:"Starting point",aliases:["circ"],handler:E},{semanticName:"Decision",name:"Diamond",shortName:"diam",description:"Decision-making step",aliases:["decision","diamond","question"],handler:tN},{semanticName:"Prepare Conditional",name:"Hexagon",shortName:"hex",description:"Preparation or condition step",aliases:["hexagon","prepare"],handler:th},{semanticName:"Data Input/Output",name:"Lean Right",shortName:"lean-r",description:"Represents input or output",aliases:["lean-right","in-out"],internalAliases:["lean_right"],handler:tw},{semanticName:"Data Input/Output",name:"Lean Left",shortName:"lean-l",description:"Represents output or input",aliases:["lean-left","out-in"],internalAliases:["lean_left"],handler:tx},{semanticName:"Priority Action",name:"Trapezoid Base Bottom",shortName:"trap-b",description:"Priority action",aliases:["priority","trapezoid-bottom","trapezoid"],handler:tX},{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:tp},{semanticName:"Stop",name:"Double Circle",shortName:"dbl-circ",description:"Represents a stop point",aliases:["double-circle"],internalAliases:["doublecircle"],handler:tl},{semanticName:"Text Block",name:"Text Block",shortName:"text",description:"Text block",handler:tY},{semanticName:"Card",name:"Notched Rectangle",shortName:"notch-rect",description:"Represents a card",aliases:["card","notched-rectangle"],handler:T},{semanticName:"Lined/Shaded Process",name:"Lined Rectangle",shortName:"lin-rect",description:"Lined process shape",aliases:["lined-rectangle","lined-process","lin-proc","shaded-process"],handler:t_},{semanticName:"Start",name:"Small Circle",shortName:"sm-circ",description:"Small starting point",aliases:["start","small-circle"],internalAliases:["stateStart"],handler:tI},{semanticName:"Stop",name:"Framed Circle",shortName:"fr-circ",description:"Stop point",aliases:["stop","framed-circle"],internalAliases:["stateEnd"],handler:tT},{semanticName:"Fork/Join",name:"Filled Rectangle",shortName:"fork",description:"Fork or join in process flow",aliases:["join"],internalAliases:["forkJoin"],handler:tn},{semanticName:"Collate",name:"Hourglass",shortName:"hourglass",description:"Represents a collate operation",aliases:["hourglass","collate"],handler:to},{semanticName:"Comment",name:"Curly Brace",shortName:"brace",description:"Adds a comment",aliases:["comment","brace-l"],handler:j},{semanticName:"Comment Right",name:"Curly Brace",shortName:"brace-r",description:"Adds a comment",handler:z},{semanticName:"Comment with braces on both sides",name:"Curly Braces",shortName:"braces",description:"Adds a comment",handler:X},{semanticName:"Com Link",name:"Lightning Bolt",shortName:"bolt",description:"Communication link",aliases:["com-link","lightning-bolt"],handler:tb},{semanticName:"Document",name:"Document",shortName:"doc",description:"Represents a document",aliases:["doc","document"],handler:tQ},{semanticName:"Delay",name:"Half-Rounded Rectangle",shortName:"delay",description:"Represents a delay",aliases:["half-rounded-rectangle"],handler:ts},{semanticName:"Direct Access Storage",name:"Horizontal Cylinder",shortName:"h-cyl",description:"Direct access storage",aliases:["das","horizontal-cylinder"],handler:tF},{semanticName:"Disk Storage",name:"Lined Cylinder",shortName:"lin-cyl",description:"Disk storage",aliases:["disk","lined-cylinder"],handler:tS},{semanticName:"Display",name:"Curved Trapezoid",shortName:"curv-trap",description:"Represents a display",aliases:["curved-trapezoid","display"],handler:J},{semanticName:"Divided Process",name:"Divided Rectangle",shortName:"div-rect",description:"Divided process shape",aliases:["div-proc","divided-rectangle","divided-process"],handler:ta},{semanticName:"Extract",name:"Triangle",shortName:"tri",description:"Extraction process",aliases:["extract","triangle"],handler:tK},{semanticName:"Internal Storage",name:"Window Pane",shortName:"win-pane",description:"Internal storage",aliases:["internal-storage","window-pane"],handler:t2},{semanticName:"Junction",name:"Filled Circle",shortName:"f-circ",description:"Junction point",aliases:["junction","filled-circle"],handler:tr},{semanticName:"Loop Limit",name:"Trapezoidal Pentagon",shortName:"notch-pent",description:"Loop limit step",aliases:["loop-limit","notched-pentagon"],handler:tJ},{semanticName:"Manual File",name:"Flipped Triangle",shortName:"flip-tri",description:"Manual file operation",aliases:["manual-file","flipped-triangle"],handler:ti},{semanticName:"Manual Input",name:"Sloped Rectangle",shortName:"sl-rect",description:"Manual input step",aliases:["manual-input","sloped-rectangle"],handler:tP},{semanticName:"Multi-Document",name:"Stacked Document",shortName:"docs",description:"Multiple documents",aliases:["documents","st-doc","stacked-document"],handler:tv},{semanticName:"Multi-Process",name:"Stacked Rectangle",shortName:"st-rect",description:"Multiple processes",aliases:["procs","processes","stacked-rectangle"],handler:tW},{semanticName:"Stored Data",name:"Bow Tie Rectangle",shortName:"bow-rect",description:"Stored data",aliases:["stored-data","bow-tie-rectangle"],handler:U},{semanticName:"Summary",name:"Crossed Circle",shortName:"cross-circ",description:"Summary",aliases:["summary","crossed-circle"],handler:V},{semanticName:"Tagged Document",name:"Tagged Document",shortName:"tag-doc",description:"Tagged document",aliases:["tag-doc","tagged-document"],handler:tV},{semanticName:"Tagged Process",name:"Tagged Rectangle",shortName:"tag-rect",description:"Tagged process",aliases:["tagged-rectangle","tag-proc","tagged-process"],handler:tH},{semanticName:"Paper Tape",name:"Flag",shortName:"flag",description:"Paper tape",aliases:["paper-tape"],handler:t0},{semanticName:"Odd",name:"Odd",shortName:"odd",description:"Odd shape",internalAliases:["rect_left_inv_arrow"],handler:tA},{semanticName:"Lined Document",name:"Lined Document",shortName:"lin-doc",description:"Lined document",aliases:["lined-document"],handler:tD}],ea=(0,s.eW)(()=>Object.fromEntries([...Object.entries({state:tG,choice:I,note:tC,rectWithTitle:tR,labelRect:tm,iconSquare:ty,iconCircle:tc,icon:td,iconRounded:tg,imageSquare:tf,anchor:P,kanbanItem:et,classBox:t7,erBox:t1,requirementBox:t9}),...ee.flatMap(t=>[t.shortName,..."aliases"in t?t.aliases:[],..."internalAliases"in t?t.internalAliases:[]].map(e=>[e,t.handler]))]),"generateShapeMap")();function el(t){return t in ea}(0,s.eW)(el,"isValidShape");var er=new Map;async function ei(t,e,a){let l,r;"rect"===e.shape&&(e.rx&&e.ry?e.shape="roundedRect":e.shape="squareRect");let i=e.shape?ea[e.shape]:void 0;if(!i)throw Error(`No such shape: ${e.shape}. Please check your syntax.`);if(e.link){let n;"sandbox"===a.config.securityLevel?n="_top":e.linkTarget&&(n=e.linkTarget||"_blank"),l=t.insert("svg:a").attr("xlink:href",e.link).attr("target",n??null),r=await i(l,e,a)}else l=r=await i(t,e,a);return e.tooltip&&r.attr("title",e.tooltip),er.set(e.id,l),e.haveCallback&&l.attr("class",l.attr("class")+" clickable"),l}(0,s.eW)(ei,"insertNode");var en=(0,s.eW)((t,e)=>{er.set(e.id,t)},"setNodeElem"),es=(0,s.eW)(()=>{er.clear()},"clear"),eh=(0,s.eW)(t=>{let e=er.get(t.id);s.cM.trace("Transforming node",t.diff,t,"translate("+(t.x-t.width/2-5)+", "+t.width/2+")");let a=t.diff||0;return t.clusterNode?e.attr("transform","translate("+(t.x+a-t.width/2)+", "+(t.y-t.height/2-8)+")"):e.attr("transform","translate("+t.x+", "+t.y+")"),a},"positionNode")}}]);