/**
 * @license
 * Copyright Tyler Technologies, Inc. 
 * License: Apache-2.0
 */
import { WithMoveable } from '../mixins/interactions/moveable/with-moveable';
export class MoveController extends WithMoveable() {
    constructor(_config) {
        super();
        this._config = _config;
        this._startMoveListener();
    }
    destroy() {
        this._stopMoveListener();
        super.stopMoveListener();
    }
    _getMoveableBounds() {
        return this._config.surfaceElement.getBoundingClientRect();
    }
    _updatePosition(x, y) {
        this._config.surfaceElement.style.top = y != null ? y : '';
        this._config.surfaceElement.style.left = x != null ? x : '';
    }
    _onMoveStart() {
        return this._config.onMoveStart();
    }
    _onMove(position) {
        return this._config.onMove(position);
    }
    _onMoveEnd() {
        this._config.onMoveEnd();
    }
    _startMoveListener() {
        this._config.handleElement.addEventListener('pointerdown', this._movePointerDownListener);
    }
    _stopMoveListener() {
        this._config.handleElement.removeEventListener('pointerdown', this._movePointerDownListener);
    }
}
