(i=o.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 o=r.at(-1);i.raw.length===1&&o!==void 0?o.raw+=`
`:r.push(i);continue}if(i=this.tokenizer.code(t)){t=t.substring(i.raw.length);let o=r.at(-1);o?.type==="paragraph"||o?.type==="text"?(o.raw+=(o.raw.endsWith(`
`)?"":`
`)+i.raw,o.text+=`
`+i.text,this.inlineQueue.at(-1).src=o.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 o=r.at(-1);o?.type==="paragraph"||o?.type==="text"?(o.raw+=(o.raw.endsWith(`
`)?"":`
`)+i.raw,o.text+=`
`+i.raw,this.inlineQueue.at(-1).src=o.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 o=1/0,l=t.slice(1),u;this.options.extensions.startBlock.forEach(h=>{u=h.call({lexer:this},l),typeof u=="number"&&u>=0&&(o=Math.min(o,u))}),o<1/0&&o>=0&&(a=t.substring(0,o+1))}if(this.state.top&&(i=this.tokenizer.paragraph(a))){let o=r.at(-1);n&&o?.type==="paragraph"?(o.raw+=(o.raw.endsWith(`
`)?"":`
`)+i.raw,o.text+=`
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=o.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 o=r.at(-1);o?.type==="text"?(o.raw+=(o.raw.endsWith(`
`)?"":`
`)+i.raw,o.text+=`
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=o.text):r.push(i);continue}if(t){let o="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(o);break}else throw new Error(o)}}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,o="";for(;t;){a||(o=""),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,o)){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)!=="_"&&(o=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}},o4=class{static{s(this,"P")}options;parser;constructor(e){this.options=e||Sm}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:eu(i,!0))+`
`:""+(r?i:eu(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 o=0;o
`+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+" "+eu(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`${eu(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=Tae(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=Tae(e);if(i===null)return eu(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:eu(e.text)}},oP=class{static{s(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""}},Sh=class QN{static{s(this,"l")}options;renderer;textRenderer;constructor(t){this.options=t||Sm,this.options.renderer=this.options.renderer||new o4,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new oP}static parse(t,r){return new QN(r).parse(t)}static parseInline(t,r){return new QN(r).parseInline(t)}parse(t,r=!0){let n="";for(let i=0;i{let o=i[a].flat(1/0);r=r.concat(this.walkTokens(o,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(...o){let l=i.renderer.apply(this,o);return l===!1&&(l=a.apply(this,o)),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 o4(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 o=a,l=r.renderer[o],u=i[o];i[o]=(...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 s4(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 o=a,l=r.tokenizer[o],u=i[o];i[o]=(...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 b2;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 o=a,l=r.hooks[o],u=i[o];b2.passThroughHooks.has(a)?i[o]=h=>{if(this.defaults.async&&b2.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[o]=(...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(o){let l=[];return l.push(a.call(this,o)),i&&(l=l.concat(i.call(this,o))),l}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return Ch.lex(e,t??this.defaults)}parser(e,t){return Sh.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 o=i.hooks?i.hooks.provideLexer():e?Ch.lex:Ch.lexInline,l=i.hooks?i.hooks.provideParser():e?Sh.parse:Sh.parseInline;if(i.async)return Promise.resolve(i.hooks?i.hooks.preprocess(t):t).then(u=>o(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=o(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:
"+eu(r.message+"",!0)+" ";return t?Promise.resolve(n):n}if(t)return Promise.reject(r);throw r}}},Cm=new KXe;s(_n,"d");_n.options=_n.setOptions=function(e){return Cm.setOptions(e),_n.defaults=Cm.defaults,wae(_n.defaults),_n};_n.getDefaults=JN;_n.defaults=Sm;_n.use=function(...e){return Cm.use(...e),_n.defaults=Cm.defaults,wae(_n.defaults),_n};_n.walkTokens=function(e,t){return Cm.walkTokens(e,t)};_n.parseInline=Cm.parseInline;_n.Parser=Sh;_n.parser=Sh.parse;_n.Renderer=o4;_n.TextRenderer=oP;_n.Lexer=Ch;_n.lexer=Ch.lex;_n.Tokenizer=s4;_n.Hooks=b2;_n.parse=_n;mrr=_n.options,grr=_n.setOptions,yrr=_n.use,vrr=_n.walkTokens,xrr=_n.parseInline,brr=Sh.parse,Trr=Ch.lex});function ZXe(e,{markdownAutoWrap:t}){let n=e.replace(/ /g,`
`).replace(/\n{2,}/g,`
`);return ck(n)}function Oae(e){return e.split(/\\n|\n| /gi).map(t=>t.trim().match(/<[^>]+>|[^\s<>]+/g)?.map(r=>({content:r,type:"normal"}))??[])}function Bae(e,t={}){let r=ZXe(e,t),n=_n.lexer(r),i=[[]],a=0;function o(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=>{o(h,l.type)}):l.type==="html"&&i[a].push({content:l.text,type:"normal"})}return s(o,"processNode"),n.forEach(l=>{l.type==="paragraph"?l.tokens?.forEach(u=>{o(u)}):l.type==="html"?i[a].push({content:l.text,type:"normal"}):i[a].push({content:l.raw,type:"normal"})}),i}function $ae(e){return e?`${e.replace(/\\n|\n/g," ")}
`:""}function Fae(e,{markdownAutoWrap:t}={}){let r=_n.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:(se.warn(`Unsupported markdown: ${i.type}`),i.raw)}return s(n,"output"),r.map(n).join("")}var Gae=F(()=>{"use strict";Pae();Y7();St();s(ZXe,"preprocessMarkdown");s(Oae,"nonMarkdownToLines");s(Bae,"markdownToLines");s($ae,"nonMarkdownToHTML");s(Fae,"markdownToHTML")});var zae=As((lP,cP)=>{"use strict";(function(e){"use strict";var t=function(){},r=e.requestAnimationFrame||e.webkitRequestAnimationFrame||e.mozRequestAnimationFrame||e.msRequestAnimationFrame||function(h){return setTimeout(h,16)};function n(){var h=this;h.reads=[],h.writes=[],h.raf=r.bind(e),t("initialized",h)}s(n,"FastDom"),n.prototype={constructor:n,runTasks:s(function(h){t("run tasks");for(var d;d=h.shift();)d()},"runTasks"),measure:s(function(h,d){t("measure");var f=d?h.bind(d):h;return this.reads.push(f),i(this),f},"measure"),mutate:s(function(h,d){t("mutate");var f=d?h.bind(d):h;return this.writes.push(f),i(this),f},"mutate"),clear:s(function(h){return t("clear",h),o(this.reads,h)||o(this.writes,h)},"clear"),extend:s(function(h){if(t("extend",h),typeof h!="object")throw new Error("expected object");var d=Object.create(this);return l(d,h),d.fastdom=this,d.initialize&&d.initialize(),d},"extend"),catch:null};function i(h){h.scheduled||(h.scheduled=!0,h.raf(a.bind(null,h)),t("flush scheduled"))}s(i,"scheduleFlush");function a(h){t("flush");var d=h.writes,f=h.reads,p;try{t("flushing reads",f.length),h.runTasks(f),t("flushing writes",d.length),h.runTasks(d)}catch(m){p=m}if(h.scheduled=!1,(f.length||d.length)&&i(h),p)if(t("task errored",p.message),h.catch)h.catch(p);else throw p}s(a,"flush");function o(h,d){var f=h.indexOf(d);return!!~f&&!!h.splice(f,1)}s(o,"remove");function l(h,d){for(var f in d)d.hasOwnProperty(f)&&(h[f]=d[f])}s(l,"mixin");var u=e.fastdom=e.fastdom||new n;typeof define=="function"?define(function(){return u}):typeof cP=="object"&&(cP.exports=u)})(typeof window<"u"?window:typeof lP<"u"?lP:globalThis)});var Vae=As((Prr,uP)=>{"use strict";(function(){var e={initialize:s(function(){this._tasks=new Map},"initialize"),mutate:s(function(r,n){return t(this,"mutate",r,n)},"mutate"),measure:s(function(r,n){return t(this,"measure",r,n)},"measure"),clear:s(function(r){var n=this._tasks,i=n.get(r);this.fastdom.clear(i),n.delete(r)},"clear")};function t(r,n,i,a){var o=r._tasks,l=r.fastdom,u,h=new Promise(function(d,f){u=l[n](function(){o.delete(h);try{d(a?i.call(a):i())}catch(p){f(p)}},a)});return o.set(h,u),h}s(t,"create"),(typeof define)[0]=="f"?define(function(){return e}):(typeof uP)[0]=="o"?uP.exports=e:window.fastdomPromised=e})()});var Wae,qae,QXe,tu,u4=F(()=>{"use strict";Wae=Rs(zae(),1),qae=Rs(Vae(),1),QXe=Wae.default.extend({raf(e){typeof queueMicrotask=="function"?queueMicrotask(e):setTimeout(e,0)}}).extend(qae.default),tu=QXe});function JXe(e){return Intl.Segmenter?[...new Intl.Segmenter().segment(e)].map(t=>t.segment):[...e]}function eKe(e,t){let r=JXe(t.content);return Hae(e,[],r,t.type)}function Hae(e,t,r,n){if(r.length===0)return[{content:t.join(""),type:n},{content:"",type:n}];let[i,...a]=r,o=[...t,i];return e([{content:o.join(""),type:n}])?Hae(e,o,a,n):(t.length===0&&i&&(t.push(i),r.shift()),[{content:t.join(""),type:n},{content:r.join(""),type:n}])}function Uae(e,t){if(e.some(({content:r})=>r.includes(`
`)))throw new Error("splitLineToFitWidth does not support newlines in the line");return hP(e,t)}function hP(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"},o=[...n];if(i!==""&&o.push({content:i,type:"normal"}),o.push(a),t(o))return hP(e,t,r,o);if(n.length>0)r.push(n),e.unshift(a);else if(a.content){let[l,u]=eKe(t,a);r.push([l]),u.content&&e.unshift(u)}return hP(e,t,r)}var Yae=F(()=>{"use strict";s(JXe,"splitTextToChars");s(eKe,"splitWordToFitWidth");s(Hae,"splitWordToFitWidthRecursion");s(Uae,"splitLineToFitWidth");s(hP,"splitLineToFitWidthRecursion")});function jae(e,t){t&&e.attr("style",t)}async function tKe(e,t,r,n,i=!1,a=Lt()){let o=e.append("foreignObject");o.attr("width",`${Math.min(10*r,Xae)}px`),o.attr("height",`${Math.min(10*r,Xae)}px`);let l=o.append("xhtml:div"),u=si(t.label)?await J0(t.label.replace(Tt.lineBreakRegex,`
`),a):xr(t.label,a),h=t.isNode?"nodeLabel":"edgeLabel",d=l.append("span");return d.html(u),jae(d,t.labelStyle),d.attr("class",`${h} ${n}`),jae(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"),(await tu.measure(()=>l.node().getBoundingClientRect())).width===r&&(l.style("display","table"),l.style("white-space","break-spaces"),l.style("width",r+"px")),o.node()}function dP(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 rKe(e,t,r){let n=e.append("text"),i=dP(n,1,t);fP(i,r);let a=i.node().getComputedTextLength();return n.remove(),a}function Zae(e,t,r){let n=e.append("text"),i=dP(n,1,t);fP(i,[{content:r,type:"normal"}]);let a=i.node()?.getBoundingClientRect();return a&&n.remove(),a}function nKe(e,t,r,n=!1,i=!1){let o=t.append("g"),l=o.insert("rect").attr("class","background").attr("style","stroke: none"),u=o.append("text").attr("y","-10.1");i&&u.attr("text-anchor","middle");let h=0;for(let d of r){let f=s(m=>rKe(o,1.1,m)<=e,"checkWidth"),p=f(d)?[d]:Uae(d,f);for(let m of p){let g=dP(u,h,1.1,i);fP(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),o.node()}else return u.node()}function Kae(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 fP(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(Kae(r.content)):i.text(" "+Kae(r.content))})}async function iKe(e,t={}){let r=[];e.replace(/(fa[bklrs]?):fa-([\w-]+)/g,(i,a,o)=>(r.push((async()=>{let l=`${a}:${o}`;return await pJ(l)?await ps(l,void 0,{class:"label-icon"}):` `})()),i));let n=await Promise.all(r);return e.replace(/(fa[bklrs]?):fa-([\w-]+)/g,()=>n.shift()??"")}var Xae,li,qo=F(()=>{"use strict";Wr();Yr();St();My();Gae();er();u4();Hl();Yae();br();s(jae,"applyStyle");Xae=16384;s(tKe,"addHtmlSpan");s(dP,"createTspan");s(rKe,"computeWidthOfText");s(Zae,"computeDimensionOfText");s(nKe,"createFormattedText");s(Kae,"decodeHTMLEntities");s(fP,"updateTextContentAndStyles");s(iKe,"replaceIconSubstring");li=s(async(e,t="",{style:r="",isTitle:n=!1,classes:i="",useHtmlLabels:a=!0,markdown:o=!0,isNode:l=!0,width:u=200,addSvgBackground:h=!1}={},d)=>{if(se.debug("XYZ createText",t,r,n,i,a,l,"addSvgBackground: ",h),a){let f=o?Fae(t,d):$ae(t),p=await iKe(lo(f),d),m=t.replace(/\\\\/g,"\\"),g={isNode:l,label:si(t)?m:p,labelStyle:r.replace("fill:","color:")};return await tKe(e,g,u,i,h,d)}else{let f=lo(t.replace(/ /g," ")),p=o?Bae(f.replace(" "," "),d):Oae(f),m=nKe(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:");ut(m).attr("style",g)}else{let g=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/background:/g,"fill:");ut(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:");ut(m).select("text").attr("style",y)}return n?ut(m).selectAll("tspan.text-outer-tspan").classed("title-row",!0):ut(m).selectAll("tspan.text-outer-tspan").classed("row",!0),m}},"createText")});async function h4(e){let t=e.getElementsByTagName("img");if(!t||t.length===0)return;let r=!Qae(e);await Promise.all([...t].map(n=>new Promise(i=>{function a(){if(n.style.display="flex",n.style.flexDirection="column",r){let o=Pe().fontSize?Pe().fontSize:window.getComputedStyle(document.body).fontSize,l=5,[u=mr.fontSize]=Bs(o),h=u*l+"px";n.style.minWidth=h,n.style.maxWidth=h}else n.style.width="100%";i(n)}s(a,"setupImage"),setTimeout(()=>{n.complete&&a()}),n.addEventListener("error",a),n.addEventListener("load",a)})))}function Qae(e){return e.nodeType===sKe?e.textContent?.trim()!=="":e.nodeType!==aKe||e.tagName.toLowerCase()==="img"?!1:[...e.childNodes].some(Qae)}var aKe,sKe,pP=F(()=>{"use strict";Jt();Qi();er();aKe=1,sKe=3;s(h4,"configureLabelImages");s(Qae,"hasTextBesidesImages")});var Jae,oKe,ese,tse=F(()=>{"use strict";Wr();qo();Jt();Yr();er();Jae=3,oKe=32,ese=s(async(e,t,r)=>{let n=Pe(),i=e.insert("g").attr("class",r??"node default").attr("id",t.domId||t.id),a=i.insert("g").attr("class","label").attr("style",un(t.labelStyle)),l=[{text:typeof t.label=="string"?t.label:t.label?.[0]??"",cssClass:"c4-name"},{text:t.stereotype,cssClass:"c4-type"},...(t.description??[]).map(v=>({text:v,cssClass:"c4-descr"}))].filter(v=>v.text),u=t.width?Math.max(t.width-2*(t.padding??0),oKe):Pe().flowchart?.wrappingWidth??200,h=n.wrap?u:Number.POSITIVE_INFINITY,d=await Promise.all(l.map(async v=>{let x=a.append("g").attr("class",v.cssClass),b=await li(x,xr(lo(v.text??""),n),{useHtmlLabels:!1,markdown:!1,isNode:!0,width:h,style:t.labelStyle},n);return ut(b).selectAll("tspan.text-outer-tspan").attr("text-anchor","middle"),ut(b).selectAll("tspan.text-inner-tspan").attr("font-weight",null).attr("font-style",null),{el:x,box:x.node().getBBox()}})),f=Math.max(...d.map(({box:v})=>v.width),0),p=0;for(let{el:v,box:x}of d)v.attr("transform",`translate(${f/2-x.x-x.width/2}, ${p-x.y})`),p+=x.height+Jae;let m=d.length>0?p-Jae:0;a.insert("rect",":first-child"),a.attr("transform",`translate(${-f/2}, ${-m/2})`);let g=a.node().getBBox(),y=(t.padding??0)/2;return{shapeSvg:i,bbox:g,halfPadding:y,label:a}},"c4LabelHelper")});function hr(e){let t=e.map((r,n)=>`${n===0?"M":"L"}${r.x},${r.y}`);return t.push("Z"),t.join(" ")}function vl(e,t,r,n,i,a){let o=[],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));o.push({x:y,y:v})}return o}function Ho(e,t,r,n,i,a){let o=[],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"),o=s((u,h)=>u?.getAttribute(h)??void 0,"getAttr");if(i){let u={fill:o(i,"fill"),"fill-opacity":o(i,"fill-opacity")??"1"};Object.entries(u).forEach(([h,d])=>{d&&r.setAttribute(h,d)})}if(a){let u={stroke:o(a,"stroke"),"stroke-width":o(a,"stroke-width")??"1","stroke-opacity":o(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 yt,d4,ht,vt,Ht=F(()=>{"use strict";qo();u4();Jt();br();Wr();Yr();er();pP();My();tse();yt=s(async(e,t,r)=>{if(t.stereotype!==void 0)return ese(e,t,r);let n,i=t.useHtmlLabels||Aa(Pe()?.htmlLabels);r?n=r:n="node default";let a=e.insert("g").attr("class",n).attr("id",t.domId||t.id),o=a.insert("g").attr("class","label").attr("style",un(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 li(o,xr(lo(l),Pe()),{useHtmlLabels:i,width:t.width||t.wrappingWidth||Pe().flowchart?.wrappingWidth,classes:h?"markdown-node-label":"",style:t.labelStyle,addSvgBackground:u,markdown:h},Pe()),f=(t?.padding??0)/2,p;if(i){let m=d.children[0],g=ut(d);await h4(m),p=await tu.measure(()=>m.getBoundingClientRect()),g.attr("width",p.width),g.attr("height",p.height)}else p=await tu.measure(()=>d.getBBox());return i?o.attr("transform","translate("+-p.width/2+", "+-p.height/2+")"):o.attr("transform","translate(0, "+-p.height/2+")"),t.centerLabel&&o.attr("transform","translate("+-p.width/2+", "+-p.height/2+")"),o.insert("rect",":first-child"),{shapeSvg:a,bbox:p,halfPadding:f,label:o}},"labelHelper"),d4=s(async(e,t,r)=>{let n=r.useHtmlLabels??ai(Pe()),i=e.insert("g").attr("class","label").attr("style",r.labelStyle||""),a=await li(i,xr(lo(t),Pe()),{useHtmlLabels:n,width:r.width||Pe()?.flowchart?.wrappingWidth,style:r.labelStyle,addSvgBackground:!!r.icon||!!r.img}),o=r.padding/2,l;if(ai(Pe())){let u=a.children[0],h=ut(a);l=await tu.measure(()=>u.getBoundingClientRect()),h.attr("width",l.width),h.attr("height",l.height)}else l=await tu.measure(()=>a.getBBox());return n?i.attr("transform","translate("+-l.width/2+", "+-l.height/2+")"):i.attr("transform","translate(0, "+-l.height/2+")"),r.centerLabel&&i.attr("transform","translate("+-l.width/2+", "+-l.height/2+")"),i.insert("rect",":first-child"),{shapeSvg:e,bbox:l,halfPadding:o,label:i}},"insertLabel"),ht=s((e,t,r)=>{if(r){e.width=r.width,e.height=r.height;return}let n=t.node().getBBox();e.width=n.width,e.height=n.height},"updateNodeBounds"),vt=s((e,t)=>(e.look==="handDrawn"?"rough-node":"node")+" "+e.cssClasses+" "+(t||""),"getNodeClasses");s(hr,"createPathFromPoints");s(vl,"generateFullSineWavePoints");s(Ho,"generateCirclePoints");s(mP,"mergePaths")});function lKe(e,t){return e.intersect(t)}var rse,nse=F(()=>{"use strict";s(lKe,"intersectNode");rse=lKe});function cKe(e,t,r,n){var i=e.x,a=e.y,o=i-n.x,l=a-n.y,u=Math.sqrt(t*t*l*l+r*r*o*o),h=Math.abs(t*r*o/u);n.x{"use strict";s(cKe,"intersectEllipse");f4=cKe});function uKe(e,t,r){return f4(e,t,t,r)}var ise,ase=F(()=>{"use strict";gP();s(uKe,"intersectCircle");ise=uKe});function hKe(e,t,r,n){{let i=t.y-e.y,a=e.x-t.x,o=t.x*e.y-e.x*t.y,l=i*r.x+a*r.y+o,u=i*n.x+a*n.y+o,h=1e-6;if(l!==0&&u!==0&&sse(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 ose,lse=F(()=>{"use strict";s(hKe,"intersectLine");s(sse,"sameSign");ose=hKe});function dKe(e,t,r){let n=e.x,i=e.y,a=[],o=Number.POSITIVE_INFINITY,l=Number.POSITIVE_INFINITY;typeof t.forEach=="function"?t.forEach(function(d){o=Math.min(o,d.x),l=Math.min(l,d.y)}):(o=Math.min(o,t.x),l=Math.min(l,t.y));let u=n-e.width/2-o,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";lse();s(dKe,"intersectPolygon");cse=dKe});var fKe,ru,p4=F(()=>{"use strict";fKe=s((e,t)=>{var r=e.x,n=e.y,i=t.x-r,a=t.y-n,o=e.width/2,l=e.height/2,u,h;return Math.abs(a)*o>Math.abs(i)*l?(a<0&&(l=-l),u=a===0?0:l*i/a,h=l):(i<0&&(o=-o),u=o,h=i===0?0:o*a/i),{x:r+u,y:n+h}},"intersectRect"),ru=fKe});var it,Zt=F(()=>{"use strict";nse();ase();gP();use();p4();it={node:rse,circle:ise,ellipse:f4,polygon:cse,rect:ru}});var hse,pKe,nu,mKe,S2,st,ft,gKe,Xt=F(()=>{"use strict";Jt();hse=s(e=>{let{handDrawnSeed:t}=Pe();return{fill:e,hachureAngle:120,hachureGap:4,fillWeight:2,roughness:.7,stroke:e,seed:t}},"solidStateFill"),pKe=s(e=>Array.isArray(e)?e:e?e.split(";").map(t=>t.trim()).filter(Boolean):[],"normalizeStyleList"),nu=s(e=>{let t=mKe([...e.cssCompiledStyles||[],...e.cssStyles||[],...pKe(e.labelStyle)]);return{stylesMap:t,stylesArray:[...t]}},"compileStyles"),mKe=s(e=>{let t=new Map;return e.forEach(r=>{let[n,i]=r.split(":");t.set(n.trim(),i?.trim())}),t},"styles2Map"),S2=s(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"),st=s(e=>{let{stylesArray:t}=nu(e),r=[],n=[],i=[],a=[];return t.forEach(o=>{let l=o[0];S2(l)?r.push(o.join(":")+" !important"):(n.push(o.join(":")+" !important"),l.includes("stroke")&&i.push(o.join(":")+" !important"),l==="fill"&&a.push(o.join(":")+" !important"))}),{labelStyles:r.join(";"),nodeStyles:n.join(";"),stylesArray:t,borderStyles:i,backgroundStyles:a}},"styles2String"),ft=s((e,t)=>{let{themeVariables:r,handDrawnSeed:n}=Pe(),{nodeBorder:i,mainBkg:a}=r,{stylesMap:o}=nu(e);return Object.assign({roughness:.7,fill:o.get("fill")||a,fillStyle:"hachure",fillWeight:4,hachureGap:5.2,stroke:o.get("stroke")||i,seed:n,strokeWidth:o.get("stroke-width")?.replace("px","")||1.3,fillLineDash:[0,0],strokeLineDash:gKe(o.get("stroke-dasharray"))},t)},"userNodeOverrides"),gKe=s(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 yP(e,t,r){if(e&&e.length){let[n,i]=t,a=Math.PI/180*r,o=Math.cos(a),l=Math.sin(a);for(let u of e){let[h,d]=u;u[0]=(h-n)*o-(d-i)*l+n,u[1]=(h-n)*l+(d-i)*o+i}}}function yKe(e,t){return e[0]===t[0]&&e[1]===t[1]}function vKe(e,t,r,n=1){let i=r,a=Math.max(t,.1),o=e[0]&&e[0][0]&&typeof e[0][0]=="number"?[e]:e,l=[0,0];if(i)for(let h of o)yP(h,l,i);let u=(function(h,d,f){let p=[];for(let b of h){let T=[...b];yKe(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 w=y[b].edge,C=y[T].edge;m.push([[Math.round(w.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})(o,a,n);if(i){for(let h of o)yP(h,l,-i);(function(h,d,f){let p=[];h.forEach((m=>p.push(...m))),yP(p,d,f)})(u,l,-i)}return u}function A2(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),vKe(e,i,n,a||1)}function S4(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 xP(e,t){return e.type===t}function MP(e){let t=[],r=(function(o){let l=new Array;for(;o!=="";)if(o.match(/^([ \t\r\n,]+)/))o=o.substr(RegExp.$1.length);else if(o.match(/^([aAcChHlLmMqQsStTvVzZ])/))l[l.length]={type:xKe,text:RegExp.$1},o=o.substr(RegExp.$1.length);else{if(!o.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))return[];l[l.length]={type:vP,text:`${parseFloat(RegExp.$1)}`},o=o.substr(RegExp.$1.length)}return l[l.length]={type:dse,text:""},l})(e),n="BOD",i=0,a=r[i];for(;!xP(a,dse);){let o=0,l=[];if(n==="BOD"){if(a.text!=="M"&&a.text!=="m")return MP("M0,0"+e);i++,o=m4[a.text],n=a.text}else xP(a,vP)?o=m4[n]:(i++,o=m4[a.text],n=a.text);if(!(i+od%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 Tse(e){let t=[],r="",n=0,i=0,a=0,o=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,o]=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)&&(Cse(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=o}r=h}return t}function w2(e,t,r){return[e*Math.cos(r)-t*Math.sin(r),e*Math.sin(r)+t*Math.cos(r)]}function Cse(e,t,r,n,i,a,o,l,u,h){let d=(f=o,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]=w2(e,t,-d),[r,n]=w2(r,n,-d);let A=(e-r)/2,I=(t-n)/2,D=A*A/(i*i)+I*I/(a*a);D>1&&(D=Math.sqrt(D),i*=D,a*=D);let L=i*i,B=a*a,O=L*B-L*I*I-B*A*A,$=L*I*I+B*A*A,W=(l===u?-1:1)*Math.sqrt(Math.abs(O/$));y=W*i*I/a+(e+r)/2,v=W*-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,I=r,D=n;g=u&&g>m?m+120*Math.PI/180*1:m+120*Math.PI/180*-1,p=Cse(r=y+i*Math.cos(g),n=v+a*Math.sin(g),I,D,i,a,o,0,u,[g,A,y,v])}x=g-m;let b=Math.cos(m),T=Math.sin(m),w=Math.cos(g),C=Math.sin(g),S=Math.tan(x/4),k=4/3*i*S,R=4/3*a*S,M=[e,t],P=[e+k*T,t-R*b],N=[r+k*C,n-R*w],_=[r,n];if(P[0]=2*M[0]-P[0],P[1]=2*M[1]-P[1],h)return[P,N,_].concat(p);{p=[P,N,_].concat(p);let A=[];for(let I=0;I2){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=vse(v,h,d,f,p,m,g,1,u);if(!u.disableMultiStroke){let b=vse(v,h,d,f,p,m,g,1.5,u);x.push(...b)}return o&&(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 mse(e,t){let r=Tse(bse(MP(e))),n=[],i=[0,0],a=[0,0];for(let{key:o,data:l}of r)switch(o){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(...CKe(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 bP(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]+Ar(i,t),n[0][1]+Ar(i,t)]});for(let o=1;o500?.4:-.0016668*u+1.233334;let d=i.maxRandomnessOffset||0;d*d*100>l&&(d=u/10);let f=d/2,p=.2+.2*kse(i),m=i.bowing*i.maxRandomnessOffset*(n-t)/200,g=i.bowing*i.maxRandomnessOffset*(e-r)/200;m=Ar(m,i,h),g=Ar(g,i,h);let y=[],v=s(()=>Ar(f,i,h),"M"),x=s(()=>Ar(d,i,h),"k"),b=i.preserveVertices;return a&&(o?y.push({op:"move",data:[e+(b?0:v()),t+(b?0:v())]}):y.push({op:"move",data:[e+(b?0:Ar(d,i,h)),t+(b?0:Ar(d,i,h))]})),o?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 g4(e,t,r){if(!e.length)return[];let n=[];n.push([e[0][0]+Ar(t,r),e[0][1]+Ar(t,r)]),n.push([e[0][0]+Ar(t,r),e[0][1]+Ar(t,r)]);for(let i=1;i3){let a=[],o=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);LP([u,p,y,x],0,r,i),LP([x,v,g,f],0,r,i)}var a,o;return i}function wKe(e,t){return C4(e,0,e.length,t)}function C4(e,t,r,n,i){let a=i||[],o=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?(C4(e,t,h+1,n,a),C4(e,h,r,n,a)):(a.length||a.push(o),a.push(l)),a}function TP(e,t=.15,r){let n=[],i=(e.length-1)/3;for(let a=0;a0?C4(n,0,n.length,r):n}var E2,CP,SP,wP,kP,EP,co,AP,xKe,vP,dse,m4,bKe,Uo,Py,DP,y4,IP,ot,Kt=F(()=>{"use strict";s(yP,"t");s(yKe,"e");s(vKe,"s");s(A2,"n");E2=class{static{s(this,"o")}constructor(t){this.helper=t}fillPolygons(t,r){return this._fillPolygons(t,r)}_fillPolygons(t,r){let n=A2(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}};s(S4,"a");CP=class extends E2{static{s(this,"h")}fillPolygons(t,r){let n=r.hachureGap;n<0&&(n=4*r.strokeWidth),n=Math.max(n,.1);let i=A2(t,Object.assign({},r,{hachureGap:n})),a=Math.PI/180*r.hachureAngle,o=[],l=.5*n*Math.cos(a),u=.5*n*Math.sin(a);for(let[h,d]of i)S4([h,d])&&o.push([[h[0]-l,h[1]+u],[...d]],[[h[0]+l,h[1]-u],[...d]]);return{type:"fillSketch",ops:this.renderLines(o,r)}}},SP=class extends E2{static{s(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}},wP=class{static{s(this,"i")}constructor(t){this.helper=t}fillPolygons(t,r){let n=A2(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 o=i/4;for(let l of t){let u=S4(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=S4(o),u=Math.floor(l/(n+i)),h=(l+i-u*(n+i))/2,d=o[0],f=o[1];d[0]>f[0]&&(d=o[1],f=o[0]);let p=Math.atan((f[1]-d[1])/(f[0]-d[0]));for(let m=0;m{let o=S4(a),l=Math.round(o/(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&&(k=0,R=2*Math.PI);let M=(R-k)/b.curveStepCount,P=[];for(let N=k;N<=R;N+=M)P.push([T+C*Math.cos(N),w+S*Math.sin(N)]);return P.push([T+C*Math.cos(R),w+S*Math.sin(R)]),P.push([T,w]),Ny([P],b)})(t,r,n,i,a,o,h));return h.stroke!==Uo&&d.push(f),this._d("arc",d,h)}curve(t,r){let n=this._o(r),i=[],a=fse(t,n);if(n.fill&&n.fill!==Uo)if(n.fillStyle==="solid"){let o=fse(t,Object.assign(Object.assign({},n),{disableMultiStroke:!0,roughness:n.roughness?n.roughness+n.fillShapeRoughnessGain:0}));i.push({type:"fillPath",ops:this._mergedShape(o.ops)})}else{let o=[],l=t;if(l.length){let u=typeof l[0][0]=="number"?[l]:l;for(let h of u)h.length<3?o.push(...h):h.length===3?o.push(...TP(xse([h[0],h[0],h[1],h[2]]),10,(1+n.roughness)/2)):o.push(...TP(xse(h),10,(1+n.roughness)/2))}o.length&&i.push(Ny([o],n))}return n.stroke!==Uo&&i.push(a),this._d("curve",i,n)}polygon(t,r){let n=this._o(r),i=[],a=v4(t,!0,n);return n.fill&&(n.fillStyle==="solid"?i.push(bP([t],n)):i.push(Ny([t],n))),n.stroke!==Uo&&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!==Uo,o=n.stroke!==Uo,l=!!(n.simplification&&n.simplification<1),u=(function(d,f,p){let m=Tse(bse(MP(d))),g=[],y=[],v=[0,0],x=[],b=s(()=>{x.length>=4&&y.push(...TP(x,f)),x=[]},"i"),T=s(()=>{b(),y.length&&(g.push(y),y=[])},"c");for(let{key:C,data:S}of m)switch(C){case"M":T(),v=[S[0],S[1]],y.push(v);break;case"L":b(),y.push([S[0],S[1]]);break;case"C":if(!x.length){let k=y.length?y[y.length-1]:v;x.push([k[0],k[1]])}x.push([S[0],S[1]]),x.push([S[2],S[3]]),x.push([S[4],S[5]]);break;case"Z":b(),y.push([v[0],v[1]])}if(T(),!p)return g;let w=[];for(let C of g){let S=wKe(C,p);S.length&&w.push(S)}return w})(t,1,l?4-4*(n.simplification||1):(1+n.roughness)/2),h=mse(t,n);if(a)if(n.fillStyle==="solid")if(u.length===1){let d=mse(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(bP(u,n));else i.push(Ny(u,n));return o&&(l?u.forEach((d=>{i.push(v4(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((o=>+o.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 o=null;switch(a.type){case"path":o={d:this.opsToPath(a),stroke:n.stroke,strokeWidth:n.strokeWidth,fill:Uo};break;case"fillPath":o={d:this.opsToPath(a),stroke:Uo,strokeWidth:0,fill:n.fill||Uo};break;case"fillSketch":o=this.fillSketch(a,n)}o&&i.push(o)}return i}fillSketch(t,r){let n=r.fillWeight;return n<0&&(n=r.strokeWidth/2),{d:this.opsToPath(t),stroke:r.fill||Uo,strokeWidth:n,fill:Uo}}_mergedShape(t){return t.filter(((r,n)=>n===0||r.op!=="move"))}},DP=class{static{s(this,"st")}constructor(t,r){this.canvas=t,this.ctx=this.canvas.getContext("2d"),this.gen=new Py(r)}draw(t){let r=t.sets||[],n=t.options||this.getDefaultOptions(),i=this.ctx,a=t.options.fixedDecimalPlaceDigits;for(let o of r)switch(o.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,o,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,o,a,l),i.restore();break}case"fillSketch":this.fillSketch(i,o,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 o=typeof n=="number"&&n>=0?a.data.map((l=>+l.toFixed(n))):a.data;switch(a.op){case"move":t.moveTo(o[0],o[1]);break;case"bcurveTo":t.bezierCurveTo(o[0],o[1],o[2],o[3],o[4],o[5]);break;case"lineTo":t.lineTo(o[0],o[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 o=this.gen.line(t,r,n,i,a);return this.draw(o),o}rectangle(t,r,n,i,a){let o=this.gen.rectangle(t,r,n,i,a);return this.draw(o),o}ellipse(t,r,n,i,a){let o=this.gen.ellipse(t,r,n,i,a);return this.draw(o),o}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,o,l=!1,u){let h=this.gen.arc(t,r,n,i,a,o,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}},y4="http://www.w3.org/2000/svg",IP=class{static{s(this,"ot")}constructor(t,r){this.svg=t,this.gen=new Py(r)}draw(t){let r=t.sets||[],n=t.options||this.getDefaultOptions(),i=this.svg.ownerDocument||window.document,a=i.createElementNS(y4,"g"),o=t.options.fixedDecimalPlaceDigits;for(let l of r){let u=null;switch(l.type){case"path":u=i.createElementNS(y4,"path"),u.setAttribute("d",this.opsToPath(l,o)),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(y4,"path"),u.setAttribute("d",this.opsToPath(l,o)),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(y4,"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 o=this.gen.line(t,r,n,i,a);return this.draw(o)}rectangle(t,r,n,i,a){let o=this.gen.rectangle(t,r,n,i,a);return this.draw(o)}ellipse(t,r,n,i,a){let o=this.gen.ellipse(t,r,n,i,a);return this.draw(o)}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,o,l=!1,u){let h=this.gen.arc(t,r,n,i,a,o,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)}},ot={canvas:s((e,t)=>new DP(e,t),"canvas"),svg:s((e,t)=>new IP(e,t),"svg"),generator:s(e=>new Py(e),"generator"),newSeed:s(()=>Py.newSeed(),"newSeed")}});function Ese(e,t){let{labelStyles:r}=st(t);t.labelStyle=r;let n=vt(t),i=n;n||(i="anchor");let a=e.insert("g").attr("class",i).attr("id",t.domId||t.id),o=1,{cssStyles:l}=t,u=ot.svg(a),h=ft(t,{fill:"black",stroke:"none",fillStyle:"solid"});t.look!=="handDrawn"&&(h.roughness=0);let d=u.circle(0,0,o*2,h),f=a.insert(()=>d,":first-child");return f.attr("class","anchor").attr("style",un(l)),ht(t,f),t.intersect=function(p){return se.info("Circle intersect",t,o,p),it.circle(t,o,p)},a}var Ase=F(()=>{"use strict";St();Ht();Zt();Xt();Kt();er();s(Ese,"anchor")});function Rse(e,t,r,n,i,a,o){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)*(o?-1:1),b=h-v*i*Math.cos(d)*(o?-1:1),T=Math.atan2((t-b)/a,(e-x)/i),C=Math.atan2((n-b)/a,(r-x)/i)-T;o&&C<0&&(C+=2*Math.PI),!o&&C>0&&(C-=2*Math.PI);let S=[];for(let k=0;k<20;k++){let R=k/19,M=T+R*C,P=x+i*Math.cos(M),N=b+a*Math.sin(M);S.push({x:P,y:N})}return S}function kKe(e,t,r){let[n,i]=[t,r].sort((a,o)=>o-a);return i*(1-Math.sqrt(1-(e/n/2)**2))}async function _se(e,t){let{labelStyles:r,nodeStyles:n}=st(t);t.labelStyle=r;let i=t.padding??0,a=t.look==="neo"?16:i,o=t.look==="neo"?12:i,l=s(M=>M+o,"calcTotalHeight"),u=s(M=>{let P=M/2;return[P/(2.5+M/50),P]},"calcEllipseRadius"),{shapeSvg:h,bbox:d}=await yt(e,t,vt(t)),f=l(t?.height?t?.height:d.height),[p,m]=u(f),g=kKe(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},...Rse(-v/2,-x/2,-v/2,x/2,p,m,!1),{x:v/2,y:x/2},...Rse(v/2,x/2,v/2,-x/2,p,m,!0)],w=ot.svg(h),C=ft(t,{});t.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");let S=hr(T),k=w.path(S,C),R=h.insert(()=>k,":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)`),ht(t,R),t.intersect=function(M){return it.polygon(t,T,M)},h}var Lse=F(()=>{"use strict";Ht();Zt();Xt();Kt();s(Rse,"generateArcPoints");s(kKe,"calculateArcSagitta");s(_se,"bowTieRect")});async function Dse(e,t,{config:{themeVariables:r}}){let{labelStyles:n,nodeStyles:i}=st(t);t.labelStyle=n;let{shapeSvg:a,bbox:o,label:l}=await yt(e,t,vt(t)),u=r?.nodeBorder??r?.lineColor??"currentColor",h=t.padding??12,d=Math.max(o.width+h*2,t.width??0,80),f=Math.max(Math.min(d*.08,12),5),p=Math.max(o.height+h*2+f,t.height??0),m=-p/2+f,g=p/2,y=d*.72,v=[`M${-d/2},${m}`,`L${-y/2},${g}`,`A${y/2},${f} 0 0 0 ${y/2},${g}`,`L${d/2},${m}`,`A${d/2},${f} 0 0 0 ${-d/2},${m}`,"Z"].join(" "),{cssStyles:x}=t,b=a.insert("g",":first-child").attr("class","basic label-container");if(t.look==="handDrawn"){let R=ot.svg(a).path(v,ft(t,{}));b.node()?.appendChild(R),x&&b.attr("style",x)}else b.append("path").attr("d",v).attr("style",i);b.append("ellipse").attr("cx",0).attr("cy",m).attr("rx",d/2).attr("ry",f).attr("style",`fill:none;stroke:${u};stroke-width:1px`),ht(t,b);let T=m+(g-m)/2;l.attr("transform",`translate(${-(o.width/2)-(o.x-(o.left??0))}, ${T-o.height/2-(o.y-(o.top??0))})`);let w=12,C=s((k,R,M)=>Array.from({length:w+1},(P,N)=>{let _=Math.PI-N*Math.PI/w;return{x:k*Math.cos(_),y:R+M*f*Math.sin(_)}}),"arc"),S=[...C(d/2,m,-1),...C(y/2,g,1).reverse()];return t.intersect=function(k){return it.polygon(t,S,k)},a}var Ise=F(()=>{"use strict";Ht();Zt();Xt();Kt();s(Dse,"bucket")});var Mi,ic=F(()=>{"use strict";Mi=s((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 Mse(e,t){let{themeVariables:r}=Pe(),n=r.clusterBkg,i=r.clusterBorder,{nodeStyles:a}=st(t),{shapeSvg:o,bbox:l}=await yt(e,t,vt(t)),u=t.padding??8,h=l.height,d=Math.max(l.width+u*2,EKe,t?.width??0),f=Math.max(h+PP+NP+u*2,t?.height??0),p=-d/2,m=-f/2,g=-(PP+NP)/2,y=o.select(".label");y&&(t.useHtmlLabels??ai(Pe())?y.attr("transform",`translate(${-l.width/2}, ${-l.height/2+g})`):y.attr("transform",`translate(0, ${-l.height/2+g})`));let v;if(t.look==="handDrawn"){let C=ot.svg(o),S=ft(t,{fill:n,stroke:i,fillStyle:"solid"}),k=C.path(Mi(p,m,d,f,OP),S);v=o.insert(()=>k,":first-child"),v.attr("class","basic label-container collapsed-group").attr("style",un(t.cssStyles))}else v=o.insert("rect",":first-child"),v.attr("class","basic label-container collapsed-group").attr("style",a).attr("rx",OP).attr("ry",OP).attr("x",p).attr("y",m).attr("width",d).attr("height",f).attr("fill",n).attr("stroke",i);let x=m+u+h+PP;o.append("line").attr("class","collapsed-separator").attr("x1",p+8).attr("y1",x).attr("x2",p+d-8).attr("y2",x).attr("stroke",i).attr("stroke-dasharray","3, 3");let b=x+NP/2,T=2.5,w=10;for(let C=-1;C<=1;C++)o.append("circle").attr("class","collapsed-indicator").attr("cx",C*w).attr("cy",b).attr("r",T).attr("fill",i);return ht(t,v),t.calcIntersect=function(C,S){return it.rect(C,S)},t.intersect=function(C){return it.rect(t,C)},o}var NP,PP,EKe,OP,Nse=F(()=>{"use strict";Jt();br();Ht();Zt();ic();Xt();Kt();er();NP=20,PP=8,EKe=80,OP=8;s(Mse,"collapsedGroup")});function Na(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 iu=F(()=>{"use strict";s(Na,"insertPolygonShape")});async function Ose(e,t){let r=t,{shapeSvg:n,bbox:i}=await yt(e,r,vt(r)),a=r.padding??0,o=i.height+2*a,l=o/2,u=i.width+2*l+a,h=r.width??0,f=r.positioned&&(r.widthInColumns??1)>1&&h>u?h:u,p=LKe(r.directions??[],i,r,f),m=Na(n,f,o,p);return m.attr("style",r.style??null),ht(r,m),r.intersect=function(g){return it.polygon(r,p,g)},n}var AKe,BP,RKe,_Ke,Pse,LKe,Bse=F(()=>{"use strict";Zt();iu();Ht();AKe=["right","left","up","down"],BP="point",RKe=s(e=>{let t=new Set;for(let r of e)switch(r){case"x":t.add("right"),t.add("left");break;case"y":t.add("up"),t.add("down");break;default:t.add(r);break}return t},"expandAndDeduplicateDirections"),_Ke=s(e=>AKe.filter(t=>e.has(t)).join("|")||BP,"getDirectionKey"),Pse={"right|left|up|down":s(({height:e,midpoint:t,padding:r,width:n})=>[{x:0,y:0},{x:t,y:0},{x:n/2,y:2*r},{x:n-t,y:0},{x:n,y:0},{x:n,y:-e/3},{x:n+2*r,y:-e/2},{x:n,y:-2*e/3},{x:n,y:-e},{x:n-t,y:-e},{x:n/2,y:-e-2*r},{x:t,y:-e},{x:0,y:-e},{x:0,y:-2*e/3},{x:-2*r,y:-e/2},{x:0,y:-e/3}],"right|left|up|down"),"right|left|up":s(({height:e,midpoint:t,width:r})=>[{x:t,y:0},{x:r-t,y:0},{x:r,y:-e/2},{x:r-t,y:-e},{x:t,y:-e},{x:0,y:-e/2}],"right|left|up"),"right|left|down":s(({height:e,midpoint:t,width:r})=>[{x:0,y:0},{x:t,y:-e},{x:r-t,y:-e},{x:r,y:0}],"right|left|down"),"right|up|down":s(({height:e,midpoint:t,width:r})=>[{x:0,y:0},{x:r,y:-t},{x:r,y:-e+t},{x:0,y:-e}],"right|up|down"),"left|up|down":s(({height:e,midpoint:t,width:r})=>[{x:r,y:0},{x:0,y:-t},{x:0,y:-e+t},{x:r,y:-e}],"left|up|down"),"right|left":s(({height:e,midpoint:t,padding:r,width:n})=>[{x:t,y:0},{x:t,y:-r},{x:n-t,y:-r},{x:n-t,y:0},{x:n,y:-e/2},{x:n-t,y:-e},{x:n-t,y:-e+r},{x:t,y:-e+r},{x:t,y:-e},{x:0,y:-e/2}],"right|left"),"up|down":s(({height:e,midpoint:t,padding:r,width:n})=>[{x:n/2,y:0},{x:0,y:-r},{x:t,y:-r},{x:t,y:-e+r},{x:0,y:-e+r},{x:n/2,y:-e},{x:n,y:-e+r},{x:n-t,y:-e+r},{x:n-t,y:-r},{x:n,y:-r}],"up|down"),"right|up":s(({height:e,midpoint:t,width:r})=>[{x:0,y:0},{x:r,y:-t},{x:0,y:-e}],"right|up"),"right|down":s(({height:e,width:t})=>[{x:0,y:0},{x:t,y:0},{x:0,y:-e}],"right|down"),"left|up":s(({height:e,midpoint:t,width:r})=>[{x:r,y:0},{x:0,y:-t},{x:r,y:-e}],"left|up"),"left|down":s(({height:e,width:t})=>[{x:t,y:0},{x:0,y:0},{x:t,y:-e}],"left|down"),right:s(({height:e,midpoint:t,padding:r,width:n})=>[{x:t,y:-r},{x:t,y:-r},{x:n-t,y:-r},{x:n-t,y:0},{x:n,y:-e/2},{x:n-t,y:-e},{x:n-t,y:-e+r},{x:t,y:-e+r},{x:t,y:-e+r}],"right"),left:s(({height:e,midpoint:t,padding:r,width:n})=>[{x:t,y:0},{x:t,y:-r},{x:n-t,y:-r},{x:n-t,y:-e+r},{x:t,y:-e+r},{x:t,y:-e},{x:0,y:-e/2}],"left"),up:s(({height:e,midpoint:t,padding:r,width:n})=>[{x:t,y:-r},{x:t,y:-e+r},{x:0,y:-e+r},{x:n/2,y:-e},{x:n,y:-e+r},{x:n-t,y:-e+r},{x:n-t,y:-r}],"up"),down:s(({height:e,midpoint:t,padding:r,width:n})=>[{x:n/2,y:0},{x:0,y:-r},{x:t,y:-r},{x:t,y:-e+r},{x:n-t,y:-e+r},{x:n-t,y:-r},{x:n,y:-r}],"down"),[BP]:()=>[{x:0,y:0}]},LKe=s((e,t,r,n)=>{let i=RKe(e),a=(r.padding??0)/2,o=t.height+4*a,l=o/2,u=n??t.width+2*l+2*a,h=_Ke(i);return(Pse[h]??Pse[BP])({height:o,midpoint:l,padding:a,width:u})},"getArrowPoints");s(Ose,"block_arrow")});async function $se(e,t,{config:{themeVariables:r}}){let{labelStyles:n,nodeStyles:i}=st(t);t.labelStyle=n;let{shapeSvg:a,bbox:o,label:l}=await yt(e,t,vt(t)),u=r?.nodeBorder??r?.lineColor??"currentColor",h=t.padding??12,d=18,f=12,p=Math.max(o.width+h*2,t.width??0,90),m=Math.max(o.height+h*2+d,t.height??0),g=-m/2,{cssStyles:y}=t,v=a.insert("g",":first-child").attr("class","basic label-container");if(t.look==="handDrawn"){let T=ot.svg(a).path(Mi(-p/2,g,p,m,f),ft(t,{}));v.node()?.appendChild(T),y&&v.attr("style",y)}else v.append("rect").attr("x",-p/2).attr("y",g).attr("width",p).attr("height",m).attr("rx",f).attr("ry",f).attr("style",i);v.append("line").attr("x1",-p/2).attr("y1",g+d).attr("x2",p/2).attr("y2",g+d).attr("style",`stroke:${u};stroke-width:1px`);for(let b=0;b<3;b++)v.append("circle").attr("cx",-p/2+12+b*9).attr("cy",g+d/2).attr("r",2.5).attr("style",`fill:${u};stroke:none`);v.append("rect").attr("class","browser-address-bar").attr("x",-p/2+44).attr("y",g+4).attr("width",Math.max(p-56,10)).attr("height",d-8).attr("rx",3).attr("ry",3).attr("style",`fill:none;stroke:${u};stroke-width:1px;opacity:0.6`),ht(t,v);let x=g+d+(m-d)/2;return l.attr("transform",`translate(${-(o.width/2)-(o.x-(o.left??0))}, ${x-o.height/2-(o.y-(o.top??0))})`),t.intersect=function(b){return it.rect(t,b)},a}var Fse=F(()=>{"use strict";Ht();Zt();ic();Xt();Kt();s($se,"browser")});async function Gse(e,t){let{labelStyles:r,nodeStyles:n}=st(t);t.labelStyle=r;let i=t.padding??0,a=t.look==="neo"?28:i,o=t.look==="neo"?24:i,{shapeSvg:l,bbox:u}=await yt(e,t,vt(t)),h=(t?.width??u.width)+(t.look==="neo"?a*2:a+w4),d=(t?.height??u.height)+(t.look==="neo"?o*2:o),f=0,p=h,m=-d,g=0,y=[{x:f+w4,y:m},{x:p,y:m},{x:p,y:g},{x:f,y:g},{x:f,y:m+w4},{x:f+w4,y:m}],v,{cssStyles:x}=t;if(t.look==="handDrawn"){let b=ot.svg(l),T=ft(t,{}),w=hr(y),C=b.path(w,T);v=l.insert(()=>C,":first-child").attr("transform",`translate(${-h/2}, ${d/2})`),x&&v.attr("style",x)}else v=Na(l,h,d,y);return n&&v.attr("style",n),ht(t,v),t.intersect=function(b){return it.polygon(t,y,b)},l}var w4,zse=F(()=>{"use strict";Ht();Zt();Xt();Kt();iu();Ht();w4=12;s(Gse,"card")});function Vse(e,t){let{nodeStyles:r}=st(t);t.label="";let n=e.insert("g").attr("class",vt(t)).attr("id",t.domId??t.id),{cssStyles:i}=t,a=Math.max(28,t.width??0),o=[{x:0,y:a/2},{x:a/2,y:0},{x:0,y:-a/2},{x:-a/2,y:0}],l=ot.svg(n),u=ft(t,{});t.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");let h=hr(o),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 it.polygon(t,o,p)},n}var Wse=F(()=>{"use strict";Zt();Kt();Xt();Ht();s(Vse,"choice")});async function k4(e,t,r){let{labelStyles:n,nodeStyles:i}=st(t);t.labelStyle=n;let{shapeSvg:a,bbox:o,halfPadding:l}=await yt(e,t,vt(t)),u=16,h=r?.padding??l,d=t.look==="neo"?o.width/2+u*2:o.width/2+h,f,{cssStyles:p}=t;if(t.look==="handDrawn"){let m=ot.svg(a),g=ft(t,{}),y=m.circle(0,0,d*2,g);f=a.insert(()=>y,":first-child"),f.attr("class","basic label-container").attr("style",un(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 ht(t,f),t.calcIntersect=function(m,g){let y=m.width/2;return it.circle(m,y,g)},t.intersect=function(m){return se.info("Circle intersect",t,d,m),it.circle(t,d,m)},a}var $P=F(()=>{"use strict";Kt();St();er();Zt();Xt();Ht();s(k4,"circle")});async function qse(e,t){let r=t,n=["node",r.cssClasses,r.class].filter(Boolean).join(" "),{shapeSvg:i,bbox:a,halfPadding:o}=await yt(e,r,n),l=i.insert("rect",":first-child"),u=r.padding??0,h=r.positioned?r.width??0:a.width+u,d=r.positioned?r.height??0:a.height+u,f=r.positioned?-h/2:-a.width/2-o,p=r.positioned?-d/2:-a.height/2-o;return l.attr("class","basic cluster composite label-container").attr("style",r.style??null).attr("rx",r.rx??null).attr("ry",r.ry??null).attr("x",f).attr("y",p).attr("width",h).attr("height",d),ht(r,l),r.intersect=function(m){return it.rect(r,m)},i}var Hse=F(()=>{"use strict";Zt();Ht();s(qse,"composite")});async function Use(e,t,{config:{themeVariables:r}}){let{labelStyles:n,nodeStyles:i}=st(t);t.labelStyle=n;let{shapeSvg:a,bbox:o,label:l}=await yt(e,t,vt(t)),u=r?.nodeBorder??r?.lineColor??"currentColor",h=t.padding??12,d=20,f=12,p=Math.max(o.width+h*2,t.width??0,90),m=Math.max(o.height+h*2+d,t.height??0),g=-m/2,{cssStyles:y}=t,v=a.insert("g",":first-child").attr("class","basic label-container");if(t.look==="handDrawn"){let T=ot.svg(a).path(Mi(-p/2,g,p,m,f),ft(t,{}));v.node()?.appendChild(T),y&&v.attr("style",y)}else v.append("rect").attr("x",-p/2).attr("y",g).attr("width",p).attr("height",m).attr("rx",f).attr("ry",f).attr("style",i);v.append("text").attr("x",-p/2+12).attr("y",g+16).attr("class","console-glyph").attr("style",`font-family:monospace;font-weight:bold;font-size:14px;fill:${u}`).text(">_"),ht(t,v);let x=g+d+(m-d)/2;return l.attr("transform",`translate(${-(o.width/2)-(o.x-(o.left??0))}, ${x-o.height/2-(o.y-(o.top??0))})`),t.intersect=function(b){return it.rect(t,b)},a}var Yse=F(()=>{"use strict";Ht();Zt();ic();Xt();Kt();s(Use,"consoleWindow")});function DKe(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},o={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 ${o.x},${o.y}`}function jse(e,t){let{labelStyles:r,nodeStyles:n}=st(t);t.labelStyle=r,t.label="";let i=e.insert("g").attr("class",vt(t)).attr("id",t.domId??t.id),a=Math.max(30,t?.width??0),{cssStyles:o}=t,l=ot.svg(i),u=ft(t,{});t.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");let h=l.circle(0,0,a*2,u),d=DKe(a),f=l.path(d,u),p=i.insert(()=>h,":first-child");return p.insert(()=>f),p.attr("class","outer-path"),o&&t.look!=="handDrawn"&&p.selectAll("path").attr("style",o),n&&t.look!=="handDrawn"&&p.selectAll("path").attr("style",n),ht(t,p),t.intersect=function(m){return se.info("crossedCircle intersect",t,{radius:a,point:m}),it.circle(t,a,m)},i}var Xse=F(()=>{"use strict";St();Ht();Xt();Kt();Zt();s(DKe,"createLine");s(jse,"crossedCircle")});function ef(e,t,r,n=100,i=0,a=180){let o=[],l=i*Math.PI/180,d=(a*Math.PI/180-l)/(n-1);for(let f=0;fC,":first-child").attr("stroke-opacity",0),S.insert(()=>T,":first-child"),S.attr("class","text"),p&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",p),n&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",n),S.attr("transform",`translate(${f}, 0)`),o.attr("transform",`translate(${-h/2+f-(a.x-(a.left??0))},${-d/2+(t.padding??0)/2-(a.y-(a.top??0))})`),ht(t,S),t.intersect=function(k){return it.polygon(t,g,k)},i}var Zse=F(()=>{"use strict";Ht();Zt();Xt();Kt();s(ef,"generateCirclePoints");s(Kse,"curlyBraceLeft")});function tf(e,t,r,n=100,i=0,a=180){let o=[],l=i*Math.PI/180,d=(a*Math.PI/180-l)/(n-1);for(let f=0;fC,":first-child").attr("stroke-opacity",0),S.insert(()=>T,":first-child"),S.attr("class","text"),p&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",p),n&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",n),S.attr("transform",`translate(${-f}, 0)`),o.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))})`),ht(t,S),t.intersect=function(k){return it.polygon(t,g,k)},i}var Jse=F(()=>{"use strict";Ht();Zt();Xt();Kt();s(tf,"generateCirclePoints");s(Qse,"curlyBraceRight")});function gs(e,t,r,n=100,i=0,a=180){let o=[],l=i*Math.PI/180,d=(a*Math.PI/180-l)/(n-1);for(let f=0;fM,":first-child").attr("stroke-opacity",0),P.insert(()=>w,":first-child"),P.insert(()=>k,":first-child"),P.attr("class","text"),p&&t.look!=="handDrawn"&&P.selectAll("path").attr("style",p),n&&t.look!=="handDrawn"&&P.selectAll("path").attr("style",n),P.attr("transform",`translate(${f-f/4}, 0)`),o.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))})`),ht(t,P),t.intersect=function(N){return it.polygon(t,y,N)},i}var toe=F(()=>{"use strict";Ht();Zt();Xt();Kt();s(gs,"generateCirclePoints");s(eoe,"curlyBraces")});async function roe(e,t){let{labelStyles:r,nodeStyles:n}=st(t);t.labelStyle=r;let i=t.padding??0,a=t.look==="neo"?16:i,o=t.look==="neo"?12:i,l=20,u=5,{shapeSvg:h,bbox:d}=await yt(e,t,vt(t)),f=Math.max(l,(d.width+a*2)*1.25,t?.width??0),p=Math.max(u,d.height+o*2,t?.height??0),m=p/2,{cssStyles:g}=t,y=ot.svg(h),v=ft(t,{});t.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");let x=f,b=p,T=x-m,w=b/4,C=[{x:T,y:0},{x:w,y:0},{x:0,y:b/2},{x:w,y:b},{x:T,y:b},...Ho(-T,-b/2,m,50,270,90)],S=hr(C),k=y.path(S,v),R=h.insert(()=>k,":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})`),ht(t,R),t.intersect=function(M){return it.polygon(t,C,M)},h}var noe=F(()=>{"use strict";Ht();Zt();Xt();Kt();s(roe,"curvedTrapezoid")});async function ioe(e,t){let{labelStyles:r,nodeStyles:n}=st(t);t.labelStyle=r;let{shapeSvg:i,bbox:a,label:o}=await yt(e,t,vt(t)),l=t.padding??20,u=Math.max(a.width+l*2,t.width??0,100),h=Math.min(Math.max(u*.23,16),56),d=h*.27,f=Math.max(a.height+l*2,t.height?t.height-(2*h-d):0),p=Math.min(u*.177,f*.45),m=f+2*h-d,g=-m/2,y=g+2*h-d,v=i.insert("g",":first-child").attr("class","basic label-container"),{cssStyles:x}=t;if(t.look==="handDrawn"){let R=ot.svg(i),M=ft(t,{}),P=R.path(Mi(-u/2,y,u,f,p),M),N=R.circle(0,g+h,h*2,M);v.insert(()=>N,":first-child"),v.insert(()=>P,":first-child"),x&&v.attr("style",x)}else v.append("rect").attr("x",-u/2).attr("y",y).attr("width",u).attr("height",f).attr("rx",p).attr("ry",p).attr("style",n),v.append("circle").attr("cx",0).attr("cy",g+h).attr("r",h).attr("style",n);ht(t,v);let b=y+f/2;o.attr("transform",`translate(${-(a.width/2)-(a.x-(a.left??0))}, ${b-a.height/2-(a.y-(a.top??0))})`);let T=g+h,w=Math.asin(Math.min(1,(y-T)/h))*180/Math.PI,k=[...Ho(0,-T,h,24,180+w,-w),...Ho(-(-u/2+p),-(y+p),p,12,90,0),...Ho(-(-u/2+p),-(m/2-p),p,12,360,270),...Ho(-(u/2-p),-(m/2-p),p,12,270,180),...Ho(-(u/2-p),-(y+p),p,12,180,90)];return t.intersect=function(R){return it.polygon(t,k,R)},i}var aoe=F(()=>{"use strict";Ht();Zt();Xt();Kt();ic();s(ioe,"person")});async function loe(e,t){let{labelStyles:r,nodeStyles:n}=st(t);t.labelStyle=r;let i=t.padding??0,a=t.look==="neo"?24:i,o=t.look==="neo"?24:i,l=t.width??0;if(t.width&&(t.width=t.width-o,t.widthS,":first-child"),y=u.insert(()=>C,":first-child"),y.attr("class","basic label-container"),v&&y.attr("style",v)}else{let x=IKe(0,0,f,g,p,m);y=u.insert("path",":first-child").attr("d",x).attr("class","basic label-container outer-path").attr("style",un(v)).attr("style",n)}return y.attr("label-offset-y",m),y.attr("transform",`translate(${-f/2}, ${-(g/2+m)})`),ht(t,y),d.attr("transform",`translate(${-(h.width/2)-(h.x-(h.left??0))}, ${-(h.height/2)+(t.padding??0)/1.5-(h.y-(h.top??0))})`),t.intersect=function(x){let b=it.rect(t,x),T=b.x-(t.x??0);if(p!=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-m)){let w=m*m*(1-T*T/(p*p));w>0&&(w=Math.sqrt(w)),w=m-w,x.y-(t.y??0)>0&&(w=-w),b.y+=w}return b},u}var IKe,MKe,NKe,soe,ooe,coe=F(()=>{"use strict";Ht();Zt();Xt();Kt();er();IKe=s((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"),MKe=s((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"),NKe=s((e,t,r,n,i,a)=>[`M${e-r/2},${-n/2}`,`a${i},${a} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),soe=8,ooe=8;s(loe,"cylinder")});async function ac(e,t,r){let{labelStyles:n,nodeStyles:i}=st(t);t.labelStyle=n;let{shapeSvg:a,bbox:o}=await yt(e,t,vt(t)),l=Math.max(o.width+r.labelPaddingX*2,t?.width||0),u=Math.max(o.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=ot.svg(a),v=ft(t,{}),x=p||m?y.path(Mi(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",un(g))}else f=a.insert("rect",":first-child"),f.attr("class","basic label-container").attr("style",i).attr("rx",un(p)).attr("ry",un(m)).attr("x",h).attr("y",d).attr("width",l).attr("height",u);return ht(t,f,t.look==="handDrawn"?void 0:{width:l,height:u}),t.calcIntersect=function(y,v){return it.rect(y,v)},t.intersect=function(y){return it.rect(t,y)},a}var km=F(()=>{"use strict";Ht();Zt();ic();Xt();Kt();er();s(ac,"drawRect")});async function uoe(e,t){let{cssClasses:r,labelPaddingX:n,labelPaddingY:i,padding:a,width:o,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=ot.svg(h),g=ft(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"))||o)??0,p=(Number(d.attr("height"))||l)??0;return f>0&&p>0&&d.attr("stroke-dasharray",`${f} ${p}`),h}var hoe=F(()=>{"use strict";km();Xt();Kt();s(uoe,"datastore")});async function doe(e,t){let{labelStyles:r,nodeStyles:n}=st(t);t.labelStyle=r;let i=t.look==="neo"?16:t.padding??0,a=t.look==="neo"?16:t.padding??0,{shapeSvg:o,bbox:l,label:u}=await yt(e,t,vt(t)),h=l.width+i,d=l.height+a,f=d*.2,p=-h/2,m=-d/2-f/2,{cssStyles:g}=t,y=ot.svg(o),v=ft(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(w=>[w.x,w.y]),v),T=o.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))})`),ht(t,T),t.intersect=function(w){return it.rect(t,w)},o}var foe=F(()=>{"use strict";Ht();Zt();Xt();Kt();s(doe,"dividedRectangle")});async function poe(e,t){let{labelStyles:r,nodeStyles:n}=st(t),i=t.look==="neo"?12:5;t.labelStyle=r;let a=t.padding??0,o=t.look==="neo"?16:a,{shapeSvg:l,bbox:u}=await yt(e,t,vt(t)),h=(t?.width?t?.width/2:u.width/2)+(o??0),d=h-i,f,{cssStyles:p}=t;if(t.look==="handDrawn"){let m=ot.svg(l),g=ft(t,{roughness:.2,strokeWidth:2.5}),y=ft(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",un(t.cssClasses)).attr("style",un(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 ht(t,f),t.intersect=function(m){return se.info("DoubleCircle intersect",t,h,m),it.circle(t,h,m)},l}var moe=F(()=>{"use strict";St();Ht();Zt();Xt();Kt();er();s(poe,"doublecircle")});function goe(e,t,{config:{themeVariables:r}}){let{labelStyles:n,nodeStyles:i}=st(t);t.label="",t.labelStyle=n;let a=e.insert("g").attr("class",vt(t)).attr("id",t.domId??t.id),o=7,{cssStyles:l}=t,u=ot.svg(a),{nodeBorder:h}=r,d=ft(t,{fillStyle:"solid"});t.look!=="handDrawn"&&(d.roughness=0);let f=u.circle(0,0,o*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),ht(t,p),t.intersect=function(m){return se.info("filledCircle intersect",t,{radius:o,point:m}),it.circle(t,o,m)},a}var yoe=F(()=>{"use strict";Kt();St();Zt();Xt();Ht();s(goe,"filledCircle")});async function boe(e,t){let{labelStyles:r,nodeStyles:n}=st(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,ht(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 se.info("Triangle intersect",t,p,T),it.polygon(t,p,T)},o}var voe,xoe,Toe=F(()=>{"use strict";St();Ht();Zt();Xt();Kt();Ht();voe=10,xoe=10;s(boe,"flippedTriangle")});async function Coe(e,t){let{labelStyles:r,nodeStyles:n}=st(t);t.labelStyle=r;let{shapeSvg:i,bbox:a,label:o}=await yt(e,t,vt(t)),l=t.padding??12,u=Math.max(a.width+l*2,t.width??0,90),h=a.height+l*2,d=Math.max(Math.min(h*.16,14),8),f=Math.max(h+d,t.height??0),p=f-d,m=Math.max(u*.38,28),g=-f/2,y=[{x:-u/2,y:g},{x:-u/2+m,y:g},{x:-u/2+m,y:g+d},{x:u/2,y:g+d},{x:u/2,y:f/2},{x:-u/2,y:f/2}],v=[`M${y[0].x},${y[0].y}`,...y.slice(1).map(w=>`L${w.x},${w.y}`),"Z"].join(" "),{cssStyles:x}=t,b;if(t.look==="handDrawn"){let C=ot.svg(i).path(v,ft(t,{}));b=i.insert(()=>C,":first-child").attr("class","basic label-container"),x&&b.attr("style",x)}else b=i.insert("path",":first-child").attr("d",v).attr("class","basic label-container").attr("style",n);t.look==="handDrawn"?ht(t,b):ht(t,b,{width:u,height:f});let T=g+d+p/2;return o.attr("transform",`translate(${-(a.width/2)-(a.x-(a.left??0))}, ${T-a.height/2-(a.y-(a.top??0))})`),t.intersect=function(w){return it.polygon(t,y,w)},i}var Soe=F(()=>{"use strict";Ht();Zt();Xt();Kt();s(Coe,"folder")});function woe(e,t,{dir:r,config:{state:n,themeVariables:i}}){let{nodeStyles:a}=st(t);t.label="";let o=e.insert("g").attr("class",vt(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=ot.svg(o),m=ft(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=o.insert(()=>g,":first-child");l&&t.look!=="handDrawn"&&y.selectAll("path").attr("style",l),a&&t.look!=="handDrawn"&&y.selectAll("path").attr("style",a),ht(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 it.rect(t,x)},o}var koe=F(()=>{"use strict";Kt();Zt();Xt();Ht();s(woe,"forkJoin")});async function Eoe(e,t){let{labelStyles:r,nodeStyles:n}=st(t);t.labelStyle=r;let i=15,a=10,o=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),ht(t,T),t.intersect=function(w){return se.info("Pill intersect",t,{radius:p,point:w}),it.polygon(t,v,w)},u}var Aoe=F(()=>{"use strict";St();Ht();Zt();Xt();Kt();s(Eoe,"halfRoundedRectangle")});async function Roe(e,t){let{labelStyles:r,nodeStyles:n}=st(t),i=t.look==="neo"?3.5:4;t.labelStyle=r;let a=t.padding??0,o=70,l=32,u=t.look==="neo"?o: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 yt(e,t,vt(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=ot.svg(d),T=ft(t,{}),w=PKe(0,0,g,p,m),C=b.path(w,T);v=d.insert(()=>C,":first-child").attr("transform",`translate(${-g/2}, ${p/2})`),x&&v.attr("style",x)}else v=Na(d,g,p,y);return n&&v.attr("style",n),t.width=g,t.height=p,ht(t,v),t.intersect=function(b){return it.polygon(t,y,b)},d}var PKe,_oe=F(()=>{"use strict";Ht();Zt();Xt();Kt();iu();PKe=s((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");s(Roe,"hexagon")});async function Loe(e,t){let{labelStyles:r,nodeStyles:n}=st(t);t.label="",t.labelStyle=r;let{shapeSvg:i}=await yt(e,t,vt(t)),a=Math.max(30,t?.width??0),o=Math.max(30,t?.height??0),{cssStyles:l}=t,u=ot.svg(i),h=ft(t,{});t.look!=="handDrawn"&&(h.roughness=0,h.fillStyle="solid");let d=[{x:0,y:0},{x:a,y:0},{x:0,y:o},{x:a,y:o}],f=hr(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}, ${-o/2})`),ht(t,m),t.intersect=function(g){return se.info("Pill intersect",t,{points:d}),it.polygon(t,d,g)},i}var Doe=F(()=>{"use strict";St();Ht();Zt();Xt();Kt();s(Loe,"hourglass")});async function Ioe(e,t,{config:{themeVariables:r,flowchart:n}}){let{labelStyles:i}=st(t);t.labelStyle=i;let a=t.assetHeight??48,o=t.assetWidth??48,l=Math.max(a,o),u=n?.wrappingWidth;t.width=Math.max(l,u??0);let{shapeSvg:h,bbox:d,label:f}=await yt(e,t,"icon-shape default"),p=t.pos==="t",m=l,g=l,{nodeBorder:y}=r,{stylesMap:v}=nu(t),x=-g/2,b=-m/2,T=t.label?8:0,w=ot.svg(h),C=ft(t,{stroke:"none",fill:"none"});t.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");let S=w.rectangle(x,b,g,m,C),k=Math.max(g,d.width),R=m+d.height+T,M=w.rectangle(-k/2,-R/2,k,R,{...C,fill:"transparent",stroke:"none"}),P=h.insert(()=>S,":first-child"),N=h.insert(()=>M);if(t.icon){let _=h.append("g");_.html(`${await ps(t.icon,{height:l,width:l,fallbackPrefix:""})} `);let A=_.node().getBBox(),I=A.width,D=A.height,L=A.x,B=A.y;_.attr("transform",`translate(${-I/2-L},${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})`),P.attr("transform",`translate(0,${p?d.height/2+T/2:-d.height/2-T/2})`),ht(t,N),t.intersect=function(_){if(se.info("iconSquare intersect",t,_),!t.label)return it.rect(t,_);let A=t.x??0,I=t.y??0,D=t.height??0,L=[];return p?L=[{x:A-d.width/2,y:I-D/2},{x:A+d.width/2,y:I-D/2},{x:A+d.width/2,y:I-D/2+d.height+T},{x:A+g/2,y:I-D/2+d.height+T},{x:A+g/2,y:I+D/2},{x:A-g/2,y:I+D/2},{x:A-g/2,y:I-D/2+d.height+T},{x:A-d.width/2,y:I-D/2+d.height+T}]:L=[{x:A-g/2,y:I-D/2},{x:A+g/2,y:I-D/2},{x:A+g/2,y:I-D/2+m},{x:A+d.width/2,y:I-D/2+m},{x:A+d.width/2/2,y:I+D/2},{x:A-d.width/2,y:I+D/2},{x:A-d.width/2,y:I-D/2+m},{x:A-g/2,y:I-D/2+m}],it.polygon(t,L,_)},h}var Moe=F(()=>{"use strict";Kt();St();Hl();Zt();Xt();Ht();s(Ioe,"icon")});async function Noe(e,t,{config:{themeVariables:r,flowchart:n}}){let{labelStyles:i}=st(t);t.labelStyle=i;let a=t.assetHeight??48,o=t.assetWidth??48,l=Math.max(a,o),u=n?.wrappingWidth;t.width=Math.max(l,u??0);let{shapeSvg:h,bbox:d,label:f}=await yt(e,t,"icon-shape default"),p=20,m=t.label?8:0,g=t.pos==="t",{nodeBorder:y,mainBkg:v}=r,{stylesMap:x}=nu(t),b=ot.svg(h),T=ft(t,{});t.look!=="handDrawn"&&(T.roughness=0,T.fillStyle="solid");let w=x.get("fill");T.stroke=w??v;let C=h.append("g");t.icon&&C.html(`${await ps(t.icon,{height:l,width:l,fallbackPrefix:""})} `);let S=C.node().getBBox(),k=S.width,R=S.height,M=S.x,P=S.y,N=Math.max(k,R)*Math.SQRT2+p*2,_=b.circle(0,0,N,T),A=Math.max(N,d.width),I=N+d.height+m,D=b.rectangle(-A/2,-I/2,A,I,{...T,fill:"transparent",stroke:"none"}),L=h.insert(()=>_,":first-child"),B=h.insert(()=>D);return C.attr("transform",`translate(${-k/2-M},${g?d.height/2+m/2-R/2-P:-d.height/2-m/2-R/2-P})`),C.attr("style",`color: ${x.get("stroke")??y};`),f.attr("transform",`translate(${-d.width/2-(d.x-(d.left??0))},${g?-I/2:I/2-d.height})`),L.attr("transform",`translate(0,${g?d.height/2+m/2:-d.height/2-m/2})`),ht(t,B),t.intersect=function(O){return se.info("iconSquare intersect",t,O),it.rect(t,O)},h}var Poe=F(()=>{"use strict";Kt();St();Hl();Zt();Xt();Ht();s(Noe,"iconCircle")});async function Ooe(e,t,{config:{themeVariables:r,flowchart:n}}){let{labelStyles:i}=st(t);t.labelStyle=i;let a=t.assetHeight??48,o=t.assetWidth??48,l=Math.max(a,o),u=n?.wrappingWidth;t.width=Math.max(l,u??0);let{shapeSvg:h,bbox:d,halfPadding:f,label:p}=await yt(e,t,"icon-shape default"),m=t.pos==="t",g=l+f*2,y=l+f*2,{nodeBorder:v,mainBkg:x}=r,{stylesMap:b}=nu(t),T=-y/2,w=-g/2,C=t.label?8:0,S=ot.svg(h),k=ft(t,{});t.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");let R=b.get("fill");k.stroke=R??x;let M=S.path(Mi(T,w,y,g,5),k),P=Math.max(y,d.width),N=g+d.height+C,_=S.rectangle(-P/2,-N/2,P,N,{...k,fill:"transparent",stroke:"none"}),A=h.insert(()=>M,":first-child").attr("class","icon-shape2"),I=h.insert(()=>_);if(t.icon){let D=h.append("g");D.html(`${await ps(t.icon,{height:l,width:l,fallbackPrefix:""})} `);let L=D.node().getBBox(),B=L.width,O=L.height,$=L.x,W=L.y;D.attr("transform",`translate(${-B/2-$},${m?d.height/2+C/2-O/2-W:-d.height/2-C/2-O/2-W})`),D.attr("style",`color: ${b.get("stroke")??v};`)}return p.attr("transform",`translate(${-d.width/2-(d.x-(d.left??0))},${m?-N/2:N/2-d.height})`),A.attr("transform",`translate(0,${m?d.height/2+C/2:-d.height/2-C/2})`),ht(t,I),t.intersect=function(D){if(se.info("iconSquare intersect",t,D),!t.label)return it.rect(t,D);let L=t.x??0,B=t.y??0,O=t.height??0,$=[];return m?$=[{x:L-d.width/2,y:B-O/2},{x:L+d.width/2,y:B-O/2},{x:L+d.width/2,y:B-O/2+d.height+C},{x:L+y/2,y:B-O/2+d.height+C},{x:L+y/2,y:B+O/2},{x:L-y/2,y:B+O/2},{x:L-y/2,y:B-O/2+d.height+C},{x:L-d.width/2,y:B-O/2+d.height+C}]:$=[{x:L-y/2,y:B-O/2},{x:L+y/2,y:B-O/2},{x:L+y/2,y:B-O/2+g},{x:L+d.width/2,y:B-O/2+g},{x:L+d.width/2/2,y:B+O/2},{x:L-d.width/2,y:B+O/2},{x:L-d.width/2,y:B-O/2+g},{x:L-y/2,y:B-O/2+g}],it.polygon(t,$,D)},h}var Boe=F(()=>{"use strict";Kt();St();Hl();Zt();Xt();ic();Ht();s(Ooe,"iconRounded")});async function $oe(e,t,{config:{themeVariables:r,flowchart:n}}){let{labelStyles:i}=st(t);t.labelStyle=i;let a=t.assetHeight??48,o=t.assetWidth??48,l=Math.max(a,o),u=n?.wrappingWidth;t.width=Math.max(l,u??0);let{shapeSvg:h,bbox:d,halfPadding:f,label:p}=await yt(e,t,"icon-shape default"),m=t.pos==="t",g=l+f*2,y=l+f*2,{nodeBorder:v,mainBkg:x}=r,{stylesMap:b}=nu(t),T=-y/2,w=-g/2,C=t.label?8:0,S=ot.svg(h),k=ft(t,{});t.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");let R=b.get("fill");k.stroke=R??x;let M=S.path(Mi(T,w,y,g,.1),k),P=Math.max(y,d.width),N=g+d.height+C,_=S.rectangle(-P/2,-N/2,P,N,{...k,fill:"transparent",stroke:"none"}),A=h.insert(()=>M,":first-child"),I=h.insert(()=>_);if(t.icon){let D=h.append("g");D.html(`${await ps(t.icon,{height:l,width:l,fallbackPrefix:""})} `);let L=D.node().getBBox(),B=L.width,O=L.height,$=L.x,W=L.y;D.attr("transform",`translate(${-B/2-$},${m?d.height/2+C/2-O/2-W:-d.height/2-C/2-O/2-W})`),D.attr("style",`color: ${b.get("stroke")??v};`)}return p.attr("transform",`translate(${-d.width/2-(d.x-(d.left??0))},${m?-N/2:N/2-d.height})`),A.attr("transform",`translate(0,${m?d.height/2+C/2:-d.height/2-C/2})`),ht(t,I),t.intersect=function(D){if(se.info("iconSquare intersect",t,D),!t.label)return it.rect(t,D);let L=t.x??0,B=t.y??0,O=t.height??0,$=[];return m?$=[{x:L-d.width/2,y:B-O/2},{x:L+d.width/2,y:B-O/2},{x:L+d.width/2,y:B-O/2+d.height+C},{x:L+y/2,y:B-O/2+d.height+C},{x:L+y/2,y:B+O/2},{x:L-y/2,y:B+O/2},{x:L-y/2,y:B-O/2+d.height+C},{x:L-d.width/2,y:B-O/2+d.height+C}]:$=[{x:L-y/2,y:B-O/2},{x:L+y/2,y:B-O/2},{x:L+y/2,y:B-O/2+g},{x:L+d.width/2,y:B-O/2+g},{x:L+d.width/2/2,y:B+O/2},{x:L-d.width/2,y:B+O/2},{x:L-d.width/2,y:B-O/2+g},{x:L-y/2,y:B-O/2+g}],it.polygon(t,$,D)},h}var Foe=F(()=>{"use strict";Kt();St();Hl();Zt();ic();Xt();Ht();s($oe,"iconSquare")});async function Goe(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:o}=st(t);t.labelStyle=o;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 yt(e,t,"image-shape default"),g=t.pos==="t",y=-h/2,v=-d/2,x=t.label?8:0,b=ot.svg(f),T=ft(t,{});t.look!=="handDrawn"&&(T.roughness=0,T.fillStyle="solid");let w=b.rectangle(y,v,h,d,T),C=Math.max(h,p.width),S=d+p.height+x,k=b.rectangle(-C/2,-S/2,C,S,{...T,fill:"none",stroke:"none"}),R=f.insert(()=>w,":first-child"),M=f.insert(()=>k);if(t.img){let P=f.append("image");P.attr("href",t.img),P.attr("width",h),P.attr("height",d),P.attr("preserveAspectRatio","none"),P.attr("transform",`translate(${-h/2},${g?S/2-d:-S/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})`),ht(t,M),t.intersect=function(P){if(se.info("iconSquare intersect",t,P),!t.label)return it.rect(t,P);let N=t.x??0,_=t.y??0,A=t.height??0,I=[];return g?I=[{x:N-p.width/2,y:_-A/2},{x:N+p.width/2,y:_-A/2},{x:N+p.width/2,y:_-A/2+p.height+x},{x:N+h/2,y:_-A/2+p.height+x},{x:N+h/2,y:_+A/2},{x:N-h/2,y:_+A/2},{x:N-h/2,y:_-A/2+p.height+x},{x:N-p.width/2,y:_-A/2+p.height+x}]:I=[{x:N-h/2,y:_-A/2},{x:N+h/2,y:_-A/2},{x:N+h/2,y:_-A/2+d},{x:N+p.width/2,y:_-A/2+d},{x:N+p.width/2/2,y:_+A/2},{x:N-p.width/2,y:_+A/2},{x:N-p.width/2,y:_-A/2+d},{x:N-h/2,y:_-A/2+d}],it.polygon(t,I,P)},f}var zoe=F(()=>{"use strict";Kt();St();Zt();Xt();Ht();s(Goe,"imageSquare")});async function Voe(e,t){let{labelStyles:r,nodeStyles:n}=st(t);t.labelStyle=r;let i=t.padding??0,a=i,o=t.look==="neo"?i*2:i,{shapeSvg:l,bbox:u}=await yt(e,t,vt(t)),h=Math.max(u.height+a*2,t.height??0),d=Math.max(u.width+o*2,(t.width??0)-h),f=[{x:0,y:0},{x:d,y:0},{x:d+3*h/6,y:-h},{x:-3*h/6,y:-h}],p,{cssStyles:m}=t;if(t.look==="handDrawn"){let g=ot.svg(l),y=ft(t,{}),v=hr(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=Na(l,d,h,f);return n&&p.attr("style",n),t.width=d,t.height=h,ht(t,p),t.intersect=function(g){return it.polygon(t,f,g)},l}var Woe=F(()=>{"use strict";Ht();Zt();Xt();Kt();iu();s(Voe,"inv_trapezoid")});async function qoe(e,t){let{shapeSvg:r,bbox:n,label:i}=await yt(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))})`),ht(t,a),t.intersect=function(u){return it.rect(t,u)},r}var Hoe=F(()=>{"use strict";km();Ht();Zt();s(qoe,"labelRect")});async function Uoe(e,t){let{labelStyles:r,nodeStyles:n}=st(t);t.labelStyle=r;let i=t.padding??0,a=i,o=t.look==="neo"?i*2:i,{shapeSvg:l,bbox:u}=await yt(e,t,vt(t)),h=Math.max(u.height+a,t.height??0),d=Math.max(u.width+o,(t.width??0)-h),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=ot.svg(l),y=ft(t,{}),v=hr(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=Na(l,d,h,f);return n&&p.attr("style",n),t.width=d,t.height=h,ht(t,p),t.intersect=function(g){return it.polygon(t,f,g)},l}var Yoe=F(()=>{"use strict";Ht();Zt();Xt();Kt();iu();s(Uoe,"lean_left")});async function joe(e,t){let{labelStyles:r,nodeStyles:n}=st(t);t.labelStyle=r;let i=t.padding??0,a=i,o=t.look==="neo"?i*2:i,{shapeSvg:l,bbox:u}=await yt(e,t,vt(t)),h=Math.max(u.height+a,t.height??0),d=Math.max(u.width+o,(t.width??0)-h),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=ot.svg(l),y=ft(t,{}),v=hr(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=Na(l,d,h,f);return n&&p.attr("style",n),t.width=d,t.height=h,ht(t,p),t.intersect=function(g){return it.polygon(t,f,g)},l}var Xoe=F(()=>{"use strict";Ht();Zt();Xt();Kt();iu();s(joe,"lean_right")});function Koe(e,t){let{labelStyles:r,nodeStyles:n}=st(t);t.label="",t.labelStyle=r;let i=e.insert("g").attr("class",vt(t)).attr("id",t.domId??t.id),{cssStyles:a}=t,o=Math.max(35,t?.width??0),l=Math.max(35,t?.height??0),u=7,h=[{x:o,y:0},{x:0,y:l+u/2},{x:o-2*u,y:l+u/2},{x:0,y:2*l},{x:o,y:l-u/2},{x:2*u,y:l-u/2}],d=ot.svg(i),f=ft(t,{});t.look!=="handDrawn"&&(f.roughness=0,f.fillStyle="solid");let p=hr(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(-${o/2},${-l})`),ht(t,g),t.intersect=function(y){return se.info("lightningBolt intersect",t,y),it.polygon(t,h,y)},i}var Zoe=F(()=>{"use strict";St();Ht();Xt();Kt();Zt();Ht();s(Koe,"lightningBolt")});async function ele(e,t){let{labelStyles:r,nodeStyles:n}=st(t);t.labelStyle=r;let i=t.padding??0,a=t.look==="neo"?16:i,o=t.look==="neo"?24:i;if(t.width||t.height){let x=t.width??0;t.width=(t.width??0)-a,t.widthS,":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=OKe(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",un(v)).attr("style",n)}return y.attr("label-offset-y",p),y.attr("transform",`translate(${-d/2}, ${-(m/2+p)})`),ht(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=it.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 w=p*p*(1-T*T/(f*f));w>0&&(w=Math.sqrt(w)),w=p-w,x.y-(t.y??0)>0&&(w=-w),b.y+=w}return b},l}var OKe,BKe,$Ke,Qoe,Joe,tle=F(()=>{"use strict";Ht();Zt();Xt();Kt();er();OKe=s((e,t,r,n,i,a,o)=>[`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+o}`,`a${i},${a} 0,0,0 ${r},0`].join(" "),"createCylinderPathD"),BKe=s((e,t,r,n,i,a,o)=>[`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+o}`,`a${i},${a} 0,0,0 ${r},0`].join(" "),"createOuterCylinderPathD"),$Ke=s((e,t,r,n,i,a)=>[`M${e-r/2},${-n/2}`,`a${i},${a} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),Qoe=10,Joe=10;s(ele,"linedCylinder")});async function rle(e,t){let{labelStyles:r,nodeStyles:n}=st(t);t.labelStyle=r;let i=t.padding??0,a=t.look==="neo"?16:i,o=t.look==="neo"?12:i;if(t.width||t.height){let w=t.width;t.width=(w??0)*10/11-a*2,t.width<10&&(t.width=10),t.height=(t?.height??0)-o*2,t.height<10&&(t.height=10)}let{shapeSvg:l,bbox:u,label:h}=await yt(e,t,vt(t)),d=(t?.width?t?.width:u.width)+(a??0)*2,f=(t?.height?t?.height:u.height)+(o??0)*2,p=t.look==="neo"?f/4:f/8,m=f+p,{cssStyles:g}=t,y=ot.svg(l),v=ft(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},...vl(-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(w=>[w.x,w.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))})`),ht(t,T),t.intersect=function(w){return it.polygon(t,x,w)},l}var nle=F(()=>{"use strict";Ht();Zt();Kt();Xt();s(rle,"linedWaveEdgedRect")});async function ile(e,t){let{labelStyles:r,nodeStyles:n}=st(t);t.labelStyle=r;let i=t.padding??0,a=t.look==="neo"?16:i,o=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)-o*2-2*l,10));let{shapeSvg:u,bbox:h,label:d}=await yt(e,t,vt(t)),f=(t?.width?t?.width:h.width)+a*2+2*l,p=(t?.height?t?.height:h.height)+o*2+2*l,m=f-2*l,g=p-2*l,y=-m/2,v=-g/2,{cssStyles:x}=t,b=ot.svg(u),T=ft(t,{}),w=[{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 S=hr(w),k=b.path(S,T),R=hr(C),M=b.path(R,T);t.look!=="handDrawn"&&(k=mP(k),M=mP(M));let P=u.insert("g",":first-child");return P.insert(()=>k),P.insert(()=>M),P.attr("class","basic label-container outer-path"),x&&t.look!=="handDrawn"&&P.selectAll("path").attr("style",x),n&&t.look!=="handDrawn"&&P.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))})`),ht(t,P),t.intersect=function(N){return it.polygon(t,w,N)},u}var ale=F(()=>{"use strict";Ht();Xt();Kt();Zt();s(ile,"multiRect")});async function sle(e,t){let{labelStyles:r,nodeStyles:n}=st(t);t.labelStyle=r;let{shapeSvg:i,bbox:a,label:o}=await yt(e,t,vt(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=vl(y-x,v+g+x,y+f-x,v+g+x,m,.8),w=T?.[T.length-1],C=[{x:y-x,y:v+x},{x:y-x,y:v+g+x},...T,{x:y+f-x,y:w.y-x},{x:y+f,y:w.y-x},{x:y+f,y:w.y-2*x},{x:y+f+x,y:w.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}],S=[{x:y,y:v+x},{x:y+f-x,y:v+x},{x:y+f-x,y:w.y-x},{x:y+f,y:w.y-x},{x:y+f,y:v},{x:y,y:v}],k=ot.svg(i),R=ft(t,{});t.look!=="handDrawn"&&(R.roughness=0,R.fillStyle="solid");let M=hr(C),P=k.path(M,R),N=hr(S),_=k.path(N,R),A=i.insert(()=>P,":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})`),o.attr("transform",`translate(${-(a.width/2)-x-(a.x-(a.left??0))}, ${-(a.height/2)+x-m/2-(a.y-(a.top??0))})`),ht(t,A),t.intersect=function(I){return it.polygon(t,C,I)},i}var ole=F(()=>{"use strict";Ht();Zt();Kt();Xt();s(sle,"multiWaveEdgedRectangle")});async function lle(e,t,{config:{themeVariables:r}}){let{labelStyles:n,nodeStyles:i}=st(t);t.labelStyle=n,t.useHtmlLabels||ai(Lt())||(t.centerLabel=!0);let{shapeSvg:o,bbox:l,label:u}=await yt(e,t,vt(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=ot.svg(o),y=ft(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=o.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))})`),ht(t,x),t.intersect=function(b){return it.rect(t,b)},o}var cle=F(()=>{"use strict";Kt();Zt();Xt();Ht();br();br();s(lle,"note")});async function ule(e,t){let{labelStyles:r,nodeStyles:n}=st(t);t.labelStyle=r;let{shapeSvg:i,bbox:a}=await yt(e,t,vt(t)),o=a.width+(t.padding??0),l=a.height+(t.padding??0),u=o+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=ot.svg(i),g=ft(t,{}),y=FKe(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=Na(i,u,u,d),f.attr("transform",`translate(${-u/2+h}, ${u/2})`);return n&&f.attr("style",n),ht(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=it.polygon(m,v,g);return{x:x.x-.5,y:x.y-.5}},t.intersect=function(m){return this.calcIntersect(t,m)},i}var FKe,hle=F(()=>{"use strict";Ht();Zt();Xt();Kt();iu();FKe=s((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");s(ule,"question")});async function dle(e,t){let{labelStyles:r,nodeStyles:n}=st(t);t.labelStyle=r;let i=t.padding??0,a=t.look==="neo"?21:i??0,o=t.look==="neo"?12:i??0,{shapeSvg:l,bbox:u,label:h}=await yt(e,t,vt(t)),d=u.width+(t.look==="neo"?a*2:a),f=Math.max(u.height+(t.look==="neo"?o*2:o),t.height??0),p=f/4,g=-Math.max(d,(t.width??0)-p)/2,y=-f/2,v=y/2,x=[{x:g+v,y},{x:g,y:0},{x:g+v,y:-y},{x:-g,y:-y},{x:-g,y}],{cssStyles:b}=t,T=ot.svg(l),w=ft(t,{});t.look!=="handDrawn"&&(w.roughness=0,w.fillStyle="solid");let C=hr(x),S=T.path(C,w),k=l.insert(()=>S,":first-child");return k.attr("class","basic label-container outer-path"),b&&t.look!=="handDrawn"&&k.selectAll("path").attr("style",b),n&&t.look!=="handDrawn"&&k.selectAll("path").attr("style",n),k.attr("transform",`translate(${-v/2},0)`),h.attr("transform",`translate(${-v/2-u.width/2-(u.x-(u.left??0))}, ${-(u.height/2)-(u.y-(u.top??0))})`),ht(t,k),t.intersect=function(R){return it.polygon(t,x,R)},l}var fle=F(()=>{"use strict";Ht();Zt();Xt();Kt();s(dle,"rect_left_inv_arrow")});var GKe,sc,E4=F(()=>{"use strict";br();Jt();qo();GKe=s(async(e,t,r,n=!1,i=!1)=>{let a=t||"";typeof a=="object"&&(a=a[0]);let o=Pe(),l=ai(o);return await li(e,a,{style:r,isTitle:n,useHtmlLabels:l,markdown:!1,isNode:i,width:Number.POSITIVE_INFINITY},o)},"createLabel"),sc=GKe});async function ple(e,t){let{labelStyles:r,nodeStyles:n}=st(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),o=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(ai(Pe())){let R=d.children[0],M=ut(d);f=R.getBoundingClientRect(),M.attr("width",f.width),M.attr("height",f.height)}se.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=ut(g);f=y.getBoundingClientRect(),v.attr("width",f.width),v.attr("height",f.height);let x=(t.padding||0)/2;ut(g).attr("transform","translate( "+(f.width>m.width?0:(m.width-f.width)/2)+", "+(m.height+x+5)+")"),ut(d).attr("transform","translate( "+(f.width(se.debug("Rough node insert CXC",P),N),":first-child"),S=a.insert(()=>(se.debug("Rough node insert CXC",P),P),":first-child")}else S=o.insert("rect",":first-child"),k=o.insert("line"),S.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)),k.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 ht(t,S),t.intersect=function(R){return it.rect(t,R)},a}var mle=F(()=>{"use strict";Wr();Ht();E4();Zt();Xt();Kt();Jt();ic();St();br();s(ple,"rectWithTitle")});async function gle(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 yle=F(()=>{"use strict";km();s(gle,"roundedRect")});async function vle(e,t){let{labelStyles:r,nodeStyles:n}=st(t);t.labelStyle=r;let i=t.look==="neo"?16:t.padding??0,a=t.look==="neo"?12:t.padding??0,{shapeSvg:o,bbox:l,label:u}=await yt(e,t,vt(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=ot.svg(o),x=ft(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),w=o.insert(()=>T,":first-child");return w.attr("class","basic label-container outer-path").attr("style",un(y)),n&&t.look!=="handDrawn"&&w.selectAll("path").attr("style",n),y&&t.look!=="handDrawn"&&w.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))})`),ht(t,w),t.intersect=function(C){return it.rect(t,C)},o}var Em,xle=F(()=>{"use strict";Ht();Zt();Xt();Kt();er();Em=8;s(vle,"shadedProcess")});async function ble(e,t){let{labelStyles:r,nodeStyles:n}=st(t);t.labelStyle=r;let i=t.padding??0,a=t.look==="neo"?16:i,o=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-o*2,10));let{shapeSvg:l,bbox:u,label:h}=await yt(e,t,vt(t)),d=(t?.width?t?.width:u.width)+a*2,f=((t?.height?t?.height:u.height)+o*2)*1.5,p=d,m=f/1.5,g=-p/2,y=-m/2,{cssStyles:v}=t,x=ot.svg(l),b=ft(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}],w=hr(T),C=x.path(w,b),S=l.insert(()=>C,":first-child");return S.attr("class","basic label-container outer-path"),v&&t.look!=="handDrawn"&&S.selectChildren("path").attr("style",v),n&&t.look!=="handDrawn"&&S.selectChildren("path").attr("style",n),S.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))})`),ht(t,S),t.intersect=function(k){return it.polygon(t,T,k)},l}var Tle=F(()=>{"use strict";Ht();Zt();Xt();Kt();s(ble,"slopedRect")});async function Cle(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 Sle=F(()=>{"use strict";km();s(Cle,"squareRect")});async function wle(e,t){let{labelStyles:r,nodeStyles:n}=st(t);t.labelStyle=r;let i=t.padding??0,a=t.look==="neo"?20:i,o=t.look==="neo"?12:i,{shapeSvg:l,bbox:u}=await yt(e,t,vt(t)),h=u.height+(t.look==="neo"?o*2:o),d=u.width+h/4+(t.look==="neo"?a*2:a),f=h/2,{cssStyles:p}=t,m=ot.svg(l),g=ft(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},...Ho(-d/2+f,0,f,50,90,270),{x:d/2-f,y:h/2},...Ho(d/2-f,0,f,50,270,450)],v=hr(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),ht(t,b),t.intersect=function(T){return it.polygon(t,y,T)},l}var kle=F(()=>{"use strict";Ht();Zt();Xt();Kt();s(wle,"stadium")});async function Ele(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 Ale=F(()=>{"use strict";km();s(Ele,"state")});function Rle(e,t,{config:{themeVariables:r}}){let{labelStyles:n,nodeStyles:i}=st(t);t.labelStyle=n;let{cssStyles:a}=t,{lineColor:o,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=ot.svg(d),p=ft(t,{});t.look!=="handDrawn"&&(p.roughness=0,p.fillStyle="solid");let m=f.circle(0,0,t.width,{...p,stroke:o,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 ht(t,x),t.intersect=function(b){return it.circle(t,(t.width??0)/2,b)},d}var _le=F(()=>{"use strict";Kt();Zt();Xt();Ht();s(Rle,"stateEnd")});function Lle(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),o;if(t.look==="handDrawn"){let u=ot.svg(a).circle(0,0,t.width,hse(n));o=a.insert(()=>u),o.attr("class","state-start").attr("r",(t.width??7)/2).attr("width",t.width??14).attr("height",t.height??14)}else o=a.insert("circle",":first-child"),o.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";o.attr("style",`filter:url(#${u})`)}return ht(t,o),t.intersect=function(l){return it.circle(t,(t.width??7)/2,l)},a}var Dle=F(()=>{"use strict";Kt();Zt();Xt();Ht();s(Lle,"stateStart")});async function Ile(e,t){let{labelStyles:r,nodeStyles:n}=st(t);t.labelStyle=r;let i=t?.padding??8,a=t.look==="neo"?28:i,o=t.look==="neo"?12:i,{shapeSvg:l,bbox:u}=await yt(e,t,vt(t)),h=Math.max(u.width+2*Oy+a,t.width??0),d=Math.max(u.height+o,t.height??0),f=h-2*Oy,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=ot.svg(l),x=ft(t,{}),b=v.rectangle(m,g,f+16,p,x),T=v.line(m+Oy,g,m+Oy,g+p,x),w=v.line(m+Oy+f,g,m+Oy+f,g+p,x);l.insert(()=>T,":first-child"),l.insert(()=>w,":first-child");let C=l.insert(()=>b,":first-child"),{cssStyles:S}=t;C.attr("class","basic label-container").attr("style",un(S)),ht(t,C)}else{let v=Na(l,f,p,y);n&&v.attr("style",n),ht(t,v)}return t.intersect=function(v){return it.polygon(t,y,v)},l}var Oy,Mle=F(()=>{"use strict";Ht();Zt();Xt();Kt();iu();er();Oy=8;s(Ile,"subroutine")});async function Nle(e,t){let{labelStyles:r,nodeStyles:n}=st(t);t.labelStyle=r;let i=t.padding??0,a=t.look==="neo"?16:i,o=t.look==="neo"?12:i;(t.width||t.height)&&(t.height=Math.max((t?.height??0)-o*2,10),t.width=Math.max((t?.width??0)-a*2-FP*(t.height+o*2),10));let{shapeSvg:l,bbox:u}=await yt(e,t,vt(t)),h=(t?.height?t?.height:u.height)+o*2,d=FP*h,f=FP*h,m=(t?.width?t?.width:u.width)+a*2+d-d,g=h,y=-m/2,v=-g/2,{cssStyles:x}=t,b=ot.svg(l),T=ft(t,{}),w=[{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 S=hr(w),k=b.path(S,T),R=hr(C),M=b.path(R,{...T,fillStyle:"solid"}),P=l.insert(()=>M,":first-child");return P.insert(()=>k,":first-child"),P.attr("class","basic label-container outer-path"),x&&t.look!=="handDrawn"&&P.selectAll("path").attr("style",x),n&&t.look!=="handDrawn"&&P.selectAll("path").attr("style",n),ht(t,P),t.intersect=function(N){return it.polygon(t,w,N)},l}var FP,Ple=F(()=>{"use strict";Ht();Xt();Kt();Zt();FP=.2;s(Nle,"taggedRect")});async function Ole(e,t){let{labelStyles:r,nodeStyles:n}=st(t);t.labelStyle=r;let{shapeSvg:i,bbox:a,label:o}=await yt(e,t,vt(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=ot.svg(i),y=ft(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");let v=[{x:-l/2-l/2*.1,y:p/2},...vl(-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},...vl(x+l,(b+u)*1.25,x+l-d,(b+u)*1.3,-u*.02,.5)],w=hr(v),C=g.path(w,y),S=hr(T),k=g.path(S,{...y,fillStyle:"solid"}),R=i.insert(()=>k,":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})`),o.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))})`),ht(t,R),t.intersect=function(M){return it.polygon(t,v,M)},i}var Ble=F(()=>{"use strict";Ht();Zt();Kt();Xt();s(Ole,"taggedWaveEdgedRectangle")});async function $le(e,t){let{labelStyles:r,nodeStyles:n}=st(t);t.labelStyle=r;let{shapeSvg:i,bbox:a}=await yt(e,t,vt(t)),o=Math.max(a.width+(t.padding??0),t?.width||0),l=Math.max(a.height+(t.padding??0),t?.height||0),u=-o/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",o).attr("height",l),ht(t,d),t.intersect=function(f){return it.rect(t,f)},i}var Fle=F(()=>{"use strict";Ht();Zt();Xt();s($le,"text")});async function Vle(e,t){let{labelStyles:r,nodeStyles:n}=st(t);t.labelStyle=r;let i=t.padding??0,a=t.look==="neo"?12:i/2,o=t.height??0;if(t.height&&(t.height=t.height-a,t.heightw,":first-child"),y=l.insert(()=>T,":first-child"),y.attr("class","basic label-container"),g&&y.attr("style",g)}else{let v=zKe(0,0,m,d,p,f);y=l.insert("path",":first-child").attr("d",v).attr("class","basic label-container").attr("style",un(g)).attr("style",n),y.attr("class","basic label-container outer-path"),g&&y.selectAll("path").attr("style",g),n&&y.selectAll("path").attr("style",n)}return y.attr("label-offset-x",p),y.attr("transform",`translate(${-m/2}, ${d/2} )`),h.attr("transform",`translate(${-(u.width/2)-p-(u.x-(u.left??0))}, ${-(u.height/2)-(u.y-(u.top??0))})`),ht(t,y),t.intersect=function(v){let x=it.rect(t,v),b=x.y-(t.y??0);if(f!=0&&(Math.abs(b)<(t.height??0)/2||Math.abs(b)==(t.height??0)/2&&Math.abs(x.x-(t.x??0))>(t.width??0)/2-p)){let T=p*p*(1-b*b/(f*f));T!=0&&(T=Math.sqrt(Math.abs(T))),T=p-T,v.x-(t.x??0)>0&&(T=-T),x.x+=T}return x},l}var zKe,VKe,WKe,Gle,zle,Wle=F(()=>{"use strict";Ht();Xt();Kt();Zt();er();zKe=s((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"),VKe=s((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"),WKe=s((e,t,r,n,i,a)=>[`M${e+r/2},${-n/2}`,`a${i},${a} 0,0,0 0,${n}`].join(" "),"createInnerCylinderPathD"),Gle=5,zle=10;s(Vle,"tiltedCylinder")});async function qle(e,t){let{labelStyles:r,nodeStyles:n}=st(t);t.labelStyle=r;let i=t.padding??0,a=(t.look==="neo",i),o=t.look==="neo"?i*2:i,{shapeSvg:l,bbox:u}=await yt(e,t,vt(t)),h=Math.max(u.height+a,t.height??0),d=Math.max(u.width+o,(t.width??0)-h),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=ot.svg(l),y=ft(t,{}),v=hr(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=Na(l,d,h,f);return n&&p.attr("style",n),t.width=d,t.height=h,ht(t,p),t.intersect=function(g){return it.polygon(t,f,g)},l}var Hle=F(()=>{"use strict";Ht();Zt();Xt();Kt();iu();s(qle,"trapezoid")});async function Ule(e,t){let{labelStyles:r,nodeStyles:n}=st(t);t.labelStyle=r;let i=t.padding??0,a=t.look==="neo"?16:i,o=t.look==="neo"?12:i,l=15,u=5;(t.width||t.height)&&(t.height=(t.height??0)-o*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),ht(t,T),t.intersect=function(w){return it.polygon(t,v,w)},h}var Yle=F(()=>{"use strict";Ht();Zt();Xt();Kt();s(Ule,"trapezoidalPentagon")});async function Kle(e,t){let{labelStyles:r,nodeStyles:n}=st(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,ht(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(w){return se.info("Triangle intersect",t,m,w),it.polygon(t,m,w)},o}var jle,Xle,Zle=F(()=>{"use strict";St();Ht();Zt();Xt();Kt();Ht();Yr();Jt();jle=10,Xle=10;s(Kle,"triangle")});async function Qle(e,t){let{labelStyles:r,nodeStyles:n}=st(t);t.labelStyle=r;let i=t.padding??0,a=t.look==="neo"?16:i,o=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)-o*2,t.height<10&&(t.height=10));let{shapeSvg:u,bbox:h,label:d}=await yt(e,t,vt(t)),f=(t?.width?t?.width:h.width)+(a??0)*2,p=(t?.height?t?.height:h.height)+(o??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=ot.svg(u),w=ft(t,{});t.look!=="handDrawn"&&(w.roughness=0,w.fillStyle="solid");let C=[{x:-f/2-b,y:g/2},...vl(-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}],S=hr(C),k=T.path(S,w),R=u.insert(()=>k,":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))})`),ht(t,R),t.intersect=function(M){return it.polygon(t,C,M)},u}var Jle=F(()=>{"use strict";Ht();Zt();Kt();Xt();s(Qle,"waveEdgedRectangle")});async function ece(e,t){let{labelStyles:r,nodeStyles:n}=st(t);t.labelStyle=r;let i=t.padding??0,a=t.look==="neo"?16:i,o=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 w=Math.min(t.height*.2,t.height/4);t.height=Math.ceil(t.height-o-w*(20/9)),t.width=t.width-a*2}let{shapeSvg:l,bbox:u}=await yt(e,t,vt(t)),h=(t?.width?t?.width:u.width)+a*2,d=(t?.height?t?.height:u.height)+o,f=d/8,p=d+f*2,{cssStyles:m}=t,g=ot.svg(l),y=ft(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");let v=[{x:-h/2,y:p/2},...vl(-h/2,p/2,h/2,p/2,f,1),{x:h/2,y:-p/2},...vl(h/2,-p/2,-h/2,-p/2,f,-1)],x=hr(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),ht(t,T),t.intersect=function(w){return it.polygon(t,v,w)},l}var tce=F(()=>{"use strict";Ht();Zt();Xt();Kt();s(ece,"waveRectangle")});async function rce(e,t){let{labelStyles:r,nodeStyles:n}=st(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-Ni,10),t.height=Math.max((t?.height??0)-a*2-Ni,10));let{shapeSvg:o,bbox:l,label:u}=await yt(e,t,vt(t)),h=(t?.width?t?.width:l.width)+i*2+Ni,d=(t?.height?t?.height:l.height)+a*2+Ni,f=h-Ni,p=d-Ni,m=-f/2,g=-p/2,{cssStyles:y}=t,v=ot.svg(o),x=ft(t,{}),b=[{x:m-Ni,y:g-Ni},{x:m-Ni,y:g+p},{x:m+f,y:g+p},{x:m+f,y:g-Ni}],T=`M${m-Ni},${g-Ni} L${m+f},${g-Ni} L${m+f},${g+p} L${m-Ni},${g+p} L${m-Ni},${g-Ni}
M${m-Ni},${g} L${m+f},${g}
M${m},${g-Ni} L${m},${g+p}`;t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");let w=v.path(T,x),C=o.insert(()=>w,":first-child");return C.attr("transform",`translate(${Ni/2}, ${Ni/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)+Ni/2-(l.x-(l.left??0))}, ${-(l.height/2)+Ni/2-(l.y-(l.top??0))})`),ht(t,C),t.intersect=function(S){return it.polygon(t,b,S)},o}var Ni,nce=F(()=>{"use strict";Ht();Xt();Kt();Zt();Ni=10;s(rce,"windowPane")});async function GP(e,t){let r=t;r.alias&&(t.label=r.alias);let{theme:n,themeVariables:i}=Lt(),{rowEven:a,rowOdd:o,nodeBorder:l,borderColorArray:u}=i;if(t.look==="handDrawn"){let{themeVariables:ne}=Lt(),{background:Z}=ne,pe={...t,id:t.id+"-background",domId:(t.domId||t.id)+"-background",look:"default",cssStyles:["stroke: none",`fill: ${Z}`]};await GP(e,pe)}let h=Lt();t.useHtmlLabels=h.htmlLabels;let d=h.er?.diagramPadding??10,f=h.er?.entityPadding??6,{cssStyles:p}=t,{labelStyles:m,nodeStyles:g}=st(t);if(r.attributes.length===0&&t.label){let ne={rx:0,ry:0,labelPaddingX:d,labelPaddingY:d*1.5,classes:""};Qa(t.label,h)+ne.labelPaddingX*20){let ne=x.width+d*2-(C+S+k+R);C+=ne/N,S+=ne/N,k>0&&(k+=ne/N),R>0&&(R+=ne/N)}let A=C+S+k+R,I=ot.svg(v),D=ft(t,{});t.look!=="handDrawn"&&(D.roughness=0,D.fillStyle="solid");let L=0;w.length>0&&(L=w.reduce((ne,Z)=>ne+(Z?.rowHeight??0),0));let B=Math.max(_.width+d*2,t?.width||0,A),O=Math.max((L??0)+x.height,t?.height||0),$=-B/2,W=-O/2;if(v.selectAll("g:not(:first-child)").each((ne,Z,pe)=>{let te=ut(pe[Z]),fe=te.attr("transform"),ce=0,de=0;if(fe){let we=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(fe);we&&(ce=parseFloat(we[1]),de=parseFloat(we[2]),te.attr("class").includes("attribute-name")?ce+=C:te.attr("class").includes("attribute-keys")?ce+=C+S:te.attr("class").includes("attribute-comment")&&(ce+=C+S+k))}te.attr("transform",`translate(${$+d/2+ce}, ${de+W+x.height+f/2})`)}),v.select(".name").attr("transform","translate("+-x.width/2+", "+(W+f/2)+")"),n!=null&&ice.has(n)){let ne=r.colorIndex??0;v.attr("data-color-id",`color-${ne%u.length}`)}let V=I.rectangle($,W,B,O,D),z=v.insert(()=>V,":first-child").attr("class","outer-path").attr("style",p.join(""));T.push(0);for(let[ne,Z]of w.entries()){let te=(ne+1)%2===0&&Z.yOffset!==0,fe=I.rectangle($,x.height+W+Z?.yOffset,B,Z?.rowHeight,{...D,fill:te?a:o,stroke:l});v.insert(()=>fe,"g.label").attr("style",p.join("")).attr("class",`row-rect-${te?"even":"odd"}`)}let H=1e-4,K=_2($,x.height+W,B+$,x.height+W,H),J=I.polygon(K.map(ne=>[ne.x,ne.y]),D);if(v.insert(()=>J).attr("class","divider"),K=_2(C+$,x.height+W,C+$,O+W,H),J=I.polygon(K.map(ne=>[ne.x,ne.y]),D),v.insert(()=>J).attr("class","divider"),M){let ne=C+S+$;K=_2(ne,x.height+W,ne,O+W,H),J=I.polygon(K.map(Z=>[Z.x,Z.y]),D),v.insert(()=>J).attr("class","divider")}if(P){let ne=C+S+k+$;K=_2(ne,x.height+W,ne,O+W,H),J=I.polygon(K.map(Z=>[Z.x,Z.y]),D),v.insert(()=>J).attr("class","divider")}for(let ne of T){let Z=x.height+W+ne;K=_2($,Z,B+$,Z,H),J=I.polygon(K.map(pe=>[pe.x,pe.y]),D),v.insert(()=>J).attr("class","divider")}if(ht(t,z),g&&t.look!=="handDrawn")if(n!=null&&qKe.has(n))v.selectAll("path").attr("style",g);else{let Z=g.split(";")?.filter(pe=>pe.includes("stroke"))?.map(pe=>`${pe}`).join("; ");v.selectAll("path").attr("style",Z??""),v.selectAll(".row-rect-even path").attr("style",g)}return t.intersect=function(ne){return it.rect(t,ne)},v}async function R2(e,t,r,n=0,i=0,a=[],o=""){let l=e.insert("g").attr("class",`label ${a.join(" ")}`).attr("transform",`translate(${n}, ${i})`).attr("style",o);t!==Vc(t)&&(t=Vc(t),t=t.replaceAll("<","<").replaceAll(">",">"));let u=l.node().appendChild(await li(l,t,{width:Qa(t,r)+100,style:o,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(Aa(r.htmlLabels)){let d=u.children[0];d.style.textAlign="start";let f=ut(u);h=d.getBoundingClientRect(),f.attr("width",h.width),f.attr("height",h.height)}return h}function _2(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 ice,qKe,ace=F(()=>{"use strict";Ht();Zt();Xt();Kt();km();br();qo();Yr();Wr();er();ice=new Set(["redux-color","redux-dark-color"]),qKe=new Set(["redux","redux-dark","redux-color","redux-dark-color"]);s(GP,"erBox");s(R2,"addText");s(_2,"lineToPolygon")});async function sce(e,t,r,n,i=r.class.padding??12){let a=n?0:3,o=e.insert("g").attr("class",vt(t)).attr("id",t.domId||t.id),l=null,u=null,h=null,d=null,f=0,p=0,m=0;if(l=o.insert("g").attr("class","annotation-group text"),t.annotations.length>0){let b=t.annotations[0];await A4(l,{text:`\xAB${b}\xBB`},0),f=l.node().getBBox().height}u=o.insert("g").attr("class","label-group text"),await A4(u,t,0,["font-weight: bolder"]);let g=u.node().getBBox();p=g.height,h=o.insert("g").attr("class","members-group text");let y=0;for(let b of t.members){let T=await A4(h,b,y,[b.parseClassifier()]);y+=T+a}m=h.node().getBBox().height,m<=0&&(m=i/2),d=o.insert("g").attr("class","methods-group text");let v=0;for(let b of t.methods){let T=await A4(d,b,v,[b.parseClassifier()]);v+=T+a}let x=o.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=o.node().getBBox(),h.attr("transform",`translate(0, ${f+p+i*2})`),x=o.node().getBBox(),d.attr("transform",`translate(0, ${f+p+(m?m+i*4:i*2)})`),x=o.node().getBBox(),{shapeSvg:o,bbox:x}}async function A4(e,t,r,n=[]){let i=e.insert("g").attr("class","label").attr("style",n.join("; ")),a=Lt(),o="useHtmlLabels"in t?t.useHtmlLabels:Aa(a.htmlLabels)??!0,l="";"text"in t?l=t.text:l=t.label,!o&&l.startsWith("\\")&&(l=l.substring(1)),si(l)&&(o=!0);let u=await li(i,ab(lo(l)),{width:Qa(l,a)+50,classes:"markdown-node-label",useHtmlLabels:o},a),h,d=1;if(o){let f=u.children[0],p=ut(u);d=f.innerHTML.split(" ").length,f.innerHTML.includes("")&&(d+=f.innerHTML.split("").length-1),await h4(f),h=f.getBoundingClientRect(),p.attr("width",h.width),p.attr("height",h.height)}else{n.includes("font-weight: bolder")&&ut(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 oce=F(()=>{"use strict";Wr();br();Ht();er();Jt();qo();pP();Yr();s(sce,"textHelper");s(A4,"addText")});async function lce(e,t){let r=Pe(),{themeVariables:n}=r,{useGradient:i}=n,a=r.class.padding??12,o=a,l=t.useHtmlLabels??Aa(r.htmlLabels)??!0,u=t;u.annotations=u.annotations??[],u.members=u.members??[],u.methods=u.methods??[];let{shapeSvg:h,bbox:d}=await sce(e,t,r,l,o),{labelStyles:f,nodeStyles:p}=st(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=ot.svg(h),v=ft(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+=o:u.members.length>0&&u.methods.length===0&&(b+=o*2);let w=-x/2,C=-b/2,S=g?a*2:u.members.length===0&&u.methods.length===0?-a:0;T&&(S=a*2);let k=y.rectangle(w-a,C-a-(g?a:u.members.length===0&&u.methods.length===0?-a/2:0),x+2*a,b+2*a+S,v),R=h.insert(()=>k,":first-child");R.attr("class","basic label-container outer-path");let M=R.node().getBBox(),P=h.select(".annotation-group").node().getBBox().height-(g?a/2:0)||0,N=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=(P+N+C+a-(C-a-(g?a:u.members.length===0&&u.methods.length===0?-a/2:0)))/2;if(h.selectAll(".text").each((I,D,L)=>{let B=ut(L[D]),O=B.attr("transform"),$=0;if(O){let H=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(O);H&&($=parseFloat(H[2]))}let W=$+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(_,o/2);T?W=Math.max(A,P+N+z+C+o*2+a)+o*2:W=P+N+z+C+o*4+a}u.members.length===0&&u.methods.length===0&&r.class?.hideEmptyMembersBox&&(u.annotations.length>0?W=$-o:W=$),l||(W-=4);let V=w;(B.attr("class").includes("label-group")||B.attr("class").includes("annotation-group"))&&(V=-B.node()?.getBBox().width/2||0,h.selectAll("text").each(function(z,H,K){window.getComputedStyle(K[H]).textAnchor==="middle"&&(V=0)})),B.attr("transform",`translate(${V}, ${W})`)}),u.members.length>0||u.methods.length>0||g){let I=P+N+C+a,D=y.line(M.x,I,M.x+M.width,I+.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 I=P+N+_+C+o*2+a,D=y.line(M.x,T?Math.max(A,I):I,M.x+M.width,(T?Math.max(A,I):I)+.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 I=RegExp(/color\s*:\s*([^;]*)/),D=I.exec(m);if(D){let L=D[0].replace("color","fill");h.selectAll("tspan").attr("style",L)}else if(f){let L=I.exec(f);if(L){let B=L[0].replace("color","fill");h.selectAll("tspan").attr("style",B)}}}return ht(t,R),t.intersect=function(I){return it.rect(t,I)},h}var cce=F(()=>{"use strict";Ht();Jt();Wr();Kt();Xt();Zt();oce();Yr();s(lce,"classBox")});async function uce(e,t){let{labelStyles:r,nodeStyles:n}=st(t);t.labelStyle=r;let i=t,a=t,o=20,l=20,u="verifyMethod"in t,h=vt(t),d=Pe(),{themeVariables:f}=d,{borderColorArray:p,requirementEdgeLabelBackground:m}=f,g=d.layout==="elk"?"start":"center",y=e.insert("g").attr("class",h).attr("id",t.domId??t.id),v;u?v=await wh(y,`<<${i.type}>>`,0,t.labelStyle):v=await wh(y,"<<Element>>",0,t.labelStyle);let x=v,b=await wh(y,i.name,x,t.labelStyle+"; font-weight: bold;");if(x+=b+l,u){let N=await wh(y,`${i.requirementId?`ID: ${i.requirementId}`:""}`,x,t.labelStyle,g);x+=N;let _=await wh(y,`${i.text?`Text: ${i.text}`:""}`,x,t.labelStyle,g);x+=_;let A=await wh(y,`${i.risk?`Risk: ${i.risk}`:""}`,x,t.labelStyle,g);x+=A,await wh(y,`${i.verifyMethod?`Verification: ${i.verifyMethod}`:""}`,x,t.labelStyle,g)}else{let N=await wh(y,`${a.type?`Type: ${a.type}`:""}`,x,t.labelStyle,g);x+=N,await wh(y,`${a.docRef?`Doc Ref: ${a.docRef}`:""}`,x,t.labelStyle,g)}let T=(y.node()?.getBBox().width??200)+o,w=(y.node()?.getBBox().height??200)+o,C=-T/2,S=-w/2,k=ot.svg(y),R=ft(t,{});t.look!=="handDrawn"&&(R.roughness=0,R.fillStyle="solid");let M=k.rectangle(C,S,T,w,R),P=y.insert(()=>M,":first-child");if(P.attr("class","basic label-container outer-path").attr("style",n),p?.length){let N=t.colorIndex??0;y.attr("data-color-id",`color-${N%p.length}`)}if(y.selectAll(".label").each((N,_,A)=>{let I=ut(A[_]),D=I.attr("transform"),L=0,B=0;if(D){let V=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(D);V&&(L=parseFloat(V[1]),B=parseFloat(V[2]))}let O=B-w/2,$=C+o/2;(_===0||_===1)&&($=L),I.attr("transform",`translate(${$}, ${O+o})`)}),x>v+b+l){let N=S+v+b+l,_;if(t.look==="neo"){let D=[[C,N],[C+T,N],[C+T,N+.001],[C,N+.001]];_=k.polygon(D,R)}else _=k.line(C,N,C+T,N,R);y.insert(()=>_).attr("class","divider")}return ht(t,P),t.intersect=function(N){return it.rect(t,N)},n&&t.look!=="handDrawn"&&(m||p?.length)&&y.selectAll("path").attr("style",n),y}async function wh(e,t,r,n="",i="center"){if(t==="")return 0;let a=e.insert("g").attr("class","label").attr("style",n),o=Pe(),l=o.htmlLabels??!0,u=await li(a,ab(lo(t)),{width:Qa(t,o)+50,classes:"markdown-node-label",useHtmlLabels:l,style:n},o),h;if(l){let d=u.children[0],f=ut(u);i==="start"&&ut(d).style("text-align","left"),h=d.getBoundingClientRect(),f.attr("width",h.width),f.attr("height",h.height)}else{let d=u.children[0];for(let f of d.children)n&&f.setAttribute("style",n);if(i==="start"){d.setAttribute("text-anchor","start");for(let f of d.children)f.setAttribute("text-anchor","start")}h=u.getBBox(),h.height+=6}return a.attr("transform",`translate(${-h.width/2},${-h.height/2+r})`),h.height}var hce=F(()=>{"use strict";Ht();Zt();Xt();Kt();er();Jt();qo();Wr();s(uce,"requirementBox");s(wh,"addText")});async function dce(e,t,{config:r}){let{labelStyles:n,nodeStyles:i}=st(t);t.labelStyle=n||"";let a=10,o=t.width;t.width=(t.width??200)-10;let{shapeSvg:l,bbox:u,label:h}=await yt(e,t,vt(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 d4(p,"ticket"in t&&t.ticket||"",m):{label:g,bbox:y}=await d4(l,"ticket"in t&&t.ticket||"",m);let{label:v,bbox:x}=await d4(l,"assigned"in t&&t.assigned||"",m);t.width=o;let b=10,T=t?.width||0,w=Math.max(y.height,x.height)/2,C=Math.max(u.height+b*2,t?.height||0)+w,S=-T/2,k=-C/2;h.attr("transform","translate("+(d-T/2)+", "+(-w-u.height/2)+")"),g.attr("transform","translate("+(d-T/2)+", "+(-w+u.height/2)+")"),v.attr("transform","translate("+(d+T/2-x.width-2*a)+", "+(-w+u.height/2)+")");let R,{rx:M,ry:P}=t,{cssStyles:N}=t;if(t.look==="handDrawn"){let _=ot.svg(l),A=ft(t,{}),I=M||P?_.path(Mi(S,k,T,C,M||0),A):_.rectangle(S,k,T,C,A);R=l.insert(()=>I,":first-child"),R.attr("class","basic label-container").attr("style",N||null)}else{R=l.insert("rect",":first-child"),R.attr("class","basic label-container __APA__").attr("style",i).attr("rx",M??5).attr("ry",P??5).attr("x",S).attr("y",k).attr("width",T).attr("height",C);let _="priority"in t&&t.priority;if(_){let A=l.append("line"),I=S+2,D=k+Math.floor((M??0)/2),L=k+C-Math.floor((M??0)/2);A.attr("x1",I).attr("y1",D).attr("x2",I).attr("y2",L).attr("stroke-width","4").attr("stroke",HKe(_))}}return ht(t,R),t.height=C,t.intersect=function(_){return it.rect(t,_)},l}var HKe,fce=F(()=>{"use strict";Ht();Zt();ic();Xt();Kt();HKe=s(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");s(dce,"kanbanItem")});async function pce(e,t){let{labelStyles:r,nodeStyles:n}=st(t);t.labelStyle=r;let{shapeSvg:i,bbox:a,halfPadding:o,label:l}=await yt(e,t,vt(t)),u=a.width+10*o,h=a.height+8*o,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=ot.svg(i),T=ft(t,{}),w=b.path(x,T);v=i.insert(()=>w,":first-child"),v.attr("class","basic label-container").attr("style",un(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})`),ht(t,v),t.calcIntersect=function(b,T){return it.rect(b,T)},t.intersect=function(b){return se.info("Bang intersect",t,b),it.rect(t,b)},i}var mce=F(()=>{"use strict";St();Ht();Zt();Xt();Kt();er();s(pce,"bang")});async function gce(e,t){let{labelStyles:r,nodeStyles:n}=st(t);t.labelStyle=r;let{shapeSvg:i,bbox:a,halfPadding:o,label:l}=await yt(e,t,vt(t)),u=a.width+2*o,h=a.height+2*o,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=ot.svg(i),b=ft(t,{}),T=x.path(v,b);y=i.insert(()=>T,":first-child"),y.attr("class","basic label-container").attr("style",un(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})`),ht(t,y),t.calcIntersect=function(x,b){return it.rect(x,b)},t.intersect=function(x){return se.info("Cloud intersect",t,x),it.rect(t,x)},i}var yce=F(()=>{"use strict";Kt();St();er();Zt();Xt();Ht();s(gce,"cloud")});async function vce(e,t){let{labelStyles:r,nodeStyles:n}=st(t);t.labelStyle=r;let{shapeSvg:i,bbox:a,halfPadding:o,label:l}=await yt(e,t,vt(t)),u=a.width+8*o,h=a.height+2*o,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()),ht(t,p),t.calcIntersect=function(m,g){return it.rect(m,g)},t.intersect=function(m){return it.rect(t,m)},i}var xce=F(()=>{"use strict";Zt();Xt();Ht();s(vce,"defaultMindmapNode")});async function bce(e,t){let r={padding:t.padding??0};return k4(e,t,r)}var Tce=F(()=>{"use strict";$P();s(bce,"mindmapCircle")});function Cce(e){return e in L2}var UKe,YKe,L2,R4=F(()=>{"use strict";Ase();Lse();Ise();Nse();Bse();Fse();zse();Wse();$P();Hse();Yse();Xse();Zse();Jse();toe();noe();aoe();coe();hoe();foe();moe();yoe();Toe();Soe();koe();Aoe();_oe();Doe();Moe();Poe();Boe();Foe();zoe();Woe();Hoe();Yoe();Xoe();Zoe();tle();nle();ale();ole();cle();hle();fle();mle();yle();xle();Tle();Sle();kle();Ale();_le();Dle();Mle();Ple();Ble();Fle();Wle();Hle();Yle();Zle();Jle();tce();nce();ace();cce();hce();fce();mce();yce();xce();Tce();UKe=[{semanticName:"Process",name:"Rectangle",shortName:"rect",description:"Standard process shape",aliases:["proc","process","rectangle"],internalAliases:["squareRect"],handler:Cle},{semanticName:"Event",name:"Rounded Rectangle",shortName:"rounded",description:"Represents an event",aliases:["event"],internalAliases:["roundedRect"],handler:gle},{semanticName:"Terminal Point",name:"Stadium",shortName:"stadium",description:"Terminal point",aliases:["terminal","pill"],handler:wle},{semanticName:"Subprocess",name:"Framed Rectangle",shortName:"fr-rect",description:"Subprocess",aliases:["subprocess","subproc","framed-rectangle","subroutine"],handler:Ile},{semanticName:"Database",name:"Cylinder",shortName:"cyl",description:"Database storage",aliases:["db","database","cylinder"],handler:loe},{semanticName:"Data Store",name:"Data Store",shortName:"datastore",description:"Data flow diagram data store",aliases:["data-store"],handler:uoe},{semanticName:"Folder",name:"Folder",shortName:"folder",description:"Folder or directory",aliases:["directory"],handler:Coe},{semanticName:"Bucket",name:"Bucket",shortName:"bucket",description:"Object storage bucket",handler:Dse},{semanticName:"Console",name:"Console (terminal window)",shortName:"console",description:"Terminal or console window",handler:Use},{semanticName:"Browser",name:"Browser",shortName:"browser",description:"Browser window",handler:$se},{semanticName:"Person",name:"Person",shortName:"person",description:"Person (circular head above a rounded body)",handler:ioe},{semanticName:"Start",name:"Circle",shortName:"circle",description:"Starting point",aliases:["circ"],handler:k4},{semanticName:"Bang",name:"Bang",shortName:"bang",description:"Bang",aliases:["bang"],handler:pce},{semanticName:"Cloud",name:"Cloud",shortName:"cloud",description:"cloud",aliases:["cloud"],handler:gce},{semanticName:"Decision",name:"Diamond",shortName:"diam",description:"Decision-making step",aliases:["decision","diamond","question"],handler:ule},{semanticName:"Prepare Conditional",name:"Hexagon",shortName:"hex",description:"Preparation or condition step",aliases:["hexagon","prepare"],handler:Roe},{semanticName:"Data Input/Output",name:"Lean Right",shortName:"lean-r",description:"Represents input or output",aliases:["lean-right","in-out"],internalAliases:["lean_right"],handler:joe},{semanticName:"Data Input/Output",name:"Lean Left",shortName:"lean-l",description:"Represents output or input",aliases:["lean-left","out-in"],internalAliases:["lean_left"],handler:Uoe},{semanticName:"Priority Action",name:"Trapezoid Base Bottom",shortName:"trap-b",description:"Priority action",aliases:["priority","trapezoid-bottom","trapezoid"],handler:qle},{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:Voe},{semanticName:"Stop",name:"Double Circle",shortName:"dbl-circ",description:"Represents a stop point",aliases:["double-circle"],internalAliases:["doublecircle"],handler:poe},{semanticName:"Text Block",name:"Text Block",shortName:"text",description:"Text block",handler:$le},{semanticName:"Card",name:"Notched Rectangle",shortName:"notch-rect",description:"Represents a card",aliases:["card","notched-rectangle"],handler:Gse},{semanticName:"Lined/Shaded Process",name:"Lined Rectangle",shortName:"lin-rect",description:"Lined process shape",aliases:["lined-rectangle","lined-process","lin-proc","shaded-process"],handler:vle},{semanticName:"Start",name:"Small Circle",shortName:"sm-circ",description:"Small starting point",aliases:["start","small-circle"],internalAliases:["stateStart"],handler:Lle},{semanticName:"Stop",name:"Framed Circle",shortName:"fr-circ",description:"Stop point",aliases:["stop","framed-circle"],internalAliases:["stateEnd"],handler:Rle},{semanticName:"Fork/Join",name:"Filled Rectangle",shortName:"fork",description:"Fork or join in process flow",aliases:["join"],internalAliases:["forkJoin"],handler:woe},{semanticName:"Collate",name:"Hourglass",shortName:"hourglass",description:"Represents a collate operation",aliases:["hourglass","collate"],handler:Loe},{semanticName:"Comment",name:"Curly Brace",shortName:"brace",description:"Adds a comment",aliases:["comment","brace-l"],handler:Kse},{semanticName:"Comment Right",name:"Curly Brace",shortName:"brace-r",description:"Adds a comment",handler:Qse},{semanticName:"Comment with braces on both sides",name:"Curly Braces",shortName:"braces",description:"Adds a comment",handler:eoe},{semanticName:"Com Link",name:"Lightning Bolt",shortName:"bolt",description:"Communication link",aliases:["com-link","lightning-bolt"],handler:Koe},{semanticName:"Document",name:"Document",shortName:"doc",description:"Represents a document",aliases:["doc","document"],handler:Qle},{semanticName:"Delay",name:"Half-Rounded Rectangle",shortName:"delay",description:"Represents a delay",aliases:["half-rounded-rectangle"],handler:Eoe},{semanticName:"Direct Access Storage",name:"Horizontal Cylinder",shortName:"h-cyl",description:"Direct access storage",aliases:["das","horizontal-cylinder"],handler:Vle},{semanticName:"Disk Storage",name:"Lined Cylinder",shortName:"lin-cyl",description:"Disk storage",aliases:["disk","lined-cylinder"],handler:ele},{semanticName:"Display",name:"Curved Trapezoid",shortName:"curv-trap",description:"Represents a display",aliases:["curved-trapezoid","display"],handler:roe},{semanticName:"Divided Process",name:"Divided Rectangle",shortName:"div-rect",description:"Divided process shape",aliases:["div-proc","divided-rectangle","divided-process"],handler:doe},{semanticName:"Extract",name:"Triangle",shortName:"tri",description:"Extraction process",aliases:["extract","triangle"],handler:Kle},{semanticName:"Internal Storage",name:"Window Pane",shortName:"win-pane",description:"Internal storage",aliases:["internal-storage","window-pane"],handler:rce},{semanticName:"Junction",name:"Filled Circle",shortName:"f-circ",description:"Junction point",aliases:["junction","filled-circle"],handler:goe},{semanticName:"Loop Limit",name:"Trapezoidal Pentagon",shortName:"notch-pent",description:"Loop limit step",aliases:["loop-limit","notched-pentagon"],handler:Ule},{semanticName:"Manual File",name:"Flipped Triangle",shortName:"flip-tri",description:"Manual file operation",aliases:["manual-file","flipped-triangle"],handler:boe},{semanticName:"Manual Input",name:"Sloped Rectangle",shortName:"sl-rect",description:"Manual input step",aliases:["manual-input","sloped-rectangle"],handler:ble},{semanticName:"Multi-Document",name:"Stacked Document",shortName:"docs",description:"Multiple documents",aliases:["documents","st-doc","stacked-document"],handler:sle},{semanticName:"Multi-Process",name:"Stacked Rectangle",shortName:"st-rect",description:"Multiple processes",aliases:["procs","processes","stacked-rectangle"],handler:ile},{semanticName:"Stored Data",name:"Bow Tie Rectangle",shortName:"bow-rect",description:"Stored data",aliases:["stored-data","bow-tie-rectangle"],handler:_se},{semanticName:"Summary",name:"Crossed Circle",shortName:"cross-circ",description:"Summary",aliases:["summary","crossed-circle"],handler:jse},{semanticName:"Tagged Document",name:"Tagged Document",shortName:"tag-doc",description:"Tagged document",aliases:["tag-doc","tagged-document"],handler:Ole},{semanticName:"Tagged Process",name:"Tagged Rectangle",shortName:"tag-rect",description:"Tagged process",aliases:["tagged-rectangle","tag-proc","tagged-process"],handler:Nle},{semanticName:"Paper Tape",name:"Flag",shortName:"flag",description:"Paper tape",aliases:["paper-tape"],handler:ece},{semanticName:"Odd",name:"Odd",shortName:"odd",description:"Odd shape",internalAliases:["rect_left_inv_arrow"],handler:dle},{semanticName:"Lined Document",name:"Lined Document",shortName:"lin-doc",description:"Lined document",aliases:["lined-document"],handler:rle}],YKe=s(()=>{let t=[...Object.entries({state:Ele,choice:Vse,note:lle,composite:qse,rectWithTitle:ple,labelRect:qoe,block_arrow:Ose,collapsedGroup:Mse,iconSquare:$oe,iconCircle:Noe,icon:Ioe,iconRounded:Ooe,imageSquare:Goe,anchor:Ese,kanbanItem:dce,mindmapCircle:bce,defaultMindmapNode:vce,classBox:lce,erBox:GP,requirementBox:uce}),...UKe.flatMap(r=>[r.shortName,..."aliases"in r?r.aliases:[],..."internalAliases"in r?r.internalAliases:[]].map(i=>[i,r.handler]))];return Object.fromEntries(t)},"generateShapeMap"),L2=YKe();s(Cce,"isValidShape")});var jKe,XKe,KKe,zP,ZKe,QKe,JKe,eZe,tZe,VP,rZe,Sce,nZe,WP,qP=F(()=>{"use strict";jKe=new Set(["system_queue","external_system_queue","container_queue","external_container_queue","component_queue","external_component_queue"]),XKe=new Set(["system_db","external_system_db","container_db","external_container_db","component_db","external_component_db"]),KKe={person:"person",box:"rounded",rounded:"rounded",cylinder:"cylinder",database:"cylinder",db:"cylinder",queue:"h-cyl",pipe:"h-cyl",component:"fr-rect"},zP=s(e=>e?KKe[e.toLowerCase()]:void 0,"keywordShape"),ZKe=s(e=>{let t=zP(e.shape)??zP(e.sprite);if(t)return t;if(e.tags)for(let n of e.tags.split(",")){let i=zP(n.trim());if(i)return i}let r=e.typeC4Shape.text;return r==="person"||r==="external_person"?"person":XKe.has(r)?"cylinder":jKe.has(r)?"h-cyl":"rounded"},"resolveNodeShape"),QKe={person:"Person",system:"Software System",container:"Container",component:"Component"},JKe=s(e=>{let t=e.replace(/^external_/,"").replace(/_(db|queue)$/,"");return QKe[t]??t.replace(/_/g," ")},"stereotypeLabel"),eZe=s(e=>e.startsWith("external_"),"isExternal"),tZe=s(e=>{let t=JKe(e.typeC4Shape.text);return e.techn?.text?`[${t}: ${e.techn.text}]`:`[${t}]`},"stereotypeText"),VP=["person","system","system_db","system_queue","container","container_db","container_queue","component","component_db","component_queue"].flatMap(e=>[e,`external_${e}`]),rZe=new Set(VP),Sce=s(e=>rZe.has(e),"isC4ElementType"),nZe=s((e,t)=>{let r=e.typeC4Shape.text,n=e.bgColor??(Sce(r)&&t[`${r}_bg_color`]),i=e.borderColor??(Sce(r)&&t[`${r}_border_color`]),a=[];return n&&a.push(`fill:${n}`),i&&a.push(`stroke:${i}`),a.push(`color:${e.fontColor??"#FFFFFF"}`),a},"elementCssStyles"),WP=s((e,t,r,n,i)=>{let a=e.typeC4Shape.text,o=["c4-shape",`c4-${a}`];eZe(a)&&o.push("c4-external");let l=ZKe(e),u=nZe(e,t);return(l==="rounded"||l==="fr-rect")&&u.push("rx:12px","ry:12px"),{id:e.alias,label:e.label.text,stereotype:tZe(e),description:e.descr?.text?[e.descr.text]:void 0,labelType:"string",isGroup:!1,shape:l,cssClasses:o.join(" "),cssStyles:u,padding:r,look:n,useHtmlLabels:!1,width:i}},"buildC4Node")});function Am(e,t,r,n,i){let a=t[e];if(!a.width)if(r)a.text=Tm(a.text,i,n),a.textLines=a.text.split(Tt.lineBreakRegex).length,a.width=i,a.height=n4(a.text,n);else{let o=a.text.split(Tt.lineBreakRegex);a.textLines=o.length;let l=0;a.height=0,a.width=0;for(let u of o)a.width=Math.max(Qa(u,n),a.width),l=n4(u,n),a.height=a.height+l}return a}async function Rce(e,t,r,n,i){let a=i.db,o=new L4(i);o.data.widthLimit=r.data.widthLimit/Math.min(HP,n.length);for(let[l,u]of n.entries()){let h=0;u.image={width:0,height:0,Y:0},u.sprite&&(u.image.width=48,u.image.height=48,u.image.Y=h,h=u.image.Y+u.image.height);let d=u.wrap&&Cr.wrap,f=_4(Cr);f.fontSize=f.fontSize+2,f.fontWeight="bold";let p=Am("label",u,d,f,o.data.widthLimit);if(p.Y=h+8,h=p.Y+p.height,u.type&&u.type.text!==""){u.type.text="["+u.type.text+"]";let v=_4(Cr),x=Am("type",u,d,v,o.data.widthLimit);x.Y=h+5,h=x.Y+x.height}if(u.descr&&u.descr.text!==""){let v=_4(Cr);v.fontSize=v.fontSize-2;let x=Am("descr",u,d,v,o.data.widthLimit);x.Y=h+20,h=x.Y+x.height}if(l==0||l%HP===0){let v=r.data.startx+Cr.diagramMarginX,x=r.data.stopy+Cr.diagramMarginY+h;o.setData(v,v,x,x)}else{let v=o.data.stopx!==o.data.startx?o.data.stopx+Cr.diagramMarginX:o.data.startx,x=o.data.starty;o.setData(v,v,x,x)}o.name=u.alias;let m=a.getC4ShapeArray(u.alias),g=a.getC4ShapeKeys(u.alias);g.length>0&&await Ace(o,e,m,g),t=u.alias;let y=a.getBoundaries(t);y.length>0&&await Rce(e,t,o,y,i),u.alias!=="global"&&Ece(e,u,o),r.data.stopy=Math.max(o.data.stopy+Cr.c4ShapeMargin,r.data.stopy),r.data.stopx=Math.max(o.data.stopx+Cr.c4ShapeMargin,r.data.stopx),D2=Math.max(D2,r.data.stopx),I2=Math.max(I2,r.data.stopy)}}var D2,I2,kce,HP,Cr,L4,UP,_4,iZe,Ece,Ace,YP,wce,aZe,sZe,oZe,jP,_ce=F(()=>{"use strict";Bie();St();K7();Yr();oI();Jt();iI();$0();er();vae();Vn();R4();qP();D2=0,I2=0,kce=4,HP=2;rb.yy=cb;Cr={},L4=class{static{s(this,"Bounds")}constructor(t){this.name="",this.data={},this.data.startx=void 0,this.data.stopx=void 0,this.data.starty=void 0,this.data.stopy=void 0,this.data.widthLimit=void 0,this.nextData={},this.nextData.startx=void 0,this.nextData.stopx=void 0,this.nextData.starty=void 0,this.nextData.stopy=void 0,this.nextData.cnt=0,UP(t.db.getConfig())}setData(t,r,n,i){this.nextData.startx=this.data.startx=t,this.nextData.stopx=this.data.stopx=r,this.nextData.starty=this.data.starty=n,this.nextData.stopy=this.data.stopy=i}updateVal(t,r,n,i){t[r]===void 0?t[r]=n:t[r]=i(n,t[r])}insert(t){this.nextData.cnt=this.nextData.cnt+1;let r=this.nextData.stopx,n=this.data.widthLimit,i=this.nextData.startx===this.nextData.stopx?r+t.margin:r+t.margin*2,a=i+t.width,o=this.nextData.starty+t.margin*2,l=o+t.height;(i>=n||a>=n||this.nextData.cnt>kce)&&(i=this.nextData.startx+t.margin+Cr.nextLinePaddingX,o=this.nextData.stopy+t.margin*2,this.nextData.stopx=a=i+t.width,this.nextData.starty=this.nextData.stopy,this.nextData.stopy=l=o+t.height,this.nextData.cnt=1),t.x=i,t.y=o,this.updateVal(this.data,"startx",i,Math.min),this.updateVal(this.data,"starty",o,Math.min),this.updateVal(this.data,"stopx",a,Math.max),this.updateVal(this.data,"stopy",l,Math.max),this.updateVal(this.nextData,"startx",i,Math.min),this.updateVal(this.nextData,"starty",o,Math.min),this.updateVal(this.nextData,"stopx",a,Math.max),this.updateVal(this.nextData,"stopy",l,Math.max)}init(t){this.name="",this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0,widthLimit:void 0},this.nextData={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0,cnt:0},UP(t.db.getConfig())}bumpLastMargin(t){this.data.stopx+=t,this.data.stopy+=t}},UP=s(function(e){ii(Cr,e),e?.fontFamily&&(Cr.personFontFamily=Cr.systemFontFamily=Cr.messageFontFamily=e.fontFamily),e?.fontSize&&(Cr.personFontSize=Cr.systemFontSize=Cr.messageFontSize=e.fontSize),e?.fontWeight&&(Cr.personFontWeight=Cr.systemFontWeight=Cr.messageFontWeight=e.fontWeight)},"setConf"),_4=s(e=>({fontFamily:e.boundaryFontFamily,fontSize:e.boundaryFontSize,fontWeight:e.boundaryFontWeight}),"boundaryFont"),iZe=s(e=>({fontFamily:e.messageFontFamily,fontSize:e.messageFontSize,fontWeight:e.messageFontWeight}),"messageFont");s(Am,"calcC4ShapeTextWH");Ece=s(function(e,t,r){let n=r.data.startx,i=r.data.starty;t.x=n,t.y=i,t.width=r.data.stopx-n,t.height=r.data.stopy-i,t.label.y=Cr.c4ShapeMargin-35;let a=t.wrap&&Cr.wrap,o=_4(Cr);o.fontSize=o.fontSize+2,o.fontWeight="bold";let l=Qa(t.label.text,o);Am("label",t,a,o,l),Qc.drawBoundary(e,t,Cr)},"drawBoundary"),Ace=s(async function(e,t,r,n){let i=Pe(),a=i.look??"classic",o={config:i},l=t.attr("id")??"",u=n.map(d=>r[Number(d)]),h=s(d=>{let f=d.shape?L2[d.shape]:void 0;if(!f)throw new Error(`C4: no shape handler for "${d.shape}"`);return f},"shapeHandlerFor");await Promise.all(u.map(async d=>{let f=WP(d,Cr,Cr.c4ShapePadding,a,Cr.width);f.domId=`${l}-${f.id}`;let p=await h(f)(t,f,o);d.width=f.width??Cr.width,d.height=f.height??Cr.height,d.margin=Cr.c4ShapeMargin,p.remove()}));for(let d of u)e.insert(d);await Promise.all(u.map(async d=>{let f=WP(d,Cr,Cr.c4ShapePadding,a,Cr.width);f.domId=`${l}-${f.id}`,f.x=d.x+d.width/2,f.y=d.y+d.height/2;let p=t.append("g").attr("transform",`translate(${d.x+d.width/2}, ${d.y+d.height/2})`);await h(f)(p,f,o),d.intersect=f.intersect})),e.bumpLastMargin(Cr.c4ShapeMargin)},"drawC4ShapeArray"),YP=class{static{s(this,"Point")}constructor(t,r){this.x=t,this.y=r}},wce=s(function(e,t){if(!e.intersect)throw new Error(`C4 shape "${e.alias}" has no intersect function. Please report this to https://github.com/mermaid-js/mermaid/issues`);let{x:r,y:n}=e.intersect(t);return new YP(r,n)},"getIntersectPoint"),aZe=s(function(e,t){let r={x:0,y:0};r.x=t.x+t.width/2,r.y=t.y+t.height/2;let n=wce(e,r);r.x=e.x+e.width/2,r.y=e.y+e.height/2;let i=wce(t,r);return{startPoint:n,endPoint:i}},"getIntersectPoints"),sZe=s(function(e,t,r,n,i){let a=n.db.getC4Type(),o=0;for(let l of t){o=o+1;let u=l.wrap&&Cr.wrap,h=iZe(Cr);a==="C4Dynamic"&&(l.label.text=o+": "+l.label.text);let d=Qa(l.label.text,h);Am("label",l,u,h,d),l.techn&&l.techn.text!==""&&(d=Qa(l.techn.text,h),Am("techn",l,u,h,d)),l.descr&&l.descr.text!==""&&(d=Qa(l.descr.text,h),Am("descr",l,u,h,d));let f=r(l.from),p=r(l.to);if(!f||!p)throw new Error(`C4 rel "${l.from}" -> "${l.to}" references an unknown shape`);let m=aZe(f,p);if(!m.startPoint||!m.endPoint)throw new Error(`Could not calculate intersection points for rel "${l.from}" -> "${l.to}"`);l.startPoint=m.startPoint,l.endPoint=m.endPoint}Qc.drawRels(e,t,Cr,i)},"drawRels");s(Rce,"drawInsideBoundary");oZe=s(async function(e,t,r,n){Cr=mk("c4");let i=Pe().securityLevel,{root:a}=yae(t,i),o=n.db;o.setWrap(Cr.wrap),kce=o.getC4ShapeInRow(),HP=o.getC4BoundaryInRow(),se.debug(`C:${JSON.stringify(Cr,null,2)}`);let l=a.select(`[id="${t}"]`);Qc.insertComputerIcon(l,t),Qc.insertDatabaseIcon(l,t),Qc.insertClockIcon(l,t);let u=new L4(n);u.setData(Cr.diagramMarginX,Cr.diagramMarginX,Cr.diagramMarginY,Cr.diagramMarginY),u.data.widthLimit=screen.availWidth,D2=Cr.diagramMarginX,I2=Cr.diagramMarginY;let h=o.getTitle(),d=o.getBoundaries("");await Rce(l,"",u,d,n),Qc.insertArrowHead(l,t),Qc.insertArrowEnd(l,t),Qc.insertArrowCrossHead(l,t),Qc.insertArrowFilledHead(l,t),sZe(l,o.getRels(),o.getC4Shape,n,t),u.data.stopx=D2,u.data.stopy=I2;let f=u.data,p=f.startx,m=f.starty,y=I2-m+2*Cr.diagramMarginY,v=D2-p,x=v+2*Cr.diagramMarginX;h&&l.append("text").text(h).attr("x",v/2-4*Cr.diagramMarginX).attr("y",m+Cr.diagramMarginY),jr(l,y,x,Cr.useMaxWidth);let b=h?60:0;l.attr("viewBox",p-Cr.diagramMarginX+" -"+(Cr.diagramMarginY+b)+" "+x+" "+(y+b)),se.debug("models:",f)},"draw"),jP={drawPersonOrSystemArray:Ace,drawBoundary:Ece,setConf:UP,draw:oZe}});var lZe,cZe,Lce,Dce=F(()=>{"use strict";Jt();qP();lZe=s(()=>{let e=Pe().c4??{},t=new CSSStyleSheet;for(let r of VP){let n=t.cssRules[t.insertRule(`.c4-shape.c4-${r} .label {}`,t.cssRules.length)],i=e[`${r}FontFamily`],a=e[`${r}FontSize`],o=e[`${r}FontWeight`];i&&n.style.setProperty("font-family",i),a&&n.style.setProperty("font-size",typeof a=="number"?`${a}px`:a),o&&n.style.setProperty("font-weight",String(o))}return[...t.cssRules].filter(r=>r.style.length>0).map(r=>` ${r.cssText}`).join(`
`)},"elementFontStyles"),cZe=s(e=>`.person {
stroke: ${e.personBorder};
fill: ${e.personBkg};
}
${lZe()}
/* The element font colour is set inline per element (default white); the
label text takes it via currentColor. */
.c4-shape .label,
.c4-shape .label text {
color: inherit;
fill: currentColor;
}
/* Structurizr typography: bold name, smaller stereotype/type and description lines. */
.c4-shape .label .c4-name {
font-weight: bold;
}
.c4-shape .label .c4-type {
font-size: 0.75em;
}
.c4-shape .label .c4-descr {
font-size: 0.82em;
}
.c4-shape .basic,
.c4-shape rect,
.c4-shape path,
.c4-shape circle,
.c4-shape ellipse,
.c4-shape line {
stroke-width: 2px;
}
`,"getStyles"),Lce=cZe});var Ice={};sr(Ice,{diagram:()=>uZe});var uZe,Mce=F(()=>{"use strict";K7();oI();_ce();Dce();uZe={parser:yJ,db:cb,renderer:jP,styles:Lce,init:s(({c4:e,wrap:t})=>{jP.setConf(e),cb.setWrap(t)},"init")}});function pZe(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function M2(){if(Pce)return rf;Pce=1;function e(o){return typeof o>"u"||o===null}s(e,"isNothing");function t(o){return typeof o=="object"&&o!==null}s(t,"isObject");function r(o){return Array.isArray(o)?o:e(o)?[]:[o]}s(r,"toArray");function n(o,l){if(l){let u=Object.keys(l);for(let h=0,d=u.length;hf&&(h=" ... ",a=l-f+h.length),o-l>f&&(d=" ...",o=l+f-d.length),{str:h+i.slice(a,o).replace(/\t/g,"\u2192")+d,pos:l-a+h.length}}s(t,"getLine");function r(i,a){return e.repeat(" ",a-i.length)+i}s(r,"padStart");function n(i,a){if(a=Object.create(a||null),!i.buffer)return null;a.maxLength||(a.maxLength=79),typeof a.indent!="number"&&(a.indent=1),typeof a.linesBefore!="number"&&(a.linesBefore=3),typeof a.linesAfter!="number"&&(a.linesAfter=2);let o=/\r?\n|\r|\0/g,l=[0],u=[],h,d=-1;for(;h=o.exec(i.buffer);)u.push(h.index),l.push(h.index+h[0].length),i.position<=h.index&&d<0&&(d=l.length-2);d<0&&(d=l.length-1);let f="",p=Math.min(i.line+a.linesAfter,u.length).toString().length,m=a.maxLength-(a.indent+p+3);for(let y=1;y<=a.linesBefore&&!(d-y<0);y++){let v=t(i.buffer,l[d-y],u[d-y],i.position-(l[d]-l[d-y]),m);f=e.repeat(" ",a.indent)+r((i.line-y+1).toString(),p)+" | "+v.str+`
`+f}let g=t(i.buffer,l[d],u[d],i.position,m);f+=e.repeat(" ",a.indent)+r((i.line+1).toString(),p)+" | "+g.str+`
`,f+=e.repeat("-",a.indent+p+3+g.pos)+`^
`;for(let y=1;y<=a.linesAfter&&!(d+y>=u.length);y++){let v=t(i.buffer,l[d+y],u[d+y],i.position-(l[d]-l[d+y]),m);f+=e.repeat(" ",a.indent)+r((i.line+y+1).toString(),p)+" | "+v.str+`
`}return f.replace(/\n$/,"")}return s(n,"makeSnippet"),KP=n,KP}function Fs(){if($ce)return ZP;$ce=1;let e=N2(),t=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],r=["scalar","sequence","mapping"];function n(a){let o={};return a!==null&&Object.keys(a).forEach(function(l){a[l].forEach(function(u){o[String(u)]=l})}),o}s(n,"compileStyleAliases");function i(a,o){if(o=o||{},Object.keys(o).forEach(function(l){if(t.indexOf(l)===-1)throw new e('Unknown option "'+l+'" is met in definition of "'+a+'" YAML type.')}),this.options=o,this.tag=a,this.kind=o.kind||null,this.resolve=o.resolve||function(){return!0},this.construct=o.construct||function(l){return l},this.instanceOf=o.instanceOf||null,this.predicate=o.predicate||null,this.represent=o.represent||null,this.representName=o.representName||null,this.defaultStyle=o.defaultStyle||null,this.multi=o.multi||!1,this.styleAliases=n(o.styleAliases||null),r.indexOf(this.kind)===-1)throw new e('Unknown kind "'+this.kind+'" is specified for "'+a+'" YAML type.')}return s(i,"Type2"),ZP=i,ZP}function sue(){if(Fce)return QP;Fce=1;let e=N2(),t=Fs();function r(a,o){let l=[];return a[o].forEach(function(u){let h=l.length;l.forEach(function(d,f){d.tag===u.tag&&d.kind===u.kind&&d.multi===u.multi&&(h=f)}),l[h]=u}),l}s(r,"compileList");function n(){let a={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function o(l){l.multi?(a.multi[l.kind].push(l),a.multi.fallback.push(l)):a[l.kind][l.tag]=a.fallback[l.tag]=l}s(o,"collectType");for(let l=0,u=arguments.length;l=48&&h<=57||h>=65&&h<=70||h>=97&&h<=102}s(r,"isHexCode");function n(h){return h>=48&&h<=55}s(n,"isOctCode");function i(h){return h>=48&&h<=57}s(i,"isDecCode");function a(h){if(h===null)return!1;let d=h.length,f=0,p=!1;if(!d)return!1;let m=h[f];if((m==="-"||m==="+")&&(m=h[++f]),m==="0"){if(f+1===d)return!0;if(m=h[++f],m==="b"){for(f++;f=0?"0b"+h.toString(2):"-0b"+h.toString(2).slice(1)},"binary"),octal:s(function(h){return h>=0?"0o"+h.toString(8):"-0o"+h.toString(8).slice(1)},"octal"),decimal:s(function(h){return h.toString(10)},"decimal"),hexadecimal:s(function(h){return h>=0?"0x"+h.toString(16).toUpperCase():"-0x"+h.toString(16).toUpperCase().slice(1)},"hexadecimal")},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),aO}function pue(){if(Yce)return sO;Yce=1;let e=M2(),t=Fs(),r=new RegExp("^(?:[-+]?(?:[0-9]+)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),n=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function i(h){return h===null||!r.test(h)?!1:isFinite(parseFloat(h,10))?!0:n.test(h)}s(i,"resolveYamlFloat");function a(h){let d=h.toLowerCase(),f=d[0]==="-"?-1:1;return"+-".indexOf(d[0])>=0&&(d=d.slice(1)),d===".inf"?f===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:d===".nan"?NaN:f*parseFloat(d,10)}s(a,"constructYamlFloat");let o=/^[-+]?[0-9]+e/;function l(h,d){if(isNaN(h))switch(d){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===h)switch(d){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===h)switch(d){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(e.isNegativeZero(h))return"-0.0";let f=h.toString(10);return o.test(f)?f.replace("e",".e"):f}s(l,"representYamlFloat");function u(h){return Object.prototype.toString.call(h)==="[object Number]"&&(h%1!==0||e.isNegativeZero(h))}return s(u,"isFloat"),sO=new t("tag:yaml.org,2002:float",{kind:"scalar",resolve:i,construct:a,predicate:u,represent:l,defaultStyle:"lowercase"}),sO}function mue(){return jce||(jce=1,oO=uue().extend({implicit:[hue(),due(),fue(),pue()]})),oO}function gue(){return Xce||(Xce=1,lO=mue()),lO}function yue(){if(Kce)return cO;Kce=1;let e=Fs(),t=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),r=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function n(o){return o===null?!1:t.exec(o)!==null||r.exec(o)!==null}s(n,"resolveYamlTimestamp");function i(o){let l=0,u=null,h=t.exec(o);if(h===null&&(h=r.exec(o)),h===null)throw new Error("Date resolve error");let d=+h[1],f=+h[2]-1,p=+h[3];if(!h[4])return new Date(Date.UTC(d,f,p));let m=+h[4],g=+h[5],y=+h[6];if(h[7]){for(l=h[7].slice(0,3);l.length<3;)l+="0";l=+l}if(h[9]){let x=+h[10],b=+(h[11]||0);u=(x*60+b)*6e4,h[9]==="-"&&(u=-u)}let v=new Date(Date.UTC(d,f,p,m,g,y,l));return u&&v.setTime(v.getTime()-u),v}s(i,"constructYamlTimestamp");function a(o){return o.toISOString()}return s(a,"representYamlTimestamp"),cO=new e("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:n,construct:i,instanceOf:Date,represent:a}),cO}function vue(){if(Zce)return uO;Zce=1;let e=Fs();function t(r){return r==="<<"||r===null}return s(t,"resolveYamlMerge"),uO=new e("tag:yaml.org,2002:merge",{kind:"scalar",resolve:t}),uO}function xue(){if(Qce)return hO;Qce=1;let e=Fs(),t=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
\r`;function r(o){if(o===null)return!1;let l=0,u=o.length,h=t;for(let d=0;d64)){if(f<0)return!1;l+=6}}return l%8===0}s(r,"resolveYamlBinary");function n(o){let l=o.replace(/[\r\n=]/g,""),u=l.length,h=t,d=0,f=[];for(let m=0;m>16&255),f.push(d>>8&255),f.push(d&255)),d=d<<6|h.indexOf(l.charAt(m));let p=u%4*6;return p===0?(f.push(d>>16&255),f.push(d>>8&255),f.push(d&255)):p===18?(f.push(d>>10&255),f.push(d>>2&255)):p===12&&f.push(d>>4&255),new Uint8Array(f)}s(n,"constructYamlBinary");function i(o){let l="",u=0,h=o.length,d=t;for(let p=0;p>18&63],l+=d[u>>12&63],l+=d[u>>6&63],l+=d[u&63]),u=(u<<8)+o[p];let f=h%3;return f===0?(l+=d[u>>18&63],l+=d[u>>12&63],l+=d[u>>6&63],l+=d[u&63]):f===2?(l+=d[u>>10&63],l+=d[u>>4&63],l+=d[u<<2&63],l+=d[64]):f===1&&(l+=d[u>>2&63],l+=d[u<<4&63],l+=d[64],l+=d[64]),l}s(i,"representYamlBinary");function a(o){return Object.prototype.toString.call(o)==="[object Uint8Array]"}return s(a,"isBinary"),hO=new e("tag:yaml.org,2002:binary",{kind:"scalar",resolve:r,construct:n,predicate:a,represent:i}),hO}function bue(){if(Jce)return dO;Jce=1;let e=Fs(),t=Object.prototype.hasOwnProperty,r=Object.prototype.toString;function n(a){if(a===null)return!0;let o=[],l=a;for(let u=0,h=l.length;u=48&&G<=57)return G-48;let X=G|32;return X>=97&&X<=102?X-97+10:-1}s(S,"fromHexCode");function k(G){return G===120?2:G===117?4:G===85?8:0}s(k,"escapedHexLen");function R(G){return G>=48&&G<=57?G-48:-1}s(R,"fromDecimalCode");function M(G){switch(G){case 48:return"\0";case 97:return"\x07";case 98:return"\b";case 116:return" ";case 9:return" ";case 110:return`
`;case 118:return"\v";case 102:return"\f";case 114:return"\r";case 101:return"\x1B";case 32:return" ";case 34:return'"';case 47:return"/";case 92:return"\\";case 78:return"\x85";case 95:return"\xA0";case 76:return"\u2028";case 80:return"\u2029";default:return""}}s(M,"simpleEscapeSequence");function P(G){return G<=65535?String.fromCharCode(G):String.fromCharCode((G-65536>>10)+55296,(G-65536&1023)+56320)}s(P,"charFromCodepoint");function N(G,X,ee){X==="__proto__"?Object.defineProperty(G,X,{configurable:!0,enumerable:!0,writable:!0,value:ee}):G[X]=ee}s(N,"setProperty");let _=new Array(256),A=new Array(256);for(let G=0;G<256;G++)_[G]=M(G)?1:0,A[G]=M(G);function I(G,X){this.input=G,this.filename=X.filename||null,this.schema=X.schema||n,this.onWarning=X.onWarning||null,this.legacy=X.legacy||!1,this.json=X.json||!1,this.listener=X.listener||null,this.maxDepth=typeof X.maxDepth=="number"?X.maxDepth:100,this.maxTotalMergeKeys=typeof X.maxTotalMergeKeys=="number"?X.maxTotalMergeKeys:1e4,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=G.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.depth=0,this.totalMergeKeys=0,this.firstTabInLine=-1,this.documents=[],this.anchorMapTransactions=[]}s(I,"State");function D(G,X){let ee={name:G.filename,buffer:G.input.slice(0,-1),position:G.position,line:G.line,column:G.position-G.lineStart};return ee.snippet=r(ee),new t(X,ee)}s(D,"generateError");function L(G,X){throw D(G,X)}s(L,"throwError");function B(G,X){G.onWarning&&G.onWarning.call(null,D(G,X))}s(B,"throwWarning");function O(G,X,ee){let q=G.anchorMapTransactions;if(q.length!==0){let ie=q[q.length-1];i.call(ie,X)||(ie[X]={existed:i.call(G.anchorMap,X),value:G.anchorMap[X]})}G.anchorMap[X]=ee}s(O,"storeAnchor");function $(G){G.anchorMapTransactions.push(Object.create(null))}s($,"beginAnchorTransaction");function W(G){let X=G.anchorMapTransactions.pop(),ee=G.anchorMapTransactions;if(ee.length===0)return;let q=ee[ee.length-1],ie=Object.keys(X);for(let j=0,U=ie.length;j=0;q-=1){let ie=X[ee[q]];ie.existed?G.anchorMap[ee[q]]=ie.value:delete G.anchorMap[ee[q]]}}s(V,"rollbackAnchorTransaction");function z(G){return{position:G.position,line:G.line,lineStart:G.lineStart,lineIndent:G.lineIndent,firstTabInLine:G.firstTabInLine,tag:G.tag,anchor:G.anchor,kind:G.kind,result:G.result}}s(z,"snapshotState");function H(G,X){G.position=X.position,G.line=X.line,G.lineStart=X.lineStart,G.lineIndent=X.lineIndent,G.firstTabInLine=X.firstTabInLine,G.tag=X.tag,G.anchor=X.anchor,G.kind=X.kind,G.result=X.result}s(H,"restoreState");let K={YAML:s(function(X,ee,q){X.version!==null&&L(X,"duplication of %YAML directive"),q.length!==1&&L(X,"YAML directive accepts exactly one argument");let ie=/^([0-9]+)\.([0-9]+)$/.exec(q[0]);ie===null&&L(X,"ill-formed argument of the YAML directive");let j=parseInt(ie[1],10),U=parseInt(ie[2],10);j!==1&&L(X,"unacceptable YAML version of the document"),X.version=q[0],X.checkLineBreaks=U<2,U!==1&&U!==2&&B(X,"unsupported YAML version of the document")},"handleYamlDirective"),TAG:s(function(X,ee,q){let ie;q.length!==2&&L(X,"TAG directive accepts exactly two arguments");let j=q[0];ie=q[1],y.test(j)||L(X,"ill-formed tag handle (first argument) of the TAG directive"),i.call(X.tagMap,j)&&L(X,'there is a previously declared suffix for "'+j+'" tag handle'),v.test(ie)||L(X,"ill-formed tag prefix (second argument) of the TAG directive");try{ie=decodeURIComponent(ie)}catch{L(X,"tag prefix is malformed: "+ie)}X.tagMap[j]=ie},"handleTagDirective")};function J(G,X,ee,q){if(X=32&&Y<=1114111||L(G,"expected valid JSON character")}else p.test(ie)&&L(G,"the stream contains non-printable characters");G.result+=ie}}s(J,"captureSegment");function ne(G,X,ee,q){e.isObject(ee)||L(G,"cannot merge mappings; the provided source object is unacceptable");let ie=Object.keys(ee);for(let j=0,U=ie.length;jG.maxTotalMergeKeys&&L(G,"merge keys exceeded maxTotalMergeKeys ("+G.maxTotalMergeKeys+")"),i.call(X,Y)||(N(X,Y,ee[Y]),q[Y]=!0)}}s(ne,"mergeMappings");function Z(G,X,ee,q,ie,j,U,Y,Ae){if(Array.isArray(ie)){ie=Array.prototype.slice.call(ie);for(let me=0,Se=ie.length;me1&&(G.result+=e.repeat(`
`,X-1))}s(ce,"writeFoldedLines");function de(G,X,ee){let q,ie,j,U,Y,Ae,me=G.kind,Se=G.result,Ce=G.input.charCodeAt(G.position);if(w(Ce)||C(Ce)||Ce===35||Ce===38||Ce===42||Ce===33||Ce===124||Ce===62||Ce===39||Ce===34||Ce===37||Ce===64||Ce===96)return!1;if(Ce===63||Ce===45){let Me=G.input.charCodeAt(G.position+1);if(w(Me)||ee&&C(Me))return!1}for(G.kind="scalar",G.result="",q=ie=G.position,j=!1;Ce!==0;){if(Ce===58){let Me=G.input.charCodeAt(G.position+1);if(w(Me)||ee&&C(Me))break}else if(Ce===35){let Me=G.input.charCodeAt(G.position-1);if(w(Me))break}else{if(G.position===G.lineStart&&fe(G)||ee&&C(Ce))break;if(b(Ce))if(U=G.line,Y=G.lineStart,Ae=G.lineIndent,te(G,!1,-1),G.lineIndent>=X){j=!0,Ce=G.input.charCodeAt(G.position);continue}else{G.position=ie,G.line=U,G.lineStart=Y,G.lineIndent=Ae;break}}j&&(J(G,q,ie,!1),ce(G,G.line-U),q=ie=G.position,j=!1),T(Ce)||(ie=G.position+1),Ce=G.input.charCodeAt(++G.position)}return J(G,q,ie,!1),G.result?!0:(G.kind=me,G.result=Se,!1)}s(de,"readPlainScalar");function Ee(G,X){let ee,q,ie=G.input.charCodeAt(G.position);if(ie!==39)return!1;for(G.kind="scalar",G.result="",G.position++,ee=q=G.position;(ie=G.input.charCodeAt(G.position))!==0;)if(ie===39)if(J(G,ee,G.position,!0),ie=G.input.charCodeAt(++G.position),ie===39)ee=G.position,G.position++,q=G.position;else return!0;else b(ie)?(J(G,ee,q,!0),ce(G,te(G,!1,X)),ee=q=G.position):G.position===G.lineStart&&fe(G)?L(G,"unexpected end of the document within a single quoted scalar"):(G.position++,T(ie)||(q=G.position));L(G,"unexpected end of the stream within a single quoted scalar")}s(Ee,"readSingleQuotedScalar");function we(G,X){let ee,q,ie,j=G.input.charCodeAt(G.position);if(j!==34)return!1;for(G.kind="scalar",G.result="",G.position++,ee=q=G.position;(j=G.input.charCodeAt(G.position))!==0;){if(j===34)return J(G,ee,G.position,!0),G.position++,!0;if(j===92){if(J(G,ee,G.position,!0),j=G.input.charCodeAt(++G.position),b(j))te(G,!1,X);else if(j<256&&_[j])G.result+=A[j],G.position++;else if((ie=k(j))>0){let U=ie,Y=0;for(;U>0;U--)j=G.input.charCodeAt(++G.position),(ie=S(j))>=0?Y=(Y<<4)+ie:L(G,"expected hexadecimal character");G.result+=P(Y),G.position++}else L(G,"unknown escape sequence");ee=q=G.position}else b(j)?(J(G,ee,q,!0),ce(G,te(G,!1,X)),ee=q=G.position):G.position===G.lineStart&&fe(G)?L(G,"unexpected end of the document within a double quoted scalar"):(G.position++,T(j)||(q=G.position))}L(G,"unexpected end of the stream within a double quoted scalar")}s(we,"readDoubleQuotedScalar");function Fe(G,X){let ee=!0,q,ie,j,U=G.tag,Y,Ae=G.anchor,me,Se,Ce,Me,_e=Object.create(null),ze,Le,qe,ve=G.input.charCodeAt(G.position);if(ve===91)me=93,Me=!1,Y=[];else if(ve===123)me=125,Me=!0,Y={};else return!1;for(G.anchor!==null&&O(G,G.anchor,Y),ve=G.input.charCodeAt(++G.position);ve!==0;){if(te(G,!0,X),ve=G.input.charCodeAt(G.position),ve===me)return G.position++,G.tag=U,G.anchor=Ae,G.kind=Me?"mapping":"sequence",G.result=Y,!0;if(ee?ve===44&&L(G,"expected the node content, but found ','"):L(G,"missed comma between flow collection entries"),Le=ze=qe=null,Se=Ce=!1,ve===63){let lt=G.input.charCodeAt(G.position+1);w(lt)&&(Se=Ce=!0,G.position++,te(G,!0,X))}q=G.line,ie=G.lineStart,j=G.position,ue(G,X,a,!1,!0),Le=G.tag,ze=G.result,te(G,!0,X),ve=G.input.charCodeAt(G.position),(Ce||G.line===q)&&ve===58&&(Se=!0,ve=G.input.charCodeAt(++G.position),te(G,!0,X),ue(G,X,a,!1,!0),qe=G.result),Me?Z(G,Y,_e,Le,ze,qe,q,ie,j):Se?Y.push(Z(G,null,_e,Le,ze,qe,q,ie,j)):Y.push(ze),te(G,!0,X),ve=G.input.charCodeAt(G.position),ve===44?(ee=!0,ve=G.input.charCodeAt(++G.position)):ee=!1}L(G,"unexpected end of the stream within a flow collection")}s(Fe,"readFlowCollection");function Ye(G,X){let ee,q=h,ie=!1,j=!1,U=X,Y=0,Ae=!1,me,Se=G.input.charCodeAt(G.position);if(Se===124)ee=!1;else if(Se===62)ee=!0;else return!1;for(G.kind="scalar",G.result="";Se!==0;)if(Se=G.input.charCodeAt(++G.position),Se===43||Se===45)h===q?q=Se===43?f:d:L(G,"repeat of a chomping mode identifier");else if((me=R(Se))>=0)me===0?L(G,"bad explicit indentation width of a block scalar; it cannot be less than one"):j?L(G,"repeat of an indentation width identifier"):(U=X+me-1,j=!0);else break;if(T(Se)){do Se=G.input.charCodeAt(++G.position);while(T(Se));if(Se===35)do Se=G.input.charCodeAt(++G.position);while(!b(Se)&&Se!==0)}for(;Se!==0;){for(pe(G),G.lineIndent=0,Se=G.input.charCodeAt(G.position);(!j||G.lineIndentU&&(U=G.lineIndent),b(Se)){Y++;continue}if(!j&&U===0&&L(G,"missing indentation for block scalar"),G.lineIndentX)&&U!==0)L(G,"bad indentation of a sequence entry");else if(G.lineIndentX)&&(ze&&(ie=G.line,j=G.lineStart,U=G.position),ue(G,X,u,!0,q)&&(ze?Me=G.result:_e=G.result),ze||(Z(G,me,Se,Ce,Me,_e,ie,j,U),Ce=Me=_e=null),te(G,!0,-1),qe=G.input.charCodeAt(G.position)),(G.line===lt||G.lineIndent>X)&&qe!==0)L(G,"bad indentation of a mapping entry");else if(G.lineIndent=G.maxDepth&&L(G,"nesting exceeded maxDepth ("+G.maxDepth+")"),G.depth+=1,G.listener!==null&&G.listener("open",G),G.tag=null,G.anchor=null,G.kind=null,G.result=null;let ze=j=U=u===ee||l===ee;if(q&&te(G,!0,-1)&&(Ae=!0,G.lineIndent>X?Y=1:G.lineIndent===X?Y=0:G.lineIndentX?Y=1:G.lineIndent===X?Y=0:G.lineIndent tag; it should be "scalar", not "'+G.kind+'"');for(let Le=0,qe=G.implicitTypes.length;Le"),G.result!==null&&Ce.kind!==G.kind&&L(G,"unacceptable node kind for !<"+G.tag+'> tag; it should be "'+Ce.kind+'", not "'+G.kind+'"'),Ce.resolve(G.result,G.tag)?(G.result=Ce.construct(G.result,G.tag),G.anchor!==null&&O(G,G.anchor,G.result)):L(G,"cannot resolve a node with !<"+G.tag+"> explicit tag")}return G.listener!==null&&G.listener("close",G),G.depth-=1,G.tag!==null||G.anchor!==null||me}s(ue,"composeNode");function le(G){let X=G.position,ee=!1,q;for(G.version=null,G.checkLineBreaks=G.legacy,G.tagMap=Object.create(null),G.anchorMap=Object.create(null);(q=G.input.charCodeAt(G.position))!==0&&(te(G,!0,-1),q=G.input.charCodeAt(G.position),!(G.lineIndent>0||q!==37));){ee=!0,q=G.input.charCodeAt(++G.position);let ie=G.position;for(;q!==0&&!w(q);)q=G.input.charCodeAt(++G.position);let j=G.input.slice(ie,G.position),U=[];for(j.length<1&&L(G,"directive name must not be less than one character in length");q!==0;){for(;T(q);)q=G.input.charCodeAt(++G.position);if(q===35){do q=G.input.charCodeAt(++G.position);while(q!==0&&!b(q));break}if(b(q))break;for(ie=G.position;q!==0&&!w(q);)q=G.input.charCodeAt(++G.position);U.push(G.input.slice(ie,G.position))}q!==0&&pe(G),i.call(K,j)?K[j](G,j,U):B(G,'unknown document directive "'+j+'"')}if(te(G,!0,-1),G.lineIndent===0&&G.input.charCodeAt(G.position)===45&&G.input.charCodeAt(G.position+1)===45&&G.input.charCodeAt(G.position+2)===45?(G.position+=3,te(G,!0,-1)):ee&&L(G,"directives end mark is expected"),ue(G,G.lineIndent-1,u,!1,!0),te(G,!0,-1),G.checkLineBreaks&&m.test(G.input.slice(X,G.position))&&B(G,"non-ASCII line breaks are interpreted as content"),G.documents.push(G.result),G.position===G.lineStart&&fe(G)){G.input.charCodeAt(G.position)===46&&(G.position+=3,te(G,!0,-1));return}G.position"u"&&(ee=X,X=null);let q=he(G,ee);if(typeof X!="function")return q;for(let ie=0,j=q.length;ie=32&&U<=126||U>=161&&U<=55295&&U!==8232&&U!==8233||U>=57344&&U<=65533&&U!==a||U>=65536&&U<=1114111}s(ne,"isPrintable");function Z(U){return ne(U)&&U!==a&&U!==u&&U!==l}s(Z,"isNsCharOrWhitespace");function pe(U,Y,Ae){let me=Z(U),Se=me&&!J(U);return(Ae?me:me&&U!==x&&U!==R&&U!==M&&U!==N&&U!==A)&&U!==p&&!(Y===T&&!Se)||Z(Y)&&!J(Y)&&U===p||Y===T&&Se}s(pe,"isPlainSafe");function te(U){return ne(U)&&U!==a&&!J(U)&&U!==b&&U!==S&&U!==T&&U!==x&&U!==R&&U!==M&&U!==N&&U!==A&&U!==p&&U!==g&&U!==v&&U!==d&&U!==_&&U!==w&&U!==C&&U!==y&&U!==f&&U!==m&&U!==k&&U!==P}s(te,"isPlainSafeFirst");function fe(U){return!J(U)&&U!==T}s(fe,"isPlainSafeLast");function ce(U,Y){let Ae=U.charCodeAt(Y),me;return Ae>=55296&&Ae<=56319&&Y+1=56320&&me<=57343)?(Ae-55296)*1024+me-56320+65536:Ae}s(ce,"codePointAt");function de(U){return/^\n* /.test(U)}s(de,"needIndentIndicator");let Ee=1,we=2,Fe=3,Ye=4,He=5;function ye(U,Y,Ae,me,Se,Ce,Me,_e){let ze,Le=0,qe=null,ve=!1,lt=!1,Oe=me!==-1,mt=-1,At=te(ce(U,0))&&fe(ce(U,U.length-1));if(Y||Me)for(ze=0;ze=65536?ze+=2:ze++){if(Le=ce(U,ze),!ne(Le))return He;At=At&&pe(Le,qe,_e),qe=Le}else{for(ze=0;ze=65536?ze+=2:ze++){if(Le=ce(U,ze),Le===l)ve=!0,Oe&&(lt=lt||ze-mt-1>me&&U[mt+1]!==" ",mt=ze);else if(!ne(Le))return He;At=At&&pe(Le,qe,_e),qe=Le}lt=lt||Oe&&ze-mt-1>me&&U[mt+1]!==" "}return!ve&&!lt?At&&!Me&&!Se(U)?Ee:Ce===W?He:we:Ae>9&&de(U)?He:Me?Ce===W?He:we:lt?Ye:Fe}s(ye,"chooseScalarStyle");function Be(U,Y,Ae,me,Se){U.dump=(function(){if(Y.length===0)return U.quotingType===W?'""':"''";if(!U.noCompatMode&&(D.indexOf(Y)!==-1||L.test(Y)))return U.quotingType===W?'"'+Y+'"':"'"+Y+"'";let Ce=U.indent*Math.max(1,Ae),Me=U.lineWidth===-1?-1:Math.max(Math.min(U.lineWidth,40),U.lineWidth-Ce),_e=me||U.flowLevel>-1&&Ae>=U.flowLevel;function ze(Le){return K(U,Le)}switch(s(ze,"testAmbiguity"),ye(Y,_e,U.indent,Me,ze,U.quotingType,U.forceQuotes&&!me,Se)){case Ee:return Y;case we:return"'"+Y.replace(/'/g,"''")+"'";case Fe:return"|"+Ie(Y,U.indent)+Ne(z(Y,Ce));case Ye:return">"+Ie(Y,U.indent)+Ne(z(re(Y,Me),Ce));case He:return'"'+le(Y)+'"';default:throw new t("impossible error: invalid scalar style")}})()}s(Be,"writeScalar");function Ie(U,Y){let Ae=de(U)?String(Y):"",me=U[U.length-1]===`
`,Ce=me&&(U[U.length-2]===`
`||U===`
`)?"+":me?"":"-";return Ae+Ce+`
`}s(Ie,"blockHeader");function Ne(U){return U[U.length-1]===`
`?U.slice(0,-1):U}s(Ne,"dropEndingNewline");function re(U,Y){let Ae=/(\n+)([^\n]*)/g,me=(function(){let _e=U.indexOf(`
`);return _e=_e!==-1?_e:U.length,Ae.lastIndex=_e,ue(U.slice(0,_e),Y)})(),Se=U[0]===`
`||U[0]===" ",Ce,Me;for(;Me=Ae.exec(U);){let _e=Me[1],ze=Me[2];Ce=ze[0]===" ",me+=_e+(!Se&&!Ce&&ze!==""?`
`:"")+ue(ze,Y),Se=Ce}return me}s(re,"foldString");function ue(U,Y){if(U===""||U[0]===" ")return U;let Ae=/ [^ ]/g,me,Se=0,Ce,Me=0,_e=0,ze="";for(;me=Ae.exec(U);)_e=me.index,_e-Se>Y&&(Ce=Me>Se?Me:_e,ze+=`
`+U.slice(Se,Ce),Se=Ce+1),Me=_e;return ze+=`
`,U.length-Se>Y&&Me>Se?ze+=U.slice(Se,Me)+`
`+U.slice(Me+1):ze+=U.slice(Se),ze.slice(1)}s(ue,"foldLine");function le(U){let Y="",Ae=0;for(let me=0;me=65536?me+=2:me++){Ae=ce(U,me);let Se=I[Ae];!Se&&ne(Ae)?(Y+=U[me],Ae>=65536&&(Y+=U[me+1])):Y+=Se||O(Ae)}return Y}s(le,"escapeString");function he(U,Y,Ae){let me="",Se=U.tag;for(let Ce=0,Me=Ae.length;Ce"u"&&ee(U,Y,null,!1,!1))&&(me!==""&&(me+=","+(U.condenseFlow?"":" ")),me+=U.dump)}U.tag=Se,U.dump="["+me+"]"}s(he,"writeFlowSequence");function Te(U,Y,Ae,me){let Se="",Ce=U.tag;for(let Me=0,_e=Ae.length;Me<_e;Me+=1){let ze=Ae[Me];U.replacer&&(ze=U.replacer.call(Ae,String(Me),ze)),(ee(U,Y+1,ze,!0,!0,!1,!0)||typeof ze>"u"&&ee(U,Y+1,null,!0,!0,!1,!0))&&((!me||Se!=="")&&(Se+=H(U,Y)),U.dump&&l===U.dump.charCodeAt(0)?Se+="-":Se+="- ",Se+=U.dump)}U.tag=Ce,U.dump=Se||"[]"}s(Te,"writeBlockSequence");function oe(U,Y,Ae){let me="",Se=U.tag,Ce=Object.keys(Ae);for(let Me=0,_e=Ce.length;Me<_e;Me+=1){let ze="";me!==""&&(ze+=", "),U.condenseFlow&&(ze+='"');let Le=Ce[Me],qe=Ae[Le];U.replacer&&(qe=U.replacer.call(Ae,Le,qe)),ee(U,Y,Le,!1,!1)&&(U.dump.length>1024&&(ze+="? "),ze+=U.dump+(U.condenseFlow?'"':"")+":"+(U.condenseFlow?"":" "),ee(U,Y,qe,!1,!1)&&(ze+=U.dump,me+=ze))}U.tag=Se,U.dump="{"+me+"}"}s(oe,"writeFlowMapping");function G(U,Y,Ae,me){let Se="",Ce=U.tag,Me=Object.keys(Ae);if(U.sortKeys===!0)Me.sort();else if(typeof U.sortKeys=="function")Me.sort(U.sortKeys);else if(U.sortKeys)throw new t("sortKeys must be a boolean or a function");for(let _e=0,ze=Me.length;_e1024;lt&&(U.dump&&l===U.dump.charCodeAt(0)?Le+="?":Le+="? "),Le+=U.dump,lt&&(Le+=H(U,Y)),ee(U,Y+1,ve,!0,lt)&&(U.dump&&l===U.dump.charCodeAt(0)?Le+=":":Le+=": ",Le+=U.dump,Se+=Le)}U.tag=Ce,U.dump=Se||"{}"}s(G,"writeBlockMapping");function X(U,Y,Ae){let me=Ae?U.explicitTypes:U.implicitTypes;for(let Se=0,Ce=me.length;Se tag resolver accepts not "'+_e+'" style');U.dump=ze}return!0}}return!1}s(X,"detectType");function ee(U,Y,Ae,me,Se,Ce,Me){U.tag=null,U.dump=Ae,X(U,Ae,!1)||X(U,Ae,!0);let _e=n.call(U.dump),ze=me;me&&(me=U.flowLevel<0||U.flowLevel>Y);let Le=_e==="[object Object]"||_e==="[object Array]",qe,ve;if(Le&&(qe=U.duplicates.indexOf(Ae),ve=qe!==-1),(U.tag!==null&&U.tag!=="?"||ve||U.indent!==2&&Y>0)&&(Se=!1),ve&&U.usedDuplicates[qe])U.dump="*ref_"+qe;else{if(Le&&ve&&!U.usedDuplicates[qe]&&(U.usedDuplicates[qe]=!0),_e==="[object Object]")me&&Object.keys(U.dump).length!==0?(G(U,Y,U.dump,Se),ve&&(U.dump="&ref_"+qe+U.dump)):(oe(U,Y,U.dump),ve&&(U.dump="&ref_"+qe+" "+U.dump));else if(_e==="[object Array]")me&&U.dump.length!==0?(U.noArrayIndent&&!Me&&Y>0?Te(U,Y-1,U.dump,Se):Te(U,Y,U.dump,Se),ve&&(U.dump="&ref_"+qe+U.dump)):(he(U,Y,U.dump),ve&&(U.dump="&ref_"+qe+" "+U.dump));else if(_e==="[object String]")U.tag!=="?"&&Be(U,U.dump,Y,Ce,ze);else{if(_e==="[object Undefined]")return!1;if(U.skipInvalid)return!1;throw new t("unacceptable kind of an object to dump "+_e)}if(U.tag!==null&&U.tag!=="?"){let lt=encodeURI(U.tag[0]==="!"?U.tag.slice(1):U.tag).replace(/!/g,"%21");U.tag[0]==="!"?lt="!"+lt:lt.slice(0,18)==="tag:yaml.org,2002:"?lt="!!"+lt.slice(18):lt="!<"+lt+">",U.dump=lt+" "+U.dump}}return!0}s(ee,"writeNode");function q(U,Y){let Ae=[],me=[];ie(U,Ae,me);let Se=me.length;for(let Ce=0;Ce{"use strict";s(pZe,"getDefaultExportFromCjs");ys={},D4={},rf={};s(M2,"requireCommon");s(N2,"requireException");s(mZe,"requireSnippet");s(Fs,"requireType");s(sue,"requireSchema");s(oue,"requireStr");s(lue,"requireSeq");s(cue,"requireMap");s(uue,"requireFailsafe");s(hue,"require_null");s(due,"requireBool");s(fue,"requireInt");s(pue,"requireFloat");s(mue,"requireJson");s(gue,"requireCore");s(yue,"requireTimestamp");s(vue,"requireMerge");s(xue,"requireBinary");s(bue,"requireOmap");s(Tue,"requirePairs");s(Cue,"requireSet");s(yO,"require_default");s(gZe,"requireLoader");gO={};s(yZe,"requireDumper");s(vZe,"requireJsYaml");xZe=vZe(),bZe=pZe(xZe),{Type:_mr,Schema:Lmr,FAILSAFE_SCHEMA:Dmr,JSON_SCHEMA:nf,CORE_SCHEMA:Imr,DEFAULT_SCHEMA:Mmr,load:af,loadAll:Nmr,dump:Pmr,YAMLException:Omr,types:Bmr,safeLoad:$mr,safeLoadAll:Fmr,safeDump:Gmr}=bZe});var TZe,M4,Sue=F(()=>{"use strict";Wr();P2();Jt();St();R4();er();Yr();$n();Xd();q0();TZe="flowchart-",M4=class{constructor(){this.vertexCounter=0;this.config=Pe();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=Lr;this.setAccDescription=Mr;this.setDiagramTitle=Gr;this.getAccTitle=Ir;this.getAccDescription=Nr;this.getDiagramTitle=Pr;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{s(this,"FlowDB")}sanitizeText(t){return Tt.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,o,l={},u){if(!t||t.trim().length===0)return;let h;if(u!==void 0){let g;u.includes(`
`)?g=u+`
`:g=`{
`+u+`
}`,h=af(g,{schema:nf})}let d=this.subGraphLookup.get(t);if(d&&h){d.metadata={...d.metadata,...h};return}let f=this.edges.find(g=>g.id===t);if(f){let g=h;g?.animate!==void 0&&(f.animate=g.animate),g?.animation!==void 0&&(f.animation=g.animation),g?.curve!==void 0&&(f.interpolate=g.curve);return}let p,m=this.vertices.get(t);if(m===void 0&&(r===void 0&&n===void 0&&i!==void 0&&i!==null&&se.warn(`Style applied to unknown node "${t}". This may indicate a typo. The node will be created automatically.`),m={id:t,labelType:"text",domId:TZe+t+"-"+this.vertexCounter,styles:[],classes:[]},this.vertices.set(t,m)),this.vertexCounter++,r!==void 0?(this.config=Pe(),p=this.sanitizeText(r.text.trim()),m.labelType=r.type,p.startsWith('"')&&p.endsWith('"')&&(p=p.substring(1,p.length-1)),m.text=p):m.text===void 0&&(m.text=t),n!==void 0&&(m.type=n),i?.forEach(g=>{m.styles.push(g)}),a?.forEach(g=>{m.classes.push(g)}),o!==void 0&&(m.dir=o),m.props===void 0?m.props=l:l!==void 0&&Object.assign(m.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(!Cce(h.shape))throw new Error(`No such shape: ${h.shape}.`);m.type=h?.shape}h?.label&&(m.text=h?.label,m.labelType=this.sanitizeNodeLabelType(h?.labelType)),h?.icon&&(m.icon=h?.icon,!h.label?.trim()&&m.text===t&&(m.text="")),h?.form&&(m.form=h?.form),h?.pos&&(m.pos=h?.pos),h?.img&&(m.img=h?.img,!h.label?.trim()&&m.text===t&&(m.text="")),h?.constraint&&(m.constraint=h.constraint),h.w&&(m.assetWidth=Number(h.w)),h.h&&(m.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};se.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=Jc(l.start,l.end,{counter:0,prefix:"L"}):l.id=Jc(l.start,l.end,{counter:h.length+1,prefix:"L"})}if(this.edges.length<(this.config.maxEdges??500))se.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;se.info("addLink",t,r,i);for(let a of t)for(let o of r){let l=a===t[t.length-1],u=o===r[0];l&&u?this.addSingleLink(a,o,n,i):this.addSingleLink(a,o,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(o=>{if(/color/.exec(o)){let l=o.replace("fill","bgFill");a.textStyles.push(l)}a.styles.push(o)})})}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 o=this.subGraphLookup.get(n);o&&o.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(Pe().securityLevel!=="loose"||r===void 0)return;let i=[];if(typeof n=="string"){i=n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let o=0;o{let o=this.lookUpDomId(t),l=document.querySelector(`[id="${o}"]`);l!==null&&l.addEventListener("click",()=>{or.runFunc(r,...i)},!1)}))}setLink(t,r,n){t.split(",").forEach(i=>{let a=this.vertices.get(i);a!==void 0&&(a.link=or.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=_y();ut(t).select("svg").selectAll("g.node").on("mouseover",a=>{let o=ut(a.currentTarget),l=o.attr("title");if(l===null)return;let u=a.currentTarget?.getBoundingClientRect();r.transition().duration(200).style("opacity",".9"),r.text(o.attr("title")).style("left",window.scrollX+u.left+(u.right-u.left)/2+"px").style("top",window.scrollY+u.bottom+"px"),r.html(ao.sanitize(l)),o.classed("hover",!0)}).on("mouseout",a=>{r.transition().duration(500).style("opacity",0),ut(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=Pe(),Tr()}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=s(p=>{let m={boolean:{},number:{},string:{}},g=[],y;return{nodeList:p.filter(function(x){let b=typeof x;return x.stmt&&x.stmt==="dir"?(y=x.value,!1):x.trim()===""?!1:b in m?m[b].hasOwnProperty(x)?!1:m[b][x]=!0:g.includes(x)?!1:g.push(x)}),dir:y}},"uniq")(r.flat()),u=l.nodeList,h=l.dir,d=Pe().flowchart??{};if(h=h??(d.inheritDir?this.getDirection()??Pe().direction??void 0:void 0),this.version==="gen-1")for(let p=0;p2e3)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,o);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",o=n.length-1;n.startsWith("=")&&(a="thick"),n.startsWith("~")&&(a="invisible");let l=this.countChar(".",n);return l&&(a="dotted",o=l),{type:i,stroke:a,length:o}}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,o){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:o,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=Pe(),r=[],n=[],i=this.getSubGraphs(),a=new Map,o=new Map,l=new Map;for(let g of i)for(let y of g.nodes)this.subGraphLookup.has(y)&&l.set(y,g.id);let u=s(g=>this.subGraphLookup.get(g)?.metadata?.view==="collapsed","isCollapsed"),h=s(g=>{let y,v=new Set,x=g;for(;x!==void 0&&!v.has(x);)v.add(x),u(x)&&(y=x),x=l.get(x);return y},"outermostCollapsed"),d=new Set,f=new Map;for(let g of i){let y=h(g.id);if(y!==void 0){g.id!==y&&(d.add(g.id),f.set(g.id,y));for(let v of g.nodes)v!==y&&(d.add(v),f.set(v,y))}}for(let g=i.length-1;g>=0;g--){let y=i[g];if(!d.has(y.id)){y.nodes.length>0&&o.set(y.id,!0);for(let v of y.nodes)a.set(v,y.id)}}for(let g=i.length-1;g>=0;g--){let y=i[g];d.has(y.id)||(y.metadata?.view==="collapsed"?r.push({id:y.id,label:y.title,labelStyle:"",labelType:y.labelType,parentId:a.get(y.id),padding:8,cssCompiledStyles:this.getCompiledStyles(y.classes),cssClasses:y.classes.join(" "),shape:"collapsedGroup",dir:y.dir,isGroup:!1,look:t.look}):r.push({id:y.id,label:y.title,labelStyle:"",labelType:y.labelType,parentId:a.get(y.id),padding:8,cssCompiledStyles:this.getCompiledStyles(y.classes),cssClasses:y.classes.join(" "),shape:"rect",dir:y.dir,isGroup:!0,look:t.look}))}this.getVertices().forEach(g=>{d.has(g.id)||this.addNodeFromVertex(g,r,a,o,t,t.look||"classic")});let m=this.getEdges();return m.forEach((g,y)=>{let{arrowTypeStart:v,arrowTypeEnd:x}=this.destructEdgeType(g.type),b=[...m.defaultStyle??[]],T=f.get(g.start)??g.start,w=f.get(g.end)??g.end;if(T===w&&(f.has(g.start)||f.has(g.end)))return;g.style&&b.push(...g.style);let C={id:Jc(T,w,{counter:y,prefix:"L"},g.id),isUserDefinedId:g.isUserDefinedId,start:T,end:w,type:g.type??"normal",label:g.text,labelType:g.labelType,labelpos:"c",thickness:g.stroke,minlen:g.length,classes:g?.stroke==="invisible"?"":"edge-thickness-normal edge-pattern-solid flowchart-link",arrowTypeStart:g?.stroke==="invisible"||g?.type==="arrow_open"?"none":v,arrowTypeEnd:g?.stroke==="invisible"||g?.type==="arrow_open"?"none":x,arrowheadStyle:"fill: #333",cssCompiledStyles:this.getCompiledStyles(g.classes),labelStyle:b,style:b,pattern:g.stroke,look:t.look,animate:g.animate,animation:g.animation,curve:g.interpolate||this.edges.defaultInterpolate||t.flowchart?.curve};n.push(C)}),{nodes:r,edges:n,other:{},config:t}}defaultConfig(){return pk.flowchart}}});var xl,Rm=F(()=>{"use strict";Wr();xl=s((e,t)=>{let r;return t==="sandbox"&&(r=ut("#i"+e)),(t==="sandbox"?ut(r.nodes()[0].contentDocument.body):ut("body")).select(`[id="${e}"]`)},"getDiagramElement")});var kh,O2=F(()=>{"use strict";kh=s(({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 wue,kue=F(()=>{"use strict";Jt();br();St();Wr();Kt();qo();p4();Xt();wue=s(async(e,t)=>{let r=Pe(),{themeVariables:n,handDrawnSeed:i}=r,{clusterBkg:a,clusterBorder:o}=n,l=o,{labelStyles:u,nodeStyles:h,borderStyles:d,backgroundStyles:f}=st(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=Aa(r.flowchart.htmlLabels),g=t.direction==="LR",y=p.insert("g").attr("class","cluster-label swimlane-label"),v=await li(y,t.label,{style:t.labelStyle,useHtmlLabels:m,isNode:!0,width:t.width}),x=v.getBBox();if(m){let A=v.children[0],I=ut(v);x=A.getBoundingClientRect(),I.attr("width",x.width),I.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 w=t.height,C=t.y-w/2,S=t.y+w/2,k=t.x-T/2,R=t.swimlaneContentTop!==void 0?t.swimlaneContentTop:C+w/3,M=g?4:0,P=x.height+2*M,N,_;if(g){let A=Math.max(P,x.height+2*M),I=k+A,D=Math.max(0,T-A);if(t.look==="handDrawn"){let O=ot.svg(p),$=ft(t,{roughness:.7,fill:a,stroke:l,fillWeight:3,seed:i}),W=ft(t,{roughness:.7,fill:"none",stroke:l,seed:i}),V=O.rectangle(k,C,A,w,$);N=p.insert(()=>V,":first-child");let z=O.rectangle(I,C,D,w,W);_=p.insert(()=>z,":first-child"),N.select("path:nth-child(2)").attr("style",d.join(";")),N.select("path").attr("style",f.join(";").replace("fill","stroke"))}else N=p.insert("rect",":first-child"),_=p.insert("rect",":first-child"),N.attr("class","swimlane-title").attr("style",h).attr("x",k).attr("y",C).attr("width",A).attr("height",w).attr("fill",a).attr("stroke",l),_.attr("class","swimlane-body").attr("style",h).attr("x",I).attr("y",C).attr("width",D).attr("height",w).attr("fill","none").attr("stroke",l);let L=k+A/2,B=t.y;y.attr("transform",`translate(${L}, ${B}) rotate(-90) translate(${-x.width/2}, ${-x.height/2})`)}else{let A=Math.max(0,R-C),I=Math.min(P,A),D=C+I,L=Math.max(0,S-D),B=t.x-T/2;if(t.look==="handDrawn"){let W=ot.svg(p),V=ft(t,{roughness:.7,fill:a,stroke:l,fillWeight:3,seed:i}),z=ft(t,{roughness:.7,fill:"none",stroke:l,seed:i}),H=W.rectangle(B,C,T,I,V);N=p.insert(()=>H,":first-child");let K=W.rectangle(B,D,T,L,z);_=p.insert(()=>K,":first-child"),N.select("path:nth-child(2)").attr("style",d.join(";")),N.select("path").attr("style",f.join(";").replace("fill","stroke"))}else N=p.insert("rect",":first-child"),_=p.insert("rect",":first-child"),N.attr("class","swimlane-title").attr("style",h).attr("x",B).attr("y",C).attr("width",T).attr("height",I).attr("fill",a).attr("stroke",l),_.attr("class","swimlane-body").attr("style",h).attr("x",B).attr("y",D).attr("width",T).attr("height",L).attr("fill","none").attr("stroke",l);let O=t.x-x.width/2,$=C+(I-x.height)/2;y.attr("transform",`translate(${O}, ${$})`)}if(se.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=w,t.offsetY=x.height-b/2,t.intersect=function(A){return ru(t,A)},{cluster:p,labelBBox:x}},"swimlane")});var Eue,CZe,SZe,wZe,kZe,EZe,AZe,Aue,sf,Rue,B2=F(()=>{"use strict";Jt();br();St();O2();Wr();Kt();qo();p4();E4();ic();Xt();kue();Eue=s(async(e,t)=>{se.info("Creating subgraph rect for ",t.id,t);let r=Pe(),{themeVariables:n,handDrawnSeed:i}=r,{clusterBkg:a,clusterBorder:o}=n,{labelStyles:l,nodeStyles:u,borderStyles:h,backgroundStyles:d}=st(t),f=e.insert("g").attr("class","cluster "+t.cssClasses).attr("id",t.domId).attr("data-look",t.look),p=ai(r),m=f.insert("g").attr("class","cluster-label "),g;t.labelType==="markdown"?g=await li(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(ai(r)){let k=g.children[0],R=ut(g);y=k.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;se.trace("Data ",t,JSON.stringify(t));let w;if(t.look==="handDrawn"){let k=ot.svg(f),R=ft(t,{roughness:.7,fill:a,stroke:o,fillWeight:3,seed:i}),M=k.path(Mi(b,T,v,x,0),R);w=f.insert(()=>(se.debug("Rough node insert CXC",M),M),":first-child"),w.select("path:nth-child(2)").attr("style",h.join(";")),w.select("path").attr("style",d.join(";").replace("fill","stroke"))}else w=f.insert("rect",":first-child"),w.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}=kh(r);if(m.attr("transform",`translate(${t.x-y.width/2}, ${t.y-t.height/2+C})`),l){let k=m.select("span");k&&k.attr("style",l)}let S=w.node().getBBox();return t.offsetX=0,t.width=S.width,t.height=S.height,t.offsetY=y.height-t.padding/2,t.intersect=function(k){return ru(t,k)},{cluster:f,labelBBox:y}},"rect"),CZe=s((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 o=n.node().getBBox();return t.width=o.width,t.height=o.height,t.intersect=function(l){return ru(t,l)},{cluster:r,labelBBox:{width:0,height:0}}},"noteGroup"),SZe=s(async(e,t)=>{let r=Pe(),{themeVariables:n,handDrawnSeed:i}=r,{altBackground:a,compositeBackground:o,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(ai(r)){let M=m.children[0],P=ut(m);g=M.getBoundingClientRect(),P.attr("width",g.width),P.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,w=t.x-x/2,C=t.y-b/2;t.width=x;let S=t.y-t.height/2-v+g.height+2,k;if(t.look==="handDrawn"){let M=t.cssClasses.includes("statediagram-cluster-alt"),P=ot.svg(h),N=t.rx||t.ry?P.path(Mi(w,C,x,b,10),{roughness:.7,fill:l,fillStyle:"solid",stroke:u,seed:i}):P.rectangle(w,C,x,b,{seed:i});k=h.insert(()=>N,":first-child");let _=P.rectangle(w,S,x,T,{fill:M?a:o,fillStyle:M?"hachure":"solid",stroke:u,seed:i});k=h.insert(()=>N,":first-child"),p=h.insert(()=>_)}else k=d.insert("rect",":first-child"),k.attr("class","outer").attr("x",w).attr("y",C).attr("width",x).attr("height",b).attr("data-look",t.look),p.attr("class","inner").attr("x",w).attr("y",S).attr("width",x).attr("height",T);f.attr("transform",`translate(${t.x-g.width/2}, ${C+1-(ai(r)?0:3)})`);let R=k.node().getBBox();return t.height=R.height,t.offsetX=0,t.offsetY=g.height-t.padding/2,t.labelBBox=g,t.intersect=function(M){return ru(t,M)},{cluster:h,labelBBox:g}},"roundedWithTitle"),wZe=s(async(e,t)=>{se.info("Creating subgraph rect for ",t.id,t);let r=Pe(),{themeVariables:n,handDrawnSeed:i}=r,{clusterBkg:a,clusterBorder:o}=n,{labelStyles:l,nodeStyles:u,borderStyles:h,backgroundStyles:d}=st(t),f=e.insert("g").attr("class","cluster "+t.cssClasses).attr("id",t.domId).attr("data-look",t.look),p=ai(r),m=f.insert("g").attr("class","cluster-label "),g=await li(m,t.label,{style:t.labelStyle,useHtmlLabels:p,isNode:!0,width:t.width}),y=g.getBBox();if(ai(r)){let k=g.children[0],R=ut(g);y=k.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;se.trace("Data ",t,JSON.stringify(t));let w;if(t.look==="handDrawn"){let k=ot.svg(f),R=ft(t,{roughness:.7,fill:a,stroke:o,fillWeight:4,seed:i}),M=k.path(Mi(b,T,v,x,t.rx),R);w=f.insert(()=>(se.debug("Rough node insert CXC",M),M),":first-child"),w.select("path:nth-child(2)").attr("style",h.join(";")),w.select("path").attr("style",d.join(";").replace("fill","stroke"))}else w=f.insert("rect",":first-child"),w.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}=kh(r);if(m.attr("transform",`translate(${t.x-y.width/2}, ${t.y-t.height/2+C})`),l){let k=m.select("span");k&&k.attr("style",l)}let S=w.node().getBBox();return t.offsetX=0,t.width=S.width,t.height=S.height,t.offsetY=y.height-t.padding/2,t.intersect=function(k){return ru(t,k)},{cluster:f,labelBBox:y}},"kanbanSection"),kZe=s((e,t)=>{let r=Pe(),{themeVariables:n,handDrawnSeed:i}=r,{nodeBorder:a}=n,o=e.insert("g").attr("class",t.cssClasses).attr("id",t.domId).attr("data-look",t.look),l=o.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=ot.svg(o).rectangle(f,p,h,d,{fill:"lightgrey",roughness:.5,strokeLineDash:[5],stroke:a,seed:i});m=o.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 ru(t,y)},{cluster:o,labelBBox:{}}},"divider"),EZe=Eue,AZe={rect:Eue,squareRect:EZe,roundedWithTitle:SZe,noteGroup:CZe,divider:kZe,kanbanSection:wZe,swimlane:wue},Aue=new Map,sf=s(async(e,t)=>{let r=t.shape||"rect",n=await AZe[r](e,t);return Aue.set(t.id,n),n},"insertCluster"),Rue=s(()=>{Aue=new Map},"clear")});var By,_ue=F(()=>{"use strict";By=s((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 N4(e,t){if(e===void 0||t===void 0)return{angle:0,deltaX:0,deltaY:0};e=gi(e),t=gi(t);let[r,n]=[e.x,e.y],[i,a]=[t.x,t.y],o=i-r,l=a-n;return{angle:Math.atan(l/o),deltaX:o,deltaY:l}}var ra,vO,gi,Lue,xO=F(()=>{"use strict";ra={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},vO={arrow_point:4,arrow_cross:12.5,arrow_circle:12.5};s(N4,"calculateDeltaAndAngle");gi=s(e=>Array.isArray(e)?{x:e[0],y:e[1]}:e,"pointTransformer"),Lue=s(e=>({x:s(function(t,r,n){let i=0,a=gi(n[0]).x=0?1:-1)}else if(r===n.length-1&&Object.hasOwn(ra,e.arrowTypeEnd)){let{angle:m,deltaX:g}=N4(n[n.length-1],n[n.length-2]);i=ra[e.arrowTypeEnd]*Math.cos(m)*(g>=0?1:-1)}let o=Math.abs(gi(t).x-gi(n[n.length-1]).x),l=Math.abs(gi(t).y-gi(n[n.length-1]).y),u=Math.abs(gi(t).x-gi(n[0]).x),h=Math.abs(gi(t).y-gi(n[0]).y),d=ra[e.arrowTypeStart],f=ra[e.arrowTypeEnd],p=1;if(o0&&l0&&h=0?1:-1)}else if(r===n.length-1&&Object.hasOwn(ra,e.arrowTypeEnd)){let{angle:m,deltaY:g}=N4(n[n.length-1],n[n.length-2]);i=ra[e.arrowTypeEnd]*Math.abs(Math.sin(m))*(g>=0?1:-1)}let o=Math.abs(gi(t).y-gi(n[n.length-1]).y),l=Math.abs(gi(t).x-gi(n[n.length-1]).x),u=Math.abs(gi(t).y-gi(n[0]).y),h=Math.abs(gi(t).x-gi(n[0]).x),d=ra[e.arrowTypeStart],f=ra[e.arrowTypeEnd],p=1;if(o0&&l0&&h{"use strict";St();Iue=s((e,t,r,n,i,a=!1,o)=>{t.arrowTypeStart&&Due(e,"start",t.arrowTypeStart,r,n,i,a,o),t.arrowTypeEnd&&Due(e,"end",t.arrowTypeEnd,r,n,i,a,o)},"addEdgeMarkers"),RZe={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}},_Ze=["cross","point","circle","lollipop","aggregation","extension","composition","dependency","barb"],Due=s((e,t,r,n,i,a,o=!1,l)=>{if(!r||r==="none")return;let u=RZe[r],h=u&&_Ze.includes(u.type);if(!u){se.warn(`Unknown arrow type: ${r}`);return}let d=u.type,m=`${i}_${a}-${d}${t==="start"?"Start":"End"}${o&&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 P4(e,t){ai(Pe())&&e&&(e.style.width=t.length*9+"px",e.style.height="12px")}function NZe(e){let t=[],r=[];for(let n=1;n5&&Math.abs(a.y-i.y)>5||i.y===a.y&&a.x===o.x&&Math.abs(a.x-i.x)>5&&Math.abs(a.y-o.y)>5)&&(t.push(a),r.push(n))}return{cornerPoints:t,cornerPointPositions:r}}function BZe(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&&ra[t.arrowTypeStart]){let i=ra[t.arrowTypeStart],a=e[0],o=e[1],{angle:l}=Oue(a,o),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&&ra[t.arrowTypeEnd]){let i=ra[t.arrowTypeEnd],a=e[n-1],o=e[n-2],{angle:l}=Oue(o,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 LZe,_m,Pi,Bue,O4,$2,oc,$y,DZe,IZe,MZe,Nue,Pue,PZe,OZe,of,Fy=F(()=>{"use strict";Jt();br();St();qo();u4();_ue();er();xO();O2();Wr();Kt();E4();Mue();Xt();LZe=s(e=>typeof e=="string"?e:Pe()?.flowchart?.curve,"resolveEdgeCurveType"),_m=new Map,Pi=new Map,Bue=s(()=>{_m.clear(),Pi.clear()},"clear"),O4=s(e=>!!(e.label||e.startLabelLeft||e.startLabelRight||e.endLabelLeft||e.endLabelRight),"hasEdgeLabel"),$2=s(e=>e?typeof e=="string"?e:e.reduce((t,r)=>t+";"+r,""):"","getLabelStyles"),oc=s(async(e,t)=>{let r=Pe(),n=ai(r),{labelStyles:i}=st(t);t.labelStyle=i;let a=e.insert("g").attr("class","edgeLabel"),o=a.insert("g").attr("class","label").attr("data-id",t.id),l=t.labelType==="markdown",h=await li(e,t.label,{style:$2(t.labelStyle),useHtmlLabels:n,addSvgBackground:!0,isNode:!1,markdown:l,width:l?void 0:void 0},r);o.node().appendChild(h),se.info("abc82",t,t.labelType);let d,f;if(n){let m=h.children[0],g=ut(h);d=await tu.measure(()=>m.getBoundingClientRect()),f=d,g.attr("width",d.width),g.attr("height",d.height)}else{let m=ut(h).select("text").node();await tu.measure(()=>{d=h.getBBox(),m&&typeof m.getBBox=="function"?f=m.getBBox():f=d})}o.attr("transform",By(f,n)),_m.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,$2(t.labelStyle)||"",!1,!1);p=y;let v=y.getBBox();if(n){let x=y.children[0],b=ut(y);v=x.getBoundingClientRect(),b.attr("width",v.width),b.attr("height",v.height)}g.attr("transform",By(v,n)),Pi.get(t.id)||Pi.set(t.id,{}),Pi.get(t.id).startLeft=m,P4(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,$2(t.labelStyle)||"",!1,!1);p=y;let v=y.getBBox();if(n){let x=y.children[0],b=ut(y);v=x.getBoundingClientRect(),b.attr("width",v.width),b.attr("height",v.height)}g.attr("transform",By(v,n)),Pi.get(t.id)||Pi.set(t.id,{}),Pi.get(t.id).startRight=m,P4(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,$2(t.labelStyle)||"",!1,!1);p=y;let v=y.getBBox();if(n){let x=y.children[0],b=ut(y);v=x.getBoundingClientRect(),b.attr("width",v.width),b.attr("height",v.height)}g.attr("transform",By(v,n)),Pi.get(t.id)||Pi.set(t.id,{}),Pi.get(t.id).endLeft=m,P4(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,$2(t.labelStyle)||"",!1,!1);p=y;let v=y.getBBox();if(n){let x=y.children[0],b=ut(y);v=x.getBoundingClientRect(),b.attr("width",v.width),b.attr("height",v.height)}g.attr("transform",By(v,n)),Pi.get(t.id)||Pi.set(t.id,{}),Pi.get(t.id).endRight=m,P4(p,t.endLabelRight)}return h},"insertEdgeLabel");s(P4,"setTerminalWidth");$y=s((e,t)=>{se.debug("Moving label abc88 ",e.id,e.label,_m.get(e.id),t);let r=t.updatedPath?t.updatedPath:t.originalPath,n=Pe(),{subGraphTitleTotalMargin:i}=kh(n);if(e.label){let a=_m.get(e.id),o=e.x,l=e.y;if(r){let u=or.calcLabelPosition(r);se.debug("Moving label "+e.label+" from (",o,",",l,") to (",u.x,",",u.y,") abc88"),t.updatedPath&&(o=u.x,l=u.y)}a.attr("transform",`translate(${o}, ${l+i/2})`)}if(e.startLabelLeft){let a=Pi.get(e.id).startLeft,o=e.x,l=e.y;if(r){let u=or.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_left",r);o=u.x,l=u.y}a.attr("transform",`translate(${o}, ${l})`)}if(e.startLabelRight){let a=Pi.get(e.id).startRight,o=e.x,l=e.y;if(r){let u=or.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_right",r);o=u.x,l=u.y}a.attr("transform",`translate(${o}, ${l})`)}if(e.endLabelLeft){let a=Pi.get(e.id).endLeft,o=e.x,l=e.y;if(r){let u=or.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_left",r);o=u.x,l=u.y}a.attr("transform",`translate(${o}, ${l})`)}if(e.endLabelRight){let a=Pi.get(e.id).endRight,o=e.x,l=e.y;if(r){let u=or.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_right",r);o=u.x,l=u.y}a.attr("transform",`translate(${o}, ${l})`)}},"positionEdgeLabel"),DZe=s((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"),IZe=s((e,t)=>{let r=e.x,n=e.y,i=Math.abs(t.x-r),a=Math.abs(t.y-n),o=e.width/2,l=e.height/2;return i>=o||a>=l},"outsideNode"),MZe=s((e,t,r)=>{se.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),o=e.width/2,l=r.xMath.abs(n-t.x)*u){let f=r.y{se.warn("abc88 cutPathAtIntersect",e,t);let r=[],n=e[0],i=!1;return e.forEach(a=>{if(se.info("abc88 checking point",a,t),!IZe(t,a)&&!i){let o=MZe(t,n,a);se.debug("abc88 inside",a,n,o),se.debug("abc88 intersection",o,t);let l=!1;r.forEach(u=>{l=l||u.x===o.x&&u.y===o.y}),r.some(u=>u.x===o.x&&u.y===o.y)?se.warn("abc88 no intersect",o,r):r.push(o),i=!0}else se.warn("abc88 outside",a,n),n=a,i||r.push(a)}),se.debug("returning points",r),r},"cutPathAtIntersect");s(NZe,"extractCornerPoints");Pue=s(function(e,t,r){let n=t.x-e.x,i=t.y-e.y,a=Math.sqrt(n*n+i*i),o=r/a;return{x:t.x-o*n,y:t.y-o*i}},"findAdjacentPoint"),PZe=s(function(e){let{cornerPointPositions:t}=NZe(e),r=[];for(let n=0;n10&&Math.abs(a.y-i.y)>=10){se.debug("Corner point fixing",Math.abs(a.x-i.x),Math.abs(a.y-i.y));let m=5;o.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 se.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"),OZe=s((e,t,r)=>{let n=e-t-r,i=2,a=2,o=i+a,l=Math.floor(n/o),u=Number.isFinite(l)?Math.max(0,l):0,h=Array(u).fill(`${i} ${a}`).join(" ");return`0 ${t} ${h} ${r}`},"generateDashArray"),of=s(function(e,t,r,n,i,a,o,l=!1){if(!o)throw new Error(`insertEdge: missing diagramId for edge "${t.id}" \u2014 edge IDs require a diagram prefix for uniqueness`);let{handDrawnSeed:u,layout:h}=Pe(),d=t.points,f=!1,p=i;var m=a;let g=[];for(let O in t.cssCompiledStyles)S2(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],W=O[O.length-1],V=.5,z=Math.abs(d[d.length-1].x-W.x)!Number.isNaN(O.y)),x=LZe(t.curve);x!=="rounded"&&(v=PZe(v));let b=Zc;switch(x){case"linear":b=Zc;break;case"basis":b=bh;break;case"cardinal":b=Kb;break;case"bumpX":b=Hb;break;case"bumpY":b=Ub;break;case"catmullRom":b=Jb;break;case"monotoneX":b=e2;break;case"monotoneY":b=t2;break;case"natural":b=Ay;break;case"step":b=Ry;break;case"stepAfter":b=n2;break;case"stepBefore":b=r2;break;case"rounded":b=Zc;break;default:b=bh}let{x:T,y:w}=Lue(t),C=xh().x(T).y(w).curve(b),S;switch(t.thickness){case"normal":S="edge-thickness-normal";break;case"thick":S="edge-thickness-thick";break;case"invisible":S="edge-thickness-invisible";break;default:S="edge-thickness-normal"}switch(t.pattern){case"solid":S+=" edge-pattern-solid";break;case"dotted":S+=" edge-pattern-dotted";break;case"dashed":S+=" edge-pattern-dashed";break;default:S+=" edge-pattern-solid"}let k,R=x==="rounded"?BZe($Ze(v,t),5):C(v),M=Array.isArray(t.style)?t.style:[t.style],P=M.find(O=>O?.startsWith("stroke:")),N="";t.animate&&(N="edge-animation-fast"),t.animation&&(N="edge-animation-"+t.animation);let _=!1;if(t.look==="handDrawn"){let O=ot.svg(e);Object.assign([],v);let $=O.path(R,{roughness:.3,seed:u});S+=" transition",k=ut($).select("path").attr("id",`${o}-${t.id}`).attr("class"," "+S+(t.classes?" "+t.classes:"")+(N?" "+N:"")).attr("style",M?M.reduce((V,z)=>V+";"+z,""):"");let W=k.attr("d");k.attr("d",W),e.node().appendChild(k.node())}else{let O=g.join(";"),$=M?M.reduce((J,ne)=>J+ne+";",""):"",W=(O?O+";"+$+";":$)+";"+(M?M.reduce((J,ne)=>J+";"+ne,""):"");k=e.append("path").attr("d",R).attr("id",`${o}-${t.id}`).attr("class"," "+S+(t.classes?" "+t.classes:"")+(N?" "+N:"")).attr("style",W),P=W.match(/stroke:([^;]+)/)?.[1],_=t.animate===!0||!!t.animation||O.includes("animation");let V=k.node(),z=typeof V.getTotalLength=="function"?V.getTotalLength():0,H=vO[t.arrowTypeStart]||0,K=vO[t.arrowTypeEnd]||0;if(t.look==="neo"&&!_){let ne=`stroke-dasharray: ${t.pattern==="dotted"||t.pattern==="dashed"?OZe(z,H,K):`0 ${H} ${z-H-K} ${K}`}; stroke-dashoffset: 0;`;k.attr("style",ne+k.attr("style"))}}k.attr("data-edge",!0),k.attr("data-et","edge"),k.attr("data-id",t.id),k.attr("data-points",y),k.attr("data-look",un(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="";(Pe().flowchart.arrowMarkerAbsolute||Pe().state.arrowMarkerAbsolute)&&(A=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,A=A.replace(/\(/g,"\\(").replace(/\)/g,"\\)")),se.info("arrowTypeStart",t.arrowTypeStart),se.info("arrowTypeEnd",t.arrowTypeEnd);let I=!_&&t?.look==="neo";Iue(k,t,A,o,n,I,P);let D=Math.floor(d.length/2),L=d[D];or.isLabelCoordinateInPath(L,k.attr("d"))||(f=!0);let B={};return f&&(B.updatedPath=d),B.originalPath=t.points,B},"insertEdge");s(BZe,"generateRoundedPath");s(Oue,"calculateDeltaAndAngle");s($Ze,"applyMarkerOffsetsToPoints")});var FZe,GZe,zZe,VZe,WZe,qZe,HZe,UZe,YZe,jZe,XZe,KZe,ZZe,QZe,JZe,eQe,tQe,rQe,nQe,iQe,aQe,sQe,oQe,lQe,Gy,B4=F(()=>{"use strict";St();br();FZe=s((e,t,r,n)=>{t.forEach(i=>{lQe[i](e,r,n)})},"insertMarkers"),GZe=s((e,t,r)=>{se.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"),zZe=s((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"),VZe=s((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"),WZe=s((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"),qZe=s((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"),HZe=s((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"),UZe=s((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"),YZe=s((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"),jZe=s((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"),XZe=s((e,t,r)=>{let n=Lt(),{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"),KZe=s((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"),ZZe=s((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"),QZe=s((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"),JZe=s((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"),eQe=s((e,t,r)=>{let n=Lt(),{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"),tQe=s((e,t,r)=>{let n=Lt(),{themeVariables:i}=n,{strokeWidth:a,mainBkg:o}=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",o??"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",o??"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"),rQe=s((e,t,r)=>{let n=Lt(),{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"),nQe=s((e,t,r)=>{let n=Lt(),{themeVariables:i}=n,{strokeWidth:a,mainBkg:o}=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",o??"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",o??"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"),iQe=s((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"),aQe=s((e,t,r)=>{let n=Lt(),{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"),sQe=s((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"),oQe=s((e,t,r)=>{let n=Lt(),{themeVariables:i}=n,{strokeWidth:a}=i,o=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");o.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),o.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),o.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10),o.selectAll("*").attr("stroke-width",`${a}`)},"requirement_contains_neo"),lQe={extension:GZe,composition:zZe,aggregation:VZe,dependency:WZe,lollipop:qZe,point:HZe,circle:UZe,cross:YZe,barb:jZe,barbNeo:XZe,only_one:KZe,zero_or_one:ZZe,one_or_more:QZe,zero_or_more:JZe,only_one_neo:eQe,zero_or_one_neo:tQe,one_or_more_neo:rQe,zero_or_more_neo:nQe,requirement_arrow:iQe,requirement_contains:sQe,requirement_arrow_neo:aQe,requirement_contains_neo:oQe},Gy=FZe});async function Eh(e,t,r){let n,i;t.shape==="rect"&&(t.rx&&t.ry?t.shape="roundedRect":t.shape="squareRect");let a=t.shape?L2[t.shape]:void 0;if(!a)throw new Error(`No such shape: ${t.shape}. Please check your syntax.`);if(t.link){let o;r.config.securityLevel==="sandbox"?o="_top":t.linkTarget&&(o=t.linkTarget||"_blank"),n=e.insert("svg:a").attr("xlink:href",t.link).attr("target",o??null),i=await a(n,t,r)}else i=await a(e,t,r),n=i;return n.attr("data-look",un(t.look)),t.tooltip&&i.attr("title",t.tooltip),$4.set(t.id,n),t.haveCallback&&n.attr("class",n.attr("class")+" clickable"),n}var $4,$ue,Fue,au,Lm=F(()=>{"use strict";St();R4();er();$4=new Map;s(Eh,"insertNode");$ue=s((e,t)=>{$4.set(t.id,e)},"setNodeElem"),Fue=s(()=>{$4.clear()},"clear"),au=s(e=>{let t=$4.get(e.id);se.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 Gue,zue=F(()=>{"use strict";br();Yr();St();B2();Fy();B4();Lm();Ht();er();Gue={common:Tt,getConfig:Lt,insertCluster:sf,insertEdge:of,insertEdgeLabel:oc,insertMarkers:Gy,insertNode:Eh,interpolateToCurve:qN,labelHelper:yt,log:se,positionEdgeLabel:$y}});var cQe,F4,bO=F(()=>{"use strict";cQe=typeof global=="object"&&global&&global.Object===Object&&global,F4=cQe});var uQe,hQe,Oi,bl=F(()=>{"use strict";bO();uQe=typeof self=="object"&&self&&self.Object===Object&&self,hQe=F4||uQe||Function("return this")(),Oi=hQe});var dQe,Pa,Dm=F(()=>{"use strict";bl();dQe=Oi.Symbol,Pa=dQe});function mQe(e){var t=fQe.call(e,F2),r=e[F2];try{e[F2]=void 0;var n=!0}catch{}var i=pQe.call(e);return n&&(t?e[F2]=r:delete e[F2]),i}var Vue,fQe,pQe,F2,Wue,que=F(()=>{"use strict";Dm();Vue=Object.prototype,fQe=Vue.hasOwnProperty,pQe=Vue.toString,F2=Pa?Pa.toStringTag:void 0;s(mQe,"getRawTag");Wue=mQe});function vQe(e){return yQe.call(e)}var gQe,yQe,Hue,Uue=F(()=>{"use strict";gQe=Object.prototype,yQe=gQe.toString;s(vQe,"objectToString");Hue=vQe});function TQe(e){return e==null?e===void 0?bQe:xQe:Yue&&Yue in Object(e)?Wue(e):Hue(e)}var xQe,bQe,Yue,Gs,lf=F(()=>{"use strict";Dm();que();Uue();xQe="[object Null]",bQe="[object Undefined]",Yue=Pa?Pa.toStringTag:void 0;s(TQe,"baseGetTag");Gs=TQe});function CQe(e){return e!=null&&typeof e=="object"}var qi,lc=F(()=>{"use strict";s(CQe,"isObjectLike");qi=CQe});function wQe(e){return typeof e=="symbol"||qi(e)&&Gs(e)==SQe}var SQe,Yo,Im=F(()=>{"use strict";lf();lc();SQe="[object Symbol]";s(wQe,"isSymbol");Yo=wQe});function kQe(e,t){for(var r=-1,n=e==null?0:e.length,i=Array(n);++r{"use strict";s(kQe,"arrayMap");su=kQe});var EQe,Zr,na=F(()=>{"use strict";EQe=Array.isArray,Zr=EQe});function Kue(e){if(typeof e=="string")return e;if(Zr(e))return su(e,Kue)+"";if(Yo(e))return Xue?Xue.call(e):"";var t=e+"";return t=="0"&&1/e==-AQe?"-0":t}var AQe,jue,Xue,Zue,Que=F(()=>{"use strict";Dm();G2();na();Im();AQe=1/0,jue=Pa?Pa.prototype:void 0,Xue=jue?jue.toString:void 0;s(Kue,"baseToString");Zue=Kue});function _Qe(e){for(var t=e.length;t--&&RQe.test(e.charAt(t)););return t}var RQe,Jue,ehe=F(()=>{"use strict";RQe=/\s/;s(_Qe,"trimmedEndIndex");Jue=_Qe});function DQe(e){return e&&e.slice(0,Jue(e)+1).replace(LQe,"")}var LQe,the,rhe=F(()=>{"use strict";ehe();LQe=/^\s+/;s(DQe,"baseTrim");the=DQe});function IQe(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var yi,Tl=F(()=>{"use strict";s(IQe,"isObject");yi=IQe});function BQe(e){if(typeof e=="number")return e;if(Yo(e))return nhe;if(yi(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=yi(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=the(e);var r=NQe.test(e);return r||PQe.test(e)?OQe(e.slice(2),r?2:8):MQe.test(e)?nhe:+e}var nhe,MQe,NQe,PQe,OQe,ihe,ahe=F(()=>{"use strict";rhe();Tl();Im();nhe=NaN,MQe=/^[-+]0x[0-9a-f]+$/i,NQe=/^0b[01]+$/i,PQe=/^0o[0-7]+$/i,OQe=parseInt;s(BQe,"toNumber");ihe=BQe});function FQe(e){if(!e)return e===0?e:0;if(e=ihe(e),e===she||e===-she){var t=e<0?-1:1;return t*$Qe}return e===e?e:0}var she,$Qe,zy,TO=F(()=>{"use strict";ahe();she=1/0,$Qe=17976931348623157e292;s(FQe,"toFinite");zy=FQe});function GQe(e){var t=zy(e),r=t%1;return t===t?r?t-r:t:0}var ohe,lhe=F(()=>{"use strict";TO();s(GQe,"toInteger");ohe=GQe});function zQe(e){return e}var uo,cf=F(()=>{"use strict";s(zQe,"identity");uo=zQe});function UQe(e){if(!yi(e))return!1;var t=Gs(e);return t==WQe||t==qQe||t==VQe||t==HQe}var VQe,WQe,qQe,HQe,ou,z2=F(()=>{"use strict";lf();Tl();VQe="[object AsyncFunction]",WQe="[object Function]",qQe="[object GeneratorFunction]",HQe="[object Proxy]";s(UQe,"isFunction");ou=UQe});var YQe,G4,che=F(()=>{"use strict";bl();YQe=Oi["__core-js_shared__"],G4=YQe});function jQe(e){return!!uhe&&uhe in e}var uhe,hhe,dhe=F(()=>{"use strict";che();uhe=(function(){var e=/[^.]+$/.exec(G4&&G4.keys&&G4.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""})();s(jQe,"isMasked");hhe=jQe});function ZQe(e){if(e!=null){try{return KQe.call(e)}catch{}try{return e+""}catch{}}return""}var XQe,KQe,Ah,CO=F(()=>{"use strict";XQe=Function.prototype,KQe=XQe.toString;s(ZQe,"toSource");Ah=ZQe});function aJe(e){if(!yi(e)||hhe(e))return!1;var t=ou(e)?iJe:JQe;return t.test(Ah(e))}var QQe,JQe,eJe,tJe,rJe,nJe,iJe,fhe,phe=F(()=>{"use strict";z2();dhe();Tl();CO();QQe=/[\\^$.*+?()[\]{}|]/g,JQe=/^\[object .+?Constructor\]$/,eJe=Function.prototype,tJe=Object.prototype,rJe=eJe.toString,nJe=tJe.hasOwnProperty,iJe=RegExp("^"+rJe.call(nJe).replace(QQe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");s(aJe,"baseIsNative");fhe=aJe});function sJe(e,t){return e?.[t]}var mhe,ghe=F(()=>{"use strict";s(sJe,"getValue");mhe=sJe});function oJe(e,t){var r=mhe(e,t);return fhe(r)?r:void 0}var ho,uf=F(()=>{"use strict";phe();ghe();s(oJe,"getNative");ho=oJe});var lJe,z4,yhe=F(()=>{"use strict";uf();bl();lJe=ho(Oi,"WeakMap"),z4=lJe});var vhe,cJe,xhe,bhe=F(()=>{"use strict";Tl();vhe=Object.create,cJe=(function(){function e(){}return s(e,"object"),function(t){if(!yi(t))return{};if(vhe)return vhe(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}})(),xhe=cJe});function uJe(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 The,Che=F(()=>{"use strict";s(uJe,"apply");The=uJe});function hJe(){}var She,whe=F(()=>{"use strict";s(hJe,"noop");She=hJe});function dJe(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r{"use strict";s(dJe,"copyArray");V4=dJe});function gJe(e){var t=0,r=0;return function(){var n=mJe(),i=pJe-(n-r);if(r=n,i>0){if(++t>=fJe)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var fJe,pJe,mJe,khe,Ehe=F(()=>{"use strict";fJe=800,pJe=16,mJe=Date.now;s(gJe,"shortOut");khe=gJe});function yJe(e){return function(){return e}}var fo,wO=F(()=>{"use strict";s(yJe,"constant");fo=yJe});var vJe,Vy,kO=F(()=>{"use strict";uf();vJe=(function(){try{var e=ho(Object,"defineProperty");return e({},"",{}),e}catch{}})(),Vy=vJe});var xJe,Ahe,Rhe=F(()=>{"use strict";wO();kO();cf();xJe=Vy?function(e,t){return Vy(e,"toString",{configurable:!0,enumerable:!1,value:fo(t),writable:!0})}:uo,Ahe=xJe});var bJe,W4,EO=F(()=>{"use strict";Rhe();Ehe();bJe=khe(Ahe),W4=bJe});function TJe(e,t){for(var r=-1,n=e==null?0:e.length;++r{"use strict";s(TJe,"arrayEach");q4=TJe});function CJe(e,t,r,n){for(var i=e.length,a=r+(n?1:-1);n?a--:++a{"use strict";s(CJe,"baseFindIndex");H4=CJe});function SJe(e){return e!==e}var _he,Lhe=F(()=>{"use strict";s(SJe,"baseIsNaN");_he=SJe});function wJe(e,t,r){for(var n=r-1,i=e.length;++n{"use strict";s(wJe,"strictIndexOf");Dhe=wJe});function kJe(e,t,r){return t===t?Dhe(e,t,r):H4(e,_he,r)}var Mhe,Nhe=F(()=>{"use strict";RO();Lhe();Ihe();s(kJe,"baseIndexOf");Mhe=kJe});function EJe(e,t){var r=e==null?0:e.length;return!!r&&Mhe(e,t,0)>-1}var Phe,Ohe=F(()=>{"use strict";Nhe();s(EJe,"arrayIncludes");Phe=EJe});function _Je(e,t){var r=typeof e;return t=t??AJe,!!t&&(r=="number"||r!="symbol"&&RJe.test(e))&&e>-1&&e%1==0&&e{"use strict";AJe=9007199254740991,RJe=/^(?:0|[1-9]\d*)$/;s(_Je,"isIndex");hf=_Je});function LJe(e,t,r){t=="__proto__"&&Vy?Vy(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var df,W2=F(()=>{"use strict";kO();s(LJe,"baseAssignValue");df=LJe});function DJe(e,t){return e===t||e!==e&&t!==t}var Cl,Mm=F(()=>{"use strict";s(DJe,"eq");Cl=DJe});function NJe(e,t,r){var n=e[t];(!(MJe.call(e,t)&&Cl(n,r))||r===void 0&&!(t in e))&&df(e,t,r)}var IJe,MJe,ff,q2=F(()=>{"use strict";W2();Mm();IJe=Object.prototype,MJe=IJe.hasOwnProperty;s(NJe,"assignValue");ff=NJe});function PJe(e,t,r,n){var i=!r;r||(r={});for(var a=-1,o=t.length;++a{"use strict";q2();W2();s(PJe,"copyObject");lu=PJe});function OJe(e,t,r){return t=Bhe(t===void 0?e.length-1:t,0),function(){for(var n=arguments,i=-1,a=Bhe(n.length-t,0),o=Array(a);++i