import BaseObject from"../Object.js";import InteractionProperty from"./Property.js";import{easeOut,linear}from"../easing.js";class Interaction extends BaseObject{constructor(t){super(),this.on,this.once,this.un,t&&t.handleEvent&&(this.handleEvent=t.handleEvent),this.map_=null,this.setActive(!0)}getActive(){return this.get(InteractionProperty.ACTIVE)}getMap(){return this.map_}handleEvent(t){return!0}setActive(t){this.set(InteractionProperty.ACTIVE,t)}setMap(t){this.map_=t}}function pan(t,e,n){var o=t.getCenterInternal();o&&(o=[o[0]+e[0],o[1]+e[1]],t.animateInternal({duration:void 0!==n?n:250,easing:linear,center:t.getConstrainedCenter(o)}))}function zoomByDelta(t,e,n,o){var r=t.getZoom();void 0!==r&&(r=t.getConstrainedZoom(r+e),e=t.getResolutionForZoom(r),t.getAnimating()&&t.cancelAnimations(),t.animate({resolution:e,anchor:n,duration:void 0!==o?o:250,easing:easeOut}))}export default Interaction;export{pan,zoomByDelta};