"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.replaceNodeChildren = void 0;
var _slate = require("slate");
var _removeNodeChildren = require("./remove-node-children");
const replaceNodeChildren = (editor, _ref) => {
  let {
    at,
    nodes,
    insertOptions,
    removeOptions
  } = _ref;
  _slate.Editor.withoutNormalizing(editor, () => {
    (0, _removeNodeChildren.removeNodeChildren)(editor, at, removeOptions);
    _slate.Transforms.insertNodes(editor, nodes, {
      ...insertOptions,
      at: at.concat([0])
    });
  });
};
exports.replaceNodeChildren = replaceNodeChildren;