// Migration workflow: options modal → progress → results view import { api } from './api.js'; import { state, setState } from './state.js'; import { escHtml, formatDateTime, downloadCsv } from './utils.js'; import { navigate } from './router.js'; import { refreshTemplates } from './templates.js'; // ── Helpers ──────────────────────────────────────────────────────────────── function getSettings() { try { return JSON.parse(localStorage.getItem('migrator_settings')) || {}; } catch { return {}; } } // ── Options modal ────────────────────────────────────────────────────────── export function showOptionsModal(ids) { if (!ids || !ids.length) return; const settings = getSettings(); const names = ids.map(id => { const t = state.templates.find(t => t.adobe_id === id); return t ? t.name : id; }); const existing = document.getElementById('migration-modal'); if (existing) existing.remove(); const wrapper = document.createElement('div'); wrapper.id = 'migration-modal'; wrapper.innerHTML = `