/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["../../../chunks/_rollupPluginBabelHelpers","../../../chunks/tslib.es6","../../../Graphic","../../../core/maybe","../../../core/reactiveUtils","../../../core/accessorSupport/decorators/property","../../../core/arrayUtils","../../../core/has","../../../core/accessorSupport/ensureType","../../../core/accessorSupport/decorators/subclass","./I3SMeshView3D","./interfaces","./LayerView3D","../support/updatingProperties","../../layers/LayerView"],(function(e,r,t,i,o,a,s,n,c,p,l,d,y,u,h){"use strict";const g=.2;let _=function(r){function a(){var e;return(e=r.apply(this,arguments)||this).type="integrated-mesh-3d",e.lodFactor=1,e._elevationContext="im",e._isIntegratedMesh=!0,e._supportsLabeling=!1,e.drapeTargetType=d.DrapeTargetType.WithoutRasterImage,e}e._inheritsLoose(a,r);var s=a.prototype;return s.initialize=function(){this.updatingHandles.add((()=>this.layer.modifications),(()=>this._loadModifications()),o.initial),this.view.basemapTerrain.overlayManager.registerDrapeTarget(this)},s.destroy=function(){this.view.basemapTerrain.overlayManager.unregisterDrapeTarget(this)},s._createLayerGraphic=function(){const e=new t;return e.layer=this.layer,e.sourceLayer=this.layer,e},s.canResume=function(){return r.prototype.canResume.call(this)&&(!this._controller||this._controller.rootNodeVisible)},s._loadModifications=function(){if(this.handles.remove("modifications"),i.isNone(this.layer.modifications))return void(this._modifications=[]);const e=this.layer.modifications;this.handles.add(this.updatingHandles.addOnCollectionChange((()=>e),(()=>this._modifications=e.toArray()),o.initial),"modifications")},e._createClass(a,[{key:"progressiveLoadFactor",get:function(){return this.lodFactor>=1?g:1}}]),a}(l.I3SMeshView3D(y.LayerView3D(h)));r.__decorate([a.property()],_.prototype,"layer",void 0),r.__decorate([a.property({aliasOf:"layer"})],_.prototype,"i3slayer",void 0),r.__decorate([a.property(u.updatingProgress)],_.prototype,"updatingProgress",void 0),r.__decorate([a.property({readOnly:!0,aliasOf:"_controller.updatingProgress"})],_.prototype,"updatingProgressValue",void 0),r.__decorate([a.property({readOnly:!0,aliasOf:"view.qualitySettings.sceneService.integratedMesh.lodFactor"})],_.prototype,"lodFactor",void 0),r.__decorate([a.property({readOnly:!0})],_.prototype,"progressiveLoadFactor",null),_=r.__decorate([p.subclass("esri.views.3d.layers.SceneLayerView3D")],_);return _}));
