/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["exports","../../support/debugFlags"],(function(e,t){"use strict";let n,i,l=!1,o=!1,a=!1,s=!1,c=null;function r(e,t){if(!o||!i)return;p();const n=i;let l=0;for(let i=0;i<e.accBinsNumX;i++)for(let t=0;t<e.accBinsNumY;t++){const o=e.accBins[i][e.accBinsNumY-1-t];l+=o.length;const a=i*e.accBinsSizeX,s=(i+1)*e.accBinsSizeX,c=t*e.accBinsSizeY,r=(t+1)*e.accBinsSizeY;n.fillText(o.length.toFixed(),a+5,c+15),f(a,s,c,r,"blue")}n.fillText("total totalShownLabels: "+l,70,40),n.fillText("total visible labels: "+t.size,70,50),n.fillText("total numTests: "+e.accNumTests,70,30)}function u(e){a=t.DECONFLICTOR_SHOW_VISIBLE,s=t.DECONFLICTOR_SHOW_INVISIBLE,l=a||s,o=t.DECONFLICTOR_SHOW_GRID,c=null,l||o?c=()=>d(e):n&&(n.parentElement.removeChild(n),n=null)}function p(){c&&(c(),c=null)}function d(e){null==n&&(n=document.createElement("canvas"),n.setAttribute("id","canvas2d"),e.surface.parentElement.style.position="relative",e.surface.parentElement.appendChild(n));const{state:t}=e,{camera:l,pixelRatio:o}=t,{width:a,height:s}=l,c=a*o,r=s*o;n.setAttribute("width",`${c}px`),n.setAttribute("height",`${r}px`),n.setAttribute("style",`position:absolute;left:0px;top:0px;display:block;pointer-events:none;width:${a}px;height:${s}px`),i=n.getContext("2d"),i.clearRect(0,0,a,s),i.font="12px Arial"}function f(e,t,l,o,a){p();const s=n.height,c=i;c.beginPath(),c.lineWidth=1,c.strokeStyle=a,c.moveTo(e,s-l),c.lineTo(t,s-l),c.stroke(),c.lineTo(t,s-o),c.stroke(),c.lineTo(t,s-l),c.stroke(),c.lineTo(e,s-l),c.stroke(),c.lineTo(e,s-l),c.stroke(),c.closePath()}function h(e,t){l&&(t&&a||!t&&s)&&f(e.aabr[0],e.aabr[2],e.aabr[1],e.aabr[3],t?"green":"red")}e.drawAccelerationStruct=r,e.drawPoly=h,e.prepare=u,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
