import { SEARCH_MARK as a } from "../hooks/useSearchOptions.mjs";
var l = "__RC_CASCADER_SPLIT__", c = "SHOW_PARENT", p = "SHOW_CHILD";
function f(r) {
  return r.join(l);
}
function _(r) {
  return r.map(f);
}
function h(r) {
  return r.split(l);
}
function A(r) {
  var t = r || {}, e = t.label, n = t.value, i = t.children, o = n || "value";
  return {
    label: e || "label",
    value: o,
    key: o,
    children: i || "children"
  };
}
function v(r, t) {
  var e, n;
  return (e = r.isLeaf) !== null && e !== void 0 ? e : !((n = r[t.children]) !== null && n !== void 0 && n.length);
}
function H(r) {
  var t = r.parentElement;
  if (t) {
    var e = r.offsetTop - t.offsetTop;
    e - t.scrollTop < 0 ? t.scrollTo({
      top: e
    }) : e + r.offsetHeight - t.scrollTop > t.offsetHeight && t.scrollTo({
      top: e + r.offsetHeight - t.offsetHeight
    });
  }
}
function d(r, t) {
  return r.map(function(e) {
    var n;
    return (n = e[a]) === null || n === void 0 ? void 0 : n.map(function(i) {
      return i[t.value];
    });
  });
}
function u(r) {
  return Array.isArray(r) && Array.isArray(r[0]);
}
function T(r) {
  return r ? u(r) ? r : (r.length === 0 ? [] : [r]).map(function(t) {
    return Array.isArray(t) ? t : [t];
  }) : [];
}
export {
  p as SHOW_CHILD,
  c as SHOW_PARENT,
  l as VALUE_SPLIT,
  A as fillFieldNames,
  d as getFullPathKeys,
  v as isLeaf,
  H as scrollIntoParentView,
  f as toPathKey,
  _ as toPathKeys,
  h as toPathValueStr,
  T as toRawValues
};
