ry.pop();
                        }
                        localStorage.setItem('mindmap-history', JSON.stringify(history));
                    }

                    document
                        .getElementById('topic-title')
                        .textContent = data.topic;
                    document.title = `${data.topic} - Mind Map AI`;
                    renderMindMap(data.markdown);
                    setupButtons(data.markdown, data.topic);
                } catch (error) {
               