1(window["webpackJsonp"] = window["webpackJsonp"] || []).push([["/scripts/vendor"],{ 2
vendor: 1,609 bytes, lines 3-59
3/***/ "./node_modules/js.cookie/dst/Cookie.js": 4/*!**********************************************!*\ 5 !*** ./node_modules/js.cookie/dst/Cookie.js ***! 6 \**********************************************/ 7/*! no static exports found */ 8/***/ (function(module, exports, __webpack_require__) { 9 10"use strict"; 11 12 13Object.defineProperty(exports, "__esModule", { 14 value: true 15}); 16var Cookie = { 17 18 get: function get(name) { 19 var match = document.cookie.match("(^|;) ?" + name + "=([^;]*)(;|$)"); 20 var value = match ? unescape(match[2]) : match; 21 try { 22 value = JSON.parse(value); 23 } catch (e) {} 24 return value; 25 }, 26 27 set: function set(name, value) { 28 var options = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2]; 29 30 var cookie = name + "=" + escape(JSON.stringify(value)) + "; path=" + (options.path ? escape(options.path) : "/"); 31 if (options.domain) cookie += "; domain=" + escape(options.domain); 32 if (options.secure) cookie += "; secure"; 33 if (options.expires) cookie += "; expires=" + options.expires; 34 if (options.live) cookie += "; expires=" + expiresFromLive(options.live); 35 document.cookie = cookie; 36 return value; 37 }, 38 39 remove: function remove(name) { 40 var value = this.get(name); 41 this.set(name, value, { live: -1 }); 42 return value; 43 } 44 45}; 46 47function expiresFromLive(live) { 48 var date = new Date(); 49 date.setDate(date.getDate() + parseInt(live)); 50 date.setMinutes(date.getMinutes() - date.getTimezoneOffset()); 51 return date.toUTCString(); 52} 53 54exports["default"] = Cookie; 55module.exports = exports["default"]; 56 57 58/***/ }), 59
vendor: 28,630 bytes, lines 60-933
60/***/ "./node_modules/simplelightbox/dist/simple-lightbox.js": 61/*!*************************************************************!*\ 62 !*** ./node_modules/simplelightbox/dist/simple-lightbox.js ***! 63 \*************************************************************/ 64/*! no static exports found */ 65/***/ (function(module, exports) { 66 67/*! 68 By André Rinas, www.andrerinas.de 69 Documentation, www.simplelightbox.de 70 Available for use under the MIT License 71 1.17.3 72*/ 73;( function( $, window, document, undefined ) 74{ 75 'use strict'; 76 77$.fn.simpleLightbox = function( options ) 78{ 79 80 var options = $.extend({ 81 sourceAttr: 'href', 82 overlay: true, 83 spinner: true, 84 nav: true, 85 navText: ['‹', '›'], 86 captions: true, 87 captionDelay: 0, 88 captionSelector: 'img', 89 captionType: 'attr', 90 captionsData: 'title', 91 captionPosition: 'bottom', 92 captionClass: '', 93 close: true, 94 closeText: '×', 95 swipeClose: true, 96 showCounter: true, 97 fileExt: 'png|jpg|jpeg|gif|webp', 98 animationSlide: true, 99 animationSpeed: 250, 100 preloading: true, 101 enableKeyboard: true, 102 loop: true, 103 rel: false, 104 docClose: true, 105 swipeTolerance: 50, 106 className: 'simple-lightbox', 107 widthRatio: 0.8, 108 heightRatio: 0.9, 109 scaleImageToRatio: false, 110 disableRightClick: false, 111 disableScroll: true, 112 alertError: true, 113 alertErrorMessage: 'Image not found, next image will be loaded', 114 additionalHtml: false, 115 history: true, 116 throttleInterval: 0, 117 doubleTapZoom: 2, 118 maxZoom: 10, 119 htmlClass: 'has-lightbox' 120 }, options); 121 122 // global variables 123 var touchDevice = ( 'ontouchstart' in window ), 124 pointerEnabled = window.navigator.pointerEnabled || window.navigator.msPointerEnabled, 125 touched = function( event ){ 126 if( touchDevice ) return true; 127 if( !pointerEnabled || typeof event === 'undefined' || typeof event.pointerType === 'undefined' ) return false; 128 if( typeof event.MSPOINTER_TYPE_MOUSE !== 'undefined' ) { 129 if( event.MSPOINTER_TYPE_MOUSE != event.pointerType ) return true; 130 } 131 else { 132 if( event.pointerType != 'mouse' ) return true; 133 } 134 return false; 135 }, 136 swipeDiff = 0, 137 swipeYDiff = 0, 138 curImg = $(), 139 transPrefix = function(){ 140 var s = document.body || document.documentElement; 141 s = s.style; 142 if( s.WebkitTransition === '' ) return '-webkit-'; 143 if( s.MozTransition === '' ) return '-moz-'; 144 if( s.OTransition === '' ) return '-o-'; 145 if( s.transition === '' ) return ''; 146 return false; 147 }, 148 opened = false, 149 loaded = [], 150 getRelated = function(rel, jqObj) { 151 var $related = jqObj.filter(function () { 152 return ($(this).attr('rel') === rel); 153 }); 154 return $related; 155 }, 156 objects = (options.rel && options.rel !== false) ? getRelated(options.rel, $(this)) : this, 157 tagname = objects.get()[0].tagName, 158 transPrefix = transPrefix(), 159 globalScrollbarwidth = 0, 160 canTransisions = (transPrefix !== false) ? true : false, 161 supportsPushState = ('pushState' in history), 162 historyhasChanged = false, 163 historyUpdateTimeout, 164 winLoc = window.location, 165 getHash = function(){ 166 return winLoc.hash.substring(1); 167 }, 168 initialHash = getHash(), 169 updateHash = function(){ 170 var hash = getHash(), 171 newHash = 'pid='+(index+1); 172 var newURL = winLoc.href.split('#')[0] + '#' + newHash; 173 174 if(supportsPushState){ 175 history[historyhasChanged ? 'replaceState' : 'pushState']('', document.title, newURL); 176 }else { 177 if(historyhasChanged) { 178 winLoc.replace( newURL ); 179 } else { 180 winLoc.hash = newHash; 181 } 182 } 183 historyhasChanged = true; 184 }, 185 resetHash = function() { 186 if (supportsPushState) { 187 history.pushState('', document.title, winLoc.pathname + winLoc.search ); 188 } else { 189 winLoc.hash = ''; 190 } 191 clearTimeout(historyUpdateTimeout); 192 193 }, 194 updateURL = function(){ 195 if(!historyhasChanged) { 196 updateHash(); // first time 197 } else { 198 historyUpdateTimeout = setTimeout(updateHash, 800); 199 } 200 }, 201 throttle = function(func, limit) { 202 var inThrottle; 203 return function() { 204 var args = arguments; 205 var context = this; 206 if (!inThrottle) { 207 func.apply(context, args); 208 inThrottle = true; 209 setTimeout(function() { 210 return inThrottle = false; 211 }, limit); 212 } 213 }; 214 }, 215 prefix = 'simplelb', 216 overlay = $('<div>').addClass('sl-overlay'), 217 closeBtn = $('<button>').addClass('sl-close').html(options.closeText), 218 spinner = $('<div>').addClass('sl-spinner').html('<div></div>'), 219 nav = $('<div>').addClass('sl-navigation').html('<button class="sl-prev">'+options.navText[0]+'</button><button class="sl-next">'+options.navText[1]+'</button>'), 220 counter = $('<div>').addClass('sl-counter').html('<span class="sl-current"></span>/<span class="sl-total"></span>'), 221 animating = false, 222 index = 0, 223 startIndex = 0, 224 caption = $('<div>').addClass('sl-caption '+options.captionClass+' pos-'+options.captionPosition), 225 image = $('<div>').addClass('sl-image'), 226 wrapper = $('<div>').addClass('sl-wrapper').addClass(options.className), 227 isValidLink = function( element ){ 228 if(!options.fileExt) return true; 229 var filEext = /\.([0-9a-z]+)(?=[?#])|(\.)(?:[\w]+)$/gmi; 230 var testExt = $( element ).attr( options.sourceAttr ).match(filEext); 231 return testExt && $( element ).prop( 'tagName' ).toUpperCase() == tagname && ( new RegExp( '\.(' + options.fileExt + ')$', 'i' ) ).test( testExt ); 232 }, 233 setup = function(){ 234 if(options.close) closeBtn.appendTo(wrapper); 235 if(options.showCounter){ 236 if(objects.length > 1){ 237 counter.appendTo(wrapper); 238 counter.find('.sl-total').text(objects.length); 239 } 240 } 241 if(options.nav) nav.appendTo(wrapper); 242 if(options.spinner) spinner.appendTo(wrapper); 243 }, 244 openImage = function(elem){ 245 elem.trigger($.Event('show.simplelightbox')); 246 if(options.disableScroll) globalScrollbarwidth = handleScrollbar('hide'); 247 if(options.htmlClass && options.htmlClass != '') $('html').addClass(options.htmlClass); 248 wrapper.appendTo('body'); 249 image.appendTo(wrapper); 250 if(options.overlay) overlay.appendTo($('body')); 251 animating = true; 252 index = objects.index(elem); 253 curImg = $( '<img/>' ) 254 .hide() 255 .attr('src', elem.attr(options.sourceAttr)) 256 .attr('data-scale', 1) 257 .attr('data-translate-x', 0) 258 .attr('data-translate-y', 0); 259 if(loaded.indexOf(elem.attr(options.sourceAttr)) == -1){ 260 loaded.push(elem.attr(options.sourceAttr)); 261 } 262 image.html('').attr('style',''); 263 curImg.appendTo(image); 264 addEvents(); 265 overlay.fadeIn('fast'); 266 $('.sl-close').fadeIn('fast'); 267 spinner.show(); 268 nav.fadeIn('fast'); 269 $('.sl-wrapper .sl-counter .sl-current').text(index +1); 270 counter.fadeIn('fast'); 271 adjustImage(); 272 if(options.preloading) preload(); 273 setTimeout( function(){ elem.trigger($.Event('shown.simplelightbox')); } ,options.animationSpeed); 274 }, 275 adjustImage = function(dir){ 276 if(!curImg.length) return; 277 var tmpImage = new Image(), 278 windowWidth = window.innerWidth * options.widthRatio, 279 windowHeight = window.innerHeight * options.heightRatio; 280 tmpImage.src = curImg.attr( 'src' ); 281 curImg.data('scale',1); 282 curImg.data('translate-x',0); 283 curImg.data('translate-y',0); 284 zoomPanElement(0,0,1); 285 $(tmpImage).on('error',function(ev){ 286 //no image was found 287 objects.eq(index).trigger($.Event('error.simplelightbox')); 288 animating = false; 289 opened = true; 290 spinner.hide(); 291 var dirDefinined = (dir == 1 || dir == -1); 292 if(startIndex === index && dirDefinined){ 293 close(); 294 return; 295 } 296 if(options.alertError){ 297 alert(options.alertErrorMessage); 298 } 299 if(dirDefinined){ 300 loadImage(dir); 301 } else { 302 loadImage(1); 303 } 304 return; 305 }); 306 307 308 tmpImage.onload = function() { 309 if (typeof dir !== 'undefined') { 310 objects.eq(index) 311 .trigger($.Event('changed.simplelightbox')) 312 .trigger($.Event( (dir===1?'nextDone':'prevDone')+'.simplelightbox')); 313 } 314 315 // history 316 if(options.history){ 317 updateURL(); 318 } 319 320 if(loaded.indexOf(curImg.attr( 'src' )) == -1){ 321 loaded.push(curImg.attr( 'src' )); 322 } 323 var imageWidth = tmpImage.width, 324 imageHeight = tmpImage.height; 325 326 if( options.scaleImageToRatio || imageWidth > windowWidth || imageHeight > windowHeight ){ 327 var ratio = imageWidth / imageHeight > windowWidth / windowHeight ? imageWidth / windowWidth : imageHeight / windowHeight; 328 imageWidth /= ratio; 329 imageHeight /= ratio; 330 } 331 332 $('.sl-image').css({ 333 'top': ( window.innerHeight - imageHeight ) / 2 + 'px', 334 'left': ( window.innerWidth - imageWidth - globalScrollbarwidth)/ 2 + 'px', 335 'width': imageWidth + 'px', 336 'height': imageHeight + 'px' 337 }); 338 spinner.hide(); 339 curImg 340 .fadeIn('fast'); 341 opened = true; 342 var cSel = (options.captionSelector == 'self') ? objects.eq(index) : objects.eq(index).find(options.captionSelector); 343 var captionText; 344 if(options.captionType == 'data'){ 345 captionText = cSel.data(options.captionsData); 346 } else if(options.captionType == 'text'){ 347 captionText = cSel.html(); 348 } else { 349 captionText = cSel.prop(options.captionsData); 350 } 351 352 if(!options.loop) { 353 if(index === 0){ $('.sl-prev').hide();} 354 if(index >= objects.length -1) {$('.sl-next').hide();} 355 if(index > 0){ $('.sl-prev').show(); } 356 if(index < objects.length -1){ $('.sl-next').show(); } 357 } 358 359 if(objects.length == 1) $('.sl-prev, .sl-next').hide(); 360 361 if(dir == 1 || dir == -1){ 362 var css = { 'opacity': 1.0 }; 363 if( options.animationSlide ) { 364 if( canTransisions ) { 365 slide(0, 100 * dir + 'px'); 366 setTimeout( function(){ slide( options.animationSpeed / 1000, 0 + 'px'); }, 50 ); 367 } 368 else { 369 css.left = parseInt( $('.sl-image').css( 'left' ) ) + 100 * dir + 'px'; 370 } 371 } 372 373 $('.sl-image').animate( css, options.animationSpeed, function(){ 374 animating = false; 375 setCaption(captionText, imageWidth); 376 }); 377 } else { 378 animating = false; 379 setCaption(captionText, imageWidth); 380 } 381 if(options.additionalHtml && $('.sl-additional-html').length === 0){ 382 $('<div>').html(options.additionalHtml).addClass('sl-additional-html').appendTo($('.sl-image')); 383 } 384 }; 385 }, 386 setCaption = function(captiontext, imageWidth){ 387 if(captiontext !== '' && typeof captiontext !== "undefined" && options.captions){ 388 caption.html(captiontext).css({'width': imageWidth + 'px'}).hide().appendTo($('.sl-image')).delay(options.captionDelay).fadeIn('fast'); 389 } 390 }, 391 slide = function(speed, pos){ 392 var styles = {}; 393 styles[transPrefix + 'transform'] = 'translateX(' + pos + ')'; 394 styles[transPrefix + 'transition'] = transPrefix + 'transform ' + speed + 's linear'; 395 $('.sl-image').css(styles); 396 }, 397 zoomPanElement = function(targetOffsetX, targetOffsetY, targetScale) { 398 var styles = {}; 399 styles[transPrefix + 'transform'] = 'translate(' + targetOffsetX + ',' + targetOffsetY+ ') scale('+targetScale+')'; 400 curImg.css(styles); 401 }, 402 minMax = function(value, min, max) { 403 return (value < min) ? min : (value > max) ? max : value; 404 }, 405 setZoomData = function(initialScale,targetOffsetX,targetOffsetY) { 406 curImg.data('scale',initialScale); 407 curImg.data('translate-x',targetOffsetX); 408 curImg.data('translate-y',targetOffsetY); 409 }, 410 addEvents = function(){ 411 // resize/responsive 412 $( window ).on( 'resize.'+prefix, adjustImage ); 413 414 // close lightbox on close btn 415 $( '.sl-wrapper' ).on('click.'+prefix+ ' touchstart.'+prefix, '.sl-close', function(e){ 416 e.preventDefault(); 417 if(opened){ close();} 418 }); 419 420 if(options.history){ 421 setTimeout(function() { 422 $(window).on('hashchange.'+prefix,function(){ 423 if(opened){ 424 if(getHash() === initialHash) { 425 close(); 426 return; 427 } 428 } 429 }); 430 }, 40); 431 } 432 433 // nav-buttons 434 nav.on('click.'+prefix, 'button', throttle(function(e){ 435 e.preventDefault(); 436 swipeDiff = 0; 437 loadImage( $(this).hasClass('sl-next') ? 1 : -1 ); 438 }, options.throttleInterval)); 439 440 // touch helpers 441 var swipeStart = 0, 442 swipeEnd = 0, 443 swipeYStart = 0, 444 swipeYEnd = 0, 445 zoomed = false, 446 mousedown = false, 447 imageLeft = 0, 448 containerHeight, 449 containerWidth, 450 containerOffsetX, 451 containerOffsetY, 452 imgHeight, 453 imgWidth, 454 capture = false, 455 initialOffsetX, 456 initialOffsetY, 457 initialPointerOffsetX, 458 initialPointerOffsetY, 459 initialPointerOffsetX2, 460 initialPointerOffsetY2, 461 initialScale = minMax(1, 1, options.maxZoom), 462 initialPinchDistance, 463 pointerOffsetX, 464 pointerOffsetY, 465 pointerOffsetX2, 466 pointerOffsetY2, 467 targetOffsetX, 468 targetOffsetY, 469 targetScale, 470 pinchOffsetX, 471 pinchOffsetY, 472 limitOffsetX, 473 limitOffsetY, 474 scaleDifference, 475 targetPinchDistance, 476 touchCount, 477 doubleTapped = false, 478 touchmoveCount = 0; 479 480 image 481 .on( 'touchstart.'+prefix+' mousedown.'+prefix, function(e) 482 { 483 if (e.target.tagName === 'A' && e.type == 'touchstart') { 484 return true; 485 } 486 e = e.originalEvent; 487 if(e.type == 'mousedown') { 488 initialPointerOffsetX = e.clientX; 489 initialPointerOffsetY = e.clientY; 490 containerHeight = image.height(); 491 containerWidth = image.width(); 492 imgHeight = curImg.height(); 493 imgWidth = curImg.width(); 494 containerOffsetX = image.position().left; 495 containerOffsetY = image.position().top; 496 497 initialOffsetX = parseFloat(curImg.data('translate-x')); 498 initialOffsetY = parseFloat(curImg.data('translate-y')); 499 500 capture = true; 501 } else { 502 touchCount = e.touches.length; 503 initialPointerOffsetX = e.touches[0].clientX; 504 initialPointerOffsetY = e.touches[0].clientY; 505 containerHeight = image.height(); 506 containerWidth = image.width(); 507 imgHeight = curImg.height(); 508 imgWidth = curImg.width(); 509 containerOffsetX = image.position().left; 510 containerOffsetY = image.position().top; 511 512 if (touchCount === 1) /* Single touch */ { 513 if(!doubleTapped) { 514 doubleTapped = true; 515 setTimeout(function(){ 516 doubleTapped = false; 517 }, 300); 518 } else { 519 curImg.addClass('sl-transition'); 520 if(!zoomed) { 521 initialScale = options.doubleTapZoom; 522 setZoomData(0,0, initialScale); 523 zoomPanElement(0 + "px", 0 + "px", initialScale); 524 $('.sl-caption').fadeOut(200); 525 zoomed = true; 526 } else { 527 initialScale = 1; 528 setZoomData(0,0,initialScale); 529 zoomPanElement(0 + "px", 0 + "px", initialScale); 530 zoomed = false; 531 } 532 533 setTimeout(function(){ 534 curImg.removeClass('sl-transition'); 535 }, 200); 536 return false; 537 } 538 539 initialOffsetX = parseFloat(curImg.data('translate-x')); 540 initialOffsetY = parseFloat(curImg.data('translate-y')); 541 } 542 else if (touchCount === 2) /* Pinch */ { 543 initialPointerOffsetX2 = e.touches[1].clientX; 544 initialPointerOffsetY2 = e.touches[1].clientY; 545 initialOffsetX = parseFloat(curImg.data('translate-x')); 546 initialOffsetY = parseFloat(curImg.data('translate-y')); 547 pinchOffsetX = (initialPointerOffsetX + initialPointerOffsetX2) / 2; 548 pinchOffsetY = (initialPointerOffsetY + initialPointerOffsetY2) / 2; 549 initialPinchDistance = Math.sqrt(((initialPointerOffsetX - initialPointerOffsetX2) * (initialPointerOffsetX - initialPointerOffsetX2)) + ((initialPointerOffsetY - initialPointerOffsetY2) * (initialPointerOffsetY - initialPointerOffsetY2))); 550 } 551 capture = true; 552 } 553 554 if(mousedown) return true; 555 if( canTransisions ) imageLeft = parseInt( image.css( 'left' ) ); 556 mousedown = true; 557 swipeDiff = 0; 558 swipeYDiff = 0; 559 swipeStart = e.pageX || e.touches[ 0 ].pageX; 560 swipeYStart = e.pageY || e.touches[ 0 ].pageY; 561 return false; 562 }) 563 .on( 'touchmove.'+prefix+' mousemove.'+prefix+' MSPointerMove', function(e) 564 { 565 if(!mousedown) return true; 566 e.preventDefault(); 567 e = e.originalEvent; 568 /* Initialize helpers */ 569 if(e.type == 'touchmove') { 570 if(capture === false) return false; 571 pointerOffsetX = e.touches[0].clientX; 572 pointerOffsetY = e.touches[0].clientY; 573 touchCount = e.touches.length; 574 touchmoveCount++; 575 576 if (touchCount > 1) /* Pinch */ { 577 pointerOffsetX2 = e.touches[1].clientX; 578 pointerOffsetY2 = e.touches[1].clientY; 579 targetPinchDistance = Math.sqrt(((pointerOffsetX - pointerOffsetX2) * (pointerOffsetX - pointerOffsetX2)) + ((pointerOffsetY - pointerOffsetY2) * (pointerOffsetY - pointerOffsetY2))); 580 if (initialPinchDistance === null) { 581 initialPinchDistance = targetPinchDistance; 582 } 583 584 if (Math.abs(initialPinchDistance - targetPinchDistance) >= 1) { 585 /* Initialize helpers */ 586 targetScale = minMax(targetPinchDistance / initialPinchDistance * initialScale, 1, options.maxZoom); 587 limitOffsetX = ((imgWidth * targetScale) - containerWidth) / 2; 588 limitOffsetY = ((imgHeight * targetScale) - containerHeight) / 2; 589 scaleDifference = targetScale - initialScale; 590 targetOffsetX = (imgWidth * targetScale) <= containerWidth ? 0: minMax(initialOffsetX - ((((((pinchOffsetX - containerOffsetX) - (containerWidth / 2)) - initialOffsetX) / (targetScale - scaleDifference))) * scaleDifference), limitOffsetX * (-1), limitOffsetX); 591 targetOffsetY = (imgHeight * targetScale) <= containerHeight ? 0 : minMax(initialOffsetY - ((((((pinchOffsetY - containerOffsetY) - (containerHeight / 2)) - initialOffsetY) / (targetScale - scaleDifference))) * scaleDifference), limitOffsetY * (-1), limitOffsetY); 592 593 zoomPanElement(targetOffsetX + "px", targetOffsetY + "px", targetScale); 594 595 if (targetScale > 1) { 596 zoomed = true; 597 $('.sl-caption').fadeOut(200); 598 } 599 600 initialPinchDistance = targetPinchDistance; 601 initialScale = targetScale; 602 initialOffsetX = targetOffsetX; 603 initialOffsetY = targetOffsetY; 604 } 605 } else { 606 targetScale = initialScale; 607 limitOffsetX = ((imgWidth * targetScale) - containerWidth) / 2; 608 limitOffsetY = ((imgHeight * targetScale) - containerHeight) / 2; 609 targetOffsetX = (imgWidth * targetScale) <= containerWidth ? 0 : minMax(pointerOffsetX - (initialPointerOffsetX - initialOffsetX), limitOffsetX * (-1), limitOffsetX); 610 targetOffsetY = (imgHeight * targetScale) <= containerHeight ? 0 : minMax(pointerOffsetY - (initialPointerOffsetY - initialOffsetY), limitOffsetY * (-1), limitOffsetY); 611 612 if (Math.abs(targetOffsetX) === Math.abs(limitOffsetX)) { 613 initialOffsetX = targetOffsetX; 614 initialPointerOffsetX = pointerOffsetX; 615 } 616 617 if (Math.abs(targetOffsetY) === Math.abs(limitOffsetY)) { 618 initialOffsetY = targetOffsetY; 619 initialPointerOffsetY = pointerOffsetY; 620 } 621 622 setZoomData(initialScale,targetOffsetX,targetOffsetY); 623 zoomPanElement(targetOffsetX + "px", targetOffsetY + "px", targetScale); 624 } 625 } 626 /* Mouse Move implementation */ 627 if(e.type == 'mousemove' && mousedown){ 628 if(e.type == 'touchmove') return true; 629 if(capture === false) return false; 630 pointerOffsetX = e.clientX; 631 pointerOffsetY = e.clientY; 632 targetScale = initialScale; 633 limitOffsetX = ((imgWidth * targetScale) - containerWidth) / 2; 634 limitOffsetY = ((imgHeight * targetScale) - containerHeight) / 2; 635 targetOffsetX = (imgWidth * targetScale) <= containerWidth ? 0 : minMax(pointerOffsetX - (initialPointerOffsetX - initialOffsetX), limitOffsetX * (-1), limitOffsetX); 636 targetOffsetY = (imgHeight * targetScale) <= containerHeight ? 0 : minMax(pointerOffsetY - (initialPointerOffsetY - initialOffsetY), limitOffsetY * (-1), limitOffsetY); 637 638 if (Math.abs(targetOffsetX) === Math.abs(limitOffsetX)) { 639 initialOffsetX = targetOffsetX; 640 initialPointerOffsetX = pointerOffsetX; 641 } 642 643 if (Math.abs(targetOffsetY) === Math.abs(limitOffsetY)) { 644 initialOffsetY = targetOffsetY; 645 initialPointerOffsetY = pointerOffsetY; 646 } 647 648 setZoomData(initialScale,targetOffsetX,targetOffsetY); 649 zoomPanElement(targetOffsetX + "px", targetOffsetY + "px", targetScale); 650 } 651 if(!zoomed) { 652 swipeEnd = e.pageX || e.touches[ 0 ].pageX; 653 swipeYEnd = e.pageY || e.touches[ 0 ].pageY; 654 swipeDiff = swipeStart - swipeEnd; 655 swipeYDiff = swipeYStart - swipeYEnd; 656 if( options.animationSlide ) { 657 if( canTransisions ) slide( 0, -swipeDiff + 'px' ); 658 else image.css( 'left', imageLeft - swipeDiff + 'px' ); 659 } 660 } 661 }) 662 .on( 'touchend.'+prefix+' mouseup.'+prefix+' touchcancel.'+prefix+' mouseleave.'+prefix+' pointerup pointercancel MSPointerUp MSPointerCancel',function(e) 663 { 664 e = e.originalEvent; 665 if(touchDevice && e.type =='touchend') { 666 touchCount = e.touches.length; 667 if (touchCount === 0) /* No touch */ { 668 /* Set attributes */ 669 setZoomData(initialScale,targetOffsetX,targetOffsetY); 670 if(initialScale == 1) { 671 zoomed = false; 672 $('.sl-caption').fadeIn(200); 673 } 674 initialPinchDistance = null; 675 capture = false; 676 } else if (touchCount === 1) /* Single touch */ { 677 initialPointerOffsetX = e.touches[0].clientX; 678 initialPointerOffsetY = e.touches[0].clientY; 679 } else if (touchCount > 1) /* Pinch */ { 680 initialPinchDistance = null; 681 } 682 } 683 684 if(mousedown){ 685 mousedown = false; 686 var possibleDir = true; 687 if(!options.loop) { 688 if(index === 0 && swipeDiff < 0){ possibleDir = false; } 689 if(index >= objects.length -1 && swipeDiff > 0) { possibleDir = false; } 690 } 691 if( Math.abs( swipeDiff ) > options.swipeTolerance && possibleDir ) { 692 loadImage( swipeDiff > 0 ? 1 : -1 ); 693 } 694 else if( options.animationSlide ) 695 { 696 if( canTransisions ) slide( options.animationSpeed / 1000, 0 + 'px' ); 697 else image.animate({ 'left': imageLeft + 'px' }, options.animationSpeed / 2 ); 698 } 699 700 if( options.swipeClose && Math.abs(swipeYDiff) > 50 && Math.abs( swipeDiff ) < options.swipeTolerance) { 701 close(); 702 } 703 } 704 }) 705 /** Detect Double click on image*/ 706 .on( 'dblclick', function(e) 707 { 708 initialPointerOffsetX = e.clientX; 709 initialPointerOffsetY = e.clientY; 710 containerHeight = image.height(); 711 containerWidth = image.width(); 712 imgHeight = curImg.height(); 713 imgWidth = curImg.width(); 714 containerOffsetX = image.position().left; 715 containerOffsetY = image.position().top; 716 717 curImg.addClass('sl-transition'); 718 if(!zoomed) { 719 initialScale = options.doubleTapZoom; 720 setZoomData(0,0, initialScale); 721 zoomPanElement(0 + "px", 0 + "px", initialScale); 722 $('.sl-caption').fadeOut(200); 723 zoomed = true; 724 } else { 725 initialScale = 1; 726 setZoomData(0,0,initialScale); 727 zoomPanElement(0 + "px", 0 + "px", initialScale); 728 zoomed = false; 729 $('.sl-caption').fadeIn(200); 730 } 731 732 setTimeout(function(){ 733 curImg.removeClass('sl-transition'); 734 }, 200); 735 capture = true; 736 return false; 737 }); 738 }, 739 removeEvents = function(){ 740 nav.off('click', 'button'); 741 $( '.sl-wrapper' ).off('click.'+prefix, '.sl-close'); 742 $( window ).off( 'resize.'+prefix); 743 $( window ).off( 'hashchange.'+prefix); 744 }, 745 preload = function(){ 746 var next = (index+1 < 0) ? objects.length -1: (index+1 >= objects.length -1) ? 0 : index+1, 747 prev = (index-1 < 0) ? objects.length -1: (index-1 >= objects.length -1) ? 0 : index-1; 748 $( '<img />' ).attr( 'src', objects.eq(next).attr( options.sourceAttr ) ).on('load', function(){ 749 if(loaded.indexOf($(this).attr('src')) == -1){ 750 loaded.push($(this).attr('src')); 751 } 752 objects.eq(index).trigger($.Event('nextImageLoaded.simplelightbox')); 753 }); 754 $( '<img />' ).attr( 'src', objects.eq(prev).attr( options.sourceAttr ) ).on('load', function(){ 755 if(loaded.indexOf($(this).attr('src')) == -1){ 756 loaded.push($(this).attr('src')); 757 } 758 objects.eq(index).trigger($.Event('prevImageLoaded.simplelightbox')); 759 }); 760 761 }, 762 loadImage = function(dir){ 763 objects.eq(index) 764 .trigger($.Event('change.simplelightbox')) 765 .trigger($.Event( (dir===1?'next':'prev')+'.simplelightbox')); 766 767 var newIndex = index + dir; 768 if(animating || (newIndex < 0 || newIndex >= objects.length) && options.loop === false ) return; 769 index = (newIndex < 0) ? objects.length -1: (newIndex > objects.length -1) ? 0 : newIndex; 770 $('.sl-wrapper .sl-counter .sl-current').text(index +1); 771 var css = { 'opacity': 0 }; 772 if( options.animationSlide ) { 773 if( canTransisions ) slide(options.animationSpeed / 1000, ( -100 * dir ) - swipeDiff + 'px'); 774 else css.left = parseInt( $('.sl-image').css( 'left' ) ) + -100 * dir + 'px'; 775 } 776 777 $('.sl-image').animate( css, options.animationSpeed, function(){ 778 setTimeout( function(){ 779 // fadeout old image 780 var elem = objects.eq(index); 781 curImg 782 .attr('src', elem.attr(options.sourceAttr)); 783 784 if(loaded.indexOf(elem.attr(options.sourceAttr)) == -1){ 785 spinner.show(); 786 } 787 $('.sl-caption').remove(); 788 adjustImage(dir); 789 if(options.preloading) preload(); 790 }, 100); 791 }); 792 }, 793 close = function(){ 794 if(animating) return; 795 var elem = objects.eq(index), 796 triggered = false; 797 798 elem.trigger($.Event('close.simplelightbox')); 799 if(options.history){ 800 resetHash(); 801 } 802 $('.sl-image img, .sl-overlay, .sl-close, .sl-navigation, .sl-image .sl-caption, .sl-counter').fadeOut('fast', function(){ 803 if(options.disableScroll) handleScrollbar('show'); 804 if(options.htmlClass && options.htmlClass != '') $('html').removeClass(options.htmlClass); 805 $('.sl-wrapper, .sl-overlay').remove(); 806 removeEvents(); 807 if(!triggered) elem.trigger($.Event('closed.simplelightbox')); 808 triggered = true; 809 }); 810 curImg = $(); 811 opened = false; 812 animating = false; 813 }, 814 handleScrollbar = function(type){ 815 var scrollbarWidth = 0; 816 if(type == 'hide'){ 817 var fullWindowWidth = window.innerWidth; 818 if (!fullWindowWidth) { 819 var documentElementRect = document.documentElement.getBoundingClientRect(); 820 fullWindowWidth = documentElementRect.right - Math.abs(documentElementRect.left); 821 } 822 if(document.body.clientWidth < fullWindowWidth){ 823 var scrollDiv = document.createElement('div'), 824 padding = parseInt($('body').css('padding-right'),10); 825 scrollDiv.className = 'sl-scrollbar-measure'; 826 $('body').append(scrollDiv); 827 scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth; 828 $(document.body)[0].removeChild(scrollDiv); 829 $('body').data('padding',padding); 830 if(scrollbarWidth > 0){ 831 $('body').addClass('hidden-scroll').css({'padding-right':padding+scrollbarWidth}); 832 } 833 } 834 } else { 835 $('body').removeClass('hidden-scroll').css({'padding-right':$('body').data('padding')}); 836 } 837 return scrollbarWidth; 838 }; 839 840 // events 841 setup(); 842 843 // open lightbox 844 objects.on( 'click.'+prefix, function( e ){ 845 if(isValidLink(this)){ 846 e.preventDefault(); 847 if(animating) return false; 848 var elem = $(this); 849 startIndex = objects.index(elem); 850 openImage(elem); 851 } 852 }); 853 854 // close on click on doc 855 $( document ).on('click.'+prefix+ ' touchstart.'+prefix, function(e){ 856 if(opened){ 857 if((options.docClose && $(e.target).closest('.sl-image').length === 0 && $(e.target).closest('.sl-navigation').length === 0)){ 858 close(); 859 } 860 } 861 }); 862 863 // disable rightclick 864 if(options.disableRightClick){ 865 $( document ).on('contextmenu', '.sl-image img', function(e){ 866 return false; 867 }); 868 } 869 870 871 // keyboard-control 872 if( options.enableKeyboard ){ 873 $( document ).on( 'keyup.'+prefix, throttle(function( e ){ 874 swipeDiff = 0; 875 // keyboard control only if lightbox is open 876 var key = e.keyCode; 877 if(animating && key == 27) { 878 curImg.attr('src', ''); 879 animating = false; 880 close(); 881 } 882 883 if(opened){ 884 e.preventDefault(); 885 if( key == 27 ) { 886 close(); 887 } 888 if( key == 37 || e.keyCode == 39 ) { 889 loadImage( e.keyCode == 39 ? 1 : -1 ); 890 } 891 } 892 }, options.throttleInterval)); 893 } 894 895 // Public methods 896 this.open = function(elem){ 897 elem = elem || $(this[0]); 898 startIndex = objects.index(elem); 899 openImage(elem); 900 }; 901 902 this.next = function(){ 903 loadImage( 1 ); 904 }; 905 906 this.prev = function(){ 907 loadImage( -1 ); 908 }; 909 910 this.close = function(){ 911 close(); 912 }; 913 914 this.destroy = function(){ 915 $( document ).off('click.'+prefix).off('keyup.'+prefix); 916 close(); 917 $('.sl-overlay, .sl-wrapper').remove(); 918 this.off('click'); 919 }; 920 921 this.refresh = function(){ 922 this.destroy(); 923 $(this).simpleLightbox(options); 924 }; 925 926 return this; 927 928}; 929})( jQuery, window, document ); 930 931 932/***/ }), 933
vendor: 589 bytes, lines 934-955
934/***/ "./node_modules/tiny-slider/src/helpers/Object.keys.js": 935/*!*************************************************************!*\ 936 !*** ./node_modules/tiny-slider/src/helpers/Object.keys.js ***! 937 \*************************************************************/ 938/*! no static exports found */ 939/***/ (function(module, exports) { 940 941// Object.keys 942if (!Object.keys) { 943 Object.keys = function(object) { 944 var keys = []; 945 for (var name in object) { 946 if (Object.prototype.hasOwnProperty.call(object, name)) { 947 keys.push(name); 948 } 949 } 950 return keys; 951 }; 952} 953 954/***/ }), 955
vendor: 970 bytes, lines 956-978
956/***/ "./node_modules/tiny-slider/src/helpers/addCSSRule.js": 957/*!************************************************************!*\ 958 !*** ./node_modules/tiny-slider/src/helpers/addCSSRule.js ***! 959 \************************************************************/ 960/*! exports provided: addCSSRule */ 961/***/ (function(module, __webpack_exports__, __webpack_require__) { 962 963"use strict"; 964__webpack_require__.r(__webpack_exports__); 965/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addCSSRule", function() { return addCSSRule; }); 966/* harmony import */ var _raf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./raf.js */ "./node_modules/tiny-slider/src/helpers/raf.js"); 967// cross browsers addRule method 968 969function addCSSRule(sheet, selector, rules, index) { 970 // return raf(function() { 971 'insertRule' in sheet ? 972 sheet.insertRule(selector + '{' + rules + '}', index) : 973 sheet.addRule(selector, rules, index); 974 // }); 975} 976 977/***/ }), 978
vendor: 1,082 bytes, lines 979-1002
979/***/ "./node_modules/tiny-slider/src/helpers/addClass.js": 980/*!**********************************************************!*\ 981 !*** ./node_modules/tiny-slider/src/helpers/addClass.js ***! 982 \**********************************************************/ 983/*! exports provided: addClass */ 984/***/ (function(module, __webpack_exports__, __webpack_require__) { 985 986"use strict"; 987__webpack_require__.r(__webpack_exports__); 988/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addClass", function() { return addClass; }); 989/* harmony import */ var _hasClass_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./hasClass.js */ "./node_modules/tiny-slider/src/helpers/hasClass.js"); 990 991var addClass = _hasClass_js__WEBPACK_IMPORTED_MODULE_0__["classListSupport"] ? 992 function (el, str) { 993 if (!Object(_hasClass_js__WEBPACK_IMPORTED_MODULE_0__["hasClass"])(el, str)) { el.classList.add(str); } 994 } : 995 function (el, str) { 996 if (!Object(_hasClass_js__WEBPACK_IMPORTED_MODULE_0__["hasClass"])(el, str)) { el.className += ' ' + str; } 997 }; 998 999 1000 1001/***/ }), 1002
vendor: 1,023 bytes, lines 1003-1024
1003/***/ "./node_modules/tiny-slider/src/helpers/addEvents.js": 1004/*!***********************************************************!*\ 1005 !*** ./node_modules/tiny-slider/src/helpers/addEvents.js ***! 1006 \***********************************************************/ 1007/*! exports provided: addEvents */ 1008/***/ (function(module, __webpack_exports__, __webpack_require__) { 1009 1010"use strict"; 1011__webpack_require__.r(__webpack_exports__); 1012/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addEvents", function() { return addEvents; }); 1013/* harmony import */ var _passiveOption_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./passiveOption.js */ "./node_modules/tiny-slider/src/helpers/passiveOption.js"); 1014 1015 1016function addEvents(el, obj, preventScrolling) { 1017 for (var prop in obj) { 1018 var option = ['touchstart', 'touchmove'].indexOf(prop) >= 0 && !preventScrolling ? _passiveOption_js__WEBPACK_IMPORTED_MODULE_0__["passiveOption"] : false; 1019 el.addEventListener(prop, obj[prop], option); 1020 } 1021} 1022 1023/***/ }), 1024
vendor: 745 bytes, lines 1025-1044
1025/***/ "./node_modules/tiny-slider/src/helpers/arrayFromNodeList.js": 1026/*!*******************************************************************!*\ 1027 !*** ./node_modules/tiny-slider/src/helpers/arrayFromNodeList.js ***! 1028 \*******************************************************************/ 1029/*! exports provided: arrayFromNodeList */ 1030/***/ (function(module, __webpack_exports__, __webpack_require__) { 1031 1032"use strict"; 1033__webpack_require__.r(__webpack_exports__); 1034/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "arrayFromNodeList", function() { return arrayFromNodeList; }); 1035function arrayFromNodeList (nl) { 1036 var arr = []; 1037 for (var i = 0, l = nl.length; i < l; i++) { 1038 arr.push(nl[i]); 1039 } 1040 return arr; 1041} 1042 1043/***/ }), 1044
vendor: 637 bytes, lines 1045-1063
1045/***/ "./node_modules/tiny-slider/src/helpers/caf.js": 1046/*!*****************************************************!*\ 1047 !*** ./node_modules/tiny-slider/src/helpers/caf.js ***! 1048 \*****************************************************/ 1049/*! exports provided: caf */ 1050/***/ (function(module, __webpack_exports__, __webpack_require__) { 1051 1052"use strict"; 1053__webpack_require__.r(__webpack_exports__); 1054/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "caf", function() { return caf; }); 1055var win = window; 1056 1057var caf = win.cancelAnimationFrame 1058 || win.mozCancelAnimationFrame 1059 || function(id){ clearTimeout(id); }; 1060 1061 1062/***/ }), 1063
vendor: 1,914 bytes, lines 1064-1112
1064/***/ "./node_modules/tiny-slider/src/helpers/calc.js": 1065/*!******************************************************!*\ 1066 !*** ./node_modules/tiny-slider/src/helpers/calc.js ***! 1067 \******************************************************/ 1068/*! exports provided: calc */ 1069/***/ (function(module, __webpack_exports__, __webpack_require__) { 1070 1071"use strict"; 1072__webpack_require__.r(__webpack_exports__); 1073/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "calc", function() { return calc; }); 1074/* harmony import */ var _getBody_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getBody.js */ "./node_modules/tiny-slider/src/helpers/getBody.js"); 1075/* harmony import */ var _setFakeBody_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./setFakeBody.js */ "./node_modules/tiny-slider/src/helpers/setFakeBody.js"); 1076/* harmony import */ var _resetFakeBody_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./resetFakeBody.js */ "./node_modules/tiny-slider/src/helpers/resetFakeBody.js"); 1077// get css-calc 1078// @return - false | calc | -webkit-calc | -moz-calc 1079// @usage - var calc = getCalc(); 1080 1081 1082 1083 1084function calc() { 1085 var doc = document, 1086 body = Object(_getBody_js__WEBPACK_IMPORTED_MODULE_0__["getBody"])(), 1087 docOverflow = Object(_setFakeBody_js__WEBPACK_IMPORTED_MODULE_1__["setFakeBody"])(body), 1088 div = doc.createElement('div'), 1089 result = false; 1090 1091 body.appendChild(div); 1092 try { 1093 var str = '(10px * 10)', 1094 vals = ['calc' + str, '-moz-calc' + str, '-webkit-calc' + str], 1095 val; 1096 for (var i = 0; i < 3; i++) { 1097 val = vals[i]; 1098 div.style.width = val; 1099 if (div.offsetWidth === 100) { 1100 result = val.replace(str, ''); 1101 break; 1102 } 1103 } 1104 } catch (e) {} 1105 1106 body.fake ? Object(_resetFakeBody_js__WEBPACK_IMPORTED_MODULE_2__["resetFakeBody"])(body, docOverflow) : div.remove(); 1107 1108 return result; 1109} 1110 1111/***/ }), 1112
vendor: 722 bytes, lines 1113-1128
1113/***/ "./node_modules/tiny-slider/src/helpers/checkStorageValue.js": 1114/*!*******************************************************************!*\ 1115 !*** ./node_modules/tiny-slider/src/helpers/checkStorageValue.js ***! 1116 \*******************************************************************/ 1117/*! exports provided: checkStorageValue */ 1118/***/ (function(module, __webpack_exports__, __webpack_require__) { 1119 1120"use strict"; 1121__webpack_require__.r(__webpack_exports__); 1122/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "checkStorageValue", function() { return checkStorageValue; }); 1123function checkStorageValue (value) { 1124 return ['true', 'false'].indexOf(value) >= 0 ? JSON.parse(value) : value; 1125} 1126 1127/***/ }), 1128
vendor: 541 bytes, lines 1129-1146
1129/***/ "./node_modules/tiny-slider/src/helpers/childNode.remove.js": 1130/*!******************************************************************!*\ 1131 !*** ./node_modules/tiny-slider/src/helpers/childNode.remove.js ***! 1132 \******************************************************************/ 1133/*! no static exports found */ 1134/***/ (function(module, exports) { 1135 1136// ChildNode.remove 1137if(!("remove" in Element.prototype)){ 1138 Element.prototype.remove = function(){ 1139 if(this.parentNode) { 1140 this.parentNode.removeChild(this); 1141 } 1142 }; 1143} 1144 1145/***/ }), 1146
vendor: 667 bytes, lines 1147-1160
1147/***/ "./node_modules/tiny-slider/src/helpers/classListSupport.js": 1148/*!******************************************************************!*\ 1149 !*** ./node_modules/tiny-slider/src/helpers/classListSupport.js ***! 1150 \******************************************************************/ 1151/*! exports provided: classListSupport */ 1152/***/ (function(module, __webpack_exports__, __webpack_require__) { 1153 1154"use strict"; 1155__webpack_require__.r(__webpack_exports__); 1156/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "classListSupport", function() { return classListSupport; }); 1157var classListSupport = 'classList' in document.createElement('_'); 1158 1159/***/ }), 1160
vendor: 1,245 bytes, lines 1161-1192
1161/***/ "./node_modules/tiny-slider/src/helpers/createStyleSheet.js": 1162/*!******************************************************************!*\ 1163 !*** ./node_modules/tiny-slider/src/helpers/createStyleSheet.js ***! 1164 \******************************************************************/ 1165/*! exports provided: createStyleSheet */ 1166/***/ (function(module, __webpack_exports__, __webpack_require__) { 1167 1168"use strict"; 1169__webpack_require__.r(__webpack_exports__); 1170/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createStyleSheet", function() { return createStyleSheet; }); 1171// create and append style sheet 1172function createStyleSheet (media) { 1173 // Create the <style> tag 1174 var style = document.createElement("style"); 1175 // style.setAttribute("type", "text/css"); 1176 1177 // Add a media (and/or media query) here if you'd like! 1178 // style.setAttribute("media", "screen") 1179 // style.setAttribute("media", "only screen and (max-width : 1024px)") 1180 if (media) { style.setAttribute("media", media); } 1181 1182 // WebKit hack :( 1183 // style.appendChild(document.createTextNode("")); 1184 1185 // Add the <style> element to the page 1186 document.querySelector('head').appendChild(style); 1187 1188 return style.sheet ? style.sheet : style.styleSheet; 1189}; 1190 1191/***/ }), 1192
vendor: 601 bytes, lines 1193-1206
1193/***/ "./node_modules/tiny-slider/src/helpers/docElement.js": 1194/*!************************************************************!*\ 1195 !*** ./node_modules/tiny-slider/src/helpers/docElement.js ***! 1196 \************************************************************/ 1197/*! exports provided: docElement */ 1198/***/ (function(module, __webpack_exports__, __webpack_require__) { 1199 1200"use strict"; 1201__webpack_require__.r(__webpack_exports__); 1202/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "docElement", function() { return docElement; }); 1203var docElement = document.documentElement; 1204 1205/***/ }), 1206
vendor: 1,234 bytes, lines 1207-1246
1207/***/ "./node_modules/tiny-slider/src/helpers/events.js": 1208/*!********************************************************!*\ 1209 !*** ./node_modules/tiny-slider/src/helpers/events.js ***! 1210 \********************************************************/ 1211/*! exports provided: Events */ 1212/***/ (function(module, __webpack_exports__, __webpack_require__) { 1213 1214"use strict"; 1215__webpack_require__.r(__webpack_exports__); 1216/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Events", function() { return Events; }); 1217function Events() { 1218 return { 1219 topics: {}, 1220 on: function (eventName, fn) { 1221 this.topics[eventName] = this.topics[eventName] || []; 1222 this.topics[eventName].push(fn); 1223 }, 1224 off: function(eventName, fn) { 1225 if (this.topics[eventName]) { 1226 for (var i = 0; i < this.topics[eventName].length; i++) { 1227 if (this.topics[eventName][i] === fn) { 1228 this.topics[eventName].splice(i, 1); 1229 break; 1230 } 1231 } 1232 } 1233 }, 1234 emit: function (eventName, data) { 1235 data.type = eventName; 1236 if (this.topics[eventName]) { 1237 this.topics[eventName].forEach(function(fn) { 1238 fn(data, eventName); 1239 }); 1240 } 1241 } 1242 }; 1243}; 1244 1245/***/ }), 1246
vendor: 947 bytes, lines 1247-1280
1247/***/ "./node_modules/tiny-slider/src/helpers/extend.js": 1248/*!********************************************************!*\ 1249 !*** ./node_modules/tiny-slider/src/helpers/extend.js ***! 1250 \********************************************************/ 1251/*! exports provided: extend */ 1252/***/ (function(module, __webpack_exports__, __webpack_require__) { 1253 1254"use strict"; 1255__webpack_require__.r(__webpack_exports__); 1256/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "extend", function() { return extend; }); 1257function extend() { 1258 var obj, name, copy, 1259 target = arguments[0] || {}, 1260 i = 1, 1261 length = arguments.length; 1262 1263 for (; i < length; i++) { 1264 if ((obj = arguments[i]) !== null) { 1265 for (name in obj) { 1266 copy = obj[name]; 1267 1268 if (target === copy) { 1269 continue; 1270 } else if (copy !== undefined) { 1271 target[name] = copy; 1272 } 1273 } 1274 } 1275 } 1276 return target; 1277} 1278 1279/***/ }), 1280
vendor: 739 bytes, lines 1281-1299
1281/***/ "./node_modules/tiny-slider/src/helpers/forEach.js": 1282/*!*********************************************************!*\ 1283 !*** ./node_modules/tiny-slider/src/helpers/forEach.js ***! 1284 \*********************************************************/ 1285/*! exports provided: forEach */ 1286/***/ (function(module, __webpack_exports__, __webpack_require__) { 1287 1288"use strict"; 1289__webpack_require__.r(__webpack_exports__); 1290/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "forEach", function() { return forEach; }); 1291// https://toddmotto.com/ditch-the-array-foreach-call-nodelist-hack/ 1292function forEach (arr, callback, scope) { 1293 for (var i = 0, l = arr.length; i < l; i++) { 1294 callback.call(scope, arr[i], i); 1295 } 1296} 1297 1298/***/ }), 1299
vendor: 600 bytes, lines 1300-1315
1300/***/ "./node_modules/tiny-slider/src/helpers/getAttr.js": 1301/*!*********************************************************!*\ 1302 !*** ./node_modules/tiny-slider/src/helpers/getAttr.js ***! 1303 \*********************************************************/ 1304/*! exports provided: getAttr */ 1305/***/ (function(module, __webpack_exports__, __webpack_require__) { 1306 1307"use strict"; 1308__webpack_require__.r(__webpack_exports__); 1309/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getAttr", function() { return getAttr; }); 1310function getAttr(el, attr) { 1311 return el.getAttribute(attr); 1312} 1313 1314/***/ }), 1315
vendor: 702 bytes, lines 1316-1339
1316/***/ "./node_modules/tiny-slider/src/helpers/getBody.js": 1317/*!*********************************************************!*\ 1318 !*** ./node_modules/tiny-slider/src/helpers/getBody.js ***! 1319 \*********************************************************/ 1320/*! exports provided: getBody */ 1321/***/ (function(module, __webpack_exports__, __webpack_require__) { 1322 1323"use strict"; 1324__webpack_require__.r(__webpack_exports__); 1325/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getBody", function() { return getBody; }); 1326function getBody () { 1327 var doc = document, 1328 body = doc.body; 1329 1330 if (!body) { 1331 body = doc.createElement('body'); 1332 body.fake = true; 1333 } 1334 1335 return body; 1336} 1337 1338/***/ }), 1339
vendor: 736 bytes, lines 1340-1356
1340/***/ "./node_modules/tiny-slider/src/helpers/getCssRulesLength.js": 1341/*!*******************************************************************!*\ 1342 !*** ./node_modules/tiny-slider/src/helpers/getCssRulesLength.js ***! 1343 \*******************************************************************/ 1344/*! exports provided: getCssRulesLength */ 1345/***/ (function(module, __webpack_exports__, __webpack_require__) { 1346 1347"use strict"; 1348__webpack_require__.r(__webpack_exports__); 1349/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getCssRulesLength", function() { return getCssRulesLength; }); 1350function getCssRulesLength(sheet) { 1351 var rule = ('insertRule' in sheet) ? sheet.cssRules : sheet.rules; 1352 return rule.length; 1353} 1354 1355/***/ }), 1356
vendor: 1,105 bytes, lines 1357-1384
1357/***/ "./node_modules/tiny-slider/src/helpers/getEndProperty.js": 1358/*!****************************************************************!*\ 1359 !*** ./node_modules/tiny-slider/src/helpers/getEndProperty.js ***! 1360 \****************************************************************/ 1361/*! exports provided: getEndProperty */ 1362/***/ (function(module, __webpack_exports__, __webpack_require__) { 1363 1364"use strict"; 1365__webpack_require__.r(__webpack_exports__); 1366/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getEndProperty", function() { return getEndProperty; }); 1367// get transitionend, animationend based on transitionDuration 1368// @propin: string 1369// @propOut: string, first-letter uppercase 1370// Usage: getEndProperty('WebkitTransitionDuration', 'Transition') => webkitTransitionEnd 1371function getEndProperty(propIn, propOut) { 1372 var endProp = false; 1373 if (/^Webkit/.test(propIn)) { 1374 endProp = 'webkit' + propOut + 'End'; 1375 } else if (/^O/.test(propIn)) { 1376 endProp = 'o' + propOut + 'End'; 1377 } else if (propIn) { 1378 endProp = propOut.toLowerCase() + 'end'; 1379 } 1380 return endProp; 1381} 1382 1383/***/ }), 1384
vendor: 678 bytes, lines 1385-1403
1385/***/ "./node_modules/tiny-slider/src/helpers/getSlideId.js": 1386/*!************************************************************!*\ 1387 !*** ./node_modules/tiny-slider/src/helpers/getSlideId.js ***! 1388 \************************************************************/ 1389/*! exports provided: getSlideId */ 1390/***/ (function(module, __webpack_exports__, __webpack_require__) { 1391 1392"use strict"; 1393__webpack_require__.r(__webpack_exports__); 1394/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getSlideId", function() { return getSlideId; }); 1395function getSlideId() { 1396 var id = window.tnsId; 1397 window.tnsId = !id ? 1 : id + 1; 1398 1399 return 'tns' + window.tnsId; 1400} 1401 1402/***/ }), 1403
vendor: 867 bytes, lines 1404-1428
1404/***/ "./node_modules/tiny-slider/src/helpers/getTouchDirection.js": 1405/*!*******************************************************************!*\ 1406 !*** ./node_modules/tiny-slider/src/helpers/getTouchDirection.js ***! 1407 \*******************************************************************/ 1408/*! exports provided: getTouchDirection */ 1409/***/ (function(module, __webpack_exports__, __webpack_require__) { 1410 1411"use strict"; 1412__webpack_require__.r(__webpack_exports__); 1413/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTouchDirection", function() { return getTouchDirection; }); 1414function getTouchDirection(angle, range) { 1415 var direction = false, 1416 gap = Math.abs(90 - Math.abs(angle)); 1417 1418 if (gap >= 90 - range) { 1419 direction = 'horizontal'; 1420 } else if (gap <= range) { 1421 direction = 'vertical'; 1422 } 1423 1424 return direction; 1425} 1426 1427/***/ }), 1428
vendor: 1,957 bytes, lines 1429-1472
1429/***/ "./node_modules/tiny-slider/src/helpers/has3DTransforms.js": 1430/*!*****************************************************************!*\ 1431 !*** ./node_modules/tiny-slider/src/helpers/has3DTransforms.js ***! 1432 \*****************************************************************/ 1433/*! exports provided: has3DTransforms */ 1434/***/ (function(module, __webpack_exports__, __webpack_require__) { 1435 1436"use strict"; 1437__webpack_require__.r(__webpack_exports__); 1438/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "has3DTransforms", function() { return has3DTransforms; }); 1439/* harmony import */ var _getBody_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getBody.js */ "./node_modules/tiny-slider/src/helpers/getBody.js"); 1440/* harmony import */ var _setFakeBody_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./setFakeBody.js */ "./node_modules/tiny-slider/src/helpers/setFakeBody.js"); 1441/* harmony import */ var _resetFakeBody_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./resetFakeBody.js */ "./node_modules/tiny-slider/src/helpers/resetFakeBody.js"); 1442 1443 1444 1445 1446function has3DTransforms(tf){ 1447 if (!tf) { return false; } 1448 if (!window.getComputedStyle) { return false; } 1449 1450 var doc = document, 1451 body = Object(_getBody_js__WEBPACK_IMPORTED_MODULE_0__["getBody"])(), 1452 docOverflow = Object(_setFakeBody_js__WEBPACK_IMPORTED_MODULE_1__["setFakeBody"])(body), 1453 el = doc.createElement('p'), 1454 has3d, 1455 cssTF = tf.length > 9 ? '-' + tf.slice(0, -9).toLowerCase() + '-' : ''; 1456 1457 cssTF += 'transform'; 1458 1459 // Add it to the body to get the computed style 1460 body.insertBefore(el, null); 1461 1462 el.style[tf] = 'translate3d(1px,1px,1px)'; 1463 has3d = window.getComputedStyle(el).getPropertyValue(cssTF); 1464 1465 body.fake ? Object(_resetFakeBody_js__WEBPACK_IMPORTED_MODULE_2__["resetFakeBody"])(body, docOverflow) : el.remove(); 1466 1467 return (has3d !== undefined && has3d.length > 0 && has3d !== "none"); 1468} 1469 1470 1471/***/ }), 1472
vendor: 600 bytes, lines 1473-1488
1473/***/ "./node_modules/tiny-slider/src/helpers/hasAttr.js": 1474/*!*********************************************************!*\ 1475 !*** ./node_modules/tiny-slider/src/helpers/hasAttr.js ***! 1476 \*********************************************************/ 1477/*! exports provided: hasAttr */ 1478/***/ (function(module, __webpack_exports__, __webpack_require__) { 1479 1480"use strict"; 1481__webpack_require__.r(__webpack_exports__); 1482/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hasAttr", function() { return hasAttr; }); 1483function hasAttr(el, attr) { 1484 return el.hasAttribute(attr); 1485} 1486 1487/***/ }), 1488
vendor: 1,162 bytes, lines 1489-1511
1489/***/ "./node_modules/tiny-slider/src/helpers/hasClass.js": 1490/*!**********************************************************!*\ 1491 !*** ./node_modules/tiny-slider/src/helpers/hasClass.js ***! 1492 \**********************************************************/ 1493/*! exports provided: classListSupport, hasClass */ 1494/***/ (function(module, __webpack_exports__, __webpack_require__) { 1495 1496"use strict"; 1497__webpack_require__.r(__webpack_exports__); 1498/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hasClass", function() { return hasClass; }); 1499/* harmony import */ var _classListSupport_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./classListSupport.js */ "./node_modules/tiny-slider/src/helpers/classListSupport.js"); 1500/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "classListSupport", function() { return _classListSupport_js__WEBPACK_IMPORTED_MODULE_0__["classListSupport"]; }); 1501 1502 1503 1504var hasClass = _classListSupport_js__WEBPACK_IMPORTED_MODULE_0__["classListSupport"] ? 1505 function (el, str) { return el.classList.contains(str); } : 1506 function (el, str) { return el.className.indexOf(str) >= 0; }; 1507 1508 1509 1510/***/ }), 1511
vendor: 671 bytes, lines 1512-1527
1512/***/ "./node_modules/tiny-slider/src/helpers/hideElement.js": 1513/*!*************************************************************!*\ 1514 !*** ./node_modules/tiny-slider/src/helpers/hideElement.js ***! 1515 \*************************************************************/ 1516/*! exports provided: hideElement */ 1517/***/ (function(module, __webpack_exports__, __webpack_require__) { 1518 1519"use strict"; 1520__webpack_require__.r(__webpack_exports__); 1521/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hideElement", function() { return hideElement; }); 1522function hideElement(el, forceHide) { 1523 if (el.style.display !== 'none') { el.style.display = 'none'; } 1524} 1525 1526/***/ }), 1527
vendor: 673 bytes, lines 1528-1544
1528/***/ "./node_modules/tiny-slider/src/helpers/isNodeList.js": 1529/*!************************************************************!*\ 1530 !*** ./node_modules/tiny-slider/src/helpers/isNodeList.js ***! 1531 \************************************************************/ 1532/*! exports provided: isNodeList */ 1533/***/ (function(module, __webpack_exports__, __webpack_require__) { 1534 1535"use strict"; 1536__webpack_require__.r(__webpack_exports__); 1537/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isNodeList", function() { return isNodeList; }); 1538function isNodeList(el) { 1539 // Only NodeList has the "item()" function 1540 return typeof el.item !== "undefined"; 1541} 1542 1543/***/ }), 1544
vendor: 635 bytes, lines 1545-1560
1545/***/ "./node_modules/tiny-slider/src/helpers/isVisible.js": 1546/*!***********************************************************!*\ 1547 !*** ./node_modules/tiny-slider/src/helpers/isVisible.js ***! 1548 \***********************************************************/ 1549/*! exports provided: isVisible */ 1550/***/ (function(module, __webpack_exports__, __webpack_require__) { 1551 1552"use strict"; 1553__webpack_require__.r(__webpack_exports__); 1554/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isVisible", function() { return isVisible; }); 1555function isVisible(el) { 1556 return window.getComputedStyle(el).display !== 'none'; 1557} 1558 1559/***/ }), 1560
vendor: 1,205 bytes, lines 1561-1593
1561/***/ "./node_modules/tiny-slider/src/helpers/jsTransform.js": 1562/*!*************************************************************!*\ 1563 !*** ./node_modules/tiny-slider/src/helpers/jsTransform.js ***! 1564 \*************************************************************/ 1565/*! exports provided: jsTransform */ 1566/***/ (function(module, __webpack_exports__, __webpack_require__) { 1567 1568"use strict"; 1569__webpack_require__.r(__webpack_exports__); 1570/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "jsTransform", function() { return jsTransform; }); 1571function jsTransform(element, attr, prefix, postfix, to, duration, callback) { 1572 var tick = Math.min(duration, 10), 1573 unit = (to.indexOf('%') >= 0) ? '%' : 'px', 1574 to = to.replace(unit, ''), 1575 from = Number(element.style[attr].replace(prefix, '').replace(postfix, '').replace(unit, '')), 1576 positionTick = (to - from) / duration * tick, 1577 running; 1578 1579 setTimeout(moveElement, tick); 1580 function moveElement() { 1581 duration -= tick; 1582 from += positionTick; 1583 element.style[attr] = prefix + from + unit + postfix; 1584 if (duration > 0) { 1585 setTimeout(moveElement, tick); 1586 } else { 1587 callback(); 1588 } 1589 } 1590} 1591 1592/***/ }), 1593
vendor: 2,039 bytes, lines 1594-1640
1594/***/ "./node_modules/tiny-slider/src/helpers/mediaquerySupport.js": 1595/*!*******************************************************************!*\ 1596 !*** ./node_modules/tiny-slider/src/helpers/mediaquerySupport.js ***! 1597 \*******************************************************************/ 1598/*! exports provided: mediaquerySupport */ 1599/***/ (function(module, __webpack_exports__, __webpack_require__) { 1600 1601"use strict"; 1602__webpack_require__.r(__webpack_exports__); 1603/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mediaquerySupport", function() { return mediaquerySupport; }); 1604/* harmony import */ var _getBody_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getBody.js */ "./node_modules/tiny-slider/src/helpers/getBody.js"); 1605/* harmony import */ var _setFakeBody_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./setFakeBody.js */ "./node_modules/tiny-slider/src/helpers/setFakeBody.js"); 1606/* harmony import */ var _resetFakeBody_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./resetFakeBody.js */ "./node_modules/tiny-slider/src/helpers/resetFakeBody.js"); 1607 1608 1609 1610 1611function mediaquerySupport () { 1612 var doc = document, 1613 body = Object(_getBody_js__WEBPACK_IMPORTED_MODULE_0__["getBody"])(), 1614 docOverflow = Object(_setFakeBody_js__WEBPACK_IMPORTED_MODULE_1__["setFakeBody"])(body), 1615 div = doc.createElement('div'), 1616 style = doc.createElement('style'), 1617 rule = '@media all and (min-width:1px){.tns-mq-test{position:absolute}}', 1618 position; 1619 1620 style.type = 'text/css'; 1621 div.className = 'tns-mq-test'; 1622 1623 body.appendChild(style); 1624 body.appendChild(div); 1625 1626 if (style.styleSheet) { 1627 style.styleSheet.cssText = rule; 1628 } else { 1629 style.appendChild(doc.createTextNode(rule)); 1630 } 1631 1632 position = window.getComputedStyle ? window.getComputedStyle(div).position : div.currentStyle['position']; 1633 1634 body.fake ? Object(_resetFakeBody_js__WEBPACK_IMPORTED_MODULE_2__["resetFakeBody"])(body, docOverflow) : div.remove(); 1635 1636 return position === "absolute"; 1637} 1638 1639/***/ }), 1640
vendor: 943 bytes, lines 1641-1664
1641/***/ "./node_modules/tiny-slider/src/helpers/passiveOption.js": 1642/*!***************************************************************!*\ 1643 !*** ./node_modules/tiny-slider/src/helpers/passiveOption.js ***! 1644 \***************************************************************/ 1645/*! exports provided: passiveOption */ 1646/***/ (function(module, __webpack_exports__, __webpack_require__) { 1647 1648"use strict"; 1649__webpack_require__.r(__webpack_exports__); 1650/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "passiveOption", function() { return passiveOption; }); 1651// Test via a getter in the options object to see if the passive property is accessed 1652var supportsPassive = false; 1653try { 1654 var opts = Object.defineProperty({}, 'passive', { 1655 get: function() { 1656 supportsPassive = true; 1657 } 1658 }); 1659 window.addEventListener("test", null, opts); 1660} catch (e) {} 1661var passiveOption = supportsPassive ? { passive: true } : false; 1662 1663/***/ }), 1664
vendor: 2,093 bytes, lines 1665-1715
1665/***/ "./node_modules/tiny-slider/src/helpers/percentageLayout.js": 1666/*!******************************************************************!*\ 1667 !*** ./node_modules/tiny-slider/src/helpers/percentageLayout.js ***! 1668 \******************************************************************/ 1669/*! exports provided: percentageLayout */ 1670/***/ (function(module, __webpack_exports__, __webpack_require__) { 1671 1672"use strict"; 1673__webpack_require__.r(__webpack_exports__); 1674/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "percentageLayout", function() { return percentageLayout; }); 1675/* harmony import */ var _getBody_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getBody.js */ "./node_modules/tiny-slider/src/helpers/getBody.js"); 1676/* harmony import */ var _setFakeBody_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./setFakeBody.js */ "./node_modules/tiny-slider/src/helpers/setFakeBody.js"); 1677/* harmony import */ var _resetFakeBody_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./resetFakeBody.js */ "./node_modules/tiny-slider/src/helpers/resetFakeBody.js"); 1678// get subpixel support value 1679// @return - boolean 1680 1681 1682 1683 1684function percentageLayout() { 1685 // check subpixel layout supporting 1686 var doc = document, 1687 body = Object(_getBody_js__WEBPACK_IMPORTED_MODULE_0__["getBody"])(), 1688 docOverflow = Object(_setFakeBody_js__WEBPACK_IMPORTED_MODULE_1__["setFakeBody"])(body), 1689 wrapper = doc.createElement('div'), 1690 outer = doc.createElement('div'), 1691 str = '', 1692 count = 70, 1693 perPage = 3, 1694 supported = false; 1695 1696 wrapper.className = "tns-t-subp2"; 1697 outer.className = "tns-t-ct"; 1698 1699 for (var i = 0; i < count; i++) { 1700 str += '<div></div>'; 1701 } 1702 1703 outer.innerHTML = str; 1704 wrapper.appendChild(outer); 1705 body.appendChild(wrapper); 1706 1707 supported = Math.abs(wrapper.getBoundingClientRect().left - outer.children[count - perPage].getBoundingClientRect().left) < 2; 1708 1709 body.fake ? Object(_resetFakeBody_js__WEBPACK_IMPORTED_MODULE_2__["resetFakeBody"])(body, docOverflow) : wrapper.remove(); 1710 1711 return supported; 1712} 1713 1714/***/ }), 1715
vendor: 719 bytes, lines 1716-1736
1716/***/ "./node_modules/tiny-slider/src/helpers/raf.js": 1717/*!*****************************************************!*\ 1718 !*** ./node_modules/tiny-slider/src/helpers/raf.js ***! 1719 \*****************************************************/ 1720/*! exports provided: raf */ 1721/***/ (function(module, __webpack_exports__, __webpack_require__) { 1722 1723"use strict"; 1724__webpack_require__.r(__webpack_exports__); 1725/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "raf", function() { return raf; }); 1726var win = window; 1727 1728var raf = win.requestAnimationFrame 1729 || win.webkitRequestAnimationFrame 1730 || win.mozRequestAnimationFrame 1731 || win.msRequestAnimationFrame 1732 || function(cb) { return setTimeout(cb, 16); }; 1733 1734 1735/***/ }), 1736
vendor: 1,105 bytes, lines 1737-1763
1737/***/ "./node_modules/tiny-slider/src/helpers/removeAttrs.js": 1738/*!*************************************************************!*\ 1739 !*** ./node_modules/tiny-slider/src/helpers/removeAttrs.js ***! 1740 \*************************************************************/ 1741/*! exports provided: removeAttrs */ 1742/***/ (function(module, __webpack_exports__, __webpack_require__) { 1743 1744"use strict"; 1745__webpack_require__.r(__webpack_exports__); 1746/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeAttrs", function() { return removeAttrs; }); 1747/* harmony import */ var _isNodeList_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isNodeList.js */ "./node_modules/tiny-slider/src/helpers/isNodeList.js"); 1748 1749 1750function removeAttrs(els, attrs) { 1751 els = (Object(_isNodeList_js__WEBPACK_IMPORTED_MODULE_0__["isNodeList"])(els) || els instanceof Array) ? els : [els]; 1752 attrs = (attrs instanceof Array) ? attrs : [attrs]; 1753 1754 var attrLength = attrs.length; 1755 for (var i = els.length; i--;) { 1756 for (var j = attrLength; j--;) { 1757 els[i].removeAttribute(attrs[j]); 1758 } 1759 } 1760} 1761 1762/***/ }), 1763
vendor: 933 bytes, lines 1764-1786
1764/***/ "./node_modules/tiny-slider/src/helpers/removeCSSRule.js": 1765/*!***************************************************************!*\ 1766 !*** ./node_modules/tiny-slider/src/helpers/removeCSSRule.js ***! 1767 \***************************************************************/ 1768/*! exports provided: removeCSSRule */ 1769/***/ (function(module, __webpack_exports__, __webpack_require__) { 1770 1771"use strict"; 1772__webpack_require__.r(__webpack_exports__); 1773/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeCSSRule", function() { return removeCSSRule; }); 1774/* harmony import */ var _raf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./raf.js */ "./node_modules/tiny-slider/src/helpers/raf.js"); 1775// cross browsers addRule method 1776 1777function removeCSSRule(sheet, index) { 1778 // return raf(function() { 1779 'deleteRule' in sheet ? 1780 sheet.deleteRule(index) : 1781 sheet.removeRule(index); 1782 // }); 1783} 1784 1785/***/ }), 1786
vendor: 1,125 bytes, lines 1787-1810
1787/***/ "./node_modules/tiny-slider/src/helpers/removeClass.js": 1788/*!*************************************************************!*\ 1789 !*** ./node_modules/tiny-slider/src/helpers/removeClass.js ***! 1790 \*************************************************************/ 1791/*! exports provided: removeClass */ 1792/***/ (function(module, __webpack_exports__, __webpack_require__) { 1793 1794"use strict"; 1795__webpack_require__.r(__webpack_exports__); 1796/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeClass", function() { return removeClass; }); 1797/* harmony import */ var _hasClass_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./hasClass.js */ "./node_modules/tiny-slider/src/helpers/hasClass.js"); 1798 1799var removeClass = _hasClass_js__WEBPACK_IMPORTED_MODULE_0__["classListSupport"] ? 1800 function (el, str) { 1801 if (Object(_hasClass_js__WEBPACK_IMPORTED_MODULE_0__["hasClass"])(el, str)) { el.classList.remove(str); } 1802 } : 1803 function (el, str) { 1804 if (Object(_hasClass_js__WEBPACK_IMPORTED_MODULE_0__["hasClass"])(el, str)) { el.className = el.className.replace(str, ''); } 1805 }; 1806 1807 1808 1809/***/ }), 1810
vendor: 1,011 bytes, lines 1811-1832
1811/***/ "./node_modules/tiny-slider/src/helpers/removeEvents.js": 1812/*!**************************************************************!*\ 1813 !*** ./node_modules/tiny-slider/src/helpers/removeEvents.js ***! 1814 \**************************************************************/ 1815/*! exports provided: removeEvents */ 1816/***/ (function(module, __webpack_exports__, __webpack_require__) { 1817 1818"use strict"; 1819__webpack_require__.r(__webpack_exports__); 1820/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeEvents", function() { return removeEvents; }); 1821/* harmony import */ var _passiveOption_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./passiveOption.js */ "./node_modules/tiny-slider/src/helpers/passiveOption.js"); 1822 1823 1824function removeEvents(el, obj) { 1825 for (var prop in obj) { 1826 var option = ['touchstart', 'touchmove'].indexOf(prop) >= 0 ? _passiveOption_js__WEBPACK_IMPORTED_MODULE_0__["passiveOption"] : false; 1827 el.removeEventListener(prop, obj[prop], option); 1828 } 1829} 1830 1831/***/ }), 1832
vendor: 1,108 bytes, lines 1833-1857
1833/***/ "./node_modules/tiny-slider/src/helpers/resetFakeBody.js": 1834/*!***************************************************************!*\ 1835 !*** ./node_modules/tiny-slider/src/helpers/resetFakeBody.js ***! 1836 \***************************************************************/ 1837/*! exports provided: resetFakeBody */ 1838/***/ (function(module, __webpack_exports__, __webpack_require__) { 1839 1840"use strict"; 1841__webpack_require__.r(__webpack_exports__); 1842/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "resetFakeBody", function() { return resetFakeBody; }); 1843/* harmony import */ var _docElement_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./docElement.js */ "./node_modules/tiny-slider/src/helpers/docElement.js"); 1844 1845 1846function resetFakeBody (body, docOverflow) { 1847 if (body.fake) { 1848 body.remove(); 1849 _docElement_js__WEBPACK_IMPORTED_MODULE_0__["docElement"].style.overflow = docOverflow; 1850 // Trigger layout so kinetic scrolling isn't disabled in iOS6+ 1851 // eslint-disable-next-line 1852 _docElement_js__WEBPACK_IMPORTED_MODULE_0__["docElement"].offsetHeight; 1853 } 1854} 1855 1856/***/ }), 1857
vendor: 1,068 bytes, lines 1858-1883
1858/***/ "./node_modules/tiny-slider/src/helpers/setAttrs.js": 1859/*!**********************************************************!*\ 1860 !*** ./node_modules/tiny-slider/src/helpers/setAttrs.js ***! 1861 \**********************************************************/ 1862/*! exports provided: setAttrs */ 1863/***/ (function(module, __webpack_exports__, __webpack_require__) { 1864 1865"use strict"; 1866__webpack_require__.r(__webpack_exports__); 1867/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setAttrs", function() { return setAttrs; }); 1868/* harmony import */ var _isNodeList_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isNodeList.js */ "./node_modules/tiny-slider/src/helpers/isNodeList.js"); 1869 1870 1871function setAttrs(els, attrs) { 1872 els = (Object(_isNodeList_js__WEBPACK_IMPORTED_MODULE_0__["isNodeList"])(els) || els instanceof Array) ? els : [els]; 1873 if (Object.prototype.toString.call(attrs) !== '[object Object]') { return; } 1874 1875 for (var i = els.length; i--;) { 1876 for(var key in attrs) { 1877 els[i].setAttribute(key, attrs[key]); 1878 } 1879 } 1880} 1881 1882/***/ }), 1883
vendor: 1,310 bytes, lines 1884-1912
1884/***/ "./node_modules/tiny-slider/src/helpers/setFakeBody.js": 1885/*!*************************************************************!*\ 1886 !*** ./node_modules/tiny-slider/src/helpers/setFakeBody.js ***! 1887 \*************************************************************/ 1888/*! exports provided: setFakeBody */ 1889/***/ (function(module, __webpack_exports__, __webpack_require__) { 1890 1891"use strict"; 1892__webpack_require__.r(__webpack_exports__); 1893/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setFakeBody", function() { return setFakeBody; }); 1894/* harmony import */ var _docElement_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./docElement.js */ "./node_modules/tiny-slider/src/helpers/docElement.js"); 1895 1896 1897function setFakeBody (body) { 1898 var docOverflow = ''; 1899 if (body.fake) { 1900 docOverflow = _docElement_js__WEBPACK_IMPORTED_MODULE_0__["docElement"].style.overflow; 1901 //avoid crashing IE8, if background image is used 1902 body.style.background = ''; 1903 //Safari 5.13/5.1.4 OSX stops loading if ::-webkit-scrollbar is used and scrollbars are visible 1904 body.style.overflow = _docElement_js__WEBPACK_IMPORTED_MODULE_0__["docElement"].style.overflow = 'hidden'; 1905 _docElement_js__WEBPACK_IMPORTED_MODULE_0__["docElement"].appendChild(body); 1906 } 1907 1908 return docOverflow; 1909} 1910 1911/***/ }), 1912
vendor: 741 bytes, lines 1913-1931
1913/***/ "./node_modules/tiny-slider/src/helpers/setLocalStorage.js": 1914/*!*****************************************************************!*\ 1915 !*** ./node_modules/tiny-slider/src/helpers/setLocalStorage.js ***! 1916 \*****************************************************************/ 1917/*! exports provided: setLocalStorage */ 1918/***/ (function(module, __webpack_exports__, __webpack_require__) { 1919 1920"use strict"; 1921__webpack_require__.r(__webpack_exports__); 1922/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setLocalStorage", function() { return setLocalStorage; }); 1923function setLocalStorage(storage, key, value, access) { 1924 if (access) { 1925 try { storage.setItem(key, value); } catch (e) {} 1926 } 1927 return value; 1928} 1929 1930/***/ }), 1931
vendor: 667 bytes, lines 1932-1947
1932/***/ "./node_modules/tiny-slider/src/helpers/showElement.js": 1933/*!*************************************************************!*\ 1934 !*** ./node_modules/tiny-slider/src/helpers/showElement.js ***! 1935 \*************************************************************/ 1936/*! exports provided: showElement */ 1937/***/ (function(module, __webpack_exports__, __webpack_require__) { 1938 1939"use strict"; 1940__webpack_require__.r(__webpack_exports__); 1941/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "showElement", function() { return showElement; }); 1942function showElement(el, forceHide) { 1943 if (el.style.display === 'none') { el.style.display = ''; } 1944} 1945 1946/***/ }), 1947
vendor: 618 bytes, lines 1948-1963
1948/***/ "./node_modules/tiny-slider/src/helpers/toDegree.js": 1949/*!**********************************************************!*\ 1950 !*** ./node_modules/tiny-slider/src/helpers/toDegree.js ***! 1951 \**********************************************************/ 1952/*! exports provided: toDegree */ 1953/***/ (function(module, __webpack_exports__, __webpack_require__) { 1954 1955"use strict"; 1956__webpack_require__.r(__webpack_exports__); 1957/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toDegree", function() { return toDegree; }); 1958function toDegree (y, x) { 1959 return Math.atan2(y, x) * (180 / Math.PI); 1960} 1961 1962/***/ }), 1963
vendor: 1,200 bytes, lines 1964-2001
1964/***/ "./node_modules/tiny-slider/src/helpers/whichProperty.js": 1965/*!***************************************************************!*\ 1966 !*** ./node_modules/tiny-slider/src/helpers/whichProperty.js ***! 1967 \***************************************************************/ 1968/*! exports provided: whichProperty */ 1969/***/ (function(module, __webpack_exports__, __webpack_require__) { 1970 1971"use strict"; 1972__webpack_require__.r(__webpack_exports__); 1973/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "whichProperty", function() { return whichProperty; }); 1974function whichProperty(props){ 1975 if (typeof props === 'string') { 1976 var arr = [props], 1977 Props = props.charAt(0).toUpperCase() + props.substr(1), 1978 prefixes = ['Webkit', 'Moz', 'ms', 'O']; 1979 1980 prefixes.forEach(function(prefix) { 1981 if (prefix !== 'ms' || props === 'transform') { 1982 arr.push(prefix + Props); 1983 } 1984 }); 1985 1986 props = arr; 1987 } 1988 1989 var el = document.createElement('fakeelement'), 1990 len = props.length; 1991 for(var i = 0; i < props.length; i++){ 1992 var prop = props[i]; 1993 if( el.style[prop] !== undefined ){ return prop; } 1994 } 1995 1996 return false; // explicit for ie9- 1997} 1998 1999 2000/***/ }), 2001
vendor: 109,104 bytes, lines 2002-4775
2002/***/ "./node_modules/tiny-slider/src/tiny-slider.js": 2003/*!*****************************************************!*\ 2004 !*** ./node_modules/tiny-slider/src/tiny-slider.js ***! 2005 \*****************************************************/ 2006/*! exports provided: tns */ 2007/***/ (function(module, __webpack_exports__, __webpack_require__) { 2008 2009"use strict"; 2010__webpack_require__.r(__webpack_exports__); 2011/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "tns", function() { return tns; }); 2012/* harmony import */ var _helpers_Object_keys__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./helpers/Object.keys */ "./node_modules/tiny-slider/src/helpers/Object.keys.js"); 2013/* harmony import */ var _helpers_Object_keys__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_helpers_Object_keys__WEBPACK_IMPORTED_MODULE_0__); 2014/* harmony import */ var _helpers_childNode_remove__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./helpers/childNode.remove */ "./node_modules/tiny-slider/src/helpers/childNode.remove.js"); 2015/* harmony import */ var _helpers_childNode_remove__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_helpers_childNode_remove__WEBPACK_IMPORTED_MODULE_1__); 2016/* harmony import */ var _helpers_raf_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./helpers/raf.js */ "./node_modules/tiny-slider/src/helpers/raf.js"); 2017/* harmony import */ var _helpers_caf_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./helpers/caf.js */ "./node_modules/tiny-slider/src/helpers/caf.js"); 2018/* harmony import */ var _helpers_extend_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./helpers/extend.js */ "./node_modules/tiny-slider/src/helpers/extend.js"); 2019/* harmony import */ var _helpers_checkStorageValue_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./helpers/checkStorageValue.js */ "./node_modules/tiny-slider/src/helpers/checkStorageValue.js"); 2020/* harmony import */ var _helpers_setLocalStorage_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./helpers/setLocalStorage.js */ "./node_modules/tiny-slider/src/helpers/setLocalStorage.js"); 2021/* harmony import */ var _helpers_getSlideId_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./helpers/getSlideId.js */ "./node_modules/tiny-slider/src/helpers/getSlideId.js"); 2022/* harmony import */ var _helpers_calc_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./helpers/calc.js */ "./node_modules/tiny-slider/src/helpers/calc.js"); 2023/* harmony import */ var _helpers_percentageLayout_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./helpers/percentageLayout.js */ "./node_modules/tiny-slider/src/helpers/percentageLayout.js"); 2024/* harmony import */ var _helpers_mediaquerySupport_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./helpers/mediaquerySupport.js */ "./node_modules/tiny-slider/src/helpers/mediaquerySupport.js"); 2025/* harmony import */ var _helpers_createStyleSheet_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./helpers/createStyleSheet.js */ "./node_modules/tiny-slider/src/helpers/createStyleSheet.js"); 2026/* harmony import */ var _helpers_addCSSRule_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./helpers/addCSSRule.js */ "./node_modules/tiny-slider/src/helpers/addCSSRule.js"); 2027/* harmony import */ var _helpers_removeCSSRule_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./helpers/removeCSSRule.js */ "./node_modules/tiny-slider/src/helpers/removeCSSRule.js"); 2028/* harmony import */ var _helpers_getCssRulesLength_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./helpers/getCssRulesLength.js */ "./node_modules/tiny-slider/src/helpers/getCssRulesLength.js"); 2029/* harmony import */ var _helpers_toDegree_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./helpers/toDegree.js */ "./node_modules/tiny-slider/src/helpers/toDegree.js"); 2030/* harmony import */ var _helpers_getTouchDirection_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./helpers/getTouchDirection.js */ "./node_modules/tiny-slider/src/helpers/getTouchDirection.js"); 2031/* harmony import */ var _helpers_forEach_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./helpers/forEach.js */ "./node_modules/tiny-slider/src/helpers/forEach.js"); 2032/* harmony import */ var _helpers_hasClass_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./helpers/hasClass.js */ "./node_modules/tiny-slider/src/helpers/hasClass.js"); 2033/* harmony import */ var _helpers_addClass_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./helpers/addClass.js */ "./node_modules/tiny-slider/src/helpers/addClass.js"); 2034/* harmony import */ var _helpers_removeClass_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./helpers/removeClass.js */ "./node_modules/tiny-slider/src/helpers/removeClass.js"); 2035/* harmony import */ var _helpers_hasAttr_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./helpers/hasAttr.js */ "./node_modules/tiny-slider/src/helpers/hasAttr.js"); 2036/* harmony import */ var _helpers_getAttr_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./helpers/getAttr.js */ "./node_modules/tiny-slider/src/helpers/getAttr.js"); 2037/* harmony import */ var _helpers_setAttrs_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./helpers/setAttrs.js */ "./node_modules/tiny-slider/src/helpers/setAttrs.js"); 2038/* harmony import */ var _helpers_removeAttrs_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./helpers/removeAttrs.js */ "./node_modules/tiny-slider/src/helpers/removeAttrs.js"); 2039/* harmony import */ var _helpers_arrayFromNodeList_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./helpers/arrayFromNodeList.js */ "./node_modules/tiny-slider/src/helpers/arrayFromNodeList.js"); 2040/* harmony import */ var _helpers_hideElement_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./helpers/hideElement.js */ "./node_modules/tiny-slider/src/helpers/hideElement.js"); 2041/* harmony import */ var _helpers_showElement_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./helpers/showElement.js */ "./node_modules/tiny-slider/src/helpers/showElement.js"); 2042/* harmony import */ var _helpers_isVisible_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./helpers/isVisible.js */ "./node_modules/tiny-slider/src/helpers/isVisible.js"); 2043/* harmony import */ var _helpers_whichProperty_js__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./helpers/whichProperty.js */ "./node_modules/tiny-slider/src/helpers/whichProperty.js"); 2044/* harmony import */ var _helpers_has3DTransforms_js__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./helpers/has3DTransforms.js */ "./node_modules/tiny-slider/src/helpers/has3DTransforms.js"); 2045/* harmony import */ var _helpers_getEndProperty_js__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./helpers/getEndProperty.js */ "./node_modules/tiny-slider/src/helpers/getEndProperty.js"); 2046/* harmony import */ var _helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./helpers/addEvents.js */ "./node_modules/tiny-slider/src/helpers/addEvents.js"); 2047/* harmony import */ var _helpers_removeEvents_js__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./helpers/removeEvents.js */ "./node_modules/tiny-slider/src/helpers/removeEvents.js"); 2048/* harmony import */ var _helpers_events_js__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./helpers/events.js */ "./node_modules/tiny-slider/src/helpers/events.js"); 2049/* harmony import */ var _helpers_jsTransform_js__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./helpers/jsTransform.js */ "./node_modules/tiny-slider/src/helpers/jsTransform.js"); 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087var tns = function(options) { 2088 options = Object(_helpers_extend_js__WEBPACK_IMPORTED_MODULE_4__["extend"])({ 2089 container: '.slider', 2090 mode: 'carousel', 2091 axis: 'horizontal', 2092 items: 1, 2093 gutter: 0, 2094 edgePadding: 0, 2095 fixedWidth: false, 2096 autoWidth: false, 2097 viewportMax: false, 2098 slideBy: 1, 2099 center: false, 2100 controls: true, 2101 controlsPosition: 'top', 2102 controlsText: ['prev', 'next'], 2103 controlsContainer: false, 2104 prevButton: false, 2105 nextButton: false, 2106 nav: true, 2107 navPosition: 'top', 2108 navContainer: false, 2109 navAsThumbnails: false, 2110 arrowKeys: false, 2111 speed: 300, 2112 autoplay: false, 2113 autoplayPosition: 'top', 2114 autoplayTimeout: 5000, 2115 autoplayDirection: 'forward', 2116 autoplayText: ['start', 'stop'], 2117 autoplayHoverPause: false, 2118 autoplayButton: false, 2119 autoplayButtonOutput: true, 2120 autoplayResetOnVisibility: true, 2121 animateIn: 'tns-fadeIn', 2122 animateOut: 'tns-fadeOut', 2123 animateNormal: 'tns-normal', 2124 animateDelay: false, 2125 loop: true, 2126 rewind: false, 2127 autoHeight: false, 2128 responsive: false, 2129 lazyload: false, 2130 lazyloadSelector: '.tns-lazy-img', 2131 touch: true, 2132 mouseDrag: false, 2133 swipeAngle: 15, 2134 nested: false, 2135 preventActionWhenRunning: false, 2136 preventScrollOnTouch: false, 2137 freezable: true, 2138 onInit: false, 2139 useLocalStorage: true 2140 }, options || {}); 2141 2142 var doc = document, 2143 win = window, 2144 KEYS = { 2145 ENTER: 13, 2146 SPACE: 32, 2147 LEFT: 37, 2148 RIGHT: 39 2149 }, 2150 tnsStorage = {}, 2151 localStorageAccess = options.useLocalStorage; 2152 2153 if (localStorageAccess) { 2154 // check browser version and local storage access 2155 var browserInfo = navigator.userAgent; 2156 var uid = new Date; 2157 2158 try { 2159 tnsStorage = win.localStorage; 2160 if (tnsStorage) { 2161 tnsStorage.setItem(uid, uid); 2162 localStorageAccess = tnsStorage.getItem(uid) == uid; 2163 tnsStorage.removeItem(uid); 2164 } else { 2165 localStorageAccess = false; 2166 } 2167 if (!localStorageAccess) { tnsStorage = {}; } 2168 } catch(e) { 2169 localStorageAccess = false; 2170 } 2171 2172 if (localStorageAccess) { 2173 // remove storage when browser version changes 2174 if (tnsStorage['tnsApp'] && tnsStorage['tnsApp'] !== browserInfo) { 2175 ['tC', 'tPL', 'tMQ', 'tTf', 't3D', 'tTDu', 'tTDe', 'tADu', 'tADe', 'tTE', 'tAE'].forEach(function(item) { tnsStorage.removeItem(item); }); 2176 } 2177 // update browserInfo 2178 localStorage['tnsApp'] = browserInfo; 2179 } 2180 } 2181 2182 var CALC = tnsStorage['tC'] ? Object(_helpers_checkStorageValue_js__WEBPACK_IMPORTED_MODULE_5__["checkStorageValue"])(tnsStorage['tC']) : Object(_helpers_setLocalStorage_js__WEBPACK_IMPORTED_MODULE_6__["setLocalStorage"])(tnsStorage, 'tC', Object(_helpers_calc_js__WEBPACK_IMPORTED_MODULE_8__["calc"])(), localStorageAccess), 2183 PERCENTAGELAYOUT = tnsStorage['tPL'] ? Object(_helpers_checkStorageValue_js__WEBPACK_IMPORTED_MODULE_5__["checkStorageValue"])(tnsStorage['tPL']) : Object(_helpers_setLocalStorage_js__WEBPACK_IMPORTED_MODULE_6__["setLocalStorage"])(tnsStorage, 'tPL', Object(_helpers_percentageLayout_js__WEBPACK_IMPORTED_MODULE_9__["percentageLayout"])(), localStorageAccess), 2184 CSSMQ = tnsStorage['tMQ'] ? Object(_helpers_checkStorageValue_js__WEBPACK_IMPORTED_MODULE_5__["checkStorageValue"])(tnsStorage['tMQ']) : Object(_helpers_setLocalStorage_js__WEBPACK_IMPORTED_MODULE_6__["setLocalStorage"])(tnsStorage, 'tMQ', Object(_helpers_mediaquerySupport_js__WEBPACK_IMPORTED_MODULE_10__["mediaquerySupport"])(), localStorageAccess), 2185 TRANSFORM = tnsStorage['tTf'] ? Object(_helpers_checkStorageValue_js__WEBPACK_IMPORTED_MODULE_5__["checkStorageValue"])(tnsStorage['tTf']) : Object(_helpers_setLocalStorage_js__WEBPACK_IMPORTED_MODULE_6__["setLocalStorage"])(tnsStorage, 'tTf', Object(_helpers_whichProperty_js__WEBPACK_IMPORTED_MODULE_29__["whichProperty"])('transform'), localStorageAccess), 2186 HAS3DTRANSFORMS = tnsStorage['t3D'] ? Object(_helpers_checkStorageValue_js__WEBPACK_IMPORTED_MODULE_5__["checkStorageValue"])(tnsStorage['t3D']) : Object(_helpers_setLocalStorage_js__WEBPACK_IMPORTED_MODULE_6__["setLocalStorage"])(tnsStorage, 't3D', Object(_helpers_has3DTransforms_js__WEBPACK_IMPORTED_MODULE_30__["has3DTransforms"])(TRANSFORM), localStorageAccess), 2187 TRANSITIONDURATION = tnsStorage['tTDu'] ? Object(_helpers_checkStorageValue_js__WEBPACK_IMPORTED_MODULE_5__["checkStorageValue"])(tnsStorage['tTDu']) : Object(_helpers_setLocalStorage_js__WEBPACK_IMPORTED_MODULE_6__["setLocalStorage"])(tnsStorage, 'tTDu', Object(_helpers_whichProperty_js__WEBPACK_IMPORTED_MODULE_29__["whichProperty"])('transitionDuration'), localStorageAccess), 2188 TRANSITIONDELAY = tnsStorage['tTDe'] ? Object(_helpers_checkStorageValue_js__WEBPACK_IMPORTED_MODULE_5__["checkStorageValue"])(tnsStorage['tTDe']) : Object(_helpers_setLocalStorage_js__WEBPACK_IMPORTED_MODULE_6__["setLocalStorage"])(tnsStorage, 'tTDe', Object(_helpers_whichProperty_js__WEBPACK_IMPORTED_MODULE_29__["whichProperty"])('transitionDelay'), localStorageAccess), 2189 ANIMATIONDURATION = tnsStorage['tADu'] ? Object(_helpers_checkStorageValue_js__WEBPACK_IMPORTED_MODULE_5__["checkStorageValue"])(tnsStorage['tADu']) : Object(_helpers_setLocalStorage_js__WEBPACK_IMPORTED_MODULE_6__["setLocalStorage"])(tnsStorage, 'tADu', Object(_helpers_whichProperty_js__WEBPACK_IMPORTED_MODULE_29__["whichProperty"])('animationDuration'), localStorageAccess), 2190 ANIMATIONDELAY = tnsStorage['tADe'] ? Object(_helpers_checkStorageValue_js__WEBPACK_IMPORTED_MODULE_5__["checkStorageValue"])(tnsStorage['tADe']) : Object(_helpers_setLocalStorage_js__WEBPACK_IMPORTED_MODULE_6__["setLocalStorage"])(tnsStorage, 'tADe', Object(_helpers_whichProperty_js__WEBPACK_IMPORTED_MODULE_29__["whichProperty"])('animationDelay'), localStorageAccess), 2191 TRANSITIONEND = tnsStorage['tTE'] ? Object(_helpers_checkStorageValue_js__WEBPACK_IMPORTED_MODULE_5__["checkStorageValue"])(tnsStorage['tTE']) : Object(_helpers_setLocalStorage_js__WEBPACK_IMPORTED_MODULE_6__["setLocalStorage"])(tnsStorage, 'tTE', Object(_helpers_getEndProperty_js__WEBPACK_IMPORTED_MODULE_31__["getEndProperty"])(TRANSITIONDURATION, 'Transition'), localStorageAccess), 2192 ANIMATIONEND = tnsStorage['tAE'] ? Object(_helpers_checkStorageValue_js__WEBPACK_IMPORTED_MODULE_5__["checkStorageValue"])(tnsStorage['tAE']) : Object(_helpers_setLocalStorage_js__WEBPACK_IMPORTED_MODULE_6__["setLocalStorage"])(tnsStorage, 'tAE', Object(_helpers_getEndProperty_js__WEBPACK_IMPORTED_MODULE_31__["getEndProperty"])(ANIMATIONDURATION, 'Animation'), localStorageAccess); 2193 2194 // get element nodes from selectors 2195 var supportConsoleWarn = win.console && typeof win.console.warn === "function", 2196 tnsList = ['container', 'controlsContainer', 'prevButton', 'nextButton', 'navContainer', 'autoplayButton'], 2197 optionsElements = {}; 2198 2199 tnsList.forEach(function(item) { 2200 if (typeof options[item] === 'string') { 2201 var str = options[item], 2202 el = doc.querySelector(str); 2203 optionsElements[item] = str; 2204 2205 if (el && el.nodeName) { 2206 options[item] = el; 2207 } else { 2208 if (supportConsoleWarn) { console.warn('Can\'t find', options[item]); } 2209 return; 2210 } 2211 } 2212 }); 2213 2214 // make sure at least 1 slide 2215 if (options.container.children.length < 1) { 2216 if (supportConsoleWarn) { console.warn('No slides found in', options.container); } 2217 return; 2218 } 2219 2220 // update options 2221 var responsive = options.responsive, 2222 nested = options.nested, 2223 carousel = options.mode === 'carousel' ? true : false; 2224 2225 if (responsive) { 2226 // apply responsive[0] to options and remove it 2227 if (0 in responsive) { 2228 options = Object(_helpers_extend_js__WEBPACK_IMPORTED_MODULE_4__["extend"])(options, responsive[0]); 2229 delete responsive[0]; 2230 } 2231 2232 var responsiveTem = {}; 2233 for (var key in responsive) { 2234 var val = responsive[key]; 2235 // update responsive 2236 // from: 300: 2 2237 // to: 2238 // 300: { 2239 // items: 2 2240 // } 2241 val = typeof val === 'number' ? {items: val} : val; 2242 responsiveTem[key] = val; 2243 } 2244 responsive = responsiveTem; 2245 responsiveTem = null; 2246 } 2247 2248 // update options 2249 function updateOptions (obj) { 2250 for (var key in obj) { 2251 if (!carousel) { 2252 if (key === 'slideBy') { obj[key] = 'page'; } 2253 if (key === 'edgePadding') { obj[key] = false; } 2254 if (key === 'autoHeight') { obj[key] = false; } 2255 } 2256 2257 // update responsive options 2258 if (key === 'responsive') { updateOptions(obj[key]); } 2259 } 2260 } 2261 if (!carousel) { updateOptions(options); } 2262 2263 2264 // === define and set variables === 2265 if (!carousel) { 2266 options.axis = 'horizontal'; 2267 options.slideBy = 'page'; 2268 options.edgePadding = false; 2269 2270 var animateIn = options.animateIn, 2271 animateOut = options.animateOut, 2272 animateDelay = options.animateDelay, 2273 animateNormal = options.animateNormal; 2274 } 2275 2276 var horizontal = options.axis === 'horizontal' ? true : false, 2277 outerWrapper = doc.createElement('div'), 2278 innerWrapper = doc.createElement('div'), 2279 middleWrapper, 2280 container = options.container, 2281 containerParent = container.parentNode, 2282 containerHTML = container.outerHTML, 2283 slideItems = container.children, 2284 slideCount = slideItems.length, 2285 breakpointZone, 2286 windowWidth = getWindowWidth(), 2287 isOn = false; 2288 if (responsive) { setBreakpointZone(); } 2289 if (carousel) { container.className += ' tns-vpfix'; } 2290 2291 // fixedWidth: viewport > rightBoundary > indexMax 2292 var autoWidth = options.autoWidth, 2293 fixedWidth = getOption('fixedWidth'), 2294 edgePadding = getOption('edgePadding'), 2295 gutter = getOption('gutter'), 2296 viewport = getViewportWidth(), 2297 center = getOption('center'), 2298 items = !autoWidth ? Math.floor(getOption('items')) : 1, 2299 slideBy = getOption('slideBy'), 2300 viewportMax = options.viewportMax || options.fixedWidthViewportWidth, 2301 arrowKeys = getOption('arrowKeys'), 2302 speed = getOption('speed'), 2303 rewind = options.rewind, 2304 loop = rewind ? false : options.loop, 2305 autoHeight = getOption('autoHeight'), 2306 controls = getOption('controls'), 2307 controlsText = getOption('controlsText'), 2308 nav = getOption('nav'), 2309 touch = getOption('touch'), 2310 mouseDrag = getOption('mouseDrag'), 2311 autoplay = getOption('autoplay'), 2312 autoplayTimeout = getOption('autoplayTimeout'), 2313 autoplayText = getOption('autoplayText'), 2314 autoplayHoverPause = getOption('autoplayHoverPause'), 2315 autoplayResetOnVisibility = getOption('autoplayResetOnVisibility'), 2316 sheet = Object(_helpers_createStyleSheet_js__WEBPACK_IMPORTED_MODULE_11__["createStyleSheet"])(), 2317 lazyload = options.lazyload, 2318 lazyloadSelector = options.lazyloadSelector, 2319 slidePositions, // collection of slide positions 2320 slideItemsOut = [], 2321 cloneCount = loop ? getCloneCountForLoop() : 0, 2322 slideCountNew = !carousel ? slideCount + cloneCount : slideCount + cloneCount * 2, 2323 hasRightDeadZone = (fixedWidth || autoWidth) && !loop ? true : false, 2324 rightBoundary = fixedWidth ? getRightBoundary() : null, 2325 updateIndexBeforeTransform = (!carousel || !loop) ? true : false, 2326 // transform 2327 transformAttr = horizontal ? 'left' : 'top', 2328 transformPrefix = '', 2329 transformPostfix = '', 2330 // index 2331 getIndexMax = (function () { 2332 if (fixedWidth) { 2333 return function() { return center && !loop ? slideCount - 1 : Math.ceil(- rightBoundary / (fixedWidth + gutter)); }; 2334 } else if (autoWidth) { 2335 return function() { 2336 for (var i = slideCountNew; i--;) { 2337 if (slidePositions[i] >= - rightBoundary) { return i; } 2338 } 2339 }; 2340 } else { 2341 return function() { 2342 if (center && carousel && !loop) { 2343 return slideCount - 1; 2344 } else { 2345 return loop || carousel ? Math.max(0, slideCountNew - Math.ceil(items)) : slideCountNew - 1; 2346 } 2347 }; 2348 } 2349 })(), 2350 index = getStartIndex(getOption('startIndex')), 2351 indexCached = index, 2352 displayIndex = getCurrentSlide(), 2353 indexMin = 0, 2354 indexMax = !autoWidth ? getIndexMax() : null, 2355 // resize 2356 resizeTimer, 2357 preventActionWhenRunning = options.preventActionWhenRunning, 2358 swipeAngle = options.swipeAngle, 2359 moveDirectionExpected = swipeAngle ? '?' : true, 2360 running = false, 2361 onInit = options.onInit, 2362 events = new _helpers_events_js__WEBPACK_IMPORTED_MODULE_34__["Events"](), 2363 // id, class 2364 newContainerClasses = ' tns-slider tns-' + options.mode, 2365 slideId = container.id || Object(_helpers_getSlideId_js__WEBPACK_IMPORTED_MODULE_7__["getSlideId"])(), 2366 disable = getOption('disable'), 2367 disabled = false, 2368 freezable = options.freezable, 2369 freeze = freezable && !autoWidth ? getFreeze() : false, 2370 frozen = false, 2371 controlsEvents = { 2372 'click': onControlsClick, 2373 'keydown': onControlsKeydown 2374 }, 2375 navEvents = { 2376 'click': onNavClick, 2377 'keydown': onNavKeydown 2378 }, 2379 hoverEvents = { 2380 'mouseover': mouseoverPause, 2381 'mouseout': mouseoutRestart 2382 }, 2383 visibilityEvent = {'visibilitychange': onVisibilityChange}, 2384 docmentKeydownEvent = {'keydown': onDocumentKeydown}, 2385 touchEvents = { 2386 'touchstart': onPanStart, 2387 'touchmove': onPanMove, 2388 'touchend': onPanEnd, 2389 'touchcancel': onPanEnd 2390 }, dragEvents = { 2391 'mousedown': onPanStart, 2392 'mousemove': onPanMove, 2393 'mouseup': onPanEnd, 2394 'mouseleave': onPanEnd 2395 }, 2396 hasControls = hasOption('controls'), 2397 hasNav = hasOption('nav'), 2398 navAsThumbnails = autoWidth ? true : options.navAsThumbnails, 2399 hasAutoplay = hasOption('autoplay'), 2400 hasTouch = hasOption('touch'), 2401 hasMouseDrag = hasOption('mouseDrag'), 2402 slideActiveClass = 'tns-slide-active', 2403 imgCompleteClass = 'tns-complete', 2404 imgEvents = { 2405 'load': onImgLoaded, 2406 'error': onImgFailed 2407 }, 2408 imgsComplete, 2409 liveregionCurrent, 2410 preventScroll = options.preventScrollOnTouch === 'force' ? true : false; 2411 2412 // controls 2413 if (hasControls) { 2414 var controlsContainer = options.controlsContainer, 2415 controlsContainerHTML = options.controlsContainer ? options.controlsContainer.outerHTML : '', 2416 prevButton = options.prevButton, 2417 nextButton = options.nextButton, 2418 prevButtonHTML = options.prevButton ? options.prevButton.outerHTML : '', 2419 nextButtonHTML = options.nextButton ? options.nextButton.outerHTML : '', 2420 prevIsButton, 2421 nextIsButton; 2422 } 2423 2424 // nav 2425 if (hasNav) { 2426 var navContainer = options.navContainer, 2427 navContainerHTML = options.navContainer ? options.navContainer.outerHTML : '', 2428 navItems, 2429 pages = autoWidth ? slideCount : getPages(), 2430 pagesCached = 0, 2431 navClicked = -1, 2432 navCurrentIndex = getCurrentNavIndex(), 2433 navCurrentIndexCached = navCurrentIndex, 2434 navActiveClass = 'tns-nav-active', 2435 navStr = 'Carousel Page ', 2436 navStrCurrent = ' (Current Slide)'; 2437 } 2438 2439 // autoplay 2440 if (hasAutoplay) { 2441 var autoplayDirection = options.autoplayDirection === 'forward' ? 1 : -1, 2442 autoplayButton = options.autoplayButton, 2443 autoplayButtonHTML = options.autoplayButton ? options.autoplayButton.outerHTML : '', 2444 autoplayHtmlStrings = ['<span class=\'tns-visually-hidden\'>', ' animation</span>'], 2445 autoplayTimer, 2446 animating, 2447 autoplayHoverPaused, 2448 autoplayUserPaused, 2449 autoplayVisibilityPaused; 2450 } 2451 2452 if (hasTouch || hasMouseDrag) { 2453 var initPosition = {}, 2454 lastPosition = {}, 2455 translateInit, 2456 disX, 2457 disY, 2458 panStart = false, 2459 rafIndex, 2460 getDist = horizontal ? 2461 function(a, b) { return a.x - b.x; } : 2462 function(a, b) { return a.y - b.y; }; 2463 } 2464 2465 // disable slider when slidecount <= items 2466 if (!autoWidth) { resetVariblesWhenDisable(disable || freeze); } 2467 2468 if (TRANSFORM) { 2469 transformAttr = TRANSFORM; 2470 transformPrefix = 'translate'; 2471 2472 if (HAS3DTRANSFORMS) { 2473 transformPrefix += horizontal ? '3d(' : '3d(0px, '; 2474 transformPostfix = horizontal ? ', 0px, 0px)' : ', 0px)'; 2475 } else { 2476 transformPrefix += horizontal ? 'X(' : 'Y('; 2477 transformPostfix = ')'; 2478 } 2479 2480 } 2481 2482 if (carousel) { container.className = container.className.replace('tns-vpfix', ''); } 2483 initStructure(); 2484 initSheet(); 2485 initSliderTransform(); 2486 2487 // === COMMON FUNCTIONS === // 2488 function resetVariblesWhenDisable (condition) { 2489 if (condition) { 2490 controls = nav = touch = mouseDrag = arrowKeys = autoplay = autoplayHoverPause = autoplayResetOnVisibility = false; 2491 } 2492 } 2493 2494 function getCurrentSlide () { 2495 var tem = carousel ? index - cloneCount : index; 2496 while (tem < 0) { tem += slideCount; } 2497 return tem%slideCount + 1; 2498 } 2499 2500 function getStartIndex (ind) { 2501 ind = ind ? Math.max(0, Math.min(loop ? slideCount - 1 : slideCount - items, ind)) : 0; 2502 return carousel ? ind + cloneCount : ind; 2503 } 2504 2505 function getAbsIndex (i) { 2506 if (i == null) { i = index; } 2507 2508 if (carousel) { i -= cloneCount; } 2509 while (i < 0) { i += slideCount; } 2510 2511 return Math.floor(i%slideCount); 2512 } 2513 2514 function getCurrentNavIndex () { 2515 var absIndex = getAbsIndex(), 2516 result; 2517 2518 result = navAsThumbnails ? absIndex : 2519 fixedWidth || autoWidth ? Math.ceil((absIndex + 1) * pages / slideCount - 1) : 2520 Math.floor(absIndex / items); 2521 2522 // set active nav to the last one when reaches the right edge 2523 if (!loop && carousel && index === indexMax) { result = pages - 1; } 2524 2525 return result; 2526 } 2527 2528 function getItemsMax () { 2529 // fixedWidth or autoWidth while viewportMax is not available 2530 if (autoWidth || (fixedWidth && !viewportMax)) { 2531 return slideCount - 1; 2532 // most cases 2533 } else { 2534 var str = fixedWidth ? 'fixedWidth' : 'items', 2535 arr = []; 2536 2537 if (fixedWidth || options[str] < slideCount) { arr.push(options[str]); } 2538 2539 if (responsive) { 2540 for (var bp in responsive) { 2541 var tem = responsive[bp][str]; 2542 if (tem && (fixedWidth || tem < slideCount)) { arr.push(tem); } 2543 } 2544 } 2545 2546 if (!arr.length) { arr.push(0); } 2547 2548 return Math.ceil(fixedWidth ? viewportMax / Math.min.apply(null, arr) : Math.max.apply(null, arr)); 2549 } 2550 } 2551 2552 function getCloneCountForLoop () { 2553 var itemsMax = getItemsMax(), 2554 result = carousel ? Math.ceil((itemsMax * 5 - slideCount)/2) : (itemsMax * 4 - slideCount); 2555 result = Math.max(itemsMax, result); 2556 2557 return hasOption('edgePadding') ? result + 1 : result; 2558 } 2559 2560 function getWindowWidth () { 2561 return win.innerWidth || doc.documentElement.clientWidth || doc.body.clientWidth; 2562 } 2563 2564 function getInsertPosition (pos) { 2565 return pos === 'top' ? 'afterbegin' : 'beforeend'; 2566 } 2567 2568 function getClientWidth (el) { 2569 var div = doc.createElement('div'), rect, width; 2570 el.appendChild(div); 2571 rect = div.getBoundingClientRect(); 2572 width = rect.right - rect.left; 2573 div.remove(); 2574 return width || getClientWidth(el.parentNode); 2575 } 2576 2577 function getViewportWidth () { 2578 var gap = edgePadding ? edgePadding * 2 - gutter : 0; 2579 return getClientWidth(containerParent) - gap; 2580 } 2581 2582 function hasOption (item) { 2583 if (options[item]) { 2584 return true; 2585 } else { 2586 if (responsive) { 2587 for (var bp in responsive) { 2588 if (responsive[bp][item]) { return true; } 2589 } 2590 } 2591 return false; 2592 } 2593 } 2594 2595 // get option: 2596 // fixed width: viewport, fixedWidth, gutter => items 2597 // others: window width => all variables 2598 // all: items => slideBy 2599 function getOption (item, ww) { 2600 if (ww == null) { ww = windowWidth; } 2601 2602 if (item === 'items' && fixedWidth) { 2603 return Math.floor((viewport + gutter) / (fixedWidth + gutter)) || 1; 2604 2605 } else { 2606 var result = options[item]; 2607 2608 if (responsive) { 2609 for (var bp in responsive) { 2610 // bp: convert string to number 2611 if (ww >= parseInt(bp)) { 2612 if (item in responsive[bp]) { result = responsive[bp][item]; } 2613 } 2614 } 2615 } 2616 2617 if (item === 'slideBy' && result === 'page') { result = getOption('items'); } 2618 if (!carousel && (item === 'slideBy' || item === 'items')) { result = Math.floor(result); } 2619 2620 return result; 2621 } 2622 } 2623 2624 function getSlideMarginLeft (i) { 2625 return CALC ? 2626 CALC + '(' + i * 100 + '% / ' + slideCountNew + ')' : 2627 i * 100 / slideCountNew + '%'; 2628 } 2629 2630 function getInnerWrapperStyles (edgePaddingTem, gutterTem, fixedWidthTem, speedTem, autoHeightBP) { 2631 var str = ''; 2632 2633 if (edgePaddingTem !== undefined) { 2634 var gap = edgePaddingTem; 2635 if (gutterTem) { gap -= gutterTem; } 2636 str = horizontal ? 2637 'margin: 0 ' + gap + 'px 0 ' + edgePaddingTem + 'px;' : 2638 'margin: ' + edgePaddingTem + 'px 0 ' + gap + 'px 0;'; 2639 } else if (gutterTem && !fixedWidthTem) { 2640 var gutterTemUnit = '-' + gutterTem + 'px', 2641 dir = horizontal ? gutterTemUnit + ' 0 0' : '0 ' + gutterTemUnit + ' 0'; 2642 str = 'margin: 0 ' + dir + ';' 2643 } 2644 2645 if (!carousel && autoHeightBP && TRANSITIONDURATION && speedTem) { str += getTransitionDurationStyle(speedTem); } 2646 return str; 2647 } 2648 2649 function getContainerWidth (fixedWidthTem, gutterTem, itemsTem) { 2650 if (fixedWidthTem) { 2651 return (fixedWidthTem + gutterTem) * slideCountNew + 'px'; 2652 } else { 2653 return CALC ? 2654 CALC + '(' + slideCountNew * 100 + '% / ' + itemsTem + ')' : 2655 slideCountNew * 100 / itemsTem + '%'; 2656 } 2657 } 2658 2659 function getSlideWidthStyle (fixedWidthTem, gutterTem, itemsTem) { 2660 var width; 2661 2662 if (fixedWidthTem) { 2663 width = (fixedWidthTem + gutterTem) + 'px'; 2664 } else { 2665 if (!carousel) { itemsTem = Math.floor(itemsTem); } 2666 var dividend = carousel ? slideCountNew : itemsTem; 2667 width = CALC ? 2668 CALC + '(100% / ' + dividend + ')' : 2669 100 / dividend + '%'; 2670 } 2671 2672 width = 'width:' + width; 2673 2674 // inner slider: overwrite outer slider styles 2675 return nested !== 'inner' ? width + ';' : width + ' !important;'; 2676 } 2677 2678 function getSlideGutterStyle (gutterTem) { 2679 var str = ''; 2680 2681 // gutter maybe interger || 0 2682 // so can't use 'if (gutter)' 2683 if (gutterTem !== false) { 2684 var prop = horizontal ? 'padding-' : 'margin-', 2685 dir = horizontal ? 'right' : 'bottom'; 2686 str = prop + dir + ': ' + gutterTem + 'px;'; 2687 } 2688 2689 return str; 2690 } 2691 2692 function getCSSPrefix (name, num) { 2693 var prefix = name.substring(0, name.length - num).toLowerCase(); 2694 if (prefix) { prefix = '-' + prefix + '-'; } 2695 2696 return prefix; 2697 } 2698 2699 function getTransitionDurationStyle (speed) { 2700 return getCSSPrefix(TRANSITIONDURATION, 18) + 'transition-duration:' + speed / 1000 + 's;'; 2701 } 2702 2703 function getAnimationDurationStyle (speed) { 2704 return getCSSPrefix(ANIMATIONDURATION, 17) + 'animation-duration:' + speed / 1000 + 's;'; 2705 } 2706 2707 function initStructure () { 2708 var classOuter = 'tns-outer', 2709 classInner = 'tns-inner', 2710 hasGutter = hasOption('gutter'); 2711 2712 outerWrapper.className = classOuter; 2713 innerWrapper.className = classInner; 2714 outerWrapper.id = slideId + '-ow'; 2715 innerWrapper.id = slideId + '-iw'; 2716 2717 // set container properties 2718 if (container.id === '') { container.id = slideId; } 2719 newContainerClasses += PERCENTAGELAYOUT || autoWidth ? ' tns-subpixel' : ' tns-no-subpixel'; 2720 newContainerClasses += CALC ? ' tns-calc' : ' tns-no-calc'; 2721 if (autoWidth) { newContainerClasses += ' tns-autowidth'; } 2722 newContainerClasses += ' tns-' + options.axis; 2723 container.className += newContainerClasses; 2724 2725 // add constrain layer for carousel 2726 if (carousel) { 2727 middleWrapper = doc.createElement('div'); 2728 middleWrapper.id = slideId + '-mw'; 2729 middleWrapper.className = 'tns-ovh'; 2730 2731 outerWrapper.appendChild(middleWrapper); 2732 middleWrapper.appendChild(innerWrapper); 2733 } else { 2734 outerWrapper.appendChild(innerWrapper); 2735 } 2736 2737 if (autoHeight) { 2738 var wp = middleWrapper ? middleWrapper : innerWrapper; 2739 wp.className += ' tns-ah'; 2740 } 2741 2742 containerParent.insertBefore(outerWrapper, container); 2743 innerWrapper.appendChild(container); 2744 2745 // add id, class, aria attributes 2746 // before clone slides 2747 Object(_helpers_forEach_js__WEBPACK_IMPORTED_MODULE_17__["forEach"])(slideItems, function(item, i) { 2748 Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_19__["addClass"])(item, 'tns-item'); 2749 if (!item.id) { item.id = slideId + '-item' + i; } 2750 if (!carousel && animateNormal) { Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_19__["addClass"])(item, animateNormal); } 2751 Object(_helpers_setAttrs_js__WEBPACK_IMPORTED_MODULE_23__["setAttrs"])(item, { 2752 'aria-hidden': 'true', 2753 'tabindex': '-1' 2754 }); 2755 }); 2756 2757 // ## clone slides 2758 // carousel: n + slides + n 2759 // gallery: slides + n 2760 if (cloneCount) { 2761 var fragmentBefore = doc.createDocumentFragment(), 2762 fragmentAfter = doc.createDocumentFragment(); 2763 2764 for (var j = cloneCount; j--;) { 2765 var num = j%slideCount, 2766 cloneFirst = slideItems[num].cloneNode(true); 2767 Object(_helpers_removeAttrs_js__WEBPACK_IMPORTED_MODULE_24__["removeAttrs"])(cloneFirst, 'id'); 2768 fragmentAfter.insertBefore(cloneFirst, fragmentAfter.firstChild); 2769 2770 if (carousel) { 2771 var cloneLast = slideItems[slideCount - 1 - num].cloneNode(true); 2772 Object(_helpers_removeAttrs_js__WEBPACK_IMPORTED_MODULE_24__["removeAttrs"])(cloneLast, 'id'); 2773 fragmentBefore.appendChild(cloneLast); 2774 } 2775 } 2776 2777 container.insertBefore(fragmentBefore, container.firstChild); 2778 container.appendChild(fragmentAfter); 2779 slideItems = container.children; 2780 } 2781 2782 } 2783 2784 function initSliderTransform () { 2785 // ## images loaded/failed 2786 if (hasOption('autoHeight') || autoWidth || !horizontal) { 2787 var imgs = container.querySelectorAll('img'); 2788 2789 // add complete class if all images are loaded/failed 2790 Object(_helpers_forEach_js__WEBPACK_IMPORTED_MODULE_17__["forEach"])(imgs, function(img) { 2791 var src = img.src; 2792 2793 if (src && src.indexOf('data:image') < 0) { 2794 Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_32__["addEvents"])(img, imgEvents); 2795 img.src = ''; 2796 img.src = src; 2797 Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_19__["addClass"])(img, 'loading'); 2798 } else if (!lazyload) { 2799 imgLoaded(img); 2800 } 2801 }); 2802 2803 // All imgs are completed 2804 Object(_helpers_raf_js__WEBPACK_IMPORTED_MODULE_2__["raf"])(function(){ imgsLoadedCheck(Object(_helpers_arrayFromNodeList_js__WEBPACK_IMPORTED_MODULE_25__["arrayFromNodeList"])(imgs), function() { imgsComplete = true; }); }); 2805 2806 // Check imgs in window only for auto height 2807 if (!autoWidth && horizontal) { imgs = getImageArray(index, Math.min(index + items - 1, slideCountNew - 1)); } 2808 2809 lazyload ? initSliderTransformStyleCheck() : Object(_helpers_raf_js__WEBPACK_IMPORTED_MODULE_2__["raf"])(function(){ imgsLoadedCheck(Object(_helpers_arrayFromNodeList_js__WEBPACK_IMPORTED_MODULE_25__["arrayFromNodeList"])(imgs), initSliderTransformStyleCheck); }); 2810 2811 } else { 2812 // set container transform property 2813 if (carousel) { doContainerTransformSilent(); } 2814 2815 // update slider tools and events 2816 initTools(); 2817 initEvents(); 2818 } 2819 } 2820 2821 function initSliderTransformStyleCheck () { 2822 if (autoWidth) { 2823 // check styles application 2824 var num = loop ? index : slideCount - 1; 2825 (function stylesApplicationCheck() { 2826 slideItems[num - 1].getBoundingClientRect().right.toFixed(2) === slideItems[num].getBoundingClientRect().left.toFixed(2) ? 2827 initSliderTransformCore() : 2828 setTimeout(function(){ stylesApplicationCheck() }, 16); 2829 })(); 2830 } else { 2831 initSliderTransformCore(); 2832 } 2833 } 2834 2835 2836 function initSliderTransformCore () { 2837 // run Fn()s which are rely on image loading 2838 if (!horizontal || autoWidth) { 2839 setSlidePositions(); 2840 2841 if (autoWidth) { 2842 rightBoundary = getRightBoundary(); 2843 if (freezable) { freeze = getFreeze(); } 2844 indexMax = getIndexMax(); // <= slidePositions, rightBoundary <= 2845 resetVariblesWhenDisable(disable || freeze); 2846 } else { 2847 updateContentWrapperHeight(); 2848 } 2849 } 2850 2851 // set container transform property 2852 if (carousel) { doContainerTransformSilent(); } 2853 2854 // update slider tools and events 2855 initTools(); 2856 initEvents(); 2857 } 2858 2859 function initSheet () { 2860 // gallery: 2861 // set animation classes and left value for gallery slider 2862 if (!carousel) { 2863 for (var i = index, l = index + Math.min(slideCount, items); i < l; i++) { 2864 var item = slideItems[i]; 2865 item.style.left = (i - index) * 100 / items + '%'; 2866 Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_19__["addClass"])(item, animateIn); 2867 Object(_helpers_removeClass_js__WEBPACK_IMPORTED_MODULE_20__["removeClass"])(item, animateNormal); 2868 } 2869 } 2870 2871 // #### LAYOUT 2872 2873 // ## INLINE-BLOCK VS FLOAT 2874 2875 // ## PercentageLayout: 2876 // slides: inline-block 2877 // remove blank space between slides by set font-size: 0 2878 2879 // ## Non PercentageLayout: 2880 // slides: float 2881 // margin-right: -100% 2882 // margin-left: ~ 2883 2884 // Resource: https://docs.google.com/spreadsheets/d/147up245wwTXeQYve3BRSAD4oVcvQmuGsFteJOeA5xNQ/edit?usp=sharing 2885 if (horizontal) { 2886 if (PERCENTAGELAYOUT || autoWidth) { 2887 Object(_helpers_addCSSRule_js__WEBPACK_IMPORTED_MODULE_12__["addCSSRule"])(sheet, '#' + slideId + ' > .tns-item', 'font-size:' + win.getComputedStyle(slideItems[0]).fontSize + ';', Object(_helpers_getCssRulesLength_js__WEBPACK_IMPORTED_MODULE_14__["getCssRulesLength"])(sheet)); 2888 Object(_helpers_addCSSRule_js__WEBPACK_IMPORTED_MODULE_12__["addCSSRule"])(sheet, '#' + slideId, 'font-size:0;', Object(_helpers_getCssRulesLength_js__WEBPACK_IMPORTED_MODULE_14__["getCssRulesLength"])(sheet)); 2889 } else if (carousel) { 2890 Object(_helpers_forEach_js__WEBPACK_IMPORTED_MODULE_17__["forEach"])(slideItems, function (slide, i) { 2891 slide.style.marginLeft = getSlideMarginLeft(i); 2892 }); 2893 } 2894 } 2895 2896 2897 // ## BASIC STYLES 2898 if (CSSMQ) { 2899 // middle wrapper style 2900 if (TRANSITIONDURATION) { 2901 var str = middleWrapper && options.autoHeight ? getTransitionDurationStyle(options.speed) : ''; 2902 Object(_helpers_addCSSRule_js__WEBPACK_IMPORTED_MODULE_12__["addCSSRule"])(sheet, '#' + slideId + '-mw', str, Object(_helpers_getCssRulesLength_js__WEBPACK_IMPORTED_MODULE_14__["getCssRulesLength"])(sheet)); 2903 } 2904 2905 // inner wrapper styles 2906 str = getInnerWrapperStyles(options.edgePadding, options.gutter, options.fixedWidth, options.speed, options.autoHeight); 2907 Object(_helpers_addCSSRule_js__WEBPACK_IMPORTED_MODULE_12__["addCSSRule"])(sheet, '#' + slideId + '-iw', str, Object(_helpers_getCssRulesLength_js__WEBPACK_IMPORTED_MODULE_14__["getCssRulesLength"])(sheet)); 2908 2909 // container styles 2910 if (carousel) { 2911 str = horizontal && !autoWidth ? 'width:' + getContainerWidth(options.fixedWidth, options.gutter, options.items) + ';' : ''; 2912 if (TRANSITIONDURATION) { str += getTransitionDurationStyle(speed); } 2913 Object(_helpers_addCSSRule_js__WEBPACK_IMPORTED_MODULE_12__["addCSSRule"])(sheet, '#' + slideId, str, Object(_helpers_getCssRulesLength_js__WEBPACK_IMPORTED_MODULE_14__["getCssRulesLength"])(sheet)); 2914 } 2915 2916 // slide styles 2917 str = horizontal && !autoWidth ? getSlideWidthStyle(options.fixedWidth, options.gutter, options.items) : ''; 2918 if (options.gutter) { str += getSlideGutterStyle(options.gutter); } 2919 // set gallery items transition-duration 2920 if (!carousel) { 2921 if (TRANSITIONDURATION) { str += getTransitionDurationStyle(speed); } 2922 if (ANIMATIONDURATION) { str += getAnimationDurationStyle(speed); } 2923 } 2924 if (str) { Object(_helpers_addCSSRule_js__WEBPACK_IMPORTED_MODULE_12__["addCSSRule"])(sheet, '#' + slideId + ' > .tns-item', str, Object(_helpers_getCssRulesLength_js__WEBPACK_IMPORTED_MODULE_14__["getCssRulesLength"])(sheet)); } 2925 2926 // non CSS mediaqueries: IE8 2927 // ## update inner wrapper, container, slides if needed 2928 // set inline styles for inner wrapper & container 2929 // insert stylesheet (one line) for slides only (since slides are many) 2930 } else { 2931 // middle wrapper styles 2932 update_carousel_transition_duration(); 2933 2934 // inner wrapper styles 2935 innerWrapper.style.cssText = getInnerWrapperStyles(edgePadding, gutter, fixedWidth, autoHeight); 2936 2937 // container styles 2938 if (carousel && horizontal && !autoWidth) { 2939 container.style.width = getContainerWidth(fixedWidth, gutter, items); 2940 } 2941 2942 // slide styles 2943 var str = horizontal && !autoWidth ? getSlideWidthStyle(fixedWidth, gutter, items) : ''; 2944 if (gutter) { str += getSlideGutterStyle(gutter); } 2945 2946 // append to the last line 2947 if (str) { Object(_helpers_addCSSRule_js__WEBPACK_IMPORTED_MODULE_12__["addCSSRule"])(sheet, '#' + slideId + ' > .tns-item', str, Object(_helpers_getCssRulesLength_js__WEBPACK_IMPORTED_MODULE_14__["getCssRulesLength"])(sheet)); } 2948 } 2949 2950 // ## MEDIAQUERIES 2951 if (responsive && CSSMQ) { 2952 for (var bp in responsive) { 2953 // bp: convert string to number 2954 bp = parseInt(bp); 2955 2956 var opts = responsive[bp], 2957 str = '', 2958 middleWrapperStr = '', 2959 innerWrapperStr = '', 2960 containerStr = '', 2961 slideStr = '', 2962 itemsBP = !autoWidth ? getOption('items', bp) : null, 2963 fixedWidthBP = getOption('fixedWidth', bp), 2964 speedBP = getOption('speed', bp), 2965 edgePaddingBP = getOption('edgePadding', bp), 2966 autoHeightBP = getOption('autoHeight', bp), 2967 gutterBP = getOption('gutter', bp); 2968 2969 // middle wrapper string 2970 if (TRANSITIONDURATION && middleWrapper && getOption('autoHeight', bp) && 'speed' in opts) { 2971 middleWrapperStr = '#' + slideId + '-mw{' + getTransitionDurationStyle(speedBP) + '}'; 2972 } 2973 2974 // inner wrapper string 2975 if ('edgePadding' in opts || 'gutter' in opts) { 2976 innerWrapperStr = '#' + slideId + '-iw{' + getInnerWrapperStyles(edgePaddingBP, gutterBP, fixedWidthBP, speedBP, autoHeightBP) + '}'; 2977 } 2978 2979 // container string 2980 if (carousel && horizontal && !autoWidth && ('fixedWidth' in opts || 'items' in opts || (fixedWidth && 'gutter' in opts))) { 2981 containerStr = 'width:' + getContainerWidth(fixedWidthBP, gutterBP, itemsBP) + ';'; 2982 } 2983 if (TRANSITIONDURATION && 'speed' in opts) { 2984 containerStr += getTransitionDurationStyle(speedBP); 2985 } 2986 if (containerStr) { 2987 containerStr = '#' + slideId + '{' + containerStr + '}'; 2988 } 2989 2990 // slide string 2991 if ('fixedWidth' in opts || (fixedWidth && 'gutter' in opts) || !carousel && 'items' in opts) { 2992 slideStr += getSlideWidthStyle(fixedWidthBP, gutterBP, itemsBP); 2993 } 2994 if ('gutter' in opts) { 2995 slideStr += getSlideGutterStyle(gutterBP); 2996 } 2997 // set gallery items transition-duration 2998 if (!carousel && 'speed' in opts) { 2999 if (TRANSITIONDURATION) { slideStr += getTransitionDurationStyle(speedBP); } 3000 if (ANIMATIONDURATION) { slideStr += getAnimationDurationStyle(speedBP); } 3001 } 3002 if (slideStr) { slideStr = '#' + slideId + ' > .tns-item{' + slideStr + '}'; } 3003 3004 // add up 3005 str = middleWrapperStr + innerWrapperStr + containerStr + slideStr; 3006 3007 if (str) { 3008 sheet.insertRule('@media (min-width: ' + bp / 16 + 'em) {' + str + '}', sheet.cssRules.length); 3009 } 3010 } 3011 } 3012 } 3013 3014 function initTools () { 3015 // == slides == 3016 updateSlideStatus(); 3017 3018 // == live region == 3019 outerWrapper.insertAdjacentHTML('afterbegin', '<div class="tns-liveregion tns-visually-hidden" aria-live="polite" aria-atomic="true">slide <span class="current">' + getLiveRegionStr() + '</span> of ' + slideCount + '</div>'); 3020 liveregionCurrent = outerWrapper.querySelector('.tns-liveregion .current'); 3021 3022 // == autoplayInit == 3023 if (hasAutoplay) { 3024 var txt = autoplay ? 'stop' : 'start'; 3025 if (autoplayButton) { 3026 Object(_helpers_setAttrs_js__WEBPACK_IMPORTED_MODULE_23__["setAttrs"])(autoplayButton, {'data-action': txt}); 3027 } else if (options.autoplayButtonOutput) { 3028 outerWrapper.insertAdjacentHTML(getInsertPosition(options.autoplayPosition), '<button data-action="' + txt + '">' + autoplayHtmlStrings[0] + txt + autoplayHtmlStrings[1] + autoplayText[0] + '</button>'); 3029 autoplayButton = outerWrapper.querySelector('[data-action]'); 3030 } 3031 3032 // add event 3033 if (autoplayButton) { 3034 Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_32__["addEvents"])(autoplayButton, {'click': toggleAutoplay}); 3035 } 3036 3037 if (autoplay) { 3038 startAutoplay(); 3039 if (autoplayHoverPause) { Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_32__["addEvents"])(container, hoverEvents); } 3040 if (autoplayResetOnVisibility) { Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_32__["addEvents"])(container, visibilityEvent); } 3041 } 3042 } 3043 3044 // == navInit == 3045 if (hasNav) { 3046 var initIndex = !carousel ? 0 : cloneCount; 3047 // customized nav 3048 // will not hide the navs in case they're thumbnails 3049 if (navContainer) { 3050 Object(_helpers_setAttrs_js__WEBPACK_IMPORTED_MODULE_23__["setAttrs"])(navContainer, {'aria-label': 'Carousel Pagination'}); 3051 navItems = navContainer.children; 3052 Object(_helpers_forEach_js__WEBPACK_IMPORTED_MODULE_17__["forEach"])(navItems, function(item, i) { 3053 Object(_helpers_setAttrs_js__WEBPACK_IMPORTED_MODULE_23__["setAttrs"])(item, { 3054 'data-nav': i, 3055 'tabindex': '-1', 3056 'aria-label': navStr + (i + 1), 3057 'aria-controls': slideId, 3058 }); 3059 }); 3060 3061 // generated nav 3062 } else { 3063 var navHtml = '', 3064 hiddenStr = navAsThumbnails ? '' : 'style="display:none"'; 3065 for (var i = 0; i < slideCount; i++) { 3066 // hide nav items by default 3067 navHtml += '<button data-nav="' + i +'" tabindex="-1" aria-controls="' + slideId + '" ' + hiddenStr + ' aria-label="' + navStr + (i + 1) +'"></button>'; 3068 } 3069 navHtml = '<div class="tns-nav" aria-label="Carousel Pagination">' + navHtml + '</div>'; 3070 outerWrapper.insertAdjacentHTML(getInsertPosition(options.navPosition), navHtml); 3071 3072 navContainer = outerWrapper.querySelector('.tns-nav'); 3073 navItems = navContainer.children; 3074 } 3075 3076 updateNavVisibility(); 3077 3078 // add transition 3079 if (TRANSITIONDURATION) { 3080 var prefix = TRANSITIONDURATION.substring(0, TRANSITIONDURATION.length - 18).toLowerCase(), 3081 str = 'transition: all ' + speed / 1000 + 's'; 3082 3083 if (prefix) { 3084 str = '-' + prefix + '-' + str; 3085 } 3086 3087 Object(_helpers_addCSSRule_js__WEBPACK_IMPORTED_MODULE_12__["addCSSRule"])(sheet, '[aria-controls^=' + slideId + '-item]', str, Object(_helpers_getCssRulesLength_js__WEBPACK_IMPORTED_MODULE_14__["getCssRulesLength"])(sheet)); 3088 } 3089 3090 Object(_helpers_setAttrs_js__WEBPACK_IMPORTED_MODULE_23__["setAttrs"])(navItems[navCurrentIndex], {'aria-label': navStr + (navCurrentIndex + 1) + navStrCurrent}); 3091 Object(_helpers_removeAttrs_js__WEBPACK_IMPORTED_MODULE_24__["removeAttrs"])(navItems[navCurrentIndex], 'tabindex'); 3092 Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_19__["addClass"])(navItems[navCurrentIndex], navActiveClass); 3093 3094 // add events 3095 Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_32__["addEvents"])(navContainer, navEvents); 3096 } 3097 3098 3099 3100 // == controlsInit == 3101 if (hasControls) { 3102 if (!controlsContainer && (!prevButton || !nextButton)) { 3103 outerWrapper.insertAdjacentHTML(getInsertPosition(options.controlsPosition), '<div class="tns-controls" aria-label="Carousel Navigation" tabindex="0"><button data-controls="prev" tabindex="-1" aria-controls="' + slideId +'">' + controlsText[0] + '</button><button data-controls="next" tabindex="-1" aria-controls="' + slideId +'">' + controlsText[1] + '</button></div>'); 3104 3105 controlsContainer = outerWrapper.querySelector('.tns-controls'); 3106 } 3107 3108 if (!prevButton || !nextButton) { 3109 prevButton = controlsContainer.children[0]; 3110 nextButton = controlsContainer.children[1]; 3111 } 3112 3113 if (options.controlsContainer) { 3114 Object(_helpers_setAttrs_js__WEBPACK_IMPORTED_MODULE_23__["setAttrs"])(controlsContainer, { 3115 'aria-label': 'Carousel Navigation', 3116 'tabindex': '0' 3117 }); 3118 } 3119 3120 if (options.controlsContainer || (options.prevButton && options.nextButton)) { 3121 Object(_helpers_setAttrs_js__WEBPACK_IMPORTED_MODULE_23__["setAttrs"])([prevButton, nextButton], { 3122 'aria-controls': slideId, 3123 'tabindex': '-1', 3124 }); 3125 } 3126 3127 if (options.controlsContainer || (options.prevButton && options.nextButton)) { 3128 Object(_helpers_setAttrs_js__WEBPACK_IMPORTED_MODULE_23__["setAttrs"])(prevButton, {'data-controls' : 'prev'}); 3129 Object(_helpers_setAttrs_js__WEBPACK_IMPORTED_MODULE_23__["setAttrs"])(nextButton, {'data-controls' : 'next'}); 3130 } 3131 3132 prevIsButton = isButton(prevButton); 3133 nextIsButton = isButton(nextButton); 3134 3135 updateControlsStatus(); 3136 3137 // add events 3138 if (controlsContainer) { 3139 Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_32__["addEvents"])(controlsContainer, controlsEvents); 3140 } else { 3141 Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_32__["addEvents"])(prevButton, controlsEvents); 3142 Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_32__["addEvents"])(nextButton, controlsEvents); 3143 } 3144 } 3145 3146 // hide tools if needed 3147 disableUI(); 3148 } 3149 3150 function initEvents () { 3151 // add events 3152 if (carousel && TRANSITIONEND) { 3153 var eve = {}; 3154 eve[TRANSITIONEND] = onTransitionEnd; 3155 Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_32__["addEvents"])(container, eve); 3156 } 3157 3158 if (touch) { Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_32__["addEvents"])(container, touchEvents, options.preventScrollOnTouch); } 3159 if (mouseDrag) { Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_32__["addEvents"])(container, dragEvents); } 3160 if (arrowKeys) { Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_32__["addEvents"])(doc, docmentKeydownEvent); } 3161 3162 if (nested === 'inner') { 3163 events.on('outerResized', function () { 3164 resizeTasks(); 3165 events.emit('innerLoaded', info()); 3166 }); 3167 } else if (responsive || fixedWidth || autoWidth || autoHeight || !horizontal) { 3168 Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_32__["addEvents"])(win, {'resize': onResize}); 3169 } 3170 3171 if (autoHeight) { 3172 if (nested === 'outer') { 3173 events.on('innerLoaded', doAutoHeight); 3174 } else if (!disable) { doAutoHeight(); } 3175 } 3176 3177 doLazyLoad(); 3178 if (disable) { disableSlider(); } else if (freeze) { freezeSlider(); } 3179 3180 events.on('indexChanged', additionalUpdates); 3181 if (nested === 'inner') { events.emit('innerLoaded', info()); } 3182 if (typeof onInit === 'function') { onInit(info()); } 3183 isOn = true; 3184 } 3185 3186 function destroy () { 3187 // sheet 3188 sheet.disabled = true; 3189 if (sheet.ownerNode) { sheet.ownerNode.remove(); } 3190 3191 // remove win event listeners 3192 Object(_helpers_removeEvents_js__WEBPACK_IMPORTED_MODULE_33__["removeEvents"])(win, {'resize': onResize}); 3193 3194 // arrowKeys, controls, nav 3195 if (arrowKeys) { Object(_helpers_removeEvents_js__WEBPACK_IMPORTED_MODULE_33__["removeEvents"])(doc, docmentKeydownEvent); } 3196 if (controlsContainer) { Object(_helpers_removeEvents_js__WEBPACK_IMPORTED_MODULE_33__["removeEvents"])(controlsContainer, controlsEvents); } 3197 if (navContainer) { Object(_helpers_removeEvents_js__WEBPACK_IMPORTED_MODULE_33__["removeEvents"])(navContainer, navEvents); } 3198 3199 // autoplay 3200 Object(_helpers_removeEvents_js__WEBPACK_IMPORTED_MODULE_33__["removeEvents"])(container, hoverEvents); 3201 Object(_helpers_removeEvents_js__WEBPACK_IMPORTED_MODULE_33__["removeEvents"])(container, visibilityEvent); 3202 if (autoplayButton) { Object(_helpers_removeEvents_js__WEBPACK_IMPORTED_MODULE_33__["removeEvents"])(autoplayButton, {'click': toggleAutoplay}); } 3203 if (autoplay) { clearInterval(autoplayTimer); } 3204 3205 // container 3206 if (carousel && TRANSITIONEND) { 3207 var eve = {}; 3208 eve[TRANSITIONEND] = onTransitionEnd; 3209 Object(_helpers_removeEvents_js__WEBPACK_IMPORTED_MODULE_33__["removeEvents"])(container, eve); 3210 } 3211 if (touch) { Object(_helpers_removeEvents_js__WEBPACK_IMPORTED_MODULE_33__["removeEvents"])(container, touchEvents); } 3212 if (mouseDrag) { Object(_helpers_removeEvents_js__WEBPACK_IMPORTED_MODULE_33__["removeEvents"])(container, dragEvents); } 3213 3214 // cache Object values in options && reset HTML 3215 var htmlList = [containerHTML, controlsContainerHTML, prevButtonHTML, nextButtonHTML, navContainerHTML, autoplayButtonHTML]; 3216 3217 tnsList.forEach(function(item, i) { 3218 var el = item === 'container' ? outerWrapper : options[item]; 3219 3220 if (typeof el === 'object') { 3221 var prevEl = el.previousElementSibling ? el.previousElementSibling : false, 3222 parentEl = el.parentNode; 3223 el.outerHTML = htmlList[i]; 3224 options[item] = prevEl ? prevEl.nextElementSibling : parentEl.firstElementChild; 3225 } 3226 }); 3227 3228 3229 // reset variables 3230 tnsList = animateIn = animateOut = animateDelay = animateNormal = horizontal = outerWrapper = innerWrapper = container = containerParent = containerHTML = slideItems = slideCount = breakpointZone = windowWidth = autoWidth = fixedWidth = edgePadding = gutter = viewport = items = slideBy = viewportMax = arrowKeys = speed = rewind = loop = autoHeight = sheet = lazyload = slidePositions = slideItemsOut = cloneCount = slideCountNew = hasRightDeadZone = rightBoundary = updateIndexBeforeTransform = transformAttr = transformPrefix = transformPostfix = getIndexMax = index = indexCached = indexMin = indexMax = resizeTimer = swipeAngle = moveDirectionExpected = running = onInit = events = newContainerClasses = slideId = disable = disabled = freezable = freeze = frozen = controlsEvents = navEvents = hoverEvents = visibilityEvent = docmentKeydownEvent = touchEvents = dragEvents = hasControls = hasNav = navAsThumbnails = hasAutoplay = hasTouch = hasMouseDrag = slideActiveClass = imgCompleteClass = imgEvents = imgsComplete = controls = controlsText = controlsContainer = controlsContainerHTML = prevButton = nextButton = prevIsButton = nextIsButton = nav = navContainer = navContainerHTML = navItems = pages = pagesCached = navClicked = navCurrentIndex = navCurrentIndexCached = navActiveClass = navStr = navStrCurrent = autoplay = autoplayTimeout = autoplayDirection = autoplayText = autoplayHoverPause = autoplayButton = autoplayButtonHTML = autoplayResetOnVisibility = autoplayHtmlStrings = autoplayTimer = animating = autoplayHoverPaused = autoplayUserPaused = autoplayVisibilityPaused = initPosition = lastPosition = translateInit = disX = disY = panStart = rafIndex = getDist = touch = mouseDrag = null; 3231 // check variables 3232 // [animateIn, animateOut, animateDelay, animateNormal, horizontal, outerWrapper, innerWrapper, container, containerParent, containerHTML, slideItems, slideCount, breakpointZone, windowWidth, autoWidth, fixedWidth, edgePadding, gutter, viewport, items, slideBy, viewportMax, arrowKeys, speed, rewind, loop, autoHeight, sheet, lazyload, slidePositions, slideItemsOut, cloneCount, slideCountNew, hasRightDeadZone, rightBoundary, updateIndexBeforeTransform, transformAttr, transformPrefix, transformPostfix, getIndexMax, index, indexCached, indexMin, indexMax, resizeTimer, swipeAngle, moveDirectionExpected, running, onInit, events, newContainerClasses, slideId, disable, disabled, freezable, freeze, frozen, controlsEvents, navEvents, hoverEvents, visibilityEvent, docmentKeydownEvent, touchEvents, dragEvents, hasControls, hasNav, navAsThumbnails, hasAutoplay, hasTouch, hasMouseDrag, slideActiveClass, imgCompleteClass, imgEvents, imgsComplete, controls, controlsText, controlsContainer, controlsContainerHTML, prevButton, nextButton, prevIsButton, nextIsButton, nav, navContainer, navContainerHTML, navItems, pages, pagesCached, navClicked, navCurrentIndex, navCurrentIndexCached, navActiveClass, navStr, navStrCurrent, autoplay, autoplayTimeout, autoplayDirection, autoplayText, autoplayHoverPause, autoplayButton, autoplayButtonHTML, autoplayResetOnVisibility, autoplayHtmlStrings, autoplayTimer, animating, autoplayHoverPaused, autoplayUserPaused, autoplayVisibilityPaused, initPosition, lastPosition, translateInit, disX, disY, panStart, rafIndex, getDist, touch, mouseDrag ].forEach(function(item) { if (item !== null) { console.log(item); } }); 3233 3234 for (var a in this) { 3235 if (a !== 'rebuild') { this[a] = null; } 3236 } 3237 isOn = false; 3238 } 3239 3240// === ON RESIZE === 3241 // responsive || fixedWidth || autoWidth || !horizontal 3242 function onResize (e) { 3243 Object(_helpers_raf_js__WEBPACK_IMPORTED_MODULE_2__["raf"])(function(){ resizeTasks(getEvent(e)); }); 3244 } 3245 3246 function resizeTasks (e) { 3247 if (!isOn) { return; } 3248 if (nested === 'outer') { events.emit('outerResized', info(e)); } 3249 windowWidth = getWindowWidth(); 3250 var bpChanged, 3251 breakpointZoneTem = breakpointZone, 3252 needContainerTransform = false; 3253 3254 if (responsive) { 3255 setBreakpointZone(); 3256 bpChanged = breakpointZoneTem !== breakpointZone; 3257 // if (hasRightDeadZone) { needContainerTransform = true; } // *? 3258 if (bpChanged) { events.emit('newBreakpointStart', info(e)); } 3259 } 3260 3261 var indChanged, 3262 itemsChanged, 3263 itemsTem = items, 3264 disableTem = disable, 3265 freezeTem = freeze, 3266 arrowKeysTem = arrowKeys, 3267 controlsTem = controls, 3268 navTem = nav, 3269 touchTem = touch, 3270 mouseDragTem = mouseDrag, 3271 autoplayTem = autoplay, 3272 autoplayHoverPauseTem = autoplayHoverPause, 3273 autoplayResetOnVisibilityTem = autoplayResetOnVisibility, 3274 indexTem = index; 3275 3276 if (bpChanged) { 3277 var fixedWidthTem = fixedWidth, 3278 autoHeightTem = autoHeight, 3279 controlsTextTem = controlsText, 3280 centerTem = center, 3281 autoplayTextTem = autoplayText; 3282 3283 if (!CSSMQ) { 3284 var gutterTem = gutter, 3285 edgePaddingTem = edgePadding; 3286 } 3287 } 3288 3289 // get option: 3290 // fixed width: viewport, fixedWidth, gutter => items 3291 // others: window width => all variables 3292 // all: items => slideBy 3293 arrowKeys = getOption('arrowKeys'); 3294 controls = getOption('controls'); 3295 nav = getOption('nav'); 3296 touch = getOption('touch'); 3297 center = getOption('center'); 3298 mouseDrag = getOption('mouseDrag'); 3299 autoplay = getOption('autoplay'); 3300 autoplayHoverPause = getOption('autoplayHoverPause'); 3301 autoplayResetOnVisibility = getOption('autoplayResetOnVisibility'); 3302 3303 if (bpChanged) { 3304 disable = getOption('disable'); 3305 fixedWidth = getOption('fixedWidth'); 3306 speed = getOption('speed'); 3307 autoHeight = getOption('autoHeight'); 3308 controlsText = getOption('controlsText'); 3309 autoplayText = getOption('autoplayText'); 3310 autoplayTimeout = getOption('autoplayTimeout'); 3311 3312 if (!CSSMQ) { 3313 edgePadding = getOption('edgePadding'); 3314 gutter = getOption('gutter'); 3315 } 3316 } 3317 // update options 3318 resetVariblesWhenDisable(disable); 3319 3320 viewport = getViewportWidth(); // <= edgePadding, gutter 3321 if ((!horizontal || autoWidth) && !disable) { 3322 setSlidePositions(); 3323 if (!horizontal) { 3324 updateContentWrapperHeight(); // <= setSlidePositions 3325 needContainerTransform = true; 3326 } 3327 } 3328 if (fixedWidth || autoWidth) { 3329 rightBoundary = getRightBoundary(); // autoWidth: <= viewport, slidePositions, gutter 3330 // fixedWidth: <= viewport, fixedWidth, gutter 3331 indexMax = getIndexMax(); // autoWidth: <= rightBoundary, slidePositions 3332 // fixedWidth: <= rightBoundary, fixedWidth, gutter 3333 } 3334 3335 if (bpChanged || fixedWidth) { 3336 items = getOption('items'); 3337 slideBy = getOption('slideBy'); 3338 itemsChanged = items !== itemsTem; 3339 3340 if (itemsChanged) { 3341 if (!fixedWidth && !autoWidth) { indexMax = getIndexMax(); } // <= items 3342 // check index before transform in case 3343 // slider reach the right edge then items become bigger 3344 updateIndex(); 3345 } 3346 } 3347 3348 if (bpChanged) { 3349 if (disable !== disableTem) { 3350 if (disable) { 3351 disableSlider(); 3352 } else { 3353 enableSlider(); // <= slidePositions, rightBoundary, indexMax 3354 } 3355 } 3356 } 3357 3358 if (freezable && (bpChanged || fixedWidth || autoWidth)) { 3359 freeze = getFreeze(); // <= autoWidth: slidePositions, gutter, viewport, rightBoundary 3360 // <= fixedWidth: fixedWidth, gutter, rightBoundary 3361 // <= others: items 3362 3363 if (freeze !== freezeTem) { 3364 if (freeze) { 3365 doContainerTransform(getContainerTransformValue(getStartIndex(0))); 3366 freezeSlider(); 3367 } else { 3368 unfreezeSlider(); 3369 needContainerTransform = true; 3370 } 3371 } 3372 } 3373 3374 resetVariblesWhenDisable(disable || freeze); // controls, nav, touch, mouseDrag, arrowKeys, autoplay, autoplayHoverPause, autoplayResetOnVisibility 3375 if (!autoplay) { autoplayHoverPause = autoplayResetOnVisibility = false; } 3376 3377 if (arrowKeys !== arrowKeysTem) { 3378 arrowKeys ? 3379 Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_32__["addEvents"])(doc, docmentKeydownEvent) : 3380 Object(_helpers_removeEvents_js__WEBPACK_IMPORTED_MODULE_33__["removeEvents"])(doc, docmentKeydownEvent); 3381 } 3382 if (controls !== controlsTem) { 3383 if (controls) { 3384 if (controlsContainer) { 3385 Object(_helpers_showElement_js__WEBPACK_IMPORTED_MODULE_27__["showElement"])(controlsContainer); 3386 } else { 3387 if (prevButton) { Object(_helpers_showElement_js__WEBPACK_IMPORTED_MODULE_27__["showElement"])(prevButton); } 3388 if (nextButton) { Object(_helpers_showElement_js__WEBPACK_IMPORTED_MODULE_27__["showElement"])(nextButton); } 3389 } 3390 } else { 3391 if (controlsContainer) { 3392 Object(_helpers_hideElement_js__WEBPACK_IMPORTED_MODULE_26__["hideElement"])(controlsContainer); 3393 } else { 3394 if (prevButton) { Object(_helpers_hideElement_js__WEBPACK_IMPORTED_MODULE_26__["hideElement"])(prevButton); } 3395 if (nextButton) { Object(_helpers_hideElement_js__WEBPACK_IMPORTED_MODULE_26__["hideElement"])(nextButton); } 3396 } 3397 } 3398 } 3399 if (nav !== navTem) { 3400 nav ? 3401 Object(_helpers_showElement_js__WEBPACK_IMPORTED_MODULE_27__["showElement"])(navContainer) : 3402 Object(_helpers_hideElement_js__WEBPACK_IMPORTED_MODULE_26__["hideElement"])(navContainer); 3403 } 3404 if (touch !== touchTem) { 3405 touch ? 3406 Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_32__["addEvents"])(container, touchEvents, options.preventScrollOnTouch) : 3407 Object(_helpers_removeEvents_js__WEBPACK_IMPORTED_MODULE_33__["removeEvents"])(container, touchEvents); 3408 } 3409 if (mouseDrag !== mouseDragTem) { 3410 mouseDrag ? 3411 Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_32__["addEvents"])(container, dragEvents) : 3412 Object(_helpers_removeEvents_js__WEBPACK_IMPORTED_MODULE_33__["removeEvents"])(container, dragEvents); 3413 } 3414 if (autoplay !== autoplayTem) { 3415 if (autoplay) { 3416 if (autoplayButton) { Object(_helpers_showElement_js__WEBPACK_IMPORTED_MODULE_27__["showElement"])(autoplayButton); } 3417 if (!animating && !autoplayUserPaused) { startAutoplay(); } 3418 } else { 3419 if (autoplayButton) { Object(_helpers_hideElement_js__WEBPACK_IMPORTED_MODULE_26__["hideElement"])(autoplayButton); } 3420 if (animating) { stopAutoplay(); } 3421 } 3422 } 3423 if (autoplayHoverPause !== autoplayHoverPauseTem) { 3424 autoplayHoverPause ? 3425 Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_32__["addEvents"])(container, hoverEvents) : 3426 Object(_helpers_removeEvents_js__WEBPACK_IMPORTED_MODULE_33__["removeEvents"])(container, hoverEvents); 3427 } 3428 if (autoplayResetOnVisibility !== autoplayResetOnVisibilityTem) { 3429 autoplayResetOnVisibility ? 3430 Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_32__["addEvents"])(doc, visibilityEvent) : 3431 Object(_helpers_removeEvents_js__WEBPACK_IMPORTED_MODULE_33__["removeEvents"])(doc, visibilityEvent); 3432 } 3433 3434 if (bpChanged) { 3435 if (fixedWidth !== fixedWidthTem || center !== centerTem) { needContainerTransform = true; } 3436 3437 if (autoHeight !== autoHeightTem) { 3438 if (!autoHeight) { innerWrapper.style.height = ''; } 3439 } 3440 3441 if (controls && controlsText !== controlsTextTem) { 3442 prevButton.innerHTML = controlsText[0]; 3443 nextButton.innerHTML = controlsText[1]; 3444 } 3445 3446 if (autoplayButton && autoplayText !== autoplayTextTem) { 3447 var i = autoplay ? 1 : 0, 3448 html = autoplayButton.innerHTML, 3449 len = html.length - autoplayTextTem[i].length; 3450 if (html.substring(len) === autoplayTextTem[i]) { 3451 autoplayButton.innerHTML = html.substring(0, len) + autoplayText[i]; 3452 } 3453 } 3454 } else { 3455 if (center && (fixedWidth || autoWidth)) { needContainerTransform = true; } 3456 } 3457 3458 if (itemsChanged || fixedWidth && !autoWidth) { 3459 pages = getPages(); 3460 updateNavVisibility(); 3461 } 3462 3463 indChanged = index !== indexTem; 3464 if (indChanged) { 3465 events.emit('indexChanged', info()); 3466 needContainerTransform = true; 3467 } else if (itemsChanged) { 3468 if (!indChanged) { additionalUpdates(); } 3469 } else if (fixedWidth || autoWidth) { 3470 doLazyLoad(); 3471 updateSlideStatus(); 3472 updateLiveRegion(); 3473 } 3474 3475 if (itemsChanged && !carousel) { updateGallerySlidePositions(); } 3476 3477 if (!disable && !freeze) { 3478 // non-meduaqueries: IE8 3479 if (bpChanged && !CSSMQ) { 3480 // middle wrapper styles 3481 if (autoHeight !== autoheightTem || speed !== speedTem) { 3482 update_carousel_transition_duration(); 3483 } 3484 3485 // inner wrapper styles 3486 if (edgePadding !== edgePaddingTem || gutter !== gutterTem) { 3487 innerWrapper.style.cssText = getInnerWrapperStyles(edgePadding, gutter, fixedWidth, speed, autoHeight); 3488 } 3489 3490 if (horizontal) { 3491 // container styles 3492 if (carousel) { 3493 container.style.width = getContainerWidth(fixedWidth, gutter, items); 3494 } 3495 3496 // slide styles 3497 var str = getSlideWidthStyle(fixedWidth, gutter, items) + 3498 getSlideGutterStyle(gutter); 3499 3500 // remove the last line and 3501 // add new styles 3502 Object(_helpers_removeCSSRule_js__WEBPACK_IMPORTED_MODULE_13__["removeCSSRule"])(sheet, Object(_helpers_getCssRulesLength_js__WEBPACK_IMPORTED_MODULE_14__["getCssRulesLength"])(sheet) - 1); 3503 Object(_helpers_addCSSRule_js__WEBPACK_IMPORTED_MODULE_12__["addCSSRule"])(sheet, '#' + slideId + ' > .tns-item', str, Object(_helpers_getCssRulesLength_js__WEBPACK_IMPORTED_MODULE_14__["getCssRulesLength"])(sheet)); 3504 } 3505 } 3506 3507 // auto height 3508 if (autoHeight) { doAutoHeight(); } 3509 3510 if (needContainerTransform) { 3511 doContainerTransformSilent(); 3512 indexCached = index; 3513 } 3514 } 3515 3516 if (bpChanged) { events.emit('newBreakpointEnd', info(e)); } 3517 } 3518 3519 3520 3521 3522 3523 // === INITIALIZATION FUNCTIONS === // 3524 function getFreeze () { 3525 if (!fixedWidth && !autoWidth) { 3526 var a = center ? items - (items - 1) / 2 : items; 3527 return slideCount <= a; 3528 } 3529 3530 var width = fixedWidth ? (fixedWidth + gutter) * slideCount : slidePositions[slideCount], 3531 vp = edgePadding ? viewport + edgePadding * 2 : viewport + gutter; 3532 3533 if (center) { 3534 vp -= fixedWidth ? (viewport - fixedWidth) / 2 : (viewport - (slidePositions[index + 1] - slidePositions[index] - gutter)) / 2; 3535 } 3536 3537 return width <= vp; 3538 } 3539 3540 function setBreakpointZone () { 3541 breakpointZone = 0; 3542 for (var bp in responsive) { 3543 bp = parseInt(bp); // convert string to number 3544 if (windowWidth >= bp) { breakpointZone = bp; } 3545 } 3546 } 3547 3548 // (slideBy, indexMin, indexMax) => index 3549 var updateIndex = (function () { 3550 return loop ? 3551 carousel ? 3552 // loop + carousel 3553 function () { 3554 var leftEdge = indexMin, 3555 rightEdge = indexMax; 3556 3557 leftEdge += slideBy; 3558 rightEdge -= slideBy; 3559 3560 // adjust edges when has edge paddings 3561 // or fixed-width slider with extra space on the right side 3562 if (edgePadding) { 3563 leftEdge += 1; 3564 rightEdge -= 1; 3565 } else if (fixedWidth) { 3566 if ((viewport + gutter)%(fixedWidth + gutter)) { rightEdge -= 1; } 3567 } 3568 3569 if (cloneCount) { 3570 if (index > rightEdge) { 3571 index -= slideCount; 3572 } else if (index < leftEdge) { 3573 index += slideCount; 3574 } 3575 } 3576 } : 3577 // loop + gallery 3578 function() { 3579 if (index > indexMax) { 3580 while (index >= indexMin + slideCount) { index -= slideCount; } 3581 } else if (index < indexMin) { 3582 while (index <= indexMax - slideCount) { index += slideCount; } 3583 } 3584 } : 3585 // non-loop 3586 function() { 3587 index = Math.max(indexMin, Math.min(indexMax, index)); 3588 }; 3589 })(); 3590 3591 function disableUI () { 3592 if (!autoplay && autoplayButton) { Object(_helpers_hideElement_js__WEBPACK_IMPORTED_MODULE_26__["hideElement"])(autoplayButton); } 3593 if (!nav && navContainer) { Object(_helpers_hideElement_js__WEBPACK_IMPORTED_MODULE_26__["hideElement"])(navContainer); } 3594 if (!controls) { 3595 if (controlsContainer) { 3596 Object(_helpers_hideElement_js__WEBPACK_IMPORTED_MODULE_26__["hideElement"])(controlsContainer); 3597 } else { 3598 if (prevButton) { Object(_helpers_hideElement_js__WEBPACK_IMPORTED_MODULE_26__["hideElement"])(prevButton); } 3599 if (nextButton) { Object(_helpers_hideElement_js__WEBPACK_IMPORTED_MODULE_26__["hideElement"])(nextButton); } 3600 } 3601 } 3602 } 3603 3604 function enableUI () { 3605 if (autoplay && autoplayButton) { Object(_helpers_showElement_js__WEBPACK_IMPORTED_MODULE_27__["showElement"])(autoplayButton); } 3606 if (nav && navContainer) { Object(_helpers_showElement_js__WEBPACK_IMPORTED_MODULE_27__["showElement"])(navContainer); } 3607 if (controls) { 3608 if (controlsContainer) { 3609 Object(_helpers_showElement_js__WEBPACK_IMPORTED_MODULE_27__["showElement"])(controlsContainer); 3610 } else { 3611 if (prevButton) { Object(_helpers_showElement_js__WEBPACK_IMPORTED_MODULE_27__["showElement"])(prevButton); } 3612 if (nextButton) { Object(_helpers_showElement_js__WEBPACK_IMPORTED_MODULE_27__["showElement"])(nextButton); } 3613 } 3614 } 3615 } 3616 3617 function freezeSlider () { 3618 if (frozen) { return; } 3619 3620 // remove edge padding from inner wrapper 3621 if (edgePadding) { innerWrapper.style.margin = '0px'; } 3622 3623 // add class tns-transparent to cloned slides 3624 if (cloneCount) { 3625 var str = 'tns-transparent'; 3626 for (var i = cloneCount; i--;) { 3627 if (carousel) { Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_19__["addClass"])(slideItems[i], str); } 3628 Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_19__["addClass"])(slideItems[slideCountNew - i - 1], str); 3629 } 3630 } 3631 3632 // update tools 3633 disableUI(); 3634 3635 frozen = true; 3636 } 3637 3638 function unfreezeSlider () { 3639 if (!frozen) { return; } 3640 3641 // restore edge padding for inner wrapper 3642 // for mordern browsers 3643 if (edgePadding && CSSMQ) { innerWrapper.style.margin = ''; } 3644 3645 // remove class tns-transparent to cloned slides 3646 if (cloneCount) { 3647 var str = 'tns-transparent'; 3648 for (var i = cloneCount; i--;) { 3649 if (carousel) { Object(_helpers_removeClass_js__WEBPACK_IMPORTED_MODULE_20__["removeClass"])(slideItems[i], str); } 3650 Object(_helpers_removeClass_js__WEBPACK_IMPORTED_MODULE_20__["removeClass"])(slideItems[slideCountNew - i - 1], str); 3651 } 3652 } 3653 3654 // update tools 3655 enableUI(); 3656 3657 frozen = false; 3658 } 3659 3660 function disableSlider () { 3661 if (disabled) { return; } 3662 3663 sheet.disabled = true; 3664 container.className = container.className.replace(newContainerClasses.substring(1), ''); 3665 Object(_helpers_removeAttrs_js__WEBPACK_IMPORTED_MODULE_24__["removeAttrs"])(container, ['style']); 3666 if (loop) { 3667 for (var j = cloneCount; j--;) { 3668 if (carousel) { Object(_helpers_hideElement_js__WEBPACK_IMPORTED_MODULE_26__["hideElement"])(slideItems[j]); } 3669 Object(_helpers_hideElement_js__WEBPACK_IMPORTED_MODULE_26__["hideElement"])(slideItems[slideCountNew - j - 1]); 3670 } 3671 } 3672 3673 // vertical slider 3674 if (!horizontal || !carousel) { Object(_helpers_removeAttrs_js__WEBPACK_IMPORTED_MODULE_24__["removeAttrs"])(innerWrapper, ['style']); } 3675 3676 // gallery 3677 if (!carousel) { 3678 for (var i = index, l = index + slideCount; i < l; i++) { 3679 var item = slideItems[i]; 3680 Object(_helpers_removeAttrs_js__WEBPACK_IMPORTED_MODULE_24__["removeAttrs"])(item, ['style']); 3681 Object(_helpers_removeClass_js__WEBPACK_IMPORTED_MODULE_20__["removeClass"])(item, animateIn); 3682 Object(_helpers_removeClass_js__WEBPACK_IMPORTED_MODULE_20__["removeClass"])(item, animateNormal); 3683 } 3684 } 3685 3686 // update tools 3687 disableUI(); 3688 3689 disabled = true; 3690 } 3691 3692 function enableSlider () { 3693 if (!disabled) { return; } 3694 3695 sheet.disabled = false; 3696 container.className += newContainerClasses; 3697 doContainerTransformSilent(); 3698 3699 if (loop) { 3700 for (var j = cloneCount; j--;) { 3701 if (carousel) { Object(_helpers_showElement_js__WEBPACK_IMPORTED_MODULE_27__["showElement"])(slideItems[j]); } 3702 Object(_helpers_showElement_js__WEBPACK_IMPORTED_MODULE_27__["showElement"])(slideItems[slideCountNew - j - 1]); 3703 } 3704 } 3705 3706 // gallery 3707 if (!carousel) { 3708 for (var i = index, l = index + slideCount; i < l; i++) { 3709 var item = slideItems[i], 3710 classN = i < index + items ? animateIn : animateNormal; 3711 item.style.left = (i - index) * 100 / items + '%'; 3712 Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_19__["addClass"])(item, classN); 3713 } 3714 } 3715 3716 // update tools 3717 enableUI(); 3718 3719 disabled = false; 3720 } 3721 3722 function updateLiveRegion () { 3723 var str = getLiveRegionStr(); 3724 if (liveregionCurrent.innerHTML !== str) { liveregionCurrent.innerHTML = str; } 3725 } 3726 3727 function getLiveRegionStr () { 3728 var arr = getVisibleSlideRange(), 3729 start = arr[0] + 1, 3730 end = arr[1] + 1; 3731 return start === end ? start + '' : start + ' to ' + end; 3732 } 3733 3734 function getVisibleSlideRange (val) { 3735 if (val == null) { val = getContainerTransformValue(); } 3736 var start = index, end, rangestart, rangeend; 3737 3738 // get range start, range end for autoWidth and fixedWidth 3739 if (center || edgePadding) { 3740 if (autoWidth || fixedWidth) { 3741 rangestart = - (parseFloat(val) + edgePadding); 3742 rangeend = rangestart + viewport + edgePadding * 2; 3743 } 3744 } else { 3745 if (autoWidth) { 3746 rangestart = slidePositions[index]; 3747 rangeend = rangestart + viewport; 3748 } 3749 } 3750 3751 // get start, end 3752 // - check auto width 3753 if (autoWidth) { 3754 slidePositions.forEach(function(point, i) { 3755 if (i < slideCountNew) { 3756 if ((center || edgePadding) && point <= rangestart + 0.5) { start = i; } 3757 if (rangeend - point >= 0.5) { end = i; } 3758 } 3759 }); 3760 3761 // - check percentage width, fixed width 3762 } else { 3763 3764 if (fixedWidth) { 3765 var cell = fixedWidth + gutter; 3766 if (center || edgePadding) { 3767 start = Math.floor(rangestart/cell); 3768 end = Math.ceil(rangeend/cell - 1); 3769 } else { 3770 end = start + Math.ceil(viewport/cell) - 1; 3771 } 3772 3773 } else { 3774 if (center || edgePadding) { 3775 var a = items - 1; 3776 if (center) { 3777 start -= a / 2; 3778 end = index + a / 2; 3779 } else { 3780 end = index + a; 3781 } 3782 3783 if (edgePadding) { 3784 var b = edgePadding * items / viewport; 3785 start -= b; 3786 end += b; 3787 } 3788 3789 start = Math.floor(start); 3790 end = Math.ceil(end); 3791 } else { 3792 end = start + items - 1; 3793 } 3794 } 3795 3796 start = Math.max(start, 0); 3797 end = Math.min(end, slideCountNew - 1); 3798 } 3799 3800 return [start, end]; 3801 } 3802 3803 function doLazyLoad () { 3804 if (lazyload && !disable) { 3805 getImageArray.apply(null, getVisibleSlideRange()).forEach(function (img) { 3806 if (!Object(_helpers_hasClass_js__WEBPACK_IMPORTED_MODULE_18__["hasClass"])(img, imgCompleteClass)) { 3807 // stop propagation transitionend event to container 3808 var eve = {}; 3809 eve[TRANSITIONEND] = function (e) { e.stopPropagation(); }; 3810 Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_32__["addEvents"])(img, eve); 3811 3812 Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_32__["addEvents"])(img, imgEvents); 3813 3814 // update src 3815 img.src = Object(_helpers_getAttr_js__WEBPACK_IMPORTED_MODULE_22__["getAttr"])(img, 'data-src'); 3816 3817 // update srcset 3818 var srcset = Object(_helpers_getAttr_js__WEBPACK_IMPORTED_MODULE_22__["getAttr"])(img, 'data-srcset'); 3819 if (srcset) { img.srcset = srcset; } 3820 3821 Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_19__["addClass"])(img, 'loading'); 3822 } 3823 }); 3824 } 3825 } 3826 3827 function onImgLoaded (e) { 3828 imgLoaded(getTarget(e)); 3829 } 3830 3831 function onImgFailed (e) { 3832 imgFailed(getTarget(e)); 3833 } 3834 3835 function imgLoaded (img) { 3836 Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_19__["addClass"])(img, 'loaded'); 3837 imgCompleted(img); 3838 } 3839 3840 function imgFailed (img) { 3841 Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_19__["addClass"])(img, 'failed'); 3842 imgCompleted(img); 3843 } 3844 3845 function imgCompleted (img) { 3846 Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_19__["addClass"])(img, 'tns-complete'); 3847 Object(_helpers_removeClass_js__WEBPACK_IMPORTED_MODULE_20__["removeClass"])(img, 'loading'); 3848 Object(_helpers_removeEvents_js__WEBPACK_IMPORTED_MODULE_33__["removeEvents"])(img, imgEvents); 3849 } 3850 3851 function getImageArray (start, end) { 3852 var imgs = []; 3853 while (start <= end) { 3854 Object(_helpers_forEach_js__WEBPACK_IMPORTED_MODULE_17__["forEach"])(slideItems[start].querySelectorAll('img'), function (img) { imgs.push(img); }); 3855 start++; 3856 } 3857 3858 return imgs; 3859 } 3860 3861 // check if all visible images are loaded 3862 // and update container height if it's done 3863 function doAutoHeight () { 3864 var imgs = getImageArray.apply(null, getVisibleSlideRange()); 3865 Object(_helpers_raf_js__WEBPACK_IMPORTED_MODULE_2__["raf"])(function(){ imgsLoadedCheck(imgs, updateInnerWrapperHeight); }); 3866 } 3867 3868 function imgsLoadedCheck (imgs, cb) { 3869 // directly execute callback function if all images are complete 3870 if (imgsComplete) { return cb(); } 3871 3872 // check selected image classes otherwise 3873 imgs.forEach(function (img, index) { 3874 if (Object(_helpers_hasClass_js__WEBPACK_IMPORTED_MODULE_18__["hasClass"])(img, imgCompleteClass)) { imgs.splice(index, 1); } 3875 }); 3876 3877 // execute callback function if selected images are all complete 3878 if (!imgs.length) { return cb(); } 3879 3880 // otherwise execute this functiona again 3881 Object(_helpers_raf_js__WEBPACK_IMPORTED_MODULE_2__["raf"])(function(){ imgsLoadedCheck(imgs, cb); }); 3882 } 3883 3884 function additionalUpdates () { 3885 doLazyLoad(); 3886 updateSlideStatus(); 3887 updateLiveRegion(); 3888 updateControlsStatus(); 3889 updateNavStatus(); 3890 } 3891 3892 3893 function update_carousel_transition_duration () { 3894 if (carousel && autoHeight) { 3895 middleWrapper.style[TRANSITIONDURATION] = speed / 1000 + 's'; 3896 } 3897 } 3898 3899 function getMaxSlideHeight (slideStart, slideRange) { 3900 var heights = []; 3901 for (var i = slideStart, l = Math.min(slideStart + slideRange, slideCountNew); i < l; i++) { 3902 heights.push(slideItems[i].offsetHeight); 3903 } 3904 3905 return Math.max.apply(null, heights); 3906 } 3907 3908 // update inner wrapper height 3909 // 1. get the max-height of the visible slides 3910 // 2. set transitionDuration to speed 3911 // 3. update inner wrapper height to max-height 3912 // 4. set transitionDuration to 0s after transition done 3913 function updateInnerWrapperHeight () { 3914 var maxHeight = autoHeight ? getMaxSlideHeight(index, items) : getMaxSlideHeight(cloneCount, slideCount), 3915 wp = middleWrapper ? middleWrapper : innerWrapper; 3916 3917 if (wp.style.height !== maxHeight) { wp.style.height = maxHeight + 'px'; } 3918 } 3919 3920 // get the distance from the top edge of the first slide to each slide 3921 // (init) => slidePositions 3922 function setSlidePositions () { 3923 slidePositions = [0]; 3924 var attr = horizontal ? 'left' : 'top', 3925 attr2 = horizontal ? 'right' : 'bottom', 3926 base = slideItems[0].getBoundingClientRect()[attr]; 3927 3928 Object(_helpers_forEach_js__WEBPACK_IMPORTED_MODULE_17__["forEach"])(slideItems, function(item, i) { 3929 // skip the first slide 3930 if (i) { slidePositions.push(item.getBoundingClientRect()[attr] - base); } 3931 // add the end edge 3932 if (i === slideCountNew - 1) { slidePositions.push(item.getBoundingClientRect()[attr2] - base); } 3933 }); 3934 } 3935 3936 // update slide 3937 function updateSlideStatus () { 3938 var range = getVisibleSlideRange(), 3939 start = range[0], 3940 end = range[1]; 3941 3942 Object(_helpers_forEach_js__WEBPACK_IMPORTED_MODULE_17__["forEach"])(slideItems, function(item, i) { 3943 // show slides 3944 if (i >= start && i <= end) { 3945 if (Object(_helpers_hasAttr_js__WEBPACK_IMPORTED_MODULE_21__["hasAttr"])(item, 'aria-hidden')) { 3946 Object(_helpers_removeAttrs_js__WEBPACK_IMPORTED_MODULE_24__["removeAttrs"])(item, ['aria-hidden', 'tabindex']); 3947 Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_19__["addClass"])(item, slideActiveClass); 3948 } 3949 // hide slides 3950 } else { 3951 if (!Object(_helpers_hasAttr_js__WEBPACK_IMPORTED_MODULE_21__["hasAttr"])(item, 'aria-hidden')) { 3952 Object(_helpers_setAttrs_js__WEBPACK_IMPORTED_MODULE_23__["setAttrs"])(item, { 3953 'aria-hidden': 'true', 3954 'tabindex': '-1' 3955 }); 3956 Object(_helpers_removeClass_js__WEBPACK_IMPORTED_MODULE_20__["removeClass"])(item, slideActiveClass); 3957 } 3958 } 3959 }); 3960 } 3961 3962 // gallery: update slide position 3963 function updateGallerySlidePositions () { 3964 var l = index + Math.min(slideCount, items); 3965 for (var i = slideCountNew; i--;) { 3966 var item = slideItems[i]; 3967 3968 if (i >= index && i < l) { 3969 // add transitions to visible slides when adjusting their positions 3970 Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_19__["addClass"])(item, 'tns-moving'); 3971 3972 item.style.left = (i - index) * 100 / items + '%'; 3973 Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_19__["addClass"])(item, animateIn); 3974 Object(_helpers_removeClass_js__WEBPACK_IMPORTED_MODULE_20__["removeClass"])(item, animateNormal); 3975 } else if (item.style.left) { 3976 item.style.left = ''; 3977 Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_19__["addClass"])(item, animateNormal); 3978 Object(_helpers_removeClass_js__WEBPACK_IMPORTED_MODULE_20__["removeClass"])(item, animateIn); 3979 } 3980 3981 // remove outlet animation 3982 Object(_helpers_removeClass_js__WEBPACK_IMPORTED_MODULE_20__["removeClass"])(item, animateOut); 3983 } 3984 3985 // removing '.tns-moving' 3986 setTimeout(function() { 3987 Object(_helpers_forEach_js__WEBPACK_IMPORTED_MODULE_17__["forEach"])(slideItems, function(el) { 3988 Object(_helpers_removeClass_js__WEBPACK_IMPORTED_MODULE_20__["removeClass"])(el, 'tns-moving'); 3989 }); 3990 }, 300); 3991 } 3992 3993 // set tabindex on Nav 3994 function updateNavStatus () { 3995 // get current nav 3996 if (nav) { 3997 navCurrentIndex = navClicked >= 0 ? navClicked : getCurrentNavIndex(); 3998 navClicked = -1; 3999 4000 if (navCurrentIndex !== navCurrentIndexCached) { 4001 var navPrev = navItems[navCurrentIndexCached], 4002 navCurrent = navItems[navCurrentIndex]; 4003 4004 Object(_helpers_setAttrs_js__WEBPACK_IMPORTED_MODULE_23__["setAttrs"])(navPrev, { 4005 'tabindex': '-1', 4006 'aria-label': navStr + (navCurrentIndexCached + 1) 4007 }); 4008 Object(_helpers_removeClass_js__WEBPACK_IMPORTED_MODULE_20__["removeClass"])(navPrev, navActiveClass); 4009 4010 Object(_helpers_setAttrs_js__WEBPACK_IMPORTED_MODULE_23__["setAttrs"])(navCurrent, {'aria-label': navStr + (navCurrentIndex + 1) + navStrCurrent}); 4011 Object(_helpers_removeAttrs_js__WEBPACK_IMPORTED_MODULE_24__["removeAttrs"])(navCurrent, 'tabindex'); 4012 Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_19__["addClass"])(navCurrent, navActiveClass); 4013 4014 navCurrentIndexCached = navCurrentIndex; 4015 } 4016 } 4017 } 4018 4019 function getLowerCaseNodeName (el) { 4020 return el.nodeName.toLowerCase(); 4021 } 4022 4023 function isButton (el) { 4024 return getLowerCaseNodeName(el) === 'button'; 4025 } 4026 4027 function isAriaDisabled (el) { 4028 return el.getAttribute('aria-disabled') === 'true'; 4029 } 4030 4031 function disEnableElement (isButton, el, val) { 4032 if (isButton) { 4033 el.disabled = val; 4034 } else { 4035 el.setAttribute('aria-disabled', val.toString()); 4036 } 4037 } 4038 4039 // set 'disabled' to true on controls when reach the edges 4040 function updateControlsStatus () { 4041 if (!controls || rewind || loop) { return; } 4042 4043 var prevDisabled = (prevIsButton) ? prevButton.disabled : isAriaDisabled(prevButton), 4044 nextDisabled = (nextIsButton) ? nextButton.disabled : isAriaDisabled(nextButton), 4045 disablePrev = (index <= indexMin) ? true : false, 4046 disableNext = (!rewind && index >= indexMax) ? true : false; 4047 4048 if (disablePrev && !prevDisabled) { 4049 disEnableElement(prevIsButton, prevButton, true); 4050 } 4051 if (!disablePrev && prevDisabled) { 4052 disEnableElement(prevIsButton, prevButton, false); 4053 } 4054 if (disableNext && !nextDisabled) { 4055 disEnableElement(nextIsButton, nextButton, true); 4056 } 4057 if (!disableNext && nextDisabled) { 4058 disEnableElement(nextIsButton, nextButton, false); 4059 } 4060 } 4061 4062 // set duration 4063 function resetDuration (el, str) { 4064 if (TRANSITIONDURATION) { el.style[TRANSITIONDURATION] = str; } 4065 } 4066 4067 function getSliderWidth () { 4068 return fixedWidth ? (fixedWidth + gutter) * slideCountNew : slidePositions[slideCountNew]; 4069 } 4070 4071 function getCenterGap (num) { 4072 if (num == null) { num = index; } 4073 4074 var gap = edgePadding ? gutter : 0; 4075 return autoWidth ? ((viewport - gap) - (slidePositions[num + 1] - slidePositions[num] - gutter))/2 : 4076 fixedWidth ? (viewport - fixedWidth) / 2 : 4077 (items - 1) / 2; 4078 } 4079 4080 function getRightBoundary () { 4081 var gap = edgePadding ? gutter : 0, 4082 result = (viewport + gap) - getSliderWidth(); 4083 4084 if (center && !loop) { 4085 result = fixedWidth ? - (fixedWidth + gutter) * (slideCountNew - 1) - getCenterGap() : 4086 getCenterGap(slideCountNew - 1) - slidePositions[slideCountNew - 1]; 4087 } 4088 if (result > 0) { result = 0; } 4089 4090 return result; 4091 } 4092 4093 function getContainerTransformValue (num) { 4094 if (num == null) { num = index; } 4095 4096 var val; 4097 if (horizontal && !autoWidth) { 4098 if (fixedWidth) { 4099 val = - (fixedWidth + gutter) * num; 4100 if (center) { val += getCenterGap(); } 4101 } else { 4102 var denominator = TRANSFORM ? slideCountNew : items; 4103 if (center) { num -= getCenterGap(); } 4104 val = - num * 100 / denominator; 4105 } 4106 } else { 4107 val = - slidePositions[num]; 4108 if (center && autoWidth) { 4109 val += getCenterGap(); 4110 } 4111 } 4112 4113 if (hasRightDeadZone) { val = Math.max(val, rightBoundary); } 4114 4115 val += (horizontal && !autoWidth && !fixedWidth) ? '%' : 'px'; 4116 4117 return val; 4118 } 4119 4120 function doContainerTransformSilent (val) { 4121 resetDuration(container, '0s'); 4122 doContainerTransform(val); 4123 } 4124 4125 function doContainerTransform (val) { 4126 if (val == null) { val = getContainerTransformValue(); } 4127 container.style[transformAttr] = transformPrefix + val + transformPostfix; 4128 } 4129 4130 function animateSlide (number, classOut, classIn, isOut) { 4131 var l = number + items; 4132 if (!loop) { l = Math.min(l, slideCountNew); } 4133 4134 for (var i = number; i < l; i++) { 4135 var item = slideItems[i]; 4136 4137 // set item positions 4138 if (!isOut) { item.style.left = (i - index) * 100 / items + '%'; } 4139 4140 if (animateDelay && TRANSITIONDELAY) { 4141 item.style[TRANSITIONDELAY] = item.style[ANIMATIONDELAY] = animateDelay * (i - number) / 1000 + 's'; 4142 } 4143 Object(_helpers_removeClass_js__WEBPACK_IMPORTED_MODULE_20__["removeClass"])(item, classOut); 4144 Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_19__["addClass"])(item, classIn); 4145 4146 if (isOut) { slideItemsOut.push(item); } 4147 } 4148 } 4149 4150 // make transfer after click/drag: 4151 // 1. change 'transform' property for mordern browsers 4152 // 2. change 'left' property for legacy browsers 4153 var transformCore = (function () { 4154 return carousel ? 4155 function () { 4156 resetDuration(container, ''); 4157 if (TRANSITIONDURATION || !speed) { 4158 // for morden browsers with non-zero duration or 4159 // zero duration for all browsers 4160 doContainerTransform(); 4161 // run fallback function manually 4162 // when duration is 0 / container is hidden 4163 if (!speed || !Object(_helpers_isVisible_js__WEBPACK_IMPORTED_MODULE_28__["isVisible"])(container)) { onTransitionEnd(); } 4164 4165 } else { 4166 // for old browser with non-zero duration 4167 Object(_helpers_jsTransform_js__WEBPACK_IMPORTED_MODULE_35__["jsTransform"])(container, transformAttr, transformPrefix, transformPostfix, getContainerTransformValue(), speed, onTransitionEnd); 4168 } 4169 4170 if (!horizontal) { updateContentWrapperHeight(); } 4171 } : 4172 function () { 4173 slideItemsOut = []; 4174 4175 var eve = {}; 4176 eve[TRANSITIONEND] = eve[ANIMATIONEND] = onTransitionEnd; 4177 Object(_helpers_removeEvents_js__WEBPACK_IMPORTED_MODULE_33__["removeEvents"])(slideItems[indexCached], eve); 4178 Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_32__["addEvents"])(slideItems[index], eve); 4179 4180 animateSlide(indexCached, animateIn, animateOut, true); 4181 animateSlide(index, animateNormal, animateIn); 4182 4183 // run fallback function manually 4184 // when transition or animation not supported / duration is 0 4185 if (!TRANSITIONEND || !ANIMATIONEND || !speed || !Object(_helpers_isVisible_js__WEBPACK_IMPORTED_MODULE_28__["isVisible"])(container)) { onTransitionEnd(); } 4186 }; 4187 })(); 4188 4189 function render (e, sliderMoved) { 4190 if (updateIndexBeforeTransform) { updateIndex(); } 4191 4192 // render when slider was moved (touch or drag) even though index may not change 4193 if (index !== indexCached || sliderMoved) { 4194 // events 4195 events.emit('indexChanged', info()); 4196 events.emit('transitionStart', info()); 4197 if (autoHeight) { doAutoHeight(); } 4198 4199 // pause autoplay when click or keydown from user 4200 if (animating && e && ['click', 'keydown'].indexOf(e.type) >= 0) { stopAutoplay(); } 4201 4202 running = true; 4203 transformCore(); 4204 } 4205 } 4206 4207 /* 4208 * Transfer prefixed properties to the same format 4209 * CSS: -Webkit-Transform => webkittransform 4210 * JS: WebkitTransform => webkittransform 4211 * @param {string} str - property 4212 * 4213 */ 4214 function strTrans (str) { 4215 return str.toLowerCase().replace(/-/g, ''); 4216 } 4217 4218 // AFTER TRANSFORM 4219 // Things need to be done after a transfer: 4220 // 1. check index 4221 // 2. add classes to visible slide 4222 // 3. disable controls buttons when reach the first/last slide in non-loop slider 4223 // 4. update nav status 4224 // 5. lazyload images 4225 // 6. update container height 4226 function onTransitionEnd (event) { 4227 // check running on gallery mode 4228 // make sure trantionend/animationend events run only once 4229 if (carousel || running) { 4230 events.emit('transitionEnd', info(event)); 4231 4232 if (!carousel && slideItemsOut.length > 0) { 4233 for (var i = 0; i < slideItemsOut.length; i++) { 4234 var item = slideItemsOut[i]; 4235 // set item positions 4236 item.style.left = ''; 4237 4238 if (ANIMATIONDELAY && TRANSITIONDELAY) { 4239 item.style[ANIMATIONDELAY] = ''; 4240 item.style[TRANSITIONDELAY] = ''; 4241 } 4242 Object(_helpers_removeClass_js__WEBPACK_IMPORTED_MODULE_20__["removeClass"])(item, animateOut); 4243 Object(_helpers_addClass_js__WEBPACK_IMPORTED_MODULE_19__["addClass"])(item, animateNormal); 4244 } 4245 } 4246 4247 /* update slides, nav, controls after checking ... 4248 * => legacy browsers who don't support 'event' 4249 * have to check event first, otherwise event.target will cause an error 4250 * => or 'gallery' mode: 4251 * + event target is slide item 4252 * => or 'carousel' mode: 4253 * + event target is container, 4254 * + event.property is the same with transform attribute 4255 */ 4256 if (!event || 4257 !carousel && event.target.parentNode === container || 4258 event.target === container && strTrans(event.propertyName) === strTrans(transformAttr)) { 4259 4260 if (!updateIndexBeforeTransform) { 4261 var indexTem = index; 4262 updateIndex(); 4263 if (index !== indexTem) { 4264 events.emit('indexChanged', info()); 4265 4266 doContainerTransformSilent(); 4267 } 4268 } 4269 4270 if (nested === 'inner') { events.emit('innerLoaded', info()); } 4271 running = false; 4272 indexCached = index; 4273 } 4274 } 4275 4276 } 4277 4278 // # ACTIONS 4279 function goTo (targetIndex, e) { 4280 if (freeze) { return; } 4281 4282 // prev slideBy 4283 if (targetIndex === 'prev') { 4284 onControlsClick(e, -1); 4285 4286 // next slideBy 4287 } else if (targetIndex === 'next') { 4288 onControlsClick(e, 1); 4289 4290 // go to exact slide 4291 } else { 4292 if (running) { 4293 if (preventActionWhenRunning) { return; } else { onTransitionEnd(); } 4294 } 4295 4296 var absIndex = getAbsIndex(), 4297 indexGap = 0; 4298 4299 if (targetIndex === 'first') { 4300 indexGap = - absIndex; 4301 } else if (targetIndex === 'last') { 4302 indexGap = carousel ? slideCount - items - absIndex : slideCount - 1 - absIndex; 4303 } else { 4304 if (typeof targetIndex !== 'number') { targetIndex = parseInt(targetIndex); } 4305 4306 if (!isNaN(targetIndex)) { 4307 // from directly called goTo function 4308 if (!e) { targetIndex = Math.max(0, Math.min(slideCount - 1, targetIndex)); } 4309 4310 indexGap = targetIndex - absIndex; 4311 } 4312 } 4313 4314 // gallery: make sure new page won't overlap with current page 4315 if (!carousel && indexGap && Math.abs(indexGap) < items) { 4316 var factor = indexGap > 0 ? 1 : -1; 4317 indexGap += (index + indexGap - slideCount) >= indexMin ? slideCount * factor : slideCount * 2 * factor * -1; 4318 } 4319 4320 index += indexGap; 4321 4322 // make sure index is in range 4323 if (carousel && loop) { 4324 if (index < indexMin) { index += slideCount; } 4325 if (index > indexMax) { index -= slideCount; } 4326 } 4327 4328 // if index is changed, start rendering 4329 if (getAbsIndex(index) !== getAbsIndex(indexCached)) { 4330 render(e); 4331 } 4332 4333 } 4334 } 4335 4336 // on controls click 4337 function onControlsClick (e, dir) { 4338 if (running) { 4339 if (preventActionWhenRunning) { return; } else { onTransitionEnd(); } 4340 } 4341 var passEventObject; 4342 4343 if (!dir) { 4344 e = getEvent(e); 4345 var target = getTarget(e); 4346 4347 while (target !== controlsContainer && [prevButton, nextButton].indexOf(target) < 0) { target = target.parentNode; } 4348 4349 var targetIn = [prevButton, nextButton].indexOf(target); 4350 if (targetIn >= 0) { 4351 passEventObject = true; 4352 dir = targetIn === 0 ? -1 : 1; 4353 } 4354 } 4355 4356 if (rewind) { 4357 if (index === indexMin && dir === -1) { 4358 goTo('last', e); 4359 return; 4360 } else if (index === indexMax && dir === 1) { 4361 goTo('first', e); 4362 return; 4363 } 4364 } 4365 4366 if (dir) { 4367 index += slideBy * dir; 4368 if (autoWidth) { index = Math.floor(index); } 4369 // pass e when click control buttons or keydown 4370 render((passEventObject || (e && e.type === 'keydown')) ? e : null); 4371 } 4372 } 4373 4374 // on nav click 4375 function onNavClick (e) { 4376 if (running) { 4377 if (preventActionWhenRunning) { return; } else { onTransitionEnd(); } 4378 } 4379 4380 e = getEvent(e); 4381 var target = getTarget(e), navIndex; 4382 4383 // find the clicked nav item 4384 while (target !== navContainer && !Object(_helpers_hasAttr_js__WEBPACK_IMPORTED_MODULE_21__["hasAttr"])(target, 'data-nav')) { target = target.parentNode; } 4385 if (Object(_helpers_hasAttr_js__WEBPACK_IMPORTED_MODULE_21__["hasAttr"])(target, 'data-nav')) { 4386 var navIndex = navClicked = Number(Object(_helpers_getAttr_js__WEBPACK_IMPORTED_MODULE_22__["getAttr"])(target, 'data-nav')), 4387 targetIndexBase = fixedWidth || autoWidth ? navIndex * slideCount / pages : navIndex * items, 4388 targetIndex = navAsThumbnails ? navIndex : Math.min(Math.ceil(targetIndexBase), slideCount - 1); 4389 goTo(targetIndex, e); 4390 4391 if (navCurrentIndex === navIndex) { 4392 if (animating) { stopAutoplay(); } 4393 navClicked = -1; // reset navClicked 4394 } 4395 } 4396 } 4397 4398 // autoplay functions 4399 function setAutoplayTimer () { 4400 autoplayTimer = setInterval(function () { 4401 onControlsClick(null, autoplayDirection); 4402 }, autoplayTimeout); 4403 4404 animating = true; 4405 } 4406 4407 function stopAutoplayTimer () { 4408 clearInterval(autoplayTimer); 4409 animating = false; 4410 } 4411 4412 function updateAutoplayButton (action, txt) { 4413 Object(_helpers_setAttrs_js__WEBPACK_IMPORTED_MODULE_23__["setAttrs"])(autoplayButton, {'data-action': action}); 4414 autoplayButton.innerHTML = autoplayHtmlStrings[0] + action + autoplayHtmlStrings[1] + txt; 4415 } 4416 4417 function startAutoplay () { 4418 setAutoplayTimer(); 4419 if (autoplayButton) { updateAutoplayButton('stop', autoplayText[1]); } 4420 } 4421 4422 function stopAutoplay () { 4423 stopAutoplayTimer(); 4424 if (autoplayButton) { updateAutoplayButton('start', autoplayText[0]); } 4425 } 4426 4427 // programaitcally play/pause the slider 4428 function play () { 4429 if (autoplay && !animating) { 4430 startAutoplay(); 4431 autoplayUserPaused = false; 4432 } 4433 } 4434 function pause () { 4435 if (animating) { 4436 stopAutoplay(); 4437 autoplayUserPaused = true; 4438 } 4439 } 4440 4441 function toggleAutoplay () { 4442 if (animating) { 4443 stopAutoplay(); 4444 autoplayUserPaused = true; 4445 } else { 4446 startAutoplay(); 4447 autoplayUserPaused = false; 4448 } 4449 } 4450 4451 function onVisibilityChange () { 4452 if (doc.hidden) { 4453 if (animating) { 4454 stopAutoplayTimer(); 4455 autoplayVisibilityPaused = true; 4456 } 4457 } else if (autoplayVisibilityPaused) { 4458 setAutoplayTimer(); 4459 autoplayVisibilityPaused = false; 4460 } 4461 } 4462 4463 function mouseoverPause () { 4464 if (animating) { 4465 stopAutoplayTimer(); 4466 autoplayHoverPaused = true; 4467 } 4468 } 4469 4470 function mouseoutRestart () { 4471 if (autoplayHoverPaused) { 4472 setAutoplayTimer(); 4473 autoplayHoverPaused = false; 4474 } 4475 } 4476 4477 // keydown events on document 4478 function onDocumentKeydown (e) { 4479 e = getEvent(e); 4480 var keyIndex = [KEYS.LEFT, KEYS.RIGHT].indexOf(e.keyCode); 4481 4482 if (keyIndex >= 0) { 4483 onControlsClick(e, keyIndex === 0 ? -1 : 1); 4484 } 4485 } 4486 4487 // on key control 4488 function onControlsKeydown (e) { 4489 e = getEvent(e); 4490 var keyIndex = [KEYS.LEFT, KEYS.RIGHT].indexOf(e.keyCode); 4491 4492 if (keyIndex >= 0) { 4493 if (keyIndex === 0) { 4494 if (!prevButton.disabled) { onControlsClick(e, -1); } 4495 } else if (!nextButton.disabled) { 4496 onControlsClick(e, 1); 4497 } 4498 } 4499 } 4500 4501 // set focus 4502 function setFocus (el) { 4503 el.focus(); 4504 } 4505 4506 // on key nav 4507 function onNavKeydown (e) { 4508 e = getEvent(e); 4509 var curElement = doc.activeElement; 4510 if (!Object(_helpers_hasAttr_js__WEBPACK_IMPORTED_MODULE_21__["hasAttr"])(curElement, 'data-nav')) { return; } 4511 4512 // var code = e.keyCode, 4513 var keyIndex = [KEYS.LEFT, KEYS.RIGHT, KEYS.ENTER, KEYS.SPACE].indexOf(e.keyCode), 4514 navIndex = Number(Object(_helpers_getAttr_js__WEBPACK_IMPORTED_MODULE_22__["getAttr"])(curElement, 'data-nav')); 4515 4516 if (keyIndex >= 0) { 4517 if (keyIndex === 0) { 4518 if (navIndex > 0) { setFocus(navItems[navIndex - 1]); } 4519 } else if (keyIndex === 1) { 4520 if (navIndex < pages - 1) { setFocus(navItems[navIndex + 1]); } 4521 } else { 4522 navClicked = navIndex; 4523 goTo(navIndex, e); 4524 } 4525 } 4526 } 4527 4528 function getEvent (e) { 4529 e = e || win.event; 4530 return isTouchEvent(e) ? e.changedTouches[0] : e; 4531 } 4532 function getTarget (e) { 4533 return e.target || win.event.srcElement; 4534 } 4535 4536 function isTouchEvent (e) { 4537 return e.type.indexOf('touch') >= 0; 4538 } 4539 4540 function preventDefaultBehavior (e) { 4541 e.preventDefault ? e.preventDefault() : e.returnValue = false; 4542 } 4543 4544 function getMoveDirectionExpected () { 4545 return Object(_helpers_getTouchDirection_js__WEBPACK_IMPORTED_MODULE_16__["getTouchDirection"])(Object(_helpers_toDegree_js__WEBPACK_IMPORTED_MODULE_15__["toDegree"])(lastPosition.y - initPosition.y, lastPosition.x - initPosition.x), swipeAngle) === options.axis; 4546 } 4547 4548 function onPanStart (e) { 4549 if (running) { 4550 if (preventActionWhenRunning) { return; } else { onTransitionEnd(); } 4551 } 4552 4553 if (autoplay && animating) { stopAutoplayTimer(); } 4554 4555 panStart = true; 4556 if (rafIndex) { 4557 Object(_helpers_caf_js__WEBPACK_IMPORTED_MODULE_3__["caf"])(rafIndex); 4558 rafIndex = null; 4559 } 4560 4561 var $ = getEvent(e); 4562 events.emit(isTouchEvent(e) ? 'touchStart' : 'dragStart', info(e)); 4563 4564 if (!isTouchEvent(e) && ['img', 'a'].indexOf(getLowerCaseNodeName(getTarget(e))) >= 0) { 4565 preventDefaultBehavior(e); 4566 } 4567 4568 lastPosition.x = initPosition.x = $.clientX; 4569 lastPosition.y = initPosition.y = $.clientY; 4570 if (carousel) { 4571 translateInit = parseFloat(container.style[transformAttr].replace(transformPrefix, '')); 4572 resetDuration(container, '0s'); 4573 } 4574 } 4575 4576 function onPanMove (e) { 4577 if (panStart) { 4578 var $ = getEvent(e); 4579 lastPosition.x = $.clientX; 4580 lastPosition.y = $.clientY; 4581 4582 if (carousel) { 4583 if (!rafIndex) { rafIndex = Object(_helpers_raf_js__WEBPACK_IMPORTED_MODULE_2__["raf"])(function(){ panUpdate(e); }); } 4584 } else { 4585 if (moveDirectionExpected === '?') { moveDirectionExpected = getMoveDirectionExpected(); } 4586 if (moveDirectionExpected) { preventScroll = true; } 4587 } 4588 4589 if (preventScroll) { e.preventDefault(); } 4590 } 4591 } 4592 4593 function panUpdate (e) { 4594 if (!moveDirectionExpected) { 4595 panStart = false; 4596 return; 4597 } 4598 Object(_helpers_caf_js__WEBPACK_IMPORTED_MODULE_3__["caf"])(rafIndex); 4599 if (panStart) { rafIndex = Object(_helpers_raf_js__WEBPACK_IMPORTED_MODULE_2__["raf"])(function(){ panUpdate(e); }); } 4600 4601 if (moveDirectionExpected === '?') { moveDirectionExpected = getMoveDirectionExpected(); } 4602 if (moveDirectionExpected) { 4603 if (!preventScroll && isTouchEvent(e)) { preventScroll = true; } 4604 4605 try { 4606 if (e.type) { events.emit(isTouchEvent(e) ? 'touchMove' : 'dragMove', info(e)); } 4607 } catch(err) {} 4608 4609 var x = translateInit, 4610 dist = getDist(lastPosition, initPosition); 4611 if (!horizontal || fixedWidth || autoWidth) { 4612 x += dist; 4613 x += 'px'; 4614 } else { 4615 var percentageX = TRANSFORM ? dist * items * 100 / ((viewport + gutter) * slideCountNew): dist * 100 / (viewport + gutter); 4616 x += percentageX; 4617 x += '%'; 4618 } 4619 4620 container.style[transformAttr] = transformPrefix + x + transformPostfix; 4621 } 4622 } 4623 4624 function onPanEnd (e) { 4625 if (panStart) { 4626 if (rafIndex) { 4627 Object(_helpers_caf_js__WEBPACK_IMPORTED_MODULE_3__["caf"])(rafIndex); 4628 rafIndex = null; 4629 } 4630 if (carousel) { resetDuration(container, ''); } 4631 panStart = false; 4632 4633 var $ = getEvent(e); 4634 lastPosition.x = $.clientX; 4635 lastPosition.y = $.clientY; 4636 var dist = getDist(lastPosition, initPosition); 4637 4638 if (Math.abs(dist)) { 4639 // drag vs click 4640 if (!isTouchEvent(e)) { 4641 // prevent "click" 4642 var target = getTarget(e); 4643 Object(_helpers_addEvents_js__WEBPACK_IMPORTED_MODULE_32__["addEvents"])(target, {'click': function preventClick (e) { 4644 preventDefaultBehavior(e); 4645 Object(_helpers_removeEvents_js__WEBPACK_IMPORTED_MODULE_33__["removeEvents"])(target, {'click': preventClick}); 4646 }}); 4647 } 4648 4649 if (carousel) { 4650 rafIndex = Object(_helpers_raf_js__WEBPACK_IMPORTED_MODULE_2__["raf"])(function() { 4651 if (horizontal && !autoWidth) { 4652 var indexMoved = - dist * items / (viewport + gutter); 4653 indexMoved = dist > 0 ? Math.floor(indexMoved) : Math.ceil(indexMoved); 4654 index += indexMoved; 4655 } else { 4656 var moved = - (translateInit + dist); 4657 if (moved <= 0) { 4658 index = indexMin; 4659 } else if (moved >= slidePositions[slideCountNew - 1]) { 4660 index = indexMax; 4661 } else { 4662 var i = 0; 4663 while (i < slideCountNew && moved >= slidePositions[i]) { 4664 index = i; 4665 if (moved > slidePositions[i] && dist < 0) { index += 1; } 4666 i++; 4667 } 4668 } 4669 } 4670 4671 render(e, dist); 4672 events.emit(isTouchEvent(e) ? 'touchEnd' : 'dragEnd', info(e)); 4673 }); 4674 } else { 4675 if (moveDirectionExpected) { 4676 onControlsClick(e, dist > 0 ? -1 : 1); 4677 } 4678 } 4679 } 4680 } 4681 4682 // reset 4683 if (options.preventScrollOnTouch === 'auto') { preventScroll = false; } 4684 if (swipeAngle) { moveDirectionExpected = '?'; } 4685 if (autoplay && !animating) { setAutoplayTimer(); } 4686 } 4687 4688 // === RESIZE FUNCTIONS === // 4689 // (slidePositions, index, items) => vertical_conentWrapper.height 4690 function updateContentWrapperHeight () { 4691 var wp = middleWrapper ? middleWrapper : innerWrapper; 4692 wp.style.height = slidePositions[index + items] - slidePositions[index] + 'px'; 4693 } 4694 4695 function getPages () { 4696 var rough = fixedWidth ? (fixedWidth + gutter) * slideCount / viewport : slideCount / items; 4697 return Math.min(Math.ceil(rough), slideCount); 4698 } 4699 4700 /* 4701 * 1. update visible nav items list 4702 * 2. add "hidden" attributes to previous visible nav items 4703 * 3. remove "hidden" attrubutes to new visible nav items 4704 */ 4705 function updateNavVisibility () { 4706 if (!nav || navAsThumbnails) { return; } 4707 4708 if (pages !== pagesCached) { 4709 var min = pagesCached, 4710 max = pages, 4711 fn = _helpers_showElement_js__WEBPACK_IMPORTED_MODULE_27__["showElement"]; 4712 4713 if (pagesCached > pages) { 4714 min = pages; 4715 max = pagesCached; 4716 fn = _helpers_hideElement_js__WEBPACK_IMPORTED_MODULE_26__["hideElement"]; 4717 } 4718 4719 while (min < max) { 4720 fn(navItems[min]); 4721 min++; 4722 } 4723 4724 // cache pages 4725 pagesCached = pages; 4726 } 4727 } 4728 4729 function info (e) { 4730 return { 4731 container: container, 4732 slideItems: slideItems, 4733 navContainer: navContainer, 4734 navItems: navItems, 4735 controlsContainer: controlsContainer, 4736 hasControls: hasControls, 4737 prevButton: prevButton, 4738 nextButton: nextButton, 4739 items: items, 4740 slideBy: slideBy, 4741 cloneCount: cloneCount, 4742 slideCount: slideCount, 4743 slideCountNew: slideCountNew, 4744 index: index, 4745 indexCached: indexCached, 4746 displayIndex: getCurrentSlide(), 4747 navCurrentIndex: navCurrentIndex, 4748 navCurrentIndexCached: navCurrentIndexCached, 4749 pages: pages, 4750 pagesCached: pagesCached, 4751 sheet: sheet, 4752 isOn: isOn, 4753 event: e || {}, 4754 }; 4755 } 4756 4757 return { 4758 version: '2.9.2', 4759 getInfo: info, 4760 events: events, 4761 goTo: goTo, 4762 play: play, 4763 pause: pause, 4764 isOn: isOn, 4765 updateSliderHeight: updateInnerWrapperHeight, 4766 refresh: initSliderTransform, 4767 destroy: destroy, 4768 rebuild: function() { 4769 return tns(Object(_helpers_extend_js__WEBPACK_IMPORTED_MODULE_4__["extend"])(options, optionsElements)); 4770 } 4771 }; 4772}; 4773 4774 4775/***/ })
4775 4776 4777}]); 4778//# sourceMappingURL=/wp-content/themes/global/Dist/Inline/Sm/vendor.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.