const fs = require('fs');

let html = fs.readFileSync('index.html', 'utf8');
html = html.replace(/<div id="abstract-chat-section" style="([^"]*?) display: none;">/g, '<div id="abstract-chat-section" style="$1">');
html = html.replace(/<div id="client-abstract-chat-section" style="([^"]*?) display: none;">/g, '<div id="client-abstract-chat-section" style="$1">');
fs.writeFileSync('index.html', html, 'utf8');
console.log('Fixed display: none in index.html');

let js = fs.readFileSync('app_final.js', 'utf8');
js = js.replace(/if\(section\) section.style.display = ab.id \? 'block' : 'none';/g, '');
// Also fix openClientAbstractModal if it hides it initially:
js = js.replace(/if\(document.getElementById\('client-abstract-chat-section'\)\) document.getElementById\('client-abstract-chat-section'\).style.display = 'none';/g, '');
js = js.replace(/if\(document.getElementById\('abstract-chat-section'\)\) document.getElementById\('abstract-chat-section'\).style.display = 'none';/g, '');
fs.writeFileSync('app_final.js', js, 'utf8');
console.log('Fixed comment visibility in app_final.js');
