const require_objectSpread2 = require("../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js");
//#region src/plus/salesSdk/bookingEditService/mergeFormIntoExtend.ts
/**
* 将 Ant Design Form 值合并进 cacheItem._extend，避免 undefined 覆盖 other.session 等字段。
*/
function mergeFormIntoExtend(baseExtend, formValues) {
	const next = require_objectSpread2._objectSpread2({}, baseExtend || {});
	for (const [key, value] of Object.entries(formValues || {})) {
		if (value === void 0) continue;
		if (key === "other" && value && typeof value === "object") {
			next.other = require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, next.other || {}), value);
			continue;
		}
		/** Capacity 子组件初始值常为 []，勿覆盖 getProductExtend 写入的默认人数。 */
		if (key === "capacity" && Array.isArray(value) && value.length === 0) continue;
		next[key] = value;
	}
	return next;
}
//#endregion
exports.mergeFormIntoExtend = mergeFormIntoExtend;
