import { _ as _Stack } from "./_Stack.mjs";
import { _ as _assignMergeValue } from "./_assignMergeValue.mjs";
import { _ as _baseFor } from "./_baseFor.mjs";
import { _ as _baseMergeDeep } from "./_baseMergeDeep.mjs";
import { i as isObject_1 } from "./isObject.mjs";
import { k as keysIn_1 } from "./keysIn.mjs";
import { _ as _safeGet } from "./_safeGet.mjs";
var Stack = _Stack, assignMergeValue = _assignMergeValue, baseFor = _baseFor, baseMergeDeep = _baseMergeDeep, isObject = isObject_1, keysIn = keysIn_1, safeGet = _safeGet;
function baseMerge(object, source, srcIndex, customizer, stack) {
  if (object === source) {
    return;
  }
  baseFor(source, function(srcValue, key) {
    stack || (stack = new Stack());
    if (isObject(srcValue)) {
      baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
    } else {
      var newValue = customizer ? customizer(safeGet(object, key), srcValue, key + "", object, source, stack) : void 0;
      if (newValue === void 0) {
        newValue = srcValue;
      }
      assignMergeValue(object, key, newValue);
    }
  }, keysIn);
}
var _baseMerge = baseMerge;
export {
  _baseMerge as _
};
