import { useMemo as b } from "react";
var c = globalThis && globalThis.__rest || function(e, n) {
  var a = {};
  for (var r in e)
    Object.prototype.hasOwnProperty.call(e, r) && n.indexOf(r) < 0 && (a[r] = e[r]);
  if (e != null && typeof Object.getOwnPropertySymbols == "function")
    for (var t = 0, r = Object.getOwnPropertySymbols(e); t < r.length; t++)
      n.indexOf(r[t]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[t]) && (a[r[t]] = e[r[t]]);
  return a;
};
function u(e) {
  const {
    breadcrumbName: n,
    children: a
  } = e, r = c(e, ["breadcrumbName", "children"]), t = Object.assign({
    title: n
  }, r);
  return a && (t.menu = {
    items: a.map((o) => {
      var {
        breadcrumbName: l
      } = o, m = c(o, ["breadcrumbName"]);
      return Object.assign(Object.assign({}, m), {
        title: l
      });
    })
  }), t;
}
function f(e, n) {
  return b(() => e || (n ? n.map(u) : null), [e, n]);
}
export {
  f as default
};
