"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const toLatestFormat = require("./toLatestFormat.cjs");
const permissivelyDeserializeNodes = (editor, serializedElement, errorMessage) => {
  let deserialized = null;
  try {
    deserialized = JSON.parse(serializedElement);
  } catch (e) {
  }
  if (typeof deserialized !== "object" || deserialized === null) {
    return [editor.createDefaultElement([{ text: serializedElement }])];
  }
  if ("formatVersion" in deserialized) {
    return toLatestFormat.toLatestFormat(editor, deserialized).children;
  }
  return toLatestFormat.toLatestFormat(editor, {
    formatVersion: 0,
    children: [deserialized]
  }).children;
};
exports.permissivelyDeserializeNodes = permissivelyDeserializeNodes;
//# sourceMappingURL=permissivelyDeserializeNodes.cjs.map
