import "./conversions.js";
import { c as p } from "../../../../../_virtual/conversions.js";
var u = p.exports;
function f() {
  for (var n = {}, r = Object.keys(u), a = r.length, e = 0; e < a; e++)
    n[r[e]] = {
      distance: -1,
      parent: null
    };
  return n;
}
function o(n) {
  var r = f(), a = [n];
  for (r[n].distance = 0; a.length; )
    for (var e = a.pop(), t = Object.keys(u[e]), i = t.length, v = 0; v < i; v++) {
      var s = t[v], c = r[s];
      c.distance === -1 && (c.distance = r[e].distance + 1, c.parent = e, a.unshift(s));
    }
  return r;
}
function l(n, r) {
  return function(a) {
    return r(n(a));
  };
}
function h(n, r) {
  for (var a = [r[n].parent, n], e = u[r[n].parent][n], t = r[n].parent; r[t].parent; )
    a.unshift(r[t].parent), e = l(u[r[t].parent][t], e), t = r[t].parent;
  return e.conversion = a, e;
}
var m = function(n) {
  for (var r = o(n), a = {}, e = Object.keys(r), t = e.length, i = 0; i < t; i++) {
    var v = e[i], s = r[v];
    s.parent !== null && (a[v] = h(v, r));
  }
  return a;
};
export {
  m as default
};
//# sourceMappingURL=route.js.map
