/g,`
+`)),a+=d+n[l+1]}),a}function dke(t,{markdownAutoWrap:e}){const n=t.replace(/
/g,`
`).replace(/\n{2,}/g,`
-`);return uke(n)}w(hke,"preprocessMarkdown");function dke(t){return t.split(/\\n|\n|
/gi).map(e=>{var r;return((r=e.trim().match(/<[^>]+>|[^\s<>]+/g))==null?void 0:r.map(n=>({content:n,type:"normal"})))??[]})}w(dke,"nonMarkdownToLines");function fke(t,e={}){const r=hke(t,e),n=pi.lexer(r),i=[[]];let s=0;function a(o,l="normal"){o.type==="text"?o.text.split(`
-`).forEach((h,d)=>{d!==0&&(s++,i.push([])),h.split(" ").forEach(f=>{f=f.replace(/'/g,"'"),f&&i[s].push({content:f,type:l})})}):o.type==="strong"||o.type==="em"?o.tokens.forEach(u=>{a(u,o.type)}):o.type==="html"&&i[s].push({content:o.text,type:"normal"})}return w(a,"processNode"),n.forEach(o=>{var l;o.type==="paragraph"?(l=o.tokens)==null||l.forEach(u=>{a(u)}):o.type==="html"?i[s].push({content:o.text,type:"normal"}):i[s].push({content:o.raw,type:"normal"})}),i}w(fke,"markdownToLines");function pke(t){return t?`${t.replace(/\\n|\n/g,"
")}
`:""}w(pke,"nonMarkdownToHTML");function gke(t,{markdownAutoWrap:e}={}){const r=pi.lexer(t);function n(i){var s,a,o;return i.type==="text"?e===!1?i.text.replace(/\n */g,"
").replace(/ /g," "):i.text.replace(/\n */g,"
"):i.type==="strong"?`${(s=i.tokens)==null?void 0:s.map(n).join("")}`:i.type==="em"?`${(a=i.tokens)==null?void 0:a.map(n).join("")}`:i.type==="paragraph"?`${(o=i.tokens)==null?void 0:o.map(n).join("")}
`:i.type==="space"?"":i.type==="html"?`${i.text}`:i.type==="escape"?i.text:(de.warn(`Unsupported markdown: ${i.type}`),i.raw)}return w(n,"output"),r.map(n).join("")}w(gke,"markdownToHTML");function mke(t){return Intl.Segmenter?[...new Intl.Segmenter().segment(t)].map(e=>e.segment):[...t]}w(mke,"splitTextToChars");function yke(t,e){const r=mke(e.content);return SZ(t,[],r,e.type)}w(yke,"splitWordToFitWidth");function SZ(t,e,r,n){if(r.length===0)return[{content:e.join(""),type:n},{content:"",type:n}];const[i,...s]=r,a=[...e,i];return t([{content:a.join(""),type:n}])?SZ(t,a,s,n):(e.length===0&&i&&(e.push(i),r.shift()),[{content:e.join(""),type:n},{content:r.join(""),type:n}])}w(SZ,"splitWordToFitWidthRecursion");function vke(t,e){if(t.some(({content:r})=>r.includes(`
-`)))throw new Error("splitLineToFitWidth does not support newlines in the line");return h_(t,e)}w(vke,"splitLineToFitWidth");function h_(t,e,r=[],n=[]){if(t.length===0)return n.length>0&&r.push(n),r.length>0?r:[];let i="";t[0].content===" "&&(i=" ",t.shift());const s=t.shift()??{content:" ",type:"normal"},a=[...n];if(i!==""&&a.push({content:i,type:"normal"}),a.push(s),e(a))return h_(t,e,r,a);if(n.length>0)r.push(n),t.unshift(s);else if(s.content){const[o,l]=yke(e,s);r.push([o]),l.content&&t.unshift(l)}return h_(t,e,r)}w(h_,"splitLineToFitWidthRecursion");function AG(t,e){e&&t.attr("style",e)}w(AG,"applyStyle");var dce=16384;async function bke(t,e,r,n,i=!1,s=br()){const a=t.append("foreignObject");a.attr("width",`${Math.min(10*r,dce)}px`),a.attr("height",`${Math.min(10*r,dce)}px`);const o=a.append("xhtml:div"),l=Ks(e.label)?await GN(e.label.replace(Vt.lineBreakRegex,`
-`),s):Ln(e.label,s),u=e.isNode?"nodeLabel":"edgeLabel",h=o.append("span");h.html(l),AG(h,e.labelStyle),h.attr("class",`${u} ${n}`),AG(o,e.labelStyle),o.style("display","table-cell"),o.style("white-space","nowrap"),o.style("line-height","1.5"),r!==Number.POSITIVE_INFINITY&&(o.style("max-width",r+"px"),o.style("text-align","center")),o.attr("xmlns","http://www.w3.org/1999/xhtml"),i&&o.attr("class","labelBkg");let d=o.node().getBoundingClientRect();return d.width===r&&(o.style("display","table"),o.style("white-space","break-spaces"),o.style("width",r+"px"),d=o.node().getBoundingClientRect()),a.node()}w(bke,"addHtmlSpan");function aD(t,e,r,n=!1){const i=t.append("tspan").attr("class","text-outer-tspan").attr("x",0).attr("y",e*r-.1+"em").attr("dy",r+"em");return n&&i.attr("text-anchor","middle"),i}w(aD,"createTspan");function xke(t,e,r){const n=t.append("text"),i=aD(n,1,e);oD(i,r);const s=i.node().getComputedTextLength();return n.remove(),s}w(xke,"computeWidthOfText");function wke(t,e,r){var a;const n=t.append("text"),i=aD(n,1,e);oD(i,[{content:r,type:"normal"}]);const s=(a=i.node())==null?void 0:a.getBoundingClientRect();return s&&n.remove(),s}w(wke,"computeDimensionOfText");function Tke(t,e,r,n=!1,i=!1){const a=e.append("g"),o=a.insert("rect").attr("class","background").attr("style","stroke: none"),l=a.append("text").attr("y","-10.1");i&&l.attr("text-anchor","middle");let u=0;for(const h of r){const d=w(p=>xke(a,1.1,p)<=t,"checkWidth"),f=d(h)?[h]:vke(h,d);for(const p of f){const g=aD(l,u,1.1,i);oD(g,p),u++}}if(n){const h=l.node().getBBox(),d=2;return o.attr("x",h.x-d).attr("y",h.y-d).attr("width",h.width+2*d).attr("height",h.height+2*d),a.node()}else return l.node()}w(Tke,"createFormattedText");function MG(t){const e=/&(amp|lt|gt);/g;return t.replace(e,(r,n)=>{switch(n){case"amp":return"&";case"lt":return"<";case"gt":return">";default:return r}})}w(MG,"decodeHTMLEntities");function oD(t,e){t.text(""),e.forEach((r,n)=>{const i=t.append("tspan").attr("font-style",r.type==="em"?"italic":"normal").attr("class","text-inner-tspan").attr("font-weight",r.type==="strong"?"bold":"normal");n===0?i.text(MG(r.content)):i.text(" "+MG(r.content))})}w(oD,"updateTextContentAndStyles");async function Cke(t,e={}){const r=[];t.replace(/(fa[bklrs]?):fa-([\w-]+)/g,(i,s,a)=>(r.push((async()=>{const o=`${s}:${a}`;return await PTt(o)?await m0(o,void 0,{class:"label-icon"}):``})()),i));const n=await Promise.all(r);return t.replace(/(fa[bklrs]?):fa-([\w-]+)/g,()=>n.shift()??"")}w(Cke,"replaceIconSubstring");var Qo=w(async(t,e="",{style:r="",isTitle:n=!1,classes:i="",useHtmlLabels:s=!0,markdown:a=!0,isNode:o=!0,width:l=200,addSvgBackground:u=!1}={},h)=>{if(de.debug("XYZ createText",e,r,n,i,s,o,"addSvgBackground: ",u),s){const d=a?gke(e,h):pke(e),f=await Cke(g0(d),h),p=e.replace(/\\\\/g,"\\"),g={isNode:o,label:Ks(e)?p:f,labelStyle:r.replace("fill:","color:")};return await bke(t,g,l,i,u,h)}else{const d=g0(e.replace(/
/g,"
")),f=a?fke(d.replace("
","
"),h):dke(d),p=Tke(l,t,f,e?u:!1,!o);if(o){/stroke:/.exec(r)&&(r=r.replace("stroke:","lineColor:"));const g=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");wt(p).attr("style",g)}else{const g=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/background:/g,"fill:");wt(p).select("rect").attr("style",g.replace(/background:/g,"fill:"));const m=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");wt(p).select("text").attr("style",m)}return n?wt(p).selectAll("tspan.text-outer-tspan").classed("title-row",!0):wt(p).selectAll("tspan.text-outer-tspan").classed("row",!0),p}},"createText");function tB(t,e,r){if(t&&t.length){const[n,i]=e,s=Math.PI/180*r,a=Math.cos(s),o=Math.sin(s);for(const l of t){const[u,h]=l;l[0]=(u-n)*a-(h-i)*o+n,l[1]=(u-n)*o+(h-i)*a+i}}}function x5t(t,e){return t[0]===e[0]&&t[1]===e[1]}function w5t(t,e,r,n=1){const i=r,s=Math.max(e,.1),a=t[0]&&t[0][0]&&typeof t[0][0]=="number"?[t]:t,o=[0,0];if(i)for(const u of a)tB(u,o,i);const l=(function(u,h,d){const f=[];for(const x of u){const b=[...x];x5t(b[0],b[b.length-1])||b.push([b[0][0],b[0][1]]),b.length>2&&f.push(b)}const p=[];h=Math.max(h,.1);const g=[];for(const x of f)for(let b=0;bx.yminb.ymin?1:x.xb.x?1:x.ymax===b.ymax?0:(x.ymax-b.ymax)/Math.abs(x.ymax-b.ymax))),!g.length)return p;let m=[],y=g[0].ymin,v=0;for(;m.length||g.length;){if(g.length){let x=-1;for(let b=0;by);b++)x=b;g.splice(0,x+1).forEach((b=>{m.push({s:y,edge:b})}))}if(m=m.filter((x=>!(x.edge.ymax<=y))),m.sort(((x,b)=>x.edge.x===b.edge.x?0:(x.edge.x-b.edge.x)/Math.abs(x.edge.x-b.edge.x))),(d!==1||v%h==0)&&m.length>1)for(let x=0;x=m.length)break;const T=m[x].edge,C=m[b].edge;p.push([[Math.round(T.x),y],[Math.round(C.x),y]])}y+=d,m.forEach((x=>{x.edge.x=x.edge.x+d*x.edge.islope})),v++}return p})(a,s,n);if(i){for(const u of a)tB(u,o,-i);(function(u,h,d){const f=[];u.forEach((p=>f.push(...p))),tB(f,h,d)})(l,o,-i)}return l}function a7(t,e){var r;const n=e.hachureAngle+90;let i=e.hachureGap;i<0&&(i=4*e.strokeWidth),i=Math.round(Math.max(i,.1));let s=1;return e.roughness>=1&&(((r=e.randomizer)===null||r===void 0?void 0:r.next())||Math.random())>.7&&(s=i),w5t(t,i,n,s||1)}class EZ{constructor(e){this.helper=e}fillPolygons(e,r){return this._fillPolygons(e,r)}_fillPolygons(e,r){const n=a7(e,r);return{type:"fillSketch",ops:this.renderLines(n,r)}}renderLines(e,r){const n=[];for(const i of e)n.push(...this.helper.doubleLineOps(i[0][0],i[0][1],i[1][0],i[1][1],r));return n}}function lD(t){const e=t[0],r=t[1];return Math.sqrt(Math.pow(e[0]-r[0],2)+Math.pow(e[1]-r[1],2))}let T5t=class extends EZ{fillPolygons(e,r){let n=r.hachureGap;n<0&&(n=4*r.strokeWidth),n=Math.max(n,.1);const i=a7(e,Object.assign({},r,{hachureGap:n})),s=Math.PI/180*r.hachureAngle,a=[],o=.5*n*Math.cos(s),l=.5*n*Math.sin(s);for(const[u,h]of i)lD([u,h])&&a.push([[u[0]-o,u[1]+l],[...h]],[[u[0]+o,u[1]-l],[...h]]);return{type:"fillSketch",ops:this.renderLines(a,r)}}};class C5t extends EZ{fillPolygons(e,r){const n=this._fillPolygons(e,r),i=Object.assign({},r,{hachureAngle:r.hachureAngle+90}),s=this._fillPolygons(e,i);return n.ops=n.ops.concat(s.ops),n}}let k5t=class{constructor(e){this.helper=e}fillPolygons(e,r){const n=a7(e,r=Object.assign({},r,{hachureAngle:0}));return this.dotsOnLines(n,r)}dotsOnLines(e,r){const n=[];let i=r.hachureGap;i<0&&(i=4*r.strokeWidth),i=Math.max(i,.1);let s=r.fillWeight;s<0&&(s=r.strokeWidth/2);const a=i/4;for(const o of e){const l=lD(o),u=l/i,h=Math.ceil(u)-1,d=l-h*i,f=(o[0][0]+o[1][0])/2-i/4,p=Math.min(o[0][1],o[1][1]);for(let g=0;g{const o=lD(a),l=Math.floor(o/(n+i)),u=(o+i-l*(n+i))/2;let h=a[0],d=a[1];h[0]>d[0]&&(h=a[1],d=a[0]);const f=Math.atan((d[1]-h[1])/(d[0]-h[0]));for(let p=0;p{const a=lD(s),o=Math.round(a/(2*r));let l=s[0],u=s[1];l[0]>u[0]&&(l=s[1],u=s[0]);const h=Math.atan((u[1]-l[1])/(u[0]-l[0]));for(let d=0;dh%2?u+r:u+e));s.push({key:"C",data:l}),e=l[4],r=l[5];break}case"Q":s.push({key:"Q",data:[...o]}),e=o[2],r=o[3];break;case"q":{const l=o.map(((u,h)=>h%2?u+r:u+e));s.push({key:"Q",data:l}),e=l[2],r=l[3];break}case"A":s.push({key:"A",data:[...o]}),e=o[5],r=o[6];break;case"a":e+=o[5],r+=o[6],s.push({key:"A",data:[o[0],o[1],o[2],o[3],o[4],e,r]});break;case"H":s.push({key:"H",data:[...o]}),e=o[0];break;case"h":e+=o[0],s.push({key:"H",data:[e]});break;case"V":s.push({key:"V",data:[...o]}),r=o[0];break;case"v":r+=o[0],s.push({key:"V",data:[r]});break;case"S":s.push({key:"S",data:[...o]}),e=o[2],r=o[3];break;case"s":{const l=o.map(((u,h)=>h%2?u+r:u+e));s.push({key:"S",data:l}),e=l[2],r=l[3];break}case"T":s.push({key:"T",data:[...o]}),e=o[0],r=o[1];break;case"t":e+=o[0],r+=o[1],s.push({key:"T",data:[e,r]});break;case"Z":case"z":s.push({key:"Z",data:[]}),e=n,r=i}return s}function Ske(t){const e=[];let r="",n=0,i=0,s=0,a=0,o=0,l=0;for(const{key:u,data:h}of t){switch(u){case"M":e.push({key:"M",data:[...h]}),[n,i]=h,[s,a]=h;break;case"C":e.push({key:"C",data:[...h]}),n=h[4],i=h[5],o=h[2],l=h[3];break;case"L":e.push({key:"L",data:[...h]}),[n,i]=h;break;case"H":n=h[0],e.push({key:"L",data:[n,i]});break;case"V":i=h[0],e.push({key:"L",data:[n,i]});break;case"S":{let d=0,f=0;r==="C"||r==="S"?(d=n+(n-o),f=i+(i-l)):(d=n,f=i),e.push({key:"C",data:[d,f,...h]}),o=h[0],l=h[1],n=h[2],i=h[3];break}case"T":{const[d,f]=h;let p=0,g=0;r==="Q"||r==="T"?(p=n+(n-o),g=i+(i-l)):(p=n,g=i);const m=n+2*(p-n)/3,y=i+2*(g-i)/3,v=d+2*(p-d)/3,x=f+2*(g-f)/3;e.push({key:"C",data:[m,y,v,x,d,f]}),o=p,l=g,n=d,i=f;break}case"Q":{const[d,f,p,g]=h,m=n+2*(d-n)/3,y=i+2*(f-i)/3,v=p+2*(d-p)/3,x=g+2*(f-g)/3;e.push({key:"C",data:[m,y,v,x,p,g]}),o=d,l=f,n=p,i=g;break}case"A":{const d=Math.abs(h[0]),f=Math.abs(h[1]),p=h[2],g=h[3],m=h[4],y=h[5],v=h[6];d===0||f===0?(e.push({key:"C",data:[n,i,y,v,y,v]}),n=y,i=v):(n!==y||i!==v)&&(Eke(n,i,y,v,d,f,p,g,m).forEach((function(x){e.push({key:"C",data:x})})),n=y,i=v);break}case"Z":e.push({key:"Z",data:[]}),n=s,i=a}r=u}return e}function nC(t,e,r){return[t*Math.cos(r)-e*Math.sin(r),t*Math.sin(r)+e*Math.cos(r)]}function Eke(t,e,r,n,i,s,a,o,l,u){const h=(d=a,Math.PI*d/180);var d;let f=[],p=0,g=0,m=0,y=0;if(u)[p,g,m,y]=u;else{[t,e]=nC(t,e,-h),[r,n]=nC(r,n,-h);const N=(t-r)/2,L=(e-n)/2;let I=N*N/(i*i)+L*L/(s*s);I>1&&(I=Math.sqrt(I),i*=I,s*=I);const $=i*i,O=s*s,D=$*O-$*L*L-O*N*N,F=$*L*L+O*N*N,z=(o===l?-1:1)*Math.sqrt(Math.abs(D/F));m=z*i*L/s+(t+r)/2,y=z*-s*N/i+(e+n)/2,p=Math.asin(parseFloat(((e-y)/s).toFixed(9))),g=Math.asin(parseFloat(((n-y)/s).toFixed(9))),tg&&(p-=2*Math.PI),!l&&g>p&&(g-=2*Math.PI)}let v=g-p;if(Math.abs(v)>120*Math.PI/180){const N=g,L=r,I=n;g=l&&g>p?p+120*Math.PI/180*1:p+120*Math.PI/180*-1,f=Eke(r=m+i*Math.cos(g),n=y+s*Math.sin(g),L,I,i,s,a,0,l,[g,N,m,y])}v=g-p;const x=Math.cos(p),b=Math.sin(p),T=Math.cos(g),C=Math.sin(g),S=Math.tan(v/4),k=4/3*i*S,E=4/3*s*S,A=[t,e],R=[t+k*b,e-E*x],_=[r+k*C,n-E*T],P=[r,n];if(R[0]=2*A[0]-R[0],R[1]=2*A[1]-R[1],u)return[R,_,P].concat(f);{f=[R,_,P].concat(f);const N=[];for(let L=0;L2){const i=[];for(let s=0;s2*Math.PI&&(p=0,g=2*Math.PI);const m=2*Math.PI/l.curveStepCount,y=Math.min(m/2,(g-p)/2),v=bce(y,u,h,d,f,p,g,1,l);if(!l.disableMultiStroke){const x=bce(y,u,h,d,f,p,g,1.5,l);v.push(...x)}return a&&(o?v.push(...bg(u,h,u+d*Math.cos(p),h+f*Math.sin(p),l),...bg(u,h,u+d*Math.cos(g),h+f*Math.sin(g),l)):v.push({op:"lineTo",data:[u,h]},{op:"lineTo",data:[u+d*Math.cos(p),h+f*Math.sin(p)]})),{type:"path",ops:v}}function mce(t,e){const r=Ske(kke(AZ(t))),n=[];let i=[0,0],s=[0,0];for(const{key:a,data:o}of r)switch(a){case"M":s=[o[0],o[1]],i=[o[0],o[1]];break;case"L":n.push(...bg(s[0],s[1],o[0],o[1],e)),s=[o[0],o[1]];break;case"C":{const[l,u,h,d,f,p]=o;n.push(...L5t(l,u,h,d,f,p,s,e)),s=[f,p];break}case"Z":n.push(...bg(s[0],s[1],i[0],i[1],e)),s=[i[0],i[1]]}return{type:"path",ops:n}}function iB(t,e){const r=[];for(const n of t)if(n.length){const i=e.maxRandomnessOffset||0,s=n.length;if(s>2){r.push({op:"move",data:[n[0][0]+en(i,e),n[0][1]+en(i,e)]});for(let a=1;a500?.4:-.0016668*l+1.233334;let h=i.maxRandomnessOffset||0;h*h*100>o&&(h=l/10);const d=h/2,f=.2+.2*Rke(i);let p=i.bowing*i.maxRandomnessOffset*(n-e)/200,g=i.bowing*i.maxRandomnessOffset*(t-r)/200;p=en(p,i,u),g=en(g,i,u);const m=[],y=()=>en(d,i,u),v=()=>en(h,i,u),x=i.preserveVertices;return a?m.push({op:"move",data:[t+(x?0:y()),e+(x?0:y())]}):m.push({op:"move",data:[t+(x?0:en(h,i,u)),e+(x?0:en(h,i,u))]}),a?m.push({op:"bcurveTo",data:[p+t+(r-t)*f+y(),g+e+(n-e)*f+y(),p+t+2*(r-t)*f+y(),g+e+2*(n-e)*f+y(),r+(x?0:y()),n+(x?0:y())]}):m.push({op:"bcurveTo",data:[p+t+(r-t)*f+v(),g+e+(n-e)*f+v(),p+t+2*(r-t)*f+v(),g+e+2*(n-e)*f+v(),r+(x?0:v()),n+(x?0:v())]}),m}function BA(t,e,r){if(!t.length)return[];const n=[];n.push([t[0][0]+en(e,r),t[0][1]+en(e,r)]),n.push([t[0][0]+en(e,r),t[0][1]+en(e,r)]);for(let i=1;i3){const s=[],a=1-r.curveTightness;i.push({op:"move",data:[t[1][0],t[1][1]]});for(let o=1;o+21&&i.push(o)):i.push(o),i.push(t[e+3])}else{const l=t[e+0],u=t[e+1],h=t[e+2],d=t[e+3],f=jm(l,u,.5),p=jm(u,h,.5),g=jm(h,d,.5),m=jm(f,p,.5),y=jm(p,g,.5),v=jm(m,y,.5);LG([l,f,m,v],0,r,i),LG([v,y,g,d],0,r,i)}var s,a;return i}function N5t(t,e){return p_(t,0,t.length,e)}function p_(t,e,r,n,i){const s=i||[],a=t[e],o=t[r-1];let l=0,u=1;for(let h=e+1;hl&&(l=d,u=h)}return Math.sqrt(l)>n?(p_(t,e,u+1,n,s),p_(t,u,r,n,s)):(s.length||s.push(a),s.push(o)),s}function sB(t,e=.15,r){const n=[],i=(t.length-1)/3;for(let s=0;s0?p_(n,0,n.length,r):n}const Ec="none";let g_=class{constructor(e){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1,fillShapeRoughnessGain:.8},this.config=e||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(Math.random()*2**31)}_o(e){return e?Object.assign({},this.defaultOptions,e):this.defaultOptions}_d(e,r,n){return{shape:e,sets:r||[],options:n||this.defaultOptions}}line(e,r,n,i,s){const a=this._o(s);return this._d("line",[Ake(e,r,n,i,a)],a)}rectangle(e,r,n,i,s){const a=this._o(s),o=[],l=_5t(e,r,n,i,a);if(a.fill){const u=[[e,r],[e+n,r],[e+n,r+i],[e,r+i]];a.fillStyle==="solid"?o.push(iB([u],a)):o.push(Vv([u],a))}return a.stroke!==Ec&&o.push(l),this._d("rectangle",o,a)}ellipse(e,r,n,i,s){const a=this._o(s),o=[],l=Mke(n,i,a),u=RG(e,r,a,l);if(a.fill)if(a.fillStyle==="solid"){const h=RG(e,r,a,l).opset;h.type="fillPath",o.push(h)}else o.push(Vv([u.estimatedPoints],a));return a.stroke!==Ec&&o.push(u.opset),this._d("ellipse",o,a)}circle(e,r,n,i){const s=this.ellipse(e,r,n,n,i);return s.shape="circle",s}linearPath(e,r){const n=this._o(r);return this._d("linearPath",[$M(e,!1,n)],n)}arc(e,r,n,i,s,a,o=!1,l){const u=this._o(l),h=[],d=gce(e,r,n,i,s,a,o,!0,u);if(o&&u.fill)if(u.fillStyle==="solid"){const f=Object.assign({},u);f.disableMultiStroke=!0;const p=gce(e,r,n,i,s,a,!0,!1,f);p.type="fillPath",h.push(p)}else h.push((function(f,p,g,m,y,v,x){const b=f,T=p;let C=Math.abs(g/2),S=Math.abs(m/2);C+=en(.01*C,x),S+=en(.01*S,x);let k=y,E=v;for(;k<0;)k+=2*Math.PI,E+=2*Math.PI;E-k>2*Math.PI&&(k=0,E=2*Math.PI);const A=(E-k)/x.curveStepCount,R=[];for(let _=k;_<=E;_+=A)R.push([b+C*Math.cos(_),T+S*Math.sin(_)]);return R.push([b+C*Math.cos(E),T+S*Math.sin(E)]),R.push([b,T]),Vv([R],x)})(e,r,n,i,s,a,u));return u.stroke!==Ec&&h.push(d),this._d("arc",h,u)}curve(e,r){const n=this._o(r),i=[],s=pce(e,n);if(n.fill&&n.fill!==Ec)if(n.fillStyle==="solid"){const a=pce(e,Object.assign(Object.assign({},n),{disableMultiStroke:!0,roughness:n.roughness?n.roughness+n.fillShapeRoughnessGain:0}));i.push({type:"fillPath",ops:this._mergedShape(a.ops)})}else{const a=[],o=e;if(o.length){const l=typeof o[0][0]=="number"?[o]:o;for(const u of l)u.length<3?a.push(...u):u.length===3?a.push(...sB(xce([u[0],u[0],u[1],u[2]]),10,(1+n.roughness)/2)):a.push(...sB(xce(u),10,(1+n.roughness)/2))}a.length&&i.push(Vv([a],n))}return n.stroke!==Ec&&i.push(s),this._d("curve",i,n)}polygon(e,r){const n=this._o(r),i=[],s=$M(e,!0,n);return n.fill&&(n.fillStyle==="solid"?i.push(iB([e],n)):i.push(Vv([e],n))),n.stroke!==Ec&&i.push(s),this._d("polygon",i,n)}path(e,r){const n=this._o(r),i=[];if(!e)return this._d("path",i,n);e=(e||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");const s=n.fill&&n.fill!=="transparent"&&n.fill!==Ec,a=n.stroke!==Ec,o=!!(n.simplification&&n.simplification<1),l=(function(h,d,f){const p=Ske(kke(AZ(h))),g=[];let m=[],y=[0,0],v=[];const x=()=>{v.length>=4&&m.push(...sB(v,d)),v=[]},b=()=>{x(),m.length&&(g.push(m),m=[])};for(const{key:C,data:S}of p)switch(C){case"M":b(),y=[S[0],S[1]],m.push(y);break;case"L":x(),m.push([S[0],S[1]]);break;case"C":if(!v.length){const k=m.length?m[m.length-1]:y;v.push([k[0],k[1]])}v.push([S[0],S[1]]),v.push([S[2],S[3]]),v.push([S[4],S[5]]);break;case"Z":x(),m.push([y[0],y[1]])}if(b(),!f)return g;const T=[];for(const C of g){const S=N5t(C,f);S.length&&T.push(S)}return T})(e,1,o?4-4*(n.simplification||1):(1+n.roughness)/2),u=mce(e,n);if(s)if(n.fillStyle==="solid")if(l.length===1){const h=mce(e,Object.assign(Object.assign({},n),{disableMultiStroke:!0,roughness:n.roughness?n.roughness+n.fillShapeRoughnessGain:0}));i.push({type:"fillPath",ops:this._mergedShape(h.ops)})}else i.push(iB(l,n));else i.push(Vv(l,n));return a&&(o?l.forEach((h=>{i.push($M(h,!1,n))})):i.push(u)),this._d("path",i,n)}opsToPath(e,r){let n="";for(const i of e.ops){const s=typeof r=="number"&&r>=0?i.data.map((a=>+a.toFixed(r))):i.data;switch(i.op){case"move":n+=`M${s[0]} ${s[1]} `;break;case"bcurveTo":n+=`C${s[0]} ${s[1]}, ${s[2]} ${s[3]}, ${s[4]} ${s[5]} `;break;case"lineTo":n+=`L${s[0]} ${s[1]} `}}return n.trim()}toPaths(e){const r=e.sets||[],n=e.options||this.defaultOptions,i=[];for(const s of r){let a=null;switch(s.type){case"path":a={d:this.opsToPath(s),stroke:n.stroke,strokeWidth:n.strokeWidth,fill:Ec};break;case"fillPath":a={d:this.opsToPath(s),stroke:Ec,strokeWidth:0,fill:n.fill||Ec};break;case"fillSketch":a=this.fillSketch(s,n)}a&&i.push(a)}return i}fillSketch(e,r){let n=r.fillWeight;return n<0&&(n=r.strokeWidth/2),{d:this.opsToPath(e),stroke:r.fill||Ec,strokeWidth:n,fill:Ec}}_mergedShape(e){return e.filter(((r,n)=>n===0||r.op!=="move"))}};class D5t{constructor(e,r){this.canvas=e,this.ctx=this.canvas.getContext("2d"),this.gen=new g_(r)}draw(e){const r=e.sets||[],n=e.options||this.getDefaultOptions(),i=this.ctx,s=e.options.fixedDecimalPlaceDigits;for(const a of r)switch(a.type){case"path":i.save(),i.strokeStyle=n.stroke==="none"?"transparent":n.stroke,i.lineWidth=n.strokeWidth,n.strokeLineDash&&i.setLineDash(n.strokeLineDash),n.strokeLineDashOffset&&(i.lineDashOffset=n.strokeLineDashOffset),this._drawToContext(i,a,s),i.restore();break;case"fillPath":{i.save(),i.fillStyle=n.fill||"";const o=e.shape==="curve"||e.shape==="polygon"||e.shape==="path"?"evenodd":"nonzero";this._drawToContext(i,a,s,o),i.restore();break}case"fillSketch":this.fillSketch(i,a,n)}}fillSketch(e,r,n){let i=n.fillWeight;i<0&&(i=n.strokeWidth/2),e.save(),n.fillLineDash&&e.setLineDash(n.fillLineDash),n.fillLineDashOffset&&(e.lineDashOffset=n.fillLineDashOffset),e.strokeStyle=n.fill||"",e.lineWidth=i,this._drawToContext(e,r,n.fixedDecimalPlaceDigits),e.restore()}_drawToContext(e,r,n,i="nonzero"){e.beginPath();for(const s of r.ops){const a=typeof n=="number"&&n>=0?s.data.map((o=>+o.toFixed(n))):s.data;switch(s.op){case"move":e.moveTo(a[0],a[1]);break;case"bcurveTo":e.bezierCurveTo(a[0],a[1],a[2],a[3],a[4],a[5]);break;case"lineTo":e.lineTo(a[0],a[1])}}r.type==="fillPath"?e.fill(i):e.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(e,r,n,i,s){const a=this.gen.line(e,r,n,i,s);return this.draw(a),a}rectangle(e,r,n,i,s){const a=this.gen.rectangle(e,r,n,i,s);return this.draw(a),a}ellipse(e,r,n,i,s){const a=this.gen.ellipse(e,r,n,i,s);return this.draw(a),a}circle(e,r,n,i){const s=this.gen.circle(e,r,n,i);return this.draw(s),s}linearPath(e,r){const n=this.gen.linearPath(e,r);return this.draw(n),n}polygon(e,r){const n=this.gen.polygon(e,r);return this.draw(n),n}arc(e,r,n,i,s,a,o=!1,l){const u=this.gen.arc(e,r,n,i,s,a,o,l);return this.draw(u),u}curve(e,r){const n=this.gen.curve(e,r);return this.draw(n),n}path(e,r){const n=this.gen.path(e,r);return this.draw(n),n}}const FA="http://www.w3.org/2000/svg";class O5t{constructor(e,r){this.svg=e,this.gen=new g_(r)}draw(e){const r=e.sets||[],n=e.options||this.getDefaultOptions(),i=this.svg.ownerDocument||window.document,s=i.createElementNS(FA,"g"),a=e.options.fixedDecimalPlaceDigits;for(const o of r){let l=null;switch(o.type){case"path":l=i.createElementNS(FA,"path"),l.setAttribute("d",this.opsToPath(o,a)),l.setAttribute("stroke",n.stroke),l.setAttribute("stroke-width",n.strokeWidth+""),l.setAttribute("fill","none"),n.strokeLineDash&&l.setAttribute("stroke-dasharray",n.strokeLineDash.join(" ").trim()),n.strokeLineDashOffset&&l.setAttribute("stroke-dashoffset",`${n.strokeLineDashOffset}`);break;case"fillPath":l=i.createElementNS(FA,"path"),l.setAttribute("d",this.opsToPath(o,a)),l.setAttribute("stroke","none"),l.setAttribute("stroke-width","0"),l.setAttribute("fill",n.fill||""),e.shape!=="curve"&&e.shape!=="polygon"||l.setAttribute("fill-rule","evenodd");break;case"fillSketch":l=this.fillSketch(i,o,n)}l&&s.appendChild(l)}return s}fillSketch(e,r,n){let i=n.fillWeight;i<0&&(i=n.strokeWidth/2);const s=e.createElementNS(FA,"path");return s.setAttribute("d",this.opsToPath(r,n.fixedDecimalPlaceDigits)),s.setAttribute("stroke",n.fill||""),s.setAttribute("stroke-width",i+""),s.setAttribute("fill","none"),n.fillLineDash&&s.setAttribute("stroke-dasharray",n.fillLineDash.join(" ").trim()),n.fillLineDashOffset&&s.setAttribute("stroke-dashoffset",`${n.fillLineDashOffset}`),s}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(e,r){return this.gen.opsToPath(e,r)}line(e,r,n,i,s){const a=this.gen.line(e,r,n,i,s);return this.draw(a)}rectangle(e,r,n,i,s){const a=this.gen.rectangle(e,r,n,i,s);return this.draw(a)}ellipse(e,r,n,i,s){const a=this.gen.ellipse(e,r,n,i,s);return this.draw(a)}circle(e,r,n,i){const s=this.gen.circle(e,r,n,i);return this.draw(s)}linearPath(e,r){const n=this.gen.linearPath(e,r);return this.draw(n)}polygon(e,r){const n=this.gen.polygon(e,r);return this.draw(n)}arc(e,r,n,i,s,a,o=!1,l){const u=this.gen.arc(e,r,n,i,s,a,o,l);return this.draw(u)}curve(e,r){const n=this.gen.curve(e,r);return this.draw(n)}path(e,r){const n=this.gen.path(e,r);return this.draw(n)}}var dr={canvas:(t,e)=>new D5t(t,e),svg:(t,e)=>new O5t(t,e),generator:t=>new g_(t),newSeed:()=>g_.newSeed()},Qr=w(async(t,e,r)=>{var p,g;let n;const i=e.useHtmlLabels||Gd((p=Ve())==null?void 0:p.htmlLabels);r?n=r:n="node default";const s=t.insert("g").attr("class",n).attr("id",e.domId||e.id),a=s.insert("g").attr("class","label").attr("style",Xa(e.labelStyle));let o;e.label===void 0?o="":o=typeof e.label=="string"?e.label:e.label[0];const l=!!e.icon||!!e.img,u=e.labelType==="markdown",h=await Qo(a,Ln(g0(o),Ve()),{useHtmlLabels:i,width:e.width||((g=Ve().flowchart)==null?void 0:g.wrappingWidth),classes:u?"markdown-node-label":"",style:e.labelStyle,addSvgBackground:l,markdown:u},Ve());let d=h.getBBox();const f=((e==null?void 0:e.padding)??0)/2;if(i){const m=h.children[0],y=wt(h);await pZ(m,o),d=m.getBoundingClientRect(),y.attr("width",d.width),y.attr("height",d.height)}return i?a.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"):a.attr("transform","translate(0, "+-d.height/2+")"),e.centerLabel&&a.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"),a.insert("rect",":first-child"),{shapeSvg:s,bbox:d,halfPadding:f,label:a}},"labelHelper"),aB=w(async(t,e,r)=>{var l,u;const n=r.useHtmlLabels??di(Ve()),i=t.insert("g").attr("class","label").attr("style",r.labelStyle||""),s=await Qo(i,Ln(g0(e),Ve()),{useHtmlLabels:n,width:r.width||((u=(l=Ve())==null?void 0:l.flowchart)==null?void 0:u.wrappingWidth),style:r.labelStyle,addSvgBackground:!!r.icon||!!r.img});let a=s.getBBox();const o=r.padding/2;if(di(Ve())){const h=s.children[0],d=wt(s);a=h.getBoundingClientRect(),d.attr("width",a.width),d.attr("height",a.height)}return n?i.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"):i.attr("transform","translate(0, "+-a.height/2+")"),r.centerLabel&&i.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"),i.insert("rect",":first-child"),{shapeSvg:t,bbox:a,halfPadding:o,label:i}},"insertLabel"),Tr=w((t,e)=>{const r=e.node().getBBox();t.width=r.width,t.height=r.height},"updateNodeBounds"),Wr=w((t,e)=>(t.look==="handDrawn"?"rough-node":"node")+" "+t.cssClasses+" "+(e||""),"getNodeClasses");function Fn(t){const e=t.map((r,n)=>`${n===0?"M":"L"}${r.x},${r.y}`);return e.push("Z"),e.join(" ")}w(Fn,"createPathFromPoints");function xg(t,e,r,n,i,s){const a=[],l=r-t,u=n-e,h=l/s,d=2*Math.PI/h,f=e+u/2;for(let p=0;p<=50;p++){const g=p/50,m=t+g*l,y=f+i*Math.sin(d*(m-t));a.push({x:m,y})}return a}w(xg,"generateFullSineWavePoints");function S6(t,e,r,n,i,s){const a=[],o=i*Math.PI/180,h=(s*Math.PI/180-o)/(n-1);for(let d=0;dl.tagName==="path"),r=document.createElementNS("http://www.w3.org/2000/svg","path"),n=e.map(l=>l.getAttribute("d")).filter(l=>l!==null).join(" ");r.setAttribute("d",n);const i=e.find(l=>l.getAttribute("fill")!=="none"),s=e.find(l=>l.getAttribute("stroke")!=="none"),a=w((l,u)=>(l==null?void 0:l.getAttribute(u))??void 0,"getAttr");if(i){const l={fill:a(i,"fill"),"fill-opacity":a(i,"fill-opacity")??"1"};Object.entries(l).forEach(([u,h])=>{h&&r.setAttribute(u,h)})}if(s){const l={stroke:a(s,"stroke"),"stroke-width":a(s,"stroke-width")??"1","stroke-opacity":a(s,"stroke-opacity")??"1"};Object.entries(l).forEach(([u,h])=>{h&&r.setAttribute(u,h)})}const o=document.createElementNS("http://www.w3.org/2000/svg","g");return o.appendChild(r),o}w(IG,"mergePaths");var P5t=w((t,e)=>{var r=t.x,n=t.y,i=e.x-r,s=e.y-n,a=t.width/2,o=t.height/2,l,u;return Math.abs(s)*a>Math.abs(i)*o?(s<0&&(o=-o),l=s===0?0:o*i/s,u=o):(i<0&&(a=-a),l=a,u=i===0?0:a*s/i),{x:r+l,y:n+u}},"intersectRect"),ev=P5t,$5t=w(async(t,e,r,n=!1,i=!1)=>{let s=e||"";typeof s=="object"&&(s=s[0]);const a=Ve(),o=di(a);return await Qo(t,s,{style:r,isTitle:n,useHtmlLabels:o,markdown:!1,isNode:i,width:Number.POSITIVE_INFINITY},a)},"createLabel"),Hp=$5t,Qg=w((t,e,r,n,i)=>["M",t+i,e,"H",t+r-i,"A",i,i,0,0,1,t+r,e+i,"V",e+n-i,"A",i,i,0,0,1,t+r-i,e+n,"H",t+i,"A",i,i,0,0,1,t,e+n-i,"V",e+i,"A",i,i,0,0,1,t+i,e,"Z"].join(" "),"createRoundedRectPathD"),B5t=w(async(t,e)=>{const r=Ve(),{themeVariables:n,handDrawnSeed:i}=r,{clusterBkg:s,clusterBorder:a}=n,o=a,{labelStyles:l,nodeStyles:u,borderStyles:h,backgroundStyles:d}=cr(e),f=t.insert("g").attr("class","cluster swimlane "+(e.cssClasses||"")).attr("id",e.id).attr("data-id",e.id).attr("data-et","cluster").attr("data-look",e.look),p=Gd(r.flowchart.htmlLabels),g=e.direction==="LR",m=f.insert("g").attr("class","cluster-label swimlane-label"),y=await Qo(m,e.label,{style:e.labelStyle,useHtmlLabels:p,isNode:!0,width:e.width});let v=y.getBBox();if(p){const N=y.children[0],L=wt(y);v=N.getBoundingClientRect(),L.attr("width",v.width),L.attr("height",v.height)}const x=e.padding??0,b=e.width<=v.width+x?v.width+x:e.width;e.width<=v.width+x?e.diff=(b-e.width)/2-x:e.diff=-x;const T=e.height,C=e.y-T/2,S=e.y+T/2,k=e.x-b/2,E=e.swimlaneContentTop!==void 0?e.swimlaneContentTop:C+T/3,A=g?4:0,R=v.height+2*A;let _,P;if(g){const N=Math.max(R,v.height+2*A),L=k+N,I=Math.max(0,b-N);if(e.look==="handDrawn"){const D=dr.svg(f),F=fr(e,{roughness:.7,fill:s,stroke:o,fillWeight:3,seed:i}),z=fr(e,{roughness:.7,fill:"none",stroke:o,seed:i}),V=D.rectangle(k,C,N,T,F);_=f.insert(()=>V,":first-child");const B=D.rectangle(L,C,I,T,z);P=f.insert(()=>B,":first-child"),_.select("path:nth-child(2)").attr("style",h.join(";")),_.select("path").attr("style",d.join(";").replace("fill","stroke"))}else _=f.insert("rect",":first-child"),P=f.insert("rect",":first-child"),_.attr("class","swimlane-title").attr("style",u).attr("x",k).attr("y",C).attr("width",N).attr("height",T).attr("fill",s).attr("stroke",o),P.attr("class","swimlane-body").attr("style",u).attr("x",L).attr("y",C).attr("width",I).attr("height",T).attr("fill","none").attr("stroke",o);const $=k+N/2,O=e.y;m.attr("transform",`translate(${$}, ${O}) rotate(-90) translate(${-v.width/2}, ${-v.height/2})`)}else{const N=Math.max(0,E-C),L=Math.min(R,N),I=C+L,$=Math.max(0,S-I),O=e.x-b/2;if(e.look==="handDrawn"){const z=dr.svg(f),V=fr(e,{roughness:.7,fill:s,stroke:o,fillWeight:3,seed:i}),B=fr(e,{roughness:.7,fill:"none",stroke:o,seed:i}),H=z.rectangle(O,C,b,L,V);_=f.insert(()=>H,":first-child");const G=z.rectangle(O,I,b,$,B);P=f.insert(()=>G,":first-child"),_.select("path:nth-child(2)").attr("style",h.join(";")),_.select("path").attr("style",d.join(";").replace("fill","stroke"))}else _=f.insert("rect",":first-child"),P=f.insert("rect",":first-child"),_.attr("class","swimlane-title").attr("style",u).attr("x",O).attr("y",C).attr("width",b).attr("height",L).attr("fill",s).attr("stroke",o),P.attr("class","swimlane-body").attr("style",u).attr("x",O).attr("y",I).attr("width",b).attr("height",$).attr("fill","none").attr("stroke",o);const D=e.x-v.width/2,F=C+(L-v.height)/2;m.attr("transform",`translate(${D}, ${F})`)}if(de.trace("Swimlane data ",e,JSON.stringify(e)),l){const N=m.select("span");N&&N.attr("style",l)}return e.offsetX=0,e.width=b,e.height=T,e.offsetY=v.height-x/2,e.intersect=function(N){return ev(e,N)},{cluster:f,labelBBox:v}},"swimlane"),_ke=w(async(t,e)=>{de.info("Creating subgraph rect for ",e.id,e);const r=Ve(),{themeVariables:n,handDrawnSeed:i}=r,{clusterBkg:s,clusterBorder:a}=n,{labelStyles:o,nodeStyles:l,borderStyles:u,backgroundStyles:h}=cr(e),d=t.insert("g").attr("class","cluster "+e.cssClasses).attr("id",e.domId).attr("data-look",e.look),f=di(r),p=d.insert("g").attr("class","cluster-label ");let g;e.labelType==="markdown"?g=await Qo(p,e.label,{style:e.labelStyle,useHtmlLabels:f,isNode:!0,width:e.width}):g=await Hp(p,e.label,e.labelStyle||"",!1,!0);let m=g.getBBox();if(di(r)){const k=g.children[0],E=wt(g);m=k.getBoundingClientRect(),E.attr("width",m.width),E.attr("height",m.height)}const y=e.width<=m.width+e.padding?m.width+e.padding:e.width;e.width<=m.width+e.padding?e.diff=(y-e.width)/2-e.padding:e.diff=-e.padding;const v=e.height,x=e.x-y/2,b=e.y-v/2;de.trace("Data ",e,JSON.stringify(e));let T;if(e.look==="handDrawn"){const k=dr.svg(d),E=fr(e,{roughness:.7,fill:s,stroke:a,fillWeight:3,seed:i}),A=k.path(Qg(x,b,y,v,0),E);T=d.insert(()=>(de.debug("Rough node insert CXC",A),A),":first-child"),T.select("path:nth-child(2)").attr("style",u.join(";")),T.select("path").attr("style",h.join(";").replace("fill","stroke"))}else T=d.insert("rect",":first-child"),T.attr("style",l).attr("rx",e.rx).attr("ry",e.ry).attr("x",x).attr("y",b).attr("width",y).attr("height",v);const{subGraphTitleTopMargin:C}=c3(r);if(p.attr("transform",`translate(${e.x-m.width/2}, ${e.y-e.height/2+C})`),o){const k=p.select("span");k&&k.attr("style",o)}const S=T.node().getBBox();return e.offsetX=0,e.width=S.width,e.height=S.height,e.offsetY=m.height-e.padding/2,e.intersect=function(k){return ev(e,k)},{cluster:d,labelBBox:m}},"rect"),F5t=w((t,e)=>{const r=t.insert("g").attr("class","note-cluster").attr("id",e.domId),n=r.insert("rect",":first-child"),i=0*e.padding,s=i/2;n.attr("rx",e.rx).attr("ry",e.ry).attr("x",e.x-e.width/2-s).attr("y",e.y-e.height/2-s).attr("width",e.width+i).attr("height",e.height+i).attr("fill","none");const a=n.node().getBBox();return e.width=a.width,e.height=a.height,e.intersect=function(o){return ev(e,o)},{cluster:r,labelBBox:{width:0,height:0}}},"noteGroup"),z5t=w(async(t,e)=>{const r=Ve(),{themeVariables:n,handDrawnSeed:i}=r,{altBackground:s,compositeBackground:a,compositeTitleBackground:o,nodeBorder:l}=n,u=t.insert("g").attr("class",e.cssClasses).attr("id",e.domId).attr("data-id",e.id).attr("data-look",e.look),h=u.insert("g",":first-child"),d=u.insert("g").attr("class","cluster-label");let f=u.append("rect");const p=await Hp(d,e.label,e.labelStyle,void 0,!0);let g=p.getBBox();if(di(r)){const A=p.children[0],R=wt(p);g=A.getBoundingClientRect(),R.attr("width",g.width),R.attr("height",g.height)}const m=0*e.padding,y=m/2,v=(e.width<=g.width+e.padding?g.width+e.padding:e.width)+m;e.width<=g.width+e.padding?e.diff=(v-e.width)/2-e.padding:e.diff=-e.padding;const x=e.height+m,b=e.height+m-g.height-6,T=e.x-v/2,C=e.y-x/2;e.width=v;const S=e.y-e.height/2-y+g.height+2;let k;if(e.look==="handDrawn"){const A=e.cssClasses.includes("statediagram-cluster-alt"),R=dr.svg(u),_=e.rx||e.ry?R.path(Qg(T,C,v,x,10),{roughness:.7,fill:o,fillStyle:"solid",stroke:l,seed:i}):R.rectangle(T,C,v,x,{seed:i});k=u.insert(()=>_,":first-child");const P=R.rectangle(T,S,v,b,{fill:A?s:a,fillStyle:A?"hachure":"solid",stroke:l,seed:i});k=u.insert(()=>_,":first-child"),f=u.insert(()=>P)}else k=h.insert("rect",":first-child"),k.attr("class","outer").attr("x",T).attr("y",C).attr("width",v).attr("height",x).attr("data-look",e.look),f.attr("class","inner").attr("x",T).attr("y",S).attr("width",v).attr("height",b);d.attr("transform",`translate(${e.x-g.width/2}, ${C+1-(di(r)?0:3)})`);const E=k.node().getBBox();return e.height=E.height,e.offsetX=0,e.offsetY=g.height-e.padding/2,e.labelBBox=g,e.intersect=function(A){return ev(e,A)},{cluster:u,labelBBox:g}},"roundedWithTitle"),V5t=w(async(t,e)=>{de.info("Creating subgraph rect for ",e.id,e);const r=Ve(),{themeVariables:n,handDrawnSeed:i}=r,{clusterBkg:s,clusterBorder:a}=n,{labelStyles:o,nodeStyles:l,borderStyles:u,backgroundStyles:h}=cr(e),d=t.insert("g").attr("class","cluster "+e.cssClasses).attr("id",e.domId).attr("data-look",e.look),f=di(r),p=d.insert("g").attr("class","cluster-label "),g=await Qo(p,e.label,{style:e.labelStyle,useHtmlLabels:f,isNode:!0,width:e.width});let m=g.getBBox();if(di(r)){const k=g.children[0],E=wt(g);m=k.getBoundingClientRect(),E.attr("width",m.width),E.attr("height",m.height)}const y=e.width<=m.width+e.padding?m.width+e.padding:e.width;e.width<=m.width+e.padding?e.diff=(y-e.width)/2-e.padding:e.diff=-e.padding;const v=e.height,x=e.x-y/2,b=e.y-v/2;de.trace("Data ",e,JSON.stringify(e));let T;if(e.look==="handDrawn"){const k=dr.svg(d),E=fr(e,{roughness:.7,fill:s,stroke:a,fillWeight:4,seed:i}),A=k.path(Qg(x,b,y,v,e.rx),E);T=d.insert(()=>(de.debug("Rough node insert CXC",A),A),":first-child"),T.select("path:nth-child(2)").attr("style",u.join(";")),T.select("path").attr("style",h.join(";").replace("fill","stroke"))}else T=d.insert("rect",":first-child"),T.attr("style",l).attr("rx",e.rx).attr("ry",e.ry).attr("x",x).attr("y",b).attr("width",y).attr("height",v);const{subGraphTitleTopMargin:C}=c3(r);if(p.attr("transform",`translate(${e.x-m.width/2}, ${e.y-e.height/2+C})`),o){const k=p.select("span");k&&k.attr("style",o)}const S=T.node().getBBox();return e.offsetX=0,e.width=S.width,e.height=S.height,e.offsetY=m.height-e.padding/2,e.intersect=function(k){return ev(e,k)},{cluster:d,labelBBox:m}},"kanbanSection"),H5t=w((t,e)=>{const r=Ve(),{themeVariables:n,handDrawnSeed:i}=r,{nodeBorder:s}=n,a=t.insert("g").attr("class",e.cssClasses).attr("id",e.domId).attr("data-look",e.look),o=a.insert("g",":first-child"),l=0*e.padding,u=e.width+l;e.diff=-e.padding;const h=e.height+l,d=e.x-u/2,f=e.y-h/2;e.width=u;let p;if(e.look==="handDrawn"){const y=dr.svg(a).rectangle(d,f,u,h,{fill:"lightgrey",roughness:.5,strokeLineDash:[5],stroke:s,seed:i});p=a.insert(()=>y,":first-child")}else{p=o.insert("rect",":first-child");let m="outer";e.look,m="divider",p.attr("class",m).attr("x",d).attr("y",f).attr("width",u).attr("height",h).attr("data-look",e.look)}const g=p.node().getBBox();return e.height=g.height,e.offsetX=0,e.offsetY=0,e.intersect=function(m){return ev(e,m)},{cluster:a,labelBBox:{}}},"divider"),G5t=_ke,W5t={rect:_ke,squareRect:G5t,roundedWithTitle:z5t,noteGroup:F5t,divider:H5t,kanbanSection:V5t,swimlane:B5t},Lke=new Map,cD=w(async(t,e)=>{const r=e.shape||"rect",n=await W5t[r](t,e);return Lke.set(e.id,n),n},"insertCluster"),Ike=w(()=>{Lke=new Map},"clear");function Nke(t,e){return t.intersect(e)}w(Nke,"intersectNode");var q5t=Nke;function Dke(t,e,r,n){var i=t.x,s=t.y,a=i-n.x,o=s-n.y,l=Math.sqrt(e*e*o*o+r*r*a*a),u=Math.abs(e*r*a/l);n.x0}w(NG,"sameSign");var Y5t=$ke;function Bke(t,e,r){let n=t.x,i=t.y,s=[],a=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY;typeof e.forEach=="function"?e.forEach(function(h){a=Math.min(a,h.x),o=Math.min(o,h.y)}):(a=Math.min(a,e.x),o=Math.min(o,e.y));let l=n-t.width/2-a,u=i-t.height/2-o;for(let h=0;h1&&s.sort(function(h,d){let f=h.x-r.x,p=h.y-r.y,g=Math.sqrt(f*f+p*p),m=d.x-r.x,y=d.y-r.y,v=Math.sqrt(m*m+y*y);return gh,":first-child");return d.attr("class","anchor").attr("style",Xa(o)),Tr(e,d),e.intersect=function(f){return de.info("Circle intersect",e,a,f),or.circle(e,a,f)},s}w(Fke,"anchor");function DG(t,e,r,n,i,s,a){const l=(t+r)/2,u=(e+n)/2,h=Math.atan2(n-e,r-t),d=(r-t)/2,f=(n-e)/2,p=d/i,g=f/s,m=Math.sqrt(p**2+g**2);if(m>1)throw new Error("The given radii are too small to create an arc between the points.");const y=Math.sqrt(1-m**2),v=l+y*s*Math.sin(h)*(a?-1:1),x=u-y*i*Math.cos(h)*(a?-1:1),b=Math.atan2((e-x)/s,(t-v)/i);let C=Math.atan2((n-x)/s,(r-v)/i)-b;a&&C<0&&(C+=2*Math.PI),!a&&C>0&&(C-=2*Math.PI);const S=[];for(let k=0;k<20;k++){const E=k/19,A=b+E*C,R=v+i*Math.cos(A),_=x+s*Math.sin(A);S.push({x:R,y:_})}return S}w(DG,"generateArcPoints");function zke(t,e,r){const[n,i]=[e,r].sort((s,a)=>a-s);return i*(1-Math.sqrt(1-(t/n/2)**2))}w(zke,"calculateArcSagitta");async function Vke(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.padding??0,s=e.look==="neo"?16:i,a=e.look==="neo"?12:i,o=w(A=>A+a,"calcTotalHeight"),l=w(A=>{const R=A/2;return[R/(2.5+A/50),R]},"calcEllipseRadius"),{shapeSvg:u,bbox:h}=await Qr(t,e,Wr(e)),d=o(e!=null&&e.height?e==null?void 0:e.height:h.height),[f,p]=l(d),g=zke(d,f,p),y=(e!=null&&e.width?e==null?void 0:e.width:h.width)+s*2+g-g,v=d,{cssStyles:x}=e,b=[{x:y/2,y:-v/2},{x:-y/2,y:-v/2},...DG(-y/2,-v/2,-y/2,v/2,f,p,!1),{x:y/2,y:v/2},...DG(y/2,v/2,y/2,-v/2,f,p,!0)],T=dr.svg(u),C=fr(e,{});e.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");const S=Fn(b),k=T.path(S,C),E=u.insert(()=>k,":first-child");return E.attr("class","basic label-container outer-path"),x&&e.look!=="handDrawn"&&E.selectAll("path").attr("style",x),n&&e.look!=="handDrawn"&&E.selectAll("path").attr("style",n),E.attr("transform",`translate(${f/2}, 0)`),Tr(e,E),e.intersect=function(A){return or.polygon(e,b,A)},u}w(Vke,"bowTieRect");function G0(t,e,r,n){return t.insert("polygon",":first-child").attr("points",n.map(function(i){return i.x+","+i.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-e/2+","+r/2+")")}w(G0,"insertPolygonShape");var zA=12;async function Hke(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.padding??0,s=e.look==="neo"?28:i,a=e.look==="neo"?24:i,{shapeSvg:o,bbox:l}=await Qr(t,e,Wr(e)),u=((e==null?void 0:e.width)??l.width)+(e.look==="neo"?s*2:s+zA),h=((e==null?void 0:e.height)??l.height)+(e.look==="neo"?a*2:a),d=0,f=u,p=-h,g=0,m=[{x:d+zA,y:p},{x:f,y:p},{x:f,y:g},{x:d,y:g},{x:d,y:p+zA},{x:d+zA,y:p}];let y;const{cssStyles:v}=e;if(e.look==="handDrawn"){const x=dr.svg(o),b=fr(e,{}),T=Fn(m),C=x.path(T,b);y=o.insert(()=>C,":first-child").attr("transform",`translate(${-u/2}, ${h/2})`),v&&y.attr("style",v)}else y=G0(o,u,h,m);return n&&y.attr("style",n),Tr(e,y),e.intersect=function(x){return or.polygon(e,m,x)},o}w(Hke,"card");function Gke(t,e){const{nodeStyles:r}=cr(e);e.label="";const n=t.insert("g").attr("class",Wr(e)).attr("id",e.domId??e.id),{cssStyles:i}=e,s=Math.max(28,e.width??0),a=[{x:0,y:s/2},{x:s/2,y:0},{x:0,y:-s/2},{x:-s/2,y:0}],o=dr.svg(n),l=fr(e,{});e.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");const u=Fn(a),h=o.path(u,l),d=n.insert(()=>h,":first-child");return i&&e.look!=="handDrawn"&&d.selectAll("path").attr("style",i),r&&e.look!=="handDrawn"&&d.selectAll("path").attr("style",r),e.width=28,e.height=28,e.intersect=function(f){return or.polygon(e,a,f)},n}w(Gke,"choice");async function MZ(t,e,r){const{labelStyles:n,nodeStyles:i}=cr(e);e.labelStyle=n;const{shapeSvg:s,bbox:a,halfPadding:o}=await Qr(t,e,Wr(e)),l=16,u=(r==null?void 0:r.padding)??o,h=e.look==="neo"?a.width/2+l*2:a.width/2+u;let d;const{cssStyles:f}=e;if(e.look==="handDrawn"){const p=dr.svg(s),g=fr(e,{}),m=p.circle(0,0,h*2,g);d=s.insert(()=>m,":first-child"),d.attr("class","basic label-container").attr("style",Xa(f))}else d=s.insert("circle",":first-child").attr("class","basic label-container").attr("style",i).attr("r",h).attr("cx",0).attr("cy",0);return Tr(e,d),e.calcIntersect=function(p,g){const m=p.width/2;return or.circle(p,m,g)},e.intersect=function(p){return de.info("Circle intersect",e,h,p),or.circle(e,h,p)},s}w(MZ,"circle");function Wke(t){const e=Math.cos(Math.PI/4),r=Math.sin(Math.PI/4),n=t*2,i={x:n/2*e,y:n/2*r},s={x:-(n/2)*e,y:n/2*r},a={x:-(n/2)*e,y:-(n/2)*r},o={x:n/2*e,y:-(n/2)*r};return`M ${s.x},${s.y} L ${o.x},${o.y}
- M ${i.x},${i.y} L ${a.x},${a.y}`}w(Wke,"createLine");function qke(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r,e.label="";const i=t.insert("g").attr("class",Wr(e)).attr("id",e.domId??e.id),s=Math.max(30,(e==null?void 0:e.width)??0),{cssStyles:a}=e,o=dr.svg(i),l=fr(e,{});e.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");const u=o.circle(0,0,s*2,l),h=Wke(s),d=o.path(h,l),f=i.insert(()=>u,":first-child");return f.insert(()=>d),f.attr("class","outer-path"),a&&e.look!=="handDrawn"&&f.selectAll("path").attr("style",a),n&&e.look!=="handDrawn"&&f.selectAll("path").attr("style",n),Tr(e,f),e.intersect=function(p){return de.info("crossedCircle intersect",e,{radius:s,point:p}),or.circle(e,s,p)},i}w(qke,"crossedCircle");function xf(t,e,r,n=100,i=0,s=180){const a=[],o=i*Math.PI/180,h=(s*Math.PI/180-o)/(n-1);for(let d=0;dC,":first-child").attr("stroke-opacity",0),S.insert(()=>b,":first-child"),S.attr("class","text"),f&&e.look!=="handDrawn"&&S.selectAll("path").attr("style",f),n&&e.look!=="handDrawn"&&S.selectAll("path").attr("style",n),S.attr("transform",`translate(${d}, 0)`),a.attr("transform",`translate(${-u/2+d-(s.x-(s.left??0))},${-h/2+(e.padding??0)/2-(s.y-(s.top??0))})`),Tr(e,S),e.intersect=function(k){return or.polygon(e,g,k)},i}w(Uke,"curlyBraceLeft");function wf(t,e,r,n=100,i=0,s=180){const a=[],o=i*Math.PI/180,h=(s*Math.PI/180-o)/(n-1);for(let d=0;dC,":first-child").attr("stroke-opacity",0),S.insert(()=>b,":first-child"),S.attr("class","text"),f&&e.look!=="handDrawn"&&S.selectAll("path").attr("style",f),n&&e.look!=="handDrawn"&&S.selectAll("path").attr("style",n),S.attr("transform",`translate(${-d}, 0)`),a.attr("transform",`translate(${-u/2+(e.padding??0)/2-(s.x-(s.left??0))},${-h/2+(e.padding??0)/2-(s.y-(s.top??0))})`),Tr(e,S),e.intersect=function(k){return or.polygon(e,g,k)},i}w(Yke,"curlyBraceRight");function uo(t,e,r,n=100,i=0,s=180){const a=[],o=i*Math.PI/180,h=(s*Math.PI/180-o)/(n-1);for(let d=0;dA,":first-child").attr("stroke-opacity",0),R.insert(()=>T,":first-child"),R.insert(()=>k,":first-child"),R.attr("class","text"),f&&e.look!=="handDrawn"&&R.selectAll("path").attr("style",f),n&&e.look!=="handDrawn"&&R.selectAll("path").attr("style",n),R.attr("transform",`translate(${d-d/4}, 0)`),a.attr("transform",`translate(${-u/2+(e.padding??0)/2-(s.x-(s.left??0))},${-h/2+(e.padding??0)/2-(s.y-(s.top??0))})`),Tr(e,R),e.intersect=function(_){return or.polygon(e,m,_)},i}w(jke,"curlyBraces");async function Xke(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.padding??0,s=e.look==="neo"?16:i,a=e.look==="neo"?12:i,o=20,l=5,{shapeSvg:u,bbox:h}=await Qr(t,e,Wr(e)),d=Math.max(o,(h.width+s*2)*1.25,(e==null?void 0:e.width)??0),f=Math.max(l,h.height+a*2,(e==null?void 0:e.height)??0),p=f/2,{cssStyles:g}=e,m=dr.svg(u),y=fr(e,{});e.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const v=d,x=f,b=v-p,T=x/4,C=[{x:b,y:0},{x:T,y:0},{x:0,y:x/2},{x:T,y:x},{x:b,y:x},...S6(-b,-x/2,p,50,270,90)],S=Fn(C),k=m.path(S,y),E=u.insert(()=>k,":first-child");return E.attr("class","basic label-container outer-path"),g&&e.look!=="handDrawn"&&E.selectChildren("path").attr("style",g),n&&e.look!=="handDrawn"&&E.selectChildren("path").attr("style",n),E.attr("transform",`translate(${-d/2}, ${-f/2})`),Tr(e,E),e.intersect=function(A){return or.polygon(e,C,A)},u}w(Xke,"curvedTrapezoid");var X5t=w((t,e,r,n,i,s)=>[`M${t},${e+s}`,`a${i},${s} 0,0,0 ${r},0`,`a${i},${s} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${s} 0,0,0 ${r},0`,`l0,${-n}`].join(" "),"createCylinderPathD"),K5t=w((t,e,r,n,i,s)=>[`M${t},${e+s}`,`M${t+r},${e+s}`,`a${i},${s} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${s} 0,0,0 ${r},0`,`l0,${-n}`].join(" "),"createOuterCylinderPathD"),Z5t=w((t,e,r,n,i,s)=>[`M${t-r/2},${-n/2}`,`a${i},${s} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),wce=8,Tce=8;async function Kke(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.padding??0,s=e.look==="neo"?24:i,a=e.look==="neo"?24:i;if(e.width||e.height){const y=e.width??0;e.width=(e.width??0)-a,e.widthC,":first-child"),g=o.insert(()=>T,":first-child"),g.attr("class","basic label-container"),m&&g.attr("style",m)}else{const y=X5t(0,0,h,p,d,f);g=o.insert("path",":first-child").attr("d",y).attr("class","basic label-container outer-path").attr("style",Xa(m)).attr("style",n)}return g.attr("label-offset-y",f),g.attr("transform",`translate(${-h/2}, ${-(p/2+f)})`),Tr(e,g),u.attr("transform",`translate(${-(l.width/2)-(l.x-(l.left??0))}, ${-(l.height/2)+(e.padding??0)/1.5-(l.y-(l.top??0))})`),e.intersect=function(y){const v=or.rect(e,y),x=v.x-(e.x??0);if(d!=0&&(Math.abs(x)<(e.width??0)/2||Math.abs(x)==(e.width??0)/2&&Math.abs(v.y-(e.y??0))>(e.height??0)/2-f)){let b=f*f*(1-x*x/(d*d));b>0&&(b=Math.sqrt(b)),b=f-b,y.y-(e.y??0)>0&&(b=-b),v.y+=b}return v},o}w(Kke,"cylinder");async function u3(t,e,r){const{labelStyles:n,nodeStyles:i}=cr(e);e.labelStyle=n;const{shapeSvg:s,bbox:a}=await Qr(t,e,Wr(e)),o=Math.max(a.width+r.labelPaddingX*2,(e==null?void 0:e.width)||0),l=Math.max(a.height+r.labelPaddingY*2,(e==null?void 0:e.height)||0),u=-o/2,h=-l/2;let d,{rx:f,ry:p}=e;const{cssStyles:g}=e;if(r!=null&&r.rx&&r.ry&&(f=r.rx,p=r.ry),e.look==="handDrawn"){const m=dr.svg(s),y=fr(e,{}),v=f||p?m.path(Qg(u,h,o,l,f||0),y):m.rectangle(u,h,o,l,y);d=s.insert(()=>v,":first-child"),d.attr("class","basic label-container").attr("style",Xa(g))}else d=s.insert("rect",":first-child"),d.attr("class","basic label-container").attr("style",i).attr("rx",Xa(f)).attr("ry",Xa(p)).attr("x",u).attr("y",h).attr("width",o).attr("height",l);return Tr(e,d),e.calcIntersect=function(m,y){return or.rect(m,y)},e.intersect=function(m){return or.rect(e,m)},s}w(u3,"drawRect");async function Zke(t,e){const{cssClasses:r,labelPaddingX:n,labelPaddingY:i,padding:s,width:a,height:o}=e,l={rx:0,ry:0,labelPaddingX:n??(s??0)*2,labelPaddingY:i??s??0},u=await u3(t,e,l);if(e.look==="handDrawn"){const p=dr.svg(u),g=fr(e,{}),m=u.select(".basic.label-container > path:nth-child(2)"),y=m.node();if(!y)return u;let v=null;if(y instanceof SVGGraphicsElement)v=y.getBBox();else return u;return u.insert(()=>p.line(v.x,v.y,v.x+v.width,v.y,g),".basic.label-container g.label"),u.insert(()=>p.line(v.x,v.y+v.height,v.x+v.width,v.y+v.height,g),".basic.label-container g.label"),m.remove(),u}const h=u.select(".basic.label-container"),d=(Number(h.attr("width"))||a)??0,f=(Number(h.attr("height"))||o)??0;return d>0&&f>0&&h.attr("stroke-dasharray",`${d} ${f}`),u}w(Zke,"datastore");async function Qke(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.look==="neo"?16:e.padding??0,s=e.look==="neo"?16:e.padding??0,{shapeSvg:a,bbox:o,label:l}=await Qr(t,e,Wr(e)),u=o.width+i,h=o.height+s,d=h*.2,f=-u/2,p=-h/2-d/2,{cssStyles:g}=e,m=dr.svg(a),y=fr(e,{});e.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const v=[{x:f,y:p+d},{x:-f,y:p+d},{x:-f,y:-p},{x:f,y:-p},{x:f,y:p},{x:-f,y:p},{x:-f,y:p+d}],x=m.polygon(v.map(T=>[T.x,T.y]),y),b=a.insert(()=>x,":first-child");return b.attr("class","basic label-container outer-path"),g&&e.look!=="handDrawn"&&b.selectAll("path").attr("style",g),n&&e.look!=="handDrawn"&&b.selectAll("path").attr("style",n),l.attr("transform",`translate(${f+(e.padding??0)/2-(o.x-(o.left??0))}, ${p+d+(e.padding??0)/2-(o.y-(o.top??0))})`),Tr(e,b),e.intersect=function(T){return or.rect(e,T)},a}w(Qke,"dividedRectangle");async function Jke(t,e){var p,g;const{labelStyles:r,nodeStyles:n}=cr(e),i=e.look==="neo"?12:5;e.labelStyle=r;const s=e.padding??0,a=e.look==="neo"?16:s,{shapeSvg:o,bbox:l}=await Qr(t,e,Wr(e)),u=(e!=null&&e.width?(e==null?void 0:e.width)/2:l.width/2)+(a??0),h=u-i;let d;const{cssStyles:f}=e;if(e.look==="handDrawn"){const m=dr.svg(o),y=fr(e,{roughness:.2,strokeWidth:2.5}),v=fr(e,{roughness:.2,strokeWidth:1.5}),x=m.circle(0,0,u*2,y),b=m.circle(0,0,h*2,v);d=o.insert("g",":first-child"),d.attr("class",Xa(e.cssClasses)).attr("style",Xa(f)),(p=d.node())==null||p.appendChild(x),(g=d.node())==null||g.appendChild(b)}else{d=o.insert("g",":first-child");const m=d.insert("circle",":first-child"),y=d.insert("circle");d.attr("class","basic label-container").attr("style",n),m.attr("class","outer-circle").attr("style",n).attr("r",u).attr("cx",0).attr("cy",0),y.attr("class","inner-circle").attr("style",n).attr("r",h).attr("cx",0).attr("cy",0)}return Tr(e,d),e.intersect=function(m){return de.info("DoubleCircle intersect",e,u,m),or.circle(e,u,m)},o}w(Jke,"doublecircle");function eSe(t,e,{config:{themeVariables:r}}){const{labelStyles:n,nodeStyles:i}=cr(e);e.label="",e.labelStyle=n;const s=t.insert("g").attr("class",Wr(e)).attr("id",e.domId??e.id),a=7,{cssStyles:o}=e,l=dr.svg(s),{nodeBorder:u}=r,h=fr(e,{fillStyle:"solid"});e.look!=="handDrawn"&&(h.roughness=0);const d=l.circle(0,0,a*2,h),f=s.insert(()=>d,":first-child");return f.selectAll("path").attr("style",`fill: ${u} !important;`),o&&o.length>0&&e.look!=="handDrawn"&&f.selectAll("path").attr("style",o),i&&e.look!=="handDrawn"&&f.selectAll("path").attr("style",i),Tr(e,f),e.intersect=function(p){return de.info("filledCircle intersect",e,{radius:a,point:p}),or.circle(e,a,p)},s}w(eSe,"filledCircle");var Cce=10,kce=10;async function tSe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.padding??0,s=e.look==="neo"?i*2:i;(e.width||e.height)&&(e.height=(e==null?void 0:e.height)??0,e.heightv,":first-child").attr("transform",`translate(${-h/2}, ${h/2})`).attr("class","outer-path");return p&&e.look!=="handDrawn"&&x.selectChildren("path").attr("style",p),n&&e.look!=="handDrawn"&&x.selectChildren("path").attr("style",n),e.width=u,e.height=h,Tr(e,x),l.attr("transform",`translate(${-o.width/2-(o.x-(o.left??0))}, ${-h/2+(e.padding??0)/2+(o.y-(o.top??0))})`),e.intersect=function(b){return de.info("Triangle intersect",e,f,b),or.polygon(e,f,b)},a}w(tSe,"flippedTriangle");function rSe(t,e,{dir:r,config:{state:n,themeVariables:i}}){const{nodeStyles:s}=cr(e);e.label="";const a=t.insert("g").attr("class",Wr(e)).attr("id",e.domId??e.id),{cssStyles:o}=e;let l=Math.max(70,(e==null?void 0:e.width)??0),u=Math.max(10,(e==null?void 0:e.height)??0);r==="LR"&&(l=Math.max(10,(e==null?void 0:e.width)??0),u=Math.max(70,(e==null?void 0:e.height)??0));const h=-1*l/2,d=-1*u/2,f=dr.svg(a),p=fr(e,{stroke:i.lineColor,fill:i.lineColor});e.look!=="handDrawn"&&(p.roughness=0,p.fillStyle="solid");const g=f.rectangle(h,d,l,u,p),m=a.insert(()=>g,":first-child");o&&e.look!=="handDrawn"&&m.selectAll("path").attr("style",o),s&&e.look!=="handDrawn"&&m.selectAll("path").attr("style",s),Tr(e,m);const y=(n==null?void 0:n.padding)??0;return e.width&&e.height&&(e.width+=y/2||0,e.height+=y/2||0),e.intersect=function(v){return or.rect(e,v)},a}w(rSe,"forkJoin");async function nSe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=15,s=10,a=e.look==="neo"?16:e.padding??0,o=e.look==="neo"?12:e.padding??0;(e.width||e.height)&&(e.height=((e==null?void 0:e.height)??0)-o*2,e.heightx,":first-child");return b.attr("class","basic label-container outer-path"),p&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",p),n&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",n),Tr(e,b),e.intersect=function(T){return de.info("Pill intersect",e,{radius:f,point:T}),or.polygon(e,y,T)},l}w(nSe,"halfRoundedRectangle");var Q5t=w((t,e,r,n,i)=>[`M${t+i},${e}`,`L${t+r-i},${e}`,`L${t+r},${e-n/2}`,`L${t+r-i},${e-n}`,`L${t+i},${e-n}`,`L${t},${e-n/2}`,"Z"].join(" "),"createHexagonPathD");async function iSe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e),i=e.look==="neo"?3.5:4;e.labelStyle=r;const s=e.padding??0,a=70,o=32,l=e.look==="neo"?a:s,u=e.look==="neo"?o:s;if(e.width||e.height){const b=(e.height??0)/i;e.width=((e==null?void 0:e.width)??0)-2*b-u,e.height=(e.height??0)-l}const{shapeSvg:h,bbox:d}=await Qr(t,e,Wr(e)),f=(e!=null&&e.height?e==null?void 0:e.height:d.height)+l,p=f/i,g=(e!=null&&e.width?e==null?void 0:e.width:d.width)+2*p+u,m=[{x:p,y:0},{x:g-p,y:0},{x:g,y:-f/2},{x:g-p,y:-f},{x:p,y:-f},{x:0,y:-f/2}];let y;const{cssStyles:v}=e;if(e.look==="handDrawn"){const x=dr.svg(h),b=fr(e,{}),T=Q5t(0,0,g,f,p),C=x.path(T,b);y=h.insert(()=>C,":first-child").attr("transform",`translate(${-g/2}, ${f/2})`),v&&y.attr("style",v)}else y=G0(h,g,f,m);return n&&y.attr("style",n),e.width=g,e.height=f,Tr(e,y),e.intersect=function(x){return or.polygon(e,m,x)},h}w(iSe,"hexagon");async function sSe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.label="",e.labelStyle=r;const{shapeSvg:i}=await Qr(t,e,Wr(e)),s=Math.max(30,(e==null?void 0:e.width)??0),a=Math.max(30,(e==null?void 0:e.height)??0),{cssStyles:o}=e,l=dr.svg(i),u=fr(e,{});e.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");const h=[{x:0,y:0},{x:s,y:0},{x:0,y:a},{x:s,y:a}],d=Fn(h),f=l.path(d,u),p=i.insert(()=>f,":first-child");return p.attr("class","basic label-container outer-path"),o&&e.look!=="handDrawn"&&p.selectChildren("path").attr("style",o),n&&e.look!=="handDrawn"&&p.selectChildren("path").attr("style",n),p.attr("transform",`translate(${-s/2}, ${-a/2})`),Tr(e,p),e.intersect=function(g){return de.info("Pill intersect",e,{points:h}),or.polygon(e,h,g)},i}w(sSe,"hourglass");async function aSe(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=cr(e);e.labelStyle=i;const s=e.assetHeight??48,a=e.assetWidth??48,o=Math.max(s,a),l=n==null?void 0:n.wrappingWidth;e.width=Math.max(o,l??0);const{shapeSvg:u,bbox:h,label:d}=await Qr(t,e,"icon-shape default"),f=e.pos==="t",p=o,g=o,{nodeBorder:m}=r,{stylesMap:y}=l3(e),v=-g/2,x=-p/2,b=e.label?8:0,T=dr.svg(u),C=fr(e,{stroke:"none",fill:"none"});e.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");const S=T.rectangle(v,x,g,p,C),k=Math.max(g,h.width),E=p+h.height+b,A=T.rectangle(-k/2,-E/2,k,E,{...C,fill:"transparent",stroke:"none"}),R=u.insert(()=>S,":first-child"),_=u.insert(()=>A);if(e.icon){const P=u.append("g");P.html(`${await m0(e.icon,{height:o,width:o,fallbackPrefix:""})}`);const N=P.node().getBBox(),L=N.width,I=N.height,$=N.x,O=N.y;P.attr("transform",`translate(${-L/2-$},${f?h.height/2+b/2-I/2-O:-h.height/2-b/2-I/2-O})`),P.attr("style",`color: ${y.get("stroke")??m};`)}return d.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${f?-E/2:E/2-h.height})`),R.attr("transform",`translate(0,${f?h.height/2+b/2:-h.height/2-b/2})`),Tr(e,_),e.intersect=function(P){if(de.info("iconSquare intersect",e,P),!e.label)return or.rect(e,P);const N=e.x??0,L=e.y??0,I=e.height??0;let $=[];return f?$=[{x:N-h.width/2,y:L-I/2},{x:N+h.width/2,y:L-I/2},{x:N+h.width/2,y:L-I/2+h.height+b},{x:N+g/2,y:L-I/2+h.height+b},{x:N+g/2,y:L+I/2},{x:N-g/2,y:L+I/2},{x:N-g/2,y:L-I/2+h.height+b},{x:N-h.width/2,y:L-I/2+h.height+b}]:$=[{x:N-g/2,y:L-I/2},{x:N+g/2,y:L-I/2},{x:N+g/2,y:L-I/2+p},{x:N+h.width/2,y:L-I/2+p},{x:N+h.width/2/2,y:L+I/2},{x:N-h.width/2,y:L+I/2},{x:N-h.width/2,y:L-I/2+p},{x:N-g/2,y:L-I/2+p}],or.polygon(e,$,P)},u}w(aSe,"icon");async function oSe(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=cr(e);e.labelStyle=i;const s=e.assetHeight??48,a=e.assetWidth??48,o=Math.max(s,a),l=n==null?void 0:n.wrappingWidth;e.width=Math.max(o,l??0);const{shapeSvg:u,bbox:h,label:d}=await Qr(t,e,"icon-shape default"),f=20,p=e.label?8:0,g=e.pos==="t",{nodeBorder:m,mainBkg:y}=r,{stylesMap:v}=l3(e),x=dr.svg(u),b=fr(e,{});e.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");const T=v.get("fill");b.stroke=T??y;const C=u.append("g");e.icon&&C.html(`${await m0(e.icon,{height:o,width:o,fallbackPrefix:""})}`);const S=C.node().getBBox(),k=S.width,E=S.height,A=S.x,R=S.y,_=Math.max(k,E)*Math.SQRT2+f*2,P=x.circle(0,0,_,b),N=Math.max(_,h.width),L=_+h.height+p,I=x.rectangle(-N/2,-L/2,N,L,{...b,fill:"transparent",stroke:"none"}),$=u.insert(()=>P,":first-child"),O=u.insert(()=>I);return C.attr("transform",`translate(${-k/2-A},${g?h.height/2+p/2-E/2-R:-h.height/2-p/2-E/2-R})`),C.attr("style",`color: ${v.get("stroke")??m};`),d.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${g?-L/2:L/2-h.height})`),$.attr("transform",`translate(0,${g?h.height/2+p/2:-h.height/2-p/2})`),Tr(e,O),e.intersect=function(D){return de.info("iconSquare intersect",e,D),or.rect(e,D)},u}w(oSe,"iconCircle");async function lSe(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=cr(e);e.labelStyle=i;const s=e.assetHeight??48,a=e.assetWidth??48,o=Math.max(s,a),l=n==null?void 0:n.wrappingWidth;e.width=Math.max(o,l??0);const{shapeSvg:u,bbox:h,halfPadding:d,label:f}=await Qr(t,e,"icon-shape default"),p=e.pos==="t",g=o+d*2,m=o+d*2,{nodeBorder:y,mainBkg:v}=r,{stylesMap:x}=l3(e),b=-m/2,T=-g/2,C=e.label?8:0,S=dr.svg(u),k=fr(e,{});e.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");const E=x.get("fill");k.stroke=E??v;const A=S.path(Qg(b,T,m,g,5),k),R=Math.max(m,h.width),_=g+h.height+C,P=S.rectangle(-R/2,-_/2,R,_,{...k,fill:"transparent",stroke:"none"}),N=u.insert(()=>A,":first-child").attr("class","icon-shape2"),L=u.insert(()=>P);if(e.icon){const I=u.append("g");I.html(`${await m0(e.icon,{height:o,width:o,fallbackPrefix:""})}`);const $=I.node().getBBox(),O=$.width,D=$.height,F=$.x,z=$.y;I.attr("transform",`translate(${-O/2-F},${p?h.height/2+C/2-D/2-z:-h.height/2-C/2-D/2-z})`),I.attr("style",`color: ${x.get("stroke")??y};`)}return f.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${p?-_/2:_/2-h.height})`),N.attr("transform",`translate(0,${p?h.height/2+C/2:-h.height/2-C/2})`),Tr(e,L),e.intersect=function(I){if(de.info("iconSquare intersect",e,I),!e.label)return or.rect(e,I);const $=e.x??0,O=e.y??0,D=e.height??0;let F=[];return p?F=[{x:$-h.width/2,y:O-D/2},{x:$+h.width/2,y:O-D/2},{x:$+h.width/2,y:O-D/2+h.height+C},{x:$+m/2,y:O-D/2+h.height+C},{x:$+m/2,y:O+D/2},{x:$-m/2,y:O+D/2},{x:$-m/2,y:O-D/2+h.height+C},{x:$-h.width/2,y:O-D/2+h.height+C}]:F=[{x:$-m/2,y:O-D/2},{x:$+m/2,y:O-D/2},{x:$+m/2,y:O-D/2+g},{x:$+h.width/2,y:O-D/2+g},{x:$+h.width/2/2,y:O+D/2},{x:$-h.width/2,y:O+D/2},{x:$-h.width/2,y:O-D/2+g},{x:$-m/2,y:O-D/2+g}],or.polygon(e,F,I)},u}w(lSe,"iconRounded");async function cSe(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=cr(e);e.labelStyle=i;const s=e.assetHeight??48,a=e.assetWidth??48,o=Math.max(s,a),l=n==null?void 0:n.wrappingWidth;e.width=Math.max(o,l??0);const{shapeSvg:u,bbox:h,halfPadding:d,label:f}=await Qr(t,e,"icon-shape default"),p=e.pos==="t",g=o+d*2,m=o+d*2,{nodeBorder:y,mainBkg:v}=r,{stylesMap:x}=l3(e),b=-m/2,T=-g/2,C=e.label?8:0,S=dr.svg(u),k=fr(e,{});e.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");const E=x.get("fill");k.stroke=E??v;const A=S.path(Qg(b,T,m,g,.1),k),R=Math.max(m,h.width),_=g+h.height+C,P=S.rectangle(-R/2,-_/2,R,_,{...k,fill:"transparent",stroke:"none"}),N=u.insert(()=>A,":first-child"),L=u.insert(()=>P);if(e.icon){const I=u.append("g");I.html(`${await m0(e.icon,{height:o,width:o,fallbackPrefix:""})}`);const $=I.node().getBBox(),O=$.width,D=$.height,F=$.x,z=$.y;I.attr("transform",`translate(${-O/2-F},${p?h.height/2+C/2-D/2-z:-h.height/2-C/2-D/2-z})`),I.attr("style",`color: ${x.get("stroke")??y};`)}return f.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${p?-_/2:_/2-h.height})`),N.attr("transform",`translate(0,${p?h.height/2+C/2:-h.height/2-C/2})`),Tr(e,L),e.intersect=function(I){if(de.info("iconSquare intersect",e,I),!e.label)return or.rect(e,I);const $=e.x??0,O=e.y??0,D=e.height??0;let F=[];return p?F=[{x:$-h.width/2,y:O-D/2},{x:$+h.width/2,y:O-D/2},{x:$+h.width/2,y:O-D/2+h.height+C},{x:$+m/2,y:O-D/2+h.height+C},{x:$+m/2,y:O+D/2},{x:$-m/2,y:O+D/2},{x:$-m/2,y:O-D/2+h.height+C},{x:$-h.width/2,y:O-D/2+h.height+C}]:F=[{x:$-m/2,y:O-D/2},{x:$+m/2,y:O-D/2},{x:$+m/2,y:O-D/2+g},{x:$+h.width/2,y:O-D/2+g},{x:$+h.width/2/2,y:O+D/2},{x:$-h.width/2,y:O+D/2},{x:$-h.width/2,y:O-D/2+g},{x:$-m/2,y:O-D/2+g}],or.polygon(e,F,I)},u}w(cSe,"iconSquare");async function uSe(t,e,{config:{flowchart:r}}){const n=new Image;n.src=(e==null?void 0:e.img)??"",await n.decode();const i=Number(n.naturalWidth.toString().replace("px","")),s=Number(n.naturalHeight.toString().replace("px",""));e.imageAspectRatio=i/s;const{labelStyles:a}=cr(e);e.labelStyle=a;const o=r==null?void 0:r.wrappingWidth;e.defaultWidth=r==null?void 0:r.wrappingWidth;const l=Math.max(e.label?o??0:0,(e==null?void 0:e.assetWidth)??i),u=e.constraint==="on"&&e!=null&&e.assetHeight?e.assetHeight*e.imageAspectRatio:l,h=e.constraint==="on"?u/e.imageAspectRatio:(e==null?void 0:e.assetHeight)??s;e.width=Math.max(u,o??0);const{shapeSvg:d,bbox:f,label:p}=await Qr(t,e,"image-shape default"),g=e.pos==="t",m=-u/2,y=-h/2,v=e.label?8:0,x=dr.svg(d),b=fr(e,{});e.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");const T=x.rectangle(m,y,u,h,b),C=Math.max(u,f.width),S=h+f.height+v,k=x.rectangle(-C/2,-S/2,C,S,{...b,fill:"none",stroke:"none"}),E=d.insert(()=>T,":first-child"),A=d.insert(()=>k);if(e.img){const R=d.append("image");R.attr("href",e.img),R.attr("width",u),R.attr("height",h),R.attr("preserveAspectRatio","none"),R.attr("transform",`translate(${-u/2},${g?S/2-h:-S/2})`)}return p.attr("transform",`translate(${-f.width/2-(f.x-(f.left??0))},${g?-h/2-f.height/2-v/2:h/2-f.height/2+v/2})`),E.attr("transform",`translate(0,${g?f.height/2+v/2:-f.height/2-v/2})`),Tr(e,A),e.intersect=function(R){if(de.info("iconSquare intersect",e,R),!e.label)return or.rect(e,R);const _=e.x??0,P=e.y??0,N=e.height??0;let L=[];return g?L=[{x:_-f.width/2,y:P-N/2},{x:_+f.width/2,y:P-N/2},{x:_+f.width/2,y:P-N/2+f.height+v},{x:_+u/2,y:P-N/2+f.height+v},{x:_+u/2,y:P+N/2},{x:_-u/2,y:P+N/2},{x:_-u/2,y:P-N/2+f.height+v},{x:_-f.width/2,y:P-N/2+f.height+v}]:L=[{x:_-u/2,y:P-N/2},{x:_+u/2,y:P-N/2},{x:_+u/2,y:P-N/2+h},{x:_+f.width/2,y:P-N/2+h},{x:_+f.width/2/2,y:P+N/2},{x:_-f.width/2,y:P+N/2},{x:_-f.width/2,y:P-N/2+h},{x:_-u/2,y:P-N/2+h}],or.polygon(e,L,R)},d}w(uSe,"imageSquare");async function hSe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.padding??0,s=i,a=e.look==="neo"?i*2:i,{shapeSvg:o,bbox:l}=await Qr(t,e,Wr(e)),u=Math.max(l.width+(a??0)*2,(e==null?void 0:e.width)??0),h=Math.max(l.height+(s??0)*2,(e==null?void 0:e.height)??0),d=[{x:0,y:0},{x:u,y:0},{x:u+3*h/6,y:-h},{x:-3*h/6,y:-h}];let f;const{cssStyles:p}=e;if(e.look==="handDrawn"){const g=dr.svg(o),m=fr(e,{}),y=Fn(d),v=g.path(y,m);f=o.insert(()=>v,":first-child").attr("transform",`translate(${-u/2}, ${h/2})`),p&&f.attr("style",p)}else f=G0(o,u,h,d);return n&&f.attr("style",n),e.width=u,e.height=h,Tr(e,f),e.intersect=function(g){return or.polygon(e,d,g)},o}w(hSe,"inv_trapezoid");async function dSe(t,e){const{shapeSvg:r,bbox:n,label:i}=await Qr(t,e,"label"),s=r.insert("rect",":first-child");return s.attr("width",.1).attr("height",.1),r.attr("class","label edgeLabel"),i.attr("transform",`translate(${-(n.width/2)-(n.x-(n.left??0))}, ${-(n.height/2)-(n.y-(n.top??0))})`),Tr(e,s),e.intersect=function(l){return or.rect(e,l)},r}w(dSe,"labelRect");async function fSe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.padding??0,s=i,a=e.look==="neo"?i*2:i,{shapeSvg:o,bbox:l}=await Qr(t,e,Wr(e)),u=((e==null?void 0:e.height)??l.height)+s,h=((e==null?void 0:e.width)??l.width)+a,d=[{x:0,y:0},{x:h+3*u/6,y:0},{x:h,y:-u},{x:-(3*u)/6,y:-u}];let f;const{cssStyles:p}=e;if(e.look==="handDrawn"){const g=dr.svg(o),m=fr(e,{}),y=Fn(d),v=g.path(y,m);f=o.insert(()=>v,":first-child").attr("transform",`translate(${-h/2}, ${u/2})`),p&&f.attr("style",p)}else f=G0(o,h,u,d);return n&&f.attr("style",n),e.width=h,e.height=u,Tr(e,f),e.intersect=function(g){return or.polygon(e,d,g)},o}w(fSe,"lean_left");async function pSe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.padding??0,s=i,a=e.look==="neo"?i*2:i,{shapeSvg:o,bbox:l}=await Qr(t,e,Wr(e)),u=((e==null?void 0:e.height)??l.height)+s,h=((e==null?void 0:e.width)??l.width)+a,d=[{x:-3*u/6,y:0},{x:h,y:0},{x:h+3*u/6,y:-u},{x:0,y:-u}];let f;const{cssStyles:p}=e;if(e.look==="handDrawn"){const g=dr.svg(o),m=fr(e,{}),y=Fn(d),v=g.path(y,m);f=o.insert(()=>v,":first-child").attr("transform",`translate(${-h/2}, ${u/2})`),p&&f.attr("style",p)}else f=G0(o,h,u,d);return n&&f.attr("style",n),e.width=h,e.height=u,Tr(e,f),e.intersect=function(g){return or.polygon(e,d,g)},o}w(pSe,"lean_right");function gSe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.label="",e.labelStyle=r;const i=t.insert("g").attr("class",Wr(e)).attr("id",e.domId??e.id),{cssStyles:s}=e,a=Math.max(35,(e==null?void 0:e.width)??0),o=Math.max(35,(e==null?void 0:e.height)??0),l=7,u=[{x:a,y:0},{x:0,y:o+l/2},{x:a-2*l,y:o+l/2},{x:0,y:2*o},{x:a,y:o-l/2},{x:2*l,y:o-l/2}],h=dr.svg(i),d=fr(e,{});e.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");const f=Fn(u),p=h.path(f,d),g=i.insert(()=>p,":first-child");return g.attr("class","outer-path"),s&&e.look!=="handDrawn"&&g.selectAll("path").attr("style",s),n&&e.look!=="handDrawn"&&g.selectAll("path").attr("style",n),g.attr("transform",`translate(-${a/2},${-o})`),Tr(e,g),e.intersect=function(m){return de.info("lightningBolt intersect",e,m),or.polygon(e,u,m)},i}w(gSe,"lightningBolt");var J5t=w((t,e,r,n,i,s,a)=>[`M${t},${e+s}`,`a${i},${s} 0,0,0 ${r},0`,`a${i},${s} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${s} 0,0,0 ${r},0`,`l0,${-n}`,`M${t},${e+s+a}`,`a${i},${s} 0,0,0 ${r},0`].join(" "),"createCylinderPathD"),e3t=w((t,e,r,n,i,s,a)=>[`M${t},${e+s}`,`M${t+r},${e+s}`,`a${i},${s} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${s} 0,0,0 ${r},0`,`l0,${-n}`,`M${t},${e+s+a}`,`a${i},${s} 0,0,0 ${r},0`].join(" "),"createOuterCylinderPathD"),t3t=w((t,e,r,n,i,s)=>[`M${t-r/2},${-n/2}`,`a${i},${s} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),Sce=10,Ece=10;async function mSe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.padding??0,s=e.look==="neo"?16:i,a=e.look==="neo"?24:i;if(e.width||e.height){const v=e.width??0;e.width=(e.width??0)-s,e.widthS,":first-child").attr("class","line"),m=o.insert(()=>C,":first-child"),m.attr("class","basic label-container"),y&&m.attr("style",y)}else{const v=J5t(0,0,h,p,d,f,g);m=o.insert("path",":first-child").attr("d",v).attr("class","basic label-container outer-path").attr("style",Xa(y)).attr("style",n)}return m.attr("label-offset-y",f),m.attr("transform",`translate(${-h/2}, ${-(p/2+f)})`),Tr(e,m),u.attr("transform",`translate(${-(l.width/2)-(l.x-(l.left??0))}, ${-(l.height/2)+f-(l.y-(l.top??0))})`),e.intersect=function(v){const x=or.rect(e,v),b=x.x-(e.x??0);if(d!=0&&(Math.abs(b)<(e.width??0)/2||Math.abs(b)==(e.width??0)/2&&Math.abs(x.y-(e.y??0))>(e.height??0)/2-f)){let T=f*f*(1-b*b/(d*d));T>0&&(T=Math.sqrt(T)),T=f-T,v.y-(e.y??0)>0&&(T=-T),x.y+=T}return x},o}w(mSe,"linedCylinder");async function ySe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.padding??0,s=e.look==="neo"?16:i,a=e.look==="neo"?12:i;if(e.width||e.height){const T=e.width;e.width=(T??0)*10/11-s*2,e.width<10&&(e.width=10),e.height=((e==null?void 0:e.height)??0)-a*2,e.height<10&&(e.height=10)}const{shapeSvg:o,bbox:l,label:u}=await Qr(t,e,Wr(e)),h=(e!=null&&e.width?e==null?void 0:e.width:l.width)+(s??0)*2,d=(e!=null&&e.height?e==null?void 0:e.height:l.height)+(a??0)*2,f=e.look==="neo"?d/4:d/8,p=d+f,{cssStyles:g}=e,m=dr.svg(o),y=fr(e,{});e.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const v=[{x:-h/2-h/2*.1,y:-p/2},{x:-h/2-h/2*.1,y:p/2},...xg(-h/2-h/2*.1,p/2,h/2+h/2*.1,p/2,f,.8),{x:h/2+h/2*.1,y:-p/2},{x:-h/2-h/2*.1,y:-p/2},{x:-h/2,y:-p/2},{x:-h/2,y:p/2*1.1},{x:-h/2,y:-p/2}],x=m.polygon(v.map(T=>[T.x,T.y]),y),b=o.insert(()=>x,":first-child");return b.attr("class","basic label-container outer-path"),g&&e.look!=="handDrawn"&&b.selectAll("path").attr("style",g),n&&e.look!=="handDrawn"&&b.selectAll("path").attr("style",n),b.attr("transform",`translate(0,${-f/2})`),u.attr("transform",`translate(${-h/2+(e.padding??0)+h/2*.1/2-(l.x-(l.left??0))},${-d/2+(e.padding??0)-f/2-(l.y-(l.top??0))})`),Tr(e,b),e.intersect=function(T){return or.polygon(e,v,T)},o}w(ySe,"linedWaveEdgedRect");async function vSe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.padding??0,s=e.look==="neo"?16:i,a=e.look==="neo"?12:i,o=e.look==="neo"?10:5;(e.width||e.height)&&(e.width=Math.max(((e==null?void 0:e.width)??0)-s*2-2*o,10),e.height=Math.max(((e==null?void 0:e.height)??0)-a*2-2*o,10));const{shapeSvg:l,bbox:u,label:h}=await Qr(t,e,Wr(e)),d=(e!=null&&e.width?e==null?void 0:e.width:u.width)+s*2+2*o,f=(e!=null&&e.height?e==null?void 0:e.height:u.height)+a*2+2*o,p=d-2*o,g=f-2*o,m=-p/2,y=-g/2,{cssStyles:v}=e,x=dr.svg(l),b=fr(e,{}),T=[{x:m-o,y:y+o},{x:m-o,y:y+g+o},{x:m+p-o,y:y+g+o},{x:m+p-o,y:y+g},{x:m+p,y:y+g},{x:m+p,y:y+g-o},{x:m+p+o,y:y+g-o},{x:m+p+o,y:y-o},{x:m+o,y:y-o},{x:m+o,y},{x:m,y},{x:m,y:y+o}],C=[{x:m,y:y+o},{x:m+p-o,y:y+o},{x:m+p-o,y:y+g},{x:m+p,y:y+g},{x:m+p,y},{x:m,y}];e.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");const S=Fn(T);let k=x.path(S,b);const E=Fn(C);let A=x.path(E,b);e.look!=="handDrawn"&&(k=IG(k),A=IG(A));const R=l.insert("g",":first-child");return R.insert(()=>k),R.insert(()=>A),R.attr("class","basic label-container outer-path"),v&&e.look!=="handDrawn"&&R.selectAll("path").attr("style",v),n&&e.look!=="handDrawn"&&R.selectAll("path").attr("style",n),h.attr("transform",`translate(${-(u.width/2)-o-(u.x-(u.left??0))}, ${-(u.height/2)+o-(u.y-(u.top??0))})`),Tr(e,R),e.intersect=function(_){return or.polygon(e,T,_)},l}w(vSe,"multiRect");async function bSe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const{shapeSvg:i,bbox:s,label:a}=await Qr(t,e,Wr(e)),o=e.padding??0,l=e.look==="neo"?16:o,u=e.look==="neo"?12:o;let h=!0;(e.width||e.height)&&(h=!1,e.width=((e==null?void 0:e.width)??0)-l*2,e.height=((e==null?void 0:e.height)??0)-u*3);const d=Math.max(s.width,(e==null?void 0:e.width)??0)+l*2,f=Math.max(s.height,(e==null?void 0:e.height)??0)+u*3,p=e.look==="neo"?f/4:f/8,g=f+(h?p/2:-p/2),m=-d/2,y=-g/2,v=10,{cssStyles:x}=e,b=xg(m-v,y+g+v,m+d-v,y+g+v,p,.8),T=b==null?void 0:b[b.length-1],C=[{x:m-v,y:y+v},{x:m-v,y:y+g+v},...b,{x:m+d-v,y:T.y-v},{x:m+d,y:T.y-v},{x:m+d,y:T.y-2*v},{x:m+d+v,y:T.y-2*v},{x:m+d+v,y:y-v},{x:m+v,y:y-v},{x:m+v,y},{x:m,y},{x:m,y:y+v}],S=[{x:m,y:y+v},{x:m+d-v,y:y+v},{x:m+d-v,y:T.y-v},{x:m+d,y:T.y-v},{x:m+d,y},{x:m,y}],k=dr.svg(i),E=fr(e,{});e.look!=="handDrawn"&&(E.roughness=0,E.fillStyle="solid");const A=Fn(C),R=k.path(A,E),_=Fn(S),P=k.path(_,E),N=i.insert(()=>R,":first-child");return N.insert(()=>P),N.attr("class","basic label-container outer-path"),x&&e.look!=="handDrawn"&&N.selectAll("path").attr("style",x),n&&e.look!=="handDrawn"&&N.selectAll("path").attr("style",n),N.attr("transform",`translate(0,${-p/2})`),a.attr("transform",`translate(${-(s.width/2)-v-(s.x-(s.left??0))}, ${-(s.height/2)+v-p/2-(s.y-(s.top??0))})`),Tr(e,N),e.intersect=function(L){return or.polygon(e,C,L)},i}w(bSe,"multiWaveEdgedRectangle");async function xSe(t,e,{config:{themeVariables:r}}){const{labelStyles:n,nodeStyles:i}=cr(e);e.labelStyle=n,e.useHtmlLabels||di(br())||(e.centerLabel=!0);const{shapeSvg:a,bbox:o,label:l}=await Qr(t,e,Wr(e)),u=Math.max(o.width+(e.padding??0)*2,(e==null?void 0:e.width)??0),h=Math.max(o.height+(e.padding??0)*2,(e==null?void 0:e.height)??0),d=-u/2,f=-h/2,{cssStyles:p}=e,g=dr.svg(a),m=fr(e,{fill:r.noteBkgColor,stroke:r.noteBorderColor});e.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=g.rectangle(d,f,u,h,m),v=a.insert(()=>y,":first-child");return v.attr("class","basic label-container outer-path"),l.attr("class","label noteLabel"),p&&e.look!=="handDrawn"&&v.selectAll("path").attr("style",p),i&&e.look!=="handDrawn"&&v.selectAll("path").attr("style",i),l.attr("transform",`translate(${-o.width/2-(o.x-(o.left??0))}, ${-(o.height/2)-(o.y-(o.top??0))})`),Tr(e,v),e.intersect=function(x){return or.rect(e,x)},a}w(xSe,"note");var r3t=w((t,e,r)=>[`M${t+r/2},${e}`,`L${t+r},${e-r/2}`,`L${t+r/2},${e-r}`,`L${t},${e-r/2}`,"Z"].join(" "),"createDecisionBoxPathD");async function wSe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const{shapeSvg:i,bbox:s}=await Qr(t,e,Wr(e)),a=s.width+(e.padding??0),o=s.height+(e.padding??0),l=a+o,u=.5,h=[{x:l/2,y:0},{x:l,y:-l/2},{x:l/2,y:-l},{x:0,y:-l/2}];let d;const{cssStyles:f}=e;if(e.look==="handDrawn"){const p=dr.svg(i),g=fr(e,{}),m=r3t(0,0,l),y=p.path(m,g);d=i.insert(()=>y,":first-child").attr("transform",`translate(${-l/2+u}, ${l/2})`),f&&d.attr("style",f)}else d=G0(i,l,l,h),d.attr("transform",`translate(${-l/2+u}, ${l/2})`);return n&&d.attr("style",n),Tr(e,d),e.calcIntersect=function(p,g){const m=p.width,y=[{x:m/2,y:0},{x:m,y:-m/2},{x:m/2,y:-m},{x:0,y:-m/2}],v=or.polygon(p,y,g);return{x:v.x-.5,y:v.y-.5}},e.intersect=function(p){return this.calcIntersect(e,p)},i}w(wSe,"question");async function TSe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.padding??0,s=e.look==="neo"?21:i??0,a=e.look==="neo"?12:i??0,{shapeSvg:o,bbox:l,label:u}=await Qr(t,e,Wr(e)),h=((e==null?void 0:e.width)??l.width)+(e.look==="neo"?s*2:s),d=((e==null?void 0:e.height)??l.height)+(e.look==="neo"?a*2:a),f=-h/2,p=-d/2,g=p/2,m=[{x:f+g,y:p},{x:f,y:0},{x:f+g,y:-p},{x:-f,y:-p},{x:-f,y:p}],{cssStyles:y}=e,v=dr.svg(o),x=fr(e,{});e.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const b=Fn(m),T=v.path(b,x),C=o.insert(()=>T,":first-child");return C.attr("class","basic label-container outer-path"),y&&e.look!=="handDrawn"&&C.selectAll("path").attr("style",y),n&&e.look!=="handDrawn"&&C.selectAll("path").attr("style",n),C.attr("transform",`translate(${-g/2},0)`),u.attr("transform",`translate(${-g/2-l.width/2-(l.x-(l.left??0))}, ${-(l.height/2)-(l.y-(l.top??0))})`),Tr(e,C),e.intersect=function(S){return or.polygon(e,m,S)},o}w(TSe,"rect_left_inv_arrow");async function CSe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;let i;e.cssClasses?i="node "+e.cssClasses:i="node default";const s=t.insert("g").attr("class",i).attr("id",e.domId||e.id),a=s.insert("g"),o=s.insert("g").attr("class","label").attr("style",n),l=e.description,u=e.label,h=await Hp(o,u,e.labelStyle,!0,!0);let d={width:0,height:0};if(di(Ve())){const E=h.children[0],A=wt(h);d=E.getBoundingClientRect(),A.attr("width",d.width),A.attr("height",d.height)}de.info("Text 2",l);const f=l||[],p=h.getBBox(),g=await Hp(o,Array.isArray(f)?f.join("
"):f,e.labelStyle,!0,!0),m=g.children[0],y=wt(g);d=m.getBoundingClientRect(),y.attr("width",d.width),y.attr("height",d.height);const v=(e.padding||0)/2;wt(g).attr("transform","translate( "+(d.width>p.width?0:(p.width-d.width)/2)+", "+(p.height+v+5)+")"),wt(h).attr("transform","translate( "+(d.width(de.debug("Rough node insert CXC",R),_),":first-child"),S=s.insert(()=>(de.debug("Rough node insert CXC",R),R),":first-child")}else S=a.insert("rect",":first-child"),k=a.insert("line"),S.attr("class","outer title-state").attr("style",n).attr("x",-d.width/2-v).attr("y",-d.height/2-v).attr("width",d.width+(e.padding||0)).attr("height",d.height+(e.padding||0)),k.attr("class","divider").attr("x1",-d.width/2-v).attr("x2",d.width/2+v).attr("y1",-d.height/2-v+p.height+v).attr("y2",-d.height/2-v+p.height+v);return Tr(e,S),e.intersect=function(E){return or.rect(e,E)},s}w(CSe,"rectWithTitle");async function kSe(t,e,{config:{themeVariables:r}}){const n=(r==null?void 0:r.radius)??5,i={rx:n,ry:n,labelPaddingX:((e==null?void 0:e.padding)??0)*1,labelPaddingY:((e==null?void 0:e.padding)??0)*1};return u3(t,e,i)}w(kSe,"roundedRect");var Mm=8;async function SSe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.look==="neo"?16:e.padding??0,s=e.look==="neo"?12:e.padding??0,{shapeSvg:a,bbox:o,label:l}=await Qr(t,e,Wr(e)),u=((e==null?void 0:e.width)??o.width)+i*2+(e.look==="neo"?Mm:Mm*2),h=((e==null?void 0:e.height)??o.height)+s*2,d=u-Mm,f=h,p=Mm-u/2,g=-h/2,{cssStyles:m}=e,y=dr.svg(a),v=fr(e,{});e.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const x=[{x:p,y:g},{x:p+d,y:g},{x:p+d,y:g+f},{x:p-Mm,y:g+f},{x:p-Mm,y:g},{x:p,y:g},{x:p,y:g+f}],b=y.polygon(x.map(C=>[C.x,C.y]),v),T=a.insert(()=>b,":first-child");return T.attr("class","basic label-container outer-path").attr("style",Xa(m)),n&&e.look!=="handDrawn"&&T.selectAll("path").attr("style",n),m&&e.look!=="handDrawn"&&T.selectAll("path").attr("style",n),l.attr("transform",`translate(${Mm/2-o.width/2-(o.x-(o.left??0))}, ${-(o.height/2)-(o.y-(o.top??0))})`),Tr(e,T),e.intersect=function(C){return or.rect(e,C)},a}w(SSe,"shadedProcess");async function ESe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.padding??0,s=e.look==="neo"?16:i,a=e.look==="neo"?12:i;(e.width||e.height)&&(e.width=Math.max(((e==null?void 0:e.width)??0)-s*2,10),e.height=Math.max(((e==null?void 0:e.height)??0)/1.5-a*2,10));const{shapeSvg:o,bbox:l,label:u}=await Qr(t,e,Wr(e)),h=(e!=null&&e.width?e==null?void 0:e.width:l.width)+s*2,d=((e!=null&&e.height?e==null?void 0:e.height:l.height)+a*2)*1.5,f=h,p=d/1.5,g=-f/2,m=-p/2,{cssStyles:y}=e,v=dr.svg(o),x=fr(e,{});e.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const b=[{x:g,y:m},{x:g,y:m+p},{x:g+f,y:m+p},{x:g+f,y:m-p/2}],T=Fn(b),C=v.path(T,x),S=o.insert(()=>C,":first-child");return S.attr("class","basic label-container outer-path"),y&&e.look!=="handDrawn"&&S.selectChildren("path").attr("style",y),n&&e.look!=="handDrawn"&&S.selectChildren("path").attr("style",n),S.attr("transform",`translate(0, ${p/4})`),u.attr("transform",`translate(${-f/2+(e.padding??0)-(l.x-(l.left??0))}, ${-p/4+(e.padding??0)-(l.y-(l.top??0))})`),Tr(e,S),e.intersect=function(k){return or.polygon(e,b,k)},o}w(ESe,"slopedRect");async function ASe(t,e){const r=e.padding??0,n=e.look==="neo"?16:r*2,i=e.look==="neo"?12:r,s={rx:0,ry:0,labelPaddingX:e.labelPaddingX??n,labelPaddingY:i};return u3(t,e,s)}w(ASe,"squareRect");async function MSe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.padding??0,s=e.look==="neo"?20:i,a=e.look==="neo"?12:i,{shapeSvg:o,bbox:l}=await Qr(t,e,Wr(e)),u=l.height+(e.look==="neo"?a*2:a),h=l.width+u/4+(e.look==="neo"?s*2:s),d=u/2,{cssStyles:f}=e,p=dr.svg(o),g=fr(e,{});e.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");const m=[{x:-h/2+d,y:-u/2},{x:h/2-d,y:-u/2},...S6(-h/2+d,0,d,50,90,270),{x:h/2-d,y:u/2},...S6(h/2-d,0,d,50,270,450)],y=Fn(m),v=p.path(y,g),x=o.insert(()=>v,":first-child");return x.attr("class","basic label-container outer-path"),f&&e.look!=="handDrawn"&&x.selectChildren("path").attr("style",f),n&&e.look!=="handDrawn"&&x.selectChildren("path").attr("style",n),Tr(e,x),e.intersect=function(b){return or.polygon(e,m,b)},o}w(MSe,"stadium");async function RSe(t,e){const r={rx:e.look==="neo"?3:5,ry:e.look==="neo"?3:5};return u3(t,e,r)}w(RSe,"state");function _Se(t,e,{config:{themeVariables:r}}){var x,b;const{labelStyles:n,nodeStyles:i}=cr(e);e.labelStyle=n;const{cssStyles:s}=e,{lineColor:a,stateBorder:o,nodeBorder:l,nodeShadow:u}=r;(e.width||e.height)&&((e.width??0)<14&&(e.width=14),(e.height??0)<14&&(e.height=14)),e.width||(e.width=14),e.height||(e.height=14);const h=t.insert("g").attr("class","node default").attr("id",e.domId??e.id),d=dr.svg(h),f=fr(e,{});e.look!=="handDrawn"&&(f.roughness=0,f.fillStyle="solid");const p=d.circle(0,0,e.width,{...f,stroke:a,strokeWidth:2}),g=o??l,m=(e.width??0)*5/14,y=d.circle(0,0,m,{...f,fill:g,stroke:g,strokeWidth:2,fillStyle:"solid"}),v=h.insert(()=>p,":first-child");if(v.insert(()=>y),e.look!=="handDrawn"&&v.attr("class","outer-path"),s&&v.selectAll("path").attr("style",s),i&&v.selectAll("path").attr("style",i),e.width<25&&u&&e.look!=="handDrawn"){const T=((b=(x=t.node())==null?void 0:x.ownerSVGElement)==null?void 0:b.id)??"",C=T?`${T}-drop-shadow-small`:"drop-shadow-small";v.attr("style",`filter:url(#${C})`)}return Tr(e,v),e.intersect=function(T){return or.circle(e,(e.width??0)/2,T)},h}w(_Se,"stateEnd");function LSe(t,e,{config:{themeVariables:r}}){var o,l;const{lineColor:n,nodeShadow:i}=r;(e.width||e.height)&&((e.width??0)<14&&(e.width=14),(e.height??0)<14&&(e.height=14)),e.width||(e.width=14),e.height||(e.height=14);const s=t.insert("g").attr("class","node default").attr("id",e.domId||e.id);let a;if(e.look==="handDrawn"){const h=dr.svg(s).circle(0,0,e.width,Owt(n));a=s.insert(()=>h),a.attr("class","state-start").attr("r",(e.width??7)/2).attr("width",e.width??14).attr("height",e.height??14)}else a=s.insert("circle",":first-child"),a.attr("class","state-start").attr("r",(e.width??7)/2).attr("width",e.width??14).attr("height",e.height??14);if(e.width<25&&i&&e.look!=="handDrawn"){const u=((l=(o=t.node())==null?void 0:o.ownerSVGElement)==null?void 0:l.id)??"",h=u?`${u}-drop-shadow-small`:"drop-shadow-small";a.attr("style",`filter:url(#${h})`)}return Tr(e,a),e.intersect=function(u){return or.circle(e,(e.width??7)/2,u)},s}w(LSe,"stateStart");var Hv=8;async function ISe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=(e==null?void 0:e.padding)??8,s=e.look==="neo"?28:i,a=e.look==="neo"?12:i,{shapeSvg:o,bbox:l}=await Qr(t,e,Wr(e)),u=((e==null?void 0:e.width)??l.width)+2*Hv+s,h=((e==null?void 0:e.height)??l.height)+a,d=u-2*Hv,f=h,p=-u/2,g=-h/2,m=[{x:0,y:0},{x:d,y:0},{x:d,y:-f},{x:0,y:-f},{x:0,y:0},{x:-8,y:0},{x:d+8,y:0},{x:d+8,y:-f},{x:-8,y:-f},{x:-8,y:0}];if(e.look==="handDrawn"){const y=dr.svg(o),v=fr(e,{}),x=y.rectangle(p,g,d+16,f,v),b=y.line(p+Hv,g,p+Hv,g+f,v),T=y.line(p+Hv+d,g,p+Hv+d,g+f,v);o.insert(()=>b,":first-child"),o.insert(()=>T,":first-child");const C=o.insert(()=>x,":first-child"),{cssStyles:S}=e;C.attr("class","basic label-container").attr("style",Xa(S)),Tr(e,C)}else{const y=G0(o,d,f,m);n&&y.attr("style",n),Tr(e,y)}return e.intersect=function(y){return or.polygon(e,m,y)},o}w(ISe,"subroutine");var oB=.2;async function NSe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.padding??0,s=e.look==="neo"?16:i,a=e.look==="neo"?12:i;(e.width||e.height)&&(e.height=Math.max(((e==null?void 0:e.height)??0)-a*2,10),e.width=Math.max(((e==null?void 0:e.width)??0)-s*2-oB*(e.height+a*2),10));const{shapeSvg:o,bbox:l}=await Qr(t,e,Wr(e)),u=(e!=null&&e.height?e==null?void 0:e.height:l.height)+a*2,h=oB*u,d=oB*u,p=(e!=null&&e.width?e==null?void 0:e.width:l.width)+s*2+h-h,g=u,m=-p/2,y=-g/2,{cssStyles:v}=e,x=dr.svg(o),b=fr(e,{}),T=[{x:m-h/2,y},{x:m+p+h/2,y},{x:m+p+h/2,y:y+g},{x:m-h/2,y:y+g}],C=[{x:m+p-h/2,y:y+g},{x:m+p+h/2,y:y+g},{x:m+p+h/2,y:y+g-d}];e.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");const S=Fn(T),k=x.path(S,b),E=Fn(C),A=x.path(E,{...b,fillStyle:"solid"}),R=o.insert(()=>A,":first-child");return R.insert(()=>k,":first-child"),R.attr("class","basic label-container outer-path"),v&&e.look!=="handDrawn"&&R.selectAll("path").attr("style",v),n&&e.look!=="handDrawn"&&R.selectAll("path").attr("style",n),Tr(e,R),e.intersect=function(_){return or.polygon(e,T,_)},o}w(NSe,"taggedRect");async function DSe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const{shapeSvg:i,bbox:s,label:a}=await Qr(t,e,Wr(e)),o=Math.max(s.width+(e.padding??0)*2,(e==null?void 0:e.width)??0),l=Math.max(s.height+(e.padding??0)*2,(e==null?void 0:e.height)??0),u=l/8,h=.2*o,d=.2*l,f=l+u,{cssStyles:p}=e,g=dr.svg(i),m=fr(e,{});e.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=[{x:-o/2-o/2*.1,y:f/2},...xg(-o/2-o/2*.1,f/2,o/2+o/2*.1,f/2,u,.8),{x:o/2+o/2*.1,y:-f/2},{x:-o/2-o/2*.1,y:-f/2}],v=-o/2+o/2*.1,x=-f/2-d*.4,b=[{x:v+o-h,y:(x+l)*1.3},{x:v+o,y:x+l-d},{x:v+o,y:(x+l)*.9},...xg(v+o,(x+l)*1.25,v+o-h,(x+l)*1.3,-l*.02,.5)],T=Fn(y),C=g.path(T,m),S=Fn(b),k=g.path(S,{...m,fillStyle:"solid"}),E=i.insert(()=>k,":first-child");return E.insert(()=>C,":first-child"),E.attr("class","basic label-container outer-path"),p&&e.look!=="handDrawn"&&E.selectAll("path").attr("style",p),n&&e.look!=="handDrawn"&&E.selectAll("path").attr("style",n),E.attr("transform",`translate(0,${-u/2})`),a.attr("transform",`translate(${-o/2+(e.padding??0)-(s.x-(s.left??0))},${-l/2+(e.padding??0)-u/2-(s.y-(s.top??0))})`),Tr(e,E),e.intersect=function(A){return or.polygon(e,y,A)},i}w(DSe,"taggedWaveEdgedRectangle");async function OSe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const{shapeSvg:i,bbox:s}=await Qr(t,e,Wr(e)),a=Math.max(s.width+(e.padding??0),(e==null?void 0:e.width)||0),o=Math.max(s.height+(e.padding??0),(e==null?void 0:e.height)||0),l=-a/2,u=-o/2,h=i.insert("rect",":first-child");return h.attr("class","text").attr("style",n).attr("rx",0).attr("ry",0).attr("x",l).attr("y",u).attr("width",a).attr("height",o),Tr(e,h),e.intersect=function(d){return or.rect(e,d)},i}w(OSe,"text");var n3t=w((t,e,r,n,i,s)=>`M${t},${e}
+`);return hke(n)}w(dke,"preprocessMarkdown");function fke(t){return t.split(/\\n|\n|