import { isNil as u } from "es-toolkit/predicate";
const c = (e, m) => {
  if (u(e))
    return 0;
  if (typeof e == "number")
    return e;
  if (typeof e != "string")
    return 0;
  const o = new Intl.NumberFormat(m).formatToParts(123456789e-2), p = o.find((i) => i.type === "group")?.value ?? ",", n = o.find((i) => i.type === "decimal")?.value ?? ".", s = e.match(/[-\d.,'\u00A0\s]+/);
  if (!s)
    return 0;
  let r = s[0].trim();
  p !== n && (r = r.replaceAll(p, "")), n !== "." && (r = r.replace(n, "."));
  const a = Number.parseFloat(r);
  return Number.isNaN(a) ? Number.NaN : a;
}, f = (e, m) => m.split(".").reduce((t, o) => t && typeof t == "object" ? t[o] : void 0, e);
export {
  f as getValueByPath,
  c as parseNumberFromValue
};
//# sourceMappingURL=formatUtils.js.map
