import { __module as pa } from "../../../../../_virtual/cytoscape-fcose2.js";
import { __require as ba } from "../../../cose-base@2.2.0/node_modules/cose-base/cose-base.js";
var wa = pa.exports, Oa;
function _a() {
  return Oa ? pa.exports : (Oa = 1, (function(xa, Pa) {
    (function(Da, Na) {
      xa.exports = Na(ba());
    })(wa, function(Ia) {
      return (
        /******/
        (() => {
          var Da = {
            /***/
            658: (
              /***/
              (($) => {
                $.exports = Object.assign != null ? Object.assign.bind(Object) : function(la) {
                  for (var D = arguments.length, j = Array(D > 1 ? D - 1 : 0), c = 1; c < D; c++)
                    j[c - 1] = arguments[c];
                  return j.forEach(function(B) {
                    Object.keys(B).forEach(function(s) {
                      return la[s] = B[s];
                    });
                  }), la;
                };
              })
            ),
            /***/
            548: (
              /***/
              (($, la, D) => {
                var j = /* @__PURE__ */ (function() {
                  function s(u, i) {
                    var n = [], r = !0, A = !1, L = void 0;
                    try {
                      for (var e = u[Symbol.iterator](), o; !(r = (o = e.next()).done) && (n.push(o.value), !(i && n.length === i)); r = !0)
                        ;
                    } catch (x) {
                      A = !0, L = x;
                    } finally {
                      try {
                        !r && e.return && e.return();
                      } finally {
                        if (A) throw L;
                      }
                    }
                    return n;
                  }
                  return function(u, i) {
                    if (Array.isArray(u))
                      return u;
                    if (Symbol.iterator in Object(u))
                      return s(u, i);
                    throw new TypeError("Invalid attempt to destructure non-iterable instance");
                  };
                })(), c = D(140).layoutBase.LinkedList, B = {};
                B.getTopMostNodes = function(s) {
                  for (var u = {}, i = 0; i < s.length; i++)
                    u[s[i].id()] = !0;
                  var n = s.filter(function(r, A) {
                    typeof r == "number" && (r = A);
                    for (var L = r.parent()[0]; L != null; ) {
                      if (u[L.id()])
                        return !1;
                      L = L.parent()[0];
                    }
                    return !0;
                  });
                  return n;
                }, B.connectComponents = function(s, u, i, n) {
                  var r = new c(), A = /* @__PURE__ */ new Set(), L = [], e = void 0, o = void 0, x = void 0, a = !1, T = 1, S = [], l = [], g = function() {
                    var m = s.collection();
                    l.push(m);
                    var U = i[0], C = s.collection();
                    C.merge(U).merge(U.descendants().intersection(u)), L.push(U), C.forEach(function(M) {
                      r.push(M), A.add(M), m.merge(M);
                    });
                    for (var ta = function() {
                      U = r.shift();
                      var ea = s.collection();
                      U.neighborhood().nodes().forEach(function(f) {
                        u.intersection(U.edgesWith(f)).length > 0 && ea.merge(f);
                      });
                      for (var Z = 0; Z < ea.length; Z++) {
                        var z = ea[Z];
                        if (e = i.intersection(z.union(z.ancestors())), e != null && !A.has(e[0])) {
                          var ia = e.union(e.descendants());
                          ia.forEach(function(f) {
                            r.push(f), A.add(f), m.merge(f), i.has(f) && L.push(f);
                          });
                        }
                      }
                    }; r.length != 0; )
                      ta();
                    if (m.forEach(function(M) {
                      u.intersection(M.connectedEdges()).forEach(function(ea) {
                        m.has(ea.source()) && m.has(ea.target()) && m.merge(ea);
                      });
                    }), L.length == i.length && (a = !0), !a || a && T > 1) {
                      o = L[0], x = o.connectedEdges().length, L.forEach(function(M) {
                        M.connectedEdges().length < x && (x = M.connectedEdges().length, o = M);
                      }), S.push(o.id());
                      var J = s.collection();
                      J.merge(L[0]), L.forEach(function(M) {
                        J.merge(M);
                      }), L = [], i = i.difference(J), T++;
                    }
                  };
                  do
                    g();
                  while (!a);
                  return n && S.length > 0 && n.set("dummy" + (n.size + 1), S), l;
                }, B.relocateComponent = function(s, u, i) {
                  if (!i.fixedNodeConstraint) {
                    var n = Number.POSITIVE_INFINITY, r = Number.NEGATIVE_INFINITY, A = Number.POSITIVE_INFINITY, L = Number.NEGATIVE_INFINITY;
                    if (i.quality == "draft") {
                      var e = !0, o = !1, x = void 0;
                      try {
                        for (var a = u.nodeIndexes[Symbol.iterator](), T; !(e = (T = a.next()).done); e = !0) {
                          var S = T.value, l = j(S, 2), g = l[0], v = l[1], m = i.cy.getElementById(g);
                          if (m) {
                            var U = m.boundingBox(), C = u.xCoords[v] - U.w / 2, ta = u.xCoords[v] + U.w / 2, J = u.yCoords[v] - U.h / 2, M = u.yCoords[v] + U.h / 2;
                            C < n && (n = C), ta > r && (r = ta), J < A && (A = J), M > L && (L = M);
                          }
                        }
                      } catch (f) {
                        o = !0, x = f;
                      } finally {
                        try {
                          !e && a.return && a.return();
                        } finally {
                          if (o)
                            throw x;
                        }
                      }
                      var ea = s.x - (r + n) / 2, Z = s.y - (L + A) / 2;
                      u.xCoords = u.xCoords.map(function(f) {
                        return f + ea;
                      }), u.yCoords = u.yCoords.map(function(f) {
                        return f + Z;
                      });
                    } else {
                      Object.keys(u).forEach(function(f) {
                        var R = u[f], q = R.getRect().x, Q = R.getRect().x + R.getRect().width, aa = R.getRect().y, H = R.getRect().y + R.getRect().height;
                        q < n && (n = q), Q > r && (r = Q), aa < A && (A = aa), H > L && (L = H);
                      });
                      var z = s.x - (r + n) / 2, ia = s.y - (L + A) / 2;
                      Object.keys(u).forEach(function(f) {
                        var R = u[f];
                        R.setCenter(R.getCenterX() + z, R.getCenterY() + ia);
                      });
                    }
                  }
                }, B.calcBoundingBox = function(s, u, i, n) {
                  for (var r = Number.MAX_SAFE_INTEGER, A = Number.MIN_SAFE_INTEGER, L = Number.MAX_SAFE_INTEGER, e = Number.MIN_SAFE_INTEGER, o = void 0, x = void 0, a = void 0, T = void 0, S = s.descendants().not(":parent"), l = S.length, g = 0; g < l; g++) {
                    var v = S[g];
                    o = u[n.get(v.id())] - v.width() / 2, x = u[n.get(v.id())] + v.width() / 2, a = i[n.get(v.id())] - v.height() / 2, T = i[n.get(v.id())] + v.height() / 2, r > o && (r = o), A < x && (A = x), L > a && (L = a), e < T && (e = T);
                  }
                  var m = {};
                  return m.topLeftX = r, m.topLeftY = L, m.width = A - r, m.height = e - L, m;
                }, B.calcParentsWithoutChildren = function(s, u) {
                  var i = s.collection();
                  return u.nodes(":parent").forEach(function(n) {
                    var r = !1;
                    n.children().forEach(function(A) {
                      A.css("display") != "none" && (r = !0);
                    }), r || i.merge(n);
                  }), i;
                }, $.exports = B;
              })
            ),
            /***/
            816: (
              /***/
              (($, la, D) => {
                var j = D(548), c = D(140).CoSELayout, B = D(140).CoSENode, s = D(140).layoutBase.PointD, u = D(140).layoutBase.DimensionD, i = D(140).layoutBase.LayoutConstants, n = D(140).layoutBase.FDLayoutConstants, r = D(140).CoSEConstants, A = function(e, o) {
                  var x = e.cy, a = e.eles, T = a.nodes(), S = a.edges(), l = void 0, g = void 0, v = void 0, m = {};
                  e.randomize && (l = o.nodeIndexes, g = o.xCoords, v = o.yCoords);
                  var U = function(f) {
                    return typeof f == "function";
                  }, C = function(f, R) {
                    return U(f) ? f(R) : f;
                  }, ta = j.calcParentsWithoutChildren(x, a), J = function ia(f, R, q, Q) {
                    for (var aa = R.length, H = 0; H < aa; H++) {
                      var E = R[H], ra = null;
                      E.intersection(ta).length == 0 && (ra = E.children());
                      var N = void 0, b = E.layoutDimensions({
                        nodeDimensionsIncludeLabels: Q.nodeDimensionsIncludeLabels
                      });
                      if (E.outerWidth() != null && E.outerHeight() != null)
                        if (Q.randomize)
                          if (!E.isParent())
                            N = f.add(new B(q.graphManager, new s(g[l.get(E.id())] - b.w / 2, v[l.get(E.id())] - b.h / 2), new u(parseFloat(b.w), parseFloat(b.h))));
                          else {
                            var oa = j.calcBoundingBox(E, g, v, l);
                            E.intersection(ta).length == 0 ? N = f.add(new B(q.graphManager, new s(oa.topLeftX, oa.topLeftY), new u(oa.width, oa.height))) : N = f.add(new B(q.graphManager, new s(oa.topLeftX, oa.topLeftY), new u(parseFloat(b.w), parseFloat(b.h))));
                          }
                        else
                          N = f.add(new B(q.graphManager, new s(E.position("x") - b.w / 2, E.position("y") - b.h / 2), new u(parseFloat(b.w), parseFloat(b.h))));
                      else
                        N = f.add(new B(this.graphManager));
                      if (N.id = E.data("id"), N.nodeRepulsion = C(Q.nodeRepulsion, E), N.paddingLeft = parseInt(E.css("padding")), N.paddingTop = parseInt(E.css("padding")), N.paddingRight = parseInt(E.css("padding")), N.paddingBottom = parseInt(E.css("padding")), Q.nodeDimensionsIncludeLabels && (N.labelWidth = E.boundingBox({ includeLabels: !0, includeNodes: !1, includeOverlays: !1 }).w, N.labelHeight = E.boundingBox({ includeLabels: !0, includeNodes: !1, includeOverlays: !1 }).h, N.labelPosVertical = E.css("text-valign"), N.labelPosHorizontal = E.css("text-halign")), m[E.data("id")] = N, isNaN(N.rect.x) && (N.rect.x = 0), isNaN(N.rect.y) && (N.rect.y = 0), ra != null && ra.length > 0) {
                        var ca = void 0;
                        ca = q.getGraphManager().add(q.newGraph(), N), ia(ca, ra, q, Q);
                      }
                    }
                  }, M = function(f, R, q) {
                    for (var Q = 0, aa = 0, H = 0; H < q.length; H++) {
                      var E = q[H], ra = m[E.data("source")], N = m[E.data("target")];
                      if (ra && N && ra !== N && ra.getEdgesBetween(N).length == 0) {
                        var b = R.add(f.newEdge(), ra, N);
                        b.id = E.id(), b.idealLength = C(e.idealEdgeLength, E), b.edgeElasticity = C(e.edgeElasticity, E), Q += b.idealLength, aa++;
                      }
                    }
                    e.idealEdgeLength != null && (aa > 0 ? r.DEFAULT_EDGE_LENGTH = n.DEFAULT_EDGE_LENGTH = Q / aa : U(e.idealEdgeLength) ? r.DEFAULT_EDGE_LENGTH = n.DEFAULT_EDGE_LENGTH = 50 : r.DEFAULT_EDGE_LENGTH = n.DEFAULT_EDGE_LENGTH = e.idealEdgeLength, r.MIN_REPULSION_DIST = n.MIN_REPULSION_DIST = n.DEFAULT_EDGE_LENGTH / 10, r.DEFAULT_RADIAL_SEPARATION = n.DEFAULT_EDGE_LENGTH);
                  }, ea = function(f, R) {
                    R.fixedNodeConstraint && (f.constraints.fixedNodeConstraint = R.fixedNodeConstraint), R.alignmentConstraint && (f.constraints.alignmentConstraint = R.alignmentConstraint), R.relativePlacementConstraint && (f.constraints.relativePlacementConstraint = R.relativePlacementConstraint);
                  };
                  e.nestingFactor != null && (r.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR = n.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR = e.nestingFactor), e.gravity != null && (r.DEFAULT_GRAVITY_STRENGTH = n.DEFAULT_GRAVITY_STRENGTH = e.gravity), e.numIter != null && (r.MAX_ITERATIONS = n.MAX_ITERATIONS = e.numIter), e.gravityRange != null && (r.DEFAULT_GRAVITY_RANGE_FACTOR = n.DEFAULT_GRAVITY_RANGE_FACTOR = e.gravityRange), e.gravityCompound != null && (r.DEFAULT_COMPOUND_GRAVITY_STRENGTH = n.DEFAULT_COMPOUND_GRAVITY_STRENGTH = e.gravityCompound), e.gravityRangeCompound != null && (r.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR = n.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR = e.gravityRangeCompound), e.initialEnergyOnIncremental != null && (r.DEFAULT_COOLING_FACTOR_INCREMENTAL = n.DEFAULT_COOLING_FACTOR_INCREMENTAL = e.initialEnergyOnIncremental), e.tilingCompareBy != null && (r.TILING_COMPARE_BY = e.tilingCompareBy), e.quality == "proof" ? i.QUALITY = 2 : i.QUALITY = 0, r.NODE_DIMENSIONS_INCLUDE_LABELS = n.NODE_DIMENSIONS_INCLUDE_LABELS = i.NODE_DIMENSIONS_INCLUDE_LABELS = e.nodeDimensionsIncludeLabels, r.DEFAULT_INCREMENTAL = n.DEFAULT_INCREMENTAL = i.DEFAULT_INCREMENTAL = !e.randomize, r.ANIMATE = n.ANIMATE = i.ANIMATE = e.animate, r.TILE = e.tile, r.TILING_PADDING_VERTICAL = typeof e.tilingPaddingVertical == "function" ? e.tilingPaddingVertical.call() : e.tilingPaddingVertical, r.TILING_PADDING_HORIZONTAL = typeof e.tilingPaddingHorizontal == "function" ? e.tilingPaddingHorizontal.call() : e.tilingPaddingHorizontal, r.DEFAULT_INCREMENTAL = n.DEFAULT_INCREMENTAL = i.DEFAULT_INCREMENTAL = !0, r.PURE_INCREMENTAL = !e.randomize, i.DEFAULT_UNIFORM_LEAF_NODE_SIZES = e.uniformNodeDimensions, e.step == "transformed" && (r.TRANSFORM_ON_CONSTRAINT_HANDLING = !0, r.ENFORCE_CONSTRAINTS = !1, r.APPLY_LAYOUT = !1), e.step == "enforced" && (r.TRANSFORM_ON_CONSTRAINT_HANDLING = !1, r.ENFORCE_CONSTRAINTS = !0, r.APPLY_LAYOUT = !1), e.step == "cose" && (r.TRANSFORM_ON_CONSTRAINT_HANDLING = !1, r.ENFORCE_CONSTRAINTS = !1, r.APPLY_LAYOUT = !0), e.step == "all" && (e.randomize ? r.TRANSFORM_ON_CONSTRAINT_HANDLING = !0 : r.TRANSFORM_ON_CONSTRAINT_HANDLING = !1, r.ENFORCE_CONSTRAINTS = !0, r.APPLY_LAYOUT = !0), e.fixedNodeConstraint || e.alignmentConstraint || e.relativePlacementConstraint ? r.TREE_REDUCTION_ON_INCREMENTAL = !1 : r.TREE_REDUCTION_ON_INCREMENTAL = !0;
                  var Z = new c(), z = Z.newGraphManager();
                  return J(z.addRoot(), j.getTopMostNodes(T), Z, e), M(Z, z, S), ea(Z, e), Z.runLayout(), m;
                };
                $.exports = { coseLayout: A };
              })
            ),
            /***/
            212: (
              /***/
              (($, la, D) => {
                var j = /* @__PURE__ */ (function() {
                  function e(o, x) {
                    for (var a = 0; a < x.length; a++) {
                      var T = x[a];
                      T.enumerable = T.enumerable || !1, T.configurable = !0, "value" in T && (T.writable = !0), Object.defineProperty(o, T.key, T);
                    }
                  }
                  return function(o, x, a) {
                    return x && e(o.prototype, x), a && e(o, a), o;
                  };
                })();
                function c(e, o) {
                  if (!(e instanceof o))
                    throw new TypeError("Cannot call a class as a function");
                }
                var B = D(658), s = D(548), u = D(657), i = u.spectralLayout, n = D(816), r = n.coseLayout, A = Object.freeze({
                  // 'draft', 'default' or 'proof' 
                  // - 'draft' only applies spectral layout 
                  // - 'default' improves the quality with subsequent CoSE layout (fast cooling rate)
                  // - 'proof' improves the quality with subsequent CoSE layout (slow cooling rate) 
                  quality: "default",
                  // Use random node positions at beginning of layout
                  // if this is set to false, then quality option must be "proof"
                  randomize: !0,
                  // Whether or not to animate the layout
                  animate: !0,
                  // Duration of animation in ms, if enabled
                  animationDuration: 1e3,
                  // Easing of animation, if enabled
                  animationEasing: void 0,
                  // Fit the viewport to the repositioned nodes
                  fit: !0,
                  // Padding around layout
                  padding: 30,
                  // Whether to include labels in node dimensions. Valid in "proof" quality
                  nodeDimensionsIncludeLabels: !1,
                  // Whether or not simple nodes (non-compound nodes) are of uniform dimensions
                  uniformNodeDimensions: !1,
                  // Whether to pack disconnected components - valid only if randomize: true
                  packComponents: !0,
                  // Layout step - all, transformed, enforced, cose - for debug purpose only
                  step: "all",
                  /* spectral layout options */
                  // False for random, true for greedy
                  samplingType: !0,
                  // Sample size to construct distance matrix
                  sampleSize: 25,
                  // Separation amount between nodes
                  nodeSeparation: 75,
                  // Power iteration tolerance
                  piTol: 1e-7,
                  /* CoSE layout options */
                  // Node repulsion (non overlapping) multiplier
                  nodeRepulsion: function(o) {
                    return 4500;
                  },
                  // Ideal edge (non nested) length
                  idealEdgeLength: function(o) {
                    return 50;
                  },
                  // Divisor to compute edge forces
                  edgeElasticity: function(o) {
                    return 0.45;
                  },
                  // Nesting factor (multiplier) to compute ideal edge length for nested edges
                  nestingFactor: 0.1,
                  // Gravity force (constant)
                  gravity: 0.25,
                  // Maximum number of iterations to perform
                  numIter: 2500,
                  // For enabling tiling
                  tile: !0,
                  // The function that specifies the criteria for comparing nodes while sorting them during tiling operation.
                  // Takes the node id as a parameter and the default tiling operation is perfomed when this option is not set.
                  tilingCompareBy: void 0,
                  // Represents the amount of the vertical space to put between the zero degree members during the tiling operation(can also be a function)
                  tilingPaddingVertical: 10,
                  // Represents the amount of the horizontal space to put between the zero degree members during the tiling operation(can also be a function)
                  tilingPaddingHorizontal: 10,
                  // Gravity range (constant) for compounds
                  gravityRangeCompound: 1.5,
                  // Gravity force (constant) for compounds
                  gravityCompound: 1,
                  // Gravity range (constant)
                  gravityRange: 3.8,
                  // Initial cooling factor for incremental layout  
                  initialEnergyOnIncremental: 0.3,
                  /* constraint options */
                  // Fix required nodes to predefined positions
                  // [{nodeId: 'n1', position: {x: 100, y: 200}, {...}]
                  fixedNodeConstraint: void 0,
                  // Align required nodes in vertical/horizontal direction
                  // {vertical: [['n1', 'n2')], ['n3', 'n4']], horizontal: ['n2', 'n4']}
                  alignmentConstraint: void 0,
                  // Place two nodes relatively in vertical/horizontal direction 
                  // [{top: 'n1', bottom: 'n2', gap: 100}, {left: 'n3', right: 'n4', gap: 75}]
                  relativePlacementConstraint: void 0,
                  /* layout event callbacks */
                  ready: function() {
                  },
                  // on layoutready
                  stop: function() {
                  }
                  // on layoutstop
                }), L = (function() {
                  function e(o) {
                    c(this, e), this.options = B({}, A, o);
                  }
                  return j(e, [{
                    key: "run",
                    value: function() {
                      var x = this, a = this.options, T = a.cy, S = a.eles, l = [], g = [], v = void 0, m = [];
                      a.fixedNodeConstraint && (!Array.isArray(a.fixedNodeConstraint) || a.fixedNodeConstraint.length == 0) && (a.fixedNodeConstraint = void 0), a.alignmentConstraint && (a.alignmentConstraint.vertical && (!Array.isArray(a.alignmentConstraint.vertical) || a.alignmentConstraint.vertical.length == 0) && (a.alignmentConstraint.vertical = void 0), a.alignmentConstraint.horizontal && (!Array.isArray(a.alignmentConstraint.horizontal) || a.alignmentConstraint.horizontal.length == 0) && (a.alignmentConstraint.horizontal = void 0)), a.relativePlacementConstraint && (!Array.isArray(a.relativePlacementConstraint) || a.relativePlacementConstraint.length == 0) && (a.relativePlacementConstraint = void 0);
                      var U = a.fixedNodeConstraint || a.alignmentConstraint || a.relativePlacementConstraint;
                      U && (a.tile = !1, a.packComponents = !1);
                      var C = void 0, ta = !1;
                      if (T.layoutUtilities && a.packComponents && (C = T.layoutUtilities("get"), C || (C = T.layoutUtilities()), ta = !0), S.nodes().length > 0)
                        if (ta) {
                          var ea = s.getTopMostNodes(a.eles.nodes());
                          if (v = s.connectComponents(T, a.eles, ea), v.forEach(function(d) {
                            var t = d.boundingBox();
                            m.push({ x: t.x1 + t.w / 2, y: t.y1 + t.h / 2 });
                          }), a.randomize && v.forEach(function(d) {
                            a.eles = d, l.push(i(a));
                          }), a.quality == "default" || a.quality == "proof") {
                            var Z = T.collection();
                            if (a.tile) {
                              var z = /* @__PURE__ */ new Map(), ia = [], f = [], R = 0, q = { nodeIndexes: z, xCoords: ia, yCoords: f }, Q = [];
                              if (v.forEach(function(d, t) {
                                d.edges().length == 0 && (d.nodes().forEach(function(k, O) {
                                  Z.merge(d.nodes()[O]), k.isParent() || (q.nodeIndexes.set(d.nodes()[O].id(), R++), q.xCoords.push(d.nodes()[0].position().x), q.yCoords.push(d.nodes()[0].position().y));
                                }), Q.push(t));
                              }), Z.length > 1) {
                                var aa = Z.boundingBox();
                                m.push({ x: aa.x1 + aa.w / 2, y: aa.y1 + aa.h / 2 }), v.push(Z), l.push(q);
                                for (var H = Q.length - 1; H >= 0; H--)
                                  v.splice(Q[H], 1), l.splice(Q[H], 1), m.splice(Q[H], 1);
                              }
                            }
                            v.forEach(function(d, t) {
                              a.eles = d, g.push(r(a, l[t])), s.relocateComponent(m[t], g[t], a);
                            });
                          } else
                            v.forEach(function(d, t) {
                              s.relocateComponent(m[t], l[t], a);
                            });
                          var E = /* @__PURE__ */ new Set();
                          if (v.length > 1) {
                            var ra = [], N = S.filter(function(d) {
                              return d.css("display") == "none";
                            });
                            v.forEach(function(d, t) {
                              var k = void 0;
                              if (a.quality == "draft" && (k = l[t].nodeIndexes), d.nodes().not(N).length > 0) {
                                var O = {};
                                O.edges = [], O.nodes = [];
                                var G = void 0;
                                d.nodes().not(N).forEach(function(_) {
                                  if (a.quality == "draft")
                                    if (!_.isParent())
                                      G = k.get(_.id()), O.nodes.push({ x: l[t].xCoords[G] - _.boundingbox().w / 2, y: l[t].yCoords[G] - _.boundingbox().h / 2, width: _.boundingbox().w, height: _.boundingbox().h });
                                    else {
                                      var w = s.calcBoundingBox(_, l[t].xCoords, l[t].yCoords, k);
                                      O.nodes.push({ x: w.topLeftX, y: w.topLeftY, width: w.width, height: w.height });
                                    }
                                  else
                                    g[t][_.id()] && O.nodes.push({ x: g[t][_.id()].getLeft(), y: g[t][_.id()].getTop(), width: g[t][_.id()].getWidth(), height: g[t][_.id()].getHeight() });
                                }), d.edges().forEach(function(_) {
                                  var w = _.source(), W = _.target();
                                  if (w.css("display") != "none" && W.css("display") != "none")
                                    if (a.quality == "draft") {
                                      var fa = k.get(w.id()), ma = k.get(W.id()), ua = [], sa = [];
                                      if (w.isParent()) {
                                        var ha = s.calcBoundingBox(w, l[t].xCoords, l[t].yCoords, k);
                                        ua.push(ha.topLeftX + ha.width / 2), ua.push(ha.topLeftY + ha.height / 2);
                                      } else
                                        ua.push(l[t].xCoords[fa]), ua.push(l[t].yCoords[fa]);
                                      if (W.isParent()) {
                                        var La = s.calcBoundingBox(W, l[t].xCoords, l[t].yCoords, k);
                                        sa.push(La.topLeftX + La.width / 2), sa.push(La.topLeftY + La.height / 2);
                                      } else
                                        sa.push(l[t].xCoords[ma]), sa.push(l[t].yCoords[ma]);
                                      O.edges.push({ startX: ua[0], startY: ua[1], endX: sa[0], endY: sa[1] });
                                    } else
                                      g[t][w.id()] && g[t][W.id()] && O.edges.push({ startX: g[t][w.id()].getCenterX(), startY: g[t][w.id()].getCenterY(), endX: g[t][W.id()].getCenterX(), endY: g[t][W.id()].getCenterY() });
                                }), O.nodes.length > 0 && (ra.push(O), E.add(t));
                              }
                            });
                            var b = C.packComponents(ra, a.randomize).shifts;
                            if (a.quality == "draft")
                              l.forEach(function(d, t) {
                                var k = d.xCoords.map(function(G) {
                                  return G + b[t].dx;
                                }), O = d.yCoords.map(function(G) {
                                  return G + b[t].dy;
                                });
                                d.xCoords = k, d.yCoords = O;
                              });
                            else {
                              var oa = 0;
                              E.forEach(function(d) {
                                Object.keys(g[d]).forEach(function(t) {
                                  var k = g[d][t];
                                  k.setCenter(k.getCenterX() + b[oa].dx, k.getCenterY() + b[oa].dy);
                                }), oa++;
                              });
                            }
                          }
                        } else {
                          var J = a.eles.boundingBox();
                          if (m.push({ x: J.x1 + J.w / 2, y: J.y1 + J.h / 2 }), a.randomize) {
                            var M = i(a);
                            l.push(M);
                          }
                          a.quality == "default" || a.quality == "proof" ? (g.push(r(a, l[0])), s.relocateComponent(m[0], g[0], a)) : s.relocateComponent(m[0], l[0], a);
                        }
                      var ca = function(t, k) {
                        if (a.quality == "default" || a.quality == "proof") {
                          typeof t == "number" && (t = k);
                          var O = void 0, G = void 0, _ = t.data("id");
                          return g.forEach(function(W) {
                            _ in W && (O = { x: W[_].getRect().getCenterX(), y: W[_].getRect().getCenterY() }, G = W[_]);
                          }), a.nodeDimensionsIncludeLabels && (G.labelWidth && (G.labelPosHorizontal == "left" ? O.x += G.labelWidth / 2 : G.labelPosHorizontal == "right" && (O.x -= G.labelWidth / 2)), G.labelHeight && (G.labelPosVertical == "top" ? O.y += G.labelHeight / 2 : G.labelPosVertical == "bottom" && (O.y -= G.labelHeight / 2))), O == null && (O = { x: t.position("x"), y: t.position("y") }), {
                            x: O.x,
                            y: O.y
                          };
                        } else {
                          var w = void 0;
                          return l.forEach(function(W) {
                            var fa = W.nodeIndexes.get(t.id());
                            fa != null && (w = { x: W.xCoords[fa], y: W.yCoords[fa] });
                          }), w == null && (w = { x: t.position("x"), y: t.position("y") }), {
                            x: w.x,
                            y: w.y
                          };
                        }
                      };
                      if (a.quality == "default" || a.quality == "proof" || a.randomize) {
                        var ya = s.calcParentsWithoutChildren(T, S), Aa = S.filter(function(d) {
                          return d.css("display") == "none";
                        });
                        a.eles = S.not(Aa), S.nodes().not(":parent").not(Aa).layoutPositions(x, a, ca), ya.length > 0 && ya.forEach(function(d) {
                          d.position(ca(d));
                        });
                      } else
                        console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.");
                    }
                  }]), e;
                })();
                $.exports = L;
              })
            ),
            /***/
            657: (
              /***/
              (($, la, D) => {
                var j = D(548), c = D(140).layoutBase.Matrix, B = D(140).layoutBase.SVD, s = function(i) {
                  var n = i.cy, r = i.eles, A = r.nodes(), L = r.nodes(":parent"), e = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), x = /* @__PURE__ */ new Map(), a = [], T = [], S = [], l = [], g = [], v = [], m = [], U = [], C = void 0, ta = 1e8, J = 1e-9, M = i.piTol, ea = i.samplingType, Z = i.nodeSeparation, z = void 0, ia = function() {
                    for (var y = 0, h = 0, p = !1; h < z; ) {
                      y = Math.floor(Math.random() * C), p = !1;
                      for (var I = 0; I < h; I++)
                        if (l[I] == y) {
                          p = !0;
                          break;
                        }
                      if (!p)
                        l[h] = y, h++;
                      else
                        continue;
                    }
                  }, f = function(y, h, p) {
                    for (var I = [], X = 0, P = 0, F = 0, V = void 0, K = [], na = 0, ga = 1, va = 0; va < C; va++)
                      K[va] = ta;
                    for (I[P] = y, K[y] = 0; P >= X; ) {
                      F = I[X++];
                      for (var Ea = a[F], da = 0; da < Ea.length; da++)
                        V = o.get(Ea[da]), K[V] == ta && (K[V] = K[F] + 1, I[++P] = V);
                      v[F][h] = K[F] * Z;
                    }
                    if (p) {
                      for (var Ta = 0; Ta < C; Ta++)
                        v[Ta][h] < g[Ta] && (g[Ta] = v[Ta][h]);
                      for (var Ca = 0; Ca < C; Ca++)
                        g[Ca] > na && (na = g[Ca], ga = Ca);
                    }
                    return ga;
                  }, R = function(y) {
                    var h = void 0;
                    if (y) {
                      h = Math.floor(Math.random() * C);
                      for (var I = 0; I < C; I++)
                        g[I] = ta;
                      for (var X = 0; X < z; X++)
                        l[X] = h, h = f(h, X, y);
                    } else {
                      ia();
                      for (var p = 0; p < z; p++)
                        f(l[p], p, y);
                    }
                    for (var P = 0; P < C; P++)
                      for (var F = 0; F < z; F++)
                        v[P][F] *= v[P][F];
                    for (var V = 0; V < z; V++)
                      m[V] = [];
                    for (var K = 0; K < z; K++)
                      for (var na = 0; na < z; na++)
                        m[K][na] = v[l[na]][K];
                  }, q = function() {
                    for (var y = B.svd(m), h = y.S, p = y.U, I = y.V, X = h[0] * h[0] * h[0], P = [], F = 0; F < z; F++) {
                      P[F] = [];
                      for (var V = 0; V < z; V++)
                        P[F][V] = 0, F == V && (P[F][V] = h[F] / (h[F] * h[F] + X / (h[F] * h[F])));
                    }
                    U = c.multMat(c.multMat(I, P), c.transpose(p));
                  }, Q = function() {
                    for (var y = void 0, h = void 0, p = [], I = [], X = [], P = [], F = 0; F < C; F++)
                      p[F] = Math.random(), I[F] = Math.random();
                    p = c.normalize(p), I = c.normalize(I);
                    for (var V = J, K = J, na = void 0; ; ) {
                      for (var ga = 0; ga < C; ga++)
                        X[ga] = p[ga];
                      if (p = c.multGamma(c.multL(c.multGamma(X), v, U)), y = c.dotProduct(X, p), p = c.normalize(p), V = c.dotProduct(X, p), na = Math.abs(V / K), na <= 1 + M && na >= 1)
                        break;
                      K = V;
                    }
                    for (var va = 0; va < C; va++)
                      X[va] = p[va];
                    for (K = J; ; ) {
                      for (var Ea = 0; Ea < C; Ea++)
                        P[Ea] = I[Ea];
                      if (P = c.minusOp(P, c.multCons(X, c.dotProduct(X, P))), I = c.multGamma(c.multL(c.multGamma(P), v, U)), h = c.dotProduct(P, I), I = c.normalize(I), V = c.dotProduct(P, I), na = Math.abs(V / K), na <= 1 + M && na >= 1)
                        break;
                      K = V;
                    }
                    for (var da = 0; da < C; da++)
                      P[da] = I[da];
                    T = c.multCons(X, Math.sqrt(Math.abs(y))), S = c.multCons(P, Math.sqrt(Math.abs(h)));
                  };
                  j.connectComponents(n, r, j.getTopMostNodes(A), e), L.forEach(function(Y) {
                    j.connectComponents(n, r, j.getTopMostNodes(Y.descendants().intersection(r)), e);
                  });
                  for (var aa = 0, H = 0; H < A.length; H++)
                    A[H].isParent() || o.set(A[H].id(), aa++);
                  var E = !0, ra = !1, N = void 0;
                  try {
                    for (var b = e.keys()[Symbol.iterator](), oa; !(E = (oa = b.next()).done); E = !0) {
                      var ca = oa.value;
                      o.set(ca, aa++);
                    }
                  } catch (Y) {
                    ra = !0, N = Y;
                  } finally {
                    try {
                      !E && b.return && b.return();
                    } finally {
                      if (ra)
                        throw N;
                    }
                  }
                  for (var ya = 0; ya < o.size; ya++)
                    a[ya] = [];
                  L.forEach(function(Y) {
                    for (var y = Y.children().intersection(r); y.nodes(":childless").length == 0; )
                      y = y.nodes()[0].children().intersection(r);
                    var h = 0, p = y.nodes(":childless")[0].connectedEdges().length;
                    y.nodes(":childless").forEach(function(I, X) {
                      I.connectedEdges().length < p && (p = I.connectedEdges().length, h = X);
                    }), x.set(Y.id(), y.nodes(":childless")[h].id());
                  }), A.forEach(function(Y) {
                    var y = void 0;
                    Y.isParent() ? y = o.get(x.get(Y.id())) : y = o.get(Y.id()), Y.neighborhood().nodes().forEach(function(h) {
                      r.intersection(Y.edgesWith(h)).length > 0 && (h.isParent() ? a[y].push(x.get(h.id())) : a[y].push(h.id()));
                    });
                  });
                  var Aa = function(y) {
                    var h = o.get(y), p = void 0;
                    e.get(y).forEach(function(I) {
                      n.getElementById(I).isParent() ? p = x.get(I) : p = I, a[h].push(p), a[o.get(p)].push(y);
                    });
                  }, d = !0, t = !1, k = void 0;
                  try {
                    for (var O = e.keys()[Symbol.iterator](), G; !(d = (G = O.next()).done); d = !0) {
                      var _ = G.value;
                      Aa(_);
                    }
                  } catch (Y) {
                    t = !0, k = Y;
                  } finally {
                    try {
                      !d && O.return && O.return();
                    } finally {
                      if (t)
                        throw k;
                    }
                  }
                  C = o.size;
                  var w = void 0;
                  if (C > 2) {
                    z = C < i.sampleSize ? C : i.sampleSize;
                    for (var W = 0; W < C; W++)
                      v[W] = [];
                    for (var fa = 0; fa < z; fa++)
                      U[fa] = [];
                    return i.quality == "draft" || i.step == "all" ? (R(ea), q(), Q(), w = { nodeIndexes: o, xCoords: T, yCoords: S }) : (o.forEach(function(Y, y) {
                      T.push(n.getElementById(y).position("x")), S.push(n.getElementById(y).position("y"));
                    }), w = { nodeIndexes: o, xCoords: T, yCoords: S }), w;
                  } else {
                    var ma = o.keys(), ua = n.getElementById(ma.next().value), sa = ua.position(), ha = ua.outerWidth();
                    if (T.push(sa.x), S.push(sa.y), C == 2) {
                      var La = n.getElementById(ma.next().value), Sa = La.outerWidth();
                      T.push(sa.x + ha / 2 + Sa / 2 + i.idealEdgeLength), S.push(sa.y);
                    }
                    return w = { nodeIndexes: o, xCoords: T, yCoords: S }, w;
                  }
                };
                $.exports = { spectralLayout: s };
              })
            ),
            /***/
            579: (
              /***/
              (($, la, D) => {
                var j = D(212), c = function(s) {
                  s && s("layout", "fcose", j);
                };
                typeof cytoscape < "u" && c(cytoscape), $.exports = c;
              })
            ),
            /***/
            140: (
              /***/
              (($) => {
                $.exports = Ia;
              })
            )
            /******/
          }, Na = {};
          function Ra($) {
            var la = Na[$];
            if (la !== void 0)
              return la.exports;
            var D = Na[$] = {
              /******/
              // no module.id needed
              /******/
              // no module.loaded needed
              /******/
              exports: {}
              /******/
            };
            return Da[$](D, D.exports, Ra), D.exports;
          }
          var Fa = Ra(579);
          return Fa;
        })()
      );
    });
  })(pa), pa.exports);
}
export {
  _a as __require
};
