/* COPYRIGHT Esri - https://js.arcgis.com/5.1.0/LICENSE.txt */
import{__decorate as t}from"tslib";import{property as r,subclass as e}from"../core/accessorSupport/decorators.js";import{GoToManager as n}from"./2d/GoToManager.js";import i from"./2d/input/MapViewInputManager.js";import{isSupportedScreenPointEvent as s,createScreenPointFromSupportedEvent as o}from"./support/screenUtils.js";const a=a=>{const p=a;let g=class extends p{constructor(...t){super(...t),this.goToManager=new n({view:this}),this.inputManager=new i({view:this}),this.addHandles([this.on("resize",t=>this.stateManager.resize(t.width,t.height))])}get interacting(){return this.navigating}get stationary(){return!this.animation&&!this.navigating&&!this.resizing&&this.stationaryManager.stationary}on(t,r,e,n){const i=this.viewEvents.on(t,r,e,n);return i||super.on(t,r)}hasEventListener(t){return super.hasEventListener(t)||this.viewEvents.hasHandler(t)}goTo(t,r){return this.goToManager.goTo(t,r)}toMap(t){if(!this.ready)return null;const r=s(t)?o(this,t):t;return this.stateManager.toMap(r)}};return t([r()],g.prototype,"goToManager",void 0),t([r({readOnly:!0})],g.prototype,"interacting",null),t([r()],g.prototype,"stationary",null),t([r({readOnly:!0})],g.prototype,"inputManager",void 0),g=t([e("esri.views.Viewport2DMixin")],g),g};export{a as Viewport2DMixin};
