import { mergeObjects as b } from "../../../../../../@base-ui_utils@0.2.4_@types_react@18.3.27_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/utils/esm/mergeObjects.js";
const u = {};
function g(t, n, e, f, i) {
  let c = {
    ...o(t, u)
  };
  return n && (c = r(c, n)), e && (c = r(c, e)), f && (c = r(c, f)), c;
}
function h(t) {
  if (t.length === 0)
    return u;
  if (t.length === 1)
    return o(t[0], u);
  let n = {
    ...o(t[0], u)
  };
  for (let e = 1; e < t.length; e += 1)
    n = r(n, t[e]);
  return n;
}
function r(t, n) {
  return s(n) ? n(t) : E(t, n);
}
function E(t, n) {
  if (!n)
    return t;
  for (const e in n) {
    const f = n[e];
    switch (e) {
      case "style": {
        t[e] = b(t.style, f);
        break;
      }
      case "className": {
        t[e] = I(t.className, f);
        break;
      }
      default:
        l(e, f) ? t[e] = y(t[e], f) : t[e] = f;
    }
  }
  return t;
}
function l(t, n) {
  const e = t.charCodeAt(0), f = t.charCodeAt(1), i = t.charCodeAt(2);
  return e === 111 && f === 110 && i >= 65 && i <= 90 && (typeof n == "function" || typeof n > "u");
}
function s(t) {
  return typeof t == "function";
}
function o(t, n) {
  return s(t) ? t(n) : t ?? u;
}
function y(t, n) {
  return n ? t ? (e) => {
    if (v(e)) {
      const i = e;
      a(i);
      const c = n(i);
      return i.baseUIHandlerPrevented || t == null || t(i), c;
    }
    const f = n(e);
    return t == null || t(e), f;
  } : n : t;
}
function a(t) {
  return t.preventBaseUIHandler = () => {
    t.baseUIHandlerPrevented = !0;
  }, t;
}
function I(t, n) {
  return n ? t ? n + " " + t : n : t;
}
function v(t) {
  return t != null && typeof t == "object" && "nativeEvent" in t;
}
export {
  a as makeEventPreventable,
  I as mergeClassNames,
  g as mergeProps,
  h as mergePropsN
};
