text: "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  var tslib_1 = require("tslib");
  var clock_1 = require("../utils/clock");
  var gesture_1 = require("./gesture");
  var TIME = 300;
  var DISTANCE = 10;
  var Press = /** @class */ (function (_super) {
      tslib_1.__extends(Press, _super);
      function Press() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.EVENT = 'press';
          return _this;
      }
      Press.prototype.onTouchCancel = function (ev) {
          this.clearTimeout();
      };
      Press.prototype.onTouchEnd = function (ev) {
          this.clearTimeout();
      };
      Press.prototype.onTouchMove = function (ev) {
          var x = ev.x, y = ev.y;
          if (x - this.touchStartX > DISTANCE || y - this.touchStartY > DISTANCE) {
              this.clearTimeout();
          }
      };
      Press.prototype.onTouchStart = function (ev) {
          var _this = this;
          this.clearTimeout();
          var x = ev.x, y = ev.y;
          this.touchStartTime = clock_1.clock.now();
          this.touchStartX = x;
          this.touchStartY = y;
          this.pressTimeout = window.setTimeout(function () {
              _this.emit({ x: x, y: y, event: ev });
          }, TIME);
      };
      Press.prototype.clearTimeout = function () {
          window.clearTimeout(this.pressTimeout);
      };
      return Press;
  }(gesture_1.Gesture));
  exports.Press = Press;
  //# sourceMappingURL=press.js.map