1!function(e){e.widget("ui.rcarousel",{_create:function(){var t,a=e(this.element),n=this,i=this.options;this._checkOptionsValidity(this.options),this._createDataObject(),t=a.data("data"),a.addClass("ui-carousel").children().wrapAll("<div class='wrapper'></div>"),this._saveElements(),this._generatePages(),this._loadElements(),this._setCarouselWidth(),this._setCarouselHeight(),e(i.navigation.next).click(function(e){n.next(),e.preventDefault()}),e(i.navigation.prev).click(function(e){n.prev(),e.preventDefault()}),t.navigation.next=e(i.navigation.next),t.navigation.prev=e(i.navigation.prev),a.hover(function(){i.auto.enabled&&(clearInterval(t.interval),t.hoveredOver=!0)},function(){i.auto.enabled&&(t.hoveredOver=!1,n._autoMode(i.auto.direction))}),this._setStep(),i.auto.enabled&&this._autoMode(i.auto.direction),this._trigger("start")},_addElement:function(t,a){var n=e(this.element),i=n.find("div.wrapper"),o=this.options;t.width(o.width).height(o.height),"horizontal"===o.orientation?e(t).css("marginRight",o.margin):e(t).css({marginBottom:o.margin,"float":"none"}),"prev"===a?i.prepend(t.clone(!0,!0)):i.append(t.clone(!0,!0))},append:function(t){var a=e(this.element),n=a.data("data");t.each(function(t,a){n.paths.push(e(a))}),n.oldPage=n.pages[n.oldPageIndex].slice(0),n.appended=!0,this._generatePages()},_autoMode:function(t){var a=this.options,n=e(this.element).data("data");n.interval="next"===t?setTimeout(e.proxy(this.next,this),a.auto.interval):setTimeout(e.proxy(this.prev,this),a.auto.interval)},_checkOptionsValidity:function(t){var a,n=this,i="";e.each(t,function(o,r){switch(o){case"visible":if(!r||"number"!=typeof r||0>=r||Math.ceil(r)-r>0)throw new Error("visible should be defined as a positive integer");break;case"step":if(!r||"number"!=typeof r||0>=r||Math.ceil(r)-r>0)throw new Error("step should be defined as a positive integer");if(r>n.options.visible){for(a=1;a<=Math.floor(t.visible);a++)i+=a<Math.floor(r)?a+", ":a;throw new Error("Only following step values are correct: "+i)}break;case"width":if(!r||"number"!=typeof r||0>=r||Math.ceil(r)-r>0)throw new Error("width should be defined as a positive integer");break;case"height":if(!r||"number"!=typeof r||0>=r||Math.ceil(r)-r>0)throw new Error("height should be defined as a positive integer");break;case"speed":if(!r&&0!==r)throw new Error("speed should be defined as a number or a string");if("number"==typeof r&&0>r)throw new Error("speed should be a positive number");if("string"==typeof r&&"slow"!==r&&"normal"!==r&&"fast"!==r)throw new Error('Only "slow", "normal" and "fast" values are valid');break;case"navigation":if(!r||e.isPlainObject(r)===!1)throw new Error("navigation should be defined as an object with at least one of the properties: 'prev' or 'next' in it");if(r.prev&&"string"!=typeof r.prev)throw new Error("navigation.prev should be defined as a string and point to '.class' or '#id' of an element");if(r.next&&"string"!=typeof r.next)throw new Error(" navigation.next should be defined as a string and point to '.class' or '#id' of an element");break;case"auto":if("string"!=typeof r.direction)throw new Error("direction should be defined as a string");if("next"!==r.direction&&"prev"!==r.direction)throw new Error("direction: only 'right' and 'left' values are valid");if(isNaN(r.interval)||"number"!=typeof r.interval||r.interval<0||Math.ceil(r.interval)-r.interval>0)throw new Error("interval should be a positive number");break;case"margin":if(isNaN(r)||"number"!=typeof r||0>r||Math.ceil(r)-r>0)throw new Error("margin should be a positive number")}})},_createDataObject:function(){var t=e(this.element);t.data("data",{paths:[],pathsLen:0,pages:[],lastPage:[],oldPageIndex:0,pageIndex:0,navigation:{},animated:!1,appended:!1,hoveredOver:!1})},_generatePages:function(){function t(){s.pages=[],s.lastPage=[],s.pages[0]=[];for(var e=l-1;e>=l-d;e--)s.lastPage.unshift(s.paths[e]);for(var e=0;d>e;e++)s.pages[0][s.pages[0].length]=s.paths[e]}function a(e){for(var t=!1,a=0;a<s.lastPage.length;a++){if(s.lastPage[a].get(0)!==e[a].get(0)){t=!1;break}t=!0}return t}function n(e,t,a){var n=a||s.pages.length;a||(s.pages[n]=[]);for(var i=e;t>i;i++)s.pages[n].push(s.paths[i]);return n}function i(){for(var e=!0,t=!1,i=r.step,o,h,p,g;!a(s.pages[s.pages.length-1])||e;)e=!1,o=i+d,o>l&&(o=l),t=d>o-i?!0:!1,t?(p=i-(d-(o-i)),g=p+(d-(o-i)),h=n(p,g),n(i,o,h)):(n(i,o),i+=r.step)}var o=this,r=this.options,s=e(this.element).data("data"),d=r.visible,l=s.paths.length;t(),i()},getCurrentPage:function(){var t=e(this.element).data("data");return t.pageIndex+1},getTotalPages:function(){var t=e(this.element).data("data");return t.pages.length},goToPage:function(t){var a,n=e(this.element).data("data");n.animated||t===n.pageIndex||(n.animated=!0,t>n.pages.length-1?t=n.pages.length-1:0>t&&(t=0),n.pageIndex=t,a=t-n.oldPageIndex,a>=0?this._goToNextPage(a):this._goToPrevPage(a),n.oldPageIndex=t)},_loadElements:function(t,a){var n=this.options,i=e(this.element).data("data"),o=a||"next",r=t||i.pages[n.startAtPage],s=0,d=r.length;if("next"===o)for(var l=s;d>l;l++)this._addElement(r[l],o);else for(var l=d-1;l>=s;l--)this._addElement(r[l],o)},_goToPrevPage:function(t){var a,n,i,o,r,s,d,l,h,p=e(this.element),g=this,v=this.options,c=e(this.element).data("data");n=c.appended?c.oldPage:c.pages[c.oldPageIndex],o=c.oldPageIndex+t,a=c.pages[o].slice(0),e(a).each(function(t,a){h=a.get(0)===e(n[t]).get(0)?!0:!1}),c.appended&&h&&(o=0===c.pageIndex?c.pageIndex=c.pages.length-1:--c.pageIndex,a=c.pages[o].slice(0)),s=a[a.length-1].get(0);for(var f=n.length-1;f>=0;f--){if(s===e(n[f]).get(0)){d=!1,l=f;break}d=!0}if(!d)for(;l>=0;)a[a.length-1].get(0)===n[l].get(0)&&a.pop(),--l;g._loadElements(a,"prev"),i=v.width*a.length+v.margin*a.length,"horizontal"===v.orientation?(r={scrollLeft:0},p.scrollLeft(i)):(r={scrollTop:0},p.scrollTop(i)),p.animate(r,v.speed,function(){g._removeOldElements("last",a.length),c.animated=!1,!c.hoveredOver&&v.auto.enabled&&(clearInterval(c.interval),g._autoMode(v.auto.direction)),g._trigger("pageLoaded",null,{page:o})}),c.appended=!1},_goToNextPage:function(t){var a,n,i,o,r,s,d,l,h,p=e(this.element),g=this.options,v=p.data("data"),c=this;n=v.appended?v.oldPage:v.pages[v.oldPageIndex],o=v.oldPageIndex+t,a=v.pages[o].slice(0),e(a).each(function(t,a){h=a.get(0)===e(n[t]).get(0)?!0:!1}),v.appended&&h&&(a=v.pages[++v.pageIndex].slice(0)),s=a[0].get(0);for(var f=0;f<a.length;f++){if(s===e(n[f]).get(0)){d=!1,l=f;break}d=!0}if(!d)for(;l<n.length;)a[0].get(0)===n[l].get(0)&&a.shift(),++l;this._loadElements(a,"next"),i=g.width*a.length+g.margin*a.length,r="horizontal"===g.orientation?{scrollLeft:"+="+i}:{scrollTop:"+="+i},p.animate(r,g.speed,function(){c._removeOldElements("first",a.length),"horizontal"===g.orientation?p.scrollLeft(0):p.scrollTop(0),v.animated=!1,!v.hoveredOver&&g.auto.enabled&&(clearInterval(v.interval),c._autoMode(g.auto.direction)),c._trigger("pageLoaded",null,{page:o})}),v.appended=!1},next:function(){var t=this.options,a=e(this.element).data("data");a.animated||(a.animated=!0,a.appended||++a.pageIndex,a.pageIndex>a.pages.length-1&&(a.pageIndex=0),this._goToNextPage(a.pageIndex-a.oldPageIndex),a.oldPageIndex=a.pageIndex)},prev:function(){var t=this.options,a=e(this.element).data("data");a.animated||(a.animated=!0,a.appended||--a.pageIndex,a.pageIndex<0&&(a.pageIndex=a.pages.length-1),this._goToPrevPage(a.pageIndex-a.oldPageIndex),a.oldPageIndex=a.pageIndex)},_removeOldElements:function(t,a){for(var n=e(this.element),i=0;a>i;i++)"first"===t?n.find("div.wrapper").children().first().remove():n.find("div.wrapper").children().last(
1).remove()},_saveElements:function(){var t,a=e(this.element),n=a.find("div.wrapper").children(),i=a.data("data");n.each(function(a,n){t=e(n),i.paths.push(t.clone(!0,!0)),t.remove()})},_setOption:function(t,a){var n,i=this.options,o=e(this.element).data("data");switch(t){case"speed":this._checkOptionsValidity({speed:a}),i.speed=a,e.Widget.prototype._setOption.apply(this,arguments);break;case"auto":n=e.extend(i.auto,a),this._checkOptionsValidity({auto:n}),i.auto.enabled&&this._autoMode(i.auto.direction)}},_setStep:function(t){var a,n=this.options,i=e(this.element).data("data");a=t||n.step,n.step=a,i.step=n.width*a},_setCarouselHeight:function(){var t,a=e(this.element),n=e(this.element).data("data"),i=this.options;t="vertical"===i.orientation?i.visible*i.height+i.margin*(i.visible-1):i.height,a.height(t)},_setCarouselWidth:function(){var t,a=e(this.element),n=this.options,i=e(this.element).data("data");t="horizontal"===n.orientation?n.visible*n.width+n.margin*(n.visible-1):n.width,a.css({width:t,overflow:"hidden"})},options:{visible:3,step:3,width:100,height:100,speed:1e3,margin:0,orientation:"horizontal",auto:{enabled:!1,direction:"next",interval:5e3},startAtPage:0,navigation:{next:"#ui-carousel-next",prev:"#ui-carousel-prev"}}})}(jQuery);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.