@lancc/cmark 1.2.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/LICENSE +21 -21
- package/README.md +47 -107
- package/assets/abnfDiagram-WEYOIA3C-CKV_7Upb.js +1 -0
- package/assets/architectureDiagram-ZHVYKT53-BvLudDvk.js +1 -0
- package/assets/blockDiagram-RJAE7QA3--gzkMGi2.js +1 -0
- package/assets/c4Diagram-XDPPPE54-ByfRiJGR.js +1 -0
- package/assets/chunk-2E7WHVMD-TfbC_dmh.js +1 -0
- package/assets/chunk-2Q5K7J3B-0YJgChVo.js +1 -0
- package/assets/chunk-4EMNKR2T-DHoYW7g5.js +1 -0
- package/assets/chunk-55XCU76K-Cq25Yw_G.js +1 -0
- package/assets/chunk-5VM5RSS4-CJaRXFHK.js +1 -0
- package/assets/chunk-JWPE2WC7-BP2iXBhe.js +1 -0
- package/assets/chunk-VQ5W62QI-B95zur4F.js +1 -0
- package/assets/chunk-XXDRQBXY-Ct0MhvQo.js +1 -0
- package/assets/chunk-ZCHMQSOR-C5VhW-wL.js +2 -0
- package/assets/classDiagram-v2-4MYWR3UA-C1G-Vkj0.js +1 -0
- package/assets/cose-bilkent-JH36ORCC-qIQoIBv0.js +1 -0
- package/assets/cynefin-EF2NZ3EQ-CR1E3YiZ.js +1 -0
- package/assets/cynefinDiagram-WF24UDRP-DaJFvZ3b.js +1 -0
- package/assets/cytoscape.esm-SjxgSg6I.js +9 -0
- package/assets/dagre-NK4GIZVX-BFRQhpii.js +1 -0
- package/assets/diagram-CBK3MWTC-DlueL6XZ.js +1 -0
- package/assets/diagram-I5XIIV2D-bITyafYX.js +1 -0
- package/assets/diagram-ODIL2UCW-Dlb4hg_-.js +1 -0
- package/assets/diagram-PFBEJUXE-CRfen0O7.js +1 -0
- package/assets/diagram-RJA3I4VV-CK-FlhGV.js +1 -0
- package/assets/diagram-TYUNFSNR-DmgVsxqa.js +1 -0
- package/assets/ebnfDiagram-V4P3TTPT-B9KGI9eQ.js +1 -0
- package/assets/echarts-CytsvCdp.js +25 -0
- package/assets/elk-QONTBCTQ-VgDftvsU.js +1 -0
- package/assets/erDiagram-KYQIGQAA-DkpP7sS4.js +1 -0
- package/assets/flowDiagram-IUGLLWBU-CRXa9Kxy.js +1 -0
- package/assets/ganttDiagram-R7GPNTJY-Cu2I55Wb.js +1 -0
- package/assets/gitGraphDiagram-PDYL7XHY-CwSo663I.js +1 -0
- package/assets/graph-Dz7AM1Q5.js +1 -0
- package/assets/index-BJ-NdQc4.js +100 -0
- package/assets/infoDiagram-MVDRKAX5-D3Qknzuo.js +1 -0
- package/assets/ishikawaDiagram-HPEHV2GE-9qYT75tk.js +1 -0
- package/assets/journeyDiagram-BOSHW7O7-DeSrJg9o.js +1 -0
- package/assets/kanban-definition-FNSA4HC5-DINkB6G7.js +1 -0
- package/assets/katex-DN8cTsI3.js +1 -0
- package/assets/markdown-S2mWvoE-.js +5 -0
- package/assets/mermaid-T_6Ze_cT.js +7 -0
- package/assets/mindmap-definition-6OY57UG3-DW5hqiAe.js +1 -0
- package/assets/pegDiagram-ECIUJNBX-BWy_tkzy.js +1 -0
- package/assets/pieDiagram-GNMPY74T-CniJbr6l.js +1 -0
- package/assets/quadrantDiagram-D57K4MC3-BVnDJkCv.js +1 -0
- package/assets/railroadDiagram-Y72NRBL7-BNKZpJJb.js +1 -0
- package/assets/requirementDiagram-EQYSW5RA-BETipHj0.js +1 -0
- package/assets/sankeyDiagram-SY24JHO5-ByEYqT7T.js +1 -0
- package/assets/sequenceDiagram-BLEHNHQU-BqCJ2tKG.js +1 -0
- package/assets/sizeCapture-INFHLROL-DlhrWFj-.js +1 -0
- package/assets/stateDiagram-v2-A6IESKWZ-DJUBWLTP.js +1 -0
- package/assets/swimlanes-B3ENRKFQ-D7k7tF5U.js +1 -0
- package/assets/swimlanesDiagram-AYQRV4AK-DoQBgB9o.js +1 -0
- package/assets/timeline-definition-JXYKGLGB-BCNhwnn6.js +1 -0
- package/assets/usecaseDiagram-WPOLBNNX-DRa_Rgl3.js +1 -0
- package/assets/vennDiagram-Q3Y3IDCW-Ba2eaO68.js +1 -0
- package/assets/wardleyDiagram-IVAIDKWA-W_i9vzY-.js +1 -0
- package/assets/xychartDiagram-4URNHDU4-ByfaGjvc.js +1 -0
- package/index.html +3 -3
- package/package.json +1 -1
- package/plugin.json +1 -1
- package/preload/git-panel.js +29 -5
- package/preload/git-service.js +48 -15
- package/preload/remote-setup.js +66 -33
- package/preload/remote-wizard.js +2 -0
- package/preload.js +30 -0
- package/assets/abnfDiagram-WEYOIA3C-BgXsTF7a.js +0 -1
- package/assets/architectureDiagram-ZHVYKT53-BsCWa_qC.js +0 -36
- package/assets/blockDiagram-RJAE7QA3-wbIxEiYN.js +0 -140
- package/assets/c4Diagram-XDPPPE54-5zdyxFvA.js +0 -38
- package/assets/chunk-2E7WHVMD-F85Lca-i.js +0 -88
- package/assets/chunk-2Q5K7J3B-CjpAZ0OI.js +0 -1
- package/assets/chunk-4EMNKR2T-C8Kbh83c.js +0 -1
- package/assets/chunk-55XCU76K-BINcFiLN.js +0 -1
- package/assets/chunk-5VM5RSS4-Diy5h2LS.js +0 -15
- package/assets/chunk-JWPE2WC7-BXnjDdh1.js +0 -1
- package/assets/chunk-VQ5W62QI-BM7ZZo1I.js +0 -1
- package/assets/chunk-XXDRQBXY-CW8CjB1w.js +0 -1
- package/assets/chunk-ZCHMQSOR-C7ATz1L1.js +0 -2
- package/assets/classDiagram-v2-4MYWR3UA-CMoqNk-b.js +0 -217
- package/assets/cose-bilkent-JH36ORCC-6rqR5iJk.js +0 -1
- package/assets/cynefin-EF2NZ3EQ-DypLIJxl.js +0 -141
- package/assets/cynefinDiagram-WF24UDRP-8b2CEBlR.js +0 -62
- package/assets/cytoscape.esm-CjX6Hyah.js +0 -331
- package/assets/dagre-NK4GIZVX-Dv6vuUbR.js +0 -4
- package/assets/diagram-CBK3MWTC-DJgMDeYd.js +0 -24
- package/assets/diagram-I5XIIV2D-BB9cMoRW.js +0 -24
- package/assets/diagram-ODIL2UCW-BVcRtsdy.js +0 -30
- package/assets/diagram-PFBEJUXE-BbGSOtJx.js +0 -3
- package/assets/diagram-RJA3I4VV-CzkY_8Fo.js +0 -41
- package/assets/diagram-TYUNFSNR-YTl5QdfL.js +0 -200
- package/assets/ebnfDiagram-V4P3TTPT-COVjPAjE.js +0 -1
- package/assets/echarts-BAPDkhe3.js +0 -61
- package/assets/elk-QONTBCTQ-DHsjY8Z_.js +0 -27
- package/assets/erDiagram-KYQIGQAA-CUAbTUl1.js +0 -99
- package/assets/flowDiagram-IUGLLWBU-CWsiqTQC.js +0 -213
- package/assets/ganttDiagram-R7GPNTJY-DetBW0Wm.js +0 -292
- package/assets/gitGraphDiagram-PDYL7XHY-ByrdgJmw.js +0 -106
- package/assets/graph-D8UmR1vK.js +0 -1
- package/assets/index-B17NCAw4.js +0 -758
- package/assets/infoDiagram-MVDRKAX5-BM48fjhU.js +0 -2
- package/assets/ishikawaDiagram-HPEHV2GE-DtHYywHZ.js +0 -70
- package/assets/journeyDiagram-BOSHW7O7-DJ1LiRh3.js +0 -139
- package/assets/kanban-definition-FNSA4HC5-DPPt8pwJ.js +0 -89
- package/assets/katex-CQL9J12G.js +0 -257
- package/assets/markdown-DVehI1Sg.js +0 -314
- package/assets/mermaid-C_q9pug0.js +0 -312
- package/assets/mindmap-definition-6OY57UG3-zbqYOEY6.js +0 -98
- package/assets/pegDiagram-ECIUJNBX-e7QG7TMq.js +0 -1
- package/assets/pieDiagram-GNMPY74T-Duf6YP0N.js +0 -39
- package/assets/quadrantDiagram-D57K4MC3-B2eYoUUy.js +0 -7
- package/assets/railroadDiagram-Y72NRBL7-BWCzPcI_.js +0 -1
- package/assets/requirementDiagram-EQYSW5RA-HhPMEqB1.js +0 -84
- package/assets/sankeyDiagram-SY24JHO5-CMUTwFBB.js +0 -40
- package/assets/sequenceDiagram-BLEHNHQU-C9wR2ll7.js +0 -169
- package/assets/sizeCapture-INFHLROL-DXfz37S6.js +0 -1
- package/assets/stateDiagram-v2-A6IESKWZ-D_gtonhE.js +0 -291
- package/assets/swimlanes-B3ENRKFQ-DdJOuuMV.js +0 -1
- package/assets/swimlanesDiagram-AYQRV4AK-BWt3HxHV.js +0 -8
- package/assets/timeline-definition-JXYKGLGB-DQsdwJe-.js +0 -120
- package/assets/usecaseDiagram-WPOLBNNX-DTRyFq7d.js +0 -370
- package/assets/vennDiagram-Q3Y3IDCW-dihYszm0.js +0 -34
- package/assets/wardleyDiagram-IVAIDKWA-BoPpgYfK.js +0 -78
- package/assets/xychartDiagram-4URNHDU4-DoLjYxeB.js +0 -7
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as rr}from"./chunk-4EMNKR2T-C8Kbh83c.js";import{c as ir}from"./chunk-ZCHMQSOR-C7ATz1L1.js";import{_ as l,l as yn}from"./mermaid-C_q9pug0.js";import"./graph-D8UmR1vK.js";import"./markdown-DVehI1Sg.js";function To(t,{measure:e}){const n=t.config?.swimlane?.lineHops;if(n===!1)return;const o=n==="gap"?"gap":"arc",s=t.edges.filter(r=>Array.isArray(r.points)&&r.points.length>=2).map(r=>({id:r.id,points:r.points,curve:r.curve,arrowTypeStart:r.arrowTypeStart,arrowTypeEnd:r.arrowTypeEnd}));rr(e.groups.edgePaths,s,{enabled:!0,jumpRadius:6,jumpStyle:o})}l(To,"applySwimlaneLineJumps");var hn="__swimlane_default__",cr=21,Mo=20;function xn(t){return Math.max(t.padding??Mo,Mo)}l(xn,"topLaneHorizontalPadding");function wo(t){const{x:e,y:n,width:o,height:s}=t,r=t.swimlaneContentTop;if(typeof e!="number"||typeof n!="number"||typeof o!="number"||typeof s!="number"||typeof r!="number"||!Number.isFinite(e)||!Number.isFinite(n)||!Number.isFinite(o)||!Number.isFinite(s)||!Number.isFinite(r)||o<=0||s<=0){delete t.groupTitleRect;return}const f=n-s/2,c=Math.min(r,n+s/2),h=Math.min(cr,Math.max(0,c-f)),m=f+h;if(m<=f){delete t.groupTitleRect;return}t.groupTitleRect={left:e-o/2,right:e+o/2,top:f,bottom:m}}l(wo,"assignTopLaneTitleRect");function Eo(t){const e=t.direction,n=t.nodes??=[];for(const r of t.nodes??[])r.isGroup&&!r.parentId&&(r.shape="swimlane",e&&(r.direction=e));const o=n.filter(r=>!r.isGroup&&!r.parentId);if(o.length===0)return;let s=n.find(r=>r.id===hn);s?s.isGroup&&(s.shape="swimlane",e&&(s.direction=e)):(s={id:hn,label:"",isGroup:!0,shape:"swimlane",padding:20,look:t.config?.look,colorIndex:n.reduce((r,f)=>Math.max(r,f.colorIndex??-1),-1)+1,...e?{direction:e}:{}},n.push(s));for(const r of o)r.parentId=hn}l(Eo,"prepareLayoutForSwimlanes");function Ao(t){const e=new Map;for(const h of t.nodes??[])e.set(h.id,h);const n=[];for(const h of t.edges??[]){const m=typeof h.start=="string"?h.start:void 0,y=typeof h.end=="string"?h.end:void 0;!m||!y||h.labelNodeId||n.push({id:h.id,src:m,dst:y,ref:h})}const o=t.nodes??[],s=o.filter(h=>h.isGroup),r=o.filter(h=>!h.isGroup);return{nodes:[...[...s].reverse(),...r].map(h=>h.id),edges:n,layout:t,nodeById:e}}l(Ao,"toGraphView");function Ro(t,e,n,o){const{layout:s}=t,r=t.nodeById,f=o?.layerGap??100,c=o?.nodeGap??40;let h=0;for(const C of e.layers){let d=0;for(const u of C){const i=r.get(u);if(!i){d++;continue}i.layer=h,i.order=d;const x=n.x[u]??d*c,L=n.y[u]??h*f;i.x=x,i.y=L,d++}h++}const m=s.nodes??[],y=new Map,g=[];for(const C of m){if(!C?.isGroup)continue;C.parentId||g.push(C);const d=m.filter(I=>I.parentId===C.id);let u=1/0,i=-1/0,x=1/0,L=-1/0;for(const I of d){const E=I.x??n.x[I.id],T=I.y??n.y[I.id],p=I.width??0,M=I.height??0;E!=null&&T!=null&&(u=Math.min(u,E-p/2),i=Math.max(i,E+p/2),x=Math.min(x,T-M/2),L=Math.max(L,T+M/2))}if(u===1/0||x===1/0)C.x=C.x??0,C.y=C.y??0,C.width=C.width??0,C.height=C.height??0;else{const I=C.padding??20,E=C.parentId?I:2*xn(C),T=I,p=Math.max(0,i-u)+E,M=Math.max(0,L-x)+T,A=(u+i)/2,R=(x+L)/2;C.x=A,C.y=R,C.width=p,C.height=M,y.set(C.id,{minX:u,maxX:i,minY:x,maxY:L})}}if(g.length>0&&y.size>0){let C=1/0,d=-1/0,u=0;for(const i of g){const x=i.padding??20;x>u&&(u=x);const L=y.get(i.id);L&&(C=Math.min(C,L.minY),d=Math.max(d,L.maxY))}if(C!==1/0&&d!==-1/0){const i=Math.max(0,d-C),L=Math.max(u,36),I=i+2*L,E=(C+d)/2;for(const k of g)k.y=E,k.height=I,k.swimlaneContentTop=C;const T=[...g].sort((k,O)=>{const F=k.x??0,D=O.x??0;return F-D}),p=[],M=[],A=[];for(const k of T){const O=y.get(k.id);if(!O)continue;const F=Math.max(0,O.maxX-O.minX)+2*xn(k),D=(O.minX+O.maxX)/2;p.push(k.id),M.push(D),A.push(F)}const R=p.length;if(R>0){const k=new Map;if(R===1)k.set(p[0],A[0]);else{const O=[];for(let j=0;j<R-1;j++)O.push(M[j+1]-M[j]);const F=new Array(R);F[0]=0;for(let j=0;j<R-1;j++)F[j+1]=2*O[j]-F[j];let D=0,B=Number.POSITIVE_INFINITY;for(let j=0;j<R;j++){const Z=A[j];j%2===0?D=Math.max(D,Z-F[j]):B=Math.min(B,F[j]-Z)}let G=D;D<=B?G=(D+B)/2:G=D;for(let j=0;j<R;j++){const Z=F[j]+(j%2===0?G:-G),dt=Math.max(A[j],Z);k.set(p[j],dt)}}for(const O of g){const F=k.get(O.id);F!=null&&(O.width=F),wo(O)}}}}}l(Ro,"writeBackToLayoutData");var ar="[EdgeLabelNodes]";function No(t){const e=[],n=[],o=new Map;for(const f of t.nodes)o.set(f.id,f);for(const f of t.edges){if(!f.label||f.label.length===0||f.isLayoutOnly||f.labelNodeId)continue;const c=f.start?o.get(f.start):void 0,h=f.end?o.get(f.end):void 0;if(!c||!h){yn.warn(ar,`Edge ${f.id} has missing source or target node`);continue}const m=`edge-label-${f.start}-${f.end}-${f.id}`,g=c.parentId!==h.parentId?h.parentId:c.parentId,C={id:m,label:f.label,edgeStart:f.start??"",edgeEnd:f.end??"",shape:"labelRect",width:0,height:0,isEdgeLabel:!0,isDummy:!0,parentId:g,isGroup:!1,labelStyle:Array.isArray(f.labelStyle)?f.labelStyle[0]:f.labelStyle??"",...c.dir?{dir:c.dir}:{}};e.push(C),f.labelNodeId=m,f.label=void 0,f.text=void 0;const d={id:`${f.id}-to-label`,start:f.start,end:m,type:"normal",isLayoutOnly:!0},u={id:`${f.id}-from-label`,start:m,end:f.end,type:"normal",isLayoutOnly:!0};n.push(d,u)}const s=[...t.nodes,...e],r=[...t.edges,...n];return{...t,nodes:s,edges:r}}l(No,"createEdgeLabelNodes");var _t=.001;function qn(t){const e=t.x??0,n=t.y??0,o=t.width??0,s=t.height??0;return o>0&&s>0?{cx:e,cy:n,rect:we(e,n,o,s)}:void 0}l(qn,"measuredNodeRect");function Zn(t){if(t.isGroup)return;const e=qn(t);return e?{id:String(t.id??""),cx:e.cx,cy:e.cy,rect:e.rect}:void 0}l(Zn,"nodeBoundsInfoFor");function oe(t,e,n=_t){return Math.abs(t.x-e.x)<n&&Math.abs(t.y-e.y)<n}l(oe,"samePoint");function ft(t,e,n=_t){return Math.abs(t.x-e.x)<n}l(ft,"sameX");function ht(t,e,n=_t){return Math.abs(t.y-e.y)<n}l(ht,"sameY");function wt(t,e,n=_t){return ht(t,e,n)&&Math.abs(t.x-e.x)>n}l(wt,"isHorizontalSegment");function Et(t,e,n=_t){return ft(t,e,n)&&Math.abs(t.y-e.y)>n}l(Et,"isVerticalSegment");function $t(t,e,n,o){return Math.max(0,Math.min(Math.max(t,e),Math.max(n,o))-Math.max(Math.min(t,e),Math.min(n,o)))}l($t,"overlapLength");function ie(t,e,n=_t){return t.horizontal&&e.horizontal&&ht(t.a,e.a,n)?$t(t.a.x,t.b.x,e.a.x,e.b.x):t.vertical&&e.vertical&&ft(t.a,e.a,n)?$t(t.a.y,t.b.y,e.a.y,e.b.y):0}l(ie,"sameAxisSegmentOverlapLength");function Ee(t,e=_t){const n=[];for(let o=0;o<t.length-1;o++){const s=t[o],r=t[o+1],f=wt(s,r,e),c=Et(s,r,e);(f||c)&&n.push({index:o,a:s,b:r,horizontal:f,vertical:c})}return n}l(Ee,"orthogonalSegmentsForPoints");function Qt(t,e=_t){const n=Ee(t,e);let o=0;for(let s=1;s<n.length;s++)n[s-1].horizontal!==n[s].horizontal&&o++;return o}l(Qt,"countOrthogonalBends");function mt(t,e=_t){const n=[];for(const o of t){const s=n.length>0?n[n.length-1]:void 0;(!s||!oe(s,o,e))&&n.push({x:o.x,y:o.y})}return n}l(mt,"dedupeConsecutivePoints");function Jn(t,e=_t){if(!t||t.length!==4)return;const[n,o,s,r]=t;return wt(n,o,e)&&Et(o,s,e)&&wt(s,r,e)?{kind:"HVH",p0:n,p1:o,p2:s,p3:r}:Et(n,o,e)&&wt(o,s,e)&&Et(s,r,e)?{kind:"VHV",p0:n,p1:o,p2:s,p3:r}:void 0}l(Jn,"classifyThreeSegmentRoute");function Je(t,e,n,o=0){const s=Math.min(t.x,e.x),r=Math.max(t.x,e.x),f=Math.min(t.y,e.y),c=Math.max(t.y,e.y);return r>n.left-o&&s<n.right+o&&c>n.top-o&&f<n.bottom+o}l(Je,"segmentBoundsOverlapRect");function Qn(t,e,n=0){return t.x>e.left+n&&t.x<e.right-n&&t.y>e.top+n&&t.y<e.bottom-n}l(Qn,"pointInsideRect");function Oo(t,e){return t.left<=e.left&&t.right>=e.right&&t.top<=e.top&&t.bottom>=e.bottom}l(Oo,"rectContainsRect");function ze(t,e){return t.left<e.right&&t.right>e.left&&t.top<e.bottom&&t.bottom>e.top}l(ze,"rectsOverlap");function bn(t,e){return{left:t.left-e,right:t.right+e,top:t.top-e,bottom:t.bottom+e}}l(bn,"inflateRect");function we(t,e,n,o){return{left:t-n/2,right:t+n/2,top:e-o/2,bottom:e+o/2}}l(we,"rectFromCenterSize");function qt(t){return qn(t)?.rect}l(qt,"rectOfNodeBounds");function Ie(t,e){switch(e){case"top":return{x:t.cx,y:t.rect.top};case"bottom":return{x:t.cx,y:t.rect.bottom};case"left":return{x:t.rect.left,y:t.cy};case"right":return{x:t.rect.right,y:t.cy}}}l(Ie,"portForRectSide");function to(t,e,n,o,s,r=_t){const f=e==="left"||e==="right",c=o==="left"||o==="right";if(f&&c){if(e==="right"&&o==="left"&&t.x<n.x||e==="left"&&o==="right"&&t.x>n.x){if(ht(t,n,r))return[t,n];const g=(t.x+n.x)/2;return[t,{x:g,y:t.y},{x:g,y:n.y},n]}if(e===o){if(ht(t,n,r))return;const g=e==="left"?Math.min(t.x,n.x)-s:Math.max(t.x,n.x)+s;return[t,{x:g,y:t.y},{x:g,y:n.y},n]}return}if(!f&&!c){if(e===o){if(ft(t,n,r))return;const C=e==="top"?Math.min(t.y,n.y)-s:Math.max(t.y,n.y)+s;return[t,{x:t.x,y:C},{x:n.x,y:C},n]}if(!(e==="bottom"&&o==="top"&&t.y<n.y||e==="top"&&o==="bottom"&&t.y>n.y))return;if(ft(t,n,r))return[t,n];const g=(t.y+n.y)/2;return[t,{x:t.x,y:g},{x:n.x,y:g},n]}if(f&&!c){const y=e==="right"&&n.x>t.x||e==="left"&&n.x<t.x,g=o==="top"&&t.y<n.y||o==="bottom"&&t.y>n.y;return y&&g?[t,{x:n.x,y:t.y},n]:void 0}const h=e==="bottom"&&n.y>t.y||e==="top"&&n.y<t.y,m=o==="left"&&t.x<n.x||o==="right"&&t.x>n.x;return h&&m?[t,{x:t.x,y:n.y},n]:void 0}l(to,"buildOrthogonalPortPath");function eo(t,e,n,o){return e==="left"||e==="right"?[t,{x:o,y:t.y},{x:o,y:n.y},n]:[t,{x:t.x,y:o},{x:n.x,y:o},n]}l(eo,"buildSameSideTrackPath");function Qe(t){const e=new Map,n=[];for(const o of t){if(o.isEdgeLabel)continue;const s=Zn(o);s&&(e.set(s.id,s),n.push({id:s.id,rect:s.rect}))}return{nodeInfoById:e,realNodeRects:n}}l(Qe,"collectRealNodeBounds");function me(t){const e=[],n=[];for(const o of t){const s=Zn(o);if(!s)continue;const r={id:s.id,rect:s.rect};o.isEdgeLabel?n.push(r):e.push(r)}return{realNodeRects:e,labelNodeRects:n}}l(me,"collectNodeRectEntries");function Bo(t,{includeEdgeLabels:e=!0}={}){const n=[];for(const o of t){if(o.isGroup||!e&&o.isEdgeLabel)continue;const s=o.x??0,r=o.y??0,f=o.width??0,c=o.height??0;n.push({nodeId:o.id,...we(s,r,f,c)})}return n}l(Bo,"collectLayoutNodeRects");function no(t,e,n=_t){const o=t.start,s=t.end;if(!o||!s)return;const r=e.get(o),f=e.get(s);if(!(!r||!f))return{srcId:o,dstId:s,srcInfo:r,dstInfo:f,collinearX:Math.abs(r.cx-f.cx)<n,collinearY:Math.abs(r.cy-f.cy)<n}}l(no,"getNodePairGeometry");function At(t,e,n,o=[],s=0){for(const r of n)if(!o.includes(r.id)&&Je(t,e,r.rect,-s))return!0;return!1}l(At,"segmentHitsAnyRect");function oo(t,e,n,o,s=_t,r=1e-6){const f=ht(t,e,s),c=ft(t,e,s),h=ht(n,o,s),m=ft(n,o,s);if(f&&h||c&&m||!(f||c)||!(h||m))return!1;const y=f?{a:t,b:e}:{a:n,b:o},g=c?{a:t,b:e}:{a:n,b:o},C=y.a.y,d=Math.min(y.a.x,y.b.x),u=Math.max(y.a.x,y.b.x),i=g.a.x,x=Math.min(g.a.y,g.b.y),L=Math.max(g.a.y,g.b.y);if(i<d||i>u||C<x||C>L)return!1;const I=Math.abs(i-y.a.x)<r&&Math.abs(C-y.a.y)<r||Math.abs(i-y.b.x)<r&&Math.abs(C-y.b.y)<r,E=Math.abs(i-g.a.x)<r&&Math.abs(C-g.a.y)<r||Math.abs(i-g.b.x)<r&&Math.abs(C-g.b.y)<r;return!(I&&E)}l(oo,"orthogonalSegmentsCross");function Po(t,e,n,o,s=_t){const r=ht(t,e,s),f=ft(t,e,s),c=ht(n,o,s),h=ft(n,o,s);return f&&h&&ft(t,n,s)?$t(t.y,e.y,n.y,o.y)>s:r&&c&&ht(t,n,s)?$t(t.x,e.x,n.x,o.x)>s:!1}l(Po,"sameAxisSegmentsOverlap");function $e(t,e,n,o,{epsilon:s=_t,skipDegenerateOther:r=!1}={}){for(const f of n){if(f===o||f.isLayoutOnly)continue;const c=f.points;if(!(!c||c.length<2))for(let h=0;h<c.length-1;h++){const m=c[h],y=c[h+1];if(!(r&&oe(m,y,s))&&(oo(t,e,m,y,s)||Po(t,e,m,y,s)))return!0}}return!1}l($e,"segmentConflictsWithAnyEdge");function ae(t,e,n,o,s=_t){const r=ht(t,e,s),f=ft(t,e,s),c=ht(n,o,s),h=ft(n,o,s);if(!(r&&h||f&&c))return!1;const m=r?{a:t,b:e}:{a:n,b:o},y=r?{a:n,b:o}:{a:t,b:e},g=m.a.y,C=Math.min(m.a.x,m.b.x),d=Math.max(m.a.x,m.b.x),u=y.a.x,i=Math.min(y.a.y,y.b.y),x=Math.max(y.a.y,y.b.y);return u>C+s&&u<d-s&&g>i+s&&g<x-s}l(ae,"orthogonalSegmentsStrictlyCross");function In(t,e,n){const o=Math.min(e,n),s=Math.max(e,n);return t>o+_t&&t<s-_t}l(In,"strictlyBetween");function ko(t,e,n){return ft(t,e)&&ft(e,n)?In(e.y,t.y,n.y):ht(t,e)&&ht(e,n)?In(e.x,t.x,n.x):!1}l(ko,"isCollinearIntermediate");function Fo(t){let e=!1;const n=[];for(let o=0;o<t.length;o++){const s=n[n.length-1],r=t[o],f=o+1<t.length?t[o+1]:void 0;if(s&&f){if(oe(s,f)){o++,e=!0;continue}if(ko(s,r,f)){e=!0;continue}}n.push(r)}return{points:n,changed:e}}l(Fo,"simplifyPolylineOnce");function Ve(t){const e=[t[0]];for(let o=1;o<t.length;o++){const s=e[e.length-1],r=t[o];if(!ft(s,r)&&!ht(s,r)){const f=e.length>=2?e[e.length-2]:void 0,h=(f?ft(f,s):!1)?{x:s.x,y:r.y}:{x:r.x,y:s.y};e.push(h)}e.push(r)}const n=[];for(const o of e){const s=n[n.length-1];(!s||!oe(s,o))&&n.push(o)}return n}l(Ve,"orthogonalizePolyline");function ce(t){if(t.length<3)return t;let e=[...t];for(let n=0;n<32;n++){const o=Fo(e);if(e=o.points,!o.changed)break}return e}l(ce,"simplifyPolyline");var nt=.001,lr=.5,So=4;function so(t,e,n){const o=t;if(o.isLayoutOnly||!o.points||o.points.length<n)return;const s=o.start?e.get(o.start):void 0,r=o.end?e.get(o.end):void 0;return{edge:o,points:o.points,srcRect:s?qt(s):void 0,dstRect:r?qt(r):void 0}}l(so,"endpointContextFor");function _o(t,e,n){if(ht(t,e,nt))return{x:t.x<n.left?n.left:n.right,y:t.y};if(ft(t,e,nt)){const o=t.y<n.top?n.top:n.bottom;return{x:t.x,y:o}}return{x:Math.min(n.right,Math.max(n.left,t.x)),y:Math.min(n.bottom,Math.max(n.top,t.y))}}l(_o,"segmentEnterPoint");function Mn(t,e,n){const o=n?1:-1;let s=n?0:t.length-1;for(;s>=0&&s<t.length&&Qn(t[s],e,lr);)s+=o;if(s<0||s>=t.length)return t;const r=s-o;if(r<0||r>=t.length)return t;const f=_o(t[s],t[r],e);return n?[f,...t.slice(s)]:[...t.slice(0,s+1),f]}l(Mn,"clipEndpoint");function Ho(t,e){for(const n of t){const o=so(n,e,2);if(!o)continue;let s=[...o.points];o.srcRect&&(s=Mn(s,o.srcRect,!0)),o.dstRect&&(s=Mn(s,o.dstRect,!1)),s=ce(Ve(s)),s=ro(s,o.srcRect,o.dstRect),o.edge.points=ce(Ve(s))}}l(Ho,"clipEdgeEndpointsToNodeBoundaries");function Sn(t,e,n,o=!1){if(ht(t,e,nt)){if(e.y<n.top-nt||e.y>n.bottom+nt)return e;if(o){if(t.x<n.left-nt)return{x:n.left,y:t.y};if(t.x>n.right+nt)return{x:n.right,y:t.y}}return{x:Math.abs(e.x-n.left)<=Math.abs(e.x-n.right)?n.left:n.right,y:t.y}}if(ft(t,e,nt)){if(e.x<n.left-nt||e.x>n.right+nt)return e;if(o){if(t.y<n.top-nt)return{x:t.x,y:n.top};if(t.y>n.bottom+nt)return{x:t.x,y:n.bottom}}const s=Math.abs(e.y-n.top)<=Math.abs(e.y-n.bottom);return{x:t.x,y:s?n.top:n.bottom}}return e}l(Sn,"snapEndpointToBoundary");function je(t,e,n){const o=t[e];for(let s=e+n;s>=0&&s<t.length;s+=n){const r=t[s];if(!oe(r,o,nt))return r}return t[e+n]}l(je,"firstDistinctAdjacent");function Ue(t,e){const n=t+So,o=e-So;return n<=o?{lo:n,hi:o}:{lo:(t+e)/2,hi:(t+e)/2}}l(Ue,"cornerClearanceRange");function Cn(t,e,n){const{lo:o,hi:s}=Ue(e,n);return Math.min(s,Math.max(o,t))}l(Cn,"clampToCornerClearance");function Do(t){const e=Math.max(...t.map(o=>o.lo)),n=Math.min(...t.map(o=>o.hi));if(!(e>n))return{lo:e,hi:n}}l(Do,"intersectRanges");function vn(t,e){return e==="left"||e==="right"?Ue(t.top,t.bottom):Ue(t.left,t.right)}l(vn,"clearanceRangeForSide");function We(t,e,n){const o=t.y>=n.top-nt&&t.y<=n.bottom+nt,s=t.x>=n.left-nt&&t.x<=n.right+nt;if(ht(t,e,nt)&&o){if(Math.abs(t.x-n.left)<nt)return"left";if(Math.abs(t.x-n.right)<nt)return"right"}if(ft(t,e,nt)&&s){if(Math.abs(t.y-n.top)<nt)return"top";if(Math.abs(t.y-n.bottom)<nt)return"bottom"}}l(We,"terminalSideForSegment");function Re(t){return t==="left"||t==="right"}l(Re,"isHorizontalSide");function Xo(t,e,n,o,s){const r=[],f=n?We(t,e,n):void 0,c=o?We(e,t,o):void 0;return n&&f&&Re(f)===s&&r.push(vn(n,f)),o&&c&&Re(c)===s&&r.push(vn(o,c)),r.length>0?Do(r):void 0}l(Xo,"straightClearanceRange");function Ln(t,e,n,o,s){const r=Xo(t,e,n,o,s);if(!r)return;const f=s?t.y:t.x,c=Math.min(r.hi,Math.max(r.lo,f));if(!(Math.abs(c-f)<nt))return s?[{x:t.x,y:c},{x:e.x,y:c}]:[{x:c,y:t.y},{x:c,y:e.y}]}l(Ln,"clearStraightEndpointCornerAxis");function ro(t,e,n){if(t.length!==2)return t;const[o,s]=t;return ht(o,s,nt)?Ln(o,s,e,n,!0)??t:ft(o,s,nt)?Ln(o,s,e,n,!1)??t:t}l(ro,"clearStraightEndpointCornerConnections");function Yo(t,e,n){return Re(n)?{x:t.x,y:Cn(t.y,e.top,e.bottom)}:{x:Cn(t.x,e.left,e.right),y:t.y}}l(Yo,"cornerClearedEndpoint");function Go(t,e,n,o,s,r){const f=t.map(c=>({...c}));for(let c=e;c>=0&&c<t.length;c+=n){const h=t[c];if(r&&!ht(h,o,nt)||!r&&!ft(h,o,nt))break;r?f[c].y=s.y:f[c].x=s.x}return f}l(Go,"moveCollinearEndpointRun");function Tn(t,e,n){if(t.length<2)return t;const o=n?0:t.length-1,s=n?1:-1,r=t[o],f=je(t,o,s);if(!f)return t;const c=We(r,f,e);if(!c)return t;const h=Re(c),m=Yo(r,e,c);return oe(r,m,nt)?t:Go(t,o,s,r,m,h)}l(Tn,"clearEndpointCornerConnection");function wn(t,e,n){const o=Math.min(t.x,e.x)>=n.left-nt&&Math.max(t.x,e.x)<=n.right+nt,s=Math.min(t.y,e.y)>=n.top-nt&&Math.max(t.y,e.y)<=n.bottom+nt;if(Math.abs(t.y-n.top)<nt&&Math.abs(e.y-n.top)<nt&&o)return"top";if(Math.abs(t.y-n.bottom)<nt&&Math.abs(e.y-n.bottom)<nt&&o)return"bottom";if(Math.abs(t.x-n.left)<nt&&Math.abs(e.x-n.left)<nt&&s)return"left";if(Math.abs(t.x-n.right)<nt&&Math.abs(e.x-n.right)<nt&&s)return"right"}l(wn,"borderSideForSegment");function En(t,e,n,o){switch(t){case"top":return ft(e,n,nt)&&n.y<o.top-nt;case"bottom":return ft(e,n,nt)&&n.y>o.bottom+nt;case"left":return ht(e,n,nt)&&n.x<o.left-nt;case"right":return ht(e,n,nt)&&n.x>o.right+nt}}l(En,"leavesOutward");function An(t,e,n){if(t.length<3)return t;if(n){const r=wn(t[0],t[1],e);return r&&En(r,t[1],t[2],e)?t.slice(1):t}const o=t.length-1,s=wn(t[o-1],t[o],e);return s&&En(s,t[o-1],t[o-2],e)?t.slice(0,o):t}l(An,"collapseOwnBorderStub");function zo(t,e,n){let o=t;if(e){const r=je(o,0,1);if(r){const f=Sn(r,o[0],e);f!==o[0]&&(o=[f,...o.slice(1)])}o=An(o,e,!0)}if(n){const r=o.length-1,f=je(o,r,-1);if(f){const c=Sn(f,o[r],n,!0);c!==o[r]&&(o=[...o.slice(0,r),c])}o=An(o,n,!1)}const s=ro(o,e,n);return s!==o||o.length===2?s:(e&&(o=Tn(o,e,!0)),n&&(o=Tn(o,n,!1)),o)}l(zo,"snapAndCollapseEndpoints");function Rn(t,e){for(const n of t){const o=so(n,e,2);if(!o)continue;const s=mt(o.points,nt),r=zo(s,o.srcRect,o.dstRect);if(r.length<3){o.edge.points=r;continue}const f=[r[0],{...r[0]},...r.slice(1,-1),r[r.length-1],{...r[r.length-1]}];o.edge.points=f}}l(Rn,"prepareEdgeEndpointsForRenderer");function io(t){return new Map(t.map(e=>[e.id,e]))}l(io,"buildNodeMap");function $o(t,e){let n=t.parentId,o=null;for(;n;){const s=e.get(n);if(!s?.isGroup)break;o=s.id,n=s.parentId}return o}l($o,"resolveTopLevelGroupId");function Nn(t,e){let n=0,o=t.parentId;for(;o;){const s=e.get(o);if(!s?.isGroup)break;n++,o=s.parentId}return n}l(Nn,"groupDepth");function co(t){let e=1/0,n=-1/0,o=1/0,s=-1/0;for(const r of t){const f=r.x,c=r.y;if(typeof f!="number"||typeof c!="number")continue;const h=r.width??0,m=r.height??0;e=Math.min(e,f-h/2),n=Math.max(n,f+h/2),o=Math.min(o,c-m/2),s=Math.max(s,c+m/2)}return e===1/0||o===1/0?null:{minX:e,maxX:n,minY:o,maxY:s}}l(co,"boundsForChildren");function Vo(t,e){const n=t.padding??20;t.x=(e.minX+e.maxX)/2,t.y=(e.minY+e.maxY)/2,t.width=Math.max(0,e.maxX-e.minX)+n,t.height=Math.max(0,e.maxY-e.minY)+n}l(Vo,"applyGroupBounds");function jo(t){const e=io(t),n=t.filter(o=>o.isGroup&&o.parentId).sort((o,s)=>Nn(s,e)-Nn(o,e));for(const o of n){const s=t.filter(f=>f.parentId===o.id),r=co(s);r&&Vo(o,r)}}l(jo,"recomputeNestedGroupBounds");function Ke(t,e){const n=t.nodes??[],o=t.edges??[],s=n.filter(h=>!h.isGroup);let r=1/0,f=-1/0;for(const h of s){const m=h[e];typeof m=="number"&&(r=Math.min(r,m),f=Math.max(f,m))}if(!Number.isFinite(r)||!Number.isFinite(f))return!1;const c=l(h=>r+f-h,"mirror");for(const h of n){const m=h[e];typeof m=="number"&&(h[e]=c(m));const y=h.groupTitleRect;y&&(h.groupTitleRect=e==="x"?{...y,left:c(y.right),right:c(y.left)}:{...y,top:c(y.bottom),bottom:c(y.top)})}for(const h of o)for(const m of h.points??[])m[e]=c(m[e]);return!0}l(Ke,"mirrorAxis");function Uo(t){return(t.nodes??[]).some(n=>!n.isGroup)?Ke(t,"y"):!0}l(Uo,"applyBtDirectionTransform");function Wo(t,e="LR"){const n=t.nodes??[],o=t.edges??[],s=n.filter(B=>!B.isGroup);let r=1/0,f=1/0;for(const B of s){const G=B.x??0,j=B.y??0;G<r&&(r=G),j<f&&(f=j)}if(!Number.isFinite(r)||!Number.isFinite(f))return!1;const c=36;let h=0,m=0;for(const B of s)h+=B.width??0,m+=B.height??0;const y=h/s.length,g=m/s.length,C=g>0?Math.max(1,y/g):1;for(const B of s){const G=B.x??0,Z=((B.y??0)-f)*C+c,dt=G-r;B.x=Z,B.y=dt}for(const B of o)if(B.points)for(const G of B.points){const j=G.x,dt=(G.y-f)*C+c,pt=j-r;G.x=dt,G.y=pt}jo(n);const d=n.filter(B=>B.isGroup&&!B.parentId);if(d.length===0)return e==="RL"&&Ke(t,"x"),!0;const u=io(n),i=new Map;for(const B of n){if(B.isGroup)continue;const G=$o(B,u);if(!G)continue;const j=i.get(G)??[];j.push(B),i.set(G,j)}let x=0;for(const B of d){const G=B.padding??0;G>x&&(x=G)}const L=[];let I=1/0,E=-1/0;for(const B of d){const G=i.get(B.id)??[],j=co(G);j&&(I=Math.min(I,j.minX),E=Math.max(E,j.maxX),L.push({lane:B,contentTop:j.minY,contentBottom:j.maxY,centerY:(j.minY+j.maxY)/2}))}if(I===1/0||E===-1/0)return!0;const T=Math.max(0,E-I),p=Math.max(x,10),M=T+2*p,A=c+M,O=(I+E)/2-M/2-c,F=O+A/2,D=Math.max(x,c);L.sort((B,G)=>B.centerY-G.centerY);for(let B=0;B<L.length;B++){const G=L[B];let j,Z;if(B===0?j=G.contentTop-D:j=(L[B-1].contentBottom+G.contentTop)/2,B===L.length-1)Z=G.contentBottom+D;else{const kt=L[B+1];Z=(G.contentBottom+kt.contentTop)/2}const dt=Math.max(0,Z-j),pt=(j+Z)/2;G.lane.x=F,G.lane.y=pt,G.lane.width=A,G.lane.height=dt,G.lane.swimlaneContentTop=G.contentTop,G.lane.groupTitleRect={left:O,right:O+c,top:j,bottom:Z}}return e==="RL"&&Ke(t,"x"),!0}l(Wo,"applyLrDirectionTransform");var se=1e-6,fr=8,He=fr,dr=[0,He,-He,2*He,-2*He];function Ko(t,e){const{nodeInfoById:n,realNodeRects:o}=Qe(e);for(const s of t){if(s.isLayoutOnly)continue;const r=s.points;if(!r||r.length<4)continue;const f=Jn(mt(r,se),se);if(!f)continue;const{p3:c}=f,h=f.kind==="HVH",m=no(s,n,se);if(!m)continue;const{srcId:y,dstId:g,srcInfo:C,dstInfo:d,collinearX:u,collinearY:i}=m;if(u||i)continue;let x;const L=C.rect;for(const I of dr){let E,T,p;if(h){const F=d.cy>C.cy?L.bottom:L.top,D=C.cx+I;if(D<=L.left+se||D>=L.right-se)continue;E={x:D,y:F},T={x:D,y:c.y},p={x:c.x,y:c.y}}else{const F=d.cx>C.cx?L.right:L.left,D=C.cy+I;if(D<=L.top+se||D>=L.bottom-se)continue;E={x:F,y:D},T={x:c.x,y:D},p={x:c.x,y:c.y}}const M=oe(E,T,se),A=oe(T,p,se);if(M&&A||!M&&At(E,T,o,[y],1)||!A&&At(T,p,o,[g],1))continue;const R=!M&&$e(E,T,t,s,{epsilon:se,skipDegenerateOther:!0}),k=!A&&$e(T,p,t,s,{epsilon:se,skipDegenerateOther:!0});if(!(R||k)){M?x=[T,p]:A?x=[E,T]:x=[E,T,p];break}}x&&(s.points=x)}}l(Ko,"portSwapToLShape");function qo(t,e){const{realNodeRects:r,labelNodeRects:f}=me(e.values());for(const c of t){if(c.isLayoutOnly)continue;const h=c.points;if(!h||h.length<4)continue;const m=mt(h,.001);if(m.length<4)continue;const y=m.length-1,g=m[y],C=m[y-1],d=m[y-2],u=g.x-C.x,i=g.y-C.y,x=Math.hypot(u,i);if(x>=10||x<.001)continue;const L=C.x-d.x,I=C.y-d.y;if(Math.hypot(L,I)<.001)continue;const T=wt(C,g,.001),p=Et(C,g,.001),M=wt(d,C,.001),A=Et(d,C,.001);if(!(T&&A||p&&M))continue;const R=c.end,k=c.start,O=R?e.get(R):void 0;if(!O)continue;const F=O.x??0,D=O.y??0,B=qt(O);if(!B)continue;let G,j;if(A){const W=I<0;G={x:F,y:d.y},j={x:F,y:W?B.bottom:B.top}}else{const W=L>0;G={x:d.x,y:D},j={x:W?B.right:B.left,y:D}}if(At(G,j,r,R?[R]:[],-2)||At(G,j,f,[],-2))continue;if(k){const W=e.get(k),et=W?qt(W):void 0;if(et&&Qn(G,et,2))continue}const Z=l((W,et)=>`${W.x.toFixed(3)},${W.y.toFixed(3)}|${et.x.toFixed(3)},${et.y.toFixed(3)}`,"ownSegmentKey"),dt=new Set;for(let W=0;W<m.length-1;W++)dt.add(Z(m[W],m[W+1]));const pt=l((W,et)=>{for(const at of t){if(at===c||at.isLayoutOnly)continue;const gt=at.points;if(!(!gt||gt.length<2))for(let xt=0;xt<gt.length-1;xt++){const vt=gt[xt],Vt=gt[xt+1];if(!dt.has(Z(vt,Vt))&&ae(W,et,vt,Vt,.001))return!0}}return!1},"segmentCrossesOtherEdge");if(pt(G,j))continue;if(y-3>=0){const W=m[y-3],et=[k,R].filter(at=>!!at);if(At(W,G,r,et,-2)||pt(W,G))continue}const Bt=[...m.slice(0,y-2),G,j];c.points=Bt;const Q=c.labelNodeId;if(Q){const W=e.get(Q);if(W){const et=W.width??0,at=W.height??0;if(et>0&&at>0){let gt,xt,vt=-1;for(let Vt=0;Vt<Bt.length-1;Vt++){const jt=Bt[Vt],Ut=Bt[Vt+1],te=Math.hypot(Ut.x-jt.x,Ut.y-jt.y),Me=ht(jt,Ut,.001),fe=ft(jt,Ut,.001);(Me&&te>=et+2||fe&&te>=at+2)&&te>vt&&(vt=te,gt=(jt.x+Ut.x)/2,xt=(jt.y+Ut.y)/2)}gt!==void 0&&xt!==void 0&&(W.x=gt,W.y=xt)}}}}}l(qo,"collapseShortTerminalStub");var J=.001,Ft=8,Zo=l(t=>typeof t=="string"?t.toUpperCase():"","upperCaseDirection"),it=Ee,gn=l((t,e)=>ft(t,e,J)||ht(t,e,J),"orthogonallyAligned");function On(t,e){const s=l((d,u)=>{const i=d.x??0,x=d.y??0,L=u.x-i,I=u.y-x;let E=(d.width??0)/2,T=(d.height??0)/2;return Math.abs(I)*E>Math.abs(L)*T?(I<0&&(T=-T),{x:i+(I===0?0:T*L/I),y:x+T}):(L<0&&(E=-E),{x:i+E,y:x+(L===0?0:E*I/L)})},"rectIntersect"),r=l((d,u)=>{const i=mt(d.points??[]);if(i.length<2)return;const x=u?d.start:d.end,L=x?e.get(x):void 0,I=L?qt(L):void 0;if(!L||!x||!I)return;const E=u?i[0]:i[i.length-1],T=u?i[1]:i[i.length-2],p=s(L,E);let M=E;if(gn(T,p)&&(M=T),ft(p,M,J))return{edge:d,edgeId:String(d.id??""),nodeId:x,atStart:u,orientation:"V",coord:p.x,min:Math.min(p.y,M.y),max:Math.max(p.y,M.y),boundary:p,railEnd:M,rect:I};if(ht(p,M,J))return{edge:d,edgeId:String(d.id??""),nodeId:x,atStart:u,orientation:"H",coord:p.y,min:Math.min(p.x,M.x),max:Math.max(p.x,M.x),boundary:p,railEnd:M,rect:I}},"terminalLaneFor"),f=l((d,u)=>Math.max(0,Math.min(d.max,u.max)-Math.max(d.min,u.min)),"projectedOverlapLength"),c=l((d,u)=>d.nodeId!==u.nodeId||d.orientation!==u.orientation?!1:d.orientation==="H"?(Math.abs(d.boundary.x-d.rect.left)<1||Math.abs(d.boundary.x-d.rect.right)<1)&&ft(d.boundary,u.boundary,1):(Math.abs(d.boundary.y-d.rect.top)<1||Math.abs(d.boundary.y-d.rect.bottom)<1)&&ht(d.boundary,u.boundary,1),"sameTerminalFace"),h=l((d,u)=>d.nodeId!==u.nodeId||d.orientation!==u.orientation?!1:f(d,u)>=Ft&&Math.abs(d.coord-u.coord)<.5,"exactTerminalLaneConflict"),m=l((d,u)=>{if(d.nodeId!==u.nodeId||d.orientation!==u.orientation||d.orientation!=="H"||d.atStart===u.atStart)return!1;const i=f(d,u);if(i<Ft)return!1;const x=d.rect.bottom-d.rect.top;return i<x||i>2*x?!1:c(d,u)&&Math.abs(d.coord-u.coord)<16},"nearTerminalLaneConflict"),y=l((d,u)=>{const i=mt(d.edge.points??[]);if(i.length<2)return;const x=d.orientation==="V"?{x:d.boundary.x+u,y:d.boundary.y}:{x:d.boundary.x,y:d.boundary.y+u},L=d.orientation==="V"?{x:d.railEnd.x+u,y:d.railEnd.y}:{x:d.railEnd.x,y:d.railEnd.y+u};if(!l(()=>Math.abs(d.boundary.y-d.rect.top)<1||Math.abs(d.boundary.y-d.rect.bottom)<1?ht(x,d.boundary,J)&&x.x>=d.rect.left+1&&x.x<=d.rect.right-1:Math.abs(d.boundary.x-d.rect.left)<1||Math.abs(d.boundary.x-d.rect.right)<1?ft(x,d.boundary,J)&&x.y>=d.rect.top+1&&x.y<=d.rect.bottom-1:!1,"boundaryStaysOnSameFace")())return;if(d.atStart){const M=i.length>1&&oe(i[1],d.railEnd,J),A=i.slice(M?2:1),R=A[0];return R&&!gn(R,L)?void 0:[x,L,...A]}const E=i.length>1&&oe(i[i.length-2],d.railEnd,J),T=i.slice(0,E?-2:-1),p=T[T.length-1];if(!(p&&!gn(p,L)))return[...T,L,x]},"shiftedCandidate"),g=l(d=>{const u=d.edge,i=mt(u.points??[]);if(i.length!==2)return!1;const x=u.start,L=u.end,I=x?e.get(x):void 0,E=L?e.get(L):void 0;if(!I||!E)return!1;const T=I.x??0,p=I.y??0,M=E.x??0,A=E.y??0,[R,k]=i;return ht(R,k,J)&&Math.abs(p-A)<1&&Math.abs(T-M)>1||ft(R,k,J)&&Math.abs(T-M)<1&&Math.abs(p-A)>1},"laneIsStraightCollinearConnector"),C=[-7,7,-14,14,-21,21];for(let d=0;d<8;d++){const u=t.filter(x=>!x.isLayoutOnly).flatMap(x=>[r(x,!0),r(x,!1)]).filter(x=>!!x);let i=!1;for(let x=0;x<u.length&&!i;x++)for(let L=x+1;L<u.length&&!i;L++){const I=u[x],E=u[L];if(I.edge===E.edge||!(h(I,E)||m(I,E)))continue;const T=!h(I,E),p=[I,E].sort((M,A)=>{const R=g(M),k=g(A);return R!==k?Number(R)-Number(k):+!A.atStart-+!M.atStart});for(const M of p){for(const A of C){const R=y(M,A);if(!R)continue;const k=r({...M.edge,points:R},M.atStart);if(!(!k||u.some(O=>O.edge!==M.edge&&(h(k,O)||T&&m(k,O))))){M.edge.points=R,i=!0;break}}if(i)break}}if(!i)return}}l(On,"separateSharedRenderedTerminalLanes");function Jo(t,e){const{realNodeRects:o,labelNodeRects:s}=me(e.values()),r=l((c,h)=>{const m=c.start,y=c.end,g=it(h);if(g.length!==h.length-1)return!1;const C=[m,y].filter(d=>!!d);for(const d of g)if(At(d.a,d.b,o,C,-2)||At(d.a,d.b,s,[],-2))return!1;for(const d of t){if(d===c||d.isLayoutOnly)continue;const u=d.points;if(!(!u||u.length<2)){for(const i of g)for(const x of it(mt(u)))if(ie(i,x,.5)>=Ft||ae(i.a,i.b,x.a,x.b,J))return!1}}return!0},"candidateIsSafe"),f=l((c,h)=>{if(h+4>=c.length)return;const m=c[h],y=c[h+1],g=c[h+2],C=c[h+3],d=c[h+4],u=wt(m,y)&&Et(y,g)&&wt(g,C)&&Et(C,d)&&ft(m,C,J)&&ft(m,d,J)&&ft(y,g,J)&&(y.x-m.x)*(C.x-g.x)<0,i=Et(m,y)&&wt(y,g)&&Et(g,C)&&wt(C,d)&&ht(m,C,J)&&ht(m,d,J)&&ht(y,g,J)&&(y.y-m.y)*(C.y-g.y)<0;if(u||i)return mt([...c.slice(0,h+1),d,...c.slice(h+5)]);if(h+5>=c.length)return;const x=c[h+5],L=Et(m,y)&&wt(y,g)&&Et(g,C)&&wt(C,d)&&Et(d,x)&&ft(m,d,J)&&ft(m,x,J)&&ft(g,C,J)&&(g.x-y.x)*(d.x-C.x)<0,I=wt(m,y)&&Et(y,g)&&wt(g,C)&&Et(C,d)&&wt(d,x)&&ht(m,d,J)&&ht(m,x,J)&&ht(g,C,J)&&(g.y-y.y)*(d.y-C.y)<0;if(!(!L&&!I))return mt([...c.slice(0,h+1),x,...c.slice(h+6)])},"withoutDogleg");for(let c=0;c<8;c++){let h=!1;for(const m of t){if(m.isLayoutOnly)continue;const y=mt(m.points??[]);for(let g=0;g<=y.length-5;g++){const C=f(y,g);if(!(!C||!r(m,C))){m.points=C,h=!0;break}}if(h)break}if(!h)return}}l(Jo,"collapseRedundantRectangularDoglegs");function Bn(t,e){const{realNodeRects:r,labelNodeRects:f}=me(e.values()),c=t.filter(u=>!u.isLayoutOnly),h=l((u,i,x)=>mt(u===i?x??[]:u.points??[]),"pointsFor"),m=l((u,i)=>{let x=0;for(let L=0;L<c.length;L++){const I=it(h(c[L],u,i));for(let E=L+1;E<c.length;E++){const T=it(h(c[E],u,i));for(const p of I)for(const M of T)ae(p.a,p.b,M.a,M.b,J)&&x++}}return x},"strictCrossingCount"),y=l(u=>{const i=it(u);if(i.length!==3)return;const x=i[1];if(!(i[0].horizontal===x.horizontal||i[2].horizontal===x.horizontal))return{index:x.index,horizontal:x.horizontal,vertical:x.vertical,segment:x}},"middleRail"),g=l((u,i)=>{const x=[u.start,u.end].filter(L=>!!L);return r.filter(L=>{if(x.includes(L.id))return!1;const I=L.rect;return i.horizontal?$t(i.a.x,i.b.x,I.left,I.right)>=Ft&&i.a.y>=I.top-2&&i.a.y<=I.bottom+2:$t(i.a.y,i.b.y,I.top,I.bottom)>=Ft&&i.a.x>=I.left-2&&i.a.x<=I.right+2})},"blockingRectsFor"),C=l((u,i,x)=>{const L=u.map(E=>({...E}));if(i.horizontal)L[i.index].y=x,L[i.index+1].y=x;else if(i.vertical)L[i.index].x=x,L[i.index+1].x=x;else return;const I=ce(mt(L));return it(I).length===I.length-1?I:void 0},"candidateByMovingRail"),d=l((u,i,x)=>{const L=[u.start,u.end].filter(E=>!!E),I=it(i);if(I.length!==i.length-1)return!1;for(const E of I)if(At(E.a,E.b,r,L,-2)||At(E.a,E.b,f,[],-2))return!1;for(const E of c)if(E!==u){for(const T of I)for(const p of it(h(E)))if(ie(T,p,.5)>=Ft)return!1}return m(u,i)<=x},"candidateIsSafe");for(let u=0;u<8;u++){const i=m();let x=!1;for(const L of c){const I=h(L),E=y(I);if(!E)continue;const T=g(L,E.segment);if(T.length===0)continue;const p=E.horizontal?[Math.min(...T.map(M=>M.rect.top))-20,Math.max(...T.map(M=>M.rect.bottom))+20]:[Math.min(...T.map(M=>M.rect.left))-20,Math.max(...T.map(M=>M.rect.right))+20];for(const M of p){const A=C(I,E.segment,M);if(!(!A||!d(L,A,i))){L.points=A,x=!0;break}}if(x)break}if(!x)return}}l(Bn,"liftObstacleHuggingSameSideRails");function Pn(t,e,n){const s=l(m=>{const y=m.groupTitleRect;if(!(!y||typeof y.left!="number"||typeof y.right!="number"||typeof y.top!="number"||typeof y.bottom!="number"||!Number.isFinite(y.left)||!Number.isFinite(y.right)||!Number.isFinite(y.top)||!Number.isFinite(y.bottom)||y.right<=y.left||y.bottom<=y.top))return{left:y.left,right:y.right,top:y.top,bottom:y.bottom}},"validTitleRect"),r=l(m=>{if(!m.isGroup||m.parentId)return;const y=Zo(m.direction??n);if(y==="LR"||y==="RL"||y==="BT")return;const g=s(m),C=m.y,d=m.height;if(!g||typeof C!="number"||typeof d!="number"||!Number.isFinite(C)||!Number.isFinite(d)||d<=0)return;const u=g.right-g.left,i=g.bottom-g.top;if(!(i<=0||u<i))return{node:m,rect:g}},"topLaneTitleFor"),f=l((m,y)=>{if(!m.horizontal)return!1;const g=m.a.y;return g<y.top-J||g>y.bottom+J?!1:$t(m.a.x,m.b.x,y.left,y.right)>=Ft},"horizontalSegmentIntersectsTitle"),c=[...e.values()].map(r).filter(m=>!!m);if(c.length===0)return;let h=0;for(const m of t){if(m.isLayoutOnly)continue;const y=mt(m.points??[]);for(const g of it(y))for(const C of c)f(g,C.rect)&&(h=Math.max(h,C.rect.bottom-g.a.y+4))}if(!(h<=J))for(const m of c){const y=m.node.y,g=m.node.height;typeof y!="number"||typeof g!="number"||!Number.isFinite(y)||!Number.isFinite(g)||g<=0||(m.node.y=y-h/2,m.node.height=g+h,m.node.groupTitleRect={...m.rect,top:m.rect.top-h,bottom:m.rect.bottom-h})}}l(Pn,"liftTopLaneTitleBandsAboveRails");function kn(t,e,n){const s=l(y=>{const g=y.groupTitleRect;if(!(!g||typeof g.left!="number"||typeof g.right!="number"||typeof g.top!="number"||typeof g.bottom!="number"||!Number.isFinite(g.left)||!Number.isFinite(g.right)||!Number.isFinite(g.top)||!Number.isFinite(g.bottom)||g.right<=g.left||g.bottom<=g.top))return{left:g.left,right:g.right,top:g.top,bottom:g.bottom}},"validTitleRect"),r=l(y=>{if(!y.isGroup||y.parentId||Zo(y.direction??n)!=="LR")return;const C=s(y),d=y.x,u=y.width;if(!C||typeof d!="number"||typeof u!="number"||!Number.isFinite(d)||!Number.isFinite(u)||u<=0)return;const i=C.right-C.left,x=C.bottom-C.top;if(!(i<=0||x<i))return{node:y,rect:C}},"leftLaneTitleFor"),f=l((y,g)=>{if(!y.vertical)return!1;const C=y.a.x;return C<g.left-J||C>g.right+J?!1:$t(y.a.y,y.b.y,g.top,g.bottom)>=Ft},"verticalSegmentIntersectsTitle"),c=l((y,g)=>{if(!y.horizontal)return!1;const C=y.a.y;return C<g.top-J||C>g.bottom+J?!1:$t(y.a.x,y.b.x,g.left,g.right)>=Ft},"horizontalSegmentIntersectsTitle"),h=[...e.values()].map(r).filter(y=>!!y);if(h.length===0)return;let m=0;for(const y of t){if(y.isLayoutOnly)continue;const g=mt(y.points??[]);for(const C of it(g))for(const d of h)if(f(C,d.rect))m=Math.max(m,d.rect.right-C.a.x+4);else if(c(C,d.rect)){const u=Math.min(C.a.x,C.b.x);m=Math.max(m,d.rect.right-u+4)}}if(!(m<=J))for(const y of h){const g=y.node.x,C=y.node.width;typeof g!="number"||typeof C!="number"||!Number.isFinite(g)||!Number.isFinite(C)||C<=0||(y.node.x=g-m/2,y.node.width=C+m,y.node.groupTitleRect={...y.rect,left:y.rect.left-m,right:y.rect.right-m})}}l(kn,"shiftLeftLaneTitleBandsLeftOfRails");function Qo(t,e){const{realNodeRects:o}=me(e.values()),s=t.filter(u=>!u.isLayoutOnly),r=l((u,i=new Map)=>mt(i.get(u)??u.points??[]),"replacementPointsFor"),f=l((u=new Map)=>{let i=0;for(let x=0;x<s.length;x++){const L=it(r(s[x],u));for(let I=x+1;I<s.length;I++){const E=it(r(s[I],u));for(const T of L)for(const p of E)ae(T.a,T.b,p.a,p.b,J)&&i++}}return i},"crossingCount"),c=l((u=new Map)=>s.reduce((i,x)=>i+Qt(r(x,u)),0),"totalBends"),h=l(u=>{const i=r(u);if(i.length<4)return;const x=i[i.length-2],L=i[i.length-1];if(!(!wt(x,L,J)&&!Et(x,L,J)))return{tailStart:x,terminal:L}},"terminalTailFor"),m=l((u,i)=>{const x=r(u);if(x.length<3)return;const L=x[0],I=x[1];let E;if(wt(L,I,J))E={x:I.x,y:i.tailStart.y};else if(Et(L,I,J))E={x:i.tailStart.x,y:I.y};else return;const T=ce(mt([L,I,E,i.tailStart,i.terminal]));return it(T).length===T.length-1?T:void 0},"candidateWithDestinationTail"),y=l((u,i)=>{const x=[u.start,u.end].filter(L=>!!L);for(const L of it(i))if(At(L.a,L.b,o,x,-2))return!0;return!1},"pathHasNodeHit"),g=l((u,i,x)=>{for(const L of s)if(L!==u){for(const I of it(i))for(const E of it(r(L,x)))if(ie(I,E,.5)>=Ft)return!0}return!1},"pathHasSharedTrack"),C=l((u,i,x)=>!y(u,i)&&!g(u,i,x),"candidateIsSafe"),d=l(()=>{const u=new Map;for(const i of s){const x=i.end;if(!x||!e.has(x)||r(i).length<4)continue;const I=u.get(x)??[];I.push(i),u.set(x,I)}return u},"edgesByDestination");for(let u=0;u<4;u++){const i=f();if(i===0)return;const x=c();let L,I=i,E=x;for(const T of d().values())for(let p=0;p<T.length;p++)for(let M=p+1;M<T.length;M++){const A=T[p],R=T[M],k=h(A),O=h(R);if(!k||!O)continue;const F=m(A,O),D=m(R,k);if(!F||!D)continue;const B=new Map([[A,F],[R,D]]);if(!C(A,F,B)||!C(R,D,B))continue;const G=f(B),j=c(B);G>=i||G>I||G===I&&j>=E||(L=B,I=G,E=j)}if(!L)return;for(const[T,p]of L)T.points=p}}l(Qo,"swapDestinationTerminalTailsToReduceCrossings");function ts(t,e){const{realNodeRects:r,labelNodeRects:f}=me(e.values()),c=t.filter(T=>!T.isLayoutOnly),h=l((T,p=new Map)=>mt(p.get(T)??T.points??[]),"replacementPointsFor"),m=l((T=new Map)=>{let p=0;for(let M=0;M<c.length;M++){const A=it(h(c[M],T));for(let R=M+1;R<c.length;R++){const k=it(h(c[R],T));for(const O of A)for(const F of k)ae(O.a,O.b,F.a,F.b,J)&&p++}}return p},"strictCrossingCount"),y=l((T=new Map)=>c.reduce((p,M)=>p+Qt(h(M,T)),0),"totalBends"),g=l(T=>{const p=T.start,M=T.end,A=p?e.get(p):void 0,R=M?e.get(M):void 0,k=A?qt(A):void 0,O=R?qt(R):void 0;return k&&O?{src:k,dst:O}:void 0},"endpointRectsFor"),C=l((T,p,M)=>{if(M.index<=0||M.index+1>=p.length-1)return;const A=g(T);if(A){if(M.vertical){const R=M.a.x,k=Math.min(A.src.left,A.dst.left),O=Math.max(A.src.right,A.dst.right),F=R<k-J?"left":R>O+J?"right":void 0;return F?{edge:T,points:p,segmentIndex:M.index,axis:"vertical",side:F,coord:R,min:Math.min(M.a.y,M.b.y),max:Math.max(M.a.y,M.b.y)}:void 0}if(M.horizontal){const R=M.a.y,k=Math.min(A.src.top,A.dst.top),O=Math.max(A.src.bottom,A.dst.bottom),F=R<k-J?"top":R>O+J?"bottom":void 0;return F?{edge:T,points:p,segmentIndex:M.index,axis:"horizontal",side:F,coord:R,min:Math.min(M.a.x,M.b.x),max:Math.max(M.a.x,M.b.x)}:void 0}}},"externalRailForSegment"),d=l(()=>{const T=[];for(const p of c){const M=h(p);for(const A of it(M)){const R=C(p,M,A);R&&T.push(R)}}return T},"collectExternalRails"),u=l((T,p)=>T.edge!==p.edge&&T.axis===p.axis&&T.side===p.side&&$t(T.min,T.max,p.min,p.max)>=Ft,"railsInteract"),i=l(T=>{const p=[],M=new Set;for(const A of T){if(M.has(A))continue;const R=[A],k=[];for(M.add(A);R.length>0;){const O=R.pop();k.push(O);for(const F of T)!M.has(F)&&u(O,F)&&(M.add(F),R.push(F))}k.length>1&&p.push(k)}return p},"connectedComponents"),x=l(T=>{const p=[];for(const M of T)p.some(A=>Math.abs(A-M.coord)<J)||p.push(M.coord);for(;p.length<T.length;){const M=Math.min(...p),A=Math.max(...p),R=T[0].side;p.push(R==="left"||R==="top"?M-12*(T.length-p.length):A+12*(T.length-p.length))}return p},"uniqueCoordsFor"),L=l(T=>{const p=T.map(R=>R.coord),M=x(T),A=[];if(T.length<=6){const R=new Array(M.length).fill(!1),k=[],O=l(()=>{if(k.length===T.length){k.some((F,D)=>Math.abs(F-p[D])>=J)&&A.push([...k]);return}for(const[F,D]of M.entries())R[F]||(R[F]=!0,k.push(D),O(),k.pop(),R[F]=!1)},"visit");return O(),A}for(let R=0;R<p.length;R++)for(let k=R+1;k<p.length;k++){const O=[...p];[O[R],O[k]]=[O[k],O[R]],A.push(O)}return A},"coordinateAssignmentsFor"),I=l((T,p)=>{const M=new Map;for(const[R,k]of T.entries()){const O=p[R],F=M.get(k.edge)??k.points.map(D=>({x:D.x,y:D.y}));k.axis==="vertical"?(F[k.segmentIndex].x=O,F[k.segmentIndex+1].x=O):(F[k.segmentIndex].y=O,F[k.segmentIndex+1].y=O),M.set(k.edge,F)}const A=new Map;for(const[R,k]of M){const O=ce(mt(k));if(it(O).length!==O.length-1)return;A.set(R,O)}return A},"replacementsForAssignment"),E=l(T=>{for(const[p,M]of T){const A=[p.start,p.end].filter(R=>!!R);for(const R of it(M))if(At(R.a,R.b,r,A,-2)||At(R.a,R.b,f,[],-2))return!1}for(let p=0;p<c.length;p++){const M=c[p],A=T.has(M),R=it(h(M,T));for(let k=p+1;k<c.length;k++){const O=c[k];if(!A&&!T.has(O))continue;const F=it(h(O,T));for(const D of R)for(const B of F)if(ie(D,B,.5)>=Ft)return!1}}return!0},"candidateIsSafe");for(let T=0;T<4;T++){const p=m();if(p===0)return;let M,A=p,R=y(),k=Number.POSITIVE_INFINITY;for(const O of i(d()))for(const F of L(O)){const D=I(O,F);if(!D||!E(D))continue;const B=m(D);if(B>=p)continue;const G=y(D),j=O.reduce((Z,dt,pt)=>Z+Math.abs(F[pt]-dt.coord),0);B>A||B===A&&(G>R||G===R&&j>=k)||(M=D,A=B,R=G,k=j)}if(!M)return;for(const[O,F]of M)O.points=F}}l(ts,"reassignCrossingExternalRailChannels");function es(t,e){const{realNodeRects:o,labelNodeRects:s}=me(e.values()),r=t.filter(d=>!d.isLayoutOnly),f=l((d,u,i)=>mt(d===u?i??[]:d.points??[]),"pointsFor"),c=l(d=>it(d).reduce((u,i)=>{const x=i.a.x-i.b.x,L=i.a.y-i.b.y;return u+Math.hypot(x,L)},0),"pathLength"),h=l((d,u)=>{let i=0;for(let x=0;x<r.length;x++){const L=it(f(r[x],d,u));for(let I=x+1;I<r.length;I++){const E=it(f(r[I],d,u));for(const T of L)for(const p of E)ae(T.a,T.b,p.a,p.b,J)&&i++}}return i},"strictCrossingCount"),m=l((d,u)=>{if(d.horizontal){const i=d.a.y;return(Math.abs(i-u.top)<1||Math.abs(i-u.bottom)<1)&&$t(d.a.x,d.b.x,u.left,u.right)>=Ft}if(d.vertical){const i=d.a.x;return(Math.abs(i-u.left)<1||Math.abs(i-u.right)<1)&&$t(d.a.y,d.b.y,u.top,u.bottom)>=Ft}return!1},"segmentRunsAlongRectBorder"),y=l(d=>{const u=[d.start,d.end].filter(x=>!!x),i=[];for(const x of u){const L=e.get(x),I=L?qt(L):void 0;I&&i.push(I)}return i},"endpointRectsFor"),g=l((d,u)=>{if(u+3>=d.length)return[];const i=d[u],x=d[u+1],L=d[u+2],I=d[u+3],E=wt(i,x,J)&&Et(x,L,J)&&wt(L,I,J),T=Et(i,x,J)&&wt(x,L,J)&&Et(L,I,J);if(!E&&!T)return[];if(!(E?Math.sign(x.x-i.x)!==Math.sign(I.x-L.x):Math.sign(x.y-i.y)!==Math.sign(I.y-L.y)))return[];const M=ft(i,I,J)||ht(i,I,J)?[]:[{x:i.x,y:I.y},{x:I.x,y:i.y}],A=M.length===0?[[...d.slice(0,u+1),...d.slice(u+3)]]:M.map(k=>[...d.slice(0,u+1),k,...d.slice(u+3)]),R=new Set;return A.map(k=>ce(mt(k))).filter(k=>{if(it(k).length!==k.length-1||!k.some(F=>oe(F,I,J)))return!1;const O=k.map(F=>`${F.x.toFixed(3)},${F.y.toFixed(3)}`).join("|");return R.has(O)?!1:(R.add(O),!0)})},"shortcutCandidatesAt"),C=l((d,u,i)=>{const x=[d.start,d.end].filter(I=>!!I),L=y(d);for(const I of it(u))if(At(I.a,I.b,o,x,-2)||At(I.a,I.b,s,[],-2)||L.some(E=>m(I,E)))return!1;for(const I of r)if(I!==d){for(const E of it(u))for(const T of it(f(I)))if(ie(E,T,.5)>=Ft)return!1}return h(d,u)<=i},"candidateIsSafe");for(let d=0;d<8;d++){const u=h();let i,x,L=u,I=Number.POSITIVE_INFINITY,E=Number.POSITIVE_INFINITY;for(const T of r){const p=f(T),M=Qt(p,J),A=c(p);for(let R=0;R<=p.length-4;R++)for(const k of g(p,R)){const O=Qt(k,J),F=c(k);if(!(O<M||O===M&&F<A-J)||!C(T,k,u))continue;const B=h(T,k);B>L||B===L&&(O>I||O===I&&F>=E)||(i=T,x=k,L=B,I=O,E=F)}}if(!i||!x)return;i.points=x}}l(es,"shortcutRedundantOrthogonalJogs");function ns(t,e){const f=[];for(const N of e.values()){if(N.isGroup||N.isEdgeLabel)continue;const _=N.x??0,H=N.y??0,V=qt(N);V&&f.push({id:String(N.id??""),cx:_,cy:H,rect:V})}if(f.length===0)return;const c=new Map(f.map(N=>[N.id,N])),h=f.map(N=>({id:N.id,rect:N.rect})),m=["top","bottom","left","right"],y={top:Math.min(...f.map(N=>N.rect.top))-20,bottom:Math.max(...f.map(N=>N.rect.bottom))+20,left:Math.min(...f.map(N=>N.rect.left))-20,right:Math.max(...f.map(N=>N.rect.right))+20},g=t.filter(N=>!N.isLayoutOnly),C=new Map(g.map((N,_)=>[N,_])),d=l(N=>{const _=N==="left"||N==="top"?-1:1,H=[];for(let V=0;V<=2;V++)H.push(y[N]+_*20*V);return H},"outwardTracksForSide"),u=l((N,_=new Map)=>mt(_.get(N)??N.points??[]),"replacementPointsFor"),i=l((N,_)=>{let H=0;for(const V of N)for(const a of _)ae(V.a,V.b,a.a,a.b,J)&&H++;return H},"crossingCountBetweenSegments"),x=l((N,_)=>i(it(N),it(_)),"crossingCountBetweenPaths"),L=l((N=new Map)=>{let _=0;const H=[],V=new Set,a=[],b=l(S=>{V.has(S)||(V.add(S),a.push(S))},"addEdge");for(let S=0;S<g.length;S++){const v=g[S],w=u(v,N);for(let P=S+1;P<g.length;P++){const U=g[P],q=x(w,u(U,N));q>0&&(_+=q,H.push({first:v,second:U,count:q}),b(v),b(U))}}return a.sort((S,v)=>(C.get(S)??0)-(C.get(v)??0)),{count:_,pairs:H,edgeSet:V,edges:a}},"crossingSnapshot"),I=l((N,_)=>{const H=new Set(_.keys());if(H.size===0)return N.count;let V=0;for(const b of N.pairs)(H.has(b.first)||H.has(b.second))&&(V+=b.count);let a=0;for(let b=0;b<g.length;b++){const S=g[b],v=H.has(S),w=u(S,_);for(let P=b+1;P<g.length;P++){const U=g[P];!v&&!H.has(U)||(a+=x(w,u(U,_)))}}return N.count-V+a},"crossingCountWithReplacements"),E=l(N=>{const _=new Map;for(const a of N.pairs){const b=_.get(a.first)??new Set;b.add(a.second),_.set(a.first,b);const S=_.get(a.second)??new Set;S.add(a.first),_.set(a.second,S)}const H=[],V=new Set;for(const a of N.edges){if(V.has(a))continue;const b=[a],S=[];for(V.add(a);b.length>0;){const v=b.pop();S.push(v);for(const w of _.get(v)??[])V.has(w)||(V.add(w),b.push(w))}S.sort((v,w)=>(C.get(v)??0)-(C.get(w)??0)),S.length>1&&H.push(S)}return H},"crossingComponents"),T=l(N=>[N.start,N.end].filter(_=>!!_),"endpointIdsFor"),p=l(N=>{const _=[];for(const H of E(N)){const V=new Set(H),a=new Set(H.flatMap(S=>T(S))),b=[...H];for(const S of g)V.has(S)||T(S).some(v=>a.has(v))&&b.push(S);b.sort((S,v)=>(C.get(S)??0)-(C.get(v)??0)),_.push(b)}return _},"pairSearchGroups"),M=l((N,_,H)=>I(N,new Map([[_,H]])),"crossingCountWithSingleReplacement"),A=l(N=>{const _=new Map;for(const H of N.pairs)_.set(H.first,(_.get(H.first)??0)+H.count),_.set(H.second,(_.get(H.second)??0)+H.count);return _},"currentCrossingsByEdge"),R=l(N=>N.slice(1).reduce((_,H,V)=>{const a=N[V];return _+Math.abs(H.x-a.x)+Math.abs(H.y-a.y)},0),"pathLength"),k=l((N=new Map)=>g.reduce((_,H)=>_+Qt(u(H,N)),0),"totalBends"),O=l((N=new Map)=>g.reduce((_,H)=>_+R(u(H,N)),0),"totalLength"),F=l((N,_,H=new Map)=>{const V=it(_);for(const a of g)if(a!==N){for(const b of V)for(const S of it(u(a,H)))if(ie(b,S,.5)>=Ft)return!0}return!1},"pathHasSegmentConflict"),D=l((N,_)=>{const H=[N.start,N.end].filter(V=>!!V);for(const V of it(_))if(At(V.a,V.b,h,H,-2))return!0;return!1},"pathHitsNode"),B=l((N,_)=>{const H=ce(mt(_));it(H).length===H.length-1&&N.push(H)},"pushOrthogonalCandidate"),G=l(N=>N==="left"||N==="right","sideIsHorizontal"),j=l((N,_,H)=>{switch(_){case"left":return Math.min(N.x,H.x)-20;case"right":return Math.max(N.x,H.x)+20;case"top":return Math.min(N.y,H.y)-20;case"bottom":return Math.max(N.y,H.y)+20}},"localTrackForSameSide"),Z=l((N,_,H,V)=>{const a=H==="left"||H==="top"?-1:1,b=[j(_,H,V),y[H]];for(const S of b)for(let v=0;v<=2;v++)B(N,eo(_,H,V,S+a*20*v))},"addSameSideCandidates"),dt=l((N,_,H,V,a)=>{for(const b of d(H))for(const S of d(a))B(N,[_,{x:b,y:_.y},{x:b,y:S},{x:V.x,y:S},V])},"addHorizontalToVerticalCandidates"),pt=l((N,_,H,V,a)=>{for(const b of d(H))for(const S of d(a))B(N,[_,{x:_.x,y:b},{x:S,y:b},{x:S,y:V.y},V])},"addVerticalToHorizontalCandidates"),kt=l((N,_,H,V,a)=>{const b=[...d("top"),...d("bottom")];for(const S of d(H))for(const v of d(a))for(const w of b)B(N,[_,{x:S,y:_.y},{x:S,y:w},{x:v,y:w},{x:v,y:V.y},V])},"addHorizontalPairCandidates"),Bt=l((N,_,H,V,a)=>{const b=[...d("left"),...d("right")];for(const S of d(H))for(const v of d(a))for(const w of b)B(N,[_,{x:_.x,y:S},{x:w,y:S},{x:w,y:v},{x:V.x,y:v},V])},"addVerticalPairCandidates"),Q=l(N=>{const _=new Set;return N.map(H=>mt(H)).filter(H=>{const V=H.map(a=>`${a.x.toFixed(3)},${a.y.toFixed(3)}`).join("|");return _.has(V)||H.length<2?!1:(_.add(V),!0)})},"dedupeCandidatePaths"),W=l((N,_,H,V)=>{const a=[],b=to(N,_,H,V,20,J);b&&B(a,b),_===V&&Z(a,N,_,H);const S=G(_),v=G(V);return S&&!v?dt(a,N,_,H,V):!S&&v?pt(a,N,_,H,V):S?kt(a,N,_,H,V):Bt(a,N,_,H,V),Q(a)},"buildCandidatesForSides"),et=l((N,_,H,V)=>{const a=[...d("left"),...d("right")],b=[...d("top"),...d("bottom")];for(const S of m){const v=Ie(V,S),w=S==="top"||S==="bottom"?d(S):b;for(const P of a){B(N,[_,H,{x:P,y:H.y},{x:P,y:v.y},v]);for(const U of w)B(N,[_,H,{x:P,y:H.y},{x:P,y:U},{x:v.x,y:U},v])}}},"addVerticalDepartureOuterTrackCandidates"),at=l((N,_,H,V)=>{const a=[...d("left"),...d("right")],b=[...d("top"),...d("bottom")];for(const S of m){const v=Ie(V,S),w=S==="left"||S==="right"?d(S):a;for(const P of b){B(N,[_,H,{x:H.x,y:P},{x:v.x,y:P},v]);for(const U of w)B(N,[_,H,{x:H.x,y:P},{x:U,y:P},{x:U,y:v.y},v])}}},"addHorizontalDepartureOuterTrackCandidates"),gt=l(N=>{const _=N.start,H=N.end,V=H?c.get(H):void 0;if(!_||!V)return[];const a=mt(N.points??[]);if(a.length<4)return[];const b=a[0],S=a[1],v=[];return Et(b,S,J)?et(v,b,S,V):wt(b,S,J)&&at(v,b,S,V),v},"terminalPreservingOuterTrackCandidates"),xt=l(N=>{const _=N.start,H=N.end,V=_?c.get(_):void 0,a=H?c.get(H):void 0;if(!V||!a)return[];const b=[];for(const S of m){const v=Ie(V,S);for(const w of m)b.push(...W(v,S,Ie(a,w),w))}return b.push(...gt(N)),b},"candidatePathsFor"),vt=l(()=>new Map(g.map(N=>[N,it(u(N))])),"currentSegmentsByEdge"),Vt=l((N,_,H)=>{const V=new Set;for(const a of g){if(a===N)continue;const b=H.get(a)??it(u(a));_.some(S=>b.some(v=>ie(S,v,.5)>=Ft))&&V.add(a)}return V},"sharedTrackConflictsFor"),jt=l((N,_,H,V)=>{const a=new Set;return xt(N).map(S=>ce(mt(S))).filter(S=>{if(D(N,S))return!1;const v=S.map(w=>`${w.x.toFixed(3)},${w.y.toFixed(3)}`).join("|");return a.has(v)||S.length<2?!1:(a.add(v),!0)}).map(S=>{const v=it(S);let w=0;for(const P of g)P!==N&&(w+=i(v,H.get(P)??it(u(P))));return{candidate:S,candidateSegments:v,crossings:_.count-(V.get(N)??0)+w,bends:Qt(S,J),totalBends:Qt(S),length:R(S)}}).filter(({crossings:S})=>S<=_.count).sort((S,v)=>S.crossings-v.crossings||S.bends-v.bends||S.length-v.length).slice(0,48).map(S=>({path:S.candidate,segments:S.candidateSegments,sharedTrackConflicts:Vt(N,S.candidateSegments,H),totalBends:S.totalBends,length:S.length}))},"pairCandidatesFor"),Ut=l((N,_,H,V,a,b)=>{let S=0;for(const w of N.pairs)(w.first===_||w.second===_||w.first===V||w.second===V)&&(S+=w.count);let v=i(H.segments,a.segments);for(const w of g){if(w===_||w===V)continue;const P=b.get(w)??it(u(w));v+=i(H.segments,P)+i(a.segments,P)}return N.count-S+v},"pairCrossingCount"),te=l((N,_)=>{for(const H of N.sharedTrackConflicts)if(H!==_)return!1;return!0},"conflictsOnlyWith"),Me=l((N,_)=>N.segments.some(H=>_.segments.some(V=>ie(H,V,.5)>=Ft)),"candidatesShareTrack"),fe=l((N,_,H,V)=>te(_,H.edge)&&te(V,N.edge)&&!Me(_,V),"pairCandidatesAreCompatible"),Se=l((N,_,H,V,a)=>{const b=Ut(N.current,_.edge,H,V.edge,a,N.baseSegments);if(!(b>=N.current.count))return{replacements:new Map([[_.edge,H.path],[V.edge,a.path]]),crossings:b,bends:N.currentBends-(N.baseBendsByEdge.get(_.edge)??0)-(N.baseBendsByEdge.get(V.edge)??0)+H.totalBends+a.totalBends,length:N.currentLength-(N.baseLengthByEdge.get(_.edge)??0)-(N.baseLengthByEdge.get(V.edge)??0)+H.length+a.length}},"scorePairReplacement"),on=l((N,_)=>N.crossings<_.crossings||N.crossings===_.crossings&&(N.bends<_.bends||N.bends===_.bends&&N.length<_.length),"pairScoreIsBetter"),sn=l((N,_,H,V)=>{let a=V;for(const b of _.candidates)for(const S of H.candidates){if(!fe(_,b,H,S))continue;const v=Se(N,_,b,H,S);v&&on(v,a)&&(a=v)}return a},"bestScoreForOptionPair"),rn=l(N=>{const _=k(),H=O(),V=vt(),a=A(N),b=new Map(g.map(q=>[q,Qt(u(q))])),S=new Map(g.map(q=>[q,R(u(q))])),v=new Map,w=p(N);for(const q of w)for(const $ of q){if(v.has($))continue;const Y=jt($,N,V,a);Y.length>0&&v.set($,{edge:$,candidates:Y})}let P={replacements:new Map,crossings:N.count,bends:_,length:H};const U={current:N,currentBends:_,currentLength:H,baseBendsByEdge:b,baseLengthByEdge:S,baseSegments:V};for(const q of w){const $=new Set(q.filter(ot=>N.edgeSet.has(ot))),Y=q.map(ot=>v.get(ot)).filter(ot=>!!ot);for(let ot=0;ot<Y.length;ot++){const rt=Y[ot];for(let st=ot+1;st<Y.length;st++){const tt=Y[st];!$.has(rt.edge)&&!$.has(tt.edge)||(P=sn(U,rt,tt,P))}}}return P.replacements.size>0?P.replacements:void 0},"bestPairedReplacement");for(let N=0;N<4;N++){const _=L(),H=_.count;if(H===0)return;let V,a,b=H,S=Number.POSITIVE_INFINITY;for(const w of _.edges){const P=Qt(u(w),J);for(const U of xt(w)){const q=D(w,U),$=!q&&F(w,U),Y=M(_,w,U),ot=Qt(U,J);q||$||!(Y<H||Y===H&&ot<P)||Y>b||Y===b&&ot>=S||(V=w,a=U,b=Y,S=ot)}}if(V&&a){V.points=a;continue}const v=rn(_);if(!v)return;for(const[w,P]of v)w.points=P}}l(ns,"resolveRenderedOrthogonalCrossings");var ge=.001,ur=8;function os(t,e){const{nodeInfoById:n,realNodeRects:o}=Qe(e),s=["top","bottom","left","right"],r=20,f={top:Math.min(...o.map(i=>i.rect.top))-r,bottom:Math.max(...o.map(i=>i.rect.bottom))+r,left:Math.min(...o.map(i=>i.rect.left))-r,right:Math.max(...o.map(i=>i.rect.right))+r},c=l((i,x,L,I)=>{const E=[],T=to(i,x,L,I,r,ge);return T&&E.push(T),x===I&&E.push(eo(i,x,L,f[x])),E},"buildOrthogonalPathCandidates"),h=l((i,x)=>{for(let L=0;L<i.length-1;L++){const I=i[L],E=i[L+1];if(At(I,E,o,x,1))return!0}return!1},"pathHitsNode"),m=l((i,x,L=!1)=>{let I=0;const E=Ee(i,ge),T=x.start,p=x.end;for(const M of t){if(M===x||M.isLayoutOnly)continue;const A=M.start,R=M.end;if(!L&&T&&p&&(A===T||A===p||R===T||R===p))continue;const k=M.points;if(!(!k||k.length<2))for(const O of E)for(const F of Ee(k,ge)){if(oo(O.a,O.b,F.a,F.b,ge,ge)){I++;continue}ie(O,F,ge)>=ur&&I++}}return I},"pathConflictCount"),y=4,g=l((i,x)=>{const L=Math.abs(i.y-x.rect.top),I=Math.abs(i.y-x.rect.bottom),E=Math.abs(i.x-x.rect.left),T=Math.abs(i.x-x.rect.right);let p="top",M=L;return I<M&&(p="bottom",M=I),E<M&&(p="left",M=E),T<M&&(p="right",M=T),p},"nearestSideOfRect"),C=new Map,d=l((i,x,L)=>{const I=C.get(i)??[];I.push({side:x,edgeId:L}),C.set(i,I)},"addFaceClaim");for(const i of t){if(i.isLayoutOnly)continue;const x=i.points??[];if(x.length<1)continue;const L=i.id??"",I=i.start,E=i.end;if(I){const T=n.get(I);T&&d(I,g(x[0],T),L)}if(E){const T=n.get(E);T&&d(E,g(x[x.length-1],T),L)}}const u=l((i,x,L)=>C.get(i)?.some(I=>I.edgeId!==L&&I.side===x)??!1,"faceIsClaimed");for(const i of t){if(i.isLayoutOnly)continue;const x=i.points;if(!x||x.length<2)continue;const L=Qt(x,ge);if(L<y)continue;const I=i.start,E=i.end;if(!I||!E)continue;const T=n.get(I),p=n.get(E);if(!T||!p)continue;const M=i.id??"",A=m(x,i,!0),R=m(x,i);let k,O=A,F=L;for(const D of s){if(u(I,D,M))continue;const B=Ie(T,D);for(const G of s){if(u(E,G,M))continue;const j=Ie(p,G);for(const Z of c(B,D,j,G)){if(h(Z,[I,E]))continue;const dt=Qt(Z,ge);if(A>0){const pt=m(Z,i,!0);if(pt>O||pt===O&&dt>=F)continue;O=pt,F=dt,k=Z;continue}m(Z,i)>R||dt<F&&(F=dt,k=Z)}}}if(k){i.points=k;const D=C.get(I);D&&C.set(I,D.filter(G=>G.edgeId!==M));const B=C.get(E);B&&C.set(E,B.filter(G=>G.edgeId!==M)),d(I,g(k[0],T),M),d(E,g(k[k.length-1],p),M)}}}l(os,"simplifyDetouredEdges");var Kt=.001,Co=10,De=7;function Fn(t,e){const n=e?0:t.length-1,o=e?1:-1,s=t[n],r=t[n+o];if(!s||!r)return;const f=r.x-s.x,c=r.y-s.y;if(!(Math.abs(f)+Math.abs(c)<Kt)){if(Math.abs(c)<=Kt){const m=s.x+Math.sign(f)*Co;return{left:Math.min(s.x,m),right:Math.max(s.x,m),top:s.y-De,bottom:s.y+De}}if(Math.abs(f)<=Kt){const m=s.y+Math.sign(c)*Co;return{left:s.x-De,right:s.x+De,top:Math.min(s.y,m),bottom:Math.max(s.y,m)}}return{left:Math.min(s.x,r.x),right:Math.max(s.x,r.x),top:Math.min(s.y,r.y),bottom:Math.max(s.y,r.y)}}}l(Fn,"markerClearanceRectFor");function ss(t){return{left:Math.min(t.left,t.right),right:Math.max(t.left,t.right),top:Math.min(t.top,t.bottom),bottom:Math.max(t.top,t.bottom)}}l(ss,"normalizeRect");function _n(t,e){const n=mt(e),o=Fn(n,!0),s=Fn(n,!1);return[o,s].some(r=>r&&ze(t,ss(r)))}l(_n,"labelOverlapsOwnMarker");function Ye(t,e){const n=[];for(const u of t){if(u.isLayoutOnly)continue;const i=u.points;if(!(!i||i.length<2))for(let x=0;x<i.length-1;x++)n.push({edgeId:u.id,p1:i[x],p2:i[x+1]})}const o=[],s=[];for(const u of e.values()){const i=u.isGroup,x=u.parentId;if(i&&!x){const I=qt(u);I&&s.push({id:u.id,rect:I});continue}if(i||u.isEdgeLabel)continue;const L=qt(u);L&&o.push({nodeId:u.id,rect:L})}const r=3,f=1,c=12,h=l((u,i)=>{const x=bn(i,r);for(const{nodeId:L,rect:I}of o)if(L!==u&&ze(x,I))return!0;return!1},"labelOverlapsForeignNode"),m=l((u,i)=>{const x=bn(i,r);for(const L of n)if(L.edgeId!==u&&Je(L.p1,L.p2,x))return!0;return!1},"labelOverlapsForeignEdge"),y=l((u,i,x)=>h(u,x)||m(i,x),"labelOverlapsAnything"),g=[],C=l(u=>{for(const{id:i,rect:x}of s)if(Oo(x,u))return i},"findContainingLane"),d=l((u,i)=>g.some(x=>x.labelId!==u&&ze(i,x.rect)),"overlapsPlacedLabel");for(const u of t){if(u.isLayoutOnly)continue;const i=u.labelNodeId;if(!i)continue;const x=e.get(i);if(!x)continue;const L=u.points;if(!L||L.length<2)continue;const I=x.width??0,E=x.height??0;if(I<=0||E<=0)continue;const T=[];for(let Q=0;Q<L.length-1;Q++){const W=L[Q],et=L[Q+1],at=Math.abs(W.x-et.x),gt=Math.abs(W.y-et.y);at<Kt&><Kt||at>=Kt&>>=Kt||T.push({idx:Q,length:at+gt,orientation:at>=Kt?"horizontal":"vertical",midX:(W.x+et.x)/2,midY:(W.y+et.y)/2})}if(T.length===0)continue;const p=T.length>=3?T.filter(Q=>Q.idx>0&&Q.idx<T.length-1):T,M=p.length>0?p:T,A=I>=E?"horizontal":"vertical",R=l(Q=>[...Q].sort((W,et)=>{const at=W.orientation===A,gt=et.orientation===A;if(at!==gt)return at?-1:1;const xt=W.length>=(W.orientation==="horizontal"?I:E)+2,vt=et.length>=(et.orientation==="horizontal"?I:E)+2;return xt!==vt?xt?-1:1:et.length-W.length}),"rankSegments"),k=T[0],O=T[T.length-1],F=[.5,.25,.75,.05,.95,.15,.85,.1,.9],D=l((Q,W)=>{const et=L[Q.idx],at=L[Q.idx+1];return{midX:et.x+(at.x-et.x)*W,midY:et.y+(at.y-et.y)*W}},"anchorAtT"),B=l((Q,W,et)=>Math.min(et,Math.max(W,Q)),"clamp"),G=l((Q,W)=>Q.midX>=W.left-Kt&&Q.midX<=W.right+Kt&&Q.midY>=W.top-Kt&&Q.midY<=W.bottom+Kt,"pointInsideRectInclusive"),j=l(Q=>{const W=we(Q.midX,Q.midY,I,E),et=C(W);if(et)return{laneId:et,anchor:Q,rect:W};const at=s.find(({rect:te})=>G(Q,te));if(!at)return;const gt=at.rect.left+I/2+f,xt=at.rect.right-I/2-f,vt=at.rect.top+E/2+f,Vt=at.rect.bottom-E/2-f;if(gt>xt||vt>Vt)return;const jt={midX:B(Q.midX,gt,xt),midY:B(Q.midY,vt,Vt)},Ut=we(jt.midX,jt.midY,I,E);return G(Q,Ut)?{laneId:at.id,anchor:jt,rect:Ut}:void 0},"placementForAnchor"),Z=l((Q,W,et)=>Q.orientation==="horizontal"?Math.abs(W.midX-et.x):Math.abs(W.midY-et.y),"distanceAlongSegment"),dt=l((Q,W)=>{const at=(Q.orientation==="horizontal"?I/2:E/2)+c;if(Q===k){const gt=L[Q.idx];if(Z(Q,W,gt)+Kt<at)return!1}if(Q===O){const gt=L[Q.idx+1];if(Z(Q,W,gt)+Kt<at)return!1}return!0},"labelClearsTerminalEndpoints"),pt=l(Q=>{const W=R(Q);for(const et of W)for(const at of F){const gt=D(et,at);if(!dt(et,gt))continue;const xt=j(gt);if(xt&&!_n(xt.rect,L)&&!d(i,xt.rect)&&!y(i,u.id,xt.rect))return{laneId:xt.laneId,anchor:xt.anchor}}},"tryPool"),kt=l((Q,W,et=!1)=>{const at=R(Q);for(const gt of at){const xt={midX:gt.midX,midY:gt.midY};if(W&&!dt(gt,xt))continue;const vt=j(xt);if(vt&&!_n(vt.rect,L)&&!d(i,vt.rect)&&!h(i,vt.rect)&&(et||!m(u.id,vt.rect)))return{laneId:vt.laneId,anchor:vt.anchor}}},"findLaneContainingFallback"),Bt=pt(M)??(M.length<T.length?pt(T):void 0)??kt(T,!0)??kt(T,!1)??kt(T,!1,!0);if(Bt){x.x=Bt.anchor.midX,x.y=Bt.anchor.midY,x.parentId=Bt.laneId;const Q=we(Bt.anchor.midX,Bt.anchor.midY,I,E),W=g.findIndex(et=>et.labelId===i);W>=0?g[W]={labelId:i,rect:Q}:g.push({labelId:i,rect:Q})}}}l(Ye,"anchorLabelsToPolyline");var mn=1e-6,hr=8,vo=hr/2,gr=3;function Hn(t,e){return t<e?`${t}::${e}`:`${e}::${t}`}l(Hn,"pairKey");function rs(t,e){const{nodeInfoById:n,realNodeRects:o}=Qe(e),s=new Map;for(const f of e){const c=f.id;if(!f.isGroup&&f.isEdgeLabel){s.set(c,{w:f.width??0,h:f.height??0});continue}}const r=l((f,c,h,m)=>{const y=Hn(c,h);let g=0;const C=l(d=>{if(!d)return;const u=s.get(d);if(!u)return;const i=m==="x"?u.w/2:u.h/2;i>g&&(g=i)},"consider");C(f.labelNodeId);for(const d of t){if(d===f||d.isLayoutOnly)continue;const u=d.start,i=d.end;!u||!i||Hn(u,i)===y&&C(d.labelNodeId)}return g>0?g+gr:0},"labelClearanceFor");for(const f of t){if(f.isLayoutOnly)continue;const c=f.points;if(!Jn(c,mn))continue;const h=no(f,n,mn);if(!h)continue;const{srcId:m,dstId:y,srcInfo:g,dstInfo:C,collinearX:d,collinearY:u}=h;if(d===u)continue;let i,x;if(d){const p=C.cy>g.cy;i={x:g.cx,y:p?g.rect.bottom:g.rect.top},x={x:C.cx,y:p?C.rect.top:C.rect.bottom}}else{const p=C.cx>g.cx;i={x:p?g.rect.right:g.rect.left,y:g.cy},x={x:p?C.rect.left:C.rect.right,y:C.cy}}if(At(i,x,o,[m,y],1))continue;const I=r(f,m,y,d?"x":"y"),E=I>vo?I:vo,T=[0,E,-E];for(const p of T){const M={...i},A={...x};if(d){if(M.x+=p,A.x+=p,M.x<=g.rect.left||M.x>=g.rect.right||A.x<=C.rect.left||A.x>=C.rect.right)continue}else if(M.y+=p,A.y+=p,M.y<=g.rect.top||M.y>=g.rect.bottom||A.y<=C.rect.top||A.y>=C.rect.bottom)continue;if(!At(M,A,o,[m,y],1)&&!$e(M,A,t,f,{epsilon:mn})){f.points=[M,A];break}}}}l(rs,"straightenCollinearSiblingDetours");function Dn(t,e){const{realNodeRects:h,labelNodeRects:m}=me(e.values()),y=l((p,M)=>Ee(M,.001).map(A=>({...A,edge:p,interior:A.index>=1&&A.index<=M.length-3})),"segmentsFor"),g=l(()=>{const p=[];for(const M of t){if(M.isLayoutOnly)continue;const A=M.points;!A||A.length<2||p.push(...y(M,mt(A)))}return p},"allSegments"),C=l((p,M)=>p.horizontal&&M.horizontal?$t(p.a.x,p.b.x,M.a.x,M.b.x)>=8&&Math.abs(p.a.y-M.a.y)<7:p.vertical&&M.vertical?$t(p.a.y,p.b.y,M.a.y,M.b.y)>=8&&Math.abs(p.a.x-M.a.x)<7:!1,"hasCrowdedParallelTrack"),d=l((p,M)=>{const A=p.start,R=p.end,k=y(p,M);if(k.length!==M.length-1)return!1;const O=[A,R].filter(D=>!!D),F=p.labelNodeId?[p.labelNodeId]:[];for(const D of k)if(At(D.a,D.b,h,O,-2)||At(D.a,D.b,m,F,-2))return!1;for(const D of t){if(D===p||D.isLayoutOnly)continue;const B=D.points;if(!(!B||B.length<2)){for(const G of k)for(const j of y(D,mt(B)))if(C(G,j)||ae(G.a,G.b,j.a,j.b,.001))return!1}}return!0},"candidateIsSafe"),u=l((p,M)=>{const A=mt(p.edge.points??[]);if(A.length<4||p.index>=A.length-1)return;const R=A.map(k=>({...k}));if(p.horizontal)R[p.index].y+=M,R[p.index+1].y+=M;else if(p.vertical)R[p.index].x+=M,R[p.index+1].x+=M;else return;return y(p.edge,R).length===R.length-1?R:void 0},"shiftedCandidate"),i=l((p,M)=>({x:p.x??(M.left+M.right)/2,y:p.y??(M.top+M.bottom)/2}),"nodeCenter"),x=l(p=>{const M=p.edge,A=mt(M.points??[]);if(A.length!==4||p.index!==1)return;const R=M.start?e.get(M.start):void 0,k=M.end?e.get(M.end):void 0,O=R?qt(R):void 0,F=k?qt(k):void 0,D=A.slice(p.index+2);if(!(!R||!k||!O||!F||D.length===0))return{sourceCenter:i(R,O),targetCenter:i(k,F),sourceRect:O,tail:D}},"sourceDetourContextFor"),L=l((p,M,A,R,k,O)=>{const F=R.y>=A.y,D=F?k.bottom:k.top,B=D+(F?20:-20);if(F&&p.b.y<=B+.001||!F&&p.b.y>=B-.001)return;const G=p.a.x+M;return mt([{x:A.x,y:D},{x:A.x,y:B},{x:G,y:B},{x:G,y:p.b.y},...O],.001)},"verticalSourceDetour"),I=l((p,M,A,R,k,O)=>{const F=R.x>=A.x,D=F?k.right:k.left,B=D+(F?20:-20);if(F&&p.b.x<=B+.001||!F&&p.b.x>=B-.001)return;const G=p.a.y+M;return mt([{x:D,y:A.y},{x:B,y:A.y},{x:B,y:G},{x:p.b.x,y:G},...O],.001)},"horizontalSourceDetour"),E=l((p,M)=>{const A=x(p);if(A){if(p.vertical)return L(p,M,A.sourceCenter,A.targetCenter,A.sourceRect,A.tail);if(p.horizontal)return I(p,M,A.sourceCenter,A.targetCenter,A.sourceRect,A.tail)}},"sourceDetourCandidate"),T=[-7,7,-14,14,-21,21];for(let p=0;p<12;p++){const M=g();let A=!1;for(let R=0;R<M.length&&!A;R++)for(let k=R+1;k<M.length&&!A;k++){const O=M[R],F=M[k];if(O.edge===F.edge||!C(O,F))continue;const D=[O,F].filter(B=>B.interior);for(const B of D){for(const G of T){const j=u(B,G);if(j&&d(B.edge,j)){B.edge.points=j,A=!0;break}const Z=E(B,G);if(Z&&d(B.edge,Z)){B.edge.points=Z,A=!0;break}}if(A)break}}if(!A)return}}l(Dn,"nudgeSharedInteriorSubpaths");function is(t,e,n,o){const s=e.x-t.x,r=e.y-t.y,f=o.x-n.x,c=o.y-n.y,h=s*c-r*f;if(Math.abs(h)<1e-10)return!1;const m=n.x-t.x,y=n.y-t.y,g=(m*c-y*f)/h,C=(m*r-y*s)/h,d=.01;return g>d&&g<1-d&&C>d&&C<1-d}l(is,"segmentsIntersect");function cs(t){const e=t.nodes??[],n=t.edges??[],o=[];if(!n.length||!e.length)return o;const s=Bo(e),r=[];for(const c of n){if(c.isLayoutOnly)continue;const h=c.points;if(!h||h.length<2)continue;const m=c.start,y=c.end,g=c.labelNodeId,C=c.id??`${m}->${y}`;for(const d of s)if(!(d.nodeId===m||d.nodeId===y)&&!(g&&d.nodeId===g)){for(let u=0;u<h.length-1;u++)if(Je(h[u],h[u+1],d,-1)){o.push({type:"edge-node-overlap",edgeId:C,targetId:d.nodeId,detail:`segment ${u} passes through node "${d.nodeId}"`});break}}for(let d=0;d<h.length-1;d++)r.push({edgeId:C,start:m,end:y,p1:h[d],p2:h[d+1]})}const f=new Set;for(let c=0;c<r.length;c++)for(let h=c+1;h<r.length;h++){const m=r[c],y=r[h];if(m.edgeId!==y.edgeId&&!(m.start===y.start||m.start===y.end||m.end===y.start||m.end===y.end)&&is(m.p1,m.p2,y.p1,y.p2)){const g=m.edgeId<y.edgeId?`${m.edgeId}|${y.edgeId}`:`${y.edgeId}|${m.edgeId}`;f.has(g)||(f.add(g),o.push({type:"edge-edge-crossing",edgeId:m.edgeId,targetId:y.edgeId,detail:`edges "${m.edgeId}" and "${y.edgeId}" cross`}))}}if(o.length>0){const c=o.filter(m=>m.type==="edge-node-overlap").length,h=o.filter(m=>m.type==="edge-edge-crossing").length;yn.warn(`[SWIMLANE_VALIDATE] ${o.length} issue(s) detected: ${c} edge-node overlap(s), ${h} edge crossing(s)`);for(const m of o)yn.warn(`[SWIMLANE_VALIDATE] ${m.type}: ${m.detail}`)}return o}l(cs,"validateSwimlanesLayout");function as(t,e){const n=t.nodes??[],o=t.edges??[],s=n.filter(c=>!c.isGroup);if((e==="LR"||e==="RL")&&s.length>0&&!Wo(t,e)||e==="BT"&&s.length>0&&!Uo(t))return;for(const c of o){if(c.isLayoutOnly)continue;const h=c.points;!h||h.length<2||(c.points=ce(Ve(h)))}os(o,n),rs(o,n),Ko(o,n);const r=new Map;for(const c of n)r.set(String(c.id),c);Ye(o,r),Ho(o,r),qo(o,r),Dn(o,r),On(o,r),Jo(o,r),Bn(o,r),Qo(o,r);const f=l(()=>{ns(o,r),On(o,r),ts(o,r),es(o,r),Ye(o,r),Rn(o,r),Bn(o,r),Ye(o,r),Rn(o,r)},"finalizeRenderedEdges");f(),Dn(o,r),f(),Pn(o,r,e),kn(o,r,e),Pn(o,r,e),kn(o,r,e)}l(as,"postProcessSwimlaneLayout");function pe(t){const e=new Map(t.nodeById),n=new Set,o=[];for(const r of t.edges){if(!e.has(r.src)||!e.has(r.dst))continue;const f=`${r.id}:${r.src}->${r.dst}`;n.has(f)||(n.add(f),o.push(r))}return{nodes:[...e.keys()],edges:o,layout:t.layout,nodeById:e}}l(pe,"normalizeGraph");function ao(t,e){return t.edges.filter(n=>n.dst===e)}l(ao,"incoming");function ls(t){const e=new Map;for(const n of t.nodes)e.set(n,[]);for(const n of t.edges)e.get(n.src).push(n.dst);return e}l(ls,"buildSuccessorMap");function lo(t){const e=ls(t);for(const n of e.values())n.sort((o,s)=>o.localeCompare(s));return e}l(lo,"buildSortedSuccessorMap");function tn(t){const e=new Map;for(const n of t.nodes)e.set(n,0);for(const n of t.edges)e.set(n.dst,(e.get(n.dst)??0)+1);return e}l(tn,"buildInDegreeMap");function fo(t,e){const n=[...e.entries()].filter(([,c])=>c===0).map(([c])=>c).sort((c,h)=>c.localeCompare(h)),o=new Set(t.edges.flatMap(c=>[c.src,c.dst])),s=l(c=>!o.has(c)&&!t.nodeById.get(c)?.isGroup,"isUnconnected"),r=[...e.keys()].filter(c=>e.get(c)===0&&s(c));let f=0;return n.map(c=>s(c)?r[f++]:c)}l(fo,"sortedZeroInDegreeNodes");function en(t,e=()=>!0){const n=new Map,o=new Map;for(const s of t.nodes)n.set(s,[]),o.set(s,[]);for(const s of t.edges)e(s)&&(o.get(s.src).push(s.dst),n.get(s.dst).push(s.src));return{preds:n,succs:o}}l(en,"buildPredecessorSuccessorMaps");function uo(t,e,n,o){let s=0;for(const f of t.nodes)o?.skipGroups&&t.nodeById.get(f)?.isGroup||(s=Math.max(s,n[f]??0));const r=Array.from({length:s+1},()=>[]);for(const f of e)o?.skipGroups&&t.nodeById.get(f)?.isGroup||r[Math.max(0,n[f]??0)].push(f);return r}l(uo,"buildLayersFromRanks");function Ne(t){const e=tn(t),n=fo(t,e),o=[],s=lo(t);for(;n.length;){const r=n.shift();o.push(r);for(const f of s.get(r)??[])if(e.set(f,(e.get(f)??0)-1),(e.get(f)??0)===0){let c=0;for(;c<n.length&&n[c]<f;)c++;n.splice(c,0,f)}}return o.length===t.nodes.length?o:null}l(Ne,"topoSortIfAcyclic");function Ae(t){const e=new Map;let n=0;for(const o of t)e.set(o,n),n++;return e}l(Ae,"buildLayerIndex");function ho(t){const e=new Array(t.length),n=l((o,s)=>{if(s-o<=1)return 0;const r=o+s>>1;let f=n(o,r)+n(r,s),c=o,h=r,m=o;for(;c<r||h<s;)h>=s||c<r&&t[c]<=t[h]?e[m++]=t[c++]:(e[m++]=t[h++],f+=r-c);for(let y=o;y<s;y++)t[y]=e[y];return f},"count");return n(0,t.length)}l(ho,"countInversions");function fs(t){const e=pe(t),n=new Map;for(const g of e.nodes)n.set(g,[]);for(const g of e.edges)n.get(g.src).push(g);for(const g of n.values())g.sort((C,d)=>C.dst===d.dst?C.id.localeCompare(d.id):C.dst.localeCompare(d.dst));const o=Object.create(null);for(const g of e.nodes)o[g]=0;const s=[],r=l(g=>{o[g]=1;for(const C of n.get(g)??[]){const d=C.dst;o[d]===0?r(d):o[d]===1&&s.push(C)}o[g]=2},"dfs"),f=tn(e),c=[...e.nodes.filter(g=>(f.get(g)??0)===0),...e.nodes.filter(g=>(f.get(g)??0)!==0)];for(const g of c)o[g]===0&&r(g);const h=new Set(s.map(g=>`${g.id}:${g.src}->${g.dst}`)),m=e.edges.map(g=>h.has(`${g.id}:${g.src}->${g.dst}`)?{id:g.id,src:g.dst,dst:g.src,weight:g.weight,ref:g.ref}:g);return{acyclic:{nodes:[...e.nodes],edges:m,layout:e.layout,nodeById:new Map(e.nodeById)},reversed:s}}l(fs,"removeCycles_DFS");function ds(t){const e=new Map,n=l(o=>{if(e.has(o))return e.get(o);const s=t.nodeById.get(o);if(!s)return e.set(o,null),null;const r=s.parentId;if(!r)return e.set(o,null),null;const c=n(r)??r;return e.set(o,c),c},"resolve");for(const o of t.nodes)n(o);return e}l(ds,"buildTopLaneMap");function le(t){const e=ds(t);return n=>e.get(n)??null}l(le,"createTopLaneResolver");function nn(t){const e=[];for(const n of t.layout.nodes??[])n.isGroup&&!n.parentId&&e.push(n.id);return[...new Set(e)].reverse()}l(nn,"buildTopLaneOrder");function go(t,e){const n=nn(t);if(!e||e.length===0)return n;const o=new Set(n),s=new Set,r=[];for(const f of e)!o.has(f)||s.has(f)||(s.add(f),r.push(f));for(const f of n)s.has(f)||r.push(f);return r}l(go,"resolveTopLaneOrder");var mr={EPSILON:1e-6},qe={GRAVITY_ITERATIONS:8,MAX_CROSSING_OPTIMIZATION_PASSES:4,DEFAULT_COMPACT_SINGLE_INPUT:!0},Lo={DEFAULT_LAYER_GAP:100,DEFAULT_NODE_GAP:40};function us(t,e){const n=pe(t),o=e?.laneOf??(()=>null),s=e?.rankHint,{preds:r}=en(n);for(const p of r.values())p.sort((M,A)=>M.localeCompare(A));const f=Ne(n)??[...n.nodes].sort((p,M)=>p.localeCompare(M)),c=new Map;for(const[p,M]of f.entries())c.set(M,p);const h=new Map,m=new Map;for(const p of n.nodes)m.set(p,[]);for(const p of f){const M=(r.get(p)??[]).filter(A=>h.has(A));if(M.length>0){const A=hs(p,M,{laneOf:o,rankHint:s,topoIndex:c});h.set(p,A),m.get(A).push(p)}else h.has(p)||h.set(p,null)}for(const p of n.nodes)h.has(p)||h.set(p,null);const y=new Set;for(const p of n.nodes)(h.get(p)??null)===null&&y.add(p);const g=[...y].sort((p,M)=>{const A=c.get(p)??0,R=c.get(M)??0;return A===R?p.localeCompare(M):A-R}),C=gs(n),d=new Map;for(const[p,M]of C.entries())d.set(p,[...M].sort((A,R)=>A.localeCompare(R)));const u=ms(d),i=ps(d),x=new Map;for(const p of n.nodes)x.set(p,[]);for(const p of i)for(const M of p.nodes){const A=x.get(M);A?A.push(p.id):x.set(M,[p.id])}const L=[],I=[],E=new Set,T=l(p=>{if(!E.has(p)){E.add(p),L.push(p);for(const M of m.get(p)??[])T(M);I.push(p)}},"walk");for(const p of g)T(p);for(const p of f)T(p);return{parent:h,children:m,roots:g,componentOf:u,blocks:i,nodeBlocks:x,adjacency:d,preorder:L,postorder:I,topologicalOrder:f}}l(us,"buildDrivingTree");function hs(t,e,n){const o=n.laneOf(t);return[...e].sort((r,f)=>{const c=n.laneOf(r),h=n.laneOf(f),m=c!=null&&c===o,y=h!=null&&h===o;if(m!==y)return m?-1:1;const g=n.rankHint?.[r],C=n.rankHint?.[f];if(g!=null&&C!=null&&g!==C)return C-g;const d=n.topoIndex.get(r)??0,u=n.topoIndex.get(f)??0;return d!==u?d-u:r.localeCompare(f)})[0]}l(hs,"chooseParent");function gs(t){const e=new Map;for(const n of t.nodes)e.set(n,new Set);for(const n of t.edges)e.get(n.src).add(n.dst),e.get(n.dst).add(n.src);return e}l(gs,"buildAdjacency");function ms(t){const e=new Map;let n=0;for(const o of t.keys()){if(e.has(o))continue;const s=[o];for(;s.length>0;){const r=s.pop();if(!e.has(r)){e.set(r,n);for(const f of t.get(r)??[])e.has(f)||s.push(f)}}n++}return e}l(ms,"assignComponents");function ps(t){const e=new Map,n=new Map,o=[],s=[];let r=0;const f=l((c,h)=>{e.set(c,++r),n.set(c,r);for(const m of t.get(c)??[])m!==h&&(e.has(m)?(e.get(m)??0)<(e.get(c)??0)&&(o.push([c,m]),n.set(c,Math.min(n.get(c)??r,e.get(m)??r))):(o.push([c,m]),f(m,c),n.set(c,Math.min(n.get(c)??r,n.get(m)??r)),(n.get(m)??0)>=(e.get(c)??0)&&s.push(ys(c,m,o,s.length))))},"visit");for(const c of t.keys())e.has(c)||f(c,null);return s}l(ps,"computeBlocks");function ys(t,e,n,o){const s=[],r=new Set;for(;n.length>0;){const f=n.pop();if(s.push(f),r.add(f[0]),r.add(f[1]),f[0]===t&&f[1]===e||f[0]===e&&f[1]===t)break}return{id:o,edges:s,nodes:[...r]}}l(ys,"popBlock");function xs(t,e,n){const o=[...t.nodes],s=new Map;for(const[I,E]of o.entries())s.set(E,I);const r=o.length,f=new Array(r).fill(-1),c=new Array(r).fill(0),h=[],m=new Set;for(const I of o){const E=n.parent.get(I)??null,T=s.get(I);T!=null&&E==null&&(f[T]=-1,c[T]=0,m.has(I)||(m.add(I),h.push(I)))}for(;h.length>0;){const I=h.shift(),E=s.get(I);if(E==null)continue;const T=n.children.get(I)??[];for(const p of T){if(m.has(p))continue;const M=s.get(p);M!=null&&(f[M]=E,c[M]=c[E]+1,m.add(p),h.push(p))}}for(const I of o){if(m.has(I))continue;const E=s.get(I);E!=null&&(f[E]=-1,c[E]=0,m.add(I))}const y=Math.max(1,Math.ceil(Math.log2(Math.max(1,r)))+1),g=Array.from({length:y},()=>new Array(r).fill(-1));for(let I=0;I<r;I++)g[0][I]=f[I];for(let I=1;I<y;I++)for(let E=0;E<r;E++){const T=g[I-1][E];g[I][E]=T===-1?-1:g[I-1][T]}const C=l((I,E)=>{if(I===-1||E===-1)return-1;c[I]<c[E]&&([I,E]=[E,I]);const T=c[I]-c[E];for(let p=0;p<y;p++)if(T>>p&1&&(I=g[p][I],I===-1))return-1;if(I===E)return I;for(let p=y-1;p>=0;p--){const M=g[p][I],A=g[p][E];M===-1||A===-1||M!==A&&(I=M,E=A)}return g[0][I]},"lcaIndex"),d=Array.from({length:r},()=>new Map);for(const I of t.edges){let E=I.src,T=I.dst,p=e[E],M=e[T];if(p==null||M==null||(p>M&&([E,T]=[T,E],[p,M]=[M,p]),p==null||M==null||p===M))continue;const A=s.get(E),R=s.get(T);if(A==null||R==null)continue;const k=C(A,R);if(k===-1)continue;const O=d[k];for(let F=p;F<M;F++)O.set(F,(O.get(F)??0)+1)}const u=new Map,i=l((I,E)=>{if(E.size!==0)for(const[T,p]of E)I.set(T,(I.get(T)??0)+p)},"mergeInto"),x=new Set,L=l(I=>{const E=s.get(I);x.add(I);const T=E==null?void 0:d[E],p=T?new Map(T):new Map,M=n.children.get(I)??[];for(const A of M){const R=L(A),k=e[I];if(k!=null){let O=u.get(I);O||(O=new Map,u.set(I,O));let F=R.get(k)??0;const D=e[A];D!=null&&D>k&&(F+=1),O.set(A,F)}i(p,R)}return p},"dfs");for(const I of n.roots)x.has(I)||L(I);for(const I of o)x.has(I)||L(I);return u}l(xs,"computeSubtreeCrossCounts");function bs(t,e,n){const o=new Map,s=l(r=>{let f=n[r]??0;const c=[...e.get(r)??[]];c.sort(mo(n));for(const h of c){s(h);const m=o.get(h);m!=null&&(f=Math.min(f,m))}o.set(r,f)},"annotate");for(const r of t)s(r);return o}l(bs,"annotateMinimumLayers");function mo(t){return(e,n)=>{const o=t[e]??0,s=t[n]??0;return o===s?e.localeCompare(n):o-s}}l(mo,"compareByRankThenId");function Is(t,e,n,o){let s=0;for(const h of e){const m=n[h]??0;m>s&&(s=m)}const r=Array.from({length:s+1},()=>[]),f=new Set,c=l(h=>{if(f.has(h))return;f.add(h);const m=n[h]??0;r[m]||(r[m]=[]),r[m].push(h);for(const y of o(h))c(y)},"emit");for(const h of t)c(h);for(const h of e)if(!f.has(h)){const m=n[h]??0;r[m]||(r[m]=[]),r[m].push(h),f.add(h)}return r}l(Is,"emitNodesInTreeOrder");function Ms(t){const e=[];for(const n of t){const o=new Set,s=[];for(const r of n)o.has(r)||(o.add(r),s.push(r));e.push(s)}return e}l(Ms,"deduplicateLayers");function Ss(t,e,n,o){return s=>{const r=t.get(s)??[];if(r.length===0)return[];const f=e[s]??0,c=[],h=[],m=n.get(s);for(const y of r){const g=o.get(y)??f;g>f?c.push({child:y,min:g}):h.push(y)}return c.sort((y,g)=>y.min===g.min?y.child.localeCompare(g.child):y.min-g.min),h.sort((y,g)=>{const C=m?.get(y)??0,d=m?.get(g)??0;if(C!==d)return C-d;const u=o.get(y)??f,i=o.get(g)??f;return u!==i?u-i:y.localeCompare(g)}),[...c.map(y=>y.child),...h]}}l(Ss,"createChildOrderer");function Ze(t,e,n){const o=us(t,{rankHint:e,laneOf:n}),{children:s,roots:r}=o;for(const g of t.nodes)s.has(g)||s.set(g,[]);const f=xs(t,e,o),c=[...r].sort(mo(e)),h=bs(c,s,e),m=Ss(s,e,f,h);let y=Is(c,t.nodes,e,m);return y=Ms(y),y}l(Ze,"buildMultitreeLayerOrder");function Cs(t,e,n){const o=new Set(t),s=new Set(e),r=Ae(e),f=[];for(const c of n)o.has(c.src)&&s.has(c.dst)&&f.push(r.get(c.dst));return ho(f)}l(Cs,"countCrossingsBetweenAdjacent");function Xn(t,e,n){const o=[];for(const r of e){const f=n[r.src],c=n[r.dst];if(f==null||c==null||f===c)continue;let h=r.src,m=r.dst,y=f,g=c;f>c&&(h=r.dst,m=r.src,y=c,g=f);for(let C=y;C<g;C++)o.push({id:`${r.id}@${C}`,src:h,dst:m,ref:r.ref})}let s=0;for(let r=0;r+1<t.length;r++)s+=Cs(t[r],t[r+1],o);return s}l(Xn,"totalCrossings");function vs(t,e){const n={...e},{preds:o}=en(t),s=le(t),r=Ze(t,n,s);let f=Xn(r,t.edges,n);const c=qe.MAX_CROSSING_OPTIMIZATION_PASSES;for(let h=0;h<c;h++){let m=!1;const y=[...t.nodes].sort((g,C)=>(n[C]??0)-(n[g]??0));for(const g of y){const C=n[g]??0;if(C===0)continue;let d=0;for(const L of o.get(g)??[])d=Math.max(d,(n[L]??0)+1);if(d>=C)continue;const u=C;n[g]=d;const i=Ze(t,n,s),x=Xn(i,t.edges,n);x<f?(f=x,m=!0):n[g]=u}if(!m)break}return n}l(vs,"optimizeRanksByCrossings");function Ls(t,e){const n=le(t),o=[...t.nodes].sort((s,r)=>(e[s]??0)-(e[r]??0)||s.localeCompare(r));for(const s of o){const r=n(s);if(!r)continue;const f=t.edges.filter(i=>i.src===s);if(f.length===0)continue;let c=!1,h=0;for(const i of f){const x=n(i.dst);x==null||x===r?c=!0:h++}if(h===0||c)continue;let m=0,y=!1;for(const i of t.edges){if(i.dst!==s)continue;const x=n(i.src);x&&(x===r?y=!0:m++)}if(m>0||!y)continue;const g=e[s]??0,C=g+h;let d=0;for(const i of t.edges)i.dst===s&&(d=Math.max(d,(e[i.src]??0)+1));const u=Math.max(g,d,C);u!==g&&(e[s]=u)}}l(Ls,"adjustCrossLaneSources");function Ts(t,e){const n=pe(t),o=Ne(n)??[...n.nodes].sort(),s=e?.compactSingleInput??!1,r=le(n);let f=Object.create(null);for(const h of o){const m=ao(n,h),y=e?.ignoreCrossLaneEdges?m.filter(g=>{const C=r(g.src),d=r(h);return!C||!d?!0:C===d}):m;if(y.length===0)f[h]=0;else if(s&&y.length===1){const g=y[0].src,C=r(g),d=r(h);C!==d?f[h]=f[g]??0:f[h]=(f[g]??0)+1}else{let g=-1/0;for(const C of y)g=Math.max(g,(f[C.src]??0)+1);f[h]=g===-1/0?0:g}}return(e?.optimizeRanksByCrossings??!1)&&(f=vs(n,f)),e?.ignoreCrossLaneEdges&&Ls(n,f),{layers:Ze(n,f,r),rankOf:f,dummy:new Set}}l(Ts,"assignLayers_LongestPath");function ws(t,e){const n=pe(t),s={...Ts(n,{compactSingleInput:e?.compactSingleInput,ignoreCrossLaneEdges:e?.ignoreCrossLaneEdges,optimizeRanksByCrossings:e?.optimizeRanksByCrossings}).rankOf},r=le(n),{preds:f,succs:c}=en(n,u=>{if(e?.ignoreCrossLaneEdges){const i=r(u.src),x=r(u.dst);if(i&&x&&i!==x)return!1}return!0}),h=Ne(n)??[...n.nodes],m=[...h].reverse(),y=l((u,i)=>{let x=0;for(const E of f.get(u)??[])x=Math.max(x,(s[E]??0)+1);let L=Number.POSITIVE_INFINITY;const I=c.get(u)??[];return I.length>0&&(L=Math.min(...I.map(E=>(s[E]??0)-1))),Number.isFinite(L)||(L=Math.max(x,i)),Math.min(Math.max(i,x),L)},"clampFeasible"),g=qe.GRAVITY_ITERATIONS,C=l(u=>{let i=!1;for(const x of u){const L=f.get(x)??[],I=c.get(x)??[];if(L.length===0&&I.length===0)continue;const E=L.length>0?L.reduce((A,R)=>A+(s[R]??0)+1,0)/L.length:s[x]??0,T=I.length>0?I.reduce((A,R)=>A+(s[R]??0)-1,0)/I.length:s[x]??0,p=Math.round((E+T)/2),M=y(x,p);M!==s[x]&&(s[x]=M,i=!0)}return i},"relaxOrder");for(let u=0;u<g;u++){const i=C(h),x=C(m);if(!i&&!x)break}for(const u of h){let i=0;for(const x of f.get(u)??[])i=Math.max(i,(s[x]??0)+1);(s[u]??0)<i&&(s[u]=i)}for(const u of m){const i=c.get(u)??[];if(i.length>0){const x=Math.min(...i.map(L=>(s[L]??0)-1));(s[u]??0)>x&&(s[u]=x)}}return{layers:uo(n,h,s),rankOf:s,dummy:new Set}}l(ws,"assignLayers_Gravity");function Es(t){const e=tn(t),n=lo(t);let o=fo(t,e);const s=[];for(;o.length>0;){const r=[];for(const f of o){s.push(f);for(const c of n.get(f)??[])e.set(c,(e.get(c)??0)-1),(e.get(c)??0)===0&&r.push(c)}o=r.sort((f,c)=>f.localeCompare(c))}return s.length===t.nodes.length?s:null}l(Es,"topoSortByGenerationIfAcyclic");function As(t,e){const n=pe(t),o=e?.direction==="LR"?Es(n)??[...n.nodes].sort():Ne(n)??[...n.nodes].sort(),s=le(n),r=l(y=>s(y)??y,"laneOf"),f=Object.create(null),c=new Map,h=l((y,g)=>e?.ignoreCrossLaneEdges??!0?r(y)===r(g)?1:0:1,"edgeWeight");for(const y of o){if(n.nodeById.get(y)?.isGroup)continue;const C=ao(n,y);let d=0;if(C.length>0)for(const L of C){const I=L.src,E=f[I]??0;d=Math.max(d,E+h(I,y))}const u=r(y),i=c.get(u)??0,x=Math.max(d,i);f[y]=x,c.set(u,x+1)}return{layers:uo(n,o,f,{skipGroups:!0}),rankOf:f,dummy:new Set}}l(As,"assignLayers_LaneAwareCompact");function Rs(t,e){const n=pe(e),{rankOf:o}=t,s=t.layers.map(d=>[...d]),r=new Set(t.dummy?[...t.dummy]:[]);let f=0;const c=new Map(n.nodeById),h=l(d=>{const u=`placeholder-${f++}`,i={id:u,isGroup:!1,isDummy:!0,width:0,height:0};for(c.set(u,i),r.add(u);s.length<=d;)s.push([]);return s[d].push(u),o[u]=d,u},"addDummyAt"),m=[...n.edges].sort((d,u)=>d.id===u.id?d.src===u.src?d.dst.localeCompare(u.dst):d.src.localeCompare(u.src):d.id.localeCompare(u.id)),y=[];for(const d of m){const u=o[d.src]??0,i=o[d.dst]??0;if(i-u<=1){y.push(d);continue}let x=d.src;for(let I=u+1,E=0;I<i;I++,E++){const T=h(I);y.push({id:`${d.id}#${E}`,src:x,dst:T,weight:d.weight,ref:d.ref}),x=T}const L=i-u-2;y.push({id:`${d.id}#${Math.max(L+1,0)}`,src:x,dst:d.dst,weight:d.weight,ref:d.ref})}const C={nodes:[...n.nodes,...[...r].filter(d=>!n.nodes.includes(d))],edges:y,layout:n.layout,nodeById:c};return{layering:{layers:s,rankOf:o,dummy:r},graphWithDummies:C}}l(Rs,"makeProperLayering");function Yn(t){const e=t.length;if(e===0)return Number.POSITIVE_INFINITY;const n=[...t].sort((o,s)=>o-s);return e%2===1?n[(e-1)/2]:.5*(n[e/2-1]+n[e/2])}l(Yn,"median");function Gn(t){return t.length===0?Number.POSITIVE_INFINITY:t.reduce((n,o)=>n+o,0)/t.length}l(Gn,"barycenter");function Ns(t,e,n,o){const s=new Map;for(const r of t)s.set(r,[]);for(const r of n)o==="down"?e.has(r.src)&&s.has(r.dst)&&s.get(r.dst).push(e.get(r.src)):e.has(r.dst)&&s.has(r.src)&&s.get(r.src).push(e.get(r.dst));return s}l(Ns,"neighborPositionsFor");function Os(t,e,n){const o=n.get(t)??0,s=n.get(e)??0;return o!==s?o-s:t.localeCompare(e)}l(Os,"currentOrderTieBreak");function zn(t,e,n){const o=new Set(t),s=new Set(e),r=Ae(t),f=Ae(e),c=[];for(const m of n)o.has(m.src)&&s.has(m.dst)&&c.push({u:r.get(m.src),v:f.get(m.dst)});c.sort((m,y)=>m.u===y.u?m.v-y.v:m.u-y.u);const h=c.map(m=>m.v);return ho(h)}l(zn,"countCrossingsBetweenAdjacent");function Ge(t,e,n){return[...t].sort((o,s)=>{const r=Yn(e.get(o)??[]),f=Yn(e.get(s)??[]);return r===f?Os(o,s,n):isFinite(r)?isFinite(f)?r-f:-1:1})}l(Ge,"sortByHeuristic");function $n(t,e,n,o,s,r){const f=Ae(t),c=Ae(e),h=Ns(e,f,n,o);if(!s||!r||r.length===0)return Ge(e,h,c);const m=new Map;for(const C of e){const d=s(C),u=m.get(d)??[];u.push(C),m.set(d,u)}const y=[];for(const C of r){const d=m.get(C);if(!d||d.length===0)continue;const u=Ge(d,h,c);y.push(...u)}const g=m.get(null);if(g&&g.length>0){const C=Ge(g,h,c);for(const d of C){const u=Gn(h.get(d)??[]);let i=y.length;if(isFinite(u))for(const[x,L]of y.entries()){const I=Gn(h.get(L)??[]);if(u<I){i=x;break}}y.splice(i,0,d)}}return y}l($n,"reorderLayer");function Vn(t,e,n,o,s){const r=[...e],f=new Set(t),c=new Set(e),h=o?new Set(o):null,m=n.filter(i=>f.has(i.src)&&c.has(i.dst)),y=h?n.filter(i=>c.has(i.src)&&h.has(i.dst)):void 0,g=l(i=>{let x=zn(t,i,m);return y&&o&&(x+=zn(i,o,y)),x},"crossingScore"),C=s?new Map:null;if(s&&C)for(const i of e)C.set(i,s(i));let d=!0,u=g(r);for(;d;){d=!1;for(let i=0;i+1<r.length;i++){if(C){const I=C.get(r[i]),E=C.get(r[i+1]);if(I!==E)continue}const x=u;[r[i],r[i+1]]=[r[i+1],r[i]];const L=g(r);L<x?(u=L,d=!0):[r[i],r[i+1]]=[r[i+1],r[i]]}}return r}l(Vn,"transposeImprove");function Bs(t,e,n){const o=t.layers.map(c=>[...c]),s=e.edges,r=le(e),f=go(e,n?.laneOrder);for(let c=0;c<3;c++){for(let h=1;h<o.length;h++)o[h]=$n(o[h-1],o[h],s,"down",r,f),o[h]=Vn(o[h-1],o[h],s,o[h+1],r);for(let h=o.length-2;h>=0;h--)o[h]=$n(o[h+1],o[h],s,"up",r,f),o[h]=Vn(o[h+1],o[h],s,o[h-1],r)}return{layers:o}}l(Bs,"orderLayers");function Ps(t,e,n){const o=n?.layerGap??Lo.DEFAULT_LAYER_GAP,s=n?.nodeGap??Lo.DEFAULT_NODE_GAP,r=n?.laneGap??s*2,f=n?.direction??"TB",c=f==="LR"||f==="RL",h=t.layers,m=Object.create(null),y=Object.create(null),g=l(O=>e.nodeById.get(O),"getNode"),C=l(O=>g(O)?.width??0,"getWidth"),d=l(O=>g(O)?.height??0,"getHeight"),u=le(e),i=go(e,n?.laneOrder),x=h.map(O=>O.reduce((F,D)=>Math.max(F,d(D)),0)),L=[];if(c)for(let O=0;O+1<h.length;O++){const F=h[O].reduce((pt,kt)=>Math.max(pt,C(kt)),0),D=h[O+1].reduce((pt,kt)=>Math.max(pt,C(kt)),0),B=x[O],G=x[O+1],j=B/2+G/2,Z=(F+D)/2,dt=Math.max(0,Z-j-o);L.push(dt)}const I=new Set;for(const O of h)for(const F of O)I.add(u(F));const E=I.has(null),T=i.filter(O=>I.has(O)),p=[...E?[null]:[],...T],M=Object.create(null);for(const O of T)M[O]=0;E&&(M.null=0);for(const O of h){const F=Object.create(null),D=[];for(const B of O){const G=u(B);G===null?D.push(B):(F[G]||=[]).push(B)}for(const[B,G]of Object.entries(F)){const j=G.reduce((Z,dt)=>Z+C(dt),0)+s*Math.max(0,G.length-1);M[B]=Math.max(M[B]??0,j)}if(E&&D.length){const B=D.reduce((G,j)=>G+C(j),0)+s*Math.max(0,D.length-1);M.null=Math.max(M.null??0,B)}}const A=new Map;{const O=p.map(B=>(B===null?M.null:M[B])??0);let D=-(O.reduce((B,G)=>B+G,0)+r*Math.max(0,p.length-1))/2;for(let B=0;B<p.length;B++){const G=p[B],j=O[B]??0,Z=D+j/2;A.set(G,Z),D+=j,B<p.length-1&&(D+=r)}}let R=0;for(const[O,F]of h.entries()){const D=x[O]??0,B=new Map;for(const j of F){const Z=u(j),dt=B.get(Z)??[];dt.push(j),B.set(Z,dt)}for(const j of p){const Z=B.get(j)??[];if(Z.length===0)continue;const dt=A.get(j);if(Z.length===1){const pt=Z[0];m[pt]=dt,y[pt]=R+D/2}else{const pt=Z.map(Q=>C(Q)),kt=pt.reduce((Q,W)=>Q+W,0)+s*(Z.length-1);let Bt=dt-kt/2;for(const[Q,W]of Z.entries()){const et=pt[Q];m[W]=Bt+et/2,y[W]=R+D/2,Bt+=et+s}}}const G=L[O]??0;R+=D+o+G}const k=new Map;for(const O of e.edges){const F=O.ref.id;k.has(F)||k.set(F,[]),k.get(F).push(O)}for(const[,O]of k){if(O.length===0)continue;const F=O[0].ref,D=F.start,B=F.end;if(D==null||B==null)continue;const G=Math.round(((m[D]??0)+(m[B]??0))/2),j=new Set;for(const Z of O)j.add(Z.src),j.add(Z.dst);for(const Z of j){if(Z===D||Z===B)continue;e.nodeById.get(Z)?.isDummy&&(m[Z]=G)}}return{x:m,y}}l(Ps,"assignCoordinates");var ks=8;function Fs(t){let e=2166136261;for(let n=0;n<t.length;n++)e^=t.charCodeAt(n),e=Math.imul(e,16777619);return e>>>0}l(Fs,"hashString");function _s(t){let e=t>>>0;return()=>{e+=1831565813;let n=e;return n=Math.imul(n^n>>>15,n|1),n^=n+Math.imul(n^n>>>7,n|61),((n^n>>>14)>>>0)/4294967296}}l(_s,"mulberry32");function Hs(t,e){const n=[...t],o=_s(e);for(let s=n.length-1;s>0;s--){const r=Math.floor(o()*(s+1));[n[s],n[r]]=[n[r],n[s]]}return n}l(Hs,"deterministicShuffle");function Ds(t,e){let n=0;for(const[o,s]of t.entries())n+=Math.abs(o-(e.get(s)??o));return n}l(Ds,"sourceDistance");function jn(t,e){const n=new Map;for(const[s,r]of t.entries())n.set(r,s);let o=0;for(const{a:s,b:r,weight:f}of e){const c=n.get(s),h=n.get(r);c==null||h==null||(o+=f*Math.abs(c-h))}return o}l(jn,"laneArrangementCost");function Xs(t){const e=nn(t);if(e.length<2)return[];const n=new Map(e.map((r,f)=>[r,f])),o=le(t),s=new Map;for(const r of t.layout.edges??[]){if(r.isLayoutOnly)continue;const f=typeof r.start=="string"?r.start:void 0,c=typeof r.end=="string"?r.end:void 0;if(!f||!c||!t.nodeById.has(f)||!t.nodeById.has(c))continue;const h=o(f),m=o(c);if(!h||!m||h===m)continue;const y=n.get(h),g=n.get(m);if(y==null||g==null)continue;const[C,d]=y<=g?[h,m]:[m,h],u=`${C}\0${d}`,i=s.get(u);i?i.weight++:s.set(u,{a:C,b:d,weight:1})}return[...s.values()]}l(Xs,"buildWeightedLaneEdges");function Un(t,e,n){const o=[...t];let s=jn(o,e),r=!0,f=0;const c=Math.max(1,o.length);for(;r&&f<c;){r=!1,f++;for(let h=0;h+1<o.length;h++){[o[h],o[h+1]]=[o[h+1],o[h]];const m=jn(o,e);m<s?(s=m,r=!0):[o[h],o[h+1]]=[o[h+1],o[h]]}}return{order:o,cost:s,sourceDistance:Ds(o,n)}}l(Un,"greedySwitch");function Ys(t,e){return t.cost!==e.cost?t.cost<e.cost:t.sourceDistance<e.sourceDistance}l(Ys,"isBetterCandidate");function Gs(t,e,n){const o=[...e].sort((s,r)=>s.a===r.a?s.b.localeCompare(r.b):s.a.localeCompare(r.a)).map(({a:s,b:r,weight:f})=>`${s}:${r}:${f}`).join("|");return Fs(`${t.join("|")}#${o}#${n}`)}l(Gs,"seedForRestart");function zs(t,e={}){const n=nn(t);if(n.length<2)return n;const o=Xs(t);if(o.length===0)return n;const s=new Map(n.map((c,h)=>[c,h]));let r=Un(n,o,s);const f=Math.max(0,e.restarts??ks);for(let c=0;c<f;c++){const h=Gs(n,o,c),m=Hs(n,h),y=Un(m,o,s);Ys(y,r)&&(r=y)}return r.order}l(zs,"optimizeTopLaneOrder");function $s(t,e){const n=e?.ignoreCrossLaneEdges??!0,o=e?.optimizeRanksByCrossings??!0,s=pe(t),r=e?.automaticLaneOrdering?zs(s,{restarts:ks}):void 0,f=fs(s),c=f.acyclic,h=n?As(c,{compactSingleInput:e?.compactSingleInput??qe.DEFAULT_COMPACT_SINGLE_INPUT,ignoreCrossLaneEdges:!0,direction:e?.direction}):ws(c,{compactSingleInput:e?.compactSingleInput??qe.DEFAULT_COMPACT_SINGLE_INPUT,ignoreCrossLaneEdges:!1,optimizeRanksByCrossings:o}),{layering:m,graphWithDummies:y}=Rs(h,c),g=Bs(m,y,{laneOrder:r}),C=Ps(g,y,{layerGap:e?.layerGap,nodeGap:e?.nodeGap,direction:e?.direction,laneOrder:r});return{acyclic:c,reversed:f.reversed,layering:m,ordered:g,coordinates:C}}l($s,"sugiyamaLayout");var ct=mr.EPSILON,pr=8,xe=15,Te=15,Xe=25,ne=20,pn=10;function Wn(t,e,n){const o=t.x??0,s=t.y??0,r=e.x-o,f=e.y-s,c=Math.abs(r),h=Math.abs(f);return c<ct&&h<ct?n:h>ct&&h*3>=c?f>0?"bottom":"top":c>ct?r>0?"right":"left":n}l(Wn,"chooseOrthogonalSide");function Kn(t,e){return Math.abs(t.to-e.from)<ct||Math.abs(t.to-e.to)<ct?t.to:t.from}l(Kn,"sharedLineEndpointCoord");function be(t,e){return t.orient==="vertical"?{x:t.coord,y:e}:{x:e,y:t.coord}}l(be,"pointOnLine");function Vs(t,e){const n=t.nodes??[],o=t.edges??[],s=[];for(const a of o)a.isLayoutOnly||s.push({...a,__originalEdge:a});const r=new Map,f=new Map,c=[],h=e==="LR";for(const a of n)r.set(a.id,a);const m=n.filter(a=>a.isGroup&&!a.parentId);for(const a of m){const b={id:a.id},S=l(v=>{f.set(v.id,b),n.filter(w=>w.parentId===v.id).forEach(S)},"assignLane");S(a)}const y=n.filter(a=>!a.isGroup&&!a.isEdgeLabel).map(a=>{const b=a.width??10,S=a.height??10,v=a.x??0,w=a.y??0,P=pr;return{nodeId:a.id,minX:v-b/2-P,maxX:v+b/2+P,minY:w-S/2-P,maxY:w+S/2+P,visualXHalfExtent:h?S/2+P:b/2+P}}),g=l((a,b,S,v)=>{let w=c.find(P=>P.orientation===a&&Math.abs(P.coord-b)<1);return w||(w={id:`pipe-${a}-${b.toFixed(0)}`,orientation:a,coord:b,spanMin:S,spanMax:v,tracks:[]},c.push(w)),w.spanMin=Math.min(w.spanMin,S),w.spanMax=Math.max(w.spanMax,v),w},"getOrAddPipe"),C=l((a,b)=>{const S=a.width??10,v=a.height??10,w=a.x??0,P=a.y??0;switch(b){case"top":return{x:w,y:P-v/2};case"bottom":return{x:w,y:P+v/2};case"left":return{x:w-S/2,y:P};case"right":return{x:w+S/2,y:P}}},"portForSide"),d=l((a,b,S)=>C(a,Wn(a,b,S?"bottom":"top")),"getOrthogonalPort"),u=[],i=[],x=new Set,L=1e3,I=l((a,b,S)=>{if(u.length===0)return 0;const v=Math.abs(b.y-S.y)<ct,w=Math.abs(b.x-S.x)<ct;if(!v&&!w)return 0;let P=0;if(v){const U=b.y,q=Math.min(b.x,S.x)-ct,$=Math.max(b.x,S.x)+ct;if($<=q)return 0;for(const Y of u)Y.edgeIndex===a||Y.orientation!=="vertical"||Y.pipe.coord<q||Y.pipe.coord>$||Y.from-ct<=U&&Y.to+ct>=U&&(P+=L)}else if(w){const U=b.x,q=Math.min(b.y,S.y)-ct,$=Math.max(b.y,S.y)+ct;if($<=q)return 0;for(const Y of u)Y.edgeIndex===a||Y.orientation!=="horizontal"||Y.pipe.coord<q||Y.pipe.coord>$||Y.from-ct<=U&&Y.to+ct>=U&&(P+=L)}return P},"crossingPenalty"),E=s.map((a,b)=>{if(!a.start||!a.end)return{idx:b,crossLane:0,dx:0,dy:0};const S=r.get(a.start),v=r.get(a.end),w=f.get(a.start),P=f.get(a.end),U=w&&P&&w.id!==P.id?1:0,q=S&&v?Math.abs((v.x??0)-(S.x??0)):0,$=S&&v?Math.abs((v.y??0)-(S.y??0)):0;return{idx:b,crossLane:U,dx:q,dy:$}}).sort((a,b)=>{if(a.crossLane!==b.crossLane)return b.crossLane-a.crossLane;const S=a.dx+a.dy,v=b.dx+b.dy;return Math.abs(S-v)>1?S-v:a.idx-b.idx}).map(a=>a.idx),T=l((a,b,S,v)=>{const w=Math.min(a.x,b.x),P=Math.max(a.x,b.x),U=Math.min(a.y,b.y),q=Math.max(a.y,b.y);return!!y.find(Y=>S&&Y.nodeId===S||v&&Y.nodeId===v?!1:Math.abs(a.x-b.x)>ct?Y.minY<a.y&&Y.maxY>a.y&&Y.maxX>w&&Y.minX<P:Y.minX<a.x&&Y.maxX>a.x&&Y.maxY>U&&Y.minY<q)},"isSegmentBlocked"),p=new Map,M=new Map;for(const a of s)!a.start||!a.end||a.start===a.end||(M.set(a.start,(M.get(a.start)??0)+1),M.set(a.end,(M.get(a.end)??0)+1));const A=l((a,b)=>Wn(a,b,"bottom"),"determineSide"),R=new Map;for(const[a,b]of s.entries()){if(!b.start||!b.end||b.start===b.end||b.points&&b.points.length>0)continue;const S=r.get(b.start),v=r.get(b.end);if(!S||!v)continue;const w=(v.x??0)-(S.x??0),P=(v.y??0)-(S.y??0);R.set(a,{edgeIdx:a,srcId:b.start,dstId:b.end,srcSide:A(S,{x:v.x??0,y:v.y??0}),dstSide:A(v,{x:S.x??0,y:S.y??0}),absDx:Math.abs(w),absDy:Math.abs(P),dxSign:Math.sign(w),dySign:Math.sign(P)})}const k=l(a=>a.srcSide==="top"||a.srcSide==="bottom"?a.absDx===0?1/0:a.absDy/a.absDx:a.absDy===0?1/0:a.absDx/a.absDy,"preferenceStrength"),O=l(a=>a.srcSide==="top"||a.srcSide==="bottom"?a.dxSign>=0?"right":"left":a.dySign>=0?"bottom":"top","secondarySide"),F=new Map;for(const a of R.values()){const b=`${a.srcId}:${a.srcSide}`;F.has(b)||F.set(b,[]),F.get(b).push(a)}const D=new Map,B=l((a,b)=>`${a}:${b}`,"loadKey");for(const a of R.values())D.set(B(a.srcId,a.srcSide),(D.get(B(a.srcId,a.srcSide))??0)+1),D.set(B(a.dstId,a.dstSide),(D.get(B(a.dstId,a.dstSide))??0)+1);for(const a of F.values())if(!(a.length<2)){a.sort((b,S)=>{const v=k(b),w=k(S);return Math.abs(v-w)>1e-9?w-v:b.edgeIdx-S.edgeIdx});for(let b=1;b<a.length;b++){const S=a[b],v=O(S),w=D.get(B(S.srcId,S.srcSide))??0,P=D.get(B(S.srcId,v))??0;P>=w||(D.set(B(S.srcId,S.srcSide),w-1),D.set(B(S.srcId,v),P+1),S.srcSide=v)}}const G=l(a=>{const b=a?.shape;return b==="question"||b==="diamond"},"isDiamondNode"),j=new Map;for(const a of R.values())j.has(a.dstId)||j.set(a.dstId,new Set),j.get(a.dstId).add(a.dstSide);for(const a of R.values()){if(!G(r.get(a.srcId)))continue;const b=j.get(a.srcId);if(!b?.has(a.srcSide))continue;const S=O(a);if(b.has(S)||(D.get(B(a.srcId,S))??0)>0)continue;const v=D.get(B(a.srcId,a.srcSide))??0;D.set(B(a.srcId,a.srcSide),Math.max(0,v-1)),D.set(B(a.srcId,S),1),a.srcSide=S}for(const a of R.values()){const{edgeIdx:b,srcId:S,dstId:v,srcSide:w,dstSide:P}=a,U=r.get(S),q=r.get(v),$=`${S}:${w}:src`,Y=w==="top"||w==="bottom"?q.x??0:q.y??0;p.has($)||p.set($,[]),p.get($).push({edgeIdx:b,oppositeCoord:Y});const ot=`${v}:${P}:dst`,rt=P==="top"||P==="bottom"?U.x??0:U.y??0;p.has(ot)||p.set(ot,[]),p.get(ot).push({edgeIdx:b,oppositeCoord:rt})}const Z=new Map,dt=8;for(const[a,b]of p){if(b.length<2)continue;b.sort((Lt,Ht)=>Lt.oppositeCoord-Ht.oppositeCoord);const S=a.split(":"),v=S.slice(0,-2).join(":"),w=S[S.length-2],P=S[S.length-1],U=r.get(v);if(!U)continue;const $=w==="left"||w==="right"?U.height??10:U.width??10,Y=U.shape,rt=Y==="question"||Y==="diamond"?$*.3:$,tt=Math.min(20,Math.max(dt,rt/(b.length+1))),Rt=-(tt*(b.length-1))/2;for(const[Lt,Ht]of b.entries()){const Zt=Rt+Lt*tt,cn=`${Ht.edgeIdx}:${P}`;Z.set(cn,Zt)}}const pt=l(a=>!!s[a]?.labelNodeId,"edgeHasLabelNode"),kt=l((a,b)=>a?(p.get(`${a}:${b}:src`)??[]).some(({edgeIdx:S})=>pt(S))||(p.get(`${a}:${b}:dst`)??[]).some(({edgeIdx:S})=>pt(S)):!1,"faceHasLabelNode"),Bt=l((a,b,S)=>b==="top"||b==="bottom"?{x:a.x+S,y:a.y}:{x:a.x,y:a.y+S},"applyPortOffset"),Q=l((a,b,S)=>{const v=R.get(a),w={x:S.x??0,y:S.y??0},P={x:b.x??0,y:b.y??0},U=v?.srcSide??A(b,w),q=v?.dstSide??A(S,P);let $=v?C(b,v.srcSide):d(b,w,!0),Y=v?C(S,v.dstSide):d(S,P,!1);const ot=Z.get(`${a}:src`),rt=Z.get(`${a}:dst`);return ot!==void 0&&($=Bt($,U,ot)),rt!==void 0&&(Y=Bt(Y,q,rt)),{pSrcPort:$,pDstPort:Y,srcSide:U,dstSide:q}},"portsForEdge");for(const a of E){const b=s[a];if(i[a]=[],!b.start||!b.end||b.points&&b.points.length>0||b.start===b.end)continue;const S=r.get(b.start),v=r.get(b.end);if(!S||!v)continue;const{pSrcPort:w,pDstPort:P,srcSide:U,dstSide:q}=Q(a,S,v),$={...w},Y={...P},ot=U==="top"||U==="bottom",rt=q==="top"||q==="bottom";if(ot){const X=w.y>(S.y??0);$.y=X?w.y+ne:w.y-ne}else{const X=w.x>(S.x??0);$.x=X?w.x+ne:w.x-ne}if(rt){const X=P.y>(v.y??0);Y.y=X?P.y+ne:P.y-ne}else{const X=P.x>(v.x??0);Y.x=X?P.x+ne:P.x-ne}const st=l((X,z)=>{for(const K of y)if(!z.includes(K.nodeId)&&X.x>K.minX&&X.x<K.maxX&&X.y>K.minY&&X.y<K.maxY)return{inside:!0,obstacle:K};return{inside:!1}},"isPointInObstacle"),tt=l((X,z,K,lt,Ct)=>{if(Ct){const Nt=X.y>(z.y??0);return{x:(K.x??0)>=X.x?lt.maxX+xe:lt.minX-xe,y:Nt?lt.maxY+Te:lt.minY-Te,leavesPositiveSide:Nt}}const bt=X.x>(z.x??0),Tt=(K.y??0)>=X.y;return{x:bt?lt.maxX+xe:lt.minX-xe,y:Tt?lt.maxY+Te:lt.minY-Te,leavesPositiveSide:bt}},"obstacleDetour");let yt=[];const Rt=[b.start,b.end],Lt=st($,Rt);if(Lt.inside&&Lt.obstacle){const X=Lt.obstacle;if(ot){const z=tt(w,S,v,X,!0);$.x=z.x,$.y=z.y;const K=z.leavesPositiveSide?Math.min(X.minY-2,w.y+ne):Math.max(X.maxY+2,w.y-ne);yt=[{x:w.x,y:K},{x:z.x,y:K},{x:z.x,y:z.y}]}else{const z=tt(w,S,v,X,!1),K=z.leavesPositiveSide?Math.min(X.minX-2,w.x+ne):Math.max(X.maxX+2,w.x-ne);$.x=z.x,$.y=z.y,yt=[{x:K,y:w.y},{x:K,y:z.y},{x:z.x,y:z.y}]}}let Ht=[];const Zt=st(Y,Rt);if(Zt.inside&&Zt.obstacle){const X=Zt.obstacle;if(rt){const z=tt(P,v,S,X,!0);Y.x=z.x,Y.y=z.y,Ht=[{x:z.x,y:z.y},{x:P.x,y:z.y}]}else{const z=tt(P,v,S,X,!1);Y.x=z.x,Y.y=z.y,Ht=[{x:z.x,y:z.y},{x:z.x,y:P.y}]}}if(yt.length===0&&Ht.length===0){const X=xe,z=Math.abs($.x-Y.x)<X,K=Math.abs($.y-Y.y)<X,lt=Z.get(`${a}:src`)!==void 0||Z.get(`${a}:dst`)!==void 0,Ct=(p.get(`${b.start??""}:${U}:src`)?.length??0)+(p.get(`${b.start??""}:${U}:dst`)?.length??0),bt=(p.get(`${b.end??""}:${q}:src`)?.length??0)+(p.get(`${b.end??""}:${q}:dst`)?.length??0),Tt=Ct>1||bt>1,Nt=M.get(b.start??"")??0,ut=M.get(b.end??"")??0,Yt=Ct>1&&kt(b.start,U)||bt>1&&kt(b.end,q),ee=Ct<=1||Nt<=2,Pt=bt<=1||ut<=2;if((z||K)&&!lt&&(!Tt||Tt&&!Yt&&ee&&Pt)&&!T(w,P,b.start,b.end)){b.points=[{...w},{...$},{...Y},{...P}],x.add(a);const It=K?"horizontal":"vertical",zt=K?w.y:w.x,Mt=K?Math.min(w.x,P.x):Math.min(w.y,P.y),St=K?Math.max(w.x,P.x):Math.max(w.y,P.y),Wt={id:`fast-path-${It}-${zt.toFixed(0)}-${a}`,orientation:It,coord:zt,spanMin:Mt,spanMax:St,tracks:[]};u.push({edgeIndex:a,segmentIndex:0,orientation:It,pipe:Wt,trackIndex:0,from:Mt,to:St});continue}}const cn=g("vertical",$.x,$.y,$.y);$.x=cn.coord;const Ks=g("vertical",Y.x,Y.y,Y.y);Y.x=Ks.coord;let de=Math.min($.x,Y.x)-50,ue=Math.max($.x,Y.x)+50,Ce=Math.min($.y,Y.y)-50,ve=Math.max($.y,Y.y)+50;for(const X of y){const z=Math.min($.x,Y.x),K=Math.max($.x,Y.x),lt=Math.min($.y,Y.y),Ct=Math.max($.y,Y.y);X.minX<K&&X.maxX>z&&X.minY<Ct&&X.maxY>lt&&(de=Math.min(de,X.minX-Xe),ue=Math.max(ue,X.maxX+Xe),Ce=Math.min(Ce,X.minY-Xe),ve=Math.max(ve,X.maxY+Xe))}for(const X of y){if(X.maxX<de||X.minX>ue||X.maxY<Ce||X.minY>ve)continue;const z=xe;g("horizontal",X.minY-z,de,ue),g("horizontal",X.maxY+z,de,ue);const K=Te;g("vertical",X.minX-K,Ce,ve),g("vertical",X.maxX+K,Ce,ve)}g("horizontal",$.y,de,ue),g("horizontal",Y.y,de,ue);const qs=c.filter(X=>X.orientation==="horizontal"&&X.coord>=Ce&&X.coord<=ve),Zs=c.filter(X=>X.orientation==="vertical"&&X.coord>=de&&X.coord<=ue),Oe=l((X,z)=>`${X.toFixed(1)},${z.toFixed(1)}`,"getKey"),Be=Oe($.x,$.y),po=Oe(Y.x,Y.y),Pe=new Map,an=new Map,ln=new Map,ke=new Set,ye=[];Pe.set(Be,0),ln.set(Be,"n"),ye.push({key:Be,f:Math.hypot(Y.x-$.x,Y.y-$.y),pt:$}),ke.add(Be);let Dt=[];const he=l((X,z)=>T(X,z,b.start,b.end),"checkSegmentBlocked"),fn={x:Y.x,y:$.y},Js=he($,fn),Qs=he(fn,Y),tr=Js||Qs,dn={x:$.x,y:Y.y},er=he($,dn),nr=he(dn,Y);if(tr?er||nr||(Math.abs($.x-Y.x)<ct?Dt=[$,Y]:Dt=[$,dn,Y]):Math.abs($.y-Y.y)<ct||Math.abs($.x-Y.x)<ct?Dt=[$,Y]:Dt=[$,fn,Y],Dt.length===0)for(;ye.length>0;){ye.sort((ut,Yt)=>ut.f-Yt.f);const X=ye.shift();if(ke.delete(X.key),X.key===po){let ut=po,Yt=Y;for(Dt=[Yt];an.has(ut);){const ee=an.get(ut);Dt.unshift(ee),Yt=ee,ut=Oe(ee.x,ee.y)}break}const z=X.pt.x,K=X.pt.y,lt=Zs.sort((ut,Yt)=>ut.coord-Yt.coord),Ct=lt.findIndex(ut=>Math.abs(ut.coord-z)<1),bt=qs.sort((ut,Yt)=>ut.coord-Yt.coord),Tt=bt.findIndex(ut=>Math.abs(ut.coord-K)<1),Nt=[];Ct>0&&Nt.push({x:lt[Ct-1].coord,y:K}),Ct>=0&&Ct<lt.length-1&&Nt.push({x:lt[Ct+1].coord,y:K}),Tt>0&&Nt.push({x:z,y:bt[Tt-1].coord}),Tt>=0&&Tt<bt.length-1&&Nt.push({x:z,y:bt[Tt+1].coord});for(const ut of Nt){const Yt=Math.min(z,ut.x),ee=Math.max(z,ut.x),Pt=Math.min(K,ut.y),Gt=Math.max(K,ut.y);if(y.some(Jt=>Jt.nodeId===b.start||Jt.nodeId===b.end?!1:Yt!==ee?Jt.minY<K&&Jt.maxY>K&&Jt.maxX>Yt&&Jt.minX<ee:Jt.minX<z&&Jt.maxX>z&&Jt.maxY>Pt&&Jt.minY<Gt))continue;const It=Oe(ut.x,ut.y),zt=Math.abs(ut.x-z)+Math.abs(ut.y-K),Mt=I(a,X.pt,ut);let St=0;const Wt=Y.x-$.x,Le=Y.y-$.y,Fe=ut.x-z,un=ut.y-K;(Le>10&&un<-5||Le<-10&&un>5)&&(St=Math.abs(un)*100),(Wt>10&&Fe<-5||Wt<-10&&Fe>5)&&(St+=Math.abs(Fe)*50);let yo=0;const xo=ln.get(X.key)??"n",bo=Math.abs(Fe)>ct?"h":"v";xo!=="n"&&xo!==bo&&(yo=50);const or=zt+Mt+St+yo,_e=(Pe.get(X.key)??1/0)+or,Io=Math.abs(Y.x-ut.x)+Math.abs(Y.y-ut.y);if(_e<(Pe.get(It)??1/0))if(an.set(It,X.pt),Pe.set(It,_e),ln.set(It,bo),!ke.has(It))ye.push({key:It,f:_e+Io,pt:ut}),ke.add(It);else{const Jt=ye.findIndex(sr=>sr.key===It);Jt!==-1&&(ye[Jt].f=_e+Io)}}}if(Dt.length===0&&(Dt=[$,{x:$.x,y:Y.y},Y]),Dt.length>4){const X=Dt[0],z=Dt[Dt.length-1];let K=Math.min(X.x,z.x),lt=Math.max(X.x,z.x),Ct=Math.min(X.y,z.y),bt=Math.max(X.y,z.y);for(const Pt of Dt)K=Math.min(K,Pt.x),lt=Math.max(lt,Pt.x),Ct=Math.min(Ct,Pt.y),bt=Math.max(bt,Pt.y);const Tt=lt>Math.max(X.x,z.x),Nt=K<Math.min(X.x,z.x);if(h){const Pt=Te;if(Tt){const Gt=Math.max(X.x,z.x),Ot=Math.min(X.y,z.y),It=Math.max(X.y,z.y),zt=y.filter(Mt=>Mt.minX<Gt&&Mt.maxX>Gt&&Mt.minY<It&&Mt.maxY>Ot);if(zt.length>0){let Mt=Math.max(X.x,z.x);for(const St of zt){const Wt=(St.minX+St.maxX)/2;if(St.visualXHalfExtent===void 0||isNaN(St.visualXHalfExtent))continue;const Le=Wt+St.visualXHalfExtent+Pt;Mt=Math.max(Mt,Le)}isNaN(Mt)||(lt=Mt)}}if(Nt){const Gt=y.filter(Ot=>Ot.minX<Math.min(X.x,z.x)+Pt&&Ot.minY<Math.max(X.y,z.y)&&Ot.maxY>Math.min(X.y,z.y));if(Gt.length>0){let Ot=Math.min(X.x,z.x);for(const It of Gt){const Mt=(It.minX+It.maxX)/2-It.visualXHalfExtent-Pt;Ot=Math.min(Ot,Mt)}K=Ot}}}const ut=l(Pt=>{const Gt=z.y>X.y,Ot=y.filter(Mt=>{const St=Math.min(X.x,z.x)<Mt.maxX&&Math.max(X.x,z.x)>Mt.minX,Wt=Math.min(X.y,z.y)<Mt.maxY&&Math.max(X.y,z.y)>Mt.minY;return St&&Wt});let It=Ot;if(h&&Ot.length>0){const Mt=Ot.filter(St=>St.minX<Pt&&St.maxX>Pt);Mt.length>0&&(It=Mt)}if(It.length===0)return z.y;const zt=xe;if(Gt){const St=Math.max(...It.map(Wt=>Wt.maxY))+zt;if(St<z.y-ct)return St}else{const St=Math.min(...It.map(Wt=>Wt.minY))-zt;if(St>z.y+ct)return St}return z.y},"findBestReturnY"),Yt=l(Pt=>{const Gt=ut(Pt),Ot={x:Pt,y:X.y},It={x:Pt,y:Gt},zt={x:z.x,y:Gt},Mt=he(X,Ot),St=he(Ot,It),Wt=he(It,zt),Le=Gt!==z.y?he(zt,z):!1;return!Mt&&!St&&!Wt&&!Le?Math.abs(Gt-z.y)<ct?[X,Ot,It,z]:[X,Ot,It,zt,z]:null},"trySimplifyWithDetourX"),ee=Tt&&!Nt?Yt(lt):Nt&&!Tt?Yt(K):null;ee&&(Dt=ee)}const Xt=[w,...yt,...Dt,...Ht.reverse(),P];if(Xt.length>=3){const X=Xt[Xt.length-1],z=Xt[Xt.length-2],K=Xt[Xt.length-3],lt=Math.abs(K.y-z.y)<ct&&Math.abs(z.y-X.y)<ct,Ct=Math.abs(K.x-z.x)<ct&&Math.abs(z.x-X.x)<ct;if(lt){const bt=Math.sign(z.x-K.x),Tt=Math.sign(X.x-K.x);bt!==0&&bt===Tt&&Math.abs(z.x-K.x)>Math.abs(X.x-K.x)&&Xt.splice(-2,1)}else if(Ct){const bt=Math.sign(z.y-K.y),Tt=Math.sign(X.y-K.y);bt!==0&&bt===Tt&&Math.abs(z.y-K.y)>Math.abs(X.y-K.y)&&Xt.splice(-2,1)}}const re=[Xt[0]];for(let X=1;X<Xt.length-1;X++){if(X===1){re.push(Xt[X]);continue}const z=re[re.length-1],K=Xt[X],lt=Xt[X+1];if(Math.abs(z.y-K.y)<ct&&Math.abs(K.y-lt.y)<ct){const Ct=K.x>z.x,bt=lt.x>K.x;if(Ct!==bt){re.push(K);continue}continue}if(Math.abs(z.x-K.x)<ct&&Math.abs(K.x-lt.x)<ct){const Ct=K.y>z.y,bt=lt.y>K.y;if(Ct!==bt){re.push(K);continue}continue}re.push(K)}re.push(Xt[Xt.length-1]);for(let X=0;X<re.length-1;X++){const z=re[X],K=re[X+1],lt=Math.abs(z.x-K.x)<ct?"vertical":"horizontal",Ct=lt==="vertical"?z.x:z.y,bt=lt==="vertical"?Math.min(z.y,K.y):Math.min(z.x,K.x),Tt=lt==="vertical"?Math.max(z.y,K.y):Math.max(z.x,K.x),Nt=g(lt,Ct,bt,Tt),ut={edgeIndex:a,segmentIndex:X,orientation:lt,pipe:Nt,trackIndex:0,from:bt,to:Tt};u.push(ut),i[a].push(u.length-1),Nt.tracks[0]||(Nt.tracks[0]={index:0,coord:Nt.coord,segments:[]}),Nt.tracks[0].segments.push({edgeIndex:a,segmentIndex:X,from:bt,to:Tt})}}const W=l((a,b)=>a.from<b.to&&b.from<a.to,"segmentsOverlap"),et=l((a,b,S,v)=>{const w=!v.segments.some(U=>(U.edgeIndex!==b.edgeIndex||U.segmentIndex!==b.segmentIndex)&&W(U,a)),P=!S.segments.some(U=>(U.edgeIndex!==a.edgeIndex||U.segmentIndex!==a.segmentIndex)&&W(U,b));return w&&P?(a.trackIndex=v.index,b.trackIndex=S.index,S.segments=[...S.segments.filter(U=>U.edgeIndex!==a.edgeIndex||U.segmentIndex!==a.segmentIndex),{edgeIndex:b.edgeIndex,segmentIndex:b.segmentIndex,from:b.from,to:b.to}],v.segments=[...v.segments.filter(U=>U.edgeIndex!==b.edgeIndex||U.segmentIndex!==b.segmentIndex),{edgeIndex:a.edgeIndex,segmentIndex:a.segmentIndex,from:a.from,to:a.to}],!0):!1},"trySwapSegmentsAcrossTracks"),at=l(a=>{const b=a.tracks.length;return a.tracks[b]={index:b,coord:a.coord,segments:[]},b},"createNewTrack"),gt=l((a,b)=>{const S=a.pipe.tracks[a.trackIndex];S.segments=S.segments.filter(w=>w.edgeIndex!==a.edgeIndex||w.segmentIndex!==a.segmentIndex),a.trackIndex=b,a.pipe.tracks[b].segments.push({edgeIndex:a.edgeIndex,segmentIndex:a.segmentIndex,from:a.from,to:a.to})},"moveSegmentToTrack"),xt=l((a,b)=>{const S=i[a.edgeIndex];for(const v of S){const w=u[v];w.pipe===a.pipe&>(w,b)}},"moveSegmentChainToTrack"),vt=l(a=>{const b=i[a.edgeIndex],S=b.indexOf(u.indexOf(a)),v=[];return S>0&&v.push(u[b[S-1]]),S<b.length-1&&v.push(u[b[S+1]]),v},"getAdjacentSegmentsAlongEdge"),Vt=l((a,b)=>{if(a.orientation===b.orientation)return!1;const S=a.orientation==="horizontal"?a:b,v=a.orientation==="horizontal"?b:a;return v.pipe.coord>S.from&&v.pipe.coord<S.to&&S.pipe.coord>v.from&&S.pipe.coord<v.to},"haveAnyCrossing"),jt=l((a,b)=>{for(const S of a.tracks)if(!S.segments.some(w=>(w.edgeIndex!==b.edgeIndex||w.segmentIndex!==b.segmentIndex)&&W(w,b)))return S.index;return-1},"findAvailableTrack"),Ut=l((a,b)=>{if(a.trackIndex===b.trackIndex)return W(a,b);const S=vt(a),v=vt(b);return S.some(w=>v.some(P=>Vt(w,P)))},"segmentsConflict"),te=l((a,b,S)=>{if(et(a,b,a.pipe.tracks[a.trackIndex],b.pipe.tracks[b.trackIndex]))return;const v=jt(a.pipe,b);S(b,v!==-1?v:at(a.pipe))},"resolveTrackConflict"),Me=l(a=>{let b=0;for(let S=0;S<a.length;S++)for(let v=S+1;v<a.length;v++){const w=a[S],P=a[v];w.pipe===P.pipe&&Ut(w,P)&&(b++,te(w,P,xt))}return b},"resolveHandleConflicts"),fe=new Map,Se=l(a=>{if(fe.has(a))return fe.get(a);const b=i[a];if(b.length===0){const q={dest:0,deviation:0,base:0,delta:0};return fe.set(a,q),q}const v=u[b[0]].pipe.coord;let w=v;for(let q=1;q<b.length;q++){const $=u[b[q]];if($.orientation==="horizontal"){const Y=$.from,ot=$.to;w=Math.abs(Y-v)>Math.abs(ot-v)?Y:ot;break}}const P=Math.abs(w-v),U={dest:w,deviation:P,base:v,delta:w-v};return fe.set(a,U),U},"getDestInfo"),on=l(()=>{let a=0;const b=new Map;for(const[v,w]of s.entries())i[v].length!==0&&w.start&&(b.has(w.start)||b.set(w.start,[]),b.get(w.start).push(v));const S=l(v=>{const w=s[v];if(!w.start||!w.end)return 0;const P=r.get(w.start),U=r.get(w.end);if(!P||!U)return 0;const q=(U.x??0)-(P.x??0),$=(U.y??0)-(P.y??0);return Math.abs(q)+Math.abs($)},"getEdgeDistance");for(const v of b.values()){v.sort((P,U)=>{const q=Se(P),$=Se(U);if(Math.abs(q.deviation-$.deviation)>1)return q.deviation-$.deviation;if(Math.abs(q.dest-$.dest)>1)return q.dest-$.dest;const Y=S(P),ot=S(U);if(Math.abs(Y-ot)>1)return ot-Y;const rt=i[P].length,st=i[U].length;if(rt!==st)return rt-st;if(rt===1){const tt=i[P][0],yt=i[U][0];if(u[tt]&&u[yt]){const Rt=u[tt],Lt=u[yt],Ht=Math.abs(Rt.to-Rt.from),Zt=Math.abs(Lt.to-Lt.from);if(Math.abs(Ht-Zt)>1)return Ht-Zt}}return 0});const w=v.map(P=>u[i[P][0]]);a+=Me(w)}return a},"fixSourceHandleCrossings"),sn=l(()=>{let a=0;const b=new Map;for(const[S,v]of s.entries())i[S].length!==0&&v.end&&(b.has(v.end)||b.set(v.end,[]),b.get(v.end).push(S));for(const S of b.values()){S.sort((w,P)=>{const U=l(Y=>{const ot=i[Y];if(ot.length<2)return 0;const rt=u[ot[ot.length-2]];return Math.abs(rt.to-rt.from)},"getDist"),q=U(w),$=U(P);return Math.abs(q-$)>.1?q-$:w-P});const v=S.map(w=>u[i[w][i[w].length-1]]);a+=Me(v)}return a},"fixTargetHandleCrossings"),rn=l(()=>{let a=0;for(const b of c){const S=[];for(const v of b.tracks)for(const w of v.segments){const P=i[w.edgeIndex].find(U=>u[U].segmentIndex===w.segmentIndex);P!==void 0&&S.push(u[P])}S.sort((v,w)=>v.edgeIndex-w.edgeIndex||v.segmentIndex-w.segmentIndex);for(let v=0;v<S.length;v++)for(let w=v+1;w<S.length;w++){const P=S[v],U=S[w];Ut(P,U)&&(a++,te(P,U,gt))}}return a},"fixPipeCrossings");let N=0;const _=10;for(;N<_;){let a=0;if(a+=on(),a+=sn(),a+=rn(),a===0)break;N++}const H=new Map;for(const a of c){const b=[];a.tracks.forEach(v=>{v.segments.forEach(w=>{b.push({edgeIndex:w.edgeIndex,segmentIndex:w.segmentIndex,trackIndex:v.index,from:w.from,to:w.to})})}),b.sort((v,w)=>v.from-w.from);const S=[];if(b.length>0){let v=[b[0]],w=b[0].to;for(let P=1;P<b.length;P++){const U=b[P];U.from<w?(v.push(U),w=Math.max(w,U.to)):(S.push(v),v=[U],w=U.to)}S.push(v)}for(const v of S){const w=new Set;v.forEach(tt=>w.add(tt.trackIndex));const P=new Map;v.forEach(tt=>{const yt=Se(tt.edgeIndex);P.set(tt.trackIndex,(P.get(tt.trackIndex)??0)+yt.delta)});const U=[...w].filter(tt=>(P.get(tt)??0)<-1),q=[...w].filter(tt=>(P.get(tt)??0)>1),$=[...w].filter(tt=>Math.abs(P.get(tt)??0)<=1);U.sort((tt,yt)=>(P.get(yt)??0)-(P.get(tt)??0)),q.sort((tt,yt)=>(P.get(tt)??0)-(P.get(yt)??0));const Y=l((tt,yt)=>{v.filter(Rt=>Rt.trackIndex===tt).forEach(Rt=>{const Lt=x.has(Rt.edgeIndex)?a.coord:yt;H.set(`${Rt.edgeIndex}-${Rt.segmentIndex}`,Lt)})},"assignCoord");let ot=0;for(const tt of U)ot++,Y(tt,a.coord-ot*pn);if($.length===0&&w.size>0){const tt=[...w].sort((Lt,Ht)=>Math.abs(P.get(Lt)??0)-Math.abs(P.get(Ht)??0))[0],yt=U.indexOf(tt);yt!==-1&&U.splice(yt,1);const Rt=q.indexOf(tt);Rt!==-1&&q.splice(Rt,1),$.push(tt)}let rt=0;for(const tt of $){if(rt===0)Y(tt,a.coord);else{const yt=rt%2===1?1:-1,Rt=Math.ceil(rt/2);Y(tt,a.coord+yt*Rt*pn*.5)}rt++}let st=0;for(const tt of q)st++,Y(tt,a.coord+st*pn)}}for(const[a,b]of s.entries()){const S=i[a]??[];if(S.length===0)continue;const v=[],w=r.get(b.start),P=r.get(b.end),{pSrcPort:U,pDstPort:q}=Q(a,w,P),$=S.map(rt=>{const st=u[rt],tt=H.get(`${st.edgeIndex}-${st.segmentIndex}`)??st.pipe.coord;return{orient:st.orientation,coord:tt,from:st.from,to:st.to}});v.push(U);for(let rt=0;rt<$.length;rt++){const st=$[rt],tt=v[v.length-1],yt=st.orient==="vertical"?tt.y:tt.x,Rt=st.orient==="vertical"?tt.x:tt.y,Lt=$[rt+1],Ht=rt<$.length-1;if(Math.abs(Rt-st.coord)>ct&&v.push(be(st,yt)),Ht&&Lt.orient===st.orient)if(Math.abs(st.coord-Lt.coord)>ct){const Zt=st.orient==="vertical"?(yt+Lt.from)/2:Kn(st,Lt);v.push(be(st,Zt),be(Lt,Zt))}else(rt===0||rt===$.length-2)&&v.push(be(st,Kn(st,Lt)));else if(Ht)v.push(be(st,Lt.coord));else{const Zt=Math.abs(st.from-yt)<Math.abs(st.to-yt)?st.to:st.from;v.push(be(st,Zt))}}const Y=v[v.length-1];(Math.abs(Y.x-q.x)>ct||Math.abs(Y.y-q.y)>ct)&&v.push(q);const ot=[];v.length>0&&ot.push(v[0]);for(let rt=1;rt<v.length;rt++){const st=v[rt],tt=ot[ot.length-1];(Math.abs(st.x-tt.x)>ct||Math.abs(st.y-tt.y)>ct)&&ot.push(st)}b.points=ot}for(const a of s){const b=a.__originalEdge;b&&a.points&&(b.points=a.points)}t.edges=(t.edges??[]).filter(a=>!a.isLayoutOnly);const V=l((a,b)=>{const S=b.x??0,v=b.y??0,w=b.width??0,P=b.height??0;if(w<=0||P<=0)return a;const U=S-w/2,q=S+w/2,$=v-P/2,Y=v+P/2;if(a.x<U||a.x>q||a.y<$||a.y>Y)return a;const ot=a.x-U,rt=q-a.x,st=a.y-$,tt=Y-a.y,yt=Math.min(ot,rt,st,tt);return yt===ot?{x:U,y:a.y}:yt===rt?{x:q,y:a.y}:yt===st?{x:a.x,y:$}:{x:a.x,y:Y}},"nodeBoundaryClamp");for(const a of t.edges){const b=a.points;if(!b||b.length<2)continue;const S=a.start,v=a.end,w=S?r.get(S):void 0,P=v?r.get(v):void 0;w&&(b[0]=V(b[0],w)),P&&(b[b.length-1]=V(b[b.length-1],P))}return t}l(Vs,"routeEdgesOrthogonal");function js(t){return t.direction??"TB"}l(js,"getSwimlaneDirection");function Us(t){const e=Ao(t),n=t.config.flowchart?.nodeSpacing??40,o=t.config.flowchart?.rankSpacing??100,s=t.config.swimlane?.ignoreCrossLaneEdges??!0,r=t.config.swimlane?.optimizeRanksByCrossings??!0,f=t.config.swimlane?.automaticLaneOrdering??!1,c=js(t),{ordered:h,coordinates:m}=$s(e,{nodeGap:n,layerGap:o,ignoreCrossLaneEdges:s,optimizeRanksByCrossings:r,automaticLaneOrdering:f,direction:c});Ro(e,h,m,{nodeGap:n,layerGap:o});for(const y of t.edges??[])delete y.points;Vs(t,c);for(const y of t.edges??[])(!y.curve||y.curve==="basis")&&(y.curve="rounded");return as(t,c),cs(t),c}l(Us,"runSwimlaneLayoutCore");function Ws(t){Eo(t);const e=No(t);t.nodes=e.nodes,t.edges=e.edges}l(Ws,"prepareSwimlaneLayout");var Cr=ir({prepareLayout:Ws,runLayoutCore:Us,afterPaint:To});export{Cr as render};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import{c as r,s as e}from"./flowDiagram-IUGLLWBU-CWsiqTQC.js";import{_ as a}from"./mermaid-C_q9pug0.js";import"./chunk-5VM5RSS4-Diy5h2LS.js";import"./chunk-XXDRQBXY-CW8CjB1w.js";import"./chunk-VQ5W62QI-BM7ZZo1I.js";import"./chunk-55XCU76K-BINcFiLN.js";import"./markdown-DVehI1Sg.js";var o=a(t=>`${e(t)}
|
|
2
|
-
.swimlane.cluster:not([data-color-id]) rect {
|
|
3
|
-
stroke: ${t.clusterBorder} !important;
|
|
4
|
-
}
|
|
5
|
-
[data-look="neo"].cluster rect {
|
|
6
|
-
filter: none;
|
|
7
|
-
}
|
|
8
|
-
`,"getStyles"),s=o,f=r({styles:s});export{f as diagram};
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
import{_ as o,L as pt,E as nt,B as Rt,a8 as Wt,a9 as Pt,aa as Bt,c as ft,l as E,Q as Vt,R as Ft,ab as yt,k as X,S as ct,K as zt,ac as Ot,z as Gt}from"./mermaid-C_q9pug0.js";import"./markdown-DVehI1Sg.js";var tt=(function(){var e=o(function(k,a,d,l){for(d=d||{},l=k.length;l--;d[k[l]]=a);return d},"o"),t=[6,11,13,14,15,17,19,20,23,24],s=[1,12],r=[1,13],n=[1,14],h=[1,15],c=[1,16],i=[1,19],y=[1,20],p={trace:o(function(){},"trace"),yy:{},symbols_:{error:2,start:3,timeline_header:4,document:5,EOF:6,timeline:7,timeline_lr:8,timeline_td:9,line:10,SPACE:11,statement:12,NEWLINE:13,title:14,acc_title:15,acc_title_value:16,acc_descr:17,acc_descr_value:18,acc_descr_multiline_value:19,section:20,period_statement:21,event_statement:22,period:23,event:24,$accept:0,$end:1},terminals_:{2:"error",6:"EOF",7:"timeline",8:"timeline_lr",9:"timeline_td",11:"SPACE",13:"NEWLINE",14:"title",15:"acc_title",16:"acc_title_value",17:"acc_descr",18:"acc_descr_value",19:"acc_descr_multiline_value",20:"section",23:"period",24:"event"},productions_:[0,[3,3],[4,1],[4,1],[4,1],[5,0],[5,2],[10,2],[10,1],[10,1],[10,1],[12,1],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[21,1],[22,1]],performAction:o(function(a,d,l,g,x,u,S){var v=u.length-1;switch(x){case 1:return u[v-1];case 3:g.setDirection("LR");break;case 4:g.setDirection("TD");break;case 5:this.$=[];break;case 6:u[v-1].push(u[v]),this.$=u[v-1];break;case 7:case 8:this.$=u[v];break;case 9:case 10:this.$=[];break;case 11:g.getCommonDb().setDiagramTitle(u[v].substr(6)),this.$=u[v].substr(6);break;case 12:this.$=u[v].trim(),g.getCommonDb().setAccTitle(this.$);break;case 13:case 14:this.$=u[v].trim(),g.getCommonDb().setAccDescription(this.$);break;case 15:g.addSection(u[v].substr(8)),this.$=u[v].substr(8);break;case 18:g.addTask(u[v],0,""),this.$=u[v];break;case 19:g.addEvent(u[v].substr(2)),this.$=u[v];break}},"anonymous"),table:[{3:1,4:2,7:[1,3],8:[1,4],9:[1,5]},{1:[3]},e(t,[2,5],{5:6}),e(t,[2,2]),e(t,[2,3]),e(t,[2,4]),{6:[1,7],10:8,11:[1,9],12:10,13:[1,11],14:s,15:r,17:n,19:h,20:c,21:17,22:18,23:i,24:y},e(t,[2,10],{1:[2,1]}),e(t,[2,6]),{12:21,14:s,15:r,17:n,19:h,20:c,21:17,22:18,23:i,24:y},e(t,[2,8]),e(t,[2,9]),e(t,[2,11]),{16:[1,22]},{18:[1,23]},e(t,[2,14]),e(t,[2,15]),e(t,[2,16]),e(t,[2,17]),e(t,[2,18]),e(t,[2,19]),e(t,[2,7]),e(t,[2,12]),e(t,[2,13])],defaultActions:{},parseError:o(function(a,d){if(d.recoverable)this.trace(a);else{var l=new Error(a);throw l.hash=d,l}},"parseError"),parse:o(function(a){var d=this,l=[0],g=[],x=[null],u=[],S=this.table,v="",I=0,C=0,W=2,O=1,L=u.slice.call(arguments,1),w=Object.create(this.lexer),H={yy:{}};for(var V in this.yy)Object.prototype.hasOwnProperty.call(this.yy,V)&&(H.yy[V]=this.yy[V]);w.setInput(a,H.yy),H.yy.lexer=w,H.yy.parser=this,typeof w.yylloc>"u"&&(w.yylloc={});var F=w.yylloc;u.push(F);var U=w.options&&w.options.ranges;typeof H.yy.parseError=="function"?this.parseError=H.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function N(A){l.length=l.length-2*A,x.length=x.length-A,u.length=u.length-A}o(N,"popStack");function b(){var A;return A=g.pop()||w.lex()||O,typeof A!="number"&&(A instanceof Array&&(g=A,A=g.pop()),A=d.symbols_[A]||A),A}o(b,"lex");for(var _,$,T,P,R={},G,B,Z,j;;){if($=l[l.length-1],this.defaultActions[$]?T=this.defaultActions[$]:((_===null||typeof _>"u")&&(_=b()),T=S[$]&&S[$][_]),typeof T>"u"||!T.length||!T[0]){var Y="";j=[];for(G in S[$])this.terminals_[G]&&G>W&&j.push("'"+this.terminals_[G]+"'");w.showPosition?Y="Parse error on line "+(I+1)+`:
|
|
2
|
-
`+w.showPosition()+`
|
|
3
|
-
Expecting `+j.join(", ")+", got '"+(this.terminals_[_]||_)+"'":Y="Parse error on line "+(I+1)+": Unexpected "+(_==O?"end of input":"'"+(this.terminals_[_]||_)+"'"),this.parseError(Y,{text:w.match,token:this.terminals_[_]||_,line:w.yylineno,loc:F,expected:j})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+$+", token: "+_);switch(T[0]){case 1:l.push(_),x.push(w.yytext),u.push(w.yylloc),l.push(T[1]),_=null,C=w.yyleng,v=w.yytext,I=w.yylineno,F=w.yylloc;break;case 2:if(B=this.productions_[T[1]][1],R.$=x[x.length-B],R._$={first_line:u[u.length-(B||1)].first_line,last_line:u[u.length-1].last_line,first_column:u[u.length-(B||1)].first_column,last_column:u[u.length-1].last_column},U&&(R._$.range=[u[u.length-(B||1)].range[0],u[u.length-1].range[1]]),P=this.performAction.apply(R,[v,C,I,H.yy,T[1],x,u].concat(L)),typeof P<"u")return P;B&&(l=l.slice(0,-1*B*2),x=x.slice(0,-1*B),u=u.slice(0,-1*B)),l.push(this.productions_[T[1]][0]),x.push(R.$),u.push(R._$),Z=S[l[l.length-2]][l[l.length-1]],l.push(Z);break;case 3:return!0}}return!0},"parse")},m=(function(){var k={EOF:1,parseError:o(function(d,l){if(this.yy.parser)this.yy.parser.parseError(d,l);else throw new Error(d)},"parseError"),setInput:o(function(a,d){return this.yy=d||this.yy||{},this._input=a,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:o(function(){var a=this._input[0];this.yytext+=a,this.yyleng++,this.offset++,this.match+=a,this.matched+=a;var d=a.match(/(?:\r\n?|\n).*/g);return d?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),a},"input"),unput:o(function(a){var d=a.length,l=a.split(/(?:\r\n?|\n)/g);this._input=a+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-d),this.offset-=d;var g=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),l.length-1&&(this.yylineno-=l.length-1);var x=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:l?(l.length===g.length?this.yylloc.first_column:0)+g[g.length-l.length].length-l[0].length:this.yylloc.first_column-d},this.options.ranges&&(this.yylloc.range=[x[0],x[0]+this.yyleng-d]),this.yyleng=this.yytext.length,this},"unput"),more:o(function(){return this._more=!0,this},"more"),reject:o(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
|
-
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:o(function(a){this.unput(this.match.slice(a))},"less"),pastInput:o(function(){var a=this.matched.substr(0,this.matched.length-this.match.length);return(a.length>20?"...":"")+a.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:o(function(){var a=this.match;return a.length<20&&(a+=this._input.substr(0,20-a.length)),(a.substr(0,20)+(a.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:o(function(){var a=this.pastInput(),d=new Array(a.length+1).join("-");return a+this.upcomingInput()+`
|
|
5
|
-
`+d+"^"},"showPosition"),test_match:o(function(a,d){var l,g,x;if(this.options.backtrack_lexer&&(x={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(x.yylloc.range=this.yylloc.range.slice(0))),g=a[0].match(/(?:\r\n?|\n).*/g),g&&(this.yylineno+=g.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:g?g[g.length-1].length-g[g.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+a[0].length},this.yytext+=a[0],this.match+=a[0],this.matches=a,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(a[0].length),this.matched+=a[0],l=this.performAction.call(this,this.yy,this,d,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),l)return l;if(this._backtrack){for(var u in x)this[u]=x[u];return!1}return!1},"test_match"),next:o(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var a,d,l,g;this._more||(this.yytext="",this.match="");for(var x=this._currentRules(),u=0;u<x.length;u++)if(l=this._input.match(this.rules[x[u]]),l&&(!d||l[0].length>d[0].length)){if(d=l,g=u,this.options.backtrack_lexer){if(a=this.test_match(l,x[u]),a!==!1)return a;if(this._backtrack){d=!1;continue}else return!1}else if(!this.options.flex)break}return d?(a=this.test_match(d,x[g]),a!==!1?a:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
|
|
6
|
-
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:o(function(){var d=this.next();return d||this.lex()},"lex"),begin:o(function(d){this.conditionStack.push(d)},"begin"),popState:o(function(){var d=this.conditionStack.length-1;return d>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:o(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:o(function(d){return d=this.conditionStack.length-1-Math.abs(d||0),d>=0?this.conditionStack[d]:"INITIAL"},"topState"),pushState:o(function(d){this.begin(d)},"pushState"),stateStackSize:o(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:o(function(d,l,g,x){switch(g){case 0:break;case 1:break;case 2:return 13;case 3:break;case 4:break;case 5:return 8;case 6:return 9;case 7:return 7;case 8:return 14;case 9:return this.begin("acc_title"),15;case 10:return this.popState(),"acc_title_value";case 11:return this.begin("acc_descr"),17;case 12:return this.popState(),"acc_descr_value";case 13:this.begin("acc_descr_multiline");break;case 14:this.popState();break;case 15:return"acc_descr_multiline_value";case 16:return 20;case 17:return 24;case 18:return 23;case 19:return 6;case 20:return"INVALID"}},"anonymous"),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:timeline[ \t]+LR\b)/i,/^(?:timeline[ \t]+TD\b)/i,/^(?:timeline\b)/i,/^(?:title\s[^\n]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^:\n]+)/i,/^(?::\s(?:[^:\n]|:(?!\s))+)/i,/^(?:[^#:\n]+)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[14,15],inclusive:!1},acc_descr:{rules:[12],inclusive:!1},acc_title:{rules:[10],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,11,13,16,17,18,19,20],inclusive:!0}}};return k})();p.lexer=m;function f(){this.yy={}}return o(f,"Parser"),f.prototype=p,p.Parser=f,new f})();tt.parser=tt;var Dt=tt,mt={};zt(mt,{addEvent:()=>$t,addSection:()=>wt,addTask:()=>Tt,addTaskOrg:()=>Nt,clear:()=>vt,default:()=>Kt,getCommonDb:()=>kt,getDirection:()=>_t,getSections:()=>St,getTasks:()=>Et,setDirection:()=>bt});var D="",xt=0,rt="LR",st=[],q=[],K=[],kt=o(()=>Ot,"getCommonDb"),vt=o(function(){st.length=0,q.length=0,D="",K.length=0,rt="LR",Gt()},"clear"),bt=o(function(e){rt=e},"setDirection"),_t=o(function(){return rt},"getDirection"),wt=o(function(e){D=e,st.push(e)},"addSection"),St=o(function(){return st},"getSections"),Et=o(function(){let e=lt();const t=100;let s=0;for(;!e&&s<t;)e=lt(),s++;return q.push(...K),q},"getTasks"),Tt=o(function(e,t,s){const r={id:xt++,section:D,type:D,task:e,score:t||0,events:s?[s]:[]};K.push(r)},"addTask"),$t=o(function(e){K.find(s=>s.id===xt-1).events.push(e)},"addEvent"),Nt=o(function(e){const t={section:D,type:D,description:e,task:e,classes:[]};q.push(t)},"addTaskOrg"),lt=o(function(){const e=o(function(s){return K[s].processed},"compileTask");let t=!0;for(const[s,r]of K.entries())e(s),t=t&&r.processed;return t},"compileTasks"),Kt={clear:vt,getCommonDb:kt,getDirection:_t,setDirection:bt,addSection:wt,getSections:St,getTasks:Et,addTask:Tt,addTaskOrg:Nt,addEvent:$t},It=0,Q=o(function(e,t){const s=e.append("rect");return s.attr("x",t.x),s.attr("y",t.y),s.attr("fill",t.fill),s.attr("stroke",t.stroke),s.attr("width",t.width),s.attr("height",t.height),s.attr("rx",t.rx),s.attr("ry",t.ry),t.class!==void 0&&s.attr("class",t.class),s},"drawRect"),Ut=o(function(e,t){const r=e.append("circle").attr("cx",t.cx).attr("cy",t.cy).attr("class","face").attr("r",15).attr("stroke-width",2).attr("overflow","visible"),n=e.append("g");n.append("circle").attr("cx",t.cx-15/3).attr("cy",t.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),n.append("circle").attr("cx",t.cx+15/3).attr("cy",t.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666");function h(y){const p=ct().startAngle(Math.PI/2).endAngle(3*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);y.append("path").attr("class","mouth").attr("d",p).attr("transform","translate("+t.cx+","+(t.cy+2)+")")}o(h,"smile");function c(y){const p=ct().startAngle(3*Math.PI/2).endAngle(5*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);y.append("path").attr("class","mouth").attr("d",p).attr("transform","translate("+t.cx+","+(t.cy+7)+")")}o(c,"sad");function i(y){y.append("line").attr("class","mouth").attr("stroke",2).attr("x1",t.cx-5).attr("y1",t.cy+7).attr("x2",t.cx+5).attr("y2",t.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}return o(i,"ambivalent"),t.score>3?h(n):t.score<3?c(n):i(n),r},"drawFace"),Xt=o(function(e,t){const s=e.append("circle");return s.attr("cx",t.cx),s.attr("cy",t.cy),s.attr("class","actor-"+t.pos),s.attr("fill",t.fill),s.attr("stroke",t.stroke),s.attr("r",t.r),s.class!==void 0&&s.attr("class",s.class),t.title!==void 0&&s.append("title").text(t.title),s},"drawCircle"),Ht=o(function(e,t){const s=t.text.replace(/<br\s*\/?>/gi," "),r=e.append("text");r.attr("x",t.x),r.attr("y",t.y),r.attr("class","legend"),r.style("text-anchor",t.anchor),t.class!==void 0&&r.attr("class",t.class);const n=r.append("tspan");return n.attr("x",t.x+t.textMargin*2),n.text(s),r},"drawText"),Zt=o(function(e,t){function s(n,h,c,i,y){return n+","+h+" "+(n+c)+","+h+" "+(n+c)+","+(h+i-y)+" "+(n+c-y*1.2)+","+(h+i)+" "+n+","+(h+i)}o(s,"genPoints");const r=e.append("polygon");r.attr("points",s(t.x,t.y,50,20,7)),r.attr("class","labelBox"),t.y=t.y+t.labelMargin,t.x=t.x+.5*t.labelMargin,Ht(e,t)},"drawLabel"),jt=o(function(e,t,s){const r=e.append("g"),n=it();n.x=t.x,n.y=t.y,n.fill=t.fill,n.width=s.width,n.height=s.height,n.class="journey-section section-type-"+t.num,n.rx=3,n.ry=3,Q(r,n),Lt(s)(t.text,r,n.x,n.y,n.width,n.height,{class:"journey-section section-type-"+t.num},s,t.colour)},"drawSection"),et=-1,qt=o(function(e,t,s,r){const n=t.x+s.width/2,h=e.append("g");et++,h.append("line").attr("id",r+"-task"+et).attr("x1",n).attr("y1",t.y).attr("x2",n).attr("y2",450).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),Ut(h,{cx:n,cy:300+(5-t.score)*30,score:t.score});const i=it();i.x=t.x,i.y=t.y,i.fill=t.fill,i.width=s.width,i.height=s.height,i.class="task task-type-"+t.num,i.rx=3,i.ry=3,Q(h,i),Lt(s)(t.task,h,i.x,i.y,i.width,i.height,{class:"task"},s,t.colour)},"drawTask"),Qt=o(function(e,t){Q(e,{x:t.startx,y:t.starty,width:t.stopx-t.startx,height:t.stopy-t.starty,fill:t.fill,class:"rect"}).lower()},"drawBackgroundRect"),Jt=o(function(){return{x:0,y:0,fill:void 0,"text-anchor":"start",width:100,height:100,textMargin:0,rx:0,ry:0}},"getTextObj"),it=o(function(){return{x:0,y:0,width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),Lt=(function(){function e(n,h,c,i,y,p,m,f){const k=h.append("text").attr("x",c+y/2).attr("y",i+p/2+5).style("font-color",f).style("text-anchor","middle").text(n);r(k,m)}o(e,"byText");function t(n,h,c,i,y,p,m,f,k){const{taskFontSize:a,taskFontFamily:d}=f,l=n.split(/<br\s*\/?>/gi);for(let g=0;g<l.length;g++){const x=g*a-a*(l.length-1)/2,u=h.append("text").attr("x",c+y/2).attr("y",i).attr("fill",k).style("text-anchor","middle").style("font-size",a).style("font-family",d);u.append("tspan").attr("x",c+y/2).attr("dy",x).text(l[g]),u.attr("y",i+p/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),r(u,m)}}o(t,"byTspan");function s(n,h,c,i,y,p,m,f){const k=h.append("switch"),d=k.append("foreignObject").attr("x",c).attr("y",i).attr("width",y).attr("height",p).attr("position","fixed").append("xhtml:div").style("display","table").style("height","100%").style("width","100%");d.append("div").attr("class","label").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(n),t(n,k,c,i,y,p,m,f),r(d,m)}o(s,"byFo");function r(n,h){for(const c in h)c in h&&n.attr(c,h[c])}return o(r,"_setTextAttrs"),function(n){return n.textPlacement==="fo"?s:n.textPlacement==="old"?e:t}})(),Yt=o(function(e,t){It=0,et=-1,e.append("defs").append("marker").attr("id",t+"-arrowhead").attr("refX",5).attr("refY",2).attr("markerWidth",6).attr("markerHeight",4).attr("orient","auto").append("path").attr("d","M 0,0 V 4 L6,2 Z")},"initGraphics");function at(e,t){e.each(function(){var s=X(this),r=s.text().split(/(\s+|<br>)/).reverse(),n,h=[],c=1.1,i=s.attr("y"),y=parseFloat(s.attr("dy")),p=s.text(null).append("tspan").attr("x",0).attr("y",i).attr("dy",y+"em");for(let m=0;m<r.length;m++)n=r[r.length-1-m],h.push(n),p.text(h.join(" ").trim()),(p.node().getComputedTextLength()>t||n==="<br>")&&(h.pop(),p.text(h.join(" ").trim()),n==="<br>"?h=[""]:h=[n],p=s.append("tspan").attr("x",0).attr("y",i).attr("dy",c+"em").text(n))})}o(at,"wrap");var te=o(function(e,t,s,r,n,h=!1){const{theme:c,look:i}=r,y=c?.includes("redux"),p=r?.themeVariables?.THEME_COLOR_LIMIT??12,m=s%p-1,f=e.append("g");t.section=m,f.attr("class",(t.class?t.class+" ":"")+"timeline-node "+("section-"+m));const k=f.append("g"),a=f.append("g"),l=a.append("text").text(t.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(at,t.width).node().getBBox(),g=r.fontSize?.replace?r.fontSize.replace("px",""):r.fontSize;if(t.height=l.height+g*1.1*.5+t.padding,t.height=Math.max(t.height,t.maxHeight),t.width=t.width+2*t.padding,a.attr("transform","translate("+t.width/2+", "+t.padding/2+")"),y&&a.attr("transform",`translate(${t.width/2}, ${h?t.padding/2+3:t.padding})`),ne(k,t,m,n,r),i==="neo"&&(f.attr("data-look","neo"),y)){const x=c.includes("dark"),u=e.node()?.ownerSVGElement??e.node(),S=X(u),v=S.attr("id")??"",I=v?`${v}-drop-shadow`:"drop-shadow";if(S.select(`#${I}`).empty()){const C=S.select("defs");(C.empty()?S.append("defs"):C).append("filter").attr("id",I).attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity",x?"0.2":"0.06").attr("flood-color",x?"#FFFFFF":"#000000")}}return t},"drawNode"),ee=o(function(e,t,s){const r=e.append("g"),h=r.append("text").text(t.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(at,t.width).node().getBBox(),c=s.fontSize?.replace?s.fontSize.replace("px",""):s.fontSize;return r.remove(),h.height+c*1.1*.5+t.padding},"getVirtualNodeHeight"),ne=o(function(e,t,s,r,n){const{theme:h}=n,c=h?.includes("redux")?0:5,i=5,y=c>0?`M0 ${t.height-i} v${-t.height+2*i} q0,-${c},${c},-${c} h${t.width-2*i} q${c},0,${c},${c} v${t.height-i} H0 Z`:`M0 ${t.height-i} v${-(t.height-i)} h${t.width} v${t.height} H0 Z`;e.append("path").attr("id",r+"-node-"+It++).attr("class","node-bkg node-"+t.type).attr("d",y),h?.includes("redux")||e.append("line").attr("class","node-line-"+s).attr("x1",0).attr("y1",t.height).attr("x2",t.width).attr("y2",t.height)},"defaultBkg"),M={drawRect:Q,drawCircle:Xt,drawSection:jt,drawText:Ht,drawLabel:Zt,drawTask:qt,drawBackgroundRect:Qt,getTextObj:Jt,getNoteRect:it,initGraphics:Yt,drawNode:te,getVirtualNodeHeight:ee},re=o(function(e,t,s,r){const n=ft(),{look:h,theme:c,themeVariables:i}=n,{useGradient:y,gradientStart:p,gradientStop:m}=i,f=n.timeline?.leftMargin??50;E.debug("timeline",r.db);const k=n.securityLevel;let a;k==="sandbox"&&(a=X("#i"+t));const l=(k==="sandbox"?X(a.nodes()[0].contentDocument.body):X("body")).select("#"+t);l.append("g");const g=r.db.getTasks(),x=r.db.getCommonDb().getDiagramTitle();E.debug("task",g),M.initGraphics(l,t);const u=r.db.getSections();E.debug("sections",u);let S=0,v=0,I=0,C=0,W=50+f,O=50;C=50;let L=0,w=!0;u.forEach(function(N){const b={number:L,descr:N,section:L,width:150,padding:20,maxHeight:S},_=M.getVirtualNodeHeight(l,b,n);E.debug("sectionHeight before draw",_),S=Math.max(S,_+20)});let H=0,V=0;E.debug("tasks.length",g.length);for(const[N,b]of g.entries()){const _={number:N,descr:b,section:b.section,width:150,padding:20,maxHeight:v},$=M.getVirtualNodeHeight(l,_,n);E.debug("taskHeight before draw",$),v=Math.max(v,$+20),H=Math.max(H,b.events.length);let T=0;for(const P of b.events){const R={descr:P,section:b.section,number:b.section,width:150,padding:20,maxHeight:50};T+=M.getVirtualNodeHeight(l,R,n)}b.events.length>0&&(T+=(b.events.length-1)*10),V=Math.max(V,T)}E.debug("maxSectionHeight before draw",S),E.debug("maxTaskHeight before draw",v),u&&u.length>0?u.forEach(N=>{const b=g.filter(P=>P.section===N),_={number:L,descr:N,section:L,width:200*Math.max(b.length,1)-50,padding:20,maxHeight:S};E.debug("sectionNode",_);const $=l.append("g"),T=M.drawNode($,_,L,n,t);E.debug("sectionNode output",T),$.attr("transform",`translate(${W}, ${C})`),O+=S+50,b.length>0&&ht(l,b,L,W,O,v,n,H,V,S,!1,t),W+=200*Math.max(b.length,1),O=C,L++}):(w=!1,ht(l,g,L,W,O,v,n,H,V,S,!0,t));const F=l.node().getBBox();if(E.debug("bounds",F),x&&l.append("text").text(x).attr("x",h==="neo"?F.x*2+f:F.width/2-f).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),I=w?S+v+150:v+100,l.append("g").attr("class","lineWrapper").append("line").attr("x1",f).attr("y1",I).attr("x2",F.width+3*f).attr("y2",I).attr("stroke-width",4).attr("stroke","black").attr("marker-end",`url(#${t}-arrowhead)`),h==="neo"&&y&&c!=="neutral"){const N=l.select("defs"),_=(N.empty()?l.append("defs"):N).append("linearGradient").attr("id",l.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");_.append("stop").attr("offset","0%").attr("stop-color",p).attr("stop-opacity",1),_.append("stop").attr("offset","100%").attr("stop-color",m).attr("stop-opacity",1)}yt(void 0,l,n.timeline?.padding??50,n.timeline?.useMaxWidth??!1)},"draw"),ht=o(function(e,t,s,r,n,h,c,i,y,p,m,f){for(const k of t){const a={descr:k.task,section:s,number:s,width:150,padding:20,maxHeight:h};E.debug("taskNode",a);const d=e.append("g").attr("class","taskWrapper"),g=M.drawNode(d,a,s,c,f).height;if(E.debug("taskHeight after draw",g),d.attr("transform",`translate(${r}, ${n})`),h=Math.max(h,g),k.events){const x=e.append("g").attr("class","lineWrapper");let u=h;n+=100,u=u+se(e,k.events,s,r,n,c,f),n-=100,x.append("line").attr("x1",r+190/2).attr("y1",n+h).attr("x2",r+190/2).attr("y2",n+h+100+y+100).attr("stroke-width",2).attr("stroke","black").attr("marker-end",`url(#${f}-arrowhead)`).attr("stroke-dasharray","5,5")}r=r+200,m&&!c.timeline?.disableMulticolor&&s++}n=n-10},"drawTasks"),se=o(function(e,t,s,r,n,h,c){let i=0;const y=n;n=n+100;for(const p of t){const m={descr:p,section:s,number:s,width:150,padding:20,maxHeight:50};E.debug("eventNode",m);const f=e.append("g").attr("class","eventWrapper"),a=M.drawNode(f,m,s,h,c,!0).height;i=i+a,f.attr("transform",`translate(${r}, ${n})`),n=n+10+a}return n=y,i},"drawEvents"),ie={setConf:o(()=>{},"setConf"),draw:re},J=200,z=5,ae=J+z*2,ot=J+100,oe=ot+z*2,Mt=10,ce=0,dt=20,At=20,ut=30,Ct=50,le=o(function(e,t,s,r){const n=ft(),h=n.timeline?.leftMargin??50;E.debug("timeline",r.db);const c=Vt(t);c.append("g");const i=r.db.getTasks(),y=r.db.getCommonDb().getDiagramTitle();E.debug("task",i),M.initGraphics(c);const p=r.db.getSections();E.debug("sections",p);let m=0,f=0;const k=50+h;let a=50;const d=a,l=k,g=ae+At,x=oe+Ct,u=l+g;let S=0;const v=p&&p.length>0,I=v?u:k+g,C=Math.max(50,g+x-z*2);p.forEach(function(N){const b={number:S,descr:N,section:S,width:C,padding:z,maxHeight:m},_=M.getVirtualNodeHeight(c,b,n);E.debug("sectionHeight before draw",_),m=Math.max(m,_)});let W=0;E.debug("tasks.length",i.length);for(const[N,b]of i.entries()){const _={number:N,descr:b,section:b.section,width:J,padding:z,maxHeight:f},$=M.getVirtualNodeHeight(c,_,n);E.debug("taskHeight before draw",$),f=Math.max(f,$);let T=0;for(const P of b.events){const R={descr:P,section:b.section,number:b.section,width:ot,padding:z,maxHeight:50};T+=M.getVirtualNodeHeight(c,R,n)}b.events.length>0&&(T+=(b.events.length-1)*Mt),W=Math.max(W,T)+ce}E.debug("maxSectionHeight before draw",m),E.debug("maxTaskHeight before draw",f);const L=Math.max(f,W)+ut;v?p.forEach(N=>{const b=i.filter(Z=>Z.section===N),_={number:S,descr:N,section:S,width:C,padding:z,maxHeight:m};E.debug("sectionNode",_);const $=c.append("g"),T=M.drawNode($,_,S,n);E.debug("sectionNode output",T);const P=I-g;$.attr("transform",`translate(${P}, ${a})`);const R=a+T.height+dt;b.length>0&>(c,b,S,I,R,f,n,L,!1);const G=b.length,B=T.height+dt+L*Math.max(G,1)-(G>0?ut*2:0);a+=B,S++}):gt(c,i,S,I,a,f,n,L,!0);let w=c.node()?.getBBox();if(!w)throw new Error("bbox not found");if(E.debug("bounds",w),y){if(c.append("text").text(y).attr("x",w.width/2-h).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),w=c.node()?.getBBox(),!w)throw new Error("bbox not found");E.debug("bounds after title",w)}const[H]=Ft(n.fontSize),V=(H??16)*2,F=(H??16)*.5+20,U=c.append("g").attr("class","lineWrapper");U.append("line").attr("x1",I).attr("y1",d-V).attr("x2",I).attr("y2",w.y+w.height+F).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)"),U.lower(),yt(void 0,c,n.timeline?.padding??50,n.timeline?.useMaxWidth??!1)},"draw"),gt=o(function(e,t,s,r,n,h,c,i,y){for(const p of t){const m={descr:p.task,section:s,number:s,width:J,padding:z,maxHeight:h};E.debug("taskNode",m);const f=e.append("g").attr("class","taskWrapper"),k=M.drawNode(f,m,s,c),a=k.height;E.debug("taskHeight after draw",a);const d=r-At-k.width;if(f.attr("transform",`translate(${d}, ${n})`),h=Math.max(h,a),p.events&&p.events.length>0){const l=n,g=r+Ct;he(e,p.events,s,r,g,l,c)}n=n+i,y&&!c.timeline?.disableMulticolor&&s++}},"drawTasks"),he=o(function(e,t,s,r,n,h,c){let i=h;for(const y of t){const p={descr:y,section:s,number:s,width:ot,padding:z,maxHeight:0};E.debug("eventNode",p);const m=e.append("g").attr("class","eventWrapper"),k=M.drawNode(m,p,s,c).height;m.attr("transform",`translate(${n}, ${i})`);const a=e.append("g").attr("class","lineWrapper"),d=i+k/2;a.append("line").attr("x1",r).attr("y1",d).attr("x2",n).attr("y2",d).attr("stroke-width",2).attr("stroke","black").attr("marker-end","url(#arrowhead)").attr("stroke-dasharray","5,5"),i=i+k+Mt}return i-h},"drawEvents"),de={setConf:o(()=>{},"setConf"),draw:le},ue=o(e=>{const{theme:t}=pt(),s=t?.includes("dark"),r=Rt(t,e.borderColorArray),n=e.svgId?.replace(/^#/,"")??"",h=n?`url(#${n}-drop-shadow)`:e.dropShadow??"none";let c="";for(let i=0;i<nt(e.THEME_COLOR_LIMIT);i++){const y=`${17-3*i}`,p=r?e.borderColorArray[i%e.borderColorArray.length]:void 0,m=p??e.mainBkg,f=p??e.nodeBorder;c+=`
|
|
7
|
-
.section-${i-1} rect,
|
|
8
|
-
.section-${i-1} path,
|
|
9
|
-
.section-${i-1} circle {
|
|
10
|
-
fill: ${s&&r?e.mainBkg:m};
|
|
11
|
-
stroke: ${f};
|
|
12
|
-
stroke-width: ${e.strokeWidth};
|
|
13
|
-
filter: ${h};
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
.section-${i-1} text {
|
|
17
|
-
fill: ${e.nodeBorder};
|
|
18
|
-
font-weight: ${e.fontWeight}
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.node-icon-${i-1} {
|
|
22
|
-
font-size: 40px;
|
|
23
|
-
color: ${e["cScaleLabel"+i]};
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.section-edge-${i-1} {
|
|
27
|
-
stroke: ${e["cScale"+i]};
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
.edge-depth-${i-1} {
|
|
31
|
-
stroke-width: ${y};
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
.section-${i-1} line {
|
|
35
|
-
stroke: ${e["cScaleInv"+i]};
|
|
36
|
-
stroke-width: 3;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
.lineWrapper line {
|
|
40
|
-
stroke: ${e.nodeBorder};
|
|
41
|
-
stroke-width:${e.strokeWidth}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
.disabled,
|
|
45
|
-
.disabled circle,
|
|
46
|
-
.disabled text {
|
|
47
|
-
fill: ${e.tertiaryColor??"lightgray"};
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
.disabled text {
|
|
51
|
-
fill: ${e.clusterBorder??"#efefef"};
|
|
52
|
-
}
|
|
53
|
-
`}return c},"genReduxSections"),ge=o(e=>{let t="";const s=nt(e.THEME_COLOR_LIMIT);for(let r=0;r<s;r++)e["lineColor"+r]=e["lineColor"+r]??e["cScaleInv"+r],Wt(e["lineColor"+r])?e["lineColor"+r]=Pt(e["lineColor"+r],20):e["lineColor"+r]=Bt(e["lineColor"+r],20);for(let r=0;r<s;r++){const n=""+(17-3*r);t+=`
|
|
54
|
-
.section-${r-1} rect, .section-${r-1} path, .section-${r-1} circle, .section-${r-1} path {
|
|
55
|
-
fill: ${e["cScale"+r]};
|
|
56
|
-
}
|
|
57
|
-
.section-${r-1} text {
|
|
58
|
-
fill: ${e["cScaleLabel"+r]};
|
|
59
|
-
}
|
|
60
|
-
.node-icon-${r-1} {
|
|
61
|
-
font-size: 40px;
|
|
62
|
-
color: ${e["cScaleLabel"+r]};
|
|
63
|
-
}
|
|
64
|
-
.section-edge-${r-1}{
|
|
65
|
-
stroke: ${e["cScale"+r]};
|
|
66
|
-
}
|
|
67
|
-
.edge-depth-${r-1}{
|
|
68
|
-
stroke-width: ${n};
|
|
69
|
-
}
|
|
70
|
-
.section-${r-1} line {
|
|
71
|
-
stroke: ${e["cScaleInv"+r]} ;
|
|
72
|
-
stroke-width: 3;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
.lineWrapper line{
|
|
76
|
-
stroke: ${e["cScaleLabel"+r]} ;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
.disabled, .disabled circle, .disabled text {
|
|
80
|
-
fill: ${e.tertiaryColor??"lightgray"};
|
|
81
|
-
}
|
|
82
|
-
.disabled text {
|
|
83
|
-
fill: ${e.clusterBorder??"#efefef"};
|
|
84
|
-
}
|
|
85
|
-
`}return t},"genSections"),pe=o(e=>{const{theme:t}=pt(),s=t?.includes("redux"),r=t==="neutral",n=e.svgId?.replace(/^#/,"")??"";let h="";if(e.useGradient&&n&&e.THEME_COLOR_LIMIT&&!r){const c=nt(e.THEME_COLOR_LIMIT);for(let i=0;i<c;i++)h+=`
|
|
86
|
-
.section-${i-1}[data-look="neo"] rect,
|
|
87
|
-
.section-${i-1}[data-look="neo"] path,
|
|
88
|
-
.section-${i-1}[data-look="neo"] circle {
|
|
89
|
-
fill: ${e.mainBkg};
|
|
90
|
-
stroke: url(#${n}-gradient);
|
|
91
|
-
stroke-width: 2;
|
|
92
|
-
}
|
|
93
|
-
.section-${i-1}[data-look="neo"] line {
|
|
94
|
-
stroke: url(#${n}-gradient);
|
|
95
|
-
stroke-width: 2;
|
|
96
|
-
}`}return`
|
|
97
|
-
.edge {
|
|
98
|
-
stroke-width: 3;
|
|
99
|
-
}
|
|
100
|
-
${s?ue(e):ge(e)}
|
|
101
|
-
${h}
|
|
102
|
-
.section-root rect, .section-root path, .section-root circle {
|
|
103
|
-
fill: ${e.git0};
|
|
104
|
-
}
|
|
105
|
-
.section-root text {
|
|
106
|
-
fill: ${e.gitBranchLabel0};
|
|
107
|
-
}
|
|
108
|
-
.icon-container {
|
|
109
|
-
height:100%;
|
|
110
|
-
display: flex;
|
|
111
|
-
justify-content: center;
|
|
112
|
-
align-items: center;
|
|
113
|
-
}
|
|
114
|
-
.edge {
|
|
115
|
-
fill: none;
|
|
116
|
-
}
|
|
117
|
-
.eventWrapper {
|
|
118
|
-
filter: brightness(120%);
|
|
119
|
-
}
|
|
120
|
-
`},"getStyles"),fe=pe,ye={setConf:o(()=>{},"setConf"),draw:o((e,t,s,r)=>(r?.db?.getDirection?.()??"LR")==="TD"?de.draw(e,t,s,r):ie.draw(e,t,s,r),"draw")},ke={db:mt,renderer:ye,parser:Dt,styles:fe};export{ke as diagram};
|