Files
static-php-cli/assets/chunks/mermaid.core.FcP8wBwW.js

310 lines
588 KiB
JavaScript
Raw Normal View History

const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/chunks/dagre-KV5264BT.Dzyh3PBi.js","assets/chunks/graph.DaVWZV7z.js","assets/chunks/baseUniq.CeiE9d8M.js","assets/chunks/layout.DhiXUKzi.js","assets/chunks/min.CT2il0xb.js","assets/chunks/clone.lkrBMtqg.js","assets/chunks/framework.C2AwuPrQ.js","assets/chunks/cose-bilkent-S5V4N54A.BTJXqd_j.js","assets/chunks/cytoscape.esm.BM_eiZzj.js","assets/chunks/c4Diagram-AHTNJAMY.D9XLip-k.js","assets/chunks/chunk-YZCP3GAM.KLB9Sa1c.js","assets/chunks/flowDiagram-DWJPFMVM.BOiZuCBe.js","assets/chunks/chunk-FMBD7UC4.BR2APasi.js","assets/chunks/chunk-55IACEB6.Ch1hJtyD.js","assets/chunks/chunk-EDXVE4YY.nt7vYGzC.js","assets/chunks/channel.CX85guNc.js","assets/chunks/erDiagram-SMLLAGMA.BObTJjrO.js","assets/chunks/gitGraphDiagram-UUTBAWPF.T55o_OZe.js","assets/chunks/chunk-4BX2VUAB.DRMGnluz.js","assets/chunks/chunk-QZHKN3VN.DynBHGSI.js","assets/chunks/wardley-RL74JXVD.BA-8CGC6.js","assets/chunks/ganttDiagram-T4ZO3ILL.ZyVGbZyU.js","assets/chunks/linear.BLeVQ8gA.js","assets/chunks/init.Gi6I4Gst.js","assets/chunks/defaultLocale.DX6XiGOO.js","assets/chunks/infoDiagram-42DDH7IO.ClyVFDpn.js","assets/chunks/pieDiagram-DEJITSTG.D3Yf2d7p.js","assets/chunks/arc.CBHvmMDx.js","assets/chunks/ordinal.BYWQX77i.js","assets/chunks/quadrantDiagram-34T5L4WZ.Dk93g3U7.js","assets/chunks/xychartDiagram-5P7HB3ND.BRakMHHi.js","assets/chunks/requirementDiagram-MS252O5E.DG0FTVHA.js","assets/chunks/sequenceDiagram-FGHM5R23.BNFcR9qe.js","assets/chunks/classDiagram-6PBFFD2Q.BzO8UvP8.js","assets/chunks/chunk-4TB4RGXK.Cn3s89lD.js","assets/chunks/classDiagram-v2-HSJHXN6E.BzO8UvP8.js","assets/chunks/stateDiagram-FHFEXIEX.KxjqYfNL.js","assets/chunks/chunk-OYMX7WX6.CIIFgoWj.js","assets/chunks/stateDiagram-v2-QKLJ7IA2.CS4DWscx.js","assets/chunks/journeyDiagram-VCZTEJTY.BmkfNblc.js","assets/chunks/timeline-definition-GMOUNBTQ.BsGTkzdk.js","assets/chunks/mindmap-definition-QFDTVHPH.Db1CW-aX.js","assets/chunks/kanban-definition-6JOO6SKY.DMOK7bzJ.js","assets/chunks/sankeyDiagram-XADWPNL6.B49IC-gh.js","assets/chunks/diagram-TYMM5635.BjNPV6NQ.js","assets/chunks/diagram-MMDJMWI5.CoyJYWwi.js","assets/chunks/blockDiagram-DXYQGD6D.ByBX24mM.js","assets/chunks/diagram-5BDNPKRD.Cxuyd23g.js","assets/chunks/architectureDiagram-Q4EWVU46.DdWOD9Cd.js","assets/chunks/ishikawaDiagram-UXIWVN3A.C5DoIbOa.js","assets/chunks/vennDiagram-DHZGUBPP.ClhBN1CI.js","assets/chunks/diagram-G4DWMVQ6.DNFPplE9.js","assets/chunks/wardleyDiagram-NUSXRM2D.CtyamWnD.js"])))=>i.map(i=>d[i]);
import{W as gt}from"./framework.C2AwuPrQ.js";function Py(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function CA(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var r=function i(){var a=!1;try{a=this instanceof i}catch{}return a?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(i){var a=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(r,i,a.get?a:{enumerable:!0,get:function(){return e[i]}})}),r}var za={exports:{}},Ry=za.exports,nh;function Ny(){return nh||(nh=1,(function(e,t){(function(r,i){e.exports=i()})(Ry,(function(){var r=1e3,i=6e4,a=36e5,s="millisecond",o="second",n="minute",l="hour",c="day",h="week",u="month",p="quarter",d="year",g="date",m="Invalid Date",y=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,x=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,b={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(I){var F=["th","st","nd","rd"],L=I%100;return"["+I+(F[(L-20)%10]||F[L]||F[0])+"]"}},k=function(I,F,L){var M=String(I);return!M||M.length>=F?I:""+Array(F+1-M.length).join(L)+I},_={s:k,z:function(I){var F=-I.utcOffset(),L=Math.abs(F),M=Math.floor(L/60),P=L%60;return(F<=0?"+":"-")+k(M,2,"0")+":"+k(P,2,"0")},m:function I(F,L){if(F.date()<L.date())return-I(L,F);var M=12*(L.year()-F.year())+(L.month()-F.month()),P=F.clone().add(M,u),H=L-P<0,Y=F.clone().add(M+(H?-1:1),u);return+(-(M+(L-P)/(H?P-Y:Y-P))||0)},a:function(I){return I<0?Math.ceil(I)||0:Math.floor(I)},p:function(I){return{M:u,y:d,w:h,d:c,D:g,h:l,m:n,s:o,ms:s,Q:p}[I]||String(I||"").toLowerCase().replace(/s$/,"")},u:function(I){return I===void 0}},w="en",v={};v[w]=b;var E="$isDayjsObject",B=function(I){return I instanceof W||!(!I||!I[E])},N=function I(F,L,M){var P;if(!F)return w;if(typeof F=="string"){var H=F.toLowerCase();v[H]&&(P=H),L&&(v[H]=L,P=H);var Y=F.split("-");if(!P&&Y.length>1)return I(Y[0])}else{var Q=F.name;v[Q]=F,P=Q}return!M&&P&&(w=P),P||!M&&w},D=function(I,F){if(B(I))return I.clone();var L=typeof F=="object"?F:{};return L.date=I,L.args=arguments,new W(L)},O=_;O.l=N,O.i=B,O.w=function(I,F){return D(I,{locale:F.$L,utc:F.$u,x:F.$x,$offset:F.$offset})};var W=(function(){function I(L){this.$L=N(L.locale,null,!0),this.parse(L),this.$x=this.$x||L.x||{},this[E]=!0}var F=I.prototype;return F.parse=function(L){this.$d=(function(M){var P=M.date,H=M.utc;if(P===null)return new Date(NaN);if(O.u(P))return new Date;if(P instanceof Date)return new Date(P);if(typeof P=="string"&&!/Z$/i.test(P)){var Y=P.match(y);if(Y){var Q=Y[2]-1||0,dt=(Y[7]||"0").substring(0,3);return H?new Date(Date.UTC(Y[1],Q,Y[3]||1,Y[4]||0,Y[5]||0,Y[6]||0,dt)):new Date(Y[1],Q,Y[3]||1,Y[4]||0,Y[5]||0,Y[6]||0,dt)}}return new Date(P)})(L),this.init()},F.init=function(){var L=this.$d;this.$y=L.getFullYear(),this.$M=L.getMonth(),this.$D=L.getDate(),this.$W=L.getDay(),this.$H=L.getHours(),this.$m=L.getMinutes(),this.$s=L.getSeconds(),this.$ms=L.getMilliseconds()},F.$utils=function(){return O},F.isValid=function(){return this.$d.toString()!==m},F.isSame=function(L,M){var P=D(L);return this.startOf(M)<=P&&P<=this.endOf(M)},F.isAfter=function(L,M){return D(L)<this.startOf(M)},F.isBefore=function(L,M){return this.endOf(M)<D(L)},F.$g=function(L,M,P){return O.u(L)?this[M]:this.set(P,L)},F.unix=function(){return Math.floor(this.valueOf()/1e3)},F.valueOf=function(){return this.$d.getTime()},F.startOf=function(L,M){var P=this,H=!!O.u(M)||M,Y=O.p(L),Q=function(Tt,xt){var Lt=O.w(P.$u?Date.UTC(P.$y,xt,Tt):new Date(P.$y,xt,Tt),P);return H?Lt:Lt.endOf(c)},dt=function(Tt,xt){return O.w(P.toDate()[Tt].apply(P.toDate("s"),(H?[0,0,0,0]:[23,59,59,999]).slice(xt)),P)},et=this.$W,ut=this.$M,it=this.$D,rt="set"+(this.$u?"UT
`+Kt),ie&&Si([W,z,I],ne=>{Kt=Pr(Kt,ne," ")}),_&&Sa?_.createHTML(Kt):Kt},t.setConfig=function(){let J=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};fo(J),ao=!0},t.clearConfig=function(){Dr=null,ao=!1},t.isValidAttribute=function(J,T,q){Dr||fo({});const G=Mt(J),bt=Mt(T);return eh(G,bt,q)},t.addHook=function(J,T){typeof T=="function"&&vi(O[J],T)},t.removeHook=function(J,T){if(T!==void 0){const q=Jy(O[J],T);return q===-1?void 0:t0(O[J],q,1)[0]}return hh(O[J])},t.removeHooks=function(J){O[J]=[]},t.removeAllHooks=function(){O=xh()},t}var ci=cu(),uu=/^-{3}\s*[\n\r](.*?)[\n\r]-{3}\s*[\n\r]+/s,Gi=/%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,b0=/\s*%%.*\n/gm,Zr,du=(Zr=class extends Error{constructor(t){super(t),this.name="UnknownDiagramError"}},f(Zr,"UnknownDiagramError"),Zr),kr={},Hn=f(function(e,t){e=e.replace(uu,"").replace(Gi,"").replace(b0,`
`);for(const[r,{detector:i}]of Object.entries(kr))if(i(e,t))return r;throw new du(`No diagram type detected matching given configuration for text: ${e}`)},"detectType"),zo=f((...e)=>{for(const{id:t,detector:r,loader:i}of e)pu(t,r,i)},"registerLazyLoadedDiagrams"),pu=f((e,t,r)=>{kr[e]&&R.warn(`Detector with key ${e} already exists. Overwriting.`),kr[e]={detector:t,loader:r},R.debug(`Detector with key ${e} added${r?" with loader":""}`)},"addDetector"),k0=f(e=>kr[e].loader,"getDiagramLoader"),Wo=f((e,t,{depth:r=2,clobber:i=!1}={})=>{const a={depth:r,clobber:i};return Array.isArray(t)&&!Array.isArray(e)?(t.forEach(s=>Wo(e,s,a)),e):Array.isArray(t)&&Array.isArray(e)?(t.forEach(s=>{e.includes(s)||e.push(s)}),e):e===void 0||r<=0?e!=null&&typeof e=="object"&&typeof t=="object"?Object.assign(e,t):t:(t!==void 0&&typeof e=="object"&&typeof t=="object"&&Object.keys(t).forEach(s=>{typeof t[s]=="object"&&t[s]!==null&&(e[s]===void 0||typeof e[s]=="object")?(e[s]===void 0&&(e[s]=Array.isArray(t[s])?[]:{}),e[s]=Wo(e[s],t[s],{depth:r-1,clobber:i})):(i||typeof e[s]!="object"&&typeof t[s]!="object")&&(e[s]=t[s])}),e)},"assignWithDepth"),Ot=Wo,Ee="#ffffff",Me="#f2f2f2",ot=f((e,t)=>t?C(e,{s:-40,l:10}):C(e,{s:-40,l:-10}),"mkBorder"),Kr,T0=(Kr=class{constructor(){this.background="#f4f4f4",this.primaryColor="#fff4dd",this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.useGradient=!0,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))"}updateColors(){if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||C(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||C(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||ot(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||ot(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||ot(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||ot(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||S(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||S(this.tertiaryColor),this.lineColor=this.lineColor||S(this.background),this.arrowheadColor=this.arrowheadColor||S(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?A(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||A(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||S(this.lineColor),this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.s
font-family: ${r.fontFamily};
font-size: ${r.fontSize};
fill: ${r.textColor}
}
@keyframes edge-animation-frame {
from {
stroke-dashoffset: 0;
}
}
@keyframes dash {
to {
stroke-dashoffset: 0;
}
}
& .edge-animation-slow {
stroke-dasharray: 9,5 !important;
stroke-dashoffset: 900;
animation: dash 50s linear infinite;
stroke-linecap: round;
}
& .edge-animation-fast {
stroke-dasharray: 9,5 !important;
stroke-dashoffset: 900;
animation: dash 20s linear infinite;
stroke-linecap: round;
}
/* Classes common for multiple diagrams */
& .error-icon {
fill: ${r.errorBkgColor};
}
& .error-text {
fill: ${r.errorTextColor};
stroke: ${r.errorTextColor};
}
& .edge-thickness-normal {
stroke-width: ${r.strokeWidth??1}px;
}
& .edge-thickness-thick {
stroke-width: 3.5px
}
& .edge-pattern-solid {
stroke-dasharray: 0;
}
& .edge-thickness-invisible {
stroke-width: 0;
fill: none;
}
& .edge-pattern-dashed{
stroke-dasharray: 3;
}
.edge-pattern-dotted {
stroke-dasharray: 2;
}
& .marker {
fill: ${r.lineColor};
stroke: ${r.lineColor};
}
& .marker.cross {
stroke: ${r.lineColor};
}
& svg {
font-family: ${r.fontFamily};
font-size: ${r.fontSize};
}
& p {
margin: 0
}
${a}
.node .neo-node {
stroke: ${r.nodeBorder};
}
[data-look="neo"].node rect, [data-look="neo"].cluster rect, [data-look="neo"].node polygon {
stroke: ${r.useGradient?"url("+i+"-gradient)":r.nodeBorder};
filter: ${r.dropShadow?r.dropShadow.replace("url(#drop-shadow)",`url(${i}-drop-shadow)`):"none"};
}
[data-look="neo"].node path {
stroke: ${r.useGradient?"url("+i+"-gradient)":r.nodeBorder};
stroke-width: ${r.strokeWidth??1}px;
}
[data-look="neo"].node .outer-path {
filter: ${r.dropShadow?r.dropShadow.replace("url(#drop-shadow)",`url(${i}-drop-shadow)`):"none"};
}
[data-look="neo"].node .neo-line path {
stroke: ${r.nodeBorder};
filter: none;
}
[data-look="neo"].node circle{
stroke: ${r.useGradient?"url("+i+"-gradient)":r.nodeBorder};
filter: ${r.dropShadow?r.dropShadow.replace("url(#drop-shadow)",`url(${i}-drop-shadow)`):"none"};
}
[data-look="neo"].node circle .state-start{
fill: #000000;
}
[data-look="neo"].icon-shape .icon {
fill: ${r.useGradient?"url("+i+"-gradient)":r.nodeBorder};
filter: ${r.dropShadow?r.dropShadow.replace("url(#drop-shadow)",`url(${i}-drop-shadow)`):"none"};
}
[data-look="neo"].icon-shape .icon-neo path {
stroke: ${r.useGradient?"url("+i+"-gradient)":r.nodeBorder};
filter: ${r.dropShadow?r.dropShadow.replace("url(#drop-shadow)",`url(${i}-drop-shadow)`):"none"};
}
${t}
`},"getStyles"),pC=f((e,t)=>{t!==void 0&&(Ha[e]=t)},"addStylesForDiagram"),fC=dC,Bu={};Wy(Bu,{clear:()=>gC,getAccDescription:()=>xC,getAccTitle:()=>yC,getDiagramTitle:()=>kC,setAccDescription:()=>CC,setAccTitle:()=>mC,setDiagramTitle:()=>bC});var Yn="",jn="",Un="",Gn=f(e=>be(e,wt()),"sanitizeText"),gC=f(()=>{Yn="",Un="",jn=""},"clear"),mC=f(e=>{Yn=Gn(e).replace(/^\s+/g,"")},"setAccTitle"),yC=f(()=>Yn,"getAccTitle"),CC=f(e=>{Un=Gn(e).replace(/\n\s+/g,`
`)},"setAccDescription"),xC=f(()=>Un,"getAccDescription"),bC=f(e=>{jn=Gn(e)},"setDiagramTitle"),kC=f(()=>jn,"getDiagramTitle"),wh=R,TC=Wn,mt=wt,kA=Cu,TA=ui,Xn=f(e=>be(e,mt()),"sanitizeText"),_C=uC,wC=f(()=>Bu,"getCommonDb"),rs={},is=f((e,t,r)=>{rs[e]&&wh.warn(`Diagram with id ${e} already registered. Overwriting.`),rs[e]=t,r&&pu(e,r),pC(e,t.styles),t.injectUtils?.(wh,TC,mt,Xn,_C,wC(),()=>{})},"registerDiagram"),jo=f(e=>{if(e in rs)return rs[e];throw new SC(e)},"getDiagram"),li,SC=(li=class extends Error{constructor(t){super(`Diagram ${t} not found.`)}},f(li,"DiagramNotFoundError"),li),vC={value:()=>{}};function Lu(){for(var e=0,t=arguments.length,r={},i;e<t;++e){if(!(i=arguments[e]+"")||i in r||/[\s.]/.test(i))throw new Error("illegal type: "+i);r[i]=[]}return new Ya(r)}function Ya(e){this._=e}function BC(e,t){return e.trim().split(/^|\s+/).map(function(r){var i="",a=r.indexOf(".");if(a>=0&&(i=r.slice(a+1),r=r.slice(0,a)),r&&!t.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:i}})}Ya.prototype=Lu.prototype={constructor:Ya,on:function(e,t){var r=this._,i=BC(e+"",r),a,s=-1,o=i.length;if(arguments.length<2){for(;++s<o;)if((a=(e=i[s]).type)&&(a=LC(r[a],e.name)))return a;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++s<o;)if(a=(e=i[s]).type)r[a]=Sh(r[a],e.name,t);else if(t==null)for(a in r)r[a]=Sh(r[a],e.name,null);return this},copy:function(){var e={},t=this._;for(var r in t)e[r]=t[r].slice();return new Ya(e)},call:function(e,t){if((a=arguments.length-2)>0)for(var r=new Array(a),i=0,a,s;i<a;++i)r[i]=arguments[i+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(s=this._[e],i=0,a=s.length;i<a;++i)s[i].value.apply(t,r)},apply:function(e,t,r){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var i=this._[e],a=0,s=i.length;a<s;++a)i[a].value.apply(t,r)}};function LC(e,t){for(var r=0,i=e.length,a;r<i;++r)if((a=e[r]).name===t)return a.value}function Sh(e,t,r){for(var i=0,a=e.length;i<a;++i)if(e[i].name===t){e[i]=vC,e=e.slice(0,i).concat(e.slice(i+1));break}return r!=null&&e.push({name:t,value:r}),e}var Uo="http://www.w3.org/1999/xhtml";const vh={svg:"http://www.w3.org/2000/svg",xhtml:Uo,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Ds(e){var t=e+="",r=t.indexOf(":");return r>=0&&(t=e.slice(0,r))!=="xmlns"&&(e=e.slice(r+1)),vh.hasOwnProperty(t)?{space:vh[t],local:e}:e}function FC(e){return function(){var t=this.ownerDocument,r=this.namespaceURI;return r===Uo&&t.documentElement.namespaceURI===Uo?t.createElement(e):t.createElementNS(r,e)}}function AC(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Fu(e){var t=Ds(e);return(t.local?AC:FC)(t)}function EC(){}function Vn(e){return e==null?EC:function(){return this.querySelector(e)}}function MC(e){typeof e!="function"&&(e=Vn(e));for(var t=this._groups,r=t.length,i=new Array(r),a=0;a<r;++a)for(var s=t[a],o=s.length,n=i[a]=new Array(o),l,c,h=0;h<o;++h)(l=s[h])&&(c=e.call(l,l.__data__,h,s))&&("__data__"in l&&(c.__data__=l.__data__),n[h]=c);return new oe(i,this._parents)}function $C(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function OC(){return[]}function Au(e){return e==null?OC:function(){return this.querySelectorAll(e)}}function IC(e){return function(){return $C(e.apply(this,arguments))}}function DC(e){typeof e=="function"?e=IC(e):e=Au(e);for(var t=this._groups,r=t.length,i=[],a=[],s=0;s<r;++s)for(var o=t[s],n=o.length,l,c=0;c<n;++c)(l=o[c])&&(i.push(e.call(l,l.__data__,c,o)),a.push(l));return new oe(i,a)}function Eu(e){return function(){return this.matches(e)}}function Mu(e){return function(t){return t.matches(e)}}var PC=Array.prototype.find;function RC(e){return function(){return PC.call(this.children,e)}}function NC(){return this.firstElementChild}function qC(e){return this.select(e==null?NC:RC(typeof e=="function"?e:Mu(e)))}var zC=Array.prototype.filter;function WC(){return Array.from(this.children)}function HC(e){return function(){return zC.call(this
`+e.mark.snippet),i+" "+r):i}f(ll,"formatError");function fi(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=ll(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}f(fi,"YAMLException$1");fi.prototype=Object.create(Error.prototype);fi.prototype.constructor=fi;fi.prototype.toString=f(function(t){return this.name+": "+ll(this,t)},"toString");var ee=fi;function Ga(e,t,r,i,a){var s="",o="",n=Math.floor(a/2)-1;return i-t>n&&(s=" ... ",t=i-n+s.length),r-i>n&&(o=" ...",r=i+n-o.length),{str:s+e.slice(t,r).replace(/\t/g,"→")+o,pos:i-t+s.length}}f(Ga,"getLine");function Xa(e,t){return It.repeat(" ",t-e.length)+e}f(Xa,"padStart");function Ld(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||(t.maxLength=79),typeof t.indent!="number"&&(t.indent=1),typeof t.linesBefore!="number"&&(t.linesBefore=3),typeof t.linesAfter!="number"&&(t.linesAfter=2);for(var r=/\r?\n|\r|\0/g,i=[0],a=[],s,o=-1;s=r.exec(e.buffer);)a.push(s.index),i.push(s.index+s[0].length),e.position<=s.index&&o<0&&(o=i.length-2);o<0&&(o=i.length-1);var n="",l,c,h=Math.min(e.line+t.linesAfter,a.length).toString().length,u=t.maxLength-(t.indent+h+3);for(l=1;l<=t.linesBefore&&!(o-l<0);l++)c=Ga(e.buffer,i[o-l],a[o-l],e.position-(i[o]-i[o-l]),u),n=It.repeat(" ",t.indent)+Xa((e.line-l+1).toString(),h)+" | "+c.str+`
`+n;for(c=Ga(e.buffer,i[o],a[o],e.position,u),n+=It.repeat(" ",t.indent)+Xa((e.line+1).toString(),h)+" | "+c.str+`
`,n+=It.repeat("-",t.indent+h+3+c.pos)+`^
`,l=1;l<=t.linesAfter&&!(o+l>=a.length);l++)c=Ga(e.buffer,i[o+l],a[o+l],e.position-(i[o]-i[o+l]),u),n+=It.repeat(" ",t.indent)+Xa((e.line+l+1).toString(),h)+" | "+c.str+`
`;return n.replace(/\n$/,"")}f(Ld,"makeSnippet");var hk=Ld,ck=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],uk=["scalar","sequence","mapping"];function Fd(e){var t={};return e!==null&&Object.keys(e).forEach(function(r){e[r].forEach(function(i){t[String(i)]=r})}),t}f(Fd,"compileStyleAliases");function Ad(e,t){if(t=t||{},Object.keys(t).forEach(function(r){if(ck.indexOf(r)===-1)throw new ee('Unknown option "'+r+'" is met in definition of "'+e+'" YAML type.')}),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(r){return r},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=Fd(t.styleAliases||null),uk.indexOf(this.kind)===-1)throw new ee('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}f(Ad,"Type$1");var Yt=Ad;function rn(e,t){var r=[];return e[t].forEach(function(i){var a=r.length;r.forEach(function(s,o){s.tag===i.tag&&s.kind===i.kind&&s.multi===i.multi&&(a=o)}),r[a]=i}),r}f(rn,"compileList");function Ed(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},t,r;function i(a){a.multi?(e.multi[a.kind].push(a),e.multi.fallback.push(a)):e[a.kind][a.tag]=e.fallback[a.tag]=a}for(f(i,"collectType"),t=0,r=arguments.length;t<r;t+=1)arguments[t].forEach(i);return e}f(Ed,"compileMap");function ps(e){return this.extend(e)}f(ps,"Schema$1");ps.prototype.extend=f(function(t){var r=[],i=[];if(t instanceof Yt)i.push(t);else if(Array.isArray(t))i=i.concat(t);else if(t&&(Array.isArray(t.implicit)||Array.isArray(t.explicit)))t.implicit&&(r=r.concat(t.implicit)),t.explicit&&(i=i.concat(t.explicit));else throw new ee("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");r.forEach(function(s){if(!(s instanceof Yt))throw new ee("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(s.loadKind&&s.loadKind!=="scalar")throw new ee("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(s.multi)throw new ee("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),i.forEach(function(s){if(!(s instanceof Yt))throw new ee("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var a=Object.create(ps.prototype);return a.implicit=(this.implicit||[]).concat(r),a.explicit=(this.explicit||[]).concat(i),a.compiledImplicit=rn(a,"implicit"),a.compiledExplicit=rn(a,"explicit"),a.compiledTypeMap=Ed(a.compiledImplicit,a.compiledExplicit),a},"extend");var dk=ps,pk=new Yt("tag:yaml.org,2002:str",{kind:"scalar",construct:f(function(e){return e!==null?e:""},"construct")}),fk=new Yt("tag:yaml.org,2002:seq",{kind:"sequence",construct:f(function(e){return e!==null?e:[]},"construct")}),gk=new Yt("tag:yaml.org,2002:map",{kind:"mapping",construct:f(function(e){return e!==null?e:{}},"construct")}),mk=new dk({explicit:[pk,fk,gk]});function Md(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}f(Md,"resolveYamlNull");function $d(){return null}f($d,"constructYamlNull");function Od(e){return e===null}f(Od,"isNull");var yk=new Yt("tag:yaml.org,2002:null",{kind:"scalar",resolve:Md,construct:$d,predicate:Od,represent:{canonical:f(function(){return"~"},"canonical"),lowercase:f(function(){return"null"},"lowercase"),uppercase:f(function(){return"NULL"},"uppercase"),camelcase:f(function(){return"Null"},"camelcase"),empty:f(function(){return""},"empty")},defaultStyle:"lowercase"});function Id(e){if(e===null)return!1;var t=e.length;return t===4&&(e==="true"||e==="True"||e==="TRUE")||t===5&&(e==="false"||e==="False"||e==="FALSE")}f(Id,"resolveYamlBoolean");function Dd(e){return e==="true"||e==="True"||e==="TRU
\r`;function ep(e){if(e===null)return!1;var t,r,i=0,a=e.length,s=hl;for(r=0;r<a;r++)if(t=s.indexOf(e.charAt(r)),!(t>64)){if(t<0)return!1;i+=6}return i%8===0}f(ep,"resolveYamlBinary");function rp(e){var t,r,i=e.replace(/[\r\n=]/g,""),a=i.length,s=hl,o=0,n=[];for(t=0;t<a;t++)t%4===0&&t&&(n.push(o>>16&255),n.push(o>>8&255),n.push(o&255)),o=o<<6|s.indexOf(i.charAt(t));return r=a%4*6,r===0?(n.push(o>>16&255),n.push(o>>8&255),n.push(o&255)):r===18?(n.push(o>>10&255),n.push(o>>2&255)):r===12&&n.push(o>>4&255),new Uint8Array(n)}f(rp,"constructYamlBinary");function ip(e){var t="",r=0,i,a,s=e.length,o=hl;for(i=0;i<s;i++)i%3===0&&i&&(t+=o[r>>18&63],t+=o[r>>12&63],t+=o[r>>6&63],t+=o[r&63]),r=(r<<8)+e[i];return a=s%3,a===0?(t+=o[r>>18&63],t+=o[r>>12&63],t+=o[r>>6&63],t+=o[r&63]):a===2?(t+=o[r>>10&63],t+=o[r>>4&63],t+=o[r<<2&63],t+=o[64]):a===1&&(t+=o[r>>2&63],t+=o[r<<4&63],t+=o[64],t+=o[64]),t}f(ip,"representYamlBinary");function ap(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}f(ap,"isBinary");var vk=new Yt("tag:yaml.org,2002:binary",{kind:"scalar",resolve:ep,construct:rp,predicate:ap,represent:ip}),Bk=Object.prototype.hasOwnProperty,Lk=Object.prototype.toString;function sp(e){if(e===null)return!0;var t=[],r,i,a,s,o,n=e;for(r=0,i=n.length;r<i;r+=1){if(a=n[r],o=!1,Lk.call(a)!=="[object Object]")return!1;for(s in a)if(Bk.call(a,s))if(!o)o=!0;else return!1;if(!o)return!1;if(t.indexOf(s)===-1)t.push(s);else return!1}return!0}f(sp,"resolveYamlOmap");function op(e){return e!==null?e:[]}f(op,"constructYamlOmap");var Fk=new Yt("tag:yaml.org,2002:omap",{kind:"sequence",resolve:sp,construct:op}),Ak=Object.prototype.toString;function np(e){if(e===null)return!0;var t,r,i,a,s,o=e;for(s=new Array(o.length),t=0,r=o.length;t<r;t+=1){if(i=o[t],Ak.call(i)!=="[object Object]"||(a=Object.keys(i),a.length!==1))return!1;s[t]=[a[0],i[a[0]]]}return!0}f(np,"resolveYamlPairs");function lp(e){if(e===null)return[];var t,r,i,a,s,o=e;for(s=new Array(o.length),t=0,r=o.length;t<r;t+=1)i=o[t],a=Object.keys(i),s[t]=[a[0],i[a[0]]];return s}f(lp,"constructYamlPairs");var Ek=new Yt("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:np,construct:lp}),Mk=Object.prototype.hasOwnProperty;function hp(e){if(e===null)return!0;var t,r=e;for(t in r)if(Mk.call(r,t)&&r[t]!==null)return!1;return!0}f(hp,"resolveYamlSet");function cp(e){return e!==null?e:{}}f(cp,"constructYamlSet");var $k=new Yt("tag:yaml.org,2002:set",{kind:"mapping",resolve:hp,construct:cp}),up=_k.extend({implicit:[wk,Sk],explicit:[vk,Fk,Ek,$k]}),ir=Object.prototype.hasOwnProperty,fs=1,dp=2,pp=3,gs=4,vo=1,Ok=2,Gh=3,Ik=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Dk=/[\x85\u2028\u2029]/,Pk=/[,\[\]\{\}]/,fp=/^(?:!|!!|![a-z\-]+!)$/i,gp=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function an(e){return Object.prototype.toString.call(e)}f(an,"_class");function Ce(e){return e===10||e===13}f(Ce,"is_EOL");function er(e){return e===9||e===32}f(er,"is_WHITE_SPACE");function Gt(e){return e===9||e===32||e===10||e===13}f(Gt,"is_WS_OR_EOL");function yr(e){return e===44||e===91||e===93||e===123||e===125}f(yr,"is_FLOW_INDICATOR");function mp(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}f(mp,"fromHexCode");function yp(e){return e===120?2:e===117?4:e===85?8:0}f(yp,"escapedHexLen");function Cp(e){return 48<=e&&e<=57?e-48:-1}f(Cp,"fromDecimalCode");function sn(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
`:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"…":e===95?" ":e===76?"\u2028":e===80?"\u2029":""}f(sn,"simpleEscapeSequence");function xp(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}f(xp,"charFromCodepoint");function cl(e,t,r){t==="__proto__"?Object.defineProperty(e,t,{configurable:!0,enumerable:!0,writable:!0,value:r}):e[t]=r}f(cl,"setProperty");var bp=new Array(256),kp=new Array(256);for(cr=0;cr<256;cr++)bp[cr]=sn(cr)?1:0,kp[cr]=sn(cr);var cr;function Tp(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||up,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}f(Tp,"State$1");function ul(e,t){var r={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return r.snippet=hk(r),new ee(t,r)}f(ul,"generateError");function K(e,t){throw ul(e,t)}f(K,"throwError");function aa(e,t){e.onWarning&&e.onWarning.call(null,ul(e,t))}f(aa,"throwWarning");var Xh={YAML:f(function(t,r,i){var a,s,o;t.version!==null&&K(t,"duplication of %YAML directive"),i.length!==1&&K(t,"YAML directive accepts exactly one argument"),a=/^([0-9]+)\.([0-9]+)$/.exec(i[0]),a===null&&K(t,"ill-formed argument of the YAML directive"),s=parseInt(a[1],10),o=parseInt(a[2],10),s!==1&&K(t,"unacceptable YAML version of the document"),t.version=i[0],t.checkLineBreaks=o<2,o!==1&&o!==2&&aa(t,"unsupported YAML version of the document")},"handleYamlDirective"),TAG:f(function(t,r,i){var a,s;i.length!==2&&K(t,"TAG directive accepts exactly two arguments"),a=i[0],s=i[1],fp.test(a)||K(t,"ill-formed tag handle (first argument) of the TAG directive"),ir.call(t.tagMap,a)&&K(t,'there is a previously declared suffix for "'+a+'" tag handle'),gp.test(s)||K(t,"ill-formed tag prefix (second argument) of the TAG directive");try{s=decodeURIComponent(s)}catch{K(t,"tag prefix is malformed: "+s)}t.tagMap[a]=s},"handleTagDirective")};function We(e,t,r,i){var a,s,o,n;if(t<r){if(n=e.input.slice(t,r),i)for(a=0,s=n.length;a<s;a+=1)o=n.charCodeAt(a),o===9||32<=o&&o<=1114111||K(e,"expected valid JSON character");else Ik.test(n)&&K(e,"the stream contains non-printable characters");e.result+=n}}f(We,"captureSegment");function on(e,t,r,i){var a,s,o,n;for(It.isObject(r)||K(e,"cannot merge mappings; the provided source object is unacceptable"),a=Object.keys(r),o=0,n=a.length;o<n;o+=1)s=a[o],ir.call(t,s)||(cl(t,s,r[s]),i[s]=!0)}f(on,"mergeMappings");function Cr(e,t,r,i,a,s,o,n,l){var c,h;if(Array.isArray(a))for(a=Array.prototype.slice.call(a),c=0,h=a.length;c<h;c+=1)Array.isArray(a[c])&&K(e,"nested arrays are not supported inside keys"),typeof a=="object"&&an(a[c])==="[object Object]"&&(a[c]="[object Object]");if(typeof a=="object"&&an(a)==="[object Object]"&&(a="[object Object]"),a=String(a),t===null&&(t={}),i==="tag:yaml.org,2002:merge")if(Array.isArray(s))for(c=0,h=s.length;c<h;c+=1)on(e,t,s[c],r);else on(e,t,s,r);else!e.json&&!ir.call(r,a)&&ir.call(t,a)&&(e.line=o||e.line,e.lineStart=n||e.lineStart,e.position=l||e.position,K(e,"duplicated mapping key")),cl(t,a,s),delete r[a];return t}f(Cr,"storeMappingPair");function zs(e){var t;t=e.input.charCodeAt(e.position),t===10?e.position++:t===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):K(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}f(zs,"readLineBreak");function Bt(e,t,r){for(var i=0,a=e.input.charCodeAt(e.position);a!==0;){for(;er(a);)a===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),a=e.input.charCodeAt(++e.position);if(t&&a===35)do a=e.input.charCodeAt(++e.position);while(a!==10&&a!==13&&a!==0);if(Ce(a))for(zs(e),a=e.input.charCodeAt(e.position),i++,e.lineIndent=0;a===32;)e.lineIndent++,a=e.input.charCodeAt(++e.position);else bre
`,t-1))}f(Ws,"writeFoldedLines");function _p(e,t,r){var i,a,s,o,n,l,c,h,u=e.kind,p=e.result,d;if(d=e.input.charCodeAt(e.position),Gt(d)||yr(d)||d===35||d===38||d===42||d===33||d===124||d===62||d===39||d===34||d===37||d===64||d===96||(d===63||d===45)&&(a=e.input.charCodeAt(e.position+1),Gt(a)||r&&yr(a)))return!1;for(e.kind="scalar",e.result="",s=o=e.position,n=!1;d!==0;){if(d===58){if(a=e.input.charCodeAt(e.position+1),Gt(a)||r&&yr(a))break}else if(d===35){if(i=e.input.charCodeAt(e.position-1),Gt(i))break}else{if(e.position===e.lineStart&&ya(e)||r&&yr(d))break;if(Ce(d))if(l=e.line,c=e.lineStart,h=e.lineIndent,Bt(e,!1,-1),e.lineIndent>=t){n=!0,d=e.input.charCodeAt(e.position);continue}else{e.position=o,e.line=l,e.lineStart=c,e.lineIndent=h;break}}n&&(We(e,s,o,!1),Ws(e,e.line-l),s=o=e.position,n=!1),er(d)||(o=e.position+1),d=e.input.charCodeAt(++e.position)}return We(e,s,o,!1),e.result?!0:(e.kind=u,e.result=p,!1)}f(_p,"readPlainScalar");function wp(e,t){var r,i,a;if(r=e.input.charCodeAt(e.position),r!==39)return!1;for(e.kind="scalar",e.result="",e.position++,i=a=e.position;(r=e.input.charCodeAt(e.position))!==0;)if(r===39)if(We(e,i,e.position,!0),r=e.input.charCodeAt(++e.position),r===39)i=e.position,e.position++,a=e.position;else return!0;else Ce(r)?(We(e,i,a,!0),Ws(e,Bt(e,!1,t)),i=a=e.position):e.position===e.lineStart&&ya(e)?K(e,"unexpected end of the document within a single quoted scalar"):(e.position++,a=e.position);K(e,"unexpected end of the stream within a single quoted scalar")}f(wp,"readSingleQuotedScalar");function Sp(e,t){var r,i,a,s,o,n;if(n=e.input.charCodeAt(e.position),n!==34)return!1;for(e.kind="scalar",e.result="",e.position++,r=i=e.position;(n=e.input.charCodeAt(e.position))!==0;){if(n===34)return We(e,r,e.position,!0),e.position++,!0;if(n===92){if(We(e,r,e.position,!0),n=e.input.charCodeAt(++e.position),Ce(n))Bt(e,!1,t);else if(n<256&&bp[n])e.result+=kp[n],e.position++;else if((o=yp(n))>0){for(a=o,s=0;a>0;a--)n=e.input.charCodeAt(++e.position),(o=mp(n))>=0?s=(s<<4)+o:K(e,"expected hexadecimal character");e.result+=xp(s),e.position++}else K(e,"unknown escape sequence");r=i=e.position}else Ce(n)?(We(e,r,i,!0),Ws(e,Bt(e,!1,t)),r=i=e.position):e.position===e.lineStart&&ya(e)?K(e,"unexpected end of the document within a double quoted scalar"):(e.position++,i=e.position)}K(e,"unexpected end of the stream within a double quoted scalar")}f(Sp,"readDoubleQuotedScalar");function vp(e,t){var r=!0,i,a,s,o=e.tag,n,l=e.anchor,c,h,u,p,d,g=Object.create(null),m,y,x,b;if(b=e.input.charCodeAt(e.position),b===91)h=93,d=!1,n=[];else if(b===123)h=125,d=!0,n={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=n),b=e.input.charCodeAt(++e.position);b!==0;){if(Bt(e,!0,t),b=e.input.charCodeAt(e.position),b===h)return e.position++,e.tag=o,e.anchor=l,e.kind=d?"mapping":"sequence",e.result=n,!0;r?b===44&&K(e,"expected the node content, but found ','"):K(e,"missed comma between flow collection entries"),y=m=x=null,u=p=!1,b===63&&(c=e.input.charCodeAt(e.position+1),Gt(c)&&(u=p=!0,e.position++,Bt(e,!0,t))),i=e.line,a=e.lineStart,s=e.position,wr(e,t,fs,!1,!0),y=e.tag,m=e.result,Bt(e,!0,t),b=e.input.charCodeAt(e.position),(p||e.line===i)&&b===58&&(u=!0,b=e.input.charCodeAt(++e.position),Bt(e,!0,t),wr(e,t,fs,!1,!0),x=e.result),d?Cr(e,n,g,y,m,x,i,a,s):u?n.push(Cr(e,null,g,y,m,x,i,a,s)):n.push(m),Bt(e,!0,t),b=e.input.charCodeAt(e.position),b===44?(r=!0,b=e.input.charCodeAt(++e.position)):r=!1}K(e,"unexpected end of the stream within a flow collection")}f(vp,"readFlowCollection");function Bp(e,t){var r,i,a=vo,s=!1,o=!1,n=t,l=0,c=!1,h,u;if(u=e.input.charCodeAt(e.position),u===124)i=!1;else if(u===62)i=!0;else return!1;for(e.kind="scalar",e.result="";u!==0;)if(u=e.input.charCodeAt(++e.position),u===43||u===45)vo===a?a=u===43?Gh:Ok:K(e,"repeat of a chomping mode identifier");else if((h=Cp(u))>=0)h===0?K(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):o?K(e,"repeat of an indentation width identifier"):(n=t+h-1,o=!0);else break;if(er(u)){do u=e.input.charCodeAt(++e.position);while(er(u));if(u===35)do u=
`,s?1+l:l):a===vo&&s&&(e.result+=`
`);break}for(i?er(u)?(c=!0,e.result+=It.repeat(`
`,s?1+l:l)):c?(c=!1,e.result+=It.repeat(`
`,l+1)):l===0?s&&(e.result+=" "):e.result+=It.repeat(`
`,l):e.result+=It.repeat(`
`,s?1+l:l),s=!0,o=!0,l=0,r=e.position;!Ce(u)&&u!==0;)u=e.input.charCodeAt(++e.position);We(e,r,e.position,!1)}return!0}f(Bp,"readBlockScalar");function nn(e,t){var r,i=e.tag,a=e.anchor,s=[],o,n=!1,l;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=s),l=e.input.charCodeAt(e.position);l!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,K(e,"tab characters must not be used in indentation")),!(l!==45||(o=e.input.charCodeAt(e.position+1),!Gt(o))));){if(n=!0,e.position++,Bt(e,!0,-1)&&e.lineIndent<=t){s.push(null),l=e.input.charCodeAt(e.position);continue}if(r=e.line,wr(e,t,pp,!1,!0),s.push(e.result),Bt(e,!0,-1),l=e.input.charCodeAt(e.position),(e.line===r||e.lineIndent>t)&&l!==0)K(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break}return n?(e.tag=i,e.anchor=a,e.kind="sequence",e.result=s,!0):!1}f(nn,"readBlockSequence");function Lp(e,t,r){var i,a,s,o,n,l,c=e.tag,h=e.anchor,u={},p=Object.create(null),d=null,g=null,m=null,y=!1,x=!1,b;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=u),b=e.input.charCodeAt(e.position);b!==0;){if(!y&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,K(e,"tab characters must not be used in indentation")),i=e.input.charCodeAt(e.position+1),s=e.line,(b===63||b===58)&&Gt(i))b===63?(y&&(Cr(e,u,p,d,g,null,o,n,l),d=g=m=null),x=!0,y=!0,a=!0):y?(y=!1,a=!0):K(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,b=i;else{if(o=e.line,n=e.lineStart,l=e.position,!wr(e,r,dp,!1,!0))break;if(e.line===s){for(b=e.input.charCodeAt(e.position);er(b);)b=e.input.charCodeAt(++e.position);if(b===58)b=e.input.charCodeAt(++e.position),Gt(b)||K(e,"a whitespace character is expected after the key-value separator within a block mapping"),y&&(Cr(e,u,p,d,g,null,o,n,l),d=g=m=null),x=!0,y=!1,a=!1,d=e.tag,g=e.result;else if(x)K(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=c,e.anchor=h,!0}else if(x)K(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=c,e.anchor=h,!0}if((e.line===s||e.lineIndent>t)&&(y&&(o=e.line,n=e.lineStart,l=e.position),wr(e,t,gs,!0,a)&&(y?g=e.result:m=e.result),y||(Cr(e,u,p,d,g,m,o,n,l),d=g=m=null),Bt(e,!0,-1),b=e.input.charCodeAt(e.position)),(e.line===s||e.lineIndent>t)&&b!==0)K(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return y&&Cr(e,u,p,d,g,null,o,n,l),x&&(e.tag=c,e.anchor=h,e.kind="mapping",e.result=u),x}f(Lp,"readBlockMapping");function Fp(e){var t,r=!1,i=!1,a,s,o;if(o=e.input.charCodeAt(e.position),o!==33)return!1;if(e.tag!==null&&K(e,"duplication of a tag property"),o=e.input.charCodeAt(++e.position),o===60?(r=!0,o=e.input.charCodeAt(++e.position)):o===33?(i=!0,a="!!",o=e.input.charCodeAt(++e.position)):a="!",t=e.position,r){do o=e.input.charCodeAt(++e.position);while(o!==0&&o!==62);e.position<e.length?(s=e.input.slice(t,e.position),o=e.input.charCodeAt(++e.position)):K(e,"unexpected end of the stream within a verbatim tag")}else{for(;o!==0&&!Gt(o);)o===33&&(i?K(e,"tag suffix cannot contain exclamation marks"):(a=e.input.slice(t-1,e.position+1),fp.test(a)||K(e,"named tag handle cannot contain such characters"),i=!0,t=e.position+1)),o=e.input.charCodeAt(++e.position);s=e.input.slice(t,e.position),Pk.test(s)&&K(e,"tag suffix cannot contain flow indicator characters")}s&&!gp.test(s)&&K(e,"tag name cannot contain such characters: "+s);try{s=decodeURIComponent(s)}catch{K(e,"tag name is malformed: "+s)}return r?e.tag=s:ir.call(e.tagMap,a)?e.tag=e.tagMap[a]+s:a==="!"?e.tag="!"+s:a==="!!"?e.tag="tag:yaml.org,2002:"+s:K(e,'undeclared tag handle "'+a+'"'),!0}f(Fp,"readTagProperty");function Ap(e){var t,r;if(r=e.input.charCodeAt(e.position),r!==38)return!1;for(e.anchor!==null&&K(e,"duplication of an anchor property"),r=e.input.charCodeAt(++e.position),t=e.position;r!==0&&!Gt(r)&&!yr(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&K(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}f(Ap,"r
`),e.charCodeAt(0)===65279&&(e=e.slice(1)));var r=new Tp(e,t),i=e.indexOf("\0");for(i!==-1&&(r.position=i,K(r,"null byte is not allowed in input")),r.input+="\0";r.input.charCodeAt(r.position)===32;)r.lineIndent+=1,r.position+=1;for(;r.position<r.length-1;)Mp(r);return r.documents}f(dl,"loadDocuments");function Rk(e,t,r){t!==null&&typeof t=="object"&&typeof r>"u"&&(r=t,t=null);var i=dl(e,r);if(typeof t!="function")return i;for(var a=0,s=i.length;a<s;a+=1)t(i[a])}f(Rk,"loadAll$1");function $p(e,t){var r=dl(e,t);if(r.length!==0){if(r.length===1)return r[0];throw new ee("expected a single document in the stream, but found more")}}f($p,"load$1");var Nk=$p,qk={load:Nk},Op=Object.prototype.toString,Ip=Object.prototype.hasOwnProperty,pl=65279,zk=9,sa=10,Wk=13,Hk=32,Yk=33,jk=34,ln=35,Uk=37,Gk=38,Xk=39,Vk=42,Dp=44,Zk=45,ms=58,Kk=61,Qk=62,Jk=63,t2=64,Pp=91,Rp=93,e2=96,Np=123,r2=124,qp=125,jt={};jt[0]="\\0";jt[7]="\\a";jt[8]="\\b";jt[9]="\\t";jt[10]="\\n";jt[11]="\\v";jt[12]="\\f";jt[13]="\\r";jt[27]="\\e";jt[34]='\\"';jt[92]="\\\\";jt[133]="\\N";jt[160]="\\_";jt[8232]="\\L";jt[8233]="\\P";var i2=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],a2=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function zp(e,t){var r,i,a,s,o,n,l;if(t===null)return{};for(r={},i=Object.keys(t),a=0,s=i.length;a<s;a+=1)o=i[a],n=String(t[o]),o.slice(0,2)==="!!"&&(o="tag:yaml.org,2002:"+o.slice(2)),l=e.compiledTypeMap.fallback[o],l&&Ip.call(l.styleAliases,n)&&(n=l.styleAliases[n]),r[o]=n;return r}f(zp,"compileStyleMap");function Wp(e){var t,r,i;if(t=e.toString(16).toUpperCase(),e<=255)r="x",i=2;else if(e<=65535)r="u",i=4;else if(e<=4294967295)r="U",i=8;else throw new ee("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+r+It.repeat("0",i-t.length)+t}f(Wp,"encodeHex");var s2=1,oa=2;function Hp(e){this.schema=e.schema||up,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=It.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=zp(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType=e.quotingType==='"'?oa:s2,this.forceQuotes=e.forceQuotes||!1,this.replacer=typeof e.replacer=="function"?e.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}f(Hp,"State");function hn(e,t){for(var r=It.repeat(" ",t),i=0,a=-1,s="",o,n=e.length;i<n;)a=e.indexOf(`
`,i),a===-1?(o=e.slice(i),i=n):(o=e.slice(i,a+1),i=a+1),o.length&&o!==`
`&&(s+=r),s+=o;return s}f(hn,"indentString");function ys(e,t){return`
`+It.repeat(" ",e.indent*t)}f(ys,"generateNextLine");function Yp(e,t){var r,i,a;for(r=0,i=e.implicitTypes.length;r<i;r+=1)if(a=e.implicitTypes[r],a.resolve(t))return!0;return!1}f(Yp,"testImplicitResolving");function na(e){return e===Hk||e===zk}f(na,"isWhitespace");function gi(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==pl||65536<=e&&e<=1114111}f(gi,"isPrintable");function cn(e){return gi(e)&&e!==pl&&e!==Wk&&e!==sa}f(cn,"isNsCharOrWhitespace");function un(e,t,r){var i=cn(e),a=i&&!na(e);return(r?i:i&&e!==Dp&&e!==Pp&&e!==Rp&&e!==Np&&e!==qp)&&e!==ln&&!(t===ms&&!a)||cn(t)&&!na(t)&&e===ln||t===ms&&a}f(un,"isPlainSafe");function jp(e){return gi(e)&&e!==pl&&!na(e)&&e!==Zk&&e!==Jk&&e!==ms&&e!==Dp&&e!==Pp&&e!==Rp&&e!==Np&&e!==qp&&e!==ln&&e!==Gk&&e!==Vk&&e!==Yk&&e!==r2&&e!==Kk&&e!==Qk&&e!==Xk&&e!==jk&&e!==Uk&&e!==t2&&e!==e2}f(jp,"isPlainSafeFirst");function Up(e){return!na(e)&&e!==ms}f(Up,"isPlainSafeLast");function Ur(e,t){var r=e.charCodeAt(t),i;return r>=55296&&r<=56319&&t+1<e.length&&(i=e.charCodeAt(t+1),i>=56320&&i<=57343)?(r-55296)*1024+i-56320+65536:r}f(Ur,"codePointAt");function fl(e){var t=/^\n* /;return t.test(e)}f(fl,"needIndentIndicator");var Gp=1,dn=2,Xp=3,Vp=4,Hr=5;function Zp(e,t,r,i,a,s,o,n){var l,c=0,h=null,u=!1,p=!1,d=i!==-1,g=-1,m=jp(Ur(e,0))&&Up(Ur(e,e.length-1));if(t||o)for(l=0;l<e.length;c>=65536?l+=2:l++){if(c=Ur(e,l),!gi(c))return Hr;m=m&&un(c,h,n),h=c}else{for(l=0;l<e.length;c>=65536?l+=2:l++){if(c=Ur(e,l),c===sa)u=!0,d&&(p=p||l-g-1>i&&e[g+1]!==" ",g=l);else if(!gi(c))return Hr;m=m&&un(c,h,n),h=c}p=p||d&&l-g-1>i&&e[g+1]!==" "}return!u&&!p?m&&!o&&!a(e)?Gp:s===oa?Hr:dn:r>9&&fl(e)?Hr:o?s===oa?Hr:dn:p?Vp:Xp}f(Zp,"chooseScalarStyle");function Kp(e,t,r,i,a){e.dump=(function(){if(t.length===0)return e.quotingType===oa?'""':"''";if(!e.noCompatMode&&(i2.indexOf(t)!==-1||a2.test(t)))return e.quotingType===oa?'"'+t+'"':"'"+t+"'";var s=e.indent*Math.max(1,r),o=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-s),n=i||e.flowLevel>-1&&r>=e.flowLevel;function l(c){return Yp(e,c)}switch(f(l,"testAmbiguity"),Zp(t,n,e.indent,o,l,e.quotingType,e.forceQuotes&&!i,a)){case Gp:return t;case dn:return"'"+t.replace(/'/g,"''")+"'";case Xp:return"|"+pn(t,e.indent)+fn(hn(t,s));case Vp:return">"+pn(t,e.indent)+fn(hn(Qp(t,o),s));case Hr:return'"'+Jp(t)+'"';default:throw new ee("impossible error: invalid scalar style")}})()}f(Kp,"writeScalar");function pn(e,t){var r=fl(e)?String(t):"",i=e[e.length-1]===`
`,a=i&&(e[e.length-2]===`
`||e===`
`),s=a?"+":i?"":"-";return r+s+`
`}f(pn,"blockHeader");function fn(e){return e[e.length-1]===`
`?e.slice(0,-1):e}f(fn,"dropEndingNewline");function Qp(e,t){for(var r=/(\n+)([^\n]*)/g,i=(function(){var c=e.indexOf(`
`);return c=c!==-1?c:e.length,r.lastIndex=c,gn(e.slice(0,c),t)})(),a=e[0]===`
`||e[0]===" ",s,o;o=r.exec(e);){var n=o[1],l=o[2];s=l[0]===" ",i+=n+(!a&&!s&&l!==""?`
`:"")+gn(l,t),a=s}return i}f(Qp,"foldString");function gn(e,t){if(e===""||e[0]===" ")return e;for(var r=/ [^ ]/g,i,a=0,s,o=0,n=0,l="";i=r.exec(e);)n=i.index,n-a>t&&(s=o>a?o:n,l+=`
`+e.slice(a,s),a=s+1),o=n;return l+=`
`,e.length-a>t&&o>a?l+=e.slice(a,o)+`
`+e.slice(o+1):l+=e.slice(a),l.slice(1)}f(gn,"foldLine");function Jp(e){for(var t="",r=0,i,a=0;a<e.length;r>=65536?a+=2:a++)r=Ur(e,a),i=jt[r],!i&&gi(r)?(t+=e[a],r>=65536&&(t+=e[a+1])):t+=i||Wp(r);return t}f(Jp,"escapeString");function tf(e,t,r){var i="",a=e.tag,s,o,n;for(s=0,o=r.length;s<o;s+=1)n=r[s],e.replacer&&(n=e.replacer.call(r,String(s),n)),(Ae(e,t,n,!1,!1)||typeof n>"u"&&Ae(e,t,null,!1,!1))&&(i!==""&&(i+=","+(e.condenseFlow?"":" ")),i+=e.dump);e.tag=a,e.dump="["+i+"]"}f(tf,"writeFlowSequence");function mn(e,t,r,i){var a="",s=e.tag,o,n,l;for(o=0,n=r.length;o<n;o+=1)l=r[o],e.replacer&&(l=e.replacer.call(r,String(o),l)),(Ae(e,t+1,l,!0,!0,!1,!0)||typeof l>"u"&&Ae(e,t+1,null,!0,!0,!1,!0))&&((!i||a!=="")&&(a+=ys(e,t)),e.dump&&sa===e.dump.charCodeAt(0)?a+="-":a+="- ",a+=e.dump);e.tag=s,e.dump=a||"[]"}f(mn,"writeBlockSequence");function ef(e,t,r){var i="",a=e.tag,s=Object.keys(r),o,n,l,c,h;for(o=0,n=s.length;o<n;o+=1)h="",i!==""&&(h+=", "),e.condenseFlow&&(h+='"'),l=s[o],c=r[l],e.replacer&&(c=e.replacer.call(r,l,c)),Ae(e,t,l,!1,!1)&&(e.dump.length>1024&&(h+="? "),h+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),Ae(e,t,c,!1,!1)&&(h+=e.dump,i+=h));e.tag=a,e.dump="{"+i+"}"}f(ef,"writeFlowMapping");function rf(e,t,r,i){var a="",s=e.tag,o=Object.keys(r),n,l,c,h,u,p;if(e.sortKeys===!0)o.sort();else if(typeof e.sortKeys=="function")o.sort(e.sortKeys);else if(e.sortKeys)throw new ee("sortKeys must be a boolean or a function");for(n=0,l=o.length;n<l;n+=1)p="",(!i||a!=="")&&(p+=ys(e,t)),c=o[n],h=r[c],e.replacer&&(h=e.replacer.call(r,c,h)),Ae(e,t+1,c,!0,!0,!0)&&(u=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,u&&(e.dump&&sa===e.dump.charCodeAt(0)?p+="?":p+="? "),p+=e.dump,u&&(p+=ys(e,t)),Ae(e,t+1,h,!0,u)&&(e.dump&&sa===e.dump.charCodeAt(0)?p+=":":p+=": ",p+=e.dump,a+=p));e.tag=s,e.dump=a||"{}"}f(rf,"writeBlockMapping");function yn(e,t,r){var i,a,s,o,n,l;for(a=r?e.explicitTypes:e.implicitTypes,s=0,o=a.length;s<o;s+=1)if(n=a[s],(n.instanceOf||n.predicate)&&(!n.instanceOf||typeof t=="object"&&t instanceof n.instanceOf)&&(!n.predicate||n.predicate(t))){if(r?n.multi&&n.representName?e.tag=n.representName(t):e.tag=n.tag:e.tag="?",n.represent){if(l=e.styleMap[n.tag]||n.defaultStyle,Op.call(n.represent)==="[object Function]")i=n.represent(t,l);else if(Ip.call(n.represent,l))i=n.represent[l](t,l);else throw new ee("!<"+n.tag+'> tag resolver accepts not "'+l+'" style');e.dump=i}return!0}return!1}f(yn,"detectType");function Ae(e,t,r,i,a,s,o){e.tag=null,e.dump=r,yn(e,r,!1)||yn(e,r,!0);var n=Op.call(e.dump),l=i,c;i&&(i=e.flowLevel<0||e.flowLevel>t);var h=n==="[object Object]"||n==="[object Array]",u,p;if(h&&(u=e.duplicates.indexOf(r),p=u!==-1),(e.tag!==null&&e.tag!=="?"||p||e.indent!==2&&t>0)&&(a=!1),p&&e.usedDuplicates[u])e.dump="*ref_"+u;else{if(h&&p&&!e.usedDuplicates[u]&&(e.usedDuplicates[u]=!0),n==="[object Object]")i&&Object.keys(e.dump).length!==0?(rf(e,t,e.dump,a),p&&(e.dump="&ref_"+u+e.dump)):(ef(e,t,e.dump),p&&(e.dump="&ref_"+u+" "+e.dump));else if(n==="[object Array]")i&&e.dump.length!==0?(e.noArrayIndent&&!o&&t>0?mn(e,t-1,e.dump,a):mn(e,t,e.dump,a),p&&(e.dump="&ref_"+u+e.dump)):(tf(e,t,e.dump),p&&(e.dump="&ref_"+u+" "+e.dump));else if(n==="[object String]")e.tag!=="?"&&Kp(e,e.dump,t,s,l);else{if(n==="[object Undefined]")return!1;if(e.skipInvalid)return!1;throw new ee("unacceptable kind of an object to dump "+n)}e.tag!==null&&e.tag!=="?"&&(c=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?c="!"+c:c.slice(0,18)==="tag:yaml.org,2002:"?c="!!"+c.slice(18):c="!<"+c+">",e.dump=c+" "+e.dump)}return!0}f(Ae,"writeNode");function af(e,t){var r=[],i=[],a,s;for(Cs(e,r,i),a=0,s=i.length;a<s;a+=1)t.duplicates.push(r[i[a]]);t.usedDuplicates=new Array(s)}f(af,"getDuplicateReferences");function Cs(e,t,r){var i,a,s;if(e!==null&&typeof e=="object")if(a=t.indexOf(e),a!==-1)r.indexOf(a)===-1&&r.push(a);else if(t.push(e),Array.isArray(e))for(a=0,s=e.length;a<s;a+=1)Cs(e[a],t,r);else for(i=Object.keys(e),a=0,s=i.length;a<s;a+=1)Cs(e[i[a]],t,r)}f(Cs,"inspectNode");function o2(e,t){t=t||{};var r=new Hp(
`:""}f(o2,"dump$1");function n2(e,t){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+t+" instead, which is now safe by default.")}}f(n2,"renamed");var l2=Xd,h2=qk.load;/*! Bundled license information:
js-yaml/dist/js-yaml.mjs:
(*! js-yaml 4.1.1 https://github.com/nodeca/js-yaml @license MIT *)
*/var Ai=f((e,t)=>{if(t)return"translate("+-e.width/2+", "+-e.height/2+")";const r=e.x??0,i=e.y??0;return"translate("+-(r+e.width/2)+", "+-(i+e.height/2)+")"},"computeLabelTransform"),Ht={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},Vh={arrow_point:4,arrow_cross:12.5,arrow_circle:12.5};function Wi(e,t){if(e===void 0||t===void 0)return{angle:0,deltaX:0,deltaY:0};e=_t(e),t=_t(t);const[r,i]=[e.x,e.y],[a,s]=[t.x,t.y],o=a-r,n=s-i;return{angle:Math.atan(n/o),deltaX:o,deltaY:n}}f(Wi,"calculateDeltaAndAngle");var _t=f(e=>Array.isArray(e)?{x:e[0],y:e[1]}:e,"pointTransformer"),c2=f(e=>({x:f(function(t,r,i){let a=0;const s=_t(i[0]).x<_t(i[i.length-1]).x?"left":"right";if(r===0&&Object.hasOwn(Ht,e.arrowTypeStart)){const{angle:d,deltaX:g}=Wi(i[0],i[1]);a=Ht[e.arrowTypeStart]*Math.cos(d)*(g>=0?1:-1)}else if(r===i.length-1&&Object.hasOwn(Ht,e.arrowTypeEnd)){const{angle:d,deltaX:g}=Wi(i[i.length-1],i[i.length-2]);a=Ht[e.arrowTypeEnd]*Math.cos(d)*(g>=0?1:-1)}const o=Math.abs(_t(t).x-_t(i[i.length-1]).x),n=Math.abs(_t(t).y-_t(i[i.length-1]).y),l=Math.abs(_t(t).x-_t(i[0]).x),c=Math.abs(_t(t).y-_t(i[0]).y),h=Ht[e.arrowTypeStart],u=Ht[e.arrowTypeEnd],p=1;if(o<u&&o>0&&n<u){let d=u+p-o;d*=s==="right"?-1:1,a-=d}if(l<h&&l>0&&c<h){let d=h+p-l;d*=s==="right"?-1:1,a+=d}return _t(t).x+a},"x"),y:f(function(t,r,i){let a=0;const s=_t(i[0]).y<_t(i[i.length-1]).y?"down":"up";if(r===0&&Object.hasOwn(Ht,e.arrowTypeStart)){const{angle:d,deltaY:g}=Wi(i[0],i[1]);a=Ht[e.arrowTypeStart]*Math.abs(Math.sin(d))*(g>=0?1:-1)}else if(r===i.length-1&&Object.hasOwn(Ht,e.arrowTypeEnd)){const{angle:d,deltaY:g}=Wi(i[i.length-1],i[i.length-2]);a=Ht[e.arrowTypeEnd]*Math.abs(Math.sin(d))*(g>=0?1:-1)}const o=Math.abs(_t(t).y-_t(i[i.length-1]).y),n=Math.abs(_t(t).x-_t(i[i.length-1]).x),l=Math.abs(_t(t).y-_t(i[0]).y),c=Math.abs(_t(t).x-_t(i[0]).x),h=Ht[e.arrowTypeStart],u=Ht[e.arrowTypeEnd],p=1;if(o<u&&o>0&&n<u){let d=u+p-o;d*=s==="up"?-1:1,a-=d}if(l<h&&l>0&&c<h){let d=h+p-l;d*=s==="up"?-1:1,a+=d}return _t(t).y+a},"y")}),"getLineFunctionsWithOffset"),$a={},$t={},Zh;function u2(){return Zh||(Zh=1,Object.defineProperty($t,"__esModule",{value:!0}),$t.BLANK_URL=$t.relativeFirstCharacters=$t.whitespaceEscapeCharsRegex=$t.urlSchemeRegex=$t.ctrlCharactersRegex=$t.htmlCtrlEntityRegex=$t.htmlEntitiesRegex=$t.invalidProtocolRegex=void 0,$t.invalidProtocolRegex=/^([^\w]*)(javascript|data|vbscript)/im,$t.htmlEntitiesRegex=/&#(\w+)(^\w|;)?/g,$t.htmlCtrlEntityRegex=/&(newline|tab);/gi,$t.ctrlCharactersRegex=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,$t.urlSchemeRegex=/^.+(:|&colon;)/gim,$t.whitespaceEscapeCharsRegex=/(\\|%5[cC])((%(6[eE]|72|74))|[nrt])/g,$t.relativeFirstCharacters=[".","/"],$t.BLANK_URL="about:blank"),$t}var Kh;function d2(){if(Kh)return $a;Kh=1,Object.defineProperty($a,"__esModule",{value:!0}),$a.sanitizeUrl=s;var e=u2();function t(o){return e.relativeFirstCharacters.indexOf(o[0])>-1}function r(o){var n=o.replace(e.ctrlCharactersRegex,"");return n.replace(e.htmlEntitiesRegex,function(l,c){return String.fromCharCode(c)})}function i(o){return URL.canParse(o)}function a(o){try{return decodeURIComponent(o)}catch{return o}}function s(o){if(!o)return e.BLANK_URL;var n,l=a(o.trim());do l=r(l).replace(e.htmlCtrlEntityRegex,"").replace(e.ctrlCharactersRegex,"").replace(e.whitespaceEscapeCharsRegex,"").trim(),l=a(l),n=l.match(e.ctrlCharactersRegex)||l.match(e.htmlEntitiesRegex)||l.match(e.htmlCtrlEntityRegex)||l.match(e.whitespaceEscapeCharsRegex);while(n&&n.length>0);var c=l;if(!c)return e.BLANK_URL;if(t(c))return c;var h=c.trimStart(),u=h.match(e.urlSchemeRegex);if(!u)return c;var p=u[0].toLowerCase().trim();if(e.invalidProtocolRegex.test(p))return e.BLANK_URL;var d=h.replace(/\\/g,"/");if(p==="mailto:"||p.includes("://"))return d;if(p==="http:"||p==="https:"){if(!i(d))return e.BLANK_URL;var g=new URL(d);return g.protocol=g.protocol.toLowerCase(),g.hostname=g.hostname.toLowerCase(),g.toString()}return d}return $a}var p2=d2(),sf=typeof global=="object"&&global&&global.Object===Object&&global,
`,"ig");e=e.trim().replace(r,"").replace(/'/gm,'"'),R.debug(`Detecting diagram directive${t!==null?" type:"+t:""} based on the text:${e}`);let i;const a=[];for(;(i=Gi.exec(e))!==null;)if(i.index===Gi.lastIndex&&Gi.lastIndex++,i&&!t||t&&i[1]?.match(t)||t&&i[2]?.match(t)){const s=i[1]?i[1]:i[2],o=i[3]?i[3].trim():i[4]?JSON.parse(i[4].trim()):null;a.push({type:s,args:o})}return a.length===0?{type:e,args:null}:a.length===1?a[0]:a}catch(r){return R.error(`ERROR: ${r.message} - Unable to parse directive type: '${t}' based on the text: '${e}'`),{type:void 0,args:null}}},"detectDirective"),U_=f(function(e){return e.replace(Gi,"")},"removeDirectives"),G_=f(function(e,t){for(const[r,i]of t.entries())if(i.match(e))return r;return-1},"isSubstringInArray");function xl(e,t){if(!e)return t;const r=`curve${e.charAt(0).toUpperCase()+e.slice(1)}`;return H_[r]??t}f(xl,"interpolateToCurve");function bf(e,t){const r=e.trim();if(r)return t.securityLevel!=="loose"?p2.sanitizeUrl(r):r}f(bf,"formatUrl");var X_=f((e,...t)=>{const r=e.split("."),i=r.length-1,a=r[i];let s=window;for(let o=0;o<i;o++)if(s=s[r[o]],!s){R.error(`Function name: ${e} not found in window`);return}s[a](...t)},"runFunc");function bl(e,t){return!e||!t?0:Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}f(bl,"distance");function kf(e){let t,r=0;e.forEach(a=>{r+=bl(a,t),t=a});const i=r/2;return kl(e,i)}f(kf,"traverseEdge");function Tf(e){return e.length===1?e[0]:kf(e)}f(Tf,"calcLabelPosition");var uc=f((e,t=2)=>{const r=Math.pow(10,t);return Math.round(e*r)/r},"roundNumber"),kl=f((e,t)=>{let r,i=t;for(const a of e){if(r){const s=bl(a,r);if(s===0)return r;if(s<i)i-=s;else{const o=i/s;if(o<=0)return r;if(o>=1)return{x:a.x,y:a.y};if(o>0&&o<1)return{x:uc((1-o)*r.x+o*a.x,5),y:uc((1-o)*r.y+o*a.y,5)}}}r=a}throw new Error("Could not find a suitable point for the given distance")},"calculatePoint"),V_=f((e,t,r)=>{R.info(`our points ${JSON.stringify(t)}`),t[0]!==r&&(t=t.reverse());const a=kl(t,25),s=e?10:5,o=Math.atan2(t[0].y-a.y,t[0].x-a.x),n={x:0,y:0};return n.x=Math.sin(o)*s+(t[0].x+a.x)/2,n.y=-Math.cos(o)*s+(t[0].y+a.y)/2,n},"calcCardinalityPosition");function _f(e,t,r){const i=structuredClone(r);R.info("our points",i),t!=="start_left"&&t!=="start_right"&&i.reverse();const a=25+e,s=kl(i,a),o=10+e*.5,n=Math.atan2(i[0].y-s.y,i[0].x-s.x),l={x:0,y:0};return t==="start_left"?(l.x=Math.sin(n+Math.PI)*o+(i[0].x+s.x)/2,l.y=-Math.cos(n+Math.PI)*o+(i[0].y+s.y)/2):t==="end_right"?(l.x=Math.sin(n-Math.PI)*o+(i[0].x+s.x)/2-5,l.y=-Math.cos(n-Math.PI)*o+(i[0].y+s.y)/2-5):t==="end_left"?(l.x=Math.sin(n)*o+(i[0].x+s.x)/2-5,l.y=-Math.cos(n)*o+(i[0].y+s.y)/2-5):(l.x=Math.sin(n)*o+(i[0].x+s.x)/2,l.y=-Math.cos(n)*o+(i[0].y+s.y)/2),l}f(_f,"calcTerminalLabelPosition");function wf(e){let t="",r="";for(const i of e)i!==void 0&&(i.startsWith("color:")||i.startsWith("text-align:")?r=r+i+";":t=t+i+";");return{style:t,labelStyle:r}}f(wf,"getStylesFromArray");var dc=0,Z_=f(()=>(dc++,"id-"+Math.random().toString(36).substr(2,12)+"-"+dc),"generateId");function Sf(e){let t="";const r="0123456789abcdef",i=r.length;for(let a=0;a<e;a++)t+=r.charAt(Math.floor(Math.random()*i));return t}f(Sf,"makeRandomHex");var K_=f(e=>Sf(e.length),"random"),Q_=f(function(){return{x:0,y:0,fill:void 0,anchor:"start",style:"#666",width:100,height:100,textMargin:0,rx:0,ry:0,valign:void 0,text:""}},"getTextObj"),J_=f(function(e,t){const r=t.text.replace(fa.lineBreakRegex," "),[,i]=Xs(t.fontSize),a=e.append("text");a.attr("x",t.x),a.attr("y",t.y),a.style("text-anchor",t.anchor),a.style("font-family",t.fontFamily),a.style("font-size",i),a.style("font-weight",t.fontWeight),a.attr("fill",t.fill),t.class!==void 0&&a.attr("class",t.class);const s=a.append("tspan");return s.attr("x",t.x+t.textMargin*2),s.attr("fill",t.fill),s.text(r),a},"drawSimpleText"),tw=Ca((e,t,r)=>{if(!e||(r=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",joinWith:"<br/>"},r),fa.lineBreakRegex.test(e)))return e;const i=e.split(" ").filter(Boolean),a=[];let s="";return i.forEach((o,n)=>{const l=Ye(`${o} `,r),c=Ye(s,r);if(l>t){const{hyphenatedStrings:p,remainingW
]`).replace("lheading",$f).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},zw=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Ww=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,If=/^( {2,}|\\)\n(?!\s*$)/,Hw=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Zs=/[\p{P}\p{S}]/u,Ml=/[\s\p{P}\p{S}]/u,Df=/[^\s\p{P}\p{S}]/u,Yw=yt(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Ml).getRegex(),Pf=/(?!~)[\p{P}\p{S}]/u,jw=/(?!~)[\s\p{P}\p{S}]/u,Uw=/(?:[^\s\p{P}\p{S}]|~)/u,Gw=yt(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Lw?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Rf=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Xw=yt(Rf,"u").replace(/punct/g,Zs).getRegex(),Vw=yt(Rf,"u").replace(/punct/g,Pf).getRegex(),Nf="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Zw=yt(Nf,"gu").replace(/notPunctSpace/g,Df).replace(/punctSpace/g,Ml).replace(/punct/g,Zs).getRegex(),Kw=yt(Nf,"gu").replace(/notPunctSpace/g,Uw).replace(/punctSpace/g,jw).replace(/punct/g,Pf).getRegex(),Qw=yt("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Df).replace(/punctSpace/g,Ml).replace(/punct/g,Zs).getRegex(),Jw=yt(/\\(punct)/,"gu").replace(/punct/g,Zs).getRegex(),tS=yt(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),eS=yt(Al).replace("(?:-->|$)","-->").getRegex(),rS=yt("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",eS).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),ws=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,iS=yt(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",ws).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),qf=yt(/^!?\[(label)\]\[(ref)\]/).replace("label",ws).replace("ref",Fl).getRegex(),zf=yt(/^!?\[(ref)\](?:\[\])?/).replace("ref",Fl).getRegex(),aS=yt("reflink|nolink(?!\\()","g").replace("reflink",qf).replace("nolink",zf).getRegex(),Cc=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,$l={_backpedal:Ki,anyPunctuation:Jw,autolink:tS,blockSkip:Gw,br:If,code:Ww,del:Ki,emStrongLDelim:Xw,emStrongRDelimAst:Zw,emStrongRDelimUnd:Qw,escape:zw,link:iS,nolink:zf,punctuation:Yw,reflink:qf,reflinkSearch:aS,tag:rS,text:Hw,url:Ki},sS={...$l,link:yt(/^!?\[(label)\]\((.*?)\)/).replace("label",ws).getRegex(),reflink:yt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ws).getRegex()},bn={...$l,emStrongRDelimAst:Kw,emStrongLDelim:Vw,url:yt(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Cc).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:yt(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("p
`).map(s=>{let o=s.match(r.other.beginningSpace);if(o===null)return s;let[n]=o;return n.length>=a.length?s.slice(a.length):s}).join(`
`)}var Ss=class{options;rules;lexer;constructor(t){this.options=t||Mr}space(t){let r=this.rules.block.newline.exec(t);if(r&&r[0].length>0)return{type:"space",raw:r[0]}}code(t){let r=this.rules.block.code.exec(t);if(r){let i=r[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:r[0],codeBlockStyle:"indented",text:this.options.pedantic?i:$i(i,`
`)}}}fences(t){let r=this.rules.block.fences.exec(t);if(r){let i=r[0],a=hS(i,r[3]||"",this.rules);return{type:"code",raw:i,lang:r[2]?r[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):r[2],text:a}}}heading(t){let r=this.rules.block.heading.exec(t);if(r){let i=r[2].trim();if(this.rules.other.endingHash.test(i)){let a=$i(i,"#");(this.options.pedantic||!a||this.rules.other.endingSpaceChar.test(a))&&(i=a.trim())}return{type:"heading",raw:r[0],depth:r[1].length,text:i,tokens:this.lexer.inline(i)}}}hr(t){let r=this.rules.block.hr.exec(t);if(r)return{type:"hr",raw:$i(r[0],`
`)}}blockquote(t){let r=this.rules.block.blockquote.exec(t);if(r){let i=$i(r[0],`
`).split(`
`),a="",s="",o=[];for(;i.length>0;){let n=!1,l=[],c;for(c=0;c<i.length;c++)if(this.rules.other.blockquoteStart.test(i[c]))l.push(i[c]),n=!0;else if(!n)l.push(i[c]);else break;i=i.slice(c);let h=l.join(`
`),u=h.replace(this.rules.other.blockquoteSetextReplace,`
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");a=a?`${a}
${h}`:h,s=s?`${s}
${u}`:u;let p=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(u,o,!0),this.lexer.state.top=p,i.length===0)break;let d=o.at(-1);if(d?.type==="code")break;if(d?.type==="blockquote"){let g=d,m=g.raw+`
`+i.join(`
`),y=this.blockquote(m);o[o.length-1]=y,a=a.substring(0,a.length-g.raw.length)+y.raw,s=s.substring(0,s.length-g.text.length)+y.text;break}else if(d?.type==="list"){let g=d,m=g.raw+`
`+i.join(`
`),y=this.list(m);o[o.length-1]=y,a=a.substring(0,a.length-d.raw.length)+y.raw,s=s.substring(0,s.length-g.raw.length)+y.raw,i=m.substring(o.at(-1).raw.length).split(`
`);continue}}return{type:"blockquote",raw:a,tokens:o,text:s}}}list(t){let r=this.rules.block.list.exec(t);if(r){let i=r[1].trim(),a=i.length>1,s={type:"list",raw:"",ordered:a,start:a?+i.slice(0,-1):"",loose:!1,items:[]};i=a?`\\d{1,9}\\${i.slice(-1)}`:`\\${i}`,this.options.pedantic&&(i=a?i:"[*+-]");let o=this.rules.other.listItemRegex(i),n=!1;for(;t;){let c=!1,h="",u="";if(!(r=o.exec(t))||this.rules.block.hr.test(t))break;h=r[0],t=t.substring(h.length);let p=r[2].split(`
`,1)[0].replace(this.rules.other.listReplaceTabs,b=>" ".repeat(3*b.length)),d=t.split(`
`,1)[0],g=!p.trim(),m=0;if(this.options.pedantic?(m=2,u=p.trimStart()):g?m=r[1].length+1:(m=r[2].search(this.rules.other.nonSpaceChar),m=m>4?1:m,u=p.slice(m),m+=r[1].length),g&&this.rules.other.blankLine.test(d)&&(h+=d+`
`,t=t.substring(d.length+1),c=!0),!c){let b=this.rules.other.nextBulletRegex(m),k=this.rules.other.hrRegex(m),_=this.rules.other.fencesBeginRegex(m),w=this.rules.other.headingBeginRegex(m),v=this.rules.other.htmlBeginRegex(m);for(;t;){let E=t.split(`
`,1)[0],B;if(d=E,this.options.pedantic?(d=d.replace(this.rules.other.listReplaceNesting," "),B=d):B=d.replace(this.rules.other.tabCharGlobal," "),_.test(d)||w.test(d)||v.test(d)||b.test(d)||k.test(d))break;if(B.search(this.rules.other.nonSpaceChar)>=m||!d.trim())u+=`
`+B.slice(m);else{if(g||p.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||_.test(p)||w.test(p)||k.test(p))break;u+=`
`+d}!g&&!d.trim()&&(g=!0),h+=E+`
`,t=t.substring(E.length+1),p=B.slice(m)}}s.loose||(n?s.loose=!0:this.rules.other.doubleBlankLine.test(h)&&(n=!0));let y=null,x;this.options.gfm&&(y=this.rules.other.listIsTask.exec(u),y&&(x=y[0]!=="[ ] ",u=u.replace(this.rules.other.listReplaceTask,""))),s.items.push({type:"list_item",raw:h,task:!!y,checked:x,loose:!1,text:u,tokens:[]}),s.raw+=h}let l=s.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;s.raw=s.raw.trimEnd();for(let c=0;c<s.items.length;c++)if(this.lexer.state.top=!1,s.items[c].tokens=this.lexer.blockTokens(s.items[c].text,[]),!s.loose){let h=s.items[c].tokens.filter(p=>p.type==="space"),u=h.length>0&&h.some(p=>this.rules.other.anyLine.test(p.raw));s.loose=u}if(s.loose)for(let c=0;c<s.items.length;c++)s.items[c].loose=!0;return s}}html(t){let r=this.rules.block.html.exec(t);if(r)return{type:"html",block:!0,raw:r[0],pre:r[1]==="pre"||r[1]==="script"||r[1]==="style",text:r[0]}}def(t){let r=this.rules.block.def.exec(t);if(r){let i=r[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),a=r[2]?r[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",s=r[3]?r[3].substring(1,r[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):r[3];return{type:"def",tag:i,raw:r[0],href:a,title:s}}}table(t){let r=this.rules.block.table.exec(t);if(!r||!this.rules.other.tableDelimiter.test(r[2]))return;let i=kc(r[1]),a=r[2].replace(this.rules.other.tableAlignChars,"").split("|"),s=r[3]?.trim()?r[3].replace(this.rules.other.tableRowBlankLine,"").split(`
`):[],o={type:"table",raw:r[0],header:[],align:[],rows:[]};if(i.length===a.length){for(let n of a)this.rules.other.tableAlignRight.test(n)?o.align.push("right"):this.rules.other.tableAlignCenter.test(n)?o.align.push("center"):this.rules.other.tableAlignLeft.test(n)?o.align.push("left"):o.align.push(null);for(let n=0;n<i.length;n++)o.header.push({text:i[n],tokens:this.lexer.inline(i[n]),header:!0,align:o.align[n]});for(let n of s)o.rows.push(kc(n,o.header.length).map((l,c)=>({text:l,tokens:this.lexer.inline(l),header:!1,align:o.align[c]})));return o}}lheading(t){let r=this.rules.block.lheading.exec(t);if(r)return{type:"heading",raw:r[0],depth:r[2].charAt(0)==="="?1:2,text:r[1],tokens:this.lexer.inline(r[1])}}paragraph(t){let r=this.rules.block.paragraph.exec(t);if(r){let i=r[1].charAt(r[1].length-1)===`
`?r[1].slice(0,-1):r[1];return{type:"paragraph",raw:r[0],text:i,tokens:this.lexer.inline(i)}}}text(t){let r=this.rules.block.text.exec(t);if(r)return{type:"text",raw:r[0],text:r[0],tokens:this.lexer.inline(r[0])}}escape(t){let r=this.rules.inline.escape.exec(t);if(r)return{type:"escape",raw:r[0],text:r[1]}}tag(t){let r=this.rules.inline.tag.exec(t);if(r)return!this.lexer.state.inLink&&this.rules.other.startATag.test(r[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(r[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(r[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(r[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:r[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:r[0]}}link(t){let r=this.rules.inline.link.exec(t);if(r){let i=r[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(i)){if(!this.rules.other.endAngleBracket.test(i))return;let o=$i(i.slice(0,-1),"\\");if((i.length-o.length)%2===0)return}else{let o=lS(r[2],"()");if(o===-2)return;if(o>-1){let n=(r[0].indexOf("!")===0?5:4)+r[1].length+o;r[2]=r[2].substring(0,o),r[0]=r[0].substring(0,n).trim(),r[3]=""}}let a=r[2],s="";if(this.options.pedantic){let o=this.rules.other.pedanticHrefTitle.exec(a);o&&(a=o[1],s=o[3])}else s=r[3]?r[3].slice(1,-1):"";return a=a.trim(),this.rules.other.startAngleBracket.test(a)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(i)?a=a.slice(1):a=a.slice(1,-1)),Tc(r,{href:a&&a.replace(this.rules.inline.anyPunctuation,"$1"),title:s&&s.replace(this.rules.inline.anyPunctuation,"$1")},r[0],this.lexer,this.rules)}}reflink(t,r){let i;if((i=this.rules.inline.reflink.exec(t))||(i=this.rules.inline.nolink.exec(t))){let a=(i[2]||i[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=r[a.toLowerCase()];if(!s){let o=i[0].charAt(0);return{type:"text",raw:o,text:o}}return Tc(i,s,i[0],this.lexer,this.rules)}}emStrong(t,r,i=""){let a=this.rules.inline.emStrongLDelim.exec(t);if(!(!a||a[3]&&i.match(this.rules.other.unicodeAlphaNumeric))&&(!(a[1]||a[2])||!i||this.rules.inline.punctuation.exec(i))){let s=[...a[0]].length-1,o,n,l=s,c=0,h=a[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(h.lastIndex=0,r=r.slice(-1*t.length+s);(a=h.exec(r))!=null;){if(o=a[1]||a[2]||a[3]||a[4]||a[5]||a[6],!o)continue;if(n=[...o].length,a[3]||a[4]){l+=n;continue}else if((a[5]||a[6])&&s%3&&!((s+n)%3)){c+=n;continue}if(l-=n,l>0)continue;n=Math.min(n,n+l+c);let u=[...a[0]][0].length,p=t.slice(0,s+a.index+u+n);if(Math.min(s,n)%2){let g=p.slice(1,-1);return{type:"em",raw:p,text:g,tokens:this.lexer.inlineTokens(g)}}let d=p.slice(2,-2);return{type:"strong",raw:p,text:d,tokens:this.lexer.inlineTokens(d)}}}}codespan(t){let r=this.rules.inline.code.exec(t);if(r){let i=r[2].replace(this.rules.other.newLineCharGlobal," "),a=this.rules.other.nonSpaceChar.test(i),s=this.rules.other.startingSpaceChar.test(i)&&this.rules.other.endingSpaceChar.test(i);return a&&s&&(i=i.substring(1,i.length-1)),{type:"codespan",raw:r[0],text:i}}}br(t){let r=this.rules.inline.br.exec(t);if(r)return{type:"br",raw:r[0]}}del(t){let r=this.rules.inline.del.exec(t);if(r)return{type:"del",raw:r[0],text:r[2],tokens:this.lexer.inlineTokens(r[2])}}autolink(t){let r=this.rules.inline.autolink.exec(t);if(r){let i,a;return r[2]==="@"?(i=r[1],a="mailto:"+i):(i=r[1],a=i),{type:"link",raw:r[0],text:i,href:a,tokens:[{type:"text",raw:i,text:i}]}}}url(t){let r;if(r=this.rules.inline.url.exec(t)){let i,a;if(r[2]==="@")i=r[0],a="mailto:"+i;else{let s;do s=r[0],r[0]=this.rules.inline._backpedal.exec(r[0])?.[0]??"";while(s!==r[0]);i=r[0],r[1]==="www."?a="http://"+r[0]:a=r[0]}return{type:"link",raw:r[0],text:i,href:a,tokens:[{type:"text",raw:i,text:i}]}}}inlineText(t){let r=this.rules.inline.text.exec(t);if(r){let i=this.lexer.state.inRawBlock;return{type:"text",raw:r[0],text:r[0],escaped:i}}}},fe=class kn{tokens;options;state;tokenizer;inlineQueue;constructor(t){this.toke
`),this.blockTokens(t,this.tokens);for(let r=0;r<this.inlineQueue.length;r++){let i=this.inlineQueue[r];this.inlineTokens(i.src,i.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,r=[],i=!1){for(this.options.pedantic&&(t=t.replace(Xt.tabCharGlobal," ").replace(Xt.spaceLine,""));t;){let a;if(this.options.extensions?.block?.some(o=>(a=o.call({lexer:this},t,r))?(t=t.substring(a.raw.length),r.push(a),!0):!1))continue;if(a=this.tokenizer.space(t)){t=t.substring(a.raw.length);let o=r.at(-1);a.raw.length===1&&o!==void 0?o.raw+=`
`:r.push(a);continue}if(a=this.tokenizer.code(t)){t=t.substring(a.raw.length);let o=r.at(-1);o?.type==="paragraph"||o?.type==="text"?(o.raw+=(o.raw.endsWith(`
`)?"":`
`)+a.raw,o.text+=`
`+a.text,this.inlineQueue.at(-1).src=o.text):r.push(a);continue}if(a=this.tokenizer.fences(t)){t=t.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.heading(t)){t=t.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.hr(t)){t=t.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.blockquote(t)){t=t.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.list(t)){t=t.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.html(t)){t=t.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.def(t)){t=t.substring(a.raw.length);let o=r.at(-1);o?.type==="paragraph"||o?.type==="text"?(o.raw+=(o.raw.endsWith(`
`)?"":`
`)+a.raw,o.text+=`
`+a.raw,this.inlineQueue.at(-1).src=o.text):this.tokens.links[a.tag]||(this.tokens.links[a.tag]={href:a.href,title:a.title},r.push(a));continue}if(a=this.tokenizer.table(t)){t=t.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.lheading(t)){t=t.substring(a.raw.length),r.push(a);continue}let s=t;if(this.options.extensions?.startBlock){let o=1/0,n=t.slice(1),l;this.options.extensions.startBlock.forEach(c=>{l=c.call({lexer:this},n),typeof l=="number"&&l>=0&&(o=Math.min(o,l))}),o<1/0&&o>=0&&(s=t.substring(0,o+1))}if(this.state.top&&(a=this.tokenizer.paragraph(s))){let o=r.at(-1);i&&o?.type==="paragraph"?(o.raw+=(o.raw.endsWith(`
`)?"":`
`)+a.raw,o.text+=`
`+a.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=o.text):r.push(a),i=s.length!==t.length,t=t.substring(a.raw.length);continue}if(a=this.tokenizer.text(t)){t=t.substring(a.raw.length);let o=r.at(-1);o?.type==="text"?(o.raw+=(o.raw.endsWith(`
`)?"":`
`)+a.raw,o.text+=`
`+a.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=o.text):r.push(a);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 i=t,a=null;if(this.tokens.links){let l=Object.keys(this.tokens.links);if(l.length>0)for(;(a=this.tokenizer.rules.inline.reflinkSearch.exec(i))!=null;)l.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(i=i.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+i.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(a=this.tokenizer.rules.inline.anyPunctuation.exec(i))!=null;)i=i.slice(0,a.index)+"++"+i.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let s;for(;(a=this.tokenizer.rules.inline.blockSkip.exec(i))!=null;)s=a[2]?a[2].length:0,i=i.slice(0,a.index+s)+"["+"a".repeat(a[0].length-s-2)+"]"+i.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);i=this.options.hooks?.emStrongMask?.call({lexer:this},i)??i;let o=!1,n="";for(;t;){o||(n=""),o=!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,i,n)){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 c=t;if(this.options.extensions?.startInline){let h=1/0,u=t.slice(1),p;this.options.extensions.startInline.forEach(d=>{p=d.call({lexer:this},u),typeof p=="number"&&p>=0&&(h=Math.min(h,p))}),h<1/0&&h>=0&&(c=t.substring(0,h+1))}if(l=this.tokenizer.inlineText(c)){t=t.substring(l.raw.length),l.raw.slice(-1)!=="_"&&(n=l.raw.slice(-1)),o=!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}},vs=class{options;parser;constructor(t){this.options=t||Mr}space(t){return""}code({text:t,lang:r,escaped:i}){let a=(r||"").match(Xt.notSpaceStart)?.[0],s=t.replace(Xt.endingNewline,"")+`
`;return a?'<pre><code class="language-'+Se(a)+'">'+(i?s:Se(s,!0))+`</code></pre>
`:"<pre><code>"+(i?s:Se(s,!0))+`</code></pre>
`}blockquote({tokens:t}){return`<blockquote>
${this.parser.parse(t)}</blockquote>
`}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:r}){return`<h${r}>${this.parser.parseInline(t)}</h${r}>
`}hr(t){return`<hr>
`}list(t){let r=t.ordered,i=t.start,a="";for(let n=0;n<t.items.length;n++){let l=t.items[n];a+=this.listitem(l)}let s=r?"ol":"ul",o=r&&i!==1?' start="'+i+'"':"";return"<"+s+o+`>
`+a+"</"+s+`>
`}listitem(t){let r="";if(t.task){let i=this.checkbox({checked:!!t.checked});t.loose?t.tokens[0]?.type==="paragraph"?(t.tokens[0].text=i+" "+t.tokens[0].text,t.tokens[0].tokens&&t.tokens[0].tokens.length>0&&t.tokens[0].tokens[0].type==="text"&&(t.tokens[0].tokens[0].text=i+" "+Se(t.tokens[0].tokens[0].text),t.tokens[0].tokens[0].escaped=!0)):t.tokens.unshift({type:"text",raw:i+" ",text:i+" ",escaped:!0}):r+=i+" "}return r+=this.parser.parse(t.tokens,!!t.loose),`<li>${r}</li>
`}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
`}table(t){let r="",i="";for(let s=0;s<t.header.length;s++)i+=this.tablecell(t.header[s]);r+=this.tablerow({text:i});let a="";for(let s=0;s<t.rows.length;s++){let o=t.rows[s];i="";for(let n=0;n<o.length;n++)i+=this.tablecell(o[n]);a+=this.tablerow({text:i})}return a&&(a=`<tbody>${a}</tbody>`),`<table>
<thead>
`+r+`</thead>
`+a+`</table>
`}tablerow({text:t}){return`<tr>
${t}</tr>
`}tablecell(t){let r=this.parser.parseInline(t.tokens),i=t.header?"th":"td";return(t.align?`<${i} align="${t.align}">`:`<${i}>`)+r+`</${i}>
`}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${Se(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:r,tokens:i}){let a=this.parser.parseInline(i),s=bc(t);if(s===null)return a;t=s;let o='<a href="'+t+'"';return r&&(o+=' title="'+Se(r)+'"'),o+=">"+a+"</a>",o}image({href:t,title:r,text:i,tokens:a}){a&&(i=this.parser.parseInline(a,this.parser.textRenderer));let s=bc(t);if(s===null)return Se(i);t=s;let o=`<img src="${t}" alt="${i}"`;return r&&(o+=` title="${Se(r)}"`),o+=">",o}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:Se(t.text)}},Ol=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}},ge=class Tn{options;renderer;textRenderer;constructor(t){this.options=t||Mr,this.options.renderer=this.options.renderer||new vs,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Ol}static parse(t,r){return new Tn(r).parse(t)}static parseInline(t,r){return new Tn(r).parseInline(t)}parse(t,r=!0){let i="";for(let a=0;a<t.length;a++){let s=t[a];if(this.options.extensions?.renderers?.[s.type]){let n=s,l=this.options.extensions.renderers[n.type].call({parser:this},n);if(l!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(n.type)){i+=l||"";continue}}let o=s;switch(o.type){case"space":{i+=this.renderer.space(o);continue}case"hr":{i+=this.renderer.hr(o);continue}case"heading":{i+=this.renderer.heading(o);continue}case"code":{i+=this.renderer.code(o);continue}case"table":{i+=this.renderer.table(o);continue}case"blockquote":{i+=this.renderer.blockquote(o);continue}case"list":{i+=this.renderer.list(o);continue}case"html":{i+=this.renderer.html(o);continue}case"def":{i+=this.renderer.def(o);continue}case"paragraph":{i+=this.renderer.paragraph(o);continue}case"text":{let n=o,l=this.renderer.text(n);for(;a+1<t.length&&t[a+1].type==="text";)n=t[++a],l+=`
`+this.renderer.text(n);r?i+=this.renderer.paragraph({type:"paragraph",raw:l,text:l,tokens:[{type:"text",raw:l,text:l,escaped:!0}]}):i+=l;continue}default:{let n='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(n),"";throw new Error(n)}}}return i}parseInline(t,r=this.renderer){let i="";for(let a=0;a<t.length;a++){let s=t[a];if(this.options.extensions?.renderers?.[s.type]){let n=this.options.extensions.renderers[s.type].call({parser:this},s);if(n!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(s.type)){i+=n||"";continue}}let o=s;switch(o.type){case"escape":{i+=r.text(o);break}case"html":{i+=r.html(o);break}case"link":{i+=r.link(o);break}case"image":{i+=r.image(o);break}case"strong":{i+=r.strong(o);break}case"em":{i+=r.em(o);break}case"codespan":{i+=r.codespan(o);break}case"br":{i+=r.br(o);break}case"del":{i+=r.del(o);break}case"text":{i+=r.text(o);break}default:{let n='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(n),"";throw new Error(n)}}}return i}},Hi=class{options;block;constructor(t){this.options=t||Mr}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(){return this.block?fe.lex:fe.lexInline}provideParser(){return this.block?ge.parse:ge.parseInline}},cS=class{defaults=vl();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=ge;Renderer=vs;TextRenderer=Ol;Lexer=fe;Tokenizer=Ss;Hooks=Hi;constructor(...t){this.use(...t)}walkTokens(t,r){let i=[];for(let a of t)switch(i=i.concat(r.call(this,a)),a.type){case"table":{let s=a;for(let o of s.header)i=i.concat(this.walkTokens(o.tokens,r));for(let o of s.rows)for(let n of o)i=i.concat(this.walkTokens(n.tokens,r));break}case"list":{let s=a;i=i.concat(this.walkTokens(s.items,r));break}default:{let s=a;this.defaults.extensions?.childTokens?.[s.type]?this.defaults.extensions.childTokens[s.type].forEach(o=>{let n=s[o].flat(1/0);i=i.concat(this.walkTokens(n,r))}):s.tokens&&(i=i.concat(this.walkTokens(s.tokens,r)))}}return i}use(...t){let r=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(i=>{let a={...i};if(a.async=this.defaults.async||a.async||!1,i.extensions&&(i.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){let o=r.renderers[s.name];o?r.renderers[s.name]=function(...n){let l=s.renderer.apply(this,n);return l===!1&&(l=o.apply(this,n)),l}:r.renderers[s.name]=s.renderer}if("tokenizer"in s){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let o=r[s.level];o?o.unshift(s.tokenizer):r[s.level]=[s.tokenizer],s.start&&(s.level==="block"?r.startBlock?r.startBlock.push(s.start):r.startBlock=[s.start]:s.level==="inline"&&(r.startInline?r.startInline.push(s.start):r.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(r.childTokens[s.name]=s.childTokens)}),a.extensions=r),i.renderer){let s=this.defaults.renderer||new vs(this.defaults);for(let o in i.renderer){if(!(o in s))throw new Error(`renderer '${o}' does not exist`);if(["options","parser"].includes(o))continue;let n=o,l=i.renderer[n],c=s[n];s[n]=(...h)=>{let u=l.apply(s,h);return u===!1&&(u=c.apply(s,h)),u||""}}a.renderer=s}if(i.tokenizer){let s=this.defaults.tokenizer||new Ss(this.defaults);for(let o in i.tokenizer){if(!(o in s))throw new Error(`tokenizer '${o}' does not exist`);if(["options","rules","lexer"].includes(o))continue;let n=o,l=i.tokenizer[n],c=s[n];s[n]=(...h)=>{let u=l.apply(s,h);return u===!1&&(u=c.apply(s,h)),u}}a.tokenizer=s}if(i.hooks){let s=this.defaults.hooks||new Hi;for(let o in i.hooks){if(!(o in s))throw new Error(`hook '${o}' does not exist`);if(["options","block"].includes(o))continue;let n=o,l=i.hooks[n],c=s[n];Hi.passThroughHooks.has(o)?s[n]=h=>{if(this.
Please report this to https://github.com/markedjs/marked.`,t){let a="<p>An error occurred:</p><pre>"+Se(i.message+"",!0)+"</pre>";return r?Promise.resolve(a):a}if(r)return Promise.reject(i);throw i}}},Br=new cS;function Ct(e,t){return Br.parse(e,t)}Ct.options=Ct.setOptions=function(e){return Br.setOptions(e),Ct.defaults=Br.defaults,Ef(Ct.defaults),Ct};Ct.getDefaults=vl;Ct.defaults=Mr;Ct.use=function(...e){return Br.use(...e),Ct.defaults=Br.defaults,Ef(Ct.defaults),Ct};Ct.walkTokens=function(e,t){return Br.walkTokens(e,t)};Ct.parseInline=Br.parseInline;Ct.Parser=ge;Ct.parser=ge.parse;Ct.Renderer=vs;Ct.TextRenderer=Ol;Ct.Lexer=fe;Ct.lexer=fe.lex;Ct.Tokenizer=Ss;Ct.Hooks=Hi;Ct.parse=Ct;Ct.options;Ct.setOptions;Ct.use;Ct.walkTokens;Ct.parseInline;ge.parse;fe.lex;function Wf(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var i=Array.from(typeof e=="string"?[e]:e);i[i.length-1]=i[i.length-1].replace(/\r?\n([\t ]*)$/,"");var a=i.reduce(function(n,l){var c=l.match(/\n([\t ]+|(?!\s).)/g);return c?n.concat(c.map(function(h){var u,p;return(p=(u=h.match(/[\t ]/g))===null||u===void 0?void 0:u.length)!==null&&p!==void 0?p:0})):n},[]);if(a.length){var s=new RegExp(`
[ ]{`+Math.min.apply(Math,a)+"}","g");i=i.map(function(n){return n.replace(s,`
`)})}i[0]=i[0].replace(/^\r?\n/,"");var o=i[0];return t.forEach(function(n,l){var c=o.match(/(?:^|\n)( *)$/),h=c?c[1]:"",u=n;typeof n=="string"&&n.includes(`
`)&&(u=String(n).split(`
`).map(function(p,d){return d===0?p:""+h+p}).join(`
`)),o+=u+i[l+1]}),o}var uS={body:'<g><rect width="80" height="80" style="fill: #087ebf; stroke-width: 0px;"/><text transform="translate(21.16 64.67)" style="fill: #fff; font-family: ArialMT, Arial; font-size: 67.75px;"><tspan x="0" y="0">?</tspan></text></g>',height:80,width:80},_n=new Map,Hf=new Map,dS=f(e=>{for(const t of e){if(!t.name)throw new Error('Invalid icon loader. Must have a "name" property with non-empty string value.');if(R.debug("Registering icon pack:",t.name),"loader"in t)Hf.set(t.name,t.loader);else if("icons"in t)_n.set(t.name,t.icons);else throw R.error("Invalid icon loader:",t),new Error('Invalid icon loader. Must have either "icons" or "loader" property.')}},"registerIconPacks"),Yf=f(async(e,t)=>{const r=pw(e,!0,t!==void 0);if(!r)throw new Error(`Invalid icon name: ${e}`);const i=r.prefix||t;if(!i)throw new Error(`Icon name must contain a prefix: ${e}`);let a=_n.get(i);if(!a){const o=Hf.get(i);if(!o)throw new Error(`Icon set not found: ${r.prefix}`);try{a={...await o(),prefix:i},_n.set(i,a)}catch(n){throw R.error(n),new Error(`Failed to load icon set: ${r.prefix}`)}}const s=mw(a,r.name);if(!s)throw new Error(`Icon not found: ${e}`);return s},"getRegisteredIconData"),pS=f(async e=>{try{return await Yf(e),!0}catch{return!1}},"isIconAvailable"),ka=f(async(e,t,r)=>{let i;try{i=await Yf(e,t?.fallbackPrefix)}catch(o){R.error(o),i=uS}const a=_w(i,t),s=Bw(vw(a.body),{...a.attributes,...r});return be(s,wt())},"getIconSVG");function jf(e,{markdownAutoWrap:t}){const i=e.replace(/<br\/>/g,`
`).replace(/\n{2,}/g,`
`);return Wf(i)}f(jf,"preprocessMarkdown");function Uf(e){return e.split(/\\n|\n|<br\s*\/?>/gi).map(t=>t.trim().match(/<[^>]+>|[^\s<>]+/g)?.map(r=>({content:r,type:"normal"}))??[])}f(Uf,"nonMarkdownToLines");function Gf(e,t={}){const r=jf(e,t),i=Ct.lexer(r),a=[[]];let s=0;function o(n,l="normal"){n.type==="text"?n.text.split(`
`).forEach((h,u)=>{u!==0&&(s++,a.push([])),h.split(" ").forEach(p=>{p=p.replace(/&#39;/g,"'"),p&&a[s].push({content:p,type:l})})}):n.type==="strong"||n.type==="em"?n.tokens.forEach(c=>{o(c,n.type)}):n.type==="html"&&a[s].push({content:n.text,type:"normal"})}return f(o,"processNode"),i.forEach(n=>{n.type==="paragraph"?n.tokens?.forEach(l=>{o(l)}):n.type==="html"?a[s].push({content:n.text,type:"normal"}):a[s].push({content:n.raw,type:"normal"})}),a}f(Gf,"markdownToLines");function Xf(e){return e?`<p>${e.replace(/\\n|\n/g,"<br />")}</p>`:""}f(Xf,"nonMarkdownToHTML");function Vf(e,{markdownAutoWrap:t}={}){const r=Ct.lexer(e);function i(a){return a.type==="text"?t===!1?a.text.replace(/\n */g,"<br/>").replace(/ /g,"&nbsp;"):a.text.replace(/\n */g,"<br/>"):a.type==="strong"?`<strong>${a.tokens?.map(i).join("")}</strong>`:a.type==="em"?`<em>${a.tokens?.map(i).join("")}</em>`:a.type==="paragraph"?`<p>${a.tokens?.map(i).join("")}</p>`:a.type==="space"?"":a.type==="html"?`${a.text}`:a.type==="escape"?a.text:(R.warn(`Unsupported markdown: ${a.type}`),a.raw)}return f(i,"output"),r.map(i).join("")}f(Vf,"markdownToHTML");function Zf(e){return Intl.Segmenter?[...new Intl.Segmenter().segment(e)].map(t=>t.segment):[...e]}f(Zf,"splitTextToChars");function Kf(e,t){const r=Zf(t.content);return Il(e,[],r,t.type)}f(Kf,"splitWordToFitWidth");function Il(e,t,r,i){if(r.length===0)return[{content:t.join(""),type:i},{content:"",type:i}];const[a,...s]=r,o=[...t,a];return e([{content:o.join(""),type:i}])?Il(e,o,s,i):(t.length===0&&a&&(t.push(a),r.shift()),[{content:t.join(""),type:i},{content:r.join(""),type:i}])}f(Il,"splitWordToFitWidthRecursion");function Qf(e,t){if(e.some(({content:r})=>r.includes(`
`)))throw new Error("splitLineToFitWidth does not support newlines in the line");return Bs(e,t)}f(Qf,"splitLineToFitWidth");function Bs(e,t,r=[],i=[]){if(e.length===0)return i.length>0&&r.push(i),r.length>0?r:[];let a="";e[0].content===" "&&(a=" ",e.shift());const s=e.shift()??{content:" ",type:"normal"},o=[...i];if(a!==""&&o.push({content:a,type:"normal"}),o.push(s),t(o))return Bs(e,t,r,o);if(i.length>0)r.push(i),e.unshift(s);else if(s.content){const[n,l]=Kf(t,s);r.push([n]),l.content&&e.unshift(l)}return Bs(e,t,r)}f(Bs,"splitLineToFitWidthRecursion");function wn(e,t){t&&e.attr("style",t)}f(wn,"applyStyle");var _c=16384;async function Jf(e,t,r,i,a=!1,s=wt()){const o=e.append("foreignObject");o.attr("width",`${Math.min(10*r,_c)}px`),o.attr("height",`${Math.min(10*r,_c)}px`);const n=o.append("xhtml:div"),l=Ji(t.label)?await Su(t.label.replace(fa.lineBreakRegex,`
`),s):be(t.label,s),c=t.isNode?"nodeLabel":"edgeLabel",h=n.append("span");h.html(l),wn(h,t.labelStyle),h.attr("class",`${c} ${i}`),wn(n,t.labelStyle),n.style("display","table-cell"),n.style("white-space","nowrap"),n.style("line-height","1.5"),r!==Number.POSITIVE_INFINITY&&(n.style("max-width",r+"px"),n.style("text-align","center")),n.attr("xmlns","http://www.w3.org/1999/xhtml"),a&&n.attr("class","labelBkg");let u=n.node().getBoundingClientRect();return u.width===r&&(n.style("display","table"),n.style("white-space","break-spaces"),n.style("width",r+"px"),u=n.node().getBoundingClientRect()),o.node()}f(Jf,"addHtmlSpan");function Ks(e,t,r,i=!1){const a=e.append("tspan").attr("class","text-outer-tspan").attr("x",0).attr("y",t*r-.1+"em").attr("dy",r+"em");return i&&a.attr("text-anchor","middle"),a}f(Ks,"createTspan");function tg(e,t,r){const i=e.append("text"),a=Ks(i,1,t);Qs(a,r);const s=a.node().getComputedTextLength();return i.remove(),s}f(tg,"computeWidthOfText");function fS(e,t,r){const i=e.append("text"),a=Ks(i,1,t);Qs(a,[{content:r,type:"normal"}]);const s=a.node()?.getBoundingClientRect();return s&&i.remove(),s}f(fS,"computeDimensionOfText");function eg(e,t,r,i=!1,a=!1){const o=t.append("g"),n=o.insert("rect").attr("class","background").attr("style","stroke: none"),l=o.append("text").attr("y","-10.1");a&&l.attr("text-anchor","middle");let c=0;for(const h of r){const u=f(d=>tg(o,1.1,d)<=e,"checkWidth"),p=u(h)?[h]:Qf(h,u);for(const d of p){const g=Ks(l,c,1.1,a);Qs(g,d),c++}}if(i){const h=l.node().getBBox(),u=2;return n.attr("x",h.x-u).attr("y",h.y-u).attr("width",h.width+2*u).attr("height",h.height+2*u),o.node()}else return l.node()}f(eg,"createFormattedText");function Sn(e){const t=/&(amp|lt|gt);/g;return e.replace(t,(r,i)=>{switch(i){case"amp":return"&";case"lt":return"<";case"gt":return">";default:return r}})}f(Sn,"decodeHTMLEntities");function Qs(e,t){e.text(""),t.forEach((r,i)=>{const a=e.append("tspan").attr("font-style",r.type==="em"?"italic":"normal").attr("class","text-inner-tspan").attr("font-weight",r.type==="strong"?"bold":"normal");i===0?a.text(Sn(r.content)):a.text(" "+Sn(r.content))})}f(Qs,"updateTextContentAndStyles");async function rg(e,t={}){const r=[];e.replace(/(fa[bklrs]?):fa-([\w-]+)/g,(a,s,o)=>(r.push((async()=>{const n=`${s}:${o}`;return await pS(n)?await ka(n,void 0,{class:"label-icon"}):`<i class='${be(a,t).replace(":"," ")}'></i>`})()),a));const i=await Promise.all(r);return e.replace(/(fa[bklrs]?):fa-([\w-]+)/g,()=>i.shift()??"")}f(rg,"replaceIconSubstring");var Xe=f(async(e,t="",{style:r="",isTitle:i=!1,classes:a="",useHtmlLabels:s=!0,markdown:o=!0,isNode:n=!0,width:l=200,addSvgBackground:c=!1}={},h)=>{if(R.debug("XYZ createText",t,r,i,a,s,n,"addSvgBackground: ",c),s){const u=o?Vf(t,h):Xf(t),p=await rg(vr(u),h),d=t.replace(/\\\\/g,"\\"),g={isNode:n,label:Ji(t)?d:p,labelStyle:r.replace("fill:","color:")};return await Jf(e,g,l,a,c,h)}else{const u=vr(t.replace(/<br\s*\/?>/g,"<br/>")),p=o?Gf(u.replace("<br>","<br/>"),h):Uf(u),d=eg(l,e,p,t?c:!1,!n);if(n){/stroke:/.exec(r)&&(r=r.replace("stroke:","lineColor:"));const g=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");ct(d).attr("style",g)}else{const g=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/background:/g,"fill:");ct(d).select("rect").attr("style",g.replace(/background:/g,"fill:"));const m=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");ct(d).select("text").attr("style",m)}return i?ct(d).selectAll("tspan.text-outer-tspan").classed("title-row",!0):ct(d).selectAll("tspan.text-outer-tspan").classed("row",!0),d}},"createText");function Ao(e,t,r){if(e&&e.length){const[i,a]=t,s=Math.PI/180*r,o=Math.cos(s),n=Math.sin(s);for(const l of e){const[c,h]=l;l[0]=(c-i)*o-(h-a)*n+i,l[1]=(c-i)*n+(h-a)*o+a}}}function gS(e,t){return e[0]===t[0]&&e[1]===t[1]}function mS(e,t,r,i=1){const a=r,s=Math.max(t,.1),o=e[0]&&e[0][0]&&typeof e[0][0]=="number"?[e]:e,n=[0
M ${a.x},${a.y} L ${o.x},${o.y}`}f(Tg,"createLine");function _g(e,t){const{labelStyles:r,nodeStyles:i}=V(t);t.labelStyle=r,t.label="";const a=e.insert("g").attr("class",tt(t)).attr("id",t.domId??t.id),s=Math.max(30,t?.width??0),{cssStyles:o}=t,n=U.svg(a),l=X(t,{});t.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");const c=n.circle(0,0,s*2,l),h=Tg(s),u=n.path(h,l),p=a.insert(()=>c,":first-child");return p.insert(()=>u),p.attr("class","outer-path"),o&&t.look!=="handDrawn"&&p.selectAll("path").attr("style",o),i&&t.look!=="handDrawn"&&p.selectAll("path").attr("style",i),Z(t,p),t.intersect=function(d){return R.info("crossedCircle intersect",t,{radius:s,point:d}),j.circle(t,s,d)},a}f(_g,"crossedCircle");function Ne(e,t,r,i=100,a=0,s=180){const o=[],n=a*Math.PI/180,h=(s*Math.PI/180-n)/(i-1);for(let u=0;u<i;u++){const p=n+u*h,d=e+r*Math.cos(p),g=t+r*Math.sin(p);o.push({x:-d,y:-g})}return o}f(Ne,"generateCirclePoints");async function wg(e,t){const{labelStyles:r,nodeStyles:i}=V(t);t.labelStyle=r;const{shapeSvg:a,bbox:s,label:o}=await at(e,t,tt(t)),n=t.look==="neo"?18:t.padding??0,l=t.look==="neo"?12:t.padding??0,c=s.width+n,h=s.height+l,u=Math.max(5,h*.1),{cssStyles:p}=t,d=[...Ne(c/2,-h/2,u,30,-90,0),{x:-c/2-u,y:u},...Ne(c/2+u*2,-u,u,20,-180,-270),...Ne(c/2+u*2,u,u,20,-90,-180),{x:-c/2-u,y:-h/2},...Ne(c/2,h/2,u,20,0,90)],g=[{x:c/2,y:-h/2-u},{x:-c/2,y:-h/2-u},...Ne(c/2,-h/2,u,20,-90,0),{x:-c/2-u,y:-u},...Ne(c/2+c*.1,-u,u,20,-180,-270),...Ne(c/2+c*.1,u,u,20,-90,-180),{x:-c/2-u,y:h/2},...Ne(c/2,h/2,u,20,0,90),{x:-c/2,y:h/2+u},{x:c/2,y:h/2+u}],m=U.svg(a),y=X(t,{fill:"none"});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const b=pt(d).replace("Z",""),k=m.path(b,y),_=pt(g),w=m.path(_,{...y}),v=a.insert("g",":first-child");return v.insert(()=>w,":first-child").attr("stroke-opacity",0),v.insert(()=>k,":first-child"),v.attr("class","text"),p&&t.look!=="handDrawn"&&v.selectAll("path").attr("style",p),i&&t.look!=="handDrawn"&&v.selectAll("path").attr("style",i),v.attr("transform",`translate(${u}, 0)`),o.attr("transform",`translate(${-c/2+u-(s.x-(s.left??0))},${-h/2+(t.padding??0)/2-(s.y-(s.top??0))})`),Z(t,v),t.intersect=function(E){return j.polygon(t,g,E)},a}f(wg,"curlyBraceLeft");function qe(e,t,r,i=100,a=0,s=180){const o=[],n=a*Math.PI/180,h=(s*Math.PI/180-n)/(i-1);for(let u=0;u<i;u++){const p=n+u*h,d=e+r*Math.cos(p),g=t+r*Math.sin(p);o.push({x:d,y:g})}return o}f(qe,"generateCirclePoints");async function Sg(e,t){const{labelStyles:r,nodeStyles:i}=V(t);t.labelStyle=r;const{shapeSvg:a,bbox:s,label:o}=await at(e,t,tt(t)),n=t.look==="neo"?18:t.padding??0,l=t.look==="neo"?12:t.padding??0,c=s.width+(t.look==="neo"?n*2:n),h=s.height+(t.look==="neo"?l*2:l),u=Math.max(5,h*.1),{cssStyles:p}=t,d=[...qe(c/2,-h/2,u,20,-90,0),{x:c/2+u,y:-u},...qe(c/2+u*2,-u,u,20,-180,-270),...qe(c/2+u*2,u,u,20,-90,-180),{x:c/2+u,y:h/2},...qe(c/2,h/2,u,20,0,90)],g=[{x:-c/2,y:-h/2-u},{x:c/2,y:-h/2-u},...qe(c/2,-h/2,u,20,-90,0),{x:c/2+u,y:-u},...qe(c/2+u*2,-u,u,20,-180,-270),...qe(c/2+u*2,u,u,20,-90,-180),{x:c/2+u,y:h/2},...qe(c/2,h/2,u,20,0,90),{x:c/2,y:h/2+u},{x:-c/2,y:h/2+u}],m=U.svg(a),y=X(t,{fill:"none"});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const b=pt(d).replace("Z",""),k=m.path(b,y),_=pt(g),w=m.path(_,{...y}),v=a.insert("g",":first-child");return v.insert(()=>w,":first-child").attr("stroke-opacity",0),v.insert(()=>k,":first-child"),v.attr("class","text"),p&&t.look!=="handDrawn"&&v.selectAll("path").attr("style",p),i&&t.look!=="handDrawn"&&v.selectAll("path").attr("style",i),v.attr("transform",`translate(${-u}, 0)`),o.attr("transform",`translate(${-c/2+(t.padding??0)/2-(s.x-(s.left??0))},${-h/2+(t.padding??0)/2-(s.y-(s.top??0))})`),Z(t,v),t.intersect=function(E){return j.polygon(t,g,E)},a}f(Sg,"curlyBraceRight");function Nt(e,t,r,i=100,a=0,s=180){const o=[],n=a*Math.PI/180,h=(s*Math.PI/180-n)/(i-1);for(let u=0;u<i;u++){const p=n+u*h,d=e+r*Math.cos(p),g=t+r*Math.sin(p);o.push({x:-d,y:-g})}return o}f(Nt,"generateCirclePoints");async function vg(e,t){const{labelStyles:r,nodeStyles:i}=V(t);t.labelStyle=r;const{s
a${a},${s} 0,0,1 0,${-i}
l${r},0
a${a},${s} 0,0,1 0,${i}
M${r},${-i}
a${a},${s} 0,0,0 0,${i}
l${-r},0`,"createCylinderPathD"),JS=f((e,t,r,i,a,s)=>[`M${e},${t}`,`M${e+r},${t}`,`a${a},${s} 0,0,0 0,${-i}`,`l${-r},0`,`a${a},${s} 0,0,0 0,${i}`,`l${r},0`].join(" "),"createOuterCylinderPathD"),tv=f((e,t,r,i,a,s)=>[`M${e+r/2},${-i/2}`,`a${a},${s} 0,0,0 0,${i}`].join(" "),"createInnerCylinderPathD"),Rc=5,Nc=10;async function pm(e,t){const{labelStyles:r,nodeStyles:i}=V(t);t.labelStyle=r;const a=t.padding??0,s=t.look==="neo"?12:a/2;if(t.width||t.height){const m=t.height??0;t.height=(t.height??0)-s,t.height<Rc&&(t.height=Rc);const x=m/2/(2.5+m/50);t.width=(t.width??0)-s-x*3,t.width<Nc&&(t.width=Nc)}const{shapeSvg:o,bbox:n,label:l}=await at(e,t,tt(t)),c=(t.height?t.height:n.height)+s,h=c/2,u=h/(2.5+c/50),p=(t.width?t.width:n.width)+u+s,{cssStyles:d}=t;let g;if(t.look==="handDrawn"){const m=U.svg(o),y=JS(0,0,p,c,u,h),x=tv(0,0,p,c,u,h),b=m.path(y,X(t,{})),k=m.path(x,X(t,{fill:"none"}));g=o.insert(()=>k,":first-child"),g=o.insert(()=>b,":first-child"),g.attr("class","basic label-container"),d&&g.attr("style",d)}else{const m=QS(0,0,p,c,u,h);g=o.insert("path",":first-child").attr("d",m).attr("class","basic label-container").attr("style",Pt(d)).attr("style",i),g.attr("class","basic label-container outer-path"),d&&g.selectAll("path").attr("style",d),i&&g.selectAll("path").attr("style",i)}return g.attr("label-offset-x",u),g.attr("transform",`translate(${-p/2}, ${c/2} )`),l.attr("transform",`translate(${-(n.width/2)-u-(n.x-(n.left??0))}, ${-(n.height/2)-(n.y-(n.top??0))})`),Z(t,g),t.intersect=function(m){const y=j.rect(t,m),x=y.y-(t.y??0);if(h!=0&&(Math.abs(x)<(t.height??0)/2||Math.abs(x)==(t.height??0)/2&&Math.abs(y.x-(t.x??0))>(t.width??0)/2-u)){let b=u*u*(1-x*x/(h*h));b!=0&&(b=Math.sqrt(Math.abs(b))),b=u-b,m.x-(t.x??0)>0&&(b=-b),y.x+=b}return y},o}f(pm,"tiltedCylinder");async function fm(e,t){const{labelStyles:r,nodeStyles:i}=V(t);t.labelStyle=r;const a=t.padding??0,s=(t.look==="neo",a),o=t.look==="neo"?a*2:a,{shapeSvg:n,bbox:l}=await at(e,t,tt(t)),c=(t?.height??l.height)+s,h=(t?.width??l.width)+o,u=[{x:-3*c/6,y:0},{x:h+3*c/6,y:0},{x:h,y:-c},{x:0,y:-c}];let p;const{cssStyles:d}=t;if(t.look==="handDrawn"){const g=U.svg(n),m=X(t,{}),y=pt(u),x=g.path(y,m);p=n.insert(()=>x,":first-child").attr("transform",`translate(${-h/2}, ${c/2})`),d&&p.attr("style",d)}else p=Ve(n,h,c,u);return i&&p.attr("style",i),t.width=h,t.height=c,Z(t,p),t.intersect=function(g){return j.polygon(t,u,g)},n}f(fm,"trapezoid");async function gm(e,t){const{labelStyles:r,nodeStyles:i}=V(t);t.labelStyle=r;const a=t.padding??0,s=t.look==="neo"?16:a,o=t.look==="neo"?12:a,n=15,l=5;(t.width||t.height)&&(t.height=(t.height??0)-o*2,t.height<l&&(t.height=l),t.width=(t.width??0)-s*2,t.width<n&&(t.width=n));const{shapeSvg:c,bbox:h}=await at(e,t,tt(t)),u=(t?.width?t?.width:h.width)+s*2,p=(t?.height?t?.height:h.height)+o*2,{cssStyles:d}=t,g=U.svg(c),m=X(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=[{x:-u/2*.8,y:-p/2},{x:u/2*.8,y:-p/2},{x:u/2,y:-p/2*.6},{x:u/2,y:p/2},{x:-u/2,y:p/2},{x:-u/2,y:-p/2*.6}],x=pt(y),b=g.path(x,m),k=c.insert(()=>b,":first-child");return k.attr("class","basic label-container outer-path"),d&&t.look!=="handDrawn"&&k.selectChildren("path").attr("style",d),i&&t.look!=="handDrawn"&&k.selectChildren("path").attr("style",i),Z(t,k),t.intersect=function(_){return j.polygon(t,y,_)},c}f(gm,"trapezoidalPentagon");var qc=10,zc=10;async function mm(e,t){const{labelStyles:r,nodeStyles:i}=V(t);t.labelStyle=r;const a=t.padding??0,s=t.look==="neo"?a*2:a;(t.width||t.height)&&(t.width=((t?.width??0)-s)/2,t.width<zc&&(t.width=zc),t.height=t?.height??0,t.height<qc&&(t.height=qc));const{shapeSvg:o,bbox:n,label:l}=await at(e,t,tt(t)),c=Ue(mt().flowchart?.htmlLabels),h=(t?.width?t?.width:n.width)+s,u=t?.height?t?.height:h+n.height,p=u,d=[{x:0,y:0},{x:p,y:0},{x:p/2,y:-u}],{cssStyles:g}=t,m=U.svg(o),y=X(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const x=pt(d),b=m.path(x,y),k=o.insert(()=>b,":first-child").attr("transform",`translate(${-u/2}, ${u/2})`).attr("class","outer-path");return g&&t.look!=="handDrawn"&&k.selectChildren("pa
M${d-St},${g} L${d+u},${g}
M${d},${g-St} L${d},${g+p}`;t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const _=y.path(k,x),w=o.insert(()=>_,":first-child");return w.attr("transform",`translate(${St/2}, ${St/2})`),w.attr("class","basic label-container outer-path"),m&&t.look!=="handDrawn"&&w.selectAll("path").attr("style",m),i&&t.look!=="handDrawn"&&w.selectAll("path").attr("style",i),l.attr("transform",`translate(${-(n.width/2)+St/2-(n.x-(n.left??0))}, ${-(n.height/2)+St/2-(n.y-(n.top??0))})`),Z(t,w),t.intersect=function(v){return j.polygon(t,b,v)},o}f(xm,"windowPane");var Wc=new Set(["redux-color","redux-dark-color"]),ev=new Set(["redux","redux-dark","redux-color","redux-dark-color"]);async function Nl(e,t){const r=t;r.alias&&(t.label=r.alias);const{theme:i,themeVariables:a}=wt(),{rowEven:s,rowOdd:o,nodeBorder:n,borderColorArray:l}=a;if(t.look==="handDrawn"){const{themeVariables:rt}=wt(),{background:ht}=rt,ft={...t,id:t.id+"-background",domId:(t.domId||t.id)+"-background",look:"default",cssStyles:["stroke: none",`fill: ${ht}`]};await Nl(e,ft)}const c=wt();t.useHtmlLabels=c.htmlLabels;let h=c.er?.diagramPadding??10,u=c.er?.entityPadding??6;const{cssStyles:p}=t,{labelStyles:d,nodeStyles:g}=V(t);if(r.attributes.length===0&&t.label){const rt={rx:0,ry:0,labelPaddingX:h,labelPaddingY:h*1.5};Ye(t.label,c)+rt.labelPaddingX*2<c.er.minEntityWidth&&(t.width=c.er.minEntityWidth);const ht=await _a(e,t,rt);if(i!=null&&Wc.has(i)){const ft=r.colorIndex??0;ht.attr("data-color-id",`color-${ft%l.length}`)}if(!Ue(c.htmlLabels)){const ft=ht.select("text"),Tt=ft.node()?.getBBox();ft.attr("transform",`translate(${-Tt.width/2}, 0)`)}return ht}c.htmlLabels||(h*=1.25,u*=1.25);let m=tt(t);m||(m="node default");const y=e.insert("g").attr("class",m).attr("id",t.domId||t.id),x=await Yr(y,t.label??"",c,0,0,["name"],d);x.height+=u;let b=0;const k=[],_=[];let w=0,v=0,E=0,B=0,N=!0,D=!0;for(const rt of r.attributes){const ht=await Yr(y,rt.type,c,0,b,["attribute-type"],d);w=Math.max(w,ht.width+h);const ft=await Yr(y,rt.name,c,0,b,["attribute-name"],d);v=Math.max(v,ft.width+h);const Tt=await Yr(y,rt.keys.join(),c,0,b,["attribute-keys"],d);E=Math.max(E,Tt.width+h);const xt=await Yr(y,rt.comment,c,0,b,["attribute-comment"],d);B=Math.max(B,xt.width+h);const Lt=Math.max(ht.height,ft.height,Tt.height,xt.height)+u;_.push({yOffset:b,rowHeight:Lt}),b+=Lt}let O=4;E<=h&&(N=!1,E=0,O--),B<=h&&(D=!1,B=0,O--);const W=y.node().getBBox();if(x.width+h*2-(w+v+E+B)>0){const rt=x.width+h*2-(w+v+E+B);w+=rt/O,v+=rt/O,E>0&&(E+=rt/O),B>0&&(B+=rt/O)}const z=w+v+E+B,I=U.svg(y),F=X(t,{});t.look!=="handDrawn"&&(F.roughness=0,F.fillStyle="solid");let L=0;_.length>0&&(L=_.reduce((rt,ht)=>rt+(ht?.rowHeight??0),0));const M=Math.max(W.width+h*2,t?.width||0,z),P=Math.max((L??0)+x.height,t?.height||0),H=-M/2,Y=-P/2;if(y.selectAll("g:not(:first-child)").each((rt,ht,ft)=>{const Tt=ct(ft[ht]),xt=Tt.attr("transform");let Lt=0,ue=0;if(xt){const Ie=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(xt);Ie&&(Lt=parseFloat(Ie[1]),ue=parseFloat(Ie[2]),Tt.attr("class").includes("attribute-name")?Lt+=w:Tt.attr("class").includes("attribute-keys")?Lt+=w+v:Tt.attr("class").includes("attribute-comment")&&(Lt+=w+v+E))}Tt.attr("transform",`translate(${H+h/2+Lt}, ${ue+Y+x.height+u/2})`)}),y.select(".name").attr("transform","translate("+-x.width/2+", "+(Y+u/2)+")"),i!=null&&Wc.has(i)){const rt=r.colorIndex??0;y.attr("data-color-id",`color-${rt%l.length}`)}const Q=I.rectangle(H,Y,M,P,F),dt=y.insert(()=>Q,":first-child").attr("class","outer-path").attr("style",p.join(""));k.push(0);for(const[rt,ht]of _.entries()){const Tt=(rt+1)%2===0&&ht.yOffset!==0,xt=I.rectangle(H,x.height+Y+ht?.yOffset,M,ht?.rowHeight,{...F,fill:Tt?s:o,stroke:n});y.insert(()=>xt,"g.label").attr("style",p.join("")).attr("class",`row-rect-${Tt?"even":"odd"}`)}const et=1e-4;let ut=jr(H,x.height+Y,M+H,x.height+Y,et),it=I.polygon(ut.map(rt=>[rt.x,rt.y]),F);if(y.insert(()=>it).attr("class","divider"),ut=jr(w+H,x.height+Y,w+H,P+Y,et),it=I.polygon(ut.map(rt=>[rt.x,rt.y]),F),y.insert(()=>it).attr("class","divider"),N){const rt=w+v+H;ut=jr(rt,x.height+Y,rt,P
a${h},${h} 1 0,0 ${g*.25},${-1*m*.1}
a${h},${h} 1 0,0 ${g*.25},0
a${h},${h} 1 0,0 ${g*.25},0
a${h},${h} 1 0,0 ${g*.25},${m*.1}
a${h},${h} 1 0,0 ${g*.15},${m*.33}
a${h*.8},${h*.8} 1 0,0 0,${m*.34}
a${h},${h} 1 0,0 ${-1*g*.15},${m*.33}
a${h},${h} 1 0,0 ${-1*g*.25},${m*.15}
a${h},${h} 1 0,0 ${-1*g*.25},0
a${h},${h} 1 0,0 ${-1*g*.25},0
a${h},${h} 1 0,0 ${-1*g*.25},${-1*m*.15}
a${h},${h} 1 0,0 ${-1*g*.1},${-1*m*.33}
a${h*.8},${h*.8} 1 0,0 0,${-1*m*.34}
a${h},${h} 1 0,0 ${g*.1},${-1*m*.33}
H0 V0 Z`;if(t.look==="handDrawn"){const b=U.svg(a),k=X(t,{}),_=b.path(x,k);y=a.insert(()=>_,":first-child"),y.attr("class","basic label-container").attr("style",Pt(u))}else y=a.insert("path",":first-child").attr("class","basic label-container").attr("style",i).attr("d",x);return y.attr("transform",`translate(${-g/2}, ${-m/2})`),Z(t,y),t.calcIntersect=function(b,k){return j.rect(b,k)},t.intersect=function(b){return R.info("Bang intersect",t,b),j.rect(t,b)},a}f(wm,"bang");async function Sm(e,t){const{labelStyles:r,nodeStyles:i}=V(t);t.labelStyle=r;const{shapeSvg:a,bbox:s,halfPadding:o,label:n}=await at(e,t,tt(t)),l=s.width+2*o,c=s.height+2*o,h=.15*l,u=.25*l,p=.35*l,d=.2*l,{cssStyles:g}=t;let m;const y=`M0 0
a${h},${h} 0 0,1 ${l*.25},${-1*l*.1}
a${p},${p} 1 0,1 ${l*.4},${-1*l*.1}
a${u},${u} 1 0,1 ${l*.35},${l*.2}
a${h},${h} 1 0,1 ${l*.15},${c*.35}
a${d},${d} 1 0,1 ${-1*l*.15},${c*.65}
a${u},${h} 1 0,1 ${-1*l*.25},${l*.15}
a${p},${p} 1 0,1 ${-1*l*.5},0
a${h},${h} 1 0,1 ${-1*l*.25},${-1*l*.15}
a${h},${h} 1 0,1 ${-1*l*.1},${-1*c*.35}
a${d},${d} 1 0,1 ${l*.1},${-1*c*.65}
H0 V0 Z`;if(t.look==="handDrawn"){const x=U.svg(a),b=X(t,{}),k=x.path(y,b);m=a.insert(()=>k,":first-child"),m.attr("class","basic label-container").attr("style",Pt(g))}else m=a.insert("path",":first-child").attr("class","basic label-container").attr("style",i).attr("d",y);return n.attr("transform",`translate(${-s.width/2}, ${-s.height/2})`),m.attr("transform",`translate(${-l/2}, ${-c/2})`),Z(t,m),t.calcIntersect=function(x,b){return j.rect(x,b)},t.intersect=function(x){return R.info("Cloud intersect",t,x),j.rect(t,x)},a}f(Sm,"cloud");async function vm(e,t){const{labelStyles:r,nodeStyles:i}=V(t);t.labelStyle=r;const{shapeSvg:a,bbox:s,halfPadding:o,label:n}=await at(e,t,tt(t)),l=s.width+8*o,c=s.height+2*o,h=5,u=t.look==="neo"?`
M${-l/2} ${c/2-h}
v${-c+2*h}
q0,-${h} ${h},-${h}
h${l-2*h}
q${h},0 ${h},${h}
v${c-h}
H${-l/2}
Z
`:`
M${-l/2} ${c/2-h}
v${-c+2*h}
q0,-${h} ${h},-${h}
h${l-2*h}
q${h},0 ${h},${h}
v${c-2*h}
q0,${h} ${-h},${h}
h${-(l-2*h)}
q${-h},0 ${-h},${-h}
Z
`;if(!t.domId)throw new Error(`defaultMindmapNode: node "${t.id}" is missing a domId was render.ts domId prefixing skipped?`);const p=a.append("path").attr("id",t.domId).attr("class","node-bkg node-"+t.type).attr("style",i).attr("d",u);return a.append("line").attr("class","node-line-").attr("x1",-l/2).attr("y1",c/2).attr("x2",l/2).attr("y2",c/2),n.attr("transform",`translate(${-s.width/2}, ${-s.height/2})`),a.append(()=>n.node()),Z(t,p),t.calcIntersect=function(d,g){return j.rect(d,g)},t.intersect=function(d){return j.rect(t,d)},a}f(vm,"defaultMindmapNode");async function Bm(e,t){const r={padding:t.padding??0};return Rl(e,t,r)}f(Bm,"mindmapCircle");var iv=[{semanticName:"Process",name:"Rectangle",shortName:"rect",description:"Standard process shape",aliases:["proc","process","rectangle"],internalAliases:["squareRect"],handler:am},{semanticName:"Event",name:"Rounded Rectangle",shortName:"rounded",description:"Represents an event",aliases:["event"],internalAliases:["roundedRect"],handler:em},{semanticName:"Terminal Point",name:"Stadium",shortName:"stadium",description:"Terminal point",aliases:["terminal","pill"],handler:sm},{semanticName:"Subprocess",name:"Framed Rectangle",shortName:"fr-rect",description:"Subprocess",aliases:["subprocess","subproc","framed-rectangle","subroutine"],handler:hm},{semanticName:"Database",name:"Cylinder",shortName:"cyl",description:"Database storage",aliases:["db","database","cylinder"],handler:Lg},{semanticName:"Start",name:"Circle",shortName:"circle",description:"Starting point",aliases:["circ"],handler:Rl},{semanticName:"Bang",name:"Bang",shortName:"bang",description:"Bang",aliases:["bang"],handler:wm},{semanticName:"Cloud",name:"Cloud",shortName:"cloud",description:"cloud",aliases:["cloud"],handler:Sm},{semanticName:"Decision",name:"Diamond",shortName:"diam",description:"Decision-making step",aliases:["decision","diamond","question"],handler:Qg},{semanticName:"Prepare Conditional",name:"Hexagon",shortName:"hex",description:"Preparation or condition step",aliases:["hexagon","prepare"],handler:Ig},{semanticName:"Data Input/Output",name:"Lean Right",shortName:"lean-r",description:"Represents input or output",aliases:["lean-right","in-out"],internalAliases:["lean_right"],handler:jg},{semanticName:"Data Input/Output",name:"Lean Left",shortName:"lean-l",description:"Represents output or input",aliases:["lean-left","out-in"],internalAliases:["lean_left"],handler:Yg},{semanticName:"Priority Action",name:"Trapezoid Base Bottom",shortName:"trap-b",description:"Priority action",aliases:["priority","trapezoid-bottom","trapezoid"],handler:fm},{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:Wg},{semanticName:"Stop",name:"Double Circle",shortName:"dbl-circ",description:"Represents a stop point",aliases:["double-circle"],internalAliases:["doublecircle"],handler:Ag},{semanticName:"Text Block",name:"Text Block",shortName:"text",description:"Text block",handler:dm},{semanticName:"Card",name:"Notched Rectangle",shortName:"notch-rect",description:"Represents a card",aliases:["card","notched-rectangle"],handler:bg},{semanticName:"Lined/Shaded Process",name:"Lined Rectangle",shortName:"lin-rect",description:"Lined process shape",aliases:["lined-rectangle","lined-process","lin-proc","shaded-process"],handler:rm},{semanticName:"Start",name:"Small Circle",shortName:"sm-circ",description:"Small starting point",aliases:["start","small-circle"],internalAliases:["stateStart"],handler:lm},{semanticName:"Stop",name:"Framed Circle",shortName:"fr-circ",description:"Stop point",aliases:["stop","framed-circle"],internalAliases:["stateEnd"],handler:nm},{semanticName:"Fork/Join",name:"Filled Rectangle",shortName:"fork",description:"Fork or join in process flow",aliases:["join"],internalAliases:["forkJoin"],handler:$g},{semanticName:"Collate",name:"Hourglass",shortName:"hourglass",description:"Represents a collate operation",aliases:["hourglass","collate"],handl
outsidePoint: ${JSON.stringify(t)}
insidePoint : ${JSON.stringify(r)}
node : x:${e.x} y:${e.y} w:${e.width} h:${e.height}`);const i=e.x,a=e.y,s=Math.abs(i-r.x),o=e.width/2;let n=r.x<t.x?o-s:o+s;const l=e.height/2,c=Math.abs(t.y-r.y),h=Math.abs(t.x-r.x);if(Math.abs(a-t.y)*o>Math.abs(i-t.x)*l){let u=r.y<t.y?t.y-l-a:a-l-t.y;n=h*u/c;const p={x:r.x<t.x?r.x+n:r.x-h+n,y:r.y<t.y?r.y+c-u:r.y-c+u};return n===0&&(p.x=t.x,p.y=t.y),h===0&&(p.x=t.x),c===0&&(p.y=t.y),R.debug(`abc89 top/bottom calc, Q ${c}, q ${u}, R ${h}, r ${n}`,p),p}else{r.x<t.x?n=t.x-o-i:n=i-o-t.x;let u=c*n/h,p=r.x<t.x?r.x+h-n:r.x-h+n,d=r.y<t.y?r.y+u:r.y-u;return R.debug(`sides calc abc89, Q ${c}, q ${u}, R ${h}, r ${n}`,{_x:p,_y:d}),n===0&&(p=t.x,d=t.y),h===0&&(p=t.x),c===0&&(d=t.y),{x:p,y:d}}},"intersection"),Yc=f((e,t)=>{R.warn("abc88 cutPathAtIntersect",e,t);let r=[],i=e[0],a=!1;return e.forEach(s=>{if(R.info("abc88 checking point",s,t),!dv(t,s)&&!a){const o=pv(t,i,s);R.debug("abc88 inside",s,i,o),R.debug("abc88 intersection",o,t);let n=!1;r.forEach(l=>{n=n||l.x===o.x&&l.y===o.y}),r.some(l=>l.x===o.x&&l.y===o.y)?R.warn("abc88 no intersect",o,r):r.push(o),a=!0}else R.warn("abc88 outside",s,i),i=s,a||r.push(s)}),R.debug("returning points",r),r},"cutPathAtIntersect");function Am(e){const t=[],r=[];for(let i=1;i<e.length-1;i++){const a=e[i-1],s=e[i],o=e[i+1];(a.x===s.x&&s.y===o.y&&Math.abs(s.x-o.x)>5&&Math.abs(s.y-a.y)>5||a.y===s.y&&s.x===o.x&&Math.abs(s.x-a.x)>5&&Math.abs(s.y-o.y)>5)&&(t.push(s),r.push(i))}return{cornerPoints:t,cornerPointPositions:r}}f(Am,"extractCornerPoints");var jc=f(function(e,t,r){const i=t.x-e.x,a=t.y-e.y,s=Math.sqrt(i*i+a*a),o=r/s;return{x:t.x-o*i,y:t.y-o*a}},"findAdjacentPoint"),fv=f(function(e){const{cornerPointPositions:t}=Am(e),r=[];for(let i=0;i<e.length;i++)if(t.includes(i)){const a=e[i-1],s=e[i+1],o=e[i],n=jc(a,o,5),l=jc(s,o,5),c=l.x-n.x,h=l.y-n.y;r.push(n);const u=Math.sqrt(2)*2;let p={x:o.x,y:o.y};if(Math.abs(s.x-a.x)>10&&Math.abs(s.y-a.y)>=10){R.debug("Corner point fixing",Math.abs(s.x-a.x),Math.abs(s.y-a.y));const d=5;o.x===n.x?p={x:c<0?n.x-d+u:n.x+d-u,y:h<0?n.y-u:n.y+u}:p={x:c<0?n.x-u:n.x+u,y:h<0?n.y-d+u:n.y+d-u}}else R.debug("Corner point skipping fixing",Math.abs(s.x-a.x),Math.abs(s.y-a.y));r.push(p,l)}else r.push(e[i]);return r},"fixCorners"),gv=f((e,t,r)=>{const i=e-t-r,a=2,s=2,o=a+s,n=Math.floor(i/o),l=Array(n).fill(`${a} ${s}`).join(" ");return`0 ${t} ${l} ${r}`},"generateDashArray"),mv=f(function(e,t,r,i,a,s,o,n=!1){if(!o)throw new Error(`insertEdge: missing diagramId for edge "${t.id}" edge IDs require a diagram prefix for uniqueness`);const{handDrawnSeed:l}=mt();let c=t.points,h=!1;const u=a;var p=s;const d=[];for(const M in t.cssCompiledStyles)Ff(M)||d.push(t.cssCompiledStyles[M]);R.debug("UIO intersect check",t.points,p.x,u.x),p.intersect&&u.intersect&&!n&&(c=c.slice(1,t.points.length-1),c.unshift(u.intersect(c[0])),R.debug("Last point UIO",t.start,"-->",t.end,c[c.length-1],p,p.intersect(c[c.length-1])),c.push(p.intersect(c[c.length-1])));const g=btoa(JSON.stringify(c));t.toCluster&&(R.info("to cluster abc88",r.get(t.toCluster)),c=Yc(t.points,r.get(t.toCluster).node),h=!0),t.fromCluster&&(R.debug("from cluster abc88",r.get(t.fromCluster),JSON.stringify(c,null,2)),c=Yc(c.reverse(),r.get(t.fromCluster).node).reverse(),h=!0);let m=c.filter(M=>!Number.isNaN(M.y));const y=hv(t.curve);y!=="rounded"&&(m=fv(m));let x=Vi;switch(y){case"linear":x=Vi;break;case"basis":x=en;break;case"cardinal":x=ld;break;case"bumpX":x=id;break;case"bumpY":x=ad;break;case"catmullRom":x=cd;break;case"monotoneX":x=md;break;case"monotoneY":x=yd;break;case"natural":x=xd;break;case"step":x=bd;break;case"stepAfter":x=Td;break;case"stepBefore":x=kd;break;case"rounded":x=Vi;break;default:x=en}const{x:b,y:k}=c2(t),_=G1().x(b).y(k).curve(x);let w;switch(t.thickness){case"normal":w="edge-thickness-normal";break;case"thick":w="edge-thickness-thick";break;case"invisible":w="edge-thickness-invisible";break;default:w="edge-thickness-normal"}switch(t.pattern){case"solid":w+=" edge-pattern-solid";break;case"dotted":w+=" edge-pattern-dotted";break;case"dashed":w+=" edge-pattern-dashed";break;default:w+=" edge-pattern-s
L20,10
M20,10
L0,20`)},"requirement_arrow"),Pv=f((e,t,r)=>{const i=wt(),{themeVariables:a}=i,{strokeWidth:s}=a;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",`${s}`).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"),Rv=f((e,t,r)=>{const i=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");i.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),i.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),i.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10)},"requirement_contains"),Nv=f((e,t,r)=>{const i=wt(),{themeVariables:a}=i,{strokeWidth:s}=a,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",`${s}`)},"requirement_contains_neo"),qv={extension:Cv,composition:xv,aggregation:bv,dependency:kv,lollipop:Tv,point:_v,circle:wv,cross:Sv,barb:vv,barbNeo:Bv,only_one:Lv,zero_or_one:Fv,one_or_more:Av,zero_or_more:Ev,only_one_neo:Mv,zero_or_one_neo:$v,one_or_more_neo:Ov,zero_or_more_neo:Iv,requirement_arrow:Dv,requirement_contains:Rv,requirement_arrow_neo:Pv,requirement_contains_neo:Nv},zv=yv,Wv={common:fa,getConfig:wt,insertCluster:NS,insertEdge:mv,insertEdgeLabel:cv,insertMarkers:zv,insertNode:Fm,interpolateToCurve:xl,labelHelper:at,log:R,positionEdgeLabel:uv},ua={},$m=f(e=>{for(const t of e)ua[t.name]=t},"registerLayoutLoaders"),Hv=f(()=>{$m([{name:"dagre",loader:f(async()=>await gt(()=>import("./dagre-KV5264BT.Dzyh3PBi.js"),__vite__mapDeps([0,1,2,3,4,5,6])),"loader")},{name:"cose-bilkent",loader:f(async()=>await gt(()=>import("./cose-bilkent-S5V4N54A.BTJXqd_j.js"),__vite__mapDeps([7,8,6])),"loader")}])},"registerDefaultLayoutLoaders");Hv();var jA=f(async(e,t)=>{if(!(e.layoutAlgorithm in ua))throw new Error(`Unknown layout algorithm: ${e.layoutAlgorithm}`);if(e.diagramId)for(const h of e.nodes){const u=h.domId||h.id;h.domId=`${e.diagramId}-${u}`}const r=ua[e.layoutAlgorithm],i=await r.loader(),{theme:a,themeVariables:s}=e.config,{useGradient:o,gradientStart:n,gradientStop:l}=s,c=t.attr("id");if(t.append("defs").append("filter").attr("id",`${c}-drop-shadow`).attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${a?.includes("dark")?"#FFFFFF":"#000000"}`),t.append("defs").append("filter").attr("id",`${c}-drop-shadow-small`).attr("height","150%").attr("width","150%").append("feDropShadow").attr("dx","2").attr("dy","2").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${a?.includes("dark")?"#FFFFFF":"#000000"}`),o){const h=t.append("linearGradient").attr("id",t.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");h.append("svg:stop").attr("offset","0%").attr("stop-color",n).attr("stop-opacity",1),h.append("svg:stop").attr("offset","100%").attr("stop-color",l).attr("stop-opacity",1)}return i.render(e,t,Wv,{algorithm:r.algorithm})},"render"),UA=f((e="",{fallback:t="dagre"}={})=>{if(e in ua)return e;if(t in ua)return R.warn(`Layout algorithm ${e} is not registered. Using ${t} as fallback.`),t;throw new Error(`Both layout algorithms ${e} and ${t} are not registered.`)},"getRegisteredLayoutAlgorithm"),Om="comm",Im="rule",Dm="decl",Yv="@import",jv="@namespace",Uv="@keyframes",Gv="@layer",Xv=Math.abs,Qi=String.fromCharCode;function Pm(e){return e.trim()}function $n(e,t,r){return e.replace(t,r)}function Vr(e,t){return e.charCodeAt(t)|0}function mi(e,t,r){return e.slice(t,r)}function Be(e){return e.length}function Vv(e){return e.length}function qa(e,t){return t.push(e),e}var eo=1,yi=1,Rm=0,ce=0,At=0,Ti="";function ql(e,t,r,i,a,s,o,n){return{va
`);const i=rk(t),a=i.append("g");i.attr("viewBox","0 0 2412 512"),vu(i,100,512,!0),a.append("path").attr("class","error-icon").attr("d","m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z"),a.append("path").attr("class","error-icon").attr("d","m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z"),a.append("path").attr("class","error-icon").attr("d","m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z"),a.append("path").attr("class","error-icon").attr("d","m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z"),a.append("path").attr("class","error-icon").attr("d","m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z"),a.append("path").attr("class","error-icon").attr("d","m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z"),a.append("text").attr("class","error-text").attr("x",1440).attr("y",250).attr("font-size","150px").style("text-anchor","middle").text("Syntax error in text"),a.append("text").attr("class","error-text").attr("x",1250).attr("y",400).attr("font-size","100px").style("text-anchor","middle").text(`mermaid version ${r}`)},"draw"),ry={draw:$L},OL=ry,IL={db:{},renderer:ry,parser:{parse:f(()=>{},"parse")}},DL=IL,iy="flowchart-elk",PL=f((e,t={})=>/^\s*flowchart-elk/.test(e)||/^\s*(flowchart|graph)/.test(e)&&t?.flowchart?.defaultRenderer==="elk"?(t.layout="elk",!0):!1,"detector"),RL=f(async()=>{const{diagram:e}=await gt(async()=>{const{diagram:t}=await import("./flowDiagram-DWJPFMVM.BOiZuCBe.js");return{diagram:t}},__vite__mapDeps([11,12,10,13,14,15,6]));return{id:iy,diagram:e}},"loader"),NL={id:iy,detector:PL,loader:RL},qL=NL,ay="timeline",zL=f(e=>/^\s*timeline/.test(e),"detector"),WL=f(async()=>{const{diagram:e}=await gt(async()=>{const{diagram:t}=await import("./timeline-definition-GMOUNBTQ.BsGTkzdk.js");return{diagram:t}},__vite__mapDeps([40,27,6]));return{id:ay,diagram:e}},"loader"),HL={id:ay,detector:zL,loader:WL},YL=HL,sy="mindmap",jL=f(e=>/^\s*mindmap/.test(e),"detector"),UL=f(async()=>{const{diagram:e}=await gt(async()=>{const{diagram:t}=await import("./mindmap-definition-QFDTVHPH.Db1CW-aX.js");return{diagram:t}},__vite__mapDeps([41,13,14,6]));return{id:sy,diagram:e}},"loader"),GL={id:sy,detector:jL,loader:UL},XL=GL,oy="kanban",VL=f(e=>/^\s*kanban/.test(e),"detector"),ZL=f(async()=>{const{diagram:e}=await gt(async()=>{const{diagram:t}=await import("./kanban-definition-6JOO6SKY.DMOK7bzJ.js");return{diagram:t}},__vite__mapDeps([42,12,6]));return{id:oy,diagram:e}},"loader"),KL={id:oy,detector:VL,loader:ZL},QL=KL,ny="sankey",JL=f(e=>/^\s*sankey(-beta)?/.test(e),"detector"),tF=f(async()=>{const{diagram:e}=await gt(async()=>{const{diagram:t}=await import("./sankeyDiagram-XADWPNL6.B49IC-gh.js");return{diagram:t}},__vite__mapDeps([43,28,23,6]));return{id:ny,diagram:e}},"loader"),eF={id:ny,detector:JL,loader:tF},rF=eF,ly="packet",iF=f(e=>/^\s*packet(-beta)?/.test(e),"detector"),aF=f(async()=>{const{diagram:e}=await gt(async()=>{const{diagram:t}=await import("./diagram-TYMM5635.BjNPV6NQ.js");return{diagram:t}},__vite__mapDeps([44,18,20,6,4,2]));return{id:ly,diagram:e}},"loa
`;try{jo(a)}catch{const c=k0(a);if(!c)throw new du(`Diagram ${a} not found.`);const{id:h,diagram:u}=await c();is(h,u)}const{db:s,parser:o,renderer:n,init:l}=jo(a);return o.parser&&(o.parser.yy=s),s.clear?.(),l?.(i),r.title&&s.setDiagramTitle?.(r.title),await o.parse(t),new br(a,t,s,o,n)}async render(t,r){await this.renderer.draw(this.text,t,r,this)}getParser(){return this.parser}getType(){return this.type}},f(br,"Diagram"),br),eu=[],PF=f(()=>{eu.forEach(e=>{e()}),eu=[]},"attachFunctions"),RF=f(e=>e.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart(),"cleanupComments");function xy(e){const t=e.match(uu);if(!t)return{text:e,metadata:{}};let r=h2(t[1],{schema:l2})??{};r=typeof r=="object"&&!Array.isArray(r)?r:{};const i={};return r.displayMode&&(i.displayMode=r.displayMode.toString()),r.title&&(i.title=r.title.toString()),r.config&&(i.config=r.config),{text:e.slice(t[0].length),metadata:i}}f(xy,"extractFrontMatter");var NF=f(e=>e.replace(/\r\n?/g,`
`).replace(/<(\w+)([^>]*)>/g,(t,r,i)=>"<"+r+i.replace(/="([^"]*)"/g,"='$1'")+">"),"cleanupText"),qF=f(e=>{const{text:t,metadata:r}=xy(e),{displayMode:i,title:a,config:s={}}=r;return i&&(s.gantt||(s.gantt={}),s.gantt.displayMode=i),{title:a,config:s,text:t}},"processFrontmatter"),zF=f(e=>{const t=ye.detectInit(e)??{},r=ye.detectDirective(e,"wrap");return Array.isArray(r)?t.wrap=r.some(({type:i})=>i==="wrap"):r?.type==="wrap"&&(t.wrap=!0),{text:U_(e),directive:t}},"processDirectives");function zl(e){const t=NF(e),r=qF(t),i=zF(r.text),a=wl(r.config,i.directive);return e=RF(i.text),{code:e,title:r.title,config:a}}f(zl,"preprocessDiagram");function by(e){const t=new TextEncoder().encode(e),r=Array.from(t,i=>String.fromCodePoint(i)).join("");return btoa(r)}f(by,"toBase64");var WF=5e4,HF="graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa",YF="sandbox",jF="loose",UF="http://www.w3.org/2000/svg",GF="http://www.w3.org/1999/xlink",XF="http://www.w3.org/1999/xhtml",VF="100%",ZF="100%",KF="border:0;margin:0;",QF="margin:0",JF="allow-top-navigation-by-user-activation allow-popups",tA='The "iframe" tag is not supported by your browser.',eA=["foreignobject"],rA=["dominant-baseline"];function Wl(e){const t=zl(e);return es(),V0(t.config??{}),t}f(Wl,"processAndSetConfigs");async function ky(e,t){io();try{const{code:r,config:i}=Wl(e);return{diagramType:(await _y(r)).type,config:i}}catch(r){if(t?.suppressErrors)return!1;throw r}}f(ky,"parse");var ru=f((e,t,r=[])=>`
.${e} ${t} { ${r.join(" !important; ")} !important; }`,"cssImportantStyles"),iA=f((e,t=new Map)=>{let r="";if(e.themeCSS!==void 0&&(r+=`
${e.themeCSS}`),e.fontFamily!==void 0&&(r+=`
:root { --mermaid-font-family: ${e.fontFamily}}`),e.altFontFamily!==void 0&&(r+=`
:root { --mermaid-alt-font-family: ${e.altFontFamily}}`),t instanceof Map){const o=Zt(e)?["> *","span"]:["rect","polygon","ellipse","circle","path"];t.forEach(n=>{Jc(n.styles)||o.forEach(l=>{r+=ru(n.id,l,n.styles)}),Jc(n.textStyles)||(r+=ru(n.id,"tspan",(n?.textStyles||[]).map(l=>l.replace("color","fill"))))})}return r},"createCssStyles"),aA=f((e,t,r,i)=>{const a=iA(e,r),s=fC(t,a,{...e.themeVariables,theme:e.theme,look:e.look},i);return In(aB(`${i}{${s}}`),oB)},"createUserStyles"),sA=f((e="",t,r)=>{let i=e;return!r&&!t&&(i=i.replace(/marker-end="url\([\d+./:=?A-Za-z-]*?#/g,'marker-end="url(#')),i=vr(i),i=i.replace(/<br>/g,"<br/>"),i},"cleanUpSvgCode"),oA=f((e="",t)=>{const r=t?.viewBox?.baseVal?.height?t.viewBox.baseVal.height+"px":ZF,i=by(`<body style="${QF}">${e}</body>`);return`<iframe style="width:${VF};height:${r};${KF}" src="data:text/html;charset=UTF-8;base64,${i}" sandbox="${JF}">
${tA}
</iframe>`},"putIntoIFrame"),iu=f((e,t,r,i,a)=>{const s=e.append("div");s.attr("id",r),i&&s.attr("style",i);const o=s.append("svg").attr("id",t).attr("width","100%").attr("xmlns",UF);return a&&o.attr("xmlns:xlink",a),o.append("g"),e},"appendDivSvgG");function zn(e,t){return e.append("iframe").attr("id",t).attr("style","width: 100%; height: 100%;").attr("sandbox","")}f(zn,"sandboxedIframe");var nA=f((e,t,r,i)=>{e.getElementById(t)?.remove(),e.getElementById(r)?.remove(),e.getElementById(i)?.remove()},"removeExistingElements"),lA=f(async function(e,t,r){io();const i=Wl(t);t=i.code;const a=wt();R.debug(a),t.length>(a?.maxTextSize??WF)&&(t=HF);const s="#"+e,o="i"+e,n="#"+o,l="d"+e,c="#"+l,h=f(()=>{const z=ct(p?n:c).node();z&&"remove"in z&&z.remove()},"removeTempElements");let u=ct("body");const p=a.securityLevel===YF,d=a.securityLevel===jF,g=a.fontFamily;if(r!==void 0){if(r&&(r.innerHTML=""),p){const W=zn(ct(r),o);u=ct(W.nodes()[0].contentDocument.body),u.node().style.margin=0}else u=ct(r);iu(u,e,l,`font-family: ${g}`,GF)}else{if(nA(document,e,l,o),p){const W=zn(ct("body"),o);u=ct(W.nodes()[0].contentDocument.body),u.node().style.margin=0}else u=ct("body");iu(u,e,l)}let m,y;try{m=await qn.fromText(t,{title:i.title})}catch(W){if(a.suppressErrorRendering)throw h(),W;m=await qn.fromText("error"),y=W}const x=u.select(c).node(),b=m.type,k=x.firstChild,_=k.firstChild,w=m.renderer.getClasses?.(t,m),v=aA(a,b,w,s),E=document.createElement("style");E.innerHTML=v,k.insertBefore(E,_);try{await m.renderer.draw(t,e,"11.14.0",m)}catch(W){throw a.suppressErrorRendering?h():OL.draw(t,e,"11.14.0"),W}const B=u.select(`${c} svg`),N=m.db.getAccTitle?.(),D=m.db.getAccDescription?.();wy(b,B,N,D),u.select(`[id="${e}"]`).selectAll("foreignobject > *").attr("xmlns",XF);let O=u.select(c).node().innerHTML;if(R.debug("config.arrowMarkerAbsolute",a.arrowMarkerAbsolute),O=sA(O,p,Ue(a.arrowMarkerAbsolute)),p){const W=u.select(c+" svg").node();O=oA(O,W)}else d||(O=ci.sanitize(O,{ADD_TAGS:eA,ADD_ATTR:rA,HTML_INTEGRATION_POINTS:{foreignobject:!0}}));if(PF(),y)throw y;return h(),{diagramType:b,svg:O,bindFunctions:m.db.bindFunctions}},"render");function Ty(e={}){const t=Ot({},e);t?.fontFamily&&!t.themeVariables?.fontFamily&&(t.themeVariables||(t.themeVariables={}),t.themeVariables.fontFamily=t.fontFamily),G0(t),t?.theme&&t.theme in ze?t.themeVariables=ze[t.theme].getThemeVariables(t.themeVariables):t&&(t.themeVariables=ze.default.getThemeVariables(t.themeVariables));const r=typeof t=="object"?U0(t):yu();Wn(r.logLevel),io()}f(Ty,"initialize");var _y=f((e,t={})=>{const{code:r}=zl(e);return qn.fromText(r,t)},"getDiagramFromText");function wy(e,t,r,i){yy(t,e),Cy(t,r,i,t.attr("id"))}f(wy,"addA11yInfo");var Lr=Object.freeze({render:lA,parse:ky,getDiagramFromText:_y,initialize:Ty,getConfig:wt,setConfig:Cu,getSiteConfig:yu,updateSiteConfig:X0,reset:f(()=>{es()},"reset"),globalReset:f(()=>{es(ui)},"globalReset"),defaultConfig:ui});Wn(wt().logLevel);es(wt());var hA=f((e,t,r)=>{R.warn(e),_l(e)?(r&&r(e.str,e.hash),t.push({...e,message:e.str,error:e})):(r&&r(e),e instanceof Error&&t.push({str:e.message,message:e.message,hash:e.name,error:e}))},"handleError"),Sy=f(async function(e={querySelector:".mermaid"}){try{await cA(e)}catch(t){if(_l(t)&&R.error(t.str),je.parseError&&je.parseError(t),!e.suppressErrors)throw R.error("Use the suppressErrors option to suppress these errors"),t}},"run"),cA=f(async function({postRenderCallback:e,querySelector:t,nodes:r}={querySelector:".mermaid"}){const i=Lr.getConfig();R.debug(`${e?"":"No "}Callback function found`);let a;if(r)a=r;else if(t)a=document.querySelectorAll(t);else throw new Error("Nodes and querySelector are both undefined");R.debug(`Found ${a.length} diagrams`),i?.startOnLoad!==void 0&&(R.debug("Start On Load: "+i?.startOnLoad),Lr.updateSiteConfig({startOnLoad:i?.startOnLoad}));const s=new ye.InitIDGenerator(i.deterministicIds,i.deterministicIDSeed);let o;const n=[];for(const l of Array.from(a)){if(R.info("Rendering diagram: "+l.id),l.getAttribute("data-processed"))continue;l.setAttribute("data-processed","true");const c=`merm
* Wait for document loaded before starting the execution
*/const GA=Object.freeze(Object.defineProperty({__proto__:null,default:mA},Symbol.toStringTag,{value:"Module"}));export{BA as $,gC as A,TA as B,tr as C,Fe as D,Wy as E,wt as F,_C as G,wl as H,mu as I,l2 as J,K_ as K,rk as L,H1 as M,rl as N,vA as O,FA as P,Rr as Q,Wh as R,zh as S,EA as T,nt as U,AA as V,LA as W,wA as X,SA as Y,$A as Z,f as _,yC as a,lc as a$,MA as a0,B0 as a1,Ji as a2,bA as a3,Xs as a4,W_ as a5,iC as a6,Su as a7,Th as a8,G1 as a9,uv as aA,cv as aB,fS as aC,ou as aD,Y1 as aE,xA as aF,Gs as aG,Ts as aH,Cf as aI,Py as aJ,ka as aK,dS as aL,uS as aM,Qn as aN,Ke as aO,Ih as aP,_b as aQ,ra as aR,m_ as aS,mf as aT,hf as aU,bT as aV,xs as aW,kT as aX,xa as aY,fr as aZ,u_ as a_,en as aa,Z_ as ab,ke as ac,$ as ad,A as ae,uC as af,Bu as ag,NS as ah,Fm as ai,HA as aj,c2 as ak,Zt as al,Xe as am,Ai as an,Sl as ao,wf as ap,vr as aq,Lf as ar,U as as,zv as at,WA as au,YA as av,qA as aw,Z as ax,zA as ay,mv as az,mC as b,Fr as b0,TT as b1,yl as b2,xT as b3,ST as b4,xi as b5,g_ as b6,R_ as b7,AT as b8,E_ as b9,A_ as bA,N_ as bB,ml as bC,z_ as bD,CA as bE,GA as bF,gl as ba,Jc as bb,V as bc,Ff as bd,re as be,mb as bf,Kn as bg,zu as bh,ma as bi,Yu as bj,_A as bk,zy as bl,Ci as bm,T_ as bn,cB as bo,Ca as bp,ks as bq,or as br,Hs as bs,ic as bt,Cl as bu,uf as bv,gf as bw,yT as bx,Rn as by,P_ as bz,mt as c,ct as d,vu as e,Ot as f,xC as g,Ye as h,be as i,p2 as j,fa as k,R as l,vf as m,pa as n,kA as o,UA as p,bC as q,jA as r,CC as s,kC as t,ye as u,h2 as v,tw as w,sv as x,OA as y,ci as z};