(i=s.call({lexer:this},t,r))?(t=t.substring(i.raw.length),r.push(i),!0):!1))continue;if(i=this.tokenizer.space(t)){t=t.substring(i.raw.length);let s=r.at(-1);i.raw.length===1&&s!==void 0?s.raw+=`
+`:r.push(i);continue}if(i=this.tokenizer.code(t)){t=t.substring(i.raw.length);let s=r.at(-1);s?.type==="paragraph"||s?.type==="text"?(s.raw+=(s.raw.endsWith(`
+`)?"":`
+`)+i.raw,s.text+=`
+`+i.text,this.inlineQueue.at(-1).src=s.text):r.push(i);continue}if(i=this.tokenizer.fences(t)){t=t.substring(i.raw.length),r.push(i);continue}if(i=this.tokenizer.heading(t)){t=t.substring(i.raw.length),r.push(i);continue}if(i=this.tokenizer.hr(t)){t=t.substring(i.raw.length),r.push(i);continue}if(i=this.tokenizer.blockquote(t)){t=t.substring(i.raw.length),r.push(i);continue}if(i=this.tokenizer.list(t)){t=t.substring(i.raw.length),r.push(i);continue}if(i=this.tokenizer.html(t)){t=t.substring(i.raw.length),r.push(i);continue}if(i=this.tokenizer.def(t)){t=t.substring(i.raw.length);let s=r.at(-1);s?.type==="paragraph"||s?.type==="text"?(s.raw+=(s.raw.endsWith(`
+`)?"":`
+`)+i.raw,s.text+=`
+`+i.raw,this.inlineQueue.at(-1).src=s.text):this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title},r.push(i));continue}if(i=this.tokenizer.table(t)){t=t.substring(i.raw.length),r.push(i);continue}if(i=this.tokenizer.lheading(t)){t=t.substring(i.raw.length),r.push(i);continue}let a=t;if(this.options.extensions?.startBlock){let s=1/0,l=t.slice(1),u;this.options.extensions.startBlock.forEach(h=>{u=h.call({lexer:this},l),typeof u=="number"&&u>=0&&(s=Math.min(s,u))}),s<1/0&&s>=0&&(a=t.substring(0,s+1))}if(this.state.top&&(i=this.tokenizer.paragraph(a))){let s=r.at(-1);n&&s?.type==="paragraph"?(s.raw+=(s.raw.endsWith(`
+`)?"":`
+`)+i.raw,s.text+=`
+`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=s.text):r.push(i),n=a.length!==t.length,t=t.substring(i.raw.length);continue}if(i=this.tokenizer.text(t)){t=t.substring(i.raw.length);let s=r.at(-1);s?.type==="text"?(s.raw+=(s.raw.endsWith(`
+`)?"":`
+`)+i.raw,s.text+=`
+`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=s.text):r.push(i);continue}if(t){let s="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(s);break}else throw new Error(s)}}return this.state.top=!0,r}inline(t,r=[]){return this.inlineQueue.push({src:t,tokens:r}),r}inlineTokens(t,r=[]){let n=t,i=null;if(this.tokens.links){let l=Object.keys(this.tokens.links);if(l.length>0)for(;(i=this.tokenizer.rules.inline.reflinkSearch.exec(n))!=null;)l.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(n=n.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(i=this.tokenizer.rules.inline.anyPunctuation.exec(n))!=null;)n=n.slice(0,i.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(i=this.tokenizer.rules.inline.blockSkip.exec(n))!=null;)n=n.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let a=!1,s="";for(;t;){a||(s=""),a=!1;let l;if(this.options.extensions?.inline?.some(h=>(l=h.call({lexer:this},t,r))?(t=t.substring(l.raw.length),r.push(l),!0):!1))continue;if(l=this.tokenizer.escape(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.tag(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.link(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(l.raw.length);let h=r.at(-1);l.type==="text"&&h?.type==="text"?(h.raw+=l.raw,h.text+=l.text):r.push(l);continue}if(l=this.tokenizer.emStrong(t,n,s)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.codespan(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.br(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.del(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.autolink(t)){t=t.substring(l.raw.length),r.push(l);continue}if(!this.state.inLink&&(l=this.tokenizer.url(t))){t=t.substring(l.raw.length),r.push(l);continue}let u=t;if(this.options.extensions?.startInline){let h=1/0,d=t.slice(1),f;this.options.extensions.startInline.forEach(p=>{f=p.call({lexer:this},d),typeof f=="number"&&f>=0&&(h=Math.min(h,f))}),h<1/0&&h>=0&&(u=t.substring(0,h+1))}if(l=this.tokenizer.inlineText(u)){t=t.substring(l.raw.length),l.raw.slice(-1)!=="_"&&(s=l.raw.slice(-1)),a=!0;let h=r.at(-1);h?.type==="text"?(h.raw+=l.raw,h.text+=l.text):r.push(l);continue}if(t){let h="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(h);break}else throw new Error(h)}}return r}},w4=class{static{o(this,"P")}options;parser;constructor(e){this.options=e||Tm}space(e){return""}code({text:e,lang:t,escaped:r}){let n=(t||"").match(_s.notSpaceStart)?.[0],i=e.replace(_s.endingNewline,"")+`
+`;return n?''+(r?i:ru(i,!0))+`
+`:""+(r?i:ru(i,!0))+`
+`}blockquote({tokens:e}){return`
+${this.parser.parse(e)}
+`}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:t}){return`${this.parser.parseInline(e)}
+`}hr(e){return`
+`}list(e){let t=e.ordered,r=e.start,n="";for(let s=0;s
+`+n+""+i+`>
+`}listitem(e){let t="";if(e.task){let r=this.checkbox({checked:!!e.checked});e.loose?e.tokens[0]?.type==="paragraph"?(e.tokens[0].text=r+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type==="text"&&(e.tokens[0].tokens[0].text=r+" "+ru(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:r+" ",text:r+" ",escaped:!0}):t+=r+" "}return t+=this.parser.parse(e.tokens,!!e.loose),`${t}
+`}checkbox({checked:e}){return" '}paragraph({tokens:e}){return`${this.parser.parseInline(e)}
+`}table(e){let t="",r="";for(let i=0;i${n}`),`
+`}tablerow({text:e}){return`
+${e}
+`}tablecell(e){let t=this.parser.parseInline(e.tokens),r=e.header?"th":"td";return(e.align?`<${r} align="${e.align}">`:`<${r}>`)+t+`${r}>
+`}strong({tokens:e}){return`${this.parser.parseInline(e)} `}em({tokens:e}){return`${this.parser.parseInline(e)} `}codespan({text:e}){return`${ru(e,!0)}`}br(e){return" "}del({tokens:e}){return`${this.parser.parseInline(e)}`}link({href:e,title:t,tokens:r}){let n=this.parser.parseInline(r),i=lse(e);if(i===null)return n;e=i;let a='"+n+" ",a}image({href:e,title:t,text:r,tokens:n}){n&&(r=this.parser.parseInline(n,this.parser.textRenderer));let i=lse(e);if(i===null)return ru(r);e=i;let a=` ",a}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:ru(e.text)}},GP=class{static{o(this,"$")}strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}},Th=class IP{static{o(this,"l")}options;renderer;textRenderer;constructor(t){this.options=t||Tm,this.options.renderer=this.options.renderer||new w4,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new GP}static parse(t,r){return new IP(r).parse(t)}static parseInline(t,r){return new IP(r).parseInline(t)}parse(t,r=!0){let n="";for(let i=0;i{let s=i[a].flat(1/0);r=r.concat(this.walkTokens(s,t))}):i.tokens&&(r=r.concat(this.walkTokens(i.tokens,t)))}}return r}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(r=>{let n={...r};if(n.async=this.defaults.async||n.async||!1,r.extensions&&(r.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){let a=t.renderers[i.name];a?t.renderers[i.name]=function(...s){let l=i.renderer.apply(this,s);return l===!1&&(l=a.apply(this,s)),l}:t.renderers[i.name]=i.renderer}if("tokenizer"in i){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let a=t[i.level];a?a.unshift(i.tokenizer):t[i.level]=[i.tokenizer],i.start&&(i.level==="block"?t.startBlock?t.startBlock.push(i.start):t.startBlock=[i.start]:i.level==="inline"&&(t.startInline?t.startInline.push(i.start):t.startInline=[i.start]))}"childTokens"in i&&i.childTokens&&(t.childTokens[i.name]=i.childTokens)}),n.extensions=t),r.renderer){let i=this.defaults.renderer||new w4(this.defaults);for(let a in r.renderer){if(!(a in i))throw new Error(`renderer '${a}' does not exist`);if(["options","parser"].includes(a))continue;let s=a,l=r.renderer[s],u=i[s];i[s]=(...h)=>{let d=l.apply(i,h);return d===!1&&(d=u.apply(i,h)),d||""}}n.renderer=i}if(r.tokenizer){let i=this.defaults.tokenizer||new C4(this.defaults);for(let a in r.tokenizer){if(!(a in i))throw new Error(`tokenizer '${a}' does not exist`);if(["options","rules","lexer"].includes(a))continue;let s=a,l=r.tokenizer[s],u=i[s];i[s]=(...h)=>{let d=l.apply(i,h);return d===!1&&(d=u.apply(i,h)),d}}n.tokenizer=i}if(r.hooks){let i=this.defaults.hooks||new L2;for(let a in r.hooks){if(!(a in i))throw new Error(`hook '${a}' does not exist`);if(["options","block"].includes(a))continue;let s=a,l=r.hooks[s],u=i[s];L2.passThroughHooks.has(a)?i[s]=h=>{if(this.defaults.async&&L2.passThroughHooksRespectAsync.has(a))return Promise.resolve(l.call(i,h)).then(f=>u.call(i,f));let d=l.call(i,h);return u.call(i,d)}:i[s]=(...h)=>{let d=l.apply(i,h);return d===!1&&(d=u.apply(i,h)),d}}n.hooks=i}if(r.walkTokens){let i=this.defaults.walkTokens,a=r.walkTokens;n.walkTokens=function(s){let l=[];return l.push(a.call(this,s)),i&&(l=l.concat(i.call(this,s))),l}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return bh.lex(e,t??this.defaults)}parser(e,t){return Th.parse(e,t??this.defaults)}parseMarkdown(e){return(t,r)=>{let n={...r},i={...this.defaults,...n},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&n.async===!1)return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof t>"u"||t===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof t!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));i.hooks&&(i.hooks.options=i,i.hooks.block=e);let s=i.hooks?i.hooks.provideLexer():e?bh.lex:bh.lexInline,l=i.hooks?i.hooks.provideParser():e?Th.parse:Th.parseInline;if(i.async)return Promise.resolve(i.hooks?i.hooks.preprocess(t):t).then(u=>s(u,i)).then(u=>i.hooks?i.hooks.processAllTokens(u):u).then(u=>i.walkTokens?Promise.all(this.walkTokens(u,i.walkTokens)).then(()=>u):u).then(u=>l(u,i)).then(u=>i.hooks?i.hooks.postprocess(u):u).catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let u=s(t,i);i.hooks&&(u=i.hooks.processAllTokens(u)),i.walkTokens&&this.walkTokens(u,i.walkTokens);let h=l(u,i);return i.hooks&&(h=i.hooks.postprocess(h)),h}catch(u){return a(u)}}}onError(e,t){return r=>{if(r.message+=`
+Please report this to https://github.com/markedjs/marked.`,e){let n="An error occurred:
"+ru(r.message+"",!0)+" ";return t?Promise.resolve(n):n}if(t)return Promise.reject(r);throw r}}},bm=new VZe;o(Sn,"d");Sn.options=Sn.setOptions=function(e){return bm.setOptions(e),Sn.defaults=bm.defaults,hse(Sn.defaults),Sn};Sn.getDefaults=MP;Sn.defaults=Tm;Sn.use=function(...e){return bm.use(...e),Sn.defaults=bm.defaults,hse(Sn.defaults),Sn};Sn.walkTokens=function(e,t){return bm.walkTokens(e,t)};Sn.parseInline=bm.parseInline;Sn.Parser=Th;Sn.parser=Th.parse;Sn.Renderer=w4;Sn.TextRenderer=GP;Sn.Lexer=bh;Sn.lexer=bh.lex;Sn.Tokenizer=C4;Sn.Hooks=L2;Sn.parse=Sn;yir=Sn.options,vir=Sn.setOptions,xir=Sn.use,bir=Sn.walkTokens,Tir=Sn.parseInline,Cir=Th.parse,wir=bh.lex});function WZe(e,{markdownAutoWrap:t}){let n=e.replace(/ /g,`
+`).replace(/\n{2,}/g,`
+`);return mS(n)}function wse(e){return e.split(/\\n|\n| /gi).map(t=>t.trim().match(/<[^>]+>|[^\s<>]+/g)?.map(r=>({content:r,type:"normal"}))??[])}function kse(e,t={}){let r=WZe(e,t),n=Sn.lexer(r),i=[[]],a=0;function s(l,u="normal"){l.type==="text"?l.text.split(`
+`).forEach((d,f)=>{f!==0&&(a++,i.push([])),d.split(" ").forEach(p=>{p=p.replace(/'/g,"'"),p&&i[a].push({content:p,type:u})})}):l.type==="strong"||l.type==="em"?l.tokens.forEach(h=>{s(h,l.type)}):l.type==="html"&&i[a].push({content:l.text,type:"normal"})}return o(s,"processNode"),n.forEach(l=>{l.type==="paragraph"?l.tokens?.forEach(u=>{s(u)}):l.type==="html"?i[a].push({content:l.text,type:"normal"}):i[a].push({content:l.raw,type:"normal"})}),i}function Sse(e){return e?`${e.replace(/\\n|\n/g," ")}
`:""}function Ese(e,{markdownAutoWrap:t}={}){let r=Sn.lexer(e);function n(i){return i.type==="text"?t===!1?i.text.replace(/\n */g," ").replace(/ /g," "):i.text.replace(/\n */g," "):i.type==="strong"?`${i.tokens?.map(n).join("")} `:i.type==="em"?`${i.tokens?.map(n).join("")} `:i.type==="paragraph"?`${i.tokens?.map(n).join("")}
`:i.type==="space"?"":i.type==="html"?`${i.text}`:i.type==="escape"?i.text:(Z.warn(`Unsupported markdown: ${i.type}`),i.raw)}return o(n,"output"),r.map(n).join("")}var Ase=F(()=>{"use strict";Cse();h8();vt();o(WZe,"preprocessMarkdown");o(wse,"nonMarkdownToLines");o(kse,"markdownToLines");o(Sse,"nonMarkdownToHTML");o(Ese,"markdownToHTML")});function qZe(e){return Intl.Segmenter?[...new Intl.Segmenter().segment(e)].map(t=>t.segment):[...e]}function HZe(e,t){let r=qZe(t.content);return Rse(e,[],r,t.type)}function Rse(e,t,r,n){if(r.length===0)return[{content:t.join(""),type:n},{content:"",type:n}];let[i,...a]=r,s=[...t,i];return e([{content:s.join(""),type:n}])?Rse(e,s,a,n):(t.length===0&&i&&(t.push(i),r.shift()),[{content:t.join(""),type:n},{content:r.join(""),type:n}])}function _se(e,t){if(e.some(({content:r})=>r.includes(`
+`)))throw new Error("splitLineToFitWidth does not support newlines in the line");return VP(e,t)}function VP(e,t,r=[],n=[]){if(e.length===0)return n.length>0&&r.push(n),r.length>0?r:[];let i="";e[0].content===" "&&(i=" ",e.shift());let a=e.shift()??{content:" ",type:"normal"},s=[...n];if(i!==""&&s.push({content:i,type:"normal"}),s.push(a),t(s))return VP(e,t,r,s);if(n.length>0)r.push(n),e.unshift(a);else if(a.content){let[l,u]=HZe(t,a);r.push([l]),u.content&&e.unshift(u)}return VP(e,t,r)}var Lse=F(()=>{"use strict";o(qZe,"splitTextToChars");o(HZe,"splitWordToFitWidth");o(Rse,"splitWordToFitWidthRecursion");o(_se,"splitLineToFitWidth");o(VP,"splitLineToFitWidthRecursion")});function Dse(e,t){t&&e.attr("style",t)}async function UZe(e,t,r,n,i=!1,a=_t()){let s=e.append("foreignObject");s.attr("width",`${Math.min(10*r,Ise)}px`),s.attr("height",`${Math.min(10*r,Ise)}px`);let l=s.append("xhtml:div"),u=ni(t.label)?await ey(t.label.replace(xt.lineBreakRegex,`
+`),a):mr(t.label,a),h=t.isNode?"nodeLabel":"edgeLabel",d=l.append("span");d.html(u),Dse(d,t.labelStyle),d.attr("class",`${h} ${n}`),Dse(l,t.labelStyle),l.style("display","table-cell"),l.style("white-space","nowrap"),l.style("line-height","1.5"),r!==Number.POSITIVE_INFINITY&&(l.style("max-width",r+"px"),l.style("text-align","center")),l.attr("xmlns","http://www.w3.org/1999/xhtml"),i&&l.attr("class","labelBkg");let f=l.node().getBoundingClientRect();return f.width===r&&(l.style("display","table"),l.style("white-space","break-spaces"),l.style("width",r+"px"),f=l.node().getBoundingClientRect()),s.node()}function WP(e,t,r,n=!1){let i=e.append("tspan").attr("class","text-outer-tspan").attr("x",0).attr("y",t*r-.1+"em").attr("dy",r+"em");return n&&i.attr("text-anchor","middle"),i}function YZe(e,t,r){let n=e.append("text"),i=WP(n,1,t);qP(i,r);let a=i.node().getComputedTextLength();return n.remove(),a}function Nse(e,t,r){let n=e.append("text"),i=WP(n,1,t);qP(i,[{content:r,type:"normal"}]);let a=i.node()?.getBoundingClientRect();return a&&n.remove(),a}function jZe(e,t,r,n=!1,i=!1){let s=t.append("g"),l=s.insert("rect").attr("class","background").attr("style","stroke: none"),u=s.append("text").attr("y","-10.1");i&&u.attr("text-anchor","middle");let h=0;for(let d of r){let f=o(m=>YZe(s,1.1,m)<=e,"checkWidth"),p=f(d)?[d]:_se(d,f);for(let m of p){let g=WP(u,h,1.1,i);qP(g,m),h++}}if(n){let d=u.node().getBBox(),f=2;return l.attr("x",d.x-f).attr("y",d.y-f).attr("width",d.width+2*f).attr("height",d.height+2*f),s.node()}else return u.node()}function Mse(e){let t=/&(amp|lt|gt);/g;return e.replace(t,(r,n)=>{switch(n){case"amp":return"&";case"lt":return"<";case"gt":return">";default:return r}})}function qP(e,t){e.text(""),t.forEach((r,n)=>{let i=e.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(Mse(r.content)):i.text(" "+Mse(r.content))})}async function XZe(e,t={}){let r=[];e.replace(/(fa[bklrs]?):fa-([\w-]+)/g,(i,a,s)=>(r.push((async()=>{let l=`${a}:${s}`;return await iJ(l)?await ts(l,void 0,{class:"label-icon"}):` `})()),i));let n=await Promise.all(r);return e.replace(/(fa[bklrs]?):fa-([\w-]+)/g,()=>n.shift()??"")}var Ise,Pn,Ls=F(()=>{"use strict";$r();Vr();vt();Ase();Qt();Vl();Lse();ur();o(Dse,"applyStyle");Ise=16384;o(UZe,"addHtmlSpan");o(WP,"createTspan");o(YZe,"computeWidthOfText");o(Nse,"computeDimensionOfText");o(jZe,"createFormattedText");o(Mse,"decodeHTMLEntities");o(qP,"updateTextContentAndStyles");o(XZe,"replaceIconSubstring");Pn=o(async(e,t="",{style:r="",isTitle:n=!1,classes:i="",useHtmlLabels:a=!0,markdown:s=!0,isNode:l=!0,width:u=200,addSvgBackground:h=!1}={},d)=>{if(Z.debug("XYZ createText",t,r,n,i,a,l,"addSvgBackground: ",h),a){let f=s?Ese(t,d):Sse(t),p=await XZe(Rs(f),d),m=t.replace(/\\\\/g,"\\"),g={isNode:l,label:ni(t)?m:p,labelStyle:r.replace("fill:","color:")};return await UZe(e,g,u,i,h,d)}else{let f=Rs(t.replace(/ /g," ")),p=s?kse(f.replace(" "," "),d):wse(f),m=jZe(u,e,p,t?h:!1,!l);if(l){/stroke:/.exec(r)&&(r=r.replace("stroke:","lineColor:"));let g=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");et(m).attr("style",g)}else{let g=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/background:/g,"fill:");et(m).select("rect").attr("style",g.replace(/background:/g,"fill:"));let y=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");et(m).select("text").attr("style",y)}return n?et(m).selectAll("tspan.text-outer-tspan").classed("title-row",!0):et(m).selectAll("tspan.text-outer-tspan").classed("row",!0),m}},"createText")});async function E4(e,t){let r=e.getElementsByTagName("img");if(!r||r.length===0)return;let n=t.replace(/ ]*>/g,"").trim()==="";await Promise.all([...r].map(i=>new Promise(a=>{function s(){if(i.style.display="flex",i.style.flexDirection="column",n){let l=Ae().fontSize?Ae().fontSize:window.getComputedStyle(document.body).fontSize,u=5,[h=cr.fontSize]=As(l),d=h*u+"px";i.style.minWidth=d,i.style.maxWidth=d}else i.style.width="100%";a(i)}o(s,"setupImage"),setTimeout(()=>{i.complete&&s()}),i.addEventListener("error",s),i.addEventListener("load",s)})))}var HP=F(()=>{"use strict";Xt();Wi();Qt();o(E4,"configureLabelImages")});function or(e){let t=e.map((r,n)=>`${n===0?"M":"L"}${r.x},${r.y}`);return t.push("Z"),t.join(" ")}function fl(e,t,r,n,i,a){let s=[],u=r-e,h=n-t,d=u/a,f=2*Math.PI/d,p=t+h/2;for(let m=0;m<=50;m++){let g=m/50,y=e+g*u,v=p+i*Math.sin(f*(y-e));s.push({x:y,y:v})}return s}function Cm(e,t,r,n,i,a){let s=[],l=i*Math.PI/180,d=(a*Math.PI/180-l)/(n-1);for(let f=0;fu.tagName==="path"),r=document.createElementNS("http://www.w3.org/2000/svg","path"),n=t.map(u=>u.getAttribute("d")).filter(u=>u!==null).join(" ");r.setAttribute("d",n);let i=t.find(u=>u.getAttribute("fill")!=="none"),a=t.find(u=>u.getAttribute("stroke")!=="none"),s=o((u,h)=>u?.getAttribute(h)??void 0,"getAttr");if(i){let u={fill:s(i,"fill"),"fill-opacity":s(i,"fill-opacity")??"1"};Object.entries(u).forEach(([h,d])=>{d&&r.setAttribute(h,d)})}if(a){let u={stroke:s(a,"stroke"),"stroke-width":s(a,"stroke-width")??"1","stroke-opacity":s(a,"stroke-opacity")??"1"};Object.entries(u).forEach(([h,d])=>{d&&r.setAttribute(h,d)})}let l=document.createElementNS("http://www.w3.org/2000/svg","g");return l.appendChild(r),l}var It,A4,pt,Dt,Kt=F(()=>{"use strict";Ls();Xt();ur();$r();Vr();Qt();HP();It=o(async(e,t,r)=>{let n,i=t.useHtmlLabels||ya(Ae()?.htmlLabels);r?n=r:n="node default";let a=e.insert("g").attr("class",n).attr("id",t.domId||t.id),s=a.insert("g").attr("class","label").attr("style",kn(t.labelStyle)),l;t.label===void 0?l="":l=typeof t.label=="string"?t.label:t.label[0];let u=!!t.icon||!!t.img,h=t.labelType==="markdown",d=await Pn(s,mr(Rs(l),Ae()),{useHtmlLabels:i,width:t.width||Ae().flowchart?.wrappingWidth,classes:h?"markdown-node-label":"",style:t.labelStyle,addSvgBackground:u,markdown:h},Ae()),f=d.getBBox(),p=(t?.padding??0)/2;if(i){let m=d.children[0],g=et(d);await E4(m,l),f=m.getBoundingClientRect(),g.attr("width",f.width),g.attr("height",f.height)}return i?s.attr("transform","translate("+-f.width/2+", "+-f.height/2+")"):s.attr("transform","translate(0, "+-f.height/2+")"),t.centerLabel&&s.attr("transform","translate("+-f.width/2+", "+-f.height/2+")"),s.insert("rect",":first-child"),{shapeSvg:a,bbox:f,halfPadding:p,label:s}},"labelHelper"),A4=o(async(e,t,r)=>{let n=r.useHtmlLabels??Gr(Ae()),i=e.insert("g").attr("class","label").attr("style",r.labelStyle||""),a=await Pn(i,mr(Rs(t),Ae()),{useHtmlLabels:n,width:r.width||Ae()?.flowchart?.wrappingWidth,style:r.labelStyle,addSvgBackground:!!r.icon||!!r.img}),s=a.getBBox(),l=r.padding/2;if(Gr(Ae())){let u=a.children[0],h=et(a);s=u.getBoundingClientRect(),h.attr("width",s.width),h.attr("height",s.height)}return n?i.attr("transform","translate("+-s.width/2+", "+-s.height/2+")"):i.attr("transform","translate(0, "+-s.height/2+")"),r.centerLabel&&i.attr("transform","translate("+-s.width/2+", "+-s.height/2+")"),i.insert("rect",":first-child"),{shapeSvg:e,bbox:s,halfPadding:l,label:i}},"insertLabel"),pt=o((e,t)=>{let r=t.node().getBBox();e.width=r.width,e.height=r.height},"updateNodeBounds"),Dt=o((e,t)=>(e.look==="handDrawn"?"rough-node":"node")+" "+e.cssClasses+" "+(t||""),"getNodeClasses");o(or,"createPathFromPoints");o(fl,"generateFullSineWavePoints");o(Cm,"generateCirclePoints");o(UP,"mergePaths")});function KZe(e,t){return e.intersect(t)}var Pse,Ose=F(()=>{"use strict";o(KZe,"intersectNode");Pse=KZe});function ZZe(e,t,r,n){var i=e.x,a=e.y,s=i-n.x,l=a-n.y,u=Math.sqrt(t*t*l*l+r*r*s*s),h=Math.abs(t*r*s/u);n.x{"use strict";o(ZZe,"intersectEllipse");R4=ZZe});function QZe(e,t,r){return R4(e,t,t,r)}var Bse,$se=F(()=>{"use strict";YP();o(QZe,"intersectCircle");Bse=QZe});function JZe(e,t,r,n){{let i=t.y-e.y,a=e.x-t.x,s=t.x*e.y-e.x*t.y,l=i*r.x+a*r.y+s,u=i*n.x+a*n.y+s,h=1e-6;if(l!==0&&u!==0&&Fse(l,u))return;let d=n.y-r.y,f=r.x-n.x,p=n.x*r.y-r.x*n.y,m=d*e.x+f*e.y+p,g=d*t.x+f*t.y+p;if(Math.abs(m)0}var zse,Gse=F(()=>{"use strict";o(JZe,"intersectLine");o(Fse,"sameSign");zse=JZe});function eQe(e,t,r){let n=e.x,i=e.y,a=[],s=Number.POSITIVE_INFINITY,l=Number.POSITIVE_INFINITY;typeof t.forEach=="function"?t.forEach(function(d){s=Math.min(s,d.x),l=Math.min(l,d.y)}):(s=Math.min(s,t.x),l=Math.min(l,t.y));let u=n-e.width/2-s,h=i-e.height/2-l;for(let d=0;d1&&a.sort(function(d,f){let p=d.x-r.x,m=d.y-r.y,g=Math.sqrt(p*p+m*m),y=f.x-r.x,v=f.y-r.y,x=Math.sqrt(y*y+v*v);return g{"use strict";Gse();o(eQe,"intersectPolygon");Vse=eQe});var tQe,nu,_4=F(()=>{"use strict";tQe=o((e,t)=>{var r=e.x,n=e.y,i=t.x-r,a=t.y-n,s=e.width/2,l=e.height/2,u,h;return Math.abs(a)*s>Math.abs(i)*l?(a<0&&(l=-l),u=a===0?0:l*i/a,h=l):(i<0&&(s=-s),u=s,h=i===0?0:s*a/i),{x:r+u,y:n+h}},"intersectRect"),nu=tQe});var ht,nr=F(()=>{"use strict";Ose();$se();YP();Wse();_4();ht={node:Pse,circle:Bse,ellipse:R4,polygon:Vse,rect:nu}});var qse,iu,rQe,M2,ct,dt,nQe,Jt=F(()=>{"use strict";Xt();qse=o(e=>{let{handDrawnSeed:t}=Ae();return{fill:e,hachureAngle:120,hachureGap:4,fillWeight:2,roughness:.7,stroke:e,seed:t}},"solidStateFill"),iu=o(e=>{let t=rQe([...e.cssCompiledStyles||[],...e.cssStyles||[],...e.labelStyle||[]]);return{stylesMap:t,stylesArray:[...t]}},"compileStyles"),rQe=o(e=>{let t=new Map;return e.forEach(r=>{let[n,i]=r.split(":");t.set(n.trim(),i?.trim())}),t},"styles2Map"),M2=o(e=>e==="color"||e==="font-size"||e==="font-family"||e==="font-weight"||e==="font-style"||e==="text-decoration"||e==="text-align"||e==="text-transform"||e==="line-height"||e==="letter-spacing"||e==="word-spacing"||e==="text-shadow"||e==="text-overflow"||e==="white-space"||e==="word-wrap"||e==="word-break"||e==="overflow-wrap"||e==="hyphens","isLabelStyle"),ct=o(e=>{let{stylesArray:t}=iu(e),r=[],n=[],i=[],a=[];return t.forEach(s=>{let l=s[0];M2(l)?r.push(s.join(":")+" !important"):(n.push(s.join(":")+" !important"),l.includes("stroke")&&i.push(s.join(":")+" !important"),l==="fill"&&a.push(s.join(":")+" !important"))}),{labelStyles:r.join(";"),nodeStyles:n.join(";"),stylesArray:t,borderStyles:i,backgroundStyles:a}},"styles2String"),dt=o((e,t)=>{let{themeVariables:r,handDrawnSeed:n}=Ae(),{nodeBorder:i,mainBkg:a}=r,{stylesMap:s}=iu(e);return Object.assign({roughness:.7,fill:s.get("fill")||a,fillStyle:"hachure",fillWeight:4,hachureGap:5.2,stroke:s.get("stroke")||i,seed:n,strokeWidth:s.get("stroke-width")?.replace("px","")||1.3,fillLineDash:[0,0],strokeLineDash:nQe(s.get("stroke-dasharray"))},t)},"userNodeOverrides"),nQe=o(e=>{if(!e)return[0,0];let t=e.trim().split(/\s+/).map(Number);if(t.length===1){let i=isNaN(t[0])?0:t[0];return[i,i]}let r=isNaN(t[0])?0:t[0],n=isNaN(t[1])?0:t[1];return[r,n]},"getStrokeDashArray")});function jP(e,t,r){if(e&&e.length){let[n,i]=t,a=Math.PI/180*r,s=Math.cos(a),l=Math.sin(a);for(let u of e){let[h,d]=u;u[0]=(h-n)*s-(d-i)*l+n,u[1]=(h-n)*l+(d-i)*s+i}}}function iQe(e,t){return e[0]===t[0]&&e[1]===t[1]}function aQe(e,t,r,n=1){let i=r,a=Math.max(t,.1),s=e[0]&&e[0][0]&&typeof e[0][0]=="number"?[e]:e,l=[0,0];if(i)for(let h of s)jP(h,l,i);let u=(function(h,d,f){let p=[];for(let b of h){let T=[...b];iQe(T[0],T[T.length-1])||T.push([T[0][0],T[0][1]]),T.length>2&&p.push(T)}let m=[];d=Math.max(d,.1);let g=[];for(let b of p)for(let T=0;Tb.yminT.ymin?1:b.xT.x?1:b.ymax===T.ymax?0:(b.ymax-T.ymax)/Math.abs(b.ymax-T.ymax))),!g.length)return m;let y=[],v=g[0].ymin,x=0;for(;y.length||g.length;){if(g.length){let b=-1;for(let T=0;Tv);T++)b=T;g.splice(0,b+1).forEach((T=>{y.push({s:v,edge:T})}))}if(y=y.filter((b=>!(b.edge.ymax<=v))),y.sort(((b,T)=>b.edge.x===T.edge.x?0:(b.edge.x-T.edge.x)/Math.abs(b.edge.x-T.edge.x))),(f!==1||x%d==0)&&y.length>1)for(let b=0;b=y.length)break;let k=y[b].edge,C=y[T].edge;m.push([[Math.round(k.x),v],[Math.round(C.x),v]])}v+=f,y.forEach((b=>{b.edge.x=b.edge.x+f*b.edge.islope})),x++}return m})(s,a,n);if(i){for(let h of s)jP(h,l,-i);(function(h,d,f){let p=[];h.forEach((m=>p.push(...m))),jP(p,d,f)})(u,l,-i)}return u}function B2(e,t){var r;let n=t.hachureAngle+90,i=t.hachureGap;i<0&&(i=4*t.strokeWidth),i=Math.round(Math.max(i,.1));let a=1;return t.roughness>=1&&(((r=t.randomizer)===null||r===void 0?void 0:r.next())||Math.random())>.7&&(a=i),aQe(e,i,n,a||1)}function $4(e){let t=e[0],r=e[1];return Math.sqrt(Math.pow(t[0]-r[0],2)+Math.pow(t[1]-r[1],2))}function KP(e,t){return e.type===t}function uO(e){let t=[],r=(function(s){let l=new Array;for(;s!=="";)if(s.match(/^([ \t\r\n,]+)/))s=s.substr(RegExp.$1.length);else if(s.match(/^([aAcChHlLmMqQsStTvVzZ])/))l[l.length]={type:sQe,text:RegExp.$1},s=s.substr(RegExp.$1.length);else{if(!s.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))return[];l[l.length]={type:XP,text:`${parseFloat(RegExp.$1)}`},s=s.substr(RegExp.$1.length)}return l[l.length]={type:Hse,text:""},l})(e),n="BOD",i=0,a=r[i];for(;!KP(a,Hse);){let s=0,l=[];if(n==="BOD"){if(a.text!=="M"&&a.text!=="m")return uO("M0,0"+e);i++,s=L4[a.text],n=a.text}else KP(a,XP)?s=L4[n]:(i++,s=L4[a.text],n=a.text);if(!(i+sd%2?h+r:h+t));a.push({key:"C",data:u}),t=u[4],r=u[5];break}case"Q":a.push({key:"Q",data:[...l]}),t=l[2],r=l[3];break;case"q":{let u=l.map(((h,d)=>d%2?h+r:h+t));a.push({key:"Q",data:u}),t=u[2],r=u[3];break}case"A":a.push({key:"A",data:[...l]}),t=l[5],r=l[6];break;case"a":t+=l[5],r+=l[6],a.push({key:"A",data:[l[0],l[1],l[2],l[3],l[4],t,r]});break;case"H":a.push({key:"H",data:[...l]}),t=l[0];break;case"h":t+=l[0],a.push({key:"H",data:[t]});break;case"V":a.push({key:"V",data:[...l]}),r=l[0];break;case"v":r+=l[0],a.push({key:"V",data:[r]});break;case"S":a.push({key:"S",data:[...l]}),t=l[2],r=l[3];break;case"s":{let u=l.map(((h,d)=>d%2?h+r:h+t));a.push({key:"S",data:u}),t=u[2],r=u[3];break}case"T":a.push({key:"T",data:[...l]}),t=l[0],r=l[1];break;case"t":t+=l[0],r+=l[1],a.push({key:"T",data:[t,r]});break;case"Z":case"z":a.push({key:"Z",data:[]}),t=n,r=i}return a}function eoe(e){let t=[],r="",n=0,i=0,a=0,s=0,l=0,u=0;for(let{key:h,data:d}of e){switch(h){case"M":t.push({key:"M",data:[...d]}),[n,i]=d,[a,s]=d;break;case"C":t.push({key:"C",data:[...d]}),n=d[4],i=d[5],l=d[2],u=d[3];break;case"L":t.push({key:"L",data:[...d]}),[n,i]=d;break;case"H":n=d[0],t.push({key:"L",data:[n,i]});break;case"V":i=d[0],t.push({key:"L",data:[n,i]});break;case"S":{let f=0,p=0;r==="C"||r==="S"?(f=n+(n-l),p=i+(i-u)):(f=n,p=i),t.push({key:"C",data:[f,p,...d]}),l=d[0],u=d[1],n=d[2],i=d[3];break}case"T":{let[f,p]=d,m=0,g=0;r==="Q"||r==="T"?(m=n+(n-l),g=i+(i-u)):(m=n,g=i);let y=n+2*(m-n)/3,v=i+2*(g-i)/3,x=f+2*(m-f)/3,b=p+2*(g-p)/3;t.push({key:"C",data:[y,v,x,b,f,p]}),l=m,u=g,n=f,i=p;break}case"Q":{let[f,p,m,g]=d,y=n+2*(f-n)/3,v=i+2*(p-i)/3,x=m+2*(f-m)/3,b=g+2*(p-g)/3;t.push({key:"C",data:[y,v,x,b,m,g]}),l=f,u=p,n=m,i=g;break}case"A":{let f=Math.abs(d[0]),p=Math.abs(d[1]),m=d[2],g=d[3],y=d[4],v=d[5],x=d[6];f===0||p===0?(t.push({key:"C",data:[n,i,v,x,v,x]}),n=v,i=x):(n!==v||i!==x)&&(toe(n,i,v,x,f,p,m,g,y).forEach((function(b){t.push({key:"C",data:b})})),n=v,i=x);break}case"Z":t.push({key:"Z",data:[]}),n=a,i=s}r=h}return t}function N2(e,t,r){return[e*Math.cos(r)-t*Math.sin(r),e*Math.sin(r)+t*Math.cos(r)]}function toe(e,t,r,n,i,a,s,l,u,h){let d=(f=s,Math.PI*f/180);var f;let p=[],m=0,g=0,y=0,v=0;if(h)[m,g,y,v]=h;else{[e,t]=N2(e,t,-d),[r,n]=N2(r,n,-d);let A=(e-r)/2,M=(t-n)/2,D=A*A/(i*i)+M*M/(a*a);D>1&&(D=Math.sqrt(D),i*=D,a*=D);let P=i*i,B=a*a,O=P*B-P*M*M-B*A*A,$=P*M*M+B*A*A,V=(l===u?-1:1)*Math.sqrt(Math.abs(O/$));y=V*i*M/a+(e+r)/2,v=V*-a*A/i+(t+n)/2,m=Math.asin(parseFloat(((t-v)/a).toFixed(9))),g=Math.asin(parseFloat(((n-v)/a).toFixed(9))),eg&&(m-=2*Math.PI),!u&&g>m&&(g-=2*Math.PI)}let x=g-m;if(Math.abs(x)>120*Math.PI/180){let A=g,M=r,D=n;g=u&&g>m?m+120*Math.PI/180*1:m+120*Math.PI/180*-1,p=toe(r=y+i*Math.cos(g),n=v+a*Math.sin(g),M,D,i,a,s,0,u,[g,A,y,v])}x=g-m;let b=Math.cos(m),T=Math.sin(m),k=Math.cos(g),C=Math.sin(g),w=Math.tan(x/4),S=4/3*i*w,R=4/3*a*w,L=[e,t],N=[e+S*T,t-R*b],I=[r+S*C,n-R*k],_=[r,n];if(N[0]=2*L[0]-N[0],N[1]=2*L[1]-N[1],h)return[N,I,_].concat(p);{p=[N,I,_].concat(p);let A=[];for(let M=0;M2){let i=[];for(let a=0;a2*Math.PI&&(m=0,g=2*Math.PI);let y=2*Math.PI/u.curveStepCount,v=Math.min(y/2,(g-m)/2),x=Zse(v,h,d,f,p,m,g,1,u);if(!u.disableMultiStroke){let b=Zse(v,h,d,f,p,m,g,1.5,u);x.push(...b)}return s&&(l?x.push(...Jd(h,d,h+f*Math.cos(m),d+p*Math.sin(m),u),...Jd(h,d,h+f*Math.cos(g),d+p*Math.sin(g),u)):x.push({op:"lineTo",data:[h,d]},{op:"lineTo",data:[h+f*Math.cos(m),d+p*Math.sin(m)]})),{type:"path",ops:x}}function jse(e,t){let r=eoe(Jse(uO(e))),n=[],i=[0,0],a=[0,0];for(let{key:s,data:l}of r)switch(s){case"M":a=[l[0],l[1]],i=[l[0],l[1]];break;case"L":n.push(...Jd(a[0],a[1],l[0],l[1],t)),a=[l[0],l[1]];break;case"C":{let[u,h,d,f,p,m]=l;n.push(...cQe(u,h,d,f,p,m,a,t)),a=[p,m];break}case"Z":n.push(...Jd(a[0],a[1],i[0],i[1],t)),a=[i[0],i[1]]}return{type:"path",ops:n}}function ZP(e,t){let r=[];for(let n of e)if(n.length){let i=t.maxRandomnessOffset||0,a=n.length;if(a>2){r.push({op:"move",data:[n[0][0]+Cr(i,t),n[0][1]+Cr(i,t)]});for(let s=1;s500?.4:-.0016668*u+1.233334;let d=i.maxRandomnessOffset||0;d*d*100>l&&(d=u/10);let f=d/2,p=.2+.2*ioe(i),m=i.bowing*i.maxRandomnessOffset*(n-t)/200,g=i.bowing*i.maxRandomnessOffset*(e-r)/200;m=Cr(m,i,h),g=Cr(g,i,h);let y=[],v=o(()=>Cr(f,i,h),"M"),x=o(()=>Cr(d,i,h),"k"),b=i.preserveVertices;return a&&(s?y.push({op:"move",data:[e+(b?0:v()),t+(b?0:v())]}):y.push({op:"move",data:[e+(b?0:Cr(d,i,h)),t+(b?0:Cr(d,i,h))]})),s?y.push({op:"bcurveTo",data:[m+e+(r-e)*p+v(),g+t+(n-t)*p+v(),m+e+2*(r-e)*p+v(),g+t+2*(n-t)*p+v(),r+(b?0:v()),n+(b?0:v())]}):y.push({op:"bcurveTo",data:[m+e+(r-e)*p+x(),g+t+(n-t)*p+x(),m+e+2*(r-e)*p+x(),g+t+2*(n-t)*p+x(),r+(b?0:x()),n+(b?0:x())]}),y}function D4(e,t,r){if(!e.length)return[];let n=[];n.push([e[0][0]+Cr(t,r),e[0][1]+Cr(t,r)]),n.push([e[0][0]+Cr(t,r),e[0][1]+Cr(t,r)]);for(let i=1;i3){let a=[],s=1-r.curveTightness;i.push({op:"move",data:[e[1][0],e[1][1]]});for(let l=1;l+21&&i.push(l)):i.push(l),i.push(e[t+3])}else{let u=e[t+0],h=e[t+1],d=e[t+2],f=e[t+3],p=wm(u,h,.5),m=wm(h,d,.5),g=wm(d,f,.5),y=wm(p,m,.5),v=wm(m,g,.5),x=wm(y,v,.5);oO([u,p,y,x],0,r,i),oO([x,v,g,f],0,r,i)}var a,s;return i}function hQe(e,t){return B4(e,0,e.length,t)}function B4(e,t,r,n,i){let a=i||[],s=e[t],l=e[r-1],u=0,h=1;for(let d=t+1;du&&(u=f,h=d)}return Math.sqrt(u)>n?(B4(e,t,h+1,n,a),B4(e,h,r,n,a)):(a.length||a.push(s),a.push(l)),a}function QP(e,t=.15,r){let n=[],i=(e.length-1)/3;for(let a=0;a0?B4(n,0,n.length,r):n}var O2,JP,eO,tO,rO,nO,no,iO,sQe,XP,Hse,L4,oQe,zo,zy,lO,I4,cO,ut,tr=F(()=>{"use strict";o(jP,"t");o(iQe,"e");o(aQe,"s");o(B2,"n");O2=class{static{o(this,"o")}constructor(t){this.helper=t}fillPolygons(t,r){return this._fillPolygons(t,r)}_fillPolygons(t,r){let n=B2(t,r);return{type:"fillSketch",ops:this.renderLines(n,r)}}renderLines(t,r){let n=[];for(let i of t)n.push(...this.helper.doubleLineOps(i[0][0],i[0][1],i[1][0],i[1][1],r));return n}};o($4,"a");JP=class extends O2{static{o(this,"h")}fillPolygons(t,r){let n=r.hachureGap;n<0&&(n=4*r.strokeWidth),n=Math.max(n,.1);let i=B2(t,Object.assign({},r,{hachureGap:n})),a=Math.PI/180*r.hachureAngle,s=[],l=.5*n*Math.cos(a),u=.5*n*Math.sin(a);for(let[h,d]of i)$4([h,d])&&s.push([[h[0]-l,h[1]+u],[...d]],[[h[0]+l,h[1]-u],[...d]]);return{type:"fillSketch",ops:this.renderLines(s,r)}}},eO=class extends O2{static{o(this,"r")}fillPolygons(t,r){let n=this._fillPolygons(t,r),i=Object.assign({},r,{hachureAngle:r.hachureAngle+90}),a=this._fillPolygons(t,i);return n.ops=n.ops.concat(a.ops),n}},tO=class{static{o(this,"i")}constructor(t){this.helper=t}fillPolygons(t,r){let n=B2(t,r=Object.assign({},r,{hachureAngle:0}));return this.dotsOnLines(n,r)}dotsOnLines(t,r){let n=[],i=r.hachureGap;i<0&&(i=4*r.strokeWidth),i=Math.max(i,.1);let a=r.fillWeight;a<0&&(a=r.strokeWidth/2);let s=i/4;for(let l of t){let u=$4(l),h=u/i,d=Math.ceil(h)-1,f=u-d*i,p=(l[0][0]+l[1][0])/2-i/4,m=Math.min(l[0][1],l[1][1]);for(let g=0;g{let l=$4(s),u=Math.floor(l/(n+i)),h=(l+i-u*(n+i))/2,d=s[0],f=s[1];d[0]>f[0]&&(d=s[1],f=s[0]);let p=Math.atan((f[1]-d[1])/(f[0]-d[0]));for(let m=0;m{let s=$4(a),l=Math.round(s/(2*r)),u=a[0],h=a[1];u[0]>h[0]&&(u=a[1],h=a[0]);let d=Math.atan((h[1]-u[1])/(h[0]-u[0]));for(let f=0;f2*Math.PI&&(S=0,R=2*Math.PI);let L=(R-S)/b.curveStepCount,N=[];for(let I=S;I<=R;I+=L)N.push([T+C*Math.cos(I),k+w*Math.sin(I)]);return N.push([T+C*Math.cos(R),k+w*Math.sin(R)]),N.push([T,k]),Fy([N],b)})(t,r,n,i,a,s,h));return h.stroke!==zo&&d.push(f),this._d("arc",d,h)}curve(t,r){let n=this._o(r),i=[],a=Use(t,n);if(n.fill&&n.fill!==zo)if(n.fillStyle==="solid"){let s=Use(t,Object.assign(Object.assign({},n),{disableMultiStroke:!0,roughness:n.roughness?n.roughness+n.fillShapeRoughnessGain:0}));i.push({type:"fillPath",ops:this._mergedShape(s.ops)})}else{let s=[],l=t;if(l.length){let u=typeof l[0][0]=="number"?[l]:l;for(let h of u)h.length<3?s.push(...h):h.length===3?s.push(...QP(Qse([h[0],h[0],h[1],h[2]]),10,(1+n.roughness)/2)):s.push(...QP(Qse(h),10,(1+n.roughness)/2))}s.length&&i.push(Fy([s],n))}return n.stroke!==zo&&i.push(a),this._d("curve",i,n)}polygon(t,r){let n=this._o(r),i=[],a=M4(t,!0,n);return n.fill&&(n.fillStyle==="solid"?i.push(ZP([t],n)):i.push(Fy([t],n))),n.stroke!==zo&&i.push(a),this._d("polygon",i,n)}path(t,r){let n=this._o(r),i=[];if(!t)return this._d("path",i,n);t=(t||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");let a=n.fill&&n.fill!=="transparent"&&n.fill!==zo,s=n.stroke!==zo,l=!!(n.simplification&&n.simplification<1),u=(function(d,f,p){let m=eoe(Jse(uO(d))),g=[],y=[],v=[0,0],x=[],b=o(()=>{x.length>=4&&y.push(...QP(x,f)),x=[]},"i"),T=o(()=>{b(),y.length&&(g.push(y),y=[])},"c");for(let{key:C,data:w}of m)switch(C){case"M":T(),v=[w[0],w[1]],y.push(v);break;case"L":b(),y.push([w[0],w[1]]);break;case"C":if(!x.length){let S=y.length?y[y.length-1]:v;x.push([S[0],S[1]])}x.push([w[0],w[1]]),x.push([w[2],w[3]]),x.push([w[4],w[5]]);break;case"Z":b(),y.push([v[0],v[1]])}if(T(),!p)return g;let k=[];for(let C of g){let w=hQe(C,p);w.length&&k.push(w)}return k})(t,1,l?4-4*(n.simplification||1):(1+n.roughness)/2),h=jse(t,n);if(a)if(n.fillStyle==="solid")if(u.length===1){let d=jse(t,Object.assign(Object.assign({},n),{disableMultiStroke:!0,roughness:n.roughness?n.roughness+n.fillShapeRoughnessGain:0}));i.push({type:"fillPath",ops:this._mergedShape(d.ops)})}else i.push(ZP(u,n));else i.push(Fy(u,n));return s&&(l?u.forEach((d=>{i.push(M4(d,!1,n))})):i.push(h)),this._d("path",i,n)}opsToPath(t,r){let n="";for(let i of t.ops){let a=typeof r=="number"&&r>=0?i.data.map((s=>+s.toFixed(r))):i.data;switch(i.op){case"move":n+=`M${a[0]} ${a[1]} `;break;case"bcurveTo":n+=`C${a[0]} ${a[1]}, ${a[2]} ${a[3]}, ${a[4]} ${a[5]} `;break;case"lineTo":n+=`L${a[0]} ${a[1]} `}}return n.trim()}toPaths(t){let r=t.sets||[],n=t.options||this.defaultOptions,i=[];for(let a of r){let s=null;switch(a.type){case"path":s={d:this.opsToPath(a),stroke:n.stroke,strokeWidth:n.strokeWidth,fill:zo};break;case"fillPath":s={d:this.opsToPath(a),stroke:zo,strokeWidth:0,fill:n.fill||zo};break;case"fillSketch":s=this.fillSketch(a,n)}s&&i.push(s)}return i}fillSketch(t,r){let n=r.fillWeight;return n<0&&(n=r.strokeWidth/2),{d:this.opsToPath(t),stroke:r.fill||zo,strokeWidth:n,fill:zo}}_mergedShape(t){return t.filter(((r,n)=>n===0||r.op!=="move"))}},lO=class{static{o(this,"st")}constructor(t,r){this.canvas=t,this.ctx=this.canvas.getContext("2d"),this.gen=new zy(r)}draw(t){let r=t.sets||[],n=t.options||this.getDefaultOptions(),i=this.ctx,a=t.options.fixedDecimalPlaceDigits;for(let s of r)switch(s.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,s,a),i.restore();break;case"fillPath":{i.save(),i.fillStyle=n.fill||"";let l=t.shape==="curve"||t.shape==="polygon"||t.shape==="path"?"evenodd":"nonzero";this._drawToContext(i,s,a,l),i.restore();break}case"fillSketch":this.fillSketch(i,s,n)}}fillSketch(t,r,n){let i=n.fillWeight;i<0&&(i=n.strokeWidth/2),t.save(),n.fillLineDash&&t.setLineDash(n.fillLineDash),n.fillLineDashOffset&&(t.lineDashOffset=n.fillLineDashOffset),t.strokeStyle=n.fill||"",t.lineWidth=i,this._drawToContext(t,r,n.fixedDecimalPlaceDigits),t.restore()}_drawToContext(t,r,n,i="nonzero"){t.beginPath();for(let a of r.ops){let s=typeof n=="number"&&n>=0?a.data.map((l=>+l.toFixed(n))):a.data;switch(a.op){case"move":t.moveTo(s[0],s[1]);break;case"bcurveTo":t.bezierCurveTo(s[0],s[1],s[2],s[3],s[4],s[5]);break;case"lineTo":t.lineTo(s[0],s[1])}}r.type==="fillPath"?t.fill(i):t.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(t,r,n,i,a){let s=this.gen.line(t,r,n,i,a);return this.draw(s),s}rectangle(t,r,n,i,a){let s=this.gen.rectangle(t,r,n,i,a);return this.draw(s),s}ellipse(t,r,n,i,a){let s=this.gen.ellipse(t,r,n,i,a);return this.draw(s),s}circle(t,r,n,i){let a=this.gen.circle(t,r,n,i);return this.draw(a),a}linearPath(t,r){let n=this.gen.linearPath(t,r);return this.draw(n),n}polygon(t,r){let n=this.gen.polygon(t,r);return this.draw(n),n}arc(t,r,n,i,a,s,l=!1,u){let h=this.gen.arc(t,r,n,i,a,s,l,u);return this.draw(h),h}curve(t,r){let n=this.gen.curve(t,r);return this.draw(n),n}path(t,r){let n=this.gen.path(t,r);return this.draw(n),n}},I4="http://www.w3.org/2000/svg",cO=class{static{o(this,"ot")}constructor(t,r){this.svg=t,this.gen=new zy(r)}draw(t){let r=t.sets||[],n=t.options||this.getDefaultOptions(),i=this.svg.ownerDocument||window.document,a=i.createElementNS(I4,"g"),s=t.options.fixedDecimalPlaceDigits;for(let l of r){let u=null;switch(l.type){case"path":u=i.createElementNS(I4,"path"),u.setAttribute("d",this.opsToPath(l,s)),u.setAttribute("stroke",n.stroke),u.setAttribute("stroke-width",n.strokeWidth+""),u.setAttribute("fill","none"),n.strokeLineDash&&u.setAttribute("stroke-dasharray",n.strokeLineDash.join(" ").trim()),n.strokeLineDashOffset&&u.setAttribute("stroke-dashoffset",`${n.strokeLineDashOffset}`);break;case"fillPath":u=i.createElementNS(I4,"path"),u.setAttribute("d",this.opsToPath(l,s)),u.setAttribute("stroke","none"),u.setAttribute("stroke-width","0"),u.setAttribute("fill",n.fill||""),t.shape!=="curve"&&t.shape!=="polygon"||u.setAttribute("fill-rule","evenodd");break;case"fillSketch":u=this.fillSketch(i,l,n)}u&&a.appendChild(u)}return a}fillSketch(t,r,n){let i=n.fillWeight;i<0&&(i=n.strokeWidth/2);let a=t.createElementNS(I4,"path");return a.setAttribute("d",this.opsToPath(r,n.fixedDecimalPlaceDigits)),a.setAttribute("stroke",n.fill||""),a.setAttribute("stroke-width",i+""),a.setAttribute("fill","none"),n.fillLineDash&&a.setAttribute("stroke-dasharray",n.fillLineDash.join(" ").trim()),n.fillLineDashOffset&&a.setAttribute("stroke-dashoffset",`${n.fillLineDashOffset}`),a}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(t,r){return this.gen.opsToPath(t,r)}line(t,r,n,i,a){let s=this.gen.line(t,r,n,i,a);return this.draw(s)}rectangle(t,r,n,i,a){let s=this.gen.rectangle(t,r,n,i,a);return this.draw(s)}ellipse(t,r,n,i,a){let s=this.gen.ellipse(t,r,n,i,a);return this.draw(s)}circle(t,r,n,i){let a=this.gen.circle(t,r,n,i);return this.draw(a)}linearPath(t,r){let n=this.gen.linearPath(t,r);return this.draw(n)}polygon(t,r){let n=this.gen.polygon(t,r);return this.draw(n)}arc(t,r,n,i,a,s,l=!1,u){let h=this.gen.arc(t,r,n,i,a,s,l,u);return this.draw(h)}curve(t,r){let n=this.gen.curve(t,r);return this.draw(n)}path(t,r){let n=this.gen.path(t,r);return this.draw(n)}},ut={canvas:o((e,t)=>new lO(e,t),"canvas"),svg:o((e,t)=>new cO(e,t),"svg"),generator:o(e=>new zy(e),"generator"),newSeed:o(()=>zy.newSeed(),"newSeed")}});function aoe(e,t){let{labelStyles:r}=ct(t);t.labelStyle=r;let n=Dt(t),i=n;n||(i="anchor");let a=e.insert("g").attr("class",i).attr("id",t.domId||t.id),s=1,{cssStyles:l}=t,u=ut.svg(a),h=dt(t,{fill:"black",stroke:"none",fillStyle:"solid"});t.look!=="handDrawn"&&(h.roughness=0);let d=u.circle(0,0,s*2,h),f=a.insert(()=>d,":first-child");return f.attr("class","anchor").attr("style",kn(l)),pt(t,f),t.intersect=function(p){return Z.info("Circle intersect",t,s,p),ht.circle(t,s,p)},a}var soe=F(()=>{"use strict";vt();Kt();nr();Jt();tr();Qt();o(aoe,"anchor")});function ooe(e,t,r,n,i,a,s){let u=(e+r)/2,h=(t+n)/2,d=Math.atan2(n-t,r-e),f=(r-e)/2,p=(n-t)/2,m=f/i,g=p/a,y=Math.sqrt(m**2+g**2);if(y>1)throw new Error("The given radii are too small to create an arc between the points.");let v=Math.sqrt(1-y**2),x=u+v*a*Math.sin(d)*(s?-1:1),b=h-v*i*Math.cos(d)*(s?-1:1),T=Math.atan2((t-b)/a,(e-x)/i),C=Math.atan2((n-b)/a,(r-x)/i)-T;s&&C<0&&(C+=2*Math.PI),!s&&C>0&&(C-=2*Math.PI);let w=[];for(let S=0;S<20;S++){let R=S/19,L=T+R*C,N=x+i*Math.cos(L),I=b+a*Math.sin(L);w.push({x:N,y:I})}return w}function dQe(e,t,r){let[n,i]=[t,r].sort((a,s)=>s-a);return i*(1-Math.sqrt(1-(e/n/2)**2))}async function loe(e,t){let{labelStyles:r,nodeStyles:n}=ct(t);t.labelStyle=r;let i=t.padding??0,a=t.look==="neo"?16:i,s=t.look==="neo"?12:i,l=o(L=>L+s,"calcTotalHeight"),u=o(L=>{let N=L/2;return[N/(2.5+L/50),N]},"calcEllipseRadius"),{shapeSvg:h,bbox:d}=await It(e,t,Dt(t)),f=l(t?.height?t?.height:d.height),[p,m]=u(f),g=dQe(f,p,m),v=(t?.width?t?.width:d.width)+a*2+g-g,x=f,{cssStyles:b}=t,T=[{x:v/2,y:-x/2},{x:-v/2,y:-x/2},...ooe(-v/2,-x/2,-v/2,x/2,p,m,!1),{x:v/2,y:x/2},...ooe(v/2,x/2,v/2,-x/2,p,m,!0)],k=ut.svg(h),C=dt(t,{});t.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");let w=or(T),S=k.path(w,C),R=h.insert(()=>S,":first-child");return R.attr("class","basic label-container outer-path"),b&&t.look!=="handDrawn"&&R.selectAll("path").attr("style",b),n&&t.look!=="handDrawn"&&R.selectAll("path").attr("style",n),R.attr("transform",`translate(${p/2}, 0)`),pt(t,R),t.intersect=function(L){return ht.polygon(t,T,L)},h}var coe=F(()=>{"use strict";Kt();nr();Jt();tr();o(ooe,"generateArcPoints");o(dQe,"calculateArcSagitta");o(loe,"bowTieRect")});function as(e,t,r,n){return e.insert("polygon",":first-child").attr("points",n.map(function(i){return i.x+","+i.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-t/2+","+r/2+")")}var Ch=F(()=>{"use strict";o(as,"insertPolygonShape")});async function uoe(e,t){let{labelStyles:r,nodeStyles:n}=ct(t);t.labelStyle=r;let i=t.padding??0,a=t.look==="neo"?28:i,s=t.look==="neo"?24:i,{shapeSvg:l,bbox:u}=await It(e,t,Dt(t)),h=(t?.width??u.width)+(t.look==="neo"?a*2:a+F4),d=(t?.height??u.height)+(t.look==="neo"?s*2:s),f=0,p=h,m=-d,g=0,y=[{x:f+F4,y:m},{x:p,y:m},{x:p,y:g},{x:f,y:g},{x:f,y:m+F4},{x:f+F4,y:m}],v,{cssStyles:x}=t;if(t.look==="handDrawn"){let b=ut.svg(l),T=dt(t,{}),k=or(y),C=b.path(k,T);v=l.insert(()=>C,":first-child").attr("transform",`translate(${-h/2}, ${d/2})`),x&&v.attr("style",x)}else v=as(l,h,d,y);return n&&v.attr("style",n),pt(t,v),t.intersect=function(b){return ht.polygon(t,y,b)},l}var F4,hoe=F(()=>{"use strict";Kt();nr();Jt();tr();Ch();Kt();F4=12;o(uoe,"card")});function doe(e,t){let{nodeStyles:r}=ct(t);t.label="";let n=e.insert("g").attr("class",Dt(t)).attr("id",t.domId??t.id),{cssStyles:i}=t,a=Math.max(28,t.width??0),s=[{x:0,y:a/2},{x:a/2,y:0},{x:0,y:-a/2},{x:-a/2,y:0}],l=ut.svg(n),u=dt(t,{});t.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");let h=or(s),d=l.path(h,u),f=n.insert(()=>d,":first-child");return i&&t.look!=="handDrawn"&&f.selectAll("path").attr("style",i),r&&t.look!=="handDrawn"&&f.selectAll("path").attr("style",r),t.width=28,t.height=28,t.intersect=function(p){return ht.polygon(t,s,p)},n}var foe=F(()=>{"use strict";nr();tr();Jt();Kt();o(doe,"choice")});async function z4(e,t,r){let{labelStyles:n,nodeStyles:i}=ct(t);t.labelStyle=n;let{shapeSvg:a,bbox:s,halfPadding:l}=await It(e,t,Dt(t)),u=16,h=r?.padding??l,d=t.look==="neo"?s.width/2+u*2:s.width/2+h,f,{cssStyles:p}=t;if(t.look==="handDrawn"){let m=ut.svg(a),g=dt(t,{}),y=m.circle(0,0,d*2,g);f=a.insert(()=>y,":first-child"),f.attr("class","basic label-container").attr("style",kn(p))}else f=a.insert("circle",":first-child").attr("class","basic label-container").attr("style",i).attr("r",d).attr("cx",0).attr("cy",0);return pt(t,f),t.calcIntersect=function(m,g){let y=m.width/2;return ht.circle(m,y,g)},t.intersect=function(m){return Z.info("Circle intersect",t,d,m),ht.circle(t,d,m)},a}var hO=F(()=>{"use strict";tr();vt();Qt();nr();Jt();Kt();o(z4,"circle")});function fQe(e){let t=Math.cos(Math.PI/4),r=Math.sin(Math.PI/4),n=e*2,i={x:n/2*t,y:n/2*r},a={x:-(n/2)*t,y:n/2*r},s={x:-(n/2)*t,y:-(n/2)*r},l={x:n/2*t,y:-(n/2)*r};return`M ${a.x},${a.y} L ${l.x},${l.y}
+ M ${i.x},${i.y} L ${s.x},${s.y}`}function poe(e,t){let{labelStyles:r,nodeStyles:n}=ct(t);t.labelStyle=r,t.label="";let i=e.insert("g").attr("class",Dt(t)).attr("id",t.domId??t.id),a=Math.max(30,t?.width??0),{cssStyles:s}=t,l=ut.svg(i),u=dt(t,{});t.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");let h=l.circle(0,0,a*2,u),d=fQe(a),f=l.path(d,u),p=i.insert(()=>h,":first-child");return p.insert(()=>f),p.attr("class","outer-path"),s&&t.look!=="handDrawn"&&p.selectAll("path").attr("style",s),n&&t.look!=="handDrawn"&&p.selectAll("path").attr("style",n),pt(t,p),t.intersect=function(m){return Z.info("crossedCircle intersect",t,{radius:a,point:m}),ht.circle(t,a,m)},i}var moe=F(()=>{"use strict";vt();Kt();Jt();tr();nr();o(fQe,"createLine");o(poe,"crossedCircle")});function ef(e,t,r,n=100,i=0,a=180){let s=[],l=i*Math.PI/180,d=(a*Math.PI/180-l)/(n-1);for(let f=0;fC,":first-child").attr("stroke-opacity",0),w.insert(()=>T,":first-child"),w.attr("class","text"),p&&t.look!=="handDrawn"&&w.selectAll("path").attr("style",p),n&&t.look!=="handDrawn"&&w.selectAll("path").attr("style",n),w.attr("transform",`translate(${f}, 0)`),s.attr("transform",`translate(${-h/2+f-(a.x-(a.left??0))},${-d/2+(t.padding??0)/2-(a.y-(a.top??0))})`),pt(t,w),t.intersect=function(S){return ht.polygon(t,g,S)},i}var yoe=F(()=>{"use strict";Kt();nr();Jt();tr();o(ef,"generateCirclePoints");o(goe,"curlyBraceLeft")});function tf(e,t,r,n=100,i=0,a=180){let s=[],l=i*Math.PI/180,d=(a*Math.PI/180-l)/(n-1);for(let f=0;fC,":first-child").attr("stroke-opacity",0),w.insert(()=>T,":first-child"),w.attr("class","text"),p&&t.look!=="handDrawn"&&w.selectAll("path").attr("style",p),n&&t.look!=="handDrawn"&&w.selectAll("path").attr("style",n),w.attr("transform",`translate(${-f}, 0)`),s.attr("transform",`translate(${-h/2+(t.padding??0)/2-(a.x-(a.left??0))},${-d/2+(t.padding??0)/2-(a.y-(a.top??0))})`),pt(t,w),t.intersect=function(S){return ht.polygon(t,g,S)},i}var xoe=F(()=>{"use strict";Kt();nr();Jt();tr();o(tf,"generateCirclePoints");o(voe,"curlyBraceRight")});function ss(e,t,r,n=100,i=0,a=180){let s=[],l=i*Math.PI/180,d=(a*Math.PI/180-l)/(n-1);for(let f=0;fL,":first-child").attr("stroke-opacity",0),N.insert(()=>k,":first-child"),N.insert(()=>S,":first-child"),N.attr("class","text"),p&&t.look!=="handDrawn"&&N.selectAll("path").attr("style",p),n&&t.look!=="handDrawn"&&N.selectAll("path").attr("style",n),N.attr("transform",`translate(${f-f/4}, 0)`),s.attr("transform",`translate(${-h/2+(t.padding??0)/2-(a.x-(a.left??0))},${-d/2+(t.padding??0)/2-(a.y-(a.top??0))})`),pt(t,N),t.intersect=function(I){return ht.polygon(t,y,I)},i}var Toe=F(()=>{"use strict";Kt();nr();Jt();tr();o(ss,"generateCirclePoints");o(boe,"curlyBraces")});async function Coe(e,t){let{labelStyles:r,nodeStyles:n}=ct(t);t.labelStyle=r;let i=t.padding??0,a=t.look==="neo"?16:i,s=t.look==="neo"?12:i,l=20,u=5,{shapeSvg:h,bbox:d}=await It(e,t,Dt(t)),f=Math.max(l,(d.width+a*2)*1.25,t?.width??0),p=Math.max(u,d.height+s*2,t?.height??0),m=p/2,{cssStyles:g}=t,y=ut.svg(h),v=dt(t,{});t.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");let x=f,b=p,T=x-m,k=b/4,C=[{x:T,y:0},{x:k,y:0},{x:0,y:b/2},{x:k,y:b},{x:T,y:b},...Cm(-T,-b/2,m,50,270,90)],w=or(C),S=y.path(w,v),R=h.insert(()=>S,":first-child");return R.attr("class","basic label-container outer-path"),g&&t.look!=="handDrawn"&&R.selectChildren("path").attr("style",g),n&&t.look!=="handDrawn"&&R.selectChildren("path").attr("style",n),R.attr("transform",`translate(${-f/2}, ${-p/2})`),pt(t,R),t.intersect=function(L){return ht.polygon(t,C,L)},h}var woe=F(()=>{"use strict";Kt();nr();Jt();tr();o(Coe,"curvedTrapezoid")});async function Eoe(e,t){let{labelStyles:r,nodeStyles:n}=ct(t);t.labelStyle=r;let i=t.padding??0,a=t.look==="neo"?24:i,s=t.look==="neo"?24:i;if(t.width||t.height){let v=t.width??0;t.width=(t.width??0)-s,t.widthC,":first-child"),g=l.insert(()=>k,":first-child"),g.attr("class","basic label-container"),y&&g.attr("style",y)}else{let v=pQe(0,0,d,m,f,p);g=l.insert("path",":first-child").attr("d",v).attr("class","basic label-container outer-path").attr("style",kn(y)).attr("style",n)}return g.attr("label-offset-y",p),g.attr("transform",`translate(${-d/2}, ${-(m/2+p)})`),pt(t,g),h.attr("transform",`translate(${-(u.width/2)-(u.x-(u.left??0))}, ${-(u.height/2)+(t.padding??0)/1.5-(u.y-(u.top??0))})`),t.intersect=function(v){let x=ht.rect(t,v),b=x.x-(t.x??0);if(f!=0&&(Math.abs(b)<(t.width??0)/2||Math.abs(b)==(t.width??0)/2&&Math.abs(x.y-(t.y??0))>(t.height??0)/2-p)){let T=p*p*(1-b*b/(f*f));T>0&&(T=Math.sqrt(T)),T=p-T,v.y-(t.y??0)>0&&(T=-T),x.y+=T}return x},l}var pQe,mQe,gQe,koe,Soe,Aoe=F(()=>{"use strict";Kt();nr();Jt();tr();Qt();pQe=o((e,t,r,n,i,a)=>[`M${e},${t+a}`,`a${i},${a} 0,0,0 ${r},0`,`a${i},${a} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${a} 0,0,0 ${r},0`,`l0,${-n}`].join(" "),"createCylinderPathD"),mQe=o((e,t,r,n,i,a)=>[`M${e},${t+a}`,`M${e+r},${t+a}`,`a${i},${a} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${a} 0,0,0 ${r},0`,`l0,${-n}`].join(" "),"createOuterCylinderPathD"),gQe=o((e,t,r,n,i,a)=>[`M${e-r/2},${-n/2}`,`a${i},${a} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),koe=8,Soe=8;o(Eoe,"cylinder")});var io,km=F(()=>{"use strict";io=o((e,t,r,n,i)=>["M",e+i,t,"H",e+r-i,"A",i,i,0,0,1,e+r,t+i,"V",t+n-i,"A",i,i,0,0,1,e+r-i,t+n,"H",e+i,"A",i,i,0,0,1,e,t+n-i,"V",t+i,"A",i,i,0,0,1,e+i,t,"Z"].join(" "),"createRoundedRectPathD")});async function ac(e,t,r){let{labelStyles:n,nodeStyles:i}=ct(t);t.labelStyle=n;let{shapeSvg:a,bbox:s}=await It(e,t,Dt(t)),l=Math.max(s.width+r.labelPaddingX*2,t?.width||0),u=Math.max(s.height+r.labelPaddingY*2,t?.height||0),h=-l/2,d=-u/2,f,{rx:p,ry:m}=t,{cssStyles:g}=t;if(r?.rx&&r.ry&&(p=r.rx,m=r.ry),t.look==="handDrawn"){let y=ut.svg(a),v=dt(t,{}),x=p||m?y.path(io(h,d,l,u,p||0),v):y.rectangle(h,d,l,u,v);f=a.insert(()=>x,":first-child"),f.attr("class","basic label-container").attr("style",kn(g))}else f=a.insert("rect",":first-child"),f.attr("class","basic label-container").attr("style",i).attr("rx",kn(p)).attr("ry",kn(m)).attr("x",h).attr("y",d).attr("width",l).attr("height",u);return pt(t,f),t.calcIntersect=function(y,v){return ht.rect(y,v)},t.intersect=function(y){return ht.rect(t,y)},a}var Sm=F(()=>{"use strict";Kt();nr();km();Jt();tr();Qt();o(ac,"drawRect")});async function Roe(e,t){let{cssClasses:r,labelPaddingX:n,labelPaddingY:i,padding:a,width:s,height:l}=t,u={rx:0,ry:0,classes:r??"",labelPaddingX:n??(a??0)*2,labelPaddingY:i??a??0},h=await ac(e,t,u);if(t.look==="handDrawn"){let m=ut.svg(h),g=dt(t,{}),y=h.select(".basic.label-container > path:nth-child(2)"),v=y.node();if(!v)return h;let x=null;if(v instanceof SVGGraphicsElement)x=v.getBBox();else return h;return h.insert(()=>m.line(x.x,x.y,x.x+x.width,x.y,g),".basic.label-container g.label"),h.insert(()=>m.line(x.x,x.y+x.height,x.x+x.width,x.y+x.height,g),".basic.label-container g.label"),y.remove(),h}let d=h.select(".basic.label-container"),f=(Number(d.attr("width"))||s)??0,p=(Number(d.attr("height"))||l)??0;return f>0&&p>0&&d.attr("stroke-dasharray",`${f} ${p}`),h}var _oe=F(()=>{"use strict";Sm();Jt();tr();o(Roe,"datastore")});async function Loe(e,t){let{labelStyles:r,nodeStyles:n}=ct(t);t.labelStyle=r;let i=t.look==="neo"?16:t.padding??0,a=t.look==="neo"?16:t.padding??0,{shapeSvg:s,bbox:l,label:u}=await It(e,t,Dt(t)),h=l.width+i,d=l.height+a,f=d*.2,p=-h/2,m=-d/2-f/2,{cssStyles:g}=t,y=ut.svg(s),v=dt(t,{});t.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");let x=[{x:p,y:m+f},{x:-p,y:m+f},{x:-p,y:-m},{x:p,y:-m},{x:p,y:m},{x:-p,y:m},{x:-p,y:m+f}],b=y.polygon(x.map(k=>[k.x,k.y]),v),T=s.insert(()=>b,":first-child");return T.attr("class","basic label-container outer-path"),g&&t.look!=="handDrawn"&&T.selectAll("path").attr("style",g),n&&t.look!=="handDrawn"&&T.selectAll("path").attr("style",n),u.attr("transform",`translate(${p+(t.padding??0)/2-(l.x-(l.left??0))}, ${m+f+(t.padding??0)/2-(l.y-(l.top??0))})`),pt(t,T),t.intersect=function(k){return ht.rect(t,k)},s}var Doe=F(()=>{"use strict";Kt();nr();Jt();tr();o(Loe,"dividedRectangle")});async function Ioe(e,t){let{labelStyles:r,nodeStyles:n}=ct(t),i=t.look==="neo"?12:5;t.labelStyle=r;let a=t.padding??0,s=t.look==="neo"?16:a,{shapeSvg:l,bbox:u}=await It(e,t,Dt(t)),h=(t?.width?t?.width/2:u.width/2)+(s??0),d=h-i,f,{cssStyles:p}=t;if(t.look==="handDrawn"){let m=ut.svg(l),g=dt(t,{roughness:.2,strokeWidth:2.5}),y=dt(t,{roughness:.2,strokeWidth:1.5}),v=m.circle(0,0,h*2,g),x=m.circle(0,0,d*2,y);f=l.insert("g",":first-child"),f.attr("class",kn(t.cssClasses)).attr("style",kn(p)),f.node()?.appendChild(v),f.node()?.appendChild(x)}else{f=l.insert("g",":first-child");let m=f.insert("circle",":first-child"),g=f.insert("circle");f.attr("class","basic label-container").attr("style",n),m.attr("class","outer-circle").attr("style",n).attr("r",h).attr("cx",0).attr("cy",0),g.attr("class","inner-circle").attr("style",n).attr("r",d).attr("cx",0).attr("cy",0)}return pt(t,f),t.intersect=function(m){return Z.info("DoubleCircle intersect",t,h,m),ht.circle(t,h,m)},l}var Moe=F(()=>{"use strict";vt();Kt();nr();Jt();tr();Qt();o(Ioe,"doublecircle")});function Noe(e,t,{config:{themeVariables:r}}){let{labelStyles:n,nodeStyles:i}=ct(t);t.label="",t.labelStyle=n;let a=e.insert("g").attr("class",Dt(t)).attr("id",t.domId??t.id),s=7,{cssStyles:l}=t,u=ut.svg(a),{nodeBorder:h}=r,d=dt(t,{fillStyle:"solid"});t.look!=="handDrawn"&&(d.roughness=0);let f=u.circle(0,0,s*2,d),p=a.insert(()=>f,":first-child");return p.selectAll("path").attr("style",`fill: ${h} !important;`),l&&l.length>0&&t.look!=="handDrawn"&&p.selectAll("path").attr("style",l),i&&t.look!=="handDrawn"&&p.selectAll("path").attr("style",i),pt(t,p),t.intersect=function(m){return Z.info("filledCircle intersect",t,{radius:s,point:m}),ht.circle(t,s,m)},a}var Poe=F(()=>{"use strict";tr();vt();nr();Jt();Kt();o(Noe,"filledCircle")});async function $oe(e,t){let{labelStyles:r,nodeStyles:n}=ct(t);t.labelStyle=r;let i=t.padding??0,a=t.look==="neo"?i*2:i;(t.width||t.height)&&(t.height=t?.height??0,t.heightx,":first-child").attr("transform",`translate(${-d/2}, ${d/2})`).attr("class","outer-path");return m&&t.look!=="handDrawn"&&b.selectChildren("path").attr("style",m),n&&t.look!=="handDrawn"&&b.selectChildren("path").attr("style",n),t.width=h,t.height=d,pt(t,b),u.attr("transform",`translate(${-l.width/2-(l.x-(l.left??0))}, ${-d/2+(t.padding??0)/2+(l.y-(l.top??0))})`),t.intersect=function(T){return Z.info("Triangle intersect",t,p,T),ht.polygon(t,p,T)},s}var Ooe,Boe,Foe=F(()=>{"use strict";vt();Kt();nr();Jt();tr();Kt();Ooe=10,Boe=10;o($oe,"flippedTriangle")});function zoe(e,t,{dir:r,config:{state:n,themeVariables:i}}){let{nodeStyles:a}=ct(t);t.label="";let s=e.insert("g").attr("class",Dt(t)).attr("id",t.domId??t.id),{cssStyles:l}=t,u=Math.max(70,t?.width??0),h=Math.max(10,t?.height??0);r==="LR"&&(u=Math.max(10,t?.width??0),h=Math.max(70,t?.height??0));let d=-1*u/2,f=-1*h/2,p=ut.svg(s),m=dt(t,{stroke:i.lineColor,fill:i.lineColor});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");let g=p.rectangle(d,f,u,h,m),y=s.insert(()=>g,":first-child");l&&t.look!=="handDrawn"&&y.selectAll("path").attr("style",l),a&&t.look!=="handDrawn"&&y.selectAll("path").attr("style",a),pt(t,y);let v=n?.padding??0;return t.width&&t.height&&(t.width+=v/2||0,t.height+=v/2||0),t.intersect=function(x){return ht.rect(t,x)},s}var Goe=F(()=>{"use strict";tr();nr();Jt();Kt();o(zoe,"forkJoin")});async function Voe(e,t){let{labelStyles:r,nodeStyles:n}=ct(t);t.labelStyle=r;let i=15,a=10,s=t.look==="neo"?16:t.padding??0,l=t.look==="neo"?12:t.padding??0;(t.width||t.height)&&(t.height=(t?.height??0)-l*2,t.heightb,":first-child");return T.attr("class","basic label-container outer-path"),m&&t.look!=="handDrawn"&&T.selectChildren("path").attr("style",m),n&&t.look!=="handDrawn"&&T.selectChildren("path").attr("style",n),pt(t,T),t.intersect=function(k){return Z.info("Pill intersect",t,{radius:p,point:k}),ht.polygon(t,v,k)},u}var Woe=F(()=>{"use strict";vt();Kt();nr();Jt();tr();o(Voe,"halfRoundedRectangle")});async function qoe(e,t){let{labelStyles:r,nodeStyles:n}=ct(t),i=t.look==="neo"?3.5:4;t.labelStyle=r;let a=t.padding??0,s=70,l=32,u=t.look==="neo"?s:a,h=t.look==="neo"?l:a;if(t.width||t.height){let T=(t.height??0)/i;t.width=(t?.width??0)-2*T-h,t.height=(t.height??0)-u}let{shapeSvg:d,bbox:f}=await It(e,t,Dt(t)),p=(t?.height?t?.height:f.height)+u,m=p/i,g=(t?.width?t?.width:f.width)+2*m+h,y=[{x:m,y:0},{x:g-m,y:0},{x:g,y:-p/2},{x:g-m,y:-p},{x:m,y:-p},{x:0,y:-p/2}],v,{cssStyles:x}=t;if(t.look==="handDrawn"){let b=ut.svg(d),T=dt(t,{}),k=yQe(0,0,g,p,m),C=b.path(k,T);v=d.insert(()=>C,":first-child").attr("transform",`translate(${-g/2}, ${p/2})`),x&&v.attr("style",x)}else v=as(d,g,p,y);return n&&v.attr("style",n),t.width=g,t.height=p,pt(t,v),t.intersect=function(b){return ht.polygon(t,y,b)},d}var yQe,Hoe=F(()=>{"use strict";Kt();nr();Jt();tr();Ch();yQe=o((e,t,r,n,i)=>[`M${e+i},${t}`,`L${e+r-i},${t}`,`L${e+r},${t-n/2}`,`L${e+r-i},${t-n}`,`L${e+i},${t-n}`,`L${e},${t-n/2}`,"Z"].join(" "),"createHexagonPathD");o(qoe,"hexagon")});async function Uoe(e,t){let{labelStyles:r,nodeStyles:n}=ct(t);t.label="",t.labelStyle=r;let{shapeSvg:i}=await It(e,t,Dt(t)),a=Math.max(30,t?.width??0),s=Math.max(30,t?.height??0),{cssStyles:l}=t,u=ut.svg(i),h=dt(t,{});t.look!=="handDrawn"&&(h.roughness=0,h.fillStyle="solid");let d=[{x:0,y:0},{x:a,y:0},{x:0,y:s},{x:a,y:s}],f=or(d),p=u.path(f,h),m=i.insert(()=>p,":first-child");return m.attr("class","basic label-container outer-path"),l&&t.look!=="handDrawn"&&m.selectChildren("path").attr("style",l),n&&t.look!=="handDrawn"&&m.selectChildren("path").attr("style",n),m.attr("transform",`translate(${-a/2}, ${-s/2})`),pt(t,m),t.intersect=function(g){return Z.info("Pill intersect",t,{points:d}),ht.polygon(t,d,g)},i}var Yoe=F(()=>{"use strict";vt();Kt();nr();Jt();tr();o(Uoe,"hourglass")});async function joe(e,t,{config:{themeVariables:r,flowchart:n}}){let{labelStyles:i}=ct(t);t.labelStyle=i;let a=t.assetHeight??48,s=t.assetWidth??48,l=Math.max(a,s),u=n?.wrappingWidth;t.width=Math.max(l,u??0);let{shapeSvg:h,bbox:d,label:f}=await It(e,t,"icon-shape default"),p=t.pos==="t",m=l,g=l,{nodeBorder:y}=r,{stylesMap:v}=iu(t),x=-g/2,b=-m/2,T=t.label?8:0,k=ut.svg(h),C=dt(t,{stroke:"none",fill:"none"});t.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");let w=k.rectangle(x,b,g,m,C),S=Math.max(g,d.width),R=m+d.height+T,L=k.rectangle(-S/2,-R/2,S,R,{...C,fill:"transparent",stroke:"none"}),N=h.insert(()=>w,":first-child"),I=h.insert(()=>L);if(t.icon){let _=h.append("g");_.html(`${await ts(t.icon,{height:l,width:l,fallbackPrefix:""})} `);let A=_.node().getBBox(),M=A.width,D=A.height,P=A.x,B=A.y;_.attr("transform",`translate(${-M/2-P},${p?d.height/2+T/2-D/2-B:-d.height/2-T/2-D/2-B})`),_.attr("style",`color: ${v.get("stroke")??y};`)}return f.attr("transform",`translate(${-d.width/2-(d.x-(d.left??0))},${p?-R/2:R/2-d.height})`),N.attr("transform",`translate(0,${p?d.height/2+T/2:-d.height/2-T/2})`),pt(t,I),t.intersect=function(_){if(Z.info("iconSquare intersect",t,_),!t.label)return ht.rect(t,_);let A=t.x??0,M=t.y??0,D=t.height??0,P=[];return p?P=[{x:A-d.width/2,y:M-D/2},{x:A+d.width/2,y:M-D/2},{x:A+d.width/2,y:M-D/2+d.height+T},{x:A+g/2,y:M-D/2+d.height+T},{x:A+g/2,y:M+D/2},{x:A-g/2,y:M+D/2},{x:A-g/2,y:M-D/2+d.height+T},{x:A-d.width/2,y:M-D/2+d.height+T}]:P=[{x:A-g/2,y:M-D/2},{x:A+g/2,y:M-D/2},{x:A+g/2,y:M-D/2+m},{x:A+d.width/2,y:M-D/2+m},{x:A+d.width/2/2,y:M+D/2},{x:A-d.width/2,y:M+D/2},{x:A-d.width/2,y:M-D/2+m},{x:A-g/2,y:M-D/2+m}],ht.polygon(t,P,_)},h}var Xoe=F(()=>{"use strict";tr();vt();Vl();nr();Jt();Kt();o(joe,"icon")});async function Koe(e,t,{config:{themeVariables:r,flowchart:n}}){let{labelStyles:i}=ct(t);t.labelStyle=i;let a=t.assetHeight??48,s=t.assetWidth??48,l=Math.max(a,s),u=n?.wrappingWidth;t.width=Math.max(l,u??0);let{shapeSvg:h,bbox:d,label:f}=await It(e,t,"icon-shape default"),p=20,m=t.label?8:0,g=t.pos==="t",{nodeBorder:y,mainBkg:v}=r,{stylesMap:x}=iu(t),b=ut.svg(h),T=dt(t,{});t.look!=="handDrawn"&&(T.roughness=0,T.fillStyle="solid");let k=x.get("fill");T.stroke=k??v;let C=h.append("g");t.icon&&C.html(`${await ts(t.icon,{height:l,width:l,fallbackPrefix:""})} `);let w=C.node().getBBox(),S=w.width,R=w.height,L=w.x,N=w.y,I=Math.max(S,R)*Math.SQRT2+p*2,_=b.circle(0,0,I,T),A=Math.max(I,d.width),M=I+d.height+m,D=b.rectangle(-A/2,-M/2,A,M,{...T,fill:"transparent",stroke:"none"}),P=h.insert(()=>_,":first-child"),B=h.insert(()=>D);return C.attr("transform",`translate(${-S/2-L},${g?d.height/2+m/2-R/2-N:-d.height/2-m/2-R/2-N})`),C.attr("style",`color: ${x.get("stroke")??y};`),f.attr("transform",`translate(${-d.width/2-(d.x-(d.left??0))},${g?-M/2:M/2-d.height})`),P.attr("transform",`translate(0,${g?d.height/2+m/2:-d.height/2-m/2})`),pt(t,B),t.intersect=function(O){return Z.info("iconSquare intersect",t,O),ht.rect(t,O)},h}var Zoe=F(()=>{"use strict";tr();vt();Vl();nr();Jt();Kt();o(Koe,"iconCircle")});async function Qoe(e,t,{config:{themeVariables:r,flowchart:n}}){let{labelStyles:i}=ct(t);t.labelStyle=i;let a=t.assetHeight??48,s=t.assetWidth??48,l=Math.max(a,s),u=n?.wrappingWidth;t.width=Math.max(l,u??0);let{shapeSvg:h,bbox:d,halfPadding:f,label:p}=await It(e,t,"icon-shape default"),m=t.pos==="t",g=l+f*2,y=l+f*2,{nodeBorder:v,mainBkg:x}=r,{stylesMap:b}=iu(t),T=-y/2,k=-g/2,C=t.label?8:0,w=ut.svg(h),S=dt(t,{});t.look!=="handDrawn"&&(S.roughness=0,S.fillStyle="solid");let R=b.get("fill");S.stroke=R??x;let L=w.path(io(T,k,y,g,5),S),N=Math.max(y,d.width),I=g+d.height+C,_=w.rectangle(-N/2,-I/2,N,I,{...S,fill:"transparent",stroke:"none"}),A=h.insert(()=>L,":first-child").attr("class","icon-shape2"),M=h.insert(()=>_);if(t.icon){let D=h.append("g");D.html(`${await ts(t.icon,{height:l,width:l,fallbackPrefix:""})} `);let P=D.node().getBBox(),B=P.width,O=P.height,$=P.x,V=P.y;D.attr("transform",`translate(${-B/2-$},${m?d.height/2+C/2-O/2-V:-d.height/2-C/2-O/2-V})`),D.attr("style",`color: ${b.get("stroke")??v};`)}return p.attr("transform",`translate(${-d.width/2-(d.x-(d.left??0))},${m?-I/2:I/2-d.height})`),A.attr("transform",`translate(0,${m?d.height/2+C/2:-d.height/2-C/2})`),pt(t,M),t.intersect=function(D){if(Z.info("iconSquare intersect",t,D),!t.label)return ht.rect(t,D);let P=t.x??0,B=t.y??0,O=t.height??0,$=[];return m?$=[{x:P-d.width/2,y:B-O/2},{x:P+d.width/2,y:B-O/2},{x:P+d.width/2,y:B-O/2+d.height+C},{x:P+y/2,y:B-O/2+d.height+C},{x:P+y/2,y:B+O/2},{x:P-y/2,y:B+O/2},{x:P-y/2,y:B-O/2+d.height+C},{x:P-d.width/2,y:B-O/2+d.height+C}]:$=[{x:P-y/2,y:B-O/2},{x:P+y/2,y:B-O/2},{x:P+y/2,y:B-O/2+g},{x:P+d.width/2,y:B-O/2+g},{x:P+d.width/2/2,y:B+O/2},{x:P-d.width/2,y:B+O/2},{x:P-d.width/2,y:B-O/2+g},{x:P-y/2,y:B-O/2+g}],ht.polygon(t,$,D)},h}var Joe=F(()=>{"use strict";tr();vt();Vl();nr();Jt();km();Kt();o(Qoe,"iconRounded")});async function ele(e,t,{config:{themeVariables:r,flowchart:n}}){let{labelStyles:i}=ct(t);t.labelStyle=i;let a=t.assetHeight??48,s=t.assetWidth??48,l=Math.max(a,s),u=n?.wrappingWidth;t.width=Math.max(l,u??0);let{shapeSvg:h,bbox:d,halfPadding:f,label:p}=await It(e,t,"icon-shape default"),m=t.pos==="t",g=l+f*2,y=l+f*2,{nodeBorder:v,mainBkg:x}=r,{stylesMap:b}=iu(t),T=-y/2,k=-g/2,C=t.label?8:0,w=ut.svg(h),S=dt(t,{});t.look!=="handDrawn"&&(S.roughness=0,S.fillStyle="solid");let R=b.get("fill");S.stroke=R??x;let L=w.path(io(T,k,y,g,.1),S),N=Math.max(y,d.width),I=g+d.height+C,_=w.rectangle(-N/2,-I/2,N,I,{...S,fill:"transparent",stroke:"none"}),A=h.insert(()=>L,":first-child"),M=h.insert(()=>_);if(t.icon){let D=h.append("g");D.html(`${await ts(t.icon,{height:l,width:l,fallbackPrefix:""})} `);let P=D.node().getBBox(),B=P.width,O=P.height,$=P.x,V=P.y;D.attr("transform",`translate(${-B/2-$},${m?d.height/2+C/2-O/2-V:-d.height/2-C/2-O/2-V})`),D.attr("style",`color: ${b.get("stroke")??v};`)}return p.attr("transform",`translate(${-d.width/2-(d.x-(d.left??0))},${m?-I/2:I/2-d.height})`),A.attr("transform",`translate(0,${m?d.height/2+C/2:-d.height/2-C/2})`),pt(t,M),t.intersect=function(D){if(Z.info("iconSquare intersect",t,D),!t.label)return ht.rect(t,D);let P=t.x??0,B=t.y??0,O=t.height??0,$=[];return m?$=[{x:P-d.width/2,y:B-O/2},{x:P+d.width/2,y:B-O/2},{x:P+d.width/2,y:B-O/2+d.height+C},{x:P+y/2,y:B-O/2+d.height+C},{x:P+y/2,y:B+O/2},{x:P-y/2,y:B+O/2},{x:P-y/2,y:B-O/2+d.height+C},{x:P-d.width/2,y:B-O/2+d.height+C}]:$=[{x:P-y/2,y:B-O/2},{x:P+y/2,y:B-O/2},{x:P+y/2,y:B-O/2+g},{x:P+d.width/2,y:B-O/2+g},{x:P+d.width/2/2,y:B+O/2},{x:P-d.width/2,y:B+O/2},{x:P-d.width/2,y:B-O/2+g},{x:P-y/2,y:B-O/2+g}],ht.polygon(t,$,D)},h}var tle=F(()=>{"use strict";tr();vt();Vl();nr();km();Jt();Kt();o(ele,"iconSquare")});async function rle(e,t,{config:{flowchart:r}}){let n=new Image;n.src=t?.img??"",await n.decode();let i=Number(n.naturalWidth.toString().replace("px","")),a=Number(n.naturalHeight.toString().replace("px",""));t.imageAspectRatio=i/a;let{labelStyles:s}=ct(t);t.labelStyle=s;let l=r?.wrappingWidth;t.defaultWidth=r?.wrappingWidth;let u=Math.max(t.label?l??0:0,t?.assetWidth??i),h=t.constraint==="on"&&t?.assetHeight?t.assetHeight*t.imageAspectRatio:u,d=t.constraint==="on"?h/t.imageAspectRatio:t?.assetHeight??a;t.width=Math.max(h,l??0);let{shapeSvg:f,bbox:p,label:m}=await It(e,t,"image-shape default"),g=t.pos==="t",y=-h/2,v=-d/2,x=t.label?8:0,b=ut.svg(f),T=dt(t,{});t.look!=="handDrawn"&&(T.roughness=0,T.fillStyle="solid");let k=b.rectangle(y,v,h,d,T),C=Math.max(h,p.width),w=d+p.height+x,S=b.rectangle(-C/2,-w/2,C,w,{...T,fill:"none",stroke:"none"}),R=f.insert(()=>k,":first-child"),L=f.insert(()=>S);if(t.img){let N=f.append("image");N.attr("href",t.img),N.attr("width",h),N.attr("height",d),N.attr("preserveAspectRatio","none"),N.attr("transform",`translate(${-h/2},${g?w/2-d:-w/2})`)}return m.attr("transform",`translate(${-p.width/2-(p.x-(p.left??0))},${g?-d/2-p.height/2-x/2:d/2-p.height/2+x/2})`),R.attr("transform",`translate(0,${g?p.height/2+x/2:-p.height/2-x/2})`),pt(t,L),t.intersect=function(N){if(Z.info("iconSquare intersect",t,N),!t.label)return ht.rect(t,N);let I=t.x??0,_=t.y??0,A=t.height??0,M=[];return g?M=[{x:I-p.width/2,y:_-A/2},{x:I+p.width/2,y:_-A/2},{x:I+p.width/2,y:_-A/2+p.height+x},{x:I+h/2,y:_-A/2+p.height+x},{x:I+h/2,y:_+A/2},{x:I-h/2,y:_+A/2},{x:I-h/2,y:_-A/2+p.height+x},{x:I-p.width/2,y:_-A/2+p.height+x}]:M=[{x:I-h/2,y:_-A/2},{x:I+h/2,y:_-A/2},{x:I+h/2,y:_-A/2+d},{x:I+p.width/2,y:_-A/2+d},{x:I+p.width/2/2,y:_+A/2},{x:I-p.width/2,y:_+A/2},{x:I-p.width/2,y:_-A/2+d},{x:I-h/2,y:_-A/2+d}],ht.polygon(t,M,N)},f}var nle=F(()=>{"use strict";tr();vt();nr();Jt();Kt();o(rle,"imageSquare")});async function ile(e,t){let{labelStyles:r,nodeStyles:n}=ct(t);t.labelStyle=r;let i=t.padding??0,a=i,s=t.look==="neo"?i*2:i,{shapeSvg:l,bbox:u}=await It(e,t,Dt(t)),h=Math.max(u.width+(s??0)*2,t?.width??0),d=Math.max(u.height+(a??0)*2,t?.height??0),f=[{x:0,y:0},{x:h,y:0},{x:h+3*d/6,y:-d},{x:-3*d/6,y:-d}],p,{cssStyles:m}=t;if(t.look==="handDrawn"){let g=ut.svg(l),y=dt(t,{}),v=or(f),x=g.path(v,y);p=l.insert(()=>x,":first-child").attr("transform",`translate(${-h/2}, ${d/2})`),m&&p.attr("style",m)}else p=as(l,h,d,f);return n&&p.attr("style",n),t.width=h,t.height=d,pt(t,p),t.intersect=function(g){return ht.polygon(t,f,g)},l}var ale=F(()=>{"use strict";Kt();nr();Jt();tr();Ch();o(ile,"inv_trapezoid")});async function sle(e,t){let{shapeSvg:r,bbox:n,label:i}=await It(e,t,"label"),a=r.insert("rect",":first-child");return a.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))})`),pt(t,a),t.intersect=function(u){return ht.rect(t,u)},r}var ole=F(()=>{"use strict";Sm();Kt();nr();o(sle,"labelRect")});async function lle(e,t){let{labelStyles:r,nodeStyles:n}=ct(t);t.labelStyle=r;let i=t.padding??0,a=i,s=t.look==="neo"?i*2:i,{shapeSvg:l,bbox:u}=await It(e,t,Dt(t)),h=(t?.height??u.height)+a,d=(t?.width??u.width)+s,f=[{x:0,y:0},{x:d+3*h/6,y:0},{x:d,y:-h},{x:-(3*h)/6,y:-h}],p,{cssStyles:m}=t;if(t.look==="handDrawn"){let g=ut.svg(l),y=dt(t,{}),v=or(f),x=g.path(v,y);p=l.insert(()=>x,":first-child").attr("transform",`translate(${-d/2}, ${h/2})`),m&&p.attr("style",m)}else p=as(l,d,h,f);return n&&p.attr("style",n),t.width=d,t.height=h,pt(t,p),t.intersect=function(g){return ht.polygon(t,f,g)},l}var cle=F(()=>{"use strict";Kt();nr();Jt();tr();Ch();o(lle,"lean_left")});async function ule(e,t){let{labelStyles:r,nodeStyles:n}=ct(t);t.labelStyle=r;let i=t.padding??0,a=i,s=t.look==="neo"?i*2:i,{shapeSvg:l,bbox:u}=await It(e,t,Dt(t)),h=(t?.height??u.height)+a,d=(t?.width??u.width)+s,f=[{x:-3*h/6,y:0},{x:d,y:0},{x:d+3*h/6,y:-h},{x:0,y:-h}],p,{cssStyles:m}=t;if(t.look==="handDrawn"){let g=ut.svg(l),y=dt(t,{}),v=or(f),x=g.path(v,y);p=l.insert(()=>x,":first-child").attr("transform",`translate(${-d/2}, ${h/2})`),m&&p.attr("style",m)}else p=as(l,d,h,f);return n&&p.attr("style",n),t.width=d,t.height=h,pt(t,p),t.intersect=function(g){return ht.polygon(t,f,g)},l}var hle=F(()=>{"use strict";Kt();nr();Jt();tr();Ch();o(ule,"lean_right")});function dle(e,t){let{labelStyles:r,nodeStyles:n}=ct(t);t.label="",t.labelStyle=r;let i=e.insert("g").attr("class",Dt(t)).attr("id",t.domId??t.id),{cssStyles:a}=t,s=Math.max(35,t?.width??0),l=Math.max(35,t?.height??0),u=7,h=[{x:s,y:0},{x:0,y:l+u/2},{x:s-2*u,y:l+u/2},{x:0,y:2*l},{x:s,y:l-u/2},{x:2*u,y:l-u/2}],d=ut.svg(i),f=dt(t,{});t.look!=="handDrawn"&&(f.roughness=0,f.fillStyle="solid");let p=or(h),m=d.path(p,f),g=i.insert(()=>m,":first-child");return g.attr("class","outer-path"),a&&t.look!=="handDrawn"&&g.selectAll("path").attr("style",a),n&&t.look!=="handDrawn"&&g.selectAll("path").attr("style",n),g.attr("transform",`translate(-${s/2},${-l})`),pt(t,g),t.intersect=function(y){return Z.info("lightningBolt intersect",t,y),ht.polygon(t,h,y)},i}var fle=F(()=>{"use strict";vt();Kt();Jt();tr();nr();Kt();o(dle,"lightningBolt")});async function gle(e,t){let{labelStyles:r,nodeStyles:n}=ct(t);t.labelStyle=r;let i=t.padding??0,a=t.look==="neo"?16:i,s=t.look==="neo"?24:i;if(t.width||t.height){let x=t.width??0;t.width=(t.width??0)-a,t.widthw,":first-child").attr("class","line"),y=l.insert(()=>C,":first-child"),y.attr("class","basic label-container"),v&&y.attr("style",v)}else{let x=vQe(0,0,d,m,f,p,g);y=l.insert("path",":first-child").attr("d",x).attr("class","basic label-container outer-path").attr("style",kn(v)).attr("style",n)}return y.attr("label-offset-y",p),y.attr("transform",`translate(${-d/2}, ${-(m/2+p)})`),pt(t,y),h.attr("transform",`translate(${-(u.width/2)-(u.x-(u.left??0))}, ${-(u.height/2)+p-(u.y-(u.top??0))})`),t.intersect=function(x){let b=ht.rect(t,x),T=b.x-(t.x??0);if(f!=0&&(Math.abs(T)<(t.width??0)/2||Math.abs(T)==(t.width??0)/2&&Math.abs(b.y-(t.y??0))>(t.height??0)/2-p)){let k=p*p*(1-T*T/(f*f));k>0&&(k=Math.sqrt(k)),k=p-k,x.y-(t.y??0)>0&&(k=-k),b.y+=k}return b},l}var vQe,xQe,bQe,ple,mle,yle=F(()=>{"use strict";Kt();nr();Jt();tr();Qt();vQe=o((e,t,r,n,i,a,s)=>[`M${e},${t+a}`,`a${i},${a} 0,0,0 ${r},0`,`a${i},${a} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${a} 0,0,0 ${r},0`,`l0,${-n}`,`M${e},${t+a+s}`,`a${i},${a} 0,0,0 ${r},0`].join(" "),"createCylinderPathD"),xQe=o((e,t,r,n,i,a,s)=>[`M${e},${t+a}`,`M${e+r},${t+a}`,`a${i},${a} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${a} 0,0,0 ${r},0`,`l0,${-n}`,`M${e},${t+a+s}`,`a${i},${a} 0,0,0 ${r},0`].join(" "),"createOuterCylinderPathD"),bQe=o((e,t,r,n,i,a)=>[`M${e-r/2},${-n/2}`,`a${i},${a} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),ple=10,mle=10;o(gle,"linedCylinder")});async function vle(e,t){let{labelStyles:r,nodeStyles:n}=ct(t);t.labelStyle=r;let i=t.padding??0,a=t.look==="neo"?16:i,s=t.look==="neo"?12:i;if(t.width||t.height){let k=t.width;t.width=(k??0)*10/11-a*2,t.width<10&&(t.width=10),t.height=(t?.height??0)-s*2,t.height<10&&(t.height=10)}let{shapeSvg:l,bbox:u,label:h}=await It(e,t,Dt(t)),d=(t?.width?t?.width:u.width)+(a??0)*2,f=(t?.height?t?.height:u.height)+(s??0)*2,p=t.look==="neo"?f/4:f/8,m=f+p,{cssStyles:g}=t,y=ut.svg(l),v=dt(t,{});t.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");let x=[{x:-d/2-d/2*.1,y:-m/2},{x:-d/2-d/2*.1,y:m/2},...fl(-d/2-d/2*.1,m/2,d/2+d/2*.1,m/2,p,.8),{x:d/2+d/2*.1,y:-m/2},{x:-d/2-d/2*.1,y:-m/2},{x:-d/2,y:-m/2},{x:-d/2,y:m/2*1.1},{x:-d/2,y:-m/2}],b=y.polygon(x.map(k=>[k.x,k.y]),v),T=l.insert(()=>b,":first-child");return T.attr("class","basic label-container outer-path"),g&&t.look!=="handDrawn"&&T.selectAll("path").attr("style",g),n&&t.look!=="handDrawn"&&T.selectAll("path").attr("style",n),T.attr("transform",`translate(0,${-p/2})`),h.attr("transform",`translate(${-d/2+(t.padding??0)+d/2*.1/2-(u.x-(u.left??0))},${-f/2+(t.padding??0)-p/2-(u.y-(u.top??0))})`),pt(t,T),t.intersect=function(k){return ht.polygon(t,x,k)},l}var xle=F(()=>{"use strict";Kt();nr();tr();Jt();o(vle,"linedWaveEdgedRect")});async function ble(e,t){let{labelStyles:r,nodeStyles:n}=ct(t);t.labelStyle=r;let i=t.padding??0,a=t.look==="neo"?16:i,s=t.look==="neo"?12:i,l=t.look==="neo"?10:5;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-a*2-2*l,10),t.height=Math.max((t?.height??0)-s*2-2*l,10));let{shapeSvg:u,bbox:h,label:d}=await It(e,t,Dt(t)),f=(t?.width?t?.width:h.width)+a*2+2*l,p=(t?.height?t?.height:h.height)+s*2+2*l,m=f-2*l,g=p-2*l,y=-m/2,v=-g/2,{cssStyles:x}=t,b=ut.svg(u),T=dt(t,{}),k=[{x:y-l,y:v+l},{x:y-l,y:v+g+l},{x:y+m-l,y:v+g+l},{x:y+m-l,y:v+g},{x:y+m,y:v+g},{x:y+m,y:v+g-l},{x:y+m+l,y:v+g-l},{x:y+m+l,y:v-l},{x:y+l,y:v-l},{x:y+l,y:v},{x:y,y:v},{x:y,y:v+l}],C=[{x:y,y:v+l},{x:y+m-l,y:v+l},{x:y+m-l,y:v+g},{x:y+m,y:v+g},{x:y+m,y:v},{x:y,y:v}];t.look!=="handDrawn"&&(T.roughness=0,T.fillStyle="solid");let w=or(k),S=b.path(w,T),R=or(C),L=b.path(R,T);t.look!=="handDrawn"&&(S=UP(S),L=UP(L));let N=u.insert("g",":first-child");return N.insert(()=>S),N.insert(()=>L),N.attr("class","basic label-container outer-path"),x&&t.look!=="handDrawn"&&N.selectAll("path").attr("style",x),n&&t.look!=="handDrawn"&&N.selectAll("path").attr("style",n),d.attr("transform",`translate(${-(h.width/2)-l-(h.x-(h.left??0))}, ${-(h.height/2)+l-(h.y-(h.top??0))})`),pt(t,N),t.intersect=function(I){return ht.polygon(t,k,I)},u}var Tle=F(()=>{"use strict";Kt();Jt();tr();nr();o(ble,"multiRect")});async function Cle(e,t){let{labelStyles:r,nodeStyles:n}=ct(t);t.labelStyle=r;let{shapeSvg:i,bbox:a,label:s}=await It(e,t,Dt(t)),l=t.padding??0,u=t.look==="neo"?16:l,h=t.look==="neo"?12:l,d=!0;(t.width||t.height)&&(d=!1,t.width=(t?.width??0)-u*2,t.height=(t?.height??0)-h*3);let f=Math.max(a.width,t?.width??0)+u*2,p=Math.max(a.height,t?.height??0)+h*3,m=t.look==="neo"?p/4:p/8,g=p+(d?m/2:-m/2),y=-f/2,v=-g/2,x=10,{cssStyles:b}=t,T=fl(y-x,v+g+x,y+f-x,v+g+x,m,.8),k=T?.[T.length-1],C=[{x:y-x,y:v+x},{x:y-x,y:v+g+x},...T,{x:y+f-x,y:k.y-x},{x:y+f,y:k.y-x},{x:y+f,y:k.y-2*x},{x:y+f+x,y:k.y-2*x},{x:y+f+x,y:v-x},{x:y+x,y:v-x},{x:y+x,y:v},{x:y,y:v},{x:y,y:v+x}],w=[{x:y,y:v+x},{x:y+f-x,y:v+x},{x:y+f-x,y:k.y-x},{x:y+f,y:k.y-x},{x:y+f,y:v},{x:y,y:v}],S=ut.svg(i),R=dt(t,{});t.look!=="handDrawn"&&(R.roughness=0,R.fillStyle="solid");let L=or(C),N=S.path(L,R),I=or(w),_=S.path(I,R),A=i.insert(()=>N,":first-child");return A.insert(()=>_),A.attr("class","basic label-container outer-path"),b&&t.look!=="handDrawn"&&A.selectAll("path").attr("style",b),n&&t.look!=="handDrawn"&&A.selectAll("path").attr("style",n),A.attr("transform",`translate(0,${-m/2})`),s.attr("transform",`translate(${-(a.width/2)-x-(a.x-(a.left??0))}, ${-(a.height/2)+x-m/2-(a.y-(a.top??0))})`),pt(t,A),t.intersect=function(M){return ht.polygon(t,C,M)},i}var wle=F(()=>{"use strict";Kt();nr();tr();Jt();o(Cle,"multiWaveEdgedRectangle")});async function kle(e,t,{config:{themeVariables:r}}){let{labelStyles:n,nodeStyles:i}=ct(t);t.labelStyle=n,t.useHtmlLabels||Gr(_t())||(t.centerLabel=!0);let{shapeSvg:s,bbox:l,label:u}=await It(e,t,Dt(t)),h=Math.max(l.width+(t.padding??0)*2,t?.width??0),d=Math.max(l.height+(t.padding??0)*2,t?.height??0),f=-h/2,p=-d/2,{cssStyles:m}=t,g=ut.svg(s),y=dt(t,{fill:r.noteBkgColor,stroke:r.noteBorderColor});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");let v=g.rectangle(f,p,h,d,y),x=s.insert(()=>v,":first-child");return x.attr("class","basic label-container outer-path"),u.attr("class","label noteLabel"),m&&t.look!=="handDrawn"&&x.selectAll("path").attr("style",m),i&&t.look!=="handDrawn"&&x.selectAll("path").attr("style",i),u.attr("transform",`translate(${-l.width/2-(l.x-(l.left??0))}, ${-(l.height/2)-(l.y-(l.top??0))})`),pt(t,x),t.intersect=function(b){return ht.rect(t,b)},s}var Sle=F(()=>{"use strict";tr();nr();Jt();Kt();ur();ur();o(kle,"note")});async function Ele(e,t){let{labelStyles:r,nodeStyles:n}=ct(t);t.labelStyle=r;let{shapeSvg:i,bbox:a}=await It(e,t,Dt(t)),s=a.width+(t.padding??0),l=a.height+(t.padding??0),u=s+l,h=.5,d=[{x:u/2,y:0},{x:u,y:-u/2},{x:u/2,y:-u},{x:0,y:-u/2}],f,{cssStyles:p}=t;if(t.look==="handDrawn"){let m=ut.svg(i),g=dt(t,{}),y=TQe(0,0,u),v=m.path(y,g);f=i.insert(()=>v,":first-child").attr("transform",`translate(${-u/2+h}, ${u/2})`),p&&f.attr("style",p)}else f=as(i,u,u,d),f.attr("transform",`translate(${-u/2+h}, ${u/2})`);return n&&f.attr("style",n),pt(t,f),t.calcIntersect=function(m,g){let y=m.width,v=[{x:y/2,y:0},{x:y,y:-y/2},{x:y/2,y:-y},{x:0,y:-y/2}],x=ht.polygon(m,v,g);return{x:x.x-.5,y:x.y-.5}},t.intersect=function(m){return this.calcIntersect(t,m)},i}var TQe,Ale=F(()=>{"use strict";Kt();nr();Jt();tr();Ch();TQe=o((e,t,r)=>[`M${e+r/2},${t}`,`L${e+r},${t-r/2}`,`L${e+r/2},${t-r}`,`L${e},${t-r/2}`,"Z"].join(" "),"createDecisionBoxPathD");o(Ele,"question")});async function Rle(e,t){let{labelStyles:r,nodeStyles:n}=ct(t);t.labelStyle=r;let i=t.padding??0,a=t.look==="neo"?21:i??0,s=t.look==="neo"?12:i??0,{shapeSvg:l,bbox:u,label:h}=await It(e,t,Dt(t)),d=(t?.width??u.width)+(t.look==="neo"?a*2:a),f=(t?.height??u.height)+(t.look==="neo"?s*2:s),p=-d/2,m=-f/2,g=m/2,y=[{x:p+g,y:m},{x:p,y:0},{x:p+g,y:-m},{x:-p,y:-m},{x:-p,y:m}],{cssStyles:v}=t,x=ut.svg(l),b=dt(t,{});t.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");let T=or(y),k=x.path(T,b),C=l.insert(()=>k,":first-child");return C.attr("class","basic label-container outer-path"),v&&t.look!=="handDrawn"&&C.selectAll("path").attr("style",v),n&&t.look!=="handDrawn"&&C.selectAll("path").attr("style",n),C.attr("transform",`translate(${-g/2},0)`),h.attr("transform",`translate(${-g/2-u.width/2-(u.x-(u.left??0))}, ${-(u.height/2)-(u.y-(u.top??0))})`),pt(t,C),t.intersect=function(w){return ht.polygon(t,y,w)},l}var _le=F(()=>{"use strict";Kt();nr();Jt();tr();o(Rle,"rect_left_inv_arrow")});var CQe,sc,G4=F(()=>{"use strict";ur();Xt();Ls();CQe=o(async(e,t,r,n=!1,i=!1)=>{let a=t||"";typeof a=="object"&&(a=a[0]);let s=Ae(),l=Gr(s);return await Pn(e,a,{style:r,isTitle:n,useHtmlLabels:l,markdown:!1,isNode:i,width:Number.POSITIVE_INFINITY},s)},"createLabel"),sc=CQe});async function Lle(e,t){let{labelStyles:r,nodeStyles:n}=ct(t);t.labelStyle=r;let i;t.cssClasses?i="node "+t.cssClasses:i="node default";let a=e.insert("g").attr("class",i).attr("id",t.domId||t.id),s=a.insert("g"),l=a.insert("g").attr("class","label").attr("style",n),u=t.description,h=t.label,d=await sc(l,h,t.labelStyle,!0,!0),f={width:0,height:0};if(Gr(Ae())){let R=d.children[0],L=et(d);f=R.getBoundingClientRect(),L.attr("width",f.width),L.attr("height",f.height)}Z.info("Text 2",u);let p=u||[],m=d.getBBox(),g=await sc(l,Array.isArray(p)?p.join(" "):p,t.labelStyle,!0,!0),y=g.children[0],v=et(g);f=y.getBoundingClientRect(),v.attr("width",f.width),v.attr("height",f.height);let x=(t.padding||0)/2;et(g).attr("transform","translate( "+(f.width>m.width?0:(m.width-f.width)/2)+", "+(m.height+x+5)+")"),et(d).attr("transform","translate( "+(f.width(Z.debug("Rough node insert CXC",N),I),":first-child"),w=a.insert(()=>(Z.debug("Rough node insert CXC",N),N),":first-child")}else w=s.insert("rect",":first-child"),S=s.insert("line"),w.attr("class","outer title-state").attr("style",n).attr("x",-f.width/2-x).attr("y",-f.height/2-x).attr("width",f.width+(t.padding||0)).attr("height",f.height+(t.padding||0)),S.attr("class","divider").attr("x1",-f.width/2-x).attr("x2",f.width/2+x).attr("y1",-f.height/2-x+m.height+x).attr("y2",-f.height/2-x+m.height+x);return pt(t,w),t.intersect=function(R){return ht.rect(t,R)},a}var Dle=F(()=>{"use strict";$r();Kt();G4();nr();Jt();tr();Xt();km();vt();ur();o(Lle,"rectWithTitle")});async function Ile(e,t,{config:{themeVariables:r}}){let n=r?.radius??5,i={rx:n,ry:n,classes:"",labelPaddingX:(t?.padding??0)*1,labelPaddingY:(t?.padding??0)*1};return ac(e,t,i)}var Mle=F(()=>{"use strict";Sm();o(Ile,"roundedRect")});async function Nle(e,t){let{labelStyles:r,nodeStyles:n}=ct(t);t.labelStyle=r;let i=t.look==="neo"?16:t.padding??0,a=t.look==="neo"?12:t.padding??0,{shapeSvg:s,bbox:l,label:u}=await It(e,t,Dt(t)),h=(t?.width??l.width)+i*2+(t.look==="neo"?Em:Em*2),d=(t?.height??l.height)+a*2,f=h-Em,p=d,m=Em-h/2,g=-d/2,{cssStyles:y}=t,v=ut.svg(s),x=dt(t,{});t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");let b=[{x:m,y:g},{x:m+f,y:g},{x:m+f,y:g+p},{x:m-Em,y:g+p},{x:m-Em,y:g},{x:m,y:g},{x:m,y:g+p}],T=v.polygon(b.map(C=>[C.x,C.y]),x),k=s.insert(()=>T,":first-child");return k.attr("class","basic label-container outer-path").attr("style",kn(y)),n&&t.look!=="handDrawn"&&k.selectAll("path").attr("style",n),y&&t.look!=="handDrawn"&&k.selectAll("path").attr("style",n),u.attr("transform",`translate(${Em/2-l.width/2-(l.x-(l.left??0))}, ${-(l.height/2)-(l.y-(l.top??0))})`),pt(t,k),t.intersect=function(C){return ht.rect(t,C)},s}var Em,Ple=F(()=>{"use strict";Kt();nr();Jt();tr();Qt();Em=8;o(Nle,"shadedProcess")});async function Ole(e,t){let{labelStyles:r,nodeStyles:n}=ct(t);t.labelStyle=r;let i=t.padding??0,a=t.look==="neo"?16:i,s=t.look==="neo"?12:i;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-a*2,10),t.height=Math.max((t?.height??0)/1.5-s*2,10));let{shapeSvg:l,bbox:u,label:h}=await It(e,t,Dt(t)),d=(t?.width?t?.width:u.width)+a*2,f=((t?.height?t?.height:u.height)+s*2)*1.5,p=d,m=f/1.5,g=-p/2,y=-m/2,{cssStyles:v}=t,x=ut.svg(l),b=dt(t,{});t.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");let T=[{x:g,y},{x:g,y:y+m},{x:g+p,y:y+m},{x:g+p,y:y-m/2}],k=or(T),C=x.path(k,b),w=l.insert(()=>C,":first-child");return w.attr("class","basic label-container outer-path"),v&&t.look!=="handDrawn"&&w.selectChildren("path").attr("style",v),n&&t.look!=="handDrawn"&&w.selectChildren("path").attr("style",n),w.attr("transform",`translate(0, ${m/4})`),h.attr("transform",`translate(${-p/2+(t.padding??0)-(u.x-(u.left??0))}, ${-m/4+(t.padding??0)-(u.y-(u.top??0))})`),pt(t,w),t.intersect=function(S){return ht.polygon(t,T,S)},l}var Ble=F(()=>{"use strict";Kt();nr();Jt();tr();o(Ole,"slopedRect")});async function $le(e,t){let r=t.padding??0,n=t.look==="neo"?16:r*2,i=t.look==="neo"?12:r,a={rx:0,ry:0,classes:"",labelPaddingX:t.labelPaddingX??n,labelPaddingY:i};return ac(e,t,a)}var Fle=F(()=>{"use strict";Sm();o($le,"squareRect")});async function zle(e,t){let{labelStyles:r,nodeStyles:n}=ct(t);t.labelStyle=r;let i=t.padding??0,a=t.look==="neo"?20:i,s=t.look==="neo"?12:i,{shapeSvg:l,bbox:u}=await It(e,t,Dt(t)),h=u.height+(t.look==="neo"?s*2:s),d=u.width+h/4+(t.look==="neo"?a*2:a),f=h/2,{cssStyles:p}=t,m=ut.svg(l),g=dt(t,{});t.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");let y=[{x:-d/2+f,y:-h/2},{x:d/2-f,y:-h/2},...Cm(-d/2+f,0,f,50,90,270),{x:d/2-f,y:h/2},...Cm(d/2-f,0,f,50,270,450)],v=or(y),x=m.path(v,g),b=l.insert(()=>x,":first-child");return b.attr("class","basic label-container outer-path"),p&&t.look!=="handDrawn"&&b.selectChildren("path").attr("style",p),n&&t.look!=="handDrawn"&&b.selectChildren("path").attr("style",n),pt(t,b),t.intersect=function(T){return ht.polygon(t,y,T)},l}var Gle=F(()=>{"use strict";Kt();nr();Jt();tr();o(zle,"stadium")});async function Vle(e,t){let r={rx:t.look==="neo"?3:5,ry:t.look==="neo"?3:5,classes:"flowchart-node"};return ac(e,t,r)}var Wle=F(()=>{"use strict";Sm();o(Vle,"state")});function qle(e,t,{config:{themeVariables:r}}){let{labelStyles:n,nodeStyles:i}=ct(t);t.labelStyle=n;let{cssStyles:a}=t,{lineColor:s,stateBorder:l,nodeBorder:u,nodeShadow:h}=r;(t.width||t.height)&&((t.width??0)<14&&(t.width=14),(t.height??0)<14&&(t.height=14)),t.width||(t.width=14),t.height||(t.height=14);let d=e.insert("g").attr("class","node default").attr("id",t.domId??t.id),f=ut.svg(d),p=dt(t,{});t.look!=="handDrawn"&&(p.roughness=0,p.fillStyle="solid");let m=f.circle(0,0,t.width,{...p,stroke:s,strokeWidth:2}),g=l??u,y=(t.width??0)*5/14,v=f.circle(0,0,y,{...p,fill:g,stroke:g,strokeWidth:2,fillStyle:"solid"}),x=d.insert(()=>m,":first-child");if(x.insert(()=>v),t.look!=="handDrawn"&&x.attr("class","outer-path"),a&&x.selectAll("path").attr("style",a),i&&x.selectAll("path").attr("style",i),t.width<25&&h&&t.look!=="handDrawn"){let b=e.node()?.ownerSVGElement?.id??"",T=b?`${b}-drop-shadow-small`:"drop-shadow-small";x.attr("style",`filter:url(#${T})`)}return pt(t,x),t.intersect=function(b){return ht.circle(t,(t.width??0)/2,b)},d}var Hle=F(()=>{"use strict";tr();nr();Jt();Kt();o(qle,"stateEnd")});function Ule(e,t,{config:{themeVariables:r}}){let{lineColor:n,nodeShadow:i}=r;(t.width||t.height)&&((t.width??0)<14&&(t.width=14),(t.height??0)<14&&(t.height=14)),t.width||(t.width=14),t.height||(t.height=14);let a=e.insert("g").attr("class","node default").attr("id",t.domId||t.id),s;if(t.look==="handDrawn"){let u=ut.svg(a).circle(0,0,t.width,qse(n));s=a.insert(()=>u),s.attr("class","state-start").attr("r",(t.width??7)/2).attr("width",t.width??14).attr("height",t.height??14)}else s=a.insert("circle",":first-child"),s.attr("class","state-start").attr("r",(t.width??7)/2).attr("width",t.width??14).attr("height",t.height??14);if(t.width<25&&i&&t.look!=="handDrawn"){let l=e.node()?.ownerSVGElement?.id??"",u=l?`${l}-drop-shadow-small`:"drop-shadow-small";s.attr("style",`filter:url(#${u})`)}return pt(t,s),t.intersect=function(l){return ht.circle(t,(t.width??7)/2,l)},a}var Yle=F(()=>{"use strict";tr();nr();Jt();Kt();o(Ule,"stateStart")});async function jle(e,t){let{labelStyles:r,nodeStyles:n}=ct(t);t.labelStyle=r;let i=t?.padding??8,a=t.look==="neo"?28:i,s=t.look==="neo"?12:i,{shapeSvg:l,bbox:u}=await It(e,t,Dt(t)),h=(t?.width??u.width)+2*Gy+a,d=(t?.height??u.height)+s,f=h-2*Gy,p=d,m=-h/2,g=-d/2,y=[{x:0,y:0},{x:f,y:0},{x:f,y:-p},{x:0,y:-p},{x:0,y:0},{x:-8,y:0},{x:f+8,y:0},{x:f+8,y:-p},{x:-8,y:-p},{x:-8,y:0}];if(t.look==="handDrawn"){let v=ut.svg(l),x=dt(t,{}),b=v.rectangle(m,g,f+16,p,x),T=v.line(m+Gy,g,m+Gy,g+p,x),k=v.line(m+Gy+f,g,m+Gy+f,g+p,x);l.insert(()=>T,":first-child"),l.insert(()=>k,":first-child");let C=l.insert(()=>b,":first-child"),{cssStyles:w}=t;C.attr("class","basic label-container").attr("style",kn(w)),pt(t,C)}else{let v=as(l,f,p,y);n&&v.attr("style",n),pt(t,v)}return t.intersect=function(v){return ht.polygon(t,y,v)},l}var Gy,Xle=F(()=>{"use strict";Kt();nr();Jt();tr();Ch();Qt();Gy=8;o(jle,"subroutine")});async function Kle(e,t){let{labelStyles:r,nodeStyles:n}=ct(t);t.labelStyle=r;let i=t.padding??0,a=t.look==="neo"?16:i,s=t.look==="neo"?12:i;(t.width||t.height)&&(t.height=Math.max((t?.height??0)-s*2,10),t.width=Math.max((t?.width??0)-a*2-dO*(t.height+s*2),10));let{shapeSvg:l,bbox:u}=await It(e,t,Dt(t)),h=(t?.height?t?.height:u.height)+s*2,d=dO*h,f=dO*h,m=(t?.width?t?.width:u.width)+a*2+d-d,g=h,y=-m/2,v=-g/2,{cssStyles:x}=t,b=ut.svg(l),T=dt(t,{}),k=[{x:y-d/2,y:v},{x:y+m+d/2,y:v},{x:y+m+d/2,y:v+g},{x:y-d/2,y:v+g}],C=[{x:y+m-d/2,y:v+g},{x:y+m+d/2,y:v+g},{x:y+m+d/2,y:v+g-f}];t.look!=="handDrawn"&&(T.roughness=0,T.fillStyle="solid");let w=or(k),S=b.path(w,T),R=or(C),L=b.path(R,{...T,fillStyle:"solid"}),N=l.insert(()=>L,":first-child");return N.insert(()=>S,":first-child"),N.attr("class","basic label-container outer-path"),x&&t.look!=="handDrawn"&&N.selectAll("path").attr("style",x),n&&t.look!=="handDrawn"&&N.selectAll("path").attr("style",n),pt(t,N),t.intersect=function(I){return ht.polygon(t,k,I)},l}var dO,Zle=F(()=>{"use strict";Kt();Jt();tr();nr();dO=.2;o(Kle,"taggedRect")});async function Qle(e,t){let{labelStyles:r,nodeStyles:n}=ct(t);t.labelStyle=r;let{shapeSvg:i,bbox:a,label:s}=await It(e,t,Dt(t)),l=Math.max(a.width+(t.padding??0)*2,t?.width??0),u=Math.max(a.height+(t.padding??0)*2,t?.height??0),h=u/8,d=.2*l,f=.2*u,p=u+h,{cssStyles:m}=t,g=ut.svg(i),y=dt(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");let v=[{x:-l/2-l/2*.1,y:p/2},...fl(-l/2-l/2*.1,p/2,l/2+l/2*.1,p/2,h,.8),{x:l/2+l/2*.1,y:-p/2},{x:-l/2-l/2*.1,y:-p/2}],x=-l/2+l/2*.1,b=-p/2-f*.4,T=[{x:x+l-d,y:(b+u)*1.3},{x:x+l,y:b+u-f},{x:x+l,y:(b+u)*.9},...fl(x+l,(b+u)*1.25,x+l-d,(b+u)*1.3,-u*.02,.5)],k=or(v),C=g.path(k,y),w=or(T),S=g.path(w,{...y,fillStyle:"solid"}),R=i.insert(()=>S,":first-child");return R.insert(()=>C,":first-child"),R.attr("class","basic label-container outer-path"),m&&t.look!=="handDrawn"&&R.selectAll("path").attr("style",m),n&&t.look!=="handDrawn"&&R.selectAll("path").attr("style",n),R.attr("transform",`translate(0,${-h/2})`),s.attr("transform",`translate(${-l/2+(t.padding??0)-(a.x-(a.left??0))},${-u/2+(t.padding??0)-h/2-(a.y-(a.top??0))})`),pt(t,R),t.intersect=function(L){return ht.polygon(t,v,L)},i}var Jle=F(()=>{"use strict";Kt();nr();tr();Jt();o(Qle,"taggedWaveEdgedRectangle")});async function ece(e,t){let{labelStyles:r,nodeStyles:n}=ct(t);t.labelStyle=r;let{shapeSvg:i,bbox:a}=await It(e,t,Dt(t)),s=Math.max(a.width+(t.padding??0),t?.width||0),l=Math.max(a.height+(t.padding??0),t?.height||0),u=-s/2,h=-l/2,d=i.insert("rect",":first-child");return d.attr("class","text").attr("style",n).attr("rx",0).attr("ry",0).attr("x",u).attr("y",h).attr("width",s).attr("height",l),pt(t,d),t.intersect=function(f){return ht.rect(t,f)},i}var tce=F(()=>{"use strict";Kt();nr();Jt();o(ece,"text")});async function ice(e,t){let{labelStyles:r,nodeStyles:n}=ct(t);t.labelStyle=r;let i=t.padding??0,a=t.look==="neo"?12:i/2;if(t.width||t.height){let y=t.height??0;t.height=(t.height??0)-a,t.heightT,":first-child"),g=s.insert(()=>b,":first-child"),g.attr("class","basic label-container"),m&&g.attr("style",m)}else{let y=wQe(0,0,p,h,f,d);g=s.insert("path",":first-child").attr("d",y).attr("class","basic label-container").attr("style",kn(m)).attr("style",n),g.attr("class","basic label-container outer-path"),m&&g.selectAll("path").attr("style",m),n&&g.selectAll("path").attr("style",n)}return g.attr("label-offset-x",f),g.attr("transform",`translate(${-p/2}, ${h/2} )`),u.attr("transform",`translate(${-(l.width/2)-f-(l.x-(l.left??0))}, ${-(l.height/2)-(l.y-(l.top??0))})`),pt(t,g),t.intersect=function(y){let v=ht.rect(t,y),x=v.y-(t.y??0);if(d!=0&&(Math.abs(x)<(t.height??0)/2||Math.abs(x)==(t.height??0)/2&&Math.abs(v.x-(t.x??0))>(t.width??0)/2-f)){let b=f*f*(1-x*x/(d*d));b!=0&&(b=Math.sqrt(Math.abs(b))),b=f-b,y.x-(t.x??0)>0&&(b=-b),v.x+=b}return v},s}var wQe,kQe,SQe,rce,nce,ace=F(()=>{"use strict";Kt();Jt();tr();nr();Qt();wQe=o((e,t,r,n,i,a)=>`M${e},${t}
+ a${i},${a} 0,0,1 0,${-n}
+ l${r},0
+ a${i},${a} 0,0,1 0,${n}
+ M${r},${-n}
+ a${i},${a} 0,0,0 0,${n}
+ l${-r},0`,"createCylinderPathD"),kQe=o((e,t,r,n,i,a)=>[`M${e},${t}`,`M${e+r},${t}`,`a${i},${a} 0,0,0 0,${-n}`,`l${-r},0`,`a${i},${a} 0,0,0 0,${n}`,`l${r},0`].join(" "),"createOuterCylinderPathD"),SQe=o((e,t,r,n,i,a)=>[`M${e+r/2},${-n/2}`,`a${i},${a} 0,0,0 0,${n}`].join(" "),"createInnerCylinderPathD"),rce=5,nce=10;o(ice,"tiltedCylinder")});async function sce(e,t){let{labelStyles:r,nodeStyles:n}=ct(t);t.labelStyle=r;let i=t.padding??0,a=(t.look==="neo",i),s=t.look==="neo"?i*2:i,{shapeSvg:l,bbox:u}=await It(e,t,Dt(t)),h=(t?.height??u.height)+a,d=(t?.width??u.width)+s,f=[{x:-3*h/6,y:0},{x:d+3*h/6,y:0},{x:d,y:-h},{x:0,y:-h}],p,{cssStyles:m}=t;if(t.look==="handDrawn"){let g=ut.svg(l),y=dt(t,{}),v=or(f),x=g.path(v,y);p=l.insert(()=>x,":first-child").attr("transform",`translate(${-d/2}, ${h/2})`),m&&p.attr("style",m)}else p=as(l,d,h,f);return n&&p.attr("style",n),t.width=d,t.height=h,pt(t,p),t.intersect=function(g){return ht.polygon(t,f,g)},l}var oce=F(()=>{"use strict";Kt();nr();Jt();tr();Ch();o(sce,"trapezoid")});async function lce(e,t){let{labelStyles:r,nodeStyles:n}=ct(t);t.labelStyle=r;let i=t.padding??0,a=t.look==="neo"?16:i,s=t.look==="neo"?12:i,l=15,u=5;(t.width||t.height)&&(t.height=(t.height??0)-s*2,t.heightb,":first-child");return T.attr("class","basic label-container outer-path"),m&&t.look!=="handDrawn"&&T.selectChildren("path").attr("style",m),n&&t.look!=="handDrawn"&&T.selectChildren("path").attr("style",n),pt(t,T),t.intersect=function(k){return ht.polygon(t,v,k)},h}var cce=F(()=>{"use strict";Kt();nr();Jt();tr();o(lce,"trapezoidalPentagon")});async function dce(e,t){let{labelStyles:r,nodeStyles:n}=ct(t);t.labelStyle=r;let i=t.padding??0,a=t.look==="neo"?i*2:i;(t.width||t.height)&&(t.width=((t?.width??0)-a)/2,t.widthb,":first-child").attr("transform",`translate(${-f/2}, ${f/2})`).attr("class","outer-path");return g&&t.look!=="handDrawn"&&T.selectChildren("path").attr("style",g),n&&t.look!=="handDrawn"&&T.selectChildren("path").attr("style",n),t.width=d,t.height=f,pt(t,T),u.attr("transform",`translate(${-l.width/2-(l.x-(l.left??0))}, ${f/2-(l.height+(t.padding??0)/(h?2:1)-(l.y-(l.top??0)))})`),t.intersect=function(k){return Z.info("Triangle intersect",t,m,k),ht.polygon(t,m,k)},s}var uce,hce,fce=F(()=>{"use strict";vt();Kt();nr();Jt();tr();Kt();Vr();Xt();uce=10,hce=10;o(dce,"triangle")});async function pce(e,t){let{labelStyles:r,nodeStyles:n}=ct(t);t.labelStyle=r;let i=t.padding??0,a=t.look==="neo"?16:i,s=t.look==="neo"?12:i,l=!0;(t.width||t.height)&&(l=!1,t.width=(t?.width??0)-a*2,t.width<10&&(t.width=10),t.height=(t?.height??0)-s*2,t.height<10&&(t.height=10));let{shapeSvg:u,bbox:h,label:d}=await It(e,t,Dt(t)),f=(t?.width?t?.width:h.width)+(a??0)*2,p=(t?.height?t?.height:h.height)+(s??0)*2,m=t.look==="neo"?p/4:p/8,g=p+(l?m:-m),{cssStyles:y}=t,x=14-f,b=x>0?x/2:0,T=ut.svg(u),k=dt(t,{});t.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");let C=[{x:-f/2-b,y:g/2},...fl(-f/2-b,g/2,f/2+b,g/2,m,.8),{x:f/2+b,y:-g/2},{x:-f/2-b,y:-g/2}],w=or(C),S=T.path(w,k),R=u.insert(()=>S,":first-child");return R.attr("class","basic label-container outer-path"),y&&t.look!=="handDrawn"&&R.selectAll("path").attr("style",y),n&&t.look!=="handDrawn"&&R.selectAll("path").attr("style",n),R.attr("transform",`translate(0,${-m/2})`),d.attr("transform",`translate(${-f/2+(t.padding??0)-(h.x-(h.left??0))},${-p/2+(t.padding??0)-m-(h.y-(h.top??0))})`),pt(t,R),t.intersect=function(L){return ht.polygon(t,C,L)},u}var mce=F(()=>{"use strict";Kt();nr();tr();Jt();o(pce,"waveEdgedRectangle")});async function gce(e,t){let{labelStyles:r,nodeStyles:n}=ct(t);t.labelStyle=r;let i=t.padding??0,a=t.look==="neo"?16:i,s=t.look==="neo"?20:i;if(t.width||t.height){t.width=t?.width??0,t.width<20&&(t.width=20),t.height=t?.height??0,t.height<10&&(t.height=10);let k=Math.min(t.height*.2,t.height/4);t.height=Math.ceil(t.height-s-k*(20/9)),t.width=t.width-a*2}let{shapeSvg:l,bbox:u}=await It(e,t,Dt(t)),h=(t?.width?t?.width:u.width)+a*2,d=(t?.height?t?.height:u.height)+s,f=d/8,p=d+f*2,{cssStyles:m}=t,g=ut.svg(l),y=dt(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");let v=[{x:-h/2,y:p/2},...fl(-h/2,p/2,h/2,p/2,f,1),{x:h/2,y:-p/2},...fl(h/2,-p/2,-h/2,-p/2,f,-1)],x=or(v),b=g.path(x,y),T=l.insert(()=>b,":first-child");return T.attr("class","basic label-container"),m&&t.look!=="handDrawn"&&T.selectAll("path").attr("style",m),n&&t.look!=="handDrawn"&&T.selectAll("path").attr("style",n),pt(t,T),t.intersect=function(k){return ht.polygon(t,v,k)},l}var yce=F(()=>{"use strict";Kt();nr();Jt();tr();o(gce,"waveRectangle")});async function vce(e,t){let{labelStyles:r,nodeStyles:n}=ct(t);t.labelStyle=r;let i=t.look==="neo"?16:t.padding??0,a=t.look==="neo"?12:t.padding??0;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-i*2-Ri,10),t.height=Math.max((t?.height??0)-a*2-Ri,10));let{shapeSvg:s,bbox:l,label:u}=await It(e,t,Dt(t)),h=(t?.width?t?.width:l.width)+i*2+Ri,d=(t?.height?t?.height:l.height)+a*2+Ri,f=h-Ri,p=d-Ri,m=-f/2,g=-p/2,{cssStyles:y}=t,v=ut.svg(s),x=dt(t,{}),b=[{x:m-Ri,y:g-Ri},{x:m-Ri,y:g+p},{x:m+f,y:g+p},{x:m+f,y:g-Ri}],T=`M${m-Ri},${g-Ri} L${m+f},${g-Ri} L${m+f},${g+p} L${m-Ri},${g+p} L${m-Ri},${g-Ri}
+ M${m-Ri},${g} L${m+f},${g}
+ M${m},${g-Ri} L${m},${g+p}`;t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");let k=v.path(T,x),C=s.insert(()=>k,":first-child");return C.attr("transform",`translate(${Ri/2}, ${Ri/2})`),C.attr("class","basic label-container outer-path"),y&&t.look!=="handDrawn"&&C.selectAll("path").attr("style",y),n&&t.look!=="handDrawn"&&C.selectAll("path").attr("style",n),u.attr("transform",`translate(${-(l.width/2)+Ri/2-(l.x-(l.left??0))}, ${-(l.height/2)+Ri/2-(l.y-(l.top??0))})`),pt(t,C),t.intersect=function(w){return ht.polygon(t,b,w)},s}var Ri,xce=F(()=>{"use strict";Kt();Jt();tr();nr();Ri=10;o(vce,"windowPane")});async function fO(e,t){let r=t;r.alias&&(t.label=r.alias);let{theme:n,themeVariables:i}=_t(),{rowEven:a,rowOdd:s,nodeBorder:l,borderColorArray:u}=i;if(t.look==="handDrawn"){let{themeVariables:Q}=_t(),{background:U}=Q,oe={...t,id:t.id+"-background",domId:(t.domId||t.id)+"-background",look:"default",cssStyles:["stroke: none",`fill: ${U}`]};await fO(e,oe)}let h=_t();t.useHtmlLabels=h.htmlLabels;let d=h.er?.diagramPadding??10,f=h.er?.entityPadding??6,{cssStyles:p}=t,{labelStyles:m,nodeStyles:g}=ct(t);if(r.attributes.length===0&&t.label){let Q={rx:0,ry:0,labelPaddingX:d,labelPaddingY:d*1.5,classes:""};Ca(t.label,h)+Q.labelPaddingX*20){let Q=x.width+d*2-(C+w+S+R);C+=Q/I,w+=Q/I,S>0&&(S+=Q/I),R>0&&(R+=Q/I)}let A=C+w+S+R,M=ut.svg(v),D=dt(t,{});t.look!=="handDrawn"&&(D.roughness=0,D.fillStyle="solid");let P=0;k.length>0&&(P=k.reduce((Q,U)=>Q+(U?.rowHeight??0),0));let B=Math.max(_.width+d*2,t?.width||0,A),O=Math.max((P??0)+x.height,t?.height||0),$=-B/2,V=-O/2;if(v.selectAll("g:not(:first-child)").each((Q,U,oe)=>{let te=et(oe[U]),le=te.attr("transform"),ie=0,ae=0;if(le){let be=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(le);be&&(ie=parseFloat(be[1]),ae=parseFloat(be[2]),te.attr("class").includes("attribute-name")?ie+=C:te.attr("class").includes("attribute-keys")?ie+=C+w:te.attr("class").includes("attribute-comment")&&(ie+=C+w+S))}te.attr("transform",`translate(${$+d/2+ie}, ${ae+V+x.height+f/2})`)}),v.select(".name").attr("transform","translate("+-x.width/2+", "+(V+f/2)+")"),n!=null&&bce.has(n)){let Q=r.colorIndex??0;v.attr("data-color-id",`color-${Q%u.length}`)}let G=M.rectangle($,V,B,O,D),z=v.insert(()=>G,":first-child").attr("class","outer-path").attr("style",p.join(""));T.push(0);for(let[Q,U]of k.entries()){let te=(Q+1)%2===0&&U.yOffset!==0,le=M.rectangle($,x.height+V+U?.yOffset,B,U?.rowHeight,{...D,fill:te?a:s,stroke:l});v.insert(()=>le,"g.label").attr("style",p.join("")).attr("class",`row-rect-${te?"even":"odd"}`)}let W=1e-4,H=F2($,x.height+V,B+$,x.height+V,W),j=M.polygon(H.map(Q=>[Q.x,Q.y]),D);if(v.insert(()=>j).attr("class","divider"),H=F2(C+$,x.height+V,C+$,O+V,W),j=M.polygon(H.map(Q=>[Q.x,Q.y]),D),v.insert(()=>j).attr("class","divider"),L){let Q=C+w+$;H=F2(Q,x.height+V,Q,O+V,W),j=M.polygon(H.map(U=>[U.x,U.y]),D),v.insert(()=>j).attr("class","divider")}if(N){let Q=C+w+S+$;H=F2(Q,x.height+V,Q,O+V,W),j=M.polygon(H.map(U=>[U.x,U.y]),D),v.insert(()=>j).attr("class","divider")}for(let Q of T){let U=x.height+V+Q;H=F2($,U,B+$,U,W),j=M.polygon(H.map(oe=>[oe.x,oe.y]),D),v.insert(()=>j).attr("class","divider")}if(pt(t,z),g&&t.look!=="handDrawn")if(n!=null&&EQe.has(n))v.selectAll("path").attr("style",g);else{let U=g.split(";")?.filter(oe=>oe.includes("stroke"))?.map(oe=>`${oe}`).join("; ");v.selectAll("path").attr("style",U??""),v.selectAll(".row-rect-even path").attr("style",g)}return t.intersect=function(Q){return ht.rect(t,Q)},v}async function $2(e,t,r,n=0,i=0,a=[],s=""){let l=e.insert("g").attr("class",`label ${a.join(" ")}`).attr("transform",`translate(${n}, ${i})`).attr("style",s);t!==qc(t)&&(t=qc(t),t=t.replaceAll("<","<").replaceAll(">",">"));let u=l.node().appendChild(await Pn(l,t,{width:Ca(t,r)+100,style:s,useHtmlLabels:r.htmlLabels},r));if(t.includes("<")||t.includes(">")){let d=u.children[0];for(d.textContent=d.textContent.replaceAll("<","<").replaceAll(">",">");d.childNodes[0];)d=d.childNodes[0],d.textContent=d.textContent.replaceAll("<","<").replaceAll(">",">")}let h=u.getBBox();if(ya(r.htmlLabels)){let d=u.children[0];d.style.textAlign="start";let f=et(u);h=d.getBoundingClientRect(),f.attr("width",h.width),f.attr("height",h.height)}return h}function F2(e,t,r,n,i){return e===r?[{x:e-i/2,y:t},{x:e+i/2,y:t},{x:r+i/2,y:n},{x:r-i/2,y:n}]:[{x:e,y:t-i/2},{x:e,y:t+i/2},{x:r,y:n+i/2},{x:r,y:n-i/2}]}var bce,EQe,Tce=F(()=>{"use strict";Kt();nr();Jt();tr();Sm();ur();Ls();Vr();$r();Qt();bce=new Set(["redux-color","redux-dark-color"]),EQe=new Set(["redux","redux-dark","redux-color","redux-dark-color"]);o(fO,"erBox");o($2,"addText");o(F2,"lineToPolygon")});async function Cce(e,t,r,n,i=r.class.padding??12){let a=n?0:3,s=e.insert("g").attr("class",Dt(t)).attr("id",t.domId||t.id),l=null,u=null,h=null,d=null,f=0,p=0,m=0;if(l=s.insert("g").attr("class","annotation-group text"),t.annotations.length>0){let b=t.annotations[0];await V4(l,{text:`\xAB${b}\xBB`},0),f=l.node().getBBox().height}u=s.insert("g").attr("class","label-group text"),await V4(u,t,0,["font-weight: bolder"]);let g=u.node().getBBox();p=g.height,h=s.insert("g").attr("class","members-group text");let y=0;for(let b of t.members){let T=await V4(h,b,y,[b.parseClassifier()]);y+=T+a}m=h.node().getBBox().height,m<=0&&(m=i/2),d=s.insert("g").attr("class","methods-group text");let v=0;for(let b of t.methods){let T=await V4(d,b,v,[b.parseClassifier()]);v+=T+a}let x=s.node().getBBox();if(l!==null){let b=l.node().getBBox();l.attr("transform",`translate(${-b.width/2})`)}return u.attr("transform",`translate(${-g.width/2}, ${f})`),x=s.node().getBBox(),h.attr("transform",`translate(0, ${f+p+i*2})`),x=s.node().getBBox(),d.attr("transform",`translate(0, ${f+p+(m?m+i*4:i*2)})`),x=s.node().getBBox(),{shapeSvg:s,bbox:x}}async function V4(e,t,r,n=[]){let i=e.insert("g").attr("class","label").attr("style",n.join("; ")),a=_t(),s="useHtmlLabels"in t?t.useHtmlLabels:ya(a.htmlLabels)??!0,l="";"text"in t?l=t.text:l=t.label,!s&&l.startsWith("\\")&&(l=l.substring(1)),ni(l)&&(s=!0);let u=await Pn(i,ub(Rs(l)),{width:Ca(l,a)+50,classes:"markdown-node-label",useHtmlLabels:s},a),h,d=1;if(s){let f=u.children[0],p=et(u);d=f.innerHTML.split(" ").length,f.innerHTML.includes("")&&(d+=f.innerHTML.split("").length-1);let m=f.getElementsByTagName("img");if(m){let g=l.replace(/ ]*>/g,"").trim()==="";await Promise.all([...m].map(y=>new Promise(v=>{function x(){if(y.style.display="flex",y.style.flexDirection="column",g){let b=a.fontSize?.toString()??window.getComputedStyle(document.body).fontSize,k=parseInt(b,10)*5+"px";y.style.minWidth=k,y.style.maxWidth=k}else y.style.width="100%";v(y)}o(x,"setupImage"),setTimeout(()=>{y.complete&&x()}),y.addEventListener("error",x),y.addEventListener("load",x)})))}h=f.getBoundingClientRect(),p.attr("width",h.width),p.attr("height",h.height)}else{n.includes("font-weight: bolder")&&et(u).selectAll("tspan").attr("font-weight",""),d=u.children.length;let f=u.children[0];(u.textContent===""||u.textContent.includes(">"))&&(f.textContent=l[0]+l.substring(1).replaceAll(">",">").replaceAll("<","<").trim(),l[1]===" "&&(f.textContent=f.textContent[0]+" "+f.textContent.substring(1))),f.textContent==="undefined"&&(f.textContent=""),h=u.getBBox()}return i.attr("transform","translate(0,"+(-h.height/(2*d)+r)+")"),h.height}var wce=F(()=>{"use strict";$r();ur();Kt();Qt();Xt();Ls();Vr();o(Cce,"textHelper");o(V4,"addText")});async function kce(e,t){let r=Ae(),{themeVariables:n}=r,{useGradient:i}=n,a=r.class.padding??12,s=a,l=t.useHtmlLabels??ya(r.htmlLabels)??!0,u=t;u.annotations=u.annotations??[],u.members=u.members??[],u.methods=u.methods??[];let{shapeSvg:h,bbox:d}=await Cce(e,t,r,l,s),{labelStyles:f,nodeStyles:p}=ct(t);t.labelStyle=f,t.cssStyles=u.styles||"";let m=u.styles?.join(";")||p||"";t.cssStyles||(t.cssStyles=m.replaceAll("!important","").split(";"));let g=u.members.length===0&&u.methods.length===0&&!r.class?.hideEmptyMembersBox,y=ut.svg(h),v=dt(t,{});t.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");let x=Math.max(t.width??0,d.width),b=Math.max(t.height??0,d.height),T=(t.height??0)>d.height;u.members.length===0&&u.methods.length===0?b+=s:u.members.length>0&&u.methods.length===0&&(b+=s*2);let k=-x/2,C=-b/2,w=g?a*2:u.members.length===0&&u.methods.length===0?-a:0;T&&(w=a*2);let S=y.rectangle(k-a,C-a-(g?a:u.members.length===0&&u.methods.length===0?-a/2:0),x+2*a,b+2*a+w,v),R=h.insert(()=>S,":first-child");R.attr("class","basic label-container outer-path");let L=R.node().getBBox(),N=h.select(".annotation-group").node().getBBox().height-(g?a/2:0)||0,I=h.select(".label-group").node().getBBox().height-(g?a/2:0)||0,_=h.select(".members-group").node().getBBox().height-(g?a/2:0)||0,A=(N+I+C+a-(C-a-(g?a:u.members.length===0&&u.methods.length===0?-a/2:0)))/2;if(h.selectAll(".text").each((M,D,P)=>{let B=et(P[D]),O=B.attr("transform"),$=0;if(O){let W=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(O);W&&($=parseFloat(W[2]))}let V=$+C+a-(g?a:u.members.length===0&&u.methods.length===0?-a/2:0);if(B.attr("class").includes("methods-group")){let z=Math.max(_,s/2);T?V=Math.max(A,N+I+z+C+s*2+a)+s*2:V=N+I+z+C+s*4+a}u.members.length===0&&u.methods.length===0&&r.class?.hideEmptyMembersBox&&(u.annotations.length>0?V=$-s:V=$),l||(V-=4);let G=k;(B.attr("class").includes("label-group")||B.attr("class").includes("annotation-group"))&&(G=-B.node()?.getBBox().width/2||0,h.selectAll("text").each(function(z,W,H){window.getComputedStyle(H[W]).textAnchor==="middle"&&(G=0)})),B.attr("transform",`translate(${G}, ${V})`)}),u.members.length>0||u.methods.length>0||g){let M=N+I+C+a,D=y.line(L.x,M,L.x+L.width,M+.001,v);h.insert(()=>D).attr("class",`divider${t.look==="neo"&&!i?" neo-line":""}`).attr("style",m)}if(g||u.members.length>0||u.methods.length>0){let M=N+I+_+C+s*2+a,D=y.line(L.x,T?Math.max(A,M):M,L.x+L.width,(T?Math.max(A,M):M)+.001,v);h.insert(()=>D).attr("class",`divider${t.look==="neo"&&!i?" neo-line":""}`).attr("style",m)}if(u.look!=="handDrawn"&&h.selectAll("path").attr("style",m),R.select(":nth-child(2)").attr("style",m),h.selectAll(".divider").select("path").attr("style",m),t.labelStyle?h.selectAll("span").attr("style",t.labelStyle):h.selectAll("span").attr("style",m),!l){let M=RegExp(/color\s*:\s*([^;]*)/),D=M.exec(m);if(D){let P=D[0].replace("color","fill");h.selectAll("tspan").attr("style",P)}else if(f){let P=M.exec(f);if(P){let B=P[0].replace("color","fill");h.selectAll("tspan").attr("style",B)}}}return pt(t,R),t.intersect=function(M){return ht.rect(t,M)},h}var Sce=F(()=>{"use strict";Kt();Xt();$r();tr();Jt();nr();wce();Vr();o(kce,"classBox")});async function Ece(e,t){let{labelStyles:r,nodeStyles:n}=ct(t);t.labelStyle=r;let i=t,a=t,s=20,l=20,u="verifyMethod"in t,h=Dt(t),{themeVariables:d}=Ae(),{borderColorArray:f,requirementEdgeLabelBackground:p}=d,m=e.insert("g").attr("class",h).attr("id",t.domId??t.id),g;u?g=await wh(m,`<<${i.type}>>`,0,t.labelStyle):g=await wh(m,"<<Element>>",0,t.labelStyle);let y=g,v=await wh(m,i.name,y,t.labelStyle+"; font-weight: bold;");if(y+=v+l,u){let L=await wh(m,`${i.requirementId?`ID: ${i.requirementId}`:""}`,y,t.labelStyle);y+=L;let N=await wh(m,`${i.text?`Text: ${i.text}`:""}`,y,t.labelStyle);y+=N;let I=await wh(m,`${i.risk?`Risk: ${i.risk}`:""}`,y,t.labelStyle);y+=I,await wh(m,`${i.verifyMethod?`Verification: ${i.verifyMethod}`:""}`,y,t.labelStyle)}else{let L=await wh(m,`${a.type?`Type: ${a.type}`:""}`,y,t.labelStyle);y+=L,await wh(m,`${a.docRef?`Doc Ref: ${a.docRef}`:""}`,y,t.labelStyle)}let x=(m.node()?.getBBox().width??200)+s,b=(m.node()?.getBBox().height??200)+s,T=-x/2,k=-b/2,C=ut.svg(m),w=dt(t,{});t.look!=="handDrawn"&&(w.roughness=0,w.fillStyle="solid");let S=C.rectangle(T,k,x,b,w),R=m.insert(()=>S,":first-child");if(R.attr("class","basic label-container outer-path").attr("style",n),f?.length){let L=t.colorIndex??0;m.attr("data-color-id",`color-${L%f.length}`)}if(m.selectAll(".label").each((L,N,I)=>{let _=et(I[N]),A=_.attr("transform"),M=0,D=0;if(A){let $=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(A);$&&(M=parseFloat($[1]),D=parseFloat($[2]))}let P=D-b/2,B=T+s/2;(N===0||N===1)&&(B=M),_.attr("transform",`translate(${B}, ${P+s})`)}),y>g+v+l){let L=k+g+v+l,N;if(t.look==="neo"){let A=[[T,L],[T+x,L],[T+x,L+.001],[T,L+.001]];N=C.polygon(A,w)}else N=C.line(T,L,T+x,L,w);m.insert(()=>N).attr("class","divider")}return pt(t,R),t.intersect=function(L){return ht.rect(t,L)},n&&t.look!=="handDrawn"&&(p||f?.length)&&m.selectAll("path").attr("style",n),m}async function wh(e,t,r,n=""){if(t==="")return 0;let i=e.insert("g").attr("class","label").attr("style",n),a=Ae(),s=a.htmlLabels??!0,l=await Pn(i,ub(Rs(t)),{width:Ca(t,a)+50,classes:"markdown-node-label",useHtmlLabels:s,style:n},a),u;if(s){let h=l.children[0],d=et(l);u=h.getBoundingClientRect(),d.attr("width",u.width),d.attr("height",u.height)}else{let h=l.children[0];for(let d of h.children)n&&d.setAttribute("style",n);u=l.getBBox(),u.height+=6}return i.attr("transform",`translate(${-u.width/2},${-u.height/2+r})`),u.height}var Ace=F(()=>{"use strict";Kt();nr();Jt();tr();Qt();Xt();Ls();$r();o(Ece,"requirementBox");o(wh,"addText")});async function Rce(e,t,{config:r}){let{labelStyles:n,nodeStyles:i}=ct(t);t.labelStyle=n||"";let a=10,s=t.width;t.width=(t.width??200)-10;let{shapeSvg:l,bbox:u,label:h}=await It(e,t,Dt(t)),d=t.padding||10,f="",p;"ticket"in t&&t.ticket&&r?.kanban?.ticketBaseUrl&&(f=r?.kanban?.ticketBaseUrl.replace("#TICKET#",t.ticket),p=l.insert("svg:a",":first-child").attr("class","kanban-ticket-link").attr("xlink:href",f).attr("target","_blank"));let m={useHtmlLabels:t.useHtmlLabels,labelStyle:t.labelStyle||"",width:t.width,img:t.img,padding:t.padding||8,centerLabel:!1},g,y;p?{label:g,bbox:y}=await A4(p,"ticket"in t&&t.ticket||"",m):{label:g,bbox:y}=await A4(l,"ticket"in t&&t.ticket||"",m);let{label:v,bbox:x}=await A4(l,"assigned"in t&&t.assigned||"",m);t.width=s;let b=10,T=t?.width||0,k=Math.max(y.height,x.height)/2,C=Math.max(u.height+b*2,t?.height||0)+k,w=-T/2,S=-C/2;h.attr("transform","translate("+(d-T/2)+", "+(-k-u.height/2)+")"),g.attr("transform","translate("+(d-T/2)+", "+(-k+u.height/2)+")"),v.attr("transform","translate("+(d+T/2-x.width-2*a)+", "+(-k+u.height/2)+")");let R,{rx:L,ry:N}=t,{cssStyles:I}=t;if(t.look==="handDrawn"){let _=ut.svg(l),A=dt(t,{}),M=L||N?_.path(io(w,S,T,C,L||0),A):_.rectangle(w,S,T,C,A);R=l.insert(()=>M,":first-child"),R.attr("class","basic label-container").attr("style",I||null)}else{R=l.insert("rect",":first-child"),R.attr("class","basic label-container __APA__").attr("style",i).attr("rx",L??5).attr("ry",N??5).attr("x",w).attr("y",S).attr("width",T).attr("height",C);let _="priority"in t&&t.priority;if(_){let A=l.append("line"),M=w+2,D=S+Math.floor((L??0)/2),P=S+C-Math.floor((L??0)/2);A.attr("x1",M).attr("y1",D).attr("x2",M).attr("y2",P).attr("stroke-width","4").attr("stroke",AQe(_))}}return pt(t,R),t.height=C,t.intersect=function(_){return ht.rect(t,_)},l}var AQe,_ce=F(()=>{"use strict";Kt();nr();km();Jt();tr();AQe=o(e=>{switch(e){case"Very High":return"red";case"High":return"orange";case"Medium":return null;case"Low":return"blue";case"Very Low":return"lightblue"}},"colorFromPriority");o(Rce,"kanbanItem")});async function Lce(e,t){let{labelStyles:r,nodeStyles:n}=ct(t);t.labelStyle=r;let{shapeSvg:i,bbox:a,halfPadding:s,label:l}=await It(e,t,Dt(t)),u=a.width+10*s,h=a.height+8*s,d=.15*u,{cssStyles:f}=t,p=a.width+20,m=a.height+20,g=Math.max(u,p),y=Math.max(h,m);l.attr("transform",`translate(${-a.width/2}, ${-a.height/2})`);let v,x=`M0 0
+ a${d},${d} 1 0,0 ${g*.25},${-1*y*.1}
+ a${d},${d} 1 0,0 ${g*.25},0
+ a${d},${d} 1 0,0 ${g*.25},0
+ a${d},${d} 1 0,0 ${g*.25},${y*.1}
+
+ a${d},${d} 1 0,0 ${g*.15},${y*.33}
+ a${d*.8},${d*.8} 1 0,0 0,${y*.34}
+ a${d},${d} 1 0,0 ${-1*g*.15},${y*.33}
+
+ a${d},${d} 1 0,0 ${-1*g*.25},${y*.15}
+ a${d},${d} 1 0,0 ${-1*g*.25},0
+ a${d},${d} 1 0,0 ${-1*g*.25},0
+ a${d},${d} 1 0,0 ${-1*g*.25},${-1*y*.15}
+
+ a${d},${d} 1 0,0 ${-1*g*.1},${-1*y*.33}
+ a${d*.8},${d*.8} 1 0,0 0,${-1*y*.34}
+ a${d},${d} 1 0,0 ${g*.1},${-1*y*.33}
+ H0 V0 Z`;if(t.look==="handDrawn"){let b=ut.svg(i),T=dt(t,{}),k=b.path(x,T);v=i.insert(()=>k,":first-child"),v.attr("class","basic label-container").attr("style",kn(f))}else v=i.insert("path",":first-child").attr("class","basic label-container").attr("style",n).attr("d",x);return v.attr("transform",`translate(${-g/2}, ${-y/2})`),pt(t,v),t.calcIntersect=function(b,T){return ht.rect(b,T)},t.intersect=function(b){return Z.info("Bang intersect",t,b),ht.rect(t,b)},i}var Dce=F(()=>{"use strict";vt();Kt();nr();Jt();tr();Qt();o(Lce,"bang")});async function Ice(e,t){let{labelStyles:r,nodeStyles:n}=ct(t);t.labelStyle=r;let{shapeSvg:i,bbox:a,halfPadding:s,label:l}=await It(e,t,Dt(t)),u=a.width+2*s,h=a.height+2*s,d=.15*u,f=.25*u,p=.35*u,m=.2*u,{cssStyles:g}=t,y,v=`M0 0
+ a${d},${d} 0 0,1 ${u*.25},${-1*u*.1}
+ a${p},${p} 1 0,1 ${u*.4},${-1*u*.1}
+ a${f},${f} 1 0,1 ${u*.35},${u*.2}
+
+ a${d},${d} 1 0,1 ${u*.15},${h*.35}
+ a${m},${m} 1 0,1 ${-1*u*.15},${h*.65}
+
+ a${f},${d} 1 0,1 ${-1*u*.25},${u*.15}
+ a${p},${p} 1 0,1 ${-1*u*.5},0
+ a${d},${d} 1 0,1 ${-1*u*.25},${-1*u*.15}
+
+ a${d},${d} 1 0,1 ${-1*u*.1},${-1*h*.35}
+ a${m},${m} 1 0,1 ${u*.1},${-1*h*.65}
+ H0 V0 Z`;if(t.look==="handDrawn"){let x=ut.svg(i),b=dt(t,{}),T=x.path(v,b);y=i.insert(()=>T,":first-child"),y.attr("class","basic label-container").attr("style",kn(g))}else y=i.insert("path",":first-child").attr("class","basic label-container").attr("style",n).attr("d",v);return l.attr("transform",`translate(${-a.width/2}, ${-a.height/2})`),y.attr("transform",`translate(${-u/2}, ${-h/2})`),pt(t,y),t.calcIntersect=function(x,b){return ht.rect(x,b)},t.intersect=function(x){return Z.info("Cloud intersect",t,x),ht.rect(t,x)},i}var Mce=F(()=>{"use strict";tr();vt();Qt();nr();Jt();Kt();o(Ice,"cloud")});async function Nce(e,t){let{labelStyles:r,nodeStyles:n}=ct(t);t.labelStyle=r;let{shapeSvg:i,bbox:a,halfPadding:s,label:l}=await It(e,t,Dt(t)),u=a.width+8*s,h=a.height+2*s,d=5,f=t.look==="neo"?`
+ M${-u/2} ${h/2-d}
+ v${-h+2*d}
+ q0,-${d} ${d},-${d}
+ h${u-2*d}
+ q${d},0 ${d},${d}
+ v${h-d}
+ H${-u/2}
+ Z
+ `:`
+ M${-u/2} ${h/2-d}
+ v${-h+2*d}
+ q0,-${d} ${d},-${d}
+ h${u-2*d}
+ q${d},0 ${d},${d}
+ v${h-2*d}
+ q0,${d} ${-d},${d}
+ h${-(u-2*d)}
+ q${-d},0 ${-d},${-d}
+ Z
+ `;if(!t.domId)throw new Error(`defaultMindmapNode: node "${t.id}" is missing a domId \u2014 was render.ts domId prefixing skipped?`);let p=i.append("path").attr("id",t.domId).attr("class","node-bkg node-"+t.type).attr("style",n).attr("d",f);return i.append("line").attr("class","node-line-").attr("x1",-u/2).attr("y1",h/2).attr("x2",u/2).attr("y2",h/2),l.attr("transform",`translate(${-a.width/2}, ${-a.height/2})`),i.append(()=>l.node()),pt(t,p),t.calcIntersect=function(m,g){return ht.rect(m,g)},t.intersect=function(m){return ht.rect(t,m)},i}var Pce=F(()=>{"use strict";nr();Jt();Kt();o(Nce,"defaultMindmapNode")});async function Oce(e,t){let r={padding:t.padding??0};return z4(e,t,r)}var Bce=F(()=>{"use strict";hO();o(Oce,"mindmapCircle")});function $ce(e){return e in pO}var RQe,_Qe,pO,mO=F(()=>{"use strict";soe();coe();hoe();foe();hO();moe();yoe();xoe();Toe();woe();Aoe();_oe();Doe();Moe();Poe();Foe();Goe();Woe();Hoe();Yoe();Xoe();Zoe();Joe();tle();nle();ale();ole();cle();hle();fle();yle();xle();Tle();wle();Sle();Ale();_le();Dle();Mle();Ple();Ble();Fle();Gle();Wle();Hle();Yle();Xle();Zle();Jle();tce();ace();oce();cce();fce();mce();yce();xce();Tce();Sce();Ace();_ce();Dce();Mce();Pce();Bce();RQe=[{semanticName:"Process",name:"Rectangle",shortName:"rect",description:"Standard process shape",aliases:["proc","process","rectangle"],internalAliases:["squareRect"],handler:$le},{semanticName:"Event",name:"Rounded Rectangle",shortName:"rounded",description:"Represents an event",aliases:["event"],internalAliases:["roundedRect"],handler:Ile},{semanticName:"Terminal Point",name:"Stadium",shortName:"stadium",description:"Terminal point",aliases:["terminal","pill"],handler:zle},{semanticName:"Subprocess",name:"Framed Rectangle",shortName:"fr-rect",description:"Subprocess",aliases:["subprocess","subproc","framed-rectangle","subroutine"],handler:jle},{semanticName:"Database",name:"Cylinder",shortName:"cyl",description:"Database storage",aliases:["db","database","cylinder"],handler:Eoe},{semanticName:"Data Store",name:"Data Store",shortName:"datastore",description:"Data flow diagram data store",aliases:["data-store"],handler:Roe},{semanticName:"Start",name:"Circle",shortName:"circle",description:"Starting point",aliases:["circ"],handler:z4},{semanticName:"Bang",name:"Bang",shortName:"bang",description:"Bang",aliases:["bang"],handler:Lce},{semanticName:"Cloud",name:"Cloud",shortName:"cloud",description:"cloud",aliases:["cloud"],handler:Ice},{semanticName:"Decision",name:"Diamond",shortName:"diam",description:"Decision-making step",aliases:["decision","diamond","question"],handler:Ele},{semanticName:"Prepare Conditional",name:"Hexagon",shortName:"hex",description:"Preparation or condition step",aliases:["hexagon","prepare"],handler:qoe},{semanticName:"Data Input/Output",name:"Lean Right",shortName:"lean-r",description:"Represents input or output",aliases:["lean-right","in-out"],internalAliases:["lean_right"],handler:ule},{semanticName:"Data Input/Output",name:"Lean Left",shortName:"lean-l",description:"Represents output or input",aliases:["lean-left","out-in"],internalAliases:["lean_left"],handler:lle},{semanticName:"Priority Action",name:"Trapezoid Base Bottom",shortName:"trap-b",description:"Priority action",aliases:["priority","trapezoid-bottom","trapezoid"],handler:sce},{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:ile},{semanticName:"Stop",name:"Double Circle",shortName:"dbl-circ",description:"Represents a stop point",aliases:["double-circle"],internalAliases:["doublecircle"],handler:Ioe},{semanticName:"Text Block",name:"Text Block",shortName:"text",description:"Text block",handler:ece},{semanticName:"Card",name:"Notched Rectangle",shortName:"notch-rect",description:"Represents a card",aliases:["card","notched-rectangle"],handler:uoe},{semanticName:"Lined/Shaded Process",name:"Lined Rectangle",shortName:"lin-rect",description:"Lined process shape",aliases:["lined-rectangle","lined-process","lin-proc","shaded-process"],handler:Nle},{semanticName:"Start",name:"Small Circle",shortName:"sm-circ",description:"Small starting point",aliases:["start","small-circle"],internalAliases:["stateStart"],handler:Ule},{semanticName:"Stop",name:"Framed Circle",shortName:"fr-circ",description:"Stop point",aliases:["stop","framed-circle"],internalAliases:["stateEnd"],handler:qle},{semanticName:"Fork/Join",name:"Filled Rectangle",shortName:"fork",description:"Fork or join in process flow",aliases:["join"],internalAliases:["forkJoin"],handler:zoe},{semanticName:"Collate",name:"Hourglass",shortName:"hourglass",description:"Represents a collate operation",aliases:["hourglass","collate"],handler:Uoe},{semanticName:"Comment",name:"Curly Brace",shortName:"brace",description:"Adds a comment",aliases:["comment","brace-l"],handler:goe},{semanticName:"Comment Right",name:"Curly Brace",shortName:"brace-r",description:"Adds a comment",handler:voe},{semanticName:"Comment with braces on both sides",name:"Curly Braces",shortName:"braces",description:"Adds a comment",handler:boe},{semanticName:"Com Link",name:"Lightning Bolt",shortName:"bolt",description:"Communication link",aliases:["com-link","lightning-bolt"],handler:dle},{semanticName:"Document",name:"Document",shortName:"doc",description:"Represents a document",aliases:["doc","document"],handler:pce},{semanticName:"Delay",name:"Half-Rounded Rectangle",shortName:"delay",description:"Represents a delay",aliases:["half-rounded-rectangle"],handler:Voe},{semanticName:"Direct Access Storage",name:"Horizontal Cylinder",shortName:"h-cyl",description:"Direct access storage",aliases:["das","horizontal-cylinder"],handler:ice},{semanticName:"Disk Storage",name:"Lined Cylinder",shortName:"lin-cyl",description:"Disk storage",aliases:["disk","lined-cylinder"],handler:gle},{semanticName:"Display",name:"Curved Trapezoid",shortName:"curv-trap",description:"Represents a display",aliases:["curved-trapezoid","display"],handler:Coe},{semanticName:"Divided Process",name:"Divided Rectangle",shortName:"div-rect",description:"Divided process shape",aliases:["div-proc","divided-rectangle","divided-process"],handler:Loe},{semanticName:"Extract",name:"Triangle",shortName:"tri",description:"Extraction process",aliases:["extract","triangle"],handler:dce},{semanticName:"Internal Storage",name:"Window Pane",shortName:"win-pane",description:"Internal storage",aliases:["internal-storage","window-pane"],handler:vce},{semanticName:"Junction",name:"Filled Circle",shortName:"f-circ",description:"Junction point",aliases:["junction","filled-circle"],handler:Noe},{semanticName:"Loop Limit",name:"Trapezoidal Pentagon",shortName:"notch-pent",description:"Loop limit step",aliases:["loop-limit","notched-pentagon"],handler:lce},{semanticName:"Manual File",name:"Flipped Triangle",shortName:"flip-tri",description:"Manual file operation",aliases:["manual-file","flipped-triangle"],handler:$oe},{semanticName:"Manual Input",name:"Sloped Rectangle",shortName:"sl-rect",description:"Manual input step",aliases:["manual-input","sloped-rectangle"],handler:Ole},{semanticName:"Multi-Document",name:"Stacked Document",shortName:"docs",description:"Multiple documents",aliases:["documents","st-doc","stacked-document"],handler:Cle},{semanticName:"Multi-Process",name:"Stacked Rectangle",shortName:"st-rect",description:"Multiple processes",aliases:["procs","processes","stacked-rectangle"],handler:ble},{semanticName:"Stored Data",name:"Bow Tie Rectangle",shortName:"bow-rect",description:"Stored data",aliases:["stored-data","bow-tie-rectangle"],handler:loe},{semanticName:"Summary",name:"Crossed Circle",shortName:"cross-circ",description:"Summary",aliases:["summary","crossed-circle"],handler:poe},{semanticName:"Tagged Document",name:"Tagged Document",shortName:"tag-doc",description:"Tagged document",aliases:["tag-doc","tagged-document"],handler:Qle},{semanticName:"Tagged Process",name:"Tagged Rectangle",shortName:"tag-rect",description:"Tagged process",aliases:["tagged-rectangle","tag-proc","tagged-process"],handler:Kle},{semanticName:"Paper Tape",name:"Flag",shortName:"flag",description:"Paper tape",aliases:["paper-tape"],handler:gce},{semanticName:"Odd",name:"Odd",shortName:"odd",description:"Odd shape",internalAliases:["rect_left_inv_arrow"],handler:Rle},{semanticName:"Lined Document",name:"Lined Document",shortName:"lin-doc",description:"Lined document",aliases:["lined-document"],handler:vle}],_Qe=o(()=>{let t=[...Object.entries({state:Vle,choice:doe,note:kle,rectWithTitle:Lle,labelRect:sle,iconSquare:ele,iconCircle:Koe,icon:joe,iconRounded:Qoe,imageSquare:rle,anchor:aoe,kanbanItem:Rce,mindmapCircle:Oce,defaultMindmapNode:Nce,classBox:kce,erBox:fO,requirementBox:Ece}),...RQe.flatMap(r=>[r.shortName,..."aliases"in r?r.aliases:[],..."internalAliases"in r?r.internalAliases:[]].map(i=>[i,r.handler]))];return Object.fromEntries(t)},"generateShapeMap"),pO=_Qe();o($ce,"isValidShape")});var LQe,W4,Fce=F(()=>{"use strict";$r();A2();Xt();vt();mO();Qt();Vr();Nn();Hd();H0();LQe="flowchart-",W4=class{constructor(){this.vertexCounter=0;this.config=Ae();this.diagramId="";this.vertices=new Map;this.edges=[];this.classes=new Map;this.subGraphs=[];this.subGraphLookup=new Map;this.tooltips=new Map;this.subCount=0;this.firstGraphFlag=!0;this.secCount=-1;this.posCrossRef=[];this.funs=[];this.setAccTitle=kr;this.setAccDescription=Rr;this.setDiagramTitle=Or;this.getAccTitle=Ar;this.getAccDescription=_r;this.getDiagramTitle=Lr;this.funs.push(this.setupToolTips.bind(this)),this.addVertex=this.addVertex.bind(this),this.firstGraph=this.firstGraph.bind(this),this.setDirection=this.setDirection.bind(this),this.addSubGraph=this.addSubGraph.bind(this),this.addLink=this.addLink.bind(this),this.setLink=this.setLink.bind(this),this.updateLink=this.updateLink.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.destructLink=this.destructLink.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setTooltip=this.setTooltip.bind(this),this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this),this.setClickFun=this.setClickFun.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen("gen-2")}static{o(this,"FlowDB")}sanitizeText(t){return xt.sanitizeText(t,this.config)}sanitizeNodeLabelType(t){switch(t){case"markdown":case"string":case"text":return t;default:return"markdown"}}setDiagramId(t){this.diagramId=t}lookUpDomId(t){for(let r of this.vertices.values())if(r.id===t)return this.diagramId?`${this.diagramId}-${r.domId}`:r.domId;return this.diagramId?`${this.diagramId}-${t}`:t}addVertex(t,r,n,i,a,s,l={},u){if(!t||t.trim().length===0)return;let h;if(u!==void 0){let m;u.includes(`
+`)?m=u+`
+`:m=`{
+`+u+`
+}`,h=Qd(m,{schema:Zd})}let d=this.edges.find(m=>m.id===t);if(d){let m=h;m?.animate!==void 0&&(d.animate=m.animate),m?.animation!==void 0&&(d.animation=m.animation),m?.curve!==void 0&&(d.interpolate=m.curve);return}let f,p=this.vertices.get(t);if(p===void 0&&(r===void 0&&n===void 0&&i!==void 0&&i!==null&&Z.warn(`Style applied to unknown node "${t}". This may indicate a typo. The node will be created automatically.`),p={id:t,labelType:"text",domId:LQe+t+"-"+this.vertexCounter,styles:[],classes:[]},this.vertices.set(t,p)),this.vertexCounter++,r!==void 0?(this.config=Ae(),f=this.sanitizeText(r.text.trim()),p.labelType=r.type,f.startsWith('"')&&f.endsWith('"')&&(f=f.substring(1,f.length-1)),p.text=f):p.text===void 0&&(p.text=t),n!==void 0&&(p.type=n),i?.forEach(m=>{p.styles.push(m)}),a?.forEach(m=>{p.classes.push(m)}),s!==void 0&&(p.dir=s),p.props===void 0?p.props=l:l!==void 0&&Object.assign(p.props,l),h!==void 0){if(h.shape){if(h.shape!==h.shape.toLowerCase()||h.shape.includes("_"))throw new Error(`No such shape: ${h.shape}. Shape names should be lowercase.`);if(!$ce(h.shape))throw new Error(`No such shape: ${h.shape}.`);p.type=h?.shape}h?.label&&(p.text=h?.label,p.labelType=this.sanitizeNodeLabelType(h?.labelType)),h?.icon&&(p.icon=h?.icon,!h.label?.trim()&&p.text===t&&(p.text="")),h?.form&&(p.form=h?.form),h?.pos&&(p.pos=h?.pos),h?.img&&(p.img=h?.img,!h.label?.trim()&&p.text===t&&(p.text="")),h?.constraint&&(p.constraint=h.constraint),h.w&&(p.assetWidth=Number(h.w)),h.h&&(p.assetHeight=Number(h.h))}}addSingleLink(t,r,n,i){let l={start:t,end:r,type:void 0,text:"",labelType:"text",classes:[],isUserDefinedId:!1,interpolate:this.edges.defaultInterpolate};Z.info("abc78 Got edge...",l);let u=n.text;if(u!==void 0&&(l.text=this.sanitizeText(u.text.trim()),l.text.startsWith('"')&&l.text.endsWith('"')&&(l.text=l.text.substring(1,l.text.length-1)),l.labelType=this.sanitizeNodeLabelType(u.type)),n!==void 0&&(l.type=n.type,l.stroke=n.stroke,l.length=n.length>10?10:n.length),i&&!this.edges.some(h=>h.id===i))l.id=i,l.isUserDefinedId=!0;else{let h=this.edges.filter(d=>d.start===l.start&&d.end===l.end);h.length===0?l.id=eu(l.start,l.end,{counter:0,prefix:"L"}):l.id=eu(l.start,l.end,{counter:h.length+1,prefix:"L"})}if(this.edges.length<(this.config.maxEdges??500))Z.info("Pushing edge..."),this.edges.push(l);else throw new Error(`Edge limit exceeded. ${this.edges.length} edges found, but the limit is ${this.config.maxEdges}.
+
+Initialize mermaid with maxEdges set to a higher number to allow more edges.
+You cannot set this config via configuration inside the diagram as it is a secure config.
+You have to call mermaid.initialize.`)}isLinkData(t){return t!==null&&typeof t=="object"&&"id"in t&&typeof t.id=="string"}addLink(t,r,n){let i=this.isLinkData(n)?n.id.replace("@",""):void 0;Z.info("addLink",t,r,i);for(let a of t)for(let s of r){let l=a===t[t.length-1],u=s===r[0];l&&u?this.addSingleLink(a,s,n,i):this.addSingleLink(a,s,n,void 0)}}updateLinkInterpolate(t,r){t.forEach(n=>{n==="default"?this.edges.defaultInterpolate=r:this.edges[n].interpolate=r})}updateLink(t,r){t.forEach(n=>{if(typeof n=="number"&&n>=this.edges.length)throw new Error(`The index ${n} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${this.edges.length-1}. (Help: Ensure that the index is within the range of existing edges.)`);n==="default"?this.edges.defaultStyle=r:(this.edges[n].style=r,(this.edges[n]?.style?.length??0)>0&&!this.edges[n]?.style?.some(i=>i?.startsWith("fill"))&&this.edges[n]?.style?.push("fill:none"))})}addClass(t,r){let n=r.join().replace(/\\,/g,"\xA7\xA7\xA7").replace(/,/g,";").replace(/§§§/g,",").split(";");t.split(",").forEach(i=>{let a=this.classes.get(i);a===void 0&&(a={id:i,styles:[],textStyles:[]},this.classes.set(i,a)),n?.forEach(s=>{if(/color/.exec(s)){let l=s.replace("fill","bgFill");a.textStyles.push(l)}a.styles.push(s)})})}setDirection(t){this.direction=t.trim(),/.*/.exec(this.direction)&&(this.direction="LR"),/.*v/.exec(this.direction)&&(this.direction="TB"),this.direction==="TD"&&(this.direction="TB")}setClass(t,r){for(let n of t.split(",")){let i=this.vertices.get(n);i&&i.classes.push(r);let a=this.edges.find(l=>l.id===n);a&&a.classes.push(r);let s=this.subGraphLookup.get(n);s&&s.classes.push(r)}}setTooltip(t,r){if(r!==void 0){r=this.sanitizeText(r);for(let n of t.split(","))this.tooltips.set(this.version==="gen-1"?this.lookUpDomId(n):n,r)}}setClickFun(t,r,n){if(Ae().securityLevel!=="loose"||r===void 0)return;let i=[];if(typeof n=="string"){i=n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let s=0;s{let s=this.lookUpDomId(t),l=document.querySelector(`[id="${s}"]`);l!==null&&l.addEventListener("click",()=>{Zt.runFunc(r,...i)},!1)}))}setLink(t,r,n){t.split(",").forEach(i=>{let a=this.vertices.get(i);a!==void 0&&(a.link=Zt.formatUrl(r,this.config),a.linkTarget=n)}),this.setClass(t,"clickable")}getTooltip(t){return this.tooltips.get(t)}setClickEvent(t,r,n){t.split(",").forEach(i=>{this.setClickFun(i,r,n)}),this.setClass(t,"clickable")}bindFunctions(t){this.funs.forEach(r=>{r(t)})}getDirection(){return this.direction?.trim()}getVertices(){return this.vertices}getEdges(){return this.edges}getClasses(){return this.classes}setupToolTips(t){let r=Dy();et(t).select("svg").selectAll("g.node").on("mouseover",a=>{let s=et(a.currentTarget),l=s.attr("title");if(l===null)return;let u=a.currentTarget?.getBoundingClientRect();r.transition().duration(200).style("opacity",".9"),r.text(s.attr("title")).style("left",window.scrollX+u.left+(u.right-u.left)/2+"px").style("top",window.scrollY+u.bottom+"px"),r.html(Zs.sanitize(l)),s.classed("hover",!0)}).on("mouseout",a=>{r.transition().duration(500).style("opacity",0),et(a.currentTarget).classed("hover",!1)})}clear(t="gen-2"){this.vertices=new Map,this.classes=new Map,this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.diagramId="",this.subGraphs=[],this.subGraphLookup=new Map,this.subCount=0,this.tooltips=new Map,this.firstGraphFlag=!0,this.version=t,this.config=Ae(),yr()}setGen(t){this.version=t||"gen-2"}defaultStyle(){return"fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;"}addSubGraph(t,r,n){let i=t.text.trim(),a=n.text;t===n&&/\s/.exec(n.text)&&(i=void 0);let l=o(g=>{let y={boolean:{},number:{},string:{}},v=[],x;return{nodeList:g.filter(function(T){let k=typeof T;return T.stmt&&T.stmt==="dir"?(x=T.value,!1):T.trim()===""?!1:k in y?y[k].hasOwnProperty(T)?!1:y[k][T]=!0:v.includes(T)?!1:v.push(T)}),dir:x}},"uniq")(r.flat()),u=l.nodeList,h=l.dir,d=h!==void 0,f=Ae().flowchart??{},p=h??(f.inheritDir?this.getDirection()??Ae().direction??void 0:void 0);if(this.version==="gen-1")for(let g=0;g2e3)return{result:!1,count:0};if(this.posCrossRef[this.secCount]=r,this.subGraphs[r].id===t)return{result:!0,count:0};let i=0,a=1;for(;i=0){let l=this.indexNodes2(t,s);if(l.result)return{result:!0,count:a+l.count};a=a+l.count}i=i+1}return{result:!1,count:a}}getDepthFirstPos(t){return this.posCrossRef[t]}indexNodes(){this.secCount=-1,this.subGraphs.length>0&&this.indexNodes2("none",this.subGraphs.length-1)}getSubGraphs(){return this.subGraphs}firstGraph(){return this.firstGraphFlag?(this.firstGraphFlag=!1,!0):!1}destructStartLink(t){let r=t.trim(),n="arrow_open";switch(r[0]){case"<":n="arrow_point",r=r.slice(1);break;case"x":n="arrow_cross",r=r.slice(1);break;case"o":n="arrow_circle",r=r.slice(1);break}let i="normal";return r.includes("=")&&(i="thick"),r.includes(".")&&(i="dotted"),{type:n,stroke:i}}countChar(t,r){let n=r.length,i=0;for(let a=0;a":i="arrow_point",r.startsWith("<")&&(i="double_"+i,n=n.slice(1));break;case"o":i="arrow_circle",r.startsWith("o")&&(i="double_"+i,n=n.slice(1));break}let a="normal",s=n.length-1;n.startsWith("=")&&(a="thick"),n.startsWith("~")&&(a="invisible");let l=this.countChar(".",n);return l&&(a="dotted",s=l),{type:i,stroke:a,length:s}}destructLink(t,r){let n=this.destructEndLink(t),i;if(r){if(i=this.destructStartLink(r),i.stroke!==n.stroke)return{type:"INVALID",stroke:"INVALID"};if(i.type==="arrow_open")i.type=n.type;else{if(i.type!==n.type)return{type:"INVALID",stroke:"INVALID"};i.type="double_"+i.type}return i.type==="double_arrow"&&(i.type="double_arrow_point"),i.length=n.length,i}return n}exists(t,r){for(let n of t)if(n.nodes.includes(r))return!0;return!1}makeUniq(t,r){let n=[];return t.nodes.forEach((i,a)=>{this.exists(r,i)||n.push(t.nodes[a])}),{nodes:n}}getTypeFromVertex(t){if(t.img)return"imageSquare";if(t.icon)return t.form==="circle"?"iconCircle":t.form==="square"?"iconSquare":t.form==="rounded"?"iconRounded":"icon";switch(t.type){case"square":case void 0:return"squareRect";case"round":return"roundedRect";case"ellipse":return"ellipse";default:return t.type}}findNode(t,r){return t.find(n=>n.id===r)}destructEdgeType(t){let r="none",n="arrow_point";switch(t){case"arrow_point":case"arrow_circle":case"arrow_cross":n=t;break;case"double_arrow_point":case"double_arrow_circle":case"double_arrow_cross":r=t.replace("double_",""),n=r;break}return{arrowTypeStart:r,arrowTypeEnd:n}}addNodeFromVertex(t,r,n,i,a,s){let l=n.get(t.id),u=i.get(t.id)??!1,h=this.findNode(r,t.id);if(h)h.cssStyles=t.styles,h.cssCompiledStyles=this.getCompiledStyles(t.classes),h.cssClasses=t.classes.join(" ");else{let d={id:t.id,label:t.text,labelType:t.labelType,labelStyle:"",parentId:l,padding:a.flowchart?.padding||8,cssStyles:t.styles,cssCompiledStyles:this.getCompiledStyles(["default","node",...t.classes]),cssClasses:"default "+t.classes.join(" "),dir:t.dir,domId:t.domId,look:s,link:t.link,linkTarget:t.linkTarget,tooltip:this.getTooltip(t.id),icon:t.icon,pos:t.pos,img:t.img,assetWidth:t.assetWidth,assetHeight:t.assetHeight,constraint:t.constraint};u?r.push({...d,isGroup:!0,shape:"rect"}):r.push({...d,isGroup:!1,shape:this.getTypeFromVertex(t)})}}getCompiledStyles(t){let r=[];for(let n of t){let i=this.classes.get(n);i?.styles&&(r=[...r,...i.styles??[]].map(a=>a.trim())),i?.textStyles&&(r=[...r,...i.textStyles??[]].map(a=>a.trim()))}return r}getData(){let t=Ae(),r=[],n=[],i=this.getSubGraphs(),a=new Map,s=new Map;for(let h=i.length-1;h>=0;h--){let d=i[h];d.nodes.length>0&&s.set(d.id,!0);for(let f of d.nodes)a.set(f,d.id)}for(let h=i.length-1;h>=0;h--){let d=i[h];r.push({id:d.id,label:d.title,labelStyle:"",labelType:d.labelType,parentId:a.get(d.id),padding:8,cssCompiledStyles:this.getCompiledStyles(d.classes),cssClasses:d.classes.join(" "),shape:"rect",dir:d.dir==="TD"?"TB":d.dir,explicitDir:d.hasExplicitDir,isGroup:!0,look:t.look})}this.getVertices().forEach(h=>{this.addNodeFromVertex(h,r,a,s,t,t.look||"classic")});let u=this.getEdges();return u.forEach((h,d)=>{let{arrowTypeStart:f,arrowTypeEnd:p}=this.destructEdgeType(h.type),m=[...u.defaultStyle??[]];h.style&&m.push(...h.style);let g={id:eu(h.start,h.end,{counter:d,prefix:"L"},h.id),isUserDefinedId:h.isUserDefinedId,start:h.start,end:h.end,type:h.type??"normal",label:h.text,labelType:h.labelType,labelpos:"c",thickness:h.stroke,minlen:h.length,classes:h?.stroke==="invisible"?"":"edge-thickness-normal edge-pattern-solid flowchart-link",arrowTypeStart:h?.stroke==="invisible"||h?.type==="arrow_open"?"none":f,arrowTypeEnd:h?.stroke==="invisible"||h?.type==="arrow_open"?"none":p,arrowheadStyle:"fill: #333",cssCompiledStyles:this.getCompiledStyles(h.classes),labelStyle:m,style:m,pattern:h.stroke,look:t.look,animate:h.animate,animation:h.animation,curve:h.interpolate||this.edges.defaultInterpolate||t.flowchart?.curve};n.push(g)}),{nodes:r,edges:n,other:{},config:t}}defaultConfig(){return bS.flowchart}}});var pl,Am=F(()=>{"use strict";$r();pl=o((e,t)=>{let r;return t==="sandbox"&&(r=et("#i"+e)),(t==="sandbox"?et(r.nodes()[0].contentDocument.body):et("body")).select(`[id="${e}"]`)},"getDiagramElement")});var oc,Vy=F(()=>{"use strict";oc=o(({flowchart:e})=>{let t=e?.subGraphTitleMargin?.top??0,r=e?.subGraphTitleMargin?.bottom??0,n=t+r;return{subGraphTitleTopMargin:t,subGraphTitleBottomMargin:r,subGraphTitleTotalMargin:n}},"getSubGraphTitleMargins")});var zce,Gce=F(()=>{"use strict";Xt();ur();vt();$r();tr();Ls();_4();Jt();zce=o(async(e,t)=>{let r=Ae(),{themeVariables:n,handDrawnSeed:i}=r,{clusterBkg:a,clusterBorder:s}=n,l=s,{labelStyles:u,nodeStyles:h,borderStyles:d,backgroundStyles:f}=ct(t),p=e.insert("g").attr("class","cluster swimlane "+(t.cssClasses||"")).attr("id",t.id).attr("data-id",t.id).attr("data-et","cluster").attr("data-look",t.look),m=ya(r.flowchart.htmlLabels),g=t.direction==="LR",y=p.insert("g").attr("class","cluster-label swimlane-label"),v=await Pn(y,t.label,{style:t.labelStyle,useHtmlLabels:m,isNode:!0,width:t.width}),x=v.getBBox();if(m){let A=v.children[0],M=et(v);x=A.getBoundingClientRect(),M.attr("width",x.width),M.attr("height",x.height)}let b=t.padding??0,T=t.width<=x.width+b?x.width+b:t.width;t.width<=x.width+b?t.diff=(T-t.width)/2-b:t.diff=-b;let k=t.height,C=t.y-k/2,w=t.y+k/2,S=t.x-T/2,R=t.swimlaneContentTop!==void 0?t.swimlaneContentTop:C+k/3,L=g?4:0,N=x.height+2*L,I,_;if(g){let A=Math.max(N,x.height+2*L),M=S+A,D=Math.max(0,T-A);if(t.look==="handDrawn"){let O=ut.svg(p),$=dt(t,{roughness:.7,fill:a,stroke:l,fillWeight:3,seed:i}),V=dt(t,{roughness:.7,fill:"none",stroke:l,seed:i}),G=O.rectangle(S,C,A,k,$);I=p.insert(()=>G,":first-child");let z=O.rectangle(M,C,D,k,V);_=p.insert(()=>z,":first-child"),I.select("path:nth-child(2)").attr("style",d.join(";")),I.select("path").attr("style",f.join(";").replace("fill","stroke"))}else I=p.insert("rect",":first-child"),_=p.insert("rect",":first-child"),I.attr("class","swimlane-title").attr("style",h).attr("x",S).attr("y",C).attr("width",A).attr("height",k).attr("fill",a).attr("stroke",l),_.attr("class","swimlane-body").attr("style",h).attr("x",M).attr("y",C).attr("width",D).attr("height",k).attr("fill","none").attr("stroke",l);let P=S+A/2,B=t.y;y.attr("transform",`translate(${P}, ${B}) rotate(-90) translate(${-x.width/2}, ${-x.height/2})`)}else{let A=Math.max(0,R-C),M=Math.min(N,A),D=C+M,P=Math.max(0,w-D),B=t.x-T/2;if(t.look==="handDrawn"){let V=ut.svg(p),G=dt(t,{roughness:.7,fill:a,stroke:l,fillWeight:3,seed:i}),z=dt(t,{roughness:.7,fill:"none",stroke:l,seed:i}),W=V.rectangle(B,C,T,M,G);I=p.insert(()=>W,":first-child");let H=V.rectangle(B,D,T,P,z);_=p.insert(()=>H,":first-child"),I.select("path:nth-child(2)").attr("style",d.join(";")),I.select("path").attr("style",f.join(";").replace("fill","stroke"))}else I=p.insert("rect",":first-child"),_=p.insert("rect",":first-child"),I.attr("class","swimlane-title").attr("style",h).attr("x",B).attr("y",C).attr("width",T).attr("height",M).attr("fill",a).attr("stroke",l),_.attr("class","swimlane-body").attr("style",h).attr("x",B).attr("y",D).attr("width",T).attr("height",P).attr("fill","none").attr("stroke",l);let O=t.x-x.width/2,$=C+(M-x.height)/2;y.attr("transform",`translate(${O}, ${$})`)}if(Z.trace("Swimlane data ",t,JSON.stringify(t)),u){let A=y.select("span");A&&A.attr("style",u)}return t.offsetX=0,t.width=T,t.height=k,t.offsetY=x.height-b/2,t.intersect=function(A){return nu(t,A)},{cluster:p,labelBBox:x}},"swimlane")});var Vce,DQe,IQe,MQe,NQe,PQe,OQe,Wce,rf,q4,Wy=F(()=>{"use strict";Xt();ur();vt();Vy();$r();tr();Ls();_4();G4();km();Jt();Gce();Vce=o(async(e,t)=>{Z.info("Creating subgraph rect for ",t.id,t);let r=Ae(),{themeVariables:n,handDrawnSeed:i}=r,{clusterBkg:a,clusterBorder:s}=n,{labelStyles:l,nodeStyles:u,borderStyles:h,backgroundStyles:d}=ct(t),f=e.insert("g").attr("class","cluster "+t.cssClasses).attr("id",t.domId).attr("data-look",t.look),p=Gr(r),m=f.insert("g").attr("class","cluster-label "),g;t.labelType==="markdown"?g=await Pn(m,t.label,{style:t.labelStyle,useHtmlLabels:p,isNode:!0,width:t.width}):g=await sc(m,t.label,t.labelStyle||"",!1,!0);let y=g.getBBox();if(Gr(r)){let S=g.children[0],R=et(g);y=S.getBoundingClientRect(),R.attr("width",y.width),R.attr("height",y.height)}let v=t.width<=y.width+t.padding?y.width+t.padding:t.width;t.width<=y.width+t.padding?t.diff=(v-t.width)/2-t.padding:t.diff=-t.padding;let x=t.height,b=t.x-v/2,T=t.y-x/2;Z.trace("Data ",t,JSON.stringify(t));let k;if(t.look==="handDrawn"){let S=ut.svg(f),R=dt(t,{roughness:.7,fill:a,stroke:s,fillWeight:3,seed:i}),L=S.path(io(b,T,v,x,0),R);k=f.insert(()=>(Z.debug("Rough node insert CXC",L),L),":first-child"),k.select("path:nth-child(2)").attr("style",h.join(";")),k.select("path").attr("style",d.join(";").replace("fill","stroke"))}else k=f.insert("rect",":first-child"),k.attr("style",u).attr("rx",t.rx).attr("ry",t.ry).attr("x",b).attr("y",T).attr("width",v).attr("height",x);let{subGraphTitleTopMargin:C}=oc(r);if(m.attr("transform",`translate(${t.x-y.width/2}, ${t.y-t.height/2+C})`),l){let S=m.select("span");S&&S.attr("style",l)}let w=k.node().getBBox();return t.offsetX=0,t.width=w.width,t.height=w.height,t.offsetY=y.height-t.padding/2,t.intersect=function(S){return nu(t,S)},{cluster:f,labelBBox:y}},"rect"),DQe=o((e,t)=>{let r=e.insert("g").attr("class","note-cluster").attr("id",t.domId),n=r.insert("rect",":first-child"),i=0*t.padding,a=i/2;n.attr("rx",t.rx).attr("ry",t.ry).attr("x",t.x-t.width/2-a).attr("y",t.y-t.height/2-a).attr("width",t.width+i).attr("height",t.height+i).attr("fill","none");let s=n.node().getBBox();return t.width=s.width,t.height=s.height,t.intersect=function(l){return nu(t,l)},{cluster:r,labelBBox:{width:0,height:0}}},"noteGroup"),IQe=o(async(e,t)=>{let r=Ae(),{themeVariables:n,handDrawnSeed:i}=r,{altBackground:a,compositeBackground:s,compositeTitleBackground:l,nodeBorder:u}=n,h=e.insert("g").attr("class",t.cssClasses).attr("id",t.domId).attr("data-id",t.id).attr("data-look",t.look),d=h.insert("g",":first-child"),f=h.insert("g").attr("class","cluster-label"),p=h.append("rect"),m=await sc(f,t.label,t.labelStyle,void 0,!0),g=m.getBBox();if(Gr(r)){let L=m.children[0],N=et(m);g=L.getBoundingClientRect(),N.attr("width",g.width),N.attr("height",g.height)}let y=0*t.padding,v=y/2,x=(t.width<=g.width+t.padding?g.width+t.padding:t.width)+y;t.width<=g.width+t.padding?t.diff=(x-t.width)/2-t.padding:t.diff=-t.padding;let b=t.height+y,T=t.height+y-g.height-6,k=t.x-x/2,C=t.y-b/2;t.width=x;let w=t.y-t.height/2-v+g.height+2,S;if(t.look==="handDrawn"){let L=t.cssClasses.includes("statediagram-cluster-alt"),N=ut.svg(h),I=t.rx||t.ry?N.path(io(k,C,x,b,10),{roughness:.7,fill:l,fillStyle:"solid",stroke:u,seed:i}):N.rectangle(k,C,x,b,{seed:i});S=h.insert(()=>I,":first-child");let _=N.rectangle(k,w,x,T,{fill:L?a:s,fillStyle:L?"hachure":"solid",stroke:u,seed:i});S=h.insert(()=>I,":first-child"),p=h.insert(()=>_)}else S=d.insert("rect",":first-child"),S.attr("class","outer").attr("x",k).attr("y",C).attr("width",x).attr("height",b).attr("data-look",t.look),p.attr("class","inner").attr("x",k).attr("y",w).attr("width",x).attr("height",T);f.attr("transform",`translate(${t.x-g.width/2}, ${C+1-(Gr(r)?0:3)})`);let R=S.node().getBBox();return t.height=R.height,t.offsetX=0,t.offsetY=g.height-t.padding/2,t.labelBBox=g,t.intersect=function(L){return nu(t,L)},{cluster:h,labelBBox:g}},"roundedWithTitle"),MQe=o(async(e,t)=>{Z.info("Creating subgraph rect for ",t.id,t);let r=Ae(),{themeVariables:n,handDrawnSeed:i}=r,{clusterBkg:a,clusterBorder:s}=n,{labelStyles:l,nodeStyles:u,borderStyles:h,backgroundStyles:d}=ct(t),f=e.insert("g").attr("class","cluster "+t.cssClasses).attr("id",t.domId).attr("data-look",t.look),p=Gr(r),m=f.insert("g").attr("class","cluster-label "),g=await Pn(m,t.label,{style:t.labelStyle,useHtmlLabels:p,isNode:!0,width:t.width}),y=g.getBBox();if(Gr(r)){let S=g.children[0],R=et(g);y=S.getBoundingClientRect(),R.attr("width",y.width),R.attr("height",y.height)}let v=t.width<=y.width+t.padding?y.width+t.padding:t.width;t.width<=y.width+t.padding?t.diff=(v-t.width)/2-t.padding:t.diff=-t.padding;let x=t.height,b=t.x-v/2,T=t.y-x/2;Z.trace("Data ",t,JSON.stringify(t));let k;if(t.look==="handDrawn"){let S=ut.svg(f),R=dt(t,{roughness:.7,fill:a,stroke:s,fillWeight:4,seed:i}),L=S.path(io(b,T,v,x,t.rx),R);k=f.insert(()=>(Z.debug("Rough node insert CXC",L),L),":first-child"),k.select("path:nth-child(2)").attr("style",h.join(";")),k.select("path").attr("style",d.join(";").replace("fill","stroke"))}else k=f.insert("rect",":first-child"),k.attr("style",u).attr("rx",t.rx).attr("ry",t.ry).attr("x",b).attr("y",T).attr("width",v).attr("height",x);let{subGraphTitleTopMargin:C}=oc(r);if(m.attr("transform",`translate(${t.x-y.width/2}, ${t.y-t.height/2+C})`),l){let S=m.select("span");S&&S.attr("style",l)}let w=k.node().getBBox();return t.offsetX=0,t.width=w.width,t.height=w.height,t.offsetY=y.height-t.padding/2,t.intersect=function(S){return nu(t,S)},{cluster:f,labelBBox:y}},"kanbanSection"),NQe=o((e,t)=>{let r=Ae(),{themeVariables:n,handDrawnSeed:i}=r,{nodeBorder:a}=n,s=e.insert("g").attr("class",t.cssClasses).attr("id",t.domId).attr("data-look",t.look),l=s.insert("g",":first-child"),u=0*t.padding,h=t.width+u;t.diff=-t.padding;let d=t.height+u,f=t.x-h/2,p=t.y-d/2;t.width=h;let m;if(t.look==="handDrawn"){let v=ut.svg(s).rectangle(f,p,h,d,{fill:"lightgrey",roughness:.5,strokeLineDash:[5],stroke:a,seed:i});m=s.insert(()=>v,":first-child")}else{m=l.insert("rect",":first-child");let y="outer";t.look,y="divider",m.attr("class",y).attr("x",f).attr("y",p).attr("width",h).attr("height",d).attr("data-look",t.look)}let g=m.node().getBBox();return t.height=g.height,t.offsetX=0,t.offsetY=0,t.intersect=function(y){return nu(t,y)},{cluster:s,labelBBox:{}}},"divider"),PQe=Vce,OQe={rect:Vce,squareRect:PQe,roundedWithTitle:IQe,noteGroup:DQe,divider:NQe,kanbanSection:MQe,swimlane:zce},Wce=new Map,rf=o(async(e,t)=>{let r=t.shape||"rect",n=await OQe[r](e,t);return Wce.set(t.id,n),n},"insertCluster"),q4=o(()=>{Wce=new Map},"clear")});var ml,gO=F(()=>{"use strict";ml=o((e,t)=>{if(t)return"translate("+-e.width/2+", "+-e.height/2+")";let r=e.x??0,n=e.y??0;return"translate("+-(r+e.width/2)+", "+-(n+e.height/2)+")"},"computeLabelTransform")});function H4(e,t){if(e===void 0||t===void 0)return{angle:0,deltaX:0,deltaY:0};e=di(e),t=di(t);let[r,n]=[e.x,e.y],[i,a]=[t.x,t.y],s=i-r,l=a-n;return{angle:Math.atan(l/s),deltaX:s,deltaY:l}}var Yi,yO,di,U4,Y4=F(()=>{"use strict";Yi={aggregation:17.25,extension:17.25,composition:17.25,dependency:6,lollipop:13.5,arrow_point:4,arrow_barb:0,arrow_barb_neo:5.5},yO={arrow_point:4,arrow_cross:12.5,arrow_circle:12.5};o(H4,"calculateDeltaAndAngle");di=o(e=>Array.isArray(e)?{x:e[0],y:e[1]}:e,"pointTransformer"),U4=o(e=>({x:o(function(t,r,n){let i=0,a=di(n[0]).x=0?1:-1)}else if(r===n.length-1&&Object.hasOwn(Yi,e.arrowTypeEnd)){let{angle:m,deltaX:g}=H4(n[n.length-1],n[n.length-2]);i=Yi[e.arrowTypeEnd]*Math.cos(m)*(g>=0?1:-1)}let s=Math.abs(di(t).x-di(n[n.length-1]).x),l=Math.abs(di(t).y-di(n[n.length-1]).y),u=Math.abs(di(t).x-di(n[0]).x),h=Math.abs(di(t).y-di(n[0]).y),d=Yi[e.arrowTypeStart],f=Yi[e.arrowTypeEnd],p=1;if(s0&&l0&&h=0?1:-1)}else if(r===n.length-1&&Object.hasOwn(Yi,e.arrowTypeEnd)){let{angle:m,deltaY:g}=H4(n[n.length-1],n[n.length-2]);i=Yi[e.arrowTypeEnd]*Math.abs(Math.sin(m))*(g>=0?1:-1)}let s=Math.abs(di(t).y-di(n[n.length-1]).y),l=Math.abs(di(t).x-di(n[n.length-1]).x),u=Math.abs(di(t).y-di(n[0]).y),h=Math.abs(di(t).x-di(n[0]).x),d=Yi[e.arrowTypeStart],f=Yi[e.arrowTypeEnd],p=1;if(s0&&l0&&h{"use strict";vt();Hce=o((e,t,r,n,i,a=!1,s)=>{t.arrowTypeStart&&qce(e,"start",t.arrowTypeStart,r,n,i,a,s),t.arrowTypeEnd&&qce(e,"end",t.arrowTypeEnd,r,n,i,a,s)},"addEdgeMarkers"),BQe={arrow_cross:{type:"cross",fill:!1},arrow_point:{type:"point",fill:!0},arrow_barb:{type:"barb",fill:!0},arrow_barb_neo:{type:"barb",fill:!0},arrow_circle:{type:"circle",fill:!1},aggregation:{type:"aggregation",fill:!1},extension:{type:"extension",fill:!1},composition:{type:"composition",fill:!0},dependency:{type:"dependency",fill:!0},lollipop:{type:"lollipop",fill:!1},only_one:{type:"onlyOne",fill:!1},zero_or_one:{type:"zeroOrOne",fill:!1},one_or_more:{type:"oneOrMore",fill:!1},zero_or_more:{type:"zeroOrMore",fill:!1},requirement_arrow:{type:"requirement_arrow",fill:!1},requirement_contains:{type:"requirement_contains",fill:!1}},$Qe=["cross","point","circle","lollipop","aggregation","extension","composition","dependency","barb"],qce=o((e,t,r,n,i,a,s=!1,l)=>{let u=BQe[r],h=u&&$Qe.includes(u.type);if(!u){Z.warn(`Unknown arrow type: ${r}`);return}let d=u.type,m=`${i}_${a}-${d}${t==="start"?"Start":"End"}${s&&h?"-margin":""}`;if(l&&l.trim()!==""){let g=l.replace(/[^\dA-Za-z]/g,"_"),y=`${m}_${g}`;if(!document.getElementById(y)){let v=document.getElementById(m);if(v){let x=v.cloneNode(!0);x.id=y,x.querySelectorAll("path, circle, line").forEach(T=>{T.setAttribute("stroke",l),u.fill&&T.setAttribute("fill",l)}),v.parentNode?.appendChild(x)}}e.attr(`marker-${t}`,`url(${n}#${y})`)}else e.attr(`marker-${t}`,`url(${n}#${m})`)},"addEdgeMarker")});function j4(e,t){Gr(Ae())&&e&&(e.style.width=t.length*9+"px",e.style.height="12px")}function WQe(e){let t=[],r=[];for(let n=1;n5&&Math.abs(a.y-i.y)>5||i.y===a.y&&a.x===s.x&&Math.abs(a.x-i.x)>5&&Math.abs(a.y-s.y)>5)&&(t.push(a),r.push(n))}return{cornerPoints:t,cornerPointPositions:r}}function UQe(e,t){if(e.length<2)return"";let r="",n=e.length,i=1e-5;for(let a=0;a({...i}));if(e.length>=2&&Yi[t.arrowTypeStart]){let i=Yi[t.arrowTypeStart],a=e[0],s=e[1],{angle:l}=Xce(a,s),u=i*Math.cos(l),h=i*Math.sin(l);r[0].x=a.x+u,r[0].y=a.y+h}let n=e.length;if(n>=2&&Yi[t.arrowTypeEnd]){let i=Yi[t.arrowTypeEnd],a=e[n-1],s=e[n-2],{angle:l}=Xce(s,a),u=i*Math.cos(l),h=i*Math.sin(l);r[n-1].x=a.x-u,r[n-1].y=a.y-h}return r}var FQe,qy,_i,X4,z2,Rm,K4,zQe,GQe,VQe,Yce,jce,qQe,HQe,Hy,G2=F(()=>{"use strict";Xt();ur();vt();Ls();gO();Qt();Y4();Vy();$r();tr();G4();Uce();Jt();FQe=o(e=>typeof e=="string"?e:Ae()?.flowchart?.curve,"resolveEdgeCurveType"),qy=new Map,_i=new Map,X4=o(()=>{qy.clear(),_i.clear()},"clear"),z2=o(e=>e?typeof e=="string"?e:e.reduce((t,r)=>t+";"+r,""):"","getLabelStyles"),Rm=o(async(e,t)=>{let r=Ae(),n=Gr(r),{labelStyles:i}=ct(t);t.labelStyle=i;let a=e.insert("g").attr("class","edgeLabel"),s=a.insert("g").attr("class","label").attr("data-id",t.id),l=t.labelType==="markdown",h=await Pn(e,t.label,{style:z2(t.labelStyle),useHtmlLabels:n,addSvgBackground:!0,isNode:!1,markdown:l,width:l?void 0:void 0},r);s.node().appendChild(h),Z.info("abc82",t,t.labelType);let d=h.getBBox(),f=d;if(n){let m=h.children[0],g=et(h);d=m.getBoundingClientRect(),f=d,g.attr("width",d.width),g.attr("height",d.height)}else{let m=et(h).select("text").node();m&&typeof m.getBBox=="function"&&(f=m.getBBox())}s.attr("transform",ml(f,n)),qy.set(t.id,a),t.width=d.width,t.height=d.height;let p;if(t.startLabelLeft){let m=e.insert("g").attr("class","edgeTerminals"),g=m.insert("g").attr("class","inner"),y=await sc(g,t.startLabelLeft,z2(t.labelStyle)||"",!1,!1);p=y;let v=y.getBBox();if(n){let x=y.children[0],b=et(y);v=x.getBoundingClientRect(),b.attr("width",v.width),b.attr("height",v.height)}g.attr("transform",ml(v,n)),_i.get(t.id)||_i.set(t.id,{}),_i.get(t.id).startLeft=m,j4(p,t.startLabelLeft)}if(t.startLabelRight){let m=e.insert("g").attr("class","edgeTerminals"),g=m.insert("g").attr("class","inner"),y=await sc(g,t.startLabelRight,z2(t.labelStyle)||"",!1,!1);p=y;let v=y.getBBox();if(n){let x=y.children[0],b=et(y);v=x.getBoundingClientRect(),b.attr("width",v.width),b.attr("height",v.height)}g.attr("transform",ml(v,n)),_i.get(t.id)||_i.set(t.id,{}),_i.get(t.id).startRight=m,j4(p,t.startLabelRight)}if(t.endLabelLeft){let m=e.insert("g").attr("class","edgeTerminals"),g=m.insert("g").attr("class","inner"),y=await sc(m,t.endLabelLeft,z2(t.labelStyle)||"",!1,!1);p=y;let v=y.getBBox();if(n){let x=y.children[0],b=et(y);v=x.getBoundingClientRect(),b.attr("width",v.width),b.attr("height",v.height)}g.attr("transform",ml(v,n)),_i.get(t.id)||_i.set(t.id,{}),_i.get(t.id).endLeft=m,j4(p,t.endLabelLeft)}if(t.endLabelRight){let m=e.insert("g").attr("class","edgeTerminals"),g=m.insert("g").attr("class","inner"),y=await sc(m,t.endLabelRight,z2(t.labelStyle)||"",!1,!1);p=y;let v=y.getBBox();if(n){let x=y.children[0],b=et(y);v=x.getBoundingClientRect(),b.attr("width",v.width),b.attr("height",v.height)}g.attr("transform",ml(v,n)),_i.get(t.id)||_i.set(t.id,{}),_i.get(t.id).endRight=m,j4(p,t.endLabelRight)}return h},"insertEdgeLabel");o(j4,"setTerminalWidth");K4=o((e,t)=>{Z.debug("Moving label abc88 ",e.id,e.label,qy.get(e.id),t);let r=t.updatedPath?t.updatedPath:t.originalPath,n=Ae(),{subGraphTitleTotalMargin:i}=oc(n);if(e.label){let a=qy.get(e.id),s=e.x,l=e.y;if(r){let u=Zt.calcLabelPosition(r);Z.debug("Moving label "+e.label+" from (",s,",",l,") to (",u.x,",",u.y,") abc88"),t.updatedPath&&(s=u.x,l=u.y)}a.attr("transform",`translate(${s}, ${l+i/2})`)}if(e.startLabelLeft){let a=_i.get(e.id).startLeft,s=e.x,l=e.y;if(r){let u=Zt.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_left",r);s=u.x,l=u.y}a.attr("transform",`translate(${s}, ${l})`)}if(e.startLabelRight){let a=_i.get(e.id).startRight,s=e.x,l=e.y;if(r){let u=Zt.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_right",r);s=u.x,l=u.y}a.attr("transform",`translate(${s}, ${l})`)}if(e.endLabelLeft){let a=_i.get(e.id).endLeft,s=e.x,l=e.y;if(r){let u=Zt.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_left",r);s=u.x,l=u.y}a.attr("transform",`translate(${s}, ${l})`)}if(e.endLabelRight){let a=_i.get(e.id).endRight,s=e.x,l=e.y;if(r){let u=Zt.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_right",r);s=u.x,l=u.y}a.attr("transform",`translate(${s}, ${l})`)}},"positionEdgeLabel"),zQe=o((e,t)=>{if(!e?.isLabelEdge||!e?.id?.endsWith("-to-label")||!Array.isArray(t)||t.length!==2)return t;let[r,n]=t,i=Math.abs(n.x-r.x),a=Math.abs(n.y-r.y);return i<.001||a<.001?t:a>=i?[r,{x:r.x,y:n.y},n]:[r,{x:n.x,y:r.y},n]},"orthogonalizeToLabelClippedPoints"),GQe=o((e,t)=>{let r=e.x,n=e.y,i=Math.abs(t.x-r),a=Math.abs(t.y-n),s=e.width/2,l=e.height/2;return i>=s||a>=l},"outsideNode"),VQe=o((e,t,r)=>{Z.debug(`intersection calc abc89:
+ outsidePoint: ${JSON.stringify(t)}
+ insidePoint : ${JSON.stringify(r)}
+ node : x:${e.x} y:${e.y} w:${e.width} h:${e.height}`);let n=e.x,i=e.y,a=Math.abs(n-r.x),s=e.width/2,l=r.xMath.abs(n-t.x)*u){let f=r.y{Z.warn("abc88 cutPathAtIntersect",e,t);let r=[],n=e[0],i=!1;return e.forEach(a=>{if(Z.info("abc88 checking point",a,t),!GQe(t,a)&&!i){let s=VQe(t,n,a);Z.debug("abc88 inside",a,n,s),Z.debug("abc88 intersection",s,t);let l=!1;r.forEach(u=>{l=l||u.x===s.x&&u.y===s.y}),r.some(u=>u.x===s.x&&u.y===s.y)?Z.warn("abc88 no intersect",s,r):r.push(s),i=!0}else Z.warn("abc88 outside",a,n),n=a,i||r.push(a)}),Z.debug("returning points",r),r},"cutPathAtIntersect");o(WQe,"extractCornerPoints");jce=o(function(e,t,r){let n=t.x-e.x,i=t.y-e.y,a=Math.sqrt(n*n+i*i),s=r/a;return{x:t.x-s*n,y:t.y-s*i}},"findAdjacentPoint"),qQe=o(function(e){let{cornerPointPositions:t}=WQe(e),r=[];for(let n=0;n10&&Math.abs(a.y-i.y)>=10){Z.debug("Corner point fixing",Math.abs(a.x-i.x),Math.abs(a.y-i.y));let m=5;s.x===l.x?p={x:h<0?l.x-m+f:l.x+m-f,y:d<0?l.y-f:l.y+f}:p={x:h<0?l.x-f:l.x+f,y:d<0?l.y-m+f:l.y+m-f}}else Z.debug("Corner point skipping fixing",Math.abs(a.x-i.x),Math.abs(a.y-i.y));r.push(p,u)}else r.push(e[n]);return r},"fixCorners"),HQe=o((e,t,r)=>{let n=e-t-r,i=2,a=2,s=i+a,l=Math.floor(n/s),u=Array(l).fill(`${i} ${a}`).join(" ");return`0 ${t} ${u} ${r}`},"generateDashArray"),Hy=o(function(e,t,r,n,i,a,s,l=!1){if(!s)throw new Error(`insertEdge: missing diagramId for edge "${t.id}" \u2014 edge IDs require a diagram prefix for uniqueness`);let{handDrawnSeed:u,layout:h}=Ae(),d=t.points,f=!1,p=i;var m=a;let g=[];for(let O in t.cssCompiledStyles)M2(O)||g.push(t.cssCompiledStyles[O]);if(h==="swimlane"){if(m.intersect&&p.intersect&&Array.isArray(d)&&d.length>=2)if(d.length===2)d=[p.intersect(d[0]),m.intersect(d[1])];else{let O=d.slice(1,-1),$=O[0],V=O[O.length-1],G=.5,z=Math.abs(d[d.length-1].x-V.x)!Number.isNaN(O.y)),x=FQe(t.curve);x!=="rounded"&&(v=qQe(v));let b=Jc;switch(x){case"linear":b=Jc;break;case"basis":b=rc;break;case"cardinal":b=e2;break;case"bumpX":b=Xb;break;case"bumpY":b=Kb;break;case"catmullRom":b=n2;break;case"monotoneX":b=i2;break;case"monotoneY":b=a2;break;case"natural":b=Ry;break;case"step":b=_y;break;case"stepAfter":b=o2;break;case"stepBefore":b=s2;break;case"rounded":b=Jc;break;default:b=rc}let{x:T,y:k}=U4(t),C=tc().x(T).y(k).curve(b),w;switch(t.thickness){case"normal":w="edge-thickness-normal";break;case"thick":w="edge-thickness-thick";break;case"invisible":w="edge-thickness-invisible";break;default:w="edge-thickness-normal"}switch(t.pattern){case"solid":w+=" edge-pattern-solid";break;case"dotted":w+=" edge-pattern-dotted";break;case"dashed":w+=" edge-pattern-dashed";break;default:w+=" edge-pattern-solid"}let S,R=x==="rounded"?UQe(YQe(v,t),5):C(v),L=Array.isArray(t.style)?t.style:[t.style],N=L.find(O=>O?.startsWith("stroke:")),I="";t.animate&&(I="edge-animation-fast"),t.animation&&(I="edge-animation-"+t.animation);let _=!1;if(t.look==="handDrawn"){let O=ut.svg(e);Object.assign([],v);let $=O.path(R,{roughness:.3,seed:u});w+=" transition",S=et($).select("path").attr("id",`${s}-${t.id}`).attr("class"," "+w+(t.classes?" "+t.classes:"")+(I?" "+I:"")).attr("style",L?L.reduce((G,z)=>G+";"+z,""):"");let V=S.attr("d");S.attr("d",V),e.node().appendChild(S.node())}else{let O=g.join(";"),$=L?L.reduce((j,Q)=>j+Q+";",""):"",V=(O?O+";"+$+";":$)+";"+(L?L.reduce((j,Q)=>j+";"+Q,""):"");S=e.append("path").attr("d",R).attr("id",`${s}-${t.id}`).attr("class"," "+w+(t.classes?" "+t.classes:"")+(I?" "+I:"")).attr("style",V),N=V.match(/stroke:([^;]+)/)?.[1],_=t.animate===!0||!!t.animation||O.includes("animation");let G=S.node(),z=typeof G.getTotalLength=="function"?G.getTotalLength():0,W=yO[t.arrowTypeStart]||0,H=yO[t.arrowTypeEnd]||0;if(t.look==="neo"&&!_){let Q=`stroke-dasharray: ${t.pattern==="dotted"||t.pattern==="dashed"?HQe(z,W,H):`0 ${W} ${z-W-H} ${H}`}; stroke-dashoffset: 0;`;S.attr("style",Q+S.attr("style"))}}S.attr("data-edge",!0),S.attr("data-et","edge"),S.attr("data-id",t.id),S.attr("data-points",y),S.attr("data-look",kn(t.look)),t.showPoints&&v.forEach(O=>{e.append("circle").style("stroke","red").style("fill","red").attr("r",1).attr("cx",O.x).attr("cy",O.y)});let A="";(Ae().flowchart.arrowMarkerAbsolute||Ae().state.arrowMarkerAbsolute)&&(A=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,A=A.replace(/\(/g,"\\(").replace(/\)/g,"\\)")),Z.info("arrowTypeStart",t.arrowTypeStart),Z.info("arrowTypeEnd",t.arrowTypeEnd);let M=!_&&t?.look==="neo";Hce(S,t,A,s,n,M,N);let D=Math.floor(d.length/2),P=d[D];Zt.isLabelCoordinateInPath(P,S.attr("d"))||(f=!0);let B={};return f&&(B.updatedPath=d),B.originalPath=t.points,B},"insertEdge");o(UQe,"generateRoundedPath");o(Xce,"calculateDeltaAndAngle");o(YQe,"applyMarkerOffsetsToPoints")});var jQe,XQe,KQe,ZQe,QQe,JQe,eJe,tJe,rJe,nJe,iJe,aJe,sJe,oJe,lJe,cJe,uJe,hJe,dJe,fJe,pJe,mJe,gJe,yJe,Uy,Z4=F(()=>{"use strict";vt();ur();jQe=o((e,t,r,n)=>{t.forEach(i=>{yJe[i](e,r,n)})},"insertMarkers"),XQe=o((e,t,r)=>{Z.trace("Making markers for ",r),e.append("defs").append("marker").attr("id",r+"_"+t+"-extensionStart").attr("class","marker extension "+t).attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 1,7 L18,13 V 1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-extensionEnd").attr("class","marker extension "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z"),e.append("marker").attr("id",r+"_"+t+"-extensionStart-margin").attr("class","marker extension "+t).attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("viewBox","0 0 20 14").append("polygon").attr("points","10,7 18,13 18,1").style("stroke-width",2).style("stroke-dasharray","0"),e.append("defs").append("marker").attr("id",r+"_"+t+"-extensionEnd-margin").attr("class","marker extension "+t).attr("refX",9).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("viewBox","0 0 20 14").append("polygon").attr("points","10,1 10,13 18,7").style("stroke-width",2).style("stroke-dasharray","0")},"extension"),KQe=o((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-compositionStart").attr("class","marker composition "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-compositionEnd").attr("class","marker composition "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-compositionStart-margin").attr("class","marker composition "+t).attr("refX",15).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("viewBox","0 0 15 15").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-compositionEnd-margin").attr("class","marker composition "+t).attr("refX",3.5).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition"),ZQe=o((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-aggregationStart").attr("class","marker aggregation "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-aggregationEnd").attr("class","marker aggregation "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-aggregationStart-margin").attr("class","marker aggregation "+t).attr("refX",15).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",2).attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-aggregationEnd-margin").attr("class","marker aggregation "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",2).attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation"),QQe=o((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-dependencyStart").attr("class","marker dependency "+t).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-dependencyEnd").attr("class","marker dependency "+t).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-dependencyStart-margin").attr("class","marker dependency "+t).attr("refX",4).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-dependencyEnd-margin").attr("class","marker dependency "+t).attr("refX",16).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"dependency"),JQe=o((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-lollipopStart").attr("class","marker lollipop "+t).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),e.append("defs").append("marker").attr("id",r+"_"+t+"-lollipopEnd").attr("class","marker lollipop "+t).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),e.append("defs").append("marker").attr("id",r+"_"+t+"-lollipopStart-margin").attr("class","marker lollipop "+t).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6).attr("stroke-width",2),e.append("defs").append("marker").attr("id",r+"_"+t+"-lollipopEnd-margin").attr("class","marker lollipop "+t).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6).attr("stroke-width",2)},"lollipop"),eJe=o((e,t,r)=>{e.append("marker").attr("id",r+"_"+t+"-pointEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-pointStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-pointEnd-margin").attr("class","marker "+t).attr("viewBox","0 0 11.5 14").attr("refX",11.5).attr("refY",7).attr("markerUnits","userSpaceOnUse").attr("markerWidth",10.5).attr("markerHeight",14).attr("orient","auto").append("path").attr("d","M 0 0 L 11.5 7 L 0 14 z").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-pointStart-margin").attr("class","marker "+t).attr("viewBox","0 0 11.5 14").attr("refX",1).attr("refY",7).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11.5).attr("markerHeight",14).attr("orient","auto").append("polygon").attr("points","0,7 11.5,14 11.5,0").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0")},"point"),tJe=o((e,t,r)=>{e.append("marker").attr("id",r+"_"+t+"-circleEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-circleStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-circleEnd-margin").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refY",5).attr("refX",12.25).attr("markerUnits","userSpaceOnUse").attr("markerWidth",14).attr("markerHeight",14).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-circleStart-margin").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",-2).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",14).attr("markerHeight",14).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0")},"circle"),rJe=o((e,t,r)=>{e.append("marker").attr("id",r+"_"+t+"-crossEnd").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-crossStart").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-crossEnd-margin").attr("class","marker cross "+t).attr("viewBox","0 0 15 15").attr("refX",17.7).attr("refY",7.5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 1,1 L 14,14 M 1,14 L 14,1").attr("class","arrowMarkerPath").style("stroke-width",2.5),e.append("marker").attr("id",r+"_"+t+"-crossStart-margin").attr("class","marker cross "+t).attr("viewBox","0 0 15 15").attr("refX",-3.5).attr("refY",7.5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 1,1 L 14,14 M 1,14 L 14,1").attr("class","arrowMarkerPath").style("stroke-width",2.5).style("stroke-dasharray","1,0")},"cross"),nJe=o((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"barb"),iJe=o((e,t,r)=>{let n=_t(),{themeVariables:i}=n,{transitionColor:a}=i;e.append("defs").append("marker").attr("id",r+"_"+t+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","strokeWidth").attr("orient","auto").append("path").attr("d","M 19,7 L11,14 L13,7 L11,0 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-barbEnd-margin").attr("refX",17).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L11,14 L13,7 L11,0 Z").attr("fill",`${a}`)},"barbNeo"),aJe=o((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-onlyOneStart").attr("class","marker onlyOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M9,0 L9,18 M15,0 L15,18"),e.append("defs").append("marker").attr("id",r+"_"+t+"-onlyOneEnd").attr("class","marker onlyOne "+t).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M3,0 L3,18 M9,0 L9,18")},"only_one"),sJe=o((e,t,r)=>{let n=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrOneStart").attr("class","marker zeroOrOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");n.append("circle").attr("fill","white").attr("cx",21).attr("cy",9).attr("r",6),n.append("path").attr("d","M9,0 L9,18");let i=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+t).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",9).attr("cy",9).attr("r",6),i.append("path").attr("d","M21,0 L21,18")},"zero_or_one"),oJe=o((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-oneOrMoreStart").attr("class","marker oneOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27"),e.append("defs").append("marker").attr("id",r+"_"+t+"-oneOrMoreEnd").attr("class","marker oneOrMore "+t).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18")},"one_or_more"),lJe=o((e,t,r)=>{let n=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");n.append("circle").attr("fill","white").attr("cx",48).attr("cy",18).attr("r",6),n.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18");let i=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+t).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",9).attr("cy",18).attr("r",6),i.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18")},"zero_or_more"),cJe=o((e,t,r)=>{let n=_t(),{themeVariables:i}=n,{strokeWidth:a}=i;e.append("defs").append("marker").attr("id",r+"_"+t+"-onlyOneStart").attr("class","marker onlyOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M9,0 L9,18 M15,0 L15,18").attr("stroke-width",`${a}`),e.append("defs").append("marker").attr("id",r+"_"+t+"-onlyOneEnd").attr("class","marker onlyOne "+t).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M3,0 L3,18 M9,0 L9,18").attr("stroke-width",`${a}`)},"only_one_neo"),uJe=o((e,t,r)=>{let n=_t(),{themeVariables:i}=n,{strokeWidth:a,mainBkg:s}=i,l=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrOneStart").attr("class","marker zeroOrOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse");l.append("circle").attr("fill",s??"white").attr("cx",21).attr("cy",9).attr("stroke-width",`${a}`).attr("r",6),l.append("path").attr("d","M9,0 L9,18").attr("stroke-width",`${a}`);let u=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+t).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("markerUnits","userSpaceOnUse").attr("orient","auto");u.append("circle").attr("fill",s??"white").attr("cx",9).attr("cy",9).attr("stroke-width",`${a}`).attr("r",6),u.append("path").attr("d","M21,0 L21,18").attr("stroke-width",`${a}`)},"zero_or_one_neo"),hJe=o((e,t,r)=>{let n=_t(),{themeVariables:i}=n,{strokeWidth:a}=i;e.append("defs").append("marker").attr("id",r+"_"+t+"-oneOrMoreStart").attr("class","marker oneOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27").attr("stroke-width",`${a}`),e.append("defs").append("marker").attr("id",r+"_"+t+"-oneOrMoreEnd").attr("class","marker oneOrMore "+t).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18").attr("stroke-width",`${a}`)},"one_or_more_neo"),dJe=o((e,t,r)=>{let n=_t(),{themeVariables:i}=n,{strokeWidth:a,mainBkg:s}=i,l=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("markerUnits","userSpaceOnUse").attr("orient","auto");l.append("circle").attr("fill",s??"white").attr("cx",45.5).attr("cy",18).attr("r",6).attr("stroke-width",`${a}`),l.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18").attr("stroke-width",`${a}`);let u=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+t).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto").attr("markerUnits","userSpaceOnUse");u.append("circle").attr("fill",s??"white").attr("cx",11).attr("cy",18).attr("r",6).attr("stroke-width",`${a}`),u.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18").attr("stroke-width",`${a}`)},"zero_or_more_neo"),fJe=o((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("path").attr("d",`M0,0
+ L20,10
+ M20,10
+ L0,20`)},"requirement_arrow"),pJe=o((e,t,r)=>{let n=_t(),{themeVariables:i}=n,{strokeWidth:a}=i;e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("stroke-width",`${a}`).attr("viewBox","0 0 25 20").append("path").attr("d",`M0,0
+ L20,10
+ M20,10
+ L0,20`).attr("stroke-linejoin","miter")},"requirement_arrow_neo"),mJe=o((e,t,r)=>{let n=e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("g");n.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),n.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),n.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10)},"requirement_contains"),gJe=o((e,t,r)=>{let n=_t(),{themeVariables:i}=n,{strokeWidth:a}=i,s=e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("g");s.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),s.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),s.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10),s.selectAll("*").attr("stroke-width",`${a}`)},"requirement_contains_neo"),yJe={extension:XQe,composition:KQe,aggregation:ZQe,dependency:QQe,lollipop:JQe,point:eJe,circle:tJe,cross:rJe,barb:nJe,barbNeo:iJe,only_one:aJe,zero_or_one:sJe,one_or_more:oJe,zero_or_more:lJe,only_one_neo:cJe,zero_or_one_neo:uJe,one_or_more_neo:hJe,zero_or_more_neo:dJe,requirement_arrow:fJe,requirement_contains:mJe,requirement_arrow_neo:pJe,requirement_contains_neo:gJe},Uy=jQe});async function nf(e,t,r){let n,i;t.shape==="rect"&&(t.rx&&t.ry?t.shape="roundedRect":t.shape="squareRect");let a=t.shape?pO[t.shape]:void 0;if(!a)throw new Error(`No such shape: ${t.shape}. Please check your syntax.`);if(t.link){let s;r.config.securityLevel==="sandbox"?s="_top":t.linkTarget&&(s=t.linkTarget||"_blank"),n=e.insert("svg:a").attr("xlink:href",t.link).attr("target",s??null),i=await a(n,t,r)}else i=await a(e,t,r),n=i;return n.attr("data-look",kn(t.look)),t.tooltip&&i.attr("title",t.tooltip),Q4.set(t.id,n),t.haveCallback&&n.attr("class",n.attr("class")+" clickable"),n}var Q4,Kce,J4,_m,Lm=F(()=>{"use strict";vt();mO();Qt();Q4=new Map;o(nf,"insertNode");Kce=o((e,t)=>{Q4.set(t.id,e)},"setNodeElem"),J4=o(()=>{Q4.clear()},"clear"),_m=o(e=>{let t=Q4.get(e.id);Z.trace("Transforming node",e.diff,e,"translate("+(e.x-e.width/2-5)+", "+e.width/2+")");let r=8,n=e.diff||0;return e.clusterNode?t.attr("transform","translate("+(e.x+n-e.width/2)+", "+(e.y-e.height/2-r)+")"):t.attr("transform","translate("+e.x+", "+e.y+")"),n},"positionNode")});var Zce,Qce=F(()=>{"use strict";ur();Vr();vt();Wy();G2();Z4();Lm();Kt();Qt();Zce={common:xt,getConfig:_t,insertCluster:rf,insertEdge:Hy,insertEdgeLabel:Rm,insertMarkers:Uy,insertNode:nf,interpolateToCurve:lP,labelHelper:It,log:Z,positionEdgeLabel:K4}});var vJe,e3,vO=F(()=>{"use strict";vJe=typeof global=="object"&&global&&global.Object===Object&&global,e3=vJe});var xJe,bJe,Li,gl=F(()=>{"use strict";vO();xJe=typeof self=="object"&&self&&self.Object===Object&&self,bJe=e3||xJe||Function("return this")(),Li=bJe});var TJe,wa,Dm=F(()=>{"use strict";gl();TJe=Li.Symbol,wa=TJe});function kJe(e){var t=CJe.call(e,V2),r=e[V2];try{e[V2]=void 0;var n=!0}catch{}var i=wJe.call(e);return n&&(t?e[V2]=r:delete e[V2]),i}var Jce,CJe,wJe,V2,eue,tue=F(()=>{"use strict";Dm();Jce=Object.prototype,CJe=Jce.hasOwnProperty,wJe=Jce.toString,V2=wa?wa.toStringTag:void 0;o(kJe,"getRawTag");eue=kJe});function AJe(e){return EJe.call(e)}var SJe,EJe,rue,nue=F(()=>{"use strict";SJe=Object.prototype,EJe=SJe.toString;o(AJe,"objectToString");rue=AJe});function LJe(e){return e==null?e===void 0?_Je:RJe:iue&&iue in Object(e)?eue(e):rue(e)}var RJe,_Je,iue,Ds,af=F(()=>{"use strict";Dm();tue();nue();RJe="[object Null]",_Je="[object Undefined]",iue=wa?wa.toStringTag:void 0;o(LJe,"baseGetTag");Ds=LJe});function DJe(e){return e!=null&&typeof e=="object"}var Bi,lc=F(()=>{"use strict";o(DJe,"isObjectLike");Bi=DJe});function MJe(e){return typeof e=="symbol"||Bi(e)&&Ds(e)==IJe}var IJe,Go,Im=F(()=>{"use strict";af();lc();IJe="[object Symbol]";o(MJe,"isSymbol");Go=MJe});function NJe(e,t){for(var r=-1,n=e==null?0:e.length,i=Array(n);++r{"use strict";o(NJe,"arrayMap");au=NJe});var PJe,Yr,ji=F(()=>{"use strict";PJe=Array.isArray,Yr=PJe});function oue(e){if(typeof e=="string")return e;if(Yr(e))return au(e,oue)+"";if(Go(e))return sue?sue.call(e):"";var t=e+"";return t=="0"&&1/e==-OJe?"-0":t}var OJe,aue,sue,lue,cue=F(()=>{"use strict";Dm();W2();ji();Im();OJe=1/0,aue=wa?wa.prototype:void 0,sue=aue?aue.toString:void 0;o(oue,"baseToString");lue=oue});function $Je(e){for(var t=e.length;t--&&BJe.test(e.charAt(t)););return t}var BJe,uue,hue=F(()=>{"use strict";BJe=/\s/;o($Je,"trimmedEndIndex");uue=$Je});function zJe(e){return e&&e.slice(0,uue(e)+1).replace(FJe,"")}var FJe,due,fue=F(()=>{"use strict";hue();FJe=/^\s+/;o(zJe,"baseTrim");due=zJe});function GJe(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var fi,yl=F(()=>{"use strict";o(GJe,"isObject");fi=GJe});function UJe(e){if(typeof e=="number")return e;if(Go(e))return pue;if(fi(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=fi(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=due(e);var r=WJe.test(e);return r||qJe.test(e)?HJe(e.slice(2),r?2:8):VJe.test(e)?pue:+e}var pue,VJe,WJe,qJe,HJe,mue,gue=F(()=>{"use strict";fue();yl();Im();pue=NaN,VJe=/^[-+]0x[0-9a-f]+$/i,WJe=/^0b[01]+$/i,qJe=/^0o[0-7]+$/i,HJe=parseInt;o(UJe,"toNumber");mue=UJe});function jJe(e){if(!e)return e===0?e:0;if(e=mue(e),e===yue||e===-yue){var t=e<0?-1:1;return t*YJe}return e===e?e:0}var yue,YJe,Yy,xO=F(()=>{"use strict";gue();yue=1/0,YJe=17976931348623157e292;o(jJe,"toFinite");Yy=jJe});function XJe(e){var t=Yy(e),r=t%1;return t===t?r?t-r:t:0}var vue,xue=F(()=>{"use strict";xO();o(XJe,"toInteger");vue=XJe});function KJe(e){return e}var ao,sf=F(()=>{"use strict";o(KJe,"identity");ao=KJe});function tet(e){if(!fi(e))return!1;var t=Ds(e);return t==QJe||t==JJe||t==ZJe||t==eet}var ZJe,QJe,JJe,eet,su,q2=F(()=>{"use strict";af();yl();ZJe="[object AsyncFunction]",QJe="[object Function]",JJe="[object GeneratorFunction]",eet="[object Proxy]";o(tet,"isFunction");su=tet});var ret,t3,bue=F(()=>{"use strict";gl();ret=Li["__core-js_shared__"],t3=ret});function net(e){return!!Tue&&Tue in e}var Tue,Cue,wue=F(()=>{"use strict";bue();Tue=(function(){var e=/[^.]+$/.exec(t3&&t3.keys&&t3.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""})();o(net,"isMasked");Cue=net});function set(e){if(e!=null){try{return aet.call(e)}catch{}try{return e+""}catch{}}return""}var iet,aet,kh,bO=F(()=>{"use strict";iet=Function.prototype,aet=iet.toString;o(set,"toSource");kh=set});function met(e){if(!fi(e)||Cue(e))return!1;var t=su(e)?pet:cet;return t.test(kh(e))}var oet,cet,uet,het,det,fet,pet,kue,Sue=F(()=>{"use strict";q2();wue();yl();bO();oet=/[\\^$.*+?()[\]{}|]/g,cet=/^\[object .+?Constructor\]$/,uet=Function.prototype,het=Object.prototype,det=uet.toString,fet=het.hasOwnProperty,pet=RegExp("^"+det.call(fet).replace(oet,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");o(met,"baseIsNative");kue=met});function get(e,t){return e?.[t]}var Eue,Aue=F(()=>{"use strict";o(get,"getValue");Eue=get});function yet(e,t){var r=Eue(e,t);return kue(r)?r:void 0}var so,of=F(()=>{"use strict";Sue();Aue();o(yet,"getNative");so=yet});var vet,r3,Rue=F(()=>{"use strict";of();gl();vet=so(Li,"WeakMap"),r3=vet});var _ue,xet,Lue,Due=F(()=>{"use strict";yl();_ue=Object.create,xet=(function(){function e(){}return o(e,"object"),function(t){if(!fi(t))return{};if(_ue)return _ue(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}})(),Lue=xet});function bet(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var Iue,Mue=F(()=>{"use strict";o(bet,"apply");Iue=bet});function Tet(){}var Nue,Pue=F(()=>{"use strict";o(Tet,"noop");Nue=Tet});function Cet(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r{"use strict";o(Cet,"copyArray");n3=Cet});function Aet(e){var t=0,r=0;return function(){var n=Eet(),i=ket-(n-r);if(r=n,i>0){if(++t>=wet)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var wet,ket,Eet,Oue,Bue=F(()=>{"use strict";wet=800,ket=16,Eet=Date.now;o(Aet,"shortOut");Oue=Aet});function Ret(e){return function(){return e}}var oo,CO=F(()=>{"use strict";o(Ret,"constant");oo=Ret});var _et,jy,wO=F(()=>{"use strict";of();_et=(function(){try{var e=so(Object,"defineProperty");return e({},"",{}),e}catch{}})(),jy=_et});var Let,$ue,Fue=F(()=>{"use strict";CO();wO();sf();Let=jy?function(e,t){return jy(e,"toString",{configurable:!0,enumerable:!1,value:oo(t),writable:!0})}:ao,$ue=Let});var Det,i3,kO=F(()=>{"use strict";Fue();Bue();Det=Oue($ue),i3=Det});function Iet(e,t){for(var r=-1,n=e==null?0:e.length;++r{"use strict";o(Iet,"arrayEach");a3=Iet});function Met(e,t,r,n){for(var i=e.length,a=r+(n?1:-1);n?a--:++a{"use strict";o(Met,"baseFindIndex");s3=Met});function Net(e){return e!==e}var zue,Gue=F(()=>{"use strict";o(Net,"baseIsNaN");zue=Net});function Pet(e,t,r){for(var n=r-1,i=e.length;++n