const require_rolldown_runtime = require('../../../../../../../../_virtual/rolldown_runtime.js');
const require_ValidateBy$1 = require('../common/ValidateBy.js');

//#region ../../node_modules/.pnpm/class-validator@0.14.1/node_modules/class-validator/cjs/decorator/typechecker/IsNumber.js
var require_IsNumber = /* @__PURE__ */ require_rolldown_runtime.__commonJS({ "../../node_modules/.pnpm/class-validator@0.14.1/node_modules/class-validator/cjs/decorator/typechecker/IsNumber.js": ((exports) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	exports.IsNumber = exports.isNumber = exports.IS_NUMBER = void 0;
	const ValidateBy_1 = require_ValidateBy$1.require_ValidateBy();
	exports.IS_NUMBER = "isNumber";
	/**
	* Checks if a given value is a number.
	*/
	function isNumber(value, options = {}) {
		if (typeof value !== "number") return false;
		if (value === Infinity || value === -Infinity) return !!options.allowInfinity;
		if (Number.isNaN(value)) return !!options.allowNaN;
		if (options.maxDecimalPlaces !== void 0) {
			let decimalPlaces = 0;
			if (value % 1 !== 0) decimalPlaces = value.toString().split(".")[1].length;
			if (decimalPlaces > options.maxDecimalPlaces) return false;
		}
		return Number.isFinite(value);
	}
	exports.isNumber = isNumber;
	/**
	* Checks if a value is a number.
	*/
	function IsNumber(options = {}, validationOptions) {
		return (0, ValidateBy_1.ValidateBy)({
			name: exports.IS_NUMBER,
			constraints: [options],
			validator: {
				validate: (value, args) => isNumber(value, args === null || args === void 0 ? void 0 : args.constraints[0]),
				defaultMessage: (0, ValidateBy_1.buildMessage)((eachPrefix) => eachPrefix + "$property must be a number conforming to the specified constraints", validationOptions)
			}
		}, validationOptions);
	}
	exports.IsNumber = IsNumber;
}) });

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