/*
All material copyright Esri, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
*/
import{__decorate as o}from"tslib";import t from"../../core/Accessor.js";import{ignoreAbortErrors as i}from"../../core/promiseUtils.js";import{property as n,subclass as e}from"../../core/accessorSupport/decorators.js";import s from"./ZoomConditions2D.js";import r from"./ZoomConditions3D.js";let m=class extends t{constructor(o){super(o)}destroy(){this.view=null}get canZoomIn(){return null!=this._zoomConditions&&this._zoomConditions.canZoomIn}get canZoomOut(){return null!=this._zoomConditions&&this._zoomConditions?.canZoomOut}get state(){return this.view?.ready?"ready":"disabled"}set view(o){o?"2d"===o.type?this._zoomConditions=new s({view:o}):"3d"===o.type&&(this._zoomConditions=new r({view:o})):this._zoomConditions=null,this._set("view",o)}zoomIn(){const o=this.view;this.canZoomIn&&o&&("2d"===o.type?o.mapViewNavigation.zoomIn():i(o.goTo({zoomFactor:2})))}zoomOut(){const o=this.view;this.canZoomOut&&o&&("2d"===o.type?o.mapViewNavigation.zoomOut():i(o.goTo({zoomFactor:.5})))}};o([n()],m.prototype,"_zoomConditions",void 0),o([n()],m.prototype,"canZoomIn",null),o([n()],m.prototype,"canZoomOut",null),o([n({readOnly:!0})],m.prototype,"state",null),o([n()],m.prototype,"view",null),m=o([e("esri.widgets.Zoom.ZoomViewModel")],m);const a=m;export{a as default};
