Build 542549stable
Module 451988
1,786 characters · in no known chunkDependencies
Required by (86)
30793400565109251760612306323893067101392107750115036116956117029130553133296152567167132206845208207222823224196229683251913253363266536276208280483282413304072340137353411356645376151378135415478416052421773428978432166432779434087436405453314453903461782471107474463492684505806521337521754525788528153529433540462552143559908568004569926588224590114594467601255604121622168632638655116679492689168745317751952769299781696805945824552841595849380853390858177860071860603871421904290911411919760922016983495
Lazily required by (0)none
Requires (0)none
Lazily requires (0)none
Source Raw
function(e,t,n){"use strict";n.d(t,{BK:()=>a,Ep:()=>i,IX:()=>s,J_:()=>r,OC:()=>o});class i{_ref;start(e,t){let n=!(arguments.length>2)||void 0===arguments[2]||arguments[2];(!this.isStarted()||n)&&(this.stop(),this._ref=window.setTimeout(()=>{this._ref=null,t()},e))}stop(){null!=this._ref&&(clearTimeout(this._ref),this._ref=null)}isStarted(){return null!=this._ref}}class r{_timeout;_delay;_handler;constructor(e,t){this._delay=e,this._handler=t,this._timeout=new i}set(e){return this._delay=e,this}delay(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];this._timeout.start(this._delay,this._handler,e)}cancel(){this._timeout.stop()}isDelayed(){return this._timeout.isStarted()}}class s{_ref;start(e,t){this.stop(),this._ref=window.setInterval(t,e)}stop(){null!=this._ref&&(clearInterval(this._ref),this._ref=null)}isStarted(){return null!=this._ref}}function a(e){return new Promise(t=>{setTimeout(()=>t(),e)})}class o{invoke;predicate;delay;_promises=new Set;_pending=new Set;_flushHandler;constructor(e,t=()=>!0,n=32){this.invoke=e,this.predicate=t,this.delay=n,this._flushHandler=new r(this.delay,()=>this._flush())}queue(e){for(let t of Array.isArray(e)?e:[e])this.predicate(t)&&this._pending.add(t);return 0===this._pending.size?Promise.resolve():new Promise((e,t)=>{this._promises.add({resolve:e,reject:t}),this._flushHandler.delay(!1)})}reset(){let e=Error("BatchInvocationManager was reset");this._promises.forEach(t=>t.reject(e)),this._pending.clear(),this._promises.clear(),this._flushHandler.cancel()}async _flush(){let e=[...this._pending];this._pending.clear();let t=[...this._promises];if(this._promises.clear(),0===e.length)return void t.forEach(e=>e.resolve());try{await this.invoke(e),t.forEach(e=>e.resolve())}catch(e){t.forEach(t=>t.reject(e))}}}}