System.register(["__unresolved_0"], function (_export, _context) {
  "use strict";

  var _loader, _cjsExports, __cjsMetaURL;

  _export("default", void 0);

  return {
    setters: [function (_unresolved_) {
      _loader = _unresolved_.default;
    }],
    execute: function () {
      _loader.define(_context.meta.url, function (exports, _require, module, __filename, __dirname) {
        var require = _loader.createRequireWithReqMap({}, _require);

        (function () {
          Object.defineProperty(exports, "__esModule", {
            value: true
          });
          exports.backtrace = void 0;
          /**
           * Backtrace from end node through parents and return the path.
           * @param node
           * @param includeStartingNode
           */

          function backtrace(node, includeStartNode, includeEndNode) {
            // Init empty path
            var path = [];
            var currentNode;

            if (includeEndNode) {
              // Attach the end node to be the current node
              currentNode = node;
            } else {
              currentNode = node.getParent();
            } // Loop as long the current node has a parent


            while (currentNode.getParent()) {
              path.push([currentNode.position.x, currentNode.position.y]);
              currentNode = currentNode.getParent();
            } // If true we will also include the starting node


            if (includeStartNode) {
              path.push([currentNode.position.x, currentNode.position.y]);
            }

            return path.reverse();
          }

          exports.backtrace = backtrace;
        })();

        _export("default", _cjsExports = module.exports);
      });

      _export("__cjsMetaURL", __cjsMetaURL = _context.meta.url);
    }
  };
});
//# sourceMappingURL=util.js.map