(()=>{
  'use strict';
  if(window.__APU_CV_OVERVIEW_PULLDOWN__)return;
  window.__APU_CV_OVERVIEW_PULLDOWN__=true;
  if(document.documentElement.dataset.scrollTheme!=='computer-vision')return;
  const mobile=matchMedia('(max-width:54rem)');
  const menuSelector='.apu-v69-malaysia-menu';
  function reset(){
    if(!mobile.matches)return;
    const menu=document.querySelector(menuSelector);
    if(!menu||!menu.classList.contains('is-open'))return;
    menu.scrollTop=0; menu.scrollLeft=0;
    const overview=menu.querySelector('.apu-v631-overview-visible,[data-apu-overview="true"],[data-apu-route-key="overview"]');
    if(overview){
      overview.hidden=false;
      overview.removeAttribute('aria-hidden');
      overview.style.setProperty('display','grid','important');
      overview.style.setProperty('position','relative','important');
      overview.style.setProperty('top','auto','important');
      overview.style.setProperty('visibility','visible','important');
      overview.style.setProperty('opacity','1','important');
      if(overview!==menu.firstElementChild)menu.prepend(overview);
    }
  }
  function afterOpen(){[0,40,120,300,700].forEach(t=>setTimeout(reset,t));}
  document.addEventListener('click',e=>{
    if(e.target.closest?.('.apu-v69-native-toggle,[aria-controls="apuV69NativeMenu"]'))afterOpen();
  },true);
  const obs=new MutationObserver(()=>afterOpen());
  const start=()=>{obs.observe(document.documentElement,{subtree:true,childList:true,attributes:true,attributeFilter:['class','aria-expanded']});afterOpen();setTimeout(()=>obs.disconnect(),12000)};
  if(document.readyState==='loading')document.addEventListener('DOMContentLoaded',start,{once:true});else start();
})();
