/*! * UAParser.js v0.7.21 * Lightweight JavaScript-based User-Agent string parser * https://github.com/faisalman/ua-parser-js * * Copyright 漏 2012-2019 Faisal Salman * Licensed under MIT License */ (function(window,undefined){"use strict";var LIBVERSION="0.7.21",EMPTY="",UNKNOWN="?",FUNC_TYPE="function",UNDEF_TYPE="undefined",OBJ_TYPE="object",STR_TYPE="string",MAJOR="major",MODEL="model",NAME="name",TYPE="type",VENDOR="vendor",VERSION="version",ARCHITECTURE="architecture",CONSOLE="console",MOBILE="mobile",TABLET="tablet",SMARTTV="smarttv",WEARABLE="wearable",EMBEDDED="embedded";var util={extend:function(regexes,extensions){var mergedRegexes={};for(var i in regexes){if(extensions[i]&&extensions[i].length%2===0){mergedRegexes[i]=extensions[i].concat(regexes[i])}else{mergedRegexes[i]=regexes[i]}}return mergedRegexes},has:function(str1,str2){if(typeof str1==="string"){return str2.toLowerCase().indexOf(str1.toLowerCase())!==-1}else{return false}},lowerize:function(str){return str.toLowerCase()},major:function(version){return typeof version===STR_TYPE?version.replace(/[^\d\.]/g,"").split(".")[0]:undefined},trim:function(str){return str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}};var mapper={rgx:function(ua,arrays){var i=0,j,k,p,q,matches,match;while(i0){if(q.length==2){if(typeof q[1]==FUNC_TYPE){this[q[0]]=q[1].call(this,match)}else{this[q[0]]=q[1]}}else if(q.length==3){if(typeof q[1]===FUNC_TYPE&&!(q[1].exec&&q[1].test)){this[q[0]]=match?q[1].call(this,match,q[2]):undefined}else{this[q[0]]=match?match.replace(q[1],q[2]):undefined}}else if(q.length==4){this[q[0]]=match?q[3].call(this,match.replace(q[1],q[2])):undefined}}else{this[q]=match?match:undefined}}}}i+=2}},str:function(str,map){for(var i in map){if(typeof map[i]===OBJ_TYPE&&map[i].length>0){for(var j=0;jn.clientWidth||"contain"===e&&t.clientWidthn)&&(f=n,d(g,n)&&(f/=40)),d(g,n)&&(j/=40,l/=40,m/=40),j=Math[j>=1?"floor":"ceil"](j/f),l=Math[l>=1?"floor":"ceil"](l/f),m=Math[m>=1?"floor":"ceil"](m/f),k.settings.normalizeOffset&&this.getBoundingClientRect){var s=this.getBoundingClientRect();o=b.clientX-s.left,p=b.clientY-s.top}return b.deltaX=l,b.deltaY=m,b.deltaFactor=f,b.offsetX=o,b.offsetY=p,b.deltaMode=0,h.unshift(b,j,l,m),e&&clearTimeout(e),e=setTimeout(c,200),(a.event.dispatch||a.event.handle).apply(this,h)}}function c(){f=null}function d(a,b){return k.settings.adjustOldDeltas&&"mousewheel"===a.type&&b%120===0}var e,f,g=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],h="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],i=Array.prototype.slice;if(a.event.fixHooks)for(var j=g.length;j;)a.event.fixHooks[g[--j]]=a.event.mouseHooks;var k=a.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var c=h.length;c;)this.addEventListener(h[--c],b,!1);else this.onmousewheel=b;a.data(this,"mousewheel-line-height",k.getLineHeight(this)),a.data(this,"mousewheel-page-height",k.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var c=h.length;c;)this.removeEventListener(h[--c],b,!1);else this.onmousewheel=null;a.removeData(this,"mousewheel-line-height"),a.removeData(this,"mousewheel-page-height")},getLineHeight:function(b){var c=a(b),d=c["offsetParent"in a.fn?"offsetParent":"parent"]();return d.length||(d=a("body")),parseInt(d.css("fontSize"),10)||parseInt(c.css("fontSize"),10)||16},getPageHeight:function(b){return a(b).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};a.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})}); /* * jQuery throttle / debounce - v1.1 - 3/7/2010 * http://benalman.com/projects/jquery-throttle-debounce-plugin/ * * Copyright (c) 2010 "Cowboy" Ben Alman * Dual licensed under the MIT and GPL licenses. * http://benalman.com/about/license/ */ (function(b,c){var $=b.jQuery||b.Cowboy||(b.Cowboy={}),a;$.throttle=a=function(e,f,j,i){var h,d=0;if(typeof f!=="boolean"){i=j;j=f;f=c}function g(){var o=this,m=+new Date()-d,n=arguments;function l(){d=+new Date();j.apply(o,n)}function k(){h=c}if(i&&!h){l()}h&&clearTimeout(h);if(i===c&&m>e){l()}else{if(f!==true){h=setTimeout(i?k:l,i===c?e-m:e)}}}if($.guid){g.guid=j.guid=j.guid||$.guid++}return g};$.debounce=function(d,e,f){return f===c?a(d,e,false):a(d,f,e!==false)}})(this); /* * jQuery carouFredSel 6.2.1 * Demo's and documentation: * caroufredsel.dev7studios.com * * Copyright (c) 2013 Fred Heusschen * www.frebsite.nl * * Dual licensed under the MIT and GPL licenses. * http://en.wikipedia.org/wiki/MIT_License * http://en.wikipedia.org/wiki/GNU_General_Public_License */ (function($) { // LOCAL if ( $.fn.carouFredSel ) { return; } $.fn.caroufredsel = $.fn.carouFredSel = function(options, configs) { // no element if (this.length == 0) { debug( true, 'No element found for "' + this.selector + '".' ); return this; } // multiple elements if (this.length > 1) { return this.each(function() { $(this).carouFredSel(options, configs); }); } var $cfs = this, $tt0 = this[0], starting_position = false; if ($cfs.data('_cfs_isCarousel')) { starting_position = $cfs.triggerHandler('_cfs_triggerEvent', 'currentPosition'); $cfs.trigger('_cfs_triggerEvent', ['destroy', true]); } var FN = {}; FN._init = function(o, setOrig, start) { o = go_getObject($tt0, o); o.items = go_getItemsObject($tt0, o.items); o.scroll = go_getScrollObject($tt0, o.scroll); o.auto = go_getAutoObject($tt0, o.auto); o.prev = go_getPrevNextObject($tt0, o.prev); o.next = go_getPrevNextObject($tt0, o.next); o.pagination = go_getPaginationObject($tt0, o.pagination); o.swipe = go_getSwipeObject($tt0, o.swipe); o.mousewheel = go_getMousewheelObject($tt0, o.mousewheel); if (setOrig) { opts_orig = $.extend(true, {}, $.fn.carouFredSel.defaults, o); } opts = $.extend(true, {}, $.fn.carouFredSel.defaults, o); opts.d = cf_getDimensions(opts); crsl.direction = (opts.direction == 'up' || opts.direction == 'left') ? 'next' : 'prev'; var a_itm = $cfs.children(), avail_primary = ms_getParentSize($wrp, opts, 'width'); if (is_true(opts.cookie)) { opts.cookie = 'caroufredsel_cookie_' + conf.serialNumber; } opts.maxDimension = ms_getMaxDimension(opts, avail_primary); // complement items and sizes opts.items = in_complementItems(opts.items, opts, a_itm, start); opts[opts.d['width']] = in_complementPrimarySize(opts[opts.d['width']], opts, a_itm); opts[opts.d['height']] = in_complementSecondarySize(opts[opts.d['height']], opts, a_itm); // primary size not set for a responsive carousel if (opts.responsive) { if (!is_percentage(opts[opts.d['width']])) { opts[opts.d['width']] = '100%'; } } // primary size is percentage if (is_percentage(opts[opts.d['width']])) { crsl.upDateOnWindowResize = true; crsl.primarySizePercentage = opts[opts.d['width']]; opts[opts.d['width']] = ms_getPercentage(avail_primary, crsl.primarySizePercentage); if (!opts.items.visible) { opts.items.visibleConf.variable = true; } } if (opts.responsive) { opts.usePadding = false; opts.padding = [0, 0, 0, 0]; opts.align = false; opts.items.visibleConf.variable = false; } else { // visible-items not set if (!opts.items.visible) { opts = in_complementVisibleItems(opts, avail_primary); } // primary size not set -> calculate it or set to "variable" if (!opts[opts.d['width']]) { if (!opts.items.visibleConf.variable && is_number(opts.items[opts.d['width']]) && opts.items.filter == '*') { opts[opts.d['width']] = opts.items.visible * opts.items[opts.d['width']]; opts.align = false; } else { opts[opts.d['width']] = 'variable'; } } // align not set -> set to center if primary size is number if (is_undefined(opts.align)) { opts.align = (is_number(opts[opts.d['width']])) ? 'center' : false; } // set variabe visible-items if (opts.items.visibleConf.variable) { opts.items.visible = gn_getVisibleItemsNext(a_itm, opts, 0); } } // set visible items by filter if (opts.items.filter != '*' && !opts.items.visibleConf.variable) { opts.items.visibleConf.org = opts.items.visible; opts.items.visible = gn_getVisibleItemsNextFilter(a_itm, opts, 0); } opts.items.visible = cf_getItemsAdjust(opts.items.visible, opts, opts.items.visibleConf.adjust, $tt0); opts.items.visibleConf.old = opts.items.visible; if (opts.responsive) { if (!opts.items.visibleConf.min) { opts.items.visibleConf.min = opts.items.visible; } if (!opts.items.visibleConf.max) { opts.items.visibleConf.max = opts.items.visible; } opts = in_getResponsiveValues(opts, a_itm, avail_primary); } else { opts.padding = cf_getPadding(opts.padding); if (opts.align == 'top') { opts.align = 'left'; } else if (opts.align == 'bottom') { opts.align = 'right'; } switch (opts.align) { // align: center, left or right case 'center': case 'left': case 'right': if (opts[opts.d['width']] != 'variable') { opts = in_getAlignPadding(opts, a_itm); opts.usePadding = true; } break; // padding default: opts.align = false; opts.usePadding = ( opts.padding[0] == 0 && opts.padding[1] == 0 && opts.padding[2] == 0 && opts.padding[3] == 0 ) ? false : true; break; } } if (!is_number(opts.scroll.duration)) { opts.scroll.duration = 500; } if (is_undefined(opts.scroll.items)) { opts.scroll.items = (opts.responsive || opts.items.visibleConf.variable || opts.items.filter != '*') ? 'visible' : opts.items.visible; } opts.auto = $.extend(true, {}, opts.scroll, opts.auto); opts.prev = $.extend(true, {}, opts.scroll, opts.prev); opts.next = $.extend(true, {}, opts.scroll, opts.next); opts.pagination = $.extend(true, {}, opts.scroll, opts.pagination); // swipe and mousewheel extend later on, per direction opts.auto = go_complementAutoObject($tt0, opts.auto); opts.prev = go_complementPrevNextObject($tt0, opts.prev); opts.next = go_complementPrevNextObject($tt0, opts.next); opts.pagination = go_complementPaginationObject($tt0, opts.pagination); opts.swipe = go_complementSwipeObject($tt0, opts.swipe); opts.mousewheel = go_complementMousewheelObject($tt0, opts.mousewheel); if (opts.synchronise) { opts.synchronise = cf_getSynchArr(opts.synchronise); } // DEPRECATED if (opts.auto.onPauseStart) { opts.auto.onTimeoutStart = opts.auto.onPauseStart; deprecated('auto.onPauseStart', 'auto.onTimeoutStart'); } if (opts.auto.onPausePause) { opts.auto.onTimeoutPause = opts.auto.onPausePause; deprecated('auto.onPausePause', 'auto.onTimeoutPause'); } if (opts.auto.onPauseEnd) { opts.auto.onTimeoutEnd = opts.auto.onPauseEnd; deprecated('auto.onPauseEnd', 'auto.onTimeoutEnd'); } if (opts.auto.pauseDuration) { opts.auto.timeoutDuration = opts.auto.pauseDuration; deprecated('auto.pauseDuration', 'auto.timeoutDuration'); } // /DEPRECATED }; // /init FN._build = function() { $cfs.data('_cfs_isCarousel', true); var a_itm = $cfs.children(), orgCSS = in_mapCss($cfs, ['textAlign', 'float', 'position', 'top', 'right', 'bottom', 'left', 'zIndex', 'width', 'height', 'marginTop', 'marginRight', 'marginBottom', 'marginLeft']), newPosition = 'relative'; switch (orgCSS.position) { case 'absolute': case 'fixed': newPosition = orgCSS.position; break; } if (conf.wrapper == 'parent') { sz_storeOrigCss($wrp); } else { $wrp.css(orgCSS); } $wrp.css({ 'overflow' : 'hidden', 'position' : newPosition }); sz_storeOrigCss($cfs); $cfs.data('_cfs_origCssZindex', orgCSS.zIndex); $cfs.css({ 'textAlign' : 'left', 'float' : 'none', 'position' : 'absolute', 'top' : 0, 'right' : 'auto', 'bottom' : 'auto', 'left' : 0, 'marginTop' : 0, 'marginRight' : 0, 'marginBottom' : 0, 'marginLeft' : 0 }); sz_storeMargin(a_itm, opts); sz_storeOrigCss(a_itm); if (opts.responsive) { sz_setResponsiveSizes(opts, a_itm); } }; // /build FN._bind_events = function() { FN._unbind_events(); // stop event $cfs.bind(cf_e('stop', conf), function(e, imm) { e.stopPropagation(); // button if (!crsl.isStopped) { if (opts.auto.button) { opts.auto.button.addClass(cf_c('stopped', conf)); } } // set stopped crsl.isStopped = true; if (opts.auto.play) { opts.auto.play = false; $cfs.trigger(cf_e('pause', conf), imm); } return true; }); // finish event $cfs.bind(cf_e('finish', conf), function(e) { e.stopPropagation(); if (crsl.isScrolling) { sc_stopScroll(scrl); } return true; }); // pause event $cfs.bind(cf_e('pause', conf), function(e, imm, res) { e.stopPropagation(); tmrs = sc_clearTimers(tmrs); // immediately pause if (imm && crsl.isScrolling) { scrl.isStopped = true; var nst = getTime() - scrl.startTime; scrl.duration -= nst; if (scrl.pre) { scrl.pre.duration -= nst; } if (scrl.post) { scrl.post.duration -= nst; } sc_stopScroll(scrl, false); } // update remaining pause-time if (!crsl.isPaused && !crsl.isScrolling) { if (res) { tmrs.timePassed += getTime() - tmrs.startTime; } } // button if (!crsl.isPaused) { if (opts.auto.button) { opts.auto.button.addClass(cf_c('paused', conf)); } } // set paused crsl.isPaused = true; // pause pause callback if (opts.auto.onTimeoutPause) { var dur1 = opts.auto.timeoutDuration - tmrs.timePassed, perc = 100 - Math.ceil( dur1 * 100 / opts.auto.timeoutDuration ); opts.auto.onTimeoutPause.call($tt0, perc, dur1); } return true; }); // play event $cfs.bind(cf_e('play', conf), function(e, dir, del, res) { e.stopPropagation(); tmrs = sc_clearTimers(tmrs); // sort params var v = [dir, del, res], t = ['string', 'number', 'boolean'], a = cf_sortParams(v, t); dir = a[0]; del = a[1]; res = a[2]; if (dir != 'prev' && dir != 'next') { dir = crsl.direction; } if (!is_number(del)) { del = 0; } if (!is_boolean(res)) { res = false; } // stopped? if (res) { crsl.isStopped = false; opts.auto.play = true; } if (!opts.auto.play) { e.stopImmediatePropagation(); return debug(conf, 'Carousel stopped: Not scrolling.'); } // button if (crsl.isPaused) { if (opts.auto.button) { opts.auto.button.removeClass(cf_c('stopped', conf)); opts.auto.button.removeClass(cf_c('paused', conf)); } } // set playing crsl.isPaused = false; tmrs.startTime = getTime(); // timeout the scrolling var dur1 = opts.auto.timeoutDuration + del; dur2 = dur1 - tmrs.timePassed; perc = 100 - Math.ceil(dur2 * 100 / dur1); if (opts.auto.progress) { tmrs.progress = setInterval(function() { var pasd = getTime() - tmrs.startTime + tmrs.timePassed, perc = Math.ceil(pasd * 100 / dur1); opts.auto.progress.updater.call(opts.auto.progress.bar[0], perc); }, opts.auto.progress.interval); } tmrs.auto = setTimeout(function() { if (opts.auto.progress) { opts.auto.progress.updater.call(opts.auto.progress.bar[0], 100); } if (opts.auto.onTimeoutEnd) { opts.auto.onTimeoutEnd.call($tt0, perc, dur2); } if (crsl.isScrolling) { $cfs.trigger(cf_e('play', conf), dir); } else { $cfs.trigger(cf_e(dir, conf), opts.auto); } }, dur2); // pause start callback if (opts.auto.onTimeoutStart) { opts.auto.onTimeoutStart.call($tt0, perc, dur2); } return true; }); // resume event $cfs.bind(cf_e('resume', conf), function(e) { e.stopPropagation(); if (scrl.isStopped) { scrl.isStopped = false; crsl.isPaused = false; crsl.isScrolling = true; scrl.startTime = getTime(); sc_startScroll(scrl, conf); } else { $cfs.trigger(cf_e('play', conf)); } return true; }); // prev + next events $cfs.bind(cf_e('prev', conf)+' '+cf_e('next', conf), function(e, obj, num, clb, que) { e.stopPropagation(); // stopped or hidden carousel, don't scroll, don't queue if (crsl.isStopped || $cfs.is(':hidden')) { e.stopImmediatePropagation(); return debug(conf, 'Carousel stopped or hidden: Not scrolling.'); } // not enough items var minimum = (is_number(opts.items.minimum)) ? opts.items.minimum : opts.items.visible + 1; if (minimum > itms.total) { e.stopImmediatePropagation(); return debug(conf, 'Not enough items ('+itms.total+' total, '+minimum+' needed): Not scrolling.'); } // get config var v = [obj, num, clb, que], t = ['object', 'number/string', 'function', 'boolean'], a = cf_sortParams(v, t); obj = a[0]; num = a[1]; clb = a[2]; que = a[3]; var eType = e.type.slice(conf.events.prefix.length); if (!is_object(obj)) { obj = {}; } if (is_function(clb)) { obj.onAfter = clb; } if (is_boolean(que)) { obj.queue = que; } obj = $.extend(true, {}, opts[eType], obj); // test conditions callback if (obj.conditions && !obj.conditions.call($tt0, eType)) { e.stopImmediatePropagation(); return debug(conf, 'Callback "conditions" returned false.'); } if (!is_number(num)) { if (opts.items.filter != '*') { num = 'visible'; } else { var arr = [num, obj.items, opts[eType].items]; for (var a = 0, l = arr.length; a < l; a++) { if (is_number(arr[a]) || arr[a] == 'page' || arr[a] == 'visible') { num = arr[a]; break; } } } switch(num) { case 'page': e.stopImmediatePropagation(); return $cfs.triggerHandler(cf_e(eType+'Page', conf), [obj, clb]); break; case 'visible': if (!opts.items.visibleConf.variable && opts.items.filter == '*') { num = opts.items.visible; } break; } } // resume animation, add current to queue if (scrl.isStopped) { $cfs.trigger(cf_e('resume', conf)); $cfs.trigger(cf_e('queue', conf), [eType, [obj, num, clb]]); e.stopImmediatePropagation(); return debug(conf, 'Carousel resumed scrolling.'); } // queue if scrolling if (obj.duration > 0) { if (crsl.isScrolling) { if (obj.queue) { if (obj.queue == 'last') { queu = []; } if (obj.queue != 'first' || queu.length == 0) { $cfs.trigger(cf_e('queue', conf), [eType, [obj, num, clb]]); } } e.stopImmediatePropagation(); return debug(conf, 'Carousel currently scrolling.'); } } tmrs.timePassed = 0; $cfs.trigger(cf_e('slide_'+eType, conf), [obj, num]); // synchronise if (opts.synchronise) { var s = opts.synchronise, c = [obj, num]; for (var j = 0, l = s.length; j < l; j++) { var d = eType; if (!s[j][2]) { d = (d == 'prev') ? 'next' : 'prev'; } if (!s[j][1]) { c[0] = s[j][0].triggerHandler('_cfs_triggerEvent', ['configuration', d]); } c[1] = num + s[j][3]; s[j][0].trigger('_cfs_triggerEvent', ['slide_'+d, c]); } } return true; }); // prev event $cfs.bind(cf_e('slide_prev', conf), function(e, sO, nI) { e.stopPropagation(); var a_itm = $cfs.children(); // non-circular at start, scroll to end if (!opts.circular) { if (itms.first == 0) { if (opts.infinite) { $cfs.trigger(cf_e('next', conf), itms.total-1); } return e.stopImmediatePropagation(); } } sz_resetMargin(a_itm, opts); // find number of items to scroll if (!is_number(nI)) { if (opts.items.visibleConf.variable) { nI = gn_getVisibleItemsPrev(a_itm, opts, itms.total-1); } else if (opts.items.filter != '*') { var xI = (is_number(sO.items)) ? sO.items : gn_getVisibleOrg($cfs, opts); nI = gn_getScrollItemsPrevFilter(a_itm, opts, itms.total-1, xI); } else { nI = opts.items.visible; } nI = cf_getAdjust(nI, opts, sO.items, $tt0); } // prevent non-circular from scrolling to far if (!opts.circular) { if (itms.total - nI < itms.first) { nI = itms.total - itms.first; } } // set new number of visible items opts.items.visibleConf.old = opts.items.visible; if (opts.items.visibleConf.variable) { var vI = cf_getItemsAdjust(gn_getVisibleItemsNext(a_itm, opts, itms.total-nI), opts, opts.items.visibleConf.adjust, $tt0); if (opts.items.visible+nI <= vI && nI < itms.total) { nI++; vI = cf_getItemsAdjust(gn_getVisibleItemsNext(a_itm, opts, itms.total-nI), opts, opts.items.visibleConf.adjust, $tt0); } opts.items.visible = vI; } else if (opts.items.filter != '*') { var vI = gn_getVisibleItemsNextFilter(a_itm, opts, itms.total-nI); opts.items.visible = cf_getItemsAdjust(vI, opts, opts.items.visibleConf.adjust, $tt0); } sz_resetMargin(a_itm, opts, true); // scroll 0, don't scroll if (nI == 0) { e.stopImmediatePropagation(); return debug(conf, '0 items to scroll: Not scrolling.'); } debug(conf, 'Scrolling '+nI+' items backward.'); // save new config itms.first += nI; while (itms.first >= itms.total) { itms.first -= itms.total; } // non-circular callback if (!opts.circular) { if (itms.first == 0 && sO.onEnd) { sO.onEnd.call($tt0, 'prev'); } if (!opts.infinite) { nv_enableNavi(opts, itms.first, conf); } } // rearrange items $cfs.children().slice(itms.total-nI, itms.total).prependTo($cfs); if (itms.total < opts.items.visible + nI) { $cfs.children().slice(0, (opts.items.visible+nI)-itms.total).clone(true).appendTo($cfs); } // the needed items var a_itm = $cfs.children(), i_old = gi_getOldItemsPrev(a_itm, opts, nI), i_new = gi_getNewItemsPrev(a_itm, opts), i_cur_l = a_itm.eq(nI-1), i_old_l = i_old.last(), i_new_l = i_new.last(); sz_resetMargin(a_itm, opts); var pL = 0, pR = 0; if (opts.align) { var p = cf_getAlignPadding(i_new, opts); pL = p[0]; pR = p[1]; } var oL = (pL < 0) ? opts.padding[opts.d[3]] : 0; // hide items for fx directscroll var hiddenitems = false, i_skp = $(); if (opts.items.visible < nI) { i_skp = a_itm.slice(opts.items.visibleConf.old, nI); if (sO.fx == 'directscroll') { var orgW = opts.items[opts.d['width']]; hiddenitems = i_skp; i_cur_l = i_new_l; sc_hideHiddenItems(hiddenitems); opts.items[opts.d['width']] = 'variable'; } } // save new sizes var $cf2 = false, i_siz = ms_getTotalSize(a_itm.slice(0, nI), opts, 'width'), w_siz = cf_mapWrapperSizes(ms_getSizes(i_new, opts, true), opts, !opts.usePadding), i_siz_vis = 0, a_cfs = {}, a_wsz = {}, a_cur = {}, a_old = {}, a_new = {}, a_lef = {}, a_lef_vis = {}, a_dur = sc_getDuration(sO, opts, nI, i_siz); switch(sO.fx) { case 'cover': case 'cover-fade': i_siz_vis = ms_getTotalSize(a_itm.slice(0, opts.items.visible), opts, 'width'); break; } if (hiddenitems) { opts.items[opts.d['width']] = orgW; } sz_resetMargin(a_itm, opts, true); if (pR >= 0) { sz_resetMargin(i_old_l, opts, opts.padding[opts.d[1]]); } if (pL >= 0) { sz_resetMargin(i_cur_l, opts, opts.padding[opts.d[3]]); } if (opts.align) { opts.padding[opts.d[1]] = pR; opts.padding[opts.d[3]] = pL; } a_lef[opts.d['left']] = -(i_siz - oL); a_lef_vis[opts.d['left']] = -(i_siz_vis - oL); a_wsz[opts.d['left']] = w_siz[opts.d['width']]; // scrolling functions var _s_wrapper = function() {}, _a_wrapper = function() {}, _s_paddingold = function() {}, _a_paddingold = function() {}, _s_paddingnew = function() {}, _a_paddingnew = function() {}, _s_paddingcur = function() {}, _a_paddingcur = function() {}, _onafter = function() {}, _moveitems = function() {}, _position = function() {}; // clone carousel switch(sO.fx) { case 'crossfade': case 'cover': case 'cover-fade': case 'uncover': case 'uncover-fade': $cf2 = $cfs.clone(true).appendTo($wrp); break; } switch(sO.fx) { case 'crossfade': case 'uncover': case 'uncover-fade': $cf2.children().slice(0, nI).remove(); $cf2.children().slice(opts.items.visibleConf.old).remove(); break; case 'cover': case 'cover-fade': $cf2.children().slice(opts.items.visible).remove(); $cf2.css(a_lef_vis); break; } $cfs.css(a_lef); // reset all scrolls scrl = sc_setScroll(a_dur, sO.easing, conf); // animate / set carousel a_cfs[opts.d['left']] = (opts.usePadding) ? opts.padding[opts.d[3]] : 0; // animate / set wrapper if (opts[opts.d['width']] == 'variable' || opts[opts.d['height']] == 'variable') { _s_wrapper = function() { $wrp.css(w_siz); }; _a_wrapper = function() { scrl.anims.push([$wrp, w_siz]); }; } // animate / set items if (opts.usePadding) { if (i_new_l.not(i_cur_l).length) { a_cur[opts.d['marginRight']] = i_cur_l.data('_cfs_origCssMargin'); if (pL < 0) { i_cur_l.css(a_cur); } else { _s_paddingcur = function() { i_cur_l.css(a_cur); }; _a_paddingcur = function() { scrl.anims.push([i_cur_l, a_cur]); }; } } switch(sO.fx) { case 'cover': case 'cover-fade': $cf2.children().eq(nI-1).css(a_cur); break; } if (i_new_l.not(i_old_l).length) { a_old[opts.d['marginRight']] = i_old_l.data('_cfs_origCssMargin'); _s_paddingold = function() { i_old_l.css(a_old); }; _a_paddingold = function() { scrl.anims.push([i_old_l, a_old]); }; } if (pR >= 0) { a_new[opts.d['marginRight']] = i_new_l.data('_cfs_origCssMargin') + opts.padding[opts.d[1]]; _s_paddingnew = function() { i_new_l.css(a_new); }; _a_paddingnew = function() { scrl.anims.push([i_new_l, a_new]); }; } } // set position _position = function() { $cfs.css(a_cfs); }; var overFill = opts.items.visible+nI-itms.total; // rearrange items _moveitems = function() { if (overFill > 0) { $cfs.children().slice(itms.total).remove(); i_old = $( $cfs.children().slice(itms.total-(opts.items.visible-overFill)).get().concat( $cfs.children().slice(0, overFill).get() ) ); } sc_showHiddenItems(hiddenitems); if (opts.usePadding) { var l_itm = $cfs.children().eq(opts.items.visible+nI-1); l_itm.css(opts.d['marginRight'], l_itm.data('_cfs_origCssMargin')); } }; var cb_arguments = sc_mapCallbackArguments(i_old, i_skp, i_new, nI, 'prev', a_dur, w_siz); // fire onAfter callbacks _onafter = function() { sc_afterScroll($cfs, $cf2, sO); crsl.isScrolling = false; clbk.onAfter = sc_fireCallbacks($tt0, sO, 'onAfter', cb_arguments, clbk); queu = sc_fireQueue($cfs, queu, conf); if (!crsl.isPaused) { $cfs.trigger(cf_e('play', conf)); } }; // fire onBefore callback crsl.isScrolling = true; tmrs = sc_clearTimers(tmrs); clbk.onBefore = sc_fireCallbacks($tt0, sO, 'onBefore', cb_arguments, clbk); switch(sO.fx) { case 'none': $cfs.css(a_cfs); _s_wrapper(); _s_paddingold(); _s_paddingnew(); _s_paddingcur(); _position(); _moveitems(); _onafter(); break; case 'fade': scrl.anims.push([$cfs, { 'opacity': 0 }, function() { _s_wrapper(); _s_paddingold(); _s_paddingnew(); _s_paddingcur(); _position(); _moveitems(); scrl = sc_setScroll(a_dur, sO.easing, conf); scrl.anims.push([$cfs, { 'opacity': 1 }, _onafter]); sc_startScroll(scrl, conf); }]); break; case 'crossfade': $cfs.css({ 'opacity': 0 }); scrl.anims.push([$cf2, { 'opacity': 0 }]); scrl.anims.push([$cfs, { 'opacity': 1 }, _onafter]); _a_wrapper(); _s_paddingold(); _s_paddingnew(); _s_paddingcur(); _position(); _moveitems(); break; case 'cover': scrl.anims.push([$cf2, a_cfs, function() { _s_paddingold(); _s_paddingnew(); _s_paddingcur(); _position(); _moveitems(); _onafter(); }]); _a_wrapper(); break; case 'cover-fade': scrl.anims.push([$cfs, { 'opacity': 0 }]); scrl.anims.push([$cf2, a_cfs, function() { _s_paddingold(); _s_paddingnew(); _s_paddingcur(); _position(); _moveitems(); _onafter(); }]); _a_wrapper(); break; case 'uncover': scrl.anims.push([$cf2, a_wsz, _onafter]); _a_wrapper(); _s_paddingold(); _s_paddingnew(); _s_paddingcur(); _position(); _moveitems(); break; case 'uncover-fade': $cfs.css({ 'opacity': 0 }); scrl.anims.push([$cfs, { 'opacity': 1 }]); scrl.anims.push([$cf2, a_wsz, _onafter]); _a_wrapper(); _s_paddingold(); _s_paddingnew(); _s_paddingcur(); _position(); _moveitems(); break; default: scrl.anims.push([$cfs, a_cfs, function() { _moveitems(); _onafter(); }]); _a_wrapper(); _a_paddingold(); _a_paddingnew(); _a_paddingcur(); break; } sc_startScroll(scrl, conf); cf_setCookie(opts.cookie, $cfs, conf); $cfs.trigger(cf_e('updatePageStatus', conf), [false, w_siz]); return true; }); // next event $cfs.bind(cf_e('slide_next', conf), function(e, sO, nI) { e.stopPropagation(); var a_itm = $cfs.children(); // non-circular at end, scroll to start if (!opts.circular) { if (itms.first == opts.items.visible) { if (opts.infinite) { $cfs.trigger(cf_e('prev', conf), itms.total-1); } return e.stopImmediatePropagation(); } } sz_resetMargin(a_itm, opts); // find number of items to scroll if (!is_number(nI)) { if (opts.items.filter != '*') { var xI = (is_number(sO.items)) ? sO.items : gn_getVisibleOrg($cfs, opts); nI = gn_getScrollItemsNextFilter(a_itm, opts, 0, xI); } else { nI = opts.items.visible; } nI = cf_getAdjust(nI, opts, sO.items, $tt0); } var lastItemNr = (itms.first == 0) ? itms.total : itms.first; // prevent non-circular from scrolling to far if (!opts.circular) { if (opts.items.visibleConf.variable) { var vI = gn_getVisibleItemsNext(a_itm, opts, nI), xI = gn_getVisibleItemsPrev(a_itm, opts, lastItemNr-1); } else { var vI = opts.items.visible, xI = opts.items.visible; } if (nI + vI > lastItemNr) { nI = lastItemNr - xI; } } // set new number of visible items opts.items.visibleConf.old = opts.items.visible; if (opts.items.visibleConf.variable) { var vI = cf_getItemsAdjust(gn_getVisibleItemsNextTestCircular(a_itm, opts, nI, lastItemNr), opts, opts.items.visibleConf.adjust, $tt0); while (opts.items.visible-nI >= vI && nI < itms.total) { nI++; vI = cf_getItemsAdjust(gn_getVisibleItemsNextTestCircular(a_itm, opts, nI, lastItemNr), opts, opts.items.visibleConf.adjust, $tt0); } opts.items.visible = vI; } else if (opts.items.filter != '*') { var vI = gn_getVisibleItemsNextFilter(a_itm, opts, nI); opts.items.visible = cf_getItemsAdjust(vI, opts, opts.items.visibleConf.adjust, $tt0); } sz_resetMargin(a_itm, opts, true); // scroll 0, don't scroll if (nI == 0) { e.stopImmediatePropagation(); return debug(conf, '0 items to scroll: Not scrolling.'); } debug(conf, 'Scrolling '+nI+' items forward.'); // save new config itms.first -= nI; while (itms.first < 0) { itms.first += itms.total; } // non-circular callback if (!opts.circular) { if (itms.first == opts.items.visible && sO.onEnd) { sO.onEnd.call($tt0, 'next'); } if (!opts.infinite) { nv_enableNavi(opts, itms.first, conf); } } // rearrange items if (itms.total < opts.items.visible+nI) { $cfs.children().slice(0, (opts.items.visible+nI)-itms.total).clone(true).appendTo($cfs); } // the needed items var a_itm = $cfs.children(), i_old = gi_getOldItemsNext(a_itm, opts), i_new = gi_getNewItemsNext(a_itm, opts, nI), i_cur_l = a_itm.eq(nI-1), i_old_l = i_old.last(), i_new_l = i_new.last(); sz_resetMargin(a_itm, opts); var pL = 0, pR = 0; if (opts.align) { var p = cf_getAlignPadding(i_new, opts); pL = p[0]; pR = p[1]; } // hide items for fx directscroll var hiddenitems = false, i_skp = $(); if (opts.items.visibleConf.old < nI) { i_skp = a_itm.slice(opts.items.visibleConf.old, nI); if (sO.fx == 'directscroll') { var orgW = opts.items[opts.d['width']]; hiddenitems = i_skp; i_cur_l = i_old_l; sc_hideHiddenItems(hiddenitems); opts.items[opts.d['width']] = 'variable'; } } // save new sizes var $cf2 = false, i_siz = ms_getTotalSize(a_itm.slice(0, nI), opts, 'width'), w_siz = cf_mapWrapperSizes(ms_getSizes(i_new, opts, true), opts, !opts.usePadding), i_siz_vis = 0, a_cfs = {}, a_cfs_vis = {}, a_cur = {}, a_old = {}, a_lef = {}, a_dur = sc_getDuration(sO, opts, nI, i_siz); switch(sO.fx) { case 'uncover': case 'uncover-fade': i_siz_vis = ms_getTotalSize(a_itm.slice(0, opts.items.visibleConf.old), opts, 'width'); break; } if (hiddenitems) { opts.items[opts.d['width']] = orgW; } if (opts.align) { if (opts.padding[opts.d[1]] < 0) { opts.padding[opts.d[1]] = 0; } } sz_resetMargin(a_itm, opts, true); sz_resetMargin(i_old_l, opts, opts.padding[opts.d[1]]); if (opts.align) { opts.padding[opts.d[1]] = pR; opts.padding[opts.d[3]] = pL; } a_lef[opts.d['left']] = (opts.usePadding) ? opts.padding[opts.d[3]] : 0; // scrolling functions var _s_wrapper = function() {}, _a_wrapper = function() {}, _s_paddingold = function() {}, _a_paddingold = function() {}, _s_paddingcur = function() {}, _a_paddingcur = function() {}, _onafter = function() {}, _moveitems = function() {}, _position = function() {}; // clone carousel switch(sO.fx) { case 'crossfade': case 'cover': case 'cover-fade': case 'uncover': case 'uncover-fade': $cf2 = $cfs.clone(true).appendTo($wrp); $cf2.children().slice(opts.items.visibleConf.old).remove(); break; } switch(sO.fx) { case 'crossfade': case 'cover': case 'cover-fade': $cfs.css('zIndex', 1); $cf2.css('zIndex', 0); break; } // reset all scrolls scrl = sc_setScroll(a_dur, sO.easing, conf); // animate / set carousel a_cfs[opts.d['left']] = -i_siz; a_cfs_vis[opts.d['left']] = -i_siz_vis; if (pL < 0) { a_cfs[opts.d['left']] += pL; } // animate / set wrapper if (opts[opts.d['width']] == 'variable' || opts[opts.d['height']] == 'variable') { _s_wrapper = function() { $wrp.css(w_siz); }; _a_wrapper = function() { scrl.anims.push([$wrp, w_siz]); }; } // animate / set items if (opts.usePadding) { var i_new_l_m = i_new_l.data('_cfs_origCssMargin'); if (pR >= 0) { i_new_l_m += opts.padding[opts.d[1]]; } i_new_l.css(opts.d['marginRight'], i_new_l_m); if (i_cur_l.not(i_old_l).length) { a_old[opts.d['marginRight']] = i_old_l.data('_cfs_origCssMargin'); } _s_paddingold = function() { i_old_l.css(a_old); }; _a_paddingold = function() { scrl.anims.push([i_old_l, a_old]); }; var i_cur_l_m = i_cur_l.data('_cfs_origCssMargin'); if (pL > 0) { i_cur_l_m += opts.padding[opts.d[3]]; } a_cur[opts.d['marginRight']] = i_cur_l_m; _s_paddingcur = function() { i_cur_l.css(a_cur); }; _a_paddingcur = function() { scrl.anims.push([i_cur_l, a_cur]); }; } // set position _position = function() { $cfs.css(a_lef); }; var overFill = opts.items.visible+nI-itms.total; // rearrange items _moveitems = function() { if (overFill > 0) { $cfs.children().slice(itms.total).remove(); } var l_itm = $cfs.children().slice(0, nI).appendTo($cfs).last(); if (overFill > 0) { i_new = gi_getCurrentItems(a_itm, opts); } sc_showHiddenItems(hiddenitems); if (opts.usePadding) { if (itms.total < opts.items.visible+nI) { var i_cur_l = $cfs.children().eq(opts.items.visible-1); i_cur_l.css(opts.d['marginRight'], i_cur_l.data('_cfs_origCssMargin') + opts.padding[opts.d[1]]); } l_itm.css(opts.d['marginRight'], l_itm.data('_cfs_origCssMargin')); } }; var cb_arguments = sc_mapCallbackArguments(i_old, i_skp, i_new, nI, 'next', a_dur, w_siz); // fire onAfter callbacks _onafter = function() { $cfs.css('zIndex', $cfs.data('_cfs_origCssZindex')); sc_afterScroll($cfs, $cf2, sO); crsl.isScrolling = false; clbk.onAfter = sc_fireCallbacks($tt0, sO, 'onAfter', cb_arguments, clbk); queu = sc_fireQueue($cfs, queu, conf); if (!crsl.isPaused) { $cfs.trigger(cf_e('play', conf)); } }; // fire onBefore callbacks crsl.isScrolling = true; tmrs = sc_clearTimers(tmrs); clbk.onBefore = sc_fireCallbacks($tt0, sO, 'onBefore', cb_arguments, clbk); switch(sO.fx) { case 'none': $cfs.css(a_cfs); _s_wrapper(); _s_paddingold(); _s_paddingcur(); _position(); _moveitems(); _onafter(); break; case 'fade': scrl.anims.push([$cfs, { 'opacity': 0 }, function() { _s_wrapper(); _s_paddingold(); _s_paddingcur(); _position(); _moveitems(); scrl = sc_setScroll(a_dur, sO.easing, conf); scrl.anims.push([$cfs, { 'opacity': 1 }, _onafter]); sc_startScroll(scrl, conf); }]); break; case 'crossfade': $cfs.css({ 'opacity': 0 }); scrl.anims.push([$cf2, { 'opacity': 0 }]); scrl.anims.push([$cfs, { 'opacity': 1 }, _onafter]); _a_wrapper(); _s_paddingold(); _s_paddingcur(); _position(); _moveitems(); break; case 'cover': $cfs.css(opts.d['left'], $wrp[opts.d['width']]()); scrl.anims.push([$cfs, a_lef, _onafter]); _a_wrapper(); _s_paddingold(); _s_paddingcur(); _moveitems(); break; case 'cover-fade': $cfs.css(opts.d['left'], $wrp[opts.d['width']]()); scrl.anims.push([$cf2, { 'opacity': 0 }]); scrl.anims.push([$cfs, a_lef, _onafter]); _a_wrapper(); _s_paddingold(); _s_paddingcur(); _moveitems(); break; case 'uncover': scrl.anims.push([$cf2, a_cfs_vis, _onafter]); _a_wrapper(); _s_paddingold(); _s_paddingcur(); _position(); _moveitems(); break; case 'uncover-fade': $cfs.css({ 'opacity': 0 }); scrl.anims.push([$cfs, { 'opacity': 1 }]); scrl.anims.push([$cf2, a_cfs_vis, _onafter]); _a_wrapper(); _s_paddingold(); _s_paddingcur(); _position(); _moveitems(); break; default: scrl.anims.push([$cfs, a_cfs, function() { _position(); _moveitems(); _onafter(); }]); _a_wrapper(); _a_paddingold(); _a_paddingcur(); break; } sc_startScroll(scrl, conf); cf_setCookie(opts.cookie, $cfs, conf); $cfs.trigger(cf_e('updatePageStatus', conf), [false, w_siz]); return true; }); // slideTo event $cfs.bind(cf_e('slideTo', conf), function(e, num, dev, org, obj, dir, clb) { e.stopPropagation(); var v = [num, dev, org, obj, dir, clb], t = ['string/number/object', 'number', 'boolean', 'object', 'string', 'function'], a = cf_sortParams(v, t); obj = a[3]; dir = a[4]; clb = a[5]; num = gn_getItemIndex(a[0], a[1], a[2], itms, $cfs); if (num == 0) { return false; } if (!is_object(obj)) { obj = false; } if (dir != 'prev' && dir != 'next') { if (opts.circular) { dir = (num <= itms.total / 2) ? 'next' : 'prev'; } else { dir = (itms.first == 0 || itms.first > num) ? 'next' : 'prev'; } } if (dir == 'prev') { num = itms.total-num; } $cfs.trigger(cf_e(dir, conf), [obj, num, clb]); return true; }); // prevPage event $cfs.bind(cf_e('prevPage', conf), function(e, obj, clb) { e.stopPropagation(); var cur = $cfs.triggerHandler(cf_e('currentPage', conf)); return $cfs.triggerHandler(cf_e('slideToPage', conf), [cur-1, obj, 'prev', clb]); }); // nextPage event $cfs.bind(cf_e('nextPage', conf), function(e, obj, clb) { e.stopPropagation(); var cur = $cfs.triggerHandler(cf_e('currentPage', conf)); return $cfs.triggerHandler(cf_e('slideToPage', conf), [cur+1, obj, 'next', clb]); }); // slideToPage event $cfs.bind(cf_e('slideToPage', conf), function(e, pag, obj, dir, clb) { e.stopPropagation(); if (!is_number(pag)) { pag = $cfs.triggerHandler(cf_e('currentPage', conf)); } var ipp = opts.pagination.items || opts.items.visible, max = Math.ceil(itms.total / ipp)-1; if (pag < 0) { pag = max; } if (pag > max) { pag = 0; } return $cfs.triggerHandler(cf_e('slideTo', conf), [pag*ipp, 0, true, obj, dir, clb]); }); // jumpToStart event $cfs.bind(cf_e('jumpToStart', conf), function(e, s) { e.stopPropagation(); if (s) { s = gn_getItemIndex(s, 0, true, itms, $cfs); } else { s = 0; } s += itms.first; if (s != 0) { if (itms.total > 0) { while (s > itms.total) { s -= itms.total; } } $cfs.prepend($cfs.children().slice(s, itms.total)); } return true; }); // synchronise event $cfs.bind(cf_e('synchronise', conf), function(e, s) { e.stopPropagation(); if (s) { s = cf_getSynchArr(s); } else if (opts.synchronise) { s = opts.synchronise; } else { return debug(conf, 'No carousel to synchronise.'); } var n = $cfs.triggerHandler(cf_e('currentPosition', conf)), x = true; for (var j = 0, l = s.length; j < l; j++) { if (!s[j][0].triggerHandler(cf_e('slideTo', conf), [n, s[j][3], true])) { x = false; } } return x; }); // queue event $cfs.bind(cf_e('queue', conf), function(e, dir, opt) { e.stopPropagation(); if (is_function(dir)) { dir.call($tt0, queu); } else if (is_array(dir)) { queu = dir; } else if (!is_undefined(dir)) { queu.push([dir, opt]); } return queu; }); // insertItem event $cfs.bind(cf_e('insertItem', conf), function(e, itm, num, org, dev) { e.stopPropagation(); var v = [itm, num, org, dev], t = ['string/object', 'string/number/object', 'boolean', 'number'], a = cf_sortParams(v, t); itm = a[0]; num = a[1]; org = a[2]; dev = a[3]; if (is_object(itm) && !is_jquery(itm)) { itm = $(itm); } else if (is_string(itm)) { itm = $(itm); } if (!is_jquery(itm) || itm.length == 0) { return debug(conf, 'Not a valid object.'); } if (is_undefined(num)) { num = 'end'; } sz_storeMargin(itm, opts); sz_storeOrigCss(itm); var orgNum = num, before = 'before'; if (num == 'end') { if (org) { if (itms.first == 0) { num = itms.total-1; before = 'after'; } else { num = itms.first; itms.first += itm.length; } if (num < 0) { num = 0; } } else { num = itms.total-1; before = 'after'; } } else { num = gn_getItemIndex(num, dev, org, itms, $cfs); } var $cit = $cfs.children().eq(num); if ($cit.length) { $cit[before](itm); } else { debug(conf, 'Correct insert-position not found! Appending item to the end.'); $cfs.append(itm); } if (orgNum != 'end' && !org) { if (num < itms.first) { itms.first += itm.length; } } itms.total = $cfs.children().length; if (itms.first >= itms.total) { itms.first -= itms.total; } $cfs.trigger(cf_e('updateSizes', conf)); $cfs.trigger(cf_e('linkAnchors', conf)); return true; }); // removeItem event $cfs.bind(cf_e('removeItem', conf), function(e, num, org, dev) { e.stopPropagation(); var v = [num, org, dev], t = ['string/number/object', 'boolean', 'number'], a = cf_sortParams(v, t); num = a[0]; org = a[1]; dev = a[2]; var removed = false; if (num instanceof $ && num.length > 1) { $removed = $(); num.each(function(i, el) { var $rem = $cfs.trigger(cf_e('removeItem', conf), [$(this), org, dev]); if ( $rem ) { $removed = $removed.add($rem); } }); return $removed; } if (is_undefined(num) || num == 'end') { $removed = $cfs.children().last(); } else { num = gn_getItemIndex(num, dev, org, itms, $cfs); var $removed = $cfs.children().eq(num); if ( $removed.length ) { if (num < itms.first) { itms.first -= $removed.length; } } } if ( $removed && $removed.length ) { $removed.detach(); itms.total = $cfs.children().length; $cfs.trigger(cf_e('updateSizes', conf)); } return $removed; }); // onBefore and onAfter event $cfs.bind(cf_e('onBefore', conf)+' '+cf_e('onAfter', conf), function(e, fn) { e.stopPropagation(); var eType = e.type.slice(conf.events.prefix.length); if (is_array(fn)) { clbk[eType] = fn; } if (is_function(fn)) { clbk[eType].push(fn); } return clbk[eType]; }); // currentPosition event $cfs.bind(cf_e('currentPosition', conf), function(e, fn) { e.stopPropagation(); if (itms.first == 0) { var val = 0; } else { var val = itms.total - itms.first; } if (is_function(fn)) { fn.call($tt0, val); } return val; }); // currentPage event $cfs.bind(cf_e('currentPage', conf), function(e, fn) { e.stopPropagation(); var ipp = opts.pagination.items || opts.items.visible, max = Math.ceil(itms.total/ipp-1), nr; if (itms.first == 0) { nr = 0; } else if (itms.first < itms.total % ipp) { nr = 0; } else if (itms.first == ipp && !opts.circular) { nr = max; } else { nr = Math.round((itms.total-itms.first)/ipp); } if (nr < 0) { nr = 0; } if (nr > max) { nr = max; } if (is_function(fn)) { fn.call($tt0, nr); } return nr; }); // currentVisible event $cfs.bind(cf_e('currentVisible', conf), function(e, fn) { e.stopPropagation(); var $i = gi_getCurrentItems($cfs.children(), opts); if (is_function(fn)) { fn.call($tt0, $i); } return $i; }); // slice event $cfs.bind(cf_e('slice', conf), function(e, f, l, fn) { e.stopPropagation(); if (itms.total == 0) { return false; } var v = [f, l, fn], t = ['number', 'number', 'function'], a = cf_sortParams(v, t); f = (is_number(a[0])) ? a[0] : 0; l = (is_number(a[1])) ? a[1] : itms.total; fn = a[2]; f += itms.first; l += itms.first; if (items.total > 0) { while (f > itms.total) { f -= itms.total; } while (l > itms.total) { l -= itms.total; } while (f < 0) { f += itms.total; } while (l < 0) { l += itms.total; } } var $iA = $cfs.children(), $i; if (l > f) { $i = $iA.slice(f, l); } else { $i = $( $iA.slice(f, itms.total).get().concat( $iA.slice(0, l).get() ) ); } if (is_function(fn)) { fn.call($tt0, $i); } return $i; }); // isPaused, isStopped and isScrolling events $cfs.bind(cf_e('isPaused', conf)+' '+cf_e('isStopped', conf)+' '+cf_e('isScrolling', conf), function(e, fn) { e.stopPropagation(); var eType = e.type.slice(conf.events.prefix.length), value = crsl[eType]; if (is_function(fn)) { fn.call($tt0, value); } return value; }); // configuration event $cfs.bind(cf_e('configuration', conf), function(e, a, b, c) { e.stopPropagation(); var reInit = false; // return entire configuration-object if (is_function(a)) { a.call($tt0, opts); } // set multiple options via object else if (is_object(a)) { opts_orig = $.extend(true, {}, opts_orig, a); if (b !== false) reInit = true; else opts = $.extend(true, {}, opts, a); } else if (!is_undefined(a)) { // callback function for specific option if (is_function(b)) { var val = eval('opts.'+a); if (is_undefined(val)) { val = ''; } b.call($tt0, val); } // set individual option else if (!is_undefined(b)) { if (typeof c !== 'boolean') c = true; eval('opts_orig.'+a+' = b'); if (c !== false) reInit = true; else eval('opts.'+a+' = b'); } // return value for specific option else { return eval('opts.'+a); } } if (reInit) { sz_resetMargin($cfs.children(), opts); FN._init(opts_orig); FN._bind_buttons(); var sz = sz_setSizes($cfs, opts); $cfs.trigger(cf_e('updatePageStatus', conf), [true, sz]); } return opts; }); // linkAnchors event $cfs.bind(cf_e('linkAnchors', conf), function(e, $con, sel) { e.stopPropagation(); if (is_undefined($con)) { $con = $('body'); } else if (is_string($con)) { $con = $($con); } if (!is_jquery($con) || $con.length == 0) { return debug(conf, 'Not a valid object.'); } if (!is_string(sel)) { sel = 'a.caroufredsel'; } $con.find(sel).each(function() { var h = this.hash || ''; if (h.length > 0 && $cfs.children().index($(h)) != -1) { $(this).unbind('click').click(function(e) { e.preventDefault(); $cfs.trigger(cf_e('slideTo', conf), h); }); } }); return true; }); // updatePageStatus event $cfs.bind(cf_e('updatePageStatus', conf), function(e, build, sizes) { e.stopPropagation(); if (!opts.pagination.container) { return; } var ipp = opts.pagination.items || opts.items.visible, pgs = Math.ceil(itms.total/ipp); if (build) { if (opts.pagination.anchorBuilder) { opts.pagination.container.children().remove(); opts.pagination.container.each(function() { for (var a = 0; a < pgs; a++) { var i = $cfs.children().eq( gn_getItemIndex(a*ipp, 0, true, itms, $cfs) ); $(this).append(opts.pagination.anchorBuilder.call(i[0], a+1)); } }); } opts.pagination.container.each(function() { $(this).children().unbind(opts.pagination.event).each(function(a) { $(this).bind(opts.pagination.event, function(e) { e.preventDefault(); $cfs.trigger(cf_e('slideTo', conf), [a*ipp, -opts.pagination.deviation, true, opts.pagination]); }); }); }); } var selected = $cfs.triggerHandler(cf_e('currentPage', conf)) + opts.pagination.deviation; if (selected >= pgs) { selected = 0; } if (selected < 0) { selected = pgs-1; } opts.pagination.container.each(function() { $(this).children().removeClass(cf_c('selected', conf)).eq(selected).addClass(cf_c('selected', conf)); }); return true; }); // updateSizes event $cfs.bind(cf_e('updateSizes', conf), function(e) { var vI = opts.items.visible, a_itm = $cfs.children(), avail_primary = ms_getParentSize($wrp, opts, 'width'); itms.total = a_itm.length; if (crsl.primarySizePercentage) { opts.maxDimension = avail_primary; opts[opts.d['width']] = ms_getPercentage(avail_primary, crsl.primarySizePercentage); } else { opts.maxDimension = ms_getMaxDimension(opts, avail_primary); } if (opts.responsive) { opts.items.width = opts.items.sizesConf.width; opts.items.height = opts.items.sizesConf.height; opts = in_getResponsiveValues(opts, a_itm, avail_primary); vI = opts.items.visible; sz_setResponsiveSizes(opts, a_itm); } else if (opts.items.visibleConf.variable) { vI = gn_getVisibleItemsNext(a_itm, opts, 0); } else if (opts.items.filter != '*') { vI = gn_getVisibleItemsNextFilter(a_itm, opts, 0); } if (!opts.circular && itms.first != 0 && vI > itms.first) { if (opts.items.visibleConf.variable) { var nI = gn_getVisibleItemsPrev(a_itm, opts, itms.first) - itms.first; } else if (opts.items.filter != '*') { var nI = gn_getVisibleItemsPrevFilter(a_itm, opts, itms.first) - itms.first; } else { var nI = opts.items.visible - itms.first; } debug(conf, 'Preventing non-circular: sliding '+nI+' items backward.'); $cfs.trigger(cf_e('prev', conf), nI); } opts.items.visible = cf_getItemsAdjust(vI, opts, opts.items.visibleConf.adjust, $tt0); opts.items.visibleConf.old = opts.items.visible; opts = in_getAlignPadding(opts, a_itm); var sz = sz_setSizes($cfs, opts); $cfs.trigger(cf_e('updatePageStatus', conf), [true, sz]); nv_showNavi(opts, itms.total, conf); nv_enableNavi(opts, itms.first, conf); return sz; }); // destroy event $cfs.bind(cf_e('destroy', conf), function(e, orgOrder) { e.stopPropagation(); tmrs = sc_clearTimers(tmrs); $cfs.data('_cfs_isCarousel', false); $cfs.trigger(cf_e('finish', conf)); if (orgOrder) { $cfs.trigger(cf_e('jumpToStart', conf)); } sz_restoreOrigCss($cfs.children()); sz_restoreOrigCss($cfs); FN._unbind_events(); FN._unbind_buttons(); if (conf.wrapper == 'parent') { sz_restoreOrigCss($wrp); } else { $wrp.replaceWith($cfs); } return true; }); // debug event $cfs.bind(cf_e('debug', conf), function(e) { debug(conf, 'Carousel width: ' + opts.width); debug(conf, 'Carousel height: ' + opts.height); debug(conf, 'Item widths: ' + opts.items.width); debug(conf, 'Item heights: ' + opts.items.height); debug(conf, 'Number of items visible: ' + opts.items.visible); if (opts.auto.play) { debug(conf, 'Number of items scrolled automatically: ' + opts.auto.items); } if (opts.prev.button) { debug(conf, 'Number of items scrolled backward: ' + opts.prev.items); } if (opts.next.button) { debug(conf, 'Number of items scrolled forward: ' + opts.next.items); } return conf.debug; }); // triggerEvent, making prefixed and namespaced events accessible from outside $cfs.bind('_cfs_triggerEvent', function(e, n, o) { e.stopPropagation(); return $cfs.triggerHandler(cf_e(n, conf), o); }); }; // /bind_events FN._unbind_events = function() { $cfs.unbind(cf_e('', conf)); $cfs.unbind(cf_e('', conf, false)); $cfs.unbind('_cfs_triggerEvent'); }; // /unbind_events FN._bind_buttons = function() { FN._unbind_buttons(); nv_showNavi(opts, itms.total, conf); nv_enableNavi(opts, itms.first, conf); if (opts.auto.pauseOnHover) { var pC = bt_pauseOnHoverConfig(opts.auto.pauseOnHover); $wrp.bind(cf_e('mouseenter', conf, false), function() { $cfs.trigger(cf_e('pause', conf), pC); }) .bind(cf_e('mouseleave', conf, false), function() { $cfs.trigger(cf_e('resume', conf)); }); } // play button if (opts.auto.button) { opts.auto.button.bind(cf_e(opts.auto.event, conf, false), function(e) { e.preventDefault(); var ev = false, pC = null; if (crsl.isPaused) { ev = 'play'; } else if (opts.auto.pauseOnEvent) { ev = 'pause'; pC = bt_pauseOnHoverConfig(opts.auto.pauseOnEvent); } if (ev) { $cfs.trigger(cf_e(ev, conf), pC); } }); } // prev button if (opts.prev.button) { opts.prev.button.bind(cf_e(opts.prev.event, conf, false), function(e) { e.preventDefault(); $cfs.trigger(cf_e('prev', conf)); }); if (opts.prev.pauseOnHover) { var pC = bt_pauseOnHoverConfig(opts.prev.pauseOnHover); opts.prev.button.bind(cf_e('mouseenter', conf, false), function() { $cfs.trigger(cf_e('pause', conf), pC); }) .bind(cf_e('mouseleave', conf, false), function() { $cfs.trigger(cf_e('resume', conf)); }); } } // next butotn if (opts.next.button) { opts.next.button.bind(cf_e(opts.next.event, conf, false), function(e) { e.preventDefault(); $cfs.trigger(cf_e('next', conf)); }); if (opts.next.pauseOnHover) { var pC = bt_pauseOnHoverConfig(opts.next.pauseOnHover); opts.next.button.bind(cf_e('mouseenter', conf, false), function() { $cfs.trigger(cf_e('pause', conf), pC); }) .bind(cf_e('mouseleave', conf, false), function() { $cfs.trigger(cf_e('resume', conf)); }); } } // pagination if (opts.pagination.container) { if (opts.pagination.pauseOnHover) { var pC = bt_pauseOnHoverConfig(opts.pagination.pauseOnHover); opts.pagination.container.bind(cf_e('mouseenter', conf, false), function() { $cfs.trigger(cf_e('pause', conf), pC); }) .bind(cf_e('mouseleave', conf, false), function() { $cfs.trigger(cf_e('resume', conf)); }); } } // prev/next keys if (opts.prev.key || opts.next.key) { $(document).bind(cf_e('keyup', conf, false, true, true), function(e) { var k = e.keyCode; if (k == opts.next.key) { e.preventDefault(); $cfs.trigger(cf_e('next', conf)); } if (k == opts.prev.key) { e.preventDefault(); $cfs.trigger(cf_e('prev', conf)); } }); } // pagination keys if (opts.pagination.keys) { $(document).bind(cf_e('keyup', conf, false, true, true), function(e) { var k = e.keyCode; if (k >= 49 && k < 58) { k = (k-49) * opts.items.visible; if (k <= itms.total) { e.preventDefault(); $cfs.trigger(cf_e('slideTo', conf), [k, 0, true, opts.pagination]); } } }); } // swipe if ($.fn.swipe) { var isTouch = 'ontouchstart' in window; if ((isTouch && opts.swipe.onTouch) || (!isTouch && opts.swipe.onMouse)) { var scP = $.extend(true, {}, opts.prev, opts.swipe), scN = $.extend(true, {}, opts.next, opts.swipe), swP = function() { $cfs.trigger(cf_e('prev', conf), [scP]) }, swN = function() { $cfs.trigger(cf_e('next', conf), [scN]) }; switch (opts.direction) { case 'up': case 'down': opts.swipe.options.swipeUp = swN; opts.swipe.options.swipeDown = swP; break; default: opts.swipe.options.swipeLeft = swN; opts.swipe.options.swipeRight = swP; } if (crsl.swipe) { $cfs.swipe('destroy'); } $wrp.swipe(opts.swipe.options); $wrp.css('cursor', 'move'); crsl.swipe = true; } } // mousewheel if ($.fn.mousewheel) { if (opts.mousewheel) { var mcP = $.extend(true, {}, opts.prev, opts.mousewheel), mcN = $.extend(true, {}, opts.next, opts.mousewheel); if (crsl.mousewheel) { $wrp.unbind(cf_e('mousewheel', conf, false)); } $wrp.bind(cf_e('mousewheel', conf, false), function(e, delta) { e.preventDefault(); if (delta > 0) { $cfs.trigger(cf_e('prev', conf), [mcP]); } else { $cfs.trigger(cf_e('next', conf), [mcN]); } }); crsl.mousewheel = true; } } if (opts.auto.play) { $cfs.trigger(cf_e('play', conf), opts.auto.delay); } if (crsl.upDateOnWindowResize) { var resizeFn = function(e) { $cfs.trigger(cf_e('finish', conf)); if (opts.auto.pauseOnResize && !crsl.isPaused) { $cfs.trigger(cf_e('play', conf)); } sz_resetMargin($cfs.children(), opts); $cfs.trigger(cf_e('updateSizes', conf)); }; var $w = $(window), onResize = null; if ($.debounce && conf.onWindowResize == 'debounce') { onResize = $.debounce(200, resizeFn); } else if ($.throttle && conf.onWindowResize == 'throttle') { onResize = $.throttle(300, resizeFn); } else { var _windowWidth = 0, _windowHeight = 0; onResize = function() { var nw = $w.width(), nh = $w.height(); if (nw != _windowWidth || nh != _windowHeight) { resizeFn(); _windowWidth = nw; _windowHeight = nh; } }; } $w.bind(cf_e('resize', conf, false, true, true), onResize); } }; // /bind_buttons FN._unbind_buttons = function() { var ns1 = cf_e('', conf), ns2 = cf_e('', conf, false); ns3 = cf_e('', conf, false, true, true); $(document).unbind(ns3); $(window).unbind(ns3); $wrp.unbind(ns2); if (opts.auto.button) { opts.auto.button.unbind(ns2); } if (opts.prev.button) { opts.prev.button.unbind(ns2); } if (opts.next.button) { opts.next.button.unbind(ns2); } if (opts.pagination.container) { opts.pagination.container.unbind(ns2); if (opts.pagination.anchorBuilder) { opts.pagination.container.children().remove(); } } if (crsl.swipe) { $cfs.swipe('destroy'); $wrp.css('cursor', 'default'); crsl.swipe = false; } if (crsl.mousewheel) { crsl.mousewheel = false; } nv_showNavi(opts, 'hide', conf); nv_enableNavi(opts, 'removeClass', conf); }; // /unbind_buttons // START if (is_boolean(configs)) { configs = { 'debug': configs }; } // set vars var crsl = { 'direction' : 'next', 'isPaused' : true, 'isScrolling' : false, 'isStopped' : false, 'mousewheel' : false, 'swipe' : false }, itms = { 'total' : $cfs.children().length, 'first' : 0 }, tmrs = { 'auto' : null, 'progress' : null, 'startTime' : getTime(), 'timePassed' : 0 }, scrl = { 'isStopped' : false, 'duration' : 0, 'startTime' : 0, 'easing' : '', 'anims' : [] }, clbk = { 'onBefore' : [], 'onAfter' : [] }, queu = [], conf = $.extend(true, {}, $.fn.carouFredSel.configs, configs), opts = {}, opts_orig = $.extend(true, {}, options), $wrp = (conf.wrapper == 'parent') ? $cfs.parent() : $cfs.wrap('<'+conf.wrapper.element+' class="'+conf.wrapper.classname+'" />').parent(); conf.selector = $cfs.selector; conf.serialNumber = $.fn.carouFredSel.serialNumber++; conf.transition = (conf.transition && $.fn.transition) ? 'transition' : 'animate'; // create carousel FN._init(opts_orig, true, starting_position); FN._build(); FN._bind_events(); FN._bind_buttons(); // find item to start if (is_array(opts.items.start)) { var start_arr = opts.items.start; } else { var start_arr = []; if (opts.items.start != 0) { start_arr.push(opts.items.start); } } if (opts.cookie) { start_arr.unshift(parseInt(cf_getCookie(opts.cookie), 10)); } if (start_arr.length > 0) { for (var a = 0, l = start_arr.length; a < l; a++) { var s = start_arr[a]; if (s == 0) { continue; } if (s === true) { s = window.location.hash; if (s.length < 1) { continue; } } else if (s === 'random') { s = Math.floor(Math.random()*itms.total); } if ($cfs.triggerHandler(cf_e('slideTo', conf), [s, 0, true, { fx: 'none' }])) { break; } } } var siz = sz_setSizes($cfs, opts), itm = gi_getCurrentItems($cfs.children(), opts); if (opts.onCreate) { opts.onCreate.call($tt0, { 'width': siz.width, 'height': siz.height, 'items': itm }); } $cfs.trigger(cf_e('updatePageStatus', conf), [true, siz]); $cfs.trigger(cf_e('linkAnchors', conf)); if (conf.debug) { $cfs.trigger(cf_e('debug', conf)); } return $cfs; }; // GLOBAL PUBLIC $.fn.carouFredSel.serialNumber = 1; $.fn.carouFredSel.defaults = { 'synchronise' : false, 'infinite' : true, 'circular' : true, 'responsive' : false, 'direction' : 'left', 'items' : { 'start' : 0 }, 'scroll' : { 'easing' : 'swing', 'duration' : 500, 'pauseOnHover' : false, 'event' : 'click', 'queue' : false } }; $.fn.carouFredSel.configs = { 'debug' : false, 'transition' : false, 'onWindowResize': 'throttle', 'events' : { 'prefix' : '', 'namespace' : 'cfs' }, 'wrapper' : { 'element' : 'div', 'classname' : 'caroufredsel_wrapper' }, 'classnames' : {} }; $.fn.carouFredSel.pageAnchorBuilder = function(nr) { return ''+nr+''; }; $.fn.carouFredSel.progressbarUpdater = function(perc) { $(this).css('width', perc+'%'); }; $.fn.carouFredSel.cookie = { get: function(n) { n += '='; var ca = document.cookie.split(';'); for (var a = 0, l = ca.length; a < l; a++) { var c = ca[a]; while (c.charAt(0) == ' ') { c = c.slice(1); } if (c.indexOf(n) == 0) { return c.slice(n.length); } } return 0; }, set: function(n, v, d) { var e = ""; if (d) { var date = new Date(); date.setTime(date.getTime() + (d * 24 * 60 * 60 * 1000)); e = "; expires=" + date.toGMTString(); } document.cookie = n + '=' + v + e + '; path=/'; }, remove: function(n) { $.fn.carouFredSel.cookie.set(n, "", -1); } }; // GLOBAL PRIVATE // scrolling functions function sc_setScroll(d, e, c) { if (c.transition == 'transition') { if (e == 'swing') { e = 'ease'; } } return { anims: [], duration: d, orgDuration: d, easing: e, startTime: getTime() }; } function sc_startScroll(s, c) { for (var a = 0, l = s.anims.length; a < l; a++) { var b = s.anims[a]; if (!b) { continue; } b[0][c.transition](b[1], s.duration, s.easing, b[2]); } } function sc_stopScroll(s, finish) { if (!is_boolean(finish)) { finish = true; } if (is_object(s.pre)) { sc_stopScroll(s.pre, finish); } for (var a = 0, l = s.anims.length; a < l; a++) { var b = s.anims[a]; b[0].stop(true); if (finish) { b[0].css(b[1]); if (is_function(b[2])) { b[2](); } } } if (is_object(s.post)) { sc_stopScroll(s.post, finish); } } function sc_afterScroll( $c, $c2, o ) { if ($c2) { $c2.remove(); } switch(o.fx) { case 'fade': case 'crossfade': case 'cover-fade': case 'uncover-fade': $c.css('opacity', 1); $c.css('filter', ''); break; } } function sc_fireCallbacks($t, o, b, a, c) { if (o[b]) { o[b].call($t, a); } if (c[b].length) { for (var i = 0, l = c[b].length; i < l; i++) { c[b][i].call($t, a); } } return []; } function sc_fireQueue($c, q, c) { if (q.length) { $c.trigger(cf_e(q[0][0], c), q[0][1]); q.shift(); } return q; } function sc_hideHiddenItems(hiddenitems) { hiddenitems.each(function() { var hi = $(this); hi.data('_cfs_isHidden', hi.is(':hidden')).hide(); }); } function sc_showHiddenItems(hiddenitems) { if (hiddenitems) { hiddenitems.each(function() { var hi = $(this); if (!hi.data('_cfs_isHidden')) { hi.show(); } }); } } function sc_clearTimers(t) { if (t.auto) { clearTimeout(t.auto); } if (t.progress) { clearInterval(t.progress); } return t; } function sc_mapCallbackArguments(i_old, i_skp, i_new, s_itm, s_dir, s_dur, w_siz) { return { 'width': w_siz.width, 'height': w_siz.height, 'items': { 'old': i_old, 'skipped': i_skp, 'visible': i_new }, 'scroll': { 'items': s_itm, 'direction': s_dir, 'duration': s_dur } }; } function sc_getDuration( sO, o, nI, siz ) { var dur = sO.duration; if (sO.fx == 'none') { return 0; } if (dur == 'auto') { dur = o.scroll.duration / o.scroll.items * nI; } else if (dur < 10) { dur = siz / dur; } if (dur < 1) { return 0; } if (sO.fx == 'fade') { dur = dur / 2; } return Math.round(dur); } // navigation functions function nv_showNavi(o, t, c) { var minimum = (is_number(o.items.minimum)) ? o.items.minimum : o.items.visible + 1; if (t == 'show' || t == 'hide') { var f = t; } else if (minimum > t) { debug(c, 'Not enough items ('+t+' total, '+minimum+' needed): Hiding navigation.'); var f = 'hide'; } else { var f = 'show'; } var s = (f == 'show') ? 'removeClass' : 'addClass', h = cf_c('hidden', c); if (o.auto.button) { o.auto.button[f]()[s](h); } if (o.prev.button) { o.prev.button[f]()[s](h); } if (o.next.button) { o.next.button[f]()[s](h); } if (o.pagination.container) { o.pagination.container[f]()[s](h); } } function nv_enableNavi(o, f, c) { if (o.circular || o.infinite) return; var fx = (f == 'removeClass' || f == 'addClass') ? f : false, di = cf_c('disabled', c); if (o.auto.button && fx) { o.auto.button[fx](di); } if (o.prev.button) { var fn = fx || (f == 0) ? 'addClass' : 'removeClass'; o.prev.button[fn](di); } if (o.next.button) { var fn = fx || (f == o.items.visible) ? 'addClass' : 'removeClass'; o.next.button[fn](di); } } // get object functions function go_getObject($tt, obj) { if (is_function(obj)) { obj = obj.call($tt); } else if (is_undefined(obj)) { obj = {}; } return obj; } function go_getItemsObject($tt, obj) { obj = go_getObject($tt, obj); if (is_number(obj)) { obj = { 'visible': obj }; } else if (obj == 'variable') { obj = { 'visible': obj, 'width': obj, 'height': obj }; } else if (!is_object(obj)) { obj = {}; } return obj; } function go_getScrollObject($tt, obj) { obj = go_getObject($tt, obj); if (is_number(obj)) { if (obj <= 50) { obj = { 'items': obj }; } else { obj = { 'duration': obj }; } } else if (is_string(obj)) { obj = { 'easing': obj }; } else if (!is_object(obj)) { obj = {}; } return obj; } function go_getNaviObject($tt, obj) { obj = go_getObject($tt, obj); if (is_string(obj)) { var temp = cf_getKeyCode(obj); if (temp == -1) { obj = $(obj); } else { obj = temp; } } return obj; } function go_getAutoObject($tt, obj) { obj = go_getNaviObject($tt, obj); if (is_jquery(obj)) { obj = { 'button': obj }; } else if (is_boolean(obj)) { obj = { 'play': obj }; } else if (is_number(obj)) { obj = { 'timeoutDuration': obj }; } if (obj.progress) { if (is_string(obj.progress) || is_jquery(obj.progress)) { obj.progress = { 'bar': obj.progress }; } } return obj; } function go_complementAutoObject($tt, obj) { if (is_function(obj.button)) { obj.button = obj.button.call($tt); } if (is_string(obj.button)) { obj.button = $(obj.button); } if (!is_boolean(obj.play)) { obj.play = true; } if (!is_number(obj.delay)) { obj.delay = 0; } if (is_undefined(obj.pauseOnEvent)) { obj.pauseOnEvent = true; } if (!is_boolean(obj.pauseOnResize)) { obj.pauseOnResize = true; } if (!is_number(obj.timeoutDuration)) { obj.timeoutDuration = (obj.duration < 10) ? 2500 : obj.duration * 5; } if (obj.progress) { if (is_function(obj.progress.bar)) { obj.progress.bar = obj.progress.bar.call($tt); } if (is_string(obj.progress.bar)) { obj.progress.bar = $(obj.progress.bar); } if (obj.progress.bar) { if (!is_function(obj.progress.updater)) { obj.progress.updater = $.fn.carouFredSel.progressbarUpdater; } if (!is_number(obj.progress.interval)) { obj.progress.interval = 50; } } else { obj.progress = false; } } return obj; } function go_getPrevNextObject($tt, obj) { obj = go_getNaviObject($tt, obj); if (is_jquery(obj)) { obj = { 'button': obj }; } else if (is_number(obj)) { obj = { 'key': obj }; } return obj; } function go_complementPrevNextObject($tt, obj) { if (is_function(obj.button)) { obj.button = obj.button.call($tt); } if (is_string(obj.button)) { obj.button = $(obj.button); } if (is_string(obj.key)) { obj.key = cf_getKeyCode(obj.key); } return obj; } function go_getPaginationObject($tt, obj) { obj = go_getNaviObject($tt, obj); if (is_jquery(obj)) { obj = { 'container': obj }; } else if (is_boolean(obj)) { obj = { 'keys': obj }; } return obj; } function go_complementPaginationObject($tt, obj) { if (is_function(obj.container)) { obj.container = obj.container.call($tt); } if (is_string(obj.container)) { obj.container = $(obj.container); } if (!is_number(obj.items)) { obj.items = false; } if (!is_boolean(obj.keys)) { obj.keys = false; } if (!is_function(obj.anchorBuilder) && !is_false(obj.anchorBuilder)) { obj.anchorBuilder = $.fn.carouFredSel.pageAnchorBuilder; } if (!is_number(obj.deviation)) { obj.deviation = 0; } return obj; } function go_getSwipeObject($tt, obj) { if (is_function(obj)) { obj = obj.call($tt); } if (is_undefined(obj)) { obj = { 'onTouch': false }; } if (is_true(obj)) { obj = { 'onTouch': obj }; } else if (is_number(obj)) { obj = { 'items': obj }; } return obj; } function go_complementSwipeObject($tt, obj) { if (!is_boolean(obj.onTouch)) { obj.onTouch = true; } if (!is_boolean(obj.onMouse)) { obj.onMouse = false; } if (!is_object(obj.options)) { obj.options = {}; } if (!is_boolean(obj.options.triggerOnTouchEnd)) { obj.options.triggerOnTouchEnd = false; } return obj; } function go_getMousewheelObject($tt, obj) { if (is_function(obj)) { obj = obj.call($tt); } if (is_true(obj)) { obj = {}; } else if (is_number(obj)) { obj = { 'items': obj }; } else if (is_undefined(obj)) { obj = false; } return obj; } function go_complementMousewheelObject($tt, obj) { return obj; } // get number functions function gn_getItemIndex(num, dev, org, items, $cfs) { if (is_string(num)) { num = $(num, $cfs); } if (is_object(num)) { num = $(num, $cfs); } if (is_jquery(num)) { num = $cfs.children().index(num); if (!is_boolean(org)) { org = false; } } else { if (!is_boolean(org)) { org = true; } } if (!is_number(num)) { num = 0; } if (!is_number(dev)) { dev = 0; } if (org) { num += items.first; } num += dev; if (items.total > 0) { while (num >= items.total) { num -= items.total; } while (num < 0) { num += items.total; } } return num; } // items prev function gn_getVisibleItemsPrev(i, o, s) { var t = 0, x = 0; for (var a = s; a >= 0; a--) { var j = i.eq(a); t += (j.is(':visible')) ? j[o.d['outerWidth']](true) : 0; if (t > o.maxDimension) { return x; } if (a == 0) { a = i.length; } x++; } } function gn_getVisibleItemsPrevFilter(i, o, s) { return gn_getItemsPrevFilter(i, o.items.filter, o.items.visibleConf.org, s); } function gn_getScrollItemsPrevFilter(i, o, s, m) { return gn_getItemsPrevFilter(i, o.items.filter, m, s); } function gn_getItemsPrevFilter(i, f, m, s) { var t = 0, x = 0; for (var a = s, l = i.length; a >= 0; a--) { x++; if (x == l) { return x; } var j = i.eq(a); if (j.is(f)) { t++; if (t == m) { return x; } } if (a == 0) { a = l; } } } function gn_getVisibleOrg($c, o) { return o.items.visibleConf.org || $c.children().slice(0, o.items.visible).filter(o.items.filter).length; } // items next function gn_getVisibleItemsNext(i, o, s) { var t = 0, x = 0; for (var a = s, l = i.length-1; a <= l; a++) { var j = i.eq(a); t += (j.is(':visible')) ? j[o.d['outerWidth']](true) : 0; if (t > o.maxDimension) { return x; } x++; if (x == l+1) { return x; } if (a == l) { a = -1; } } } function gn_getVisibleItemsNextTestCircular(i, o, s, l) { var v = gn_getVisibleItemsNext(i, o, s); if (!o.circular) { if (s + v > l) { v = l - s; } } return v; } function gn_getVisibleItemsNextFilter(i, o, s) { return gn_getItemsNextFilter(i, o.items.filter, o.items.visibleConf.org, s, o.circular); } function gn_getScrollItemsNextFilter(i, o, s, m) { return gn_getItemsNextFilter(i, o.items.filter, m+1, s, o.circular) - 1; } function gn_getItemsNextFilter(i, f, m, s, c) { var t = 0, x = 0; for (var a = s, l = i.length-1; a <= l; a++) { x++; if (x >= l) { return x; } var j = i.eq(a); if (j.is(f)) { t++; if (t == m) { return x; } } if (a == l) { a = -1; } } } // get items functions function gi_getCurrentItems(i, o) { return i.slice(0, o.items.visible); } function gi_getOldItemsPrev(i, o, n) { return i.slice(n, o.items.visibleConf.old+n); } function gi_getNewItemsPrev(i, o) { return i.slice(0, o.items.visible); } function gi_getOldItemsNext(i, o) { return i.slice(0, o.items.visibleConf.old); } function gi_getNewItemsNext(i, o, n) { return i.slice(n, o.items.visible+n); } // sizes functions function sz_storeMargin(i, o, d) { if (o.usePadding) { if (!is_string(d)) { d = '_cfs_origCssMargin'; } i.each(function() { var j = $(this), m = parseInt(j.css(o.d['marginRight']), 10); if (!is_number(m)) { m = 0; } j.data(d, m); }); } } function sz_resetMargin(i, o, m) { if (o.usePadding) { var x = (is_boolean(m)) ? m : false; if (!is_number(m)) { m = 0; } sz_storeMargin(i, o, '_cfs_tempCssMargin'); i.each(function() { var j = $(this); j.css(o.d['marginRight'], ((x) ? j.data('_cfs_tempCssMargin') : m + j.data('_cfs_origCssMargin'))); }); } } function sz_storeOrigCss(i) { i.each(function() { var j = $(this); j.data('_cfs_origCss', j.attr('style') || ''); }); } function sz_restoreOrigCss(i) { i.each(function() { var j = $(this); j.attr('style', j.data('_cfs_origCss') || ''); }); } function sz_setResponsiveSizes(o, all) { var visb = o.items.visible, newS = o.items[o.d['width']], seco = o[o.d['height']], secp = is_percentage(seco); all.each(function() { var $t = $(this), nw = newS - ms_getPaddingBorderMargin($t, o, 'Width'); $t[o.d['width']](nw); if (secp) { $t[o.d['height']](ms_getPercentage(nw, seco)); } }); } function sz_setSizes($c, o) { var $w = $c.parent(), $i = $c.children(), $v = gi_getCurrentItems($i, o), sz = cf_mapWrapperSizes(ms_getSizes($v, o, true), o, false); $w.css(sz); if (o.usePadding) { var p = o.padding, r = p[o.d[1]]; if (o.align && r < 0) { r = 0; } var $l = $v.last(); $l.css(o.d['marginRight'], $l.data('_cfs_origCssMargin') + r); $c.css(o.d['top'], p[o.d[0]]); $c.css(o.d['left'], p[o.d[3]]); } $c.css(o.d['width'], sz[o.d['width']]+(ms_getTotalSize($i, o, 'width')*2)); $c.css(o.d['height'], ms_getLargestSize($i, o, 'height')); return sz; } // measuring functions function ms_getSizes(i, o, wrapper) { return [ms_getTotalSize(i, o, 'width', wrapper), ms_getLargestSize(i, o, 'height', wrapper)]; } function ms_getLargestSize(i, o, dim, wrapper) { if (!is_boolean(wrapper)) { wrapper = false; } if (is_number(o[o.d[dim]]) && wrapper) { return o[o.d[dim]]; } if (is_number(o.items[o.d[dim]])) { return o.items[o.d[dim]]; } dim = (dim.toLowerCase().indexOf('width') > -1) ? 'outerWidth' : 'outerHeight'; return ms_getTrueLargestSize(i, o, dim); } function ms_getTrueLargestSize(i, o, dim) { var s = 0; for (var a = 0, l = i.length; a < l; a++) { var j = i.eq(a); var m = (j.is(':visible')) ? j[o.d[dim]](true) : 0; if (s < m) { s = m; } } return s; } function ms_getTotalSize(i, o, dim, wrapper) { if (!is_boolean(wrapper)) { wrapper = false; } if (is_number(o[o.d[dim]]) && wrapper) { return o[o.d[dim]]; } if (is_number(o.items[o.d[dim]])) { return o.items[o.d[dim]] * i.length; } var d = (dim.toLowerCase().indexOf('width') > -1) ? 'outerWidth' : 'outerHeight', s = 0; for (var a = 0, l = i.length; a < l; a++) { var j = i.eq(a); s += (j.is(':visible')) ? j[o.d[d]](true) : 0; } return s; } function ms_getParentSize($w, o, d) { var isVisible = $w.is(':visible'); if (isVisible) { $w.hide(); } var s = $w.parent()[o.d[d]](); if (isVisible) { $w.show(); } return s; } function ms_getMaxDimension(o, a) { return (is_number(o[o.d['width']])) ? o[o.d['width']] : a; } function ms_hasVariableSizes(i, o, dim) { var s = false, v = false; for (var a = 0, l = i.length; a < l; a++) { var j = i.eq(a); var c = (j.is(':visible')) ? j[o.d[dim]](true) : 0; if (s === false) { s = c; } else if (s != c) { v = true; } if (s == 0) { v = true; } } return v; } function ms_getPaddingBorderMargin(i, o, d) { return i[o.d['outer'+d]](true) - i[o.d[d.toLowerCase()]](); } function ms_getPercentage(s, o) { if (is_percentage(o)) { o = parseInt( o.slice(0, -1), 10 ); if (!is_number(o)) { return s; } s *= o/100; } return s; } // config functions function cf_e(n, c, pf, ns, rd) { if (!is_boolean(pf)) { pf = true; } if (!is_boolean(ns)) { ns = true; } if (!is_boolean(rd)) { rd = false; } if (pf) { n = c.events.prefix + n; } if (ns) { n = n +'.'+ c.events.namespace; } if (ns && rd) { n += c.serialNumber; } return n; } function cf_c(n, c) { return (is_string(c.classnames[n])) ? c.classnames[n] : n; } function cf_mapWrapperSizes(ws, o, p) { if (!is_boolean(p)) { p = true; } var pad = (o.usePadding && p) ? o.padding : [0, 0, 0, 0]; var wra = {}; wra[o.d['width']] = ws[0] + pad[1] + pad[3]; wra[o.d['height']] = ws[1] + pad[0] + pad[2]; return wra; } function cf_sortParams(vals, typs) { var arr = []; for (var a = 0, l1 = vals.length; a < l1; a++) { for (var b = 0, l2 = typs.length; b < l2; b++) { if (typs[b].indexOf(typeof vals[a]) > -1 && is_undefined(arr[b])) { arr[b] = vals[a]; break; } } } return arr; } function cf_getPadding(p) { if (is_undefined(p)) { return [0, 0, 0, 0]; } if (is_number(p)) { return [p, p, p, p]; } if (is_string(p)) { p = p.split('px').join('').split('em').join('').split(' '); } if (!is_array(p)) { return [0, 0, 0, 0]; } for (var i = 0; i < 4; i++) { p[i] = parseInt(p[i], 10); } switch (p.length) { case 0: return [0, 0, 0, 0]; case 1: return [p[0], p[0], p[0], p[0]]; case 2: return [p[0], p[1], p[0], p[1]]; case 3: return [p[0], p[1], p[2], p[1]]; default: return [p[0], p[1], p[2], p[3]]; } } function cf_getAlignPadding(itm, o) { var x = (is_number(o[o.d['width']])) ? Math.ceil(o[o.d['width']] - ms_getTotalSize(itm, o, 'width')) : 0; switch (o.align) { case 'left': return [0, x]; case 'right': return [x, 0]; case 'center': default: return [Math.ceil(x/2), Math.floor(x/2)]; } } function cf_getDimensions(o) { var dm = [ ['width' , 'innerWidth' , 'outerWidth' , 'height' , 'innerHeight' , 'outerHeight' , 'left', 'top' , 'marginRight' , 0, 1, 2, 3], ['height' , 'innerHeight' , 'outerHeight' , 'width' , 'innerWidth' , 'outerWidth' , 'top' , 'left', 'marginBottom', 3, 2, 1, 0] ]; var dl = dm[0].length, dx = (o.direction == 'right' || o.direction == 'left') ? 0 : 1; var dimensions = {}; for (var d = 0; d < dl; d++) { dimensions[dm[0][d]] = dm[dx][d]; } return dimensions; } function cf_getAdjust(x, o, a, $t) { var v = x; if (is_function(a)) { v = a.call($t, v); } else if (is_string(a)) { var p = a.split('+'), m = a.split('-'); if (m.length > p.length) { var neg = true, sta = m[0], adj = m[1]; } else { var neg = false, sta = p[0], adj = p[1]; } switch(sta) { case 'even': v = (x % 2 == 1) ? x-1 : x; break; case 'odd': v = (x % 2 == 0) ? x-1 : x; break; default: v = x; break; } adj = parseInt(adj, 10); if (is_number(adj)) { if (neg) { adj = -adj; } v += adj; } } if (!is_number(v) || v < 1) { v = 1; } return v; } function cf_getItemsAdjust(x, o, a, $t) { return cf_getItemAdjustMinMax(cf_getAdjust(x, o, a, $t), o.items.visibleConf); } function cf_getItemAdjustMinMax(v, i) { if (is_number(i.min) && v < i.min) { v = i.min; } if (is_number(i.max) && v > i.max) { v = i.max; } if (v < 1) { v = 1; } return v; } function cf_getSynchArr(s) { if (!is_array(s)) { s = [[s]]; } if (!is_array(s[0])) { s = [s]; } for (var j = 0, l = s.length; j < l; j++) { if (is_string(s[j][0])) { s[j][0] = $(s[j][0]); } if (!is_boolean(s[j][1])) { s[j][1] = true; } if (!is_boolean(s[j][2])) { s[j][2] = true; } if (!is_number(s[j][3])) { s[j][3] = 0; } } return s; } function cf_getKeyCode(k) { if (k == 'right') { return 39; } if (k == 'left') { return 37; } if (k == 'up') { return 38; } if (k == 'down') { return 40; } return -1; } function cf_setCookie(n, $c, c) { if (n) { var v = $c.triggerHandler(cf_e('currentPosition', c)); $.fn.carouFredSel.cookie.set(n, v); } } function cf_getCookie(n) { var c = $.fn.carouFredSel.cookie.get(n); return (c == '') ? 0 : c; } // init function function in_mapCss($elem, props) { var css = {}; for (var p = 0, l = props.length; p < l; p++) { css[props[p]] = $elem.css(props[p]); } return css; } function in_complementItems(obj, opt, itm, sta) { if (!is_object(obj.visibleConf)) { obj.visibleConf = {}; } if (!is_object(obj.sizesConf)) { obj.sizesConf = {}; } if (obj.start == 0 && is_number(sta)) { obj.start = sta; } // visible items if (is_object(obj.visible)) { obj.visibleConf.min = obj.visible.min; obj.visibleConf.max = obj.visible.max; obj.visible = false; } else if (is_string(obj.visible)) { // variable visible items if (obj.visible == 'variable') { obj.visibleConf.variable = true; } // adjust string visible items else { obj.visibleConf.adjust = obj.visible; } obj.visible = false; } else if (is_function(obj.visible)) { obj.visibleConf.adjust = obj.visible; obj.visible = false; } // set items filter if (!is_string(obj.filter)) { obj.filter = (itm.filter(':hidden').length > 0) ? ':visible' : '*'; } // primary item-size not set if (!obj[opt.d['width']]) { // responsive carousel -> set to largest if (opt.responsive) { debug(true, 'Set a '+opt.d['width']+' for the items!'); obj[opt.d['width']] = ms_getTrueLargestSize(itm, opt, 'outerWidth'); } // non-responsive -> measure it or set to "variable" else { obj[opt.d['width']] = (ms_hasVariableSizes(itm, opt, 'outerWidth')) ? 'variable' : itm[opt.d['outerWidth']](true); } } // secondary item-size not set -> measure it or set to "variable" if (!obj[opt.d['height']]) { obj[opt.d['height']] = (ms_hasVariableSizes(itm, opt, 'outerHeight')) ? 'variable' : itm[opt.d['outerHeight']](true); } obj.sizesConf.width = obj.width; obj.sizesConf.height = obj.height; return obj; } function in_complementVisibleItems(opt, avl) { // primary item-size variable -> set visible items variable if (opt.items[opt.d['width']] == 'variable') { opt.items.visibleConf.variable = true; } if (!opt.items.visibleConf.variable) { // primary size is number -> calculate visible-items if (is_number(opt[opt.d['width']])) { opt.items.visible = Math.floor(opt[opt.d['width']] / opt.items[opt.d['width']]); } // measure and calculate primary size and visible-items else { opt.items.visible = Math.floor(avl / opt.items[opt.d['width']]); opt[opt.d['width']] = opt.items.visible * opt.items[opt.d['width']]; if (!opt.items.visibleConf.adjust) { opt.align = false; } } if (opt.items.visible == 'Infinity' || opt.items.visible < 1) { debug(true, 'Not a valid number of visible items: Set to "variable".'); opt.items.visibleConf.variable = true; } } return opt; } function in_complementPrimarySize(obj, opt, all) { // primary size set to auto -> measure largest item-size and set it if (obj == 'auto') { obj = ms_getTrueLargestSize(all, opt, 'outerWidth'); } return obj; } function in_complementSecondarySize(obj, opt, all) { // secondary size set to auto -> measure largest item-size and set it if (obj == 'auto') { obj = ms_getTrueLargestSize(all, opt, 'outerHeight'); } // secondary size not set -> set to secondary item-size if (!obj) { obj = opt.items[opt.d['height']]; } return obj; } function in_getAlignPadding(o, all) { var p = cf_getAlignPadding(gi_getCurrentItems(all, o), o); o.padding[o.d[1]] = p[1]; o.padding[o.d[3]] = p[0]; return o; } function in_getResponsiveValues(o, all, avl) { var visb = cf_getItemAdjustMinMax(Math.ceil(o[o.d['width']] / o.items[o.d['width']]), o.items.visibleConf); if (visb > all.length) { visb = all.length; } var newS = Math.floor(o[o.d['width']]/visb); o.items.visible = visb; o.items[o.d['width']] = newS; o[o.d['width']] = visb * newS; return o; } // buttons functions function bt_pauseOnHoverConfig(p) { if (is_string(p)) { var i = (p.indexOf('immediate') > -1) ? true : false, r = (p.indexOf('resume') > -1) ? true : false; } else { var i = r = false; } return [i, r]; } function bt_mousesheelNumber(mw) { return (is_number(mw)) ? mw : null } // helper functions function is_null(a) { return (a === null); } function is_undefined(a) { return (is_null(a) || typeof a == 'undefined' || a === '' || a === 'undefined'); } function is_array(a) { return (a instanceof Array); } function is_jquery(a) { return (a instanceof jQuery); } function is_object(a) { return ((a instanceof Object || typeof a == 'object') && !is_null(a) && !is_jquery(a) && !is_array(a) && !is_function(a)); } function is_number(a) { return ((a instanceof Number || typeof a == 'number') && !isNaN(a)); } function is_string(a) { return ((a instanceof String || typeof a == 'string') && !is_undefined(a) && !is_true(a) && !is_false(a)); } function is_function(a) { return (a instanceof Function || typeof a == 'function'); } function is_boolean(a) { return (a instanceof Boolean || typeof a == 'boolean' || is_true(a) || is_false(a)); } function is_true(a) { return (a === true || a === 'true'); } function is_false(a) { return (a === false || a === 'false'); } function is_percentage(x) { return (is_string(x) && x.slice(-1) == '%'); } function getTime() { return new Date().getTime(); } function deprecated( o, n ) { debug(true, o+' is DEPRECATED, support for it will be removed. Use '+n+' instead.'); } function debug(d, m) { if (!is_undefined(window.console) && !is_undefined(window.console.log)) { if (is_object(d)) { var s = ' ('+d.selector+')'; d = d.debug; } else { var s = ''; } if (!d) { return false; } if (is_string(m)) { m = 'carouFredSel'+s+': ' + m; } else { m = ['carouFredSel'+s+':', m]; } window.console.log(m); } return false; } // EASING FUNCTIONS $.extend($.easing, { 'quadratic': function(t) { var t2 = t * t; return t * (-t2 * t + 4 * t2 - 6 * t + 4); }, 'cubic': function(t) { return t * (4 * t * t - 9 * t + 6); }, 'elastic': function(t) { var t2 = t * t; return t * (33 * t2 * t2 - 106 * t2 * t + 126 * t2 - 67 * t + 15); } }); })(jQuery); /* == jquery mousewheel plugin == Version: 3.1.13, License: MIT License (MIT) */ !function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?module.exports=a:a(jQuery)}(function(a){function b(b){var g=b||window.event,h=i.call(arguments,1),j=0,l=0,m=0,n=0,o=0,p=0;if(b=a.event.fix(g),b.type="mousewheel","detail"in g&&(m=-1*g.detail),"wheelDelta"in g&&(m=g.wheelDelta),"wheelDeltaY"in g&&(m=g.wheelDeltaY),"wheelDeltaX"in g&&(l=-1*g.wheelDeltaX),"axis"in g&&g.axis===g.HORIZONTAL_AXIS&&(l=-1*m,m=0),j=0===m?l:m,"deltaY"in g&&(m=-1*g.deltaY,j=m),"deltaX"in g&&(l=g.deltaX,0===m&&(j=-1*l)),0!==m||0!==l){if(1===g.deltaMode){var q=a.data(this,"mousewheel-line-height");j*=q,m*=q,l*=q}else if(2===g.deltaMode){var r=a.data(this,"mousewheel-page-height");j*=r,m*=r,l*=r}if(n=Math.max(Math.abs(m),Math.abs(l)),(!f||f>n)&&(f=n,d(g,n)&&(f/=40)),d(g,n)&&(j/=40,l/=40,m/=40),j=Math[j>=1?"floor":"ceil"](j/f),l=Math[l>=1?"floor":"ceil"](l/f),m=Math[m>=1?"floor":"ceil"](m/f),k.settings.normalizeOffset&&this.getBoundingClientRect){var s=this.getBoundingClientRect();o=b.clientX-s.left,p=b.clientY-s.top}return b.deltaX=l,b.deltaY=m,b.deltaFactor=f,b.offsetX=o,b.offsetY=p,b.deltaMode=0,h.unshift(b,j,l,m),e&&clearTimeout(e),e=setTimeout(c,200),(a.event.dispatch||a.event.handle).apply(this,h)}}function c(){f=null}function d(a,b){return k.settings.adjustOldDeltas&&"mousewheel"===a.type&&b%120===0}var e,f,g=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],h="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],i=Array.prototype.slice;if(a.event.fixHooks)for(var j=g.length;j;)a.event.fixHooks[g[--j]]=a.event.mouseHooks;var k=a.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var c=h.length;c;)this.addEventListener(h[--c],b,!1);else this.onmousewheel=b;a.data(this,"mousewheel-line-height",k.getLineHeight(this)),a.data(this,"mousewheel-page-height",k.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var c=h.length;c;)this.removeEventListener(h[--c],b,!1);else this.onmousewheel=null;a.removeData(this,"mousewheel-line-height"),a.removeData(this,"mousewheel-page-height")},getLineHeight:function(b){var c=a(b),d=c["offsetParent"in a.fn?"offsetParent":"parent"]();return d.length||(d=a("body")),parseInt(d.css("fontSize"),10)||parseInt(c.css("fontSize"),10)||16},getPageHeight:function(b){return a(b).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};a.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})});!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?module.exports=a:a(jQuery)}(function(a){function b(b){var g=b||window.event,h=i.call(arguments,1),j=0,l=0,m=0,n=0,o=0,p=0;if(b=a.event.fix(g),b.type="mousewheel","detail"in g&&(m=-1*g.detail),"wheelDelta"in g&&(m=g.wheelDelta),"wheelDeltaY"in g&&(m=g.wheelDeltaY),"wheelDeltaX"in g&&(l=-1*g.wheelDeltaX),"axis"in g&&g.axis===g.HORIZONTAL_AXIS&&(l=-1*m,m=0),j=0===m?l:m,"deltaY"in g&&(m=-1*g.deltaY,j=m),"deltaX"in g&&(l=g.deltaX,0===m&&(j=-1*l)),0!==m||0!==l){if(1===g.deltaMode){var q=a.data(this,"mousewheel-line-height");j*=q,m*=q,l*=q}else if(2===g.deltaMode){var r=a.data(this,"mousewheel-page-height");j*=r,m*=r,l*=r}if(n=Math.max(Math.abs(m),Math.abs(l)),(!f||f>n)&&(f=n,d(g,n)&&(f/=40)),d(g,n)&&(j/=40,l/=40,m/=40),j=Math[j>=1?"floor":"ceil"](j/f),l=Math[l>=1?"floor":"ceil"](l/f),m=Math[m>=1?"floor":"ceil"](m/f),k.settings.normalizeOffset&&this.getBoundingClientRect){var s=this.getBoundingClientRect();o=b.clientX-s.left,p=b.clientY-s.top}return b.deltaX=l,b.deltaY=m,b.deltaFactor=f,b.offsetX=o,b.offsetY=p,b.deltaMode=0,h.unshift(b,j,l,m),e&&clearTimeout(e),e=setTimeout(c,200),(a.event.dispatch||a.event.handle).apply(this,h)}}function c(){f=null}function d(a,b){return k.settings.adjustOldDeltas&&"mousewheel"===a.type&&b%120===0}var e,f,g=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],h="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],i=Array.prototype.slice;if(a.event.fixHooks)for(var j=g.length;j;)a.event.fixHooks[g[--j]]=a.event.mouseHooks;var k=a.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var c=h.length;c;)this.addEventListener(h[--c],b,!1);else this.onmousewheel=b;a.data(this,"mousewheel-line-height",k.getLineHeight(this)),a.data(this,"mousewheel-page-height",k.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var c=h.length;c;)this.removeEventListener(h[--c],b,!1);else this.onmousewheel=null;a.removeData(this,"mousewheel-line-height"),a.removeData(this,"mousewheel-page-height")},getLineHeight:function(b){var c=a(b),d=c["offsetParent"in a.fn?"offsetParent":"parent"]();return d.length||(d=a("body")),parseInt(d.css("fontSize"),10)||parseInt(c.css("fontSize"),10)||16},getPageHeight:function(b){return a(b).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};a.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})}); /* == malihu jquery custom scrollbar plugin == Version: 3.1.5, License: MIT License (MIT) */ !function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"undefined"!=typeof module&&module.exports?module.exports=e:e(jQuery,window,document)}(function(e){!function(t){var o="function"==typeof define&&define.amd,a="undefined"!=typeof module&&module.exports,n="https:"==document.location.protocol?"https:":"http:",i="codebase.dev.ftbj.net/common/js/plugs/jquery.mousewheel.min.js";o||(a?require("jquery-mousewheel")(e):e.event.special.mousewheel||e("head").append(decodeURI("%3Cscript src="+n+"//"+i+"%3E%3C/script%3E"))),t()}(function(){var t,o="mCustomScrollbar",a="mCS",n=".mCustomScrollbar",i={setTop:0,setLeft:0,axis:"y",scrollbarPosition:"inside",scrollInertia:500,autoDraggerLength:!0,alwaysShowScrollbar:0,snapOffset:0,mouseWheel:{enable:!0,scrollAmount:"100",axis:"y",deltaFactor:100,disableOver:["select","option","keygen","datalist","textarea"]},scrollButtons:{scrollType:"stepless",scrollAmount:"auto"},keyboard:{enable:!0,scrollType:"stepless",scrollAmount:"auto"},contentTouchScroll:25,documentTouchScroll:!0,advanced:{autoExpandHorizontalScroll: true,autoScrollOnFocus:"input,textarea,select,button,datalist,keygen,a[tabindex],area,object,[contenteditable='true']",updateOnContentResize:!0,updateOnImageLoad:"auto",autoUpdateTimeout:60},theme:"light",callbacks:{onTotalScrollOffset:0,onTotalScrollBackOffset:0,alwaysTriggerOffsets:!0}},r=0,l={},s=window.attachEvent&&!window.addEventListener?1:0,c=!1,d=["mCSB_dragger_onDrag","mCSB_scrollTools_onDrag","mCS_img_loaded","mCS_disabled","mCS_destroyed","mCS_no_scrollbar","mCS-autoHide","mCS-dir-rtl","mCS_no_scrollbar_y","mCS_no_scrollbar_x","mCS_y_hidden","mCS_x_hidden","mCSB_draggerContainer","mCSB_buttonUp","mCSB_buttonDown","mCSB_buttonLeft","mCSB_buttonRight"],u={init:function(t){var t=e.extend(!0,{},i,t),o=f.call(this);if(t.live){var s=t.liveSelector||this.selector||n,c=e(s);if("off"===t.live)return void m(s);l[s]=setTimeout(function(){c.mCustomScrollbar(t),"once"===t.live&&c.length&&m(s)},500)}else m(s);return t.setWidth=t.set_width?t.set_width:t.setWidth,t.setHeight=t.set_height?t.set_height:t.setHeight,t.axis=t.horizontalScroll?"x":p(t.axis),t.scrollInertia=t.scrollInertia>0&&t.scrollInertia<17?17:t.scrollInertia,"object"!=typeof t.mouseWheel&&1==t.mouseWheel&&(t.mouseWheel={enable:!0,scrollAmount:"auto",axis:"y",preventDefault:!1,deltaFactor:"auto",normalizeDelta:!1,invert:!1}),t.mouseWheel.scrollAmount=t.mouseWheelPixels?t.mouseWheelPixels:t.mouseWheel.scrollAmount,t.mouseWheel.normalizeDelta=t.advanced.normalizeMouseWheelDelta?t.advanced.normalizeMouseWheelDelta:t.mouseWheel.normalizeDelta,t.scrollButtons.scrollType=g(t.scrollButtons.scrollType),h(t),e(o).each(function(){var o=e(this);if(!o.data(a)){o.data(a,{idx:++r,opt:t,scrollRatio:{y:null,x:null},overflowed:null,contentReset:{y:null,x:null},bindEvents:!1,tweenRunning:!1,sequential:{},langDir:o.css("direction"),cbOffsets:null,trigger:null,poll:{size:{o:0,n:0},img:{o:0,n:0},change:{o:0,n:0}}});var n=o.data(a),i=n.opt,l=o.data("mcs-axis"),s=o.data("mcs-scrollbar-position"),c=o.data("mcs-theme");l&&(i.axis=l),s&&(i.scrollbarPosition=s),c&&(i.theme=c,h(i)),v.call(this),n&&i.callbacks.onCreate&&"function"==typeof i.callbacks.onCreate&&i.callbacks.onCreate.call(this),e("#mCSB_"+n.idx+"_container img:not(."+d[2]+")").addClass(d[2]),u.update.call(null,o)}})},update:function(t,o){var n=t||f.call(this);return e(n).each(function(){var t=e(this);if(t.data(a)){var n=t.data(a),i=n.opt,r=e("#mCSB_"+n.idx+"_container"),l=e("#mCSB_"+n.idx),s=[e("#mCSB_"+n.idx+"_dragger_vertical"),e("#mCSB_"+n.idx+"_dragger_horizontal")];if(!r.length)return;n.tweenRunning&&Q(t),o&&n&&i.callbacks.onBeforeUpdate&&"function"==typeof i.callbacks.onBeforeUpdate&&i.callbacks.onBeforeUpdate.call(this),t.hasClass(d[3])&&t.removeClass(d[3]),t.hasClass(d[4])&&t.removeClass(d[4]),l.css("max-height","none"),l.height()!==t.height()&&l.css("max-height",t.height()),_.call(this),"y"===i.axis||i.advanced.autoExpandHorizontalScroll||r.css("width",x(r)),n.overflowed=y.call(this),M.call(this),i.autoDraggerLength&&S.call(this),b.call(this),T.call(this);var c=[Math.abs(r[0].offsetTop),Math.abs(r[0].offsetLeft)];"x"!==i.axis&&(n.overflowed[0]?s[0].height()>s[0].parent().height()?B.call(this):(G(t,c[0].toString(),{dir:"y",dur:0,overwrite:"none"}),n.contentReset.y=null):(B.call(this),"y"===i.axis?k.call(this):"yx"===i.axis&&n.overflowed[1]&&G(t,c[1].toString(),{dir:"x",dur:0,overwrite:"none"}))),"y"!==i.axis&&(n.overflowed[1]?s[1].width()>s[1].parent().width()?B.call(this):(G(t,c[1].toString(),{dir:"x",dur:0,overwrite:"none"}),n.contentReset.x=null):(B.call(this),"x"===i.axis?k.call(this):"yx"===i.axis&&n.overflowed[0]&&G(t,c[0].toString(),{dir:"y",dur:0,overwrite:"none"}))),o&&n&&(2===o&&i.callbacks.onImageLoad&&"function"==typeof i.callbacks.onImageLoad?i.callbacks.onImageLoad.call(this):3===o&&i.callbacks.onSelectorChange&&"function"==typeof i.callbacks.onSelectorChange?i.callbacks.onSelectorChange.call(this):i.callbacks.onUpdate&&"function"==typeof i.callbacks.onUpdate&&i.callbacks.onUpdate.call(this)),N.call(this)}})},scrollTo:function(t,o){if("undefined"!=typeof t&&null!=t){var n=f.call(this);return e(n).each(function(){var n=e(this);if(n.data(a)){var i=n.data(a),r=i.opt,l={trigger:"external",scrollInertia:r.scrollInertia,scrollEasing:"mcsEaseInOut",moveDragger:!1,timeout:60,callbacks:!0,onStart:!0,onUpdate:!0,onComplete:!0},s=e.extend(!0,{},l,o),c=Y.call(this,t),d=s.scrollInertia>0&&s.scrollInertia<17?17:s.scrollInertia;c[0]=X.call(this,c[0],"y"),c[1]=X.call(this,c[1],"x"),s.moveDragger&&(c[0]*=i.scrollRatio.y,c[1]*=i.scrollRatio.x),s.dur=ne()?0:d,setTimeout(function(){null!==c[0]&&"undefined"!=typeof c[0]&&"x"!==r.axis&&i.overflowed[0]&&(s.dir="y",s.overwrite="all",G(n,c[0].toString(),s)),null!==c[1]&&"undefined"!=typeof c[1]&&"y"!==r.axis&&i.overflowed[1]&&(s.dir="x",s.overwrite="none",G(n,c[1].toString(),s))},s.timeout)}})}},stop:function(){var t=f.call(this);return e(t).each(function(){var t=e(this);t.data(a)&&Q(t)})},disable:function(t){var o=f.call(this);return e(o).each(function(){var o=e(this);if(o.data(a)){o.data(a);N.call(this,"remove"),k.call(this),t&&B.call(this),M.call(this,!0),o.addClass(d[3])}})},destroy:function(){var t=f.call(this);return e(t).each(function(){var n=e(this);if(n.data(a)){var i=n.data(a),r=i.opt,l=e("#mCSB_"+i.idx),s=e("#mCSB_"+i.idx+"_container"),c=e(".mCSB_"+i.idx+"_scrollbar");r.live&&m(r.liveSelector||e(t).selector),N.call(this,"remove"),k.call(this),B.call(this),n.removeData(a),$(this,"mcs"),c.remove(),s.find("img."+d[2]).removeClass(d[2]),l.replaceWith(s.contents()),n.removeClass(o+" _"+a+"_"+i.idx+" "+d[6]+" "+d[7]+" "+d[5]+" "+d[3]).addClass(d[4])}})}},f=function(){return"object"!=typeof e(this)||e(this).length<1?n:this},h=function(t){var o=["rounded","rounded-dark","rounded-dots","rounded-dots-dark"],a=["rounded-dots","rounded-dots-dark","3d","3d-dark","3d-thick","3d-thick-dark","inset","inset-dark","inset-2","inset-2-dark","inset-3","inset-3-dark"],n=["minimal","minimal-dark"],i=["minimal","minimal-dark"],r=["minimal","minimal-dark"];t.autoDraggerLength=e.inArray(t.theme,o)>-1?!1:t.autoDraggerLength,t.autoExpandScrollbar=e.inArray(t.theme,a)>-1?!1:t.autoExpandScrollbar,t.scrollButtons.enable=e.inArray(t.theme,n)>-1?!1:t.scrollButtons.enable,t.autoHideScrollbar=e.inArray(t.theme,i)>-1?!0:t.autoHideScrollbar,t.scrollbarPosition=e.inArray(t.theme,r)>-1?"outside":t.scrollbarPosition},m=function(e){l[e]&&(clearTimeout(l[e]),$(l,e))},p=function(e){return"yx"===e||"xy"===e||"auto"===e?"yx":"x"===e||"horizontal"===e?"x":"y"},g=function(e){return"stepped"===e||"pixels"===e||"step"===e||"click"===e?"stepped":"stepless"},v=function(){var t=e(this),n=t.data(a),i=n.opt,r=i.autoExpandScrollbar?" "+d[1]+"_expand":"",l=["
","
"],s="yx"===i.axis?"mCSB_vertical_horizontal":"x"===i.axis?"mCSB_horizontal":"mCSB_vertical",c="yx"===i.axis?l[0]+l[1]:"x"===i.axis?l[1]:l[0],u="yx"===i.axis?"
":"",f=i.autoHideScrollbar?" "+d[6]:"",h="x"!==i.axis&&"rtl"===n.langDir?" "+d[7]:"";i.setWidth&&t.css("width",i.setWidth),i.setHeight&&t.css("height",i.setHeight),i.setLeft="y"!==i.axis&&"rtl"===n.langDir?"989999px":i.setLeft,t.addClass(o+" _"+a+"_"+n.idx+f+h).wrapInner("
");var m=e("#mCSB_"+n.idx),p=e("#mCSB_"+n.idx+"_container");"y"===i.axis||i.advanced.autoExpandHorizontalScroll||p.css("width",x(p)),"outside"===i.scrollbarPosition?("static"===t.css("position")&&t.css("position","relative"),t.css("overflow","visible"),m.addClass("mCSB_outside").after(c)):(m.addClass("mCSB_inside").append(c),p.wrap(u)),w.call(this);var g=[e("#mCSB_"+n.idx+"_dragger_vertical"),e("#mCSB_"+n.idx+"_dragger_horizontal")];g[0].css("min-height",g[0].height()),g[1].css("min-width",g[1].width())},x=function(t){var o=[t[0].scrollWidth,Math.max.apply(Math,t.children().map(function(){return e(this).outerWidth(!0)}).get())],a=t.parent().width();return o[0]>a?o[0]:o[1]>a?o[1]:"100%"},_=function(){var t=e(this),o=t.data(a),n=o.opt,i=e("#mCSB_"+o.idx+"_container");if(n.advanced.autoExpandHorizontalScroll&&"y"!==n.axis){i.css({width:"auto","min-width":0,"overflow-x":"scroll"});var r=Math.ceil(i[0].scrollWidth);3===n.advanced.autoExpandHorizontalScroll||2!==n.advanced.autoExpandHorizontalScroll&&r>i.parent().width()?i.css({width:r,"min-width":"100%","overflow-x":"inherit"}):i.css({"overflow-x":"inherit",position:"absolute"}).wrap("
").css({width:Math.ceil(i[0].getBoundingClientRect().right+.4)-Math.floor(i[0].getBoundingClientRect().left),"min-width":"100%",position:"relative"}).unwrap()}},w=function(){var t=e(this),o=t.data(a),n=o.opt,i=e(".mCSB_"+o.idx+"_scrollbar:first"),r=oe(n.scrollButtons.tabindex)?"tabindex='"+n.scrollButtons.tabindex+"'":"",l=["","","",""],s=["x"===n.axis?l[2]:l[0],"x"===n.axis?l[3]:l[1],l[2],l[3]];n.scrollButtons.enable&&i.prepend(s[0]).append(s[1]).next(".mCSB_scrollTools").prepend(s[2]).append(s[3])},S=function(){var t=e(this),o=t.data(a),n=e("#mCSB_"+o.idx),i=e("#mCSB_"+o.idx+"_container"),r=[e("#mCSB_"+o.idx+"_dragger_vertical"),e("#mCSB_"+o.idx+"_dragger_horizontal")],l=[n.height()/i.outerHeight(!1),n.width()/i.outerWidth(!1)],c=[parseInt(r[0].css("min-height")),Math.round(l[0]*r[0].parent().height()),parseInt(r[1].css("min-width")),Math.round(l[1]*r[1].parent().width())],d=s&&c[1]r&&(r=s),c>l&&(l=c),[r>n.height(),l>n.width()]},B=function(){var t=e(this),o=t.data(a),n=o.opt,i=e("#mCSB_"+o.idx),r=e("#mCSB_"+o.idx+"_container"),l=[e("#mCSB_"+o.idx+"_dragger_vertical"),e("#mCSB_"+o.idx+"_dragger_horizontal")];if(Q(t),("x"!==n.axis&&!o.overflowed[0]||"y"===n.axis&&o.overflowed[0])&&(l[0].add(r).css("top",0),G(t,"_resetY")),"y"!==n.axis&&!o.overflowed[1]||"x"===n.axis&&o.overflowed[1]){var s=dx=0;"rtl"===o.langDir&&(s=i.width()-r.outerWidth(!1),dx=Math.abs(s/o.scrollRatio.x)),r.css("left",s),l[1].css("left",dx),G(t,"_resetX")}},T=function(){function t(){r=setTimeout(function(){e.event.special.mousewheel?(clearTimeout(r),W.call(o[0])):t()},100)}var o=e(this),n=o.data(a),i=n.opt;if(!n.bindEvents){if(I.call(this),i.contentTouchScroll&&D.call(this),E.call(this),i.mouseWheel.enable){var r;t()}P.call(this),U.call(this),i.advanced.autoScrollOnFocus&&H.call(this),i.scrollButtons.enable&&F.call(this),i.keyboard.enable&&q.call(this),n.bindEvents=!0}},k=function(){var t=e(this),o=t.data(a),n=o.opt,i=a+"_"+o.idx,r=".mCSB_"+o.idx+"_scrollbar",l=e("#mCSB_"+o.idx+",#mCSB_"+o.idx+"_container,#mCSB_"+o.idx+"_container_wrapper,"+r+" ."+d[12]+",#mCSB_"+o.idx+"_dragger_vertical,#mCSB_"+o.idx+"_dragger_horizontal,"+r+">a"),s=e("#mCSB_"+o.idx+"_container");n.advanced.releaseDraggableSelectors&&l.add(e(n.advanced.releaseDraggableSelectors)),n.advanced.extraDraggableSelectors&&l.add(e(n.advanced.extraDraggableSelectors)),o.bindEvents&&(e(document).add(e(!A()||top.document)).unbind("."+i),l.each(function(){e(this).unbind("."+i)}),clearTimeout(t[0]._focusTimeout),$(t[0],"_focusTimeout"),clearTimeout(o.sequential.step),$(o.sequential,"step"),clearTimeout(s[0].onCompleteTimeout),$(s[0],"onCompleteTimeout"),o.bindEvents=!1)},M=function(t){var o=e(this),n=o.data(a),i=n.opt,r=e("#mCSB_"+n.idx+"_container_wrapper"),l=r.length?r:e("#mCSB_"+n.idx+"_container"),s=[e("#mCSB_"+n.idx+"_scrollbar_vertical"),e("#mCSB_"+n.idx+"_scrollbar_horizontal")],c=[s[0].find(".mCSB_dragger"),s[1].find(".mCSB_dragger")];"x"!==i.axis&&(n.overflowed[0]&&!t?(s[0].add(c[0]).add(s[0].children("a")).css("display","block"),l.removeClass(d[8]+" "+d[10])):(i.alwaysShowScrollbar?(2!==i.alwaysShowScrollbar&&c[0].css("display","none"),l.removeClass(d[10])):(s[0].css("display","none"),l.addClass(d[10])),l.addClass(d[8]))),"y"!==i.axis&&(n.overflowed[1]&&!t?(s[1].add(c[1]).add(s[1].children("a")).css("display","block"),l.removeClass(d[9]+" "+d[11])):(i.alwaysShowScrollbar?(2!==i.alwaysShowScrollbar&&c[1].css("display","none"),l.removeClass(d[11])):(s[1].css("display","none"),l.addClass(d[11])),l.addClass(d[9]))),n.overflowed[0]||n.overflowed[1]?o.removeClass(d[5]):o.addClass(d[5])},O=function(t){var o=t.type,a=t.target.ownerDocument!==document&&null!==frameElement?[e(frameElement).offset().top,e(frameElement).offset().left]:null,n=A()&&t.target.ownerDocument!==top.document&&null!==frameElement?[e(t.view.frameElement).offset().top,e(t.view.frameElement).offset().left]:[0,0];switch(o){case"pointerdown":case"MSPointerDown":case"pointermove":case"MSPointerMove":case"pointerup":case"MSPointerUp":return a?[t.originalEvent.pageY-a[0]+n[0],t.originalEvent.pageX-a[1]+n[1],!1]:[t.originalEvent.pageY,t.originalEvent.pageX,!1];case"touchstart":case"touchmove":case"touchend":var i=t.originalEvent.touches[0]||t.originalEvent.changedTouches[0],r=t.originalEvent.touches.length||t.originalEvent.changedTouches.length;return t.target.ownerDocument!==document?[i.screenY,i.screenX,r>1]:[i.pageY,i.pageX,r>1];default:return a?[t.pageY-a[0]+n[0],t.pageX-a[1]+n[1],!1]:[t.pageY,t.pageX,!1]}},I=function(){function t(e,t,a,n){if(h[0].idleTimer=d.scrollInertia<233?250:0,o.attr("id")===f[1])var i="x",s=(o[0].offsetLeft-t+n)*l.scrollRatio.x;else var i="y",s=(o[0].offsetTop-e+a)*l.scrollRatio.y;G(r,s.toString(),{dir:i,drag:!0})}var o,n,i,r=e(this),l=r.data(a),d=l.opt,u=a+"_"+l.idx,f=["mCSB_"+l.idx+"_dragger_vertical","mCSB_"+l.idx+"_dragger_horizontal"],h=e("#mCSB_"+l.idx+"_container"),m=e("#"+f[0]+",#"+f[1]),p=d.advanced.releaseDraggableSelectors?m.add(e(d.advanced.releaseDraggableSelectors)):m,g=d.advanced.extraDraggableSelectors?e(!A()||top.document).add(e(d.advanced.extraDraggableSelectors)):e(!A()||top.document);m.bind("contextmenu."+u,function(e){e.preventDefault()}).bind("mousedown."+u+" touchstart."+u+" pointerdown."+u+" MSPointerDown."+u,function(t){if(t.stopImmediatePropagation(),t.preventDefault(),ee(t)){c=!0,s&&(document.onselectstart=function(){return!1}),L.call(h,!1),Q(r),o=e(this);var a=o.offset(),l=O(t)[0]-a.top,u=O(t)[1]-a.left,f=o.height()+a.top,m=o.width()+a.left;f>l&&l>0&&m>u&&u>0&&(n=l,i=u),C(o,"active",d.autoExpandScrollbar)}}).bind("touchmove."+u,function(e){e.stopImmediatePropagation(),e.preventDefault();var a=o.offset(),r=O(e)[0]-a.top,l=O(e)[1]-a.left;t(n,i,r,l)}),e(document).add(g).bind("mousemove."+u+" pointermove."+u+" MSPointerMove."+u,function(e){if(o){var a=o.offset(),r=O(e)[0]-a.top,l=O(e)[1]-a.left;if(n===r&&i===l)return;t(n,i,r,l)}}).add(p).bind("mouseup."+u+" touchend."+u+" pointerup."+u+" MSPointerUp."+u,function(){o&&(C(o,"active",d.autoExpandScrollbar),o=null),c=!1,s&&(document.onselectstart=null),L.call(h,!0)})},D=function(){function o(e){if(!te(e)||c||O(e)[2])return void(t=0);t=1,b=0,C=0,d=1,y.removeClass("mCS_touch_action");var o=I.offset();u=O(e)[0]-o.top,f=O(e)[1]-o.left,z=[O(e)[0],O(e)[1]]}function n(e){if(te(e)&&!c&&!O(e)[2]&&(T.documentTouchScroll||e.preventDefault(),e.stopImmediatePropagation(),(!C||b)&&d)){g=K();var t=M.offset(),o=O(e)[0]-t.top,a=O(e)[1]-t.left,n="mcsLinearOut";if(E.push(o),W.push(a),z[2]=Math.abs(O(e)[0]-z[0]),z[3]=Math.abs(O(e)[1]-z[1]),B.overflowed[0])var i=D[0].parent().height()-D[0].height(),r=u-o>0&&o-u>-(i*B.scrollRatio.y)&&(2*z[3]0&&a-f>-(l*B.scrollRatio.x)&&(2*z[2]30)){_=1e3/(v-p);var n="mcsEaseOut",i=2.5>_,r=i?[E[E.length-2],W[W.length-2]]:[0,0];x=i?[o-r[0],a-r[1]]:[o-h,a-m];var u=[Math.abs(x[0]),Math.abs(x[1])];_=i?[Math.abs(x[0]/4),Math.abs(x[1]/4)]:[_,_];var f=[Math.abs(I[0].offsetTop)-x[0]*l(u[0]/_[0],_[0]),Math.abs(I[0].offsetLeft)-x[1]*l(u[1]/_[1],_[1])];w="yx"===T.axis?[f[0],f[1]]:"x"===T.axis?[null,f[1]]:[f[0],null],S=[4*u[0]+T.scrollInertia,4*u[1]+T.scrollInertia];var y=parseInt(T.contentTouchScroll)||0;w[0]=u[0]>y?w[0]:0,w[1]=u[1]>y?w[1]:0,B.overflowed[0]&&s(w[0],S[0],n,"y",L,!1),B.overflowed[1]&&s(w[1],S[1],n,"x",L,!1)}}}function l(e,t){var o=[1.5*t,2*t,t/1.5,t/2];return e>90?t>4?o[0]:o[3]:e>60?t>3?o[3]:o[2]:e>30?t>8?o[1]:t>6?o[0]:t>4?t:o[2]:t>8?t:o[3]}function s(e,t,o,a,n,i){e&&G(y,e.toString(),{dur:t,scrollEasing:o,dir:a,overwrite:n,drag:i})}var d,u,f,h,m,p,g,v,x,_,w,S,b,C,y=e(this),B=y.data(a),T=B.opt,k=a+"_"+B.idx,M=e("#mCSB_"+B.idx),I=e("#mCSB_"+B.idx+"_container"),D=[e("#mCSB_"+B.idx+"_dragger_vertical"),e("#mCSB_"+B.idx+"_dragger_horizontal")],E=[],W=[],R=0,L="yx"===T.axis?"none":"all",z=[],P=I.find("iframe"),H=["touchstart."+k+" pointerdown."+k+" MSPointerDown."+k,"touchmove."+k+" pointermove."+k+" MSPointerMove."+k,"touchend."+k+" pointerup."+k+" MSPointerUp."+k],U=void 0!==document.body.style.touchAction&&""!==document.body.style.touchAction;I.bind(H[0],function(e){o(e)}).bind(H[1],function(e){n(e)}),M.bind(H[0],function(e){i(e)}).bind(H[2],function(e){r(e)}),P.length&&P.each(function(){e(this).bind("load",function(){A(this)&&e(this.contentDocument||this.contentWindow.document).bind(H[0],function(e){o(e),i(e)}).bind(H[1],function(e){n(e)}).bind(H[2],function(e){r(e)})})})},E=function(){function o(){return window.getSelection?window.getSelection().toString():document.selection&&"Control"!=document.selection.type?document.selection.createRange().text:0}function n(e,t,o){d.type=o&&i?"stepped":"stepless",d.scrollAmount=10,j(r,e,t,"mcsLinearOut",o?60:null)}var i,r=e(this),l=r.data(a),s=l.opt,d=l.sequential,u=a+"_"+l.idx,f=e("#mCSB_"+l.idx+"_container"),h=f.parent();f.bind("mousedown."+u,function(){t||i||(i=1,c=!0)}).add(document).bind("mousemove."+u,function(e){if(!t&&i&&o()){var a=f.offset(),r=O(e)[0]-a.top+f[0].offsetTop,c=O(e)[1]-a.left+f[0].offsetLeft;r>0&&r0&&cr?n("on",38):r>h.height()&&n("on",40)),"y"!==s.axis&&l.overflowed[1]&&(0>c?n("on",37):c>h.width()&&n("on",39)))}}).bind("mouseup."+u+" dragend."+u,function(){t||(i&&(i=0,n("off",null)),c=!1)})},W=function(){function t(t,a){if(Q(o),!z(o,t.target)){var r="auto"!==i.mouseWheel.deltaFactor?parseInt(i.mouseWheel.deltaFactor):s&&t.deltaFactor<100?100:t.deltaFactor||100,d=i.scrollInertia;if("x"===i.axis||"x"===i.mouseWheel.axis)var u="x",f=[Math.round(r*n.scrollRatio.x),parseInt(i.mouseWheel.scrollAmount)],h="auto"!==i.mouseWheel.scrollAmount?f[1]:f[0]>=l.width()?.9*l.width():f[0],m=Math.abs(e("#mCSB_"+n.idx+"_container")[0].offsetLeft),p=c[1][0].offsetLeft,g=c[1].parent().width()-c[1].width(),v="y"===i.mouseWheel.axis?t.deltaY||a:t.deltaX;else var u="y",f=[Math.round(r*n.scrollRatio.y),parseInt(i.mouseWheel.scrollAmount)],h="auto"!==i.mouseWheel.scrollAmount?f[1]:f[0]>=l.height()?.9*l.height():f[0],m=Math.abs(e("#mCSB_"+n.idx+"_container")[0].offsetTop),p=c[0][0].offsetTop,g=c[0].parent().height()-c[0].height(),v=t.deltaY||a;"y"===u&&!n.overflowed[0]||"x"===u&&!n.overflowed[1]||((i.mouseWheel.invert||t.webkitDirectionInvertedFromDevice)&&(v=-v),i.mouseWheel.normalizeDelta&&(v=0>v?-1:1),(v>0&&0!==p||0>v&&p!==g||i.mouseWheel.preventDefault)&&(t.stopImmediatePropagation(),t.preventDefault()),t.deltaFactor<5&&!i.mouseWheel.normalizeDelta&&(h=t.deltaFactor,d=17),G(o,(m-v*h).toString(),{dir:u,dur:d}))}}if(e(this).data(a)){var o=e(this),n=o.data(a),i=n.opt,r=a+"_"+n.idx,l=e("#mCSB_"+n.idx),c=[e("#mCSB_"+n.idx+"_dragger_vertical"),e("#mCSB_"+n.idx+"_dragger_horizontal")],d=e("#mCSB_"+n.idx+"_container").find("iframe");d.length&&d.each(function(){e(this).bind("load",function(){A(this)&&e(this.contentDocument||this.contentWindow.document).bind("mousewheel."+r,function(e,o){t(e,o)})})}),l.bind("mousewheel."+r,function(e,o){t(e,o)})}},R=new Object,A=function(t){var o=!1,a=!1,n=null;if(void 0===t?a="#empty":void 0!==e(t).attr("id")&&(a=e(t).attr("id")),a!==!1&&void 0!==R[a])return R[a];if(t){try{var i=t.contentDocument||t.contentWindow.document;n=i.body.innerHTML}catch(r){}o=null!==n}else{try{var i=top.document;n=i.body.innerHTML}catch(r){}o=null!==n}return a!==!1&&(R[a]=o),o},L=function(e){var t=this.find("iframe");if(t.length){var o=e?"auto":"none";t.css("pointer-events",o)}},z=function(t,o){var n=o.nodeName.toLowerCase(),i=t.data(a).opt.mouseWheel.disableOver,r=["select","textarea"];return e.inArray(n,i)>-1&&!(e.inArray(n,r)>-1&&!e(o).is(":focus"))},P=function(){var t,o=e(this),n=o.data(a),i=a+"_"+n.idx,r=e("#mCSB_"+n.idx+"_container"),l=r.parent(),s=e(".mCSB_"+n.idx+"_scrollbar ."+d[12]);s.bind("mousedown."+i+" touchstart."+i+" pointerdown."+i+" MSPointerDown."+i,function(o){c=!0,e(o.target).hasClass("mCSB_dragger")||(t=1)}).bind("touchend."+i+" pointerup."+i+" MSPointerUp."+i,function(){c=!1}).bind("click."+i,function(a){if(t&&(t=0,e(a.target).hasClass(d[12])||e(a.target).hasClass("mCSB_draggerRail"))){Q(o);var i=e(this),s=i.find(".mCSB_dragger");if(i.parent(".mCSB_scrollTools_horizontal").length>0){if(!n.overflowed[1])return;var c="x",u=a.pageX>s.offset().left?-1:1,f=Math.abs(r[0].offsetLeft)-u*(.9*l.width())}else{if(!n.overflowed[0])return;var c="y",u=a.pageY>s.offset().top?-1:1,f=Math.abs(r[0].offsetTop)-u*(.9*l.height())}G(o,f.toString(),{dir:c,scrollEasing:"mcsEaseInOut"})}})},H=function(){var t=e(this),o=t.data(a),n=o.opt,i=a+"_"+o.idx,r=e("#mCSB_"+o.idx+"_container"),l=r.parent();r.bind("focusin."+i,function(){var o=e(document.activeElement),a=r.find(".mCustomScrollBox").length,i=0;o.is(n.advanced.autoScrollOnFocus)&&(Q(t),clearTimeout(t[0]._focusTimeout),t[0]._focusTimer=a?(i+17)*a:0,t[0]._focusTimeout=setTimeout(function(){var e=[ae(o)[0],ae(o)[1]],a=[r[0].offsetTop,r[0].offsetLeft],s=[a[0]+e[0]>=0&&a[0]+e[0]=0&&a[0]+e[1]a");s.bind("contextmenu."+r,function(e){e.preventDefault()}).bind("mousedown."+r+" touchstart."+r+" pointerdown."+r+" MSPointerDown."+r+" mouseup."+r+" touchend."+r+" pointerup."+r+" MSPointerUp."+r+" mouseout."+r+" pointerout."+r+" MSPointerOut."+r+" click."+r,function(a){function r(e,o){i.scrollAmount=n.scrollButtons.scrollAmount,j(t,e,o)}if(a.preventDefault(),ee(a)){var l=e(this).attr("class");switch(i.type=n.scrollButtons.scrollType,a.type){case"mousedown":case"touchstart":case"pointerdown":case"MSPointerDown":if("stepped"===i.type)return;c=!0,o.tweenRunning=!1,r("on",l);break;case"mouseup":case"touchend":case"pointerup":case"MSPointerUp":case"mouseout":case"pointerout":case"MSPointerOut":if("stepped"===i.type)return;c=!1,i.dir&&r("off",l);break;case"click":if("stepped"!==i.type||o.tweenRunning)return;r("on",l)}}})},q=function(){function t(t){function a(e,t){r.type=i.keyboard.scrollType,r.scrollAmount=i.keyboard.scrollAmount,"stepped"===r.type&&n.tweenRunning||j(o,e,t)}switch(t.type){case"blur":n.tweenRunning&&r.dir&&a("off",null);break;case"keydown":case"keyup":var l=t.keyCode?t.keyCode:t.which,s="on";if("x"!==i.axis&&(38===l||40===l)||"y"!==i.axis&&(37===l||39===l)){if((38===l||40===l)&&!n.overflowed[0]||(37===l||39===l)&&!n.overflowed[1])return;"keyup"===t.type&&(s="off"),e(document.activeElement).is(u)||(t.preventDefault(),t.stopImmediatePropagation(),a(s,l))}else if(33===l||34===l){if((n.overflowed[0]||n.overflowed[1])&&(t.preventDefault(),t.stopImmediatePropagation()),"keyup"===t.type){Q(o);var f=34===l?-1:1;if("x"===i.axis||"yx"===i.axis&&n.overflowed[1]&&!n.overflowed[0])var h="x",m=Math.abs(c[0].offsetLeft)-f*(.9*d.width());else var h="y",m=Math.abs(c[0].offsetTop)-f*(.9*d.height());G(o,m.toString(),{dir:h,scrollEasing:"mcsEaseInOut"})}}else if((35===l||36===l)&&!e(document.activeElement).is(u)&&((n.overflowed[0]||n.overflowed[1])&&(t.preventDefault(),t.stopImmediatePropagation()),"keyup"===t.type)){if("x"===i.axis||"yx"===i.axis&&n.overflowed[1]&&!n.overflowed[0])var h="x",m=35===l?Math.abs(d.width()-c.outerWidth(!1)):0;else var h="y",m=35===l?Math.abs(d.height()-c.outerHeight(!1)):0;G(o,m.toString(),{dir:h,scrollEasing:"mcsEaseInOut"})}}}var o=e(this),n=o.data(a),i=n.opt,r=n.sequential,l=a+"_"+n.idx,s=e("#mCSB_"+n.idx),c=e("#mCSB_"+n.idx+"_container"),d=c.parent(),u="input,textarea,select,datalist,keygen,[contenteditable='true']",f=c.find("iframe"),h=["blur."+l+" keydown."+l+" keyup."+l];f.length&&f.each(function(){e(this).bind("load",function(){A(this)&&e(this.contentDocument||this.contentWindow.document).bind(h[0],function(e){t(e)})})}),s.attr("tabindex","0").bind(h[0],function(e){t(e)})},j=function(t,o,n,i,r){function l(e){u.snapAmount&&(f.scrollAmount=u.snapAmount instanceof Array?"x"===f.dir[0]?u.snapAmount[1]:u.snapAmount[0]:u.snapAmount);var o="stepped"!==f.type,a=r?r:e?o?p/1.5:g:1e3/60,n=e?o?7.5:40:2.5,s=[Math.abs(h[0].offsetTop),Math.abs(h[0].offsetLeft)],d=[c.scrollRatio.y>10?10:c.scrollRatio.y,c.scrollRatio.x>10?10:c.scrollRatio.x],m="x"===f.dir[0]?s[1]+f.dir[1]*(d[1]*n):s[0]+f.dir[1]*(d[0]*n),v="x"===f.dir[0]?s[1]+f.dir[1]*parseInt(f.scrollAmount):s[0]+f.dir[1]*parseInt(f.scrollAmount),x="auto"!==f.scrollAmount?v:m,_=i?i:e?o?"mcsLinearOut":"mcsEaseInOut":"mcsLinear",w=!!e;return e&&17>a&&(x="x"===f.dir[0]?s[1]:s[0]),G(t,x.toString(),{dir:f.dir[0],scrollEasing:_,dur:a,onComplete:w}),e?void(f.dir=!1):(clearTimeout(f.step),void(f.step=setTimeout(function(){l()},a)))}function s(){clearTimeout(f.step),$(f,"step"),Q(t)}var c=t.data(a),u=c.opt,f=c.sequential,h=e("#mCSB_"+c.idx+"_container"),m="stepped"===f.type,p=u.scrollInertia<26?26:u.scrollInertia,g=u.scrollInertia<1?17:u.scrollInertia;switch(o){case"on":if(f.dir=[n===d[16]||n===d[15]||39===n||37===n?"x":"y",n===d[13]||n===d[15]||38===n||37===n?-1:1],Q(t),oe(n)&&"stepped"===f.type)return;l(m);break;case"off":s(),(m||c.tweenRunning&&f.dir)&&l(!0)}},Y=function(t){var o=e(this).data(a).opt,n=[];return"function"==typeof t&&(t=t()),t instanceof Array?n=t.length>1?[t[0],t[1]]:"x"===o.axis?[null,t[0]]:[t[0],null]:(n[0]=t.y?t.y:t.x||"x"===o.axis?null:t,n[1]=t.x?t.x:t.y||"y"===o.axis?null:t),"function"==typeof n[0]&&(n[0]=n[0]()),"function"==typeof n[1]&&(n[1]=n[1]()),n},X=function(t,o){if(null!=t&&"undefined"!=typeof t){var n=e(this),i=n.data(a),r=i.opt,l=e("#mCSB_"+i.idx+"_container"),s=l.parent(),c=typeof t;o||(o="x"===r.axis?"x":"y");var d="x"===o?l.outerWidth(!1)-s.width():l.outerHeight(!1)-s.height(),f="x"===o?l[0].offsetLeft:l[0].offsetTop,h="x"===o?"left":"top";switch(c){case"function":return t();case"object":var m=t.jquery?t:e(t);if(!m.length)return;return"x"===o?ae(m)[1]:ae(m)[0];case"string":case"number":if(oe(t))return Math.abs(t);if(-1!==t.indexOf("%"))return Math.abs(d*parseInt(t)/100);if(-1!==t.indexOf("-="))return Math.abs(f-parseInt(t.split("-=")[1]));if(-1!==t.indexOf("+=")){var p=f+parseInt(t.split("+=")[1]);return p>=0?0:Math.abs(p)}if(-1!==t.indexOf("px")&&oe(t.split("px")[0]))return Math.abs(t.split("px")[0]);if("top"===t||"left"===t)return 0;if("bottom"===t)return Math.abs(s.height()-l.outerHeight(!1));if("right"===t)return Math.abs(s.width()-l.outerWidth(!1));if("first"===t||"last"===t){var m=l.find(":"+t);return"x"===o?ae(m)[1]:ae(m)[0]}return e(t).length?"x"===o?ae(e(t))[1]:ae(e(t))[0]:(l.css(h,t),void u.update.call(null,n[0]))}}},N=function(t){function o(){return clearTimeout(f[0].autoUpdate),0===l.parents("html").length?void(l=null):void(f[0].autoUpdate=setTimeout(function(){return c.advanced.updateOnSelectorChange&&(s.poll.change.n=i(),s.poll.change.n!==s.poll.change.o)?(s.poll.change.o=s.poll.change.n,void r(3)):c.advanced.updateOnContentResize&&(s.poll.size.n=l[0].scrollHeight+l[0].scrollWidth+f[0].offsetHeight+l[0].offsetHeight+l[0].offsetWidth,s.poll.size.n!==s.poll.size.o)?(s.poll.size.o=s.poll.size.n,void r(1)):!c.advanced.updateOnImageLoad||"auto"===c.advanced.updateOnImageLoad&&"y"===c.axis||(s.poll.img.n=f.find("img").length,s.poll.img.n===s.poll.img.o)?void((c.advanced.updateOnSelectorChange||c.advanced.updateOnContentResize||c.advanced.updateOnImageLoad)&&o()):(s.poll.img.o=s.poll.img.n,void f.find("img").each(function(){n(this)}))},c.advanced.autoUpdateTimeout))}function n(t){function o(e,t){return function(){ return t.apply(e,arguments)}}function a(){this.onload=null,e(t).addClass(d[2]),r(2)}if(e(t).hasClass(d[2]))return void r();var n=new Image;n.onload=o(n,a),n.src=t.src}function i(){c.advanced.updateOnSelectorChange===!0&&(c.advanced.updateOnSelectorChange="*");var e=0,t=f.find(c.advanced.updateOnSelectorChange);return c.advanced.updateOnSelectorChange&&t.length>0&&t.each(function(){e+=this.offsetHeight+this.offsetWidth}),e}function r(e){clearTimeout(f[0].autoUpdate),u.update.call(null,l[0],e)}var l=e(this),s=l.data(a),c=s.opt,f=e("#mCSB_"+s.idx+"_container");return t?(clearTimeout(f[0].autoUpdate),void $(f[0],"autoUpdate")):void o()},V=function(e,t,o){return Math.round(e/t)*t-o},Q=function(t){var o=t.data(a),n=e("#mCSB_"+o.idx+"_container,#mCSB_"+o.idx+"_container_wrapper,#mCSB_"+o.idx+"_dragger_vertical,#mCSB_"+o.idx+"_dragger_horizontal");n.each(function(){Z.call(this)})},G=function(t,o,n){function i(e){return s&&c.callbacks[e]&&"function"==typeof c.callbacks[e]}function r(){return[c.callbacks.alwaysTriggerOffsets||w>=S[0]+y,c.callbacks.alwaysTriggerOffsets||-B>=w]}function l(){var e=[h[0].offsetTop,h[0].offsetLeft],o=[x[0].offsetTop,x[0].offsetLeft],a=[h.outerHeight(!1),h.outerWidth(!1)],i=[f.height(),f.width()];t[0].mcs={content:h,top:e[0],left:e[1],draggerTop:o[0],draggerLeft:o[1],topPct:Math.round(100*Math.abs(e[0])/(Math.abs(a[0])-i[0])),leftPct:Math.round(100*Math.abs(e[1])/(Math.abs(a[1])-i[1])),direction:n.dir}}var s=t.data(a),c=s.opt,d={trigger:"internal",dir:"y",scrollEasing:"mcsEaseOut",drag:!1,dur:c.scrollInertia,overwrite:"all",callbacks:!0,onStart:!0,onUpdate:!0,onComplete:!0},n=e.extend(d,n),u=[n.dur,n.drag?0:n.dur],f=e("#mCSB_"+s.idx),h=e("#mCSB_"+s.idx+"_container"),m=h.parent(),p=c.callbacks.onTotalScrollOffset?Y.call(t,c.callbacks.onTotalScrollOffset):[0,0],g=c.callbacks.onTotalScrollBackOffset?Y.call(t,c.callbacks.onTotalScrollBackOffset):[0,0];if(s.trigger=n.trigger,0===m.scrollTop()&&0===m.scrollLeft()||(e(".mCSB_"+s.idx+"_scrollbar").css("visibility","visible"),m.scrollTop(0).scrollLeft(0)),"_resetY"!==o||s.contentReset.y||(i("onOverflowYNone")&&c.callbacks.onOverflowYNone.call(t[0]),s.contentReset.y=1),"_resetX"!==o||s.contentReset.x||(i("onOverflowXNone")&&c.callbacks.onOverflowXNone.call(t[0]),s.contentReset.x=1),"_resetY"!==o&&"_resetX"!==o){if(!s.contentReset.y&&t[0].mcs||!s.overflowed[0]||(i("onOverflowY")&&c.callbacks.onOverflowY.call(t[0]),s.contentReset.x=null),!s.contentReset.x&&t[0].mcs||!s.overflowed[1]||(i("onOverflowX")&&c.callbacks.onOverflowX.call(t[0]),s.contentReset.x=null),c.snapAmount){var v=c.snapAmount instanceof Array?"x"===n.dir?c.snapAmount[1]:c.snapAmount[0]:c.snapAmount;o=V(o,v,c.snapOffset)}switch(n.dir){case"x":var x=e("#mCSB_"+s.idx+"_dragger_horizontal"),_="left",w=h[0].offsetLeft,S=[f.width()-h.outerWidth(!1),x.parent().width()-x.width()],b=[o,0===o?0:o/s.scrollRatio.x],y=p[1],B=g[1],T=y>0?y/s.scrollRatio.x:0,k=B>0?B/s.scrollRatio.x:0;break;case"y":var x=e("#mCSB_"+s.idx+"_dragger_vertical"),_="top",w=h[0].offsetTop,S=[f.height()-h.outerHeight(!1),x.parent().height()-x.height()],b=[o,0===o?0:o/s.scrollRatio.y],y=p[0],B=g[0],T=y>0?y/s.scrollRatio.y:0,k=B>0?B/s.scrollRatio.y:0}b[1]<0||0===b[0]&&0===b[1]?b=[0,0]:b[1]>=S[1]?b=[S[0],S[1]]:b[0]=-b[0],t[0].mcs||(l(),i("onInit")&&c.callbacks.onInit.call(t[0])),clearTimeout(h[0].onCompleteTimeout),J(x[0],_,Math.round(b[1]),u[1],n.scrollEasing),!s.tweenRunning&&(0===w&&b[0]>=0||w===S[0]&&b[0]<=S[0])||J(h[0],_,Math.round(b[0]),u[0],n.scrollEasing,n.overwrite,{onStart:function(){n.callbacks&&n.onStart&&!s.tweenRunning&&(i("onScrollStart")&&(l(),c.callbacks.onScrollStart.call(t[0])),s.tweenRunning=!0,C(x),s.cbOffsets=r())},onUpdate:function(){n.callbacks&&n.onUpdate&&i("whileScrolling")&&(l(),c.callbacks.whileScrolling.call(t[0]))},onComplete:function(){if(n.callbacks&&n.onComplete){"yx"===c.axis&&clearTimeout(h[0].onCompleteTimeout);var e=h[0].idleTimer||0;h[0].onCompleteTimeout=setTimeout(function(){i("onScroll")&&(l(),c.callbacks.onScroll.call(t[0])),i("onTotalScroll")&&b[1]>=S[1]-T&&s.cbOffsets[0]&&(l(),c.callbacks.onTotalScroll.call(t[0])),i("onTotalScrollBack")&&b[1]<=k&&s.cbOffsets[1]&&(l(),c.callbacks.onTotalScrollBack.call(t[0])),s.tweenRunning=!1,h[0].idleTimer=0,C(x,"hide")},e)}}})}},J=function(e,t,o,a,n,i,r){function l(){S.stop||(x||m.call(),x=K()-v,s(),x>=S.time&&(S.time=x>S.time?x+f-(x-S.time):x+f-1,S.time0?(S.currVal=u(S.time,_,b,a,n),w[t]=Math.round(S.currVal)+"px"):w[t]=o+"px",p.call()}function c(){f=1e3/60,S.time=x+f,h=window.requestAnimationFrame?window.requestAnimationFrame:function(e){return s(),setTimeout(e,.01)},S.id=h(l)}function d(){null!=S.id&&(window.requestAnimationFrame?window.cancelAnimationFrame(S.id):clearTimeout(S.id),S.id=null)}function u(e,t,o,a,n){switch(n){case"linear":case"mcsLinear":return o*e/a+t;case"mcsLinearOut":return e/=a,e--,o*Math.sqrt(1-e*e)+t;case"easeInOutSmooth":return e/=a/2,1>e?o/2*e*e+t:(e--,-o/2*(e*(e-2)-1)+t);case"easeInOutStrong":return e/=a/2,1>e?o/2*Math.pow(2,10*(e-1))+t:(e--,o/2*(-Math.pow(2,-10*e)+2)+t);case"easeInOut":case"mcsEaseInOut":return e/=a/2,1>e?o/2*e*e*e+t:(e-=2,o/2*(e*e*e+2)+t);case"easeOutSmooth":return e/=a,e--,-o*(e*e*e*e-1)+t;case"easeOutStrong":return o*(-Math.pow(2,-10*e/a)+1)+t;case"easeOut":case"mcsEaseOut":default:var i=(e/=a)*e,r=i*e;return t+o*(.499999999999997*r*i+-2.5*i*i+5.5*r+-6.5*i+4*e)}}e._mTween||(e._mTween={top:{},left:{}});var f,h,r=r||{},m=r.onStart||function(){},p=r.onUpdate||function(){},g=r.onComplete||function(){},v=K(),x=0,_=e.offsetTop,w=e.style,S=e._mTween[t];"left"===t&&(_=e.offsetLeft);var b=o-_;S.stop=0,"none"!==i&&d(),c()},K=function(){return window.performance&&window.performance.now?window.performance.now():window.performance&&window.performance.webkitNow?window.performance.webkitNow():Date.now?Date.now():(new Date).getTime()},Z=function(){var e=this;e._mTween||(e._mTween={top:{},left:{}});for(var t=["top","left"],o=0;o=0&&a[0]+ae(n)[0]=0&&a[1]+ae(n)[1]=0&&r[1]-i[1]*l[1][0]<0&&r[1]+n[1]-i[1]*l[1][1]>=0},mcsOverflow:e.expr[":"].mcsOverflow||function(t){var o=e(t).data(a);if(o)return o.overflowed[0]||o.overflowed[1]}})})})}); /*! * InertiaPlugin 3.6.1 * https://greensock.com * * @license Copyright 2021, GreenSock. All rights reserved. * Subject to the terms at https://greensock.com/standard-license or for Club GreenSock members, the agreement issued with that membership. * @author: Jack Doyle, jack@greensock.com */ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t=t||self).window=t.window||{})}(this,function(e){"use strict";function m(){return n||"undefined"!=typeof window&&(n=window.gsap)}function p(t){return s(t).id}function q(t){return f[p("string"==typeof t?g(t)[0]:t)]}function r(t){var e,n=o;if(.05<=t-c)for(c=t;n;)((e=n.g(n.t,n.p))!==n.v1||.2+c.max+1e-10?(d=c.unitFactor||P.unitFactors[a]||1,(p=f>c.max&&c.min!==c.max||-15p&&(w||c.preventOvershoot?l=c.min-s:g=c.min-s-l)),this._props.push(a),this._pt=new F(this._pt,t,a,s,0,U,0,h.set(t,a,this)),this._pt.u=u||0,this._pt.c1=l,this._pt.c2=g);return n.duration(_),j},render:function render(t,e){var n=e._pt;for(t=w(e.tween._time/e.tween._dur);n;)n.set(n.t,n.p,Y(n.s+n.c1*t+n.c2*t*t)+n.u,n.d,t),n=n._next}};"track,untrack,isTracking,getVelocity,getByTarget".split(",").forEach(function(t){return D[t]=h[t]}),J()&&v.registerPlugin(D),e.InertiaPlugin=D,e.VelocityTracker=h,e.default=D;if (typeof(window)==="undefined"||window!==e){Object.defineProperty(e,"__esModule",{value:!0})} else {delete e.default}}); /*! * ScrollToPlugin 3.6.1 * https://greensock.com * * @license Copyright 2021, GreenSock. All rights reserved. * Subject to the terms at https://greensock.com/standard-license or for Club GreenSock members, the agreement issued with that membership. * @author: Jack Doyle, jack@greensock.com */ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t=t||self).window=t.window||{})}(this,function(e){"use strict";function k(){return"undefined"!=typeof window}function l(){return i||k()&&(i=window.gsap)&&i.registerPlugin&&i}function m(t){return"string"==typeof t}function n(t){return"function"==typeof t}function o(t,e){var o="x"===e?"Width":"Height",n="scroll"+o,r="client"+o;return t===x||t===u||t===c?Math.max(u[n],c[n])-(x["inner"+o]||u[r]||c[r]):t[n]-t["offset"+o]}function p(t,e){var o="scroll"+("x"===e?"Left":"Top");return t===x&&(null!=t.pageXOffset?o="page"+e.toUpperCase()+"Offset":t=null!=u[o]?u:c),function(){return t[o]}}function r(t,e){if(!(t=a(t)[0])||!t.getBoundingClientRect)return console.warn("scrollTo target doesn't exist. Using 0")||{x:0,y:0};var o=t.getBoundingClientRect(),n=!e||e===x||e===c,r=n?{top:u.clientTop-(x.pageYOffset||u.scrollTop||c.scrollTop||0),left:u.clientLeft-(x.pageXOffset||u.scrollLeft||c.scrollLeft||0)}:e.getBoundingClientRect(),i={x:o.left-r.left,y:o.top-r.top};return!n&&e&&(i.x+=p(e,"x")(),i.y+=p(e,"y")()),i}function s(t,e,n,i,l){return isNaN(t)||"object"==typeof t?m(t)&&"="===t.charAt(1)?parseFloat(t.substr(2))*("-"===t.charAt(0)?-1:1)+i-l:"max"===t?o(e,n)-l:Math.min(o(e,n),r(t,e)[n]-l):parseFloat(t)-l}function t(){i=l(),k()&&i&&document.body&&(x=window,c=document.body,u=document.documentElement,a=i.utils.toArray,i.config({autoKillThreshold:7}),g=i.config(),f=1)}var i,f,x,u,c,a,g,y={version:"3.6.1",name:"scrollTo",rawVars:1,register:function register(e){i=e,t()},init:function init(e,o,r,i,l){f||t();var u=this;u.isWin=e===x,u.target=e,u.tween=r,o=function _clean(t,e,o,r){if(n(t)&&(t=t(e,o,r)),"object"!=typeof t)return m(t)&&"max"!==t&&"="!==t.charAt(1)?{x:t,y:t}:{y:t};if(t.nodeType)return{y:t,x:t};var i,l={};for(i in t)l[i]="onAutoKill"!==i&&n(t[i])?t[i](e,o,r):t[i];return l}(o,i,e,l),u.vars=o,u.autoKill=!!o.autoKill,u.getX=p(e,"x"),u.getY=p(e,"y"),u.x=u.xPrev=u.getX(),u.y=u.yPrev=u.getY(),null!=o.x?(u.add(u,"x",u.x,s(o.x,e,"x",u.x,o.offsetX||0),i,l),u._props.push("scrollTo_x")):u.skipX=1,null!=o.y?(u.add(u,"y",u.y,s(o.y,e,"y",u.y,o.offsetY||0),i,l),u._props.push("scrollTo_y")):u.skipY=1},render:function render(t,e){for(var n,r,i,l,s,u=e._pt,f=e.target,p=e.tween,c=e.autoKill,a=e.xPrev,y=e.yPrev,d=e.isWin;u;)u.r(t,u.d),u=u._next;n=d||!e.skipX?e.getX():a,i=(r=d||!e.skipY?e.getY():y)-y,l=n-a,s=g.autoKillThreshold,e.x<0&&(e.x=0),e.y<0&&(e.y=0),c&&(!e.skipX&&(sr&&(n*=t/100),e=e.substr(0,r-1)),e=n+(e in w?w[e]*t:~e.indexOf("%")?parseFloat(e)*t/100:parseFloat(e)||0)}return e}function Ia(e,t,r,n,o,i,a){var s=o.startColor,l=o.endColor,c=o.fontSize,f=o.indent,u=o.fontWeight,p=_e.createElement("div"),d=N(r)||"fixed"===O(r,"pinType"),g=-1!==e.indexOf("scroller"),h=d?Pe:r,v=-1!==e.indexOf("start"),m=v?s:l,b="border-color:"+m+";font-size:"+c+";color:"+m+";font-weight:"+u+";pointer-events:none;white-space:nowrap;font-family:sans-serif,Arial;z-index:1000;padding:4px 8px;border-width:0;border-style:solid;";return b+="position:"+(g&&d?"fixed;":"absolute;"),!g&&d||(b+=(n===ot?x:y)+":"+(i+parseFloat(f))+"px;"),a&&(b+="box-sizing:border-box;text-align:left;width:"+a.offsetWidth+"px;"),p._isStart=v,p.setAttribute("class","gsap-marker-"+e),p.style.cssText=b,p.innerText=t||0===t?e+"-"+t:e,h.children[0]?h.insertBefore(p,h.children[0]):h.appendChild(p),p._offset=p["offset"+n.op.d2],C(p,0,n,v),p}function Ma(){return l=l||s(D)}function Na(){l||(l=s(D),Xe||E("scrollStart"),Xe=He())}function Oa(){return!Le&&!r&&!_e.fullscreenElement&&a.restart(!0)}function Ua(e){var t,r=Se.ticker.frame,n=[],o=0;if(g!==r||De){for(z();o=e)return n[r];return n.pop()}for(r=n.length,e+=1e-4;r--;)if(n[r]<=e)return n[r];return n[0]}}(C):Se.utils.snap(de.snapTo),p=de.duration||{min:.1,max:2},p=Y(p)?Ne(p.min,p.max):Ne(p,p),y=Se.delayedCall(de.delay||o/2||.1,function(){if(Math.abs(Ce.getVelocity())<10&&!Ae){var e=C&&!he?C.totalProgress():Ce.progress,t=(e-x)/(He()-Ie)*1e3||0,r=Ze(t/2)*t/.185,n=e+(!1===de.inertia?0:r),o=Ne(0,1,u(n,Ce)),i=Ce.scroll(),a=Math.round(k+o*U),s=de.onStart,l=de.onInterrupt,c=de.onComplete,f=d.tween;if(i<=E&&k<=i&&a!==i){if(f&&!f._initted&&f.data<=Math.abs(a-i))return;d(a,{duration:p(Ze(.185*Math.max(Ze(n-e),Ze(o-e))/t/.05||0)),ease:de.ease||"power3",data:Math.abs(a-i),onInterrupt:function onInterrupt(){return y.restart(!0)&&l&&l(Ce)},onComplete:function onComplete(){b=x=C&&!he?C.totalProgress():Ce.progress,ue&&ue(Ce),c&&c(Ce)}},i,r*U,a-i-r*U),s&&s(Ce,d.tween)}}else Ce.isActive&&y.restart(!0)}).pause()),i&&(ct[i]=Ce),ae=Ce.trigger=Ee(ae||se)[0],se=!0===se?ae:Ee(se)[0],V(ne)&&(ne={targets:ae,className:ne}),se&&(!1===le||le===et||(le=!(!le&&"flex"===ta(se.parentNode).display)&&Ge),Ce.pin=se,!1!==w.force3D&&Se.set(se,{force3D:!0}),(n=Se.core.getCache(se)).spacer?B=n.pinState:(n.spacer=F=_e.createElement("div"),F.setAttribute("class","pin-spacer"+(i?" pin-spacer-"+i:"")),n.pinState=B=ib(se)),Ce.spacer=F=n.spacer,r=ta(se),h=r[le+te.os2],H=Se.getProperty(se),g=Se.quickSetter(se,te.a,rt),fb(se,F,r),D=ib(se)),c&&(e=Y(c)?va(c,at):at,A=Ia("scroller-start",i,ve,te,e,0),z=Ia("scroller-end",i,ve,te,e,0,A),t=A["offset"+te.op.d2],I=Ia("start",i,ve,te,e,t),L=Ia("end",i,ve,te,e,t),be||(function _makePositionable(e){e.style.position="absolute"===ta(e).position?"absolute":"relative"}(me?Pe:ve),Se.set([A,z],{force3D:!0}),v=Se.quickSetter(A,te.a,rt),m=Se.quickSetter(z,te.a,rt))),Ce.revert=function(e){var t=!1!==e||!Ce.enabled,r=Le;t!==S&&(t&&(G=Math.max(Ce.scroll(),Ce.scroll.rec||0),K=Ce.progress,ee=C&&C.progress()),I&&[I,L,A,z].forEach(function(e){return e.style.display=t?"none":"block"}),t&&(Le=1),Ce.update(t),Le=r,se&&(t?function _swapPinOut(e,t,r){if(ut(r),e.parentNode===t){var n=t.parentNode;n&&(n.insertBefore(e,t),n.removeChild(t))}}(se,F,B):ge&&Ce.isActive||fb(se,F,ta(se),$)),S=t)},Ce.refresh=function(e,t){if(!Le&&Ce.enabled||t)if(se&&e&&Xe)Ca(ScrollTrigger,"scrollEnd",Va);else{Le=1,j&&j.pause(),ce&&C&&C.progress(0).invalidate(),S||Ce.revert();for(var r,n,o,i,a,s,l,c,f,u=Te(),p=Oe(),d=T(ve,te),g=0,h=0,v=w.end,m=w.endTrigger||ae,b=w.start||(0!==w.start&&ae?se?"0 0":"0 100%":0),x=ae&&Math.max(0,lt.indexOf(Ce))||0,y=x;y--;)(s=lt[y]).end||s.refresh(0,1)||(Le=1),!(l=s.pin)||l!==ae&&l!==se||s.revert();for(k=lb(b,ae,u,te,Ce.scroll(),I,A,Ce,p,we,be,d)||(se?-.001:0),W(v)&&(v=v(Ce)),V(v)&&!v.indexOf("+=")&&(~v.indexOf(" ")?v=(V(b)?b.split(" ")[0]:"")+v:(g=Ha(v.substr(2),u),v=V(b)?b:k+g,m=ae)),E=Math.max(k,lb(v||(m?"100% 0":d),m,u,te,Ce.scroll()+g,L,z,Ce,p,we,be,d))||-.001,U=E-k||(k-=.01)&&.001,g=0,y=x;y--;)(l=(s=lt[y]).pin)&&s.start-s._pinPush=T(ve,te),ge)if(e||!r&&!o)nb(se,F);else{var u=it(se,!0),p=s-k;nb(se,Pe,u.top+(te===ot?p:0)+rt,u.left+(te===ot?0:p)+rt)}ut(r||o?R:D),q!==U&&c<1&&r||g(Z+(1!==c||o?0:q))}}else g(Z+q*c);!de||d.tween||Le||De||y.restart(!0),ne&&(a||pe&&c&&(c<1||!Re))&&Ee(ne.targets).forEach(function(e){return e.classList[r||pe?"add":"remove"](ne.className)}),!re||he||e||re(Ce),i&&!Le?(n=c&&!f?0:1===c?1:1===f?2:3,he&&(o=!a&&"none"!==ye[n+1]&&ye[n+1]||ye[n],C&&("complete"===o||"reset"===o||o in C)&&("complete"===o?C.pause().totalProgress(1):"reset"===o?C.restart(!0).pause():C[o]()),re&&re(Ce)),!a&&Re||(oe&&a&&oe(Ce),xe[n]&&xe[n](Ce),pe&&(1===c?Ce.kill(!1,1):xe[n]=0),a||xe[n=1===c?1:3]&&xe[n](Ce))):he&&re&&!Le&&re(Ce)}m&&(v(s+(A._isFlipped?1:0)),m(s))},Ce.enable=function(){Ce.enabled||(Ce.enabled=!0,Ca(ve,"resize",Oa),Ca(ve,"scroll",Na),f&&Ca(ScrollTrigger,"refreshInit",f),C&&C.add?Se.delayedCall(.01,function(){return k||E||Ce.refresh()})&&(U=.01)&&(k=E=0):Ce.refresh())},Ce.disable=function(e,t){if(Ce.enabled&&(!1!==e&&Ce.revert(),Ce.enabled=Ce.isActive=!1,t||j&&j.pause(),G=0,n&&(n.uncache=1),f&&Da(ScrollTrigger,"refreshInit",f),y&&(y.pause(),d.tween&&d.tween.kill()&&(d.tween=0)),!me)){for(var r=lt.length;r--;)if(lt[r].scroller===ve&<[r]!==Ce)return;Da(ve,"resize",Oa),Da(ve,"scroll",Na)}},Ce.kill=function(e,t){Ce.disable(e,t),i&&delete ct[i];var r=lt.indexOf(Ce);lt.splice(r,1),r===ze&&0":">")}}function x(D,u,e){var t=D.nodeType;if(1===t||9===t||11===t)for(D=D.firstChild;D;D=D.nextSibling)x(D,u,e);else 3!==t&&4!==t||(D.nodeValue=D.nodeValue.split(u).join(e))}function y(D,u){for(var e=u.length;-1<--e;)D.push(u[e])}function z(D,u,e){for(var t;D&&D!==u;){if(t=D._next||D.nextSibling)return t.textContent.charAt(0)===e;D=D.parentNode||D._parent}}function A(D){var u,e,t=s(D.childNodes),F=t.length;for(u=0;uL&&("BR"!==l.nodeName||0===E)&&(a=[],k.push(a),b=m),G&&(l._x=l.offsetLeft,l._y=m,l._w=l.offsetWidth,l._h=l.offsetHeight),k&&((l._isSplit&&d||!q&&d||P&&d||!P&&l.parentNode.parentNode===D&&!l.parentNode._isSplit)&&(a.push(l),l._x-=_,z(l,D,j)&&(l._wordEnd=!0)),"BR"===l.nodeName&&(l.nextSibling&&"BR"===l.nextSibling.nodeName||0===E)&&k.push([])));for(E=0;ED.clientHeight&&(D.style.height=n-T+"px",D.clientHeightD.clientWidth&&(D.style.width=i-N+"px",D.clientWidth",c=1,g=e.specialChars?"function"==typeof e.specialChars?e.specialChars:u:null,y=X.createElement("div"),m=D.parentNode;for(m.insertBefore(y,D),y.textContent=D.nodeValue,m.removeChild(D),o=-1!==(i=function getText(D){var u=D.nodeType,e="";if(1===u||9===u||11===u){if("string"==typeof D.textContent)return D.textContent;for(D=D.firstChild;D;D=D.nextSibling)e+=getText(D)}else if(3===u||4===u)return D.nodeValue;return e}(D=y)).indexOf("<"),!1!==e.reduceWhiteSpace&&(i=i.replace(b," ").replace(_,"")),o&&(i=i.split("<").join("{{LT}}")),r=i.length,n=(" "===i.charAt(0)?f:"")+F(),E=0;E":l,E+=d-1;else if(l===B&&i.charAt(E-1)!==B&&E){for(n+=c?A:"",c=0;i.charAt(E+1)===B;)n+=f,E++;E===r-1?n+=f:")"!==i.charAt(E+1)&&(n+=f+F(),c=1)}else"{"===l&&"{{LT}}"===i.substr(E,6)?(n+=a?C()+"{{LT}}":"{{LT}}",E+=5):55296<=l.charCodeAt(0)&&l.charCodeAt(0)<=56319||65024<=i.charCodeAt(E+1)&&i.charCodeAt(E+1)<=65039?(s=((i.substr(E,12).split(v)||[])[1]||"").length||2,n+=a&&" "!==l?C()+i.substr(E,s)+"":i.substr(E,s),E+=s-1):n+=a&&" "!==l?C()+l+"":l;D.outerHTML=n+(c?A:""),o&&x(m,"{{LT}}","<")}function E(u,e,F,C){var i,n,r=s(u.childNodes),l=r.length,o=t(e);if(3!==u.nodeType||1o.scrollHeight,a.removeChild(o),B=n,Te=function(e){for(var t=e.split(","),n=(("onpointerdown"in s?"pointerdown,pointermove,pointerup,pointercancel":"onmspointerdown"in s?"MSPointerDown,MSPointerMove,MSPointerUp,MSPointerCancel":e).split(",")),o={},r=4;-1<--r;)o[t[r]]=n[r],o[n[r]]=t[r];try{me.addEventListener("test",null,Object.defineProperty({},"passive",{get:function get(){d=1}}))}catch(e){}return o}("touchstart,touchmove,touchend,touchcancel"),va(ve,"touchcancel",Y),va(xe,"touchmove",Y),l&&l.addEventListener("touchstart",Y),va(ve,"contextmenu",function(){for(var e in Be)Be[e].isPressed&&Be[e].endDrag()}),ge=we=U()}var n,o,r,i,a;ge?(Se=ge.plugins.inertia,c=ge.utils.checkPrefix,O=c(O),_e=c(_e),be=ge.utils.toArray,R=!!c("perspective")):e&&console.warn("Please gsap.registerPlugin(Draggable)")}var ge,xe,ve,me,l,s,ye,we,c,be,d,Me,Te,De,Ee,Xe,Se,Le,Ye,R,B,n,O="transform",_e="transformOrigin",Ce=Array.isArray,ke=180/Math.PI,Ne=1e20,a=new fe,Pe=Date.now||function(){return(new Date).getTime()},Re=[],Be={},Oe=0,o=/^(?:a|input|textarea|button|select)$/i,Ae=0,He={},Ie={},Fe=function _isRoot(e){return!(e&&e!==me&&9!==e.nodeType&&e!==ve.body&&e!==xe&&e.nodeType&&e.parentNode)},p={},We={},A=function _getElementBounds(e,t){t=be(t)[0];var n,o,r,i,a,l,s,c,d,p,u,h,f,g,x=e.getBBox&&e.ownerSVGElement,v=e.ownerDocument||ve;if(e===xe)r=Ba(v),o=(n=Ca(v))+(v.documentElement.clientWidth||e.innerWidth||v.body.clientWidth||0),i=r+((e.innerHeight||0)-20d||l.rightp||l.bottom=l.width*l.height*n:o.width>n&&o.height>n))},Draggable);function Draggable(h,p){var e;e=Ve.call(this)||this,we||Xa(1),h=be(h)[0],Se=Se||ge.plugins.inertia,e.vars=p=na(p||{}),e.target=h,e.x=e.y=e.rotation=0,e.dragResistance=parseFloat(p.dragResistance)||0,e.edgeResistance=isNaN(p.edgeResistance)?1:parseFloat(p.edgeResistance)||0,e.lockAxis=p.lockAxis,e.autoScroll=p.autoScroll||0,e.lockedAxis=null,e.allowEventDefault=!!p.allowEventDefault,ge.getProperty(h,"x");function Jg(e,t){return parseFloat(le.get(h,e,t))}function oh(e){return xa(e),e.stopImmediatePropagation&&e.stopImmediatePropagation(),!1}function ph(e){if(Q.autoScroll&&Q.isDragging&&(ee||k)){var t,n,o,r,i,a,l,s,c=h,d=15*Q.autoScroll;for(ee=!1,Ie.scrollTop=null!=xe.pageYOffset?xe.pageYOffset:null!=ce.documentElement.scrollTop?ce.documentElement.scrollTop:ce.body.scrollTop,Ie.scrollLeft=null!=xe.pageXOffset?xe.pageXOffset:null!=ce.documentElement.scrollLeft?ce.documentElement.scrollLeft:ce.body.scrollLeft,r=Q.pointerX-Ie.scrollLeft,i=Q.pointerY-Ie.scrollTop;c&&!n;)t=(n=Fe(c.parentNode))?Ie:c.parentNode,o=n?{bottom:Math.max(me.clientHeight,xe.innerHeight||0),right:Math.max(me.clientWidth,xe.innerWidth||0),left:0,top:0}:t.getBoundingClientRect(),a=l=0,U&&((s=t._gsMaxScrollY-t.scrollTop)<0?l=s:i>o.bottom-oe&&s?(ee=!0,l=Math.min(s,d*(1-Math.max(0,o.bottom-i)/oe)|0)):io.right-ne&&s?(ee=!0,a=Math.min(s,d*(1-Math.max(0,o.right-r)/ne)|0)):rj?(Q.y=a,M+(T-a)*c):M):(B&&(s=e*B.a+t*B.c+B.e,t=e*B.b+t*B.d+B.f,e=s),(r=t-b)Math.abs(r)?"y":U?"x":null,s&&V(Q.vars.onLockAxis)&&Q.vars.onLockAxis.call(Q,Q.pointerEvent)),"y"===s?r=0:"x"===s&&(o=0)),i=_(M+o*c),a=_(T+r*c)),(N||P||R)&&(Q.x!==i||Q.y!==a&&!z)?(R&&(He.x=i,He.y=a,s=R(He),i=_(s.x),a=_(s.y)),N&&(i=_(N(i))),P&&(a=_(P(a)))):D&&(Ea._gsMaxScrollY&&(a.scrollTop=a._gsMaxScrollY),K&&a.scrollLeft>a._gsMaxScrollX&&(a.scrollLeft=a._gsMaxScrollX),i=a;Q.isThrowing&&(r||Q.endX>E||Q.endXL||Q.endYt._dur||e._start<0))for(var r=t;r;)r._dirty=1,r=r.parent;return t}function wa(t){return t._repeat?gt(t._tTime,t=t.duration()+t._rDelay)*t:0}function ya(t,e){return(t-e._start)*e._ts+(0<=e._ts?0:e._dirty?e.totalDuration():e._tDur)}function za(t){return t._end=ca(t._start+(t._tDur/Math.abs(t._ts||t._rts||j)||0))}function Aa(t,e){var r=t._dp;return r&&r.smoothChildTiming&&t._ts&&(t._start=ca(r._time-(0j)&&e.render(r,!0)),ta(t,e)._dp&&t._initted&&t._time>=t._dur&&t._ts){if(t._dura;)s=s._prev;s?(e._next=s._next,s._next=e):(e._next=t[r],t[r]=e),e._next?e._next._prev=e:t[i]=e,e._prev=s,e.parent=e._dp=t}(t,e,"_first","_last",t._sort?"_start":0),t._recent=e,i||Ba(t,e),t}function Da(t,e){return(ot.ScrollTrigger||N("scrollTrigger",e))&&ot.ScrollTrigger.create(e,t)}function Ea(t,e,r,i){return Nt(t,e),t._initted?!r&&t._pt&&(t._dur&&!1!==t.vars.lazy||!t._dur&&t.vars.lazy)&&f!==Pt.frame?(ht.push(t),t._lazy=[e,i],1):void 0:1}function Ia(t,e,r,i){var n=t._repeat,a=ca(e)||0,s=t._tTime/t._tDur;return s&&!i&&(t._time*=a/t._dur),t._dur=a,t._tDur=n?n<0?1e10:ca(a*(n+1)+t._rDelay*n):a,s&&!i?Aa(t,t._tTime=t._tDur*s):t.parent&&za(t),r||ta(t.parent,t),t}function Ja(t){return t instanceof Bt?ta(t):Ia(t,t._dur)}function La(t,e){var r,i,n=t.labels,a=t._recent||vt,s=t.duration()>=U?a.endTime(!1):t._dur;return o(e)&&(isNaN(e)||e in n)?"<"===(r=e.charAt(0))||">"===r?("<"===r?a._start:a.endTime(0<=a._repeat))+(parseFloat(e.substr(1))||0):(r=e.indexOf("="))<0?(e in n||(n[e]=s),n[e]):(i=+(e.charAt(r-1)+e.substr(r+1)),1(n=Math.abs(n))&&(a=i,o=n);return a}function ib(t){return sa(t),t.scrollTrigger&&t.scrollTrigger.kill(!1),t.progress()<1&&xt(t,"onInterrupt"),t}function nb(t,e,r){return(6*(t=t<0?t+1:1>16,t>>8&Ot,t&Ot]:0:Mt.black;if(!c){if(","===t.substr(-1)&&(t=t.substr(0,t.length-1)),Mt[t])c=Mt[t];else if("#"===t.charAt(0)){if(t.length<6&&(t="#"+(i=t.charAt(1))+i+(n=t.charAt(2))+n+(a=t.charAt(3))+a+(5===t.length?t.charAt(4)+t.charAt(4):"")),9===t.length)return[(c=parseInt(t.substr(1,6),16))>>16,c>>8&Ot,c&Ot,parseInt(t.substr(7),16)/255];c=[(t=parseInt(t.substr(1),16))>>16,t>>8&Ot,t&Ot]}else if("hsl"===t.substr(0,3))if(c=d=t.match(tt),e){if(~t.indexOf("="))return c=t.match(et),r&&c.length<4&&(c[3]=1),c}else s=+c[0]%360/360,o=c[1]/100,i=2*(u=c[2]/100)-(n=u<=.5?u*(o+1):u+o-u*o),3=r&&te)return i;i=i._next}else for(i=t._last;i&&i._start>=r;){if(!i._dur&&"isPause"===i.data&&i._start=n._start)&&n._ts&&h!==n){if(n.parent!==this)return this.render(t,e,r);if(n.render(0=this.totalDuration()||!v&&_)&&(f!==this._start&&Math.abs(l)===Math.abs(this._ts)||this._lock||(!t&&g||!(v===m&&0=i&&(a instanceof Vt?e&&n.push(a):(r&&n.push(a),t&&n.push.apply(n,a.getChildren(!0,e,r)))),a=a._next;return n},e.getById=function getById(t){for(var e=this.getChildren(1,1,1),r=e.length;r--;)if(e[r].vars.id===t)return e[r]},e.remove=function remove(t){return o(t)?this.removeLabel(t):p(t)?this.killTweensOf(t):(ra(this,t),t===this._recent&&(this._recent=this._last),ta(this))},e.totalTime=function totalTime(t,e){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=ca(Pt.time-(0e:!e||a.isActive())&&i.push(a):(r=a.getTweensOf(n,e)).length&&i.push.apply(i,r),a=a._next;return i},e.tweenTo=function tweenTo(t,e){e=e||{};var r=this,i=La(r,t),n=e.startAt,a=e.onStart,s=e.onStartParams,o=e.immediateRender,u=Vt.to(r,ja({ease:e.ease||"none",lazy:!1,immediateRender:!1,time:i,overwrite:"auto",duration:e.duration||Math.abs((i-(n&&"time"in n?n.time:r._time))/r.timeScale())||j,onStart:function onStart(){r.pause();var t=e.duration||Math.abs((i-r._time)/r.timeScale());u._dur!==t&&Ia(u,t,0,1).render(u._time,!0,!0),a&&a.apply(u,s||[])}},e));return o?u.render(0):u},e.tweenFromTo=function tweenFromTo(t,e,r){return this.tweenTo(e,ja({startAt:{time:La(this,t)}},r))},e.recent=function recent(){return this._recent},e.nextLabel=function nextLabel(t){return void 0===t&&(t=this._time),gb(this,La(this,t))},e.previousLabel=function previousLabel(t){return void 0===t&&(t=this._time),gb(this,La(this,t),1)},e.currentLabel=function currentLabel(t){return arguments.length?this.seek(t,!0):this.previousLabel(this._time+j)},e.shiftChildren=function shiftChildren(t,e,r){void 0===r&&(r=0);for(var i,n=this._first,a=this.labels;n;)n._start>=r&&(n._start+=t,n._end+=t),n=n._next;if(e)for(i in a)a[i]>=r&&(a[i]+=t);return ta(this)},e.invalidate=function invalidate(){var t=this._first;for(this._lock=0;t;)t.invalidate(),t=t._next;return n.prototype.invalidate.call(this)},e.clear=function clear(t){void 0===t&&(t=!0);for(var e,r=this._first;r;)e=r._next,this.remove(r),r=e;return this._dp&&(this._time=this._tTime=this._pTime=0),t&&(this.labels={}),ta(this)},e.totalDuration=function totalDuration(t){var e,r,i,n=0,a=this,s=a._last,o=U;if(arguments.length)return a.timeScale((a._repeat<0?a.duration():a.totalDuration())/(a.reversed()?-t:t));if(a._dirty){for(i=a.parent;s;)e=s._prev,s._dirty&&s.totalDuration(),o<(r=s._start)&&a._sort&&s._ts&&!a._lock?(a._lock=1,Ca(a,s,r-s._delay,1)._lock=0):o=r,r<0&&s._ts&&(n-=r,(!i&&!a._dp||i&&i.smoothChildTiming)&&(a._start+=r/a._ts,a._time-=r,a._tTime-=r),a.shiftChildren(-r,!1,-Infinity),o=0),s._end>n&&s._ts&&(n=s._end),s=e;Ia(a,a===F&&a._time>n?a._time:n,1,1),a._dirty=0}return a._tDur},Timeline.updateRoot=function updateRoot(t){if(F._ts&&(ga(F,ya(t,F)),f=Pt.frame),Pt.frame>=ct){ct+=Y.autoSleep||120;var e=F._first;if((!e||!e._ts)&&Y.autoSleep&&Pt._listeners.length<2){for(;e&&!e._ts;)e=e._next;e||Pt.sleep()}}},Timeline}(Ft);ja(Bt.prototype,{_lock:0,_hasPause:0,_forcing:0});function Qb(t,e,r,i,n,a){var u,h,l,f;if(ft[t]&&!1!==(u=new ft[t]).init(n,u.rawVars?e[t]:function _processVars(t,e,r,i,n){if(p(t)&&(t=Ut(t,n,e,r,i)),!s(t)||t.style&&t.nodeType||K(t)||Z(t))return o(t)?Ut(t,n,e,r,i):t;var a,u={};for(a in t)u[a]=Ut(t[a],n,e,r,i);return u}(e[t],i,n,a,r),r,i,a)&&(r._pt=h=new ie(r._pt,n,t,0,1,u.render,u,0,u.priority),r!==d))for(l=r._ptLookup[r._targets.indexOf(n)],f=u._props.length;f--;)l[u._props[f]]=h;return u}var qt,Yt=function _addPropTween(t,e,r,i,n,a,s,u,h){p(i)&&(i=i(n||0,t,a));var l,f=t[e],d="get"!==r?r:p(f)?h?t[e.indexOf("set")||!p(t["get"+e.substr(3)])?e:"get"+e.substr(3)](h):t[e]():f,c=p(f)?h?Jt:Qt:Gt;if(o(i)&&(~i.indexOf("random(")&&(i=db(i)),"="===i.charAt(1)&&(i=parseFloat(d)+parseFloat(i.substr(2))*("-"===i.charAt(0)?-1:1)+(Oa(d)||0))),d!==i)return isNaN(d*i)?(f||e in t||N(e,i),function _addComplexStringPropTween(t,e,r,i,n,a,s){var o,u,h,l,f,d,c,p,_=new ie(this._pt,t,e,0,1,Zt,null,n),m=0,g=0;for(_.b=r,_.e=i,r+="",(c=~(i+="").indexOf("random("))&&(i=db(i)),a&&(a(p=[r,i],t,e),r=p[0],i=p[1]),u=r.match(it)||[];o=it.exec(i);)l=o[0],f=i.substring(m,o.index),h?h=(h+1)%5:"rgba("===f.substr(-5)&&(h=1),l!==u[g++]&&(d=parseFloat(u[g-1])||0,_._pt={_next:_._pt,p:f||1===g?f:",",s:d,c:"="===l.charAt(1)?parseFloat(l.substr(2))*("-"===l.charAt(0)?-1:1):parseFloat(l)-d,m:h&&h<4?Math.round:0},m=it.lastIndex);return _.c=m")});else{if(l=P.length,c=b?Va(b):Q,s(b))for(f in b)~jt.indexOf(f)&&((p=p||{})[f]=b[f]);for(u=0;u=t._tDur||e<0)&&t.ratio===u&&(u&&sa(t,1),r||(xt(t,u?"onComplete":"onReverseComplete",!0),t._prom&&t._prom()))}else t._zTime||(t._zTime=e)}(this,t,e,r);return this},e.targets=function targets(){return this._targets},e.invalidate=function invalidate(){return this._pt=this._op=this._startAt=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(),A.prototype.invalidate.call(this)},e.kill=function kill(t,e){if(void 0===e&&(e="all"),!(t||e&&"all"!==e))return this._lazy=this._pt=0,this.parent?ib(this):this;if(this.timeline){var r=this.timeline.totalDuration();return this.timeline.killTweensOf(t,e,qt&&!0!==qt.vars.overwrite)._first||ib(this),this.parent&&r!==this.timeline.totalDuration()&&Ia(this,this._dur*this.timeline._tDur/r,0,1),this}var i,n,a,s,u,h,l,f=this._targets,d=t?Tt(t):f,c=this._ptLookup,p=this._pt;if((!e||"all"===e)&&function _arraysMatch(t,e){for(var r=t.length,i=r===e.length;i&&r--&&t[r]===e[r];);return r<0}(f,d))return"all"===e&&(this._pt=0),ib(this);for(i=this._op=this._op||[],"all"!==e&&(o(e)&&(u={},ba(e,function(t){return u[t]=1}),e=u),e=function _addAliasesToVars(t,e){var r,i,n,a,s=t[0]?_(t[0]).harness:0,o=s&&s.aliases;if(!o)return e;for(i in r=mt({},e),o)if(i in r)for(n=(a=o[i].split(",")).length;n--;)r[a[n]]=r[i];return r}(f,e)),l=f.length;l--;)if(~d.indexOf(f[l]))for(u in n=c[l],"all"===e?(i[l]=e,s=n,a={}):(a=i[l]=i[l]||{},s=e),s)(h=n&&n[u])&&("kill"in h.d&&!0!==h.d.kill(u)||ra(this,h,"_pt"),delete n[u]),"all"!==a&&(a[u]=1);return this._initted&&!this._pt&&p&&ib(this),this},Tween.to=function to(t,e,r){return new Tween(t,e,r)},Tween.from=function from(t,e){return new Tween(t,ea(arguments,1))},Tween.delayedCall=function delayedCall(t,e,r,i){return new Tween(e,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:t,onComplete:e,onReverseComplete:e,onCompleteParams:r,onReverseCompleteParams:r,callbackScope:i})},Tween.fromTo=function fromTo(t,e,r){return new Tween(t,ea(arguments,2))},Tween.set=function set(t,e){return e.duration=0,e.repeatDelay||(e.repeat=0),new Tween(t,e)},Tween.killTweensOf=function killTweensOf(t,e,r){return F.killTweensOf(t,e,r)},Tween}(Ft);ja(Vt.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0}),ba("staggerTo,staggerFrom,staggerFromTo",function(r){Vt[r]=function(){var t=new Bt,e=bt.call(arguments,0);return e.splice("staggerFromTo"===r?5:4,0,0),t[r].apply(t,e)}});function _b(t,e,r){return t.setAttribute(e,r)}function hc(t,e,r,i){i.mSet(t,e,i.m.call(i.tween,r,i.mt),i)}var Gt=function _setterPlain(t,e,r){return t[e]=r},Qt=function _setterFunc(t,e,r){return t[e](r)},Jt=function _setterFuncWithParam(t,e,r,i){return t[e](i.fp,r)},Wt=function _getSetter(t,e){return p(t[e])?Qt:r(t[e])&&t.setAttribute?_b:Gt},Ht=function _renderPlain(t,e){return e.set(e.t,e.p,Math.round(1e4*(e.s+e.c*t))/1e4,e)},$t=function _renderBoolean(t,e){return e.set(e.t,e.p,!!(e.s+e.c*t),e)},Zt=function _renderComplexString(t,e){var r=e._pt,i="";if(!t&&e.b)i=e.b;else if(1===t&&e.e)i=e.e;else{for(;r;)i=r.p+(r.m?r.m(r.s+r.c*t):Math.round(1e4*(r.s+r.c*t))/1e4)+i,r=r._next;i+=e.c}e.set(e.t,e.p,i,e)},Kt=function _renderPropTweens(t,e){for(var r=e._pt;r;)r.r(t,r.d),r=r._next},te=function _addPluginModifier(t,e,r,i){for(var n,a=this._pt;a;)n=a._next,a.p===i&&a.modifier(t,e,r),a=n},ee=function _killPropTweensOf(t){for(var e,r,i=this._pt;i;)r=i._next,i.p===t&&!i.op||i.op===t?ra(this,i,"_pt"):i.dep||(e=1),i=r;return!e},re=function _sortPropTweensByPriority(t){for(var e,r,i,n,a=t._pt;a;){for(e=a._next,r=i;r&&r.pr>a.pr;)r=r._next;(a._prev=r?r._prev:n)?a._prev._next=a:i=a,(a._next=r)?r._prev=a:n=a,a=e}t._pt=i},ie=(PropTween.prototype.modifier=function modifier(t,e,r){this.mSet=this.mSet||this.set,this.set=hc,this.m=t,this.mt=r,this.tween=e},PropTween);function PropTween(t,e,r,i,n,a,s,o,u){this.t=e,this.s=i,this.c=n,this.p=r,this.r=a||Ht,this.d=s||this,this.set=o||Gt,this.pr=u||0,(this._next=t)&&(t._prev=this)}ba(_t+"parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger",function(t){return ut[t]=1}),ot.TweenMax=ot.TweenLite=Vt,ot.TimelineLite=ot.TimelineMax=Bt,F=new Bt({sortChildren:!1,defaults:B,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0}),Y.stringFilter=tb;var ne={registerPlugin:function registerPlugin(){for(var t=arguments.length,e=new Array(t),r=0;r2&&void 0!==arguments[2]?arguments[2]:0;return qe(t).reduce(function(r,n){return e(r,t[n],n)},r)}function n(t){for(var r=arguments.length,n=Array(r>1?r-1:0),i=1;i0&&void 0!==arguments[0]?arguments[0]:"div",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments[3],i=ye.createElement(t);return Object.getOwnPropertyNames(e).forEach(function(t){var r=e[t];-1!==t.indexOf("aria-")||"role"===t||"type"===t?(Ye.warn(Je(Qe,t,r)),i.setAttribute(t,r)):"textContent"===t?g(i,r):i[t]=r}),Object.getOwnPropertyNames(r).forEach(function(t){i.setAttribute(t,r[t])}),n&&D(i,n),i}function g(t,e){return void 0===t.textContent?t.innerText=e:t.textContent=e,t}function m(t,e){e.firstChild?e.insertBefore(t,e.firstChild):e.appendChild(t)}function _(t,e){return u(e),t.classList?t.classList.contains(e):h(e).test(t.className)}function b(t,e){return t.classList?t.classList.add(e):_(t,e)||(t.className=(t.className+" "+e).trim()),t}function T(t,e){return t.classList?t.classList.remove(e):(u(e),t.className=t.className.split(/\s+/).filter(function(t){return t!==e}).join(" ")),t}function C(t,e,r){var n=_(t,e);if("function"==typeof r&&(r=r(t,e)),"boolean"!=typeof r&&(r=!n),r!==n)return r?b(t,e):T(t,e),t}function k(t,e){Object.getOwnPropertyNames(e).forEach(function(r){var n=e[r];null===n||void 0===n||!1===n?t.removeAttribute(r):t.setAttribute(r,!0===n?"":n)})}function E(t){var e={};if(t&&t.attributes&&t.attributes.length>0)for(var r=t.attributes,n=r.length-1;n>=0;n--){var i=r[n].name,o=r[n].value;"boolean"!=typeof t[i]&&-1===",autoplay,controls,playsinline,loop,muted,default,defaultMuted,".indexOf(","+i+",")||(o=null!==o),e[i]=o}return e}function w(t,e){return t.getAttribute(e)}function S(t,e,r){t.setAttribute(e,r)}function x(t,e){t.removeAttribute(e)}function j(){ye.body.focus(),ye.onselectstart=function(){return!1}}function A(){ye.onselectstart=function(){return!0}}function P(t){if(t&&t.getBoundingClientRect&&t.parentNode){var e=t.getBoundingClientRect(),r={};return["bottom","height","left","right","top","width"].forEach(function(t){void 0!==e[t]&&(r[t]=e[t])}),r.height||(r.height=parseFloat(l(t,"height"))),r.width||(r.width=parseFloat(l(t,"width"))),r}}function O(t){var e=void 0;if(t.getBoundingClientRect&&t.parentNode&&(e=t.getBoundingClientRect()),!e)return{left:0,top:0};var r=ye.documentElement,n=ye.body,i=r.clientLeft||n.clientLeft||0,o=he.pageXOffset||n.scrollLeft,s=e.left+o-i,a=r.clientTop||n.clientTop||0,l=he.pageYOffset||n.scrollTop,c=e.top+l-a;return{left:Math.round(s),top:Math.round(c)}}function M(t,e){var r={},n=O(t),i=t.offsetWidth,o=t.offsetHeight,s=n.top,a=n.left,l=e.pageY,c=e.pageX;return e.changedTouches&&(c=e.changedTouches[0].pageX,l=e.changedTouches[0].pageY),r.y=Math.max(0,Math.min(1,(s-l+o)/o)),r.x=Math.max(0,Math.min(1,(c-a)/i)),r}function N(t){return i(t)&&3===t.nodeType}function I(t){for(;t.firstChild;)t.removeChild(t.firstChild);return t}function L(t){return"function"==typeof t&&(t=t()),(Array.isArray(t)?t:[t]).map(function(t){return"function"==typeof t&&(t=t()),d(t)||N(t)?t:"string"==typeof t&&/\S/.test(t)?ye.createTextNode(t):void 0}).filter(function(t){return t})}function D(t,e){return L(e).forEach(function(e){return t.appendChild(e)}),t}function R(t,e){return D(I(t),e)}function B(t){return void 0===t.button&&void 0===t.buttons||(0===t.button&&void 0===t.buttons||(9===Ie||0===t.button&&1===t.buttons))}function F(){return rr++}function H(t){var e=t[ir];return e||(e=t[ir]=F()),nr[e]||(nr[e]={}),nr[e]}function V(t){var e=t[ir];return!!e&&!!Object.getOwnPropertyNames(nr[e]).length}function z(t){var e=t[ir];if(e){delete nr[e];try{delete t[ir]}catch(e){t.removeAttribute?t.removeAttribute(ir):t[ir]=null}}}function W(t,e){var r=H(t);0===r.handlers[e].length&&(delete r.handlers[e],t.removeEventListener?t.removeEventListener(e,r.dispatcher,!1):t.detachEvent&&t.detachEvent("on"+e,r.dispatcher)),Object.getOwnPropertyNames(r.handlers).length<=0&&(delete r.handlers,delete r.dispatcher,delete r.disabled),0===Object.getOwnPropertyNames(r).length&&z(t)}function U(t,e,r,n){r.forEach(function(r){t(e,r,n)})}function X(t){function e(){return!0}function r(){return!1}if(!t||!t.isPropagationStopped){var n=t||he.event;t={};for(var i in n)"layerX"!==i&&"layerY"!==i&&"keyLocation"!==i&&"webkitMovementX"!==i&&"webkitMovementY"!==i&&("returnValue"===i&&n.preventDefault||(t[i]=n[i]));if(t.target||(t.target=t.srcElement||ye),t.relatedTarget||(t.relatedTarget=t.fromElement===t.target?t.toElement:t.fromElement),t.preventDefault=function(){n.preventDefault&&n.preventDefault(),t.returnValue=!1,n.returnValue=!1,t.defaultPrevented=!0},t.defaultPrevented=!1,t.stopPropagation=function(){n.stopPropagation&&n.stopPropagation(),t.cancelBubble=!0,n.cancelBubble=!0,t.isPropagationStopped=e},t.isPropagationStopped=r,t.stopImmediatePropagation=function(){n.stopImmediatePropagation&&n.stopImmediatePropagation(),t.isImmediatePropagationStopped=e,t.stopPropagation()},t.isImmediatePropagationStopped=r,null!==t.clientX&&void 0!==t.clientX){var o=ye.documentElement,s=ye.body;t.pageX=t.clientX+(o&&o.scrollLeft||s&&s.scrollLeft||0)-(o&&o.clientLeft||s&&s.clientLeft||0),t.pageY=t.clientY+(o&&o.scrollTop||s&&s.scrollTop||0)-(o&&o.clientTop||s&&s.clientTop||0)}t.which=t.charCode||t.keyCode,null!==t.button&&void 0!==t.button&&(t.button=1&t.button?0:4&t.button?1:2&t.button?2:0)}return t}function q(t,e,r){if(Array.isArray(e))return U(q,t,e,r);var n=H(t);if(n.handlers||(n.handlers={}),n.handlers[e]||(n.handlers[e]=[]),r.guid||(r.guid=F()),n.handlers[e].push(r),n.dispatcher||(n.disabled=!1,n.dispatcher=function(e,r){if(!n.disabled){e=X(e);var i=n.handlers[e.type];if(i)for(var o=i.slice(0),s=0,a=o.length;s-1&&(i={passive:!0}),t.addEventListener(e,n.dispatcher,i)}else t.attachEvent&&t.attachEvent("on"+e,n.dispatcher)}function K(t,e,r){if(V(t)){var n=H(t);if(n.handlers){if(Array.isArray(e))return U(K,t,e,r);var i=function(t,e){n.handlers[e]=[],W(t,e)};if(void 0!==e){var o=n.handlers[e];if(o){if(!r)return void i(t,e);if(r.guid)for(var s=0;s1&&void 0!==arguments[1]?arguments[1]:{},r=e.eventBusKey;if(r){if(!t[r].nodeName)throw new Error('The eventBusKey "'+r+'" does not refer to an element.');t.eventBusEl_=t[r]}else t.eventBusEl_=y("span",{className:"vjs-event-bus"});return n(t,Er),t.on("dispose",function(){t.off(),he.setTimeout(function(){t.eventBusEl_=null},0)}),t}function Q(t,e){return n(t,wr),t.state=n({},t.state,e),"function"==typeof t.handleStateChanged&&gr(t)&&t.on("statechanged",t.handleStateChanged),t}function Z(t){return"string"!=typeof t?t:t.charAt(0).toUpperCase()+t.slice(1)}function tt(t,e){return Z(t)===Z(e)}function et(){for(var t={},r=arguments.length,n=Array(r),i=0;ir)throw new Error("Failed to execute '"+t+"' on 'TimeRanges': The index provided ("+e+") is non-numeric or out of bounds (0-"+r+").")}function nt(t,e,r,n){return rt(t,n,r.length-1),r[n][e]}function it(t){return void 0===t||0===t.length?{length:0,start:function(){throw new Error("This TimeRanges object is empty")},end:function(){throw new Error("This TimeRanges object is empty")}}:{length:t.length,start:nt.bind(null,"start",0,t),end:nt.bind(null,"end",1,t)}}function ot(t,e){return Array.isArray(t)?it(t):void 0===t||void 0===e?it():it([[t,e]])}function st(t,e){var r=0,n=void 0,i=void 0;if(!e)return 0;t&&t.length||(t=ot(0,0));for(var o=0;oe&&(i=e),r+=i-n;return r/e}function at(t){if(t instanceof at)return t;"number"==typeof t?this.code=t:"string"==typeof t?this.message=t:i(t)&&("number"==typeof t.code&&(this.code=t.code),n(this,t)),this.message||(this.message=at.defaultMessages[this.code]||"")}function lt(t,e){var r,n=null;try{r=JSON.parse(t,e)}catch(t){n=t}return[n,r]}function ct(t){return void 0!==t&&null!==t&&"function"==typeof t.then}function ut(t){ct(t)&&t.then(null,function(t){})}function ht(t){var e=ln.call(t);return"[object Function]"===e||"function"==typeof t&&"[object RegExp]"!==e||"undefined"!=typeof window&&(t===window.setTimeout||t===window.alert||t===window.confirm||t===window.prompt)}function pt(){for(var t={},e=0;e0&&(u=setTimeout(function(){if(!c){c=!0,a.abort("timeout");var t=new Error("XMLHttpRequest timeout");t.code="ETIMEDOUT",n(t)}},t.timeout)),a.setRequestHeader)for(l in f)f.hasOwnProperty(l)&&a.setRequestHeader(l,f[l]);else if(t.headers&&!dt(t.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in t&&(a.responseType=t.responseType),"beforeSend"in t&&"function"==typeof t.beforeSend&&t.beforeSend(a),a.send(d||null),a}function gt(t){if("document"===t.responseType)return t.responseXML;var e=t.responseXML&&"parsererror"===t.responseXML.documentElement.nodeName;return""!==t.responseType||e?null:t.responseXML}function mt(){}function _t(t,e){this.name="ParsingError",this.code=t.code,this.message=e||t.message}function bt(t){function e(t,e,r,n){return 3600*(0|t)+60*(0|e)+(0|r)+(0|n)/1e3}var r=t.match(/^(\d+):(\d{2})(:\d{2})?\.(\d{3})/);return r?r[3]?e(r[1],r[2],r[3].replace(":",""),r[4]):r[1]>59?e(r[1],r[2],0,r[4]):e(0,r[1],r[2],r[4]):null}function Tt(){this.values=Hn(null)}function Ct(t,e,r,n){var i=n?t.split(n):[t];for(var o in i)if("string"==typeof i[o]){var s=i[o].split(r);if(2===s.length){var a=s[0],l=s[1];e(a,l)}}}function kt(t,e,r){function n(){var e=bt(t);if(null===e)throw new _t(_t.Errors.BadTimeStamp,"Malformed timestamp: "+o);return t=t.replace(/^[^\sa-zA-Z-]+/,""),e}function i(){t=t.replace(/^\s+/,"")}var o=t;if(i(),e.startTime=n(),i(),"--\x3e"!==t.substr(0,3))throw new _t(_t.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '--\x3e'): "+o);t=t.substr(3),i(),e.endTime=n(),i(),function(t,e){var n=new Tt;Ct(t,function(t,e){switch(t){case"region":for(var i=r.length-1;i>=0;i--)if(r[i].id===e){n.set(t,r[i].region);break}break;case"vertical":n.alt(t,e,["rl","lr"]);break;case"line":var o=e.split(","),s=o[0];n.integer(t,s),n.percent(t,s)&&n.set("snapToLines",!1),n.alt(t,s,["auto"]),2===o.length&&n.alt("lineAlign",o[1],["start","middle","end"]);break;case"position":o=e.split(","),n.percent(t,o[0]),2===o.length&&n.alt("positionAlign",o[1],["start","middle","end"]);break;case"size":n.percent(t,e);break;case"align":n.alt(t,e,["start","middle","end","left","right"])}},/:/,/\s/),e.region=n.get("region",null),e.vertical=n.get("vertical",""),e.line=n.get("line","auto"),e.lineAlign=n.get("lineAlign","start"),e.snapToLines=n.get("snapToLines",!0),e.size=n.get("size",100),e.align=n.get("align","middle"),e.position=n.get("position",{start:0,left:0,middle:50,end:100,right:100},e.align),e.positionAlign=n.get("positionAlign",{start:"start",left:"start",middle:"middle",end:"end",right:"end"},e.align)}(t,e)}function Et(t,e){function r(t){return Vn[t]}for(var n,i=t.document.createElement("div"),o=i,s=[];null!==(n=function(){if(!e)return null;var t=e.match(/^([^<]*)(<[^>]*>?)?/);return function(t){return e=e.substr(t.length),t}(t[1]?t[1]:t[2])}());)if("<"!==n[0])o.appendChild(t.document.createTextNode(function(t){for(;c=t.match(/&(amp|lt|gt|lrm|rlm|nbsp);/);)t=t.replace(c[0],r);return t}(n)));else{if("/"===n[1]){s.length&&s[s.length-1]===n.substr(2).replace(">","")&&(s.pop(),o=o.parentNode);continue}var a,l=bt(n.substr(1,n.length-2));if(l){a=t.document.createProcessingInstruction("timestamp",l),o.appendChild(a);continue}var c=n.match(/^<([^.\s\/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!c)continue;if(!(a=function(e,r){var n=zn[e];if(!n)return null;var i=t.document.createElement(n);i.localName=n;var o=Wn[e];return o&&r&&(i[o]=r.trim()),i}(c[1],c[3])))continue;if(!function(t,e){return!Un[e.localName]||Un[e.localName]===t.localName}(o,a))continue;c[2]&&(a.className=c[2].substr(1).replace("."," ")),s.push(c[1]),o.appendChild(a),o=a}return i}function wt(t){for(var e=0;e=r[0]&&t<=r[1])return!0}return!1}function St(t){function e(t,e){for(var r=e.childNodes.length-1;r>=0;r--)t.push(e.childNodes[r])}function r(t){if(!t||!t.length)return null;var n=t.pop(),i=n.textContent||n.innerText;if(i){var o=i.match(/^.*(\n|\r)/);return o?(t.length=0,o[0]):i}return"ruby"===n.tagName?r(t):n.childNodes?(e(t,n),r(t)):void 0}var n,i=[],o="";if(!t||!t.childNodes)return"ltr";for(e(i,t);o=r(i);)for(var s=0;s=0&&t.line<=100))return t.line;if(!t.track||!t.track.textTrackList||!t.track.textTrackList.mediaElement)return-1;for(var e=t.track,r=e.textTrackList,n=0,i=0;ih&&(u=u<0?-1:1,u*=Math.ceil(h/c)*c),s<0&&(u+=""===o.vertical?r.height:r.width,a=a.reverse()),i.move(p,u)}else{var d=i.lineHeight/r.height*100;switch(o.lineAlign){case"middle":s-=d/2;break;case"end":s-=d}switch(o.vertical){case"":e.applyStyles({top:e.formatStyle(s,"%")});break;case"rl":e.applyStyles({left:e.formatStyle(s,"%")});break;case"lr":e.applyStyles({right:e.formatStyle(s,"%")})}a=["+y","-x","+x","-y"],i=new Pt(e)}var f=function(t,e){for(var i,o=new Pt(t),s=1,a=0;al&&(i=new Pt(t),s=l),t=new Pt(o)}return i||o}(i,a);e.move(f.toCSSCompatValues(r))}function Mt(){}function Nt(t){return"string"==typeof t&&(!!$n[t.toLowerCase()]&&t.toLowerCase())}function It(t){return"string"==typeof t&&(!!Yn[t.toLowerCase()]&&t.toLowerCase())}function Lt(t){for(var e=1;e100)throw new Error("Position must be between 0 and 100.");y=t,this.hasBeenReset=!0}})),Object.defineProperty(n,"positionAlign",Lt({},o,{get:function(){return g},set:function(t){var e=It(t);if(!e)throw new SyntaxError("An invalid or illegal string was specified.");g=e,this.hasBeenReset=!0}})),Object.defineProperty(n,"size",Lt({},o,{get:function(){return m},set:function(t){if(t<0||t>100)throw new Error("Size must be between 0 and 100.");m=t,this.hasBeenReset=!0}})),Object.defineProperty(n,"align",Lt({},o,{get:function(){return _},set:function(t){var e=It(t);if(!e)throw new SyntaxError("An invalid or illegal string was specified.");_=e,this.hasBeenReset=!0}})),n.displayState=void 0,i)return n}function Rt(t){return"string"==typeof t&&(!!Jn[t.toLowerCase()]&&t.toLowerCase())}function Bt(t){return"number"==typeof t&&t>=0&&t<=100}function Ft(){var t=100,e=3,r=0,n=100,i=0,o=100,s="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return t},set:function(e){if(!Bt(e))throw new Error("Width must be between 0 and 100.");t=e}},lines:{enumerable:!0,get:function(){return e},set:function(t){if("number"!=typeof t)throw new TypeError("Lines must be set to a number.");e=t}},regionAnchorY:{enumerable:!0,get:function(){return n},set:function(t){if(!Bt(t))throw new Error("RegionAnchorX must be between 0 and 100.");n=t}},regionAnchorX:{enumerable:!0,get:function(){return r},set:function(t){if(!Bt(t))throw new Error("RegionAnchorY must be between 0 and 100.");r=t}},viewportAnchorY:{enumerable:!0,get:function(){return o},set:function(t){if(!Bt(t))throw new Error("ViewportAnchorY must be between 0 and 100.");o=t}},viewportAnchorX:{enumerable:!0,get:function(){return i},set:function(t){if(!Bt(t))throw new Error("ViewportAnchorX must be between 0 and 100.");i=t}},scroll:{enumerable:!0,get:function(){return s},set:function(t){var e=Rt(t);if(!1===e)throw new SyntaxError("An invalid or illegal string was specified.");s=e}}})}function Ht(t,e,r,n){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},o=t.textTracks();i.kind=e,r&&(i.label=r),n&&(i.language=n),i.tech=t;var s=new Fn.text.TrackClass(i);return o.addTrack(s),s}function Vt(t,e){ei[t]=ei[t]||[],ei[t].push(e)}function zt(t,e,r){t.setTimeout(function(){return Jt(e,ei[e.type],r,t)},1)}function Wt(t,e){t.forEach(function(t){return t.setTech&&t.setTech(e)})}function Ut(t,e,r){return t.reduceRight(Kt(r),e[r]())}function Xt(t,e,r,n){return e[r](t.reduce(Kt(r),n))}function qt(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i="call"+Z(r),o=t.reduce(Kt(i),n),s=o===ni,a=s?null:e[r](o);return $t(t,r,a,s),a}function Kt(t){return function(e,r){return e===ni?ni:r[t]?r[t](e):e}}function $t(t,e,r,n){for(var i=t.length-1;i>=0;i--){var o=t[i];o[e]&&o[e](n,r)}}function Yt(t){ri[t.id()]=null}function Gt(t,e){var r=ri[t.id()],n=null;if(void 0===r||null===r)return n=e(t),ri[t.id()]=[[e,n]],n;for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments[2],i=arguments[3],o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],s=arguments.length>5&&void 0!==arguments[5]&&arguments[5],a=e[0],l=e.slice(1);if("string"==typeof a)Jt(t,ei[a],r,i,o,s);else if(a){var c=Gt(i,a);if(!c.setSource)return o.push(c),Jt(t,l,r,i,o,s);c.setSource(n({},t),function(e,n){if(e)return Jt(t,l,r,i,o,s);o.push(c),Jt(n,t.type===n.type?l:ei[n.type],r,i,o,s)})}else l.length?Jt(t,l,r,i,o,s):s?r(t,o):Jt(t,ei["*"],r,i,o,!0)}function Qt(t){var e=li(t.src);return!t.type&&e&&(t.type=e),t}function Zt(t,e){var r=void 0;if(4===t.length)r=t[1]+t[1]+t[2]+t[2]+t[3]+t[3];else{if(7!==t.length)throw new Error("Invalid color code provided, "+t+"; must be formatted as e.g. #f0e or #f604e2.");r=t.slice(1)}return"rgba("+parseInt(r.slice(0,2),16)+","+parseInt(r.slice(2,4),16)+","+parseInt(r.slice(4,6),16)+","+e+")"}function te(t,e,r){try{t.style[e]=r}catch(t){return}}function ee(t){Ci=t}function re(){Ci=Ti}function ne(t,e){if(e&&(t=e(t)),t&&"none"!==t)return t}function ie(t,e){return ne(t.options[t.options.selectedIndex].value,e)}function oe(t,e,r){if(e)for(var n=0;n0)for(var i=0,o=t.length;i0)for(var s=0,a=e.length;s0)for(var l=0,c=r.length;l0)for(var u=0,h=n.length;u=e&&(t.apply(void 0,arguments),r=n)}},vr=function(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:he,i=void 0,o=function(){n.clearTimeout(i),i=null},s=function(){var o=this,s=arguments,a=function(){i=null,a=null,r||t.apply(o,s)};!i&&r&&t.apply(o,s),n.clearTimeout(i),i=n.setTimeout(a,e)};return s.cancel=o,s},yr=function(){};yr.prototype.allowedEvents_={},yr.prototype.on=function(t,e){var r=this.addEventListener;this.addEventListener=function(){},q(this,t,e),this.addEventListener=r},yr.prototype.addEventListener=yr.prototype.on,yr.prototype.off=function(t,e){K(this,t,e)},yr.prototype.removeEventListener=yr.prototype.off,yr.prototype.one=function(t,e){var r=this.addEventListener;this.addEventListener=function(){},Y(this,t,e),this.addEventListener=r},yr.prototype.trigger=function(t){var e=t.type||t;"string"==typeof t&&(t={type:e}),t=X(t),this.allowedEvents_[e]&&this["on"+e]&&this["on"+e](t),$(this,t)},yr.prototype.dispatchEvent=yr.prototype.trigger;var gr=function(t){return t instanceof yr||!!t.eventBusEl_&&["on","one","off","trigger"].every(function(e){return"function"==typeof t[e]})},mr=function(t){return"string"==typeof t&&/\S/.test(t)||Array.isArray(t)&&!!t.length},_r=function(t){if(!t.nodeName&&!gr(t))throw new Error("Invalid target; must be a DOM node or evented object.")},br=function(t){if(!mr(t))throw new Error("Invalid event type; must be a non-empty string or array.")},Tr=function(t){if("function"!=typeof t)throw new Error("Invalid listener; must be a function.")},Cr=function(t,e){var r=e.length<3||e[0]===t||e[0]===t.eventBusEl_,n=void 0,i=void 0,o=void 0;return r?(n=t.eventBusEl_,e.length>=3&&e.shift(),i=e[0],o=e[1]):(n=e[0],i=e[1],o=e[2]),_r(n),br(i),Tr(o),o=dr(t,o),{isTargetingSelf:r,target:n,type:i,listener:o}},kr=function(t,e,r,n){_r(t),t.nodeName?ar[e](t,r,n):t[e](r,n)},Er={on:function(){for(var t=this,e=arguments.length,r=Array(e),n=0;n=0;t--)this.children_[t].dispose&&this.children_[t].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.el_&&(this.el_.parentNode&&this.el_.parentNode.removeChild(this.el_),z(this.el_),this.el_=null),this.player_=null},t.prototype.player=function(){return this.player_},t.prototype.options=function(t){return Ye.warn("this.options() has been deprecated and will be moved to the constructor in 6.0"),t?(this.options_=et(this.options_,t),this.options_):this.options_},t.prototype.el=function(){return this.el_},t.prototype.createEl=function(t,e,r){return y(t,e,r)},t.prototype.localize=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t,n=this.player_.language&&this.player_.language(),i=this.player_.languages&&this.player_.languages(),o=i&&i[n],s=n&&n.split("-")[0],a=i&&i[s],l=r;return o&&o[t]?l=o[t]:a&&a[t]&&(l=a[t]),e&&(l=l.replace(/\{(\d+)\}/g,function(t,r){var n=e[r-1],i=n;return void 0===n&&(i=t),i})),l},t.prototype.contentEl=function(){return this.contentEl_||this.el_},t.prototype.id=function(){return this.id_},t.prototype.name=function(){return this.name_},t.prototype.children=function(){return this.children_},t.prototype.getChildById=function(t){return this.childIndex_[t]},t.prototype.getChild=function(t){if(t)return t=Z(t),this.childNameIndex_[t]},t.prototype.addChild=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.children_.length,i=void 0,o=void 0;if("string"==typeof e){o=Z(e);var s=r.componentClass||o;r.name=o;var a=t.getComponent(s);if(!a)throw new Error("Component "+s+" does not exist");if("function"!=typeof a)return null;i=new a(this.player_||this,r)}else i=e;if(this.children_.splice(n,0,i),"function"==typeof i.id&&(this.childIndex_[i.id()]=i),o=o||i.name&&Z(i.name()),o&&(this.childNameIndex_[o]=i),"function"==typeof i.el&&i.el()){var l=this.contentEl().children,c=l[n]||null;this.contentEl().insertBefore(i.el(),c)}return i},t.prototype.removeChild=function(t){if("string"==typeof t&&(t=this.getChild(t)),t&&this.children_){for(var e=!1,r=this.children_.length-1;r>=0;r--)if(this.children_[r]===t){e=!0,this.children_.splice(r,1);break}if(e){this.childIndex_[t.id()]=null,this.childNameIndex_[t.name()]=null;var n=t.el();n&&n.parentNode===this.contentEl()&&this.contentEl().removeChild(t.el())}}},t.prototype.initChildren=function(){var e=this,r=this.options_.children;if(r){var n=this.options_,i=function(t){var r=t.name,i=t.opts;if(void 0!==n[r]&&(i=n[r]),!1!==i){!0===i&&(i={}),i.playerOptions=e.options_.playerOptions;var o=e.addChild(r,i);o&&(e[r]=o)}},o=void 0,s=t.getComponent("Tech");o=Array.isArray(r)?r:Object.keys(r),o.concat(Object.keys(this.options_).filter(function(t){return!o.some(function(e){return"string"==typeof e?t===e:t===e.name})})).map(function(t){var n=void 0,i=void 0;return"string"==typeof t?(n=t,i=r[n]||e.options_[n]||{}):(n=t.name,i=t),{name:n,opts:i}}).filter(function(e){var r=t.getComponent(e.opts.componentClass||Z(e.name));return r&&!s.isTech(r)}).forEach(i)}},t.prototype.buildCSSClass=function(){return""},t.prototype.ready=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t)return this.isReady_?void(e?t.call(this):this.setTimeout(t,1)):(this.readyQueue_=this.readyQueue_||[],void this.readyQueue_.push(t))},t.prototype.triggerReady=function(){this.isReady_=!0,this.setTimeout(function(){var t=this.readyQueue_;this.readyQueue_=[],t&&t.length>0&&t.forEach(function(t){t.call(this)},this),this.trigger("ready")},1)},t.prototype.$=function(t,e){return Ze(t,e||this.contentEl())},t.prototype.$$=function(t,e){return tr(t,e||this.contentEl())},t.prototype.hasClass=function(t){return _(this.el_,t)},t.prototype.addClass=function(t){b(this.el_,t)},t.prototype.removeClass=function(t){T(this.el_,t)},t.prototype.toggleClass=function(t,e){C(this.el_,t,e)},t.prototype.show=function(){this.removeClass("vjs-hidden")},t.prototype.hide=function(){this.addClass("vjs-hidden")},t.prototype.lockShowing=function(){this.addClass("vjs-lock-showing")},t.prototype.unlockShowing=function(){this.removeClass("vjs-lock-showing")},t.prototype.getAttribute=function(t){return w(this.el_,t)},t.prototype.setAttribute=function(t,e){S(this.el_,t,e)},t.prototype.removeAttribute=function(t){x(this.el_,t)},t.prototype.width=function(t,e){return this.dimension("width",t,e)},t.prototype.height=function(t,e){return this.dimension("height",t,e)},t.prototype.dimensions=function(t,e){this.width(t,!0),this.height(e)},t.prototype.dimension=function(t,e,r){if(void 0!==e)return null!==e&&e===e||(e=0),-1!==(""+e).indexOf("%")||-1!==(""+e).indexOf("px")?this.el_.style[t]=e:this.el_.style[t]="auto"===e?"":e+"px",void(r||this.trigger("componentresize"));if(!this.el_)return 0;var n=this.el_.style[t],i=n.indexOf("px");return-1!==i?parseInt(n.slice(0,i),10):parseInt(this.el_["offset"+Z(t)],10)},t.prototype.currentDimension=function(t){var e=0;if("width"!==t&&"height"!==t)throw new Error("currentDimension only accepts width or height value");if("function"==typeof he.getComputedStyle){var r=he.getComputedStyle(this.el_);e=r.getPropertyValue(t)||r[t]}if(0===(e=parseFloat(e))){var n="offset"+Z(t);e=this.el_[n]}return e},t.prototype.currentDimensions=function(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}},t.prototype.currentWidth=function(){return this.currentDimension("width")},t.prototype.currentHeight=function(){return this.currentDimension("height")},t.prototype.focus=function(){this.el_.focus()},t.prototype.blur=function(){this.el_.blur()},t.prototype.emitTapEvents=function(){var t=0,e=null,r=void 0;this.on("touchstart",function(n){1===n.touches.length&&(e={pageX:n.touches[0].pageX,pageY:n.touches[0].pageY},t=(new Date).getTime(),r=!0)}),this.on("touchmove",function(t){if(t.touches.length>1)r=!1;else if(e){var n=t.touches[0].pageX-e.pageX,i=t.touches[0].pageY-e.pageY,o=Math.sqrt(n*n+i*i);o>10&&(r=!1)}});var n=function(){r=!1};this.on("touchleave",n),this.on("touchcancel",n),this.on("touchend",function(n){if(e=null,!0===r){(new Date).getTime()-t<200&&(n.preventDefault(),this.trigger("tap"))}})},t.prototype.enableTouchActivity=function(){if(this.player()&&this.player().reportUserActivity){var t=dr(this.player(),this.player().reportUserActivity),e=void 0;this.on("touchstart",function(){t(),this.clearInterval(e),e=this.setInterval(t,250)});var r=function(r){t(),this.clearInterval(e)};this.on("touchmove",t),this.on("touchend",r),this.on("touchcancel",r)}},t.prototype.setTimeout=function(t,e){var r,n,i=this;return t=dr(this,t),r=he.setTimeout(function(){i.off("dispose",n),t()},e),n=function(){return i.clearTimeout(r)},n.guid="vjs-timeout-"+r,this.on("dispose",n),r},t.prototype.clearTimeout=function(t){he.clearTimeout(t);var e=function(){};return e.guid="vjs-timeout-"+t,this.off("dispose",e),t},t.prototype.setInterval=function(t,e){var r=this;t=dr(this,t);var n=he.setInterval(t,e),i=function(){return r.clearInterval(n)};return i.guid="vjs-interval-"+n,this.on("dispose",i),n},t.prototype.clearInterval=function(t){he.clearInterval(t);var e=function(){};return e.guid="vjs-interval-"+t,this.off("dispose",e),t},t.prototype.requestAnimationFrame=function(t){var e,r,n=this;return this.supportsRaf_?(t=dr(this,t),e=he.requestAnimationFrame(function(){n.off("dispose",r),t()}),r=function(){return n.cancelAnimationFrame(e)},r.guid="vjs-raf-"+e,this.on("dispose",r),e):this.setTimeout(t,1e3/60)},t.prototype.cancelAnimationFrame=function(t){if(this.supportsRaf_){he.cancelAnimationFrame(t);var e=function(){};return e.guid="vjs-raf-"+t,this.off("dispose",e),t}return this.clearTimeout(t)},t.registerComponent=function(e,r){if("string"!=typeof e||!e)throw new Error('Illegal component name, "'+e+'"; must be a non-empty string.');var n=t.getComponent("Tech"),i=n&&n.isTech(r),o=t===r||t.prototype.isPrototypeOf(r.prototype);if(i||!o){var s=void 0;throw s=i?"techs must be registered using Tech.registerTech()":"must be a Component subclass",new Error('Illegal component, "'+e+'"; '+s+".")}e=Z(e),t.components_||(t.components_={});var a=t.getComponent("Player");if("Player"===e&&a&&a.players){var l=a.players,c=Object.keys(l);if(l&&c.length>0&&c.map(function(t){return l[t]}).every(Boolean))throw new Error("Can not register Player component after player has been created.")}return t.components_[e]=r,r},t.getComponent=function(e){if(e)return e=Z(e),t.components_&&t.components_[e]?t.components_[e]:void 0},t}();Sr.prototype.supportsRaf_="function"==typeof he.requestAnimationFrame&&"function"==typeof he.cancelAnimationFrame,Sr.registerComponent("Component",Sr);for(var xr={},jr=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],Ar=jr[0],Pr=void 0,Or=0;Or0&&void 0!==arguments[0]?arguments[0]:[],i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;Ve(this,e);var o=We(this,t.call(this));if(!i&&(i=o,Ne)){i=ye.createElement("custom");for(var s in e.prototype)"constructor"!==s&&(i[s]=e.prototype[s])}i.tracks_=[],Object.defineProperty(i,"length",{get:function(){return this.tracks_.length}});for(var a=0;a0&&void 0!==arguments[0]?arguments[0]:[];Ve(this,e);for(var o=void 0,s=i.length-1;s>=0;s--)if(i[s].enabled){Wr(i,i[s]);break}if(Ne){o=ye.createElement("custom");for(var a in Vr.prototype)"constructor"!==a&&(o[a]=Vr.prototype[a]);for(var l in e.prototype)"constructor"!==l&&(o[l]=e.prototype[l])}return o=r=We(this,t.call(this,i,o)),o.changing_=!1,n=o,We(r,n)}return ze(e,t),e.prototype.addTrack=function(e){var r=this;e.enabled&&Wr(this,e),t.prototype.addTrack.call(this,e),e.addEventListener&&e.addEventListener("enabledchange",function(){r.changing_||(r.changing_=!0,Wr(r,e),r.changing_=!1,r.trigger("change"))})},e}(Vr),Xr=function(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:[];Ve(this,e);for(var o=void 0,s=i.length-1;s>=0;s--)if(i[s].selected){Xr(i,i[s]);break}if(Ne){o=ye.createElement("custom");for(var a in Vr.prototype)"constructor"!==a&&(o[a]=Vr.prototype[a]);for(var l in e.prototype)"constructor"!==l&&(o[l]=e.prototype[l])}return o=r=We(this,t.call(this,i,o)),o.changing_=!1,Object.defineProperty(o,"selectedIndex",{get:function(){for(var t=0;t0&&void 0!==arguments[0]?arguments[0]:[];Ve(this,e);var o=void 0;if(Ne){o=ye.createElement("custom");for(var s in Vr.prototype)"constructor"!==s&&(o[s]=Vr.prototype[s]);for(var a in e.prototype)"constructor"!==a&&(o[a]=e.prototype[a])}return o=r=We(this,t.call(this,i,o)),n=o,We(r,n)}return ze(e,t),e.prototype.addTrack=function(e){t.prototype.addTrack.call(this,e),e.addEventListener("modechange",dr(this,function(){this.trigger("change")})),-1===["metadata","chapters"].indexOf(e.kind)&&e.addEventListener("modechange",dr(this,function(){this.trigger("selectedlanguagechange")}))},e}(Vr),$r=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];Ve(this,t);var r=this;if(Ne){r=ye.createElement("custom");for(var n in t.prototype)"constructor"!==n&&(r[n]=t.prototype[n])}r.trackElements_=[],Object.defineProperty(r,"length",{get:function(){return this.trackElements_.length}});for(var i=0,o=e.length;i0&&void 0!==arguments[0]?arguments[0]:{};Ve(this,e);var i=We(this,t.call(this)),o=i;if(Ne){o=ye.createElement("custom");for(var s in e.prototype)"constructor"!==s&&(o[s]=e.prototype[s])}var a={id:n.id||"vjs_track_"+F(),kind:n.kind||"",label:n.label||"",language:n.language||""};for(var l in a)!function(t){Object.defineProperty(o,t,{get:function(){return a[t]},set:function(){}})}(l);return r=o,We(i,r)}return ze(e,t),e}(yr),en=function(t){var e=["protocol","hostname","port","pathname","search","hash","host"],r=ye.createElement("a");r.href=t;var n=""===r.host&&"file:"!==r.protocol,i=void 0;n&&(i=ye.createElement("div"),i.innerHTML='',r=i.firstChild,i.setAttribute("style","display:none; position:absolute;"),ye.body.appendChild(i));for(var o={},s=0;sx',t=e.firstChild.href}return t},nn=function(t){if("string"==typeof t){var e=/^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/i,r=e.exec(t);if(r)return r.pop().toLowerCase()}return""},on=function(t){var e=he.location,r=en(t);return(":"===r.protocol?e.protocol:r.protocol)+r.host!==e.protocol+e.host},sn=(Object.freeze||Object)({parseUrl:en,getAbsoluteURL:rn,getFileExtension:nn,isCrossOrigin:on}),an=ht,ln=Object.prototype.toString,cn=t(function(t,e){function r(t){return t.replace(/^\s*|\s*$/g,"")}e=t.exports=r,e.left=function(t){return t.replace(/^\s*/,"")},e.right=function(t){return t.replace(/\s*$/,"")}}),un=Function.prototype.toString,hn=/^\s*class\b/,pn=function(t){try{var e=un.call(t);return hn.test(e)}catch(t){return!1}},dn=function(t){try{return!pn(t)&&(un.call(t),!0)}catch(t){return!1}},fn=Object.prototype.toString,vn="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag,yn=function(t){if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;if("function"==typeof t&&!t.prototype)return!0;if(vn)return dn(t);if(pn(t))return!1;var e=fn.call(t);return"[object Function]"===e||"[object GeneratorFunction]"===e},gn=Object.prototype.toString,mn=Object.prototype.hasOwnProperty,_n=function(t,e,r){for(var n=0,i=t.length;n=3&&(n=r),"[object Array]"===gn.call(t)?_n(t,e,n):"string"==typeof t?bn(t,e,n):Tn(t,e,n)},kn=Cn,En=function(t){return"[object Array]"===Object.prototype.toString.call(t)},wn=function(t){if(!t)return{};var e={};return kn(cn(t).split("\n"),function(t){var r=t.indexOf(":"),n=cn(t.slice(0,r)).toLowerCase(),i=cn(t.slice(r+1));void 0===e[n]?e[n]=i:En(e[n])?e[n].push(i):e[n]=[e[n],i]}),e},Sn=pt,xn=Object.prototype.hasOwnProperty,jn=vt;vt.XMLHttpRequest=he.XMLHttpRequest||mt,vt.XDomainRequest="withCredentials"in new vt.XMLHttpRequest?vt.XMLHttpRequest:he.XDomainRequest,function(t,e){for(var r=0;r0&&(he.console&&he.console.groupCollapsed&&he.console.groupCollapsed("Text Track parsing errors for "+e.src),n.forEach(function(t){return Ye.error(t)}),he.console&&he.console.groupEnd&&he.console.groupEnd()),r.flush()},Pn=function(t,e){var r={uri:t},n=on(t);n&&(r.cors=n),jn(r,dr(this,function(t,r,n){if(t)return Ye.error(t,r);if(e.loaded_=!0,"function"!=typeof he.WebVTT){if(e.tech_){var i=function(){return An(n,e)};e.tech_.on("vttjsloaded",i),e.tech_.on("vttjserror",function(){Ye.error("vttjs failed to load, stopping trying to process "+e.src),e.tech_.off("vttjsloaded",i)})}}else An(n,e)}))},On=function(t){function e(){ var r,n,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(Ve(this,e),!i.tech)throw new Error("A tech was not provided.");var o=et(i,{kind:Qr[i.kind]||"subtitles",language:i.language||i.srclang||""}),s=Zr[o.mode]||"disabled",a=o.default;"metadata"!==o.kind&&"chapters"!==o.kind||(s="hidden");var l=r=We(this,t.call(this,o));if(l.tech_=o.tech,Ne)for(var c in e.prototype)"constructor"!==c&&(l[c]=e.prototype[c]);l.cues_=[],l.activeCues_=[];var u=new Yr(l.cues_),h=new Yr(l.activeCues_),p=!1,d=dr(l,function(){this.activeCues=this.activeCues,p&&(this.trigger("cuechange"),p=!1)});return"disabled"!==s&&l.tech_.ready(function(){l.tech_.on("timeupdate",d)},!0),Object.defineProperty(l,"default",{get:function(){return a},set:function(){}}),Object.defineProperty(l,"mode",{get:function(){return s},set:function(t){var e=this;Zr[t]&&(s=t,"disabled"!==s?this.tech_.ready(function(){e.tech_.on("timeupdate",d)},!0):this.tech_.off("timeupdate",d),this.trigger("modechange"))}}),Object.defineProperty(l,"cues",{get:function(){return this.loaded_?u:null},set:function(){}}),Object.defineProperty(l,"activeCues",{get:function(){if(!this.loaded_)return null;if(0===this.cues.length)return h;for(var t=this.tech_.currentTime(),e=[],r=0,n=this.cues.length;r=t?e.push(i):i.startTime===i.endTime&&i.startTime<=t&&i.startTime+.5>=t&&e.push(i)}if(p=!1,e.length!==this.activeCues_.length)p=!0;else for(var o=0;o0&&void 0!==arguments[0]?arguments[0]:{};Ve(this,e);var o=et(i,{kind:Jr[i.kind]||""}),s=r=We(this,t.call(this,o)),a=!1;if(Ne)for(var l in e.prototype)"constructor"!==l&&(s[l]=e.prototype[l]);return Object.defineProperty(s,"enabled",{get:function(){return a},set:function(t){"boolean"==typeof t&&t!==a&&(a=t,this.trigger("enabledchange"))}}),o.enabled&&(s.enabled=o.enabled),s.loaded_=!0,n=s,We(r,n)}return ze(e,t),e}(tn),Nn=function(t){function e(){var r,n,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Ve(this,e);var o=et(i,{kind:Gr[i.kind]||""}),s=r=We(this,t.call(this,o)),a=!1;if(Ne)for(var l in e.prototype)"constructor"!==l&&(s[l]=e.prototype[l]);return Object.defineProperty(s,"selected",{get:function(){return a},set:function(t){"boolean"==typeof t&&t!==a&&(a=t,this.trigger("selectedchange"))}}),o.selected&&(s.selected=o.selected),n=s,We(r,n)}return ze(e,t),e}(tn),In=0,Ln=2,Dn=function(t){function e(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Ve(this,e);var n=We(this,t.call(this)),i=void 0,o=n;if(Ne){o=ye.createElement("custom");for(var s in e.prototype)"constructor"!==s&&(o[s]=e.prototype[s])}var a=new On(r);if(o.kind=a.kind,o.src=a.src,o.srclang=a.language,o.label=a.label,o.default=a.default,Object.defineProperty(o,"readyState",{get:function(){return i}}),Object.defineProperty(o,"track",{get:function(){return a}}),i=In,a.addEventListener("loadeddata",function(){i=Ln,o.trigger({type:"load",target:o})}),Ne){var l;return l=o,We(n,l)}return n}return ze(e,t),e}(yr);Dn.prototype.allowedEvents_={load:"load"},Dn.NONE=In,Dn.LOADING=1,Dn.LOADED=Ln,Dn.ERROR=3;var Rn={audio:{ListClass:Ur,TrackClass:Mn,capitalName:"Audio"},video:{ListClass:qr,TrackClass:Nn,capitalName:"Video"},text:{ListClass:Kr,TrackClass:On,capitalName:"Text"}};Object.keys(Rn).forEach(function(t){Rn[t].getterName=t+"Tracks",Rn[t].privateName=t+"Tracks_"});var Bn={remoteText:{ListClass:Kr,TrackClass:On,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:$r,TrackClass:Dn,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}},Fn=et(Rn,Bn);Bn.names=Object.keys(Bn),Rn.names=Object.keys(Rn),Fn.names=[].concat(Bn.names).concat(Rn.names);var Hn=Object.create||function(){function t(){}return function(e){if(1!==arguments.length)throw new Error("Object.create shim only accepts one parameter.");return t.prototype=e,new t}}();_t.prototype=Hn(Error.prototype),_t.prototype.constructor=_t,_t.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}},Tt.prototype={set:function(t,e){this.get(t)||""===e||(this.values[t]=e)},get:function(t,e,r){return r?this.has(t)?this.values[t]:e[r]:this.has(t)?this.values[t]:e},has:function(t){return t in this.values},alt:function(t,e,r){for(var n=0;n=0&&e<=100)&&(this.set(t,e),!0)}};var Vn={"&":"&","<":"<",">":">","‎":"鈥?,"‏":"鈥?," ":"聽"},zn={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},Wn={v:"title",lang:"lang"},Un={rt:"ruby"},Xn=[[1470,1470],[1472,1472],[1475,1475],[1478,1478],[1488,1514],[1520,1524],[1544,1544],[1547,1547],[1549,1549],[1563,1563],[1566,1610],[1645,1647],[1649,1749],[1765,1766],[1774,1775],[1786,1805],[1807,1808],[1810,1839],[1869,1957],[1969,1969],[1984,2026],[2036,2037],[2042,2042],[2048,2069],[2074,2074],[2084,2084],[2088,2088],[2096,2110],[2112,2136],[2142,2142],[2208,2208],[2210,2220],[8207,8207],[64285,64285],[64287,64296],[64298,64310],[64312,64316],[64318,64318],[64320,64321],[64323,64324],[64326,64449],[64467,64829],[64848,64911],[64914,64967],[65008,65020],[65136,65140],[65142,65276],[67584,67589],[67592,67592],[67594,67637],[67639,67640],[67644,67644],[67647,67669],[67671,67679],[67840,67867],[67872,67897],[67903,67903],[67968,68023],[68030,68031],[68096,68096],[68112,68115],[68117,68119],[68121,68147],[68160,68167],[68176,68184],[68192,68223],[68352,68405],[68416,68437],[68440,68466],[68472,68479],[68608,68680],[126464,126467],[126469,126495],[126497,126498],[126500,126500],[126503,126503],[126505,126514],[126516,126519],[126521,126521],[126523,126523],[126530,126530],[126535,126535],[126537,126537],[126539,126539],[126541,126543],[126545,126546],[126548,126548],[126551,126551],[126553,126553],[126555,126555],[126557,126557],[126559,126559],[126561,126562],[126564,126564],[126567,126570],[126572,126578],[126580,126583],[126585,126588],[126590,126590],[126592,126601],[126603,126619],[126625,126627],[126629,126633],[126635,126651],[1114109,1114109]];jt.prototype.applyStyles=function(t,e){e=e||this.div;for(var r in t)t.hasOwnProperty(r)&&(e.style[r]=t[r])},jt.prototype.formatStyle=function(t,e){return 0===t?0:t+e},At.prototype=Hn(jt.prototype),At.prototype.constructor=At,Pt.prototype.move=function(t,e){switch(e=void 0!==e?e:this.lineHeight,t){case"+x":this.left+=e,this.right+=e;break;case"-x":this.left-=e,this.right-=e;break;case"+y":this.top+=e,this.bottom+=e;break;case"-y":this.top-=e,this.bottom-=e}},Pt.prototype.overlaps=function(t){return this.leftt.left&&this.topt.top},Pt.prototype.overlapsAny=function(t){for(var e=0;e=t.top&&this.bottom<=t.bottom&&this.left>=t.left&&this.right<=t.right},Pt.prototype.overlapsOppositeAxis=function(t,e){switch(e){case"+x":return this.leftt.right;case"+y":return this.topt.bottom}},Pt.prototype.intersectPercentage=function(t){return Math.max(0,Math.min(this.right,t.right)-Math.max(this.left,t.left))*Math.max(0,Math.min(this.bottom,t.bottom)-Math.max(this.top,t.top))/(this.height*this.width)},Pt.prototype.toCSSCompatValues=function(t){return{top:this.top-t.top,bottom:t.bottom-this.bottom,left:this.left-t.left,right:t.right-this.right,height:this.height,width:this.width}},Pt.getSimpleBoxPosition=function(t){var e=t.div?t.div.offsetHeight:t.tagName?t.offsetHeight:0,r=t.div?t.div.offsetWidth:t.tagName?t.offsetWidth:0,n=t.div?t.div.offsetTop:t.tagName?t.offsetTop:0;return t=t.div?t.div.getBoundingClientRect():t.tagName?t.getBoundingClientRect():t,{left:t.left,right:t.right,top:t.top||n,height:t.height||e,bottom:t.bottom||n+(t.height||e),width:t.width||r}},Mt.StringDecoder=function(){return{decode:function(t){if(!t)return"";if("string"!=typeof t)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(t))}}},Mt.convertCueToDOMTree=function(t,e){return t&&e?Et(t,e):null};Mt.processCues=function(t,e,r){if(!t||!e||!r)return null;for(;r.firstChild;)r.removeChild(r.firstChild);var n=t.document.createElement("div");if(n.style.position="absolute",n.style.left="0",n.style.right="0",n.style.top="0",n.style.bottom="0",n.style.margin="1.5%",r.appendChild(n),function(t){for(var e=0;e0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};Ve(this,e),r.reportTouchActivity=!1;var i=We(this,t.call(this,null,r,n));return i.hasStarted_=!1,i.on("playing",function(){this.hasStarted_=!0}),i.on("loadstart",function(){this.hasStarted_=!1}),Fn.names.forEach(function(t){var e=Fn[t];r&&r[e.getterName]&&(i[e.privateName]=r[e.getterName])}),i.featuresProgressEvents||i.manualProgressOn(),i.featuresTimeupdateEvents||i.manualTimeUpdatesOn(),["Text","Audio","Video"].forEach(function(t){!1===r["native"+t+"Tracks"]&&(i["featuresNative"+t+"Tracks"]=!1)}),!1===r.nativeCaptions||!1===r.nativeTextTracks?i.featuresNativeTextTracks=!1:!0!==r.nativeCaptions&&!0!==r.nativeTextTracks||(i.featuresNativeTextTracks=!0),i.featuresNativeTextTracks||i.emulateTextTracks(),i.autoRemoteTextTracks_=new Fn.text.ListClass,i.initTrackListeners(),r.nativeControlsForTouch||i.emitTapEvents(),i.constructor&&(i.name_=i.constructor.name||"Unknown Tech"),i}return ze(e,t),e.prototype.triggerSourceset=function(t){var e=this;this.isReady_||this.one("ready",function(){return e.setTimeout(function(){return e.triggerSourceset(t)},1)}),this.trigger({src:t,type:"sourceset"})},e.prototype.manualProgressOn=function(){this.on("durationchange",this.onDurationChange),this.manualProgress=!0,this.one("ready",this.trackProgress)},e.prototype.manualProgressOff=function(){this.manualProgress=!1,this.stopTrackingProgress(),this.off("durationchange",this.onDurationChange)},e.prototype.trackProgress=function(t){this.stopTrackingProgress(),this.progressInterval=this.setInterval(dr(this,function(){var t=this.bufferedPercent();this.bufferedPercent_!==t&&this.trigger("progress"),this.bufferedPercent_=t,1===t&&this.stopTrackingProgress()}),500)},e.prototype.onDurationChange=function(t){this.duration_=this.duration()},e.prototype.buffered=function(){return ot(0,0)},e.prototype.bufferedPercent=function(){return st(this.buffered(),this.duration_)},e.prototype.stopTrackingProgress=function(){this.clearInterval(this.progressInterval)},e.prototype.manualTimeUpdatesOn=function(){this.manualTimeUpdates=!0,this.on("play",this.trackCurrentTime),this.on("pause",this.stopTrackingCurrentTime)},e.prototype.manualTimeUpdatesOff=function(){this.manualTimeUpdates=!1,this.stopTrackingCurrentTime(),this.off("play",this.trackCurrentTime),this.off("pause",this.stopTrackingCurrentTime)},e.prototype.trackCurrentTime=function(){this.currentTimeInterval&&this.stopTrackingCurrentTime(),this.currentTimeInterval=this.setInterval(function(){this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},250)},e.prototype.stopTrackingCurrentTime=function(){this.clearInterval(this.currentTimeInterval),this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},e.prototype.dispose=function(){this.clearTracks(Rn.names),this.manualProgress&&this.manualProgressOff(),this.manualTimeUpdates&&this.manualTimeUpdatesOff(),t.prototype.dispose.call(this)},e.prototype.clearTracks=function(t){var e=this;t=[].concat(t),t.forEach(function(t){for(var r=e[t+"Tracks"]()||[],n=r.length;n--;){var i=r[n];"text"===t&&e.removeRemoteTextTrack(i),r.removeTrack(i)}})},e.prototype.cleanupAutoTextTracks=function(){for(var t=this.autoRemoteTextTracks_||[],e=t.length;e--;){var r=t[e];this.removeRemoteTextTrack(r)}},e.prototype.reset=function(){},e.prototype.error=function(t){return void 0!==t&&(this.error_=new at(t),this.trigger("error")),this.error_},e.prototype.played=function(){return this.hasStarted_?ot(0,0):ot()},e.prototype.setCurrentTime=function(){this.manualTimeUpdates&&this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},e.prototype.initTrackListeners=function(){var t=this;Rn.names.forEach(function(e){var r=Rn[e],n=function(){t.trigger(e+"trackchange")},i=t[r.getterName]();i.addEventListener("removetrack",n),i.addEventListener("addtrack",n),t.on("dispose",function(){i.removeEventListener("removetrack",n),i.removeEventListener("addtrack",n)})})},e.prototype.addWebVttScript_=function(){var t=this;if(!he.WebVTT)if(ye.body.contains(this.el())){if(!this.options_["vtt.js"]&&o(Zn)&&Object.keys(Zn).length>0)return void this.trigger("vttjsloaded");var e=ye.createElement("script");e.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.12.4/vtt.min.js",e.onload=function(){t.trigger("vttjsloaded")},e.onerror=function(){t.trigger("vttjserror")},this.on("dispose",function(){e.onload=null,e.onerror=null}),he.WebVTT=!0,this.el().parentNode.appendChild(e)}else this.ready(this.addWebVttScript_)},e.prototype.emulateTextTracks=function(){var t=this,e=this.textTracks(),r=this.remoteTextTracks(),n=function(t){return e.addTrack(t.track)},i=function(t){return e.removeTrack(t.track)};r.on("addtrack",n),r.on("removetrack",i),this.addWebVttScript_();var o=function(){return t.trigger("texttrackchange")},s=function(){o();for(var t=0;t0&&void 0!==arguments[0]?arguments[0]:{},r=arguments[1],n=this.createRemoteTextTrack(e);return!0!==r&&!1!==r&&(Ye.warn('Calling addRemoteTextTrack without explicitly setting the "manualCleanup" parameter to `true` is deprecated and default to `false` in future version of video.js'),r=!0),this.remoteTextTrackEls().addTrackElement_(n),this.remoteTextTracks().addTrack(n.track),!0!==r&&this.ready(function(){return t.autoRemoteTextTracks_.addTrack(n.track)}),n},e.prototype.removeRemoteTextTrack=function(t){var e=this.remoteTextTrackEls().getTrackElementByTrack_(t);this.remoteTextTrackEls().removeTrackElement_(e),this.remoteTextTracks().removeTrack(t),this.autoRemoteTextTracks_.removeTrack(t)},e.prototype.getVideoPlaybackQuality=function(){return{}},e.prototype.setPoster=function(){},e.prototype.playsinline=function(){},e.prototype.setPlaysinline=function(){},e.prototype.canPlayType=function(){return""},e.canPlayType=function(){return""},e.canPlaySource=function(t,r){return e.canPlayType(t.type)},e.isTech=function(t){return t.prototype instanceof e||t instanceof e||t===e},e.registerTech=function(t,r){if(e.techs_||(e.techs_={}),!e.isTech(r))throw new Error("Tech "+t+" must be a Tech");if(!e.canPlayType)throw new Error("Techs must have a static canPlayType method on them");if(!e.canPlaySource)throw new Error("Techs must have a static canPlaySource method on them");return t=Z(t),e.techs_[t]=r,"Tech"!==t&&e.defaultTechOrder_.push(t),r},e.getTech=function(t){if(t)return t=Z(t),e.techs_&&e.techs_[t]?e.techs_[t]:he&&he.videojs&&he.videojs[t]?(Ye.warn("The "+t+" tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)"),he.videojs[t]):void 0},e}(Sr);Fn.names.forEach(function(t){var e=Fn[t];ti.prototype[e.getterName]=function(){return this[e.privateName]=this[e.privateName]||new e.ListClass,this[e.privateName]}}),ti.prototype.featuresVolumeControl=!0,ti.prototype.featuresMuteControl=!0,ti.prototype.featuresFullscreenResize=!1,ti.prototype.featuresPlaybackRate=!1,ti.prototype.featuresProgressEvents=!1,ti.prototype.featuresSourceset=!1,ti.prototype.featuresTimeupdateEvents=!1,ti.prototype.featuresNativeTextTracks=!1,ti.withSourceHandlers=function(t){t.registerSourceHandler=function(e,r){var n=t.sourceHandlers;n||(n=t.sourceHandlers=[]),void 0===r&&(r=n.length),n.splice(r,0,e)},t.canPlayType=function(e){for(var r=t.sourceHandlers||[],n=void 0,i=0;i0&&void 0!==arguments[0]?arguments[0]:"",e=nn(t);return ai[e.toLowerCase()]||""},ci=function(t,e){if(!e)return"";if(t.cache_.source.src===e&&t.cache_.source.type)return t.cache_.source.type;var r=t.cache_.sources.filter(function(t){return t.src===e});if(r.length)return r[0].type;for(var n=t.$$("source"),i=0;i0&&void 0!==arguments[0]?arguments[0]:"div",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};r=n({innerHTML:'',className:this.buildCSSClass(),tabIndex:0},r),"button"===e&&Ye.error("Creating a ClickableComponent with an HTML element of "+e+" is not supported; use a Button instead."),i=n({role:"button"},i),this.tabIndex_=r.tabIndex;var o=t.prototype.createEl.call(this,e,r,i);return this.createControlTextEl(o),o},e.prototype.dispose=function(){this.controlTextEl_=null,t.prototype.dispose.call(this)},e.prototype.createControlTextEl=function(t){return this.controlTextEl_=y("span",{className:"vjs-control-text"},{"aria-live":"polite"}),t&&t.appendChild(this.controlTextEl_),this.controlText(this.controlText_,t),this.controlTextEl_},e.prototype.controlText=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.el();if(void 0===t)return this.controlText_||"Need Text";var r=this.localize(t);this.controlText_=t,g(this.controlTextEl_,r),this.nonIconControl||e.setAttribute("title",r)},e.prototype.buildCSSClass=function(){return"vjs-control vjs-button "+t.prototype.buildCSSClass.call(this)},e.prototype.enable=function(){this.enabled_||(this.enabled_=!0,this.removeClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","false"),void 0!==this.tabIndex_&&this.el_.setAttribute("tabIndex",this.tabIndex_),this.on(["tap","click"],this.handleClick),this.on("focus",this.handleFocus),this.on("blur",this.handleBlur))},e.prototype.disable=function(){this.enabled_=!1,this.addClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","true"),void 0!==this.tabIndex_&&this.el_.removeAttribute("tabIndex"),this.off(["tap","click"],this.handleClick),this.off("focus",this.handleFocus),this.off("blur",this.handleBlur)},e.prototype.handleClick=function(t){},e.prototype.handleFocus=function(t){q(ye,"keydown",dr(this,this.handleKeyPress))},e.prototype.handleKeyPress=function(e){32===e.which||13===e.which?(e.preventDefault(),this.trigger("click")):t.prototype.handleKeyPress&&t.prototype.handleKeyPress.call(this,e)},e.prototype.handleBlur=function(t){K(ye,"keydown",dr(this,this.handleKeyPress))},e}(Sr);Sr.registerComponent("ClickableComponent",pi);var di=function(t){function e(r,n){Ve(this,e);var i=We(this,t.call(this,r,n));return i.update(),r.on("posterchange",dr(i,i.update)),i}return ze(e,t),e.prototype.dispose=function(){this.player().off("posterchange",this.update),t.prototype.dispose.call(this)},e.prototype.createEl=function(){var t=y("div",{className:"vjs-poster",tabIndex:-1});return Be||(this.fallbackImg_=y("img"),t.appendChild(this.fallbackImg_)),t},e.prototype.update=function(t){var e=this.player().poster();this.setSrc(e),e?this.show():this.hide()},e.prototype.setSrc=function(t){if(this.fallbackImg_)this.fallbackImg_.src=t;else{var e="";t&&(e='url("'+t+'")'),this.el_.style.backgroundImage=e}},e.prototype.handleClick=function(t){this.player_.controls()&&(this.player_.paused()?ut(this.player_.play()):this.player_.pause())},e}(pi);Sr.registerComponent("PosterImage",di);var fi={monospace:"monospace",sansSerif:"sans-serif",serif:"serif",monospaceSansSerif:'"Andale Mono", "Lucida Console", monospace',monospaceSerif:'"Courier New", monospace',proportionalSansSerif:"sans-serif",proportionalSerif:"serif",casual:'"Comic Sans MS", Impact, fantasy',script:'"Monotype Corsiva", cursive',smallcaps:'"Andale Mono", "Lucida Console", monospace, sans-serif'},vi=function(t){function e(r,n,i){Ve(this,e);var o=We(this,t.call(this,r,n,i)),s=dr(o,o.updateDisplay);return r.on("loadstart",dr(o,o.toggleDisplay)),r.on("texttrackchange",s),r.on("loadstart",dr(o,o.preselectTrack)),r.ready(dr(o,function(){if(r.tech_&&r.tech_.featuresNativeTextTracks)return void this.hide();r.on("fullscreenchange",s),r.on("playerresize",s),he.addEventListener&&he.addEventListener("orientationchange",s),r.on("dispose",function(){return he.removeEventListener("orientationchange",s)});for(var t=this.options_.playerOptions.tracks||[],e=0;e1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};t="button",e=n({innerHTML:'',className:this.buildCSSClass()},e),r=n({type:"button"},r);var i=Sr.prototype.createEl.call(this,t,e,r);return this.createControlTextEl(i),i},e.prototype.addChild=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.constructor.name;return Ye.warn("Adding an actionable (user controllable) child to a Button ("+r+") is not supported; use a ClickableComponent instead."),Sr.prototype.addChild.call(this,t,e)},e.prototype.enable=function(){t.prototype.enable.call(this),this.el_.removeAttribute("disabled")},e.prototype.disable=function(){t.prototype.disable.call(this),this.el_.setAttribute("disabled","disabled")},e.prototype.handleKeyPress=function(e){32!==e.which&&13!==e.which&&t.prototype.handleKeyPress.call(this,e)},e}(pi);Sr.registerComponent("Button",gi);var mi=function(t){function e(r,n){Ve(this,e);var i=We(this,t.call(this,r,n));return i.mouseused_=!1,i.on("mousedown",i.handleMouseDown),i}return ze(e,t),e.prototype.buildCSSClass=function(){return"vjs-big-play-button"},e.prototype.handleClick=function(t){var e=this.player_.play();if(this.mouseused_&&t.clientX&&t.clientY)return void ut(e);var r=this.player_.getChild("controlBar"),n=r&&r.getChild("playToggle");if(!n)return void this.player_.focus();var i=function(){return n.focus()};ct(e)?e.then(i,function(){}):this.setTimeout(i,1)},e.prototype.handleKeyPress=function(e){this.mouseused_=!1,t.prototype.handleKeyPress.call(this,e)},e.prototype.handleMouseDown=function(t){this.mouseused_=!0},e}(gi);mi.prototype.controlText_="Play Video",Sr.registerComponent("BigPlayButton",mi);var _i=function(t){function e(r,n){Ve(this,e);var i=We(this,t.call(this,r,n));return i.controlText(n&&n.controlText||i.localize("Close")),i}return ze(e,t),e.prototype.buildCSSClass=function(){return"vjs-close-button "+t.prototype.buildCSSClass.call(this)},e.prototype.handleClick=function(t){this.trigger({type:"close",bubbles:!1})},e}(gi);Sr.registerComponent("CloseButton",_i);var bi=function(t){function e(r,n){Ve(this,e);var i=We(this,t.call(this,r,n));return i.on(r,"play",i.handlePlay),i.on(r,"pause",i.handlePause),i.on(r,"ended",i.handleEnded),i}return ze(e,t),e.prototype.buildCSSClass=function(){return"vjs-play-control "+t.prototype.buildCSSClass.call(this)},e.prototype.handleClick=function(t){this.player_.paused()?this.player_.play():this.player_.pause()},e.prototype.handleSeeked=function(t){this.removeClass("vjs-ended"),this.player_.paused()?this.handlePause(t):this.handlePlay(t)},e.prototype.handlePlay=function(t){this.removeClass("vjs-ended"),this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.controlText("Pause")},e.prototype.handlePause=function(t){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.controlText("Play")},e.prototype.handleEnded=function(t){this.removeClass("vjs-playing"),this.addClass("vjs-ended"),this.controlText("Replay"),this.one(this.player_,"seeked",this.handleSeeked)},e}(gi);bi.prototype.controlText_="Play",Sr.registerComponent("PlayToggle",bi);var Ti=function(t,e){t=t<0?0:t;var r=Math.floor(t%60),n=Math.floor(t/60%60),i=Math.floor(t/3600),o=Math.floor(e/60%60),s=Math.floor(e/3600);return(isNaN(t)||t===1/0)&&(i=n=r="-"),i=i>0||s>0?i+":":"",n=((i||o>=10)&&n<10?"0"+n:n)+":",r=r<10?"0"+r:r,i+n+r},Ci=Ti,ki=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;return Ci(t,e)},Ei=function(t){function e(r,n){Ve(this,e);var i=We(this,t.call(this,r,n));return i.throttledUpdateContent=fr(dr(i,i.updateContent),25),i.on(r,"timeupdate",i.throttledUpdateContent),i}return ze(e,t),e.prototype.createEl=function(e){var r=this.buildCSSClass(),n=t.prototype.createEl.call(this,"div",{className:r+" vjs-time-control vjs-control",innerHTML:''+this.localize(this.labelText_)+"聽"});return this.contentEl_=y("span",{className:r+"-display"},{"aria-live":"off"}),this.updateTextNode_(),n.appendChild(this.contentEl_),n},e.prototype.dispose=function(){this.contentEl_=null,this.textNode_=null,t.prototype.dispose.call(this)},e.prototype.updateTextNode_=function(){if(this.contentEl_){for(;this.contentEl_.firstChild;)this.contentEl_.removeChild(this.contentEl_.firstChild);this.textNode_=ye.createTextNode(this.formattedTime_||this.formatTime_(0)),this.contentEl_.appendChild(this.textNode_)}},e.prototype.formatTime_=function(t){return ki(t)},e.prototype.updateFormattedTime_=function(t){var e=this.formatTime_(t);e!==this.formattedTime_&&(this.formattedTime_=e,this.requestAnimationFrame(this.updateTextNode_))},e.prototype.updateContent=function(t){},e}(Sr);Ei.prototype.labelText_="Time",Ei.prototype.controlText_="Time",Sr.registerComponent("TimeDisplay",Ei);var wi=function(t){function e(r,n){Ve(this,e);var i=We(this,t.call(this,r,n));return i.on(r,"ended",i.handleEnded),i}return ze(e,t),e.prototype.buildCSSClass=function(){return"vjs-current-time"},e.prototype.updateContent=function(t){var e=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();this.updateFormattedTime_(e)},e.prototype.handleEnded=function(t){this.player_.duration()&&this.updateFormattedTime_(this.player_.duration())},e}(Ei);wi.prototype.labelText_="Current Time",wi.prototype.controlText_="Current Time",Sr.registerComponent("CurrentTimeDisplay",wi);var Si=function(t){function e(r,n){Ve(this,e);var i=We(this,t.call(this,r,n));return i.on(r,"durationchange",i.updateContent),i.on(r,"loadedmetadata",i.throttledUpdateContent),i}return ze(e,t),e.prototype.buildCSSClass=function(){return"vjs-duration"},e.prototype.updateContent=function(t){var e=this.player_.duration();e&&this.duration_!==e&&(this.duration_=e,this.updateFormattedTime_(e))},e}(Ei);Si.prototype.labelText_="Duration",Si.prototype.controlText_="Duration",Sr.registerComponent("DurationDisplay",Si);var xi=function(t){function e(){return Ve(this,e),We(this,t.apply(this,arguments))}return ze(e,t),e.prototype.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-time-control vjs-time-divider",innerHTML:"
/
"})},e}(Sr);Sr.registerComponent("TimeDivider",xi);var ji=function(t){function e(r,n){Ve(this,e);var i=We(this,t.call(this,r,n));return i.on(r,"durationchange",i.throttledUpdateContent),i.on(r,"ended",i.handleEnded),i}return ze(e,t),e.prototype.buildCSSClass=function(){return"vjs-remaining-time"},e.prototype.formatTime_=function(e){return"-"+t.prototype.formatTime_.call(this,e)},e.prototype.updateContent=function(t){this.player_.duration()&&(this.player_.remainingTimeDisplay?this.updateFormattedTime_(this.player_.remainingTimeDisplay()):this.updateFormattedTime_(this.player_.remainingTime()))},e.prototype.handleEnded=function(t){this.player_.duration()&&this.updateFormattedTime_(0)},e}(Ei);ji.prototype.labelText_="Remaining Time",ji.prototype.controlText_="Remaining Time",Sr.registerComponent("RemainingTimeDisplay",ji);var Ai=function(t){function e(r,n){Ve(this,e);var i=We(this,t.call(this,r,n));return i.updateShowing(),i.on(i.player(),"durationchange",i.updateShowing),i}return ze(e,t),e.prototype.createEl=function(){var e=t.prototype.createEl.call(this,"div",{className:"vjs-live-control vjs-control"});return this.contentEl_=y("div",{className:"vjs-live-display",innerHTML:''+this.localize("Stream Type")+"聽"+this.localize("LIVE")},{"aria-live":"off"}),e.appendChild(this.contentEl_),e},e.prototype.dispose=function(){this.contentEl_=null,t.prototype.dispose.call(this)},e.prototype.updateShowing=function(t){this.player().duration()===1/0?this.show():this.hide()},e}(Sr);Sr.registerComponent("LiveDisplay",Ai);var Pi=function(t){function e(r,n){Ve(this,e);var i=We(this,t.call(this,r,n));return i.bar=i.getChild(i.options_.barName),i.vertical(!!i.options_.vertical),i.enable(),i}return ze(e,t),e.prototype.enabled=function(){return this.enabled_},e.prototype.enable=function(){this.enabled()||(this.on("mousedown",this.handleMouseDown),this.on("touchstart",this.handleMouseDown),this.on("focus",this.handleFocus),this.on("blur",this.handleBlur),this.on("click",this.handleClick),this.on(this.player_,"controlsvisible",this.update),this.playerEvent&&this.on(this.player_,this.playerEvent,this.update),this.removeClass("disabled"),this.setAttribute("tabindex",0),this.enabled_=!0)},e.prototype.disable=function(){if(this.enabled()){var t=this.bar.el_.ownerDocument;this.off("mousedown",this.handleMouseDown),this.off("touchstart",this.handleMouseDown),this.off("focus",this.handleFocus),this.off("blur",this.handleBlur),this.off("click",this.handleClick),this.off(this.player_,"controlsvisible",this.update),this.off(t,"mousemove",this.handleMouseMove),this.off(t,"mouseup",this.handleMouseUp),this.off(t,"touchmove",this.handleMouseMove),this.off(t,"touchend",this.handleMouseUp),this.removeAttribute("tabindex"),this.addClass("disabled"),this.playerEvent&&this.off(this.player_,this.playerEvent,this.update),this.enabled_=!1}},e.prototype.createEl=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return r.className=r.className+" vjs-slider",r=n({tabIndex:0},r),i=n({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100,tabIndex:0},i),t.prototype.createEl.call(this,e,r,i)},e.prototype.handleMouseDown=function(t){var e=this.bar.el_.ownerDocument;"mousedown"===t.type&&t.preventDefault(),"touchstart"!==t.type||Oe||t.preventDefault(),j(),this.addClass("vjs-sliding"),this.trigger("slideractive"),this.on(e,"mousemove",this.handleMouseMove),this.on(e,"mouseup",this.handleMouseUp),this.on(e,"touchmove",this.handleMouseMove),this.on(e,"touchend",this.handleMouseUp),this.handleMouseMove(t)},e.prototype.handleMouseMove=function(t){},e.prototype.handleMouseUp=function(){var t=this.bar.el_.ownerDocument;A(),this.removeClass("vjs-sliding"),this.trigger("sliderinactive"),this.off(t,"mousemove",this.handleMouseMove),this.off(t,"mouseup",this.handleMouseUp),this.off(t,"touchmove",this.handleMouseMove),this.off(t,"touchend",this.handleMouseUp),this.update()},e.prototype.update=function(){if(this.el_){var t=this.getPercent(),e=this.bar;if(e){("number"!=typeof t||t!==t||t<0||t===1/0)&&(t=0);var r=(100*t).toFixed(2)+"%",n=e.el().style;return this.vertical()?n.height=r:n.width=r,t}}},e.prototype.calculateDistance=function(t){var e=M(this.el_,t);return this.vertical()?e.y:e.x},e.prototype.handleFocus=function(){this.on(this.bar.el_.ownerDocument,"keydown",this.handleKeyPress)},e.prototype.handleKeyPress=function(t){37===t.which||40===t.which?(t.preventDefault(),this.stepBack()):38!==t.which&&39!==t.which||(t.preventDefault(),this.stepForward())},e.prototype.handleBlur=function(){this.off(this.bar.el_.ownerDocument,"keydown",this.handleKeyPress)},e.prototype.handleClick=function(t){t.stopImmediatePropagation(),t.preventDefault()},e.prototype.vertical=function(t){if(void 0===t)return this.vertical_||!1;this.vertical_=!!t,this.vertical_?this.addClass("vjs-slider-vertical"):this.addClass("vjs-slider-horizontal")},e}(Sr);Sr.registerComponent("Slider",Pi);var Oi=function(t){function e(r,n){Ve(this,e);var i=We(this,t.call(this,r,n));return i.partEls_=[],i.on(r,"progress",i.update),i}return ze(e,t),e.prototype.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-load-progress",innerHTML:''+this.localize("Loaded")+": 0%"})},e.prototype.dispose=function(){this.partEls_=null,t.prototype.dispose.call(this)},e.prototype.update=function(t){var e=this.player_.buffered(),r=this.player_.duration(),n=this.player_.bufferedEnd(),i=this.partEls_,o=function(t,e){var r=t/e||0;return 100*(r>=1?1:r)+"%"};this.el_.style.width=o(n,r);for(var s=0;se.length;u--)this.el_.removeChild(i[u-1]);i.length=e.length},e}(Sr);Sr.registerComponent("LoadProgressBar",Oi);var Mi=function(t){function e(){return Ve(this,e),We(this,t.apply(this,arguments))}return ze(e,t),e.prototype.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-time-tooltip"})},e.prototype.update=function(t,e,r){var n=P(this.el_),i=P(this.player_.el()),o=t.width*e;if(i&&n){var s=t.left-i.left+o,a=t.width-o+(i.right-t.right),l=n.width/2;sn.width&&(l=n.width),this.el_.style.right="-"+l+"px",g(this.el_,r)}},e}(Sr);Sr.registerComponent("TimeTooltip",Mi);var Ni=function(t){function e(){return Ve(this,e),We(this,t.apply(this,arguments))}return ze(e,t),e.prototype.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-play-progress vjs-slider-bar",innerHTML:''+this.localize("Progress")+": 0%"})},e.prototype.update=function(t,e){var r=this;this.rafId_&&this.cancelAnimationFrame(this.rafId_),this.rafId_=this.requestAnimationFrame(function(){var n=r.player_.scrubbing()?r.player_.getCache().currentTime:r.player_.currentTime(),i=ki(n,r.player_.duration()),o=r.getChild("timeTooltip");o&&o.update(t,e,i)})},e}(Sr);Ni.prototype.options_={children:[]},Ie&&!(Ie>8)||ke||we||Ni.prototype.options_.children.push("timeTooltip"),Sr.registerComponent("PlayProgressBar",Ni);var Ii=function(t){function e(r,n){Ve(this,e);var i=We(this,t.call(this,r,n));return i.update=fr(dr(i,i.update),25),i}return ze(e,t),e.prototype.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"})},e.prototype.update=function(t,e){var r=this;this.rafId_&&this.cancelAnimationFrame(this.rafId_),this.rafId_=this.requestAnimationFrame(function(){var n=r.player_.duration(),i=ki(e*n,n);r.el_.style.left=t.width*e+"px",r.getChild("timeTooltip").update(t,e,i)})},e}(Sr);Ii.prototype.options_={children:["timeTooltip"]},Sr.registerComponent("MouseTimeDisplay",Ii);var Li=function(t){function e(r,n){Ve(this,e);var i=We(this,t.call(this,r,n));return i.setEventHandlers_(),i}return ze(e,t),e.prototype.setEventHandlers_=function(){var t=this;this.update=fr(dr(this,this.update),30),this.on(this.player_,"timeupdate",this.update),this.on(this.player_,"ended",this.handleEnded),this.updateInterval=null,this.on(this.player_,["playing"],function(){t.clearInterval(t.updateInterval),t.updateInterval=t.setInterval(function(){t.requestAnimationFrame(function(){t.update()})},30)}),this.on(this.player_,["ended","pause","waiting"],function(){t.clearInterval(t.updateInterval)}),this.on(this.player_,["timeupdate","ended"],this.update)},e.prototype.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})},e.prototype.update_=function(t,e){var r=this.player_.duration();this.el_.setAttribute("aria-valuenow",(100*e).toFixed(2)),this.el_.setAttribute("aria-valuetext",this.localize("progress bar timing: currentTime={1} duration={2}",[ki(t,r),ki(r,r)],"{1} of {2}")),this.bar.update(P(this.el_),e)},e.prototype.update=function(e){var r=t.prototype.update.call(this);return this.update_(this.getCurrentTime_(),r),r},e.prototype.getCurrentTime_=function(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()},e.prototype.handleEnded=function(t){this.update_(this.player_.duration(),1)},e.prototype.getPercent=function(){var t=this.getCurrentTime_()/this.player_.duration();return t>=1?1:t},e.prototype.handleMouseDown=function(e){B(e)&&(e.stopPropagation(),this.player_.scrubbing(!0),this.videoWasPlaying=!this.player_.paused(),this.player_.pause(),t.prototype.handleMouseDown.call(this,e))},e.prototype.handleMouseMove=function(t){if(B(t)){var e=this.calculateDistance(t)*this.player_.duration();e===this.player_.duration()&&(e-=.1),this.player_.currentTime(e)}},e.prototype.enable=function(){t.prototype.enable.call(this);var e=this.getChild("mouseTimeDisplay");e&&e.show()},e.prototype.disable=function(){t.prototype.disable.call(this);var e=this.getChild("mouseTimeDisplay");e&&e.hide()},e.prototype.handleMouseUp=function(e){t.prototype.handleMouseUp.call(this,e),e&&e.stopPropagation(),this.player_.scrubbing(!1),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying&&ut(this.player_.play())},e.prototype.stepForward=function(){this.player_.currentTime(this.player_.currentTime()+5)},e.prototype.stepBack=function(){this.player_.currentTime(this.player_.currentTime()-5)},e.prototype.handleAction=function(t){this.player_.paused()?this.player_.play():this.player_.pause()},e.prototype.handleKeyPress=function(e){32===e.which||13===e.which?(e.preventDefault(),this.handleAction(e)):t.prototype.handleKeyPress&&t.prototype.handleKeyPress.call(this,e)},e}(Pi);Li.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"},Ie&&!(Ie>8)||ke||we||Li.prototype.options_.children.splice(1,0,"mouseTimeDisplay"),Li.prototype.playerEvent="timeupdate",Sr.registerComponent("SeekBar",Li);var Di=function(t){function e(r,n){Ve(this,e);var i=We(this,t.call(this,r,n));return i.handleMouseMove=fr(dr(i,i.handleMouseMove),25),i.throttledHandleMouseSeek=fr(dr(i,i.handleMouseSeek),25),i.enable(),i}return ze(e,t),e.prototype.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-progress-control vjs-control"})},e.prototype.handleMouseMove=function(t){var e=this.getChild("seekBar");if(e){var r=e.getChild("mouseTimeDisplay"),n=e.el(),i=P(n),o=M(n,t).x;o>1?o=1:o<0&&(o=0),r&&r.update(i,o)}},e.prototype.handleMouseSeek=function(t){var e=this.getChild("seekBar");e&&e.handleMouseMove(t)},e.prototype.enabled=function(){return this.enabled_},e.prototype.disable=function(){this.children().forEach(function(t){return t.disable&&t.disable()}),this.enabled()&&(this.off(["mousedown","touchstart"],this.handleMouseDown),this.off(this.el_,"mousemove",this.handleMouseMove),this.handleMouseUp(),this.addClass("disabled"),this.enabled_=!1)},e.prototype.enable=function(){this.children().forEach(function(t){return t.enable&&t.enable()}),this.enabled()||(this.on(["mousedown","touchstart"],this.handleMouseDown),this.on(this.el_,"mousemove",this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0)},e.prototype.handleMouseDown=function(t){var e=this.el_.ownerDocument,r=this.getChild("seekBar");r&&r.handleMouseDown(t),this.on(e,"mousemove",this.throttledHandleMouseSeek),this.on(e,"touchmove",this.throttledHandleMouseSeek),this.on(e,"mouseup",this.handleMouseUp),this.on(e,"touchend",this.handleMouseUp)},e.prototype.handleMouseUp=function(t){var e=this.el_.ownerDocument,r=this.getChild("seekBar");r&&r.handleMouseUp(t),this.off(e,"mousemove",this.throttledHandleMouseSeek),this.off(e,"touchmove",this.throttledHandleMouseSeek),this.off(e,"mouseup",this.handleMouseUp),this.off(e,"touchend",this.handleMouseUp)},e}(Sr);Di.prototype.options_={children:["seekBar"]},Sr.registerComponent("ProgressControl",Di);var Ri=function(t){function e(r,n){Ve(this,e);var i=We(this,t.call(this,r,n));return i.on(r,"fullscreenchange",i.handleFullscreenChange),!1===ye[xr.fullscreenEnabled]&&i.disable(),i}return ze(e,t),e.prototype.buildCSSClass=function(){return"vjs-fullscreen-control "+t.prototype.buildCSSClass.call(this)},e.prototype.handleFullscreenChange=function(t){this.player_.isFullscreen()?this.controlText("Non-Fullscreen"):this.controlText("Fullscreen")},e.prototype.handleClick=function(t){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()},e}(gi);Ri.prototype.controlText_="Fullscreen",Sr.registerComponent("FullscreenToggle",Ri);var Bi=function(t,e){e.tech_&&!e.tech_.featuresVolumeControl&&t.addClass("vjs-hidden"),t.on(e,"loadstart",function(){e.tech_.featuresVolumeControl?t.removeClass("vjs-hidden"):t.addClass("vjs-hidden")})},Fi=function(t){function e(){return Ve(this,e),We(this,t.apply(this,arguments))}return ze(e,t),e.prototype.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-volume-level",innerHTML:''})},e}(Sr);Sr.registerComponent("VolumeLevel",Fi);var Hi=function(t){function e(r,n){Ve(this,e);var i=We(this,t.call(this,r,n));return i.on("slideractive",i.updateLastVolume_),i.on(r,"volumechange",i.updateARIAAttributes),r.ready(function(){return i.updateARIAAttributes()}),i}return ze(e,t),e.prototype.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"})},e.prototype.handleMouseDown=function(e){B(e)&&t.prototype.handleMouseDown.call(this,e)},e.prototype.handleMouseMove=function(t){B(t)&&(this.checkMuted(),this.player_.volume(this.calculateDistance(t)))},e.prototype.checkMuted=function(){this.player_.muted()&&this.player_.muted(!1)},e.prototype.getPercent=function(){return this.player_.muted()?0:this.player_.volume()},e.prototype.stepForward=function(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)},e.prototype.stepBack=function(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)},e.prototype.updateARIAAttributes=function(t){var e=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",e),this.el_.setAttribute("aria-valuetext",e+"%")},e.prototype.volumeAsPercentage_=function(){return Math.round(100*this.player_.volume())},e.prototype.updateLastVolume_=function(){var t=this,e=this.player_.volume();this.one("sliderinactive",function(){0===t.player_.volume()&&t.player_.lastVolume_(e)})},e}(Pi);Hi.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"},Hi.prototype.playerEvent="volumechange",Sr.registerComponent("VolumeBar",Hi);var Vi=function(t){function e(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Ve(this,e),n.vertical=n.vertical||!1,(void 0===n.volumeBar||o(n.volumeBar))&&(n.volumeBar=n.volumeBar||{},n.volumeBar.vertical=n.vertical);var i=We(this,t.call(this,r,n));return Bi(i,r),i.throttledHandleMouseMove=fr(dr(i,i.handleMouseMove),25),i.on("mousedown",i.handleMouseDown),i.on("touchstart",i.handleMouseDown),i.on(i.volumeBar,["focus","slideractive"],function(){i.volumeBar.addClass("vjs-slider-active"),i.addClass("vjs-slider-active"),i.trigger("slideractive")}),i.on(i.volumeBar,["blur","sliderinactive"],function(){i.volumeBar.removeClass("vjs-slider-active"),i.removeClass("vjs-slider-active"),i.trigger("sliderinactive")}),i}return ze(e,t),e.prototype.createEl=function(){var e="vjs-volume-horizontal";return this.options_.vertical&&(e="vjs-volume-vertical"),t.prototype.createEl.call(this,"div",{className:"vjs-volume-control vjs-control "+e})},e.prototype.handleMouseDown=function(t){var e=this.el_.ownerDocument;this.on(e,"mousemove",this.throttledHandleMouseMove),this.on(e,"touchmove",this.throttledHandleMouseMove),this.on(e,"mouseup",this.handleMouseUp),this.on(e,"touchend",this.handleMouseUp)},e.prototype.handleMouseUp=function(t){var e=this.el_.ownerDocument;this.off(e,"mousemove",this.throttledHandleMouseMove),this.off(e,"touchmove",this.throttledHandleMouseMove),this.off(e,"mouseup",this.handleMouseUp),this.off(e,"touchend",this.handleMouseUp)},e.prototype.handleMouseMove=function(t){this.volumeBar.handleMouseMove(t)},e}(Sr);Vi.prototype.options_={children:["volumeBar"]},Sr.registerComponent("VolumeControl",Vi);var zi=function(t,e){e.tech_&&!e.tech_.featuresMuteControl&&t.addClass("vjs-hidden"),t.on(e,"loadstart",function(){e.tech_.featuresMuteControl?t.removeClass("vjs-hidden"):t.addClass("vjs-hidden")})},Wi=function(t){function e(r,n){Ve(this,e);var i=We(this,t.call(this,r,n));return zi(i,r),i.on(r,["loadstart","volumechange"],i.update),i}return ze(e,t),e.prototype.buildCSSClass=function(){return"vjs-mute-control "+t.prototype.buildCSSClass.call(this)},e.prototype.handleClick=function(t){var e=this.player_.volume(),r=this.player_.lastVolume_();if(0===e){var n=r<.1?.1:r;this.player_.volume(n),this.player_.muted(!1)}else this.player_.muted(!this.player_.muted())},e.prototype.update=function(t){this.updateIcon_(),this.updateControlText_()},e.prototype.updateIcon_=function(){var t=this.player_.volume(),e=3;ke&&this.player_.muted(this.player_.tech_.el_.muted),0===t||this.player_.muted()?e=0:t<.33?e=1:t<.67&&(e=2);for(var r=0;r<4;r++)T(this.el_,"vjs-vol-"+r);b(this.el_,"vjs-vol-"+e)},e.prototype.updateControlText_=function(){var t=this.player_.muted()||0===this.player_.volume(),e=t?"Unmute":"Mute";this.controlText()!==e&&this.controlText(e)},e}(gi);Wi.prototype.controlText_="Mute",Sr.registerComponent("MuteToggle",Wi);var Ui=function(t){function e(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Ve(this,e),void 0!==n.inline?n.inline=n.inline:n.inline=!0,(void 0===n.volumeControl||o(n.volumeControl))&&(n.volumeControl=n.volumeControl||{},n.volumeControl.vertical=!n.inline);var i=We(this,t.call(this,r,n));return i.on(r,["loadstart"],i.volumePanelState_),i.on(i.volumeControl,["slideractive"],i.sliderActive_),i.on(i.volumeControl,["sliderinactive"],i.sliderInactive_),i}return ze(e,t),e.prototype.sliderActive_=function(){this.addClass("vjs-slider-active")},e.prototype.sliderInactive_=function(){this.removeClass("vjs-slider-active")},e.prototype.volumePanelState_=function(){this.volumeControl.hasClass("vjs-hidden")&&this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-hidden"),this.volumeControl.hasClass("vjs-hidden")&&!this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-mute-toggle-only")},e.prototype.createEl=function(){var e="vjs-volume-panel-horizontal";return this.options_.inline||(e="vjs-volume-panel-vertical"),t.prototype.createEl.call(this,"div",{className:"vjs-volume-panel vjs-control "+e})},e}(Sr);Ui.prototype.options_={children:["muteToggle","volumeControl"]},Sr.registerComponent("VolumePanel",Ui);var Xi=function(t){function e(r,n){Ve(this,e);var i=We(this,t.call(this,r,n));return n&&(i.menuButton_=n.menuButton),i.focusedChild_=-1,i.on("keydown",i.handleKeyPress),i}return ze(e,t),e.prototype.addItem=function(t){this.addChild(t),t.on("click",dr(this,function(e){this.menuButton_&&(this.menuButton_.unpressButton(),"CaptionSettingsMenuItem"!==t.name()&&this.menuButton_.focus())}))},e.prototype.createEl=function(){var e=this.options_.contentElType||"ul";this.contentEl_=y(e,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");var r=t.prototype.createEl.call(this,"div",{append:this.contentEl_,className:"vjs-menu"});return r.appendChild(this.contentEl_),q(r,"click",function(t){t.preventDefault(),t.stopImmediatePropagation()}),r},e.prototype.dispose=function(){this.contentEl_=null,t.prototype.dispose.call(this)},e.prototype.handleKeyPress=function(t){37===t.which||40===t.which?(t.preventDefault(),this.stepForward()):38!==t.which&&39!==t.which||(t.preventDefault(),this.stepBack())},e.prototype.stepForward=function(){var t=0;void 0!==this.focusedChild_&&(t=this.focusedChild_+1),this.focus(t)},e.prototype.stepBack=function(){var t=0;void 0!==this.focusedChild_&&(t=this.focusedChild_-1),this.focus(t)},e.prototype.focus=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=this.children().slice();e.length&&e[0].className&&/vjs-menu-title/.test(e[0].className)&&e.shift(),e.length>0&&(t<0?t=0:t>=e.length&&(t=e.length-1),this.focusedChild_=t,e[t].el_.focus())},e}(Sr);Sr.registerComponent("Menu",Xi);var qi=function(t){function e(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Ve(this,e);var i=We(this,t.call(this,r,n));i.menuButton_=new gi(r,n),i.menuButton_.controlText(i.controlText_),i.menuButton_.el_.setAttribute("aria-haspopup","true");var o=gi.prototype.buildCSSClass();return i.menuButton_.el_.className=i.buildCSSClass()+" "+o,i.menuButton_.removeClass("vjs-control"),i.addChild(i.menuButton_),i.update(),i.enabled_=!0,i.on(i.menuButton_,"tap",i.handleClick),i.on(i.menuButton_,"click",i.handleClick),i.on(i.menuButton_,"focus",i.handleFocus),i.on(i.menuButton_,"blur",i.handleBlur),i.on("keydown",i.handleSubmenuKeyPress),i}return ze(e,t),e.prototype.update=function(){var t=this.createMenu();this.menu&&(this.menu.dispose(),this.removeChild(this.menu)),this.menu=t,this.addChild(t),this.buttonPressed_=!1,this.menuButton_.el_.setAttribute("aria-expanded","false"),this.items&&this.items.length<=this.hideThreshold_?this.hide():this.show()},e.prototype.createMenu=function(){var t=new Xi(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){var e=y("li",{className:"vjs-menu-title",innerHTML:Z(this.options_.title),tabIndex:-1});this.hideThreshold_+=1,t.children_.unshift(e),m(e,t.contentEl())}if(this.items=this.createItems(),this.items)for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:this.menuButton_.el();return this.menuButton_.controlText(t,e)},e.prototype.handleClick=function(t){this.one(this.menu.contentEl(),"mouseleave",dr(this,function(t){this.unpressButton(),this.el_.blur()})),this.buttonPressed_?this.unpressButton():this.pressButton()},e.prototype.focus=function(){this.menuButton_.focus()},e.prototype.blur=function(){this.menuButton_.blur()},e.prototype.handleFocus=function(){q(ye,"keydown",dr(this,this.handleKeyPress))},e.prototype.handleBlur=function(){K(ye,"keydown",dr(this,this.handleKeyPress))},e.prototype.handleKeyPress=function(t){27===t.which||9===t.which?(this.buttonPressed_&&this.unpressButton(),9!==t.which&&(t.preventDefault(),this.menuButton_.el_.focus())):38!==t.which&&40!==t.which||this.buttonPressed_||(this.pressButton(),t.preventDefault())},e.prototype.handleSubmenuKeyPress=function(t){27!==t.which&&9!==t.which||(this.buttonPressed_&&this.unpressButton(),9!==t.which&&(t.preventDefault(),this.menuButton_.el_.focus()))},e.prototype.pressButton=function(){if(this.enabled_){if(this.buttonPressed_=!0,this.menu.lockShowing(),this.menuButton_.el_.setAttribute("aria-expanded","true"),ke&&f())return;this.menu.focus()}},e.prototype.unpressButton=function(){this.enabled_&&(this.buttonPressed_=!1,this.menu.unlockShowing(),this.menuButton_.el_.setAttribute("aria-expanded","false"))},e.prototype.disable=function(){this.unpressButton(),this.enabled_=!1,this.addClass("vjs-disabled"),this.menuButton_.disable()},e.prototype.enable=function(){this.enabled_=!0,this.removeClass("vjs-disabled"),this.menuButton_.enable()},e}(Sr);Sr.registerComponent("MenuButton",qi);var Ki=function(t){function e(r,n){Ve(this,e);var i=n.tracks,o=We(this,t.call(this,r,n));if(o.items.length<=1&&o.hide(),!i)return We(o);var s=dr(o,o.update);return i.addEventListener("removetrack",s),i.addEventListener("addtrack",s),o.player_.on("ready",s),o.player_.on("dispose",function(){i.removeEventListener("removetrack",s),i.removeEventListener("addtrack",s)}),o}return ze(e,t),e}(qi);Sr.registerComponent("TrackButton",Ki);var $i=function(t){function e(r,n){Ve(this,e);var i=We(this,t.call(this,r,n));return i.selectable=n.selectable,i.isSelected_=n.selected||!1,i.multiSelectable=n.multiSelectable,i.selected(i.isSelected_), i.selectable?i.multiSelectable?i.el_.setAttribute("role","menuitemcheckbox"):i.el_.setAttribute("role","menuitemradio"):i.el_.setAttribute("role","menuitem"),i}return ze(e,t),e.prototype.createEl=function(e,r,i){return this.nonIconControl=!0,t.prototype.createEl.call(this,"li",n({className:"vjs-menu-item",innerHTML:''+this.localize(this.options_.label)+"",tabIndex:-1},r),i)},e.prototype.handleClick=function(t){this.selected(!0)},e.prototype.selected=function(t){this.selectable&&(t?(this.addClass("vjs-selected"),this.el_.setAttribute("aria-checked","true"),this.controlText(", selected"),this.isSelected_=!0):(this.removeClass("vjs-selected"),this.el_.setAttribute("aria-checked","false"),this.controlText(""),this.isSelected_=!1))},e}(pi);Sr.registerComponent("MenuItem",$i);var Yi=function(t){function e(r,n){Ve(this,e);var i=n.track,o=r.textTracks();n.label=i.label||i.language||"Unknown",n.selected="showing"===i.mode;var s=We(this,t.call(this,r,n));s.track=i;var a=function(){for(var t=arguments.length,e=Array(t),r=0;r-1?"showing"!==s.mode&&(s.mode="showing"):"disabled"!==s.mode&&(s.mode="disabled")}},e.prototype.handleTracksChange=function(t){var e="showing"===this.track.mode;e!==this.isSelected_&&this.selected(e)},e.prototype.handleSelectedLanguageChange=function(t){if("showing"===this.track.mode){var e=this.player_.cache_.selectedLanguage;if(e&&e.enabled&&e.language===this.track.language&&e.kind!==this.track.kind)return;this.player_.cache_.selectedLanguage={enabled:!0,language:this.track.language,kind:this.track.kind}}},e.prototype.dispose=function(){this.track=null,t.prototype.dispose.call(this)},e}($i);Sr.registerComponent("TextTrackMenuItem",Yi);var Gi=function(t){function e(r,n){return Ve(this,e),n.track={player:r,kind:n.kind,kinds:n.kinds,default:!1,mode:"disabled"},n.kinds||(n.kinds=[n.kind]),n.label?n.track.label=n.label:n.track.label=n.kinds.join(" and ")+" off",n.selectable=!0,n.multiSelectable=!1,We(this,t.call(this,r,n))}return ze(e,t),e.prototype.handleTracksChange=function(t){for(var e=this.player().textTracks(),r=!0,n=0,i=e.length;n-1&&"showing"===o.mode){r=!1;break}}r!==this.isSelected_&&this.selected(r)},e.prototype.handleSelectedLanguageChange=function(t){for(var e=this.player().textTracks(),r=!0,n=0,i=e.length;n-1&&"showing"===o.mode){r=!1;break}}r&&(this.player_.cache_.selectedLanguage={enabled:!1})},e}(Yi);Sr.registerComponent("OffTextTrackMenuItem",Gi);var Ji=function(t){function e(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Ve(this,e),n.tracks=r.textTracks(),We(this,t.call(this,r,n))}return ze(e,t),e.prototype.createItems=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Yi,r=void 0;this.label_&&(r=this.label_+" off"),t.push(new Gi(this.player_,{kinds:this.kinds_,kind:this.kind_,label:r})),this.hideThreshold_+=1;var n=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(var i=0;i-1){var s=new e(this.player_,{track:o,selectable:!0,multiSelectable:!1});s.addClass("vjs-"+o.kind+"-menu-item"),t.push(s)}}return t},e}(Ki);Sr.registerComponent("TextTrackButton",Ji);var Qi=function(t){function e(r,n){Ve(this,e);var i=n.track,o=n.cue,s=r.currentTime();n.selectable=!0,n.multiSelectable=!1,n.label=o.text,n.selected=o.startTime<=s&&s=0;e--){var r=t[e];if(r.kind===this.kind_)return r}},e.prototype.getMenuCaption=function(){return this.track_&&this.track_.label?this.track_.label:this.localize(Z(this.kind_))},e.prototype.createMenu=function(){return this.options_.title=this.getMenuCaption(),t.prototype.createMenu.call(this)},e.prototype.createItems=function(){var t=[];if(!this.track_)return t;var e=this.track_.cues;if(!e)return t;for(var r=0,n=e.length;r
',nextArrow:'
',autoplay:false,autoplaySpeed:5000,centerMode:false,centerPadding:"50px",cssEase:"ease",customPaging:function(k,j){return""},dots:false,dotsClass:"slick-dots",draggable:true,easing:"linear",edgeFriction:0.35,fade:false,focusOnSelect:false,focusOnChange:false,infinite:true,initialSlide:0,lazyLoad:"ondemand",mobileFirst:false,pauseOnHover:true,pauseOnFocus:true,pauseOnDotsHover:false,respondTo:"window",responsive:null,rows:1,rtl:false,slide:"",slidesPerRow:1,slidesToShow:1,slidesToScroll:1,speed:500,swipe:true,swipeToSlide:false,touchMove:true,touchThreshold:5,useCSS:true,useTransform:true,variableWidth:false,vertical:false,verticalSwiping:false,waitForAnimate:true,zIndex:2};f.initials={animating:false,dragging:false,autoPlayTimer:null,currentDirection:0,currentLeft:null,currentSlide:0,direction:1,$dots:null,listWidth:null,listHeight:null,loadIndex:0,$nextArrow:null,$prevArrow:null,scrolling:false,slideCount:null,slideWidth:null,$slideTrack:null,$slides:null,sliding:false,slideOffset:0,swipeLeft:null,swiping:false,$list:null,touchObject:{},transformsEnabled:false,unslicked:false};a.extend(f,f.initials);f.activeBreakpoint=null;f.animType=null;f.animProp=null;f.breakpoints=[];f.breakpointSettings=[];f.cssTransitions=false;f.focussed=false;f.interrupted=false;f.hidden="hidden";f.paused=true;f.positionProp=null;f.respondTo=null;f.rowCount=1;f.shouldClick=true;f.$slider=a(g);f.$slidesCache=null;f.transformType=null;f.transitionType=null;f.visibilityChange="visibilitychange";f.windowWidth=0;f.windowTimer=null;e=a(g).data("slick")||{};f.options=a.extend({},f.defaults,h,e);f.currentSlide=f.options.initialSlide;f.originalSettings=f.options;if(typeof document.mozHidden!=="undefined"){f.hidden="mozHidden";f.visibilityChange="mozvisibilitychange"}else{if(typeof document.webkitHidden!=="undefined"){f.hidden="webkitHidden";f.visibilityChange="webkitvisibilitychange"}}f.autoPlay=a.proxy(f.autoPlay,f);f.autoPlayClear=a.proxy(f.autoPlayClear,f);f.autoPlayIterator=a.proxy(f.autoPlayIterator,f);f.changeSlide=a.proxy(f.changeSlide,f);f.clickHandler=a.proxy(f.clickHandler,f);f.selectHandler=a.proxy(f.selectHandler,f);f.setPosition=a.proxy(f.setPosition,f);f.swipeHandler=a.proxy(f.swipeHandler,f);f.dragHandler=a.proxy(f.dragHandler,f);f.keyHandler=a.proxy(f.keyHandler,f);f.instanceUid=c++;f.htmlExpr=/^(?:\s*(<[\w\W]+>)[^>]*)$/;f.registerBreakpoints();f.init(true)}return d}());b.prototype.activateADA=function(){var c=this;c.$slideTrack.find(".slick-active").attr({"aria-hidden":"false"}).find("a, input, button, select").attr({"tabindex":"0"})};b.prototype.addSlide=b.prototype.slickAdd=function(c,e,f){var d=this;if(typeof(e)==="boolean"){f=e;e=null}else{if(e<0||(e>=d.slideCount)){return false}}d.unload();if(typeof(e)==="number"){if(e===0&&d.$slides.length===0){a(c).appendTo(d.$slideTrack)}else{if(f){a(c).insertBefore(d.$slides.eq(e))}else{a(c).insertAfter(d.$slides.eq(e))}}}else{if(f===true){a(c).prependTo(d.$slideTrack)}else{a(c).appendTo(d.$slideTrack)}}d.$slides=d.$slideTrack.children(this.options.slide);d.$slideTrack.children(this.options.slide).detach();d.$slideTrack.append(d.$slides);d.$slides.each(function(g,h){a(h).attr("data-slick-index",g)});d.$slidesCache=d.$slides;d.reinit()};b.prototype.animateHeight=function(){var d=this;if(d.options.slidesToShow===1&&d.options.adaptiveHeight===true&&d.options.vertical===false){var c=d.$slides.eq(d.currentSlide).outerHeight(true);d.$list.animate({height:c},d.options.speed)}};b.prototype.animateSlide=function(f,e){var d={},c=this;c.animateHeight();if(c.options.rtl===true&&c.options.vertical===false){f=-f}if(c.transformsEnabled===false){if(c.options.vertical===false){c.$slideTrack.animate({left:f},c.options.speed,c.options.easing,e)}else{c.$slideTrack.animate({top:f},c.options.speed,c.options.easing,e)}}else{if(c.cssTransitions===false){if(c.options.rtl===true){c.currentLeft=-(c.currentLeft)}a({animStart:c.currentLeft}).animate({animStart:f},{duration:c.options.speed,easing:c.options.easing,step:function(g){g=Math.ceil(g);if(c.options.vertical===false){d[c.animType]="translate("+g+"px, 0px)";c.$slideTrack.css(d)}else{d[c.animType]="translate(0px,"+g+"px)";c.$slideTrack.css(d)}},complete:function(){if(e){e.call()}}})}else{c.applyTransition();f=Math.ceil(f);if(c.options.vertical===false){d[c.animType]="translate3d("+f+"px, 0px, 0px)"}else{d[c.animType]="translate3d(0px,"+f+"px, 0px)"}c.$slideTrack.css(d);if(e){setTimeout(function(){c.disableTransition();e.call()},c.options.speed)}}}};b.prototype.getNavTarget=function(){var d=this,c=d.options.asNavFor;if(c&&c!==null){c=a(c).not(d.$slider)}return c};b.prototype.asNavFor=function(e){var d=this,c=d.getNavTarget();if(c!==null&&typeof c==="object"){c.each(function(){var f=a(this).slick("getSlick");if(!f.unslicked){f.slideHandler(e,true)}})}};b.prototype.applyTransition=function(c){var d=this,e={};if(d.options.fade===false){e[d.transitionType]=d.transformType+" "+d.options.speed+"ms "+d.options.cssEase}else{e[d.transitionType]="opacity "+d.options.speed+"ms "+d.options.cssEase}if(d.options.fade===false){d.$slideTrack.css(e)}else{d.$slides.eq(c).css(e)}};b.prototype.autoPlay=function(){var c=this;c.autoPlayClear();if(c.slideCount>c.options.slidesToShow){c.autoPlayTimer=setInterval(c.autoPlayIterator,c.options.autoplaySpeed)}};b.prototype.autoPlayClear=function(){var c=this;if(c.autoPlayTimer){clearInterval(c.autoPlayTimer)}};b.prototype.autoPlayIterator=function(){var c=this,d=c.currentSlide+c.options.slidesToScroll;if(!c.paused&&!c.interrupted&&!c.focussed){if(c.options.infinite===false){if(c.direction===1&&(c.currentSlide+1)===(c.slideCount-1)){c.direction=0}else{if(c.direction===0){d=c.currentSlide-c.options.slidesToScroll;if(c.currentSlide-1===0){c.direction=1}}}}c.slideHandler(d)}};b.prototype.buildArrows=function(){var c=this;if(c.options.arrows===true){c.$prevArrow=a(c.options.prevArrow).addClass("slick-arrow");c.$nextArrow=a(c.options.nextArrow).addClass("slick-arrow");if(c.slideCount>c.options.slidesToShow){c.$prevArrow.removeClass("slick-hidden").removeAttr("aria-hidden tabindex");c.$nextArrow.removeClass("slick-hidden").removeAttr("aria-hidden tabindex");if(c.htmlExpr.test(c.options.prevArrow)){c.$prevArrow.prependTo(c.options.appendArrows)}if(c.htmlExpr.test(c.options.nextArrow)){c.$nextArrow.appendTo(c.options.appendArrows)}if(c.options.infinite!==true){c.$prevArrow.addClass("slick-disabled").attr("aria-disabled","true")}}else{c.$prevArrow.add(c.$nextArrow).addClass("slick-hidden").attr({"aria-disabled":"true","tabindex":"-1"})}}};b.prototype.buildDots=function(){var d=this,e,c;if(d.options.dots===true&&d.slideCount>d.options.slidesToShow){d.$slider.addClass("slick-dotted");c=a("
    ").addClass(d.options.dotsClass);for(e=0;e<=d.getDotCount();e+=1){c.append(a("
  • ").addClass(d.options.dotsClass.slice(0,-1)).append(d.options.customPaging.call(this,d,e)))}d.$dots=c.appendTo(d.options.appendDots);d.$dots.find("li").first().addClass("slick-active")}};b.prototype.buildOut=function(){var c=this;c.$slides=c.$slider.children(c.options.slide+":not(.slick-cloned)").addClass("slick-slide");c.slideCount=c.$slides.length;c.$slides.each(function(d,e){a(e).attr("data-slick-index",d).data("originalStyling",a(e).attr("style")||"")});c.$slider.addClass("slick-slider");c.$slideTrack=(c.slideCount===0)?a('
    ').appendTo(c.$slider):c.$slides.wrapAll('
    ').parent();c.$list=c.$slideTrack.wrap('
    ').parent();c.$slideTrack.css("opacity",0);if(c.options.centerMode===true||c.options.swipeToSlide===true){c.options.slidesToScroll=1}a("img[data-lazy]",c.$slider).not("[src]").addClass("slick-loading");c.setupInfinite();c.buildArrows();c.buildDots();c.updateDots();c.setSlideClasses(typeof c.currentSlide==="number"?c.currentSlide:0);if(c.options.draggable===true){c.$list.addClass("draggable")}};b.prototype.buildRows=function(){var m=this,l,k,i,d,j,h,e,n;d=document.createDocumentFragment();h=m.$slider.children();if(m.options.rows>0){e=m.options.slidesPerRow*m.options.rows;j=Math.ceil(h.length/e);for(l=0;lk.breakpoints[i]){c=k.breakpoints[i]}}}}if(c!==null){if(k.activeBreakpoint!==null){if(c!==k.activeBreakpoint||j){k.activeBreakpoint=c;if(k.breakpointSettings[c]==="unslick"){k.unslick(c)}else{k.options=a.extend({},k.originalSettings,k.breakpointSettings[c]);if(h===true){k.currentSlide=k.options.initialSlide}k.refresh(h)}f=c}}else{k.activeBreakpoint=c;if(k.breakpointSettings[c]==="unslick"){k.unslick(c)}else{k.options=a.extend({},k.originalSettings,k.breakpointSettings[c]);if(h===true){k.currentSlide=k.options.initialSlide}k.refresh(h)}f=c}}else{if(k.activeBreakpoint!==null){k.activeBreakpoint=null;k.options=k.originalSettings;if(h===true){k.currentSlide=k.options.initialSlide}k.refresh(h);f=c}}if(!h&&f!==false){k.$slider.trigger("breakpoint",[k,f])}}};b.prototype.changeSlide=function(g,j){var e=this,c=a(g.currentTarget),i,f,h;if(c.is("a")){g.preventDefault()}if(!c.is("li")){c=c.closest("li")}h=(e.slideCount%e.options.slidesToScroll!==0);i=h?0:(e.slideCount-e.currentSlide)%e.options.slidesToScroll;switch(g.data.message){case"previous":f=i===0?e.options.slidesToScroll:e.options.slidesToShow-i;if(e.slideCount>e.options.slidesToShow){e.slideHandler(e.currentSlide-f,false,j)}break;case"next":f=i===0?e.options.slidesToScroll:i;if(e.slideCount>e.options.slidesToShow){e.slideHandler(e.currentSlide+f,false,j)}break;case"index":var d=g.data.index===0?0:g.data.index||c.index()*e.options.slidesToScroll;e.slideHandler(e.checkNavigable(d),false,j);c.children().trigger("focus");break;default:return}};b.prototype.checkNavigable=function(d){var c=this,e,f;e=c.getNavigableIndexes();f=0;if(d>e[e.length-1]){d=e[e.length-1]}else{for(var g in e){if(dc.options.slidesToShow){c.$prevArrow&&c.$prevArrow.off("click.slick",c.changeSlide);c.$nextArrow&&c.$nextArrow.off("click.slick",c.changeSlide);if(c.options.accessibility===true){c.$prevArrow&&c.$prevArrow.off("keydown.slick",c.keyHandler);c.$nextArrow&&c.$nextArrow.off("keydown.slick",c.keyHandler)}}c.$list.off("touchstart.slick mousedown.slick",c.swipeHandler);c.$list.off("touchmove.slick mousemove.slick",c.swipeHandler);c.$list.off("touchend.slick mouseup.slick",c.swipeHandler);c.$list.off("touchcancel.slick mouseleave.slick",c.swipeHandler);c.$list.off("click.slick",c.clickHandler);a(document).off(c.visibilityChange,c.visibility);c.cleanUpSlideEvents();if(c.options.accessibility===true){c.$list.off("keydown.slick",c.keyHandler)}if(c.options.focusOnSelect===true){a(c.$slideTrack).children().off("click.slick",c.selectHandler)}a(window).off("orientationchange.slick.slick-"+c.instanceUid,c.orientationChange);a(window).off("resize.slick.slick-"+c.instanceUid,c.resize);a("[draggable!=true]",c.$slideTrack).off("dragstart",c.preventDefault);a(window).off("load.slick.slick-"+c.instanceUid,c.setPosition)};b.prototype.cleanUpSlideEvents=function(){var c=this;c.$list.off("mouseenter.slick",a.proxy(c.interrupt,c,true));c.$list.off("mouseleave.slick",a.proxy(c.interrupt,c,false))};b.prototype.cleanUpRows=function(){var d=this,c;if(d.options.rows>0){c=d.$slides.children().children();c.removeAttr("style");d.$slider.empty().append(c)}};b.prototype.clickHandler=function(d){var c=this;if(c.shouldClick===false){d.stopImmediatePropagation();d.stopPropagation();d.preventDefault()}};b.prototype.destroy=function(d){var c=this;c.autoPlayClear();c.touchObject={};c.cleanUpEvents();a(".slick-cloned",c.$slider).detach();if(c.$dots){c.$dots.remove()}if(c.$prevArrow&&c.$prevArrow.length){c.$prevArrow.removeClass("slick-disabled slick-arrow slick-hidden").removeAttr("aria-hidden aria-disabled tabindex").css("display","");if(c.htmlExpr.test(c.options.prevArrow)){c.$prevArrow.remove()}}if(c.$nextArrow&&c.$nextArrow.length){c.$nextArrow.removeClass("slick-disabled slick-arrow slick-hidden").removeAttr("aria-hidden aria-disabled tabindex").css("display","");if(c.htmlExpr.test(c.options.nextArrow)){c.$nextArrow.remove()}}if(c.$slides){c.$slides.removeClass("slick-slide slick-active slick-center slick-visible slick-current").removeAttr("aria-hidden").removeAttr("data-slick-index").each(function(){a(this).attr("style",a(this).data("originalStyling"))});c.$slideTrack.children(this.options.slide).detach();c.$slideTrack.detach();c.$list.detach();c.$slider.append(c.$slides)}c.cleanUpRows();c.$slider.removeClass("slick-slider");c.$slider.removeClass("slick-initialized");c.$slider.removeClass("slick-dotted");c.unslicked=true;if(!d){c.$slider.trigger("destroy",[c])}};b.prototype.disableTransition=function(c){var d=this,e={};e[d.transitionType]="";if(d.options.fade===false){d.$slideTrack.css(e)}else{d.$slides.eq(c).css(e)}};b.prototype.fadeSlide=function(d,e){var c=this;if(c.cssTransitions===false){c.$slides.eq(d).css({zIndex:c.options.zIndex});c.$slides.eq(d).animate({opacity:1},c.options.speed,c.options.easing,e)}else{c.applyTransition(d);c.$slides.eq(d).css({opacity:1,zIndex:c.options.zIndex});if(e){setTimeout(function(){c.disableTransition(d);e.call()},c.options.speed)}}};b.prototype.fadeSlideOut=function(d){var c=this;if(c.cssTransitions===false){c.$slides.eq(d).animate({opacity:0,zIndex:c.options.zIndex-2},c.options.speed,c.options.easing)}else{c.applyTransition(d);c.$slides.eq(d).css({zIndex:c.options.zIndex-2})}};b.prototype.filterSlides=b.prototype.slickFilter=function(d){var c=this;if(d!==null){c.$slidesCache=c.$slides;c.unload();c.$slideTrack.children(this.options.slide).detach();c.$slidesCache.filter(d).appendTo(c.$slideTrack);c.reinit()}};b.prototype.focusHandler=function(){var c=this;c.$slider.off("focus.slick blur.slick").on("focus.slick","*",function(e){var d=a(this);setTimeout(function(){if(c.options.pauseOnFocus){if(d.is(":focus")){c.focussed=true;c.autoPlay()}}},0)}).on("blur.slick","*",function(e){var d=a(this);if(c.options.pauseOnFocus){c.focussed=false;c.autoPlay()}})};b.prototype.getCurrent=b.prototype.slickCurrentSlide=function(){var c=this;return c.currentSlide};b.prototype.getDotCount=function(){var d=this;var f=0;var c=0;var e=0;if(d.options.infinite===true){if(d.slideCount<=d.options.slidesToShow){++e}else{while(fd.options.slidesToShow){d.slideOffset=(d.slideWidth*d.options.slidesToShow)*-1;f=-1;if(d.options.vertical===true&&d.options.centerMode===true){if(d.options.slidesToShow===2){f=-1.5}else{if(d.options.slidesToShow===1){f=-2}}}c=(e*d.options.slidesToShow)*f}if(d.slideCount%d.options.slidesToScroll!==0){if(g+d.options.slidesToScroll>d.slideCount&&d.slideCount>d.options.slidesToShow){if(g>d.slideCount){d.slideOffset=((d.options.slidesToShow-(g-d.slideCount))*d.slideWidth)*-1;c=((d.options.slidesToShow-(g-d.slideCount))*e)*-1}else{d.slideOffset=((d.slideCount%d.options.slidesToScroll)*d.slideWidth)*-1;c=((d.slideCount%d.options.slidesToScroll)*e)*-1}}}}else{if(g+d.options.slidesToShow>d.slideCount){d.slideOffset=((g+d.options.slidesToShow)-d.slideCount)*d.slideWidth;c=((g+d.options.slidesToShow)-d.slideCount)*e}}if(d.slideCount<=d.options.slidesToShow){d.slideOffset=0;c=0}if(d.options.centerMode===true&&d.slideCount<=d.options.slidesToShow){d.slideOffset=((d.slideWidth*Math.floor(d.options.slidesToShow))/2)-((d.slideWidth*d.slideCount)/2)}else{if(d.options.centerMode===true&&d.options.infinite===true){d.slideOffset+=d.slideWidth*Math.floor(d.options.slidesToShow/2)-d.slideWidth}else{if(d.options.centerMode===true){d.slideOffset=0;d.slideOffset+=d.slideWidth*Math.floor(d.options.slidesToShow/2)}}}if(d.options.vertical===false){i=((g*d.slideWidth)*-1)+d.slideOffset}else{i=((g*e)*-1)+c}if(d.options.variableWidth===true){if(d.slideCount<=d.options.slidesToShow||d.options.infinite===false){h=d.$slideTrack.children(".slick-slide").eq(g)}else{h=d.$slideTrack.children(".slick-slide").eq(g+d.options.slidesToShow)}if(d.options.rtl===true){if(h[0]){i=(d.$slideTrack.width()-h[0].offsetLeft-h.width())*-1}else{i=0}}else{i=h[0]?h[0].offsetLeft*-1:0}if(d.options.centerMode===true){if(d.slideCount<=d.options.slidesToShow||d.options.infinite===false){h=d.$slideTrack.children(".slick-slide").eq(g)}else{h=d.$slideTrack.children(".slick-slide").eq(g+d.options.slidesToShow+1)}if(d.options.rtl===true){if(h[0]){i=(d.$slideTrack.width()-h[0].offsetLeft-h.width())*-1}else{i=0}}else{i=h[0]?h[0].offsetLeft*-1:0}i+=(d.$list.width()-h.outerWidth())/2}}return i};b.prototype.getOption=b.prototype.slickGetOption=function(d){var c=this;return c.options[d]};b.prototype.getNavigableIndexes=function(){var f=this,g=0,d=0,e=[],c;if(f.options.infinite===false){c=f.slideCount}else{g=f.options.slidesToScroll*-1;d=f.options.slidesToScroll*-1;c=f.slideCount*2}while(g=0)&&(e.getNavigableIndexes()[j]c.options.slidesToShow){c.$prevArrow.off("click.slick").on("click.slick",{message:"previous"},c.changeSlide);c.$nextArrow.off("click.slick").on("click.slick",{message:"next"},c.changeSlide);if(c.options.accessibility===true){c.$prevArrow.on("keydown.slick",c.keyHandler);c.$nextArrow.on("keydown.slick",c.keyHandler)}}};b.prototype.initDotEvents=function(){var c=this;if(c.options.dots===true&&c.slideCount>c.options.slidesToShow){a("li",c.$dots).on("click.slick",{message:"index"},c.changeSlide);if(c.options.accessibility===true){c.$dots.on("keydown.slick",c.keyHandler)}}if(c.options.dots===true&&c.options.pauseOnDotsHover===true&&c.slideCount>c.options.slidesToShow){a("li",c.$dots).on("mouseenter.slick",a.proxy(c.interrupt,c,true)).on("mouseleave.slick",a.proxy(c.interrupt,c,false))}};b.prototype.initSlideEvents=function(){var c=this;if(c.options.pauseOnHover){c.$list.on("mouseenter.slick",a.proxy(c.interrupt,c,true));c.$list.on("mouseleave.slick",a.proxy(c.interrupt,c,false))}};b.prototype.initializeEvents=function(){var c=this;c.initArrowEvents();c.initDotEvents();c.initSlideEvents();c.$list.on("touchstart.slick mousedown.slick",{action:"start"},c.swipeHandler);c.$list.on("touchmove.slick mousemove.slick",{action:"move"},c.swipeHandler);c.$list.on("touchend.slick mouseup.slick",{action:"end"},c.swipeHandler);c.$list.on("touchcancel.slick mouseleave.slick",{action:"end"},c.swipeHandler);c.$list.on("click.slick",c.clickHandler);a(document).on(c.visibilityChange,a.proxy(c.visibility,c));if(c.options.accessibility===true){c.$list.on("keydown.slick",c.keyHandler)}if(c.options.focusOnSelect===true){a(c.$slideTrack).children().on("click.slick",c.selectHandler)}a(window).on("orientationchange.slick.slick-"+c.instanceUid,a.proxy(c.orientationChange,c));a(window).on("resize.slick.slick-"+c.instanceUid,a.proxy(c.resize,c));a("[draggable!=true]",c.$slideTrack).on("dragstart",c.preventDefault);a(window).on("load.slick.slick-"+c.instanceUid,c.setPosition);a(c.setPosition)};b.prototype.initUI=function(){var c=this;if(c.options.arrows===true&&c.slideCount>c.options.slidesToShow){c.$prevArrow.show();c.$nextArrow.show()}if(c.options.dots===true&&c.slideCount>c.options.slidesToShow){c.$dots.show()}};b.prototype.keyHandler=function(d){var c=this;if(!d.target.tagName.match("TEXTAREA|INPUT|SELECT")){if(d.keyCode===37&&c.options.accessibility===true){c.changeSlide({data:{message:c.options.rtl===true?"next":"previous"}})}else{if(d.keyCode===39&&c.options.accessibility===true){c.changeSlide({data:{message:c.options.rtl===true?"previous":"next"}})}}}};b.prototype.lazyLoad=function(){var k=this,f,e,l,c;function m(i){a("img[data-lazy]",i).each(function(){var q=a(this),r=a(this).attr("data-lazy"),o=a(this).attr("data-srcset"),n=a(this).attr("data-sizes")||k.$slider.attr("data-sizes"),p=document.createElement("img");p.onload=function(){q.animate({opacity:0},100,function(){if(o){q.attr("srcset",o);if(n){q.attr("sizes",n)}}q.attr("src",r).animate({opacity:1},200,function(){q.removeAttr("data-lazy data-srcset data-sizes").removeClass("slick-loading")});k.$slider.trigger("lazyLoaded",[k,q,r])})};p.onerror=function(){q.removeAttr("data-lazy").removeClass("slick-loading").addClass("slick-lazyload-error");k.$slider.trigger("lazyLoadError",[k,q,r])};p.src=r})}if(k.options.centerMode===true){if(k.options.infinite===true){l=k.currentSlide+(k.options.slidesToShow/2+1);c=l+k.options.slidesToShow+2}else{l=Math.max(0,k.currentSlide-(k.options.slidesToShow/2+1));c=2+(k.options.slidesToShow/2+1)+k.currentSlide}}else{l=k.options.infinite?k.options.slidesToShow+k.currentSlide:k.currentSlide;c=Math.ceil(l+k.options.slidesToShow);if(k.options.fade===true){if(l>0){l--}if(c<=k.slideCount){c++}}}f=k.$slider.find(".slick-slide").slice(l,c);if(k.options.lazyLoad==="anticipated"){var d=l-1,g=c,j=k.$slider.find(".slick-slide");for(var h=0;h=k.slideCount-k.options.slidesToShow){e=k.$slider.find(".slick-cloned").slice(0,k.options.slidesToShow);m(e)}else{if(k.currentSlide===0){e=k.$slider.find(".slick-cloned").slice(k.options.slidesToShow*-1);m(e)}}}};b.prototype.loadSlider=function(){var c=this;c.setPosition();c.$slideTrack.css({opacity:1});c.$slider.removeClass("slick-loading");c.initUI();if(c.options.lazyLoad==="progressive"){c.progressiveLazyLoad()}};b.prototype.next=b.prototype.slickNext=function(){var c=this;c.changeSlide({data:{message:"next"}})};b.prototype.orientationChange=function(){var c=this;c.checkResponsive();c.setPosition()};b.prototype.pause=b.prototype.slickPause=function(){var c=this;c.autoPlayClear();c.paused=true};b.prototype.play=b.prototype.slickPlay=function(){var c=this;c.autoPlay();c.options.autoplay=true;c.paused=false;c.focussed=false;c.interrupted=false};b.prototype.postSlide=function(d){var c=this;if(!c.unslicked){c.$slider.trigger("afterChange",[c,d]);c.animating=false;if(c.slideCount>c.options.slidesToShow){c.setPosition()}c.swipeLeft=null;if(c.options.autoplay){c.autoPlay()}if(c.options.accessibility===true){c.initADA();if(c.options.focusOnChange){var e=a(c.$slides.get(c.currentSlide));e.attr("tabindex",0).focus()}}}};b.prototype.prev=b.prototype.slickPrev=function(){var c=this;c.changeSlide({data:{message:"previous"}})};b.prototype.preventDefault=function(c){c.preventDefault()};b.prototype.progressiveLazyLoad=function(f){f=f||1;var e=this,d=a("img[data-lazy]",e.$slider),i,j,g,c,h;if(d.length){i=d.first();j=i.attr("data-lazy");g=i.attr("data-srcset");c=i.attr("data-sizes")||e.$slider.attr("data-sizes");h=document.createElement("img");h.onload=function(){if(g){i.attr("srcset",g);if(c){i.attr("sizes",c)}}i.attr("src",j).removeAttr("data-lazy data-srcset data-sizes").removeClass("slick-loading");if(e.options.adaptiveHeight===true){e.setPosition()}e.$slider.trigger("lazyLoaded",[e,i,j]);e.progressiveLazyLoad()};h.onerror=function(){if(f<3){setTimeout(function(){e.progressiveLazyLoad(f+1)},500)}else{i.removeAttr("data-lazy").removeClass("slick-loading").addClass("slick-lazyload-error");e.$slider.trigger("lazyLoadError",[e,i,j]);e.progressiveLazyLoad()}};h.src=j}else{e.$slider.trigger("allImagesLoaded",[e])}};b.prototype.refresh=function(d){var e=this,f,c;c=e.slideCount-e.options.slidesToShow;if(!e.options.infinite&&(e.currentSlide>c)){e.currentSlide=c}if(e.slideCount<=e.options.slidesToShow){e.currentSlide=0}f=e.currentSlide;e.destroy(true);a.extend(e,e.initials,{currentSlide:f});e.init();if(!d){e.changeSlide({data:{message:"index",index:f}},false)}};b.prototype.registerBreakpoints=function(){var e=this,d,f,c,g=e.options.responsive||null;if(a.type(g)==="array"&&g.length){e.respondTo=e.options.respondTo||"window";for(d in g){c=e.breakpoints.length-1;if(g.hasOwnProperty(d)){f=g[d].breakpoint;while(c>=0){if(e.breakpoints[c]&&e.breakpoints[c]===f){e.breakpoints.splice(c,1)}c--}e.breakpoints.push(f);e.breakpointSettings[f]=g[d].settings}}e.breakpoints.sort(function(i,h){return(e.options.mobileFirst)?i-h:h-i})}};b.prototype.reinit=function(){var c=this;c.$slides=c.$slideTrack.children(c.options.slide).addClass("slick-slide");c.slideCount=c.$slides.length;if(c.currentSlide>=c.slideCount&&c.currentSlide!==0){c.currentSlide=c.currentSlide-c.options.slidesToScroll}if(c.slideCount<=c.options.slidesToShow){c.currentSlide=0}c.registerBreakpoints();c.setProps();c.setupInfinite();c.buildArrows();c.updateArrows();c.initArrowEvents();c.buildDots();c.updateDots();c.initDotEvents();c.cleanUpSlideEvents();c.initSlideEvents();c.checkResponsive(false,true);if(c.options.focusOnSelect===true){a(c.$slideTrack).children().on("click.slick",c.selectHandler)}c.setSlideClasses(typeof c.currentSlide==="number"?c.currentSlide:0);c.setPosition();c.focusHandler();c.paused=!c.options.autoplay;c.autoPlay();c.$slider.trigger("reInit",[c])};b.prototype.resize=function(){var c=this;if(a(window).width()!==c.windowWidth){clearTimeout(c.windowDelay);c.windowDelay=window.setTimeout(function(){c.windowWidth=a(window).width();c.checkResponsive();if(!c.unslicked){c.setPosition()}},50)}};b.prototype.removeSlide=b.prototype.slickRemove=function(d,f,e){var c=this;if(typeof(d)==="boolean"){f=d;d=f===true?0:c.slideCount-1}else{d=f===true?--d:d}if(c.slideCount<1||d<0||d>c.slideCount-1){return false}c.unload();if(e===true){c.$slideTrack.children().remove()}else{c.$slideTrack.children(this.options.slide).eq(d).remove()}c.$slides=c.$slideTrack.children(this.options.slide);c.$slideTrack.children(this.options.slide).detach();c.$slideTrack.append(c.$slides);c.$slidesCache=c.$slides;c.reinit()};b.prototype.setCSS=function(d){var e=this,f={},c,g;if(e.options.rtl===true){d=-d}c=e.positionProp=="left"?Math.ceil(d)+"px":"0px";g=e.positionProp=="top"?Math.ceil(d)+"px":"0px";f[e.positionProp]=d;if(e.transformsEnabled===false){e.$slideTrack.css(f)}else{f={};if(e.cssTransitions===false){f[e.animType]="translate("+c+", "+g+")";e.$slideTrack.css(f)}else{f[e.animType]="translate3d("+c+", "+g+", 0px)";e.$slideTrack.css(f)}}};b.prototype.setDimensions=function(){var c=this;if(c.options.vertical===false){if(c.options.centerMode===true){c.$list.css({padding:("0px "+c.options.centerPadding)})}}else{c.$list.height(c.$slides.first().outerHeight(true)*c.options.slidesToShow);if(c.options.centerMode===true){c.$list.css({padding:(c.options.centerPadding+" 0px")})}}c.listWidth=c.$list.width();c.listHeight=c.$list.height();if(c.options.vertical===false&&c.options.variableWidth===false){c.slideWidth=Math.ceil(c.listWidth/c.options.slidesToShow);c.$slideTrack.width(Math.ceil((c.slideWidth*c.$slideTrack.children(".slick-slide").length)))}else{if(c.options.variableWidth===true){c.$slideTrack.width(5000*c.slideCount)}else{c.slideWidth=Math.ceil(c.listWidth);c.$slideTrack.height(Math.ceil((c.$slides.first().outerHeight(true)*c.$slideTrack.children(".slick-slide").length)))}}var d=c.$slides.first().outerWidth(true)-c.$slides.first().width();if(c.options.variableWidth===false){c.$slideTrack.children(".slick-slide").width(c.slideWidth-d)}};b.prototype.setFade=function(){var c=this,d;c.$slides.each(function(e,f){d=(c.slideWidth*e)*-1;if(c.options.rtl===true){a(f).css({position:"relative",right:d,top:0,zIndex:c.options.zIndex-2,opacity:0})}else{a(f).css({position:"relative",left:d,top:0,zIndex:c.options.zIndex-2,opacity:0})}});c.$slides.eq(c.currentSlide).css({zIndex:c.options.zIndex-1,opacity:1})};b.prototype.setHeight=function(){var d=this;if(d.options.slidesToShow===1&&d.options.adaptiveHeight===true&&d.options.vertical===false){var c=d.$slides.eq(d.currentSlide).outerHeight(true);d.$list.css("height",c)}};b.prototype.setOption=b.prototype.slickSetOption=function(){var d=this,c,h,g,i,f=false,e;if(a.type(arguments[0])==="object"){g=arguments[0];f=arguments[1];e="multiple"}else{if(a.type(arguments[0])==="string"){g=arguments[0];i=arguments[1];f=arguments[2];if(arguments[0]==="responsive"&&a.type(arguments[1])==="array"){e="responsive"}else{if(typeof arguments[1]!=="undefined"){e="single"}}}}if(e==="single"){d.options[g]=i}else{if(e==="multiple"){a.each(g,function(j,k){d.options[j]=k})}else{if(e==="responsive"){for(h in i){if(a.type(d.options.responsive)!=="array"){d.options.responsive=[i[h]]}else{c=d.options.responsive.length-1;while(c>=0){if(d.options.responsive[c].breakpoint===i[h].breakpoint){d.options.responsive.splice(c,1)}c--}d.options.responsive.push(i[h])}}}}}if(f){d.unload();d.reinit()}};b.prototype.setPosition=function(){var c=this;c.setDimensions();c.setHeight();if(c.options.fade===false){c.setCSS(c.getLeft(c.currentSlide))}else{c.setFade()}c.$slider.trigger("setPosition",[c])};b.prototype.setProps=function(){var d=this,c=document.body.style;d.positionProp=d.options.vertical===true?"top":"left";if(d.positionProp==="top"){d.$slider.addClass("slick-vertical")}else{d.$slider.removeClass("slick-vertical")}if(c.WebkitTransition!==undefined||c.MozTransition!==undefined||c.msTransition!==undefined){if(d.options.useCSS===true){d.cssTransitions=true}}if(d.options.fade){if(typeof d.options.zIndex==="number"){if(d.options.zIndex<3){d.options.zIndex=3}}else{d.options.zIndex=d.defaults.zIndex}}if(c.OTransform!==undefined){d.animType="OTransform";d.transformType="-o-transform";d.transitionType="OTransition";if(c.perspectiveProperty===undefined&&c.webkitPerspective===undefined){d.animType=false}}if(c.MozTransform!==undefined){d.animType="MozTransform";d.transformType="-moz-transform";d.transitionType="MozTransition";if(c.perspectiveProperty===undefined&&c.MozPerspective===undefined){d.animType=false}}if(c.webkitTransform!==undefined){d.animType="webkitTransform";d.transformType="-webkit-transform";d.transitionType="webkitTransition";if(c.perspectiveProperty===undefined&&c.webkitPerspective===undefined){d.animType=false}}if(c.msTransform!==undefined){d.animType="msTransform";d.transformType="-ms-transform";d.transitionType="msTransition";if(c.msTransform===undefined){d.animType=false}}if(c.transform!==undefined&&d.animType!==false){d.animType="transform";d.transformType="transform";d.transitionType="transition"}d.transformsEnabled=d.options.useTransform&&(d.animType!==null&&d.animType!==false)};b.prototype.setSlideClasses=function(g){var f=this,c,e,i,h;e=f.$slider.find(".slick-slide").removeClass("slick-active slick-center slick-current").attr("aria-hidden","true");f.$slides.eq(g).addClass("slick-current");if(f.options.centerMode===true){var d=f.options.slidesToShow%2===0?1:0;c=Math.floor(f.options.slidesToShow/2);if(f.options.infinite===true){if(g>=c&&g<=(f.slideCount-1)-c){f.$slides.slice(g-c+d,g+c+1).addClass("slick-active").attr("aria-hidden","false")}else{i=f.options.slidesToShow+g;e.slice(i-c+1+d,i+c+2).addClass("slick-active").attr("aria-hidden","false")}if(g===0){e.eq(e.length-1-f.options.slidesToShow).addClass("slick-center")}else{if(g===f.slideCount-1){e.eq(f.options.slidesToShow).addClass("slick-center")}}}f.$slides.eq(g).addClass("slick-center")}else{if(g>=0&&g<=(f.slideCount-f.options.slidesToShow)){f.$slides.slice(g,g+f.options.slidesToShow).addClass("slick-active").attr("aria-hidden","false")}else{if(e.length<=f.options.slidesToShow){e.addClass("slick-active").attr("aria-hidden","false")}else{h=f.slideCount%f.options.slidesToShow;i=f.options.infinite===true?f.options.slidesToShow+g:g;if(f.options.slidesToShow==f.options.slidesToScroll&&(f.slideCount-g)c.options.slidesToShow){if(c.options.centerMode===true){e=c.options.slidesToShow+1}else{e=c.options.slidesToShow}for(d=c.slideCount;d>(c.slideCount-e);d-=1){f=d-1;a(c.$slides[f]).clone(true).attr("id","").attr("data-slick-index",f-c.slideCount).prependTo(c.$slideTrack).addClass("slick-cloned")}for(d=0;dk.getDotCount()*k.options.slidesToScroll)){if(k.options.fade===false){d=k.currentSlide;if(e!==true&&k.slideCount>k.options.slidesToShow){k.animateSlide(j,function(){k.postSlide(d)})}else{k.postSlide(d)}}return}else{if(k.options.infinite===false&&k.options.centerMode===true&&(f<0||f>(k.slideCount-k.options.slidesToScroll))){if(k.options.fade===false){d=k.currentSlide;if(e!==true&&k.slideCount>k.options.slidesToShow){k.animateSlide(j,function(){k.postSlide(d)})}else{k.postSlide(d)}}return}}if(k.options.autoplay){clearInterval(k.autoPlayTimer)}if(d<0){if(k.slideCount%k.options.slidesToScroll!==0){l=k.slideCount-(k.slideCount%k.options.slidesToScroll)}else{l=k.slideCount+d}}else{if(d>=k.slideCount){if(k.slideCount%k.options.slidesToScroll!==0){l=0}else{l=d-k.slideCount}}else{l=d}}k.animating=true;k.$slider.trigger("beforeChange",[k,k.currentSlide,l]);h=k.currentSlide;k.currentSlide=l;k.setSlideClasses(k.currentSlide);if(k.options.asNavFor){c=k.getNavTarget();c=c.slick("getSlick");if(c.slideCount<=c.options.slidesToShow){c.setSlideClasses(k.currentSlide)}}k.updateDots();k.updateArrows();if(k.options.fade===true){if(e!==true){k.fadeSlideOut(h);k.fadeSlide(l,function(){k.postSlide(l)})}else{k.postSlide(l)}k.animateHeight();return}if(e!==true&&k.slideCount>k.options.slidesToShow){k.animateSlide(g,function(){k.postSlide(l)})}else{k.postSlide(l)}};b.prototype.startLoad=function(){var c=this;if(c.options.arrows===true&&c.slideCount>c.options.slidesToShow){c.$prevArrow.hide();c.$nextArrow.hide()}if(c.options.dots===true&&c.slideCount>c.options.slidesToShow){c.$dots.hide()}c.$slider.addClass("slick-loading")};b.prototype.swipeDirection=function(){var c,f,e,g,d=this;c=d.touchObject.startX-d.touchObject.curX;f=d.touchObject.startY-d.touchObject.curY;e=Math.atan2(f,c);g=Math.round(e*180/Math.PI);if(g<0){g=360-Math.abs(g)}if((g<=45)&&(g>=0)){return(d.options.rtl===false?"left":"right")}if((g<=360)&&(g>=315)){return(d.options.rtl===false?"left":"right")}if((g>=135)&&(g<=225)){return(d.options.rtl===false?"right":"left")}if(d.options.verticalSwiping===true){if((g>=35)&&(g<=135)){return"down"}else{return"up"}}return"vertical"};b.prototype.swipeEnd=function(e){var d=this,c,f;d.dragging=false;d.swiping=false;if(d.scrolling){d.scrolling=false;return false}d.interrupted=false;d.shouldClick=(d.touchObject.swipeLength>10)?false:true;if(d.touchObject.curX===undefined){return false}if(d.touchObject.edgeHit===true){d.$slider.trigger("edge",[d,d.swipeDirection()])}if(d.touchObject.swipeLength>=d.touchObject.minSwipe){f=d.swipeDirection();switch(f){case"left":case"down":c=d.options.swipeToSlide?d.checkNavigable(d.currentSlide+d.getSlideCount()):d.currentSlide+d.getSlideCount();d.currentDirection=0;break;case"right":case"up":c=d.options.swipeToSlide?d.checkNavigable(d.currentSlide-d.getSlideCount()):d.currentSlide-d.getSlideCount();d.currentDirection=1;break;default:}if(f!="vertical"){d.slideHandler(c);d.touchObject={};d.$slider.trigger("swipe",[d,f])}}else{if(d.touchObject.startX!==d.touchObject.curX){d.slideHandler(d.currentSlide);d.touchObject={}}}};b.prototype.swipeHandler=function(d){var c=this;if((c.options.swipe===false)||("ontouchend" in document&&c.options.swipe===false)){return}else{if(c.options.draggable===false&&d.type.indexOf("mouse")!==-1){return}}c.touchObject.fingerCount=d.originalEvent&&d.originalEvent.touches!==undefined?d.originalEvent.touches.length:1;c.touchObject.minSwipe=c.listWidth/c.options.touchThreshold;if(c.options.verticalSwiping===true){c.touchObject.minSwipe=c.listHeight/c.options.touchThreshold}switch(d.data.action){case"start":c.swipeStart(d);break;case"move":c.swipeMove(d);break;case"end":c.swipeEnd(d);break}};b.prototype.swipeMove=function(c){var k=this,g=false,e,i,f,j,h,d;h=c.originalEvent!==undefined?c.originalEvent.touches:null;if(!k.dragging||k.scrolling||h&&h.length!==1){return false}e=k.getLeft(k.currentSlide);k.touchObject.curX=h!==undefined?h[0].pageX:c.clientX;k.touchObject.curY=h!==undefined?h[0].pageY:c.clientY;k.touchObject.swipeLength=Math.round(Math.sqrt(Math.pow(k.touchObject.curX-k.touchObject.startX,2)));d=Math.round(Math.sqrt(Math.pow(k.touchObject.curY-k.touchObject.startY,2)));if(!k.options.verticalSwiping&&!k.swiping&&d>4){k.scrolling=true;return false}if(k.options.verticalSwiping===true){k.touchObject.swipeLength=d}i=k.swipeDirection();if(c.originalEvent!==undefined&&k.touchObject.swipeLength>4){k.swiping=true;c.preventDefault()}j=(k.options.rtl===false?1:-1)*(k.touchObject.curX>k.touchObject.startX?1:-1);if(k.options.verticalSwiping===true){j=k.touchObject.curY>k.touchObject.startY?1:-1}f=k.touchObject.swipeLength;k.touchObject.edgeHit=false;if(k.options.infinite===false){if((k.currentSlide===0&&i==="right")||(k.currentSlide>=k.getDotCount()&&i==="left")){f=k.touchObject.swipeLength*k.options.edgeFriction;k.touchObject.edgeHit=true}}if(k.options.vertical===false){k.swipeLeft=e+f*j}else{k.swipeLeft=e+(f*(k.$list.height()/k.listWidth))*j}if(k.options.verticalSwiping===true){k.swipeLeft=e+f*j}if(k.options.fade===true||k.options.touchMove===false){return false}if(k.animating===true){k.swipeLeft=null;return false}k.setCSS(k.swipeLeft)};b.prototype.swipeStart=function(d){var c=this,e;c.interrupted=true;if(c.touchObject.fingerCount!==1||c.slideCount<=c.options.slidesToShow){c.touchObject={};return false}if(d.originalEvent!==undefined&&d.originalEvent.touches!==undefined){e=d.originalEvent.touches[0]}c.touchObject.startX=c.touchObject.curX=e!==undefined?e.pageX:d.clientX;c.touchObject.startY=c.touchObject.curY=e!==undefined?e.pageY:d.clientY;c.dragging=true};b.prototype.unfilterSlides=b.prototype.slickUnfilter=function(){var c=this;if(c.$slidesCache!==null){c.unload();c.$slideTrack.children(this.options.slide).detach();c.$slidesCache.appendTo(c.$slideTrack);c.reinit()}};b.prototype.unload=function(){var c=this;a(".slick-cloned",c.$slider).remove();if(c.$dots){c.$dots.remove()}if(c.$prevArrow&&c.htmlExpr.test(c.options.prevArrow)){c.$prevArrow.remove()}if(c.$nextArrow&&c.htmlExpr.test(c.options.nextArrow)){c.$nextArrow.remove()}c.$slides.removeClass("slick-slide slick-active slick-visible slick-current").attr("aria-hidden","true").css("width","")};b.prototype.unslick=function(d){var c=this;c.$slider.trigger("unslick",[c,d]);c.destroy()};b.prototype.updateArrows=function(){var d=this,c;c=Math.floor(d.options.slidesToShow/2);if(d.options.arrows===true&&d.slideCount>d.options.slidesToShow&&!d.options.infinite){d.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false");d.$nextArrow.removeClass("slick-disabled").attr("aria-disabled","false");if(d.currentSlide===0){d.$prevArrow.addClass("slick-disabled").attr("aria-disabled","true");d.$nextArrow.removeClass("slick-disabled").attr("aria-disabled","false")}else{if(d.currentSlide>=d.slideCount-d.options.slidesToShow&&d.options.centerMode===false){d.$nextArrow.addClass("slick-disabled").attr("aria-disabled","true");d.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false")}else{if(d.currentSlide>=d.slideCount-1&&d.options.centerMode===true){d.$nextArrow.addClass("slick-disabled").attr("aria-disabled","true");d.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false")}}}}};b.prototype.updateDots=function(){var c=this;if(c.$dots!==null){c.$dots.find("li").removeClass("slick-active").end();c.$dots.find("li").eq(Math.floor(c.currentSlide/c.options.slidesToScroll)).addClass("slick-active")}};b.prototype.visibility=function(){var c=this;if(c.options.autoplay){if(document[c.hidden]){c.interrupted=true}else{c.interrupted=false}}};a.fn.slick=function(){var f=this,h=arguments[0],e=Array.prototype.slice.call(arguments,1),c=f.length,g,d;for(g=0;g