SEC Filings & Regulatory News Tracker
Analysis Results for
Recent SEC Filings:
Recent Regulatory News:
Simulated Regulatory Health:
Regulatory Compliance Score: / 100
Key Regulatory Risks:
${filing.description}
`; secFilingsOutput.appendChild(div); }); } if (regulatoryNewsOutput) { regulatoryNewsOutput.innerHTML = ''; // Clear previous simulatedNews.sort((a, b) => new Date(b.date) - new Date(a.date)); // Sort news by date simulatedNews.forEach(news => { const div = document.createElement('div'); div.className = 'news-item'; div.innerHTML = `${news.date}: ${news.title}
`; regulatoryNewsOutput.appendChild(div); }); } if (complianceScoreOutput) complianceScoreOutput.textContent = complianceScore; if (regulatoryRisksOutput) { regulatoryRisksOutput.textContent = regulatoryRisks.join('. ') + (regulatoryRisks.length > 0 ? '.' : ''); } resultsContainer.classList.remove('hidden'); toggleLoadingState(false); } /** * Generates and downloads a PDF of the report. */ async function downloadPdf() { if (resultsContainer && resultsContainer.classList.contains('hidden')) { showErrorMessage("Please track filings and news first to generate a report for PDF."); return; } hideErrorMessage(); const { jsPDF } = window.jspdf; const doc = new jsPDF(); // Gather input and output data const companySymbol = companySymbolInput.value.trim().toUpperCase(); const complianceScore = complianceScoreOutput ? complianceScoreOutput.textContent : 'N/A'; const regulatoryRisks = regulatoryRisksOutput ? regulatoryRisksOutput.textContent : 'N/A'; const simulatedFilings = []; if (secFilingsOutput) { Array.from(secFilingsOutput.children).forEach(item => { simulatedFilings.push({ type: item.querySelector('.filing-type').textContent, date: item.querySelector('.filing-date').textContent, description: item.querySelector('p:last-child').textContent }); }); } const simulatedNews = []; if (regulatoryNewsOutput) { Array.from(regulatoryNewsOutput.children).forEach(item => { simulatedNews.push({ date: item.querySelector('.news-date').textContent.replace(':', ''), title: item.querySelector('.news-title').textContent }); }); } let yPos = 20; const margin = 15; const pageWidth = doc.internal.pageSize.getWidth(); const textWidth = pageWidth - 2 * margin; doc.setFont('Inter', 'bold'); doc.setFontSize(22); doc.text('SEC Filings & Regulatory News Report', pageWidth / 2, yPos, { align: 'center' }); yPos += 15; doc.setDrawColor(226, 232, 240); doc.line(margin, yPos, pageWidth - margin, yPos); yPos += 10; doc.setFont('Inter', 'bold'); doc.setFontSize(16); doc.text(`Report for: ${companySymbol}`, margin, yPos); yPos += 12; // Recent SEC Filings doc.setFont('Inter', 'bold'); doc.setFontSize(14); doc.text('Recent SEC Filings:', margin, yPos); yPos += 8; doc.setFont('Inter', 'normal'); doc.setFontSize(12); if (simulatedFilings.length > 0) { const filingTableRows = simulatedFilings.map(f => [f.type, f.date, f.description]); doc.autoTable({ startY: yPos, head: [['Type', 'Date', 'Description']], body: filingTableRows, theme: 'grid', styles: { font: 'Inter', fontSize: 9, cellPadding: 2, valign: 'top', halign: 'left', textColor: [51, 65, 85], cellWidth: 'wrap' }, headStyles: { fillColor: [240, 244, 248], textColor: [51, 65, 85], fontStyle: 'bold' }, columnStyles: { 0: { cellWidth: 30 }, /* Type */ 1: { cellWidth: 25 }, /* Date */ 2: { cellWidth: 'auto' } /* Description */ }, margin: { left: margin, right: margin } }); yPos = doc.autoTable.previous.finalY + 15; } else { doc.text('No recent filings found in simulation.', margin, yPos); yPos += 10; } // Recent Regulatory News doc.setFont('Inter', 'bold'); doc.setFontSize(14); doc.text('Recent Regulatory News:', margin, yPos); yPos += 8; doc.setFont('Inter', 'normal'); doc.setFontSize(12); if (simulatedNews.length > 0) { const newsTableRows = simulatedNews.map(n => [n.date, n.title]); doc.autoTable({ startY: yPos, head: [['Date', 'Headline']], body: newsTableRows, theme: 'grid', styles: { font: 'Inter', fontSize: 9, cellPadding: 2, valign: 'top', halign: 'left', textColor: [51, 65, 85], cellWidth: 'wrap' }, headStyles: { fillColor: [240, 244, 248], textColor: [51, 65, 85], fontStyle: 'bold' }, columnStyles: { 0: { cellWidth: 25 }, /* Date */ 1: { cellWidth: 'auto' } /* Headline */ }, margin: { left: margin, right: margin } }); yPos = doc.autoTable.previous.finalY + 15; } else { doc.text('No recent regulatory news found in simulation.', margin, yPos); yPos += 10; } // Simulated Regulatory Health doc.setFont('Inter', 'bold'); doc.setFontSize(14); doc.text('Simulated Regulatory Health:', margin, yPos); yPos += 8; doc.setFont('Inter', 'normal'); doc.setFontSize(12); doc.text(`Regulatory Compliance Score: ${complianceScore} / 100`, margin, yPos); yPos += 8; const risksLines = doc.splitTextToSize(`Key Regulatory Risks: ${regulatoryRisks}`, textWidth); doc.text(risksLines, margin, yPos); yPos += (risksLines.length * 6) + 15; // Concluding remark doc.setFont('Inter', 'normal'); doc.setFontSize(10); const concludingText = "This report provides a *simulated* analysis of SEC filings and regulatory news for demonstration purposes. It does not fetch real-time or actual data from the SEC or other regulatory bodies. For real regulatory compliance and investment decisions, always refer to official SEC filings and consult with qualified legal and financial professionals. This tool is for informational and educational purposes only."; const concludingLines = doc.splitTextToSize(concludingText, textWidth); doc.text(concludingLines, margin, yPos); doc.save(`${companySymbol}_SEC_Regulatory_Report.pdf`); } });