/* COPYRIGHT Esri - https://js.arcgis.com/5.1.0/LICENSE.txt */
import{__decorate as e}from"tslib";import t from"../../../core/Collection.js";import{destroyHandle as i,makeHandle as r}from"../../../core/handleUtils.js";import{watch as s,syncAndInitial as o,initial as a}from"../../../core/reactiveUtils.js";import{property as l,subclass as h}from"../../../core/accessorSupport/decorators.js";import{DynamicLayerView3DMixin as n}from"./DynamicLayerView3D.js";import p from"./ImagerySubView3D.js";import{LayerView3D as d}from"./LayerView3D.js";import{ImageHighlightHelper3D as g}from"./support/ImageHighlightHelper3D.js";import m from"../support/flow/FlowSubViewExtent3D.js";import u from"../../layers/ImageryLayerView.js";import{RefreshableLayerView as y}from"../../layers/RefreshableLayerView.js";import{isPixelHighlightTarget as f}from"../../layers/support/highlightUtils.js";let w=class extends(n(y(d(u)))){constructor(){super(...arguments),this.type="imagery-3d"}get highlightOptions(){return null}get pixelData(){return null}initialize(){const e=()=>this._updatingHandles.addPromise(this.refreshDebounced());this._updatingHandles.add(()=>this.layer?.exportImageServiceParameters?.version,e),this._updatingHandles.add(()=>this.layer?.renderer,e),this._updatingHandles.add(()=>this.timeExtent,e),this._highlightHelper=new g({view:this.view,layer:this.layer,updatingHandles:this._updatingHandles}),this.addHandles([i(this._highlightHelper),s(()=>this.suspended,e=>this._highlightHelper.suspended=e,o)])}_initSubView(){this.addHandles([s(()=>this.layer.renderer,e=>this._recreateSubView(e),a)])}_recreateSubView(e){const t="flow"===e?.type,i="flow"===this.subView?.type,r=this.subView;r&&t===i||(this.subView=t?new m({layerView:this}):new p({layerView:this}),r?.destroy())}getFetchOptions(){return{timeExtent:this.timeExtent}}highlight(e,i){if("number"==typeof e||"string"==typeof e||f(e))return r();if(Array.isArray(e)||t.isCollection(e)){const t=e.at(0);if(null==t||"number"==typeof t||"string"==typeof t)return r()}return this._highlightHelper.highlight(e,i)}isUpdating(){return super.isUpdating()||this._highlightHelper.updating}};e([l()],w.prototype,"highlightOptions",null),e([l()],w.prototype,"pixelData",null),w=e([h("esri.views.3d.layers.ImageryLayerView3D")],w);const c=w;export{c as default};
