/* All material copyright ESRI, All Rights Reserved, unless otherwise specified. See https://js.arcgis.com/4.25/esri/copyright.txt for details. */ import{_ as e}from"../chunks/tslib.es6.js";import s from"../core/Accessor.js";import r from"../core/Collection.js";import{watch as t,initial as o}from"../core/reactiveUtils.js";import{property as i}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import"../core/accessorSupport/ensureType.js";import{subclass as a}from"../core/accessorSupport/decorators/subclass.js";let p=class extends s{constructor(e){super(e),this.view=null,this.baseLayerViews=new r,this.referenceLayerViews=new r,this._loadingHandle=t((()=>this.view?.map?.basemap),(e=>{e&&e.load().catch((()=>{}))}),o)}destroy(){this._set("view",null),this._loadingHandle&&(this._loadingHandle.remove(),this._loadingHandle=null)}get suspended(){return!this.view||this.view.suspended}get updating(){if(this.view&&this.view.suspended)return!1;const e=this.view?.map?.basemap;return!!e&&(!!e.loaded&&(this.baseLayerViews.some((e=>e.updating))||this.referenceLayerViews.some((e=>e.updating))))}};e([i({constructOnly:!0})],p.prototype,"view",void 0),e([i({readOnly:!0})],p.prototype,"baseLayerViews",void 0),e([i({readOnly:!0})],p.prototype,"referenceLayerViews",void 0),e([i({readOnly:!0})],p.prototype,"suspended",null),e([i({type:Boolean,readOnly:!0})],p.prototype,"updating",null),p=e([a("esri.views.BasemapView")],p);export{p as BasemapView};