Brak opisu

slick.min.js 28KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457
  1. ! function(a) {
  2. "use strict";
  3. "function" == typeof define && define.amd ? define(["jquery"], a) : a(jQuery)
  4. }(function(a) {
  5. "use strict";
  6. var b = window.Slick || {};
  7. b = function() {
  8. function c(c, d) {
  9. var f, g, e = this;
  10. if(e.defaults = {
  11. accessibility: !0,
  12. arrows: !0,
  13. autoplay: !1,
  14. autoplaySpeed: 3e3,
  15. centerMode: !1,
  16. centerPadding: "50px",
  17. cssEase: "ease",
  18. customPaging: function(a, b) {
  19. return '<button type="button">' + (b + 1) + "</button>"
  20. },
  21. dots: !1,
  22. draggable: !0,
  23. easing: "linear",
  24. fade: !1,
  25. infinite: !0,
  26. lazyLoad: "ondemand",
  27. onBeforeChange: null,
  28. onAfterChange: null,
  29. onInit: null,
  30. onReInit: null,
  31. pauseOnHover: !0,
  32. responsive: null,
  33. slide: "div",
  34. slidesToShow: 1,
  35. slidesToScroll: 1,
  36. speed: 300,
  37. swipe: !0,
  38. touchMove: !0,
  39. touchThreshold: 5,
  40. vertical: !1
  41. }, e.initials = {
  42. animating: !1,
  43. autoPlayTimer: null,
  44. currentSlide: 0,
  45. currentLeft: null,
  46. direction: 1,
  47. $dots: null,
  48. listWidth: null,
  49. listHeight: null,
  50. loadIndex: 0,
  51. $nextArrow: null,
  52. $prevArrow: null,
  53. slideCount: null,
  54. slideWidth: null,
  55. $slideTrack: null,
  56. $slides: null,
  57. sliding: !1,
  58. slideOffset: 0,
  59. swipeLeft: null,
  60. $list: null,
  61. touchObject: {},
  62. transformsEnabled: !1
  63. }, a.extend(e, e.initials), e.activeBreakpoint = null, e.animType = null, e.animProp = null, e.breakpoints = [], e.breakpointSettings = [], e.cssTransitions = !1, e.paused = !1, e.positionProp = null, e.$slider = a(c), e.$slidesCache = null, e.transformType = null, e.transitionType = null, e.windowWidth = 0, e.windowTimer = null, e.options = a.extend({}, e.defaults, d), e.originalSettings = e.options, f = e.options.responsive || null, f && f.length > -1) {
  64. for(g in f) f.hasOwnProperty(g) && (e.breakpoints.push(f[g].breakpoint), e.breakpointSettings[f[g].breakpoint] = f[g].settings);
  65. e.breakpoints.sort(function(a, b) {
  66. return b - a
  67. })
  68. }
  69. e.autoPlay = a.proxy(e.autoPlay, e), e.autoPlayClear = a.proxy(e.autoPlayClear, e), e.changeSlide = a.proxy(e.changeSlide, e), e.setPosition = a.proxy(e.setPosition, e), e.swipeHandler = a.proxy(e.swipeHandler, e), e.dragHandler = a.proxy(e.dragHandler, e), e.keyHandler = a.proxy(e.keyHandler, e), e.autoPlayIterator = a.proxy(e.autoPlayIterator, e), e.instanceUid = b++, e.init()
  70. }
  71. var b = 0;
  72. return c
  73. }(), b.prototype.addSlide = function(b, c, d) {
  74. var e = this;
  75. if("boolean" == typeof c) d = c, c = null;
  76. else if(0 > c || c >= e.slideCount) return !1;
  77. e.unload(), "number" == typeof c ? 0 === c && 0 === e.$slides.length ? a(b).appendTo(e.$slideTrack) : d ? a(b).insertBefore(e.$slides.eq(c)) : a(b).insertAfter(e.$slides.eq(c)) : d === !0 ? a(b).prependTo(e.$slideTrack) : a(b).appendTo(e.$slideTrack), e.$slides = e.$slideTrack.children(this.options.slide), e.$slideTrack.children(this.options.slide).remove(), e.$slideTrack.append(e.$slides), e.$slidesCache = e.$slides, e.reinit()
  78. }, b.prototype.animateSlide = function(b, c) {
  79. var d = {},
  80. e = this;
  81. e.transformsEnabled === !1 ? e.options.vertical === !1 ? e.$slideTrack.animate({
  82. left: b
  83. }, e.options.speed, e.options.easing, c) : e.$slideTrack.animate({
  84. top: b
  85. }, e.options.speed, e.options.easing, c) : e.cssTransitions === !1 ? a({
  86. animStart: e.currentLeft
  87. }).animate({
  88. animStart: b
  89. }, {
  90. duration: e.options.speed,
  91. easing: e.options.easing,
  92. step: function(a) {
  93. e.options.vertical === !1 ? (d[e.animType] = "translate(" + a + "px, 0px)", e.$slideTrack.css(d)) : (d[e.animType] = "translate(0px," + a + "px)", e.$slideTrack.css(d))
  94. },
  95. complete: function() {
  96. c && c.call()
  97. }
  98. }) : (e.applyTransition(), d[e.animType] = e.options.vertical === !1 ? "translate3d(" + b + "px, 0px, 0px)" : "translate3d(0px," + b + "px, 0px)", e.$slideTrack.css(d), c && setTimeout(function() {
  99. e.disableTransition(), c.call()
  100. }, e.options.speed))
  101. }, b.prototype.applyTransition = function(a) {
  102. var b = this,
  103. c = {};
  104. c[b.transitionType] = b.options.fade === !1 ? b.transformType + " " + b.options.speed + "ms " + b.options.cssEase : "opacity " + b.options.speed + "ms " + b.options.cssEase, b.options.fade === !1 ? b.$slideTrack.css(c) : b.$slides.eq(a).css(c)
  105. }, b.prototype.autoPlay = function() {
  106. var a = this;
  107. a.autoPlayTimer && clearInterval(a.autoPlayTimer), a.slideCount > a.options.slidesToShow && a.paused !== !0 && (a.autoPlayTimer = setInterval(a.autoPlayIterator, a.options.autoplaySpeed))
  108. }, b.prototype.autoPlayClear = function() {
  109. var a = this;
  110. a.autoPlayTimer && clearInterval(a.autoPlayTimer)
  111. }, b.prototype.autoPlayIterator = function() {
  112. var a = this;
  113. a.options.infinite === !1 ? 1 === a.direction ? (a.currentSlide + 1 === a.slideCount - 1 && (a.direction = 0), a.slideHandler(a.currentSlide + a.options.slidesToScroll)) : (0 === a.currentSlide - 1 && (a.direction = 1), a.slideHandler(a.currentSlide - a.options.slidesToScroll)) : a.slideHandler(a.currentSlide + a.options.slidesToScroll)
  114. }, b.prototype.buildArrows = function() {
  115. var b = this;
  116. b.options.arrows === !0 && b.slideCount > b.options.slidesToShow && (b.$prevArrow = a('<button type="button" class="slick-prev">Previous</button>').appendTo(b.$slider), b.$nextArrow = a('<button type="button" class="slick-next">Next</button>').appendTo(b.$slider), b.options.infinite !== !0 && b.$prevArrow.addClass("slick-disabled"))
  117. }, b.prototype.buildDots = function() {
  118. var c, d, b = this;
  119. if(b.options.dots === !0 && b.slideCount > b.options.slidesToShow) {
  120. for(d = '<ul class="slick-dots">', c = 0; c <= b.getDotCount(); c += 1) d += "<li>" + b.options.customPaging.call(this, b, c) + "</li>";
  121. d += "</ul>", b.$dots = a(d).appendTo(b.$slider), b.$dots.find("li").first().addClass("slick-active")
  122. }
  123. }, b.prototype.buildOut = function() {
  124. var b = this;
  125. b.$slides = b.$slider.children(b.options.slide + ":not(.slick-cloned)").addClass("slick-slide"), b.slideCount = b.$slides.length, b.$slidesCache = b.$slides, b.$slider.addClass("slick-slider"), b.$slideTrack = 0 === b.slideCount ? a('<div class="slick-track"/>').appendTo(b.$slider) : b.$slides.wrapAll('<div class="slick-track"/>').parent(), b.$list = b.$slideTrack.wrap('<div class="slick-list"/>').parent(), b.$slideTrack.css("opacity", 0), b.options.centerMode === !0 && (b.options.infinite = !0, b.options.slidesToScroll = 1, 0 === b.options.slidesToShow % 2 && (b.options.slidesToShow = 3)), a("img[data-lazy]", b.$slider).not("[src]").addClass("slick-loading"), b.setupInfinite(), b.buildArrows(), b.buildDots(), b.options.accessibility === !0 && b.$list.prop("tabIndex", 0), b.setSlideClasses(0), b.options.draggable === !0 && b.$list.addClass("draggable")
  126. }, b.prototype.checkResponsive = function() {
  127. var c, d, b = this;
  128. if(b.originalSettings.responsive && b.originalSettings.responsive.length > -1 && null !== b.originalSettings.responsive) {
  129. d = null;
  130. for(c in b.breakpoints) b.breakpoints.hasOwnProperty(c) && a(window).width() < b.breakpoints[c] && (d = b.breakpoints[c]);
  131. null !== d ? null !== b.activeBreakpoint ? d !== b.activeBreakpoint && (b.activeBreakpoint = d, b.options = a.extend({}, b.defaults, b.breakpointSettings[d]), b.refresh()) : (b.activeBreakpoint = d, b.options = a.extend({}, b.defaults, b.breakpointSettings[d]), b.refresh()) : null !== b.activeBreakpoint && (b.activeBreakpoint = null, b.options = a.extend({}, b.defaults, b.originalSettings), b.refresh())
  132. }
  133. }, b.prototype.changeSlide = function(b) {
  134. var c = this;
  135. switch(b.data.message) {
  136. case "previous":
  137. c.slideHandler(c.currentSlide - c.options.slidesToScroll);
  138. break;
  139. case "next":
  140. c.slideHandler(c.currentSlide + c.options.slidesToScroll);
  141. break;
  142. case "index":
  143. c.slideHandler(a(b.target).parent().index() * c.options.slidesToScroll);
  144. break;
  145. default:
  146. return !1
  147. }
  148. }, b.prototype.destroy = function() {
  149. var b = this;
  150. b.autoPlayClear(), b.touchObject = {}, a(".slick-cloned", b.$slider).remove(), b.$dots && b.$dots.remove(), b.$prevArrow && (b.$prevArrow.remove(), b.$nextArrow.remove()), b.$slides.unwrap().unwrap(), b.$slides.removeClass("slick-slide slick-active slick-visible").removeAttr("style"), b.$slider.removeClass("slick-slider"), b.$slider.removeClass("slick-initialized"), b.$list.off(".slick"), a(window).off(".slick-" + b.instanceUid)
  151. }, b.prototype.disableTransition = function(a) {
  152. var b = this,
  153. c = {};
  154. c[b.transitionType] = "", b.options.fade === !1 ? b.$slideTrack.css(c) : b.$slides.eq(a).css(c)
  155. }, b.prototype.fadeSlide = function(a, b) {
  156. var c = this;
  157. c.cssTransitions === !1 ? (c.$slides.eq(a).css({
  158. zIndex: 1e3
  159. }), c.$slides.eq(a).animate({
  160. opacity: 1
  161. }, c.options.speed, c.options.easing, b)) : (c.applyTransition(a), c.$slides.eq(a).css({
  162. opacity: 1,
  163. zIndex: 1e3
  164. }), b && setTimeout(function() {
  165. c.disableTransition(a), b.call()
  166. }, c.options.speed))
  167. }, b.prototype.filterSlides = function(a) {
  168. var b = this;
  169. null !== a && (b.unload(), b.$slideTrack.children(this.options.slide).remove(), b.$slidesCache.filter(a).appendTo(b.$slideTrack), b.reinit())
  170. }, b.prototype.getCurrent = function() {
  171. var a = this;
  172. return a.currentSlide
  173. }, b.prototype.getDotCount = function() {
  174. var e, a = this,
  175. b = 0,
  176. c = 0,
  177. d = 0;
  178. for(e = a.options.infinite === !0 ? a.slideCount + a.options.slidesToShow - a.options.slidesToScroll : a.slideCount; e > b;) d++, c += a.options.slidesToScroll, b = c + a.options.slidesToShow;
  179. return d
  180. }, b.prototype.getLeft = function(a) {
  181. var c, b = this;
  182. return b.slideOffset = 0, b.options.infinite === !0 ? (b.slideCount > b.options.slidesToShow && (b.slideOffset = -1 * b.slideWidth * b.options.slidesToShow), 0 !== b.slideCount % b.options.slidesToScroll && a + b.options.slidesToScroll > b.slideCount && b.slideCount > b.options.slidesToShow && (b.slideOffset = -1 * b.slideCount % b.options.slidesToShow * b.slideWidth)) : 0 !== b.slideCount % b.options.slidesToShow && a + b.options.slidesToScroll > b.slideCount && b.slideCount > b.options.slidesToShow && (b.slideOffset = b.slideCount % b.options.slidesToShow * b.slideWidth), b.options.centerMode === !0 && (b.slideOffset += b.slideWidth * Math.floor(b.options.slidesToShow / 2) - b.slideWidth), b.options.vertical === !1 ? c = -1 * a * b.slideWidth + b.slideOffset : (b.listHeight = b.$list.height(), c = b.options.infinite === !0 ? -1 * a * b.listHeight - b.listHeight : -1 * a * b.listHeight), c
  183. }, b.prototype.init = function() {
  184. var b = this;
  185. a(b.$slider).hasClass("slick-initialized") || (a(b.$slider).addClass("slick-initialized"), b.buildOut(), b.setProps(), b.startLoad(), b.loadSlider(), b.initializeEvents(), b.checkResponsive()), null !== b.options.onInit && b.options.onInit.call(this, b)
  186. }, b.prototype.initArrowEvents = function() {
  187. var a = this;
  188. a.options.arrows === !0 && a.slideCount > a.options.slidesToShow && (a.$prevArrow.on("click.slick", {
  189. message: "previous"
  190. }, a.changeSlide), a.$nextArrow.on("click.slick", {
  191. message: "next"
  192. }, a.changeSlide))
  193. }, b.prototype.initDotEvents = function() {
  194. var b = this;
  195. b.options.dots === !0 && b.slideCount > b.options.slidesToShow && a("li", b.$dots).on("click.slick", {
  196. message: "index"
  197. }, b.changeSlide)
  198. }, b.prototype.initializeEvents = function() {
  199. var b = this;
  200. b.initArrowEvents(), b.initDotEvents(), b.$list.on("touchstart.slick mousedown.slick", {
  201. action: "start"
  202. }, b.swipeHandler), b.$list.on("touchmove.slick mousemove.slick", {
  203. action: "move"
  204. }, b.swipeHandler), b.$list.on("touchend.slick mouseup.slick", {
  205. action: "end"
  206. }, b.swipeHandler), b.$list.on("touchcancel.slick mouseleave.slick", {
  207. action: "end"
  208. }, b.swipeHandler), b.options.pauseOnHover === !0 && b.options.autoplay === !0 && (b.$list.on("mouseenter.slick", b.autoPlayClear), b.$list.on("mouseleave.slick", b.autoPlay)), b.options.accessibility === !0 && b.$list.on("keydown.slick", b.keyHandler), a(window).on("orientationchange.slick.slick-" + b.instanceUid, function() {
  209. b.checkResponsive(), b.setPosition()
  210. }), a(window).on("resize.slick.slick-" + b.instanceUid, function() {
  211. a(window).width !== b.windowWidth && (clearTimeout(b.windowDelay), b.windowDelay = window.setTimeout(function() {
  212. b.windowWidth = a(window).width(), b.checkResponsive(), b.setPosition()
  213. }, 50))
  214. }), a(window).on("load.slick.slick-" + b.instanceUid, b.setPosition)
  215. }, b.prototype.initUI = function() {
  216. var a = this;
  217. a.options.arrows === !0 && a.slideCount > a.options.slidesToShow && (a.$prevArrow.show(), a.$nextArrow.show()), a.options.dots === !0 && a.slideCount > a.options.slidesToShow && a.$dots.show(), a.options.autoplay === !0 && a.autoPlay()
  218. }, b.prototype.keyHandler = function(a) {
  219. var b = this;
  220. 37 === a.keyCode ? b.changeSlide({
  221. data: {
  222. message: "previous"
  223. }
  224. }) : 39 === a.keyCode && b.changeSlide({
  225. data: {
  226. message: "next"
  227. }
  228. })
  229. }, b.prototype.lazyLoad = function() {
  230. var c, d, e, f, b = this;
  231. b.options.centerMode === !0 ? (e = b.options.slidesToShow + b.currentSlide - 1, f = e + b.options.slidesToShow + 2) : (e = b.options.infinite ? b.options.slidesToShow + b.currentSlide : b.currentSlide, f = e + b.options.slidesToShow), c = b.$slider.find(".slick-slide").slice(e, f), a("img[data-lazy]", c).not("[src]").each(function() {
  232. a(this).css({
  233. opacity: 0
  234. }).attr("src", a(this).attr("data-lazy")).removeClass("slick-loading").load(function() {
  235. a(this).animate({
  236. opacity: 1
  237. }, 200)
  238. })
  239. }), b.currentSlide >= b.slideCount - b.options.slidesToShow ? (d = b.$slider.find(".slick-cloned").slice(0, b.options.slidesToShow), a("img[data-lazy]", d).not("[src]").each(function() {
  240. a(this).css({
  241. opacity: 0
  242. }).attr("src", a(this).attr("data-lazy")).removeClass("slick-loading").load(function() {
  243. a(this).animate({
  244. opacity: 1
  245. }, 200)
  246. })
  247. })) : 0 === b.currentSlide && (d = b.$slider.find(".slick-cloned").slice(-1 * b.options.slidesToShow), a("img[data-lazy]", d).not("[src]").each(function() {
  248. a(this).css({
  249. opacity: 0
  250. }).attr("src", a(this).attr("data-lazy")).removeClass("slick-loading").load(function() {
  251. a(this).animate({
  252. opacity: 1
  253. }, 200)
  254. })
  255. }))
  256. }, b.prototype.loadSlider = function() {
  257. var a = this;
  258. a.setPosition(), a.$slideTrack.css({
  259. opacity: 1
  260. }), a.$slider.removeClass("slick-loading"), a.initUI(), "progressive" === a.options.lazyLoad && a.progressiveLazyLoad()
  261. }, b.prototype.postSlide = function(a) {
  262. var b = this;
  263. null !== b.options.onAfterChange && b.options.onAfterChange.call(this, b, a), b.animating = !1, b.setPosition(), b.swipeLeft = null, b.options.autoplay === !0 && b.paused === !1 && b.autoPlay(), b.setSlideClasses(b.currentSlide)
  264. }, b.prototype.progressiveLazyLoad = function() {
  265. var c, d, b = this;
  266. c = a("img[data-lazy]").not("[src]").length, c > 0 && (d = a(a("img[data-lazy]", b.$slider).not("[src]").get(0)), d.attr("src", d.attr("data-lazy")).removeClass("slick-loading").load(function() {
  267. b.progressiveLazyLoad()
  268. }))
  269. }, b.prototype.refresh = function() {
  270. var b = this;
  271. b.destroy(), a.extend(b, b.initials), b.init()
  272. }, b.prototype.reinit = function() {
  273. var b = this;
  274. b.$slides = a(b.options.slide + ":not(.slick-cloned)", b.$slideTrack).addClass("slick-slide"), b.slideCount = b.$slides.length, b.currentSlide >= b.slideCount && 0 !== b.currentSlide && (b.currentSlide = b.currentSlide - b.options.slidesToScroll), b.setProps(), b.setupInfinite(), b.buildArrows(), b.updateArrows(), b.initArrowEvents(), b.buildDots(), b.updateDots(), b.initDotEvents(), b.setSlideClasses(0), b.setPosition(), null !== b.options.onReInit && b.options.onReInit.call(this, b)
  275. }, b.prototype.removeSlide = function(a, b) {
  276. var c = this;
  277. return "boolean" == typeof a ? (b = a, a = b === !0 ? 0 : c.slideCount - 1) : a = b === !0 ? --a : a, c.slideCount < 1 || 0 > a || a > c.slideCount - 1 ? !1 : (c.unload(), c.$slideTrack.children(this.options.slide).eq(a).remove(), c.$slides = c.$slideTrack.children(this.options.slide), c.$slideTrack.children(this.options.slide).remove(), c.$slideTrack.append(c.$slides), c.$slidesCache = c.$slides, c.reinit(), void 0)
  278. }, b.prototype.setCSS = function(a) {
  279. var d, e, b = this,
  280. c = {};
  281. d = "left" == b.positionProp ? a + "px" : "0px", e = "top" == b.positionProp ? a + "px" : "0px", c[b.positionProp] = a, b.transformsEnabled === !1 ? b.$slideTrack.css(c) : (c = {}, b.cssTransitions === !1 ? (c[b.animType] = "translate(" + d + ", " + e + ")", b.$slideTrack.css(c)) : (c[b.animType] = "translate3d(" + d + ", " + e + ", 0px)", b.$slideTrack.css(c)))
  282. }, b.prototype.setDimensions = function() {
  283. var a = this;
  284. a.options.centerMode === !0 ? a.$slideTrack.children(".slick-slide").width(a.slideWidth) : a.$slideTrack.children(".slick-slide").width(a.slideWidth), a.options.vertical === !1 ? (a.$slideTrack.width(Math.ceil(a.slideWidth * a.$slideTrack.children(".slick-slide").length)), a.options.centerMode === !0 && a.$list.css({
  285. // a.options.centerMode === !0 ? a.$slideTrack.children(".slick-slide").width('252px') : a.$slideTrack.children(".slick-slide").width('252px'), a.options.vertical === !1 ? (a.$slideTrack.width(Math.ceil(a.slideWidth * a.$slideTrack.children(".slick-slide").length)), a.options.centerMode === !0 && a.$list.css({
  286. padding: "0px " + a.options.centerPadding
  287. })) : (a.$list.height(a.$slides.first().outerHeight()), a.$slideTrack.height(Math.ceil(a.listHeight * a.$slideTrack.children(".slick-slide").length)), a.options.centerMode === !0 && a.$list.css({
  288. padding: a.options.centerPadding + " 0px"
  289. }))
  290. }, b.prototype.setFade = function() {
  291. var c, b = this;
  292. b.$slides.each(function(d, e) {
  293. c = -1 * b.slideWidth * d, a(e).css({
  294. position: "relative",
  295. left: c,
  296. top: 0,
  297. zIndex: 800,
  298. opacity: 0
  299. })
  300. }), b.$slides.eq(b.currentSlide).css({
  301. zIndex: 900,
  302. opacity: 1
  303. })
  304. }, b.prototype.setPosition = function() {
  305. var a = this;
  306. a.setValues(), a.setDimensions(), a.options.fade === !1 ? a.setCSS(a.getLeft(a.currentSlide)) : a.setFade()
  307. }, b.prototype.setProps = function() {
  308. var a = this;
  309. a.positionProp = a.options.vertical === !0 ? "top" : "left", "top" === a.positionProp ? a.$slider.addClass("slick-vertical") : a.$slider.removeClass("slick-vertical"), (void 0 !== document.body.style.WebkitTransition || void 0 !== document.body.style.MozTransition || void 0 !== document.body.style.msTransition) && (a.cssTransitions = !0), void 0 !== document.body.style.MozTransform && (a.animType = "MozTransform", a.transformType = "-moz-transform", a.transitionType = "MozTransition"), void 0 !== document.body.style.webkitTransform && (a.animType = "webkitTransform", a.transformType = "-webkit-transform", a.transitionType = "webkitTransition"), void 0 !== document.body.style.msTransform && (a.animType = "transform", a.transformType = "transform", a.transitionType = "transition"), a.transformsEnabled = null !== a.animType
  310. }, b.prototype.setValues = function() {
  311. var a = this;
  312. a.listWidth = a.$list.width(), a.listHeight = a.$list.height(), a.slideWidth = Math.ceil(a.listWidth / a.options.slidesToShow)
  313. }, b.prototype.setSlideClasses = function(a) {
  314. var c, d, e, b = this;
  315. b.$slider.find(".slick-slide").removeClass("slick-active").removeClass("slick-center"), d = b.$slider.find(".slick-slide"), b.options.centerMode === !0 ? (c = Math.floor(b.options.slidesToShow / 2), a >= c && a <= b.slideCount - 1 - c ? b.$slides.slice(a - c, a + c + 1).addClass("slick-active") : (e = b.options.slidesToShow + a, d.slice(e - c + 1, e + c + 2).addClass("slick-active")), 0 === a ? d.eq(d.length - 1 - b.options.slidesToShow).addClass("slick-center") : a === b.slideCount - 1 && d.eq(b.options.slidesToShow).addClass("slick-center"), b.$slides.eq(a).addClass("slick-center")) : a > 0 && a < b.slideCount - b.options.slidesToShow ? b.$slides.slice(a, a + b.options.slidesToShow).addClass("slick-active") : (e = b.options.slidesToShow + a, d.slice(e, e + b.options.slidesToShow).addClass("slick-active")), "ondemand" === b.options.lazyLoad && b.lazyLoad()
  316. }, b.prototype.setupInfinite = function() {
  317. var c, d, e, b = this;
  318. if((b.options.fade === !0 || b.options.vertical === !0) && (b.options.slidesToShow = 1, b.options.slidesToScroll = 1, b.options.centerMode = !1), b.options.infinite === !0 && b.options.fade === !1 && (d = null, b.slideCount > b.options.slidesToShow)) {
  319. for(e = b.options.centerMode === !0 ? b.options.slidesToShow + 1 : b.options.slidesToShow, c = b.slideCount; c > b.slideCount - e; c -= 1) d = c - 1, a(b.$slides[d]).clone().attr("id", "").prependTo(b.$slideTrack).addClass("slick-cloned");
  320. for(c = 0; e > c; c += 1) d = c, a(b.$slides[d]).clone().attr("id", "").appendTo(b.$slideTrack).addClass("slick-cloned");
  321. b.$slideTrack.find(".slick-cloned").find("[id]").each(function() {
  322. a(this).attr("id", "")
  323. })
  324. }
  325. }, b.prototype.slideHandler = function(a) {
  326. var b, c, d, e, f = null,
  327. g = this;
  328. return g.animating === !0 ? !1 : (b = a, f = g.getLeft(b), d = g.getLeft(g.currentSlide), e = 0 !== g.slideCount % g.options.slidesToScroll ? g.options.slidesToScroll : 0, g.currentLeft = null === g.swipeLeft ? d : g.swipeLeft, g.options.infinite === !1 && (0 > a || a > g.slideCount - g.options.slidesToShow + e) ? (b = g.currentSlide, g.animateSlide(d, function() {
  329. g.postSlide(b)
  330. }), !1) : (g.options.autoplay === !0 && clearInterval(g.autoPlayTimer), c = 0 > b ? 0 !== g.slideCount % g.options.slidesToScroll ? g.slideCount - g.slideCount % g.options.slidesToScroll : g.slideCount - g.options.slidesToScroll : b > g.slideCount - 1 ? 0 : b, g.animating = !0, null !== g.options.onBeforeChange && a !== g.currentSlide && g.options.onBeforeChange.call(this, g, g.currentSlide, c), g.currentSlide = c, g.updateDots(), g.updateArrows(), g.options.fade === !0 ? (g.fadeSlide(c, function() {
  331. g.postSlide(c)
  332. }), !1) : (g.animateSlide(f, function() {
  333. g.postSlide(c)
  334. }), void 0)))
  335. }, b.prototype.startLoad = function() {
  336. var a = this;
  337. a.options.arrows === !0 && a.slideCount > a.options.slidesToShow && (a.$prevArrow.hide(), a.$nextArrow.hide()), a.options.dots === !0 && a.slideCount > a.options.slidesToShow && a.$dots.hide(), a.$slider.addClass("slick-loading")
  338. }, b.prototype.swipeDirection = function() {
  339. var a, b, c, d, e = this;
  340. return a = e.touchObject.startX - e.touchObject.curX, b = e.touchObject.startY - e.touchObject.curY, c = Math.atan2(b, a), d = Math.round(180 * c / Math.PI), 0 > d && (d = 360 - Math.abs(d)), 45 >= d && d >= 0 ? "left" : 360 >= d && d >= 315 ? "left" : d >= 135 && 225 >= d ? "right" : "vertical"
  341. }, b.prototype.swipeEnd = function(b) {
  342. var c = this;
  343. if(c.$list.removeClass("dragging"), void 0 === c.touchObject.curX) return !1;
  344. if(c.touchObject.swipeLength >= c.touchObject.minSwipe) switch(a(b.target).on("click.slick", function(b) {
  345. b.stopImmediatePropagation(), b.stopPropagation(), b.preventDefault(), a(b.target).off("click.slick")
  346. }), c.swipeDirection()) {
  347. case "left":
  348. c.slideHandler(c.currentSlide + c.options.slidesToScroll), c.touchObject = {};
  349. break;
  350. case "right":
  351. c.slideHandler(c.currentSlide - c.options.slidesToScroll), c.touchObject = {}
  352. } else c.touchObject.startX !== c.touchObject.curX && (c.slideHandler(c.currentSlide), c.touchObject = {})
  353. }, b.prototype.swipeHandler = function(a) {
  354. var b = this;
  355. if("ontouchend" in document && b.options.swipe === !1) return !1;
  356. if(b.options.draggable === !1 && !a.originalEvent.touches) return !1;
  357. switch(b.touchObject.fingerCount = a.originalEvent && void 0 !== a.originalEvent.touches ? a.originalEvent.touches.length : 1, b.touchObject.minSwipe = b.listWidth / b.options.touchThreshold, a.data.action) {
  358. case "start":
  359. b.swipeStart(a);
  360. break;
  361. case "move":
  362. b.swipeMove(a);
  363. break;
  364. case "end":
  365. b.swipeEnd(a)
  366. }
  367. }, b.prototype.swipeMove = function(a) {
  368. var c, d, e, f, b = this;
  369. return f = void 0 !== a.originalEvent ? a.originalEvent.touches : null, c = b.getLeft(b.currentSlide), !b.$list.hasClass("dragging") || f && 1 !== f.length ? !1 : (b.touchObject.curX = void 0 !== f ? f[0].pageX : a.clientX, b.touchObject.curY = void 0 !== f ? f[0].pageY : a.clientY, b.touchObject.swipeLength = Math.round(Math.sqrt(Math.pow(b.touchObject.curX - b.touchObject.startX, 2))), d = b.swipeDirection(), "vertical" !== d ? (void 0 !== a.originalEvent && b.touchObject.swipeLength > 4 && a.preventDefault(), e = b.touchObject.curX > b.touchObject.startX ? 1 : -1, b.swipeLeft = b.options.vertical === !1 ? c + b.touchObject.swipeLength * e : c + b.touchObject.swipeLength * (b.listHeight / b.listWidth) * e, b.options.fade === !0 || b.options.touchMove === !1 ? !1 : b.animating === !0 ? (b.swipeLeft = null, !1) : (b.setCSS(b.swipeLeft), void 0)) : void 0)
  370. }, b.prototype.swipeStart = function(a) {
  371. var c, b = this;
  372. return 1 !== b.touchObject.fingerCount || b.slideCount <= b.options.slidesToShow ? (b.touchObject = {}, !1) : (void 0 !== a.originalEvent && void 0 !== a.originalEvent.touches && (c = a.originalEvent.touches[0]), b.touchObject.startX = b.touchObject.curX = void 0 !== c ? c.pageX : a.clientX, b.touchObject.startY = b.touchObject.curY = void 0 !== c ? c.pageY : a.clientY, b.$list.addClass("dragging"), void 0)
  373. }, b.prototype.unfilterSlides = function() {
  374. var a = this;
  375. null !== a.$slidesCache && (a.unload(), a.$slideTrack.children(this.options.slide).remove(), a.$slidesCache.appendTo(a.$slideTrack), a.reinit())
  376. }, b.prototype.unload = function() {
  377. var b = this;
  378. a(".slick-cloned", b.$slider).remove(), b.$dots && b.$dots.remove(), b.$prevArrow && (b.$prevArrow.remove(), b.$nextArrow.remove()), b.$slides.removeClass("slick-slide slick-active slick-visible").removeAttr("style")
  379. }, b.prototype.updateArrows = function() {
  380. var a = this;
  381. a.options.arrows === !0 && a.options.infinite !== !0 && a.slideCount > a.options.slidesToShow && (a.$prevArrow.removeClass("slick-disabled"), a.$nextArrow.removeClass("slick-disabled"), 0 === a.currentSlide ? (a.$prevArrow.addClass("slick-disabled"), a.$nextArrow.removeClass("slick-disabled")) : a.currentSlide >= a.slideCount - a.options.slidesToShow && (a.$nextArrow.addClass("slick-disabled"), a.$prevArrow.removeClass("slick-disabled")))
  382. }, b.prototype.updateDots = function() {
  383. var a = this;
  384. null !== a.$dots && (a.$dots.find("li").removeClass("slick-active"), a.$dots.find("li").eq(a.currentSlide / a.options.slidesToScroll).addClass("slick-active"))
  385. }, a.fn.slick = function(a) {
  386. var c = this;
  387. return c.each(function(c, d) {
  388. d.slick = new b(d, a)
  389. })
  390. }, a.fn.slickAdd = function(a, b, c) {
  391. var d = this;
  392. return d.each(function(d, e) {
  393. e.slick.addSlide(a, b, c)
  394. })
  395. }, a.fn.slickCurrentSlide = function() {
  396. var a = this;
  397. return a.get(0).slick.getCurrent()
  398. }, a.fn.slickFilter = function(a) {
  399. var b = this;
  400. return b.each(function(b, c) {
  401. c.slick.filterSlides(a)
  402. })
  403. }, a.fn.slickGoTo = function(a) {
  404. var b = this;
  405. return b.each(function(b, c) {
  406. c.slick.slideHandler(a)
  407. })
  408. }, a.fn.slickNext = function() {
  409. var a = this;
  410. return a.each(function(a, b) {
  411. b.slick.changeSlide({
  412. data: {
  413. message: "next"
  414. }
  415. })
  416. })
  417. }, a.fn.slickPause = function() {
  418. var a = this;
  419. return a.each(function(a, b) {
  420. b.slick.autoPlayClear(), b.slick.paused = !0
  421. })
  422. }, a.fn.slickPlay = function() {
  423. var a = this;
  424. return a.each(function(a, b) {
  425. b.slick.paused = !1, b.slick.autoPlay()
  426. })
  427. }, a.fn.slickPrev = function() {
  428. var a = this;
  429. return a.each(function(a, b) {
  430. b.slick.changeSlide({
  431. data: {
  432. message: "previous"
  433. }
  434. })
  435. })
  436. }, a.fn.slickRemove = function(a, b) {
  437. var c = this;
  438. return c.each(function(c, d) {
  439. d.slick.removeSlide(a, b)
  440. })
  441. }, a.fn.slickSetOption = function(a, b, c) {
  442. var d = this;
  443. return d.each(function(d, e) {
  444. e.slick.options[a] = b, c === !0 && (e.slick.unload(), e.slick.reinit())
  445. })
  446. }, a.fn.slickUnfilter = function() {
  447. var a = this;
  448. return a.each(function(a, b) {
  449. b.slick.unfilterSlides()
  450. })
  451. }, a.fn.unslick = function() {
  452. var a = this;
  453. return a.each(function(a, b) {
  454. b.slick.destroy()
  455. })
  456. }
  457. });