const require_rolldown_runtime = require('../../../../../../../_virtual/rolldown_runtime.js');
const require_ValidationMetadata$1 = require('../metadata/ValidationMetadata.js');

//#region ../../node_modules/.pnpm/class-validator@0.14.1/node_modules/class-validator/cjs/validation-schema/ValidationSchemaToMetadataTransformer.js
var require_ValidationSchemaToMetadataTransformer = /* @__PURE__ */ require_rolldown_runtime.__commonJS({ "../../node_modules/.pnpm/class-validator@0.14.1/node_modules/class-validator/cjs/validation-schema/ValidationSchemaToMetadataTransformer.js": ((exports) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	const ValidationMetadata_1 = require_ValidationMetadata$1.require_ValidationMetadata();
	/**
	* Used to transform validation schemas to validation metadatas.
	*/
	var ValidationSchemaToMetadataTransformer = class {
		transform(schema) {
			const metadatas = [];
			Object.keys(schema.properties).forEach((property) => {
				schema.properties[property].forEach((validation) => {
					const validationOptions = {
						message: validation.message,
						groups: validation.groups,
						always: validation.always,
						each: validation.each
					};
					const args = {
						type: validation.type,
						name: validation.name,
						target: schema.name,
						propertyName: property,
						constraints: validation.constraints,
						validationTypeOptions: validation.options,
						validationOptions
					};
					metadatas.push(new ValidationMetadata_1.ValidationMetadata(args));
				});
			});
			return metadatas;
		}
	};
	exports.ValidationSchemaToMetadataTransformer = ValidationSchemaToMetadataTransformer;
}) });

//#endregion
Object.defineProperty(exports, 'default', {
  enumerable: true,
  get: function () {
    return require_ValidationSchemaToMetadataTransformer();
  }
});