UNPKG

vue-glide-js

Version:
7 lines 31.4 kB
(function(t,e){"object"===typeof exports&&"object"===typeof module?module.exports=e():"function"===typeof define&&define.amd?define([],e):"object"===typeof exports?exports["vue-glide"]=e():t["vue-glide"]=e()})("undefined"!==typeof self?self:this,(function(){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"===typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(i,r,function(e){return t[e]}.bind(null,r));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s="fb15")}({"4d21":function(t,e,n){},f6fd:function(t,e){(function(t){var e="currentScript",n=t.getElementsByTagName("script");e in t||Object.defineProperty(t,e,{get:function(){try{throw new Error}catch(i){var t,e=(/.*at [^\(]*\((.*):.+:.+\)$/gi.exec(i.stack)||[!1])[1];for(t in n)if(n[t].src==e||"interactive"==n[t].readyState)return n[t];return null}}})})(document)},fb15:function(t,e,n){"use strict";var i;(n.r(e),"undefined"!==typeof window)&&(n("f6fd"),(i=window.document.currentScript)&&(i=i.src.match(/(.+\/)[^/]+\.js(\?.*)?$/))&&(n.p=i[1]));var r={type:"slider",startAt:0,perView:1,focusAt:0,gap:10,autoplay:!1,hoverpause:!0,keyboard:!0,bound:!1,swipeThreshold:80,dragThreshold:120,perTouch:!1,touchRatio:.5,touchAngle:45,animationDuration:400,rewind:!0,rewindDuration:800,animationTimingFunc:"cubic-bezier(.165, .840, .440, 1)",throttle:10,direction:"ltr",peek:0,breakpoints:{},classes:{direction:{ltr:"glide--ltr",rtl:"glide--rtl"},slider:"glide--slider",carousel:"glide--carousel",swipeable:"glide--swipeable",dragging:"glide--dragging",cloneSlide:"glide__slide--clone",activeNav:"glide__bullet--active",activeSlide:"glide__slide--active",disabledArrow:"glide__arrow--disabled"}}; /*! * Glide.js v3.4.1 * (c) 2013-2019 Jędrzej Chałubek <jedrzej.chalubek@gmail.com> (http://jedrzejchalubek.com/) * Released under the MIT License. */function o(t){console.error("[Glide warn]: "+t)}var s="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},u=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},a=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),l=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},c=function t(e,n,i){null===e&&(e=Function.prototype);var r=Object.getOwnPropertyDescriptor(e,n);if(void 0===r){var o=Object.getPrototypeOf(e);return null===o?void 0:t(o,n,i)}if("value"in r)return r.value;var s=r.get;return void 0!==s?s.call(i):void 0},d=function(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)},f=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!==typeof e&&"function"!==typeof e?t:e};function h(t){return parseInt(t)}function p(t){return parseFloat(t)}function v(t){return"string"===typeof t}function m(t){var e="undefined"===typeof t?"undefined":s(t);return"function"===e||"object"===e&&!!t}function g(t){return"number"===typeof t}function y(t){return"function"===typeof t}function b(t){return"undefined"===typeof t}function w(t){return t.constructor===Array}function _(t,e,n){var i={};for(var r in e)y(e[r])?i[r]=e[r](t,i,n):o("Extension must be a function");for(var s in i)y(i[s].mount)&&i[s].mount();return i}function k(t,e,n){Object.defineProperty(t,e,n)}function S(t){return Object.keys(t).sort().reduce((function(e,n){return e[n]=t[n],e[n],e}),{})}function x(t,e){var n=l({},t,e);return e.hasOwnProperty("classes")&&(n.classes=l({},t.classes,e.classes),e.classes.hasOwnProperty("direction")&&(n.classes.direction=l({},t.classes.direction,e.classes.direction))),e.hasOwnProperty("breakpoints")&&(n.breakpoints=l({},t.breakpoints,e.breakpoints)),n}var T=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};u(this,t),this.events=e,this.hop=e.hasOwnProperty}return a(t,[{key:"on",value:function(t,e){if(w(t))for(var n=0;n<t.length;n++)this.on(t[n],e);this.hop.call(this.events,t)||(this.events[t]=[]);var i=this.events[t].push(e)-1;return{remove:function(){delete this.events[t][i]}}}},{key:"emit",value:function(t,e){if(w(t))for(var n=0;n<t.length;n++)this.emit(t[n],e);this.hop.call(this.events,t)&&this.events[t].forEach((function(t){t(e||{})}))}}]),t}(),O=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};u(this,t),this._c={},this._t=[],this._e=new T,this.disabled=!1,this.selector=e,this.settings=x(r,n),this.index=this.settings.startAt}return a(t,[{key:"mount",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._e.emit("mount.before"),m(t)?this._c=_(this,t,this._e):o("You need to provide a object on `mount()`"),this._e.emit("mount.after"),this}},{key:"mutate",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return w(t)?this._t=t:o("You need to provide a array on `mutate()`"),this}},{key:"update",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.settings=x(this.settings,t),t.hasOwnProperty("startAt")&&(this.index=t.startAt),this._e.emit("update"),this}},{key:"go",value:function(t){return this._c.Run.make(t),this}},{key:"move",value:function(t){return this._c.Transition.disable(),this._c.Move.make(t),this}},{key:"destroy",value:function(){return this._e.emit("destroy"),this}},{key:"play",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return t&&(this.settings.autoplay=t),this._e.emit("play"),this}},{key:"pause",value:function(){return this._e.emit("pause"),this}},{key:"disable",value:function(){return this.disabled=!0,this}},{key:"enable",value:function(){return this.disabled=!1,this}},{key:"on",value:function(t,e){return this._e.on(t,e),this}},{key:"isType",value:function(t){return this.settings.type===t}},{key:"settings",get:function(){return this._o},set:function(t){m(t)?this._o=t:o("Options must be an `object` instance.")}},{key:"index",get:function(){return this._i},set:function(t){this._i=h(t)}},{key:"type",get:function(){return this.settings.type}},{key:"disabled",get:function(){return this._d},set:function(t){this._d=!!t}}]),t}();function H(t,e,n){var i={mount:function(){this._o=!1},make:function(i){var r=this;t.disabled||(t.disable(),this.move=i,n.emit("run.before",this.move),this.calculate(),n.emit("run",this.move),e.Transition.after((function(){r.isStart()&&n.emit("run.start",r.move),r.isEnd()&&n.emit("run.end",r.move),(r.isOffset("<")||r.isOffset(">"))&&(r._o=!1,n.emit("run.offset",r.move)),n.emit("run.after",r.move),t.enable()})))},calculate:function(){var e=this.move,n=this.length,i=e.steps,r=e.direction,s=g(h(i))&&0!==h(i);switch(r){case">":">"===i?t.index=n:this.isEnd()?t.isType("slider")&&!t.settings.rewind||(this._o=!0,t.index=0):s?t.index+=Math.min(n-t.index,-h(i)):t.index++;break;case"<":"<"===i?t.index=0:this.isStart()?t.isType("slider")&&!t.settings.rewind||(this._o=!0,t.index=n):s?t.index-=Math.min(t.index,h(i)):t.index--;break;case"=":t.index=i;break;default:o("Invalid direction pattern ["+r+i+"] has been used");break}},isStart:function(){return 0===t.index},isEnd:function(){return t.index===this.length},isOffset:function(t){return this._o&&this.move.direction===t}};return k(i,"move",{get:function(){return this._m},set:function(t){var e=t.substr(1);this._m={direction:t.substr(0,1),steps:e?h(e)?h(e):e:0}}}),k(i,"length",{get:function(){var n=t.settings,i=e.Html.slides.length;return t.isType("slider")&&"center"!==n.focusAt&&n.bound?i-1-(h(n.perView)-1)+h(n.focusAt):i-1}}),k(i,"offset",{get:function(){return this._o}}),i}function C(){return(new Date).getTime()}function j(t,e,n){var i=void 0,r=void 0,o=void 0,s=void 0,u=0;n||(n={});var a=function(){u=!1===n.leading?0:C(),i=null,s=t.apply(r,o),i||(r=o=null)},l=function(){var l=C();u||!1!==n.leading||(u=l);var c=e-(l-u);return r=this,o=arguments,c<=0||c>e?(i&&(clearTimeout(i),i=null),u=l,s=t.apply(r,o),i||(r=o=null)):i||!1===n.trailing||(i=setTimeout(a,c)),s};return l.cancel=function(){clearTimeout(i),u=0,i=r=o=null},l}var A={ltr:["marginLeft","marginRight"],rtl:["marginRight","marginLeft"]};function M(t,e,n){var i={apply:function(t){for(var n=0,i=t.length;n<i;n++){var r=t[n].style,o=e.Direction.value;r[A[o][0]]=0!==n?this.value/2+"px":"",n!==t.length-1?r[A[o][1]]=this.value/2+"px":r[A[o][1]]=""}},remove:function(t){for(var e=0,n=t.length;e<n;e++){var i=t[e].style;i.marginLeft="",i.marginRight=""}}};return k(i,"value",{get:function(){return h(t.settings.gap)}}),k(i,"grow",{get:function(){return i.value*(e.Sizes.length-1)}}),k(i,"reductor",{get:function(){var e=t.settings.perView;return i.value*(e-1)/e}}),n.on(["build.after","update"],j((function(){i.apply(e.Html.wrapper.children)}),30)),n.on("destroy",(function(){i.remove(e.Html.wrapper.children)})),i}function E(t){if(t&&t.parentNode){for(var e=t.parentNode.firstChild,n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}return[]}function P(t){return!!(t&&t instanceof window.HTMLElement)}var N='[data-glide-el="track"]';function L(t,e){var n={mount:function(){this.root=t.selector,this.track=this.root.querySelector(N),this.slides=Array.prototype.slice.call(this.wrapper.children).filter((function(e){return!e.classList.contains(t.settings.classes.cloneSlide)}))}};return k(n,"root",{get:function(){return n._r},set:function(t){v(t)&&(t=document.querySelector(t)),P(t)?n._r=t:o("Root element must be a existing Html node")}}),k(n,"track",{get:function(){return n._t},set:function(t){P(t)?n._t=t:o("Could not find track element. Please use "+N+" attribute.")}}),k(n,"wrapper",{get:function(){return n.track.children[0]}}),n}function B(t,e,n){var i={mount:function(){this.value=t.settings.peek}};return k(i,"value",{get:function(){return i._v},set:function(t){m(t)?(t.before=h(t.before),t.after=h(t.after)):t=h(t),i._v=t}}),k(i,"reductor",{get:function(){var e=i.value,n=t.settings.perView;return m(e)?e.before/n+e.after/n:2*e/n}}),n.on(["resize","update"],(function(){i.mount()})),i}function z(t,e,n){var i={mount:function(){this._o=0},make:function(){var t=this,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.offset=i,n.emit("move",{movement:this.value}),e.Transition.after((function(){n.emit("move.after",{movement:t.value})}))}};return k(i,"offset",{get:function(){return i._o},set:function(t){i._o=b(t)?0:h(t)}}),k(i,"translate",{get:function(){return e.Sizes.slideWidth*t.index}}),k(i,"value",{get:function(){var t=this.offset,n=this.translate;return e.Direction.is("rtl")?n+t:n-t}}),n.on(["build.before","run"],(function(){i.make()})),i}function R(t,e,n){var i={setupSlides:function(){for(var t=this.slideWidth+"px",n=e.Html.slides,i=0;i<n.length;i++)n[i].style.width=t},setupWrapper:function(t){e.Html.wrapper.style.width=this.wrapperSize+"px"},remove:function(){for(var t=e.Html.slides,n=0;n<t.length;n++)t[n].style.width="";e.Html.wrapper.style.width=""}};return k(i,"length",{get:function(){return e.Html.slides.length}}),k(i,"width",{get:function(){return e.Html.root.offsetWidth}}),k(i,"wrapperSize",{get:function(){return i.slideWidth*i.length+e.Gaps.grow+e.Clones.grow}}),k(i,"slideWidth",{get:function(){return i.width/t.settings.perView-e.Peek.reductor-e.Gaps.reductor}}),n.on(["build.before","resize","update"],(function(){i.setupSlides(),i.setupWrapper()})),n.on("destroy",(function(){i.remove()})),i}function $(t,e,n){var i={mount:function(){n.emit("build.before"),this.typeClass(),this.activeClass(),n.emit("build.after")},typeClass:function(){e.Html.root.classList.add(t.settings.classes[t.settings.type])},activeClass:function(){var n=t.settings.classes,i=e.Html.slides[t.index];i&&(i.classList.add(n.activeSlide),E(i).forEach((function(t){t.classList.remove(n.activeSlide)})))},removeClasses:function(){var n=t.settings.classes;e.Html.root.classList.remove(n[t.settings.type]),e.Html.slides.forEach((function(t){t.classList.remove(n.activeSlide)}))}};return n.on(["destroy","update"],(function(){i.removeClasses()})),n.on(["resize","update"],(function(){i.mount()})),n.on("move.after",(function(){i.activeClass()})),i}function D(t,e,n){var i={mount:function(){this.items=[],t.isType("carousel")&&(this.items=this.collect())},collect:function(){for(var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i=e.Html.slides,r=t.settings,o=r.perView,s=r.classes,u=+!!t.settings.peek,a=o+u,l=i.slice(0,a),c=i.slice(-a),d=0;d<Math.max(1,Math.floor(o/i.length));d++){for(var f=0;f<l.length;f++){var h=l[f].cloneNode(!0);h.classList.add(s.cloneSlide),n.push(h)}for(var p=0;p<c.length;p++){var v=c[p].cloneNode(!0);v.classList.add(s.cloneSlide),n.unshift(v)}}return n},append:function(){for(var t=this.items,n=e.Html,i=n.wrapper,r=n.slides,o=Math.floor(t.length/2),s=t.slice(0,o).reverse(),u=t.slice(o,t.length),a=e.Sizes.slideWidth+"px",l=0;l<u.length;l++)i.appendChild(u[l]);for(var c=0;c<s.length;c++)i.insertBefore(s[c],r[0]);for(var d=0;d<t.length;d++)t[d].style.width=a},remove:function(){for(var t=this.items,n=0;n<t.length;n++)e.Html.wrapper.removeChild(t[n])}};return k(i,"grow",{get:function(){return(e.Sizes.slideWidth+e.Gaps.value)*i.items.length}}),n.on("update",(function(){i.remove(),i.mount(),i.append()})),n.on("build.before",(function(){t.isType("carousel")&&i.append()})),n.on("destroy",(function(){i.remove()})),i}var G=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};u(this,t),this.listeners=e}return a(t,[{key:"on",value:function(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];v(t)&&(t=[t]);for(var r=0;r<t.length;r++)this.listeners[t[r]]=n,e.addEventListener(t[r],this.listeners[t[r]],i)}},{key:"off",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];v(t)&&(t=[t]);for(var i=0;i<t.length;i++)e.removeEventListener(t[i],this.listeners[t[i]],n)}},{key:"destroy",value:function(){delete this.listeners}}]),t}();function V(t,e,n){var i=new G,r={mount:function(){this.bind()},bind:function(){i.on("resize",window,j((function(){n.emit("resize")}),t.settings.throttle))},unbind:function(){i.off("resize",window)}};return n.on("destroy",(function(){r.unbind(),i.destroy()})),r}var W=["ltr","rtl"],I={">":"<","<":">","=":"="};function q(t,e,n){var i={mount:function(){this.value=t.settings.direction},resolve:function(t){var e=t.slice(0,1);return this.is("rtl")?t.split(e).join(I[e]):t},is:function(t){return this.value===t},addClass:function(){e.Html.root.classList.add(t.settings.classes.direction[this.value])},removeClass:function(){e.Html.root.classList.remove(t.settings.classes.direction[this.value])}};return k(i,"value",{get:function(){return i._v},set:function(t){W.indexOf(t)>-1?i._v=t:o("Direction value must be `ltr` or `rtl`")}}),n.on(["destroy","update"],(function(){i.removeClass()})),n.on("update",(function(){i.mount()})),n.on(["build.before","update"],(function(){i.addClass()})),i}function F(t,e){return{modify:function(t){return e.Direction.is("rtl")?-t:t}}}function X(t,e){return{modify:function(n){return n+e.Gaps.value*t.index}}}function Y(t,e){return{modify:function(t){return t+e.Clones.grow/2}}}function U(t,e){return{modify:function(n){if(t.settings.focusAt>=0){var i=e.Peek.value;return m(i)?n-i.before:n-i}return n}}}function K(t,e){return{modify:function(n){var i=e.Gaps.value,r=e.Sizes.width,o=t.settings.focusAt,s=e.Sizes.slideWidth;return"center"===o?n-(r/2-s/2):n-s*o-i*o}}}function J(t,e,n){var i=[X,Y,U,K].concat(t._t,[F]);return{mutate:function(r){for(var s=0;s<i.length;s++){var u=i[s];y(u)&&y(u().modify)?r=u(t,e,n).modify(r):o("Transformer should be a function that returns an object with `modify()` method")}return r}}}function Q(t,e,n){var i={set:function(n){var i=J(t,e).mutate(n);e.Html.wrapper.style.transform="translate3d("+-1*i+"px, 0px, 0px)"},remove:function(){e.Html.wrapper.style.transform=""}};return n.on("move",(function(r){var o=e.Gaps.value,s=e.Sizes.length,u=e.Sizes.slideWidth;return t.isType("carousel")&&e.Run.isOffset("<")?(e.Transition.after((function(){n.emit("translate.jump"),i.set(u*(s-1))})),i.set(-u-o*s)):t.isType("carousel")&&e.Run.isOffset(">")?(e.Transition.after((function(){n.emit("translate.jump"),i.set(0)})),i.set(u*s+o*s)):i.set(r.movement)})),n.on("destroy",(function(){i.remove()})),i}function Z(t,e,n){var i=!1,r={compose:function(e){var n=t.settings;return i?e+" 0ms "+n.animationTimingFunc:e+" "+this.duration+"ms "+n.animationTimingFunc},set:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"transform";e.Html.wrapper.style.transition=this.compose(t)},remove:function(){e.Html.wrapper.style.transition=""},after:function(t){setTimeout((function(){t()}),this.duration)},enable:function(){i=!1,this.set()},disable:function(){i=!0,this.set()}};return k(r,"duration",{get:function(){var n=t.settings;return t.isType("slider")&&e.Run.offset?n.rewindDuration:n.animationDuration}}),n.on("move",(function(){r.set()})),n.on(["build.before","resize","translate.jump"],(function(){r.disable()})),n.on("run",(function(){r.enable()})),n.on("destroy",(function(){r.remove()})),r}var tt=!1;try{var et=Object.defineProperty({},"passive",{get:function(){tt=!0}});window.addEventListener("testPassive",null,et),window.removeEventListener("testPassive",null,et)}catch(At){}var nt=tt,it=["touchstart","mousedown"],rt=["touchmove","mousemove"],ot=["touchend","touchcancel","mouseup","mouseleave"],st=["mousedown","mousemove","mouseup","mouseleave"];function ut(t,e,n){var i=new G,r=0,o=0,s=0,u=!1,a=!!nt&&{passive:!0},l={mount:function(){this.bindSwipeStart()},start:function(e){if(!u&&!t.disabled){this.disable();var i=this.touches(e);r=null,o=h(i.pageX),s=h(i.pageY),this.bindSwipeMove(),this.bindSwipeEnd(),n.emit("swipe.start")}},move:function(i){if(!t.disabled){var u=t.settings,a=u.touchAngle,l=u.touchRatio,c=u.classes,d=this.touches(i),f=h(d.pageX)-o,v=h(d.pageY)-s,m=Math.abs(f<<2),g=Math.abs(v<<2),y=Math.sqrt(m+g),b=Math.sqrt(g);if(r=Math.asin(b/y),!(180*r/Math.PI<a))return!1;i.stopPropagation(),e.Move.make(f*p(l)),e.Html.root.classList.add(c.dragging),n.emit("swipe.move")}},end:function(i){if(!t.disabled){var s=t.settings,u=this.touches(i),a=this.threshold(i),l=u.pageX-o,c=180*r/Math.PI,d=Math.round(l/e.Sizes.slideWidth);this.enable(),l>a&&c<s.touchAngle?(s.perTouch&&(d=Math.min(d,h(s.perTouch))),e.Direction.is("rtl")&&(d=-d),e.Run.make(e.Direction.resolve("<"+d))):l<-a&&c<s.touchAngle?(s.perTouch&&(d=Math.max(d,-h(s.perTouch))),e.Direction.is("rtl")&&(d=-d),e.Run.make(e.Direction.resolve(">"+d))):e.Move.make(),e.Html.root.classList.remove(s.classes.dragging),this.unbindSwipeMove(),this.unbindSwipeEnd(),n.emit("swipe.end")}},bindSwipeStart:function(){var n=this,r=t.settings;r.swipeThreshold&&i.on(it[0],e.Html.wrapper,(function(t){n.start(t)}),a),r.dragThreshold&&i.on(it[1],e.Html.wrapper,(function(t){n.start(t)}),a)},unbindSwipeStart:function(){i.off(it[0],e.Html.wrapper,a),i.off(it[1],e.Html.wrapper,a)},bindSwipeMove:function(){var n=this;i.on(rt,e.Html.wrapper,j((function(t){n.move(t)}),t.settings.throttle),a)},unbindSwipeMove:function(){i.off(rt,e.Html.wrapper,a)},bindSwipeEnd:function(){var t=this;i.on(ot,e.Html.wrapper,(function(e){t.end(e)}))},unbindSwipeEnd:function(){i.off(ot,e.Html.wrapper)},touches:function(t){return st.indexOf(t.type)>-1?t:t.touches[0]||t.changedTouches[0]},threshold:function(e){var n=t.settings;return st.indexOf(e.type)>-1?n.dragThreshold:n.swipeThreshold},enable:function(){return u=!1,e.Transition.enable(),this},disable:function(){return u=!0,e.Transition.disable(),this}};return n.on("build.after",(function(){e.Html.root.classList.add(t.settings.classes.swipeable)})),n.on("destroy",(function(){l.unbindSwipeStart(),l.unbindSwipeMove(),l.unbindSwipeEnd(),i.destroy()})),l}function at(t,e,n){var i=new G,r={mount:function(){this.bind()},bind:function(){i.on("dragstart",e.Html.wrapper,this.dragstart)},unbind:function(){i.off("dragstart",e.Html.wrapper)},dragstart:function(t){t.preventDefault()}};return n.on("destroy",(function(){r.unbind(),i.destroy()})),r}function lt(t,e,n){var i=new G,r=!1,o=!1,s={mount:function(){this._a=e.Html.wrapper.querySelectorAll("a"),this.bind()},bind:function(){i.on("click",e.Html.wrapper,this.click)},unbind:function(){i.off("click",e.Html.wrapper)},click:function(t){o&&(t.stopPropagation(),t.preventDefault())},detach:function(){if(o=!0,!r){for(var t=0;t<this.items.length;t++)this.items[t].draggable=!1,this.items[t].setAttribute("data-href",this.items[t].getAttribute("href")),this.items[t].removeAttribute("href");r=!0}return this},attach:function(){if(o=!1,r){for(var t=0;t<this.items.length;t++)this.items[t].draggable=!0,this.items[t].setAttribute("href",this.items[t].getAttribute("data-href"));r=!1}return this}};return k(s,"items",{get:function(){return s._a}}),n.on("swipe.move",(function(){s.detach()})),n.on("swipe.end",(function(){e.Transition.after((function(){s.attach()}))})),n.on("destroy",(function(){s.attach(),s.unbind(),i.destroy()})),s}var ct='[data-glide-el="controls[nav]"]',dt='[data-glide-el^="controls"]';function ft(t,e,n){var i=new G,r=!!nt&&{passive:!0},o={mount:function(){this._n=e.Html.root.querySelectorAll(ct),this._c=e.Html.root.querySelectorAll(dt),this.addBindings()},setActive:function(){for(var t=0;t<this._n.length;t++)this.addClass(this._n[t].children)},removeActive:function(){for(var t=0;t<this._n.length;t++)this.removeClass(this._n[t].children)},addClass:function(e){var n=t.settings,i=e[t.index];i&&(i.classList.add(n.classes.activeNav),E(i).forEach((function(t){t.classList.remove(n.classes.activeNav)})))},removeClass:function(e){var n=e[t.index];n&&n.classList.remove(t.settings.classes.activeNav)},addBindings:function(){for(var t=0;t<this._c.length;t++)this.bind(this._c[t].children)},removeBindings:function(){for(var t=0;t<this._c.length;t++)this.unbind(this._c[t].children)},bind:function(t){for(var e=0;e<t.length;e++)i.on("click",t[e],this.click),i.on("touchstart",t[e],this.click,r)},unbind:function(t){for(var e=0;e<t.length;e++)i.off(["click","touchstart"],t[e])},click:function(t){t.preventDefault(),e.Run.make(e.Direction.resolve(t.currentTarget.getAttribute("data-glide-dir")))}};return k(o,"items",{get:function(){return o._c}}),n.on(["mount.after","move.after"],(function(){o.setActive()})),n.on("destroy",(function(){o.removeBindings(),o.removeActive(),i.destroy()})),o}function ht(t,e,n){var i=new G,r={mount:function(){t.settings.keyboard&&this.bind()},bind:function(){i.on("keyup",document,this.press)},unbind:function(){i.off("keyup",document)},press:function(t){39===t.keyCode&&e.Run.make(e.Direction.resolve(">")),37===t.keyCode&&e.Run.make(e.Direction.resolve("<"))}};return n.on(["destroy","update"],(function(){r.unbind()})),n.on("update",(function(){r.mount()})),n.on("destroy",(function(){i.destroy()})),r}function pt(t,e,n){var i=new G,r={mount:function(){this.start(),t.settings.hoverpause&&this.bind()},start:function(){var n=this;t.settings.autoplay&&b(this._i)&&(this._i=setInterval((function(){n.stop(),e.Run.make(">"),n.start()}),this.time))},stop:function(){this._i=clearInterval(this._i)},bind:function(){var t=this;i.on("mouseover",e.Html.root,(function(){t.stop()})),i.on("mouseout",e.Html.root,(function(){t.start()}))},unbind:function(){i.off(["mouseover","mouseout"],e.Html.root)}};return k(r,"time",{get:function(){var n=e.Html.slides[t.index].getAttribute("data-glide-autoplay");return h(n||t.settings.autoplay)}}),n.on(["destroy","update"],(function(){r.unbind()})),n.on(["run.before","pause","destroy","swipe.start","update"],(function(){r.stop()})),n.on(["run.after","play","swipe.end"],(function(){r.start()})),n.on("update",(function(){r.mount()})),n.on("destroy",(function(){i.destroy()})),r}function vt(t){return m(t)?S(t):(o("Breakpoints option must be an object"),{})}function mt(t,e,n){var i=new G,r=t.settings,o=vt(r.breakpoints),s=l({},r),u={match:function(t){if("undefined"!==typeof window.matchMedia)for(var e in t)if(t.hasOwnProperty(e)&&window.matchMedia("(max-width: "+e+"px)").matches)return t[e];return s}};return l(r,u.match(o)),i.on("resize",window,j((function(){t.settings=x(r,u.match(o))}),t.settings.throttle)),n.on("update",(function(){o=vt(o),s=l({},r)})),n.on("destroy",(function(){i.off("resize",window)})),u}var gt={Html:L,Translate:Q,Transition:Z,Direction:q,Peek:B,Sizes:R,Gaps:M,Move:z,Clones:D,Resize:V,Build:$,Run:H,Swipe:ut,Images:at,Anchors:lt,Controls:ft,Keyboard:ht,Autoplay:pt,Breakpoints:mt},yt=function(t){function e(){return u(this,e),f(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return d(e,t),a(e,[{key:"mount",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return c(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"mount",this).call(this,l({},gt,t))}}]),e}(O),bt=yt,wt=(n("4d21"),["build.after","build.before","mount.after","mount.before","move.after","move","pause","play","resize","run.after","run.before","run.end","run.offset","run.start","run","swipe.end","swipe.move","swipe.start","translate.jump","update"]),_t={name:"VueGlide",model:{prop:"active",event:"change"},props:{type:{type:String,default:"slider"},startAt:{type:Number,default:0},perView:{type:Number,default:3},focusAt:{type:[String,Number],default:0},gap:{type:Number,default:10},autoplay:{type:[Number,Boolean],default:!1},hoverpause:{type:Boolean,default:!0},keyboard:{type:Boolean,default:!0},bound:{type:Boolean,default:!1},swipeThreshold:{type:[Number,Boolean],default:80},dragThreshold:{type:[Number,Boolean],default:120},perTouch:{type:[Number,Boolean],default:!1},touchRatio:{type:Number,default:.5},touchAngle:{type:Number,default:45},animationDuration:{type:Number,default:400},rewind:{type:Boolean,default:!0},rewindDuration:{type:Number,default:800},animationTimingFunc:{type:String,default:"cubic-bezier(0.165, 0.840, 0.440, 1.000)"},direction:{type:String,default:"ltr"},peek:{type:[Number,Object],default:0},breakpoints:{type:Object,default:function(){}},classes:{type:Object,default:function(){}},throttle:{type:Number,default:25},toSlideByClick:{type:Boolean,default:!1},bullet:{type:Boolean,default:!1},options:{type:Object,default:function(){}},active:{type:Number,default:null}},data:function(){return{glide:void 0}},render:function(t){var e,n,i=[],r=this.$slots.default.filter((function(t){var e=!1;return t.componentOptions&&(e="VueGlideSlide"===t.componentOptions.tag||"vue-glide-slide"===t.componentOptions.tag),e}));if(this.$slots.control&&this.$slots.control.length&&(e=t("div",{attrs:{"data-glide-el":"controls"}},[this.$slots.control])),this.bullet){for(var o=0;o<this.slidesCount;o++)i.push(t("button",{key:o,attrs:{"data-glide-dir":"="+o,class:"glide__bullet"}}));n=t("div",{class:"glide__bullets",attrs:{"data-glide-el":"controls[nav]"}},[i])}return t("div",{class:"glide"},[t("div",{class:"glide__track",attrs:{"data-glide-el":"track"}},[t("ul",{class:"glide__slides"},[r])]),e,n])},watch:{active:function(){this.changeSlideByModel()}},computed:{currentSlide:function(){return this.glide.index},slidesCount:function(){return this.$slots.default.filter((function(t){return t.componentOptions&&"vue-glide-slide"===t.componentOptions.tag})).length}},mounted:function(){this.init()},methods:{init:function(){var t={direction:{ltr:"glide--ltr",rtl:"glide--rtl"},slider:"glide--slider",carousel:"glide--carousel",swipeable:"glide--swipeable",dragging:"glide--dragging",cloneSlide:"glide__slide--clone",activeNav:"glide__bullet--active",activeSlide:"glide__slide--active",disabledArrow:"glide__arrow--disabled"},e=Object.assign({},this.$props);delete e.options,e.classes=Object.assign(t,this.classes);var n=Object.assign(e,this.options);this.toSlideByClick&&this.goToSlideByClick(),this.glide=new bt(this.$el,n),this.eventConnector(wt),this.glide.mount(),this.addEventListenerToSlide(),this.bindModel(),this.changeSlideByModel()},go:function(t){this.glide.go(t)},goToSlideByClick:function(){var t=this;this.$on("glide:slide-click",(function(e){return t.go("=".concat(e))}))},eventConnector:function(t){var e=this;t.map((function(t){e.glide.on(t,(function(n){var i=t.replace(/\./,"-");e.$emit("glide:".concat(i),n)}))}))},bindModel:function(){var t=this;this.$on("glide:move",(function(){t.$emit("change",t.currentSlide)}))},changeSlideByModel:function(){if(null!==this.active)return this.active>this.slidesCount-1?this.go("=".concat(this.slidesCount-1)):this.active<0?this.go("=0"):void this.go("=".concat(this.active))},addEventListenerToSlide:function(){var t=this,e=document.querySelectorAll(".glide__slide");e=Array.from(e),e.forEach((function(e){e.addEventListener("click",(function(e){var n=function e(n){var i=n.parentNode,r=i.classList.contains("glide__slide");if(r)return t.$emit("glide:slide-click",Number(i.dataset.glideIndex));e(i)};e.target.classList.contains("glide__slide")||n(e.target),t.$emit("glide:slide-click",Number(e.target.dataset.glideIndex))}))}))}}},kt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("li",{staticClass:"glide__slide",attrs:{"data-glide-index":t.index}},[t._t("default")],2)},St=[],xt={name:"VueGlideSlide",computed:{index:function(){var t=this;return this.$parent.$children.findIndex((function(e){return e._uid===t._uid}))}}},Tt=xt;function Ot(t,e,n,i,r,o,s,u){var a,l="function"===typeof t?t.options:t;if(e&&(l.render=e,l.staticRenderFns=n,l._compiled=!0),i&&(l.functional=!0),o&&(l._scopeId="data-v-"+o),s?(a=function(t){t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,t||"undefined"===typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),r&&r.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(s)},l._ssrRegister=a):r&&(a=u?function(){r.call(this,this.$root.$options.shadowRoot)}:r),a)if(l.functional){l._injectStyles=a;var c=l.render;l.render=function(t,e){return a.call(e),c(t,e)}}else{var d=l.beforeCreate;l.beforeCreate=d?[].concat(d,a):[a]}return{exports:t,options:l}}var Ht=Ot(Tt,kt,St,!1,null,null,null),Ct=Ht.exports,jt={install:function(t,e){t.component(_t.name,_t),t.component(Ct.name,Ct)}};n.d(e,"Glide",(function(){return _t})),n.d(e,"GlideSlide",(function(){return Ct}));e["default"]=jt}})})); //# sourceMappingURL=vue-glide.umd.min.js.map