/** * Rewrite IDs in a cloned SVG to prevent collisions on multi-diagram pages. * @private */ /** * Clone SVG with optional text and style preservation * Unified function that replaces modal.js cloneSVGWithTextPreservation and export.js cloneSVGWithStyles * * @param {SVGElement} svg - Original SVG element to clone * @param {object} options - Cloning options * @param {boolean} options.preserveText - Preserve text attributes and dimensions (default: true) * @param {boolean} options.preserveStyles - Copy computed styles to inline (default: false) * @param {Array} options.styleProps - Style properties to copy (default: DEFAULT_STYLE_PROPS) * @param {boolean} options.preserveStyleElements - Copy