import n from "./_baseTrim.js";
import f from "./isObject.js";
import o from "./isSymbol.js";
var s = NaN, m = /^[-+]0x[0-9a-f]+$/i, p = /^0b[01]+$/i, e = /^0o[0-7]+$/i, b = parseInt;
function O(r) {
  if (typeof r == "number")
    return r;
  if (o(r))
    return s;
  if (f(r)) {
    var t = typeof r.valueOf == "function" ? r.valueOf() : r;
    r = f(t) ? t + "" : t;
  }
  if (typeof r != "string")
    return r === 0 ? r : +r;
  r = n(r);
  var i = p.test(r);
  return i || e.test(r) ? b(r.slice(2), i ? 2 : 8) : m.test(r) ? s : +r;
}
export {
  O as default
};
