jQuery(function($){"use strict";var on_touch=ts_is_touch_device();ts_mega_menu_change_state($('body').innerWidth());$('.widget_nav_menu .menu-item-has-children .sub-menu').before('');if(on_touch||$(window).width()<768){ts_menu_action_on_ipad();} if(typeof boxshop_params!='undefined'&&boxshop_params.sticky_header==1){ts_sticky_menu();} $(window).on('resize orientationchange',$.throttle(250,function(){ts_mega_menu_change_state($('body').innerWidth());ts_set_cloud_zoom();}));if(on_touch){$(document).on('click','.ts-tiny-cart-wrapper span.drop-icon',function(){var dropdown_form=$(this).parent().siblings('.dropdown-container');$(this).parent().parent().toggleClass('active');return false;});} if(on_touch){$('.header-currency a.wcml_selected_currency').on('click',function(){$('.header-currency').toggleClass('active');});$('.header-language a.lang_sel_sel').on('click',function(){$('.header-language').toggleClass('active');return false;});} if($('html').offset().top<100){$("#to-top").hide().addClass("off");} $(window).on('scroll',function(){if($(this).scrollTop()>100){$("#to-top").removeClass("off").addClass("on");}else{$("#to-top").removeClass("on").addClass("off");}});$('#to-top .scroll-button').on('click',function(){$('body,html').animate({scrollTop:'0px'},1000);return false;});ts_quickshop_handle();$('body').on('added_to_wishlist',function(){ts_update_tini_wishlist();$('.yith-wcwl-wishlistaddedbrowse.show, .yith-wcwl-wishlistexistsbrowse.show').closest('.button-in.wishlist').addClass('added');});$('body').on('removed_from_wishlist added_to_cart',function(){if($('.wishlist_table').length){ts_update_tini_wishlist();}});ts_set_cloud_zoom();if($('.cloud-zoom, .cloud-zoom-gallery').length>0){$(document).on('found_variation reset_image','form.variations_form',function(){$('.cloud-zoom, .cloud-zoom-gallery').CloudZoom({});});} if($('body').hasClass('single-product')&&typeof PhotoSwipe!=='undefined'){$('.images-thumbnails').on('click','.woocommerce-product-gallery__image a',function(e){e.preventDefault();var items=ts_get_single_product_gallery_items();var index=$(this).find('img').attr('data-index');var pswpElement=$('.pswp')[0];var options={index:parseInt(index),shareEl:false,closeOnScroll:false,history:false,hideAnimationDuration:0,showAnimationDuration:0};var photoswipe=new PhotoSwipe(pswpElement,PhotoSwipeUI_Default,items,options);photoswipe.init();});} function ts_get_single_product_gallery_items(){var items=[];$('.images-thumbnails .woocommerce-product-gallery__image a').each(function(index,ele){if($(ele).parents('.owl-item.cloned').length==0){var img=$(ele).find('img');var large_image_src=img.attr('data-large_image');var large_image_w=img.attr('data-large_image_width');var large_image_h=img.attr('data-large_image_height');var item={src:large_image_src,w:large_image_w,h:large_image_h,title:img.attr('title')};items.push(item);}});if($('.vertical-thumbnail').length>0&&items.length>1){var main_thumbnail=items.pop();items.unshift(main_thumbnail);$('.images-thumbnails > .thumbnails img').each(function(index,ele){$(ele).attr('data-index',index+1);});} return items;} function single_variable_product_reset_stock(wrapper){var stock_html=wrapper.find('p.availability').data('original');var classes=wrapper.find('p.availability').data('class');if(classes==''){classes='in-stock';} wrapper.find('p.availability span').html(stock_html);wrapper.find('p.availability').removeClass('in-stock out-of-stock').addClass(classes);} $(document).on('found_variation','form.variations_form',function(){var wrapper=$(this).parents('.summary');if(wrapper.find('.single_variation .stock').length>0){var stock_html=wrapper.find('.single_variation .stock').html();var classes=wrapper.find('.single_variation .stock').hasClass('out-of-stock')?'out-of-stock':'in-stock';wrapper.find('p.availability span').html(stock_html);wrapper.find('p.availability').removeClass('in-stock out-of-stock').addClass(classes);} else{single_variable_product_reset_stock(wrapper);}});$(document).on('reset_image','form.variations_form',function(){var wrapper=$(this).parents('.summary');single_variable_product_reset_stock(wrapper);});$(document).on('update_variation_values','form.variations_form',function(){if($(this).find('.ts-product-attribute').length>0){$(this).find('.ts-product-attribute').each(function(){var attr=$(this);var values=[];attr.siblings('select').find('option').each(function(){if($(this).attr('value')){values.push($(this).attr('value'));}});attr.find('.option').removeClass('hidden');attr.find('.option').each(function(){if($.inArray($(this).attr('data-value'),values)==-1){$(this).addClass('hidden');}});});}});$('form.woocommerce-ordering ul.orderby ul a').on('click',function(e){e.preventDefault();if($(this).hasClass('current')){return;} var form=$(this).closest('form.woocommerce-ordering');var data=$(this).attr('data-orderby');form.find('select.orderby').val(data).trigger('change');});if(typeof $.fn.select2=='function'){$('.ts-search-by-category select.select-category').select2();var MutationObserver=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;$.fn.attrchange=function(callback){if(MutationObserver){var options={subtree:false,attributes:true};var observer=new MutationObserver(function(mutations){mutations.forEach(function(e){callback.call(e.target,e.attributeName);});});return this.each(function(){observer.observe(this,options);});}} $('.ts-header .ts-search-by-category .select2-container').attrchange(function(attrName){if(attrName=='class'){if($(this).hasClass('select2-container--open')){$('body > .select2-container--open').addClass('category-dropdown');$('body > .select2-container--open').removeClass('sticky');} else{$('body > .select2-container--open').removeClass('category-dropdown');}}});} $('.widget-title-wrapper a.block-control').on('click',function(e){e.preventDefault();$(this).parent().siblings(':not(script)').slideToggle(400);$(this).toggleClass('active');});ts_widget_toggle();if(!on_touch){$(window).on('resize',$.throttle(250,function(){ts_widget_toggle();}));} if($('img.ts-lazy-load').length){$(window).on('scroll ts_lazy_load',function(){var scroll_top=$(this).scrollTop();var window_height=$(this).height();$('img.ts-lazy-load:not(.loaded)').each(function(){if($(this).data('src')&&$(this).offset().top0){if(selector.find('option[value="'+val+'"]').length>0){selector.val(val).change();_this.closest('.ts-product-attribute').find('.option').removeClass('selected');_this.closest('.option').addClass('selected');}} return false;});$('.variations_form').on('click','.reset_variations',function(){$(this).closest('.variations').find('.ts-product-attribute .option').removeClass('selected');});if($('.single-product').length>0){var wrapper=$('.single-product .product:not(.vertical-thumbnail) .images-thumbnails .thumbnails.loading');wrapper.find('.product-thumbnails').owlCarousel({loop:true,nav:true,navText:[,],dots:false,navSpeed:1000,rtl:$('body').hasClass('rtl'),margin:20,navRewind:false,autoplay:true,autoplayHoverPause:true,autoplaySpeed:1000,responsiveBaseElement:wrapper,responsiveRefreshRate:1000,responsive:{0:{items:2},210:{items:2},320:{items:3},470:{items:4},600:{items:5}},onInitialized:function(){wrapper.addClass('loaded').removeClass('loading');}});var wrapper=$('.single-product .product.vertical-thumbnail .images-thumbnails .thumbnails.loading');if(wrapper.length>0&&typeof $.fn.carouFredSel=='function'){var items=4;if($('#left-sidebar').length>0||$('#right-sidebar').length>0){items=3;} if($('#left-sidebar').length>0&&$('#right-sidebar').length>0){items=4;} var _slider_data={items:items,direction:'up',width:'auto',height:'150px',infinite:true,prev:wrapper.find('.owl-prev'),next:wrapper.find('.owl-next'),auto:{play:true,timeoutDuration:5000,duration:800,delay:3000,items:1,pauseOnHover:true},scroll:{items:1},swipe:{onTouch:true,onMouse:true},onCreate:function(){wrapper.addClass('loaded').removeClass('loading');}};wrapper.find('.product-thumbnails').carouFredSel(_slider_data);$(window).on('resize orientationchange',$.debounce(250,function(){if($(window).width()<280){_slider_data.items=2;} else if($(window).width()<500){_slider_data.items=3;} else if($(window).width()<768){_slider_data.items=4;} else{_slider_data.items=items;} wrapper.find('.product-thumbnails').trigger('configuration',_slider_data);}));$(window).trigger('resize');}} if(typeof $.fn.prettyPhoto=='function'){$('a.ts-product-video-button').prettyPhoto({deeplinking:false,opacity:0.9,social_tools:false,default_width:900,default_height:472,theme:'ts-product-video',changepicturecallback:function(){$('.ts-product-video').addClass('loaded');}});} $('.single-product .related .products, .single-product .upsells .products, .woocommerce .cross-sells .products').each(function(){var _this=$(this);if(_this.find('.product').length>1){_this.owlCarousel({loop:true,nav:true,navText:[,],dots:false,navSpeed:1000,rtl:$('body').hasClass('rtl'),margin:20,navRewind:false,responsiveBaseElement:_this,responsiveRefreshRate:1000,responsive:{0:{items:1},300:{items:2},579:{items:3},767:{items:4},881:{items:5}}});}});if(typeof $.fn.YTPlayer=='function'){$('.ts-youtube-video-bg').each(function(index,element){var selector=$(this);var poster=selector.data('poster');var property=selector.data('property')&&typeof selector.data('property')=='string'?eval('('+selector.data('property')+')'):selector.data('property');var vol=50;if(property.mute){vol=0;} if(!on_touch){var player=selector.YTPlayer({mute:property.mute,vol:vol});player.on('YTPStart',function(){selector.removeClass('pausing playing').addClass('playing');selector.closest('.vc_row').addClass('playing');if(poster){selector.css({'background-image':''});selector.find('.mbYTP_wrapper').css({'opacity':1});} if(property.mute){player.get(0).player.mute();}});player.on('YTPPause',function(){selector.removeClass('pausing playing').addClass('pausing');selector.closest('.vc_row').removeClass('playing');if(poster){selector.css({'background-image':'url('+poster+')'});selector.find('.mbYTP_wrapper').css({'opacity':0});}});player.on('YTPChanged',function(){if(!property.autoPlay&&poster){selector.css({'background-image':'url('+poster+')'});}});} else if(poster){selector.css({'background-image':'url('+poster+')'});}});} $('.ts-hosted-video-bg').each(function(){var selector=$(this);var video=selector.find('video');var video_dom=selector.find('video').get(0);if(video.hasClass('loop')){video_dom.loop=true;} if(video.hasClass('muted')){video_dom.muted=true;} var poster=selector.data('poster');if(poster){selector.css({'background-image':'url('+poster+')'});} var control=selector.find('.video-control');control.on('click',function(){if(!selector.hasClass('playing')){video_dom.play();selector.css({'background-image':''});selector.removeClass('pausing').addClass('playing');selector.closest('.vc_row').addClass('playing');} else{video_dom.pause();if(poster){selector.css({'background-image':'url('+poster+')'});} selector.removeClass('playing').addClass('pausing');selector.closest('.vc_row').removeClass('playing');}});if(!on_touch){selector.addClass('pausing');if(video.hasClass('autoplay')){control.trigger('click');}}});$('.single-product .vc_tta-accordion .vc_tta-panel-heading').on('click',function(){if($(this).parents('.vc_tta-panel').hasClass('vc_active')){return;} var acc_header=$(this);var header_sticky=0;if(!on_touch){if($('.is-sticky .header-sticky').length>0){header_sticky=$('.is-sticky .header-sticky').height();} else if(typeof boxshop_params!='undefined'&&boxshop_params.sticky_header==1&&$('.header-sticky').length>0){header_sticky=$('.header-sticky').height();}} setTimeout(function(){$('body,html').animate({scrollTop:acc_header.offset().top-acc_header.height()-header_sticky},600);},600);});if($('.woocommerce-tabs.accordion-tabs').length>0){$('a.woocommerce-review-link').on('click',function(){var acc_header=$('#reviews').parents('.vc_tta-panel-body').siblings('.vc_tta-panel-heading');if(!acc_header.parents('.vc_tta-panel').hasClass('vc_active')){setTimeout(function(){acc_header.trigger('click');acc_header.find('.vc_tta-panel-title a').trigger('click');},100);}});} $('.widget_categories > ul').each(function(index,ele){var _this=$(ele);var icon_toggle_html='';var ul_child=_this.find('ul.children');ul_child.hide();ul_child.closest('li').addClass('cat-parent');ul_child.before(icon_toggle_html);});$('.widget_categories span.icon-toggle').on('click',function(){var parent_li=$(this).parent('li.cat-parent');if(!parent_li.hasClass('active')){parent_li.find('ul.children:first').slideDown();parent_li.addClass('active');} else{parent_li.find('ul.children').slideUp();parent_li.removeClass('active');parent_li.find('li.cat-parent').removeClass('active');}});$('.widget_categories li.current-cat').parents('ul.children').siblings('.icon-toggle').trigger('click');$('.widget_categories li.current-cat.cat-parent > .icon-toggle').trigger('click');$('.ts-blogs-widget-wrapper.ts-slider').each(function(){var element=$(this);var show_nav=element.data('show_nav')==1;var auto_play=element.data('auto_play')==1;element.owlCarousel({loop:true,items:1,nav:show_nav,navText:[,],dots:false,margin:10,navSpeed:1000,slideBy:1,rtl:$('body').hasClass('rtl'),navRewind:false,autoplay:auto_play,autoplayTimeout:5000,autoplayHoverPause:true,autoplaySpeed:false,mouseDrag:true,touchDrag:true,responsiveRefreshRate:1000,responsive:{0:{items:1}},onInitialized:function(){element.addClass('loaded').removeClass('loading');}});});$('.widget-container.ts-product-categories-widget .icon-toggle').on('click',function(){var parent_li=$(this).parent('li.cat-parent');if(!parent_li.hasClass('active')){parent_li.addClass('active');parent_li.find('ul.children:first').slideDown();} else{parent_li.find('ul.children').slideUp();parent_li.removeClass('active');parent_li.find('li.cat-parent').removeClass('active');}});$('.widget-container.ts-product-categories-widget').each(function(){var element=$(this);var parent_li=element.find('ul.children').parent('li');parent_li.addClass('cat-parent');element.find('li.current').parents('ul.children').siblings('.icon-toggle').trigger('click');});$('.widget-container.ts-product-categories-widget .cat-parent.current > .icon-toggle').trigger('click');$('.product-filter-by-availability-wrapper > ul input[type="checkbox"]').on('change',function(){$(this).parent('li').siblings('li').find('input[type="checkbox"]').attr('checked',false);var val='';if($(this).is(':checked')){val=$(this).val();} var form=$(this).closest('ul').siblings('form');if(val!=''){form.find('input[name="stock"]').val(val);} else{form.find('input[name="stock"]').remove();} form.submit();});$('.ts-products-widget-wrapper.ts-slider').each(function(){var element=$(this);var show_nav=element.data('show_nav')==1;var auto_play=element.data('auto_play')==1;element.owlCarousel({loop:true,items:1,nav:show_nav,navText:[,],dots:false,navSpeed:1000,slideBy:1,rtl:$('body').hasClass('rtl'),navRewind:false,autoplay:auto_play,autoplayTimeout:5000,autoplayHoverPause:true,autoplaySpeed:false,mouseDrag:true,touchDrag:true,responsiveRefreshRate:1000,responsive:{0:{items:1}},onInitialized:function(){element.addClass('loaded').removeClass('loading');}});});$('.ts-recent-comments-widget-wrapper.ts-slider').each(function(){var element=$(this);var show_nav=element.data('show_nav')==1;var auto_play=element.data('auto_play')==1;element.owlCarousel({loop:true,items:1,margin:10,nav:show_nav,navText:[,],dots:false,navSpeed:1000,slideBy:1,rtl:$('body').hasClass('rtl'),navRewind:false,autoplay:auto_play,autoplayTimeout:5000,autoplayHoverPause:true,autoplaySpeed:false,mouseDrag:true,touchDrag:true,responsiveRefreshRate:1000,responsive:{0:{items:1}},onInitialized:function(){element.addClass('loaded').removeClass('loading');}});});if(!on_touch&&$('.single-portfolio').length>0&&$('.single-portfolio .thumbnails').length>0){$(window).on('scroll',function(){var window_width=$(window).width();var scroll_top=$(this).scrollTop();var content_height=$('.single-portfolio .entry-content').height();var thumbnails_height=$('.single-portfolio .thumbnails').height();var thumbnails_top=$('.single-portfolio .thumbnails').offset().top;if(scroll_top>thumbnails_top&&window_width>767){var margin=scroll_top-thumbnails_top;if(margin+content_height>thumbnails_height){margin=thumbnails_height-content_height;} if(margin>=0){$('.single-portfolio .entry-content').css('margin-top',margin);}} else{$('.single-portfolio .entry-content').css('margin-top',0);}});} if(typeof $.fn.prettyPhoto=='function'){$('.single-portfolio .thumbnails a[rel^="prettyPhoto"]').prettyPhoto({show_title:false,deeplinking:false,social_tools:false});} $(document).on('yith_infs_added_elem',function(){ts_quickshop_handle();});});function ts_mega_menu_change_state(case_size){if(typeof case_size=='undefined') case_size=jQuery('body').innerWidth();case_size+=ts_get_scrollbar_width();if(case_size<991){jQuery('.group-meta-header').hide();jQuery('.group-meta-header').removeClass('open');jQuery('.ts-group-meta-icon-toggle').removeClass('active');jQuery('.ts-group-meta-icon-toggle').off('click');jQuery('.ts-group-meta-icon-toggle').on('click',function(){jQuery('.group-meta-header').slideToggle(600);jQuery('.group-meta-header').toggleClass('open');jQuery(this).toggleClass('active');});} jQuery('span.ts-menu-drop-icon').removeClass('active');if(case_size>767){jQuery('nav.pc-menu > ul.menu').show(200);var padding_left=0,container_width=0;var container=jQuery('.header-sticky > .container');if(container.length<=0){container=jQuery('.header-sticky');if(container.length<=0){return;} container_width=container.outerWidth();} else{container_width=container.width();padding_left=parseInt(container.css('padding-left'));} var container_offset=container.offset();setTimeout(function(){jQuery('nav.pc-menu > ul.menu').children('.ts-megamenu-fullwidth').each(function(index,element){var current_offset=jQuery(element).offset();var left=current_offset.left-container_offset.left-padding_left;jQuery(element).children('ul.sub-menu').css({'width':container_width+'px','left':-left+'px'});});jQuery('nav.pc-menu > ul.menu').children('.ts-megamenu-columns-1, .ts-megamenu-columns-2, .ts-megamenu-columns-3, .ts-megamenu-columns-4').each(function(index,element){jQuery(element).children('ul.sub-menu').css({'max-width':container_width+'px'});var sub_menu_width=jQuery(element).children('ul.sub-menu').outerWidth();var item_width=jQuery(element).outerWidth();jQuery(element).children('ul.sub-menu').css({'left':'-'+(sub_menu_width/2-item_width/2)+'px'});var container_left=container_offset.left;var container_right=container_left+container_width;var item_left=jQuery(element).offset().left;var overflow_left=(sub_menu_width/2>(item_left+item_width/2-container_left));var overflow_right=((sub_menu_width/2+item_left+item_width/2)>container_right);if(overflow_left){var left=item_left-container_left-padding_left;jQuery(element).children('ul.sub-menu').css({'left':-left+'px'});} if(overflow_right&&!overflow_left){var left=item_left-container_left-padding_left;left=left-(container_width-sub_menu_width);jQuery(element).children('ul.sub-menu').css({'left':-left+'px'});}});jQuery('ul.menu li.menu-item').removeClass('hide');},800);} else{jQuery('.ic-mobile-menu-button').off('click');jQuery('.ic-mobile-menu-button').on('click',function(){jQuery('#page').addClass('menu-mobile-active');});jQuery('.ic-mobile-menu-close-button').off('click');jQuery('.ic-mobile-menu-close-button').on('click',function(){jQuery('#page').removeClass('menu-mobile-active');});jQuery('#wpadminbar').css('position','fixed');jQuery('ul.menu li.menu-item').removeClass('hide');}} function ts_menu_action_on_ipad(){jQuery('.vertical-menu-heading').on('click',function(){var is_active=jQuery(this).hasClass('active');var vertical_menu=jQuery(this).siblings('.vertical-menu');jQuery('nav.pc-menu > ul.menu').find('.sub-menu').hide();jQuery('nav.pc-menu > ul.menu li.menu-item').removeClass('active');jQuery('nav.pc-menu span.ts-menu-drop-icon').removeClass('active');if(vertical_menu.length>0){if(is_active){vertical_menu.fadeOut(250);jQuery(this).removeClass('active');} else{vertical_menu.fadeIn(250);jQuery(this).addClass('active');}}});jQuery('.vertical-menu-wrapper span.ts-menu-drop-icon').on('click',function(){var is_active=jQuery(this).hasClass('active');var sub_menu=jQuery(this).siblings('.sub-menu');jQuery('nav.pc-menu > ul.menu').find('.sub-menu').hide();jQuery('nav.pc-menu span.ts-menu-drop-icon').removeClass('active');jQuery('nav.pc-menu li.menu-item').removeClass('active');jQuery('nav.vertical-menu span.ts-menu-drop-icon').removeClass('active');jQuery('nav.vertical-menu > ul.menu').find('.sub-menu').hide();jQuery(this).parents('.sub-menu').show();if(sub_menu.length>0){if(is_active){sub_menu.fadeOut(250);jQuery(this).removeClass('active');} else{sub_menu.fadeIn(250);jQuery(this).addClass('active');} jQuery(this).parents('.sub-menu').siblings('.ts-menu-drop-icon').addClass('active');}});jQuery('.main-menu.pc-menu span.ts-menu-drop-icon').on('click',function(){var is_active=jQuery(this).hasClass('active');var sub_menu=jQuery(this).siblings('.sub-menu');jQuery('.vertical-menu-heading').removeClass('active');jQuery('.vertical-menu-wrapper > .vertical-menu').hide();jQuery('nav.vertical-menu span.ts-menu-drop-icon').removeClass('active');jQuery('nav.vertical-menu > ul.menu').find('.sub-menu').hide();jQuery('.main-menu.pc-menu span.ts-menu-drop-icon').removeClass('active');jQuery('.main-menu.pc-menu li.menu-item').removeClass('active');jQuery('.main-menu.pc-menu > ul.menu').find('.sub-menu').hide();jQuery(this).parents('.sub-menu').show();if(sub_menu.length>0){if(is_active){sub_menu.fadeOut(250);jQuery(this).removeClass('active');jQuery(this).parent().removeClass('active');} else{sub_menu.fadeIn(250);jQuery(this).addClass('active');jQuery(this).parent().addClass('active');} jQuery(this).parents('.sub-menu').siblings('.ts-menu-drop-icon').addClass('active');}});jQuery('.mobile-menu .sub-menu').before('');jQuery('.mobile-menu .sub-menu').hide();jQuery('.mobile-menu span.ts-menu-drop-icon').on('click',function(){var is_active=jQuery(this).hasClass('active');var sub_menu=jQuery(this).siblings('.sub-menu');if(is_active){sub_menu.slideUp(250);sub_menu.find('.sub-menu').hide();sub_menu.find('.ts-menu-drop-icon').removeClass('active');} else{sub_menu.slideDown(250);} jQuery(this).toggleClass('active');});} function ts_is_touch_device(){return!jQuery('body').hasClass('ts_desktop');} function ts_get_scrollbar_width(){var $inner=jQuery('
test
'),$outer=jQuery('
').append($inner),inner=$inner[0],outer=$outer[0];jQuery('body').append(outer);var width1=inner.offsetWidth;$outer.css('overflow','scroll');var width2=outer.clientWidth;$outer.remove();return(width1-width2);} function ts_sticky_menu(){var on_touch=ts_is_touch_device();if(!on_touch&&jQuery(window).width()>768){var top_spacing=0;if(jQuery('body').hasClass('logged-in')&&jQuery('body').hasClass('admin-bar')&&jQuery('#wpadminbar').length>0){top_spacing=jQuery('#wpadminbar').height();} var top_begin=jQuery('header.ts-header').height()+100;if(jQuery('body').hasClass('display-vertical-menu')&&jQuery('nav.vertical-menu').length>0){top_begin+=jQuery('nav.vertical-menu').height();} setTimeout(function(){jQuery('.header-sticky').sticky({topSpacing:top_spacing,topBegin:top_begin,scrollOnTop:function(){ts_mega_menu_change_state();jQuery('body > .select2-container--open').removeClass('sticky');},scrollOnBottom:function(){ts_mega_menu_change_state();jQuery('body > .select2-container--open').addClass('sticky');}});},200);var old_scroll_top=0;var extra_space=650+top_spacing+top_begin;if(jQuery('.top-slideshow').length>0){extra_space+=jQuery('.top-slideshow').height();} jQuery(window).on('scroll',function(){if(jQuery('.is-sticky').length>0){var scroll_top=jQuery(this).scrollTop();if(scroll_top>old_scroll_top&&scroll_top>extra_space){jQuery('.is-sticky .header-sticky').addClass('header-sticky-hide');} else{if(jQuery('.is-sticky .header-sticky').hasClass('header-sticky-hide')){jQuery('.is-sticky .header-sticky').removeClass('header-sticky-hide');}} old_scroll_top=scroll_top;}});}} function ts_quickshop_handle(){if(typeof jQuery.fn.prettyPhoto!='function'){return;} jQuery('a.quickshop').prettyPhoto({deeplinking:false,opacity:0.9,social_tools:false,default_width:980,default_height:480,theme:'pp_woocommerce',changepicturecallback:function(){jQuery('.pp_inline').find('form.variations_form').wc_variation_form();jQuery('.pp_inline').find('form.variations_form .variations select').change();jQuery('body').trigger('wc_fragments_loaded');jQuery('.pp_inline .variations_form').on('click','.reset_variations',function(){jQuery(this).closest('.variations').find('.ts-product-attribute .option').removeClass('selected');});jQuery('.pp_woocommerce').addClass('loaded');var _this=jQuery('.ts-quickshop-wrapper .images-slider-wrapper');if(_this.find('.image-item').length<=1){return;} var owl=_this.find('.image-items').owlCarousel({items:1,loop:true,nav:true,navText:[,],dots:false,navSpeed:1000,slideBy:1,rtl:jQuery('body').hasClass('rtl'),margin:10,navRewind:false,autoplay:false,autoplayTimeout:5000,autoplayHoverPause:false,autoplaySpeed:false,mouseDrag:true,touchDrag:true,responsiveBaseElement:_this,responsiveRefreshRate:1000,onInitialized:function(){_this.addClass('loaded').removeClass('loading');}});}});} function ts_update_tini_wishlist(){if(typeof boxshop_params=='undefined'){return;} var wishlist_wrapper=jQuery('.my-wishlist-wrapper');if(wishlist_wrapper.length==0){return;} wishlist_wrapper.addClass('loading');jQuery.ajax({type:'POST',url:boxshop_params.ajax_url,data:{action:'boxshop_update_tini_wishlist'},success:function(response){var first_icon=wishlist_wrapper.children('i.fa:first');wishlist_wrapper.html(response);if(first_icon.length>0){wishlist_wrapper.prepend(first_icon);} wishlist_wrapper.removeClass('loading');}});} function ts_set_cloud_zoom(){jQuery('.cloud-zoom-wrap .cloud-zoom-big').remove();jQuery('.cloud-zoom, .cloud-zoom-gallery').off('click');var clz_width=jQuery('.cloud-zoom, .cloud-zoom-gallery').width();var clz_img_width=jQuery('.cloud-zoom, .cloud-zoom-gallery').children('img').width();var cl_zoom=jQuery('.cloud-zoom, .cloud-zoom-gallery').not('.on_pc');var temp=(clz_width-clz_img_width)/2;if(cl_zoom.length>0){cl_zoom.data('zoom',null).siblings('.mousetrap').off().remove();cl_zoom.CloudZoom({adjustX:temp});}} function ts_widget_toggle(){if(typeof boxshop_params!='undefined'&&boxshop_params.responsive==0){return;} jQuery('.wpb_widgetised_column .widget-title-wrapper a.block-control, .footer-container .widget-title-wrapper a.block-control').remove();var window_width=jQuery(window).width();window_width+=ts_get_scrollbar_width();if(window_width>=768){jQuery('.widget-title-wrapper a.block-control').removeClass('active').hide();jQuery('.widget-title-wrapper a.block-control').parent().siblings(':not(script)').show();} else{jQuery('.widget-title-wrapper a.block-control').removeClass('active').show();jQuery('.widget-title-wrapper a.block-control').parent().siblings(':not(script)').hide();jQuery('.wpb_widgetised_column .widget-title-wrapper, .footer-container .widget-title-wrapper').siblings(':not(script)').show();}} function ts_woocommerce_quantity_increment($){$(document).on('click','.plus, .minus',function(){var $qty=$(this).closest('.quantity').find('.qty'),currentVal=parseFloat($qty.val()),max=parseFloat($qty.attr('max')),min=parseFloat($qty.attr('min')),step=$qty.attr('step');if(!currentVal||currentVal===''||currentVal==='NaN')currentVal=0;if(max===''||max==='NaN')max='';if(min===''||min==='NaN')min=0;if(step==='any'||step===''||step===undefined||parseFloat(step)==='NaN')step=1;if($(this).is('.plus')){if(max&&(max==currentVal||currentVal>max)){$qty.val(max);}else{$qty.val(currentVal+parseFloat(step));}}else{if(min&&(min==currentVal||currentVal0){$qty.val(currentVal-parseFloat(step));}} $qty.trigger('change');});} function ts_ajax_search(){var search_string='';var search_previous_string='';var search_timeout;var search_delay=500;var search_input;var search_cache_data={};jQuery('body').append('
');var ts_search_result_container=jQuery('#ts-search-result-container');jQuery('.ts-header .search-content input[name="s"]').on('keyup',function(e){search_input=jQuery(this);ts_search_result_container.hide();search_string=jQuery(this).val().trim();if(search_string.length<2){search_input.parents('.search-content').removeClass('loading');return;} if(search_cache_data[search_string]){ts_search_result_container.html(search_cache_data[search_string]);ts_search_result_container.show();search_previous_string='';search_input.parents('.search-content').removeClass('loading');ts_search_result_container.find('.view-all-wrapper a').on('click',function(e){e.preventDefault();search_input.parents('form').submit();});return;} clearTimeout(search_timeout);search_timeout=setTimeout(function(){if(search_string==search_previous_string||search_string.length<2){return;} search_previous_string=search_string;search_input.parents('.search-content').addClass('loading');var category='';var select_category=search_input.parents('.search-content').siblings('.select-category');if(select_category.length>0){category=select_category.find(':selected').val();} jQuery.ajax({type:'POST',url:boxshop_params.ajax_url,data:{action:'boxshop_ajax_search',search_string:search_string,category:category},error:function(xhr,err){search_input.parents('.search-content').removeClass('loading');},success:function(response){if(response!=''){response=JSON.parse(response);if(response.search_string==search_string){ts_search_result_container.html(response.html);search_cache_data[search_string]=response.html;var top=search_input.offset().top+search_input.outerHeight(true);var left=Math.ceil(search_input.offset().left);var width=search_input.outerWidth(true);var border_width=parseInt(search_input.parent('.search-content').css('border-left-width'));left-=border_width;width+=border_width;if(width<300){width=300;} window_width=jQuery(window).width();if((left+width)>window_width){left-=(width-search_input.outerWidth(true));} ts_search_result_container.css({'position':'absolute','top':top,'left':left,'width':width,'display':'block'});search_input.parents('.search-content').removeClass('loading');ts_search_result_container.find('.view-all-wrapper a').on('click',function(e){e.preventDefault();search_input.parents('form').submit();});}} else{search_input.parents('.search-content').removeClass('loading');}}});},search_delay);});ts_search_result_container.on('mouseleave',function(){ts_search_result_container.hide();});jQuery('body').on('click',function(){ts_search_result_container.hide();});jQuery('.ts-search-by-category select.select-category').on('change',function(){search_previous_string='';search_cache_data={};jQuery(this).parents('.ts-search-by-category').find('.search-content input[name="s"]').trigger('keyup');});} function ts_single_related_post_gallery_slider(){if(jQuery('.single-post figure.gallery, .list-posts .post-item .gallery figure, .ts-blogs-widget .thumbnail.gallery figure').length>0){var _this=jQuery('.single-post figure.gallery, .list-posts .post-item .gallery figure, .ts-blogs-widget .thumbnail.gallery figure');var slider_data={items:1,loop:true,nav:false,dots:true,animateIn:'fadeIn',animateOut:'fadeOut',navText:[,],navSpeed:1000,slideBy:1,rtl:jQuery('body').hasClass('rtl'),margin:10,navRewind:false,autoplay:true,autoplayTimeout:4000,autoplayHoverPause:true,autoplaySpeed:false,autoHeight:true,mouseDrag:false,touchDrag:true,responsive:{0:{items:1}},onInitialized:function(){_this.removeClass('loading');_this.parent('.gallery').addClass('loaded').removeClass('loading');}};_this.each(function(){var validate_slider=true;if(jQuery(this).find('img').length<=1){validate_slider=false;} if(validate_slider){jQuery(this).owlCarousel(slider_data);} else{jQuery(this).removeClass('loading');jQuery(this).parent('.gallery').removeClass('loading');}});} if(jQuery('.single-post .related-posts.loading').length>0){var _this=jQuery('.single-post .related-posts.loading');var slider_data={loop:true,nav:true,navText:[,],dots:false,navSpeed:1000,slideBy:1,rtl:jQuery('body').hasClass('rtl'),margin:30,navRewind:false,autoplay:false,autoplayTimeout:5000,autoplayHoverPause:true,autoplaySpeed:false,autoHeight:true,mouseDrag:true,touchDrag:true,responsiveBaseElement:_this,responsiveRefreshRate:400,responsive:{0:{items:1},640:{items:2},1150:{items:3},1400:{items:4}},onInitialized:function(){_this.addClass('loaded').removeClass('loading');}};_this.find('.content-wrapper .blogs').owlCarousel(slider_data);}} ;/* SmoothScroll for websites v1.4.9 // Licensed under the terms of the MIT license. // People involved // - Balazs Galambosi (maintainer) // - Michael Herf (Pulse Algorithm) */ !function(){var e,t,o,n,r={frameRate:150,animationTime:400,stepSize:100,pulseAlgorithm:!0,pulseScale:4,pulseNormalize:1,accelerationDelta:50,accelerationMax:3,keyboardSupport:!0,arrowScroll:50,fixedBackground:!0,excluded:""},a=r,l=!1,i=!1,c={x:0,y:0},u=!1,s=document.documentElement,d=[],f=/^Mac/.test(navigator.platform),m={left:37,up:38,right:39,down:40,spacebar:32,pageup:33,pagedown:34,end:35,home:36},h={37:1,38:1,39:1,40:1};function w(){if(!u&&document.body){u=!0;var n=document.body,r=document.documentElement,c=window.innerHeight,d=n.scrollHeight;if(s=document.compatMode.indexOf("CSS")>=0?r:n,e=n,a.keyboardSupport&&A("keydown",S),top!=self)i=!0;else if(Z&&d>c&&(n.offsetHeight<=c||r.offsetHeight<=c)){var f,m=document.createElement("div");m.style.cssText="position:absolute; z-index:-10000; top:0; left:0; right:0; height:"+s.scrollHeight+"px",document.body.appendChild(m),o=function(){f||(f=setTimeout(function(){l||(m.style.height="0",m.style.height=s.scrollHeight+"px",f=null)},500))},setTimeout(o,10),A("resize",o);if((t=new q(o)).observe(n,{attributes:!0,childList:!0,characterData:!1}),s.offsetHeight<=c){var h=document.createElement("div");h.style.clear="both",n.appendChild(h)}}a.fixedBackground||l||(n.style.backgroundAttachment="scroll",r.style.backgroundAttachment="scroll")}}var p=[],v=!1,y=Date.now();function b(e,t,o){var n,r;if(n=(n=t)>0?1:-1,r=(r=o)>0?1:-1,(c.x!==n||c.y!==r)&&(c.x=n,c.y=r,p=[],y=0),1!=a.accelerationMax){var l=Date.now()-y;if(l1&&(i=Math.min(i,a.accelerationMax),t*=i,o*=i)}y=Date.now()}if(p.push({x:t,y:o,lastX:t<0?.99:-.99,lastY:o<0?.99:-.99,start:Date.now()}),!v){var u=V(),s=e===u||e===document.body;null==e.$scrollBehavior&&function(e){var t=M(e);if(null==B[t]){var o=getComputedStyle(e,"")["scroll-behavior"];B[t]="smooth"==o}return B[t]}(e)&&(e.$scrollBehavior=e.style.scrollBehavior,e.style.scrollBehavior="auto");var d=function(n){for(var r=Date.now(),l=0,i=0,c=0;c=a.animationTime,h=m?1:f/a.animationTime;a.pulseAlgorithm&&(h=I(h));var w=u.x*h-u.lastX>>0,y=u.y*h-u.lastY>>0;l+=w,i+=y,u.lastX+=w,u.lastY+=y,m&&(p.splice(c,1),c--)}s?window.scrollBy(l,i):(l&&(e.scrollLeft+=l),i&&(e.scrollTop+=i)),t||o||(p=[]),p.length?R(d,e,1e3/a.frameRate+1):(v=!1,null!=e.$scrollBehavior&&(e.style.scrollBehavior=e.$scrollBehavior,e.$scrollBehavior=null))};R(d,e,0),v=!0}}function g(t){u||w();var o=t.target;if(t.defaultPrevented||t.ctrlKey)return!0;if(K(e,"embed")||K(o,"embed")&&/\.pdf/i.test(o.src)||K(e,"object")||o.shadowRoot)return!0;var r=-t.wheelDeltaX||t.deltaX||0,l=-t.wheelDeltaY||t.deltaY||0;f&&(t.wheelDeltaX&&P(t.wheelDeltaX,120)&&(r=t.wheelDeltaX/Math.abs(t.wheelDeltaX)*-120),t.wheelDeltaY&&P(t.wheelDeltaY,120)&&(l=t.wheelDeltaY/Math.abs(t.wheelDeltaY)*-120)),r||l||(l=-t.wheelDelta||0),1===t.deltaMode&&(r*=40,l*=40);var c=L(o);return c?!!function(e){if(!e)return;d.length||(d=[e,e,e]);e=Math.abs(e),d.push(e),d.shift(),clearTimeout(n),n=setTimeout(function(){try{localStorage.SS_deltaBuffer=d.join(",")}catch(e){}},1e3);var t=e>120&&$(e);return!$(120)&&!$(100)&&!t}(l)||(Math.abs(r)>1.2&&(r*=a.stepSize/120),Math.abs(l)>1.2&&(l*=a.stepSize/120),b(c,r,l),t.preventDefault(),void C()):!i||!U||(Object.defineProperty(t,"target",{value:window.frameElement}),parent.wheel(t))}function S(t){var o=t.target,n=t.ctrlKey||t.altKey||t.metaKey||t.shiftKey&&t.keyCode!==m.spacebar;document.body.contains(e)||(e=document.activeElement);var r=/^(button|submit|radio|checkbox|file|color|image)$/i;if(t.defaultPrevented||/^(textarea|select|embed|object)$/i.test(o.nodeName)||K(o,"input")&&!r.test(o.type)||K(e,"video")||function(e){var t=e.target,o=!1;if(-1!=document.URL.indexOf("www.youtube.com/watch"))do{if(o=t.classList&&t.classList.contains("html5-video-controls"))break}while(t=t.parentNode);return o}(t)||o.isContentEditable||n)return!0;if((K(o,"button")||K(o,"input")&&r.test(o.type))&&t.keyCode===m.spacebar)return!0;if(K(o,"input")&&"radio"==o.type&&h[t.keyCode])return!0;var l=0,c=0,u=L(e);if(!u)return!i||!U||parent.keydown(t);var s=u.clientHeight;switch(u==document.body&&(s=window.innerHeight),t.keyCode){case m.up:c=-a.arrowScroll;break;case m.down:c=a.arrowScroll;break;case m.spacebar:c=-(t.shiftKey?1:-1)*s*.9;break;case m.pageup:c=.9*-s;break;case m.pagedown:c=.9*s;break;case m.home:u==document.body&&document.scrollingElement&&(u=document.scrollingElement),c=-u.scrollTop;break;case m.end:var d=u.scrollHeight-u.scrollTop-s;c=d>0?d+10:0;break;case m.left:l=-a.arrowScroll;break;case m.right:l=a.arrowScroll;break;default:return!0}b(u,l,c),t.preventDefault(),C()}function x(t){e=t.target}var k,D,M=(k=0,function(e){return e.uniqueID||(e.uniqueID=k++)}),E={},T={},B={};function C(){clearTimeout(D),D=setInterval(function(){E=T=B={}},1e3)}function H(e,t,o){for(var n=o?E:T,r=e.length;r--;)n[M(e[r])]=t;return t}function z(e,t){return(t?E:T)[M(e)]}function L(e){var t=[],o=document.body,n=s.scrollHeight;do{var r=z(e,!1);if(r)return H(t,r);if(t.push(e),n===e.scrollHeight){var a=X(s)&&X(o)||Y(s);if(i&&O(s)||!i&&a)return H(t,V())}else if(O(e)&&Y(e))return H(t,e)}while(e=e.parentElement)}function O(e){return e.clientHeight+10=1?1:e<=0?0:(1==a.pulseNormalize&&(a.pulseNormalize/=F(1)),F(e))}var _=window.navigator.userAgent,W=/Edge/.test(_),U=/chrome/i.test(_)&&!W,G=/safari/i.test(_)&&!W,J=/mobile/i.test(_),Q=/Windows NT 6.1/i.test(_)&&/rv:11/i.test(_),Z=G&&(/Version\/8/i.test(_)||/Version\/9/i.test(_)),ee=(U||G||Q)&&!J,te=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:function(){te=!0}}))}catch(e){}var oe=!!te&&{passive:!1},ne="onwheel"in document.createElement("div")?"wheel":"mousewheel";function re(e){for(var t in e)r.hasOwnProperty(t)&&(a[t]=e[t])}ne&&ee&&(A(ne,g,oe),A("mousedown",x),A("load",w)),re.destroy=function(){t&&t.disconnect(),N(ne,g),N("mousedown",x),N("keydown",S),N("resize",o),N("load",w)},window.SmoothScrollOptions&&re(window.SmoothScrollOptions),"function"==typeof define&&define.amd?define(function(){return re}):"object"==typeof exports?module.exports=re:window.SmoothScroll=re}(); ;(function($){var defaults={topSpacing:0,bottomSpacing:0,topBegin:0,className:'is-sticky',wrapperClassName:'sticky-wrapper',center:false,getWidthFrom:'',scrollOnTop:function(){},scrollOnBottom:function(){}},$window=$(window),$document=$(document),sticked=[],windowHeight=$window.height(),scroller=function(){var scrollTop=$window.scrollTop(),documentHeight=$document.height(),dwh=documentHeight-windowHeight,extra=(scrollTop>dwh)?dwh-scrollTop:0;for(var i=0;i').attr('id',stickyId+'-sticky-wrapper').addClass(o.wrapperClassName);stickyElement.wrapAll(wrapper);if(o.center){stickyElement.parent().css({width:stickyElement.outerWidth(),marginLeft:"auto",marginRight:"auto"});} if(stickyElement.css("float")=="right"){stickyElement.css({"float":"none"}).parent().css({"float":"right"});} var stickyWrapper=stickyElement.parent();stickyWrapper.css('height',stickyElement.outerHeight());sticked.push({topSpacing:o.topSpacing,bottomSpacing:o.bottomSpacing,topBegin:o.topBegin,stickyElement:stickyElement,currentTop:null,stickyWrapper:stickyWrapper,className:o.className,getWidthFrom:o.getWidthFrom,scrollOnTop:o.scrollOnTop,scrollOnBottom:o.scrollOnBottom});});},update:scroller};if(window.addEventListener){window.addEventListener('scroll',scroller,false);window.addEventListener('resize',resizer,false);}else if(window.attachEvent){window.attachEvent('onscroll',scroller);window.attachEvent('onresize',resizer);} $.fn.sticky=function(method){if(methods[method]){return methods[method].apply(this,Array.prototype.slice.call(arguments,1));}else if(typeof method==='object'||!method){return methods.init.apply(this,arguments);}else{$.error('Method '+method+' does not exist on jQuery.sticky');}};$(function(){setTimeout(scroller,400);});})(jQuery);;(function($){$(document).ready(function(){$('.cloud-zoom, .cloud-zoom-gallery').CloudZoom();});function format(str){for(var i=1;iLoading...',w/3,(w/2)-(w/6))).find(':last').css('opacity',0.5);}},200);var ie6FixRemove=function(){if($ie6Fix!==null){$ie6Fix.remove();$ie6Fix=null;}};this.removeBits=function(){if(lens){lens.remove();lens=null;} if($tint){$tint.remove();$tint=null;} if(softFocus){softFocus.remove();softFocus=null;} ie6FixRemove();$('.cloud-zoom-loading',jWin.parent()).remove();};this.destroy=function(){jWin.data('zoom',null);if($mouseTrap){$mouseTrap.off();$mouseTrap.remove();$mouseTrap=null;} if(zoomDiv){zoomDiv.remove();zoomDiv=null;} this.removeBits();};this.fadedOut=function(){if(zoomDiv){zoomDiv.remove();zoomDiv=null;} this.removeBits();};this.controlLoop=function(){if(lens){var x=(mx-sImg.offset().left-(cw*0.5))>>0;var y=(my-sImg.offset().top-(ch*0.5))>>0;if(x<0){x=0;} else if(x>(sImg.outerWidth()-cw)){x=(sImg.outerWidth()-cw);} if(y<0){y=0;} else if(y>(sImg.outerHeight()-ch)){y=(sImg.outerHeight()-ch);} lens.css({left:x,top:y});lens.css('background-position',(-x)+'px '+(-y)+'px');destU=(((x)/sImg.outerWidth())*zoomImage.width)>>0;destV=(((y)/sImg.outerHeight())*zoomImage.height)>>0;currU+=(destU-currU)/opts.smoothMove;currV+=(destV-currV)/opts.smoothMove;zoomDiv.css('background-position',(-(currU>>0)+'px ')+(-(currV>>0)+'px'));} controlTimer=setTimeout(function(){ctx.controlLoop();},30);};this.init2=function(img,id){filesLoaded++;if(id===1){zoomImage=img;} if(filesLoaded===2){this.init();}};this.init=function(){$('.cloud-zoom-loading',jWin.parent()).remove();$mouseTrap=jWin.parent().append(format("
",sImg.outerWidth(),sImg.outerHeight(),0,0)).find(':last');$mouseTrap.on('mousemove',this,function(event){mx=event.pageX;my=event.pageY;});$mouseTrap.on('mouseleave',this,function(event){jWin.trigger('cloudzoom_end_zoom');clearTimeout(controlTimer);if(lens){lens.fadeOut(299);} if($tint){$tint.fadeOut(299);} if(softFocus){softFocus.fadeOut(299);} zoomDiv.fadeOut(300,function(){ctx.fadedOut();});return false;});$mouseTrap.on('mouseenter',this,function(event){jWin.trigger('cloudzoom_start_zoom');mx=event.pageX;my=event.pageY;zw=event.data;if(zoomDiv){zoomDiv.stop(true,false);zoomDiv.remove();} var xPos=opts.adjustX,yPos=opts.adjustY;var siw=sImg.outerWidth();var sih=sImg.outerHeight();var w=opts.zoomWidth;var h=opts.zoomHeight;if(opts.zoomWidth=='auto'){w=siw;} if(opts.zoomHeight=='auto'){h=sih;} var appendTo=jWin.parent();switch(opts.position){case'top':yPos-=h;break;case'right':xPos+=siw;break;case'bottom':yPos+=sih;break;case'left':xPos-=w;break;case'inside':w=siw;h=sih;break;default:appendTo=$('#'+opts.position);if(!appendTo.length){appendTo=jWin;xPos+=siw;yPos+=sih;}else{w=appendTo.innerWidth();h=appendTo.innerHeight();}} zoomDiv=appendTo.append(format('',xPos,yPos,w,h,zoomImage.src)).find(':last');if(sImg.attr('title')&&opts.showTitle){zoomDiv.append(format('
%0
',sImg.attr('title'))).find(':last').css('opacity',opts.titleOpacity);} var browserCheck=/(msie) ([\w.]+)/.exec(navigator.userAgent);if(browserCheck){if((browserCheck[1]||"")=='msie'&&(browserCheck[2]||"0")<7){$ie6Fix=$('').css({position:"absolute",left:xPos,top:yPos,zIndex:99,width:w,height:h}).insertBefore(zoomDiv);}} zoomDiv.fadeIn(500);if(lens){lens.remove();lens=null;} cw=(sImg.outerWidth()/zoomImage.width)*zoomDiv.width();ch=(sImg.outerHeight()/zoomImage.height)*zoomDiv.height();lens=jWin.append(format("",cw,ch)).find(':last');$mouseTrap.css('cursor',lens.css('cursor'));var noTrans=false;if(opts.tint){lens.css('background','url("'+sImg.attr('src')+'")');$tint=jWin.append(format('
',sImg.outerWidth(),sImg.outerHeight(),opts.tint)).find(':last');$tint.css('opacity',opts.tintOpacity);noTrans=true;$tint.fadeIn(500);} if(opts.softFocus){lens.css('background','url("'+sImg.attr('src')+'")');softFocus=jWin.append(format('
',sImg.outerWidth()-2,sImg.outerHeight()-2,opts.tint)).find(':last');softFocus.css('background','url("'+sImg.attr('src')+'")');softFocus.css('opacity',0.5);noTrans=true;softFocus.fadeIn(500);} if(!noTrans){lens.css('opacity',opts.lensOpacity);} if(opts.position!=='inside'){lens.fadeIn(500);} zw.controlLoop();return;});jWin.trigger('cloudzoom_ready');};img1=new Image();$(img1).on('load',function(){ctx.init2(this,0);});img1.src=sImg.attr('src');img2=new Image();$(img2).on('load',function(){ctx.init2(this,1);});img2.src=jWin.attr('href');} $.fn.CloudZoom=function(options){try{document.execCommand("BackgroundImageCache",false,true);}catch(e){} this.each(function(){var relOpts,opts;eval('var a = {'+$(this).attr('data-rel')+'}');relOpts=a;if($(this).is('.cloud-zoom')){opts=$.extend({},$.fn.CloudZoom.defaults,options);opts=$.extend({},opts,relOpts);$(this).css({'position':'relative','display':'block'});$('img',$(this)).css({'display':'block'});if(!$(this).parent().hasClass('cloud-zoom-wrap')&&opts.useWrapper){$(this).wrap('
');} $(this).data('zoom',new CloudZoom($(this),opts));}else if($(this).is('.cloud-zoom-gallery')){opts=$.extend({},relOpts,options);$(this).data('relOpts',opts);$(this).on('click',$(this),function(event){var data=event.data.data('relOpts');$('#'+data.useZoom).data('zoom').destroy();$('#'+data.useZoom).attr('href',event.data.attr('href'));$('#'+data.useZoom+' img').attr('src',event.data.data('relOpts').smallImage);$('#'+event.data.data('relOpts').useZoom).CloudZoom();return false;});}});return this;};$.fn.CloudZoom.defaults={zoomWidth:'auto',zoomHeight:'auto',position:'right',transparentImage:'.',useWrapper:true,tint:false,tintOpacity:0.5,lensOpacity:0.5,softFocus:false,smoothMove:3,showTitle:true,titleOpacity:0.5,adjustX:0,adjustY:0};})(jQuery); ;/* * 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($){function sc_setScroll(e,t,n){if(n.transition=="transition"){if(t=="swing"){t="ease"}}return{anims:[],duration:e,orgDuration:e,easing:t,startTime:getTime()}}function sc_startScroll(e,t){for(var n=0,r=e.anims.length;nt){debug(n,"Not enough items ("+t+" total, "+r+" needed): Hiding navigation.");var i="hide"}else{var i="show"}var s=i=="show"?"removeClass":"addClass",o=cf_c("hidden",n);if(e.auto.button){e.auto.button[i]()[s](o)}if(e.prev.button){e.prev.button[i]()[s](o)}if(e.next.button){e.next.button[i]()[s](o)}if(e.pagination.container){e.pagination.container[i]()[s](o)}}function nv_enableNavi(e,t,n){if(e.circular||e.infinite)return;var r=t=="removeClass"||t=="addClass"?t:false,i=cf_c("disabled",n);if(e.auto.button&&r){e.auto.button[r](i)}if(e.prev.button){var s=r||t==0?"addClass":"removeClass";e.prev.button[s](i)}if(e.next.button){var s=r||t==e.items.visible?"addClass":"removeClass";e.next.button[s](i)}}function go_getObject(e,t){if(is_function(t)){t=t.call(e)}else if(is_undefined(t)){t={}}return t}function go_getItemsObject(e,t){t=go_getObject(e,t);if(is_number(t)){t={visible:t}}else if(t=="variable"){t={visible:t,width:t,height:t}}else if(!is_object(t)){t={}}return t}function go_getScrollObject(e,t){t=go_getObject(e,t);if(is_number(t)){if(t<=50){t={items:t}}else{t={duration:t}}}else if(is_string(t)){t={easing:t}}else if(!is_object(t)){t={}}return t}function go_getNaviObject(e,t){t=go_getObject(e,t);if(is_string(t)){var n=cf_getKeyCode(t);if(n==-1){t=$(t)}else{t=n}}return t}function go_getAutoObject(e,t){t=go_getNaviObject(e,t);if(is_jquery(t)){t={button:t}}else if(is_boolean(t)){t={play:t}}else if(is_number(t)){t={timeoutDuration:t}}if(t.progress){if(is_string(t.progress)||is_jquery(t.progress)){t.progress={bar:t.progress}}}return t}function go_complementAutoObject(e,t){if(is_function(t.button)){t.button=t.button.call(e)}if(is_string(t.button)){t.button=$(t.button)}if(!is_boolean(t.play)){t.play=true}if(!is_number(t.delay)){t.delay=0}if(is_undefined(t.pauseOnEvent)){t.pauseOnEvent=true}if(!is_boolean(t.pauseOnResize)){t.pauseOnResize=true}if(!is_number(t.timeoutDuration)){t.timeoutDuration=t.duration<10?2500:t.duration*5}if(t.progress){if(is_function(t.progress.bar)){t.progress.bar=t.progress.bar.call(e)}if(is_string(t.progress.bar)){t.progress.bar=$(t.progress.bar)}if(t.progress.bar){if(!is_function(t.progress.updater)){t.progress.updater=$.fn.carouFredSel.progressbarUpdater}if(!is_number(t.progress.interval)){t.progress.interval=50}}else{t.progress=false}}return t}function go_getPrevNextObject(e,t){t=go_getNaviObject(e,t);if(is_jquery(t)){t={button:t}}else if(is_number(t)){t={key:t}}return t}function go_complementPrevNextObject(e,t){if(is_function(t.button)){t.button=t.button.call(e)}if(is_string(t.button)){t.button=$(t.button)}if(is_string(t.key)){t.key=cf_getKeyCode(t.key)}return t}function go_getPaginationObject(e,t){t=go_getNaviObject(e,t);if(is_jquery(t)){t={container:t}}else if(is_boolean(t)){t={keys:t}}return t}function go_complementPaginationObject(e,t){if(is_function(t.container)){t.container=t.container.call(e)}if(is_string(t.container)){t.container=$(t.container)}if(!is_number(t.items)){t.items=false}if(!is_boolean(t.keys)){t.keys=false}if(!is_function(t.anchorBuilder)&&!is_false(t.anchorBuilder)){t.anchorBuilder=$.fn.carouFredSel.pageAnchorBuilder}if(!is_number(t.deviation)){t.deviation=0}return t}function go_getSwipeObject(e,t){if(is_function(t)){t=t.call(e)}if(is_undefined(t)){t={onTouch:false}}if(is_true(t)){t={onTouch:t}}else if(is_number(t)){t={items:t}}return t}function go_complementSwipeObject(e,t){if(!is_boolean(t.onTouch)){t.onTouch=true}if(!is_boolean(t.onMouse)){t.onMouse=false}if(!is_object(t.options)){t.options={}}if(!is_boolean(t.options.triggerOnTouchEnd)){t.options.triggerOnTouchEnd=false}return t}function go_getMousewheelObject(e,t){if(is_function(t)){t=t.call(e)}if(is_true(t)){t={}}else if(is_number(t)){t={items:t}}else if(is_undefined(t)){t=false}return t}function go_complementMousewheelObject(e,t){return t}function gn_getItemIndex(e,t,n,r,i){if(is_string(e)){e=$(e,i)}if(is_object(e)){e=$(e,i)}if(is_jquery(e)){e=i.children().index(e);if(!is_boolean(n)){n=false}}else{if(!is_boolean(n)){n=true}}if(!is_number(e)){e=0}if(!is_number(t)){t=0}if(n){e+=r.first}e+=t;if(r.total>0){while(e>=r.total){e-=r.total}while(e<0){e+=r.total}}return e}function gn_getVisibleItemsPrev(e,t,n){var r=0,i=0;for(var s=n;s>=0;s--){var o=e.eq(s);r+=o.is(":visible")?o[t.d["outerWidth"]](true):0;if(r>t.maxDimension){return i}if(s==0){s=e.length}i++}}function gn_getVisibleItemsPrevFilter(e,t,n){return gn_getItemsPrevFilter(e,t.items.filter,t.items.visibleConf.org,n)}function gn_getScrollItemsPrevFilter(e,t,n,r){return gn_getItemsPrevFilter(e,t.items.filter,r,n)}function gn_getItemsPrevFilter(e,t,n,r){var i=0,s=0;for(var o=r,u=e.length;o>=0;o--){s++;if(s==u){return s}var a=e.eq(o);if(a.is(t)){i++;if(i==n){return s}}if(o==0){o=u}}}function gn_getVisibleOrg(e,t){return t.items.visibleConf.org||e.children().slice(0,t.items.visible).filter(t.items.filter).length}function gn_getVisibleItemsNext(e,t,n){var r=0,i=0;for(var s=n,o=e.length-1;s<=o;s++){var u=e.eq(s);r+=u.is(":visible")?u[t.d["outerWidth"]](true):0;if(r>t.maxDimension){return i}i++;if(i==o+1){return i}if(s==o){s=-1}}}function gn_getVisibleItemsNextTestCircular(e,t,n,r){var i=gn_getVisibleItemsNext(e,t,n);if(!t.circular){if(n+i>r){i=r-n}}return i}function gn_getVisibleItemsNextFilter(e,t,n){return gn_getItemsNextFilter(e,t.items.filter,t.items.visibleConf.org,n,t.circular)}function gn_getScrollItemsNextFilter(e,t,n,r){return gn_getItemsNextFilter(e,t.items.filter,r+1,n,t.circular)-1}function gn_getItemsNextFilter(e,t,n,r,i){var s=0,o=0;for(var u=r,a=e.length-1;u<=a;u++){o++;if(o>=a){return o}var f=e.eq(u);if(f.is(t)){s++;if(s==n){return o}}if(u==a){u=-1}}}function gi_getCurrentItems(e,t){return e.slice(0,t.items.visible)}function gi_getOldItemsPrev(e,t,n){return e.slice(n,t.items.visibleConf.old+n)}function gi_getNewItemsPrev(e,t){return e.slice(0,t.items.visible)}function gi_getOldItemsNext(e,t){return e.slice(0,t.items.visibleConf.old)}function gi_getNewItemsNext(e,t,n){return e.slice(n,t.items.visible+n)}function sz_storeMargin(e,t,n){if(t.usePadding){if(!is_string(n)){n="_cfs_origCssMargin"}e.each(function(){var e=$(this),r=parseInt(e.css(t.d["marginRight"]),10);if(!is_number(r)){r=0}e.data(n,r)})}}function sz_resetMargin(e,t,n){if(t.usePadding){var r=is_boolean(n)?n:false;if(!is_number(n)){n=0}sz_storeMargin(e,t,"_cfs_tempCssMargin");e.each(function(){var e=$(this);e.css(t.d["marginRight"],r?e.data("_cfs_tempCssMargin"):n+e.data("_cfs_origCssMargin"))})}}function sz_storeOrigCss(e){e.each(function(){var e=$(this);e.data("_cfs_origCss",e.attr("style")||"")})}function sz_restoreOrigCss(e){e.each(function(){var e=$(this);e.attr("style",e.data("_cfs_origCss")||"")})}function sz_setResponsiveSizes(e,t){var n=e.items.visible,r=e.items[e.d["width"]],i=e[e.d["height"]],s=is_percentage(i);t.each(function(){var t=$(this),n=r-ms_getPaddingBorderMargin(t,e,"Width");t[e.d["width"]](n);if(s){t[e.d["height"]](ms_getPercentage(n,i))}})}function sz_setSizes(e,t){var n=e.parent(),r=e.children(),i=gi_getCurrentItems(r,t),s=cf_mapWrapperSizes(ms_getSizes(i,t,true),t,false);n.css(s);if(t.usePadding){var o=t.padding,u=o[t.d[1]];if(t.align&&u<0){u=0}var a=i.last();a.css(t.d["marginRight"],a.data("_cfs_origCssMargin")+u);e.css(t.d["top"],o[t.d[0]]);e.css(t.d["left"],o[t.d[3]])}e.css(t.d["width"],s[t.d["width"]]+ms_getTotalSize(r,t,"width")*2);e.css(t.d["height"],ms_getLargestSize(r,t,"height"));return s}function ms_getSizes(e,t,n){return[ms_getTotalSize(e,t,"width",n),ms_getLargestSize(e,t,"height",n)]}function ms_getLargestSize(e,t,n,r){if(!is_boolean(r)){r=false}if(is_number(t[t.d[n]])&&r){return t[t.d[n]]}if(is_number(t.items[t.d[n]])){return t.items[t.d[n]]}n=n.toLowerCase().indexOf("width")>-1?"outerWidth":"outerHeight";return ms_getTrueLargestSize(e,t,n)}function ms_getTrueLargestSize(e,t,n){var r=0;for(var i=0,s=e.length;i-1?"outerWidth":"outerHeight",s=0;for(var o=0,u=e.length;o-1&&is_undefined(n[s])){n[s]=e[r];break}}}return n}function cf_getPadding(e){if(is_undefined(e)){return[0,0,0,0]}if(is_number(e)){return[e,e,e,e]}if(is_string(e)){e=e.split("px").join("").split("em").join("").split(" ")}if(!is_array(e)){return[0,0,0,0]}for(var t=0;t<4;t++){e[t]=parseInt(e[t],10)}switch(e.length){case 0:return[0,0,0,0];case 1:return[e[0],e[0],e[0],e[0]];case 2:return[e[0],e[1],e[0],e[1]];case 3:return[e[0],e[1],e[2],e[1]];default:return[e[0],e[1],e[2],e[3]]}}function cf_getAlignPadding(e,t){var n=is_number(t[t.d["width"]])?Math.ceil(t[t.d["width"]]-ms_getTotalSize(e,t,"width")):0;switch(t.align){case"left":return[0,n];case"right":return[n,0];case"center":default:return[Math.ceil(n/2),Math.floor(n/2)]}}function cf_getDimensions(e){var t=[["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 n=t[0].length,r=e.direction=="right"||e.direction=="left"?0:1;var i={};for(var s=0;ss.length){var u=true,a=o[0],f=o[1]}else{var u=false,a=s[0],f=s[1]}switch(a){case"even":i=e%2==1?e-1:e;break;case"odd":i=e%2==0?e-1:e;break;default:i=e;break}f=parseInt(f,10);if(is_number(f)){if(u){f=-f}i+=f}}if(!is_number(i)||i<1){i=1}return i}function cf_getItemsAdjust(e,t,n,r){return cf_getItemAdjustMinMax(cf_getAdjust(e,t,n,r),t.items.visibleConf)}function cf_getItemAdjustMinMax(e,t){if(is_number(t.min)&&et.max){e=t.max}if(e<1){e=1}return e}function cf_getSynchArr(e){if(!is_array(e)){e=[[e]]}if(!is_array(e[0])){e=[e]}for(var t=0,n=e.length;t0?":visible":"*"}if(!e[t.d["width"]]){if(t.responsive){debug(true,"Set a "+t.d["width"]+" for the items!");e[t.d["width"]]=ms_getTrueLargestSize(n,t,"outerWidth")}else{e[t.d["width"]]=ms_hasVariableSizes(n,t,"outerWidth")?"variable":n[t.d["outerWidth"]](true)}}if(!e[t.d["height"]]){e[t.d["height"]]=ms_hasVariableSizes(n,t,"outerHeight")?"variable":n[t.d["outerHeight"]](true)}e.sizesConf.width=e.width;e.sizesConf.height=e.height;return e}function in_complementVisibleItems(e,t){if(e.items[e.d["width"]]=="variable"){e.items.visibleConf.variable=true}if(!e.items.visibleConf.variable){if(is_number(e[e.d["width"]])){e.items.visible=Math.floor(e[e.d["width"]]/e.items[e.d["width"]])}else{e.items.visible=Math.floor(t/e.items[e.d["width"]]);e[e.d["width"]]=e.items.visible*e.items[e.d["width"]];if(!e.items.visibleConf.adjust){e.align=false}}if(e.items.visible=="Infinity"||e.items.visible<1){debug(true,'Not a valid number of visible items: Set to "variable".');e.items.visibleConf.variable=true}}return e}function in_complementPrimarySize(e,t,n){if(e=="auto"){e=ms_getTrueLargestSize(n,t,"outerWidth")}return e}function in_complementSecondarySize(e,t,n){if(e=="auto"){e=ms_getTrueLargestSize(n,t,"outerHeight")}if(!e){e=t.items[t.d["height"]]}return e}function in_getAlignPadding(e,t){var n=cf_getAlignPadding(gi_getCurrentItems(t,e),e);e.padding[e.d[1]]=n[1];e.padding[e.d[3]]=n[0];return e}function in_getResponsiveValues(e,t,n){var r=cf_getItemAdjustMinMax(Math.ceil(e[e.d["width"]]/e.items[e.d["width"]]),e.items.visibleConf);if(r>t.length){r=t.length}var i=Math.floor(e[e.d["width"]]/r);e.items.visible=r;e.items[e.d["width"]]=i;e[e.d["width"]]=r*i;return e}function bt_pauseOnHoverConfig(e){if(is_string(e)){var t=e.indexOf("immediate")>-1?true:false,n=e.indexOf("resume")>-1?true:false}else{var t=n=false}return[t,n]}function bt_mousesheelNumber(e){return is_number(e)?e:null}function is_null(e){return e===null}function is_undefined(e){return is_null(e)||typeof e=="undefined"||e===""||e==="undefined"}function is_array(e){return e instanceof Array}function is_jquery(e){return e instanceof jQuery}function is_object(e){return(e instanceof Object||typeof e=="object")&&!is_null(e)&&!is_jquery(e)&&!is_array(e)&&!is_function(e)}function is_number(e){return(e instanceof Number||typeof e=="number")&&!isNaN(e)}function is_string(e){return(e instanceof String||typeof e=="string")&&!is_undefined(e)&&!is_true(e)&&!is_false(e)}function is_function(e){return e instanceof Function||typeof e=="function"}function is_boolean(e){return e instanceof Boolean||typeof e=="boolean"||is_true(e)||is_false(e)}function is_true(e){return e===true||e==="true"}function is_false(e){return e===false||e==="false"}function is_percentage(e){return is_string(e)&&e.slice(-1)=="%"}function getTime(){return(new Date).getTime()}function deprecated(e,t){debug(true,e+" is DEPRECATED, support for it will be removed. Use "+t+" instead.")}function debug(e,t){if(!is_undefined(window.console)&&!is_undefined(window.console.log)){if(is_object(e)){var n=" ("+e.selector+")";e=e.debug}else{var n=""}if(!e){return false}if(is_string(t)){t="carouFredSel"+n+": "+t}else{t=["carouFredSel"+n+":",t]}window.console.log(t)}return false}if($.fn.carouFredSel){return}$.fn.caroufredsel=$.fn.carouFredSel=function(options,configs){if(this.length==0){debug(true,'No element found for "'+this.selector+'".');return this}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(e,t,n){e=go_getObject($tt0,e);e.items=go_getItemsObject($tt0,e.items);e.scroll=go_getScrollObject($tt0,e.scroll);e.auto=go_getAutoObject($tt0,e.auto);e.prev=go_getPrevNextObject($tt0,e.prev);e.next=go_getPrevNextObject($tt0,e.next);e.pagination=go_getPaginationObject($tt0,e.pagination);e.swipe=go_getSwipeObject($tt0,e.swipe);e.mousewheel=go_getMousewheelObject($tt0,e.mousewheel);if(t){opts_orig=$.extend(true,{},$.fn.carouFredSel.defaults,e)}opts=$.extend(true,{},$.fn.carouFredSel.defaults,e);opts.d=cf_getDimensions(opts);crsl.direction=opts.direction=="up"||opts.direction=="left"?"next":"prev";var r=$cfs.children(),i=ms_getParentSize($wrp,opts,"width");if(is_true(opts.cookie)){opts.cookie="caroufredsel_cookie_"+conf.serialNumber}opts.maxDimension=ms_getMaxDimension(opts,i);opts.items=in_complementItems(opts.items,opts,r,n);opts[opts.d["width"]]=in_complementPrimarySize(opts[opts.d["width"]],opts,r);opts[opts.d["height"]]=in_complementSecondarySize(opts[opts.d["height"]],opts,r);if(opts.responsive){if(!is_percentage(opts[opts.d["width"]])){opts[opts.d["width"]]="100%"}}if(is_percentage(opts[opts.d["width"]])){crsl.upDateOnWindowResize=true;crsl.primarySizePercentage=opts[opts.d["width"]];opts[opts.d["width"]]=ms_getPercentage(i,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{if(!opts.items.visible){opts=in_complementVisibleItems(opts,i)}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"}}if(is_undefined(opts.align)){opts.align=is_number(opts[opts.d["width"]])?"center":false}if(opts.items.visibleConf.variable){opts.items.visible=gn_getVisibleItemsNext(r,opts,0)}}if(opts.items.filter!="*"&&!opts.items.visibleConf.variable){opts.items.visibleConf.org=opts.items.visible;opts.items.visible=gn_getVisibleItemsNextFilter(r,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,r,i)}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){case"center":case"left":case"right":if(opts[opts.d["width"]]!="variable"){opts=in_getAlignPadding(opts,r);opts.usePadding=true}break;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);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)}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")}};FN._build=function(){$cfs.data("_cfs_isCarousel",true);var e=$cfs.children(),t=in_mapCss($cfs,["textAlign","float","position","top","right","bottom","left","zIndex","width","height","marginTop","marginRight","marginBottom","marginLeft"]),n="relative";switch(t.position){case"absolute":case"fixed":n=t.position;break}if(conf.wrapper=="parent"){sz_storeOrigCss($wrp)}else{$wrp.css(t)}$wrp.css({overflow:"hidden",position:n});sz_storeOrigCss($cfs);$cfs.data("_cfs_origCssZindex",t.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(e,opts);sz_storeOrigCss(e);if(opts.responsive){sz_setResponsiveSizes(opts,e)}};FN._bind_events=function(){FN._unbind_events();$cfs.on(cf_e("stop",conf),function(e,t){e.stopPropagation();if(!crsl.isStopped){if(opts.auto.button){opts.auto.button.addClass(cf_c("stopped",conf))}}crsl.isStopped=true;if(opts.auto.play){opts.auto.play=false;$cfs.trigger(cf_e("pause",conf),t)}return true});$cfs.on(cf_e("finish",conf),function(e){e.stopPropagation();if(crsl.isScrolling){sc_stopScroll(scrl)}return true});$cfs.on(cf_e("pause",conf),function(e,t,n){e.stopPropagation();tmrs=sc_clearTimers(tmrs);if(t&&crsl.isScrolling){scrl.isStopped=true;var r=getTime()-scrl.startTime;scrl.duration-=r;if(scrl.pre){scrl.pre.duration-=r}if(scrl.post){scrl.post.duration-=r}sc_stopScroll(scrl,false)}if(!crsl.isPaused&&!crsl.isScrolling){if(n){tmrs.timePassed+=getTime()-tmrs.startTime}}if(!crsl.isPaused){if(opts.auto.button){opts.auto.button.addClass(cf_c("paused",conf))}}crsl.isPaused=true;if(opts.auto.onTimeoutPause){var i=opts.auto.timeoutDuration-tmrs.timePassed,s=100-Math.ceil(i*100/opts.auto.timeoutDuration);opts.auto.onTimeoutPause.call($tt0,s,i)}return true});$cfs.on(cf_e("play",conf),function(e,t,n,r){e.stopPropagation();tmrs=sc_clearTimers(tmrs);var i=[t,n,r],s=["string","number","boolean"],o=cf_sortParams(i,s);t=o[0];n=o[1];r=o[2];if(t!="prev"&&t!="next"){t=crsl.direction}if(!is_number(n)){n=0}if(!is_boolean(r)){r=false}if(r){crsl.isStopped=false;opts.auto.play=true}if(!opts.auto.play){e.stopImmediatePropagation();return debug(conf,"Carousel stopped: Not scrolling.")}if(crsl.isPaused){if(opts.auto.button){opts.auto.button.removeClass(cf_c("stopped",conf));opts.auto.button.removeClass(cf_c("paused",conf))}}crsl.isPaused=false;tmrs.startTime=getTime();var u=opts.auto.timeoutDuration+n;dur2=u-tmrs.timePassed;perc=100-Math.ceil(dur2*100/u);if(opts.auto.progress){tmrs.progress=setInterval(function(){var e=getTime()-tmrs.startTime+tmrs.timePassed,t=Math.ceil(e*100/u);opts.auto.progress.updater.call(opts.auto.progress.bar[0],t)},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),t)}else{$cfs.trigger(cf_e(t,conf),opts.auto)}},dur2);if(opts.auto.onTimeoutStart){opts.auto.onTimeoutStart.call($tt0,perc,dur2)}return true});$cfs.on(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});$cfs.on(cf_e("prev",conf)+" "+cf_e("next",conf),function(e,t,n,r,i){e.stopPropagation();if(crsl.isStopped||$cfs.is(":hidden")){e.stopImmediatePropagation();return debug(conf,"Carousel stopped or hidden: Not scrolling.")}var s=is_number(opts.items.minimum)?opts.items.minimum:opts.items.visible+1;if(s>itms.total){e.stopImmediatePropagation();return debug(conf,"Not enough items ("+itms.total+" total, "+s+" needed): Not scrolling.")}var o=[t,n,r,i],u=["object","number/string","function","boolean"],a=cf_sortParams(o,u);t=a[0];n=a[1];r=a[2];i=a[3];var f=e.type.slice(conf.events.prefix.length);if(!is_object(t)){t={}}if(is_function(r)){t.onAfter=r}if(is_boolean(i)){t.queue=i}t=$.extend(true,{},opts[f],t);if(t.conditions&&!t.conditions.call($tt0,f)){e.stopImmediatePropagation();return debug(conf,'Callback "conditions" returned false.')}if(!is_number(n)){if(opts.items.filter!="*"){n="visible"}else{var l=[n,t.items,opts[f].items];for(var a=0,c=l.length;a0){if(crsl.isScrolling){if(t.queue){if(t.queue=="last"){queu=[]}if(t.queue!="first"||queu.length==0){$cfs.trigger(cf_e("queue",conf),[f,[t,n,r]])}}e.stopImmediatePropagation();return debug(conf,"Carousel currently scrolling.")}}tmrs.timePassed=0;$cfs.trigger(cf_e("slide_"+f,conf),[t,n]);if(opts.synchronise){var h=opts.synchronise,p=[t,n];for(var d=0,c=h.length;d=itms.total){itms.first-=itms.total}if(!opts.circular){if(itms.first==0&&t.onEnd){t.onEnd.call($tt0,"prev")}if(!opts.infinite){nv_enableNavi(opts,itms.first,conf)}}$cfs.children().slice(itms.total-n,itms.total).prependTo($cfs);if(itms.total=0){sz_resetMargin(f,opts,opts.padding[opts.d[1]])}if(c>=0){sz_resetMargin(a,opts,opts.padding[opts.d[3]])}if(opts.align){opts.padding[opts.d[1]]=h;opts.padding[opts.d[3]]=c}k[opts.d["left"]]=-(b-d);L[opts.d["left"]]=-(E-d);x[opts.d["left"]]=w[opts.d["width"]];var O=function(){},M=function(){},_=function(){},D=function(){},P=function(){},H=function(){},B=function(){},j=function(){},F=function(){},I=function(){},q=function(){};switch(t.fx){case"crossfade":case"cover":case"cover-fade":case"uncover":case"uncover-fade":y=$cfs.clone(true).appendTo($wrp);break}switch(t.fx){case"crossfade":case"uncover":case"uncover-fade":y.children().slice(0,n).remove();y.children().slice(opts.items.visibleConf.old).remove();break;case"cover":case"cover-fade":y.children().slice(opts.items.visible).remove();y.css(L);break}$cfs.css(k);scrl=sc_setScroll(A,t.easing,conf);S[opts.d["left"]]=opts.usePadding?opts.padding[opts.d[3]]:0;if(opts[opts.d["width"]]=="variable"||opts[opts.d["height"]]=="variable"){O=function(){$wrp.css(w)};M=function(){scrl.anims.push([$wrp,w])}}if(opts.usePadding){if(l.not(a).length){T[opts.d["marginRight"]]=a.data("_cfs_origCssMargin");if(c<0){a.css(T)}else{B=function(){a.css(T)};j=function(){scrl.anims.push([a,T])}}}switch(t.fx){case"cover":case"cover-fade":y.children().eq(n-1).css(T);break}if(l.not(f).length){N[opts.d["marginRight"]]=f.data("_cfs_origCssMargin");_=function(){f.css(N)};D=function(){scrl.anims.push([f,N])}}if(h>=0){C[opts.d["marginRight"]]=l.data("_cfs_origCssMargin")+opts.padding[opts.d[1]];P=function(){l.css(C)};H=function(){scrl.anims.push([l,C])}}}q=function(){$cfs.css(S)};var R=opts.items.visible+n-itms.total;I=function(){if(R>0){$cfs.children().slice(itms.total).remove();o=$($cfs.children().slice(itms.total-(opts.items.visible-R)).get().concat($cfs.children().slice(0,R).get()))}sc_showHiddenItems(v);if(opts.usePadding){var e=$cfs.children().eq(opts.items.visible+n-1);e.css(opts.d["marginRight"],e.data("_cfs_origCssMargin"))}};var U=sc_mapCallbackArguments(o,m,u,n,"prev",A,w);F=function(){sc_afterScroll($cfs,y,t);crsl.isScrolling=false;clbk.onAfter=sc_fireCallbacks($tt0,t,"onAfter",U,clbk);queu=sc_fireQueue($cfs,queu,conf);if(!crsl.isPaused){$cfs.trigger(cf_e("play",conf))}};crsl.isScrolling=true;tmrs=sc_clearTimers(tmrs);clbk.onBefore=sc_fireCallbacks($tt0,t,"onBefore",U,clbk);switch(t.fx){case"none":$cfs.css(S);O();_();P();B();q();I();F();break;case"fade":scrl.anims.push([$cfs,{opacity:0},function(){O();_();P();B();q();I();scrl=sc_setScroll(A,t.easing,conf);scrl.anims.push([$cfs,{opacity:1},F]);sc_startScroll(scrl,conf)}]);break;case"crossfade":$cfs.css({opacity:0});scrl.anims.push([y,{opacity:0}]);scrl.anims.push([$cfs,{opacity:1},F]);M();_();P();B();q();I();break;case"cover":scrl.anims.push([y,S,function(){_();P();B();q();I();F()}]);M();break;case"cover-fade":scrl.anims.push([$cfs,{opacity:0}]);scrl.anims.push([y,S,function(){_();P();B();q();I();F()}]);M();break;case"uncover":scrl.anims.push([y,x,F]);M();_();P();B();q();I();break;case"uncover-fade":$cfs.css({opacity:0});scrl.anims.push([$cfs,{opacity:1}]);scrl.anims.push([y,x,F]);M();_();P();B();q();I();break;default:scrl.anims.push([$cfs,S,function(){I();F()}]);M();D();H();j();break}sc_startScroll(scrl,conf);cf_setCookie(opts.cookie,$cfs,conf);$cfs.trigger(cf_e("updatePageStatus",conf),[false,w]);return true});$cfs.on(cf_e("slide_next",conf),function(e,t,n){e.stopPropagation();var r=$cfs.children();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(r,opts);if(!is_number(n)){if(opts.items.filter!="*"){var i=is_number(t.items)?t.items:gn_getVisibleOrg($cfs,opts);n=gn_getScrollItemsNextFilter(r,opts,0,i)}else{n=opts.items.visible}n=cf_getAdjust(n,opts,t.items,$tt0)}var s=itms.first==0?itms.total:itms.first;if(!opts.circular){if(opts.items.visibleConf.variable){var o=gn_getVisibleItemsNext(r,opts,n),i=gn_getVisibleItemsPrev(r,opts,s-1)}else{var o=opts.items.visible,i=opts.items.visible}if(n+o>s){n=s-i}}opts.items.visibleConf.old=opts.items.visible;if(opts.items.visibleConf.variable){var o=cf_getItemsAdjust(gn_getVisibleItemsNextTestCircular(r,opts,n,s),opts,opts.items.visibleConf.adjust,$tt0);while(opts.items.visible-n>=o&&n=0){j+=opts.padding[opts.d[1]]}c.css(opts.d["marginRight"],j);if(f.not(l).length){N[opts.d["marginRight"]]=l.data("_cfs_origCssMargin")}O=function(){l.css(N)};M=function(){scrl.anims.push([l,N])};var F=f.data("_cfs_origCssMargin");if(h>0){F+=opts.padding[opts.d[3]]}T[opts.d["marginRight"]]=F;_=function(){f.css(T)};D=function(){scrl.anims.push([f,T])}}B=function(){$cfs.css(C)};var I=opts.items.visible+n-itms.total;H=function(){if(I>0){$cfs.children().slice(itms.total).remove()}var e=$cfs.children().slice(0,n).appendTo($cfs).last();if(I>0){a=gi_getCurrentItems(r,opts)}sc_showHiddenItems(v);if(opts.usePadding){if(itms.totalt?"next":"prev"}}if(s=="prev"){t=itms.total-t}$cfs.trigger(cf_e(s,conf),[i,t,o]);return true});$cfs.on(cf_e("prevPage",conf),function(e,t,n){e.stopPropagation();var r=$cfs.triggerHandler(cf_e("currentPage",conf));return $cfs.triggerHandler(cf_e("slideToPage",conf),[r-1,t,"prev",n])});$cfs.on(cf_e("nextPage",conf),function(e,t,n){e.stopPropagation();var r=$cfs.triggerHandler(cf_e("currentPage",conf));return $cfs.triggerHandler(cf_e("slideToPage",conf),[r+1,t,"next",n])});$cfs.on(cf_e("slideToPage",conf),function(e,t,n,r,i){e.stopPropagation();if(!is_number(t)){t=$cfs.triggerHandler(cf_e("currentPage",conf))}var s=opts.pagination.items||opts.items.visible,o=Math.ceil(itms.total/s)-1;if(t<0){t=o}if(t>o){t=0}return $cfs.triggerHandler(cf_e("slideTo",conf),[t*s,0,true,n,r,i])});$cfs.on(cf_e("jumpToStart",conf),function(e,t){e.stopPropagation();if(t){t=gn_getItemIndex(t,0,true,itms,$cfs)}else{t=0}t+=itms.first;if(t!=0){if(itms.total>0){while(t>itms.total){t-=itms.total}}$cfs.prepend($cfs.children().slice(t,itms.total))}return true});$cfs.on(cf_e("synchronise",conf),function(e,t){e.stopPropagation();if(t){t=cf_getSynchArr(t)}else if(opts.synchronise){t=opts.synchronise}else{return debug(conf,"No carousel to synchronise.")}var n=$cfs.triggerHandler(cf_e("currentPosition",conf)),r=true;for(var i=0,s=t.length;i=itms.total){itms.first-=itms.total}$cfs.trigger(cf_e("updateSizes",conf));$cfs.trigger(cf_e("linkAnchors",conf));return true});$cfs.on(cf_e("removeItem",conf),function(e,t,n,r){e.stopPropagation();var i=[t,n,r],s=["string/number/object","boolean","number"],o=cf_sortParams(i,s);t=o[0];n=o[1];r=o[2];var u=false;if(t instanceof $&&t.length>1){a=$();t.each(function(e,t){var i=$cfs.trigger(cf_e("removeItem",conf),[$(this),n,r]);if(i){a=a.add(i)}});return a}if(is_undefined(t)||t=="end"){a=$cfs.children().last()}else{t=gn_getItemIndex(t,r,n,itms,$cfs);var a=$cfs.children().eq(t);if(a.length){if(tr){i=r}if(is_function(t)){t.call($tt0,i)}return i});$cfs.on(cf_e("currentVisible",conf),function(e,t){e.stopPropagation();var n=gi_getCurrentItems($cfs.children(),opts);if(is_function(t)){t.call($tt0,n)}return n});$cfs.on(cf_e("slice",conf),function(e,t,n,r){e.stopPropagation();if(itms.total==0){return false}var i=[t,n,r],s=["number","number","function"],o=cf_sortParams(i,s);t=is_number(o[0])?o[0]:0;n=is_number(o[1])?o[1]:itms.total;r=o[2];t+=itms.first;n+=itms.first;if(items.total>0){while(t>itms.total){t-=itms.total}while(n>itms.total){n-=itms.total}while(t<0){t+=itms.total}while(n<0){n+=itms.total}}var u=$cfs.children(),a;if(n>t){a=u.slice(t,n)}else{a=$(u.slice(t,itms.total).get().concat(u.slice(0,n).get()))}if(is_function(r)){r.call($tt0,a)}return a});$cfs.on(cf_e("isPaused",conf)+" "+cf_e("isStopped",conf)+" "+cf_e("isScrolling",conf),function(e,t){e.stopPropagation();var n=e.type.slice(conf.events.prefix.length),r=crsl[n];if(is_function(t)){t.call($tt0,r)}return r});$cfs.on(cf_e("configuration",conf),function(e,a,b,c){e.stopPropagation();var reInit=false;if(is_function(a)){a.call($tt0,opts)}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)){if(is_function(b)){var val=eval("opts."+a);if(is_undefined(val)){val=""}b.call($tt0,val)}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")}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});$cfs.on(cf_e("linkAnchors",conf),function(e,t,n){e.stopPropagation();if(is_undefined(t)){t=$("body")}else if(is_string(t)){t=$(t)}if(!is_jquery(t)||t.length==0){return debug(conf,"Not a valid object.")}if(!is_string(n)){n="a.caroufredsel"}t.find(n).each(function(){var e=this.hash||"";if(e.length>0&&$cfs.children().index($(e))!=-1){$(this).off("click").click(function(t){t.preventDefault();$cfs.trigger(cf_e("slideTo",conf),e)})}});return true});$cfs.on(cf_e("updatePageStatus",conf),function(e,t,n){e.stopPropagation();if(!opts.pagination.container){return}var r=opts.pagination.items||opts.items.visible,i=Math.ceil(itms.total/r);if(t){if(opts.pagination.anchorBuilder){opts.pagination.container.children().remove();opts.pagination.container.each(function(){for(var e=0;e=i){s=0}if(s<0){s=i-1}opts.pagination.container.each(function(){$(this).children().removeClass(cf_c("selected",conf)).eq(s).addClass(cf_c("selected",conf))});return true});$cfs.on(cf_e("updateSizes",conf),function(e){var t=opts.items.visible,n=$cfs.children(),r=ms_getParentSize($wrp,opts,"width");itms.total=n.length;if(crsl.primarySizePercentage){opts.maxDimension=r;opts[opts.d["width"]]=ms_getPercentage(r,crsl.primarySizePercentage)}else{opts.maxDimension=ms_getMaxDimension(opts,r)}if(opts.responsive){opts.items.width=opts.items.sizesConf.width;opts.items.height=opts.items.sizesConf.height;opts=in_getResponsiveValues(opts,n,r);t=opts.items.visible;sz_setResponsiveSizes(opts,n)}else if(opts.items.visibleConf.variable){t=gn_getVisibleItemsNext(n,opts,0)}else if(opts.items.filter!="*"){t=gn_getVisibleItemsNextFilter(n,opts,0)}if(!opts.circular&&itms.first!=0&&t>itms.first){if(opts.items.visibleConf.variable){var i=gn_getVisibleItemsPrev(n,opts,itms.first)-itms.first}else if(opts.items.filter!="*"){var i=gn_getVisibleItemsPrevFilter(n,opts,itms.first)-itms.first}else{var i=opts.items.visible-itms.first}debug(conf,"Preventing non-circular: sliding "+i+" items backward.");$cfs.trigger(cf_e("prev",conf),i)}opts.items.visible=cf_getItemsAdjust(t,opts,opts.items.visibleConf.adjust,$tt0);opts.items.visibleConf.old=opts.items.visible;opts=in_getAlignPadding(opts,n);var s=sz_setSizes($cfs,opts);$cfs.trigger(cf_e("updatePageStatus",conf),[true,s]);nv_showNavi(opts,itms.total,conf);nv_enableNavi(opts,itms.first,conf);return s});$cfs.on(cf_e("destroy",conf),function(e,t){e.stopPropagation();tmrs=sc_clearTimers(tmrs);$cfs.data("_cfs_isCarousel",false);$cfs.trigger(cf_e("finish",conf));if(t){$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});$cfs.on(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});$cfs.on("_cfs_triggerEvent",function(e,t,n){e.stopPropagation();return $cfs.triggerHandler(cf_e(t,conf),n)})};FN._unbind_events=function(){$cfs.off(cf_e("",conf));$cfs.off(cf_e("",conf,false));$cfs.off("_cfs_triggerEvent")};FN._bind_buttons=function(){FN._unbind_buttons();nv_showNavi(opts,itms.total,conf);nv_enableNavi(opts,itms.first,conf);if(opts.auto.pauseOnHover){var e=bt_pauseOnHoverConfig(opts.auto.pauseOnHover);$wrp.on(cf_e("mouseenter",conf,false),function(){$cfs.trigger(cf_e("pause",conf),e)}).on(cf_e("mouseleave",conf,false),function(){$cfs.trigger(cf_e("resume",conf))})}if(opts.auto.button){opts.auto.button.on(cf_e(opts.auto.event,conf,false),function(e){e.preventDefault();var t=false,n=null;if(crsl.isPaused){t="play"}else if(opts.auto.pauseOnEvent){t="pause";n=bt_pauseOnHoverConfig(opts.auto.pauseOnEvent)}if(t){$cfs.trigger(cf_e(t,conf),n)}})}if(opts.prev.button){opts.prev.button.on(cf_e(opts.prev.event,conf,false),function(e){e.preventDefault();$cfs.trigger(cf_e("prev",conf))});if(opts.prev.pauseOnHover){var e=bt_pauseOnHoverConfig(opts.prev.pauseOnHover);opts.prev.button.on(cf_e("mouseenter",conf,false),function(){$cfs.trigger(cf_e("pause",conf),e)}).on(cf_e("mouseleave",conf,false),function(){$cfs.trigger(cf_e("resume",conf))})}}if(opts.next.button){opts.next.button.on(cf_e(opts.next.event,conf,false),function(e){e.preventDefault();$cfs.trigger(cf_e("next",conf))});if(opts.next.pauseOnHover){var e=bt_pauseOnHoverConfig(opts.next.pauseOnHover);opts.next.button.on(cf_e("mouseenter",conf,false),function(){$cfs.trigger(cf_e("pause",conf),e)}).on(cf_e("mouseleave",conf,false),function(){$cfs.trigger(cf_e("resume",conf))})}}if(opts.pagination.container){if(opts.pagination.pauseOnHover){var e=bt_pauseOnHoverConfig(opts.pagination.pauseOnHover);opts.pagination.container.on(cf_e("mouseenter",conf,false),function(){$cfs.trigger(cf_e("pause",conf),e)}).on(cf_e("mouseleave",conf,false),function(){$cfs.trigger(cf_e("resume",conf))})}}if(opts.prev.key||opts.next.key){$(document).on(cf_e("keyup",conf,false,true,true),function(e){var t=e.keyCode;if(t==opts.next.key){e.preventDefault();$cfs.trigger(cf_e("next",conf))}if(t==opts.prev.key){e.preventDefault();$cfs.trigger(cf_e("prev",conf))}})}if(opts.pagination.keys){$(document).on(cf_e("keyup",conf,false,true,true),function(e){var t=e.keyCode;if(t>=49&&t<58){t=(t-49)*opts.items.visible;if(t<=itms.total){e.preventDefault();$cfs.trigger(cf_e("slideTo",conf),[t,0,true,opts.pagination])}}})}if($.fn.swipe){var t="ontouchstart"in window;if(t&&opts.swipe.onTouch||!t&&opts.swipe.onMouse){var n=$.extend(true,{},opts.prev,opts.swipe),r=$.extend(true,{},opts.next,opts.swipe),i=function(){$cfs.trigger(cf_e("prev",conf),[n])},s=function(){$cfs.trigger(cf_e("next",conf),[r])};switch(opts.direction){case"up":case"down":opts.swipe.options.swipeUp=s;opts.swipe.options.swipeDown=i;break;default:opts.swipe.options.swipeLeft=s;opts.swipe.options.swipeRight=i}if(crsl.swipe){$cfs.swipe("destroy")}$wrp.swipe(opts.swipe.options);$wrp.css("cursor","move");crsl.swipe=true}}if($.fn.mousewheel){if(opts.mousewheel){var o=$.extend(true,{},opts.prev,opts.mousewheel),u=$.extend(true,{},opts.next,opts.mousewheel);if(crsl.mousewheel){$wrp.off(cf_e("mousewheel",conf,false))}$wrp.on(cf_e("mousewheel",conf,false),function(e,t){e.preventDefault();if(t>0){$cfs.trigger(cf_e("prev",conf),[o])}else{$cfs.trigger(cf_e("next",conf),[u])}});crsl.mousewheel=true}}if(opts.auto.play){$cfs.trigger(cf_e("play",conf),opts.auto.delay)}if(crsl.upDateOnWindowResize){var a,f;if(jQuery.browser.msie&&parseInt(jQuery.browser.version,10)<=8){var l=function(e){if(a==undefined||a!=$(window).height()||f==undefined||f!=$(window).width()){$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));a=$(window).height();f=$(window).width()}}}else{var l=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 c=$(window),h=null;if($.debounce&&conf.onWindowResize=="debounce"){h=$.debounce(200,l)}else if($.throttle&&conf.onWindowResize=="throttle"){h=$.throttle(300,l)}else{var p=0,d=0;h=function(){var e=c.width(),t=c.height();if(e!=p||t!=d){l();p=e;d=t}}}c.on(cf_e("resize",conf,false,true,true),h)}};FN._unbind_buttons=function(){var e=cf_e("",conf),t=cf_e("",conf,false);ns3=cf_e("",conf,false,true,true);$(document).off(ns3);$(window).off(ns3);$wrp.off(t);if(opts.auto.button){opts.auto.button.off(t)}if(opts.prev.button){opts.prev.button.off(t)}if(opts.next.button){opts.next.button.off(t)}if(opts.pagination.container){opts.pagination.container.off(t);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)};if(is_boolean(configs)){configs={debug:configs}}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";FN._init(opts_orig,true,starting_position);FN._build();FN._bind_events();FN._bind_buttons();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'+e+""};$.fn.carouFredSel.progressbarUpdater=function(e){$(this).css("width",e+"%")};$.fn.carouFredSel.cookie={get:function(e){e+="=";var t=document.cookie.split(";");for(var n=0,r=t.length;n0&&(e.splice(d-1,2),d-=2)}e=e.join("/")}else 0===e.indexOf("./")&&(e=e.substring(2));if((g||v)&&m){for(d=(n=e.split("/")).length;d>0;d-=1){if(i=n.slice(0,d).join("/"),g)for(p=g.length;p>0;p-=1)if((o=m[g.slice(0,p).join("/")])&&(o=o[i])){r=o,a=d;break}if(r)break;!l&&v&&v[i]&&(l=v[i],c=d)}!r&&l&&(r=l,a=c),r&&(n.splice(0,a,r),e=n.join("/"))}return e}function v(t,n){return function(){var i=h.call(arguments,0);return"string"!=typeof i[0]&&1===i.length&&i.push(null),r.apply(e,i.concat([t,n]))}}function y(e){return function(t){l[e]=t}}function _(n){if(g(c,n)){var i=c[n];delete c[n],d[n]=!0,t.apply(e,i)}if(!g(l,n)&&!g(d,n))throw new Error("No "+n);return l[n]}function w(e){var t,n=e?e.indexOf("!"):-1;return n>-1&&(t=e.substring(0,n),e=e.substring(n+1,e.length)),[t,e]}s=function(e,t){var n,i=w(e),o=i[0];return e=i[1],o&&(n=_(o=m(o,t))),o?e=n&&n.normalize?n.normalize(e,function(e){return function(t){return m(t,e)}}(t)):m(e,t):(o=(i=w(e=m(e,t)))[0],e=i[1],o&&(n=_(o))),{f:o?o+"!"+e:e,n:e,pr:o,p:n}},a={require:function(e){return v(e)},exports:function(e){var t=l[e];return void 0!==t?t:l[e]={}},module:function(e){return{id:e,uri:"",exports:l[e],config:function(e){return function(){return u&&u.config&&u.config[e]||{}}}(e)}}},t=function(t,n,i,o){var r,u,p,h,f,m,w=[],$=typeof i;if(o=o||t,"undefined"===$||"function"===$){for(n=!n.length&&i.length?["require","exports","module"]:n,f=0;f0&&(n.call(arguments,e.prototype.constructor),o=t.prototype.constructor),o.apply(this,arguments)}t.displayName=e.displayName,r.prototype=new function(){this.constructor=r};for(var s=0;s":">",'"':""","'":"'","/":"/"};return"string"!=typeof e?e:String(e).replace(/[&<>"'\/\\]/g,function(e){return t[e]})},t.appendMany=function(t,n){if("1.7"===e.fn.jquery.substr(0,3)){var i=e();e.map(n,function(e){i=i.add(e)}),n=i}t.append(n)},t}),t.define("select2/results",["jquery","./utils"],function(e,t){function n(e,t,i){this.$element=e,this.data=i,this.options=t,n.__super__.constructor.call(this)}return t.Extend(n,t.Observable),n.prototype.render=function(){var t=e('
    ');return this.options.get("multiple")&&t.attr("aria-multiselectable","true"),this.$results=t,t},n.prototype.clear=function(){this.$results.empty()},n.prototype.displayMessage=function(t){var n=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var i=e('
  • '),o=this.options.get("translations").get(t.message);i.append(n(o(t.args))),i[0].className+=" select2-results__message",this.$results.append(i)},n.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},n.prototype.append=function(e){this.hideLoading();var t=[];if(null!=e.results&&0!==e.results.length){e.results=this.sort(e.results);for(var n=0;n0?t.first().trigger("mouseenter"):e.first().trigger("mouseenter"),this.ensureHighlightVisible()},n.prototype.setClasses=function(){var t=this;this.data.current(function(n){var i=e.map(n,function(e){return e.id.toString()});t.$results.find(".select2-results__option[aria-selected]").each(function(){var t=e(this),n=e.data(this,"data"),o=""+n.id;null!=n.element&&n.element.selected||null==n.element&&e.inArray(o,i)>-1?t.attr("aria-selected","true"):t.attr("aria-selected","false")})})},n.prototype.showLoading=function(e){this.hideLoading();var t={disabled:!0,loading:!0,text:this.options.get("translations").get("searching")(e)},n=this.option(t);n.className+=" loading-results",this.$results.prepend(n)},n.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},n.prototype.option=function(t){var n=document.createElement("li");n.className="select2-results__option";var i={role:"treeitem","aria-selected":"false"};for(var o in t.disabled&&(delete i["aria-selected"],i["aria-disabled"]="true"),null==t.id&&delete i["aria-selected"],null!=t._resultId&&(n.id=t._resultId),t.title&&(n.title=t.title),t.children&&(i.role="group",i["aria-label"]=t.text,delete i["aria-selected"]),i){var r=i[o];n.setAttribute(o,r)}if(t.children){var s=e(n),a=document.createElement("strong");a.className="select2-results__group";e(a);this.template(t,a);for(var l=[],c=0;c",{"class":"select2-results__options select2-results__options--nested"});p.append(l),s.append(a),s.append(p)}else this.template(t,n);return e.data(n,"data",t),n},n.prototype.bind=function(t,n){var i=this,o=t.id+"-results";this.$results.attr("id",o),t.on("results:all",function(e){i.clear(),i.append(e.data),t.isOpen()&&(i.setClasses(),i.highlightFirstItem())}),t.on("results:append",function(e){i.append(e.data),t.isOpen()&&i.setClasses()}),t.on("query",function(e){i.hideMessages(),i.showLoading(e)}),t.on("select",function(){t.isOpen()&&(i.setClasses(),i.highlightFirstItem())}),t.on("unselect",function(){t.isOpen()&&(i.setClasses(),i.highlightFirstItem())}),t.on("open",function(){i.$results.attr("aria-expanded","true"),i.$results.attr("aria-hidden","false"),i.setClasses(),i.ensureHighlightVisible()}),t.on("close",function(){i.$results.attr("aria-expanded","false"),i.$results.attr("aria-hidden","true"),i.$results.removeAttr("aria-activedescendant")}),t.on("results:toggle",function(){var e=i.getHighlightedResults();0!==e.length&&e.trigger("mouseup")}),t.on("results:select",function(){var e=i.getHighlightedResults();if(0!==e.length){var t=e.data("data");"true"==e.attr("aria-selected")?i.trigger("close",{}):i.trigger("select",{data:t})}}),t.on("results:previous",function(){var e=i.getHighlightedResults(),t=i.$results.find("[aria-selected]"),n=t.index(e);if(0!==n){var o=n-1;0===e.length&&(o=0);var r=t.eq(o);r.trigger("mouseenter");var s=i.$results.offset().top,a=r.offset().top,l=i.$results.scrollTop()+(a-s);0===o?i.$results.scrollTop(0):a-s<0&&i.$results.scrollTop(l)}}),t.on("results:next",function(){var e=i.getHighlightedResults(),t=i.$results.find("[aria-selected]"),n=t.index(e)+1;if(!(n>=t.length)){var o=t.eq(n);o.trigger("mouseenter");var r=i.$results.offset().top+i.$results.outerHeight(!1),s=o.offset().top+o.outerHeight(!1),a=i.$results.scrollTop()+s-r;0===n?i.$results.scrollTop(0):s>r&&i.$results.scrollTop(a)}}),t.on("results:focus",function(e){e.element.addClass("select2-results__option--highlighted")}),t.on("results:message",function(e){i.displayMessage(e)}),e.fn.mousewheel&&this.$results.on("mousewheel",function(e){var t=i.$results.scrollTop(),n=i.$results.get(0).scrollHeight-t+e.deltaY,o=e.deltaY>0&&t-e.deltaY<=0,r=e.deltaY<0&&n<=i.$results.height();o?(i.$results.scrollTop(0),e.preventDefault(),e.stopPropagation()):r&&(i.$results.scrollTop(i.$results.get(0).scrollHeight-i.$results.height()),e.preventDefault(),e.stopPropagation())}),this.$results.on("mouseup",".select2-results__option[aria-selected]",function(t){var n=e(this),o=n.data("data");"true"!==n.attr("aria-selected")?i.trigger("select",{originalEvent:t,data:o}):i.options.get("multiple")?i.trigger("unselect",{originalEvent:t,data:o}):i.trigger("close",{})}),this.$results.on("mouseenter",".select2-results__option[aria-selected]",function(t){var n=e(this).data("data");i.getHighlightedResults().removeClass("select2-results__option--highlighted"),i.trigger("results:focus",{data:n,element:e(this)})})},n.prototype.getHighlightedResults=function(){return this.$results.find(".select2-results__option--highlighted")},n.prototype.destroy=function(){this.$results.remove()},n.prototype.ensureHighlightVisible=function(){var e=this.getHighlightedResults();if(0!==e.length){var t=this.$results.find("[aria-selected]").index(e),n=this.$results.offset().top,i=e.offset().top,o=this.$results.scrollTop()+(i-n),r=i-n;o-=2*e.outerHeight(!1),t<=2?this.$results.scrollTop(0):(r>this.$results.outerHeight()||r<0)&&this.$results.scrollTop(o)}},n.prototype.template=function(t,n){var i=this.options.get("templateResult"),o=this.options.get("escapeMarkup"),r=i(t,n);null==r?n.style.display="none":"string"==typeof r?n.innerHTML=o(r):e(n).append(r)},n}),t.define("select2/keys",[],function(){return{BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46}}),t.define("select2/selection/base",["jquery","../utils","../keys"],function(e,t,n){function i(e,t){this.$element=e,this.options=t,i.__super__.constructor.call(this)}return t.Extend(i,t.Observable),i.prototype.render=function(){var t=e('');return this._tabindex=0,null!=this.$element.data("old-tabindex")?this._tabindex=this.$element.data("old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),t.attr("title",this.$element.attr("title")),t.attr("tabindex",this._tabindex),this.$selection=t,t},i.prototype.bind=function(e,t){var i=this,o=(e.id,e.id+"-results");this.container=e,this.$selection.on("focus",function(e){i.trigger("focus",e)}),this.$selection.on("blur",function(e){i._handleBlur(e)}),this.$selection.on("keydown",function(e){i.trigger("keypress",e),e.which===n.SPACE&&e.preventDefault()}),e.on("results:focus",function(e){i.$selection.attr("aria-activedescendant",e.data._resultId)}),e.on("selection:update",function(e){i.update(e.data)}),e.on("open",function(){i.$selection.attr("aria-expanded","true"),i.$selection.attr("aria-owns",o),i._attachCloseHandler(e)}),e.on("close",function(){i.$selection.attr("aria-expanded","false"),i.$selection.removeAttr("aria-activedescendant"),i.$selection.removeAttr("aria-owns"),i.$selection.focus(),i._detachCloseHandler(e)}),e.on("enable",function(){i.$selection.attr("tabindex",i._tabindex)}),e.on("disable",function(){i.$selection.attr("tabindex","-1")})},i.prototype._handleBlur=function(t){var n=this;window.setTimeout(function(){document.activeElement==n.$selection[0]||e.contains(n.$selection[0],document.activeElement)||n.trigger("blur",t)},1)},i.prototype._attachCloseHandler=function(t){e(document.body).on("mousedown.select2."+t.id,function(t){var n=e(t.target).closest(".select2");e(".select2.select2-container--open").each(function(){var t=e(this);this!=n[0]&&t.data("element").select2("close")})})},i.prototype._detachCloseHandler=function(t){e(document.body).off("mousedown.select2."+t.id)},i.prototype.position=function(e,t){t.find(".selection").append(e)},i.prototype.destroy=function(){this._detachCloseHandler(this.container)},i.prototype.update=function(e){throw new Error("The `update` method must be defined in child classes.")},i}),t.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(e,t,n,i){function o(){o.__super__.constructor.apply(this,arguments)}return n.Extend(o,t),o.prototype.render=function(){var e=o.__super__.render.call(this);return e.addClass("select2-selection--single"),e.html(''),e},o.prototype.bind=function(e,t){var n=this;o.__super__.bind.apply(this,arguments);var i=e.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",i),this.$selection.attr("aria-labelledby",i),this.$selection.on("mousedown",function(e){1===e.which&&n.trigger("toggle",{originalEvent:e})}),this.$selection.on("focus",function(e){}),this.$selection.on("blur",function(e){}),e.on("focus",function(t){e.isOpen()||n.$selection.focus()}),e.on("selection:update",function(e){n.update(e.data)})},o.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},o.prototype.display=function(e,t){var n=this.options.get("templateSelection");return this.options.get("escapeMarkup")(n(e,t))},o.prototype.selectionContainer=function(){return e("")},o.prototype.update=function(e){if(0!==e.length){var t=e[0],n=this.$selection.find(".select2-selection__rendered"),i=this.display(t,n);n.empty().append(i),n.prop("title",t.title||t.text)}else this.clear()},o}),t.define("select2/selection/multiple",["jquery","./base","../utils"],function(e,t,n){function i(e,t){i.__super__.constructor.apply(this,arguments)}return n.Extend(i,t),i.prototype.render=function(){var e=i.__super__.render.call(this);return e.addClass("select2-selection--multiple"),e.html('
      '),e},i.prototype.bind=function(t,n){var o=this;i.__super__.bind.apply(this,arguments),this.$selection.on("click",function(e){o.trigger("toggle",{originalEvent:e})}),this.$selection.on("click",".select2-selection__choice__remove",function(t){if(!o.options.get("disabled")){var n=e(this).parent().data("data");o.trigger("unselect",{originalEvent:t,data:n})}})},i.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},i.prototype.display=function(e,t){var n=this.options.get("templateSelection");return this.options.get("escapeMarkup")(n(e,t))},i.prototype.selectionContainer=function(){return e('
    • ×
    • ')},i.prototype.update=function(e){if(this.clear(),0!==e.length){for(var t=[],i=0;i1||n)return e.call(this,t);this.clear();var i=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__rendered").append(i)},t}),t.define("select2/selection/allowClear",["jquery","../keys"],function(e,t){function n(){}return n.prototype.bind=function(e,t,n){var i=this;e.call(this,t,n),null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option."),this.$selection.on("mousedown",".select2-selection__clear",function(e){i._handleClear(e)}),t.on("keypress",function(e){i._handleKeyboardClear(e,t)})},n.prototype._handleClear=function(e,t){if(!this.options.get("disabled")){var n=this.$selection.find(".select2-selection__clear");if(0!==n.length){t.stopPropagation();for(var i=n.data("data"),o=0;o0||0===n.length)){var i=e('×');i.data("data",n),this.$selection.find(".select2-selection__rendered").prepend(i)}},n}),t.define("select2/selection/search",["jquery","../utils","../keys"],function(e,t,n){function i(e,t,n){e.call(this,t,n)}return i.prototype.render=function(t){var n=e('');this.$searchContainer=n,this.$search=n.find("input");var i=t.call(this);return this._transferTabIndex(),i},i.prototype.bind=function(e,t,i){var o=this;e.call(this,t,i),t.on("open",function(){o.$search.trigger("focus")}),t.on("close",function(){o.$search.val(""),o.$search.removeAttr("aria-activedescendant"),o.$search.trigger("focus")}),t.on("enable",function(){o.$search.prop("disabled",!1),o._transferTabIndex()}),t.on("disable",function(){o.$search.prop("disabled",!0)}),t.on("focus",function(e){o.$search.trigger("focus")}),t.on("results:focus",function(e){o.$search.attr("aria-activedescendant",e.id)}),this.$selection.on("focusin",".select2-search--inline",function(e){o.trigger("focus",e)}),this.$selection.on("focusout",".select2-search--inline",function(e){o._handleBlur(e)}),this.$selection.on("keydown",".select2-search--inline",function(e){if(e.stopPropagation(),o.trigger("keypress",e),o._keyUpPrevented=e.isDefaultPrevented(),e.which===n.BACKSPACE&&""===o.$search.val()){var t=o.$searchContainer.prev(".select2-selection__choice");if(t.length>0){var i=t.data("data");o.searchRemoveChoice(i),e.preventDefault()}}});var r=document.documentMode,s=r&&r<=11;this.$selection.on("input.searchcheck",".select2-search--inline",function(e){s?o.$selection.off("input.search input.searchcheck"):o.$selection.off("keyup.search")}),this.$selection.on("keyup.search input.search",".select2-search--inline",function(e){if(s&&"input"===e.type)o.$selection.off("input.search input.searchcheck");else{var t=e.which;t!=n.SHIFT&&t!=n.CTRL&&t!=n.ALT&&t!=n.TAB&&o.handleSearch(e)}})},i.prototype._transferTabIndex=function(e){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},i.prototype.createPlaceholder=function(e,t){this.$search.attr("placeholder",t.text)},i.prototype.update=function(e,t){var n=this.$search[0]==document.activeElement;this.$search.attr("placeholder",""),e.call(this,t),this.$selection.find(".select2-selection__rendered").append(this.$searchContainer),this.resizeSearch(),n&&this.$search.focus()},i.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var e=this.$search.val();this.trigger("query",{term:e})}this._keyUpPrevented=!1},i.prototype.searchRemoveChoice=function(e,t){this.trigger("unselect",{data:t}),this.$search.val(t.text),this.handleSearch()},i.prototype.resizeSearch=function(){this.$search.css("width","25px");var e="";""!==this.$search.attr("placeholder")?e=this.$selection.find(".select2-selection__rendered").innerWidth():e=.75*(this.$search.val().length+1)+"em";this.$search.css("width",e)},i}),t.define("select2/selection/eventRelay",["jquery"],function(e){function t(){}return t.prototype.bind=function(t,n,i){var o=this,r=["open","opening","close","closing","select","selecting","unselect","unselecting"],s=["opening","closing","selecting","unselecting"];t.call(this,n,i),n.on("*",function(t,n){if(-1!==e.inArray(t,r)){n=n||{};var i=e.Event("select2:"+t,{params:n});o.$element.trigger(i),-1!==e.inArray(t,s)&&(n.prevented=i.isDefaultPrevented())}})},t}),t.define("select2/translation",["jquery","require"],function(e,t){function n(e){this.dict=e||{}}return n.prototype.all=function(){return this.dict},n.prototype.get=function(e){return this.dict[e]},n.prototype.extend=function(t){this.dict=e.extend({},t.all(),this.dict)},n._cache={},n.loadPath=function(e){if(!(e in n._cache)){var i=t(e);n._cache[e]=i}return new n(n._cache[e])},n}),t.define("select2/diacritics",[],function(){return{"Ⓐ":"A","A":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","C":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","Ⓔ":"E","E":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","I":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","L":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","NJ":"NJ","Nj":"Nj","Ⓞ":"O","O":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","P":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Q":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","R":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","S":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","T":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","U":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","V":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","W":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Y":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Z":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","a":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","c":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","dz":"dz","dž":"dz","ⓔ":"e","e":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","l":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","nj":"nj","ⓞ":"o","o":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ω":"ω","ς":"σ"}}),t.define("select2/data/base",["../utils"],function(e){function t(e,n){t.__super__.constructor.call(this)}return e.Extend(t,e.Observable),t.prototype.current=function(e){throw new Error("The `current` method must be defined in child classes.")},t.prototype.query=function(e,t){throw new Error("The `query` method must be defined in child classes.")},t.prototype.bind=function(e,t){},t.prototype.destroy=function(){},t.prototype.generateResultId=function(t,n){var i=t.id+"-result-";return i+=e.generateChars(4),null!=n.id?i+="-"+n.id.toString():i+="-"+e.generateChars(4),i},t}),t.define("select2/data/select",["./base","../utils","jquery"],function(e,t,n){function i(e,t){this.$element=e,this.options=t,i.__super__.constructor.call(this)}return t.Extend(i,e),i.prototype.current=function(e){var t=[],i=this;this.$element.find(":selected").each(function(){var e=n(this),o=i.item(e);t.push(o)}),e(t)},i.prototype.select=function(e){var t=this;if(e.selected=!0,n(e.element).is("option"))return e.element.selected=!0,void this.$element.trigger("change");if(this.$element.prop("multiple"))this.current(function(i){var o=[];(e=[e]).push.apply(e,i);for(var r=0;r=0){var u=o.filter(a(c)),d=this.item(u),p=n.extend(!0,{},c,d),h=this.option(p);u.replaceWith(h)}else{var f=this.option(c);if(c.children){var g=this.convertToOptions(c.children);t.appendMany(f,g)}s.push(f)}}return s},i}),t.define("select2/data/ajax",["./array","../utils","jquery"],function(e,t,n){function i(e,t){this.ajaxOptions=this._applyDefaults(t.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),i.__super__.constructor.call(this,e,t)}return t.Extend(i,e),i.prototype._applyDefaults=function(e){var t={data:function(e){return n.extend({},e,{q:e.term})},transport:function(e,t,i){var o=n.ajax(e);return o.then(t),o.fail(i),o}};return n.extend({},t,e,!0)},i.prototype.processResults=function(e){return e},i.prototype.query=function(e,t){var i=this;null!=this._request&&(n.isFunction(this._request.abort)&&this._request.abort(),this._request=null);var o=n.extend({type:"GET"},this.ajaxOptions);function r(){var r=o.transport(o,function(o){var r=i.processResults(o,e);i.options.get("debug")&&window.console&&console.error&&(r&&r.results&&n.isArray(r.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),t(r)},function(){r.status&&"0"===r.status||i.trigger("results:message",{message:"errorLoading"})});i._request=r}"function"==typeof o.url&&(o.url=o.url.call(this.$element,e)),"function"==typeof o.data&&(o.data=o.data.call(this.$element,e)),this.ajaxOptions.delay&&null!=e.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(r,this.ajaxOptions.delay)):r()},i}),t.define("select2/data/tags",["jquery"],function(e){function t(t,n,i){var o=i.get("tags"),r=i.get("createTag");r!==undefined&&(this.createTag=r);var s=i.get("insertTag");if(s!==undefined&&(this.insertTag=s),t.call(this,n,i),e.isArray(o))for(var a=0;a0&&t.term.length>this.maximumInputLength?this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:t.term,params:t}}):e.call(this,t,n)},e}),t.define("select2/data/maximumSelectionLength",[],function(){function e(e,t,n){this.maximumSelectionLength=n.get("maximumSelectionLength"),e.call(this,t,n)}return e.prototype.query=function(e,t,n){var i=this;this.current(function(o){var r=null!=o?o.length:0;i.maximumSelectionLength>0&&r>=i.maximumSelectionLength?i.trigger("results:message",{message:"maximumSelected",args:{maximum:i.maximumSelectionLength}}):e.call(i,t,n)})},e}),t.define("select2/dropdown",["jquery","./utils"],function(e,t){function n(e,t){this.$element=e,this.options=t,n.__super__.constructor.call(this)}return t.Extend(n,t.Observable),n.prototype.render=function(){var t=e('');return t.attr("dir",this.options.get("dir")),this.$dropdown=t,t},n.prototype.bind=function(){},n.prototype.position=function(e,t){},n.prototype.destroy=function(){this.$dropdown.remove()},n}),t.define("select2/dropdown/search",["jquery","../utils"],function(e,t){function n(){}return n.prototype.render=function(t){var n=t.call(this),i=e('');return this.$searchContainer=i,this.$search=i.find("input"),n.prepend(i),n},n.prototype.bind=function(t,n,i){var o=this;t.call(this,n,i),this.$search.on("keydown",function(e){o.trigger("keypress",e),o._keyUpPrevented=e.isDefaultPrevented()}),this.$search.on("input",function(t){e(this).off("keyup")}),this.$search.on("keyup input",function(e){o.handleSearch(e)}),n.on("open",function(){o.$search.attr("tabindex",0),o.$search.focus(),window.setTimeout(function(){o.$search.focus()},0)}),n.on("close",function(){o.$search.attr("tabindex",-1),o.$search.val("")}),n.on("focus",function(){n.isOpen()&&o.$search.focus()}),n.on("results:all",function(e){null!=e.query.term&&""!==e.query.term||(o.showSearch(e)?o.$searchContainer.removeClass("select2-search--hide"):o.$searchContainer.addClass("select2-search--hide"))})},n.prototype.handleSearch=function(e){if(!this._keyUpPrevented){var t=this.$search.val();this.trigger("query",{term:t})}this._keyUpPrevented=!1},n.prototype.showSearch=function(e,t){return!0},n}),t.define("select2/dropdown/hidePlaceholder",[],function(){function e(e,t,n,i){this.placeholder=this.normalizePlaceholder(n.get("placeholder")),e.call(this,t,n,i)}return e.prototype.append=function(e,t){t.results=this.removePlaceholder(t.results),e.call(this,t)},e.prototype.normalizePlaceholder=function(e,t){return"string"==typeof t&&(t={id:"",text:t}),t},e.prototype.removePlaceholder=function(e,t){for(var n=t.slice(0),i=t.length-1;i>=0;i--){var o=t[i];this.placeholder.id===o.id&&n.splice(i,1)}return n},e}),t.define("select2/dropdown/infiniteScroll",["jquery"],function(e){function t(e,t,n,i){this.lastParams={},e.call(this,t,n,i),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return t.prototype.append=function(e,t){this.$loadingMore.remove(),this.loading=!1,e.call(this,t),this.showLoadingMore(t)&&this.$results.append(this.$loadingMore)},t.prototype.bind=function(t,n,i){var o=this;t.call(this,n,i),n.on("query",function(e){o.lastParams=e,o.loading=!0}),n.on("query:append",function(e){o.lastParams=e,o.loading=!0}),this.$results.on("scroll",function(){var t=e.contains(document.documentElement,o.$loadingMore[0]);!o.loading&&t&&(o.$results.offset().top+o.$results.outerHeight(!1)+50>=o.$loadingMore.offset().top+o.$loadingMore.outerHeight(!1)&&o.loadMore())})},t.prototype.loadMore=function(){this.loading=!0;var t=e.extend({},{page:1},this.lastParams);t.page++,this.trigger("query:append",t)},t.prototype.showLoadingMore=function(e,t){return t.pagination&&t.pagination.more},t.prototype.createLoadingMore=function(){var t=e('
    • '),n=this.options.get("translations").get("loadingMore");return t.html(n(this.lastParams)),t},t}),t.define("select2/dropdown/attachBody",["jquery","../utils"],function(e,t){function n(t,n,i){this.$dropdownParent=i.get("dropdownParent")||e(document.body),t.call(this,n,i)}return n.prototype.bind=function(e,t,n){var i=this,o=!1;e.call(this,t,n),t.on("open",function(){i._showDropdown(),i._attachPositioningHandler(t),o||(o=!0,t.on("results:all",function(){i._positionDropdown(),i._resizeDropdown()}),t.on("results:append",function(){i._positionDropdown(),i._resizeDropdown()}))}),t.on("close",function(){i._hideDropdown(),i._detachPositioningHandler(t)}),this.$dropdownContainer.on("mousedown",function(e){e.stopPropagation()})},n.prototype.destroy=function(e){e.call(this),this.$dropdownContainer.remove()},n.prototype.position=function(e,t,n){t.attr("class",n.attr("class")),t.removeClass("select2"),t.addClass("select2-container--open"),t.css({position:"absolute",top:-999999}),this.$container=n},n.prototype.render=function(t){var n=e(""),i=t.call(this);return n.append(i),this.$dropdownContainer=n,n},n.prototype._hideDropdown=function(e){this.$dropdownContainer.detach()},n.prototype._attachPositioningHandler=function(n,i){var o=this,r="scroll.select2."+i.id,s="resize.select2."+i.id,a="orientationchange.select2."+i.id,l=this.$container.parents().filter(t.hasScroll);l.each(function(){e(this).data("select2-scroll-position",{x:e(this).scrollLeft(),y:e(this).scrollTop()})}),l.on(r,function(t){var n=e(this).data("select2-scroll-position");e(this).scrollTop(n.y)}),e(window).on(r+" "+s+" "+a,function(e){o._positionDropdown(),o._resizeDropdown()})},n.prototype._detachPositioningHandler=function(n,i){var o="scroll.select2."+i.id,r="resize.select2."+i.id,s="orientationchange.select2."+i.id;this.$container.parents().filter(t.hasScroll).off(o),e(window).off(o+" "+r+" "+s)},n.prototype._positionDropdown=function(){var t=e(window),n=this.$dropdown.hasClass("select2-dropdown--above"),i=this.$dropdown.hasClass("select2-dropdown--below"),o=null,r=this.$container.offset();r.bottom=r.top+this.$container.outerHeight(!1);var s={height:this.$container.outerHeight(!1)};s.top=r.top,s.bottom=r.top+s.height;var a=this.$dropdown.outerHeight(!1),l=t.scrollTop(),c=t.scrollTop()+t.height(),u=lr.bottom+a,p={left:r.left,top:s.bottom},h=this.$dropdownParent;"static"===h.css("position")&&(h=h.offsetParent());var f=h.offset();p.top-=f.top,p.left-=f.left,n||i||(o="below"),d||!u||n?!u&&d&&n&&(o="below"):o="above",("above"==o||n&&"below"!==o)&&(p.top=s.top-f.top-a),null!=o&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+o),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+o)),this.$dropdownContainer.css(p)},n.prototype._resizeDropdown=function(){var e={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(e.minWidth=e.width,e.position="relative",e.width="auto"),this.$dropdown.css(e)},n.prototype._showDropdown=function(e){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},n}),t.define("select2/dropdown/minimumResultsForSearch",[],function(){function e(e,t,n,i){this.minimumResultsForSearch=n.get("minimumResultsForSearch"),this.minimumResultsForSearch<0&&(this.minimumResultsForSearch=Infinity),e.call(this,t,n,i)}return e.prototype.showSearch=function(e,t){return!(function n(e){for(var t=0,i=0;i0&&(d.dataAdapter=c.Decorate(d.dataAdapter,v)),d.maximumInputLength>0&&(d.dataAdapter=c.Decorate(d.dataAdapter,y)),d.maximumSelectionLength>0&&(d.dataAdapter=c.Decorate(d.dataAdapter,_)),d.tags&&(d.dataAdapter=c.Decorate(d.dataAdapter,g)),null==d.tokenSeparators&&null==d.tokenizer||(d.dataAdapter=c.Decorate(d.dataAdapter,m)),null!=d.query){var E=t(d.amdBase+"compat/query");d.dataAdapter=c.Decorate(d.dataAdapter,E)}if(null!=d.initSelection){var D=t(d.amdBase+"compat/initSelection");d.dataAdapter=c.Decorate(d.dataAdapter,D)}}if(null==d.resultsAdapter&&(d.resultsAdapter=n,null!=d.ajax&&(d.resultsAdapter=c.Decorate(d.resultsAdapter,x)),null!=d.placeholder&&(d.resultsAdapter=c.Decorate(d.resultsAdapter,b)),d.selectOnClose&&(d.resultsAdapter=c.Decorate(d.resultsAdapter,S))),null==d.dropdownAdapter){if(d.multiple)d.dropdownAdapter=w;else{var T=c.Decorate(w,$);d.dropdownAdapter=T}if(0!==d.minimumResultsForSearch&&(d.dropdownAdapter=c.Decorate(d.dropdownAdapter,C)),d.closeOnSelect&&(d.dropdownAdapter=c.Decorate(d.dropdownAdapter,O)),null!=d.dropdownCssClass||null!=d.dropdownCss||null!=d.adaptDropdownCssClass){var q=t(d.amdBase+"compat/dropdownCss");d.dropdownAdapter=c.Decorate(d.dropdownAdapter,q)}d.dropdownAdapter=c.Decorate(d.dropdownAdapter,A)}if(null==d.selectionAdapter){if(d.multiple?d.selectionAdapter=o:d.selectionAdapter=i,null!=d.placeholder&&(d.selectionAdapter=c.Decorate(d.selectionAdapter,r)),d.allowClear&&(d.selectionAdapter=c.Decorate(d.selectionAdapter,s)),d.multiple&&(d.selectionAdapter=c.Decorate(d.selectionAdapter,a)),null!=d.containerCssClass||null!=d.containerCss||null!=d.adaptContainerCssClass){var j=t(d.amdBase+"compat/containerCss");d.selectionAdapter=c.Decorate(d.selectionAdapter,j)}d.selectionAdapter=c.Decorate(d.selectionAdapter,l)}if("string"==typeof d.language)if(d.language.indexOf("-")>0){var L=d.language.split("-")[0];d.language=[d.language,L]}else d.language=[d.language];if(e.isArray(d.language)){var k=new u;d.language.push("en");for(var P=d.language,I=0;I0){for(var r=e.extend(!0,{},o),s=o.children.length-1;s>=0;s--)null==n(i,o.children[s])&&r.children.splice(s,1);return r.children.length>0?r:n(i,r)}var a=t(o.text).toUpperCase(),l=t(i.term).toUpperCase();return a.indexOf(l)>-1?o:null},minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,sorter:function(e){return e},templateResult:function(e){return e.text},templateSelection:function(e){return e.text},theme:"default",width:"resolve"}},D.prototype.set=function(t,n){var i={};i[e.camelCase(t)]=n;var o=c._convertData(i);e.extend(this.defaults,o)},new D}),t.define("select2/options",["require","jquery","./defaults","./utils"],function(e,t,n,i){function o(t,o){if(this.options=t,null!=o&&this.fromElement(o),this.options=n.apply(this.options),o&&o.is("input")){var r=e(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=i.Decorate(this.options.dataAdapter,r)}}return o.prototype.fromElement=function(e){var n=["select2"];null==this.options.multiple&&(this.options.multiple=e.prop("multiple")),null==this.options.disabled&&(this.options.disabled=e.prop("disabled")),null==this.options.language&&(e.prop("lang")?this.options.language=e.prop("lang").toLowerCase():e.closest("[lang]").prop("lang")&&(this.options.language=e.closest("[lang]").prop("lang"))),null==this.options.dir&&(e.prop("dir")?this.options.dir=e.prop("dir"):e.closest("[dir]").prop("dir")?this.options.dir=e.closest("[dir]").prop("dir"):this.options.dir="ltr"),e.prop("disabled",this.options.disabled),e.prop("multiple",this.options.multiple),e.data("select2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),e.data("data",e.data("select2Tags")),e.data("tags",!0)),e.data("ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),e.attr("ajax--url",e.data("ajaxUrl")),e.data("ajax--url",e.data("ajaxUrl")));var o={};o=t.fn.jquery&&"1."==t.fn.jquery.substr(0,2)&&e[0].dataset?t.extend(!0,{},e[0].dataset,e.data()):e.data();var r=t.extend(!0,{},o);for(var s in r=i._convertData(r))t.inArray(s,n)>-1||(t.isPlainObject(this.options[s])?t.extend(this.options[s],r[s]):this.options[s]=r[s]);return this},o.prototype.get=function(e){return this.options[e]},o.prototype.set=function(e,t){this.options[e]=t},o}),t.define("select2/core",["jquery","./options","./utils","./keys"],function(e,t,n,i){var o=function(e,n){null!=e.data("select2")&&e.data("select2").destroy(),this.$element=e,this.id=this._generateId(e),n=n||{},this.options=new t(n,e),o.__super__.constructor.call(this);var i=e.attr("tabindex")||0;e.data("old-tabindex",i),e.attr("tabindex","-1");var r=this.options.get("dataAdapter");this.dataAdapter=new r(e,this.options);var s=this.render();this._placeContainer(s);var a=this.options.get("selectionAdapter");this.selection=new a(e,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,s);var l=this.options.get("dropdownAdapter");this.dropdown=new l(e,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,s);var c=this.options.get("resultsAdapter");this.results=new c(e,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var u=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current(function(e){u.trigger("selection:update",{data:e})}),e.addClass("select2-hidden-accessible"),e.attr("aria-hidden","true"),this._syncAttributes(),e.data("select2",this)};return n.Extend(o,n.Observable),o.prototype._generateId=function(e){return"select2-"+(null!=e.attr("id")?e.attr("id"):null!=e.attr("name")?e.attr("name")+"-"+n.generateChars(2):n.generateChars(4)).replace(/(:|\.|\[|\]|,)/g,"")},o.prototype._placeContainer=function(e){e.insertAfter(this.$element);var t=this._resolveWidth(this.$element,this.options.get("width"));null!=t&&e.css("width",t)},o.prototype._resolveWidth=function(e,t){var n=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==t){var i=this._resolveWidth(e,"style");return null!=i?i:this._resolveWidth(e,"element")}if("element"==t){var o=e.outerWidth(!1);return o<=0?"auto":o+"px"}if("style"==t){var r=e.attr("style");if("string"!=typeof r)return null;for(var s=r.split(";"),a=0,l=s.length;a=1)return c[1]}return null}return t},o.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},o.prototype._registerDomEvents=function(){var t=this;this.$element.on("change.select2",function(){t.dataAdapter.current(function(e){t.trigger("selection:update",{data:e})})}),this.$element.on("focus.select2",function(e){t.trigger("focus",e)}),this._syncA=n.bind(this._syncAttributes,this),this._syncS=n.bind(this._syncSubtree,this),this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._syncA);var i=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=i?(this._observer=new i(function(n){e.each(n,t._syncA),e.each(n,t._syncS)}),this._observer.observe(this.$element[0],{attributes:!0,childList:!0,subtree:!1})):this.$element[0].addEventListener&&(this.$element[0].addEventListener("DOMAttrModified",t._syncA,!1),this.$element[0].addEventListener("DOMNodeInserted",t._syncS,!1),this.$element[0].addEventListener("DOMNodeRemoved",t._syncS,!1))},o.prototype._registerDataEvents=function(){var e=this;this.dataAdapter.on("*",function(t,n){e.trigger(t,n)})},o.prototype._registerSelectionEvents=function(){var t=this,n=["toggle","focus"];this.selection.on("toggle",function(){t.toggleDropdown()}),this.selection.on("focus",function(e){t.focus(e)}),this.selection.on("*",function(i,o){-1===e.inArray(i,n)&&t.trigger(i,o)})},o.prototype._registerDropdownEvents=function(){var e=this;this.dropdown.on("*",function(t,n){e.trigger(t,n)})},o.prototype._registerResultsEvents=function(){var e=this;this.results.on("*",function(t,n){e.trigger(t,n)})},o.prototype._registerEvents=function(){var e=this;this.on("open",function(){e.$container.addClass("select2-container--open")}),this.on("close",function(){e.$container.removeClass("select2-container--open")}),this.on("enable",function(){e.$container.removeClass("select2-container--disabled")}),this.on("disable",function(){e.$container.addClass("select2-container--disabled")}),this.on("blur",function(){e.$container.removeClass("select2-container--focus")}),this.on("query",function(t){e.isOpen()||e.trigger("open",{}),this.dataAdapter.query(t,function(n){e.trigger("results:all",{data:n,query:t})})}),this.on("query:append",function(t){this.dataAdapter.query(t,function(n){e.trigger("results:append",{data:n,query:t})})}),this.on("keypress",function(t){var n=t.which;e.isOpen()?n===i.ESC||n===i.TAB||n===i.UP&&t.altKey?(e.close(),t.preventDefault()):n===i.ENTER?(e.trigger("results:select",{}),t.preventDefault()):n===i.SPACE&&t.ctrlKey?(e.trigger("results:toggle",{}),t.preventDefault()):n===i.UP?(e.trigger("results:previous",{}),t.preventDefault()):n===i.DOWN&&(e.trigger("results:next",{}),t.preventDefault()):(n===i.ENTER||n===i.SPACE||n===i.DOWN&&t.altKey)&&(e.open(),t.preventDefault())})},o.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.options.get("disabled")?(this.isOpen()&&this.close(),this.trigger("disable",{})):this.trigger("enable",{})},o.prototype._syncSubtree=function(e,t){var n=!1,i=this;if(!e||!e.target||"OPTION"===e.target.nodeName||"OPTGROUP"===e.target.nodeName){if(t)if(t.addedNodes&&t.addedNodes.length>0)for(var o=0;o0&&(n=!0);else n=!0;n&&this.dataAdapter.current(function(e){i.trigger("selection:update",{data:e})})}},o.prototype.trigger=function(e,t){var n=o.__super__.trigger,i={open:"opening",close:"closing",select:"selecting",unselect:"unselecting"};if(t===undefined&&(t={}),e in i){var r=i[e],s={prevented:!1,name:e,args:t};if(n.call(this,r,s),s.prevented)return void(t.prevented=!0)}n.call(this,e,t)},o.prototype.toggleDropdown=function(){this.options.get("disabled")||(this.isOpen()?this.close():this.open())},o.prototype.open=function(){this.isOpen()||this.trigger("query",{})},o.prototype.close=function(){this.isOpen()&&this.trigger("close",{})},o.prototype.isOpen=function(){return this.$container.hasClass("select2-container--open")},o.prototype.hasFocus=function(){return this.$container.hasClass("select2-container--focus")},o.prototype.focus=function(e){this.hasFocus()||(this.$container.addClass("select2-container--focus"),this.trigger("focus",{}))},o.prototype.enable=function(e){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'),null!=e&&0!==e.length||(e=[!0]);var t=!e[0];this.$element.prop("disabled",t)},o.prototype.data=function(){this.options.get("debug")&&arguments.length>0&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.');var e=[];return this.dataAdapter.current(function(t){e=t}),e},o.prototype.val=function(t){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==t||0===t.length)return this.$element.val();var n=t[0];e.isArray(n)&&(n=e.map(n,function(e){return e.toString()})),this.$element.val(n).trigger("change")},o.prototype.destroy=function(){this.$container.remove(),this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._syncA),null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&(this.$element[0].removeEventListener("DOMAttrModified",this._syncA,!1),this.$element[0].removeEventListener("DOMNodeInserted",this._syncS,!1),this.$element[0].removeEventListener("DOMNodeRemoved",this._syncS,!1)),this._syncA=null,this._syncS=null,this.$element.off(".select2"),this.$element.attr("tabindex",this.$element.data("old-tabindex")),this.$element.removeClass("select2-hidden-accessible"),this.$element.attr("aria-hidden","false"),this.$element.removeData("select2"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null},o.prototype.render=function(){var t=e('');return t.attr("dir",this.options.get("dir")),this.$container=t,this.$container.addClass("select2-container--"+this.options.get("theme")),t.data("element",this.$element),t},o}),t.define("select2/compat/utils",["jquery"],function(e){return{syncCssClasses:function(t,n,i){var o,r,s=[];(o=e.trim(t.attr("class")))&&e((o=""+o).split(/\s+/)).each(function(){0===this.indexOf("select2-")&&s.push(this)}),(o=e.trim(n.attr("class")))&&e((o=""+o).split(/\s+/)).each(function(){0!==this.indexOf("select2-")&&null!=(r=i(this))&&s.push(r)}),t.attr("class",s.join(" "))}}}),t.define("select2/compat/containerCss",["jquery","./utils"],function(e,t){function n(e){return null}function i(){}return i.prototype.render=function(i){var o=i.call(this),r=this.options.get("containerCssClass")||"";e.isFunction(r)&&(r=r(this.$element));var s=this.options.get("adaptContainerCssClass");if(s=s||n,-1!==r.indexOf(":all:")){r=r.replace(":all:","");var a=s;s=function(e){var t=a(e);return null!=t?t+" "+e:e}}var l=this.options.get("containerCss")||{};return e.isFunction(l)&&(l=l(this.$element)),t.syncCssClasses(o,this.$element,s),o.css(l),o.addClass(r),o},i}),t.define("select2/compat/dropdownCss",["jquery","./utils"],function(e,t){function n(e){return null}function i(){}return i.prototype.render=function(i){var o=i.call(this),r=this.options.get("dropdownCssClass")||"";e.isFunction(r)&&(r=r(this.$element));var s=this.options.get("adaptDropdownCssClass");if(s=s||n,-1!==r.indexOf(":all:")){r=r.replace(":all:","");var a=s;s=function(e){var t=a(e);return null!=t?t+" "+e:e}}var l=this.options.get("dropdownCss")||{};return e.isFunction(l)&&(l=l(this.$element)),t.syncCssClasses(o,this.$element,s),o.css(l),o.addClass(r),o},i}),t.define("select2/compat/initSelection",["jquery"],function(e){function t(e,t,n){n.get("debug")&&window.console&&console.warn&&console.warn("Select2: The `initSelection` option has been deprecated in favor of a custom data adapter that overrides the `current` method. This method is now called multiple times instead of a single time when the instance is initialized. Support will be removed for the `initSelection` option in future versions of Select2"),this.initSelection=n.get("initSelection"),this._isInitialized=!1,e.call(this,t,n)}return t.prototype.current=function(t,n){var i=this;this._isInitialized?t.call(this,n):this.initSelection.call(null,this.$element,function(t){i._isInitialized=!0,e.isArray(t)||(t=[t]),n(t)})},t}),t.define("select2/compat/inputData",["jquery"],function(e){function t(e,t,n){this._currentData=[],this._valueSeparator=n.get("valueSeparator")||",","hidden"===t.prop("type")&&n.get("debug")&&console&&console.warn&&console.warn("Select2: Using a hidden input with Select2 is no longer supported and may stop working in the future. It is recommended to use a `