import { __commonJS } from "../../_virtual/rolldown_runtime.mjs";
import { require_type } from "../es-errors/type.mjs";
import { require_gopd } from "../gopd/index.mjs";
import { require_get_intrinsic } from "../get-intrinsic/index.mjs";
import { require_define_data_property } from "../define-data-property/index.mjs";
import { require_has_property_descriptors } from "../has-property-descriptors/index.mjs";

//#region ../../node_modules/set-function-length/index.js
var require_set_function_length = /* @__PURE__ */ __commonJS({ "../../node_modules/set-function-length/index.js": ((exports, module) => {
	var GetIntrinsic = require_get_intrinsic();
	var define = require_define_data_property();
	var hasDescriptors = require_has_property_descriptors()();
	var gOPD = require_gopd();
	var $TypeError = require_type();
	var $floor = GetIntrinsic("%Math.floor%");
	/** @type {import('.')} */
	module.exports = function setFunctionLength(fn, length) {
		if (typeof fn !== "function") throw new $TypeError("`fn` is not a function");
		if (typeof length !== "number" || length < 0 || length > 4294967295 || $floor(length) !== length) throw new $TypeError("`length` must be a positive 32-bit integer");
		var loose = arguments.length > 2 && !!arguments[2];
		var functionLengthIsConfigurable = true;
		var functionLengthIsWritable = true;
		if ("length" in fn && gOPD) {
			var desc = gOPD(fn, "length");
			if (desc && !desc.configurable) functionLengthIsConfigurable = false;
			if (desc && !desc.writable) functionLengthIsWritable = false;
		}
		if (functionLengthIsConfigurable || functionLengthIsWritable || !loose) if (hasDescriptors) define(fn, "length", length, true, true);
		else define(fn, "length", length);
		return fn;
	};
}) });

//#endregion
export default require_set_function_length();

export { require_set_function_length };
//# sourceMappingURL=index.mjs.map