@reqvire-org/reqvire 1.3.1 → 1.4.0

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.
Files changed (172) hide show
  1. package/artifacts/reqvire-darwin-arm64.tar.gz +0 -0
  2. package/artifacts/reqvire-darwin-x86_64.tar.gz +0 -0
  3. package/artifacts/reqvire-linux-x86_64.tar.gz +0 -0
  4. package/explorer-dist/assets/brand/README.md +28 -0
  5. package/explorer-dist/assets/explorer-KnowledgeGraphCanvasImpl.js +1 -0
  6. package/explorer-dist/assets/{explorer-abnfDiagram-VCTEODGH.js → explorer-abnfDiagram-WEYOIA3C.js} +1 -1
  7. package/explorer-dist/assets/explorer-actionscript-3.js +1 -1
  8. package/explorer-dist/assets/explorer-ada.js +1 -1
  9. package/explorer-dist/assets/explorer-ahk.js +1 -0
  10. package/explorer-dist/assets/explorer-ahk2.js +1 -0
  11. package/explorer-dist/assets/explorer-apex.js +1 -1
  12. package/explorer-dist/assets/explorer-architectureDiagram-ZHVYKT53.js +36 -0
  13. package/explorer-dist/assets/explorer-asciidoc.js +1 -1
  14. package/explorer-dist/assets/explorer-bat.js +1 -1
  15. package/explorer-dist/assets/explorer-beancount.js +1 -1
  16. package/explorer-dist/assets/explorer-bird2.js +1 -1
  17. package/explorer-dist/assets/explorer-blockDiagram-RJAE7QA3.js +140 -0
  18. package/explorer-dist/assets/explorer-bsl.js +1 -1
  19. package/explorer-dist/assets/explorer-c3.js +1 -1
  20. package/explorer-dist/assets/explorer-c4Diagram-XDPPPE54.js +38 -0
  21. package/explorer-dist/assets/explorer-catppuccin-frappe.js +1 -1
  22. package/explorer-dist/assets/explorer-catppuccin-latte.js +1 -1
  23. package/explorer-dist/assets/explorer-catppuccin-macchiato.js +1 -1
  24. package/explorer-dist/assets/explorer-catppuccin-mocha.js +1 -1
  25. package/explorer-dist/assets/explorer-chapel.js +1 -0
  26. package/explorer-dist/assets/{explorer-chunk-SVP7TREG.js → explorer-chunk-2E7WHVMD.js} +4 -4
  27. package/explorer-dist/assets/explorer-chunk-4EMNKR2T.js +1 -0
  28. package/explorer-dist/assets/explorer-chunk-55XCU76K.js +1 -0
  29. package/explorer-dist/assets/explorer-chunk-ZCHMQSOR.js +2 -0
  30. package/explorer-dist/assets/explorer-clarity.js +1 -1
  31. package/explorer-dist/assets/explorer-classDiagram-v2-4MYWR3UA.js +217 -0
  32. package/explorer-dist/assets/explorer-coq.js +1 -1
  33. package/explorer-dist/assets/explorer-cose-bilkent-JH36ORCC.js +1 -1
  34. package/explorer-dist/assets/explorer-cpp.js +1 -1
  35. package/explorer-dist/assets/explorer-csharp.js +1 -1
  36. package/explorer-dist/assets/explorer-css.js +1 -1
  37. package/explorer-dist/assets/explorer-cynefin-EF2NZ3EQ.js +141 -0
  38. package/explorer-dist/assets/{explorer-cynefinDiagram-5FMLGOSQ.js → explorer-cynefinDiagram-WF24UDRP.js} +2 -2
  39. package/explorer-dist/assets/explorer-cytoscape.esm.js +23 -23
  40. package/explorer-dist/assets/explorer-dagre-NK4GIZVX.js +4 -0
  41. package/explorer-dist/assets/explorer-dart.js +1 -1
  42. package/explorer-dist/assets/{explorer-diagram-VX7I27RA.js → explorer-diagram-CBK3MWTC.js} +2 -2
  43. package/explorer-dist/assets/explorer-diagram-I5XIIV2D.js +24 -0
  44. package/explorer-dist/assets/{explorer-diagram-S7CK7UJ4.js → explorer-diagram-ODIL2UCW.js} +5 -5
  45. package/explorer-dist/assets/explorer-diagram-PFBEJUXE.js +3 -0
  46. package/explorer-dist/assets/explorer-diagram-RJA3I4VV.js +41 -0
  47. package/explorer-dist/assets/explorer-diagram-TYUNFSNR.js +200 -0
  48. package/explorer-dist/assets/explorer-dotenv.js +1 -1
  49. package/explorer-dist/assets/{explorer-ebnfDiagram-PWID7BFC.js → explorer-ebnfDiagram-V4P3TTPT.js} +1 -1
  50. package/explorer-dist/assets/explorer-elk-QONTBCTQ.js +27 -0
  51. package/explorer-dist/assets/explorer-emacs-lisp.js +1 -1
  52. package/explorer-dist/assets/explorer-erDiagram-KYQIGQAA.js +99 -0
  53. package/explorer-dist/assets/explorer-flowDiagram-IUGLLWBU.js +213 -0
  54. package/explorer-dist/assets/explorer-ganttDiagram-R7GPNTJY.js +292 -0
  55. package/explorer-dist/assets/explorer-gdscript.js +1 -1
  56. package/explorer-dist/assets/{explorer-gitGraphDiagram-WWUBYQGX.js → explorer-gitGraphDiagram-PDYL7XHY.js} +5 -5
  57. package/explorer-dist/assets/explorer-gn.js +1 -1
  58. package/explorer-dist/assets/explorer-graph.js +1 -0
  59. package/explorer-dist/assets/explorer-hack.js +1 -1
  60. package/explorer-dist/assets/explorer-handlebars.js +1 -1
  61. package/explorer-dist/assets/explorer-haxe.js +1 -1
  62. package/explorer-dist/assets/explorer-hxml.js +1 -1
  63. package/explorer-dist/assets/explorer-index.js +312 -0
  64. package/explorer-dist/assets/explorer-infoDiagram-MVDRKAX5.js +2 -0
  65. package/explorer-dist/assets/{explorer-ishikawaDiagram-5VMMS53U.js → explorer-ishikawaDiagram-HPEHV2GE.js} +4 -4
  66. package/explorer-dist/assets/{explorer-journeyDiagram-3NMN7TZE.js → explorer-journeyDiagram-BOSHW7O7.js} +1 -1
  67. package/explorer-dist/assets/explorer-julia.js +1 -1
  68. package/explorer-dist/assets/explorer-just.js +1 -1
  69. package/explorer-dist/assets/explorer-kanagawa-dragon.js +1 -1
  70. package/explorer-dist/assets/explorer-kanagawa-lotus.js +1 -1
  71. package/explorer-dist/assets/explorer-kanagawa-wave.js +1 -1
  72. package/explorer-dist/assets/{explorer-kanban-definition-UXKFOSKX.js → explorer-kanban-definition-FNSA4HC5.js} +7 -7
  73. package/explorer-dist/assets/explorer-katex.js +18 -18
  74. package/explorer-dist/assets/explorer-latex.js +1 -1
  75. package/explorer-dist/assets/explorer-linear.js +1 -1
  76. package/explorer-dist/assets/explorer-llvm.js +1 -1
  77. package/explorer-dist/assets/explorer-luau.js +1 -1
  78. package/explorer-dist/assets/explorer-marko.js +1 -1
  79. package/explorer-dist/assets/explorer-mdc.js +1 -1
  80. package/explorer-dist/assets/explorer-mermaid.core.js +150 -148
  81. package/explorer-dist/assets/explorer-mermaid.js +1 -1
  82. package/explorer-dist/assets/explorer-mindmap-definition-6OY57UG3.js +98 -0
  83. package/explorer-dist/assets/explorer-mojo.js +1 -1
  84. package/explorer-dist/assets/explorer-monokai.js +1 -1
  85. package/explorer-dist/assets/explorer-moonbit.js +1 -1
  86. package/explorer-dist/assets/explorer-move.js +1 -1
  87. package/explorer-dist/assets/explorer-nextflow-groovy.js +1 -1
  88. package/explorer-dist/assets/explorer-nextflow.js +1 -1
  89. package/explorer-dist/assets/explorer-nsis.js +1 -0
  90. package/explorer-dist/assets/explorer-nushell.js +1 -1
  91. package/explorer-dist/assets/explorer-one-dark-pro.js +1 -1
  92. package/explorer-dist/assets/explorer-ontologyGraphRendererImpl.js +616 -0
  93. package/explorer-dist/assets/explorer-org.js +1 -0
  94. package/explorer-dist/assets/{explorer-pegDiagram-XKGWAZYB.js → explorer-pegDiagram-ECIUJNBX.js} +1 -1
  95. package/explorer-dist/assets/explorer-php.js +1 -1
  96. package/explorer-dist/assets/explorer-pieDiagram-GNMPY74T.js +39 -0
  97. package/explorer-dist/assets/explorer-powershell.js +1 -1
  98. package/explorer-dist/assets/explorer-prisma.js +1 -1
  99. package/explorer-dist/assets/{explorer-quadrantDiagram-AXDQQJYC.js → explorer-quadrantDiagram-D57K4MC3.js} +1 -1
  100. package/explorer-dist/assets/explorer-r.js +1 -1
  101. package/explorer-dist/assets/{explorer-railroadDiagram-O6MQD6OU.js → explorer-railroadDiagram-Y72NRBL7.js} +1 -1
  102. package/explorer-dist/assets/explorer-rbs.js +1 -0
  103. package/explorer-dist/assets/explorer-red.js +1 -1
  104. package/explorer-dist/assets/explorer-requirementDiagram-EQYSW5RA.js +84 -0
  105. package/explorer-dist/assets/explorer-rose-pine-dawn.js +1 -1
  106. package/explorer-dist/assets/explorer-rose-pine-moon.js +1 -1
  107. package/explorer-dist/assets/explorer-rose-pine.js +1 -1
  108. package/explorer-dist/assets/explorer-rst.js +1 -1
  109. package/explorer-dist/assets/explorer-ruby.js +1 -1
  110. package/explorer-dist/assets/explorer-rust.js +1 -1
  111. package/explorer-dist/assets/{explorer-sankeyDiagram-P5KCCOFB.js → explorer-sankeyDiagram-SY24JHO5.js} +4 -4
  112. package/explorer-dist/assets/explorer-scala.js +1 -1
  113. package/explorer-dist/assets/explorer-sequenceDiagram-BLEHNHQU.js +169 -0
  114. package/explorer-dist/assets/explorer-smalltalk.js +1 -1
  115. package/explorer-dist/assets/explorer-smithy.js +1 -0
  116. package/explorer-dist/assets/explorer-solarized-dark.js +1 -1
  117. package/explorer-dist/assets/explorer-solarized-light.js +1 -1
  118. package/explorer-dist/assets/explorer-solidity.js +1 -1
  119. package/explorer-dist/assets/explorer-sql.js +1 -1
  120. package/explorer-dist/assets/explorer-stateDiagram-v2-A6IESKWZ.js +291 -0
  121. package/explorer-dist/assets/explorer-surrealql.js +1 -1
  122. package/explorer-dist/assets/explorer-svelte.js +1 -1
  123. package/explorer-dist/assets/explorer-swift.js +1 -1
  124. package/explorer-dist/assets/explorer-swimlanes-B3ENRKFQ.js +1 -0
  125. package/explorer-dist/assets/explorer-swimlanesDiagram-AYQRV4AK.js +8 -0
  126. package/explorer-dist/assets/explorer-system-verilog.js +1 -1
  127. package/explorer-dist/assets/explorer-timeline-definition-JXYKGLGB.js +120 -0
  128. package/explorer-dist/assets/explorer-twig.js +1 -1
  129. package/explorer-dist/assets/explorer-typespec.js +1 -1
  130. package/explorer-dist/assets/explorer-typst.js +1 -1
  131. package/explorer-dist/assets/explorer-usecaseDiagram-WPOLBNNX.js +370 -0
  132. package/explorer-dist/assets/explorer-v.js +1 -1
  133. package/explorer-dist/assets/explorer-vb.js +1 -1
  134. package/explorer-dist/assets/explorer-vennDiagram-Q3Y3IDCW.js +34 -0
  135. package/explorer-dist/assets/explorer-verilog.js +1 -1
  136. package/explorer-dist/assets/explorer-vue.js +1 -1
  137. package/explorer-dist/assets/{explorer-wardleyDiagram-VM6X3IG4.js → explorer-wardleyDiagram-IVAIDKWA.js} +3 -3
  138. package/explorer-dist/assets/explorer-xychartDiagram-4URNHDU4.js +7 -0
  139. package/explorer-dist/assets/explorer.css +1 -1
  140. package/explorer-dist/assets/explorer.js +40 -1152
  141. package/explorer-dist/assets/fonts/.gitkeep +0 -0
  142. package/package.json +1 -1
  143. package/explorer-dist/assets/explorer-architectureDiagram-5GKGNRK7.js +0 -36
  144. package/explorer-dist/assets/explorer-blockDiagram-I7D4REHJ.js +0 -129
  145. package/explorer-dist/assets/explorer-c4Diagram-7LVT6UL2.js +0 -38
  146. package/explorer-dist/assets/explorer-chunk-F27PBJKO.js +0 -1
  147. package/explorer-dist/assets/explorer-chunk-IMKFNOWR.js +0 -231
  148. package/explorer-dist/assets/explorer-chunk-TICWLB2K.js +0 -206
  149. package/explorer-dist/assets/explorer-classDiagram-ZZMXUADV.js +0 -1
  150. package/explorer-dist/assets/explorer-classDiagram-v2-VYDZK3BY.js +0 -1
  151. package/explorer-dist/assets/explorer-cynefin-OW5HDTMX.js +0 -178
  152. package/explorer-dist/assets/explorer-dagre-GXQ25YYZ.js +0 -4
  153. package/explorer-dist/assets/explorer-diagram-UQ7AKVKN.js +0 -41
  154. package/explorer-dist/assets/explorer-diagram-VSXAHHWV.js +0 -3
  155. package/explorer-dist/assets/explorer-diagram-Z3DM3KII.js +0 -24
  156. package/explorer-dist/assets/explorer-erDiagram-RLTQ6QDP.js +0 -99
  157. package/explorer-dist/assets/explorer-flowDiagram-HODETNUW.js +0 -168
  158. package/explorer-dist/assets/explorer-ganttDiagram-EL5Y4UJY.js +0 -292
  159. package/explorer-dist/assets/explorer-infoDiagram-27XIBGKW.js +0 -2
  160. package/explorer-dist/assets/explorer-layout.js +0 -1
  161. package/explorer-dist/assets/explorer-mindmap-definition-YA3MSWOX.js +0 -96
  162. package/explorer-dist/assets/explorer-pieDiagram-E7YTZNPT.js +0 -39
  163. package/explorer-dist/assets/explorer-requirementDiagram-BXWQKSXE.js +0 -84
  164. package/explorer-dist/assets/explorer-sequenceDiagram-WJ2MYXX4.js +0 -162
  165. package/explorer-dist/assets/explorer-stateDiagram-D77RDMKH.js +0 -1
  166. package/explorer-dist/assets/explorer-stateDiagram-v2-MP3YSRHH.js +0 -1
  167. package/explorer-dist/assets/explorer-swimlanes-42K2YHIH.js +0 -1
  168. package/explorer-dist/assets/explorer-swimlanesDiagram-VR7AAH4N.js +0 -8
  169. package/explorer-dist/assets/explorer-timeline-definition-24CTP7MA.js +0 -120
  170. package/explorer-dist/assets/explorer-vennDiagram-4TSXK5OY.js +0 -34
  171. package/explorer-dist/assets/explorer-xychartDiagram-S5SC5T6Z.js +0 -7
  172. /package/explorer-dist/assets/{explorer-chunk-POPQ4Y6H.js → explorer-chunk-VQ5W62QI.js} +0 -0
@@ -0,0 +1 @@
1
+ import{a as lr}from"./explorer-chunk-4EMNKR2T.js";import{c as fr}from"./explorer-chunk-ZCHMQSOR.js";import{_ as l,l as Mn}from"./explorer-mermaid.core.js";import"./explorer.js";import"./explorer-graph.js";function Ro(t,{measure:e}){var r,a;const n=(a=(r=t.config)==null?void 0:r.swimlane)==null?void 0:a.lineHops;if(n===!1)return;const o=n==="gap"?"gap":"arc",s=t.edges.filter(c=>Array.isArray(c.points)&&c.points.length>=2).map(c=>({id:c.id,points:c.points,curve:c.curve,arrowTypeStart:c.arrowTypeStart,arrowTypeEnd:c.arrowTypeEnd}));lr(e.groups.edgePaths,s,{enabled:!0,jumpRadius:6,jumpStyle:o})}l(Ro,"applySwimlaneLineJumps");var yn="__swimlane_default__",dr=21,Lo=20;function Sn(t){return Math.max(t.padding??Lo,Lo)}l(Sn,"topLaneHorizontalPadding");function No(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 a=n-s/2,c=Math.min(r,n+s/2),u=Math.min(dr,Math.max(0,c-a)),m=a+u;if(m<=a){delete t.groupTitleRect;return}t.groupTitleRect={left:e-o/2,right:e+o/2,top:a,bottom:m}}l(No,"assignTopLaneTitleRect");function Oo(t){var r;const e=t.direction,n=t.nodes??(t.nodes=[]);for(const a of t.nodes??[])a.isGroup&&!a.parentId&&(a.shape="swimlane",e&&(a.direction=e));const o=n.filter(a=>!a.isGroup&&!a.parentId);if(o.length===0)return;let s=n.find(a=>a.id===yn);s?s.isGroup&&(s.shape="swimlane",e&&(s.direction=e)):(s={id:yn,label:"",isGroup:!0,shape:"swimlane",padding:20,look:(r=t.config)==null?void 0:r.look,colorIndex:n.reduce((a,c)=>Math.max(a,c.colorIndex??-1),-1)+1,...e?{direction:e}:{}},n.push(s));for(const a of o)a.parentId=yn}l(Oo,"prepareLayoutForSwimlanes");function Bo(t){const e=new Map;for(const u of t.nodes??[])e.set(u.id,u);const n=[];for(const u of t.edges??[]){const m=typeof u.start=="string"?u.start:void 0,p=typeof u.end=="string"?u.end:void 0;!m||!p||u.labelNodeId||n.push({id:u.id,src:m,dst:p,ref:u})}const o=t.nodes??[],s=o.filter(u=>u.isGroup),r=o.filter(u=>!u.isGroup);return{nodes:[...[...s].reverse(),...r].map(u=>u.id),edges:n,layout:t,nodeById:e}}l(Bo,"toGraphView");function Po(t,e,n,o){const{layout:s}=t,r=t.nodeById,a=(o==null?void 0:o.layerGap)??100,c=(o==null?void 0:o.nodeGap)??40;let u=0;for(const S of e.layers){let f=0;for(const d of S){const i=r.get(d);if(!i){f++;continue}i.layer=u,i.order=f;const y=n.x[d]??f*c,C=n.y[d]??u*a;i.x=y,i.y=C,f++}u++}const m=s.nodes??[],p=new Map,g=[];for(const S of m){if(!(S!=null&&S.isGroup))continue;S.parentId||g.push(S);const f=m.filter(b=>b.parentId===S.id);let d=1/0,i=-1/0,y=1/0,C=-1/0;for(const b of f){const L=b.x??n.x[b.id],v=b.y??n.y[b.id],x=b.width??0,I=b.height??0;L!=null&&v!=null&&(d=Math.min(d,L-x/2),i=Math.max(i,L+x/2),y=Math.min(y,v-I/2),C=Math.max(C,v+I/2))}if(d===1/0||y===1/0)S.x=S.x??0,S.y=S.y??0,S.width=S.width??0,S.height=S.height??0;else{const b=S.padding??20,L=S.parentId?b:2*Sn(S),v=b,x=Math.max(0,i-d)+L,I=Math.max(0,C-y)+v,T=(d+i)/2,A=(y+C)/2;S.x=T,S.y=A,S.width=x,S.height=I,p.set(S.id,{minX:d,maxX:i,minY:y,maxY:C})}}if(g.length>0&&p.size>0){let S=1/0,f=-1/0,d=0;for(const i of g){const y=i.padding??20;y>d&&(d=y);const C=p.get(i.id);C&&(S=Math.min(S,C.minY),f=Math.max(f,C.maxY))}if(S!==1/0&&f!==-1/0){const i=Math.max(0,f-S),C=Math.max(d,36),b=i+2*C,L=(S+f)/2;for(const P of g)P.y=L,P.height=b,P.swimlaneContentTop=S;const v=[...g].sort((P,O)=>{const k=P.x??0,D=O.x??0;return k-D}),x=[],I=[],T=[];for(const P of v){const O=p.get(P.id);if(!O)continue;const k=Math.max(0,O.maxX-O.minX)+2*Sn(P),D=(O.minX+O.maxX)/2;x.push(P.id),I.push(D),T.push(k)}const A=x.length;if(A>0){const P=new Map;if(A===1)P.set(x[0],T[0]);else{const O=[];for(let j=0;j<A-1;j++)O.push(I[j+1]-I[j]);const k=new Array(A);k[0]=0;for(let j=0;j<A-1;j++)k[j+1]=2*O[j]-k[j];let D=0,B=Number.POSITIVE_INFINITY;for(let j=0;j<A;j++){const tt=T[j];j%2===0?D=Math.max(D,tt-k[j]):B=Math.min(B,k[j]-tt)}let G=D;D<=B?G=(D+B)/2:G=D;for(let j=0;j<A;j++){const tt=k[j]+(j%2===0?G:-G),ft=Math.max(T[j],tt);P.set(x[j],ft)}}for(const O of g){const k=P.get(O.id);k!=null&&(O.width=k),No(O)}}}}}l(Po,"writeBackToLayoutData");var ur="[EdgeLabelNodes]";function ko(t){const e=[],n=[],o=new Map;for(const a of t.nodes)o.set(a.id,a);for(const a of t.edges){if(!a.label||a.label.length===0||a.isLayoutOnly||a.labelNodeId)continue;const c=a.start?o.get(a.start):void 0,u=a.end?o.get(a.end):void 0;if(!c||!u){Mn.warn(ur,`Edge ${a.id} has missing source or target node`);continue}const m=`edge-label-${a.start}-${a.end}-${a.id}`,g=c.parentId!==u.parentId?u.parentId:c.parentId,S={id:m,label:a.label,edgeStart:a.start??"",edgeEnd:a.end??"",shape:"labelRect",width:0,height:0,isEdgeLabel:!0,isDummy:!0,parentId:g,isGroup:!1,labelStyle:Array.isArray(a.labelStyle)?a.labelStyle[0]:a.labelStyle??"",...c.dir?{dir:c.dir}:{}};e.push(S),a.labelNodeId=m,a.label=void 0,a.text=void 0;const f={id:`${a.id}-to-label`,start:a.start,end:m,type:"normal",isLayoutOnly:!0},d={id:`${a.id}-from-label`,start:m,end:a.end,type:"normal",isLayoutOnly:!0};n.push(f,d)}const s=[...t.nodes,...e],r=[...t.edges,...n];return{...t,nodes:s,edges:r}}l(ko,"createEdgeLabelNodes");var Yt=.001;function to(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:Ne(e,n,o,s)}:void 0}l(to,"measuredNodeRect");function eo(t){if(t.isGroup)return;const e=to(t);return e?{id:String(t.id??""),cx:e.cx,cy:e.cy,rect:e.rect}:void 0}l(eo,"nodeBoundsInfoFor");function ce(t,e,n=Yt){return Math.abs(t.x-e.x)<n&&Math.abs(t.y-e.y)<n}l(ce,"samePoint");function gt(t,e,n=Yt){return Math.abs(t.x-e.x)<n}l(gt,"sameX");function xt(t,e,n=Yt){return Math.abs(t.y-e.y)<n}l(xt,"sameY");function Nt(t,e,n=Yt){return xt(t,e,n)&&Math.abs(t.x-e.x)>n}l(Nt,"isHorizontalSegment");function Ot(t,e,n=Yt){return gt(t,e,n)&&Math.abs(t.y-e.y)>n}l(Ot,"isVerticalSegment");function Wt(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(Wt,"overlapLength");function fe(t,e,n=Yt){return t.horizontal&&e.horizontal&&xt(t.a,e.a,n)?Wt(t.a.x,t.b.x,e.a.x,e.b.x):t.vertical&&e.vertical&&gt(t.a,e.a,n)?Wt(t.a.y,t.b.y,e.a.y,e.b.y):0}l(fe,"sameAxisSegmentOverlapLength");function Oe(t,e=Yt){const n=[];for(let o=0;o<t.length-1;o++){const s=t[o],r=t[o+1],a=Nt(s,r,e),c=Ot(s,r,e);(a||c)&&n.push({index:o,a:s,b:r,horizontal:a,vertical:c})}return n}l(Oe,"orthogonalSegmentsForPoints");function oe(t,e=Yt){const n=Oe(t,e);let o=0;for(let s=1;s<n.length;s++)n[s-1].horizontal!==n[s].horizontal&&o++;return o}l(oe,"countOrthogonalBends");function pt(t,e=Yt){const n=[];for(const o of t){const s=n.length>0?n[n.length-1]:void 0;(!s||!ce(s,o,e))&&n.push({x:o.x,y:o.y})}return n}l(pt,"dedupeConsecutivePoints");function no(t,e=Yt){if(!t||t.length!==4)return;const[n,o,s,r]=t;return Nt(n,o,e)&&Ot(o,s,e)&&Nt(s,r,e)?{kind:"HVH",p0:n,p1:o,p2:s,p3:r}:Ot(n,o,e)&&Nt(o,s,e)&&Ot(s,r,e)?{kind:"VHV",p0:n,p1:o,p2:s,p3:r}:void 0}l(no,"classifyThreeSegmentRoute");function nn(t,e,n,o=0){const s=Math.min(t.x,e.x),r=Math.max(t.x,e.x),a=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&&a<n.bottom+o}l(nn,"segmentBoundsOverlapRect");function oo(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(oo,"pointInsideRect");function Fo(t,e){return t.left<=e.left&&t.right>=e.right&&t.top<=e.top&&t.bottom>=e.bottom}l(Fo,"rectContainsRect");function Ue(t,e){return t.left<e.right&&t.right>e.left&&t.top<e.bottom&&t.bottom>e.top}l(Ue,"rectsOverlap");function Cn(t,e){return{left:t.left-e,right:t.right+e,top:t.top-e,bottom:t.bottom+e}}l(Cn,"inflateRect");function Ne(t,e,n,o){return{left:t-n/2,right:t+n/2,top:e-o/2,bottom:e+o/2}}l(Ne,"rectFromCenterSize");function te(t){var e;return(e=to(t))==null?void 0:e.rect}l(te,"rectOfNodeBounds");function ve(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(ve,"portForRectSide");function so(t,e,n,o,s,r=Yt){const a=e==="left"||e==="right",c=o==="left"||o==="right";if(a&&c){if(e==="right"&&o==="left"&&t.x<n.x||e==="left"&&o==="right"&&t.x>n.x){if(xt(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(xt(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(!a&&!c){if(e===o){if(gt(t,n,r))return;const S=e==="top"?Math.min(t.y,n.y)-s:Math.max(t.y,n.y)+s;return[t,{x:t.x,y:S},{x:n.x,y:S},n]}if(!(e==="bottom"&&o==="top"&&t.y<n.y||e==="top"&&o==="bottom"&&t.y>n.y))return;if(gt(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(a&&!c){const p=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 p&&g?[t,{x:n.x,y:t.y},n]:void 0}const u=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 u&&m?[t,{x:t.x,y:n.y},n]:void 0}l(so,"buildOrthogonalPortPath");function ro(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(ro,"buildSameSideTrackPath");function on(t){const e=new Map,n=[];for(const o of t){if(o.isEdgeLabel)continue;const s=eo(o);s&&(e.set(s.id,s),n.push({id:s.id,rect:s.rect}))}return{nodeInfoById:e,realNodeRects:n}}l(on,"collectRealNodeBounds");function be(t){const e=[],n=[];for(const o of t){const s=eo(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(be,"collectNodeRectEntries");function _o(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,a=o.width??0,c=o.height??0;n.push({nodeId:o.id,...Ne(s,r,a,c)})}return n}l(_o,"collectLayoutNodeRects");function io(t,e,n=Yt){const o=t.start,s=t.end;if(!o||!s)return;const r=e.get(o),a=e.get(s);if(!(!r||!a))return{srcId:o,dstId:s,srcInfo:r,dstInfo:a,collinearX:Math.abs(r.cx-a.cx)<n,collinearY:Math.abs(r.cy-a.cy)<n}}l(io,"getNodePairGeometry");function Bt(t,e,n,o=[],s=0){for(const r of n)if(!o.includes(r.id)&&nn(t,e,r.rect,-s))return!0;return!1}l(Bt,"segmentHitsAnyRect");function co(t,e,n,o,s=Yt,r=1e-6){const a=xt(t,e,s),c=gt(t,e,s),u=xt(n,o,s),m=gt(n,o,s);if(a&&u||c&&m||!(a||c)||!(u||m))return!1;const p=a?{a:t,b:e}:{a:n,b:o},g=c?{a:t,b:e}:{a:n,b:o},S=p.a.y,f=Math.min(p.a.x,p.b.x),d=Math.max(p.a.x,p.b.x),i=g.a.x,y=Math.min(g.a.y,g.b.y),C=Math.max(g.a.y,g.b.y);if(i<f||i>d||S<y||S>C)return!1;const b=Math.abs(i-p.a.x)<r&&Math.abs(S-p.a.y)<r||Math.abs(i-p.b.x)<r&&Math.abs(S-p.b.y)<r,L=Math.abs(i-g.a.x)<r&&Math.abs(S-g.a.y)<r||Math.abs(i-g.b.x)<r&&Math.abs(S-g.b.y)<r;return!(b&&L)}l(co,"orthogonalSegmentsCross");function Ho(t,e,n,o,s=Yt){const r=xt(t,e,s),a=gt(t,e,s),c=xt(n,o,s),u=gt(n,o,s);return a&&u&&gt(t,n,s)?Wt(t.y,e.y,n.y,o.y)>s:r&&c&&xt(t,n,s)?Wt(t.x,e.x,n.x,o.x)>s:!1}l(Ho,"sameAxisSegmentsOverlap");function We(t,e,n,o,{epsilon:s=Yt,skipDegenerateOther:r=!1}={}){for(const a of n){if(a===o||a.isLayoutOnly)continue;const c=a.points;if(!(!c||c.length<2))for(let u=0;u<c.length-1;u++){const m=c[u],p=c[u+1];if(!(r&&ce(m,p,s))&&(co(t,e,m,p,s)||Ho(t,e,m,p,s)))return!0}}return!1}l(We,"segmentConflictsWithAnyEdge");function ue(t,e,n,o,s=Yt){const r=xt(t,e,s),a=gt(t,e,s),c=xt(n,o,s),u=gt(n,o,s);if(!(r&&u||a&&c))return!1;const m=r?{a:t,b:e}:{a:n,b:o},p=r?{a:n,b:o}:{a:t,b:e},g=m.a.y,S=Math.min(m.a.x,m.b.x),f=Math.max(m.a.x,m.b.x),d=p.a.x,i=Math.min(p.a.y,p.b.y),y=Math.max(p.a.y,p.b.y);return d>S+s&&d<f-s&&g>i+s&&g<y-s}l(ue,"orthogonalSegmentsStrictlyCross");function vn(t,e,n){const o=Math.min(e,n),s=Math.max(e,n);return t>o+Yt&&t<s-Yt}l(vn,"strictlyBetween");function Do(t,e,n){return gt(t,e)&&gt(e,n)?vn(e.y,t.y,n.y):xt(t,e)&&xt(e,n)?vn(e.x,t.x,n.x):!1}l(Do,"isCollinearIntermediate");function Xo(t){let e=!1;const n=[];for(let o=0;o<t.length;o++){const s=n[n.length-1],r=t[o],a=o+1<t.length?t[o+1]:void 0;if(s&&a){if(ce(s,a)){o++,e=!0;continue}if(Do(s,r,a)){e=!0;continue}}n.push(r)}return{points:n,changed:e}}l(Xo,"simplifyPolylineOnce");function Ke(t){const e=[t[0]];for(let o=1;o<t.length;o++){const s=e[e.length-1],r=t[o];if(!gt(s,r)&&!xt(s,r)){const a=e.length>=2?e[e.length-2]:void 0,u=(a?gt(a,s):!1)?{x:s.x,y:r.y}:{x:r.x,y:s.y};e.push(u)}e.push(r)}const n=[];for(const o of e){const s=n[n.length-1];(!s||!ce(s,o))&&n.push(o)}return n}l(Ke,"orthogonalizePolyline");function de(t){if(t.length<3)return t;let e=[...t];for(let n=0;n<32;n++){const o=Xo(e);if(e=o.points,!o.changed)break}return e}l(de,"simplifyPolyline");var it=.001,hr=.5,To=4;function ao(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?te(s):void 0,dstRect:r?te(r):void 0}}l(ao,"endpointContextFor");function Yo(t,e,n){if(xt(t,e,it))return{x:t.x<n.left?n.left:n.right,y:t.y};if(gt(t,e,it)){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(Yo,"segmentEnterPoint");function Ln(t,e,n){const o=n?1:-1;let s=n?0:t.length-1;for(;s>=0&&s<t.length&&oo(t[s],e,hr);)s+=o;if(s<0||s>=t.length)return t;const r=s-o;if(r<0||r>=t.length)return t;const a=Yo(t[s],t[r],e);return n?[a,...t.slice(s)]:[...t.slice(0,s+1),a]}l(Ln,"clipEndpoint");function Go(t,e){for(const n of t){const o=ao(n,e,2);if(!o)continue;let s=[...o.points];o.srcRect&&(s=Ln(s,o.srcRect,!0)),o.dstRect&&(s=Ln(s,o.dstRect,!1)),s=de(Ke(s)),s=lo(s,o.srcRect,o.dstRect),o.edge.points=de(Ke(s))}}l(Go,"clipEdgeEndpointsToNodeBoundaries");function Tn(t,e,n,o=!1){if(xt(t,e,it)){if(e.y<n.top-it||e.y>n.bottom+it)return e;if(o){if(t.x<n.left-it)return{x:n.left,y:t.y};if(t.x>n.right+it)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(gt(t,e,it)){if(e.x<n.left-it||e.x>n.right+it)return e;if(o){if(t.y<n.top-it)return{x:t.x,y:n.top};if(t.y>n.bottom+it)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(Tn,"snapEndpointToBoundary");function qe(t,e,n){const o=t[e];for(let s=e+n;s>=0&&s<t.length;s+=n){const r=t[s];if(!ce(r,o,it))return r}return t[e+n]}l(qe,"firstDistinctAdjacent");function Ze(t,e){const n=t+To,o=e-To;return n<=o?{lo:n,hi:o}:{lo:(t+e)/2,hi:(t+e)/2}}l(Ze,"cornerClearanceRange");function wn(t,e,n){const{lo:o,hi:s}=Ze(e,n);return Math.min(s,Math.max(o,t))}l(wn,"clampToCornerClearance");function zo(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(zo,"intersectRanges");function En(t,e){return e==="left"||e==="right"?Ze(t.top,t.bottom):Ze(t.left,t.right)}l(En,"clearanceRangeForSide");function Je(t,e,n){const o=t.y>=n.top-it&&t.y<=n.bottom+it,s=t.x>=n.left-it&&t.x<=n.right+it;if(xt(t,e,it)&&o){if(Math.abs(t.x-n.left)<it)return"left";if(Math.abs(t.x-n.right)<it)return"right"}if(gt(t,e,it)&&s){if(Math.abs(t.y-n.top)<it)return"top";if(Math.abs(t.y-n.bottom)<it)return"bottom"}}l(Je,"terminalSideForSegment");function Pe(t){return t==="left"||t==="right"}l(Pe,"isHorizontalSide");function $o(t,e,n,o,s){const r=[],a=n?Je(t,e,n):void 0,c=o?Je(e,t,o):void 0;return n&&a&&Pe(a)===s&&r.push(En(n,a)),o&&c&&Pe(c)===s&&r.push(En(o,c)),r.length>0?zo(r):void 0}l($o,"straightClearanceRange");function An(t,e,n,o,s){const r=$o(t,e,n,o,s);if(!r)return;const a=s?t.y:t.x,c=Math.min(r.hi,Math.max(r.lo,a));if(!(Math.abs(c-a)<it))return s?[{x:t.x,y:c},{x:e.x,y:c}]:[{x:c,y:t.y},{x:c,y:e.y}]}l(An,"clearStraightEndpointCornerAxis");function lo(t,e,n){if(t.length!==2)return t;const[o,s]=t;return xt(o,s,it)?An(o,s,e,n,!0)??t:gt(o,s,it)?An(o,s,e,n,!1)??t:t}l(lo,"clearStraightEndpointCornerConnections");function Vo(t,e,n){return Pe(n)?{x:t.x,y:wn(t.y,e.top,e.bottom)}:{x:wn(t.x,e.left,e.right),y:t.y}}l(Vo,"cornerClearedEndpoint");function jo(t,e,n,o,s,r){const a=t.map(c=>({...c}));for(let c=e;c>=0&&c<t.length;c+=n){const u=t[c];if(r&&!xt(u,o,it)||!r&&!gt(u,o,it))break;r?a[c].y=s.y:a[c].x=s.x}return a}l(jo,"moveCollinearEndpointRun");function Rn(t,e,n){if(t.length<2)return t;const o=n?0:t.length-1,s=n?1:-1,r=t[o],a=qe(t,o,s);if(!a)return t;const c=Je(r,a,e);if(!c)return t;const u=Pe(c),m=Vo(r,e,c);return ce(r,m,it)?t:jo(t,o,s,r,m,u)}l(Rn,"clearEndpointCornerConnection");function Nn(t,e,n){const o=Math.min(t.x,e.x)>=n.left-it&&Math.max(t.x,e.x)<=n.right+it,s=Math.min(t.y,e.y)>=n.top-it&&Math.max(t.y,e.y)<=n.bottom+it;if(Math.abs(t.y-n.top)<it&&Math.abs(e.y-n.top)<it&&o)return"top";if(Math.abs(t.y-n.bottom)<it&&Math.abs(e.y-n.bottom)<it&&o)return"bottom";if(Math.abs(t.x-n.left)<it&&Math.abs(e.x-n.left)<it&&s)return"left";if(Math.abs(t.x-n.right)<it&&Math.abs(e.x-n.right)<it&&s)return"right"}l(Nn,"borderSideForSegment");function On(t,e,n,o){switch(t){case"top":return gt(e,n,it)&&n.y<o.top-it;case"bottom":return gt(e,n,it)&&n.y>o.bottom+it;case"left":return xt(e,n,it)&&n.x<o.left-it;case"right":return xt(e,n,it)&&n.x>o.right+it}}l(On,"leavesOutward");function Bn(t,e,n){if(t.length<3)return t;if(n){const r=Nn(t[0],t[1],e);return r&&On(r,t[1],t[2],e)?t.slice(1):t}const o=t.length-1,s=Nn(t[o-1],t[o],e);return s&&On(s,t[o-1],t[o-2],e)?t.slice(0,o):t}l(Bn,"collapseOwnBorderStub");function Uo(t,e,n){let o=t;if(e){const r=qe(o,0,1);if(r){const a=Tn(r,o[0],e);a!==o[0]&&(o=[a,...o.slice(1)])}o=Bn(o,e,!0)}if(n){const r=o.length-1,a=qe(o,r,-1);if(a){const c=Tn(a,o[r],n,!0);c!==o[r]&&(o=[...o.slice(0,r),c])}o=Bn(o,n,!1)}const s=lo(o,e,n);return s!==o||o.length===2?s:(e&&(o=Rn(o,e,!0)),n&&(o=Rn(o,n,!1)),o)}l(Uo,"snapAndCollapseEndpoints");function Pn(t,e){for(const n of t){const o=ao(n,e,2);if(!o)continue;const s=pt(o.points,it),r=Uo(s,o.srcRect,o.dstRect);if(r.length<3){o.edge.points=r;continue}const a=[r[0],{...r[0]},...r.slice(1,-1),r[r.length-1],{...r[r.length-1]}];o.edge.points=a}}l(Pn,"prepareEdgeEndpointsForRenderer");function fo(t){return new Map(t.map(e=>[e.id,e]))}l(fo,"buildNodeMap");function Wo(t,e){let n=t.parentId,o=null;for(;n;){const s=e.get(n);if(!(s!=null&&s.isGroup))break;o=s.id,n=s.parentId}return o}l(Wo,"resolveTopLevelGroupId");function kn(t,e){let n=0,o=t.parentId;for(;o;){const s=e.get(o);if(!(s!=null&&s.isGroup))break;n++,o=s.parentId}return n}l(kn,"groupDepth");function uo(t){let e=1/0,n=-1/0,o=1/0,s=-1/0;for(const r of t){const a=r.x,c=r.y;if(typeof a!="number"||typeof c!="number")continue;const u=r.width??0,m=r.height??0;e=Math.min(e,a-u/2),n=Math.max(n,a+u/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(uo,"boundsForChildren");function Ko(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(Ko,"applyGroupBounds");function qo(t){const e=fo(t),n=t.filter(o=>o.isGroup&&o.parentId).sort((o,s)=>kn(s,e)-kn(o,e));for(const o of n){const s=t.filter(a=>a.parentId===o.id),r=uo(s);r&&Ko(o,r)}}l(qo,"recomputeNestedGroupBounds");function Qe(t,e){const n=t.nodes??[],o=t.edges??[],s=n.filter(u=>!u.isGroup);let r=1/0,a=-1/0;for(const u of s){const m=u[e];typeof m=="number"&&(r=Math.min(r,m),a=Math.max(a,m))}if(!Number.isFinite(r)||!Number.isFinite(a))return!1;const c=l(u=>r+a-u,"mirror");for(const u of n){const m=u[e];typeof m=="number"&&(u[e]=c(m));const p=u.groupTitleRect;p&&(u.groupTitleRect=e==="x"?{...p,left:c(p.right),right:c(p.left)}:{...p,top:c(p.bottom),bottom:c(p.top)})}for(const u of o)for(const m of u.points??[])m[e]=c(m[e]);return!0}l(Qe,"mirrorAxis");function Zo(t){return(t.nodes??[]).some(n=>!n.isGroup)?Qe(t,"y"):!0}l(Zo,"applyBtDirectionTransform");function Jo(t,e="LR"){const n=t.nodes??[],o=t.edges??[],s=n.filter(B=>!B.isGroup);let r=1/0,a=1/0;for(const B of s){const G=B.x??0,j=B.y??0;G<r&&(r=G),j<a&&(a=j)}if(!Number.isFinite(r)||!Number.isFinite(a))return!1;const c=36;let u=0,m=0;for(const B of s)u+=B.width??0,m+=B.height??0;const p=u/s.length,g=m/s.length,S=g>0?Math.max(1,p/g):1;for(const B of s){const G=B.x??0,tt=((B.y??0)-a)*S+c,ft=G-r;B.x=tt,B.y=ft}for(const B of o)if(B.points)for(const G of B.points){const j=G.x,ft=(G.y-a)*S+c,It=j-r;G.x=ft,G.y=It}qo(n);const f=n.filter(B=>B.isGroup&&!B.parentId);if(f.length===0)return e==="RL"&&Qe(t,"x"),!0;const d=fo(n),i=new Map;for(const B of n){if(B.isGroup)continue;const G=Wo(B,d);if(!G)continue;const j=i.get(G)??[];j.push(B),i.set(G,j)}let y=0;for(const B of f){const G=B.padding??0;G>y&&(y=G)}const C=[];let b=1/0,L=-1/0;for(const B of f){const G=i.get(B.id)??[],j=uo(G);j&&(b=Math.min(b,j.minX),L=Math.max(L,j.maxX),C.push({lane:B,contentTop:j.minY,contentBottom:j.maxY,centerY:(j.minY+j.maxY)/2}))}if(b===1/0||L===-1/0)return!0;const v=Math.max(0,L-b),x=Math.max(y,10),I=v+2*x,T=c+I,O=(b+L)/2-I/2-c,k=O+T/2,D=Math.max(y,c);C.sort((B,G)=>B.centerY-G.centerY);for(let B=0;B<C.length;B++){const G=C[B];let j,tt;if(B===0?j=G.contentTop-D:j=(C[B-1].contentBottom+G.contentTop)/2,B===C.length-1)tt=G.contentBottom+D;else{const Dt=C[B+1];tt=(G.contentBottom+Dt.contentTop)/2}const ft=Math.max(0,tt-j),It=(j+tt)/2;G.lane.x=k,G.lane.y=It,G.lane.width=T,G.lane.height=ft,G.lane.swimlaneContentTop=G.contentTop,G.lane.groupTitleRect={left:O,right:O+c,top:j,bottom:tt}}return e==="RL"&&Qe(t,"x"),!0}l(Jo,"applyLrDirectionTransform");var ae=1e-6,gr=8,Ge=gr,mr=[0,Ge,-Ge,2*Ge,-2*Ge];function Qo(t,e){const{nodeInfoById:n,realNodeRects:o}=on(e);for(const s of t){if(s.isLayoutOnly)continue;const r=s.points;if(!r||r.length<4)continue;const a=no(pt(r,ae),ae);if(!a)continue;const{p3:c}=a,u=a.kind==="HVH",m=io(s,n,ae);if(!m)continue;const{srcId:p,dstId:g,srcInfo:S,dstInfo:f,collinearX:d,collinearY:i}=m;if(d||i)continue;let y;const C=S.rect;for(const b of mr){let L,v,x;if(u){const k=f.cy>S.cy?C.bottom:C.top,D=S.cx+b;if(D<=C.left+ae||D>=C.right-ae)continue;L={x:D,y:k},v={x:D,y:c.y},x={x:c.x,y:c.y}}else{const k=f.cx>S.cx?C.right:C.left,D=S.cy+b;if(D<=C.top+ae||D>=C.bottom-ae)continue;L={x:k,y:D},v={x:c.x,y:D},x={x:c.x,y:c.y}}const I=ce(L,v,ae),T=ce(v,x,ae);if(I&&T||!I&&Bt(L,v,o,[p],1)||!T&&Bt(v,x,o,[g],1))continue;const A=!I&&We(L,v,t,s,{epsilon:ae,skipDegenerateOther:!0}),P=!T&&We(v,x,t,s,{epsilon:ae,skipDegenerateOther:!0});if(!(A||P)){I?y=[v,x]:T?y=[L,v]:y=[L,v,x];break}}y&&(s.points=y)}}l(Qo,"portSwapToLShape");function ts(t,e){const{realNodeRects:r,labelNodeRects:a}=be(e.values());for(const c of t){if(c.isLayoutOnly)continue;const u=c.points;if(!u||u.length<4)continue;const m=pt(u,.001);if(m.length<4)continue;const p=m.length-1,g=m[p],S=m[p-1],f=m[p-2],d=g.x-S.x,i=g.y-S.y,y=Math.hypot(d,i);if(y>=10||y<.001)continue;const C=S.x-f.x,b=S.y-f.y;if(Math.hypot(C,b)<.001)continue;const v=Nt(S,g,.001),x=Ot(S,g,.001),I=Nt(f,S,.001),T=Ot(f,S,.001);if(!(v&&T||x&&I))continue;const A=c.end,P=c.start,O=A?e.get(A):void 0;if(!O)continue;const k=O.x??0,D=O.y??0,B=te(O);if(!B)continue;let G,j;if(T){const Z=b<0;G={x:k,y:f.y},j={x:k,y:Z?B.bottom:B.top}}else{const Z=C>0;G={x:f.x,y:D},j={x:Z?B.right:B.left,y:D}}if(Bt(G,j,r,A?[A]:[],-2)||Bt(G,j,a,[],-2))continue;if(P){const Z=e.get(P),rt=Z?te(Z):void 0;if(rt&&oo(G,rt,2))continue}const tt=l((Z,rt)=>`${Z.x.toFixed(3)},${Z.y.toFixed(3)}|${rt.x.toFixed(3)},${rt.y.toFixed(3)}`,"ownSegmentKey"),ft=new Set;for(let Z=0;Z<m.length-1;Z++)ft.add(tt(m[Z],m[Z+1]));const It=l((Z,rt)=>{for(const ut of t){if(ut===c||ut.isLayoutOnly)continue;const yt=ut.points;if(!(!yt||yt.length<2))for(let St=0;St<yt.length-1;St++){const Et=yt[St],Kt=yt[St+1];if(!ft.has(tt(Et,Kt))&&ue(Z,rt,Et,Kt,.001))return!0}}return!1},"segmentCrossesOtherEdge");if(It(G,j))continue;if(p-3>=0){const Z=m[p-3],rt=[P,A].filter(ut=>!!ut);if(Bt(Z,G,r,rt,-2)||It(Z,G))continue}const _t=[...m.slice(0,p-2),G,j];c.points=_t;const nt=c.labelNodeId;if(nt){const Z=e.get(nt);if(Z){const rt=Z.width??0,ut=Z.height??0;if(rt>0&&ut>0){let yt,St,Et=-1;for(let Kt=0;Kt<_t.length-1;Kt++){const qt=_t[Kt],Zt=_t[Kt+1],se=Math.hypot(Zt.x-qt.x,Zt.y-qt.y),Le=xt(qt,Zt,.001),ge=gt(qt,Zt,.001);(Le&&se>=rt+2||ge&&se>=ut+2)&&se>Et&&(Et=se,yt=(qt.x+Zt.x)/2,St=(qt.y+Zt.y)/2)}yt!==void 0&&St!==void 0&&(Z.x=yt,Z.y=St)}}}}}l(ts,"collapseShortTerminalStub");var et=.001,Xt=8,es=l(t=>typeof t=="string"?t.toUpperCase():"","upperCaseDirection"),at=Oe,pn=l((t,e)=>gt(t,e,et)||xt(t,e,et),"orthogonallyAligned");function Fn(t,e){const s=l((f,d)=>{const i=f.x??0,y=f.y??0,C=d.x-i,b=d.y-y;let L=(f.width??0)/2,v=(f.height??0)/2;return Math.abs(b)*L>Math.abs(C)*v?(b<0&&(v=-v),{x:i+(b===0?0:v*C/b),y:y+v}):(C<0&&(L=-L),{x:i+L,y:y+(C===0?0:L*b/C)})},"rectIntersect"),r=l((f,d)=>{const i=pt(f.points??[]);if(i.length<2)return;const y=d?f.start:f.end,C=y?e.get(y):void 0,b=C?te(C):void 0;if(!C||!y||!b)return;const L=d?i[0]:i[i.length-1],v=d?i[1]:i[i.length-2],x=s(C,L);let I=L;if(pn(v,x)&&(I=v),gt(x,I,et))return{edge:f,edgeId:String(f.id??""),nodeId:y,atStart:d,orientation:"V",coord:x.x,min:Math.min(x.y,I.y),max:Math.max(x.y,I.y),boundary:x,railEnd:I,rect:b};if(xt(x,I,et))return{edge:f,edgeId:String(f.id??""),nodeId:y,atStart:d,orientation:"H",coord:x.y,min:Math.min(x.x,I.x),max:Math.max(x.x,I.x),boundary:x,railEnd:I,rect:b}},"terminalLaneFor"),a=l((f,d)=>Math.max(0,Math.min(f.max,d.max)-Math.max(f.min,d.min)),"projectedOverlapLength"),c=l((f,d)=>f.nodeId!==d.nodeId||f.orientation!==d.orientation?!1:f.orientation==="H"?(Math.abs(f.boundary.x-f.rect.left)<1||Math.abs(f.boundary.x-f.rect.right)<1)&&gt(f.boundary,d.boundary,1):(Math.abs(f.boundary.y-f.rect.top)<1||Math.abs(f.boundary.y-f.rect.bottom)<1)&&xt(f.boundary,d.boundary,1),"sameTerminalFace"),u=l((f,d)=>f.nodeId!==d.nodeId||f.orientation!==d.orientation?!1:a(f,d)>=Xt&&Math.abs(f.coord-d.coord)<.5,"exactTerminalLaneConflict"),m=l((f,d)=>{if(f.nodeId!==d.nodeId||f.orientation!==d.orientation||f.orientation!=="H"||f.atStart===d.atStart)return!1;const i=a(f,d);if(i<Xt)return!1;const y=f.rect.bottom-f.rect.top;return i<y||i>2*y?!1:c(f,d)&&Math.abs(f.coord-d.coord)<16},"nearTerminalLaneConflict"),p=l((f,d)=>{const i=pt(f.edge.points??[]);if(i.length<2)return;const y=f.orientation==="V"?{x:f.boundary.x+d,y:f.boundary.y}:{x:f.boundary.x,y:f.boundary.y+d},C=f.orientation==="V"?{x:f.railEnd.x+d,y:f.railEnd.y}:{x:f.railEnd.x,y:f.railEnd.y+d};if(!l(()=>Math.abs(f.boundary.y-f.rect.top)<1||Math.abs(f.boundary.y-f.rect.bottom)<1?xt(y,f.boundary,et)&&y.x>=f.rect.left+1&&y.x<=f.rect.right-1:Math.abs(f.boundary.x-f.rect.left)<1||Math.abs(f.boundary.x-f.rect.right)<1?gt(y,f.boundary,et)&&y.y>=f.rect.top+1&&y.y<=f.rect.bottom-1:!1,"boundaryStaysOnSameFace")())return;if(f.atStart){const I=i.length>1&&ce(i[1],f.railEnd,et),T=i.slice(I?2:1),A=T[0];return A&&!pn(A,C)?void 0:[y,C,...T]}const L=i.length>1&&ce(i[i.length-2],f.railEnd,et),v=i.slice(0,L?-2:-1),x=v[v.length-1];if(!(x&&!pn(x,C)))return[...v,C,y]},"shiftedCandidate"),g=l(f=>{const d=f.edge,i=pt(d.points??[]);if(i.length!==2)return!1;const y=d.start,C=d.end,b=y?e.get(y):void 0,L=C?e.get(C):void 0;if(!b||!L)return!1;const v=b.x??0,x=b.y??0,I=L.x??0,T=L.y??0,[A,P]=i;return xt(A,P,et)&&Math.abs(x-T)<1&&Math.abs(v-I)>1||gt(A,P,et)&&Math.abs(v-I)<1&&Math.abs(x-T)>1},"laneIsStraightCollinearConnector"),S=[-7,7,-14,14,-21,21];for(let f=0;f<8;f++){const d=t.filter(y=>!y.isLayoutOnly).flatMap(y=>[r(y,!0),r(y,!1)]).filter(y=>!!y);let i=!1;for(let y=0;y<d.length&&!i;y++)for(let C=y+1;C<d.length&&!i;C++){const b=d[y],L=d[C];if(b.edge===L.edge||!(u(b,L)||m(b,L)))continue;const v=!u(b,L),x=[b,L].sort((I,T)=>{const A=g(I),P=g(T);return A!==P?Number(A)-Number(P):+!T.atStart-+!I.atStart});for(const I of x){for(const T of S){const A=p(I,T);if(!A)continue;const P=r({...I.edge,points:A},I.atStart);if(!(!P||d.some(O=>O.edge!==I.edge&&(u(P,O)||v&&m(P,O))))){I.edge.points=A,i=!0;break}}if(i)break}}if(!i)return}}l(Fn,"separateSharedRenderedTerminalLanes");function ns(t,e){const{realNodeRects:o,labelNodeRects:s}=be(e.values()),r=l((c,u)=>{const m=c.start,p=c.end,g=at(u);if(g.length!==u.length-1)return!1;const S=[m,p].filter(f=>!!f);for(const f of g)if(Bt(f.a,f.b,o,S,-2)||Bt(f.a,f.b,s,[],-2))return!1;for(const f of t){if(f===c||f.isLayoutOnly)continue;const d=f.points;if(!(!d||d.length<2)){for(const i of g)for(const y of at(pt(d)))if(fe(i,y,.5)>=Xt||ue(i.a,i.b,y.a,y.b,et))return!1}}return!0},"candidateIsSafe"),a=l((c,u)=>{if(u+4>=c.length)return;const m=c[u],p=c[u+1],g=c[u+2],S=c[u+3],f=c[u+4],d=Nt(m,p)&&Ot(p,g)&&Nt(g,S)&&Ot(S,f)&&gt(m,S,et)&&gt(m,f,et)&&gt(p,g,et)&&(p.x-m.x)*(S.x-g.x)<0,i=Ot(m,p)&&Nt(p,g)&&Ot(g,S)&&Nt(S,f)&&xt(m,S,et)&&xt(m,f,et)&&xt(p,g,et)&&(p.y-m.y)*(S.y-g.y)<0;if(d||i)return pt([...c.slice(0,u+1),f,...c.slice(u+5)]);if(u+5>=c.length)return;const y=c[u+5],C=Ot(m,p)&&Nt(p,g)&&Ot(g,S)&&Nt(S,f)&&Ot(f,y)&&gt(m,f,et)&&gt(m,y,et)&&gt(g,S,et)&&(g.x-p.x)*(f.x-S.x)<0,b=Nt(m,p)&&Ot(p,g)&&Nt(g,S)&&Ot(S,f)&&Nt(f,y)&&xt(m,f,et)&&xt(m,y,et)&&xt(g,S,et)&&(g.y-p.y)*(f.y-S.y)<0;if(!(!C&&!b))return pt([...c.slice(0,u+1),y,...c.slice(u+6)])},"withoutDogleg");for(let c=0;c<8;c++){let u=!1;for(const m of t){if(m.isLayoutOnly)continue;const p=pt(m.points??[]);for(let g=0;g<=p.length-5;g++){const S=a(p,g);if(!(!S||!r(m,S))){m.points=S,u=!0;break}}if(u)break}if(!u)return}}l(ns,"collapseRedundantRectangularDoglegs");function _n(t,e){const{realNodeRects:r,labelNodeRects:a}=be(e.values()),c=t.filter(d=>!d.isLayoutOnly),u=l((d,i,y)=>pt(d===i?y??[]:d.points??[]),"pointsFor"),m=l((d,i)=>{let y=0;for(let C=0;C<c.length;C++){const b=at(u(c[C],d,i));for(let L=C+1;L<c.length;L++){const v=at(u(c[L],d,i));for(const x of b)for(const I of v)ue(x.a,x.b,I.a,I.b,et)&&y++}}return y},"strictCrossingCount"),p=l(d=>{const i=at(d);if(i.length!==3)return;const y=i[1];if(!(i[0].horizontal===y.horizontal||i[2].horizontal===y.horizontal))return{index:y.index,horizontal:y.horizontal,vertical:y.vertical,segment:y}},"middleRail"),g=l((d,i)=>{const y=[d.start,d.end].filter(C=>!!C);return r.filter(C=>{if(y.includes(C.id))return!1;const b=C.rect;return i.horizontal?Wt(i.a.x,i.b.x,b.left,b.right)>=Xt&&i.a.y>=b.top-2&&i.a.y<=b.bottom+2:Wt(i.a.y,i.b.y,b.top,b.bottom)>=Xt&&i.a.x>=b.left-2&&i.a.x<=b.right+2})},"blockingRectsFor"),S=l((d,i,y)=>{const C=d.map(L=>({...L}));if(i.horizontal)C[i.index].y=y,C[i.index+1].y=y;else if(i.vertical)C[i.index].x=y,C[i.index+1].x=y;else return;const b=de(pt(C));return at(b).length===b.length-1?b:void 0},"candidateByMovingRail"),f=l((d,i,y)=>{const C=[d.start,d.end].filter(L=>!!L),b=at(i);if(b.length!==i.length-1)return!1;for(const L of b)if(Bt(L.a,L.b,r,C,-2)||Bt(L.a,L.b,a,[],-2))return!1;for(const L of c)if(L!==d){for(const v of b)for(const x of at(u(L)))if(fe(v,x,.5)>=Xt)return!1}return m(d,i)<=y},"candidateIsSafe");for(let d=0;d<8;d++){const i=m();let y=!1;for(const C of c){const b=u(C),L=p(b);if(!L)continue;const v=g(C,L.segment);if(v.length===0)continue;const x=L.horizontal?[Math.min(...v.map(I=>I.rect.top))-20,Math.max(...v.map(I=>I.rect.bottom))+20]:[Math.min(...v.map(I=>I.rect.left))-20,Math.max(...v.map(I=>I.rect.right))+20];for(const I of x){const T=S(b,L.segment,I);if(!(!T||!f(C,T,i))){C.points=T,y=!0;break}}if(y)break}if(!y)return}}l(_n,"liftObstacleHuggingSameSideRails");function Hn(t,e,n){const s=l(m=>{const p=m.groupTitleRect;if(!(!p||typeof p.left!="number"||typeof p.right!="number"||typeof p.top!="number"||typeof p.bottom!="number"||!Number.isFinite(p.left)||!Number.isFinite(p.right)||!Number.isFinite(p.top)||!Number.isFinite(p.bottom)||p.right<=p.left||p.bottom<=p.top))return{left:p.left,right:p.right,top:p.top,bottom:p.bottom}},"validTitleRect"),r=l(m=>{if(!m.isGroup||m.parentId)return;const p=es(m.direction??n);if(p==="LR"||p==="RL"||p==="BT")return;const g=s(m),S=m.y,f=m.height;if(!g||typeof S!="number"||typeof f!="number"||!Number.isFinite(S)||!Number.isFinite(f)||f<=0)return;const d=g.right-g.left,i=g.bottom-g.top;if(!(i<=0||d<i))return{node:m,rect:g}},"topLaneTitleFor"),a=l((m,p)=>{if(!m.horizontal)return!1;const g=m.a.y;return g<p.top-et||g>p.bottom+et?!1:Wt(m.a.x,m.b.x,p.left,p.right)>=Xt},"horizontalSegmentIntersectsTitle"),c=[...e.values()].map(r).filter(m=>!!m);if(c.length===0)return;let u=0;for(const m of t){if(m.isLayoutOnly)continue;const p=pt(m.points??[]);for(const g of at(p))for(const S of c)a(g,S.rect)&&(u=Math.max(u,S.rect.bottom-g.a.y+4))}if(!(u<=et))for(const m of c){const p=m.node.y,g=m.node.height;typeof p!="number"||typeof g!="number"||!Number.isFinite(p)||!Number.isFinite(g)||g<=0||(m.node.y=p-u/2,m.node.height=g+u,m.node.groupTitleRect={...m.rect,top:m.rect.top-u,bottom:m.rect.bottom-u})}}l(Hn,"liftTopLaneTitleBandsAboveRails");function Dn(t,e,n){const s=l(p=>{const g=p.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(p=>{if(!p.isGroup||p.parentId||es(p.direction??n)!=="LR")return;const S=s(p),f=p.x,d=p.width;if(!S||typeof f!="number"||typeof d!="number"||!Number.isFinite(f)||!Number.isFinite(d)||d<=0)return;const i=S.right-S.left,y=S.bottom-S.top;if(!(i<=0||y<i))return{node:p,rect:S}},"leftLaneTitleFor"),a=l((p,g)=>{if(!p.vertical)return!1;const S=p.a.x;return S<g.left-et||S>g.right+et?!1:Wt(p.a.y,p.b.y,g.top,g.bottom)>=Xt},"verticalSegmentIntersectsTitle"),c=l((p,g)=>{if(!p.horizontal)return!1;const S=p.a.y;return S<g.top-et||S>g.bottom+et?!1:Wt(p.a.x,p.b.x,g.left,g.right)>=Xt},"horizontalSegmentIntersectsTitle"),u=[...e.values()].map(r).filter(p=>!!p);if(u.length===0)return;let m=0;for(const p of t){if(p.isLayoutOnly)continue;const g=pt(p.points??[]);for(const S of at(g))for(const f of u)if(a(S,f.rect))m=Math.max(m,f.rect.right-S.a.x+4);else if(c(S,f.rect)){const d=Math.min(S.a.x,S.b.x);m=Math.max(m,f.rect.right-d+4)}}if(!(m<=et))for(const p of u){const g=p.node.x,S=p.node.width;typeof g!="number"||typeof S!="number"||!Number.isFinite(g)||!Number.isFinite(S)||S<=0||(p.node.x=g-m/2,p.node.width=S+m,p.node.groupTitleRect={...p.rect,left:p.rect.left-m,right:p.rect.right-m})}}l(Dn,"shiftLeftLaneTitleBandsLeftOfRails");function os(t,e){const{realNodeRects:o}=be(e.values()),s=t.filter(d=>!d.isLayoutOnly),r=l((d,i=new Map)=>pt(i.get(d)??d.points??[]),"replacementPointsFor"),a=l((d=new Map)=>{let i=0;for(let y=0;y<s.length;y++){const C=at(r(s[y],d));for(let b=y+1;b<s.length;b++){const L=at(r(s[b],d));for(const v of C)for(const x of L)ue(v.a,v.b,x.a,x.b,et)&&i++}}return i},"crossingCount"),c=l((d=new Map)=>s.reduce((i,y)=>i+oe(r(y,d)),0),"totalBends"),u=l(d=>{const i=r(d);if(i.length<4)return;const y=i[i.length-2],C=i[i.length-1];if(!(!Nt(y,C,et)&&!Ot(y,C,et)))return{tailStart:y,terminal:C}},"terminalTailFor"),m=l((d,i)=>{const y=r(d);if(y.length<3)return;const C=y[0],b=y[1];let L;if(Nt(C,b,et))L={x:b.x,y:i.tailStart.y};else if(Ot(C,b,et))L={x:i.tailStart.x,y:b.y};else return;const v=de(pt([C,b,L,i.tailStart,i.terminal]));return at(v).length===v.length-1?v:void 0},"candidateWithDestinationTail"),p=l((d,i)=>{const y=[d.start,d.end].filter(C=>!!C);for(const C of at(i))if(Bt(C.a,C.b,o,y,-2))return!0;return!1},"pathHasNodeHit"),g=l((d,i,y)=>{for(const C of s)if(C!==d){for(const b of at(i))for(const L of at(r(C,y)))if(fe(b,L,.5)>=Xt)return!0}return!1},"pathHasSharedTrack"),S=l((d,i,y)=>!p(d,i)&&!g(d,i,y),"candidateIsSafe"),f=l(()=>{const d=new Map;for(const i of s){const y=i.end;if(!y||!e.has(y)||r(i).length<4)continue;const b=d.get(y)??[];b.push(i),d.set(y,b)}return d},"edgesByDestination");for(let d=0;d<4;d++){const i=a();if(i===0)return;const y=c();let C,b=i,L=y;for(const v of f().values())for(let x=0;x<v.length;x++)for(let I=x+1;I<v.length;I++){const T=v[x],A=v[I],P=u(T),O=u(A);if(!P||!O)continue;const k=m(T,O),D=m(A,P);if(!k||!D)continue;const B=new Map([[T,k],[A,D]]);if(!S(T,k,B)||!S(A,D,B))continue;const G=a(B),j=c(B);G>=i||G>b||G===b&&j>=L||(C=B,b=G,L=j)}if(!C)return;for(const[v,x]of C)v.points=x}}l(os,"swapDestinationTerminalTailsToReduceCrossings");function ss(t,e){const{realNodeRects:r,labelNodeRects:a}=be(e.values()),c=t.filter(v=>!v.isLayoutOnly),u=l((v,x=new Map)=>pt(x.get(v)??v.points??[]),"replacementPointsFor"),m=l((v=new Map)=>{let x=0;for(let I=0;I<c.length;I++){const T=at(u(c[I],v));for(let A=I+1;A<c.length;A++){const P=at(u(c[A],v));for(const O of T)for(const k of P)ue(O.a,O.b,k.a,k.b,et)&&x++}}return x},"strictCrossingCount"),p=l((v=new Map)=>c.reduce((x,I)=>x+oe(u(I,v)),0),"totalBends"),g=l(v=>{const x=v.start,I=v.end,T=x?e.get(x):void 0,A=I?e.get(I):void 0,P=T?te(T):void 0,O=A?te(A):void 0;return P&&O?{src:P,dst:O}:void 0},"endpointRectsFor"),S=l((v,x,I)=>{if(I.index<=0||I.index+1>=x.length-1)return;const T=g(v);if(T){if(I.vertical){const A=I.a.x,P=Math.min(T.src.left,T.dst.left),O=Math.max(T.src.right,T.dst.right),k=A<P-et?"left":A>O+et?"right":void 0;return k?{edge:v,points:x,segmentIndex:I.index,axis:"vertical",side:k,coord:A,min:Math.min(I.a.y,I.b.y),max:Math.max(I.a.y,I.b.y)}:void 0}if(I.horizontal){const A=I.a.y,P=Math.min(T.src.top,T.dst.top),O=Math.max(T.src.bottom,T.dst.bottom),k=A<P-et?"top":A>O+et?"bottom":void 0;return k?{edge:v,points:x,segmentIndex:I.index,axis:"horizontal",side:k,coord:A,min:Math.min(I.a.x,I.b.x),max:Math.max(I.a.x,I.b.x)}:void 0}}},"externalRailForSegment"),f=l(()=>{const v=[];for(const x of c){const I=u(x);for(const T of at(I)){const A=S(x,I,T);A&&v.push(A)}}return v},"collectExternalRails"),d=l((v,x)=>v.edge!==x.edge&&v.axis===x.axis&&v.side===x.side&&Wt(v.min,v.max,x.min,x.max)>=Xt,"railsInteract"),i=l(v=>{const x=[],I=new Set;for(const T of v){if(I.has(T))continue;const A=[T],P=[];for(I.add(T);A.length>0;){const O=A.pop();P.push(O);for(const k of v)!I.has(k)&&d(O,k)&&(I.add(k),A.push(k))}P.length>1&&x.push(P)}return x},"connectedComponents"),y=l(v=>{const x=[];for(const I of v)x.some(T=>Math.abs(T-I.coord)<et)||x.push(I.coord);for(;x.length<v.length;){const I=Math.min(...x),T=Math.max(...x),A=v[0].side;x.push(A==="left"||A==="top"?I-12*(v.length-x.length):T+12*(v.length-x.length))}return x},"uniqueCoordsFor"),C=l(v=>{const x=v.map(A=>A.coord),I=y(v),T=[];if(v.length<=6){const A=new Array(I.length).fill(!1),P=[],O=l(()=>{if(P.length===v.length){P.some((k,D)=>Math.abs(k-x[D])>=et)&&T.push([...P]);return}for(const[k,D]of I.entries())A[k]||(A[k]=!0,P.push(D),O(),P.pop(),A[k]=!1)},"visit");return O(),T}for(let A=0;A<x.length;A++)for(let P=A+1;P<x.length;P++){const O=[...x];[O[A],O[P]]=[O[P],O[A]],T.push(O)}return T},"coordinateAssignmentsFor"),b=l((v,x)=>{const I=new Map;for(const[A,P]of v.entries()){const O=x[A],k=I.get(P.edge)??P.points.map(D=>({x:D.x,y:D.y}));P.axis==="vertical"?(k[P.segmentIndex].x=O,k[P.segmentIndex+1].x=O):(k[P.segmentIndex].y=O,k[P.segmentIndex+1].y=O),I.set(P.edge,k)}const T=new Map;for(const[A,P]of I){const O=de(pt(P));if(at(O).length!==O.length-1)return;T.set(A,O)}return T},"replacementsForAssignment"),L=l(v=>{for(const[x,I]of v){const T=[x.start,x.end].filter(A=>!!A);for(const A of at(I))if(Bt(A.a,A.b,r,T,-2)||Bt(A.a,A.b,a,[],-2))return!1}for(let x=0;x<c.length;x++){const I=c[x],T=v.has(I),A=at(u(I,v));for(let P=x+1;P<c.length;P++){const O=c[P];if(!T&&!v.has(O))continue;const k=at(u(O,v));for(const D of A)for(const B of k)if(fe(D,B,.5)>=Xt)return!1}}return!0},"candidateIsSafe");for(let v=0;v<4;v++){const x=m();if(x===0)return;let I,T=x,A=p(),P=Number.POSITIVE_INFINITY;for(const O of i(f()))for(const k of C(O)){const D=b(O,k);if(!D||!L(D))continue;const B=m(D);if(B>=x)continue;const G=p(D),j=O.reduce((tt,ft,It)=>tt+Math.abs(k[It]-ft.coord),0);B>T||B===T&&(G>A||G===A&&j>=P)||(I=D,T=B,A=G,P=j)}if(!I)return;for(const[O,k]of I)O.points=k}}l(ss,"reassignCrossingExternalRailChannels");function rs(t,e){const{realNodeRects:o,labelNodeRects:s}=be(e.values()),r=t.filter(f=>!f.isLayoutOnly),a=l((f,d,i)=>pt(f===d?i??[]:f.points??[]),"pointsFor"),c=l(f=>at(f).reduce((d,i)=>{const y=i.a.x-i.b.x,C=i.a.y-i.b.y;return d+Math.hypot(y,C)},0),"pathLength"),u=l((f,d)=>{let i=0;for(let y=0;y<r.length;y++){const C=at(a(r[y],f,d));for(let b=y+1;b<r.length;b++){const L=at(a(r[b],f,d));for(const v of C)for(const x of L)ue(v.a,v.b,x.a,x.b,et)&&i++}}return i},"strictCrossingCount"),m=l((f,d)=>{if(f.horizontal){const i=f.a.y;return(Math.abs(i-d.top)<1||Math.abs(i-d.bottom)<1)&&Wt(f.a.x,f.b.x,d.left,d.right)>=Xt}if(f.vertical){const i=f.a.x;return(Math.abs(i-d.left)<1||Math.abs(i-d.right)<1)&&Wt(f.a.y,f.b.y,d.top,d.bottom)>=Xt}return!1},"segmentRunsAlongRectBorder"),p=l(f=>{const d=[f.start,f.end].filter(y=>!!y),i=[];for(const y of d){const C=e.get(y),b=C?te(C):void 0;b&&i.push(b)}return i},"endpointRectsFor"),g=l((f,d)=>{if(d+3>=f.length)return[];const i=f[d],y=f[d+1],C=f[d+2],b=f[d+3],L=Nt(i,y,et)&&Ot(y,C,et)&&Nt(C,b,et),v=Ot(i,y,et)&&Nt(y,C,et)&&Ot(C,b,et);if(!L&&!v)return[];if(!(L?Math.sign(y.x-i.x)!==Math.sign(b.x-C.x):Math.sign(y.y-i.y)!==Math.sign(b.y-C.y)))return[];const I=gt(i,b,et)||xt(i,b,et)?[]:[{x:i.x,y:b.y},{x:b.x,y:i.y}],T=I.length===0?[[...f.slice(0,d+1),...f.slice(d+3)]]:I.map(P=>[...f.slice(0,d+1),P,...f.slice(d+3)]),A=new Set;return T.map(P=>de(pt(P))).filter(P=>{if(at(P).length!==P.length-1||!P.some(k=>ce(k,b,et)))return!1;const O=P.map(k=>`${k.x.toFixed(3)},${k.y.toFixed(3)}`).join("|");return A.has(O)?!1:(A.add(O),!0)})},"shortcutCandidatesAt"),S=l((f,d,i)=>{const y=[f.start,f.end].filter(b=>!!b),C=p(f);for(const b of at(d))if(Bt(b.a,b.b,o,y,-2)||Bt(b.a,b.b,s,[],-2)||C.some(L=>m(b,L)))return!1;for(const b of r)if(b!==f){for(const L of at(d))for(const v of at(a(b)))if(fe(L,v,.5)>=Xt)return!1}return u(f,d)<=i},"candidateIsSafe");for(let f=0;f<8;f++){const d=u();let i,y,C=d,b=Number.POSITIVE_INFINITY,L=Number.POSITIVE_INFINITY;for(const v of r){const x=a(v),I=oe(x,et),T=c(x);for(let A=0;A<=x.length-4;A++)for(const P of g(x,A)){const O=oe(P,et),k=c(P);if(!(O<I||O===I&&k<T-et)||!S(v,P,d))continue;const B=u(v,P);B>C||B===C&&(O>b||O===b&&k>=L)||(i=v,y=P,C=B,b=O,L=k)}}if(!i||!y)return;i.points=y}}l(rs,"shortcutRedundantOrthogonalJogs");function is(t,e){const a=[];for(const R of e.values()){if(R.isGroup||R.isEdgeLabel)continue;const F=R.x??0,_=R.y??0,V=te(R);V&&a.push({id:String(R.id??""),cx:F,cy:_,rect:V})}if(a.length===0)return;const c=new Map(a.map(R=>[R.id,R])),u=a.map(R=>({id:R.id,rect:R.rect})),m=["top","bottom","left","right"],p={top:Math.min(...a.map(R=>R.rect.top))-20,bottom:Math.max(...a.map(R=>R.rect.bottom))+20,left:Math.min(...a.map(R=>R.rect.left))-20,right:Math.max(...a.map(R=>R.rect.right))+20},g=t.filter(R=>!R.isLayoutOnly),S=new Map(g.map((R,F)=>[R,F])),f=l(R=>{const F=R==="left"||R==="top"?-1:1,_=[];for(let V=0;V<=2;V++)_.push(p[R]+F*20*V);return _},"outwardTracksForSide"),d=l((R,F=new Map)=>pt(F.get(R)??R.points??[]),"replacementPointsFor"),i=l((R,F)=>{let _=0;for(const V of R)for(const K of F)ue(V.a,V.b,K.a,K.b,et)&&_++;return _},"crossingCountBetweenSegments"),y=l((R,F)=>i(at(R),at(F)),"crossingCountBetweenPaths"),C=l((R=new Map)=>{let F=0;const _=[],V=new Set,K=[],J=l(Y=>{V.has(Y)||(V.add(Y),K.push(Y))},"addEdge");for(let Y=0;Y<g.length;Y++){const q=g[Y],h=d(q,R);for(let M=Y+1;M<g.length;M++){const E=g[M],w=y(h,d(E,R));w>0&&(F+=w,_.push({first:q,second:E,count:w}),J(q),J(E))}}return K.sort((Y,q)=>(S.get(Y)??0)-(S.get(q)??0)),{count:F,pairs:_,edgeSet:V,edges:K}},"crossingSnapshot"),b=l((R,F)=>{const _=new Set(F.keys());if(_.size===0)return R.count;let V=0;for(const J of R.pairs)(_.has(J.first)||_.has(J.second))&&(V+=J.count);let K=0;for(let J=0;J<g.length;J++){const Y=g[J],q=_.has(Y),h=d(Y,F);for(let M=J+1;M<g.length;M++){const E=g[M];!q&&!_.has(E)||(K+=y(h,d(E,F)))}}return R.count-V+K},"crossingCountWithReplacements"),L=l(R=>{const F=new Map;for(const K of R.pairs){const J=F.get(K.first)??new Set;J.add(K.second),F.set(K.first,J);const Y=F.get(K.second)??new Set;Y.add(K.first),F.set(K.second,Y)}const _=[],V=new Set;for(const K of R.edges){if(V.has(K))continue;const J=[K],Y=[];for(V.add(K);J.length>0;){const q=J.pop();Y.push(q);for(const h of F.get(q)??[])V.has(h)||(V.add(h),J.push(h))}Y.sort((q,h)=>(S.get(q)??0)-(S.get(h)??0)),Y.length>1&&_.push(Y)}return _},"crossingComponents"),v=l(R=>[R.start,R.end].filter(F=>!!F),"endpointIdsFor"),x=l(R=>{const F=[];for(const _ of L(R)){const V=new Set(_),K=new Set(_.flatMap(Y=>v(Y))),J=[..._];for(const Y of g)V.has(Y)||v(Y).some(q=>K.has(q))&&J.push(Y);J.sort((Y,q)=>(S.get(Y)??0)-(S.get(q)??0)),F.push(J)}return F},"pairSearchGroups"),I=l((R,F,_)=>b(R,new Map([[F,_]])),"crossingCountWithSingleReplacement"),T=l(R=>{const F=new Map;for(const _ of R.pairs)F.set(_.first,(F.get(_.first)??0)+_.count),F.set(_.second,(F.get(_.second)??0)+_.count);return F},"currentCrossingsByEdge"),A=l(R=>R.slice(1).reduce((F,_,V)=>{const K=R[V];return F+Math.abs(_.x-K.x)+Math.abs(_.y-K.y)},0),"pathLength"),P=l((R=new Map)=>g.reduce((F,_)=>F+oe(d(_,R)),0),"totalBends"),O=l((R=new Map)=>g.reduce((F,_)=>F+A(d(_,R)),0),"totalLength"),k=l((R,F,_=new Map)=>{const V=at(F);for(const K of g)if(K!==R){for(const J of V)for(const Y of at(d(K,_)))if(fe(J,Y,.5)>=Xt)return!0}return!1},"pathHasSegmentConflict"),D=l((R,F)=>{const _=[R.start,R.end].filter(V=>!!V);for(const V of at(F))if(Bt(V.a,V.b,u,_,-2))return!0;return!1},"pathHitsNode"),B=l((R,F)=>{const _=de(pt(F));at(_).length===_.length-1&&R.push(_)},"pushOrthogonalCandidate"),G=l(R=>R==="left"||R==="right","sideIsHorizontal"),j=l((R,F,_)=>{switch(F){case"left":return Math.min(R.x,_.x)-20;case"right":return Math.max(R.x,_.x)+20;case"top":return Math.min(R.y,_.y)-20;case"bottom":return Math.max(R.y,_.y)+20}},"localTrackForSameSide"),tt=l((R,F,_,V)=>{const K=_==="left"||_==="top"?-1:1,J=[j(F,_,V),p[_]];for(const Y of J)for(let q=0;q<=2;q++)B(R,ro(F,_,V,Y+K*20*q))},"addSameSideCandidates"),ft=l((R,F,_,V,K)=>{for(const J of f(_))for(const Y of f(K))B(R,[F,{x:J,y:F.y},{x:J,y:Y},{x:V.x,y:Y},V])},"addHorizontalToVerticalCandidates"),It=l((R,F,_,V,K)=>{for(const J of f(_))for(const Y of f(K))B(R,[F,{x:F.x,y:J},{x:Y,y:J},{x:Y,y:V.y},V])},"addVerticalToHorizontalCandidates"),Dt=l((R,F,_,V,K)=>{const J=[...f("top"),...f("bottom")];for(const Y of f(_))for(const q of f(K))for(const h of J)B(R,[F,{x:Y,y:F.y},{x:Y,y:h},{x:q,y:h},{x:q,y:V.y},V])},"addHorizontalPairCandidates"),_t=l((R,F,_,V,K)=>{const J=[...f("left"),...f("right")];for(const Y of f(_))for(const q of f(K))for(const h of J)B(R,[F,{x:F.x,y:Y},{x:h,y:Y},{x:h,y:q},{x:V.x,y:q},V])},"addVerticalPairCandidates"),nt=l(R=>{const F=new Set;return R.map(_=>pt(_)).filter(_=>{const V=_.map(K=>`${K.x.toFixed(3)},${K.y.toFixed(3)}`).join("|");return F.has(V)||_.length<2?!1:(F.add(V),!0)})},"dedupeCandidatePaths"),Z=l((R,F,_,V)=>{const K=[],J=so(R,F,_,V,20,et);J&&B(K,J),F===V&&tt(K,R,F,_);const Y=G(F),q=G(V);return Y&&!q?ft(K,R,F,_,V):!Y&&q?It(K,R,F,_,V):Y?Dt(K,R,F,_,V):_t(K,R,F,_,V),nt(K)},"buildCandidatesForSides"),rt=l((R,F,_,V)=>{const K=[...f("left"),...f("right")],J=[...f("top"),...f("bottom")];for(const Y of m){const q=ve(V,Y),h=Y==="top"||Y==="bottom"?f(Y):J;for(const M of K){B(R,[F,_,{x:M,y:_.y},{x:M,y:q.y},q]);for(const E of h)B(R,[F,_,{x:M,y:_.y},{x:M,y:E},{x:q.x,y:E},q])}}},"addVerticalDepartureOuterTrackCandidates"),ut=l((R,F,_,V)=>{const K=[...f("left"),...f("right")],J=[...f("top"),...f("bottom")];for(const Y of m){const q=ve(V,Y),h=Y==="left"||Y==="right"?f(Y):K;for(const M of J){B(R,[F,_,{x:_.x,y:M},{x:q.x,y:M},q]);for(const E of h)B(R,[F,_,{x:_.x,y:M},{x:E,y:M},{x:E,y:q.y},q])}}},"addHorizontalDepartureOuterTrackCandidates"),yt=l(R=>{const F=R.start,_=R.end,V=_?c.get(_):void 0;if(!F||!V)return[];const K=pt(R.points??[]);if(K.length<4)return[];const J=K[0],Y=K[1],q=[];return Ot(J,Y,et)?rt(q,J,Y,V):Nt(J,Y,et)&&ut(q,J,Y,V),q},"terminalPreservingOuterTrackCandidates"),St=l(R=>{const F=R.start,_=R.end,V=F?c.get(F):void 0,K=_?c.get(_):void 0;if(!V||!K)return[];const J=[];for(const Y of m){const q=ve(V,Y);for(const h of m)J.push(...Z(q,Y,ve(K,h),h))}return J.push(...yt(R)),J},"candidatePathsFor"),Et=l(()=>new Map(g.map(R=>[R,at(d(R))])),"currentSegmentsByEdge"),Kt=l((R,F,_)=>{const V=new Set;for(const K of g){if(K===R)continue;const J=_.get(K)??at(d(K));F.some(Y=>J.some(q=>fe(Y,q,.5)>=Xt))&&V.add(K)}return V},"sharedTrackConflictsFor"),qt=l((R,F,_,V)=>{const K=new Set;return St(R).map(Y=>de(pt(Y))).filter(Y=>{if(D(R,Y))return!1;const q=Y.map(h=>`${h.x.toFixed(3)},${h.y.toFixed(3)}`).join("|");return K.has(q)||Y.length<2?!1:(K.add(q),!0)}).map(Y=>{const q=at(Y);let h=0;for(const M of g)M!==R&&(h+=i(q,_.get(M)??at(d(M))));return{candidate:Y,candidateSegments:q,crossings:F.count-(V.get(R)??0)+h,bends:oe(Y,et),totalBends:oe(Y),length:A(Y)}}).filter(({crossings:Y})=>Y<=F.count).sort((Y,q)=>Y.crossings-q.crossings||Y.bends-q.bends||Y.length-q.length).slice(0,48).map(Y=>({path:Y.candidate,segments:Y.candidateSegments,sharedTrackConflicts:Kt(R,Y.candidateSegments,_),totalBends:Y.totalBends,length:Y.length}))},"pairCandidatesFor"),Zt=l((R,F,_,V,K,J)=>{let Y=0;for(const h of R.pairs)(h.first===F||h.second===F||h.first===V||h.second===V)&&(Y+=h.count);let q=i(_.segments,K.segments);for(const h of g){if(h===F||h===V)continue;const M=J.get(h)??at(d(h));q+=i(_.segments,M)+i(K.segments,M)}return R.count-Y+q},"pairCrossingCount"),se=l((R,F)=>{for(const _ of R.sharedTrackConflicts)if(_!==F)return!1;return!0},"conflictsOnlyWith"),Le=l((R,F)=>R.segments.some(_=>F.segments.some(V=>fe(_,V,.5)>=Xt)),"candidatesShareTrack"),ge=l((R,F,_,V)=>se(F,_.edge)&&se(V,R.edge)&&!Le(F,V),"pairCandidatesAreCompatible"),Te=l((R,F,_,V,K)=>{const J=Zt(R.current,F.edge,_,V.edge,K,R.baseSegments);if(!(J>=R.current.count))return{replacements:new Map([[F.edge,_.path],[V.edge,K.path]]),crossings:J,bends:R.currentBends-(R.baseBendsByEdge.get(F.edge)??0)-(R.baseBendsByEdge.get(V.edge)??0)+_.totalBends+K.totalBends,length:R.currentLength-(R.baseLengthByEdge.get(F.edge)??0)-(R.baseLengthByEdge.get(V.edge)??0)+_.length+K.length}},"scorePairReplacement"),an=l((R,F)=>R.crossings<F.crossings||R.crossings===F.crossings&&(R.bends<F.bends||R.bends===F.bends&&R.length<F.length),"pairScoreIsBetter"),ln=l((R,F,_,V)=>{let K=V;for(const J of F.candidates)for(const Y of _.candidates){if(!ge(F,J,_,Y))continue;const q=Te(R,F,J,_,Y);q&&an(q,K)&&(K=q)}return K},"bestScoreForOptionPair"),fn=l(R=>{const F=P(),_=O(),V=Et(),K=T(R),J=new Map(g.map(w=>[w,oe(d(w))])),Y=new Map(g.map(w=>[w,A(d(w))])),q=new Map,h=x(R);for(const w of h)for(const N of w){if(q.has(N))continue;const H=qt(N,R,V,K);H.length>0&&q.set(N,{edge:N,candidates:H})}let M={replacements:new Map,crossings:R.count,bends:F,length:_};const E={current:R,currentBends:F,currentLength:_,baseBendsByEdge:J,baseLengthByEdge:Y,baseSegments:V};for(const w of h){const N=new Set(w.filter(W=>R.edgeSet.has(W))),H=w.map(W=>q.get(W)).filter(W=>!!W);for(let W=0;W<H.length;W++){const ot=H[W];for(let U=W+1;U<H.length;U++){const $=H[U];!N.has(ot.edge)&&!N.has($.edge)||(M=ln(E,ot,$,M))}}}return M.replacements.size>0?M.replacements:void 0},"bestPairedReplacement");for(let R=0;R<4;R++){const F=C(),_=F.count;if(_===0)return;let V,K,J=_,Y=Number.POSITIVE_INFINITY;for(const h of F.edges){const M=oe(d(h),et);for(const E of St(h)){const w=D(h,E),N=!w&&k(h,E),H=I(F,h,E),W=oe(E,et);w||N||!(H<_||H===_&&W<M)||H>J||H===J&&W>=Y||(V=h,K=E,J=H,Y=W)}}if(V&&K){V.points=K;continue}const q=fn(F);if(!q)return;for(const[h,M]of q)h.points=M}}l(is,"resolveRenderedOrthogonalCrossings");var pe=.001,xr=8;function cs(t,e){const{nodeInfoById:n,realNodeRects:o}=on(e),s=["top","bottom","left","right"],r=20,a={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,y,C,b)=>{const L=[],v=so(i,y,C,b,r,pe);return v&&L.push(v),y===b&&L.push(ro(i,y,C,a[y])),L},"buildOrthogonalPathCandidates"),u=l((i,y)=>{for(let C=0;C<i.length-1;C++){const b=i[C],L=i[C+1];if(Bt(b,L,o,y,1))return!0}return!1},"pathHitsNode"),m=l((i,y,C=!1)=>{let b=0;const L=Oe(i,pe),v=y.start,x=y.end;for(const I of t){if(I===y||I.isLayoutOnly)continue;const T=I.start,A=I.end;if(!C&&v&&x&&(T===v||T===x||A===v||A===x))continue;const P=I.points;if(!(!P||P.length<2))for(const O of L)for(const k of Oe(P,pe)){if(co(O.a,O.b,k.a,k.b,pe,pe)){b++;continue}fe(O,k,pe)>=xr&&b++}}return b},"pathConflictCount"),p=4,g=l((i,y)=>{const C=Math.abs(i.y-y.rect.top),b=Math.abs(i.y-y.rect.bottom),L=Math.abs(i.x-y.rect.left),v=Math.abs(i.x-y.rect.right);let x="top",I=C;return b<I&&(x="bottom",I=b),L<I&&(x="left",I=L),v<I&&(x="right",I=v),x},"nearestSideOfRect"),S=new Map,f=l((i,y,C)=>{const b=S.get(i)??[];b.push({side:y,edgeId:C}),S.set(i,b)},"addFaceClaim");for(const i of t){if(i.isLayoutOnly)continue;const y=i.points??[];if(y.length<1)continue;const C=i.id??"",b=i.start,L=i.end;if(b){const v=n.get(b);v&&f(b,g(y[0],v),C)}if(L){const v=n.get(L);v&&f(L,g(y[y.length-1],v),C)}}const d=l((i,y,C)=>{var b;return((b=S.get(i))==null?void 0:b.some(L=>L.edgeId!==C&&L.side===y))??!1},"faceIsClaimed");for(const i of t){if(i.isLayoutOnly)continue;const y=i.points;if(!y||y.length<2)continue;const C=oe(y,pe);if(C<p)continue;const b=i.start,L=i.end;if(!b||!L)continue;const v=n.get(b),x=n.get(L);if(!v||!x)continue;const I=i.id??"",T=m(y,i,!0),A=m(y,i);let P,O=T,k=C;for(const D of s){if(d(b,D,I))continue;const B=ve(v,D);for(const G of s){if(d(L,G,I))continue;const j=ve(x,G);for(const tt of c(B,D,j,G)){if(u(tt,[b,L]))continue;const ft=oe(tt,pe);if(T>0){const It=m(tt,i,!0);if(It>O||It===O&&ft>=k)continue;O=It,k=ft,P=tt;continue}m(tt,i)>A||ft<k&&(k=ft,P=tt)}}}if(P){i.points=P;const D=S.get(b);D&&S.set(b,D.filter(G=>G.edgeId!==I));const B=S.get(L);B&&S.set(L,B.filter(G=>G.edgeId!==I)),f(b,g(P[0],v),I),f(L,g(P[P.length-1],x),I)}}}l(cs,"simplifyDetouredEdges");var Qt=.001,wo=10,ze=7;function Xn(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 a=r.x-s.x,c=r.y-s.y;if(!(Math.abs(a)+Math.abs(c)<Qt)){if(Math.abs(c)<=Qt){const m=s.x+Math.sign(a)*wo;return{left:Math.min(s.x,m),right:Math.max(s.x,m),top:s.y-ze,bottom:s.y+ze}}if(Math.abs(a)<=Qt){const m=s.y+Math.sign(c)*wo;return{left:s.x-ze,right:s.x+ze,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(Xn,"markerClearanceRectFor");function as(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(as,"normalizeRect");function Yn(t,e){const n=pt(e),o=Xn(n,!0),s=Xn(n,!1);return[o,s].some(r=>r&&Ue(t,as(r)))}l(Yn,"labelOverlapsOwnMarker");function Ve(t,e){const n=[];for(const d of t){if(d.isLayoutOnly)continue;const i=d.points;if(!(!i||i.length<2))for(let y=0;y<i.length-1;y++)n.push({edgeId:d.id,p1:i[y],p2:i[y+1]})}const o=[],s=[];for(const d of e.values()){const i=d.isGroup,y=d.parentId;if(i&&!y){const b=te(d);b&&s.push({id:d.id,rect:b});continue}if(i||d.isEdgeLabel)continue;const C=te(d);C&&o.push({nodeId:d.id,rect:C})}const r=3,a=1,c=12,u=l((d,i)=>{const y=Cn(i,r);for(const{nodeId:C,rect:b}of o)if(C!==d&&Ue(y,b))return!0;return!1},"labelOverlapsForeignNode"),m=l((d,i)=>{const y=Cn(i,r);for(const C of n)if(C.edgeId!==d&&nn(C.p1,C.p2,y))return!0;return!1},"labelOverlapsForeignEdge"),p=l((d,i,y)=>u(d,y)||m(i,y),"labelOverlapsAnything"),g=[],S=l(d=>{for(const{id:i,rect:y}of s)if(Fo(y,d))return i},"findContainingLane"),f=l((d,i)=>g.some(y=>y.labelId!==d&&Ue(i,y.rect)),"overlapsPlacedLabel");for(const d of t){if(d.isLayoutOnly)continue;const i=d.labelNodeId;if(!i)continue;const y=e.get(i);if(!y)continue;const C=d.points;if(!C||C.length<2)continue;const b=y.width??0,L=y.height??0;if(b<=0||L<=0)continue;const v=[];for(let nt=0;nt<C.length-1;nt++){const Z=C[nt],rt=C[nt+1],ut=Math.abs(Z.x-rt.x),yt=Math.abs(Z.y-rt.y);ut<Qt&&yt<Qt||ut>=Qt&&yt>=Qt||v.push({idx:nt,length:ut+yt,orientation:ut>=Qt?"horizontal":"vertical",midX:(Z.x+rt.x)/2,midY:(Z.y+rt.y)/2})}if(v.length===0)continue;const x=v.length>=3?v.filter(nt=>nt.idx>0&&nt.idx<v.length-1):v,I=x.length>0?x:v,T=b>=L?"horizontal":"vertical",A=l(nt=>[...nt].sort((Z,rt)=>{const ut=Z.orientation===T,yt=rt.orientation===T;if(ut!==yt)return ut?-1:1;const St=Z.length>=(Z.orientation==="horizontal"?b:L)+2,Et=rt.length>=(rt.orientation==="horizontal"?b:L)+2;return St!==Et?St?-1:1:rt.length-Z.length}),"rankSegments"),P=v[0],O=v[v.length-1],k=[.5,.25,.75,.05,.95,.15,.85,.1,.9],D=l((nt,Z)=>{const rt=C[nt.idx],ut=C[nt.idx+1];return{midX:rt.x+(ut.x-rt.x)*Z,midY:rt.y+(ut.y-rt.y)*Z}},"anchorAtT"),B=l((nt,Z,rt)=>Math.min(rt,Math.max(Z,nt)),"clamp"),G=l((nt,Z)=>nt.midX>=Z.left-Qt&&nt.midX<=Z.right+Qt&&nt.midY>=Z.top-Qt&&nt.midY<=Z.bottom+Qt,"pointInsideRectInclusive"),j=l(nt=>{const Z=Ne(nt.midX,nt.midY,b,L),rt=S(Z);if(rt)return{laneId:rt,anchor:nt,rect:Z};const ut=s.find(({rect:se})=>G(nt,se));if(!ut)return;const yt=ut.rect.left+b/2+a,St=ut.rect.right-b/2-a,Et=ut.rect.top+L/2+a,Kt=ut.rect.bottom-L/2-a;if(yt>St||Et>Kt)return;const qt={midX:B(nt.midX,yt,St),midY:B(nt.midY,Et,Kt)},Zt=Ne(qt.midX,qt.midY,b,L);return G(nt,Zt)?{laneId:ut.id,anchor:qt,rect:Zt}:void 0},"placementForAnchor"),tt=l((nt,Z,rt)=>nt.orientation==="horizontal"?Math.abs(Z.midX-rt.x):Math.abs(Z.midY-rt.y),"distanceAlongSegment"),ft=l((nt,Z)=>{const ut=(nt.orientation==="horizontal"?b/2:L/2)+c;if(nt===P){const yt=C[nt.idx];if(tt(nt,Z,yt)+Qt<ut)return!1}if(nt===O){const yt=C[nt.idx+1];if(tt(nt,Z,yt)+Qt<ut)return!1}return!0},"labelClearsTerminalEndpoints"),It=l(nt=>{const Z=A(nt);for(const rt of Z)for(const ut of k){const yt=D(rt,ut);if(!ft(rt,yt))continue;const St=j(yt);if(St&&!Yn(St.rect,C)&&!f(i,St.rect)&&!p(i,d.id,St.rect))return{laneId:St.laneId,anchor:St.anchor}}},"tryPool"),Dt=l((nt,Z,rt=!1)=>{const ut=A(nt);for(const yt of ut){const St={midX:yt.midX,midY:yt.midY};if(Z&&!ft(yt,St))continue;const Et=j(St);if(Et&&!Yn(Et.rect,C)&&!f(i,Et.rect)&&!u(i,Et.rect)&&(rt||!m(d.id,Et.rect)))return{laneId:Et.laneId,anchor:Et.anchor}}},"findLaneContainingFallback"),_t=It(I)??(I.length<v.length?It(v):void 0)??Dt(v,!0)??Dt(v,!1)??Dt(v,!1,!0);if(_t){y.x=_t.anchor.midX,y.y=_t.anchor.midY,y.parentId=_t.laneId;const nt=Ne(_t.anchor.midX,_t.anchor.midY,b,L),Z=g.findIndex(rt=>rt.labelId===i);Z>=0?g[Z]={labelId:i,rect:nt}:g.push({labelId:i,rect:nt})}}}l(Ve,"anchorLabelsToPolyline");var bn=1e-6,yr=8,Eo=yr/2,pr=3;function Gn(t,e){return t<e?`${t}::${e}`:`${e}::${t}`}l(Gn,"pairKey");function ls(t,e){const{nodeInfoById:n,realNodeRects:o}=on(e),s=new Map;for(const a of e){const c=a.id;if(!a.isGroup&&a.isEdgeLabel){s.set(c,{w:a.width??0,h:a.height??0});continue}}const r=l((a,c,u,m)=>{const p=Gn(c,u);let g=0;const S=l(f=>{if(!f)return;const d=s.get(f);if(!d)return;const i=m==="x"?d.w/2:d.h/2;i>g&&(g=i)},"consider");S(a.labelNodeId);for(const f of t){if(f===a||f.isLayoutOnly)continue;const d=f.start,i=f.end;!d||!i||Gn(d,i)===p&&S(f.labelNodeId)}return g>0?g+pr:0},"labelClearanceFor");for(const a of t){if(a.isLayoutOnly)continue;const c=a.points;if(!no(c,bn))continue;const u=io(a,n,bn);if(!u)continue;const{srcId:m,dstId:p,srcInfo:g,dstInfo:S,collinearX:f,collinearY:d}=u;if(f===d)continue;let i,y;if(f){const x=S.cy>g.cy;i={x:g.cx,y:x?g.rect.bottom:g.rect.top},y={x:S.cx,y:x?S.rect.top:S.rect.bottom}}else{const x=S.cx>g.cx;i={x:x?g.rect.right:g.rect.left,y:g.cy},y={x:x?S.rect.left:S.rect.right,y:S.cy}}if(Bt(i,y,o,[m,p],1))continue;const b=r(a,m,p,f?"x":"y"),L=b>Eo?b:Eo,v=[0,L,-L];for(const x of v){const I={...i},T={...y};if(f){if(I.x+=x,T.x+=x,I.x<=g.rect.left||I.x>=g.rect.right||T.x<=S.rect.left||T.x>=S.rect.right)continue}else if(I.y+=x,T.y+=x,I.y<=g.rect.top||I.y>=g.rect.bottom||T.y<=S.rect.top||T.y>=S.rect.bottom)continue;if(!Bt(I,T,o,[m,p],1)&&!We(I,T,t,a,{epsilon:bn})){a.points=[I,T];break}}}}l(ls,"straightenCollinearSiblingDetours");function zn(t,e){const{realNodeRects:u,labelNodeRects:m}=be(e.values()),p=l((x,I)=>Oe(I,.001).map(T=>({...T,edge:x,interior:T.index>=1&&T.index<=I.length-3})),"segmentsFor"),g=l(()=>{const x=[];for(const I of t){if(I.isLayoutOnly)continue;const T=I.points;!T||T.length<2||x.push(...p(I,pt(T)))}return x},"allSegments"),S=l((x,I)=>x.horizontal&&I.horizontal?Wt(x.a.x,x.b.x,I.a.x,I.b.x)>=8&&Math.abs(x.a.y-I.a.y)<7:x.vertical&&I.vertical?Wt(x.a.y,x.b.y,I.a.y,I.b.y)>=8&&Math.abs(x.a.x-I.a.x)<7:!1,"hasCrowdedParallelTrack"),f=l((x,I)=>{const T=x.start,A=x.end,P=p(x,I);if(P.length!==I.length-1)return!1;const O=[T,A].filter(D=>!!D),k=x.labelNodeId?[x.labelNodeId]:[];for(const D of P)if(Bt(D.a,D.b,u,O,-2)||Bt(D.a,D.b,m,k,-2))return!1;for(const D of t){if(D===x||D.isLayoutOnly)continue;const B=D.points;if(!(!B||B.length<2)){for(const G of P)for(const j of p(D,pt(B)))if(S(G,j)||ue(G.a,G.b,j.a,j.b,.001))return!1}}return!0},"candidateIsSafe"),d=l((x,I)=>{const T=pt(x.edge.points??[]);if(T.length<4||x.index>=T.length-1)return;const A=T.map(P=>({...P}));if(x.horizontal)A[x.index].y+=I,A[x.index+1].y+=I;else if(x.vertical)A[x.index].x+=I,A[x.index+1].x+=I;else return;return p(x.edge,A).length===A.length-1?A:void 0},"shiftedCandidate"),i=l((x,I)=>({x:x.x??(I.left+I.right)/2,y:x.y??(I.top+I.bottom)/2}),"nodeCenter"),y=l(x=>{const I=x.edge,T=pt(I.points??[]);if(T.length!==4||x.index!==1)return;const A=I.start?e.get(I.start):void 0,P=I.end?e.get(I.end):void 0,O=A?te(A):void 0,k=P?te(P):void 0,D=T.slice(x.index+2);if(!(!A||!P||!O||!k||D.length===0))return{sourceCenter:i(A,O),targetCenter:i(P,k),sourceRect:O,tail:D}},"sourceDetourContextFor"),C=l((x,I,T,A,P,O)=>{const k=A.y>=T.y,D=k?P.bottom:P.top,B=D+(k?20:-20);if(k&&x.b.y<=B+.001||!k&&x.b.y>=B-.001)return;const G=x.a.x+I;return pt([{x:T.x,y:D},{x:T.x,y:B},{x:G,y:B},{x:G,y:x.b.y},...O],.001)},"verticalSourceDetour"),b=l((x,I,T,A,P,O)=>{const k=A.x>=T.x,D=k?P.right:P.left,B=D+(k?20:-20);if(k&&x.b.x<=B+.001||!k&&x.b.x>=B-.001)return;const G=x.a.y+I;return pt([{x:D,y:T.y},{x:B,y:T.y},{x:B,y:G},{x:x.b.x,y:G},...O],.001)},"horizontalSourceDetour"),L=l((x,I)=>{const T=y(x);if(T){if(x.vertical)return C(x,I,T.sourceCenter,T.targetCenter,T.sourceRect,T.tail);if(x.horizontal)return b(x,I,T.sourceCenter,T.targetCenter,T.sourceRect,T.tail)}},"sourceDetourCandidate"),v=[-7,7,-14,14,-21,21];for(let x=0;x<12;x++){const I=g();let T=!1;for(let A=0;A<I.length&&!T;A++)for(let P=A+1;P<I.length&&!T;P++){const O=I[A],k=I[P];if(O.edge===k.edge||!S(O,k))continue;const D=[O,k].filter(B=>B.interior);for(const B of D){for(const G of v){const j=d(B,G);if(j&&f(B.edge,j)){B.edge.points=j,T=!0;break}const tt=L(B,G);if(tt&&f(B.edge,tt)){B.edge.points=tt,T=!0;break}}if(T)break}}if(!T)return}}l(zn,"nudgeSharedInteriorSubpaths");function fs(t,e,n,o){const s=e.x-t.x,r=e.y-t.y,a=o.x-n.x,c=o.y-n.y,u=s*c-r*a;if(Math.abs(u)<1e-10)return!1;const m=n.x-t.x,p=n.y-t.y,g=(m*c-p*a)/u,S=(m*r-p*s)/u,f=.01;return g>f&&g<1-f&&S>f&&S<1-f}l(fs,"segmentsIntersect");function ds(t){const e=t.nodes??[],n=t.edges??[],o=[];if(!n.length||!e.length)return o;const s=_o(e),r=[];for(const c of n){if(c.isLayoutOnly)continue;const u=c.points;if(!u||u.length<2)continue;const m=c.start,p=c.end,g=c.labelNodeId,S=c.id??`${m}->${p}`;for(const f of s)if(!(f.nodeId===m||f.nodeId===p)&&!(g&&f.nodeId===g)){for(let d=0;d<u.length-1;d++)if(nn(u[d],u[d+1],f,-1)){o.push({type:"edge-node-overlap",edgeId:S,targetId:f.nodeId,detail:`segment ${d} passes through node "${f.nodeId}"`});break}}for(let f=0;f<u.length-1;f++)r.push({edgeId:S,start:m,end:p,p1:u[f],p2:u[f+1]})}const a=new Set;for(let c=0;c<r.length;c++)for(let u=c+1;u<r.length;u++){const m=r[c],p=r[u];if(m.edgeId!==p.edgeId&&!(m.start===p.start||m.start===p.end||m.end===p.start||m.end===p.end)&&fs(m.p1,m.p2,p.p1,p.p2)){const g=m.edgeId<p.edgeId?`${m.edgeId}|${p.edgeId}`:`${p.edgeId}|${m.edgeId}`;a.has(g)||(a.add(g),o.push({type:"edge-edge-crossing",edgeId:m.edgeId,targetId:p.edgeId,detail:`edges "${m.edgeId}" and "${p.edgeId}" cross`}))}}if(o.length>0){const c=o.filter(m=>m.type==="edge-node-overlap").length,u=o.filter(m=>m.type==="edge-edge-crossing").length;Mn.warn(`[SWIMLANE_VALIDATE] ${o.length} issue(s) detected: ${c} edge-node overlap(s), ${u} edge crossing(s)`);for(const m of o)Mn.warn(`[SWIMLANE_VALIDATE] ${m.type}: ${m.detail}`)}return o}l(ds,"validateSwimlanesLayout");function us(t,e){const n=t.nodes??[],o=t.edges??[],s=n.filter(c=>!c.isGroup);if((e==="LR"||e==="RL")&&s.length>0&&!Jo(t,e)||e==="BT"&&s.length>0&&!Zo(t))return;for(const c of o){if(c.isLayoutOnly)continue;const u=c.points;!u||u.length<2||(c.points=de(Ke(u)))}cs(o,n),ls(o,n),Qo(o,n);const r=new Map;for(const c of n)r.set(String(c.id),c);Ve(o,r),Go(o,r),ts(o,r),zn(o,r),Fn(o,r),ns(o,r),_n(o,r),os(o,r);const a=l(()=>{is(o,r),Fn(o,r),ss(o,r),rs(o,r),Ve(o,r),Pn(o,r),_n(o,r),Ve(o,r),Pn(o,r)},"finalizeRenderedEdges");a(),zn(o,r),a(),Hn(o,r,e),Dn(o,r,e),Hn(o,r,e),Dn(o,r,e)}l(us,"postProcessSwimlaneLayout");function Ie(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 a=`${r.id}:${r.src}->${r.dst}`;n.has(a)||(n.add(a),o.push(r))}return{nodes:[...e.keys()],edges:o,layout:t.layout,nodeById:e}}l(Ie,"normalizeGraph");function ho(t,e){return t.edges.filter(n=>n.dst===e)}l(ho,"incoming");function hs(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(hs,"buildSuccessorMap");function go(t){const e=hs(t);for(const n of e.values())n.sort((o,s)=>o.localeCompare(s));return e}l(go,"buildSortedSuccessorMap");function sn(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(sn,"buildInDegreeMap");function mo(t,e){const n=[...e.entries()].filter(([,c])=>c===0).map(([c])=>c).sort((c,u)=>c.localeCompare(u)),o=new Set(t.edges.flatMap(c=>[c.src,c.dst])),s=l(c=>{var u;return!o.has(c)&&!((u=t.nodeById.get(c))!=null&&u.isGroup)},"isUnconnected"),r=[...e.keys()].filter(c=>e.get(c)===0&&s(c));let a=0;return n.map(c=>s(c)?r[a++]:c)}l(mo,"sortedZeroInDegreeNodes");function rn(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(rn,"buildPredecessorSuccessorMaps");function xo(t,e,n,o){var a,c;let s=0;for(const u of t.nodes)o!=null&&o.skipGroups&&((a=t.nodeById.get(u))!=null&&a.isGroup)||(s=Math.max(s,n[u]??0));const r=Array.from({length:s+1},()=>[]);for(const u of e)o!=null&&o.skipGroups&&((c=t.nodeById.get(u))!=null&&c.isGroup)||r[Math.max(0,n[u]??0)].push(u);return r}l(xo,"buildLayersFromRanks");function ke(t){const e=sn(t),n=mo(t,e),o=[],s=go(t);for(;n.length;){const r=n.shift();o.push(r);for(const a of s.get(r)??[])if(e.set(a,(e.get(a)??0)-1),(e.get(a)??0)===0){let c=0;for(;c<n.length&&n[c]<a;)c++;n.splice(c,0,a)}}return o.length===t.nodes.length?o:null}l(ke,"topoSortIfAcyclic");function Be(t){const e=new Map;let n=0;for(const o of t)e.set(o,n),n++;return e}l(Be,"buildLayerIndex");function yo(t){const e=new Array(t.length),n=l((o,s)=>{if(s-o<=1)return 0;const r=o+s>>1;let a=n(o,r)+n(r,s),c=o,u=r,m=o;for(;c<r||u<s;)u>=s||c<r&&t[c]<=t[u]?e[m++]=t[c++]:(e[m++]=t[u++],a+=r-c);for(let p=o;p<s;p++)t[p]=e[p];return a},"count");return n(0,t.length)}l(yo,"countInversions");function gs(t){const e=Ie(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((S,f)=>S.dst===f.dst?S.id.localeCompare(f.id):S.dst.localeCompare(f.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 S of n.get(g)??[]){const f=S.dst;o[f]===0?r(f):o[f]===1&&s.push(S)}o[g]=2},"dfs"),a=sn(e),c=[...e.nodes.filter(g=>(a.get(g)??0)===0),...e.nodes.filter(g=>(a.get(g)??0)!==0)];for(const g of c)o[g]===0&&r(g);const u=new Set(s.map(g=>`${g.id}:${g.src}->${g.dst}`)),m=e.edges.map(g=>u.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(gs,"removeCycles_DFS");function ms(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(ms,"buildTopLaneMap");function he(t){const e=ms(t);return n=>e.get(n)??null}l(he,"createTopLaneResolver");function cn(t){const e=[];for(const n of t.layout.nodes??[])n.isGroup&&!n.parentId&&e.push(n.id);return[...new Set(e)].reverse()}l(cn,"buildTopLaneOrder");function po(t,e){const n=cn(t);if(!e||e.length===0)return n;const o=new Set(n),s=new Set,r=[];for(const a of e)!o.has(a)||s.has(a)||(s.add(a),r.push(a));for(const a of n)s.has(a)||r.push(a);return r}l(po,"resolveTopLaneOrder");var br={EPSILON:1e-6},tn={GRAVITY_ITERATIONS:8,MAX_CROSSING_OPTIMIZATION_PASSES:4,DEFAULT_COMPACT_SINGLE_INPUT:!0},Ao={DEFAULT_LAYER_GAP:100,DEFAULT_NODE_GAP:40};function xs(t,e){const n=Ie(t),o=(e==null?void 0:e.laneOf)??(()=>null),s=e==null?void 0:e.rankHint,{preds:r}=rn(n);for(const x of r.values())x.sort((I,T)=>I.localeCompare(T));const a=ke(n)??[...n.nodes].sort((x,I)=>x.localeCompare(I)),c=new Map;for(const[x,I]of a.entries())c.set(I,x);const u=new Map,m=new Map;for(const x of n.nodes)m.set(x,[]);for(const x of a){const I=(r.get(x)??[]).filter(T=>u.has(T));if(I.length>0){const T=ys(x,I,{laneOf:o,rankHint:s,topoIndex:c});u.set(x,T),m.get(T).push(x)}else u.has(x)||u.set(x,null)}for(const x of n.nodes)u.has(x)||u.set(x,null);const p=new Set;for(const x of n.nodes)(u.get(x)??null)===null&&p.add(x);const g=[...p].sort((x,I)=>{const T=c.get(x)??0,A=c.get(I)??0;return T===A?x.localeCompare(I):T-A}),S=ps(n),f=new Map;for(const[x,I]of S.entries())f.set(x,[...I].sort((T,A)=>T.localeCompare(A)));const d=bs(f),i=Is(f),y=new Map;for(const x of n.nodes)y.set(x,[]);for(const x of i)for(const I of x.nodes){const T=y.get(I);T?T.push(x.id):y.set(I,[x.id])}const C=[],b=[],L=new Set,v=l(x=>{if(!L.has(x)){L.add(x),C.push(x);for(const I of m.get(x)??[])v(I);b.push(x)}},"walk");for(const x of g)v(x);for(const x of a)v(x);return{parent:u,children:m,roots:g,componentOf:d,blocks:i,nodeBlocks:y,adjacency:f,preorder:C,postorder:b,topologicalOrder:a}}l(xs,"buildDrivingTree");function ys(t,e,n){const o=n.laneOf(t);return[...e].sort((r,a)=>{var i,y;const c=n.laneOf(r),u=n.laneOf(a),m=c!=null&&c===o,p=u!=null&&u===o;if(m!==p)return m?-1:1;const g=(i=n.rankHint)==null?void 0:i[r],S=(y=n.rankHint)==null?void 0:y[a];if(g!=null&&S!=null&&g!==S)return S-g;const f=n.topoIndex.get(r)??0,d=n.topoIndex.get(a)??0;return f!==d?f-d:r.localeCompare(a)})[0]}l(ys,"chooseParent");function ps(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(ps,"buildAdjacency");function bs(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 a of t.get(r)??[])e.has(a)||s.push(a)}}n++}return e}l(bs,"assignComponents");function Is(t){const e=new Map,n=new Map,o=[],s=[];let r=0;const a=l((c,u)=>{e.set(c,++r),n.set(c,r);for(const m of t.get(c)??[])m!==u&&(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]),a(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(Ms(c,m,o,s.length))))},"visit");for(const c of t.keys())e.has(c)||a(c,null);return s}l(Is,"computeBlocks");function Ms(t,e,n,o){const s=[],r=new Set;for(;n.length>0;){const a=n.pop();if(s.push(a),r.add(a[0]),r.add(a[1]),a[0]===t&&a[1]===e||a[0]===e&&a[1]===t)break}return{id:o,edges:s,nodes:[...r]}}l(Ms,"popBlock");function Ss(t,e,n){const o=[...t.nodes],s=new Map;for(const[b,L]of o.entries())s.set(L,b);const r=o.length,a=new Array(r).fill(-1),c=new Array(r).fill(0),u=[],m=new Set;for(const b of o){const L=n.parent.get(b)??null,v=s.get(b);v!=null&&L==null&&(a[v]=-1,c[v]=0,m.has(b)||(m.add(b),u.push(b)))}for(;u.length>0;){const b=u.shift(),L=s.get(b);if(L==null)continue;const v=n.children.get(b)??[];for(const x of v){if(m.has(x))continue;const I=s.get(x);I!=null&&(a[I]=L,c[I]=c[L]+1,m.add(x),u.push(x))}}for(const b of o){if(m.has(b))continue;const L=s.get(b);L!=null&&(a[L]=-1,c[L]=0,m.add(b))}const p=Math.max(1,Math.ceil(Math.log2(Math.max(1,r)))+1),g=Array.from({length:p},()=>new Array(r).fill(-1));for(let b=0;b<r;b++)g[0][b]=a[b];for(let b=1;b<p;b++)for(let L=0;L<r;L++){const v=g[b-1][L];g[b][L]=v===-1?-1:g[b-1][v]}const S=l((b,L)=>{if(b===-1||L===-1)return-1;c[b]<c[L]&&([b,L]=[L,b]);const v=c[b]-c[L];for(let x=0;x<p;x++)if(v>>x&1&&(b=g[x][b],b===-1))return-1;if(b===L)return b;for(let x=p-1;x>=0;x--){const I=g[x][b],T=g[x][L];I===-1||T===-1||I!==T&&(b=I,L=T)}return g[0][b]},"lcaIndex"),f=Array.from({length:r},()=>new Map);for(const b of t.edges){let L=b.src,v=b.dst,x=e[L],I=e[v];if(x==null||I==null||(x>I&&([L,v]=[v,L],[x,I]=[I,x]),x==null||I==null||x===I))continue;const T=s.get(L),A=s.get(v);if(T==null||A==null)continue;const P=S(T,A);if(P===-1)continue;const O=f[P];for(let k=x;k<I;k++)O.set(k,(O.get(k)??0)+1)}const d=new Map,i=l((b,L)=>{if(L.size!==0)for(const[v,x]of L)b.set(v,(b.get(v)??0)+x)},"mergeInto"),y=new Set,C=l(b=>{const L=s.get(b);y.add(b);const v=L==null?void 0:f[L],x=v?new Map(v):new Map,I=n.children.get(b)??[];for(const T of I){const A=C(T),P=e[b];if(P!=null){let O=d.get(b);O||(O=new Map,d.set(b,O));let k=A.get(P)??0;const D=e[T];D!=null&&D>P&&(k+=1),O.set(T,k)}i(x,A)}return x},"dfs");for(const b of n.roots)y.has(b)||C(b);for(const b of o)y.has(b)||C(b);return d}l(Ss,"computeSubtreeCrossCounts");function Cs(t,e,n){const o=new Map,s=l(r=>{let a=n[r]??0;const c=[...e.get(r)??[]];c.sort(bo(n));for(const u of c){s(u);const m=o.get(u);m!=null&&(a=Math.min(a,m))}o.set(r,a)},"annotate");for(const r of t)s(r);return o}l(Cs,"annotateMinimumLayers");function bo(t){return(e,n)=>{const o=t[e]??0,s=t[n]??0;return o===s?e.localeCompare(n):o-s}}l(bo,"compareByRankThenId");function vs(t,e,n,o){let s=0;for(const u of e){const m=n[u]??0;m>s&&(s=m)}const r=Array.from({length:s+1},()=>[]),a=new Set,c=l(u=>{if(a.has(u))return;a.add(u);const m=n[u]??0;r[m]||(r[m]=[]),r[m].push(u);for(const p of o(u))c(p)},"emit");for(const u of t)c(u);for(const u of e)if(!a.has(u)){const m=n[u]??0;r[m]||(r[m]=[]),r[m].push(u),a.add(u)}return r}l(vs,"emitNodesInTreeOrder");function Ls(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(Ls,"deduplicateLayers");function Ts(t,e,n,o){return s=>{const r=t.get(s)??[];if(r.length===0)return[];const a=e[s]??0,c=[],u=[],m=n.get(s);for(const p of r){const g=o.get(p)??a;g>a?c.push({child:p,min:g}):u.push(p)}return c.sort((p,g)=>p.min===g.min?p.child.localeCompare(g.child):p.min-g.min),u.sort((p,g)=>{const S=(m==null?void 0:m.get(p))??0,f=(m==null?void 0:m.get(g))??0;if(S!==f)return S-f;const d=o.get(p)??a,i=o.get(g)??a;return d!==i?d-i:p.localeCompare(g)}),[...c.map(p=>p.child),...u]}}l(Ts,"createChildOrderer");function en(t,e,n){const o=xs(t,{rankHint:e,laneOf:n}),{children:s,roots:r}=o;for(const g of t.nodes)s.has(g)||s.set(g,[]);const a=Ss(t,e,o),c=[...r].sort(bo(e)),u=Cs(c,s,e),m=Ts(s,e,a,u);let p=vs(c,t.nodes,e,m);return p=Ls(p),p}l(en,"buildMultitreeLayerOrder");function ws(t,e,n){const o=new Set(t),s=new Set(e),r=Be(e),a=[];for(const c of n)o.has(c.src)&&s.has(c.dst)&&a.push(r.get(c.dst));return yo(a)}l(ws,"countCrossingsBetweenAdjacent");function $n(t,e,n){const o=[];for(const r of e){const a=n[r.src],c=n[r.dst];if(a==null||c==null||a===c)continue;let u=r.src,m=r.dst,p=a,g=c;a>c&&(u=r.dst,m=r.src,p=c,g=a);for(let S=p;S<g;S++)o.push({id:`${r.id}@${S}`,src:u,dst:m,ref:r.ref})}let s=0;for(let r=0;r+1<t.length;r++)s+=ws(t[r],t[r+1],o);return s}l($n,"totalCrossings");function Es(t,e){const n={...e},{preds:o}=rn(t),s=he(t),r=en(t,n,s);let a=$n(r,t.edges,n);const c=tn.MAX_CROSSING_OPTIMIZATION_PASSES;for(let u=0;u<c;u++){let m=!1;const p=[...t.nodes].sort((g,S)=>(n[S]??0)-(n[g]??0));for(const g of p){const S=n[g]??0;if(S===0)continue;let f=0;for(const C of o.get(g)??[])f=Math.max(f,(n[C]??0)+1);if(f>=S)continue;const d=S;n[g]=f;const i=en(t,n,s),y=$n(i,t.edges,n);y<a?(a=y,m=!0):n[g]=d}if(!m)break}return n}l(Es,"optimizeRanksByCrossings");function As(t,e){const n=he(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 a=t.edges.filter(i=>i.src===s);if(a.length===0)continue;let c=!1,u=0;for(const i of a){const y=n(i.dst);y==null||y===r?c=!0:u++}if(u===0||c)continue;let m=0,p=!1;for(const i of t.edges){if(i.dst!==s)continue;const y=n(i.src);y&&(y===r?p=!0:m++)}if(m>0||!p)continue;const g=e[s]??0,S=g+u;let f=0;for(const i of t.edges)i.dst===s&&(f=Math.max(f,(e[i.src]??0)+1));const d=Math.max(g,f,S);d!==g&&(e[s]=d)}}l(As,"adjustCrossLaneSources");function Rs(t,e){const n=Ie(t),o=ke(n)??[...n.nodes].sort(),s=(e==null?void 0:e.compactSingleInput)??!1,r=he(n);let a=Object.create(null);for(const u of o){const m=ho(n,u),p=e!=null&&e.ignoreCrossLaneEdges?m.filter(g=>{const S=r(g.src),f=r(u);return!S||!f?!0:S===f}):m;if(p.length===0)a[u]=0;else if(s&&p.length===1){const g=p[0].src,S=r(g),f=r(u);S!==f?a[u]=a[g]??0:a[u]=(a[g]??0)+1}else{let g=-1/0;for(const S of p)g=Math.max(g,(a[S.src]??0)+1);a[u]=g===-1/0?0:g}}return((e==null?void 0:e.optimizeRanksByCrossings)??!1)&&(a=Es(n,a)),e!=null&&e.ignoreCrossLaneEdges&&As(n,a),{layers:en(n,a,r),rankOf:a,dummy:new Set}}l(Rs,"assignLayers_LongestPath");function Ns(t,e){const n=Ie(t),s={...Rs(n,{compactSingleInput:e==null?void 0:e.compactSingleInput,ignoreCrossLaneEdges:e==null?void 0:e.ignoreCrossLaneEdges,optimizeRanksByCrossings:e==null?void 0:e.optimizeRanksByCrossings}).rankOf},r=he(n),{preds:a,succs:c}=rn(n,d=>{if(e!=null&&e.ignoreCrossLaneEdges){const i=r(d.src),y=r(d.dst);if(i&&y&&i!==y)return!1}return!0}),u=ke(n)??[...n.nodes],m=[...u].reverse(),p=l((d,i)=>{let y=0;for(const L of a.get(d)??[])y=Math.max(y,(s[L]??0)+1);let C=Number.POSITIVE_INFINITY;const b=c.get(d)??[];return b.length>0&&(C=Math.min(...b.map(L=>(s[L]??0)-1))),Number.isFinite(C)||(C=Math.max(y,i)),Math.min(Math.max(i,y),C)},"clampFeasible"),g=tn.GRAVITY_ITERATIONS,S=l(d=>{let i=!1;for(const y of d){const C=a.get(y)??[],b=c.get(y)??[];if(C.length===0&&b.length===0)continue;const L=C.length>0?C.reduce((T,A)=>T+(s[A]??0)+1,0)/C.length:s[y]??0,v=b.length>0?b.reduce((T,A)=>T+(s[A]??0)-1,0)/b.length:s[y]??0,x=Math.round((L+v)/2),I=p(y,x);I!==s[y]&&(s[y]=I,i=!0)}return i},"relaxOrder");for(let d=0;d<g;d++){const i=S(u),y=S(m);if(!i&&!y)break}for(const d of u){let i=0;for(const y of a.get(d)??[])i=Math.max(i,(s[y]??0)+1);(s[d]??0)<i&&(s[d]=i)}for(const d of m){const i=c.get(d)??[];if(i.length>0){const y=Math.min(...i.map(C=>(s[C]??0)-1));(s[d]??0)>y&&(s[d]=y)}}return{layers:xo(n,u,s),rankOf:s,dummy:new Set}}l(Ns,"assignLayers_Gravity");function Os(t){const e=sn(t),n=go(t);let o=mo(t,e);const s=[];for(;o.length>0;){const r=[];for(const a of o){s.push(a);for(const c of n.get(a)??[])e.set(c,(e.get(c)??0)-1),(e.get(c)??0)===0&&r.push(c)}o=r.sort((a,c)=>a.localeCompare(c))}return s.length===t.nodes.length?s:null}l(Os,"topoSortByGenerationIfAcyclic");function Bs(t,e){const n=Ie(t),o=(e==null?void 0:e.direction)==="LR"?Os(n)??[...n.nodes].sort():ke(n)??[...n.nodes].sort(),s=he(n),r=l(p=>s(p)??p,"laneOf"),a=Object.create(null),c=new Map,u=l((p,g)=>(e==null?void 0:e.ignoreCrossLaneEdges)??!0?r(p)===r(g)?1:0:1,"edgeWeight");for(const p of o){const g=n.nodeById.get(p);if(g!=null&&g.isGroup)continue;const S=ho(n,p);let f=0;if(S.length>0)for(const C of S){const b=C.src,L=a[b]??0;f=Math.max(f,L+u(b,p))}const d=r(p),i=c.get(d)??0,y=Math.max(f,i);a[p]=y,c.set(d,y+1)}return{layers:xo(n,o,a,{skipGroups:!0}),rankOf:a,dummy:new Set}}l(Bs,"assignLayers_LaneAwareCompact");function Ps(t,e){const n=Ie(e),{rankOf:o}=t,s=t.layers.map(f=>[...f]),r=new Set(t.dummy?[...t.dummy]:[]);let a=0;const c=new Map(n.nodeById),u=l(f=>{const d=`placeholder-${a++}`,i={id:d,isGroup:!1,isDummy:!0,width:0,height:0};for(c.set(d,i),r.add(d);s.length<=f;)s.push([]);return s[f].push(d),o[d]=f,d},"addDummyAt"),m=[...n.edges].sort((f,d)=>f.id===d.id?f.src===d.src?f.dst.localeCompare(d.dst):f.src.localeCompare(d.src):f.id.localeCompare(d.id)),p=[];for(const f of m){const d=o[f.src]??0,i=o[f.dst]??0;if(i-d<=1){p.push(f);continue}let y=f.src;for(let b=d+1,L=0;b<i;b++,L++){const v=u(b);p.push({id:`${f.id}#${L}`,src:y,dst:v,weight:f.weight,ref:f.ref}),y=v}const C=i-d-2;p.push({id:`${f.id}#${Math.max(C+1,0)}`,src:y,dst:f.dst,weight:f.weight,ref:f.ref})}const S={nodes:[...n.nodes,...[...r].filter(f=>!n.nodes.includes(f))],edges:p,layout:n.layout,nodeById:c};return{layering:{layers:s,rankOf:o,dummy:r},graphWithDummies:S}}l(Ps,"makeProperLayering");function Vn(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(Vn,"median");function jn(t){return t.length===0?Number.POSITIVE_INFINITY:t.reduce((n,o)=>n+o,0)/t.length}l(jn,"barycenter");function ks(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(ks,"neighborPositionsFor");function Fs(t,e,n){const o=n.get(t)??0,s=n.get(e)??0;return o!==s?o-s:t.localeCompare(e)}l(Fs,"currentOrderTieBreak");function Un(t,e,n){const o=new Set(t),s=new Set(e),r=Be(t),a=Be(e),c=[];for(const m of n)o.has(m.src)&&s.has(m.dst)&&c.push({u:r.get(m.src),v:a.get(m.dst)});c.sort((m,p)=>m.u===p.u?m.v-p.v:m.u-p.u);const u=c.map(m=>m.v);return yo(u)}l(Un,"countCrossingsBetweenAdjacent");function je(t,e,n){return[...t].sort((o,s)=>{const r=Vn(e.get(o)??[]),a=Vn(e.get(s)??[]);return r===a?Fs(o,s,n):isFinite(r)?isFinite(a)?r-a:-1:1})}l(je,"sortByHeuristic");function Wn(t,e,n,o,s,r){const a=Be(t),c=Be(e),u=ks(e,a,n,o);if(!s||!r||r.length===0)return je(e,u,c);const m=new Map;for(const S of e){const f=s(S),d=m.get(f)??[];d.push(S),m.set(f,d)}const p=[];for(const S of r){const f=m.get(S);if(!f||f.length===0)continue;const d=je(f,u,c);p.push(...d)}const g=m.get(null);if(g&&g.length>0){const S=je(g,u,c);for(const f of S){const d=jn(u.get(f)??[]);let i=p.length;if(isFinite(d))for(const[y,C]of p.entries()){const b=jn(u.get(C)??[]);if(d<b){i=y;break}}p.splice(i,0,f)}}return p}l(Wn,"reorderLayer");function Kn(t,e,n,o,s){const r=[...e],a=new Set(t),c=new Set(e),u=o?new Set(o):null,m=n.filter(i=>a.has(i.src)&&c.has(i.dst)),p=u?n.filter(i=>c.has(i.src)&&u.has(i.dst)):void 0,g=l(i=>{let y=Un(t,i,m);return p&&o&&(y+=Un(i,o,p)),y},"crossingScore"),S=s?new Map:null;if(s&&S)for(const i of e)S.set(i,s(i));let f=!0,d=g(r);for(;f;){f=!1;for(let i=0;i+1<r.length;i++){if(S){const b=S.get(r[i]),L=S.get(r[i+1]);if(b!==L)continue}const y=d;[r[i],r[i+1]]=[r[i+1],r[i]];const C=g(r);C<y?(d=C,f=!0):[r[i],r[i+1]]=[r[i+1],r[i]]}}return r}l(Kn,"transposeImprove");function _s(t,e,n){const o=t.layers.map(c=>[...c]),s=e.edges,r=he(e),a=po(e,n==null?void 0:n.laneOrder);for(let c=0;c<3;c++){for(let u=1;u<o.length;u++)o[u]=Wn(o[u-1],o[u],s,"down",r,a),o[u]=Kn(o[u-1],o[u],s,o[u+1],r);for(let u=o.length-2;u>=0;u--)o[u]=Wn(o[u+1],o[u],s,"up",r,a),o[u]=Kn(o[u+1],o[u],s,o[u-1],r)}return{layers:o}}l(_s,"orderLayers");function Hs(t,e,n){const o=(n==null?void 0:n.layerGap)??Ao.DEFAULT_LAYER_GAP,s=(n==null?void 0:n.nodeGap)??Ao.DEFAULT_NODE_GAP,r=(n==null?void 0:n.laneGap)??s*2,a=(n==null?void 0:n.direction)??"TB",c=a==="LR"||a==="RL",u=t.layers,m=Object.create(null),p=Object.create(null),g=l(O=>e.nodeById.get(O),"getNode"),S=l(O=>{var k;return((k=g(O))==null?void 0:k.width)??0},"getWidth"),f=l(O=>{var k;return((k=g(O))==null?void 0:k.height)??0},"getHeight"),d=he(e),i=po(e,n==null?void 0:n.laneOrder),y=u.map(O=>O.reduce((k,D)=>Math.max(k,f(D)),0)),C=[];if(c)for(let O=0;O+1<u.length;O++){const k=u[O].reduce((It,Dt)=>Math.max(It,S(Dt)),0),D=u[O+1].reduce((It,Dt)=>Math.max(It,S(Dt)),0),B=y[O],G=y[O+1],j=B/2+G/2,tt=(k+D)/2,ft=Math.max(0,tt-j-o);C.push(ft)}const b=new Set;for(const O of u)for(const k of O)b.add(d(k));const L=b.has(null),v=i.filter(O=>b.has(O)),x=[...L?[null]:[],...v],I=Object.create(null);for(const O of v)I[O]=0;L&&(I.null=0);for(const O of u){const k=Object.create(null),D=[];for(const B of O){const G=d(B);G===null?D.push(B):(k[G]||(k[G]=[])).push(B)}for(const[B,G]of Object.entries(k)){const j=G.reduce((tt,ft)=>tt+S(ft),0)+s*Math.max(0,G.length-1);I[B]=Math.max(I[B]??0,j)}if(L&&D.length){const B=D.reduce((G,j)=>G+S(j),0)+s*Math.max(0,D.length-1);I.null=Math.max(I.null??0,B)}}const T=new Map;{const O=x.map(B=>(B===null?I.null:I[B])??0);let D=-(O.reduce((B,G)=>B+G,0)+r*Math.max(0,x.length-1))/2;for(let B=0;B<x.length;B++){const G=x[B],j=O[B]??0,tt=D+j/2;T.set(G,tt),D+=j,B<x.length-1&&(D+=r)}}let A=0;for(const[O,k]of u.entries()){const D=y[O]??0,B=new Map;for(const j of k){const tt=d(j),ft=B.get(tt)??[];ft.push(j),B.set(tt,ft)}for(const j of x){const tt=B.get(j)??[];if(tt.length===0)continue;const ft=T.get(j);if(tt.length===1){const It=tt[0];m[It]=ft,p[It]=A+D/2}else{const It=tt.map(nt=>S(nt)),Dt=It.reduce((nt,Z)=>nt+Z,0)+s*(tt.length-1);let _t=ft-Dt/2;for(const[nt,Z]of tt.entries()){const rt=It[nt];m[Z]=_t+rt/2,p[Z]=A+D/2,_t+=rt+s}}}const G=C[O]??0;A+=D+o+G}const P=new Map;for(const O of e.edges){const k=O.ref.id;P.has(k)||P.set(k,[]),P.get(k).push(O)}for(const[,O]of P){if(O.length===0)continue;const k=O[0].ref,D=k.start,B=k.end;if(D==null||B==null)continue;const G=Math.round(((m[D]??0)+(m[B]??0))/2),j=new Set;for(const tt of O)j.add(tt.src),j.add(tt.dst);for(const tt of j){if(tt===D||tt===B)continue;const ft=e.nodeById.get(tt);ft!=null&&ft.isDummy&&(m[tt]=G)}}return{x:m,y:p}}l(Hs,"assignCoordinates");var Ds=8;function Xs(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(Xs,"hashString");function Ys(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(Ys,"mulberry32");function Gs(t,e){const n=[...t],o=Ys(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(Gs,"deterministicShuffle");function zs(t,e){let n=0;for(const[o,s]of t.entries())n+=Math.abs(o-(e.get(s)??o));return n}l(zs,"sourceDistance");function qn(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:a}of e){const c=n.get(s),u=n.get(r);c==null||u==null||(o+=a*Math.abs(c-u))}return o}l(qn,"laneArrangementCost");function $s(t){const e=cn(t);if(e.length<2)return[];const n=new Map(e.map((r,a)=>[r,a])),o=he(t),s=new Map;for(const r of t.layout.edges??[]){if(r.isLayoutOnly)continue;const a=typeof r.start=="string"?r.start:void 0,c=typeof r.end=="string"?r.end:void 0;if(!a||!c||!t.nodeById.has(a)||!t.nodeById.has(c))continue;const u=o(a),m=o(c);if(!u||!m||u===m)continue;const p=n.get(u),g=n.get(m);if(p==null||g==null)continue;const[S,f]=p<=g?[u,m]:[m,u],d=`${S}\0${f}`,i=s.get(d);i?i.weight++:s.set(d,{a:S,b:f,weight:1})}return[...s.values()]}l($s,"buildWeightedLaneEdges");function Zn(t,e,n){const o=[...t];let s=qn(o,e),r=!0,a=0;const c=Math.max(1,o.length);for(;r&&a<c;){r=!1,a++;for(let u=0;u+1<o.length;u++){[o[u],o[u+1]]=[o[u+1],o[u]];const m=qn(o,e);m<s?(s=m,r=!0):[o[u],o[u+1]]=[o[u+1],o[u]]}}return{order:o,cost:s,sourceDistance:zs(o,n)}}l(Zn,"greedySwitch");function Vs(t,e){return t.cost!==e.cost?t.cost<e.cost:t.sourceDistance<e.sourceDistance}l(Vs,"isBetterCandidate");function js(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:a})=>`${s}:${r}:${a}`).join("|");return Xs(`${t.join("|")}#${o}#${n}`)}l(js,"seedForRestart");function Us(t,e={}){const n=cn(t);if(n.length<2)return n;const o=$s(t);if(o.length===0)return n;const s=new Map(n.map((c,u)=>[c,u]));let r=Zn(n,o,s);const a=Math.max(0,e.restarts??Ds);for(let c=0;c<a;c++){const u=js(n,o,c),m=Gs(n,u),p=Zn(m,o,s);Vs(p,r)&&(r=p)}return r.order}l(Us,"optimizeTopLaneOrder");function Ws(t,e){const n=(e==null?void 0:e.ignoreCrossLaneEdges)??!0,o=(e==null?void 0:e.optimizeRanksByCrossings)??!0,s=Ie(t),r=e!=null&&e.automaticLaneOrdering?Us(s,{restarts:Ds}):void 0,a=gs(s),c=a.acyclic,u=n?Bs(c,{compactSingleInput:(e==null?void 0:e.compactSingleInput)??tn.DEFAULT_COMPACT_SINGLE_INPUT,ignoreCrossLaneEdges:!0,direction:e==null?void 0:e.direction}):Ns(c,{compactSingleInput:(e==null?void 0:e.compactSingleInput)??tn.DEFAULT_COMPACT_SINGLE_INPUT,ignoreCrossLaneEdges:!1,optimizeRanksByCrossings:o}),{layering:m,graphWithDummies:p}=Ps(u,c),g=_s(m,p,{laneOrder:r}),S=Hs(g,p,{layerGap:e==null?void 0:e.layerGap,nodeGap:e==null?void 0:e.nodeGap,direction:e==null?void 0:e.direction,laneOrder:r});return{acyclic:c,reversed:a.reversed,layering:m,ordered:g,coordinates:S}}l(Ws,"sugiyamaLayout");var lt=br.EPSILON,Ir=8,Se=15,Re=15,$e=25,ie=20,In=10;function Jn(t,e,n){const o=t.x??0,s=t.y??0,r=e.x-o,a=e.y-s,c=Math.abs(r),u=Math.abs(a);return c<lt&&u<lt?n:u>lt&&u*3>=c?a>0?"bottom":"top":c>lt?r>0?"right":"left":n}l(Jn,"chooseOrthogonalSide");function Qn(t,e){return Math.abs(t.to-e.from)<lt||Math.abs(t.to-e.to)<lt?t.to:t.from}l(Qn,"sharedLineEndpointCoord");function Ce(t,e){return t.orient==="vertical"?{x:t.coord,y:e}:{x:e,y:t.coord}}l(Ce,"pointOnLine");function Ks(t,e){var K,J,Y,q;const n=t.nodes??[],o=t.edges??[],s=[];for(const h of o)h.isLayoutOnly||s.push({...h,__originalEdge:h});const r=new Map,a=new Map,c=[],u=e==="LR";for(const h of n)r.set(h.id,h);const m=n.filter(h=>h.isGroup&&!h.parentId);for(const h of m){const M={id:h.id},E=l(w=>{a.set(w.id,M),n.filter(N=>N.parentId===w.id).forEach(E)},"assignLane");E(h)}const p=n.filter(h=>!h.isGroup&&!h.isEdgeLabel).map(h=>{const M=h.width??10,E=h.height??10,w=h.x??0,N=h.y??0,H=Ir;return{nodeId:h.id,minX:w-M/2-H,maxX:w+M/2+H,minY:N-E/2-H,maxY:N+E/2+H,visualXHalfExtent:u?E/2+H:M/2+H}}),g=l((h,M,E,w)=>{let N=c.find(H=>H.orientation===h&&Math.abs(H.coord-M)<1);return N||(N={id:`pipe-${h}-${M.toFixed(0)}`,orientation:h,coord:M,spanMin:E,spanMax:w,tracks:[]},c.push(N)),N.spanMin=Math.min(N.spanMin,E),N.spanMax=Math.max(N.spanMax,w),N},"getOrAddPipe"),S=l((h,M)=>{const E=h.width??10,w=h.height??10,N=h.x??0,H=h.y??0;switch(M){case"top":return{x:N,y:H-w/2};case"bottom":return{x:N,y:H+w/2};case"left":return{x:N-E/2,y:H};case"right":return{x:N+E/2,y:H}}},"portForSide"),f=l((h,M,E)=>S(h,Jn(h,M,E?"bottom":"top")),"getOrthogonalPort"),d=[],i=[],y=new Set,C=1e3,b=l((h,M,E)=>{if(d.length===0)return 0;const w=Math.abs(M.y-E.y)<lt,N=Math.abs(M.x-E.x)<lt;if(!w&&!N)return 0;let H=0;if(w){const W=M.y,ot=Math.min(M.x,E.x)-lt,U=Math.max(M.x,E.x)+lt;if(U<=ot)return 0;for(const $ of d)$.edgeIndex===h||$.orientation!=="vertical"||$.pipe.coord<ot||$.pipe.coord>U||$.from-lt<=W&&$.to+lt>=W&&(H+=C)}else if(N){const W=M.x,ot=Math.min(M.y,E.y)-lt,U=Math.max(M.y,E.y)+lt;if(U<=ot)return 0;for(const $ of d)$.edgeIndex===h||$.orientation!=="horizontal"||$.pipe.coord<ot||$.pipe.coord>U||$.from-lt<=W&&$.to+lt>=W&&(H+=C)}return H},"crossingPenalty"),L=s.map((h,M)=>{if(!h.start||!h.end)return{idx:M,crossLane:0,dx:0,dy:0};const E=r.get(h.start),w=r.get(h.end),N=a.get(h.start),H=a.get(h.end),W=N&&H&&N.id!==H.id?1:0,ot=E&&w?Math.abs((w.x??0)-(E.x??0)):0,U=E&&w?Math.abs((w.y??0)-(E.y??0)):0;return{idx:M,crossLane:W,dx:ot,dy:U}}).sort((h,M)=>{if(h.crossLane!==M.crossLane)return M.crossLane-h.crossLane;const E=h.dx+h.dy,w=M.dx+M.dy;return Math.abs(E-w)>1?E-w:h.idx-M.idx}).map(h=>h.idx),v=l((h,M,E,w)=>{const N=Math.min(h.x,M.x),H=Math.max(h.x,M.x),W=Math.min(h.y,M.y),ot=Math.max(h.y,M.y);return!!p.find($=>E&&$.nodeId===E||w&&$.nodeId===w?!1:Math.abs(h.x-M.x)>lt?$.minY<h.y&&$.maxY>h.y&&$.maxX>N&&$.minX<H:$.minX<h.x&&$.maxX>h.x&&$.maxY>W&&$.minY<ot)},"isSegmentBlocked"),x=new Map,I=new Map;for(const h of s)!h.start||!h.end||h.start===h.end||(I.set(h.start,(I.get(h.start)??0)+1),I.set(h.end,(I.get(h.end)??0)+1));const T=l((h,M)=>Jn(h,M,"bottom"),"determineSide"),A=new Map;for(const[h,M]of s.entries()){if(!M.start||!M.end||M.start===M.end||M.points&&M.points.length>0)continue;const E=r.get(M.start),w=r.get(M.end);if(!E||!w)continue;const N=(w.x??0)-(E.x??0),H=(w.y??0)-(E.y??0);A.set(h,{edgeIdx:h,srcId:M.start,dstId:M.end,srcSide:T(E,{x:w.x??0,y:w.y??0}),dstSide:T(w,{x:E.x??0,y:E.y??0}),absDx:Math.abs(N),absDy:Math.abs(H),dxSign:Math.sign(N),dySign:Math.sign(H)})}const P=l(h=>h.srcSide==="top"||h.srcSide==="bottom"?h.absDx===0?1/0:h.absDy/h.absDx:h.absDy===0?1/0:h.absDx/h.absDy,"preferenceStrength"),O=l(h=>h.srcSide==="top"||h.srcSide==="bottom"?h.dxSign>=0?"right":"left":h.dySign>=0?"bottom":"top","secondarySide"),k=new Map;for(const h of A.values()){const M=`${h.srcId}:${h.srcSide}`;k.has(M)||k.set(M,[]),k.get(M).push(h)}const D=new Map,B=l((h,M)=>`${h}:${M}`,"loadKey");for(const h of A.values())D.set(B(h.srcId,h.srcSide),(D.get(B(h.srcId,h.srcSide))??0)+1),D.set(B(h.dstId,h.dstSide),(D.get(B(h.dstId,h.dstSide))??0)+1);for(const h of k.values())if(!(h.length<2)){h.sort((M,E)=>{const w=P(M),N=P(E);return Math.abs(w-N)>1e-9?N-w:M.edgeIdx-E.edgeIdx});for(let M=1;M<h.length;M++){const E=h[M],w=O(E),N=D.get(B(E.srcId,E.srcSide))??0,H=D.get(B(E.srcId,w))??0;H>=N||(D.set(B(E.srcId,E.srcSide),N-1),D.set(B(E.srcId,w),H+1),E.srcSide=w)}}const G=l(h=>{const M=h==null?void 0:h.shape;return M==="question"||M==="diamond"},"isDiamondNode"),j=new Map;for(const h of A.values())j.has(h.dstId)||j.set(h.dstId,new Set),j.get(h.dstId).add(h.dstSide);for(const h of A.values()){if(!G(r.get(h.srcId)))continue;const M=j.get(h.srcId);if(!(M!=null&&M.has(h.srcSide)))continue;const E=O(h);if(M.has(E)||(D.get(B(h.srcId,E))??0)>0)continue;const w=D.get(B(h.srcId,h.srcSide))??0;D.set(B(h.srcId,h.srcSide),Math.max(0,w-1)),D.set(B(h.srcId,E),1),h.srcSide=E}for(const h of A.values()){const{edgeIdx:M,srcId:E,dstId:w,srcSide:N,dstSide:H}=h,W=r.get(E),ot=r.get(w),U=`${E}:${N}:src`,$=N==="top"||N==="bottom"?ot.x??0:ot.y??0;x.has(U)||x.set(U,[]),x.get(U).push({edgeIdx:M,oppositeCoord:$});const bt=`${w}:${H}:dst`,dt=H==="top"||H==="bottom"?W.x??0:W.y??0;x.has(bt)||x.set(bt,[]),x.get(bt).push({edgeIdx:M,oppositeCoord:dt})}const tt=new Map,ft=8;for(const[h,M]of x){if(M.length<2)continue;M.sort((At,Gt)=>At.oppositeCoord-Gt.oppositeCoord);const E=h.split(":"),w=E.slice(0,-2).join(":"),N=E[E.length-2],H=E[E.length-1],W=r.get(w);if(!W)continue;const U=N==="left"||N==="right"?W.height??10:W.width??10,$=W.shape,dt=$==="question"||$==="diamond"?U*.3:U,st=Math.min(20,Math.max(ft,dt/(M.length+1))),Pt=-(st*(M.length-1))/2;for(const[At,Gt]of M.entries()){const ee=Pt+At*st,dn=`${Gt.edgeIdx}:${H}`;tt.set(dn,ee)}}const It=l(h=>{var M;return!!((M=s[h])!=null&&M.labelNodeId)},"edgeHasLabelNode"),Dt=l((h,M)=>h?(x.get(`${h}:${M}:src`)??[]).some(({edgeIdx:E})=>It(E))||(x.get(`${h}:${M}:dst`)??[]).some(({edgeIdx:E})=>It(E)):!1,"faceHasLabelNode"),_t=l((h,M,E)=>M==="top"||M==="bottom"?{x:h.x+E,y:h.y}:{x:h.x,y:h.y+E},"applyPortOffset"),nt=l((h,M,E)=>{const w=A.get(h),N={x:E.x??0,y:E.y??0},H={x:M.x??0,y:M.y??0},W=(w==null?void 0:w.srcSide)??T(M,N),ot=(w==null?void 0:w.dstSide)??T(E,H);let U=w?S(M,w.srcSide):f(M,N,!0),$=w?S(E,w.dstSide):f(E,H,!1);const bt=tt.get(`${h}:src`),dt=tt.get(`${h}:dst`);return bt!==void 0&&(U=_t(U,W,bt)),dt!==void 0&&($=_t($,ot,dt)),{pSrcPort:U,pDstPort:$,srcSide:W,dstSide:ot}},"portsForEdge");for(const h of L){const M=s[h];if(i[h]=[],!M.start||!M.end||M.points&&M.points.length>0||M.start===M.end)continue;const E=r.get(M.start),w=r.get(M.end);if(!E||!w)continue;const{pSrcPort:N,pDstPort:H,srcSide:W,dstSide:ot}=nt(h,E,w),U={...N},$={...H},bt=W==="top"||W==="bottom",dt=ot==="top"||ot==="bottom";if(bt){const X=N.y>(E.y??0);U.y=X?N.y+ie:N.y-ie}else{const X=N.x>(E.x??0);U.x=X?N.x+ie:N.x-ie}if(dt){const X=H.y>(w.y??0);$.y=X?H.y+ie:H.y-ie}else{const X=H.x>(w.x??0);$.x=X?H.x+ie:H.x-ie}const ct=l((X,z)=>{for(const Q of p)if(!z.includes(Q.nodeId)&&X.x>Q.minX&&X.x<Q.maxX&&X.y>Q.minY&&X.y<Q.maxY)return{inside:!0,obstacle:Q};return{inside:!1}},"isPointInObstacle"),st=l((X,z,Q,ht,wt)=>{if(wt){const kt=X.y>(z.y??0);return{x:(Q.x??0)>=X.x?ht.maxX+Se:ht.minX-Se,y:kt?ht.maxY+Re:ht.minY-Re,leavesPositiveSide:kt}}const Ct=X.x>(z.x??0),Rt=(Q.y??0)>=X.y;return{x:Ct?ht.maxX+Se:ht.minX-Se,y:Rt?ht.maxY+Re:ht.minY-Re,leavesPositiveSide:Ct}},"obstacleDetour");let Mt=[];const Pt=[M.start,M.end],At=ct(U,Pt);if(At.inside&&At.obstacle){const X=At.obstacle;if(bt){const z=st(N,E,w,X,!0);U.x=z.x,U.y=z.y;const Q=z.leavesPositiveSide?Math.min(X.minY-2,N.y+ie):Math.max(X.maxY+2,N.y-ie);Mt=[{x:N.x,y:Q},{x:z.x,y:Q},{x:z.x,y:z.y}]}else{const z=st(N,E,w,X,!1),Q=z.leavesPositiveSide?Math.min(X.minX-2,N.x+ie):Math.max(X.maxX+2,N.x-ie);U.x=z.x,U.y=z.y,Mt=[{x:Q,y:N.y},{x:Q,y:z.y},{x:z.x,y:z.y}]}}let Gt=[];const ee=ct($,Pt);if(ee.inside&&ee.obstacle){const X=ee.obstacle;if(dt){const z=st(H,w,E,X,!0);$.x=z.x,$.y=z.y,Gt=[{x:z.x,y:z.y},{x:H.x,y:z.y}]}else{const z=st(H,w,E,X,!1);$.x=z.x,$.y=z.y,Gt=[{x:z.x,y:z.y},{x:z.x,y:H.y}]}}if(Mt.length===0&&Gt.length===0){const X=Se,z=Math.abs(U.x-$.x)<X,Q=Math.abs(U.y-$.y)<X,ht=tt.get(`${h}:src`)!==void 0||tt.get(`${h}:dst`)!==void 0,wt=(((K=x.get(`${M.start??""}:${W}:src`))==null?void 0:K.length)??0)+(((J=x.get(`${M.start??""}:${W}:dst`))==null?void 0:J.length)??0),Ct=(((Y=x.get(`${M.end??""}:${ot}:src`))==null?void 0:Y.length)??0)+(((q=x.get(`${M.end??""}:${ot}:dst`))==null?void 0:q.length)??0),Rt=wt>1||Ct>1,kt=I.get(M.start??"")??0,mt=I.get(M.end??"")??0,Vt=wt>1&&Dt(M.start,W)||Ct>1&&Dt(M.end,ot),re=wt<=1||kt<=2,Ht=Ct<=1||mt<=2;if((z||Q)&&!ht&&(!Rt||Rt&&!Vt&&re&&Ht)&&!v(N,H,M.start,M.end)){M.points=[{...N},{...U},{...$},{...H}],y.add(h);const vt=Q?"horizontal":"vertical",Ut=Q?N.y:N.x,Lt=Q?Math.min(N.x,H.x):Math.min(N.y,H.y),Tt=Q?Math.max(N.x,H.x):Math.max(N.y,H.y),Jt={id:`fast-path-${vt}-${Ut.toFixed(0)}-${h}`,orientation:vt,coord:Ut,spanMin:Lt,spanMax:Tt,tracks:[]};d.push({edgeIndex:h,segmentIndex:0,orientation:vt,pipe:Jt,trackIndex:0,from:Lt,to:Tt});continue}}const dn=g("vertical",U.x,U.y,U.y);U.x=dn.coord;const Qs=g("vertical",$.x,$.y,$.y);$.x=Qs.coord;let me=Math.min(U.x,$.x)-50,xe=Math.max(U.x,$.x)+50,we=Math.min(U.y,$.y)-50,Ee=Math.max(U.y,$.y)+50;for(const X of p){const z=Math.min(U.x,$.x),Q=Math.max(U.x,$.x),ht=Math.min(U.y,$.y),wt=Math.max(U.y,$.y);X.minX<Q&&X.maxX>z&&X.minY<wt&&X.maxY>ht&&(me=Math.min(me,X.minX-$e),xe=Math.max(xe,X.maxX+$e),we=Math.min(we,X.minY-$e),Ee=Math.max(Ee,X.maxY+$e))}for(const X of p){if(X.maxX<me||X.minX>xe||X.maxY<we||X.minY>Ee)continue;const z=Se;g("horizontal",X.minY-z,me,xe),g("horizontal",X.maxY+z,me,xe);const Q=Re;g("vertical",X.minX-Q,we,Ee),g("vertical",X.maxX+Q,we,Ee)}g("horizontal",U.y,me,xe),g("horizontal",$.y,me,xe);const tr=c.filter(X=>X.orientation==="horizontal"&&X.coord>=we&&X.coord<=Ee),er=c.filter(X=>X.orientation==="vertical"&&X.coord>=me&&X.coord<=xe),Fe=l((X,z)=>`${X.toFixed(1)},${z.toFixed(1)}`,"getKey"),_e=Fe(U.x,U.y),Io=Fe($.x,$.y),He=new Map,un=new Map,hn=new Map,De=new Set,Me=[];He.set(_e,0),hn.set(_e,"n"),Me.push({key:_e,f:Math.hypot($.x-U.x,$.y-U.y),pt:U}),De.add(_e);let zt=[];const ye=l((X,z)=>v(X,z,M.start,M.end),"checkSegmentBlocked"),gn={x:$.x,y:U.y},nr=ye(U,gn),or=ye(gn,$),sr=nr||or,mn={x:U.x,y:$.y},rr=ye(U,mn),ir=ye(mn,$);if(sr?rr||ir||(Math.abs(U.x-$.x)<lt?zt=[U,$]:zt=[U,mn,$]):Math.abs(U.y-$.y)<lt||Math.abs(U.x-$.x)<lt?zt=[U,$]:zt=[U,gn,$],zt.length===0)for(;Me.length>0;){Me.sort((mt,Vt)=>mt.f-Vt.f);const X=Me.shift();if(De.delete(X.key),X.key===Io){let mt=Io,Vt=$;for(zt=[Vt];un.has(mt);){const re=un.get(mt);zt.unshift(re),Vt=re,mt=Fe(re.x,re.y)}break}const z=X.pt.x,Q=X.pt.y,ht=er.sort((mt,Vt)=>mt.coord-Vt.coord),wt=ht.findIndex(mt=>Math.abs(mt.coord-z)<1),Ct=tr.sort((mt,Vt)=>mt.coord-Vt.coord),Rt=Ct.findIndex(mt=>Math.abs(mt.coord-Q)<1),kt=[];wt>0&&kt.push({x:ht[wt-1].coord,y:Q}),wt>=0&&wt<ht.length-1&&kt.push({x:ht[wt+1].coord,y:Q}),Rt>0&&kt.push({x:z,y:Ct[Rt-1].coord}),Rt>=0&&Rt<Ct.length-1&&kt.push({x:z,y:Ct[Rt+1].coord});for(const mt of kt){const Vt=Math.min(z,mt.x),re=Math.max(z,mt.x),Ht=Math.min(Q,mt.y),jt=Math.max(Q,mt.y);if(p.some(ne=>ne.nodeId===M.start||ne.nodeId===M.end?!1:Vt!==re?ne.minY<Q&&ne.maxY>Q&&ne.maxX>Vt&&ne.minX<re:ne.minX<z&&ne.maxX>z&&ne.maxY>Ht&&ne.minY<jt))continue;const vt=Fe(mt.x,mt.y),Ut=Math.abs(mt.x-z)+Math.abs(mt.y-Q),Lt=b(h,X.pt,mt);let Tt=0;const Jt=$.x-U.x,Ae=$.y-U.y,Xe=mt.x-z,xn=mt.y-Q;(Ae>10&&xn<-5||Ae<-10&&xn>5)&&(Tt=Math.abs(xn)*100),(Jt>10&&Xe<-5||Jt<-10&&Xe>5)&&(Tt+=Math.abs(Xe)*50);let Mo=0;const So=hn.get(X.key)??"n",Co=Math.abs(Xe)>lt?"h":"v";So!=="n"&&So!==Co&&(Mo=50);const cr=Ut+Lt+Tt+Mo,Ye=(He.get(X.key)??1/0)+cr,vo=Math.abs($.x-mt.x)+Math.abs($.y-mt.y);if(Ye<(He.get(vt)??1/0))if(un.set(vt,X.pt),He.set(vt,Ye),hn.set(vt,Co),!De.has(vt))Me.push({key:vt,f:Ye+vo,pt:mt}),De.add(vt);else{const ne=Me.findIndex(ar=>ar.key===vt);ne!==-1&&(Me[ne].f=Ye+vo)}}}if(zt.length===0&&(zt=[U,{x:U.x,y:$.y},$]),zt.length>4){const X=zt[0],z=zt[zt.length-1];let Q=Math.min(X.x,z.x),ht=Math.max(X.x,z.x),wt=Math.min(X.y,z.y),Ct=Math.max(X.y,z.y);for(const Ht of zt)Q=Math.min(Q,Ht.x),ht=Math.max(ht,Ht.x),wt=Math.min(wt,Ht.y),Ct=Math.max(Ct,Ht.y);const Rt=ht>Math.max(X.x,z.x),kt=Q<Math.min(X.x,z.x);if(u){const Ht=Re;if(Rt){const jt=Math.max(X.x,z.x),Ft=Math.min(X.y,z.y),vt=Math.max(X.y,z.y),Ut=p.filter(Lt=>Lt.minX<jt&&Lt.maxX>jt&&Lt.minY<vt&&Lt.maxY>Ft);if(Ut.length>0){let Lt=Math.max(X.x,z.x);for(const Tt of Ut){const Jt=(Tt.minX+Tt.maxX)/2;if(Tt.visualXHalfExtent===void 0||isNaN(Tt.visualXHalfExtent))continue;const Ae=Jt+Tt.visualXHalfExtent+Ht;Lt=Math.max(Lt,Ae)}isNaN(Lt)||(ht=Lt)}}if(kt){const jt=p.filter(Ft=>Ft.minX<Math.min(X.x,z.x)+Ht&&Ft.minY<Math.max(X.y,z.y)&&Ft.maxY>Math.min(X.y,z.y));if(jt.length>0){let Ft=Math.min(X.x,z.x);for(const vt of jt){const Lt=(vt.minX+vt.maxX)/2-vt.visualXHalfExtent-Ht;Ft=Math.min(Ft,Lt)}Q=Ft}}}const mt=l(Ht=>{const jt=z.y>X.y,Ft=p.filter(Lt=>{const Tt=Math.min(X.x,z.x)<Lt.maxX&&Math.max(X.x,z.x)>Lt.minX,Jt=Math.min(X.y,z.y)<Lt.maxY&&Math.max(X.y,z.y)>Lt.minY;return Tt&&Jt});let vt=Ft;if(u&&Ft.length>0){const Lt=Ft.filter(Tt=>Tt.minX<Ht&&Tt.maxX>Ht);Lt.length>0&&(vt=Lt)}if(vt.length===0)return z.y;const Ut=Se;if(jt){const Tt=Math.max(...vt.map(Jt=>Jt.maxY))+Ut;if(Tt<z.y-lt)return Tt}else{const Tt=Math.min(...vt.map(Jt=>Jt.minY))-Ut;if(Tt>z.y+lt)return Tt}return z.y},"findBestReturnY"),Vt=l(Ht=>{const jt=mt(Ht),Ft={x:Ht,y:X.y},vt={x:Ht,y:jt},Ut={x:z.x,y:jt},Lt=ye(X,Ft),Tt=ye(Ft,vt),Jt=ye(vt,Ut),Ae=jt!==z.y?ye(Ut,z):!1;return!Lt&&!Tt&&!Jt&&!Ae?Math.abs(jt-z.y)<lt?[X,Ft,vt,z]:[X,Ft,vt,Ut,z]:null},"trySimplifyWithDetourX"),re=Rt&&!kt?Vt(ht):kt&&!Rt?Vt(Q):null;re&&(zt=re)}const $t=[N,...Mt,...zt,...Gt.reverse(),H];if($t.length>=3){const X=$t[$t.length-1],z=$t[$t.length-2],Q=$t[$t.length-3],ht=Math.abs(Q.y-z.y)<lt&&Math.abs(z.y-X.y)<lt,wt=Math.abs(Q.x-z.x)<lt&&Math.abs(z.x-X.x)<lt;if(ht){const Ct=Math.sign(z.x-Q.x),Rt=Math.sign(X.x-Q.x);Ct!==0&&Ct===Rt&&Math.abs(z.x-Q.x)>Math.abs(X.x-Q.x)&&$t.splice(-2,1)}else if(wt){const Ct=Math.sign(z.y-Q.y),Rt=Math.sign(X.y-Q.y);Ct!==0&&Ct===Rt&&Math.abs(z.y-Q.y)>Math.abs(X.y-Q.y)&&$t.splice(-2,1)}}const le=[$t[0]];for(let X=1;X<$t.length-1;X++){if(X===1){le.push($t[X]);continue}const z=le[le.length-1],Q=$t[X],ht=$t[X+1];if(Math.abs(z.y-Q.y)<lt&&Math.abs(Q.y-ht.y)<lt){const wt=Q.x>z.x,Ct=ht.x>Q.x;if(wt!==Ct){le.push(Q);continue}continue}if(Math.abs(z.x-Q.x)<lt&&Math.abs(Q.x-ht.x)<lt){const wt=Q.y>z.y,Ct=ht.y>Q.y;if(wt!==Ct){le.push(Q);continue}continue}le.push(Q)}le.push($t[$t.length-1]);for(let X=0;X<le.length-1;X++){const z=le[X],Q=le[X+1],ht=Math.abs(z.x-Q.x)<lt?"vertical":"horizontal",wt=ht==="vertical"?z.x:z.y,Ct=ht==="vertical"?Math.min(z.y,Q.y):Math.min(z.x,Q.x),Rt=ht==="vertical"?Math.max(z.y,Q.y):Math.max(z.x,Q.x),kt=g(ht,wt,Ct,Rt),mt={edgeIndex:h,segmentIndex:X,orientation:ht,pipe:kt,trackIndex:0,from:Ct,to:Rt};d.push(mt),i[h].push(d.length-1),kt.tracks[0]||(kt.tracks[0]={index:0,coord:kt.coord,segments:[]}),kt.tracks[0].segments.push({edgeIndex:h,segmentIndex:X,from:Ct,to:Rt})}}const Z=l((h,M)=>h.from<M.to&&M.from<h.to,"segmentsOverlap"),rt=l((h,M,E,w)=>{const N=!w.segments.some(W=>(W.edgeIndex!==M.edgeIndex||W.segmentIndex!==M.segmentIndex)&&Z(W,h)),H=!E.segments.some(W=>(W.edgeIndex!==h.edgeIndex||W.segmentIndex!==h.segmentIndex)&&Z(W,M));return N&&H?(h.trackIndex=w.index,M.trackIndex=E.index,E.segments=[...E.segments.filter(W=>W.edgeIndex!==h.edgeIndex||W.segmentIndex!==h.segmentIndex),{edgeIndex:M.edgeIndex,segmentIndex:M.segmentIndex,from:M.from,to:M.to}],w.segments=[...w.segments.filter(W=>W.edgeIndex!==M.edgeIndex||W.segmentIndex!==M.segmentIndex),{edgeIndex:h.edgeIndex,segmentIndex:h.segmentIndex,from:h.from,to:h.to}],!0):!1},"trySwapSegmentsAcrossTracks"),ut=l(h=>{const M=h.tracks.length;return h.tracks[M]={index:M,coord:h.coord,segments:[]},M},"createNewTrack"),yt=l((h,M)=>{const E=h.pipe.tracks[h.trackIndex];E.segments=E.segments.filter(N=>N.edgeIndex!==h.edgeIndex||N.segmentIndex!==h.segmentIndex),h.trackIndex=M,h.pipe.tracks[M].segments.push({edgeIndex:h.edgeIndex,segmentIndex:h.segmentIndex,from:h.from,to:h.to})},"moveSegmentToTrack"),St=l((h,M)=>{const E=i[h.edgeIndex];for(const w of E){const N=d[w];N.pipe===h.pipe&&yt(N,M)}},"moveSegmentChainToTrack"),Et=l(h=>{const M=i[h.edgeIndex],E=M.indexOf(d.indexOf(h)),w=[];return E>0&&w.push(d[M[E-1]]),E<M.length-1&&w.push(d[M[E+1]]),w},"getAdjacentSegmentsAlongEdge"),Kt=l((h,M)=>{if(h.orientation===M.orientation)return!1;const E=h.orientation==="horizontal"?h:M,w=h.orientation==="horizontal"?M:h;return w.pipe.coord>E.from&&w.pipe.coord<E.to&&E.pipe.coord>w.from&&E.pipe.coord<w.to},"haveAnyCrossing"),qt=l((h,M)=>{for(const E of h.tracks)if(!E.segments.some(N=>(N.edgeIndex!==M.edgeIndex||N.segmentIndex!==M.segmentIndex)&&Z(N,M)))return E.index;return-1},"findAvailableTrack"),Zt=l((h,M)=>{if(h.trackIndex===M.trackIndex)return Z(h,M);const E=Et(h),w=Et(M);return E.some(N=>w.some(H=>Kt(N,H)))},"segmentsConflict"),se=l((h,M,E)=>{if(rt(h,M,h.pipe.tracks[h.trackIndex],M.pipe.tracks[M.trackIndex]))return;const w=qt(h.pipe,M);E(M,w!==-1?w:ut(h.pipe))},"resolveTrackConflict"),Le=l(h=>{let M=0;for(let E=0;E<h.length;E++)for(let w=E+1;w<h.length;w++){const N=h[E],H=h[w];N.pipe===H.pipe&&Zt(N,H)&&(M++,se(N,H,St))}return M},"resolveHandleConflicts"),ge=new Map,Te=l(h=>{if(ge.has(h))return ge.get(h);const M=i[h];if(M.length===0){const ot={dest:0,deviation:0,base:0,delta:0};return ge.set(h,ot),ot}const w=d[M[0]].pipe.coord;let N=w;for(let ot=1;ot<M.length;ot++){const U=d[M[ot]];if(U.orientation==="horizontal"){const $=U.from,bt=U.to;N=Math.abs($-w)>Math.abs(bt-w)?$:bt;break}}const H=Math.abs(N-w),W={dest:N,deviation:H,base:w,delta:N-w};return ge.set(h,W),W},"getDestInfo"),an=l(()=>{let h=0;const M=new Map;for(const[w,N]of s.entries())i[w].length!==0&&N.start&&(M.has(N.start)||M.set(N.start,[]),M.get(N.start).push(w));const E=l(w=>{const N=s[w];if(!N.start||!N.end)return 0;const H=r.get(N.start),W=r.get(N.end);if(!H||!W)return 0;const ot=(W.x??0)-(H.x??0),U=(W.y??0)-(H.y??0);return Math.abs(ot)+Math.abs(U)},"getEdgeDistance");for(const w of M.values()){w.sort((H,W)=>{const ot=Te(H),U=Te(W);if(Math.abs(ot.deviation-U.deviation)>1)return ot.deviation-U.deviation;if(Math.abs(ot.dest-U.dest)>1)return ot.dest-U.dest;const $=E(H),bt=E(W);if(Math.abs($-bt)>1)return bt-$;const dt=i[H].length,ct=i[W].length;if(dt!==ct)return dt-ct;if(dt===1){const st=i[H][0],Mt=i[W][0];if(d[st]&&d[Mt]){const Pt=d[st],At=d[Mt],Gt=Math.abs(Pt.to-Pt.from),ee=Math.abs(At.to-At.from);if(Math.abs(Gt-ee)>1)return Gt-ee}}return 0});const N=w.map(H=>d[i[H][0]]);h+=Le(N)}return h},"fixSourceHandleCrossings"),ln=l(()=>{let h=0;const M=new Map;for(const[E,w]of s.entries())i[E].length!==0&&w.end&&(M.has(w.end)||M.set(w.end,[]),M.get(w.end).push(E));for(const E of M.values()){E.sort((N,H)=>{const W=l($=>{const bt=i[$];if(bt.length<2)return 0;const dt=d[bt[bt.length-2]];return Math.abs(dt.to-dt.from)},"getDist"),ot=W(N),U=W(H);return Math.abs(ot-U)>.1?ot-U:N-H});const w=E.map(N=>d[i[N][i[N].length-1]]);h+=Le(w)}return h},"fixTargetHandleCrossings"),fn=l(()=>{let h=0;for(const M of c){const E=[];for(const w of M.tracks)for(const N of w.segments){const H=i[N.edgeIndex].find(W=>d[W].segmentIndex===N.segmentIndex);H!==void 0&&E.push(d[H])}E.sort((w,N)=>w.edgeIndex-N.edgeIndex||w.segmentIndex-N.segmentIndex);for(let w=0;w<E.length;w++)for(let N=w+1;N<E.length;N++){const H=E[w],W=E[N];Zt(H,W)&&(h++,se(H,W,yt))}}return h},"fixPipeCrossings");let R=0;const F=10;for(;R<F;){let h=0;if(h+=an(),h+=ln(),h+=fn(),h===0)break;R++}const _=new Map;for(const h of c){const M=[];h.tracks.forEach(w=>{w.segments.forEach(N=>{M.push({edgeIndex:N.edgeIndex,segmentIndex:N.segmentIndex,trackIndex:w.index,from:N.from,to:N.to})})}),M.sort((w,N)=>w.from-N.from);const E=[];if(M.length>0){let w=[M[0]],N=M[0].to;for(let H=1;H<M.length;H++){const W=M[H];W.from<N?(w.push(W),N=Math.max(N,W.to)):(E.push(w),w=[W],N=W.to)}E.push(w)}for(const w of E){const N=new Set;w.forEach(st=>N.add(st.trackIndex));const H=new Map;w.forEach(st=>{const Mt=Te(st.edgeIndex);H.set(st.trackIndex,(H.get(st.trackIndex)??0)+Mt.delta)});const W=[...N].filter(st=>(H.get(st)??0)<-1),ot=[...N].filter(st=>(H.get(st)??0)>1),U=[...N].filter(st=>Math.abs(H.get(st)??0)<=1);W.sort((st,Mt)=>(H.get(Mt)??0)-(H.get(st)??0)),ot.sort((st,Mt)=>(H.get(st)??0)-(H.get(Mt)??0));const $=l((st,Mt)=>{w.filter(Pt=>Pt.trackIndex===st).forEach(Pt=>{const At=y.has(Pt.edgeIndex)?h.coord:Mt;_.set(`${Pt.edgeIndex}-${Pt.segmentIndex}`,At)})},"assignCoord");let bt=0;for(const st of W)bt++,$(st,h.coord-bt*In);if(U.length===0&&N.size>0){const st=[...N].sort((At,Gt)=>Math.abs(H.get(At)??0)-Math.abs(H.get(Gt)??0))[0],Mt=W.indexOf(st);Mt!==-1&&W.splice(Mt,1);const Pt=ot.indexOf(st);Pt!==-1&&ot.splice(Pt,1),U.push(st)}let dt=0;for(const st of U){if(dt===0)$(st,h.coord);else{const Mt=dt%2===1?1:-1,Pt=Math.ceil(dt/2);$(st,h.coord+Mt*Pt*In*.5)}dt++}let ct=0;for(const st of ot)ct++,$(st,h.coord+ct*In)}}for(const[h,M]of s.entries()){const E=i[h]??[];if(E.length===0)continue;const w=[],N=r.get(M.start),H=r.get(M.end),{pSrcPort:W,pDstPort:ot}=nt(h,N,H),U=E.map(dt=>{const ct=d[dt],st=_.get(`${ct.edgeIndex}-${ct.segmentIndex}`)??ct.pipe.coord;return{orient:ct.orientation,coord:st,from:ct.from,to:ct.to}});w.push(W);for(let dt=0;dt<U.length;dt++){const ct=U[dt],st=w[w.length-1],Mt=ct.orient==="vertical"?st.y:st.x,Pt=ct.orient==="vertical"?st.x:st.y,At=U[dt+1],Gt=dt<U.length-1;if(Math.abs(Pt-ct.coord)>lt&&w.push(Ce(ct,Mt)),Gt&&At.orient===ct.orient)if(Math.abs(ct.coord-At.coord)>lt){const ee=ct.orient==="vertical"?(Mt+At.from)/2:Qn(ct,At);w.push(Ce(ct,ee),Ce(At,ee))}else(dt===0||dt===U.length-2)&&w.push(Ce(ct,Qn(ct,At)));else if(Gt)w.push(Ce(ct,At.coord));else{const ee=Math.abs(ct.from-Mt)<Math.abs(ct.to-Mt)?ct.to:ct.from;w.push(Ce(ct,ee))}}const $=w[w.length-1];(Math.abs($.x-ot.x)>lt||Math.abs($.y-ot.y)>lt)&&w.push(ot);const bt=[];w.length>0&&bt.push(w[0]);for(let dt=1;dt<w.length;dt++){const ct=w[dt],st=bt[bt.length-1];(Math.abs(ct.x-st.x)>lt||Math.abs(ct.y-st.y)>lt)&&bt.push(ct)}M.points=bt}for(const h of s){const M=h.__originalEdge;M&&h.points&&(M.points=h.points)}t.edges=(t.edges??[]).filter(h=>!h.isLayoutOnly);const V=l((h,M)=>{const E=M.x??0,w=M.y??0,N=M.width??0,H=M.height??0;if(N<=0||H<=0)return h;const W=E-N/2,ot=E+N/2,U=w-H/2,$=w+H/2;if(h.x<W||h.x>ot||h.y<U||h.y>$)return h;const bt=h.x-W,dt=ot-h.x,ct=h.y-U,st=$-h.y,Mt=Math.min(bt,dt,ct,st);return Mt===bt?{x:W,y:h.y}:Mt===dt?{x:ot,y:h.y}:Mt===ct?{x:h.x,y:U}:{x:h.x,y:$}},"nodeBoundaryClamp");for(const h of t.edges){const M=h.points;if(!M||M.length<2)continue;const E=h.start,w=h.end,N=E?r.get(E):void 0,H=w?r.get(w):void 0;N&&(M[0]=V(M[0],N)),H&&(M[M.length-1]=V(M[M.length-1],H))}return t}l(Ks,"routeEdgesOrthogonal");function qs(t){return t.direction??"TB"}l(qs,"getSwimlaneDirection");function Zs(t){var p,g,S,f,d;const e=Bo(t),n=((p=t.config.flowchart)==null?void 0:p.nodeSpacing)??40,o=((g=t.config.flowchart)==null?void 0:g.rankSpacing)??100,s=((S=t.config.swimlane)==null?void 0:S.ignoreCrossLaneEdges)??!0,r=((f=t.config.swimlane)==null?void 0:f.optimizeRanksByCrossings)??!0,a=((d=t.config.swimlane)==null?void 0:d.automaticLaneOrdering)??!1,c=qs(t),{ordered:u,coordinates:m}=Ws(e,{nodeGap:n,layerGap:o,ignoreCrossLaneEdges:s,optimizeRanksByCrossings:r,automaticLaneOrdering:a,direction:c});Po(e,u,m,{nodeGap:n,layerGap:o});for(const i of t.edges??[])delete i.points;Ks(t,c);for(const i of t.edges??[])(!i.curve||i.curve==="basis")&&(i.curve="rounded");return us(t,c),ds(t),c}l(Zs,"runSwimlaneLayoutCore");function Js(t){Oo(t);const e=ko(t);t.nodes=e.nodes,t.edges=e.edges}l(Js,"prepareSwimlaneLayout");var wr=fr({prepareLayout:Js,runLayoutCore:Zs,afterPaint:Ro});export{wr as render};
@@ -0,0 +1,8 @@
1
+ import{c as r,s as e}from"./explorer-flowDiagram-IUGLLWBU.js";import{_ as a}from"./explorer-mermaid.core.js";import"./explorer.js";import"./explorer-chunk-5VM5RSS4.js";import"./explorer-chunk-XXDRQBXY.js";import"./explorer-chunk-VQ5W62QI.js";import"./explorer-chunk-55XCU76K.js";import"./explorer-channel.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,u=r({styles:s});export{u as diagram};
@@ -1 +1 @@
1
- const e=Object.freeze(JSON.parse(`{"displayName":"SystemVerilog","fileTypes":["v","vh","sv","svh"],"name":"system-verilog","patterns":[{"include":"#comments"},{"include":"#strings"},{"include":"#typedef-enum-struct-union"},{"include":"#typedef"},{"include":"#functions"},{"include":"#keywords"},{"include":"#tables"},{"include":"#function-task"},{"include":"#module-declaration"},{"include":"#class-declaration"},{"include":"#enum-struct-union"},{"include":"#sequence"},{"include":"#all-types"},{"include":"#module-parameters"},{"include":"#module-no-parameters"},{"include":"#port-net-parameter"},{"include":"#system-tf"},{"include":"#assertion"},{"include":"#bind-directive"},{"include":"#cast-operator"},{"include":"#storage-scope"},{"include":"#attributes"},{"include":"#imports"},{"include":"#operators"},{"include":"#constants"},{"include":"#identifiers"},{"include":"#selects"}],"repository":{"all-types":{"patterns":[{"include":"#built-ins"},{"include":"#modifiers"}]},"assertion":{"captures":{"1":{"name":"entity.name.goto-label.php"},"2":{"name":"keyword.operator.systemverilog"},"3":{"name":"keyword.sva.systemverilog"}},"match":"\\\\b([A-Z_a-z][$0-9A-Z_a-z]*)[\\\\t\\\\n\\\\r ]*(:)[\\\\t\\\\n\\\\r ]*(assert|assume|cover|restrict)\\\\b"},"attributes":{"begin":"(?<!@[\\\\t\\\\n\\\\r ]?)\\\\(\\\\*","beginCaptures":{"0":{"name":"punctuation.attribute.rounds.begin"}},"end":"\\\\*\\\\)","endCaptures":{"0":{"name":"punctuation.attribute.rounds.end"}},"name":"meta.attribute.systemverilog","patterns":[{"captures":{"1":{"name":"keyword.control.systemverilog"},"2":{"name":"keyword.operator.assignment.systemverilog"}},"match":"([A-Z_a-z][$0-9A-Z_a-z]*)(?:[\\\\t\\\\n\\\\r ]*(=)[\\\\t\\\\n\\\\r ]*)?"},{"include":"#constants"},{"include":"#strings"}]},"base-grammar":{"patterns":[{"include":"#all-types"},{"include":"#comments"},{"include":"#operators"},{"include":"#constants"},{"include":"#strings"},{"captures":{"1":{"name":"storage.type.interface.systemverilog"}},"match":"[\\\\t\\\\n\\\\r ]*\\\\b([A-Z_a-z][$0-9A-Z_a-z]*)[\\\\t\\\\n\\\\r ]+[A-Z_a-z][\\\\t\\\\n ,0-9=A-Z_a-z]*"},{"include":"#storage-scope"}]},"bind-directive":{"captures":{"1":{"name":"keyword.control.systemverilog"},"2":{"name":"entity.name.type.module.systemverilog"}},"match":"[\\\\t\\\\n\\\\r ]*\\\\b(bind)[\\\\t\\\\n\\\\r ]+([A-Z_a-z][$.0-9A-Z_a-z]*)\\\\b","name":"meta.definition.systemverilog"},"built-ins":{"patterns":[{"match":"[\\\\t\\\\n\\\\r ]*\\\\b(bit|logic|reg)\\\\b","name":"storage.type.vector.systemverilog"},{"match":"[\\\\t\\\\n\\\\r ]*\\\\b(byte|shortint|int|longint|integer|time|genvar)\\\\b","name":"storage.type.atom.systemverilog"},{"match":"[\\\\t\\\\n\\\\r ]*\\\\b(shortreal|real|realtime)\\\\b","name":"storage.type.notint.systemverilog"},{"match":"[\\\\t\\\\n\\\\r ]*\\\\b(supply[01]|tri|triand|trior|trireg|tri[01]|uwire|wire|wand|wor)\\\\b","name":"storage.type.net.systemverilog"},{"match":"[\\\\t\\\\n\\\\r ]*\\\\b(genvar|var|void|signed|unsigned|string|const|process)\\\\b","name":"storage.type.built-in.systemverilog"},{"match":"[\\\\t\\\\n\\\\r ]*\\\\b(uvm_(?:root|transaction|component|monitor|driver|test|env|object|agent|sequence_base|sequence_item|sequence_state|sequencer|sequencer_base|sequence|component_registry|analysis_imp|analysis_port|analysis_export|config_db|active_passive_enum|phase|verbosity|tlm_analysis_fifo|tlm_fifo|report_server|objection|recorder|domain|reg_field|reg_block|reg|bitstream_t|radix_enum|printer|packer|comparer|scope_stack))\\\\b","name":"storage.type.uvm.systemverilog"}]},"cast-operator":{"captures":{"1":{"patterns":[{"include":"#built-ins"},{"include":"#constants"},{"match":"[A-Z_a-z][$0-9A-Z_a-z]*","name":"storage.type.user-defined.systemverilog"}]},"2":{"name":"keyword.operator.cast.systemverilog"}},"match":"[\\\\t\\\\n\\\\r ]*([0-9]+|[A-Z_a-z][$0-9A-Z_a-z]*)(')(?=\\\\()","name":"meta.cast.systemverilog"},"class-declaration":{"begin":"[\\\\t\\\\n\\\\r ]*\\\\b(virtual[\\\\t\\\\n\\\\r ]+)?(class)(?:[\\\\t\\\\n\\\\r ]+((?:st|autom)atic))?[\\\\t\\\\n\\\\r ]+([A-Z_a-z][$0-:A-Z_a-z]*)(?:[\\\\t\\\\n\\\\r ]+(extends|implements)[\\\\t\\\\n\\\\r ]+([A-Z_a-z][$0-:A-Z_a-z]*))?","beginCaptures":{"1":{"name":"storage.modifier.systemverilog"},"2":{"name":"storage.type.class.systemverilog"},"3":{"name":"storage.modifier.systemverilog"},"4":{"name":"entity.name.type.class.systemverilog"},"5":{"name":"keyword.control.systemverilog"},"6":{"name":"entity.name.type.class.systemverilog"}},"end":";","endCaptures":{"0":{"name":"punctuation.definition.class.end.systemverilog"}},"name":"meta.class.systemverilog","patterns":[{"captures":{"1":{"name":"keyword.control.systemverilog"},"2":{"name":"entity.name.type.class.systemverilog"},"3":{"name":"entity.name.type.class.systemverilog"}},"match":"[\\\\t\\\\n\\\\r ]+\\\\b(extends|implements)[\\\\t\\\\n\\\\r ]+([A-Z_a-z][$0-:A-Z_a-z]*)(?:[\\\\t\\\\n\\\\r ]*,[\\\\t\\\\n\\\\r ]*([A-Z_a-z][$0-:A-Z_a-z]*))*"},{"captures":{"1":{"name":"storage.type.userdefined.systemverilog"},"2":{"name":"keyword.operator.param.systemverilog"}},"match":"[\\\\t\\\\n\\\\r ]+\\\\b([A-Z_a-z][$0-9A-Z_a-z]*)[\\\\t\\\\n\\\\r ]*(#)\\\\(","name":"meta.typedef.class.systemverilog"},{"include":"#port-net-parameter"},{"include":"#base-grammar"},{"include":"#module-binding"},{"include":"#identifiers"}]},"comments":{"patterns":[{"begin":"/\\\\*","beginCaptures":{"0":{"name":"punctuation.definition.comment.systemverilog"}},"end":"\\\\*/","endCaptures":{"0":{"name":"punctuation.definition.comment.systemverilog"}},"name":"comment.block.systemverilog","patterns":[{"include":"#fixme-todo"}]},{"begin":"//","beginCaptures":{"0":{"name":"punctuation.definition.comment.systemverilog"}},"end":"$\\\\n?","name":"comment.line.double-slash.systemverilog","patterns":[{"include":"#fixme-todo"}]}]},"compiler-directives":{"name":"meta.preprocessor.systemverilog","patterns":[{"captures":{"1":{"name":"punctuation.definition.directive.systemverilog"},"2":{"name":"string.regexp.systemverilog"}},"match":"(\`)(else|endif|endcelldefine|celldefine|nounconnected_drive|resetall|undefineall|end_keywords|__FILE__|__LINE__)\\\\b"},{"captures":{"1":{"name":"punctuation.definition.directive.systemverilog"},"2":{"name":"string.regexp.systemverilog"},"3":{"name":"variable.other.constant.preprocessor.systemverilog"}},"match":"(\`)(ifdef|ifndef|elsif|define|undef|pragma)[\\\\t\\\\n\\\\r ]+([A-Z_a-z][$0-9A-Z_a-z]*)\\\\b"},{"captures":{"1":{"name":"punctuation.definition.directive.systemverilog"},"2":{"name":"string.regexp.systemverilog"}},"match":"(\`)(include|timescale|default_nettype|unconnected_drive|line|begin_keywords)\\\\b"},{"begin":"(\`)(protected)\\\\b","beginCaptures":{"1":{"name":"punctuation.definition.directive.systemverilog"},"2":{"name":"string.regexp.systemverilog"}},"end":"(\`)(endprotected)\\\\b","endCaptures":{"1":{"name":"punctuation.definition.directive.systemverilog"},"2":{"name":"string.regexp.systemverilog"}},"name":"meta.crypto.systemverilog"},{"captures":{"1":{"name":"punctuation.definition.directive.systemverilog"},"2":{"name":"variable.other.constant.preprocessor.systemverilog"}},"match":"(\`)([A-Z_a-z][$0-9A-Z_a-z]*)\\\\b"}]},"constants":{"patterns":[{"match":"(\\\\b[1-9][0-9_]*)?'([Ss]?[Bb][\\\\t\\\\n\\\\r ]*[01?XZxz][01?XZ_xz]*|[Ss]?[Oo][\\\\t\\\\n\\\\r ]*[0-7?XZxz][0-7?XZ_xz]*|[Ss]?[Dd][\\\\t\\\\n\\\\r ]*[0-9?XZxz][0-9?XZ_xz]*|[Ss]?[Hh][\\\\t\\\\n\\\\r ]*[?XZxz\\\\h][?XZ_xz\\\\h]*)(([Ee])([-+])?[0-9]+)?(?!['\\\\w])","name":"constant.numeric.systemverilog"},{"match":"'[01XZxz]","name":"constant.numeric.bit.systemverilog"},{"match":"\\\\b\\\\d[._\\\\d]*(?<!\\\\.)[Ee][-+]?[0-9]+\\\\b","name":"constant.numeric.exp.systemverilog"},{"match":"\\\\b\\\\d[._\\\\d]*(?![.\\\\d]|[\\\\t\\\\n\\\\r ]*(?:[Ee]|fs|ps|ns|us|ms|s))\\\\b","name":"constant.numeric.decimal.systemverilog"},{"match":"\\\\b\\\\d[.\\\\d]*[\\\\t\\\\n\\\\r ]*(?:[fnpu]|m?)s\\\\b","name":"constant.numeric.time.systemverilog"},{"include":"#compiler-directives"},{"match":"\\\\b(?:this|super|null)\\\\b","name":"constant.language.systemverilog"},{"match":"\\\\b([A-Z][0-9A-Z_]*)\\\\b","name":"constant.other.net.systemverilog"},{"match":"\\\\b(?<!\\\\.)([0-9A-Z_]+)(?!\\\\.)\\\\b","name":"constant.numeric.parameter.uppercase.systemverilog"},{"match":"\\\\.\\\\*","name":"keyword.operator.quantifier.regexp"}]},"enum-struct-union":{"begin":"[\\\\t\\\\n\\\\r ]*\\\\b(enum|struct|union(?:[\\\\t\\\\n\\\\r ]+tagged)?|class|interface[\\\\t\\\\n\\\\r ]+class)(?:[\\\\t\\\\n\\\\r ]+(?!(?:pack|sign|unsign)ed)([A-Z_a-z][$0-9A-Z_a-z]*)?[\\\\t\\\\n\\\\r ]*(\\\\[[]\\\\t\\\\n\\\\r $%'-+\\\\--:A-\\\\[_-z]*])?)?(?:[\\\\t\\\\n\\\\r ]+(packed))?(?:[\\\\t\\\\n\\\\r ]+((?:|un)signed))?(?=[\\\\t\\\\n\\\\r ]*(?:\\\\{|$))","beginCaptures":{"1":{"name":"keyword.control.systemverilog"},"2":{"patterns":[{"include":"#built-ins"}]},"3":{"patterns":[{"include":"#selects"}]},"4":{"name":"storage.modifier.systemverilog"},"5":{"name":"storage.modifier.systemverilog"}},"end":"(?<=})[\\\\t\\\\n\\\\r ]*([A-Z_a-z][$0-9A-Z_a-z]*|(?<=^|[\\\\t\\\\n\\\\r ])\\\\\\\\[!-~]+(?=$|[\\\\t\\\\n\\\\r ]))[\\\\t\\\\n\\\\r ]*(\\\\[[]\\\\t\\\\n\\\\r $%'-+\\\\--:A-\\\\[_-z]*])?[\\\\t\\\\n\\\\r ]*[,;]","endCaptures":{"1":{"patterns":[{"include":"#identifiers"}]},"2":{"patterns":[{"include":"#selects"}]}},"name":"meta.enum-struct-union.systemverilog","patterns":[{"include":"#keywords"},{"include":"#base-grammar"},{"include":"#identifiers"}]},"fixme-todo":{"patterns":[{"match":"(?i:fixme)","name":"invalid.broken.fixme.systemverilog"},{"match":"(?i:todo)","name":"invalid.unimplemented.todo.systemverilog"}]},"function-task":{"begin":"[\\\\t\\\\n\\\\r ]*(?:\\\\b(virtual)[\\\\t\\\\n\\\\r ]+)?\\\\b(function|task)\\\\b(?:[\\\\t\\\\n\\\\r ]+\\\\b((?:st|autom)atic)\\\\b)?","beginCaptures":{"1":{"name":"storage.modifier.systemverilog"},"2":{"name":"storage.type.function.systemverilog"},"3":{"name":"storage.modifier.systemverilog"}},"end":";","endCaptures":{"0":{"name":"punctuation.definition.function.end.systemverilog"}},"name":"meta.function.systemverilog","patterns":[{"captures":{"1":{"name":"support.type.scope.systemverilog"},"2":{"name":"keyword.operator.scope.systemverilog"},"3":{"patterns":[{"include":"#built-ins"},{"match":"[A-Z_a-z][$0-9A-Z_a-z]*","name":"storage.type.user-defined.systemverilog"}]},"4":{"patterns":[{"include":"#modifiers"}]},"5":{"patterns":[{"include":"#selects"}]},"6":{"name":"entity.name.function.systemverilog"}},"match":"[\\\\t\\\\n\\\\r ]*(?:\\\\b([A-Z_a-z][$0-9A-Z_a-z]*)(::))?([A-Z_a-z][$0-9A-Z_a-z]*\\\\b[\\\\t\\\\n\\\\r ]+)?(?:\\\\b((?:|un)signed)\\\\b[\\\\t\\\\n\\\\r ]*)?(?:(\\\\[[]\\\\t\\\\n\\\\r $%'-+\\\\--:A-\\\\[_-z]*])[\\\\t\\\\n\\\\r ]*)?\\\\b([A-Z_a-z][$0-9A-Z_a-z]*)\\\\b[\\\\t\\\\n\\\\r ]*(?=[(;])"},{"include":"#keywords"},{"include":"#port-net-parameter"},{"include":"#base-grammar"},{"include":"#identifiers"}]},"functions":{"match":"[\\\\t\\\\n\\\\r ]*\\\\b(?!while|for|iff??|else|casex??|casez)([A-Z_a-z][$0-9A-Z_a-z]*)(?=[\\\\t\\\\n\\\\r ]*\\\\()","name":"entity.name.function.systemverilog"},"identifiers":{"patterns":[{"match":"\\\\b[A-Z_a-z][$0-9A-Z_a-z]*\\\\b","name":"variable.other.identifier.systemverilog"},{"match":"(?<=^|[\\\\t\\\\n\\\\r ])\\\\\\\\[!-~]+(?=$|[\\\\t\\\\n\\\\r ])","name":"string.regexp.identifier.systemverilog"}]},"imports":{"captures":{"1":{"name":"keyword.control.systemverilog"},"2":{"name":"support.type.scope.systemverilog"},"3":{"name":"keyword.operator.scope.systemverilog"},"4":{"patterns":[{"include":"#operators"},{"include":"#identifiers"}]}},"match":"[\\\\t\\\\n\\\\r ]*\\\\b((?:im|ex)port)[\\\\t\\\\n\\\\r ]+([A-Z_a-z][$0-9A-Z_a-z]*|\\\\*)[\\\\t\\\\n\\\\r ]*(::)[\\\\t\\\\n\\\\r ]*([A-Z_a-z][$0-9A-Z_a-z]*|\\\\*)[\\\\t\\\\n\\\\r ]*([,;])","name":"meta.import.systemverilog"},"keywords":{"patterns":[{"captures":{"1":{"name":"keyword.other.systemverilog"}},"match":"[\\\\t\\\\n\\\\r ]*\\\\b(edge|negedge|posedge|cell|config|defparam|design|disable|endgenerate|endspecify|event|generate|ifnone|incdir|instance|liblist|library|noshowcancelled|pulsestyle_onevent|pulsestyle_ondetect|scalared|showcancelled|specify|specparam|use|vectored)\\\\b"},{"include":"#sv-control"},{"include":"#sv-control-begin"},{"include":"#sv-control-end"},{"include":"#sv-definition"},{"include":"#sv-cover-cross"},{"include":"#sv-std"},{"include":"#sv-option"},{"include":"#sv-local"},{"include":"#sv-rand"}]},"modifiers":{"match":"[\\\\t\\\\n\\\\r ]*\\\\b(?:(?:un)?signed|packed|small|medium|large|supply[01]|strong[01]|pull[01]|weak[01]|highz[01])\\\\b","name":"storage.modifier.systemverilog"},"module-binding":{"begin":"\\\\.([A-Z_a-z][$0-9A-Z_a-z]*)[\\\\t\\\\n\\\\r ]*\\\\(","beginCaptures":{"1":{"name":"support.function.port.systemverilog"}},"end":"\\\\),?","name":"meta.port.binding.systemverilog","patterns":[{"include":"#constants"},{"include":"#comments"},{"include":"#operators"},{"include":"#strings"},{"include":"#constants"},{"include":"#storage-scope"},{"include":"#cast-operator"},{"include":"#system-tf"},{"match":"\\\\bvirtual\\\\b","name":"storage.modifier.systemverilog"},{"include":"#identifiers"}]},"module-declaration":{"begin":"[\\\\t\\\\n\\\\r ]*\\\\b((?:macro)?module|interface|program|package|modport)[\\\\t\\\\n\\\\r ]+(?:((?:st|autom)atic)[\\\\t\\\\n\\\\r ]+)?([A-Z_a-z][$0-9A-Z_a-z]*)\\\\b","beginCaptures":{"1":{"name":"keyword.control.systemverilog"},"2":{"name":"storage.modifier.systemverilog"},"3":{"name":"entity.name.type.module.systemverilog"}},"end":";","endCaptures":{"0":{"name":"punctuation.definition.module.end.systemverilog"}},"name":"meta.module.systemverilog","patterns":[{"include":"#parameters"},{"include":"#port-net-parameter"},{"include":"#imports"},{"include":"#base-grammar"},{"include":"#system-tf"},{"include":"#identifiers"}]},"module-no-parameters":{"begin":"[\\\\t\\\\n\\\\r ]*\\\\b(?:(bind|pullup|pulldown)[\\\\t\\\\n\\\\r ]+(?:([A-Z_a-z][$.0-9A-Z_a-z]*)[\\\\t\\\\n\\\\r ]+)?)?(\\\\b(?:and|nand|or|nor|xor|xnor|buf|not|bufif[01]|notif[01]|r?[cnp]mos|r?tran|r?tranif[01])\\\\b|[A-Z_a-z][$0-9A-Z_a-z]*)[\\\\t\\\\n\\\\r ]+(?!intersect|and|or|throughout|within)([A-Z_a-z][$0-9A-Z_a-z]*)[\\\\t\\\\n\\\\r ]*(\\\\[[]\\\\t\\\\n\\\\r $%'-+\\\\--:A-\\\\[_-z]*])?[\\\\t\\\\n\\\\r ]*(?=\\\\(|$)(?!;)","beginCaptures":{"1":{"name":"keyword.control.systemverilog"},"2":{"name":"entity.name.type.module.systemverilog"},"3":{"name":"entity.name.type.module.systemverilog"},"4":{"name":"variable.other.module.systemverilog"},"5":{"patterns":[{"include":"#selects"}]}},"end":"\\\\)(?:[\\\\t\\\\n\\\\r ]*(;))?","endCaptures":{"1":{"name":"punctuation.module.instantiation.end.systemverilog"}},"name":"meta.module.no_parameters.systemverilog","patterns":[{"include":"#module-binding"},{"include":"#comments"},{"include":"#operators"},{"include":"#constants"},{"include":"#strings"},{"include":"#port-net-parameter"},{"match":"\\\\b([A-Z_a-z][$0-9A-Z_a-z]*)\\\\b(?=[\\\\t\\\\n\\\\r ]*(\\\\(|$))","name":"variable.other.module.systemverilog"},{"include":"#identifiers"}]},"module-parameters":{"begin":"[\\\\t\\\\n\\\\r ]*\\\\b(?:(bind)[\\\\t\\\\n\\\\r ]+([A-Z_a-z][$.0-9A-Z_a-z]*)[\\\\t\\\\n\\\\r ]+)?([A-Z_a-z][$0-9A-Z_a-z]*)[\\\\t\\\\n\\\\r ]+(?!intersect|and|or|throughout|within)(?=#[^#])","beginCaptures":{"1":{"name":"keyword.control.systemverilog"},"2":{"name":"entity.name.type.module.systemverilog"},"3":{"name":"entity.name.type.module.systemverilog"}},"end":"\\\\)(?:[\\\\t\\\\n\\\\r ]*(;))?","endCaptures":{"1":{"name":"punctuation.module.instantiation.end.systemverilog"}},"name":"meta.module.parameters.systemverilog","patterns":[{"match":"\\\\b([A-Z_a-z][$0-9A-Z_a-z]*)\\\\b(?=[\\\\t\\\\n\\\\r ]*\\\\()","name":"variable.other.module.systemverilog"},{"include":"#module-binding"},{"include":"#parameters"},{"include":"#comments"},{"include":"#operators"},{"include":"#constants"},{"include":"#strings"},{"include":"#port-net-parameter"},{"match":"\\\\b([A-Z_a-z][$0-9A-Z_a-z]*)\\\\b(?=[\\\\t\\\\n\\\\r ]*$)","name":"variable.other.module.systemverilog"},{"include":"#identifiers"}]},"operators":{"patterns":[{"match":"\\\\b(?:dist|inside|with|intersect|and|or|throughout|within|first_match)\\\\b|:=|:/|\\\\|->|\\\\|=>|->>|\\\\*>|#-#|#=#|&&&","name":"keyword.operator.logical.systemverilog"},{"match":"@|##?|->|<->","name":"keyword.operator.channel.systemverilog"},{"match":"(?:[-%\\\\&*+/^|]|>>>?|<<<?|<?)=","name":"keyword.operator.assignment.systemverilog"},{"match":"\\\\+\\\\+","name":"keyword.operator.increment.systemverilog"},{"match":"--","name":"keyword.operator.decrement.systemverilog"},{"match":"[-+]|\\\\*\\\\*|[%*/]","name":"keyword.operator.arithmetic.systemverilog"},{"match":"!|&&|\\\\|\\\\|","name":"keyword.operator.logical.systemverilog"},{"match":"<<<?|>>>?","name":"keyword.operator.bitwise.shift.systemverilog"},{"match":"~&|~\\\\|?|\\\\^~|~\\\\^|[\\\\&^{|]|'\\\\{|[:?}]","name":"keyword.operator.bitwise.systemverilog"},{"match":"<=?|>=?|==\\\\?|!=\\\\?|===|!==|==|!=","name":"keyword.operator.comparison.systemverilog"}]},"parameters":{"begin":"[\\\\t\\\\n\\\\r ]*(#)[\\\\t\\\\n\\\\r ]*(\\\\()","beginCaptures":{"1":{"name":"keyword.operator.channel.systemverilog"},"2":{"name":"punctuation.section.parameters.begin"}},"end":"(\\\\))[\\\\t\\\\n\\\\r ]*(?=[(;A-Z\\\\\\\\_a-z]|$)","endCaptures":{"1":{"name":"punctuation.section.parameters.end"}},"name":"meta.parameters.systemverilog","patterns":[{"include":"#port-net-parameter"},{"include":"#comments"},{"include":"#constants"},{"include":"#operators"},{"include":"#strings"},{"include":"#system-tf"},{"include":"#functions"},{"match":"\\\\bvirtual\\\\b","name":"storage.modifier.systemverilog"},{"include":"#module-binding"}]},"port-net-parameter":{"patterns":[{"captures":{"1":{"name":"support.type.direction.systemverilog"},"2":{"name":"storage.type.net.systemverilog"},"3":{"name":"support.type.scope.systemverilog"},"4":{"name":"keyword.operator.scope.systemverilog"},"5":{"patterns":[{"include":"#built-ins"},{"match":"[A-Z_a-z][$0-9A-Z_a-z]*","name":"storage.type.user-defined.systemverilog"}]},"6":{"patterns":[{"include":"#modifiers"}]},"7":{"patterns":[{"include":"#selects"}]},"8":{"patterns":[{"include":"#constants"},{"include":"#identifiers"}]},"9":{"patterns":[{"include":"#selects"}]}},"match":",?[\\\\t\\\\n\\\\r ]*(?:\\\\b(output|input|inout|ref)\\\\b[\\\\t\\\\n\\\\r ]*)?(?:\\\\b(localparam|parameter|var|supply[01]|tri|triand|trior|trireg|tri[01]|uwire|wire|wand|wor)\\\\b[\\\\t\\\\n\\\\r ]*)?(?:\\\\b([A-Z_a-z][$0-9A-Z_a-z]*)(::))?(?:([A-Z_a-z][$0-9A-Z_a-z]*)\\\\b[\\\\t\\\\n\\\\r ]*)?(?:\\\\b((?:|un)signed)\\\\b[\\\\t\\\\n\\\\r ]*)?(?:(\\\\[[]\\\\t\\\\n\\\\r $%'-+\\\\--:A-\\\\[_-z]*])[\\\\t\\\\n\\\\r ]*)?(?<!(?<!#)[-!%\\\\&(*+/:<-?^|~][\\\\t\\\\n\\\\r ]*)\\\\b([A-Z_a-z][$0-9A-Z_a-z]*)\\\\b[\\\\t\\\\n\\\\r ]*(\\\\[[]\\\\t\\\\n\\\\r $%'-+\\\\--:A-\\\\[_-z]*])?[\\\\t\\\\n\\\\r ]*(?=[),/;=]|$)","name":"meta.port-net-parameter.declaration.systemverilog"}]},"selects":{"begin":"\\\\[","beginCaptures":{"0":{"name":"punctuation.slice.brackets.begin"}},"end":"]","endCaptures":{"0":{"name":"punctuation.slice.brackets.end"}},"name":"meta.brackets.select.systemverilog","patterns":[{"match":"\\\\$(?![a-z])","name":"constant.language.systemverilog"},{"include":"#system-tf"},{"include":"#constants"},{"include":"#operators"},{"include":"#cast-operator"},{"include":"#storage-scope"},{"match":"[A-Z_a-z][$0-9A-Z_a-z]*","name":"variable.other.identifier.systemverilog"}]},"sequence":{"captures":{"1":{"name":"keyword.control.systemverilog"},"2":{"name":"entity.name.function.systemverilog"}},"match":"[\\\\t\\\\n\\\\r ]*\\\\b(sequence)[\\\\t\\\\n\\\\r ]+([A-Z_a-z][$0-9A-Z_a-z]*)\\\\b","name":"meta.sequence.systemverilog"},"storage-scope":{"captures":{"1":{"name":"support.type.scope.systemverilog"},"2":{"name":"keyword.operator.scope.systemverilog"}},"match":"\\\\b([A-Z_a-z][$0-9A-Z_a-z]*)(::)","name":"meta.scope.systemverilog"},"strings":{"patterns":[{"begin":"\`?\\"","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.systemverilog"}},"end":"\\"\`?","endCaptures":{"0":{"name":"punctuation.definition.string.end.systemverilog"}},"name":"string.quoted.double.systemverilog","patterns":[{"match":"\\\\\\\\(?:[\\"\\\\\\\\afntv]|[0-7]{3}|x\\\\h{2})","name":"constant.character.escape.systemverilog"},{"match":"%(\\\\d+\\\\$)?[- #'+0]*[,:;_]?((-?\\\\d+)|\\\\*(-?\\\\d+\\\\$)?)?(\\\\.((-?\\\\d+)|\\\\*(-?\\\\d+\\\\$)?)?)?(hh?|ll|[Ljltz])?[%B-HLMOPS-VXZb-hlmops-vxz]","name":"constant.character.format.placeholder.systemverilog"},{"match":"%","name":"invalid.illegal.placeholder.systemverilog"},{"include":"#fixme-todo"}]},{"begin":"(?<=include)[\\\\t\\\\n\\\\r ]*(<)","beginCaptures":{"1":{"name":"punctuation.definition.string.begin.systemverilog"}},"end":">","endCaptures":{"0":{"name":"punctuation.definition.string.end.systemverilog"}},"name":"string.quoted.other.lt-gt.include.systemverilog"}]},"sv-control":{"captures":{"1":{"name":"keyword.control.systemverilog"}},"match":"[\\\\t\\\\n\\\\r ]*\\\\b(initial|always|always_comb|always_ff|always_latch|final|assign|deassign|force|release|wait|forever|repeat|alias|while|for|iff??|else|casex??|casez|default|endcase|return|break|continue|do|foreach|clocking|coverpoint|property|bins|binsof|illegal_bins|ignore_bins|randcase|matches|solve|before|expect|cross|ref|srandom|struct|chandle|tagged|extern|throughout|timeprecision|timeunit|priority|type|union|wait_order|triggered|randsequence|context|pure|wildcard|new|forkjoin|unique0??|priority)\\\\b"},"sv-control-begin":{"captures":{"1":{"name":"keyword.control.systemverilog"},"2":{"name":"punctuation.definition.label.systemverilog"},"3":{"name":"entity.name.section.systemverilog"}},"match":"[\\\\t\\\\n\\\\r ]*\\\\b(begin|fork)\\\\b(?:[\\\\t\\\\n\\\\r ]*(:)[\\\\t\\\\n\\\\r ]*([A-Z_a-z][$0-9A-Z_a-z]*))?","name":"meta.item.begin.systemverilog"},"sv-control-end":{"captures":{"1":{"name":"keyword.control.systemverilog"},"2":{"name":"punctuation.definition.label.systemverilog"},"3":{"name":"entity.name.section.systemverilog"}},"match":"[\\\\t\\\\n\\\\r ]*\\\\b(end|endmodule|endinterface|endprogram|endchecker|endclass|endpackage|endconfig|endfunction|endtask|endproperty|endsequence|endgroup|endprimitive|endclocking|endgenerate|join|join_any|join_none)\\\\b(?:[\\\\t\\\\n\\\\r ]*(:)[\\\\t\\\\n\\\\r ]*([A-Z_a-z][$0-9A-Z_a-z]*))?","name":"meta.item.end.systemverilog"},"sv-cover-cross":{"captures":{"2":{"name":"entity.name.type.class.systemverilog"},"3":{"name":"keyword.operator.other.systemverilog"},"4":{"name":"keyword.control.systemverilog"}},"match":"(([A-Z_a-z][$0-9A-Z_a-z]*)[\\\\t\\\\n\\\\r ]*(:))?[\\\\t\\\\n\\\\r ]*(c(?:overpoint|ross))[\\\\t\\\\n\\\\r ]+([A-Z_a-z][$0-9A-Z_a-z]*)","name":"meta.definition.systemverilog"},"sv-definition":{"captures":{"1":{"name":"keyword.control.systemverilog"},"2":{"name":"entity.name.type.class.systemverilog"}},"match":"[\\\\t\\\\n\\\\r ]*\\\\b(primitive|package|constraint|interface|covergroup|program)[\\\\t\\\\n\\\\r ]+\\\\b([A-Z_a-z][$0-9A-Z_a-z]*)\\\\b","name":"meta.definition.systemverilog"},"sv-local":{"captures":{"1":{"name":"keyword.other.systemverilog"}},"match":"[\\\\t\\\\n\\\\r ]*\\\\b(const|static|protected|virtual|localparam|parameter|local)\\\\b"},"sv-option":{"captures":{"1":{"name":"keyword.cover.systemverilog"}},"match":"[\\\\t\\\\n\\\\r ]*\\\\b(option)\\\\."},"sv-rand":{"match":"[\\\\t\\\\n\\\\r ]*\\\\brandc??\\\\b","name":"storage.type.rand.systemverilog"},"sv-std":{"match":"\\\\b(std)\\\\b::","name":"support.class.systemverilog"},"system-tf":{"match":"\\\\$[$0-9A-Z_a-z][$0-9A-Z_a-z]*\\\\b","name":"support.function.systemverilog"},"tables":{"begin":"[\\\\t\\\\n\\\\r ]*\\\\b(table)\\\\b","beginCaptures":{"1":{"name":"keyword.table.systemverilog.begin"}},"end":"[\\\\t\\\\n\\\\r ]*\\\\b(endtable)\\\\b","endCaptures":{"1":{"name":"keyword.table.systemverilog.end"}},"name":"meta.table.systemverilog","patterns":[{"include":"#comments"},{"match":"\\\\b[01BFNPRXbfnprx]\\\\b","name":"constant.language.systemverilog"},{"match":"[-*?]","name":"constant.language.systemverilog"},{"captures":{"1":{"name":"constant.language.systemverilog"}},"match":"\\\\(([01?Xx]{2})\\\\)"},{"match":":","name":"punctuation.definition.label.systemverilog"},{"include":"#operators"},{"include":"#constants"},{"include":"#strings"},{"include":"#identifiers"}]},"typedef":{"begin":"[\\\\t\\\\n\\\\r ]*\\\\b(typedef)[\\\\t\\\\n\\\\r ]+(?:([A-Z_a-z][$0-9A-Z_a-z]*)(?:[\\\\t\\\\n\\\\r ]+\\\\b((?:|un)signed)\\\\b)?[\\\\t\\\\n\\\\r ]*(\\\\[[]\\\\t\\\\n\\\\r $%'-+\\\\--:A-\\\\[_-z]*])?)?(?=[\\\\t\\\\n\\\\r ]*[A-Z\\\\\\\\_a-z])","beginCaptures":{"1":{"name":"keyword.control.systemverilog"},"2":{"patterns":[{"include":"#built-ins"},{"match":"\\\\bvirtual\\\\b","name":"storage.modifier.systemverilog"}]},"3":{"patterns":[{"include":"#modifiers"}]},"4":{"patterns":[{"include":"#selects"}]}},"end":";","endCaptures":{"0":{"name":"punctuation.definition.typedef.end.systemverilog"}},"name":"meta.typedef.systemverilog","patterns":[{"include":"#identifiers"},{"include":"#selects"}]},"typedef-enum-struct-union":{"begin":"[\\\\t\\\\n\\\\r ]*\\\\b(typedef)[\\\\t\\\\n\\\\r ]+(enum|struct|union(?:[\\\\t\\\\n\\\\r ]+tagged)?|class|interface[\\\\t\\\\n\\\\r ]+class)(?:[\\\\t\\\\n\\\\r ]+(?!(?:pack|sign|unsign)ed)([A-Z_a-z][$0-9A-Z_a-z]*)?[\\\\t\\\\n\\\\r ]*(\\\\[[]\\\\t\\\\n\\\\r $%'-+\\\\--:A-\\\\[_-z]*])?)?(?:[\\\\t\\\\n\\\\r ]+(packed))?(?:[\\\\t\\\\n\\\\r ]+((?:|un)signed))?(?=[\\\\t\\\\n\\\\r ]*(?:\\\\{|$))","beginCaptures":{"1":{"name":"keyword.control.systemverilog"},"2":{"name":"keyword.control.systemverilog"},"3":{"patterns":[{"include":"#built-ins"}]},"4":{"patterns":[{"include":"#selects"}]},"5":{"name":"storage.modifier.systemverilog"},"6":{"name":"storage.modifier.systemverilog"}},"end":"(?<=})[\\\\t\\\\n\\\\r ]*([A-Z_a-z][$0-9A-Z_a-z]*|(?<=^|[\\\\t\\\\n\\\\r ])\\\\\\\\[!-~]+(?=$|[\\\\t\\\\n\\\\r ]))[\\\\t\\\\n\\\\r ]*(\\\\[[]\\\\t\\\\n\\\\r $%'-+\\\\--:A-\\\\[_-z]*])?[\\\\t\\\\n\\\\r ]*[,;]","endCaptures":{"1":{"name":"storage.type.systemverilog"},"2":{"patterns":[{"include":"#selects"}]}},"name":"meta.typedef-enum-struct-union.systemverilog","patterns":[{"include":"#port-net-parameter"},{"include":"#keywords"},{"include":"#base-grammar"},{"include":"#identifiers"}]}},"scopeName":"source.systemverilog"}`)),t=[e];export{t as default};
1
+ const e=Object.freeze(JSON.parse(`{"displayName":"SystemVerilog","fileTypes":["v","vh","sv","svh"],"name":"system-verilog","patterns":[{"include":"#comments"},{"include":"#strings"},{"include":"#typedef-enum-struct-union"},{"include":"#typedef"},{"include":"#functions"},{"include":"#keywords"},{"include":"#tables"},{"include":"#function-task"},{"include":"#module-declaration"},{"include":"#class-declaration"},{"include":"#enum-struct-union"},{"include":"#sequence"},{"include":"#all-types"},{"include":"#module-parameters"},{"include":"#module-no-parameters"},{"include":"#port-net-parameter"},{"include":"#system-tf"},{"include":"#assertion"},{"include":"#bind-directive"},{"include":"#cast-operator"},{"include":"#storage-scope"},{"include":"#attributes"},{"include":"#imports"},{"include":"#operators"},{"include":"#constants"},{"include":"#identifiers"},{"include":"#selects"}],"repository":{"all-types":{"patterns":[{"include":"#built-ins"},{"include":"#modifiers"}]},"assertion":{"captures":{"1":{"name":"entity.name.goto-label.php"},"2":{"name":"keyword.operator.systemverilog"},"3":{"name":"keyword.sva.systemverilog"}},"match":"\\\\b([A-Z_a-z][$0-9A-Z_a-z]*)[\\\\t\\\\n\\\\r ]*(:)[\\\\t\\\\n\\\\r ]*(assert|assume|cover|restrict)\\\\b"},"attributes":{"begin":"(?<!@[\\\\t\\\\n\\\\r ]?)\\\\(\\\\*","beginCaptures":{"0":{"name":"punctuation.attribute.rounds.begin"}},"end":"\\\\*\\\\)","endCaptures":{"0":{"name":"punctuation.attribute.rounds.end"}},"name":"meta.attribute.systemverilog","patterns":[{"captures":{"1":{"name":"keyword.control.systemverilog"},"2":{"name":"keyword.operator.assignment.systemverilog"}},"match":"([A-Z_a-z][$0-9A-Z_a-z]*)(?:[\\\\t\\\\n\\\\r ]*(=)[\\\\t\\\\n\\\\r ]*)?"},{"include":"#constants"},{"include":"#strings"}]},"base-grammar":{"patterns":[{"include":"#all-types"},{"include":"#comments"},{"include":"#operators"},{"include":"#constants"},{"include":"#strings"},{"captures":{"1":{"name":"storage.type.interface.systemverilog"}},"match":"[\\\\t\\\\n\\\\r ]*(?<![$0-9A-Z_a-z])([A-Z_a-z][$0-9A-Z_a-z]*)(?![$0-9A-Z_a-z])[\\\\t\\\\n\\\\r ]+[A-Z_a-z][\\\\t\\\\n $,0-9=A-Z_a-z]*"},{"include":"#storage-scope"}]},"bind-directive":{"captures":{"1":{"name":"keyword.control.systemverilog"},"2":{"name":"entity.name.type.module.systemverilog"}},"match":"[\\\\t\\\\n\\\\r ]*\\\\b(bind)[\\\\t\\\\n\\\\r ]+([A-Z_a-z][$.0-9A-Z_a-z]*)(?![$0-9A-Z_a-z])","name":"meta.definition.systemverilog"},"built-ins":{"patterns":[{"match":"[\\\\t\\\\n\\\\r ]*\\\\b(bit|logic|reg)\\\\b","name":"storage.type.vector.systemverilog"},{"match":"[\\\\t\\\\n\\\\r ]*\\\\b(byte|shortint|int|longint|integer|time|genvar)\\\\b","name":"storage.type.atom.systemverilog"},{"match":"[\\\\t\\\\n\\\\r ]*\\\\b(shortreal|real|realtime)\\\\b","name":"storage.type.notint.systemverilog"},{"match":"[\\\\t\\\\n\\\\r ]*\\\\b(supply[01]|tri|triand|trior|trireg|tri[01]|uwire|wire|wand|wor)\\\\b","name":"storage.type.net.systemverilog"},{"match":"[\\\\t\\\\n\\\\r ]*\\\\b(genvar|var|void|signed|unsigned|string|const|process)\\\\b","name":"storage.type.built-in.systemverilog"},{"match":"[\\\\t\\\\n\\\\r ]*\\\\b(uvm_(?:root|transaction|component|monitor|driver|test|env|object|agent|sequence_base|sequence_item|sequence_state|sequencer|sequencer_base|sequence|component_registry|analysis_imp|analysis_port|analysis_export|config_db|active_passive_enum|phase|verbosity|tlm_analysis_fifo|tlm_fifo|report_server|objection|recorder|domain|reg_field|reg_block|reg|bitstream_t|radix_enum|printer|packer|comparer|scope_stack))\\\\b","name":"storage.type.uvm.systemverilog"}]},"cast-operator":{"captures":{"1":{"patterns":[{"include":"#built-ins"},{"include":"#constants"},{"match":"[A-Z_a-z][$0-9A-Z_a-z]*","name":"storage.type.user-defined.systemverilog"}]},"2":{"name":"keyword.operator.cast.systemverilog"}},"match":"[\\\\t\\\\n\\\\r ]*([0-9]+|[A-Z_a-z][$0-9A-Z_a-z]*)(')(?=\\\\()","name":"meta.cast.systemverilog"},"class-declaration":{"begin":"[\\\\t\\\\n\\\\r ]*\\\\b(virtual[\\\\t\\\\n\\\\r ]+)?(class)(?:[\\\\t\\\\n\\\\r ]+((?:st|autom)atic))?[\\\\t\\\\n\\\\r ]+([A-Z_a-z][$0-:A-Z_a-z]*)(?:[\\\\t\\\\n\\\\r ]+(extends|implements)[\\\\t\\\\n\\\\r ]+([A-Z_a-z][$0-:A-Z_a-z]*))?","beginCaptures":{"1":{"name":"storage.modifier.systemverilog"},"2":{"name":"storage.type.class.systemverilog"},"3":{"name":"storage.modifier.systemverilog"},"4":{"name":"entity.name.type.class.systemverilog"},"5":{"name":"keyword.control.systemverilog"},"6":{"name":"entity.name.type.class.systemverilog"}},"end":";","endCaptures":{"0":{"name":"punctuation.definition.class.end.systemverilog"}},"name":"meta.class.systemverilog","patterns":[{"captures":{"1":{"name":"keyword.control.systemverilog"},"2":{"name":"entity.name.type.class.systemverilog"},"3":{"name":"entity.name.type.class.systemverilog"}},"match":"[\\\\t\\\\n\\\\r ]+\\\\b(extends|implements)[\\\\t\\\\n\\\\r ]+([A-Z_a-z][$0-:A-Z_a-z]*)(?:[\\\\t\\\\n\\\\r ]*,[\\\\t\\\\n\\\\r ]*([A-Z_a-z][$0-:A-Z_a-z]*))*"},{"captures":{"1":{"name":"storage.type.userdefined.systemverilog"},"2":{"name":"keyword.operator.param.systemverilog"}},"match":"[\\\\t\\\\n\\\\r ]+(?<![$0-9A-Z_a-z])([A-Z_a-z][$0-9A-Z_a-z]*)(?![$0-9A-Z_a-z])[\\\\t\\\\n\\\\r ]*(#)\\\\(","name":"meta.typedef.class.systemverilog"},{"include":"#port-net-parameter"},{"include":"#base-grammar"},{"include":"#module-binding"},{"include":"#identifiers"}]},"comments":{"patterns":[{"begin":"/\\\\*","beginCaptures":{"0":{"name":"punctuation.definition.comment.systemverilog"}},"end":"\\\\*/","endCaptures":{"0":{"name":"punctuation.definition.comment.systemverilog"}},"name":"comment.block.systemverilog","patterns":[{"include":"#fixme-todo"}]},{"begin":"//","beginCaptures":{"0":{"name":"punctuation.definition.comment.systemverilog"}},"end":"$\\\\n?","name":"comment.line.double-slash.systemverilog","patterns":[{"include":"#fixme-todo"}]}]},"compiler-directives":{"name":"meta.preprocessor.systemverilog","patterns":[{"captures":{"1":{"name":"punctuation.definition.directive.systemverilog"},"2":{"name":"string.regexp.systemverilog"}},"match":"(\`)(else|endif|endcelldefine|celldefine|nounconnected_drive|resetall|undefineall|end_keywords|__FILE__|__LINE__)\\\\b"},{"captures":{"1":{"name":"punctuation.definition.directive.systemverilog"},"2":{"name":"string.regexp.systemverilog"},"3":{"name":"variable.other.constant.preprocessor.systemverilog"}},"match":"(\`)(ifdef|ifndef|elsif|define|undef|pragma)[\\\\t\\\\n\\\\r ]+([A-Z_a-z][$0-9A-Z_a-z]*)(?![$0-9A-Z_a-z])"},{"captures":{"1":{"name":"punctuation.definition.directive.systemverilog"},"2":{"name":"string.regexp.systemverilog"}},"match":"(\`)(include|timescale|default_nettype|unconnected_drive|line|begin_keywords)\\\\b"},{"begin":"(\`)(protected)\\\\b","beginCaptures":{"1":{"name":"punctuation.definition.directive.systemverilog"},"2":{"name":"string.regexp.systemverilog"}},"end":"(\`)(endprotected)\\\\b","endCaptures":{"1":{"name":"punctuation.definition.directive.systemverilog"},"2":{"name":"string.regexp.systemverilog"}},"name":"meta.crypto.systemverilog"},{"captures":{"1":{"name":"punctuation.definition.directive.systemverilog"},"2":{"name":"variable.other.constant.preprocessor.systemverilog"}},"match":"(\`)([A-Z_a-z][$0-9A-Z_a-z]*)(?![$0-9A-Z_a-z])"}]},"constants":{"patterns":[{"match":"(\\\\b[1-9][0-9_]*)?'([Ss]?[Bb][\\\\t\\\\n\\\\r ]*[01?XZxz][01?XZ_xz]*|[Ss]?[Oo][\\\\t\\\\n\\\\r ]*[0-7?XZxz][0-7?XZ_xz]*|[Ss]?[Dd][\\\\t\\\\n\\\\r ]*[0-9?XZxz][0-9?XZ_xz]*|[Ss]?[Hh][\\\\t\\\\n\\\\r ]*[?XZxz\\\\h][?XZ_xz\\\\h]*)(([Ee])([-+])?[0-9]+)?(?!['\\\\w])","name":"constant.numeric.systemverilog"},{"match":"'[01XZxz]","name":"constant.numeric.bit.systemverilog"},{"match":"\\\\b\\\\d[._\\\\d]*(?<!\\\\.)[Ee][-+]?[0-9]+\\\\b","name":"constant.numeric.exp.systemverilog"},{"match":"\\\\b\\\\d[._\\\\d]*(?![.\\\\d]|[\\\\t\\\\n\\\\r ]*(?:[Ee]|fs|ps|ns|us|ms|s))\\\\b","name":"constant.numeric.decimal.systemverilog"},{"match":"\\\\b\\\\d[.\\\\d]*[\\\\t\\\\n\\\\r ]*(?:[fnpu]|m?)s\\\\b","name":"constant.numeric.time.systemverilog"},{"include":"#compiler-directives"},{"match":"\\\\b(?:this|super|null)\\\\b","name":"constant.language.systemverilog"},{"match":"\\\\b([A-Z][0-9A-Z_]*)\\\\b","name":"constant.other.net.systemverilog"},{"match":"\\\\b(?<!\\\\.)([0-9A-Z_]+)(?!\\\\.)\\\\b","name":"constant.numeric.parameter.uppercase.systemverilog"},{"match":"\\\\.\\\\*","name":"keyword.operator.quantifier.regexp"}]},"enum-struct-union":{"begin":"[\\\\t\\\\n\\\\r ]*\\\\b(enum|struct|union(?:[\\\\t\\\\n\\\\r ]+tagged)?|class|interface[\\\\t\\\\n\\\\r ]+class)(?:[\\\\t\\\\n\\\\r ]+(?!(?:pack|sign|unsign)ed)([A-Z_a-z][$0-9A-Z_a-z]*)?[\\\\t\\\\n\\\\r ]*(\\\\[[]\\\\t\\\\n\\\\r $%'-+\\\\--:A-\\\\[_-z]*])?)?(?:[\\\\t\\\\n\\\\r ]+(packed))?(?:[\\\\t\\\\n\\\\r ]+((?:|un)signed))?(?=[\\\\t\\\\n\\\\r ]*(?:\\\\{|$))","beginCaptures":{"1":{"name":"keyword.control.systemverilog"},"2":{"patterns":[{"include":"#built-ins"}]},"3":{"patterns":[{"include":"#selects"}]},"4":{"name":"storage.modifier.systemverilog"},"5":{"name":"storage.modifier.systemverilog"}},"end":"(?<=})[\\\\t\\\\n\\\\r ]*([A-Z_a-z][$0-9A-Z_a-z]*|(?<=^|[\\\\t\\\\n\\\\r ])\\\\\\\\[!-~]+(?=$|[\\\\t\\\\n\\\\r ]))[\\\\t\\\\n\\\\r ]*(\\\\[[]\\\\t\\\\n\\\\r $%'-+\\\\--:A-\\\\[_-z]*])?[\\\\t\\\\n\\\\r ]*[,;]","endCaptures":{"1":{"patterns":[{"include":"#identifiers"}]},"2":{"patterns":[{"include":"#selects"}]}},"name":"meta.enum-struct-union.systemverilog","patterns":[{"include":"#keywords"},{"include":"#base-grammar"},{"include":"#identifiers"}]},"fixme-todo":{"patterns":[{"match":"(?i:fixme)","name":"invalid.broken.fixme.systemverilog"},{"match":"(?i:todo)","name":"invalid.unimplemented.todo.systemverilog"}]},"function-task":{"begin":"[\\\\t\\\\n\\\\r ]*(?:\\\\b(virtual)[\\\\t\\\\n\\\\r ]+)?\\\\b(function|task)\\\\b(?:[\\\\t\\\\n\\\\r ]+\\\\b((?:st|autom)atic)\\\\b)?","beginCaptures":{"1":{"name":"storage.modifier.systemverilog"},"2":{"name":"storage.type.function.systemverilog"},"3":{"name":"storage.modifier.systemverilog"}},"end":";","endCaptures":{"0":{"name":"punctuation.definition.function.end.systemverilog"}},"name":"meta.function.systemverilog","patterns":[{"captures":{"1":{"name":"support.type.scope.systemverilog"},"2":{"name":"keyword.operator.scope.systemverilog"},"3":{"patterns":[{"include":"#built-ins"},{"match":"[A-Z_a-z][$0-9A-Z_a-z]*","name":"storage.type.user-defined.systemverilog"}]},"4":{"patterns":[{"include":"#modifiers"}]},"5":{"patterns":[{"include":"#selects"}]},"6":{"name":"entity.name.function.systemverilog"}},"match":"[\\\\t\\\\n\\\\r ]*(?:(?<![$0-9A-Z_a-z])([A-Z_a-z][$0-9A-Z_a-z]*)(::))?([A-Z_a-z][$0-9A-Z_a-z]*(?![$0-9A-Z_a-z])[\\\\t\\\\n\\\\r ]+)?(?:\\\\b((?:|un)signed)\\\\b[\\\\t\\\\n\\\\r ]*)?(?:(\\\\[[]\\\\t\\\\n\\\\r $%'-+\\\\--:A-\\\\[_-z]*])[\\\\t\\\\n\\\\r ]*)?(?<![$0-9A-Z_a-z])([A-Z_a-z][$0-9A-Z_a-z]*)(?![$0-9A-Z_a-z])[\\\\t\\\\n\\\\r ]*(?=[(;])"},{"include":"#keywords"},{"include":"#port-net-parameter"},{"include":"#base-grammar"},{"include":"#identifiers"}]},"functions":{"match":"[\\\\t\\\\n\\\\r ]*\\\\b(?!while|for|iff??|else|casex??|casez)([A-Z_a-z][$0-9A-Z_a-z]*)(?=[\\\\t\\\\n\\\\r ]*\\\\()","name":"entity.name.function.systemverilog"},"identifiers":{"patterns":[{"match":"(?<![$0-9A-Z_a-z])[A-Z_a-z][$0-9A-Z_a-z]*(?![$0-9A-Z_a-z])","name":"variable.other.identifier.systemverilog"},{"match":"(?<=^|[\\\\t\\\\n\\\\r ])\\\\\\\\[!-~]+(?=$|[\\\\t\\\\n\\\\r ])","name":"string.regexp.identifier.systemverilog"}]},"imports":{"captures":{"1":{"name":"keyword.control.systemverilog"},"2":{"name":"support.type.scope.systemverilog"},"3":{"name":"keyword.operator.scope.systemverilog"},"4":{"patterns":[{"include":"#operators"},{"include":"#identifiers"}]}},"match":"[\\\\t\\\\n\\\\r ]*\\\\b((?:im|ex)port)[\\\\t\\\\n\\\\r ]+([A-Z_a-z][$0-9A-Z_a-z]*|\\\\*)[\\\\t\\\\n\\\\r ]*(::)[\\\\t\\\\n\\\\r ]*([A-Z_a-z][$0-9A-Z_a-z]*|\\\\*)[\\\\t\\\\n\\\\r ]*([,;])","name":"meta.import.systemverilog"},"keywords":{"patterns":[{"captures":{"1":{"name":"keyword.other.systemverilog"}},"match":"[\\\\t\\\\n\\\\r ]*\\\\b(edge|negedge|posedge|cell|config|defparam|design|disable|endgenerate|endspecify|event|generate|ifnone|incdir|instance|liblist|library|noshowcancelled|pulsestyle_onevent|pulsestyle_ondetect|scalared|showcancelled|specify|specparam|use|vectored)\\\\b"},{"include":"#sv-control"},{"include":"#sv-control-begin"},{"include":"#sv-control-end"},{"include":"#sv-definition"},{"include":"#sv-cover-cross"},{"include":"#sv-std"},{"include":"#sv-option"},{"include":"#sv-local"},{"include":"#sv-rand"}]},"modifiers":{"match":"[\\\\t\\\\n\\\\r ]*\\\\b(?:(?:un)?signed|packed|small|medium|large|supply[01]|strong[01]|pull[01]|weak[01]|highz[01])\\\\b","name":"storage.modifier.systemverilog"},"module-binding":{"begin":"\\\\.([A-Z_a-z][$0-9A-Z_a-z]*)[\\\\t\\\\n\\\\r ]*\\\\(","beginCaptures":{"1":{"name":"support.function.port.systemverilog"}},"end":"\\\\),?","name":"meta.port.binding.systemverilog","patterns":[{"include":"#constants"},{"include":"#comments"},{"include":"#operators"},{"include":"#strings"},{"include":"#constants"},{"include":"#storage-scope"},{"include":"#cast-operator"},{"include":"#system-tf"},{"match":"\\\\bvirtual\\\\b","name":"storage.modifier.systemverilog"},{"include":"#identifiers"}]},"module-declaration":{"begin":"[\\\\t\\\\n\\\\r ]*\\\\b((?:macro)?module|interface|program|package|modport)[\\\\t\\\\n\\\\r ]+(?:((?:st|autom)atic)[\\\\t\\\\n\\\\r ]+)?([A-Z_a-z][$0-9A-Z_a-z]*)(?![$0-9A-Z_a-z])","beginCaptures":{"1":{"name":"keyword.control.systemverilog"},"2":{"name":"storage.modifier.systemverilog"},"3":{"name":"entity.name.type.module.systemverilog"}},"end":";","endCaptures":{"0":{"name":"punctuation.definition.module.end.systemverilog"}},"name":"meta.module.systemverilog","patterns":[{"include":"#parameters"},{"include":"#port-net-parameter"},{"include":"#imports"},{"include":"#base-grammar"},{"include":"#system-tf"},{"include":"#identifiers"}]},"module-no-parameters":{"begin":"[\\\\t\\\\n\\\\r ]*\\\\b(?:(bind|pullup|pulldown)[\\\\t\\\\n\\\\r ]+(?:([A-Z_a-z][$.0-9A-Z_a-z]*)[\\\\t\\\\n\\\\r ]+)?)?(\\\\b(?:and|nand|or|nor|xor|xnor|buf|not|bufif[01]|notif[01]|r?[cnp]mos|r?tran|r?tranif[01])\\\\b|[A-Z_a-z][$0-9A-Z_a-z]*)[\\\\t\\\\n\\\\r ]+(?!intersect|and|or|throughout|within)([A-Z_a-z][$0-9A-Z_a-z]*)[\\\\t\\\\n\\\\r ]*(\\\\[[]\\\\t\\\\n\\\\r $%'-+\\\\--:A-\\\\[_-z]*])?[\\\\t\\\\n\\\\r ]*(?=\\\\(|$)(?!;)","beginCaptures":{"1":{"name":"keyword.control.systemverilog"},"2":{"name":"entity.name.type.module.systemverilog"},"3":{"name":"entity.name.type.module.systemverilog"},"4":{"name":"variable.other.module.systemverilog"},"5":{"patterns":[{"include":"#selects"}]}},"end":"\\\\)(?:[\\\\t\\\\n\\\\r ]*(;))?","endCaptures":{"1":{"name":"punctuation.module.instantiation.end.systemverilog"}},"name":"meta.module.no_parameters.systemverilog","patterns":[{"include":"#module-binding"},{"include":"#comments"},{"include":"#operators"},{"include":"#constants"},{"include":"#strings"},{"include":"#port-net-parameter"},{"match":"(?<![$0-9A-Z_a-z])([A-Z_a-z][$0-9A-Z_a-z]*)(?![$0-9A-Z_a-z])(?=[\\\\t\\\\n\\\\r ]*(\\\\(|$))","name":"variable.other.module.systemverilog"},{"include":"#identifiers"}]},"module-parameters":{"begin":"^[\\\\t ]*\\\\b(?:(bind)[\\\\t ]+([A-Z_a-z][$.0-9A-Z_a-z]*)[\\\\t ]+)?(?!\\\\b(?:intersect|and|or|throughout|within)\\\\b)([A-Z_a-z][$0-9A-Z_a-z]*)[\\\\t ]*(?=#[^#]|$)","beginCaptures":{"1":{"name":"keyword.control.systemverilog"},"2":{"name":"entity.name.type.module.systemverilog"},"3":{"name":"entity.name.type.module.systemverilog"}},"end":"\\\\)(?:[\\\\t\\\\n\\\\r ]*(;))?","endCaptures":{"1":{"name":"punctuation.module.instantiation.end.systemverilog"}},"name":"meta.module.parameters.systemverilog","patterns":[{"match":"(?<![$0-9A-Z_a-z])([A-Z_a-z][$0-9A-Z_a-z]*)(?![$0-9A-Z_a-z])(?=[\\\\t\\\\n\\\\r ]*\\\\()","name":"variable.other.module.systemverilog"},{"include":"#module-binding"},{"include":"#parameters"},{"include":"#comments"},{"include":"#operators"},{"include":"#constants"},{"include":"#strings"},{"include":"#port-net-parameter"},{"match":"(?<![$0-9A-Z_a-z])([A-Z_a-z][$0-9A-Z_a-z]*)(?![$0-9A-Z_a-z])(?=[\\\\t\\\\n\\\\r ]*$)","name":"variable.other.module.systemverilog"},{"include":"#identifiers"}]},"operators":{"patterns":[{"match":"\\\\b(?:dist|inside|with|intersect|and|or|throughout|within|first_match)\\\\b|:=|:/|\\\\|->|\\\\|=>|->>|\\\\*>|#-#|#=#|&&&","name":"keyword.operator.logical.systemverilog"},{"match":"@|##?|->|<->","name":"keyword.operator.channel.systemverilog"},{"match":"(?:[-%\\\\&*+/^|]|>>>?|<<<?|<?)=","name":"keyword.operator.assignment.systemverilog"},{"match":"\\\\+\\\\+","name":"keyword.operator.increment.systemverilog"},{"match":"--","name":"keyword.operator.decrement.systemverilog"},{"match":"[-+]|\\\\*\\\\*|[%*/]","name":"keyword.operator.arithmetic.systemverilog"},{"match":"!|&&|\\\\|\\\\|","name":"keyword.operator.logical.systemverilog"},{"match":"<<<?|>>>?","name":"keyword.operator.bitwise.shift.systemverilog"},{"match":"~&|~\\\\|?|\\\\^~|~\\\\^|[\\\\&^{|]|'\\\\{|[:?}]","name":"keyword.operator.bitwise.systemverilog"},{"match":"<=?|>=?|==\\\\?|!=\\\\?|===|!==|==|!=","name":"keyword.operator.comparison.systemverilog"}]},"parameters":{"begin":"[\\\\t\\\\n\\\\r ]*(#)[\\\\t\\\\n\\\\r ]*(\\\\()","beginCaptures":{"1":{"name":"keyword.operator.channel.systemverilog"},"2":{"name":"punctuation.section.parameters.begin"}},"end":"(\\\\))[\\\\t\\\\n\\\\r ]*(?=[(;A-Z\\\\\\\\_a-z]|$)","endCaptures":{"1":{"name":"punctuation.section.parameters.end"}},"name":"meta.parameters.systemverilog","patterns":[{"include":"#port-net-parameter"},{"include":"#comments"},{"include":"#constants"},{"include":"#operators"},{"include":"#strings"},{"include":"#system-tf"},{"include":"#functions"},{"match":"\\\\bvirtual\\\\b","name":"storage.modifier.systemverilog"},{"include":"#module-binding"}]},"port-net-parameter":{"patterns":[{"captures":{"1":{"name":"support.type.direction.systemverilog"},"2":{"name":"storage.type.net.systemverilog"},"3":{"name":"support.type.scope.systemverilog"},"4":{"name":"keyword.operator.scope.systemverilog"},"5":{"patterns":[{"include":"#built-ins"},{"match":"[A-Z_a-z][$0-9A-Z_a-z]*","name":"storage.type.user-defined.systemverilog"}]},"6":{"patterns":[{"include":"#modifiers"}]},"7":{"patterns":[{"include":"#selects"}]},"8":{"patterns":[{"include":"#constants"},{"include":"#identifiers"}]},"9":{"patterns":[{"include":"#selects"}]}},"match":",?[\\\\t\\\\n\\\\r ]*(?:\\\\b(output|input|inout|ref)\\\\b[\\\\t\\\\n\\\\r ]*)?(?:\\\\b(localparam|parameter|var|supply[01]|tri|triand|trior|trireg|tri[01]|uwire|wire|wand|wor)\\\\b[\\\\t\\\\n\\\\r ]*)?(?:(?<![$0-9A-Z_a-z])([A-Z_a-z][$0-9A-Z_a-z]*)(::))?(?:([A-Z_a-z][$0-9A-Z_a-z]*)(?![$0-9A-Z_a-z])[\\\\t\\\\n\\\\r ]*)?(?:\\\\b((?:|un)signed)\\\\b[\\\\t\\\\n\\\\r ]*)?(?:(\\\\[[]\\\\t\\\\n\\\\r $%'-+\\\\--:A-\\\\[_-z]*])[\\\\t\\\\n\\\\r ]*)?(?<!(?<!#)[-!%\\\\&(*+/:<-?^|~][\\\\t\\\\n\\\\r ]*)(?<![$0-9A-Z_a-z])([A-Z_a-z][$0-9A-Z_a-z]*)(?![$0-9A-Z_a-z])[\\\\t\\\\n\\\\r ]*(\\\\[[]\\\\t\\\\n\\\\r $%'-+\\\\--:A-\\\\[_-z]*])?[\\\\t\\\\n\\\\r ]*(?=[),/;=]|$)","name":"meta.port-net-parameter.declaration.systemverilog"}]},"selects":{"begin":"\\\\[","beginCaptures":{"0":{"name":"punctuation.slice.brackets.begin"}},"end":"]","endCaptures":{"0":{"name":"punctuation.slice.brackets.end"}},"name":"meta.brackets.select.systemverilog","patterns":[{"match":"\\\\$(?![a-z])","name":"constant.language.systemverilog"},{"include":"#system-tf"},{"include":"#constants"},{"include":"#operators"},{"include":"#cast-operator"},{"include":"#storage-scope"},{"match":"[A-Z_a-z][$0-9A-Z_a-z]*","name":"variable.other.identifier.systemverilog"}]},"sequence":{"captures":{"1":{"name":"keyword.control.systemverilog"},"2":{"name":"entity.name.function.systemverilog"}},"match":"[\\\\t\\\\n\\\\r ]*\\\\b(sequence)[\\\\t\\\\n\\\\r ]+([A-Z_a-z][$0-9A-Z_a-z]*)(?![$0-9A-Z_a-z])","name":"meta.sequence.systemverilog"},"storage-scope":{"captures":{"1":{"name":"support.type.scope.systemverilog"},"2":{"name":"keyword.operator.scope.systemverilog"}},"match":"(?<![$0-9A-Z_a-z])([A-Z_a-z][$0-9A-Z_a-z]*)(::)","name":"meta.scope.systemverilog"},"strings":{"patterns":[{"begin":"\`?\\"","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.systemverilog"}},"end":"\\"\`?","endCaptures":{"0":{"name":"punctuation.definition.string.end.systemverilog"}},"name":"string.quoted.double.systemverilog","patterns":[{"match":"\\\\\\\\(?:[\\"\\\\\\\\afntv]|[0-7]{3}|x\\\\h{2})","name":"constant.character.escape.systemverilog"},{"match":"%(\\\\d+\\\\$)?[- #'+0]*[,:;_]?((-?\\\\d+)|\\\\*(-?\\\\d+\\\\$)?)?(\\\\.((-?\\\\d+)|\\\\*(-?\\\\d+\\\\$)?)?)?(hh?|ll|[Ljltz])?[%B-HLMOPS-VXZb-hlmops-vxz]","name":"constant.character.format.placeholder.systemverilog"},{"match":"%","name":"invalid.illegal.placeholder.systemverilog"},{"include":"#fixme-todo"}]},{"begin":"(?<=include)[\\\\t\\\\n\\\\r ]*(<)","beginCaptures":{"1":{"name":"punctuation.definition.string.begin.systemverilog"}},"end":">","endCaptures":{"0":{"name":"punctuation.definition.string.end.systemverilog"}},"name":"string.quoted.other.lt-gt.include.systemverilog"}]},"sv-control":{"captures":{"1":{"name":"keyword.control.systemverilog"}},"match":"[\\\\t\\\\n\\\\r ]*\\\\b(initial|always|always_comb|always_ff|always_latch|final|assign|deassign|force|release|wait|forever|repeat|alias|while|for|iff??|else|casex??|casez|default|endcase|return|break|continue|do|foreach|clocking|coverpoint|property|bins|binsof|illegal_bins|ignore_bins|randcase|matches|solve|before|expect|cross|ref|srandom|struct|chandle|tagged|extern|throughout|timeprecision|timeunit|priority|type|union|wait_order|triggered|randsequence|context|pure|wildcard|new|forkjoin|unique0??|priority)\\\\b"},"sv-control-begin":{"captures":{"1":{"name":"keyword.control.systemverilog"},"2":{"name":"punctuation.definition.label.systemverilog"},"3":{"name":"entity.name.section.systemverilog"}},"match":"[\\\\t\\\\n\\\\r ]*\\\\b(begin|fork)\\\\b(?:[\\\\t\\\\n\\\\r ]*(:)[\\\\t\\\\n\\\\r ]*([A-Z_a-z][$0-9A-Z_a-z]*))?","name":"meta.item.begin.systemverilog"},"sv-control-end":{"captures":{"1":{"name":"keyword.control.systemverilog"},"2":{"name":"punctuation.definition.label.systemverilog"},"3":{"name":"entity.name.section.systemverilog"}},"match":"[\\\\t\\\\n\\\\r ]*\\\\b(end|endmodule|endinterface|endprogram|endchecker|endclass|endpackage|endconfig|endfunction|endtask|endproperty|endsequence|endgroup|endprimitive|endclocking|endgenerate|join|join_any|join_none)\\\\b(?:[\\\\t\\\\n\\\\r ]*(:)[\\\\t\\\\n\\\\r ]*([A-Z_a-z][$0-9A-Z_a-z]*))?","name":"meta.item.end.systemverilog"},"sv-cover-cross":{"captures":{"2":{"name":"entity.name.type.class.systemverilog"},"3":{"name":"keyword.operator.other.systemverilog"},"4":{"name":"keyword.control.systemverilog"}},"match":"(([A-Z_a-z][$0-9A-Z_a-z]*)[\\\\t\\\\n\\\\r ]*(:))?[\\\\t\\\\n\\\\r ]*(c(?:overpoint|ross))[\\\\t\\\\n\\\\r ]+([A-Z_a-z][$0-9A-Z_a-z]*)","name":"meta.definition.systemverilog"},"sv-definition":{"captures":{"1":{"name":"keyword.control.systemverilog"},"2":{"name":"entity.name.type.class.systemverilog"}},"match":"[\\\\t\\\\n\\\\r ]*\\\\b(primitive|package|constraint|interface|covergroup|program)[\\\\t\\\\n\\\\r ]+(?<![$0-9A-Z_a-z])([A-Z_a-z][$0-9A-Z_a-z]*)(?![$0-9A-Z_a-z])","name":"meta.definition.systemverilog"},"sv-local":{"captures":{"1":{"name":"keyword.other.systemverilog"}},"match":"[\\\\t\\\\n\\\\r ]*\\\\b(const|static|protected|virtual|localparam|parameter|local)\\\\b"},"sv-option":{"captures":{"1":{"name":"keyword.cover.systemverilog"}},"match":"[\\\\t\\\\n\\\\r ]*\\\\b(option)\\\\."},"sv-rand":{"match":"[\\\\t\\\\n\\\\r ]*\\\\brandc??\\\\b","name":"storage.type.rand.systemverilog"},"sv-std":{"match":"\\\\b(std)\\\\b::","name":"support.class.systemverilog"},"system-tf":{"match":"(?<![$0-9A-Z_a-z])\\\\$[$0-9A-Z_a-z]+(?![$0-9A-Z_a-z])","name":"support.function.systemverilog"},"tables":{"begin":"[\\\\t\\\\n\\\\r ]*\\\\b(table)\\\\b","beginCaptures":{"1":{"name":"keyword.table.systemverilog.begin"}},"end":"[\\\\t\\\\n\\\\r ]*\\\\b(endtable)\\\\b","endCaptures":{"1":{"name":"keyword.table.systemverilog.end"}},"name":"meta.table.systemverilog","patterns":[{"include":"#comments"},{"match":"\\\\b[01BFNPRXbfnprx]\\\\b","name":"constant.language.systemverilog"},{"match":"[-*?]","name":"constant.language.systemverilog"},{"captures":{"1":{"name":"constant.language.systemverilog"}},"match":"\\\\(([01?Xx]{2})\\\\)"},{"match":":","name":"punctuation.definition.label.systemverilog"},{"include":"#operators"},{"include":"#constants"},{"include":"#strings"},{"include":"#identifiers"}]},"typedef":{"begin":"[\\\\t\\\\n\\\\r ]*\\\\b(typedef)[\\\\t\\\\n\\\\r ]+(?:([A-Z_a-z][$0-9A-Z_a-z]*)(?:[\\\\t\\\\n\\\\r ]+\\\\b((?:|un)signed)\\\\b)?[\\\\t\\\\n\\\\r ]*(\\\\[[]\\\\t\\\\n\\\\r $%'-+\\\\--:A-\\\\[_-z]*])?)?(?=[\\\\t\\\\n\\\\r ]*[A-Z\\\\\\\\_a-z])","beginCaptures":{"1":{"name":"keyword.control.systemverilog"},"2":{"patterns":[{"include":"#built-ins"},{"match":"\\\\bvirtual\\\\b","name":"storage.modifier.systemverilog"}]},"3":{"patterns":[{"include":"#modifiers"}]},"4":{"patterns":[{"include":"#selects"}]}},"end":";","endCaptures":{"0":{"name":"punctuation.definition.typedef.end.systemverilog"}},"name":"meta.typedef.systemverilog","patterns":[{"include":"#identifiers"},{"include":"#selects"}]},"typedef-enum-struct-union":{"begin":"[\\\\t\\\\n\\\\r ]*\\\\b(typedef)[\\\\t\\\\n\\\\r ]+(enum|struct|union(?:[\\\\t\\\\n\\\\r ]+tagged)?|class|interface[\\\\t\\\\n\\\\r ]+class)(?:[\\\\t\\\\n\\\\r ]+(?!(?:pack|sign|unsign)ed)([A-Z_a-z][$0-9A-Z_a-z]*)?[\\\\t\\\\n\\\\r ]*(\\\\[[]\\\\t\\\\n\\\\r $%'-+\\\\--:A-\\\\[_-z]*])?)?(?:[\\\\t\\\\n\\\\r ]+(packed))?(?:[\\\\t\\\\n\\\\r ]+((?:|un)signed))?(?=[\\\\t\\\\n\\\\r ]*(?:\\\\{|$))","beginCaptures":{"1":{"name":"keyword.control.systemverilog"},"2":{"name":"keyword.control.systemverilog"},"3":{"patterns":[{"include":"#built-ins"}]},"4":{"patterns":[{"include":"#selects"}]},"5":{"name":"storage.modifier.systemverilog"},"6":{"name":"storage.modifier.systemverilog"}},"end":"(?<=})[\\\\t\\\\n\\\\r ]*([A-Z_a-z][$0-9A-Z_a-z]*|(?<=^|[\\\\t\\\\n\\\\r ])\\\\\\\\[!-~]+(?=$|[\\\\t\\\\n\\\\r ]))[\\\\t\\\\n\\\\r ]*(\\\\[[]\\\\t\\\\n\\\\r $%'-+\\\\--:A-\\\\[_-z]*])?[\\\\t\\\\n\\\\r ]*[,;]","endCaptures":{"1":{"name":"storage.type.systemverilog"},"2":{"patterns":[{"include":"#selects"}]}},"name":"meta.typedef-enum-struct-union.systemverilog","patterns":[{"include":"#port-net-parameter"},{"include":"#keywords"},{"include":"#base-grammar"},{"include":"#identifiers"}]}},"scopeName":"source.systemverilog"}`)),t=[e];export{t as default};