import { __awaiter as c } from "../../../tslib/tslib.es6.mjs";
import * as _ from "react-dom";
const e = Object.assign({}, _), {
  version: s,
  render: f,
  unmountComponentAtNode: l
} = e;
let r;
try {
  Number((s || "").split(".")[0]) >= 18 && e.createRoot && (r = e.createRoot);
} catch (n) {
}
function i(n) {
  const {
    __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: t
  } = e;
  t && typeof t == "object" && (t.usingClientEntryPoint = n);
}
const o = "__antd_mobile_root__";
function m(n, t) {
  f(n, t);
}
function a(n, t) {
  i(!0);
  const u = t[o] || r(t);
  i(!1), u.render(n), t[o] = u;
}
function v(n, t) {
  if (r) {
    a(n, t);
    return;
  }
  m(n, t);
}
function d(n) {
  return l(n);
}
function R(n) {
  return c(this, void 0, void 0, function* () {
    return Promise.resolve().then(() => {
      var t;
      (t = n[o]) === null || t === void 0 || t.unmount(), delete n[o];
    });
  });
}
function E(n) {
  return r ? R(n) : d(n);
}
export {
  v as render,
  E as unmount
};
