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 (
);
}
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});