const {Logo, Button, Icon, IconButton} = window.SuperiorNitrogenServiceDesignSystem_483eb9; function scrollToId(id){ const el=document.getElementById(id); if(el) window.scrollTo({top:el.getBoundingClientRect().top+window.scrollY-84,behavior:'smooth'}); } function useViewport(){ const [w,setW]=React.useState(typeof window!=='undefined'?window.innerWidth:1280); React.useEffect(()=>{ const onResize=()=>setW(window.innerWidth); window.addEventListener('resize',onResize,{passive:true}); return ()=>window.removeEventListener('resize',onResize); },[]); return w; } function LangToggle({lang,setLang,onDark=true}){ return (
{['en','fr'].map(l=>( ))}
); } function SiteHeader({t,lang,setLang,active}) { const C=window.SNS_CONTACT; const w=useViewport(); const isMobile=w<=980; const px=w<=480?20:w<=980?28:50; const [menuOpen,setMenuOpen]=React.useState(false); const [scrolled,setScrolled]=React.useState(false); React.useEffect(()=>{ if(!isMobile) setMenuOpen(false) },[isMobile]); React.useEffect(()=>{ const onScroll=()=>setScrolled(window.scrollY>10); window.addEventListener('scroll',onScroll,{passive:true}); onScroll(); return ()=>window.removeEventListener('scroll',onScroll); },[]); return (
{!isMobile && }
{C.tel} {C.mail}
{!isMobile && {t.utilTag}}
{e.preventDefault();window.scrollTo({top:0,behavior:'smooth'});setMenuOpen(false)}} style={{border:'none',display:'flex'}}> {!isMobile && ( <> )} {isMobile && (
setMenuOpen(o=>!o)} style={{background:'transparent',borderColor:'rgba(255,255,255,.35)',color:'var(--white)'}}/>
)}
{isMobile && menuOpen && (
{t.nav.map(([id,label])=>( {e.preventDefault();scrollToId(id);setMenuOpen(false)}} style={{border:'none',padding:'12px 0',fontFamily:'var(--font-display)',fontSize:14,fontWeight:700,letterSpacing:'.06em',textTransform:'uppercase',color:active===id?'var(--white)':'rgba(255,255,255,.66)',borderBottom:'1px solid rgba(255,255,255,.08)'}}>{label} ))}
)}
); } function SiteFooter({t}) { const C=window.SNS_CONTACT; const w=useViewport(); const isMobile=w<=760; const isTablet=w<=1024; const px=w<=480?20:w<=980?28:50; return ( ); } Object.assign(window, {SiteHeader, SiteFooter, LangToggle, scrollToId, useViewport});