import layoutManager from"./layoutmanager.js";import events from"./emby-apiclient/events.js";let defaultScope=document.body,scopes=[],_currentScope=defaultScope;function pushScope(elem){scopes.includes(elem)||(scopes.push(elem),_currentScope=elem)}function removeItemOnce(arr,value){value=arr.indexOf(value);return-1=activeElementRect.bottom)continue;break;case 3:if(elementRect.bottom<=activeElementRect.bottom)continue;if(elementRectTop<=activeElementTop)continue}var x2=elementRectLeft+elementRectWidth-1,y2=elementRectTop+elementRectHeight-1;let distX,distY;switch(direction){case 0:var intersectY=intersection(point1y,point2y,elementRectTop,y2);distX=Math.abs(point1x-Math.min(point1x,x2)),distY=intersectY||1+Math.min(Math.abs(point1y-y2),Math.abs(point2y-elementRectTop));break;case 1:{let intersectY=intersection(point1y,point2y,elementRectTop,y2);distX=Math.abs(point2x-Math.max(point2x,elementRectLeft)),distY=intersectY||1+Math.min(Math.abs(point1y-y2),Math.abs(point2y-elementRectTop));break}case 2:intersectY=intersection(point1x,point2x,elementRectLeft,x2);distY=Math.abs(point1y-Math.min(point1y,y2)),distX=intersectY||1+Math.min(Math.abs(point1x-x2),Math.abs(point2x-elementRectLeft));break;case 3:{let intersectX=intersection(point1x,point2x,elementRectLeft,x2);distY=Math.abs(point2y-Math.max(point2y,elementRectTop)),distX=intersectX||1+Math.min(Math.abs(point1x-x2),Math.abs(point2x-elementRectLeft));break}}elementRectWidth=Math.sqrt(distX*distX+distY*distY);elementRectWidth