// WEVAL Product Assistant Chatbot — Self-injecting widget (function() { 'use strict'; if(document.getElementById('weval-bot-widget')) return; // Already loaded // Inject CSS var style = document.createElement('style'); style.id = 'weval-bot-css'; style.textContent = `#weval-bot-btn{width:56px;height:56px;border-radius:50%;background:linear-gradient(135deg,#6366f1,#8b5cf6);border:none;cursor:pointer;box-shadow:0 4px 24px rgba(99,102,241,.4);display:flex;align-items:center;justify-content:center;transition:transform .2s,box-shadow .2s}#weval-bot-btn:hover{transform:scale(1.08);box-shadow:0 6px 32px rgba(99,102,241,.5)}#weval-bot-btn svg{width:28px;height:28px;fill:#fff}#weval-bot-badge{position:absolute;top:-2px;right:-2px;width:14px;height:14px;background:#22c55e;border-radius:50%;border:2px solid #fff;animation:pulse-badge 2s infinite}@keyframes pulse-badge{0%,100%{opacity:1}50%{opacity:.5}}#weval-bot-panel{display:none;position:fixed;bottom:90px;right:20px;width:380px;max-height:520px;background:#0f1629;border:1px solid rgba(99,102,241,.2);border-radius:16px;box-shadow:0 12px 48px rgba(0,0,0,.5);overflow:hidden;flex-direction:column}#weval-bot-panel.open{display:flex}#weval-bot-head{background:linear-gradient(135deg,#6366f1,#8b5cf6);padding:14px 18px;display:flex;align-items:center;gap:10px}#weval-bot-head .avatar{width:36px;height:36px;border-radius:50%;background:rgba(255,255,255,.2);display:flex;align-items:center;justify-content:center;font-size:18px}#weval-bot-head .info{flex:1;color:#fff}#weval-bot-head .info .name{font-weight:600;font-size:14px}#weval-bot-head .info .status{font-size:11px;opacity:.8}#weval-bot-close{background:none;border:none;color:rgba(255,255,255,.7);cursor:pointer;font-size:20px;padding:4px}#weval-bot-msgs{flex:1;overflow-y:auto;padding:14px;display:flex;flex-direction:column;gap:10px;min-height:280px;max-height:360px}.bot-msg{max-width:85%;padding:10px 14px;border-radius:12px;font-size:13px;line-height:1.5;word-wrap:break-word}.bot-msg.bot{background:rgba(99,102,241,.12);color:#e2e8f0;border-bottom-left-radius:4px;align-self:flex-start}.bot-msg.user{background:#6366f1;color:#fff;border-bottom-right-radius:4px;align-self:flex-end}.bot-msg a{color:#818cf8;text-decoration:underline}.bot-typing{display:flex;gap:4px;padding:10px 14px;align-self:flex-start}.bot-typing span{width:6px;height:6px;background:#6366f1;border-radius:50%;animation:bounce .6s infinite alternate}.bot-typing span:nth-child(2){animation-delay:.2s}.bot-typing span:nth-child(3){animation-delay:.4s}@keyframes bounce{to{opacity:.3;transform:translateY(-4px)}}#weval-bot-input-area{padding:10px 14px;border-top:1px solid rgba(255,255,255,.06);display:flex;gap:8px}#weval-bot-input{flex:1;background:rgba(255,255,255,.06);border:1px solid rgba(255,255,255,.1);border-radius:8px;padding:8px 12px;color:#e2e8f0;font-size:13px;outline:none}#weval-bot-input::placeholder{color:rgba(255,255,255,.3)}#weval-bot-send{background:#6366f1;border:none;border-radius:8px;padding:8px 12px;color:#fff;cursor:pointer;font-size:13px;font-weight:600}#weval-bot-send:hover{background:#5558e6}.quick-btns{display:flex;flex-wrap:wrap;gap:6px;margin-top:6px}.quick-btn{background:rgba(99,102,241,.15);border:1px solid rgba(99,102,241,.25);color:#a5b4fc;padding:5px 10px;border-radius:6px;font-size:11px;cursor:pointer;transition:all .15s}.quick-btn:hover{background:rgba(99,102,241,.3);color:#fff}`; document.head.appendChild(style); // Inject HTML var wrapper = document.createElement('div'); wrapper.innerHTML = `
W
WEVAL Assistant
En ligne - 37 produits
`; while(wrapper.firstChild) document.body.appendChild(wrapper.firstChild); // Run JS const PRODUCTS_KB = { deliVerscore: {name:'DeliverScore',desc:'Audit deliverability email - SPF/DKIM/DMARC/blacklists. Score + recommandations IA.',price:'Gratuit + Pro $49/mo',url:'/products/deliverscore.html',category:'Email Intelligence'}, medreach: {name:'MedReach API',desc:'Base de 18596 medecins verifies au Maghreb. API REST + export.',price:'Gratuit + Pro $299/mo',url:'/products/medreach.html',category:'Data'}, gpu: {name:'WEVIA Inference',desc:'IA Souveraine propulsee par WEVIA sur GPU RTX 4000 Ada. API OpenAI-compatible.',price:'Gratuit + Pro $99/mo',url:'/products/gpu-inference.html',category:'IA'}, contentfactory: {name:'AI Content Factory',desc:'Génération de contenu IA - articles, fiches produits, LinkedIn. 6 templates.',price:'Gratuit + Pro $29/mo',url:'/products/content-factory.html',category:'IA'}, proposalai: {name:'ProposalAI',desc:'Generateur de propositions commerciales qualité Big4. Brief -> propale en 30 sec.',price:'Gratuit + Pro $19/mo',url:'/products/proposalai.html',category:'IA'}, blueprintai: {name:'BlueprintAI',desc:'Process docs, BPMN, CDC, blueprints L1/L2/L3, 8D, RACI.',price:'$25/mo',url:'/products/blueprintai.html',category:'IA'}, storeforge: {name:'StoreForge',desc:'E-commerce IA. Boutique en 5 min. Descriptions IA, chatbot WEVIA, paiement Maroc.',price:'0-$29/mo',url:'/products/storeforge.html',category:'Commerce'}, leadforge: {name:'LeadForge',desc:'collecte de donnees B2B sur mesure. Leads verifies tous secteurs. 0.30-0.$50/lead.',price:'0.30-0.$49/lead',url:'/products/workspace.html',category:'Data'}, mailwarm: {name:'MailWarm',desc:'Warmup email automatique. 500+ seeds. Inbox 90%+ en 4-6 semaines.',price:'$29/compte/mo',url:'/products/workspace.html',category:'Email'}, sentinel: {name:'Sentinel Monitor',desc:'Cyber monitoring PME - SSL, ports, DNS, OWASP. Alertes Telegram.',price:'Gratuit + Pro $49/mo',url:'/products/workspace.html',category:'Security'}, outreachai: {name:'OutreachAI',desc:'Cold outreach IA. Upload leads -> IA personnalisé -> envoi -> tracking.',price:'$199/mo',url:'/products/workspace.html',category:'Email'}, wevia: {name:'WEVIA White-Label',desc:'Chatbot IA cle en main. Widget embed 5 min. KB custom, memoire, vision.',price:'100-$299/mo',url:'/products/wevia-whitelabel.html',category:'IA'}, emailverify: {name:'EmailVerify',desc:'Validation email temps reel MX+SMTP+disposable.',price:'$49/mo',url:'/products/workspace.html',category:'Email Intelligence'}, blacklistguard: {name:'BlacklistGuard',desc:'Monitoring 100+ blacklists RBL + alertes.',price:'$29/mo',url:'/products/workspace.html',category:'Email Intelligence'}, reputationai: {name:'ReputationAI',desc:'Score reputation domaine + historique.',price:'$39/mo',url:'/products/workspace.html',category:'Email Intelligence'}, copyai: {name:'CopyAI WEVAL',desc:'Copywriting IA - emails, sujets, CTA. GPU souverain.',price:'$39/mo',url:'/products/workspace.html',category:'IA'}, dataharvest: {name:'DataHarvest',desc:'collecte de donnees web avance anti-detect avec rotation.',price:'$99/mo',url:'/products/workspace.html',category:'Data'}, smsforge: {name:'SMSForge',desc:'SMS marketing Maghreb/Europe.',price:'$49/mo',url:'/products/workspace.html',category:'Marketing'}, adscontrol: {name:'AdsControl',desc:'Multi-channel ads FB/Google/LinkedIn/TikTok.',price:'$99/mo',url:'/products/workspace.html',category:'Marketing'}, wevalcrm: {name:'WEVAL CRM',desc:'CRM leger pipeline + contacts + IA.',price:'Gratuit + Pro $29/mo',url:'/products/workspace.html',category:'Business'}, canvasai: {name:'CanvasAI',desc:'Design IA - visuels, bannieres, logos.',price:'$29/mo',url:'/products/workspace.html',category:'IA'}, devforge: {name:'DevForge AI',desc:'12 modules dev: specs, tests, code gen, API design, security review.',price:'$199/mo',url:'/products/workspace.html',category:'Dev'}, medreachhcp: {name:'MedReach HCP',desc:'Data 18596 medecins verifies Maghreb + campagnes pharma HCP.',price:'$299/mo',url:'/products/workspace.html',category:'Data'}, arsenal: {name:'Arsenal Framework',desc:'150+ ecrans. ERP Intelligence, Brain Engine, PMTA. Enterprise.',price:'2000-$9,999/mo',url:'/products/arsenal.html',category:'Flagship'}, wevads: {name:'WEVADS Platform',desc:'Infrastructure email complete. Brain Engine 646 configs. 6.65M contacts.',price:'Enterprise',url:'/products/wevads.html',category:'Flagship'},};function getProductList() { return Object.values(PRODUCTS_KB).map(p => `${p.name} - ${p.desc} (${p.price})`).join('

');}function findProducts(query) { const q = query.toLowerCase(); const matches = []; const keywords = { email: ['deliVerscore','emailverify','blacklistguard','reputationai','mailwarm','outreachai'], ia: ['gpu','contentfactory','proposalai','blueprintai','copyai','canvasai','devforge','wevia'], data: ['medreach','leadforge','dataharvest','ethica'], security: ['sentinel','blacklistguard'], ecommerce: ['storeforge'], marketing: ['smsforge','adscontrol','outreachai'], crm: ['wevalcrm'], sap: ['arsenal'], enterprise: ['arsenal','wevads','wevia'], gratuit: [], prix: [], maroc: ['medreach','ethica','smsforge','storeforge'], }; for (const [kw, ids] of Object.entries(keywords)) { if (q.includes(kw)) ids.forEach(id => { if (!matches.includes(id)) matches.push(id); }); } // Also search in product names and descriptions for (const [id, p] of Object.entries(PRODUCTS_KB)) { if (p.name.toLowerCase().includes(q) || p.desc.toLowerCase().includes(q) || p.category.toLowerCase().includes(q)) { if (!matches.includes(id)) matches.push(id); } } return matches.map(id => PRODUCTS_KB[id]).filter(Boolean);}function botReply(userMsg) { const q = userMsg.toLowerCase(); // Greetings if (/^(bonjour|salut|hello|hi|hey|coucou)/.test(q)) { return `Bonjour ! Je suis l'assistant WEVAL. Nous avons 37 produits SaaS en production. Comment puis-je vous aider ?
Voir les produitsEmailIATarifs
`; } // List all if (/tous|tout|liste|produit|service|catalogue|quoi/.test(q)) { const cats = {}; Object.values(PRODUCTS_KB).forEach(p => { if (!cats[p.category]) cats[p.category]=[]; cats[p.category].push(p); }); let html = `Voici nos ${Object.keys(PRODUCTS_KB).length} produits par categorie :

`; for (const [cat, prods] of Object.entries(cats)) { html += `${cat}
`; prods.forEach(p => { html += `• ${p.name} - ${p.price}
`; }); html += '
'; } html += `
EmailIAGratuit
`; return html; } // Pricing if (/prix|tarif|cout|combien|pricing|gratuit|free/.test(q)) { const free = Object.values(PRODUCTS_KB).filter(p => p.price.toLowerCase().includes('gratuit')); let html = `Produits avec plan gratuit (${free.length}):
`; free.forEach(p => { html += `• ${p.name} - ${p.price}
`; }); html += `
Tous les prix sont sur notre catalogue. Besoin d'un devis personnalisé ?
Demander une demoNous contacter
`; return html; } // Demo / essai if (/demo|essai|tester|try|commencer|start/.test(q)) { return `Pour commencer gratuitement :

1. Ouvrir le Workspace et creer un compte
2. Vous aurez acces a tous les produits gratuits
3. Testez DeliverScore, WEVIA Inference, Content Factory...

Ou contactez-nous pour une demo personnalisée !
Ouvrir Workspace
`; } // Specific product search const matches = findProducts(q); if (matches.length > 0) { let html = `J'ai trouve ${matches.length} produit(s) correspondant :

`; matches.slice(0, 6).forEach(p => { html += `${p.name}
${p.desc}
${p.price}

`; }); if (matches.length > 6) html += `...et ${matches.length - 6} autres.
`; html += `
Voir ${matches[0].name}Tarifs
`; return html; } // Default - suggest contacting or browsing return `Je n'ai pas trouve de produit specifique pour "${userMsg}". Nos 37 produits couvrent : Email Intelligence, IA/GPU, Data, Security, Marketing, E-commerce et Dev.

Voir toutContacter WEVALWorkspace
`;}function toggleBot() { const p = document.getElementById('weval-bot-panel'); p.classList.toggle('open'); if (p.classList.contains('open') && document.getElementById('weval-bot-msgs').children.length === 0) { addMsg('bot', `Bonjour ! Je suis l'assistant produits WEVAL. Nous proposons 37 SaaS en production. Que recherchez-vous ?
CatalogueEmailIAGratuitDemo
`); } document.getElementById('weval-bot-badge').style.display = 'none';}function addMsg(type, html) { const msgs = document.getElementById('weval-bot-msgs'); const div = document.createElement('div'); div.className = 'bot-msg ' + type; div.innerHTML = html; msgs.appendChild(div); msgs.scrollTop = msgs.scrollHeight;}function askBot(q) { document.getElementById('weval-bot-input').value = q; sendBot();}function sendBot() { const input = document.getElementById('weval-bot-input'); const msg = input.value.trim(); if (!msg) return; input.value = ''; addMsg('user', msg); // Show typing const msgs = document.getElementById('weval-bot-msgs'); const typing = document.createElement('div'); typing.className = 'bot-typing'; typing.innerHTML = ''; msgs.appendChild(typing); msgs.scrollTop = msgs.scrollHeight; setTimeout(() => { typing.remove(); addMsg('bot', botReply(msg)); }, 400 + Math.random() * 600);} // Expose functions globally for onclick handlers window.toggleBot = toggleBot; window.sendBot = sendBot; window.askBot = askBot; })();