'; html+='

B2B Wholesale Listing — '+dateStr+'


'; // Title html+=''; html+=''; html+='
B2B Wholesale Product Title
Title'+escapeHtml(d.title||'')+'
Platforms'+(d.platforms||[]).join(', ')+'

'; // Highlights html+=''; (d.highlights||[]).forEach(function(h,i){ html+=''; }); html+='
5 Core Highlights
Highlight '+(i+1)+''+escapeHtml(h)+'

'; // Specs html+=''; (d.specs||[]).forEach(function(s){ html+=''; }); html+='
Product Specifications
'+escapeHtml(s.name)+''+escapeHtml(s.value)+'

'; // Pricing html+=''; (d.pricing||[]).forEach(function(p){ html+=''; }); html+='
Tiered MOQ Pricing
'+escapeHtml(p.tier)+''+escapeHtml(p.range)+'

'; // B2B Meta html+=''; html+=''; html+=''; html+=''; html+=''; html+=''; html+='
Order & Logistics
MOQ'+(d.moq||'—')+'
Lead Time'+(d.lead_time||'—')+'
Packaging'+(d.packaging||'—')+'
FOB Reference'+(d.fob_reference||'—')+'
Logistics'+(d.logistics||'—')+'

'; // Description html+=''; html+=''; html+='
Product Description
'+escapeHtml(d.description||'')+'

'; // Certifications if(d.certifications&&d.certifications.length){ html+=''; html+=''; html+='
Certifications
'+(d.certifications||[]).join(', ')+'

'; } // Market insight if(d.market_insight){ html+=''; html+=''; html+='
Market Insight
'+escapeHtml(d.market_insight)+'

'; } // Keywords html+=''; html+=''; html+='
Alibaba SEO Keywords
'+(d.keywords||[]).join(', ')+'

'; // Social posts var sp=d.social_posts||{}; html+=''; if(sp.linkedin) html+=''; if(sp.alibaba) html+=''; if(sp.whatsapp) html+=''; html+='
B2B Social Posts
LinkedIn'+escapeHtml(sp.linkedin)+'
Alibaba'+escapeHtml(sp.alibaba)+'
WhatsApp'+escapeHtml(sp.whatsapp)+'

'; html+='

Generated by SnapListing B2B — ManuTrade AI on '+dateStr+'

'; html+=''; var blob=new Blob([html],{type:'application/vnd.ms-excel'}); var url=URL.createObjectURL(blob); var a=document.createElement('a'); a.href=url; a.download='B2B_Listing_'+dateStr+'.xls'; document.body.appendChild(a);a.click(); document.body.removeChild(a);URL.revokeObjectURL(url); toast('✅ Excel file opened in your spreadsheet editor — ready to edit'); } // ═══════════════════════════════════════ // EXPORT WORD // ═══════════════════════════════════════ function exportWord(){ if(!lastListingData){toast('⚠️ Please generate the listing copy first');return;} var d=lastListingData; var now=new Date(); var dateStr=now.getFullYear()+'-'+String(now.getMonth()+1).padStart(2,'0')+'-'+String(now.getDate()).padStart(2,'0'); // Build HTML → .doc (Word opens natively as editable document) var html=''; html+=''; html+='

B2B Wholesale Listing Report

'; html+='

Generated: '+dateStr+'


'; html+='

Product Title

'; html+='

'+escapeHtml(d.title||'')+'

'; html+='

Platforms: '+(d.platforms||[]).join(', ')+'

'; html+='

5 Core Highlights

'; html+='

Product Specifications

'; (d.specs||[]).forEach(function(s){ html+=''; }); html+='
SpecificationValue
'+escapeHtml(s.name)+''+escapeHtml(s.value)+'
'; html+='

Tiered MOQ Pricing

'; (d.pricing||[]).forEach(function(p){ html+=''; }); html+='
Quantity TierUnit Price
'+escapeHtml(p.tier)+''+escapeHtml(p.range)+'
'; html+='

Order & Logistics

'; html+='

MOQ: '+(d.moq||'—')+'

'; html+='

Lead Time: '+(d.lead_time||'—')+'

'; html+='

Packaging: '+(d.packaging||'—')+'

'; html+='

FOB Reference: '+(d.fob_reference||'—')+'

'; html+='

Logistics: '+(d.logistics||'—')+'

'; html+='

Product Description

'; html+='

'+escapeHtml(d.description||'')+'

'; if(d.certifications&&d.certifications.length){ html+='

Certifications

'+(d.certifications||[]).join(', ')+'

'; } if(d.market_insight){ html+='

Market Insight

'+escapeHtml(d.market_insight)+'

'; } html+='

Alibaba SEO Keywords

'+(d.keywords||[]).join(', ')+'

'; var sp=d.social_posts||{}; if(sp.linkedin||sp.alibaba||sp.whatsapp){ html+='

B2B Social Posts

'; if(sp.linkedin) html+='

LinkedIn:
'+escapeHtml(sp.linkedin)+'

'; if(sp.alibaba) html+='

Alibaba:
'+escapeHtml(sp.alibaba)+'

'; if(sp.whatsapp) html+='

WhatsApp:
'+escapeHtml(sp.whatsapp)+'

'; } html+='

Generated by SnapListing B2B — ManuTrade AI on '+dateStr+'

'; html+=''; var blob=new Blob([html],{type:'application/msword'}); var url=URL.createObjectURL(blob); var a=document.createElement('a'); a.href=url; a.download='B2B_Listing_'+dateStr+'.doc'; document.body.appendChild(a);a.click(); document.body.removeChild(a);URL.revokeObjectURL(url); toast('✅ Word document opened in your word processor — ready to edit'); } // ═══════════════════════════════════════ // HELPER: escapeHtml // ═══════════════════════════════════════ function escapeHtml(str){ return String(str).replace(/&/g,'&').replace(//g,'>').replace(/"/g,'"'); } // ═══════════════════════════════════════ // INIT // ═══════════════════════════════════════ // Gate JS disabled — using manutradeai-auth.js instead // Auth system dispatches 'mta:unlocked' after login; content reveal is handled by auth.js. // Start the countdown timer that the removed gate used to start. window.addEventListener('mta:unlocked', function(){ startCountdown(); });