@softistx/pulsarix-widget 0.8.2 → 0.8.4

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 (112) hide show
  1. package/dist/chunks/{abnfDiagram-XWFEHMT6.jcqkp43e.js → abnfDiagram-XWFEHMT6.b9yk4x5x.js} +1 -1
  2. package/dist/chunks/architecture-WOLXFQ4H.aft3rkrr.js +1 -0
  3. package/dist/chunks/{architectureDiagram-CSQXQB3N.pk9dxdfb.js → architectureDiagram-CSQXQB3N.qz18rz0g.js} +1 -1
  4. package/dist/chunks/{blockDiagram-BEDRHYPZ.ehefn7dt.js → blockDiagram-BEDRHYPZ.bb08b9nt.js} +1 -1
  5. package/dist/chunks/{c4Diagram-M2UUVUY5.knj3as6x.js → c4Diagram-M2UUVUY5.px0epccd.js} +2 -2
  6. package/dist/chunks/{chat-markdown-DLDNLXM9.tvekh9sm.js → chat-markdown-CrbWbK1O.k4nmgyey.js} +5 -5
  7. package/dist/chunks/{classDiagram-v2-KXABOMEV.vtb7vjzn.js → classDiagram-v2-KXABOMEV.f02387t9.js} +2 -2
  8. package/dist/chunks/{cose-bilkent-JH36ORCC.gb18dr42.js → cose-bilkent-JH36ORCC.azq9k24r.js} +1 -1
  9. package/dist/chunks/cynefin-EF2NZ3EQ.dk039jny.js +1 -0
  10. package/dist/chunks/{cynefinDiagram-NJNITYFG.akmr90zk.js → cynefinDiagram-NJNITYFG.zt7gprt1.js} +1 -1
  11. package/dist/chunks/{dagre-KIHZ2IZ3.7n7s7vq2.js → dagre-KIHZ2IZ3.702bqbr9.js} +1 -1
  12. package/dist/chunks/{diagram-7YQZDPLS.d3sdv0py.js → diagram-7YQZDPLS.m7vf21j6.js} +1 -1
  13. package/dist/chunks/{diagram-QBROCOUO.2v08zs42.js → diagram-QBROCOUO.33e5hv7x.js} +3 -3
  14. package/dist/chunks/{diagram-RJJCUUZO.tpnwa621.js → diagram-RJJCUUZO.94k74bz7.js} +2 -2
  15. package/dist/chunks/{diagram-WERXNKYE.hz7tgbtr.js → diagram-WERXNKYE.7fe849z6.js} +1 -1
  16. package/dist/chunks/{diagram-YHHI257C.9gge9ecb.js → diagram-YHHI257C.qjjjfq7w.js} +2 -2
  17. package/dist/chunks/{diagram-YR4HJLHV.bajpx75b.js → diagram-YR4HJLHV.310x2we2.js} +1 -1
  18. package/dist/chunks/{ebnfDiagram-N527522P.hxbbq671.js → ebnfDiagram-N527522P.a4crteq1.js} +1 -1
  19. package/dist/chunks/{editor-shortcuts-dialog-I77EAez1.0s00eh53.js → editor-shortcuts-dialog-B0ppoiza.x3p4h07t.js} +1 -1
  20. package/dist/chunks/editor.arg3zy29.js +4 -0
  21. package/dist/chunks/{elk-O5DQBFGD.vy7cdqps.js → elk-O5DQBFGD.dx61etan.js} +1 -1
  22. package/dist/chunks/{emoji-picker-BofyuTmK.qf287fk6.js → emoji-picker-CbvQZ2ZL.nst616hd.js} +2 -2
  23. package/dist/chunks/{erDiagram-K3K3BIDK.kzs3v0ts.js → erDiagram-K3K3BIDK.qzqv67zm.js} +5 -5
  24. package/dist/chunks/eventmodeling-K75KTNOO.gmm1bcak.js +1 -0
  25. package/dist/chunks/{flow-diagram-OPO1ep57.5006stqg.js → flow-diagram-AiM6FiIm.73jr19pb.js} +1 -1
  26. package/dist/chunks/flowDiagram-Z6JWZHQI.fzwqg115.js +1 -0
  27. package/dist/chunks/{ganttDiagram-3PRQTZWP.qkcp8pvg.js → ganttDiagram-3PRQTZWP.xngzb32h.js} +2 -2
  28. package/dist/chunks/gitGraph-VSP46ZUC.0m8jykgw.js +1 -0
  29. package/dist/chunks/{gitGraphDiagram-VXDFKS5L.ry9dejxm.js → gitGraphDiagram-VXDFKS5L.1sm36z2q.js} +1 -1
  30. package/dist/chunks/{grid-E2QIVN74.q51enfx7.js → grid-E2QIVN74.76pgtn2n.js} +1 -1
  31. package/dist/chunks/illustration-BOW28wq5.bkz28k1x.js +1 -0
  32. package/dist/chunks/{index.23p1k2rx.js → index.0e4s8r4m.js} +1 -1
  33. package/dist/chunks/{index.bfeafb22.js → index.0k4tbjhp.js} +1 -1
  34. package/dist/chunks/{index.fab58nn0.js → index.1d7qpsyx.js} +2 -2
  35. package/dist/chunks/{index.q9dsw4bt.js → index.32jxrb9b.js} +2 -2
  36. package/dist/chunks/{index.9zhger75.js → index.7gxz6d1f.js} +2 -2
  37. package/dist/chunks/{index.gqa9s37g.js → index.7k5v3p25.js} +1 -1
  38. package/dist/chunks/{index.vnhefjwh.js → index.8f3x951p.js} +1 -1
  39. package/dist/chunks/{index.h6120080.js → index.9bf5qrah.js} +1 -1
  40. package/dist/chunks/{index.fgsp5qqn.js → index.a1bxkgd3.js} +10 -10
  41. package/dist/chunks/{index.cf9nd6xy.js → index.a6rz456z.js} +2 -2
  42. package/dist/chunks/{index.eec12m3n.js → index.dnnzjw18.js} +1 -1
  43. package/dist/chunks/index.e35b4yh5.js +44 -0
  44. package/dist/chunks/{index.51yk4ene.js → index.fbeztcp3.js} +1 -1
  45. package/dist/chunks/{index.fvh2m60c.js → index.hvdnkr5m.js} +2 -2
  46. package/dist/chunks/{index.3k4gyba0.js → index.nsckd1vt.js} +2 -2
  47. package/dist/chunks/{index.yf0h5qnv.js → index.r0p3fm9f.js} +1 -1
  48. package/dist/chunks/{index.x163xe9c.js → index.rfyzb2yv.js} +1 -1
  49. package/dist/chunks/{index.x1xqs5m5.js → index.t34t6kpe.js} +2 -2
  50. package/dist/chunks/{index.20dvswea.js → index.wrjdgn4c.js} +2 -2
  51. package/dist/chunks/{index.153rcscj.js → index.zm5x44tn.js} +1 -1
  52. package/dist/chunks/info-OHQRW6UA.e0a85drn.js +1 -0
  53. package/dist/chunks/{infoDiagram-EZ3ZOAHP.r2yygqw8.js → infoDiagram-EZ3ZOAHP.pfd0fjwn.js} +1 -1
  54. package/dist/chunks/{ishikawaDiagram-S3EKX5GW.gwqtdvb2.js → ishikawaDiagram-S3EKX5GW.h5kjez1x.js} +2 -2
  55. package/dist/chunks/{journeyDiagram-POQNLL5X.rp31qkq5.js → journeyDiagram-POQNLL5X.55cqc9p0.js} +2 -2
  56. package/dist/chunks/{kanban-definition-BH5XI6FM.ymsqx6en.js → kanban-definition-BH5XI6FM.pkdvda4y.js} +1 -1
  57. package/dist/chunks/{markup-color-chrome-ykGNUl8y.06cy435c.js → markup-color-chrome-ykGNUl8y.0ds56d6x.js} +1 -1
  58. package/dist/chunks/{markup-custom-color-C8Xc6JxB.an2wngns.js → markup-custom-color-Dgm2hHI7.7darvajx.js} +1 -1
  59. package/dist/chunks/{mention-list-Dhq70jL5.1k61f24q.js → mention-list-CkAUzPBG.mtjgmmzb.js} +1 -1
  60. package/dist/chunks/{mermaid.core.x45crg0h.js → mermaid.core.j7s05j63.js} +4 -4
  61. package/dist/chunks/{mindmap-definition-WVAN44T4.5cbd4rg2.js → mindmap-definition-WVAN44T4.x3jbxvft.js} +1 -1
  62. package/dist/chunks/packet-JDAUHWVQ.52409p3r.js +1 -0
  63. package/dist/chunks/{panel.nm4pj2wm.js → panel.9tp7gr60.js} +1 -1
  64. package/dist/chunks/{pegDiagram-D4NLKWP3.fsryts4r.js → pegDiagram-D4NLKWP3.xq15gqy9.js} +1 -1
  65. package/dist/chunks/pie-XZMESJXO.q5kre8cx.js +1 -0
  66. package/dist/chunks/{pieDiagram-36ENHN4W.k4k2gvg0.js → pieDiagram-36ENHN4W.8h0wam54.js} +2 -2
  67. package/dist/chunks/{plated-illustration-BzxADkoZ.wtc9psry.js → plated-illustration-COZYWJ81.xy7ba5mq.js} +1 -1
  68. package/dist/chunks/{quadrantDiagram-ZQUDMS73.j7nj12w0.js → quadrantDiagram-ZQUDMS73.k28g8jpn.js} +2 -2
  69. package/dist/chunks/radar-ABXABTNO.yk872k2n.js +1 -0
  70. package/dist/chunks/railroad-I3PHUGI6.9wfa6vs3.js +1 -0
  71. package/dist/chunks/railroad-abnf-LNEFI6M7.70zznk3b.js +1 -0
  72. package/dist/chunks/railroad-ebnf-DWYD2UWJ.4pvdng0p.js +1 -0
  73. package/dist/chunks/railroad-peg-JR7BVNR7.ev15ebp6.js +1 -0
  74. package/dist/chunks/{railroadDiagram-JIZHGYPL.a681wt3b.js → railroadDiagram-JIZHGYPL.e7p2vqgg.js} +1 -1
  75. package/dist/chunks/{render-VIF2ZAQL.rn9hpsbx.js → render-VIF2ZAQL.w5ytncsg.js} +1 -1
  76. package/dist/chunks/{requirementDiagram-AXW2TVFA.shapgy39.js → requirementDiagram-AXW2TVFA.arekdz02.js} +2 -2
  77. package/dist/chunks/{sankeyDiagram-FBCJTAIF.2syz1e2b.js → sankeyDiagram-FBCJTAIF.1d04xcmb.js} +2 -2
  78. package/dist/chunks/{sequenceDiagram-3LA2ROMG.jq1w12a6.js → sequenceDiagram-3LA2ROMG.j4xywwp1.js} +2 -2
  79. package/dist/chunks/{sizeCapture-2Q2CQKSF.jtv53a6j.js → sizeCapture-2Q2CQKSF.862bnf6p.js} +1 -1
  80. package/dist/chunks/{stateDiagram-v2-ATKHQDJO.x0g2rngz.js → stateDiagram-v2-ATKHQDJO.xvvtr0y2.js} +2 -2
  81. package/dist/chunks/{swimlanes-YQL5WMAO.j7j7c6ex.js → swimlanes-YQL5WMAO.dtnjb4xt.js} +1 -1
  82. package/dist/chunks/swimlanesDiagram-UCCPES4V.0q8kd5qn.js +8 -0
  83. package/dist/chunks/{timeline-definition-7Z437IG3.s5bvn8dr.js → timeline-definition-7Z437IG3.zfhqzc4r.js} +1 -1
  84. package/dist/chunks/treeView-D4JQ5SDB.3fzswdjp.js +1 -0
  85. package/dist/chunks/treemap-SAJKECNS.cgh74bhn.js +1 -0
  86. package/dist/chunks/{usecaseDiagram-RDK6N6HP.9k4r423e.js → usecaseDiagram-RDK6N6HP.ewxnyz4c.js} +2 -2
  87. package/dist/chunks/{vennDiagram-SHRQU5PJ.82q5dzm6.js → vennDiagram-SHRQU5PJ.wkzf1f00.js} +2 -2
  88. package/dist/chunks/wardley-7MLQ67FV.6q5tgt0s.js +1 -0
  89. package/dist/chunks/{wardleyDiagram-F3OXNVQS.fm4tw2nc.js → wardleyDiagram-F3OXNVQS.srjfm4nb.js} +1 -1
  90. package/dist/chunks/{xychartDiagram-GDYJKCDI.57vqn2zd.js → xychartDiagram-GDYJKCDI.xfa2vexk.js} +2 -2
  91. package/dist/index.js +16 -16
  92. package/package.json +2 -2
  93. package/dist/chunks/architecture-WOLXFQ4H.6qa86taq.js +0 -1
  94. package/dist/chunks/cynefin-EF2NZ3EQ.e86yfa9w.js +0 -1
  95. package/dist/chunks/editor.h5bxwyxn.js +0 -4
  96. package/dist/chunks/eventmodeling-K75KTNOO.9yb5zf47.js +0 -1
  97. package/dist/chunks/flowDiagram-Z6JWZHQI.zf0kndsp.js +0 -1
  98. package/dist/chunks/gitGraph-VSP46ZUC.txpj8e6d.js +0 -1
  99. package/dist/chunks/illustration-BoOzuxNg.h0gnxa4s.js +0 -1
  100. package/dist/chunks/index.0hrfbrja.js +0 -44
  101. package/dist/chunks/info-OHQRW6UA.xea9bh7d.js +0 -1
  102. package/dist/chunks/packet-JDAUHWVQ.c7dmae11.js +0 -1
  103. package/dist/chunks/pie-XZMESJXO.6rv4kzjx.js +0 -1
  104. package/dist/chunks/radar-ABXABTNO.58dfc8ba.js +0 -1
  105. package/dist/chunks/railroad-I3PHUGI6.00fqbahv.js +0 -1
  106. package/dist/chunks/railroad-abnf-LNEFI6M7.gt1x50q5.js +0 -1
  107. package/dist/chunks/railroad-ebnf-DWYD2UWJ.qr5qfkga.js +0 -1
  108. package/dist/chunks/railroad-peg-JR7BVNR7.m61rq7hj.js +0 -1
  109. package/dist/chunks/swimlanesDiagram-UCCPES4V.tzqcsrmd.js +0 -8
  110. package/dist/chunks/treeView-D4JQ5SDB.0x1grm2t.js +0 -1
  111. package/dist/chunks/treemap-SAJKECNS.1te19jsm.js +0 -1
  112. package/dist/chunks/wardley-7MLQ67FV.zp6gykk3.js +0 -1
@@ -1,4 +1,4 @@
1
- import{e,n,u,N,Bt,wl,St,gr,$t,yn,br}from"./index.fgsp5qqn.js";import{Le,Ge,st,De,vt,ir,te,Te,pt,or,mt,Hn,Oi,Pi,Bi,$r,Dt,Fi,zr,Ve,Hr,Yt,Ot,Ur,sr,qr,$i,zi,Un,Re,Hi,jr,lr,Gr,qn,jn,cr,Ui,Gn,qi,Ta,yt,Vn,ji,Gi,Vi,et,Wn,Kn,Vr,Wi,Yn,b,lt,xt,Ie,ur,ue}from"./index.20dvswea.js";import{Ii,Mi,Q,dn,cl,Ni,ot}from"./index.fvh2m60c.js";import{sa}from"./index.0hrfbrja.js";var mr={};sa(mr,{default:()=>Z});var so=/\s/;function uo(r){var t=r.length;while(t--&&so.test(r.charAt(t)));return t}var ae=uo;var co=/^\s+/;function po(r){return r?r.slice(0,ae(r)+1).replace(co,""):r}var fe=po;var se=NaN,lo=/^[-+]0x[0-9a-f]+$/i,mo=/^0b[01]+$/i,ho=/^0o[0-7]+$/i,go=parseInt;function vo(r){if(typeof r=="number")return r;if(vt(r))return se;if(Te(r)){var t=typeof r.valueOf=="function"?r.valueOf():r;r=Te(t)?t+"":t}if(typeof r!="string")return r===0?r:+r;r=fe(r);var o=mo.test(r);return o||ho.test(r)?go(r.slice(2),o?2:8):lo.test(r)?se:+r}var de=vo;var ce=1/0,bo=179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000;function yo(r){if(!r)return r===0?r:0;if(r=de(r),r===ce||r===-ce){var t=r<0?-1:1;return t*bo}return r===r?r:0}var V=yo;function wo(r){var t=V(r),o=t%1;return t===t?o?t-o:t:0}var pe=wo;var le=Object.create,_o=function(){function r(){}return function(t){if(!Te(t))return{};if(le)return le(t);r.prototype=t;var o=new r;return r.prototype=void 0,o}}(),me=_o;function Eo(r,t){var o=-1,i=r.length;t||(t=Array(i));while(++o<i)t[o]=r[o];return t}var dr=Eo;function xo(r,t,o){if(t=="__proto__"&&Hn)Hn(r,t,{configurable:!0,enumerable:!0,value:o,writable:!0});else r[t]=o}var M=xo;var Oo=Object.prototype,Lo=Oo.hasOwnProperty;function Io(r,t,o){var i=r[t];if(!(Lo.call(r,t)&&Dt(i,o))||o===void 0&&!(t in r))M(r,t,o)}var j=Io;function So(r,t,o,i){var a=!o;o||(o={});var f=-1,s=t.length;while(++f<s){var d=t[f],c=i?i(o[d],r[d],d,o,r):void 0;if(c===void 0)c=r[d];if(a)M(o,d,c);else j(o,d,c)}return o}var k=So;function No(r,t,o){if(!Te(o))return!1;var i=typeof t;if(i=="number"?Ve(o)&&$r(t,o.length):i=="string"&&(t in o))return Dt(o[t],r);return!1}var C=No;function Po(r){return zr(function(t,o){var i=-1,a=o.length,f=a>1?o[a-1]:void 0,s=a>2?o[2]:void 0;if(f=r.length>3&&typeof f=="function"?(a--,f):void 0,s&&C(o[0],o[1],s))f=a<3?void 0:f,a=1;t=Object(t);while(++i<a){var d=o[i];if(d)r(t,d,i,f)}return t})}var he=Po;function ko(r){var t=[];if(r!=null)for(var o in Object(r))t.push(o);return t}var ge=ko;var To=Object.prototype,Co=To.hasOwnProperty;function Ao(r){if(!Te(r))return ge(r);var t=Hr(r),o=[];for(var i in r)if(!(i=="constructor"&&(t||!Co.call(r,i))))o.push(i);return o}var ve=Ao;function Ro(r){return Ve(r)?$i(r,!0):ve(r)}var L=Ro;function Mo(r){var t=r==null?0:r.length;return t?jn(r,1):[]}var S=Mo;function jo(r){return Oi(Fi(r,void 0,S),r+"")}var be=jo;var Bo=zi(Object.getPrototypeOf,Object),Y=Bo;var Do="[object Object]",Fo=Function.prototype,Go=Object.prototype,ye=Fo.toString,Xo=Go.hasOwnProperty,Uo=ye.call(Object);function Vo(r){if(!De(r)||st(r)!=Do)return!1;var t=Y(r);if(t===null)return!0;var o=Xo.call(t,"constructor")&&t.constructor;return typeof o=="function"&&o instanceof o&&ye.call(o)==Uo}var we=Vo;var Yo="\\ud800-\\udfff",zo="\\u0300-\\u036f",Wo="\\ufe20-\\ufe2f",qo="\\u20d0-\\u20ff",Ho=zo+Wo+qo,Ko="\\ufe0e\\ufe0f",Jo="\\u200d",Zo=RegExp("["+Jo+Yo+Ho+Ko+"]");function $o(r){return Zo.test(r)}var _e=$o;function Qo(r,t){return r&&k(t,Re(t),r)}var Ee=Qo;function ri(r,t){return r&&k(t,L(t),r)}var xe=ri;var Pe=typeof mr=="object"&&mr&&!mr.nodeType&&mr,Oe=Pe&&typeof pr=="object"&&pr&&!pr.nodeType&&pr,ei=Oe&&Oe.exports===Pe,Se=ei?Le.Buffer:void 0,Ne=Se?Se.allocUnsafe:void 0;function ti(r,t){if(t)return r.slice();var o=r.length,i=Ne?Ne(o):new r.constructor(o);return r.copy(i),i}var Z=ti;function ni(r,t){return k(r,Gn(r),t)}var ke=ni;var oi=Object.getOwnPropertySymbols,ii=!oi?Ui:function(r){var t=[];while(r)qn(t,Gn(r)),r=Y(r);return t},hr=ii;function ai(r,t){return k(r,hr(r),t)}var Ce=ai;function fi(r){return qi(r,L,hr)}var Ae=fi;var si=Object.prototype,ui=si.hasOwnProperty;function di(r){var t=r.length,o=new r.constructor(t);if(t&&typeof r[0]=="string"&&ui.call(r,"index"))o.index=r.index,o.input=r.input;return o}var Me=di;function ci(r){var t=new r.constructor(r.byteLength);return new Vn(t).set(new Vn(r)),t}var z=ci;function pi(r,t){var o=t?z(r.buffer):r.buffer;return new r.constructor(o,r.byteOffset,r.byteLength)}var je=pi;var li=/\w*$/;function mi(r){var t=new r.constructor(r.source,li.exec(r));return t.lastIndex=r.lastIndex,t}var Be=mi;var Fe=Ge?Ge.prototype:void 0,Xe=Fe?Fe.valueOf:void 0;function hi(r){return Xe?Object(Xe.call(r)):{}}var Ue=hi;function gi(r,t){var o=t?z(r.buffer):r.buffer;return new r.constructor(o,r.byteOffset,r.length)}var vr=gi;var vi="[object Boolean]",bi="[object Date]",yi="[object Map]",wi="[object Number]",_i="[object RegExp]",Ei="[object Set]",xi="[object String]",Li="[object Symbol]",Si="[object ArrayBuffer]",ki="[object DataView]",Ti="[object Float32Array]",Ci="[object Float64Array]",Ai="[object Int8Array]",Ri="[object Int16Array]",Di="[object Int32Array]",Xi="[object Uint8Array]",Yi="[object Uint8ClampedArray]",Ki="[object Uint16Array]",Ji="[object Uint32Array]";function Zi(r,t,o){var i=r.constructor;switch(t){case Si:return z(r);case vi:case bi:return new i(+r);case ki:return je(r,o);case Ti:case Ci:case Ai:case Ri:case Di:case Xi:case Yi:case Ki:case Ji:return vr(r,o);case yi:return new i;case wi:case xi:return new i(r);case _i:return Be(r);case Ei:return new i;case Li:return Ue(r)}}var Ye=Zi;function Qi(r){return typeof r.constructor=="function"&&!Hr(r)?me(Y(r)):{}}var yr=Qi;var ra="[object Map]";function ea(r){return De(r)&&yt(r)==ra}var ze=ea;var We=sr&&sr.isMap,ta=We?Ur(We):ze,qe=ta;var na="[object Set]";function oa(r){return De(r)&&yt(r)==na}var He=oa;var Ke=sr&&sr.isSet,ia=Ke?Ur(Ke):He,Je=ia;var aa=1,fa=2,ua=4,Ze="[object Arguments]",da="[object Array]",ca="[object Boolean]",pa="[object Date]",la="[object Error]",$e="[object Function]",ma="[object GeneratorFunction]",ha="[object Map]",ga="[object Number]",Qe="[object Object]",va="[object RegExp]",ba="[object Set]",ya="[object String]",wa="[object Symbol]",_a="[object WeakMap]",Ea="[object ArrayBuffer]",xa="[object DataView]",Oa="[object Float32Array]",La="[object Float64Array]",Ia="[object Int8Array]",Sa="[object Int16Array]",Na="[object Int32Array]",Pa="[object Uint8Array]",ka="[object Uint8ClampedArray]",Ca="[object Uint16Array]",Aa="[object Uint32Array]",x={};x[Ze]=x[da]=x[Ea]=x[xa]=x[ca]=x[pa]=x[Oa]=x[La]=x[Ia]=x[Sa]=x[Na]=x[ha]=x[ga]=x[Qe]=x[va]=x[ba]=x[ya]=x[wa]=x[Pa]=x[ka]=x[Ca]=x[Aa]=!0;x[la]=x[$e]=x[_a]=!1;function wr(r,t,o,i,a,f){var s,d=t&aa,c=t&fa,p=t&ua;if(o)s=a?o(r,i,a,f):o(r);if(s!==void 0)return s;if(!Te(r))return r;var l=te(r);if(l){if(s=Me(r),!d)return dr(r,s)}else{var m=yt(r),h=m==$e||m==ma;if(Ot(r))return Z(r,d);if(m==Qe||m==Ze||h&&!a){if(s=c||h?{}:yr(r),!d)return c?Ce(r,xe(s,r)):ke(r,Ee(s,r))}else{if(!x[m])return a?r:{};s=Ye(r,m,d)}}f||(f=new cr);var v=f.get(r);if(v)return v;if(f.set(r,s),Je(r))r.forEach(function(g){s.add(wr(g,t,o,g,r,f))});else if(qe(r))r.forEach(function(g,_){s.set(_,wr(g,t,o,_,r,f))});var w=p?c?Ae:Ta:c?L:Re,y=l?void 0:w(r);return Pi(y||r,function(g,_){if(y)_=g,g=r[_];j(s,_,wr(g,t,o,_,r,f))}),s}var rt=wr;var Ra=1,Ma=4;function ja(r){return rt(r,Ra|Ma)}var tt=ja;var Ba=function(){return Le.Date.now()},Sr=Ba;var nt=Object.prototype,Da=nt.hasOwnProperty,Fa=zr(function(r,t){r=Object(r);var o=-1,i=t.length,a=i>2?t[2]:void 0;if(a&&C(t[0],t[1],a))i=1;while(++o<i){var f=t[o],s=L(f),d=-1,c=s.length;while(++d<c){var p=s[d],l=r[p];if(l===void 0||Dt(l,nt[p])&&!Da.call(r,p))r[p]=f[p]}}return r}),it=Fa;function Ga(r,t,o){if(o!==void 0&&!Dt(r[t],o)||o===void 0&&!(t in r))M(r,t,o)}var rr=Ga;function Xa(r,t){if(t==="constructor"&&typeof r[t]==="function")return;if(t=="__proto__")return;return r[t]}var er=Xa;function Ua(r){return k(r,L(r))}var at=Ua;function Va(r,t,o,i,a,f,s){var d=er(r,o),c=er(t,o),p=s.get(c);if(p){rr(r,o,p);return}var l=f?f(d,c,o+"",r,t,s):void 0,m=l===void 0;if(m){var h=te(c),v=!h&&Ot(c),w=!h&&!v&&qr(c);if(l=c,h||v||w)if(te(d))l=d;else if(Wi(d))l=dr(d);else if(v)m=!1,l=Z(c,!0);else if(w)m=!1,l=vr(c,!0);else l=[];else if(we(c)||Yt(c)){if(l=d,Yt(d))l=at(d);else if(!Te(d)||or(d))l=yr(c)}else m=!1}if(m)s.set(c,l),a(l,c,i,f,s),s.delete(c);rr(r,o,l)}var ft=Va;function ut(r,t,o,i,a){if(r===t)return;Wn(t,function(f,s){if(a||(a=new cr),Te(f))ft(r,t,s,o,ut,i,a);else{var d=i?i(er(r,s),f,s+"",r,t,a):void 0;if(d===void 0)d=f;rr(r,s,d)}},L)}var dt=ut;function Ya(r){var t=r==null?0:r.length;return t?r[t-1]:void 0}var X=Ya;function za(r){return function(t,o,i){var a=Object(t);if(!Ve(t)){var f=et(o,3);t=Re(t),o=function(d){return f(a[d],d,a)}}var s=r(t,o,i);return s>-1?a[f?t[s]:s]:void 0}}var ct=za;var Wa=Math.max;function qa(r,t,o){var i=r==null?0:r.length;if(!i)return-1;var a=o==null?0:pe(o);if(a<0)a=Wa(i+a,0);return Bi(r,et(t,3),a)}var ht=qa;var Ha=ct(ht),tr=Ha;function Ka(r,t){var o=-1,i=Ve(r)?Array(r.length):[];return Vr(r,function(a,f,s){i[++o]=t(a,f,s)}),i}var _r=Ka;function Ja(r,t){var o=te(r)?ir:_r;return o(r,et(t,3))}var E=Ja;function Za(r,t){return r==null?r:Wn(r,Yn(t),L)}var gt=Za;function $a(r,t){return r&&Kn(r,Yn(t))}var bt=$a;function Qa(r,t){return r>t}var wt=Qa;var rf=Object.prototype,ef=rf.hasOwnProperty;function tf(r,t){return r!=null&&ef.call(r,t)}var _t=tf;function nf(r,t){return r!=null&&ji(r,t,_t)}var Er=nf;var of="[object String]";function af(r){return typeof r=="string"||!te(r)&&De(r)&&st(r)==of}var Et=af;function ff(r,t){return r<t}var xr=ff;function sf(r,t){var o={};return t=et(t,3),Kn(r,function(i,a,f){M(o,a,t(i,a,f))}),o}var W=sf;function uf(r,t,o){var i=-1,a=r.length;while(++i<a){var f=r[i],s=t(f);if(s!=null&&(d===void 0?s===s&&!vt(s):o(s,d)))var d=s,c=f}return c}var q=uf;function df(r){return r&&r.length?q(r,pt,wt):void 0}var I=df;var cf=he(function(r,t,o){dt(r,t,o)}),nr=cf;function pf(r){return r&&r.length?q(r,pt,xr):void 0}var B=pf;function lf(r,t){return r&&r.length?q(r,et(t,2),xr):void 0}var H=lf;function mf(r,t,o,i){if(!Te(r))return r;t=jr(t,r);var a=-1,f=t.length,s=f-1,d=r;while(d!=null&&++a<f){var c=lr(t[a]),p=o;if(c==="__proto__"||c==="constructor"||c==="prototype")return r;if(a!=s){var l=d[c];if(p=i?i(l,c,d):void 0,p===void 0)p=Te(l)?l:$r(t[a+1])?[]:{}}j(d,c,p),d=d[c]}return r}var Lt=mf;function hf(r,t,o){var i=-1,a=t.length,f={};while(++i<a){var s=t[i],d=Gr(r,s);if(o(d,s))Lt(f,jr(s,r),d)}return f}var It=hf;function gf(r,t){var o=r.length;r.sort(t);while(o--)r[o]=r[o].value;return r}var Nt=gf;function vf(r,t){if(r!==t){var o=r!==void 0,i=r===null,a=r===r,f=vt(r),s=t!==void 0,d=t===null,c=t===t,p=vt(t);if(!d&&!p&&!f&&r>t||f&&s&&c&&!d&&!p||i&&s&&c||!o&&c||!a)return 1;if(!i&&!f&&!p&&r<t||p&&o&&a&&!i&&!f||d&&o&&a||!s&&a||!c)return-1}return 0}var Pt=vf;function bf(r,t,o){var i=-1,a=r.criteria,f=t.criteria,s=a.length,d=o.length;while(++i<s){var c=Pt(a[i],f[i]);if(c){if(i>=d)return c;var p=o[i];return c*(p=="desc"?-1:1)}}return r.index-t.index}var kt=bf;function yf(r,t,o){if(t.length)t=ir(t,function(f){if(te(f))return function(s){return Gr(s,f.length===1?f[0]:f)};return f});else t=[pt];var i=-1;t=ir(t,Ur(et));var a=_r(r,function(f,s,d){var c=ir(t,function(p){return p(f)});return{criteria:c,index:++i,value:f}});return Nt(a,function(f,s){return kt(f,s,o)})}var Tt=yf;var wf=Vi("length"),Ct=wf;var Rt="\\ud800-\\udfff",_f="\\u0300-\\u036f",Ef="\\ufe20-\\ufe2f",xf="\\u20d0-\\u20ff",Of=_f+Ef+xf,Lf="\\ufe0e\\ufe0f",If="["+Rt+"]",Nr="["+Of+"]",Pr="\\ud83c[\\udffb-\\udfff]",Sf="(?:"+Nr+"|"+Pr+")",Mt="[^"+Rt+"]",jt="(?:\\ud83c[\\udde6-\\uddff]){2}",Ft="[\\ud800-\\udbff][\\udc00-\\udfff]",Nf="\\u200d",Gt=Sf+"?",Xt="["+Lf+"]?",Pf="(?:"+Nf+"(?:"+[Mt,jt,Ft].join("|")+")"+Xt+Gt+")*",kf=Xt+Gt+Pf,Tf="(?:"+[Mt+Nr+"?",Nr,jt,Ft,If].join("|")+")",At=RegExp(Pr+"(?="+Pr+")|"+Tf+kf,"g");function Cf(r){var t=At.lastIndex=0;while(At.test(r))++t;return t}var Ut=Cf;function Af(r){return _e(r)?Ut(r):Ct(r)}var Vt=Af;function Rf(r,t){return It(r,t,function(o,i){return Gi(r,i)})}var zt=Rf;var Mf=be(function(r,t){return r==null?{}:zt(r,t)}),K=Mf;var{ceil:jf,max:Bf}=Math;function Df(r,t,o,i){var a=-1,f=Bf(jf((t-r)/(o||1)),0),s=Array(f);while(f--)s[i?f:++a]=r,r+=o;return s}var Wt=Df;function Ff(r){return function(t,o,i){if(i&&typeof i!="number"&&C(t,o,i))o=i=void 0;if(t=V(t),o===void 0)o=t,t=0;else o=V(o);return i=i===void 0?t<o?1:-1:V(i),Wt(t,o,i,r)}}var qt=Ff;var Gf=qt(),P=Gf;var Xf="[object Map]",Uf="[object Set]";function Vf(r){if(r==null)return 0;if(Ve(r))return Et(r)?Vt(r):r.length;var t=yt(r);if(t==Xf||t==Uf)return r.size;return Un(r).length}var Ht=Vf;var Yf=zr(function(r,t){if(r==null)return[];var o=t.length;if(o>1&&C(r,t[0],t[1]))t=[];else if(o>2&&C(t[0],t[1],t[2]))t=[t[0]];return Tt(r,jn(t,1),[])}),A=Yf;var zf=0;function Wf(r){var t=++zf;return Hi(r)+t}var J=Wf;function qf(r,t,o){var i=-1,a=r.length,f=t.length,s={};while(++i<a){var d=i<f?t[i]:void 0;o(s,r[i],d)}return s}var Kt=qf;function Hf(r,t){return Kt(r||[],t||[],j)}var kr=Hf;class Tr{constructor(){var r={};r._next=r._prev=r,this._sentinel=r}dequeue(){var r=this._sentinel,t=r._prev;if(t!==r)return Jt(t),t}enqueue(r){var t=this._sentinel;if(r._prev&&r._next)Jt(r);r._next=t._next,t._next._prev=r,t._next=r,r._prev=t}toString(){var r=[],t=this._sentinel,o=t._prev;while(o!==t)r.push(JSON.stringify(o,Kf)),o=o._prev;return"["+r.join(", ")+"]"}}function Jt(r){r._prev._next=r._next,r._next._prev=r._prev,delete r._next,delete r._prev}function Kf(r,t){if(r!=="_next"&&r!=="_prev")return t}var Jf=mt(1);function Zt(r,t){if(r.nodeCount()<=1)return[];var o=$f(r,t||Jf),i=Zf(o.graph,o.buckets,o.zeroIdx);return S(E(i,function(a){return r.outEdges(a.v,a.w)}))}function Zf(r,t,o){var i=[],a=t[t.length-1],f=t[0],s;while(r.nodeCount()){while(s=f.dequeue())Cr(r,t,o,s);while(s=a.dequeue())Cr(r,t,o,s);if(r.nodeCount()){for(var d=t.length-2;d>0;--d)if(s=t[d].dequeue(),s){i=i.concat(Cr(r,t,o,s,!0));break}}}return i}function Cr(r,t,o,i,a){var f=a?[]:void 0;return b(r.inEdges(i.v),function(s){var d=r.edge(s),c=r.node(s.v);if(a)f.push({v:s.v,w:s.w});c.out-=d,Ar(t,o,c)}),b(r.outEdges(i.v),function(s){var d=r.edge(s),c=s.w,p=r.node(c);p.in-=d,Ar(t,o,p)}),r.removeNode(i.v),f}function $f(r,t){var o=new ue,i=0,a=0;b(r.nodes(),function(d){o.setNode(d,{v:d,in:0,out:0})}),b(r.edges(),function(d){var c=o.edge(d.v,d.w)||0,p=t(d),l=c+p;o.setEdge(d.v,d.w,l),a=Math.max(a,o.node(d.v).out+=p),i=Math.max(i,o.node(d.w).in+=p)});var f=P(a+i+3).map(function(){return new Tr}),s=i+1;return b(o.nodes(),function(d){Ar(f,s,o.node(d))}),{graph:o,buckets:f,zeroIdx:s}}function Ar(r,t,o){if(!o.out)r[0].enqueue(o);else if(!o.in)r[r.length-1].enqueue(o);else r[o.out-o.in+t].enqueue(o)}function Qt(r){var t=r.graph().acyclicer==="greedy"?Zt(r,o(r)):Qf(r);b(t,function(i){var a=r.edge(i);r.removeEdge(i),a.forwardName=i.name,a.reversed=!0,r.setEdge(i.w,i.v,a,J("rev"))});function o(i){return function(a){return i.edge(a).weight}}}function Qf(r){var t=[],o={},i={};function a(f){if(Object.prototype.hasOwnProperty.call(i,f))return;i[f]=!0,o[f]=!0,b(r.outEdges(f),function(s){if(Object.prototype.hasOwnProperty.call(o,s.w))t.push(s);else a(s.w)}),delete o[f]}return b(r.nodes(),a),t}function rn(r){b(r.edges(),function(t){var o=r.edge(t);if(o.reversed){r.removeEdge(t);var i=o.forwardName;delete o.reversed,delete o.forwardName,r.setEdge(t.w,t.v,o,i)}})}function T(r,t,o,i){var a;do a=J(i);while(r.hasNode(a));return o.dummy=t,r.setNode(a,o),a}function tn(r){var t=new ue().setGraph(r.graph());return b(r.nodes(),function(o){t.setNode(o,r.node(o))}),b(r.edges(),function(o){var i=t.edge(o.v,o.w)||{weight:0,minlen:1},a=r.edge(o);t.setEdge(o.v,o.w,{weight:i.weight+a.weight,minlen:Math.max(i.minlen,a.minlen)})}),t}function Or(r){var t=new ue({multigraph:r.isMultigraph()}).setGraph(r.graph());return b(r.nodes(),function(o){if(!r.children(o).length)t.setNode(o,r.node(o))}),b(r.edges(),function(o){t.setEdge(o,r.edge(o))}),t}function Rr(r,t){var{x:o,y:i}=r,a=t.x-o,f=t.y-i,s=r.width/2,d=r.height/2;if(!a&&!f)throw Error("Not possible to find intersection inside of the rectangle");var c,p;if(Math.abs(f)*s>Math.abs(a)*d){if(f<0)d=-d;c=d*a/f,p=d}else{if(a<0)s=-s;c=s,p=s*f/a}return{x:o+c,y:i+p}}function D(r){var t=E(P(Br(r)+1),function(){return[]});return b(r.nodes(),function(o){var i=r.node(o),a=i.rank;if(!Ie(a))t[a][i.order]=o}),t}function nn(r){var t=B(E(r.nodes(),function(o){return r.node(o).rank}));b(r.nodes(),function(o){var i=r.node(o);if(Er(i,"rank"))i.rank-=t})}function on(r){var t=B(E(r.nodes(),function(f){return r.node(f).rank})),o=[];b(r.nodes(),function(f){var s=r.node(f).rank-t;if(!o[s])o[s]=[];o[s].push(f)});var i=0,a=r.graph().nodeRankFactor;b(o,function(f,s){if(Ie(f)&&s%a!==0)--i;else if(i)b(f,function(d){r.node(d).rank+=i})})}function Mr(r,t,o,i){var a={width:0,height:0};if(arguments.length>=4)a.rank=o,a.order=i;return T(r,"border",a,t)}function Br(r){return I(E(r.nodes(),function(t){var o=r.node(t).rank;if(!Ie(o))return o}))}function an(r,t){var o={lhs:[],rhs:[]};return b(r,function(i){if(t(i))o.lhs.push(i);else o.rhs.push(i)}),o}function fn(r,t){var o=Sr();try{return t()}finally{console.log(r+" time: "+(Sr()-o)+"ms")}}function sn(r,t){return t()}function cn(r){function t(o){var i=r.children(o),a=r.node(o);if(i.length)b(i,t);if(Object.prototype.hasOwnProperty.call(a,"minRank")){a.borderLeft=[],a.borderRight=[];for(var f=a.minRank,s=a.maxRank+1;f<s;++f)un(r,"borderLeft","_bl",o,a,f),un(r,"borderRight","_br",o,a,f)}}b(r.children(),t)}function un(r,t,o,i,a,f){var s={width:0,height:0,rank:f,borderType:t},d=a[t][f-1],c=T(r,"border",s,o);if(a[t][f]=c,r.setParent(c,i),d)r.setEdge(d,c,{weight:1})}function ln(r){var t=r.graph().rankdir.toLowerCase();if(t==="lr"||t==="rl")hn(r)}function mn(r){var t=r.graph().rankdir.toLowerCase();if(t==="bt"||t==="rl")rs(r);if(t==="lr"||t==="rl")es(r),hn(r)}function hn(r){b(r.nodes(),function(t){pn(r.node(t))}),b(r.edges(),function(t){pn(r.edge(t))})}function pn(r){var t=r.width;r.width=r.height,r.height=t}function rs(r){b(r.nodes(),function(t){Dr(r.node(t))}),b(r.edges(),function(t){var o=r.edge(t);if(b(o.points,Dr),Object.prototype.hasOwnProperty.call(o,"y"))Dr(o)})}function Dr(r){r.y=-r.y}function es(r){b(r.nodes(),function(t){Fr(r.node(t))}),b(r.edges(),function(t){var o=r.edge(t);if(b(o.points,Fr),Object.prototype.hasOwnProperty.call(o,"x"))Fr(o)})}function Fr(r){var t=r.x;r.x=r.y,r.y=t}function gn(r){r.graph().dummyChains=[],b(r.edges(),function(t){ns(r,t)})}function ns(r,t){var o=t.v,i=r.node(o).rank,a=t.w,f=r.node(a).rank,s=t.name,d=r.edge(t),c=d.labelRank;if(f===i+1)return;r.removeEdge(t);var p=void 0,l,m;for(m=0,++i;i<f;++m,++i){if(d.points=[],p={width:0,height:0,edgeLabel:d,edgeObj:t,rank:i},l=T(r,"edge",p,"_d"),i===c)p.width=d.width,p.height=d.height,p.dummy="edge-label",p.labelpos=d.labelpos;if(r.setEdge(o,l,{weight:d.weight},s),m===0)r.graph().dummyChains.push(l);o=l}r.setEdge(o,a,{weight:d.weight},s)}function vn(r){b(r.graph().dummyChains,function(t){var o=r.node(t),i=o.edgeLabel,a;r.setEdge(o.edgeObj,i);while(o.dummy){if(a=r.successors(t)[0],r.removeNode(t),i.points.push({x:o.x,y:o.y}),o.dummy==="edge-label")i.x=o.x,i.y=o.y,i.width=o.width,i.height=o.height;t=a,o=r.node(t)}})}function ar(r){var t={};function o(i){var a=r.node(i);if(Object.prototype.hasOwnProperty.call(t,i))return a.rank;t[i]=!0;var f=B(E(r.outEdges(i),function(s){return o(s.w)-r.edge(s).minlen}));if(f===Number.POSITIVE_INFINITY||f===void 0||f===null)f=0;return a.rank=f}b(r.sources(),o)}function U(r,t){return r.node(t.w).rank-r.node(t.v).rank-r.edge(t).minlen}function Lr(r){var t=new ue({directed:!1}),o=r.nodes()[0],i=r.nodeCount();t.setNode(o,{});var a,f;while(os(t,r)<i)a=is(t,r),f=t.hasNode(a.v)?U(r,a):-U(r,a),as(t,r,f);return t}function os(r,t){function o(i){b(t.nodeEdges(i),function(a){var f=a.v,s=i===f?a.w:f;if(!r.hasNode(s)&&!U(t,a))r.setNode(s,{}),r.setEdge(i,s,{}),o(s)})}return b(r.nodes(),o),r.nodeCount()}function is(r,t){return H(t.edges(),function(o){if(r.hasNode(o.v)!==r.hasNode(o.w))return U(t,o)})}function as(r,t,o){b(r.nodes(),function(i){t.node(i).rank+=o})}var uh=mt(1);var gh=mt(1);Xr.CycleException=fr;function Xr(r){var t={},o={},i=[];function a(f){if(Object.prototype.hasOwnProperty.call(o,f))throw new fr;if(!Object.prototype.hasOwnProperty.call(t,f))o[f]=!0,t[f]=!0,b(r.predecessors(f),a),delete o[f],i.push(f)}if(b(r.sinks(),a),Ht(t)!==r.nodeCount())throw new fr;return i}function fr(){}fr.prototype=Error();function Ir(r,t,o){if(!te(t))t=[t];var i=(r.isDirected()?r.successors:r.neighbors).bind(r),a=[],f={};return b(t,function(s){if(!r.hasNode(s))throw Error("Graph does not have node: "+s);wn(r,s,o==="post",f,i,a)}),a}function wn(r,t,o,i,a,f){if(!Object.prototype.hasOwnProperty.call(i,t)){if(i[t]=!0,!o)f.push(t);if(b(a(t),function(s){wn(r,s,o,i,a,f)}),o)f.push(t)}}function Yr(r,t){return Ir(r,t,"post")}function Wr(r,t){return Ir(r,t,"pre")}G.initLowLimValues=Jr;G.initCutValues=Kr;G.calcCutValue=En;G.leaveEdge=On;G.enterEdge=Ln;G.exchangeEdges=In;function G(r){r=tn(r),ar(r);var t=Lr(r);Jr(t),Kr(t,r);var o,i;while(o=On(t))i=Ln(t,r,o),In(t,r,o,i)}function Kr(r,t){var o=Yr(r,r.nodes());o=o.slice(0,o.length-1),b(o,function(i){cs(r,t,i)})}function cs(r,t,o){var i=r.node(o),a=i.parent;r.edge(o,a).cutvalue=En(r,t,o)}function En(r,t,o){var i=r.node(o),a=i.parent,f=!0,s=t.edge(o,a),d=0;if(!s)f=!1,s=t.edge(a,o);return d=s.weight,b(t.nodeEdges(o),function(c){var p=c.v===o,l=p?c.w:c.v;if(l!==a){var m=p===f,h=t.edge(c).weight;if(d+=m?h:-h,ls(r,o,l)){var v=r.edge(o,l).cutvalue;d+=m?-v:v}}}),d}function Jr(r,t){if(arguments.length<2)t=r.nodes()[0];xn(r,{},1,t)}function xn(r,t,o,i,a){var f=o,s=r.node(i);if(t[i]=!0,b(r.neighbors(i),function(d){if(!Object.prototype.hasOwnProperty.call(t,d))o=xn(r,t,o,d,i)}),s.low=f,s.lim=o++,a)s.parent=a;else delete s.parent;return o}function On(r){return tr(r.edges(),function(t){return r.edge(t).cutvalue<0})}function Ln(r,t,o){var{v:i,w:a}=o;if(!t.hasEdge(i,a))i=o.w,a=o.v;var f=r.node(i),s=r.node(a),d=f,c=!1;if(f.lim>s.lim)d=s,c=!0;var p=lt(t.edges(),function(l){return c===_n(r,r.node(l.v),d)&&c!==_n(r,r.node(l.w),d)});return H(p,function(l){return U(t,l)})}function In(r,t,o,i){var{v:a,w:f}=o;r.removeEdge(a,f),r.setEdge(i.v,i.w,{}),Jr(r),Kr(r,t),ps(r,t)}function ps(r,t){var o=tr(r.nodes(),function(a){return!t.node(a).parent}),i=Wr(r,o);i=i.slice(1),b(i,function(a){var f=r.node(a).parent,s=t.edge(a,f),d=!1;if(!s)s=t.edge(f,a),d=!0;t.node(a).rank=t.node(f).rank+(d?s.minlen:-s.minlen)})}function ls(r,t,o){return r.hasEdge(t,o)}function _n(r,t,o){return o.low<=t.lim&&t.lim<=o.lim}function Zr(r){switch(r.graph().ranker){case"network-simplex":Sn(r);break;case"tight-tree":hs(r);break;case"longest-path":ms(r);break;default:Sn(r)}}var ms=ar;function hs(r){ar(r),Lr(r)}function Sn(r){G(r)}function Nn(r){var t=T(r,"root",{},"_root"),o=gs(r),i=I(xt(o))-1,a=2*i+1;r.graph().nestingRoot=t,b(r.edges(),function(s){r.edge(s).minlen*=a});var f=vs(r)+1;b(r.children(),function(s){Pn(r,t,a,f,i,o,s)}),r.graph().nodeRankFactor=a}function Pn(r,t,o,i,a,f,s){var d=r.children(s);if(!d.length){if(s!==t)r.setEdge(t,s,{weight:0,minlen:o});return}var c=Mr(r,"_bt"),p=Mr(r,"_bb"),l=r.node(s);if(r.setParent(c,s),l.borderTop=c,r.setParent(p,s),l.borderBottom=p,b(d,function(m){Pn(r,t,o,i,a,f,m);var h=r.node(m),v=h.borderTop?h.borderTop:m,w=h.borderBottom?h.borderBottom:m,y=h.borderTop?i:2*i,g=v!==w?1:a-f[s]+1;r.setEdge(c,v,{weight:y,minlen:g,nestingEdge:!0}),r.setEdge(w,p,{weight:y,minlen:g,nestingEdge:!0})}),!r.parent(s))r.setEdge(t,c,{weight:0,minlen:a+f[s]})}function gs(r){var t={};function o(i,a){var f=r.children(i);if(f&&f.length)b(f,function(s){o(s,a+1)});t[i]=a}return b(r.children(),function(i){o(i,1)}),t}function vs(r){return ur(r.edges(),function(t,o){return t+r.edge(o).weight},0)}function kn(r){var t=r.graph();r.removeNode(t.nestingRoot),delete t.nestingRoot,b(r.edges(),function(o){var i=r.edge(o);if(i.nestingEdge)r.removeEdge(o)})}function Tn(r,t,o){var i={},a;b(o,function(f){var s=r.parent(f),d,c;while(s){if(d=r.parent(s),d)c=i[d],i[d]=s;else c=a,a=s;if(c&&c!==s){t.setEdge(c,s);return}s=d}})}function Cn(r,t,o){var i=ys(r),a=new ue({compound:!0}).setGraph({root:i}).setDefaultNodeLabel(function(f){return r.node(f)});return b(r.nodes(),function(f){var s=r.node(f),d=r.parent(f);if(s.rank===t||s.minRank<=t&&t<=s.maxRank){if(a.setNode(f),a.setParent(f,d||i),b(r[o](f),function(c){var p=c.v===f?c.w:c.v,l=a.edge(p,f),m=!Ie(l)?l.weight:0;a.setEdge(p,f,{weight:r.edge(c).weight+m})}),Object.prototype.hasOwnProperty.call(s,"minRank"))a.setNode(f,{borderLeft:s.borderLeft[t],borderRight:s.borderRight[t]})}}),a}function ys(r){var t;while(r.hasNode(t=J("_root")));return t}function An(r,t){var o=0;for(var i=1;i<t.length;++i)o+=ws(r,t[i-1],t[i]);return o}function ws(r,t,o){var i=kr(o,E(o,function(p,l){return l})),a=S(E(t,function(p){return A(E(r.outEdges(p),function(l){return{pos:i[l.w],weight:r.edge(l).weight}}),"pos")})),f=1;while(f<o.length)f<<=1;var s=2*f-1;f-=1;var d=E(Array(s),function(){return 0}),c=0;return b(a.forEach(function(p){var l=p.pos+f;d[l]+=p.weight;var m=0;while(l>0){if(l%2)m+=d[l+1];l=l-1>>1,d[l]+=p.weight}c+=p.weight*m})),c}function Rn(r){var t={},o=lt(r.nodes(),function(d){return!r.children(d).length}),i=I(E(o,function(d){return r.node(d).rank})),a=E(P(i+1),function(){return[]});function f(d){if(Er(t,d))return;t[d]=!0;var c=r.node(d);a[c.rank].push(d),b(r.successors(d),f)}var s=A(o,function(d){return r.node(d).rank});return b(s,f),a}function Mn(r,t){return E(t,function(o){var i=r.inEdges(o);if(!i.length)return{v:o};else{var a=ur(i,function(f,s){var d=r.edge(s),c=r.node(s.v);return{sum:f.sum+d.weight*c.order,weight:f.weight+d.weight}},{sum:0,weight:0});return{v:o,barycenter:a.sum/a.weight,weight:a.weight}}})}function Bn(r,t){var o={};b(r,function(a,f){var s=o[a.v]={indegree:0,in:[],out:[],vs:[a.v],i:f};if(!Ie(a.barycenter))s.barycenter=a.barycenter,s.weight=a.weight}),b(t.edges(),function(a){var f=o[a.v],s=o[a.w];if(!Ie(f)&&!Ie(s))s.indegree++,f.out.push(o[a.w])});var i=lt(o,function(a){return!a.indegree});return _s(i)}function _s(r){var t=[];function o(f){return function(s){if(s.merged)return;if(Ie(s.barycenter)||Ie(f.barycenter)||s.barycenter>=f.barycenter)Es(f,s)}}function i(f){return function(s){if(s.in.push(f),--s.indegree===0)r.push(s)}}while(r.length){var a=r.pop();t.push(a),b(a.in.reverse(),o(a)),b(a.out,i(a))}return E(lt(t,function(f){return!f.merged}),function(f){return K(f,["vs","i","barycenter","weight"])})}function Es(r,t){var o=0,i=0;if(r.weight)o+=r.barycenter*r.weight,i+=r.weight;if(t.weight)o+=t.barycenter*t.weight,i+=t.weight;r.vs=t.vs.concat(r.vs),r.barycenter=o/i,r.weight=i,r.i=Math.min(t.i,r.i),t.merged=!0}function Fn(r,t){var o=an(r,function(l){return Object.prototype.hasOwnProperty.call(l,"barycenter")}),i=o.lhs,a=A(o.rhs,function(l){return-l.i}),f=[],s=0,d=0,c=0;i.sort(xs(!!t)),c=Dn(f,a,c),b(i,function(l){c+=l.vs.length,f.push(l.vs),s+=l.barycenter*l.weight,d+=l.weight,c=Dn(f,a,c)});var p={vs:S(f)};if(d)p.barycenter=s/d,p.weight=d;return p}function Dn(r,t,o){var i;while(t.length&&(i=X(t)).i<=o)t.pop(),r.push(i.vs),o++;return o}function xs(r){return function(t,o){if(t.barycenter<o.barycenter)return-1;else if(t.barycenter>o.barycenter)return 1;return!r?t.i-o.i:o.i-t.i}}function Qr(r,t,o,i){var a=r.children(t),f=r.node(t),s=f?f.borderLeft:void 0,d=f?f.borderRight:void 0,c={};if(s)a=lt(a,function(w){return w!==s&&w!==d});var p=Mn(r,a);b(p,function(w){if(r.children(w.v).length){var y=Qr(r,w.v,o,i);if(c[w.v]=y,Object.prototype.hasOwnProperty.call(y,"barycenter"))Ls(w,y)}});var l=Bn(p,o);Os(l,c);var m=Fn(l,i);if(s){if(m.vs=S([s,m.vs,d]),r.predecessors(s).length){var h=r.node(r.predecessors(s)[0]),v=r.node(r.predecessors(d)[0]);if(!Object.prototype.hasOwnProperty.call(m,"barycenter"))m.barycenter=0,m.weight=0;m.barycenter=(m.barycenter*m.weight+h.order+v.order)/(m.weight+2),m.weight+=2}}return m}function Os(r,t){b(r,function(o){o.vs=S(o.vs.map(function(i){if(t[i])return t[i].vs;return i}))})}function Ls(r,t){if(!Ie(r.barycenter))r.barycenter=(r.barycenter*r.weight+t.barycenter*t.weight)/(r.weight+t.weight),r.weight+=t.weight;else r.barycenter=t.barycenter,r.weight=t.weight}function Jn(r){var t=Br(r),o=Xn(r,P(1,t+1),"inEdges"),i=Xn(r,P(t-1,-1,-1),"outEdges"),a=Rn(r);zn(r,a);var f=Number.POSITIVE_INFINITY,s;for(var d=0,c=0;c<4;++d,++c){Is(d%2?o:i,d%4>=2),a=D(r);var p=An(r,a);if(p<f)c=0,s=tt(a),f=p}zn(r,s)}function Xn(r,t,o){return E(t,function(i){return Cn(r,i,o)})}function Is(r,t){var o=new ue;b(r,function(i){var a=i.graph().root,f=Qr(i,a,o,t);b(f.vs,function(s,d){i.node(s).order=d}),Tn(i,o,f.vs)})}function zn(r,t){b(t,function(o){b(o,function(i,a){r.node(i).order=a})})}function Zn(r){var t=Ns(r);b(r.graph().dummyChains,function(o){var i=r.node(o),a=i.edgeObj,f=Ss(r,t,a.v,a.w),{path:s,lca:d}=f,c=0,p=s[c],l=!0;while(o!==a.w){if(i=r.node(o),l){while((p=s[c])!==d&&r.node(p).maxRank<i.rank)c++;if(p===d)l=!1}if(!l){while(c<s.length-1&&r.node(p=s[c+1]).minRank<=i.rank)c++;p=s[c]}r.setParent(o,p),o=r.successors(o)[0]}})}function Ss(r,t,o,i){var a=[],f=[],s=Math.min(t[o].low,t[i].low),d=Math.max(t[o].lim,t[i].lim),c,p;c=o;do c=r.parent(c),a.push(c);while(c&&(t[c].low>s||d>t[c].lim));p=c,c=i;while((c=r.parent(c))!==p)f.push(c);return{path:a.concat(f.reverse()),lca:p}}function Ns(r){var t={},o=0;function i(a){var f=o;b(r.children(a),i),t[a]={low:f,lim:o++}}return b(r.children(),i),t}function Ps(r,t){var o={};function i(a,f){var s=0,d=0,c=a.length,p=X(f);return b(f,function(l,m){var h=Ts(r,l),v=h?r.node(h).order:c;if(h||l===p)b(f.slice(d,m+1),function(w){b(r.predecessors(w),function(y){var g=r.node(y),_=g.order;if((_<s||v<_)&&!(g.dummy&&r.node(w).dummy))$n(o,y,w)})}),d=m+1,s=v}),f}return ur(t,i),o}function ks(r,t){var o={};function i(f,s,d,c,p){var l;b(P(s,d),function(m){if(l=f[m],r.node(l).dummy)b(r.predecessors(l),function(h){var v=r.node(h);if(v.dummy&&(v.order<c||v.order>p))$n(o,h,l)})})}function a(f,s){var d=-1,c,p=0;return b(s,function(l,m){if(r.node(l).dummy==="border"){var h=r.predecessors(l);if(h.length)c=r.node(h[0]).order,i(s,p,m,d,c),p=m,d=c}i(s,p,s.length,c,f.length)}),s}return ur(t,a),o}function Ts(r,t){if(r.node(t).dummy)return tr(r.predecessors(t),function(o){return r.node(o).dummy})}function $n(r,t,o){if(t>o){var i=t;t=o,o=i}if(!Object.prototype.hasOwnProperty.call(r,t))Object.defineProperty(r,t,{enumerable:!0,configurable:!0,value:{},writable:!0});var a=r[t];Object.defineProperty(a,o,{enumerable:!0,configurable:!0,value:!0,writable:!0})}function Cs(r,t,o){if(t>o){var i=t;t=o,o=i}return!!r[t]&&Object.prototype.hasOwnProperty.call(r[t],o)}function As(r,t,o,i){var a={},f={},s={};return b(t,function(d){b(d,function(c,p){a[c]=c,f[c]=c,s[c]=p})}),b(t,function(d){var c=-1;b(d,function(p){var l=i(p);if(l.length){l=A(l,function(y){return s[y]});var m=(l.length-1)/2;for(var h=Math.floor(m),v=Math.ceil(m);h<=v;++h){var w=l[h];if(f[p]===p&&c<s[w]&&!Cs(o,p,w))f[w]=p,f[p]=a[p]=a[w],c=s[w]}}})}),{root:a,align:f}}function Rs(r,t,o,i,a){var f={},s=Ms(r,t,o,a),d=a?"borderLeft":"borderRight";function c(m,h){var v=s.nodes(),w=v.pop(),y={};while(w){if(y[w])m(w);else y[w]=!0,v.push(w),v=v.concat(h(w));w=v.pop()}}function p(m){f[m]=s.inEdges(m).reduce(function(h,v){return Math.max(h,f[v.v]+s.edge(v))},0)}function l(m){var h=s.outEdges(m).reduce(function(w,y){return Math.min(w,f[y.w]-s.edge(y))},Number.POSITIVE_INFINITY),v=r.node(m);if(h!==Number.POSITIVE_INFINITY&&v.borderType!==d)f[m]=Math.max(f[m],h)}return c(p,s.predecessors.bind(s)),c(l,s.successors.bind(s)),b(i,function(m){f[m]=f[o[m]]}),f}function Ms(r,t,o,i){var a=new ue,f=r.graph(),s=Fs(f.nodesep,f.edgesep,i);return b(t,function(d){var c;b(d,function(p){var l=o[p];if(a.setNode(l),c){var m=o[c],h=a.edge(m,l);a.setEdge(m,l,Math.max(s(r,p,c),h||0))}c=p})}),a}function js(r,t){return H(xt(t),function(o){var{NEGATIVE_INFINITY:i,POSITIVE_INFINITY:a}=Number;return gt(o,function(f,s){var d=Gs(r,s)/2;i=Math.max(f+d,i),a=Math.min(f-d,a)}),i-a})}function Bs(r,t){var o=xt(t),i=B(o),a=I(o);b(["u","d"],function(f){b(["l","r"],function(s){var d=f+s,c=r[d],p;if(c===t)return;var l=xt(c);if(p=s==="l"?i-B(l):a-I(l),p)r[d]=W(c,function(m){return m+p})})})}function Ds(r,t){return W(r.ul,function(o,i){if(t)return r[t.toLowerCase()][i];else{var a=A(E(r,i));return(a[1]+a[2])/2}})}function Qn(r){var t=D(r),o=nr(Ps(r,t),ks(r,t)),i={},a;b(["u","d"],function(s){a=s==="u"?t:xt(t).reverse(),b(["l","r"],function(d){if(d==="r")a=E(a,function(m){return xt(m).reverse()});var c=(s==="u"?r.predecessors:r.successors).bind(r),p=As(r,a,o,c),l=Rs(r,a,p.root,p.align,d==="r");if(d==="r")l=W(l,function(m){return-m});i[s+d]=l})});var f=js(r,i);return Bs(i,f),Ds(i,r.graph().align)}function Fs(r,t,o){return function(i,a,f){var s=i.node(a),d=i.node(f),c=0,p;if(c+=s.width/2,Object.prototype.hasOwnProperty.call(s,"labelpos"))switch(s.labelpos.toLowerCase()){case"l":p=-s.width/2;break;case"r":p=s.width/2;break}if(p)c+=o?p:-p;if(p=0,c+=(s.dummy?t:r)/2,c+=(d.dummy?t:r)/2,c+=d.width/2,Object.prototype.hasOwnProperty.call(d,"labelpos"))switch(d.labelpos.toLowerCase()){case"l":p=d.width/2;break;case"r":p=-d.width/2;break}if(p)c+=o?p:-p;return p=0,c}}function Gs(r,t){return r.node(t).width}function ro(r){r=Or(r),Xs(r),bt(Qn(r),function(t,o){r.node(o).x=t})}function Xs(r){var t=D(r),o=r.graph().ranksep,i=0;b(t,function(a){var f=I(E(a,function(s){return r.node(s).height}));b(a,function(s){r.node(s).y=i+f/2}),i+=f+o})}function ne(r,t){var o=t&&t.debugTiming?fn:sn;o("layout",()=>{var i=o(" buildLayoutGraph",()=>$s(r));o(" runLayout",()=>Us(i,o)),o(" updateInputGraph",()=>Vs(r,i))})}function Us(r,t){t(" makeSpaceForEdgeLabels",()=>Qs(r)),t(" removeSelfEdges",()=>su(r)),t(" acyclic",()=>Qt(r)),t(" nestingGraph.run",()=>Nn(r)),t(" rank",()=>Zr(Or(r))),t(" injectEdgeLabelProxies",()=>ru(r)),t(" removeEmptyRanks",()=>on(r)),t(" nestingGraph.cleanup",()=>kn(r)),t(" normalizeRanks",()=>nn(r)),t(" assignRankMinMax",()=>eu(r)),t(" removeEdgeLabelProxies",()=>tu(r)),t(" normalize.run",()=>gn(r)),t(" parentDummyChains",()=>Zn(r)),t(" addBorderSegments",()=>cn(r)),t(" order",()=>Jn(r)),t(" insertSelfEdges",()=>uu(r)),t(" adjustCoordinateSystem",()=>ln(r)),t(" position",()=>ro(r)),t(" positionSelfEdges",()=>du(r)),t(" removeBorderNodes",()=>fu(r)),t(" normalize.undo",()=>vn(r)),t(" fixupEdgeLabelCoords",()=>iu(r)),t(" undoCoordinateSystem",()=>mn(r)),t(" translateGraph",()=>nu(r)),t(" assignNodeIntersects",()=>ou(r)),t(" reversePoints",()=>au(r)),t(" acyclic.undo",()=>rn(r))}function Vs(r,t){b(r.nodes(),function(o){var i=r.node(o),a=t.node(o);if(i){if(i.x=a.x,i.y=a.y,t.children(o).length)i.width=a.width,i.height=a.height}}),b(r.edges(),function(o){var i=r.edge(o),a=t.edge(o);if(i.points=a.points,Object.prototype.hasOwnProperty.call(a,"x"))i.x=a.x,i.y=a.y}),r.graph().width=t.graph().width,r.graph().height=t.graph().height}var Ys=["nodesep","edgesep","ranksep","marginx","marginy"],zs={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},Ws=["acyclicer","ranker","rankdir","align"],qs=["width","height"],Hs={width:0,height:0},Ks=["minlen","weight","width","height","labeloffset"],Js={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},Zs=["labelpos"];function $s(r){var t=new ue({multigraph:!0,compound:!0}),o=ee(r.graph());return t.setGraph(nr({},zs,re(o,Ys),K(o,Ws))),b(r.nodes(),function(i){var a=ee(r.node(i));t.setNode(i,it(re(a,qs),Hs)),t.setParent(i,r.parent(i))}),b(r.edges(),function(i){var a=ee(r.edge(i));t.setEdge(i,nr({},Js,re(a,Ks),K(a,Zs)))}),t}function Qs(r){var t=r.graph();t.ranksep/=2,b(r.edges(),function(o){var i=r.edge(o);if(i.minlen*=2,i.labelpos.toLowerCase()!=="c")if(t.rankdir==="TB"||t.rankdir==="BT")i.width+=i.labeloffset;else i.height+=i.labeloffset})}function ru(r){b(r.edges(),function(t){var o=r.edge(t);if(o.width&&o.height){var i=r.node(t.v),a=r.node(t.w),f={rank:(a.rank-i.rank)/2+i.rank,e:t};T(r,"edge-proxy",f,"_ep")}})}function eu(r){var t=0;b(r.nodes(),function(o){var i=r.node(o);if(i.borderTop)i.minRank=r.node(i.borderTop).rank,i.maxRank=r.node(i.borderBottom).rank,t=I(t,i.maxRank)}),r.graph().maxRank=t}function tu(r){b(r.nodes(),function(t){var o=r.node(t);if(o.dummy==="edge-proxy")r.edge(o.e).labelRank=o.rank,r.removeNode(t)})}function nu(r){var t=Number.POSITIVE_INFINITY,o=0,i=Number.POSITIVE_INFINITY,a=0,f=r.graph(),s=f.marginx||0,d=f.marginy||0;function c(p){var{x:l,y:m,width:h,height:v}=p;t=Math.min(t,l-h/2),o=Math.max(o,l+h/2),i=Math.min(i,m-v/2),a=Math.max(a,m+v/2)}b(r.nodes(),function(p){c(r.node(p))}),b(r.edges(),function(p){var l=r.edge(p);if(Object.prototype.hasOwnProperty.call(l,"x"))c(l)}),t-=s,i-=d,b(r.nodes(),function(p){var l=r.node(p);l.x-=t,l.y-=i}),b(r.edges(),function(p){var l=r.edge(p);if(b(l.points,function(m){m.x-=t,m.y-=i}),Object.prototype.hasOwnProperty.call(l,"x"))l.x-=t;if(Object.prototype.hasOwnProperty.call(l,"y"))l.y-=i}),f.width=o-t+s,f.height=a-i+d}function ou(r){b(r.edges(),function(t){var o=r.edge(t),i=r.node(t.v),a=r.node(t.w),f,s;if(!o.points)o.points=[],f=a,s=i;else f=o.points[0],s=o.points[o.points.length-1];o.points.unshift(Rr(i,f)),o.points.push(Rr(a,s))})}function iu(r){b(r.edges(),function(t){var o=r.edge(t);if(Object.prototype.hasOwnProperty.call(o,"x")){if(o.labelpos==="l"||o.labelpos==="r")o.width-=o.labeloffset;switch(o.labelpos){case"l":o.x-=o.width/2+o.labeloffset;break;case"r":o.x+=o.width/2+o.labeloffset;break}}})}function au(r){b(r.edges(),function(t){var o=r.edge(t);if(o.reversed)o.points.reverse()})}function fu(r){b(r.nodes(),function(t){if(r.children(t).length){var o=r.node(t),i=r.node(o.borderTop),a=r.node(o.borderBottom),f=r.node(X(o.borderLeft)),s=r.node(X(o.borderRight));o.width=Math.abs(s.x-f.x),o.height=Math.abs(a.y-i.y),o.x=f.x+o.width/2,o.y=i.y+o.height/2}}),b(r.nodes(),function(t){if(r.node(t).dummy==="border")r.removeNode(t)})}function su(r){b(r.edges(),function(t){if(t.v===t.w){var o=r.node(t.v);if(!o.selfEdges)o.selfEdges=[];o.selfEdges.push({e:t,label:r.edge(t)}),r.removeEdge(t)}})}function uu(r){var t=D(r);b(t,function(o){var i=0;b(o,function(a,f){var s=r.node(a);s.order=f+i,b(s.selfEdges,function(d){T(r,"selfedge",{width:d.label.width,height:d.label.height,rank:s.rank,order:f+ ++i,e:d.e,label:d.label},"_se")}),delete s.selfEdges})})}function du(r){b(r.nodes(),function(t){var o=r.node(t);if(o.dummy==="selfedge"){var i=r.node(o.e.v),a=i.x+i.width/2,f=i.y,s=o.x-a,d=i.height/2;r.setEdge(o.e,o.label),r.removeNode(t),o.label.points=[{x:a+2*s/3,y:f-d},{x:a+5*s/6,y:f-d},{x:a+s,y:f},{x:a+5*s/6,y:f+d},{x:a+2*s/3,y:f+d}],o.label.x=o.x,o.label.y=o.y}})}function re(r,t){return W(K(r,t),Number)}function ee(r){var t={};return b(r,function(o,i){t[i.toLowerCase()]=o}),t}var eo=e((r,t,o)=>Math.max(t,Math.min(o,r)),"clamp"),to=e((r="TB")=>{switch(r){case"BT":return"bottom";case"LR":return"right";case"RL":return"left";case"TB":default:return"top"}},"getDefaultSelfLoopSide"),cu=e((r)=>r==="flowchart"||r==="flowchart-v2"||r==="stateDiagram"||r==="er"||r==="classDiagram","shouldMergeSelfLoopSegments"),pu=["x","y","width","height","labelBBox","intersect","calcIntersect","diff","clusterNode"],lu=e((r,t,o,i,a)=>{let f=[],s=new Set;if(o.forEach(({start:l,end:m})=>{if(l!==i)s.add(l);if(m!==i)s.add(m)}),s.forEach((l)=>{let m=r.node(l);if(typeof m?.x==="number"&&typeof m?.y==="number")f.push(m)}),f.length===0)o.forEach(({edge:l})=>{(l.points??[]).forEach((m)=>{if(typeof m?.x==="number"&&typeof m?.y==="number")f.push(m)})});if(f.length===0)return to(a);let d=f.reduce((l,m)=>({x:l.x+m.x/f.length,y:l.y+m.y/f.length}),{x:0,y:0}),c=d.x-t.x,p=d.y-t.y;if(Math.abs(c)>Math.abs(p))return c>0?"right":"left";if(Math.abs(p)>0)return p>0?"bottom":"top";return to(a)},"getSelfLoopSide"),mu=e((r,t="top",o=0,i=0)=>{let a=r.x,f=r.y-o,s=r.width/2,d=r.height/2,c=Math.max(36,Math.min(100,r.width*0.8)),p=eo(Math.max(i,r.width*0.35),36,c),l=eo(Math.min(r.width,r.height)*0.45,24,48);switch(t){case"bottom":{let m=f+d;return[{x:a-p/2,y:m},{x:a-p/2,y:m+l},{x:a+p/2,y:m+l},{x:a+p/2,y:m}]}case"right":{let m=a+s;return[{x:m,y:f-p/2},{x:m+l,y:f-p/2},{x:m+l,y:f+p/2},{x:m,y:f+p/2}]}case"left":{let m=a-s;return[{x:m,y:f-p/2},{x:m-l,y:f-p/2},{x:m-l,y:f+p/2},{x:m,y:f+p/2}]}case"top":default:{let m=f-d;return[{x:a-p/2,y:m},{x:a-p/2,y:m-l},{x:a+p/2,y:m-l},{x:a+p/2,y:m}]}}},"getSelfLoopPoints"),hu=e((r,t,o="top",i=0,a={})=>{let s=r.x,d=r.y-i,c=a.width??0,p=a.height??0;switch(o){case"bottom":return{x:s,y:Math.max(...t.map((l)=>l.y))+p/2+4};case"right":return{x:Math.max(...t.map((l)=>l.x))+c/2+4,y:d};case"left":return{x:Math.min(...t.map((l)=>l.x))-c/2-4,y:d};case"top":default:return{x:s,y:Math.min(...t.map((l)=>l.y))-p/2-4}}},"getSelfLoopLabelPosition"),oo=e((r,t=0,{mergeSelfLoops:o=!0}={})=>{let i=new Map,a=[],f=r.graph()?.rankdir;return r.edges().forEach((s)=>{let d=r.edge(s);if(o&&d.selfLoop){let c=d.selfLoop.id;if(!i.has(c))i.set(c,[]);i.get(c).push({edge:d,start:s.v,end:s.w})}else a.push({edge:d,start:s.v,end:s.w})}),i.forEach((s)=>{if(s.length!==3){s.forEach((_)=>a.push(_));return}s.sort((_,R)=>_.edge.selfLoop.order-R.edge.selfLoop.order);let[d,c,p]=s,l=d.edge.originalEdge??c.edge.originalEdge??p.edge.originalEdge??c.edge,m=r.node(l.start);if(!m){s.forEach((_)=>a.push(_));return}let h={width:c.edge.width,height:c.edge.height},v=lu(r,m,s,l.start,f),w=mu(m,v,t,h.width??0),y=hu(m,w,v,t,h),g={...c.edge,...l,id:l.id,points:w,start:l.start,end:l.end,x:y.x,y:y.y,width:h.width,height:h.height,labelStyle:c.edge.labelStyle,fromCluster:d.edge.fromCluster??c.edge.fromCluster??p.edge.fromCluster,toCluster:d.edge.toCluster??c.edge.toCluster??p.edge.toCluster};delete g.selfLoop,delete g.originalEdge,a.push({edge:g,start:g.start,end:g.end})}),a},"getEdgesToRender"),io=e(async({element:r,graph:t,diagramType:o,id:i,parentCluster:a,siteConfig:f})=>{let s=t.graph().rankdir;n.trace("Dir in recursive render - dir:",s);let{clusters:d,edgePaths:c,edgeLabels:p,nodes:l,rootGroups:m}=Ii(r,{edgePathsClass:"edgePaths"});if(!t.nodes())n.info("No nodes found for",t);else n.info("Recursive render XXX",t.nodes());if(t.edges().length>0)n.info("Recursive edges",t.edge(t.edges()[0]));let h=cu(o);await Promise.all(t.nodes().map(async function(y){let g=t.node(y);if(a!==void 0){let _=JSON.parse(JSON.stringify(a.clusterData));if(n.trace(`Setting data for parent cluster XXX
1
+ import{e,n,u,N,Bt,wl,St,gr,$t,yn,br}from"./index.a1bxkgd3.js";import{Le,Ge,st,Oe,vt,ir,te,Te,pt,or,mt,Hn,Di,Pi,Bi,$r,Ot,Fi,zr,Ve,Hr,Yt,Dt,Ur,sr,qr,$i,zi,Un,Ie,Hi,jr,lr,Gr,qn,jn,cr,Ui,Gn,qi,Ta,yt,Vn,ji,Gi,Vi,et,Wn,Kn,Vr,Wi,Yn,b,lt,xt,Re,ur,ue}from"./index.wrjdgn4c.js";import{Ri,Mi,Q,dn,cl,Ni,ot}from"./index.hvdnkr5m.js";import{sa}from"./index.e35b4yh5.js";var mr={};sa(mr,{default:()=>Z});var so=/\s/;function uo(r){var t=r.length;while(t--&&so.test(r.charAt(t)));return t}var ae=uo;var co=/^\s+/;function po(r){return r?r.slice(0,ae(r)+1).replace(co,""):r}var fe=po;var se=NaN,lo=/^[-+]0x[0-9a-f]+$/i,mo=/^0b[01]+$/i,ho=/^0o[0-7]+$/i,go=parseInt;function vo(r){if(typeof r=="number")return r;if(vt(r))return se;if(Te(r)){var t=typeof r.valueOf=="function"?r.valueOf():r;r=Te(t)?t+"":t}if(typeof r!="string")return r===0?r:+r;r=fe(r);var o=mo.test(r);return o||ho.test(r)?go(r.slice(2),o?2:8):lo.test(r)?se:+r}var de=vo;var ce=1/0,bo=179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000;function yo(r){if(!r)return r===0?r:0;if(r=de(r),r===ce||r===-ce){var t=r<0?-1:1;return t*bo}return r===r?r:0}var V=yo;function wo(r){var t=V(r),o=t%1;return t===t?o?t-o:t:0}var pe=wo;var le=Object.create,_o=function(){function r(){}return function(t){if(!Te(t))return{};if(le)return le(t);r.prototype=t;var o=new r;return r.prototype=void 0,o}}(),me=_o;function Eo(r,t){var o=-1,i=r.length;t||(t=Array(i));while(++o<i)t[o]=r[o];return t}var dr=Eo;function xo(r,t,o){if(t=="__proto__"&&Hn)Hn(r,t,{configurable:!0,enumerable:!0,value:o,writable:!0});else r[t]=o}var M=xo;var Oo=Object.prototype,Lo=Oo.hasOwnProperty;function Io(r,t,o){var i=r[t];if(!(Lo.call(r,t)&&Ot(i,o))||o===void 0&&!(t in r))M(r,t,o)}var j=Io;function So(r,t,o,i){var a=!o;o||(o={});var f=-1,s=t.length;while(++f<s){var d=t[f],c=i?i(o[d],r[d],d,o,r):void 0;if(c===void 0)c=r[d];if(a)M(o,d,c);else j(o,d,c)}return o}var k=So;function No(r,t,o){if(!Te(o))return!1;var i=typeof t;if(i=="number"?Ve(o)&&$r(t,o.length):i=="string"&&(t in o))return Ot(o[t],r);return!1}var C=No;function Po(r){return zr(function(t,o){var i=-1,a=o.length,f=a>1?o[a-1]:void 0,s=a>2?o[2]:void 0;if(f=r.length>3&&typeof f=="function"?(a--,f):void 0,s&&C(o[0],o[1],s))f=a<3?void 0:f,a=1;t=Object(t);while(++i<a){var d=o[i];if(d)r(t,d,i,f)}return t})}var he=Po;function ko(r){var t=[];if(r!=null)for(var o in Object(r))t.push(o);return t}var ge=ko;var To=Object.prototype,Co=To.hasOwnProperty;function Ao(r){if(!Te(r))return ge(r);var t=Hr(r),o=[];for(var i in r)if(!(i=="constructor"&&(t||!Co.call(r,i))))o.push(i);return o}var ve=Ao;function Ro(r){return Ve(r)?$i(r,!0):ve(r)}var L=Ro;function Mo(r){var t=r==null?0:r.length;return t?jn(r,1):[]}var S=Mo;function jo(r){return Di(Fi(r,void 0,S),r+"")}var be=jo;var Bo=zi(Object.getPrototypeOf,Object),Y=Bo;var Do="[object Object]",Fo=Function.prototype,Go=Object.prototype,ye=Fo.toString,Xo=Go.hasOwnProperty,Uo=ye.call(Object);function Vo(r){if(!Oe(r)||st(r)!=Do)return!1;var t=Y(r);if(t===null)return!0;var o=Xo.call(t,"constructor")&&t.constructor;return typeof o=="function"&&o instanceof o&&ye.call(o)==Uo}var we=Vo;var Yo="\\ud800-\\udfff",zo="\\u0300-\\u036f",Wo="\\ufe20-\\ufe2f",qo="\\u20d0-\\u20ff",Ho=zo+Wo+qo,Ko="\\ufe0e\\ufe0f",Jo="\\u200d",Zo=RegExp("["+Jo+Yo+Ho+Ko+"]");function $o(r){return Zo.test(r)}var _e=$o;function Qo(r,t){return r&&k(t,Ie(t),r)}var Ee=Qo;function ri(r,t){return r&&k(t,L(t),r)}var xe=ri;var ke=typeof mr=="object"&&mr&&!mr.nodeType&&mr,Se=ke&&typeof pr=="object"&&pr&&!pr.nodeType&&pr,ei=Se&&Se.exports===ke,Ne=ei?Le.Buffer:void 0,Pe=Ne?Ne.allocUnsafe:void 0;function ti(r,t){if(t)return r.slice();var o=r.length,i=Pe?Pe(o):new r.constructor(o);return r.copy(i),i}var Z=ti;function ni(r,t){return k(r,Gn(r),t)}var Ce=ni;var oi=Object.getOwnPropertySymbols,ii=!oi?Ui:function(r){var t=[];while(r)qn(t,Gn(r)),r=Y(r);return t},hr=ii;function ai(r,t){return k(r,hr(r),t)}var Ae=ai;function fi(r){return qi(r,L,hr)}var Me=fi;var si=Object.prototype,ui=si.hasOwnProperty;function di(r){var t=r.length,o=new r.constructor(t);if(t&&typeof r[0]=="string"&&ui.call(r,"index"))o.index=r.index,o.input=r.input;return o}var je=di;function ci(r){var t=new r.constructor(r.byteLength);return new Vn(t).set(new Vn(r)),t}var z=ci;function pi(r,t){var o=t?z(r.buffer):r.buffer;return new r.constructor(o,r.byteOffset,r.byteLength)}var Be=pi;var li=/\w*$/;function mi(r){var t=new r.constructor(r.source,li.exec(r));return t.lastIndex=r.lastIndex,t}var De=mi;var Fe=Ge?Ge.prototype:void 0,Xe=Fe?Fe.valueOf:void 0;function hi(r){return Xe?Object(Xe.call(r)):{}}var Ue=hi;function gi(r,t){var o=t?z(r.buffer):r.buffer;return new r.constructor(o,r.byteOffset,r.length)}var vr=gi;var vi="[object Boolean]",bi="[object Date]",yi="[object Map]",wi="[object Number]",_i="[object RegExp]",Ei="[object Set]",xi="[object String]",Oi="[object Symbol]",Li="[object ArrayBuffer]",Ii="[object DataView]",Si="[object Float32Array]",ki="[object Float64Array]",Ti="[object Int8Array]",Ci="[object Int16Array]",Ai="[object Int32Array]",Xi="[object Uint8Array]",Yi="[object Uint8ClampedArray]",Ki="[object Uint16Array]",Ji="[object Uint32Array]";function Zi(r,t,o){var i=r.constructor;switch(t){case Li:return z(r);case vi:case bi:return new i(+r);case Ii:return Be(r,o);case Si:case ki:case Ti:case Ci:case Ai:case Xi:case Yi:case Ki:case Ji:return vr(r,o);case yi:return new i;case wi:case xi:return new i(r);case _i:return De(r);case Ei:return new i;case Oi:return Ue(r)}}var Ye=Zi;function Qi(r){return typeof r.constructor=="function"&&!Hr(r)?me(Y(r)):{}}var yr=Qi;var ra="[object Map]";function ea(r){return Oe(r)&&yt(r)==ra}var ze=ea;var We=sr&&sr.isMap,ta=We?Ur(We):ze,qe=ta;var na="[object Set]";function oa(r){return Oe(r)&&yt(r)==na}var He=oa;var Ke=sr&&sr.isSet,ia=Ke?Ur(Ke):He,Je=ia;var aa=1,fa=2,ua=4,Ze="[object Arguments]",da="[object Array]",ca="[object Boolean]",pa="[object Date]",la="[object Error]",$e="[object Function]",ma="[object GeneratorFunction]",ha="[object Map]",ga="[object Number]",Qe="[object Object]",va="[object RegExp]",ba="[object Set]",ya="[object String]",wa="[object Symbol]",_a="[object WeakMap]",Ea="[object ArrayBuffer]",xa="[object DataView]",Oa="[object Float32Array]",La="[object Float64Array]",Ia="[object Int8Array]",Sa="[object Int16Array]",Na="[object Int32Array]",Pa="[object Uint8Array]",ka="[object Uint8ClampedArray]",Ca="[object Uint16Array]",Aa="[object Uint32Array]",x={};x[Ze]=x[da]=x[Ea]=x[xa]=x[ca]=x[pa]=x[Oa]=x[La]=x[Ia]=x[Sa]=x[Na]=x[ha]=x[ga]=x[Qe]=x[va]=x[ba]=x[ya]=x[wa]=x[Pa]=x[ka]=x[Ca]=x[Aa]=!0;x[la]=x[$e]=x[_a]=!1;function wr(r,t,o,i,a,f){var s,d=t&aa,c=t&fa,p=t&ua;if(o)s=a?o(r,i,a,f):o(r);if(s!==void 0)return s;if(!Te(r))return r;var l=te(r);if(l){if(s=je(r),!d)return dr(r,s)}else{var m=yt(r),h=m==$e||m==ma;if(Dt(r))return Z(r,d);if(m==Qe||m==Ze||h&&!a){if(s=c||h?{}:yr(r),!d)return c?Ae(r,xe(s,r)):Ce(r,Ee(s,r))}else{if(!x[m])return a?r:{};s=Ye(r,m,d)}}f||(f=new cr);var v=f.get(r);if(v)return v;if(f.set(r,s),Je(r))r.forEach(function(g){s.add(wr(g,t,o,g,r,f))});else if(qe(r))r.forEach(function(g,_){s.set(_,wr(g,t,o,_,r,f))});var w=p?c?Me:Ta:c?L:Ie,y=l?void 0:w(r);return Pi(y||r,function(g,_){if(y)_=g,g=r[_];j(s,_,wr(g,t,o,_,r,f))}),s}var rt=wr;var Ra=1,Ma=4;function ja(r){return rt(r,Ra|Ma)}var tt=ja;var Ba=function(){return Le.Date.now()},Sr=Ba;var nt=Object.prototype,Da=nt.hasOwnProperty,Fa=zr(function(r,t){r=Object(r);var o=-1,i=t.length,a=i>2?t[2]:void 0;if(a&&C(t[0],t[1],a))i=1;while(++o<i){var f=t[o],s=L(f),d=-1,c=s.length;while(++d<c){var p=s[d],l=r[p];if(l===void 0||Ot(l,nt[p])&&!Da.call(r,p))r[p]=f[p]}}return r}),it=Fa;function Ga(r,t,o){if(o!==void 0&&!Ot(r[t],o)||o===void 0&&!(t in r))M(r,t,o)}var rr=Ga;function Xa(r,t){if(t==="constructor"&&typeof r[t]==="function")return;if(t=="__proto__")return;return r[t]}var er=Xa;function Ua(r){return k(r,L(r))}var at=Ua;function Va(r,t,o,i,a,f,s){var d=er(r,o),c=er(t,o),p=s.get(c);if(p){rr(r,o,p);return}var l=f?f(d,c,o+"",r,t,s):void 0,m=l===void 0;if(m){var h=te(c),v=!h&&Dt(c),w=!h&&!v&&qr(c);if(l=c,h||v||w)if(te(d))l=d;else if(Wi(d))l=dr(d);else if(v)m=!1,l=Z(c,!0);else if(w)m=!1,l=vr(c,!0);else l=[];else if(we(c)||Yt(c)){if(l=d,Yt(d))l=at(d);else if(!Te(d)||or(d))l=yr(c)}else m=!1}if(m)s.set(c,l),a(l,c,i,f,s),s.delete(c);rr(r,o,l)}var ft=Va;function ut(r,t,o,i,a){if(r===t)return;Wn(t,function(f,s){if(a||(a=new cr),Te(f))ft(r,t,s,o,ut,i,a);else{var d=i?i(er(r,s),f,s+"",r,t,a):void 0;if(d===void 0)d=f;rr(r,s,d)}},L)}var dt=ut;function Ya(r){var t=r==null?0:r.length;return t?r[t-1]:void 0}var X=Ya;function za(r){return function(t,o,i){var a=Object(t);if(!Ve(t)){var f=et(o,3);t=Ie(t),o=function(d){return f(a[d],d,a)}}var s=r(t,o,i);return s>-1?a[f?t[s]:s]:void 0}}var ct=za;var Wa=Math.max;function qa(r,t,o){var i=r==null?0:r.length;if(!i)return-1;var a=o==null?0:pe(o);if(a<0)a=Wa(i+a,0);return Bi(r,et(t,3),a)}var ht=qa;var Ha=ct(ht),tr=Ha;function Ka(r,t){var o=-1,i=Ve(r)?Array(r.length):[];return Vr(r,function(a,f,s){i[++o]=t(a,f,s)}),i}var _r=Ka;function Ja(r,t){var o=te(r)?ir:_r;return o(r,et(t,3))}var E=Ja;function Za(r,t){return r==null?r:Wn(r,Yn(t),L)}var gt=Za;function $a(r,t){return r&&Kn(r,Yn(t))}var bt=$a;function Qa(r,t){return r>t}var wt=Qa;var rf=Object.prototype,ef=rf.hasOwnProperty;function tf(r,t){return r!=null&&ef.call(r,t)}var _t=tf;function nf(r,t){return r!=null&&ji(r,t,_t)}var Er=nf;var of="[object String]";function af(r){return typeof r=="string"||!te(r)&&Oe(r)&&st(r)==of}var Et=af;function ff(r,t){return r<t}var xr=ff;function sf(r,t){var o={};return t=et(t,3),Kn(r,function(i,a,f){M(o,a,t(i,a,f))}),o}var W=sf;function uf(r,t,o){var i=-1,a=r.length;while(++i<a){var f=r[i],s=t(f);if(s!=null&&(d===void 0?s===s&&!vt(s):o(s,d)))var d=s,c=f}return c}var q=uf;function df(r){return r&&r.length?q(r,pt,wt):void 0}var I=df;var cf=he(function(r,t,o){dt(r,t,o)}),nr=cf;function pf(r){return r&&r.length?q(r,pt,xr):void 0}var B=pf;function lf(r,t){return r&&r.length?q(r,et(t,2),xr):void 0}var H=lf;function mf(r,t,o,i){if(!Te(r))return r;t=jr(t,r);var a=-1,f=t.length,s=f-1,d=r;while(d!=null&&++a<f){var c=lr(t[a]),p=o;if(c==="__proto__"||c==="constructor"||c==="prototype")return r;if(a!=s){var l=d[c];if(p=i?i(l,c,d):void 0,p===void 0)p=Te(l)?l:$r(t[a+1])?[]:{}}j(d,c,p),d=d[c]}return r}var Lt=mf;function hf(r,t,o){var i=-1,a=t.length,f={};while(++i<a){var s=t[i],d=Gr(r,s);if(o(d,s))Lt(f,jr(s,r),d)}return f}var It=hf;function gf(r,t){var o=r.length;r.sort(t);while(o--)r[o]=r[o].value;return r}var Nt=gf;function vf(r,t){if(r!==t){var o=r!==void 0,i=r===null,a=r===r,f=vt(r),s=t!==void 0,d=t===null,c=t===t,p=vt(t);if(!d&&!p&&!f&&r>t||f&&s&&c&&!d&&!p||i&&s&&c||!o&&c||!a)return 1;if(!i&&!f&&!p&&r<t||p&&o&&a&&!i&&!f||d&&o&&a||!s&&a||!c)return-1}return 0}var Pt=vf;function bf(r,t,o){var i=-1,a=r.criteria,f=t.criteria,s=a.length,d=o.length;while(++i<s){var c=Pt(a[i],f[i]);if(c){if(i>=d)return c;var p=o[i];return c*(p=="desc"?-1:1)}}return r.index-t.index}var kt=bf;function yf(r,t,o){if(t.length)t=ir(t,function(f){if(te(f))return function(s){return Gr(s,f.length===1?f[0]:f)};return f});else t=[pt];var i=-1;t=ir(t,Ur(et));var a=_r(r,function(f,s,d){var c=ir(t,function(p){return p(f)});return{criteria:c,index:++i,value:f}});return Nt(a,function(f,s){return kt(f,s,o)})}var Tt=yf;var wf=Vi("length"),Ct=wf;var Rt="\\ud800-\\udfff",_f="\\u0300-\\u036f",Ef="\\ufe20-\\ufe2f",xf="\\u20d0-\\u20ff",Of=_f+Ef+xf,Lf="\\ufe0e\\ufe0f",If="["+Rt+"]",Nr="["+Of+"]",Pr="\\ud83c[\\udffb-\\udfff]",Sf="(?:"+Nr+"|"+Pr+")",Mt="[^"+Rt+"]",jt="(?:\\ud83c[\\udde6-\\uddff]){2}",Ft="[\\ud800-\\udbff][\\udc00-\\udfff]",Nf="\\u200d",Gt=Sf+"?",Xt="["+Lf+"]?",Pf="(?:"+Nf+"(?:"+[Mt,jt,Ft].join("|")+")"+Xt+Gt+")*",kf=Xt+Gt+Pf,Tf="(?:"+[Mt+Nr+"?",Nr,jt,Ft,If].join("|")+")",At=RegExp(Pr+"(?="+Pr+")|"+Tf+kf,"g");function Cf(r){var t=At.lastIndex=0;while(At.test(r))++t;return t}var Ut=Cf;function Af(r){return _e(r)?Ut(r):Ct(r)}var Vt=Af;function Rf(r,t){return It(r,t,function(o,i){return Gi(r,i)})}var zt=Rf;var Mf=be(function(r,t){return r==null?{}:zt(r,t)}),K=Mf;var{ceil:jf,max:Bf}=Math;function Df(r,t,o,i){var a=-1,f=Bf(jf((t-r)/(o||1)),0),s=Array(f);while(f--)s[i?f:++a]=r,r+=o;return s}var Wt=Df;function Ff(r){return function(t,o,i){if(i&&typeof i!="number"&&C(t,o,i))o=i=void 0;if(t=V(t),o===void 0)o=t,t=0;else o=V(o);return i=i===void 0?t<o?1:-1:V(i),Wt(t,o,i,r)}}var qt=Ff;var Gf=qt(),P=Gf;var Xf="[object Map]",Uf="[object Set]";function Vf(r){if(r==null)return 0;if(Ve(r))return Et(r)?Vt(r):r.length;var t=yt(r);if(t==Xf||t==Uf)return r.size;return Un(r).length}var Ht=Vf;var Yf=zr(function(r,t){if(r==null)return[];var o=t.length;if(o>1&&C(r,t[0],t[1]))t=[];else if(o>2&&C(t[0],t[1],t[2]))t=[t[0]];return Tt(r,jn(t,1),[])}),A=Yf;var zf=0;function Wf(r){var t=++zf;return Hi(r)+t}var J=Wf;function qf(r,t,o){var i=-1,a=r.length,f=t.length,s={};while(++i<a){var d=i<f?t[i]:void 0;o(s,r[i],d)}return s}var Kt=qf;function Hf(r,t){return Kt(r||[],t||[],j)}var kr=Hf;class Tr{constructor(){var r={};r._next=r._prev=r,this._sentinel=r}dequeue(){var r=this._sentinel,t=r._prev;if(t!==r)return Jt(t),t}enqueue(r){var t=this._sentinel;if(r._prev&&r._next)Jt(r);r._next=t._next,t._next._prev=r,t._next=r,r._prev=t}toString(){var r=[],t=this._sentinel,o=t._prev;while(o!==t)r.push(JSON.stringify(o,Kf)),o=o._prev;return"["+r.join(", ")+"]"}}function Jt(r){r._prev._next=r._next,r._next._prev=r._prev,delete r._next,delete r._prev}function Kf(r,t){if(r!=="_next"&&r!=="_prev")return t}var Jf=mt(1);function Zt(r,t){if(r.nodeCount()<=1)return[];var o=$f(r,t||Jf),i=Zf(o.graph,o.buckets,o.zeroIdx);return S(E(i,function(a){return r.outEdges(a.v,a.w)}))}function Zf(r,t,o){var i=[],a=t[t.length-1],f=t[0],s;while(r.nodeCount()){while(s=f.dequeue())Cr(r,t,o,s);while(s=a.dequeue())Cr(r,t,o,s);if(r.nodeCount()){for(var d=t.length-2;d>0;--d)if(s=t[d].dequeue(),s){i=i.concat(Cr(r,t,o,s,!0));break}}}return i}function Cr(r,t,o,i,a){var f=a?[]:void 0;return b(r.inEdges(i.v),function(s){var d=r.edge(s),c=r.node(s.v);if(a)f.push({v:s.v,w:s.w});c.out-=d,Ar(t,o,c)}),b(r.outEdges(i.v),function(s){var d=r.edge(s),c=s.w,p=r.node(c);p.in-=d,Ar(t,o,p)}),r.removeNode(i.v),f}function $f(r,t){var o=new ue,i=0,a=0;b(r.nodes(),function(d){o.setNode(d,{v:d,in:0,out:0})}),b(r.edges(),function(d){var c=o.edge(d.v,d.w)||0,p=t(d),l=c+p;o.setEdge(d.v,d.w,l),a=Math.max(a,o.node(d.v).out+=p),i=Math.max(i,o.node(d.w).in+=p)});var f=P(a+i+3).map(function(){return new Tr}),s=i+1;return b(o.nodes(),function(d){Ar(f,s,o.node(d))}),{graph:o,buckets:f,zeroIdx:s}}function Ar(r,t,o){if(!o.out)r[0].enqueue(o);else if(!o.in)r[r.length-1].enqueue(o);else r[o.out-o.in+t].enqueue(o)}function Qt(r){var t=r.graph().acyclicer==="greedy"?Zt(r,o(r)):Qf(r);b(t,function(i){var a=r.edge(i);r.removeEdge(i),a.forwardName=i.name,a.reversed=!0,r.setEdge(i.w,i.v,a,J("rev"))});function o(i){return function(a){return i.edge(a).weight}}}function Qf(r){var t=[],o={},i={};function a(f){if(Object.prototype.hasOwnProperty.call(i,f))return;i[f]=!0,o[f]=!0,b(r.outEdges(f),function(s){if(Object.prototype.hasOwnProperty.call(o,s.w))t.push(s);else a(s.w)}),delete o[f]}return b(r.nodes(),a),t}function rn(r){b(r.edges(),function(t){var o=r.edge(t);if(o.reversed){r.removeEdge(t);var i=o.forwardName;delete o.reversed,delete o.forwardName,r.setEdge(t.w,t.v,o,i)}})}function T(r,t,o,i){var a;do a=J(i);while(r.hasNode(a));return o.dummy=t,r.setNode(a,o),a}function tn(r){var t=new ue().setGraph(r.graph());return b(r.nodes(),function(o){t.setNode(o,r.node(o))}),b(r.edges(),function(o){var i=t.edge(o.v,o.w)||{weight:0,minlen:1},a=r.edge(o);t.setEdge(o.v,o.w,{weight:i.weight+a.weight,minlen:Math.max(i.minlen,a.minlen)})}),t}function Or(r){var t=new ue({multigraph:r.isMultigraph()}).setGraph(r.graph());return b(r.nodes(),function(o){if(!r.children(o).length)t.setNode(o,r.node(o))}),b(r.edges(),function(o){t.setEdge(o,r.edge(o))}),t}function Rr(r,t){var{x:o,y:i}=r,a=t.x-o,f=t.y-i,s=r.width/2,d=r.height/2;if(!a&&!f)throw Error("Not possible to find intersection inside of the rectangle");var c,p;if(Math.abs(f)*s>Math.abs(a)*d){if(f<0)d=-d;c=d*a/f,p=d}else{if(a<0)s=-s;c=s,p=s*f/a}return{x:o+c,y:i+p}}function D(r){var t=E(P(Br(r)+1),function(){return[]});return b(r.nodes(),function(o){var i=r.node(o),a=i.rank;if(!Re(a))t[a][i.order]=o}),t}function nn(r){var t=B(E(r.nodes(),function(o){return r.node(o).rank}));b(r.nodes(),function(o){var i=r.node(o);if(Er(i,"rank"))i.rank-=t})}function on(r){var t=B(E(r.nodes(),function(f){return r.node(f).rank})),o=[];b(r.nodes(),function(f){var s=r.node(f).rank-t;if(!o[s])o[s]=[];o[s].push(f)});var i=0,a=r.graph().nodeRankFactor;b(o,function(f,s){if(Re(f)&&s%a!==0)--i;else if(i)b(f,function(d){r.node(d).rank+=i})})}function Mr(r,t,o,i){var a={width:0,height:0};if(arguments.length>=4)a.rank=o,a.order=i;return T(r,"border",a,t)}function Br(r){return I(E(r.nodes(),function(t){var o=r.node(t).rank;if(!Re(o))return o}))}function an(r,t){var o={lhs:[],rhs:[]};return b(r,function(i){if(t(i))o.lhs.push(i);else o.rhs.push(i)}),o}function fn(r,t){var o=Sr();try{return t()}finally{console.log(r+" time: "+(Sr()-o)+"ms")}}function sn(r,t){return t()}function cn(r){function t(o){var i=r.children(o),a=r.node(o);if(i.length)b(i,t);if(Object.prototype.hasOwnProperty.call(a,"minRank")){a.borderLeft=[],a.borderRight=[];for(var f=a.minRank,s=a.maxRank+1;f<s;++f)un(r,"borderLeft","_bl",o,a,f),un(r,"borderRight","_br",o,a,f)}}b(r.children(),t)}function un(r,t,o,i,a,f){var s={width:0,height:0,rank:f,borderType:t},d=a[t][f-1],c=T(r,"border",s,o);if(a[t][f]=c,r.setParent(c,i),d)r.setEdge(d,c,{weight:1})}function ln(r){var t=r.graph().rankdir.toLowerCase();if(t==="lr"||t==="rl")hn(r)}function mn(r){var t=r.graph().rankdir.toLowerCase();if(t==="bt"||t==="rl")rs(r);if(t==="lr"||t==="rl")es(r),hn(r)}function hn(r){b(r.nodes(),function(t){pn(r.node(t))}),b(r.edges(),function(t){pn(r.edge(t))})}function pn(r){var t=r.width;r.width=r.height,r.height=t}function rs(r){b(r.nodes(),function(t){Dr(r.node(t))}),b(r.edges(),function(t){var o=r.edge(t);if(b(o.points,Dr),Object.prototype.hasOwnProperty.call(o,"y"))Dr(o)})}function Dr(r){r.y=-r.y}function es(r){b(r.nodes(),function(t){Fr(r.node(t))}),b(r.edges(),function(t){var o=r.edge(t);if(b(o.points,Fr),Object.prototype.hasOwnProperty.call(o,"x"))Fr(o)})}function Fr(r){var t=r.x;r.x=r.y,r.y=t}function gn(r){r.graph().dummyChains=[],b(r.edges(),function(t){ns(r,t)})}function ns(r,t){var o=t.v,i=r.node(o).rank,a=t.w,f=r.node(a).rank,s=t.name,d=r.edge(t),c=d.labelRank;if(f===i+1)return;r.removeEdge(t);var p=void 0,l,m;for(m=0,++i;i<f;++m,++i){if(d.points=[],p={width:0,height:0,edgeLabel:d,edgeObj:t,rank:i},l=T(r,"edge",p,"_d"),i===c)p.width=d.width,p.height=d.height,p.dummy="edge-label",p.labelpos=d.labelpos;if(r.setEdge(o,l,{weight:d.weight},s),m===0)r.graph().dummyChains.push(l);o=l}r.setEdge(o,a,{weight:d.weight},s)}function vn(r){b(r.graph().dummyChains,function(t){var o=r.node(t),i=o.edgeLabel,a;r.setEdge(o.edgeObj,i);while(o.dummy){if(a=r.successors(t)[0],r.removeNode(t),i.points.push({x:o.x,y:o.y}),o.dummy==="edge-label")i.x=o.x,i.y=o.y,i.width=o.width,i.height=o.height;t=a,o=r.node(t)}})}function ar(r){var t={};function o(i){var a=r.node(i);if(Object.prototype.hasOwnProperty.call(t,i))return a.rank;t[i]=!0;var f=B(E(r.outEdges(i),function(s){return o(s.w)-r.edge(s).minlen}));if(f===Number.POSITIVE_INFINITY||f===void 0||f===null)f=0;return a.rank=f}b(r.sources(),o)}function U(r,t){return r.node(t.w).rank-r.node(t.v).rank-r.edge(t).minlen}function Lr(r){var t=new ue({directed:!1}),o=r.nodes()[0],i=r.nodeCount();t.setNode(o,{});var a,f;while(os(t,r)<i)a=is(t,r),f=t.hasNode(a.v)?U(r,a):-U(r,a),as(t,r,f);return t}function os(r,t){function o(i){b(t.nodeEdges(i),function(a){var f=a.v,s=i===f?a.w:f;if(!r.hasNode(s)&&!U(t,a))r.setNode(s,{}),r.setEdge(i,s,{}),o(s)})}return b(r.nodes(),o),r.nodeCount()}function is(r,t){return H(t.edges(),function(o){if(r.hasNode(o.v)!==r.hasNode(o.w))return U(t,o)})}function as(r,t,o){b(r.nodes(),function(i){t.node(i).rank+=o})}var uh=mt(1);var gh=mt(1);Xr.CycleException=fr;function Xr(r){var t={},o={},i=[];function a(f){if(Object.prototype.hasOwnProperty.call(o,f))throw new fr;if(!Object.prototype.hasOwnProperty.call(t,f))o[f]=!0,t[f]=!0,b(r.predecessors(f),a),delete o[f],i.push(f)}if(b(r.sinks(),a),Ht(t)!==r.nodeCount())throw new fr;return i}function fr(){}fr.prototype=Error();function Ir(r,t,o){if(!te(t))t=[t];var i=(r.isDirected()?r.successors:r.neighbors).bind(r),a=[],f={};return b(t,function(s){if(!r.hasNode(s))throw Error("Graph does not have node: "+s);wn(r,s,o==="post",f,i,a)}),a}function wn(r,t,o,i,a,f){if(!Object.prototype.hasOwnProperty.call(i,t)){if(i[t]=!0,!o)f.push(t);if(b(a(t),function(s){wn(r,s,o,i,a,f)}),o)f.push(t)}}function Yr(r,t){return Ir(r,t,"post")}function Wr(r,t){return Ir(r,t,"pre")}G.initLowLimValues=Jr;G.initCutValues=Kr;G.calcCutValue=En;G.leaveEdge=On;G.enterEdge=Ln;G.exchangeEdges=In;function G(r){r=tn(r),ar(r);var t=Lr(r);Jr(t),Kr(t,r);var o,i;while(o=On(t))i=Ln(t,r,o),In(t,r,o,i)}function Kr(r,t){var o=Yr(r,r.nodes());o=o.slice(0,o.length-1),b(o,function(i){cs(r,t,i)})}function cs(r,t,o){var i=r.node(o),a=i.parent;r.edge(o,a).cutvalue=En(r,t,o)}function En(r,t,o){var i=r.node(o),a=i.parent,f=!0,s=t.edge(o,a),d=0;if(!s)f=!1,s=t.edge(a,o);return d=s.weight,b(t.nodeEdges(o),function(c){var p=c.v===o,l=p?c.w:c.v;if(l!==a){var m=p===f,h=t.edge(c).weight;if(d+=m?h:-h,ls(r,o,l)){var v=r.edge(o,l).cutvalue;d+=m?-v:v}}}),d}function Jr(r,t){if(arguments.length<2)t=r.nodes()[0];xn(r,{},1,t)}function xn(r,t,o,i,a){var f=o,s=r.node(i);if(t[i]=!0,b(r.neighbors(i),function(d){if(!Object.prototype.hasOwnProperty.call(t,d))o=xn(r,t,o,d,i)}),s.low=f,s.lim=o++,a)s.parent=a;else delete s.parent;return o}function On(r){return tr(r.edges(),function(t){return r.edge(t).cutvalue<0})}function Ln(r,t,o){var{v:i,w:a}=o;if(!t.hasEdge(i,a))i=o.w,a=o.v;var f=r.node(i),s=r.node(a),d=f,c=!1;if(f.lim>s.lim)d=s,c=!0;var p=lt(t.edges(),function(l){return c===_n(r,r.node(l.v),d)&&c!==_n(r,r.node(l.w),d)});return H(p,function(l){return U(t,l)})}function In(r,t,o,i){var{v:a,w:f}=o;r.removeEdge(a,f),r.setEdge(i.v,i.w,{}),Jr(r),Kr(r,t),ps(r,t)}function ps(r,t){var o=tr(r.nodes(),function(a){return!t.node(a).parent}),i=Wr(r,o);i=i.slice(1),b(i,function(a){var f=r.node(a).parent,s=t.edge(a,f),d=!1;if(!s)s=t.edge(f,a),d=!0;t.node(a).rank=t.node(f).rank+(d?s.minlen:-s.minlen)})}function ls(r,t,o){return r.hasEdge(t,o)}function _n(r,t,o){return o.low<=t.lim&&t.lim<=o.lim}function Zr(r){switch(r.graph().ranker){case"network-simplex":Sn(r);break;case"tight-tree":hs(r);break;case"longest-path":ms(r);break;default:Sn(r)}}var ms=ar;function hs(r){ar(r),Lr(r)}function Sn(r){G(r)}function Nn(r){var t=T(r,"root",{},"_root"),o=gs(r),i=I(xt(o))-1,a=2*i+1;r.graph().nestingRoot=t,b(r.edges(),function(s){r.edge(s).minlen*=a});var f=vs(r)+1;b(r.children(),function(s){Pn(r,t,a,f,i,o,s)}),r.graph().nodeRankFactor=a}function Pn(r,t,o,i,a,f,s){var d=r.children(s);if(!d.length){if(s!==t)r.setEdge(t,s,{weight:0,minlen:o});return}var c=Mr(r,"_bt"),p=Mr(r,"_bb"),l=r.node(s);if(r.setParent(c,s),l.borderTop=c,r.setParent(p,s),l.borderBottom=p,b(d,function(m){Pn(r,t,o,i,a,f,m);var h=r.node(m),v=h.borderTop?h.borderTop:m,w=h.borderBottom?h.borderBottom:m,y=h.borderTop?i:2*i,g=v!==w?1:a-f[s]+1;r.setEdge(c,v,{weight:y,minlen:g,nestingEdge:!0}),r.setEdge(w,p,{weight:y,minlen:g,nestingEdge:!0})}),!r.parent(s))r.setEdge(t,c,{weight:0,minlen:a+f[s]})}function gs(r){var t={};function o(i,a){var f=r.children(i);if(f&&f.length)b(f,function(s){o(s,a+1)});t[i]=a}return b(r.children(),function(i){o(i,1)}),t}function vs(r){return ur(r.edges(),function(t,o){return t+r.edge(o).weight},0)}function kn(r){var t=r.graph();r.removeNode(t.nestingRoot),delete t.nestingRoot,b(r.edges(),function(o){var i=r.edge(o);if(i.nestingEdge)r.removeEdge(o)})}function Tn(r,t,o){var i={},a;b(o,function(f){var s=r.parent(f),d,c;while(s){if(d=r.parent(s),d)c=i[d],i[d]=s;else c=a,a=s;if(c&&c!==s){t.setEdge(c,s);return}s=d}})}function Cn(r,t,o){var i=ys(r),a=new ue({compound:!0}).setGraph({root:i}).setDefaultNodeLabel(function(f){return r.node(f)});return b(r.nodes(),function(f){var s=r.node(f),d=r.parent(f);if(s.rank===t||s.minRank<=t&&t<=s.maxRank){if(a.setNode(f),a.setParent(f,d||i),b(r[o](f),function(c){var p=c.v===f?c.w:c.v,l=a.edge(p,f),m=!Re(l)?l.weight:0;a.setEdge(p,f,{weight:r.edge(c).weight+m})}),Object.prototype.hasOwnProperty.call(s,"minRank"))a.setNode(f,{borderLeft:s.borderLeft[t],borderRight:s.borderRight[t]})}}),a}function ys(r){var t;while(r.hasNode(t=J("_root")));return t}function An(r,t){var o=0;for(var i=1;i<t.length;++i)o+=ws(r,t[i-1],t[i]);return o}function ws(r,t,o){var i=kr(o,E(o,function(p,l){return l})),a=S(E(t,function(p){return A(E(r.outEdges(p),function(l){return{pos:i[l.w],weight:r.edge(l).weight}}),"pos")})),f=1;while(f<o.length)f<<=1;var s=2*f-1;f-=1;var d=E(Array(s),function(){return 0}),c=0;return b(a.forEach(function(p){var l=p.pos+f;d[l]+=p.weight;var m=0;while(l>0){if(l%2)m+=d[l+1];l=l-1>>1,d[l]+=p.weight}c+=p.weight*m})),c}function Rn(r){var t={},o=lt(r.nodes(),function(d){return!r.children(d).length}),i=I(E(o,function(d){return r.node(d).rank})),a=E(P(i+1),function(){return[]});function f(d){if(Er(t,d))return;t[d]=!0;var c=r.node(d);a[c.rank].push(d),b(r.successors(d),f)}var s=A(o,function(d){return r.node(d).rank});return b(s,f),a}function Mn(r,t){return E(t,function(o){var i=r.inEdges(o);if(!i.length)return{v:o};else{var a=ur(i,function(f,s){var d=r.edge(s),c=r.node(s.v);return{sum:f.sum+d.weight*c.order,weight:f.weight+d.weight}},{sum:0,weight:0});return{v:o,barycenter:a.sum/a.weight,weight:a.weight}}})}function Bn(r,t){var o={};b(r,function(a,f){var s=o[a.v]={indegree:0,in:[],out:[],vs:[a.v],i:f};if(!Re(a.barycenter))s.barycenter=a.barycenter,s.weight=a.weight}),b(t.edges(),function(a){var f=o[a.v],s=o[a.w];if(!Re(f)&&!Re(s))s.indegree++,f.out.push(o[a.w])});var i=lt(o,function(a){return!a.indegree});return _s(i)}function _s(r){var t=[];function o(f){return function(s){if(s.merged)return;if(Re(s.barycenter)||Re(f.barycenter)||s.barycenter>=f.barycenter)Es(f,s)}}function i(f){return function(s){if(s.in.push(f),--s.indegree===0)r.push(s)}}while(r.length){var a=r.pop();t.push(a),b(a.in.reverse(),o(a)),b(a.out,i(a))}return E(lt(t,function(f){return!f.merged}),function(f){return K(f,["vs","i","barycenter","weight"])})}function Es(r,t){var o=0,i=0;if(r.weight)o+=r.barycenter*r.weight,i+=r.weight;if(t.weight)o+=t.barycenter*t.weight,i+=t.weight;r.vs=t.vs.concat(r.vs),r.barycenter=o/i,r.weight=i,r.i=Math.min(t.i,r.i),t.merged=!0}function Fn(r,t){var o=an(r,function(l){return Object.prototype.hasOwnProperty.call(l,"barycenter")}),i=o.lhs,a=A(o.rhs,function(l){return-l.i}),f=[],s=0,d=0,c=0;i.sort(xs(!!t)),c=Dn(f,a,c),b(i,function(l){c+=l.vs.length,f.push(l.vs),s+=l.barycenter*l.weight,d+=l.weight,c=Dn(f,a,c)});var p={vs:S(f)};if(d)p.barycenter=s/d,p.weight=d;return p}function Dn(r,t,o){var i;while(t.length&&(i=X(t)).i<=o)t.pop(),r.push(i.vs),o++;return o}function xs(r){return function(t,o){if(t.barycenter<o.barycenter)return-1;else if(t.barycenter>o.barycenter)return 1;return!r?t.i-o.i:o.i-t.i}}function Qr(r,t,o,i){var a=r.children(t),f=r.node(t),s=f?f.borderLeft:void 0,d=f?f.borderRight:void 0,c={};if(s)a=lt(a,function(w){return w!==s&&w!==d});var p=Mn(r,a);b(p,function(w){if(r.children(w.v).length){var y=Qr(r,w.v,o,i);if(c[w.v]=y,Object.prototype.hasOwnProperty.call(y,"barycenter"))Ls(w,y)}});var l=Bn(p,o);Os(l,c);var m=Fn(l,i);if(s){if(m.vs=S([s,m.vs,d]),r.predecessors(s).length){var h=r.node(r.predecessors(s)[0]),v=r.node(r.predecessors(d)[0]);if(!Object.prototype.hasOwnProperty.call(m,"barycenter"))m.barycenter=0,m.weight=0;m.barycenter=(m.barycenter*m.weight+h.order+v.order)/(m.weight+2),m.weight+=2}}return m}function Os(r,t){b(r,function(o){o.vs=S(o.vs.map(function(i){if(t[i])return t[i].vs;return i}))})}function Ls(r,t){if(!Re(r.barycenter))r.barycenter=(r.barycenter*r.weight+t.barycenter*t.weight)/(r.weight+t.weight),r.weight+=t.weight;else r.barycenter=t.barycenter,r.weight=t.weight}function Jn(r){var t=Br(r),o=Xn(r,P(1,t+1),"inEdges"),i=Xn(r,P(t-1,-1,-1),"outEdges"),a=Rn(r);zn(r,a);var f=Number.POSITIVE_INFINITY,s;for(var d=0,c=0;c<4;++d,++c){Is(d%2?o:i,d%4>=2),a=D(r);var p=An(r,a);if(p<f)c=0,s=tt(a),f=p}zn(r,s)}function Xn(r,t,o){return E(t,function(i){return Cn(r,i,o)})}function Is(r,t){var o=new ue;b(r,function(i){var a=i.graph().root,f=Qr(i,a,o,t);b(f.vs,function(s,d){i.node(s).order=d}),Tn(i,o,f.vs)})}function zn(r,t){b(t,function(o){b(o,function(i,a){r.node(i).order=a})})}function Zn(r){var t=Ns(r);b(r.graph().dummyChains,function(o){var i=r.node(o),a=i.edgeObj,f=Ss(r,t,a.v,a.w),{path:s,lca:d}=f,c=0,p=s[c],l=!0;while(o!==a.w){if(i=r.node(o),l){while((p=s[c])!==d&&r.node(p).maxRank<i.rank)c++;if(p===d)l=!1}if(!l){while(c<s.length-1&&r.node(p=s[c+1]).minRank<=i.rank)c++;p=s[c]}r.setParent(o,p),o=r.successors(o)[0]}})}function Ss(r,t,o,i){var a=[],f=[],s=Math.min(t[o].low,t[i].low),d=Math.max(t[o].lim,t[i].lim),c,p;c=o;do c=r.parent(c),a.push(c);while(c&&(t[c].low>s||d>t[c].lim));p=c,c=i;while((c=r.parent(c))!==p)f.push(c);return{path:a.concat(f.reverse()),lca:p}}function Ns(r){var t={},o=0;function i(a){var f=o;b(r.children(a),i),t[a]={low:f,lim:o++}}return b(r.children(),i),t}function Ps(r,t){var o={};function i(a,f){var s=0,d=0,c=a.length,p=X(f);return b(f,function(l,m){var h=Ts(r,l),v=h?r.node(h).order:c;if(h||l===p)b(f.slice(d,m+1),function(w){b(r.predecessors(w),function(y){var g=r.node(y),_=g.order;if((_<s||v<_)&&!(g.dummy&&r.node(w).dummy))$n(o,y,w)})}),d=m+1,s=v}),f}return ur(t,i),o}function ks(r,t){var o={};function i(f,s,d,c,p){var l;b(P(s,d),function(m){if(l=f[m],r.node(l).dummy)b(r.predecessors(l),function(h){var v=r.node(h);if(v.dummy&&(v.order<c||v.order>p))$n(o,h,l)})})}function a(f,s){var d=-1,c,p=0;return b(s,function(l,m){if(r.node(l).dummy==="border"){var h=r.predecessors(l);if(h.length)c=r.node(h[0]).order,i(s,p,m,d,c),p=m,d=c}i(s,p,s.length,c,f.length)}),s}return ur(t,a),o}function Ts(r,t){if(r.node(t).dummy)return tr(r.predecessors(t),function(o){return r.node(o).dummy})}function $n(r,t,o){if(t>o){var i=t;t=o,o=i}if(!Object.prototype.hasOwnProperty.call(r,t))Object.defineProperty(r,t,{enumerable:!0,configurable:!0,value:{},writable:!0});var a=r[t];Object.defineProperty(a,o,{enumerable:!0,configurable:!0,value:!0,writable:!0})}function Cs(r,t,o){if(t>o){var i=t;t=o,o=i}return!!r[t]&&Object.prototype.hasOwnProperty.call(r[t],o)}function As(r,t,o,i){var a={},f={},s={};return b(t,function(d){b(d,function(c,p){a[c]=c,f[c]=c,s[c]=p})}),b(t,function(d){var c=-1;b(d,function(p){var l=i(p);if(l.length){l=A(l,function(y){return s[y]});var m=(l.length-1)/2;for(var h=Math.floor(m),v=Math.ceil(m);h<=v;++h){var w=l[h];if(f[p]===p&&c<s[w]&&!Cs(o,p,w))f[w]=p,f[p]=a[p]=a[w],c=s[w]}}})}),{root:a,align:f}}function Rs(r,t,o,i,a){var f={},s=Ms(r,t,o,a),d=a?"borderLeft":"borderRight";function c(m,h){var v=s.nodes(),w=v.pop(),y={};while(w){if(y[w])m(w);else y[w]=!0,v.push(w),v=v.concat(h(w));w=v.pop()}}function p(m){f[m]=s.inEdges(m).reduce(function(h,v){return Math.max(h,f[v.v]+s.edge(v))},0)}function l(m){var h=s.outEdges(m).reduce(function(w,y){return Math.min(w,f[y.w]-s.edge(y))},Number.POSITIVE_INFINITY),v=r.node(m);if(h!==Number.POSITIVE_INFINITY&&v.borderType!==d)f[m]=Math.max(f[m],h)}return c(p,s.predecessors.bind(s)),c(l,s.successors.bind(s)),b(i,function(m){f[m]=f[o[m]]}),f}function Ms(r,t,o,i){var a=new ue,f=r.graph(),s=Fs(f.nodesep,f.edgesep,i);return b(t,function(d){var c;b(d,function(p){var l=o[p];if(a.setNode(l),c){var m=o[c],h=a.edge(m,l);a.setEdge(m,l,Math.max(s(r,p,c),h||0))}c=p})}),a}function js(r,t){return H(xt(t),function(o){var{NEGATIVE_INFINITY:i,POSITIVE_INFINITY:a}=Number;return gt(o,function(f,s){var d=Gs(r,s)/2;i=Math.max(f+d,i),a=Math.min(f-d,a)}),i-a})}function Bs(r,t){var o=xt(t),i=B(o),a=I(o);b(["u","d"],function(f){b(["l","r"],function(s){var d=f+s,c=r[d],p;if(c===t)return;var l=xt(c);if(p=s==="l"?i-B(l):a-I(l),p)r[d]=W(c,function(m){return m+p})})})}function Ds(r,t){return W(r.ul,function(o,i){if(t)return r[t.toLowerCase()][i];else{var a=A(E(r,i));return(a[1]+a[2])/2}})}function Qn(r){var t=D(r),o=nr(Ps(r,t),ks(r,t)),i={},a;b(["u","d"],function(s){a=s==="u"?t:xt(t).reverse(),b(["l","r"],function(d){if(d==="r")a=E(a,function(m){return xt(m).reverse()});var c=(s==="u"?r.predecessors:r.successors).bind(r),p=As(r,a,o,c),l=Rs(r,a,p.root,p.align,d==="r");if(d==="r")l=W(l,function(m){return-m});i[s+d]=l})});var f=js(r,i);return Bs(i,f),Ds(i,r.graph().align)}function Fs(r,t,o){return function(i,a,f){var s=i.node(a),d=i.node(f),c=0,p;if(c+=s.width/2,Object.prototype.hasOwnProperty.call(s,"labelpos"))switch(s.labelpos.toLowerCase()){case"l":p=-s.width/2;break;case"r":p=s.width/2;break}if(p)c+=o?p:-p;if(p=0,c+=(s.dummy?t:r)/2,c+=(d.dummy?t:r)/2,c+=d.width/2,Object.prototype.hasOwnProperty.call(d,"labelpos"))switch(d.labelpos.toLowerCase()){case"l":p=d.width/2;break;case"r":p=-d.width/2;break}if(p)c+=o?p:-p;return p=0,c}}function Gs(r,t){return r.node(t).width}function ro(r){r=Or(r),Xs(r),bt(Qn(r),function(t,o){r.node(o).x=t})}function Xs(r){var t=D(r),o=r.graph().ranksep,i=0;b(t,function(a){var f=I(E(a,function(s){return r.node(s).height}));b(a,function(s){r.node(s).y=i+f/2}),i+=f+o})}function ne(r,t){var o=t&&t.debugTiming?fn:sn;o("layout",()=>{var i=o(" buildLayoutGraph",()=>$s(r));o(" runLayout",()=>Us(i,o)),o(" updateInputGraph",()=>Vs(r,i))})}function Us(r,t){t(" makeSpaceForEdgeLabels",()=>Qs(r)),t(" removeSelfEdges",()=>su(r)),t(" acyclic",()=>Qt(r)),t(" nestingGraph.run",()=>Nn(r)),t(" rank",()=>Zr(Or(r))),t(" injectEdgeLabelProxies",()=>ru(r)),t(" removeEmptyRanks",()=>on(r)),t(" nestingGraph.cleanup",()=>kn(r)),t(" normalizeRanks",()=>nn(r)),t(" assignRankMinMax",()=>eu(r)),t(" removeEdgeLabelProxies",()=>tu(r)),t(" normalize.run",()=>gn(r)),t(" parentDummyChains",()=>Zn(r)),t(" addBorderSegments",()=>cn(r)),t(" order",()=>Jn(r)),t(" insertSelfEdges",()=>uu(r)),t(" adjustCoordinateSystem",()=>ln(r)),t(" position",()=>ro(r)),t(" positionSelfEdges",()=>du(r)),t(" removeBorderNodes",()=>fu(r)),t(" normalize.undo",()=>vn(r)),t(" fixupEdgeLabelCoords",()=>iu(r)),t(" undoCoordinateSystem",()=>mn(r)),t(" translateGraph",()=>nu(r)),t(" assignNodeIntersects",()=>ou(r)),t(" reversePoints",()=>au(r)),t(" acyclic.undo",()=>rn(r))}function Vs(r,t){b(r.nodes(),function(o){var i=r.node(o),a=t.node(o);if(i){if(i.x=a.x,i.y=a.y,t.children(o).length)i.width=a.width,i.height=a.height}}),b(r.edges(),function(o){var i=r.edge(o),a=t.edge(o);if(i.points=a.points,Object.prototype.hasOwnProperty.call(a,"x"))i.x=a.x,i.y=a.y}),r.graph().width=t.graph().width,r.graph().height=t.graph().height}var Ys=["nodesep","edgesep","ranksep","marginx","marginy"],zs={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},Ws=["acyclicer","ranker","rankdir","align"],qs=["width","height"],Hs={width:0,height:0},Ks=["minlen","weight","width","height","labeloffset"],Js={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},Zs=["labelpos"];function $s(r){var t=new ue({multigraph:!0,compound:!0}),o=ee(r.graph());return t.setGraph(nr({},zs,re(o,Ys),K(o,Ws))),b(r.nodes(),function(i){var a=ee(r.node(i));t.setNode(i,it(re(a,qs),Hs)),t.setParent(i,r.parent(i))}),b(r.edges(),function(i){var a=ee(r.edge(i));t.setEdge(i,nr({},Js,re(a,Ks),K(a,Zs)))}),t}function Qs(r){var t=r.graph();t.ranksep/=2,b(r.edges(),function(o){var i=r.edge(o);if(i.minlen*=2,i.labelpos.toLowerCase()!=="c")if(t.rankdir==="TB"||t.rankdir==="BT")i.width+=i.labeloffset;else i.height+=i.labeloffset})}function ru(r){b(r.edges(),function(t){var o=r.edge(t);if(o.width&&o.height){var i=r.node(t.v),a=r.node(t.w),f={rank:(a.rank-i.rank)/2+i.rank,e:t};T(r,"edge-proxy",f,"_ep")}})}function eu(r){var t=0;b(r.nodes(),function(o){var i=r.node(o);if(i.borderTop)i.minRank=r.node(i.borderTop).rank,i.maxRank=r.node(i.borderBottom).rank,t=I(t,i.maxRank)}),r.graph().maxRank=t}function tu(r){b(r.nodes(),function(t){var o=r.node(t);if(o.dummy==="edge-proxy")r.edge(o.e).labelRank=o.rank,r.removeNode(t)})}function nu(r){var t=Number.POSITIVE_INFINITY,o=0,i=Number.POSITIVE_INFINITY,a=0,f=r.graph(),s=f.marginx||0,d=f.marginy||0;function c(p){var{x:l,y:m,width:h,height:v}=p;t=Math.min(t,l-h/2),o=Math.max(o,l+h/2),i=Math.min(i,m-v/2),a=Math.max(a,m+v/2)}b(r.nodes(),function(p){c(r.node(p))}),b(r.edges(),function(p){var l=r.edge(p);if(Object.prototype.hasOwnProperty.call(l,"x"))c(l)}),t-=s,i-=d,b(r.nodes(),function(p){var l=r.node(p);l.x-=t,l.y-=i}),b(r.edges(),function(p){var l=r.edge(p);if(b(l.points,function(m){m.x-=t,m.y-=i}),Object.prototype.hasOwnProperty.call(l,"x"))l.x-=t;if(Object.prototype.hasOwnProperty.call(l,"y"))l.y-=i}),f.width=o-t+s,f.height=a-i+d}function ou(r){b(r.edges(),function(t){var o=r.edge(t),i=r.node(t.v),a=r.node(t.w),f,s;if(!o.points)o.points=[],f=a,s=i;else f=o.points[0],s=o.points[o.points.length-1];o.points.unshift(Rr(i,f)),o.points.push(Rr(a,s))})}function iu(r){b(r.edges(),function(t){var o=r.edge(t);if(Object.prototype.hasOwnProperty.call(o,"x")){if(o.labelpos==="l"||o.labelpos==="r")o.width-=o.labeloffset;switch(o.labelpos){case"l":o.x-=o.width/2+o.labeloffset;break;case"r":o.x+=o.width/2+o.labeloffset;break}}})}function au(r){b(r.edges(),function(t){var o=r.edge(t);if(o.reversed)o.points.reverse()})}function fu(r){b(r.nodes(),function(t){if(r.children(t).length){var o=r.node(t),i=r.node(o.borderTop),a=r.node(o.borderBottom),f=r.node(X(o.borderLeft)),s=r.node(X(o.borderRight));o.width=Math.abs(s.x-f.x),o.height=Math.abs(a.y-i.y),o.x=f.x+o.width/2,o.y=i.y+o.height/2}}),b(r.nodes(),function(t){if(r.node(t).dummy==="border")r.removeNode(t)})}function su(r){b(r.edges(),function(t){if(t.v===t.w){var o=r.node(t.v);if(!o.selfEdges)o.selfEdges=[];o.selfEdges.push({e:t,label:r.edge(t)}),r.removeEdge(t)}})}function uu(r){var t=D(r);b(t,function(o){var i=0;b(o,function(a,f){var s=r.node(a);s.order=f+i,b(s.selfEdges,function(d){T(r,"selfedge",{width:d.label.width,height:d.label.height,rank:s.rank,order:f+ ++i,e:d.e,label:d.label},"_se")}),delete s.selfEdges})})}function du(r){b(r.nodes(),function(t){var o=r.node(t);if(o.dummy==="selfedge"){var i=r.node(o.e.v),a=i.x+i.width/2,f=i.y,s=o.x-a,d=i.height/2;r.setEdge(o.e,o.label),r.removeNode(t),o.label.points=[{x:a+2*s/3,y:f-d},{x:a+5*s/6,y:f-d},{x:a+s,y:f},{x:a+5*s/6,y:f+d},{x:a+2*s/3,y:f+d}],o.label.x=o.x,o.label.y=o.y}})}function re(r,t){return W(K(r,t),Number)}function ee(r){var t={};return b(r,function(o,i){t[i.toLowerCase()]=o}),t}var eo=e((r,t,o)=>Math.max(t,Math.min(o,r)),"clamp"),to=e((r="TB")=>{switch(r){case"BT":return"bottom";case"LR":return"right";case"RL":return"left";case"TB":default:return"top"}},"getDefaultSelfLoopSide"),cu=e((r)=>r==="flowchart"||r==="flowchart-v2"||r==="stateDiagram"||r==="er"||r==="classDiagram","shouldMergeSelfLoopSegments"),pu=["x","y","width","height","labelBBox","intersect","calcIntersect","diff","clusterNode"],lu=e((r,t,o,i,a)=>{let f=[],s=new Set;if(o.forEach(({start:l,end:m})=>{if(l!==i)s.add(l);if(m!==i)s.add(m)}),s.forEach((l)=>{let m=r.node(l);if(typeof m?.x==="number"&&typeof m?.y==="number")f.push(m)}),f.length===0)o.forEach(({edge:l})=>{(l.points??[]).forEach((m)=>{if(typeof m?.x==="number"&&typeof m?.y==="number")f.push(m)})});if(f.length===0)return to(a);let d=f.reduce((l,m)=>({x:l.x+m.x/f.length,y:l.y+m.y/f.length}),{x:0,y:0}),c=d.x-t.x,p=d.y-t.y;if(Math.abs(c)>Math.abs(p))return c>0?"right":"left";if(Math.abs(p)>0)return p>0?"bottom":"top";return to(a)},"getSelfLoopSide"),mu=e((r,t="top",o=0,i=0)=>{let a=r.x,f=r.y-o,s=r.width/2,d=r.height/2,c=Math.max(36,Math.min(100,r.width*0.8)),p=eo(Math.max(i,r.width*0.35),36,c),l=eo(Math.min(r.width,r.height)*0.45,24,48);switch(t){case"bottom":{let m=f+d;return[{x:a-p/2,y:m},{x:a-p/2,y:m+l},{x:a+p/2,y:m+l},{x:a+p/2,y:m}]}case"right":{let m=a+s;return[{x:m,y:f-p/2},{x:m+l,y:f-p/2},{x:m+l,y:f+p/2},{x:m,y:f+p/2}]}case"left":{let m=a-s;return[{x:m,y:f-p/2},{x:m-l,y:f-p/2},{x:m-l,y:f+p/2},{x:m,y:f+p/2}]}case"top":default:{let m=f-d;return[{x:a-p/2,y:m},{x:a-p/2,y:m-l},{x:a+p/2,y:m-l},{x:a+p/2,y:m}]}}},"getSelfLoopPoints"),hu=e((r,t,o="top",i=0,a={})=>{let s=r.x,d=r.y-i,c=a.width??0,p=a.height??0;switch(o){case"bottom":return{x:s,y:Math.max(...t.map((l)=>l.y))+p/2+4};case"right":return{x:Math.max(...t.map((l)=>l.x))+c/2+4,y:d};case"left":return{x:Math.min(...t.map((l)=>l.x))-c/2-4,y:d};case"top":default:return{x:s,y:Math.min(...t.map((l)=>l.y))-p/2-4}}},"getSelfLoopLabelPosition"),oo=e((r,t=0,{mergeSelfLoops:o=!0}={})=>{let i=new Map,a=[],f=r.graph()?.rankdir;return r.edges().forEach((s)=>{let d=r.edge(s);if(o&&d.selfLoop){let c=d.selfLoop.id;if(!i.has(c))i.set(c,[]);i.get(c).push({edge:d,start:s.v,end:s.w})}else a.push({edge:d,start:s.v,end:s.w})}),i.forEach((s)=>{if(s.length!==3){s.forEach((_)=>a.push(_));return}s.sort((_,R)=>_.edge.selfLoop.order-R.edge.selfLoop.order);let[d,c,p]=s,l=d.edge.originalEdge??c.edge.originalEdge??p.edge.originalEdge??c.edge,m=r.node(l.start);if(!m){s.forEach((_)=>a.push(_));return}let h={width:c.edge.width,height:c.edge.height},v=lu(r,m,s,l.start,f),w=mu(m,v,t,h.width??0),y=hu(m,w,v,t,h),g={...c.edge,...l,id:l.id,points:w,start:l.start,end:l.end,x:y.x,y:y.y,width:h.width,height:h.height,labelStyle:c.edge.labelStyle,fromCluster:d.edge.fromCluster??c.edge.fromCluster??p.edge.fromCluster,toCluster:d.edge.toCluster??c.edge.toCluster??p.edge.toCluster};delete g.selfLoop,delete g.originalEdge,a.push({edge:g,start:g.start,end:g.end})}),a},"getEdgesToRender"),io=e(async({element:r,graph:t,diagramType:o,id:i,parentCluster:a,siteConfig:f})=>{let s=t.graph().rankdir;n.trace("Dir in recursive render - dir:",s);let{clusters:d,edgePaths:c,edgeLabels:p,nodes:l,rootGroups:m}=Ri(r,{edgePathsClass:"edgePaths"});if(!t.nodes())n.info("No nodes found for",t);else n.info("Recursive render XXX",t.nodes());if(t.edges().length>0)n.info("Recursive edges",t.edge(t.edges()[0]));let h=cu(o);await Promise.all(t.nodes().map(async function(y){let g=t.node(y);if(a!==void 0){let _=JSON.parse(JSON.stringify(a.clusterData));if(n.trace(`Setting data for parent cluster XXX
2
2
  Node.id = `,y,`
3
3
  data=`,_.height,`
4
4
  Parent cluster`,a.height),t.setNode(a.id,_),!t.parent(y))n.trace("Setting parent",y,a.id),t.setParent(y,a.id,_)}if(n.info("(Insert) Node XXX"+y+": "+JSON.stringify(t.node(y))),g?.clusterNode){n.info("Cluster identified XBX",y,g.width,t.node(y));let{ranksep:_,nodesep:R}=t.graph();g.graph.setGraph({...g.graph.graph(),ranksep:_+25,nodesep:R});let oe=await wu({element:l,graph:g.graph,diagramType:o,id:i,parentCluster:t.node(y),siteConfig:f}),ie=oe.elem;N(g,ie),g.diff=oe.diff||0,n.info("New compound node after recursive render XAX",y,"width",g.width,"height",g.height),wl(ie,g)}else if(t.children(y).length>0)n.trace("Cluster - the non recursive path XBX",y,g.id,g,g.width,"Graph:",t),n.trace(dn(g.id,t)),Q.set(g.id,{id:dn(g.id,t),node:g});else n.trace("Node - the non recursive path XAX",y,l,t.node(y),s),await Mi(l,t.node(y),{config:f,dir:s})})),await e(async()=>{let y=t.edges().map(async function(g){let _=t.edge(g.v,g.w,g.name);if(n.info("Edge "+g.v+" -> "+g.w+": "+JSON.stringify(g)),n.info("Edge "+g.v+" -> "+g.w+": ",g," ",JSON.stringify(t.edge(g))),n.info("Fix",Q,"ids:",g.v,g.w,"Translating: ",Q.get(g.v),Q.get(g.w)),h&&_.selfLoop){if(_.selfLoop.order!==1)return;let R={..._.originalEdge,..._,id:_.selfLoop.id,startLabelLeft:_.originalEdge?.startLabelLeft??_.startLabelLeft,startLabelRight:_.originalEdge?.startLabelRight??_.startLabelRight,endLabelLeft:_.originalEdge?.endLabelLeft??_.endLabelLeft,endLabelRight:_.originalEdge?.endLabelRight??_.endLabelRight};await $t(p,R),_.width=R.width,_.height=R.height,_.labelStyle=R.labelStyle;return}await $t(p,_)});await Promise.all(y)},"processEdges")();let{subGraphTitleTotalMargin:w}=Bt(f);return{elem:m,graph:t,groups:{clusters:d,edgePaths:c,edgeLabels:p,nodes:l,rootGroups:m},diagramType:o,id:i,mergeSelfLoops:h,subGraphTitleTotalMargin:w}},"measureDagreGraph"),ao=e((r)=>{n.info("############################################# XXX"),n.info("### Layout ### XXX"),n.info("############################################# XXX"),ne(r)},"runDagreGraphLayout"),gu=e((r,t,o)=>{let i=r.node(t);if(!i)return;let a={...i};if(i?.clusterNode)a.y=(i.y??0)+o;else if(r.children(t).length>0)a.height=(i.height??0)+o;else a.y=(i.y??0)+o/2;return a},"normalizeDagreNode"),no=e((r,t)=>{pu.forEach((o)=>{if(t[o]!==void 0)r[o]=t[o]})},"applyDagreNodeLayout"),vu=e((r,t,o,i)=>({...r,start:r.start??t,end:r.end??o,points:(r.points??[]).map((a)=>({...a,y:typeof a.y==="number"?a.y+i:a.y}))}),"normalizeDagreEdge"),bu=e((r,t)=>{let{graph:o,mergeSelfLoops:i,subGraphTitleTotalMargin:a=0}=t,f=new Map(r.nodes.map((d)=>[d.id,d]));Ni(o).forEach((d)=>{let c=gu(o,d,a);if(!c)return;no(o.node(d),c);let p=f.get(d);if(p)no(p,c)});let s=a/2;return r.edges=oo(o,s,{mergeSelfLoops:i}).map(({edge:d,start:c,end:p})=>vu(d,c,p,s)),r},"applyDagreLayoutResult"),yu=e(async({elem:r,graph:t,groups:{clusters:o,edgePaths:i},diagramType:a,id:f,mergeSelfLoops:s,subGraphTitleTotalMargin:d})=>{let c=0;await Promise.all(Ni(t).map(async function(m){let h=t.node(m);if(n.info("Position XBX => "+m+": ("+h.x,","+h.y,") width: ",h.width," height: ",h.height),h?.clusterNode)h.y+=d,n.info("A tainted cluster node XBX1",m,h.id,h.width,h.height,h.x,h.y,t.parent(m)),Q.get(h.id).node=h,St(h);else if(t.children(m).length>0){n.info("A pure cluster node XBX1",m,h.id,h.x,h.y,h.width,h.height,t.parent(m)),h.height+=d,t.node(h.parentId);let v=h?.padding/2||0,w=h?.labelBBox?.height||0,y=w-v||0;n.debug("OffsetY",y,"labelHeight",w,"halfPadding",v),await gr(o,h),Q.get(h.id).node=h}else{let v=t.node(h.parentId);h.y+=d/2,n.info("A regular node XBX1 - using the padding",h.id,"parent",h.parentId,h.width,h.height,h.x,h.y,"offsetY",h.offsetY,"parent",v,v?.offsetY,h),St(h)}}));let p=d/2;return oo(t,p,{mergeSelfLoops:s}).forEach(function({edge:m,start:h,end:v}){n.info("Edge "+h+" -> "+v+": "+JSON.stringify(m),m),m.points.forEach((_)=>_.y+=p);let w=t.node(h),y=t.node(v),g=br(i,m,Q,a,w,y,f);yn(m,g)}),t.nodes().forEach(function(m){let h=t.node(m);if(n.info(m,h.type,h.diff),h.isGroup)c=h.diff}),n.warn("Returning from recursive render XAX",r,c),{elem:r,diff:c}},"paintDagreLayoutCore"),wu=e(async(r)=>{let t=await io(r);return ao(t.graph),await yu(t)},"renderDagreSubgraph"),fo=e((r)=>{let t=new ue({multigraph:!0,compound:!0}).setGraph({rankdir:r.direction,nodesep:r.config?.nodeSpacing||r.nodeSpacing||r.config?.flowchart?.nodeSpacing,ranksep:r.config?.rankSpacing||r.rankSpacing||r.config?.flowchart?.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});return r.nodes.forEach((o)=>{if(t.setNode(o.id,{...o}),o.parentId)t.setParent(o.id,o.parentId)}),n.debug("Edges:",r.edges),r.edges.forEach((o)=>{if(o.start===o.end){let i=o.start,a=i+"---"+i+"---1",f=i+"---"+i+"---2",s=t.node(i);t.setNode(a,{domId:a,id:a,parentId:s.parentId,labelStyle:"",label:"",padding:0,shape:"labelRect",style:"",width:10,height:10}),t.setParent(a,s.parentId),t.setNode(f,{domId:f,id:f,parentId:s.parentId,labelStyle:"",padding:0,shape:"labelRect",label:"",style:"",width:10,height:10}),t.setParent(f,s.parentId);let d=structuredClone(o),c=structuredClone(o),p=structuredClone(o),l=structuredClone(o);if(c.originalEdge=d,c.selfLoop={id:d.id,order:0},p.originalEdge=d,p.selfLoop={id:d.id,order:1},l.originalEdge=d,l.selfLoop={id:d.id,order:2},c.label="",c.arrowTypeEnd="none",c.endLabelLeft="",c.endLabelRight="",c.startLabelLeft="",c.id=i+"-cyclic-special-1",p.startLabelRight="",p.startLabelLeft="",p.endLabelLeft="",p.endLabelRight="",p.arrowTypeStart="none",p.arrowTypeEnd="none",p.id=i+"-cyclic-special-mid",l.label="",l.startLabelRight="",l.startLabelLeft="",l.arrowTypeStart="none",s.isGroup)c.fromCluster=i,l.toCluster=i;l.id=i+"-cyclic-special-2",l.arrowTypeStart="none",t.setEdge(i,a,c,i+"-cyclic-special-0"),t.setEdge(a,f,p,i+"-cyclic-special-1"),t.setEdge(f,i,l,i+"-cyclic-special-2")}else t.setEdge(o.start,o.end,{...o},o.id)}),cl(t),{graph:t}},"prepareLayoutForDagre"),_u=e(async(r,{element:t,preparedLayout:o})=>{let i=o??fo(r),a=u(),f=await io({element:t,graph:i.graph,diagramType:r.type,id:r.diagramId,parentCluster:void 0,siteConfig:a});return i.measuredLayout=f,f},"measureDagreLayout"),Eu=e((r,t)=>{let o=t.preparedLayout?.measuredLayout;if(!o)throw Error("runDagreLayoutCore requires measureDagreLayout to run first");return ao(o.graph),bu(r,o),o},"runDagreLayoutCore"),xu=e((r,{measure:t})=>Ni(t.graph).map((o)=>t.graph.node(o)).filter(Boolean),"getDagrePaintNodes"),Ou=e((r,t,{measure:o})=>r?o.graph.node(r):void 0,"getDagreEdgeNode"),Kg=ot({prepareLayout:fo,measureLayout:_u,runLayoutCore:Eu,paintOptions:{clusterDb:Q,getNodes:xu,getEdgeNode:Ou,skipNode:e((r,{measure:t})=>!t.graph.hasNode(r.id),"skipNode"),isCluster:e((r,{measure:t})=>t.graph.hasNode(r.id)&&(t.graph.children(r.id)??[]).length>0,"isCluster")}});export{bu as applyDagreLayoutResult,oo as getEdgesToRender,_u as measureDagreLayout,fo as prepareLayoutForDagre,Kg as render,Eu as runDagreLayoutCore,cu as shouldMergeSelfLoopSegments};
@@ -1,4 +1,4 @@
1
- import{ee}from"./index.yf0h5qnv.js";import{e,n,Me,F,k,j,A,L,I,R,M,O,D,Y,K}from"./index.fgsp5qqn.js";import{se}from"./index.9zhger75.js";var h={showLegend:!0,ticks:5,max:null,min:0,graticule:"circle"},C=32,b={axes:[],curves:[],options:h},x=structuredClone(b),B=F.radar,W=e(()=>K({...B,...k().radar}),"getConfig"),T=e(()=>x.axes,"getAxes"),V=e(()=>x.curves,"getCurves"),H=e(()=>x.options,"getOptions"),U=e((r)=>{x.axes=r.map((t)=>({name:t.name,label:t.label??t.name}))},"setAxes"),X=e((r)=>{x.curves=r.map((t)=>({name:t.name,label:t.label??t.name,entries:N(t.entries)}))},"setCurves"),N=e((r)=>{if(r[0].axis==null)return r.map((a)=>a.value);let t=T();if(t.length===0)throw Error("Axes must be populated before curves for reference entries");return t.map((a)=>{let s=r.find((o)=>o.axis?.$refText===a.name);if(s===void 0)throw Error("Missing entry for axis "+a.label);return s.value})},"computeCurveEntries"),Z=e((r)=>{let t=r.reduce((a,s)=>(a[s.name]=s,a),{});if(x.options={showLegend:t.showLegend?.value??h.showLegend,ticks:t.ticks?.value??h.ticks,max:t.max?.value??h.max,min:t.min?.value??h.min,graticule:t.graticule?.value??h.graticule},x.options.ticks>C)n.warn(`Radar diagram ticks (${x.options.ticks}) exceeds maximum allowed (${C}). Using ${C} instead.`),x.options.ticks=C},"setOptions"),q=e(()=>{A(),x=structuredClone(b)},"clear"),y={getAxes:T,getCurves:V,getOptions:H,setAxes:U,setCurves:X,setOptions:Z,getConfig:W,clear:q,setAccTitle:L,getAccTitle:I,setDiagramTitle:O,getDiagramTitle:D,getAccDescription:M,setAccDescription:R},J=e((r)=>{ee(r,y);let{axes:t,curves:a,options:s}=r;y.setAxes(t),y.setCurves(a),y.setOptions(s)},"populate"),Q={parse:e(async(r)=>{let t=await se("radar",r);n.debug(t),J(t)},"parse")},tt=e((r,t,a,s)=>{let o=s.db,c=o.getAxes(),d=o.getCurves(),i=o.getOptions(),l=o.getConfig(),u=o.getDiagramTitle(),m=Y(t),p=et(m,l),g=i.max??Math.max(...d.map((w)=>Math.max(...w.entries))),v=i.min,f=Math.min(l.width,l.height)/2;at(p,c,f,i.ticks,i.graticule),rt(p,c,f,l),S(p,c,d,v,g,i.graticule,l),P(p,d,i.showLegend,l),p.append("text").attr("class","radarTitle").text(u).attr("x",0).attr("y",-l.height/2-l.marginTop)},"draw"),et=e((r,t)=>{let a=t.width+t.marginLeft+t.marginRight,s=t.height+t.marginTop+t.marginBottom,o={x:t.marginLeft+t.width/2,y:t.marginTop+t.height/2};return j(r,s,a,t.useMaxWidth??!0),r.attr("viewBox",`0 0 ${a} ${s}`).attr("overflow","visible"),r.append("g").attr("transform",`translate(${o.x}, ${o.y})`)},"drawFrame"),at=e((r,t,a,s,o)=>{if(o==="circle")for(let c=0;c<s;c++){let d=a*(c+1)/s;r.append("circle").attr("r",d).attr("class","radarGraticule")}else if(o==="polygon"){let c=t.length;for(let d=0;d<s;d++){let i=a*(d+1)/s,l=t.map((u,m)=>{let p=2*m*Math.PI/c-Math.PI/2,g=i*Math.cos(p),v=i*Math.sin(p);return`${g},${v}`}).join(" ");r.append("polygon").attr("points",l).attr("class","radarGraticule")}}},"drawGraticule"),rt=e((r,t,a,s)=>{let o=t.length;for(let c=0;c<o;c++){let d=t[c].label,i=2*c*Math.PI/o-Math.PI/2,l=Math.cos(i),u=Math.sin(i);r.append("line").attr("x1",0).attr("y1",0).attr("x2",a*s.axisScaleFactor*l).attr("y2",a*s.axisScaleFactor*u).attr("class","radarAxisLine");let m=l>0.01?"start":l<-0.01?"end":"middle",p=u>0.01?"hanging":u<-0.01?"auto":"central",g=4;r.append("text").text(d).attr("x",a*s.axisLabelFactor*l+g*l).attr("y",a*s.axisLabelFactor*u+g*u).attr("text-anchor",m).attr("dominant-baseline",p).attr("class","radarAxisLabel")}},"drawAxes");function S(r,t,a,s,o,c,d){let i=t.length,l=Math.min(d.width,d.height)/2;a.forEach((u,m)=>{if(u.entries.length!==i)return;let p=u.entries.map((g,v)=>{let f=2*Math.PI*v/i-Math.PI/2,w=_(g,s,o,l),z=w*Math.cos(f),G=w*Math.sin(f);return{x:z,y:G}});if(c==="circle")r.append("path").attr("d",E(p,d.curveTension)).attr("class",`radarCurve-${m}`);else if(c==="polygon")r.append("polygon").attr("points",p.map((g)=>`${g.x},${g.y}`).join(" ")).attr("class",`radarCurve-${m}`)})}e(S,"drawCurves");function _(r,t,a,s){let o=Math.min(Math.max(r,t),a);return s*(o-t)/(a-t)}e(_,"relativeRadius");function E(r,t){let a=r.length,s=`M${r[0].x},${r[0].y}`;for(let o=0;o<a;o++){let c=r[(o-1+a)%a],d=r[o],i=r[(o+1)%a],l=r[(o+2)%a],u={x:d.x+(i.x-c.x)*t,y:d.y+(i.y-c.y)*t},m={x:i.x-(l.x-d.x)*t,y:i.y-(l.y-d.y)*t};s+=` C${u.x},${u.y} ${m.x},${m.y} ${i.x},${i.y}`}return`${s} Z`}e(E,"closedRoundCurve");function P(r,t,a,s){if(!a)return;let o=(s.width/2+s.marginRight)*3/4,c=-(s.height/2+s.marginTop)*3/4,d=20;t.forEach((i,l)=>{let u=r.append("g").attr("transform",`translate(${o}, ${c+l*d})`);u.append("rect").attr("width",12).attr("height",12).attr("class",`radarLegendBox-${l}`),u.append("text").attr("x",16).attr("y",0).attr("class","radarLegendText").text(i.label)})}e(P,"drawLegend");var nt={draw:tt},st=e((r,t)=>{let a="";for(let s=0;s<r.THEME_COLOR_LIMIT;s++){let o=r[`cScale${s}`];a+=`
1
+ import{ee}from"./index.r0p3fm9f.js";import{e,n,Me,F,k,j,A,L,R,I,M,D,O,Y,K}from"./index.a1bxkgd3.js";import{se}from"./index.7gxz6d1f.js";var h={showLegend:!0,ticks:5,max:null,min:0,graticule:"circle"},C=32,b={axes:[],curves:[],options:h},x=structuredClone(b),B=F.radar,W=e(()=>K({...B,...k().radar}),"getConfig"),T=e(()=>x.axes,"getAxes"),V=e(()=>x.curves,"getCurves"),H=e(()=>x.options,"getOptions"),U=e((r)=>{x.axes=r.map((t)=>({name:t.name,label:t.label??t.name}))},"setAxes"),X=e((r)=>{x.curves=r.map((t)=>({name:t.name,label:t.label??t.name,entries:N(t.entries)}))},"setCurves"),N=e((r)=>{if(r[0].axis==null)return r.map((a)=>a.value);let t=T();if(t.length===0)throw Error("Axes must be populated before curves for reference entries");return t.map((a)=>{let s=r.find((o)=>o.axis?.$refText===a.name);if(s===void 0)throw Error("Missing entry for axis "+a.label);return s.value})},"computeCurveEntries"),Z=e((r)=>{let t=r.reduce((a,s)=>(a[s.name]=s,a),{});if(x.options={showLegend:t.showLegend?.value??h.showLegend,ticks:t.ticks?.value??h.ticks,max:t.max?.value??h.max,min:t.min?.value??h.min,graticule:t.graticule?.value??h.graticule},x.options.ticks>C)n.warn(`Radar diagram ticks (${x.options.ticks}) exceeds maximum allowed (${C}). Using ${C} instead.`),x.options.ticks=C},"setOptions"),q=e(()=>{A(),x=structuredClone(b)},"clear"),y={getAxes:T,getCurves:V,getOptions:H,setAxes:U,setCurves:X,setOptions:Z,getConfig:W,clear:q,setAccTitle:L,getAccTitle:R,setDiagramTitle:D,getDiagramTitle:O,getAccDescription:M,setAccDescription:I},J=e((r)=>{ee(r,y);let{axes:t,curves:a,options:s}=r;y.setAxes(t),y.setCurves(a),y.setOptions(s)},"populate"),Q={parse:e(async(r)=>{let t=await se("radar",r);n.debug(t),J(t)},"parse")},tt=e((r,t,a,s)=>{let o=s.db,c=o.getAxes(),d=o.getCurves(),i=o.getOptions(),l=o.getConfig(),u=o.getDiagramTitle(),m=Y(t),p=et(m,l),g=i.max??Math.max(...d.map((w)=>Math.max(...w.entries))),v=i.min,f=Math.min(l.width,l.height)/2;at(p,c,f,i.ticks,i.graticule),rt(p,c,f,l),S(p,c,d,v,g,i.graticule,l),P(p,d,i.showLegend,l),p.append("text").attr("class","radarTitle").text(u).attr("x",0).attr("y",-l.height/2-l.marginTop)},"draw"),et=e((r,t)=>{let a=t.width+t.marginLeft+t.marginRight,s=t.height+t.marginTop+t.marginBottom,o={x:t.marginLeft+t.width/2,y:t.marginTop+t.height/2};return j(r,s,a,t.useMaxWidth??!0),r.attr("viewBox",`0 0 ${a} ${s}`).attr("overflow","visible"),r.append("g").attr("transform",`translate(${o.x}, ${o.y})`)},"drawFrame"),at=e((r,t,a,s,o)=>{if(o==="circle")for(let c=0;c<s;c++){let d=a*(c+1)/s;r.append("circle").attr("r",d).attr("class","radarGraticule")}else if(o==="polygon"){let c=t.length;for(let d=0;d<s;d++){let i=a*(d+1)/s,l=t.map((u,m)=>{let p=2*m*Math.PI/c-Math.PI/2,g=i*Math.cos(p),v=i*Math.sin(p);return`${g},${v}`}).join(" ");r.append("polygon").attr("points",l).attr("class","radarGraticule")}}},"drawGraticule"),rt=e((r,t,a,s)=>{let o=t.length;for(let c=0;c<o;c++){let d=t[c].label,i=2*c*Math.PI/o-Math.PI/2,l=Math.cos(i),u=Math.sin(i);r.append("line").attr("x1",0).attr("y1",0).attr("x2",a*s.axisScaleFactor*l).attr("y2",a*s.axisScaleFactor*u).attr("class","radarAxisLine");let m=l>0.01?"start":l<-0.01?"end":"middle",p=u>0.01?"hanging":u<-0.01?"auto":"central",g=4;r.append("text").text(d).attr("x",a*s.axisLabelFactor*l+g*l).attr("y",a*s.axisLabelFactor*u+g*u).attr("text-anchor",m).attr("dominant-baseline",p).attr("class","radarAxisLabel")}},"drawAxes");function S(r,t,a,s,o,c,d){let i=t.length,l=Math.min(d.width,d.height)/2;a.forEach((u,m)=>{if(u.entries.length!==i)return;let p=u.entries.map((g,v)=>{let f=2*Math.PI*v/i-Math.PI/2,w=_(g,s,o,l),z=w*Math.cos(f),G=w*Math.sin(f);return{x:z,y:G}});if(c==="circle")r.append("path").attr("d",E(p,d.curveTension)).attr("class",`radarCurve-${m}`);else if(c==="polygon")r.append("polygon").attr("points",p.map((g)=>`${g.x},${g.y}`).join(" ")).attr("class",`radarCurve-${m}`)})}e(S,"drawCurves");function _(r,t,a,s){let o=Math.min(Math.max(r,t),a);return s*(o-t)/(a-t)}e(_,"relativeRadius");function E(r,t){let a=r.length,s=`M${r[0].x},${r[0].y}`;for(let o=0;o<a;o++){let c=r[(o-1+a)%a],d=r[o],i=r[(o+1)%a],l=r[(o+2)%a],u={x:d.x+(i.x-c.x)*t,y:d.y+(i.y-c.y)*t},m={x:i.x-(l.x-d.x)*t,y:i.y-(l.y-d.y)*t};s+=` C${u.x},${u.y} ${m.x},${m.y} ${i.x},${i.y}`}return`${s} Z`}e(E,"closedRoundCurve");function P(r,t,a,s){if(!a)return;let o=(s.width/2+s.marginRight)*3/4,c=-(s.height/2+s.marginTop)*3/4,d=20;t.forEach((i,l)=>{let u=r.append("g").attr("transform",`translate(${o}, ${c+l*d})`);u.append("rect").attr("width",12).attr("height",12).attr("class",`radarLegendBox-${l}`),u.append("text").attr("x",16).attr("y",0).attr("class","radarLegendText").text(i.label)})}e(P,"drawLegend");var nt={draw:tt},st=e((r,t)=>{let a="";for(let s=0;s<r.THEME_COLOR_LIMIT;s++){let o=r[`cScale${s}`];a+=`
2
2
  .radarCurve-${s} {
3
3
  color: ${o};
4
4
  fill: ${o};
@@ -1,6 +1,6 @@
1
- import{Xn}from"./index.153rcscj.js";import{e,n,be,gt,Pe,Rr,y,A,L,I,R,M,O,D,u,Pt,Kr,m,ut,dt,ve,he,pe,tt,z,We,aa,Ae,_e}from"./index.fgsp5qqn.js";import{Xt}from"./index.23p1k2rx.js";import{Xe}from"./index.eec12m3n.js";import{Ee}from"./index.gqa9s37g.js";import{ge}from"./index.h6120080.js";var vt={SHAPE_UNSUPPORTED:"SHAPE_UNSUPPORTED",SHAPE_REMOVED:"SHAPE_REMOVED",EDGE_OPERATOR_UNSUPPORTED:"EDGE_OPERATOR_UNSUPPORTED",REFERENCE_EDGE_LABEL_REJECTED:"REFERENCE_EDGE_LABEL_REJECTED",CONNECTOR_REF_UNRESOLVED:"CONNECTOR_REF_UNRESOLVED",CONNECTOR_REF_NOT_A_CONNECTOR:"CONNECTOR_REF_NOT_A_CONNECTOR",METADATA_KEY_MISAPPLIED:"METADATA_KEY_MISAPPLIED",DUPLICATE_ID_NODE:"DUPLICATE_ID_NODE",RESERVED_SYNTHETIC_ID:"RESERVED_SYNTHETIC_ID",CONTAINMENT_VIOLATION:"CONTAINMENT_VIOLATION",EDGE_SEMANTIC_CONTRADICTION:"EDGE_SEMANTIC_CONTRADICTION",FLOW_NO_INPUT:"FLOW_NO_INPUT"},U1=new Set([vt.SHAPE_UNSUPPORTED,vt.SHAPE_REMOVED,vt.CONTAINMENT_VIOLATION]),vs=new Set(Object.values(vt).filter((t)=>!U1.has(t))),j1=new Map([["task","roundedRect"],["tool","subroutine"],["input","lean-right"],["lean_right","lean-right"],["decision","diamond"],["refdoc","lin-doc"],["action","hexagon"],["round","rect"]]),z1=new Set(["doc","stadium","terminal","circle","trapezoid","inv_trapezoid","inv-trapezoid","doublecircle","double-circle","typeDeclaration","procs","lean_left","lean-left","in-out","cylinder","ellipse","odd","tag-rect","tagged-rectangle","delay","half-rounded-rectangle","lin-rect","lined-rectangle","win-pane","window-pane","curv-trap","curved-trapezoid"]),W1=new Set(["roundedRect","subroutine","subprocess","subproc","framed-rectangle","lean-right","diamond","lin-doc","lined-document","hexagon","hex","connector","collapsedGroup"]),Tt="roundedRect";function Dt(t){if(!t)return t;return j1.get(t)??t}e(Dt,"resolveShapeAlias");function _1(t,r){for(let a of t){if(a.isGroup)continue;if(!a.shape||a.shape==="squareRect"||a.shape==="rect")a.shape=Tt;if(z1.has(a.shape)){let o=`shape "${a.shape}" was removed in v0.8.1, using "${Tt}"`;if(r?.emitError)r.emitError("SHAPE_REMOVED",o,{nodeId:a.id});else n.warn(`agentflow: ${o}`);a.shape=Tt;continue}if(!W1.has(a.shape)){let o=`shape "${a.shape}" is not supported, using "${Tt}"`;if(r?.emitWarning)r.emitWarning("SHAPE_UNSUPPORTED",o,{nodeId:a.id});else n.warn(`agentflow: ${o}`);a.shape=Tt}}}e(_1,"normaliseNodeShapes");var i1=new Map([["tool",0],["task",1],["decision",2],["input",3],["refdoc",4],["connector",5],["action",6]]),F1=i1.size,V1=e((t)=>`af-kind-${t}`,"kindClass"),K1=[...i1.keys()],I1=e((t)=>Math.max(1,t-F1),"containerSlotCount"),L1=e((t,r)=>{let a=F1+t%I1(r);return r>0?a%r:a},"containerSlot");function B1(t,r,a){let o=u().themeVariables?.borderColorArray,d=Array.isArray(o)?o.length:0,h=a.size;for(let l of t??[]){if(l.isGroup||l.shape==="collapsedGroup"){let k=a.get(String(l.id))??h++;l.colorIndex=L1(k,d);continue}let p=r(String(l.id));if(p&&i1.has(p))l.cssClasses=`${l.cssClasses??""} ${V1(p)}`.replace(/\s+/g," ").trim()}}e(B1,"assignColorSlots");var v1="agentflow-",c1=new Set(["shape","view","icon","img","form","pos","w","h","class","style","labelType"]),H1=new Set(["subroutine","subprocess","subproc","framed-rectangle","tool"]),Y1={flow:"flowGroup"};function M1(t){let r=!1,a=!1,o=0,d,h=[];for(let l of t.split(`
1
+ import{Xn}from"./index.zm5x44tn.js";import{e,n,be,gt,Pe,Ir,y,A,L,R,I,M,D,O,u,Pt,Kr,m,ut,dt,ve,he,pe,tt,z,We,aa,Ae,_e}from"./index.a1bxkgd3.js";import{Xt}from"./index.0e4s8r4m.js";import{Xe}from"./index.dnnzjw18.js";import{Ee}from"./index.7k5v3p25.js";import{ge}from"./index.9bf5qrah.js";var vt={SHAPE_UNSUPPORTED:"SHAPE_UNSUPPORTED",SHAPE_REMOVED:"SHAPE_REMOVED",EDGE_OPERATOR_UNSUPPORTED:"EDGE_OPERATOR_UNSUPPORTED",REFERENCE_EDGE_LABEL_REJECTED:"REFERENCE_EDGE_LABEL_REJECTED",CONNECTOR_REF_UNRESOLVED:"CONNECTOR_REF_UNRESOLVED",CONNECTOR_REF_NOT_A_CONNECTOR:"CONNECTOR_REF_NOT_A_CONNECTOR",METADATA_KEY_MISAPPLIED:"METADATA_KEY_MISAPPLIED",DUPLICATE_ID_NODE:"DUPLICATE_ID_NODE",RESERVED_SYNTHETIC_ID:"RESERVED_SYNTHETIC_ID",CONTAINMENT_VIOLATION:"CONTAINMENT_VIOLATION",EDGE_SEMANTIC_CONTRADICTION:"EDGE_SEMANTIC_CONTRADICTION",FLOW_NO_INPUT:"FLOW_NO_INPUT"},U1=new Set([vt.SHAPE_UNSUPPORTED,vt.SHAPE_REMOVED,vt.CONTAINMENT_VIOLATION]),vs=new Set(Object.values(vt).filter((t)=>!U1.has(t))),j1=new Map([["task","roundedRect"],["tool","subroutine"],["input","lean-right"],["lean_right","lean-right"],["decision","diamond"],["refdoc","lin-doc"],["action","hexagon"],["round","rect"]]),z1=new Set(["doc","stadium","terminal","circle","trapezoid","inv_trapezoid","inv-trapezoid","doublecircle","double-circle","typeDeclaration","procs","lean_left","lean-left","in-out","cylinder","ellipse","odd","tag-rect","tagged-rectangle","delay","half-rounded-rectangle","lin-rect","lined-rectangle","win-pane","window-pane","curv-trap","curved-trapezoid"]),W1=new Set(["roundedRect","subroutine","subprocess","subproc","framed-rectangle","lean-right","diamond","lin-doc","lined-document","hexagon","hex","connector","collapsedGroup"]),Tt="roundedRect";function Dt(t){if(!t)return t;return j1.get(t)??t}e(Dt,"resolveShapeAlias");function _1(t,r){for(let a of t){if(a.isGroup)continue;if(!a.shape||a.shape==="squareRect"||a.shape==="rect")a.shape=Tt;if(z1.has(a.shape)){let o=`shape "${a.shape}" was removed in v0.8.1, using "${Tt}"`;if(r?.emitError)r.emitError("SHAPE_REMOVED",o,{nodeId:a.id});else n.warn(`agentflow: ${o}`);a.shape=Tt;continue}if(!W1.has(a.shape)){let o=`shape "${a.shape}" is not supported, using "${Tt}"`;if(r?.emitWarning)r.emitWarning("SHAPE_UNSUPPORTED",o,{nodeId:a.id});else n.warn(`agentflow: ${o}`);a.shape=Tt}}}e(_1,"normaliseNodeShapes");var i1=new Map([["tool",0],["task",1],["decision",2],["input",3],["refdoc",4],["connector",5],["action",6]]),F1=i1.size,V1=e((t)=>`af-kind-${t}`,"kindClass"),K1=[...i1.keys()],I1=e((t)=>Math.max(1,t-F1),"containerSlotCount"),L1=e((t,r)=>{let a=F1+t%I1(r);return r>0?a%r:a},"containerSlot");function B1(t,r,a){let o=u().themeVariables?.borderColorArray,d=Array.isArray(o)?o.length:0,h=a.size;for(let l of t??[]){if(l.isGroup||l.shape==="collapsedGroup"){let k=a.get(String(l.id))??h++;l.colorIndex=L1(k,d);continue}let p=r(String(l.id));if(p&&i1.has(p))l.cssClasses=`${l.cssClasses??""} ${V1(p)}`.replace(/\s+/g," ").trim()}}e(B1,"assignColorSlots");var v1="agentflow-",c1=new Set(["shape","view","icon","img","form","pos","w","h","class","style","labelType"]),H1=new Set(["subroutine","subprocess","subproc","framed-rectangle","tool"]),Y1={flow:"flowGroup"};function M1(t){let r=!1,a=!1,o=0,d,h=[];for(let l of t.split(`
2
2
  `)){if(d!==void 0){let E=l.length-l.trimStart().length;if(l.trim()===""||E>d){h.push(l);continue}d=void 0}let p=-1;for(let E=0;E<l.length;E++){let S=l[E];if(a){if(S==="\\")E++;else if(S==='"')a=!1}else if(r){if(S==="'")r=!1}else if(S==='"')a=!0;else if(S==="'")r=!0;else if(S==="#"&&(E===0||l[E-1]===" "||l[E-1]==="\t")){p=E;break}else if(S==="["||S==="{")o++;else if(S==="]"||S==="}")o=Math.max(0,o-1)}if(r||a||o>0){h.push(l);continue}let k=p>=0?l.slice(0,p):l,b=p>=0?l.slice(p):"";if(/:\s*[>|][\d+-]*\s*$/.test(k)){d=l.length-l.trimStart().length,h.push(l);continue}h.push(k.replace(/,([\t ]*)$/,"$1")+b)}return h.join(`
3
- `)}e(M1,"stripLineTrailingCommas");var q1=class{constructor(){this.vertexCounter=0,this.config=u(),this.vertices=new Map,this.edges=[],this.classes=new Map,this.subGraphs=[],this.subGraphLookup=new Map,this.globalNodes=new Set,this.connectors=new Map,this.tooltips=new Map,this.subCount=0,this.firstGraphFlag=!0,this.secCount=-1,this.posCrossRef=[],this.diagramId="",this.preserveCommentsWhenParsing=!0,this.frontmatterLineOffset=0,this.elementMappings=[],this.bareVertexMappings=new WeakSet,this.diagnostics=[],this.postParseValidationRun=!1,this.funs=[],this.setAccTitle=L,this.setAccDescription=R,this.setDiagramTitle=O,this.getAccTitle=I,this.getAccDescription=M,this.getDiagramTitle=D,this.funs.push(this.setupToolTips.bind(this)),this.addVertex=this.addVertex.bind(this),this.firstGraph=this.firstGraph.bind(this),this.setDirection=this.setDirection.bind(this),this.addSubGraph=this.addSubGraph.bind(this),this.addGlobal=this.addGlobal.bind(this),this.addConnector=this.addConnector.bind(this),this.addConnectorMapping=this.addConnectorMapping.bind(this),this.addLink=this.addLink.bind(this),this.setLink=this.setLink.bind(this),this.updateLink=this.updateLink.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.destructLink=this.destructLink.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setTooltip=this.setTooltip.bind(this),this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this),this.setClickFun=this.setClickFun.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.setFrontmatterLineOffset=this.setFrontmatterLineOffset.bind(this),this.addVertexMapping=this.addVertexMapping.bind(this),this.extendVertexMapping=this.extendVertexMapping.bind(this),this.addEdgeMapping=this.addEdgeMapping.bind(this),this.addSubgraphMapping=this.addSubgraphMapping.bind(this),this.emitWarning=this.emitWarning.bind(this),this.emitError=this.emitError.bind(this),this.getDiagnostics=this.getDiagnostics.bind(this),this.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen("gen-2")}static{e(this,"AgentFlowDB")}sanitizeText(t){return y.sanitizeText(t,this.config)}sanitizeNodeLabelType(t){switch(t){case"markdown":case"string":case"text":return t;default:return"markdown"}}setDiagramId(t){this.diagramId=t}lookUpDomId(t){for(let r of this.vertices.values())if(r.id===t)return this.diagramId?`${this.diagramId}-${r.domId}`:r.domId;return this.diagramId?`${this.diagramId}-${t}`:t}addVertex(t,r,a,o,d,h,l={},p,k){if(!t||t.trim().length===0)return;let b;if(p!==void 0){let C;if(!p.includes(`
3
+ `)}e(M1,"stripLineTrailingCommas");var q1=class{constructor(){this.vertexCounter=0,this.config=u(),this.vertices=new Map,this.edges=[],this.classes=new Map,this.subGraphs=[],this.subGraphLookup=new Map,this.globalNodes=new Set,this.connectors=new Map,this.tooltips=new Map,this.subCount=0,this.firstGraphFlag=!0,this.secCount=-1,this.posCrossRef=[],this.diagramId="",this.preserveCommentsWhenParsing=!0,this.frontmatterLineOffset=0,this.elementMappings=[],this.bareVertexMappings=new WeakSet,this.diagnostics=[],this.postParseValidationRun=!1,this.funs=[],this.setAccTitle=L,this.setAccDescription=I,this.setDiagramTitle=D,this.getAccTitle=R,this.getAccDescription=M,this.getDiagramTitle=O,this.funs.push(this.setupToolTips.bind(this)),this.addVertex=this.addVertex.bind(this),this.firstGraph=this.firstGraph.bind(this),this.setDirection=this.setDirection.bind(this),this.addSubGraph=this.addSubGraph.bind(this),this.addGlobal=this.addGlobal.bind(this),this.addConnector=this.addConnector.bind(this),this.addConnectorMapping=this.addConnectorMapping.bind(this),this.addLink=this.addLink.bind(this),this.setLink=this.setLink.bind(this),this.updateLink=this.updateLink.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.destructLink=this.destructLink.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setTooltip=this.setTooltip.bind(this),this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this),this.setClickFun=this.setClickFun.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.setFrontmatterLineOffset=this.setFrontmatterLineOffset.bind(this),this.addVertexMapping=this.addVertexMapping.bind(this),this.extendVertexMapping=this.extendVertexMapping.bind(this),this.addEdgeMapping=this.addEdgeMapping.bind(this),this.addSubgraphMapping=this.addSubgraphMapping.bind(this),this.emitWarning=this.emitWarning.bind(this),this.emitError=this.emitError.bind(this),this.getDiagnostics=this.getDiagnostics.bind(this),this.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen("gen-2")}static{e(this,"AgentFlowDB")}sanitizeText(t){return y.sanitizeText(t,this.config)}sanitizeNodeLabelType(t){switch(t){case"markdown":case"string":case"text":return t;default:return"markdown"}}setDiagramId(t){this.diagramId=t}lookUpDomId(t){for(let r of this.vertices.values())if(r.id===t)return this.diagramId?`${this.diagramId}-${r.domId}`:r.domId;return this.diagramId?`${this.diagramId}-${t}`:t}addVertex(t,r,a,o,d,h,l={},p,k){if(!t||t.trim().length===0)return;let b;if(p!==void 0){let C;if(!p.includes(`
4
4
  `))C=`{
5
5
  `+p+`
6
6
  }`;else C=p+`
@@ -19,7 +19,7 @@ ${V.join(`
19
19
 
20
20
  Initialize mermaid with maxEdges set to a higher number to allow more edges.
21
21
  You cannot set this config via configuration inside the diagram as it is a secure config.
22
- You have to call mermaid.initialize.`)}isLinkData(t){return t!==null&&typeof t==="object"&&"id"in t&&typeof t.id==="string"}addLink(t,r,a){let o=this.isLinkData(a)?a.id.replace("@",""):void 0;n.info("addLink",t,r,o);for(let d of t)for(let h of r){let l=d===t[t.length-1],p=h===r[0];if(l&&p)this.addSingleLink(d,h,a,o);else this.addSingleLink(d,h,a,void 0)}}updateLinkInterpolate(t,r){t.forEach((a)=>{if(a==="default"){this.edges.defaultInterpolate=r;return}if(typeof a==="number"&&a>=this.edges.length)throw Error(`The index ${a} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${this.edges.length-1}. (Help: Ensure that the index is within the range of existing edges.)`);this.edges[a].interpolate=r})}updateLink(t,r){t.forEach((a)=>{if(typeof a==="number"&&a>=this.edges.length)throw Error(`The index ${a} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${this.edges.length-1}. (Help: Ensure that the index is within the range of existing edges.)`);if(a==="default")this.edges.defaultStyle=r;else if(this.edges[a].style=r,(this.edges[a]?.style?.length??0)>0&&!this.edges[a]?.style?.some((o)=>o?.startsWith("fill")))this.edges[a]?.style?.push("fill:none")})}addClass(t,r){let a=r.join().replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");t.split(",").forEach((o)=>{let d=this.classes.get(o);if(d===void 0)d={id:o,styles:[],textStyles:[]},this.classes.set(o,d);if(a!==void 0&&a!==null)a.forEach((h)=>{if(/color/.exec(h)){let l=h.replace("fill","bgFill");d.textStyles.push(l)}d.styles.push(h)})})}setDirection(t){if(this.direction=t.trim(),/.*</.exec(this.direction))this.direction="RL";if(/.*\^/.exec(this.direction))this.direction="BT";if(/.*>/.exec(this.direction))this.direction="LR";if(/.*v/.exec(this.direction))this.direction="TB";if(this.direction==="TD")this.direction="TB"}setClass(t,r){for(let a of t.split(",")){let o=this.vertices.get(a);if(o)o.classes.push(r);let d=this.edges.find((l)=>l.id===a);if(d)d.classes.push(r);let h=this.subGraphLookup.get(a);if(h)h.classes.push(r)}}setTooltip(t,r){if(r===void 0)return;r=this.sanitizeText(r);for(let a of t.split(","))this.tooltips.set(this.version==="gen-1"?this.lookUpDomId(a):a,r)}setClickFun(t,r,a){if(u().securityLevel!=="loose")return;if(r===void 0)return;let o=[];if(typeof a==="string"){o=a.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let h=0;h<o.length;h++){let l=o[h].trim();if(l.startsWith('"')&&l.endsWith('"'))l=l.substr(1,l.length-2);o[h]=l}}if(o.length===0)o.push(t);let d=this.vertices.get(t);if(d)d.haveCallback=!0,this.funs.push(()=>{let h=this.lookUpDomId(t),l=document.querySelector(`[id="${h}"]`);if(l!==null)l.addEventListener("click",()=>{z.runFunc(r,...o)},!1)})}setLink(t,r,a){t.split(",").forEach((o)=>{let d=this.vertices.get(o);if(d!==void 0)d.link=z.formatUrl(r,this.config),d.linkTarget=a}),this.setClass(t,"clickable")}getTooltip(t){return this.tooltips.get(t)}setClickEvent(t,r,a){t.split(",").forEach((o)=>{this.setClickFun(o,r,a)}),this.setClass(t,"clickable")}bindFunctions(t){this.funs.forEach((r)=>{r(t)})}getDirection(){return this.direction?.trim()}getVertices(){return this.vertices}getEdges(){return this.edges}isToolDefinition(t){return H1.has(t.type)}getTools(){let t=[];for(let r of this.vertices.values())if(this.isToolDefinition(r))t.push(r);return t}getClasses(){return this.classes}setupToolTips(t){let r=Xt();m(t).select("svg").selectAll("g.node").on("mouseover",(d)=>{let h=m(d.currentTarget),l=h.attr("title");if(l===null)return;let p=d.currentTarget?.getBoundingClientRect();r.transition().duration(200).style("opacity",".9"),r.text(h.attr("title")).style("left",window.scrollX+p.left+(p.right-p.left)/2+"px").style("top",window.scrollY+p.bottom+"px"),r.html(Pe.sanitize(l)),h.classed("hover",!0)}).on("mouseout",(d)=>{r.transition().duration(500).style("opacity",0),m(d.currentTarget).classed("hover",!1)})}clear(t="gen-2"){this.vertices=new Map,this.classes=new Map,this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.subGraphs=[],this.subGraphLookup=new Map,this.globalNodes=new Set,this.connectors=new Map,this.subCount=0,this.tooltips=new Map,this.firstGraphFlag=!0,this.version=t,this.config=u(),this.diagramId="",this.vertexCounter=0,this.direction=void 0,this.secCount=-1,this.posCrossRef=[],this.frontmatterLineOffset=0,this.elementMappings=[],this.bareVertexMappings=new WeakSet,this.diagnostics=[],this.postParseValidationRun=!1,A()}setGen(t){this.version=t||"gen-2"}defaultStyle(){return"fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;"}addSubGraph(t,r,a,o){let d=t?.text?.trim(),h=a?.text;if(t===a&&a?.text&&/\s/.exec(a.text))d=void 0;let p=e((_)=>{let W={boolean:{},number:{},string:{}},V=[],C;return{nodeList:_.filter(function(g){let F=typeof g;if(g.stmt&&g.stmt==="dir")return C=g.value,!1;if(g.trim()==="")return!1;if(F in W)return W[F].hasOwnProperty(g)?!1:W[F][g]=!0;else return V.includes(g)?!1:V.push(g)}),dir:C}},"uniq")(r.flat()),{nodeList:k,dir:b}=p,E=u().flowchart??{};if(b=b??(E.inheritDir?this.getDirection()??u().direction??void 0:void 0),this.version==="gen-1")for(let _=0;_<k.length;_++)k[_]=this.lookUpDomId(k[_]);d=d??"subGraph"+this.subCount,h=h||"",h=this.sanitizeText(h),this.subCount=this.subCount+1;let S={id:d,nodes:k.filter((_)=>_!==d&&!this.globalNodes.has(_)),title:h.trim(),classes:[],dir:b,labelType:this.sanitizeNodeLabelType(a?.type),type:o??"flow"};n.info("Adding",S.id,S.nodes,S.dir),S.nodes=this.makeUniq(S,this.subGraphs).nodes;let N=this.getPosForId(d);if(N!==-1){let _=this.subGraphs[N];for(let W of S.nodes)if(!_.nodes.includes(W))_.nodes.push(W);if(S.title)_.title=S.title;if(S.dir)_.dir=S.dir;if(S.type)_.type=S.type;this.subGraphLookup.set(d,_)}else this.subGraphs.push(S),this.subGraphLookup.set(d,S);return d}addGlobal(t){for(let r of t.flat()){if(typeof r!=="string")continue;let a=r.trim();if(a!=="")this.globalNodes.add(a)}for(let r of this.subGraphs)r.nodes=r.nodes.filter((a)=>!this.globalNodes.has(a))}getPosForId(t){for(let[r,a]of this.subGraphs.entries())if(a.id===t)return r;return-1}indexNodes2(t,r){let a=this.subGraphs[r].nodes;if(this.secCount=this.secCount+1,this.secCount>2000)return{result:!1,count:0};if(this.posCrossRef[this.secCount]=r,this.subGraphs[r].id===t)return{result:!0,count:0};let o=0,d=1;while(o<a.length){let h=this.getPosForId(a[o]);if(h>=0){let l=this.indexNodes2(t,h);if(l.result)return{result:!0,count:d+l.count};else d=d+l.count}o=o+1}return{result:!1,count:d}}getDepthFirstPos(t){return this.posCrossRef[t]}indexNodes(){if(this.secCount=-1,this.subGraphs.length>0)this.indexNodes2("none",this.subGraphs.length-1)}addConnector(t,r){let a=t?.text?.trim();if(!a)return"";let o=r?.text?.trim()??"",d=o.length>0?this.sanitizeText(o):a,h=this.connectors.get(a);if(!h)h={id:a,labelType:"text",domId:v1+a+"-"+this.vertexCounter,styles:[],classes:[],isConnector:!0,text:d},this.connectors.set(a,h),this.vertices.set(a,h),this.vertexCounter++;else if(o.length>0)h.text=d;return a}getSubGraphs(){return this.subGraphs}getConnectors(){return[...this.connectors.values()]}firstGraph(){if(this.firstGraphFlag)return this.firstGraphFlag=!1,!0;return!1}computeEdgeSemantic(t,r){if(t==="arrow_point"&&r==="normal")return"sequence";if(t==="arrow_cross"&&r==="normal")return"failure";if(t==="arrow_open"&&r==="dotted")return"reference";return}destructStartLink(t){let r=t.trim(),a="arrow_open",o="normal";if(r.includes("."))o="dotted";return{type:"arrow_open",stroke:o}}countChar(t,r){let a=r.length,o=0;for(let d=0;d<a;++d)if(r[d]===t)++o;return o}destructEndLink(t){let r=t.trim(),a=r.slice(0,-1),o="arrow_open";switch(r.slice(-1)){case"x":o="arrow_cross";break;case">":o="arrow_point";break;case"-":case".":o="arrow_open",a=r;break}let d="normal",h=a.length-1,l=this.countChar(".",a);if(l>0)d="dotted",h=l;return{type:o,stroke:d,length:h}}destructLink(t,r){let a=this.destructEndLink(t),o;if(r){if(o=this.destructStartLink(r),o.stroke!==a.stroke)return{type:"INVALID",stroke:"INVALID"};return o.type=a.type,o.length=a.length,{...o,edgeSemantic:this.computeEdgeSemantic(o.type,o.stroke)}}return{...a,edgeSemantic:this.computeEdgeSemantic(a.type,a.stroke)}}exists(t,r){for(let a of t)if(a.nodes.includes(r))return!0;return!1}makeUniq(t,r){let a=[];return t.nodes.forEach((o,d)=>{if(!this.exists(r,o))a.push(t.nodes[d])}),{nodes:a}}getTypeFromVertex(t){let r=typeof t.type==="string"?Dt(t.type):t.type;switch(r){case"square":case void 0:return"squareRect";case"round":return"roundedRect";case"ellipse":return"ellipse";default:return r}}findNode(t,r){return t.find((a)=>a.id===r)}destructEdgeType(t){let r="none",a="arrow_point";switch(t){case"arrow_point":case"arrow_circle":case"arrow_cross":case"arrow_hierarchy":a=t;break;case"double_arrow_point":case"double_arrow_circle":case"double_arrow_cross":r=t.replace("double_",""),a=r;break}return{arrowTypeStart:r,arrowTypeEnd:a}}addNodeFromVertex(t,r,a,o,d,h){let l=a.get(t.id),p=o.get(t.id)??!1,k=this.findNode(r,t.id);if(k)k.cssStyles=t.styles,k.cssCompiledStyles=this.getCompiledStyles(t.classes),k.cssClasses=t.classes.join(" ");else{let b={id:t.id,label:t.text,labelType:t.labelType,labelStyle:"",parentId:l,padding:d.flowchart?.padding||8,cssStyles:t.styles,cssCompiledStyles:this.getCompiledStyles(["default","node",...t.classes]),cssClasses:"default "+t.classes.join(" "),dir:t.dir,domId:t.domId,look:h,link:t.link,linkTarget:t.linkTarget,tooltip:this.getTooltip(t.id),metadata:t.metadata};if(p)r.push({...b,isGroup:!0,shape:"rect"});else r.push({...b,isGroup:!1,shape:this.getTypeFromVertex(t),wrappingWidth:d.agentflow?.wrappingWidth,minWidth:d.agentflow?.minNodeWidth})}}getCompiledStyles(t){let r=[];for(let a of t){let o=this.classes.get(a);if(o?.styles)r=[...r,...o.styles??[]].map((d)=>d.trim());if(o?.textStyles)r=[...r,...o.textStyles??[]].map((d)=>d.trim())}return r}runPostParseValidators(){if(this.postParseValidationRun)return;this.postParseValidationRun=!0}getData(){this.runPostParseValidators();let t=u(),r=[],a=[],o=this.getSubGraphs(),d=new Map,h=new Map,l=new Set,p=new Map,k=e((f,g,F=new Set)=>{if(F.has(f))return;F.add(f);let q=this.subGraphLookup.get(f);if(!q)return;for(let me of q.nodes){if(me===g||F.has(me))continue;l.add(me),p.set(me,g),k(me,g,F)}},"collectDescendants");for(let f of o)if(f.metadata?.view==="collapsed"&&!l.has(f.id))k(f.id,f.id);let b=e((f,g)=>{let F=new Set,q=g;while(q!==void 0&&!F.has(q)){if(q===f)return!0;F.add(q),q=d.get(q)}return!1},"wouldCloseContainmentCycle");for(let f=o.length-1;f>=0;f--){let g=o[f];if(l.has(g.id))continue;if(g.nodes.length>0)h.set(g.id,!0);for(let F of g.nodes){if(b(F,g.id)){this.emitWarning(vt.CONTAINMENT_VIOLATION,`Container "${g.id}" cannot contain "${F}" because "${F}" already contains it. The nesting that would close the loop is dropped.`,{nodeId:F});continue}d.set(F,g.id)}}for(let f=o.length-1;f>=0;f--){let g=o[f];if(l.has(g.id))continue;if(g.metadata?.view==="collapsed"){let q={...g.metadata,containerType:g.type};r.push({id:g.id,label:g.title,labelStyle:"",labelType:g.labelType,parentId:d.get(g.id),padding:8,cssCompiledStyles:this.getCompiledStyles(g.classes),cssClasses:g.classes.join(" "),shape:"collapsedGroup",dir:g.dir,isGroup:!1,look:t.look,metadata:q})}else r.push({id:g.id,label:g.title,labelStyle:"",labelType:g.labelType,parentId:d.get(g.id),padding:8,cssCompiledStyles:this.getCompiledStyles(g.classes),cssClasses:g.classes.join(" "),shape:Y1[g.type??"flow"],dir:g.dir,isGroup:!0,look:t.look,metadata:g.metadata})}this.getVertices().forEach((f)=>{if(l.has(f.id))return;this.addNodeFromVertex(f,r,d,h,t,t.look||"classic")});let S=this.getEdges();S.forEach((f,g)=>{let F=p.get(f.start)??f.start,q=p.get(f.end)??f.end;if(F===q&&f.start!==f.end)return;let{arrowTypeStart:me,arrowTypeEnd:Ie}=this.destructEdgeType(f.type),Fe=[...S.defaultStyle??[]];if(f.style)Fe.push(...f.style);let Le={id:We(F,q,{counter:g,prefix:"L"},f.id),isUserDefinedId:f.isUserDefinedId,start:F,end:q,type:f.type??"normal",label:f.text,labelType:f.labelType,labelpos:"c",thickness:f.stroke,minlen:f.length,classes:f?.stroke==="invisible"?"":"edge-thickness-normal edge-pattern-solid flowchart-link",arrowTypeStart:f?.stroke==="invisible"||f?.type==="arrow_open"?"none":me,arrowTypeEnd:f?.stroke==="invisible"||f?.type==="arrow_open"?"none":Ie,arrowheadStyle:"fill: #333",cssCompiledStyles:this.getCompiledStyles(f.classes),labelStyle:Fe,style:Fe,pattern:f.stroke,look:t.look,animate:f.animate,animation:f.animation,curve:f.interpolate||this.edges.defaultInterpolate||t.flowchart?.curve,metadata:f.metadata};a.push(Le)}),_1(r,this);let N=new Map,_=new Map;for(let f of o){let g=d.get(f.id);if(g!==void 0)_.set(g,[..._.get(g)??[],f.id])}let W=0,V=e((f)=>{if(N.has(f))return;N.set(f,W++);for(let g of _.get(f)??[])V(g)},"walkContainers");for(let f of o)if(d.get(f.id)===void 0)V(f.id);let C=new Set(this.getConnectors().map((f)=>f.id));return B1(r,(f)=>{if(C.has(f))return"connector";let g=this.vertices.get(f);return g?this.deriveVertexKind(g,Dt(g.type)):void 0},N),{nodes:r,edges:a,other:{},config:t,connectors:this.getConnectors()}}validate(){if(u().layout!=="grid")return;Rr(void 0,[...this.vertices.values(),...this.subGraphs])}defaultConfig(){return Kr.flowchart}deriveVertexKind(t,r){if(this.isToolDefinition(t))return"tool";if(r==="hexagon"||r==="hex")return"action";if(r==="lean-right"||r==="lean_right")return"input";if(r==="lin-doc"||r==="lined-document")return"refdoc";if(r==="diamond")return"decision";return"task"}getSemanticModel(){this.runPostParseValidators();let t=new Set(this.subGraphs.map((l)=>l.id)),r=[],a=[];for(let[l,p]of this.vertices){if(t.has(l))continue;if(p.isConnector){let E={id:l};if(p.text!==void 0&&p.text!==l)E.title=p.text;if(p.metadata&&Object.keys(p.metadata).length>0){let S={};for(let[N,_]of Object.entries(p.metadata)){if(c1.has(N))continue;S[N]=_}if(Object.keys(S).length>0)E.metadata=S}a.push(E);continue}let k={id:l};if(p.text!==void 0)k.label=p.text;let b=typeof p.type==="string"?Dt(p.type):p.type;if(b!==void 0)k.shape=b;if(k.vertexKind=this.deriveVertexKind(p,b),p.metadata&&Object.keys(p.metadata).length>0){let E={};for(let[S,N]of Object.entries(p.metadata)){if(c1.has(S))continue;E[S]=N}if(Object.keys(E).length>0)k.metadata=E}r.push(k)}let o=this.edges.map((l)=>{let p={start:l.start,end:l.end};if(l.id!==void 0)p.id=l.id;if(typeof l.text==="string"&&l.text.length>0)p.label=l.text;if(l.type!==void 0)p.type=l.type;if(l.stroke!==void 0)p.stroke=l.stroke;if(l.edgeSemantic!==void 0)p.edgeSemantic=l.edgeSemantic;if(l.length!==void 0)p.length=l.length;if(l.metadata&&Object.keys(l.metadata).length>0)p.metadata={...l.metadata};return p}),d=this.subGraphs.map((l)=>{let p={id:l.id,nodes:[...l.nodes]};if(l.type!==void 0)p.type=l.type;if(l.title!==void 0)p.title=l.title;if(l.dir!==void 0)p.direction=l.dir;if(l.metadata&&Object.keys(l.metadata).length>0){let k={};for(let[b,E]of Object.entries(l.metadata)){if(c1.has(b))continue;k[b]=E}if(Object.keys(k).length>0)p.metadata=k}return p}),h={vertices:r,edges:o,subGraphs:d,connectors:a,diagnostics:this.diagnostics};if(this.direction!==void 0)h.direction=this.direction;return h}setFrontmatterLineOffset(t){this.frontmatterLineOffset=t??0}toElementPosition(t){let r=t?.first_line??0,a=t?.first_column??0,o=t?.last_line??r,d=t?.last_column??a,[h,l]=t?.range??[0,0];return{startLine:r+this.frontmatterLineOffset,startColumn:a,endLine:o+this.frontmatterLineOffset,endColumn:d,startIndex:h,endIndex:l}}pushMapping(t,r,a){if(!t)return;let o={id:t,type:r,position:this.toElementPosition(a)};return this.elementMappings.push(o),o}addVertexMapping(t,r,a,o){let d=this.pushMapping(t,"vertex",o);if(d&&a==null)this.bareVertexMappings.add(d)}extendVertexMapping(t,r){if(!t||!r)return;let a=this.toElementPosition(r);for(let o=this.elementMappings.length-1;o>=0;o--){let d=this.elementMappings[o];if(d.type==="vertex"&&d.id===t){if(this.bareVertexMappings.has(d))d.type="attachment",this.bareVertexMappings.delete(d);if(a.endLine>d.position.endLine||a.endLine===d.position.endLine&&a.endColumn>d.position.endColumn)d.position.endLine=a.endLine,d.position.endColumn=a.endColumn,d.position.endIndex=a.endIndex;return}}this.pushMapping(t,"attachment",r)}addEdgeMapping(t,r,a,o){let d=Array.isArray(r)?r.map((l)=>typeof l==="string"?l:l?.id??"").filter(Boolean):[],h=d.length>0?d.join(">"):"edge";this.pushMapping(h,"edge",o)}addSubgraphMapping(t,r,a,o){let d=(typeof t==="string"?t:t?.text)??"",h=this.toElementPosition(a),l=o?this.toElementPosition(o):h;if(!d)return;this.elementMappings.push({id:d,type:"subgraph",position:{startLine:h.startLine,startColumn:h.startColumn,endLine:l.endLine,endColumn:l.endColumn,startIndex:h.startIndex,endIndex:l.endIndex}})}addConnectorMapping(t,r,a,o){let d=t?.text?.trim()??"";if(!d)return;let h=this.toElementPosition(a),l=o?this.toElementPosition(o):h;this.elementMappings.push({id:d,type:"connector",position:{startLine:h.startLine,startColumn:h.startColumn,endLine:l.endLine,endColumn:l.endColumn,startIndex:h.startIndex,endIndex:l.endIndex}})}getElementMappings(){return[...this.elementMappings]}getElementById(t){return this.elementMappings.find((r)=>r.id===t)}getElementsOnLine(t){return this.elementMappings.filter((r)=>t>=r.position.startLine&&t<=r.position.endLine)}getElementAtPosition(t,r){let a=this.elementMappings.filter((d)=>{let{startLine:h,startColumn:l,endLine:p,endColumn:k}=d.position;if(t<h||t>p)return!1;if(t===h&&r<l)return!1;if(t===p&&r>k)return!1;return!0});if(a.length===0)return;let o=e(({position:d})=>[d.endLine-d.startLine,d.endColumn-d.startColumn],"span");return a.reduce((d,h)=>{let[l,p]=o(d),[k,b]=o(h);if(k!==l)return k<l?h:d;return b<p?h:d})}getMappingStats(){let t=0,r=0,a=0,o=0,d=0;for(let h of this.elementMappings)if(h.type==="vertex")t++;else if(h.type==="edge")r++;else if(h.type==="subgraph")a++;else if(h.type==="connector")o++;else if(h.type==="attachment")d++;return{vertices:t,edges:r,subgraphs:a,connectors:o,attachments:d,totalElements:this.elementMappings.length}}emitDiagnostic(t,r,a,o){let d=o?.nodeId??o?.edgeId,h=d?this.getElementById(d):void 0,l={id:t,severity:r,message:a,...o?.nodeId?{nodeId:o.nodeId}:{},...o?.edgeId&&!o?.nodeId?{edgeId:o.edgeId}:{},...h?{position:h.position}:{}};if(this.diagnostics.some((b)=>b.id===l.id&&b.severity===l.severity&&b.message===l.message&&b.nodeId===l.nodeId&&b.edgeId===l.edgeId))return;this.diagnostics.push(l);let k=`agentflow[${t}]: ${a}`;if(r==="error")n.error(k);else n.warn(k)}emitWarning(t,r,a){this.emitDiagnostic(t,"warning",r,a)}emitError(t,r,a){this.emitDiagnostic(t,"error",r,a)}getDiagnostics(){return[...this.diagnostics]}},X1=e(function(t,r){return r.db.getClasses()},"getClasses"),Q1=e(async function(t,r,a,o){n.debug("Drawing agentflow diagram",r);let{securityLevel:d,agentflow:h,layout:l}=u();o.db.setDiagramId(r),n.debug("Before getData: ");let p=o.db.getData();n.debug("Data: ",p);let k=Ee(r,d),b=o.db.getDirection();if(p.type=o.type,p.layoutAlgorithm=_e(l),p.layoutAlgorithm==="dagre"&&l==="elk")n.warn("flowchart-elk was moved to an external package in Mermaid v11. Please refer [release notes](https://github.com/mermaid-js/mermaid/releases/tag/v11.0.0) for more details. This diagram will be rendered using `dagre` layout as a fallback.");p.direction=b,p.nodeSpacing=h?.nodeSpacing||50,p.rankSpacing=h?.rankSpacing||50,p.markers=["point","circle","cross","hierarchy"],p.diagramId=r,n.debug("REF1:",p),await Ae(p,k);let E=h?.diagramPadding??8;z.insertTitle(k,"agentflowTitleText",h?.titleTopMargin??0,o.db.getDiagramTitle()),ge(k,E,"agentflow",h?.useMaxWidth??!0)},"draw"),J1={getClasses:X1,draw:Q1},d1=function(){var t=e(function(Ke,x,T,v){for(T=T||{},v=Ke.length;v--;T[Ke[v]]=x);return T},"o"),r=[1,5],a=[1,4],o=[1,3],d=[1,6],h=[1,8,9,10,11,12,28,35,36,38,40,42,47,63,87,88,89,90,91,92,105,108,109,112,114,117,118,119,124,125,126,127,128],l=[2,2],p=[1,15],k=[1,16],b=[1,17],E=[1,18],S=[1,19],N=[1,26],_=[1,27],W=[1,28],V=[1,30],C=[1,31],f=[1,32],g=[1,55],F=[1,54],q=[1,34],me=[1,35],Ie=[1,36],Fe=[1,37],Le=[1,38],Q=[1,50],J=[1,52],Z=[1,48],ee=[1,53],te=[1,49],se=[1,56],ie=[1,51],re=[1,57],ne=[1,58],He=[1,39],Ye=[1,40],qe=[1,41],Qe=[1,42],Je=[1,43],je=[1,64],B=[1,8,9,10,11,12,28,33,35,36,38,40,42,47,63,87,88,89,90,91,92,105,108,109,112,114,117,118,119,124,125,126,127,128],ce=[1,70],de=[1,68],fe=[1,67],ke=[1,69],st=[8,9,10,12,78,80,81],it=[1,88],rt=[1,101],nt=[1,106],at=[1,105],ot=[1,102],lt=[1,98],ct=[1,104],ht=[1,100],pt=[1,107],ft=[1,103],bt=[1,108],kt=[1,99],Ze=[8,9,10,11,12,43,78,80,81],oe=[8,9,10,11,12,43,49,78,80,81],Se=[8,9,10,11,12,30,43,47,49,51,53,55,57,59,61,63,66,68,70,71,73,78,80,81,92,105,108,109,112,114,117,118,119],h1=[8,9,10,12,47,63,78,80,81,92,105,108,109,112,114,117,118,119],mt=[47,63,92,105,108,109,112,114,117,118,119],p1=[1,131],f1=[1,132],_t=[1,134],Ft=[1,133],g1=[47,63,65,77,92,105,108,109,112,114,117,118,119],Vt=[1,143],It=[1,157],Lt=[1,158],Bt=[1,159],Mt=[1,162],wt=[1,161],yt=[1,160],Nt=[1,145],Rt=[1,147],Ot=[1,151],b1=[1,139],k1=[1,140],Gt=[1,152],Ut=[1,153],jt=[1,154],zt=[1,155],Wt=[1,156],Kt=[1,163],Ht=[1,164],Yt=[1,141],qt=[1,142],Qt=[1,149],Jt=[1,144],Zt=[1,148],$t=[1,146],At=[8,9,10,11,12,28,33,35,36,38,40,42,47,63,87,88,89,90,91,92,105,108,109,112,114,117,118,119,124,125,126,127,128],m1=[1,168],Et=[1,170],X=[8,9,10,12],xe=[8,9,10,11,12,15,47,63,92,108,109,112,114,117,118,119],P=[1,190],ue=[1,186],le=[1,187],G=[1,191],U=[1,188],j=[1,189],Ct=[80,119,122],K=[8,9,10,11,12,13,15,28,30,33,35,36,43,47,63,78,87,88,89,90,91,92,93,108,112,114,117,118,119],A1=[11,109],ze=[32,52,54,56,58,60,65,67,69,70,72,74,119,120,121],Be=[1,269],Me=[1,267],we=[1,271],ye=[1,265],Ne=[1,266],Re=[1,268],Oe=[1,270],Ge=[1,272],St=[1,292],E1=[8,9,10,12,109],Ve=[8,9,10,11,12,63,87,108,109,112,113,114,115],r1={trace:e(function(){},"trace"),yy:{},symbols_:{error:2,start:3,graphConfig:4,document:5,line:6,statement:7,COMMENT:8,SEMI:9,NEWLINE:10,SPACE:11,EOF:12,GRAPH:13,NODIR:14,DIR:15,FirstStmtSeparator:16,ending:17,endToken:18,spaceList:19,spaceListNewline:20,vertexStatement:21,separator:22,styleStatement:23,linkStyleStatement:24,classDefStatement:25,classStatement:26,clickStatement:27,flow:28,textNoTags:29,SQS:30,text:31,SQE:32,end:33,shapeData:34,global:35,connector:36,direction:37,acc_title:38,acc_title_value:39,acc_descr:40,acc_descr_value:41,acc_descr_multiline_value:42,SHAPE_DATA:43,link:44,node:45,styledVertex:46,AMP:47,vertex:48,STYLE_SEPARATOR:49,idString:50,DOUBLECIRCLESTART:51,DOUBLECIRCLEEND:52,PS:53,PE:54,"(-":55,"-)":56,STADIUMSTART:57,STADIUMEND:58,SUBROUTINESTART:59,SUBROUTINEEND:60,VERTEX_WITH_PROPS_START:61,"NODE_STRING[field]":62,COLON:63,"NODE_STRING[value]":64,PIPE:65,CYLINDERSTART:66,CYLINDEREND:67,DIAMOND_START:68,DIAMOND_STOP:69,TAGEND:70,TRAPSTART:71,TRAPEND:72,INVTRAPSTART:73,INVTRAPEND:74,linkStatement:75,arrowText:76,TESTSTR:77,START_LINK:78,edgeText:79,LINK:80,LINK_ID:81,edgeTextToken:82,STR:83,MD_STR:84,textToken:85,keywords:86,STYLE:87,LINKSTYLE:88,CLASSDEF:89,CLASS:90,CLICK:91,DOWN:92,UP:93,textNoTagsToken:94,stylesOpt:95,"idString[vertex]":96,"idString[class]":97,CALLBACKNAME:98,CALLBACKARGS:99,HREF:100,LINK_TARGET:101,"STR[link]":102,"STR[tooltip]":103,alphaNum:104,DEFAULT:105,numList:106,INTERPOLATE:107,NUM:108,COMMA:109,style:110,styleComponent:111,NODE_STRING:112,UNIT:113,BRKT:114,PCT:115,idStringToken:116,MINUS:117,MULT:118,UNICODE_TEXT:119,TEXT:120,TAGSTART:121,EDGE_TEXT:122,alphaNumToken:123,direction_tb:124,direction_bt:125,direction_rl:126,direction_lr:127,direction_td:128,$accept:0,$end:1},terminals_:{2:"error",8:"COMMENT",9:"SEMI",10:"NEWLINE",11:"SPACE",12:"EOF",13:"GRAPH",14:"NODIR",15:"DIR",28:"flow",30:"SQS",32:"SQE",33:"end",35:"global",36:"connector",38:"acc_title",39:"acc_title_value",40:"acc_descr",41:"acc_descr_value",42:"acc_descr_multiline_value",43:"SHAPE_DATA",47:"AMP",49:"STYLE_SEPARATOR",51:"DOUBLECIRCLESTART",52:"DOUBLECIRCLEEND",53:"PS",54:"PE",55:"(-",56:"-)",57:"STADIUMSTART",58:"STADIUMEND",59:"SUBROUTINESTART",60:"SUBROUTINEEND",61:"VERTEX_WITH_PROPS_START",62:"NODE_STRING[field]",63:"COLON",64:"NODE_STRING[value]",65:"PIPE",66:"CYLINDERSTART",67:"CYLINDEREND",68:"DIAMOND_START",69:"DIAMOND_STOP",70:"TAGEND",71:"TRAPSTART",72:"TRAPEND",73:"INVTRAPSTART",74:"INVTRAPEND",77:"TESTSTR",78:"START_LINK",80:"LINK",81:"LINK_ID",83:"STR",84:"MD_STR",87:"STYLE",88:"LINKSTYLE",89:"CLASSDEF",90:"CLASS",91:"CLICK",92:"DOWN",93:"UP",96:"idString[vertex]",97:"idString[class]",98:"CALLBACKNAME",99:"CALLBACKARGS",100:"HREF",101:"LINK_TARGET",102:"STR[link]",103:"STR[tooltip]",105:"DEFAULT",107:"INTERPOLATE",108:"NUM",109:"COMMA",112:"NODE_STRING",113:"UNIT",114:"BRKT",115:"PCT",117:"MINUS",118:"MULT",119:"UNICODE_TEXT",120:"TEXT",121:"TAGSTART",122:"EDGE_TEXT",124:"direction_tb",125:"direction_bt",126:"direction_rl",127:"direction_lr",128:"direction_td"},productions_:[0,[3,2],[5,0],[5,2],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[4,2],[4,2],[4,2],[4,2],[4,3],[17,2],[17,1],[18,1],[18,1],[18,1],[16,1],[16,1],[16,2],[16,1],[20,2],[20,2],[20,2],[20,1],[20,1],[20,1],[19,2],[19,1],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,9],[7,10],[7,6],[7,7],[7,4],[7,4],[7,7],[7,8],[7,4],[7,5],[7,1],[7,2],[7,2],[7,1],[22,1],[22,1],[22,1],[22,1],[34,2],[34,1],[21,4],[21,3],[21,4],[21,2],[21,2],[21,1],[45,1],[45,6],[45,5],[46,1],[46,3],[48,4],[48,4],[48,6],[48,4],[48,4],[48,4],[48,8],[48,4],[48,4],[48,4],[48,6],[48,4],[48,4],[48,4],[48,4],[48,4],[48,1],[44,2],[44,3],[44,3],[44,1],[44,3],[44,4],[79,1],[79,2],[79,1],[79,1],[75,1],[75,2],[76,3],[31,1],[31,2],[31,1],[31,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[29,1],[29,2],[29,1],[29,1],[25,5],[26,5],[27,2],[27,4],[27,3],[27,5],[27,3],[27,5],[27,5],[27,7],[27,2],[27,4],[27,2],[27,4],[27,4],[27,6],[23,5],[24,5],[24,5],[24,9],[24,9],[24,7],[24,7],[106,1],[106,3],[95,1],[95,3],[110,1],[110,2],[111,1],[111,1],[111,1],[111,1],[111,1],[111,1],[111,1],[111,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[85,1],[85,1],[85,1],[85,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[82,1],[82,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[50,1],[50,2],[104,1],[104,2],[37,1],[37,1],[37,1],[37,1],[37,1]],performAction:e(function(x,T,v,c,H,s,w){var i=s.length-1;switch(H){case 2:this.$=[];break;case 3:if(!Array.isArray(s[i])||s[i].length>0)s[i-1].push(s[i]);this.$=s[i-1];break;case 4:case 198:this.$=s[i];break;case 5:case 33:case 34:case 35:case 36:case 37:this.$=[];break;case 13:c.setDirection("TB"),this.$="TB";break;case 14:c.setDirection(s[i-1]),this.$=s[i-1];break;case 32:this.$=s[i-1].nodes;break;case 38:if(this.$=c.addSubGraph(s[i-6],s[i-1],s[i-4],"flow"),c.addSubgraphMapping)c.addSubgraphMapping(s[i-6],s[i-4],w[i-8],w[i]);break;case 39:if(this.$=c.addSubGraph(s[i-7],s[i-1],s[i-5],"flow"),c.addVertex(this.$,void 0,void 0,void 0,void 0,void 0,void 0,s[i-3],w[i-3]),c.addSubgraphMapping)c.addSubgraphMapping(s[i-7],s[i-5],w[i-9],w[i]);break;case 40:if(this.$=c.addSubGraph(s[i-3],s[i-1],{text:"",type:"text"},"flow"),c.addSubgraphMapping)c.addSubgraphMapping(s[i-3],{text:"",type:"text"},w[i-5],w[i]);break;case 41:if(this.$=c.addSubGraph(s[i-4],s[i-1],{text:"",type:"text"},"flow"),c.addVertex(this.$,void 0,void 0,void 0,void 0,void 0,void 0,s[i-3],w[i-3]),c.addSubgraphMapping)c.addSubgraphMapping(s[i-4],{text:"",type:"text"},w[i-6],w[i]);break;case 42:if(this.$=c.addSubGraph(void 0,s[i-1],void 0,"flow"),c.addSubgraphMapping)c.addSubgraphMapping(void 0,void 0,w[i-3],w[i]);break;case 43:c.addGlobal(s[i-1]),this.$=[];break;case 44:if(this.$=c.addConnector(s[i-4],s[i-2]),c.addConnectorMapping)c.addConnectorMapping(s[i-4],s[i-2],w[i-6],w[i]);break;case 45:if(this.$=c.addConnector(s[i-5],s[i-3]),c.addVertex(this.$,void 0,void 0,void 0,void 0,void 0,void 0,s[i-1],w[i-1]),c.addConnectorMapping)c.addConnectorMapping(s[i-5],s[i-3],w[i-7],w[i]);break;case 46:if(this.$=c.addConnector(s[i-1],{text:"",type:"text"}),c.addConnectorMapping)c.addConnectorMapping(s[i-1],{text:"",type:"text"},w[i-3],w[i]);break;case 47:if(this.$=c.addConnector(s[i-2],{text:"",type:"text"}),c.addVertex(this.$,void 0,void 0,void 0,void 0,void 0,void 0,s[i-1],w[i-1]),c.addConnectorMapping)c.addConnectorMapping(s[i-2],{text:"",type:"text"},w[i-4],w[i]);break;case 49:this.$=s[i].trim(),c.setAccTitle(this.$);break;case 50:case 51:this.$=s[i].trim(),c.setAccDescription(this.$);break;case 56:this.$=s[i-1]+s[i];break;case 57:this.$=s[i];break;case 58:if(c.addVertex(s[i-1][s[i-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,s[i],w[i]),c.extendVertexMapping)c.extendVertexMapping(s[i-1][s[i-1].length-1],w[i]);if(c.addLink(s[i-3].stmt,s[i-1],s[i-2]),c.addEdgeMapping)c.addEdgeMapping(s[i-3].stmt,s[i-1],s[i-2],this._$);this.$={stmt:s[i-1],nodes:s[i-1].concat(s[i-3].nodes)};break;case 59:if(c.addLink(s[i-2].stmt,s[i],s[i-1]),c.addEdgeMapping)c.addEdgeMapping(s[i-2].stmt,s[i],s[i-1],this._$);this.$={stmt:s[i],nodes:s[i].concat(s[i-2].nodes)};break;case 60:if(c.addLink(s[i-3].stmt,s[i-1],s[i-2]),c.addEdgeMapping)c.addEdgeMapping(s[i-3].stmt,s[i-1],s[i-2],this._$);this.$={stmt:s[i-1],nodes:s[i-1].concat(s[i-3].nodes)};break;case 61:this.$={stmt:s[i-1],nodes:s[i-1]};break;case 62:if(c.addVertex(s[i-1][s[i-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,s[i],w[i]),c.extendVertexMapping)c.extendVertexMapping(s[i-1][s[i-1].length-1],w[i]);this.$={stmt:s[i-1],nodes:s[i-1],shapeData:s[i]};break;case 63:this.$={stmt:s[i],nodes:s[i]};break;case 64:this.$=[s[i]];break;case 65:if(c.addVertex(s[i-5][s[i-5].length-1],void 0,void 0,void 0,void 0,void 0,void 0,s[i-4],w[i-4]),c.extendVertexMapping)c.extendVertexMapping(s[i-5][s[i-5].length-1],w[i-4]);this.$=s[i-5].concat(s[i]);break;case 66:this.$=s[i-4].concat(s[i]);break;case 67:this.$=s[i];break;case 68:this.$=s[i-2],c.setClass(s[i-2],s[i]);break;case 69:if(this.$=s[i-3],c.addVertex(s[i-3],s[i-1],"square"),c.addVertexMapping)c.addVertexMapping(s[i-3],s[i-1],"square",this._$);break;case 70:if(this.$=s[i-3],c.addVertex(s[i-3],s[i-1],"doublecircle"),c.addVertexMapping)c.addVertexMapping(s[i-3],s[i-1],"doublecircle",this._$);break;case 71:if(this.$=s[i-5],c.addVertex(s[i-5],s[i-2],"circle"),c.addVertexMapping)c.addVertexMapping(s[i-5],s[i-2],"circle",this._$);break;case 72:if(this.$=s[i-3],c.addVertex(s[i-3],s[i-1],"ellipse"),c.addVertexMapping)c.addVertexMapping(s[i-3],s[i-1],"ellipse",this._$);break;case 73:if(this.$=s[i-3],c.addVertex(s[i-3],s[i-1],"stadium"),c.addVertexMapping)c.addVertexMapping(s[i-3],s[i-1],"stadium",this._$);break;case 74:if(this.$=s[i-3],c.addVertex(s[i-3],s[i-1],"subroutine"),c.addVertexMapping)c.addVertexMapping(s[i-3],s[i-1],"subroutine",this._$);break;case 75:if(this.$=s[i-7],c.addVertex(s[i-7],s[i-1],"rect",void 0,void 0,void 0,Object.fromEntries([[s[i-5],s[i-3]]])),c.addVertexMapping)c.addVertexMapping(s[i-7],s[i-1],"rect",this._$);break;case 76:if(this.$=s[i-3],c.addVertex(s[i-3],s[i-1],"cylinder"),c.addVertexMapping)c.addVertexMapping(s[i-3],s[i-1],"cylinder",this._$);break;case 77:if(this.$=s[i-3],c.addVertex(s[i-3],s[i-1],"round"),c.addVertexMapping)c.addVertexMapping(s[i-3],s[i-1],"round",this._$);break;case 78:if(this.$=s[i-3],c.addVertex(s[i-3],s[i-1],"diamond"),c.addVertexMapping)c.addVertexMapping(s[i-3],s[i-1],"diamond",this._$);break;case 79:if(this.$=s[i-5],c.addVertex(s[i-5],s[i-2],"hexagon"),c.addVertexMapping)c.addVertexMapping(s[i-5],s[i-2],"hexagon",this._$);break;case 80:if(this.$=s[i-3],c.addVertex(s[i-3],s[i-1],"odd"),c.addVertexMapping)c.addVertexMapping(s[i-3],s[i-1],"odd",this._$);break;case 81:if(this.$=s[i-3],c.addVertex(s[i-3],s[i-1],"trapezoid"),c.addVertexMapping)c.addVertexMapping(s[i-3],s[i-1],"trapezoid",this._$);break;case 82:if(this.$=s[i-3],c.addVertex(s[i-3],s[i-1],"inv_trapezoid"),c.addVertexMapping)c.addVertexMapping(s[i-3],s[i-1],"inv_trapezoid",this._$);break;case 83:if(this.$=s[i-3],c.addVertex(s[i-3],s[i-1],"lean_right"),c.addVertexMapping)c.addVertexMapping(s[i-3],s[i-1],"lean_right",this._$);break;case 84:if(this.$=s[i-3],c.addVertex(s[i-3],s[i-1],"lean_left"),c.addVertexMapping)c.addVertexMapping(s[i-3],s[i-1],"lean_left",this._$);break;case 85:if(this.$=s[i],c.addVertex(s[i]),c.addVertexMapping)c.addVertexMapping(s[i],void 0,void 0,this._$);break;case 86:s[i-1].text=s[i],this.$=s[i-1];break;case 87:case 88:s[i-2].text=s[i-1],this.$=s[i-2];break;case 89:this.$=s[i];break;case 90:var Y=c.destructLink(s[i],s[i-2]);this.$={type:Y.type,stroke:Y.stroke,length:Y.length,edgeSemantic:Y.edgeSemantic,text:s[i-1]};break;case 91:var Y=c.destructLink(s[i],s[i-2]);this.$={type:Y.type,stroke:Y.stroke,length:Y.length,edgeSemantic:Y.edgeSemantic,text:s[i-1],id:s[i-3]};break;case 92:this.$={text:s[i],type:"text"};break;case 93:this.$={text:s[i-1].text+""+s[i],type:s[i-1].type};break;case 94:this.$={text:s[i],type:"string"};break;case 95:this.$={text:s[i],type:"markdown"};break;case 96:var Y=c.destructLink(s[i]);this.$={type:Y.type,stroke:Y.stroke,length:Y.length,edgeSemantic:Y.edgeSemantic};break;case 97:var Y=c.destructLink(s[i]);this.$={type:Y.type,stroke:Y.stroke,length:Y.length,edgeSemantic:Y.edgeSemantic,id:s[i-1]};break;case 98:this.$=s[i-1];break;case 99:this.$={text:s[i],type:"text"};break;case 100:this.$={text:s[i-1].text+""+s[i],type:s[i-1].type};break;case 101:this.$={text:s[i],type:"string"};break;case 102:case 119:this.$={text:s[i],type:"markdown"};break;case 116:this.$={text:s[i],type:"text"};break;case 117:this.$={text:s[i-1].text+""+s[i],type:s[i-1].type};break;case 118:this.$={text:s[i],type:"text"};break;case 120:this.$=s[i-4],c.addClass(s[i-2],s[i]);break;case 121:this.$=s[i-4],c.setClass(s[i-2],s[i]);break;case 122:case 130:this.$=s[i-1],c.setClickEvent(s[i-1],s[i]);break;case 123:case 131:this.$=s[i-3],c.setClickEvent(s[i-3],s[i-2]),c.setTooltip(s[i-3],s[i]);break;case 124:this.$=s[i-2],c.setClickEvent(s[i-2],s[i-1],s[i]);break;case 125:this.$=s[i-4],c.setClickEvent(s[i-4],s[i-3],s[i-2]),c.setTooltip(s[i-4],s[i]);break;case 126:this.$=s[i-2],c.setLink(s[i-2],s[i]);break;case 127:this.$=s[i-4],c.setLink(s[i-4],s[i-2]),c.setTooltip(s[i-4],s[i]);break;case 128:this.$=s[i-4],c.setLink(s[i-4],s[i-2],s[i]);break;case 129:this.$=s[i-6],c.setLink(s[i-6],s[i-4],s[i]),c.setTooltip(s[i-6],s[i-2]);break;case 132:this.$=s[i-1],c.setLink(s[i-1],s[i]);break;case 133:this.$=s[i-3],c.setLink(s[i-3],s[i-2]),c.setTooltip(s[i-3],s[i]);break;case 134:this.$=s[i-3],c.setLink(s[i-3],s[i-2],s[i]);break;case 135:this.$=s[i-5],c.setLink(s[i-5],s[i-4],s[i]),c.setTooltip(s[i-5],s[i-2]);break;case 136:this.$=s[i-4],c.addVertex(s[i-2],void 0,void 0,s[i]);break;case 137:this.$=s[i-4],c.updateLink([s[i-2]],s[i]);break;case 138:this.$=s[i-4],c.updateLink(s[i-2],s[i]);break;case 139:this.$=s[i-8],c.updateLinkInterpolate([s[i-6]],s[i-2]),c.updateLink([s[i-6]],s[i]);break;case 140:this.$=s[i-8],c.updateLinkInterpolate(s[i-6],s[i-2]),c.updateLink(s[i-6],s[i]);break;case 141:this.$=s[i-6],c.updateLinkInterpolate([s[i-4]],s[i]);break;case 142:this.$=s[i-6],c.updateLinkInterpolate(s[i-4],s[i]);break;case 143:case 145:this.$=[s[i]];break;case 144:case 146:s[i-2].push(s[i]),this.$=s[i-2];break;case 148:this.$=s[i-1]+s[i];break;case 196:this.$=s[i];break;case 197:this.$=s[i-1]+""+s[i];break;case 199:this.$=s[i-1]+""+s[i];break;case 200:this.$={stmt:"dir",value:"TB"};break;case 201:this.$={stmt:"dir",value:"BT"};break;case 202:this.$={stmt:"dir",value:"RL"};break;case 203:this.$={stmt:"dir",value:"LR"};break;case 204:this.$={stmt:"dir",value:"TD"};break}},"anonymous"),table:[{3:1,4:2,8:r,10:a,11:o,13:d},{1:[3]},t(h,l,{5:7}),{4:8,8:r,10:a,11:o,13:d},{4:9,8:r,10:a,11:o,13:d},{4:10,8:r,10:a,11:o,13:d},{14:[1,11],15:[1,12]},{1:[2,1],6:13,7:14,8:p,9:k,10:b,11:E,12:S,21:20,23:21,24:22,25:23,26:24,27:25,28:N,35:_,36:W,37:29,38:V,40:C,42:f,45:33,46:44,47:g,48:45,50:46,63:F,87:q,88:me,89:Ie,90:Fe,91:Le,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:47,117:ie,118:re,119:ne,124:He,125:Ye,126:qe,127:Qe,128:Je},t(h,[2,10]),t(h,[2,11]),t(h,[2,12]),t(h,[2,13]),{8:[1,63],9:[1,60],10:[1,61],11:je,16:59,19:62},t(B,[2,3]),t(B,[2,4]),t(B,[2,5]),t(B,[2,6]),t(B,[2,7]),t(B,[2,8]),t(B,[2,9]),{8:ce,9:de,10:fe,12:ke,22:65,44:66,75:71,78:[1,72],80:[1,74],81:[1,73]},{8:ce,9:de,10:fe,12:ke,22:75},{8:ce,9:de,10:fe,12:ke,22:76},{8:ce,9:de,10:fe,12:ke,22:77},{8:ce,9:de,10:fe,12:ke,22:78},{8:ce,9:de,10:fe,12:ke,22:79},{8:ce,9:de,10:fe,11:[1,80],12:ke,22:81},{8:ce,9:de,10:fe,12:ke,22:82},{11:[1,83]},t(B,[2,48]),{39:[1,84]},{41:[1,85]},t(B,[2,51]),t(st,[2,63],{19:86,34:87,11:je,43:it}),{11:[1,89]},{11:[1,90]},{11:[1,91]},{11:[1,92]},{15:rt,47:nt,63:at,83:[1,96],92:ot,98:[1,93],100:[1,94],104:95,108:lt,109:ct,112:ht,114:pt,117:ft,118:bt,119:kt,123:97},t(B,[2,200]),t(B,[2,201]),t(B,[2,202]),t(B,[2,203]),t(B,[2,204]),t(Ze,[2,64]),t(Ze,[2,67],{49:[1,109]}),t(oe,[2,85],{116:122,30:[1,110],47:g,51:[1,111],53:[1,112],55:[1,113],57:[1,114],59:[1,115],61:[1,116],63:F,66:[1,117],68:[1,118],70:[1,119],71:[1,120],73:[1,121],92:Q,105:J,108:Z,109:ee,112:te,114:se,117:ie,118:re,119:ne}),t(Se,[2,196]),t(Se,[2,157]),t(Se,[2,158]),t(Se,[2,159]),t(Se,[2,160]),t(Se,[2,161]),t(Se,[2,162]),t(Se,[2,163]),t(Se,[2,164]),t(Se,[2,165]),t(Se,[2,166]),t(Se,[2,167]),t(h,[2,14]),t(h,[2,20]),t(h,[2,21]),{10:[1,123]},t(h,[2,23]),t(h1,[2,31],{19:124,11:je}),t(B,[2,32]),{45:125,46:44,47:g,48:45,50:46,63:F,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:47,117:ie,118:re,119:ne},t(B,[2,52]),t(B,[2,53]),t(B,[2,54]),t(B,[2,55]),t(mt,[2,89],{76:126,65:[1,128],77:[1,127]}),{79:129,82:130,83:p1,84:f1,119:_t,122:Ft},{78:[1,135],80:[1,136]},t(g1,[2,96]),t(B,[2,33]),t(B,[2,34]),t(B,[2,35]),t(B,[2,36]),t(B,[2,37]),{11:Vt,13:It,15:Lt,28:Bt,29:137,33:Mt,35:wt,36:yt,47:Nt,63:Rt,78:Ot,83:b1,84:k1,86:150,87:Gt,88:Ut,89:jt,90:zt,91:Wt,92:Kt,93:Ht,94:138,108:Yt,112:qt,114:Qt,117:Jt,118:Zt,119:$t},t(At,l,{5:165}),t(At,l,{5:166}),{11:Vt,13:It,15:Lt,28:Bt,29:167,33:Mt,35:wt,36:yt,47:Nt,63:Rt,78:Ot,83:b1,84:k1,86:150,87:Gt,88:Ut,89:jt,90:zt,91:Wt,92:Kt,93:Ht,94:138,108:Yt,112:qt,114:Qt,117:Jt,118:Zt,119:$t},t(B,[2,49]),t(B,[2,50]),t(st,[2,61],{47:m1}),t(st,[2,62],{19:169,11:je,43:Et}),t(Ze,[2,57]),{47:g,50:171,63:F,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:47,117:ie,118:re,119:ne},{105:[1,172],106:173,108:[1,174]},{47:g,50:175,63:F,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:47,117:ie,118:re,119:ne},{47:g,50:176,63:F,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:47,117:ie,118:re,119:ne},t(X,[2,122],{11:[1,177],99:[1,178]}),{83:[1,179]},t(X,[2,130],{123:181,11:[1,180],15:rt,47:nt,63:at,92:ot,108:lt,109:ct,112:ht,114:pt,117:ft,118:bt,119:kt}),t(X,[2,132],{11:[1,182]}),t(xe,[2,198]),t(xe,[2,185]),t(xe,[2,186]),t(xe,[2,187]),t(xe,[2,188]),t(xe,[2,189]),t(xe,[2,190]),t(xe,[2,191]),t(xe,[2,192]),t(xe,[2,193]),t(xe,[2,194]),t(xe,[2,195]),{47:g,50:183,63:F,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:47,117:ie,118:re,119:ne},{31:184,70:P,83:ue,84:le,85:185,119:G,120:U,121:j},{31:192,70:P,83:ue,84:le,85:185,119:G,120:U,121:j},{31:194,53:[1,193],70:P,83:ue,84:le,85:185,119:G,120:U,121:j},{31:195,70:P,83:ue,84:le,85:185,119:G,120:U,121:j},{31:196,70:P,83:ue,84:le,85:185,119:G,120:U,121:j},{31:197,70:P,83:ue,84:le,85:185,119:G,120:U,121:j},{112:[1,198]},{31:199,70:P,83:ue,84:le,85:185,119:G,120:U,121:j},{31:200,68:[1,201],70:P,83:ue,84:le,85:185,119:G,120:U,121:j},{31:202,70:P,83:ue,84:le,85:185,119:G,120:U,121:j},{31:203,70:P,83:ue,84:le,85:185,119:G,120:U,121:j},{31:204,70:P,83:ue,84:le,85:185,119:G,120:U,121:j},t(Se,[2,197]),t(h,[2,22]),t(h1,[2,30]),t(st,[2,59],{34:205,19:206,11:je,43:it}),t(mt,[2,86],{11:[1,207]}),{11:[1,208]},{31:209,70:P,83:ue,84:le,85:185,119:G,120:U,121:j},{80:[1,210],82:211,119:_t,122:Ft},t(Ct,[2,92]),t(Ct,[2,94]),t(Ct,[2,95]),t(Ct,[2,183]),t(Ct,[2,184]),{79:212,82:130,83:p1,84:f1,119:_t,122:Ft},t(g1,[2,97]),{8:ce,9:de,10:fe,11:Vt,12:ke,13:It,15:Lt,22:214,28:Bt,30:[1,213],33:Mt,34:215,35:wt,36:yt,43:it,47:Nt,63:Rt,78:Ot,86:150,87:Gt,88:Ut,89:jt,90:zt,91:Wt,92:Kt,93:Ht,94:216,108:Yt,112:qt,114:Qt,117:Jt,118:Zt,119:$t},t(K,[2,116]),t(K,[2,118]),t(K,[2,119]),t(K,[2,172]),t(K,[2,173]),t(K,[2,174]),t(K,[2,175]),t(K,[2,176]),t(K,[2,177]),t(K,[2,178]),t(K,[2,179]),t(K,[2,180]),t(K,[2,181]),t(K,[2,182]),t(K,[2,103]),t(K,[2,104]),t(K,[2,105]),t(K,[2,106]),t(K,[2,107]),t(K,[2,108]),t(K,[2,109]),t(K,[2,110]),t(K,[2,111]),t(K,[2,112]),t(K,[2,113]),t(K,[2,114]),t(K,[2,115]),{6:13,7:14,8:p,9:k,10:b,11:E,12:S,21:20,23:21,24:22,25:23,26:24,27:25,28:N,33:[1,217],35:_,36:W,37:29,38:V,40:C,42:f,45:33,46:44,47:g,48:45,50:46,63:F,87:q,88:me,89:Ie,90:Fe,91:Le,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:47,117:ie,118:re,119:ne,124:He,125:Ye,126:qe,127:Qe,128:Je},{6:13,7:14,8:p,9:k,10:b,11:E,12:S,21:20,23:21,24:22,25:23,26:24,27:25,28:N,33:[1,218],35:_,36:W,37:29,38:V,40:C,42:f,45:33,46:44,47:g,48:45,50:46,63:F,87:q,88:me,89:Ie,90:Fe,91:Le,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:47,117:ie,118:re,119:ne,124:He,125:Ye,126:qe,127:Qe,128:Je},{8:ce,9:de,10:fe,11:Vt,12:ke,13:It,15:Lt,22:220,28:Bt,30:[1,219],33:Mt,34:221,35:wt,36:yt,43:it,47:Nt,63:Rt,78:Ot,86:150,87:Gt,88:Ut,89:jt,90:zt,91:Wt,92:Kt,93:Ht,94:216,108:Yt,112:qt,114:Qt,117:Jt,118:Zt,119:$t},{11:je,19:222},{47:[1,223]},t(Ze,[2,56]),{11:[1,224],47:g,63:F,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:122,117:ie,118:re,119:ne},{11:[1,225]},{11:[1,226],109:[1,227]},t(A1,[2,143]),{11:[1,228],47:g,63:F,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:122,117:ie,118:re,119:ne},{11:[1,229],47:g,63:F,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:122,117:ie,118:re,119:ne},{83:[1,230]},t(X,[2,124],{11:[1,231]}),t(X,[2,126],{11:[1,232]}),{83:[1,233]},t(xe,[2,199]),{83:[1,234],101:[1,235]},t(Ze,[2,68],{116:122,47:g,63:F,92:Q,105:J,108:Z,109:ee,112:te,114:se,117:ie,118:re,119:ne}),{32:[1,236],70:P,85:237,119:G,120:U,121:j},t(ze,[2,99]),t(ze,[2,101]),t(ze,[2,102]),t(ze,[2,168]),t(ze,[2,169]),t(ze,[2,170]),t(ze,[2,171]),{52:[1,238],70:P,85:237,119:G,120:U,121:j},{31:239,70:P,83:ue,84:le,85:185,119:G,120:U,121:j},{54:[1,240],70:P,85:237,119:G,120:U,121:j},{56:[1,241],70:P,85:237,119:G,120:U,121:j},{58:[1,242],70:P,85:237,119:G,120:U,121:j},{60:[1,243],70:P,85:237,119:G,120:U,121:j},{63:[1,244]},{67:[1,245],70:P,85:237,119:G,120:U,121:j},{69:[1,246],70:P,85:237,119:G,120:U,121:j},{31:247,70:P,83:ue,84:le,85:185,119:G,120:U,121:j},{32:[1,248],70:P,85:237,119:G,120:U,121:j},{70:P,72:[1,249],74:[1,250],85:237,119:G,120:U,121:j},{70:P,72:[1,252],74:[1,251],85:237,119:G,120:U,121:j},t(st,[2,58],{19:169,11:je,43:Et}),t(st,[2,60],{47:m1}),t(mt,[2,88]),t(mt,[2,87]),{65:[1,253],70:P,85:237,119:G,120:U,121:j},t(mt,[2,90]),t(Ct,[2,93]),{80:[1,254],82:211,119:_t,122:Ft},{31:255,70:P,83:ue,84:le,85:185,119:G,120:U,121:j},t(At,l,{5:256}),{8:ce,9:de,10:fe,12:ke,22:257,43:Et},t(K,[2,117]),t(B,[2,42]),t(B,[2,43]),{31:258,70:P,83:ue,84:le,85:185,119:G,120:U,121:j},t(B,[2,46]),{8:ce,9:de,10:fe,12:ke,22:259,43:Et},{46:260,47:g,48:45,50:46,63:F,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:47,117:ie,118:re,119:ne},{11:je,19:261},{11:Be,63:Me,87:we,95:262,108:ye,110:263,111:264,112:Ne,113:Re,114:Oe,115:Ge},{11:Be,63:Me,87:we,95:273,107:[1,274],108:ye,110:263,111:264,112:Ne,113:Re,114:Oe,115:Ge},{11:Be,63:Me,87:we,95:275,107:[1,276],108:ye,110:263,111:264,112:Ne,113:Re,114:Oe,115:Ge},{108:[1,277]},{11:Be,63:Me,87:we,95:278,108:ye,110:263,111:264,112:Ne,113:Re,114:Oe,115:Ge},{47:g,50:279,63:F,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:47,117:ie,118:re,119:ne},t(X,[2,123]),{83:[1,280]},{83:[1,281],101:[1,282]},t(X,[2,131]),t(X,[2,133],{11:[1,283]}),t(X,[2,134]),t(oe,[2,69]),t(ze,[2,100]),t(oe,[2,70]),{54:[1,284],70:P,85:237,119:G,120:U,121:j},t(oe,[2,77]),t(oe,[2,72]),t(oe,[2,73]),t(oe,[2,74]),{112:[1,285]},t(oe,[2,76]),t(oe,[2,78]),{69:[1,286],70:P,85:237,119:G,120:U,121:j},t(oe,[2,80]),t(oe,[2,81]),t(oe,[2,83]),t(oe,[2,82]),t(oe,[2,84]),t([11,47,63,92,105,108,109,112,114,117,118,119],[2,98]),t(mt,[2,91]),{32:[1,287],70:P,85:237,119:G,120:U,121:j},{6:13,7:14,8:p,9:k,10:b,11:E,12:S,21:20,23:21,24:22,25:23,26:24,27:25,28:N,33:[1,288],35:_,36:W,37:29,38:V,40:C,42:f,45:33,46:44,47:g,48:45,50:46,63:F,87:q,88:me,89:Ie,90:Fe,91:Le,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:47,117:ie,118:re,119:ne,124:He,125:Ye,126:qe,127:Qe,128:Je},t(At,l,{5:289}),{32:[1,290],70:P,85:237,119:G,120:U,121:j},t(B,[2,47]),t(Ze,[2,66]),{46:291,47:g,48:45,50:46,63:F,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:47,117:ie,118:re,119:ne},t(X,[2,136],{109:St}),t(E1,[2,145],{111:293,11:Be,63:Me,87:we,108:ye,112:Ne,113:Re,114:Oe,115:Ge}),t(Ve,[2,147]),t(Ve,[2,149]),t(Ve,[2,150]),t(Ve,[2,151]),t(Ve,[2,152]),t(Ve,[2,153]),t(Ve,[2,154]),t(Ve,[2,155]),t(Ve,[2,156]),t(X,[2,137],{109:St}),{11:[1,294]},t(X,[2,138],{109:St}),{11:[1,295]},t(A1,[2,144]),t(X,[2,120],{109:St}),t(X,[2,121],{116:122,47:g,63:F,92:Q,105:J,108:Z,109:ee,112:te,114:se,117:ie,118:re,119:ne}),t(X,[2,125]),t(X,[2,127],{11:[1,296]}),t(X,[2,128]),{101:[1,297]},{54:[1,298]},{65:[1,299]},{69:[1,300]},{8:ce,9:de,10:fe,12:ke,22:301,34:302,43:it},t(B,[2,40]),{6:13,7:14,8:p,9:k,10:b,11:E,12:S,21:20,23:21,24:22,25:23,26:24,27:25,28:N,33:[1,303],35:_,36:W,37:29,38:V,40:C,42:f,45:33,46:44,47:g,48:45,50:46,63:F,87:q,88:me,89:Ie,90:Fe,91:Le,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:47,117:ie,118:re,119:ne,124:He,125:Ye,126:qe,127:Qe,128:Je},{8:ce,9:de,10:fe,12:ke,22:304,34:305,43:it},t(Ze,[2,65]),{11:Be,63:Me,87:we,108:ye,110:306,111:264,112:Ne,113:Re,114:Oe,115:Ge},t(Ve,[2,148]),{15:rt,47:nt,63:at,92:ot,104:307,108:lt,109:ct,112:ht,114:pt,117:ft,118:bt,119:kt,123:97},{15:rt,47:nt,63:at,92:ot,104:308,108:lt,109:ct,112:ht,114:pt,117:ft,118:bt,119:kt,123:97},{101:[1,309]},t(X,[2,135]),t(oe,[2,71]),{31:310,70:P,83:ue,84:le,85:185,119:G,120:U,121:j},t(oe,[2,79]),t(At,l,{5:311}),{8:ce,9:de,10:fe,12:ke,22:312,43:Et},t(B,[2,41]),t(B,[2,44]),{8:ce,9:de,10:fe,12:ke,22:313,43:Et},t(E1,[2,146],{111:293,11:Be,63:Me,87:we,108:ye,112:Ne,113:Re,114:Oe,115:Ge}),t(X,[2,141],{123:181,11:[1,314],15:rt,47:nt,63:at,92:ot,108:lt,109:ct,112:ht,114:pt,117:ft,118:bt,119:kt}),t(X,[2,142],{123:181,11:[1,315],15:rt,47:nt,63:at,92:ot,108:lt,109:ct,112:ht,114:pt,117:ft,118:bt,119:kt}),t(X,[2,129]),{32:[1,316],70:P,85:237,119:G,120:U,121:j},{6:13,7:14,8:p,9:k,10:b,11:E,12:S,21:20,23:21,24:22,25:23,26:24,27:25,28:N,33:[1,317],35:_,36:W,37:29,38:V,40:C,42:f,45:33,46:44,47:g,48:45,50:46,63:F,87:q,88:me,89:Ie,90:Fe,91:Le,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:47,117:ie,118:re,119:ne,124:He,125:Ye,126:qe,127:Qe,128:Je},t(At,l,{5:318}),t(B,[2,45]),{11:Be,63:Me,87:we,95:319,108:ye,110:263,111:264,112:Ne,113:Re,114:Oe,115:Ge},{11:Be,63:Me,87:we,95:320,108:ye,110:263,111:264,112:Ne,113:Re,114:Oe,115:Ge},t(oe,[2,75]),t(B,[2,38]),{6:13,7:14,8:p,9:k,10:b,11:E,12:S,21:20,23:21,24:22,25:23,26:24,27:25,28:N,33:[1,321],35:_,36:W,37:29,38:V,40:C,42:f,45:33,46:44,47:g,48:45,50:46,63:F,87:q,88:me,89:Ie,90:Fe,91:Le,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:47,117:ie,118:re,119:ne,124:He,125:Ye,126:qe,127:Qe,128:Je},t(X,[2,139],{109:St}),t(X,[2,140],{109:St}),t(B,[2,39])],defaultActions:{},parseError:e(function(x,T){if(T.recoverable)this.trace(x);else{var v=Error(x);throw v.hash=T,v}},"parseError"),parse:e(function(x){var T=this,v=[0],c=[],H=[null],s=[],w=this.table,i="",Y=0,C1=0,S1=0,R1=2,x1=1,O1=s.slice.call(arguments,1),ae=Object.create(this.lexer),$e={yy:{}};for(var n1 in this.yy)if(Object.prototype.hasOwnProperty.call(this.yy,n1))$e.yy[n1]=this.yy[n1];if(ae.setInput(x,$e.yy),$e.yy.lexer=ae,$e.yy.parser=this,typeof ae.yylloc>"u")ae.yylloc={};var a1=ae.yylloc;s.push(a1);var P1=ae.options&&ae.options.ranges;if(typeof $e.yy.parseError==="function")this.parseError=$e.yy.parseError;else this.parseError=Object.getPrototypeOf(this).parseError;function G1(De){v.length=v.length-2*De,H.length=H.length-De,s.length=s.length-De}e(G1,"popStack");function T1(){var De=c.pop()||ae.lex()||x1;if(typeof De!=="number"){if(De instanceof Array)c=De,De=c.pop();De=T.symbols_[De]||De}return De}e(T1,"lex");var Ce,o1,et,Te,is,u1,xt={},t1,Ue,D1,s1;while(!0){if(et=v[v.length-1],this.defaultActions[et])Te=this.defaultActions[et];else{if(Ce===null||typeof Ce>"u")Ce=T1();Te=w[et]&&w[et][Ce]}if(typeof Te>"u"||!Te.length||!Te[0]){var l1="";s1=[];for(t1 in w[et])if(this.terminals_[t1]&&t1>R1)s1.push("'"+this.terminals_[t1]+"'");if(ae.showPosition)l1="Parse error on line "+(Y+1)+`:
22
+ You have to call mermaid.initialize.`)}isLinkData(t){return t!==null&&typeof t==="object"&&"id"in t&&typeof t.id==="string"}addLink(t,r,a){let o=this.isLinkData(a)?a.id.replace("@",""):void 0;n.info("addLink",t,r,o);for(let d of t)for(let h of r){let l=d===t[t.length-1],p=h===r[0];if(l&&p)this.addSingleLink(d,h,a,o);else this.addSingleLink(d,h,a,void 0)}}updateLinkInterpolate(t,r){t.forEach((a)=>{if(a==="default"){this.edges.defaultInterpolate=r;return}if(typeof a==="number"&&a>=this.edges.length)throw Error(`The index ${a} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${this.edges.length-1}. (Help: Ensure that the index is within the range of existing edges.)`);this.edges[a].interpolate=r})}updateLink(t,r){t.forEach((a)=>{if(typeof a==="number"&&a>=this.edges.length)throw Error(`The index ${a} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${this.edges.length-1}. (Help: Ensure that the index is within the range of existing edges.)`);if(a==="default")this.edges.defaultStyle=r;else if(this.edges[a].style=r,(this.edges[a]?.style?.length??0)>0&&!this.edges[a]?.style?.some((o)=>o?.startsWith("fill")))this.edges[a]?.style?.push("fill:none")})}addClass(t,r){let a=r.join().replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");t.split(",").forEach((o)=>{let d=this.classes.get(o);if(d===void 0)d={id:o,styles:[],textStyles:[]},this.classes.set(o,d);if(a!==void 0&&a!==null)a.forEach((h)=>{if(/color/.exec(h)){let l=h.replace("fill","bgFill");d.textStyles.push(l)}d.styles.push(h)})})}setDirection(t){if(this.direction=t.trim(),/.*</.exec(this.direction))this.direction="RL";if(/.*\^/.exec(this.direction))this.direction="BT";if(/.*>/.exec(this.direction))this.direction="LR";if(/.*v/.exec(this.direction))this.direction="TB";if(this.direction==="TD")this.direction="TB"}setClass(t,r){for(let a of t.split(",")){let o=this.vertices.get(a);if(o)o.classes.push(r);let d=this.edges.find((l)=>l.id===a);if(d)d.classes.push(r);let h=this.subGraphLookup.get(a);if(h)h.classes.push(r)}}setTooltip(t,r){if(r===void 0)return;r=this.sanitizeText(r);for(let a of t.split(","))this.tooltips.set(this.version==="gen-1"?this.lookUpDomId(a):a,r)}setClickFun(t,r,a){if(u().securityLevel!=="loose")return;if(r===void 0)return;let o=[];if(typeof a==="string"){o=a.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let h=0;h<o.length;h++){let l=o[h].trim();if(l.startsWith('"')&&l.endsWith('"'))l=l.substr(1,l.length-2);o[h]=l}}if(o.length===0)o.push(t);let d=this.vertices.get(t);if(d)d.haveCallback=!0,this.funs.push(()=>{let h=this.lookUpDomId(t),l=document.querySelector(`[id="${h}"]`);if(l!==null)l.addEventListener("click",()=>{z.runFunc(r,...o)},!1)})}setLink(t,r,a){t.split(",").forEach((o)=>{let d=this.vertices.get(o);if(d!==void 0)d.link=z.formatUrl(r,this.config),d.linkTarget=a}),this.setClass(t,"clickable")}getTooltip(t){return this.tooltips.get(t)}setClickEvent(t,r,a){t.split(",").forEach((o)=>{this.setClickFun(o,r,a)}),this.setClass(t,"clickable")}bindFunctions(t){this.funs.forEach((r)=>{r(t)})}getDirection(){return this.direction?.trim()}getVertices(){return this.vertices}getEdges(){return this.edges}isToolDefinition(t){return H1.has(t.type)}getTools(){let t=[];for(let r of this.vertices.values())if(this.isToolDefinition(r))t.push(r);return t}getClasses(){return this.classes}setupToolTips(t){let r=Xt();m(t).select("svg").selectAll("g.node").on("mouseover",(d)=>{let h=m(d.currentTarget),l=h.attr("title");if(l===null)return;let p=d.currentTarget?.getBoundingClientRect();r.transition().duration(200).style("opacity",".9"),r.text(h.attr("title")).style("left",window.scrollX+p.left+(p.right-p.left)/2+"px").style("top",window.scrollY+p.bottom+"px"),r.html(Pe.sanitize(l)),h.classed("hover",!0)}).on("mouseout",(d)=>{r.transition().duration(500).style("opacity",0),m(d.currentTarget).classed("hover",!1)})}clear(t="gen-2"){this.vertices=new Map,this.classes=new Map,this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.subGraphs=[],this.subGraphLookup=new Map,this.globalNodes=new Set,this.connectors=new Map,this.subCount=0,this.tooltips=new Map,this.firstGraphFlag=!0,this.version=t,this.config=u(),this.diagramId="",this.vertexCounter=0,this.direction=void 0,this.secCount=-1,this.posCrossRef=[],this.frontmatterLineOffset=0,this.elementMappings=[],this.bareVertexMappings=new WeakSet,this.diagnostics=[],this.postParseValidationRun=!1,A()}setGen(t){this.version=t||"gen-2"}defaultStyle(){return"fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;"}addSubGraph(t,r,a,o){let d=t?.text?.trim(),h=a?.text;if(t===a&&a?.text&&/\s/.exec(a.text))d=void 0;let p=e((_)=>{let W={boolean:{},number:{},string:{}},V=[],C;return{nodeList:_.filter(function(g){let F=typeof g;if(g.stmt&&g.stmt==="dir")return C=g.value,!1;if(g.trim()==="")return!1;if(F in W)return W[F].hasOwnProperty(g)?!1:W[F][g]=!0;else return V.includes(g)?!1:V.push(g)}),dir:C}},"uniq")(r.flat()),{nodeList:k,dir:b}=p,E=u().flowchart??{};if(b=b??(E.inheritDir?this.getDirection()??u().direction??void 0:void 0),this.version==="gen-1")for(let _=0;_<k.length;_++)k[_]=this.lookUpDomId(k[_]);d=d??"subGraph"+this.subCount,h=h||"",h=this.sanitizeText(h),this.subCount=this.subCount+1;let S={id:d,nodes:k.filter((_)=>_!==d&&!this.globalNodes.has(_)),title:h.trim(),classes:[],dir:b,labelType:this.sanitizeNodeLabelType(a?.type),type:o??"flow"};n.info("Adding",S.id,S.nodes,S.dir),S.nodes=this.makeUniq(S,this.subGraphs).nodes;let N=this.getPosForId(d);if(N!==-1){let _=this.subGraphs[N];for(let W of S.nodes)if(!_.nodes.includes(W))_.nodes.push(W);if(S.title)_.title=S.title;if(S.dir)_.dir=S.dir;if(S.type)_.type=S.type;this.subGraphLookup.set(d,_)}else this.subGraphs.push(S),this.subGraphLookup.set(d,S);return d}addGlobal(t){for(let r of t.flat()){if(typeof r!=="string")continue;let a=r.trim();if(a!=="")this.globalNodes.add(a)}for(let r of this.subGraphs)r.nodes=r.nodes.filter((a)=>!this.globalNodes.has(a))}getPosForId(t){for(let[r,a]of this.subGraphs.entries())if(a.id===t)return r;return-1}indexNodes2(t,r){let a=this.subGraphs[r].nodes;if(this.secCount=this.secCount+1,this.secCount>2000)return{result:!1,count:0};if(this.posCrossRef[this.secCount]=r,this.subGraphs[r].id===t)return{result:!0,count:0};let o=0,d=1;while(o<a.length){let h=this.getPosForId(a[o]);if(h>=0){let l=this.indexNodes2(t,h);if(l.result)return{result:!0,count:d+l.count};else d=d+l.count}o=o+1}return{result:!1,count:d}}getDepthFirstPos(t){return this.posCrossRef[t]}indexNodes(){if(this.secCount=-1,this.subGraphs.length>0)this.indexNodes2("none",this.subGraphs.length-1)}addConnector(t,r){let a=t?.text?.trim();if(!a)return"";let o=r?.text?.trim()??"",d=o.length>0?this.sanitizeText(o):a,h=this.connectors.get(a);if(!h)h={id:a,labelType:"text",domId:v1+a+"-"+this.vertexCounter,styles:[],classes:[],isConnector:!0,text:d},this.connectors.set(a,h),this.vertices.set(a,h),this.vertexCounter++;else if(o.length>0)h.text=d;return a}getSubGraphs(){return this.subGraphs}getConnectors(){return[...this.connectors.values()]}firstGraph(){if(this.firstGraphFlag)return this.firstGraphFlag=!1,!0;return!1}computeEdgeSemantic(t,r){if(t==="arrow_point"&&r==="normal")return"sequence";if(t==="arrow_cross"&&r==="normal")return"failure";if(t==="arrow_open"&&r==="dotted")return"reference";return}destructStartLink(t){let r=t.trim(),a="arrow_open",o="normal";if(r.includes("."))o="dotted";return{type:"arrow_open",stroke:o}}countChar(t,r){let a=r.length,o=0;for(let d=0;d<a;++d)if(r[d]===t)++o;return o}destructEndLink(t){let r=t.trim(),a=r.slice(0,-1),o="arrow_open";switch(r.slice(-1)){case"x":o="arrow_cross";break;case">":o="arrow_point";break;case"-":case".":o="arrow_open",a=r;break}let d="normal",h=a.length-1,l=this.countChar(".",a);if(l>0)d="dotted",h=l;return{type:o,stroke:d,length:h}}destructLink(t,r){let a=this.destructEndLink(t),o;if(r){if(o=this.destructStartLink(r),o.stroke!==a.stroke)return{type:"INVALID",stroke:"INVALID"};return o.type=a.type,o.length=a.length,{...o,edgeSemantic:this.computeEdgeSemantic(o.type,o.stroke)}}return{...a,edgeSemantic:this.computeEdgeSemantic(a.type,a.stroke)}}exists(t,r){for(let a of t)if(a.nodes.includes(r))return!0;return!1}makeUniq(t,r){let a=[];return t.nodes.forEach((o,d)=>{if(!this.exists(r,o))a.push(t.nodes[d])}),{nodes:a}}getTypeFromVertex(t){let r=typeof t.type==="string"?Dt(t.type):t.type;switch(r){case"square":case void 0:return"squareRect";case"round":return"roundedRect";case"ellipse":return"ellipse";default:return r}}findNode(t,r){return t.find((a)=>a.id===r)}destructEdgeType(t){let r="none",a="arrow_point";switch(t){case"arrow_point":case"arrow_circle":case"arrow_cross":case"arrow_hierarchy":a=t;break;case"double_arrow_point":case"double_arrow_circle":case"double_arrow_cross":r=t.replace("double_",""),a=r;break}return{arrowTypeStart:r,arrowTypeEnd:a}}addNodeFromVertex(t,r,a,o,d,h){let l=a.get(t.id),p=o.get(t.id)??!1,k=this.findNode(r,t.id);if(k)k.cssStyles=t.styles,k.cssCompiledStyles=this.getCompiledStyles(t.classes),k.cssClasses=t.classes.join(" ");else{let b={id:t.id,label:t.text,labelType:t.labelType,labelStyle:"",parentId:l,padding:d.flowchart?.padding||8,cssStyles:t.styles,cssCompiledStyles:this.getCompiledStyles(["default","node",...t.classes]),cssClasses:"default "+t.classes.join(" "),dir:t.dir,domId:t.domId,look:h,link:t.link,linkTarget:t.linkTarget,tooltip:this.getTooltip(t.id),metadata:t.metadata};if(p)r.push({...b,isGroup:!0,shape:"rect"});else r.push({...b,isGroup:!1,shape:this.getTypeFromVertex(t),wrappingWidth:d.agentflow?.wrappingWidth,minWidth:d.agentflow?.minNodeWidth})}}getCompiledStyles(t){let r=[];for(let a of t){let o=this.classes.get(a);if(o?.styles)r=[...r,...o.styles??[]].map((d)=>d.trim());if(o?.textStyles)r=[...r,...o.textStyles??[]].map((d)=>d.trim())}return r}runPostParseValidators(){if(this.postParseValidationRun)return;this.postParseValidationRun=!0}getData(){this.runPostParseValidators();let t=u(),r=[],a=[],o=this.getSubGraphs(),d=new Map,h=new Map,l=new Set,p=new Map,k=e((f,g,F=new Set)=>{if(F.has(f))return;F.add(f);let q=this.subGraphLookup.get(f);if(!q)return;for(let me of q.nodes){if(me===g||F.has(me))continue;l.add(me),p.set(me,g),k(me,g,F)}},"collectDescendants");for(let f of o)if(f.metadata?.view==="collapsed"&&!l.has(f.id))k(f.id,f.id);let b=e((f,g)=>{let F=new Set,q=g;while(q!==void 0&&!F.has(q)){if(q===f)return!0;F.add(q),q=d.get(q)}return!1},"wouldCloseContainmentCycle");for(let f=o.length-1;f>=0;f--){let g=o[f];if(l.has(g.id))continue;if(g.nodes.length>0)h.set(g.id,!0);for(let F of g.nodes){if(b(F,g.id)){this.emitWarning(vt.CONTAINMENT_VIOLATION,`Container "${g.id}" cannot contain "${F}" because "${F}" already contains it. The nesting that would close the loop is dropped.`,{nodeId:F});continue}d.set(F,g.id)}}for(let f=o.length-1;f>=0;f--){let g=o[f];if(l.has(g.id))continue;if(g.metadata?.view==="collapsed"){let q={...g.metadata,containerType:g.type};r.push({id:g.id,label:g.title,labelStyle:"",labelType:g.labelType,parentId:d.get(g.id),padding:8,cssCompiledStyles:this.getCompiledStyles(g.classes),cssClasses:g.classes.join(" "),shape:"collapsedGroup",dir:g.dir,isGroup:!1,look:t.look,metadata:q})}else r.push({id:g.id,label:g.title,labelStyle:"",labelType:g.labelType,parentId:d.get(g.id),padding:8,cssCompiledStyles:this.getCompiledStyles(g.classes),cssClasses:g.classes.join(" "),shape:Y1[g.type??"flow"],dir:g.dir,isGroup:!0,look:t.look,metadata:g.metadata})}this.getVertices().forEach((f)=>{if(l.has(f.id))return;this.addNodeFromVertex(f,r,d,h,t,t.look||"classic")});let S=this.getEdges();S.forEach((f,g)=>{let F=p.get(f.start)??f.start,q=p.get(f.end)??f.end;if(F===q&&f.start!==f.end)return;let{arrowTypeStart:me,arrowTypeEnd:Ie}=this.destructEdgeType(f.type),Fe=[...S.defaultStyle??[]];if(f.style)Fe.push(...f.style);let Le={id:We(F,q,{counter:g,prefix:"L"},f.id),isUserDefinedId:f.isUserDefinedId,start:F,end:q,type:f.type??"normal",label:f.text,labelType:f.labelType,labelpos:"c",thickness:f.stroke,minlen:f.length,classes:f?.stroke==="invisible"?"":"edge-thickness-normal edge-pattern-solid flowchart-link",arrowTypeStart:f?.stroke==="invisible"||f?.type==="arrow_open"?"none":me,arrowTypeEnd:f?.stroke==="invisible"||f?.type==="arrow_open"?"none":Ie,arrowheadStyle:"fill: #333",cssCompiledStyles:this.getCompiledStyles(f.classes),labelStyle:Fe,style:Fe,pattern:f.stroke,look:t.look,animate:f.animate,animation:f.animation,curve:f.interpolate||this.edges.defaultInterpolate||t.flowchart?.curve,metadata:f.metadata};a.push(Le)}),_1(r,this);let N=new Map,_=new Map;for(let f of o){let g=d.get(f.id);if(g!==void 0)_.set(g,[..._.get(g)??[],f.id])}let W=0,V=e((f)=>{if(N.has(f))return;N.set(f,W++);for(let g of _.get(f)??[])V(g)},"walkContainers");for(let f of o)if(d.get(f.id)===void 0)V(f.id);let C=new Set(this.getConnectors().map((f)=>f.id));return B1(r,(f)=>{if(C.has(f))return"connector";let g=this.vertices.get(f);return g?this.deriveVertexKind(g,Dt(g.type)):void 0},N),{nodes:r,edges:a,other:{},config:t,connectors:this.getConnectors()}}validate(){if(u().layout!=="grid")return;Ir(void 0,[...this.vertices.values(),...this.subGraphs])}defaultConfig(){return Kr.flowchart}deriveVertexKind(t,r){if(this.isToolDefinition(t))return"tool";if(r==="hexagon"||r==="hex")return"action";if(r==="lean-right"||r==="lean_right")return"input";if(r==="lin-doc"||r==="lined-document")return"refdoc";if(r==="diamond")return"decision";return"task"}getSemanticModel(){this.runPostParseValidators();let t=new Set(this.subGraphs.map((l)=>l.id)),r=[],a=[];for(let[l,p]of this.vertices){if(t.has(l))continue;if(p.isConnector){let E={id:l};if(p.text!==void 0&&p.text!==l)E.title=p.text;if(p.metadata&&Object.keys(p.metadata).length>0){let S={};for(let[N,_]of Object.entries(p.metadata)){if(c1.has(N))continue;S[N]=_}if(Object.keys(S).length>0)E.metadata=S}a.push(E);continue}let k={id:l};if(p.text!==void 0)k.label=p.text;let b=typeof p.type==="string"?Dt(p.type):p.type;if(b!==void 0)k.shape=b;if(k.vertexKind=this.deriveVertexKind(p,b),p.metadata&&Object.keys(p.metadata).length>0){let E={};for(let[S,N]of Object.entries(p.metadata)){if(c1.has(S))continue;E[S]=N}if(Object.keys(E).length>0)k.metadata=E}r.push(k)}let o=this.edges.map((l)=>{let p={start:l.start,end:l.end};if(l.id!==void 0)p.id=l.id;if(typeof l.text==="string"&&l.text.length>0)p.label=l.text;if(l.type!==void 0)p.type=l.type;if(l.stroke!==void 0)p.stroke=l.stroke;if(l.edgeSemantic!==void 0)p.edgeSemantic=l.edgeSemantic;if(l.length!==void 0)p.length=l.length;if(l.metadata&&Object.keys(l.metadata).length>0)p.metadata={...l.metadata};return p}),d=this.subGraphs.map((l)=>{let p={id:l.id,nodes:[...l.nodes]};if(l.type!==void 0)p.type=l.type;if(l.title!==void 0)p.title=l.title;if(l.dir!==void 0)p.direction=l.dir;if(l.metadata&&Object.keys(l.metadata).length>0){let k={};for(let[b,E]of Object.entries(l.metadata)){if(c1.has(b))continue;k[b]=E}if(Object.keys(k).length>0)p.metadata=k}return p}),h={vertices:r,edges:o,subGraphs:d,connectors:a,diagnostics:this.diagnostics};if(this.direction!==void 0)h.direction=this.direction;return h}setFrontmatterLineOffset(t){this.frontmatterLineOffset=t??0}toElementPosition(t){let r=t?.first_line??0,a=t?.first_column??0,o=t?.last_line??r,d=t?.last_column??a,[h,l]=t?.range??[0,0];return{startLine:r+this.frontmatterLineOffset,startColumn:a,endLine:o+this.frontmatterLineOffset,endColumn:d,startIndex:h,endIndex:l}}pushMapping(t,r,a){if(!t)return;let o={id:t,type:r,position:this.toElementPosition(a)};return this.elementMappings.push(o),o}addVertexMapping(t,r,a,o){let d=this.pushMapping(t,"vertex",o);if(d&&a==null)this.bareVertexMappings.add(d)}extendVertexMapping(t,r){if(!t||!r)return;let a=this.toElementPosition(r);for(let o=this.elementMappings.length-1;o>=0;o--){let d=this.elementMappings[o];if(d.type==="vertex"&&d.id===t){if(this.bareVertexMappings.has(d))d.type="attachment",this.bareVertexMappings.delete(d);if(a.endLine>d.position.endLine||a.endLine===d.position.endLine&&a.endColumn>d.position.endColumn)d.position.endLine=a.endLine,d.position.endColumn=a.endColumn,d.position.endIndex=a.endIndex;return}}this.pushMapping(t,"attachment",r)}addEdgeMapping(t,r,a,o){let d=Array.isArray(r)?r.map((l)=>typeof l==="string"?l:l?.id??"").filter(Boolean):[],h=d.length>0?d.join(">"):"edge";this.pushMapping(h,"edge",o)}addSubgraphMapping(t,r,a,o){let d=(typeof t==="string"?t:t?.text)??"",h=this.toElementPosition(a),l=o?this.toElementPosition(o):h;if(!d)return;this.elementMappings.push({id:d,type:"subgraph",position:{startLine:h.startLine,startColumn:h.startColumn,endLine:l.endLine,endColumn:l.endColumn,startIndex:h.startIndex,endIndex:l.endIndex}})}addConnectorMapping(t,r,a,o){let d=t?.text?.trim()??"";if(!d)return;let h=this.toElementPosition(a),l=o?this.toElementPosition(o):h;this.elementMappings.push({id:d,type:"connector",position:{startLine:h.startLine,startColumn:h.startColumn,endLine:l.endLine,endColumn:l.endColumn,startIndex:h.startIndex,endIndex:l.endIndex}})}getElementMappings(){return[...this.elementMappings]}getElementById(t){return this.elementMappings.find((r)=>r.id===t)}getElementsOnLine(t){return this.elementMappings.filter((r)=>t>=r.position.startLine&&t<=r.position.endLine)}getElementAtPosition(t,r){let a=this.elementMappings.filter((d)=>{let{startLine:h,startColumn:l,endLine:p,endColumn:k}=d.position;if(t<h||t>p)return!1;if(t===h&&r<l)return!1;if(t===p&&r>k)return!1;return!0});if(a.length===0)return;let o=e(({position:d})=>[d.endLine-d.startLine,d.endColumn-d.startColumn],"span");return a.reduce((d,h)=>{let[l,p]=o(d),[k,b]=o(h);if(k!==l)return k<l?h:d;return b<p?h:d})}getMappingStats(){let t=0,r=0,a=0,o=0,d=0;for(let h of this.elementMappings)if(h.type==="vertex")t++;else if(h.type==="edge")r++;else if(h.type==="subgraph")a++;else if(h.type==="connector")o++;else if(h.type==="attachment")d++;return{vertices:t,edges:r,subgraphs:a,connectors:o,attachments:d,totalElements:this.elementMappings.length}}emitDiagnostic(t,r,a,o){let d=o?.nodeId??o?.edgeId,h=d?this.getElementById(d):void 0,l={id:t,severity:r,message:a,...o?.nodeId?{nodeId:o.nodeId}:{},...o?.edgeId&&!o?.nodeId?{edgeId:o.edgeId}:{},...h?{position:h.position}:{}};if(this.diagnostics.some((b)=>b.id===l.id&&b.severity===l.severity&&b.message===l.message&&b.nodeId===l.nodeId&&b.edgeId===l.edgeId))return;this.diagnostics.push(l);let k=`agentflow[${t}]: ${a}`;if(r==="error")n.error(k);else n.warn(k)}emitWarning(t,r,a){this.emitDiagnostic(t,"warning",r,a)}emitError(t,r,a){this.emitDiagnostic(t,"error",r,a)}getDiagnostics(){return[...this.diagnostics]}},X1=e(function(t,r){return r.db.getClasses()},"getClasses"),Q1=e(async function(t,r,a,o){n.debug("Drawing agentflow diagram",r);let{securityLevel:d,agentflow:h,layout:l}=u();o.db.setDiagramId(r),n.debug("Before getData: ");let p=o.db.getData();n.debug("Data: ",p);let k=Ee(r,d),b=o.db.getDirection();if(p.type=o.type,p.layoutAlgorithm=_e(l),p.layoutAlgorithm==="dagre"&&l==="elk")n.warn("flowchart-elk was moved to an external package in Mermaid v11. Please refer [release notes](https://github.com/mermaid-js/mermaid/releases/tag/v11.0.0) for more details. This diagram will be rendered using `dagre` layout as a fallback.");p.direction=b,p.nodeSpacing=h?.nodeSpacing||50,p.rankSpacing=h?.rankSpacing||50,p.markers=["point","circle","cross","hierarchy"],p.diagramId=r,n.debug("REF1:",p),await Ae(p,k);let E=h?.diagramPadding??8;z.insertTitle(k,"agentflowTitleText",h?.titleTopMargin??0,o.db.getDiagramTitle()),ge(k,E,"agentflow",h?.useMaxWidth??!0)},"draw"),J1={getClasses:X1,draw:Q1},d1=function(){var t=e(function(Ke,x,T,v){for(T=T||{},v=Ke.length;v--;T[Ke[v]]=x);return T},"o"),r=[1,5],a=[1,4],o=[1,3],d=[1,6],h=[1,8,9,10,11,12,28,35,36,38,40,42,47,63,87,88,89,90,91,92,105,108,109,112,114,117,118,119,124,125,126,127,128],l=[2,2],p=[1,15],k=[1,16],b=[1,17],E=[1,18],S=[1,19],N=[1,26],_=[1,27],W=[1,28],V=[1,30],C=[1,31],f=[1,32],g=[1,55],F=[1,54],q=[1,34],me=[1,35],Ie=[1,36],Fe=[1,37],Le=[1,38],Q=[1,50],J=[1,52],Z=[1,48],ee=[1,53],te=[1,49],se=[1,56],ie=[1,51],re=[1,57],ne=[1,58],He=[1,39],Ye=[1,40],qe=[1,41],Qe=[1,42],Je=[1,43],je=[1,64],B=[1,8,9,10,11,12,28,33,35,36,38,40,42,47,63,87,88,89,90,91,92,105,108,109,112,114,117,118,119,124,125,126,127,128],ce=[1,70],de=[1,68],fe=[1,67],ke=[1,69],st=[8,9,10,12,78,80,81],it=[1,88],rt=[1,101],nt=[1,106],at=[1,105],ot=[1,102],lt=[1,98],ct=[1,104],ht=[1,100],pt=[1,107],ft=[1,103],bt=[1,108],kt=[1,99],Ze=[8,9,10,11,12,43,78,80,81],oe=[8,9,10,11,12,43,49,78,80,81],Se=[8,9,10,11,12,30,43,47,49,51,53,55,57,59,61,63,66,68,70,71,73,78,80,81,92,105,108,109,112,114,117,118,119],h1=[8,9,10,12,47,63,78,80,81,92,105,108,109,112,114,117,118,119],mt=[47,63,92,105,108,109,112,114,117,118,119],p1=[1,131],f1=[1,132],_t=[1,134],Ft=[1,133],g1=[47,63,65,77,92,105,108,109,112,114,117,118,119],Vt=[1,143],It=[1,157],Lt=[1,158],Bt=[1,159],Mt=[1,162],wt=[1,161],yt=[1,160],Nt=[1,145],Rt=[1,147],Ot=[1,151],b1=[1,139],k1=[1,140],Gt=[1,152],Ut=[1,153],jt=[1,154],zt=[1,155],Wt=[1,156],Kt=[1,163],Ht=[1,164],Yt=[1,141],qt=[1,142],Qt=[1,149],Jt=[1,144],Zt=[1,148],$t=[1,146],At=[8,9,10,11,12,28,33,35,36,38,40,42,47,63,87,88,89,90,91,92,105,108,109,112,114,117,118,119,124,125,126,127,128],m1=[1,168],Et=[1,170],X=[8,9,10,12],xe=[8,9,10,11,12,15,47,63,92,108,109,112,114,117,118,119],P=[1,190],ue=[1,186],le=[1,187],G=[1,191],U=[1,188],j=[1,189],Ct=[80,119,122],K=[8,9,10,11,12,13,15,28,30,33,35,36,43,47,63,78,87,88,89,90,91,92,93,108,112,114,117,118,119],A1=[11,109],ze=[32,52,54,56,58,60,65,67,69,70,72,74,119,120,121],Be=[1,269],Me=[1,267],we=[1,271],ye=[1,265],Ne=[1,266],Re=[1,268],Oe=[1,270],Ge=[1,272],St=[1,292],E1=[8,9,10,12,109],Ve=[8,9,10,11,12,63,87,108,109,112,113,114,115],r1={trace:e(function(){},"trace"),yy:{},symbols_:{error:2,start:3,graphConfig:4,document:5,line:6,statement:7,COMMENT:8,SEMI:9,NEWLINE:10,SPACE:11,EOF:12,GRAPH:13,NODIR:14,DIR:15,FirstStmtSeparator:16,ending:17,endToken:18,spaceList:19,spaceListNewline:20,vertexStatement:21,separator:22,styleStatement:23,linkStyleStatement:24,classDefStatement:25,classStatement:26,clickStatement:27,flow:28,textNoTags:29,SQS:30,text:31,SQE:32,end:33,shapeData:34,global:35,connector:36,direction:37,acc_title:38,acc_title_value:39,acc_descr:40,acc_descr_value:41,acc_descr_multiline_value:42,SHAPE_DATA:43,link:44,node:45,styledVertex:46,AMP:47,vertex:48,STYLE_SEPARATOR:49,idString:50,DOUBLECIRCLESTART:51,DOUBLECIRCLEEND:52,PS:53,PE:54,"(-":55,"-)":56,STADIUMSTART:57,STADIUMEND:58,SUBROUTINESTART:59,SUBROUTINEEND:60,VERTEX_WITH_PROPS_START:61,"NODE_STRING[field]":62,COLON:63,"NODE_STRING[value]":64,PIPE:65,CYLINDERSTART:66,CYLINDEREND:67,DIAMOND_START:68,DIAMOND_STOP:69,TAGEND:70,TRAPSTART:71,TRAPEND:72,INVTRAPSTART:73,INVTRAPEND:74,linkStatement:75,arrowText:76,TESTSTR:77,START_LINK:78,edgeText:79,LINK:80,LINK_ID:81,edgeTextToken:82,STR:83,MD_STR:84,textToken:85,keywords:86,STYLE:87,LINKSTYLE:88,CLASSDEF:89,CLASS:90,CLICK:91,DOWN:92,UP:93,textNoTagsToken:94,stylesOpt:95,"idString[vertex]":96,"idString[class]":97,CALLBACKNAME:98,CALLBACKARGS:99,HREF:100,LINK_TARGET:101,"STR[link]":102,"STR[tooltip]":103,alphaNum:104,DEFAULT:105,numList:106,INTERPOLATE:107,NUM:108,COMMA:109,style:110,styleComponent:111,NODE_STRING:112,UNIT:113,BRKT:114,PCT:115,idStringToken:116,MINUS:117,MULT:118,UNICODE_TEXT:119,TEXT:120,TAGSTART:121,EDGE_TEXT:122,alphaNumToken:123,direction_tb:124,direction_bt:125,direction_rl:126,direction_lr:127,direction_td:128,$accept:0,$end:1},terminals_:{2:"error",8:"COMMENT",9:"SEMI",10:"NEWLINE",11:"SPACE",12:"EOF",13:"GRAPH",14:"NODIR",15:"DIR",28:"flow",30:"SQS",32:"SQE",33:"end",35:"global",36:"connector",38:"acc_title",39:"acc_title_value",40:"acc_descr",41:"acc_descr_value",42:"acc_descr_multiline_value",43:"SHAPE_DATA",47:"AMP",49:"STYLE_SEPARATOR",51:"DOUBLECIRCLESTART",52:"DOUBLECIRCLEEND",53:"PS",54:"PE",55:"(-",56:"-)",57:"STADIUMSTART",58:"STADIUMEND",59:"SUBROUTINESTART",60:"SUBROUTINEEND",61:"VERTEX_WITH_PROPS_START",62:"NODE_STRING[field]",63:"COLON",64:"NODE_STRING[value]",65:"PIPE",66:"CYLINDERSTART",67:"CYLINDEREND",68:"DIAMOND_START",69:"DIAMOND_STOP",70:"TAGEND",71:"TRAPSTART",72:"TRAPEND",73:"INVTRAPSTART",74:"INVTRAPEND",77:"TESTSTR",78:"START_LINK",80:"LINK",81:"LINK_ID",83:"STR",84:"MD_STR",87:"STYLE",88:"LINKSTYLE",89:"CLASSDEF",90:"CLASS",91:"CLICK",92:"DOWN",93:"UP",96:"idString[vertex]",97:"idString[class]",98:"CALLBACKNAME",99:"CALLBACKARGS",100:"HREF",101:"LINK_TARGET",102:"STR[link]",103:"STR[tooltip]",105:"DEFAULT",107:"INTERPOLATE",108:"NUM",109:"COMMA",112:"NODE_STRING",113:"UNIT",114:"BRKT",115:"PCT",117:"MINUS",118:"MULT",119:"UNICODE_TEXT",120:"TEXT",121:"TAGSTART",122:"EDGE_TEXT",124:"direction_tb",125:"direction_bt",126:"direction_rl",127:"direction_lr",128:"direction_td"},productions_:[0,[3,2],[5,0],[5,2],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[4,2],[4,2],[4,2],[4,2],[4,3],[17,2],[17,1],[18,1],[18,1],[18,1],[16,1],[16,1],[16,2],[16,1],[20,2],[20,2],[20,2],[20,1],[20,1],[20,1],[19,2],[19,1],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,9],[7,10],[7,6],[7,7],[7,4],[7,4],[7,7],[7,8],[7,4],[7,5],[7,1],[7,2],[7,2],[7,1],[22,1],[22,1],[22,1],[22,1],[34,2],[34,1],[21,4],[21,3],[21,4],[21,2],[21,2],[21,1],[45,1],[45,6],[45,5],[46,1],[46,3],[48,4],[48,4],[48,6],[48,4],[48,4],[48,4],[48,8],[48,4],[48,4],[48,4],[48,6],[48,4],[48,4],[48,4],[48,4],[48,4],[48,1],[44,2],[44,3],[44,3],[44,1],[44,3],[44,4],[79,1],[79,2],[79,1],[79,1],[75,1],[75,2],[76,3],[31,1],[31,2],[31,1],[31,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[29,1],[29,2],[29,1],[29,1],[25,5],[26,5],[27,2],[27,4],[27,3],[27,5],[27,3],[27,5],[27,5],[27,7],[27,2],[27,4],[27,2],[27,4],[27,4],[27,6],[23,5],[24,5],[24,5],[24,9],[24,9],[24,7],[24,7],[106,1],[106,3],[95,1],[95,3],[110,1],[110,2],[111,1],[111,1],[111,1],[111,1],[111,1],[111,1],[111,1],[111,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[85,1],[85,1],[85,1],[85,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[82,1],[82,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[50,1],[50,2],[104,1],[104,2],[37,1],[37,1],[37,1],[37,1],[37,1]],performAction:e(function(x,T,v,c,H,s,w){var i=s.length-1;switch(H){case 2:this.$=[];break;case 3:if(!Array.isArray(s[i])||s[i].length>0)s[i-1].push(s[i]);this.$=s[i-1];break;case 4:case 198:this.$=s[i];break;case 5:case 33:case 34:case 35:case 36:case 37:this.$=[];break;case 13:c.setDirection("TB"),this.$="TB";break;case 14:c.setDirection(s[i-1]),this.$=s[i-1];break;case 32:this.$=s[i-1].nodes;break;case 38:if(this.$=c.addSubGraph(s[i-6],s[i-1],s[i-4],"flow"),c.addSubgraphMapping)c.addSubgraphMapping(s[i-6],s[i-4],w[i-8],w[i]);break;case 39:if(this.$=c.addSubGraph(s[i-7],s[i-1],s[i-5],"flow"),c.addVertex(this.$,void 0,void 0,void 0,void 0,void 0,void 0,s[i-3],w[i-3]),c.addSubgraphMapping)c.addSubgraphMapping(s[i-7],s[i-5],w[i-9],w[i]);break;case 40:if(this.$=c.addSubGraph(s[i-3],s[i-1],{text:"",type:"text"},"flow"),c.addSubgraphMapping)c.addSubgraphMapping(s[i-3],{text:"",type:"text"},w[i-5],w[i]);break;case 41:if(this.$=c.addSubGraph(s[i-4],s[i-1],{text:"",type:"text"},"flow"),c.addVertex(this.$,void 0,void 0,void 0,void 0,void 0,void 0,s[i-3],w[i-3]),c.addSubgraphMapping)c.addSubgraphMapping(s[i-4],{text:"",type:"text"},w[i-6],w[i]);break;case 42:if(this.$=c.addSubGraph(void 0,s[i-1],void 0,"flow"),c.addSubgraphMapping)c.addSubgraphMapping(void 0,void 0,w[i-3],w[i]);break;case 43:c.addGlobal(s[i-1]),this.$=[];break;case 44:if(this.$=c.addConnector(s[i-4],s[i-2]),c.addConnectorMapping)c.addConnectorMapping(s[i-4],s[i-2],w[i-6],w[i]);break;case 45:if(this.$=c.addConnector(s[i-5],s[i-3]),c.addVertex(this.$,void 0,void 0,void 0,void 0,void 0,void 0,s[i-1],w[i-1]),c.addConnectorMapping)c.addConnectorMapping(s[i-5],s[i-3],w[i-7],w[i]);break;case 46:if(this.$=c.addConnector(s[i-1],{text:"",type:"text"}),c.addConnectorMapping)c.addConnectorMapping(s[i-1],{text:"",type:"text"},w[i-3],w[i]);break;case 47:if(this.$=c.addConnector(s[i-2],{text:"",type:"text"}),c.addVertex(this.$,void 0,void 0,void 0,void 0,void 0,void 0,s[i-1],w[i-1]),c.addConnectorMapping)c.addConnectorMapping(s[i-2],{text:"",type:"text"},w[i-4],w[i]);break;case 49:this.$=s[i].trim(),c.setAccTitle(this.$);break;case 50:case 51:this.$=s[i].trim(),c.setAccDescription(this.$);break;case 56:this.$=s[i-1]+s[i];break;case 57:this.$=s[i];break;case 58:if(c.addVertex(s[i-1][s[i-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,s[i],w[i]),c.extendVertexMapping)c.extendVertexMapping(s[i-1][s[i-1].length-1],w[i]);if(c.addLink(s[i-3].stmt,s[i-1],s[i-2]),c.addEdgeMapping)c.addEdgeMapping(s[i-3].stmt,s[i-1],s[i-2],this._$);this.$={stmt:s[i-1],nodes:s[i-1].concat(s[i-3].nodes)};break;case 59:if(c.addLink(s[i-2].stmt,s[i],s[i-1]),c.addEdgeMapping)c.addEdgeMapping(s[i-2].stmt,s[i],s[i-1],this._$);this.$={stmt:s[i],nodes:s[i].concat(s[i-2].nodes)};break;case 60:if(c.addLink(s[i-3].stmt,s[i-1],s[i-2]),c.addEdgeMapping)c.addEdgeMapping(s[i-3].stmt,s[i-1],s[i-2],this._$);this.$={stmt:s[i-1],nodes:s[i-1].concat(s[i-3].nodes)};break;case 61:this.$={stmt:s[i-1],nodes:s[i-1]};break;case 62:if(c.addVertex(s[i-1][s[i-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,s[i],w[i]),c.extendVertexMapping)c.extendVertexMapping(s[i-1][s[i-1].length-1],w[i]);this.$={stmt:s[i-1],nodes:s[i-1],shapeData:s[i]};break;case 63:this.$={stmt:s[i],nodes:s[i]};break;case 64:this.$=[s[i]];break;case 65:if(c.addVertex(s[i-5][s[i-5].length-1],void 0,void 0,void 0,void 0,void 0,void 0,s[i-4],w[i-4]),c.extendVertexMapping)c.extendVertexMapping(s[i-5][s[i-5].length-1],w[i-4]);this.$=s[i-5].concat(s[i]);break;case 66:this.$=s[i-4].concat(s[i]);break;case 67:this.$=s[i];break;case 68:this.$=s[i-2],c.setClass(s[i-2],s[i]);break;case 69:if(this.$=s[i-3],c.addVertex(s[i-3],s[i-1],"square"),c.addVertexMapping)c.addVertexMapping(s[i-3],s[i-1],"square",this._$);break;case 70:if(this.$=s[i-3],c.addVertex(s[i-3],s[i-1],"doublecircle"),c.addVertexMapping)c.addVertexMapping(s[i-3],s[i-1],"doublecircle",this._$);break;case 71:if(this.$=s[i-5],c.addVertex(s[i-5],s[i-2],"circle"),c.addVertexMapping)c.addVertexMapping(s[i-5],s[i-2],"circle",this._$);break;case 72:if(this.$=s[i-3],c.addVertex(s[i-3],s[i-1],"ellipse"),c.addVertexMapping)c.addVertexMapping(s[i-3],s[i-1],"ellipse",this._$);break;case 73:if(this.$=s[i-3],c.addVertex(s[i-3],s[i-1],"stadium"),c.addVertexMapping)c.addVertexMapping(s[i-3],s[i-1],"stadium",this._$);break;case 74:if(this.$=s[i-3],c.addVertex(s[i-3],s[i-1],"subroutine"),c.addVertexMapping)c.addVertexMapping(s[i-3],s[i-1],"subroutine",this._$);break;case 75:if(this.$=s[i-7],c.addVertex(s[i-7],s[i-1],"rect",void 0,void 0,void 0,Object.fromEntries([[s[i-5],s[i-3]]])),c.addVertexMapping)c.addVertexMapping(s[i-7],s[i-1],"rect",this._$);break;case 76:if(this.$=s[i-3],c.addVertex(s[i-3],s[i-1],"cylinder"),c.addVertexMapping)c.addVertexMapping(s[i-3],s[i-1],"cylinder",this._$);break;case 77:if(this.$=s[i-3],c.addVertex(s[i-3],s[i-1],"round"),c.addVertexMapping)c.addVertexMapping(s[i-3],s[i-1],"round",this._$);break;case 78:if(this.$=s[i-3],c.addVertex(s[i-3],s[i-1],"diamond"),c.addVertexMapping)c.addVertexMapping(s[i-3],s[i-1],"diamond",this._$);break;case 79:if(this.$=s[i-5],c.addVertex(s[i-5],s[i-2],"hexagon"),c.addVertexMapping)c.addVertexMapping(s[i-5],s[i-2],"hexagon",this._$);break;case 80:if(this.$=s[i-3],c.addVertex(s[i-3],s[i-1],"odd"),c.addVertexMapping)c.addVertexMapping(s[i-3],s[i-1],"odd",this._$);break;case 81:if(this.$=s[i-3],c.addVertex(s[i-3],s[i-1],"trapezoid"),c.addVertexMapping)c.addVertexMapping(s[i-3],s[i-1],"trapezoid",this._$);break;case 82:if(this.$=s[i-3],c.addVertex(s[i-3],s[i-1],"inv_trapezoid"),c.addVertexMapping)c.addVertexMapping(s[i-3],s[i-1],"inv_trapezoid",this._$);break;case 83:if(this.$=s[i-3],c.addVertex(s[i-3],s[i-1],"lean_right"),c.addVertexMapping)c.addVertexMapping(s[i-3],s[i-1],"lean_right",this._$);break;case 84:if(this.$=s[i-3],c.addVertex(s[i-3],s[i-1],"lean_left"),c.addVertexMapping)c.addVertexMapping(s[i-3],s[i-1],"lean_left",this._$);break;case 85:if(this.$=s[i],c.addVertex(s[i]),c.addVertexMapping)c.addVertexMapping(s[i],void 0,void 0,this._$);break;case 86:s[i-1].text=s[i],this.$=s[i-1];break;case 87:case 88:s[i-2].text=s[i-1],this.$=s[i-2];break;case 89:this.$=s[i];break;case 90:var Y=c.destructLink(s[i],s[i-2]);this.$={type:Y.type,stroke:Y.stroke,length:Y.length,edgeSemantic:Y.edgeSemantic,text:s[i-1]};break;case 91:var Y=c.destructLink(s[i],s[i-2]);this.$={type:Y.type,stroke:Y.stroke,length:Y.length,edgeSemantic:Y.edgeSemantic,text:s[i-1],id:s[i-3]};break;case 92:this.$={text:s[i],type:"text"};break;case 93:this.$={text:s[i-1].text+""+s[i],type:s[i-1].type};break;case 94:this.$={text:s[i],type:"string"};break;case 95:this.$={text:s[i],type:"markdown"};break;case 96:var Y=c.destructLink(s[i]);this.$={type:Y.type,stroke:Y.stroke,length:Y.length,edgeSemantic:Y.edgeSemantic};break;case 97:var Y=c.destructLink(s[i]);this.$={type:Y.type,stroke:Y.stroke,length:Y.length,edgeSemantic:Y.edgeSemantic,id:s[i-1]};break;case 98:this.$=s[i-1];break;case 99:this.$={text:s[i],type:"text"};break;case 100:this.$={text:s[i-1].text+""+s[i],type:s[i-1].type};break;case 101:this.$={text:s[i],type:"string"};break;case 102:case 119:this.$={text:s[i],type:"markdown"};break;case 116:this.$={text:s[i],type:"text"};break;case 117:this.$={text:s[i-1].text+""+s[i],type:s[i-1].type};break;case 118:this.$={text:s[i],type:"text"};break;case 120:this.$=s[i-4],c.addClass(s[i-2],s[i]);break;case 121:this.$=s[i-4],c.setClass(s[i-2],s[i]);break;case 122:case 130:this.$=s[i-1],c.setClickEvent(s[i-1],s[i]);break;case 123:case 131:this.$=s[i-3],c.setClickEvent(s[i-3],s[i-2]),c.setTooltip(s[i-3],s[i]);break;case 124:this.$=s[i-2],c.setClickEvent(s[i-2],s[i-1],s[i]);break;case 125:this.$=s[i-4],c.setClickEvent(s[i-4],s[i-3],s[i-2]),c.setTooltip(s[i-4],s[i]);break;case 126:this.$=s[i-2],c.setLink(s[i-2],s[i]);break;case 127:this.$=s[i-4],c.setLink(s[i-4],s[i-2]),c.setTooltip(s[i-4],s[i]);break;case 128:this.$=s[i-4],c.setLink(s[i-4],s[i-2],s[i]);break;case 129:this.$=s[i-6],c.setLink(s[i-6],s[i-4],s[i]),c.setTooltip(s[i-6],s[i-2]);break;case 132:this.$=s[i-1],c.setLink(s[i-1],s[i]);break;case 133:this.$=s[i-3],c.setLink(s[i-3],s[i-2]),c.setTooltip(s[i-3],s[i]);break;case 134:this.$=s[i-3],c.setLink(s[i-3],s[i-2],s[i]);break;case 135:this.$=s[i-5],c.setLink(s[i-5],s[i-4],s[i]),c.setTooltip(s[i-5],s[i-2]);break;case 136:this.$=s[i-4],c.addVertex(s[i-2],void 0,void 0,s[i]);break;case 137:this.$=s[i-4],c.updateLink([s[i-2]],s[i]);break;case 138:this.$=s[i-4],c.updateLink(s[i-2],s[i]);break;case 139:this.$=s[i-8],c.updateLinkInterpolate([s[i-6]],s[i-2]),c.updateLink([s[i-6]],s[i]);break;case 140:this.$=s[i-8],c.updateLinkInterpolate(s[i-6],s[i-2]),c.updateLink(s[i-6],s[i]);break;case 141:this.$=s[i-6],c.updateLinkInterpolate([s[i-4]],s[i]);break;case 142:this.$=s[i-6],c.updateLinkInterpolate(s[i-4],s[i]);break;case 143:case 145:this.$=[s[i]];break;case 144:case 146:s[i-2].push(s[i]),this.$=s[i-2];break;case 148:this.$=s[i-1]+s[i];break;case 196:this.$=s[i];break;case 197:this.$=s[i-1]+""+s[i];break;case 199:this.$=s[i-1]+""+s[i];break;case 200:this.$={stmt:"dir",value:"TB"};break;case 201:this.$={stmt:"dir",value:"BT"};break;case 202:this.$={stmt:"dir",value:"RL"};break;case 203:this.$={stmt:"dir",value:"LR"};break;case 204:this.$={stmt:"dir",value:"TD"};break}},"anonymous"),table:[{3:1,4:2,8:r,10:a,11:o,13:d},{1:[3]},t(h,l,{5:7}),{4:8,8:r,10:a,11:o,13:d},{4:9,8:r,10:a,11:o,13:d},{4:10,8:r,10:a,11:o,13:d},{14:[1,11],15:[1,12]},{1:[2,1],6:13,7:14,8:p,9:k,10:b,11:E,12:S,21:20,23:21,24:22,25:23,26:24,27:25,28:N,35:_,36:W,37:29,38:V,40:C,42:f,45:33,46:44,47:g,48:45,50:46,63:F,87:q,88:me,89:Ie,90:Fe,91:Le,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:47,117:ie,118:re,119:ne,124:He,125:Ye,126:qe,127:Qe,128:Je},t(h,[2,10]),t(h,[2,11]),t(h,[2,12]),t(h,[2,13]),{8:[1,63],9:[1,60],10:[1,61],11:je,16:59,19:62},t(B,[2,3]),t(B,[2,4]),t(B,[2,5]),t(B,[2,6]),t(B,[2,7]),t(B,[2,8]),t(B,[2,9]),{8:ce,9:de,10:fe,12:ke,22:65,44:66,75:71,78:[1,72],80:[1,74],81:[1,73]},{8:ce,9:de,10:fe,12:ke,22:75},{8:ce,9:de,10:fe,12:ke,22:76},{8:ce,9:de,10:fe,12:ke,22:77},{8:ce,9:de,10:fe,12:ke,22:78},{8:ce,9:de,10:fe,12:ke,22:79},{8:ce,9:de,10:fe,11:[1,80],12:ke,22:81},{8:ce,9:de,10:fe,12:ke,22:82},{11:[1,83]},t(B,[2,48]),{39:[1,84]},{41:[1,85]},t(B,[2,51]),t(st,[2,63],{19:86,34:87,11:je,43:it}),{11:[1,89]},{11:[1,90]},{11:[1,91]},{11:[1,92]},{15:rt,47:nt,63:at,83:[1,96],92:ot,98:[1,93],100:[1,94],104:95,108:lt,109:ct,112:ht,114:pt,117:ft,118:bt,119:kt,123:97},t(B,[2,200]),t(B,[2,201]),t(B,[2,202]),t(B,[2,203]),t(B,[2,204]),t(Ze,[2,64]),t(Ze,[2,67],{49:[1,109]}),t(oe,[2,85],{116:122,30:[1,110],47:g,51:[1,111],53:[1,112],55:[1,113],57:[1,114],59:[1,115],61:[1,116],63:F,66:[1,117],68:[1,118],70:[1,119],71:[1,120],73:[1,121],92:Q,105:J,108:Z,109:ee,112:te,114:se,117:ie,118:re,119:ne}),t(Se,[2,196]),t(Se,[2,157]),t(Se,[2,158]),t(Se,[2,159]),t(Se,[2,160]),t(Se,[2,161]),t(Se,[2,162]),t(Se,[2,163]),t(Se,[2,164]),t(Se,[2,165]),t(Se,[2,166]),t(Se,[2,167]),t(h,[2,14]),t(h,[2,20]),t(h,[2,21]),{10:[1,123]},t(h,[2,23]),t(h1,[2,31],{19:124,11:je}),t(B,[2,32]),{45:125,46:44,47:g,48:45,50:46,63:F,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:47,117:ie,118:re,119:ne},t(B,[2,52]),t(B,[2,53]),t(B,[2,54]),t(B,[2,55]),t(mt,[2,89],{76:126,65:[1,128],77:[1,127]}),{79:129,82:130,83:p1,84:f1,119:_t,122:Ft},{78:[1,135],80:[1,136]},t(g1,[2,96]),t(B,[2,33]),t(B,[2,34]),t(B,[2,35]),t(B,[2,36]),t(B,[2,37]),{11:Vt,13:It,15:Lt,28:Bt,29:137,33:Mt,35:wt,36:yt,47:Nt,63:Rt,78:Ot,83:b1,84:k1,86:150,87:Gt,88:Ut,89:jt,90:zt,91:Wt,92:Kt,93:Ht,94:138,108:Yt,112:qt,114:Qt,117:Jt,118:Zt,119:$t},t(At,l,{5:165}),t(At,l,{5:166}),{11:Vt,13:It,15:Lt,28:Bt,29:167,33:Mt,35:wt,36:yt,47:Nt,63:Rt,78:Ot,83:b1,84:k1,86:150,87:Gt,88:Ut,89:jt,90:zt,91:Wt,92:Kt,93:Ht,94:138,108:Yt,112:qt,114:Qt,117:Jt,118:Zt,119:$t},t(B,[2,49]),t(B,[2,50]),t(st,[2,61],{47:m1}),t(st,[2,62],{19:169,11:je,43:Et}),t(Ze,[2,57]),{47:g,50:171,63:F,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:47,117:ie,118:re,119:ne},{105:[1,172],106:173,108:[1,174]},{47:g,50:175,63:F,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:47,117:ie,118:re,119:ne},{47:g,50:176,63:F,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:47,117:ie,118:re,119:ne},t(X,[2,122],{11:[1,177],99:[1,178]}),{83:[1,179]},t(X,[2,130],{123:181,11:[1,180],15:rt,47:nt,63:at,92:ot,108:lt,109:ct,112:ht,114:pt,117:ft,118:bt,119:kt}),t(X,[2,132],{11:[1,182]}),t(xe,[2,198]),t(xe,[2,185]),t(xe,[2,186]),t(xe,[2,187]),t(xe,[2,188]),t(xe,[2,189]),t(xe,[2,190]),t(xe,[2,191]),t(xe,[2,192]),t(xe,[2,193]),t(xe,[2,194]),t(xe,[2,195]),{47:g,50:183,63:F,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:47,117:ie,118:re,119:ne},{31:184,70:P,83:ue,84:le,85:185,119:G,120:U,121:j},{31:192,70:P,83:ue,84:le,85:185,119:G,120:U,121:j},{31:194,53:[1,193],70:P,83:ue,84:le,85:185,119:G,120:U,121:j},{31:195,70:P,83:ue,84:le,85:185,119:G,120:U,121:j},{31:196,70:P,83:ue,84:le,85:185,119:G,120:U,121:j},{31:197,70:P,83:ue,84:le,85:185,119:G,120:U,121:j},{112:[1,198]},{31:199,70:P,83:ue,84:le,85:185,119:G,120:U,121:j},{31:200,68:[1,201],70:P,83:ue,84:le,85:185,119:G,120:U,121:j},{31:202,70:P,83:ue,84:le,85:185,119:G,120:U,121:j},{31:203,70:P,83:ue,84:le,85:185,119:G,120:U,121:j},{31:204,70:P,83:ue,84:le,85:185,119:G,120:U,121:j},t(Se,[2,197]),t(h,[2,22]),t(h1,[2,30]),t(st,[2,59],{34:205,19:206,11:je,43:it}),t(mt,[2,86],{11:[1,207]}),{11:[1,208]},{31:209,70:P,83:ue,84:le,85:185,119:G,120:U,121:j},{80:[1,210],82:211,119:_t,122:Ft},t(Ct,[2,92]),t(Ct,[2,94]),t(Ct,[2,95]),t(Ct,[2,183]),t(Ct,[2,184]),{79:212,82:130,83:p1,84:f1,119:_t,122:Ft},t(g1,[2,97]),{8:ce,9:de,10:fe,11:Vt,12:ke,13:It,15:Lt,22:214,28:Bt,30:[1,213],33:Mt,34:215,35:wt,36:yt,43:it,47:Nt,63:Rt,78:Ot,86:150,87:Gt,88:Ut,89:jt,90:zt,91:Wt,92:Kt,93:Ht,94:216,108:Yt,112:qt,114:Qt,117:Jt,118:Zt,119:$t},t(K,[2,116]),t(K,[2,118]),t(K,[2,119]),t(K,[2,172]),t(K,[2,173]),t(K,[2,174]),t(K,[2,175]),t(K,[2,176]),t(K,[2,177]),t(K,[2,178]),t(K,[2,179]),t(K,[2,180]),t(K,[2,181]),t(K,[2,182]),t(K,[2,103]),t(K,[2,104]),t(K,[2,105]),t(K,[2,106]),t(K,[2,107]),t(K,[2,108]),t(K,[2,109]),t(K,[2,110]),t(K,[2,111]),t(K,[2,112]),t(K,[2,113]),t(K,[2,114]),t(K,[2,115]),{6:13,7:14,8:p,9:k,10:b,11:E,12:S,21:20,23:21,24:22,25:23,26:24,27:25,28:N,33:[1,217],35:_,36:W,37:29,38:V,40:C,42:f,45:33,46:44,47:g,48:45,50:46,63:F,87:q,88:me,89:Ie,90:Fe,91:Le,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:47,117:ie,118:re,119:ne,124:He,125:Ye,126:qe,127:Qe,128:Je},{6:13,7:14,8:p,9:k,10:b,11:E,12:S,21:20,23:21,24:22,25:23,26:24,27:25,28:N,33:[1,218],35:_,36:W,37:29,38:V,40:C,42:f,45:33,46:44,47:g,48:45,50:46,63:F,87:q,88:me,89:Ie,90:Fe,91:Le,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:47,117:ie,118:re,119:ne,124:He,125:Ye,126:qe,127:Qe,128:Je},{8:ce,9:de,10:fe,11:Vt,12:ke,13:It,15:Lt,22:220,28:Bt,30:[1,219],33:Mt,34:221,35:wt,36:yt,43:it,47:Nt,63:Rt,78:Ot,86:150,87:Gt,88:Ut,89:jt,90:zt,91:Wt,92:Kt,93:Ht,94:216,108:Yt,112:qt,114:Qt,117:Jt,118:Zt,119:$t},{11:je,19:222},{47:[1,223]},t(Ze,[2,56]),{11:[1,224],47:g,63:F,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:122,117:ie,118:re,119:ne},{11:[1,225]},{11:[1,226],109:[1,227]},t(A1,[2,143]),{11:[1,228],47:g,63:F,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:122,117:ie,118:re,119:ne},{11:[1,229],47:g,63:F,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:122,117:ie,118:re,119:ne},{83:[1,230]},t(X,[2,124],{11:[1,231]}),t(X,[2,126],{11:[1,232]}),{83:[1,233]},t(xe,[2,199]),{83:[1,234],101:[1,235]},t(Ze,[2,68],{116:122,47:g,63:F,92:Q,105:J,108:Z,109:ee,112:te,114:se,117:ie,118:re,119:ne}),{32:[1,236],70:P,85:237,119:G,120:U,121:j},t(ze,[2,99]),t(ze,[2,101]),t(ze,[2,102]),t(ze,[2,168]),t(ze,[2,169]),t(ze,[2,170]),t(ze,[2,171]),{52:[1,238],70:P,85:237,119:G,120:U,121:j},{31:239,70:P,83:ue,84:le,85:185,119:G,120:U,121:j},{54:[1,240],70:P,85:237,119:G,120:U,121:j},{56:[1,241],70:P,85:237,119:G,120:U,121:j},{58:[1,242],70:P,85:237,119:G,120:U,121:j},{60:[1,243],70:P,85:237,119:G,120:U,121:j},{63:[1,244]},{67:[1,245],70:P,85:237,119:G,120:U,121:j},{69:[1,246],70:P,85:237,119:G,120:U,121:j},{31:247,70:P,83:ue,84:le,85:185,119:G,120:U,121:j},{32:[1,248],70:P,85:237,119:G,120:U,121:j},{70:P,72:[1,249],74:[1,250],85:237,119:G,120:U,121:j},{70:P,72:[1,252],74:[1,251],85:237,119:G,120:U,121:j},t(st,[2,58],{19:169,11:je,43:Et}),t(st,[2,60],{47:m1}),t(mt,[2,88]),t(mt,[2,87]),{65:[1,253],70:P,85:237,119:G,120:U,121:j},t(mt,[2,90]),t(Ct,[2,93]),{80:[1,254],82:211,119:_t,122:Ft},{31:255,70:P,83:ue,84:le,85:185,119:G,120:U,121:j},t(At,l,{5:256}),{8:ce,9:de,10:fe,12:ke,22:257,43:Et},t(K,[2,117]),t(B,[2,42]),t(B,[2,43]),{31:258,70:P,83:ue,84:le,85:185,119:G,120:U,121:j},t(B,[2,46]),{8:ce,9:de,10:fe,12:ke,22:259,43:Et},{46:260,47:g,48:45,50:46,63:F,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:47,117:ie,118:re,119:ne},{11:je,19:261},{11:Be,63:Me,87:we,95:262,108:ye,110:263,111:264,112:Ne,113:Re,114:Oe,115:Ge},{11:Be,63:Me,87:we,95:273,107:[1,274],108:ye,110:263,111:264,112:Ne,113:Re,114:Oe,115:Ge},{11:Be,63:Me,87:we,95:275,107:[1,276],108:ye,110:263,111:264,112:Ne,113:Re,114:Oe,115:Ge},{108:[1,277]},{11:Be,63:Me,87:we,95:278,108:ye,110:263,111:264,112:Ne,113:Re,114:Oe,115:Ge},{47:g,50:279,63:F,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:47,117:ie,118:re,119:ne},t(X,[2,123]),{83:[1,280]},{83:[1,281],101:[1,282]},t(X,[2,131]),t(X,[2,133],{11:[1,283]}),t(X,[2,134]),t(oe,[2,69]),t(ze,[2,100]),t(oe,[2,70]),{54:[1,284],70:P,85:237,119:G,120:U,121:j},t(oe,[2,77]),t(oe,[2,72]),t(oe,[2,73]),t(oe,[2,74]),{112:[1,285]},t(oe,[2,76]),t(oe,[2,78]),{69:[1,286],70:P,85:237,119:G,120:U,121:j},t(oe,[2,80]),t(oe,[2,81]),t(oe,[2,83]),t(oe,[2,82]),t(oe,[2,84]),t([11,47,63,92,105,108,109,112,114,117,118,119],[2,98]),t(mt,[2,91]),{32:[1,287],70:P,85:237,119:G,120:U,121:j},{6:13,7:14,8:p,9:k,10:b,11:E,12:S,21:20,23:21,24:22,25:23,26:24,27:25,28:N,33:[1,288],35:_,36:W,37:29,38:V,40:C,42:f,45:33,46:44,47:g,48:45,50:46,63:F,87:q,88:me,89:Ie,90:Fe,91:Le,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:47,117:ie,118:re,119:ne,124:He,125:Ye,126:qe,127:Qe,128:Je},t(At,l,{5:289}),{32:[1,290],70:P,85:237,119:G,120:U,121:j},t(B,[2,47]),t(Ze,[2,66]),{46:291,47:g,48:45,50:46,63:F,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:47,117:ie,118:re,119:ne},t(X,[2,136],{109:St}),t(E1,[2,145],{111:293,11:Be,63:Me,87:we,108:ye,112:Ne,113:Re,114:Oe,115:Ge}),t(Ve,[2,147]),t(Ve,[2,149]),t(Ve,[2,150]),t(Ve,[2,151]),t(Ve,[2,152]),t(Ve,[2,153]),t(Ve,[2,154]),t(Ve,[2,155]),t(Ve,[2,156]),t(X,[2,137],{109:St}),{11:[1,294]},t(X,[2,138],{109:St}),{11:[1,295]},t(A1,[2,144]),t(X,[2,120],{109:St}),t(X,[2,121],{116:122,47:g,63:F,92:Q,105:J,108:Z,109:ee,112:te,114:se,117:ie,118:re,119:ne}),t(X,[2,125]),t(X,[2,127],{11:[1,296]}),t(X,[2,128]),{101:[1,297]},{54:[1,298]},{65:[1,299]},{69:[1,300]},{8:ce,9:de,10:fe,12:ke,22:301,34:302,43:it},t(B,[2,40]),{6:13,7:14,8:p,9:k,10:b,11:E,12:S,21:20,23:21,24:22,25:23,26:24,27:25,28:N,33:[1,303],35:_,36:W,37:29,38:V,40:C,42:f,45:33,46:44,47:g,48:45,50:46,63:F,87:q,88:me,89:Ie,90:Fe,91:Le,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:47,117:ie,118:re,119:ne,124:He,125:Ye,126:qe,127:Qe,128:Je},{8:ce,9:de,10:fe,12:ke,22:304,34:305,43:it},t(Ze,[2,65]),{11:Be,63:Me,87:we,108:ye,110:306,111:264,112:Ne,113:Re,114:Oe,115:Ge},t(Ve,[2,148]),{15:rt,47:nt,63:at,92:ot,104:307,108:lt,109:ct,112:ht,114:pt,117:ft,118:bt,119:kt,123:97},{15:rt,47:nt,63:at,92:ot,104:308,108:lt,109:ct,112:ht,114:pt,117:ft,118:bt,119:kt,123:97},{101:[1,309]},t(X,[2,135]),t(oe,[2,71]),{31:310,70:P,83:ue,84:le,85:185,119:G,120:U,121:j},t(oe,[2,79]),t(At,l,{5:311}),{8:ce,9:de,10:fe,12:ke,22:312,43:Et},t(B,[2,41]),t(B,[2,44]),{8:ce,9:de,10:fe,12:ke,22:313,43:Et},t(E1,[2,146],{111:293,11:Be,63:Me,87:we,108:ye,112:Ne,113:Re,114:Oe,115:Ge}),t(X,[2,141],{123:181,11:[1,314],15:rt,47:nt,63:at,92:ot,108:lt,109:ct,112:ht,114:pt,117:ft,118:bt,119:kt}),t(X,[2,142],{123:181,11:[1,315],15:rt,47:nt,63:at,92:ot,108:lt,109:ct,112:ht,114:pt,117:ft,118:bt,119:kt}),t(X,[2,129]),{32:[1,316],70:P,85:237,119:G,120:U,121:j},{6:13,7:14,8:p,9:k,10:b,11:E,12:S,21:20,23:21,24:22,25:23,26:24,27:25,28:N,33:[1,317],35:_,36:W,37:29,38:V,40:C,42:f,45:33,46:44,47:g,48:45,50:46,63:F,87:q,88:me,89:Ie,90:Fe,91:Le,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:47,117:ie,118:re,119:ne,124:He,125:Ye,126:qe,127:Qe,128:Je},t(At,l,{5:318}),t(B,[2,45]),{11:Be,63:Me,87:we,95:319,108:ye,110:263,111:264,112:Ne,113:Re,114:Oe,115:Ge},{11:Be,63:Me,87:we,95:320,108:ye,110:263,111:264,112:Ne,113:Re,114:Oe,115:Ge},t(oe,[2,75]),t(B,[2,38]),{6:13,7:14,8:p,9:k,10:b,11:E,12:S,21:20,23:21,24:22,25:23,26:24,27:25,28:N,33:[1,321],35:_,36:W,37:29,38:V,40:C,42:f,45:33,46:44,47:g,48:45,50:46,63:F,87:q,88:me,89:Ie,90:Fe,91:Le,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:47,117:ie,118:re,119:ne,124:He,125:Ye,126:qe,127:Qe,128:Je},t(X,[2,139],{109:St}),t(X,[2,140],{109:St}),t(B,[2,39])],defaultActions:{},parseError:e(function(x,T){if(T.recoverable)this.trace(x);else{var v=Error(x);throw v.hash=T,v}},"parseError"),parse:e(function(x){var T=this,v=[0],c=[],H=[null],s=[],w=this.table,i="",Y=0,C1=0,S1=0,R1=2,x1=1,O1=s.slice.call(arguments,1),ae=Object.create(this.lexer),$e={yy:{}};for(var n1 in this.yy)if(Object.prototype.hasOwnProperty.call(this.yy,n1))$e.yy[n1]=this.yy[n1];if(ae.setInput(x,$e.yy),$e.yy.lexer=ae,$e.yy.parser=this,typeof ae.yylloc>"u")ae.yylloc={};var a1=ae.yylloc;s.push(a1);var P1=ae.options&&ae.options.ranges;if(typeof $e.yy.parseError==="function")this.parseError=$e.yy.parseError;else this.parseError=Object.getPrototypeOf(this).parseError;function G1(De){v.length=v.length-2*De,H.length=H.length-De,s.length=s.length-De}e(G1,"popStack");function T1(){var De=c.pop()||ae.lex()||x1;if(typeof De!=="number"){if(De instanceof Array)c=De,De=c.pop();De=T.symbols_[De]||De}return De}e(T1,"lex");var Ce,o1,et,Te,is,u1,xt={},t1,Ue,D1,s1;while(!0){if(et=v[v.length-1],this.defaultActions[et])Te=this.defaultActions[et];else{if(Ce===null||typeof Ce>"u")Ce=T1();Te=w[et]&&w[et][Ce]}if(typeof Te>"u"||!Te.length||!Te[0]){var l1="";s1=[];for(t1 in w[et])if(this.terminals_[t1]&&t1>R1)s1.push("'"+this.terminals_[t1]+"'");if(ae.showPosition)l1="Parse error on line "+(Y+1)+`:
23
23
  `+ae.showPosition()+`
24
24
  Expecting `+s1.join(", ")+", got '"+(this.terminals_[Ce]||Ce)+"'";else l1="Parse error on line "+(Y+1)+": Unexpected "+(Ce==x1?"end of input":"'"+(this.terminals_[Ce]||Ce)+"'");this.parseError(l1,{text:ae.match,token:this.terminals_[Ce]||Ce,line:ae.yylineno,loc:a1,expected:s1})}if(Te[0]instanceof Array&&Te.length>1)throw Error("Parse Error: multiple actions possible at state: "+et+", token: "+Ce);switch(Te[0]){case 1:if(v.push(Ce),H.push(ae.yytext),s.push(ae.yylloc),v.push(Te[1]),Ce=null,!o1){if(C1=ae.yyleng,i=ae.yytext,Y=ae.yylineno,a1=ae.yylloc,S1>0)S1--}else Ce=o1,o1=null;break;case 2:if(Ue=this.productions_[Te[1]][1],xt.$=H[H.length-Ue],xt._$={first_line:s[s.length-(Ue||1)].first_line,last_line:s[s.length-1].last_line,first_column:s[s.length-(Ue||1)].first_column,last_column:s[s.length-1].last_column},P1)xt._$.range=[s[s.length-(Ue||1)].range[0],s[s.length-1].range[1]];if(u1=this.performAction.apply(xt,[i,C1,Y,$e.yy,Te[1],H,s].concat(O1)),typeof u1<"u")return u1;if(Ue)v=v.slice(0,-1*Ue*2),H=H.slice(0,-1*Ue),s=s.slice(0,-1*Ue);v.push(this.productions_[Te[1]][0]),H.push(xt.$),s.push(xt._$),D1=w[v[v.length-2]][v[v.length-1]],v.push(D1);break;case 3:return!0}}return!0},"parse")},N1=function(){var Ke={EOF:1,parseError:e(function(T,v){if(this.yy.parser)this.yy.parser.parseError(T,v);else throw Error(T)},"parseError"),setInput:e(function(x,T){if(this.yy=T||this.yy||{},this._input=x,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges)this.yylloc.range=[0,0];return this.offset=0,this},"setInput"),input:e(function(){var x=this._input[0];this.yytext+=x,this.yyleng++,this.offset++,this.match+=x,this.matched+=x;var T=x.match(/(?:\r\n?|\n).*/g);if(T)this.yylineno++,this.yylloc.last_line++;else this.yylloc.last_column++;if(this.options.ranges)this.yylloc.range[1]++;return this._input=this._input.slice(1),x},"input"),unput:e(function(x){var T=x.length,v=x.split(/(?:\r\n?|\n)/g);this._input=x+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-T),this.offset-=T;var c=this.match.split(/(?:\r\n?|\n)/g);if(this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),v.length-1)this.yylineno-=v.length-1;var H=this.yylloc.range;if(this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:v?(v.length===c.length?this.yylloc.first_column:0)+c[c.length-v.length].length-v[0].length:this.yylloc.first_column-T},this.options.ranges)this.yylloc.range=[H[0],H[0]+this.yyleng-T];return this.yyleng=this.yytext.length,this},"unput"),more:e(function(){return this._more=!0,this},"more"),reject:e(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
25
25
  `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:e(function(x){this.unput(this.match.slice(x))},"less"),pastInput:e(function(){var x=this.matched.substr(0,this.matched.length-this.match.length);return(x.length>20?"...":"")+x.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:e(function(){var x=this.match;if(x.length<20)x+=this._input.substr(0,20-x.length);return(x.substr(0,20)+(x.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:e(function(){var x=this.pastInput(),T=Array(x.length+1).join("-");return x+this.upcomingInput()+`