const require_rolldown_runtime = require('../../../../../../../_virtual/rolldown_runtime.js');
const require_ClassTransformer$1 = require('../ClassTransformer.js');

//#region ../../node_modules/.pnpm/class-transformer@0.5.1/node_modules/class-transformer/cjs/decorators/transform-instance-to-plain.decorator.js
var require_transform_instance_to_plain_decorator = /* @__PURE__ */ require_rolldown_runtime.__commonJS({ "../../node_modules/.pnpm/class-transformer@0.5.1/node_modules/class-transformer/cjs/decorators/transform-instance-to-plain.decorator.js": ((exports) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	const ClassTransformer_1 = require_ClassTransformer$1.require_ClassTransformer();
	/**
	* Transform the object from class to plain object and return only with the exposed properties.
	*
	* Can be applied to functions and getters/setters only.
	*/
	function TransformInstanceToPlain(params) {
		return function(target, propertyKey, descriptor) {
			const classTransformer = new ClassTransformer_1.ClassTransformer();
			const originalMethod = descriptor.value;
			descriptor.value = function(...args) {
				const result = originalMethod.apply(this, args);
				return !!result && (typeof result === "object" || typeof result === "function") && typeof result.then === "function" ? result.then((data) => classTransformer.instanceToPlain(data, params)) : classTransformer.instanceToPlain(result, params);
			};
		};
	}
	exports.TransformInstanceToPlain = TransformInstanceToPlain;
}) });

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