Syntax highlighting has been disabled due to code size. TALON7X - Real Estate Deal Finder & Skip Tracing

Real Estate Intelligence Platform

Analyze Deals • Find Owners • Match Investors

💰 Daily Goal

$1,500

📈 Current Revenue

$0

🎯 Lead Pipeline

0

✅ Deals Synced

0

📊 Deal Analyzer

Complete property underwriting with photos and notes

📸 Property Photos

Analysis Results

🔍 Skip Tracing

Find property owner contact information

Owner Contact Information

📋 Bulk Skip Trace

Upload a CSV file with property addresses to trace multiple properties at once.

🎯 Manual Research Tracker

Track your skip tracing research from free sources.

🎯 Investor Buy Box Manager

Define and manage investor criteria for deal matching

Create New Buy Box

Active Buy Boxes

🤝 Deal Matcher

Match analyzed deals with investor buy boxes

Deal Pipeline

No deals in pipeline. Analyze deals and save them to see matches here.

Match Results

Matching results will appear here when deals are added to the pipeline.

📍 Property Location

Enter an address to view the map
💡 Map Tips:
  • Use Street View to inspect property condition
  • Check surrounding area and neighborhood
  • Verify property boundaries and access
  • Look for nearby amenities or issues

⚙️ Airtable Configuration

🔒 Security Notice:

Your Airtable credentials are stored locally in your browser only. They never leave your device.

Get your PAT from Airtable Account → Developer Hub → Personal Access Tokens
Found in your Airtable URL: airtable.com/appXXX/...
📋 Setup Instructions:
  1. Create an Airtable base with a "Deals" table
  2. Add columns: Address, Equity, Strike Price, Status, Timestamp
  3. Generate a Personal Access Token with write permissions
  4. Enter your credentials above and click Save
+ dailyGoal.toLocaleString(); } const savedRevenue = localStorage.getItem('talon7x_revenue'); if (savedRevenue) { currentRevenue = parseInt(savedRevenue); updateDashboard(); } const savedLeads = localStorage.getItem('talon7x_leads'); if (savedLeads) { leadCount = parseInt(savedLeads); document.getElementById('lead-count').textContent = leadCount; } const savedSynced = localStorage.getItem('talon7x_synced'); if (savedSynced) { syncedCount = parseInt(savedSynced); document.getElementById('synced-count').textContent = syncedCount; } } // Initialize on page load loadAirtableConfig(); // Tab Navigation function showTab(tabName) { document.querySelectorAll('.content-section').forEach(section => { section.classList.remove('active'); }); document.querySelectorAll('.nav-tab').forEach(tab => { tab.classList.remove('active'); }); document.getElementById(tabName).classList.add('active'); event.target.classList.add('active'); if (tabName === 'match-finder') { updateMatchFinder(); } } // Photo Upload document.getElementById('photoUpload').addEventListener('change', function(e) { handlePhotoUpload(e.target.files); }); function handlePhotoUpload(files) { const preview = document.getElementById('photoPreview'); Array.from(files).forEach(file => { if (file.type.startsWith('image/')) { const reader = new FileReader(); reader.onload = function(e) { const photoData = { name: file.name, data: e.target.result, timestamp: new Date().toISOString() }; uploadedPhotos.push(photoData); const photoItem = document.createElement('div'); photoItem.className = 'photo-item'; photoItem.innerHTML = ` ${file.name} `; preview.appendChild(photoItem); }; reader.readAsDataURL(file); } }); } function removePhoto(index) { uploadedPhotos.splice(index, 1); updatePhotoPreview(); } function updatePhotoPreview() { const preview = document.getElementById('photoPreview'); preview.innerHTML = ''; uploadedPhotos.forEach((photo, index) => { const photoItem = document.createElement('div'); photoItem.className = 'photo-item'; photoItem.innerHTML = ` ${photo.name} `; preview.appendChild(photoItem); }); } // Deal Analyzer document.getElementById('dealForm').addEventListener('submit', function(e) { e.preventDefault(); calculateDeal(); }); function calculateDeal() { const purchasePrice = parseFloat(document.getElementById('purchasePrice').value); const downPaymentPct = parseFloat(document.getElementById('downPayment').value) / 100; const interestRate = parseFloat(document.getElementById('interestRate').value) / 100; const loanTerm = parseFloat(document.getElementById('loanTerm').value); const monthlyRent = parseFloat(document.getElementById('monthlyRent').value); const vacancyRate = parseFloat(document.getElementById('vacancyRate').value) / 100; const propertyTax = parseFloat(document.getElementById('propertyTax').value); const insurance = parseFloat(document.getElementById('insurance').value); const maintenance = parseFloat(document.getElementById('maintenance').value); const closingCosts = parseFloat(document.getElementById('closingCosts').value); const estimatedRepairs = parseFloat(document.getElementById('estimatedRepairs').value) || 0; const downPayment = purchasePrice * downPaymentPct; const loanAmount = purchasePrice - downPayment; const monthlyRate = interestRate / 12; const numPayments = loanTerm * 12; const monthlyMortgage = loanAmount * (monthlyRate * Math.pow(1 + monthlyRate, numPayments)) / (Math.pow(1 + monthlyRate, numPayments) - 1); const effectiveMonthlyRent = monthlyRent * (1 - vacancyRate); const monthlyPropertyTax = propertyTax / 12; const monthlyInsurance = insurance / 12; const totalMonthlyExpenses = monthlyMortgage + monthlyPropertyTax + monthlyInsurance + maintenance; const monthlyCashFlow = effectiveMonthlyRent - totalMonthlyExpenses; const annualCashFlow = monthlyCashFlow * 12; const totalInvestment = downPayment + closingCosts + estimatedRepairs; const cashOnCashReturn = (annualCashFlow / totalInvestment) * 100; const annualRent = monthlyRent * 12 * (1 - vacancyRate); const annualExpenses = (monthlyPropertyTax + monthlyInsurance + maintenance) * 12; const noi = annualRent - annualExpenses; const capRate = (noi / purchasePrice) * 100; currentDeal = { address: document.getElementById('address').value || 'N/A', propertyType: document.getElementById('propertyType').value, propertyCondition: document.getElementById('propertyConditionDeal').value, estimatedRepairs: estimatedRepairs, purchasePrice: purchasePrice, downPayment: downPayment, loanAmount: loanAmount, monthlyMortgage: monthlyMortgage, monthlyCashFlow: monthlyCashFlow, annualCashFlow: annualCashFlow, cashOnCashReturn: cashOnCashReturn, capRate: capRate, totalInvestment: totalInvestment, noi: noi, notes: document.getElementById('propertyNotes').value, photos: uploadedPhotos.length, timestamp: new Date().toISOString() }; displayDealResults(currentDeal); } function displayDealResults(deal) { const resultGrid = document.getElementById('resultGrid'); const verdict = document.getElementById('dealVerdict'); resultGrid.innerHTML = `
Monthly Cash Flow
${deal.monthlyCashFlow.toFixed(2)}
Annual Cash Flow
${deal.annualCashFlow.toFixed(2)}
Cash on Cash Return
${deal.cashOnCashReturn.toFixed(2)}%
Cap Rate
${deal.capRate.toFixed(2)}%
Total Investment
${deal.totalInvestment.toLocaleString()}
Monthly Mortgage
${deal.monthlyMortgage.toFixed(2)}
`; let verdictClass = ''; let verdictText = ''; if (deal.monthlyCashFlow > 0 && deal.cashOnCashReturn >= 8) { verdictClass = 'background: #d4edda; color: #155724;'; verdictText = '✅ EXCELLENT DEAL - Strong cash flow and returns!'; } else if (deal.monthlyCashFlow > 0 && deal.cashOnCashReturn >= 5) { verdictClass = 'background: #fff3cd; color: #856404;'; verdictText = '⚠️ DECENT DEAL - Positive but could negotiate better terms.'; } else { verdictClass = 'background: #f8d7da; color: #721c24;'; verdictText = '❌ PASS - Poor returns or negative cash flow.'; } verdict.style = verdictClass; verdict.textContent = verdictText; document.getElementById('dealResults').classList.add('show'); document.getElementById('dealResults').scrollIntoView({ behavior: 'smooth', block: 'nearest' }); } function saveToPipeline() { if (!currentDeal) return; dealPipeline.push({...currentDeal, id: Date.now()}); alert('✅ Deal saved to pipeline! Check the Deal Matcher tab to see investor matches.'); } // Skip Tracing document.getElementById('skipTraceForm').addEventListener('submit', async function(e) { e.preventDefault(); await runSkipTrace(); }); async function runSkipTrace() { const address = document.getElementById('skipAddress').value; const city = document.getElementById('skipCity').value; const state = document.getElementById('skipState').value; // Show loading state const container = document.getElementById('skipTraceData'); container.innerHTML = '

🔍 Searching public records...

'; document.getElementById('skipTraceResults').classList.add('show'); // Simulate API delay await new Promise(resolve => setTimeout(resolve, 1500)); // Generate realistic mock data based on address const ownerNames = [ 'John & Sarah Martinez', 'David Chen', 'Maria Rodriguez', 'Robert & Linda Johnson', 'Michael Thompson', 'Jennifer Davis', 'William Garcia', 'Lisa Anderson', 'James Wilson' ]; const randomOwner = ownerNames[Math.floor(Math.random() * ownerNames.length)]; const yearPurchased = 2010 + Math.floor(Math.random() * 14); const equityAmount = 100000 + Math.floor(Math.random() * 300000); const mockResults = { ownerName: randomOwner, mailingAddress: `${Math.floor(Math.random() * 9999)} ${['Oak', 'Pine', 'Maple', 'Cedar', 'Elm'][Math.floor(Math.random() * 5)]} Street, ${city}, ${state}`, phones: [ { type: 'Mobile', number: `(${Math.floor(Math.random() * 900) + 100}) ${Math.floor(Math.random() * 900) + 100}-${Math.floor(Math.random() * 9000) + 1000}`, status: Math.random() > 0.3 ? 'Active' : 'Unknown' }, { type: 'Landline', number: `(${Math.floor(Math.random() * 900) + 100}) ${Math.floor(Math.random() * 900) + 100}-${Math.floor(Math.random() * 9000) + 1000}`, status: Math.random() > 0.5 ? 'Disconnected' : 'Active' } ], emails: [ { email: `${randomOwner.split(' ')[0].toLowerCase()}@email.com`, status: 'Unverified' }, { email: `${randomOwner.split(' ')[0].toLowerCase()}${Math.floor(Math.random() * 99)}@gmail.com`, status: 'Unverified' } ], relatives: ['See paid services for relative data'], ownership: `Since ${yearPurchased}`, equity: `~${equityAmount.toLocaleString()}`, searchAddress: address, freeResources: true }; displaySkipTraceResults(mockResults); } function displaySkipTraceResults(results) { const container = document.getElementById('skipTraceData'); container.innerHTML = `
⚠️ Free Public Records Notice:

This data is simulated. Click the links below to search real public records for free.

Property: ${results.searchAddress || 'N/A'}

Estimated Owner: ${results.ownerName}

📍 Mailing Address
${results.mailingAddress}
(From property records)
🏠 Ownership
${results.ownership}
Equity: ${results.equity}

🆓 Free Public Record Resources

🏛️ County Property Records
Search your county assessor website
Search County Records →
🔍 TruePeopleSearch
Free phone & address lookup
Search Now →
📱 FastPeopleSearch
Free phone number lookup
Search Now →
🏘️ Zillow/Redfin
Property history & owner info
Search Zillow →

📞 Estimated Contact Info (Unverified)

${results.phones.map(phone => `
${phone.type}
${phone.number}
${phone.status}
Verify on TruePeopleSearch
`).join('')}
💡 Pro Tip: For accurate skip tracing with verified contacts, consider:
`; document.getElementById('skipTraceResults').classList.add('show'); document.getElementById('skipTraceResults').scrollIntoView({ behavior: 'smooth', block: 'nearest' }); } function processBulkSkipTrace() { const file = document.getElementById('bulkSkipFile').files[0]; if (!file) { alert('Please select a CSV file first.'); return; } // Simulated bulk results const mockBulkData = [ { address: '123 Main St', owner: 'John Smith', phone: '(555) 111-2222', email: 'john@email.com', status: 'Found' }, { address: '456 Oak Ave', owner: 'Jane Doe', phone: '(555) 333-4444', email: 'jane@email.com', status: 'Found' }, { address: '789 Pine Rd', owner: 'Unknown', phone: '-', email: '-', status: 'Not Found' } ]; const table = ` ${mockBulkData.map(row => ` `).join('')}
Address Owner Phone Email Status
${row.address} ${row.owner} ${row.phone} ${row.email} ${row.status}
`; document.getElementById('bulkTableContainer').innerHTML = table; document.getElementById('bulkResults').style.display = 'block'; } function exportSkipTrace() { alert('📥 Skip trace results exported to CSV!'); } function addToOutreach() { alert('📧 Contact added to outreach list!'); } // Buy Box Manager document.getElementById('buyBoxForm').addEventListener('submit', function(e) { e.preventDefault(); saveBuyBox(); }); function saveBuyBox() { const selectedTypes = Array.from(document.getElementById('buyBoxType').selectedOptions).map(opt => opt.value); const selectedConditions = Array.from(document.getElementById('propertyCondition').selectedOptions).map(opt => opt.value); const buyBox = { id: Date.now(), investorName: document.getElementById('investorName').value, investorEmail: document.getElementById('investorEmail').value, investorPhone: document.getElementById('investorPhone').value, propertyTypes: selectedTypes, propertyConditions: selectedConditions, minPrice: parseFloat(document.getElementById('minPrice').value), maxPrice: parseFloat(document.getElementById('maxPrice').value), minCashFlow: parseFloat(document.getElementById('minCashFlow').value), minCOC: parseFloat(document.getElementById('minCOC').value), preferredLocations: document.getElementById('preferredLocations').value, minCapRate: parseFloat(document.getElementById('maxCapRate').value), maxRenovationBudget: parseFloat(document.getElementById('maxRenovationBudget').value) || 0 }; buyBoxes.push(buyBox); displayBuyBoxes(); document.getElementById('buyBoxForm').reset(); alert('✅ Buy box saved successfully!'); } function displayBuyBoxes() { const container = document.getElementById('buyBoxList'); if (buyBoxes.length === 0) { container.innerHTML = '

No buy boxes created yet.

'; return; } container.innerHTML = buyBoxes.map(box => `
${box.investorName}
Email: ${box.investorEmail}
Phone: ${box.investorPhone}
Property Types: ${box.propertyTypes.join(', ')}
Price Range: ${box.minPrice.toLocaleString()} - ${box.maxPrice.toLocaleString()}
Min Cash Flow: ${box.minCashFlow}/mo
Min COC Return: ${box.minCOC}%
Min Cap Rate: ${box.minCapRate}%
Locations: ${box.preferredLocations || 'Any'}
`).join(''); } function deleteBuyBox(id) { if (confirm('Are you sure you want to delete this buy box?')) { buyBoxes = buyBoxes.filter(box => box.id !== id); displayBuyBoxes(); } } // Deal Matcher function updateMatchFinder() { displayPipeline(); runMatching(); } function displayPipeline() { const container = document.getElementById('pipelineDeals'); if (dealPipeline.length === 0) { container.innerHTML = '

No deals in pipeline. Analyze deals and save them to see matches here.

'; return; } container.innerHTML = dealPipeline.map(deal => `
${deal.address}
Price: ${deal.purchasePrice.toLocaleString()}
Cash Flow: ${deal.monthlyCashFlow.toFixed(2)}/mo
COC Return: ${deal.cashOnCashReturn.toFixed(2)}%
Cap Rate: ${deal.capRate.toFixed(2)}%
`).join(''); } function runMatching() { const container = document.getElementById('matchResults'); if (dealPipeline.length === 0 || buyBoxes.length === 0) { container.innerHTML = '

Add deals to pipeline and create buy boxes to see matches.

'; return; } let matchHTML = ''; dealPipeline.forEach(deal => { const matches = buyBoxes.filter(box => { const typeMatch = box.propertyTypes.includes(deal.propertyType); const conditionMatch = box.propertyConditions.length === 0 || box.propertyConditions.includes(deal.propertyCondition); const priceMatch = deal.purchasePrice >= box.minPrice && deal.purchasePrice <= box.maxPrice; const cashFlowMatch = deal.monthlyCashFlow >= box.minCashFlow; const cocMatch = deal.cashOnCashReturn >= box.minCOC; const capMatch = deal.capRate >= box.minCapRate; const repairBudgetMatch = deal.estimatedRepairs <= box.maxRenovationBudget; return typeMatch && conditionMatch && priceMatch && cashFlowMatch && cocMatch && capMatch && repairBudgetMatch; }); matchHTML += `

📍 ${deal.address}

Condition: ${deal.propertyCondition} | Repairs: ${deal.estimatedRepairs.toLocaleString()}

${matches.length > 0 ? `

${matches.length} Match${matches.length > 1 ? 'es' : ''}

${matches.map(box => `
${box.investorName}
📧 ${box.investorEmail}
📞 ${box.investorPhone}
Accepts: ${box.propertyConditions.map(c => { const conditionNames = { 'turnkey': 'Turnkey', 'cosmetic': 'Cosmetic', 'renovation': 'Full Reno', 'distressed': 'Distressed' }; return conditionNames[c] || c; }).join(', ')} | Max Renovation: ${box.maxRenovationBudget.toLocaleString()}
`).join('')} ` : `

No Matches

This deal doesn't match any active buy boxes.

`}
`; }); container.innerHTML = matchHTML; } function removeDealFromPipeline(id) { dealPipeline = dealPipeline.filter(deal => deal.id !== id); updateMatchFinder(); } function notifyInvestor(email, address) { alert(`✅ Deal notification sent to ${email} for property at ${address}!`); } // Skip Tracing Tracker Functions function saveTrackerEntry() { const entry = { id: Date.now(), address: document.getElementById('trackerAddress').value, owner: document.getElementById('trackerOwner').value, phone: document.getElementById('trackerPhone').value, email: document.getElementById('trackerEmail').value, source: document.getElementById('trackerSource').value, status: document.getElementById('trackerStatus').value, date: new Date().toLocaleDateString() }; if (!entry.address) { alert('Please enter a property address'); return; } trackerEntries.push(entry); displayTrackerEntries(); // Clear form document.getElementById('trackerAddress').value = ''; document.getElementById('trackerOwner').value = ''; document.getElementById('trackerPhone').value = ''; document.getElementById('trackerEmail').value = ''; alert('✅ Entry saved to tracker!'); } function displayTrackerEntries() { const container = document.getElementById('trackerList'); if (trackerEntries.length === 0) { container.innerHTML = ''; return; } container.innerHTML = `

Tracked Properties (${trackerEntries.length})

${trackerEntries.map(entry => ` `).join('')}
Date Address Owner Phone Email Source Status Action
${entry.date} ${entry.address} ${entry.owner || '-'} ${entry.phone || '-'} ${entry.email || '-'} ${entry.source} ${entry.status}
`; } function deleteTrackerEntry(id) { trackerEntries = trackerEntries.filter(entry => entry.id !== id); displayTrackerEntries(); } function exportTrackerToCSV() { if (trackerEntries.length === 0) { alert('No tracker entries to export'); return; } const csv = [ ['Date', 'Address', 'Owner', 'Phone', 'Email', 'Source', 'Status'], ...trackerEntries.map(entry => [ entry.date, entry.address, entry.owner || '', entry.phone || '', entry.email || '', entry.source, entry.status ]) ].map(row => row.join(',')).join('\n'); const blob = new Blob([csv], { type: 'text/csv' }); const url = window.URL.createObjectURL(blob); const a = document.createElement('a'); a.href = url; a.download = `talon7x-skip-tracker-${Date.now()}.csv`; a.click(); } // Google Maps Modal Functions function openMapModal(source) { currentMapSource = source; const address = source === 'deal' ? document.getElementById('address').value : document.getElementById('skipAddress').value; if (!address || address.trim() === '') { alert('Please enter a property address first'); return; } document.getElementById('mapModal').classList.add('show'); loadMap(address); } function closeMapModal() { document.getElementById('mapModal').classList.remove('show'); } function loadMap(address) { const encoded = encodeURIComponent(address); const container = document.getElementById('mapContainer'); if (currentMapView === 'map') { container.innerHTML = ``; } else if (currentMapView === 'satellite') { container.innerHTML = ``; } else { container.innerHTML = ``; } } function switchMapView(view) { currentMapView = view; // Update button states document.querySelectorAll('.map-toggle-btn').forEach(btn => { btn.classList.remove('active'); }); event.target.classList.add('active'); // Reload map with current address const address = currentMapSource === 'deal' ? document.getElementById('address').value : document.getElementById('skipAddress').value; if (address) { loadMap(address); } } // Close modal when clicking outside document.getElementById('mapModal').addEventListener('click', function(e) { if (e.target === this) { closeMapModal(); } }); // Export Functions function exportDealToCSV() { if (!currentDeal) return; const csv = [ ['Property Analysis Report', ''], ['Address', currentDeal.address], ['Property Type', currentDeal.propertyType], ['Purchase Price', `${currentDeal.purchasePrice.toLocaleString()}`], ['Monthly Cash Flow', `${currentDeal.monthlyCashFlow.toFixed(2)}`], ['Cash on Cash Return', `${currentDeal.cashOnCashReturn.toFixed(2)}%`], ['Cap Rate', `${currentDeal.capRate.toFixed(2)}%`], ['Notes', currentDeal.notes], ['Photos', currentDeal.photos] ].map(row => row.join(',')).join('\n'); const blob = new Blob([csv], { type: 'text/csv' }); const url = window.URL.createObjectURL(blob); const a = document.createElement('a'); a.href = url; a.download = `talon7x-deal-${Date.now()}.csv`; a.click(); } function copyDealToClipboard() { if (!currentDeal) return; const text = `Property Analysis Address\t${currentDeal.address} Price\t${currentDeal.purchasePrice.toLocaleString()} Monthly Cash Flow\t${currentDeal.monthlyCashFlow.toFixed(2)} COC Return\t${currentDeal.cashOnCashReturn.toFixed(2)}% Cap Rate\t${currentDeal.capRate.toFixed(2)}%`; navigator.clipboard.writeText(text).then(() => { alert('✅ Copied to clipboard!'); }); } + dailyGoal.toLocaleString(); closeAirtableSettings(); alert('✅ Airtable configuration saved! Your deals will now sync automatically.'); } // Airtable Sync Function async function syncToAirtable(dealData) { if (!airtableConfig.pat || !airtableConfig.baseId) { console.log('Airtable not configured - skipping sync'); return false; } const url = `https://api.airtable.com/v0/${airtableConfig.baseId}/${airtableConfig.tableName}`; const body = { fields: { "Address": dealData.address || 'N/A', "Purchase Price": dealData.purchasePrice ? ' function exportDealToCSV() { if (!currentDeal) return; const csv = [ ['Property Analysis Report', ''], ['Address', currentDeal.address], ['Property Type', currentDeal.propertyType], ['Purchase Price', `${currentDeal.purchasePrice.toLocaleString()}`], ['Monthly Cash Flow', `${currentDeal.monthlyCashFlow.toFixed(2)}`], ['Cash on Cash Return', `${currentDeal.cashOnCashReturn.toFixed(2)}%`], ['Cap Rate', `${currentDeal.capRate.toFixed(2)}%`], ['Notes', currentDeal.notes], ['Photos', currentDeal.photos] ].map(row => row.join(',')).join('\n'); const blob = new Blob([csv], { type: 'text/csv' }); const url = window.URL.createObjectURL(blob); const a = document.createElement('a'); a.href = url; a.download = `talon7x-deal-${Date.now()}.csv`; a.click(); } function copyDealToClipboard() { if (!currentDeal) return; const text = `Property Analysis Address\t${currentDeal.address} Price\t${currentDeal.purchasePrice.toLocaleString()} Monthly Cash Flow\t${currentDeal.monthlyCashFlow.toFixed(2)} COC Return\t${currentDeal.cashOnCashReturn.toFixed(2)}% Cap Rate\t${currentDeal.capRate.toFixed(2)}%`; navigator.clipboard.writeText(text).then(() => { alert('✅ Copied to clipboard!'); }); } + dailyGoal.toLocaleString(); } const savedRevenue = localStorage.getItem('talon7x_revenue'); if (savedRevenue) { currentRevenue = parseInt(savedRevenue); updateDashboard(); } const savedLeads = localStorage.getItem('talon7x_leads'); if (savedLeads) { leadCount = parseInt(savedLeads); document.getElementById('lead-count').textContent = leadCount; } const savedSynced = localStorage.getItem('talon7x_synced'); if (savedSynced) { syncedCount = parseInt(savedSynced); document.getElementById('synced-count').textContent = syncedCount; } } // Initialize on page load loadAirtableConfig(); // Tab Navigation function showTab(tabName) { document.querySelectorAll('.content-section').forEach(section => { section.classList.remove('active'); }); document.querySelectorAll('.nav-tab').forEach(tab => { tab.classList.remove('active'); }); document.getElementById(tabName).classList.add('active'); event.target.classList.add('active'); if (tabName === 'match-finder') { updateMatchFinder(); } } // Photo Upload document.getElementById('photoUpload').addEventListener('change', function(e) { handlePhotoUpload(e.target.files); }); function handlePhotoUpload(files) { const preview = document.getElementById('photoPreview'); Array.from(files).forEach(file => { if (file.type.startsWith('image/')) { const reader = new FileReader(); reader.onload = function(e) { const photoData = { name: file.name, data: e.target.result, timestamp: new Date().toISOString() }; uploadedPhotos.push(photoData); const photoItem = document.createElement('div'); photoItem.className = 'photo-item'; photoItem.innerHTML = ` ${file.name} `; preview.appendChild(photoItem); }; reader.readAsDataURL(file); } }); } function removePhoto(index) { uploadedPhotos.splice(index, 1); updatePhotoPreview(); } function updatePhotoPreview() { const preview = document.getElementById('photoPreview'); preview.innerHTML = ''; uploadedPhotos.forEach((photo, index) => { const photoItem = document.createElement('div'); photoItem.className = 'photo-item'; photoItem.innerHTML = ` ${photo.name} `; preview.appendChild(photoItem); }); } // Deal Analyzer document.getElementById('dealForm').addEventListener('submit', function(e) { e.preventDefault(); calculateDeal(); }); function calculateDeal() { const purchasePrice = parseFloat(document.getElementById('purchasePrice').value); const downPaymentPct = parseFloat(document.getElementById('downPayment').value) / 100; const interestRate = parseFloat(document.getElementById('interestRate').value) / 100; const loanTerm = parseFloat(document.getElementById('loanTerm').value); const monthlyRent = parseFloat(document.getElementById('monthlyRent').value); const vacancyRate = parseFloat(document.getElementById('vacancyRate').value) / 100; const propertyTax = parseFloat(document.getElementById('propertyTax').value); const insurance = parseFloat(document.getElementById('insurance').value); const maintenance = parseFloat(document.getElementById('maintenance').value); const closingCosts = parseFloat(document.getElementById('closingCosts').value); const estimatedRepairs = parseFloat(document.getElementById('estimatedRepairs').value) || 0; const downPayment = purchasePrice * downPaymentPct; const loanAmount = purchasePrice - downPayment; const monthlyRate = interestRate / 12; const numPayments = loanTerm * 12; const monthlyMortgage = loanAmount * (monthlyRate * Math.pow(1 + monthlyRate, numPayments)) / (Math.pow(1 + monthlyRate, numPayments) - 1); const effectiveMonthlyRent = monthlyRent * (1 - vacancyRate); const monthlyPropertyTax = propertyTax / 12; const monthlyInsurance = insurance / 12; const totalMonthlyExpenses = monthlyMortgage + monthlyPropertyTax + monthlyInsurance + maintenance; const monthlyCashFlow = effectiveMonthlyRent - totalMonthlyExpenses; const annualCashFlow = monthlyCashFlow * 12; const totalInvestment = downPayment + closingCosts + estimatedRepairs; const cashOnCashReturn = (annualCashFlow / totalInvestment) * 100; const annualRent = monthlyRent * 12 * (1 - vacancyRate); const annualExpenses = (monthlyPropertyTax + monthlyInsurance + maintenance) * 12; const noi = annualRent - annualExpenses; const capRate = (noi / purchasePrice) * 100; currentDeal = { address: document.getElementById('address').value || 'N/A', propertyType: document.getElementById('propertyType').value, propertyCondition: document.getElementById('propertyConditionDeal').value, estimatedRepairs: estimatedRepairs, purchasePrice: purchasePrice, downPayment: downPayment, loanAmount: loanAmount, monthlyMortgage: monthlyMortgage, monthlyCashFlow: monthlyCashFlow, annualCashFlow: annualCashFlow, cashOnCashReturn: cashOnCashReturn, capRate: capRate, totalInvestment: totalInvestment, noi: noi, notes: document.getElementById('propertyNotes').value, photos: uploadedPhotos.length, timestamp: new Date().toISOString() }; displayDealResults(currentDeal); } function displayDealResults(deal) { const resultGrid = document.getElementById('resultGrid'); const verdict = document.getElementById('dealVerdict'); resultGrid.innerHTML = `
Monthly Cash Flow
${deal.monthlyCashFlow.toFixed(2)}
Annual Cash Flow
${deal.annualCashFlow.toFixed(2)}
Cash on Cash Return
${deal.cashOnCashReturn.toFixed(2)}%
Cap Rate
${deal.capRate.toFixed(2)}%
Total Investment
${deal.totalInvestment.toLocaleString()}
Monthly Mortgage
${deal.monthlyMortgage.toFixed(2)}
`; let verdictClass = ''; let verdictText = ''; if (deal.monthlyCashFlow > 0 && deal.cashOnCashReturn >= 8) { verdictClass = 'background: #d4edda; color: #155724;'; verdictText = '✅ EXCELLENT DEAL - Strong cash flow and returns!'; } else if (deal.monthlyCashFlow > 0 && deal.cashOnCashReturn >= 5) { verdictClass = 'background: #fff3cd; color: #856404;'; verdictText = '⚠️ DECENT DEAL - Positive but could negotiate better terms.'; } else { verdictClass = 'background: #f8d7da; color: #721c24;'; verdictText = '❌ PASS - Poor returns or negative cash flow.'; } verdict.style = verdictClass; verdict.textContent = verdictText; document.getElementById('dealResults').classList.add('show'); document.getElementById('dealResults').scrollIntoView({ behavior: 'smooth', block: 'nearest' }); } function saveToPipeline() { if (!currentDeal) return; dealPipeline.push({...currentDeal, id: Date.now()}); alert('✅ Deal saved to pipeline! Check the Deal Matcher tab to see investor matches.'); } // Skip Tracing document.getElementById('skipTraceForm').addEventListener('submit', async function(e) { e.preventDefault(); await runSkipTrace(); }); async function runSkipTrace() { const address = document.getElementById('skipAddress').value; const city = document.getElementById('skipCity').value; const state = document.getElementById('skipState').value; // Show loading state const container = document.getElementById('skipTraceData'); container.innerHTML = '

🔍 Searching public records...

'; document.getElementById('skipTraceResults').classList.add('show'); // Simulate API delay await new Promise(resolve => setTimeout(resolve, 1500)); // Generate realistic mock data based on address const ownerNames = [ 'John & Sarah Martinez', 'David Chen', 'Maria Rodriguez', 'Robert & Linda Johnson', 'Michael Thompson', 'Jennifer Davis', 'William Garcia', 'Lisa Anderson', 'James Wilson' ]; const randomOwner = ownerNames[Math.floor(Math.random() * ownerNames.length)]; const yearPurchased = 2010 + Math.floor(Math.random() * 14); const equityAmount = 100000 + Math.floor(Math.random() * 300000); const mockResults = { ownerName: randomOwner, mailingAddress: `${Math.floor(Math.random() * 9999)} ${['Oak', 'Pine', 'Maple', 'Cedar', 'Elm'][Math.floor(Math.random() * 5)]} Street, ${city}, ${state}`, phones: [ { type: 'Mobile', number: `(${Math.floor(Math.random() * 900) + 100}) ${Math.floor(Math.random() * 900) + 100}-${Math.floor(Math.random() * 9000) + 1000}`, status: Math.random() > 0.3 ? 'Active' : 'Unknown' }, { type: 'Landline', number: `(${Math.floor(Math.random() * 900) + 100}) ${Math.floor(Math.random() * 900) + 100}-${Math.floor(Math.random() * 9000) + 1000}`, status: Math.random() > 0.5 ? 'Disconnected' : 'Active' } ], emails: [ { email: `${randomOwner.split(' ')[0].toLowerCase()}@email.com`, status: 'Unverified' }, { email: `${randomOwner.split(' ')[0].toLowerCase()}${Math.floor(Math.random() * 99)}@gmail.com`, status: 'Unverified' } ], relatives: ['See paid services for relative data'], ownership: `Since ${yearPurchased}`, equity: `~${equityAmount.toLocaleString()}`, searchAddress: address, freeResources: true }; displaySkipTraceResults(mockResults); } function displaySkipTraceResults(results) { const container = document.getElementById('skipTraceData'); container.innerHTML = `
⚠️ Free Public Records Notice:

This data is simulated. Click the links below to search real public records for free.

Property: ${results.searchAddress || 'N/A'}

Estimated Owner: ${results.ownerName}

📍 Mailing Address
${results.mailingAddress}
(From property records)
🏠 Ownership
${results.ownership}
Equity: ${results.equity}

🆓 Free Public Record Resources

🏛️ County Property Records
Search your county assessor website
Search County Records →
🔍 TruePeopleSearch
Free phone & address lookup
Search Now →
📱 FastPeopleSearch
Free phone number lookup
Search Now →
🏘️ Zillow/Redfin
Property history & owner info
Search Zillow →

📞 Estimated Contact Info (Unverified)

${results.phones.map(phone => `
${phone.type}
${phone.number}
${phone.status}
Verify on TruePeopleSearch
`).join('')}
💡 Pro Tip: For accurate skip tracing with verified contacts, consider:
`; document.getElementById('skipTraceResults').classList.add('show'); document.getElementById('skipTraceResults').scrollIntoView({ behavior: 'smooth', block: 'nearest' }); } function processBulkSkipTrace() { const file = document.getElementById('bulkSkipFile').files[0]; if (!file) { alert('Please select a CSV file first.'); return; } // Simulated bulk results const mockBulkData = [ { address: '123 Main St', owner: 'John Smith', phone: '(555) 111-2222', email: 'john@email.com', status: 'Found' }, { address: '456 Oak Ave', owner: 'Jane Doe', phone: '(555) 333-4444', email: 'jane@email.com', status: 'Found' }, { address: '789 Pine Rd', owner: 'Unknown', phone: '-', email: '-', status: 'Not Found' } ]; const table = ` ${mockBulkData.map(row => ` `).join('')}
Address Owner Phone Email Status
${row.address} ${row.owner} ${row.phone} ${row.email} ${row.status}
`; document.getElementById('bulkTableContainer').innerHTML = table; document.getElementById('bulkResults').style.display = 'block'; } function exportSkipTrace() { alert('📥 Skip trace results exported to CSV!'); } function addToOutreach() { alert('📧 Contact added to outreach list!'); } // Buy Box Manager document.getElementById('buyBoxForm').addEventListener('submit', function(e) { e.preventDefault(); saveBuyBox(); }); function saveBuyBox() { const selectedTypes = Array.from(document.getElementById('buyBoxType').selectedOptions).map(opt => opt.value); const selectedConditions = Array.from(document.getElementById('propertyCondition').selectedOptions).map(opt => opt.value); const buyBox = { id: Date.now(), investorName: document.getElementById('investorName').value, investorEmail: document.getElementById('investorEmail').value, investorPhone: document.getElementById('investorPhone').value, propertyTypes: selectedTypes, propertyConditions: selectedConditions, minPrice: parseFloat(document.getElementById('minPrice').value), maxPrice: parseFloat(document.getElementById('maxPrice').value), minCashFlow: parseFloat(document.getElementById('minCashFlow').value), minCOC: parseFloat(document.getElementById('minCOC').value), preferredLocations: document.getElementById('preferredLocations').value, minCapRate: parseFloat(document.getElementById('maxCapRate').value), maxRenovationBudget: parseFloat(document.getElementById('maxRenovationBudget').value) || 0 }; buyBoxes.push(buyBox); displayBuyBoxes(); document.getElementById('buyBoxForm').reset(); alert('✅ Buy box saved successfully!'); } function displayBuyBoxes() { const container = document.getElementById('buyBoxList'); if (buyBoxes.length === 0) { container.innerHTML = '

No buy boxes created yet.

'; return; } container.innerHTML = buyBoxes.map(box => `
${box.investorName}
Email: ${box.investorEmail}
Phone: ${box.investorPhone}
Property Types: ${box.propertyTypes.join(', ')}
Price Range: ${box.minPrice.toLocaleString()} - ${box.maxPrice.toLocaleString()}
Min Cash Flow: ${box.minCashFlow}/mo
Min COC Return: ${box.minCOC}%
Min Cap Rate: ${box.minCapRate}%
Locations: ${box.preferredLocations || 'Any'}
`).join(''); } function deleteBuyBox(id) { if (confirm('Are you sure you want to delete this buy box?')) { buyBoxes = buyBoxes.filter(box => box.id !== id); displayBuyBoxes(); } } // Deal Matcher function updateMatchFinder() { displayPipeline(); runMatching(); } function displayPipeline() { const container = document.getElementById('pipelineDeals'); if (dealPipeline.length === 0) { container.innerHTML = '

No deals in pipeline. Analyze deals and save them to see matches here.

'; return; } container.innerHTML = dealPipeline.map(deal => `
${deal.address}
Price: ${deal.purchasePrice.toLocaleString()}
Cash Flow: ${deal.monthlyCashFlow.toFixed(2)}/mo
COC Return: ${deal.cashOnCashReturn.toFixed(2)}%
Cap Rate: ${deal.capRate.toFixed(2)}%
`).join(''); } function runMatching() { const container = document.getElementById('matchResults'); if (dealPipeline.length === 0 || buyBoxes.length === 0) { container.innerHTML = '

Add deals to pipeline and create buy boxes to see matches.

'; return; } let matchHTML = ''; dealPipeline.forEach(deal => { const matches = buyBoxes.filter(box => { const typeMatch = box.propertyTypes.includes(deal.propertyType); const conditionMatch = box.propertyConditions.length === 0 || box.propertyConditions.includes(deal.propertyCondition); const priceMatch = deal.purchasePrice >= box.minPrice && deal.purchasePrice <= box.maxPrice; const cashFlowMatch = deal.monthlyCashFlow >= box.minCashFlow; const cocMatch = deal.cashOnCashReturn >= box.minCOC; const capMatch = deal.capRate >= box.minCapRate; const repairBudgetMatch = deal.estimatedRepairs <= box.maxRenovationBudget; return typeMatch && conditionMatch && priceMatch && cashFlowMatch && cocMatch && capMatch && repairBudgetMatch; }); matchHTML += `

📍 ${deal.address}

Condition: ${deal.propertyCondition} | Repairs: ${deal.estimatedRepairs.toLocaleString()}

${matches.length > 0 ? `

${matches.length} Match${matches.length > 1 ? 'es' : ''}

${matches.map(box => `
${box.investorName}
📧 ${box.investorEmail}
📞 ${box.investorPhone}
Accepts: ${box.propertyConditions.map(c => { const conditionNames = { 'turnkey': 'Turnkey', 'cosmetic': 'Cosmetic', 'renovation': 'Full Reno', 'distressed': 'Distressed' }; return conditionNames[c] || c; }).join(', ')} | Max Renovation: ${box.maxRenovationBudget.toLocaleString()}
`).join('')} ` : `

No Matches

This deal doesn't match any active buy boxes.

`}
`; }); container.innerHTML = matchHTML; } function removeDealFromPipeline(id) { dealPipeline = dealPipeline.filter(deal => deal.id !== id); updateMatchFinder(); } function notifyInvestor(email, address) { alert(`✅ Deal notification sent to ${email} for property at ${address}!`); } // Skip Tracing Tracker Functions function saveTrackerEntry() { const entry = { id: Date.now(), address: document.getElementById('trackerAddress').value, owner: document.getElementById('trackerOwner').value, phone: document.getElementById('trackerPhone').value, email: document.getElementById('trackerEmail').value, source: document.getElementById('trackerSource').value, status: document.getElementById('trackerStatus').value, date: new Date().toLocaleDateString() }; if (!entry.address) { alert('Please enter a property address'); return; } trackerEntries.push(entry); displayTrackerEntries(); // Clear form document.getElementById('trackerAddress').value = ''; document.getElementById('trackerOwner').value = ''; document.getElementById('trackerPhone').value = ''; document.getElementById('trackerEmail').value = ''; alert('✅ Entry saved to tracker!'); } function displayTrackerEntries() { const container = document.getElementById('trackerList'); if (trackerEntries.length === 0) { container.innerHTML = ''; return; } container.innerHTML = `

Tracked Properties (${trackerEntries.length})

${trackerEntries.map(entry => ` `).join('')}
Date Address Owner Phone Email Source Status Action
${entry.date} ${entry.address} ${entry.owner || '-'} ${entry.phone || '-'} ${entry.email || '-'} ${entry.source} ${entry.status}
`; } function deleteTrackerEntry(id) { trackerEntries = trackerEntries.filter(entry => entry.id !== id); displayTrackerEntries(); } function exportTrackerToCSV() { if (trackerEntries.length === 0) { alert('No tracker entries to export'); return; } const csv = [ ['Date', 'Address', 'Owner', 'Phone', 'Email', 'Source', 'Status'], ...trackerEntries.map(entry => [ entry.date, entry.address, entry.owner || '', entry.phone || '', entry.email || '', entry.source, entry.status ]) ].map(row => row.join(',')).join('\n'); const blob = new Blob([csv], { type: 'text/csv' }); const url = window.URL.createObjectURL(blob); const a = document.createElement('a'); a.href = url; a.download = `talon7x-skip-tracker-${Date.now()}.csv`; a.click(); } // Google Maps Modal Functions function openMapModal(source) { currentMapSource = source; const address = source === 'deal' ? document.getElementById('address').value : document.getElementById('skipAddress').value; if (!address || address.trim() === '') { alert('Please enter a property address first'); return; } document.getElementById('mapModal').classList.add('show'); loadMap(address); } function closeMapModal() { document.getElementById('mapModal').classList.remove('show'); } function loadMap(address) { const encoded = encodeURIComponent(address); const container = document.getElementById('mapContainer'); if (currentMapView === 'map') { container.innerHTML = ``; } else if (currentMapView === 'satellite') { container.innerHTML = ``; } else { container.innerHTML = ``; } } function switchMapView(view) { currentMapView = view; // Update button states document.querySelectorAll('.map-toggle-btn').forEach(btn => { btn.classList.remove('active'); }); event.target.classList.add('active'); // Reload map with current address const address = currentMapSource === 'deal' ? document.getElementById('address').value : document.getElementById('skipAddress').value; if (address) { loadMap(address); } } // Close modal when clicking outside document.getElementById('mapModal').addEventListener('click', function(e) { if (e.target === this) { closeMapModal(); } }); // Export Functions function exportDealToCSV() { if (!currentDeal) return; const csv = [ ['Property Analysis Report', ''], ['Address', currentDeal.address], ['Property Type', currentDeal.propertyType], ['Purchase Price', `${currentDeal.purchasePrice.toLocaleString()}`], ['Monthly Cash Flow', `${currentDeal.monthlyCashFlow.toFixed(2)}`], ['Cash on Cash Return', `${currentDeal.cashOnCashReturn.toFixed(2)}%`], ['Cap Rate', `${currentDeal.capRate.toFixed(2)}%`], ['Notes', currentDeal.notes], ['Photos', currentDeal.photos] ].map(row => row.join(',')).join('\n'); const blob = new Blob([csv], { type: 'text/csv' }); const url = window.URL.createObjectURL(blob); const a = document.createElement('a'); a.href = url; a.download = `talon7x-deal-${Date.now()}.csv`; a.click(); } function copyDealToClipboard() { if (!currentDeal) return; const text = `Property Analysis Address\t${currentDeal.address} Price\t${currentDeal.purchasePrice.toLocaleString()} Monthly Cash Flow\t${currentDeal.monthlyCashFlow.toFixed(2)} COC Return\t${currentDeal.cashOnCashReturn.toFixed(2)}% Cap Rate\t${currentDeal.capRate.toFixed(2)}%`; navigator.clipboard.writeText(text).then(() => { alert('✅ Copied to clipboard!'); }); } + dealData.purchasePrice.toLocaleString() : 'N/A', "Monthly Cash Flow": dealData.monthlyCashFlow ? ' function exportDealToCSV() { if (!currentDeal) return; const csv = [ ['Property Analysis Report', ''], ['Address', currentDeal.address], ['Property Type', currentDeal.propertyType], ['Purchase Price', `${currentDeal.purchasePrice.toLocaleString()}`], ['Monthly Cash Flow', `${currentDeal.monthlyCashFlow.toFixed(2)}`], ['Cash on Cash Return', `${currentDeal.cashOnCashReturn.toFixed(2)}%`], ['Cap Rate', `${currentDeal.capRate.toFixed(2)}%`], ['Notes', currentDeal.notes], ['Photos', currentDeal.photos] ].map(row => row.join(',')).join('\n'); const blob = new Blob([csv], { type: 'text/csv' }); const url = window.URL.createObjectURL(blob); const a = document.createElement('a'); a.href = url; a.download = `talon7x-deal-${Date.now()}.csv`; a.click(); } function copyDealToClipboard() { if (!currentDeal) return; const text = `Property Analysis Address\t${currentDeal.address} Price\t${currentDeal.purchasePrice.toLocaleString()} Monthly Cash Flow\t${currentDeal.monthlyCashFlow.toFixed(2)} COC Return\t${currentDeal.cashOnCashReturn.toFixed(2)}% Cap Rate\t${currentDeal.capRate.toFixed(2)}%`; navigator.clipboard.writeText(text).then(() => { alert('✅ Copied to clipboard!'); }); } + dailyGoal.toLocaleString(); } const savedRevenue = localStorage.getItem('talon7x_revenue'); if (savedRevenue) { currentRevenue = parseInt(savedRevenue); updateDashboard(); } const savedLeads = localStorage.getItem('talon7x_leads'); if (savedLeads) { leadCount = parseInt(savedLeads); document.getElementById('lead-count').textContent = leadCount; } const savedSynced = localStorage.getItem('talon7x_synced'); if (savedSynced) { syncedCount = parseInt(savedSynced); document.getElementById('synced-count').textContent = syncedCount; } } // Initialize on page load loadAirtableConfig(); // Tab Navigation function showTab(tabName) { document.querySelectorAll('.content-section').forEach(section => { section.classList.remove('active'); }); document.querySelectorAll('.nav-tab').forEach(tab => { tab.classList.remove('active'); }); document.getElementById(tabName).classList.add('active'); event.target.classList.add('active'); if (tabName === 'match-finder') { updateMatchFinder(); } } // Photo Upload document.getElementById('photoUpload').addEventListener('change', function(e) { handlePhotoUpload(e.target.files); }); function handlePhotoUpload(files) { const preview = document.getElementById('photoPreview'); Array.from(files).forEach(file => { if (file.type.startsWith('image/')) { const reader = new FileReader(); reader.onload = function(e) { const photoData = { name: file.name, data: e.target.result, timestamp: new Date().toISOString() }; uploadedPhotos.push(photoData); const photoItem = document.createElement('div'); photoItem.className = 'photo-item'; photoItem.innerHTML = ` ${file.name} `; preview.appendChild(photoItem); }; reader.readAsDataURL(file); } }); } function removePhoto(index) { uploadedPhotos.splice(index, 1); updatePhotoPreview(); } function updatePhotoPreview() { const preview = document.getElementById('photoPreview'); preview.innerHTML = ''; uploadedPhotos.forEach((photo, index) => { const photoItem = document.createElement('div'); photoItem.className = 'photo-item'; photoItem.innerHTML = ` ${photo.name} `; preview.appendChild(photoItem); }); } // Deal Analyzer document.getElementById('dealForm').addEventListener('submit', function(e) { e.preventDefault(); calculateDeal(); }); function calculateDeal() { const purchasePrice = parseFloat(document.getElementById('purchasePrice').value); const downPaymentPct = parseFloat(document.getElementById('downPayment').value) / 100; const interestRate = parseFloat(document.getElementById('interestRate').value) / 100; const loanTerm = parseFloat(document.getElementById('loanTerm').value); const monthlyRent = parseFloat(document.getElementById('monthlyRent').value); const vacancyRate = parseFloat(document.getElementById('vacancyRate').value) / 100; const propertyTax = parseFloat(document.getElementById('propertyTax').value); const insurance = parseFloat(document.getElementById('insurance').value); const maintenance = parseFloat(document.getElementById('maintenance').value); const closingCosts = parseFloat(document.getElementById('closingCosts').value); const estimatedRepairs = parseFloat(document.getElementById('estimatedRepairs').value) || 0; const downPayment = purchasePrice * downPaymentPct; const loanAmount = purchasePrice - downPayment; const monthlyRate = interestRate / 12; const numPayments = loanTerm * 12; const monthlyMortgage = loanAmount * (monthlyRate * Math.pow(1 + monthlyRate, numPayments)) / (Math.pow(1 + monthlyRate, numPayments) - 1); const effectiveMonthlyRent = monthlyRent * (1 - vacancyRate); const monthlyPropertyTax = propertyTax / 12; const monthlyInsurance = insurance / 12; const totalMonthlyExpenses = monthlyMortgage + monthlyPropertyTax + monthlyInsurance + maintenance; const monthlyCashFlow = effectiveMonthlyRent - totalMonthlyExpenses; const annualCashFlow = monthlyCashFlow * 12; const totalInvestment = downPayment + closingCosts + estimatedRepairs; const cashOnCashReturn = (annualCashFlow / totalInvestment) * 100; const annualRent = monthlyRent * 12 * (1 - vacancyRate); const annualExpenses = (monthlyPropertyTax + monthlyInsurance + maintenance) * 12; const noi = annualRent - annualExpenses; const capRate = (noi / purchasePrice) * 100; currentDeal = { address: document.getElementById('address').value || 'N/A', propertyType: document.getElementById('propertyType').value, propertyCondition: document.getElementById('propertyConditionDeal').value, estimatedRepairs: estimatedRepairs, purchasePrice: purchasePrice, downPayment: downPayment, loanAmount: loanAmount, monthlyMortgage: monthlyMortgage, monthlyCashFlow: monthlyCashFlow, annualCashFlow: annualCashFlow, cashOnCashReturn: cashOnCashReturn, capRate: capRate, totalInvestment: totalInvestment, noi: noi, notes: document.getElementById('propertyNotes').value, photos: uploadedPhotos.length, timestamp: new Date().toISOString() }; displayDealResults(currentDeal); } function displayDealResults(deal) { const resultGrid = document.getElementById('resultGrid'); const verdict = document.getElementById('dealVerdict'); resultGrid.innerHTML = `
Monthly Cash Flow
${deal.monthlyCashFlow.toFixed(2)}
Annual Cash Flow
${deal.annualCashFlow.toFixed(2)}
Cash on Cash Return
${deal.cashOnCashReturn.toFixed(2)}%
Cap Rate
${deal.capRate.toFixed(2)}%
Total Investment
${deal.totalInvestment.toLocaleString()}
Monthly Mortgage
${deal.monthlyMortgage.toFixed(2)}
`; let verdictClass = ''; let verdictText = ''; if (deal.monthlyCashFlow > 0 && deal.cashOnCashReturn >= 8) { verdictClass = 'background: #d4edda; color: #155724;'; verdictText = '✅ EXCELLENT DEAL - Strong cash flow and returns!'; } else if (deal.monthlyCashFlow > 0 && deal.cashOnCashReturn >= 5) { verdictClass = 'background: #fff3cd; color: #856404;'; verdictText = '⚠️ DECENT DEAL - Positive but could negotiate better terms.'; } else { verdictClass = 'background: #f8d7da; color: #721c24;'; verdictText = '❌ PASS - Poor returns or negative cash flow.'; } verdict.style = verdictClass; verdict.textContent = verdictText; document.getElementById('dealResults').classList.add('show'); document.getElementById('dealResults').scrollIntoView({ behavior: 'smooth', block: 'nearest' }); } function saveToPipeline() { if (!currentDeal) return; dealPipeline.push({...currentDeal, id: Date.now()}); alert('✅ Deal saved to pipeline! Check the Deal Matcher tab to see investor matches.'); } // Skip Tracing document.getElementById('skipTraceForm').addEventListener('submit', async function(e) { e.preventDefault(); await runSkipTrace(); }); async function runSkipTrace() { const address = document.getElementById('skipAddress').value; const city = document.getElementById('skipCity').value; const state = document.getElementById('skipState').value; // Show loading state const container = document.getElementById('skipTraceData'); container.innerHTML = '

🔍 Searching public records...

'; document.getElementById('skipTraceResults').classList.add('show'); // Simulate API delay await new Promise(resolve => setTimeout(resolve, 1500)); // Generate realistic mock data based on address const ownerNames = [ 'John & Sarah Martinez', 'David Chen', 'Maria Rodriguez', 'Robert & Linda Johnson', 'Michael Thompson', 'Jennifer Davis', 'William Garcia', 'Lisa Anderson', 'James Wilson' ]; const randomOwner = ownerNames[Math.floor(Math.random() * ownerNames.length)]; const yearPurchased = 2010 + Math.floor(Math.random() * 14); const equityAmount = 100000 + Math.floor(Math.random() * 300000); const mockResults = { ownerName: randomOwner, mailingAddress: `${Math.floor(Math.random() * 9999)} ${['Oak', 'Pine', 'Maple', 'Cedar', 'Elm'][Math.floor(Math.random() * 5)]} Street, ${city}, ${state}`, phones: [ { type: 'Mobile', number: `(${Math.floor(Math.random() * 900) + 100}) ${Math.floor(Math.random() * 900) + 100}-${Math.floor(Math.random() * 9000) + 1000}`, status: Math.random() > 0.3 ? 'Active' : 'Unknown' }, { type: 'Landline', number: `(${Math.floor(Math.random() * 900) + 100}) ${Math.floor(Math.random() * 900) + 100}-${Math.floor(Math.random() * 9000) + 1000}`, status: Math.random() > 0.5 ? 'Disconnected' : 'Active' } ], emails: [ { email: `${randomOwner.split(' ')[0].toLowerCase()}@email.com`, status: 'Unverified' }, { email: `${randomOwner.split(' ')[0].toLowerCase()}${Math.floor(Math.random() * 99)}@gmail.com`, status: 'Unverified' } ], relatives: ['See paid services for relative data'], ownership: `Since ${yearPurchased}`, equity: `~${equityAmount.toLocaleString()}`, searchAddress: address, freeResources: true }; displaySkipTraceResults(mockResults); } function displaySkipTraceResults(results) { const container = document.getElementById('skipTraceData'); container.innerHTML = `
⚠️ Free Public Records Notice:

This data is simulated. Click the links below to search real public records for free.

Property: ${results.searchAddress || 'N/A'}

Estimated Owner: ${results.ownerName}

📍 Mailing Address
${results.mailingAddress}
(From property records)
🏠 Ownership
${results.ownership}
Equity: ${results.equity}

🆓 Free Public Record Resources

🏛️ County Property Records
Search your county assessor website
Search County Records →
🔍 TruePeopleSearch
Free phone & address lookup
Search Now →
📱 FastPeopleSearch
Free phone number lookup
Search Now →
🏘️ Zillow/Redfin
Property history & owner info
Search Zillow →

📞 Estimated Contact Info (Unverified)

${results.phones.map(phone => `
${phone.type}
${phone.number}
${phone.status}
Verify on TruePeopleSearch
`).join('')}
💡 Pro Tip: For accurate skip tracing with verified contacts, consider:
`; document.getElementById('skipTraceResults').classList.add('show'); document.getElementById('skipTraceResults').scrollIntoView({ behavior: 'smooth', block: 'nearest' }); } function processBulkSkipTrace() { const file = document.getElementById('bulkSkipFile').files[0]; if (!file) { alert('Please select a CSV file first.'); return; } // Simulated bulk results const mockBulkData = [ { address: '123 Main St', owner: 'John Smith', phone: '(555) 111-2222', email: 'john@email.com', status: 'Found' }, { address: '456 Oak Ave', owner: 'Jane Doe', phone: '(555) 333-4444', email: 'jane@email.com', status: 'Found' }, { address: '789 Pine Rd', owner: 'Unknown', phone: '-', email: '-', status: 'Not Found' } ]; const table = ` ${mockBulkData.map(row => ` `).join('')}
Address Owner Phone Email Status
${row.address} ${row.owner} ${row.phone} ${row.email} ${row.status}
`; document.getElementById('bulkTableContainer').innerHTML = table; document.getElementById('bulkResults').style.display = 'block'; } function exportSkipTrace() { alert('📥 Skip trace results exported to CSV!'); } function addToOutreach() { alert('📧 Contact added to outreach list!'); } // Buy Box Manager document.getElementById('buyBoxForm').addEventListener('submit', function(e) { e.preventDefault(); saveBuyBox(); }); function saveBuyBox() { const selectedTypes = Array.from(document.getElementById('buyBoxType').selectedOptions).map(opt => opt.value); const selectedConditions = Array.from(document.getElementById('propertyCondition').selectedOptions).map(opt => opt.value); const buyBox = { id: Date.now(), investorName: document.getElementById('investorName').value, investorEmail: document.getElementById('investorEmail').value, investorPhone: document.getElementById('investorPhone').value, propertyTypes: selectedTypes, propertyConditions: selectedConditions, minPrice: parseFloat(document.getElementById('minPrice').value), maxPrice: parseFloat(document.getElementById('maxPrice').value), minCashFlow: parseFloat(document.getElementById('minCashFlow').value), minCOC: parseFloat(document.getElementById('minCOC').value), preferredLocations: document.getElementById('preferredLocations').value, minCapRate: parseFloat(document.getElementById('maxCapRate').value), maxRenovationBudget: parseFloat(document.getElementById('maxRenovationBudget').value) || 0 }; buyBoxes.push(buyBox); displayBuyBoxes(); document.getElementById('buyBoxForm').reset(); alert('✅ Buy box saved successfully!'); } function displayBuyBoxes() { const container = document.getElementById('buyBoxList'); if (buyBoxes.length === 0) { container.innerHTML = '

No buy boxes created yet.

'; return; } container.innerHTML = buyBoxes.map(box => `
${box.investorName}
Email: ${box.investorEmail}
Phone: ${box.investorPhone}
Property Types: ${box.propertyTypes.join(', ')}
Price Range: ${box.minPrice.toLocaleString()} - ${box.maxPrice.toLocaleString()}
Min Cash Flow: ${box.minCashFlow}/mo
Min COC Return: ${box.minCOC}%
Min Cap Rate: ${box.minCapRate}%
Locations: ${box.preferredLocations || 'Any'}
`).join(''); } function deleteBuyBox(id) { if (confirm('Are you sure you want to delete this buy box?')) { buyBoxes = buyBoxes.filter(box => box.id !== id); displayBuyBoxes(); } } // Deal Matcher function updateMatchFinder() { displayPipeline(); runMatching(); } function displayPipeline() { const container = document.getElementById('pipelineDeals'); if (dealPipeline.length === 0) { container.innerHTML = '

No deals in pipeline. Analyze deals and save them to see matches here.

'; return; } container.innerHTML = dealPipeline.map(deal => `
${deal.address}
Price: ${deal.purchasePrice.toLocaleString()}
Cash Flow: ${deal.monthlyCashFlow.toFixed(2)}/mo
COC Return: ${deal.cashOnCashReturn.toFixed(2)}%
Cap Rate: ${deal.capRate.toFixed(2)}%
`).join(''); } function runMatching() { const container = document.getElementById('matchResults'); if (dealPipeline.length === 0 || buyBoxes.length === 0) { container.innerHTML = '

Add deals to pipeline and create buy boxes to see matches.

'; return; } let matchHTML = ''; dealPipeline.forEach(deal => { const matches = buyBoxes.filter(box => { const typeMatch = box.propertyTypes.includes(deal.propertyType); const conditionMatch = box.propertyConditions.length === 0 || box.propertyConditions.includes(deal.propertyCondition); const priceMatch = deal.purchasePrice >= box.minPrice && deal.purchasePrice <= box.maxPrice; const cashFlowMatch = deal.monthlyCashFlow >= box.minCashFlow; const cocMatch = deal.cashOnCashReturn >= box.minCOC; const capMatch = deal.capRate >= box.minCapRate; const repairBudgetMatch = deal.estimatedRepairs <= box.maxRenovationBudget; return typeMatch && conditionMatch && priceMatch && cashFlowMatch && cocMatch && capMatch && repairBudgetMatch; }); matchHTML += `

📍 ${deal.address}

Condition: ${deal.propertyCondition} | Repairs: ${deal.estimatedRepairs.toLocaleString()}

${matches.length > 0 ? `

${matches.length} Match${matches.length > 1 ? 'es' : ''}

${matches.map(box => `
${box.investorName}
📧 ${box.investorEmail}
📞 ${box.investorPhone}
Accepts: ${box.propertyConditions.map(c => { const conditionNames = { 'turnkey': 'Turnkey', 'cosmetic': 'Cosmetic', 'renovation': 'Full Reno', 'distressed': 'Distressed' }; return conditionNames[c] || c; }).join(', ')} | Max Renovation: ${box.maxRenovationBudget.toLocaleString()}
`).join('')} ` : `

No Matches

This deal doesn't match any active buy boxes.

`}
`; }); container.innerHTML = matchHTML; } function removeDealFromPipeline(id) { dealPipeline = dealPipeline.filter(deal => deal.id !== id); updateMatchFinder(); } function notifyInvestor(email, address) { alert(`✅ Deal notification sent to ${email} for property at ${address}!`); } // Skip Tracing Tracker Functions function saveTrackerEntry() { const entry = { id: Date.now(), address: document.getElementById('trackerAddress').value, owner: document.getElementById('trackerOwner').value, phone: document.getElementById('trackerPhone').value, email: document.getElementById('trackerEmail').value, source: document.getElementById('trackerSource').value, status: document.getElementById('trackerStatus').value, date: new Date().toLocaleDateString() }; if (!entry.address) { alert('Please enter a property address'); return; } trackerEntries.push(entry); displayTrackerEntries(); // Clear form document.getElementById('trackerAddress').value = ''; document.getElementById('trackerOwner').value = ''; document.getElementById('trackerPhone').value = ''; document.getElementById('trackerEmail').value = ''; alert('✅ Entry saved to tracker!'); } function displayTrackerEntries() { const container = document.getElementById('trackerList'); if (trackerEntries.length === 0) { container.innerHTML = ''; return; } container.innerHTML = `

Tracked Properties (${trackerEntries.length})

${trackerEntries.map(entry => ` `).join('')}
Date Address Owner Phone Email Source Status Action
${entry.date} ${entry.address} ${entry.owner || '-'} ${entry.phone || '-'} ${entry.email || '-'} ${entry.source} ${entry.status}
`; } function deleteTrackerEntry(id) { trackerEntries = trackerEntries.filter(entry => entry.id !== id); displayTrackerEntries(); } function exportTrackerToCSV() { if (trackerEntries.length === 0) { alert('No tracker entries to export'); return; } const csv = [ ['Date', 'Address', 'Owner', 'Phone', 'Email', 'Source', 'Status'], ...trackerEntries.map(entry => [ entry.date, entry.address, entry.owner || '', entry.phone || '', entry.email || '', entry.source, entry.status ]) ].map(row => row.join(',')).join('\n'); const blob = new Blob([csv], { type: 'text/csv' }); const url = window.URL.createObjectURL(blob); const a = document.createElement('a'); a.href = url; a.download = `talon7x-skip-tracker-${Date.now()}.csv`; a.click(); } // Google Maps Modal Functions function openMapModal(source) { currentMapSource = source; const address = source === 'deal' ? document.getElementById('address').value : document.getElementById('skipAddress').value; if (!address || address.trim() === '') { alert('Please enter a property address first'); return; } document.getElementById('mapModal').classList.add('show'); loadMap(address); } function closeMapModal() { document.getElementById('mapModal').classList.remove('show'); } function loadMap(address) { const encoded = encodeURIComponent(address); const container = document.getElementById('mapContainer'); if (currentMapView === 'map') { container.innerHTML = ``; } else if (currentMapView === 'satellite') { container.innerHTML = ``; } else { container.innerHTML = ``; } } function switchMapView(view) { currentMapView = view; // Update button states document.querySelectorAll('.map-toggle-btn').forEach(btn => { btn.classList.remove('active'); }); event.target.classList.add('active'); // Reload map with current address const address = currentMapSource === 'deal' ? document.getElementById('address').value : document.getElementById('skipAddress').value; if (address) { loadMap(address); } } // Close modal when clicking outside document.getElementById('mapModal').addEventListener('click', function(e) { if (e.target === this) { closeMapModal(); } }); // Export Functions function exportDealToCSV() { if (!currentDeal) return; const csv = [ ['Property Analysis Report', ''], ['Address', currentDeal.address], ['Property Type', currentDeal.propertyType], ['Purchase Price', `${currentDeal.purchasePrice.toLocaleString()}`], ['Monthly Cash Flow', `${currentDeal.monthlyCashFlow.toFixed(2)}`], ['Cash on Cash Return', `${currentDeal.cashOnCashReturn.toFixed(2)}%`], ['Cap Rate', `${currentDeal.capRate.toFixed(2)}%`], ['Notes', currentDeal.notes], ['Photos', currentDeal.photos] ].map(row => row.join(',')).join('\n'); const blob = new Blob([csv], { type: 'text/csv' }); const url = window.URL.createObjectURL(blob); const a = document.createElement('a'); a.href = url; a.download = `talon7x-deal-${Date.now()}.csv`; a.click(); } function copyDealToClipboard() { if (!currentDeal) return; const text = `Property Analysis Address\t${currentDeal.address} Price\t${currentDeal.purchasePrice.toLocaleString()} Monthly Cash Flow\t${currentDeal.monthlyCashFlow.toFixed(2)} COC Return\t${currentDeal.cashOnCashReturn.toFixed(2)}% Cap Rate\t${currentDeal.capRate.toFixed(2)}%`; navigator.clipboard.writeText(text).then(() => { alert('✅ Copied to clipboard!'); }); } + dealData.monthlyCashFlow.toFixed(2) : 'N/A', "COC Return": dealData.cashOnCashReturn ? dealData.cashOnCashReturn.toFixed(2) + '%' : 'N/A', "Cap Rate": dealData.capRate ? dealData.capRate.toFixed(2) + '%' : 'N/A', "Status": "Analyzing", "Timestamp": new Date().toISOString() } }; try { const response = await fetch(url, { method: 'POST', headers: { 'Authorization': `Bearer ${airtableConfig.pat}`, 'Content-Type': 'application/json' }, body: JSON.stringify(body) }); if (response.ok) { syncedCount++; document.getElementById('synced-count').textContent = syncedCount; localStorage.setItem('talon7x_synced', syncedCount); return true; } else { console.error('Airtable sync failed:', await response.text()); return false; } } catch (e) { console.error("Sync Error:", e); return false; } } // Dashboard Update Functions function updateDashboard() { document.getElementById('current-rev').textContent = ' function exportDealToCSV() { if (!currentDeal) return; const csv = [ ['Property Analysis Report', ''], ['Address', currentDeal.address], ['Property Type', currentDeal.propertyType], ['Purchase Price', `${currentDeal.purchasePrice.toLocaleString()}`], ['Monthly Cash Flow', `${currentDeal.monthlyCashFlow.toFixed(2)}`], ['Cash on Cash Return', `${currentDeal.cashOnCashReturn.toFixed(2)}%`], ['Cap Rate', `${currentDeal.capRate.toFixed(2)}%`], ['Notes', currentDeal.notes], ['Photos', currentDeal.photos] ].map(row => row.join(',')).join('\n'); const blob = new Blob([csv], { type: 'text/csv' }); const url = window.URL.createObjectURL(blob); const a = document.createElement('a'); a.href = url; a.download = `talon7x-deal-${Date.now()}.csv`; a.click(); } function copyDealToClipboard() { if (!currentDeal) return; const text = `Property Analysis Address\t${currentDeal.address} Price\t${currentDeal.purchasePrice.toLocaleString()} Monthly Cash Flow\t${currentDeal.monthlyCashFlow.toFixed(2)} COC Return\t${currentDeal.cashOnCashReturn.toFixed(2)}% Cap Rate\t${currentDeal.capRate.toFixed(2)}%`; navigator.clipboard.writeText(text).then(() => { alert('✅ Copied to clipboard!'); }); } + dailyGoal.toLocaleString(); } const savedRevenue = localStorage.getItem('talon7x_revenue'); if (savedRevenue) { currentRevenue = parseInt(savedRevenue); updateDashboard(); } const savedLeads = localStorage.getItem('talon7x_leads'); if (savedLeads) { leadCount = parseInt(savedLeads); document.getElementById('lead-count').textContent = leadCount; } const savedSynced = localStorage.getItem('talon7x_synced'); if (savedSynced) { syncedCount = parseInt(savedSynced); document.getElementById('synced-count').textContent = syncedCount; } } // Initialize on page load loadAirtableConfig(); // Tab Navigation function showTab(tabName) { document.querySelectorAll('.content-section').forEach(section => { section.classList.remove('active'); }); document.querySelectorAll('.nav-tab').forEach(tab => { tab.classList.remove('active'); }); document.getElementById(tabName).classList.add('active'); event.target.classList.add('active'); if (tabName === 'match-finder') { updateMatchFinder(); } } // Photo Upload document.getElementById('photoUpload').addEventListener('change', function(e) { handlePhotoUpload(e.target.files); }); function handlePhotoUpload(files) { const preview = document.getElementById('photoPreview'); Array.from(files).forEach(file => { if (file.type.startsWith('image/')) { const reader = new FileReader(); reader.onload = function(e) { const photoData = { name: file.name, data: e.target.result, timestamp: new Date().toISOString() }; uploadedPhotos.push(photoData); const photoItem = document.createElement('div'); photoItem.className = 'photo-item'; photoItem.innerHTML = ` ${file.name} `; preview.appendChild(photoItem); }; reader.readAsDataURL(file); } }); } function removePhoto(index) { uploadedPhotos.splice(index, 1); updatePhotoPreview(); } function updatePhotoPreview() { const preview = document.getElementById('photoPreview'); preview.innerHTML = ''; uploadedPhotos.forEach((photo, index) => { const photoItem = document.createElement('div'); photoItem.className = 'photo-item'; photoItem.innerHTML = ` ${photo.name} `; preview.appendChild(photoItem); }); } // Deal Analyzer document.getElementById('dealForm').addEventListener('submit', function(e) { e.preventDefault(); calculateDeal(); }); function calculateDeal() { const purchasePrice = parseFloat(document.getElementById('purchasePrice').value); const downPaymentPct = parseFloat(document.getElementById('downPayment').value) / 100; const interestRate = parseFloat(document.getElementById('interestRate').value) / 100; const loanTerm = parseFloat(document.getElementById('loanTerm').value); const monthlyRent = parseFloat(document.getElementById('monthlyRent').value); const vacancyRate = parseFloat(document.getElementById('vacancyRate').value) / 100; const propertyTax = parseFloat(document.getElementById('propertyTax').value); const insurance = parseFloat(document.getElementById('insurance').value); const maintenance = parseFloat(document.getElementById('maintenance').value); const closingCosts = parseFloat(document.getElementById('closingCosts').value); const estimatedRepairs = parseFloat(document.getElementById('estimatedRepairs').value) || 0; const downPayment = purchasePrice * downPaymentPct; const loanAmount = purchasePrice - downPayment; const monthlyRate = interestRate / 12; const numPayments = loanTerm * 12; const monthlyMortgage = loanAmount * (monthlyRate * Math.pow(1 + monthlyRate, numPayments)) / (Math.pow(1 + monthlyRate, numPayments) - 1); const effectiveMonthlyRent = monthlyRent * (1 - vacancyRate); const monthlyPropertyTax = propertyTax / 12; const monthlyInsurance = insurance / 12; const totalMonthlyExpenses = monthlyMortgage + monthlyPropertyTax + monthlyInsurance + maintenance; const monthlyCashFlow = effectiveMonthlyRent - totalMonthlyExpenses; const annualCashFlow = monthlyCashFlow * 12; const totalInvestment = downPayment + closingCosts + estimatedRepairs; const cashOnCashReturn = (annualCashFlow / totalInvestment) * 100; const annualRent = monthlyRent * 12 * (1 - vacancyRate); const annualExpenses = (monthlyPropertyTax + monthlyInsurance + maintenance) * 12; const noi = annualRent - annualExpenses; const capRate = (noi / purchasePrice) * 100; currentDeal = { address: document.getElementById('address').value || 'N/A', propertyType: document.getElementById('propertyType').value, propertyCondition: document.getElementById('propertyConditionDeal').value, estimatedRepairs: estimatedRepairs, purchasePrice: purchasePrice, downPayment: downPayment, loanAmount: loanAmount, monthlyMortgage: monthlyMortgage, monthlyCashFlow: monthlyCashFlow, annualCashFlow: annualCashFlow, cashOnCashReturn: cashOnCashReturn, capRate: capRate, totalInvestment: totalInvestment, noi: noi, notes: document.getElementById('propertyNotes').value, photos: uploadedPhotos.length, timestamp: new Date().toISOString() }; displayDealResults(currentDeal); } function displayDealResults(deal) { const resultGrid = document.getElementById('resultGrid'); const verdict = document.getElementById('dealVerdict'); resultGrid.innerHTML = `
Monthly Cash Flow
${deal.monthlyCashFlow.toFixed(2)}
Annual Cash Flow
${deal.annualCashFlow.toFixed(2)}
Cash on Cash Return
${deal.cashOnCashReturn.toFixed(2)}%
Cap Rate
${deal.capRate.toFixed(2)}%
Total Investment
${deal.totalInvestment.toLocaleString()}
Monthly Mortgage
${deal.monthlyMortgage.toFixed(2)}
`; let verdictClass = ''; let verdictText = ''; if (deal.monthlyCashFlow > 0 && deal.cashOnCashReturn >= 8) { verdictClass = 'background: #d4edda; color: #155724;'; verdictText = '✅ EXCELLENT DEAL - Strong cash flow and returns!'; } else if (deal.monthlyCashFlow > 0 && deal.cashOnCashReturn >= 5) { verdictClass = 'background: #fff3cd; color: #856404;'; verdictText = '⚠️ DECENT DEAL - Positive but could negotiate better terms.'; } else { verdictClass = 'background: #f8d7da; color: #721c24;'; verdictText = '❌ PASS - Poor returns or negative cash flow.'; } verdict.style = verdictClass; verdict.textContent = verdictText; document.getElementById('dealResults').classList.add('show'); document.getElementById('dealResults').scrollIntoView({ behavior: 'smooth', block: 'nearest' }); } function saveToPipeline() { if (!currentDeal) return; dealPipeline.push({...currentDeal, id: Date.now()}); alert('✅ Deal saved to pipeline! Check the Deal Matcher tab to see investor matches.'); } // Skip Tracing document.getElementById('skipTraceForm').addEventListener('submit', async function(e) { e.preventDefault(); await runSkipTrace(); }); async function runSkipTrace() { const address = document.getElementById('skipAddress').value; const city = document.getElementById('skipCity').value; const state = document.getElementById('skipState').value; // Show loading state const container = document.getElementById('skipTraceData'); container.innerHTML = '

🔍 Searching public records...

'; document.getElementById('skipTraceResults').classList.add('show'); // Simulate API delay await new Promise(resolve => setTimeout(resolve, 1500)); // Generate realistic mock data based on address const ownerNames = [ 'John & Sarah Martinez', 'David Chen', 'Maria Rodriguez', 'Robert & Linda Johnson', 'Michael Thompson', 'Jennifer Davis', 'William Garcia', 'Lisa Anderson', 'James Wilson' ]; const randomOwner = ownerNames[Math.floor(Math.random() * ownerNames.length)]; const yearPurchased = 2010 + Math.floor(Math.random() * 14); const equityAmount = 100000 + Math.floor(Math.random() * 300000); const mockResults = { ownerName: randomOwner, mailingAddress: `${Math.floor(Math.random() * 9999)} ${['Oak', 'Pine', 'Maple', 'Cedar', 'Elm'][Math.floor(Math.random() * 5)]} Street, ${city}, ${state}`, phones: [ { type: 'Mobile', number: `(${Math.floor(Math.random() * 900) + 100}) ${Math.floor(Math.random() * 900) + 100}-${Math.floor(Math.random() * 9000) + 1000}`, status: Math.random() > 0.3 ? 'Active' : 'Unknown' }, { type: 'Landline', number: `(${Math.floor(Math.random() * 900) + 100}) ${Math.floor(Math.random() * 900) + 100}-${Math.floor(Math.random() * 9000) + 1000}`, status: Math.random() > 0.5 ? 'Disconnected' : 'Active' } ], emails: [ { email: `${randomOwner.split(' ')[0].toLowerCase()}@email.com`, status: 'Unverified' }, { email: `${randomOwner.split(' ')[0].toLowerCase()}${Math.floor(Math.random() * 99)}@gmail.com`, status: 'Unverified' } ], relatives: ['See paid services for relative data'], ownership: `Since ${yearPurchased}`, equity: `~${equityAmount.toLocaleString()}`, searchAddress: address, freeResources: true }; displaySkipTraceResults(mockResults); } function displaySkipTraceResults(results) { const container = document.getElementById('skipTraceData'); container.innerHTML = `
⚠️ Free Public Records Notice:

This data is simulated. Click the links below to search real public records for free.

Property: ${results.searchAddress || 'N/A'}

Estimated Owner: ${results.ownerName}

📍 Mailing Address
${results.mailingAddress}
(From property records)
🏠 Ownership
${results.ownership}
Equity: ${results.equity}

🆓 Free Public Record Resources

🏛️ County Property Records
Search your county assessor website
Search County Records →
🔍 TruePeopleSearch
Free phone & address lookup
Search Now →
📱 FastPeopleSearch
Free phone number lookup
Search Now →
🏘️ Zillow/Redfin
Property history & owner info
Search Zillow →

📞 Estimated Contact Info (Unverified)

${results.phones.map(phone => `
${phone.type}
${phone.number}
${phone.status}
Verify on TruePeopleSearch
`).join('')}
💡 Pro Tip: For accurate skip tracing with verified contacts, consider:
`; document.getElementById('skipTraceResults').classList.add('show'); document.getElementById('skipTraceResults').scrollIntoView({ behavior: 'smooth', block: 'nearest' }); } function processBulkSkipTrace() { const file = document.getElementById('bulkSkipFile').files[0]; if (!file) { alert('Please select a CSV file first.'); return; } // Simulated bulk results const mockBulkData = [ { address: '123 Main St', owner: 'John Smith', phone: '(555) 111-2222', email: 'john@email.com', status: 'Found' }, { address: '456 Oak Ave', owner: 'Jane Doe', phone: '(555) 333-4444', email: 'jane@email.com', status: 'Found' }, { address: '789 Pine Rd', owner: 'Unknown', phone: '-', email: '-', status: 'Not Found' } ]; const table = ` ${mockBulkData.map(row => ` `).join('')}
Address Owner Phone Email Status
${row.address} ${row.owner} ${row.phone} ${row.email} ${row.status}
`; document.getElementById('bulkTableContainer').innerHTML = table; document.getElementById('bulkResults').style.display = 'block'; } function exportSkipTrace() { alert('📥 Skip trace results exported to CSV!'); } function addToOutreach() { alert('📧 Contact added to outreach list!'); } // Buy Box Manager document.getElementById('buyBoxForm').addEventListener('submit', function(e) { e.preventDefault(); saveBuyBox(); }); function saveBuyBox() { const selectedTypes = Array.from(document.getElementById('buyBoxType').selectedOptions).map(opt => opt.value); const selectedConditions = Array.from(document.getElementById('propertyCondition').selectedOptions).map(opt => opt.value); const buyBox = { id: Date.now(), investorName: document.getElementById('investorName').value, investorEmail: document.getElementById('investorEmail').value, investorPhone: document.getElementById('investorPhone').value, propertyTypes: selectedTypes, propertyConditions: selectedConditions, minPrice: parseFloat(document.getElementById('minPrice').value), maxPrice: parseFloat(document.getElementById('maxPrice').value), minCashFlow: parseFloat(document.getElementById('minCashFlow').value), minCOC: parseFloat(document.getElementById('minCOC').value), preferredLocations: document.getElementById('preferredLocations').value, minCapRate: parseFloat(document.getElementById('maxCapRate').value), maxRenovationBudget: parseFloat(document.getElementById('maxRenovationBudget').value) || 0 }; buyBoxes.push(buyBox); displayBuyBoxes(); document.getElementById('buyBoxForm').reset(); alert('✅ Buy box saved successfully!'); } function displayBuyBoxes() { const container = document.getElementById('buyBoxList'); if (buyBoxes.length === 0) { container.innerHTML = '

No buy boxes created yet.

'; return; } container.innerHTML = buyBoxes.map(box => `
${box.investorName}
Email: ${box.investorEmail}
Phone: ${box.investorPhone}
Property Types: ${box.propertyTypes.join(', ')}
Price Range: ${box.minPrice.toLocaleString()} - ${box.maxPrice.toLocaleString()}
Min Cash Flow: ${box.minCashFlow}/mo
Min COC Return: ${box.minCOC}%
Min Cap Rate: ${box.minCapRate}%
Locations: ${box.preferredLocations || 'Any'}
`).join(''); } function deleteBuyBox(id) { if (confirm('Are you sure you want to delete this buy box?')) { buyBoxes = buyBoxes.filter(box => box.id !== id); displayBuyBoxes(); } } // Deal Matcher function updateMatchFinder() { displayPipeline(); runMatching(); } function displayPipeline() { const container = document.getElementById('pipelineDeals'); if (dealPipeline.length === 0) { container.innerHTML = '

No deals in pipeline. Analyze deals and save them to see matches here.

'; return; } container.innerHTML = dealPipeline.map(deal => `
${deal.address}
Price: ${deal.purchasePrice.toLocaleString()}
Cash Flow: ${deal.monthlyCashFlow.toFixed(2)}/mo
COC Return: ${deal.cashOnCashReturn.toFixed(2)}%
Cap Rate: ${deal.capRate.toFixed(2)}%
`).join(''); } function runMatching() { const container = document.getElementById('matchResults'); if (dealPipeline.length === 0 || buyBoxes.length === 0) { container.innerHTML = '

Add deals to pipeline and create buy boxes to see matches.

'; return; } let matchHTML = ''; dealPipeline.forEach(deal => { const matches = buyBoxes.filter(box => { const typeMatch = box.propertyTypes.includes(deal.propertyType); const conditionMatch = box.propertyConditions.length === 0 || box.propertyConditions.includes(deal.propertyCondition); const priceMatch = deal.purchasePrice >= box.minPrice && deal.purchasePrice <= box.maxPrice; const cashFlowMatch = deal.monthlyCashFlow >= box.minCashFlow; const cocMatch = deal.cashOnCashReturn >= box.minCOC; const capMatch = deal.capRate >= box.minCapRate; const repairBudgetMatch = deal.estimatedRepairs <= box.maxRenovationBudget; return typeMatch && conditionMatch && priceMatch && cashFlowMatch && cocMatch && capMatch && repairBudgetMatch; }); matchHTML += `

📍 ${deal.address}

Condition: ${deal.propertyCondition} | Repairs: ${deal.estimatedRepairs.toLocaleString()}

${matches.length > 0 ? `

${matches.length} Match${matches.length > 1 ? 'es' : ''}

${matches.map(box => `
${box.investorName}
📧 ${box.investorEmail}
📞 ${box.investorPhone}
Accepts: ${box.propertyConditions.map(c => { const conditionNames = { 'turnkey': 'Turnkey', 'cosmetic': 'Cosmetic', 'renovation': 'Full Reno', 'distressed': 'Distressed' }; return conditionNames[c] || c; }).join(', ')} | Max Renovation: ${box.maxRenovationBudget.toLocaleString()}
`).join('')} ` : `

No Matches

This deal doesn't match any active buy boxes.

`}
`; }); container.innerHTML = matchHTML; } function removeDealFromPipeline(id) { dealPipeline = dealPipeline.filter(deal => deal.id !== id); updateMatchFinder(); } function notifyInvestor(email, address) { alert(`✅ Deal notification sent to ${email} for property at ${address}!`); } // Skip Tracing Tracker Functions function saveTrackerEntry() { const entry = { id: Date.now(), address: document.getElementById('trackerAddress').value, owner: document.getElementById('trackerOwner').value, phone: document.getElementById('trackerPhone').value, email: document.getElementById('trackerEmail').value, source: document.getElementById('trackerSource').value, status: document.getElementById('trackerStatus').value, date: new Date().toLocaleDateString() }; if (!entry.address) { alert('Please enter a property address'); return; } trackerEntries.push(entry); displayTrackerEntries(); // Clear form document.getElementById('trackerAddress').value = ''; document.getElementById('trackerOwner').value = ''; document.getElementById('trackerPhone').value = ''; document.getElementById('trackerEmail').value = ''; alert('✅ Entry saved to tracker!'); } function displayTrackerEntries() { const container = document.getElementById('trackerList'); if (trackerEntries.length === 0) { container.innerHTML = ''; return; } container.innerHTML = `

Tracked Properties (${trackerEntries.length})

${trackerEntries.map(entry => ` `).join('')}
Date Address Owner Phone Email Source Status Action
${entry.date} ${entry.address} ${entry.owner || '-'} ${entry.phone || '-'} ${entry.email || '-'} ${entry.source} ${entry.status}
`; } function deleteTrackerEntry(id) { trackerEntries = trackerEntries.filter(entry => entry.id !== id); displayTrackerEntries(); } function exportTrackerToCSV() { if (trackerEntries.length === 0) { alert('No tracker entries to export'); return; } const csv = [ ['Date', 'Address', 'Owner', 'Phone', 'Email', 'Source', 'Status'], ...trackerEntries.map(entry => [ entry.date, entry.address, entry.owner || '', entry.phone || '', entry.email || '', entry.source, entry.status ]) ].map(row => row.join(',')).join('\n'); const blob = new Blob([csv], { type: 'text/csv' }); const url = window.URL.createObjectURL(blob); const a = document.createElement('a'); a.href = url; a.download = `talon7x-skip-tracker-${Date.now()}.csv`; a.click(); } // Google Maps Modal Functions function openMapModal(source) { currentMapSource = source; const address = source === 'deal' ? document.getElementById('address').value : document.getElementById('skipAddress').value; if (!address || address.trim() === '') { alert('Please enter a property address first'); return; } document.getElementById('mapModal').classList.add('show'); loadMap(address); } function closeMapModal() { document.getElementById('mapModal').classList.remove('show'); } function loadMap(address) { const encoded = encodeURIComponent(address); const container = document.getElementById('mapContainer'); if (currentMapView === 'map') { container.innerHTML = ``; } else if (currentMapView === 'satellite') { container.innerHTML = ``; } else { container.innerHTML = ``; } } function switchMapView(view) { currentMapView = view; // Update button states document.querySelectorAll('.map-toggle-btn').forEach(btn => { btn.classList.remove('active'); }); event.target.classList.add('active'); // Reload map with current address const address = currentMapSource === 'deal' ? document.getElementById('address').value : document.getElementById('skipAddress').value; if (address) { loadMap(address); } } // Close modal when clicking outside document.getElementById('mapModal').addEventListener('click', function(e) { if (e.target === this) { closeMapModal(); } }); // Export Functions function exportDealToCSV() { if (!currentDeal) return; const csv = [ ['Property Analysis Report', ''], ['Address', currentDeal.address], ['Property Type', currentDeal.propertyType], ['Purchase Price', `${currentDeal.purchasePrice.toLocaleString()}`], ['Monthly Cash Flow', `${currentDeal.monthlyCashFlow.toFixed(2)}`], ['Cash on Cash Return', `${currentDeal.cashOnCashReturn.toFixed(2)}%`], ['Cap Rate', `${currentDeal.capRate.toFixed(2)}%`], ['Notes', currentDeal.notes], ['Photos', currentDeal.photos] ].map(row => row.join(',')).join('\n'); const blob = new Blob([csv], { type: 'text/csv' }); const url = window.URL.createObjectURL(blob); const a = document.createElement('a'); a.href = url; a.download = `talon7x-deal-${Date.now()}.csv`; a.click(); } function copyDealToClipboard() { if (!currentDeal) return; const text = `Property Analysis Address\t${currentDeal.address} Price\t${currentDeal.purchasePrice.toLocaleString()} Monthly Cash Flow\t${currentDeal.monthlyCashFlow.toFixed(2)} COC Return\t${currentDeal.cashOnCashReturn.toFixed(2)}% Cap Rate\t${currentDeal.capRate.toFixed(2)}%`; navigator.clipboard.writeText(text).then(() => { alert('✅ Copied to clipboard!'); }); } + currentRevenue.toLocaleString(); const progress = Math.min((currentRevenue / dailyGoal) * 100, 100); document.getElementById('progress-fill').style.width = progress + '%'; // Save to localStorage localStorage.setItem('talon7x_revenue', currentRevenue); } function markAsPaid() { const amount = prompt('Enter deal amount ($):', '500'); if (amount && !isNaN(amount)) { currentRevenue += parseInt(amount); updateDashboard(); alert('✅ function exportDealToCSV() { if (!currentDeal) return; const csv = [ ['Property Analysis Report', ''], ['Address', currentDeal.address], ['Property Type', currentDeal.propertyType], ['Purchase Price', `${currentDeal.purchasePrice.toLocaleString()}`], ['Monthly Cash Flow', `${currentDeal.monthlyCashFlow.toFixed(2)}`], ['Cash on Cash Return', `${currentDeal.cashOnCashReturn.toFixed(2)}%`], ['Cap Rate', `${currentDeal.capRate.toFixed(2)}%`], ['Notes', currentDeal.notes], ['Photos', currentDeal.photos] ].map(row => row.join(',')).join('\n'); const blob = new Blob([csv], { type: 'text/csv' }); const url = window.URL.createObjectURL(blob); const a = document.createElement('a'); a.href = url; a.download = `talon7x-deal-${Date.now()}.csv`; a.click(); } function copyDealToClipboard() { if (!currentDeal) return; const text = `Property Analysis Address\t${currentDeal.address} Price\t${currentDeal.purchasePrice.toLocaleString()} Monthly Cash Flow\t${currentDeal.monthlyCashFlow.toFixed(2)} COC Return\t${currentDeal.cashOnCashReturn.toFixed(2)}% Cap Rate\t${currentDeal.capRate.toFixed(2)}%`; navigator.clipboard.writeText(text).then(() => { alert('✅ Copied to clipboard!'); }); } + dailyGoal.toLocaleString(); } const savedRevenue = localStorage.getItem('talon7x_revenue'); if (savedRevenue) { currentRevenue = parseInt(savedRevenue); updateDashboard(); } const savedLeads = localStorage.getItem('talon7x_leads'); if (savedLeads) { leadCount = parseInt(savedLeads); document.getElementById('lead-count').textContent = leadCount; } const savedSynced = localStorage.getItem('talon7x_synced'); if (savedSynced) { syncedCount = parseInt(savedSynced); document.getElementById('synced-count').textContent = syncedCount; } } // Initialize on page load loadAirtableConfig(); // Tab Navigation function showTab(tabName) { document.querySelectorAll('.content-section').forEach(section => { section.classList.remove('active'); }); document.querySelectorAll('.nav-tab').forEach(tab => { tab.classList.remove('active'); }); document.getElementById(tabName).classList.add('active'); event.target.classList.add('active'); if (tabName === 'match-finder') { updateMatchFinder(); } } // Photo Upload document.getElementById('photoUpload').addEventListener('change', function(e) { handlePhotoUpload(e.target.files); }); function handlePhotoUpload(files) { const preview = document.getElementById('photoPreview'); Array.from(files).forEach(file => { if (file.type.startsWith('image/')) { const reader = new FileReader(); reader.onload = function(e) { const photoData = { name: file.name, data: e.target.result, timestamp: new Date().toISOString() }; uploadedPhotos.push(photoData); const photoItem = document.createElement('div'); photoItem.className = 'photo-item'; photoItem.innerHTML = ` ${file.name} `; preview.appendChild(photoItem); }; reader.readAsDataURL(file); } }); } function removePhoto(index) { uploadedPhotos.splice(index, 1); updatePhotoPreview(); } function updatePhotoPreview() { const preview = document.getElementById('photoPreview'); preview.innerHTML = ''; uploadedPhotos.forEach((photo, index) => { const photoItem = document.createElement('div'); photoItem.className = 'photo-item'; photoItem.innerHTML = ` ${photo.name} `; preview.appendChild(photoItem); }); } // Deal Analyzer document.getElementById('dealForm').addEventListener('submit', function(e) { e.preventDefault(); calculateDeal(); }); function calculateDeal() { const purchasePrice = parseFloat(document.getElementById('purchasePrice').value); const downPaymentPct = parseFloat(document.getElementById('downPayment').value) / 100; const interestRate = parseFloat(document.getElementById('interestRate').value) / 100; const loanTerm = parseFloat(document.getElementById('loanTerm').value); const monthlyRent = parseFloat(document.getElementById('monthlyRent').value); const vacancyRate = parseFloat(document.getElementById('vacancyRate').value) / 100; const propertyTax = parseFloat(document.getElementById('propertyTax').value); const insurance = parseFloat(document.getElementById('insurance').value); const maintenance = parseFloat(document.getElementById('maintenance').value); const closingCosts = parseFloat(document.getElementById('closingCosts').value); const estimatedRepairs = parseFloat(document.getElementById('estimatedRepairs').value) || 0; const downPayment = purchasePrice * downPaymentPct; const loanAmount = purchasePrice - downPayment; const monthlyRate = interestRate / 12; const numPayments = loanTerm * 12; const monthlyMortgage = loanAmount * (monthlyRate * Math.pow(1 + monthlyRate, numPayments)) / (Math.pow(1 + monthlyRate, numPayments) - 1); const effectiveMonthlyRent = monthlyRent * (1 - vacancyRate); const monthlyPropertyTax = propertyTax / 12; const monthlyInsurance = insurance / 12; const totalMonthlyExpenses = monthlyMortgage + monthlyPropertyTax + monthlyInsurance + maintenance; const monthlyCashFlow = effectiveMonthlyRent - totalMonthlyExpenses; const annualCashFlow = monthlyCashFlow * 12; const totalInvestment = downPayment + closingCosts + estimatedRepairs; const cashOnCashReturn = (annualCashFlow / totalInvestment) * 100; const annualRent = monthlyRent * 12 * (1 - vacancyRate); const annualExpenses = (monthlyPropertyTax + monthlyInsurance + maintenance) * 12; const noi = annualRent - annualExpenses; const capRate = (noi / purchasePrice) * 100; currentDeal = { address: document.getElementById('address').value || 'N/A', propertyType: document.getElementById('propertyType').value, propertyCondition: document.getElementById('propertyConditionDeal').value, estimatedRepairs: estimatedRepairs, purchasePrice: purchasePrice, downPayment: downPayment, loanAmount: loanAmount, monthlyMortgage: monthlyMortgage, monthlyCashFlow: monthlyCashFlow, annualCashFlow: annualCashFlow, cashOnCashReturn: cashOnCashReturn, capRate: capRate, totalInvestment: totalInvestment, noi: noi, notes: document.getElementById('propertyNotes').value, photos: uploadedPhotos.length, timestamp: new Date().toISOString() }; displayDealResults(currentDeal); } function displayDealResults(deal) { const resultGrid = document.getElementById('resultGrid'); const verdict = document.getElementById('dealVerdict'); resultGrid.innerHTML = `
Monthly Cash Flow
${deal.monthlyCashFlow.toFixed(2)}
Annual Cash Flow
${deal.annualCashFlow.toFixed(2)}
Cash on Cash Return
${deal.cashOnCashReturn.toFixed(2)}%
Cap Rate
${deal.capRate.toFixed(2)}%
Total Investment
${deal.totalInvestment.toLocaleString()}
Monthly Mortgage
${deal.monthlyMortgage.toFixed(2)}
`; let verdictClass = ''; let verdictText = ''; if (deal.monthlyCashFlow > 0 && deal.cashOnCashReturn >= 8) { verdictClass = 'background: #d4edda; color: #155724;'; verdictText = '✅ EXCELLENT DEAL - Strong cash flow and returns!'; } else if (deal.monthlyCashFlow > 0 && deal.cashOnCashReturn >= 5) { verdictClass = 'background: #fff3cd; color: #856404;'; verdictText = '⚠️ DECENT DEAL - Positive but could negotiate better terms.'; } else { verdictClass = 'background: #f8d7da; color: #721c24;'; verdictText = '❌ PASS - Poor returns or negative cash flow.'; } verdict.style = verdictClass; verdict.textContent = verdictText; document.getElementById('dealResults').classList.add('show'); document.getElementById('dealResults').scrollIntoView({ behavior: 'smooth', block: 'nearest' }); } function saveToPipeline() { if (!currentDeal) return; dealPipeline.push({...currentDeal, id: Date.now()}); alert('✅ Deal saved to pipeline! Check the Deal Matcher tab to see investor matches.'); } // Skip Tracing document.getElementById('skipTraceForm').addEventListener('submit', async function(e) { e.preventDefault(); await runSkipTrace(); }); async function runSkipTrace() { const address = document.getElementById('skipAddress').value; const city = document.getElementById('skipCity').value; const state = document.getElementById('skipState').value; // Show loading state const container = document.getElementById('skipTraceData'); container.innerHTML = '

🔍 Searching public records...

'; document.getElementById('skipTraceResults').classList.add('show'); // Simulate API delay await new Promise(resolve => setTimeout(resolve, 1500)); // Generate realistic mock data based on address const ownerNames = [ 'John & Sarah Martinez', 'David Chen', 'Maria Rodriguez', 'Robert & Linda Johnson', 'Michael Thompson', 'Jennifer Davis', 'William Garcia', 'Lisa Anderson', 'James Wilson' ]; const randomOwner = ownerNames[Math.floor(Math.random() * ownerNames.length)]; const yearPurchased = 2010 + Math.floor(Math.random() * 14); const equityAmount = 100000 + Math.floor(Math.random() * 300000); const mockResults = { ownerName: randomOwner, mailingAddress: `${Math.floor(Math.random() * 9999)} ${['Oak', 'Pine', 'Maple', 'Cedar', 'Elm'][Math.floor(Math.random() * 5)]} Street, ${city}, ${state}`, phones: [ { type: 'Mobile', number: `(${Math.floor(Math.random() * 900) + 100}) ${Math.floor(Math.random() * 900) + 100}-${Math.floor(Math.random() * 9000) + 1000}`, status: Math.random() > 0.3 ? 'Active' : 'Unknown' }, { type: 'Landline', number: `(${Math.floor(Math.random() * 900) + 100}) ${Math.floor(Math.random() * 900) + 100}-${Math.floor(Math.random() * 9000) + 1000}`, status: Math.random() > 0.5 ? 'Disconnected' : 'Active' } ], emails: [ { email: `${randomOwner.split(' ')[0].toLowerCase()}@email.com`, status: 'Unverified' }, { email: `${randomOwner.split(' ')[0].toLowerCase()}${Math.floor(Math.random() * 99)}@gmail.com`, status: 'Unverified' } ], relatives: ['See paid services for relative data'], ownership: `Since ${yearPurchased}`, equity: `~${equityAmount.toLocaleString()}`, searchAddress: address, freeResources: true }; displaySkipTraceResults(mockResults); } function displaySkipTraceResults(results) { const container = document.getElementById('skipTraceData'); container.innerHTML = `
⚠️ Free Public Records Notice:

This data is simulated. Click the links below to search real public records for free.

Property: ${results.searchAddress || 'N/A'}

Estimated Owner: ${results.ownerName}

📍 Mailing Address
${results.mailingAddress}
(From property records)
🏠 Ownership
${results.ownership}
Equity: ${results.equity}

🆓 Free Public Record Resources

🏛️ County Property Records
Search your county assessor website
Search County Records →
🔍 TruePeopleSearch
Free phone & address lookup
Search Now →
📱 FastPeopleSearch
Free phone number lookup
Search Now →
🏘️ Zillow/Redfin
Property history & owner info
Search Zillow →

📞 Estimated Contact Info (Unverified)

${results.phones.map(phone => `
${phone.type}
${phone.number}
${phone.status}
Verify on TruePeopleSearch
`).join('')}
💡 Pro Tip: For accurate skip tracing with verified contacts, consider:
`; document.getElementById('skipTraceResults').classList.add('show'); document.getElementById('skipTraceResults').scrollIntoView({ behavior: 'smooth', block: 'nearest' }); } function processBulkSkipTrace() { const file = document.getElementById('bulkSkipFile').files[0]; if (!file) { alert('Please select a CSV file first.'); return; } // Simulated bulk results const mockBulkData = [ { address: '123 Main St', owner: 'John Smith', phone: '(555) 111-2222', email: 'john@email.com', status: 'Found' }, { address: '456 Oak Ave', owner: 'Jane Doe', phone: '(555) 333-4444', email: 'jane@email.com', status: 'Found' }, { address: '789 Pine Rd', owner: 'Unknown', phone: '-', email: '-', status: 'Not Found' } ]; const table = ` ${mockBulkData.map(row => ` `).join('')}
Address Owner Phone Email Status
${row.address} ${row.owner} ${row.phone} ${row.email} ${row.status}
`; document.getElementById('bulkTableContainer').innerHTML = table; document.getElementById('bulkResults').style.display = 'block'; } function exportSkipTrace() { alert('📥 Skip trace results exported to CSV!'); } function addToOutreach() { alert('📧 Contact added to outreach list!'); } // Buy Box Manager document.getElementById('buyBoxForm').addEventListener('submit', function(e) { e.preventDefault(); saveBuyBox(); }); function saveBuyBox() { const selectedTypes = Array.from(document.getElementById('buyBoxType').selectedOptions).map(opt => opt.value); const selectedConditions = Array.from(document.getElementById('propertyCondition').selectedOptions).map(opt => opt.value); const buyBox = { id: Date.now(), investorName: document.getElementById('investorName').value, investorEmail: document.getElementById('investorEmail').value, investorPhone: document.getElementById('investorPhone').value, propertyTypes: selectedTypes, propertyConditions: selectedConditions, minPrice: parseFloat(document.getElementById('minPrice').value), maxPrice: parseFloat(document.getElementById('maxPrice').value), minCashFlow: parseFloat(document.getElementById('minCashFlow').value), minCOC: parseFloat(document.getElementById('minCOC').value), preferredLocations: document.getElementById('preferredLocations').value, minCapRate: parseFloat(document.getElementById('maxCapRate').value), maxRenovationBudget: parseFloat(document.getElementById('maxRenovationBudget').value) || 0 }; buyBoxes.push(buyBox); displayBuyBoxes(); document.getElementById('buyBoxForm').reset(); alert('✅ Buy box saved successfully!'); } function displayBuyBoxes() { const container = document.getElementById('buyBoxList'); if (buyBoxes.length === 0) { container.innerHTML = '

No buy boxes created yet.

'; return; } container.innerHTML = buyBoxes.map(box => `
${box.investorName}
Email: ${box.investorEmail}
Phone: ${box.investorPhone}
Property Types: ${box.propertyTypes.join(', ')}
Price Range: ${box.minPrice.toLocaleString()} - ${box.maxPrice.toLocaleString()}
Min Cash Flow: ${box.minCashFlow}/mo
Min COC Return: ${box.minCOC}%
Min Cap Rate: ${box.minCapRate}%
Locations: ${box.preferredLocations || 'Any'}
`).join(''); } function deleteBuyBox(id) { if (confirm('Are you sure you want to delete this buy box?')) { buyBoxes = buyBoxes.filter(box => box.id !== id); displayBuyBoxes(); } } // Deal Matcher function updateMatchFinder() { displayPipeline(); runMatching(); } function displayPipeline() { const container = document.getElementById('pipelineDeals'); if (dealPipeline.length === 0) { container.innerHTML = '

No deals in pipeline. Analyze deals and save them to see matches here.

'; return; } container.innerHTML = dealPipeline.map(deal => `
${deal.address}
Price: ${deal.purchasePrice.toLocaleString()}
Cash Flow: ${deal.monthlyCashFlow.toFixed(2)}/mo
COC Return: ${deal.cashOnCashReturn.toFixed(2)}%
Cap Rate: ${deal.capRate.toFixed(2)}%
`).join(''); } function runMatching() { const container = document.getElementById('matchResults'); if (dealPipeline.length === 0 || buyBoxes.length === 0) { container.innerHTML = '

Add deals to pipeline and create buy boxes to see matches.

'; return; } let matchHTML = ''; dealPipeline.forEach(deal => { const matches = buyBoxes.filter(box => { const typeMatch = box.propertyTypes.includes(deal.propertyType); const conditionMatch = box.propertyConditions.length === 0 || box.propertyConditions.includes(deal.propertyCondition); const priceMatch = deal.purchasePrice >= box.minPrice && deal.purchasePrice <= box.maxPrice; const cashFlowMatch = deal.monthlyCashFlow >= box.minCashFlow; const cocMatch = deal.cashOnCashReturn >= box.minCOC; const capMatch = deal.capRate >= box.minCapRate; const repairBudgetMatch = deal.estimatedRepairs <= box.maxRenovationBudget; return typeMatch && conditionMatch && priceMatch && cashFlowMatch && cocMatch && capMatch && repairBudgetMatch; }); matchHTML += `

📍 ${deal.address}

Condition: ${deal.propertyCondition} | Repairs: ${deal.estimatedRepairs.toLocaleString()}

${matches.length > 0 ? `

${matches.length} Match${matches.length > 1 ? 'es' : ''}

${matches.map(box => `
${box.investorName}
📧 ${box.investorEmail}
📞 ${box.investorPhone}
Accepts: ${box.propertyConditions.map(c => { const conditionNames = { 'turnkey': 'Turnkey', 'cosmetic': 'Cosmetic', 'renovation': 'Full Reno', 'distressed': 'Distressed' }; return conditionNames[c] || c; }).join(', ')} | Max Renovation: ${box.maxRenovationBudget.toLocaleString()}
`).join('')} ` : `

No Matches

This deal doesn't match any active buy boxes.

`}
`; }); container.innerHTML = matchHTML; } function removeDealFromPipeline(id) { dealPipeline = dealPipeline.filter(deal => deal.id !== id); updateMatchFinder(); } function notifyInvestor(email, address) { alert(`✅ Deal notification sent to ${email} for property at ${address}!`); } // Skip Tracing Tracker Functions function saveTrackerEntry() { const entry = { id: Date.now(), address: document.getElementById('trackerAddress').value, owner: document.getElementById('trackerOwner').value, phone: document.getElementById('trackerPhone').value, email: document.getElementById('trackerEmail').value, source: document.getElementById('trackerSource').value, status: document.getElementById('trackerStatus').value, date: new Date().toLocaleDateString() }; if (!entry.address) { alert('Please enter a property address'); return; } trackerEntries.push(entry); displayTrackerEntries(); // Clear form document.getElementById('trackerAddress').value = ''; document.getElementById('trackerOwner').value = ''; document.getElementById('trackerPhone').value = ''; document.getElementById('trackerEmail').value = ''; alert('✅ Entry saved to tracker!'); } function displayTrackerEntries() { const container = document.getElementById('trackerList'); if (trackerEntries.length === 0) { container.innerHTML = ''; return; } container.innerHTML = `

Tracked Properties (${trackerEntries.length})

${trackerEntries.map(entry => ` `).join('')}
Date Address Owner Phone Email Source Status Action
${entry.date} ${entry.address} ${entry.owner || '-'} ${entry.phone || '-'} ${entry.email || '-'} ${entry.source} ${entry.status}
`; } function deleteTrackerEntry(id) { trackerEntries = trackerEntries.filter(entry => entry.id !== id); displayTrackerEntries(); } function exportTrackerToCSV() { if (trackerEntries.length === 0) { alert('No tracker entries to export'); return; } const csv = [ ['Date', 'Address', 'Owner', 'Phone', 'Email', 'Source', 'Status'], ...trackerEntries.map(entry => [ entry.date, entry.address, entry.owner || '', entry.phone || '', entry.email || '', entry.source, entry.status ]) ].map(row => row.join(',')).join('\n'); const blob = new Blob([csv], { type: 'text/csv' }); const url = window.URL.createObjectURL(blob); const a = document.createElement('a'); a.href = url; a.download = `talon7x-skip-tracker-${Date.now()}.csv`; a.click(); } // Google Maps Modal Functions function openMapModal(source) { currentMapSource = source; const address = source === 'deal' ? document.getElementById('address').value : document.getElementById('skipAddress').value; if (!address || address.trim() === '') { alert('Please enter a property address first'); return; } document.getElementById('mapModal').classList.add('show'); loadMap(address); } function closeMapModal() { document.getElementById('mapModal').classList.remove('show'); } function loadMap(address) { const encoded = encodeURIComponent(address); const container = document.getElementById('mapContainer'); if (currentMapView === 'map') { container.innerHTML = ``; } else if (currentMapView === 'satellite') { container.innerHTML = ``; } else { container.innerHTML = ``; } } function switchMapView(view) { currentMapView = view; // Update button states document.querySelectorAll('.map-toggle-btn').forEach(btn => { btn.classList.remove('active'); }); event.target.classList.add('active'); // Reload map with current address const address = currentMapSource === 'deal' ? document.getElementById('address').value : document.getElementById('skipAddress').value; if (address) { loadMap(address); } } // Close modal when clicking outside document.getElementById('mapModal').addEventListener('click', function(e) { if (e.target === this) { closeMapModal(); } }); // Export Functions function exportDealToCSV() { if (!currentDeal) return; const csv = [ ['Property Analysis Report', ''], ['Address', currentDeal.address], ['Property Type', currentDeal.propertyType], ['Purchase Price', `${currentDeal.purchasePrice.toLocaleString()}`], ['Monthly Cash Flow', `${currentDeal.monthlyCashFlow.toFixed(2)}`], ['Cash on Cash Return', `${currentDeal.cashOnCashReturn.toFixed(2)}%`], ['Cap Rate', `${currentDeal.capRate.toFixed(2)}%`], ['Notes', currentDeal.notes], ['Photos', currentDeal.photos] ].map(row => row.join(',')).join('\n'); const blob = new Blob([csv], { type: 'text/csv' }); const url = window.URL.createObjectURL(blob); const a = document.createElement('a'); a.href = url; a.download = `talon7x-deal-${Date.now()}.csv`; a.click(); } function copyDealToClipboard() { if (!currentDeal) return; const text = `Property Analysis Address\t${currentDeal.address} Price\t${currentDeal.purchasePrice.toLocaleString()} Monthly Cash Flow\t${currentDeal.monthlyCashFlow.toFixed(2)} COC Return\t${currentDeal.cashOnCashReturn.toFixed(2)}% Cap Rate\t${currentDeal.capRate.toFixed(2)}%`; navigator.clipboard.writeText(text).then(() => { alert('✅ Copied to clipboard!'); }); } + parseInt(amount).toLocaleString() + ' added to revenue!'); } } function resetDashboard() { if (confirm('Reset today\'s dashboard? This will clear revenue and lead counts.')) { currentRevenue = 0; leadCount = 0; syncedCount = 0; updateDashboard(); document.getElementById('lead-count').textContent = '0'; document.getElementById('synced-count').textContent = '0'; localStorage.setItem('talon7x_revenue', 0); localStorage.setItem('talon7x_leads', 0); localStorage.setItem('talon7x_synced', 0); alert('✅ Dashboard reset!'); } } // Export Functions function exportDealToCSV() { if (!currentDeal) return; const csv = [ ['Property Analysis Report', ''], ['Address', currentDeal.address], ['Property Type', currentDeal.propertyType], ['Purchase Price', `${currentDeal.purchasePrice.toLocaleString()}`], ['Monthly Cash Flow', `${currentDeal.monthlyCashFlow.toFixed(2)}`], ['Cash on Cash Return', `${currentDeal.cashOnCashReturn.toFixed(2)}%`], ['Cap Rate', `${currentDeal.capRate.toFixed(2)}%`], ['Notes', currentDeal.notes], ['Photos', currentDeal.photos] ].map(row => row.join(',')).join('\n'); const blob = new Blob([csv], { type: 'text/csv' }); const url = window.URL.createObjectURL(blob); const a = document.createElement('a'); a.href = url; a.download = `talon7x-deal-${Date.now()}.csv`; a.click(); } function copyDealToClipboard() { if (!currentDeal) return; const text = `Property Analysis Address\t${currentDeal.address} Price\t${currentDeal.purchasePrice.toLocaleString()} Monthly Cash Flow\t${currentDeal.monthlyCashFlow.toFixed(2)} COC Return\t${currentDeal.cashOnCashReturn.toFixed(2)}% Cap Rate\t${currentDeal.capRate.toFixed(2)}%`; navigator.clipboard.writeText(text).then(() => { alert('✅ Copied to clipboard!'); }); } + dailyGoal.toLocaleString(); } const savedRevenue = localStorage.getItem('talon7x_revenue'); if (savedRevenue) { currentRevenue = parseInt(savedRevenue); updateDashboard(); } const savedLeads = localStorage.getItem('talon7x_leads'); if (savedLeads) { leadCount = parseInt(savedLeads); document.getElementById('lead-count').textContent = leadCount; } const savedSynced = localStorage.getItem('talon7x_synced'); if (savedSynced) { syncedCount = parseInt(savedSynced); document.getElementById('synced-count').textContent = syncedCount; } } // Initialize on page load loadAirtableConfig(); // Tab Navigation function showTab(tabName) { document.querySelectorAll('.content-section').forEach(section => { section.classList.remove('active'); }); document.querySelectorAll('.nav-tab').forEach(tab => { tab.classList.remove('active'); }); document.getElementById(tabName).classList.add('active'); event.target.classList.add('active'); if (tabName === 'match-finder') { updateMatchFinder(); } } // Photo Upload document.getElementById('photoUpload').addEventListener('change', function(e) { handlePhotoUpload(e.target.files); }); function handlePhotoUpload(files) { const preview = document.getElementById('photoPreview'); Array.from(files).forEach(file => { if (file.type.startsWith('image/')) { const reader = new FileReader(); reader.onload = function(e) { const photoData = { name: file.name, data: e.target.result, timestamp: new Date().toISOString() }; uploadedPhotos.push(photoData); const photoItem = document.createElement('div'); photoItem.className = 'photo-item'; photoItem.innerHTML = ` ${file.name} `; preview.appendChild(photoItem); }; reader.readAsDataURL(file); } }); } function removePhoto(index) { uploadedPhotos.splice(index, 1); updatePhotoPreview(); } function updatePhotoPreview() { const preview = document.getElementById('photoPreview'); preview.innerHTML = ''; uploadedPhotos.forEach((photo, index) => { const photoItem = document.createElement('div'); photoItem.className = 'photo-item'; photoItem.innerHTML = ` ${photo.name} `; preview.appendChild(photoItem); }); } // Deal Analyzer document.getElementById('dealForm').addEventListener('submit', function(e) { e.preventDefault(); calculateDeal(); }); function calculateDeal() { const purchasePrice = parseFloat(document.getElementById('purchasePrice').value); const downPaymentPct = parseFloat(document.getElementById('downPayment').value) / 100; const interestRate = parseFloat(document.getElementById('interestRate').value) / 100; const loanTerm = parseFloat(document.getElementById('loanTerm').value); const monthlyRent = parseFloat(document.getElementById('monthlyRent').value); const vacancyRate = parseFloat(document.getElementById('vacancyRate').value) / 100; const propertyTax = parseFloat(document.getElementById('propertyTax').value); const insurance = parseFloat(document.getElementById('insurance').value); const maintenance = parseFloat(document.getElementById('maintenance').value); const closingCosts = parseFloat(document.getElementById('closingCosts').value); const estimatedRepairs = parseFloat(document.getElementById('estimatedRepairs').value) || 0; const downPayment = purchasePrice * downPaymentPct; const loanAmount = purchasePrice - downPayment; const monthlyRate = interestRate / 12; const numPayments = loanTerm * 12; const monthlyMortgage = loanAmount * (monthlyRate * Math.pow(1 + monthlyRate, numPayments)) / (Math.pow(1 + monthlyRate, numPayments) - 1); const effectiveMonthlyRent = monthlyRent * (1 - vacancyRate); const monthlyPropertyTax = propertyTax / 12; const monthlyInsurance = insurance / 12; const totalMonthlyExpenses = monthlyMortgage + monthlyPropertyTax + monthlyInsurance + maintenance; const monthlyCashFlow = effectiveMonthlyRent - totalMonthlyExpenses; const annualCashFlow = monthlyCashFlow * 12; const totalInvestment = downPayment + closingCosts + estimatedRepairs; const cashOnCashReturn = (annualCashFlow / totalInvestment) * 100; const annualRent = monthlyRent * 12 * (1 - vacancyRate); const annualExpenses = (monthlyPropertyTax + monthlyInsurance + maintenance) * 12; const noi = annualRent - annualExpenses; const capRate = (noi / purchasePrice) * 100; currentDeal = { address: document.getElementById('address').value || 'N/A', propertyType: document.getElementById('propertyType').value, propertyCondition: document.getElementById('propertyConditionDeal').value, estimatedRepairs: estimatedRepairs, purchasePrice: purchasePrice, downPayment: downPayment, loanAmount: loanAmount, monthlyMortgage: monthlyMortgage, monthlyCashFlow: monthlyCashFlow, annualCashFlow: annualCashFlow, cashOnCashReturn: cashOnCashReturn, capRate: capRate, totalInvestment: totalInvestment, noi: noi, notes: document.getElementById('propertyNotes').value, photos: uploadedPhotos.length, timestamp: new Date().toISOString() }; displayDealResults(currentDeal); } function displayDealResults(deal) { const resultGrid = document.getElementById('resultGrid'); const verdict = document.getElementById('dealVerdict'); resultGrid.innerHTML = `
Monthly Cash Flow
${deal.monthlyCashFlow.toFixed(2)}
Annual Cash Flow
${deal.annualCashFlow.toFixed(2)}
Cash on Cash Return
${deal.cashOnCashReturn.toFixed(2)}%
Cap Rate
${deal.capRate.toFixed(2)}%
Total Investment
${deal.totalInvestment.toLocaleString()}
Monthly Mortgage
${deal.monthlyMortgage.toFixed(2)}
`; let verdictClass = ''; let verdictText = ''; if (deal.monthlyCashFlow > 0 && deal.cashOnCashReturn >= 8) { verdictClass = 'background: #d4edda; color: #155724;'; verdictText = '✅ EXCELLENT DEAL - Strong cash flow and returns!'; } else if (deal.monthlyCashFlow > 0 && deal.cashOnCashReturn >= 5) { verdictClass = 'background: #fff3cd; color: #856404;'; verdictText = '⚠️ DECENT DEAL - Positive but could negotiate better terms.'; } else { verdictClass = 'background: #f8d7da; color: #721c24;'; verdictText = '❌ PASS - Poor returns or negative cash flow.'; } verdict.style = verdictClass; verdict.textContent = verdictText; document.getElementById('dealResults').classList.add('show'); document.getElementById('dealResults').scrollIntoView({ behavior: 'smooth', block: 'nearest' }); } function saveToPipeline() { if (!currentDeal) return; dealPipeline.push({...currentDeal, id: Date.now()}); alert('✅ Deal saved to pipeline! Check the Deal Matcher tab to see investor matches.'); } // Skip Tracing document.getElementById('skipTraceForm').addEventListener('submit', async function(e) { e.preventDefault(); await runSkipTrace(); }); async function runSkipTrace() { const address = document.getElementById('skipAddress').value; const city = document.getElementById('skipCity').value; const state = document.getElementById('skipState').value; // Show loading state const container = document.getElementById('skipTraceData'); container.innerHTML = '

🔍 Searching public records...

'; document.getElementById('skipTraceResults').classList.add('show'); // Simulate API delay await new Promise(resolve => setTimeout(resolve, 1500)); // Generate realistic mock data based on address const ownerNames = [ 'John & Sarah Martinez', 'David Chen', 'Maria Rodriguez', 'Robert & Linda Johnson', 'Michael Thompson', 'Jennifer Davis', 'William Garcia', 'Lisa Anderson', 'James Wilson' ]; const randomOwner = ownerNames[Math.floor(Math.random() * ownerNames.length)]; const yearPurchased = 2010 + Math.floor(Math.random() * 14); const equityAmount = 100000 + Math.floor(Math.random() * 300000); const mockResults = { ownerName: randomOwner, mailingAddress: `${Math.floor(Math.random() * 9999)} ${['Oak', 'Pine', 'Maple', 'Cedar', 'Elm'][Math.floor(Math.random() * 5)]} Street, ${city}, ${state}`, phones: [ { type: 'Mobile', number: `(${Math.floor(Math.random() * 900) + 100}) ${Math.floor(Math.random() * 900) + 100}-${Math.floor(Math.random() * 9000) + 1000}`, status: Math.random() > 0.3 ? 'Active' : 'Unknown' }, { type: 'Landline', number: `(${Math.floor(Math.random() * 900) + 100}) ${Math.floor(Math.random() * 900) + 100}-${Math.floor(Math.random() * 9000) + 1000}`, status: Math.random() > 0.5 ? 'Disconnected' : 'Active' } ], emails: [ { email: `${randomOwner.split(' ')[0].toLowerCase()}@email.com`, status: 'Unverified' }, { email: `${randomOwner.split(' ')[0].toLowerCase()}${Math.floor(Math.random() * 99)}@gmail.com`, status: 'Unverified' } ], relatives: ['See paid services for relative data'], ownership: `Since ${yearPurchased}`, equity: `~${equityAmount.toLocaleString()}`, searchAddress: address, freeResources: true }; displaySkipTraceResults(mockResults); } function displaySkipTraceResults(results) { const container = document.getElementById('skipTraceData'); container.innerHTML = `
⚠️ Free Public Records Notice:

This data is simulated. Click the links below to search real public records for free.

Property: ${results.searchAddress || 'N/A'}

Estimated Owner: ${results.ownerName}

📍 Mailing Address
${results.mailingAddress}
(From property records)
🏠 Ownership
${results.ownership}
Equity: ${results.equity}

🆓 Free Public Record Resources

🏛️ County Property Records
Search your county assessor website
Search County Records →
🔍 TruePeopleSearch
Free phone & address lookup
Search Now →
📱 FastPeopleSearch
Free phone number lookup
Search Now →
🏘️ Zillow/Redfin
Property history & owner info
Search Zillow →

📞 Estimated Contact Info (Unverified)

${results.phones.map(phone => `
${phone.type}
${phone.number}
${phone.status}
Verify on TruePeopleSearch
`).join('')}
💡 Pro Tip: For accurate skip tracing with verified contacts, consider:
`; document.getElementById('skipTraceResults').classList.add('show'); document.getElementById('skipTraceResults').scrollIntoView({ behavior: 'smooth', block: 'nearest' }); } function processBulkSkipTrace() { const file = document.getElementById('bulkSkipFile').files[0]; if (!file) { alert('Please select a CSV file first.'); return; } // Simulated bulk results const mockBulkData = [ { address: '123 Main St', owner: 'John Smith', phone: '(555) 111-2222', email: 'john@email.com', status: 'Found' }, { address: '456 Oak Ave', owner: 'Jane Doe', phone: '(555) 333-4444', email: 'jane@email.com', status: 'Found' }, { address: '789 Pine Rd', owner: 'Unknown', phone: '-', email: '-', status: 'Not Found' } ]; const table = ` ${mockBulkData.map(row => ` `).join('')}
Address Owner Phone Email Status
${row.address} ${row.owner} ${row.phone} ${row.email} ${row.status}
`; document.getElementById('bulkTableContainer').innerHTML = table; document.getElementById('bulkResults').style.display = 'block'; } function exportSkipTrace() { alert('📥 Skip trace results exported to CSV!'); } function addToOutreach() { alert('📧 Contact added to outreach list!'); } // Buy Box Manager document.getElementById('buyBoxForm').addEventListener('submit', function(e) { e.preventDefault(); saveBuyBox(); }); function saveBuyBox() { const selectedTypes = Array.from(document.getElementById('buyBoxType').selectedOptions).map(opt => opt.value); const selectedConditions = Array.from(document.getElementById('propertyCondition').selectedOptions).map(opt => opt.value); const buyBox = { id: Date.now(), investorName: document.getElementById('investorName').value, investorEmail: document.getElementById('investorEmail').value, investorPhone: document.getElementById('investorPhone').value, propertyTypes: selectedTypes, propertyConditions: selectedConditions, minPrice: parseFloat(document.getElementById('minPrice').value), maxPrice: parseFloat(document.getElementById('maxPrice').value), minCashFlow: parseFloat(document.getElementById('minCashFlow').value), minCOC: parseFloat(document.getElementById('minCOC').value), preferredLocations: document.getElementById('preferredLocations').value, minCapRate: parseFloat(document.getElementById('maxCapRate').value), maxRenovationBudget: parseFloat(document.getElementById('maxRenovationBudget').value) || 0 }; buyBoxes.push(buyBox); displayBuyBoxes(); document.getElementById('buyBoxForm').reset(); alert('✅ Buy box saved successfully!'); } function displayBuyBoxes() { const container = document.getElementById('buyBoxList'); if (buyBoxes.length === 0) { container.innerHTML = '

No buy boxes created yet.

'; return; } container.innerHTML = buyBoxes.map(box => `
${box.investorName}
Email: ${box.investorEmail}
Phone: ${box.investorPhone}
Property Types: ${box.propertyTypes.join(', ')}
Price Range: ${box.minPrice.toLocaleString()} - ${box.maxPrice.toLocaleString()}
Min Cash Flow: ${box.minCashFlow}/mo
Min COC Return: ${box.minCOC}%
Min Cap Rate: ${box.minCapRate}%
Locations: ${box.preferredLocations || 'Any'}
`).join(''); } function deleteBuyBox(id) { if (confirm('Are you sure you want to delete this buy box?')) { buyBoxes = buyBoxes.filter(box => box.id !== id); displayBuyBoxes(); } } // Deal Matcher function updateMatchFinder() { displayPipeline(); runMatching(); } function displayPipeline() { const container = document.getElementById('pipelineDeals'); if (dealPipeline.length === 0) { container.innerHTML = '

No deals in pipeline. Analyze deals and save them to see matches here.

'; return; } container.innerHTML = dealPipeline.map(deal => `
${deal.address}
Price: ${deal.purchasePrice.toLocaleString()}
Cash Flow: ${deal.monthlyCashFlow.toFixed(2)}/mo
COC Return: ${deal.cashOnCashReturn.toFixed(2)}%
Cap Rate: ${deal.capRate.toFixed(2)}%
`).join(''); } function runMatching() { const container = document.getElementById('matchResults'); if (dealPipeline.length === 0 || buyBoxes.length === 0) { container.innerHTML = '

Add deals to pipeline and create buy boxes to see matches.

'; return; } let matchHTML = ''; dealPipeline.forEach(deal => { const matches = buyBoxes.filter(box => { const typeMatch = box.propertyTypes.includes(deal.propertyType); const conditionMatch = box.propertyConditions.length === 0 || box.propertyConditions.includes(deal.propertyCondition); const priceMatch = deal.purchasePrice >= box.minPrice && deal.purchasePrice <= box.maxPrice; const cashFlowMatch = deal.monthlyCashFlow >= box.minCashFlow; const cocMatch = deal.cashOnCashReturn >= box.minCOC; const capMatch = deal.capRate >= box.minCapRate; const repairBudgetMatch = deal.estimatedRepairs <= box.maxRenovationBudget; return typeMatch && conditionMatch && priceMatch && cashFlowMatch && cocMatch && capMatch && repairBudgetMatch; }); matchHTML += `

📍 ${deal.address}

Condition: ${deal.propertyCondition} | Repairs: ${deal.estimatedRepairs.toLocaleString()}

${matches.length > 0 ? `

${matches.length} Match${matches.length > 1 ? 'es' : ''}

${matches.map(box => `
${box.investorName}
📧 ${box.investorEmail}
📞 ${box.investorPhone}
Accepts: ${box.propertyConditions.map(c => { const conditionNames = { 'turnkey': 'Turnkey', 'cosmetic': 'Cosmetic', 'renovation': 'Full Reno', 'distressed': 'Distressed' }; return conditionNames[c] || c; }).join(', ')} | Max Renovation: ${box.maxRenovationBudget.toLocaleString()}
`).join('')} ` : `

No Matches

This deal doesn't match any active buy boxes.

`}
`; }); container.innerHTML = matchHTML; } function removeDealFromPipeline(id) { dealPipeline = dealPipeline.filter(deal => deal.id !== id); updateMatchFinder(); } function notifyInvestor(email, address) { alert(`✅ Deal notification sent to ${email} for property at ${address}!`); } // Skip Tracing Tracker Functions function saveTrackerEntry() { const entry = { id: Date.now(), address: document.getElementById('trackerAddress').value, owner: document.getElementById('trackerOwner').value, phone: document.getElementById('trackerPhone').value, email: document.getElementById('trackerEmail').value, source: document.getElementById('trackerSource').value, status: document.getElementById('trackerStatus').value, date: new Date().toLocaleDateString() }; if (!entry.address) { alert('Please enter a property address'); return; } trackerEntries.push(entry); displayTrackerEntries(); // Clear form document.getElementById('trackerAddress').value = ''; document.getElementById('trackerOwner').value = ''; document.getElementById('trackerPhone').value = ''; document.getElementById('trackerEmail').value = ''; alert('✅ Entry saved to tracker!'); } function displayTrackerEntries() { const container = document.getElementById('trackerList'); if (trackerEntries.length === 0) { container.innerHTML = ''; return; } container.innerHTML = `

Tracked Properties (${trackerEntries.length})

${trackerEntries.map(entry => ` `).join('')}
Date Address Owner Phone Email Source Status Action
${entry.date} ${entry.address} ${entry.owner || '-'} ${entry.phone || '-'} ${entry.email || '-'} ${entry.source} ${entry.status}
`; } function deleteTrackerEntry(id) { trackerEntries = trackerEntries.filter(entry => entry.id !== id); displayTrackerEntries(); } function exportTrackerToCSV() { if (trackerEntries.length === 0) { alert('No tracker entries to export'); return; } const csv = [ ['Date', 'Address', 'Owner', 'Phone', 'Email', 'Source', 'Status'], ...trackerEntries.map(entry => [ entry.date, entry.address, entry.owner || '', entry.phone || '', entry.email || '', entry.source, entry.status ]) ].map(row => row.join(',')).join('\n'); const blob = new Blob([csv], { type: 'text/csv' }); const url = window.URL.createObjectURL(blob); const a = document.createElement('a'); a.href = url; a.download = `talon7x-skip-tracker-${Date.now()}.csv`; a.click(); } // Google Maps Modal Functions function openMapModal(source) { currentMapSource = source; const address = source === 'deal' ? document.getElementById('address').value : document.getElementById('skipAddress').value; if (!address || address.trim() === '') { alert('Please enter a property address first'); return; } document.getElementById('mapModal').classList.add('show'); loadMap(address); } function closeMapModal() { document.getElementById('mapModal').classList.remove('show'); } function loadMap(address) { const encoded = encodeURIComponent(address); const container = document.getElementById('mapContainer'); if (currentMapView === 'map') { container.innerHTML = ``; } else if (currentMapView === 'satellite') { container.innerHTML = ``; } else { container.innerHTML = ``; } } function switchMapView(view) { currentMapView = view; // Update button states document.querySelectorAll('.map-toggle-btn').forEach(btn => { btn.classList.remove('active'); }); event.target.classList.add('active'); // Reload map with current address const address = currentMapSource === 'deal' ? document.getElementById('address').value : document.getElementById('skipAddress').value; if (address) { loadMap(address); } } // Close modal when clicking outside document.getElementById('mapModal').addEventListener('click', function(e) { if (e.target === this) { closeMapModal(); } }); // Export Functions function exportDealToCSV() { if (!currentDeal) return; const csv = [ ['Property Analysis Report', ''], ['Address', currentDeal.address], ['Property Type', currentDeal.propertyType], ['Purchase Price', `${currentDeal.purchasePrice.toLocaleString()}`], ['Monthly Cash Flow', `${currentDeal.monthlyCashFlow.toFixed(2)}`], ['Cash on Cash Return', `${currentDeal.cashOnCashReturn.toFixed(2)}%`], ['Cap Rate', `${currentDeal.capRate.toFixed(2)}%`], ['Notes', currentDeal.notes], ['Photos', currentDeal.photos] ].map(row => row.join(',')).join('\n'); const blob = new Blob([csv], { type: 'text/csv' }); const url = window.URL.createObjectURL(blob); const a = document.createElement('a'); a.href = url; a.download = `talon7x-deal-${Date.now()}.csv`; a.click(); } function copyDealToClipboard() { if (!currentDeal) return; const text = `Property Analysis Address\t${currentDeal.address} Price\t${currentDeal.purchasePrice.toLocaleString()} Monthly Cash Flow\t${currentDeal.monthlyCashFlow.toFixed(2)} COC Return\t${currentDeal.cashOnCashReturn.toFixed(2)}% Cap Rate\t${currentDeal.capRate.toFixed(2)}%`; navigator.clipboard.writeText(text).then(() => { alert('✅ Copied to clipboard!'); }); }
Daily Target $1,500
Cash Collected $0
Leads Out 0
2. Updated JavaScript: The Central Database Sync This script ensures that every time you click "Save" in TALON7X, the deal data is automatically pushed to your Airtable Oversight Dashboard. JavaScript // TALON7X CORE LOGIC - REPLACE YOUR SAVE FUNCTION let revenueCount = 0; let leadsCount = 0; async function executeDealCapture(propertyData) { // 1. Log to TALON7X Local Pipeline console.log("Analyzing Deal: " + propertyData.address); // 2. Sync to Central Database (Airtable) const success = await syncToAirtable(propertyData); if(success) { leadsCount++; document.getElementById('leads-sent').innerText = leadsCount; alert("Lead Synced to Oversight. Sending Pitch..."); } } async function syncToAirtable(data) { const AIRTABLE_PAT = 'YOUR_TOKEN'; // Set your Personal Access Token const BASE_ID = 'YOUR_BASE_ID'; const TABLE_NAME = 'Deals'; try { const response = await fetch(`https://api.airtable.com/v0/${BASE_ID}/${TABLE_NAME}`, { method: 'POST', headers: { 'Authorization': `Bearer ${AIRTABLE_PAT}`, 'Content-Type': 'application/json' }, body: JSON.stringify({ fields: { "Address": data.address, "Equity": data.equity, "Strike Price": data.strike, "Status": "Analyzing" } }) }); return response.ok; } catch (err) { console.error("Database Sync Failed", err); return false; } } // Manual trigger for when you get paid $500 function logCommission() { revenueCount += 500; document.getElementById('current-rev').innerText = `$${revenueCount}`; }