(function($){ "use strict"; var kingster_mobile=false; if(navigator.userAgent.match(/Android/i)||navigator.userAgent.match(/webOS/i)||navigator.userAgent.match(/BlackBerry/i) || navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/iPod/i)||navigator.userAgent.match(/Windows Phone/i)){ kingster_mobile=true; }else{ kingster_mobile=false; } var kingster_display='desktop'; if(typeof(window.matchMedia)=='function'){ $(window).on('resize kingster-set-display', function(){ if(window.matchMedia('(max-width: 419px)').matches){ kingster_display='mobile-portrait'; }else if(window.matchMedia('(max-width: 767px)').matches){ kingster_display='mobile-landscape' }else if(window.matchMedia('(max-width: 959px)').matches){ kingster_display='tablet' }else{ kingster_display='desktop'; }}); $(window).trigger('kingster-set-display'); }else{ $(window).on('resize kingster-set-display', function(){ if($(window).innerWidth() <=419){ kingster_display='mobile-portrait'; }else if($(window).innerWidth() <=767){ kingster_display='mobile-landscape' }else if($(window).innerWidth() <=959){ kingster_display='tablet' }else{ kingster_display='desktop'; }}); $(window).trigger('kingster-set-display'); } var kingster_debounce=function(func, threshold, execAsap){ var timeout; return function debounced(){ var obj=this, args=arguments; function delayed(){ if(!execAsap){ func.apply(obj, args); } timeout=null; }; if(timeout){ clearTimeout(timeout); }else if(execAsap){ func.apply(obj, args); } timeout=setTimeout(delayed, threshold); };} var kingster_throttling=function(func, threshold){ var timeout; return function throttled(){ var obj=this, args=arguments; function delayed(){ func.apply(obj, args); timeout=null; }; if(!timeout){ timeout=setTimeout(delayed, threshold); }};} var kingster_sf_menu=function(menu){ if(menu.length==0) return; this.main_menu=menu; this.slide_bar=this.main_menu.children('.kingster-navigation-slide-bar'); this.slide_bar_val={ width: 0, left: 0 }; this.slide_bar_offset='2'; this.current_menu=this.main_menu.children('.sf-menu').children('.current-menu-item, .current-menu-ancestor').children('a'); this.init(); } kingster_sf_menu.prototype={ init: function(){ var t=this; t.sf_menu_mod(); if(typeof($.fn.superfish)=='function'){ t.main_menu.superfish({ delay: 400, speed: 'fast' }); t.sf_menu_position(); $(window).resize(kingster_debounce(function(){ t.sf_menu_position(); }, 300)); } if(t.slide_bar.length > 0){ t.init_slidebar(); }}, sf_menu_mod: function(){ this.main_menu.find('.sf-mega > ul').each(function(){ var mega_content=$('
'); var mega_row=$('
'); var mega_column_size=0; $(this).children('li').each(function(){ var column_size=parseInt($(this).attr('data-size')); if(mega_column_size + column_size <=60){ mega_column_size +=column_size; }else{ mega_column_size=column_size; mega_content.append(mega_row); mega_row=$('
'); } mega_row.append($('
') .addClass('kingster-column-' + column_size) .html($('
') .addClass($(this).attr('class')) .attr('id', $(this).attr('id')) .html($(this).html()) ) ); }); mega_content.append(mega_row); $(this).replaceWith(mega_content.html()); }); }, sf_menu_position: function(){ if(kingster_display=='mobile-landscape'||kingster_display=='mobile-portrait'||kingster_display=='tablet') return; var body_wrapper=$('.kingster-body-wrapper'); var sub_normal_menu=this.main_menu.find('.sf-menu > li.kingster-normal-menu .sub-menu'); sub_normal_menu.css({display: 'block'}).removeClass('sub-menu-right'); sub_normal_menu.each(function(){ if($(this).offset().left + $(this).width() > body_wrapper.outerWidth()){ $(this).addClass('sub-menu-right'); }}); sub_normal_menu.css({display: 'none'}); this.main_menu.find('.sf-menu > li.kingster-mega-menu .sf-mega').each(function(){ if(!$(this).hasClass('sf-mega-full')){ $(this).css({ display: 'block' }); $(this).css({ right: '', 'margin-left': -(($(this).width() - $(this).parent().outerWidth()) / 2) }); if($(this).offset().left + $(this).width() > $(window).width()){ $(this).css({ right: 0, 'margin-left': '' }); } $(this).css({ display: 'none' }); }}); }, init_slidebar: function(){ var t=this; t.init_slidebar_pos(); $(window).load(function(){ t.init_slidebar_pos(); }); if(!kingster_mobile){ t.main_menu.children('.sf-menu').children('li').on({ mouseenter: function(){ var nav_element=$(this).children('a'); if(nav_element.length > 0){ t.slide_bar.animate({ width: nav_element.outerWidth() + (2 * t.slide_bar_offset), left: nav_element.position().left - t.slide_bar_offset }, { queue: false, duration: 250 }); }}, mouseleave: function(){ t.slide_bar.animate({ width: t.slide_bar_val.width, left: t.slide_bar_val.left }, { queue: false, duration: 250 }); }}); } $(window).on('resize', function(){ t.init_slidebar_pos(); }); $(window).on('kingster-navigation-slider-bar-init', function(){ t.current_menu=t.main_menu.children('.sf-menu').children('.current-menu-item, .current-menu-ancestor').children('a'); t.animate_slidebar_pos(); }); $(window).on('kingster-navigation-slider-bar-animate', function(){ t.animate_slidebar_pos(); }); }, init_slidebar_pos: function(){ if(kingster_display=='mobile-landscape'||kingster_display=='mobile-portrait'||kingster_display=='tablet') return; var t=this; if(t.current_menu.length > 0){ t.slide_bar_val={ width: t.current_menu.outerWidth() + (2 * t.slide_bar_offset), left: t.current_menu.position().left - t.slide_bar_offset };}else{ t.slide_bar_val={ width: 0, left: t.main_menu.children('ul').children('li:first-child').position().left }} t.slide_bar.css({ width: t.slide_bar_val.width, left: t.slide_bar_val.left, display: 'block' }); }, animate_slidebar_pos: function(){ if(kingster_display=='mobile-landscape'||kingster_display=='mobile-portrait'||kingster_display=='tablet') return; var t=this; if(t.current_menu.length > 0){ t.slide_bar_val={ width: t.current_menu.outerWidth() + (2 * t.slide_bar_offset), left: t.current_menu.position().left - t.slide_bar_offset };}else{ t.slide_bar_val={ width: 0, left: t.main_menu.children('ul').children('li:first-child').position().left }} t.slide_bar.animate({ width: t.slide_bar_val.width, left: t.slide_bar_val.left }, { queue: false, duration: 250 }); }}; $.fn.kingster_mobile_menu=function(args){ var menu_button=$(this).siblings('.kingster-mm-menu-button'); var options={ navbar: { title: '' }, extensions: [ 'pagedim-black' ], }; var extensions={ offCanvas: { pageNodetype: '.kingster-body-outer-wrapper' }}; $(this).find('a[href="#"]').each(function(){ var content=$(this).html(); $('').html(content).insertBefore($(this)); $(this).remove(); }); if($(this).attr('data-slide')){ var html_class='kingster-mmenu-' + $(this).attr('data-slide'); $('html').addClass(html_class); options.offCanvas={ position:$(this).attr('data-slide') };} $(this).mmenu(options, extensions); var menu_api=$(this).data('mmenu'); $(this).find('a').not('.mm-next, .mm-prev').on('click', function(){ menu_api.close(); }); $(this).find('.mmenu-custom-close').on('click', function(){ menu_api.close(); }); menu_api.bind('open', function($panel){ menu_button.addClass('kingster-active'); }); menu_api.bind('close', function($panel){ menu_button.removeClass('kingster-active'); }); } var kingster_overlay_menu=function(menu){ this.menu=menu; this.menu_button=menu.children('.kingster-overlay-menu-icon'); this.menu_content=menu.children('.kingster-overlay-menu-content'); this.menu_close=this.menu_content.children('.kingster-overlay-menu-close'); this.init(); } kingster_overlay_menu.prototype={ init: function(){ var t=this; var delay_count=0; t.menu_content.appendTo('body'); t.menu_content.find('ul.menu > li').each(function(){ $(this).css('transition-delay', (delay_count * 150) + 'ms'); delay_count++; }); t.menu_button.on('click', function(){ $(this).addClass('kingster-active'); t.menu_content.fadeIn(200, function(){ $(this).addClass('kingster-active'); }); return false; }); t.menu_close.on('click', function(){ t.menu_button.removeClass('kingster-active'); t.menu_content.fadeOut(400, function(){ $(this).removeClass('kingster-active'); }); t.menu_content.find('.sub-menu').slideUp(200).removeClass('kingster-active'); return false; }); t.menu_content.find('a').on('click', function(e){ var sub_menu=$(this).siblings('.sub-menu'); if(sub_menu.length > 0){ if(!sub_menu.hasClass('kingster-active')){ var prev_active=sub_menu.closest('li').siblings().find('.sub-menu.kingster-active'); if(prev_active.length > 0){ prev_active.removeClass('kingster-active').slideUp(150); sub_menu.delay(150).slideDown(400, 'easeOutQuart').addClass('kingster-active'); }else{ sub_menu.slideDown(400, 'easeOutQuart').addClass('kingster-active'); } $(this).addClass('kingster-no-preload'); return false; }else{ $(this).removeClass('kingster-no-preload'); }}else{ t.menu_close.trigger('click'); }}); }}; var kingster_header_side_nav=function(side_nav){ if(side_nav.length==0) return; this.prev_scroll=0; this.side_nav=side_nav; this.side_nav_content=side_nav.children(); this.init(); } kingster_header_side_nav.prototype={ init: function(){ var t=this; t.init_nav_bar_element(); $(window).resize(function(){ t.init_nav_bar_element(); }); $(window).scroll(function(){ if(kingster_display=='mobile-landscape'||kingster_display=='mobile-portrait'||kingster_display=='tablet') return; if(t.side_nav.hasClass('kingster-allow-slide')){ var admin_bar_height=parseInt($('html').css('margin-top')); var scroll_down=($(window).scrollTop() > t.prev_scroll); t.prev_scroll=$(window).scrollTop(); if(scroll_down){ if(!t.side_nav.hasClass('kingster-fix-bottom')){ if(t.side_nav.hasClass('kingster-fix-top')){ t.side_nav.css('top', t.side_nav.offset().top); t.side_nav.removeClass('kingster-fix-top'); }else if($(window).height() + $(window).scrollTop() > t.side_nav_content.offset().top + t.side_nav_content.outerHeight()){ if(!t.side_nav.hasClass('kingster-fix-bottom')){ t.side_nav.addClass('kingster-fix-bottom'); t.side_nav.css('top', ''); }} }}else{ if(!t.side_nav.hasClass('kingster-fix-top')){ if(t.side_nav.hasClass('kingster-fix-bottom')){ var top_pos=$(window).scrollTop() + ($(window).height() - admin_bar_height) - t.side_nav_content.outerHeight(); t.side_nav.css('top', top_pos); t.side_nav.removeClass('kingster-fix-bottom'); }else if($(window).scrollTop() + admin_bar_height < t.side_nav_content.offset().top){ if(!t.side_nav.hasClass('kingster-fix-top')){ t.side_nav.addClass('kingster-fix-top'); t.side_nav.css('top', ''); }} }} }}); }, init_nav_bar_element: function(){ if(kingster_display=='mobile-landscape'||kingster_display=='mobile-portrait'||kingster_display=='tablet') return; var t=this; var middle_pos=t.side_nav_content.children('.kingster-pos-middle').addClass('kingster-active'); var bottom_pos=t.side_nav_content.children('.kingster-pos-bottom').addClass('kingster-active'); t.side_nav_content.children('.kingster-pre-spaces').remove(); if($(window).height() < t.side_nav_content.height()){ t.side_nav.addClass('kingster-allow-slide'); }else{ t.side_nav.removeClass('kingster-allow-slide kingster-fix-top kingster-fix-bottom').css('top', ''); if(t.side_nav.hasClass('kingster-style-middle')){ middle_pos.each(function(){ var top_padding=parseInt($(this).css('padding-top')); var prespace=((t.side_nav.height() - (t.side_nav_content.height() - top_padding)) / 2) - top_padding; if(prespace > 0){ $('
').css('height', prespace).insertBefore($(this)); }}); } bottom_pos.each(function(){ var prespace=t.side_nav.height() - t.side_nav_content.height(); if(prespace > 0){ $('
').css('height', prespace).insertBefore($(this)); }}); }} }; var kingster_anchor=function(){ this.anchor_link=$('a[href*="#"]').not('[href="#"]').filter(function(){ if($(this).is('.kingster-mm-menu-button, .mm-next, .mm-prev, .mm-title, .gdlr-core-ilightbox')){ return false; } if($(this).is('.fbx-btn-transition')){ return false; } if($(this).parent('.description_tab, .reviews_tab').length||$(this).not('[class^="kingster"]').closest('.woocommerce').length){ return false; } return true; }); if(this.anchor_link.length){ this.menu_anchor=$('#kingster-main-menu, #kingster-bullet-anchor'); this.home_anchor=this.menu_anchor.find('ul.sf-menu > li.current-menu-item > a, ul.sf-menu > li.current-menu-ancestor > a, .kingster-bullet-anchor-link.current-menu-item'); this.init(); }} kingster_anchor.prototype={ init: function(){ var t=this; t.animate_anchor(); t.scroll_section(); t.menu_anchor.filter('#kingster-bullet-anchor').each(function(){ $(this).css('margin-top', - t.menu_anchor.height() / 2).addClass('kingster-init'); }); var url_hash=window.location.hash; if(url_hash){ setTimeout(function(){ var current_menu=t.menu_anchor.find('a[href*="' + url_hash + '"]'); if(!current_menu.is('.current-menu-item, .current-menu-ancestor')){ current_menu.addClass('current-menu-item').siblings().removeClass('current-menu-item current-menu-ancestor'); $(window).trigger('kingster-navigation-slider-bar-init'); } t.scroll_to(url_hash, false, 300); }, 500); }}, animate_anchor: function(){ var t=this; t.home_anchor.on('click', function(){ if(window.location.href==this.href){ $('html, body').animate({ scrollTop: 0 }, { duration: 1500, easing: 'easeOutQuart' }); return false; }}); t.anchor_link.on('click', function(){ if(location.hostname==this.hostname&&location.pathname.replace(/^\//,'')==this.pathname.replace(/^\//,'')){ return t.scroll_to(this.hash, true); }}); }, scroll_to: function(hash, redirect, duration){ if(hash=='#kingster-top-anchor'){ var scroll_position=0; }else{ var target=$(hash); if(target.length){ var scroll_position=target.offset().top; }} if(typeof(scroll_position)!='undefined'){ scroll_position=scroll_position - parseInt($('html').css('margin-top')); if(kingster_display=='mobile-portrait'||kingster_display=='mobile-landscape'){ scroll_position=scroll_position - 75; }else if(typeof(window.kingster_anchor_offset)!='undefined'){ scroll_position=scroll_position - parseInt(window.kingster_anchor_offset); } if(scroll_position < 0) scroll_position=0; $('html, body').animate({ scrollTop: scroll_position }, { duration: 1500, easing: 'easeOutQuart', queue: false }); return false; }else if(redirect){ window.location.href=kingster_script_core.home_url + hash; return false; }}, scroll_section: function(){ var t=this; var menu_link_anchor=this.menu_anchor.find('a[href*="#"]').not('[href="#"]'); if(!menu_link_anchor.length){ return; } var home_anchor_section=$('#kingster-page-wrapper'); var anchor_section=home_anchor_section.find('div[id], section[id]'); if(!anchor_section.length){ return; } menu_link_anchor.each(function(){ if($(this).closest('.sub-menu').length==0&&$(this.hash).length){ $(this).attr('data-anchor', this.hash); }}); $(window).scroll(function(){ if(kingster_display=='mobile-landscape'||kingster_display=='mobile-portrait'||kingster_display=='tablet') return; if(t.home_anchor.length&&$(window).scrollTop() <=home_anchor_section.offset().top){ t.home_anchor.each(function(){ if($(this).hasClass('kingster-bullet-anchor-link')){ $(this).addClass('current-menu-item').siblings().removeClass('current-menu-item'); $(this).parent('.kingster-bullet-anchor').attr('data-anchor-section', 'kingster-home'); }else if(!$(this).parent('.current-menu-item, .current-menu-ancestor').length){ $(this).parent().addClass('current-menu-item').siblings().removeClass('current-menu-item current-menu-ancestor'); $(window).trigger('kingster-navigation-slider-bar-init'); }}); }else{ var section_position=$(window).scrollTop() + ($(window).height() / 2); anchor_section.each(function(){ if($(this).css('display')=='none') return; var top_offset_pos=$(this).offset().top; if((section_position > top_offset_pos)&&(section_position < top_offset_pos + $(this).outerHeight())){ var section_id=$(this).attr('id'); menu_link_anchor.filter('[data-anchor="#' + section_id + '"]').each(function(){ if($(this).hasClass('kingster-bullet-anchor-link')){ $(this).addClass('current-menu-item').siblings().removeClass('current-menu-item'); $(this).parent('.kingster-bullet-anchor').attr('data-anchor-section', section_id); }else if($(this).parent('li.menu-item').length&&!$(this).parent('li.menu-item').is('.current-menu-item, .current-menu-ancestor')){ $(this).parent('li.menu-item').addClass('current-menu-item').siblings().removeClass('current-menu-item current-menu-ancestor'); $(window).trigger('kingster-navigation-slider-bar-init'); }}); return false; }}); }}); }}; var kingster_sticky_navigation=function(){ var t=this; t.sticky_nav=$('.kingster-with-sticky-navigation .kingster-sticky-navigation'); t.mobile_menu=$('#kingster-mobile-header'); if(t.sticky_nav.hasClass('kingster-sticky-navigation-height')){ window.kingster_anchor_offset=t.sticky_nav.outerHeight(); $(window).resize(function(){ window.kingster_anchor_offset=t.sticky_nav.outerHeight(); }); }else if(t.sticky_nav.attr('data-navigation-offset')){ window.kingster_anchor_offset=parseInt(t.sticky_nav.attr('data-navigation-offset')); }else if(t.sticky_nav.length){ window.kingster_anchor_offset=75; } if(t.sticky_nav.length){ t.init(); } if(t.mobile_menu.hasClass('kingster-sticky-mobile-navigation')){ t.style_mobile_slide(); $(window).trigger('kingster-set-sticky-mobile-navigation'); }} kingster_sticky_navigation.prototype={ init: function(){ var t=this; if(t.sticky_nav.hasClass('kingster-style-fixed')){ t.style_fixed(); }else if(t.sticky_nav.hasClass('kingster-style-slide')){ t.style_slide(); } $(window).trigger('kingster-set-sticky-navigation'); }, style_fixed: function(){ var t=this; var placeholder=$('
'); $(window).on('scroll kingster-set-sticky-navigation', function(){ if(kingster_display=='mobile-landscape'||kingster_display=='mobile-portrait'||kingster_display=='tablet') return; var page_offset=parseInt($('html').css('margin-top')); if(!t.sticky_nav.hasClass('kingster-fixed-navigation')){ if($(window).scrollTop() + page_offset > t.sticky_nav.offset().top){ if(!t.sticky_nav.hasClass('kingster-without-placeholder')){ placeholder.height(t.sticky_nav.outerHeight()); } placeholder.insertAfter(t.sticky_nav); $('body').append(t.sticky_nav); t.sticky_nav.addClass('kingster-fixed-navigation'); setTimeout(function(){ t.sticky_nav.addClass('kingster-animate-fixed-navigation'); }, 10); setTimeout(function(){ t.sticky_nav.css('height', ''); $(window).trigger('kingster-navigation-slider-bar-animate'); }, 200); }}else{ if($(window).scrollTop() + page_offset <=placeholder.offset().top){ if(!t.sticky_nav.hasClass('kingster-without-placeholder')){ t.sticky_nav.height(placeholder.height()); } t.sticky_nav.insertBefore(placeholder); t.sticky_nav.removeClass('kingster-fixed-navigation'); placeholder.remove(); setTimeout(function(){ t.sticky_nav.removeClass('kingster-animate-fixed-navigation'); }, 10); setTimeout(function(){ t.sticky_nav.css('height', ''); $(window).trigger('kingster-navigation-slider-bar-animate'); }, 200); }} }); }, style_slide: function(){ var t=this; var placeholder=$('
'); $(window).on('scroll kingster-set-sticky-navigation', function(){ if(kingster_display=='mobile-landscape'||kingster_display=='mobile-portrait'||kingster_display=='tablet'){ return; } var page_offset=parseInt($('html').css('margin-top')); if(!t.sticky_nav.hasClass('kingster-fixed-navigation')){ if($(window).scrollTop() + page_offset > t.sticky_nav.offset().top + t.sticky_nav.outerHeight() + 200){ if(!t.sticky_nav.hasClass('kingster-without-placeholder')){ placeholder.height(t.sticky_nav.outerHeight()); } placeholder.insertAfter(t.sticky_nav); t.sticky_nav.css('display', 'none'); $('body').append(t.sticky_nav); t.sticky_nav.addClass('kingster-fixed-navigation kingster-animate-fixed-navigation'); t.sticky_nav.slideDown(200); $(window).trigger('kingster-navigation-slider-bar-animate'); }}else{ if($(window).scrollTop() + page_offset <=placeholder.offset().top + placeholder.height() + 200){ var clone=t.sticky_nav.clone(); clone.insertAfter(t.sticky_nav); clone.slideUp(200, function(){ $(this).remove(); }); t.sticky_nav.insertBefore(placeholder); placeholder.remove(); t.sticky_nav.removeClass('kingster-fixed-navigation kingster-animate-fixed-navigation'); t.sticky_nav.css('display', 'block'); $(window).trigger('kingster-navigation-slider-bar-animate'); }} }); }, style_mobile_slide: function(){ var t=this; var placeholder=$('
'); $(window).on('scroll kingster-set-sticky-mobile-navigation', function(){ if(kingster_display=='mobile-landscape'||kingster_display=='mobile-portrait'||kingster_display=='tablet'){ var page_offset=parseInt($('html').css('margin-top')); if(!t.mobile_menu.hasClass('kingster-fixed-navigation')){ if($(window).scrollTop() + page_offset > t.mobile_menu.offset().top + t.mobile_menu.outerHeight() + 200){ placeholder.height(t.mobile_menu.outerHeight()).insertAfter(t.mobile_menu); $('body').append(t.mobile_menu); t.mobile_menu.addClass('kingster-fixed-navigation'); t.mobile_menu.css('display', 'none').slideDown(200); }}else{ if($(window).scrollTop() + page_offset <=placeholder.offset().top + placeholder.height() + 200){ var clone=t.mobile_menu.clone(); clone.insertAfter(t.mobile_menu); clone.slideUp(200, function(){ $(this).remove(); }); t.mobile_menu.insertBefore(placeholder); placeholder.remove(); t.mobile_menu.removeClass('kingster-fixed-navigation'); t.mobile_menu.css('display', 'block'); }} }}); }, }; var kingster_font_resize=function(){ this.heading_font=$('h1, h2, h3, h4, h5, h6'); this.init(); } kingster_font_resize.prototype={ init: function(){ var t=this; t.resize(); $(window).on('resize', kingster_throttling(function(){ t.resize(); }, 100)); }, resize: function(){ var t=this; if(kingster_display=='mobile-landscape'||kingster_display=='mobile-portrait'){ t.heading_font.each(function(){ if(parseInt($(this).css('font-size')) > 40){ if(!$(this).attr('data-orig-font')){ $(this).attr('data-orig-font', $(this).css('font-size')); } $(this).css('font-size', '40px'); }}); }else{ t.heading_font.filter('[data-orig-font]').each(function(){ $(this).css('font-size', $(this).attr('data-orig-font')); }); }} }; $.fn.kingster_tab=function(){ var elem=$(this); elem.find('.gdlr-core-tab-item-title').on('click', function(){ var tab_id=$(this).attr('data-tab-id'); var tab_item_wrap=$(this).closest('.gdlr-core-tab-item-wrap'); tab_item_wrap.siblings('.gdlr-core-tab-item-content-image-wrap').each(function(){ var active_tab=$(this).children('[data-tab-id="' + tab_id + '"]'); if(active_tab.length){ $(this).css('width', ''); $(this).css('height', tab_item_wrap.outerHeight()); active_tab.siblings().removeClass('gdlr-core-active'); active_tab.addClass('gdlr-core-active'); }else{ $(this).css('width', '0px'); $(this).children().removeClass('gdlr-core-active'); }}); }); elem.find('.gdlr-core-tab-item-content-image-wrap').css('height', $(this).find('.gdlr-core-tab-item-wrap').outerHeight()); $(window).on('load resize', function(){ elem.find('.gdlr-core-tab-item-content-image-wrap').css('height', elem.find('.gdlr-core-tab-item-wrap').outerHeight()); }); } $(document).ready(function(){ new kingster_font_resize(); $('#kingster-main-menu, #kingster-right-menu, #kingster-mobile-menu, #kingster-top-bar-menu').each(function(){ if($(this).hasClass('kingster-overlay-menu')){ new kingster_overlay_menu($(this)); }else if($(this).hasClass('kingster-mm-menu-wrap')){ $(this).kingster_mobile_menu(); }else{ new kingster_sf_menu($(this)); }}); $('#kingster-top-search, #kingster-mobile-top-search').each(function(){ var search_wrap=$(this).siblings('.kingster-top-search-wrap'); search_wrap.appendTo('body'); $(this).on('click', function(){ search_wrap.fadeIn(200, function(){ $(this).addClass('kingster-active'); }); }); search_wrap.find('.kingster-top-search-close').on('click', function(){ search_wrap.fadeOut(200, function(){ $(this).addClass('kingster-active'); }); }); search_wrap.find('.search-submit').on('click', function(){ if(search_wrap.find('.search-field').val().length==0){ return false; }}); }); $('#kingster-main-menu-cart, #kingster-mobile-menu-cart').each(function(){ $(this).on({ mouseenter: function(){ $(this).addClass('kingster-active kingster-animating'); }, mouseleave: function(){ var menu_cart=$(this); menu_cart.removeClass('kingster-active'); setTimeout(function(){ menu_cart.removeClass('kingster-animating'); }, 400) }}); }); $('.kingster-header-boxed-wrap, .kingster-header-background-transparent, .kingster-navigation-bar-wrap.kingster-style-transparent').each(function(){ var header_transparent=$(this); var header_transparent_sub=$('.kingster-header-transparent-substitute'); header_transparent_sub.height(header_transparent.outerHeight()); $(window).on('load resize', function(){ header_transparent_sub.height(header_transparent.outerHeight()); }); }); $('body.error404, body.search-no-results').each(function(){ var wrap=$(this).find('#kingster-full-no-header-wrap'); var body_wrap_offset=parseInt($(this).children('.kingster-body-outer-wrapper').children('.kingster-body-wrapper').css('margin-bottom')); var padding=($(window).height() - wrap.offset().top - wrap.outerHeight() - body_wrap_offset) / 2; if(padding > 0){ wrap.css({ 'padding-top': padding, 'padding-bottom': padding }); } $(window).on('load resize', function(){ wrap.css({ 'padding-top': 0, 'padding-bottom': 0 }); padding=($(window).height() - wrap.offset().top - wrap.outerHeight() - body_wrap_offset) / 2; if(padding > 0){ wrap.css({ 'padding-top': padding, 'padding-bottom': padding }); }}); }); var back_to_top=$('#kingster-footer-back-to-top-button'); if(back_to_top.length){ $(window).on('scroll', function(){ if($(window).scrollTop() > 300){ back_to_top.addClass('kingster-scrolled'); }else{ back_to_top.removeClass('kingster-scrolled'); }}); } $('body').children('#kingster-page-preload').each(function(){ var page_preload=$(this); var animation_time=parseInt(page_preload.attr('data-animation-time')); $('a[href]').not('[href^="#"], [target="_blank"], .gdlr-core-js, .strip, .sf-with-ul, .remove, .ajax_add_to_cart').on('click', function(e){ if(e.which!=1||$(this).hasClass('kingster-no-preload')||e.ctrlKey) return; if($(this).closest('.tribe-events-nav-pagination').length) return; if(window.location.href!=this.href){ page_preload.addClass('kingster-out').fadeIn(animation_time); }}); $(window).load(function(){ page_preload.fadeOut(animation_time); }); }); $('body.kingster-blog-style-2 .kingster-single-nav-area').each(function(){ var max_height; var single_nav_2=$(this).children(); max_height=0; single_nav_2.css('min-height', '0px'); single_nav_2.each(function(){ if(max_height < $(this).outerHeight()){ max_height=$(this).outerHeight(); }}); single_nav_2.css('min-height', max_height); $(window).resize(function(){ max_height=0; single_nav_2.css('min-height', '0px'); single_nav_2.each(function(){ if(max_height < $(this).outerHeight()){ max_height=$(this).outerHeight(); }}); single_nav_2.css('min-height', max_height); }); }); $('.gdlr-core-tab-item').kingster_tab(); }); $(window).on('pageshow', function(event){ if(event.originalEvent.persisted){ $('body').children('#kingster-page-preload').each(function(){ $(this).fadeOut(400); }); }}); $(window).load(function(){ $('#kingster-fixed-footer').each(function(){ var fixed_footer=$(this); var placeholder=$(''); placeholder.insertBefore(fixed_footer); placeholder.height(fixed_footer.outerHeight()); $('body').css('min-height', $(window).height() - parseInt($('html').css('margin-top'))); $(window).resize(function(){ placeholder.height(fixed_footer.outerHeight()); $('body').css('min-height', $(window).height() - parseInt($('html').css('margin-top'))); }); }); new kingster_header_side_nav($('#kingster-header-side-nav')); new kingster_sticky_navigation(); new kingster_anchor(); }); })(jQuery); !function(e){function t(){e[n].glbl||(r={$wndw:e(window),$docu:e(document),$html:e("html"),$body:e("body")},i={},a={},o={},e.each([i,a,o],function(e,t){t.add=function(e){e=e.split(" ");for(var n=0,s=e.length;s>n;n++)t[e[n]]=t.mm(e[n])}}),i.mm=function(e){return"mm-"+e},i.add("wrapper menu panels panel nopanel current highest opened subopened navbar hasnavbar title btn prev next listview nolistview inset vertical selected divider spacer hidden fullsubopen"),i.umm=function(e){return"mm-"==e.slice(0,3)&&(e=e.slice(3)),e},a.mm=function(e){return"mm-"+e},a.add("parent sub"),o.mm=function(e){return e+".mm"},o.add("transitionend webkitTransitionEnd click scroll keydown mousedown mouseup touchstart touchmove touchend orientationchange"),e[n]._c=i,e[n]._d=a,e[n]._e=o,e[n].glbl=r)}var n="mmenu",s="5.6.1";if(!(e[n]&&e[n].version>s)){e[n]=function(e,t,n){this.$menu=e,this._api=["bind","init","update","setSelected","getInstance","openPanel","closePanel","closeAllPanels"],this.opts=t,this.conf=n,this.vars={},this.cbck={},"function"==typeof this.___deprecated&&this.___deprecated(),this._initMenu(),this._initAnchors();var s=this.$pnls.children();return this._initAddons(),this.init(s),"function"==typeof this.___debug&&this.___debug(),this},e[n].version=s,e[n].addons={},e[n].uniqueId=0,e[n].defaults={extensions:[],navbar:{add:!0,title:"Menu",titleLink:"panel"},onClick:{setSelected:!0},slidingSubmenus:!0},e[n].configuration={classNames:{divider:"Divider",inset:"Inset",panel:"Panel",selected:"Selected",spacer:"Spacer",vertical:"Vertical"},clone:!1,openingInterval:25,panelNodetype:"ul, ol, div",transitionDuration:400},e[n].prototype={init:function(e){e=e.not("."+i.nopanel),e=this._initPanels(e),this.trigger("init",e),this.trigger("update")},update:function(){this.trigger("update")},setSelected:function(e){this.$menu.find("."+i.listview).children().removeClass(i.selected),e.addClass(i.selected),this.trigger("setSelected",e)},openPanel:function(t){var s=t.parent(),a=this;if(s.hasClass(i.vertical)){var o=s.parents("."+i.subopened);if(o.length)return void this.openPanel(o.first());s.addClass(i.opened),this.trigger("openPanel",t),this.trigger("openingPanel",t),this.trigger("openedPanel",t)}else{if(t.hasClass(i.current))return;var r=this.$pnls.children("."+i.panel),l=r.filter("."+i.current);r.removeClass(i.highest).removeClass(i.current).not(t).not(l).not("."+i.vertical).addClass(i.hidden),e[n].support.csstransitions||l.addClass(i.hidden),t.hasClass(i.opened)?t.nextAll("."+i.opened).addClass(i.highest).removeClass(i.opened).removeClass(i.subopened):(t.addClass(i.highest),l.addClass(i.subopened)),t.removeClass(i.hidden).addClass(i.current),a.trigger("openPanel",t),setTimeout(function(){t.removeClass(i.subopened).addClass(i.opened),a.trigger("openingPanel",t),a.__transitionend(t,function(){a.trigger("openedPanel",t)},a.conf.transitionDuration)},this.conf.openingInterval)}},closePanel:function(e){var t=e.parent();t.hasClass(i.vertical)&&(t.removeClass(i.opened),this.trigger("closePanel",e),this.trigger("closingPanel",e),this.trigger("closedPanel",e))},closeAllPanels:function(){this.$menu.find("."+i.listview).children().removeClass(i.selected).filter("."+i.vertical).removeClass(i.opened);var e=this.$pnls.children("."+i.panel),t=e.first();this.$pnls.children("."+i.panel).not(t).removeClass(i.subopened).removeClass(i.opened).removeClass(i.current).removeClass(i.highest).addClass(i.hidden),this.openPanel(t)},togglePanel:function(e){var t=e.parent();t.hasClass(i.vertical)&&this[t.hasClass(i.opened)?"closePanel":"openPanel"](e)},getInstance:function(){return this},bind:function(e,t){this.cbck[e]=this.cbck[e]||[],this.cbck[e].push(t)},trigger:function(){var e=this,t=Array.prototype.slice.call(arguments),n=t.shift();if(this.cbck[n])for(var s=0,i=this.cbck[n].length;i>s;s++)this.cbck[n][s].apply(e,t)},_initMenu:function(){this.$menu.attr("id",this.$menu.attr("id")||this.__getUniqueId()),this.conf.clone&&(this.$menu=this.$menu.clone(!0),this.$menu.add(this.$menu.find("[id]")).filter("[id]").each(function(){e(this).attr("id",i.mm(e(this).attr("id")))})),this.$menu.contents().each(function(){3==e(this)[0].nodeType&&e(this).remove()}),this.$pnls=e('
').append(this.$menu.children(this.conf.panelNodetype)).prependTo(this.$menu),this.$menu.parent().addClass(i.wrapper);var t=[i.menu];this.opts.slidingSubmenus||t.push(i.vertical),this.opts.extensions=this.opts.extensions.length?"mm-"+this.opts.extensions.join(" mm-"):"",this.opts.extensions&&t.push(this.opts.extensions),this.$menu.addClass(t.join(" "))},_initPanels:function(t){var n=this,s=this.__findAddBack(t,"ul, ol");this.__refactorClass(s,this.conf.classNames.inset,"inset").addClass(i.nolistview+" "+i.nopanel),s.not("."+i.nolistview).addClass(i.listview);var o=this.__findAddBack(t,"."+i.listview).children();this.__refactorClass(o,this.conf.classNames.selected,"selected"),this.__refactorClass(o,this.conf.classNames.divider,"divider"),this.__refactorClass(o,this.conf.classNames.spacer,"spacer"),this.__refactorClass(this.__findAddBack(t,"."+this.conf.classNames.panel),this.conf.classNames.panel,"panel");var r=e(),l=t.add(t.find("."+i.panel)).add(this.__findAddBack(t,"."+i.listview).children().children(this.conf.panelNodetype)).not("."+i.nopanel);this.__refactorClass(l,this.conf.classNames.vertical,"vertical"),this.opts.slidingSubmenus||l.addClass(i.vertical),l.each(function(){var t=e(this),s=t;t.is("ul, ol")?(t.wrap('
'),s=t.parent()):s.addClass(i.panel);var a=t.attr("id");t.removeAttr("id"),s.attr("id",a||n.__getUniqueId()),t.hasClass(i.vertical)&&(t.removeClass(n.conf.classNames.vertical),s.add(s.parent()).addClass(i.vertical)),r=r.add(s)});var d=e("."+i.panel,this.$menu);r.each(function(t){var s,o,r=e(this),l=r.parent(),d=l.children("a, span").first();if(l.is("."+i.panels)||(l.data(a.sub,r),r.data(a.parent,l)),l.children("."+i.next).length||l.parent().is("."+i.listview)&&(s=r.attr("id"),o=e('').insertBefore(d),d.is("span")&&o.addClass(i.fullsubopen)),!r.children("."+i.navbar).length&&!l.hasClass(i.vertical)){l.parent().is("."+i.listview)?l=l.closest("."+i.panel):(d=l.closest("."+i.panel).find('a[href="#'+r.attr("id")+'"]').first(),l=d.closest("."+i.panel));var c=e('
');if(l.length){switch(s=l.attr("id"),n.opts.navbar.titleLink){case"anchor":_url=d.attr("href");break;case"panel":case"parent":_url="#"+s;break;default:_url=!1}c.append('').append(e('").text(d.text())).prependTo(r),n.opts.navbar.add&&r.addClass(i.hasnavbar)}else n.opts.navbar.title&&(c.append(''+n.opts.navbar.title+"").prependTo(r),n.opts.navbar.add&&r.addClass(i.hasnavbar))}});var c=this.__findAddBack(t,"."+i.listview).children("."+i.selected).removeClass(i.selected).last().addClass(i.selected);c.add(c.parentsUntil("."+i.menu,"li")).filter("."+i.vertical).addClass(i.opened).end().each(function(){e(this).parentsUntil("."+i.menu,"."+i.panel).not("."+i.vertical).first().addClass(i.opened).parentsUntil("."+i.menu,"."+i.panel).not("."+i.vertical).first().addClass(i.opened).addClass(i.subopened)}),c.children("."+i.panel).not("."+i.vertical).addClass(i.opened).parentsUntil("."+i.menu,"."+i.panel).not("."+i.vertical).first().addClass(i.opened).addClass(i.subopened);var p=d.filter("."+i.opened);return p.length||(p=r.first()),p.addClass(i.opened).last().addClass(i.current),r.not("."+i.vertical).not(p.last()).addClass(i.hidden).end().filter(function(){return!e(this).parent().hasClass(i.panels)}).appendTo(this.$pnls),r},_initAnchors:function(){var t=this;r.$body.on(o.click+"-oncanvas","a[href]",function(s){var a=e(this),o=!1,r=t.$menu.find(a).length;for(var l in e[n].addons)if(e[n].addons[l].clickAnchor.call(t,a,r)){o=!0;break}var d=a.attr("href");if(!o&&r&&d.length>1&&"#"==d.slice(0,1))try{var c=e(d,t.$menu);c.is("."+i.panel)&&(o=!0,t[a.parent().hasClass(i.vertical)?"togglePanel":"openPanel"](c))}catch(p){}if(o&&s.preventDefault(),!o&&r&&a.is("."+i.listview+" > li > a")&&!a.is('[rel="external"]')&&!a.is('[target="_blank"]')){t.__valueOrFn(t.opts.onClick.setSelected,a)&&t.setSelected(e(s.target).parent());var h=t.__valueOrFn(t.opts.onClick.preventDefault,a,"#"==d.slice(0,1));h&&s.preventDefault(),t.__valueOrFn(t.opts.onClick.close,a,h)&&t.close()}})},_initAddons:function(){var t;for(t in e[n].addons)e[n].addons[t].add.call(this),e[n].addons[t].add=function(){};for(t in e[n].addons)e[n].addons[t].setup.call(this)},_getOriginalMenuId:function(){var e=this.$menu.attr("id");return e&&e.length&&this.conf.clone&&(e=i.umm(e)),e},__api:function(){var t=this,n={};return e.each(this._api,function(e){var s=this;n[s]=function(){var e=t[s].apply(t,arguments);return"undefined"==typeof e?n:e}}),n},__valueOrFn:function(e,t,n){return"function"==typeof e?e.call(t[0]):"undefined"==typeof e&&"undefined"!=typeof n?n:e},__refactorClass:function(e,t,n){return e.filter("."+t).removeClass(t).addClass(i[n])},__findAddBack:function(e,t){return e.find(t).add(e.filter(t))},__filterListItems:function(e){return e.not("."+i.divider).not("."+i.hidden)},__transitionend:function(e,t,n){var s=!1,i=function(){s||t.call(e[0]),s=!0};e.one(o.transitionend,i),e.one(o.webkitTransitionEnd,i),setTimeout(i,1.1*n)},__getUniqueId:function(){return i.mm(e[n].uniqueId++)}},e.fn[n]=function(s,i){return t(),s=e.extend(!0,{},e[n].defaults,s),i=e.extend(!0,{},e[n].configuration,i),this.each(function(){var t=e(this);if(!t.data(n)){var a=new e[n](t,s,i);a.$menu.data(n,a.__api())}})},e[n].support={touch:"ontouchstart"in window||navigator.msMaxTouchPoints||!1,csstransitions:function(){if("undefined"!=typeof Modernizr&&"undefined"!=typeof Modernizr.csstransitions)return Modernizr.csstransitions;var e=document.body||document.documentElement,t=e.style,n="transition";if("string"==typeof t[n])return!0;var s=["Moz","webkit","Webkit","Khtml","O","ms"];n=n.charAt(0).toUpperCase()+n.substr(1);for(var i=0;i1&&a.wrapPageIfNeeded&&(t=t.wrapAll("<"+this.conf[n].pageNodetype+" />").parent())),t.each(function(){e(this).attr("id",e(this).attr("id")||i.__getUniqueId())}),t.addClass(s.page+" "+s.slideout),o.$page=t,this.trigger("setPage",t)},e[t].prototype["_initWindow_"+n]=function(){o.$wndw.off(a.keydown+"-"+n).on(a.keydown+"-"+n,function(e){return o.$html.hasClass(s.opened)&&9==e.keyCode?(e.preventDefault(),!1):void 0});var e=0;o.$wndw.off(a.resize+"-"+n).on(a.resize+"-"+n,function(t,n){if(1==o.$page.length&&(n||o.$html.hasClass(s.opened))){var i=o.$wndw.height();(n||i!=e)&&(e=i,o.$page.css("minHeight",i))}})},e[t].prototype._initBlocker=function(){var t=this;this.opts[n].blockUI&&(o.$blck||(o.$blck=e('
')),o.$blck.appendTo(o.$body).off(a.touchstart+"-"+n+" "+a.touchmove+"-"+n).on(a.touchstart+"-"+n+" "+a.touchmove+"-"+n,function(e){e.preventDefault(),e.stopPropagation(),o.$blck.trigger(a.mousedown+"-"+n)}).off(a.mousedown+"-"+n).on(a.mousedown+"-"+n,function(e){e.preventDefault(),o.$html.hasClass(s.modal)||(t.closeAllOthers(),t.close())}))};var s,i,a,o}(jQuery), function(e){var t="mmenu",n="scrollBugFix";e[t].addons[n]={setup:function(){var i=this,r=this.opts[n];this.conf[n];if(o=e[t].glbl,e[t].support.touch&&this.opts.offCanvas&&this.opts.offCanvas.modal&&("boolean"==typeof r&&(r={fix:r}),"object"!=typeof r&&(r={}),r=this.opts[n]=e.extend(!0,{},e[t].defaults[n],r),r.fix)){var l=this.$menu.attr("id"),d=!1;this.bind("opening",function(){this.$pnls.children("."+s.current).scrollTop(0)}),o.$docu.on(a.touchmove,function(e){i.vars.opened&&e.preventDefault()}),o.$body.on(a.touchstart,"#"+l+"> ."+s.panels+"> ."+s.current,function(e){i.vars.opened&&(d||(d=!0,0===e.currentTarget.scrollTop?e.currentTarget.scrollTop=1:e.currentTarget.scrollHeight===e.currentTarget.scrollTop+e.currentTarget.offsetHeight&&(e.currentTarget.scrollTop-=1),d=!1))}).on(a.touchmove,"#"+l+"> ."+s.panels+"> ."+s.current,function(t){i.vars.opened&&e(this)[0].scrollHeight>e(this).innerHeight()&&t.stopPropagation()}),o.$wndw.on(a.orientationchange,function(){i.$pnls.children("."+s.current).scrollTop(0).css({"-webkit-overflow-scrolling":"auto"}).css({"-webkit-overflow-scrolling":"touch"})})}},add:function(){s=e[t]._c,i=e[t]._d,a=e[t]._e},clickAnchor:function(e,t){}},e[t].defaults[n]={fix:!0};var s,i,a,o}(jQuery); !function(e,s){"use strict";var o=function(){var o={bcClass:"sf-breadcrumb",menuClass:"sf-js-enabled",anchorClass:"sf-with-ul",menuArrowClass:"sf-arrows"},t=function(){var s=/^(?![\w\W]*Windows Phone)[\w\W]*(iPhone|iPad|iPod)/i.test(navigator.userAgent);return s&&e("html").css("cursor","pointer").on("click",e.noop),s}(),n=function(){var e=document.documentElement.style;return"behavior"in e&&"fill"in e&&/iemobile/i.test(navigator.userAgent)}(),i=function(){return!!s.PointerEvent}(),r=function(e,s){var t=o.menuClass;s.cssArrows&&(t+=" "+o.menuArrowClass),e.toggleClass(t)},a=function(s,t){return s.find("li."+t.pathClass).slice(0,t.pathLevels).addClass(t.hoverClass+" "+o.bcClass).filter(function(){return e(this).children(t.popUpSelector).hide().show().length}).removeClass(t.pathClass)},l=function(e){e.children("a").toggleClass(o.anchorClass)},h=function(e){var s=e.css("ms-touch-action"),o=e.css("touch-action");o=o||s,o="pan-y"===o?"auto":"pan-y",e.css({"ms-touch-action":o,"touch-action":o})},u=function(s,o){var r="li:has("+o.popUpSelector+")";e.fn.hoverIntent&&!o.disableHI?s.hoverIntent(c,f,r):s.on("mouseenter.superfish",r,c).on("mouseleave.superfish",r,f);var a="MSPointerDown.superfish";i&&(a="pointerdown.superfish"),t||(a+=" touchend.superfish"),n&&(a+=" mousedown.superfish"),s.on("focusin.superfish","li",c).on("focusout.superfish","li",f).on(a,"a",o,p)},p=function(s){var o=e(this),t=m(o),n=o.siblings(s.data.popUpSelector);return t.onHandleTouch.call(n)===!1?this:void(n.length>0&&n.is(":hidden")&&(o.one("click.superfish",!1),"MSPointerDown"===s.type||"pointerdown"===s.type?o.trigger("focus"):e.proxy(c,o.parent("li"))()))},c=function(){var s=e(this),o=m(s);clearTimeout(o.sfTimer),s.siblings().superfish("hide").end().superfish("show")},f=function(){var s=e(this),o=m(s);t?e.proxy(d,s,o)():(clearTimeout(o.sfTimer),o.sfTimer=setTimeout(e.proxy(d,s,o),o.delay))},d=function(s){s.retainPath=e.inArray(this[0],s.$path)>-1,this.superfish("hide"),this.parents("."+s.hoverClass).length||(s.onIdle.call(v(this)),s.$path.length&&e.proxy(c,s.$path)())},v=function(e){return e.closest("."+o.menuClass)},m=function(e){return v(e).data("sf-options")};return{hide:function(s){if(this.length){var o=this,t=m(o);if(!t)return this;var n=t.retainPath===!0?t.$path:"",i=o.find("li."+t.hoverClass).add(this).not(n).removeClass(t.hoverClass).children(t.popUpSelector),r=t.speedOut;if(s&&(i.show(),r=0),t.retainPath=!1,t.onBeforeHide.call(i)===!1)return this;i.stop(!0,!0).animate(t.animationOut,r,"easeOutQuad",function(){var s=e(this);t.onHide.call(s)})}return this},show:function(){var e=m(this);if(!e)return this;var s=this.addClass(e.hoverClass),o=s.children(e.popUpSelector);return e.onBeforeShow.call(o)===!1?this:(o.stop(!0,!0).animate(e.animation,e.speed,"easeOutQuad",function(){e.onShow.call(o)}),this)},destroy:function(){return this.each(function(){var s,t=e(this),n=t.data("sf-options");return n?(s=t.find(n.popUpSelector).parent("li"),clearTimeout(n.sfTimer),r(t,n),l(s),h(t),t.off(".superfish").off(".hoverIntent"),s.children(n.popUpSelector).attr("style",function(e,s){return s.replace(/display[^;]+;?/g,"")}),n.$path.removeClass(n.hoverClass+" "+o.bcClass).addClass(n.pathClass),t.find("."+n.hoverClass).removeClass(n.hoverClass),n.onDestroy.call(t),void t.removeData("sf-options")):!1})},init:function(s){return this.each(function(){var t=e(this);if(t.data("sf-options"))return!1;var n=e.extend({},e.fn.superfish.defaults,s),i=t.find(n.popUpSelector).parent("li");n.$path=a(t,n),t.data("sf-options",n),r(t,n),l(i),h(t),u(t,n),i.not("."+o.bcClass).superfish("hide",!0),n.onInit.call(this)})}}}();e.fn.superfish=function(s,t){return o[s]?o[s].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof s&&s?e.error("Method "+s+" does not exist on jQuery.fn.superfish"):o.init.apply(this,arguments)},e.fn.superfish.defaults={popUpSelector:"ul,.sf-mega",hoverClass:"sfHover",pathClass:"overrideThisToUse",pathLevels:1,delay:800,animation:{opacity:"show"},animationOut:{opacity:"hide"},speed:"normal",speedOut:"fast",cssArrows:!0,disableHI:!1,onInit:e.noop,onBeforeShow:e.noop,onShow:e.noop,onBeforeHide:e.noop,onHide:e.noop,onIdle:e.noop,onDestroy:e.noop,onHandleTouch:e.noop}}(jQuery,window); !function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports?e(require("jquery")):e(jQuery)}(function(m){"use strict";var a;m.support.htmlMenuitem="HTMLMenuItemElement"in window,m.support.htmlCommand="HTMLCommandElement"in window,m.support.eventSelectstart="onselectstart"in document.documentElement,m.ui&&m.widget||(m.cleanData=(a=m.cleanData,function(e){var t,n,o;for(o=0;null!=e[o];o++){n=e[o];try{(t=m._data(n,"events"))&&t.remove&&m(n).triggerHandler("remove")}catch(e){}}a(e)}));var c=null,d=!1,p=m(window),f=0,h={},x={},v={},g={selector:null,appendTo:null,trigger:"right",autoHide:!1,delay:200,reposition:!0,hideOnSecondTrigger:!1,selectableSubMenu:!1,classNames:{hover:"context-menu-hover",disabled:"context-menu-disabled",visible:"context-menu-visible",notSelectable:"context-menu-not-selectable",icon:"context-menu-icon",iconEdit:"context-menu-icon-edit",iconCut:"context-menu-icon-cut",iconCopy:"context-menu-icon-copy",iconPaste:"context-menu-icon-paste",iconDelete:"context-menu-icon-delete",iconAdd:"context-menu-icon-add",iconQuit:"context-menu-icon-quit",iconLoadingClass:"context-menu-icon-loading"},determinePosition:function(e){if(m.ui&&m.ui.position)e.css("display","block").position({my:"center top",at:"center bottom",of:this,offset:"0 5",collision:"fit"}).css("display","none");else{var t=this.offset();t.top+=this.outerHeight(),t.left+=this.outerWidth()/2-e.outerWidth()/2,e.css(t)}},position:function(e,t,n){var o;if(t||n){if("maintain"===t&&"maintain"===n)o=e.$menu.position();else{var a=e.$menu.offsetParent().offset();o={top:n-a.top,left:t-a.left}}var s=p.scrollTop()+p.height(),i=p.scrollLeft()+p.width(),c=e.$menu.outerHeight(),l=e.$menu.outerWidth();o.top+c>s&&(o.top-=c),o.top<0&&(o.top=0),o.left+l>i&&(o.left-=l),o.left<0&&(o.left=0),e.$menu.css(o)}else e.determinePosition.call(this,e.$menu)},positionSubmenu:function(e){if(void 0!==e)if(m.ui&&m.ui.position)e.css("display","block").position({my:"left top-5",at:"right top",of:this,collision:"flipfit fit"}).css("display","");else{var t={top:-9,left:this.outerWidth()-5};e.css(t)}},zIndex:1,animation:{duration:50,show:"slideDown",hide:"slideUp"},events:{show:m.noop,hide:m.noop,activated:m.noop},callback:null,items:{}},s={timer:null,pageX:null,pageY:null},b={abortevent:function(e){e.preventDefault(),e.stopImmediatePropagation()},contextmenu:function(e){var t=m(this);if("right"===e.data.trigger&&(e.preventDefault(),e.stopImmediatePropagation()),!("right"!==e.data.trigger&&"demand"!==e.data.trigger&&e.originalEvent||!(void 0===e.mouseButton||!e.data||"left"===e.data.trigger&&0===e.mouseButton||"right"===e.data.trigger&&2===e.mouseButton)||t.hasClass("context-menu-active")||t.hasClass("context-menu-disabled"))){if(c=t,e.data.build){var n=e.data.build(c,e);if(!1===n)return;if(e.data=m.extend(!0,{},g,e.data,n||{}),!e.data.items||m.isEmptyObject(e.data.items))throw window.console&&(console.error||console.log).call(console,"No items specified to show in contextMenu"),new Error("No Items specified");e.data.$trigger=c,$.create(e.data)}$.show.call(t,e.data,e.pageX,e.pageY)}},click:function(e){e.preventDefault(),e.stopImmediatePropagation(),m(this).trigger(m.Event("contextmenu",{data:e.data,pageX:e.pageX,pageY:e.pageY}))},mousedown:function(e){var t=m(this);c&&c.length&&!c.is(t)&&c.data("contextMenu").$menu.trigger("contextmenu:hide"),2===e.button&&(c=t.data("contextMenuActive",!0))},mouseup:function(e){var t=m(this);t.data("contextMenuActive")&&c&&c.length&&c.is(t)&&!t.hasClass("context-menu-disabled")&&(e.preventDefault(),e.stopImmediatePropagation(),(c=t).trigger(m.Event("contextmenu",{data:e.data,pageX:e.pageX,pageY:e.pageY}))),t.removeData("contextMenuActive")},mouseenter:function(e){var t=m(this),n=m(e.relatedTarget),o=m(document);n.is(".context-menu-list")||n.closest(".context-menu-list").length||c&&c.length||(s.pageX=e.pageX,s.pageY=e.pageY,s.data=e.data,o.on("mousemove.contextMenuShow",b.mousemove),s.timer=setTimeout(function(){s.timer=null,o.off("mousemove.contextMenuShow"),(c=t).trigger(m.Event("contextmenu",{data:s.data,pageX:s.pageX,pageY:s.pageY}))},e.data.delay))},mousemove:function(e){s.pageX=e.pageX,s.pageY=e.pageY},mouseleave:function(e){var t=m(e.relatedTarget);if(!t.is(".context-menu-list")&&!t.closest(".context-menu-list").length){try{clearTimeout(s.timer)}catch(e){}s.timer=null}},layerClick:function(a){var s,i,c=m(this).data("contextMenuRoot"),l=a.button,r=a.pageX,u=a.pageY,d=void 0===r;a.preventDefault(),setTimeout(function(){if(d)null!=c&&null!==c.$menu&&void 0!==c.$menu&&c.$menu.trigger("contextmenu:hide");else{var e,t="left"===c.trigger&&0===l||"right"===c.trigger&&2===l;if(document.elementFromPoint&&c.$layer){if(c.$layer.hide(),(s=document.elementFromPoint(r-p.scrollLeft(),u-p.scrollTop())).isContentEditable){var n=document.createRange(),o=window.getSelection();n.selectNode(s),n.collapse(!0),o.removeAllRanges(),o.addRange(n)}m(s).trigger(a),c.$layer.show()}if(c.hideOnSecondTrigger&&t&&null!==c.$menu&&void 0!==c.$menu)c.$menu.trigger("contextmenu:hide");else{if(c.reposition&&t)if(document.elementFromPoint){if(c.$trigger.is(s))return void c.position.call(c.$trigger,c,r,u)}else if(i=c.$trigger.offset(),e=m(window),i.top+=e.scrollTop(),i.top<=a.pageY&&(i.left+=e.scrollLeft(),i.left<=a.pageX&&(i.bottom=i.top+c.$trigger.outerHeight(),i.bottom>=a.pageY&&(i.right=i.left+c.$trigger.outerWidth(),i.right>=a.pageX))))return void c.position.call(c.$trigger,c,r,u);s&&t&&c.$trigger.one("contextmenu:hidden",function(){m(s).contextMenu({x:r,y:u,button:l})}),null!=c&&null!==c.$menu&&void 0!==c.$menu&&c.$menu.trigger("contextmenu:hide")}}},50)},keyStop:function(e,t){t.isInput||e.preventDefault(),e.stopPropagation()},key:function(e){var t={};c&&(t=c.data("contextMenu")||{}),void 0===t.zIndex&&(t.zIndex=0);var n=0,o=function(e){""!==e.style.zIndex?n=e.style.zIndex:null!==e.offsetParent&&void 0!==e.offsetParent?o(e.offsetParent):null!==e.parentElement&&void 0!==e.parentElement&&o(e.parentElement)};if(o(e.target),!(t.$menu&&parseInt(n,10)>parseInt(t.$menu.css("zIndex"),10))){switch(e.keyCode){case 9:case 38:if(b.keyStop(e,t),t.isInput){if(9===e.keyCode&&e.shiftKey)return e.preventDefault(),t.$selected&&t.$selected.find("input, textarea, select").blur(),void(null!==t.$menu&&void 0!==t.$menu&&t.$menu.trigger("prevcommand"));if(38===e.keyCode&&"checkbox"===t.$selected.find("input, textarea, select").prop("type"))return void e.preventDefault()}else if(9!==e.keyCode||e.shiftKey)return void(null!==t.$menu&&void 0!==t.$menu&&t.$menu.trigger("prevcommand"));break;case 40:if(b.keyStop(e,t),!t.isInput)return void(null!==t.$menu&&void 0!==t.$menu&&t.$menu.trigger("nextcommand"));if(9===e.keyCode)return e.preventDefault(),t.$selected&&t.$selected.find("input, textarea, select").blur(),void(null!==t.$menu&&void 0!==t.$menu&&t.$menu.trigger("nextcommand"));if(40===e.keyCode&&"checkbox"===t.$selected.find("input, textarea, select").prop("type"))return void e.preventDefault();break;case 37:if(b.keyStop(e,t),t.isInput||!t.$selected||!t.$selected.length)break;if(!t.$selected.parent().hasClass("context-menu-root")){var a=t.$selected.parent().parent();return t.$selected.trigger("contextmenu:blur"),void(t.$selected=a)}break;case 39:if(b.keyStop(e,t),t.isInput||!t.$selected||!t.$selected.length)break;var s=t.$selected.data("contextMenu")||{};if(s.$menu&&t.$selected.hasClass("context-menu-submenu"))return t.$selected=null,s.$selected=null,void s.$menu.trigger("nextcommand");break;case 35:case 36:return t.$selected&&t.$selected.find("input, textarea, select").length?void 0:((t.$selected&&t.$selected.parent()||t.$menu).children(":not(."+t.classNames.disabled+", ."+t.classNames.notSelectable+")")[36===e.keyCode?"first":"last"]().trigger("contextmenu:focus"),void e.preventDefault());case 13:if(b.keyStop(e,t),t.isInput){if(t.$selected&&!t.$selected.is("textarea, select"))return void e.preventDefault();break}return void(void 0!==t.$selected&&null!==t.$selected&&t.$selected.trigger("mouseup"));case 32:case 33:case 34:return void b.keyStop(e,t);case 27:return b.keyStop(e,t),void(null!==t.$menu&&void 0!==t.$menu&&t.$menu.trigger("contextmenu:hide"));default:var i=String.fromCharCode(e.keyCode).toUpperCase();if(t.accesskeys&&t.accesskeys[i])return void t.accesskeys[i].$node.trigger(t.accesskeys[i].$menu?"contextmenu:focus":"mouseup")}e.stopPropagation(),void 0!==t.$selected&&null!==t.$selected&&t.$selected.trigger(e)}},prevItem:function(e){e.stopPropagation();var t=m(this).data("contextMenu")||{},n=m(this).data("contextMenuRoot")||{};if(t.$selected){var o=t.$selected;(t=t.$selected.parent().data("contextMenu")||{}).$selected=o}for(var a=t.$menu.children(),s=t.$selected&&t.$selected.prev().length?t.$selected.prev():a.last(),i=s;s.hasClass(n.classNames.disabled)||s.hasClass(n.classNames.notSelectable)||s.is(":hidden");)if((s=s.prev().length?s.prev():a.last()).is(i))return;t.$selected&&b.itemMouseleave.call(t.$selected.get(0),e),b.itemMouseenter.call(s.get(0),e);var c=s.find("input, textarea, select");c.length&&c.focus()},nextItem:function(e){e.stopPropagation();var t=m(this).data("contextMenu")||{},n=m(this).data("contextMenuRoot")||{};if(t.$selected){var o=t.$selected;(t=t.$selected.parent().data("contextMenu")||{}).$selected=o}for(var a=t.$menu.children(),s=t.$selected&&t.$selected.next().length?t.$selected.next():a.first(),i=s;s.hasClass(n.classNames.disabled)||s.hasClass(n.classNames.notSelectable)||s.is(":hidden");)if((s=s.next().length?s.next():a.first()).is(i))return;t.$selected&&b.itemMouseleave.call(t.$selected.get(0),e),b.itemMouseenter.call(s.get(0),e);var c=s.find("input, textarea, select");c.length&&c.focus()},focusInput:function(){var e=m(this).closest(".context-menu-item"),t=e.data(),n=t.contextMenu,o=t.contextMenuRoot;o.$selected=n.$selected=e,o.isInput=n.isInput=!0},blurInput:function(){var e=m(this).closest(".context-menu-item").data(),t=e.contextMenu;e.contextMenuRoot.isInput=t.isInput=!1},menuMouseenter:function(){m(this).data().contextMenuRoot.hovering=!0},menuMouseleave:function(e){var t=m(this).data().contextMenuRoot;t.$layer&&t.$layer.is(e.relatedTarget)&&(t.hovering=!1)},itemMouseenter:function(e){var t=m(this),n=t.data(),o=n.contextMenu,a=n.contextMenuRoot;a.hovering=!0,e&&a.$layer&&a.$layer.is(e.relatedTarget)&&(e.preventDefault(),e.stopImmediatePropagation()),(o.$menu?o:a).$menu.children("."+a.classNames.hover).trigger("contextmenu:blur").children(".hover").trigger("contextmenu:blur"),t.hasClass(a.classNames.disabled)||t.hasClass(a.classNames.notSelectable)?o.$selected=null:t.trigger("contextmenu:focus")},itemMouseleave:function(e){var t=m(this),n=t.data(),o=n.contextMenu,a=n.contextMenuRoot;if(a!==o&&a.$layer&&a.$layer.is(e.relatedTarget))return void 0!==a.$selected&&null!==a.$selected&&a.$selected.trigger("contextmenu:blur"),e.preventDefault(),e.stopImmediatePropagation(),void(a.$selected=o.$selected=o.$node);o&&o.$menu&&o.$menu.hasClass("context-menu-visible")||t.trigger("contextmenu:blur")},itemClick:function(e){var t,n=m(this),o=n.data(),a=o.contextMenu,s=o.contextMenuRoot,i=o.contextMenuKey;if(!(!a.items[i]||n.is("."+s.classNames.disabled+", .context-menu-separator, ."+s.classNames.notSelectable)||n.is(".context-menu-submenu")&&!1===s.selectableSubMenu)){if(e.preventDefault(),e.stopImmediatePropagation(),m.isFunction(a.callbacks[i])&&Object.prototype.hasOwnProperty.call(a.callbacks,i))t=a.callbacks[i];else{if(!m.isFunction(s.callback))return;t=s.callback}!1!==t.call(s.$trigger,i,s,e)?s.$menu.trigger("contextmenu:hide"):s.$menu.parent().length&&$.update.call(s.$trigger,s)}},inputClick:function(e){e.stopImmediatePropagation()},hideMenu:function(e,t){var n=m(this).data("contextMenuRoot");$.hide.call(n.$trigger,n,t&&t.force)},focusItem:function(e){e.stopPropagation();var t=m(this),n=t.data(),o=n.contextMenu,a=n.contextMenuRoot;t.hasClass(a.classNames.disabled)||t.hasClass(a.classNames.notSelectable)||(t.addClass([a.classNames.hover,a.classNames.visible].join(" ")).parent().find(".context-menu-item").not(t).removeClass(a.classNames.visible).filter("."+a.classNames.hover).trigger("contextmenu:blur"),o.$selected=a.$selected=t,o&&o.$node&&o.$node.hasClass("context-menu-submenu")&&o.$node.addClass(a.classNames.hover),o.$node&&a.positionSubmenu.call(o.$node,o.$menu))},blurItem:function(e){e.stopPropagation();var t=m(this),n=t.data(),o=n.contextMenu,a=n.contextMenuRoot;o.autoHide&&t.removeClass(a.classNames.visible),t.removeClass(a.classNames.hover),o.$selected=null}},$={show:function(n,e,t){var o=m(this),a={};if(m("#context-menu-layer").trigger("mousedown"),n.$trigger=o,!1!==n.events.show.call(o,n))if(!1!==$.update.call(o,n)){if(n.position.call(o,n,e,t),n.zIndex){var s=n.zIndex;"function"==typeof n.zIndex&&(s=n.zIndex.call(o,n)),a.zIndex=function(e){for(var t=0,n=e;t=Math.max(t,parseInt(n.css("z-index"),10)||0),(n=n.parent())&&n.length&&!(-1<"html body".indexOf(n.prop("nodeName").toLowerCase())););return t}(o)+s}$.layer.call(n.$menu,n,a.zIndex),n.$menu.find("ul").css("zIndex",a.zIndex+1),n.$menu.css(a)[n.animation.show](n.animation.duration,function(){o.trigger("contextmenu:visible"),$.activated(n),n.events.activated(n)}),o.data("contextMenu",n).addClass("context-menu-active"),m(document).off("keydown.contextMenu").on("keydown.contextMenu",b.key),n.autoHide&&m(document).on("mousemove.contextMenuAutoHide",function(e){var t=o.offset();t.right=t.left+o.outerWidth(),t.bottom=t.top+o.outerHeight(),!n.$layer||n.hovering||e.pageX>=t.left&&e.pageX<=t.right&&e.pageY>=t.top&&e.pageY<=t.bottom||setTimeout(function(){n.hovering||null===n.$menu||void 0===n.$menu||n.$menu.trigger("contextmenu:hide")},50)})}else c=null;else c=null},hide:function(t,e){var n=m(this);if(t||(t=n.data("contextMenu")||{}),e||!t.events||!1!==t.events.hide.call(n,t)){if(n.removeData("contextMenu").removeClass("context-menu-active"),t.$layer){setTimeout((o=t.$layer,function(){o.remove()}),10);try{delete t.$layer}catch(e){t.$layer=null}}var o;c=null,t.$menu.find("."+t.classNames.hover).trigger("contextmenu:blur"),t.$selected=null,t.$menu.find("."+t.classNames.visible).removeClass(t.classNames.visible),m(document).off(".contextMenuAutoHide").off("keydown.contextMenu"),t.$menu&&t.$menu[t.animation.hide](t.animation.duration,function(){t.build&&(t.$menu.remove(),m.each(t,function(e){switch(e){case"ns":case"selector":case"build":case"trigger":return!0;default:t[e]=void 0;try{delete t[e]}catch(e){}return!0}})),setTimeout(function(){n.trigger("contextmenu:hidden")},10)})}},create:function(r,u){function d(e){var t=m("");if(e._accesskey)e._beforeAccesskey&&t.append(document.createTextNode(e._beforeAccesskey)),m("").addClass("context-menu-accesskey").text(e._accesskey).appendTo(t),e._afterAccesskey&&t.append(document.createTextNode(e._afterAccesskey));else if(e.isHtmlName){if(void 0!==e.accesskey)throw new Error("accesskeys are not compatible with HTML names and cannot be used together in the same item");t.html(e.name)}else t.text(e.name);return t}void 0===u&&(u=r),r.$menu=m('
    ').addClass(r.className||"").data({contextMenu:r,contextMenuRoot:u}),m.each(["callbacks","commands","inputs"],function(e,t){r[t]={},u[t]||(u[t]={})}),u.accesskeys||(u.accesskeys={}),m.each(r.items,function(n,o){var e=m('
  • ').addClass(o.className||""),t=null,a=null;if(e.on("click",m.noop),"string"!=typeof o&&"cm_separator"!==o.type||(o={type:"cm_seperator"}),o.$node=e.data({contextMenu:r,contextMenuRoot:u,contextMenuKey:n}),void 0!==o.accesskey)for(var s,i=function(e){for(var t,n=e.split(/\s+/),o=[],a=0;t=n[a];a++)t=t.charAt(0).toUpperCase(),o.push(t);return o}(o.accesskey),c=0;s=i[c];c++)if(!u.accesskeys[s]){var l=(u.accesskeys[s]=o).name.match(new RegExp("^(.*?)("+s+")(.*)$","i"));l&&(o._beforeAccesskey=l[1],o._accesskey=l[2],o._afterAccesskey=l[3]);break}if(o.type&&v[o.type])v[o.type].call(e,o,r,u),m.each([r,u],function(e,t){t.commands[n]=o,!m.isFunction(o.callback)||void 0!==t.callbacks[n]&&void 0!==r.type||(t.callbacks[n]=o.callback)});else{switch("cm_seperator"===o.type?e.addClass("context-menu-separator "+u.classNames.notSelectable):"html"===o.type?e.addClass("context-menu-html "+u.classNames.notSelectable):"sub"===o.type||(o.type?(t=m("").appendTo(e),d(o).appendTo(t),e.addClass("context-menu-input"),r.hasTypes=!0,m.each([r,u],function(e,t){t.commands[n]=o,t.inputs[n]=o})):o.items&&(o.type="sub")),o.type){case"cm_seperator":break;case"text":a=m('').attr("name","context-menu-input-"+n).val(o.value||"").appendTo(t);break;case"textarea":a=m('').attr("name","context-menu-input-"+n).val(o.value||"").appendTo(t),o.height&&a.height(o.height);break;case"checkbox":a=m('').attr("name","context-menu-input-"+n).val(o.value||"").prop("checked",!!o.selected).prependTo(t);break;case"radio":a=m('').attr("name","context-menu-input-"+o.radio).val(o.value||"").prop("checked",!!o.selected).prependTo(t);break;case"select":a=m('').attr("name","context-menu-input-"+n).appendTo(t),o.options&&(m.each(o.options,function(e,t){m("").val(e).text(t).appendTo(a)}),a.val(o.selected));break;case"sub":d(o).appendTo(e),o.appendTo=o.$node,e.data("contextMenu",o).addClass("context-menu-submenu"),o.callback=null,"function"==typeof o.items.then?$.processPromises(o,u,o.items):$.create(o,u);break;case"html":m(o.html).appendTo(e);break;default:m.each([r,u],function(e,t){t.commands[n]=o,!m.isFunction(o.callback)||void 0!==t.callbacks[n]&&void 0!==r.type||(t.callbacks[n]=o.callback)}),d(o).appendTo(e)}o.type&&"sub"!==o.type&&"html"!==o.type&&"cm_seperator"!==o.type&&(a.on("focus",b.focusInput).on("blur",b.blurInput),o.events&&a.on(o.events,r)),o.icon&&(m.isFunction(o.icon)?o._icon=o.icon.call(this,this,e,n,o):"string"==typeof o.icon&&"fa-"===o.icon.substring(0,3)?o._icon=u.classNames.icon+" "+u.classNames.icon+"--fa fa "+o.icon:o._icon=u.classNames.icon+" "+u.classNames.icon+"-"+o.icon,e.addClass(o._icon))}o.$input=a,o.$label=t,e.appendTo(r.$menu),!r.hasTypes&&m.support.eventSelectstart&&e.on("selectstart.disableTextSelect",b.abortevent)}),r.$node||r.$menu.css("display","none").addClass("context-menu-root"),r.$menu.appendTo(r.appendTo||document.body)},resize:function(e,t){var n;e.css({position:"absolute",display:"block"}),e.data("width",(n=e.get(0)).getBoundingClientRect?Math.ceil(n.getBoundingClientRect().width):e.outerWidth()+1),e.css({position:"static",minWidth:"0px",maxWidth:"100000px"}),e.find("> li > ul").each(function(){$.resize(m(this),!0)}),t||e.find("ul").addBack().css({position:"",display:"",minWidth:"",maxWidth:""}).outerWidth(function(){return m(this).data("width")})},update:function(s,i){var c=this;void 0===i&&(i=s,$.resize(s.$menu));var l=!1;return s.$menu.children().each(function(){var e,t=m(this),n=t.data("contextMenuKey"),o=s.items[n],a=m.isFunction(o.disabled)&&o.disabled.call(c,n,i)||!0===o.disabled;if((e=m.isFunction(o.visible)?o.visible.call(c,n,i):void 0===o.visible||!0===o.visible)&&(l=!0),t[e?"show":"hide"](),t[a?"addClass":"removeClass"](i.classNames.disabled),m.isFunction(o.icon)&&(t.removeClass(o._icon),o._icon=o.icon.call(this,c,t,n,o),t.addClass(o._icon)),o.type)switch(t.find("input, select, textarea").prop("disabled",a),o.type){case"text":case"textarea":o.$input.val(o.value||"");break;case"checkbox":case"radio":o.$input.val(o.value||"").prop("checked",!!o.selected);break;case"select":o.$input.val((0===o.selected?"0":o.selected)||"")}o.$menu&&($.update.call(c,o,i)&&(l=!0))}),l},layer:function(e,t){var n=e.$layer=m('
    ').css({height:p.height(),width:p.width(),display:"block",position:"fixed","z-index":t,top:0,left:0,opacity:0,filter:"alpha(opacity=0)","background-color":"#000"}).data("contextMenuRoot",e).insertBefore(this).on("contextmenu",b.abortevent).on("mousedown",b.layerClick);return void 0===document.body.style.maxWidth&&n.css({position:"absolute",height:m(document).height()}),n},processPromises:function(e,t,n){function o(e,t,n){void 0===n?(n={error:{name:"No items and no error item",icon:"context-menu-icon context-menu-icon-quit"}},window.console&&(console.error||console.log).call(console,'When you reject a promise, provide an "items" object, equal to normal sub-menu items')):"string"==typeof n&&(n={error:{name:n}}),a(e,t,n)}function a(e,t,n){void 0!==t.$menu&&t.$menu.is(":visible")&&(e.$node.removeClass(t.classNames.iconLoadingClass),e.items=n,$.create(e,t,!0),$.update(e,t),t.positionSubmenu.call(e.$node,e.$menu))}e.$node.addClass(t.classNames.iconLoadingClass),n.then(function(e,t,n){void 0===n&&o(void 0),a(e,t,n)}.bind(this,e,t),o.bind(this,e,t))},activated:function(e){var t=e.$menu,n=t.offset(),o=m(window).height(),a=m(window).scrollTop(),s=t.height();oa+o)&&t.css({top:"0px"})}};function l(e){return e.id&&m('label[for="'+e.id+'"]').val()||e.name}m.fn.contextMenu=function(e){var t=this,n=e;if(0