import { isVNode as n, h as e } from "vue";
import { locales as o } from "./interface.mjs";
const s = (r) => r == null || typeof r == "string" && r.trim() === "", y = (r, t = {}) => typeof r == "string" || typeof r == "number" ? String(r) + JSON.stringify(t) : "complex-value", d = (r, t = {
  rawValue: !0,
  precision: 2,
  thousand: !0,
  thousandSeparator: ",",
  currency: "CNY",
  percent: !1
}) => {
  if (Object.prototype.toString.call(r) === "[object Null]" || Object.prototype.toString.call(r) === "[object Undefined]" || Object.prototype.toString.call(r) === "[object Object]" || Object.prototype.toString.call(r) === "[object Function]" || r === "")
    return "--";
  if (t.rawValue)
    return r;
  if (typeof r == "number") {
    if (t.percent)
      return `${r.toFixed(t.precision)}%`;
    if (t.currency)
      return r.toLocaleString(
        o[t.currency ? t.currency : "CNY"],
        {
          style: "currency",
          currency: t.currency ? t.currency : "CNY"
        }
      );
    if (t.thousand) {
      const [c, i] = r.toFixed(t.precision ? t.precision : 2).split(".");
      return `${c.replace(
        /(\d)(?=(\d{3})+(?!\d))/g,
        `$1${t.thousandSeparator ? t.thousandSeparator : ","}`
      )}.${i}`;
    }
    return r.toFixed(t.precision ? t.precision : 2);
  }
  return r;
}, p = (r) => n(r) || typeof r == "function", a = (r) => n(r) ? e(r) : typeof r == "function" ? e(r()) : null, l = (r) => ["ASIN", "MSKU", "aSKU", "SKU"].includes(r);
export {
  d as convertValue,
  y as createMemoizeKey,
  l as isConstLabel,
  s as isNull,
  p as isVNodeOrFunction,
  a as renderValue
};
