From ed6ccbba2fa8f5fde704e51d221e860d086ac574 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Wed, 23 Dec 2015 01:04:16 -0500 Subject: [PATCH] update components --- .../bower_components/hammerjs/.bower.json | 11 +- .../bower_components/hammerjs/.jscsrc | 101 +++++++++++- .../bower_components/hammerjs/.travis.yml | 2 + .../hammerjs/Gruntfile.coffee | 11 +- .../bower_components/hammerjs/bower.json | 1 - .../bower_components/hammerjs/hammer.js | 153 ++++++++++++------ .../bower_components/hammerjs/hammer.min.js | 8 +- .../bower_components/hammerjs/hammer.min.map | 2 +- .../bower_components/hammerjs/package.json | 13 +- .../iron-flex-layout/.bower.json | 6 +- .../paper-material/.bower.json | 4 +- .../bower_components/paper-ripple/.bower.json | 6 +- 12 files changed, 227 insertions(+), 91 deletions(-) diff --git a/dashboard-ui/bower_components/hammerjs/.bower.json b/dashboard-ui/bower_components/hammerjs/.bower.json index 90e8a70c7..977f64211 100644 --- a/dashboard-ui/bower_components/hammerjs/.bower.json +++ b/dashboard-ui/bower_components/hammerjs/.bower.json @@ -1,20 +1,19 @@ { "name": "hammerjs", - "version": "2.0.4", "main": "hammer.js", "ignore": [ "tests", "src" ], "homepage": "https://github.com/hammerjs/hammer.js", - "_release": "2.0.4", + "version": "2.0.5", + "_release": "2.0.5", "_resolution": { "type": "version", - "tag": "2.0.4", - "commit": "7fc11efb37d6f2334ce957e26e9cf53690e10fa5" + "tag": "v2.0.5", + "commit": "4ac915029353faf7cbe3ac9252d84a2621772f85" }, "_source": "git://github.com/hammerjs/hammer.js.git", "_target": "~2.0.4", - "_originalSource": "hammer.js", - "_direct": true + "_originalSource": "hammer.js" } \ No newline at end of file diff --git a/dashboard-ui/bower_components/hammerjs/.jscsrc b/dashboard-ui/bower_components/hammerjs/.jscsrc index e0c480f41..168677b82 100644 --- a/dashboard-ui/bower_components/hammerjs/.jscsrc +++ b/dashboard-ui/bower_components/hammerjs/.jscsrc @@ -1,8 +1,95 @@ { - "preset": "google", - "excludeFiles": [ - "*.js", - "tests/**/assets", - "node_modules/**" - ] -} + "excludeFiles": [ + "*.js", + "tests/**/assets", + "node_modules/**" + ], + "requireCurlyBraces": [ + "if", + "else", + "for", + "while", + "do", + "try", + "catch" + ], + "requireOperatorBeforeLineBreak": true, + "requireCamelCaseOrUpperCaseIdentifiers": true, + "maximumLineLength": { + "value": 120, + "allowComments": true, + "allowRegex": true + }, + "validateIndentation": 4, + "validateQuoteMarks": "'", + "disallowMultipleLineStrings": true, + "disallowMixedSpacesAndTabs": true, + "disallowTrailingWhitespace": true, + "disallowSpaceAfterPrefixUnaryOperators": true, + "requireSpaceAfterKeywords": [ + "if", + "else", + "for", + "while", + "do", + "switch", + "return", + "try", + "catch" + ], + "requireSpaceBeforeBinaryOperators": [ + "=", + "+=", + "-=", + "*=", + "/=", + "%=", + "<<=", + ">>=", + ">>>=", + "&=", + "|=", + "^=", + "+=", + "+", + "-", + "*", + "/", + "%", + "<<", + ">>", + ">>>", + "&", + "|", + "^", + "&&", + "||", + "===", + "==", + ">=", + "<=", + "<", + ">", + "!=", + "!==" + ], + "requireSpaceAfterBinaryOperators": true, + "requireSpacesInConditionalExpression": true, + "requireSpaceBeforeBlockStatements": true, + "requireLineFeedAtFileEnd": true, + "requireSpacesInFunctionExpression": { + "beforeOpeningCurlyBrace": true + }, + "disallowSpacesInAnonymousFunctionExpression": { + "beforeOpeningRoundBrace": true + }, + "disallowSpacesInsideObjectBrackets": "all", + "disallowSpacesInsideArrayBrackets": "all", + "disallowSpacesInsideParentheses": true, + "validateJSDoc": { + "checkParamNames": true, + "requireParamTypes": true + }, + "disallowMultipleLineBreaks": true, + "disallowNewlineBeforeBlockStatements": true +} \ No newline at end of file diff --git a/dashboard-ui/bower_components/hammerjs/.travis.yml b/dashboard-ui/bower_components/hammerjs/.travis.yml index a6e6c3e72..308d9a6e8 100644 --- a/dashboard-ui/bower_components/hammerjs/.travis.yml +++ b/dashboard-ui/bower_components/hammerjs/.travis.yml @@ -2,6 +2,8 @@ language: node_js node_js: - "0.10" +sudo: false + before_script: - npm install -g grunt-cli diff --git a/dashboard-ui/bower_components/hammerjs/Gruntfile.coffee b/dashboard-ui/bower_components/hammerjs/Gruntfile.coffee index 9998e2075..d14d6ec58 100644 --- a/dashboard-ui/bower_components/hammerjs/Gruntfile.coffee +++ b/dashboard-ui/bower_components/hammerjs/Gruntfile.coffee @@ -19,7 +19,7 @@ module.exports = (grunt) -> concat: build: src: [ - 'src/hammer.prefix' + 'src/hammer.prefix.js' 'src/utils.js' 'src/input.js' 'src/input/*.js' @@ -29,7 +29,7 @@ module.exports = (grunt) -> 'src/hammer.js' 'src/manager.js' 'src/expose.js' - 'src/hammer.suffix'] + 'src/hammer.suffix.js'] dest: 'hammer.js' uglify: @@ -80,8 +80,9 @@ module.exports = (grunt) -> jscs: src: [ - 'src/**/*.js' - 'tests/unit/*.js' + 'src/**/*.js', + '!src/hammer.prefix.js', + '!src/hammer.suffix.js' ] options: config: "./.jscsrc" @@ -113,7 +114,7 @@ module.exports = (grunt) -> grunt.loadNpmTasks 'grunt-contrib-connect' grunt.loadNpmTasks 'grunt-string-replace' grunt.loadNpmTasks 'grunt-banner' - grunt.loadNpmTasks 'grunt-jscs-checker' + grunt.loadNpmTasks 'grunt-jscs' # Default task(s) grunt.registerTask 'default', ['connect', 'watch'] diff --git a/dashboard-ui/bower_components/hammerjs/bower.json b/dashboard-ui/bower_components/hammerjs/bower.json index 61bb63154..632c16e5e 100644 --- a/dashboard-ui/bower_components/hammerjs/bower.json +++ b/dashboard-ui/bower_components/hammerjs/bower.json @@ -1,6 +1,5 @@ { "name": "hammerjs", - "version": "2.0.4", "main": "hammer.js", "ignore": [ "tests", diff --git a/dashboard-ui/bower_components/hammerjs/hammer.js b/dashboard-ui/bower_components/hammerjs/hammer.js index 522668899..7acc5eec2 100644 --- a/dashboard-ui/bower_components/hammerjs/hammer.js +++ b/dashboard-ui/bower_components/hammerjs/hammer.js @@ -1,12 +1,12 @@ -/*! Hammer.JS - v2.0.4 - 2014-09-28 +/*! Hammer.JS - v2.0.4 - 2015-12-22 * http://hammerjs.github.io/ * - * Copyright (c) 2014 Jorik Tangelder; - * Licensed under the MIT license */ + * Copyright (c) 2015 Jorik Tangelder; + * Licensed under the license */ (function(window, document, exportName, undefined) { 'use strict'; -var VENDOR_PREFIXES = ['', 'webkit', 'moz', 'MS', 'ms', 'o']; +var VENDOR_PREFIXES = ['', 'webkit', 'Moz', 'MS', 'ms', 'o']; var TEST_ELEMENT = document.createElement('div'); var TYPE_FUNCTION = 'function'; @@ -320,8 +320,8 @@ function uniqueId() { * @returns {DocumentView|Window} */ function getWindowForElement(element) { - var doc = element.ownerDocument; - return (doc.defaultView || doc.parentWindow); + var doc = element.ownerDocument || element; + return (doc.defaultView || doc.parentWindow || window); } var MOBILE_REGEX = /mobile|tablet|ip(ad|hone|od)|android/i; @@ -500,9 +500,17 @@ function computeInputData(manager, input) { computeDeltaXY(session, input); input.offsetDirection = getDirection(input.deltaX, input.deltaY); + var overallVelocity = getVelocity(input.deltaTime, input.deltaX, input.deltaY); + input.overallVelocityX = overallVelocity.x; + input.overallVelocityY = overallVelocity.y; + input.overallVelocity = (abs(overallVelocity.x) > abs(overallVelocity.y)) ? overallVelocity.x : overallVelocity.y; + input.scale = firstMultiple ? getScale(firstMultiple.pointers, pointers) : 1; input.rotation = firstMultiple ? getRotation(firstMultiple.pointers, pointers) : 0; + input.maxPointers = !session.prevInput ? input.pointers.length : ((input.pointers.length > + session.prevInput.maxPointers) ? input.pointers.length : session.prevInput.maxPointers); + computeIntervalInputData(session, input); // find the correct target @@ -546,8 +554,8 @@ function computeIntervalInputData(session, input) { velocity, velocityX, velocityY, direction; if (input.eventType != INPUT_CANCEL && (deltaTime > COMPUTE_INTERVAL || last.velocity === undefined)) { - var deltaX = last.deltaX - input.deltaX; - var deltaY = last.deltaY - input.deltaY; + var deltaX = input.deltaX - last.deltaX; + var deltaY = input.deltaY - last.deltaY; var v = getVelocity(deltaTime, deltaX, deltaY); velocityX = v.x; @@ -652,9 +660,9 @@ function getDirection(x, y) { } if (abs(x) >= abs(y)) { - return x > 0 ? DIRECTION_LEFT : DIRECTION_RIGHT; + return x < 0 ? DIRECTION_LEFT : DIRECTION_RIGHT; } - return y > 0 ? DIRECTION_UP : DIRECTION_DOWN; + return y < 0 ? DIRECTION_UP : DIRECTION_DOWN; } /** @@ -697,7 +705,7 @@ function getAngle(p1, p2, props) { * @return {Number} rotation */ function getRotation(start, end) { - return getAngle(end[1], end[0], PROPS_CLIENT_XY) - getAngle(start[1], start[0], PROPS_CLIENT_XY); + return getAngle(end[1], end[0], PROPS_CLIENT_XY) + getAngle(start[1], start[0], PROPS_CLIENT_XY); } /** @@ -790,7 +798,7 @@ var POINTER_ELEMENT_EVENTS = 'pointerdown'; var POINTER_WINDOW_EVENTS = 'pointermove pointerup pointercancel'; // IE10 has prefixed support, and case-sensitive -if (window.MSPointerEvent) { +if (window.MSPointerEvent && !window.PointerEvent) { POINTER_ELEMENT_EVENTS = 'MSPointerDown'; POINTER_WINDOW_EVENTS = 'MSPointerMove MSPointerUp MSPointerCancel'; } @@ -1114,7 +1122,7 @@ TouchAction.prototype = { value = this.compute(); } - if (NATIVE_TOUCH_ACTION) { + if (NATIVE_TOUCH_ACTION && this.manager.element.style) { this.manager.element.style[PREFIXED_TOUCH_ACTION] = value; } this.actions = value.toLowerCase().trim(); @@ -1165,6 +1173,23 @@ TouchAction.prototype = { var hasPanY = inStr(actions, TOUCH_ACTION_PAN_Y); var hasPanX = inStr(actions, TOUCH_ACTION_PAN_X); + if (hasNone) { + //do not prevent defaults if this is a tap gesture + + var isTapPointer = input.pointers.length === 1; + var isTapMovement = input.distance < 2; + var isTapTouchTime = input.deltaTime < 250; + + if (isTapPointer && isTapMovement && isTapTouchTime) { + return; + } + } + + if (hasPanX && hasPanY) { + // `pan-x pan-y` means browser handles all scrolling/panning, do not prevent + return; + } + if (hasNone || (hasPanY && direction & DIRECTION_HORIZONTAL) || (hasPanX && direction & DIRECTION_VERTICAL)) { @@ -1196,9 +1221,12 @@ function cleanTouchActions(actions) { var hasPanX = inStr(actions, TOUCH_ACTION_PAN_X); var hasPanY = inStr(actions, TOUCH_ACTION_PAN_Y); - // pan-x and pan-y can be combined + // if both pan-x and pan-y are set (different recognizers + // for different directions, e.g. horizontal pan but vertical swipe?) + // we need none (as otherwise with pan-x pan-y combined none of these + // recognizers will work, since the browser would handle all panning if (hasPanX && hasPanY) { - return TOUCH_ACTION_PAN_X + ' ' + TOUCH_ACTION_PAN_Y; + return TOUCH_ACTION_NONE; } // pan-x OR pan-y @@ -1256,10 +1284,13 @@ var STATE_FAILED = 32; * @param {Object} options */ function Recognizer(options) { + // make sure, options are copied over to a new object to prevent leaking it outside + options = extend({}, options || {}); + this.id = uniqueId(); this.manager = null; - this.options = merge(options || {}, this.defaults); + this.options = merge(options, this.defaults); // default is enable true this.options.enable = ifUndefined(this.options.enable, true); @@ -1387,20 +1418,24 @@ Recognizer.prototype = { var self = this; var state = this.state; - function emit(withState) { - self.manager.emit(self.options.event + (withState ? stateStr(state) : ''), input); + function emit(event) { + self.manager.emit(event, input); } // 'panstart' and 'panmove' if (state < STATE_ENDED) { - emit(true); + emit(self.options.event + stateStr(state)); } - emit(); // simple 'eventName' events + emit(self.options.event); // simple 'eventName' events + + if (input.additionalEvent) { // additional event(panleft, panright, pinchin, pinchout...) + emit(input.additionalEvent); + } // panend and pancancel if (state >= STATE_ENDED) { - emit(true); + emit(self.options.event + stateStr(state)); } }, @@ -1665,14 +1700,15 @@ inherit(PanRecognizer, AttrRecognizer, { }, emit: function(input) { + this.pX = input.deltaX; this.pY = input.deltaY; var direction = directionStr(input.direction); - if (direction) { - this.manager.emit(this.options.event + direction, input); - } + if (direction) { + input.additionalEvent = this.options.event + direction; + } this._super.emit.call(this, input); } }); @@ -1708,11 +1744,11 @@ inherit(PinchRecognizer, AttrRecognizer, { }, emit: function(input) { - this._super.emit.call(this, input); if (input.scale !== 1) { var inOut = input.scale < 1 ? 'in' : 'out'; - this.manager.emit(this.options.event + inOut, input); + input.additionalEvent = this.options.event + inOut; } + this._super.emit.call(this, input); } }); @@ -1737,8 +1773,8 @@ inherit(PressRecognizer, Recognizer, { defaults: { event: 'press', pointers: 1, - time: 500, // minimal time of the pointer to be pressed - threshold: 5 // a minimal movement is ok, but keep it low + time: 251, // minimal time of the pointer to be pressed + threshold: 9 // a minimal movement is ok, but keep it low }, getTouchAction: function() { @@ -1836,7 +1872,7 @@ inherit(SwipeRecognizer, AttrRecognizer, { defaults: { event: 'swipe', threshold: 10, - velocity: 0.65, + velocity: 0.3, direction: DIRECTION_HORIZONTAL | DIRECTION_VERTICAL, pointers: 1 }, @@ -1850,21 +1886,22 @@ inherit(SwipeRecognizer, AttrRecognizer, { var velocity; if (direction & (DIRECTION_HORIZONTAL | DIRECTION_VERTICAL)) { - velocity = input.velocity; + velocity = input.overallVelocity; } else if (direction & DIRECTION_HORIZONTAL) { - velocity = input.velocityX; + velocity = input.overallVelocityX; } else if (direction & DIRECTION_VERTICAL) { - velocity = input.velocityY; + velocity = input.overallVelocityY; } return this._super.attrTest.call(this, input) && - direction & input.direction && + direction & input.offsetDirection && input.distance > this.options.threshold && + input.maxPointers == this.options.pointers && abs(velocity) > this.options.velocity && input.eventType & INPUT_END; }, emit: function(input) { - var direction = directionStr(input.direction); + var direction = directionStr(input.offsetDirection); if (direction) { this.manager.emit(this.options.event + direction, input); } @@ -1907,7 +1944,7 @@ inherit(TapRecognizer, Recognizer, { taps: 1, interval: 300, // max time between the multi-tap taps time: 250, // max time of the pointer to be down (like finger on the screen) - threshold: 2, // a minimal movement is ok, but keep it low + threshold: 9, // a minimal movement is ok, but keep it low posThreshold: 10 // a multi-tap can be a bit off the initial position }, @@ -1981,7 +2018,7 @@ inherit(TapRecognizer, Recognizer, { }, emit: function() { - if (this.state == STATE_RECOGNIZED ) { + if (this.state == STATE_RECOGNIZED) { this._input.tapCount = this.count; this.manager.emit(this.options.event, this._input); } @@ -1989,7 +2026,7 @@ inherit(TapRecognizer, Recognizer, { }); /** - * Simple way to create an manager with a default set of recognizers. + * Simple way to create a manager with a default set of recognizers. * @param {HTMLElement} element * @param {Object} [options] * @constructor @@ -2055,12 +2092,12 @@ Hammer.defaults = { */ preset: [ // RecognizerClass, options, [recognizeWith, ...], [requireFailure, ...] - [RotateRecognizer, { enable: false }], - [PinchRecognizer, { enable: false }, ['rotate']], - [SwipeRecognizer,{ direction: DIRECTION_HORIZONTAL }], - [PanRecognizer, { direction: DIRECTION_HORIZONTAL }, ['swipe']], + [RotateRecognizer, {enable: false}], + [PinchRecognizer, {enable: false}, ['rotate']], + [SwipeRecognizer, {direction: DIRECTION_HORIZONTAL}], + [PanRecognizer, {direction: DIRECTION_HORIZONTAL}, ['swipe']], [TapRecognizer], - [TapRecognizer, { event: 'doubletap', taps: 2 }, ['tap']], + [TapRecognizer, {event: 'doubletap', taps: 2}, ['tap']], [PressRecognizer] ], @@ -2127,9 +2164,9 @@ var FORCED_STOP = 2; * @constructor */ function Manager(element, options) { - options = options || {}; + var newOptions = options ? extend({}, options) : {}; + this.options = merge(newOptions, Hammer.defaults); - this.options = merge(options, Hammer.defaults); this.options.inputTarget = this.options.inputTarget || element; this.handlers = {}; @@ -2142,7 +2179,7 @@ function Manager(element, options) { toggleCssProps(this, true); - each(options.recognizers, function(item) { + each(this.options.recognizers, function(item) { var recognizer = this.add(new (item[0])(item[1])); item[2] && recognizer.recognizeWith(item[2]); item[3] && recognizer.requireFailure(item[3]); @@ -2290,11 +2327,19 @@ Manager.prototype = { return this; } - var recognizers = this.recognizers; recognizer = this.get(recognizer); - recognizers.splice(inArray(recognizers, recognizer), 1); - this.touchAction.update(); + // let's make sure this recognizer exists + if (recognizer) { + var recognizers = this.recognizers; + var index = inArray(recognizers, recognizer); + + if (index !== -1) { + recognizers.splice(index, 1); + this.touchAction.update(); + } + } + return this; }, @@ -2325,7 +2370,7 @@ Manager.prototype = { if (!handler) { delete handlers[event]; } else { - handlers[event].splice(inArray(handlers[event], handler), 1); + handlers[event] && handlers[event].splice(inArray(handlers[event], handler), 1); } }); return this; @@ -2381,6 +2426,9 @@ Manager.prototype = { */ function toggleCssProps(manager, add) { var element = manager.element; + if (!element.style) { + return; + } each(manager.options.cssProps, function(value, name) { element.style[prefixed(element.style, name)] = add ? value : ''; }); @@ -2450,7 +2498,12 @@ extend(Hammer, { prefixed: prefixed }); -if (typeof define == TYPE_FUNCTION && define.amd) { +// this prevents errors when Hammer is loaded in the presence of an AMD +// style loader but by script tag, not by the loader. +var freeGlobal = (typeof window !== 'undefined' ? window : (typeof self !== 'undefined' ? self : {})); // jshint ignore:line +freeGlobal.Hammer = Hammer; + +if (typeof define === 'function' && define.amd) { define(function() { return Hammer; }); diff --git a/dashboard-ui/bower_components/hammerjs/hammer.min.js b/dashboard-ui/bower_components/hammerjs/hammer.min.js index 2071fb1f0..9b0d605ea 100644 --- a/dashboard-ui/bower_components/hammerjs/hammer.min.js +++ b/dashboard-ui/bower_components/hammerjs/hammer.min.js @@ -1,7 +1,7 @@ -/*! Hammer.JS - v2.0.4 - 2014-09-28 +/*! Hammer.JS - v2.0.4 - 2015-12-22 * http://hammerjs.github.io/ * - * Copyright (c) 2014 Jorik Tangelder; - * Licensed under the MIT license */ -!function(a,b,c,d){"use strict";function e(a,b,c){return setTimeout(k(a,c),b)}function f(a,b,c){return Array.isArray(a)?(g(a,c[b],c),!0):!1}function g(a,b,c){var e;if(a)if(a.forEach)a.forEach(b,c);else if(a.length!==d)for(e=0;e-1}function r(a){return a.trim().split(/\s+/g)}function s(a,b,c){if(a.indexOf&&!c)return a.indexOf(b);for(var d=0;dc[b]}):d.sort()),d}function v(a,b){for(var c,e,f=b[0].toUpperCase()+b.slice(1),g=0;g1&&!c.firstMultiple?c.firstMultiple=E(b):1===e&&(c.firstMultiple=!1);var f=c.firstInput,g=c.firstMultiple,h=g?g.center:f.center,i=b.center=F(d);b.timeStamp=nb(),b.deltaTime=b.timeStamp-f.timeStamp,b.angle=J(h,i),b.distance=I(h,i),C(c,b),b.offsetDirection=H(b.deltaX,b.deltaY),b.scale=g?L(g.pointers,d):1,b.rotation=g?K(g.pointers,d):0,D(c,b);var j=a.element;p(b.srcEvent.target,j)&&(j=b.srcEvent.target),b.target=j}function C(a,b){var c=b.center,d=a.offsetDelta||{},e=a.prevDelta||{},f=a.prevInput||{};(b.eventType===yb||f.eventType===Ab)&&(e=a.prevDelta={x:f.deltaX||0,y:f.deltaY||0},d=a.offsetDelta={x:c.x,y:c.y}),b.deltaX=e.x+(c.x-d.x),b.deltaY=e.y+(c.y-d.y)}function D(a,b){var c,e,f,g,h=a.lastInterval||b,i=b.timeStamp-h.timeStamp;if(b.eventType!=Bb&&(i>xb||h.velocity===d)){var j=h.deltaX-b.deltaX,k=h.deltaY-b.deltaY,l=G(i,j,k);e=l.x,f=l.y,c=mb(l.x)>mb(l.y)?l.x:l.y,g=H(j,k),a.lastInterval=b}else c=h.velocity,e=h.velocityX,f=h.velocityY,g=h.direction;b.velocity=c,b.velocityX=e,b.velocityY=f,b.direction=g}function E(a){for(var b=[],c=0;ce;)c+=a[e].clientX,d+=a[e].clientY,e++;return{x:lb(c/b),y:lb(d/b)}}function G(a,b,c){return{x:b/a||0,y:c/a||0}}function H(a,b){return a===b?Cb:mb(a)>=mb(b)?a>0?Db:Eb:b>0?Fb:Gb}function I(a,b,c){c||(c=Kb);var d=b[c[0]]-a[c[0]],e=b[c[1]]-a[c[1]];return Math.sqrt(d*d+e*e)}function J(a,b,c){c||(c=Kb);var d=b[c[0]]-a[c[0]],e=b[c[1]]-a[c[1]];return 180*Math.atan2(e,d)/Math.PI}function K(a,b){return J(b[1],b[0],Lb)-J(a[1],a[0],Lb)}function L(a,b){return I(b[0],b[1],Lb)/I(a[0],a[1],Lb)}function M(){this.evEl=Nb,this.evWin=Ob,this.allow=!0,this.pressed=!1,y.apply(this,arguments)}function N(){this.evEl=Rb,this.evWin=Sb,y.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}function O(){this.evTarget=Ub,this.evWin=Vb,this.started=!1,y.apply(this,arguments)}function P(a,b){var c=t(a.touches),d=t(a.changedTouches);return b&(Ab|Bb)&&(c=u(c.concat(d),"identifier",!0)),[c,d]}function Q(){this.evTarget=Xb,this.targetIds={},y.apply(this,arguments)}function R(a,b){var c=t(a.touches),d=this.targetIds;if(b&(yb|zb)&&1===c.length)return d[c[0].identifier]=!0,[c,c];var e,f,g=t(a.changedTouches),h=[],i=this.target;if(f=c.filter(function(a){return p(a.target,i)}),b===yb)for(e=0;eh&&(b.push(a),h=b.length-1):e&(Ab|Bb)&&(c=!0),0>h||(b[h]=a,this.callback(this.manager,e,{pointers:b,changedPointers:[a],pointerType:f,srcEvent:a}),c&&b.splice(h,1))}});var Tb={touchstart:yb,touchmove:zb,touchend:Ab,touchcancel:Bb},Ub="touchstart",Vb="touchstart touchmove touchend touchcancel";j(O,y,{handler:function(a){var b=Tb[a.type];if(b===yb&&(this.started=!0),this.started){var c=P.call(this,a,b);b&(Ab|Bb)&&c[0].length-c[1].length===0&&(this.started=!1),this.callback(this.manager,b,{pointers:c[0],changedPointers:c[1],pointerType:tb,srcEvent:a})}}});var Wb={touchstart:yb,touchmove:zb,touchend:Ab,touchcancel:Bb},Xb="touchstart touchmove touchend touchcancel";j(Q,y,{handler:function(a){var b=Wb[a.type],c=R.call(this,a,b);c&&this.callback(this.manager,b,{pointers:c[0],changedPointers:c[1],pointerType:tb,srcEvent:a})}}),j(S,y,{handler:function(a,b,c){var d=c.pointerType==tb,e=c.pointerType==vb;if(d)this.mouse.allow=!1;else if(e&&!this.mouse.allow)return;b&(Ab|Bb)&&(this.mouse.allow=!0),this.callback(a,b,c)},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var Yb=v(jb.style,"touchAction"),Zb=Yb!==d,$b="compute",_b="auto",ac="manipulation",bc="none",cc="pan-x",dc="pan-y";T.prototype={set:function(a){a==$b&&(a=this.compute()),Zb&&(this.manager.element.style[Yb]=a),this.actions=a.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var a=[];return g(this.manager.recognizers,function(b){l(b.options.enable,[b])&&(a=a.concat(b.getTouchAction()))}),U(a.join(" "))},preventDefaults:function(a){if(!Zb){var b=a.srcEvent,c=a.offsetDirection;if(this.manager.session.prevented)return void b.preventDefault();var d=this.actions,e=q(d,bc),f=q(d,dc),g=q(d,cc);return e||f&&c&Hb||g&&c&Ib?this.preventSrc(b):void 0}},preventSrc:function(a){this.manager.session.prevented=!0,a.preventDefault()}};var ec=1,fc=2,gc=4,hc=8,ic=hc,jc=16,kc=32;V.prototype={defaults:{},set:function(a){return h(this.options,a),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(a){if(f(a,"recognizeWith",this))return this;var b=this.simultaneous;return a=Y(a,this),b[a.id]||(b[a.id]=a,a.recognizeWith(this)),this},dropRecognizeWith:function(a){return f(a,"dropRecognizeWith",this)?this:(a=Y(a,this),delete this.simultaneous[a.id],this)},requireFailure:function(a){if(f(a,"requireFailure",this))return this;var b=this.requireFail;return a=Y(a,this),-1===s(b,a)&&(b.push(a),a.requireFailure(this)),this},dropRequireFailure:function(a){if(f(a,"dropRequireFailure",this))return this;a=Y(a,this);var b=s(this.requireFail,a);return b>-1&&this.requireFail.splice(b,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(a){return!!this.simultaneous[a.id]},emit:function(a){function b(b){c.manager.emit(c.options.event+(b?W(d):""),a)}var c=this,d=this.state;hc>d&&b(!0),b(),d>=hc&&b(!0)},tryEmit:function(a){return this.canEmit()?this.emit(a):void(this.state=kc)},canEmit:function(){for(var a=0;af?Db:Eb,c=f!=this.pX,d=Math.abs(a.deltaX)):(e=0===g?Cb:0>g?Fb:Gb,c=g!=this.pY,d=Math.abs(a.deltaY))),a.direction=e,c&&d>b.threshold&&e&b.direction},attrTest:function(a){return Z.prototype.attrTest.call(this,a)&&(this.state&fc||!(this.state&fc)&&this.directionTest(a))},emit:function(a){this.pX=a.deltaX,this.pY=a.deltaY;var b=X(a.direction);b&&this.manager.emit(this.options.event+b,a),this._super.emit.call(this,a)}}),j(_,Z,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[bc]},attrTest:function(a){return this._super.attrTest.call(this,a)&&(Math.abs(a.scale-1)>this.options.threshold||this.state&fc)},emit:function(a){if(this._super.emit.call(this,a),1!==a.scale){var b=a.scale<1?"in":"out";this.manager.emit(this.options.event+b,a)}}}),j(ab,V,{defaults:{event:"press",pointers:1,time:500,threshold:5},getTouchAction:function(){return[_b]},process:function(a){var b=this.options,c=a.pointers.length===b.pointers,d=a.distanceb.time;if(this._input=a,!d||!c||a.eventType&(Ab|Bb)&&!f)this.reset();else if(a.eventType&yb)this.reset(),this._timer=e(function(){this.state=ic,this.tryEmit()},b.time,this);else if(a.eventType&Ab)return ic;return kc},reset:function(){clearTimeout(this._timer)},emit:function(a){this.state===ic&&(a&&a.eventType&Ab?this.manager.emit(this.options.event+"up",a):(this._input.timeStamp=nb(),this.manager.emit(this.options.event,this._input)))}}),j(bb,Z,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[bc]},attrTest:function(a){return this._super.attrTest.call(this,a)&&(Math.abs(a.rotation)>this.options.threshold||this.state&fc)}}),j(cb,Z,{defaults:{event:"swipe",threshold:10,velocity:.65,direction:Hb|Ib,pointers:1},getTouchAction:function(){return $.prototype.getTouchAction.call(this)},attrTest:function(a){var b,c=this.options.direction;return c&(Hb|Ib)?b=a.velocity:c&Hb?b=a.velocityX:c&Ib&&(b=a.velocityY),this._super.attrTest.call(this,a)&&c&a.direction&&a.distance>this.options.threshold&&mb(b)>this.options.velocity&&a.eventType&Ab},emit:function(a){var b=X(a.direction);b&&this.manager.emit(this.options.event+b,a),this.manager.emit(this.options.event,a)}}),j(db,V,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:2,posThreshold:10},getTouchAction:function(){return[ac]},process:function(a){var b=this.options,c=a.pointers.length===b.pointers,d=a.distance-1}function r(a){return a.trim().split(/\s+/g)}function s(a,b,c){if(a.indexOf&&!c)return a.indexOf(b);for(var d=0;dc[b]}):d.sort()),d}function v(a,b){for(var c,e,f=b[0].toUpperCase()+b.slice(1),g=0;g1&&!c.firstMultiple?c.firstMultiple=E(b):1===e&&(c.firstMultiple=!1);var f=c.firstInput,g=c.firstMultiple,h=g?g.center:f.center,i=b.center=F(d);b.timeStamp=nb(),b.deltaTime=b.timeStamp-f.timeStamp,b.angle=J(h,i),b.distance=I(h,i),C(c,b),b.offsetDirection=H(b.deltaX,b.deltaY);var j=G(b.deltaTime,b.deltaX,b.deltaY);b.overallVelocityX=j.x,b.overallVelocityY=j.y,b.overallVelocity=mb(j.x)>mb(j.y)?j.x:j.y,b.scale=g?L(g.pointers,d):1,b.rotation=g?K(g.pointers,d):0,b.maxPointers=c.prevInput?b.pointers.length>c.prevInput.maxPointers?b.pointers.length:c.prevInput.maxPointers:b.pointers.length,D(c,b);var k=a.element;p(b.srcEvent.target,k)&&(k=b.srcEvent.target),b.target=k}function C(a,b){var c=b.center,d=a.offsetDelta||{},e=a.prevDelta||{},f=a.prevInput||{};(b.eventType===yb||f.eventType===Ab)&&(e=a.prevDelta={x:f.deltaX||0,y:f.deltaY||0},d=a.offsetDelta={x:c.x,y:c.y}),b.deltaX=e.x+(c.x-d.x),b.deltaY=e.y+(c.y-d.y)}function D(a,b){var c,e,f,g,h=a.lastInterval||b,i=b.timeStamp-h.timeStamp;if(b.eventType!=Bb&&(i>xb||h.velocity===d)){var j=b.deltaX-h.deltaX,k=b.deltaY-h.deltaY,l=G(i,j,k);e=l.x,f=l.y,c=mb(l.x)>mb(l.y)?l.x:l.y,g=H(j,k),a.lastInterval=b}else c=h.velocity,e=h.velocityX,f=h.velocityY,g=h.direction;b.velocity=c,b.velocityX=e,b.velocityY=f,b.direction=g}function E(a){for(var b=[],c=0;ce;)c+=a[e].clientX,d+=a[e].clientY,e++;return{x:lb(c/b),y:lb(d/b)}}function G(a,b,c){return{x:b/a||0,y:c/a||0}}function H(a,b){return a===b?Cb:mb(a)>=mb(b)?0>a?Db:Eb:0>b?Fb:Gb}function I(a,b,c){c||(c=Kb);var d=b[c[0]]-a[c[0]],e=b[c[1]]-a[c[1]];return Math.sqrt(d*d+e*e)}function J(a,b,c){c||(c=Kb);var d=b[c[0]]-a[c[0]],e=b[c[1]]-a[c[1]];return 180*Math.atan2(e,d)/Math.PI}function K(a,b){return J(b[1],b[0],Lb)+J(a[1],a[0],Lb)}function L(a,b){return I(b[0],b[1],Lb)/I(a[0],a[1],Lb)}function M(){this.evEl=Nb,this.evWin=Ob,this.allow=!0,this.pressed=!1,y.apply(this,arguments)}function N(){this.evEl=Rb,this.evWin=Sb,y.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}function O(){this.evTarget=Ub,this.evWin=Vb,this.started=!1,y.apply(this,arguments)}function P(a,b){var c=t(a.touches),d=t(a.changedTouches);return b&(Ab|Bb)&&(c=u(c.concat(d),"identifier",!0)),[c,d]}function Q(){this.evTarget=Xb,this.targetIds={},y.apply(this,arguments)}function R(a,b){var c=t(a.touches),d=this.targetIds;if(b&(yb|zb)&&1===c.length)return d[c[0].identifier]=!0,[c,c];var e,f,g=t(a.changedTouches),h=[],i=this.target;if(f=c.filter(function(a){return p(a.target,i)}),b===yb)for(e=0;eh&&(b.push(a),h=b.length-1):e&(Ab|Bb)&&(c=!0),0>h||(b[h]=a,this.callback(this.manager,e,{pointers:b,changedPointers:[a],pointerType:f,srcEvent:a}),c&&b.splice(h,1))}});var Tb={touchstart:yb,touchmove:zb,touchend:Ab,touchcancel:Bb},Ub="touchstart",Vb="touchstart touchmove touchend touchcancel";j(O,y,{handler:function(a){var b=Tb[a.type];if(b===yb&&(this.started=!0),this.started){var c=P.call(this,a,b);b&(Ab|Bb)&&c[0].length-c[1].length===0&&(this.started=!1),this.callback(this.manager,b,{pointers:c[0],changedPointers:c[1],pointerType:tb,srcEvent:a})}}});var Wb={touchstart:yb,touchmove:zb,touchend:Ab,touchcancel:Bb},Xb="touchstart touchmove touchend touchcancel";j(Q,y,{handler:function(a){var b=Wb[a.type],c=R.call(this,a,b);c&&this.callback(this.manager,b,{pointers:c[0],changedPointers:c[1],pointerType:tb,srcEvent:a})}}),j(S,y,{handler:function(a,b,c){var d=c.pointerType==tb,e=c.pointerType==vb;if(d)this.mouse.allow=!1;else if(e&&!this.mouse.allow)return;b&(Ab|Bb)&&(this.mouse.allow=!0),this.callback(a,b,c)},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var Yb=v(jb.style,"touchAction"),Zb=Yb!==d,$b="compute",_b="auto",ac="manipulation",bc="none",cc="pan-x",dc="pan-y";T.prototype={set:function(a){a==$b&&(a=this.compute()),Zb&&this.manager.element.style&&(this.manager.element.style[Yb]=a),this.actions=a.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var a=[];return g(this.manager.recognizers,function(b){l(b.options.enable,[b])&&(a=a.concat(b.getTouchAction()))}),U(a.join(" "))},preventDefaults:function(a){if(!Zb){var b=a.srcEvent,c=a.offsetDirection;if(this.manager.session.prevented)return void b.preventDefault();var d=this.actions,e=q(d,bc),f=q(d,dc),g=q(d,cc);if(e){var h=1===a.pointers.length,i=a.distance<2,j=a.deltaTime<250;if(h&&i&&j)return}if(!g||!f)return e||f&&c&Hb||g&&c&Ib?this.preventSrc(b):void 0}},preventSrc:function(a){this.manager.session.prevented=!0,a.preventDefault()}};var ec=1,fc=2,gc=4,hc=8,ic=hc,jc=16,kc=32;V.prototype={defaults:{},set:function(a){return h(this.options,a),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(a){if(f(a,"recognizeWith",this))return this;var b=this.simultaneous;return a=Y(a,this),b[a.id]||(b[a.id]=a,a.recognizeWith(this)),this},dropRecognizeWith:function(a){return f(a,"dropRecognizeWith",this)?this:(a=Y(a,this),delete this.simultaneous[a.id],this)},requireFailure:function(a){if(f(a,"requireFailure",this))return this;var b=this.requireFail;return a=Y(a,this),-1===s(b,a)&&(b.push(a),a.requireFailure(this)),this},dropRequireFailure:function(a){if(f(a,"dropRequireFailure",this))return this;a=Y(a,this);var b=s(this.requireFail,a);return b>-1&&this.requireFail.splice(b,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(a){return!!this.simultaneous[a.id]},emit:function(a){function b(b){c.manager.emit(b,a)}var c=this,d=this.state;hc>d&&b(c.options.event+W(d)),b(c.options.event),a.additionalEvent&&b(a.additionalEvent),d>=hc&&b(c.options.event+W(d))},tryEmit:function(a){return this.canEmit()?this.emit(a):void(this.state=kc)},canEmit:function(){for(var a=0;af?Db:Eb,c=f!=this.pX,d=Math.abs(a.deltaX)):(e=0===g?Cb:0>g?Fb:Gb,c=g!=this.pY,d=Math.abs(a.deltaY))),a.direction=e,c&&d>b.threshold&&e&b.direction},attrTest:function(a){return Z.prototype.attrTest.call(this,a)&&(this.state&fc||!(this.state&fc)&&this.directionTest(a))},emit:function(a){this.pX=a.deltaX,this.pY=a.deltaY;var b=X(a.direction);b&&(a.additionalEvent=this.options.event+b),this._super.emit.call(this,a)}}),j(_,Z,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[bc]},attrTest:function(a){return this._super.attrTest.call(this,a)&&(Math.abs(a.scale-1)>this.options.threshold||this.state&fc)},emit:function(a){if(1!==a.scale){var b=a.scale<1?"in":"out";a.additionalEvent=this.options.event+b}this._super.emit.call(this,a)}}),j(ab,V,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[_b]},process:function(a){var b=this.options,c=a.pointers.length===b.pointers,d=a.distanceb.time;if(this._input=a,!d||!c||a.eventType&(Ab|Bb)&&!f)this.reset();else if(a.eventType&yb)this.reset(),this._timer=e(function(){this.state=ic,this.tryEmit()},b.time,this);else if(a.eventType&Ab)return ic;return kc},reset:function(){clearTimeout(this._timer)},emit:function(a){this.state===ic&&(a&&a.eventType&Ab?this.manager.emit(this.options.event+"up",a):(this._input.timeStamp=nb(),this.manager.emit(this.options.event,this._input)))}}),j(bb,Z,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[bc]},attrTest:function(a){return this._super.attrTest.call(this,a)&&(Math.abs(a.rotation)>this.options.threshold||this.state&fc)}}),j(cb,Z,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Hb|Ib,pointers:1},getTouchAction:function(){return $.prototype.getTouchAction.call(this)},attrTest:function(a){var b,c=this.options.direction;return c&(Hb|Ib)?b=a.overallVelocity:c&Hb?b=a.overallVelocityX:c&Ib&&(b=a.overallVelocityY),this._super.attrTest.call(this,a)&&c&a.offsetDirection&&a.distance>this.options.threshold&&a.maxPointers==this.options.pointers&&mb(b)>this.options.velocity&&a.eventType&Ab},emit:function(a){var b=X(a.offsetDirection);b&&this.manager.emit(this.options.event+b,a),this.manager.emit(this.options.event,a)}}),j(db,V,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[ac]},process:function(a){var b=this.options,c=a.pointers.length===b.pointers,d=a.distance