import s from "react";
import { cloneElement as m, isFragment as c } from "../_util/reactNode.mjs";
const p = /^[\u4e00-\u9fa5]{2}$/, f = p.test.bind(p);
function P(n) {
  return n === "danger" ? {
    danger: !0
  } : {
    type: n
  };
}
function l(n) {
  return typeof n == "string";
}
function x(n) {
  return n === "text" || n === "link";
}
function g(n, o) {
  if (n == null)
    return;
  const e = o ? " " : "";
  return typeof n != "string" && typeof n != "number" && l(n.type) && f(n.props.children) ? m(n, {
    children: n.props.children.split("").join(e)
  }) : l(n) ? f(n) ? /* @__PURE__ */ s.createElement("span", null, n.split("").join(e)) : /* @__PURE__ */ s.createElement("span", null, n) : c(n) ? /* @__PURE__ */ s.createElement("span", null, n) : n;
}
function b(n, o) {
  let e = !1;
  const t = [];
  return s.Children.forEach(n, (r) => {
    const u = typeof r, i = u === "string" || u === "number";
    if (e && i) {
      const a = t.length - 1, C = t[a];
      t[a] = `${C}${r}`;
    } else
      t.push(r);
    e = i;
  }), s.Children.map(t, (r) => g(r, o));
}
export {
  P as convertLegacyProps,
  l as isString,
  f as isTwoCNChar,
  x as isUnBorderedButtonType,
  b as spaceChildren
};
