Global Travel Insurance Coverage Analyzer
Compare travel insurance plans to find the best fit for your trip.
Your insurance plan comparison will appear here. Please fill out the 'Data Configuration' tab first.
Trip Details
Select Plans to Compare
Please select at least one plan to compare from the Data Configuration tab.
`; downloadBtn.classList.add('hidden'); return; } const isTripCostCovered = (plan) => plan.coverage.cancellation >= data.tripCost; let resultsHtml = data.plans.map(plan => `${plan.name}
${formatCurrency(plan.price)}
Estimated Premium
${isTripCostCovered(plan) ? '✅ Covers your trip cost
' : '⚠️ Does not fully cover trip cost
'}Medical Emergency:${formatCurrency(plan.coverage.medical)}
Trip Cancellation:${formatCurrency(plan.coverage.cancellation)}
Trip Interruption:${formatCurrency(plan.coverage.interruption)}
Baggage Loss/Delay:${formatCurrency(plan.coverage.baggage)}
Travel Delay:${formatCurrency(plan.coverage.delay)}
Insurance Plan Comparison
${resultsHtml}
Disclaimer: This is a simplified comparison for informational purposes only. Coverage amounts and terms vary by provider. Always read the full policy details before purchasing.
`;
downloadBtn.classList.remove('hidden');
}
function downloadPDF() {
const { jsPDF } = window.jspdf;
const pdf = new jsPDF({ orientation: 'p', unit: 'mm', format: 'a4' });
const contentToPrint = document.getElementById('dashboard-content');
if (!contentToPrint) return;
html2canvas(contentToPrint, { scale: 2, useCORS: true }).then(canvas => {
const imgData = canvas.toDataURL('image/png');
const pdfWidth = pdf.internal.pageSize.getWidth();
const pdfHeight = (canvas.height * pdfWidth) / canvas.width;
pdf.addImage(imgData, 'PNG', 10, 10, pdfWidth - 20, pdfHeight > 277 ? 277 : pdfHeight - 20);
pdf.save('Travel-Insurance-Comparison.pdf');
});
}
