Corporate Data Breach Legal Risk Calculator

Corporate Data Breach Legal Risk Calculator

Estimate the potential legal and financial impact of a data breach.

Type of Data Breached

${formatCurrency(analysis.estimatedMin)} - ${formatCurrency(analysis.estimatedMax)}

Based on ${analysis.records.toLocaleString('en-US')} records in the ${analysis.industry} sector.

Potential Cost Breakdown

${Object.entries(analysis.costs).map(([key, value]) => `
${key.replace('_', ' ')} ${formatCurrency(value)}
`).join('')}
`; } async function downloadPDF() { downloadPdfButton.disabled = true; pdfLoadingMessage.classList.remove('hidden'); const analysis = calculateRisk(); let riskLevel, riskColor; if (analysis.score < 30) { riskLevel = "Low"; riskColor = "#16a34a"; } else if (analysis.score < 60) { riskLevel = "Moderate"; riskColor = "#ca8a04"; } else if (analysis.score < 85) { riskLevel = "High"; riskColor = "#ea580c"; } else { riskLevel = "Severe"; riskColor = "#dc2626"; } const formatCurrency = (num) => `$${Math.round(num).toLocaleString('en-US')}`; const pdfContainer = document.getElementById('pdf-clone-container'); pdfContainer.innerHTML = `

Data Breach Risk Analysis Report

Overall Risk Score
${analysis.score} (${riskLevel})
Estimated Financial Impact
${formatCurrency(analysis.estimatedMin)} - ${formatCurrency(analysis.estimatedMax)}

Potential Cost Breakdown

${Object.entries(analysis.costs).map(([key, value]) => `
${key.charAt(0).toUpperCase() + key.slice(1)} ${formatCurrency(value)}
`).join('')}

Scenario Details

Industry${analysis.industry}
Records Affected${analysis.records.toLocaleString('en-US')}
`; pdfContainer.style.display = 'block'; try { const canvas = await html2canvas(pdfContainer.querySelector('#pdf-content-wrapper'), { scale: 2 }); const imgData = canvas.toDataURL('image/png'); const pdf = new jsPDF({ orientation: 'p', unit: 'px', format: 'a4' }); const pdfWidth = pdf.internal.pageSize.getWidth(); const pdfHeight = (canvas.height * pdfWidth) / canvas.width; pdf.addImage(imgData, 'PNG', 0, 0, pdfWidth, pdfHeight); pdf.save('Data-Breach-Risk-Analysis.pdf'); } catch (error) { console.error("Error generating PDF:", error); } finally { downloadPdfButton.disabled = false; pdfLoadingMessage.classList.add('hidden'); pdfContainer.style.display = 'none'; } } // --- EVENT LISTENERS --- prevButton.addEventListener('click', () => navigateTabs(-1)); nextButton.addEventListener('click', () => navigateTabs(1)); downloadPdfButton.addEventListener('click', downloadPDF); tabButtons.forEach(button => { button.addEventListener('click', () => showTab(parseInt(button.dataset.tab, 10))); }); // --- INITIALIZATION --- showTab(1); });
Scroll to Top