@bkm016/basalt 0.1.10 → 0.1.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{chunk-0mjb3sm3.js → chunk-jymx3a77.js} +165 -152
- package/{chunk-3mqf9ped.js → chunk-zq32mwxj.js} +110 -110
- package/compiled.js +1 -1
- package/package.json +1 -1
- package/ui-test-worker.js +1 -1
- package/web/{chunk-9yfftz38.js → chunk-05mvzx00.js} +1 -1
- package/web/chunk-086dshck.js +1 -0
- package/web/chunk-0fy590s0.js +1 -0
- package/web/{chunk-se4h6wx0.js → chunk-0hvxb5d5.js} +1 -1
- package/web/chunk-0mdf1qja.js +1 -0
- package/web/{chunk-w3zgfhjb.js → chunk-0y971zgq.js} +2 -2
- package/web/{chunk-j89s11x8.js → chunk-1t38sgrk.js} +2 -2
- package/web/{chunk-z4bp6p32.js → chunk-1zfxaafq.js} +1 -1
- package/web/{chunk-g7kz8f7q.js → chunk-27812gqr.js} +5 -5
- package/web/{chunk-rag65pfs.js → chunk-2ds0a2z1.js} +3 -3
- package/web/{chunk-rh3xb76f.js → chunk-2f2agfpj.js} +11 -11
- package/web/{chunk-wtvch4ad.js → chunk-2tsxj613.js} +3 -3
- package/web/{chunk-y2rzeb4v.js → chunk-2weaa3gn.js} +2 -2
- package/web/{chunk-8h2x89tw.js → chunk-3020mmp1.js} +1 -1
- package/web/{chunk-mykrm8ba.js → chunk-30aeb767.js} +2 -2
- package/web/chunk-32zmk3f5.js +1 -0
- package/web/{chunk-rxvm70w5.js → chunk-36dc7tcg.js} +2 -2
- package/web/{chunk-j37p0b13.js → chunk-3a57m7xm.js} +3 -3
- package/web/{chunk-tt93zbn4.js → chunk-3b4wqmnh.js} +7 -7
- package/web/chunk-3d3wnh8a.js +2 -0
- package/web/{chunk-zse05v6j.js → chunk-3ftb27f3.js} +8 -8
- package/web/{chunk-de40q05r.js → chunk-47mbbmst.js} +3 -3
- package/web/chunk-48479gnx.js +1 -0
- package/web/{chunk-5v5q13hz.js → chunk-4gc663j0.js} +2 -2
- package/web/{chunk-88wd49xe.js → chunk-4rwwtfnd.js} +2 -2
- package/web/{chunk-eqndhs21.js → chunk-4wwd3pfz.js} +2 -2
- package/web/{chunk-myd6sc76.js → chunk-57pyz29y.js} +2 -2
- package/web/{chunk-32ty2xfn.js → chunk-59nk506k.js} +1 -1
- package/web/{chunk-m4fxd5d9.js → chunk-5ahx98zj.js} +8 -8
- package/web/chunk-6cjm2yr7.js +1 -0
- package/web/{chunk-frnh4zqf.js → chunk-6jb2zyp6.js} +2 -2
- package/web/{chunk-3eexx7y5.js → chunk-793m5jjh.js} +1 -1
- package/web/{chunk-p55vhns6.js → chunk-7dycbjxn.js} +4 -4
- package/web/chunk-7ycxz39p.js +1 -0
- package/web/{chunk-gw8x1g61.js → chunk-8151c970.js} +1 -1
- package/web/{chunk-jccz14ye.js → chunk-885kpj14.js} +2 -2
- package/web/{chunk-vasppf6b.js → chunk-8csw0mvf.js} +2 -2
- package/web/{chunk-x850q01z.js → chunk-8z7texmv.js} +1 -1
- package/web/{chunk-sd3xat3r.js → chunk-90fkdzx3.js} +6 -6
- package/web/chunk-94denx9h.js +39 -0
- package/web/{chunk-zms6mrqk.js → chunk-96xhmmqz.js} +6 -6
- package/web/chunk-9jy8nc4r.js +1 -0
- package/web/{chunk-dv1berk6.js → chunk-9kkzmss7.js} +3 -3
- package/web/chunk-9wr33d0t.js +1 -0
- package/web/{chunk-fmmrthpa.js → chunk-a3pye9ag.js} +3 -3
- package/web/chunk-a4tdrxdh.js +1 -0
- package/web/chunk-a9fvsyc1.js +1 -0
- package/web/chunk-apvbvg4d.js +1 -0
- package/web/{chunk-wrevb4ew.js → chunk-b3j07x0n.js} +6 -6
- package/web/{chunk-0770q5e1.js → chunk-b6sqwmq7.js} +1 -1
- package/web/chunk-bkxcc7v5.js +1 -0
- package/web/chunk-bve354k7.js +1 -0
- package/web/{chunk-nawxgz87.js → chunk-cbwvfedy.js} +8 -8
- package/web/{chunk-x5g1yy12.js → chunk-cpshsp24.js} +1 -1
- package/web/chunk-cwpxakby.js +1 -0
- package/web/chunk-d3f763n7.js +2 -0
- package/web/{chunk-grm2208k.js → chunk-d4519smc.js} +14 -14
- package/web/chunk-de29pe57.js +1 -0
- package/web/chunk-dk0fnj87.js +1 -0
- package/web/{chunk-c57f714b.js → chunk-drchr3yn.js} +2 -2
- package/web/chunk-dsbyfvwz.js +1 -0
- package/web/{chunk-xtn305fd.js → chunk-dtrh40vr.js} +1 -1
- package/web/chunk-e68jw0bg.js +1 -0
- package/web/{chunk-tfqarvdx.js → chunk-e763h2px.js} +67 -67
- package/web/{chunk-pgwf37s2.js → chunk-enryqmj7.js} +5 -5
- package/web/{chunk-jke2ev6m.js → chunk-f79ajymt.js} +2 -2
- package/web/{chunk-qq6m2my8.js → chunk-fj753yzt.js} +2 -2
- package/web/{chunk-5svqfj4g.js → chunk-g0rtcedn.js} +3 -3
- package/web/{chunk-18neka5g.js → chunk-g31dbnzm.js} +4 -4
- package/web/{chunk-1ev0n3n4.js → chunk-g4as4zzd.js} +4 -4
- package/web/{chunk-6e87m0nm.js → chunk-gten0rpx.js} +2 -2
- package/web/{chunk-sjkg40ay.js → chunk-gyhr27dm.js} +1 -1
- package/web/{chunk-js6kb05s.js → chunk-hjyev38w.js} +6 -6
- package/web/{chunk-rwfmccmh.js → chunk-hm8thq7c.js} +4 -4
- package/web/{chunk-07agqp8h.js → chunk-j4gvtszc.js} +2 -2
- package/web/chunk-jd7npyv9.js +8 -0
- package/web/chunk-jhpg2kcf.js +1 -0
- package/web/{chunk-qdzy124b.js → chunk-jqqbkdtw.js} +2 -2
- package/web/chunk-jzz5htxp.js +1 -0
- package/web/chunk-ka3q31t1.js +1 -0
- package/web/chunk-kahab58k.js +1139 -0
- package/web/{chunk-q4bst4an.js → chunk-kfbgvh0c.js} +1 -1
- package/web/chunk-krgvx75q.js +1 -0
- package/web/chunk-kxeaj44h.js +1 -0
- package/web/chunk-m1rdyvb5.js +1 -0
- package/web/{chunk-z5qn0xev.js → chunk-m24yb8md.js} +2 -2
- package/web/chunk-m7k4wr3k.js +1 -0
- package/web/chunk-mdj3r75b.js +1 -0
- package/web/{chunk-h5ckjk48.js → chunk-mpdeqzc9.js} +10 -10
- package/web/{chunk-knm82fw9.js → chunk-mykbcvqz.js} +1 -1
- package/web/{chunk-1qh7f5kr.js → chunk-n33753da.js} +1 -1
- package/web/{chunk-yppgejg7.js → chunk-nafe18y9.js} +10 -10
- package/web/chunk-nbcpbqq4.js +1 -0
- package/web/{chunk-bc3ajvfg.js → chunk-nhx8pw7p.js} +1 -1
- package/web/chunk-nkpdd9hw.js +1 -0
- package/web/{chunk-eh7wp62z.js → chunk-p1yc8hwn.js} +1 -1
- package/web/chunk-p29brxyt.js +1 -0
- package/web/chunk-p8fbes0t.js +1 -0
- package/web/chunk-pbp1p5ex.js +1 -0
- package/web/{chunk-n4yzs2q0.js → chunk-ppjw1mps.js} +4 -4
- package/web/{chunk-7tkgbbf9.js → chunk-pq56b3mq.js} +2 -2
- package/web/{chunk-vvvd3grf.js → chunk-pzg25qqe.js} +2 -2
- package/web/{chunk-t5nvgz7z.js → chunk-q65zxczs.js} +7 -7
- package/web/{chunk-g7dc4hrd.js → chunk-q8v5j963.js} +2 -2
- package/web/{chunk-zz1qkaar.js → chunk-qykt7avq.js} +2 -2
- package/web/chunk-r6q1301x.js +1 -0
- package/web/chunk-r8kghrkb.js +1 -0
- package/web/chunk-rhxn7mxg.js +1 -0
- package/web/{chunk-46jnkghq.js → chunk-rqympya7.js} +2 -2
- package/web/{chunk-k0cg4n2k.js → chunk-s0xy00v5.js} +2 -2
- package/web/chunk-svqshmpg.js +1 -0
- package/web/chunk-swzxq7r3.css +1 -0
- package/web/{chunk-905vw286.js → chunk-t18tn37m.js} +2 -2
- package/web/chunk-tbsaseer.js +1 -0
- package/web/{chunk-rbqnre6q.js → chunk-tggja45g.js} +3 -3
- package/web/chunk-tgkdyxbn.js +1 -0
- package/web/{chunk-sc63488q.js → chunk-tpdcrrf1.js} +1 -1
- package/web/chunk-v0zfnvc1.js +1 -0
- package/web/{chunk-tqze6d6b.js → chunk-v3dn9bfw.js} +1 -1
- package/web/chunk-vj31fs16.js +1 -0
- package/web/chunk-vr79r8vh.js +1 -0
- package/web/chunk-wb9tax0m.js +1 -0
- package/web/{chunk-26ecc2xh.js → chunk-wbwets5x.js} +19 -19
- package/web/chunk-x9eghjjd.js +1 -0
- package/web/{chunk-awkdw9rw.js → chunk-xbyrgyy0.js} +2 -2
- package/web/{chunk-qy1zx2yw.js → chunk-xjc5fmcr.js} +24 -24
- package/web/{chunk-qh62nkem.js → chunk-ydtrc1ay.js} +2 -2
- package/web/chunk-yrh86m0n.js +1 -0
- package/web/chunk-z3ky5ews.js +2 -0
- package/web/{chunk-ehtmb6sn.js → chunk-zdhyq3ch.js} +13 -13
- package/web/{chunk-gsw1tv96.js → chunk-zv73g4qq.js} +2 -2
- package/web/index.html +1 -1
- package/web/chunk-045d3b5d.js +0 -1
- package/web/chunk-12qf1r6m.js +0 -1
- package/web/chunk-1ex3wgms.js +0 -2
- package/web/chunk-2cz7tx8q.js +0 -1
- package/web/chunk-4am8j3k3.js +0 -1
- package/web/chunk-5qvmefq2.js +0 -1
- package/web/chunk-5z2n4z9x.css +0 -1
- package/web/chunk-6y55gk1n.js +0 -1
- package/web/chunk-7np1jp3x.js +0 -8
- package/web/chunk-7qq1ypvj.js +0 -1
- package/web/chunk-87e8d1hv.js +0 -1
- package/web/chunk-8y2526ve.js +0 -1
- package/web/chunk-918e5t4x.js +0 -2
- package/web/chunk-96m2m3e8.js +0 -1
- package/web/chunk-9f4zzqbx.js +0 -1
- package/web/chunk-a1n4468c.js +0 -1
- package/web/chunk-arnzrqnm.js +0 -1
- package/web/chunk-b46ws7rf.js +0 -1
- package/web/chunk-bwy3e58v.js +0 -1
- package/web/chunk-d5gshd1a.js +0 -1
- package/web/chunk-dp0k5vhd.js +0 -1
- package/web/chunk-et1hytyv.js +0 -1
- package/web/chunk-f7jpakwh.js +0 -1
- package/web/chunk-f9m9seam.js +0 -1
- package/web/chunk-g2erm7k0.js +0 -1
- package/web/chunk-g3kbn0t2.js +0 -1
- package/web/chunk-ght0t49g.js +0 -1
- package/web/chunk-ghwm7bdj.js +0 -2
- package/web/chunk-gx340asc.js +0 -1
- package/web/chunk-h0c42zy3.js +0 -1
- package/web/chunk-h2txs73e.js +0 -39
- package/web/chunk-h3tkacc7.js +0 -1
- package/web/chunk-je78j3vr.js +0 -1
- package/web/chunk-kxdtg9dt.js +0 -1
- package/web/chunk-m9xzt9p7.js +0 -1
- package/web/chunk-mzzaet63.js +0 -1
- package/web/chunk-ngt1j8py.js +0 -1139
- package/web/chunk-q34as3v6.js +0 -1
- package/web/chunk-qe0bgeda.js +0 -1
- package/web/chunk-sat7zyva.js +0 -1
- package/web/chunk-sk0hpa80.js +0 -1
- package/web/chunk-tj1fn8v2.js +0 -1
- package/web/chunk-tvcxrx6h.js +0 -1
- package/web/chunk-tzpnh70q.js +0 -1
- package/web/chunk-vb7g4xg6.js +0 -1
- package/web/chunk-wzfe6jtq.js +0 -1
- package/web/chunk-xh4xn1az.js +0 -1
- package/web/chunk-xk904wqv.js +0 -1
- package/web/chunk-xzwxcxb4.js +0 -1
- package/web/chunk-yekaz74b.js +0 -1
- package/web/chunk-ys2tns0p.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
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)=>`
|
|
1
|
+
import{G}from"./chunk-p1yc8hwn.js";import{t,a,M,x,O,yt,C,S,E,T,A,L,R,l,p,V,Vi,An,rt,U,ze,Le}from"./chunk-e763h2px.js";import{Q}from"./chunk-xjc5fmcr.js";import{ht,gr}from"./chunk-3b4wqmnh.js";import{Se,Te}from"./chunk-kahab58k.js";var ft=Te(function(it,st){(function(i,s){if(typeof it==="object"&&typeof st==="object")st.exports=s(gr());else if(typeof define==="function"&&define.amd)define(["cose-base"],s);else if(typeof it==="object")it.cytoscapeFcose=s(gr());else i.cytoscapeFcose=s(i.coseBase)})(it,function(e){return(()=>{var i={658:(N)=>{N.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:(N,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(k){_=!0,F=k}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,k=void 0,n=!1,P=1,X=[],D=[],j=function(){var I=d.collection();D.push(I);var H=u[0],J=d.collection();J.merge(H).merge(H.descendants().intersection(f)),F.push(H),J.forEach(function(re){r.push(re),_.add(re),I.merge(re)});var Z=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)Z();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],k=h.connectedEdges().length,F.forEach(function(re){if(re.connectedEdges().length<k)k=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 D},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,k=void 0;try{for(var n=f.nodeIndexes[Symbol.iterator](),P;!(o=(P=n.next()).done);o=!0){var X=P.value,D=b(X,2),j=D[0],Y=D[1],I=u.cy.getElementById(j);if(I){var H=I.boundingBox(),J=f.xCoords[Y]-H.w/2,Z=f.xCoords[Y]+H.w/2,se=f.yCoords[Y]-H.h/2,re=f.yCoords[Y]+H.h/2;if(J<g)g=J;if(Z>r)r=Z;if(se<_)_=se;if(re>F)F=re}}}catch(q){h=!0,k=q}finally{try{if(!o&&n.return)n.return()}finally{if(h)throw k}}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,k=void 0,n=void 0,P=void 0,X=d.descendants().not(":parent"),D=X.length;for(var j=0;j<D;j++){var Y=X[j];if(h=f[g.get(Y.id())]-Y.width()/2,k=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(_<k)_=k;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},N.exports=y},816:(N,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:k,eles:n}=o,P=n.nodes(),X=n.edges(),D=void 0,j=void 0,Y=void 0,I={};if(o.randomize)D=h.nodeIndexes,j=h.xCoords,Y=h.yCoords;var H=function(q){return typeof q==="function"},J=function(q,oe){if(H(q))return q(oe);else return q},Z=b.calcParentsWithoutChildren(k,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(Z).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[D.get(W.id())]-ve.w/2,Y[D.get(W.id())]-ve.h/2),new f(parseFloat(ve.w),parseFloat(ve.h))));else{var Me=b.calcBoundingBox(W,j,Y,D);if(W.intersection(Z).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=J(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=J(o.idealEdgeLength,W),ve.edgeElasticity=J(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};N.exports={coseLayout:_}},212:(N,B,v)=>{var b=function(){function o(h,k){for(var n=0;n<k.length;n++){var P=k[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,k,n){if(k)o(h.prototype,k);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 k=this,n=this.options,{cy:P,eles:X}=n,D=[],j=void 0,Y=void 0,I=[],H=void 0,J=[];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 Z=n.fixedNodeConstraint||n.alignmentConstraint||n.relativePlacementConstraint;if(Z)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(J.push({x:ue.x1+ue.w/2,y:ue.y1+ue.h/2}),n.randomize){var Ce=u(n);D.push(Ce)}if(n.quality=="default"||n.quality=="proof")I.push(r(n,D[0])),d.relocateComponent(J[0],I[0],n);else d.relocateComponent(J[0],D[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();J.push({x:z.x1+z.w/2,y:z.y1+z.h/2})}),n.randomize)H.forEach(function(K){n.eles=K,D.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();J.push({x:W.x1+W.w/2,y:W.y1+W.h/2}),H.push(de),D.push(De);for(var Ae=xe.length-1;Ae>=0;Ae--)H.splice(xe[Ae],1),D.splice(xe[Ae],1),J.splice(xe[Ae],1)}}H.forEach(function(K,z){n.eles=K,I.push(r(n,D[z])),d.relocateComponent(J[z],I[z],n)})}else H.forEach(function(K,z){d.relocateComponent(J[z],D[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=D[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:D[z].xCoords[me]-fe.boundingbox().w/2,y:D[z].yCoords[me]-fe.boundingbox().h/2,width:fe.boundingbox().w,height:fe.boundingbox().h});else{var he=d.calcBoundingBox(fe,D[z].xCoords,D[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,D[z].xCoords,D[z].yCoords,pe);Pe.push(We.topLeftX+We.width/2),Pe.push(We.topLeftY+We.height/2)}else Pe.push(D[z].xCoords[Be]),Pe.push(D[z].yCoords[Be]);if(Ee.isParent()){var Je=d.calcBoundingBox(Ee,D[z].xCoords,D[z].yCoords,pe);Ye.push(Je.topLeftX+Je.width/2),Ye.push(Je.topLeftY+Je.height/2)}else Ye.push(D[z].xCoords[et]),Ye.push(D[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")D.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(D.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(k,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}();N.exports=F},657:(N,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,k=new Map,n=[],P=[],X=[],D=[],j=[],Y=[],I=[],H=[],J=void 0,Z=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()*Z),ne=!1;for(var ae=0;ae<te;ae++)if(D[ae]==ee){ne=!0;break}if(!ne)D[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<Z;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<Z;Oe++)if(Y[Oe][te]<j[Oe])j[Oe]=Y[Oe][te];for(var tt=0;tt<Z;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(D[ne],ne,ee,!1)}else{te=Math.floor(Math.random()*Z),J=te;for(var ae=0;ae<Z;ae++)j[ae]=se;for(var we=0;we<de;we++)D[we]=te,te=oe(te,we,ee)}for(var ge=0;ge<Z;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[D[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<Z;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<Z;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<Z;Xe++)we[Xe]=ne[Xe];Ie=0,Fe=re;while(!0){Ie++;for(var He=0;He<Z;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<Z;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}),k.set(ye.id(),ee.nodes(":childless")[te].id())}),_.forEach(function(ye){var ee=void 0;if(ye.isParent())ee=h.get(k.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(k.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=k.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}}Z=h.size;var fe=void 0;if(Z>2){de=Z<u.sampleSize?Z:u.sampleSize;for(var he=0;he<Z;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),Z==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}};N.exports={spectralLayout:d}},579:(N,B,v)=>{var b=v(212),c=function(d){if(!d)return;d("layout","fcose",b)};if(typeof cytoscape<"u")c(cytoscape);N.exports=c},140:(N)=>{N.exports=e}},s={};function w(N){var B=s[N];if(B!==void 0)return B.exports;var v=s[N]={exports:{}};return i[N](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"),mt=t((e)=>e.data(),"edgeData"),Qe=t((e)=>e.data(),"nodeData"),Gt=M.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:N,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:N,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"),N=[];while(w.size>0){let B=w.values().next().value;N.push(m(B))}this.dataStructures={adjList:i,spatialMaps:N,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 Q("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-eh7wp62z.js";import{t,a,N,x,O,gt,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"),
|
|
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"),nt={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:Vi,blank:{body:Ze("")}}},Yt=t(async function(e,i,s,w){let m=s.getConfigField("padding"),N=s.getConfigField("iconSize"),B=N/2,v=N/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}=mt(c),{x:h,y:k}=c[0].sourceEndpoint(),{x:n,y:P}=c[0].midpoint(),{x:X,y:D}=c[0].targetEndpoint(),j=m+4;if(u)if(Re(d))h+=d==="L"?-j:j;else k+=d==="T"?-j:j+18;if(F)if(Re(r))X+=r==="L"?-j:j;else D+=r==="T"?-j:j+18;if(!u&&s.getNode(y)?.type==="junction")if(Re(d))h+=d==="L"?B:-B;else k+=d==="T"?B:-B;if(!F&&s.getNode(g)?.type==="junction")if(Re(r))X+=r==="L"?B:-B;else D+=r==="T"?B:-B;if(c[0]._private.rscratch){let Y=e.insert("g");if(Y.insert("path").attr("d",`M ${h},${k} L ${n},${P} L${X},${D} `).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](k,v):k-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](D,v):D-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(k-D)/1.5;else H=Math.abs(h-X)/2;let J=Y.append("g");if(await Le(J,o,{useHtmlLabels:!1,width:H,classes:"architecture-service-label"},l()),J.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),I==="X")J.attr("transform","translate("+n+", "+P+")");else if(I==="Y")J.attr("transform","translate("+n+", "+P+") rotate(-90)");else if(I==="XY"){let Z=lt(d,r);if(Z&&Dt(Z)){let se=J.node().getBoundingClientRect(),[re,ue]=Ft(Z);J.attr("dominant-baseline","auto").attr("transform",`rotate(${-1*re*ue*45})`);let Ce=J.node().getBoundingClientRect();J.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}]);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};
|
|
36
|
+
`)}}}}}))},"drawEdges"),Ut=t(async function(e,i,s,w){let N=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 rt(y.icon,{height:N,width:N,fallbackPrefix:nt.prefix})}</g>`),h.attr("transform","translate("+(F+b+1)+", "+(o+b+1)+")"),F+=N,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 N of s){let B=i.append("g"),v=e.getConfigField("iconSize");if(N.title){let d=B.append("g");await Le(d,N.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(N.icon)b.html(`<g>${await rt(N.icon,{height:v,width:v,fallbackPrefix:nt.prefix})}</g>`);else if(N.iconText){b.html(`<g>${await rt("blank",{height:v,width:v,fallbackPrefix:nt.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(N.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-${N.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-${N.id}`).attr("class","architecture-service");let{width:c,height:y}=B.node().getBBox();N.width=c,N.height=y,e.setElementForId(N.id,B)}return 0},"drawServices"),Vt=t(function(e,i,s,w){s.forEach((m)=>{let N=i.append("g"),B=e.getConfigField("iconSize");N.append("g").append("rect").attr("id",`${w}-node-${m.id}`).attr("fill-opacity","0").attr("width",B).attr("height",B),N.attr("class","architecture-junction");let{width:b,height:c}=N._groups[0][0].getBBox();N.width=b,N.height=c,e.setElementForId(m.id,N)})},"drawJunctions");An([{name:nt.prefix,icons:nt}]);ht.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:N,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:N,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 k=0;k<h.length-1;k++)for(let n=k+1;n<h.length;n++){let[P,X]=h[k],[D,j]=h[n];if(s.get(pt(P,D))===u)g.set(F,[...g.get(F)??[],...X,...j]);else if(P==="default"||D==="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"),N=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 k=g.get(r)??new Map;if(!g.has(r))g.set(r,k);for(let n of[h,k]){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]=N.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"),N=i.getConfigField("idealEdgeLengthMultiplier"),B=N*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 k=b([F[0]+h[0],F[1]+h[1]]),n=d.get(k);if(n&&!u[k]){if(f.push(k),v.has(`${_}|${n}`))return;w.push({[ut[o]]:n,[ut[kt(o)]]:_,gap:N*m})}})}}}}),w}t(Nt,"getRelativeConstraints");function St(e,i,s,w,m,{spatialMaps:N,groupAlignments:B}){return new Promise((v)=>{let b=p("body").append("div").attr("id","cy").attr("style","display:none"),c=ht({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,N,B,y),f=Nt(N,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[k,n]=h.connectedNodes(),{parent:P}=Qe(k),{parent:X}=Qe(n);return P===X?g:r},edgeElasticity(h){let[k,n]=h.connectedNodes(),{parent:P}=Qe(k),{parent:X}=Qe(n);return P===X?_:0.001},alignmentConstraint:d,relativePlacementConstraint:f});o.one("layoutstop",()=>{function h(k,n,P,X){let D,j,{x:Y,y:I}=k,{x:H,y:J}=n;j=(X-I+(Y-P)*(I-J)/(Y-H))/Math.sqrt(1+Math.pow((I-J)/(Y-H),2)),D=Math.sqrt(Math.pow(X-I,2)+Math.pow(P-Y,2)-Math.pow(j,2));let Z=Math.sqrt(Math.pow(H-Y,2)+Math.pow(J-I,2));D=D/Z;let se=(H-Y)*(X-I)-(J-I)*(P-Y);switch(!0){case se>=0:se=1;break;case se<0:se=-1;break}let re=(H-Y)*(P-Y)+(J-I)*(X-I);switch(!0){case re>=0:re=1;break;case re<0:re=-1;break}return j=Math.abs(j)*se,D=D*re,{distances:j,weights:D}}t(h,"getSegmentWeights"),c.startBatch();for(let k of Object.values(c.edges()))if(k.data?.()){let{x:n,y:P}=k.source().position(),{x:X,y:D}=k.target().position();if(n!==X&&P!==D){let j=k.sourceEndpoint(),Y=k.targetEndpoint(),{sourceDir:I}=mt(k),[H,J]=Ve(I)?[j.x,Y.y]:[Y.x,j.y],{weights:Z,distances:se}=h(j,Y,H,J);k.style("segment-distances",se),k.style("segment-weights",Z)}}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 N=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,N,i),Vt(m,f,B,i);let g=await St(N,B,v,b,m,c);await Yt(d,g,m,i),await Ut(u,g,m,i),Lt(m,g),yt(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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{g,o,Y,i,r,e,n,y,ne}from"./chunk-kahab58k.js";import{In}from"./chunk-0y971zgq.js";import"./chunk-d3f763n7.js";var G={config:"自定义路径",env:"环境变量",system:"系统预装"};function L({connection:b}){let{Button:h,Input:P,Switch:v,SettingGroup:C,SettingRow:f,cn:x}=y(),B=Y(),[m,N]=r({}),[a,d]=r({}),[l,w]=r(null),[u,A]=r(!0),[k,R]=r(!1),[p,E]=r(!1),[I,c]=r(null),q=i(null),z=(a.executable??"")!==(m.executable??"")||Boolean(a.noSandbox)!==Boolean(m.noSandbox)||Boolean(a.ignoreCertErrors)!==Boolean(m.ignoreCertErrors),O=g(async(t)=>{R(!0);try{let s=await b.request("/api/plugins/browser/status",{signal:t});w(s)}catch(s){if(!t?.aborted)w({available:!1,error:s instanceof Error?s.message:"无法获取浏览器状态"})}finally{if(!t?.aborted)R(!1)}},[b]);o(()=>{let t=new AbortController;return q.current=t,Promise.all([b.request("/api/plugins/browser/settings",{signal:t.signal}),b.request("/api/plugins/browser/status",{signal:t.signal})]).then(([s,S])=>{if(!t.signal.aborted)N(s),d(s),w(S)}).catch((s)=>{if(!t.signal.aborted)c({type:"error",text:s instanceof Error?s.message:"读取浏览器设置失败"})}).finally(()=>{if(!t.signal.aborted)A(!1)}),()=>t.abort()},[b]);let D=async(t)=>{if(t?.preventDefault(),p||u)return;let s=new AbortController;E(!0),c(null);try{if(await b.request("/api/plugins/browser/settings",{method:"PATCH",signal:s.signal,headers:{"Content-Type":"application/json"},body:JSON.stringify(a)}),!s.signal.aborted)N(a),c({type:"success",text:"设置已保存,将在浏览器进程下次启动时生效。"}),await O(s.signal)}catch(S){if(!s.signal.aborted)c({type:"error",text:S instanceof Error?S.message:"保存设置失败"})}finally{if(!s.signal.aborted)E(!1)}},T=()=>{d(m),c(null)};return n("form",{id:B,onSubmit:D,className:"min-w-0 space-y-5",children:[e(C,{title:"运行环境",children:e(f,{title:n("span",{className:"flex items-center gap-2",children:[e("span",{className:x("size-2 shrink-0 rounded-full",l?.available?"bg-success":"bg-danger")}),l?l.available?"浏览器可用":"未检测到可用浏览器":"正在检测…"]}),description:l&&!l.available&&l.error?e("span",{className:"text-danger",children:l.error}):l?.available&&l.source?`来源:${G[l.source]??l.source}`:void 0,children:n(h,{type:"button",size:"sm",variant:"ghost",disabled:u||k,onClick:()=>void O(),className:"text-dim",children:[e(ne,{className:x("size-3.5",k&&"animate-spin")}),"重新检测"]})})}),n(C,{title:"启动参数",children:[e(f,{vertical:!0,title:"可执行文件路径",description:"留空时自动探测系统浏览器",children:n("div",{className:"flex gap-2",children:[e(P,{id:"browser-executable",disabled:u||p,value:a.executable??"",placeholder:"自动探测",onChange:(t)=>{d({...a,executable:t.target.value}),c(null)}}),a.executable&&e(h,{type:"button",variant:"ghost",size:"sm",disabled:u||p,onClick:()=>{d({...a,executable:""}),c(null)},className:"shrink-0",children:"清空"})]})}),e(f,{title:"禁用沙箱 (--no-sandbox)",description:"容器或 root 环境使用",children:e(v,{label:"禁用沙箱",disabled:u||p,checked:a.noSandbox??!1,onCheckedChange:(t)=>{d({...a,noSandbox:t}),c(null)}})}),e(f,{title:"忽略证书错误 (--ignore-certificate-errors)",description:"跳过自签名与证书有效性检查",children:e(v,{label:"忽略证书错误",disabled:u||p,checked:a.ignoreCertErrors??!1,onCheckedChange:(t)=>{d({...a,ignoreCertErrors:t}),c(null)}})})]}),e(In,{formID:B,notice:I,dirty:z,busy:u||p,saving:p,onReset:T})]})}export{L as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{t,p}from"./chunk-
|
|
1
|
+
import{t,p}from"./chunk-e763h2px.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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk-e763h2px.js";import"./chunk-8csw0mvf.js";import{Mo}from"./chunk-2f2agfpj.js";import"./chunk-m24yb8md.js";import"./chunk-3d3wnh8a.js";import"./chunk-tpdcrrf1.js";import"./chunk-n33753da.js";export{Mo as diagram};
|