@threatcaptain/tc-reports 0.2.4 → 0.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -28696,7 +28696,7 @@ const Dashboard = () => {
28696
28696
  };
28697
28697
  return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-white rounded-xl border border-slate-200 shadow-sm p-6 mb-8", children: [
28698
28698
  /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-xl font-semibold text-slate-900 mb-6", children: "Choose Your Report Template" }),
28699
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-2 gap-6 ", children: templates.map((template) => {
28699
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid grid-cols-1 md:grid-cols-3 gap-6 ", children: templates.map((template) => {
28700
28700
  const getTemplateIcon = (id) => {
28701
28701
  switch (id) {
28702
28702
  case "financial-impact":
@@ -28736,82 +28736,31 @@ const Dashboard = () => {
28736
28736
  template.id
28737
28737
  );
28738
28738
  }) }),
28739
- /* @__PURE__ */ jsxRuntime.jsx(
28739
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full flex p-4", children: /* @__PURE__ */ jsxRuntime.jsx(
28740
28740
  Button$1,
28741
28741
  {
28742
28742
  size: "lg",
28743
+ variant: "default",
28744
+ className: "mx-auto w-full max-w-80",
28743
28745
  onClick: () => handleNavigation(),
28744
28746
  disabled: templateIds.length === 0,
28745
28747
  children: "Create Report"
28746
28748
  }
28747
- )
28749
+ ) })
28748
28750
  ] }) });
28749
28751
  };
28750
- const transformToUnifiedData = (formData, simulationData, logoBase64) => {
28751
- {
28752
- const sampleTotalCost = 156750;
28753
- const sampleRecordCount = 2500;
28754
- const sampleHoursDown = 18;
28755
- const sampleBusinessDowntime = 89200;
28756
- const sampleHardCosts = sampleTotalCost - sampleBusinessDowntime;
28757
- const sampleRegulatoryFines = sampleTotalCost * 0.15;
28758
- const sampleReputationDamage = sampleTotalCost * 0.1;
28759
- const sampleCostBreakdown = {
28760
- hard_costs: sampleHardCosts,
28761
- business_downtime: sampleBusinessDowntime,
28762
- regulatory_fines: sampleRegulatoryFines,
28763
- reputation_damage: sampleReputationDamage
28764
- };
28765
- return {
28766
- companyName: formData.companyName || "Your MSP Company",
28767
- clientName: formData.clientName || "Client Company",
28768
- reportTitle: formData.reportTitle || "Cyber Financial Impact Analysis",
28769
- reportDate: new Date(formData.generatedDate || Date.now()).toLocaleDateString(),
28770
- executiveSummary: formData.executiveSummary || "This report provides a comprehensive analysis of the potential financial impact of cybersecurity threats on your organization.",
28771
- customNotes: "Please review the recommendations and contact us to discuss implementation strategies.",
28772
- logoUrl: logoBase64,
28773
- primaryColor: "#2563eb",
28774
- secondaryColor: "#1e40af",
28775
- // Sample financial data
28776
- totalCost: sampleTotalCost,
28777
- recordCount: sampleRecordCount,
28778
- businessDowntime: sampleBusinessDowntime,
28779
- hoursDown: sampleHoursDown,
28780
- breachType: "Ransomware Attack",
28781
- industry: "Healthcare",
28782
- // Sample insurance data - pass through from form data
28783
- insuranceScore: formData.insuranceHealthScore || 490,
28784
- insuranceCategory: formData.insuranceScoreCategory || "Poor",
28785
- // Enhanced sample metrics
28786
- percentageBreached: 35,
28787
- costPerRecord: Math.round(sampleTotalCost / sampleRecordCount),
28788
- hourlyDowntimeCost: Math.round(sampleBusinessDowntime / sampleHoursDown),
28789
- // Cost breakdown
28790
- costBreakdown: sampleCostBreakdown,
28791
- // Individual cost components with percentages (formatted for display)
28792
- hardCosts: sampleHardCosts.toLocaleString(),
28793
- hardCostsPercentage: (sampleHardCosts / sampleTotalCost * 100).toFixed(1),
28794
- businessDowntimePercentage: (sampleBusinessDowntime / sampleTotalCost * 100).toFixed(1),
28795
- regulatoryFines: sampleRegulatoryFines.toLocaleString(),
28796
- regulatoryFinesPercentage: (sampleRegulatoryFines / sampleTotalCost * 100).toFixed(1),
28797
- reputationDamage: sampleReputationDamage.toLocaleString(),
28798
- reputationDamagePercentage: (sampleReputationDamage / sampleTotalCost * 100).toFixed(1)
28799
- };
28800
- }
28801
- };
28802
- const BreachLikelihood = ({ config }) => {
28752
+ const BreachLikelihood = ({ reportData }) => {
28803
28753
  var _a;
28754
+ const { clientData, securityAssessment, user } = reportData;
28804
28755
  const calculateBreachLikelihood = (protectionLevel) => {
28805
- var _a2, _b;
28806
- if (((_a2 = config.assessmentData) == null ? void 0 : _a2.overall_breach_likelihood) !== null && ((_b = config.assessmentData) == null ? void 0 : _b.overall_breach_likelihood) !== void 0) {
28807
- return Math.round(config.assessmentData.overall_breach_likelihood);
28756
+ if ((securityAssessment == null ? void 0 : securityAssessment.overall_breach_likelihood) !== null && (securityAssessment == null ? void 0 : securityAssessment.overall_breach_likelihood) !== void 0) {
28757
+ return Math.round(securityAssessment.overall_breach_likelihood);
28808
28758
  }
28809
28759
  return Math.max(5, 100 - protectionLevel);
28810
28760
  };
28811
28761
  const calculateProtectionLevel = () => {
28812
- var _a2;
28813
- if ((_a2 = config.assessmentData) == null ? void 0 : _a2.findings) {
28814
- const findings = config.assessmentData.findings;
28762
+ if (securityAssessment == null ? void 0 : securityAssessment.findings) {
28763
+ const findings = securityAssessment.findings;
28815
28764
  const totalControls = 18;
28816
28765
  let implementedControls = 0;
28817
28766
  for (let i = 1; i <= totalControls; i++) {
@@ -28822,7 +28771,7 @@ const BreachLikelihood = ({ config }) => {
28822
28771
  }
28823
28772
  return Math.round(implementedControls / totalControls * 100);
28824
28773
  }
28825
- return 19;
28774
+ return 0;
28826
28775
  };
28827
28776
  const calculateRiskExposure = (baseCost2, likelihood) => {
28828
28777
  return Math.round(baseCost2 * (likelihood / 100));
@@ -28830,7 +28779,7 @@ const BreachLikelihood = ({ config }) => {
28830
28779
  const currentProtection = calculateProtectionLevel();
28831
28780
  const attackLikelihood = calculateBreachLikelihood(currentProtection);
28832
28781
  const baseCost = parseInt(
28833
- ((_a = config.totalEstimatedCost) == null ? void 0 : _a.replace(/,/g, "")) || "510000"
28782
+ ((_a = clientData.totalEstimatedCost) == null ? void 0 : _a.replace(/,/g, "")) || "510000"
28834
28783
  );
28835
28784
  const realRiskExposure = calculateRiskExposure(baseCost, attackLikelihood);
28836
28785
  const riskReduction = Math.max(0, 100 - attackLikelihood);
@@ -28843,14 +28792,14 @@ const BreachLikelihood = ({ config }) => {
28843
28792
  /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-2xl font-bold text-slate-900 text-left", children: "Executive Summary" }),
28844
28793
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-slate-50 rounded-lg p-4 text-left space-y-2", children: [
28845
28794
  /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-base font-semibold text-slate-900", children: "Why This Breach Likelihood Assessment Matters" }),
28846
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-slate-700 leading-relaxed whitespace-pre-line text-sm", children: config.executiveSummary })
28795
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-slate-700 leading-relaxed whitespace-pre-line text-sm", children: clientData.executiveSummary ? clientData.executiveSummary : "" })
28847
28796
  ] }),
28848
28797
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4 mb-4", children: [
28849
28798
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-red-600 text-white p-6 rounded-lg text-center", children: [
28850
28799
  /* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlertTriangle, { className: "w-8 h-8 mx-auto mb-3" }),
28851
28800
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-3xl font-bold mb-2", children: [
28852
28801
  "$",
28853
- baseCost.toLocaleString()
28802
+ baseCost ? baseCost.toLocaleString() : "510,000"
28854
28803
  ] }),
28855
28804
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-xs opacity-90", children: "What an attack could cost your business" })
28856
28805
  ] }),
@@ -29010,7 +28959,7 @@ const BreachLikelihood = ({ config }) => {
29010
28959
  ] }),
29011
28960
  (() => {
29012
28961
  var _a2;
29013
- const controlMappings = ((_a2 = config.assessmentData) == null ? void 0 : _a2.control_mappings) || [];
28962
+ const controlMappings = ((_a2 = clientData.securityAssessment) == null ? void 0 : _a2.control_mappings) || [];
29014
28963
  const implementedControls = Array.isArray(controlMappings) ? controlMappings.filter((c2) => c2.implemented === true) : [];
29015
28964
  const potentialControls = Array.isArray(controlMappings) ? controlMappings.filter((c2) => c2.implemented !== true) : [];
29016
28965
  const renderControlRow = (control) => {
@@ -29197,7 +29146,7 @@ const BreachLikelihood = ({ config }) => {
29197
29146
  /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-lg font-semibold text-slate-900 mb-4", children: "Control Implementation Impact" }),
29198
29147
  (() => {
29199
29148
  var _a2;
29200
- const controlMappings = ((_a2 = config.assessmentData) == null ? void 0 : _a2.control_mappings) || [];
29149
+ const controlMappings = ((_a2 = clientData.securityAssessment) == null ? void 0 : _a2.control_mappings) || [];
29201
29150
  const implementedControls = Array.isArray(controlMappings) ? controlMappings.filter(
29202
29151
  (control) => control.implemented === true
29203
29152
  ) : [];
@@ -29275,9 +29224,9 @@ const BreachLikelihood = ({ config }) => {
29275
29224
  " ",
29276
29225
  /* @__PURE__ */ jsxRuntime.jsx("strong", { children: "Insurance Readiness:" }),
29277
29226
  " ",
29278
- config.insuranceHealthScore || 490,
29227
+ clientData.insuranceHealthScore || 490,
29279
29228
  "/850 (",
29280
- config.insuranceScoreCategory || "Poor",
29229
+ clientData.insuranceScoreCategory || "Poor",
29281
29230
  ")"
29282
29231
  ] }),
29283
29232
  /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
@@ -29330,7 +29279,11 @@ const BreachLikelihood = ({ config }) => {
29330
29279
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-gradient-to-r from-blue-600 to-blue-800 text-white rounded-lg p-8 text-center", children: [
29331
29280
  /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-2xl font-bold mb-4", children: "Ready to Protect Your Business?" }),
29332
29281
  /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-lg mb-6 opacity-90", children: "You know what you're facing and what it costs to fix. The question isn't whether you can afford protection - it's whether you can afford to go without it." }),
29333
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-lg mb-4" }),
29282
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-lg mb-4", children: [
29283
+ /* @__PURE__ */ jsxRuntime.jsx("strong", { children: "Contact:" }),
29284
+ " ",
29285
+ (user == null ? void 0 : user.email) || "contact@company.com"
29286
+ ] }),
29334
29287
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm opacity-80", children: "Every day you wait is another day criminals could strike. Every protection you add makes your business safer." })
29335
29288
  ] })
29336
29289
  ] }),
@@ -29377,10 +29330,9 @@ const BreachLikelihood = ({ config }) => {
29377
29330
  /* @__PURE__ */ jsxRuntime.jsxs("p", { children: [
29378
29331
  /* @__PURE__ */ jsxRuntime.jsx("strong", { children: "Your result:" }),
29379
29332
  " $",
29380
- baseCost.toLocaleString(),
29381
- " ",
29382
- "potential cost for small ",
29383
- config.clientIndustry,
29333
+ baseCost ? baseCost.toLocaleString() : "510,000",
29334
+ " potential cost for small ",
29335
+ clientData.industry,
29384
29336
  " business"
29385
29337
  ] })
29386
29338
  ] })
@@ -29429,22 +29381,31 @@ const BreachLikelihood = ({ config }) => {
29429
29381
  ] });
29430
29382
  };
29431
29383
  const getExecutiveSummaryTemplate = (industry) => {
29432
- const industryTemplates = {
29433
- "Healthcare": "Think of this like a malpractice insurance evaluation for your medical practice. Just as you wouldn't practice without malpractice coverage, you can't afford to practice without understanding your cyber risk exposure. One successful cyberattack could cost your practice more than your highest malpractice settlement.",
29434
- "Legal": "Think of this like a malpractice insurance evaluation for your law firm. Just as you wouldn't practice without malpractice coverage, you can't afford to practice without understanding your cyber risk exposure. One successful cyberattack could cost your firm more than your highest case settlement.",
29435
- "Financial Services": "Think of this like a regulatory compliance audit for your financial institution. Just as you wouldn't operate without proper compliance, you can't afford to operate without understanding your cyber risk exposure. One successful cyberattack could cost your institution more than your largest loan default.",
29436
- "Education": "Think of this like an accreditation review for your educational institution. Just as you wouldn't operate without proper accreditation, you can't afford to operate without understanding your cyber risk exposure. One successful cyberattack could cost your institution more than losing a major grant.",
29437
- "Manufacturing": "Think of this like a safety inspection for your manufacturing facility. Just as you wouldn't operate without proper safety protocols, you can't afford to operate without understanding your cyber risk exposure. One successful cyberattack could cost your facility more than your largest equipment failure.",
29438
- "Retail": "Think of this like a loss prevention audit for your retail business. Just as you wouldn't operate without proper inventory controls, you can't afford to operate without understanding your cyber risk exposure. One successful cyberattack could cost your business more than your highest shrinkage loss.",
29439
- "Technology": "Think of this like a code review for your software platform. Just as you wouldn't deploy without proper testing, you can't afford to operate without understanding your cyber risk exposure. One successful cyberattack could cost your company more than your largest system outage.",
29440
- "Government": "Think of this like a security clearance review for your agency. Just as you wouldn't operate without proper clearances, you can't afford to operate without understanding your cyber risk exposure. One successful cyberattack could cost your agency more than your largest budget overrun."
29441
- };
29442
- return industryTemplates[industry] || "This cybersecurity financial impact analysis estimates the potential cost of a data breach for the client, using trusted, industry-standard data. Backed by sources like IBM Security and the Ponemon Institute, it provides a credible view of the financial risks organizations like yours face in today's threat landscape. Alongside relevant industry insights, this report outlines actionable considerations to support the client's cybersecurity planning, risk management, and executive decision-making—even ahead of a detailed security assessment.";
29384
+ switch (industry) {
29385
+ case "Healthcare":
29386
+ return "Think of this like a malpractice insurance evaluation for your medical practice. Just as you wouldn't practice without malpractice coverage, you can't afford to practice without understanding your cyber risk exposure. One successful cyberattack could cost your practice more than your highest malpractice settlement.";
29387
+ case "Legal":
29388
+ return "Think of this like a malpractice insurance evaluation for your law firm. Just as you wouldn't practice without malpractice coverage, you can't afford to practice without understanding your cyber risk exposure. One successful cyberattack could cost your firm more than your highest case settlement.";
29389
+ case "Financial Services":
29390
+ return "Think of this like a regulatory compliance audit for your financial institution. Just as you wouldn't operate without proper compliance, you can't afford to operate without understanding your cyber risk exposure. One successful cyberattack could cost your institution more than your largest loan default.";
29391
+ case "Education":
29392
+ return "Think of this like an accreditation review for your educational institution. Just as you wouldn't operate without proper accreditation, you can't afford to operate without understanding your cyber risk exposure. One successful cyberattack could cost your institution more than losing a major grant.";
29393
+ case "Manufacturing":
29394
+ return "Think of this like a safety inspection for your manufacturing facility. Just as you wouldn't operate without proper safety protocols, you can't afford to operate without understanding your cyber risk exposure. One successful cyberattack could cost your facility more than your largest equipment failure.";
29395
+ case "Retail":
29396
+ return "Think of this like a loss prevention audit for your retail business. Just as you wouldn't operate without proper inventory controls, you can't afford to operate without understanding your cyber risk exposure. One successful cyberattack could cost your business more than your highest shrinkage loss.";
29397
+ case "Technology":
29398
+ return "Think of this like a code review for your software platform. Just as you wouldn't deploy without proper testing, you can't afford to operate without understanding your cyber risk exposure. One successful cyberattack could cost your company more than your largest system outage.";
29399
+ case "Government":
29400
+ return "Think of this like a security clearance review for your agency. Just as you wouldn't operate without proper clearances, you can't afford to operate without understanding your cyber risk exposure. One successful cyberattack could cost your agency more than your largest budget overrun.";
29401
+ default:
29402
+ return "This cybersecurity financial impact analysis estimates the potential cost of a data breach for the client, using trusted, industry-standard data. Backed by sources like IBM Security and the Ponemon Institute, it provides a credible view of the financial risks organizations like yours face in today's threat landscape. Alongside relevant industry insights, this report outlines actionable considerations to support the client's cybersecurity planning, risk management, and executive decision-making—even ahead of a detailed security assessment.";
29403
+ }
29443
29404
  };
29444
29405
  const formatCurrency = (value) => {
29445
29406
  return `$${value.toLocaleString()}`;
29446
29407
  };
29447
- const getIndustrySpecificCosts = (industry, costBreakdown) => {
29408
+ const getIndustrySpecificCosts = (industry, simulationData) => {
29448
29409
  const industryExamples = {
29449
29410
  "Healthcare": {
29450
29411
  "Post-Breach Response": "Forensic analysis, legal counsel, incident response team",
@@ -29476,74 +29437,68 @@ const getIndustrySpecificCosts = (industry, costBreakdown) => {
29476
29437
  {
29477
29438
  category: "Post-Breach Response",
29478
29439
  example: examples["Post-Breach Response"],
29479
- cost: costBreakdown.hard_costs,
29440
+ cost: simulationData.hard_costs,
29480
29441
  color: "#dc2626"
29481
29442
  },
29482
29443
  {
29483
29444
  category: "Business Downtime",
29484
29445
  example: examples["Business Downtime"],
29485
- cost: costBreakdown.business_downtime,
29446
+ cost: simulationData.business_downtime,
29486
29447
  color: "#3b82f6"
29487
29448
  },
29488
29449
  {
29489
29450
  category: "Notification",
29490
29451
  example: examples["Notification"],
29491
- cost: costBreakdown.regulatory_fines,
29452
+ cost: simulationData.regulatory_fines,
29492
29453
  color: "#ca8a04"
29493
29454
  },
29494
29455
  {
29495
29456
  category: "Investigation",
29496
29457
  example: examples["Investigation"],
29497
- cost: costBreakdown.reputation_damage,
29458
+ cost: simulationData.reputation_damage,
29498
29459
  color: "#16a34a"
29499
29460
  }
29500
29461
  ];
29501
29462
  };
29502
- const createCostBreakdownFromSimulation = ({ costBreakdown }) => {
29463
+ const createCostBreakdownFromSimulation = ({ cost_breakdown }) => {
29503
29464
  var _a, _b, _c, _d;
29504
- if (typeof costBreakdown === "object" && !Array.isArray(costBreakdown)) {
29505
- return {
29506
- hard_costs: (costBreakdown.forensic_costs || 0) + (costBreakdown.legal_costs || 0) + (costBreakdown.system_restoration || 0),
29507
- business_downtime: costBreakdown.business_interruption || 0,
29508
- regulatory_fines: costBreakdown.regulatory_fines || 0,
29509
- reputation_damage: costBreakdown.pr_costs || 0
29510
- };
29511
- } else if (Array.isArray(costBreakdown)) {
29512
- return {
29513
- hard_costs: ((_a = costBreakdown.find((item) => item.category === "Ex-Post Response")) == null ? void 0 : _a.amount) || 0,
29514
- business_downtime: ((_b = costBreakdown.find((item) => item.category === "Business Downtime")) == null ? void 0 : _b.amount) || 0,
29515
- regulatory_fines: ((_c = costBreakdown.find((item) => item.category === "Notification")) == null ? void 0 : _c.amount) || 0,
29516
- reputation_damage: ((_d = costBreakdown.find((item) => item.category === "Investigation")) == null ? void 0 : _d.amount) || 0
29517
- };
29518
- }
29465
+ return {
29466
+ hard_costs: ((_a = cost_breakdown.find((item) => item.category === "Ex-Post Response")) == null ? void 0 : _a.amount) || 0,
29467
+ business_downtime: ((_b = cost_breakdown.find((item) => item.category === "Business Downtime")) == null ? void 0 : _b.amount) || 0,
29468
+ regulatory_fines: ((_c = cost_breakdown.find((item) => item.category === "Notification")) == null ? void 0 : _c.amount) || 0,
29469
+ reputation_damage: ((_d = cost_breakdown.find((item) => item.category === "Investigation")) == null ? void 0 : _d.amount) || 0
29470
+ };
29519
29471
  };
29520
29472
  const UnifiedCostBreakdownChart = ({
29521
- costBreakdown,
29473
+ hard_costs,
29474
+ business_downtime,
29475
+ regulatory_fines,
29476
+ reputation_damage,
29522
29477
  totalCost,
29523
29478
  showTotal = true
29524
29479
  }) => {
29525
29480
  const data = [
29526
29481
  {
29527
29482
  name: "Post-Breach Response",
29528
- value: costBreakdown.hard_costs || 0,
29483
+ value: hard_costs || 0,
29529
29484
  color: "#dc2626",
29530
29485
  label: "Post-Breach Response"
29531
29486
  },
29532
29487
  {
29533
29488
  name: "Business Downtime",
29534
- value: costBreakdown.business_downtime || 0,
29489
+ value: business_downtime || 0,
29535
29490
  color: "#3b82f6",
29536
29491
  label: "Business Downtime"
29537
29492
  },
29538
29493
  {
29539
29494
  name: "Notification",
29540
- value: costBreakdown.regulatory_fines || 0,
29495
+ value: regulatory_fines || 0,
29541
29496
  color: "#ca8a04",
29542
29497
  label: "Notification"
29543
29498
  },
29544
29499
  {
29545
29500
  name: "Investigation",
29546
- value: costBreakdown.reputation_damage || 0,
29501
+ value: reputation_damage || 0,
29547
29502
  color: "#16a34a",
29548
29503
  label: "Investigation"
29549
29504
  }
@@ -29654,25 +29609,27 @@ const UnifiedCostBreakdownChart = ({
29654
29609
  }
29655
29610
  ) }) });
29656
29611
  };
29657
- const FinancialImpact = ({ config, unifiedData }) => {
29658
- var _a, _b, _c;
29659
- const getDisplayExecutiveSummary = () => {
29660
- if (config.executiveSummary) return config.executiveSummary;
29661
- return getExecutiveSummaryTemplate(config.clientIndustry);
29612
+ const FinancialImpact = ({ reportData }) => {
29613
+ var _a;
29614
+ const { clientData, simulationData, user } = reportData;
29615
+ const { industry } = clientData;
29616
+ const displayExecutiveSummary = () => {
29617
+ if (clientData.executiveSummary) return clientData.executiveSummary;
29618
+ return getExecutiveSummaryTemplate(clientData.industry);
29662
29619
  };
29663
- const getIndustryRiskLevel = (industry) => {
29620
+ const getIndustryRiskLevel = (industry2) => {
29664
29621
  const highRiskIndustries = [
29665
29622
  "Healthcare",
29666
29623
  "Financial Services",
29667
29624
  "Government"
29668
29625
  ];
29669
29626
  const mediumRiskIndustries = ["Retail", "Education", "Legal"];
29670
- if (highRiskIndustries.includes(industry))
29627
+ if (highRiskIndustries.includes(industry2))
29671
29628
  return {
29672
29629
  level: "High",
29673
29630
  color: "text-red-600 bg-red-50"
29674
29631
  };
29675
- if (mediumRiskIndustries.includes(industry))
29632
+ if (mediumRiskIndustries.includes(industry2))
29676
29633
  return {
29677
29634
  level: "Medium",
29678
29635
  color: "text-yellow-600 bg-yellow-50"
@@ -29682,7 +29639,7 @@ const FinancialImpact = ({ config, unifiedData }) => {
29682
29639
  color: "text-green-600 bg-green-50"
29683
29640
  };
29684
29641
  };
29685
- const getIndustryThreats = (industry) => {
29642
+ const getIndustryThreats = (industry2) => {
29686
29643
  const industryThreats = {
29687
29644
  // Snake case mappings (database format)
29688
29645
  "healthcare": ["Phishing", "Ransomware", "Third Party Breach"],
@@ -29860,21 +29817,26 @@ const FinancialImpact = ({ config, unifiedData }) => {
29860
29817
  "Third Party Breach"
29861
29818
  ]
29862
29819
  };
29863
- return industryThreats[industry] || [
29820
+ return industryThreats[industry2] || [
29864
29821
  "Phishing Attacks",
29865
29822
  "Business Email Compromise",
29866
29823
  "Data Exfiltration"
29867
29824
  ];
29868
29825
  };
29869
- const riskLevel = getIndustryRiskLevel(config.clientIndustry);
29870
- const dynamicCostBreakdown = createCostBreakdownFromSimulation(
29871
- config.simulationData || {}
29872
- );
29826
+ const riskLevel = getIndustryRiskLevel(industry);
29827
+ const dynamicCostBreakdown = createCostBreakdownFromSimulation(simulationData);
29873
29828
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
29874
- /* @__PURE__ */ jsxRuntime.jsx("section", { id: "financial-impact", className: "report-page text-center space-y-6 pb-8 border-b border-slate-200", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
29875
- /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-4xl font-bold text-slate-900", children: "Cyber Financial Impact Analysis" }),
29876
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xl text-slate-600", children: "Quantifying Your Organization's Cyber Risk Exposure" })
29877
- ] }) }),
29829
+ /* @__PURE__ */ jsxRuntime.jsx(
29830
+ "section",
29831
+ {
29832
+ id: "financial-impact",
29833
+ className: "report-page text-center space-y-6 pb-8 border-b border-slate-200",
29834
+ children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
29835
+ /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-4xl font-bold text-slate-900", children: "Cyber Financial Impact Analysis" }),
29836
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xl text-slate-600", children: "Quantifying Your Organization's Cyber Risk Exposure" })
29837
+ ] })
29838
+ }
29839
+ ),
29878
29840
  /* @__PURE__ */ jsxRuntime.jsxs("section", { className: "report-page space-y-6", children: [
29879
29841
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center space-x-3", children: [
29880
29842
  /* @__PURE__ */ jsxRuntime.jsx(lucideReact.FileText, { className: "w-6 h-6 text-blue-600" }),
@@ -29883,21 +29845,21 @@ const FinancialImpact = ({ config, unifiedData }) => {
29883
29845
  /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-slate-600", children: "An overview of your organization's financial cyber risk" })
29884
29846
  ] })
29885
29847
  ] }),
29886
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "bg-slate-50 rounded-lg p-6", children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-slate-700 leading-relaxed", children: getDisplayExecutiveSummary() }) }),
29848
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "bg-slate-50 rounded-lg p-6", children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-slate-700 leading-relaxed", children: displayExecutiveSummary() }) }),
29887
29849
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-red-600 rounded-lg p-6 text-white text-center", children: [
29888
29850
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-center space-x-2 mb-2", children: [
29889
29851
  /* @__PURE__ */ jsxRuntime.jsx(lucideReact.DollarSign, { className: "w-8 h-8" }),
29890
29852
  /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-2xl font-bold", children: "TOTAL POTENTIAL IMPACT" })
29891
29853
  ] }),
29892
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-4xl font-bold", children: config.totalEstimatedCost ? `${config.totalEstimatedCost}` : formatCurrency(unifiedData.totalCost) }),
29854
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-4xl font-bold", children: simulationData.total_cost ? formatCurrency(simulationData.total_cost) : "" }),
29893
29855
  /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-sm opacity-75 mt-2", children: [
29894
- "Cost Range:",
29895
- config.costRange || `$${Math.round((parseInt(((_a = config.totalEstimatedCost) == null ? void 0 : _a.replace(/[^0-9]/g, "")) || "0") || unifiedData.totalCost) * 0.75).toLocaleString()} - $${Math.round((parseInt(((_b = config.totalEstimatedCost) == null ? void 0 : _b.replace(/[^0-9]/g, "")) || "0") || unifiedData.totalCost) * 1.5).toLocaleString()}`
29856
+ "Cost Range: ",
29857
+ `$${Math.round(simulationData.total_cost * 0.75).toLocaleString()} - $${Math.round(simulationData.total_cost * 1.5).toLocaleString()}`
29896
29858
  ] })
29897
29859
  ] }),
29898
29860
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
29899
29861
  /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "text-lg font-semibold text-slate-900", children: "Top Industry Threats" }),
29900
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4", children: getIndustryThreats(config.clientIndustry).map((threat, index2) => /* @__PURE__ */ jsxRuntime.jsxs(
29862
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4", children: getIndustryThreats(clientData.industry).map((threat, index2) => /* @__PURE__ */ jsxRuntime.jsxs(
29901
29863
  "div",
29902
29864
  {
29903
29865
  className: "bg-red-50 border border-red-200 rounded-lg p-4 flex items-center space-x-3",
@@ -29923,22 +29885,20 @@ const FinancialImpact = ({ config, unifiedData }) => {
29923
29885
  }
29924
29886
  ),
29925
29887
  /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-slate-600", children: [
29926
- config.clientIndustry === "Healthcare" && "Healthcare organizations face elevated cyber risks due to valuable PHI data that commands high prices on dark web markets.",
29927
- config.clientIndustry === "Financial Services" && "Financial institutions are prime targets due to direct access to funds and sensitive financial data.",
29928
- config.clientIndustry === "Manufacturing" && "Manufacturing companies face operational technology risks that can halt production and supply chains.",
29888
+ clientData.industry === "Healthcare" && "Healthcare organizations face elevated cyber risks due to valuable PHI data that commands high prices on dark web markets.",
29889
+ clientData.industry === "Financial Services" && "Financial institutions are prime targets due to direct access to funds and sensitive financial data.",
29890
+ clientData.industry === "Manufacturing" && "Manufacturing companies face operational technology risks that can halt production and supply chains.",
29929
29891
  !["Healthcare", "Financial Services", "Manufacturing"].includes(
29930
- config.clientIndustry
29892
+ clientData.industry
29931
29893
  ) && "Your industry faces specific cyber risks that require tailored protection strategies."
29932
29894
  ] })
29933
29895
  ] }),
29934
29896
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
29935
29897
  /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "text-lg font-semibold text-slate-900", children: "Key Risk Factors" }),
29936
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-1", children: getIndustryThreats(config.clientIndustry).map(
29937
- (threat, index2) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center space-x-2", children: [
29938
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlertTriangle, { className: "w-4 h-4 text-red-500" }),
29939
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm", children: threat })
29940
- ] }, index2)
29941
- ) })
29898
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-1", children: getIndustryThreats(clientData.industry).map((threat, index2) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center space-x-2", children: [
29899
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlertTriangle, { className: "w-4 h-4 text-red-500" }),
29900
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm", children: threat })
29901
+ ] }, index2)) })
29942
29902
  ] })
29943
29903
  ] })
29944
29904
  ] }),
@@ -29947,27 +29907,30 @@ const FinancialImpact = ({ config, unifiedData }) => {
29947
29907
  /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-2xl font-bold text-slate-900 mb-2", children: "Detailed Financial Breakdown" }),
29948
29908
  /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-slate-600", children: "Understanding the components of the total potential cost" })
29949
29909
  ] }),
29950
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-1 lg:grid-cols-5 gap-8", children: [
29951
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "lg:col-span-2 space-y-4", children: /* @__PURE__ */ jsxRuntime.jsx("div", { id: "impact-chart", className: "chart-container", children: /* @__PURE__ */ jsxRuntime.jsx(
29910
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-1 lg:grid-cols-6 gap-8", children: [
29911
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "lg:col-span-3 space-y-4", children: /* @__PURE__ */ jsxRuntime.jsx("div", { id: "impact-chart", className: "chart-container", children: /* @__PURE__ */ jsxRuntime.jsx(
29952
29912
  UnifiedCostBreakdownChart,
29953
29913
  {
29954
- costBreakdown: dynamicCostBreakdown,
29914
+ hard_costs: dynamicCostBreakdown.hard_costs,
29915
+ business_downtime: dynamicCostBreakdown.business_downtime,
29916
+ regulatory_fines: dynamicCostBreakdown.regulatory_fines,
29917
+ reputation_damage: dynamicCostBreakdown.reputation_damage,
29955
29918
  totalCost: parseInt(
29956
- ((_c = config.totalEstimatedCost) == null ? void 0 : _c.replace(/,/g, "")) || "0"
29957
- ) || unifiedData.totalCost
29919
+ ((_a = clientData.totalEstimatedCost) == null ? void 0 : _a.replace(/,/g, "")) || "0"
29920
+ ) || clientData.totalCost
29958
29921
  }
29959
29922
  ) }) }),
29960
29923
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "lg:col-span-3 space-y-4", children: [
29961
29924
  /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "font-semibold text-slate-900", children: "Cost Categories" }),
29962
29925
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-2", children: getIndustrySpecificCosts(
29963
- config.clientIndustry,
29964
- dynamicCostBreakdown
29926
+ clientData.industry,
29927
+ simulationData
29965
29928
  ).map((item, index2) => {
29966
29929
  const costValues = [
29967
- dynamicCostBreakdown.hard_costs,
29968
- dynamicCostBreakdown.business_downtime,
29969
- dynamicCostBreakdown.regulatory_fines,
29970
- dynamicCostBreakdown.reputation_damage
29930
+ dynamicCostBreakdown.hard_costs || 0,
29931
+ dynamicCostBreakdown.business_downtime || 0,
29932
+ dynamicCostBreakdown.regulatory_fines || 0,
29933
+ dynamicCostBreakdown.reputation_damage || 0
29971
29934
  ];
29972
29935
  const dynamicCost = costValues[index2] || item.cost;
29973
29936
  return /* @__PURE__ */ jsxRuntime.jsxs(
@@ -30004,20 +29967,20 @@ const FinancialImpact = ({ config, unifiedData }) => {
30004
29967
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-3 text-sm", children: [
30005
29968
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-between", children: [
30006
29969
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-slate-600", children: "Breach Type:" }),
30007
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium text-right", children: config.breachType })
29970
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium text-right capitalize", children: simulationData.breach_type ? simulationData.breach_type : "" })
30008
29971
  ] }),
30009
29972
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-between", children: [
30010
29973
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-slate-600", children: "Industry:" }),
30011
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium text-right", children: config.clientIndustry })
29974
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium text-right", children: clientData.industry })
30012
29975
  ] }),
30013
29976
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-between", children: [
30014
29977
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-slate-600", children: "Records at Risk:" }),
30015
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium text-right", children: config.recordsAtRisk ? parseInt(config.recordsAtRisk).toLocaleString() : unifiedData.recordCount.toLocaleString() })
29978
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium text-right", children: simulationData.record_count ? parseInt(simulationData.record_count).toLocaleString() : "" })
30016
29979
  ] }),
30017
29980
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-between", children: [
30018
29981
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-slate-600", children: "% Breached:" }),
30019
29982
  /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "font-medium text-right", children: [
30020
- config.percentageBreached,
29983
+ simulationData.percentage_breached,
30021
29984
  "%"
30022
29985
  ] })
30023
29986
  ] })
@@ -30028,62 +29991,29 @@ const FinancialImpact = ({ config, unifiedData }) => {
30028
29991
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-3 text-sm", children: [
30029
29992
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-between", children: [
30030
29993
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-slate-600", children: "Records Affected:" }),
30031
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium text-right", children: config.recordsAffected ? parseInt(config.recordsAffected).toLocaleString() : Math.round(
30032
- unifiedData.recordCount * (parseInt(config.percentageBreached) / 100)
30033
- ).toLocaleString() })
29994
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium text-right", children: parseInt(simulationData.record_count) * (simulationData.percentage_breached / 100) || "" })
30034
29995
  ] }),
30035
29996
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-between", children: [
30036
29997
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-slate-600", children: "Downtime Duration:" }),
30037
29998
  /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "font-medium text-right", children: [
30038
- config.downtimeHours || unifiedData.hoursDown,
29999
+ simulationData.hours_down || "",
30039
30000
  "h"
30040
30001
  ] })
30041
30002
  ] }),
30042
30003
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-between", children: [
30043
30004
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-slate-600", children: "Cost per Hour:" }),
30044
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium text-right", children: formatCurrency(
30045
- parseInt(config.downtimeCostPerHour) || unifiedData.hourlyDowntimeCost
30046
- ) })
30005
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium text-right", children: formatCurrency(parseInt(simulationData.cost_per_hour)) })
30047
30006
  ] }),
30048
30007
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-between", children: [
30049
30008
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-slate-600", children: "Total Downtime Cost:" }),
30050
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium text-right", children: config.totalDowntimeCost ? `$${config.totalDowntimeCost}` : formatCurrency(unifiedData.businessDowntime) })
30009
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium text-right", children: formatCurrency(
30010
+ parseInt(simulationData.hours_down) * parseInt(simulationData.cost_per_hour)
30011
+ ) })
30051
30012
  ] })
30052
30013
  ] })
30053
30014
  ] })
30054
30015
  ] })
30055
30016
  ] }),
30056
- /* @__PURE__ */ jsxRuntime.jsxs("section", { className: "report-page space-y-4 border-t border-slate-200 pt-8", children: [
30057
- /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-2xl font-bold text-slate-900", children: "Recommendations to Reduce Risk" }),
30058
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "overflow-x-auto", children: /* @__PURE__ */ jsxRuntime.jsxs("table", { className: "w-full caption-bottom text-sm", children: [
30059
- /* @__PURE__ */ jsxRuntime.jsx("thead", { className: "border-b", children: /* @__PURE__ */ jsxRuntime.jsxs("tr", { className: "border-b transition-colors hover:bg-muted/50", children: [
30060
- /* @__PURE__ */ jsxRuntime.jsx("th", { className: "h-10 px-2 text-left align-middle font-medium text-muted-foreground w-12", children: "#" }),
30061
- /* @__PURE__ */ jsxRuntime.jsx("th", { className: "h-10 px-2 text-left align-middle font-medium text-muted-foreground w-1/4", children: "Title" }),
30062
- /* @__PURE__ */ jsxRuntime.jsx("th", { className: "h-10 px-2 text-left align-middle font-medium text-muted-foreground w-1/3", children: "Problem" }),
30063
- /* @__PURE__ */ jsxRuntime.jsx("th", { className: "h-10 px-2 text-left align-middle font-medium text-muted-foreground w-1/3", children: "Solution" })
30064
- ] }) }),
30065
- /* @__PURE__ */ jsxRuntime.jsx("tbody", { children: config.recommendations.map((rec, index2) => /* @__PURE__ */ jsxRuntime.jsxs(
30066
- "tr",
30067
- {
30068
- className: "border-b transition-colors hover:bg-muted/50",
30069
- children: [
30070
- /* @__PURE__ */ jsxRuntime.jsx("td", { className: "p-2 align-top", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-6 h-6 bg-blue-600 text-white rounded-full flex items-center justify-center text-xs font-bold", children: index2 + 1 }) }),
30071
- /* @__PURE__ */ jsxRuntime.jsx("td", { className: "p-2 align-top", children: /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "text-sm font-semibold text-slate-900 leading-tight", children: rec.title }) }),
30072
- /* @__PURE__ */ jsxRuntime.jsx("td", { className: "p-2 align-top", children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-slate-700 leading-tight", children: rec.problem }) }),
30073
- /* @__PURE__ */ jsxRuntime.jsxs("td", { className: "p-2 align-top", children: [
30074
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-slate-700 leading-tight", children: rec.solution }),
30075
- rec.analogy && /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-xs text-slate-600 italic mt-1 leading-tight", children: [
30076
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium", children: "Think of it this way:" }),
30077
- " ",
30078
- rec.analogy
30079
- ] })
30080
- ] })
30081
- ]
30082
- },
30083
- rec.id
30084
- )) })
30085
- ] }) })
30086
- ] }),
30087
30017
  /* @__PURE__ */ jsxRuntime.jsxs("section", { className: "report-page space-y-6 border-t border-slate-200 pt-8", children: [
30088
30018
  /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
30089
30019
  /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-2xl font-bold text-slate-900 mb-2", children: "Proposed Next Steps" }),
@@ -30103,8 +30033,8 @@ const FinancialImpact = ({ config, unifiedData }) => {
30103
30033
  /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "font-semibold text-slate-900 mb-2", children: "Schedule Your Strategy Session" }),
30104
30034
  /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-slate-600 mb-4", children: "Let's discuss these findings and develop a customized cybersecurity roadmap for your organization." }),
30105
30035
  /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-slate-600", children: [
30106
- "Contact us at:",
30107
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium text-slate-900" })
30036
+ "Contact us at: ",
30037
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium text-slate-900", children: (user == null ? void 0 : user.email) || /* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: "red", fontWeight: "bold" }, children: "NEEDS MSP EMAIL ADDRESS" }) })
30108
30038
  ] })
30109
30039
  ] })
30110
30040
  ] }),
@@ -30174,19 +30104,7 @@ const FinancialImpact = ({ config, unifiedData }) => {
30174
30104
  ] })
30175
30105
  ] })
30176
30106
  ] })
30177
- ] }),
30178
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "report-page space-y-6 border-t border-slate-200 pt-8", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center space-x-3", children: [
30179
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-8 h-8 bg-gray-600 rounded-lg flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.FileText, { className: "w-5 h-5 text-white" }) }),
30180
- /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
30181
- /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-2xl font-bold text-slate-900", children: "Important Disclaimer" }),
30182
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-slate-600", children: "Legal limitations and professional guidance" })
30183
- ] })
30184
- ] }) }),
30185
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-t border-slate-200 pt-4 text-center text-xs text-slate-500", children: /* @__PURE__ */ jsxRuntime.jsxs("p", { children: [
30186
- "Powered by ThreatCaptain • Generated on",
30187
- " ",
30188
- (/* @__PURE__ */ new Date()).toLocaleDateString()
30189
- ] }) })
30107
+ ] })
30190
30108
  ] });
30191
30109
  };
30192
30110
  const ASSESSMENT_CATEGORIES = {
@@ -30440,10 +30358,11 @@ const InsuranceHealthGauge = ({
30440
30358
  ) })
30441
30359
  ] });
30442
30360
  };
30443
- const InsuranceHealthScore = ({ config }) => {
30361
+ const InsuranceHealthScore = ({ reportData }) => {
30444
30362
  var _a;
30445
- const hasAssessmentData = config.assessmentData && config.assessmentData.responses && Object.keys(config.assessmentData.responses).length > 0;
30446
- const score = hasAssessmentData ? config.insuranceHealthScore || 650 : null;
30363
+ const { clientData, insuranceHealthData } = reportData;
30364
+ const hasAssessmentData = insuranceHealthData.responses && Object.keys(insuranceHealthData.responses).length > 0;
30365
+ const score = hasAssessmentData ? insuranceHealthData.score || 650 : null;
30447
30366
  const scoreCategory = score ? getScoreCategory(score) : null;
30448
30367
  const scoreCategoryData = typeof scoreCategory === "string" ? {
30449
30368
  category: scoreCategory,
@@ -30451,10 +30370,17 @@ const InsuranceHealthScore = ({ config }) => {
30451
30370
  bgColor: "bg-blue-600"
30452
30371
  } : scoreCategory;
30453
30372
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
30454
- /* @__PURE__ */ jsxRuntime.jsx("section", { id: "insurance-health-score", className: "report-page text-center space-y-6 pb-8 border-b border-slate-200", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
30455
- /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-4xl font-bold text-slate-900", children: "Cyber Insurance Health Score Report" }),
30456
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xl text-slate-600", children: "Understanding How Insurance Companies View Your Organization" })
30457
- ] }) }),
30373
+ /* @__PURE__ */ jsxRuntime.jsx(
30374
+ "section",
30375
+ {
30376
+ id: "insurance-health-score",
30377
+ className: "report-page text-center space-y-6 pb-8 border-b border-slate-200",
30378
+ children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
30379
+ /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-4xl font-bold text-slate-900", children: "Cyber Insurance Health Score Report" }),
30380
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xl text-slate-600", children: "Understanding How Insurance Companies View Your Organization" })
30381
+ ] })
30382
+ }
30383
+ ),
30458
30384
  /* @__PURE__ */ jsxRuntime.jsxs("section", { className: "report-page space-y-6", children: [
30459
30385
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center space-x-3", children: [
30460
30386
  /* @__PURE__ */ jsxRuntime.jsx(lucideReact.FileText, { className: "w-6 h-6 text-blue-600" }),
@@ -30463,7 +30389,7 @@ const InsuranceHealthScore = ({ config }) => {
30463
30389
  /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-slate-600", children: "Understanding your organization's insurance readiness" })
30464
30390
  ] })
30465
30391
  ] }),
30466
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "bg-slate-50 rounded-lg p-6 space-y-4", children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-slate-700 leading-relaxed", children: config.executiveSummary || `Think of this like checking your credit score before applying for a business loan. Just as your credit score determines whether banks will lend to you and at what rates, your cybersecurity "credit score" determines whether insurance companies will protect you when cybercriminals attack your business. Here's what most business owners don't realize: cyber insurance is rapidly becoming a business necessity. One ransomware attack can shut down your business for weeks and cost hundreds of thousands in recovery. Many of your clients and partners may soon require you to carry cyber insurance, and insurance companies are getting pickier about who they'll cover and how much they'll charge. This assessment shows you exactly where you stand in the insurance companies' eyes, so you can either improve your "cybersecurity credit score" to get better rates, or at least know what to expect when shopping for coverage.` }) }),
30392
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "bg-slate-50 rounded-lg p-6 space-y-4", children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-slate-700 leading-relaxed", children: clientData.executiveSummary || `Think of this like checking your credit score before applying for a business loan. Just as your credit score determines whether banks will lend to you and at what rates, your cybersecurity "credit score" determines whether insurance companies will protect you when cybercriminals attack your business. Here's what most business owners don't realize: cyber insurance is rapidly becoming a business necessity. One ransomware attack can shut down your business for weeks and cost hundreds of thousands in recovery. Many of your clients and partners may soon require you to carry cyber insurance, and insurance companies are getting pickier about who they'll cover and how much they'll charge. This assessment shows you exactly where you stand in the insurance companies' eyes, so you can either improve your "cybersecurity credit score" to get better rates, or at least know what to expect when shopping for coverage.` }) }),
30467
30393
  /* @__PURE__ */ jsxRuntime.jsxs(
30468
30394
  "div",
30469
30395
  {
@@ -30521,8 +30447,8 @@ const InsuranceHealthScore = ({ config }) => {
30521
30447
  /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-2xl font-bold text-slate-900 mb-2", children: "Your Insurance Health Score Results" }),
30522
30448
  /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-slate-600", children: "Assessment results and category breakdown" })
30523
30449
  ] }),
30524
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-1 lg:grid-cols-5 gap-8", children: [
30525
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "lg:col-span-3 flex flex-col items-center space-y-4", children: [
30450
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-1 md:grid-cols-6 gap-8", children: [
30451
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "md:col-span-3 flex flex-col items-center space-y-4", children: [
30526
30452
  hasAssessmentData ? /* @__PURE__ */ jsxRuntime.jsx(InsuranceHealthGauge, { score, size: 320 }) : /* @__PURE__ */ jsxRuntime.jsx(
30527
30453
  "div",
30528
30454
  {
@@ -30537,12 +30463,12 @@ const InsuranceHealthScore = ({ config }) => {
30537
30463
  ),
30538
30464
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-center" })
30539
30465
  ] }),
30540
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "lg:col-span-2 space-y-4", children: [
30466
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "md:col-span-3 space-y-4", children: [
30541
30467
  /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "font-semibold text-slate-900", children: "Security Category Scores" }),
30542
30468
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-3", children: (() => {
30543
- if (config.assessmentData && config.assessmentData.responses) {
30469
+ if (insuranceHealthData.responses) {
30544
30470
  const domains = getSecurityDomains(
30545
- config.assessmentData.responses
30471
+ insuranceHealthData.responses
30546
30472
  );
30547
30473
  return domains.map((domain, index2) => {
30548
30474
  let statusPill = "";
@@ -30588,7 +30514,7 @@ const InsuranceHealthScore = ({ config }) => {
30588
30514
  /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-2xl font-bold text-slate-900 mb-2", children: "Recommendations for Improvement" }),
30589
30515
  /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-slate-600", children: "Priority actions to enhance your insurance health score" })
30590
30516
  ] }),
30591
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-6", children: ((_a = config.recommendations) == null ? void 0 : _a.map((rec, index2) => /* @__PURE__ */ jsxRuntime.jsx(
30517
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-6", children: ((_a = clientData.recommendations) == null ? void 0 : _a.map((rec, index2) => /* @__PURE__ */ jsxRuntime.jsx(
30592
30518
  "div",
30593
30519
  {
30594
30520
  className: "bg-white border border-slate-200 rounded-lg p-6",
@@ -30697,22 +30623,18 @@ const InsuranceHealthScore = ({ config }) => {
30697
30623
  /* @__PURE__ */ jsxRuntime.jsxs("ul", { className: "text-sm text-slate-700 space-y-1", children: [
30698
30624
  /* @__PURE__ */ jsxRuntime.jsxs("li", { children: [
30699
30625
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium text-green-600", children: "750-850:" }),
30700
- " ",
30701
30626
  "Excellent - Premium discounts available"
30702
30627
  ] }),
30703
30628
  /* @__PURE__ */ jsxRuntime.jsxs("li", { children: [
30704
30629
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium text-blue-600", children: "650-749:" }),
30705
- " ",
30706
30630
  "Good - Standard coverage available"
30707
30631
  ] }),
30708
30632
  /* @__PURE__ */ jsxRuntime.jsxs("li", { children: [
30709
30633
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium text-yellow-600", children: "550-649:" }),
30710
- " ",
30711
30634
  "Fair - Limited coverage options"
30712
30635
  ] }),
30713
30636
  /* @__PURE__ */ jsxRuntime.jsxs("li", { children: [
30714
30637
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium text-red-600", children: "Below 550:" }),
30715
- " ",
30716
30638
  "Poor - Coverage may be denied"
30717
30639
  ] })
30718
30640
  ] })
@@ -30803,35 +30725,32 @@ const InsuranceHealthScore = ({ config }) => {
30803
30725
  ] })
30804
30726
  ] });
30805
30727
  };
30806
- const ReportMatrix = {
30807
- "financial-impact": FinancialImpact,
30808
- "breach-likelihood": BreachLikelihood,
30809
- "insurance-health-score": InsuranceHealthScore
30810
- };
30811
- const ReportBuilder = ({ clientId, config }) => {
30728
+ const ReportBuilder = ({
30729
+ clientData,
30730
+ assessmentData,
30731
+ simulationData,
30732
+ mspCompanyName,
30733
+ user
30734
+ }) => {
30812
30735
  const [searchParams] = reactRouterDom.useSearchParams();
30813
30736
  const reportTemplate = searchParams.get("template");
30814
30737
  const templateArray = (reportTemplate == null ? void 0 : reportTemplate.split(",").map((item) => item.trim())) || [];
30815
- const unifiedData = transformToUnifiedData(
30816
- {
30817
- companyName: config.mspCompanyName || "Your MSP Company",
30818
- clientName: config.clientCompanyName || "Client Company",
30819
- reportTitle: "Cyber Financial Impact Analysis",
30820
- executiveSummary: config.executiveSummary || "This report provides a comprehensive analysis of the potential financial impact of cybersecurity threats on your organization.",
30821
- generatedDate: (/* @__PURE__ */ new Date()).toLocaleDateString()
30822
- },
30823
- null,
30824
- ""
30738
+ const showFinancialImpact = templateArray.includes("financial-impact");
30739
+ const showBreachLikelihood = templateArray.includes("breach-likelihood");
30740
+ const showInsuranceHealthScore = templateArray.includes(
30741
+ "insurance-health-score"
30825
30742
  );
30743
+ const securityAssessment = assessmentData.securityAssessments;
30744
+ const insuranceHealthData = assessmentData.insuranceAssessment;
30745
+ const financialSimulationData = simulationData;
30826
30746
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
30827
- !clientId && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "max-w-4xl mx-auto bg-white p-8 flex items-center justify-center min-h-[600px]", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-center space-y-4", children: [
30747
+ !clientData.id && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "max-w-4xl mx-auto bg-white p-8 flex items-center justify-center min-h-[600px]", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-center space-y-4", children: [
30828
30748
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-16 h-16 bg-slate-100 rounded-full flex items-center justify-center mx-auto", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.FileText, { className: "w-8 h-8 text-slate-400" }) }),
30829
30749
  /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-xl font-semibold text-slate-700", children: "Please Select a Client" }),
30830
30750
  /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-slate-500 max-w-md", children: "Choose a client from the dropdown above to generate and preview their cyber financial impact analysis report." })
30831
30751
  ] }) }),
30832
30752
  /* @__PURE__ */ jsxRuntime.jsx("nav", { children: /* @__PURE__ */ jsxRuntime.jsx("ul", { className: "report-toc max-w-4xl mx-auto bg-white p-4 flex space-x-4 overflow-x-auto", children: !!(templateArray.length > 1) && templateArray.map((item) => {
30833
- const Component = ReportMatrix[item];
30834
- return Component ? /* @__PURE__ */ jsxRuntime.jsx("li", { children: /* @__PURE__ */ jsxRuntime.jsx(
30753
+ return /* @__PURE__ */ jsxRuntime.jsx("li", { children: /* @__PURE__ */ jsxRuntime.jsx(
30835
30754
  "a",
30836
30755
  {
30837
30756
  href: `#${item}`,
@@ -30840,7 +30759,7 @@ const ReportBuilder = ({ clientId, config }) => {
30840
30759
  (word) => word.charAt(0).toUpperCase() + word.slice(1)
30841
30760
  ).join(" ")
30842
30761
  }
30843
- ) }, item) : null;
30762
+ ) }, item);
30844
30763
  }) }) }),
30845
30764
  /* @__PURE__ */ jsxRuntime.jsxs(
30846
30765
  "article",
@@ -30848,10 +30767,10 @@ const ReportBuilder = ({ clientId, config }) => {
30848
30767
  id: "print-report",
30849
30768
  className: "report-wrapper max-w-4xl mx-auto bg-white p-8 space-y-8",
30850
30769
  children: [
30851
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mx-auto w-20 h-20 bg-slate-200 rounded-lg flex items-center justify-center", children: config.mspLogoBase64 ? /* @__PURE__ */ jsxRuntime.jsx(
30770
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mx-auto w-20 h-20 bg-slate-200 rounded-lg flex items-center justify-center", children: clientData.logo ? /* @__PURE__ */ jsxRuntime.jsx(
30852
30771
  "img",
30853
30772
  {
30854
- src: config.mspLogoBase64,
30773
+ src: clientData.logo,
30855
30774
  alt: "MSP Logo",
30856
30775
  className: "w-full h-full object-contain rounded-lg"
30857
30776
  }
@@ -30859,32 +30778,51 @@ const ReportBuilder = ({ clientId, config }) => {
30859
30778
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "max-w-md mx-auto bg-slate-50 rounded-lg p-6 space-y-3", children: [
30860
30779
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-between", children: [
30861
30780
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium text-slate-700", children: "Prepared For:" }),
30862
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-slate-900", children: config.clientCompanyName || "Client Company" })
30781
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-slate-900", children: clientData.company_name || "Client Company" })
30863
30782
  ] }),
30864
30783
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-between", children: [
30865
30784
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium text-slate-700", children: "Industry Sector:" }),
30866
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-slate-900", children: config.clientIndustry || "Industry" })
30785
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-slate-900", children: clientData.industry || "Industry" })
30867
30786
  ] }),
30868
30787
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-between", children: [
30869
30788
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium text-slate-700", children: "Prepared By:" }),
30870
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-slate-900", children: config.mspCompanyName || "MSP Company" })
30789
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-slate-900", children: mspCompanyName || /* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: "red", fontWeight: "bold" }, children: "NEEDS ACTUAL MSP NAME" }) })
30871
30790
  ] }),
30872
30791
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-between", children: [
30873
30792
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium text-slate-700", children: "Assessment Date:" }),
30874
30793
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-slate-900", children: (/* @__PURE__ */ new Date()).toLocaleDateString() })
30875
30794
  ] })
30876
30795
  ] }),
30877
- templateArray.map((item) => {
30878
- const Component = ReportMatrix[item];
30879
- return Component ? /* @__PURE__ */ jsxRuntime.jsx(Component, { unifiedData, config }, item) : null;
30880
- }),
30796
+ showFinancialImpact && /* @__PURE__ */ jsxRuntime.jsx(
30797
+ FinancialImpact,
30798
+ {
30799
+ reportData: {
30800
+ clientData,
30801
+ simulationData: financialSimulationData,
30802
+ user
30803
+ }
30804
+ }
30805
+ ),
30806
+ showBreachLikelihood && /* @__PURE__ */ jsxRuntime.jsx(
30807
+ BreachLikelihood,
30808
+ {
30809
+ reportData: { clientData, securityAssessment, user }
30810
+ }
30811
+ ),
30812
+ showInsuranceHealthScore && /* @__PURE__ */ jsxRuntime.jsx(
30813
+ InsuranceHealthScore,
30814
+ {
30815
+ reportData: { clientData, insuranceHealthData }
30816
+ }
30817
+ ),
30881
30818
  /* @__PURE__ */ jsxRuntime.jsxs("footer", { className: "report-page text-center pt-8 border-t border-slate-200", children: [
30882
30819
  /* @__PURE__ */ jsxRuntime.jsx("h4", { children: "Professional Recommendation" }),
30883
30820
  /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-slate-500", children: "This assessment combines financial impact modeling, insurance readiness evaluation, and breach likelihood analysis to provide a complete view of your organization's cybersecurity risk profile." }),
30884
30821
  /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-xs text-slate-400 mt-2", children: [
30885
- "Generated by ",
30886
- config.mspCompanyName,
30887
- " on ",
30822
+ "Generated by",
30823
+ " ",
30824
+ mspCompanyName ? mspCompanyName : /* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: "red", fontWeight: "bold" }, children: "NEEDS ACTUAL MSP NAME" }),
30825
+ " on ",
30888
30826
  (/* @__PURE__ */ new Date()).toLocaleDateString()
30889
30827
  ] })
30890
30828
  ] })