// jsdom (without pretendToBeVisual) has no requestAnimationFrame, but the
// overlay components rely on it for the a-hide -> a-show transition cycle.
if(!globalThis.requestAnimationFrame) {
globalThis.requestAnimationFrame = callback => setTimeout(() => callback(performance.now()), 0);
globalThis.cancelAnimationFrame = clearTimeout;
}
// jsdom has no layout engine, so scrolling is a no-op.
if(!Element.prototype.scrollIntoView) {
Element.prototype.scrollIntoView = () => {};
}
export function raf() {
return new Promise(resolve => requestAnimationFrame(() => resolve()));
}