import { warn } from "vue";
import { isObject as i, hasOwn as r } from "../../../../../@vue/shared/dist/shared.esm-bundler.mjs";
import u$1 from "../../../../../lodash-es/fromPairs.mjs";
const u = "__epPropKey", h = (e) => e, y = (e) => i(e) && !!e[u], O = (e, r$1) => {
  if (!i(e) || y(e))
    return e;
  const { values: o, required: p, default: n, type: c, validator: a } = e, f = {
    type: c,
    required: !!p,
    validator: o || a ? (l) => {
      let t = false, i2 = [];
      if (o && (i2 = Array.from(o), r(e, "default") && i2.push(n), t || (t = i2.includes(l))), a && (t || (t = a(l))), !t && i2.length > 0) {
        const m = [...new Set(i2)].map((P) => JSON.stringify(P)).join(", ");
        warn(`Invalid prop: validation failed${r$1 ? ` for prop "${r$1}"` : ""}. Expected one of [${m}], got value ${JSON.stringify(l)}.`);
      }
      return t;
    } : void 0,
    [u]: true
  };
  return r(e, "default") && (f.default = n), f;
}, j = (e) => u$1(Object.entries(e).map(([r2, o]) => [
  r2,
  O(o, r2)
]));
export {
  O as buildProp,
  j as buildProps,
  h as definePropType,
  u as epPropKey,
  y as isEpProp
};
