import vine, { symbols, Vine, VineNativeEnum } from '@vinejs/vine';
Vine.macro('enumWithValues', (values) => {
    return new VineEnumWithValues(values);
});
Vine.macro('enumWithArrayValues', (values) => {
    return vine.enumWithValues(Object.fromEntries(values.map((v) => [v, v])));
});
export class VineEnumWithValues extends VineNativeEnum {
    #enumObject;
    #native;
    constructor(values, options, validations) {
        super(values, options, validations);
        this.#enumObject = values;
        this.#native = new VineNativeEnum(values, options, validations);
    }
    clone() {
        return new VineEnumWithValues(this.#enumObject, this.cloneOptions(), this.cloneValidations());
    }
    [symbols.PARSE](propertyName, refs, options) {
        const nativeParse = this.#native[symbols.PARSE].bind(this.#native);
        const output = nativeParse(propertyName, refs, options);
        output.enumValues = Object.values(this.#enumObject);
        return output;
    }
}
//# sourceMappingURL=vine_enum_with_values.js.map