"use client";
import * as o from "react";
import { useComposedRefs as m } from "../../../../../@radix-ui_react-compose-refs@1.1.2_@types_react@19.0.10_react@19.0.0/node_modules/@radix-ui/react-compose-refs/dist/index.js";
import { jsx as u } from "react/jsx-runtime";
// @__NO_SIDE_EFFECTS__
function y(r) {
  const t = /* @__PURE__ */ E(r), l = o.forwardRef((n, e) => {
    const { children: i, ...c } = n, a = o.Children.toArray(i), s = a.find(g);
    if (s) {
      const f = s.props.children, d = a.map((p) => p === s ? o.Children.count(f) > 1 ? o.Children.only(null) : o.isValidElement(f) ? f.props.children : null : p);
      return /* @__PURE__ */ u(t, { ...c, ref: e, children: o.isValidElement(f) ? o.cloneElement(f, void 0, d) : null });
    }
    return /* @__PURE__ */ u(t, { ...c, ref: e, children: i });
  });
  return l.displayName = `${r}.Slot`, l;
}
var b = /* @__PURE__ */ y("Slot");
// @__NO_SIDE_EFFECTS__
function E(r) {
  const t = o.forwardRef((l, n) => {
    const { children: e, ...i } = l, c = o.isValidElement(e) ? R(e) : void 0, a = m(c, n);
    if (o.isValidElement(e)) {
      const s = C(i, e.props);
      return e.type !== o.Fragment && (s.ref = a), o.cloneElement(e, s);
    }
    return o.Children.count(e) > 1 ? o.Children.only(null) : null;
  });
  return t.displayName = `${r}.SlotClone`, t;
}
var S = Symbol("radix.slottable");
function g(r) {
  return o.isValidElement(r) && typeof r.type == "function" && "__radixId" in r.type && r.type.__radixId === S;
}
function C(r, t) {
  const l = { ...t };
  for (const n in t) {
    const e = r[n], i = t[n];
    /^on[A-Z]/.test(n) ? e && i ? l[n] = (...a) => {
      const s = i(...a);
      return e(...a), s;
    } : e && (l[n] = e) : n === "style" ? l[n] = { ...e, ...i } : n === "className" && (l[n] = [e, i].filter(Boolean).join(" "));
  }
  return { ...r, ...l };
}
function R(r) {
  var n, e;
  let t = (n = Object.getOwnPropertyDescriptor(r.props, "ref")) == null ? void 0 : n.get, l = t && "isReactWarning" in t && t.isReactWarning;
  return l ? r.ref : (t = (e = Object.getOwnPropertyDescriptor(r, "ref")) == null ? void 0 : e.get, l = t && "isReactWarning" in t && t.isReactWarning, l ? r.props.ref : r.props.ref || r.ref);
}
export {
  b as Root,
  b as Slot,
  y as createSlot
};
//# sourceMappingURL=index.js.map
