import p from "../../@babel/runtime/helpers/esm/typeof.mjs";
import { isValidElement as a } from "react";
import { r as i } from "../node_modules/react-is/index.mjs";
import c from "./hooks/useMemo.mjs";
function l(t, r) {
  typeof t == "function" ? t(r) : p(t) === "object" && t && "current" in t && (t.current = r);
}
function s() {
  for (var t = arguments.length, r = new Array(t), n = 0; n < t; n++)
    r[n] = arguments[n];
  var e = r.filter(function(u) {
    return u;
  });
  return e.length <= 1 ? e[0] : function(u) {
    r.forEach(function(o) {
      l(o, u);
    });
  };
}
function R() {
  for (var t = arguments.length, r = new Array(t), n = 0; n < t; n++)
    r[n] = arguments[n];
  return c(function() {
    return s.apply(void 0, r);
  }, r, function(e, u) {
    return e.length !== u.length || e.every(function(o, f) {
      return o !== u[f];
    });
  });
}
function m(t) {
  var r, n, e = i.isMemo(t) ? t.type.type : t.type;
  return !(typeof e == "function" && !((r = e.prototype) !== null && r !== void 0 && r.render) || typeof t == "function" && !((n = t.prototype) !== null && n !== void 0 && n.render));
}
function E(t) {
  return !/* @__PURE__ */ a(t) || i.isFragment(t) ? !1 : m(t);
}
export {
  s as composeRef,
  l as fillRef,
  E as supportNodeRef,
  m as supportRef,
  R as useComposeRef
};
