diff --git a/.gitignore b/.gitignore index a736115..4457951 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ playground/ docs/ yarn-error.log examples/ +dist/index.html diff --git a/dist/zingtouch.js b/dist/zingtouch.js index 8d00f16..e6be8f7 100644 --- a/dist/zingtouch.js +++ b/dist/zingtouch.js @@ -4,5 +4,5 @@ * Author: ZingChart http://zingchart.com * License: MIT */ -!function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return e[r].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=n(1),u=r(i);window.ZingTouch=u.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),u=r(i),o=n(4),a=r(o),s=n(10),c=r(s),f=n(12),l=r(f),d=n(13),p=r(d),h=n(14),y=r(h),v=n(15),g=r(v),m=n(16),b=r(m),w={_regions:[],Gesture:a.default,Expand:c.default,Pan:l.default,Pinch:p.default,Rotate:y.default,Swipe:g.default,Tap:b.default,Region:function(e,t,n){var r=w._regions.length,i=new u.default(e,t,n,r);return w._regions.push(i),i}};t.default=w},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var u=function(){function e(e,t){for(var n=0;n0&&!function(){t.preventDefault?(f.default.setMSPreventDefault(t.element),e.preventDefault?e.preventDefault():e.returnValue=!1):f.default.removeMSPreventDefault(t.element);var i={},u=(0,s.default)(r,e,n);u.forEach(function(t){var n=t.binding.gesture.id;if(i[n]){var r=f.default.getPropagationPath(e);f.default.getPathIndex(r,t.binding.element)r?u*(n-i):u*i},getVelocity:function(e,t,n,r,i,u){var o=this.distanceBetweenTwoPoints(e,r,t,i);return o/(u-n)},getRightMostInput:function(e){var t=null,n=Number.MIN_VALUE;return e.forEach(function(e){e.initial.x>n&&(t=e)}),t},isInteger:function(e){return"number"==typeof e&&e%1===0},isInside:function(e,t,n){var r=n.getBoundingClientRect();return e>r.left&&er.top&&t0&&t.push(n)}),t}},{key:"updateInputs",value:function(e,t){function n(e,t,n,r){var i=I.default.normalizeEvent(e.type),o=u(t.inputs,n);return"start"===i&&o?void t.resetInputs():"start"!==i&&o&&!I.default.isInside(o.current.x,o.current.y,r)?void t.resetInputs():"start"===i||o?void("start"===i?t.inputs.push(new x.default(e,n)):o.update(e,n)):void t.resetInputs()}var r=T,i=e.touches?"TouchEvent":e.pointerType?"PointerEvent":"MouseEvent";switch(i){case"TouchEvent":if(e.touches.length!==e.targetTouches.length)return!1;for(var o in e.changedTouches)e.changedTouches.hasOwnProperty(o)&&I.default.isInteger(parseInt(o))&&(r=e.changedTouches[o].identifier,n(e,this,r,t));break;case"PointerEvent":r=e.pointerId,n(e,this,r,t);break;case"MouseEvent":default:n(e,this,T,t)}return!0}},{key:"resetInputs",value:function(){this.inputs=[]}},{key:"numActiveInputs",value:function(){var e=this.inputs.filter(function(e){return"end"!==e.current.type});return e.length}},{key:"registerGesture",value:function(e,t){this.assignGestureId(e),this.registeredGestures[t]=e}},{key:"assignGestureId",value:function(e){e.setId(this.regionId+"-"+this.numGestures++)}}]),e}();t.default=k},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(11),s=r(a),c=function(e){function t(e){i(this,t);var n=u(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.type="expand",n}return o(t,e),t}(s.default);t.default=c},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n=this.threshold)return o.lastEmittedDistance=r,{distance:r,center:u}}else if(r>i)o.lastEmittedDistance=r;else if(r=this.threshold)return o.lastEmittedDistance=r,{distance:r,center:u};return null}}}]),t}(c.default);t.default=h},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;nthis.threshold,s=Math.abs(e[i].current.x-u.lastEmitted.x)>this.threshold;if(o=a||s,!u.active||!o)return null;r.data[i]={distanceFromOrigin:l.default.distanceBetweenTwoPoints(e[i].initial.x,e[i].current.x,e[i].initial.y,e[i].current.y),directionFromOrigin:l.default.getAngle(e[i].initial.x,e[i].initial.y,e[i].current.x,e[i].current.y),currentDirection:l.default.getAngle(u.lastEmitted.x,u.lastEmitted.y,e[i].current.x,e[i].current.y)},u.lastEmitted.x=e[i].current.x,u.lastEmitted.y=e[i].current.y}return r}},{key:"end",value:function(e){var t=this;return e.forEach(function(e){var n=e.getGestureProgress(t.getId());n.active=!1}),null}}]),t}(c.default);t.default=h},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(11),s=r(a),c=n(8),f=(r(c),function(e){function t(e){i(this,t);var n=u(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.type="pinch",n}return o(t,e),t}(s.default));t.default=f},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;nthis.maxProgressStack&&i.moves.shift()}return null}},{key:"end",value:function(e){if(this.numInputs===e.length){for(var t={data:[]},n=0;n2){var i=r.moves.pop();if((new Date).getTime()-i.time>this.maxRestTime)return null;for(var u=void 0,o=r.moves.length-1;o!==-1;){if(r.moves[o].time!==i.time){u=r.moves[o];break}o--}u||(u=r.moves.pop(),u.time+=this.timeDistortion);var a=l.default.getVelocity(u.x,u.y,u.time,i.x,i.y,i.time);t.data[n]={velocity:a,currentDirection:l.default.getAngle(u.x,u.y,i.x,i.y)}}}for(var n=0;n0)return t}return null}}]),t}(c.default);t.default=g},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s=function(){function e(e,t){for(var n=0;n=u)return{interval:u};var o=function(){var n=t.type;return e.forEach(function(e){e.resetProgress(n)}),{v:null}}();return"object"===("undefined"==typeof o?"undefined":a(o))?o.v:void 0}}]),t}(f.default);t.default=g},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var r=function e(t,r,i,u,o){n(this,e),this.element=t,this.gesture=r,this.handler=i,this.capture="undefined"!=typeof u&&u,this.bindOnce="undefined"!=typeof o&&o};t.default=r},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var u=function(){function e(e,t){for(var n=0;n0&&!function(){t.preventDefault?(f.default.setMSPreventDefault(t.element),e.preventDefault?e.preventDefault():e.returnValue=!1):f.default.removeMSPreventDefault(t.element);var i={},u=(0,s.default)(r,e,n);u.forEach(function(t){var n=t.binding.gesture.id;if(i[n]){var r=f.default.getPropagationPath(e);f.default.getPathIndex(r,t.binding.element)r?u*(n-i):u*i},getVelocity:function(e,t,n,r,i,u){var o=this.distanceBetweenTwoPoints(e,r,t,i);return o/(u-n)},getRightMostInput:function(e){var t=null,n=Number.MIN_VALUE;return e.forEach(function(e){e.initial.x>n&&(t=e)}),t},isInteger:function(e){return"number"==typeof e&&e%1===0},isInside:function(e,t,n){var r=n.getBoundingClientRect();return e>r.left&&er.top&&t0&&t.push(n)}),t}},{key:"updateInputs",value:function(e,t){function n(e,t,n,r){var i=I.default.normalizeEvent(e.type),o=u(t.inputs,n);return"start"===i&&o?void t.resetInputs():"start"!==i&&o&&!I.default.isInside(o.current.x,o.current.y,r)?void t.resetInputs():"start"===i||o?void("start"===i?t.inputs.push(new x.default(e,n)):o.update(e,n)):void t.resetInputs()}var r=T,i=e.touches?"TouchEvent":e.pointerType?"PointerEvent":"MouseEvent";switch(i){case"TouchEvent":if(e.touches.length!==e.targetTouches.length)return!1;for(var o in e.changedTouches)e.changedTouches.hasOwnProperty(o)&&I.default.isInteger(parseInt(o))&&(r=e.changedTouches[o].identifier,n(e,this,r,t));break;case"PointerEvent":r=e.pointerId,n(e,this,r,t);break;case"MouseEvent":default:n(e,this,T,t)}return!0}},{key:"resetInputs",value:function(){this.inputs=[]}},{key:"numActiveInputs",value:function(){var e=this.inputs.filter(function(e){return"end"!==e.current.type});return e.length}},{key:"registerGesture",value:function(e,t){this.assignGestureId(e),this.registeredGestures[t]=e}},{key:"assignGestureId",value:function(e){e.setId(this.regionId+"-"+this.numGestures++)}}]),e}();t.default=k},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(11),s=r(a),c=function(e){function t(e){i(this,t);var n=u(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.type="expand",n}return o(t,e),t}(s.default);t.default=c},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n=this.threshold)return o.lastEmittedDistance=r,{distance:r,center:u}}else if(r>i)o.lastEmittedDistance=r;else if(r=this.threshold)return o.lastEmittedDistance=r,{distance:r,center:u};return null}}}]),t}(c.default);t.default=h},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;nthis.threshold,s=Math.abs(e[i].current.x-u.lastEmitted.x)>this.threshold;if(o=a||s,!u.active||!o)return null;r.data[i]={distanceFromOrigin:l.default.distanceBetweenTwoPoints(e[i].initial.x,e[i].current.x,e[i].initial.y,e[i].current.y),directionFromOrigin:l.default.getAngle(e[i].initial.x,e[i].initial.y,e[i].current.x,e[i].current.y),currentDirection:l.default.getAngle(u.lastEmitted.x,u.lastEmitted.y,e[i].current.x,e[i].current.y)},u.lastEmitted.x=e[i].current.x,u.lastEmitted.y=e[i].current.y}return r}},{key:"end",value:function(e){var t=this;return e.forEach(function(e){var n=e.getGestureProgress(t.getId());n.active=!1}),null}}]),t}(c.default);t.default=h},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(11),s=r(a),c=n(8),f=(r(c),function(e){function t(e){i(this,t);var n=u(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.type="pinch",n}return o(t,e),t}(s.default));t.default=f},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;nthis.maxProgressStack&&i.moves.shift()}return null}},{key:"end",value:function(e){if(this.numInputs===e.length){for(var t={data:[]},n=0;n2){var i=r.moves.pop();if((new Date).getTime()-i.time>this.maxRestTime)return null;for(var u=void 0,o=r.moves.length-1;o!==-1;){if(r.moves[o].time!==i.time){u=r.moves[o];break}o--}u||(u=r.moves.pop(),u.time+=this.timeDistortion);var a=l.default.getVelocity(u.x,u.y,u.time,i.x,i.y,i.time);t.data[n]={velocity:a,currentDirection:l.default.getAngle(u.x,u.y,i.x,i.y)}}}for(var n=0;n0)return t}return null}}]),t}(c.default);t.default=g},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s=function(){function e(e,t){for(var n=0;n=u)return{interval:u};var o=function(){var n=t.type;return e.forEach(function(e){e.resetProgress(n)}),{v:null}}();return"object"===("undefined"==typeof o?"undefined":a(o))?o.v:void 0}}]),t}(f.default);t.default=g},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var r=function e(t,r,i,u,o){n(this,e),this.element=t,this.gesture=r,this.handler=i,this.capture="undefined"!=typeof u&&u,this.bindOnce="undefined"!=typeof o&&o};t.default=r},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var u=function(){function e(e,t){for(var n=0;n 0) {\n\t (function () {\n\t if (region.preventDefault) {\n\t _util2.default.setMSPreventDefault(region.element);\n\t event.preventDefault ? event.preventDefault() : event.returnValue = false;\n\t } else {\n\t _util2.default.removeMSPreventDefault(region.element);\n\t }\n\t\n\t var toBeDispatched = {};\n\t var gestures = (0, _interpreter2.default)(bindings, event, state);\n\t\n\t /* Determine the deepest path index to emit the event\n\t from, to avoid duplicate events being fired. */\n\t\n\t gestures.forEach(function (gesture) {\n\t var id = gesture.binding.gesture.id;\n\t if (toBeDispatched[id]) {\n\t var path = _util2.default.getPropagationPath(event);\n\t if (_util2.default.getPathIndex(path, gesture.binding.element) < _util2.default.getPathIndex(path, toBeDispatched[id].binding.element)) {\n\t toBeDispatched[id] = gesture;\n\t }\n\t } else {\n\t toBeDispatched[id] = gesture;\n\t }\n\t });\n\t\n\t Object.keys(toBeDispatched).forEach(function (index) {\n\t var gesture = toBeDispatched[index];\n\t (0, _dispatcher2.default)(gesture.binding, gesture.data, gesture.events);\n\t });\n\t })();\n\t }\n\t\n\t var endCount = 0;\n\t state.inputs.forEach(function (input) {\n\t if (input.getCurrentEventType() === 'end') {\n\t endCount++;\n\t }\n\t });\n\t\n\t if (endCount === state.inputs.length) {\n\t state.resetInputs();\n\t }\n\t} /**\n\t * @file arbiter.js\n\t * Contains logic for the dispatcher\n\t */\n\t\n\texports.default = arbiter;\n\n/***/ },\n/* 6 */\n/***/ function(module, exports) {\n\n\t\"use strict\";\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t/**\n\t * @file dispatcher.js\n\t * Contains logic for the dispatcher\n\t */\n\t\n\t/**\n\t * Emits data at the target element if available, and bubbles up from\n\t * the target to the parent until the document has been reached.\n\t * Called from the arbiter.\n\t * @param {Binding} binding - An object of type Binding\n\t * @param {Object} data - The metadata computed by the gesture being emitted.\n\t * @param {Array} events - An array of ZingEvents\n\t * corresponding to the inputs on the screen.\n\t */\n\tfunction dispatcher(binding, data, events) {\n\t data.events = events;\n\t\n\t var newEvent = new CustomEvent(binding.gesture.getId(), {\n\t detail: data,\n\t bubbles: true,\n\t cancelable: true\n\t });\n\t emitEvent(binding.element, newEvent, binding);\n\t}\n\t\n\t/**\n\t * Emits the new event. Unbinds the event if the event was registered\n\t * at bindOnce.\n\t * @param {Element} target - Element object to emit the event to.\n\t * @param {Event} event - The CustomEvent to emit.\n\t * @param {Binding} binding - An object of type Binding\n\t */\n\tfunction emitEvent(target, event, binding) {\n\t target.dispatchEvent(event);\n\t if (binding.bindOnce) {\n\t ZingTouch.unbind(binding.element, binding.gesture.getType());\n\t }\n\t}\n\t\n\texports.default = dispatcher;\n\n/***/ },\n/* 7 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _util = __webpack_require__(8);\n\t\n\tvar _util2 = _interopRequireDefault(_util);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\t/**\n\t * Receives an event and an array of Bindings (element -> gesture handler)\n\t * to determine what event will be emitted. Called from the arbiter.\n\t * @param {Array} bindings - An array containing Binding objects\n\t * that associate the element to an event handler.\n\t * @param {Object} event - The event emitted from the window.\n\t * @param {Object} state - The state object of the current listener.\n\t * @return {Object | null} - Returns an object containing a binding and\n\t * metadata, or null if a gesture will not be emitted.\n\t */\n\tfunction interpreter(bindings, event, state) {\n\t var evType = _util2.default.normalizeEvent(event.type);\n\t var candidates = [];\n\t bindings.forEach(function (binding) {\n\t var result = binding.gesture[evType](state.inputs, state, binding.element);\n\t if (result) {\n\t (function () {\n\t var events = [];\n\t state.inputs.forEach(function (input) {\n\t events.push(input.current);\n\t });\n\t\n\t candidates.push({\n\t binding: binding,\n\t data: result,\n\t events: events\n\t });\n\t })();\n\t }\n\t });\n\t\n\t return candidates;\n\t} /**\n\t * @file interpreter.js\n\t * Contains logic for the interpreter\n\t */\n\t\n\texports.default = interpreter;\n\n/***/ },\n/* 8 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t/**\n\t * @file util.js\n\t * Various accessor and mutator functions to handle state and validation.\n\t */\n\t\n\tvar CIRCLE_DEGREES = 360;\n\tvar HALF_CIRCLE_DEGREES = 180;\n\t\n\t/**\n\t * Contains generic helper functions\n\t * @type {Object}\n\t * @namespace util\n\t */\n\tvar util = {\n\t\n\t /**\n\t * Normalizes window events to be either of type start, move, or end.\n\t * @param {String} type - The event type emitted by the browser\n\t * @return {null|String} - The normalized event, or null if it is an\n\t * event not predetermined.\n\t */\n\t normalizeEvent: function normalizeEvent(type) {\n\t switch (type) {\n\t case 'mousedown':\n\t case 'touchstart':\n\t case 'pointerdown':\n\t return 'start';\n\t case 'mousemove':\n\t case 'touchmove':\n\t case 'pointermove':\n\t return 'move';\n\t case 'mouseup':\n\t case 'touchend':\n\t case 'pointerup':\n\t return 'end';\n\t default:\n\t return null;\n\t }\n\t },\n\t\n\t /* normalizeEvent*/\n\t\n\t /**\n\t * Determines if the current and previous coordinates are within or\n\t * up to a certain tolerance.\n\t * @param {Number} currentX - Current event's x coordinate\n\t * @param {Number} currentY - Current event's y coordinate\n\t * @param {Number} previousX - Previous event's x coordinate\n\t * @param {Number} previousY - Previous event's y coordinate\n\t * @param {Number} tolerance - The tolerance in pixel value.\n\t * @return {boolean} - true if the current coordinates are\n\t * within the tolerance, false otherwise\n\t */\n\t isWithin: function isWithin(currentX, currentY, previousX, previousY, tolerance) {\n\t return Math.abs(currentY - previousY) <= tolerance && Math.abs(currentX - previousX) <= tolerance;\n\t },\n\t\n\t /* isWithin*/\n\t\n\t /**\n\t * Calculates the distance between two points.\n\t * @param {Number} x0\n\t * @param {Number} x1\n\t * @param {Number} y0\n\t * @param {Number} y1\n\t * @return {number} The numerical value between two points\n\t */\n\t distanceBetweenTwoPoints: function distanceBetweenTwoPoints(x0, x1, y0, y1) {\n\t var dist = Math.sqrt((x1 - x0) * (x1 - x0) + (y1 - y0) * (y1 - y0));\n\t return Math.round(dist * 100) / 100;\n\t },\n\t\n\t\n\t /**\n\t * Calculates the midpoint coordinates between two points.\n\t * @param {Number} x0\n\t * @param {Number} x1\n\t * @param {Number} y0\n\t * @param {Number} y1\n\t * @return {Object} The coordinates of the midpoint.\n\t */\n\t getMidpoint: function getMidpoint(x0, x1, y0, y1) {\n\t return {\n\t x: (x0 + x1) / 2,\n\t y: (y0 + y1) / 2\n\t };\n\t },\n\t\n\t /**\n\t * Calculates the angle between the projection and an origin point.\n\t * | (projectionX,projectionY)\n\t * | /°\n\t * | /\n\t * | /\n\t * | / θ\n\t * | /__________\n\t * ° (originX, originY)\n\t * @param {number} originX\n\t * @param {number} originY\n\t * @param {number} projectionX\n\t * @param {number} projectionY\n\t * @return {number} - Degree along the unit circle where the project lies\n\t */\n\t getAngle: function getAngle(originX, originY, projectionX, projectionY) {\n\t var angle = Math.atan2(projectionY - originY, projectionX - originX) * (HALF_CIRCLE_DEGREES / Math.PI);\n\t return CIRCLE_DEGREES - (angle < 0 ? CIRCLE_DEGREES + angle : angle);\n\t },\n\t\n\t /**\n\t * Calculates the angular distance in degrees between two angles\n\t * along the unit circle\n\t * @param {number} start - The starting point in degrees\n\t * @param {number} end - The ending point in degrees\n\t * @return {number} The number of degrees between the\n\t * starting point and ending point. Negative degrees denote a clockwise\n\t * direction, and positive a counter-clockwise direction.\n\t */\n\t getAngularDistance: function getAngularDistance(start, end) {\n\t var angle = (end - start) % CIRCLE_DEGREES;\n\t var sign = angle < 0 ? 1 : -1;\n\t angle = Math.abs(angle);\n\t return angle > HALF_CIRCLE_DEGREES ? sign * (CIRCLE_DEGREES - angle) : sign * angle;\n\t },\n\t\n\t\n\t /**\n\t * Calculates the velocity of pixel/milliseconds between two points\n\t * @param {Number} startX\n\t * @param {Number} startY\n\t * @param {Number} startTime\n\t * @param {Number} endX\n\t * @param {Number} endY\n\t * @param {Number} endTime\n\t * @return {Number} velocity of px/time\n\t */\n\t getVelocity: function getVelocity(startX, startY, startTime, endX, endY, endTime) {\n\t var distance = this.distanceBetweenTwoPoints(startX, endX, startY, endY);\n\t return distance / (endTime - startTime);\n\t },\n\t\n\t\n\t /**\n\t * Returns the farthest right input\n\t * @param {Array} inputs\n\t * @return {Object}\n\t */\n\t getRightMostInput: function getRightMostInput(inputs) {\n\t var rightMost = null;\n\t var distance = Number.MIN_VALUE;\n\t inputs.forEach(function (input) {\n\t if (input.initial.x > distance) {\n\t rightMost = input;\n\t }\n\t });\n\t return rightMost;\n\t },\n\t\n\t\n\t /**\n\t * Determines is the value is an integer and not a floating point\n\t * @param {Mixed} value\n\t * @return {boolean}\n\t */\n\t isInteger: function isInteger(value) {\n\t return typeof value === 'number' && value % 1 === 0;\n\t },\n\t\n\t\n\t /**\n\t * Determines if the x,y position of the input is within then target.\n\t * @param {Number} x -clientX\n\t * @param {Number} y -clientY\n\t * @param {Element} target\n\t * @return {Boolean}\n\t */\n\t isInside: function isInside(x, y, target) {\n\t var rect = target.getBoundingClientRect();\n\t return x > rect.left && x < rect.left + rect.width && y > rect.top && y < rect.top + rect.height;\n\t },\n\t\n\t /**\n\t * Polyfill for event.propagationPath\n\t * @param {Event} event\n\t * @return {Array}\n\t */\n\t getPropagationPath: function getPropagationPath(event) {\n\t if (event.path) {\n\t return event.path;\n\t } else {\n\t var path = [];\n\t var node = event.target;\n\t while (node != document) {\n\t path.push(node);\n\t node = node.parentNode;\n\t }\n\t\n\t return path;\n\t }\n\t },\n\t\n\t\n\t /**\n\t * Retrieve the index inside the path array\n\t * @param {Array} path\n\t * @param {Element} element\n\t * @return {Element}\n\t */\n\t getPathIndex: function getPathIndex(path, element) {\n\t var index = path.length;\n\t\n\t path.forEach(function (obj) {\n\t if (obj === element) {\n\t index = i;\n\t }\n\t });\n\t\n\t return index;\n\t },\n\t setMSPreventDefault: function setMSPreventDefault(element) {\n\t element.style['-ms-content-zooming'] = 'none';\n\t element.style['touch-action'] = 'none';\n\t },\n\t removeMSPreventDefault: function removeMSPreventDefault(element) {\n\t element.style['-ms-content-zooming'] = '';\n\t element.style['touch-action'] = '';\n\t }\n\t};\n\texports.default = util;\n\n/***/ },\n/* 9 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /**\n\t * @file State.js\n\t */\n\t\n\tvar _Gesture = __webpack_require__(4);\n\t\n\tvar _Gesture2 = _interopRequireDefault(_Gesture);\n\t\n\tvar _Expand = __webpack_require__(10);\n\t\n\tvar _Expand2 = _interopRequireDefault(_Expand);\n\t\n\tvar _Pan = __webpack_require__(12);\n\t\n\tvar _Pan2 = _interopRequireDefault(_Pan);\n\t\n\tvar _Pinch = __webpack_require__(13);\n\t\n\tvar _Pinch2 = _interopRequireDefault(_Pinch);\n\t\n\tvar _Rotate = __webpack_require__(14);\n\t\n\tvar _Rotate2 = _interopRequireDefault(_Rotate);\n\t\n\tvar _Swipe = __webpack_require__(15);\n\t\n\tvar _Swipe2 = _interopRequireDefault(_Swipe);\n\t\n\tvar _Tap = __webpack_require__(16);\n\t\n\tvar _Tap2 = _interopRequireDefault(_Tap);\n\t\n\tvar _Binding = __webpack_require__(17);\n\t\n\tvar _Binding2 = _interopRequireDefault(_Binding);\n\t\n\tvar _Input = __webpack_require__(18);\n\t\n\tvar _Input2 = _interopRequireDefault(_Input);\n\t\n\tvar _util = __webpack_require__(8);\n\t\n\tvar _util2 = _interopRequireDefault(_util);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tvar DEFAULT_MOUSE_ID = 0;\n\t\n\t/**\n\t * Creates an object related to a Region's state,\n\t * and contains helper methods to update and clean up different states.\n\t */\n\t\n\tvar State = function () {\n\t\n\t /**\n\t * Constructor for the State class.\n\t * @param {String} regionId - The id the region this state is bound to.\n\t */\n\t function State(regionId) {\n\t _classCallCheck(this, State);\n\t\n\t /**\n\t * The id for the region this state is bound to.\n\t * @type {String}\n\t */\n\t this.regionId = regionId;\n\t\n\t /**\n\t * An array of current and recently inactive\n\t * Input objects related to a gesture.\n\t * @type {Input}\n\t */\n\t this.inputs = [];\n\t\n\t /**\n\t * An array of Binding objects; The list of relations between elements,\n\t * their gestures, and the handlers.\n\t * @type {Binding}\n\t */\n\t this.bindings = [];\n\t\n\t /**\n\t * The number of gestures that have been registered with this state\n\t * @type {Number}\n\t */\n\t this.numGestures = 0;\n\t\n\t /**\n\t * A key/value map all the registered gestures for the listener.\n\t * Note: Can only have one gesture registered to one key.\n\t * @type {Object}\n\t */\n\t this.registeredGestures = {};\n\t\n\t this.registerGesture(new _Expand2.default(), 'expand');\n\t this.registerGesture(new _Pan2.default(), 'pan');\n\t this.registerGesture(new _Rotate2.default(), 'rotate');\n\t this.registerGesture(new _Pinch2.default(), 'pinch');\n\t this.registerGesture(new _Swipe2.default(), 'swipe');\n\t this.registerGesture(new _Tap2.default(), 'tap');\n\t }\n\t\n\t /**\n\t * Creates a new binding with the given element and gesture object.\n\t * If the gesture object provided is unregistered, it's reference\n\t * will be saved in as a binding to be later referenced.\n\t * @param {Element} element - The element the gesture is bound to.\n\t * @param {String|Object} gesture - Either a name of a registered gesture,\n\t * or an unregistered Gesture object.\n\t * @param {Function} handler - The function handler to be called\n\t * when the event is emitted. Used to bind/unbind.\n\t * @param {Boolean} capture - Whether the gesture is to be\n\t * detected in the capture of bubble phase. Used to bind/unbind.\n\t * @param {Boolean} bindOnce - Option to bind once and\n\t * only emit the event once.\n\t */\n\t\n\t\n\t _createClass(State, [{\n\t key: 'addBinding',\n\t value: function addBinding(element, gesture, handler, capture, bindOnce) {\n\t var boundGesture = void 0;\n\t\n\t // Error type checking.\n\t if (element && typeof element.tagName === 'undefined') {\n\t throw new Error('Parameter element is an invalid object.');\n\t }\n\t\n\t if (typeof handler !== 'function') {\n\t throw new Error('Parameter handler is invalid.');\n\t }\n\t\n\t if (typeof gesture === 'string' && Object.keys(this.registeredGestures).indexOf(gesture) === -1) {\n\t throw new Error('Parameter ' + gesture + ' is not a registered gesture');\n\t } else if ((typeof gesture === 'undefined' ? 'undefined' : _typeof(gesture)) === 'object' && !(gesture instanceof _Gesture2.default)) {\n\t throw new Error('Parameter for the gesture is not of a Gesture type');\n\t }\n\t\n\t if (typeof gesture === 'string') {\n\t boundGesture = this.registeredGestures[gesture];\n\t } else {\n\t boundGesture = gesture;\n\t if (boundGesture.id === '') {\n\t this.assignGestureId(boundGesture);\n\t }\n\t }\n\t\n\t this.bindings.push(new _Binding2.default(element, boundGesture, handler, capture, bindOnce));\n\t element.addEventListener(boundGesture.getId(), handler, capture);\n\t }\n\t\n\t /**\n\t * Retrieves the Binding by which an element is associated to.\n\t * @param {Element} element - The element to find bindings to.\n\t * @return {Array} - An array of Bindings to which that element is bound\n\t */\n\t\n\t }, {\n\t key: 'retrieveBindingsByElement',\n\t value: function retrieveBindingsByElement(element) {\n\t var matches = [];\n\t this.bindings.map(function (binding) {\n\t if (binding.element === element) {\n\t matches.push(binding);\n\t }\n\t });\n\t return matches;\n\t }\n\t\n\t /**\n\t * Retrieves all bindings based upon the initial X/Y position of the inputs.\n\t * e.g. if gesture started on the correct target element,\n\t * but diverted away into the correct region, this would still be valid.\n\t * @return {Array} - An array of Bindings to which that element is bound\n\t */\n\t\n\t }, {\n\t key: 'retrieveBindingsByInitialPos',\n\t value: function retrieveBindingsByInitialPos() {\n\t var _this = this;\n\t\n\t var matches = [];\n\t this.bindings.forEach(function (binding) {\n\t // Determine if at least one input is in the target element.\n\t // They should all be in the region based upon a prior check\n\t var inputsInside = _this.inputs.filter(function (input) {\n\t return _util2.default.isInside(input.initial.x, input.initial.y, binding.element);\n\t });\n\t if (inputsInside.length > 0) {\n\t matches.push(binding);\n\t }\n\t });\n\t return matches;\n\t }\n\t\n\t /**\n\t * Updates the inputs with new information based upon a new event being fired.\n\t * @param {Event} event - The event being captured.\n\t * @param {Element} regionElement - The element where\n\t * this current Region is bound to.\n\t * @return {boolean} - returns true for a successful update,\n\t * false if the event is invalid.\n\t */\n\t\n\t }, {\n\t key: 'updateInputs',\n\t value: function updateInputs(event, regionElement) {\n\t var identifier = DEFAULT_MOUSE_ID;\n\t var eventType = event.touches ? 'TouchEvent' : event.pointerType ? 'PointerEvent' : 'MouseEvent';\n\t\n\t switch (eventType) {\n\t case 'TouchEvent':\n\t // Return if all gestures did not originate from the same target\n\t if (event.touches.length !== event.targetTouches.length) {\n\t return false;\n\t }\n\t\n\t for (var index in event.changedTouches) {\n\t if (event.changedTouches.hasOwnProperty(index) && _util2.default.isInteger(parseInt(index))) {\n\t identifier = event.changedTouches[index].identifier;\n\t update(event, this, identifier, regionElement);\n\t }\n\t }\n\t break;\n\t\n\t case 'PointerEvent':\n\t identifier = event.pointerId;\n\t update(event, this, identifier, regionElement);\n\t break;\n\t\n\t case 'MouseEvent':\n\t default:\n\t update(event, this, DEFAULT_MOUSE_ID, regionElement);\n\t break;\n\t }\n\t return true;\n\t\n\t function update(event, state, identifier, regionElement) {\n\t var eventType = _util2.default.normalizeEvent(event.type);\n\t var input = findInputById(state.inputs, identifier);\n\t\n\t // A starting input was not cleaned up properly and still exists.\n\t if (eventType === 'start' && input) {\n\t state.resetInputs();\n\t return;\n\t }\n\t\n\t // An input has moved outside the region.\n\t if (eventType !== 'start' && input && !_util2.default.isInside(input.current.x, input.current.y, regionElement)) {\n\t state.resetInputs();\n\t return;\n\t }\n\t\n\t if (eventType !== 'start' && !input) {\n\t state.resetInputs();\n\t return;\n\t }\n\t\n\t if (eventType === 'start') {\n\t state.inputs.push(new _Input2.default(event, identifier));\n\t } else {\n\t input.update(event, identifier);\n\t }\n\t }\n\t }\n\t\n\t /**\n\t * Removes all inputs from the state, allowing for a new gesture.\n\t */\n\t\n\t }, {\n\t key: 'resetInputs',\n\t value: function resetInputs() {\n\t this.inputs = [];\n\t }\n\t\n\t /**\n\t * Counts the number of active inputs at any given time.\n\t * @return {Number} - The number of active inputs.\n\t */\n\t\n\t }, {\n\t key: 'numActiveInputs',\n\t value: function numActiveInputs() {\n\t var endType = this.inputs.filter(function (input) {\n\t return input.current.type !== 'end';\n\t });\n\t return endType.length;\n\t }\n\t\n\t /**\n\t * Register the gesture to the current region.\n\t * @param {Object} gesture - The gesture to register\n\t * @param {String} key - The key to define the new gesture as.\n\t */\n\t\n\t }, {\n\t key: 'registerGesture',\n\t value: function registerGesture(gesture, key) {\n\t this.assignGestureId(gesture);\n\t this.registeredGestures[key] = gesture;\n\t }\n\t\n\t /**\n\t * Tracks the gesture to this state object to become uniquely identifiable.\n\t * Useful for nested Regions.\n\t * @param {Gesture} gesture - The gesture to track\n\t */\n\t\n\t }, {\n\t key: 'assignGestureId',\n\t value: function assignGestureId(gesture) {\n\t gesture.setId(this.regionId + '-' + this.numGestures++);\n\t }\n\t }]);\n\t\n\t return State;\n\t}();\n\t/**\n\t * Searches through each input, comparing the browser's identifier key\n\t * for touches, to the stored one in each input\n\t * @param {Array} inputs - The array of inputs in state.\n\t * @param {String} identifier - The identifier the browser has assigned.\n\t * @return {Input} - The input object with the corresponding identifier,\n\t * null if it did not find any.\n\t */\n\t\n\t\n\tfunction findInputById(inputs, identifier) {\n\t for (var i = 0; i < inputs.length; i++) {\n\t if (inputs[i].identifier === identifier) {\n\t return inputs[i];\n\t }\n\t }\n\t\n\t return null;\n\t}\n\t\n\texports.default = State;\n\n/***/ },\n/* 10 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _Distance2 = __webpack_require__(11);\n\t\n\tvar _Distance3 = _interopRequireDefault(_Distance2);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /**\n\t * @file Expand.js\n\t * Contains the Expand class\n\t */\n\t\n\t/**\n\t * An Expand is defined as two inputs moving farther away from each other.\n\t * This gesture does not account for any start/end events to allow for the\n\t * event to interact with the Pan and Pinch events.\n\t * @class Expand\n\t */\n\tvar Expand = function (_Distance) {\n\t _inherits(Expand, _Distance);\n\t\n\t /**\n\t * Constructor function for the Expand class.\n\t * @param {object} options\n\t */\n\t function Expand(options) {\n\t _classCallCheck(this, Expand);\n\t\n\t /**\n\t * The type of the Gesture.\n\t * @type {String}\n\t */\n\t var _this = _possibleConstructorReturn(this, (Expand.__proto__ || Object.getPrototypeOf(Expand)).call(this, options));\n\t\n\t _this.type = 'expand';\n\t return _this;\n\t }\n\t\n\t return Expand;\n\t}(_Distance3.default);\n\t\n\texports.default = Expand;\n\n/***/ },\n/* 11 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _Gesture2 = __webpack_require__(4);\n\t\n\tvar _Gesture3 = _interopRequireDefault(_Gesture2);\n\t\n\tvar _util = __webpack_require__(8);\n\t\n\tvar _util2 = _interopRequireDefault(_util);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /**\n\t * @file Distance.js\n\t * Contains the abstract Distance class\n\t */\n\t\n\tvar DEFAULT_INPUTS = 2;\n\tvar DEFAULT_MIN_THRESHOLD = 1;\n\t\n\t/**\n\t * A Distance is defined as two inputs moving either together or apart.\n\t * @class Distance\n\t */\n\t\n\tvar Distance = function (_Gesture) {\n\t _inherits(Distance, _Gesture);\n\t\n\t /**\n\t * Constructor function for the Distance class.\n\t * @param {Object} options\n\t */\n\t function Distance(options) {\n\t _classCallCheck(this, Distance);\n\t\n\t /**\n\t * The type of the Gesture.\n\t * @type {String}\n\t */\n\t var _this = _possibleConstructorReturn(this, (Distance.__proto__ || Object.getPrototypeOf(Distance)).call(this));\n\t\n\t _this.type = 'distance';\n\t\n\t /**\n\t * The minimum amount in pixels the inputs must move until it is fired.\n\t * @type {Number}\n\t */\n\t _this.threshold = options && options.threshold ? options.threshold : DEFAULT_MIN_THRESHOLD;\n\t return _this;\n\t }\n\t\n\t /**\n\t * Event hook for the start of a gesture. Initialized the lastEmitted\n\t * gesture and stores it in the first input for reference events.\n\t * @param {Array} inputs\n\t */\n\t\n\t\n\t _createClass(Distance, [{\n\t key: 'start',\n\t value: function start(inputs) {\n\t if (inputs.length === DEFAULT_INPUTS) {\n\t // Store the progress in the first input.\n\t var progress = inputs[0].getGestureProgress(this.type);\n\t progress.lastEmittedDistance = _util2.default.distanceBetweenTwoPoints(inputs[0].current.x, inputs[1].current.x, inputs[0].current.y, inputs[1].current.y);\n\t }\n\t }\n\t\n\t /**\n\t * Event hook for the move of a gesture.\n\t * Determines if the two points are moved in the expected direction relative\n\t * to the current distance and the last distance.\n\t * @param {Array} inputs - The array of Inputs on the screen.\n\t * @param {Object} state - The state object of the current region.\n\t * @param {Element} element - The element associated to the binding.\n\t * @return {Object | null} - Returns the distance in pixels between two inputs\n\t */\n\t\n\t }, {\n\t key: 'move',\n\t value: function move(inputs, state, element) {\n\t if (state.numActiveInputs() === DEFAULT_INPUTS) {\n\t var currentDistance = _util2.default.distanceBetweenTwoPoints(inputs[0].current.x, inputs[1].current.x, inputs[0].current.y, inputs[1].current.y);\n\t var lastDistance = _util2.default.distanceBetweenTwoPoints(inputs[0].previous.x, inputs[1].previous.x, inputs[0].previous.y, inputs[1].previous.y);\n\t\n\t var centerPoint = _util2.default.getMidpoint(inputs[0].current.x, inputs[1].current.x, inputs[0].current.y, inputs[1].current.y);\n\t\n\t // Retrieve the first input's progress.\n\t var progress = inputs[0].getGestureProgress(this.type);\n\t\n\t if (this.type === 'expand') {\n\t if (currentDistance < lastDistance) {\n\t progress.lastEmittedDistance = currentDistance;\n\t } else if (currentDistance - progress.lastEmittedDistance >= this.threshold) {\n\t progress.lastEmittedDistance = currentDistance;\n\t return {\n\t distance: currentDistance,\n\t center: centerPoint\n\t };\n\t }\n\t } else {\n\t if (currentDistance > lastDistance) {\n\t progress.lastEmittedDistance = currentDistance;\n\t } else if (currentDistance < lastDistance && progress.lastEmittedDistance - currentDistance >= this.threshold) {\n\t progress.lastEmittedDistance = currentDistance;\n\t return {\n\t distance: currentDistance,\n\t center: centerPoint\n\t };\n\t }\n\t }\n\t\n\t return null;\n\t }\n\t }\n\t }]);\n\t\n\t return Distance;\n\t}(_Gesture3.default);\n\t\n\texports.default = Distance;\n\n/***/ },\n/* 12 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _Gesture2 = __webpack_require__(4);\n\t\n\tvar _Gesture3 = _interopRequireDefault(_Gesture2);\n\t\n\tvar _util = __webpack_require__(8);\n\t\n\tvar _util2 = _interopRequireDefault(_util);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /**\n\t * @file Pan.js\n\t * Contains the Pan class\n\t */\n\t\n\tvar DEFAULT_INPUTS = 1;\n\tvar DEFAULT_MIN_THRESHOLD = 1;\n\t\n\t/**\n\t * A Pan is defined as a normal movement in any direction on a screen.\n\t * Pan gestures do not track start events and can interact with pinch and \\\n\t * expand gestures.\n\t * @class Pan\n\t */\n\t\n\tvar Pan = function (_Gesture) {\n\t _inherits(Pan, _Gesture);\n\t\n\t /**\n\t * Constructor function for the Pan class.\n\t * @param {Object} [options] - The options object.\n\t * @param {Number} [options.numInputs=1] - Number of inputs for the\n\t * Pan gesture.\n\t * @param {Number} [options.threshold=1] - The minimum number of\n\t * pixels the input has to move to trigger this gesture.\n\t */\n\t function Pan(options) {\n\t _classCallCheck(this, Pan);\n\t\n\t /**\n\t * The type of the Gesture.\n\t * @type {String}\n\t */\n\t var _this = _possibleConstructorReturn(this, (Pan.__proto__ || Object.getPrototypeOf(Pan)).call(this));\n\t\n\t _this.type = 'pan';\n\t\n\t /**\n\t * The number of inputs to trigger a Pan can be variable,\n\t * and the maximum number being a factor of the browser.\n\t * @type {Number}\n\t */\n\t _this.numInputs = options && options.numInputs ? options.numInputs : DEFAULT_INPUTS;\n\t\n\t /**\n\t * The minimum amount in pixels the pan must move until it is fired.\n\t * @type {Number}\n\t */\n\t _this.threshold = options && options.threshold ? options.threshold : DEFAULT_MIN_THRESHOLD;\n\t return _this;\n\t }\n\t\n\t /**\n\t * Event hook for the start of a gesture. Marks each input as active,\n\t * so it can invalidate any end events.\n\t * @param {Array} inputs\n\t */\n\t\n\t\n\t _createClass(Pan, [{\n\t key: 'start',\n\t value: function start(inputs) {\n\t var _this2 = this;\n\t\n\t inputs.forEach(function (input) {\n\t var progress = input.getGestureProgress(_this2.getId());\n\t progress.active = true;\n\t progress.lastEmitted = {\n\t x: input.current.x,\n\t y: input.current.y\n\t };\n\t });\n\t }\n\t\n\t /**\n\t * move() - Event hook for the move of a gesture.\n\t * Fired whenever the input length is met, and keeps a boolean flag that\n\t * the gesture has fired at least once.\n\t * @param {Array} inputs - The array of Inputs on the screen\n\t * @param {Object} state - The state object of the current region.\n\t * @param {Element} element - The element associated to the binding.\n\t * @return {Object} - Returns the distance in pixels between the two inputs.\n\t */\n\t\n\t }, {\n\t key: 'move',\n\t value: function move(inputs, state, element) {\n\t if (this.numInputs === inputs.length) {\n\t var output = {\n\t data: []\n\t };\n\t for (var i = 0; i < inputs.length; i++) {\n\t var progress = inputs[i].getGestureProgress(this.getId());\n\t\n\t var reachedThreshold = false;\n\t\n\t // Check threshold distance\n\t var yThreshold = Math.abs(inputs[i].current.y - progress.lastEmitted.y) > this.threshold;\n\t var xThreshold = Math.abs(inputs[i].current.x - progress.lastEmitted.x) > this.threshold;\n\t reachedThreshold = yThreshold || xThreshold;\n\t\n\t if (progress.active && reachedThreshold) {\n\t output.data[i] = {\n\t distanceFromOrigin: _util2.default.distanceBetweenTwoPoints(inputs[i].initial.x, inputs[i].current.x, inputs[i].initial.y, inputs[i].current.y),\n\t directionFromOrigin: _util2.default.getAngle(inputs[i].initial.x, inputs[i].initial.y, inputs[i].current.x, inputs[i].current.y),\n\t currentDirection: _util2.default.getAngle(progress.lastEmitted.x, progress.lastEmitted.y, inputs[i].current.x, inputs[i].current.y)\n\t };\n\t progress.lastEmitted.x = inputs[i].current.x;\n\t progress.lastEmitted.y = inputs[i].current.y;\n\t } else {\n\t return null;\n\t }\n\t }\n\t }\n\t\n\t return output;\n\t }\n\t\n\t /* move*/\n\t\n\t /**\n\t * end() - Event hook for the end of a gesture. If the gesture has at least\n\t * fired once, then it ends on the first end event such that any remaining\n\t * inputs will not trigger the event until all inputs have reached the\n\t * touchend event. Any touchend->touchstart events that occur before all\n\t * inputs are fully off the screen should not fire.\n\t * @param {Array} inputs - The array of Inputs on the screen\n\t * @return {null} - null if the gesture is not to be emitted,\n\t * Object with information otherwise.\n\t */\n\t\n\t }, {\n\t key: 'end',\n\t value: function end(inputs) {\n\t var _this3 = this;\n\t\n\t inputs.forEach(function (input) {\n\t var progress = input.getGestureProgress(_this3.getId());\n\t progress.active = false;\n\t });\n\t return null;\n\t }\n\t\n\t /* end*/\n\t\n\t }]);\n\t\n\t return Pan;\n\t}(_Gesture3.default);\n\t\n\texports.default = Pan;\n\n/***/ },\n/* 13 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _Distance2 = __webpack_require__(11);\n\t\n\tvar _Distance3 = _interopRequireDefault(_Distance2);\n\t\n\tvar _util = __webpack_require__(8);\n\t\n\tvar _util2 = _interopRequireDefault(_util);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /**\n\t * @file Pinch.js\n\t * Contains the Pinch class\n\t */\n\t\n\t/**\n\t * An Pinch is defined as two inputs moving closer to each other.\n\t * This gesture does not account for any start/end events to allow for the event\n\t * to interact with the Pan and Pinch events.\n\t * @class Pinch\n\t */\n\tvar Pinch = function (_Distance) {\n\t _inherits(Pinch, _Distance);\n\t\n\t /**\n\t * Constructor function for the Pinch class.\n\t * @param {Object} options\n\t */\n\t function Pinch(options) {\n\t _classCallCheck(this, Pinch);\n\t\n\t /**\n\t * The type of the Gesture.\n\t * @type {String}\n\t */\n\t var _this = _possibleConstructorReturn(this, (Pinch.__proto__ || Object.getPrototypeOf(Pinch)).call(this, options));\n\t\n\t _this.type = 'pinch';\n\t return _this;\n\t }\n\t\n\t return Pinch;\n\t}(_Distance3.default);\n\t\n\texports.default = Pinch;\n\n/***/ },\n/* 14 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _Gesture2 = __webpack_require__(4);\n\t\n\tvar _Gesture3 = _interopRequireDefault(_Gesture2);\n\t\n\tvar _util = __webpack_require__(8);\n\t\n\tvar _util2 = _interopRequireDefault(_util);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /**\n\t * @file Rotate.js\n\t * Contains the Rotate class\n\t */\n\t\n\tvar MAX_INPUTS = 2;\n\t\n\t/**\n\t * A Rotate is defined as two inputs moving about a circle,\n\t * maintaining a relatively equal radius.\n\t * @class Rotate\n\t */\n\t\n\tvar Rotate = function (_Gesture) {\n\t _inherits(Rotate, _Gesture);\n\t\n\t /**\n\t * Constructor function for the Rotate class.\n\t */\n\t function Rotate() {\n\t _classCallCheck(this, Rotate);\n\t\n\t /**\n\t * The type of the Gesture.\n\t * @type {String}\n\t */\n\t var _this = _possibleConstructorReturn(this, (Rotate.__proto__ || Object.getPrototypeOf(Rotate)).call(this));\n\t\n\t _this.type = 'rotate';\n\t return _this;\n\t }\n\t\n\t /**\n\t * move() - Event hook for the move of a gesture. Obtains the midpoint of two\n\t * the two inputs and calculates the projection of the right most input along\n\t * a unit circle to obtain an angle. This angle is compared to the previously\n\t * calculated angle to output the change of distance, and is compared to the\n\t * initial angle to output the distance from the initial angle to the current\n\t * angle.\n\t * @param {Array} inputs - The array of Inputs on the screen\n\t * @param {Object} state - The state object of the current listener.\n\t * @param {Element} element - The element associated to the binding.\n\t * @return {null} - null if this event did not occur\n\t * @return {Object} obj.angle - The current angle along the unit circle\n\t * @return {Object} obj.distanceFromOrigin - The angular distance travelled\n\t * from the initial right most point.\n\t * @return {Object} obj.distanceFromLast - The change of angle between the\n\t * last position and the current position.\n\t */\n\t\n\t\n\t _createClass(Rotate, [{\n\t key: 'move',\n\t value: function move(inputs, state, element) {\n\t if (state.numActiveInputs() <= MAX_INPUTS) {\n\t var referencePivot = void 0;\n\t var diffX = void 0;\n\t var diffY = void 0;\n\t var input = void 0;\n\t if (state.numActiveInputs() === 1) {\n\t var bRect = element.getBoundingClientRect();\n\t referencePivot = {\n\t x: bRect.left + bRect.width / 2,\n\t y: bRect.top + bRect.height / 2\n\t };\n\t input = inputs[0];\n\t diffX = diffY = 0;\n\t } else {\n\t referencePivot = _util2.default.getMidpoint(inputs[0].initial.x, inputs[1].initial.x, inputs[0].initial.y, inputs[1].initial.y);\n\t var currentPivot = _util2.default.getMidpoint(inputs[0].current.x, inputs[1].current.x, inputs[0].current.y, inputs[1].current.y);\n\t diffX = referencePivot.x - currentPivot.x;\n\t diffY = referencePivot.y - currentPivot.y;\n\t input = _util2.default.getRightMostInput(inputs);\n\t }\n\t\n\t // Translate the current pivot point.\n\t var currentAngle = _util2.default.getAngle(referencePivot.x, referencePivot.y, input.current.x + diffX, input.current.y + diffY);\n\t\n\t var progress = input.getGestureProgress(this.getId());\n\t if (!progress.initialAngle) {\n\t progress.initialAngle = progress.previousAngle = currentAngle;\n\t progress.distance = progress.change = 0;\n\t } else {\n\t progress.change = _util2.default.getAngularDistance(progress.previousAngle, currentAngle);\n\t progress.distance = progress.distance + progress.change;\n\t }\n\t\n\t progress.previousAngle = currentAngle;\n\t\n\t return {\n\t angle: currentAngle,\n\t distanceFromOrigin: progress.distance,\n\t distanceFromLast: progress.change\n\t };\n\t }\n\t\n\t return null;\n\t }\n\t\n\t /* move*/\n\t\n\t }]);\n\t\n\t return Rotate;\n\t}(_Gesture3.default);\n\t\n\texports.default = Rotate;\n\n/***/ },\n/* 15 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _Gesture2 = __webpack_require__(4);\n\t\n\tvar _Gesture3 = _interopRequireDefault(_Gesture2);\n\t\n\tvar _util = __webpack_require__(8);\n\t\n\tvar _util2 = _interopRequireDefault(_util);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /**\n\t * @file Swipe.js\n\t * Contains the Swipe class\n\t */\n\t\n\tvar DEFAULT_INPUTS = 1;\n\tvar DEFAULT_MAX_REST_TIME = 100;\n\tvar DEFAULT_ESCAPE_VELOCITY = 0.2;\n\tvar DEFAULT_TIME_DISTORTION = 100;\n\tvar DEFAULT_MAX_PROGRESS_STACK = 10;\n\t\n\t/**\n\t * A swipe is defined as input(s) moving in the same direction in an relatively\n\t * increasing velocity and leaving the screen at some point before it drops\n\t * below it's escape velocity.\n\t * @class Swipe\n\t */\n\t\n\tvar Swipe = function (_Gesture) {\n\t _inherits(Swipe, _Gesture);\n\t\n\t /**\n\t * Constructor function for the Swipe class.\n\t * @param {Object} [options] - The options object.\n\t * @param {Number} [options.numInputs] - The number of inputs to trigger a\n\t * Swipe can be variable, and the maximum number being a factor of the browser\n\t * move and current move events.\n\t * @param {Number} [options.maxRestTime] - The maximum resting time a point\n\t * has between it's last\n\t * @param {Number} [options.escapeVelocity] - The minimum velocity the input\n\t * has to be at to emit a swipe.\n\t * @param {Number} [options.timeDistortion] - (EXPERIMENTAL) A value of time\n\t * in milliseconds to distort between events.\n\t * @param {Number} [options.maxProgressStack] - (EXPERIMENTAL)The maximum\n\t * amount of move events to keep\n\t * track of for a swipe.\n\t */\n\t function Swipe(options) {\n\t _classCallCheck(this, Swipe);\n\t\n\t /**\n\t * The type of the Gesture\n\t * @type {String}\n\t */\n\t var _this = _possibleConstructorReturn(this, (Swipe.__proto__ || Object.getPrototypeOf(Swipe)).call(this));\n\t\n\t _this.type = 'swipe';\n\t\n\t /**\n\t * The number of inputs to trigger a Swipe can be variable,\n\t * and the maximum number being a factor of the browser.\n\t * @type {Number}\n\t */\n\t _this.numInputs = options && options.numInputs ? options.numInputs : DEFAULT_INPUTS;\n\t\n\t /**\n\t * The maximum resting time a point has between it's last move and\n\t * current move events.\n\t * @type {Number}\n\t */\n\t _this.maxRestTime = options && options.maxRestTime ? options.maxRestTime : DEFAULT_MAX_REST_TIME;\n\t\n\t /**\n\t * The minimum velocity the input has to be at to emit a swipe.\n\t * This is useful for determining the difference between\n\t * a swipe and a pan gesture.\n\t * @type {number}\n\t */\n\t _this.escapeVelocity = options && options.escapeVelocity ? options.escapeVelocity : DEFAULT_ESCAPE_VELOCITY;\n\t\n\t /**\n\t * (EXPERIMENTAL) A value of time in milliseconds to distort between events.\n\t * Browsers do not accurately measure time with the Date constructor in\n\t * milliseconds, so consecutive events sometimes display the same timestamp\n\t * but different x/y coordinates. This will distort a previous time\n\t * in such cases by the timeDistortion's value.\n\t * @type {number}\n\t */\n\t _this.timeDistortion = options && options.timeDistortion ? options.timeDistortion : DEFAULT_TIME_DISTORTION;\n\t\n\t /**\n\t * (EXPERIMENTAL) The maximum amount of move events to keep track of for a\n\t * swipe. This helps give a more accurate estimate of the user's velocity.\n\t * @type {number}\n\t */\n\t _this.maxProgressStack = options && options.maxProgressStack ? options.maxProgressStack : DEFAULT_MAX_PROGRESS_STACK;\n\t return _this;\n\t }\n\t\n\t /**\n\t * Event hook for the move of a gesture. Captures an input's x/y coordinates\n\t * and the time of it's event on a stack.\n\t * @param {Array} inputs - The array of Inputs on the screen.\n\t * @param {Object} state - The state object of the current region.\n\t * @param {Element} element - The element associated to the binding.\n\t * @return {null} - Swipe does not emit from a move.\n\t */\n\t\n\t\n\t _createClass(Swipe, [{\n\t key: 'move',\n\t value: function move(inputs, state, element) {\n\t if (this.numInputs === inputs.length) {\n\t for (var i = 0; i < inputs.length; i++) {\n\t var progress = inputs[i].getGestureProgress(this.getId());\n\t if (!progress.moves) {\n\t progress.moves = [];\n\t }\n\t\n\t progress.moves.push({\n\t time: new Date().getTime(),\n\t x: inputs[i].current.x,\n\t y: inputs[i].current.y\n\t });\n\t\n\t if (progress.length > this.maxProgressStack) {\n\t progress.moves.shift();\n\t }\n\t }\n\t }\n\t\n\t return null;\n\t }\n\t\n\t /* move*/\n\t\n\t /**\n\t * Determines if the input's history validates a swipe motion.\n\t * Determines if it did not come to a complete stop (maxRestTime), and if it\n\t * had enough of a velocity to be considered (ESCAPE_VELOCITY).\n\t * @param {Array} inputs - The array of Inputs on the screen\n\t * @return {null|Object} - null if the gesture is not to be emitted,\n\t * Object with information otherwise.\n\t */\n\t\n\t }, {\n\t key: 'end',\n\t value: function end(inputs) {\n\t if (this.numInputs === inputs.length) {\n\t var output = {\n\t data: []\n\t };\n\t\n\t for (var i = 0; i < inputs.length; i++) {\n\t // Determine if all input events are on the 'end' event.\n\t if (inputs[i].current.type !== 'end') {\n\t return;\n\t }\n\t\n\t var progress = inputs[i].getGestureProgress(this.getId());\n\t if (progress.moves && progress.moves.length > 2) {\n\t // CHECK : Return if the input has not moved in maxRestTime ms.\n\t\n\t var currentMove = progress.moves.pop();\n\t if (new Date().getTime() - currentMove.time > this.maxRestTime) {\n\t return null;\n\t }\n\t\n\t var lastMove = void 0;\n\t var index = progress.moves.length - 1;\n\t\n\t /* Date is unreliable, so we retrieve the last move event where\n\t the time is not the same. */\n\t while (index !== -1) {\n\t if (progress.moves[index].time !== currentMove.time) {\n\t lastMove = progress.moves[index];\n\t break;\n\t }\n\t\n\t index--;\n\t }\n\t\n\t /* If the date is REALLY unreliable, we apply a time distortion\n\t to the last event.\n\t */\n\t if (!lastMove) {\n\t lastMove = progress.moves.pop();\n\t lastMove.time += this.timeDistortion;\n\t }\n\t\n\t var velocity = _util2.default.getVelocity(lastMove.x, lastMove.y, lastMove.time, currentMove.x, currentMove.y, currentMove.time);\n\t\n\t output.data[i] = {\n\t velocity: velocity,\n\t currentDirection: _util2.default.getAngle(lastMove.x, lastMove.y, currentMove.x, currentMove.y)\n\t };\n\t }\n\t }\n\t\n\t for (var i = 0; i < output.data.length; i++) {\n\t if (velocity < this.escapeVelocity) {\n\t return null;\n\t }\n\t }\n\t\n\t if (output.data.length > 0) {\n\t return output;\n\t }\n\t }\n\t\n\t return null;\n\t }\n\t\n\t /* end*/\n\t\n\t }]);\n\t\n\t return Swipe;\n\t}(_Gesture3.default);\n\t\n\texports.default = Swipe;\n\n/***/ },\n/* 16 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _Gesture2 = __webpack_require__(4);\n\t\n\tvar _Gesture3 = _interopRequireDefault(_Gesture2);\n\t\n\tvar _util = __webpack_require__(8);\n\t\n\tvar _util2 = _interopRequireDefault(_util);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /**\n\t * @file Tap.js\n\t * Contains the Tap class\n\t */\n\t\n\tvar DEFAULT_MIN_DELAY_MS = 0;\n\tvar DEFAULT_MAX_DELAY_MS = 300;\n\tvar DEFAULT_INPUTS = 1;\n\tvar DEFAULT_MOVE_PX_TOLERANCE = 10;\n\t\n\t/**\n\t * A Tap is defined as a touchstart to touchend event in quick succession.\n\t * @class Tap\n\t */\n\t\n\tvar Tap = function (_Gesture) {\n\t _inherits(Tap, _Gesture);\n\t\n\t /**\n\t * Constructor function for the Tap class.\n\t * @param {Object} [options] - The options object.\n\t * @param {Number} [options.minDelay=0] - The minimum delay between a\n\t * touchstart and touchend can be configured in milliseconds.\n\t * @param {Number} [options.maxDelay=300] - The maximum delay between a\n\t * touchstart and touchend can be configured in milliseconds.\n\t * @param {Number} [options.numInputs=1] - Number of inputs for Tap gesture.\n\t * @param {Number} [options.tolerance=10] - The tolerance in pixels\n\t * a user can move.\n\t */\n\t function Tap(options) {\n\t _classCallCheck(this, Tap);\n\t\n\t /**\n\t * The type of the Gesture.\n\t * @type {String}\n\t */\n\t var _this = _possibleConstructorReturn(this, (Tap.__proto__ || Object.getPrototypeOf(Tap)).call(this));\n\t\n\t _this.type = 'tap';\n\t\n\t /**\n\t * The minimum amount between a touchstart and a touchend can be configured\n\t * in milliseconds. The minimum delay starts to count down when the expected\n\t * number of inputs are on the screen, and ends when ALL inputs are off the\n\t * screen.\n\t * @type {Number}\n\t */\n\t _this.minDelay = options && options.minDelay ? options.minDelay : DEFAULT_MIN_DELAY_MS;\n\t\n\t /**\n\t * The maximum delay between a touchstart and touchend can be configured in\n\t * milliseconds. The maximum delay starts to count down when the expected\n\t * number of inputs are on the screen, and ends when ALL inputs are off the\n\t * screen.\n\t * @type {Number}\n\t */\n\t _this.maxDelay = options && options.maxDelay ? options.maxDelay : DEFAULT_MAX_DELAY_MS;\n\t\n\t /**\n\t * The number of inputs to trigger a Tap can be variable,\n\t * and the maximum number being a factor of the browser.\n\t * @type {Number}\n\t */\n\t _this.numInputs = options && options.numInputs ? options.numInputs : DEFAULT_INPUTS;\n\t\n\t /**\n\t * A move tolerance in pixels allows some slop between a user's start to end\n\t * events. This allows the Tap gesture to be triggered more easily.\n\t * @type {number}\n\t */\n\t _this.tolerance = options && options.tolerance ? options.tolerance : DEFAULT_MOVE_PX_TOLERANCE;\n\t return _this;\n\t }\n\t\n\t /* constructor*/\n\t\n\t /**\n\t * Event hook for the start of a gesture. Keeps track of when the inputs\n\t * trigger the start event.\n\t * @param {Array} inputs - The array of Inputs on the screen.\n\t * @return {null} - Tap does not trigger on a start event.\n\t */\n\t\n\t\n\t _createClass(Tap, [{\n\t key: 'start',\n\t value: function start(inputs) {\n\t var _this2 = this;\n\t\n\t if (inputs.length === this.numInputs) {\n\t inputs.forEach(function (input) {\n\t var progress = input.getGestureProgress(_this2.type);\n\t progress.start = new Date().getTime();\n\t });\n\t }\n\t\n\t return null;\n\t }\n\t\n\t /* start*/\n\t\n\t /**\n\t * Event hook for the move of a gesture. The Tap event reaches here if the\n\t * user starts to move their input before an 'end' event is reached.\n\t * @param {Array} inputs - The array of Inputs on the screen.\n\t * @param {Object} state - The state object of the current region.\n\t * @param {Element} element - The element associated to the binding.\n\t * @return {null} - Tap does not trigger on a move event.\n\t */\n\t\n\t }, {\n\t key: 'move',\n\t value: function move(inputs, state, element) {\n\t var _this3 = this;\n\t\n\t for (var i = 0; i < inputs.length; i++) {\n\t if (inputs[i].getCurrentEventType() === 'move') {\n\t var current = inputs[i].current;\n\t var previous = inputs[i].previous;\n\t if (!_util2.default.isWithin(current.x, current.y, previous.x, previous.y, this.tolerance)) {\n\t var _ret = function () {\n\t var type = _this3.type;\n\t inputs.forEach(function (input) {\n\t input.resetProgress(type);\n\t });\n\t\n\t return {\n\t v: null\n\t };\n\t }();\n\t\n\t if ((typeof _ret === 'undefined' ? 'undefined' : _typeof(_ret)) === \"object\") return _ret.v;\n\t }\n\t }\n\t }\n\t\n\t return null;\n\t }\n\t\n\t /* move*/\n\t\n\t /**\n\t * Event hook for the end of a gesture.\n\t * Determines if this the tap event can be fired if the delay and tolerance\n\t * constraints are met. Also waits for all of the inputs to be off the screen\n\t * before determining if the gesture is triggered.\n\t * @param {Array} inputs - The array of Inputs on the screen.\n\t * @return {null|Object} - null if the gesture is not to be emitted,\n\t * Object with information otherwise. Returns the interval time between start\n\t * and end events.\n\t */\n\t\n\t }, {\n\t key: 'end',\n\t value: function end(inputs) {\n\t var _this4 = this;\n\t\n\t if (inputs.length !== this.numInputs) {\n\t return null;\n\t }\n\t\n\t var startTime = Number.MAX_VALUE;\n\t for (var i = 0; i < inputs.length; i++) {\n\t if (inputs[i].getCurrentEventType() !== 'end') {\n\t return null;\n\t }\n\t\n\t var progress = inputs[i].getGestureProgress(this.type);\n\t if (!progress.start) {\n\t return null;\n\t }\n\t\n\t // Find the most recent input's startTime\n\t if (progress.start < startTime) {\n\t startTime = progress.start;\n\t }\n\t }\n\t\n\t var interval = new Date().getTime() - startTime;\n\t if (this.minDelay <= interval && this.maxDelay >= interval) {\n\t return {\n\t interval: interval\n\t };\n\t } else {\n\t var _ret2 = function () {\n\t var type = _this4.type;\n\t inputs.forEach(function (input) {\n\t input.resetProgress(type);\n\t });\n\t\n\t return {\n\t v: null\n\t };\n\t }();\n\t\n\t if ((typeof _ret2 === 'undefined' ? 'undefined' : _typeof(_ret2)) === \"object\") return _ret2.v;\n\t }\n\t }\n\t\n\t /* end*/\n\t\n\t }]);\n\t\n\t return Tap;\n\t}(_Gesture3.default);\n\t\n\texports.default = Tap;\n\n/***/ },\n/* 17 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\t/**\n\t * @file Binding.js\n\t */\n\t\n\t/**\n\t * Responsible for creating a binding between an element and a gesture.\n\t * @class Binding\n\t */\n\tvar Binding =\n\t/**\n\t * Constructor function for the Binding class.\n\t * @param {Element} element - The element to associate the gesture to.\n\t * @param {Gesture} gesture - A instance of the Gesture type.\n\t * @param {Function} handler - The function handler to execute when a\n\t * gesture is recognized\n\t * on the associated element.\n\t * @param {Boolean} [capture=false] - A boolean signifying if the event is\n\t * to be emitted during\n\t * the capture or bubble phase.\n\t * @param {Boolean} [bindOnce=false] - A boolean flag\n\t * used for the bindOnce syntax.\n\t */\n\tfunction Binding(element, gesture, handler, capture, bindOnce) {\n\t _classCallCheck(this, Binding);\n\t\n\t /**\n\t * The element to associate the gesture to.\n\t * @type {Element}\n\t */\n\t this.element = element;\n\t /**\n\t * A instance of the Gesture type.\n\t * @type {Gesture}\n\t */\n\t this.gesture = gesture;\n\t /**\n\t * The function handler to execute when a gesture is\n\t * recognized on the associated element.\n\t * @type {Function}\n\t */\n\t this.handler = handler;\n\t\n\t /**\n\t * A boolean signifying if the event is to be\n\t * emitted during the capture or bubble phase.\n\t * @type {Boolean}\n\t */\n\t this.capture = typeof capture !== 'undefined' ? capture : false;\n\t\n\t /**\n\t * A boolean flag used for the bindOnce syntax.\n\t * @type {Boolean}\n\t */\n\t this.bindOnce = typeof bindOnce !== 'undefined' ? bindOnce : false;\n\t};\n\t\n\texports.default = Binding;\n\n/***/ },\n/* 18 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /**\n\t * @file Input.js\n\t */\n\t\n\tvar _ZingEvent = __webpack_require__(19);\n\t\n\tvar _ZingEvent2 = _interopRequireDefault(_ZingEvent);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\t/**\n\t * Tracks a single input and contains information about the\n\t * current, previous, and initial events.\n\t * Contains the progress of each Input and it's associated gestures.\n\t * @class Input\n\t */\n\tvar Input = function () {\n\t\n\t /**\n\t * Constructor function for the Input class.\n\t * @param {Event} event - The Event object from the window\n\t * @param {Number} [identifier=0] - The identifier for each input event\n\t * (taken from event.changedTouches)\n\t */\n\t function Input(event, identifier) {\n\t _classCallCheck(this, Input);\n\t\n\t var currentEvent = new _ZingEvent2.default(event, identifier);\n\t\n\t /**\n\t * Holds the initial event object. A touchstart/mousedown event.\n\t * @type {ZingEvent}\n\t */\n\t this.initial = currentEvent;\n\t\n\t /**\n\t * Holds the most current event for this Input, disregarding any other past,\n\t * current, and future events that other Inputs participate in.\n\t * e.g. This event ended in an 'end' event, but another Input is still\n\t * participating in events -- this will not be updated in such cases.\n\t * @type {ZingEvent}\n\t */\n\t this.current = currentEvent;\n\t\n\t /**\n\t * Holds the previous event that took place.\n\t * @type {ZingEvent}\n\t */\n\t this.previous = currentEvent;\n\t\n\t /**\n\t * Refers to the event.touches index, or 0 if a simple mouse event occurred.\n\t * @type {Number}\n\t */\n\t this.identifier = typeof identifier !== 'undefined' ? identifier : 0;\n\t\n\t /**\n\t * Stores internal state between events for\n\t * each gesture based off of the gesture's id.\n\t * @type {Object}\n\t */\n\t this.progress = {};\n\t }\n\t\n\t /**\n\t * Receives an input, updates the internal state of what the input has done.\n\t * @param {Event} event - The event object to wrap with a ZingEvent.\n\t * @param {Number} touchIdentifier - The index of inputs, from event.touches\n\t */\n\t\n\t\n\t _createClass(Input, [{\n\t key: 'update',\n\t value: function update(event, touchIdentifier) {\n\t this.previous = this.current;\n\t this.current = new _ZingEvent2.default(event, touchIdentifier);\n\t }\n\t\n\t /**\n\t * Returns the progress of the specified gesture.\n\t * @param {String} id - The identifier for each unique Gesture's progress.\n\t * @return {Object} - The progress of the gesture.\n\t * Creates an empty object if no progress has begun.\n\t */\n\t\n\t }, {\n\t key: 'getGestureProgress',\n\t value: function getGestureProgress(id) {\n\t if (!this.progress[id]) {\n\t this.progress[id] = {};\n\t }\n\t return this.progress[id];\n\t }\n\t\n\t /**\n\t * Returns the normalized current Event's type.\n\t * @return {String} The current event's type ( start | move | end )\n\t */\n\t\n\t }, {\n\t key: 'getCurrentEventType',\n\t value: function getCurrentEventType() {\n\t return this.current.type;\n\t }\n\t\n\t /**\n\t * Resets a progress/state object of the specified gesture.\n\t * @param {String} id - The identifier of the specified gesture\n\t */\n\t\n\t }, {\n\t key: 'resetProgress',\n\t value: function resetProgress(id) {\n\t this.progress[id] = {};\n\t }\n\t }]);\n\t\n\t return Input;\n\t}();\n\t\n\texports.default = Input;\n\n/***/ },\n/* 19 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _util = __webpack_require__(8);\n\t\n\tvar _util2 = _interopRequireDefault(_util);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } } /**\n\t * @file ZingEvent.js\n\t * Contains logic for ZingEvents\n\t */\n\t\n\tvar INITIAL_COORDINATE = 0;\n\t/**\n\t * An event wrapper that normalizes events across browsers and input devices\n\t * @class ZingEvent\n\t */\n\t\n\tvar ZingEvent =\n\t/**\n\t * @constructor\n\t * @param {Event} event - The event object being wrapped.\n\t * @param {Array} event.touches - The number of touches on\n\t * a screen (mobile only).\n\t * @param {Object} event.changedTouches - The TouchList representing\n\t * points that participated in the event.\n\t * @param {Number} touchIdentifier - The index of touch if applicable\n\t */\n\tfunction ZingEvent(event, touchIdentifier) {\n\t _classCallCheck(this, ZingEvent);\n\t\n\t /**\n\t * The original event object.\n\t * @type {Event}\n\t */\n\t this.originalEvent = event;\n\t\n\t /**\n\t * The type of event or null if it is an event not predetermined.\n\t * @see util.normalizeEvent\n\t * @type {String | null}\n\t */\n\t this.type = _util2.default.normalizeEvent(event.type);\n\t\n\t /**\n\t * The X coordinate for the event, based off of the client.\n\t * @type {number}\n\t */\n\t this.x = INITIAL_COORDINATE;\n\t\n\t /**\n\t * The Y coordinate for the event, based off of the client.\n\t * @type {number}\n\t */\n\t this.y = INITIAL_COORDINATE;\n\t\n\t var eventObj = void 0;\n\t if (event.touches && event.changedTouches) {\n\t for (var i = 0; i < event.changedTouches.length; i++) {\n\t if (event.changedTouches[i].identifier === touchIdentifier) {\n\t eventObj = event.changedTouches[i];\n\t break;\n\t }\n\t }\n\t } else {\n\t eventObj = event;\n\t }\n\t\n\t this.x = this.clientX = eventObj.clientX;\n\t this.y = this.clientY = eventObj.clientY;\n\t\n\t this.pageX = eventObj.pageX;\n\t this.pageY = eventObj.pageY;\n\t\n\t this.screenX = eventObj.screenX;\n\t this.screenY = eventObj.screenY;\n\t};\n\t\n\texports.default = ZingEvent;\n\n/***/ }\n/******/ ]);\n\n\n// WEBPACK FOOTER //\n// ./dist/zingtouch.js"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 4b504d245c921ba2cc18","/**\n * @file main.js\n * Main file to setup event listeners on the document,\n * and to expose the ZingTouch object\n */\n\nimport ZingTouch from './../ZingTouch.js';\nwindow.ZingTouch = ZingTouch;\n\n\n\n// WEBPACK FOOTER //\n// ./src/core/main.js","/**\n * @file ZingTouch.js\n * Main object containing API methods and Gesture constructors\n */\n\nimport Region from './core/classes/Region.js';\nimport Gesture from './gestures/Gesture.js';\nimport Expand from './gestures/Expand.js';\nimport Pan from './gestures/Pan.js';\nimport Pinch from './gestures/Pinch.js';\nimport Rotate from './gestures/Rotate.js';\nimport Swipe from './gestures/Swipe.js';\nimport Tap from './gestures/Tap.js';\n\n/**\n * The global API interface for ZingTouch. Contains a constructor for the\n * Region Object, and constructors for each predefined Gesture.\n * @type {Object}\n * @namespace ZingTouch\n */\nlet ZingTouch = {\n _regions: [],\n\n // Constructors\n Gesture: Gesture,\n Expand: Expand,\n Pan: Pan,\n Pinch: Pinch,\n Rotate: Rotate,\n Swipe: Swipe,\n Tap: Tap,\n Region: function(element, capture, preventDefault) {\n let id = ZingTouch._regions.length;\n let region = new Region(element, capture, preventDefault, id);\n ZingTouch._regions.push(region);\n return region;\n },\n};\n\nexport default ZingTouch;\n\n\n\n// WEBPACK FOOTER //\n// ./src/ZingTouch.js","/**\n * @file Region.js\n */\n\nimport Binder from './Binder.js';\nimport Gesture from './../../gestures/Gesture.js';\nimport arbiter from './../arbiter.js';\nimport State from './State.js';\n\n/**\n * Allows the user to specify a region to capture all events to feed ZingTouch\n * into. This can be as narrow as the element itself, or as big as the document\n * itself. The more specific an area, the better performant the overall\n * application will perform. Contains API methods to bind/unbind specific\n * elements to corresponding gestures. Also contains the ability to\n * register/unregister new gestures.\n * @class Region\n */\nclass Region {\n\n /**\n * Constructor function for the Region class.\n * @param {Element} element - The element to capture all\n * window events in that region to feed into ZingTouch.\n * @param {boolean} [capture=false] - Whether the region listens for\n * captures or bubbles.\n * @param {boolean} [preventDefault=true] - Whether the default browser\n * functionality should be disabled;\n * @param {Number} id - The id of the region, assigned by the ZingTouch object\n */\n constructor(element, capture, preventDefault, id) {\n /**\n * The identifier for the Region. This is assigned by the ZingTouch object\n * and is used to hash gesture id for uniqueness.\n * @type {Number}\n */\n this.id = id;\n\n /**\n * The element being bound to.\n * @type {Element}\n */\n this.element = element;\n\n /**\n * Whether the region listens for captures or bubbles.\n * @type {boolean}\n */\n this.capture = (typeof capture !== 'undefined') ? capture : false;\n\n /**\n * Boolean to disable browser functionality such as scrolling and zooming\n * over the region\n * @type {boolean}\n */\n this.preventDefault = (typeof preventDefault !== 'undefined') ?\n preventDefault : true;\n\n /**\n * The internal state object for a Region.\n * Keeps track of registered gestures, inputs, and events.\n * @type {State}\n */\n this.state = new State(id);\n\n let eventNames = [];\n if (window.PointerEvent) {\n eventNames = [\n 'pointerdown',\n 'pointermove',\n 'pointerup',\n ];\n } else {\n eventNames = [\n 'mousedown',\n 'mousemove',\n 'mouseup',\n 'touchstart',\n 'touchmove',\n 'touchend',\n ];\n }\n\n // Bind detected browser events to the region element.\n eventNames.map((name) => {\n element.addEventListener(name, (e) => {\n arbiter(e, this);\n }, this.capture);\n });\n }\n\n /**\n * Bind an element to a registered/unregistered gesture with\n * multiple function signatures.\n * @example\n * bind(element) - chainable\n * @example\n * bind(element, gesture, handler, [capture])\n * @param {Element} element - The element object.\n * @param {String|Object} [gesture] - Gesture key, or a Gesture object.\n * @param {Function} [handler] - The function to execute when an event is\n * emitted.\n * @param {Boolean} [capture] - capture/bubble\n * @param {Boolean} [bindOnce = false] - Option to bind once and\n * only emit the event once.\n * @return {Object} - a chainable object that has the same function as bind.\n */\n bind(element, gesture, handler, capture, bindOnce) {\n if (!element || (element && !element.tagName)) {\n throw 'Bind must contain an element';\n }\n\n bindOnce = (typeof bindOnce !== 'undefined') ? bindOnce : false;\n if (!gesture) {\n return new Binder(element, bindOnce, this.state);\n } else {\n this.state.addBinding(element, gesture, handler, capture, bindOnce);\n }\n }\n\n /**\n * Bind an element and sets up actions to remove the binding once\n * it has been emitted for the first time.\n * 1. bind(element) - chainable\n * 2. bind(element, gesture, handler, [capture])\n * @param {Element} element - The element object.\n * @param {String|Object} gesture - Gesture key, or a Gesture object.\n * @param {Function} handler - The function to execute when an\n * event is emitted.\n * @param {Boolean} capture - capture/bubble\n * @return {Object} - a chainable object that has the same function as bind.\n */\n bindOnce(element, gesture, handler, capture) {\n this.bind(element, gesture, handler, capture, true);\n }\n\n /**\n * Unbinds an element from either the specified gesture\n * or all if no element is specified.\n * @param {Element} element -The element to remove.\n * @param {String | Object} [gesture] - A String representing the gesture,\n * or the actual object being used.\n * @return {Array} - An array of Bindings that were unbound to the element;\n */\n unbind(element, gesture) {\n let bindings = this.state.retrieveBindingsByElement(element);\n let unbound = [];\n\n bindings.forEach((binding) => {\n if (gesture) {\n if (typeof gesture === 'string' &&\n this.state.registeredGestures[gesture]) {\n let registeredGesture = this.state.registeredGestures[gesture];\n if (registeredGesture.id === binding.gesture.id) {\n element.removeEventListener(\n binding.gesture.getId(),\n binding.handler, binding.capture);\n unbound.push(binding);\n }\n }\n } else {\n element.removeEventListener(\n binding.gesture.getId(),\n binding.handler,\n binding.capture);\n unbound.push(binding);\n }\n });\n\n return unbound;\n }\n\n /* unbind*/\n\n /**\n * Registers a new gesture with an assigned key\n * @param {String} key - The key used to register an element to that gesture\n * @param {Gesture} gesture - A gesture object\n */\n register(key, gesture) {\n if (typeof key !== 'string') {\n throw new Error('Parameter key is an invalid string');\n }\n\n if (!gesture instanceof Gesture) {\n throw new Error('Parameter gesture is an invalid Gesture object');\n }\n\n gesture.setType(key);\n this.state.registerGesture(gesture, key);\n }\n\n /* register*/\n\n /**\n * Un-registers a gesture from the Region's state such that\n * it is no longer emittable.\n * Unbinds all events that were registered with the type.\n * @param {String|Object} key - Gesture key that was used to\n * register the object\n * @return {Object} - The Gesture object that was unregistered\n * or null if it could not be found.\n */\n unregister(key) {\n this.state.bindings.forEach((binding) => {\n if (binding.gesture.getType() === key) {\n binding.element.removeEventListener(binding.gesture.getId(),\n binding.handler, binding.capture);\n }\n });\n\n let registeredGesture = this.state.registeredGestures[key];\n delete this.state.registeredGestures[key];\n return registeredGesture;\n }\n}\n\nexport default Region;\n\n\n\n// WEBPACK FOOTER //\n// ./src/core/classes/Region.js","/**\n * @file Binder.js\n */\n\n/**\n * A chainable object that contains a single element to be bound upon.\n * Called from ZingTouch.bind(), and is used to chain over gesture callbacks.\n * @class\n */\nclass Binder {\n /**\n * Constructor function for the Binder class.\n * @param {Element} element - The element to bind gestures to.\n * @param {Boolean} bindOnce - Option to bind once and only emit\n * the event once.\n * @param {Object} state - The state of the Region that is being bound to.\n * @return {Object} - Returns 'this' to be chained over and over again.\n */\n constructor(element, bindOnce, state) {\n /**\n * The element to bind gestures to.\n * @type {Element}\n */\n this.element = element;\n\n Object.keys(state.registeredGestures).forEach((key) => {\n this[key] = (handler, capture) => {\n state.addBinding(this.element, key, handler, capture, bindOnce);\n return this;\n };\n });\n }\n\n}\n\nexport default Binder;\n\n\n\n// WEBPACK FOOTER //\n// ./src/core/classes/Binder.js","/**\n * @file Gesture.js\n * Contains the Gesture class\n */\n\n/**\n * The Gesture class that all gestures inherit from.\n */\nclass Gesture {\n /**\n * Constructor function for the Gesture class.\n * @class Gesture\n */\n constructor() {\n /**\n * The generic string type of gesture ('expand'|'pan'|'pinch'|\n * 'rotate'|'swipe'|'tap').\n * @type {String}\n */\n this.type = null;\n\n /**\n * The unique identifier for each gesture determined at bind time by the\n * state object. This allows for distinctions across instance variables of\n * Gestures that are created on the fly (e.g. Tap-1, Tap-2, etc).\n * @type {String|null}\n */\n this.id = null;\n }\n\n /**\n * Set the type of the gesture to be called during an event\n * @param {String} type - The unique identifier of the gesture being created.\n */\n setType(type) {\n this.type = type;\n }\n\n /**\n * getType() - Returns the generic type of the gesture\n * @return {String} - The type of gesture\n */\n getType() {\n return this.type;\n }\n\n /**\n * Set the id of the gesture to be called during an event\n * @param {String} id - The unique identifier of the gesture being created.\n */\n setId(id) {\n this.id = id;\n }\n\n /**\n * Return the id of the event. If the id does not exist, return the type.\n * @return {String}\n */\n getId() {\n return (this.id !== null) ? this.id : this.type;\n }\n\n /**\n * Updates internal properties with new ones, only if the properties exist.\n * @param {Object} object\n */\n update(object) {\n for (let key in object) {\n if (this[key]) {\n this[key] = object[key];\n }\n }\n }\n\n /**\n * start() - Event hook for the start of a gesture\n * @param {Array} inputs - The array of Inputs on the screen\n * @return {null|Object} - Default of null\n */\n start(inputs) {\n return null;\n }\n\n /**\n * move() - Event hook for the move of a gesture\n * @param {Array} inputs - The array of Inputs on the screen\n * @param {Object} state - The state object of the current region.\n * @param {Element} element - The element associated to the binding.\n * @return {null|Object} - Default of null\n */\n move(inputs, state, element) {\n return null;\n }\n\n /**\n * end() - Event hook for the move of a gesture\n * @param {Array} inputs - The array of Inputs on the screen\n * @return {null|Object} - Default of null\n */\n end(inputs) {\n return null;\n }\n\n}\n\nexport default Gesture;\n\n\n\n// WEBPACK FOOTER //\n// ./src/gestures/Gesture.js","/**\n * @file arbiter.js\n * Contains logic for the dispatcher\n */\n\nimport dispatcher from './dispatcher.js';\nimport interpreter from './interpreter.js';\nimport util from './util.js';\n\n/**\n * Function that handles event flow, negotiating with the interpreter,\n * and dispatcher.\n * 1. Receiving all touch events in the window.\n * 2. Determining which gestures are linked to the target element.\n * 3. Negotiating with the Interpreter what event should occur.\n * 4. Sending events to the dispatcher to emit events to the target.\n * @param {Event} event - The event emitted from the window object.\n * @param {Object} region - The region object of the current listener.\n */\nfunction arbiter(event, region) {\n const state = region.state;\n\n /*\n Return if a gesture is not in progress and won't be. Also catches the case\n where a previous event is in a partial state (2 finger pan, waits for both\n inputs to reach touchend)\n */\n if (state.inputs.length === 0 && util.normalizeEvent(event.type) !==\n 'start') {\n return;\n }\n\n /*\n Check for 'stale' or events that lost focus\n (e.g. a pan goes off screen/off region.)\n Does not affect mobile devices.\n */\n if (typeof event.buttons !== 'undefined' &&\n util.normalizeEvent(event.type) !== 'end' &&\n event.buttons === 0) {\n state.resetInputs();\n return;\n }\n\n // Update the state with the new events. If the event is stopped, return;\n if (!state.updateInputs(event, region.element)) {\n return;\n }\n\n // Retrieve the initial target from any one of the inputs\n const bindings = state.retrieveBindingsByInitialPos();\n if (bindings.length > 0) {\n if (region.preventDefault) {\n util.setMSPreventDefault(region.element);\n event.preventDefault ? event.preventDefault():(event.returnValue = false);\n } else {\n util.removeMSPreventDefault(region.element);\n }\n\n const toBeDispatched = {};\n const gestures = interpreter(bindings, event, state);\n\n /* Determine the deepest path index to emit the event\n from, to avoid duplicate events being fired. */\n\n gestures.forEach((gesture) => {\n const id = gesture.binding.gesture.id;\n if (toBeDispatched[id]) {\n const path = util.getPropagationPath(event);\n if (util.getPathIndex(path, gesture.binding.element) <\n util.getPathIndex(path, toBeDispatched[id].binding.element)) {\n toBeDispatched[id] = gesture;\n }\n } else {\n toBeDispatched[id] = gesture;\n }\n });\n\n Object.keys(toBeDispatched).forEach((index) => {\n const gesture = toBeDispatched[index];\n dispatcher(gesture.binding, gesture.data, gesture.events);\n });\n }\n\n let endCount = 0;\n state.inputs.forEach((input) => {\n if (input.getCurrentEventType() === 'end') {\n endCount++;\n }\n });\n\n if (endCount === state.inputs.length) {\n state.resetInputs();\n }\n}\n\nexport default arbiter;\n\n\n\n// WEBPACK FOOTER //\n// ./src/core/arbiter.js","/**\n * @file dispatcher.js\n * Contains logic for the dispatcher\n */\n\n/**\n * Emits data at the target element if available, and bubbles up from\n * the target to the parent until the document has been reached.\n * Called from the arbiter.\n * @param {Binding} binding - An object of type Binding\n * @param {Object} data - The metadata computed by the gesture being emitted.\n * @param {Array} events - An array of ZingEvents\n * corresponding to the inputs on the screen.\n */\nfunction dispatcher(binding, data, events) {\n data.events = events;\n\n const newEvent = new CustomEvent(binding.gesture.getId(), {\n detail: data,\n bubbles: true,\n cancelable: true,\n });\n emitEvent(binding.element, newEvent, binding);\n}\n\n/**\n * Emits the new event. Unbinds the event if the event was registered\n * at bindOnce.\n * @param {Element} target - Element object to emit the event to.\n * @param {Event} event - The CustomEvent to emit.\n * @param {Binding} binding - An object of type Binding\n */\nfunction emitEvent(target, event, binding) {\n target.dispatchEvent(event);\n if (binding.bindOnce) {\n ZingTouch.unbind(binding.element, binding.gesture.getType());\n }\n}\n\nexport default dispatcher;\n\n\n\n// WEBPACK FOOTER //\n// ./src/core/dispatcher.js","/**\n * @file interpreter.js\n * Contains logic for the interpreter\n */\n\nimport util from './util.js';\n\n/**\n * Receives an event and an array of Bindings (element -> gesture handler)\n * to determine what event will be emitted. Called from the arbiter.\n * @param {Array} bindings - An array containing Binding objects\n * that associate the element to an event handler.\n * @param {Object} event - The event emitted from the window.\n * @param {Object} state - The state object of the current listener.\n * @return {Object | null} - Returns an object containing a binding and\n * metadata, or null if a gesture will not be emitted.\n */\nfunction interpreter(bindings, event, state) {\n const evType = util.normalizeEvent(event.type);\n const candidates = [];\n bindings.forEach((binding) => {\n let result = binding.gesture[evType](state.inputs, state, binding.element);\n if (result) {\n const events = [];\n state.inputs.forEach((input) => {\n events.push(input.current);\n });\n\n candidates.push({\n binding: binding,\n data: result,\n events: events,\n });\n }\n });\n\n return candidates;\n}\n\nexport default interpreter;\n\n\n\n// WEBPACK FOOTER //\n// ./src/core/interpreter.js","/**\n * @file util.js\n * Various accessor and mutator functions to handle state and validation.\n */\n\nconst CIRCLE_DEGREES = 360;\nconst HALF_CIRCLE_DEGREES = 180;\n\n/**\n * Contains generic helper functions\n * @type {Object}\n * @namespace util\n */\nlet util = {\n\n /**\n * Normalizes window events to be either of type start, move, or end.\n * @param {String} type - The event type emitted by the browser\n * @return {null|String} - The normalized event, or null if it is an\n * event not predetermined.\n */\n normalizeEvent(type) {\n switch (type) {\n case 'mousedown' :\n case 'touchstart' :\n case 'pointerdown' :\n return 'start';\n case 'mousemove' :\n case 'touchmove' :\n case 'pointermove' :\n return 'move';\n case 'mouseup' :\n case 'touchend' :\n case 'pointerup' :\n return 'end';\n default :\n return null;\n }\n },\n /* normalizeEvent*/\n\n /**\n * Determines if the current and previous coordinates are within or\n * up to a certain tolerance.\n * @param {Number} currentX - Current event's x coordinate\n * @param {Number} currentY - Current event's y coordinate\n * @param {Number} previousX - Previous event's x coordinate\n * @param {Number} previousY - Previous event's y coordinate\n * @param {Number} tolerance - The tolerance in pixel value.\n * @return {boolean} - true if the current coordinates are\n * within the tolerance, false otherwise\n */\n isWithin(currentX, currentY, previousX, previousY, tolerance) {\n return ((Math.abs(currentY - previousY) <= tolerance) &&\n (Math.abs(currentX - previousX) <= tolerance));\n },\n /* isWithin*/\n\n /**\n * Calculates the distance between two points.\n * @param {Number} x0\n * @param {Number} x1\n * @param {Number} y0\n * @param {Number} y1\n * @return {number} The numerical value between two points\n */\n distanceBetweenTwoPoints(x0, x1, y0, y1) {\n let dist = (Math.sqrt(((x1 - x0) * (x1 - x0)) + ((y1 - y0) * (y1 - y0))));\n return Math.round(dist * 100) / 100;\n },\n\n /**\n * Calculates the midpoint coordinates between two points.\n * @param {Number} x0\n * @param {Number} x1\n * @param {Number} y0\n * @param {Number} y1\n * @return {Object} The coordinates of the midpoint.\n */\n getMidpoint(x0, x1, y0, y1) {\n return {\n x: ((x0 + x1) / 2),\n y: ((y0 + y1) / 2),\n };\n },\n /**\n * Calculates the angle between the projection and an origin point.\n * | (projectionX,projectionY)\n * | /°\n * | /\n * | /\n * | / θ\n * | /__________\n * ° (originX, originY)\n * @param {number} originX\n * @param {number} originY\n * @param {number} projectionX\n * @param {number} projectionY\n * @return {number} - Degree along the unit circle where the project lies\n */\n getAngle(originX, originY, projectionX, projectionY) {\n let angle = Math.atan2(projectionY - originY, projectionX - originX) *\n ((HALF_CIRCLE_DEGREES) / Math.PI);\n return CIRCLE_DEGREES - ((angle < 0) ? (CIRCLE_DEGREES + angle) : angle);\n },\n /**\n * Calculates the angular distance in degrees between two angles\n * along the unit circle\n * @param {number} start - The starting point in degrees\n * @param {number} end - The ending point in degrees\n * @return {number} The number of degrees between the\n * starting point and ending point. Negative degrees denote a clockwise\n * direction, and positive a counter-clockwise direction.\n */\n getAngularDistance(start, end) {\n let angle = (end - start) % CIRCLE_DEGREES;\n let sign = (angle < 0) ? 1 : -1;\n angle = Math.abs(angle);\n return (angle > HALF_CIRCLE_DEGREES) ?\n sign * (CIRCLE_DEGREES - angle) : sign * angle;\n },\n\n /**\n * Calculates the velocity of pixel/milliseconds between two points\n * @param {Number} startX\n * @param {Number} startY\n * @param {Number} startTime\n * @param {Number} endX\n * @param {Number} endY\n * @param {Number} endTime\n * @return {Number} velocity of px/time\n */\n getVelocity(startX, startY, startTime, endX, endY, endTime) {\n let distance = this.distanceBetweenTwoPoints(startX, endX, startY, endY);\n return (distance / (endTime - startTime));\n },\n\n /**\n * Returns the farthest right input\n * @param {Array} inputs\n * @return {Object}\n */\n getRightMostInput(inputs) {\n let rightMost = null;\n let distance = Number.MIN_VALUE;\n inputs.forEach((input) => {\n if (input.initial.x > distance) {\n rightMost = input;\n }\n });\n return rightMost;\n },\n\n /**\n * Determines is the value is an integer and not a floating point\n * @param {Mixed} value\n * @return {boolean}\n */\n isInteger(value) {\n return (typeof value === 'number') && (value % 1 === 0);\n },\n\n /**\n * Determines if the x,y position of the input is within then target.\n * @param {Number} x -clientX\n * @param {Number} y -clientY\n * @param {Element} target\n * @return {Boolean}\n */\n isInside(x, y, target) {\n const rect = target.getBoundingClientRect();\n return ((x > rect.left && x < rect.left + rect.width) &&\n (y > rect.top && y < rect.top + rect.height));\n },\n /**\n * Polyfill for event.propagationPath\n * @param {Event} event\n * @return {Array}\n */\n getPropagationPath(event) {\n if (event.path) {\n return event.path;\n } else {\n let path = [];\n let node = event.target;\n while (node != document) {\n path.push(node);\n node = node.parentNode;\n }\n\n return path;\n }\n },\n\n /**\n * Retrieve the index inside the path array\n * @param {Array} path\n * @param {Element} element\n * @return {Element}\n */\n getPathIndex(path, element) {\n let index = path.length;\n\n path.forEach((obj) => {\n if (obj === element) {\n index = i;\n }\n });\n\n return index;\n },\n\n setMSPreventDefault(element) {\n element.style['-ms-content-zooming'] = 'none';\n element.style['touch-action'] = 'none';\n },\n\n removeMSPreventDefault(element) {\n element.style['-ms-content-zooming'] = '';\n element.style['touch-action'] = '';\n },\n};\nexport default util;\n\n\n\n// WEBPACK FOOTER //\n// ./src/core/util.js","/**\n * @file State.js\n */\n\nimport Gesture from './../../gestures/Gesture.js';\nimport Expand from './../../gestures/Expand.js';\nimport Pan from './../../gestures/Pan.js';\nimport Pinch from './../../gestures/Pinch.js';\nimport Rotate from './../../gestures/Rotate.js';\nimport Swipe from './../../gestures/Swipe.js';\nimport Tap from './../../gestures/Tap.js';\nimport Binding from './Binding.js';\nimport Input from './Input.js';\nimport util from './../util.js';\n\nconst DEFAULT_MOUSE_ID = 0;\n\n/**\n * Creates an object related to a Region's state,\n * and contains helper methods to update and clean up different states.\n */\nclass State {\n\n /**\n * Constructor for the State class.\n * @param {String} regionId - The id the region this state is bound to.\n */\n constructor(regionId) {\n /**\n * The id for the region this state is bound to.\n * @type {String}\n */\n this.regionId = regionId;\n\n /**\n * An array of current and recently inactive\n * Input objects related to a gesture.\n * @type {Input}\n */\n this.inputs = [];\n\n /**\n * An array of Binding objects; The list of relations between elements,\n * their gestures, and the handlers.\n * @type {Binding}\n */\n this.bindings = [];\n\n /**\n * The number of gestures that have been registered with this state\n * @type {Number}\n */\n this.numGestures = 0;\n\n /**\n * A key/value map all the registered gestures for the listener.\n * Note: Can only have one gesture registered to one key.\n * @type {Object}\n */\n this.registeredGestures = {};\n\n this.registerGesture(new Expand(), 'expand');\n this.registerGesture(new Pan(), 'pan');\n this.registerGesture(new Rotate(), 'rotate');\n this.registerGesture(new Pinch(), 'pinch');\n this.registerGesture(new Swipe(), 'swipe');\n this.registerGesture(new Tap(), 'tap');\n }\n\n /**\n * Creates a new binding with the given element and gesture object.\n * If the gesture object provided is unregistered, it's reference\n * will be saved in as a binding to be later referenced.\n * @param {Element} element - The element the gesture is bound to.\n * @param {String|Object} gesture - Either a name of a registered gesture,\n * or an unregistered Gesture object.\n * @param {Function} handler - The function handler to be called\n * when the event is emitted. Used to bind/unbind.\n * @param {Boolean} capture - Whether the gesture is to be\n * detected in the capture of bubble phase. Used to bind/unbind.\n * @param {Boolean} bindOnce - Option to bind once and\n * only emit the event once.\n */\n addBinding(element, gesture, handler, capture, bindOnce) {\n let boundGesture;\n\n // Error type checking.\n if (element && typeof element.tagName === 'undefined') {\n throw new Error('Parameter element is an invalid object.');\n }\n\n if (typeof handler !== 'function') {\n throw new Error('Parameter handler is invalid.');\n }\n\n if (typeof gesture === 'string' &&\n Object.keys(this.registeredGestures).indexOf(gesture) === -1) {\n throw new Error('Parameter ' + gesture + ' is not a registered gesture');\n } else if (typeof gesture === 'object' && !(gesture instanceof Gesture)) {\n throw new Error('Parameter for the gesture is not of a Gesture type');\n }\n\n if (typeof gesture === 'string') {\n boundGesture = this.registeredGestures[gesture];\n } else {\n boundGesture = gesture;\n if (boundGesture.id === '') {\n this.assignGestureId(boundGesture);\n }\n }\n\n this.bindings.push(new Binding(element, boundGesture,\n handler, capture, bindOnce));\n element.addEventListener(boundGesture.getId(), handler, capture);\n }\n\n /**\n * Retrieves the Binding by which an element is associated to.\n * @param {Element} element - The element to find bindings to.\n * @return {Array} - An array of Bindings to which that element is bound\n */\n retrieveBindingsByElement(element) {\n let matches = [];\n this.bindings.map((binding) => {\n if (binding.element === element) {\n matches.push(binding);\n }\n });\n return matches;\n }\n\n /**\n * Retrieves all bindings based upon the initial X/Y position of the inputs.\n * e.g. if gesture started on the correct target element,\n * but diverted away into the correct region, this would still be valid.\n * @return {Array} - An array of Bindings to which that element is bound\n */\n retrieveBindingsByInitialPos() {\n let matches = [];\n this.bindings.forEach((binding) => {\n // Determine if at least one input is in the target element.\n // They should all be in the region based upon a prior check\n let inputsInside = this.inputs.filter((input) => {\n return util.isInside(input.initial.x, input.initial.y, binding.element);\n });\n if (inputsInside.length > 0) {\n matches.push(binding);\n }\n });\n return matches;\n }\n\n /**\n * Updates the inputs with new information based upon a new event being fired.\n * @param {Event} event - The event being captured.\n * @param {Element} regionElement - The element where\n * this current Region is bound to.\n * @return {boolean} - returns true for a successful update,\n * false if the event is invalid.\n */\n updateInputs(event, regionElement) {\n let identifier = DEFAULT_MOUSE_ID;\n let eventType = (event.touches) ?\n 'TouchEvent' : (event.pointerType) ? 'PointerEvent' : 'MouseEvent';\n\n switch (eventType) {\n case 'TouchEvent':\n // Return if all gestures did not originate from the same target\n if (event.touches.length !== event.targetTouches.length) {\n return false;\n }\n\n for (let index in event.changedTouches) {\n if (event.changedTouches.hasOwnProperty(index) &&\n util.isInteger((parseInt(index)))) {\n identifier = event.changedTouches[index].identifier;\n update(event, this, identifier, regionElement);\n }\n }\n break;\n\n case 'PointerEvent':\n identifier = event.pointerId;\n update(event, this, identifier, regionElement);\n break;\n\n case 'MouseEvent':\n default:\n update(event, this, DEFAULT_MOUSE_ID, regionElement);\n break;\n }\n return true;\n\n function update(event, state, identifier, regionElement) {\n let eventType = util.normalizeEvent(event.type);\n let input = findInputById(state.inputs, identifier);\n\n // A starting input was not cleaned up properly and still exists.\n if (eventType === 'start' && input) {\n state.resetInputs();\n return;\n }\n\n // An input has moved outside the region.\n if (eventType !== 'start' &&\n input &&\n !util.isInside(input.current.x, input.current.y, regionElement)) {\n state.resetInputs();\n return;\n }\n\n if (eventType !== 'start' && !input) {\n state.resetInputs();\n return;\n }\n\n if (eventType === 'start') {\n state.inputs.push(new Input(event, identifier));\n } else {\n input.update(event, identifier);\n }\n }\n }\n\n /**\n * Removes all inputs from the state, allowing for a new gesture.\n */\n resetInputs() {\n this.inputs = [];\n }\n\n /**\n * Counts the number of active inputs at any given time.\n * @return {Number} - The number of active inputs.\n */\n numActiveInputs() {\n let endType = this.inputs.filter((input) => {\n return input.current.type !== 'end';\n });\n return endType.length;\n }\n\n /**\n * Register the gesture to the current region.\n * @param {Object} gesture - The gesture to register\n * @param {String} key - The key to define the new gesture as.\n */\n registerGesture(gesture, key) {\n this.assignGestureId(gesture);\n this.registeredGestures[key] = gesture;\n }\n\n /**\n * Tracks the gesture to this state object to become uniquely identifiable.\n * Useful for nested Regions.\n * @param {Gesture} gesture - The gesture to track\n */\n assignGestureId(gesture) {\n gesture.setId(this.regionId + '-' + this.numGestures++);\n }\n\n}\n/**\n * Searches through each input, comparing the browser's identifier key\n * for touches, to the stored one in each input\n * @param {Array} inputs - The array of inputs in state.\n * @param {String} identifier - The identifier the browser has assigned.\n * @return {Input} - The input object with the corresponding identifier,\n * null if it did not find any.\n */\nfunction findInputById(inputs, identifier) {\n for (let i = 0; i < inputs.length; i++) {\n if (inputs[i].identifier === identifier) {\n return inputs[i];\n }\n }\n\n return null;\n}\n\nexport default State;\n\n\n\n// WEBPACK FOOTER //\n// ./src/core/classes/State.js","/**\n * @file Expand.js\n * Contains the Expand class\n */\n\nimport Distance from './Distance.js';\n\n/**\n * An Expand is defined as two inputs moving farther away from each other.\n * This gesture does not account for any start/end events to allow for the\n * event to interact with the Pan and Pinch events.\n * @class Expand\n */\nclass Expand extends Distance {\n\n /**\n * Constructor function for the Expand class.\n * @param {object} options\n */\n constructor(options) {\n super(options);\n\n /**\n * The type of the Gesture.\n * @type {String}\n */\n this.type = 'expand';\n }\n\n}\n\nexport default Expand;\n\n\n\n// WEBPACK FOOTER //\n// ./src/gestures/Expand.js","/**\n * @file Distance.js\n * Contains the abstract Distance class\n */\n\nimport Gesture from './Gesture.js';\nimport util from './../core/util.js';\n\nconst DEFAULT_INPUTS = 2;\nconst DEFAULT_MIN_THRESHOLD = 1;\n\n/**\n * A Distance is defined as two inputs moving either together or apart.\n * @class Distance\n */\nclass Distance extends Gesture {\n /**\n * Constructor function for the Distance class.\n * @param {Object} options\n */\n constructor(options) {\n super();\n\n /**\n * The type of the Gesture.\n * @type {String}\n */\n this.type = 'distance';\n\n /**\n * The minimum amount in pixels the inputs must move until it is fired.\n * @type {Number}\n */\n this.threshold = (options && options.threshold) ?\n options.threshold : DEFAULT_MIN_THRESHOLD;\n }\n\n /**\n * Event hook for the start of a gesture. Initialized the lastEmitted\n * gesture and stores it in the first input for reference events.\n * @param {Array} inputs\n */\n start(inputs) {\n if (inputs.length === DEFAULT_INPUTS) {\n // Store the progress in the first input.\n let progress = inputs[0].getGestureProgress(this.type);\n progress.lastEmittedDistance = util.distanceBetweenTwoPoints(\n inputs[0].current.x,\n inputs[1].current.x,\n inputs[0].current.y,\n inputs[1].current.y);\n }\n }\n\n /**\n * Event hook for the move of a gesture.\n * Determines if the two points are moved in the expected direction relative\n * to the current distance and the last distance.\n * @param {Array} inputs - The array of Inputs on the screen.\n * @param {Object} state - The state object of the current region.\n * @param {Element} element - The element associated to the binding.\n * @return {Object | null} - Returns the distance in pixels between two inputs\n */\n move(inputs, state, element) {\n if (state.numActiveInputs() === DEFAULT_INPUTS) {\n let currentDistance = util.distanceBetweenTwoPoints(\n inputs[0].current.x,\n inputs[1].current.x,\n inputs[0].current.y,\n inputs[1].current.y);\n let lastDistance = util.distanceBetweenTwoPoints(\n inputs[0].previous.x,\n inputs[1].previous.x,\n inputs[0].previous.y,\n inputs[1].previous.y);\n\n const centerPoint = util.getMidpoint(\n inputs[0].current.x,\n inputs[1].current.x,\n inputs[0].current.y,\n inputs[1].current.y);\n\n // Retrieve the first input's progress.\n let progress = inputs[0].getGestureProgress(this.type);\n\n if (this.type === 'expand') {\n if (currentDistance < lastDistance) {\n progress.lastEmittedDistance = currentDistance;\n } else if ((currentDistance - progress.lastEmittedDistance >=\n this.threshold)) {\n progress.lastEmittedDistance = currentDistance;\n return {\n distance: currentDistance,\n center: centerPoint,\n };\n }\n } else {\n if (currentDistance > lastDistance) {\n progress.lastEmittedDistance = currentDistance;\n } else if (currentDistance < lastDistance &&\n (progress.lastEmittedDistance - currentDistance >= this.threshold)) {\n progress.lastEmittedDistance = currentDistance;\n return {\n distance: currentDistance,\n center: centerPoint,\n };\n }\n }\n\n return null;\n }\n }\n}\n\nexport default Distance;\n\n\n\n// WEBPACK FOOTER //\n// ./src/gestures/Distance.js","/**\n * @file Pan.js\n * Contains the Pan class\n */\n\nimport Gesture from './Gesture.js';\nimport util from './../core/util.js';\n\nconst DEFAULT_INPUTS = 1;\nconst DEFAULT_MIN_THRESHOLD = 1;\n\n/**\n * A Pan is defined as a normal movement in any direction on a screen.\n * Pan gestures do not track start events and can interact with pinch and \\\n * expand gestures.\n * @class Pan\n */\nclass Pan extends Gesture {\n /**\n * Constructor function for the Pan class.\n * @param {Object} [options] - The options object.\n * @param {Number} [options.numInputs=1] - Number of inputs for the\n * Pan gesture.\n * @param {Number} [options.threshold=1] - The minimum number of\n * pixels the input has to move to trigger this gesture.\n */\n constructor(options) {\n super();\n\n /**\n * The type of the Gesture.\n * @type {String}\n */\n this.type = 'pan';\n\n /**\n * The number of inputs to trigger a Pan can be variable,\n * and the maximum number being a factor of the browser.\n * @type {Number}\n */\n this.numInputs = (options && options.numInputs) ?\n options.numInputs : DEFAULT_INPUTS;\n\n /**\n * The minimum amount in pixels the pan must move until it is fired.\n * @type {Number}\n */\n this.threshold = (options && options.threshold) ?\n options.threshold : DEFAULT_MIN_THRESHOLD;\n }\n\n /**\n * Event hook for the start of a gesture. Marks each input as active,\n * so it can invalidate any end events.\n * @param {Array} inputs\n */\n start(inputs) {\n inputs.forEach((input) => {\n let progress = input.getGestureProgress(this.getId());\n progress.active = true;\n progress.lastEmitted = {\n x: input.current.x,\n y: input.current.y,\n };\n });\n }\n\n /**\n * move() - Event hook for the move of a gesture.\n * Fired whenever the input length is met, and keeps a boolean flag that\n * the gesture has fired at least once.\n * @param {Array} inputs - The array of Inputs on the screen\n * @param {Object} state - The state object of the current region.\n * @param {Element} element - The element associated to the binding.\n * @return {Object} - Returns the distance in pixels between the two inputs.\n */\n move(inputs, state, element) {\n if (this.numInputs === inputs.length) {\n var output = {\n data: [],\n };\n for (let i = 0; i < inputs.length; i++) {\n let progress = inputs[i].getGestureProgress(this.getId());\n\n let reachedThreshold = false;\n\n // Check threshold distance\n const yThreshold = Math.abs(inputs[i].current.y -\n progress.lastEmitted.y) > this.threshold;\n const xThreshold = Math.abs(inputs[i].current.x -\n progress.lastEmitted.x) > this.threshold;\n reachedThreshold = yThreshold || xThreshold;\n\n if (progress.active && reachedThreshold) {\n output.data[i] = {\n distanceFromOrigin: util.distanceBetweenTwoPoints(\n inputs[i].initial.x,\n inputs[i].current.x,\n inputs[i].initial.y,\n inputs[i].current.y),\n directionFromOrigin: util.getAngle(\n inputs[i].initial.x,\n inputs[i].initial.y,\n inputs[i].current.x,\n inputs[i].current.y),\n currentDirection: util.getAngle(\n progress.lastEmitted.x,\n progress.lastEmitted.y,\n inputs[i].current.x,\n inputs[i].current.y),\n };\n progress.lastEmitted.x = inputs[i].current.x;\n progress.lastEmitted.y = inputs[i].current.y;\n } else {\n return null;\n }\n }\n }\n\n return output;\n }\n\n /* move*/\n\n /**\n * end() - Event hook for the end of a gesture. If the gesture has at least\n * fired once, then it ends on the first end event such that any remaining\n * inputs will not trigger the event until all inputs have reached the\n * touchend event. Any touchend->touchstart events that occur before all\n * inputs are fully off the screen should not fire.\n * @param {Array} inputs - The array of Inputs on the screen\n * @return {null} - null if the gesture is not to be emitted,\n * Object with information otherwise.\n */\n end(inputs) {\n inputs.forEach((input) => {\n let progress = input.getGestureProgress(this.getId());\n progress.active = false;\n });\n return null;\n }\n\n /* end*/\n}\n\nexport default Pan;\n\n\n\n// WEBPACK FOOTER //\n// ./src/gestures/Pan.js","/**\n * @file Pinch.js\n * Contains the Pinch class\n */\n\nimport Distance from './Distance.js';\nimport util from './../core/util.js';\n\n/**\n * An Pinch is defined as two inputs moving closer to each other.\n * This gesture does not account for any start/end events to allow for the event\n * to interact with the Pan and Pinch events.\n * @class Pinch\n */\nclass Pinch extends Distance {\n /**\n * Constructor function for the Pinch class.\n * @param {Object} options\n */\n constructor(options) {\n super(options);\n\n /**\n * The type of the Gesture.\n * @type {String}\n */\n this.type = 'pinch';\n }\n\n}\n\nexport default Pinch;\n\n\n\n// WEBPACK FOOTER //\n// ./src/gestures/Pinch.js","/**\n * @file Rotate.js\n * Contains the Rotate class\n */\n\nimport Gesture from './Gesture.js';\nimport util from './../core/util.js';\n\nconst MAX_INPUTS = 2;\n\n/**\n * A Rotate is defined as two inputs moving about a circle,\n * maintaining a relatively equal radius.\n * @class Rotate\n */\nclass Rotate extends Gesture {\n /**\n * Constructor function for the Rotate class.\n */\n constructor() {\n super();\n\n /**\n * The type of the Gesture.\n * @type {String}\n */\n this.type = 'rotate';\n }\n\n /**\n * move() - Event hook for the move of a gesture. Obtains the midpoint of two\n * the two inputs and calculates the projection of the right most input along\n * a unit circle to obtain an angle. This angle is compared to the previously\n * calculated angle to output the change of distance, and is compared to the\n * initial angle to output the distance from the initial angle to the current\n * angle.\n * @param {Array} inputs - The array of Inputs on the screen\n * @param {Object} state - The state object of the current listener.\n * @param {Element} element - The element associated to the binding.\n * @return {null} - null if this event did not occur\n * @return {Object} obj.angle - The current angle along the unit circle\n * @return {Object} obj.distanceFromOrigin - The angular distance travelled\n * from the initial right most point.\n * @return {Object} obj.distanceFromLast - The change of angle between the\n * last position and the current position.\n */\n move(inputs, state, element) {\n if (state.numActiveInputs() <= MAX_INPUTS) {\n let referencePivot;\n let diffX;\n let diffY;\n let input;\n if (state.numActiveInputs() === 1) {\n let bRect = element.getBoundingClientRect();\n referencePivot = {\n x: bRect.left + bRect.width / 2,\n y: bRect.top + bRect.height / 2,\n };\n input = inputs[0];\n diffX = diffY = 0;\n } else {\n referencePivot = util.getMidpoint(\n inputs[0].initial.x,\n inputs[1].initial.x,\n inputs[0].initial.y,\n inputs[1].initial.y);\n let currentPivot = util.getMidpoint(\n inputs[0].current.x,\n inputs[1].current.x,\n inputs[0].current.y,\n inputs[1].current.y);\n diffX = referencePivot.x - currentPivot.x;\n diffY = referencePivot.y - currentPivot.y;\n input = util.getRightMostInput(inputs);\n }\n\n // Translate the current pivot point.\n let currentAngle = util.getAngle(referencePivot.x, referencePivot.y,\n input.current.x + diffX, input.current.y + diffY);\n\n let progress = input.getGestureProgress(this.getId());\n if (!progress.initialAngle) {\n progress.initialAngle = progress.previousAngle = currentAngle;\n progress.distance = progress.change = 0;\n } else {\n progress.change = util.getAngularDistance(\n progress.previousAngle,\n currentAngle);\n progress.distance = progress.distance + progress.change;\n }\n\n progress.previousAngle = currentAngle;\n\n return {\n angle: currentAngle,\n distanceFromOrigin: progress.distance,\n distanceFromLast: progress.change,\n };\n }\n\n return null;\n }\n\n /* move*/\n}\n\nexport default Rotate;\n\n\n\n// WEBPACK FOOTER //\n// ./src/gestures/Rotate.js","/**\n * @file Swipe.js\n * Contains the Swipe class\n */\n\nimport Gesture from './Gesture.js';\nimport util from './../core/util.js';\n\nconst DEFAULT_INPUTS = 1;\nconst DEFAULT_MAX_REST_TIME = 100;\nconst DEFAULT_ESCAPE_VELOCITY = 0.2;\nconst DEFAULT_TIME_DISTORTION = 100;\nconst DEFAULT_MAX_PROGRESS_STACK = 10;\n\n/**\n * A swipe is defined as input(s) moving in the same direction in an relatively\n * increasing velocity and leaving the screen at some point before it drops\n * below it's escape velocity.\n * @class Swipe\n */\nclass Swipe extends Gesture {\n\n /**\n * Constructor function for the Swipe class.\n * @param {Object} [options] - The options object.\n * @param {Number} [options.numInputs] - The number of inputs to trigger a\n * Swipe can be variable, and the maximum number being a factor of the browser\n * move and current move events.\n * @param {Number} [options.maxRestTime] - The maximum resting time a point\n * has between it's last\n * @param {Number} [options.escapeVelocity] - The minimum velocity the input\n * has to be at to emit a swipe.\n * @param {Number} [options.timeDistortion] - (EXPERIMENTAL) A value of time\n * in milliseconds to distort between events.\n * @param {Number} [options.maxProgressStack] - (EXPERIMENTAL)The maximum\n * amount of move events to keep\n * track of for a swipe.\n */\n constructor(options) {\n super();\n /**\n * The type of the Gesture\n * @type {String}\n */\n this.type = 'swipe';\n\n /**\n * The number of inputs to trigger a Swipe can be variable,\n * and the maximum number being a factor of the browser.\n * @type {Number}\n */\n this.numInputs = (options && options.numInputs) ?\n options.numInputs : DEFAULT_INPUTS;\n\n /**\n * The maximum resting time a point has between it's last move and\n * current move events.\n * @type {Number}\n */\n this.maxRestTime = (options && options.maxRestTime) ?\n options.maxRestTime : DEFAULT_MAX_REST_TIME;\n\n /**\n * The minimum velocity the input has to be at to emit a swipe.\n * This is useful for determining the difference between\n * a swipe and a pan gesture.\n * @type {number}\n */\n this.escapeVelocity = (options && options.escapeVelocity) ?\n options.escapeVelocity : DEFAULT_ESCAPE_VELOCITY;\n\n /**\n * (EXPERIMENTAL) A value of time in milliseconds to distort between events.\n * Browsers do not accurately measure time with the Date constructor in\n * milliseconds, so consecutive events sometimes display the same timestamp\n * but different x/y coordinates. This will distort a previous time\n * in such cases by the timeDistortion's value.\n * @type {number}\n */\n this.timeDistortion = (options && options.timeDistortion) ?\n options.timeDistortion : DEFAULT_TIME_DISTORTION;\n\n /**\n * (EXPERIMENTAL) The maximum amount of move events to keep track of for a\n * swipe. This helps give a more accurate estimate of the user's velocity.\n * @type {number}\n */\n this.maxProgressStack = (options && options.maxProgressStack) ?\n options.maxProgressStack : DEFAULT_MAX_PROGRESS_STACK;\n }\n\n /**\n * Event hook for the move of a gesture. Captures an input's x/y coordinates\n * and the time of it's event on a stack.\n * @param {Array} inputs - The array of Inputs on the screen.\n * @param {Object} state - The state object of the current region.\n * @param {Element} element - The element associated to the binding.\n * @return {null} - Swipe does not emit from a move.\n */\n move(inputs, state, element) {\n if (this.numInputs === inputs.length) {\n for (let i = 0; i < inputs.length; i++) {\n let progress = inputs[i].getGestureProgress(this.getId());\n if (!progress.moves) {\n progress.moves = [];\n }\n\n progress.moves.push({\n time: new Date().getTime(),\n x: inputs[i].current.x,\n y: inputs[i].current.y,\n });\n\n if (progress.length > this.maxProgressStack) {\n progress.moves.shift();\n }\n }\n }\n\n return null;\n }\n\n /* move*/\n\n /**\n * Determines if the input's history validates a swipe motion.\n * Determines if it did not come to a complete stop (maxRestTime), and if it\n * had enough of a velocity to be considered (ESCAPE_VELOCITY).\n * @param {Array} inputs - The array of Inputs on the screen\n * @return {null|Object} - null if the gesture is not to be emitted,\n * Object with information otherwise.\n */\n end(inputs) {\n if (this.numInputs === inputs.length) {\n let output = {\n data: [],\n };\n\n for (var i = 0; i < inputs.length; i++) {\n // Determine if all input events are on the 'end' event.\n if (inputs[i].current.type !== 'end') {\n return;\n }\n\n let progress = inputs[i].getGestureProgress(this.getId());\n if (progress.moves && progress.moves.length > 2) {\n // CHECK : Return if the input has not moved in maxRestTime ms.\n\n let currentMove = progress.moves.pop();\n if ((new Date().getTime()) - currentMove.time > this.maxRestTime) {\n return null;\n }\n\n let lastMove;\n let index = progress.moves.length - 1;\n\n /* Date is unreliable, so we retrieve the last move event where\n the time is not the same. */\n while (index !== -1) {\n if (progress.moves[index].time !== currentMove.time) {\n lastMove = progress.moves[index];\n break;\n }\n\n index--;\n }\n\n /* If the date is REALLY unreliable, we apply a time distortion\n to the last event.\n */\n if (!lastMove) {\n lastMove = progress.moves.pop();\n lastMove.time += this.timeDistortion;\n }\n\n var velocity = util.getVelocity(lastMove.x, lastMove.y, lastMove.time,\n currentMove.x, currentMove.y, currentMove.time);\n\n output.data[i] = {\n velocity: velocity,\n currentDirection: util.getAngle(\n lastMove.x,\n lastMove.y,\n currentMove.x,\n currentMove.y),\n };\n }\n }\n\n for (var i = 0; i < output.data.length; i++) {\n if (velocity < this.escapeVelocity) {\n return null;\n }\n }\n\n if (output.data.length > 0) {\n return output;\n }\n }\n\n return null;\n }\n\n /* end*/\n}\n\nexport default Swipe;\n\n\n\n// WEBPACK FOOTER //\n// ./src/gestures/Swipe.js","/**\n * @file Tap.js\n * Contains the Tap class\n */\n\nimport Gesture from './Gesture.js';\nimport util from './../core/util.js';\n\nconst DEFAULT_MIN_DELAY_MS = 0;\nconst DEFAULT_MAX_DELAY_MS = 300;\nconst DEFAULT_INPUTS = 1;\nconst DEFAULT_MOVE_PX_TOLERANCE = 10;\n\n/**\n * A Tap is defined as a touchstart to touchend event in quick succession.\n * @class Tap\n */\nclass Tap extends Gesture {\n /**\n * Constructor function for the Tap class.\n * @param {Object} [options] - The options object.\n * @param {Number} [options.minDelay=0] - The minimum delay between a\n * touchstart and touchend can be configured in milliseconds.\n * @param {Number} [options.maxDelay=300] - The maximum delay between a\n * touchstart and touchend can be configured in milliseconds.\n * @param {Number} [options.numInputs=1] - Number of inputs for Tap gesture.\n * @param {Number} [options.tolerance=10] - The tolerance in pixels\n * a user can move.\n */\n constructor(options) {\n super();\n\n /**\n * The type of the Gesture.\n * @type {String}\n */\n this.type = 'tap';\n\n /**\n * The minimum amount between a touchstart and a touchend can be configured\n * in milliseconds. The minimum delay starts to count down when the expected\n * number of inputs are on the screen, and ends when ALL inputs are off the\n * screen.\n * @type {Number}\n */\n this.minDelay = (options && options.minDelay) ?\n options.minDelay : DEFAULT_MIN_DELAY_MS;\n\n /**\n * The maximum delay between a touchstart and touchend can be configured in\n * milliseconds. The maximum delay starts to count down when the expected\n * number of inputs are on the screen, and ends when ALL inputs are off the\n * screen.\n * @type {Number}\n */\n this.maxDelay = (options && options.maxDelay) ?\n options.maxDelay : DEFAULT_MAX_DELAY_MS;\n\n /**\n * The number of inputs to trigger a Tap can be variable,\n * and the maximum number being a factor of the browser.\n * @type {Number}\n */\n this.numInputs = (options && options.numInputs) ?\n options.numInputs : DEFAULT_INPUTS;\n\n /**\n * A move tolerance in pixels allows some slop between a user's start to end\n * events. This allows the Tap gesture to be triggered more easily.\n * @type {number}\n */\n this.tolerance = (options && options.tolerance) ?\n options.tolerance : DEFAULT_MOVE_PX_TOLERANCE;\n }\n\n /* constructor*/\n\n /**\n * Event hook for the start of a gesture. Keeps track of when the inputs\n * trigger the start event.\n * @param {Array} inputs - The array of Inputs on the screen.\n * @return {null} - Tap does not trigger on a start event.\n */\n start(inputs) {\n if (inputs.length === this.numInputs) {\n inputs.forEach((input) => {\n let progress = input.getGestureProgress(this.type);\n progress.start = new Date().getTime();\n });\n }\n\n return null;\n }\n\n /* start*/\n\n /**\n * Event hook for the move of a gesture. The Tap event reaches here if the\n * user starts to move their input before an 'end' event is reached.\n * @param {Array} inputs - The array of Inputs on the screen.\n * @param {Object} state - The state object of the current region.\n * @param {Element} element - The element associated to the binding.\n * @return {null} - Tap does not trigger on a move event.\n */\n move(inputs, state, element) {\n for (let i = 0; i < inputs.length; i++) {\n if (inputs[i].getCurrentEventType() === 'move') {\n let current = inputs[i].current;\n let previous = inputs[i].previous;\n if (!util.isWithin(\n current.x,\n current.y,\n previous.x,\n previous.y,\n this.tolerance)) {\n let type = this.type;\n inputs.forEach(function(input) {\n input.resetProgress(type);\n });\n\n return null;\n }\n }\n }\n\n return null;\n }\n\n /* move*/\n\n /**\n * Event hook for the end of a gesture.\n * Determines if this the tap event can be fired if the delay and tolerance\n * constraints are met. Also waits for all of the inputs to be off the screen\n * before determining if the gesture is triggered.\n * @param {Array} inputs - The array of Inputs on the screen.\n * @return {null|Object} - null if the gesture is not to be emitted,\n * Object with information otherwise. Returns the interval time between start\n * and end events.\n */\n end(inputs) {\n if (inputs.length !== this.numInputs) {\n return null;\n }\n\n let startTime = Number.MAX_VALUE;\n for (let i = 0; i < inputs.length; i++) {\n if (inputs[i].getCurrentEventType() !== 'end') {\n return null;\n }\n\n let progress = inputs[i].getGestureProgress(this.type);\n if (!progress.start) {\n return null;\n }\n\n // Find the most recent input's startTime\n if (progress.start < startTime) {\n startTime = progress.start;\n }\n }\n\n let interval = new Date().getTime() - startTime;\n if ((this.minDelay <= interval) && (this.maxDelay >= interval)) {\n return {\n interval: interval,\n };\n } else {\n let type = this.type;\n inputs.forEach(function(input) {\n input.resetProgress(type);\n });\n\n return null;\n }\n }\n\n /* end*/\n}\n\nexport default Tap;\n\n\n\n// WEBPACK FOOTER //\n// ./src/gestures/Tap.js","/**\n * @file Binding.js\n */\n\n/**\n * Responsible for creating a binding between an element and a gesture.\n * @class Binding\n */\nclass Binding {\n /**\n * Constructor function for the Binding class.\n * @param {Element} element - The element to associate the gesture to.\n * @param {Gesture} gesture - A instance of the Gesture type.\n * @param {Function} handler - The function handler to execute when a\n * gesture is recognized\n * on the associated element.\n * @param {Boolean} [capture=false] - A boolean signifying if the event is\n * to be emitted during\n * the capture or bubble phase.\n * @param {Boolean} [bindOnce=false] - A boolean flag\n * used for the bindOnce syntax.\n */\n constructor(element, gesture, handler, capture, bindOnce) {\n /**\n * The element to associate the gesture to.\n * @type {Element}\n */\n this.element = element;\n /**\n * A instance of the Gesture type.\n * @type {Gesture}\n */\n this.gesture = gesture;\n /**\n * The function handler to execute when a gesture is\n * recognized on the associated element.\n * @type {Function}\n */\n this.handler = handler;\n\n /**\n * A boolean signifying if the event is to be\n * emitted during the capture or bubble phase.\n * @type {Boolean}\n */\n this.capture = (typeof capture !== 'undefined') ? capture : false;\n\n /**\n * A boolean flag used for the bindOnce syntax.\n * @type {Boolean}\n */\n this.bindOnce = (typeof bindOnce !== 'undefined') ? bindOnce : false;\n }\n\n}\n\nexport default Binding;\n\n\n\n// WEBPACK FOOTER //\n// ./src/core/classes/Binding.js","/**\n * @file Input.js\n */\n\nimport ZingEvent from './ZingEvent.js';\n\n/**\n * Tracks a single input and contains information about the\n * current, previous, and initial events.\n * Contains the progress of each Input and it's associated gestures.\n * @class Input\n */\nclass Input {\n\n /**\n * Constructor function for the Input class.\n * @param {Event} event - The Event object from the window\n * @param {Number} [identifier=0] - The identifier for each input event\n * (taken from event.changedTouches)\n */\n constructor(event, identifier) {\n let currentEvent = new ZingEvent(event, identifier);\n\n /**\n * Holds the initial event object. A touchstart/mousedown event.\n * @type {ZingEvent}\n */\n this.initial = currentEvent;\n\n /**\n * Holds the most current event for this Input, disregarding any other past,\n * current, and future events that other Inputs participate in.\n * e.g. This event ended in an 'end' event, but another Input is still\n * participating in events -- this will not be updated in such cases.\n * @type {ZingEvent}\n */\n this.current = currentEvent;\n\n /**\n * Holds the previous event that took place.\n * @type {ZingEvent}\n */\n this.previous = currentEvent;\n\n /**\n * Refers to the event.touches index, or 0 if a simple mouse event occurred.\n * @type {Number}\n */\n this.identifier = (typeof identifier !== 'undefined') ? identifier : 0;\n\n /**\n * Stores internal state between events for\n * each gesture based off of the gesture's id.\n * @type {Object}\n */\n this.progress = {};\n }\n\n /**\n * Receives an input, updates the internal state of what the input has done.\n * @param {Event} event - The event object to wrap with a ZingEvent.\n * @param {Number} touchIdentifier - The index of inputs, from event.touches\n */\n update(event, touchIdentifier) {\n this.previous = this.current;\n this.current = new ZingEvent(event, touchIdentifier);\n }\n\n /**\n * Returns the progress of the specified gesture.\n * @param {String} id - The identifier for each unique Gesture's progress.\n * @return {Object} - The progress of the gesture.\n * Creates an empty object if no progress has begun.\n */\n getGestureProgress(id) {\n if (!this.progress[id]) {\n this.progress[id] = {};\n }\n return this.progress[id];\n }\n\n /**\n * Returns the normalized current Event's type.\n * @return {String} The current event's type ( start | move | end )\n */\n getCurrentEventType() {\n return this.current.type;\n }\n\n /**\n * Resets a progress/state object of the specified gesture.\n * @param {String} id - The identifier of the specified gesture\n */\n resetProgress(id) {\n this.progress[id] = {};\n }\n\n}\n\nexport default Input;\n\n\n\n// WEBPACK FOOTER //\n// ./src/core/classes/Input.js","/**\n * @file ZingEvent.js\n * Contains logic for ZingEvents\n */\n\nimport util from '../util.js';\n\nconst INITIAL_COORDINATE = 0;\n/**\n * An event wrapper that normalizes events across browsers and input devices\n * @class ZingEvent\n */\nclass ZingEvent {\n /**\n * @constructor\n * @param {Event} event - The event object being wrapped.\n * @param {Array} event.touches - The number of touches on\n * a screen (mobile only).\n * @param {Object} event.changedTouches - The TouchList representing\n * points that participated in the event.\n * @param {Number} touchIdentifier - The index of touch if applicable\n */\n constructor(event, touchIdentifier) {\n /**\n * The original event object.\n * @type {Event}\n */\n this.originalEvent = event;\n\n /**\n * The type of event or null if it is an event not predetermined.\n * @see util.normalizeEvent\n * @type {String | null}\n */\n this.type = util.normalizeEvent(event.type);\n\n /**\n * The X coordinate for the event, based off of the client.\n * @type {number}\n */\n this.x = INITIAL_COORDINATE;\n\n /**\n * The Y coordinate for the event, based off of the client.\n * @type {number}\n */\n this.y = INITIAL_COORDINATE;\n\n let eventObj;\n if (event.touches && event.changedTouches) {\n for (let i = 0; i < event.changedTouches.length; i++) {\n if (event.changedTouches[i].identifier === touchIdentifier) {\n eventObj = event.changedTouches[i];\n break;\n }\n }\n } else {\n eventObj = event;\n }\n\n this.x = this.clientX = eventObj.clientX;\n this.y = this.clientY = eventObj.clientY;\n\n this.pageX = eventObj.pageX;\n this.pageY = eventObj.pageY;\n\n this.screenX = eventObj.screenX;\n this.screenY = eventObj.screenY;\n }\n}\n\nexport default ZingEvent;\n\n\n\n// WEBPACK FOOTER //\n// ./src/core/classes/ZingEvent.js"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///./dist/zingtouch.js","webpack:///webpack/bootstrap 801e7c6a989db482d874","webpack:///./src/core/main.js","webpack:///./src/ZingTouch.js","webpack:///./src/core/classes/Region.js","webpack:///./src/core/classes/Binder.js","webpack:///./src/gestures/Gesture.js","webpack:///./src/core/arbiter.js","webpack:///./src/core/dispatcher.js","webpack:///./src/core/interpreter.js","webpack:///./src/core/util.js","webpack:///./src/core/classes/State.js","webpack:///./src/gestures/Expand.js","webpack:///./src/gestures/Distance.js","webpack:///./src/gestures/Pan.js","webpack:///./src/gestures/Pinch.js","webpack:///./src/gestures/Rotate.js","webpack:///./src/gestures/Swipe.js","webpack:///./src/gestures/Tap.js","webpack:///./src/core/classes/Binding.js","webpack:///./src/core/classes/Input.js","webpack:///./src/core/classes/ZingEvent.js"],"names":["modules","__webpack_require__","moduleId","installedModules","exports","module","id","loaded","call","m","c","p","_interopRequireDefault","obj","__esModule","default","_ZingTouch","_ZingTouch2","window","ZingTouch","Object","defineProperty","value","_Region2","_Region3","_Gesture","_Gesture2","_Expand","_Expand2","_Pan","_Pan2","_Pinch","_Pinch2","_Rotate","_Rotate2","_Swipe","_Swipe2","_Tap","_Tap2","_regions","Gesture","Expand","Pan","Pinch","Rotate","Swipe","Tap","Region","element","capture","preventDefault","length","region","push","_classCallCheck","instance","Constructor","TypeError","_createClass","defineProperties","target","props","i","descriptor","enumerable","configurable","writable","key","protoProps","staticProps","prototype","_Binder","_Binder2","_arbiter","_arbiter2","_State","_State2","_this","this","state","eventNames","PointerEvent","TouchEvent","map","name","addEventListener","e","gesture","handler","bindOnce","tagName","addBinding","bind","_this2","bindings","retrieveBindingsByElement","unbound","forEach","binding","registeredGestures","registeredGesture","removeEventListener","getId","Error","setType","registerGesture","getType","Binder","keys","type","object","inputs","arbiter","event","_util2","normalizeEvent","buttons","resetInputs","updateInputs","retrieveBindingsByInitialPos","setMSPreventDefault","returnValue","removeMSPreventDefault","toBeDispatched","gestures","_interpreter2","path","getPropagationPath","getPathIndex","index","_dispatcher2","data","events","endCount","input","getCurrentEventType","_dispatcher","_interpreter","_util","dispatcher","newEvent","CustomEvent","detail","bubbles","cancelable","emitEvent","dispatchEvent","unbind","interpreter","evType","candidates","result","current","CIRCLE_DEGREES","HALF_CIRCLE_DEGREES","util","isWithin","currentX","currentY","previousX","previousY","tolerance","Math","abs","distanceBetweenTwoPoints","x0","x1","y0","y1","dist","sqrt","round","getMidpoint","x","y","getAngle","originX","originY","projectionX","projectionY","angle","atan2","PI","getAngularDistance","start","end","sign","getVelocity","startX","startY","startTime","endX","endY","endTime","distance","getRightMostInput","rightMost","Number","MIN_VALUE","initial","isInteger","isInside","rect","getBoundingClientRect","left","width","top","height","node","document","parentNode","style","findInputById","identifier","_typeof","Symbol","iterator","constructor","_Binding","_Binding2","_Input","_Input2","DEFAULT_MOUSE_ID","State","regionId","numGestures","boundGesture","indexOf","assignGestureId","matches","inputsInside","filter","regionElement","update","eventType","touches","pointerType","targetTouches","changedTouches","hasOwnProperty","parseInt","pointerId","endType","setId","_possibleConstructorReturn","self","ReferenceError","_inherits","subClass","superClass","create","setPrototypeOf","__proto__","_Distance2","_Distance3","_Distance","options","getPrototypeOf","_Gesture3","DEFAULT_INPUTS","DEFAULT_MIN_THRESHOLD","Distance","threshold","progress","getGestureProgress","lastEmittedDistance","numActiveInputs","currentDistance","lastDistance","previous","centerPoint","center","numInputs","active","lastEmitted","output","reachedThreshold","yThreshold","xThreshold","distanceFromOrigin","directionFromOrigin","currentDirection","_this3","MAX_INPUTS","referencePivot","diffX","diffY","bRect","currentPivot","currentAngle","initialAngle","change","previousAngle","distanceFromLast","DEFAULT_MAX_REST_TIME","DEFAULT_ESCAPE_VELOCITY","DEFAULT_TIME_DISTORTION","DEFAULT_MAX_PROGRESS_STACK","maxRestTime","escapeVelocity","timeDistortion","maxProgressStack","moves","time","Date","getTime","shift","currentMove","pop","lastMove","velocity","DEFAULT_MIN_DELAY_MS","DEFAULT_MAX_DELAY_MS","DEFAULT_MOVE_PX_TOLERANCE","minDelay","maxDelay","_ret","resetProgress","v","_this4","MAX_VALUE","interval","_ret2","Binding","_ZingEvent","_ZingEvent2","Input","currentEvent","touchIdentifier","INITIAL_COORDINATE","ZingEvent","originalEvent","eventObj","clientX","clientY","pageX","pageY","screenX","screenY"],"mappings":";;;;;;CAAS,SAAUA,GCInB,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GAAAE,OAGA,IAAAC,GAAAF,EAAAD,IACAE,WACAE,GAAAJ,EACAK,QAAA,EAUA,OANAP,GAAAE,GAAAM,KAAAH,EAAAD,QAAAC,IAAAD,QAAAH,GAGAI,EAAAE,QAAA,EAGAF,EAAAD,QAvBA,GAAAD,KAqCA,OATAF,GAAAQ,EAAAT,EAGAC,EAAAS,EAAAP,EAGAF,EAAAU,EAAA,GAGAV,EAAA,KDMM,SAASI,EAAQD,EAASH,GAE/B,YAMA,SAASW,GAAuBC,GAAO,MAAOA,IAAOA,EAAIC,WAAaD,GAAQE,QAASF,GE9CxF,GAAAG,GAAAf,EAAA,GF4CKgB,EAAcL,EAAuBI,EE3C1CE,QAAOC,UAAPF,EAAAF,SFuDM,SAASV,EAAQD,EAASH,GAE/B,YAsCA,SAASW,GAAuBC,GAAO,MAAOA,IAAOA,EAAIC,WAAaD,GAAQE,QAASF,GApCvFO,OAAOC,eAAejB,EAAS,cAC7BkB,OAAO,GG9DV,IAAAC,GAAAt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AAQ3C,QpBg/EnB1C,IAAK,gBACL7C,MAAO,SoB1+EIhB,GACZwE,KAAKyL,SAASjQ,UpB8+ERgU,IAGTlU,GAAQW,QoB5+EMuT,GpBg/ET,SAASjU,EAAQD,EAASH,GAE/B,YAUA,SAASW,GAAuBC,GAAO,MAAOA,IAAOA,EAAIC,WAAaD,GAAQE,QAASF,GAEvF,QAASyC,GAAgBC,EAAUC,GAAe,KAAMD,YAAoBC,IAAgB,KAAM,IAAIC,WAAU,qCAVhHrC,OAAOC,eAAejB,EAAS,cAC7BkB,OAAO,GqBnlFV,IAAAoH,GAAAzI,EAAA,GrBwlFKiH,EAAStG,EAAuB8H,GqBtlF/B+L,EAAqB,EAKrBC,EAUJ,QAAAA,GAAYzN,EAAOuN,GAAiBlR,EAAAwB,KAAA4P,GAKlC5P,KAAK6P,cAAgB1N,EAOrBnC,KAAK+B,KAAOK,EAAAnG,QAAKoG,eAAeF,EAAMJ,MAMtC/B,KAAK+F,EAAI4J,EAMT3P,KAAKgG,EAAI2J,CAET,IAAIG,SACJ,IAAI3N,EAAM0H,SAAW1H,EAAM6H,gBACzB,IAAK,GAAIhL,GAAI,EAAGA,EAAImD,EAAM6H,eAAe3L,OAAQW,IAC/C,GAAImD,EAAM6H,eAAehL,GAAGuJ,aAAemH,EAAiB,CAC1DI,EAAW3N,EAAM6H,eAAehL,EAChC,YAIJ8Q,GAAW3N,CAGbnC,MAAK+F,EAAI/F,KAAK+P,QAAUD,EAASC,QACjC/P,KAAKgG,EAAIhG,KAAKgQ,QAAUF,EAASE,QAEjChQ,KAAKiQ,MAAQH,EAASG,MACtBjQ,KAAKkQ,MAAQJ,EAASI,MAEtBlQ,KAAKmQ,QAAUL,EAASK,QACxBnQ,KAAKoQ,QAAUN,EAASM,QrBqmF3B9U,GAAQW,QqBjmFM2T","file":"/Users/mike/zingtouch/dist/zingtouch.js","sourcesContent":["/******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar _ZingTouch = __webpack_require__(1);\n\t\n\tvar _ZingTouch2 = _interopRequireDefault(_ZingTouch);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\twindow.ZingTouch = _ZingTouch2.default; /**\n\t * @file main.js\n\t * Main file to setup event listeners on the document,\n\t * and to expose the ZingTouch object\n\t */\n\n/***/ },\n/* 1 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _Region2 = __webpack_require__(2);\n\t\n\tvar _Region3 = _interopRequireDefault(_Region2);\n\t\n\tvar _Gesture = __webpack_require__(4);\n\t\n\tvar _Gesture2 = _interopRequireDefault(_Gesture);\n\t\n\tvar _Expand = __webpack_require__(10);\n\t\n\tvar _Expand2 = _interopRequireDefault(_Expand);\n\t\n\tvar _Pan = __webpack_require__(12);\n\t\n\tvar _Pan2 = _interopRequireDefault(_Pan);\n\t\n\tvar _Pinch = __webpack_require__(13);\n\t\n\tvar _Pinch2 = _interopRequireDefault(_Pinch);\n\t\n\tvar _Rotate = __webpack_require__(14);\n\t\n\tvar _Rotate2 = _interopRequireDefault(_Rotate);\n\t\n\tvar _Swipe = __webpack_require__(15);\n\t\n\tvar _Swipe2 = _interopRequireDefault(_Swipe);\n\t\n\tvar _Tap = __webpack_require__(16);\n\t\n\tvar _Tap2 = _interopRequireDefault(_Tap);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\t/**\n\t * The global API interface for ZingTouch. Contains a constructor for the\n\t * Region Object, and constructors for each predefined Gesture.\n\t * @type {Object}\n\t * @namespace ZingTouch\n\t */\n\t/**\n\t * @file ZingTouch.js\n\t * Main object containing API methods and Gesture constructors\n\t */\n\t\n\tvar ZingTouch = {\n\t _regions: [],\n\t\n\t // Constructors\n\t Gesture: _Gesture2.default,\n\t Expand: _Expand2.default,\n\t Pan: _Pan2.default,\n\t Pinch: _Pinch2.default,\n\t Rotate: _Rotate2.default,\n\t Swipe: _Swipe2.default,\n\t Tap: _Tap2.default,\n\t Region: function Region(element, capture, preventDefault) {\n\t var id = ZingTouch._regions.length;\n\t var region = new _Region3.default(element, capture, preventDefault, id);\n\t ZingTouch._regions.push(region);\n\t return region;\n\t }\n\t};\n\t\n\texports.default = ZingTouch;\n\n/***/ },\n/* 2 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /**\n\t * @file Region.js\n\t */\n\t\n\tvar _Binder = __webpack_require__(3);\n\t\n\tvar _Binder2 = _interopRequireDefault(_Binder);\n\t\n\tvar _Gesture = __webpack_require__(4);\n\t\n\tvar _Gesture2 = _interopRequireDefault(_Gesture);\n\t\n\tvar _arbiter = __webpack_require__(5);\n\t\n\tvar _arbiter2 = _interopRequireDefault(_arbiter);\n\t\n\tvar _State = __webpack_require__(9);\n\t\n\tvar _State2 = _interopRequireDefault(_State);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\t/**\n\t * Allows the user to specify a region to capture all events to feed ZingTouch\n\t * into. This can be as narrow as the element itself, or as big as the document\n\t * itself. The more specific an area, the better performant the overall\n\t * application will perform. Contains API methods to bind/unbind specific\n\t * elements to corresponding gestures. Also contains the ability to\n\t * register/unregister new gestures.\n\t * @class Region\n\t */\n\tvar Region = function () {\n\t\n\t /**\n\t * Constructor function for the Region class.\n\t * @param {Element} element - The element to capture all\n\t * window events in that region to feed into ZingTouch.\n\t * @param {boolean} [capture=false] - Whether the region listens for\n\t * captures or bubbles.\n\t * @param {boolean} [preventDefault=true] - Whether the default browser\n\t * functionality should be disabled;\n\t * @param {Number} id - The id of the region, assigned by the ZingTouch object\n\t */\n\t function Region(element, capture, preventDefault, id) {\n\t var _this = this;\n\t\n\t _classCallCheck(this, Region);\n\t\n\t /**\n\t * The identifier for the Region. This is assigned by the ZingTouch object\n\t * and is used to hash gesture id for uniqueness.\n\t * @type {Number}\n\t */\n\t this.id = id;\n\t\n\t /**\n\t * The element being bound to.\n\t * @type {Element}\n\t */\n\t this.element = element;\n\t\n\t /**\n\t * Whether the region listens for captures or bubbles.\n\t * @type {boolean}\n\t */\n\t this.capture = typeof capture !== 'undefined' ? capture : false;\n\t\n\t /**\n\t * Boolean to disable browser functionality such as scrolling and zooming\n\t * over the region\n\t * @type {boolean}\n\t */\n\t this.preventDefault = typeof preventDefault !== 'undefined' ? preventDefault : true;\n\t\n\t /**\n\t * The internal state object for a Region.\n\t * Keeps track of registered gestures, inputs, and events.\n\t * @type {State}\n\t */\n\t this.state = new _State2.default(id);\n\t\n\t var eventNames = [];\n\t if (window.PointerEvent && !window.TouchEvent) {\n\t eventNames = ['pointerdown', 'pointermove', 'pointerup'];\n\t } else {\n\t eventNames = ['mousedown', 'mousemove', 'mouseup', 'touchstart', 'touchmove', 'touchend'];\n\t }\n\t\n\t // Bind detected browser events to the region element.\n\t eventNames.map(function (name) {\n\t element.addEventListener(name, function (e) {\n\t (0, _arbiter2.default)(e, _this);\n\t }, _this.capture);\n\t });\n\t }\n\t\n\t /**\n\t * Bind an element to a registered/unregistered gesture with\n\t * multiple function signatures.\n\t * @example\n\t * bind(element) - chainable\n\t * @example\n\t * bind(element, gesture, handler, [capture])\n\t * @param {Element} element - The element object.\n\t * @param {String|Object} [gesture] - Gesture key, or a Gesture object.\n\t * @param {Function} [handler] - The function to execute when an event is\n\t * emitted.\n\t * @param {Boolean} [capture] - capture/bubble\n\t * @param {Boolean} [bindOnce = false] - Option to bind once and\n\t * only emit the event once.\n\t * @return {Object} - a chainable object that has the same function as bind.\n\t */\n\t\n\t\n\t _createClass(Region, [{\n\t key: 'bind',\n\t value: function bind(element, gesture, handler, capture, bindOnce) {\n\t if (!element || element && !element.tagName) {\n\t throw 'Bind must contain an element';\n\t }\n\t\n\t bindOnce = typeof bindOnce !== 'undefined' ? bindOnce : false;\n\t if (!gesture) {\n\t return new _Binder2.default(element, bindOnce, this.state);\n\t } else {\n\t this.state.addBinding(element, gesture, handler, capture, bindOnce);\n\t }\n\t }\n\t\n\t /**\n\t * Bind an element and sets up actions to remove the binding once\n\t * it has been emitted for the first time.\n\t * 1. bind(element) - chainable\n\t * 2. bind(element, gesture, handler, [capture])\n\t * @param {Element} element - The element object.\n\t * @param {String|Object} gesture - Gesture key, or a Gesture object.\n\t * @param {Function} handler - The function to execute when an\n\t * event is emitted.\n\t * @param {Boolean} capture - capture/bubble\n\t * @return {Object} - a chainable object that has the same function as bind.\n\t */\n\t\n\t }, {\n\t key: 'bindOnce',\n\t value: function bindOnce(element, gesture, handler, capture) {\n\t this.bind(element, gesture, handler, capture, true);\n\t }\n\t\n\t /**\n\t * Unbinds an element from either the specified gesture\n\t * or all if no element is specified.\n\t * @param {Element} element -The element to remove.\n\t * @param {String | Object} [gesture] - A String representing the gesture,\n\t * or the actual object being used.\n\t * @return {Array} - An array of Bindings that were unbound to the element;\n\t */\n\t\n\t }, {\n\t key: 'unbind',\n\t value: function unbind(element, gesture) {\n\t var _this2 = this;\n\t\n\t var bindings = this.state.retrieveBindingsByElement(element);\n\t var unbound = [];\n\t\n\t bindings.forEach(function (binding) {\n\t if (gesture) {\n\t if (typeof gesture === 'string' && _this2.state.registeredGestures[gesture]) {\n\t var registeredGesture = _this2.state.registeredGestures[gesture];\n\t if (registeredGesture.id === binding.gesture.id) {\n\t element.removeEventListener(binding.gesture.getId(), binding.handler, binding.capture);\n\t unbound.push(binding);\n\t }\n\t }\n\t } else {\n\t element.removeEventListener(binding.gesture.getId(), binding.handler, binding.capture);\n\t unbound.push(binding);\n\t }\n\t });\n\t\n\t return unbound;\n\t }\n\t\n\t /* unbind*/\n\t\n\t /**\n\t * Registers a new gesture with an assigned key\n\t * @param {String} key - The key used to register an element to that gesture\n\t * @param {Gesture} gesture - A gesture object\n\t */\n\t\n\t }, {\n\t key: 'register',\n\t value: function register(key, gesture) {\n\t if (typeof key !== 'string') {\n\t throw new Error('Parameter key is an invalid string');\n\t }\n\t\n\t if (!gesture instanceof _Gesture2.default) {\n\t throw new Error('Parameter gesture is an invalid Gesture object');\n\t }\n\t\n\t gesture.setType(key);\n\t this.state.registerGesture(gesture, key);\n\t }\n\t\n\t /* register*/\n\t\n\t /**\n\t * Un-registers a gesture from the Region's state such that\n\t * it is no longer emittable.\n\t * Unbinds all events that were registered with the type.\n\t * @param {String|Object} key - Gesture key that was used to\n\t * register the object\n\t * @return {Object} - The Gesture object that was unregistered\n\t * or null if it could not be found.\n\t */\n\t\n\t }, {\n\t key: 'unregister',\n\t value: function unregister(key) {\n\t this.state.bindings.forEach(function (binding) {\n\t if (binding.gesture.getType() === key) {\n\t binding.element.removeEventListener(binding.gesture.getId(), binding.handler, binding.capture);\n\t }\n\t });\n\t\n\t var registeredGesture = this.state.registeredGestures[key];\n\t delete this.state.registeredGestures[key];\n\t return registeredGesture;\n\t }\n\t }]);\n\t\n\t return Region;\n\t}();\n\t\n\texports.default = Region;\n\n/***/ },\n/* 3 */\n/***/ function(module, exports) {\n\n\t\"use strict\";\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\t/**\n\t * @file Binder.js\n\t */\n\t\n\t/**\n\t * A chainable object that contains a single element to be bound upon.\n\t * Called from ZingTouch.bind(), and is used to chain over gesture callbacks.\n\t * @class\n\t */\n\tvar Binder =\n\t/**\n\t * Constructor function for the Binder class.\n\t * @param {Element} element - The element to bind gestures to.\n\t * @param {Boolean} bindOnce - Option to bind once and only emit\n\t * the event once.\n\t * @param {Object} state - The state of the Region that is being bound to.\n\t * @return {Object} - Returns 'this' to be chained over and over again.\n\t */\n\tfunction Binder(element, bindOnce, state) {\n\t var _this = this;\n\t\n\t _classCallCheck(this, Binder);\n\t\n\t /**\n\t * The element to bind gestures to.\n\t * @type {Element}\n\t */\n\t this.element = element;\n\t\n\t Object.keys(state.registeredGestures).forEach(function (key) {\n\t _this[key] = function (handler, capture) {\n\t state.addBinding(_this.element, key, handler, capture, bindOnce);\n\t return _this;\n\t };\n\t });\n\t};\n\t\n\texports.default = Binder;\n\n/***/ },\n/* 4 */\n/***/ function(module, exports) {\n\n\t\"use strict\";\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\t/**\n\t * @file Gesture.js\n\t * Contains the Gesture class\n\t */\n\t\n\t/**\n\t * The Gesture class that all gestures inherit from.\n\t */\n\tvar Gesture = function () {\n\t /**\n\t * Constructor function for the Gesture class.\n\t * @class Gesture\n\t */\n\t function Gesture() {\n\t _classCallCheck(this, Gesture);\n\t\n\t /**\n\t * The generic string type of gesture ('expand'|'pan'|'pinch'|\n\t * 'rotate'|'swipe'|'tap').\n\t * @type {String}\n\t */\n\t this.type = null;\n\t\n\t /**\n\t * The unique identifier for each gesture determined at bind time by the\n\t * state object. This allows for distinctions across instance variables of\n\t * Gestures that are created on the fly (e.g. Tap-1, Tap-2, etc).\n\t * @type {String|null}\n\t */\n\t this.id = null;\n\t }\n\t\n\t /**\n\t * Set the type of the gesture to be called during an event\n\t * @param {String} type - The unique identifier of the gesture being created.\n\t */\n\t\n\t\n\t _createClass(Gesture, [{\n\t key: \"setType\",\n\t value: function setType(type) {\n\t this.type = type;\n\t }\n\t\n\t /**\n\t * getType() - Returns the generic type of the gesture\n\t * @return {String} - The type of gesture\n\t */\n\t\n\t }, {\n\t key: \"getType\",\n\t value: function getType() {\n\t return this.type;\n\t }\n\t\n\t /**\n\t * Set the id of the gesture to be called during an event\n\t * @param {String} id - The unique identifier of the gesture being created.\n\t */\n\t\n\t }, {\n\t key: \"setId\",\n\t value: function setId(id) {\n\t this.id = id;\n\t }\n\t\n\t /**\n\t * Return the id of the event. If the id does not exist, return the type.\n\t * @return {String}\n\t */\n\t\n\t }, {\n\t key: \"getId\",\n\t value: function getId() {\n\t return this.id !== null ? this.id : this.type;\n\t }\n\t\n\t /**\n\t * Updates internal properties with new ones, only if the properties exist.\n\t * @param {Object} object\n\t */\n\t\n\t }, {\n\t key: \"update\",\n\t value: function update(object) {\n\t for (var key in object) {\n\t if (this[key]) {\n\t this[key] = object[key];\n\t }\n\t }\n\t }\n\t\n\t /**\n\t * start() - Event hook for the start of a gesture\n\t * @param {Array} inputs - The array of Inputs on the screen\n\t * @return {null|Object} - Default of null\n\t */\n\t\n\t }, {\n\t key: \"start\",\n\t value: function start(inputs) {\n\t return null;\n\t }\n\t\n\t /**\n\t * move() - Event hook for the move of a gesture\n\t * @param {Array} inputs - The array of Inputs on the screen\n\t * @param {Object} state - The state object of the current region.\n\t * @param {Element} element - The element associated to the binding.\n\t * @return {null|Object} - Default of null\n\t */\n\t\n\t }, {\n\t key: \"move\",\n\t value: function move(inputs, state, element) {\n\t return null;\n\t }\n\t\n\t /**\n\t * end() - Event hook for the move of a gesture\n\t * @param {Array} inputs - The array of Inputs on the screen\n\t * @return {null|Object} - Default of null\n\t */\n\t\n\t }, {\n\t key: \"end\",\n\t value: function end(inputs) {\n\t return null;\n\t }\n\t }]);\n\t\n\t return Gesture;\n\t}();\n\t\n\texports.default = Gesture;\n\n/***/ },\n/* 5 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _dispatcher = __webpack_require__(6);\n\t\n\tvar _dispatcher2 = _interopRequireDefault(_dispatcher);\n\t\n\tvar _interpreter = __webpack_require__(7);\n\t\n\tvar _interpreter2 = _interopRequireDefault(_interpreter);\n\t\n\tvar _util = __webpack_require__(8);\n\t\n\tvar _util2 = _interopRequireDefault(_util);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\t/**\n\t * Function that handles event flow, negotiating with the interpreter,\n\t * and dispatcher.\n\t * 1. Receiving all touch events in the window.\n\t * 2. Determining which gestures are linked to the target element.\n\t * 3. Negotiating with the Interpreter what event should occur.\n\t * 4. Sending events to the dispatcher to emit events to the target.\n\t * @param {Event} event - The event emitted from the window object.\n\t * @param {Object} region - The region object of the current listener.\n\t */\n\tfunction arbiter(event, region) {\n\t var state = region.state;\n\t\n\t /*\n\t Return if a gesture is not in progress and won't be. Also catches the case\n\t where a previous event is in a partial state (2 finger pan, waits for both\n\t inputs to reach touchend)\n\t */\n\t if (state.inputs.length === 0 && _util2.default.normalizeEvent(event.type) !== 'start') {\n\t return;\n\t }\n\t\n\t /*\n\t Check for 'stale' or events that lost focus\n\t (e.g. a pan goes off screen/off region.)\n\t Does not affect mobile devices.\n\t */\n\t if (typeof event.buttons !== 'undefined' && _util2.default.normalizeEvent(event.type) !== 'end' && event.buttons === 0) {\n\t state.resetInputs();\n\t return;\n\t }\n\t\n\t // Update the state with the new events. If the event is stopped, return;\n\t if (!state.updateInputs(event, region.element)) {\n\t return;\n\t }\n\t\n\t // Retrieve the initial target from any one of the inputs\n\t var bindings = state.retrieveBindingsByInitialPos();\n\t if (bindings.length > 0) {\n\t (function () {\n\t if (region.preventDefault) {\n\t _util2.default.setMSPreventDefault(region.element);\n\t event.preventDefault ? event.preventDefault() : event.returnValue = false;\n\t } else {\n\t _util2.default.removeMSPreventDefault(region.element);\n\t }\n\t\n\t var toBeDispatched = {};\n\t var gestures = (0, _interpreter2.default)(bindings, event, state);\n\t\n\t /* Determine the deepest path index to emit the event\n\t from, to avoid duplicate events being fired. */\n\t\n\t gestures.forEach(function (gesture) {\n\t var id = gesture.binding.gesture.id;\n\t if (toBeDispatched[id]) {\n\t var path = _util2.default.getPropagationPath(event);\n\t if (_util2.default.getPathIndex(path, gesture.binding.element) < _util2.default.getPathIndex(path, toBeDispatched[id].binding.element)) {\n\t toBeDispatched[id] = gesture;\n\t }\n\t } else {\n\t toBeDispatched[id] = gesture;\n\t }\n\t });\n\t\n\t Object.keys(toBeDispatched).forEach(function (index) {\n\t var gesture = toBeDispatched[index];\n\t (0, _dispatcher2.default)(gesture.binding, gesture.data, gesture.events);\n\t });\n\t })();\n\t }\n\t\n\t var endCount = 0;\n\t state.inputs.forEach(function (input) {\n\t if (input.getCurrentEventType() === 'end') {\n\t endCount++;\n\t }\n\t });\n\t\n\t if (endCount === state.inputs.length) {\n\t state.resetInputs();\n\t }\n\t} /**\n\t * @file arbiter.js\n\t * Contains logic for the dispatcher\n\t */\n\t\n\texports.default = arbiter;\n\n/***/ },\n/* 6 */\n/***/ function(module, exports) {\n\n\t\"use strict\";\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t/**\n\t * @file dispatcher.js\n\t * Contains logic for the dispatcher\n\t */\n\t\n\t/**\n\t * Emits data at the target element if available, and bubbles up from\n\t * the target to the parent until the document has been reached.\n\t * Called from the arbiter.\n\t * @param {Binding} binding - An object of type Binding\n\t * @param {Object} data - The metadata computed by the gesture being emitted.\n\t * @param {Array} events - An array of ZingEvents\n\t * corresponding to the inputs on the screen.\n\t */\n\tfunction dispatcher(binding, data, events) {\n\t data.events = events;\n\t\n\t var newEvent = new CustomEvent(binding.gesture.getId(), {\n\t detail: data,\n\t bubbles: true,\n\t cancelable: true\n\t });\n\t emitEvent(binding.element, newEvent, binding);\n\t}\n\t\n\t/**\n\t * Emits the new event. Unbinds the event if the event was registered\n\t * at bindOnce.\n\t * @param {Element} target - Element object to emit the event to.\n\t * @param {Event} event - The CustomEvent to emit.\n\t * @param {Binding} binding - An object of type Binding\n\t */\n\tfunction emitEvent(target, event, binding) {\n\t target.dispatchEvent(event);\n\t if (binding.bindOnce) {\n\t ZingTouch.unbind(binding.element, binding.gesture.getType());\n\t }\n\t}\n\t\n\texports.default = dispatcher;\n\n/***/ },\n/* 7 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _util = __webpack_require__(8);\n\t\n\tvar _util2 = _interopRequireDefault(_util);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\t/**\n\t * Receives an event and an array of Bindings (element -> gesture handler)\n\t * to determine what event will be emitted. Called from the arbiter.\n\t * @param {Array} bindings - An array containing Binding objects\n\t * that associate the element to an event handler.\n\t * @param {Object} event - The event emitted from the window.\n\t * @param {Object} state - The state object of the current listener.\n\t * @return {Object | null} - Returns an object containing a binding and\n\t * metadata, or null if a gesture will not be emitted.\n\t */\n\tfunction interpreter(bindings, event, state) {\n\t var evType = _util2.default.normalizeEvent(event.type);\n\t var candidates = [];\n\t bindings.forEach(function (binding) {\n\t var result = binding.gesture[evType](state.inputs, state, binding.element);\n\t if (result) {\n\t (function () {\n\t var events = [];\n\t state.inputs.forEach(function (input) {\n\t events.push(input.current);\n\t });\n\t\n\t candidates.push({\n\t binding: binding,\n\t data: result,\n\t events: events\n\t });\n\t })();\n\t }\n\t });\n\t\n\t return candidates;\n\t} /**\n\t * @file interpreter.js\n\t * Contains logic for the interpreter\n\t */\n\t\n\texports.default = interpreter;\n\n/***/ },\n/* 8 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t/**\n\t * @file util.js\n\t * Various accessor and mutator functions to handle state and validation.\n\t */\n\t\n\tvar CIRCLE_DEGREES = 360;\n\tvar HALF_CIRCLE_DEGREES = 180;\n\t\n\t/**\n\t * Contains generic helper functions\n\t * @type {Object}\n\t * @namespace util\n\t */\n\tvar util = {\n\t\n\t /**\n\t * Normalizes window events to be either of type start, move, or end.\n\t * @param {String} type - The event type emitted by the browser\n\t * @return {null|String} - The normalized event, or null if it is an\n\t * event not predetermined.\n\t */\n\t normalizeEvent: function normalizeEvent(type) {\n\t switch (type) {\n\t case 'mousedown':\n\t case 'touchstart':\n\t case 'pointerdown':\n\t return 'start';\n\t case 'mousemove':\n\t case 'touchmove':\n\t case 'pointermove':\n\t return 'move';\n\t case 'mouseup':\n\t case 'touchend':\n\t case 'pointerup':\n\t return 'end';\n\t default:\n\t return null;\n\t }\n\t },\n\t\n\t /* normalizeEvent*/\n\t\n\t /**\n\t * Determines if the current and previous coordinates are within or\n\t * up to a certain tolerance.\n\t * @param {Number} currentX - Current event's x coordinate\n\t * @param {Number} currentY - Current event's y coordinate\n\t * @param {Number} previousX - Previous event's x coordinate\n\t * @param {Number} previousY - Previous event's y coordinate\n\t * @param {Number} tolerance - The tolerance in pixel value.\n\t * @return {boolean} - true if the current coordinates are\n\t * within the tolerance, false otherwise\n\t */\n\t isWithin: function isWithin(currentX, currentY, previousX, previousY, tolerance) {\n\t return Math.abs(currentY - previousY) <= tolerance && Math.abs(currentX - previousX) <= tolerance;\n\t },\n\t\n\t /* isWithin*/\n\t\n\t /**\n\t * Calculates the distance between two points.\n\t * @param {Number} x0\n\t * @param {Number} x1\n\t * @param {Number} y0\n\t * @param {Number} y1\n\t * @return {number} The numerical value between two points\n\t */\n\t distanceBetweenTwoPoints: function distanceBetweenTwoPoints(x0, x1, y0, y1) {\n\t var dist = Math.sqrt((x1 - x0) * (x1 - x0) + (y1 - y0) * (y1 - y0));\n\t return Math.round(dist * 100) / 100;\n\t },\n\t\n\t\n\t /**\n\t * Calculates the midpoint coordinates between two points.\n\t * @param {Number} x0\n\t * @param {Number} x1\n\t * @param {Number} y0\n\t * @param {Number} y1\n\t * @return {Object} The coordinates of the midpoint.\n\t */\n\t getMidpoint: function getMidpoint(x0, x1, y0, y1) {\n\t return {\n\t x: (x0 + x1) / 2,\n\t y: (y0 + y1) / 2\n\t };\n\t },\n\t\n\t /**\n\t * Calculates the angle between the projection and an origin point.\n\t * | (projectionX,projectionY)\n\t * | /°\n\t * | /\n\t * | /\n\t * | / θ\n\t * | /__________\n\t * ° (originX, originY)\n\t * @param {number} originX\n\t * @param {number} originY\n\t * @param {number} projectionX\n\t * @param {number} projectionY\n\t * @return {number} - Degree along the unit circle where the project lies\n\t */\n\t getAngle: function getAngle(originX, originY, projectionX, projectionY) {\n\t var angle = Math.atan2(projectionY - originY, projectionX - originX) * (HALF_CIRCLE_DEGREES / Math.PI);\n\t return CIRCLE_DEGREES - (angle < 0 ? CIRCLE_DEGREES + angle : angle);\n\t },\n\t\n\t /**\n\t * Calculates the angular distance in degrees between two angles\n\t * along the unit circle\n\t * @param {number} start - The starting point in degrees\n\t * @param {number} end - The ending point in degrees\n\t * @return {number} The number of degrees between the\n\t * starting point and ending point. Negative degrees denote a clockwise\n\t * direction, and positive a counter-clockwise direction.\n\t */\n\t getAngularDistance: function getAngularDistance(start, end) {\n\t var angle = (end - start) % CIRCLE_DEGREES;\n\t var sign = angle < 0 ? 1 : -1;\n\t angle = Math.abs(angle);\n\t return angle > HALF_CIRCLE_DEGREES ? sign * (CIRCLE_DEGREES - angle) : sign * angle;\n\t },\n\t\n\t\n\t /**\n\t * Calculates the velocity of pixel/milliseconds between two points\n\t * @param {Number} startX\n\t * @param {Number} startY\n\t * @param {Number} startTime\n\t * @param {Number} endX\n\t * @param {Number} endY\n\t * @param {Number} endTime\n\t * @return {Number} velocity of px/time\n\t */\n\t getVelocity: function getVelocity(startX, startY, startTime, endX, endY, endTime) {\n\t var distance = this.distanceBetweenTwoPoints(startX, endX, startY, endY);\n\t return distance / (endTime - startTime);\n\t },\n\t\n\t\n\t /**\n\t * Returns the farthest right input\n\t * @param {Array} inputs\n\t * @return {Object}\n\t */\n\t getRightMostInput: function getRightMostInput(inputs) {\n\t var rightMost = null;\n\t var distance = Number.MIN_VALUE;\n\t inputs.forEach(function (input) {\n\t if (input.initial.x > distance) {\n\t rightMost = input;\n\t }\n\t });\n\t return rightMost;\n\t },\n\t\n\t\n\t /**\n\t * Determines is the value is an integer and not a floating point\n\t * @param {Mixed} value\n\t * @return {boolean}\n\t */\n\t isInteger: function isInteger(value) {\n\t return typeof value === 'number' && value % 1 === 0;\n\t },\n\t\n\t\n\t /**\n\t * Determines if the x,y position of the input is within then target.\n\t * @param {Number} x -clientX\n\t * @param {Number} y -clientY\n\t * @param {Element} target\n\t * @return {Boolean}\n\t */\n\t isInside: function isInside(x, y, target) {\n\t var rect = target.getBoundingClientRect();\n\t return x > rect.left && x < rect.left + rect.width && y > rect.top && y < rect.top + rect.height;\n\t },\n\t\n\t /**\n\t * Polyfill for event.propagationPath\n\t * @param {Event} event\n\t * @return {Array}\n\t */\n\t getPropagationPath: function getPropagationPath(event) {\n\t if (event.path) {\n\t return event.path;\n\t } else {\n\t var path = [];\n\t var node = event.target;\n\t while (node != document) {\n\t path.push(node);\n\t node = node.parentNode;\n\t }\n\t\n\t return path;\n\t }\n\t },\n\t\n\t\n\t /**\n\t * Retrieve the index inside the path array\n\t * @param {Array} path\n\t * @param {Element} element\n\t * @return {Element}\n\t */\n\t getPathIndex: function getPathIndex(path, element) {\n\t var index = path.length;\n\t\n\t path.forEach(function (obj) {\n\t if (obj === element) {\n\t index = i;\n\t }\n\t });\n\t\n\t return index;\n\t },\n\t setMSPreventDefault: function setMSPreventDefault(element) {\n\t element.style['-ms-content-zooming'] = 'none';\n\t element.style['touch-action'] = 'none';\n\t },\n\t removeMSPreventDefault: function removeMSPreventDefault(element) {\n\t element.style['-ms-content-zooming'] = '';\n\t element.style['touch-action'] = '';\n\t }\n\t};\n\texports.default = util;\n\n/***/ },\n/* 9 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /**\n\t * @file State.js\n\t */\n\t\n\tvar _Gesture = __webpack_require__(4);\n\t\n\tvar _Gesture2 = _interopRequireDefault(_Gesture);\n\t\n\tvar _Expand = __webpack_require__(10);\n\t\n\tvar _Expand2 = _interopRequireDefault(_Expand);\n\t\n\tvar _Pan = __webpack_require__(12);\n\t\n\tvar _Pan2 = _interopRequireDefault(_Pan);\n\t\n\tvar _Pinch = __webpack_require__(13);\n\t\n\tvar _Pinch2 = _interopRequireDefault(_Pinch);\n\t\n\tvar _Rotate = __webpack_require__(14);\n\t\n\tvar _Rotate2 = _interopRequireDefault(_Rotate);\n\t\n\tvar _Swipe = __webpack_require__(15);\n\t\n\tvar _Swipe2 = _interopRequireDefault(_Swipe);\n\t\n\tvar _Tap = __webpack_require__(16);\n\t\n\tvar _Tap2 = _interopRequireDefault(_Tap);\n\t\n\tvar _Binding = __webpack_require__(17);\n\t\n\tvar _Binding2 = _interopRequireDefault(_Binding);\n\t\n\tvar _Input = __webpack_require__(18);\n\t\n\tvar _Input2 = _interopRequireDefault(_Input);\n\t\n\tvar _util = __webpack_require__(8);\n\t\n\tvar _util2 = _interopRequireDefault(_util);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tvar DEFAULT_MOUSE_ID = 0;\n\t\n\t/**\n\t * Creates an object related to a Region's state,\n\t * and contains helper methods to update and clean up different states.\n\t */\n\t\n\tvar State = function () {\n\t\n\t /**\n\t * Constructor for the State class.\n\t * @param {String} regionId - The id the region this state is bound to.\n\t */\n\t function State(regionId) {\n\t _classCallCheck(this, State);\n\t\n\t /**\n\t * The id for the region this state is bound to.\n\t * @type {String}\n\t */\n\t this.regionId = regionId;\n\t\n\t /**\n\t * An array of current and recently inactive\n\t * Input objects related to a gesture.\n\t * @type {Input}\n\t */\n\t this.inputs = [];\n\t\n\t /**\n\t * An array of Binding objects; The list of relations between elements,\n\t * their gestures, and the handlers.\n\t * @type {Binding}\n\t */\n\t this.bindings = [];\n\t\n\t /**\n\t * The number of gestures that have been registered with this state\n\t * @type {Number}\n\t */\n\t this.numGestures = 0;\n\t\n\t /**\n\t * A key/value map all the registered gestures for the listener.\n\t * Note: Can only have one gesture registered to one key.\n\t * @type {Object}\n\t */\n\t this.registeredGestures = {};\n\t\n\t this.registerGesture(new _Expand2.default(), 'expand');\n\t this.registerGesture(new _Pan2.default(), 'pan');\n\t this.registerGesture(new _Rotate2.default(), 'rotate');\n\t this.registerGesture(new _Pinch2.default(), 'pinch');\n\t this.registerGesture(new _Swipe2.default(), 'swipe');\n\t this.registerGesture(new _Tap2.default(), 'tap');\n\t }\n\t\n\t /**\n\t * Creates a new binding with the given element and gesture object.\n\t * If the gesture object provided is unregistered, it's reference\n\t * will be saved in as a binding to be later referenced.\n\t * @param {Element} element - The element the gesture is bound to.\n\t * @param {String|Object} gesture - Either a name of a registered gesture,\n\t * or an unregistered Gesture object.\n\t * @param {Function} handler - The function handler to be called\n\t * when the event is emitted. Used to bind/unbind.\n\t * @param {Boolean} capture - Whether the gesture is to be\n\t * detected in the capture of bubble phase. Used to bind/unbind.\n\t * @param {Boolean} bindOnce - Option to bind once and\n\t * only emit the event once.\n\t */\n\t\n\t\n\t _createClass(State, [{\n\t key: 'addBinding',\n\t value: function addBinding(element, gesture, handler, capture, bindOnce) {\n\t var boundGesture = void 0;\n\t\n\t // Error type checking.\n\t if (element && typeof element.tagName === 'undefined') {\n\t throw new Error('Parameter element is an invalid object.');\n\t }\n\t\n\t if (typeof handler !== 'function') {\n\t throw new Error('Parameter handler is invalid.');\n\t }\n\t\n\t if (typeof gesture === 'string' && Object.keys(this.registeredGestures).indexOf(gesture) === -1) {\n\t throw new Error('Parameter ' + gesture + ' is not a registered gesture');\n\t } else if ((typeof gesture === 'undefined' ? 'undefined' : _typeof(gesture)) === 'object' && !(gesture instanceof _Gesture2.default)) {\n\t throw new Error('Parameter for the gesture is not of a Gesture type');\n\t }\n\t\n\t if (typeof gesture === 'string') {\n\t boundGesture = this.registeredGestures[gesture];\n\t } else {\n\t boundGesture = gesture;\n\t if (boundGesture.id === '') {\n\t this.assignGestureId(boundGesture);\n\t }\n\t }\n\t\n\t this.bindings.push(new _Binding2.default(element, boundGesture, handler, capture, bindOnce));\n\t element.addEventListener(boundGesture.getId(), handler, capture);\n\t }\n\t\n\t /**\n\t * Retrieves the Binding by which an element is associated to.\n\t * @param {Element} element - The element to find bindings to.\n\t * @return {Array} - An array of Bindings to which that element is bound\n\t */\n\t\n\t }, {\n\t key: 'retrieveBindingsByElement',\n\t value: function retrieveBindingsByElement(element) {\n\t var matches = [];\n\t this.bindings.map(function (binding) {\n\t if (binding.element === element) {\n\t matches.push(binding);\n\t }\n\t });\n\t return matches;\n\t }\n\t\n\t /**\n\t * Retrieves all bindings based upon the initial X/Y position of the inputs.\n\t * e.g. if gesture started on the correct target element,\n\t * but diverted away into the correct region, this would still be valid.\n\t * @return {Array} - An array of Bindings to which that element is bound\n\t */\n\t\n\t }, {\n\t key: 'retrieveBindingsByInitialPos',\n\t value: function retrieveBindingsByInitialPos() {\n\t var _this = this;\n\t\n\t var matches = [];\n\t this.bindings.forEach(function (binding) {\n\t // Determine if at least one input is in the target element.\n\t // They should all be in the region based upon a prior check\n\t var inputsInside = _this.inputs.filter(function (input) {\n\t return _util2.default.isInside(input.initial.x, input.initial.y, binding.element);\n\t });\n\t if (inputsInside.length > 0) {\n\t matches.push(binding);\n\t }\n\t });\n\t return matches;\n\t }\n\t\n\t /**\n\t * Updates the inputs with new information based upon a new event being fired.\n\t * @param {Event} event - The event being captured.\n\t * @param {Element} regionElement - The element where\n\t * this current Region is bound to.\n\t * @return {boolean} - returns true for a successful update,\n\t * false if the event is invalid.\n\t */\n\t\n\t }, {\n\t key: 'updateInputs',\n\t value: function updateInputs(event, regionElement) {\n\t var identifier = DEFAULT_MOUSE_ID;\n\t var eventType = event.touches ? 'TouchEvent' : event.pointerType ? 'PointerEvent' : 'MouseEvent';\n\t\n\t switch (eventType) {\n\t case 'TouchEvent':\n\t // Return if all gestures did not originate from the same target\n\t if (event.touches.length !== event.targetTouches.length) {\n\t return false;\n\t }\n\t\n\t for (var index in event.changedTouches) {\n\t if (event.changedTouches.hasOwnProperty(index) && _util2.default.isInteger(parseInt(index))) {\n\t identifier = event.changedTouches[index].identifier;\n\t update(event, this, identifier, regionElement);\n\t }\n\t }\n\t break;\n\t\n\t case 'PointerEvent':\n\t identifier = event.pointerId;\n\t update(event, this, identifier, regionElement);\n\t break;\n\t\n\t case 'MouseEvent':\n\t default:\n\t update(event, this, DEFAULT_MOUSE_ID, regionElement);\n\t break;\n\t }\n\t return true;\n\t\n\t function update(event, state, identifier, regionElement) {\n\t var eventType = _util2.default.normalizeEvent(event.type);\n\t var input = findInputById(state.inputs, identifier);\n\t\n\t // A starting input was not cleaned up properly and still exists.\n\t if (eventType === 'start' && input) {\n\t state.resetInputs();\n\t return;\n\t }\n\t\n\t // An input has moved outside the region.\n\t if (eventType !== 'start' && input && !_util2.default.isInside(input.current.x, input.current.y, regionElement)) {\n\t state.resetInputs();\n\t return;\n\t }\n\t\n\t if (eventType !== 'start' && !input) {\n\t state.resetInputs();\n\t return;\n\t }\n\t\n\t if (eventType === 'start') {\n\t state.inputs.push(new _Input2.default(event, identifier));\n\t } else {\n\t input.update(event, identifier);\n\t }\n\t }\n\t }\n\t\n\t /**\n\t * Removes all inputs from the state, allowing for a new gesture.\n\t */\n\t\n\t }, {\n\t key: 'resetInputs',\n\t value: function resetInputs() {\n\t this.inputs = [];\n\t }\n\t\n\t /**\n\t * Counts the number of active inputs at any given time.\n\t * @return {Number} - The number of active inputs.\n\t */\n\t\n\t }, {\n\t key: 'numActiveInputs',\n\t value: function numActiveInputs() {\n\t var endType = this.inputs.filter(function (input) {\n\t return input.current.type !== 'end';\n\t });\n\t return endType.length;\n\t }\n\t\n\t /**\n\t * Register the gesture to the current region.\n\t * @param {Object} gesture - The gesture to register\n\t * @param {String} key - The key to define the new gesture as.\n\t */\n\t\n\t }, {\n\t key: 'registerGesture',\n\t value: function registerGesture(gesture, key) {\n\t this.assignGestureId(gesture);\n\t this.registeredGestures[key] = gesture;\n\t }\n\t\n\t /**\n\t * Tracks the gesture to this state object to become uniquely identifiable.\n\t * Useful for nested Regions.\n\t * @param {Gesture} gesture - The gesture to track\n\t */\n\t\n\t }, {\n\t key: 'assignGestureId',\n\t value: function assignGestureId(gesture) {\n\t gesture.setId(this.regionId + '-' + this.numGestures++);\n\t }\n\t }]);\n\t\n\t return State;\n\t}();\n\t/**\n\t * Searches through each input, comparing the browser's identifier key\n\t * for touches, to the stored one in each input\n\t * @param {Array} inputs - The array of inputs in state.\n\t * @param {String} identifier - The identifier the browser has assigned.\n\t * @return {Input} - The input object with the corresponding identifier,\n\t * null if it did not find any.\n\t */\n\t\n\t\n\tfunction findInputById(inputs, identifier) {\n\t for (var i = 0; i < inputs.length; i++) {\n\t if (inputs[i].identifier === identifier) {\n\t return inputs[i];\n\t }\n\t }\n\t\n\t return null;\n\t}\n\t\n\texports.default = State;\n\n/***/ },\n/* 10 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _Distance2 = __webpack_require__(11);\n\t\n\tvar _Distance3 = _interopRequireDefault(_Distance2);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /**\n\t * @file Expand.js\n\t * Contains the Expand class\n\t */\n\t\n\t/**\n\t * An Expand is defined as two inputs moving farther away from each other.\n\t * This gesture does not account for any start/end events to allow for the\n\t * event to interact with the Pan and Pinch events.\n\t * @class Expand\n\t */\n\tvar Expand = function (_Distance) {\n\t _inherits(Expand, _Distance);\n\t\n\t /**\n\t * Constructor function for the Expand class.\n\t * @param {object} options\n\t */\n\t function Expand(options) {\n\t _classCallCheck(this, Expand);\n\t\n\t /**\n\t * The type of the Gesture.\n\t * @type {String}\n\t */\n\t var _this = _possibleConstructorReturn(this, (Expand.__proto__ || Object.getPrototypeOf(Expand)).call(this, options));\n\t\n\t _this.type = 'expand';\n\t return _this;\n\t }\n\t\n\t return Expand;\n\t}(_Distance3.default);\n\t\n\texports.default = Expand;\n\n/***/ },\n/* 11 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _Gesture2 = __webpack_require__(4);\n\t\n\tvar _Gesture3 = _interopRequireDefault(_Gesture2);\n\t\n\tvar _util = __webpack_require__(8);\n\t\n\tvar _util2 = _interopRequireDefault(_util);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /**\n\t * @file Distance.js\n\t * Contains the abstract Distance class\n\t */\n\t\n\tvar DEFAULT_INPUTS = 2;\n\tvar DEFAULT_MIN_THRESHOLD = 1;\n\t\n\t/**\n\t * A Distance is defined as two inputs moving either together or apart.\n\t * @class Distance\n\t */\n\t\n\tvar Distance = function (_Gesture) {\n\t _inherits(Distance, _Gesture);\n\t\n\t /**\n\t * Constructor function for the Distance class.\n\t * @param {Object} options\n\t */\n\t function Distance(options) {\n\t _classCallCheck(this, Distance);\n\t\n\t /**\n\t * The type of the Gesture.\n\t * @type {String}\n\t */\n\t var _this = _possibleConstructorReturn(this, (Distance.__proto__ || Object.getPrototypeOf(Distance)).call(this));\n\t\n\t _this.type = 'distance';\n\t\n\t /**\n\t * The minimum amount in pixels the inputs must move until it is fired.\n\t * @type {Number}\n\t */\n\t _this.threshold = options && options.threshold ? options.threshold : DEFAULT_MIN_THRESHOLD;\n\t return _this;\n\t }\n\t\n\t /**\n\t * Event hook for the start of a gesture. Initialized the lastEmitted\n\t * gesture and stores it in the first input for reference events.\n\t * @param {Array} inputs\n\t */\n\t\n\t\n\t _createClass(Distance, [{\n\t key: 'start',\n\t value: function start(inputs) {\n\t if (inputs.length === DEFAULT_INPUTS) {\n\t // Store the progress in the first input.\n\t var progress = inputs[0].getGestureProgress(this.type);\n\t progress.lastEmittedDistance = _util2.default.distanceBetweenTwoPoints(inputs[0].current.x, inputs[1].current.x, inputs[0].current.y, inputs[1].current.y);\n\t }\n\t }\n\t\n\t /**\n\t * Event hook for the move of a gesture.\n\t * Determines if the two points are moved in the expected direction relative\n\t * to the current distance and the last distance.\n\t * @param {Array} inputs - The array of Inputs on the screen.\n\t * @param {Object} state - The state object of the current region.\n\t * @param {Element} element - The element associated to the binding.\n\t * @return {Object | null} - Returns the distance in pixels between two inputs\n\t */\n\t\n\t }, {\n\t key: 'move',\n\t value: function move(inputs, state, element) {\n\t if (state.numActiveInputs() === DEFAULT_INPUTS) {\n\t var currentDistance = _util2.default.distanceBetweenTwoPoints(inputs[0].current.x, inputs[1].current.x, inputs[0].current.y, inputs[1].current.y);\n\t var lastDistance = _util2.default.distanceBetweenTwoPoints(inputs[0].previous.x, inputs[1].previous.x, inputs[0].previous.y, inputs[1].previous.y);\n\t\n\t var centerPoint = _util2.default.getMidpoint(inputs[0].current.x, inputs[1].current.x, inputs[0].current.y, inputs[1].current.y);\n\t\n\t // Retrieve the first input's progress.\n\t var progress = inputs[0].getGestureProgress(this.type);\n\t\n\t if (this.type === 'expand') {\n\t if (currentDistance < lastDistance) {\n\t progress.lastEmittedDistance = currentDistance;\n\t } else if (currentDistance - progress.lastEmittedDistance >= this.threshold) {\n\t progress.lastEmittedDistance = currentDistance;\n\t return {\n\t distance: currentDistance,\n\t center: centerPoint\n\t };\n\t }\n\t } else {\n\t if (currentDistance > lastDistance) {\n\t progress.lastEmittedDistance = currentDistance;\n\t } else if (currentDistance < lastDistance && progress.lastEmittedDistance - currentDistance >= this.threshold) {\n\t progress.lastEmittedDistance = currentDistance;\n\t return {\n\t distance: currentDistance,\n\t center: centerPoint\n\t };\n\t }\n\t }\n\t\n\t return null;\n\t }\n\t }\n\t }]);\n\t\n\t return Distance;\n\t}(_Gesture3.default);\n\t\n\texports.default = Distance;\n\n/***/ },\n/* 12 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _Gesture2 = __webpack_require__(4);\n\t\n\tvar _Gesture3 = _interopRequireDefault(_Gesture2);\n\t\n\tvar _util = __webpack_require__(8);\n\t\n\tvar _util2 = _interopRequireDefault(_util);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /**\n\t * @file Pan.js\n\t * Contains the Pan class\n\t */\n\t\n\tvar DEFAULT_INPUTS = 1;\n\tvar DEFAULT_MIN_THRESHOLD = 1;\n\t\n\t/**\n\t * A Pan is defined as a normal movement in any direction on a screen.\n\t * Pan gestures do not track start events and can interact with pinch and \\\n\t * expand gestures.\n\t * @class Pan\n\t */\n\t\n\tvar Pan = function (_Gesture) {\n\t _inherits(Pan, _Gesture);\n\t\n\t /**\n\t * Constructor function for the Pan class.\n\t * @param {Object} [options] - The options object.\n\t * @param {Number} [options.numInputs=1] - Number of inputs for the\n\t * Pan gesture.\n\t * @param {Number} [options.threshold=1] - The minimum number of\n\t * pixels the input has to move to trigger this gesture.\n\t */\n\t function Pan(options) {\n\t _classCallCheck(this, Pan);\n\t\n\t /**\n\t * The type of the Gesture.\n\t * @type {String}\n\t */\n\t var _this = _possibleConstructorReturn(this, (Pan.__proto__ || Object.getPrototypeOf(Pan)).call(this));\n\t\n\t _this.type = 'pan';\n\t\n\t /**\n\t * The number of inputs to trigger a Pan can be variable,\n\t * and the maximum number being a factor of the browser.\n\t * @type {Number}\n\t */\n\t _this.numInputs = options && options.numInputs ? options.numInputs : DEFAULT_INPUTS;\n\t\n\t /**\n\t * The minimum amount in pixels the pan must move until it is fired.\n\t * @type {Number}\n\t */\n\t _this.threshold = options && options.threshold ? options.threshold : DEFAULT_MIN_THRESHOLD;\n\t return _this;\n\t }\n\t\n\t /**\n\t * Event hook for the start of a gesture. Marks each input as active,\n\t * so it can invalidate any end events.\n\t * @param {Array} inputs\n\t */\n\t\n\t\n\t _createClass(Pan, [{\n\t key: 'start',\n\t value: function start(inputs) {\n\t var _this2 = this;\n\t\n\t inputs.forEach(function (input) {\n\t var progress = input.getGestureProgress(_this2.getId());\n\t progress.active = true;\n\t progress.lastEmitted = {\n\t x: input.current.x,\n\t y: input.current.y\n\t };\n\t });\n\t }\n\t\n\t /**\n\t * move() - Event hook for the move of a gesture.\n\t * Fired whenever the input length is met, and keeps a boolean flag that\n\t * the gesture has fired at least once.\n\t * @param {Array} inputs - The array of Inputs on the screen\n\t * @param {Object} state - The state object of the current region.\n\t * @param {Element} element - The element associated to the binding.\n\t * @return {Object} - Returns the distance in pixels between the two inputs.\n\t */\n\t\n\t }, {\n\t key: 'move',\n\t value: function move(inputs, state, element) {\n\t if (this.numInputs === inputs.length) {\n\t var output = {\n\t data: []\n\t };\n\t for (var i = 0; i < inputs.length; i++) {\n\t var progress = inputs[i].getGestureProgress(this.getId());\n\t\n\t var reachedThreshold = false;\n\t\n\t // Check threshold distance\n\t var yThreshold = Math.abs(inputs[i].current.y - progress.lastEmitted.y) > this.threshold;\n\t var xThreshold = Math.abs(inputs[i].current.x - progress.lastEmitted.x) > this.threshold;\n\t reachedThreshold = yThreshold || xThreshold;\n\t\n\t if (progress.active && reachedThreshold) {\n\t output.data[i] = {\n\t distanceFromOrigin: _util2.default.distanceBetweenTwoPoints(inputs[i].initial.x, inputs[i].current.x, inputs[i].initial.y, inputs[i].current.y),\n\t directionFromOrigin: _util2.default.getAngle(inputs[i].initial.x, inputs[i].initial.y, inputs[i].current.x, inputs[i].current.y),\n\t currentDirection: _util2.default.getAngle(progress.lastEmitted.x, progress.lastEmitted.y, inputs[i].current.x, inputs[i].current.y)\n\t };\n\t progress.lastEmitted.x = inputs[i].current.x;\n\t progress.lastEmitted.y = inputs[i].current.y;\n\t } else {\n\t return null;\n\t }\n\t }\n\t }\n\t\n\t return output;\n\t }\n\t\n\t /* move*/\n\t\n\t /**\n\t * end() - Event hook for the end of a gesture. If the gesture has at least\n\t * fired once, then it ends on the first end event such that any remaining\n\t * inputs will not trigger the event until all inputs have reached the\n\t * touchend event. Any touchend->touchstart events that occur before all\n\t * inputs are fully off the screen should not fire.\n\t * @param {Array} inputs - The array of Inputs on the screen\n\t * @return {null} - null if the gesture is not to be emitted,\n\t * Object with information otherwise.\n\t */\n\t\n\t }, {\n\t key: 'end',\n\t value: function end(inputs) {\n\t var _this3 = this;\n\t\n\t inputs.forEach(function (input) {\n\t var progress = input.getGestureProgress(_this3.getId());\n\t progress.active = false;\n\t });\n\t return null;\n\t }\n\t\n\t /* end*/\n\t\n\t }]);\n\t\n\t return Pan;\n\t}(_Gesture3.default);\n\t\n\texports.default = Pan;\n\n/***/ },\n/* 13 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _Distance2 = __webpack_require__(11);\n\t\n\tvar _Distance3 = _interopRequireDefault(_Distance2);\n\t\n\tvar _util = __webpack_require__(8);\n\t\n\tvar _util2 = _interopRequireDefault(_util);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /**\n\t * @file Pinch.js\n\t * Contains the Pinch class\n\t */\n\t\n\t/**\n\t * An Pinch is defined as two inputs moving closer to each other.\n\t * This gesture does not account for any start/end events to allow for the event\n\t * to interact with the Pan and Pinch events.\n\t * @class Pinch\n\t */\n\tvar Pinch = function (_Distance) {\n\t _inherits(Pinch, _Distance);\n\t\n\t /**\n\t * Constructor function for the Pinch class.\n\t * @param {Object} options\n\t */\n\t function Pinch(options) {\n\t _classCallCheck(this, Pinch);\n\t\n\t /**\n\t * The type of the Gesture.\n\t * @type {String}\n\t */\n\t var _this = _possibleConstructorReturn(this, (Pinch.__proto__ || Object.getPrototypeOf(Pinch)).call(this, options));\n\t\n\t _this.type = 'pinch';\n\t return _this;\n\t }\n\t\n\t return Pinch;\n\t}(_Distance3.default);\n\t\n\texports.default = Pinch;\n\n/***/ },\n/* 14 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _Gesture2 = __webpack_require__(4);\n\t\n\tvar _Gesture3 = _interopRequireDefault(_Gesture2);\n\t\n\tvar _util = __webpack_require__(8);\n\t\n\tvar _util2 = _interopRequireDefault(_util);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /**\n\t * @file Rotate.js\n\t * Contains the Rotate class\n\t */\n\t\n\tvar MAX_INPUTS = 2;\n\t\n\t/**\n\t * A Rotate is defined as two inputs moving about a circle,\n\t * maintaining a relatively equal radius.\n\t * @class Rotate\n\t */\n\t\n\tvar Rotate = function (_Gesture) {\n\t _inherits(Rotate, _Gesture);\n\t\n\t /**\n\t * Constructor function for the Rotate class.\n\t */\n\t function Rotate() {\n\t _classCallCheck(this, Rotate);\n\t\n\t /**\n\t * The type of the Gesture.\n\t * @type {String}\n\t */\n\t var _this = _possibleConstructorReturn(this, (Rotate.__proto__ || Object.getPrototypeOf(Rotate)).call(this));\n\t\n\t _this.type = 'rotate';\n\t return _this;\n\t }\n\t\n\t /**\n\t * move() - Event hook for the move of a gesture. Obtains the midpoint of two\n\t * the two inputs and calculates the projection of the right most input along\n\t * a unit circle to obtain an angle. This angle is compared to the previously\n\t * calculated angle to output the change of distance, and is compared to the\n\t * initial angle to output the distance from the initial angle to the current\n\t * angle.\n\t * @param {Array} inputs - The array of Inputs on the screen\n\t * @param {Object} state - The state object of the current listener.\n\t * @param {Element} element - The element associated to the binding.\n\t * @return {null} - null if this event did not occur\n\t * @return {Object} obj.angle - The current angle along the unit circle\n\t * @return {Object} obj.distanceFromOrigin - The angular distance travelled\n\t * from the initial right most point.\n\t * @return {Object} obj.distanceFromLast - The change of angle between the\n\t * last position and the current position.\n\t */\n\t\n\t\n\t _createClass(Rotate, [{\n\t key: 'move',\n\t value: function move(inputs, state, element) {\n\t if (state.numActiveInputs() <= MAX_INPUTS) {\n\t var referencePivot = void 0;\n\t var diffX = void 0;\n\t var diffY = void 0;\n\t var input = void 0;\n\t if (state.numActiveInputs() === 1) {\n\t var bRect = element.getBoundingClientRect();\n\t referencePivot = {\n\t x: bRect.left + bRect.width / 2,\n\t y: bRect.top + bRect.height / 2\n\t };\n\t input = inputs[0];\n\t diffX = diffY = 0;\n\t } else {\n\t referencePivot = _util2.default.getMidpoint(inputs[0].initial.x, inputs[1].initial.x, inputs[0].initial.y, inputs[1].initial.y);\n\t var currentPivot = _util2.default.getMidpoint(inputs[0].current.x, inputs[1].current.x, inputs[0].current.y, inputs[1].current.y);\n\t diffX = referencePivot.x - currentPivot.x;\n\t diffY = referencePivot.y - currentPivot.y;\n\t input = _util2.default.getRightMostInput(inputs);\n\t }\n\t\n\t // Translate the current pivot point.\n\t var currentAngle = _util2.default.getAngle(referencePivot.x, referencePivot.y, input.current.x + diffX, input.current.y + diffY);\n\t\n\t var progress = input.getGestureProgress(this.getId());\n\t if (!progress.initialAngle) {\n\t progress.initialAngle = progress.previousAngle = currentAngle;\n\t progress.distance = progress.change = 0;\n\t } else {\n\t progress.change = _util2.default.getAngularDistance(progress.previousAngle, currentAngle);\n\t progress.distance = progress.distance + progress.change;\n\t }\n\t\n\t progress.previousAngle = currentAngle;\n\t\n\t return {\n\t angle: currentAngle,\n\t distanceFromOrigin: progress.distance,\n\t distanceFromLast: progress.change\n\t };\n\t }\n\t\n\t return null;\n\t }\n\t\n\t /* move*/\n\t\n\t }]);\n\t\n\t return Rotate;\n\t}(_Gesture3.default);\n\t\n\texports.default = Rotate;\n\n/***/ },\n/* 15 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _Gesture2 = __webpack_require__(4);\n\t\n\tvar _Gesture3 = _interopRequireDefault(_Gesture2);\n\t\n\tvar _util = __webpack_require__(8);\n\t\n\tvar _util2 = _interopRequireDefault(_util);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /**\n\t * @file Swipe.js\n\t * Contains the Swipe class\n\t */\n\t\n\tvar DEFAULT_INPUTS = 1;\n\tvar DEFAULT_MAX_REST_TIME = 100;\n\tvar DEFAULT_ESCAPE_VELOCITY = 0.2;\n\tvar DEFAULT_TIME_DISTORTION = 100;\n\tvar DEFAULT_MAX_PROGRESS_STACK = 10;\n\t\n\t/**\n\t * A swipe is defined as input(s) moving in the same direction in an relatively\n\t * increasing velocity and leaving the screen at some point before it drops\n\t * below it's escape velocity.\n\t * @class Swipe\n\t */\n\t\n\tvar Swipe = function (_Gesture) {\n\t _inherits(Swipe, _Gesture);\n\t\n\t /**\n\t * Constructor function for the Swipe class.\n\t * @param {Object} [options] - The options object.\n\t * @param {Number} [options.numInputs] - The number of inputs to trigger a\n\t * Swipe can be variable, and the maximum number being a factor of the browser\n\t * move and current move events.\n\t * @param {Number} [options.maxRestTime] - The maximum resting time a point\n\t * has between it's last\n\t * @param {Number} [options.escapeVelocity] - The minimum velocity the input\n\t * has to be at to emit a swipe.\n\t * @param {Number} [options.timeDistortion] - (EXPERIMENTAL) A value of time\n\t * in milliseconds to distort between events.\n\t * @param {Number} [options.maxProgressStack] - (EXPERIMENTAL)The maximum\n\t * amount of move events to keep\n\t * track of for a swipe.\n\t */\n\t function Swipe(options) {\n\t _classCallCheck(this, Swipe);\n\t\n\t /**\n\t * The type of the Gesture\n\t * @type {String}\n\t */\n\t var _this = _possibleConstructorReturn(this, (Swipe.__proto__ || Object.getPrototypeOf(Swipe)).call(this));\n\t\n\t _this.type = 'swipe';\n\t\n\t /**\n\t * The number of inputs to trigger a Swipe can be variable,\n\t * and the maximum number being a factor of the browser.\n\t * @type {Number}\n\t */\n\t _this.numInputs = options && options.numInputs ? options.numInputs : DEFAULT_INPUTS;\n\t\n\t /**\n\t * The maximum resting time a point has between it's last move and\n\t * current move events.\n\t * @type {Number}\n\t */\n\t _this.maxRestTime = options && options.maxRestTime ? options.maxRestTime : DEFAULT_MAX_REST_TIME;\n\t\n\t /**\n\t * The minimum velocity the input has to be at to emit a swipe.\n\t * This is useful for determining the difference between\n\t * a swipe and a pan gesture.\n\t * @type {number}\n\t */\n\t _this.escapeVelocity = options && options.escapeVelocity ? options.escapeVelocity : DEFAULT_ESCAPE_VELOCITY;\n\t\n\t /**\n\t * (EXPERIMENTAL) A value of time in milliseconds to distort between events.\n\t * Browsers do not accurately measure time with the Date constructor in\n\t * milliseconds, so consecutive events sometimes display the same timestamp\n\t * but different x/y coordinates. This will distort a previous time\n\t * in such cases by the timeDistortion's value.\n\t * @type {number}\n\t */\n\t _this.timeDistortion = options && options.timeDistortion ? options.timeDistortion : DEFAULT_TIME_DISTORTION;\n\t\n\t /**\n\t * (EXPERIMENTAL) The maximum amount of move events to keep track of for a\n\t * swipe. This helps give a more accurate estimate of the user's velocity.\n\t * @type {number}\n\t */\n\t _this.maxProgressStack = options && options.maxProgressStack ? options.maxProgressStack : DEFAULT_MAX_PROGRESS_STACK;\n\t return _this;\n\t }\n\t\n\t /**\n\t * Event hook for the move of a gesture. Captures an input's x/y coordinates\n\t * and the time of it's event on a stack.\n\t * @param {Array} inputs - The array of Inputs on the screen.\n\t * @param {Object} state - The state object of the current region.\n\t * @param {Element} element - The element associated to the binding.\n\t * @return {null} - Swipe does not emit from a move.\n\t */\n\t\n\t\n\t _createClass(Swipe, [{\n\t key: 'move',\n\t value: function move(inputs, state, element) {\n\t if (this.numInputs === inputs.length) {\n\t for (var i = 0; i < inputs.length; i++) {\n\t var progress = inputs[i].getGestureProgress(this.getId());\n\t if (!progress.moves) {\n\t progress.moves = [];\n\t }\n\t\n\t progress.moves.push({\n\t time: new Date().getTime(),\n\t x: inputs[i].current.x,\n\t y: inputs[i].current.y\n\t });\n\t\n\t if (progress.length > this.maxProgressStack) {\n\t progress.moves.shift();\n\t }\n\t }\n\t }\n\t\n\t return null;\n\t }\n\t\n\t /* move*/\n\t\n\t /**\n\t * Determines if the input's history validates a swipe motion.\n\t * Determines if it did not come to a complete stop (maxRestTime), and if it\n\t * had enough of a velocity to be considered (ESCAPE_VELOCITY).\n\t * @param {Array} inputs - The array of Inputs on the screen\n\t * @return {null|Object} - null if the gesture is not to be emitted,\n\t * Object with information otherwise.\n\t */\n\t\n\t }, {\n\t key: 'end',\n\t value: function end(inputs) {\n\t if (this.numInputs === inputs.length) {\n\t var output = {\n\t data: []\n\t };\n\t\n\t for (var i = 0; i < inputs.length; i++) {\n\t // Determine if all input events are on the 'end' event.\n\t if (inputs[i].current.type !== 'end') {\n\t return;\n\t }\n\t\n\t var progress = inputs[i].getGestureProgress(this.getId());\n\t if (progress.moves && progress.moves.length > 2) {\n\t // CHECK : Return if the input has not moved in maxRestTime ms.\n\t\n\t var currentMove = progress.moves.pop();\n\t if (new Date().getTime() - currentMove.time > this.maxRestTime) {\n\t return null;\n\t }\n\t\n\t var lastMove = void 0;\n\t var index = progress.moves.length - 1;\n\t\n\t /* Date is unreliable, so we retrieve the last move event where\n\t the time is not the same. */\n\t while (index !== -1) {\n\t if (progress.moves[index].time !== currentMove.time) {\n\t lastMove = progress.moves[index];\n\t break;\n\t }\n\t\n\t index--;\n\t }\n\t\n\t /* If the date is REALLY unreliable, we apply a time distortion\n\t to the last event.\n\t */\n\t if (!lastMove) {\n\t lastMove = progress.moves.pop();\n\t lastMove.time += this.timeDistortion;\n\t }\n\t\n\t var velocity = _util2.default.getVelocity(lastMove.x, lastMove.y, lastMove.time, currentMove.x, currentMove.y, currentMove.time);\n\t\n\t output.data[i] = {\n\t velocity: velocity,\n\t currentDirection: _util2.default.getAngle(lastMove.x, lastMove.y, currentMove.x, currentMove.y)\n\t };\n\t }\n\t }\n\t\n\t for (var i = 0; i < output.data.length; i++) {\n\t if (velocity < this.escapeVelocity) {\n\t return null;\n\t }\n\t }\n\t\n\t if (output.data.length > 0) {\n\t return output;\n\t }\n\t }\n\t\n\t return null;\n\t }\n\t\n\t /* end*/\n\t\n\t }]);\n\t\n\t return Swipe;\n\t}(_Gesture3.default);\n\t\n\texports.default = Swipe;\n\n/***/ },\n/* 16 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _Gesture2 = __webpack_require__(4);\n\t\n\tvar _Gesture3 = _interopRequireDefault(_Gesture2);\n\t\n\tvar _util = __webpack_require__(8);\n\t\n\tvar _util2 = _interopRequireDefault(_util);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /**\n\t * @file Tap.js\n\t * Contains the Tap class\n\t */\n\t\n\tvar DEFAULT_MIN_DELAY_MS = 0;\n\tvar DEFAULT_MAX_DELAY_MS = 300;\n\tvar DEFAULT_INPUTS = 1;\n\tvar DEFAULT_MOVE_PX_TOLERANCE = 10;\n\t\n\t/**\n\t * A Tap is defined as a touchstart to touchend event in quick succession.\n\t * @class Tap\n\t */\n\t\n\tvar Tap = function (_Gesture) {\n\t _inherits(Tap, _Gesture);\n\t\n\t /**\n\t * Constructor function for the Tap class.\n\t * @param {Object} [options] - The options object.\n\t * @param {Number} [options.minDelay=0] - The minimum delay between a\n\t * touchstart and touchend can be configured in milliseconds.\n\t * @param {Number} [options.maxDelay=300] - The maximum delay between a\n\t * touchstart and touchend can be configured in milliseconds.\n\t * @param {Number} [options.numInputs=1] - Number of inputs for Tap gesture.\n\t * @param {Number} [options.tolerance=10] - The tolerance in pixels\n\t * a user can move.\n\t */\n\t function Tap(options) {\n\t _classCallCheck(this, Tap);\n\t\n\t /**\n\t * The type of the Gesture.\n\t * @type {String}\n\t */\n\t var _this = _possibleConstructorReturn(this, (Tap.__proto__ || Object.getPrototypeOf(Tap)).call(this));\n\t\n\t _this.type = 'tap';\n\t\n\t /**\n\t * The minimum amount between a touchstart and a touchend can be configured\n\t * in milliseconds. The minimum delay starts to count down when the expected\n\t * number of inputs are on the screen, and ends when ALL inputs are off the\n\t * screen.\n\t * @type {Number}\n\t */\n\t _this.minDelay = options && options.minDelay ? options.minDelay : DEFAULT_MIN_DELAY_MS;\n\t\n\t /**\n\t * The maximum delay between a touchstart and touchend can be configured in\n\t * milliseconds. The maximum delay starts to count down when the expected\n\t * number of inputs are on the screen, and ends when ALL inputs are off the\n\t * screen.\n\t * @type {Number}\n\t */\n\t _this.maxDelay = options && options.maxDelay ? options.maxDelay : DEFAULT_MAX_DELAY_MS;\n\t\n\t /**\n\t * The number of inputs to trigger a Tap can be variable,\n\t * and the maximum number being a factor of the browser.\n\t * @type {Number}\n\t */\n\t _this.numInputs = options && options.numInputs ? options.numInputs : DEFAULT_INPUTS;\n\t\n\t /**\n\t * A move tolerance in pixels allows some slop between a user's start to end\n\t * events. This allows the Tap gesture to be triggered more easily.\n\t * @type {number}\n\t */\n\t _this.tolerance = options && options.tolerance ? options.tolerance : DEFAULT_MOVE_PX_TOLERANCE;\n\t return _this;\n\t }\n\t\n\t /* constructor*/\n\t\n\t /**\n\t * Event hook for the start of a gesture. Keeps track of when the inputs\n\t * trigger the start event.\n\t * @param {Array} inputs - The array of Inputs on the screen.\n\t * @return {null} - Tap does not trigger on a start event.\n\t */\n\t\n\t\n\t _createClass(Tap, [{\n\t key: 'start',\n\t value: function start(inputs) {\n\t var _this2 = this;\n\t\n\t if (inputs.length === this.numInputs) {\n\t inputs.forEach(function (input) {\n\t var progress = input.getGestureProgress(_this2.type);\n\t progress.start = new Date().getTime();\n\t });\n\t }\n\t\n\t return null;\n\t }\n\t\n\t /* start*/\n\t\n\t /**\n\t * Event hook for the move of a gesture. The Tap event reaches here if the\n\t * user starts to move their input before an 'end' event is reached.\n\t * @param {Array} inputs - The array of Inputs on the screen.\n\t * @param {Object} state - The state object of the current region.\n\t * @param {Element} element - The element associated to the binding.\n\t * @return {null} - Tap does not trigger on a move event.\n\t */\n\t\n\t }, {\n\t key: 'move',\n\t value: function move(inputs, state, element) {\n\t var _this3 = this;\n\t\n\t for (var i = 0; i < inputs.length; i++) {\n\t if (inputs[i].getCurrentEventType() === 'move') {\n\t var current = inputs[i].current;\n\t var previous = inputs[i].previous;\n\t if (!_util2.default.isWithin(current.x, current.y, previous.x, previous.y, this.tolerance)) {\n\t var _ret = function () {\n\t var type = _this3.type;\n\t inputs.forEach(function (input) {\n\t input.resetProgress(type);\n\t });\n\t\n\t return {\n\t v: null\n\t };\n\t }();\n\t\n\t if ((typeof _ret === 'undefined' ? 'undefined' : _typeof(_ret)) === \"object\") return _ret.v;\n\t }\n\t }\n\t }\n\t\n\t return null;\n\t }\n\t\n\t /* move*/\n\t\n\t /**\n\t * Event hook for the end of a gesture.\n\t * Determines if this the tap event can be fired if the delay and tolerance\n\t * constraints are met. Also waits for all of the inputs to be off the screen\n\t * before determining if the gesture is triggered.\n\t * @param {Array} inputs - The array of Inputs on the screen.\n\t * @return {null|Object} - null if the gesture is not to be emitted,\n\t * Object with information otherwise. Returns the interval time between start\n\t * and end events.\n\t */\n\t\n\t }, {\n\t key: 'end',\n\t value: function end(inputs) {\n\t var _this4 = this;\n\t\n\t if (inputs.length !== this.numInputs) {\n\t return null;\n\t }\n\t\n\t var startTime = Number.MAX_VALUE;\n\t for (var i = 0; i < inputs.length; i++) {\n\t if (inputs[i].getCurrentEventType() !== 'end') {\n\t return null;\n\t }\n\t\n\t var progress = inputs[i].getGestureProgress(this.type);\n\t if (!progress.start) {\n\t return null;\n\t }\n\t\n\t // Find the most recent input's startTime\n\t if (progress.start < startTime) {\n\t startTime = progress.start;\n\t }\n\t }\n\t\n\t var interval = new Date().getTime() - startTime;\n\t if (this.minDelay <= interval && this.maxDelay >= interval) {\n\t return {\n\t interval: interval\n\t };\n\t } else {\n\t var _ret2 = function () {\n\t var type = _this4.type;\n\t inputs.forEach(function (input) {\n\t input.resetProgress(type);\n\t });\n\t\n\t return {\n\t v: null\n\t };\n\t }();\n\t\n\t if ((typeof _ret2 === 'undefined' ? 'undefined' : _typeof(_ret2)) === \"object\") return _ret2.v;\n\t }\n\t }\n\t\n\t /* end*/\n\t\n\t }]);\n\t\n\t return Tap;\n\t}(_Gesture3.default);\n\t\n\texports.default = Tap;\n\n/***/ },\n/* 17 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\t/**\n\t * @file Binding.js\n\t */\n\t\n\t/**\n\t * Responsible for creating a binding between an element and a gesture.\n\t * @class Binding\n\t */\n\tvar Binding =\n\t/**\n\t * Constructor function for the Binding class.\n\t * @param {Element} element - The element to associate the gesture to.\n\t * @param {Gesture} gesture - A instance of the Gesture type.\n\t * @param {Function} handler - The function handler to execute when a\n\t * gesture is recognized\n\t * on the associated element.\n\t * @param {Boolean} [capture=false] - A boolean signifying if the event is\n\t * to be emitted during\n\t * the capture or bubble phase.\n\t * @param {Boolean} [bindOnce=false] - A boolean flag\n\t * used for the bindOnce syntax.\n\t */\n\tfunction Binding(element, gesture, handler, capture, bindOnce) {\n\t _classCallCheck(this, Binding);\n\t\n\t /**\n\t * The element to associate the gesture to.\n\t * @type {Element}\n\t */\n\t this.element = element;\n\t /**\n\t * A instance of the Gesture type.\n\t * @type {Gesture}\n\t */\n\t this.gesture = gesture;\n\t /**\n\t * The function handler to execute when a gesture is\n\t * recognized on the associated element.\n\t * @type {Function}\n\t */\n\t this.handler = handler;\n\t\n\t /**\n\t * A boolean signifying if the event is to be\n\t * emitted during the capture or bubble phase.\n\t * @type {Boolean}\n\t */\n\t this.capture = typeof capture !== 'undefined' ? capture : false;\n\t\n\t /**\n\t * A boolean flag used for the bindOnce syntax.\n\t * @type {Boolean}\n\t */\n\t this.bindOnce = typeof bindOnce !== 'undefined' ? bindOnce : false;\n\t};\n\t\n\texports.default = Binding;\n\n/***/ },\n/* 18 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /**\n\t * @file Input.js\n\t */\n\t\n\tvar _ZingEvent = __webpack_require__(19);\n\t\n\tvar _ZingEvent2 = _interopRequireDefault(_ZingEvent);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\t/**\n\t * Tracks a single input and contains information about the\n\t * current, previous, and initial events.\n\t * Contains the progress of each Input and it's associated gestures.\n\t * @class Input\n\t */\n\tvar Input = function () {\n\t\n\t /**\n\t * Constructor function for the Input class.\n\t * @param {Event} event - The Event object from the window\n\t * @param {Number} [identifier=0] - The identifier for each input event\n\t * (taken from event.changedTouches)\n\t */\n\t function Input(event, identifier) {\n\t _classCallCheck(this, Input);\n\t\n\t var currentEvent = new _ZingEvent2.default(event, identifier);\n\t\n\t /**\n\t * Holds the initial event object. A touchstart/mousedown event.\n\t * @type {ZingEvent}\n\t */\n\t this.initial = currentEvent;\n\t\n\t /**\n\t * Holds the most current event for this Input, disregarding any other past,\n\t * current, and future events that other Inputs participate in.\n\t * e.g. This event ended in an 'end' event, but another Input is still\n\t * participating in events -- this will not be updated in such cases.\n\t * @type {ZingEvent}\n\t */\n\t this.current = currentEvent;\n\t\n\t /**\n\t * Holds the previous event that took place.\n\t * @type {ZingEvent}\n\t */\n\t this.previous = currentEvent;\n\t\n\t /**\n\t * Refers to the event.touches index, or 0 if a simple mouse event occurred.\n\t * @type {Number}\n\t */\n\t this.identifier = typeof identifier !== 'undefined' ? identifier : 0;\n\t\n\t /**\n\t * Stores internal state between events for\n\t * each gesture based off of the gesture's id.\n\t * @type {Object}\n\t */\n\t this.progress = {};\n\t }\n\t\n\t /**\n\t * Receives an input, updates the internal state of what the input has done.\n\t * @param {Event} event - The event object to wrap with a ZingEvent.\n\t * @param {Number} touchIdentifier - The index of inputs, from event.touches\n\t */\n\t\n\t\n\t _createClass(Input, [{\n\t key: 'update',\n\t value: function update(event, touchIdentifier) {\n\t this.previous = this.current;\n\t this.current = new _ZingEvent2.default(event, touchIdentifier);\n\t }\n\t\n\t /**\n\t * Returns the progress of the specified gesture.\n\t * @param {String} id - The identifier for each unique Gesture's progress.\n\t * @return {Object} - The progress of the gesture.\n\t * Creates an empty object if no progress has begun.\n\t */\n\t\n\t }, {\n\t key: 'getGestureProgress',\n\t value: function getGestureProgress(id) {\n\t if (!this.progress[id]) {\n\t this.progress[id] = {};\n\t }\n\t return this.progress[id];\n\t }\n\t\n\t /**\n\t * Returns the normalized current Event's type.\n\t * @return {String} The current event's type ( start | move | end )\n\t */\n\t\n\t }, {\n\t key: 'getCurrentEventType',\n\t value: function getCurrentEventType() {\n\t return this.current.type;\n\t }\n\t\n\t /**\n\t * Resets a progress/state object of the specified gesture.\n\t * @param {String} id - The identifier of the specified gesture\n\t */\n\t\n\t }, {\n\t key: 'resetProgress',\n\t value: function resetProgress(id) {\n\t this.progress[id] = {};\n\t }\n\t }]);\n\t\n\t return Input;\n\t}();\n\t\n\texports.default = Input;\n\n/***/ },\n/* 19 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _util = __webpack_require__(8);\n\t\n\tvar _util2 = _interopRequireDefault(_util);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } } /**\n\t * @file ZingEvent.js\n\t * Contains logic for ZingEvents\n\t */\n\t\n\tvar INITIAL_COORDINATE = 0;\n\t/**\n\t * An event wrapper that normalizes events across browsers and input devices\n\t * @class ZingEvent\n\t */\n\t\n\tvar ZingEvent =\n\t/**\n\t * @constructor\n\t * @param {Event} event - The event object being wrapped.\n\t * @param {Array} event.touches - The number of touches on\n\t * a screen (mobile only).\n\t * @param {Object} event.changedTouches - The TouchList representing\n\t * points that participated in the event.\n\t * @param {Number} touchIdentifier - The index of touch if applicable\n\t */\n\tfunction ZingEvent(event, touchIdentifier) {\n\t _classCallCheck(this, ZingEvent);\n\t\n\t /**\n\t * The original event object.\n\t * @type {Event}\n\t */\n\t this.originalEvent = event;\n\t\n\t /**\n\t * The type of event or null if it is an event not predetermined.\n\t * @see util.normalizeEvent\n\t * @type {String | null}\n\t */\n\t this.type = _util2.default.normalizeEvent(event.type);\n\t\n\t /**\n\t * The X coordinate for the event, based off of the client.\n\t * @type {number}\n\t */\n\t this.x = INITIAL_COORDINATE;\n\t\n\t /**\n\t * The Y coordinate for the event, based off of the client.\n\t * @type {number}\n\t */\n\t this.y = INITIAL_COORDINATE;\n\t\n\t var eventObj = void 0;\n\t if (event.touches && event.changedTouches) {\n\t for (var i = 0; i < event.changedTouches.length; i++) {\n\t if (event.changedTouches[i].identifier === touchIdentifier) {\n\t eventObj = event.changedTouches[i];\n\t break;\n\t }\n\t }\n\t } else {\n\t eventObj = event;\n\t }\n\t\n\t this.x = this.clientX = eventObj.clientX;\n\t this.y = this.clientY = eventObj.clientY;\n\t\n\t this.pageX = eventObj.pageX;\n\t this.pageY = eventObj.pageY;\n\t\n\t this.screenX = eventObj.screenX;\n\t this.screenY = eventObj.screenY;\n\t};\n\t\n\texports.default = ZingEvent;\n\n/***/ }\n/******/ ]);\n\n\n// WEBPACK FOOTER //\n// ./dist/zingtouch.js"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 801e7c6a989db482d874","/**\n * @file main.js\n * Main file to setup event listeners on the document,\n * and to expose the ZingTouch object\n */\n\nimport ZingTouch from './../ZingTouch.js';\nwindow.ZingTouch = ZingTouch;\n\n\n\n// WEBPACK FOOTER //\n// ./src/core/main.js","/**\n * @file ZingTouch.js\n * Main object containing API methods and Gesture constructors\n */\n\nimport Region from './core/classes/Region.js';\nimport Gesture from './gestures/Gesture.js';\nimport Expand from './gestures/Expand.js';\nimport Pan from './gestures/Pan.js';\nimport Pinch from './gestures/Pinch.js';\nimport Rotate from './gestures/Rotate.js';\nimport Swipe from './gestures/Swipe.js';\nimport Tap from './gestures/Tap.js';\n\n/**\n * The global API interface for ZingTouch. Contains a constructor for the\n * Region Object, and constructors for each predefined Gesture.\n * @type {Object}\n * @namespace ZingTouch\n */\nlet ZingTouch = {\n _regions: [],\n\n // Constructors\n Gesture: Gesture,\n Expand: Expand,\n Pan: Pan,\n Pinch: Pinch,\n Rotate: Rotate,\n Swipe: Swipe,\n Tap: Tap,\n Region: function(element, capture, preventDefault) {\n let id = ZingTouch._regions.length;\n let region = new Region(element, capture, preventDefault, id);\n ZingTouch._regions.push(region);\n return region;\n },\n};\n\nexport default ZingTouch;\n\n\n\n// WEBPACK FOOTER //\n// ./src/ZingTouch.js","/**\n * @file Region.js\n */\n\nimport Binder from './Binder.js';\nimport Gesture from './../../gestures/Gesture.js';\nimport arbiter from './../arbiter.js';\nimport State from './State.js';\n\n/**\n * Allows the user to specify a region to capture all events to feed ZingTouch\n * into. This can be as narrow as the element itself, or as big as the document\n * itself. The more specific an area, the better performant the overall\n * application will perform. Contains API methods to bind/unbind specific\n * elements to corresponding gestures. Also contains the ability to\n * register/unregister new gestures.\n * @class Region\n */\nclass Region {\n\n /**\n * Constructor function for the Region class.\n * @param {Element} element - The element to capture all\n * window events in that region to feed into ZingTouch.\n * @param {boolean} [capture=false] - Whether the region listens for\n * captures or bubbles.\n * @param {boolean} [preventDefault=true] - Whether the default browser\n * functionality should be disabled;\n * @param {Number} id - The id of the region, assigned by the ZingTouch object\n */\n constructor(element, capture, preventDefault, id) {\n /**\n * The identifier for the Region. This is assigned by the ZingTouch object\n * and is used to hash gesture id for uniqueness.\n * @type {Number}\n */\n this.id = id;\n\n /**\n * The element being bound to.\n * @type {Element}\n */\n this.element = element;\n\n /**\n * Whether the region listens for captures or bubbles.\n * @type {boolean}\n */\n this.capture = (typeof capture !== 'undefined') ? capture : false;\n\n /**\n * Boolean to disable browser functionality such as scrolling and zooming\n * over the region\n * @type {boolean}\n */\n this.preventDefault = (typeof preventDefault !== 'undefined') ?\n preventDefault : true;\n\n /**\n * The internal state object for a Region.\n * Keeps track of registered gestures, inputs, and events.\n * @type {State}\n */\n this.state = new State(id);\n\n let eventNames = [];\n if (window.PointerEvent && !window.TouchEvent) {\n eventNames = [\n 'pointerdown',\n 'pointermove',\n 'pointerup',\n ];\n } else {\n eventNames = [\n 'mousedown',\n 'mousemove',\n 'mouseup',\n 'touchstart',\n 'touchmove',\n 'touchend',\n ];\n }\n\n // Bind detected browser events to the region element.\n eventNames.map((name) => {\n element.addEventListener(name, (e) => {\n arbiter(e, this);\n }, this.capture);\n });\n }\n\n /**\n * Bind an element to a registered/unregistered gesture with\n * multiple function signatures.\n * @example\n * bind(element) - chainable\n * @example\n * bind(element, gesture, handler, [capture])\n * @param {Element} element - The element object.\n * @param {String|Object} [gesture] - Gesture key, or a Gesture object.\n * @param {Function} [handler] - The function to execute when an event is\n * emitted.\n * @param {Boolean} [capture] - capture/bubble\n * @param {Boolean} [bindOnce = false] - Option to bind once and\n * only emit the event once.\n * @return {Object} - a chainable object that has the same function as bind.\n */\n bind(element, gesture, handler, capture, bindOnce) {\n if (!element || (element && !element.tagName)) {\n throw 'Bind must contain an element';\n }\n\n bindOnce = (typeof bindOnce !== 'undefined') ? bindOnce : false;\n if (!gesture) {\n return new Binder(element, bindOnce, this.state);\n } else {\n this.state.addBinding(element, gesture, handler, capture, bindOnce);\n }\n }\n\n /**\n * Bind an element and sets up actions to remove the binding once\n * it has been emitted for the first time.\n * 1. bind(element) - chainable\n * 2. bind(element, gesture, handler, [capture])\n * @param {Element} element - The element object.\n * @param {String|Object} gesture - Gesture key, or a Gesture object.\n * @param {Function} handler - The function to execute when an\n * event is emitted.\n * @param {Boolean} capture - capture/bubble\n * @return {Object} - a chainable object that has the same function as bind.\n */\n bindOnce(element, gesture, handler, capture) {\n this.bind(element, gesture, handler, capture, true);\n }\n\n /**\n * Unbinds an element from either the specified gesture\n * or all if no element is specified.\n * @param {Element} element -The element to remove.\n * @param {String | Object} [gesture] - A String representing the gesture,\n * or the actual object being used.\n * @return {Array} - An array of Bindings that were unbound to the element;\n */\n unbind(element, gesture) {\n let bindings = this.state.retrieveBindingsByElement(element);\n let unbound = [];\n\n bindings.forEach((binding) => {\n if (gesture) {\n if (typeof gesture === 'string' &&\n this.state.registeredGestures[gesture]) {\n let registeredGesture = this.state.registeredGestures[gesture];\n if (registeredGesture.id === binding.gesture.id) {\n element.removeEventListener(\n binding.gesture.getId(),\n binding.handler, binding.capture);\n unbound.push(binding);\n }\n }\n } else {\n element.removeEventListener(\n binding.gesture.getId(),\n binding.handler,\n binding.capture);\n unbound.push(binding);\n }\n });\n\n return unbound;\n }\n\n /* unbind*/\n\n /**\n * Registers a new gesture with an assigned key\n * @param {String} key - The key used to register an element to that gesture\n * @param {Gesture} gesture - A gesture object\n */\n register(key, gesture) {\n if (typeof key !== 'string') {\n throw new Error('Parameter key is an invalid string');\n }\n\n if (!gesture instanceof Gesture) {\n throw new Error('Parameter gesture is an invalid Gesture object');\n }\n\n gesture.setType(key);\n this.state.registerGesture(gesture, key);\n }\n\n /* register*/\n\n /**\n * Un-registers a gesture from the Region's state such that\n * it is no longer emittable.\n * Unbinds all events that were registered with the type.\n * @param {String|Object} key - Gesture key that was used to\n * register the object\n * @return {Object} - The Gesture object that was unregistered\n * or null if it could not be found.\n */\n unregister(key) {\n this.state.bindings.forEach((binding) => {\n if (binding.gesture.getType() === key) {\n binding.element.removeEventListener(binding.gesture.getId(),\n binding.handler, binding.capture);\n }\n });\n\n let registeredGesture = this.state.registeredGestures[key];\n delete this.state.registeredGestures[key];\n return registeredGesture;\n }\n}\n\nexport default Region;\n\n\n\n// WEBPACK FOOTER //\n// ./src/core/classes/Region.js","/**\n * @file Binder.js\n */\n\n/**\n * A chainable object that contains a single element to be bound upon.\n * Called from ZingTouch.bind(), and is used to chain over gesture callbacks.\n * @class\n */\nclass Binder {\n /**\n * Constructor function for the Binder class.\n * @param {Element} element - The element to bind gestures to.\n * @param {Boolean} bindOnce - Option to bind once and only emit\n * the event once.\n * @param {Object} state - The state of the Region that is being bound to.\n * @return {Object} - Returns 'this' to be chained over and over again.\n */\n constructor(element, bindOnce, state) {\n /**\n * The element to bind gestures to.\n * @type {Element}\n */\n this.element = element;\n\n Object.keys(state.registeredGestures).forEach((key) => {\n this[key] = (handler, capture) => {\n state.addBinding(this.element, key, handler, capture, bindOnce);\n return this;\n };\n });\n }\n\n}\n\nexport default Binder;\n\n\n\n// WEBPACK FOOTER //\n// ./src/core/classes/Binder.js","/**\n * @file Gesture.js\n * Contains the Gesture class\n */\n\n/**\n * The Gesture class that all gestures inherit from.\n */\nclass Gesture {\n /**\n * Constructor function for the Gesture class.\n * @class Gesture\n */\n constructor() {\n /**\n * The generic string type of gesture ('expand'|'pan'|'pinch'|\n * 'rotate'|'swipe'|'tap').\n * @type {String}\n */\n this.type = null;\n\n /**\n * The unique identifier for each gesture determined at bind time by the\n * state object. This allows for distinctions across instance variables of\n * Gestures that are created on the fly (e.g. Tap-1, Tap-2, etc).\n * @type {String|null}\n */\n this.id = null;\n }\n\n /**\n * Set the type of the gesture to be called during an event\n * @param {String} type - The unique identifier of the gesture being created.\n */\n setType(type) {\n this.type = type;\n }\n\n /**\n * getType() - Returns the generic type of the gesture\n * @return {String} - The type of gesture\n */\n getType() {\n return this.type;\n }\n\n /**\n * Set the id of the gesture to be called during an event\n * @param {String} id - The unique identifier of the gesture being created.\n */\n setId(id) {\n this.id = id;\n }\n\n /**\n * Return the id of the event. If the id does not exist, return the type.\n * @return {String}\n */\n getId() {\n return (this.id !== null) ? this.id : this.type;\n }\n\n /**\n * Updates internal properties with new ones, only if the properties exist.\n * @param {Object} object\n */\n update(object) {\n for (let key in object) {\n if (this[key]) {\n this[key] = object[key];\n }\n }\n }\n\n /**\n * start() - Event hook for the start of a gesture\n * @param {Array} inputs - The array of Inputs on the screen\n * @return {null|Object} - Default of null\n */\n start(inputs) {\n return null;\n }\n\n /**\n * move() - Event hook for the move of a gesture\n * @param {Array} inputs - The array of Inputs on the screen\n * @param {Object} state - The state object of the current region.\n * @param {Element} element - The element associated to the binding.\n * @return {null|Object} - Default of null\n */\n move(inputs, state, element) {\n return null;\n }\n\n /**\n * end() - Event hook for the move of a gesture\n * @param {Array} inputs - The array of Inputs on the screen\n * @return {null|Object} - Default of null\n */\n end(inputs) {\n return null;\n }\n\n}\n\nexport default Gesture;\n\n\n\n// WEBPACK FOOTER //\n// ./src/gestures/Gesture.js","/**\n * @file arbiter.js\n * Contains logic for the dispatcher\n */\n\nimport dispatcher from './dispatcher.js';\nimport interpreter from './interpreter.js';\nimport util from './util.js';\n\n/**\n * Function that handles event flow, negotiating with the interpreter,\n * and dispatcher.\n * 1. Receiving all touch events in the window.\n * 2. Determining which gestures are linked to the target element.\n * 3. Negotiating with the Interpreter what event should occur.\n * 4. Sending events to the dispatcher to emit events to the target.\n * @param {Event} event - The event emitted from the window object.\n * @param {Object} region - The region object of the current listener.\n */\nfunction arbiter(event, region) {\n const state = region.state;\n\n /*\n Return if a gesture is not in progress and won't be. Also catches the case\n where a previous event is in a partial state (2 finger pan, waits for both\n inputs to reach touchend)\n */\n if (state.inputs.length === 0 && util.normalizeEvent(event.type) !==\n 'start') {\n return;\n }\n\n /*\n Check for 'stale' or events that lost focus\n (e.g. a pan goes off screen/off region.)\n Does not affect mobile devices.\n */\n if (typeof event.buttons !== 'undefined' &&\n util.normalizeEvent(event.type) !== 'end' &&\n event.buttons === 0) {\n state.resetInputs();\n return;\n }\n\n // Update the state with the new events. If the event is stopped, return;\n if (!state.updateInputs(event, region.element)) {\n return;\n }\n\n // Retrieve the initial target from any one of the inputs\n const bindings = state.retrieveBindingsByInitialPos();\n if (bindings.length > 0) {\n if (region.preventDefault) {\n util.setMSPreventDefault(region.element);\n event.preventDefault ? event.preventDefault():(event.returnValue = false);\n } else {\n util.removeMSPreventDefault(region.element);\n }\n\n const toBeDispatched = {};\n const gestures = interpreter(bindings, event, state);\n\n /* Determine the deepest path index to emit the event\n from, to avoid duplicate events being fired. */\n\n gestures.forEach((gesture) => {\n const id = gesture.binding.gesture.id;\n if (toBeDispatched[id]) {\n const path = util.getPropagationPath(event);\n if (util.getPathIndex(path, gesture.binding.element) <\n util.getPathIndex(path, toBeDispatched[id].binding.element)) {\n toBeDispatched[id] = gesture;\n }\n } else {\n toBeDispatched[id] = gesture;\n }\n });\n\n Object.keys(toBeDispatched).forEach((index) => {\n const gesture = toBeDispatched[index];\n dispatcher(gesture.binding, gesture.data, gesture.events);\n });\n }\n\n let endCount = 0;\n state.inputs.forEach((input) => {\n if (input.getCurrentEventType() === 'end') {\n endCount++;\n }\n });\n\n if (endCount === state.inputs.length) {\n state.resetInputs();\n }\n}\n\nexport default arbiter;\n\n\n\n// WEBPACK FOOTER //\n// ./src/core/arbiter.js","/**\n * @file dispatcher.js\n * Contains logic for the dispatcher\n */\n\n/**\n * Emits data at the target element if available, and bubbles up from\n * the target to the parent until the document has been reached.\n * Called from the arbiter.\n * @param {Binding} binding - An object of type Binding\n * @param {Object} data - The metadata computed by the gesture being emitted.\n * @param {Array} events - An array of ZingEvents\n * corresponding to the inputs on the screen.\n */\nfunction dispatcher(binding, data, events) {\n data.events = events;\n\n const newEvent = new CustomEvent(binding.gesture.getId(), {\n detail: data,\n bubbles: true,\n cancelable: true,\n });\n emitEvent(binding.element, newEvent, binding);\n}\n\n/**\n * Emits the new event. Unbinds the event if the event was registered\n * at bindOnce.\n * @param {Element} target - Element object to emit the event to.\n * @param {Event} event - The CustomEvent to emit.\n * @param {Binding} binding - An object of type Binding\n */\nfunction emitEvent(target, event, binding) {\n target.dispatchEvent(event);\n if (binding.bindOnce) {\n ZingTouch.unbind(binding.element, binding.gesture.getType());\n }\n}\n\nexport default dispatcher;\n\n\n\n// WEBPACK FOOTER //\n// ./src/core/dispatcher.js","/**\n * @file interpreter.js\n * Contains logic for the interpreter\n */\n\nimport util from './util.js';\n\n/**\n * Receives an event and an array of Bindings (element -> gesture handler)\n * to determine what event will be emitted. Called from the arbiter.\n * @param {Array} bindings - An array containing Binding objects\n * that associate the element to an event handler.\n * @param {Object} event - The event emitted from the window.\n * @param {Object} state - The state object of the current listener.\n * @return {Object | null} - Returns an object containing a binding and\n * metadata, or null if a gesture will not be emitted.\n */\nfunction interpreter(bindings, event, state) {\n const evType = util.normalizeEvent(event.type);\n const candidates = [];\n bindings.forEach((binding) => {\n let result = binding.gesture[evType](state.inputs, state, binding.element);\n if (result) {\n const events = [];\n state.inputs.forEach((input) => {\n events.push(input.current);\n });\n\n candidates.push({\n binding: binding,\n data: result,\n events: events,\n });\n }\n });\n\n return candidates;\n}\n\nexport default interpreter;\n\n\n\n// WEBPACK FOOTER //\n// ./src/core/interpreter.js","/**\n * @file util.js\n * Various accessor and mutator functions to handle state and validation.\n */\n\nconst CIRCLE_DEGREES = 360;\nconst HALF_CIRCLE_DEGREES = 180;\n\n/**\n * Contains generic helper functions\n * @type {Object}\n * @namespace util\n */\nlet util = {\n\n /**\n * Normalizes window events to be either of type start, move, or end.\n * @param {String} type - The event type emitted by the browser\n * @return {null|String} - The normalized event, or null if it is an\n * event not predetermined.\n */\n normalizeEvent(type) {\n switch (type) {\n case 'mousedown' :\n case 'touchstart' :\n case 'pointerdown' :\n return 'start';\n case 'mousemove' :\n case 'touchmove' :\n case 'pointermove' :\n return 'move';\n case 'mouseup' :\n case 'touchend' :\n case 'pointerup' :\n return 'end';\n default :\n return null;\n }\n },\n /* normalizeEvent*/\n\n /**\n * Determines if the current and previous coordinates are within or\n * up to a certain tolerance.\n * @param {Number} currentX - Current event's x coordinate\n * @param {Number} currentY - Current event's y coordinate\n * @param {Number} previousX - Previous event's x coordinate\n * @param {Number} previousY - Previous event's y coordinate\n * @param {Number} tolerance - The tolerance in pixel value.\n * @return {boolean} - true if the current coordinates are\n * within the tolerance, false otherwise\n */\n isWithin(currentX, currentY, previousX, previousY, tolerance) {\n return ((Math.abs(currentY - previousY) <= tolerance) &&\n (Math.abs(currentX - previousX) <= tolerance));\n },\n /* isWithin*/\n\n /**\n * Calculates the distance between two points.\n * @param {Number} x0\n * @param {Number} x1\n * @param {Number} y0\n * @param {Number} y1\n * @return {number} The numerical value between two points\n */\n distanceBetweenTwoPoints(x0, x1, y0, y1) {\n let dist = (Math.sqrt(((x1 - x0) * (x1 - x0)) + ((y1 - y0) * (y1 - y0))));\n return Math.round(dist * 100) / 100;\n },\n\n /**\n * Calculates the midpoint coordinates between two points.\n * @param {Number} x0\n * @param {Number} x1\n * @param {Number} y0\n * @param {Number} y1\n * @return {Object} The coordinates of the midpoint.\n */\n getMidpoint(x0, x1, y0, y1) {\n return {\n x: ((x0 + x1) / 2),\n y: ((y0 + y1) / 2),\n };\n },\n /**\n * Calculates the angle between the projection and an origin point.\n * | (projectionX,projectionY)\n * | /°\n * | /\n * | /\n * | / θ\n * | /__________\n * ° (originX, originY)\n * @param {number} originX\n * @param {number} originY\n * @param {number} projectionX\n * @param {number} projectionY\n * @return {number} - Degree along the unit circle where the project lies\n */\n getAngle(originX, originY, projectionX, projectionY) {\n let angle = Math.atan2(projectionY - originY, projectionX - originX) *\n ((HALF_CIRCLE_DEGREES) / Math.PI);\n return CIRCLE_DEGREES - ((angle < 0) ? (CIRCLE_DEGREES + angle) : angle);\n },\n /**\n * Calculates the angular distance in degrees between two angles\n * along the unit circle\n * @param {number} start - The starting point in degrees\n * @param {number} end - The ending point in degrees\n * @return {number} The number of degrees between the\n * starting point and ending point. Negative degrees denote a clockwise\n * direction, and positive a counter-clockwise direction.\n */\n getAngularDistance(start, end) {\n let angle = (end - start) % CIRCLE_DEGREES;\n let sign = (angle < 0) ? 1 : -1;\n angle = Math.abs(angle);\n return (angle > HALF_CIRCLE_DEGREES) ?\n sign * (CIRCLE_DEGREES - angle) : sign * angle;\n },\n\n /**\n * Calculates the velocity of pixel/milliseconds between two points\n * @param {Number} startX\n * @param {Number} startY\n * @param {Number} startTime\n * @param {Number} endX\n * @param {Number} endY\n * @param {Number} endTime\n * @return {Number} velocity of px/time\n */\n getVelocity(startX, startY, startTime, endX, endY, endTime) {\n let distance = this.distanceBetweenTwoPoints(startX, endX, startY, endY);\n return (distance / (endTime - startTime));\n },\n\n /**\n * Returns the farthest right input\n * @param {Array} inputs\n * @return {Object}\n */\n getRightMostInput(inputs) {\n let rightMost = null;\n let distance = Number.MIN_VALUE;\n inputs.forEach((input) => {\n if (input.initial.x > distance) {\n rightMost = input;\n }\n });\n return rightMost;\n },\n\n /**\n * Determines is the value is an integer and not a floating point\n * @param {Mixed} value\n * @return {boolean}\n */\n isInteger(value) {\n return (typeof value === 'number') && (value % 1 === 0);\n },\n\n /**\n * Determines if the x,y position of the input is within then target.\n * @param {Number} x -clientX\n * @param {Number} y -clientY\n * @param {Element} target\n * @return {Boolean}\n */\n isInside(x, y, target) {\n const rect = target.getBoundingClientRect();\n return ((x > rect.left && x < rect.left + rect.width) &&\n (y > rect.top && y < rect.top + rect.height));\n },\n /**\n * Polyfill for event.propagationPath\n * @param {Event} event\n * @return {Array}\n */\n getPropagationPath(event) {\n if (event.path) {\n return event.path;\n } else {\n let path = [];\n let node = event.target;\n while (node != document) {\n path.push(node);\n node = node.parentNode;\n }\n\n return path;\n }\n },\n\n /**\n * Retrieve the index inside the path array\n * @param {Array} path\n * @param {Element} element\n * @return {Element}\n */\n getPathIndex(path, element) {\n let index = path.length;\n\n path.forEach((obj) => {\n if (obj === element) {\n index = i;\n }\n });\n\n return index;\n },\n\n setMSPreventDefault(element) {\n element.style['-ms-content-zooming'] = 'none';\n element.style['touch-action'] = 'none';\n },\n\n removeMSPreventDefault(element) {\n element.style['-ms-content-zooming'] = '';\n element.style['touch-action'] = '';\n },\n};\nexport default util;\n\n\n\n// WEBPACK FOOTER //\n// ./src/core/util.js","/**\n * @file State.js\n */\n\nimport Gesture from './../../gestures/Gesture.js';\nimport Expand from './../../gestures/Expand.js';\nimport Pan from './../../gestures/Pan.js';\nimport Pinch from './../../gestures/Pinch.js';\nimport Rotate from './../../gestures/Rotate.js';\nimport Swipe from './../../gestures/Swipe.js';\nimport Tap from './../../gestures/Tap.js';\nimport Binding from './Binding.js';\nimport Input from './Input.js';\nimport util from './../util.js';\n\nconst DEFAULT_MOUSE_ID = 0;\n\n/**\n * Creates an object related to a Region's state,\n * and contains helper methods to update and clean up different states.\n */\nclass State {\n\n /**\n * Constructor for the State class.\n * @param {String} regionId - The id the region this state is bound to.\n */\n constructor(regionId) {\n /**\n * The id for the region this state is bound to.\n * @type {String}\n */\n this.regionId = regionId;\n\n /**\n * An array of current and recently inactive\n * Input objects related to a gesture.\n * @type {Input}\n */\n this.inputs = [];\n\n /**\n * An array of Binding objects; The list of relations between elements,\n * their gestures, and the handlers.\n * @type {Binding}\n */\n this.bindings = [];\n\n /**\n * The number of gestures that have been registered with this state\n * @type {Number}\n */\n this.numGestures = 0;\n\n /**\n * A key/value map all the registered gestures for the listener.\n * Note: Can only have one gesture registered to one key.\n * @type {Object}\n */\n this.registeredGestures = {};\n\n this.registerGesture(new Expand(), 'expand');\n this.registerGesture(new Pan(), 'pan');\n this.registerGesture(new Rotate(), 'rotate');\n this.registerGesture(new Pinch(), 'pinch');\n this.registerGesture(new Swipe(), 'swipe');\n this.registerGesture(new Tap(), 'tap');\n }\n\n /**\n * Creates a new binding with the given element and gesture object.\n * If the gesture object provided is unregistered, it's reference\n * will be saved in as a binding to be later referenced.\n * @param {Element} element - The element the gesture is bound to.\n * @param {String|Object} gesture - Either a name of a registered gesture,\n * or an unregistered Gesture object.\n * @param {Function} handler - The function handler to be called\n * when the event is emitted. Used to bind/unbind.\n * @param {Boolean} capture - Whether the gesture is to be\n * detected in the capture of bubble phase. Used to bind/unbind.\n * @param {Boolean} bindOnce - Option to bind once and\n * only emit the event once.\n */\n addBinding(element, gesture, handler, capture, bindOnce) {\n let boundGesture;\n\n // Error type checking.\n if (element && typeof element.tagName === 'undefined') {\n throw new Error('Parameter element is an invalid object.');\n }\n\n if (typeof handler !== 'function') {\n throw new Error('Parameter handler is invalid.');\n }\n\n if (typeof gesture === 'string' &&\n Object.keys(this.registeredGestures).indexOf(gesture) === -1) {\n throw new Error('Parameter ' + gesture + ' is not a registered gesture');\n } else if (typeof gesture === 'object' && !(gesture instanceof Gesture)) {\n throw new Error('Parameter for the gesture is not of a Gesture type');\n }\n\n if (typeof gesture === 'string') {\n boundGesture = this.registeredGestures[gesture];\n } else {\n boundGesture = gesture;\n if (boundGesture.id === '') {\n this.assignGestureId(boundGesture);\n }\n }\n\n this.bindings.push(new Binding(element, boundGesture,\n handler, capture, bindOnce));\n element.addEventListener(boundGesture.getId(), handler, capture);\n }\n\n /**\n * Retrieves the Binding by which an element is associated to.\n * @param {Element} element - The element to find bindings to.\n * @return {Array} - An array of Bindings to which that element is bound\n */\n retrieveBindingsByElement(element) {\n let matches = [];\n this.bindings.map((binding) => {\n if (binding.element === element) {\n matches.push(binding);\n }\n });\n return matches;\n }\n\n /**\n * Retrieves all bindings based upon the initial X/Y position of the inputs.\n * e.g. if gesture started on the correct target element,\n * but diverted away into the correct region, this would still be valid.\n * @return {Array} - An array of Bindings to which that element is bound\n */\n retrieveBindingsByInitialPos() {\n let matches = [];\n this.bindings.forEach((binding) => {\n // Determine if at least one input is in the target element.\n // They should all be in the region based upon a prior check\n let inputsInside = this.inputs.filter((input) => {\n return util.isInside(input.initial.x, input.initial.y, binding.element);\n });\n if (inputsInside.length > 0) {\n matches.push(binding);\n }\n });\n return matches;\n }\n\n /**\n * Updates the inputs with new information based upon a new event being fired.\n * @param {Event} event - The event being captured.\n * @param {Element} regionElement - The element where\n * this current Region is bound to.\n * @return {boolean} - returns true for a successful update,\n * false if the event is invalid.\n */\n updateInputs(event, regionElement) {\n let identifier = DEFAULT_MOUSE_ID;\n let eventType = (event.touches) ?\n 'TouchEvent' : (event.pointerType) ? 'PointerEvent' : 'MouseEvent';\n\n switch (eventType) {\n case 'TouchEvent':\n // Return if all gestures did not originate from the same target\n if (event.touches.length !== event.targetTouches.length) {\n return false;\n }\n\n for (let index in event.changedTouches) {\n if (event.changedTouches.hasOwnProperty(index) &&\n util.isInteger((parseInt(index)))) {\n identifier = event.changedTouches[index].identifier;\n update(event, this, identifier, regionElement);\n }\n }\n break;\n\n case 'PointerEvent':\n identifier = event.pointerId;\n update(event, this, identifier, regionElement);\n break;\n\n case 'MouseEvent':\n default:\n update(event, this, DEFAULT_MOUSE_ID, regionElement);\n break;\n }\n return true;\n\n function update(event, state, identifier, regionElement) {\n let eventType = util.normalizeEvent(event.type);\n let input = findInputById(state.inputs, identifier);\n\n // A starting input was not cleaned up properly and still exists.\n if (eventType === 'start' && input) {\n state.resetInputs();\n return;\n }\n\n // An input has moved outside the region.\n if (eventType !== 'start' &&\n input &&\n !util.isInside(input.current.x, input.current.y, regionElement)) {\n state.resetInputs();\n return;\n }\n\n if (eventType !== 'start' && !input) {\n state.resetInputs();\n return;\n }\n\n if (eventType === 'start') {\n state.inputs.push(new Input(event, identifier));\n } else {\n input.update(event, identifier);\n }\n }\n }\n\n /**\n * Removes all inputs from the state, allowing for a new gesture.\n */\n resetInputs() {\n this.inputs = [];\n }\n\n /**\n * Counts the number of active inputs at any given time.\n * @return {Number} - The number of active inputs.\n */\n numActiveInputs() {\n let endType = this.inputs.filter((input) => {\n return input.current.type !== 'end';\n });\n return endType.length;\n }\n\n /**\n * Register the gesture to the current region.\n * @param {Object} gesture - The gesture to register\n * @param {String} key - The key to define the new gesture as.\n */\n registerGesture(gesture, key) {\n this.assignGestureId(gesture);\n this.registeredGestures[key] = gesture;\n }\n\n /**\n * Tracks the gesture to this state object to become uniquely identifiable.\n * Useful for nested Regions.\n * @param {Gesture} gesture - The gesture to track\n */\n assignGestureId(gesture) {\n gesture.setId(this.regionId + '-' + this.numGestures++);\n }\n\n}\n/**\n * Searches through each input, comparing the browser's identifier key\n * for touches, to the stored one in each input\n * @param {Array} inputs - The array of inputs in state.\n * @param {String} identifier - The identifier the browser has assigned.\n * @return {Input} - The input object with the corresponding identifier,\n * null if it did not find any.\n */\nfunction findInputById(inputs, identifier) {\n for (let i = 0; i < inputs.length; i++) {\n if (inputs[i].identifier === identifier) {\n return inputs[i];\n }\n }\n\n return null;\n}\n\nexport default State;\n\n\n\n// WEBPACK FOOTER //\n// ./src/core/classes/State.js","/**\n * @file Expand.js\n * Contains the Expand class\n */\n\nimport Distance from './Distance.js';\n\n/**\n * An Expand is defined as two inputs moving farther away from each other.\n * This gesture does not account for any start/end events to allow for the\n * event to interact with the Pan and Pinch events.\n * @class Expand\n */\nclass Expand extends Distance {\n\n /**\n * Constructor function for the Expand class.\n * @param {object} options\n */\n constructor(options) {\n super(options);\n\n /**\n * The type of the Gesture.\n * @type {String}\n */\n this.type = 'expand';\n }\n\n}\n\nexport default Expand;\n\n\n\n// WEBPACK FOOTER //\n// ./src/gestures/Expand.js","/**\n * @file Distance.js\n * Contains the abstract Distance class\n */\n\nimport Gesture from './Gesture.js';\nimport util from './../core/util.js';\n\nconst DEFAULT_INPUTS = 2;\nconst DEFAULT_MIN_THRESHOLD = 1;\n\n/**\n * A Distance is defined as two inputs moving either together or apart.\n * @class Distance\n */\nclass Distance extends Gesture {\n /**\n * Constructor function for the Distance class.\n * @param {Object} options\n */\n constructor(options) {\n super();\n\n /**\n * The type of the Gesture.\n * @type {String}\n */\n this.type = 'distance';\n\n /**\n * The minimum amount in pixels the inputs must move until it is fired.\n * @type {Number}\n */\n this.threshold = (options && options.threshold) ?\n options.threshold : DEFAULT_MIN_THRESHOLD;\n }\n\n /**\n * Event hook for the start of a gesture. Initialized the lastEmitted\n * gesture and stores it in the first input for reference events.\n * @param {Array} inputs\n */\n start(inputs) {\n if (inputs.length === DEFAULT_INPUTS) {\n // Store the progress in the first input.\n let progress = inputs[0].getGestureProgress(this.type);\n progress.lastEmittedDistance = util.distanceBetweenTwoPoints(\n inputs[0].current.x,\n inputs[1].current.x,\n inputs[0].current.y,\n inputs[1].current.y);\n }\n }\n\n /**\n * Event hook for the move of a gesture.\n * Determines if the two points are moved in the expected direction relative\n * to the current distance and the last distance.\n * @param {Array} inputs - The array of Inputs on the screen.\n * @param {Object} state - The state object of the current region.\n * @param {Element} element - The element associated to the binding.\n * @return {Object | null} - Returns the distance in pixels between two inputs\n */\n move(inputs, state, element) {\n if (state.numActiveInputs() === DEFAULT_INPUTS) {\n let currentDistance = util.distanceBetweenTwoPoints(\n inputs[0].current.x,\n inputs[1].current.x,\n inputs[0].current.y,\n inputs[1].current.y);\n let lastDistance = util.distanceBetweenTwoPoints(\n inputs[0].previous.x,\n inputs[1].previous.x,\n inputs[0].previous.y,\n inputs[1].previous.y);\n\n const centerPoint = util.getMidpoint(\n inputs[0].current.x,\n inputs[1].current.x,\n inputs[0].current.y,\n inputs[1].current.y);\n\n // Retrieve the first input's progress.\n let progress = inputs[0].getGestureProgress(this.type);\n\n if (this.type === 'expand') {\n if (currentDistance < lastDistance) {\n progress.lastEmittedDistance = currentDistance;\n } else if ((currentDistance - progress.lastEmittedDistance >=\n this.threshold)) {\n progress.lastEmittedDistance = currentDistance;\n return {\n distance: currentDistance,\n center: centerPoint,\n };\n }\n } else {\n if (currentDistance > lastDistance) {\n progress.lastEmittedDistance = currentDistance;\n } else if (currentDistance < lastDistance &&\n (progress.lastEmittedDistance - currentDistance >= this.threshold)) {\n progress.lastEmittedDistance = currentDistance;\n return {\n distance: currentDistance,\n center: centerPoint,\n };\n }\n }\n\n return null;\n }\n }\n}\n\nexport default Distance;\n\n\n\n// WEBPACK FOOTER //\n// ./src/gestures/Distance.js","/**\n * @file Pan.js\n * Contains the Pan class\n */\n\nimport Gesture from './Gesture.js';\nimport util from './../core/util.js';\n\nconst DEFAULT_INPUTS = 1;\nconst DEFAULT_MIN_THRESHOLD = 1;\n\n/**\n * A Pan is defined as a normal movement in any direction on a screen.\n * Pan gestures do not track start events and can interact with pinch and \\\n * expand gestures.\n * @class Pan\n */\nclass Pan extends Gesture {\n /**\n * Constructor function for the Pan class.\n * @param {Object} [options] - The options object.\n * @param {Number} [options.numInputs=1] - Number of inputs for the\n * Pan gesture.\n * @param {Number} [options.threshold=1] - The minimum number of\n * pixels the input has to move to trigger this gesture.\n */\n constructor(options) {\n super();\n\n /**\n * The type of the Gesture.\n * @type {String}\n */\n this.type = 'pan';\n\n /**\n * The number of inputs to trigger a Pan can be variable,\n * and the maximum number being a factor of the browser.\n * @type {Number}\n */\n this.numInputs = (options && options.numInputs) ?\n options.numInputs : DEFAULT_INPUTS;\n\n /**\n * The minimum amount in pixels the pan must move until it is fired.\n * @type {Number}\n */\n this.threshold = (options && options.threshold) ?\n options.threshold : DEFAULT_MIN_THRESHOLD;\n }\n\n /**\n * Event hook for the start of a gesture. Marks each input as active,\n * so it can invalidate any end events.\n * @param {Array} inputs\n */\n start(inputs) {\n inputs.forEach((input) => {\n let progress = input.getGestureProgress(this.getId());\n progress.active = true;\n progress.lastEmitted = {\n x: input.current.x,\n y: input.current.y,\n };\n });\n }\n\n /**\n * move() - Event hook for the move of a gesture.\n * Fired whenever the input length is met, and keeps a boolean flag that\n * the gesture has fired at least once.\n * @param {Array} inputs - The array of Inputs on the screen\n * @param {Object} state - The state object of the current region.\n * @param {Element} element - The element associated to the binding.\n * @return {Object} - Returns the distance in pixels between the two inputs.\n */\n move(inputs, state, element) {\n if (this.numInputs === inputs.length) {\n var output = {\n data: [],\n };\n for (let i = 0; i < inputs.length; i++) {\n let progress = inputs[i].getGestureProgress(this.getId());\n\n let reachedThreshold = false;\n\n // Check threshold distance\n const yThreshold = Math.abs(inputs[i].current.y -\n progress.lastEmitted.y) > this.threshold;\n const xThreshold = Math.abs(inputs[i].current.x -\n progress.lastEmitted.x) > this.threshold;\n reachedThreshold = yThreshold || xThreshold;\n\n if (progress.active && reachedThreshold) {\n output.data[i] = {\n distanceFromOrigin: util.distanceBetweenTwoPoints(\n inputs[i].initial.x,\n inputs[i].current.x,\n inputs[i].initial.y,\n inputs[i].current.y),\n directionFromOrigin: util.getAngle(\n inputs[i].initial.x,\n inputs[i].initial.y,\n inputs[i].current.x,\n inputs[i].current.y),\n currentDirection: util.getAngle(\n progress.lastEmitted.x,\n progress.lastEmitted.y,\n inputs[i].current.x,\n inputs[i].current.y),\n };\n progress.lastEmitted.x = inputs[i].current.x;\n progress.lastEmitted.y = inputs[i].current.y;\n } else {\n return null;\n }\n }\n }\n\n return output;\n }\n\n /* move*/\n\n /**\n * end() - Event hook for the end of a gesture. If the gesture has at least\n * fired once, then it ends on the first end event such that any remaining\n * inputs will not trigger the event until all inputs have reached the\n * touchend event. Any touchend->touchstart events that occur before all\n * inputs are fully off the screen should not fire.\n * @param {Array} inputs - The array of Inputs on the screen\n * @return {null} - null if the gesture is not to be emitted,\n * Object with information otherwise.\n */\n end(inputs) {\n inputs.forEach((input) => {\n let progress = input.getGestureProgress(this.getId());\n progress.active = false;\n });\n return null;\n }\n\n /* end*/\n}\n\nexport default Pan;\n\n\n\n// WEBPACK FOOTER //\n// ./src/gestures/Pan.js","/**\n * @file Pinch.js\n * Contains the Pinch class\n */\n\nimport Distance from './Distance.js';\nimport util from './../core/util.js';\n\n/**\n * An Pinch is defined as two inputs moving closer to each other.\n * This gesture does not account for any start/end events to allow for the event\n * to interact with the Pan and Pinch events.\n * @class Pinch\n */\nclass Pinch extends Distance {\n /**\n * Constructor function for the Pinch class.\n * @param {Object} options\n */\n constructor(options) {\n super(options);\n\n /**\n * The type of the Gesture.\n * @type {String}\n */\n this.type = 'pinch';\n }\n\n}\n\nexport default Pinch;\n\n\n\n// WEBPACK FOOTER //\n// ./src/gestures/Pinch.js","/**\n * @file Rotate.js\n * Contains the Rotate class\n */\n\nimport Gesture from './Gesture.js';\nimport util from './../core/util.js';\n\nconst MAX_INPUTS = 2;\n\n/**\n * A Rotate is defined as two inputs moving about a circle,\n * maintaining a relatively equal radius.\n * @class Rotate\n */\nclass Rotate extends Gesture {\n /**\n * Constructor function for the Rotate class.\n */\n constructor() {\n super();\n\n /**\n * The type of the Gesture.\n * @type {String}\n */\n this.type = 'rotate';\n }\n\n /**\n * move() - Event hook for the move of a gesture. Obtains the midpoint of two\n * the two inputs and calculates the projection of the right most input along\n * a unit circle to obtain an angle. This angle is compared to the previously\n * calculated angle to output the change of distance, and is compared to the\n * initial angle to output the distance from the initial angle to the current\n * angle.\n * @param {Array} inputs - The array of Inputs on the screen\n * @param {Object} state - The state object of the current listener.\n * @param {Element} element - The element associated to the binding.\n * @return {null} - null if this event did not occur\n * @return {Object} obj.angle - The current angle along the unit circle\n * @return {Object} obj.distanceFromOrigin - The angular distance travelled\n * from the initial right most point.\n * @return {Object} obj.distanceFromLast - The change of angle between the\n * last position and the current position.\n */\n move(inputs, state, element) {\n if (state.numActiveInputs() <= MAX_INPUTS) {\n let referencePivot;\n let diffX;\n let diffY;\n let input;\n if (state.numActiveInputs() === 1) {\n let bRect = element.getBoundingClientRect();\n referencePivot = {\n x: bRect.left + bRect.width / 2,\n y: bRect.top + bRect.height / 2,\n };\n input = inputs[0];\n diffX = diffY = 0;\n } else {\n referencePivot = util.getMidpoint(\n inputs[0].initial.x,\n inputs[1].initial.x,\n inputs[0].initial.y,\n inputs[1].initial.y);\n let currentPivot = util.getMidpoint(\n inputs[0].current.x,\n inputs[1].current.x,\n inputs[0].current.y,\n inputs[1].current.y);\n diffX = referencePivot.x - currentPivot.x;\n diffY = referencePivot.y - currentPivot.y;\n input = util.getRightMostInput(inputs);\n }\n\n // Translate the current pivot point.\n let currentAngle = util.getAngle(referencePivot.x, referencePivot.y,\n input.current.x + diffX, input.current.y + diffY);\n\n let progress = input.getGestureProgress(this.getId());\n if (!progress.initialAngle) {\n progress.initialAngle = progress.previousAngle = currentAngle;\n progress.distance = progress.change = 0;\n } else {\n progress.change = util.getAngularDistance(\n progress.previousAngle,\n currentAngle);\n progress.distance = progress.distance + progress.change;\n }\n\n progress.previousAngle = currentAngle;\n\n return {\n angle: currentAngle,\n distanceFromOrigin: progress.distance,\n distanceFromLast: progress.change,\n };\n }\n\n return null;\n }\n\n /* move*/\n}\n\nexport default Rotate;\n\n\n\n// WEBPACK FOOTER //\n// ./src/gestures/Rotate.js","/**\n * @file Swipe.js\n * Contains the Swipe class\n */\n\nimport Gesture from './Gesture.js';\nimport util from './../core/util.js';\n\nconst DEFAULT_INPUTS = 1;\nconst DEFAULT_MAX_REST_TIME = 100;\nconst DEFAULT_ESCAPE_VELOCITY = 0.2;\nconst DEFAULT_TIME_DISTORTION = 100;\nconst DEFAULT_MAX_PROGRESS_STACK = 10;\n\n/**\n * A swipe is defined as input(s) moving in the same direction in an relatively\n * increasing velocity and leaving the screen at some point before it drops\n * below it's escape velocity.\n * @class Swipe\n */\nclass Swipe extends Gesture {\n\n /**\n * Constructor function for the Swipe class.\n * @param {Object} [options] - The options object.\n * @param {Number} [options.numInputs] - The number of inputs to trigger a\n * Swipe can be variable, and the maximum number being a factor of the browser\n * move and current move events.\n * @param {Number} [options.maxRestTime] - The maximum resting time a point\n * has between it's last\n * @param {Number} [options.escapeVelocity] - The minimum velocity the input\n * has to be at to emit a swipe.\n * @param {Number} [options.timeDistortion] - (EXPERIMENTAL) A value of time\n * in milliseconds to distort between events.\n * @param {Number} [options.maxProgressStack] - (EXPERIMENTAL)The maximum\n * amount of move events to keep\n * track of for a swipe.\n */\n constructor(options) {\n super();\n /**\n * The type of the Gesture\n * @type {String}\n */\n this.type = 'swipe';\n\n /**\n * The number of inputs to trigger a Swipe can be variable,\n * and the maximum number being a factor of the browser.\n * @type {Number}\n */\n this.numInputs = (options && options.numInputs) ?\n options.numInputs : DEFAULT_INPUTS;\n\n /**\n * The maximum resting time a point has between it's last move and\n * current move events.\n * @type {Number}\n */\n this.maxRestTime = (options && options.maxRestTime) ?\n options.maxRestTime : DEFAULT_MAX_REST_TIME;\n\n /**\n * The minimum velocity the input has to be at to emit a swipe.\n * This is useful for determining the difference between\n * a swipe and a pan gesture.\n * @type {number}\n */\n this.escapeVelocity = (options && options.escapeVelocity) ?\n options.escapeVelocity : DEFAULT_ESCAPE_VELOCITY;\n\n /**\n * (EXPERIMENTAL) A value of time in milliseconds to distort between events.\n * Browsers do not accurately measure time with the Date constructor in\n * milliseconds, so consecutive events sometimes display the same timestamp\n * but different x/y coordinates. This will distort a previous time\n * in such cases by the timeDistortion's value.\n * @type {number}\n */\n this.timeDistortion = (options && options.timeDistortion) ?\n options.timeDistortion : DEFAULT_TIME_DISTORTION;\n\n /**\n * (EXPERIMENTAL) The maximum amount of move events to keep track of for a\n * swipe. This helps give a more accurate estimate of the user's velocity.\n * @type {number}\n */\n this.maxProgressStack = (options && options.maxProgressStack) ?\n options.maxProgressStack : DEFAULT_MAX_PROGRESS_STACK;\n }\n\n /**\n * Event hook for the move of a gesture. Captures an input's x/y coordinates\n * and the time of it's event on a stack.\n * @param {Array} inputs - The array of Inputs on the screen.\n * @param {Object} state - The state object of the current region.\n * @param {Element} element - The element associated to the binding.\n * @return {null} - Swipe does not emit from a move.\n */\n move(inputs, state, element) {\n if (this.numInputs === inputs.length) {\n for (let i = 0; i < inputs.length; i++) {\n let progress = inputs[i].getGestureProgress(this.getId());\n if (!progress.moves) {\n progress.moves = [];\n }\n\n progress.moves.push({\n time: new Date().getTime(),\n x: inputs[i].current.x,\n y: inputs[i].current.y,\n });\n\n if (progress.length > this.maxProgressStack) {\n progress.moves.shift();\n }\n }\n }\n\n return null;\n }\n\n /* move*/\n\n /**\n * Determines if the input's history validates a swipe motion.\n * Determines if it did not come to a complete stop (maxRestTime), and if it\n * had enough of a velocity to be considered (ESCAPE_VELOCITY).\n * @param {Array} inputs - The array of Inputs on the screen\n * @return {null|Object} - null if the gesture is not to be emitted,\n * Object with information otherwise.\n */\n end(inputs) {\n if (this.numInputs === inputs.length) {\n let output = {\n data: [],\n };\n\n for (var i = 0; i < inputs.length; i++) {\n // Determine if all input events are on the 'end' event.\n if (inputs[i].current.type !== 'end') {\n return;\n }\n\n let progress = inputs[i].getGestureProgress(this.getId());\n if (progress.moves && progress.moves.length > 2) {\n // CHECK : Return if the input has not moved in maxRestTime ms.\n\n let currentMove = progress.moves.pop();\n if ((new Date().getTime()) - currentMove.time > this.maxRestTime) {\n return null;\n }\n\n let lastMove;\n let index = progress.moves.length - 1;\n\n /* Date is unreliable, so we retrieve the last move event where\n the time is not the same. */\n while (index !== -1) {\n if (progress.moves[index].time !== currentMove.time) {\n lastMove = progress.moves[index];\n break;\n }\n\n index--;\n }\n\n /* If the date is REALLY unreliable, we apply a time distortion\n to the last event.\n */\n if (!lastMove) {\n lastMove = progress.moves.pop();\n lastMove.time += this.timeDistortion;\n }\n\n var velocity = util.getVelocity(lastMove.x, lastMove.y, lastMove.time,\n currentMove.x, currentMove.y, currentMove.time);\n\n output.data[i] = {\n velocity: velocity,\n currentDirection: util.getAngle(\n lastMove.x,\n lastMove.y,\n currentMove.x,\n currentMove.y),\n };\n }\n }\n\n for (var i = 0; i < output.data.length; i++) {\n if (velocity < this.escapeVelocity) {\n return null;\n }\n }\n\n if (output.data.length > 0) {\n return output;\n }\n }\n\n return null;\n }\n\n /* end*/\n}\n\nexport default Swipe;\n\n\n\n// WEBPACK FOOTER //\n// ./src/gestures/Swipe.js","/**\n * @file Tap.js\n * Contains the Tap class\n */\n\nimport Gesture from './Gesture.js';\nimport util from './../core/util.js';\n\nconst DEFAULT_MIN_DELAY_MS = 0;\nconst DEFAULT_MAX_DELAY_MS = 300;\nconst DEFAULT_INPUTS = 1;\nconst DEFAULT_MOVE_PX_TOLERANCE = 10;\n\n/**\n * A Tap is defined as a touchstart to touchend event in quick succession.\n * @class Tap\n */\nclass Tap extends Gesture {\n /**\n * Constructor function for the Tap class.\n * @param {Object} [options] - The options object.\n * @param {Number} [options.minDelay=0] - The minimum delay between a\n * touchstart and touchend can be configured in milliseconds.\n * @param {Number} [options.maxDelay=300] - The maximum delay between a\n * touchstart and touchend can be configured in milliseconds.\n * @param {Number} [options.numInputs=1] - Number of inputs for Tap gesture.\n * @param {Number} [options.tolerance=10] - The tolerance in pixels\n * a user can move.\n */\n constructor(options) {\n super();\n\n /**\n * The type of the Gesture.\n * @type {String}\n */\n this.type = 'tap';\n\n /**\n * The minimum amount between a touchstart and a touchend can be configured\n * in milliseconds. The minimum delay starts to count down when the expected\n * number of inputs are on the screen, and ends when ALL inputs are off the\n * screen.\n * @type {Number}\n */\n this.minDelay = (options && options.minDelay) ?\n options.minDelay : DEFAULT_MIN_DELAY_MS;\n\n /**\n * The maximum delay between a touchstart and touchend can be configured in\n * milliseconds. The maximum delay starts to count down when the expected\n * number of inputs are on the screen, and ends when ALL inputs are off the\n * screen.\n * @type {Number}\n */\n this.maxDelay = (options && options.maxDelay) ?\n options.maxDelay : DEFAULT_MAX_DELAY_MS;\n\n /**\n * The number of inputs to trigger a Tap can be variable,\n * and the maximum number being a factor of the browser.\n * @type {Number}\n */\n this.numInputs = (options && options.numInputs) ?\n options.numInputs : DEFAULT_INPUTS;\n\n /**\n * A move tolerance in pixels allows some slop between a user's start to end\n * events. This allows the Tap gesture to be triggered more easily.\n * @type {number}\n */\n this.tolerance = (options && options.tolerance) ?\n options.tolerance : DEFAULT_MOVE_PX_TOLERANCE;\n }\n\n /* constructor*/\n\n /**\n * Event hook for the start of a gesture. Keeps track of when the inputs\n * trigger the start event.\n * @param {Array} inputs - The array of Inputs on the screen.\n * @return {null} - Tap does not trigger on a start event.\n */\n start(inputs) {\n if (inputs.length === this.numInputs) {\n inputs.forEach((input) => {\n let progress = input.getGestureProgress(this.type);\n progress.start = new Date().getTime();\n });\n }\n\n return null;\n }\n\n /* start*/\n\n /**\n * Event hook for the move of a gesture. The Tap event reaches here if the\n * user starts to move their input before an 'end' event is reached.\n * @param {Array} inputs - The array of Inputs on the screen.\n * @param {Object} state - The state object of the current region.\n * @param {Element} element - The element associated to the binding.\n * @return {null} - Tap does not trigger on a move event.\n */\n move(inputs, state, element) {\n for (let i = 0; i < inputs.length; i++) {\n if (inputs[i].getCurrentEventType() === 'move') {\n let current = inputs[i].current;\n let previous = inputs[i].previous;\n if (!util.isWithin(\n current.x,\n current.y,\n previous.x,\n previous.y,\n this.tolerance)) {\n let type = this.type;\n inputs.forEach(function(input) {\n input.resetProgress(type);\n });\n\n return null;\n }\n }\n }\n\n return null;\n }\n\n /* move*/\n\n /**\n * Event hook for the end of a gesture.\n * Determines if this the tap event can be fired if the delay and tolerance\n * constraints are met. Also waits for all of the inputs to be off the screen\n * before determining if the gesture is triggered.\n * @param {Array} inputs - The array of Inputs on the screen.\n * @return {null|Object} - null if the gesture is not to be emitted,\n * Object with information otherwise. Returns the interval time between start\n * and end events.\n */\n end(inputs) {\n if (inputs.length !== this.numInputs) {\n return null;\n }\n\n let startTime = Number.MAX_VALUE;\n for (let i = 0; i < inputs.length; i++) {\n if (inputs[i].getCurrentEventType() !== 'end') {\n return null;\n }\n\n let progress = inputs[i].getGestureProgress(this.type);\n if (!progress.start) {\n return null;\n }\n\n // Find the most recent input's startTime\n if (progress.start < startTime) {\n startTime = progress.start;\n }\n }\n\n let interval = new Date().getTime() - startTime;\n if ((this.minDelay <= interval) && (this.maxDelay >= interval)) {\n return {\n interval: interval,\n };\n } else {\n let type = this.type;\n inputs.forEach(function(input) {\n input.resetProgress(type);\n });\n\n return null;\n }\n }\n\n /* end*/\n}\n\nexport default Tap;\n\n\n\n// WEBPACK FOOTER //\n// ./src/gestures/Tap.js","/**\n * @file Binding.js\n */\n\n/**\n * Responsible for creating a binding between an element and a gesture.\n * @class Binding\n */\nclass Binding {\n /**\n * Constructor function for the Binding class.\n * @param {Element} element - The element to associate the gesture to.\n * @param {Gesture} gesture - A instance of the Gesture type.\n * @param {Function} handler - The function handler to execute when a\n * gesture is recognized\n * on the associated element.\n * @param {Boolean} [capture=false] - A boolean signifying if the event is\n * to be emitted during\n * the capture or bubble phase.\n * @param {Boolean} [bindOnce=false] - A boolean flag\n * used for the bindOnce syntax.\n */\n constructor(element, gesture, handler, capture, bindOnce) {\n /**\n * The element to associate the gesture to.\n * @type {Element}\n */\n this.element = element;\n /**\n * A instance of the Gesture type.\n * @type {Gesture}\n */\n this.gesture = gesture;\n /**\n * The function handler to execute when a gesture is\n * recognized on the associated element.\n * @type {Function}\n */\n this.handler = handler;\n\n /**\n * A boolean signifying if the event is to be\n * emitted during the capture or bubble phase.\n * @type {Boolean}\n */\n this.capture = (typeof capture !== 'undefined') ? capture : false;\n\n /**\n * A boolean flag used for the bindOnce syntax.\n * @type {Boolean}\n */\n this.bindOnce = (typeof bindOnce !== 'undefined') ? bindOnce : false;\n }\n\n}\n\nexport default Binding;\n\n\n\n// WEBPACK FOOTER //\n// ./src/core/classes/Binding.js","/**\n * @file Input.js\n */\n\nimport ZingEvent from './ZingEvent.js';\n\n/**\n * Tracks a single input and contains information about the\n * current, previous, and initial events.\n * Contains the progress of each Input and it's associated gestures.\n * @class Input\n */\nclass Input {\n\n /**\n * Constructor function for the Input class.\n * @param {Event} event - The Event object from the window\n * @param {Number} [identifier=0] - The identifier for each input event\n * (taken from event.changedTouches)\n */\n constructor(event, identifier) {\n let currentEvent = new ZingEvent(event, identifier);\n\n /**\n * Holds the initial event object. A touchstart/mousedown event.\n * @type {ZingEvent}\n */\n this.initial = currentEvent;\n\n /**\n * Holds the most current event for this Input, disregarding any other past,\n * current, and future events that other Inputs participate in.\n * e.g. This event ended in an 'end' event, but another Input is still\n * participating in events -- this will not be updated in such cases.\n * @type {ZingEvent}\n */\n this.current = currentEvent;\n\n /**\n * Holds the previous event that took place.\n * @type {ZingEvent}\n */\n this.previous = currentEvent;\n\n /**\n * Refers to the event.touches index, or 0 if a simple mouse event occurred.\n * @type {Number}\n */\n this.identifier = (typeof identifier !== 'undefined') ? identifier : 0;\n\n /**\n * Stores internal state between events for\n * each gesture based off of the gesture's id.\n * @type {Object}\n */\n this.progress = {};\n }\n\n /**\n * Receives an input, updates the internal state of what the input has done.\n * @param {Event} event - The event object to wrap with a ZingEvent.\n * @param {Number} touchIdentifier - The index of inputs, from event.touches\n */\n update(event, touchIdentifier) {\n this.previous = this.current;\n this.current = new ZingEvent(event, touchIdentifier);\n }\n\n /**\n * Returns the progress of the specified gesture.\n * @param {String} id - The identifier for each unique Gesture's progress.\n * @return {Object} - The progress of the gesture.\n * Creates an empty object if no progress has begun.\n */\n getGestureProgress(id) {\n if (!this.progress[id]) {\n this.progress[id] = {};\n }\n return this.progress[id];\n }\n\n /**\n * Returns the normalized current Event's type.\n * @return {String} The current event's type ( start | move | end )\n */\n getCurrentEventType() {\n return this.current.type;\n }\n\n /**\n * Resets a progress/state object of the specified gesture.\n * @param {String} id - The identifier of the specified gesture\n */\n resetProgress(id) {\n this.progress[id] = {};\n }\n\n}\n\nexport default Input;\n\n\n\n// WEBPACK FOOTER //\n// ./src/core/classes/Input.js","/**\n * @file ZingEvent.js\n * Contains logic for ZingEvents\n */\n\nimport util from '../util.js';\n\nconst INITIAL_COORDINATE = 0;\n/**\n * An event wrapper that normalizes events across browsers and input devices\n * @class ZingEvent\n */\nclass ZingEvent {\n /**\n * @constructor\n * @param {Event} event - The event object being wrapped.\n * @param {Array} event.touches - The number of touches on\n * a screen (mobile only).\n * @param {Object} event.changedTouches - The TouchList representing\n * points that participated in the event.\n * @param {Number} touchIdentifier - The index of touch if applicable\n */\n constructor(event, touchIdentifier) {\n /**\n * The original event object.\n * @type {Event}\n */\n this.originalEvent = event;\n\n /**\n * The type of event or null if it is an event not predetermined.\n * @see util.normalizeEvent\n * @type {String | null}\n */\n this.type = util.normalizeEvent(event.type);\n\n /**\n * The X coordinate for the event, based off of the client.\n * @type {number}\n */\n this.x = INITIAL_COORDINATE;\n\n /**\n * The Y coordinate for the event, based off of the client.\n * @type {number}\n */\n this.y = INITIAL_COORDINATE;\n\n let eventObj;\n if (event.touches && event.changedTouches) {\n for (let i = 0; i < event.changedTouches.length; i++) {\n if (event.changedTouches[i].identifier === touchIdentifier) {\n eventObj = event.changedTouches[i];\n break;\n }\n }\n } else {\n eventObj = event;\n }\n\n this.x = this.clientX = eventObj.clientX;\n this.y = this.clientY = eventObj.clientY;\n\n this.pageX = eventObj.pageX;\n this.pageY = eventObj.pageY;\n\n this.screenX = eventObj.screenX;\n this.screenY = eventObj.screenY;\n }\n}\n\nexport default ZingEvent;\n\n\n\n// WEBPACK FOOTER //\n// ./src/core/classes/ZingEvent.js"],"sourceRoot":""} \ No newline at end of file diff --git a/src/core/classes/Region.js b/src/core/classes/Region.js index 7cdada2..40ebf92 100644 --- a/src/core/classes/Region.js +++ b/src/core/classes/Region.js @@ -64,7 +64,7 @@ class Region { this.state = new State(id); let eventNames = []; - if (window.PointerEvent) { + if (window.PointerEvent && !window.TouchEvent) { eventNames = [ 'pointerdown', 'pointermove',