UNPKG

mermaid

Version:

Markdown-ish syntax for generating flowcharts, mindmaps, sequence diagrams, class diagrams, gantt charts, git graphs and more.

11 lines (10 loc) • 49 kB
import{a as Bt}from"./chunk-Z2IEFKAF.mjs";import{f as Q}from"./chunk-3DCBE5TA.mjs";import{a as $t}from"./chunk-JENJ2NYI.mjs";import{c as At,d as Ut}from"./chunk-FRYFDGAD.mjs";import{c as ft,e as Tt}from"./chunk-KNGDTZMA.mjs";import{q as A,u as Pt}from"./chunk-EB7S5WDG.mjs";import{$ as U,c as kt,u as v,y as dt}from"./chunk-VLFMOWSA.mjs";import{$ as Ot,G as K,H as yt,J as gt,K as xt,L as pt,P as bt,S as wt,W as Mt,X as St,Y as Lt,Z as Et,_ as _t,b as x,h as T}from"./chunk-NXZFCOWJ.mjs";import{a as i}from"./chunk-V3YWWTDH.mjs";var z=i((r,t)=>{if(t)return"translate("+-r.width/2+", "+-r.height/2+")";let e=r.x??0,a=r.y??0;return"translate("+-(e+r.width/2)+", "+-(a+r.height/2)+")"},"computeLabelTransform");var M={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},ht={arrow_point:4,arrow_cross:12.5,arrow_circle:12.5,arrow_open_head:4,arrow_hollow_circle:8};function tt(r,t){if(r===void 0||t===void 0)return{angle:0,deltaX:0,deltaY:0};r=b(r),t=b(t);let[e,a]=[r.x,r.y],[s,n]=[t.x,t.y],o=s-e,c=n-a;return{angle:Math.atan(c/o),deltaX:o,deltaY:c}}i(tt,"calculateDeltaAndAngle");var b=i(r=>Array.isArray(r)?{x:r[0],y:r[1]}:r,"pointTransformer"),Wt=i(r=>({x:i(function(t,e,a){let s=0,n=b(a[0]).x<b(a[a.length-1]).x?"left":"right";if(e===0&&Object.hasOwn(M,r.arrowTypeStart)){let{angle:p,deltaX:k}=tt(a[0],a[1]);s=M[r.arrowTypeStart]*Math.cos(p)*(k>=0?1:-1)}else if(e===a.length-1&&Object.hasOwn(M,r.arrowTypeEnd)){let{angle:p,deltaX:k}=tt(a[a.length-1],a[a.length-2]);s=M[r.arrowTypeEnd]*Math.cos(p)*(k>=0?1:-1)}let o=Math.abs(b(t).x-b(a[a.length-1]).x),c=Math.abs(b(t).y-b(a[a.length-1]).y),l=Math.abs(b(t).x-b(a[0]).x),f=Math.abs(b(t).y-b(a[0]).y),h=M[r.arrowTypeStart],m=M[r.arrowTypeEnd],d=1;if(o<m&&o>0&&c<m){let p=m+d-o;p*=n==="right"?-1:1,s-=p}if(l<h&&l>0&&f<h){let p=h+d-l;p*=n==="right"?-1:1,s+=p}return b(t).x+s},"x"),y:i(function(t,e,a){let s=0,n=b(a[0]).y<b(a[a.length-1]).y?"down":"up";if(e===0&&Object.hasOwn(M,r.arrowTypeStart)){let{angle:p,deltaY:k}=tt(a[0],a[1]);s=M[r.arrowTypeStart]*Math.abs(Math.sin(p))*(k>=0?1:-1)}else if(e===a.length-1&&Object.hasOwn(M,r.arrowTypeEnd)){let{angle:p,deltaY:k}=tt(a[a.length-1],a[a.length-2]);s=M[r.arrowTypeEnd]*Math.abs(Math.sin(p))*(k>=0?1:-1)}let o=Math.abs(b(t).y-b(a[a.length-1]).y),c=Math.abs(b(t).x-b(a[a.length-1]).x),l=Math.abs(b(t).y-b(a[0]).y),f=Math.abs(b(t).x-b(a[0]).x),h=M[r.arrowTypeStart],m=M[r.arrowTypeEnd],d=1;if(o<m&&o>0&&c<m){let p=m+d-o;p*=n==="up"?-1:1,s-=p}if(l<h&&l>0&&f<h){let p=h+d-l;p*=n==="up"?-1:1,s+=p}return b(t).y+s},"y")}),"getLineFunctionsWithOffset");var Ht=i(r=>typeof r=="number"&&Number.isFinite(r)&&r>0?r:1,"getStepDuration"),rt=i(r=>typeof r.step=="number"&&Number.isInteger(r.step)&&r.step>0,"isStepEdge");var Yt=[.25,.35,.15,.65,.75,.5,.85,.1,.9],mt=9,ir=11,cr=2,lr="#333333",Xt=12,vt=6,Ct=14,Nt=.01,dr=4.5,qt=/translate\(\s*(-?[\d.e]+)[\s,]+(-?[\d.e]+)/i,pr=4,fr=.6,hr=4,mr=i((r,t,e=1)=>{let a=Math.max(t,r);return{begin:(r-1)*e,dur:e,gap:(a-1)*e}},"getEdgeStepTiming"),ur=i(r=>`step_${Array.from(r,t=>/[\dA-Za-z]/.test(t)?t:`_${(t.codePointAt(0)??0).toString(16)}_`).join("")}`,"toAnimationId"),kr=i(r=>{let t=/^m\s*(-?[\d.e]+)[\s,]+(-?[\d.e]+)/i.exec(r.trim());return t?`translate(${t[1]},${t[2]}) `:""},"pathStartTranslate"),yr=i(r=>Array.from(r,(t,e)=>{let a=t.codePointAt(0)??0;if(a===0)return"\uFFFD";let s=a<=31||a===127,n=/\d/.test(t)&&(e===0||e===1&&r.startsWith("-"));return s||n?`\\${a.toString(16)} `:r==="-"?"\\-":a>=128||/[\w-]/.test(t)?t:`\\${t}`}).join(""),"escapeCssIdentifierFallback"),gr=i(r=>typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(r):yr(r),"escapeCssIdentifier"),xr=i((r,t)=>{let e=r.node(),a=e?.ownerSVGElement??e?.closest?.("svg")??e,s=t||a?.getAttribute("id");if(!a||!s||a.querySelector("style.edge-step-style"))return;let n=`#${gr(s)} `,o=a.ownerDocument.createElementNS("http://www.w3.org/2000/svg","style");o.setAttribute("class","edge-step-style"),o.textContent=`@media (prefers-reduced-motion: reduce) { ${n}.edge-step-dot, ${n}.edge-step-highlight { display: none; } }`,a.appendChild(o)},"ensureReducedMotionStyle"),br=i((r,t)=>{let e=r.filter(n=>Number.isFinite(n.x)&&Number.isFinite(n.y));if(e.length===0)return;let a=e.slice(1).map((n,o)=>Math.hypot(n.x-e[o].x,n.y-e[o].y)),s=a.reduce((n,o)=>n+o,0)*t;for(let[n,o]of a.entries()){if(s<=o&&o>0){let c=s/o,l=e[n],f=e[n+1];return{x:l.x+(f.x-l.x)*c,y:l.y+(f.y-l.y)*c}}s-=o}return e[e.length-1]},"pointAlongPolyline"),wr=i((r,t)=>{let e=typeof t?.getTotalLength=="function"?t.getTotalLength():0,a=t?.getPointAtLength?.bind(t);return e>0&&a?s=>{let{x:n,y:o}=a(e*s);return{x:n,y:o}}:s=>br(r,s)},"createPathSampler"),Mr=i((r,t)=>Math.min(Number.POSITIVE_INFINITY,...t.map(e=>{let a=Math.max(Math.abs(r.x-e.x)-e.halfWidth,0),s=Math.max(Math.abs(r.y-e.y)-e.halfHeight,0);return Math.hypot(a,s)-mt})),"roomAround"),Sr=i((r,t)=>{let e=r(t),a=r(Math.max(t-Nt,0)),s=r(Math.min(t+Nt,1));if(!e||!a||!s)return[];let n=Math.hypot(s.x-a.x,s.y-a.y);if(n===0)return[];let o={x:-(s.y-a.y)/n,y:(s.x-a.x)/n};return[1,-1].map(c=>({x:e.x+o.x*Ct*c,y:e.y+o.y*Ct*c}))},"besideThePath"),Lr=i((r,t)=>{let e=[...Yt.map(r),...Yt.flatMap(n=>Sr(r,n))],a,s=Number.NEGATIVE_INFINITY;for(let n of e){if(!n||!Number.isFinite(n.x)||!Number.isFinite(n.y))continue;let o=Mr(n,t);if(o>=cr)return n;o>s&&(a=n,s=o)}return a},"chooseBadgePosition"),It=i((r,t)=>({...r,halfWidth:t,halfHeight:t}),"square"),Er=i(r=>{let t=qt.exec(r.getAttribute("transform")??"");return t?{x:Number(t[1]),y:Number(t[2])}:{x:0,y:0}},"translationOf"),ut=i(r=>{let t={x:0,y:0};for(let e=r;e&&e.localName!=="svg";e=e.parentElement){let{x:a,y:s}=Er(e);t.x+=a,t.y+=s}return t},"offsetInSvg"),_r=i((r,t)=>{if(!qt.test(r.getAttribute("transform")??""))return;let e=ut(r),a=e.x-t.x,s=e.y-t.y,n=r.getBBox?.();if(n)return{x:a+n.x+n.width/2,y:s+n.y+n.height/2,halfWidth:n.width/2,halfHeight:n.height/2}},"boxedObstacle"),Or=i(r=>{try{let t=JSON.parse(atob(r.getAttribute("data-points")??""));return Array.isArray(t)?t:[]}catch{return[]}},"readPoints"),Rt=i((r,t)=>{let e=Math.hypot(r.x-t.x,r.y-t.y);if(e===0)return It(r,Xt);let a={x:(r.x-t.x)/e,y:(r.y-t.y)/e},s=Xt/2;return{x:r.x-a.x*s,y:r.y-a.y*s,halfWidth:Math.abs(a.x)*s+Math.abs(a.y)*vt,halfHeight:Math.abs(a.y)*s+Math.abs(a.x)*vt}},"arrowheadObstacle"),Gt=i((r,t)=>{let e=r.getAttribute(t);return!!e&&e!=="none"},"hasMarker"),Pr=i((r,t)=>{let e=Or(r).filter(c=>Number.isFinite(c?.x)&&Number.isFinite(c?.y));if(e.length===0)return[];let a=ut(r),s=i(c=>({x:c.x+a.x-t.x,y:c.y+a.y-t.y}),"toSvg"),n=e.length-1,o=[];return Gt(r,"marker-start")&&o.push(Rt(s(e[0]),s(e[Math.min(1,n)]))),Gt(r,"marker-end")&&o.push(Rt(s(e[n]),s(e[Math.max(n-1,0)]))),o},"arrowheadObstacles"),Vt=i(r=>{let t={x:0,y:0},e=[...r?.querySelectorAll(".edgeLabel, .node")??[]].map(s=>_r(s,t)).filter(s=>s!==void 0),a=[...r?.querySelectorAll('path[data-edge="true"]')??[]].flatMap(s=>Pr(s,t));return[...e,...a]},"collectBadgeObstacles"),Tr=i((r,t)=>{if(!r.label||t.length===0)return[];let{x:e,y:a}=A.calcLabelPosition(t);return[{x:e,y:a,halfWidth:(r.width??0)/2,halfHeight:(r.height??0)/2}]},"edgeLabelObstacles"),Ar=i(r=>{let t=r/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4},"linearChannel"),Dt=i(r=>{try{let[t,e,a]=["r","g","b"].map(s=>Ar(kt(r,s)));return .2126*t+.7152*e+.0722*a}catch{return}},"relativeLuminance"),Ur=i((r,t)=>{let e=Dt(r),a=Dt(t);return e===void 0||a===void 0?0:(Math.max(e,a)+.05)/(Math.min(e,a)+.05)},"contrastRatio"),$r=i((r,t)=>{let a=[...t.filter(n=>!!n),"#ffffff","#000000"].map(n=>({color:n,ratio:Ur(r,n)}));return(a.find(({ratio:n})=>n>=dr)??a.reduce((n,o)=>o.ratio>n.ratio?o:n)).color},"pickBadgeTextColor"),Br=i(r=>{let t=r?.replace(/^stroke:\s*/,"").trim();return t===""?void 0:t},"bareColor"),Wr=i((r,t,e,a=Vt(r.node()?.closest("svg")))=>{if(!rt(t)||!t.showStepNumber)return;let s=ut(r.node()),n=a.map(f=>({...f,x:f.x-s.x,y:f.y-s.y})),o=Lr(wr(e.points,e.pathNode),[...n,...Tr(t,e.points)]);if(!o)return;let c=Br(e.color)??lr,l=r.append("g").attr("class","edge-step-badge").attr("transform",`translate(${o.x},${o.y})`).attr("pointer-events","none").attr("data-step",t.step);return l.append("circle").attr("r",mt).attr("fill",c),l.append("text").attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size",ir).attr("fill",$r(c,e.textColors??[])).text(String(t.step)),It({x:o.x+s.x,y:o.y+s.y},mt)},"insertEdgeStepBadge"),zt=i((r,t,e)=>{r.append("animateTransform").attr("attributeName","transform").attr("type","scale").attr("values","1;1").attr("dur",`${e}s`).attr("begin",`${t}.begin`).attr("fill","remove")},"showWhileStepPlays"),Hr=i((r,t,e,a,s)=>{if(!rt(t)||!e)return;let{begin:n,dur:o,gap:c}=mr(t.step,t.stepCount??t.step,Ht(t.stepDuration)),l=ur(`${a}-${t.id}-step`),f=`${kr(e)}scale(0)`,h=s?.replace(/^stroke:\s*/,""),m=r.append("path").attr("class","edge-step-highlight").attr("aria-hidden","true").attr("d",e).attr("fill","none").attr("stroke",h??"currentColor").attr("stroke-width",pr).attr("stroke-linecap","round").attr("stroke-opacity",fr).attr("pointer-events","none").attr("transform",f).attr("data-step",t.step);zt(m,l,o);let d=r.append("circle").attr("class","edge-step-dot").attr("r",hr).attr("aria-hidden","true").attr("transform",f).attr("data-step",t.step);h&&d.attr("fill",h).attr("stroke","none"),d.append("animateMotion").attr("id",l).attr("path",e).attr("dur",`${o}s`).attr("begin",`${n}s;${l}.end+${c}s`).attr("fill","remove"),zt(d,l,o),xr(r,a)},"insertEdgeStepDot"),et=new WeakMap,Yr=i(r=>{let t=r.querySelector(":scope > g.edge-step-badges");if(t)return t;let e=r.ownerDocument.createElementNS("http://www.w3.org/2000/svg","g");return e.setAttribute("class","edge-step-badges"),r.appendChild(e)},"badgeLayer"),Ne=i(r=>{let t=r?et.get(r):void 0;if(!r||!t)return;et.delete(r);let e=Vt(r);for(let{elem:a,edge:s,options:n}of t){let o=a.node()?.parentElement;if(!o)continue;let c=T(Yr(o)),l=Wr(c,s,n,e);l&&e.push(l)}},"placeQueuedStepBadges"),Ft=i((r,t,e,a,s)=>{Hr(r,t,e,a,s.color);let n=r.node(),o=n?.ownerSVGElement??n;!o||!rt(t)||!t.showStepNumber||et.set(o,[...et.get(o)??[],{elem:r,edge:t,options:s}])},"insertEdgeStepMarks");var Qt=i((r,t,e,a,s,n=!1,o)=>{t.arrowTypeStart&&jt(r,"start",t.arrowTypeStart,e,a,s,n,o),t.arrowTypeEnd&&jt(r,"end",t.arrowTypeEnd,e,a,s,n,o)},"addEdgeMarkers"),Xr={arrow_cross:{type:"cross",fill:!1},arrow_point:{type:"point",fill:!0},arrow_barb:{type:"barb",fill:!0},arrow_barb_neo:{type:"barb",fill:!0},arrow_circle:{type:"circle",fill:!1},arrow_open_head:{type:"openArrow",fill:!1},arrow_hollow_circle:{type:"hollowCircle",fill:!1},arrow_hierarchy:{type:"hierarchy",fill:!1},aggregation:{type:"aggregation",fill:!1},extension:{type:"extension",fill:!1},composition:{type:"composition",fill:!0},dependency:{type:"dependency",fill:!0},lollipop:{type:"lollipop",fill:!1},only_one:{type:"onlyOne",fill:!1},zero_or_one:{type:"zeroOrOne",fill:!1},one_or_more:{type:"oneOrMore",fill:!1},zero_or_more:{type:"zeroOrMore",fill:!1},requirement_arrow:{type:"requirement_arrow",fill:!1},requirement_contains:{type:"requirement_contains",fill:!1}},vr=["cross","point","circle","lollipop","aggregation","extension","composition","dependency","barb"],jt=i((r,t,e,a,s,n,o=!1,c)=>{if(!e||e==="none")return;let l=Xr[e],f=l&&vr.includes(l.type);if(!l){x.warn(`Unknown arrow type: ${e}`);return}let h=l.type,p=`${s}_${n}-${h}${t==="start"?"Start":"End"}${o&&f?"-margin":""}`;if(c&&c.trim()!==""){let k=c.replace(/[^\dA-Za-z]/g,"_"),y=`${p}_${k}`;if(!document.getElementById(y)){let u=document.getElementById(p);if(u){let _=u.cloneNode(!0);_.id=y,_.querySelectorAll("path, circle, line").forEach(W=>{W.setAttribute("stroke",c),l.fill&&W.setAttribute("fill",c)}),u.parentNode?.appendChild(_)}}r.attr(`marker-${t}`,`url(${a}#${y})`)}else r.attr(`marker-${t}`,`url(${a}#${p})`)},"addEdgeMarker");var Cr=i(r=>typeof r=="string"?r:U()?.flowchart?.curve,"resolveEdgeCurveType"),st=new Map,E=new Map,ia=i(()=>{st.clear(),E.clear()},"clear"),ca=i(r=>!!(r.label||r.startLabelLeft||r.startLabelRight||r.endLabelLeft||r.endLabelRight),"hasEdgeLabel"),Z=i(r=>r?typeof r=="string"?r:r.reduce((t,e)=>t+";"+e,""):"","getLabelStyles"),la=i(async(r,t)=>{let e=U(),a=dt(e),{labelStyles:s}=Ut(t);t.labelStyle=s;let n=r.insert("g").attr("class","edgeLabel"),o=n.insert("g").attr("class","label").attr("data-id",t.id),c=t.labelType==="markdown",f=await Tt(r,t.label,{style:Z(t.labelStyle),useHtmlLabels:a,addSvgBackground:!0,isNode:!1,markdown:c,width:c?void 0:void 0},e);o.node().appendChild(f),x.info("abc82",t,t.labelType);let h,m;if(a){let p=f.children[0],k=T(f);h=await ft.measure(()=>p.getBoundingClientRect()),m=h,k.attr("width",h.width),k.attr("height",h.height)}else{let p=T(f).select("text").node();await ft.measure(()=>{h=f.getBBox(),p&&typeof p.getBBox=="function"?m=p.getBBox():m=h})}o.attr("transform",z(m,a)),st.set(t.id,n),t.width=h.width,t.height=h.height;let d;if(t.startLabelLeft){let p=r.insert("g").attr("class","edgeTerminals"),k=p.insert("g").attr("class","inner"),y=await Q(k,t.startLabelLeft,Z(t.labelStyle)||"",!1,!1);d=y;let u=y.getBBox();if(a){let _=y.children[0],w=T(y);u=_.getBoundingClientRect(),w.attr("width",u.width),w.attr("height",u.height)}k.attr("transform",z(u,a)),E.get(t.id)||E.set(t.id,{}),E.get(t.id).startLeft=p,nt(d,t.startLabelLeft,u),at(t,"startLeft",u)}if(t.startLabelRight){let p=r.insert("g").attr("class","edgeTerminals"),k=p.insert("g").attr("class","inner"),y=await Q(k,t.startLabelRight,Z(t.labelStyle)||"",!1,!1);d=y;let u=y.getBBox();if(a){let _=y.children[0],w=T(y);u=_.getBoundingClientRect(),w.attr("width",u.width),w.attr("height",u.height)}k.attr("transform",z(u,a)),E.get(t.id)||E.set(t.id,{}),E.get(t.id).startRight=p,nt(d,t.startLabelRight,u),at(t,"startRight",u)}if(t.endLabelLeft){let p=r.insert("g").attr("class","edgeTerminals"),k=p.insert("g").attr("class","inner"),y=await Q(k,t.endLabelLeft,Z(t.labelStyle)||"",!1,!1);d=y;let u=y.getBBox();if(a){let _=y.children[0],w=T(y);u=_.getBoundingClientRect(),w.attr("width",u.width),w.attr("height",u.height)}k.attr("transform",z(u,a)),E.get(t.id)||E.set(t.id,{}),E.get(t.id).endLeft=p,nt(d,t.endLabelLeft,u),at(t,"endLeft",u)}if(t.endLabelRight){let p=r.insert("g").attr("class","edgeTerminals"),k=p.insert("g").attr("class","inner"),y=await Q(k,t.endLabelRight,Z(t.labelStyle)||"",!1,!1);d=y;let u=y.getBBox();if(a){let _=y.children[0],w=T(y);u=_.getBoundingClientRect(),w.attr("width",u.width),w.attr("height",u.height)}k.attr("transform",z(u,a)),E.get(t.id)||E.set(t.id,{}),E.get(t.id).endRight=p,nt(d,t.endLabelRight,u),at(t,"endRight",u)}return f},"insertEdgeLabel");function at(r,t,e){r.terminalLabelSizes??={},r.terminalLabelSizes[t]={width:e.width,height:e.height}}i(at,"recordTerminalLabelSize");function nt(r,t,e){dt(U())&&r&&(r.style.width=Math.max(t.length*9,e.width)+"px",r.style.height=e.height+"px")}i(nt,"setTerminalWidth");var Nr=i((r,t)=>{let e=r.x,a=r.y;if(t?.updatedPath){let s=A.calcLabelPosition(t.updatedPath);if(t.originalPath){let n=A.calcLabelPosition(t.originalPath);e=r.x+(s.x-n.x),a=r.y+(s.y-n.y)}else e=s.x,a=s.y}return{x:e,y:a}},"resolveEdgeLabelPosition"),da=i((r,t)=>{x.debug("Moving label abc88 ",r.id,r.label,st.get(r.id),t);let e=U(),{subGraphTitleTotalMargin:a}=Bt(e);if(r.label){let n=st.get(r.id),{x:o,y:c}=Nr(r,t);x.debug("Moving label "+r.label+" from (",r.x,",",r.y,") to (",o,",",c,") abc88"),n.attr("transform",`translate(${o}, ${c+a/2})`)}let s=t.updatedPath?t.updatedPath:t.originalPath;if(r.startLabelLeft){let n=E.get(r.id).startLeft,o=r.x,c=r.y;if(s){let l=A.calcTerminalLabelPosition(r.arrowTypeStart?10:0,"start_left",s);o=l.x,c=l.y}n.attr("transform",`translate(${o}, ${c})`)}if(r.startLabelRight){let n=E.get(r.id).startRight,o=r.x,c=r.y;if(s){let l=A.calcTerminalLabelPosition(r.arrowTypeStart?10:0,"start_right",s);o=l.x,c=l.y}n.attr("transform",`translate(${o}, ${c})`)}if(r.endLabelLeft){let n=E.get(r.id).endLeft,o=r.x,c=r.y;if(s){let l=A.calcTerminalLabelPosition(r.arrowTypeEnd?10:0,"end_left",s);o=l.x,c=l.y}n.attr("transform",`translate(${o}, ${c})`)}if(r.endLabelRight){let n=E.get(r.id).endRight,o=r.x,c=r.y;if(s){let l=A.calcTerminalLabelPosition(r.arrowTypeEnd?10:0,"end_right",s);o=l.x,c=l.y}n.attr("transform",`translate(${o}, ${c})`)}},"positionEdgeLabel"),q=.5,$=i((r,t)=>Math.abs(r.x-t.x)<q,"sharesColumn"),B=i((r,t)=>Math.abs(r.y-t.y)<q,"sharesRow"),tr=i((r,t)=>$(r,t)&&B(r,t),"coincides");function Rr(r,t,e){return $(r,t)&&!B(r,t)?$(e,t):B(r,t)&&!$(r,t)?B(e,t):$(e,t)||B(e,t)}i(Rr,"keepsArrivalAxis");function Gr(r,t,e){return tr(r,t)?{heading:t,from:e}:{heading:r,from:t}}i(Gr,"arrivalSegment");function Dr({heading:r,from:t},e,a){return(r.x-t.x)*(a.x-e.x)+(r.y-t.y)*(a.y-e.y)<0}i(Dr,"runsAgainstHeading");function zr({heading:r,from:t},e,a){return B(r,t)&&!$(r,t)?{x:a.x,y:e.y}:$(r,t)&&!B(r,t)?{x:e.x,y:a.y}:a}i(zr,"snapToArrivalAxis");function qr(r,t,e,a){if(($(r,t)||B(r,t))&&!Rr(r,t,a))return r;let n=Gr(r,t,e);return Dr(n,t,a)?t:zr(n,t,a)}i(qr,"dockFinalPoint");function Ir(r){let t=Object.hasOwn(M,r)?M[r]:0;return Number.isFinite(t)?t:0}i(Ir,"markerPullBack");function Vr({originalLast:r,lastInner:t,newLast:e,minLength:a}){let s=!tr(r,t),n=Math.hypot(e.x-t.x,e.y-t.y);return n>=Math.max(q,a)?e:s&&n>=q?r:void 0}i(Vr,"finalDockPoint");var Fr=i((r,t)=>{if(!r?.isLabelEdge||!r?.id?.endsWith("-to-label")||!Array.isArray(t)||t.length!==2)return t;let[e,a]=t,s=Math.abs(a.x-e.x),n=Math.abs(a.y-e.y);return s<.001||n<.001?t:n>=s?[e,{x:e.x,y:a.y},a]:[e,{x:a.x,y:e.y},a]},"orthogonalizeToLabelClippedPoints"),jr=i((r,t)=>{let e=r.x,a=r.y,s=Math.abs(t.x-e),n=Math.abs(t.y-a),o=r.width/2,c=r.height/2;return s>=o||n>=c},"outsideNode"),Qr=i((r,t,e)=>{x.debug(`intersection calc abc89: outsidePoint: ${JSON.stringify(t)} insidePoint : ${JSON.stringify(e)} node : x:${r.x} y:${r.y} w:${r.width} h:${r.height}`);let a=r.x,s=r.y,n=Math.abs(a-e.x),o=r.width/2,c=e.x<t.x?o-n:o+n,l=r.height/2,f=Math.abs(t.y-e.y),h=Math.abs(t.x-e.x);if(Math.abs(s-t.y)*o>Math.abs(a-t.x)*l){let m=e.y<t.y?t.y-l-s:s-l-t.y;c=h*m/f;let d={x:e.x<t.x?e.x+c:e.x-h+c,y:e.y<t.y?e.y+f-m:e.y-f+m};return c===0&&(d.x=t.x,d.y=t.y),h===0&&(d.x=t.x),f===0&&(d.y=t.y),x.debug(`abc89 top/bottom calc, Q ${f}, q ${m}, R ${h}, r ${c}`,d),d}else{e.x<t.x?c=t.x-o-a:c=a-o-t.x;let m=f*c/h,d=e.x<t.x?e.x+h-c:e.x-h+c,p=e.y<t.y?e.y+m:e.y-m;return x.debug(`sides calc abc89, Q ${f}, q ${m}, R ${h}, r ${c}`,{_x:d,_y:p}),c===0&&(d=t.x,p=t.y),h===0&&(d=t.x),f===0&&(p=t.y),{x:d,y:p}}},"intersection"),Zt=i((r,t)=>{x.warn("abc88 cutPathAtIntersect",r,t);let e=[],a=r[0],s=!1;return r.forEach(n=>{if(x.info("abc88 checking point",n,t),!jr(t,n)&&!s){let o=Qr(t,a,n);x.debug("abc88 inside",n,a,o),x.debug("abc88 intersection",o,t);let c=!1;e.forEach(l=>{c=c||l.x===o.x&&l.y===o.y}),e.some(l=>l.x===o.x&&l.y===o.y)?x.warn("abc88 no intersect",o,e):e.push(o),s=!0}else x.warn("abc88 outside",n,a),a=n,s||e.push(n)}),x.debug("returning points",e),e},"cutPathAtIntersect");function Zr(r){let t=[],e=[];for(let a=1;a<r.length-1;a++){let s=r[a-1],n=r[a],o=r[a+1];(s.x===n.x&&n.y===o.y&&Math.abs(n.x-o.x)>5&&Math.abs(n.y-s.y)>5||s.y===n.y&&n.x===o.x&&Math.abs(n.x-s.x)>5&&Math.abs(n.y-o.y)>5)&&(t.push(n),e.push(a))}return{cornerPoints:t,cornerPointPositions:e}}i(Zr,"extractCornerPoints");var Jt=i(function(r,t,e){let a=t.x-r.x,s=t.y-r.y,n=Math.sqrt(a*a+s*s),o=e/n;return{x:t.x-o*a,y:t.y-o*s}},"findAdjacentPoint"),Jr=i(function(r){let{cornerPointPositions:t}=Zr(r),e=[];for(let a=0;a<r.length;a++)if(t.includes(a)){let s=r[a-1],n=r[a+1],o=r[a],c=Jt(s,o,5),l=Jt(n,o,5),f=l.x-c.x,h=l.y-c.y;e.push(c);let m=Math.sqrt(2)*2,d={x:o.x,y:o.y};if(Math.abs(n.x-s.x)>10&&Math.abs(n.y-s.y)>=10){x.debug("Corner point fixing",Math.abs(n.x-s.x),Math.abs(n.y-s.y));let p=5;o.x===c.x?d={x:f<0?c.x-p+m:c.x+p-m,y:h<0?c.y-m:c.y+m}:d={x:f<0?c.x-m:c.x+m,y:h<0?c.y-p+m:c.y+p-m}}else x.debug("Corner point skipping fixing",Math.abs(n.x-s.x),Math.abs(n.y-s.y));e.push(d,l)}else e.push(r[a]);return e},"fixCorners"),Kr=i((r,t,e)=>{let a=r-t-e,s=2,n=2,o=s+n,c=Math.floor(a/o),l=Number.isFinite(c)?Math.max(0,c):0,f=Array(l).fill(`${s} ${n}`).join(" ");return`0 ${t} ${f} ${e}`},"generateDashArray"),pa=i(function(r,t,e,a,s,n,o,c=!1,l=void 0){if(!o)throw new Error(`insertEdge: missing diagramId for edge "${t.id}" \u2014 edge IDs require a diagram prefix for uniqueness`);let{handDrawnSeed:f,layout:h}=U(),m=l??h,d=t.points,p=!1,k=s;var y=n;let u=[];for(let g in t.cssCompiledStyles)At(g)||u.push(t.cssCompiledStyles[g]);if(m==="swimlane"){if(!c&&y.intersect&&k.intersect&&Array.isArray(d)&&d.length>=2)if(d.length===2){let[g,O]=d;d=$(g,O)||B(g,O)?[k.intersect(g),y.intersect(O)]:[k.intersect(O),y.intersect(g)]}else{let g=d.slice(1,-1),O=g[0],H=g[g.length-1],Y=k.intersect(O),N=d[d.length-1],F=y.intersect(H),j=g.at(-2)??d[0],D=qr(N,H,j,F),X=Vr({originalLast:N,lastInner:H,newLast:D,minLength:Ir(t.arrowTypeEnd)}),nr=Math.abs(Y.x-O.x)<q&&Math.abs(Y.y-O.y)<q?[]:[Y],sr=X?[X]:[];d=[...nr,...g,...sr]}d=Fr(t,d)}else y.intersect&&k.intersect&&!c&&(d=d.slice(1,t.points.length-1),d.unshift(k.intersect(d[0])),d.push(y.intersect(d[d.length-1])));let _=btoa(JSON.stringify(d));t.toCluster&&(x.info("to cluster abc88",e.get(t.toCluster)),d=Zt(t.points,e.get(t.toCluster).node),p=!0),t.fromCluster&&(x.debug("from cluster abc88",e.get(t.fromCluster),JSON.stringify(d,null,2)),d=Zt(d.reverse(),e.get(t.fromCluster).node).reverse(),p=!0);let w=d.filter(g=>!Number.isNaN(g.y)),W=Cr(t.curve);W!=="rounded"&&(w=Jr(w));let L=K;switch(W){case"linear":L=K;break;case"basis":L=pt;break;case"cardinal":L=bt;break;case"bumpX":L=gt;break;case"bumpY":L=xt;break;case"catmullRom":L=wt;break;case"monotoneX":L=Mt;break;case"monotoneY":L=St;break;case"natural":L=Lt;break;case"step":L=Et;break;case"stepAfter":L=Ot;break;case"stepBefore":L=_t;break;case"rounded":L=K;break;default:L=pt}let{x:I,y:R}=Wt(t),ot=yt().x(I).y(R).curve(L),P;switch(t.thickness){case"normal":P="edge-thickness-normal";break;case"thick":P="edge-thickness-thick";break;case"invisible":P="edge-thickness-invisible";break;default:P="edge-thickness-normal"}switch(t.pattern){case"solid":P+=" edge-pattern-solid";break;case"dotted":P+=" edge-pattern-dotted";break;case"dashed":P+=" edge-pattern-dashed";break;default:P+=" edge-pattern-solid"}let S,V=W==="rounded"?te(re(w,t),5):ot(w),C=Array.isArray(t.style)?t.style:[t.style],it=C.find(g=>g?.startsWith("stroke:")),G="";t.animate&&(G="edge-animation-fast"),t.animation&&(G="edge-animation-"+t.animation);let ct=!1;if(t.look==="handDrawn"){let g=$t.svg(r);Object.assign([],w);let O=g.path(V,{roughness:.3,seed:f});P+=" transition",S=T(O).select("path").attr("id",`${o}-${t.id}`).attr("class"," "+P+(t.classes?" "+t.classes:"")+(G?" "+G:"")).attr("style",C?C.reduce((Y,N)=>Y+";"+N,""):"");let H=S.attr("d");S.attr("d",H),r.node().appendChild(S.node())}else{let g=u.join(";"),O=C?C.reduce((D,X)=>D+X+";",""):"",H=(g?g+";"+O+";":O)+";"+(C?C.reduce((D,X)=>D+";"+X,""):"");S=r.append("path").attr("d",V).attr("id",`${o}-${t.id}`).attr("class"," "+P+(t.classes?" "+t.classes:"")+(G?" "+G:"")).attr("style",H),it=H.match(/stroke:([^;]+)/)?.[1],ct=t.animate===!0||!!t.animation||g.includes("animation");let Y=S.node(),N=typeof Y.getTotalLength=="function"?Y.getTotalLength():0,F=ht[t.arrowTypeStart]||0,j=ht[t.arrowTypeEnd]||0;if(t.look==="neo"&&!ct){let X=`stroke-dasharray: ${t.pattern==="dotted"||t.pattern==="dashed"?Kr(N,F,j):`0 ${F} ${N-F-j} ${j}`}; stroke-dashoffset: 0;`;S.attr("style",X+S.attr("style"))}}if(S.attr("data-edge",!0),S.attr("data-et","edge"),S.attr("data-id",t.id),S.attr("data-points",_),S.attr("data-look",Pt(t.look)),t.step!==void 0){let{themeVariables:g}=U(),O=it??g?.lineColor;Ft(r,t,V,o,{points:w,pathNode:S.node(),color:O,textColors:[g?.background,g?.primaryTextColor]})}t.showPoints&&w.forEach(g=>{r.append("circle").style("stroke","red").style("fill","red").attr("r",1).attr("cx",g.x).attr("cy",g.y)});let J="";(U().flowchart.arrowMarkerAbsolute||U().state.arrowMarkerAbsolute)&&(J=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,J=J.replace(/\(/g,"\\(").replace(/\)/g,"\\)")),x.info("arrowTypeStart",t.arrowTypeStart),x.info("arrowTypeEnd",t.arrowTypeEnd);let rr=!ct&&t?.look==="neo";Qt(S,t,J,o,a,rr,it);let er=Math.floor(d.length/2),ar=d[er];A.isLabelCoordinateInPath(ar,S.attr("d"))||(p=!0);let lt={};return p&&(lt.updatedPath=d),lt.originalPath=t.points,lt},"insertEdge");function te(r,t){if(r.length<2)return"";let e="",a=r.length,s=1e-5;for(let n=0;n<a;n++){let o=r[n],c=r[n-1],l=r[n+1];if(n===0)e+=`M${o.x},${o.y}`;else if(n===a-1)e+=`L${o.x},${o.y}`;else{let f=o.x-c.x,h=o.y-c.y,m=l.x-o.x,d=l.y-o.y,p=Math.hypot(f,h),k=Math.hypot(m,d);if(p<s||k<s){e+=`L${o.x},${o.y}`;continue}let y=f/p,u=h/p,_=m/k,w=d/k,W=y*_+u*w,L=Math.max(-1,Math.min(1,W)),I=Math.acos(L);if(I<s||Math.abs(Math.PI-I)<s){e+=`L${o.x},${o.y}`;continue}let R=Math.min(t/Math.sin(I/2),p/2,k/2),ot=o.x-y*R,P=o.y-u*R,S=o.x+_*R,V=o.y+w*R;e+=`L${ot},${P}`,e+=`Q${o.x},${o.y} ${S},${V}`}}return e}i(te,"generateRoundedPath");function Kt(r,t){if(!r||!t)return{angle:0,deltaX:0,deltaY:0};let e=t.x-r.x,a=t.y-r.y;return{angle:Math.atan2(a,e),deltaX:e,deltaY:a}}i(Kt,"calculateDeltaAndAngle");function re(r,t){let e=r.map(s=>({...s}));if(r.length>=2&&M[t.arrowTypeStart]){let s=M[t.arrowTypeStart],n=r[0],o=r[1],{angle:c}=Kt(n,o),l=s*Math.cos(c),f=s*Math.sin(c);e[0].x=n.x+l,e[0].y=n.y+f}let a=r.length;if(a>=2&&M[t.arrowTypeEnd]){let s=M[t.arrowTypeEnd],n=r[a-1],o=r[a-2],{angle:c}=Kt(o,n),l=s*Math.cos(c),f=s*Math.sin(c);e[a-1].x=n.x-l,e[a-1].y=n.y-f}return e}i(re,"applyMarkerOffsetsToPoints");var ee=i((r,t,e,a)=>{t.forEach(s=>{Pe[s](r,e,a)})},"insertMarkers"),ae=i((r,t,e)=>{x.trace("Making markers for ",e),r.append("defs").append("marker").attr("id",e+"_"+t+"-extensionStart").attr("class","marker extension "+t).attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 1,7 L18,13 V 1 Z"),r.append("defs").append("marker").attr("id",e+"_"+t+"-extensionEnd").attr("class","marker extension "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 1,1 V 13 L18,7 Z"),r.append("marker").attr("id",e+"_"+t+"-extensionStart-margin").attr("class","marker extension "+t).attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("viewBox","0 0 20 14").append("polygon").attr("points","10,7 18,13 18,1").style("stroke-width",2).style("stroke-dasharray","0"),r.append("defs").append("marker").attr("id",e+"_"+t+"-extensionEnd-margin").attr("class","marker extension "+t).attr("refX",9).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("viewBox","0 0 20 14").append("polygon").attr("points","10,1 10,13 18,7").style("stroke-width",2).style("stroke-dasharray","0")},"extension"),ne=i((r,t,e)=>{r.append("defs").append("marker").attr("id",e+"_"+t+"-compositionStart").attr("class","marker composition "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),r.append("defs").append("marker").attr("id",e+"_"+t+"-compositionEnd").attr("class","marker composition "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),r.append("defs").append("marker").attr("id",e+"_"+t+"-compositionStart-margin").attr("class","marker composition "+t).attr("refX",15).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("viewBox","0 0 15 15").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),r.append("defs").append("marker").attr("id",e+"_"+t+"-compositionEnd-margin").attr("class","marker composition "+t).attr("refX",3.5).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition"),se=i((r,t,e)=>{r.append("defs").append("marker").attr("id",e+"_"+t+"-aggregationStart").attr("class","marker aggregation "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),r.append("defs").append("marker").attr("id",e+"_"+t+"-aggregationEnd").attr("class","marker aggregation "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),r.append("defs").append("marker").attr("id",e+"_"+t+"-aggregationStart-margin").attr("class","marker aggregation "+t).attr("refX",15).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",2).attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),r.append("defs").append("marker").attr("id",e+"_"+t+"-aggregationEnd-margin").attr("class","marker aggregation "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",2).attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation"),oe=i((r,t,e)=>{r.append("defs").append("marker").attr("id",e+"_"+t+"-dependencyStart").attr("class","marker dependency "+t).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),r.append("defs").append("marker").attr("id",e+"_"+t+"-dependencyEnd").attr("class","marker dependency "+t).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z"),r.append("defs").append("marker").attr("id",e+"_"+t+"-dependencyStart-margin").attr("class","marker dependency "+t).attr("refX",4).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),r.append("defs").append("marker").attr("id",e+"_"+t+"-dependencyEnd-margin").attr("class","marker dependency "+t).attr("refX",16).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"dependency"),ie=i((r,t,e)=>{r.append("defs").append("marker").attr("id",e+"_"+t+"-lollipopStart").attr("class","marker lollipop "+t).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),r.append("defs").append("marker").attr("id",e+"_"+t+"-lollipopEnd").attr("class","marker lollipop "+t).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),r.append("defs").append("marker").attr("id",e+"_"+t+"-lollipopStart-margin").attr("class","marker lollipop "+t).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6).attr("stroke-width",2),r.append("defs").append("marker").attr("id",e+"_"+t+"-lollipopEnd-margin").attr("class","marker lollipop "+t).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6).attr("stroke-width",2)},"lollipop"),ce=i((r,t,e)=>{r.append("marker").attr("id",e+"_"+t+"-pointEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),r.append("marker").attr("id",e+"_"+t+"-pointStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),r.append("marker").attr("id",e+"_"+t+"-pointEnd-margin").attr("class","marker "+t).attr("viewBox","0 0 11.5 14").attr("refX",11.5).attr("refY",7).attr("markerUnits","userSpaceOnUse").attr("markerWidth",10.5).attr("markerHeight",14).attr("orient","auto").append("path").attr("d","M 0 0 L 11.5 7 L 0 14 z").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0"),r.append("marker").attr("id",e+"_"+t+"-pointStart-margin").attr("class","marker "+t).attr("viewBox","0 0 11.5 14").attr("refX",1).attr("refY",7).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11.5).attr("markerHeight",14).attr("orient","auto").append("polygon").attr("points","0,7 11.5,14 11.5,0").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0")},"point"),le=i((r,t,e)=>{r.append("marker").attr("id",e+"_"+t+"-circleEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),r.append("marker").attr("id",e+"_"+t+"-circleStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),r.append("marker").attr("id",e+"_"+t+"-circleEnd-margin").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refY",5).attr("refX",12.25).attr("markerUnits","userSpaceOnUse").attr("markerWidth",14).attr("markerHeight",14).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0"),r.append("marker").attr("id",e+"_"+t+"-circleStart-margin").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",-2).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",14).attr("markerHeight",14).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0")},"circle"),de=i((r,t,e)=>{r.append("marker").attr("id",e+"_"+t+"-crossEnd").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),r.append("marker").attr("id",e+"_"+t+"-crossStart").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),r.append("marker").attr("id",e+"_"+t+"-crossEnd-margin").attr("class","marker cross "+t).attr("viewBox","0 0 15 15").attr("refX",17.7).attr("refY",7.5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 1,1 L 14,14 M 1,14 L 14,1").attr("class","arrowMarkerPath").style("stroke-width",2.5),r.append("marker").attr("id",e+"_"+t+"-crossStart-margin").attr("class","marker cross "+t).attr("viewBox","0 0 15 15").attr("refX",-3.5).attr("refY",7.5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 1,1 L 14,14 M 1,14 L 14,1").attr("class","arrowMarkerPath").style("stroke-width",2.5).style("stroke-dasharray","1,0")},"cross"),pe=i((r,t,e)=>{r.append("defs").append("marker").attr("id",e+"_"+t+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"barb"),fe=i((r,t,e)=>{let a=v(),{themeVariables:s}=a,{transitionColor:n}=s;r.append("defs").append("marker").attr("id",e+"_"+t+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","strokeWidth").attr("orient","auto").append("path").attr("d","M 19,7 L11,14 L13,7 L11,0 Z"),r.append("defs").append("marker").attr("id",e+"_"+t+"-barbEnd-margin").attr("refX",17).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L11,14 L13,7 L11,0 Z").attr("fill",`${n}`)},"barbNeo"),he=i((r,t,e)=>{r.append("defs").append("marker").attr("id",e+"_"+t+"-onlyOneStart").attr("class","marker onlyOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M9,0 L9,18 M15,0 L15,18"),r.append("defs").append("marker").attr("id",e+"_"+t+"-onlyOneEnd").attr("class","marker onlyOne "+t).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M3,0 L3,18 M9,0 L9,18")},"only_one"),me=i((r,t,e)=>{let a=r.append("defs").append("marker").attr("id",e+"_"+t+"-zeroOrOneStart").attr("class","marker zeroOrOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");a.append("circle").attr("fill","white").attr("cx",21).attr("cy",9).attr("r",6),a.append("path").attr("d","M9,0 L9,18");let s=r.append("defs").append("marker").attr("id",e+"_"+t+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+t).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");s.append("circle").attr("fill","white").attr("cx",9).attr("cy",9).attr("r",6),s.append("path").attr("d","M21,0 L21,18")},"zero_or_one"),ue=i((r,t,e)=>{r.append("defs").append("marker").attr("id",e+"_"+t+"-oneOrMoreStart").attr("class","marker oneOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27"),r.append("defs").append("marker").attr("id",e+"_"+t+"-oneOrMoreEnd").attr("class","marker oneOrMore "+t).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18")},"one_or_more"),ke=i((r,t,e)=>{let a=r.append("defs").append("marker").attr("id",e+"_"+t+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");a.append("circle").attr("fill","white").attr("cx",48).attr("cy",18).attr("r",6),a.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18");let s=r.append("defs").append("marker").attr("id",e+"_"+t+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+t).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");s.append("circle").attr("fill","white").attr("cx",9).attr("cy",18).attr("r",6),s.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18")},"zero_or_more"),ye=i((r,t,e)=>{let a=v(),{themeVariables:s}=a,{strokeWidth:n}=s;r.append("defs").append("marker").attr("id",e+"_"+t+"-onlyOneStart").attr("class","marker onlyOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M9,0 L9,18 M15,0 L15,18").attr("stroke-width",`${n}`),r.append("defs").append("marker").attr("id",e+"_"+t+"-onlyOneEnd").attr("class","marker onlyOne "+t).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M3,0 L3,18 M9,0 L9,18").attr("stroke-width",`${n}`)},"only_one_neo"),ge=i((r,t,e)=>{let a=v(),{themeVariables:s}=a,{strokeWidth:n,mainBkg:o}=s,c=r.append("defs").append("marker").attr("id",e+"_"+t+"-zeroOrOneStart").attr("class","marker zeroOrOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse");c.append("circle").attr("fill",o??"white").attr("cx",21).attr("cy",9).attr("stroke-width",`${n}`).attr("r",6),c.append("path").attr("d","M9,0 L9,18").attr("stroke-width",`${n}`);let l=r.append("defs").append("marker").attr("id",e+"_"+t+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+t).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("markerUnits","userSpaceOnUse").attr("orient","auto");l.append("circle").attr("fill",o??"white").attr("cx",9).attr("cy",9).attr("stroke-width",`${n}`).attr("r",6),l.append("path").attr("d","M21,0 L21,18").attr("stroke-width",`${n}`)},"zero_or_one_neo"),xe=i((r,t,e)=>{let a=v(),{themeVariables:s}=a,{strokeWidth:n}=s;r.append("defs").append("marker").attr("id",e+"_"+t+"-oneOrMoreStart").attr("class","marker oneOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27").attr("stroke-width",`${n}`),r.append("defs").append("marker").attr("id",e+"_"+t+"-oneOrMoreEnd").attr("class","marker oneOrMore "+t).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18").attr("stroke-width",`${n}`)},"one_or_more_neo"),be=i((r,t,e)=>{let a=v(),{themeVariables:s}=a,{strokeWidth:n,mainBkg:o}=s,c=r.append("defs").append("marker").attr("id",e+"_"+t+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("markerUnits","userSpaceOnUse").attr("orient","auto");c.append("circle").attr("fill",o??"white").attr("cx",45.5).attr("cy",18).attr("r",6).attr("stroke-width",`${n}`),c.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18").attr("stroke-width",`${n}`);let l=r.append("defs").append("marker").attr("id",e+"_"+t+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+t).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto").attr("markerUnits","userSpaceOnUse");l.append("circle").attr("fill",o??"white").attr("cx",11).attr("cy",18).attr("r",6).attr("stroke-width",`${n}`),l.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18").attr("stroke-width",`${n}`)},"zero_or_more_neo"),we=i((r,t,e)=>{r.append("defs").append("marker").attr("id",e+"_"+t+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("path").attr("d",`M0,0 L20,10 M20,10 L0,20`)},"requirement_arrow"),Me=i((r,t,e)=>{let a=v(),{themeVariables:s}=a,{strokeWidth:n}=s;r.append("defs").append("marker").attr("id",e+"_"+t+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("stroke-width",`${n}`).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"),Se=i((r,t,e)=>{let a=r.append("defs").append("marker").attr("id",e+"_"+t+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("g");a.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),a.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),a.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10)},"requirement_contains"),Le=i((r,t,e)=>{let a=v(),{themeVariables:s}=a,{strokeWidth:n}=s,o=r.append("defs").append("marker").attr("id",e+"_"+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",`${n}`)},"requirement_contains_neo"),Ee=i((r,t,e)=>{r.append("marker").attr("id",e+"_"+t+"-hierarchyEnd").attr("class","marker hierarchy "+t).attr("viewBox","0 0 12 10").attr("refX",10).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",10).attr("orient","auto").append("path").attr("d","M 0 0 L 6 5 L 0 10 M 4 0 L 10 5 L 4 10").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0").style("fill","none"),r.append("marker").attr("id",e+"_"+t+"-hierarchyStart").attr("class","marker hierarchy "+t).attr("viewBox","0 0 12 10").attr("refX",2).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",10).attr("orient","auto").append("path").attr("d","M 12 0 L 6 5 L 12 10 M 8 0 L 2 5 L 8 10").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0").style("fill","none")},"hierarchy"),_e=i((r,t,e)=>{r.append("marker").attr("id",e+"_"+t+"-openArrowEnd").attr("class","marker openArrow "+t).attr("viewBox","0 0 12 12").attr("refX",11).attr("refY",6).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 1 1 L 11 6 L 1 11").attr("class","arrowMarkerPath").style("stroke-width",1.4).style("stroke-linecap","round").style("stroke-linejoin","round").style("stroke-dasharray","1,0").style("fill","none"),r.append("marker").attr("id",e+"_"+t+"-openArrowStart").attr("class","marker openArrow "+t).attr("viewBox","0 0 12 12").attr("refX",1).attr("refY",6).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 11 1 L 1 6 L 11 11").attr("class","arrowMarkerPath").style("stroke-width",1.4).style("stroke-linecap","round").style("stroke-linejoin","round").style("stroke-dasharray","1,0").style("fill","none")},"openArrow"),Oe=i((r,t,e)=>{r.append("marker").attr("id",e+"_"+t+"-hollowCircleStart").attr("class","marker hollowCircle "+t).attr("viewBox","0 0 10 10").attr("refX",0).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",10).attr("markerHeight",10).attr("orient","auto").append("circle").attr("cx",5).attr("cy",5).attr("r",3.6).attr("class","arrowMarkerPath").style("stroke-width",1.4).style("stroke-dasharray","1,0").style("fill","none"),r.append("marker").attr("id",e+"_"+t+"-hollowCircleEnd").attr("class","marker hollowCircle "+t).attr("viewBox","0 0 10 10").attr("refX",10).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",10).attr("markerHeight",10).attr("orient","auto").append("circle").attr("cx",5).attr("cy",5).attr("r",3.6).attr("class","arrowMarkerPath").style("stroke-width",1.4).style("stroke-dasharray","1,0").style("fill","none")},"hollowCircle"),Pe={extension:ae,composition:ne,aggregation:se,dependency:oe,lollipop:ie,point:ce,circle:le,cross:de,barb:pe,barbNeo:fe,hierarchy:Ee,only_one:he,zero_or_one:me,one_or_more:ue,zero_or_more:ke,only_one_neo:ye,zero_or_one_neo:ge,one_or_more_neo:xe,zero_or_more_neo:be,requirement_arrow:we,requirement_contains:Se,requirement_arrow_neo:Me,requirement_contains_neo:Le,openArrow:_e,hollowCircle:Oe},ka=ee;export{Ht as a,rt as b,M as c,ht as d,Ne as e,st as f,E as g,ia as h,ca as i,la as j,Nr as k,da as l,pa as m,ka as n};