/* global React, Icon, Reveal, WA_URL, PHONE_FMT, EMAIL */
const { useState: useStateFin } = React;
/* ===========================================================
Equipo y respaldo
=========================================================== */
function Team() {
return (
);
}
/* ===========================================================
Recursos / Blog
=========================================================== */
function Resources() {
const posts = [
{
cat: 'Regulación',
title: 'Net Billing en Chile: qué es y por qué es clave para autoconsumo industrial.',
read: '8 min',
date: 'May 2026',
},
{
cat: 'Regulación',
title: 'PMGD: la vía para grandes consumidores que quieren inyectar excedentes.',
read: '11 min',
date: 'Abr 2026',
},
{
cat: 'Financiamiento',
title: 'Cómo financiar tu planta solar sin tocar CAPEX: PPA, leasing y banca.',
read: '7 min',
date: 'Abr 2026',
},
{
cat: 'Técnico',
title: 'TIR, payback y LCOE: las tres cifras que deciden una cotización solar.',
read: '6 min',
date: 'Mar 2026',
},
];
return (
);
}
/* ===========================================================
Final CTA — formulario inline
=========================================================== */
function FinalCTA({ onOpenCalendar }) {
const [form, setForm] = useStateFin({
empresa: '', sector: '', consumo: '', nombre: '', cargo: '', email: '', telefono: '',
});
const [sent, setSent] = useStateFin(false);
const submit = (e) => {
e.preventDefault();
setSent(true);
};
return (
);
}
/* ===========================================================
Footer
=========================================================== */
function Footer({ onHome = true }) {
const HOME = 'index.html';
const base = onHome ? '' : HOME;
return (
Soluciones energéticas industriales en Chile.
Diseño, ingeniería, instalación y O&M de plantas solares fotovoltaicas.
SEC
ChileCompra
ISO 9001
ISO 14001
);
}
/* ===========================================================
Calendar / diagnostic Modal
=========================================================== */
function CalendarModal({ open, onClose, prefill }) {
const [step, setStep] = useStateFin(1);
const [slot, setSlot] = useStateFin(null);
const [form, setForm] = useStateFin({ empresa: '', nombre: '', email: '', telefono: '' });
const [done, setDone] = useStateFin(false);
if (!open) return null;
// Generate next 5 weekdays
const days = [];
let d = new Date();
while (days.length < 5) {
d = new Date(d.getTime() + 86400000);
if (d.getDay() !== 0 && d.getDay() !== 6) {
days.push(new Date(d));
}
}
const slots = ['09:30', '11:00', '12:30', '15:00', '16:30'];
const submit = (e) => {
e.preventDefault();
setDone(true);
};
const fmtDay = (d) => d.toLocaleDateString('es-CL', { weekday: 'short', day: 'numeric', month: 'short' });
return (
e.stopPropagation()}>
Paso {done ? 3 : step} de 3
{done ? '¡Listo!' : step === 1 ? 'Elige una hora' : 'Tus datos'}
{done ? (
Diagnóstico agendado
{slot && `${fmtDay(slot.day)} · ${slot.time} hrs`}
Te enviamos confirmación a {form.email}.
Volver al sitio
) : step === 1 ? (
Reunión de 30 min con un ingeniero de SLF. Por videollamada o en sitio.
{days.map((day, i) => (
setSlot({ day, time: null })}
className="card"
style={{
padding: 12, textAlign: 'center', cursor: 'pointer',
background: slot && slot.day.getDate() === day.getDate() ? 'var(--pv-blue)' : '#fff',
color: slot && slot.day.getDate() === day.getDate() ? '#fff' : 'var(--ink)',
borderColor: slot && slot.day.getDate() === day.getDate() ? 'var(--pv-blue)' : 'var(--line)',
}}
>
{day.toLocaleDateString('es-CL', { weekday: 'short' })}
{day.getDate()}
{day.toLocaleDateString('es-CL', { month: 'short' })}
))}
{slot && (
<>
Horarios disponibles
{slots.map((t) => (
setSlot({ ...slot, time: t })}
className="btn btn-ghost btn-sm"
style={{
background: slot.time === t ? 'var(--pv-blue)' : '#fff',
color: slot.time === t ? '#fff' : 'var(--ink)',
borderColor: slot.time === t ? 'var(--pv-blue)' : 'var(--line)',
}}
>
{t}
))}
>
)}
setStep(2)}
style={{ justifyContent: 'center', marginTop: 8 }}
>
Continuar
) : (
)}
);
}
/* ===========================================================
Floating WhatsApp
=========================================================== */
function WhatsAppFloat() {
return (
);
}
Object.assign(window, { Team, Resources, FinalCTA, Footer, CalendarModal, WhatsAppFloat });