import { v as parseStrictNonNegativeInteger } from "./number-coercion-CU7MBp2A.js";
import "./parse-finite-number-D0XNMNbx.js";
import { i as emitInternalDiagnosticEvent } from "./diagnostic-events-CKGnJ7YJ.js";
//#region src/logging/diagnostic-payload.ts
function logLargePayload(params) {
	emitInternalDiagnosticEvent({
		type: "payload.large",
		...params
	});
}
function logRejectedLargePayload(params) {
	logLargePayload({
		action: "rejected",
		...params
	});
}
function parseContentLengthHeader(raw) {
	const value = Array.isArray(raw) ? raw[0] : raw;
	if (typeof value !== "string") return;
	const trimmed = value.trim();
	if (trimmed.length === 0 || !/^\d+$/.test(trimmed)) return;
	return parseStrictNonNegativeInteger(trimmed);
}
//#endregion
export { logRejectedLargePayload as n, parseContentLengthHeader as r, logLargePayload as t };
