| 19184 | } |
| 19185 | }; |
| 19186 | const remove$1 = editor => { |
| 19187 | if (!editor.removed) { |
| 19188 | const {_selectionOverrides, editorUpload} = editor; |
| 19189 | const body = editor.getBody(); |
| 19190 | const element = editor.getElement(); |
| 19191 | if (body) { |
| 19192 | editor.save({ is_removing: true }); |
| 19193 | } |
| 19194 | editor.removed = true; |
| 19195 | editor.unbindAllNativeEvents(); |
| 19196 | if (editor.hasHiddenInput && isNonNullable(element === null || element === void 0 ? void 0 : element.nextSibling)) { |
| 19197 | DOM$8.remove(element.nextSibling); |
| 19198 | } |
| 19199 | fireRemove(editor); |
| 19200 | editor.editorManager.remove(editor); |
| 19201 | if (!editor.inline && body) { |
| 19202 | restoreOriginalStyles(editor); |
| 19203 | } |
| 19204 | fireDetach(editor); |
| 19205 | DOM$8.remove(editor.getContainer()); |
| 19206 | safeDestroy(_selectionOverrides); |
| 19207 | safeDestroy(editorUpload); |
| 19208 | editor.destroy(); |
| 19209 | } |
| 19210 | }; |
| 19211 | const destroy = (editor, automatic) => { |
| 19212 | const {selection, dom} = editor; |
| 19213 | if (editor.destroyed) { |
no test coverage detected