(()=>{const popovers=(document.querySelectorAll('.wp-is-tooltip'));let openTimeout;popovers.forEach(function(popover){const trigger=(popover.querySelector('.wp-tooltip__toggle'));const panel=(popover.querySelector('span.wp-tooltip__bubble'));if(!trigger||!panel){return;}
const showTooltip=()=>{clearTimeout(openTimeout);openTimeout=setTimeout(()=>{if(!panel.matches(':popover-open')){panel.showPopover({source:trigger});}},300);};const hideTooltip=()=>{clearTimeout(openTimeout);if(panel.matches(':popover-open')){panel.hidePopover();}};trigger.addEventListener('mouseenter',showTooltip);trigger.addEventListener('focus',showTooltip);trigger.addEventListener('mouseleave',hideTooltip);trigger.addEventListener('blur',hideTooltip);});})();