"use strict";function t(t,a,e){return a in t?Object.defineProperty(t,a,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[a]=e,t}Object.defineProperty(exports,"__esModule",{value:!0});class a{static getInstance(){return a.instance||(a.instance=new a),a.instance}register(t){this.callbacks.add(t),null===this.animationFrameId&&this.start()}unregister(t){this.callbacks.delete(t),0===this.callbacks.size&&null!==this.animationFrameId&&this.stop()}start(){let t=()=>{this.callbacks.forEach(t=>t()),this.animationFrameId=requestAnimationFrame(t)};this.animationFrameId=requestAnimationFrame(t)}stop(){null!==this.animationFrameId&&(cancelAnimationFrame(this.animationFrameId),this.animationFrameId=null)}constructor(){t(this,"callbacks",new Set),t(this,"animationFrameId",null)}}t(a,"instance",void 0);var e=a.getInstance();exports.default=e;
