/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
import{__decorate as e}from"tslib";import{isSome as r}from"../../../../core/arrayUtils.js";import{property as t,subclass as o}from"../../../../core/accessorSupport/decorators.js";import{fromQuat as s}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{create as l}from"../../../../core/libs/gl-matrix-2/factories/quatf64.js";import{transformMat4 as p,copy as c}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as m}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import a from"../../../../geometry/Polygon.js";import{projectBuffer as n}from"../../../../geometry/projection/projectBuffer.js";import{TileTreeDebugger as u}from"../../../support/TileTreeDebugger.js";let f=class extends u{constructor(e){super(e)}getTiles(){const e=this.lv.getVisibleNodes(),t=this.view.renderSpatialReference,o=this.nodeSR;return e.map(e=>g(e,t,o)).filter(r).sort((e,r)=>e.lij[0]===r.lij[0]?e.label>r.label?-1:1:e.lij[0]-r.lij[0])}};function g(e,r,t){const o=e.serviceObbInIndexSR;if(null==o||null==r)return null;s(h,o.getQuaternion(l())),o.getCenter(j),n(j,t,0,j,r,0),h[12]=j[0],h[13]=j[1],h[14]=j[2];const i=[[],[],[]],u=o.getHalfSize(m());p(j,u,h),n(j,r,0,j,t,0),i[0].push([j[0],j[1]]),c(j,u),j[0]=-j[0],p(j,j,h),n(j,r,0,j,t,0),i[0].push([j[0],j[1]]),c(j,u),j[0]=-j[0],j[1]=-j[1],p(j,j,h),n(j,r,0,j,t,0),i[0].push([j[0],j[1]]),c(j,u),j[1]=-j[1],p(j,j,h),n(j,r,0,j,t,0),i[0].push([j[0],j[1]]),i[1].push(i[0][0]),i[1].push(i[0][1]),c(j,u),j[0]=-j[0],j[2]=-j[2],p(j,j,h),n(j,r,0,j,t,0),i[1].push([j[0],j[1]]),c(j,u),j[2]=-j[2],p(j,j,h),n(j,r,0,j,t,0),i[1].push([j[0],j[1]]),i[2].push(i[0][0]),i[2].push(i[0][3]),o.getHalfSize(j),j[1]=-j[1],j[2]=-j[2],p(j,j,h),n(j,r,0,j,t,0),i[2].push([j[0],j[1]]),i[2].push(i[1][3]);const f=new a({rings:i,spatialReference:t});return{lij:[e.level,e.childCount,0],level:e.level,label:e.id,geometry:f}}e([t({constructOnly:!0})],f.prototype,"lv",void 0),e([t({constructOnly:!0})],f.prototype,"nodeSR",void 0),f=e([o("esri.views.3d.layers.support.I3STreeDebugger")],f);const h=i(),j=m();export{f as I3STreeDebugger};
