/* COPYRIGHT Esri - https://js.arcgis.com/5.0.18/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{copy as l,transformMat4 as p}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import c from"../../../../geometry/Polygon.js";import{projectBuffer as n}from"../../../../geometry/projection/projectBuffer.js";import{TileTreeDebugger as m}from"../../../support/TileTreeDebugger.js";let u=class extends m{constructor(e){super(e)}getTiles(){const e=this.lv.getVisibleNodes(),t=this.view.renderSpatialReference,o=this.nodeSR;return e.map(e=>f(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 f(e,r,t){const o=e.serviceObbInIndexSR;if(null==o||null==r)return null;s(h,o.quaternion),l(j,o.center),n(j,t,0,j,r,0),h[12]=j[0],h[13]=j[1],h[14]=j[2];const i=[[],[],[]];p(j,o.halfSize,h),n(j,r,0,j,t,0),i[0].push([j[0],j[1]]),l(j,o.halfSize),j[0]=-j[0],p(j,j,h),n(j,r,0,j,t,0),i[0].push([j[0],j[1]]),l(j,o.halfSize),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]]),l(j,o.halfSize),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]),l(j,o.halfSize),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]]),l(j,o.halfSize),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]),l(j,o.halfSize),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 a=new c({rings:i,spatialReference:t});return{lij:[e.level,e.childCount,0],level:e.level,label:e.id,geometry:a}}e([t({constructOnly:!0})],u.prototype,"lv",void 0),e([t({constructOnly:!0})],u.prototype,"nodeSR",void 0),u=e([o("esri.views.3d.layers.support.I3STreeDebugger")],u);const h=i(),j=a();export{u as I3STreeDebugger};
