Module 812901

1,590 characters · in 37839834fb0c345a.js
Dependencies
Lazily required by (0)none
Requires (0)none
Lazily requires (0)none
Source Raw
function(e,t,l){l.d(t,{A:()=>s,G:()=>c});var i,s=((i={}).Backstage="backstage",i.WithinAppContent="within-app-content",i.AboveAppContent="above-app-content",i);let n={backstage:0,"within-app-content":1,"above-app-content":1002};class a{_pool=null;setPool(e){this._pool=e}get pool(){if(null==this._pool)throw Error("FramePlacementStrategy: pool accessed before setPool");return this._pool}}class r extends a{placed=new Map;rafHandle=null;initialize(e){e.style.position="fixed",e.style.top="0",e.style.left="0",e.style.pointerEvents="none",e.style.display="none",this.pool.appendChild(e)}place(e,t,l){this.placed.set(e,{target:t,level:l}),this.position(e,t,l),this.ensureTicking()}unplace(e){this.placed.delete(e),e.style.display="none"}ensureTicking(){null==this.rafHandle&&(this.rafHandle=requestAnimationFrame(this.tick))}position(e,t,l){let i=t.getBoundingClientRect();e.style.display="block",e.style.zIndex=String(n[l]),e.style.transform=`translate(${i.left}px, ${i.top}px)`,e.style.width=`${i.width}px`,e.style.height=`${i.height}px`}tick=()=>{for(let[e,{target:t,level:l}]of this.placed)this.position(e,t,l);this.rafHandle=this.placed.size>0?requestAnimationFrame(this.tick):null}}class o extends a{initialize(e){e.style.width="100%",e.style.height="100%",e.style.pointerEvents="none",e.style.display="none",this.pool.appendChild(e)}place(e,t,l){e.parentElement!==t&&t.moveBefore(e,null),e.style.display="block"}unplace(e){e.parentElement!==this.pool&&this.pool.moveBefore(e,null),e.style.display="none"}}function c(){return"function"==typeof Element.prototype.moveBefore?new o:new r}}