// diag-results.jsx — Resultados: scorecard, radar, brecha, proyección, recomendación y envío. function normalizePhone(raw) { let d = (raw || '').replace(/\D/g, ''); if (d.startsWith('00')) d = d.slice(2); if (d.length === 10) d = '52' + d; // MX local sin lada de país return d; } function buildSummaryText(nombre, scores, rec, growth) { const L = window.diagLevelLabel; const lines = []; lines.push(`THE NEXT LEVEL 360 — Diagnóstico de ${nombre || 'tu perfil'}`); lines.push(''); lines.push(`Hoy estás en: ${rec.avg.toFixed(1)}/5 · Nivel "${L(rec.avg)}"`); lines.push(`Tu siguiente nivel: ${growth.goal.toFixed(1)}/5 · "${L(growth.goal)}"`); lines.push(''); lines.push('TUS 8 EJES (hoy → siguiente nivel):'); scores.forEach(s => { const gap = (s.target - s.current); const arrow = gap > 0.1 ? ` (+${gap.toFixed(1)})` : ''; lines.push(`• ${s.n} ${s.name}: ${s.current.toFixed(1)} → ${s.target.toFixed(1)}${arrow}`); }); lines.push(''); lines.push(`EJE PRIORITARIO: ${rec.top.name}`); lines.push(`TIEMPO ESTIMADO: ${rec.estWeeks} semanas`); lines.push(`PROGRAMA SUGERIDO: ${rec.program.title} (${rec.program.meta.price})`); lines.push(''); lines.push('Tu siguiente nivel empieza hoy. — Coach Arturo Ceballos'); return lines.join('\n'); } /* mensaje optimizado para WhatsApp: encabezado visual + resumen + CTA con link */ function buildWhatsAppText(nombre, scores, rec, growth) { const L = window.diagLevelLabel; const first = nombre ? nombre.split(' ')[0] : ''; const top3 = rec.focus.map(f => ` • *${f.name}:* ${f.current.toFixed(1)} → ${f.target.toFixed(1)}`).join('\n'); return ( `🎯 *THE NEXT LEVEL 360* *Diagnóstico de los 8 Ejes* ━━━━━━━━━━━━━━━ ${first ? `Hola, soy *${first}*. Comparto mi diagnóstico y quiero más información 👇` : 'Hola, comparto mi diagnóstico y quiero más información 👇'} 📍 *Hoy estoy en:* ${rec.avg.toFixed(1)}/5 — _${L(rec.avg)}_ 🚀 *Mi siguiente nivel:* ${growth.goal.toFixed(1)}/5 — _${L(growth.goal)}_ ⏱ *Tiempo estimado:* ${rec.estWeeks} semanas 🔑 *Eje prioritario:* ${rec.top.name} 📊 *Mis 3 prioridades:* ${top3} ✅ *Programa sugerido:* ${rec.program.title} · ${rec.program.meta.price} 📎 _Adjunto el PDF completo de mi diagnóstico._ — vía Coach Arturo Ceballos 👉 https://thenextlevel360.com` ); } const IconWA = () => ( ); const IconMail = () => ( ); function Results({ data, scores, rec, growth, onRestart }) { const summary = buildSummaryText(data.nombre, scores, rec, growth); const waText = buildWhatsAppText(data.nombre, scores, rec, growth); const COACH_WA = '525568095911'; const waHref = `https://wa.me/${COACH_WA}?text=${encodeURIComponent(waText)}`; const mailHref = `mailto:${encodeURIComponent(data.email || '')}` + `?subject=${encodeURIComponent('Tu Diagnóstico The Next Level 360')}` + `&body=${encodeURIComponent(summary)}`; const L = window.diagLevelLabel; const p = rec.program; const first = data.nombre ? data.nombre.split(' ')[0] : ''; const handleWAClick = () => { // trigger PDF download so the user can attach it in the chat setTimeout(() => { if (typeof window.__diagPrintPdf === 'function') { try { window.__diagPrintPdf(); } catch(e){} } }, 400); }; return (
Tu diagnóstico está listo

{first ? first + ', ' : ''}este es tu punto de partida

Hoy estás en el nivel {L(rec.avg)}. Tu siguiente nivel es {L(growth.goal)}, y tu mayor oportunidad está en {rec.top.name}.

{rec.avg.toFixed(1)} /5
Hoy · {L(rec.avg)}
{growth.goal.toFixed(1)} /5
Tu siguiente nivel
{rec.estWeeks} sem
Para lograrlo
{/* RADAR */}

Mapa de los 8 ejes

Hoy Tu siguiente nivel
{/* BRECHA (dot-plot coloquial) */}

¿Qué te falta para subir de nivel?

Aquí estás hoy Aquí quieres llegar
Para cerrar esta brecha y llegar a tu siguiente nivel necesitas aproximadamente {rec.estWeeks} semanas de trabajo enfocado.
{/* GROWTH PROJECTION */} {/* RECOMMENDATION */}
● Tu siguiente paso recomendado
{rec.focus.map(f => ( {f.name} {f.current.toFixed(1)}→{f.target.toFixed(1)} ))}

{p.title}

{rec.reason}

    {p.bullets.map((b, i) =>
  • {b}
  • )}
{p.tag}
Duración estimada
{rec.estWeeks} semanas
Inversión
{p.meta.price}
Enviar por WhatsApp Enviar a mi correo
Al enviar se abre tu chat con el equipo (+52 556 809 5911) con el resumen, y se genera tu PDF para que lo adjuntes en el mismo chat.
Volver a empezar el diagnóstico
); } Object.assign(window, { Results, buildSummaryText, normalizePhone });