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11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493

// Threat Intelligence Vendor Data
const vendors = [
    {
        id: 'abuse-ch',
        name: 'abuse.ch',
        logo: 'http://static.photos/technology/200x200/1',
        description: 'Malware and botnet tracking platform',
        features: ['Malware Tracking', 'Botnet Monitoring', 'IOC Feeds', 'Threat Intelligence'],
        pricing: 'Freemium',
        coverage: ['Network', 'Malware', 'Botnet'],
        integrations: ['SIEM', 'Firewalls', 'EDR'],
        freeTrial: true,
        rating: 4.3
    },
    {
        id: 'anomali',
        name: 'Anomali',
        logo: 'http://static.photos/technology/200x200/2',
        description: 'Enterprise threat intelligence platform',
        features: ['Threat Intelligence', 'Threat Hunting', 'SIEM Integration', 'Automation'],
        pricing: 'Enterprise',
        coverage: ['Network', 'Endpoint', 'Cloud'],
        integrations: ['SIEM', 'Firewalls', 'EDR'],
        freeTrial: false,
        rating: 4.2
    },
    {
        id: 'arctic-wolf',
        name: 'Arctic Wolf Networks',
        logo: 'http://static.photos/technology/200x200/3',
        description: 'Security operations and threat intelligence',
        features: ['Managed Detection', 'Threat Intelligence', 'Vulnerability Management', 'Cloud Monitoring'],
        pricing: 'Subscription-based',
        coverage: ['Network', 'Endpoint', 'Cloud'],
        integrations: ['SIEM', 'SOAR', 'EDR'],
        freeTrial: true,
        rating: 4.5
    },
    {
        id: 'bitdefender',
        name: 'Bitdefender',
        logo: 'http://static.photos/technology/200x200/4',
        description: 'Endpoint protection with threat intelligence',
        features: ['Endpoint Security', 'Threat Intelligence', 'Network Security', 'Cloud Security'],
        pricing: 'Subscription-based',
        coverage: ['Endpoint', 'Network', 'Cloud'],
        integrations: ['SIEM', 'SOAR', 'EDR'],
        freeTrial: true,
        rating: 4.6
    },
    {
        id: 'bitsight',
        name: 'Bitsight',
        logo: 'http://static.photos/technology/200x200/5',
        description: 'Security ratings and risk intelligence',
        features: ['Risk Assessment', 'Threat Intelligence', 'Third-Party Risk', 'Compliance'],
        pricing: 'Enterprise',
        coverage: ['Network', 'Web', 'Third-Party'],
        integrations: ['SIEM', 'GRC', 'SOAR'],
        freeTrial: false,
        rating: 4.4
    },
    {
        id: 'blocklist-de',
        name: 'Blocklist.de',
        logo: 'http://static.photos/technology/200x200/6',
        description: 'Community-based IP blocklist',
        features: ['IP Blocklist', 'Brute Force Protection', 'Attack Logs', 'Community Data'],
        pricing: 'Free',
        coverage: ['Network', 'IP Reputation'],
        integrations: ['Firewalls', 'IDS/IPS', 'SIEM'],
        freeTrial: true,
        rating: 4.0
    },
{
        id: 'mandiant',
        name: 'Mandiant Threat Intelligence',
        logo: 'http://static.photos/technology/200x200/3',
        description: 'Expert-led threat intelligence services',
        features: ['Incident Response', 'Threat Intelligence', 'Malware Analysis', 'Vulnerability Research'],
        pricing: 'Enterprise',
        coverage: ['Network', 'Endpoint', 'Cloud'],
        integrations: ['Firewalls', 'SIEM', 'EDR'],
        freeTrial: false,
        rating: 4.7
    },
    {
        id: 'palo-alto',
        name: 'Palo Alto Unit 42',
        logo: 'http://static.photos/technology/200x200/4',
        description: 'Integrated threat intelligence with next-gen firewalls',
        features: ['Network Security', 'Cloud Security', 'Threat Intelligence', 'Automated Response'],
        pricing: 'Bundled with Products',
        coverage: ['Network', 'Cloud', 'Endpoint'],
        integrations: ['Firewalls', 'Cortex XSOAR', 'SIEM'],
        freeTrial: true,
        rating: 4.5
    },
    {
        id: 'fireeye',
        name: 'FireEye Threat Intelligence',
        logo: 'http://static.photos/technology/200x200/5',
        description: 'Comprehensive threat intelligence and analysis',
        features: ['Malware Analysis', 'Threat Intelligence', 'Incident Response', 'Vulnerability Research'],
        pricing: 'Enterprise',
        coverage: ['Network', 'Endpoint', 'Email'],
        integrations: ['SIEM', 'EDR', 'SOAR'],
        freeTrial: false,
        rating: 4.4
    },
    {
        id: 'anomali',
        name: 'Anomali ThreatStream',
        logo: 'http://static.photos/technology/200x200/6',
        description: 'Threat intelligence platform for security operations',
        features: ['Threat Intelligence', 'Threat Hunting', 'SIEM Integration', 'Automation'],
        pricing: 'Subscription-based',
        coverage: ['Network', 'Endpoint', 'Cloud'],
        integrations: ['SIEM', 'Firewalls', 'EDR'],
        freeTrial: true,
        rating: 4.3
    },
    {
        id: 'flashpoint',
        name: 'Flashpoint Intelligence',
        logo: 'http://static.photos/technology/200x200/7',
        description: 'Business risk intelligence from the deep and dark web',
        features: ['Dark Web Monitoring', 'Vulnerability Intelligence', 'Brand Protection', 'Fraud Detection'],
        pricing: 'Enterprise',
        coverage: ['Dark Web', 'Web', 'Network'],
        integrations: ['SIEM', 'SOAR', 'TIPS'],
        freeTrial: false,
        rating: 4.5
    },
    {
        id: 'threatconnect',
        name: 'ThreatConnect',
        logo: 'http://static.photos/technology/200x200/8',
        description: 'Threat intelligence platform (TIP) with automation',
        features: ['Threat Intelligence', 'Analytics', 'Automation', 'Collaboration'],
        pricing: 'Subscription-based',
        coverage: ['Network', 'Endpoint', 'Cloud'],
        integrations: ['SIEM', 'SOAR', 'EDR'],
        freeTrial: true,
        rating: 4.2
    },
    {
        id: 'alienvault',
        name: 'AT&T Alien Labs',
        logo: 'http://static.photos/technology/200x200/9',
        description: 'Open threat intelligence community and platform',
        features: ['Threat Intelligence', 'USM Platform', 'Open Source', 'Community'],
        pricing: 'Freemium',
        coverage: ['Network', 'Endpoint', 'Cloud'],
        integrations: ['SIEM', 'USM', 'OSSIM'],
        freeTrial: true,
        rating: 4.0
    },
    {
        id: 'wiz',
        name: 'Wiz',
        logo: 'http://static.photos/technology/200x200/50',
        description: 'Cloud security and threat intelligence',
        features: ['Cloud Security', 'Threat Detection', 'Vulnerability Management', 'Compliance'],
        pricing: 'Subscription-based',
        coverage: ['Cloud', 'Container', 'Serverless'],
        integrations: ['SIEM', 'SOAR', 'CSPM'],
        freeTrial: true,
        rating: 4.7
    },
    {
        id: 'withsecure',
        name: 'WithSecure',
        logo: 'http://static.photos/technology/200x200/51',
        description: 'Endpoint protection and threat intelligence',
        features: ['Endpoint Security', 'Threat Intelligence', 'EDR', 'XDR'],
        pricing: 'Subscription-based',
        coverage: ['Endpoint', 'Network', 'Cloud'],
        integrations: ['SIEM', 'SOAR', 'EDR'],
        freeTrial: true,
        rating: 4.5
    },
    {
        id: 'yeti',
        name: 'Yeti',
        logo: 'http://static.photos/technology/200x200/52',
        description: 'Open-source threat intelligence platform',
        features: ['Threat Intelligence', 'Malware Analysis', 'IOC Management', 'Collaboration'],
        pricing: 'Open Source',
        coverage: ['Network', 'Endpoint', 'Malware'],
        integrations: ['SIEM', 'SOAR', 'MISP'],
        freeTrial: true,
        rating: 4.2
    },
    {
        id: 'zerofox',
        name: 'ZeroFOX',
        logo: 'http://static.photos/technology/200x200/53',
        description: 'Digital risk protection platform',
        features: ['Social Media Protection', 'Threat Intelligence', 'Brand Protection', 'Fraud Detection'],
        pricing: 'Enterprise',
        coverage: ['Social Media', 'Web', 'Dark Web'],
        integrations: ['SIEM', 'SOAR', 'TIPS'],
        freeTrial: false,
        rating: 4.4
    }
];

// Sort vendors alphabetically by name
vendors.sort((a, b) => a.name.localeCompare(b.name));
// Selected vendors for comparison
let selectedVendors = [];

// DOM elements
const vendorGrid = document.getElementById('vendor-grid');
const comparisonBody = document.getElementById('comparison-body');
const compareBtn = document.getElementById('compare-btn');
const clearBtn = document.getElementById('clear-btn');
const vendorModal = document.getElementById('vendor-modal');
const closeModal = document.getElementById('close-modal');
const modalTitle = document.getElementById('modal-title');
const modalContent = document.getElementById('modal-content');

// Initialize the page
document.addEventListener('DOMContentLoaded', () => {
    renderVendorGrid();
    setupEventListeners();
});

// Render all vendors in the grid
function renderVendorGrid() {
    vendorGrid.innerHTML = '';
    
    vendors.forEach(vendor => {
        const isSelected = selectedVendors.includes(vendor.id);
        
        const card = document.createElement('div');
        card.className = `vendor-card bg-white rounded-xl shadow-md overflow-hidden ${isSelected ? 'ring-2 ring-indigo-500' : ''}`;
        card.innerHTML = `
            <div class="p-6">
                <div class="flex items-center mb-4">
                    <img src="${vendor.logo}" alt="${vendor.name}" class="w-12 h-12 rounded-full object-cover mr-4">
                    <div>
                        <h3 class="font-bold text-lg">${vendor.name}</h3>
                        <div class="flex items-center">
                            <div class="flex text-yellow-400 mr-2">
                                ${renderStars(vendor.rating)}
                            </div>
                            <span class="text-gray-600 text-sm">${vendor.rating}</span>
                        </div>
                    </div>
                </div>
                <p class="text-gray-600 mb-4">${vendor.description}</p>
                <div class="flex flex-wrap mb-4">
                    ${vendor.features.map(feature => `
                        <span class="feature-badge bg-indigo-100 text-indigo-800">${feature}</span>
                    `).join('')}
                </div>
                <div class="flex justify-between items-center">
                    <button data-vendor-id="${vendor.id}" class="view-details-btn text-indigo-600 hover:text-indigo-800 font-medium flex items-center">
                        <i data-feather="info" class="w-4 h-4 mr-1"></i> Details
                    </button>
                    <button data-vendor-id="${vendor.id}" class="compare-btn ${isSelected ? 'bg-red-500 hover:bg-red-600' : 'bg-indigo-600 hover:bg-indigo-700'} text-white font-medium py-1 px-3 rounded-full text-sm flex items-center transition-colors">
                        <i data-feather="${isSelected ? 'x' : 'plus'}" class="w-4 h-4 mr-1"></i>
                        ${isSelected ? 'Remove' : 'Compare'}
                    </button>
                </div>
            </div>
        `;
        
        vendorGrid.appendChild(card);
    });
    
    feather.replace();
}

// Render stars based on rating
function renderStars(rating) {
    const fullStars = Math.floor(rating);
    const hasHalfStar = rating % 1 >= 0.5;
    let stars = '';
    
    for (let i = 0; i < fullStars; i++) {
        stars += '<i data-feather="star" class="w-4 h-4 fill-current"></i>';
    }
    
    if (hasHalfStar) {
        stars += '<i data-feather="star" class="w-4 h-4 fill-current" fill="url(#half-star)"></i>';
    }
    
    const emptyStars = 5 - fullStars - (hasHalfStar ? 1 : 0);
    for (let i = 0; i < emptyStars; i++) {
        stars += '<i data-feather="star" class="w-4 h-4"></i>';
    }
    
    return stars;
}

// Set up event listeners
function setupEventListeners() {
    // Compare button click
    compareBtn.addEventListener('click', () => {
        if (selectedVendors.length < 2) {
            alert('Please select at least 2 vendors to compare');
            return;
        }
        
        renderComparisonTable();
        document.getElementById('comparison').scrollIntoView({ behavior: 'smooth' });
    });
    
    // Clear comparison button
    clearBtn.addEventListener('click', () => {
        selectedVendors = [];
        renderVendorGrid();
        comparisonBody.innerHTML = '';
    });
    
    // Close modal button
    closeModal.addEventListener('click', () => {
        vendorModal.classList.add('hidden');
    });
    
    // Vendor grid event delegation
    vendorGrid.addEventListener('click', (e) => {
        const compareBtn = e.target.closest('.compare-btn');
        const detailsBtn = e.target.closest('.view-details-btn');
        
        if (compareBtn) {
            const vendorId = compareBtn.getAttribute('data-vendor-id');
            toggleVendorSelection(vendorId);
        }
        
        if (detailsBtn) {
            const vendorId = detailsBtn.getAttribute('data-vendor-id');
            showVendorDetails(vendorId);
        }
    });
}

// Toggle vendor selection for comparison
function toggleVendorSelection(vendorId) {
    const index = selectedVendors.indexOf(vendorId);
    
    if (index === -1) {
        selectedVendors.push(vendorId);
    } else {
        selectedVendors.splice(index, 1);
    }
    
    renderVendorGrid();
}

// Show vendor details in modal
function showVendorDetails(vendorId) {
    const vendor = vendors.find(v => v.id === vendorId);
    
    if (!vendor) return;
    
    modalTitle.textContent = vendor.name;
    
    modalContent.innerHTML = `
        <div class="flex items-start mb-6">
            <img src="${vendor.logo}" alt="${vendor.name}" class="w-20 h-20 rounded-full object-cover mr-6">
            <div>
                <div class="flex items-center mb-2">
                    <div class="flex text-yellow-400 mr-2">
                        ${renderStars(vendor.rating)}
                    </div>
                    <span class="text-gray-600">${vendor.rating}/5.0</span>
                </div>
                <p class="text-gray-700">${vendor.description}</p>
            </div>
        </div>
        
        <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
            <div>
                <h4 class="font-bold text-lg mb-3">Features</h4>
                <ul class="space-y-2">
                    ${vendor.features.map(feature => `
                        <li class="flex items-center">
                            <i data-feather="check" class="w-4 h-4 text-green-500 mr-2"></i>
                            <span>${feature}</span>
                        </li>
                    `).join('')}
                </ul>
            </div>
            
            <div>
                <h4 class="font-bold text-lg mb-3">Coverage</h4>
                <div class="flex flex-wrap gap-2">
                    ${vendor.coverage.map(cov => `
                        <span class="px-3 py-1 bg-emerald-100 text-emerald-800 rounded-full text-sm">${cov}</span>
                    `).join('')}
                </div>
                
                <h4 class="font-bold text-lg mt-4 mb-3">Integrations</h4>
                <div class="flex flex-wrap gap-2">
                    ${vendor.integrations.map(int => `
                        <span class="px-3 py-1 bg-blue-100 text-blue-800 rounded-full text-sm">${int}</span>
                    `).join('')}
                </div>
                
                <div class="mt-4 p-4 bg-gray-50 rounded-lg">
                    <p class="font-medium">Pricing: <span class="text-gray-700">${vendor.pricing}</span></p>
                    <p class="font-medium mt-2">Free Trial: <span class="text-gray-700">${vendor.freeTrial ? 'Yes' : 'No'}</span></p>
                </div>
            </div>
        </div>
    `;
    
    feather.replace();
    vendorModal.classList.remove('hidden');
}

// Render the comparison table
function renderComparisonTable() {
    const selected = vendors.filter(v => selectedVendors.includes(v.id));
    
    if (selected.length < 2) {
        comparisonBody.innerHTML = '<tr><td colspan="100%" class="text-center py-4">Please select at least 2 vendors to compare</td></tr>';
        return;
    }
    
    // Clear previous content
    comparisonBody.innerHTML = '';
    
    // Update table headers
    const headerRow = document.querySelector('#comparison thead tr');
    headerRow.innerHTML = '<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Feature</th>';
    
    selected.forEach(vendor => {
        headerRow.innerHTML += `
            <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
                <div class="flex items-center">
                    <img src="${vendor.logo}" alt="${vendor.name}" class="w-8 h-8 rounded-full mr-2">
                    ${vendor.name}
                </div>
            </th>
        `;
    });
    
    // Comparison categories
    const categories = [
        { name: 'Features', key: 'features', type: 'list' },
        { name: 'Coverage', key: 'coverage', type: 'list' },
        { name: 'Integrations', key: 'integrations', type: 'list' },
        { name: 'Pricing Model', key: 'pricing', type: 'text' },
        { name: 'Free Trial', key: 'freeTrial', type: 'boolean' },
        { name: 'Rating', key: 'rating', type: 'rating' }
    ];
    
    // Add rows for each comparison category
    categories.forEach(category => {
        const row = document.createElement('tr');
        row.innerHTML = `<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">${category.name}</td>`;
        
        selected.forEach(vendor => {
            const value = vendor[category.key];
            
            let cellContent = '';
            if (category.type === 'list') {
                cellContent = value.map(item => `
                    <span class="inline-block bg-gray-100 rounded-full px-3 py-1 text-sm font-medium text-gray-700 mr-1 mb-1">
                        ${item}
                    </span>
                `).join('');
            } else if (category.type === 'boolean') {
                cellContent = value ? 
                    '<span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-green-100 text-green-800">Yes</span>' :
                    '<span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-red-100 text-red-800">No</span>';
            } else if (category.type === 'rating') {
                cellContent = `
                    <div class="flex items-center">
                        <div class="flex text-yellow-400 mr-2">
                            ${renderStars(value)}
                        </div>
                        <span class="text-gray-600">${value}</span>
                    </div>
                `;
            } else {
                cellContent = `<span class="text-gray-700">${value}</span>`;
            }
            
            row.innerHTML += `<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${cellContent}</td>`;
        });
        
        comparisonBody.appendChild(row);
    });
    
    feather.replace();
}