"use strict";exports.__esModule=!0,exports.stopRequestAnimationFrame=exports.startRequestAnimationFrame=exports.removeRender=exports.onRender=exports.forceRender=exports.clear=void 0;const RenderQueue=new Set;let stopped=!0;const onRender=a=>(RenderQueue.add(a),()=>{RenderQueue.delete(a)});exports.onRender=onRender;const removeRender=a=>{RenderQueue.delete(a)};exports.removeRender=removeRender;const clear=()=>{RenderQueue.clear()};exports.clear=clear;function render(a=0){stopped||(forceRender(a),requestAnimationFrame(render))}const forceRender=(a=0)=>{RenderQueue.forEach(b=>b(a))};exports.forceRender=forceRender;const startRequestAnimationFrame=()=>{stopped&&(stopped=!1,render())};exports.startRequestAnimationFrame=startRequestAnimationFrame;const stopRequestAnimationFrame=()=>{stopped=!0};exports.stopRequestAnimationFrame=stopRequestAnimationFrame;