{"version":3,"file":"js/vendors-node_modules_swipejs_swipe_js.js","mappings":";;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC;AACD;AACA;AACA,MAAM,IAA0C;AAChD;AACA;AACA,IAAI,iCAAO,EAAE,mCAAE;AACf;AACA;AACA,KAAK;AAAA,kGAAC;AACN,IAAI,KAAK,EAQN;AACH,CAAC;AACD;AACA;AACA;AACA;AACA,oBAAoB,qBAAM,gBAAgB,qBAAM,YAAY,qBAAM,IAAI,qBAAM;AAC5E;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C;AAC7C;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA,KAAK;;AAEL;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,gDAAgD;AAChD;AACA,8CAA8C;AAC9C;AACA;AACA,4CAA4C;AAC5C;AACA;AACA;AACA;AACA,2DAA2D;AAC3D,2CAA2C;AAC3C;;AAEA;AACA;AACA;AACA,OAAO;;AAEP;AACA;;AAEA;AACA;AACA,UAAU;AACV;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV,gFAAgF,iBAAiB;AACjG;AACA;AACA;AACA,OAAO;;AAEP;AACA;;AAEA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,oCAAoC;;AAEpC;AACA;AACA;;AAEA,YAAY;;AAEZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD;;AAEvD;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;;AAEP;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,8CAA8C;;AAE9C;AACA;AACA;AACA,0DAA0D;;AAE1D;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA,wCAAwC;;AAExC;AACA;;AAEA,gBAAgB;AAChB;AACA;;AAEA;AACA;AACA;;AAEA,cAAc;AACd,wCAAwC;;AAExC;AACA;;AAEA,gBAAgB;AAChB;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA,YAAY;;AAEZ;;AAEA;AACA;AACA;;AAEA,cAAc;;AAEd;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV,qFAAqF,iBAAiB;AACtG;AACA;AACA;AACA,OAAO;;AAEP;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;;AAEP;AACA;AACA;AACA;AACA,OAAO;;AAEP;AACA;AACA;AACA;AACA,OAAO;;AAEP;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,iCAAiC,gBAAgB;;AAEjD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,oFAAoF,gBAAgB;AACpG;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,mFAAmF,gBAAgB;AACnG;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,QAAQ;AACR,wCAAwC;AACxC;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,sBAAsB,mBAAmB;AACzC;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,wBAAwB,mBAAmB;AAC3C;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,QAAQ;AACR;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,QAAQ;AACR;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA,yDAAyD;;AAEzD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA,kCAAkC;AAClC;AACA;;AAEA,QAAQ;;AAER;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA,OAAO;;AAEP;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK;AACL;;AAEA;AACA,CAAC","sources":["webpack://palacio/./node_modules/swipejs/swipe.js"],"sourcesContent":["/*!\n * Swipe 2.3.1\n *\n * Brad Birdsall\n * Copyright 2013, MIT License\n *\n*/\n\n// if the module has no dependencies, the above pattern can be simplified to\n// eslint-disable-next-line no-extra-semi\n;(function (root, factory) {\n root = root || {};\n // eslint-disable-next-line no-undef\n if (typeof define === 'function' && define.amd) {\n // AMD. Register as an anonymous module.\n // eslint-disable-next-line no-undef\n define([], function(){\n root.Swipe = factory();\n return root.Swipe;\n });\n } else if (typeof module === 'object' && module.exports) {\n // Node. Does not work with strict CommonJS, but\n // only CommonJS-like environments that support module.exports,\n // like Node.\n module.exports = factory();\n } else {\n // Browser globals\n root.Swipe = factory();\n }\n}(this, function () {\n // Establish the root object, `window` (`self`) in the browser, `global`\n // on the server, or `this` in some virtual machines. We use `self`\n // instead of `window` for `WebWorker` support.\n var root = typeof self == 'object' && self.self === self && self ||\n typeof global == 'object' && global.global === global && global ||\n this;\n\n var _document = root.document;\n\n function Swipe(container, options) {\n\n 'use strict';\n\n options = options || {};\n\n // setup initial vars\n var start = {};\n var delta = {};\n var isScrolling;\n\n // setup auto slideshow\n var delay = options.auto || 0;\n var interval;\n\n var disabled = false;\n\n // utilities\n // simple no operation function\n var noop = function() {};\n // offload a functions execution\n var offloadFn = function(fn) { setTimeout(fn || noop, 0); };\n // Returns a function, that, as long as it continues to be invoked, will not\n // be triggered.\n var throttle = function (fn, threshhold) {\n threshhold = threshhold || 100;\n var timeout = null;\n\n function cancel() {\n if (timeout) clearTimeout(timeout);\n }\n\n function throttledFn() {\n var context = this;\n var args = arguments;\n cancel();\n timeout = setTimeout(function() {\n timeout = null;\n fn.apply(context, args);\n }, threshhold);\n }\n\n // allow remove throttled timeout\n throttledFn.cancel = cancel;\n\n return throttledFn;\n };\n\n // check whether event is cancelable\n var isCancelable = function (event) {\n if (!event) return false;\n return typeof event.cancelable !== 'boolean' || event.cancelable;\n };\n\n // polyfill for browsers that do not support Element.matches()\n if (!Element.prototype.matches) {\n Element.prototype.matches =\n Element.prototype.matchesSelector ||\n Element.prototype.mozMatchesSelector ||\n Element.prototype.msMatchesSelector ||\n Element.prototype.oMatchesSelector ||\n Element.prototype.webkitMatchesSelector ||\n function (s) {\n var matches = (this.document || this.ownerDocument).querySelectorAll(s),\n i = matches.length;\n while (--i >= 0 && matches.item(i) !== this)\n ;\n return i > -1;\n };\n }\n\n // check browser capabilities\n var browser = {\n addEventListener: !!root.addEventListener,\n passiveEvents: (function () {\n // Test via a getter in the options object to see if the passive property is accessed\n var supportsPassive = false;\n try {\n var opts = Object.defineProperty({}, 'passive', {\n // eslint-disable-next-line getter-return\n get: function () {\n supportsPassive = true;\n }\n });\n root.addEventListener('testEvent', null, opts);\n root.removeEventListener('testEvent', null, opts);\n }\n catch (e) {\n supportsPassive = false;\n }\n return supportsPassive;\n })(),\n // eslint-disable-next-line no-undef\n touch: ('ontouchstart' in root) || root.DocumentTouch && _document instanceof DocumentTouch,\n transitions: (function(temp) {\n var props = ['transitionProperty', 'WebkitTransition', 'MozTransition', 'OTransition', 'msTransition'];\n for ( var i in props ) {\n if (temp.style[ props[i] ] !== undefined){\n return true;\n }\n }\n return false;\n })(_document.createElement('swipe'))\n };\n\n // quit if no root element\n if (!container) return;\n\n var element = container.children[0];\n var slides, slidePos, width, length;\n var index = parseInt(options.startSlide, 10) || 0;\n var speed = options.speed || 300;\n options.continuous = options.continuous !== undefined ? options.continuous : true;\n\n // check text direction\n var slideDir = (function(el, prop, dir) {\n if (el.currentStyle) {\n dir = el.currentStyle[prop];\n } else if (root.getComputedStyle) {\n dir = root.getComputedStyle(el, null).getPropertyValue(prop);\n }\n return 'rtl' === dir ? 'right' : 'left';\n })(container, 'direction');\n\n // AutoRestart option: auto restart slideshow after user's touch event\n options.autoRestart = options.autoRestart !== undefined ? options.autoRestart : false;\n\n // throttled setup\n var throttledSetup = throttle(setup);\n\n // setup event capturing\n var events = {\n\n handleEvent: function(event) {\n // allow bypass 'resize' event\n if (disabled && event.type !== 'resize') return;\n\n switch (event.type) {\n case 'mousedown':\n case 'touchstart': this.start(event); break;\n case 'mousemove':\n case 'touchmove': this.move(event); break;\n case 'mouseup':\n case 'mouseleave':\n case 'touchend': this.end(event); break;\n case 'webkitTransitionEnd':\n case 'msTransitionEnd':\n case 'oTransitionEnd':\n case 'otransitionend':\n case 'transitionend': this.transitionEnd(event); break;\n case 'resize': throttledSetup(); break;\n }\n\n if (options.stopPropagation) {\n event.stopPropagation();\n }\n },\n\n start: function(event) {\n var touches;\n\n if (isMouseEvent(event)) {\n touches = event;\n } else {\n touches = event.touches[0];\n }\n\n // check if the user is swiping on an element that the options say to ignore (for example, a scrolling area)\n if (options.ignore && touches.target.matches(options.ignore)) {\n return;\n }\n\n // For desktop Safari drag\n // Fix #146\n if (isMouseEvent(event)) event.preventDefault();\n\n // measure start values\n start = {\n\n // get initial touch coords\n x: touches.pageX,\n y: touches.pageY,\n\n // store time to determine touch duration\n time: +new Date()\n\n };\n\n // used for testing first move event\n isScrolling = undefined;\n\n // reset delta and end measurements\n delta = {};\n\n // attach touchmove and touchend listeners\n if (isMouseEvent(event)) {\n element.addEventListener('mousemove', this, false);\n element.addEventListener('mouseup', this, false);\n element.addEventListener('mouseleave', this, false);\n } else {\n element.addEventListener('touchmove', this, browser.passiveEvents ? { passive: false } : false);\n element.addEventListener('touchend', this, false);\n }\n runDragStart(getPos(), slides[index]);\n },\n\n move: function(event) {\n var touches;\n\n if (isMouseEvent(event)) {\n touches = event;\n } else {\n // ensure swiping with one touch and not pinching\n if ( event.touches.length > 1 || event.scale && event.scale !== 1) {\n return;\n }\n\n // we can disable scrolling unless it is already in progress\n if (options.disableScroll && isCancelable(event)) {\n event.preventDefault();\n }\n\n touches = event.touches[0];\n }\n\n // measure change in x and y\n delta = {\n x: touches.pageX - start.x,\n y: touches.pageY - start.y\n };\n\n // determine if scrolling test has run - one time test\n if ( typeof isScrolling === 'undefined') {\n isScrolling = !!( isScrolling || Math.abs(delta.x) < Math.abs(delta.y) );\n }\n\n // if user is not trying to scroll vertically\n if (!isScrolling) {\n\n // if it is not already scrolling\n if (isCancelable(event)) {\n // prevent native scrolling\n event.preventDefault();\n }\n\n // stop slideshow\n stop();\n\n // increase resistance if first or last slide\n if (options.continuous) { // we don't add resistance at the end\n\n translate(circle(index-1), delta.x + slidePos[circle(index-1)], 0);\n translate(index, delta.x + slidePos[index], 0);\n translate(circle(index+1), delta.x + slidePos[circle(index+1)], 0);\n\n } else {\n\n delta.x =\n delta.x /\n ( (!index && delta.x > 0 || // if first slide and sliding left\n index === slides.length - 1 && // or if last slide and sliding right\n delta.x < 0 // and if sliding at all\n ) ?\n ( Math.abs(delta.x) / width + 1 ) // determine resistance level\n : 1 ); // no resistance if false\n\n // translate 1:1\n translate(index-1, delta.x + slidePos[index-1], 0);\n translate(index, delta.x + slidePos[index], 0);\n translate(index+1, delta.x + slidePos[index+1], 0);\n }\n }\n },\n\n end: function(event) {\n\n // measure duration\n var duration = +new Date() - start.time;\n\n // determine if slide attempt triggers next/prev slide\n var isValidSlide =\n Number(duration) < 250 && // if slide duration is less than 250ms\n Math.abs(delta.x) > 20 || // and if slide amt is greater than 20px\n Math.abs(delta.x) > width/2; // or if slide amt is greater than half the width\n\n // determine if slide attempt is past start and end\n var isPastBounds =\n !index && delta.x > 0 || // if first slide and slide amt is greater than 0\n index === slides.length - 1 && delta.x < 0; // or if last slide and slide amt is less than 0\n\n if (options.continuous) {\n isPastBounds = false;\n }\n\n // OLD determine direction of swipe (true:right, false:left)\n // determine direction of swipe (1: backward, -1: forward)\n var direction = Math.abs(delta.x) / delta.x;\n\n // if not scrolling vertically\n if (!isScrolling) {\n\n if (isValidSlide && !isPastBounds) {\n\n // if we're moving right\n if (direction < 0) {\n\n if (options.continuous) { // we need to get the next in this direction in place\n\n move(circle(index-1), -width, 0);\n move(circle(index+2), width, 0);\n\n } else {\n move(index-1, -width, 0);\n }\n\n move(index, slidePos[index]-width, speed);\n move(circle(index+1), slidePos[circle(index+1)]-width, speed);\n index = circle(index+1);\n\n } else {\n if (options.continuous) { // we need to get the next in this direction in place\n\n move(circle(index+1), width, 0);\n move(circle(index-2), -width, 0);\n\n } else {\n move(index+1, width, 0);\n }\n\n move(index, slidePos[index]+width, speed);\n move(circle(index-1), slidePos[circle(index-1)]+width, speed);\n index = circle(index-1);\n }\n\n runCallback(getPos(), slides[index], direction);\n\n } else {\n\n if (options.continuous) {\n\n move(circle(index-1), -width, speed);\n move(index, 0, speed);\n move(circle(index+1), width, speed);\n\n } else {\n\n move(index-1, -width, speed);\n move(index, 0, speed);\n move(index+1, width, speed);\n }\n }\n }\n\n // kill touchmove and touchend event listeners until touchstart called again\n if (isMouseEvent(event)) {\n element.removeEventListener('mousemove', events, false);\n element.removeEventListener('mouseup', events, false);\n element.removeEventListener('mouseleave', events, false);\n } else {\n element.removeEventListener('touchmove', events, browser.passiveEvents ? { passive: false } : false);\n element.removeEventListener('touchend', events, false);\n }\n runDragEnd(getPos(), slides[index]);\n },\n\n transitionEnd: function(event) {\n var currentIndex = parseInt(event.target.getAttribute('data-index'), 10);\n if (currentIndex === index) {\n if (delay || options.autoRestart) restart();\n\n runTransitionEnd(getPos(), slides[index]);\n }\n }\n };\n\n // trigger setup\n setup();\n\n // start auto slideshow if applicable\n begin();\n\n // Expose the Swipe API\n return {\n // initialize\n setup: setup,\n\n // go to slide\n slide: function(to, speed) {\n stop();\n slide(to, speed);\n },\n\n // move to previous\n prev: function() {\n stop();\n prev();\n },\n\n // move to next\n next: function() {\n stop();\n next();\n },\n\n // Restart slideshow\n restart: restart,\n\n // cancel slideshow\n stop: stop,\n\n // return current index position\n getPos: getPos,\n\n // disable slideshow\n disable: disable,\n\n // enable slideshow\n enable: enable,\n\n // return total number of slides\n getNumSlides: function() { return length; },\n\n // completely remove swipe\n kill: kill\n };\n\n // remove all event listeners\n function detachEvents() {\n if (browser.addEventListener) {\n // remove current event listeners\n element.removeEventListener('touchstart', events, browser.passiveEvents ? { passive: true } : false);\n element.removeEventListener('mousedown', events, false);\n element.removeEventListener('webkitTransitionEnd', events, false);\n element.removeEventListener('msTransitionEnd', events, false);\n element.removeEventListener('oTransitionEnd', events, false);\n element.removeEventListener('otransitionend', events, false);\n element.removeEventListener('transitionend', events, false);\n root.removeEventListener('resize', events, false);\n } else {\n root.onresize = null;\n }\n }\n\n // add event listeners\n function attachEvents() {\n if (browser.addEventListener) {\n\n // set touchstart event on element\n if (browser.touch) {\n element.addEventListener('touchstart', events, browser.passiveEvents ? { passive: true } : false);\n }\n\n if (options.draggable) {\n element.addEventListener('mousedown', events, false);\n }\n\n if (browser.transitions) {\n element.addEventListener('webkitTransitionEnd', events, false);\n element.addEventListener('msTransitionEnd', events, false);\n element.addEventListener('oTransitionEnd', events, false);\n element.addEventListener('otransitionend', events, false);\n element.addEventListener('transitionend', events, false);\n }\n\n // set resize event on window\n root.addEventListener('resize', events, false);\n\n } else {\n root.onresize = throttledSetup; // to play nice with old IE\n }\n }\n\n // clone nodes when there is only two slides\n function cloneNode(el) {\n var clone = el.cloneNode(true);\n element.appendChild(clone);\n\n // tag these slides as clones (to remove them on kill)\n clone.setAttribute('data-cloned', true);\n\n // Remove id from element\n clone.removeAttribute('id');\n }\n\n function setup(opts) {\n // Overwrite options if necessary\n if (opts != null) {\n for (var prop in opts) {\n options[prop] = opts[prop];\n }\n }\n\n // cache slides\n slides = element.children;\n length = slides.length;\n\n // slides length correction, minus cloned slides\n for (var i = 0; i < slides.length; i++) {\n if (slides[i].getAttribute('data-cloned')) length--;\n }\n\n // set continuous to false if only one slide\n if (slides.length < 2) {\n options.continuous = false;\n }\n\n // special case if two slides\n if (browser.transitions && options.continuous && slides.length < 3) {\n cloneNode(slides[0]);\n cloneNode(slides[1]);\n\n slides = element.children;\n }\n\n // adjust style on rtl\n if ('right' === slideDir) {\n for (var j = 0; j < slides.length; j++) {\n slides[j].style.float = 'right';\n }\n }\n\n // create an array to store current positions of each slide\n slidePos = new Array(slides.length);\n\n // determine width of each slide\n width = container.getBoundingClientRect().width || container.offsetWidth;\n\n element.style.width = (slides.length * width * 2) + 'px';\n\n // stack elements\n var pos = slides.length;\n while(pos--) {\n var slide = slides[pos];\n\n slide.style.width = width + 'px';\n slide.setAttribute('data-index', pos);\n\n if (browser.transitions) {\n slide.style[slideDir] = (pos * -width) + 'px';\n move(pos, index > pos ? -width : (index < pos ? width : 0), 0);\n }\n }\n\n // reposition elements before and after index\n if (options.continuous && browser.transitions) {\n move(circle(index-1), -width, 0);\n move(circle(index+1), width, 0);\n }\n\n if (!browser.transitions) {\n element.style[slideDir] = (index * -width) + 'px';\n }\n\n container.style.visibility = 'visible';\n\n // reinitialize events\n detachEvents();\n attachEvents();\n }\n\n function prev() {\n if (disabled) return;\n\n if (options.continuous) {\n slide(index-1);\n } else if (index) {\n slide(index-1);\n }\n }\n\n function next() {\n if (disabled) return;\n\n if (options.continuous) {\n slide(index+1);\n } else if (index < slides.length - 1) {\n slide(index+1);\n }\n }\n\n function runCallback(pos, index, dir) {\n if (options.callback) {\n options.callback(pos, index, dir);\n }\n }\n\n function runTransitionEnd(pos, index) {\n if (options.transitionEnd) {\n options.transitionEnd(pos, index);\n }\n }\n\n function runDragStart(pos, index) {\n if (options.dragStart) {\n options.dragStart(pos, index);\n }\n }\n\n function runDragEnd(pos, index) {\n if (options.dragEnd) {\n options.dragEnd(pos, index);\n }\n }\n\n function circle(index) {\n\n // a simple positive modulo using slides.length\n return (slides.length + (index % slides.length)) % slides.length;\n }\n\n function getPos() {\n // Fix for the clone issue in the event of 2 slides\n var currentIndex = index;\n\n if (currentIndex >= length) {\n currentIndex = currentIndex - length;\n }\n\n return currentIndex;\n }\n\n function slide(to, slideSpeed) {\n\n // ensure to is of type 'number'\n to = typeof to !== 'number' ? parseInt(to, 10) : to;\n\n // do nothing if already on requested slide\n if (index === to) return;\n\n if (browser.transitions) {\n\n var direction = Math.abs(index-to) / (index-to); // 1: backward, -1: forward\n\n // get the actual position of the slide\n if (options.continuous) {\n var natural_direction = direction;\n direction = -slidePos[circle(to)] / width;\n\n // if going forward but to < index, use to = slides.length + to\n // if going backward but to > index, use to = -slides.length + to\n if (direction !== natural_direction) {\n to = -direction * slides.length + to;\n }\n\n }\n\n var diff = Math.abs(index-to) - 1;\n\n // move all the slides between index and to in the right direction\n while (diff--) {\n move( circle((to > index ? to : index) - diff - 1), width * direction, 0);\n }\n\n to = circle(to);\n\n move(index, width * direction, slideSpeed || speed);\n move(to, 0, slideSpeed || speed);\n\n if (options.continuous) { // we need to get the next in place\n move(circle(to - direction), -(width * direction), 0);\n }\n\n } else {\n\n to = circle(to);\n animate(index * -width, to * -width, slideSpeed || speed);\n // no fallback for a circular continuous if the browser does not accept transitions\n }\n\n index = to;\n offloadFn(function() {\n runCallback(getPos(), slides[index], direction);\n });\n }\n\n function move(index, dist, speed) {\n translate(index, dist, speed);\n slidePos[index] = dist;\n }\n\n function translate(index, dist, speed) {\n\n var slide = slides[index];\n var style = slide && slide.style;\n\n if (!style) return;\n\n style.webkitTransitionDuration =\n style.MozTransitionDuration =\n style.msTransitionDuration =\n style.OTransitionDuration =\n style.transitionDuration = speed + 'ms';\n\n style.webkitTransform =\n style.msTransform =\n style.MozTransform =\n style.OTransform =\n style.transform = 'translateX(' + dist + 'px)';\n }\n\n function animate(from, to, speed) {\n\n // if not an animation, just reposition\n if (!speed) {\n element.style[slideDir] = to + 'px';\n return;\n }\n\n var start = +new Date();\n\n var timer = setInterval(function() {\n var timeElap = +new Date() - start;\n\n if (timeElap > speed) {\n\n element.style[slideDir] = to + 'px';\n\n if (delay || options.autoRestart) restart();\n\n runTransitionEnd(getPos(), slides[index]);\n\n clearInterval(timer);\n\n return;\n }\n\n element.style[slideDir] = (( (to - from) * (Math.floor((timeElap / speed) * 100) / 100) ) + from) + 'px';\n }, 4);\n\n }\n\n function begin() {\n delay = options.auto || 0;\n if (delay) interval = setTimeout(next, delay);\n }\n\n function stop() {\n delay = 0;\n clearTimeout(interval);\n }\n\n function restart() {\n stop();\n begin();\n }\n\n function disable() {\n stop();\n disabled = true;\n }\n\n function enable() {\n disabled = false;\n restart();\n }\n\n function isMouseEvent(e) {\n return /^mouse/.test(e.type);\n }\n\n function kill() {\n // cancel slideshow\n stop();\n\n // remove inline styles\n container.style.visibility = '';\n\n // reset element\n element.style.width = '';\n element.style[slideDir] = '';\n\n // reset slides\n var pos = slides.length;\n while (pos--) {\n\n if (browser.transitions) {\n translate(pos, 0, 0);\n }\n\n var slide = slides[pos];\n\n // if the slide is tagged as clone, remove it\n if (slide.getAttribute('data-cloned')) {\n var _parent = slide.parentElement;\n _parent.removeChild(slide);\n }\n\n // remove styles\n slide.style.width = '';\n slide.style[slideDir] = '';\n\n slide.style.webkitTransitionDuration =\n slide.style.MozTransitionDuration =\n slide.style.msTransitionDuration =\n slide.style.OTransitionDuration =\n slide.style.transitionDuration = '';\n\n slide.style.webkitTransform =\n slide.style.msTransform =\n slide.style.MozTransform =\n slide.style.OTransform = '';\n\n // remove custom attributes (?)\n // slide.removeAttribute('data-index');\n }\n\n // remove all events\n detachEvents();\n\n // remove throttled function timeout\n throttledSetup.cancel();\n }\n }\n\n if ( root.jQuery || root.Zepto ) {\n (function($) {\n $.fn.Swipe = function(params) {\n return this.each(function() {\n $(this).data('Swipe', new Swipe($(this)[0], params));\n });\n };\n })( root.jQuery || root.Zepto );\n }\n\n return Swipe;\n}));\n"],"names":[],"sourceRoot":""}