@bkm016/basalt 0.1.9 → 0.1.10

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 (132) hide show
  1. package/{chunk-0xd9mnc2.js → chunk-0mjb3sm3.js} +2 -2
  2. package/{chunk-66h5qpc6.js → chunk-3mqf9ped.js} +89 -89
  3. package/compiled.js +1 -1
  4. package/package.json +1 -1
  5. package/ui-test-worker.js +1 -1
  6. package/web/chunk-045d3b5d.js +1 -0
  7. package/web/{chunk-ff1pmd3g.js → chunk-0770q5e1.js} +1 -1
  8. package/web/{chunk-2x4g9t37.js → chunk-18neka5g.js} +2 -2
  9. package/web/{chunk-w3w18stt.js → chunk-1ev0n3n4.js} +1 -1
  10. package/web/chunk-1ex3wgms.js +2 -0
  11. package/web/{chunk-7qkav30b.js → chunk-1qh7f5kr.js} +1 -1
  12. package/web/{chunk-rayf24gy.js → chunk-26ecc2xh.js} +8 -8
  13. package/web/{chunk-me7dza1c.js → chunk-2cz7tx8q.js} +1 -1
  14. package/web/{chunk-mdfksj61.js → chunk-32ty2xfn.js} +1 -1
  15. package/web/{chunk-ts6jsfdk.js → chunk-3eexx7y5.js} +1 -1
  16. package/web/{chunk-2dvbeqt0.js → chunk-46jnkghq.js} +1 -1
  17. package/web/chunk-4am8j3k3.js +1 -0
  18. package/web/{chunk-qz6r9v1z.js → chunk-5qvmefq2.js} +1 -1
  19. package/web/{chunk-9ctg0f30.js → chunk-5svqfj4g.js} +1 -1
  20. package/web/{chunk-qsqtwf34.js → chunk-5v5q13hz.js} +1 -1
  21. package/web/chunk-7np1jp3x.js +8 -0
  22. package/web/chunk-87e8d1hv.js +1 -0
  23. package/web/{chunk-kcjz03h5.js → chunk-88wd49xe.js} +2 -2
  24. package/web/{chunk-0pghpg4y.js → chunk-8h2x89tw.js} +1 -1
  25. package/web/chunk-8y2526ve.js +1 -0
  26. package/web/{chunk-8jcvdd5d.js → chunk-905vw286.js} +1 -1
  27. package/web/{chunk-2hrswh3d.js → chunk-918e5t4x.js} +1 -1
  28. package/web/chunk-96m2m3e8.js +1 -0
  29. package/web/{chunk-43g4wd7a.js → chunk-9f4zzqbx.js} +1 -1
  30. package/web/{chunk-dnv8dx72.js → chunk-a1n4468c.js} +1 -1
  31. package/web/{chunk-s37beysw.js → chunk-b46ws7rf.js} +1 -1
  32. package/web/{chunk-24jhbz82.js → chunk-bc3ajvfg.js} +1 -1
  33. package/web/{chunk-ket6g0yd.js → chunk-d5gshd1a.js} +1 -1
  34. package/web/{chunk-c6yacwbc.js → chunk-de40q05r.js} +1 -1
  35. package/web/chunk-dp0k5vhd.js +1 -0
  36. package/web/{chunk-5dr4tkem.js → chunk-dv1berk6.js} +3 -3
  37. package/web/{chunk-dwjmr0zj.js → chunk-eh7wp62z.js} +1 -1
  38. package/web/{chunk-ctzkqx2g.js → chunk-ehtmb6sn.js} +1 -1
  39. package/web/chunk-et1hytyv.js +1 -0
  40. package/web/chunk-f9m9seam.js +1 -0
  41. package/web/{chunk-3pd0qt83.js → chunk-fmmrthpa.js} +2 -2
  42. package/web/chunk-g2erm7k0.js +1 -0
  43. package/web/chunk-g3kbn0t2.js +1 -0
  44. package/web/{chunk-t893141g.js → chunk-g7dc4hrd.js} +1 -1
  45. package/web/{chunk-p9hfcamx.js → chunk-g7kz8f7q.js} +1 -1
  46. package/web/chunk-ght0t49g.js +1 -0
  47. package/web/{chunk-xa43ndfj.js → chunk-ghwm7bdj.js} +2 -2
  48. package/web/{chunk-8z0r0wtk.js → chunk-grm2208k.js} +1 -1
  49. package/web/{chunk-0zwc2rvh.js → chunk-gsw1tv96.js} +1 -1
  50. package/web/{chunk-tftc5v89.js → chunk-gw8x1g61.js} +1 -1
  51. package/web/chunk-gx340asc.js +1 -0
  52. package/web/{chunk-935mjq1c.js → chunk-h2txs73e.js} +1 -1
  53. package/web/chunk-h3tkacc7.js +1 -0
  54. package/web/{chunk-ewx42c11.js → chunk-h5ckjk48.js} +1 -1
  55. package/web/{chunk-nnyc889n.js → chunk-j37p0b13.js} +1 -1
  56. package/web/{chunk-fjb3ksfd.js → chunk-j89s11x8.js} +1 -1
  57. package/web/chunk-je78j3vr.js +1 -0
  58. package/web/{chunk-fpb2dd2d.js → chunk-jke2ev6m.js} +1 -1
  59. package/web/{chunk-98y92vmh.js → chunk-js6kb05s.js} +1 -1
  60. package/web/{chunk-30b33r2w.js → chunk-k0cg4n2k.js} +2 -2
  61. package/web/{chunk-b5h52neg.js → chunk-knm82fw9.js} +1 -1
  62. package/web/{chunk-vqmj6peg.js → chunk-kxdtg9dt.js} +1 -1
  63. package/web/{chunk-db3twjvk.js → chunk-m4fxd5d9.js} +5 -5
  64. package/web/chunk-m9xzt9p7.js +1 -0
  65. package/web/{chunk-xx11yv61.js → chunk-n4yzs2q0.js} +1 -1
  66. package/web/{chunk-zdyys4ar.js → chunk-nawxgz87.js} +2 -2
  67. package/web/chunk-ngt1j8py.js +1139 -0
  68. package/web/{chunk-3ak5dg10.js → chunk-p55vhns6.js} +1 -1
  69. package/web/{chunk-nvpp0ghj.js → chunk-pgwf37s2.js} +1 -1
  70. package/web/{chunk-af9evdza.js → chunk-q4bst4an.js} +1 -1
  71. package/web/{chunk-9fnr00kv.js → chunk-qdzy124b.js} +2 -2
  72. package/web/chunk-qe0bgeda.js +1 -0
  73. package/web/{chunk-60axh4sa.js → chunk-qy1zx2yw.js} +2 -2
  74. package/web/{chunk-sk1wkgjw.js → chunk-rag65pfs.js} +1 -1
  75. package/web/{chunk-5jdrev9p.js → chunk-rbqnre6q.js} +3 -3
  76. package/web/{chunk-ddyyc20r.js → chunk-rh3xb76f.js} +1 -1
  77. package/web/{chunk-wzd2a4k5.js → chunk-rwfmccmh.js} +1 -1
  78. package/web/{chunk-zb2bkr7f.js → chunk-rxvm70w5.js} +1 -1
  79. package/web/{chunk-z05x9cbm.js → chunk-sat7zyva.js} +1 -1
  80. package/web/{chunk-rrpn5r5w.js → chunk-sc63488q.js} +1 -1
  81. package/web/{chunk-v1exk5wd.js → chunk-sd3xat3r.js} +6 -6
  82. package/web/{chunk-4a6gdrbs.js → chunk-se4h6wx0.js} +1 -1
  83. package/web/{chunk-a0ryzdnp.js → chunk-sjkg40ay.js} +1 -1
  84. package/web/chunk-sk0hpa80.js +1 -0
  85. package/web/{chunk-spbs56wz.js → chunk-t5nvgz7z.js} +1 -1
  86. package/web/{chunk-veam6vk4.js → chunk-tfqarvdx.js} +30 -30
  87. package/web/{chunk-5a4mj3qz.js → chunk-tqze6d6b.js} +1 -1
  88. package/web/{chunk-8w7fyb3v.js → chunk-tt93zbn4.js} +7 -7
  89. package/web/chunk-tvcxrx6h.js +1 -0
  90. package/web/chunk-tzpnh70q.js +1 -0
  91. package/web/{chunk-79e08rk1.js → chunk-vasppf6b.js} +1 -1
  92. package/web/chunk-vb7g4xg6.js +1 -0
  93. package/web/{chunk-dz7g1gnv.js → chunk-w3zgfhjb.js} +1 -1
  94. package/web/{chunk-gn8kyz76.js → chunk-wrevb4ew.js} +1 -1
  95. package/web/{chunk-3ecrkvr3.js → chunk-wtvch4ad.js} +1 -1
  96. package/web/chunk-wzfe6jtq.js +1 -0
  97. package/web/{chunk-eadfxfkw.js → chunk-x5g1yy12.js} +1 -1
  98. package/web/{chunk-m9q5nr8f.js → chunk-x850q01z.js} +1 -1
  99. package/web/{chunk-a61zrp66.js → chunk-xk904wqv.js} +1 -1
  100. package/web/{chunk-3hr3ew9w.js → chunk-xtn305fd.js} +1 -1
  101. package/web/{chunk-3txxt0a7.js → chunk-yekaz74b.js} +1 -1
  102. package/web/{chunk-rasjtvsb.js → chunk-yppgejg7.js} +2 -2
  103. package/web/{chunk-66wb0p6e.js → chunk-z4bp6p32.js} +1 -1
  104. package/web/{chunk-5v2c0aqk.js → chunk-z5qn0xev.js} +1 -1
  105. package/web/{chunk-5baeh8q7.js → chunk-zms6mrqk.js} +4 -4
  106. package/web/{chunk-601k823s.js → chunk-zse05v6j.js} +2 -2
  107. package/web/{chunk-vsjpnwsr.js → chunk-zz1qkaar.js} +1 -1
  108. package/web/index.html +1 -1
  109. package/web/chunk-08sq3cwm.js +0 -1
  110. package/web/chunk-24fjnnee.js +0 -1
  111. package/web/chunk-2j2atyjw.js +0 -1
  112. package/web/chunk-3h3g3ca3.js +0 -1
  113. package/web/chunk-3pcrxg6m.js +0 -1
  114. package/web/chunk-814kkkmq.js +0 -8
  115. package/web/chunk-8w8atrdh.js +0 -1
  116. package/web/chunk-942g3eqn.js +0 -1
  117. package/web/chunk-avxk6jpc.js +0 -2
  118. package/web/chunk-fmthkpff.js +0 -1
  119. package/web/chunk-gv99c8zv.js +0 -1
  120. package/web/chunk-h0767tjv.js +0 -1
  121. package/web/chunk-hqynf99g.js +0 -1
  122. package/web/chunk-mbwwj216.js +0 -1
  123. package/web/chunk-n0wazxgz.js +0 -1
  124. package/web/chunk-nvt9tkt4.js +0 -1139
  125. package/web/chunk-ph1dgffm.js +0 -1
  126. package/web/chunk-rad2s9ha.js +0 -1
  127. package/web/chunk-s60s09mb.js +0 -1
  128. package/web/chunk-tfvcs2xx.js +0 -1
  129. package/web/chunk-wdq2tp9e.js +0 -1
  130. package/web/chunk-wkf5xfyr.js +0 -1
  131. package/web/chunk-y1qty77a.js +0 -1
  132. package/web/chunk-zgavhnt8.js +0 -1
@@ -1,4 +1,4 @@
1
- import{G}from"./chunk-dwjmr0zj.js";import{t,a,N,x,O,ht,C,S,E,T,A,L,R,l,p,V,Gi,Ln,nt,U,ze,Le}from"./chunk-veam6vk4.js";import{J}from"./chunk-60axh4sa.js";import{mt,vr}from"./chunk-8w7fyb3v.js";import{Se,Te}from"./chunk-nvt9tkt4.js";var ft=Te(function(rt,st){(function(i,s){if(typeof rt==="object"&&typeof st==="object")st.exports=s(vr());else if(typeof define==="function"&&define.amd)define(["cose-base"],s);else if(typeof rt==="object")rt.cytoscapeFcose=s(vr());else i.cytoscapeFcose=s(i.coseBase)})(rt,function(e){return(()=>{var i={658:(k)=>{k.exports=Object.assign!=null?Object.assign.bind(Object):function(B){for(var v=arguments.length,b=Array(v>1?v-1:0),c=1;c<v;c++)b[c-1]=arguments[c];return b.forEach(function(y){Object.keys(y).forEach(function(d){return B[d]=y[d]})}),B}},548:(k,B,v)=>{var b=function(){function d(f,u){var g=[],r=!0,_=!1,F=void 0;try{for(var o=f[Symbol.iterator](),h;!(r=(h=o.next()).done);r=!0)if(g.push(h.value),u&&g.length===u)break}catch(D){_=!0,F=D}finally{try{if(!r&&o.return)o.return()}finally{if(_)throw F}}return g}return function(f,u){if(Array.isArray(f))return f;else if(Symbol.iterator in Object(f))return d(f,u);else throw TypeError("Invalid attempt to destructure non-iterable instance")}}(),c=v(140).layoutBase.LinkedList,y={};y.getTopMostNodes=function(d){var f={};for(var u=0;u<d.length;u++)f[d[u].id()]=!0;var g=d.filter(function(r,_){if(typeof r==="number")r=_;var F=r.parent()[0];while(F!=null){if(f[F.id()])return!1;F=F.parent()[0]}return!0});return g},y.connectComponents=function(d,f,u,g){var r=new c,_=new Set,F=[],o=void 0,h=void 0,D=void 0,n=!1,P=1,X=[],M=[],j=function(){var I=d.collection();M.push(I);var H=u[0],Z=d.collection();Z.merge(H).merge(H.descendants().intersection(f)),F.push(H),Z.forEach(function(re){r.push(re),_.add(re),I.merge(re)});var Q=function(){H=r.shift();var ue=d.collection();H.neighborhood().nodes().forEach(function(q){if(f.intersection(H.edgesWith(q)).length>0)ue.merge(q)});for(var Ce=0;Ce<ue.length;Ce++){var $e=ue[Ce];if(o=u.intersection($e.union($e.ancestors())),o!=null&&!_.has(o[0])){var de=o.union(o.descendants());de.forEach(function(q){if(r.push(q),_.add(q),I.merge(q),u.has(q))F.push(q)})}}};while(r.length!=0)Q();if(I.forEach(function(re){f.intersection(re.connectedEdges()).forEach(function(ue){if(I.has(ue.source())&&I.has(ue.target()))I.merge(ue)})}),F.length==u.length)n=!0;if(!n||n&&P>1){h=F[0],D=h.connectedEdges().length,F.forEach(function(re){if(re.connectedEdges().length<D)D=re.connectedEdges().length,h=re}),X.push(h.id());var se=d.collection();se.merge(F[0]),F.forEach(function(re){se.merge(re)}),F=[],u=u.difference(se),P++}};do j();while(!n);if(g){if(X.length>0)g.set("dummy"+(g.size+1),X)}return M},y.relocateComponent=function(d,f,u){if(!u.fixedNodeConstraint){var{POSITIVE_INFINITY:g,NEGATIVE_INFINITY:r,POSITIVE_INFINITY:_,NEGATIVE_INFINITY:F}=Number;if(u.quality=="draft"){var o=!0,h=!1,D=void 0;try{for(var n=f.nodeIndexes[Symbol.iterator](),P;!(o=(P=n.next()).done);o=!0){var X=P.value,M=b(X,2),j=M[0],Y=M[1],I=u.cy.getElementById(j);if(I){var H=I.boundingBox(),Z=f.xCoords[Y]-H.w/2,Q=f.xCoords[Y]+H.w/2,se=f.yCoords[Y]-H.h/2,re=f.yCoords[Y]+H.h/2;if(Z<g)g=Z;if(Q>r)r=Q;if(se<_)_=se;if(re>F)F=re}}}catch(q){h=!0,D=q}finally{try{if(!o&&n.return)n.return()}finally{if(h)throw D}}var ue=d.x-(r+g)/2,Ce=d.y-(F+_)/2;f.xCoords=f.xCoords.map(function(q){return q+ue}),f.yCoords=f.yCoords.map(function(q){return q+Ce})}else{Object.keys(f).forEach(function(q){var oe=f[q],Ne=oe.getRect().x,ke=oe.getRect().x+oe.getRect().width,De=oe.getRect().y,xe=oe.getRect().y+oe.getRect().height;if(Ne<g)g=Ne;if(ke>r)r=ke;if(De<_)_=De;if(xe>F)F=xe});var $e=d.x-(r+g)/2,de=d.y-(F+_)/2;Object.keys(f).forEach(function(q){var oe=f[q];oe.setCenter(oe.getCenterX()+$e,oe.getCenterY()+de)})}}},y.calcBoundingBox=function(d,f,u,g){var{MAX_SAFE_INTEGER:r,MIN_SAFE_INTEGER:_,MAX_SAFE_INTEGER:F,MIN_SAFE_INTEGER:o}=Number,h=void 0,D=void 0,n=void 0,P=void 0,X=d.descendants().not(":parent"),M=X.length;for(var j=0;j<M;j++){var Y=X[j];if(h=f[g.get(Y.id())]-Y.width()/2,D=f[g.get(Y.id())]+Y.width()/2,n=u[g.get(Y.id())]-Y.height()/2,P=u[g.get(Y.id())]+Y.height()/2,r>h)r=h;if(_<D)_=D;if(F>n)F=n;if(o<P)o=P}var I={};return I.topLeftX=r,I.topLeftY=F,I.width=_-r,I.height=o-F,I},y.calcParentsWithoutChildren=function(d,f){var u=d.collection();return f.nodes(":parent").forEach(function(g){var r=!1;if(g.children().forEach(function(_){if(_.css("display")!="none")r=!0}),!r)u.merge(g)}),u},k.exports=y},816:(k,B,v)=>{var b=v(548),c=v(140).CoSELayout,y=v(140).CoSENode,d=v(140).layoutBase.PointD,f=v(140).layoutBase.DimensionD,u=v(140).layoutBase.LayoutConstants,g=v(140).layoutBase.FDLayoutConstants,r=v(140).CoSEConstants,_=function(o,h){var{cy:D,eles:n}=o,P=n.nodes(),X=n.edges(),M=void 0,j=void 0,Y=void 0,I={};if(o.randomize)M=h.nodeIndexes,j=h.xCoords,Y=h.yCoords;var H=function(q){return typeof q==="function"},Z=function(q,oe){if(H(q))return q(oe);else return q},Q=b.calcParentsWithoutChildren(D,n),se=function de(q,oe,Ne,ke){var De=oe.length;for(var xe=0;xe<De;xe++){var W=oe[xe],Ae=null;if(W.intersection(Q).length==0)Ae=W.children();var ie=void 0,ve=W.layoutDimensions({nodeDimensionsIncludeLabels:ke.nodeDimensionsIncludeLabels});if(W.outerWidth()!=null&&W.outerHeight()!=null)if(ke.randomize)if(!W.isParent())ie=q.add(new y(Ne.graphManager,new d(j[M.get(W.id())]-ve.w/2,Y[M.get(W.id())]-ve.h/2),new f(parseFloat(ve.w),parseFloat(ve.h))));else{var Me=b.calcBoundingBox(W,j,Y,M);if(W.intersection(Q).length==0)ie=q.add(new y(Ne.graphManager,new d(Me.topLeftX,Me.topLeftY),new f(Me.width,Me.height)));else ie=q.add(new y(Ne.graphManager,new d(Me.topLeftX,Me.topLeftY),new f(parseFloat(ve.w),parseFloat(ve.h))))}else ie=q.add(new y(Ne.graphManager,new d(W.position("x")-ve.w/2,W.position("y")-ve.h/2),new f(parseFloat(ve.w),parseFloat(ve.h))));else ie=q.add(new y(this.graphManager));if(ie.id=W.data("id"),ie.nodeRepulsion=Z(ke.nodeRepulsion,W),ie.paddingLeft=parseInt(W.css("padding")),ie.paddingTop=parseInt(W.css("padding")),ie.paddingRight=parseInt(W.css("padding")),ie.paddingBottom=parseInt(W.css("padding")),ke.nodeDimensionsIncludeLabels)ie.labelWidth=W.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).w,ie.labelHeight=W.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).h,ie.labelPosVertical=W.css("text-valign"),ie.labelPosHorizontal=W.css("text-halign");if(I[W.data("id")]=ie,isNaN(ie.rect.x))ie.rect.x=0;if(isNaN(ie.rect.y))ie.rect.y=0;if(Ae!=null&&Ae.length>0){var Ge=void 0;Ge=Ne.getGraphManager().add(Ne.newGraph(),ie),de(Ge,Ae,Ne,ke)}}},re=function(q,oe,Ne){var ke=0,De=0;for(var xe=0;xe<Ne.length;xe++){var W=Ne[xe],Ae=I[W.data("source")],ie=I[W.data("target")];if(Ae&&ie&&Ae!==ie&&Ae.getEdgesBetween(ie).length==0){var ve=oe.add(q.newEdge(),Ae,ie);ve.id=W.id(),ve.idealLength=Z(o.idealEdgeLength,W),ve.edgeElasticity=Z(o.edgeElasticity,W),ke+=ve.idealLength,De++}}if(o.idealEdgeLength!=null){if(De>0)r.DEFAULT_EDGE_LENGTH=g.DEFAULT_EDGE_LENGTH=ke/De;else if(!H(o.idealEdgeLength))r.DEFAULT_EDGE_LENGTH=g.DEFAULT_EDGE_LENGTH=o.idealEdgeLength;else r.DEFAULT_EDGE_LENGTH=g.DEFAULT_EDGE_LENGTH=50;r.MIN_REPULSION_DIST=g.MIN_REPULSION_DIST=g.DEFAULT_EDGE_LENGTH/10,r.DEFAULT_RADIAL_SEPARATION=g.DEFAULT_EDGE_LENGTH}},ue=function(q,oe){if(oe.fixedNodeConstraint)q.constraints.fixedNodeConstraint=oe.fixedNodeConstraint;if(oe.alignmentConstraint)q.constraints.alignmentConstraint=oe.alignmentConstraint;if(oe.relativePlacementConstraint)q.constraints.relativePlacementConstraint=oe.relativePlacementConstraint};if(o.nestingFactor!=null)r.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=g.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=o.nestingFactor;if(o.gravity!=null)r.DEFAULT_GRAVITY_STRENGTH=g.DEFAULT_GRAVITY_STRENGTH=o.gravity;if(o.numIter!=null)r.MAX_ITERATIONS=g.MAX_ITERATIONS=o.numIter;if(o.gravityRange!=null)r.DEFAULT_GRAVITY_RANGE_FACTOR=g.DEFAULT_GRAVITY_RANGE_FACTOR=o.gravityRange;if(o.gravityCompound!=null)r.DEFAULT_COMPOUND_GRAVITY_STRENGTH=g.DEFAULT_COMPOUND_GRAVITY_STRENGTH=o.gravityCompound;if(o.gravityRangeCompound!=null)r.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=g.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=o.gravityRangeCompound;if(o.initialEnergyOnIncremental!=null)r.DEFAULT_COOLING_FACTOR_INCREMENTAL=g.DEFAULT_COOLING_FACTOR_INCREMENTAL=o.initialEnergyOnIncremental;if(o.tilingCompareBy!=null)r.TILING_COMPARE_BY=o.tilingCompareBy;if(o.quality=="proof")u.QUALITY=2;else u.QUALITY=0;if(r.NODE_DIMENSIONS_INCLUDE_LABELS=g.NODE_DIMENSIONS_INCLUDE_LABELS=u.NODE_DIMENSIONS_INCLUDE_LABELS=o.nodeDimensionsIncludeLabels,r.DEFAULT_INCREMENTAL=g.DEFAULT_INCREMENTAL=u.DEFAULT_INCREMENTAL=!o.randomize,r.ANIMATE=g.ANIMATE=u.ANIMATE=o.animate,r.TILE=o.tile,r.TILING_PADDING_VERTICAL=typeof o.tilingPaddingVertical==="function"?o.tilingPaddingVertical.call():o.tilingPaddingVertical,r.TILING_PADDING_HORIZONTAL=typeof o.tilingPaddingHorizontal==="function"?o.tilingPaddingHorizontal.call():o.tilingPaddingHorizontal,r.DEFAULT_INCREMENTAL=g.DEFAULT_INCREMENTAL=u.DEFAULT_INCREMENTAL=!0,r.PURE_INCREMENTAL=!o.randomize,u.DEFAULT_UNIFORM_LEAF_NODE_SIZES=o.uniformNodeDimensions,o.step=="transformed")r.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,r.ENFORCE_CONSTRAINTS=!1,r.APPLY_LAYOUT=!1;if(o.step=="enforced")r.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,r.ENFORCE_CONSTRAINTS=!0,r.APPLY_LAYOUT=!1;if(o.step=="cose")r.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,r.ENFORCE_CONSTRAINTS=!1,r.APPLY_LAYOUT=!0;if(o.step=="all"){if(o.randomize)r.TRANSFORM_ON_CONSTRAINT_HANDLING=!0;else r.TRANSFORM_ON_CONSTRAINT_HANDLING=!1;r.ENFORCE_CONSTRAINTS=!0,r.APPLY_LAYOUT=!0}if(o.fixedNodeConstraint||o.alignmentConstraint||o.relativePlacementConstraint)r.TREE_REDUCTION_ON_INCREMENTAL=!1;else r.TREE_REDUCTION_ON_INCREMENTAL=!0;var Ce=new c,$e=Ce.newGraphManager();return se($e.addRoot(),b.getTopMostNodes(P),Ce,o),re(Ce,$e,X),ue(Ce,o),Ce.runLayout(),I};k.exports={coseLayout:_}},212:(k,B,v)=>{var b=function(){function o(h,D){for(var n=0;n<D.length;n++){var P=D[n];if(P.enumerable=P.enumerable||!1,P.configurable=!0,"value"in P)P.writable=!0;Object.defineProperty(h,P.key,P)}}return function(h,D,n){if(D)o(h.prototype,D);if(n)o(h,n);return h}}();function c(o,h){if(!(o instanceof h))throw TypeError("Cannot call a class as a function")}var y=v(658),d=v(548),f=v(657),u=f.spectralLayout,g=v(816),r=g.coseLayout,_=Object.freeze({quality:"default",randomize:!0,animate:!0,animationDuration:1000,animationEasing:void 0,fit:!0,padding:30,nodeDimensionsIncludeLabels:!1,uniformNodeDimensions:!1,packComponents:!0,step:"all",samplingType:!0,sampleSize:25,nodeSeparation:75,piTol:0.0000001,nodeRepulsion:function(h){return 4500},idealEdgeLength:function(h){return 50},edgeElasticity:function(h){return 0.45},nestingFactor:0.1,gravity:0.25,numIter:2500,tile:!0,tilingCompareBy:void 0,tilingPaddingVertical:10,tilingPaddingHorizontal:10,gravityRangeCompound:1.5,gravityCompound:1,gravityRange:3.8,initialEnergyOnIncremental:0.3,fixedNodeConstraint:void 0,alignmentConstraint:void 0,relativePlacementConstraint:void 0,ready:function(){},stop:function(){}}),F=function(){function o(h){c(this,o),this.options=y({},_,h)}return b(o,[{key:"run",value:function(){var D=this,n=this.options,{cy:P,eles:X}=n,M=[],j=void 0,Y=void 0,I=[],H=void 0,Z=[];if(n.fixedNodeConstraint&&(!Array.isArray(n.fixedNodeConstraint)||n.fixedNodeConstraint.length==0))n.fixedNodeConstraint=void 0;if(n.alignmentConstraint){if(n.alignmentConstraint.vertical&&(!Array.isArray(n.alignmentConstraint.vertical)||n.alignmentConstraint.vertical.length==0))n.alignmentConstraint.vertical=void 0;if(n.alignmentConstraint.horizontal&&(!Array.isArray(n.alignmentConstraint.horizontal)||n.alignmentConstraint.horizontal.length==0))n.alignmentConstraint.horizontal=void 0}if(n.relativePlacementConstraint&&(!Array.isArray(n.relativePlacementConstraint)||n.relativePlacementConstraint.length==0))n.relativePlacementConstraint=void 0;var Q=n.fixedNodeConstraint||n.alignmentConstraint||n.relativePlacementConstraint;if(Q)n.tile=!1,n.packComponents=!1;var se=void 0,re=!1;if(P.layoutUtilities&&n.packComponents){if(se=P.layoutUtilities("get"),!se)se=P.layoutUtilities();re=!0}if(X.nodes().length>0)if(!re){var ue=n.eles.boundingBox();if(Z.push({x:ue.x1+ue.w/2,y:ue.y1+ue.h/2}),n.randomize){var Ce=u(n);M.push(Ce)}if(n.quality=="default"||n.quality=="proof")I.push(r(n,M[0])),d.relocateComponent(Z[0],I[0],n);else d.relocateComponent(Z[0],M[0],n)}else{var $e=d.getTopMostNodes(n.eles.nodes());if(H=d.connectComponents(P,n.eles,$e),H.forEach(function(K){var z=K.boundingBox();Z.push({x:z.x1+z.w/2,y:z.y1+z.h/2})}),n.randomize)H.forEach(function(K){n.eles=K,M.push(u(n))});if(n.quality=="default"||n.quality=="proof"){var de=P.collection();if(n.tile){var q=new Map,oe=[],Ne=[],ke=0,De={nodeIndexes:q,xCoords:oe,yCoords:Ne},xe=[];if(H.forEach(function(K,z){if(K.edges().length==0)K.nodes().forEach(function(pe,le){if(de.merge(K.nodes()[le]),!pe.isParent())De.nodeIndexes.set(K.nodes()[le].id(),ke++),De.xCoords.push(K.nodes()[0].position().x),De.yCoords.push(K.nodes()[0].position().y)}),xe.push(z)}),de.length>1){var W=de.boundingBox();Z.push({x:W.x1+W.w/2,y:W.y1+W.h/2}),H.push(de),M.push(De);for(var Ae=xe.length-1;Ae>=0;Ae--)H.splice(xe[Ae],1),M.splice(xe[Ae],1),Z.splice(xe[Ae],1)}}H.forEach(function(K,z){n.eles=K,I.push(r(n,M[z])),d.relocateComponent(Z[z],I[z],n)})}else H.forEach(function(K,z){d.relocateComponent(Z[z],M[z],n)});var ie=new Set;if(H.length>1){var ve=[],Me=X.filter(function(K){return K.css("display")=="none"});H.forEach(function(K,z){var pe=void 0;if(n.quality=="draft")pe=M[z].nodeIndexes;if(K.nodes().not(Me).length>0){var le={};le.edges=[],le.nodes=[];var me=void 0;if(K.nodes().not(Me).forEach(function(fe){if(n.quality=="draft")if(!fe.isParent())me=pe.get(fe.id()),le.nodes.push({x:M[z].xCoords[me]-fe.boundingbox().w/2,y:M[z].yCoords[me]-fe.boundingbox().h/2,width:fe.boundingbox().w,height:fe.boundingbox().h});else{var he=d.calcBoundingBox(fe,M[z].xCoords,M[z].yCoords,pe);le.nodes.push({x:he.topLeftX,y:he.topLeftY,width:he.width,height:he.height})}else if(I[z][fe.id()])le.nodes.push({x:I[z][fe.id()].getLeft(),y:I[z][fe.id()].getTop(),width:I[z][fe.id()].getWidth(),height:I[z][fe.id()].getHeight()})}),K.edges().forEach(function(fe){var he=fe.source(),Ee=fe.target();if(he.css("display")!="none"&&Ee.css("display")!="none"){if(n.quality=="draft"){var Be=pe.get(he.id()),et=pe.get(Ee.id()),Pe=[],Ye=[];if(he.isParent()){var We=d.calcBoundingBox(he,M[z].xCoords,M[z].yCoords,pe);Pe.push(We.topLeftX+We.width/2),Pe.push(We.topLeftY+We.height/2)}else Pe.push(M[z].xCoords[Be]),Pe.push(M[z].yCoords[Be]);if(Ee.isParent()){var Je=d.calcBoundingBox(Ee,M[z].xCoords,M[z].yCoords,pe);Ye.push(Je.topLeftX+Je.width/2),Ye.push(Je.topLeftY+Je.height/2)}else Ye.push(M[z].xCoords[et]),Ye.push(M[z].yCoords[et]);le.edges.push({startX:Pe[0],startY:Pe[1],endX:Ye[0],endY:Ye[1]})}else if(I[z][he.id()]&&I[z][Ee.id()])le.edges.push({startX:I[z][he.id()].getCenterX(),startY:I[z][he.id()].getCenterY(),endX:I[z][Ee.id()].getCenterX(),endY:I[z][Ee.id()].getCenterY()})}}),le.nodes.length>0)ve.push(le),ie.add(z)}});var Ge=se.packComponents(ve,n.randomize).shifts;if(n.quality=="draft")M.forEach(function(K,z){var pe=K.xCoords.map(function(me){return me+Ge[z].dx}),le=K.yCoords.map(function(me){return me+Ge[z].dy});K.xCoords=pe,K.yCoords=le});else{var Ke=0;ie.forEach(function(K){Object.keys(I[K]).forEach(function(z){var pe=I[K][z];pe.setCenter(pe.getCenterX()+Ge[Ke].dx,pe.getCenterY()+Ge[Ke].dy)}),Ke++})}}}var je=function(z,pe){if(n.quality=="default"||n.quality=="proof"){if(typeof z==="number")z=pe;var le=void 0,me=void 0,fe=z.data("id");if(I.forEach(function(Ee){if(fe in Ee)le={x:Ee[fe].getRect().getCenterX(),y:Ee[fe].getRect().getCenterY()},me=Ee[fe]}),n.nodeDimensionsIncludeLabels){if(me.labelWidth){if(me.labelPosHorizontal=="left")le.x+=me.labelWidth/2;else if(me.labelPosHorizontal=="right")le.x-=me.labelWidth/2}if(me.labelHeight){if(me.labelPosVertical=="top")le.y+=me.labelHeight/2;else if(me.labelPosVertical=="bottom")le.y-=me.labelHeight/2}}if(le==null)le={x:z.position("x"),y:z.position("y")};return{x:le.x,y:le.y}}else{var he=void 0;if(M.forEach(function(Ee){var Be=Ee.nodeIndexes.get(z.id());if(Be!=null)he={x:Ee.xCoords[Be],y:Ee.yCoords[Be]}}),he==null)he={x:z.position("x"),y:z.position("y")};return{x:he.x,y:he.y}}};if(n.quality=="default"||n.quality=="proof"||n.randomize){var at=d.calcParentsWithoutChildren(P,X),qe=X.filter(function(K){return K.css("display")=="none"});if(n.eles=X.not(qe),X.nodes().not(":parent").not(qe).layoutPositions(D,n,je),at.length>0)at.forEach(function(K){K.position(je(K))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),o}();k.exports=F},657:(k,B,v)=>{var b=v(548),c=v(140).layoutBase.Matrix,y=v(140).layoutBase.SVD,d=function(u){var{cy:g,eles:r}=u,_=r.nodes(),F=r.nodes(":parent"),o=new Map,h=new Map,D=new Map,n=[],P=[],X=[],M=[],j=[],Y=[],I=[],H=[],Z=void 0,Q=void 0,se=1e8,re=0.000000001,{piTol:ue,samplingType:Ce,nodeSeparation:$e}=u,de=void 0,q=function(){var ee=0,te=0,ne=!1;while(te<de){ee=Math.floor(Math.random()*Q),ne=!1;for(var ae=0;ae<te;ae++)if(M[ae]==ee){ne=!0;break}if(!ne)M[te]=ee,te++;else continue}},oe=function(ee,te,ne){var ae=[],we=0,ge=0,ce=0,Ie=void 0,be=[],Fe=0,_e=1;for(var Ue=0;Ue<Q;Ue++)be[Ue]=se;ae[ge]=ee,be[ee]=0;while(ge>=we){ce=ae[we++];var Xe=n[ce];for(var He=0;He<Xe.length;He++)if(Ie=h.get(Xe[He]),be[Ie]==se)be[Ie]=be[ce]+1,ae[++ge]=Ie;Y[ce][te]=be[ce]*$e}if(ne){for(var Oe=0;Oe<Q;Oe++)if(Y[Oe][te]<j[Oe])j[Oe]=Y[Oe][te];for(var tt=0;tt<Q;tt++)if(j[tt]>Fe)Fe=j[tt],_e=tt}return _e},Ne=function(ee){var te=void 0;if(!ee){q();for(var ne=0;ne<de;ne++)oe(M[ne],ne,ee,!1)}else{te=Math.floor(Math.random()*Q),Z=te;for(var ae=0;ae<Q;ae++)j[ae]=se;for(var we=0;we<de;we++)M[we]=te,te=oe(te,we,ee)}for(var ge=0;ge<Q;ge++)for(var ce=0;ce<de;ce++)Y[ge][ce]*=Y[ge][ce];for(var Ie=0;Ie<de;Ie++)I[Ie]=[];for(var be=0;be<de;be++)for(var Fe=0;Fe<de;Fe++)I[be][Fe]=Y[M[Fe]][be]},ke=function(){var ee=y.svd(I),{S:te,U:ne,V:ae}=ee,we=te[0]*te[0]*te[0],ge=[];for(var ce=0;ce<de;ce++){ge[ce]=[];for(var Ie=0;Ie<de;Ie++)if(ge[ce][Ie]=0,ce==Ie)ge[ce][Ie]=te[ce]/(te[ce]*te[ce]+we/(te[ce]*te[ce]))}H=c.multMat(c.multMat(ae,ge),c.transpose(ne))},De=function(){var ee=void 0,te=void 0,ne=[],ae=[],we=[],ge=[];for(var ce=0;ce<Q;ce++)ne[ce]=Math.random(),ae[ce]=Math.random();ne=c.normalize(ne),ae=c.normalize(ae);var Ie=0,be=re,Fe=re,_e=void 0;while(!0){Ie++;for(var Ue=0;Ue<Q;Ue++)we[Ue]=ne[Ue];if(ne=c.multGamma(c.multL(c.multGamma(we),Y,H)),ee=c.dotProduct(we,ne),ne=c.normalize(ne),be=c.dotProduct(we,ne),_e=Math.abs(be/Fe),_e<=1+ue&&_e>=1)break;Fe=be}for(var Xe=0;Xe<Q;Xe++)we[Xe]=ne[Xe];Ie=0,Fe=re;while(!0){Ie++;for(var He=0;He<Q;He++)ge[He]=ae[He];if(ge=c.minusOp(ge,c.multCons(we,c.dotProduct(we,ge))),ae=c.multGamma(c.multL(c.multGamma(ge),Y,H)),te=c.dotProduct(ge,ae),ae=c.normalize(ae),be=c.dotProduct(ge,ae),_e=Math.abs(be/Fe),_e<=1+ue&&_e>=1)break;Fe=be}for(var Oe=0;Oe<Q;Oe++)ge[Oe]=ae[Oe];P=c.multCons(we,Math.sqrt(Math.abs(ee))),X=c.multCons(ge,Math.sqrt(Math.abs(te)))};b.connectComponents(g,r,b.getTopMostNodes(_),o),F.forEach(function(ye){b.connectComponents(g,r,b.getTopMostNodes(ye.descendants().intersection(r)),o)});var xe=0;for(var W=0;W<_.length;W++)if(!_[W].isParent())h.set(_[W].id(),xe++);var Ae=!0,ie=!1,ve=void 0;try{for(var Me=o.keys()[Symbol.iterator](),Ge;!(Ae=(Ge=Me.next()).done);Ae=!0){var Ke=Ge.value;h.set(Ke,xe++)}}catch(ye){ie=!0,ve=ye}finally{try{if(!Ae&&Me.return)Me.return()}finally{if(ie)throw ve}}for(var je=0;je<h.size;je++)n[je]=[];F.forEach(function(ye){var ee=ye.children().intersection(r);while(ee.nodes(":childless").length==0)ee=ee.nodes()[0].children().intersection(r);var te=0,ne=ee.nodes(":childless")[0].connectedEdges().length;ee.nodes(":childless").forEach(function(ae,we){if(ae.connectedEdges().length<ne)ne=ae.connectedEdges().length,te=we}),D.set(ye.id(),ee.nodes(":childless")[te].id())}),_.forEach(function(ye){var ee=void 0;if(ye.isParent())ee=h.get(D.get(ye.id()));else ee=h.get(ye.id());ye.neighborhood().nodes().forEach(function(te){if(r.intersection(ye.edgesWith(te)).length>0)if(te.isParent())n[ee].push(D.get(te.id()));else n[ee].push(te.id())})});var at=function(ee){var te=h.get(ee),ne=void 0;o.get(ee).forEach(function(ae){if(g.getElementById(ae).isParent())ne=D.get(ae);else ne=ae;n[te].push(ne),n[h.get(ne)].push(ee)})},qe=!0,K=!1,z=void 0;try{for(var pe=o.keys()[Symbol.iterator](),le;!(qe=(le=pe.next()).done);qe=!0){var me=le.value;at(me)}}catch(ye){K=!0,z=ye}finally{try{if(!qe&&pe.return)pe.return()}finally{if(K)throw z}}Q=h.size;var fe=void 0;if(Q>2){de=Q<u.sampleSize?Q:u.sampleSize;for(var he=0;he<Q;he++)Y[he]=[];for(var Ee=0;Ee<de;Ee++)H[Ee]=[];if(u.quality=="draft"||u.step=="all")Ne(Ce),ke(),De(),fe={nodeIndexes:h,xCoords:P,yCoords:X};else h.forEach(function(ye,ee){P.push(g.getElementById(ee).position("x")),X.push(g.getElementById(ee).position("y"))}),fe={nodeIndexes:h,xCoords:P,yCoords:X};return fe}else{var Be=h.keys(),et=g.getElementById(Be.next().value),Pe=et.position(),Ye=et.outerWidth();if(P.push(Pe.x),X.push(Pe.y),Q==2){var We=g.getElementById(Be.next().value),Je=We.outerWidth();P.push(Pe.x+Ye/2+Je/2+u.idealEdgeLength),X.push(Pe.y)}return fe={nodeIndexes:h,xCoords:P,yCoords:X},fe}};k.exports={spectralLayout:d}},579:(k,B,v)=>{var b=v(212),c=function(d){if(!d)return;d("layout","fcose",b)};if(typeof cytoscape<"u")c(cytoscape);k.exports=c},140:(k)=>{k.exports=e}},s={};function w(k){var B=s[k];if(B!==void 0)return B.exports;var v=s[k]={exports:{}};return i[k](v,v.exports,w),v.exports}var m=w(579);return m})()})});var xt=Se(ft(),1);var ut={L:"left",R:"right",T:"top",B:"bottom"},gt={L:t((e)=>`${e},${e/2} 0,${e} 0,0`,"L"),R:t((e)=>`0,${e/2} ${e},0 ${e},${e}`,"R"),T:t((e)=>`0,0 ${e},0 ${e/2},${e}`,"T"),B:t((e)=>`${e/2},0 ${e},${e} 0,${e}`,"B")},ot={L:t((e,i)=>e-i+2,"L"),R:t((e,i)=>e-2,"R"),T:t((e,i)=>e-i+2,"T"),B:t((e,i)=>e-2,"B")},kt=t(function(e){if(Re(e))return e==="L"?"R":"L";else return e==="T"?"B":"T"},"getOppositeArchitectureDirection"),vt=t(function(e){let i=e;return i==="L"||i==="R"||i==="T"||i==="B"},"isArchitectureDirection"),Re=t(function(e){let i=e;return i==="L"||i==="R"},"isArchitectureDirectionX"),Ve=t(function(e){let i=e;return i==="T"||i==="B"},"isArchitectureDirectionY"),dt=t(function(e,i){let s=Re(e)&&Ve(i),w=Ve(e)&&Re(i);return s||w},"isArchitectureDirectionXY"),Dt=t(function(e){let i=e[0],s=e[1],w=Re(i)&&Ve(s),m=Ve(i)&&Re(s);return w||m},"isArchitecturePairXY"),Rt=t(function(e){return e!=="LL"&&e!=="RR"&&e!=="TT"&&e!=="BB"},"isValidArchitectureDirectionPair"),lt=t(function(e,i){let s=`${e}${i}`;return Rt(s)?s:void 0},"getArchitectureDirectionPair"),Mt=t(function([e,i],s){let w=s[0],m=s[1];if(Re(w))if(Ve(m))return[e+(w==="L"?-1:1),i+(m==="T"?1:-1)];else return[e+(w==="L"?-1:1),i];else if(Re(m))return[e+(m==="L"?1:-1),i+(w==="T"?1:-1)];else return[e,i+(w==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),Ft=t(function(e){if(e==="LT"||e==="TL")return[1,1];else if(e==="BL"||e==="LB")return[1,-1];else if(e==="BR"||e==="RB")return[-1,-1];else return[-1,1]},"getArchitectureDirectionXYFactors"),$t=t(function(e,i){if(dt(e,i))return"bend";else if(Re(e))return"horizontal";return"vertical"},"getArchitectureDirectionAlignment"),Pt=t(function(e){return e.type==="service"},"isArchitectureService"),Ot=t(function(e){return e.type==="junction"},"isArchitectureJunction"),pt=t((e,i)=>{let[s,w]=[e,i].sort();return`${JSON.stringify(s)}-${JSON.stringify(w)}`},"architectureGroupAlignmentKey"),yt=t((e)=>e.data(),"edgeData"),Qe=t((e)=>e.data(),"nodeData"),Gt=N.architecture,Et=class{constructor(){this.nodes=new Map,this.groups=new Map,this.edges=[],this.layoutHints=[],this.registeredIds=new Map,this.elements=new Map,this.diagramId="",this.setAccTitle=S,this.getAccTitle=E,this.setDiagramTitle=L,this.getDiagramTitle=R,this.getAccDescription=A,this.setAccDescription=T,this.clear()}static{t(this,"ArchitectureDB")}setDiagramId(e){this.diagramId=e}getDiagramId(){return this.diagramId}clear(){this.nodes=new Map,this.groups=new Map,this.edges=[],this.layoutHints=[],this.registeredIds=new Map,this.dataStructures=void 0,this.elements=new Map,this.diagramId="",C()}addService({id:e,icon:i,in:s,title:w,iconText:m}){if(this.registeredIds.has(e))throw Error(`The service id [${e}] is already in use by another ${this.registeredIds.get(e)}`);if(s!==void 0){if(e===s)throw Error(`The service [${e}] cannot be placed within itself`);if(!this.registeredIds.has(s))throw Error(`The service [${e}]'s parent does not exist. Please make sure the parent is created before this service`);if(this.registeredIds.get(s)==="node")throw Error(`The service [${e}]'s parent is not a group`)}this.registeredIds.set(e,"node"),this.nodes.set(e,{id:e,type:"service",icon:i,iconText:m,title:w,edges:[],in:s})}getServices(){return[...this.nodes.values()].filter(Pt)}addJunction({id:e,in:i}){if(this.registeredIds.has(e))throw Error(`The junction id [${e}] is already in use by another ${this.registeredIds.get(e)}`);if(i!==void 0){if(e===i)throw Error(`The junction [${e}] cannot be placed within itself`);if(!this.registeredIds.has(i))throw Error(`The junction [${e}]'s parent does not exist. Please make sure the parent is created before this junction`);if(this.registeredIds.get(i)==="node")throw Error(`The junction [${e}]'s parent is not a group`)}this.registeredIds.set(e,"node"),this.nodes.set(e,{id:e,type:"junction",edges:[],in:i})}getJunctions(){return[...this.nodes.values()].filter(Ot)}getNodes(){return[...this.nodes.values()]}getNode(e){return this.nodes.get(e)??null}addGroup({id:e,icon:i,in:s,title:w}){if(this.registeredIds.has(e))throw Error(`The group id [${e}] is already in use by another ${this.registeredIds.get(e)}`);if(s!==void 0){if(e===s)throw Error(`The group [${e}] cannot be placed within itself`);if(!this.registeredIds.has(s))throw Error(`The group [${e}]'s parent does not exist. Please make sure the parent is created before this group`);if(this.registeredIds.get(s)==="node")throw Error(`The group [${e}]'s parent is not a group`)}this.registeredIds.set(e,"group"),this.groups.set(e,{id:e,icon:i,title:w,in:s})}getGroups(){return[...this.groups.values()]}addEdge({lhsId:e,rhsId:i,lhsDir:s,rhsDir:w,lhsInto:m,rhsInto:k,lhsGroup:B,rhsGroup:v,title:b}){if(!vt(s))throw Error(`Invalid direction given for left hand side of edge ${e}--${i}. Expected (L,R,T,B) got ${String(s)}`);if(!vt(w))throw Error(`Invalid direction given for right hand side of edge ${e}--${i}. Expected (L,R,T,B) got ${String(w)}`);if(!this.nodes.has(e)&&!this.groups.has(e))throw Error(`The left-hand id [${e}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(!this.nodes.has(i)&&!this.groups.has(i))throw Error(`The right-hand id [${i}] does not yet exist. Please create the service/group before declaring an edge to it.`);let c=this.nodes.get(e).in,y=this.nodes.get(i).in;if(B&&c&&y&&c==y)throw Error(`The left-hand id [${e}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(v&&c&&y&&c==y)throw Error(`The right-hand id [${i}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);let d={lhsId:e,lhsDir:s,lhsInto:m,lhsGroup:B,rhsId:i,rhsDir:w,rhsInto:k,rhsGroup:v,title:b};this.edges.push(d);let f=this.nodes.get(e),u=this.nodes.get(i);if(f&&u)f.edges.push(this.edges[this.edges.length-1]),u.edges.push(this.edges[this.edges.length-1])}getEdges(){return this.edges}addLayoutHint(e){if(e.members.length<2)throw Error(`An align directive requires at least two members; got ${e.members.length}`);let i=new Set;e.members.forEach((s)=>{if(this.registeredIds.get(s)!=="node")throw Error(`align ${e.direction} references [${s}], which is not a service or junction`);if(i.has(s))throw Error(`align ${e.direction} lists [${s}] more than once`);i.add(s)}),this.layoutHints.push(e)}getLayoutHints(){return this.layoutHints}getDataStructures(){if(this.dataStructures===void 0){let e=new Map,i=new Map;for(let[B,v]of this.nodes.entries()){let b=new Map;for(let c of v.edges){let y=this.getNode(c.lhsId)?.in,d=this.getNode(c.rhsId)?.in;if(y&&d&&y!==d){let f=$t(c.lhsDir,c.rhsDir);if(f!=="bend")e.set(pt(y,d),f)}if(c.lhsId===B){let f=lt(c.lhsDir,c.rhsDir);if(f)b.set(f,c.rhsId)}else{let f=lt(c.rhsDir,c.lhsDir);if(f)b.set(f,c.lhsId)}}i.set(B,b)}let s=new Set,w=new Set(i.keys()),m=t((B)=>{let v=new Map([[B,[0,0]]]),b=[B];while(b.length>0){let c=b.shift();if(c){s.add(c),w.delete(c);let y=i.get(c);if(!y)throw Error(`BFS error: adjacency list for id ${c} not found. Please report this as a bug.`);let d=v.get(c);if(!d)throw Error(`BFS error: position for id ${c} not found in spatial map. Please report this as a bug.`);let[f,u]=d;y.forEach((g,r)=>{if(!s.has(g))v.set(g,Mt([f,u],r)),b.push(g)})}}return v},"BFS"),k=[];while(w.size>0){let B=w.values().next().value;k.push(m(B))}this.dataStructures={adjList:i,spatialMaps:k,groupAlignments:e}}return this.dataStructures}setElementForId(e,i){this.elements.set(e,i)}getElementById(e){return this.elements.get(e)}getConfig(){return U({...Gt,...x().architecture})}getConfigField(e){return this.getConfig()[e]}},zt=t((e,i)=>{G(e,i),e.groups.map((s)=>i.addGroup(s)),e.services.map((s)=>i.addService({...s,type:"service"})),e.junctions.map((s)=>i.addJunction({...s,type:"junction"})),e.edges.map((s)=>i.addEdge(s)),e.alignments?.map((s)=>i.addLayoutHint({direction:s.direction,members:[...s.members]}))},"populateDb"),wt={parser:{yy:void 0},parse:t(async(e)=>{let i=await J("architecture",e);a.debug(i);let s=wt.parser?.yy;if(!(s instanceof Et))throw Error("parser.parser?.yy was not a ArchitectureDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");zt(i,s)},"parse")},Bt=t((e)=>`
1
+ import{G}from"./chunk-eh7wp62z.js";import{t,a,N,x,O,gt,C,S,E,T,A,L,R,l,p,V,Gi,Ln,nt,U,ze,Le}from"./chunk-tfqarvdx.js";import{J}from"./chunk-qy1zx2yw.js";import{ft,vr}from"./chunk-tt93zbn4.js";import{Se,Te}from"./chunk-ngt1j8py.js";var ut=Te(function(rt,st){(function(i,s){if(typeof rt==="object"&&typeof st==="object")st.exports=s(vr());else if(typeof define==="function"&&define.amd)define(["cose-base"],s);else if(typeof rt==="object")rt.cytoscapeFcose=s(vr());else i.cytoscapeFcose=s(i.coseBase)})(rt,function(e){return(()=>{var i={658:(k)=>{k.exports=Object.assign!=null?Object.assign.bind(Object):function(B){for(var v=arguments.length,b=Array(v>1?v-1:0),c=1;c<v;c++)b[c-1]=arguments[c];return b.forEach(function(y){Object.keys(y).forEach(function(d){return B[d]=y[d]})}),B}},548:(k,B,v)=>{var b=function(){function d(f,u){var g=[],r=!0,_=!1,F=void 0;try{for(var o=f[Symbol.iterator](),h;!(r=(h=o.next()).done);r=!0)if(g.push(h.value),u&&g.length===u)break}catch(D){_=!0,F=D}finally{try{if(!r&&o.return)o.return()}finally{if(_)throw F}}return g}return function(f,u){if(Array.isArray(f))return f;else if(Symbol.iterator in Object(f))return d(f,u);else throw TypeError("Invalid attempt to destructure non-iterable instance")}}(),c=v(140).layoutBase.LinkedList,y={};y.getTopMostNodes=function(d){var f={};for(var u=0;u<d.length;u++)f[d[u].id()]=!0;var g=d.filter(function(r,_){if(typeof r==="number")r=_;var F=r.parent()[0];while(F!=null){if(f[F.id()])return!1;F=F.parent()[0]}return!0});return g},y.connectComponents=function(d,f,u,g){var r=new c,_=new Set,F=[],o=void 0,h=void 0,D=void 0,n=!1,P=1,X=[],M=[],j=function(){var I=d.collection();M.push(I);var H=u[0],Z=d.collection();Z.merge(H).merge(H.descendants().intersection(f)),F.push(H),Z.forEach(function(re){r.push(re),_.add(re),I.merge(re)});var Q=function(){H=r.shift();var ue=d.collection();H.neighborhood().nodes().forEach(function(q){if(f.intersection(H.edgesWith(q)).length>0)ue.merge(q)});for(var Ce=0;Ce<ue.length;Ce++){var $e=ue[Ce];if(o=u.intersection($e.union($e.ancestors())),o!=null&&!_.has(o[0])){var de=o.union(o.descendants());de.forEach(function(q){if(r.push(q),_.add(q),I.merge(q),u.has(q))F.push(q)})}}};while(r.length!=0)Q();if(I.forEach(function(re){f.intersection(re.connectedEdges()).forEach(function(ue){if(I.has(ue.source())&&I.has(ue.target()))I.merge(ue)})}),F.length==u.length)n=!0;if(!n||n&&P>1){h=F[0],D=h.connectedEdges().length,F.forEach(function(re){if(re.connectedEdges().length<D)D=re.connectedEdges().length,h=re}),X.push(h.id());var se=d.collection();se.merge(F[0]),F.forEach(function(re){se.merge(re)}),F=[],u=u.difference(se),P++}};do j();while(!n);if(g){if(X.length>0)g.set("dummy"+(g.size+1),X)}return M},y.relocateComponent=function(d,f,u){if(!u.fixedNodeConstraint){var{POSITIVE_INFINITY:g,NEGATIVE_INFINITY:r,POSITIVE_INFINITY:_,NEGATIVE_INFINITY:F}=Number;if(u.quality=="draft"){var o=!0,h=!1,D=void 0;try{for(var n=f.nodeIndexes[Symbol.iterator](),P;!(o=(P=n.next()).done);o=!0){var X=P.value,M=b(X,2),j=M[0],Y=M[1],I=u.cy.getElementById(j);if(I){var H=I.boundingBox(),Z=f.xCoords[Y]-H.w/2,Q=f.xCoords[Y]+H.w/2,se=f.yCoords[Y]-H.h/2,re=f.yCoords[Y]+H.h/2;if(Z<g)g=Z;if(Q>r)r=Q;if(se<_)_=se;if(re>F)F=re}}}catch(q){h=!0,D=q}finally{try{if(!o&&n.return)n.return()}finally{if(h)throw D}}var ue=d.x-(r+g)/2,Ce=d.y-(F+_)/2;f.xCoords=f.xCoords.map(function(q){return q+ue}),f.yCoords=f.yCoords.map(function(q){return q+Ce})}else{Object.keys(f).forEach(function(q){var oe=f[q],Ne=oe.getRect().x,ke=oe.getRect().x+oe.getRect().width,De=oe.getRect().y,xe=oe.getRect().y+oe.getRect().height;if(Ne<g)g=Ne;if(ke>r)r=ke;if(De<_)_=De;if(xe>F)F=xe});var $e=d.x-(r+g)/2,de=d.y-(F+_)/2;Object.keys(f).forEach(function(q){var oe=f[q];oe.setCenter(oe.getCenterX()+$e,oe.getCenterY()+de)})}}},y.calcBoundingBox=function(d,f,u,g){var{MAX_SAFE_INTEGER:r,MIN_SAFE_INTEGER:_,MAX_SAFE_INTEGER:F,MIN_SAFE_INTEGER:o}=Number,h=void 0,D=void 0,n=void 0,P=void 0,X=d.descendants().not(":parent"),M=X.length;for(var j=0;j<M;j++){var Y=X[j];if(h=f[g.get(Y.id())]-Y.width()/2,D=f[g.get(Y.id())]+Y.width()/2,n=u[g.get(Y.id())]-Y.height()/2,P=u[g.get(Y.id())]+Y.height()/2,r>h)r=h;if(_<D)_=D;if(F>n)F=n;if(o<P)o=P}var I={};return I.topLeftX=r,I.topLeftY=F,I.width=_-r,I.height=o-F,I},y.calcParentsWithoutChildren=function(d,f){var u=d.collection();return f.nodes(":parent").forEach(function(g){var r=!1;if(g.children().forEach(function(_){if(_.css("display")!="none")r=!0}),!r)u.merge(g)}),u},k.exports=y},816:(k,B,v)=>{var b=v(548),c=v(140).CoSELayout,y=v(140).CoSENode,d=v(140).layoutBase.PointD,f=v(140).layoutBase.DimensionD,u=v(140).layoutBase.LayoutConstants,g=v(140).layoutBase.FDLayoutConstants,r=v(140).CoSEConstants,_=function(o,h){var{cy:D,eles:n}=o,P=n.nodes(),X=n.edges(),M=void 0,j=void 0,Y=void 0,I={};if(o.randomize)M=h.nodeIndexes,j=h.xCoords,Y=h.yCoords;var H=function(q){return typeof q==="function"},Z=function(q,oe){if(H(q))return q(oe);else return q},Q=b.calcParentsWithoutChildren(D,n),se=function de(q,oe,Ne,ke){var De=oe.length;for(var xe=0;xe<De;xe++){var W=oe[xe],Ae=null;if(W.intersection(Q).length==0)Ae=W.children();var ie=void 0,ve=W.layoutDimensions({nodeDimensionsIncludeLabels:ke.nodeDimensionsIncludeLabels});if(W.outerWidth()!=null&&W.outerHeight()!=null)if(ke.randomize)if(!W.isParent())ie=q.add(new y(Ne.graphManager,new d(j[M.get(W.id())]-ve.w/2,Y[M.get(W.id())]-ve.h/2),new f(parseFloat(ve.w),parseFloat(ve.h))));else{var Me=b.calcBoundingBox(W,j,Y,M);if(W.intersection(Q).length==0)ie=q.add(new y(Ne.graphManager,new d(Me.topLeftX,Me.topLeftY),new f(Me.width,Me.height)));else ie=q.add(new y(Ne.graphManager,new d(Me.topLeftX,Me.topLeftY),new f(parseFloat(ve.w),parseFloat(ve.h))))}else ie=q.add(new y(Ne.graphManager,new d(W.position("x")-ve.w/2,W.position("y")-ve.h/2),new f(parseFloat(ve.w),parseFloat(ve.h))));else ie=q.add(new y(this.graphManager));if(ie.id=W.data("id"),ie.nodeRepulsion=Z(ke.nodeRepulsion,W),ie.paddingLeft=parseInt(W.css("padding")),ie.paddingTop=parseInt(W.css("padding")),ie.paddingRight=parseInt(W.css("padding")),ie.paddingBottom=parseInt(W.css("padding")),ke.nodeDimensionsIncludeLabels)ie.labelWidth=W.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).w,ie.labelHeight=W.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).h,ie.labelPosVertical=W.css("text-valign"),ie.labelPosHorizontal=W.css("text-halign");if(I[W.data("id")]=ie,isNaN(ie.rect.x))ie.rect.x=0;if(isNaN(ie.rect.y))ie.rect.y=0;if(Ae!=null&&Ae.length>0){var Ge=void 0;Ge=Ne.getGraphManager().add(Ne.newGraph(),ie),de(Ge,Ae,Ne,ke)}}},re=function(q,oe,Ne){var ke=0,De=0;for(var xe=0;xe<Ne.length;xe++){var W=Ne[xe],Ae=I[W.data("source")],ie=I[W.data("target")];if(Ae&&ie&&Ae!==ie&&Ae.getEdgesBetween(ie).length==0){var ve=oe.add(q.newEdge(),Ae,ie);ve.id=W.id(),ve.idealLength=Z(o.idealEdgeLength,W),ve.edgeElasticity=Z(o.edgeElasticity,W),ke+=ve.idealLength,De++}}if(o.idealEdgeLength!=null){if(De>0)r.DEFAULT_EDGE_LENGTH=g.DEFAULT_EDGE_LENGTH=ke/De;else if(!H(o.idealEdgeLength))r.DEFAULT_EDGE_LENGTH=g.DEFAULT_EDGE_LENGTH=o.idealEdgeLength;else r.DEFAULT_EDGE_LENGTH=g.DEFAULT_EDGE_LENGTH=50;r.MIN_REPULSION_DIST=g.MIN_REPULSION_DIST=g.DEFAULT_EDGE_LENGTH/10,r.DEFAULT_RADIAL_SEPARATION=g.DEFAULT_EDGE_LENGTH}},ue=function(q,oe){if(oe.fixedNodeConstraint)q.constraints.fixedNodeConstraint=oe.fixedNodeConstraint;if(oe.alignmentConstraint)q.constraints.alignmentConstraint=oe.alignmentConstraint;if(oe.relativePlacementConstraint)q.constraints.relativePlacementConstraint=oe.relativePlacementConstraint};if(o.nestingFactor!=null)r.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=g.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=o.nestingFactor;if(o.gravity!=null)r.DEFAULT_GRAVITY_STRENGTH=g.DEFAULT_GRAVITY_STRENGTH=o.gravity;if(o.numIter!=null)r.MAX_ITERATIONS=g.MAX_ITERATIONS=o.numIter;if(o.gravityRange!=null)r.DEFAULT_GRAVITY_RANGE_FACTOR=g.DEFAULT_GRAVITY_RANGE_FACTOR=o.gravityRange;if(o.gravityCompound!=null)r.DEFAULT_COMPOUND_GRAVITY_STRENGTH=g.DEFAULT_COMPOUND_GRAVITY_STRENGTH=o.gravityCompound;if(o.gravityRangeCompound!=null)r.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=g.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=o.gravityRangeCompound;if(o.initialEnergyOnIncremental!=null)r.DEFAULT_COOLING_FACTOR_INCREMENTAL=g.DEFAULT_COOLING_FACTOR_INCREMENTAL=o.initialEnergyOnIncremental;if(o.tilingCompareBy!=null)r.TILING_COMPARE_BY=o.tilingCompareBy;if(o.quality=="proof")u.QUALITY=2;else u.QUALITY=0;if(r.NODE_DIMENSIONS_INCLUDE_LABELS=g.NODE_DIMENSIONS_INCLUDE_LABELS=u.NODE_DIMENSIONS_INCLUDE_LABELS=o.nodeDimensionsIncludeLabels,r.DEFAULT_INCREMENTAL=g.DEFAULT_INCREMENTAL=u.DEFAULT_INCREMENTAL=!o.randomize,r.ANIMATE=g.ANIMATE=u.ANIMATE=o.animate,r.TILE=o.tile,r.TILING_PADDING_VERTICAL=typeof o.tilingPaddingVertical==="function"?o.tilingPaddingVertical.call():o.tilingPaddingVertical,r.TILING_PADDING_HORIZONTAL=typeof o.tilingPaddingHorizontal==="function"?o.tilingPaddingHorizontal.call():o.tilingPaddingHorizontal,r.DEFAULT_INCREMENTAL=g.DEFAULT_INCREMENTAL=u.DEFAULT_INCREMENTAL=!0,r.PURE_INCREMENTAL=!o.randomize,u.DEFAULT_UNIFORM_LEAF_NODE_SIZES=o.uniformNodeDimensions,o.step=="transformed")r.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,r.ENFORCE_CONSTRAINTS=!1,r.APPLY_LAYOUT=!1;if(o.step=="enforced")r.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,r.ENFORCE_CONSTRAINTS=!0,r.APPLY_LAYOUT=!1;if(o.step=="cose")r.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,r.ENFORCE_CONSTRAINTS=!1,r.APPLY_LAYOUT=!0;if(o.step=="all"){if(o.randomize)r.TRANSFORM_ON_CONSTRAINT_HANDLING=!0;else r.TRANSFORM_ON_CONSTRAINT_HANDLING=!1;r.ENFORCE_CONSTRAINTS=!0,r.APPLY_LAYOUT=!0}if(o.fixedNodeConstraint||o.alignmentConstraint||o.relativePlacementConstraint)r.TREE_REDUCTION_ON_INCREMENTAL=!1;else r.TREE_REDUCTION_ON_INCREMENTAL=!0;var Ce=new c,$e=Ce.newGraphManager();return se($e.addRoot(),b.getTopMostNodes(P),Ce,o),re(Ce,$e,X),ue(Ce,o),Ce.runLayout(),I};k.exports={coseLayout:_}},212:(k,B,v)=>{var b=function(){function o(h,D){for(var n=0;n<D.length;n++){var P=D[n];if(P.enumerable=P.enumerable||!1,P.configurable=!0,"value"in P)P.writable=!0;Object.defineProperty(h,P.key,P)}}return function(h,D,n){if(D)o(h.prototype,D);if(n)o(h,n);return h}}();function c(o,h){if(!(o instanceof h))throw TypeError("Cannot call a class as a function")}var y=v(658),d=v(548),f=v(657),u=f.spectralLayout,g=v(816),r=g.coseLayout,_=Object.freeze({quality:"default",randomize:!0,animate:!0,animationDuration:1000,animationEasing:void 0,fit:!0,padding:30,nodeDimensionsIncludeLabels:!1,uniformNodeDimensions:!1,packComponents:!0,step:"all",samplingType:!0,sampleSize:25,nodeSeparation:75,piTol:0.0000001,nodeRepulsion:function(h){return 4500},idealEdgeLength:function(h){return 50},edgeElasticity:function(h){return 0.45},nestingFactor:0.1,gravity:0.25,numIter:2500,tile:!0,tilingCompareBy:void 0,tilingPaddingVertical:10,tilingPaddingHorizontal:10,gravityRangeCompound:1.5,gravityCompound:1,gravityRange:3.8,initialEnergyOnIncremental:0.3,fixedNodeConstraint:void 0,alignmentConstraint:void 0,relativePlacementConstraint:void 0,ready:function(){},stop:function(){}}),F=function(){function o(h){c(this,o),this.options=y({},_,h)}return b(o,[{key:"run",value:function(){var D=this,n=this.options,{cy:P,eles:X}=n,M=[],j=void 0,Y=void 0,I=[],H=void 0,Z=[];if(n.fixedNodeConstraint&&(!Array.isArray(n.fixedNodeConstraint)||n.fixedNodeConstraint.length==0))n.fixedNodeConstraint=void 0;if(n.alignmentConstraint){if(n.alignmentConstraint.vertical&&(!Array.isArray(n.alignmentConstraint.vertical)||n.alignmentConstraint.vertical.length==0))n.alignmentConstraint.vertical=void 0;if(n.alignmentConstraint.horizontal&&(!Array.isArray(n.alignmentConstraint.horizontal)||n.alignmentConstraint.horizontal.length==0))n.alignmentConstraint.horizontal=void 0}if(n.relativePlacementConstraint&&(!Array.isArray(n.relativePlacementConstraint)||n.relativePlacementConstraint.length==0))n.relativePlacementConstraint=void 0;var Q=n.fixedNodeConstraint||n.alignmentConstraint||n.relativePlacementConstraint;if(Q)n.tile=!1,n.packComponents=!1;var se=void 0,re=!1;if(P.layoutUtilities&&n.packComponents){if(se=P.layoutUtilities("get"),!se)se=P.layoutUtilities();re=!0}if(X.nodes().length>0)if(!re){var ue=n.eles.boundingBox();if(Z.push({x:ue.x1+ue.w/2,y:ue.y1+ue.h/2}),n.randomize){var Ce=u(n);M.push(Ce)}if(n.quality=="default"||n.quality=="proof")I.push(r(n,M[0])),d.relocateComponent(Z[0],I[0],n);else d.relocateComponent(Z[0],M[0],n)}else{var $e=d.getTopMostNodes(n.eles.nodes());if(H=d.connectComponents(P,n.eles,$e),H.forEach(function(K){var z=K.boundingBox();Z.push({x:z.x1+z.w/2,y:z.y1+z.h/2})}),n.randomize)H.forEach(function(K){n.eles=K,M.push(u(n))});if(n.quality=="default"||n.quality=="proof"){var de=P.collection();if(n.tile){var q=new Map,oe=[],Ne=[],ke=0,De={nodeIndexes:q,xCoords:oe,yCoords:Ne},xe=[];if(H.forEach(function(K,z){if(K.edges().length==0)K.nodes().forEach(function(pe,le){if(de.merge(K.nodes()[le]),!pe.isParent())De.nodeIndexes.set(K.nodes()[le].id(),ke++),De.xCoords.push(K.nodes()[0].position().x),De.yCoords.push(K.nodes()[0].position().y)}),xe.push(z)}),de.length>1){var W=de.boundingBox();Z.push({x:W.x1+W.w/2,y:W.y1+W.h/2}),H.push(de),M.push(De);for(var Ae=xe.length-1;Ae>=0;Ae--)H.splice(xe[Ae],1),M.splice(xe[Ae],1),Z.splice(xe[Ae],1)}}H.forEach(function(K,z){n.eles=K,I.push(r(n,M[z])),d.relocateComponent(Z[z],I[z],n)})}else H.forEach(function(K,z){d.relocateComponent(Z[z],M[z],n)});var ie=new Set;if(H.length>1){var ve=[],Me=X.filter(function(K){return K.css("display")=="none"});H.forEach(function(K,z){var pe=void 0;if(n.quality=="draft")pe=M[z].nodeIndexes;if(K.nodes().not(Me).length>0){var le={};le.edges=[],le.nodes=[];var me=void 0;if(K.nodes().not(Me).forEach(function(fe){if(n.quality=="draft")if(!fe.isParent())me=pe.get(fe.id()),le.nodes.push({x:M[z].xCoords[me]-fe.boundingbox().w/2,y:M[z].yCoords[me]-fe.boundingbox().h/2,width:fe.boundingbox().w,height:fe.boundingbox().h});else{var he=d.calcBoundingBox(fe,M[z].xCoords,M[z].yCoords,pe);le.nodes.push({x:he.topLeftX,y:he.topLeftY,width:he.width,height:he.height})}else if(I[z][fe.id()])le.nodes.push({x:I[z][fe.id()].getLeft(),y:I[z][fe.id()].getTop(),width:I[z][fe.id()].getWidth(),height:I[z][fe.id()].getHeight()})}),K.edges().forEach(function(fe){var he=fe.source(),Ee=fe.target();if(he.css("display")!="none"&&Ee.css("display")!="none"){if(n.quality=="draft"){var Be=pe.get(he.id()),et=pe.get(Ee.id()),Pe=[],Ye=[];if(he.isParent()){var We=d.calcBoundingBox(he,M[z].xCoords,M[z].yCoords,pe);Pe.push(We.topLeftX+We.width/2),Pe.push(We.topLeftY+We.height/2)}else Pe.push(M[z].xCoords[Be]),Pe.push(M[z].yCoords[Be]);if(Ee.isParent()){var Je=d.calcBoundingBox(Ee,M[z].xCoords,M[z].yCoords,pe);Ye.push(Je.topLeftX+Je.width/2),Ye.push(Je.topLeftY+Je.height/2)}else Ye.push(M[z].xCoords[et]),Ye.push(M[z].yCoords[et]);le.edges.push({startX:Pe[0],startY:Pe[1],endX:Ye[0],endY:Ye[1]})}else if(I[z][he.id()]&&I[z][Ee.id()])le.edges.push({startX:I[z][he.id()].getCenterX(),startY:I[z][he.id()].getCenterY(),endX:I[z][Ee.id()].getCenterX(),endY:I[z][Ee.id()].getCenterY()})}}),le.nodes.length>0)ve.push(le),ie.add(z)}});var Ge=se.packComponents(ve,n.randomize).shifts;if(n.quality=="draft")M.forEach(function(K,z){var pe=K.xCoords.map(function(me){return me+Ge[z].dx}),le=K.yCoords.map(function(me){return me+Ge[z].dy});K.xCoords=pe,K.yCoords=le});else{var Ke=0;ie.forEach(function(K){Object.keys(I[K]).forEach(function(z){var pe=I[K][z];pe.setCenter(pe.getCenterX()+Ge[Ke].dx,pe.getCenterY()+Ge[Ke].dy)}),Ke++})}}}var je=function(z,pe){if(n.quality=="default"||n.quality=="proof"){if(typeof z==="number")z=pe;var le=void 0,me=void 0,fe=z.data("id");if(I.forEach(function(Ee){if(fe in Ee)le={x:Ee[fe].getRect().getCenterX(),y:Ee[fe].getRect().getCenterY()},me=Ee[fe]}),n.nodeDimensionsIncludeLabels){if(me.labelWidth){if(me.labelPosHorizontal=="left")le.x+=me.labelWidth/2;else if(me.labelPosHorizontal=="right")le.x-=me.labelWidth/2}if(me.labelHeight){if(me.labelPosVertical=="top")le.y+=me.labelHeight/2;else if(me.labelPosVertical=="bottom")le.y-=me.labelHeight/2}}if(le==null)le={x:z.position("x"),y:z.position("y")};return{x:le.x,y:le.y}}else{var he=void 0;if(M.forEach(function(Ee){var Be=Ee.nodeIndexes.get(z.id());if(Be!=null)he={x:Ee.xCoords[Be],y:Ee.yCoords[Be]}}),he==null)he={x:z.position("x"),y:z.position("y")};return{x:he.x,y:he.y}}};if(n.quality=="default"||n.quality=="proof"||n.randomize){var at=d.calcParentsWithoutChildren(P,X),qe=X.filter(function(K){return K.css("display")=="none"});if(n.eles=X.not(qe),X.nodes().not(":parent").not(qe).layoutPositions(D,n,je),at.length>0)at.forEach(function(K){K.position(je(K))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),o}();k.exports=F},657:(k,B,v)=>{var b=v(548),c=v(140).layoutBase.Matrix,y=v(140).layoutBase.SVD,d=function(u){var{cy:g,eles:r}=u,_=r.nodes(),F=r.nodes(":parent"),o=new Map,h=new Map,D=new Map,n=[],P=[],X=[],M=[],j=[],Y=[],I=[],H=[],Z=void 0,Q=void 0,se=1e8,re=0.000000001,{piTol:ue,samplingType:Ce,nodeSeparation:$e}=u,de=void 0,q=function(){var ee=0,te=0,ne=!1;while(te<de){ee=Math.floor(Math.random()*Q),ne=!1;for(var ae=0;ae<te;ae++)if(M[ae]==ee){ne=!0;break}if(!ne)M[te]=ee,te++;else continue}},oe=function(ee,te,ne){var ae=[],we=0,ge=0,ce=0,Ie=void 0,be=[],Fe=0,_e=1;for(var Ue=0;Ue<Q;Ue++)be[Ue]=se;ae[ge]=ee,be[ee]=0;while(ge>=we){ce=ae[we++];var Xe=n[ce];for(var He=0;He<Xe.length;He++)if(Ie=h.get(Xe[He]),be[Ie]==se)be[Ie]=be[ce]+1,ae[++ge]=Ie;Y[ce][te]=be[ce]*$e}if(ne){for(var Oe=0;Oe<Q;Oe++)if(Y[Oe][te]<j[Oe])j[Oe]=Y[Oe][te];for(var tt=0;tt<Q;tt++)if(j[tt]>Fe)Fe=j[tt],_e=tt}return _e},Ne=function(ee){var te=void 0;if(!ee){q();for(var ne=0;ne<de;ne++)oe(M[ne],ne,ee,!1)}else{te=Math.floor(Math.random()*Q),Z=te;for(var ae=0;ae<Q;ae++)j[ae]=se;for(var we=0;we<de;we++)M[we]=te,te=oe(te,we,ee)}for(var ge=0;ge<Q;ge++)for(var ce=0;ce<de;ce++)Y[ge][ce]*=Y[ge][ce];for(var Ie=0;Ie<de;Ie++)I[Ie]=[];for(var be=0;be<de;be++)for(var Fe=0;Fe<de;Fe++)I[be][Fe]=Y[M[Fe]][be]},ke=function(){var ee=y.svd(I),{S:te,U:ne,V:ae}=ee,we=te[0]*te[0]*te[0],ge=[];for(var ce=0;ce<de;ce++){ge[ce]=[];for(var Ie=0;Ie<de;Ie++)if(ge[ce][Ie]=0,ce==Ie)ge[ce][Ie]=te[ce]/(te[ce]*te[ce]+we/(te[ce]*te[ce]))}H=c.multMat(c.multMat(ae,ge),c.transpose(ne))},De=function(){var ee=void 0,te=void 0,ne=[],ae=[],we=[],ge=[];for(var ce=0;ce<Q;ce++)ne[ce]=Math.random(),ae[ce]=Math.random();ne=c.normalize(ne),ae=c.normalize(ae);var Ie=0,be=re,Fe=re,_e=void 0;while(!0){Ie++;for(var Ue=0;Ue<Q;Ue++)we[Ue]=ne[Ue];if(ne=c.multGamma(c.multL(c.multGamma(we),Y,H)),ee=c.dotProduct(we,ne),ne=c.normalize(ne),be=c.dotProduct(we,ne),_e=Math.abs(be/Fe),_e<=1+ue&&_e>=1)break;Fe=be}for(var Xe=0;Xe<Q;Xe++)we[Xe]=ne[Xe];Ie=0,Fe=re;while(!0){Ie++;for(var He=0;He<Q;He++)ge[He]=ae[He];if(ge=c.minusOp(ge,c.multCons(we,c.dotProduct(we,ge))),ae=c.multGamma(c.multL(c.multGamma(ge),Y,H)),te=c.dotProduct(ge,ae),ae=c.normalize(ae),be=c.dotProduct(ge,ae),_e=Math.abs(be/Fe),_e<=1+ue&&_e>=1)break;Fe=be}for(var Oe=0;Oe<Q;Oe++)ge[Oe]=ae[Oe];P=c.multCons(we,Math.sqrt(Math.abs(ee))),X=c.multCons(ge,Math.sqrt(Math.abs(te)))};b.connectComponents(g,r,b.getTopMostNodes(_),o),F.forEach(function(ye){b.connectComponents(g,r,b.getTopMostNodes(ye.descendants().intersection(r)),o)});var xe=0;for(var W=0;W<_.length;W++)if(!_[W].isParent())h.set(_[W].id(),xe++);var Ae=!0,ie=!1,ve=void 0;try{for(var Me=o.keys()[Symbol.iterator](),Ge;!(Ae=(Ge=Me.next()).done);Ae=!0){var Ke=Ge.value;h.set(Ke,xe++)}}catch(ye){ie=!0,ve=ye}finally{try{if(!Ae&&Me.return)Me.return()}finally{if(ie)throw ve}}for(var je=0;je<h.size;je++)n[je]=[];F.forEach(function(ye){var ee=ye.children().intersection(r);while(ee.nodes(":childless").length==0)ee=ee.nodes()[0].children().intersection(r);var te=0,ne=ee.nodes(":childless")[0].connectedEdges().length;ee.nodes(":childless").forEach(function(ae,we){if(ae.connectedEdges().length<ne)ne=ae.connectedEdges().length,te=we}),D.set(ye.id(),ee.nodes(":childless")[te].id())}),_.forEach(function(ye){var ee=void 0;if(ye.isParent())ee=h.get(D.get(ye.id()));else ee=h.get(ye.id());ye.neighborhood().nodes().forEach(function(te){if(r.intersection(ye.edgesWith(te)).length>0)if(te.isParent())n[ee].push(D.get(te.id()));else n[ee].push(te.id())})});var at=function(ee){var te=h.get(ee),ne=void 0;o.get(ee).forEach(function(ae){if(g.getElementById(ae).isParent())ne=D.get(ae);else ne=ae;n[te].push(ne),n[h.get(ne)].push(ee)})},qe=!0,K=!1,z=void 0;try{for(var pe=o.keys()[Symbol.iterator](),le;!(qe=(le=pe.next()).done);qe=!0){var me=le.value;at(me)}}catch(ye){K=!0,z=ye}finally{try{if(!qe&&pe.return)pe.return()}finally{if(K)throw z}}Q=h.size;var fe=void 0;if(Q>2){de=Q<u.sampleSize?Q:u.sampleSize;for(var he=0;he<Q;he++)Y[he]=[];for(var Ee=0;Ee<de;Ee++)H[Ee]=[];if(u.quality=="draft"||u.step=="all")Ne(Ce),ke(),De(),fe={nodeIndexes:h,xCoords:P,yCoords:X};else h.forEach(function(ye,ee){P.push(g.getElementById(ee).position("x")),X.push(g.getElementById(ee).position("y"))}),fe={nodeIndexes:h,xCoords:P,yCoords:X};return fe}else{var Be=h.keys(),et=g.getElementById(Be.next().value),Pe=et.position(),Ye=et.outerWidth();if(P.push(Pe.x),X.push(Pe.y),Q==2){var We=g.getElementById(Be.next().value),Je=We.outerWidth();P.push(Pe.x+Ye/2+Je/2+u.idealEdgeLength),X.push(Pe.y)}return fe={nodeIndexes:h,xCoords:P,yCoords:X},fe}};k.exports={spectralLayout:d}},579:(k,B,v)=>{var b=v(212),c=function(d){if(!d)return;d("layout","fcose",b)};if(typeof cytoscape<"u")c(cytoscape);k.exports=c},140:(k)=>{k.exports=e}},s={};function w(k){var B=s[k];if(B!==void 0)return B.exports;var v=s[k]={exports:{}};return i[k](v,v.exports,w),v.exports}var m=w(579);return m})()})});var xt=Se(ut(),1);var ht={L:"left",R:"right",T:"top",B:"bottom"},vt={L:t((e)=>`${e},${e/2} 0,${e} 0,0`,"L"),R:t((e)=>`0,${e/2} ${e},0 ${e},${e}`,"R"),T:t((e)=>`0,0 ${e},0 ${e/2},${e}`,"T"),B:t((e)=>`${e/2},0 ${e},${e} 0,${e}`,"B")},ot={L:t((e,i)=>e-i+2,"L"),R:t((e,i)=>e-2,"R"),T:t((e,i)=>e-i+2,"T"),B:t((e,i)=>e-2,"B")},kt=t(function(e){if(Re(e))return e==="L"?"R":"L";else return e==="T"?"B":"T"},"getOppositeArchitectureDirection"),pt=t(function(e){let i=e;return i==="L"||i==="R"||i==="T"||i==="B"},"isArchitectureDirection"),Re=t(function(e){let i=e;return i==="L"||i==="R"},"isArchitectureDirectionX"),Ve=t(function(e){let i=e;return i==="T"||i==="B"},"isArchitectureDirectionY"),dt=t(function(e,i){let s=Re(e)&&Ve(i),w=Ve(e)&&Re(i);return s||w},"isArchitectureDirectionXY"),Dt=t(function(e){let i=e[0],s=e[1],w=Re(i)&&Ve(s),m=Ve(i)&&Re(s);return w||m},"isArchitecturePairXY"),Rt=t(function(e){return e!=="LL"&&e!=="RR"&&e!=="TT"&&e!=="BB"},"isValidArchitectureDirectionPair"),lt=t(function(e,i){let s=`${e}${i}`;return Rt(s)?s:void 0},"getArchitectureDirectionPair"),Mt=t(function([e,i],s){let w=s[0],m=s[1];if(Re(w))if(Ve(m))return[e+(w==="L"?-1:1),i+(m==="T"?1:-1)];else return[e+(w==="L"?-1:1),i];else if(Re(m))return[e+(m==="L"?1:-1),i+(w==="T"?1:-1)];else return[e,i+(w==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),Ft=t(function(e){if(e==="LT"||e==="TL")return[1,1];else if(e==="BL"||e==="LB")return[1,-1];else if(e==="BR"||e==="RB")return[-1,-1];else return[-1,1]},"getArchitectureDirectionXYFactors"),$t=t(function(e,i){if(dt(e,i))return"bend";else if(Re(e))return"horizontal";return"vertical"},"getArchitectureDirectionAlignment"),Pt=t(function(e){return e.type==="service"},"isArchitectureService"),Ot=t(function(e){return e.type==="junction"},"isArchitectureJunction"),mt=t((e,i)=>{let[s,w]=[e,i].sort();return`${JSON.stringify(s)}-${JSON.stringify(w)}`},"architectureGroupAlignmentKey"),yt=t((e)=>e.data(),"edgeData"),Qe=t((e)=>e.data(),"nodeData"),Gt=N.architecture,Et=class{constructor(){this.nodes=new Map,this.groups=new Map,this.edges=[],this.layoutHints=[],this.registeredIds=new Map,this.elements=new Map,this.diagramId="",this.setAccTitle=S,this.getAccTitle=E,this.setDiagramTitle=L,this.getDiagramTitle=R,this.getAccDescription=A,this.setAccDescription=T,this.clear()}static{t(this,"ArchitectureDB")}setDiagramId(e){this.diagramId=e}getDiagramId(){return this.diagramId}clear(){this.nodes=new Map,this.groups=new Map,this.edges=[],this.layoutHints=[],this.registeredIds=new Map,this.dataStructures=void 0,this.elements=new Map,this.diagramId="",C()}addService({id:e,icon:i,in:s,title:w,iconText:m}){if(this.registeredIds.has(e))throw Error(`The service id [${e}] is already in use by another ${this.registeredIds.get(e)}`);if(s!==void 0){if(e===s)throw Error(`The service [${e}] cannot be placed within itself`);if(!this.registeredIds.has(s))throw Error(`The service [${e}]'s parent does not exist. Please make sure the parent is created before this service`);if(this.registeredIds.get(s)==="node")throw Error(`The service [${e}]'s parent is not a group`)}this.registeredIds.set(e,"node"),this.nodes.set(e,{id:e,type:"service",icon:i,iconText:m,title:w,edges:[],in:s})}getServices(){return[...this.nodes.values()].filter(Pt)}addJunction({id:e,in:i}){if(this.registeredIds.has(e))throw Error(`The junction id [${e}] is already in use by another ${this.registeredIds.get(e)}`);if(i!==void 0){if(e===i)throw Error(`The junction [${e}] cannot be placed within itself`);if(!this.registeredIds.has(i))throw Error(`The junction [${e}]'s parent does not exist. Please make sure the parent is created before this junction`);if(this.registeredIds.get(i)==="node")throw Error(`The junction [${e}]'s parent is not a group`)}this.registeredIds.set(e,"node"),this.nodes.set(e,{id:e,type:"junction",edges:[],in:i})}getJunctions(){return[...this.nodes.values()].filter(Ot)}getNodes(){return[...this.nodes.values()]}getNode(e){return this.nodes.get(e)??null}addGroup({id:e,icon:i,in:s,title:w}){if(this.registeredIds.has(e))throw Error(`The group id [${e}] is already in use by another ${this.registeredIds.get(e)}`);if(s!==void 0){if(e===s)throw Error(`The group [${e}] cannot be placed within itself`);if(!this.registeredIds.has(s))throw Error(`The group [${e}]'s parent does not exist. Please make sure the parent is created before this group`);if(this.registeredIds.get(s)==="node")throw Error(`The group [${e}]'s parent is not a group`)}this.registeredIds.set(e,"group"),this.groups.set(e,{id:e,icon:i,title:w,in:s})}getGroups(){return[...this.groups.values()]}addEdge({lhsId:e,rhsId:i,lhsDir:s,rhsDir:w,lhsInto:m,rhsInto:k,lhsGroup:B,rhsGroup:v,title:b}){if(!pt(s))throw Error(`Invalid direction given for left hand side of edge ${e}--${i}. Expected (L,R,T,B) got ${String(s)}`);if(!pt(w))throw Error(`Invalid direction given for right hand side of edge ${e}--${i}. Expected (L,R,T,B) got ${String(w)}`);if(!this.nodes.has(e)&&!this.groups.has(e))throw Error(`The left-hand id [${e}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(!this.nodes.has(i)&&!this.groups.has(i))throw Error(`The right-hand id [${i}] does not yet exist. Please create the service/group before declaring an edge to it.`);let c=this.nodes.get(e).in,y=this.nodes.get(i).in;if(B&&c&&y&&c==y)throw Error(`The left-hand id [${e}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(v&&c&&y&&c==y)throw Error(`The right-hand id [${i}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);let d={lhsId:e,lhsDir:s,lhsInto:m,lhsGroup:B,rhsId:i,rhsDir:w,rhsInto:k,rhsGroup:v,title:b};this.edges.push(d);let f=this.nodes.get(e),u=this.nodes.get(i);if(f&&u)f.edges.push(this.edges[this.edges.length-1]),u.edges.push(this.edges[this.edges.length-1])}getEdges(){return this.edges}addLayoutHint(e){if(e.members.length<2)throw Error(`An align directive requires at least two members; got ${e.members.length}`);let i=new Set;e.members.forEach((s)=>{if(this.registeredIds.get(s)!=="node")throw Error(`align ${e.direction} references [${s}], which is not a service or junction`);if(i.has(s))throw Error(`align ${e.direction} lists [${s}] more than once`);i.add(s)}),this.layoutHints.push(e)}getLayoutHints(){return this.layoutHints}getDataStructures(){if(this.dataStructures===void 0){let e=new Map,i=new Map;for(let[B,v]of this.nodes.entries()){let b=new Map;for(let c of v.edges){let y=this.getNode(c.lhsId)?.in,d=this.getNode(c.rhsId)?.in;if(y&&d&&y!==d){let f=$t(c.lhsDir,c.rhsDir);if(f!=="bend")e.set(mt(y,d),f)}if(c.lhsId===B){let f=lt(c.lhsDir,c.rhsDir);if(f)b.set(f,c.rhsId)}else{let f=lt(c.rhsDir,c.lhsDir);if(f)b.set(f,c.lhsId)}}i.set(B,b)}let s=new Set,w=new Set(i.keys()),m=t((B)=>{let v=new Map([[B,[0,0]]]),b=[B];while(b.length>0){let c=b.shift();if(c){s.add(c),w.delete(c);let y=i.get(c);if(!y)throw Error(`BFS error: adjacency list for id ${c} not found. Please report this as a bug.`);let d=v.get(c);if(!d)throw Error(`BFS error: position for id ${c} not found in spatial map. Please report this as a bug.`);let[f,u]=d;y.forEach((g,r)=>{if(!s.has(g))v.set(g,Mt([f,u],r)),b.push(g)})}}return v},"BFS"),k=[];while(w.size>0){let B=w.values().next().value;k.push(m(B))}this.dataStructures={adjList:i,spatialMaps:k,groupAlignments:e}}return this.dataStructures}setElementForId(e,i){this.elements.set(e,i)}getElementById(e){return this.elements.get(e)}getConfig(){return U({...Gt,...x().architecture})}getConfigField(e){return this.getConfig()[e]}},zt=t((e,i)=>{G(e,i),e.groups.map((s)=>i.addGroup(s)),e.services.map((s)=>i.addService({...s,type:"service"})),e.junctions.map((s)=>i.addJunction({...s,type:"junction"})),e.edges.map((s)=>i.addEdge(s)),e.alignments?.map((s)=>i.addLayoutHint({direction:s.direction,members:[...s.members]}))},"populateDb"),wt={parser:{yy:void 0},parse:t(async(e)=>{let i=await J("architecture",e);a.debug(i);let s=wt.parser?.yy;if(!(s instanceof Et))throw Error("parser.parser?.yy was not a ArchitectureDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");zt(i,s)},"parse")},Bt=t((e)=>`
2
2
  .edge {
3
3
  stroke-width: ${e.archEdgeWidth};
4
4
  stroke: ${e.archEdgeColor};
@@ -29,8 +29,8 @@ import{G}from"./chunk-dwjmr0zj.js";import{t,a,N,x,O,ht,C,S,E,T,A,L,R,l,p,V,Gi,Ln
29
29
  display: -webkit-box;
30
30
  -webkit-box-orient: vertical;
31
31
  }
32
- `,"getStyles"),_t=Bt;function ct(e,i){if(e===0)return i();let s=Math.random,w=e>>>0;Math.random=function(){w=w+1831565813>>>0;let m=w;return m=Math.imul(m^m>>>15,m|1),m^=m+Math.imul(m^m>>>7,m|61),((m^m>>>14)>>>0)/4294967296};try{return i()}finally{Math.random=s}}t(ct,"withSeededRandom");var Ze=t((e)=>`<g><rect width="80" height="80" style="fill: #087ebf; stroke-width: 0px;"/>${e}</g>`,"wrapIcon"),it={prefix:"mermaid-architecture",height:80,width:80,icons:{database:{body:Ze('<path id="b" data-name="4" d="m20,57.86c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path id="c" data-name="3" d="m20,45.95c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path id="d" data-name="2" d="m20,34.05c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse id="e" data-name="1" cx="40" cy="22.14" rx="20" ry="7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="20" y1="57.86" x2="20" y2="22.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="60" y1="57.86" x2="60" y2="22.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>')},server:{body:Ze('<rect x="17.5" y="17.5" width="45" height="45" rx="2" ry="2" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="32.5" x2="62.5" y2="32.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="47.5" x2="62.5" y2="47.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><g><path d="m56.25,25c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,25c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><path d="m56.25,40c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,40c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><path d="m56.25,55c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,55c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g>')},disk:{body:Ze('<rect x="20" y="15" width="40" height="50" rx="1" ry="1" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="24" cy="19.17" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="56" cy="19.17" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="24" cy="60.83" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="56" cy="60.83" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="40" cy="33.75" rx="14" ry="14.58" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="40" cy="33.75" rx="4" ry="4.17" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m37.51,42.52l-4.83,13.22c-.26.71-1.1,1.02-1.76.64l-4.18-2.42c-.66-.38-.81-1.26-.33-1.84l9.01-10.8c.88-1.05,2.56-.08,2.09,1.2Z" style="fill: #fff; stroke-width: 0px;"/>')},internet:{body:Ze('<circle cx="40" cy="40" r="22.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="40" y1="17.5" x2="40" y2="62.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="40" x2="62.5" y2="40" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m39.99,17.51c-15.28,11.1-15.28,33.88,0,44.98" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m40.01,17.51c15.28,11.1,15.28,33.88,0,44.98" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="19.75" y1="30.1" x2="60.25" y2="30.1" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="19.75" y1="49.9" x2="60.25" y2="49.9" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>')},cloud:{body:Ze('<path d="m65,47.5c0,2.76-2.24,5-5,5H20c-2.76,0-5-2.24-5-5,0-1.87,1.03-3.51,2.56-4.36-.04-.21-.06-.42-.06-.64,0-2.6,2.48-4.74,5.65-4.97,1.65-4.51,6.34-7.76,11.85-7.76.86,0,1.69.08,2.5.23,2.09-1.57,4.69-2.5,7.5-2.5,6.1,0,11.19,4.38,12.28,10.17,2.14.56,3.72,2.51,3.72,4.83,0,.03,0,.07-.01.1,2.29.46,4.01,2.48,4.01,4.9Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>')},unknown:Gi,blank:{body:Ze("")}}},Yt=t(async function(e,i,s,w){let m=s.getConfigField("padding"),k=s.getConfigField("iconSize"),B=k/2,v=k/6,b=v/2;await Promise.all(i.edges().map(async(c)=>{let{source:y,sourceDir:d,sourceArrow:f,sourceGroup:u,target:g,targetDir:r,targetArrow:_,targetGroup:F,label:o}=yt(c),{x:h,y:D}=c[0].sourceEndpoint(),{x:n,y:P}=c[0].midpoint(),{x:X,y:M}=c[0].targetEndpoint(),j=m+4;if(u)if(Re(d))h+=d==="L"?-j:j;else D+=d==="T"?-j:j+18;if(F)if(Re(r))X+=r==="L"?-j:j;else M+=r==="T"?-j:j+18;if(!u&&s.getNode(y)?.type==="junction")if(Re(d))h+=d==="L"?B:-B;else D+=d==="T"?B:-B;if(!F&&s.getNode(g)?.type==="junction")if(Re(r))X+=r==="L"?B:-B;else M+=r==="T"?B:-B;if(c[0]._private.rscratch){let Y=e.insert("g");if(Y.insert("path").attr("d",`M ${h},${D} L ${n},${P} L${X},${M} `).attr("class","edge").attr("id",`${w}-${ze(y,g,{prefix:"L"})}`),f){let I=Re(d)?ot[d](h,v):h-b,H=Ve(d)?ot[d](D,v):D-b;Y.insert("polygon").attr("points",gt[d](v)).attr("transform",`translate(${I},${H})`).attr("class","arrow")}if(_){let I=Re(r)?ot[r](X,v):X-b,H=Ve(r)?ot[r](M,v):M-b;Y.insert("polygon").attr("points",gt[r](v)).attr("transform",`translate(${I},${H})`).attr("class","arrow")}if(o){let I=!dt(d,r)?Re(d)?"X":"Y":"XY",H=0;if(I==="X")H=Math.abs(h-X);else if(I==="Y")H=Math.abs(D-M)/1.5;else H=Math.abs(h-X)/2;let Z=Y.append("g");if(await Le(Z,o,{useHtmlLabels:!1,width:H,classes:"architecture-service-label"},l()),Z.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),I==="X")Z.attr("transform","translate("+n+", "+P+")");else if(I==="Y")Z.attr("transform","translate("+n+", "+P+") rotate(-90)");else if(I==="XY"){let Q=lt(d,r);if(Q&&Dt(Q)){let se=Z.node().getBoundingClientRect(),[re,ue]=Ft(Q);Z.attr("dominant-baseline","auto").attr("transform",`rotate(${-1*re*ue*45})`);let Ce=Z.node().getBoundingClientRect();Z.attr("transform",`
32
+ `,"getStyles"),_t=Bt;function ct(e,i){if(e===0)return i();let s=Math.random,w=e>>>0;Math.random=function(){w=w+1831565813>>>0;let m=w;return m=Math.imul(m^m>>>15,m|1),m^=m+Math.imul(m^m>>>7,m|61),((m^m>>>14)>>>0)/4294967296};try{return i()}finally{Math.random=s}}t(ct,"withSeededRandom");var Ze=t((e)=>`<g><rect width="80" height="80" style="fill: #087ebf; stroke-width: 0px;"/>${e}</g>`,"wrapIcon"),it={prefix:"mermaid-architecture",height:80,width:80,icons:{database:{body:Ze('<path id="b" data-name="4" d="m20,57.86c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path id="c" data-name="3" d="m20,45.95c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path id="d" data-name="2" d="m20,34.05c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse id="e" data-name="1" cx="40" cy="22.14" rx="20" ry="7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="20" y1="57.86" x2="20" y2="22.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="60" y1="57.86" x2="60" y2="22.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>')},server:{body:Ze('<rect x="17.5" y="17.5" width="45" height="45" rx="2" ry="2" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="32.5" x2="62.5" y2="32.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="47.5" x2="62.5" y2="47.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><g><path d="m56.25,25c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,25c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><path d="m56.25,40c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,40c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><path d="m56.25,55c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,55c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g>')},disk:{body:Ze('<rect x="20" y="15" width="40" height="50" rx="1" ry="1" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="24" cy="19.17" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="56" cy="19.17" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="24" cy="60.83" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="56" cy="60.83" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="40" cy="33.75" rx="14" ry="14.58" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="40" cy="33.75" rx="4" ry="4.17" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m37.51,42.52l-4.83,13.22c-.26.71-1.1,1.02-1.76.64l-4.18-2.42c-.66-.38-.81-1.26-.33-1.84l9.01-10.8c.88-1.05,2.56-.08,2.09,1.2Z" style="fill: #fff; stroke-width: 0px;"/>')},internet:{body:Ze('<circle cx="40" cy="40" r="22.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="40" y1="17.5" x2="40" y2="62.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="40" x2="62.5" y2="40" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m39.99,17.51c-15.28,11.1-15.28,33.88,0,44.98" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m40.01,17.51c15.28,11.1,15.28,33.88,0,44.98" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="19.75" y1="30.1" x2="60.25" y2="30.1" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="19.75" y1="49.9" x2="60.25" y2="49.9" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>')},cloud:{body:Ze('<path d="m65,47.5c0,2.76-2.24,5-5,5H20c-2.76,0-5-2.24-5-5,0-1.87,1.03-3.51,2.56-4.36-.04-.21-.06-.42-.06-.64,0-2.6,2.48-4.74,5.65-4.97,1.65-4.51,6.34-7.76,11.85-7.76.86,0,1.69.08,2.5.23,2.09-1.57,4.69-2.5,7.5-2.5,6.1,0,11.19,4.38,12.28,10.17,2.14.56,3.72,2.51,3.72,4.83,0,.03,0,.07-.01.1,2.29.46,4.01,2.48,4.01,4.9Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>')},unknown:Gi,blank:{body:Ze("")}}},Yt=t(async function(e,i,s,w){let m=s.getConfigField("padding"),k=s.getConfigField("iconSize"),B=k/2,v=k/6,b=v/2;await Promise.all(i.edges().map(async(c)=>{let{source:y,sourceDir:d,sourceArrow:f,sourceGroup:u,target:g,targetDir:r,targetArrow:_,targetGroup:F,label:o}=yt(c),{x:h,y:D}=c[0].sourceEndpoint(),{x:n,y:P}=c[0].midpoint(),{x:X,y:M}=c[0].targetEndpoint(),j=m+4;if(u)if(Re(d))h+=d==="L"?-j:j;else D+=d==="T"?-j:j+18;if(F)if(Re(r))X+=r==="L"?-j:j;else M+=r==="T"?-j:j+18;if(!u&&s.getNode(y)?.type==="junction")if(Re(d))h+=d==="L"?B:-B;else D+=d==="T"?B:-B;if(!F&&s.getNode(g)?.type==="junction")if(Re(r))X+=r==="L"?B:-B;else M+=r==="T"?B:-B;if(c[0]._private.rscratch){let Y=e.insert("g");if(Y.insert("path").attr("d",`M ${h},${D} L ${n},${P} L${X},${M} `).attr("class","edge").attr("id",`${w}-${ze(y,g,{prefix:"L"})}`),f){let I=Re(d)?ot[d](h,v):h-b,H=Ve(d)?ot[d](D,v):D-b;Y.insert("polygon").attr("points",vt[d](v)).attr("transform",`translate(${I},${H})`).attr("class","arrow")}if(_){let I=Re(r)?ot[r](X,v):X-b,H=Ve(r)?ot[r](M,v):M-b;Y.insert("polygon").attr("points",vt[r](v)).attr("transform",`translate(${I},${H})`).attr("class","arrow")}if(o){let I=!dt(d,r)?Re(d)?"X":"Y":"XY",H=0;if(I==="X")H=Math.abs(h-X);else if(I==="Y")H=Math.abs(D-M)/1.5;else H=Math.abs(h-X)/2;let Z=Y.append("g");if(await Le(Z,o,{useHtmlLabels:!1,width:H,classes:"architecture-service-label"},l()),Z.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),I==="X")Z.attr("transform","translate("+n+", "+P+")");else if(I==="Y")Z.attr("transform","translate("+n+", "+P+") rotate(-90)");else if(I==="XY"){let Q=lt(d,r);if(Q&&Dt(Q)){let se=Z.node().getBoundingClientRect(),[re,ue]=Ft(Q);Z.attr("dominant-baseline","auto").attr("transform",`rotate(${-1*re*ue*45})`);let Ce=Z.node().getBoundingClientRect();Z.attr("transform",`
33
33
  translate(${n}, ${P-se.height/2})
34
34
  translate(${re*Ce.width/2}, ${ue*Ce.height/2})
35
35
  rotate(${-1*re*ue*45}, 0, ${se.height/2})
36
- `)}}}}}))},"drawEdges"),Ut=t(async function(e,i,s,w){let k=s.getConfigField("padding")*0.75,B=s.getConfigField("fontSize"),b=s.getConfigField("iconSize")/2;await Promise.all(i.nodes().map(async(c)=>{let y=Qe(c);if(y.type==="group"){let{h:d,w:f,x1:u,y1:g}=c.boundingBox(),r=e.append("rect");r.attr("id",`${w}-group-${y.id}`).attr("x",u+b).attr("y",g+b).attr("width",f).attr("height",d).attr("class","node-bkg");let _=e.append("g"),F=u,o=g;if(y.icon){let h=_.append("g");h.html(`<g>${await nt(y.icon,{height:k,width:k,fallbackPrefix:it.prefix})}</g>`),h.attr("transform","translate("+(F+b+1)+", "+(o+b+1)+")"),F+=k,o+=B/2-1-2}if(y.label){let h=_.append("g");await Le(h,y.label,{useHtmlLabels:!1,width:f,classes:"architecture-service-label"},l()),h.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","start").attr("text-anchor","start"),h.attr("transform","translate("+(F+b+4)+", "+(o+b+2)+")")}s.setElementForId(y.id,r)}}))},"drawGroups"),Ht=t(async function(e,i,s,w){let m=l();for(let k of s){let B=i.append("g"),v=e.getConfigField("iconSize");if(k.title){let d=B.append("g");await Le(d,k.title,{useHtmlLabels:!1,width:v*1.5,classes:"architecture-service-label"},m),d.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),d.attr("transform","translate("+v/2+", "+v+")")}let b=B.append("g");if(k.icon)b.html(`<g>${await nt(k.icon,{height:v,width:v,fallbackPrefix:it.prefix})}</g>`);else if(k.iconText){b.html(`<g>${await nt("blank",{height:v,width:v,fallbackPrefix:it.prefix})}</g>`);let u=b.append("g").append("foreignObject").attr("width",v).attr("height",v).append("div").attr("class","node-icon-text").attr("style",`height: ${v}px;`).append("div").html(O(k.iconText,m)),g=parseInt(window.getComputedStyle(u.node(),null).getPropertyValue("font-size").replace(/\D/g,""))??16;u.attr("style",`-webkit-line-clamp: ${Math.floor((v-2)/g)};`)}else b.append("path").attr("class","node-bkg").attr("id",`${w}-node-${k.id}`).attr("d",`M0,${v} V5 Q0,0 5,0 H${v-5} Q${v},0 ${v},5 V${v} Z`);B.attr("id",`${w}-service-${k.id}`).attr("class","architecture-service");let{width:c,height:y}=B.node().getBBox();k.width=c,k.height=y,e.setElementForId(k.id,B)}return 0},"drawServices"),Vt=t(function(e,i,s,w){s.forEach((m)=>{let k=i.append("g"),B=e.getConfigField("iconSize");k.append("g").append("rect").attr("id",`${w}-node-${m.id}`).attr("fill-opacity","0").attr("width",B).attr("height",B),k.attr("class","architecture-junction");let{width:b,height:c}=k._groups[0][0].getBBox();k.width=b,k.height=c,e.setElementForId(m.id,k)})},"drawJunctions");Ln([{name:it.prefix,icons:it}]);mt.use(xt.default);function Tt(e,i,s){e.forEach((w)=>{i.add({group:"nodes",data:{type:"service",id:w.id,icon:w.icon,label:w.title,parent:w.in,width:s.getConfigField("iconSize"),height:s.getConfigField("iconSize")},classes:"node-service"})})}t(Tt,"addServices");function At(e,i,s){e.forEach((w)=>{i.add({group:"nodes",data:{type:"junction",id:w.id,parent:w.in,width:s.getConfigField("iconSize"),height:s.getConfigField("iconSize")},classes:"node-junction"})})}t(At,"addJunctions");function Lt(e,i){i.nodes().map((s)=>{let w=Qe(s);if(w.type==="group")return;w.x=s.position().x,w.y=s.position().y,e.getElementById(w.id).attr("transform","translate("+(w.x||0)+","+(w.y||0)+")")})}t(Lt,"positionNodes");function Ct(e,i){e.forEach((s)=>{i.add({group:"nodes",data:{type:"group",id:s.id,icon:s.icon,label:s.title,parent:s.in},classes:"node-group"})})}t(Ct,"addGroups");function It(e,i){e.forEach((s)=>{let{lhsId:w,rhsId:m,lhsInto:k,lhsGroup:B,rhsInto:v,lhsDir:b,rhsDir:c,rhsGroup:y,title:d}=s,f=dt(s.lhsDir,s.rhsDir)?"segments":"straight",u={id:`${w}-${m}`,label:d,source:w,sourceDir:b,sourceArrow:k,sourceGroup:B,sourceEndpoint:b==="L"?"0 50%":b==="R"?"100% 50%":b==="T"?"50% 0":"50% 100%",target:m,targetDir:c,targetArrow:v,targetGroup:y,targetEndpoint:c==="L"?"0 50%":c==="R"?"100% 50%":c==="T"?"50% 0":"50% 100%"};i.add({group:"edges",data:u,classes:f})})}t(It,"addEdges");function bt(e,i,s,w=[]){let m=t((f,u)=>{let g=new Map;for(let[r,_]of f.entries()){let F=`${r}`,o=0,h=[..._.entries()];if(h.length===1){g.set(F,h[0][1]);continue}for(let D=0;D<h.length-1;D++)for(let n=D+1;n<h.length;n++){let[P,X]=h[D],[M,j]=h[n];if(s.get(pt(P,M))===u)g.set(F,[...g.get(F)??[],...X,...j]);else if(P==="default"||M==="default")g.set(F,[...g.get(F)??[],...X,...j]);else{let I=`${F}-${o++}`;g.set(I,X);let H=`${F}-${o++}`;g.set(H,j)}}}return g},"flattenAlignments"),k=i.map((f)=>{let u=new Map,g=new Map;return f.forEach(([r,_],F)=>{let o=e.getNode(F)?.in??"default",h=u.get(_)??new Map;if(!u.has(_))u.set(_,h);let D=g.get(r)??new Map;if(!g.has(r))g.set(r,D);for(let n of[h,D]){let P=n.get(o)??[];if(!n.has(o))n.set(o,P);P.push(F)}}),{horiz:[...m(u,"horizontal").values()].filter((r)=>r.length>1),vert:[...m(g,"vertical").values()].filter((r)=>r.length>1)}}),[B,v]=k.reduce(([f,u],{horiz:g,vert:r})=>[[...f,...g],[...u,...r]],[[],[]]),b=new Set;w.forEach((f)=>f.members.forEach((u)=>b.add(u)));let c=t((f)=>f.filter((u)=>!u.some((g)=>b.has(g))),"dropOverlapping"),y=c(B),d=c(v);return w.forEach((f)=>{if(f.members.length<2)return;if(f.direction==="row")y.push([...f.members]);else d.push([...f.members])}),{horizontal:y,vertical:d}}t(bt,"getAlignments");function Nt(e,i,s=[]){let w=[],m=i.getConfigField("iconSize"),k=i.getConfigField("idealEdgeLengthMultiplier"),B=k*m,v=new Set;s.forEach((y)=>{for(let d=0;d<y.members.length-1;d++){let f=y.members[d],u=y.members[d+1];if(v.add(`${f}|${u}`),v.add(`${u}|${f}`),y.direction==="row")w.push({left:f,right:u,gap:B});else w.push({top:f,bottom:u,gap:B})}});let b=t((y)=>`${y[0]},${y[1]}`,"posToStr"),c=t((y)=>y.split(",").map((d)=>parseInt(d)),"strToPos");return e.forEach((y)=>{let d=new Map([...y.entries()].map(([r,_])=>[b(_),r])),f=[b([0,0])],u={},g={L:[-1,0],R:[1,0],T:[0,1],B:[0,-1]};while(f.length>0){let r=f.shift();if(r){u[r]=1;let _=d.get(r);if(_){let F=c(r);Object.entries(g).forEach(([o,h])=>{let D=b([F[0]+h[0],F[1]+h[1]]),n=d.get(D);if(n&&!u[D]){if(f.push(D),v.has(`${_}|${n}`))return;w.push({[ut[o]]:n,[ut[kt(o)]]:_,gap:k*m})}})}}}}),w}t(Nt,"getRelativeConstraints");function St(e,i,s,w,m,{spatialMaps:k,groupAlignments:B}){return new Promise((v)=>{let b=p("body").append("div").attr("id","cy").attr("style","display:none"),c=mt({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"straight","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"edge[label]",style:{label:"data(label)"}},{selector:"edge.segments",style:{"curve-style":"segments","segment-weights":"0","segment-distances":[0.5],"edge-distances":"endpoints","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"node",style:{"compound-sizing-wrt-labels":"include"}},{selector:"node[label]",style:{"text-valign":"bottom","text-halign":"center","font-size":`${m.getConfigField("fontSize")}px`}},{selector:".node-service",style:{label:"data(label)",width:"data(width)",height:"data(height)"}},{selector:".node-junction",style:{width:"data(width)",height:"data(height)"}},{selector:".node-group",style:{padding:`${m.getConfigField("padding")}px`}}],layout:{name:"grid",boundingBox:{x1:0,x2:100,y1:0,y2:100}}});b.remove(),Ct(s,c),Tt(e,c,m),At(i,c,m),It(w,c);let y=m.getLayoutHints(),d=bt(m,k,B,y),f=Nt(k,m,y),u=m.getConfigField("iconSize"),g=m.getConfigField("idealEdgeLengthMultiplier")*u,r=0.5*u,_=m.getConfigField("edgeElasticity"),F=m.getConfigField("seed"),o=c.layout({name:"fcose",quality:"proof",randomize:m.getConfigField("randomize"),nodeSeparation:m.getConfigField("nodeSeparation"),numIter:m.getConfigField("numIter"),styleEnabled:!1,animate:!1,nodeDimensionsIncludeLabels:!1,idealEdgeLength(h){let[D,n]=h.connectedNodes(),{parent:P}=Qe(D),{parent:X}=Qe(n);return P===X?g:r},edgeElasticity(h){let[D,n]=h.connectedNodes(),{parent:P}=Qe(D),{parent:X}=Qe(n);return P===X?_:0.001},alignmentConstraint:d,relativePlacementConstraint:f});o.one("layoutstop",()=>{function h(D,n,P,X){let M,j,{x:Y,y:I}=D,{x:H,y:Z}=n;j=(X-I+(Y-P)*(I-Z)/(Y-H))/Math.sqrt(1+Math.pow((I-Z)/(Y-H),2)),M=Math.sqrt(Math.pow(X-I,2)+Math.pow(P-Y,2)-Math.pow(j,2));let Q=Math.sqrt(Math.pow(H-Y,2)+Math.pow(Z-I,2));M=M/Q;let se=(H-Y)*(X-I)-(Z-I)*(P-Y);switch(!0){case se>=0:se=1;break;case se<0:se=-1;break}let re=(H-Y)*(P-Y)+(Z-I)*(X-I);switch(!0){case re>=0:re=1;break;case re<0:re=-1;break}return j=Math.abs(j)*se,M=M*re,{distances:j,weights:M}}t(h,"getSegmentWeights"),c.startBatch();for(let D of Object.values(c.edges()))if(D.data?.()){let{x:n,y:P}=D.source().position(),{x:X,y:M}=D.target().position();if(n!==X&&P!==M){let j=D.sourceEndpoint(),Y=D.targetEndpoint(),{sourceDir:I}=yt(D),[H,Z]=Ve(I)?[j.x,Y.y]:[Y.x,j.y],{weights:Q,distances:se}=h(j,Y,H,Z);D.style("segment-distances",se),D.style("segment-weights",Q)}}c.endBatch(),ct(F,()=>o.run())});try{ct(F,()=>o.run())}catch(h){if(h instanceof RangeError&&h.message.includes("Invalid array length"))throw Error("Architecture layout failed: a declared `align row|column` directive likely contradicts the edge directions, or two declared alignments overlap on a shared node. Check that the order of members in each `align` chain is consistent with the edges between them, and that no node appears in two `align` directives along the same axis.");throw h}c.ready((h)=>{a.info("Ready",h),v(c)})})}t(St,"layoutArchitecture");var Xt=t(async(e,i,s,w)=>{let m=w.db;m.setDiagramId(i);let k=m.getServices(),B=m.getJunctions(),v=m.getGroups(),b=m.getEdges(),c=m.getDataStructures(),y=V(i),d=y.append("g");d.attr("class","architecture-edges");let f=y.append("g");f.attr("class","architecture-services");let u=y.append("g");u.attr("class","architecture-groups"),await Ht(m,f,k,i),Vt(m,f,B,i);let g=await St(k,B,v,b,m,c);await Yt(d,g,m,i),await Ut(u,g,m,i),Lt(m,g),ht(void 0,y,m.getConfigField("padding"),m.getConfigField("useMaxWidth"))},"draw"),jt={draw:Xt},ar={parser:wt,get db(){return new Et},renderer:jt,styles:_t};export{ar as diagram};
36
+ `)}}}}}))},"drawEdges"),Ut=t(async function(e,i,s,w){let k=s.getConfigField("padding")*0.75,B=s.getConfigField("fontSize"),b=s.getConfigField("iconSize")/2;await Promise.all(i.nodes().map(async(c)=>{let y=Qe(c);if(y.type==="group"){let{h:d,w:f,x1:u,y1:g}=c.boundingBox(),r=e.append("rect");r.attr("id",`${w}-group-${y.id}`).attr("x",u+b).attr("y",g+b).attr("width",f).attr("height",d).attr("class","node-bkg");let _=e.append("g"),F=u,o=g;if(y.icon){let h=_.append("g");h.html(`<g>${await nt(y.icon,{height:k,width:k,fallbackPrefix:it.prefix})}</g>`),h.attr("transform","translate("+(F+b+1)+", "+(o+b+1)+")"),F+=k,o+=B/2-1-2}if(y.label){let h=_.append("g");await Le(h,y.label,{useHtmlLabels:!1,width:f,classes:"architecture-service-label"},l()),h.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","start").attr("text-anchor","start"),h.attr("transform","translate("+(F+b+4)+", "+(o+b+2)+")")}s.setElementForId(y.id,r)}}))},"drawGroups"),Ht=t(async function(e,i,s,w){let m=l();for(let k of s){let B=i.append("g"),v=e.getConfigField("iconSize");if(k.title){let d=B.append("g");await Le(d,k.title,{useHtmlLabels:!1,width:v*1.5,classes:"architecture-service-label"},m),d.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),d.attr("transform","translate("+v/2+", "+v+")")}let b=B.append("g");if(k.icon)b.html(`<g>${await nt(k.icon,{height:v,width:v,fallbackPrefix:it.prefix})}</g>`);else if(k.iconText){b.html(`<g>${await nt("blank",{height:v,width:v,fallbackPrefix:it.prefix})}</g>`);let u=b.append("g").append("foreignObject").attr("width",v).attr("height",v).append("div").attr("class","node-icon-text").attr("style",`height: ${v}px;`).append("div").html(O(k.iconText,m)),g=parseInt(window.getComputedStyle(u.node(),null).getPropertyValue("font-size").replace(/\D/g,""))??16;u.attr("style",`-webkit-line-clamp: ${Math.floor((v-2)/g)};`)}else b.append("path").attr("class","node-bkg").attr("id",`${w}-node-${k.id}`).attr("d",`M0,${v} V5 Q0,0 5,0 H${v-5} Q${v},0 ${v},5 V${v} Z`);B.attr("id",`${w}-service-${k.id}`).attr("class","architecture-service");let{width:c,height:y}=B.node().getBBox();k.width=c,k.height=y,e.setElementForId(k.id,B)}return 0},"drawServices"),Vt=t(function(e,i,s,w){s.forEach((m)=>{let k=i.append("g"),B=e.getConfigField("iconSize");k.append("g").append("rect").attr("id",`${w}-node-${m.id}`).attr("fill-opacity","0").attr("width",B).attr("height",B),k.attr("class","architecture-junction");let{width:b,height:c}=k._groups[0][0].getBBox();k.width=b,k.height=c,e.setElementForId(m.id,k)})},"drawJunctions");Ln([{name:it.prefix,icons:it}]);ft.use(xt.default);function Tt(e,i,s){e.forEach((w)=>{i.add({group:"nodes",data:{type:"service",id:w.id,icon:w.icon,label:w.title,parent:w.in,width:s.getConfigField("iconSize"),height:s.getConfigField("iconSize")},classes:"node-service"})})}t(Tt,"addServices");function At(e,i,s){e.forEach((w)=>{i.add({group:"nodes",data:{type:"junction",id:w.id,parent:w.in,width:s.getConfigField("iconSize"),height:s.getConfigField("iconSize")},classes:"node-junction"})})}t(At,"addJunctions");function Lt(e,i){i.nodes().map((s)=>{let w=Qe(s);if(w.type==="group")return;w.x=s.position().x,w.y=s.position().y,e.getElementById(w.id).attr("transform","translate("+(w.x||0)+","+(w.y||0)+")")})}t(Lt,"positionNodes");function Ct(e,i){e.forEach((s)=>{i.add({group:"nodes",data:{type:"group",id:s.id,icon:s.icon,label:s.title,parent:s.in},classes:"node-group"})})}t(Ct,"addGroups");function It(e,i){e.forEach((s)=>{let{lhsId:w,rhsId:m,lhsInto:k,lhsGroup:B,rhsInto:v,lhsDir:b,rhsDir:c,rhsGroup:y,title:d}=s,f=dt(s.lhsDir,s.rhsDir)?"segments":"straight",u={id:`${w}-${m}`,label:d,source:w,sourceDir:b,sourceArrow:k,sourceGroup:B,sourceEndpoint:b==="L"?"0 50%":b==="R"?"100% 50%":b==="T"?"50% 0":"50% 100%",target:m,targetDir:c,targetArrow:v,targetGroup:y,targetEndpoint:c==="L"?"0 50%":c==="R"?"100% 50%":c==="T"?"50% 0":"50% 100%"};i.add({group:"edges",data:u,classes:f})})}t(It,"addEdges");function bt(e,i,s,w=[]){let m=t((f,u)=>{let g=new Map;for(let[r,_]of f.entries()){let F=`${r}`,o=0,h=[..._.entries()];if(h.length===1){g.set(F,h[0][1]);continue}for(let D=0;D<h.length-1;D++)for(let n=D+1;n<h.length;n++){let[P,X]=h[D],[M,j]=h[n];if(s.get(mt(P,M))===u)g.set(F,[...g.get(F)??[],...X,...j]);else if(P==="default"||M==="default")g.set(F,[...g.get(F)??[],...X,...j]);else{let I=`${F}-${o++}`;g.set(I,X);let H=`${F}-${o++}`;g.set(H,j)}}}return g},"flattenAlignments"),k=i.map((f)=>{let u=new Map,g=new Map;return f.forEach(([r,_],F)=>{let o=e.getNode(F)?.in??"default",h=u.get(_)??new Map;if(!u.has(_))u.set(_,h);let D=g.get(r)??new Map;if(!g.has(r))g.set(r,D);for(let n of[h,D]){let P=n.get(o)??[];if(!n.has(o))n.set(o,P);P.push(F)}}),{horiz:[...m(u,"horizontal").values()].filter((r)=>r.length>1),vert:[...m(g,"vertical").values()].filter((r)=>r.length>1)}}),[B,v]=k.reduce(([f,u],{horiz:g,vert:r})=>[[...f,...g],[...u,...r]],[[],[]]),b=new Set;w.forEach((f)=>f.members.forEach((u)=>b.add(u)));let c=t((f)=>f.filter((u)=>!u.some((g)=>b.has(g))),"dropOverlapping"),y=c(B),d=c(v);return w.forEach((f)=>{if(f.members.length<2)return;if(f.direction==="row")y.push([...f.members]);else d.push([...f.members])}),{horizontal:y,vertical:d}}t(bt,"getAlignments");function Nt(e,i,s=[]){let w=[],m=i.getConfigField("iconSize"),k=i.getConfigField("idealEdgeLengthMultiplier"),B=k*m,v=new Set;s.forEach((y)=>{for(let d=0;d<y.members.length-1;d++){let f=y.members[d],u=y.members[d+1];if(v.add(`${f}|${u}`),v.add(`${u}|${f}`),y.direction==="row")w.push({left:f,right:u,gap:B});else w.push({top:f,bottom:u,gap:B})}});let b=t((y)=>`${y[0]},${y[1]}`,"posToStr"),c=t((y)=>y.split(",").map((d)=>parseInt(d)),"strToPos");return e.forEach((y)=>{let d=new Map([...y.entries()].map(([r,_])=>[b(_),r])),f=[b([0,0])],u={},g={L:[-1,0],R:[1,0],T:[0,1],B:[0,-1]};while(f.length>0){let r=f.shift();if(r){u[r]=1;let _=d.get(r);if(_){let F=c(r);Object.entries(g).forEach(([o,h])=>{let D=b([F[0]+h[0],F[1]+h[1]]),n=d.get(D);if(n&&!u[D]){if(f.push(D),v.has(`${_}|${n}`))return;w.push({[ht[o]]:n,[ht[kt(o)]]:_,gap:k*m})}})}}}}),w}t(Nt,"getRelativeConstraints");function St(e,i,s,w,m,{spatialMaps:k,groupAlignments:B}){return new Promise((v)=>{let b=p("body").append("div").attr("id","cy").attr("style","display:none"),c=ft({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"straight","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"edge[label]",style:{label:"data(label)"}},{selector:"edge.segments",style:{"curve-style":"segments","segment-weights":"0","segment-distances":[0.5],"edge-distances":"endpoints","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"node",style:{"compound-sizing-wrt-labels":"include"}},{selector:"node[label]",style:{"text-valign":"bottom","text-halign":"center","font-size":`${m.getConfigField("fontSize")}px`}},{selector:".node-service",style:{label:"data(label)",width:"data(width)",height:"data(height)"}},{selector:".node-junction",style:{width:"data(width)",height:"data(height)"}},{selector:".node-group",style:{padding:`${m.getConfigField("padding")}px`}}],layout:{name:"grid",boundingBox:{x1:0,x2:100,y1:0,y2:100}}});b.remove(),Ct(s,c),Tt(e,c,m),At(i,c,m),It(w,c);let y=m.getLayoutHints(),d=bt(m,k,B,y),f=Nt(k,m,y),u=m.getConfigField("iconSize"),g=m.getConfigField("idealEdgeLengthMultiplier")*u,r=0.5*u,_=m.getConfigField("edgeElasticity"),F=m.getConfigField("seed"),o=c.layout({name:"fcose",quality:"proof",randomize:m.getConfigField("randomize"),nodeSeparation:m.getConfigField("nodeSeparation"),numIter:m.getConfigField("numIter"),styleEnabled:!1,animate:!1,nodeDimensionsIncludeLabels:!1,idealEdgeLength(h){let[D,n]=h.connectedNodes(),{parent:P}=Qe(D),{parent:X}=Qe(n);return P===X?g:r},edgeElasticity(h){let[D,n]=h.connectedNodes(),{parent:P}=Qe(D),{parent:X}=Qe(n);return P===X?_:0.001},alignmentConstraint:d,relativePlacementConstraint:f});o.one("layoutstop",()=>{function h(D,n,P,X){let M,j,{x:Y,y:I}=D,{x:H,y:Z}=n;j=(X-I+(Y-P)*(I-Z)/(Y-H))/Math.sqrt(1+Math.pow((I-Z)/(Y-H),2)),M=Math.sqrt(Math.pow(X-I,2)+Math.pow(P-Y,2)-Math.pow(j,2));let Q=Math.sqrt(Math.pow(H-Y,2)+Math.pow(Z-I,2));M=M/Q;let se=(H-Y)*(X-I)-(Z-I)*(P-Y);switch(!0){case se>=0:se=1;break;case se<0:se=-1;break}let re=(H-Y)*(P-Y)+(Z-I)*(X-I);switch(!0){case re>=0:re=1;break;case re<0:re=-1;break}return j=Math.abs(j)*se,M=M*re,{distances:j,weights:M}}t(h,"getSegmentWeights"),c.startBatch();for(let D of Object.values(c.edges()))if(D.data?.()){let{x:n,y:P}=D.source().position(),{x:X,y:M}=D.target().position();if(n!==X&&P!==M){let j=D.sourceEndpoint(),Y=D.targetEndpoint(),{sourceDir:I}=yt(D),[H,Z]=Ve(I)?[j.x,Y.y]:[Y.x,j.y],{weights:Q,distances:se}=h(j,Y,H,Z);D.style("segment-distances",se),D.style("segment-weights",Q)}}c.endBatch(),ct(F,()=>o.run())});try{ct(F,()=>o.run())}catch(h){if(h instanceof RangeError&&h.message.includes("Invalid array length"))throw Error("Architecture layout failed: a declared `align row|column` directive likely contradicts the edge directions, or two declared alignments overlap on a shared node. Check that the order of members in each `align` chain is consistent with the edges between them, and that no node appears in two `align` directives along the same axis.");throw h}c.ready((h)=>{a.info("Ready",h),v(c)})})}t(St,"layoutArchitecture");var Xt=t(async(e,i,s,w)=>{let m=w.db;m.setDiagramId(i);let k=m.getServices(),B=m.getJunctions(),v=m.getGroups(),b=m.getEdges(),c=m.getDataStructures(),y=V(i),d=y.append("g");d.attr("class","architecture-edges");let f=y.append("g");f.attr("class","architecture-services");let u=y.append("g");u.attr("class","architecture-groups"),await Ht(m,f,k,i),Vt(m,f,B,i);let g=await St(k,B,v,b,m,c);await Yt(d,g,m,i),await Ut(u,g,m,i),Lt(m,g),gt(void 0,y,m.getConfigField("padding"),m.getConfigField("useMaxWidth"))},"draw"),jt={draw:Xt},ar={parser:wt,get db(){return new Et},renderer:jt,styles:_t};export{ar as diagram};
@@ -1,4 +1,4 @@
1
- import{t,a,de,Re,b,C,S,E,T,A,L,R,l,sn,Tn,p,et,tt,M,ze,pe,se,le,Ye,Nr,ge,ye}from"./chunk-veam6vk4.js";import{Ft}from"./chunk-79e08rk1.js";import{je}from"./chunk-5v2c0aqk.js";import{Bt}from"./chunk-avxk6jpc.js";import{he}from"./chunk-rrpn5r5w.js";import{ue}from"./chunk-7qkav30b.js";var A1="flowchart-",m1=class{constructor(){this.vertexCounter=0,this.config=l(),this.diagramId="",this.vertices=new Map,this.edges=[],this.classes=new Map,this.subGraphs=[],this.subGraphLookup=new Map,this.tooltips=new Map,this.subCount=0,this.firstGraphFlag=!0,this.secCount=-1,this.posCrossRef=[],this.funs=[],this.setAccTitle=S,this.setAccDescription=T,this.setDiagramTitle=L,this.getAccTitle=E,this.getAccDescription=A,this.getDiagramTitle=R,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.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.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen("gen-2")}static{t(this,"FlowDB")}sanitizeText(e){return b.sanitizeText(e,this.config)}sanitizeNodeLabelType(e){switch(e){case"markdown":case"string":case"text":return e;default:return"markdown"}}setDiagramId(e){this.diagramId=e}lookUpDomId(e){for(let r of this.vertices.values())if(r.id===e)return this.diagramId?`${this.diagramId}-${r.domId}`:r.domId;return this.diagramId?`${this.diagramId}-${e}`:e}addVertex(e,r,n,u,c,m,d={},y){if(!e||e.trim().length===0)return;let f;if(y!==void 0){let _;if(!y.includes(`
1
+ import{t,a,de,Re,b,C,S,E,T,A,L,R,l,sn,Tn,p,et,tt,M,ze,pe,se,le,Ye,Nr,ge,ye}from"./chunk-tfqarvdx.js";import{Ft}from"./chunk-vasppf6b.js";import{je}from"./chunk-z5qn0xev.js";import{Bt}from"./chunk-1ex3wgms.js";import{he}from"./chunk-sc63488q.js";import{ue}from"./chunk-1qh7f5kr.js";var A1="flowchart-",m1=class{constructor(){this.vertexCounter=0,this.config=l(),this.diagramId="",this.vertices=new Map,this.edges=[],this.classes=new Map,this.subGraphs=[],this.subGraphLookup=new Map,this.tooltips=new Map,this.subCount=0,this.firstGraphFlag=!0,this.secCount=-1,this.posCrossRef=[],this.funs=[],this.setAccTitle=S,this.setAccDescription=T,this.setDiagramTitle=L,this.getAccTitle=E,this.getAccDescription=A,this.getDiagramTitle=R,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.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.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen("gen-2")}static{t(this,"FlowDB")}sanitizeText(e){return b.sanitizeText(e,this.config)}sanitizeNodeLabelType(e){switch(e){case"markdown":case"string":case"text":return e;default:return"markdown"}}setDiagramId(e){this.diagramId=e}lookUpDomId(e){for(let r of this.vertices.values())if(r.id===e)return this.diagramId?`${this.diagramId}-${r.domId}`:r.domId;return this.diagramId?`${this.diagramId}-${e}`:e}addVertex(e,r,n,u,c,m,d={},y){if(!e||e.trim().length===0)return;let f;if(y!==void 0){let _;if(!y.includes(`
2
2
  `))_=`{
3
3
  `+y+`
4
4
  }`;else _=y+`
@@ -1,4 +1,4 @@
1
- import{t,a,oe,O,b,F,S,E,T,A,l,p,Dn,Kr,He,w,ea}from"./chunk-veam6vk4.js";import{an}from"./chunk-79e08rk1.js";var Gt=function(){var e=t(function(wt,k,R,D){for(R=R||{},D=wt.length;D--;R[wt[D]]=k);return R},"o"),n=[1,24],i=[1,25],o=[1,26],f=[1,27],u=[1,28],r=[1,63],d=[1,64],s=[1,65],y=[1,66],g=[1,67],m=[1,68],v=[1,69],P=[1,29],V=[1,30],z=[1,31],Y=[1,32],U=[1,33],H=[1,34],rt=[1,35],st=[1,36],at=[1,37],it=[1,38],ot=[1,39],lt=[1,40],ct=[1,41],ut=[1,42],ht=[1,43],dt=[1,44],pt=[1,45],ft=[1,46],yt=[1,47],_t=[1,48],bt=[1,50],mt=[1,51],gt=[1,52],xt=[1,53],vt=[1,54],kt=[1,55],Et=[1,56],St=[1,57],Tt=[1,58],Ct=[1,59],Rt=[1,60],Bt=[14,42],$t=[14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],Yt=[12,14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],N=[1,82],L=[1,83],I=[1,84],M=[1,85],B=[12,14,42],ye=[12,14,33,42],Xt=[12,14,33,42,76,77,79,80],Nt=[12,33],te=[34,36,37,38,39,40,41,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],ee={trace:t(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,direction:5,direction_tb:6,direction_bt:7,direction_rl:8,direction_lr:9,graphConfig:10,C4_CONTEXT:11,NEWLINE:12,statements:13,EOF:14,C4_CONTAINER:15,C4_COMPONENT:16,C4_DYNAMIC:17,C4_DEPLOYMENT:18,otherStatements:19,diagramStatements:20,otherStatement:21,title:22,accDescription:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,boundaryStatement:29,boundaryStartStatement:30,boundaryStopStatement:31,boundaryStart:32,LBRACE:33,ENTERPRISE_BOUNDARY:34,attributes:35,SYSTEM_BOUNDARY:36,BOUNDARY:37,CONTAINER_BOUNDARY:38,NODE:39,NODE_L:40,NODE_R:41,RBRACE:42,diagramStatement:43,PERSON:44,PERSON_EXT:45,SYSTEM:46,SYSTEM_DB:47,SYSTEM_QUEUE:48,SYSTEM_EXT:49,SYSTEM_EXT_DB:50,SYSTEM_EXT_QUEUE:51,CONTAINER:52,CONTAINER_DB:53,CONTAINER_QUEUE:54,CONTAINER_EXT:55,CONTAINER_EXT_DB:56,CONTAINER_EXT_QUEUE:57,COMPONENT:58,COMPONENT_DB:59,COMPONENT_QUEUE:60,COMPONENT_EXT:61,COMPONENT_EXT_DB:62,COMPONENT_EXT_QUEUE:63,REL:64,BIREL:65,REL_U:66,REL_D:67,REL_L:68,REL_R:69,REL_B:70,REL_INDEX:71,UPDATE_EL_STYLE:72,UPDATE_REL_STYLE:73,UPDATE_LAYOUT_CONFIG:74,attribute:75,STR:76,STR_KEY:77,STR_VALUE:78,ATTRIBUTE:79,ATTRIBUTE_EMPTY:80,$accept:0,$end:1},terminals_:{2:"error",6:"direction_tb",7:"direction_bt",8:"direction_rl",9:"direction_lr",11:"C4_CONTEXT",12:"NEWLINE",14:"EOF",15:"C4_CONTAINER",16:"C4_COMPONENT",17:"C4_DYNAMIC",18:"C4_DEPLOYMENT",22:"title",23:"accDescription",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"LBRACE",34:"ENTERPRISE_BOUNDARY",36:"SYSTEM_BOUNDARY",37:"BOUNDARY",38:"CONTAINER_BOUNDARY",39:"NODE",40:"NODE_L",41:"NODE_R",42:"RBRACE",44:"PERSON",45:"PERSON_EXT",46:"SYSTEM",47:"SYSTEM_DB",48:"SYSTEM_QUEUE",49:"SYSTEM_EXT",50:"SYSTEM_EXT_DB",51:"SYSTEM_EXT_QUEUE",52:"CONTAINER",53:"CONTAINER_DB",54:"CONTAINER_QUEUE",55:"CONTAINER_EXT",56:"CONTAINER_EXT_DB",57:"CONTAINER_EXT_QUEUE",58:"COMPONENT",59:"COMPONENT_DB",60:"COMPONENT_QUEUE",61:"COMPONENT_EXT",62:"COMPONENT_EXT_DB",63:"COMPONENT_EXT_QUEUE",64:"REL",65:"BIREL",66:"REL_U",67:"REL_D",68:"REL_L",69:"REL_R",70:"REL_B",71:"REL_INDEX",72:"UPDATE_EL_STYLE",73:"UPDATE_REL_STYLE",74:"UPDATE_LAYOUT_CONFIG",76:"STR",77:"STR_KEY",78:"STR_VALUE",79:"ATTRIBUTE",80:"ATTRIBUTE_EMPTY"},productions_:[0,[3,1],[3,1],[5,1],[5,1],[5,1],[5,1],[4,1],[10,4],[10,4],[10,4],[10,4],[10,4],[13,1],[13,1],[13,2],[19,1],[19,2],[19,3],[21,1],[21,1],[21,2],[21,2],[21,1],[29,3],[30,3],[30,3],[30,4],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[31,1],[20,1],[20,2],[20,3],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,1],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[35,1],[35,2],[75,1],[75,2],[75,1],[75,1]],performAction:t(function(k,R,D,x,j,h,Ft){var _=h.length-1;switch(j){case 3:x.setDirection("TB");break;case 4:x.setDirection("BT");break;case 5:x.setDirection("RL");break;case 6:x.setDirection("LR");break;case 8:case 9:case 10:case 11:case 12:x.setC4Type(h[_-3]);break;case 19:x.setTitle(h[_].substring(6)),this.$=h[_].substring(6);break;case 20:x.setAccDescription(h[_].substring(15)),this.$=h[_].substring(15);break;case 21:this.$=h[_].trim(),x.setTitle(this.$);break;case 22:case 23:this.$=h[_].trim(),x.setAccDescription(this.$);break;case 28:h[_].splice(2,0,"ENTERPRISE"),x.addPersonOrSystemBoundary(...h[_]),this.$=h[_];break;case 29:h[_].splice(2,0,"SYSTEM"),x.addPersonOrSystemBoundary(...h[_]),this.$=h[_];break;case 30:x.addPersonOrSystemBoundary(...h[_]),this.$=h[_];break;case 31:h[_].splice(2,0,"CONTAINER"),x.addContainerBoundary(...h[_]),this.$=h[_];break;case 32:x.addDeploymentNode("node",...h[_]),this.$=h[_];break;case 33:x.addDeploymentNode("nodeL",...h[_]),this.$=h[_];break;case 34:x.addDeploymentNode("nodeR",...h[_]),this.$=h[_];break;case 35:x.popBoundaryParseStack();break;case 39:x.addPersonOrSystem("person",...h[_]),this.$=h[_];break;case 40:x.addPersonOrSystem("external_person",...h[_]),this.$=h[_];break;case 41:x.addPersonOrSystem("system",...h[_]),this.$=h[_];break;case 42:x.addPersonOrSystem("system_db",...h[_]),this.$=h[_];break;case 43:x.addPersonOrSystem("system_queue",...h[_]),this.$=h[_];break;case 44:x.addPersonOrSystem("external_system",...h[_]),this.$=h[_];break;case 45:x.addPersonOrSystem("external_system_db",...h[_]),this.$=h[_];break;case 46:x.addPersonOrSystem("external_system_queue",...h[_]),this.$=h[_];break;case 47:x.addContainer("container",...h[_]),this.$=h[_];break;case 48:x.addContainer("container_db",...h[_]),this.$=h[_];break;case 49:x.addContainer("container_queue",...h[_]),this.$=h[_];break;case 50:x.addContainer("external_container",...h[_]),this.$=h[_];break;case 51:x.addContainer("external_container_db",...h[_]),this.$=h[_];break;case 52:x.addContainer("external_container_queue",...h[_]),this.$=h[_];break;case 53:x.addComponent("component",...h[_]),this.$=h[_];break;case 54:x.addComponent("component_db",...h[_]),this.$=h[_];break;case 55:x.addComponent("component_queue",...h[_]),this.$=h[_];break;case 56:x.addComponent("external_component",...h[_]),this.$=h[_];break;case 57:x.addComponent("external_component_db",...h[_]),this.$=h[_];break;case 58:x.addComponent("external_component_queue",...h[_]),this.$=h[_];break;case 60:x.addRel("rel",...h[_]),this.$=h[_];break;case 61:x.addRel("birel",...h[_]),this.$=h[_];break;case 62:x.addRel("rel_u",...h[_]),this.$=h[_];break;case 63:x.addRel("rel_d",...h[_]),this.$=h[_];break;case 64:x.addRel("rel_l",...h[_]),this.$=h[_];break;case 65:x.addRel("rel_r",...h[_]),this.$=h[_];break;case 66:x.addRel("rel_b",...h[_]),this.$=h[_];break;case 67:h[_].splice(0,1),x.addRel("rel",...h[_]),this.$=h[_];break;case 68:x.updateElStyle("update_el_style",...h[_]),this.$=h[_];break;case 69:x.updateRelStyle("update_rel_style",...h[_]),this.$=h[_];break;case 70:x.updateLayoutConfig("update_layout_config",...h[_]),this.$=h[_];break;case 71:this.$=[h[_]];break;case 72:h[_].unshift(h[_-1]),this.$=h[_];break;case 73:case 75:this.$=h[_].trim();break;case 74:let At={};At[h[_-1].trim()]=h[_].trim(),this.$=At;break;case 76:this.$="";break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],7:[1,6],8:[1,7],9:[1,8],10:4,11:[1,9],15:[1,10],16:[1,11],17:[1,12],18:[1,13]},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,7]},{1:[2,3]},{1:[2,4]},{1:[2,5]},{1:[2,6]},{12:[1,14]},{12:[1,15]},{12:[1,16]},{12:[1,17]},{12:[1,18]},{13:19,19:20,20:21,21:22,22:n,23:i,24:o,26:f,28:u,29:49,30:61,32:62,34:r,36:d,37:s,38:y,39:g,40:m,41:v,43:23,44:P,45:V,46:z,47:Y,48:U,49:H,50:rt,51:st,52:at,53:it,54:ot,55:lt,56:ct,57:ut,58:ht,59:dt,60:pt,61:ft,62:yt,63:_t,64:bt,65:mt,66:gt,67:xt,68:vt,69:kt,70:Et,71:St,72:Tt,73:Ct,74:Rt},{13:70,19:20,20:21,21:22,22:n,23:i,24:o,26:f,28:u,29:49,30:61,32:62,34:r,36:d,37:s,38:y,39:g,40:m,41:v,43:23,44:P,45:V,46:z,47:Y,48:U,49:H,50:rt,51:st,52:at,53:it,54:ot,55:lt,56:ct,57:ut,58:ht,59:dt,60:pt,61:ft,62:yt,63:_t,64:bt,65:mt,66:gt,67:xt,68:vt,69:kt,70:Et,71:St,72:Tt,73:Ct,74:Rt},{13:71,19:20,20:21,21:22,22:n,23:i,24:o,26:f,28:u,29:49,30:61,32:62,34:r,36:d,37:s,38:y,39:g,40:m,41:v,43:23,44:P,45:V,46:z,47:Y,48:U,49:H,50:rt,51:st,52:at,53:it,54:ot,55:lt,56:ct,57:ut,58:ht,59:dt,60:pt,61:ft,62:yt,63:_t,64:bt,65:mt,66:gt,67:xt,68:vt,69:kt,70:Et,71:St,72:Tt,73:Ct,74:Rt},{13:72,19:20,20:21,21:22,22:n,23:i,24:o,26:f,28:u,29:49,30:61,32:62,34:r,36:d,37:s,38:y,39:g,40:m,41:v,43:23,44:P,45:V,46:z,47:Y,48:U,49:H,50:rt,51:st,52:at,53:it,54:ot,55:lt,56:ct,57:ut,58:ht,59:dt,60:pt,61:ft,62:yt,63:_t,64:bt,65:mt,66:gt,67:xt,68:vt,69:kt,70:Et,71:St,72:Tt,73:Ct,74:Rt},{13:73,19:20,20:21,21:22,22:n,23:i,24:o,26:f,28:u,29:49,30:61,32:62,34:r,36:d,37:s,38:y,39:g,40:m,41:v,43:23,44:P,45:V,46:z,47:Y,48:U,49:H,50:rt,51:st,52:at,53:it,54:ot,55:lt,56:ct,57:ut,58:ht,59:dt,60:pt,61:ft,62:yt,63:_t,64:bt,65:mt,66:gt,67:xt,68:vt,69:kt,70:Et,71:St,72:Tt,73:Ct,74:Rt},{14:[1,74]},e(Bt,[2,13],{43:23,29:49,30:61,32:62,20:75,34:r,36:d,37:s,38:y,39:g,40:m,41:v,44:P,45:V,46:z,47:Y,48:U,49:H,50:rt,51:st,52:at,53:it,54:ot,55:lt,56:ct,57:ut,58:ht,59:dt,60:pt,61:ft,62:yt,63:_t,64:bt,65:mt,66:gt,67:xt,68:vt,69:kt,70:Et,71:St,72:Tt,73:Ct,74:Rt}),e(Bt,[2,14]),e($t,[2,16],{12:[1,76]}),e(Bt,[2,36],{12:[1,77]}),e(Yt,[2,19]),e(Yt,[2,20]),{25:[1,78]},{27:[1,79]},e(Yt,[2,23]),{35:80,75:81,76:N,77:L,79:I,80:M},{35:86,75:81,76:N,77:L,79:I,80:M},{35:87,75:81,76:N,77:L,79:I,80:M},{35:88,75:81,76:N,77:L,79:I,80:M},{35:89,75:81,76:N,77:L,79:I,80:M},{35:90,75:81,76:N,77:L,79:I,80:M},{35:91,75:81,76:N,77:L,79:I,80:M},{35:92,75:81,76:N,77:L,79:I,80:M},{35:93,75:81,76:N,77:L,79:I,80:M},{35:94,75:81,76:N,77:L,79:I,80:M},{35:95,75:81,76:N,77:L,79:I,80:M},{35:96,75:81,76:N,77:L,79:I,80:M},{35:97,75:81,76:N,77:L,79:I,80:M},{35:98,75:81,76:N,77:L,79:I,80:M},{35:99,75:81,76:N,77:L,79:I,80:M},{35:100,75:81,76:N,77:L,79:I,80:M},{35:101,75:81,76:N,77:L,79:I,80:M},{35:102,75:81,76:N,77:L,79:I,80:M},{35:103,75:81,76:N,77:L,79:I,80:M},{35:104,75:81,76:N,77:L,79:I,80:M},e(B,[2,59]),{35:105,75:81,76:N,77:L,79:I,80:M},{35:106,75:81,76:N,77:L,79:I,80:M},{35:107,75:81,76:N,77:L,79:I,80:M},{35:108,75:81,76:N,77:L,79:I,80:M},{35:109,75:81,76:N,77:L,79:I,80:M},{35:110,75:81,76:N,77:L,79:I,80:M},{35:111,75:81,76:N,77:L,79:I,80:M},{35:112,75:81,76:N,77:L,79:I,80:M},{35:113,75:81,76:N,77:L,79:I,80:M},{35:114,75:81,76:N,77:L,79:I,80:M},{35:115,75:81,76:N,77:L,79:I,80:M},{20:116,29:49,30:61,32:62,34:r,36:d,37:s,38:y,39:g,40:m,41:v,43:23,44:P,45:V,46:z,47:Y,48:U,49:H,50:rt,51:st,52:at,53:it,54:ot,55:lt,56:ct,57:ut,58:ht,59:dt,60:pt,61:ft,62:yt,63:_t,64:bt,65:mt,66:gt,67:xt,68:vt,69:kt,70:Et,71:St,72:Tt,73:Ct,74:Rt},{12:[1,118],33:[1,117]},{35:119,75:81,76:N,77:L,79:I,80:M},{35:120,75:81,76:N,77:L,79:I,80:M},{35:121,75:81,76:N,77:L,79:I,80:M},{35:122,75:81,76:N,77:L,79:I,80:M},{35:123,75:81,76:N,77:L,79:I,80:M},{35:124,75:81,76:N,77:L,79:I,80:M},{35:125,75:81,76:N,77:L,79:I,80:M},{14:[1,126]},{14:[1,127]},{14:[1,128]},{14:[1,129]},{1:[2,8]},e(Bt,[2,15]),e($t,[2,17],{21:22,19:130,22:n,23:i,24:o,26:f,28:u}),e(Bt,[2,37],{19:20,20:21,21:22,43:23,29:49,30:61,32:62,13:131,22:n,23:i,24:o,26:f,28:u,34:r,36:d,37:s,38:y,39:g,40:m,41:v,44:P,45:V,46:z,47:Y,48:U,49:H,50:rt,51:st,52:at,53:it,54:ot,55:lt,56:ct,57:ut,58:ht,59:dt,60:pt,61:ft,62:yt,63:_t,64:bt,65:mt,66:gt,67:xt,68:vt,69:kt,70:Et,71:St,72:Tt,73:Ct,74:Rt}),e(Yt,[2,21]),e(Yt,[2,22]),e(B,[2,39]),e(ye,[2,71],{75:81,35:132,76:N,77:L,79:I,80:M}),e(Xt,[2,73]),{78:[1,133]},e(Xt,[2,75]),e(Xt,[2,76]),e(B,[2,40]),e(B,[2,41]),e(B,[2,42]),e(B,[2,43]),e(B,[2,44]),e(B,[2,45]),e(B,[2,46]),e(B,[2,47]),e(B,[2,48]),e(B,[2,49]),e(B,[2,50]),e(B,[2,51]),e(B,[2,52]),e(B,[2,53]),e(B,[2,54]),e(B,[2,55]),e(B,[2,56]),e(B,[2,57]),e(B,[2,58]),e(B,[2,60]),e(B,[2,61]),e(B,[2,62]),e(B,[2,63]),e(B,[2,64]),e(B,[2,65]),e(B,[2,66]),e(B,[2,67]),e(B,[2,68]),e(B,[2,69]),e(B,[2,70]),{31:134,42:[1,135]},{12:[1,136]},{33:[1,137]},e(Nt,[2,28]),e(Nt,[2,29]),e(Nt,[2,30]),e(Nt,[2,31]),e(Nt,[2,32]),e(Nt,[2,33]),e(Nt,[2,34]),{1:[2,9]},{1:[2,10]},{1:[2,11]},{1:[2,12]},e($t,[2,18]),e(Bt,[2,38]),e(ye,[2,72]),e(Xt,[2,74]),e(B,[2,24]),e(B,[2,35]),e(te,[2,25]),e(te,[2,26],{12:[1,138]}),e(te,[2,27])],defaultActions:{2:[2,1],3:[2,2],4:[2,7],5:[2,3],6:[2,4],7:[2,5],8:[2,6],74:[2,8],126:[2,9],127:[2,10],128:[2,11],129:[2,12]},parseError:t(function(k,R){if(R.recoverable)this.trace(k);else{var D=Error(k);throw D.hash=R,D}},"parseError"),parse:t(function(k){var R=this,D=[0],x=[],j=[null],h=[],Ft=this.table,_="",At=0,_e=0,be=0,Be=2,me=1,Ve=h.slice.call(arguments,1),W=Object.create(this.lexer),Lt={yy:{}};for(var ne in this.yy)if(Object.prototype.hasOwnProperty.call(this.yy,ne))Lt.yy[ne]=this.yy[ne];if(W.setInput(k,Lt.yy),Lt.yy.lexer=W,Lt.yy.parser=this,typeof W.yylloc>"u")W.yylloc={};var re=W.yylloc;h.push(re);var Ye=W.options&&W.options.ranges;if(typeof Lt.yy.parseError==="function")this.parseError=Lt.yy.parseError;else this.parseError=Object.getPrototypeOf(this).parseError;function Fe(K){D.length=D.length-2*K,j.length=j.length-K,h.length=h.length-K}t(Fe,"popStack");function ge(){var K=x.pop()||W.lex()||me;if(typeof K!=="number"){if(K instanceof Array)x=K,K=x.pop();K=R.symbols_[K]||K}return K}t(ge,"lex");var X,se,It,Q,X0,ae,Vt={},Ht,et,xe,Qt;while(!0){if(It=D[D.length-1],this.defaultActions[It])Q=this.defaultActions[It];else{if(X===null||typeof X>"u")X=ge();Q=Ft[It]&&Ft[It][X]}if(typeof Q>"u"||!Q.length||!Q[0]){var ie="";Qt=[];for(Ht in Ft[It])if(this.terminals_[Ht]&&Ht>Be)Qt.push("'"+this.terminals_[Ht]+"'");if(W.showPosition)ie="Parse error on line "+(At+1)+`:
1
+ import{t,a,oe,O,b,F,S,E,T,A,l,p,Dn,Kr,He,w,ea}from"./chunk-tfqarvdx.js";import{an}from"./chunk-vasppf6b.js";var Gt=function(){var e=t(function(wt,k,R,D){for(R=R||{},D=wt.length;D--;R[wt[D]]=k);return R},"o"),n=[1,24],i=[1,25],o=[1,26],f=[1,27],u=[1,28],r=[1,63],d=[1,64],s=[1,65],y=[1,66],g=[1,67],m=[1,68],v=[1,69],P=[1,29],V=[1,30],z=[1,31],Y=[1,32],U=[1,33],H=[1,34],rt=[1,35],st=[1,36],at=[1,37],it=[1,38],ot=[1,39],lt=[1,40],ct=[1,41],ut=[1,42],ht=[1,43],dt=[1,44],pt=[1,45],ft=[1,46],yt=[1,47],_t=[1,48],bt=[1,50],mt=[1,51],gt=[1,52],xt=[1,53],vt=[1,54],kt=[1,55],Et=[1,56],St=[1,57],Tt=[1,58],Ct=[1,59],Rt=[1,60],Bt=[14,42],$t=[14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],Yt=[12,14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],N=[1,82],L=[1,83],I=[1,84],M=[1,85],B=[12,14,42],ye=[12,14,33,42],Xt=[12,14,33,42,76,77,79,80],Nt=[12,33],te=[34,36,37,38,39,40,41,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],ee={trace:t(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,direction:5,direction_tb:6,direction_bt:7,direction_rl:8,direction_lr:9,graphConfig:10,C4_CONTEXT:11,NEWLINE:12,statements:13,EOF:14,C4_CONTAINER:15,C4_COMPONENT:16,C4_DYNAMIC:17,C4_DEPLOYMENT:18,otherStatements:19,diagramStatements:20,otherStatement:21,title:22,accDescription:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,boundaryStatement:29,boundaryStartStatement:30,boundaryStopStatement:31,boundaryStart:32,LBRACE:33,ENTERPRISE_BOUNDARY:34,attributes:35,SYSTEM_BOUNDARY:36,BOUNDARY:37,CONTAINER_BOUNDARY:38,NODE:39,NODE_L:40,NODE_R:41,RBRACE:42,diagramStatement:43,PERSON:44,PERSON_EXT:45,SYSTEM:46,SYSTEM_DB:47,SYSTEM_QUEUE:48,SYSTEM_EXT:49,SYSTEM_EXT_DB:50,SYSTEM_EXT_QUEUE:51,CONTAINER:52,CONTAINER_DB:53,CONTAINER_QUEUE:54,CONTAINER_EXT:55,CONTAINER_EXT_DB:56,CONTAINER_EXT_QUEUE:57,COMPONENT:58,COMPONENT_DB:59,COMPONENT_QUEUE:60,COMPONENT_EXT:61,COMPONENT_EXT_DB:62,COMPONENT_EXT_QUEUE:63,REL:64,BIREL:65,REL_U:66,REL_D:67,REL_L:68,REL_R:69,REL_B:70,REL_INDEX:71,UPDATE_EL_STYLE:72,UPDATE_REL_STYLE:73,UPDATE_LAYOUT_CONFIG:74,attribute:75,STR:76,STR_KEY:77,STR_VALUE:78,ATTRIBUTE:79,ATTRIBUTE_EMPTY:80,$accept:0,$end:1},terminals_:{2:"error",6:"direction_tb",7:"direction_bt",8:"direction_rl",9:"direction_lr",11:"C4_CONTEXT",12:"NEWLINE",14:"EOF",15:"C4_CONTAINER",16:"C4_COMPONENT",17:"C4_DYNAMIC",18:"C4_DEPLOYMENT",22:"title",23:"accDescription",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"LBRACE",34:"ENTERPRISE_BOUNDARY",36:"SYSTEM_BOUNDARY",37:"BOUNDARY",38:"CONTAINER_BOUNDARY",39:"NODE",40:"NODE_L",41:"NODE_R",42:"RBRACE",44:"PERSON",45:"PERSON_EXT",46:"SYSTEM",47:"SYSTEM_DB",48:"SYSTEM_QUEUE",49:"SYSTEM_EXT",50:"SYSTEM_EXT_DB",51:"SYSTEM_EXT_QUEUE",52:"CONTAINER",53:"CONTAINER_DB",54:"CONTAINER_QUEUE",55:"CONTAINER_EXT",56:"CONTAINER_EXT_DB",57:"CONTAINER_EXT_QUEUE",58:"COMPONENT",59:"COMPONENT_DB",60:"COMPONENT_QUEUE",61:"COMPONENT_EXT",62:"COMPONENT_EXT_DB",63:"COMPONENT_EXT_QUEUE",64:"REL",65:"BIREL",66:"REL_U",67:"REL_D",68:"REL_L",69:"REL_R",70:"REL_B",71:"REL_INDEX",72:"UPDATE_EL_STYLE",73:"UPDATE_REL_STYLE",74:"UPDATE_LAYOUT_CONFIG",76:"STR",77:"STR_KEY",78:"STR_VALUE",79:"ATTRIBUTE",80:"ATTRIBUTE_EMPTY"},productions_:[0,[3,1],[3,1],[5,1],[5,1],[5,1],[5,1],[4,1],[10,4],[10,4],[10,4],[10,4],[10,4],[13,1],[13,1],[13,2],[19,1],[19,2],[19,3],[21,1],[21,1],[21,2],[21,2],[21,1],[29,3],[30,3],[30,3],[30,4],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[31,1],[20,1],[20,2],[20,3],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,1],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[35,1],[35,2],[75,1],[75,2],[75,1],[75,1]],performAction:t(function(k,R,D,x,j,h,Ft){var _=h.length-1;switch(j){case 3:x.setDirection("TB");break;case 4:x.setDirection("BT");break;case 5:x.setDirection("RL");break;case 6:x.setDirection("LR");break;case 8:case 9:case 10:case 11:case 12:x.setC4Type(h[_-3]);break;case 19:x.setTitle(h[_].substring(6)),this.$=h[_].substring(6);break;case 20:x.setAccDescription(h[_].substring(15)),this.$=h[_].substring(15);break;case 21:this.$=h[_].trim(),x.setTitle(this.$);break;case 22:case 23:this.$=h[_].trim(),x.setAccDescription(this.$);break;case 28:h[_].splice(2,0,"ENTERPRISE"),x.addPersonOrSystemBoundary(...h[_]),this.$=h[_];break;case 29:h[_].splice(2,0,"SYSTEM"),x.addPersonOrSystemBoundary(...h[_]),this.$=h[_];break;case 30:x.addPersonOrSystemBoundary(...h[_]),this.$=h[_];break;case 31:h[_].splice(2,0,"CONTAINER"),x.addContainerBoundary(...h[_]),this.$=h[_];break;case 32:x.addDeploymentNode("node",...h[_]),this.$=h[_];break;case 33:x.addDeploymentNode("nodeL",...h[_]),this.$=h[_];break;case 34:x.addDeploymentNode("nodeR",...h[_]),this.$=h[_];break;case 35:x.popBoundaryParseStack();break;case 39:x.addPersonOrSystem("person",...h[_]),this.$=h[_];break;case 40:x.addPersonOrSystem("external_person",...h[_]),this.$=h[_];break;case 41:x.addPersonOrSystem("system",...h[_]),this.$=h[_];break;case 42:x.addPersonOrSystem("system_db",...h[_]),this.$=h[_];break;case 43:x.addPersonOrSystem("system_queue",...h[_]),this.$=h[_];break;case 44:x.addPersonOrSystem("external_system",...h[_]),this.$=h[_];break;case 45:x.addPersonOrSystem("external_system_db",...h[_]),this.$=h[_];break;case 46:x.addPersonOrSystem("external_system_queue",...h[_]),this.$=h[_];break;case 47:x.addContainer("container",...h[_]),this.$=h[_];break;case 48:x.addContainer("container_db",...h[_]),this.$=h[_];break;case 49:x.addContainer("container_queue",...h[_]),this.$=h[_];break;case 50:x.addContainer("external_container",...h[_]),this.$=h[_];break;case 51:x.addContainer("external_container_db",...h[_]),this.$=h[_];break;case 52:x.addContainer("external_container_queue",...h[_]),this.$=h[_];break;case 53:x.addComponent("component",...h[_]),this.$=h[_];break;case 54:x.addComponent("component_db",...h[_]),this.$=h[_];break;case 55:x.addComponent("component_queue",...h[_]),this.$=h[_];break;case 56:x.addComponent("external_component",...h[_]),this.$=h[_];break;case 57:x.addComponent("external_component_db",...h[_]),this.$=h[_];break;case 58:x.addComponent("external_component_queue",...h[_]),this.$=h[_];break;case 60:x.addRel("rel",...h[_]),this.$=h[_];break;case 61:x.addRel("birel",...h[_]),this.$=h[_];break;case 62:x.addRel("rel_u",...h[_]),this.$=h[_];break;case 63:x.addRel("rel_d",...h[_]),this.$=h[_];break;case 64:x.addRel("rel_l",...h[_]),this.$=h[_];break;case 65:x.addRel("rel_r",...h[_]),this.$=h[_];break;case 66:x.addRel("rel_b",...h[_]),this.$=h[_];break;case 67:h[_].splice(0,1),x.addRel("rel",...h[_]),this.$=h[_];break;case 68:x.updateElStyle("update_el_style",...h[_]),this.$=h[_];break;case 69:x.updateRelStyle("update_rel_style",...h[_]),this.$=h[_];break;case 70:x.updateLayoutConfig("update_layout_config",...h[_]),this.$=h[_];break;case 71:this.$=[h[_]];break;case 72:h[_].unshift(h[_-1]),this.$=h[_];break;case 73:case 75:this.$=h[_].trim();break;case 74:let At={};At[h[_-1].trim()]=h[_].trim(),this.$=At;break;case 76:this.$="";break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],7:[1,6],8:[1,7],9:[1,8],10:4,11:[1,9],15:[1,10],16:[1,11],17:[1,12],18:[1,13]},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,7]},{1:[2,3]},{1:[2,4]},{1:[2,5]},{1:[2,6]},{12:[1,14]},{12:[1,15]},{12:[1,16]},{12:[1,17]},{12:[1,18]},{13:19,19:20,20:21,21:22,22:n,23:i,24:o,26:f,28:u,29:49,30:61,32:62,34:r,36:d,37:s,38:y,39:g,40:m,41:v,43:23,44:P,45:V,46:z,47:Y,48:U,49:H,50:rt,51:st,52:at,53:it,54:ot,55:lt,56:ct,57:ut,58:ht,59:dt,60:pt,61:ft,62:yt,63:_t,64:bt,65:mt,66:gt,67:xt,68:vt,69:kt,70:Et,71:St,72:Tt,73:Ct,74:Rt},{13:70,19:20,20:21,21:22,22:n,23:i,24:o,26:f,28:u,29:49,30:61,32:62,34:r,36:d,37:s,38:y,39:g,40:m,41:v,43:23,44:P,45:V,46:z,47:Y,48:U,49:H,50:rt,51:st,52:at,53:it,54:ot,55:lt,56:ct,57:ut,58:ht,59:dt,60:pt,61:ft,62:yt,63:_t,64:bt,65:mt,66:gt,67:xt,68:vt,69:kt,70:Et,71:St,72:Tt,73:Ct,74:Rt},{13:71,19:20,20:21,21:22,22:n,23:i,24:o,26:f,28:u,29:49,30:61,32:62,34:r,36:d,37:s,38:y,39:g,40:m,41:v,43:23,44:P,45:V,46:z,47:Y,48:U,49:H,50:rt,51:st,52:at,53:it,54:ot,55:lt,56:ct,57:ut,58:ht,59:dt,60:pt,61:ft,62:yt,63:_t,64:bt,65:mt,66:gt,67:xt,68:vt,69:kt,70:Et,71:St,72:Tt,73:Ct,74:Rt},{13:72,19:20,20:21,21:22,22:n,23:i,24:o,26:f,28:u,29:49,30:61,32:62,34:r,36:d,37:s,38:y,39:g,40:m,41:v,43:23,44:P,45:V,46:z,47:Y,48:U,49:H,50:rt,51:st,52:at,53:it,54:ot,55:lt,56:ct,57:ut,58:ht,59:dt,60:pt,61:ft,62:yt,63:_t,64:bt,65:mt,66:gt,67:xt,68:vt,69:kt,70:Et,71:St,72:Tt,73:Ct,74:Rt},{13:73,19:20,20:21,21:22,22:n,23:i,24:o,26:f,28:u,29:49,30:61,32:62,34:r,36:d,37:s,38:y,39:g,40:m,41:v,43:23,44:P,45:V,46:z,47:Y,48:U,49:H,50:rt,51:st,52:at,53:it,54:ot,55:lt,56:ct,57:ut,58:ht,59:dt,60:pt,61:ft,62:yt,63:_t,64:bt,65:mt,66:gt,67:xt,68:vt,69:kt,70:Et,71:St,72:Tt,73:Ct,74:Rt},{14:[1,74]},e(Bt,[2,13],{43:23,29:49,30:61,32:62,20:75,34:r,36:d,37:s,38:y,39:g,40:m,41:v,44:P,45:V,46:z,47:Y,48:U,49:H,50:rt,51:st,52:at,53:it,54:ot,55:lt,56:ct,57:ut,58:ht,59:dt,60:pt,61:ft,62:yt,63:_t,64:bt,65:mt,66:gt,67:xt,68:vt,69:kt,70:Et,71:St,72:Tt,73:Ct,74:Rt}),e(Bt,[2,14]),e($t,[2,16],{12:[1,76]}),e(Bt,[2,36],{12:[1,77]}),e(Yt,[2,19]),e(Yt,[2,20]),{25:[1,78]},{27:[1,79]},e(Yt,[2,23]),{35:80,75:81,76:N,77:L,79:I,80:M},{35:86,75:81,76:N,77:L,79:I,80:M},{35:87,75:81,76:N,77:L,79:I,80:M},{35:88,75:81,76:N,77:L,79:I,80:M},{35:89,75:81,76:N,77:L,79:I,80:M},{35:90,75:81,76:N,77:L,79:I,80:M},{35:91,75:81,76:N,77:L,79:I,80:M},{35:92,75:81,76:N,77:L,79:I,80:M},{35:93,75:81,76:N,77:L,79:I,80:M},{35:94,75:81,76:N,77:L,79:I,80:M},{35:95,75:81,76:N,77:L,79:I,80:M},{35:96,75:81,76:N,77:L,79:I,80:M},{35:97,75:81,76:N,77:L,79:I,80:M},{35:98,75:81,76:N,77:L,79:I,80:M},{35:99,75:81,76:N,77:L,79:I,80:M},{35:100,75:81,76:N,77:L,79:I,80:M},{35:101,75:81,76:N,77:L,79:I,80:M},{35:102,75:81,76:N,77:L,79:I,80:M},{35:103,75:81,76:N,77:L,79:I,80:M},{35:104,75:81,76:N,77:L,79:I,80:M},e(B,[2,59]),{35:105,75:81,76:N,77:L,79:I,80:M},{35:106,75:81,76:N,77:L,79:I,80:M},{35:107,75:81,76:N,77:L,79:I,80:M},{35:108,75:81,76:N,77:L,79:I,80:M},{35:109,75:81,76:N,77:L,79:I,80:M},{35:110,75:81,76:N,77:L,79:I,80:M},{35:111,75:81,76:N,77:L,79:I,80:M},{35:112,75:81,76:N,77:L,79:I,80:M},{35:113,75:81,76:N,77:L,79:I,80:M},{35:114,75:81,76:N,77:L,79:I,80:M},{35:115,75:81,76:N,77:L,79:I,80:M},{20:116,29:49,30:61,32:62,34:r,36:d,37:s,38:y,39:g,40:m,41:v,43:23,44:P,45:V,46:z,47:Y,48:U,49:H,50:rt,51:st,52:at,53:it,54:ot,55:lt,56:ct,57:ut,58:ht,59:dt,60:pt,61:ft,62:yt,63:_t,64:bt,65:mt,66:gt,67:xt,68:vt,69:kt,70:Et,71:St,72:Tt,73:Ct,74:Rt},{12:[1,118],33:[1,117]},{35:119,75:81,76:N,77:L,79:I,80:M},{35:120,75:81,76:N,77:L,79:I,80:M},{35:121,75:81,76:N,77:L,79:I,80:M},{35:122,75:81,76:N,77:L,79:I,80:M},{35:123,75:81,76:N,77:L,79:I,80:M},{35:124,75:81,76:N,77:L,79:I,80:M},{35:125,75:81,76:N,77:L,79:I,80:M},{14:[1,126]},{14:[1,127]},{14:[1,128]},{14:[1,129]},{1:[2,8]},e(Bt,[2,15]),e($t,[2,17],{21:22,19:130,22:n,23:i,24:o,26:f,28:u}),e(Bt,[2,37],{19:20,20:21,21:22,43:23,29:49,30:61,32:62,13:131,22:n,23:i,24:o,26:f,28:u,34:r,36:d,37:s,38:y,39:g,40:m,41:v,44:P,45:V,46:z,47:Y,48:U,49:H,50:rt,51:st,52:at,53:it,54:ot,55:lt,56:ct,57:ut,58:ht,59:dt,60:pt,61:ft,62:yt,63:_t,64:bt,65:mt,66:gt,67:xt,68:vt,69:kt,70:Et,71:St,72:Tt,73:Ct,74:Rt}),e(Yt,[2,21]),e(Yt,[2,22]),e(B,[2,39]),e(ye,[2,71],{75:81,35:132,76:N,77:L,79:I,80:M}),e(Xt,[2,73]),{78:[1,133]},e(Xt,[2,75]),e(Xt,[2,76]),e(B,[2,40]),e(B,[2,41]),e(B,[2,42]),e(B,[2,43]),e(B,[2,44]),e(B,[2,45]),e(B,[2,46]),e(B,[2,47]),e(B,[2,48]),e(B,[2,49]),e(B,[2,50]),e(B,[2,51]),e(B,[2,52]),e(B,[2,53]),e(B,[2,54]),e(B,[2,55]),e(B,[2,56]),e(B,[2,57]),e(B,[2,58]),e(B,[2,60]),e(B,[2,61]),e(B,[2,62]),e(B,[2,63]),e(B,[2,64]),e(B,[2,65]),e(B,[2,66]),e(B,[2,67]),e(B,[2,68]),e(B,[2,69]),e(B,[2,70]),{31:134,42:[1,135]},{12:[1,136]},{33:[1,137]},e(Nt,[2,28]),e(Nt,[2,29]),e(Nt,[2,30]),e(Nt,[2,31]),e(Nt,[2,32]),e(Nt,[2,33]),e(Nt,[2,34]),{1:[2,9]},{1:[2,10]},{1:[2,11]},{1:[2,12]},e($t,[2,18]),e(Bt,[2,38]),e(ye,[2,72]),e(Xt,[2,74]),e(B,[2,24]),e(B,[2,35]),e(te,[2,25]),e(te,[2,26],{12:[1,138]}),e(te,[2,27])],defaultActions:{2:[2,1],3:[2,2],4:[2,7],5:[2,3],6:[2,4],7:[2,5],8:[2,6],74:[2,8],126:[2,9],127:[2,10],128:[2,11],129:[2,12]},parseError:t(function(k,R){if(R.recoverable)this.trace(k);else{var D=Error(k);throw D.hash=R,D}},"parseError"),parse:t(function(k){var R=this,D=[0],x=[],j=[null],h=[],Ft=this.table,_="",At=0,_e=0,be=0,Be=2,me=1,Ve=h.slice.call(arguments,1),W=Object.create(this.lexer),Lt={yy:{}};for(var ne in this.yy)if(Object.prototype.hasOwnProperty.call(this.yy,ne))Lt.yy[ne]=this.yy[ne];if(W.setInput(k,Lt.yy),Lt.yy.lexer=W,Lt.yy.parser=this,typeof W.yylloc>"u")W.yylloc={};var re=W.yylloc;h.push(re);var Ye=W.options&&W.options.ranges;if(typeof Lt.yy.parseError==="function")this.parseError=Lt.yy.parseError;else this.parseError=Object.getPrototypeOf(this).parseError;function Fe(K){D.length=D.length-2*K,j.length=j.length-K,h.length=h.length-K}t(Fe,"popStack");function ge(){var K=x.pop()||W.lex()||me;if(typeof K!=="number"){if(K instanceof Array)x=K,K=x.pop();K=R.symbols_[K]||K}return K}t(ge,"lex");var X,se,It,Q,X0,ae,Vt={},Ht,et,xe,Qt;while(!0){if(It=D[D.length-1],this.defaultActions[It])Q=this.defaultActions[It];else{if(X===null||typeof X>"u")X=ge();Q=Ft[It]&&Ft[It][X]}if(typeof Q>"u"||!Q.length||!Q[0]){var ie="";Qt=[];for(Ht in Ft[It])if(this.terminals_[Ht]&&Ht>Be)Qt.push("'"+this.terminals_[Ht]+"'");if(W.showPosition)ie="Parse error on line "+(At+1)+`:
2
2
  `+W.showPosition()+`
3
3
  Expecting `+Qt.join(", ")+", got '"+(this.terminals_[X]||X)+"'";else ie="Parse error on line "+(At+1)+": Unexpected "+(X==me?"end of input":"'"+(this.terminals_[X]||X)+"'");this.parseError(ie,{text:W.match,token:this.terminals_[X]||X,line:W.yylineno,loc:re,expected:Qt})}if(Q[0]instanceof Array&&Q.length>1)throw Error("Parse Error: multiple actions possible at state: "+It+", token: "+X);switch(Q[0]){case 1:if(D.push(X),j.push(W.yytext),h.push(W.yylloc),D.push(Q[1]),X=null,!se){if(_e=W.yyleng,_=W.yytext,At=W.yylineno,re=W.yylloc,be>0)be--}else X=se,se=null;break;case 2:if(et=this.productions_[Q[1]][1],Vt.$=j[j.length-et],Vt._$={first_line:h[h.length-(et||1)].first_line,last_line:h[h.length-1].last_line,first_column:h[h.length-(et||1)].first_column,last_column:h[h.length-1].last_column},Ye)Vt._$.range=[h[h.length-(et||1)].range[0],h[h.length-1].range[1]];if(ae=this.performAction.apply(Vt,[_,_e,At,Lt.yy,Q[1],j,h].concat(Ve)),typeof ae<"u")return ae;if(et)D=D.slice(0,-1*et*2),j=j.slice(0,-1*et),h=h.slice(0,-1*et);D.push(this.productions_[Q[1]][0]),j.push(Vt.$),h.push(Vt._$),xe=Ft[D[D.length-2]][D[D.length-1]],D.push(xe);break;case 3:return!0}}return!0},"parse")},Me=function(){var wt={EOF:1,parseError:t(function(R,D){if(this.yy.parser)this.yy.parser.parseError(R,D);else throw Error(R)},"parseError"),setInput:t(function(k,R){if(this.yy=R||this.yy||{},this._input=k,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:t(function(){var k=this._input[0];this.yytext+=k,this.yyleng++,this.offset++,this.match+=k,this.matched+=k;var R=k.match(/(?:\r\n?|\n).*/g);if(R)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),k},"input"),unput:t(function(k){var R=k.length,D=k.split(/(?:\r\n?|\n)/g);this._input=k+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-R),this.offset-=R;var x=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),D.length-1)this.yylineno-=D.length-1;var j=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:D?(D.length===x.length?this.yylloc.first_column:0)+x[x.length-D.length].length-D[0].length:this.yylloc.first_column-R},this.options.ranges)this.yylloc.range=[j[0],j[0]+this.yyleng-R];return this.yyleng=this.yytext.length,this},"unput"),more:t(function(){return this._more=!0,this},"more"),reject:t(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
4
  `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:t(function(k){this.unput(this.match.slice(k))},"less"),pastInput:t(function(){var k=this.matched.substr(0,this.matched.length-this.match.length);return(k.length>20?"...":"")+k.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:t(function(){var k=this.match;if(k.length<20)k+=this._input.substr(0,20-k.length);return(k.substr(0,20)+(k.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:t(function(){var k=this.pastInput(),R=Array(k.length+1).join("-");return k+this.upcomingInput()+`
@@ -1,2 +1,2 @@
1
- import{t,a,x,l,M,P,Tt,Et,Co,yt,en,So,Hn,Me,To,Qi,At,Ji,tn,Zn}from"./chunk-veam6vk4.js";import{re}from"./chunk-kcjz03h5.js";import{_}from"./chunk-nvt9tkt4.js";function pa(e,{edgePathsClass:r="edges edgePaths"}={}){let n=e.insert("g").attr("class","root"),i=n.insert("g").attr("class","clusters"),s=n.insert("g").attr("class",r),o=n.insert("g").attr("class","edgeLabels"),u=n.insert("g").attr("class","nodes");return{clusters:i,edgePaths:s,edgeLabels:o,nodes:u,rootGroups:n}}t(pa,"createLayoutElementGroups");async function L(e,r,n){if(r.label){let{shapeSvg:i,bbox:s}=await P(e,n===void 0?r:{...r,width:n});r.labelBBox={width:s.width,height:s.height},i.remove()}else r.labelBBox={width:0,height:0}}t(L,"measureGroupLabel");async function ma(e,r,n){let i=await Et(e,r,n),s=i.node()?.getBBox()??{width:0,height:0};return r.width=s.width,r.height=s.height,i}t(ma,"insertMeasuredNode");function D(e,r,n){let i=e,s=new Set;while(i){if(i.dir)return i.dir;if(!i.parentId||s.has(i.parentId))break;s.add(i.parentId),i=r.get(i.parentId)}return n}t(D,"resolveNodeDir");async function S(e,r,n={}){let i=new re({multigraph:!0,compound:!0}),s=[...r.edges],o=l(),u=pa(e),{edgeLabels:d,nodes:c}=u,g=new Map,b=new Map(r.nodes.map((f)=>[f.id,f])),E=r.direction,h=e.node()!=null;await Promise.all(r.nodes.map(async(f)=>{if(f.isGroup){if(h){let w=n.unwrapGroupLabels&&f.labelType!=="markdown";await L(c,f,w?Number.POSITIVE_INFINITY:void 0)}i.setNode(f.id,{...f})}else{if(h){let w=await ma(c,f,{config:o,dir:D(f,b,E)});g.set(f.id,w)}i.setNode(f.id,{...f})}}));for(let f of s){if(h&&Qi(f))await At(d,f);if(i.setEdge(f.start,f.end,{...f},f.id),!r.edges.some((v)=>v.id===f.id))r.edges.push(f)}if(globalThis.mermaidCaptureSizes){let{captureNodeSizes:f}=await (_("4a6gdrbs"),import("./chunk-4a6gdrbs.js"));f(e,r)}return{graph:i,groups:u,nodeElements:g}}t(S,"createGraphWithElements");var W=new Map,m=new Map,k=new Map,U=t(()=>{m.clear(),k.clear(),W.clear()},"clear"),p=t((e,r)=>{let n=m.get(r)||[];return a.trace("In isDescendant",r," ",e," = ",n.includes(e)),n.includes(e)},"isDescendant"),Z=t((e,r)=>{let n=m.get(r)||[];if(a.info("Descendants of ",r," is ",n),a.info("Edge is ",e),e.v===r||e.w===r)return!1;if(!n)return a.debug("Tilt, ",r,",not in descendants"),!1;return n.includes(e.v)||p(e.v,r)||p(e.w,r)||n.includes(e.w)},"edgeInCluster"),R=t((e,r,n,i)=>{a.debug("Copying children of ",e,"root",i,"data",r.node(e),i);let s=r.children(e)||[];if(e!==i)s.push(e);a.debug("Copying (nodes) clusterId",e,"nodes",s),s.forEach((o)=>{if(r.children(o).length>0)R(o,r,n,i);else{let u=r.node(o);if(a.info("cp ",o," to ",i," with parent ",e),n.setNode(o,u),i!==r.parent(o))a.debug("Setting parent",o,r.parent(o)),n.setParent(o,r.parent(o));if(e!==i&&o!==e)a.debug("Setting parent",o,e),n.setParent(o,e);else a.info("In copy ",e,"root",i,"data",r.node(e),i),a.debug("Not Setting parent for node=",o,"cluster!==rootId",e!==i,"node!==clusterId",o!==e);let d=r.edges(o);a.debug("Copying Edges",d),d.forEach((c)=>{a.info("Edge",c);let g=r.edge(c.v,c.w,c.name);a.info("Edge data",g,i);try{if(Z(c,i))a.info("Copying as ",c.v,c.w,g,c.name),n.setEdge(c.v,c.w,g,c.name),a.info("newGraph edges ",n.edges(),n.edge(n.edges()[0]));else a.info("Skipping copy of edge ",c.v,"-->",c.w," rootId: ",i," clusterId:",e)}catch(b){a.error(b)}})}a.debug("Removing node",o),r.removeNode(o)})},"copy"),T=t((e,r)=>{let n=r.children(e),i=[...n];for(let s of n)k.set(s,e),i=[...i,...T(s,r)];return i},"extractDescendants"),I=t((e,r,n)=>{let i=e.edges().filter((c)=>c.v===r||c.w===r),s=e.edges().filter((c)=>c.v===n||c.w===n),o=i.map((c)=>({v:c.v===r?n:c.v,w:c.w===r?r:c.w})),u=s.map((c)=>({v:c.v,w:c.w}));return o.filter((c)=>u.some((g)=>c.v===g.v&&c.w===g.w))},"findCommonEdges"),Bn=t((e,r,n)=>{let i=r.children(e);if(a.trace("Searching children of id ",e,i),i.length<1)return e;let s;for(let o of i){let u=Bn(o,r,n),d=I(r,n,u);if(u)if(d.length>0)s=u;else return u}return s},"findNonClusterChild"),y=t((e)=>{if(!W.has(e))return e;if(!W.get(e).externalConnections)return e;if(W.has(e))return W.get(e).id;return e},"getAnchorId"),so=t((e,r)=>{if(!e||r>10){a.debug("Opting out, no graph ");return}else a.debug("Opting in, graph ");e.nodes().forEach(function(n){if(e.children(n).length>0)a.debug("Cluster identified",n," Replacement id in edges: ",Bn(n,e,n)),m.set(n,T(n,e)),W.set(n,{id:Bn(n,e,n),clusterData:e.node(n)})}),e.nodes().forEach(function(n){let i=e.children(n),s=e.edges();if(i.length>0)a.debug("Cluster identified",n,m),s.forEach((o)=>{let u=p(o.v,n),d=p(o.w,n);if(u^d)a.debug("Edge: ",o," leaves cluster ",n),a.debug("Descendants of XXX ",n,": ",m.get(n)),W.get(n).externalConnections=!0});else a.debug("Not a cluster ",n,m)});for(let n of W.keys()){let i=W.get(n).id,s=e.parent(i);if(s!==n&&W.has(s)&&!W.get(s).externalConnections)W.get(n).id=s;let o=e.edges().some((u)=>u.v===n);if(i&&W.get(n)?.externalConnections&&o&&X(e,i,n)){let u=ee(e,n,e.parent(i));if(u)W.get(n).id=u}}e.edges().forEach(function(n){let i=e.edge(n);a.debug("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(n)),a.debug("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(e.edge(n)));let{v:s,w:o}=n;if(a.debug("Fix XXX",W,"ids:",n.v,n.w,"Translating: ",W.get(n.v)," --- ",W.get(n.w)),W.get(n.v)||W.get(n.w)){if(a.debug("Fixing and trying - removing XXX",n.v,n.w,n.name),s=y(n.v),o=y(n.w),e.removeEdge(n.v,n.w,n.name),s!==n.v){let u=e.parent(s);W.get(u).externalConnections=!0,i.fromCluster=n.v}if(o!==n.w){let u=e.parent(o);W.get(u).externalConnections=!0,i.toCluster=n.w}a.debug("Fix Replacing with XXX",s,o,n.name),e.setEdge(s,o,i,n.name)}}),B(e,0),a.trace(W)},"adjustClustersAndEdges"),B=t((e,r)=>{if(r>10){a.error("Bailing out");return}let n=e.nodes(),i=!1;for(let s of n){let o=e.children(s);i=i||o.length>0}if(!i){a.debug("Done, no node has children",e.nodes());return}a.debug("Nodes = ",n,r);for(let s of n)if(a.debug("Extracting node",s,W,W.has(s)&&!W.get(s).externalConnections,!e.parent(s),e.node(s),e.children("D")," Depth ",r),!W.has(s))a.debug("Not a cluster",s,r);else if(!W.get(s).externalConnections&&e.children(s)&&e.children(s).length>0){a.debug("Cluster without external connections, without a parent and with children",s,r);let u=e.graph().rankdir==="TB"?"LR":"TB";if(W.get(s)?.clusterData?.dir)u=W.get(s).clusterData.dir,a.debug("Fixing dir",W.get(s).clusterData.dir,u);let d=new re({multigraph:!0,compound:!0}).setGraph({rankdir:u,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});R(s,e,d,s),e.setNode(s,{clusterNode:!0,id:s,clusterData:W.get(s).clusterData,label:W.get(s).label,graph:d})}else a.debug("Cluster ** ",s," **not meeting the criteria !externalConnections:",!W.get(s).externalConnections," no parent: ",!e.parent(s)," children ",e.children(s)&&e.children(s).length>0,e.children("D"),r),a.debug(W);n=e.nodes(),a.debug("New list of nodes",n);for(let s of n){let o=e.node(s);if(a.debug(" Now next level",s,o),o?.clusterNode)B(o.graph,r+1)}},"extractor"),A=t((e,r)=>{if(r.length===0)return[];let n=Object.assign([],r);return r.forEach((i)=>{let s=e.children(i),o=A(e,s);n=[...n,...o]}),n},"sorter"),fa=t((e)=>A(e,e.children()),"sortNodesByHierarchy"),X=t((e,r,n)=>{let i=e.parent(r);while(i&&i!==n){let s=W.get(i);if(s&&!s.externalConnections)return!0;i=e.parent(i)}return!1},"isNodeInExtractableCluster"),ee=t((e,r,n)=>{let i=e.children(r)??[];for(let s of i){if(s===n||p(s,n))continue;let o=Bn(s,e,r);if(!o)continue;if(!X(e,o,r))return o}return null},"findSafeAnchorNode");function lr({prepareLayout:e,measureLayout:r,runLayoutCore:n,paintLayout:i,afterPaint:s,paintOptions:o}){let u=r??O;return t(async function(c,g,b,E){let h=g.select("g");(b?.insertMarkers??Zn)(h,c.markers,c.type,c.diagramId),G();let f={element:h,helpers:b,options:E};f.preparedLayout=await e?.(c,f);let w=await u(c,f),v=await n(c,f),C={...f,measure:w};if(i)await i(c,C,v);else await F(c,C,o);await s?.(c,C,v)},"render")}t(lr,"createCommonLayoutRenderer");function G(){Co(),To(),So(),U()}t(G,"clearLayoutRenderState");async function O(e,{element:r},n){return await S(r,e,n)}t(O,"defaultMeasureLayout");async function F(e,r,n={}){let{measure:i}=r,{groups:s}=i;for(let u of n.getNodes?.(e,r)??e.nodes){if(n.skipNode?.(u,r))continue;await j(s,u,r,n)}let o=z(e.nodes);for(let u of e.edges){if(J(u,n))continue;await V(s,u,o,e,n,r)}}t(F,"paintLayoutData");async function j(e,r,n,i){if(r.clusterNode)yt(r);else if(H(r,n,i))await en(e.clusters,r);else yt(r)}t(j,"paintLayoutNode");function H(e,r,n){return e.isGroup===!0&&(n.isCluster?.(e,r)??!0)}t(H,"shouldPaintAsCluster");function z(e){let r=new Map;for(let n of e)if(n?.id)r.set(n.id,n);return r}t(z,"buildNodeLookup");function J(e,r){return e.isLayoutOnly||Boolean(r.skipEdge?.(e))}t(J,"shouldSkipPaintEdge");async function V(e,r,n,i,s,o){let u=tn(e.edgePaths,{...r},s.clusterDb??new Map,i.type,N(r.start,r,n,o,s),N(r.end,r,n,o,s),i.diagramId,Y(r,s),i.layoutAlgorithm);if(Qi(r)){if(!Hn.has(r.id))await At(e.edgeLabels,r);q(r,u)}}t(V,"paintLayoutEdge");function N(e,r,n,i,s){return s.getEdgeNode?.(e,r,i)??(e?n.get(e)??{}:{})}t(N,"getRenderedNode");function Y(e,r){return typeof r.skipIntersect==="function"?r.skipIntersect(e):r.skipIntersect??!1}t(Y,"shouldSkipIntersect");function q(e,r){let n=r?.updatedPath??r?.originalPath,i=x(),{subGraphTitleTotalMargin:s}=Tt({flowchart:i.flowchart??{}});if(e.label){let o=Hn.get(e.id),{x:u,y:d}=Ji(e,r);o.attr("transform",`translate(${u}, ${d+s/2})`)}for(let[o,u]of[["startLeft",e.startLabelLeft],["startRight",e.startLabelRight],["endLeft",e.endLabelLeft],["endRight",e.endLabelRight]])if(u){let{x:d,y:c}=K(e,o,n);Me.get(e.id)[o].attr("transform",`translate(${d}, ${c})`)}}t(q,"positionRenderedEdgeLabel");var te={startLeft:"start_left",startRight:"start_right",endLeft:"end_left",endRight:"end_right"};function K(e,r,n){let i=e.terminalLabelCenters?.[r];if(i)return{...i};if(!n)return{x:e.x,y:e.y};let s=r.startsWith("start")?e.arrowTypeStart:e.arrowTypeEnd;return M.calcTerminalLabelPosition(s?10:0,te[r],n)}t(K,"terminalLabelTranslate");
1
+ import{t,a,x,l,M,P,Tt,Et,Co,vt,en,So,Hn,Me,To,Qi,At,Ji,tn,Zn}from"./chunk-tfqarvdx.js";import{re}from"./chunk-88wd49xe.js";import{_}from"./chunk-ngt1j8py.js";function pa(e,{edgePathsClass:r="edges edgePaths"}={}){let n=e.insert("g").attr("class","root"),i=n.insert("g").attr("class","clusters"),s=n.insert("g").attr("class",r),o=n.insert("g").attr("class","edgeLabels"),u=n.insert("g").attr("class","nodes");return{clusters:i,edgePaths:s,edgeLabels:o,nodes:u,rootGroups:n}}t(pa,"createLayoutElementGroups");async function L(e,r,n){if(r.label){let{shapeSvg:i,bbox:s}=await P(e,n===void 0?r:{...r,width:n});r.labelBBox={width:s.width,height:s.height},i.remove()}else r.labelBBox={width:0,height:0}}t(L,"measureGroupLabel");async function ma(e,r,n){let i=await Et(e,r,n),s=i.node()?.getBBox()??{width:0,height:0};return r.width=s.width,r.height=s.height,i}t(ma,"insertMeasuredNode");function D(e,r,n){let i=e,s=new Set;while(i){if(i.dir)return i.dir;if(!i.parentId||s.has(i.parentId))break;s.add(i.parentId),i=r.get(i.parentId)}return n}t(D,"resolveNodeDir");async function S(e,r,n={}){let i=new re({multigraph:!0,compound:!0}),s=[...r.edges],o=l(),u=pa(e),{edgeLabels:d,nodes:c}=u,g=new Map,b=new Map(r.nodes.map((f)=>[f.id,f])),E=r.direction,h=e.node()!=null;await Promise.all(r.nodes.map(async(f)=>{if(f.isGroup){if(h){let w=n.unwrapGroupLabels&&f.labelType!=="markdown";await L(c,f,w?Number.POSITIVE_INFINITY:void 0)}i.setNode(f.id,{...f})}else{if(h){let w=await ma(c,f,{config:o,dir:D(f,b,E)});g.set(f.id,w)}i.setNode(f.id,{...f})}}));for(let f of s){if(h&&Qi(f))await At(d,f);if(i.setEdge(f.start,f.end,{...f},f.id),!r.edges.some((v)=>v.id===f.id))r.edges.push(f)}if(globalThis.mermaidCaptureSizes){let{captureNodeSizes:f}=await (_("se4h6wx0"),import("./chunk-se4h6wx0.js"));f(e,r)}return{graph:i,groups:u,nodeElements:g}}t(S,"createGraphWithElements");var W=new Map,m=new Map,k=new Map,U=t(()=>{m.clear(),k.clear(),W.clear()},"clear"),p=t((e,r)=>{let n=m.get(r)||[];return a.trace("In isDescendant",r," ",e," = ",n.includes(e)),n.includes(e)},"isDescendant"),Z=t((e,r)=>{let n=m.get(r)||[];if(a.info("Descendants of ",r," is ",n),a.info("Edge is ",e),e.v===r||e.w===r)return!1;if(!n)return a.debug("Tilt, ",r,",not in descendants"),!1;return n.includes(e.v)||p(e.v,r)||p(e.w,r)||n.includes(e.w)},"edgeInCluster"),R=t((e,r,n,i)=>{a.debug("Copying children of ",e,"root",i,"data",r.node(e),i);let s=r.children(e)||[];if(e!==i)s.push(e);a.debug("Copying (nodes) clusterId",e,"nodes",s),s.forEach((o)=>{if(r.children(o).length>0)R(o,r,n,i);else{let u=r.node(o);if(a.info("cp ",o," to ",i," with parent ",e),n.setNode(o,u),i!==r.parent(o))a.debug("Setting parent",o,r.parent(o)),n.setParent(o,r.parent(o));if(e!==i&&o!==e)a.debug("Setting parent",o,e),n.setParent(o,e);else a.info("In copy ",e,"root",i,"data",r.node(e),i),a.debug("Not Setting parent for node=",o,"cluster!==rootId",e!==i,"node!==clusterId",o!==e);let d=r.edges(o);a.debug("Copying Edges",d),d.forEach((c)=>{a.info("Edge",c);let g=r.edge(c.v,c.w,c.name);a.info("Edge data",g,i);try{if(Z(c,i))a.info("Copying as ",c.v,c.w,g,c.name),n.setEdge(c.v,c.w,g,c.name),a.info("newGraph edges ",n.edges(),n.edge(n.edges()[0]));else a.info("Skipping copy of edge ",c.v,"-->",c.w," rootId: ",i," clusterId:",e)}catch(b){a.error(b)}})}a.debug("Removing node",o),r.removeNode(o)})},"copy"),T=t((e,r)=>{let n=r.children(e),i=[...n];for(let s of n)k.set(s,e),i=[...i,...T(s,r)];return i},"extractDescendants"),I=t((e,r,n)=>{let i=e.edges().filter((c)=>c.v===r||c.w===r),s=e.edges().filter((c)=>c.v===n||c.w===n),o=i.map((c)=>({v:c.v===r?n:c.v,w:c.w===r?r:c.w})),u=s.map((c)=>({v:c.v,w:c.w}));return o.filter((c)=>u.some((g)=>c.v===g.v&&c.w===g.w))},"findCommonEdges"),Bn=t((e,r,n)=>{let i=r.children(e);if(a.trace("Searching children of id ",e,i),i.length<1)return e;let s;for(let o of i){let u=Bn(o,r,n),d=I(r,n,u);if(u)if(d.length>0)s=u;else return u}return s},"findNonClusterChild"),y=t((e)=>{if(!W.has(e))return e;if(!W.get(e).externalConnections)return e;if(W.has(e))return W.get(e).id;return e},"getAnchorId"),so=t((e,r)=>{if(!e||r>10){a.debug("Opting out, no graph ");return}else a.debug("Opting in, graph ");e.nodes().forEach(function(n){if(e.children(n).length>0)a.debug("Cluster identified",n," Replacement id in edges: ",Bn(n,e,n)),m.set(n,T(n,e)),W.set(n,{id:Bn(n,e,n),clusterData:e.node(n)})}),e.nodes().forEach(function(n){let i=e.children(n),s=e.edges();if(i.length>0)a.debug("Cluster identified",n,m),s.forEach((o)=>{let u=p(o.v,n),d=p(o.w,n);if(u^d)a.debug("Edge: ",o," leaves cluster ",n),a.debug("Descendants of XXX ",n,": ",m.get(n)),W.get(n).externalConnections=!0});else a.debug("Not a cluster ",n,m)});for(let n of W.keys()){let i=W.get(n).id,s=e.parent(i);if(s!==n&&W.has(s)&&!W.get(s).externalConnections)W.get(n).id=s;let o=e.edges().some((u)=>u.v===n);if(i&&W.get(n)?.externalConnections&&o&&X(e,i,n)){let u=ee(e,n,e.parent(i));if(u)W.get(n).id=u}}e.edges().forEach(function(n){let i=e.edge(n);a.debug("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(n)),a.debug("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(e.edge(n)));let{v:s,w:o}=n;if(a.debug("Fix XXX",W,"ids:",n.v,n.w,"Translating: ",W.get(n.v)," --- ",W.get(n.w)),W.get(n.v)||W.get(n.w)){if(a.debug("Fixing and trying - removing XXX",n.v,n.w,n.name),s=y(n.v),o=y(n.w),e.removeEdge(n.v,n.w,n.name),s!==n.v){let u=e.parent(s);W.get(u).externalConnections=!0,i.fromCluster=n.v}if(o!==n.w){let u=e.parent(o);W.get(u).externalConnections=!0,i.toCluster=n.w}a.debug("Fix Replacing with XXX",s,o,n.name),e.setEdge(s,o,i,n.name)}}),B(e,0),a.trace(W)},"adjustClustersAndEdges"),B=t((e,r)=>{if(r>10){a.error("Bailing out");return}let n=e.nodes(),i=!1;for(let s of n){let o=e.children(s);i=i||o.length>0}if(!i){a.debug("Done, no node has children",e.nodes());return}a.debug("Nodes = ",n,r);for(let s of n)if(a.debug("Extracting node",s,W,W.has(s)&&!W.get(s).externalConnections,!e.parent(s),e.node(s),e.children("D")," Depth ",r),!W.has(s))a.debug("Not a cluster",s,r);else if(!W.get(s).externalConnections&&e.children(s)&&e.children(s).length>0){a.debug("Cluster without external connections, without a parent and with children",s,r);let u=e.graph().rankdir==="TB"?"LR":"TB";if(W.get(s)?.clusterData?.dir)u=W.get(s).clusterData.dir,a.debug("Fixing dir",W.get(s).clusterData.dir,u);let d=new re({multigraph:!0,compound:!0}).setGraph({rankdir:u,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});R(s,e,d,s),e.setNode(s,{clusterNode:!0,id:s,clusterData:W.get(s).clusterData,label:W.get(s).label,graph:d})}else a.debug("Cluster ** ",s," **not meeting the criteria !externalConnections:",!W.get(s).externalConnections," no parent: ",!e.parent(s)," children ",e.children(s)&&e.children(s).length>0,e.children("D"),r),a.debug(W);n=e.nodes(),a.debug("New list of nodes",n);for(let s of n){let o=e.node(s);if(a.debug(" Now next level",s,o),o?.clusterNode)B(o.graph,r+1)}},"extractor"),A=t((e,r)=>{if(r.length===0)return[];let n=Object.assign([],r);return r.forEach((i)=>{let s=e.children(i),o=A(e,s);n=[...n,...o]}),n},"sorter"),fa=t((e)=>A(e,e.children()),"sortNodesByHierarchy"),X=t((e,r,n)=>{let i=e.parent(r);while(i&&i!==n){let s=W.get(i);if(s&&!s.externalConnections)return!0;i=e.parent(i)}return!1},"isNodeInExtractableCluster"),ee=t((e,r,n)=>{let i=e.children(r)??[];for(let s of i){if(s===n||p(s,n))continue;let o=Bn(s,e,r);if(!o)continue;if(!X(e,o,r))return o}return null},"findSafeAnchorNode");function lr({prepareLayout:e,measureLayout:r,runLayoutCore:n,paintLayout:i,afterPaint:s,paintOptions:o}){let u=r??O;return t(async function(c,g,b,E){let h=g.select("g");(b?.insertMarkers??Zn)(h,c.markers,c.type,c.diagramId),G();let f={element:h,helpers:b,options:E};f.preparedLayout=await e?.(c,f);let w=await u(c,f),v=await n(c,f),C={...f,measure:w};if(i)await i(c,C,v);else await F(c,C,o);await s?.(c,C,v)},"render")}t(lr,"createCommonLayoutRenderer");function G(){Co(),To(),So(),U()}t(G,"clearLayoutRenderState");async function O(e,{element:r},n){return await S(r,e,n)}t(O,"defaultMeasureLayout");async function F(e,r,n={}){let{measure:i}=r,{groups:s}=i;for(let u of n.getNodes?.(e,r)??e.nodes){if(n.skipNode?.(u,r))continue;await j(s,u,r,n)}let o=z(e.nodes);for(let u of e.edges){if(J(u,n))continue;await V(s,u,o,e,n,r)}}t(F,"paintLayoutData");async function j(e,r,n,i){if(r.clusterNode)vt(r);else if(H(r,n,i))await en(e.clusters,r);else vt(r)}t(j,"paintLayoutNode");function H(e,r,n){return e.isGroup===!0&&(n.isCluster?.(e,r)??!0)}t(H,"shouldPaintAsCluster");function z(e){let r=new Map;for(let n of e)if(n?.id)r.set(n.id,n);return r}t(z,"buildNodeLookup");function J(e,r){return e.isLayoutOnly||Boolean(r.skipEdge?.(e))}t(J,"shouldSkipPaintEdge");async function V(e,r,n,i,s,o){let u=tn(e.edgePaths,{...r},s.clusterDb??new Map,i.type,N(r.start,r,n,o,s),N(r.end,r,n,o,s),i.diagramId,Y(r,s),i.layoutAlgorithm);if(Qi(r)){if(!Hn.has(r.id))await At(e.edgeLabels,r);q(r,u)}}t(V,"paintLayoutEdge");function N(e,r,n,i,s){return s.getEdgeNode?.(e,r,i)??(e?n.get(e)??{}:{})}t(N,"getRenderedNode");function Y(e,r){return typeof r.skipIntersect==="function"?r.skipIntersect(e):r.skipIntersect??!1}t(Y,"shouldSkipIntersect");function q(e,r){let n=r?.updatedPath??r?.originalPath,i=x(),{subGraphTitleTotalMargin:s}=Tt({flowchart:i.flowchart??{}});if(e.label){let o=Hn.get(e.id),{x:u,y:d}=Ji(e,r);o.attr("transform",`translate(${u}, ${d+s/2})`)}for(let[o,u]of[["startLeft",e.startLabelLeft],["startRight",e.startLabelRight],["endLeft",e.endLabelLeft],["endRight",e.endLabelRight]])if(u){let{x:d,y:c}=K(e,o,n);Me.get(e.id)[o].attr("transform",`translate(${d}, ${c})`)}}t(q,"positionRenderedEdgeLabel");var te={startLeft:"start_left",startRight:"start_right",endLeft:"end_left",endRight:"end_right"};function K(e,r,n){let i=e.terminalLabelCenters?.[r];if(i)return{...i};if(!n)return{x:e.x,y:e.y};let s=r.startsWith("start")?e.arrowTypeStart:e.arrowTypeEnd;return M.calcTerminalLabelPosition(s?10:0,te[r],n)}t(K,"terminalLabelTranslate");
2
2
  export{pa,ma,W,Bn,so,fa,lr};
@@ -1 +1 @@
1
- import{o,Y,i,r,f,e,n,y,ne,Q}from"./chunk-nvt9tkt4.js";import{na}from"./chunk-2hrswh3d.js";var T=[{id:"exa",name:"Exa",description:"免密钥 · 综合搜索"},{id:"tavily",name:"Tavily",description:"免密钥 · 支持域名筛选"},{id:"parallel",name:"Parallel",description:"免密钥 · 网页搜索"},{id:"firecrawl",name:"Firecrawl",description:"免密钥 · 网页内容"},{id:"tinyfish",name:"TinyFish",description:"免密钥 · 搜索摘要"},{id:"searxng",name:"SearXNG",description:"免密钥 · 需自建服务"},{id:"brave",name:"Brave",description:"需密钥 · 独立搜索引擎"}];function D(t){return{enabled:t.search.provider!=="off",provider:t.search.provider==="off"?"auto":t.search.provider,searxngUrl:t.search.searxngUrl??"",proxy:t.proxy??"",acceptLanguage:t.acceptLanguage??""}}function G(t,c){return{search:{provider:t.enabled?t.provider:"off",searxngUrl:t.searxngUrl},keys:{...c},proxy:t.proxy,acceptLanguage:t.acceptLanguage}}function A(t,c,u){let p=D(t);if(c.enabled!==p.enabled)return!0;if(c.enabled&&c.provider!==p.provider)return!0;return c.searxngUrl!==p.searxngUrl||c.proxy!==p.proxy||c.acceptLanguage!==p.acceptLanguage||Object.keys(u).length>0}function z({notice:t}){let{cn:c}=y();if(!t)return null;let u=t.type==="success"?na:ne;return n("div",{role:t.type==="error"?"alert":"status",className:c("flex items-start gap-2 text-xs",t.type==="success"?"text-success":"text-danger"),children:[e(u,{className:"mt-0.5 size-4 shrink-0","aria-hidden":"true"}),e("span",{className:"min-w-0 break-words",children:t.text})]})}function I(t){let{Button:c,Input:u,Switch:p,Select:x,StatusChip:S,SettingActions:R,SettingGroup:P,SettingRow:C,cn:w}=y(),m=Y(),l=t.busy!==void 0;return n("form",{id:`${m}-form`,className:"min-w-0 space-y-5",onSubmit:async(s)=>{s.preventDefault(),await t.onSave()},children:[n(P,{title:"联网搜索",children:[e(C,{title:"启用搜索",description:"查询会发送至所选搜索服务",children:e(p,{label:"启用联网搜索",disabled:l,checked:t.draft.enabled,onCheckedChange:(s)=>t.onDraft({...t.draft,enabled:s})})}),e(C,{title:"搜索渠道",description:"自动:Exa → Tavily → Parallel → Firecrawl → TinyFish",children:e("div",{className:"w-48",children:e(x,{id:`${m}-provider`,value:t.draft.provider,disabled:l||!t.draft.enabled,className:"min-w-0",groups:[{options:[{value:"auto",label:"自动",description:"失败时依次切换渠道"},...T.map((s)=>({value:s.id,label:s.name}))]}],onValueChange:(s)=>{let a=s==="auto"?s:T.find((k)=>k.id===s)?.id;if(a)t.onDraft({...t.draft,provider:a})}})})}),(t.draft.provider==="searxng"||t.draft.searxngUrl)&&e(C,{vertical:!0,title:"自建 SearXNG 地址",children:e(u,{id:`${m}-searxng`,"aria-label":"自建 SearXNG 地址",type:"url",maxLength:2000,disabled:l||!t.draft.enabled,value:t.draft.searxngUrl,placeholder:"https://search.example.com",onChange:(s)=>t.onDraft({...t.draft,searxngUrl:s.target.value})})})]}),e(P,{title:"渠道与密钥",description:"检测使用已保存的配置",action:n(c,{type:"button",size:"sm",variant:"ghost",disabled:l,className:"text-dim",onClick:async()=>await t.onCheck("all"),children:[e(Q,{className:w("size-3.5",t.checking==="all"&&"animate-spin"),"aria-hidden":"true"}),t.checking==="all"?"正在检测…":"全部检测"]}),children:T.map((s)=>{let a=s.id,k=a==="searxng"?void 0:t.saved.keys[a],K=k?.source==="environment",W=a==="searxng"?void 0:t.keys[a],h=W==="",v=t.checks[a],L=t.checking==="all"||t.checking===a,b=k?.configured?"已配置密钥":"未配置";if(a==="searxng")b=t.saved.search.searxngUrl?"已配置地址":"未配置地址";if(K)b="来自环境变量";if(h)b="待移除";if(W)b="待保存密钥";let E=v&&!v.ok&&!L?v.error??(v.kind==="search"?v.meta?.failed[0]?.error:v.meta?.error)??"检测失败,请检查配置。":void 0;return n("div",{className:"min-w-0",children:[n(C,{title:s.name,description:n(f,{children:[s.description,K&&" · 请在服务端环境变量中更换或移除",E&&e("span",{role:"status",className:"block break-words text-danger",children:E})]}),children:[L?e(S,{tone:"neutral",pulse:!0,children:"检测中"}):v?e(S,{tone:v.ok?"success":"danger",children:v.ok?`可用 ${v.elapsedMs} ms`:"不可用"}):e("span",{className:w("text-xs",W!==void 0?"text-warning":"text-faint"),children:b}),a!=="searxng"&&!K&&n(f,{children:[e(c,{type:"button",size:"sm",variant:"ghost",disabled:l,"aria-label":`${k?.configured?"更换":"设置"} ${s.name} 密钥`,"aria-expanded":t.editingKey===a,"aria-controls":`${m}-${a}-key-editor`,onClick:()=>t.onEditKey(t.editingKey===a?void 0:a),children:k?.configured?"更换":"设置密钥"}),k?.configured&&!h&&e(c,{type:"button",size:"sm",variant:"ghost",disabled:l,"aria-label":`移除 ${s.name} 密钥`,onClick:()=>{t.onKeys({...t.keys,[a]:""}),t.onEditKey(void 0)},children:"移除"})]}),e(c,{type:"button",size:"sm",variant:"ghost",disabled:l,"aria-label":`检测 ${s.name}`,onClick:async()=>await t.onCheck(a),children:"检测"})]}),a!=="searxng"&&t.editingKey===a&&n("div",{id:`${m}-${a}-key-editor`,className:"flex items-center gap-2 pb-3",children:[e(u,{id:`${m}-${a}-key`,"aria-label":`${s.name} API 密钥`,type:"password",autoComplete:"new-password",maxLength:4000,disabled:l,value:t.keys[a]??"",placeholder:"输入新密钥,保存后生效;只写入,不回显",onChange:(N)=>{let d={...t.keys};if(N.target.value.trim())d[a]=N.target.value;else delete d[a];t.onKeys(d)}}),e(c,{type:"button",size:"sm",variant:"ghost",disabled:l,onClick:()=>{let N={...t.keys};delete N[a],t.onKeys(N),t.onEditKey(void 0)},children:"取消"})]})]},a)})}),n(P,{title:"网络",children:[e(C,{vertical:!0,title:"代理 URL",description:"留空使用服务端环境代理",children:e(u,{id:`${m}-proxy`,"aria-label":"代理 URL",type:"url",maxLength:2000,disabled:l,value:t.draft.proxy,placeholder:"http://127.0.0.1:7890",onChange:(s)=>t.onDraft({...t.draft,proxy:s.target.value})})}),e(C,{vertical:!0,title:"Accept-Language",children:e(u,{id:`${m}-language`,"aria-label":"Accept-Language",maxLength:200,disabled:l,value:t.draft.acceptLanguage,placeholder:"en-US,en;q=0.9",onChange:(s)=>t.onDraft({...t.draft,acceptLanguage:s.target.value})})})]}),n(R,{children:[e("div",{className:"mr-auto min-w-0",children:e(z,{notice:t.notice})}),t.dirty&&e(c,{type:"button",size:"sm",variant:"ghost",disabled:l,onClick:t.onRestore,children:"撤销更改"}),e(c,{form:`${m}-form`,type:"submit",size:"sm",variant:"primary",disabled:l||!t.dirty,children:t.busy==="save"?"保存中…":"保存"})]})]})}function M({connection:t}){let{Button:c}=y(),[u,p]=r(),[x,S]=r(),[R,P]=r({}),[C,w]=r(),[m,l]=r("load"),[s,a]=r(),[k,K]=r({}),[W,h]=r(),[v,L]=r(0),b=i(void 0);o(()=>{let d=new AbortController;return b.current=d,l("load"),h(void 0),p(void 0),S(void 0),P({}),w(void 0),K({}),t.request("/api/plugins/webfetch/settings",{signal:d.signal,cache:v>0?"reload":"default"}).then((g)=>{if(d.signal.aborted)return;p(g),S(D(g))}).catch((g)=>{if(!d.signal.aborted)h({type:"error",text:g instanceof Error?g.message:"加载设置失败,请重试。"})}).finally(()=>{if(!d.signal.aborted)b.current=void 0,l(void 0)}),()=>{d.abort(),b.current?.abort(),b.current=void 0}},[t,v]);async function E(){if(b.current||!u||!x||!A(u,x,R))return;let d=new AbortController;b.current=d,l("save"),h(void 0);try{let g=await t.request("/api/plugins/webfetch/settings",{method:"PATCH",signal:d.signal,headers:{"Content-Type":"application/json"},body:JSON.stringify(G(x,R))});if(d.signal.aborted)return;p(g),S(D(g)),P({}),w(void 0),K({}),h({type:"success",text:"设置已保存。"})}catch(g){if(!d.signal.aborted)h({type:"error",text:g instanceof Error?g.message:"保存失败,请重试。"})}finally{if(!d.signal.aborted)b.current=void 0,l(void 0)}}async function N(d){if(b.current||!u)return;let g=new AbortController;b.current=g,l("test"),a(d),h(void 0);try{let U=await t.request(`/api/plugins/webfetch/test?provider=${d}`,{method:"POST",signal:g.signal});if(g.signal.aborted)return;K((q)=>{let F={...q};for(let B of U.checks)if(B.kind==="search"&&B.provider)F[B.provider]=B;return F})}catch(U){if(!g.signal.aborted)h({type:"error",text:U instanceof Error?U.message:"检测失败,请重试。"})}finally{if(!g.signal.aborted)b.current=void 0,l(void 0),a(void 0)}}if(!u||!x)return n("div",{className:"min-w-0 space-y-3",children:[m==="load"&&e("p",{role:"status",className:"text-sm text-dim",children:"正在加载设置…"}),e(z,{notice:W}),m!=="load"&&e(c,{type:"button",size:"sm",variant:"ghost",onClick:()=>L(v+1),children:"重新加载"})]});return e(I,{saved:u,draft:x,keys:R,editingKey:C,dirty:A(u,x,R),busy:m==="load"?void 0:m,checking:s,checks:k,notice:W,onDraft:(d)=>{S(d),h(void 0)},onKeys:(d)=>{P(d),h(void 0)},onEditKey:w,onSave:E,onCheck:N,onRestore:()=>{S(D(u)),P({}),w(void 0),h(void 0)}})}export{M as default};
1
+ import{o,Y,i,r,f,e,n,y,ne,Q}from"./chunk-ngt1j8py.js";import{na}from"./chunk-918e5t4x.js";var T=[{id:"exa",name:"Exa",description:"免密钥 · 综合搜索"},{id:"tavily",name:"Tavily",description:"免密钥 · 支持域名筛选"},{id:"parallel",name:"Parallel",description:"免密钥 · 网页搜索"},{id:"firecrawl",name:"Firecrawl",description:"免密钥 · 网页内容"},{id:"tinyfish",name:"TinyFish",description:"免密钥 · 搜索摘要"},{id:"searxng",name:"SearXNG",description:"免密钥 · 需自建服务"},{id:"brave",name:"Brave",description:"需密钥 · 独立搜索引擎"}];function D(t){return{enabled:t.search.provider!=="off",provider:t.search.provider==="off"?"auto":t.search.provider,searxngUrl:t.search.searxngUrl??"",proxy:t.proxy??"",acceptLanguage:t.acceptLanguage??""}}function G(t,c){return{search:{provider:t.enabled?t.provider:"off",searxngUrl:t.searxngUrl},keys:{...c},proxy:t.proxy,acceptLanguage:t.acceptLanguage}}function A(t,c,u){let p=D(t);if(c.enabled!==p.enabled)return!0;if(c.enabled&&c.provider!==p.provider)return!0;return c.searxngUrl!==p.searxngUrl||c.proxy!==p.proxy||c.acceptLanguage!==p.acceptLanguage||Object.keys(u).length>0}function z({notice:t}){let{cn:c}=y();if(!t)return null;let u=t.type==="success"?na:ne;return n("div",{role:t.type==="error"?"alert":"status",className:c("flex items-start gap-2 text-xs",t.type==="success"?"text-success":"text-danger"),children:[e(u,{className:"mt-0.5 size-4 shrink-0","aria-hidden":"true"}),e("span",{className:"min-w-0 break-words",children:t.text})]})}function I(t){let{Button:c,Input:u,Switch:p,Select:x,StatusChip:S,SettingActions:R,SettingGroup:P,SettingRow:C,cn:w}=y(),m=Y(),l=t.busy!==void 0;return n("form",{id:`${m}-form`,className:"min-w-0 space-y-5",onSubmit:async(s)=>{s.preventDefault(),await t.onSave()},children:[n(P,{title:"联网搜索",children:[e(C,{title:"启用搜索",description:"查询会发送至所选搜索服务",children:e(p,{label:"启用联网搜索",disabled:l,checked:t.draft.enabled,onCheckedChange:(s)=>t.onDraft({...t.draft,enabled:s})})}),e(C,{title:"搜索渠道",description:"自动:Exa → Tavily → Parallel → Firecrawl → TinyFish",children:e("div",{className:"w-48",children:e(x,{id:`${m}-provider`,value:t.draft.provider,disabled:l||!t.draft.enabled,className:"min-w-0",groups:[{options:[{value:"auto",label:"自动",description:"失败时依次切换渠道"},...T.map((s)=>({value:s.id,label:s.name}))]}],onValueChange:(s)=>{let a=s==="auto"?s:T.find((k)=>k.id===s)?.id;if(a)t.onDraft({...t.draft,provider:a})}})})}),(t.draft.provider==="searxng"||t.draft.searxngUrl)&&e(C,{vertical:!0,title:"自建 SearXNG 地址",children:e(u,{id:`${m}-searxng`,"aria-label":"自建 SearXNG 地址",type:"url",maxLength:2000,disabled:l||!t.draft.enabled,value:t.draft.searxngUrl,placeholder:"https://search.example.com",onChange:(s)=>t.onDraft({...t.draft,searxngUrl:s.target.value})})})]}),e(P,{title:"渠道与密钥",description:"检测使用已保存的配置",action:n(c,{type:"button",size:"sm",variant:"ghost",disabled:l,className:"text-dim",onClick:async()=>await t.onCheck("all"),children:[e(Q,{className:w("size-3.5",t.checking==="all"&&"animate-spin"),"aria-hidden":"true"}),t.checking==="all"?"正在检测…":"全部检测"]}),children:T.map((s)=>{let a=s.id,k=a==="searxng"?void 0:t.saved.keys[a],K=k?.source==="environment",W=a==="searxng"?void 0:t.keys[a],h=W==="",v=t.checks[a],L=t.checking==="all"||t.checking===a,b=k?.configured?"已配置密钥":"未配置";if(a==="searxng")b=t.saved.search.searxngUrl?"已配置地址":"未配置地址";if(K)b="来自环境变量";if(h)b="待移除";if(W)b="待保存密钥";let E=v&&!v.ok&&!L?v.error??(v.kind==="search"?v.meta?.failed[0]?.error:v.meta?.error)??"检测失败,请检查配置。":void 0;return n("div",{className:"min-w-0",children:[n(C,{title:s.name,description:n(f,{children:[s.description,K&&" · 请在服务端环境变量中更换或移除",E&&e("span",{role:"status",className:"block break-words text-danger",children:E})]}),children:[L?e(S,{tone:"neutral",pulse:!0,children:"检测中"}):v?e(S,{tone:v.ok?"success":"danger",children:v.ok?`可用 ${v.elapsedMs} ms`:"不可用"}):e("span",{className:w("text-xs",W!==void 0?"text-warning":"text-faint"),children:b}),a!=="searxng"&&!K&&n(f,{children:[e(c,{type:"button",size:"sm",variant:"ghost",disabled:l,"aria-label":`${k?.configured?"更换":"设置"} ${s.name} 密钥`,"aria-expanded":t.editingKey===a,"aria-controls":`${m}-${a}-key-editor`,onClick:()=>t.onEditKey(t.editingKey===a?void 0:a),children:k?.configured?"更换":"设置密钥"}),k?.configured&&!h&&e(c,{type:"button",size:"sm",variant:"ghost",disabled:l,"aria-label":`移除 ${s.name} 密钥`,onClick:()=>{t.onKeys({...t.keys,[a]:""}),t.onEditKey(void 0)},children:"移除"})]}),e(c,{type:"button",size:"sm",variant:"ghost",disabled:l,"aria-label":`检测 ${s.name}`,onClick:async()=>await t.onCheck(a),children:"检测"})]}),a!=="searxng"&&t.editingKey===a&&n("div",{id:`${m}-${a}-key-editor`,className:"flex items-center gap-2 pb-3",children:[e(u,{id:`${m}-${a}-key`,"aria-label":`${s.name} API 密钥`,type:"password",autoComplete:"new-password",maxLength:4000,disabled:l,value:t.keys[a]??"",placeholder:"输入新密钥,保存后生效;只写入,不回显",onChange:(N)=>{let d={...t.keys};if(N.target.value.trim())d[a]=N.target.value;else delete d[a];t.onKeys(d)}}),e(c,{type:"button",size:"sm",variant:"ghost",disabled:l,onClick:()=>{let N={...t.keys};delete N[a],t.onKeys(N),t.onEditKey(void 0)},children:"取消"})]})]},a)})}),n(P,{title:"网络",children:[e(C,{vertical:!0,title:"代理 URL",description:"留空使用服务端环境代理",children:e(u,{id:`${m}-proxy`,"aria-label":"代理 URL",type:"url",maxLength:2000,disabled:l,value:t.draft.proxy,placeholder:"http://127.0.0.1:7890",onChange:(s)=>t.onDraft({...t.draft,proxy:s.target.value})})}),e(C,{vertical:!0,title:"Accept-Language",children:e(u,{id:`${m}-language`,"aria-label":"Accept-Language",maxLength:200,disabled:l,value:t.draft.acceptLanguage,placeholder:"en-US,en;q=0.9",onChange:(s)=>t.onDraft({...t.draft,acceptLanguage:s.target.value})})})]}),n(R,{children:[e("div",{className:"mr-auto min-w-0",children:e(z,{notice:t.notice})}),t.dirty&&e(c,{type:"button",size:"sm",variant:"ghost",disabled:l,onClick:t.onRestore,children:"撤销更改"}),e(c,{form:`${m}-form`,type:"submit",size:"sm",variant:"primary",disabled:l||!t.dirty,children:t.busy==="save"?"保存中…":"保存"})]})]})}function M({connection:t}){let{Button:c}=y(),[u,p]=r(),[x,S]=r(),[R,P]=r({}),[C,w]=r(),[m,l]=r("load"),[s,a]=r(),[k,K]=r({}),[W,h]=r(),[v,L]=r(0),b=i(void 0);o(()=>{let d=new AbortController;return b.current=d,l("load"),h(void 0),p(void 0),S(void 0),P({}),w(void 0),K({}),t.request("/api/plugins/webfetch/settings",{signal:d.signal,cache:v>0?"reload":"default"}).then((g)=>{if(d.signal.aborted)return;p(g),S(D(g))}).catch((g)=>{if(!d.signal.aborted)h({type:"error",text:g instanceof Error?g.message:"加载设置失败,请重试。"})}).finally(()=>{if(!d.signal.aborted)b.current=void 0,l(void 0)}),()=>{d.abort(),b.current?.abort(),b.current=void 0}},[t,v]);async function E(){if(b.current||!u||!x||!A(u,x,R))return;let d=new AbortController;b.current=d,l("save"),h(void 0);try{let g=await t.request("/api/plugins/webfetch/settings",{method:"PATCH",signal:d.signal,headers:{"Content-Type":"application/json"},body:JSON.stringify(G(x,R))});if(d.signal.aborted)return;p(g),S(D(g)),P({}),w(void 0),K({}),h({type:"success",text:"设置已保存。"})}catch(g){if(!d.signal.aborted)h({type:"error",text:g instanceof Error?g.message:"保存失败,请重试。"})}finally{if(!d.signal.aborted)b.current=void 0,l(void 0)}}async function N(d){if(b.current||!u)return;let g=new AbortController;b.current=g,l("test"),a(d),h(void 0);try{let U=await t.request(`/api/plugins/webfetch/test?provider=${d}`,{method:"POST",signal:g.signal});if(g.signal.aborted)return;K((q)=>{let F={...q};for(let B of U.checks)if(B.kind==="search"&&B.provider)F[B.provider]=B;return F})}catch(U){if(!g.signal.aborted)h({type:"error",text:U instanceof Error?U.message:"检测失败,请重试。"})}finally{if(!g.signal.aborted)b.current=void 0,l(void 0),a(void 0)}}if(!u||!x)return n("div",{className:"min-w-0 space-y-3",children:[m==="load"&&e("p",{role:"status",className:"text-sm text-dim",children:"正在加载设置…"}),e(z,{notice:W}),m!=="load"&&e(c,{type:"button",size:"sm",variant:"ghost",onClick:()=>L(v+1),children:"重新加载"})]});return e(I,{saved:u,draft:x,keys:R,editingKey:C,dirty:A(u,x,R),busy:m==="load"?void 0:m,checking:s,checks:k,notice:W,onDraft:(d)=>{S(d),h(void 0)},onKeys:(d)=>{P(d),h(void 0)},onEditKey:w,onSave:E,onCheck:N,onRestore:()=>{S(D(u)),P({}),w(void 0),h(void 0)}})}export{M as default};
@@ -1,2 +1,2 @@
1
- import{t,p}from"./chunk-veam6vk4.js";var he=t((o,e)=>{let n;if(e==="sandbox")n=p("#i"+o);return(e==="sandbox"?p(n.nodes()[0].contentDocument.body):p("body")).select(`[id="${o}"]`)},"getDiagramElement");
1
+ import{t,p}from"./chunk-tfqarvdx.js";var he=t((o,e)=>{let n;if(e==="sandbox")n=p("#i"+o);return(e==="sandbox"?p(n.nodes()[0].contentDocument.body):p("body")).select(`[id="${o}"]`)},"getDiagramElement");
2
2
  export{he};