/* PVRescue marketing site — shared chrome: contact, helpers, QuoteForm, header, footer, floating actions. */ (function(){ const { Button, Icon, Input, Select, Card, Badge, BrandChip } = window.PVRescueDesignSystem_b3a34e; /* ---- Contact details -------------------------------------------------- */ const CONTACT = { phoneLabel: '074 303 9999', phoneHref: 'tel:+27743039999', waLabel: '074 303 9999', waHref: 'https://wa.me/27743039999', email: 'gerhard@pvrescue.co.za', emailHref: 'mailto:gerhard@pvrescue.co.za', }; /* Web3Forms — quote-form leads are emailed to whichever address is set for this access key in the Web3Forms dashboard (set that to gerhard@pvrescue.co.za). */ const WEB3FORMS_KEY = '5c665032-7b25-41cf-b0d3-96e1269a6d8f'; const SERVICES_LIST = ['New solar installation', 'Battery backup', 'Pi²R solar geyser', 'Electrical work', 'Maintenance / repair', 'Farm / agricultural']; const WA_SVG = ''; function WAIcon({ size = 20 }) { return React.createElement('span', { style: { width: size, height: size, display: 'inline-flex', flex: 'none' }, dangerouslySetInnerHTML: { __html: WA_SVG } }); } function Eyebrow({ children, tone }) { return React.createElement('span', { className: 'pvr-eyebrow', style: tone === 'light' ? { color: '#fff' } : undefined }, children); } function Section({ id, children, style, narrow }) { return (
{children}
); } function H2({ children, light, style }) { return

{children}

; } /* ---------------------------------------------------------------- QuoteForm */ function QuoteForm({ variant = 'light', compact = false }) { const [done, setDone] = React.useState(null); const dark = variant === 'dark'; const submit = async (e) => { e.preventDefault(); const form = e.target; const data = new FormData(form); data.append('access_key', WEB3FORMS_KEY); data.append('subject', 'New quote request — PVRescue website'); data.append('from_name', 'PVRescue Website'); try { const res = await fetch('https://api.web3forms.com/submit', { method: 'POST', body: data }); const json = await res.json(); if (json.success) { setDone('PVR-' + Math.floor(2000 + Math.random() * 7999)); form.reset(); } else { alert('Sorry — something went wrong. Please call or WhatsApp us on +27 74 303 9999.'); } } catch (err) { alert('Network error. Please call or WhatsApp us on +27 74 303 9999.'); } }; if (done) { return (
Request received

We'll call you back within 1 business hour. Your ref is {done}.

Chat on WhatsApp now
); } return (
} required aria-label="Phone number" />
} aria-label="Suburb" />
No obligation · we reply within the hour
); } /* ------------------------------------------------------------------- Header */ const NAV = [['services', 'Services'], ['how', 'How it works'], ['why', 'Why us'], ['areas', 'Areas'], ['faq', 'FAQ']]; function jump(id) { const el = document.getElementById(id); if (el) window.scrollTo({ top: el.getBoundingClientRect().top + window.scrollY - 76, behavior: 'smooth' }); } function SiteHeader() { return (
{ e.preventDefault(); window.scrollTo({ top: 0, behavior: 'smooth' }); }}> PVRescue
{CONTACT.phoneLabel}
); } /* ------------------------------------------------------------------- Footer */ function FootCol({ title, children }) { return (
{title}
{children}
); } function FLink({ children, href, onClick }) { return {children}; } function SiteFooter() { return ( ); } /* ----------------------------------------------------- Floating quick actions */ function FloatingActions() { return ( <>
Call now WhatsApp
); } Object.assign(window, { PVR_CONTACT: CONTACT, PVR_SERVICES_LIST: SERVICES_LIST, WAIcon, SiteEyebrow: Eyebrow, SiteSection: Section, SiteH2: H2, QuoteForm, SiteHeader, SiteFooter, FloatingActions, siteJump: jump }); })();