import { __commonJSMin } from "../../_virtual/rolldown_runtime.js";
import { require_layout_base } from "../layout-base/layout-base.js";
var require_cose_base = /* @__PURE__ */ __commonJSMin(((e, n) => {
	(function(r, i) {
		typeof e == "object" && typeof n == "object" ? n.exports = i(require_layout_base()) : typeof define == "function" && define.amd ? define(["layout-base"], i) : typeof e == "object" ? e.coseBase = i(require_layout_base()) : r.coseBase = i(r.layoutBase);
	})(e, function(e) {
		return (function(e) {
			var t = {};
			function n(r) {
				if (t[r]) return t[r].exports;
				var i = t[r] = {
					i: r,
					l: !1,
					exports: {}
				};
				return e[r].call(i.exports, i, i.exports, n), i.l = !0, i.exports;
			}
			return n.m = e, n.c = t, n.i = function(e) {
				return e;
			}, n.d = function(e, t, r) {
				n.o(e, t) || Object.defineProperty(e, t, {
					configurable: !1,
					enumerable: !0,
					get: r
				});
			}, n.n = function(e) {
				var t = e && e.__esModule ? function() {
					return e.default;
				} : function() {
					return e;
				};
				return n.d(t, "a", t), t;
			}, n.o = function(e, t) {
				return Object.prototype.hasOwnProperty.call(e, t);
			}, n.p = "", n(n.s = 7);
		})([
			(function(t, n) {
				t.exports = e;
			}),
			(function(e, t, n) {
				var r = n(0).FDLayoutConstants;
				function i() {}
				for (var a in r) i[a] = r[a];
				i.DEFAULT_USE_MULTI_LEVEL_SCALING = !1, i.DEFAULT_RADIAL_SEPARATION = r.DEFAULT_EDGE_LENGTH, i.DEFAULT_COMPONENT_SEPERATION = 60, i.TILE = !0, i.TILING_PADDING_VERTICAL = 10, i.TILING_PADDING_HORIZONTAL = 10, i.TREE_REDUCTION_ON_INCREMENTAL = !1, e.exports = i;
			}),
			(function(e, t, n) {
				var r = n(0).FDLayoutEdge;
				function i(e, t, n) {
					r.call(this, e, t, n);
				}
				for (var a in i.prototype = Object.create(r.prototype), r) i[a] = r[a];
				e.exports = i;
			}),
			(function(e, t, n) {
				var r = n(0).LGraph;
				function i(e, t, n) {
					r.call(this, e, t, n);
				}
				for (var a in i.prototype = Object.create(r.prototype), r) i[a] = r[a];
				e.exports = i;
			}),
			(function(e, t, n) {
				var r = n(0).LGraphManager;
				function i(e) {
					r.call(this, e);
				}
				for (var a in i.prototype = Object.create(r.prototype), r) i[a] = r[a];
				e.exports = i;
			}),
			(function(e, t, n) {
				var r = n(0).FDLayoutNode, i = n(0).IMath;
				function a(e, t, n, i) {
					r.call(this, e, t, n, i);
				}
				for (var o in a.prototype = Object.create(r.prototype), r) a[o] = r[o];
				a.prototype.move = function() {
					var e = this.graphManager.getLayout();
					this.displacementX = e.coolingFactor * (this.springForceX + this.repulsionForceX + this.gravitationForceX) / this.noOfChildren, this.displacementY = e.coolingFactor * (this.springForceY + this.repulsionForceY + this.gravitationForceY) / this.noOfChildren, Math.abs(this.displacementX) > e.coolingFactor * e.maxNodeDisplacement && (this.displacementX = e.coolingFactor * e.maxNodeDisplacement * i.sign(this.displacementX)), Math.abs(this.displacementY) > e.coolingFactor * e.maxNodeDisplacement && (this.displacementY = e.coolingFactor * e.maxNodeDisplacement * i.sign(this.displacementY)), this.child == null || this.child.getNodes().length == 0 ? this.moveBy(this.displacementX, this.displacementY) : this.propogateDisplacementToChildren(this.displacementX, this.displacementY), e.totalDisplacement += Math.abs(this.displacementX) + Math.abs(this.displacementY), this.springForceX = 0, this.springForceY = 0, this.repulsionForceX = 0, this.repulsionForceY = 0, this.gravitationForceX = 0, this.gravitationForceY = 0, this.displacementX = 0, this.displacementY = 0;
				}, a.prototype.propogateDisplacementToChildren = function(e, t) {
					for (var n = this.getChild().getNodes(), r, i = 0; i < n.length; i++) r = n[i], r.getChild() == null ? (r.moveBy(e, t), r.displacementX += e, r.displacementY += t) : r.propogateDisplacementToChildren(e, t);
				}, a.prototype.setPred1 = function(e) {
					this.pred1 = e;
				}, a.prototype.getPred1 = function() {
					return pred1;
				}, a.prototype.getPred2 = function() {
					return pred2;
				}, a.prototype.setNext = function(e) {
					this.next = e;
				}, a.prototype.getNext = function() {
					return next;
				}, a.prototype.setProcessed = function(e) {
					this.processed = e;
				}, a.prototype.isProcessed = function() {
					return processed;
				}, e.exports = a;
			}),
			(function(e, t, n) {
				var r = n(0).FDLayout, i = n(4), a = n(3), o = n(5), s = n(2), c = n(1), l = n(0).FDLayoutConstants, u = n(0).LayoutConstants, d = n(0).Point, f = n(0).PointD, p = n(0).Layout, m = n(0).Integer, h = n(0).IGeometry, g = n(0).LGraph, _ = n(0).Transform;
				function v() {
					r.call(this), this.toBeTiled = {};
				}
				for (var y in v.prototype = Object.create(r.prototype), r) v[y] = r[y];
				v.prototype.newGraphManager = function() {
					var e = new i(this);
					return this.graphManager = e, e;
				}, v.prototype.newGraph = function(e) {
					return new a(null, this.graphManager, e);
				}, v.prototype.newNode = function(e) {
					return new o(this.graphManager, e);
				}, v.prototype.newEdge = function(e) {
					return new s(null, null, e);
				}, v.prototype.initParameters = function() {
					r.prototype.initParameters.call(this, arguments), this.isSubLayout || (c.DEFAULT_EDGE_LENGTH < 10 ? this.idealEdgeLength = 10 : this.idealEdgeLength = c.DEFAULT_EDGE_LENGTH, this.useSmartIdealEdgeLengthCalculation = c.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION, this.springConstant = l.DEFAULT_SPRING_STRENGTH, this.repulsionConstant = l.DEFAULT_REPULSION_STRENGTH, this.gravityConstant = l.DEFAULT_GRAVITY_STRENGTH, this.compoundGravityConstant = l.DEFAULT_COMPOUND_GRAVITY_STRENGTH, this.gravityRangeFactor = l.DEFAULT_GRAVITY_RANGE_FACTOR, this.compoundGravityRangeFactor = l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR, this.prunedNodesAll = [], this.growTreeIterations = 0, this.afterGrowthIterations = 0, this.isTreeGrowing = !1, this.isGrowthFinished = !1, this.coolingCycle = 0, this.maxCoolingCycle = this.maxIterations / l.CONVERGENCE_CHECK_PERIOD, this.finalTemperature = l.CONVERGENCE_CHECK_PERIOD / this.maxIterations, this.coolingAdjuster = 1);
				}, v.prototype.layout = function() {
					return u.DEFAULT_CREATE_BENDS_AS_NEEDED && (this.createBendpoints(), this.graphManager.resetAllEdges()), this.level = 0, this.classicLayout();
				}, v.prototype.classicLayout = function() {
					if (this.nodesWithGravity = this.calculateNodesToApplyGravitationTo(), this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity), this.calcNoOfChildrenForAllNodes(), this.graphManager.calcLowestCommonAncestors(), this.graphManager.calcInclusionTreeDepths(), this.graphManager.getRoot().calcEstimatedSize(), this.calcIdealEdgeLengths(), this.incremental) {
						if (c.TREE_REDUCTION_ON_INCREMENTAL) {
							this.reduceTrees(), this.graphManager.resetAllNodesToApplyGravitation();
							var e = new Set(this.getAllNodes()), t = this.nodesWithGravity.filter(function(t) {
								return e.has(t);
							});
							this.graphManager.setAllNodesToApplyGravitation(t);
						}
					} else {
						var n = this.getFlatForest();
						if (n.length > 0) this.positionNodesRadially(n);
						else {
							this.reduceTrees(), this.graphManager.resetAllNodesToApplyGravitation();
							var e = new Set(this.getAllNodes()), t = this.nodesWithGravity.filter(function(t) {
								return e.has(t);
							});
							this.graphManager.setAllNodesToApplyGravitation(t), this.positionNodesRandomly();
						}
					}
					return this.initSpringEmbedder(), this.runSpringEmbedder(), !0;
				}, v.prototype.tick = function() {
					if (this.totalIterations++, this.totalIterations === this.maxIterations && !this.isTreeGrowing && !this.isGrowthFinished) if (this.prunedNodesAll.length > 0) this.isTreeGrowing = !0;
					else return !0;
					if (this.totalIterations % l.CONVERGENCE_CHECK_PERIOD == 0 && !this.isTreeGrowing && !this.isGrowthFinished) {
						if (this.isConverged()) if (this.prunedNodesAll.length > 0) this.isTreeGrowing = !0;
						else return !0;
						this.coolingCycle++, this.layoutQuality == 0 ? this.coolingAdjuster = this.coolingCycle : this.layoutQuality == 1 && (this.coolingAdjuster = this.coolingCycle / 3), this.coolingFactor = Math.max(this.initialCoolingFactor - this.coolingCycle ** +(Math.log(100 * (this.initialCoolingFactor - this.finalTemperature)) / Math.log(this.maxCoolingCycle)) / 100 * this.coolingAdjuster, this.finalTemperature), this.animationPeriod = Math.ceil(this.initialAnimationPeriod * Math.sqrt(this.coolingFactor));
					}
					if (this.isTreeGrowing) {
						if (this.growTreeIterations % 10 == 0) if (this.prunedNodesAll.length > 0) {
							this.graphManager.updateBounds(), this.updateGrid(), this.growTree(this.prunedNodesAll), this.graphManager.resetAllNodesToApplyGravitation();
							var e = new Set(this.getAllNodes()), t = this.nodesWithGravity.filter(function(t) {
								return e.has(t);
							});
							this.graphManager.setAllNodesToApplyGravitation(t), this.graphManager.updateBounds(), this.updateGrid(), this.coolingFactor = l.DEFAULT_COOLING_FACTOR_INCREMENTAL;
						} else this.isTreeGrowing = !1, this.isGrowthFinished = !0;
						this.growTreeIterations++;
					}
					if (this.isGrowthFinished) {
						if (this.isConverged()) return !0;
						this.afterGrowthIterations % 10 == 0 && (this.graphManager.updateBounds(), this.updateGrid()), this.coolingFactor = l.DEFAULT_COOLING_FACTOR_INCREMENTAL * ((100 - this.afterGrowthIterations) / 100), this.afterGrowthIterations++;
					}
					var n = !this.isTreeGrowing && !this.isGrowthFinished, r = this.growTreeIterations % 10 == 1 && this.isTreeGrowing || this.afterGrowthIterations % 10 == 1 && this.isGrowthFinished;
					return this.totalDisplacement = 0, this.graphManager.updateBounds(), this.calcSpringForces(), this.calcRepulsionForces(n, r), this.calcGravitationalForces(), this.moveNodes(), this.animate(), !1;
				}, v.prototype.getPositionsData = function() {
					for (var e = this.graphManager.getAllNodes(), t = {}, n = 0; n < e.length; n++) {
						var r = e[n].rect, i = e[n].id;
						t[i] = {
							id: i,
							x: r.getCenterX(),
							y: r.getCenterY(),
							w: r.width,
							h: r.height
						};
					}
					return t;
				}, v.prototype.runSpringEmbedder = function() {
					this.initialAnimationPeriod = 25, this.animationPeriod = this.initialAnimationPeriod;
					var e = !1;
					if (l.ANIMATE === "during") this.emit("layoutstarted");
					else {
						for (; !e;) e = this.tick();
						this.graphManager.updateBounds();
					}
				}, v.prototype.calculateNodesToApplyGravitationTo = function() {
					var e = [], t, n = this.graphManager.getGraphs(), r = n.length, i;
					for (i = 0; i < r; i++) t = n[i], t.updateConnected(), t.isConnected || (e = e.concat(t.getNodes()));
					return e;
				}, v.prototype.createBendpoints = function() {
					var e = [];
					e = e.concat(this.graphManager.getAllEdges());
					var t = /* @__PURE__ */ new Set(), n;
					for (n = 0; n < e.length; n++) {
						var r = e[n];
						if (!t.has(r)) {
							var i = r.getSource(), a = r.getTarget();
							if (i == a) r.getBendpoints().push(new f()), r.getBendpoints().push(new f()), this.createDummyNodesForBendpoints(r), t.add(r);
							else {
								var o = [];
								if (o = o.concat(i.getEdgeListToNode(a)), o = o.concat(a.getEdgeListToNode(i)), !t.has(o[0])) {
									if (o.length > 1) {
										var s;
										for (s = 0; s < o.length; s++) {
											var c = o[s];
											c.getBendpoints().push(new f()), this.createDummyNodesForBendpoints(c);
										}
									}
									o.forEach(function(e) {
										t.add(e);
									});
								}
							}
						}
						if (t.size == e.length) break;
					}
				}, v.prototype.positionNodesRadially = function(e) {
					for (var t = new d(0, 0), n = Math.ceil(Math.sqrt(e.length)), r = 0, i = 0, a = 0, o = new f(0, 0), s = 0; s < e.length; s++) {
						s % n == 0 && (a = 0, i = r, s != 0 && (i += c.DEFAULT_COMPONENT_SEPERATION), r = 0);
						var l = e[s], m = p.findCenterOfTree(l);
						t.x = a, t.y = i, o = v.radialLayout(l, m, t), o.y > r && (r = Math.floor(o.y)), a = Math.floor(o.x + c.DEFAULT_COMPONENT_SEPERATION);
					}
					this.transform(new f(u.WORLD_CENTER_X - o.x / 2, u.WORLD_CENTER_Y - o.y / 2));
				}, v.radialLayout = function(e, t, n) {
					var r = Math.max(this.maxDiagonalInTree(e), c.DEFAULT_RADIAL_SEPARATION);
					v.branchRadialLayout(t, null, 0, 359, 0, r);
					var i = g.calculateBounds(e), a = new _();
					a.setDeviceOrgX(i.getMinX()), a.setDeviceOrgY(i.getMinY()), a.setWorldOrgX(n.x), a.setWorldOrgY(n.y);
					for (var o = 0; o < e.length; o++) e[o].transform(a);
					var s = new f(i.getMaxX(), i.getMaxY());
					return a.inverseTransformPoint(s);
				}, v.branchRadialLayout = function(e, t, n, r, i, a) {
					var o = (r - n + 1) / 2;
					o < 0 && (o += 180);
					var s = (o + n) % 360 * h.TWO_PI / 360, c = i * Math.cos(s), l = i * Math.sin(s);
					e.setCenter(c, l);
					var u = [];
					u = u.concat(e.getEdges());
					var d = u.length;
					t != null && d--;
					for (var f = 0, p = u.length, m, g = e.getEdgesBetween(t); g.length > 1;) {
						var _ = g[0];
						g.splice(0, 1);
						var y = u.indexOf(_);
						y >= 0 && u.splice(y, 1), p--, d--;
					}
					m = t == null ? 0 : (u.indexOf(g[0]) + 1) % p;
					for (var b = Math.abs(r - n) / d, x = m; f != d; x = ++x % p) {
						var S = u[x].getOtherEnd(e);
						if (S != t) {
							var C = (n + f * b) % 360, w = (C + b) % 360;
							v.branchRadialLayout(S, e, C, w, i + a, a), f++;
						}
					}
				}, v.maxDiagonalInTree = function(e) {
					for (var t = m.MIN_VALUE, n = 0; n < e.length; n++) {
						var r = e[n].getDiagonal();
						r > t && (t = r);
					}
					return t;
				}, v.prototype.calcRepulsionRange = function() {
					return 2 * (this.level + 1) * this.idealEdgeLength;
				}, v.prototype.groupZeroDegreeMembers = function() {
					var e = this, t = {};
					this.memberGroups = {}, this.idToDummyNode = {};
					for (var n = [], r = this.graphManager.getAllNodes(), i = 0; i < r.length; i++) {
						var a = r[i], s = a.getParent();
						this.getNodeDegreeWithChildren(a) === 0 && (s.id == null || !this.getToBeTiled(s)) && n.push(a);
					}
					for (var i = 0; i < n.length; i++) {
						var a = n[i], c = a.getParent().id;
						t[c] === void 0 && (t[c] = []), t[c] = t[c].concat(a);
					}
					Object.keys(t).forEach(function(n) {
						if (t[n].length > 1) {
							var r = "DummyCompound_" + n;
							e.memberGroups[r] = t[n];
							var i = t[n][0].getParent(), a = new o(e.graphManager);
							a.id = r, a.paddingLeft = i.paddingLeft || 0, a.paddingRight = i.paddingRight || 0, a.paddingBottom = i.paddingBottom || 0, a.paddingTop = i.paddingTop || 0, e.idToDummyNode[r] = a;
							var s = e.getGraphManager().add(e.newGraph(), a), c = i.getChild();
							c.add(a);
							for (var l = 0; l < t[n].length; l++) {
								var u = t[n][l];
								c.remove(u), s.add(u);
							}
						}
					});
				}, v.prototype.clearCompounds = function() {
					var e = {}, t = {};
					this.performDFSOnCompounds();
					for (var n = 0; n < this.compoundOrder.length; n++) t[this.compoundOrder[n].id] = this.compoundOrder[n], e[this.compoundOrder[n].id] = [].concat(this.compoundOrder[n].getChild().getNodes()), this.graphManager.remove(this.compoundOrder[n].getChild()), this.compoundOrder[n].child = null;
					this.graphManager.resetAllNodes(), this.tileCompoundMembers(e, t);
				}, v.prototype.clearZeroDegreeMembers = function() {
					var e = this, t = this.tiledZeroDegreePack = [];
					Object.keys(this.memberGroups).forEach(function(n) {
						var r = e.idToDummyNode[n];
						t[n] = e.tileNodes(e.memberGroups[n], r.paddingLeft + r.paddingRight), r.rect.width = t[n].width, r.rect.height = t[n].height;
					});
				}, v.prototype.repopulateCompounds = function() {
					for (var e = this.compoundOrder.length - 1; e >= 0; e--) {
						var t = this.compoundOrder[e], n = t.id, r = t.paddingLeft, i = t.paddingTop;
						this.adjustLocations(this.tiledMemberPack[n], t.rect.x, t.rect.y, r, i);
					}
				}, v.prototype.repopulateZeroDegreeMembers = function() {
					var e = this, t = this.tiledZeroDegreePack;
					Object.keys(t).forEach(function(n) {
						var r = e.idToDummyNode[n], i = r.paddingLeft, a = r.paddingTop;
						e.adjustLocations(t[n], r.rect.x, r.rect.y, i, a);
					});
				}, v.prototype.getToBeTiled = function(e) {
					var t = e.id;
					if (this.toBeTiled[t] != null) return this.toBeTiled[t];
					var n = e.getChild();
					if (n == null) return this.toBeTiled[t] = !1, !1;
					for (var r = n.getNodes(), i = 0; i < r.length; i++) {
						var a = r[i];
						if (this.getNodeDegree(a) > 0) return this.toBeTiled[t] = !1, !1;
						if (a.getChild() == null) {
							this.toBeTiled[a.id] = !1;
							continue;
						}
						if (!this.getToBeTiled(a)) return this.toBeTiled[t] = !1, !1;
					}
					return this.toBeTiled[t] = !0, !0;
				}, v.prototype.getNodeDegree = function(e) {
					e.id;
					for (var t = e.getEdges(), n = 0, r = 0; r < t.length; r++) {
						var i = t[r];
						i.getSource().id !== i.getTarget().id && (n += 1);
					}
					return n;
				}, v.prototype.getNodeDegreeWithChildren = function(e) {
					var t = this.getNodeDegree(e);
					if (e.getChild() == null) return t;
					for (var n = e.getChild().getNodes(), r = 0; r < n.length; r++) {
						var i = n[r];
						t += this.getNodeDegreeWithChildren(i);
					}
					return t;
				}, v.prototype.performDFSOnCompounds = function() {
					this.compoundOrder = [], this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes());
				}, v.prototype.fillCompexOrderByDFS = function(e) {
					for (var t = 0; t < e.length; t++) {
						var n = e[t];
						n.getChild() != null && this.fillCompexOrderByDFS(n.getChild().getNodes()), this.getToBeTiled(n) && this.compoundOrder.push(n);
					}
				}, v.prototype.adjustLocations = function(e, t, n, r, i) {
					t += r, n += i;
					for (var a = t, o = 0; o < e.rows.length; o++) {
						var s = e.rows[o];
						t = a;
						for (var c = 0, l = 0; l < s.length; l++) {
							var u = s[l];
							u.rect.x = t, u.rect.y = n, t += u.rect.width + e.horizontalPadding, u.rect.height > c && (c = u.rect.height);
						}
						n += c + e.verticalPadding;
					}
				}, v.prototype.tileCompoundMembers = function(e, t) {
					var n = this;
					this.tiledMemberPack = [], Object.keys(e).forEach(function(r) {
						var i = t[r];
						n.tiledMemberPack[r] = n.tileNodes(e[r], i.paddingLeft + i.paddingRight), i.rect.width = n.tiledMemberPack[r].width, i.rect.height = n.tiledMemberPack[r].height;
					});
				}, v.prototype.tileNodes = function(e, t) {
					var n = {
						rows: [],
						rowWidth: [],
						rowHeight: [],
						width: 0,
						height: t,
						verticalPadding: c.TILING_PADDING_VERTICAL,
						horizontalPadding: c.TILING_PADDING_HORIZONTAL
					};
					e.sort(function(e, t) {
						return e.rect.width * e.rect.height > t.rect.width * t.rect.height ? -1 : e.rect.width * e.rect.height < t.rect.width * t.rect.height ? 1 : 0;
					});
					for (var r = 0; r < e.length; r++) {
						var i = e[r];
						n.rows.length == 0 ? this.insertNodeToRow(n, i, 0, t) : this.canAddHorizontal(n, i.rect.width, i.rect.height) ? this.insertNodeToRow(n, i, this.getShortestRowIndex(n), t) : this.insertNodeToRow(n, i, n.rows.length, t), this.shiftToLastRow(n);
					}
					return n;
				}, v.prototype.insertNodeToRow = function(e, t, n, r) {
					var i = r;
					n == e.rows.length && (e.rows.push([]), e.rowWidth.push(i), e.rowHeight.push(0));
					var a = e.rowWidth[n] + t.rect.width;
					e.rows[n].length > 0 && (a += e.horizontalPadding), e.rowWidth[n] = a, e.width < a && (e.width = a);
					var o = t.rect.height;
					n > 0 && (o += e.verticalPadding);
					var s = 0;
					o > e.rowHeight[n] && (s = e.rowHeight[n], e.rowHeight[n] = o, s = e.rowHeight[n] - s), e.height += s, e.rows[n].push(t);
				}, v.prototype.getShortestRowIndex = function(e) {
					for (var t = -1, n = Number.MAX_VALUE, r = 0; r < e.rows.length; r++) e.rowWidth[r] < n && (t = r, n = e.rowWidth[r]);
					return t;
				}, v.prototype.getLongestRowIndex = function(e) {
					for (var t = -1, n = Number.MIN_VALUE, r = 0; r < e.rows.length; r++) e.rowWidth[r] > n && (t = r, n = e.rowWidth[r]);
					return t;
				}, v.prototype.canAddHorizontal = function(e, t, n) {
					var r = this.getShortestRowIndex(e);
					if (r < 0) return !0;
					var i = e.rowWidth[r];
					if (i + e.horizontalPadding + t <= e.width) return !0;
					var a = 0;
					e.rowHeight[r] < n && r > 0 && (a = n + e.verticalPadding - e.rowHeight[r]);
					var o = e.width - i >= t + e.horizontalPadding ? (e.height + a) / (i + t + e.horizontalPadding) : (e.height + a) / e.width;
					a = n + e.verticalPadding;
					var s = e.width < t ? (e.height + a) / t : (e.height + a) / e.width;
					return s < 1 && (s = 1 / s), o < 1 && (o = 1 / o), o < s;
				}, v.prototype.shiftToLastRow = function(e) {
					var t = this.getLongestRowIndex(e), n = e.rowWidth.length - 1, r = e.rows[t], i = r[r.length - 1], a = i.width + e.horizontalPadding;
					if (e.width - e.rowWidth[n] > a && t != n) {
						r.splice(-1, 1), e.rows[n].push(i), e.rowWidth[t] = e.rowWidth[t] - a, e.rowWidth[n] = e.rowWidth[n] + a, e.width = e.rowWidth[instance.getLongestRowIndex(e)];
						for (var o = Number.MIN_VALUE, s = 0; s < r.length; s++) r[s].height > o && (o = r[s].height);
						t > 0 && (o += e.verticalPadding);
						var c = e.rowHeight[t] + e.rowHeight[n];
						e.rowHeight[t] = o, e.rowHeight[n] < i.height + e.verticalPadding && (e.rowHeight[n] = i.height + e.verticalPadding);
						var l = e.rowHeight[t] + e.rowHeight[n];
						e.height += l - c, this.shiftToLastRow(e);
					}
				}, v.prototype.tilingPreLayout = function() {
					c.TILE && (this.groupZeroDegreeMembers(), this.clearCompounds(), this.clearZeroDegreeMembers());
				}, v.prototype.tilingPostLayout = function() {
					c.TILE && (this.repopulateZeroDegreeMembers(), this.repopulateCompounds());
				}, v.prototype.reduceTrees = function() {
					for (var e = [], t = !0, n; t;) {
						var r = this.graphManager.getAllNodes(), i = [];
						t = !1;
						for (var a = 0; a < r.length; a++) n = r[a], n.getEdges().length == 1 && !n.getEdges()[0].isInterGraph && n.getChild() == null && (i.push([
							n,
							n.getEdges()[0],
							n.getOwner()
						]), t = !0);
						if (t == 1) {
							for (var o = [], s = 0; s < i.length; s++) i[s][0].getEdges().length == 1 && (o.push(i[s]), i[s][0].getOwner().remove(i[s][0]));
							e.push(o), this.graphManager.resetAllNodes(), this.graphManager.resetAllEdges();
						}
					}
					this.prunedNodesAll = e;
				}, v.prototype.growTree = function(e) {
					for (var t = e[e.length - 1], n, r = 0; r < t.length; r++) n = t[r], this.findPlaceforPrunedNode(n), n[2].add(n[0]), n[2].add(n[1], n[1].source, n[1].target);
					e.splice(e.length - 1, 1), this.graphManager.resetAllNodes(), this.graphManager.resetAllEdges();
				}, v.prototype.findPlaceforPrunedNode = function(e) {
					var t, n, r = e[0];
					n = r == e[1].source ? e[1].target : e[1].source;
					var i = n.startX, a = n.finishX, o = n.startY, s = n.finishY, c = [
						0,
						0,
						0,
						0
					];
					if (o > 0) for (var u = i; u <= a; u++) c[0] += this.grid[u][o - 1].length + this.grid[u][o].length - 1;
					if (a < this.grid.length - 1) for (var u = o; u <= s; u++) c[1] += this.grid[a + 1][u].length + this.grid[a][u].length - 1;
					if (s < this.grid[0].length - 1) for (var u = i; u <= a; u++) c[2] += this.grid[u][s + 1].length + this.grid[u][s].length - 1;
					if (i > 0) for (var u = o; u <= s; u++) c[3] += this.grid[i - 1][u].length + this.grid[i][u].length - 1;
					for (var d = m.MAX_VALUE, f, p, h = 0; h < c.length; h++) c[h] < d ? (d = c[h], f = 1, p = h) : c[h] == d && f++;
					if (f == 3 && d == 0) c[0] == 0 && c[1] == 0 && c[2] == 0 ? t = 1 : c[0] == 0 && c[1] == 0 && c[3] == 0 ? t = 0 : c[0] == 0 && c[2] == 0 && c[3] == 0 ? t = 3 : c[1] == 0 && c[2] == 0 && c[3] == 0 && (t = 2);
					else if (f == 2 && d == 0) {
						var g = Math.floor(Math.random() * 2);
						t = c[0] == 0 && c[1] == 0 ? g == 0 ? 0 : 1 : c[0] == 0 && c[2] == 0 ? g == 0 ? 0 : 2 : c[0] == 0 && c[3] == 0 ? g == 0 ? 0 : 3 : c[1] == 0 && c[2] == 0 ? g == 0 ? 1 : 2 : c[1] == 0 && c[3] == 0 ? g == 0 ? 1 : 3 : g == 0 ? 2 : 3;
					} else if (f == 4 && d == 0) {
						var g = Math.floor(Math.random() * 4);
						t = g;
					} else t = p;
					t == 0 ? r.setCenter(n.getCenterX(), n.getCenterY() - n.getHeight() / 2 - l.DEFAULT_EDGE_LENGTH - r.getHeight() / 2) : t == 1 ? r.setCenter(n.getCenterX() + n.getWidth() / 2 + l.DEFAULT_EDGE_LENGTH + r.getWidth() / 2, n.getCenterY()) : t == 2 ? r.setCenter(n.getCenterX(), n.getCenterY() + n.getHeight() / 2 + l.DEFAULT_EDGE_LENGTH + r.getHeight() / 2) : r.setCenter(n.getCenterX() - n.getWidth() / 2 - l.DEFAULT_EDGE_LENGTH - r.getWidth() / 2, n.getCenterY());
				}, e.exports = v;
			}),
			(function(e, t, n) {
				var r = {};
				r.layoutBase = n(0), r.CoSEConstants = n(1), r.CoSEEdge = n(2), r.CoSEGraph = n(3), r.CoSEGraphManager = n(4), r.CoSELayout = n(6), r.CoSENode = n(5), e.exports = r;
			})
		]);
	});
}));
export default require_cose_base();
export { require_cose_base };
