1!function(a){a.idleTimer=function(b,c){var d;"object"==typeof b?(d=b,b=null):"number"==typeof b&&(d={timeout:b},b=null),c=c||document,d=a.extend({idle:!1,timeout:3e4,events:"mousemove keydown wheel DOMMouseScroll mousewheel mousedown touchstart touchmove MSPointerDown MSPointerMove"},d);var e=a(c),f=e.data("idleTimerObj")||{},g=function(b){var d=a.data(c,"idleTimerObj")||{};d.idle=!d.idle,d.olddate=+new Date;var e=a.Event((d.idle?"idle":"active")+".idleTimer");a(c).trigger(e,[c,a.extend({},d),b])},h=function(b){var d=a.data(c,"idleTimerObj")||{};if(null==d.remaining){if("mousemove"===b.type){if(b.pageX===d.pageX&&b.pageY===d.pageY)return;if("undefined"==typeof b.pageX&&"undefined"==typeof b.pageY)return;var e=+new Date-d.olddate;if(200>e)return}clearTimeout(d.tId),d.idle&&g(b),d.lastActive=+new Date,d.pageX=b.pageX,d.pageY=b.pageY,d.tId=setTimeout(g,d.timeout)}},i=function(){var b=a.data(c,"idleTimerObj")||{};b.idle=b.idleBackup,b.olddate=+new Date,b.lastActive=b.olddate,b.remaining=null,clearTimeout(b.tId),b.idle||(b.tId=setTimeout(g,b.timeout))},j=function(){var b=a.data(c,"idleTimerObj")||{};null==b.remaining&&(b.remaining=b.timeout-(+new Date-b.olddate),clearTimeout(b.tId))},k=function(){var b=a.data(c,"idleTimerObj")||{};null!=b.remaining&&(b.idle||(b.tId=setTimeout(g,b.remaining)),b.remaining=null)},l=function(){var b=a.data(c,"idleTimerObj")||{};clearTimeout(b.tId),e.removeData("idleTimerObj"),e.off("._idleTimer")},m=function(){var b=a.data(c,"idleTimerObj")||{};if(b.idle)return 0;if(null!=b.remaining)return b.remaining;var d=b.timeout-(+new Date-b.lastActive);return 0>d&&(d=0),d};if(null===b&&"undefined"!=typeof f.idle)return i(),e;if(null===b);else{if(null!==b&&"undefined"==typeof f.idle)return!1;if("destroy"===b)return l(),e;if("pause"===b)return j(),e;if("resume"===b)return k(),e;if("reset"===b)return i(),e;if("getRemainingTime"===b)return m();if("getElapsedTime"===b)return+new Date-f.olddate;if("getLastActiveTime"===b)return f.lastActive;if("isIdle"===b)return f.idle}return e.on(a.trim((d.events+" ").split(" ").join("._idleTimer ")),function(a){h(a)}),f=a.extend({},{olddate:+new Date,lastActive:+new Date,idle:d.idle,idleBackup:d.idle,timeout:d.timeout,remaining:null,tId:null,pageX:null,pageY:null}),f.idle||(f.tId=setTimeout(g,f.timeout)),a.data(c,"idleTimerObj",f),e},a.fn.idleTimer=function(b){return this[0]?a.idleTimer(b,this[0]):this}}(jQuery); 2(function($){ 3$(document).ready(function(){ 4var all_networks_opened=0; 5$('body').on('click', '.et_social_share', function(){ 6var $this_el=$(this), 7social_type=$this_el.data('social_type'), 8social_network=$this_el.data('social_name'), 9share_link='media'==social_type ? $this_el.data('social_link'):$this_el.prop('href'); 10update_stats_table(social_network, $this_el); 11if('like'===social_network){ 12return false; 13} 14var left=($(window).width()/2) -(550/2); 15var top=($(window).height()/2) -(450/2); 16var new_window=window.open(share_link, '', 'scrollbars=1, height=450, width=550, left=' + left + ', top=' + top); 17if(window.focus){ 18new_window.focus(); 19} 20return false; 21}); 22$('.et_social_follow').click(function(){ 23var $this_el=$(this), 24social_network=$this_el.data('social_name'); 25update_stats_table(social_network, $this_el); 26if('like'===social_network){ 27return false; 28}}); 29$('body').on('click', '.et_social_share_pinterest', function(){ 30if($(this).hasClass('et_social_pin_all')){ 31var left=($(window).width()/2) -(550/2), 32top=($(window).height()/2) -(450/2), 33share_link=$(this).attr('href'), 34new_window=window.open(share_link, '', 'scrollbars=1, height=450, width=550, left=' + left + ', top=' + top); 35if(window.focus){ 36new_window.focus(); 37}}else{ 38$('.et_social_pin_images_outer').fadeToggle(400); 39} 40return false; 41}); 42function get_url_parameter(param_name){ 43var page_url=window.location.search.substring(1); 44var url_variables=page_url.split('&'); 45for(var i=0; i < url_variables.length; i++){ 46var curr_param_name=url_variables[i].split('='); 47if(curr_param_name[0]==param_name){ 48return curr_param_name[1]; 49}} 50} 51function update_stats_table($social_network, $this_el){ 52var action=$this_el.data('social_type'), 53media_url='media'==action ? $this_el.closest('.et_social_media_wrapper').find('img').attr('src'):'', 54post_id=$this_el.data('post_id'), 55location=$this_el.data('location'), 56stats_data=''; 57stats_data=JSON.stringify({ 58'action':action, 59'network':$social_network, 60'media_url':media_url, 61'post_id':post_id, 62'location':location 63}); 64$.ajax({ 65type: 'POST',
66url: monarchSettings.ajaxurl, 67data: { 68action:'add_stats_record_db', 69stats_data_array:stats_data, 70add_stats_nonce:monarchSettings.stats_nonce 71}, 72success: function(data){ 73if(true==data){ 74if('like'===action){ 75update_single_shares($this_el, '', post_id, $social_network, 'like'); 76} 77if('media'===action){ 78update_total_media_shares($this_el.closest('.et_social_media_wrapper')); 79update_single_shares($this_el, media_url, post_id, $social_network, 'media'); 80}} 81}}); 82} 83function append_share_counts($current_network){ 84var network=$current_network.data('social_name'), 85min_count=$current_network.data('min_count'), 86post_id=$current_network.data('post_id'), 87url=monarchSettings.pageurl!=='' ? monarchSettings.pageurl:window.location.href, 88label_div=$current_network.find('.et_social_network_label'), 89append_to=(0!=(label_div.length)) ? label_div:$current_network; 90$share_count_data=JSON.stringify({ 'network':network, 'min_count':min_count, 'post_id':post_id, 'url':url }); 91$.ajax({ 92type: 'POST', 93url: monarchSettings.ajaxurl, 94data: { 95action:'get_shares_count', 96share_count_array:$share_count_data, 97get_share_counts_nonce:monarchSettings.share_counts 98}, 99beforeSend: function(data){ 100append_to.append('<span class="et_social_placeholder"></span>'); 101}, 102success: function(data){ 103$current_network.find('span.et_social_placeholder').remove(); 104append_to.append(data); 105}}); 106} 107function append_total_shares($current_area){ 108var post_id=$current_area.data('post_id'), 109url=monarchSettings.pageurl!=='' ? monarchSettings.pageurl:window.location.href, 110append_to=$current_area; 111$share_total_count_data=JSON.stringify({ 'post_id':post_id, 'url':url }); 112$.ajax({ 113type: 'POST', 114url: monarchSettings.ajaxurl, 115data: { 116action:'get_total_shares', 117share_total_count_array:$share_total_count_data, 118get_total_counts_nonce:monarchSettings.total_counts 119}, 120beforeSend: function(data){ 121append_to.append('<span class="et_social_placeholder"></span>'); 122}, 123success: function(data){ 124append_to.find('span.et_social_placeholder').remove(); 125append_to.append(data); 126}}); 127} 128function append_follow_counts($current_area){ 129var network=$current_area.data('network'), 130min_count=$current_area.data('min_count'), 131index=$current_area.data('index'), 132append_to=$current_area; 133$follow_count_data=JSON.stringify({ 'network':network, 'min_count':min_count, 'index':index }); 134$.ajax({ 135type: 'POST', 136url: monarchSettings.ajaxurl, 137data: { 138action:'get_follow_counts', 139follow_count_array:$follow_count_data, 140get_follow_counts_nonce:monarchSettings.follow_counts 141}, 142beforeSend: function(data){ 143append_to.append('<span class="et_social_placeholder"></span>'); 144}, 145success: function(data){ 146$current_area.find('span.et_social_placeholder').remove(); 147append_to.append(data); 148}}); 149} 150function append_total_follows($current_area){ 151var append_to=$current_area; 152$.ajax({ 153type: 'POST', 154url: monarchSettings.ajaxurl, 155data: { 156action:'get_follow_total', 157get_total_counts_nonce:monarchSettings.total_counts 158}, 159beforeSend: function(data){ 160append_to.append('<span class="et_social_placeholder"></span>'); 161}, 162success: function(data){ 163append_to.find('span.et_social_placeholder').remove(); 164append_to.append(data); 165}}); 166} 167if($('.et_social_display_follow_counts').length){ 168$('.et_social_display_follow_counts').each(function(){ 169append_follow_counts($(this)); 170}); 171} 172if($('.et_social_follow_total').length){ 173$('.et_social_follow_total').each(function(){ 174append_total_follows($(this)); 175}); 176} 177if($('.et_social_total_share').length){ 178$('.et_social_total_share').each(function(){ 179append_total_shares($(this)); 180}); 181} 182if($('.et_social_display_count').length){ 183$('.et_social_display_count').each(function(){ 184append_share_counts($(this)); 185}); 186} 187if($('.et_social_media_wrapper').length&&$('.et_social_media_wrapper .et_social_totalcount').length){ 188$('.et_social_media_wrapper').each(function(){ 189update_total_media_shares($(this)); 190}); 191} 192if($('.et_social_media_wrapper').length&&$('.et_social_media_wrapper .et_social_withcounts').length){ 193$('.et_social_media_wrapper .et_social_share').each(function(){ 194var this_el=$(this), 195media_url=this_el.closest('.et_social_media_wrapper').find('img').attr('src'), 196post_id=this_el.data('post_id'), 197social_network=this_el.data('social_name'); 198update_single_shares(this_el, media_url, post_id, social_network, 'media'); 199}); 200} 201function update_total_media_shares($element){ 202if($('.et_social_totalcount').length){ 203var this_el=$element, 204media_url=this_el.find('img').attr('src'), 205post_id=this_el.find('.et_social_share').first().data('post_id'), 206media_data=JSON.stringify({ 'media_url':media_url, 'post_id':post_id }); 207$.ajax({ 208type: 'POST',
209url: monarchSettings.ajaxurl, 210data: { 211action:'get_media_shares_total', 212media_total:media_data, 213get_media_shares_total_nonce:monarchSettings.media_total 214}, 215success: function(data){ 216this_el.find('.et_social_totalcount_count').empty().append(data); 217}}); 218}} 219function update_single_shares($this_el, $media_url, $post_id, $network, $action){ 220if($('.et_social_withcounts').length){ 221var media_data=JSON.stringify({ 'media_url':$media_url, 'post_id':$post_id, 'network':$network, 'action':$action }); 222$.ajax({ 223type: 'POST', 224url: monarchSettings.ajaxurl, 225data: { 226action:'get_shares_single', 227media_single:media_data, 228get_media_shares_nonce:monarchSettings.media_single 229}, 230success: function(data){ 231$this_el.find('.et_social_count span').not('.et_social_count_label').empty().append(data); 232}}); 233}} 234function setCookieExpire(days){ 235var ms=days*24*60*60*1000; 236var date=new Date(); 237date.setTime(date.getTime() + ms); 238return "; expires=" + date.toUTCString(); 239} 240function checkCookieValue(cookieName, value){ 241return parseCookies()[cookieName]===value; 242} 243function parseCookies(){ 244var cookies=document.cookie.split('; '); 245var ret={}; 246for (var i=cookies.length - 1; i >=0; i--){ 247var el=cookies[i].split('='); 248ret[el[0]]=el[1]; 249} 250return ret; 251} 252function set_cookie($expire){ 253cookieExpire=setCookieExpire($expire); 254document.cookie='etSocialCookie=true' + cookieExpire; 255} 256function make_popup_visible($popup, $delay){ 257setTimeout(function(){ 258$popup.addClass('et_social_visible et_social_animated'); 259if($('.et_social_resize').length){ 260$('.et_social_resize').each(function(){ 261define_popup_position($(this)); 262}); 263}}, $delay); 264} 265function auto_popup(this_el, delay){ 266var $current_popup_auto=this_el; 267if(! $current_popup_auto.hasClass('et_social_animated')){ 268var $cookies_expire_auto=$current_popup_auto.data('cookie_duration') ? $current_popup_auto.data('cookie_duration'):false, 269$delay=delay; 270if(( false!==$cookies_expire_auto&&! checkCookieValue('etSocialCookie', 'true'))||false==$cookies_expire_auto){ 271make_popup_visible($current_popup_auto, $delay); 272if(false!==$cookies_expire_auto){ 273set_cookie($cookies_expire_auto); 274}} 275}} 276if('true'==get_url_parameter('et_monarch_popup')){ 277$('.et_social_after_comment').each(function(){ 278var $current_popup=$(this); 279auto_popup($current_popup, 0); 280}); 281} 282if($('.et_social_auto_popup').length){ 283$('.et_social_auto_popup').each(function(){ 284var $current_popup_auto=$(this); 285auto_popup($current_popup_auto, ''!==$current_popup_auto.data('delay') ? $current_popup_auto.data('delay') * 1000:0); 286}); 287} 288$('.et_social_pinterest_window .et_social_close').on('click', function(){ 289$('.et_social_pin_images_outer').fadeToggle(400); 290}); 291$('body').on('click', '.et_social_icon_cancel', function(){ 292var this_el=$(this); 293if(this_el.parent().hasClass('et_social_flyin')){ 294$popup=this_el.parent(); 295}else{ 296$popup=this_el.parent().parent(); 297if($popup.hasClass('et_social_all_networks_popup')){ 298all_networks_opened=0; 299}} 300$popup.addClass('et_social_fadeout'); 301setTimeout(function(){ 302$popup.remove(); 303}, 800); 304return false; 305}); 306if($('.et_monarch_after_order').length){ 307$('.et_social_after_purchase').each(function(){ 308var $current_popup=$(this); 309if(! $current_popup.hasClass('et_social_animated')){ 310var $cookies_expire=$current_popup.data('cookie_duration') ? $current_popup.data('cookie_duration'):false, 311$delay=0; 312if(( false!==$cookies_expire&&! checkCookieValue('etSocialCookie', 'true'))||false==$cookies_expire){ 313make_popup_visible($current_popup, $delay); 314if(false!==$cookies_expire){ 315set_cookie($cookies_expire); 316}} 317}}); 318} 319if($('.et_social_trigger_bottom').length){ 320$('.et_social_trigger_bottom').each(function(){ 321scroll_trigger($(this), true); 322}); 323} 324if($('.et_social_scroll').length){ 325$('.et_social_scroll').each(function(){ 326scroll_trigger($(this), false); 327}); 328} 329function scroll_trigger(this_el, is_bottom_trigger){ 330var current_popup_bottom=this_el; 331if(! current_popup_bottom.hasClass('et_social_animated')){ 332var cookies_expire_bottom=current_popup_bottom.data('cookie_duration') ? current_popup_bottom.data('cookie_duration'):false; 333if(true==is_bottom_trigger){ 334var scroll_trigger=$('.et_social_bottom_trigger').length ? $('.et_social_bottom_trigger').offset().top:$(document).height() - 500; 335}else{ 336var scroll_pos=this_el.data('scroll_pos') > 100 ? 100:this_el.data('scroll_pos'), 337scroll_trigger=100==scroll_pos ? $(document).height() - 10:$(document).height() * scroll_pos / 100; 338} 339$(window).scroll(function(){ 340if(( false!==cookies_expire_bottom&&! checkCookieValue('etSocialCookie', 'true'))||false==cookies_expire_bottom){ 341if($(window).scrollTop() + $(window).height() > scroll_trigger){ 342current_popup_bottom.addClass('et_social_visible et_social_animated'); 343if($('.et_social_resize').length){ 344$('.et_social_resize').each(function(){ 345define_popup_position($(this)); 346}); 347} 348if(false!==cookies_expire_bottom){ 349set_cookie(cookies_expire_bottom); 350}} 351}}); 352}} 353if($('.et_social_trigger_idle').length){ 354$('.et_social_trigger_idle').each(function(){ 355var this_el=$(this); 356if(! this_el.hasClass('et_social_animated')){ 357var $cookies_expire_idle=this_el.data('cookie_duration') ? this_el.data('cookie_duration'):false, 358$idle_timeout=''!==this_el.data('idle_timeout') ? this_el.data('idle_timeout') * 1000:30000; 359if(( false!==$cookies_expire_idle&&! checkCookieValue('etSocialCookie', 'true'))||false==$cookies_expire_idle){ 360$(document).idleTimer($idle_timeout); 361$(document).on("idle.idleTimer", function(){ 362make_popup_visible(this_el, 0); 363}); 364if(false!==$cookies_expire_idle){ 365set_cookie($cookies_expire_idle); 366}} 367}}); 368} 369$('.et_social_heading, .et_social_mobile_button').click(function(){ 370$this_mobile_div=$('.et_social_mobile'); 371$this_mobile_div.css({'display':'block' }); 372$('.et_social_mobile_button').removeClass('et_social_active_button'); 373if($this_mobile_div.hasClass('et_social_opened')){ 374$this_mobile_div.find('.et_social_networks').slideToggle(600); 375$this_mobile_div.removeClass('et_social_opened').addClass('et_social_closed');
376$('.et_social_mobile_overlay').removeClass('et_social_visible_overlay'); 377$('.et_social_mobile_overlay').fadeToggle(600); 378}else{ 379$this_mobile_div.removeClass('et_social_closed').addClass('et_social_opened'); 380$this_mobile_div.find('.et_social_networks').slideToggle(600); 381$('.et_social_mobile_overlay').addClass('et_social_visible_overlay').css({ 'display':'block' }); 382}}); 383$('.et_social_mobile .et_social_close').click(function(){ 384$mobile_div=$('.et_social_mobile'); 385$mobile_div.fadeToggle(600); 386$('.et_social_mobile_button').addClass('et_social_active_button'); 387if($mobile_div.hasClass('et_social_opened')){ 388$('.et_social_mobile_overlay').fadeToggle(600); 389$mobile_div.removeClass('et_social_opened'); 390$mobile_div.find('.et_social_networks').fadeToggle(600); 391}}); 392if($('.et_social_inline').length){ 393if($('body').hasClass('et_pb_pagebuilder_layout')){ 394var top_inline=$('.et_social_inline_top'), 395bottom_inline=$('.et_social_inline_bottom'), 396divi_container='<div class="et_pb_row"><div class="et_pb_column et_pb_column_4_4"></div></div>'; 397if(top_inline.length){ 398$('.et_pb_section').not('.et_pb_fullwidth_section').first().prepend(divi_container).find('.et_pb_row').first().find('.et_pb_column').append(top_inline); 399} 400if(bottom_inline.length){ 401$('.et_pb_section').not('.et_pb_fullwidth_section').last().append(divi_container).find('.et_pb_row').last().find('.et_pb_column').append(bottom_inline); 402}} 403} 404function define_popup_position($this_popup){ 405setTimeout(function(){ 406var this_popup=$this_popup, 407networks_div=this_popup.find('.et_social_networks'), 408header_height=this_popup.find('.et_social_header').outerHeight(), 409total_count_height=this_popup.find('.et_social_totalcount').height(), 410extra_height=0 < total_count_height ? 20:0; 411this_popup.height(this_popup.find('.et_social_icons_container').innerHeight() + header_height + total_count_height + 20 + extra_height); 412var popup_max_height=this_popup.hasClass('et_social_popup_content') ? $(window).height():$(window).height() - 60; 413if(this_popup.hasClass('et_social_popup_content')&&768 < $(window).width()){ 414popup_max_height=popup_max_height - 50; 415} 416this_popup.css({ 'max-height':popup_max_height }); 417if(this_popup.hasClass('et_social_popup_content')){ 418var top_position=$(window).height() / 2 - this_popup.innerHeight() / 2; 419this_popup.css({ 'top':top_position + 'px' }); 420} 421var networks_div_height=this_popup.height() - header_height + total_count_height - extra_height; 422networks_div.height(networks_div_height); 423}, 400); 424} 425function set_mobile_sidebar_height(){ 426setTimeout(function(){ 427var mobile_div=$('.et_social_mobile'); 428if(!mobile_div.hasClass('et_social_opened')){ 429$('.et_social_mobile .et_social_networks').css({'display':'block'}); 430} 431if($('.et_social_active_button').length){ 432mobile_div.css({'display':'block'}); 433} 434var inner_contatiner_height=mobile_div.find('.et_social_icons_container').innerHeight() + 45; 435if(!mobile_div.hasClass('et_social_opened')){ 436$('.et_social_mobile .et_social_networks').css({'display':'none'}); 437} 438if($('.et_social_active_button').length){ 439mobile_div.css({'display':'none'}); 440} 441mobile_div.find('.et_social_networks').css({ 'max-height':inner_contatiner_height, 'height':inner_contatiner_height }); 442if($(window).height() < inner_contatiner_height){ 443var inner_height=$(window).height() - mobile_div.find('.et_social_heading').innerHeight() + 10; 444mobile_div.find('.et_social_networks').css({ 'height':inner_height }); 445}}, 400); 446} 447function set_sidebar_position(){ 448if($('.et_social_sidebar_networks').length){ 449var this_sidebar=$('.et_social_sidebar_networks'), 450top_position=$(window).height() / 2 - this_sidebar.innerHeight() / 2; 451top_position=0 > top_position ? 0:top_position; 452this_sidebar.css({ 'top':top_position + 'px' }); 453}} 454function set_media_wrapper_size(){ 455if($('.et_social_media_wrapper').length){ 456$('.et_social_media_wrapper').each(function(){ 457var this_wrapper=$(this), 458this_wrapper_media=this_wrapper.find('.et_social_media'), 459this_image=this_wrapper.find('img'), 460this_image_height=this_image.height(), 461this_image_width=this_image.width(), 462this_wrapper_networks_height=this_wrapper.find('.et_social_networks').innerHeight(); 463this_wrapper.addClass(this_image.attr('class')); 464this_wrapper_media.css({ 'max-height':this_image_height }); 465this_wrapper_media.css({ 'height':this_wrapper_networks_height + 50 }); 466this_wrapper_media.width(this_image_width - 80); 467}); 468}} 469$('body').on('click', '.et_social_open_all', function(){ 470all_networks_opened++; 471if(1==all_networks_opened){ 472var this_button=$(this), 473page_id=this_button.data('page_id'), 474permalink=this_button.data('permalink'), 475title=this_button.data('title'), 476media=typeof this_button.data('media')!=='undefined' ? this_button.data('media'):'', 477is_popup='popup'==this_button.data('location') ? 'true':'false'; 478$.ajax({ 479type: 'POST',
480url: monarchSettings.ajaxurl, 481data: { 482action:'generate_all_networks_popup', 483all_networks_page_id:page_id, 484all_networks_link:permalink, 485all_networks_title:title, 486all_networks_media:media, 487is_popup:is_popup, 488generate_all_window_nonce:monarchSettings.generate_all_window_nonce 489}, 490success: function(data){ 491if('false'==is_popup){ 492$('body').append(data); 493make_popup_visible($('.et_social_all_networks_popup'), 1); 494}else{ 495var popup_container=this_button.parent().closest('.et_social_popup_content'); 496this_button.parent().replaceWith(data); 497define_popup_position(popup_container); 498all_networks_opened=0; 499}} 500}); 501} 502return false; 503}); 504set_mobile_sidebar_height(); 505set_sidebar_position(); 506$(window).resize(function(){ 507if($('.et_social_resize').length){ 508$('.et_social_resize').each(function(){ 509define_popup_position($(this)); 510}); 511} 512if($('.et_social_mobile')){ 513set_mobile_sidebar_height(); 514} 515if($('.et_social_sidebar_networks').length){ 516set_sidebar_position(); 517} 518set_media_wrapper_size(); 519}); 520$('.et_social_hide_sidebar').click(function(){ 521$('.et_social_hide_sidebar').toggleClass('et_social_hidden_sidebar'); 522$('.et_social_sidebar_networks').toggleClass('et_social_hidden_sidebar et_social_visible_sidebar'); 523}); 524$(window).load(function(){ 525set_media_wrapper_size(); 526if($('.et_social_pin_images').length&&($('.et_social_all_button').length||$('.et_social_pinterest').length)){ 527var pin_container=$('.et_social_pin_images'), 528permalink=pin_container.data('permalink'), 529title=pin_container.data('title'), 530post_id=pin_container.data('post_id'), 531$i=0; 532$('img').each(function(){ 533if(! $(this).hasClass('avatar')){ 534var this_img=$(this).attr('src'), 535this_alt=$(this).attr('alt'); 536if(''!=this_img){ 537var pin_link='http://www.pinterest.com/pin/create/button/?url=' + permalink + '&media=' + this_img + '&description=' + title, 538this_img_container='<div class="et_social_pin_image"><a href="' + pin_link + '" rel="nofollow" class="et_social_icon et_social_share" data-social_name="pinterest" data-post_id="' + post_id + '" data-social_type="share"><img src="' + this_img + '" alt="' + this_alt + '"/><span class="et_social_pin_overlay et_social_icon"></span></a></div>'; 539$('.et_social_pin_images').append(this_img_container); 540$i++; 541}} 542}); 543if(0==$i){ 544$('.et_social_pin_images').append(monarchSettings.no_img_message); 545}} 546}); 547}); 548})(jQuery); 549!function(e){"use strict";const s="morphext",i={animation:"bounce",speed:2e3,autoInit:!0,phrases:[],animateCssVersion:"4.1.1",autoAttachAnimateCss:!0};function n(t){this.element=e(t),this._settings=e.extend({},i,JSON.parse(this.element.attr("data-morphext-options"))),this._defaults=i,this._init()}n.prototype={_init:function(){var t;this.element.addClass("morphext"),this._settings.autoAttachAnimateCss&&(t=`https://cdnjs.cloudflare.com/ajax/libs/animate.css/${this._settings.animateCssVersion}/animate.min.css`,e(`link[href='${t}']`).length||e(`<link href="${t}" rel="stylesheet">`).appendTo("head")),this._index=0,this.animate(),this.start()},animate:function(){this._index=this._index%this._settings.phrases.length;const t=document.createElement("span");t.classList.add("morphext__animated","animate__animated",`animate__${this._settings.animation}`),e(t).text(this._settings.phrases[this._index]),this.element.html(e(t).prop("outerHTML")),this._index+=1},start:function(){var t=this;this._interval=setInterval(function(){t.animate()},this._settings.speed)},stop:function(){this._interval=clearInterval(this._interval)}},e.fn[s]=function(t){return this.each(function(){e.data(this,"plugin_"+s)||e.data(this,"plugin_"+s,new n(this))})}}(jQuery); 550jQuery(document).ready(function($){ 551var adminBarHeight=0; 552if($("#wpadminbar").length!=0){ 553var adminBarHeight=$('#wpadminbar').height(); 554} 555var mysticky_welcomebar_height=adminBarHeight + jQuery('.mysticky-welcomebar-fixed').outerHeight(); 556if(jQuery('.mysticky-welcomebar-fixed').data('position')=='top'){ 557jQuery('.mysticky-welcomebar-entry-effect-slide-in.mysticky-welcomebar-fixed').css('top', '-' + mysticky_welcomebar_height + 'px'); 558}else{ 559jQuery('.mysticky-welcomebar-entry-effect-slide-in.mysticky-welcomebar-fixed').css('bottom', '-' + mysticky_welcomebar_height + 'px'); 560} 561var divi_topbar_height=$('.et_fixed_nav #top-header').outerHeight(); 562var divi_total_height=mysticky_welcomebar_height + divi_topbar_height; 563var welcombar_aftersubmission=$('.mysticky-welcomebar-fixed').data('aftersubmission'); 564if(welcombar_aftersubmission=='dont_show_welcomebar'){ 565var welcomebar_storage=localStorage.getItem("welcomebar_close"); 566}else if(welcombar_aftersubmission=='show_welcomebar_next_visit'){ 567var welcomebar_storage=sessionStorage.getItem("welcomebar_close"); 568}else{ 569sessionStorage.removeItem('welcomebar_close'); 570localStorage.removeItem('welcomebar_close'); 571var welcomebar_storage=null; 572} 573if(welcomebar_storage===null){ 574var after_trigger=jQuery('.mysticky-welcomebar-fixed').data('after-triger'); 575jQuery('body').addClass('mysticky-welcomebar-apper'); 576if(after_trigger=='after_a_few_seconds'){ 577if($('.mysticky-welcomebar-fixed').hasClass('mysticky-welcomebar-display-desktop')){ 578if($(window).width() > 767){ 579var trigger_sec=jQuery('.mysticky-welcomebar-fixed').data('triger-sec') * 1000; 580var welcombar_position=$('.mysticky-welcomebar-fixed').data('position'); 581var welcombar_height=$('.mysticky-welcomebar-fixed').outerHeight(); 582setTimeout(function(){ 583jQuery('.mysticky-welcomebar-fixed').addClass('mysticky-welcomebar-animation'); 584$('.mysticky-welcomebar-fixed').addClass('entry-effect'); 585if(welcombar_position=='top'){ 586jQuery('.mysticky-welcomebar-fixed').addClass('mysticky-welcomebar-animation'); 587jQuery('.mysticky-welcomebar-fixed').css('top', (adminBarHeight + 0) + 'px'); 588jQuery('.mysticky-welcomebar-fixed').css('opacity', '1'); 589$('html').css('margin-bottom', ''); 590jQuery('#mysticky_divi_style').remove(); 591jQuery('.et_fixed_nav #top-header').css('top', welcombar_height + 'px'); 592jQuery('head').append('<style id="mysticky_divi_style" type="text/css">.et_fixed_nav #main-header {top: ' + welcombar_height + 'px !important}.et_fixed_nav #top-header + #main-header{top: ' + divi_total_height + 'px !important}</style>'); 593$("html").animate({ "margin-top": mysticky_welcomebar_height + "px" }, 1000, function(){ 594$("html").css("cssText", "margin-top:" + mysticky_welcomebar_height + "px!important;"); 595}); 596$('#mysticky-nav').css('top', mysticky_welcomebar_height + 'px'); 597}else{ 598jQuery('.mysticky-welcomebar-fixed').css('bottom', '0'); 599jQuery('.mysticky-welcomebar-fixed').css('opacity', '1'); 600$('html').css('margin-top', ''); 601jQuery('#mysticky_divi_style').remove(); 602jQuery('.et_fixed_nav #top-header').css('top', ''); 603$('html').attr('style', 'margin-bottom: ' + mysticky_welcomebar_height + 'px !important'); 604}}, trigger_sec); 605}} 606} 607if($(window).width() < 767){ 608if(after_trigger=='after_a_few_seconds'){ 609if($('.mysticky-welcomebar-fixed').hasClass('mysticky-welcomebar-display-mobile')){ 610var trigger_sec=jQuery('.mysticky-welcomebar-fixed').data('triger-sec') * 1000; 611var welcombar_position=$('.mysticky-welcomebar-fixed').data('position'); 612var welcombar_height=$('.mysticky-welcomebar-fixed').outerHeight(); 613setTimeout(function(){ 614jQuery('.mysticky-welcomebar-fixed').addClass('mysticky-welcomebar-animation'); 615$('.mysticky-welcomebar-fixed').addClass('entry-effect'); 616jQuery('#mysticky_divi_style').remove(); 617jQuery('.et_fixed_nav #top-header').css('top', ''); 618if(welcombar_position=='top'){ 619jQuery('.mysticky-welcomebar-fixed').css('top',(adminBarHeight + 0) + 'px'); 620jQuery('.mysticky-welcomebar-fixed').css('opacity', '1'); 621$('html').css('margin-bottom', ''); 622$("html").animate({ "margin-top": mysticky_welcomebar_height + "px" }, 1000, function(){ 623$("html").css("cssText", "margin-top:" + mysticky_welcomebar_height + "px!important;"); 624}); 625$('#mysticky-nav').css('top', mysticky_welcomebar_height + 'px'); 626}else{ 627jQuery('.mysticky-welcomebar-fixed').css('bottom', '0'); 628jQuery('.mysticky-welcomebar-fixed').css('opacity', '1'); 629$('html').css('margin-top', ''); 630$('html').attr('style', 'margin-bottom: ' + mysticky_welcomebar_height + 'px !important'); 631}}, trigger_sec); 632}} 633} 634mystickyelements_present(); 635} 636$(window).resize(function(){ 637var mysticky_welcomebar_height=jQuery('.mysticky-welcomebar-fixed').outerHeight(); 638if(welcombar_aftersubmission=='dont_show_welcomebar'){ 639var welcomebar_storage=localStorage.getItem("welcomebar_close"); 640}else if(welcombar_aftersubmission=='show_welcomebar_next_visit'){ 641var welcomebar_storage=sessionStorage.getItem("welcomebar_close"); 642}else{ 643sessionStorage.removeItem('welcomebar_close'); 644localStorage.removeItem('welcomebar_close'); 645var welcomebar_storage=null; 646} 647if(welcomebar_storage===null){ 648var after_trigger=jQuery('.mysticky-welcomebar-fixed').data('after-triger'); 649if(! $('.mysticky-welcomebar-fixed').hasClass('mysticky-welcomebar-notapper')){ 650jQuery('body').addClass('mysticky-welcomebar-apper'); 651}else{ 652jQuery('body').removeClass('mysticky-welcomebar-apper'); 653} 654if(after_trigger=='after_a_few_seconds'){ 655var trigger_sec=jQuery('.mysticky-welcomebar-fixed').data('triger-sec') * 1000; 656var welcombar_position=$('.mysticky-welcomebar-fixed').data('position'); 657var welcombar_height=$('.mysticky-welcomebar-fixed').outerHeight(); 658if($(window).width() < 767){ 659if($('.mysticky-welcomebar-fixed').hasClass('mysticky-welcomebar-display-mobile')){ 660setTimeout(function(){ 661jQuery('.mysticky-welcomebar-fixed').addClass('mysticky-welcomebar-animation'); 662$('.mysticky-welcomebar-fixed').addClass('entry-effect'); 663jQuery('#mysticky_divi_style').remove(); 664jQuery('.et_fixed_nav #top-header').css('top', ''); 665if(welcombar_position=='top'){ 666jQuery('.mysticky-welcomebar-fixed').css('top',(adminBarHeight + 0) + 'px'); 667jQuery('.mysticky-welcomebar-fixed').css('opacity', '1'); 668$('html').css('margin-bottom', ''); 669$("html").animate({ "margin-top": mysticky_welcomebar_height + "px" }, 1000, function(){ 670$("html").css("cssText", "margin-top:" + mysticky_welcomebar_height + "px!important;"); 671}); 672$('.mysticky-welcomebar-apper #mysticky-nav').css('top', mysticky_welcomebar_height + 'px'); 673}else{ 674jQuery('.mysticky-welcomebar-fixed').css('bottom', '0'); 675jQuery('.mysticky-welcomebar-fixed').css('opacity', '1'); 676$('html').css('margin-top', ''); 677$('html').attr('style', 'margin-bottom: ' + mysticky_welcomebar_height + 'px !important'); 678}}, trigger_sec); 679}}else{ 680if($('.mysticky-welcomebar-fixed').hasClass('mysticky-welcomebar-display-desktop')){ 681setTimeout(function(){ 682jQuery('.mysticky-welcomebar-fixed').addClass('mysticky-welcomebar-animation'); 683$('.mysticky-welcomebar-fixed').addClass('entry-effect'); 684if(welcombar_position=='top'){ 685jQuery('.mysticky-welcomebar-fixed').css('top',(adminBarHeight + 0) + 'px'); 686jQuery('.mysticky-welcomebar-fixed').css('opacity', '1'); 687$('html').css('margin-bottom', ''); 688jQuery('#mysticky_divi_style').remove(); 689jQuery('.mysticky-welcomebar-apper.et_fixed_nav #top-header').css('top', welcombar_height + 'px'); 690jQuery('head').append('<style id="mysticky_divi_style" type="text/css">.mysticky-welcomebar-apper.et_fixed_nav #main-header {top: ' + welcombar_height + 'px !important}.mysticky-welcomebar-apper.et_fixed_nav #top-header + #main-header{top: ' + divi_total_height + 'px !important}</style>'); 691$("html").animate({ "margin-top": mysticky_welcomebar_height + "px" }, 1000, function(){ 692$("html").css("cssText", "margin-top:" + mysticky_welcomebar_height + "px!important;"); 693}); 694$('.mysticky-welcomebar-apper #mysticky-nav').css('top', mysticky_welcomebar_height + 'px'); 695}else{ 696jQuery('.mysticky-welcomebar-fixed').css('bottom', '0'); 697jQuery('.mysticky-welcomebar-fixed').css('opacity', '1'); 698$('html').css('margin-top', ''); 699jQuery('#mysticky_divi_style').remove(); 700jQuery('.et_fixed_nav #top-header').css('top', ''); 701$('html').attr('style', 'margin-bottom: ' + mysticky_welcomebar_height + 'px !important'); 702}}, trigger_sec); 703}} 704} 705mystickyelements_present(); 706}}); 707jQuery(window).on('scroll', function(){ 708if(welcombar_aftersubmission=='dont_show_welcomebar'){ 709var welcomebar_storage=localStorage.getItem("welcomebar_close"); 710}else if(welcombar_aftersubmission=='show_welcomebar_next_visit'){ 711var welcomebar_storage=sessionStorage.getItem("welcomebar_close"); 712}else{ 713sessionStorage.removeItem('welcomebar_close'); 714localStorage.removeItem('welcomebar_close'); 715var welcomebar_storage=null; 716} 717if(welcomebar_storage===null){ 718var welcombar_height=$('.mysticky-welcomebar-fixed').outerHeight(); 719var welcombar_position=$('.mysticky-welcomebar-fixed').data('position'); 720if(welcombar_position=='top'){ 721$('#mysticky-nav').css('top', mysticky_welcomebar_height + 'px'); 722} 723if(after_trigger==='after_scroll'){ 724var scroll=100 * $(window).scrollTop() / ($(document).height() - $(window).height()); 725var after_scroll_val=jQuery('.mysticky-welcomebar-fixed').data('triger-sec'); 726var welcombar_position=$('.mysticky-welcomebar-fixed').data('position'); 727var welcombar_height=$('.mysticky-welcomebar-fixed').outerHeight(); 728if(scroll > after_scroll_val){ 729if($('.mysticky-welcomebar-fixed').hasClass('mysticky-welcomebar-display-desktop')){ 730if($(window).width() > 767){ 731jQuery('.mysticky-welcomebar-fixed').addClass('mysticky-welcomebar-animation'); 732$('.mysticky-welcomebar-fixed').addClass('entry-effect'); 733if(welcombar_position=='top'){ 734jQuery('.mysticky-welcomebar-fixed').css('top', (adminBarHeight+ 0) + 'px'); 735jQuery('.mysticky-welcomebar-fixed').css('opacity', '1'); 736$('html').css('margin-bottom', ''); 737$("html").animate({ "margin-top": mysticky_welcomebar_height + "px" }, 1000, function(){ 738$("html").css("cssText", "margin-top:" + mysticky_welcomebar_height + "px!important;"); 739}); 740$('#mysticky-nav').css('top', mysticky_welcomebar_height + 'px'); 741}else{ 742jQuery('.mysticky-welcomebar-fixed').css('bottom', '0'); 743jQuery('.mysticky-welcomebar-fixed').css('opacity', '1'); 744$('html').css('margin-top', ''); 745$('html').attr('style', 'margin-bottom: ' + mysticky_welcomebar_height + 'px !important'); 746}} 747} 748if($('.mysticky-welcomebar-fixed').hasClass('mysticky-welcomebar-display-mobile')){ 749if($(window).width() < 767){ 750jQuery('.mysticky-welcomebar-fixed').addClass('mysticky-welcomebar-animation'); 751$('.mysticky-welcomebar-fixed').addClass('entry-effect'); 752if(welcombar_position=='top'){ 753jQuery('.mysticky-welcomebar-fixed').css('top',(adminBarHeight +0) + 'px'); 754jQuery('.mysticky-welcomebar-fixed').css('opacity', '1'); 755$('html').css('margin-bottom', ''); 756$("html").animate({ "margin-top": mysticky_welcomebar_height + "px" }, 1000, function(){ 757$("html").css("cssText", "margin-top:" + mysticky_welcomebar_height + "px!important;"); 758}); 759$('#mysticky-nav').css('top', mysticky_welcomebar_height + 'px'); 760}else{ 761jQuery('.mysticky-welcomebar-fixed').css('bottom', '0'); 762jQuery('.mysticky-welcomebar-fixed').css('opacity', '1'); 763$('html').css('margin-top', ''); 764$('html').attr('style', 'margin-bottom: ' + mysticky_welcomebar_height + 'px !important'); 765}} 766}} 767} 768mystickyelements_present(); 769}}); 770jQuery('.mysticky-welcomebar-close, .mysticky-welcomebar-btn a').on('click', function(e){ 771if($(this).attr('href')==''){ 772e.preventDefault(); 773} 774var flag=true; 775var trigger_sec=100; 776var welcomebar_widget=0; 777if(jQuery(".mysticky-welcomebar-lead-content").length > 0&&!$(this).hasClass("mysticky-welcomebar-close")){ 778if(jQuery('#contact-lead-name-'+welcomebar_widget).val()!=''&&(jQuery('#contact-lead-phone-'+welcomebar_widget).val()!=''||jQuery('#contact-lead-email-'+welcomebar_widget).val()!='')){ 779if(jQuery('#contact-lead-email-'+welcomebar_widget).css("display")!='none'&&IsEmail(jQuery('#contact-lead-email-'+welcomebar_widget).val())!=true){ 780if($(".input-error").length){ 781$(".input-error").remove(); 782} 783$('<div class="input-error"><span>Please, enter valid email</span></div>').insertAfter(jQuery('#contact-lead-email-' + welcomebar_widget)); 784flag=false; 785} 786if(jQuery('#contact-lead-phone-'+welcomebar_widget).css("display")!='none'&&validatePhone(jQuery('#contact-lead-phone-'+welcomebar_widget).val())!=true){ 787if($(".input-error").length){ 788$(".input-error").remove(); 789} 790$('<div class="input-error"><span>Please, enter valid phone</span></div>').insertAfter(jQuery('#contact-lead-phone-'+welcomebar_widget)); 791flag=false; 792} 793if(flag==true){ 794var data=[]; 795data["contact_name"]=jQuery('#contact-lead-name-'+welcomebar_widget).val(); 796data["contact_email"]=jQuery('#contact-lead-email-'+welcomebar_widget).val(); 797data["contact_phone"]=jQuery('#contact-lead-phone-'+welcomebar_widget).val(); 798data["contact_page_link"]=jQuery('#contact-lead-pagelink-'+welcomebar_widget).val(); 799var s
799ucess_message=$('.mysticky-welcomebar-fixed').data('show-success-message'); 800if(sucess_message==1){ 801$(".mysticky-welcomebar-fixed .mysticky-welcomebar-lead-content").hide(); 802$(".mysticky-welcomebar-fixed .mysticky-welcomebar-content p").hide(); 803$(".mysticky-welcomebar-fixed .mysticky-welcomebar-btn.contact-lead-button").hide(); 804$(".mysticky-welcomebar-fixed .mysticky-welcomebar-thankyou-content").show(); 805$(".mysticky-welcomebar-fixed .mysticky-welcomebar-thankyou-content p").show(); 806} 807var trigger_sec=2000; 808jQuery.ajax({ 809url: welcomebar_frontjs.ajaxurl, 810type:'post', 811data: 'contact_name='+data["contact_name"]+'&contact_email='+data["contact_email"]+'&contact_phone='+data["contact_phone"]+'&action=stickymenu_contact_lead_form&widget_id=' + welcomebar_widget + '&page_link='+ data["contact_page_link"]+'&save_form_lead=1&wpnonce=' + welcomebar_frontjs.ajax_nonce, 812success: function(data){ 813$(".mysticky-welcomebar-widget-"+welcomebar_widget+" .mysticky-welcomebar-fixed-wrap").css("margin-bottom","0"); 814jQuery('#contact-lead-name-'+welcomebar_widget).val(''); 815jQuery('#contact-lead-email-'+welcomebar_widget).val(''); 816jQuery('#contact-lead-phone-'+welcomebar_widget).val(''); 817}, 818}); 819}else{ 820$(".mysticky-welcomebar-widget-"+welcomebar_widget+" .mysticky-welcomebar-fixed-wrap").css("margin-bottom","10px"); 821return false; 822}}else{ 823localStorage.removeItem('welcomebar_close_' + welcomebar_widget); 824sessionStorage.removeItem('welcomebar_close_' + welcomebar_widget); 825if($(".input-error").length){ 826$(".input-error").remove(); 827} 828if(jQuery('#contact-lead-name-'+welcomebar_widget).css("display")!='none'&&jQuery('#contact-lead-name-'+welcomebar_widget).val()==''&&jQuery('#contact-lead-email-'+welcomebar_widget).css("display")!='none'&&jQuery('#contact-lead-email-'+welcomebar_widget).val()==''){ 829$('<div class="input-error"><span>Please enter your name and email</span></div>').insertAfter(jQuery('#contact-lead-name-'+welcomebar_widget)); 830flag=false; 831}else if(jQuery('#contact-lead-name-'+welcomebar_widget).css("display")!='none'&&jQuery('#contact-lead-name-'+welcomebar_widget).val()==''&&jQuery('#contact-lead-phone-'+welcomebar_widget).css("display")!='none'&&jQuery('#contact-lead-phone-'+welcomebar_widget).val()==''){ 832$('<div class="input-error"><span>Please enter your name and phone</span></div>').insertAfter(jQuery('#contact-lead-name-'+welcomebar_widget)); 833flag=false; 834}else if(jQuery('#contact-lead-name-'+welcomebar_widget).css("display")!='none'&&jQuery('#contact-lead-name-'+welcomebar_widget).val()==''){ 835$('<div class="input-error"><span>Please enter your name</span></div>').insertAfter(jQuery('#contact-lead-name-'+welcomebar_widget)); 836flag=false; 837}else if(jQuery('#contact-lead-email-'+welcomebar_widget).css("display")!='none'&&jQuery('#contact-lead-email-'+welcomebar_widget).val()==''){ 838$('<div class="input-error"><span>Please, enter your email</span></div>').insertAfter(jQuery('#contact-lead-email-'+welcomebar_widget)); 839flag=false; 840}else if(jQuery('#contact-lead-phone-'+welcomebar_widget).css("display")!='none'&&jQuery('#contact-lead-phone-'+welcomebar_widget).val()==''){ 841$('<div class="input-error"><span>Please, enter your phone</span></div>').insertAfter(jQuery('#contact-lead-phone-'+welcomebar_widget)); 842flag=false; 843} 844if(flag==false){ 845$(".mysticky-welcomebar-widget-"+welcomebar_widget+" .mysticky-welcomebar-fixed-wrap").css("margin-bottom","10px"); 846}else{ 847$(".mysticky-welcomebar-widget-"+welcomebar_widget+" .mysticky-welcomebar-fixed-wrap").css("margin-bottom","0"); 848} 849return false; 850}}else{ 851if($(this).hasClass("mysticky-welcomebar-close")){ 852localStorage.setItem('is_close_trigger_' + welcomebar_widget, 'yes'); 853}} 854setTimeout(function(){ 855if(welcombar_aftersubmission!='show_welcomebar_every_page'){ 856if(welcombar_aftersubmission=='dont_show_welcomebar'){ 857sessionStorage.removeItem('welcomebar_close'); 858localStorage.setItem('welcomebar_close', 'close'); 859}else if(welcombar_aftersubmission=='show_welcomebar_next_visit'){ 860localStorage.removeItem('welcomebar_close'); 861sessionStorage.setItem('welcomebar_close', 'close'); 862}} 863var welcombar_position=$('.mysticky-welcomebar-fixed').data('position'); 864var welcombar_height=$('.mysticky-welcomebar-fixed').outerHeight(); 865jQuery('.mysticky-welcomebar-fixed').addClass('mysticky-welcomebar-notapper'); 866jQuery('body').removeClass('mysticky-welcomebar-apper');
867jQuery('.mysticky-welcomebar-fixed').slideUp('slow'); 868if(welcombar_position=='top'){ 869jQuery('.mysticky-welcomebar-fixed').css('top', '-' + mysticky_welcomebar_height + 'px'); 870}else{ 871jQuery('.mysticky-welcomebar-fixed').css('bottom', '-' + mysticky_welcomebar_height + 'px'); 872} 873jQuery('#mysticky_divi_style').remove(); 874jQuery('.et_fixed_nav #top-header').css('top', ''); 875jQuery('html').css('margin-top', ''); 876jQuery('html').css('margin-bottom', ''); 877$('#mysticky-nav').css('top', '0px'); 878var mystickyelements_show=$('.mystickyelements-fixed').length; 879if(mystickyelements_show&&$(window).width() <=1024&&$('.mystickyelements-fixed').hasClass('mystickyelements-position-mobile-top')&&welcombar_position=='top'){ 880var mystickyelements_height=$('.mystickyelements-fixed').height(); 881$('.mystickyelements-fixed').css('top', ''); 882$("html").animate({ "margin-top": mystickyelements_height + "px" }, 1000, function(){ 883$("html").css("cssText", "margin-top:" + mystickyelements_height + "px!important;"); 884}); 885}}, trigger_sec); 886jQuery('#contact-lead-name-'+welcomebar_widget).val(''); 887jQuery('#contact-lead-email-'+welcomebar_widget).val(''); 888jQuery('#contact-lead-phone-'+welcomebar_widget).val(''); 889}); 890$('.mysticky-welcomebar-close').on('keydown', function(e){ 891if(e.keyCode=='13'){ 892$(this).trigger('click'); 893}}); 894}); 895function mystickyelements_present(){ 896var after_trigger=jQuery('.mysticky-welcomebar-fixed').data('after-triger'); 897var mystickyelements_show=jQuery('.mystickyelements-fixed').length; 898var welcombar_position=jQuery('.mysticky-welcomebar-fixed').data('position'); 899var adminBarHeight=0; 900if(jQuery("#wpadminbar").length!=0){ 901var adminBarHeight=jQuery('#wpadminbar').height(); 902} 903if(jQuery(window).width() <=600&&jQuery(window).scrollTop()!=0&&welcombar_position=='top'){ 904jQuery('.mysticky-welcomebar-fixed').css('top', '0px'); 905var welcombar_height=jQuery('.mysticky-welcomebar-fixed').outerHeight(); 906if(jQuery('.mysticky-welcomebar-fixed').css('display')==='none'){ 907welcombar_height=0; 908} 909jQuery('#mysticky-nav').css('top', welcombar_height + 'px'); 910}else if(welcombar_position=='top'){ 911var mysticky_welcomebar_height=adminBarHeight + jQuery('.mysticky-welcomebar-fixed').outerHeight(); 912if(jQuery('.mysticky-welcomebar-fixed').css('display')==='none'){ 913mysticky_welcomebar_height=adminBarHeight + 0; 914} 915jQuery('.mysticky-welcomebar-fixed').css('top',(adminBarHeight + 0) + 'px'); 916jQuery('#mysticky-nav').css('top', mysticky_welcomebar_height + 'px'); 917} 918if(mystickyelements_show){ 919var welcombar_height=jQuery('.mysticky-welcomebar-fixed').outerHeight(); 920var mystickyelements_height=jQuery('.mystickyelements-fixed').height(); 921var mystickyelements_total_height=welcombar_height + mystickyelements_height; 922if(jQuery(window).width() <=1024&&jQuery('.mystickyelements-fixed').hasClass('mystickyelements-position-mobile-top')){ 923if(after_trigger=='after_a_few_seconds'){ 924if(jQuery('.mysticky-welcomebar-fixed').hasClass('mysticky-welcomebar-display-mobile')){ 925var trigger_sec=jQuery('.mysticky-welcomebar-fixed').data('triger-sec') * 1000; 926setTimeout(function(){ 927if(welcombar_position=='top'){ 928jQuery('.mystickyelements-fixed').css('top', welcombar_height); 929$("html").animate({ "margin-top": mystickyelements_total_height + "px" }, 1000, function(){ 930$("html").css("cssText", "margin-top:" + mystickyelements_total_height + "px!important;"); 931}); 932}else{ 933jQuery('.mystickyelements-fixed').css('top', ''); 934jQuery('html').attr('style', 'margin-bottom: ' + welcombar_height + 'px !important'); 935}}, trigger_sec); 936}}else if(after_trigger==='after_scroll'){ 937var scroll=100 * $(window).scrollTop() / ($(document).height() - $(window).height()); 938var after_scroll_val=$('.mysticky-welcomebar-fixed').data('triger-sec'); 939if(scroll > after_scroll_val){ 940if(jQuery('.mysticky-welcomebar-fixed').hasClass('mysticky-welcomebar-display-mobile')){ 941if(welcombar_position=='top'){ 942jQuery('.mystickyelements-fixed').css('top', welcombar_height); 943$("html").animate({ "margin-top": mystickyelements_total_height + "px" }, 1000, function(){ 944$("html").css("cssText", "margin-top:" + mystickyelements_total_height + "px!important;"); 945}); 946}else{ 947jQuery('.mystickyelements-fixed').css('top', ''); 948jQuery('html').attr('style', 'margin-bottom: ' + welcombar_height + 'px !important'); 949}} 950}} 951}} 952} 953jQuery(".mysticky-welcomebar-fixed").on("animationend MSAnimationEnd webkitAnimationEnd oAnimationEnd", 954function(){ 955jQuery(this).removeClass("animation-start"); 956} 957); 958jQuery(document).ready(function(){ 959var container=jQuery(".mysticky-welcomebar-fixed"); 960var refreshId=setInterval(function(){ 961container.addClass("animation-start"); 962}, 3500); 963}); 964function IsEmail(email){ 965var regex = 966/^([a-zA-Z0-9_\.\-\+])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/; 967if(!regex.test(email)){ 968return false;
969}else{ 970return true; 971}} 972function validatePhone(txtPhone){ 973var a=txtPhone; 974var filter=/^((\+[1-9]{1,4}[ \-]*)|(\([0-9]{2,3}\)[ \-]*)|([0-9]{2,4})[ \-]*)*?[0-9]{3,4}?[ \-]*[0-9]{3,4}?$/; 975if(filter.test(a)){ 976return true; 977}else{ 978return false; 979}}; 980window.addComment=function(v){var I,C,h,E=v.document,b={commentReplyClass:"comment-reply-link",commentReplyTitleId:"reply-title",cancelReplyId:"cancel-comment-reply-link",commentFormId:"commentform",temporaryFormId:"wp-temp-form-div",parentIdFieldId:"comment_parent",postIdFieldId:"comment_post_ID"},e=v.MutationObserver||v.WebKitMutationObserver||v.MozMutationObserver,r="querySelector"in E&&"addEventListener"in v,n=!!E.documentElement.dataset;function t(){d(),e&&new e(o).observe(E.body,{childList:!0,subtree:!0})}function d(e){if(r&&(I=g(b.cancelReplyId),C=g(b.commentFormId),I)){I.addEventListener("touchstart",l),I.addEventListener("click",l);function t(e){if((e.metaKey||e.ctrlKey)&&13===e.keyCode)return C.removeEventListener("keydown",t),e.preventDefault(),C.submit.click(),!1}C&&C.addEventListener("keydown",t);for(var n,d=function(e){var t=b.commentReplyClass;e&&e.childNodes||(e=E);e=E.getElementsByClassName?e.getElementsByClassName(t):e.querySelectorAll("."+t);return e}(e),o=0,i=d.length;o<i;o++)(n=d[o]).addEventListener("touchstart",a),n.addEventListener("click",a)}}function l(e){var t,n,d=g(b.temporaryFormId);d&&h&&(g(b.parentIdFieldId).value="0",t=d.textContent,d.parentNode.replaceChild(h,d),this.style.display="none",n=(d=(d=g(b.commentReplyTitleId))&&d.firstChild)&&d.nextSibling,d&&d.nodeType===Node.TEXT_NODE&&t&&(n&&"A"===n.nodeName&&n.id!==b.cancelReplyId&&(n.style.display=""),d.textContent=t),e.preventDefault())}function a(e){var t=g(b.commentReplyTitleId),t=t&&t.firstChild.textContent,n=this,d=m(n,"belowelement"),o=m(n,"commentid"),i=m(n,"respondelement"),r=m(n,"postid"),n=m(n,"replyto")||t;d&&o&&i&&r&&!1===v.addComment.moveForm(d,o,i,r,n)&&e.preventDefault()}function o(e){for(var t=e.length;t--;)if(e[t].addedNodes.length)return void d()}function m(e,t){return n?e.dataset[t]:e.getAttribute("data-"+t)}function g(e){return E.getElementById(e)}return r&&"loading"!==E.readyState?t():r&&v.addEventListener("DOMContentLoaded",t,!1),{init:d,moveForm:function(e,t,n,d,o){var i,r,l,a,m,c,s,e=g(e),n=(h=g(n),g(b.parentIdFieldId)),y=g(b.postIdFieldId),p=g(b.commentReplyTitleId),u=(p=p&&p.firstChild)&&p.nextSibling;if(e&&h&&n){void 0===o&&(o=p&&p.textContent),a=h,m=b.temporaryFormId,c=g(m),s=(s=g(b.commentReplyTitleId))?s.firstChild.textContent:"",c||((c=E.createElement("div")).id=m,c.style.display="none",c.textContent=s,a.parentNode.insertBefore(c,a)),d&&y&&(y.value=d),n.value=t,I.style.display="",e.parentNode.insertBefore(h,e.nextSibling),p&&p.nodeType===Node.TEXT_NODE&&(u&&"A"===u.nodeName&&u.id!==b.cancelReplyId&&(u.style.display="none"),p.textContent=o),I.onclick=function(){return!1};try{for(var f=0;f<C.elements.length;f++)if(i=C.elements[f],r=!1,"getComputedStyle"in v?l=v.getComputedStyle(i):E.documentElement.currentStyle&&(l=i.currentStyle),(i.offsetWidth<=0&&i.offsetHeight<=0||"hidden"===l.visibility)&&(r=!0),"hidden"!==i.type&&!i.disabled&&!r){i.focus();break}}catch(e){}return!1}}}}(window); 981"use strict";var extendStatics=function(d,b){return extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)Object.prototype.hasOwnProperty.call(b,p)&&(d[p]=b[p])},extendStatics(d,b)};function __extends(d,b){if("function"!=typeof b&&null!==b)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");function __(){this.constructor=d}extendStatics(d,b),d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)}var __assign=function(){return __assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},__assign.apply(this,arguments)},reactive=function(getter,interval){void 0===interval&&(interval=300);var subs=[],v=getter(),interval_id=setInterval((function(){if(0===subs.length)return;var new_v=getter();if(v===new_v||"object"==typeof v&&JSON.stringify(v)===JSON.stringify(new_v))return;v=new_v;for(var _i=0,subs_1=subs;_i<subs_1.length;_i++){(0,subs_1[_i])(new_v)}}),interval);return{get val(){return v},on_change:function(update){update(v),subs.push(update)},clear:function(){clearInterval(interval_id)}}},StaticOffsets=function(){function StaticOffsets(el,get_root_offset,need_to_calc_offset,get_prev_sibling){void 0===el&&(el=null),void 0===get_root_offset&&(get_root_offset=function(){return Math.round(scrollY+(_this.el?_this.el.getBoundingClientRect().top:0))}),void 0===need_to_calc_offset&&(need_to_calc_offset=function(){return!1}),void 0===get_prev_sibling&&(get_prev_sibling=function(){return null});var _this=this;this.el=el,this.get_root_offset=get_root_offset,this.need_to_calc_offset=need_to_calc_offset,this.get_prev_sibling=get_prev_sibling,this.user_margins={},this.root=0,this.top=0,this.get_top_offset=function(){return _this.get_sibilings_offset(_this.get_prev_sibling,_this.get_prev_sibling(_this.el),_this.user_margins.margin_top)}}return StaticOffsets.prototype.init=function(user_margins){var _this=this;this.user_margins=user_margins,this.top_watcher=reactive(this.get_top_offset),this.top_watcher.on_change((function(top){_this.top=top})),this.root_watcher=reactive(this.get_root_offset),this.root_watcher.on_change((function(root){_this.root=root}))},StaticOffsets.prototype.clear=function(){this.top_watcher&&this.top_watcher.clear(),this.root_watcher&&this.root_watcher.clear()},StaticOffsets.prototype.update=function(){},StaticOffsets.prototype.get_sibilings_offset=function(next,el,offset){if(void 0===offset&&(offset=0),!el)return offset;if(!this.need_to_calc_offset(el))return this.get_sibilings_offset(next,next(el),offset);var _a=getComputedStyle(el),marginTop=_a.marginTop,marginBottom=_a.marginBottom;return this.get_sibilings_offset(next,next(el),offset+el.getBoundingClientRect().height+parseInt(marginTop||"0")+parseInt(marginBottom||"0"))},StaticOffsets}(),DynamicOffsets=function(_super){function DynamicOffsets(el,get_root_offset,need_to_calc_offset,get_prev_sibling,get_next_sibling){void 0===el&&(el=null),void 0===need_to_calc_offset&&(need_to_calc_offset=function(){return!1}),void 0===get_prev_sibling&&(get_prev_sibling=function(){return null}),void 0===get_next_sibling&&(get_next_sibling=function(){return null});
981var _this=_super.call(this,el,get_root_offset,need_to_calc_offset,get_prev_sibling)||this;return _this.get_next_sibling=get_next_sibling,_this.bottom=0,_this.max_top_offset=0,_this.relative_top=0,_this.height=0,_this.position={top:0,bottom:0},_this.border_box=0,_this.get_height=function(){return _this.el?Math.round(Math.max(_this.el.clientHeight,_this.el.getBoundingClientRect().height)):0},_this.get_bottom_offset=function(){return _this.get_sibilings_offset(_this.get_next_sibling,_this.get_next_sibling(_this.el),_this.user_margins.margin_bottom)},_this}return __extends(DynamicOffsets,_super),DynamicOffsets.prototype.init=function(user_margins){var _this=this;_super.prototype.init.call(this,user_margins),this.height_watcher=reactive(this.get_height),this.height_watcher.on_change((function(height){_this.height=height,_this.border_box=_this.get_border_box(),_this.relative_top=_this.get_relative_top()})),this.bottom_offset=reactive(this.get_bottom_offset),this.bottom_offset.on_change((function(bottom){_this.bottom=bottom,_this.relative_top=_this.get_relative_top()}))},DynamicOffsets.prototype.clear=function(){_super.prototype.clear.call(this),this.height_watcher&&this.height_watcher.clear(),this.bottom_offset&&this.bottom_offset.clear()},DynamicOffsets.prototype.update=function(){this.position=this.get_position()},DynamicOffsets.prototype.set_max_offset=function(max_top_offset){this.max_top_offset=max_top_offset,this.relative_top=this.get_relative_top()},DynamicOffsets.prototype.get_position=function(){return this.el&&this.el.parentElement?{top:this.el.offsetTop,bottom:this.el.parentElement.clientHeight-this.el.offsetTop-this.border_box}:{top:0,bottom:0}},DynamicOffsets.prototype.get_border_box=function(){if(!this.el)return 0;var _a=getComputedStyle(this.el),marginTop=_a.marginTop,marginBottom=_a.marginBottom;return this.height+parseInt(marginTop)+parseInt(marginBottom)},DynamicOffsets.prototype.get_relative_top=function(){return this.max_top_offset-this.border_box-this.bottom},DynamicOffsets}(StaticOffsets),StopWidgetClassName="FixedWidget__stop_widget",FixedWidgetClassName="FixedWidget__fixed_widget",BaseWidget=function(){function BaseWidget(el){var _this=this;this.el=el,this.get_root_offset=function(){return Math.round(scrollY+(_this.el?_this.el.getBoundingClientRect().top:0))},this.need_to_calc_el_offset=function(_){return!1},this.offsets=new StaticOffsets(this.el,this.get_root_offset)}return BaseWidget.prototype.mount=function(user_margins){void 0===user_margins&&(user_margins={}),this.offsets.init(user_margins)},BaseWidget.prototype.render=function(_reject){this.offsets.update()},BaseWidget.prototype.unmount=function(){this.offsets.clear()},BaseWidget.prototype.getElement=function(){return this.el},BaseWidget.prototype.toString=function(){var _a;return"".concat(null===(_a=this.el)||void 0===_a?void 0:_a.innerHTML)},BaseWidget.queryAllWidgetsContainers=function(className){return[].concat(Array.from(document.querySelectorAll(".".concat(className))),Array.from(document.querySelectorAll("[data-fixed_widget=".concat(className)))).map((function(el){el.classList.remove(className),el.removeAttribute("data-fixed_widget");var container=getWidgetContainer(el);return container.classList.remove(FixedWidgetClassName),container.classList.remove(StopWidgetClassName),container}))},BaseWidget.from=function(root,className){var _this=this,elements=[];try{elements=Array.from(root.querySelectorAll(":scope > .".concat(className)))}catch(_e){elements=Array.from(root.children).filter((function(e){return e.classList.contains(className)}))}return elements.filter((function(el){return null!==el})).map((function(e){return new _this(e)}))},BaseWidget}(),getWidgetContainer=function(el){if(!el.parentElement)return el;var parentClassNames=el.parentElement.classList.toString();return parentClassNames.includes("sidebar")?el:parentClassNames.includes("wp-block-group")||parentClassNames.includes("wp-block-column")||el.parentElement.classList.contains("widget")?getWidgetContainer(el.parentElement):el},compatabilty_FW_v5=function(selectors){return void 0===selectors&&(selectors=[]),selectors.some((function(s){return!/^[a-z]/i.test(s)}))?selectors:selectors.concat(selectors.map((function(s){return"#".concat(s)})))},queryElements=function(selectors){return void 0===selectors&&(selectors=[]),Array.from(selectors.map((function(selector){return Array.from(document.querySelectorAll(selector))}))).reduce((function(all,elements){return all.concat(elements)}),[]).filter((function(e){return e instanceof HTMLElement}))};function findWithProperty(el,predicate){return el&&el!==document.body?predicate(getComputedStyle(el))?el:findWithProperty(el.parentElement,predicate):null}var PositionWidget=function(_super){function PositionWidget(el){var _this=_
981super.call(this,el)||this;return _this.is_pinned=!1,_this.init_rect={height:0,width:0},_this.init_style={position:"static",marginBottom:"",transition:"",transform:"",marginTop:"",padding:"",width:"",top:""},_this.get_prev_sibling=function(el){return el&&!el.classList.contains(StopWidgetClassName)&&el.previousElementSibling||null},_this.get_next_sibling=function(el){return el&&!el.classList.contains(StopWidgetClassName)?el.nextElementSibling:null},_this.need_to_calc_el_offset=function(el){return el.classList.contains(FixedWidgetClassName)},_this.offsets=new DynamicOffsets(_this.el,_this.get_root_offset,_this.need_to_calc_el_offset,_this.get_prev_sibling,_this.get_next_sibling),_this}return __extends(PositionWidget,_super),PositionWidget.prototype.mount=function(user_margins){var _this=this;_super.prototype.mount.call(this,user_margins),this.el&&this.el.parentElement&&(this.store_style(getComputedStyle(this.el)),this.store_rect(this.el),this.height_watcher=reactive((function(){return _this.el?_this.el.getBoundingClientRect().height:0})))},PositionWidget.prototype.unmount=function(){var _a;_super.prototype.unmount.call(this),this.unpin(),null===(_a=this.height_watcher)||void 0===_a||_a.clear(),this.reset_style(),this.reset_rect()},PositionWidget.prototype.reset_style=function(){if(this.el){for(var prop in this.init_style)this.el.style[prop]="";this.init_style={position:"static",marginBottom:"",transition:"",transform:"",marginTop:"",padding:"",width:"",top:""}}},PositionWidget.prototype.reset_rect=function(){if(this.el){for(var prop in this.init_rect)this.el.style[prop]="";this.init_rect={height:0,width:0}}},PositionWidget.prototype.render=function(reject){_super.prototype.render.call(this,reject),this.on_scroll(Math.round(scrollY),reject)},PositionWidget.from=function(root){return _super.from.call(this,root,FixedWidgetClassName)},PositionWidget.prototype.on_scroll=function(_scroll_top,_reject){throw new Error("Method is not overridden!")},PositionWidget.prototype.pin=function(){!this.is_pinned&&this.el&&(this.is_pinned=!0,this.el.classList.add("FixedWidget__fixed_widget__pinned"))},PositionWidget.prototype.unpin=function(){this.is_pinned&&this.el&&(this.is_pinned=!1,this.el.classList.remove("FixedWidget__fixed_widget__pinned"))},PositionWidget.prototype.store_style=function(style){for(var prop in this.init_style)this.init_style[prop]=style[prop];"relative"===this.init_style.position&&(this.init_style.position="static")},PositionWidget.prototype.set_style=function(style){var _this=this;Object.entries(style).forEach((function(_a){var prop=_a[0],rule=_a[1];_this.el&&(_this.el.style[prop]=rule)}))},PositionWidget.prototype.store_rect=function(el){if(el){var r=el.getBoundingClientRect(),style=getComputedStyle(el);"content-box"==style.boxSizing&&(r.height=r.height-parseInt(style.paddingTop,10)-parseInt(style.paddingBottom,10)-parseInt(style.borderTopWidth,10)-parseInt(style.borderBottomWidth,10),r.width=r.width-parseInt(style.paddingLeft,10)-parseInt(style.paddingRight,10)-parseInt(style.borderLeftWidth,10)-parseInt(style.borderRightWidth,10));var rect={height:r.height,width:r.width};for(var prop in this.init_rect)this.init_rect[prop]=rect[prop]}},PositionWidget.prototype.restore_style=function(){if(this.el)for(var prop in this.init_style)this.el.style[prop]=this.init_style[prop]},PositionWidget.prototype.restore_rect=function(){if(this.el)for(var prop in this.init_rect)this.el.style[prop]="".concat(this.init_rect[prop],"px")},PositionWidget}(BaseWidget),FixedWidget=function(_super){function FixedWidget(el){var _this=_super.call(this,el)||this;return _this.get_root_offset=function(){if(!_this.el)return Number.MAX_VALUE;var top=_this.el.getBoundingClientRect().top,new_root_offset=Math.round(scrollY+top);return 0==scrollY?new_root_offset:(_this.is_pinned?Math.min:Math.max)(_this.offsets.root,new_root_offset)},_this.need_to_calc_el_offset=function(el){return el.classList.contains(FixedWidgetClassName)&&el!==_this.el},_this.el&&_this.el.parentElement?(_this.el.classList.add(FixedWidgetClassName),_this):_this}return __extends(FixedWidget,_super),FixedWidget.prototype.mount=function(margins){var _this=this;_super.prototype.mount.call(this,margins),this.el&&(this.clone(),this.offsets.clear(),this.offsets=new DynamicOffsets(this.clone_el,this.get_root_offset,this.need_to_calc_el_offset,this.get_prev_sibling,this.get_next_sibling),this.offsets.init(margins),this.height_watcher&&this.height_watcher.on_change((function(){_this.store_rect(_this.el),_this.clone_el&&_this.el&&(_this.clone_el.style.height="".concat(_this.init_rect.height,"px"))})))},FixedWidget.prototype.unmount=function(){var _a;_super.prototype.unmount.call(this),null===(_a=this.clone_el)||void 0===_a||_a.remove(),this.clone_el=void 0},FixedWidget.prototype.set_max_offset=function(max_top_offsets){var _this=this,max_top_offset=max_top_offsets.find((function(offset){return 0!==offset&&offset>_this.offsets.root}));max_top_offset&&this.offsets.set_max_offset(max_top_offset)},FixedWidget.prototype.on_scroll=function(scroll_top){if(this.el){var need_to_fix=scroll_top>0&&scroll_top>this.offsets.root-this.offsets.top,top=0!==this.offsets.max_top_offset&&scroll_top>this.offsets.relative_top-this.offsets.top?this.offsets.relative_top-scroll_top:this.offsets.top;need_to_fix?this.fix(top):this.is_pinned&&(this.unpin(),this.restore_style(),this.clone_el&&(this.clone_el.style.display="none"))}},FixedWidget.prototype.clone=function(){var _this=this;if(this.el&&this.el.parentElement&&!this.clone_el){for(var prop in this.clone_el=this.el.cloneNode(!1),this.clone_el.getAttributeNames().forEac
981h((function(attr){_this.clone_el.removeAttribute(attr)})),this.init_style)this.clone_el.style[prop]=this.init_style[prop];this.clone_el.style.display="none",this.el.parentElement.insertBefore(this.clone_el,this.el)}},FixedWidget.prototype.fix=function(top){this.el&&(this.is_pinned?this.el.style.top="".concat(top,"px"):(this.pin(),this.restore_style(),this.restore_rect(),this.set_style({top:"".concat(top,"px"),position:"fixed"}),this.clone_el&&(this.clone_el.style.display="block")))},FixedWidget.new=function(selector){return new FixedWidget(document.querySelector(selector))},FixedWidget.is=function(selector){var el=document.querySelector(selector);return!!el&&el.classList.contains(FixedWidgetClassName)},FixedWidget}(PositionWidget),StickyWidget=function(_super){function StickyWidget(el){var _this=_super.call(this,el)||this;return _this.borderBox=0,_this.margins=0,_this.el&&_this.el.parentElement?(_this.el.classList.add(FixedWidgetClassName),_this):_this}return __extends(StickyWidget,_super),StickyWidget.prototype.mount=function(margins){_super.prototype.mount.call(this,margins),this.el&&(this.el.style.position="sticky",this.el.style.position="-webkit-sticky",this.el.style.transition=/all|transform/.test(this.init_style.transition)?this.init_style.transition:"transform 0s",this.el.style.boxSizing="border-box")},StickyWidget.prototype.set_max_offset=function(max_top_offsets){var _this=this;if(this.el&&this.el.parentElement){var max_top_offset=max_top_offsets.find((function(offset){return _this.el&&offset>_this.el.offsetTop}));max_top_offset&&this.offsets.set_max_offset(max_top_offset)}},StickyWidget.prototype.on_scroll=function(_scroll_top,_reject){if(this.el&&this.el.parentElement){this.offsets.position.top>this.offsets.top?this.pin():this.unpin();var actual_bottom=this.offsets.position.bottom,expected_bottom=this.offsets.max_top_offset?Math.min(this.offsets.max_top_offset-(this.el.parentElement.clientHeight-actual_bottom),actual_bottom):this.offsets.bottom;this.el.style.top="".concat(this.offsets.top,"px"),expected_bottom>=this.offsets.bottom?this.el.style.transform="translateY(0px)":this.el.style.transform="translateY(".concat(expected_bottom-this.offsets.bottom,"px)")}},StickyWidget.new=function(selector){return new StickyWidget(document.querySelector(selector))},StickyWidget.is=function(selector){var el=document.querySelector(selector);return!!el&&el.classList.contains(FixedWidgetClassName)},StickyWidget}(PositionWidget),StopWidget=function(_super){function StopWidget(el){var _this=_super.call(this,el)||this;return _this.need_to_calc_el_offset=function(){return!0},_this.el&&_this.el.parentElement?(_this.el.classList.add(StopWidgetClassName),_this):_this}return __extends(StopWidget,_super),StopWidget.new=function(selector){return new StopWidget(document.querySelector(selector))},StopWidget.is=function(selector){var el=document.querySelector(selector);return!!el&&el.classList.contains(StopWidgetClassName)},StopWidget.from=function(root){return _super.from.call(this,root,StopWidgetClassName)},StopWidget}(BaseWidget),Sidebar=function(){function Sidebar(el,margins,use_sticky_position){void 0===use_sticky_position&&(use_sticky_position=!1);var _this=this;this.el=el,this.margins=margins,this.widgets=[],this.stop_widgets=[],this.isSticky=!1,this.setWidgetsMaxOffset=function(max_offsets){for(var _i=0,_a=_this.widgets;_i<_a.length;_i++){_a[_i].set_max_offset(max_offsets)}_this.render()},this.logWidgetRenderError=function(){console.log("Fixed Widget: fallback to position sticky")},this.onWidgetRenderError=function(w){if(_this.logWidgetRenderError(),w instanceof StickyWidget){w.unmount();var i=_this.widgets.findIndex((function(widget){return w===widget})),widget=new FixedWidget(w.getElement());widget.mount(_this.margins),widget.render(_this.logWidgetRenderError),_this.widgets[i]=widget}}
981;var isDeprecatedFloatMarkup=!!findWithProperty(this.el,(function(style){return"none"!==style.float})),isOverflowHiddenMarkup=!!findWithProperty(this.el,(function(style){return"hidden"===style.overflow}));(isDeprecatedFloatMarkup||isOverflowHiddenMarkup)&&use_sticky_position&&console.log("Fixed Widget: fallback to position sticky"),this.isSticky=!isDeprecatedFloatMarkup&&!isOverflowHiddenMarkup&&use_sticky_position;var WidgetContructor=this.isSticky?StickyWidget:FixedWidget;this.stop_widgets=StopWidget.from(this.el),this.widgets=WidgetContructor.from(this.el),this.offsets=new DynamicOffsets(this.el),this.isSticky&&(this.el.style.position="relative",0===this.stop_widgets.length&&(this.el.style.minHeight="100%"))}return Sidebar.prototype.mount=function(){var _this=this;this.offsets.clear(),this.max_offset_watcher&&this.max_offset_watcher.clear(),this.offsets.init(this.margins),this.stop_widgets.forEach((function(widget){widget.mount()})),this.widgets.forEach((function(widget){widget.mount(_this.margins)})),this.widgets=this.widgets.sort((function(a,b){return a.offsets.root-b.offsets.root}))},Sidebar.prototype.set_max_offset=function(general_stop_widgets){var is_local_stop_widgets=0!=this.stop_widgets.length,use_top_offset=this.isSticky&&is_local_stop_widgets,stop_widgets=is_local_stop_widgets?this.stop_widgets:general_stop_widgets;this.max_offset_watcher=reactive((function(){return 0===stop_widgets.length?[Math.round(document.body.scrollHeight)]:stop_widgets.map((function(widget){return Math.round(use_top_offset?widget.offsets.top:widget.offsets.root)})).sort()})),this.max_offset_watcher.on_change(this.setWidgetsMaxOffset)},Sidebar.prototype.render=function(){for(var _i=0,_a=this.stop_widgets;_i<_a.length;_i++){_a[_i].render(this.logWidgetRenderError)}for(var _b=0,_c=this.widgets;_b<_c.length;_b++){_c[_b].render(this.onWidgetRenderError)}},Sidebar.prototype.unmount=function(){for(var _i=0,_a=this.stop_widgets;_i<_a.length;_i++){_a[_i].unmount()}for(var _b=0,_c=this.widgets;_b<_c.length;_b++){_c[_b].unmount()}},Sidebar}(),Sidebars=function(){function Sidebars(elements,options){var _this=this;this.data=[],this.render=function(){for(var _i=0,_a=_this.data;_i<_a.length;_i++){_a[_i].render()}},this.data=Array.from(new Set(elements.map((function(widget){return widget.parentElement})))).filter((function(sidebar_el){return null!==sidebar_el})).map((function(sidebar_el){return new Sidebar(sidebar_el,{margin_bottom:options.margin_bottom,margin_top:options.margin_top},options.use_sticky_position)}))}return Sidebars.prototype.mount=function(){this.data.forEach((function(sidebar){sidebar.mount()})),this.set_max_offset()},Sidebars.prototype.unmonut=function(){this.data.forEach((function(sidebar){sidebar.unmount()}))},Sidebars.prototype.set_max_offset=function(){for(var general_stop_widgets=this.getGeneralStopElements(),_i=0,_a=this.data;_i<_a.length;_i++){_a[_i].set_max_offset(general_stop_widgets)}},Sidebars.prototype.getGeneralStopElements=function(){return this.data.filter((function(sidebar){return!sidebar.isSticky||0===sidebar.widgets.length})).map((function(sidebar){return sidebar.stop_widgets})).reduce((function(all,widgets){return all.concat(widgets)}),[])},Sidebars.new=function(options){var s,arr1,arr2,fixedWidgetsContainers=Array.from(new Set(BaseWidget.queryAllWidgetsContainers(FixedWidgetClassName).concat(queryElements(compatabilty_FW_v5(options.widgets))))),stopWidgetsSelectors=compatabilty_FW_v5((void 0===(s=options.stop_elements_selectors||options.stop_id)&&(s=""),s.replace(/[\r\n]|[\r]/gi,"\n").split("\n").map((function(s){return s.trim()})).filter((function(s){return""!==s})))),stopWidgetsContainers=Array.from(new Set(BaseWidget.queryAllWidgetsContainers(StopWidgetClassName).concat(queryElements(stopWidgetsSelectors)))),_a=(arr1=fixedWidgetsContainers,[(arr2=stopWidgetsContainers).filter((function(e){return!arr1.includes(e)})),arr1.filter((function(e){return arr2.includes(e)}))]),stopWidgetsUniqContainers=_a[0];return _a[1].forEach((function(w){console.error("The Widget is detected as fixed block and stop block!\n".concat(w.innerHTML))}
981)),fixedWidgetsContainers.forEach((function(c){c.classList.add(FixedWidgetClassName)})),stopWidgetsUniqContainers.forEach((function(c){c.classList.add(StopWidgetClassName)})),new Sidebars(fixedWidgetsContainers.concat(stopWidgetsUniqContainers).filter((function(container){var hasNestedWidget=container.innerHTML.includes(FixedWidgetClassName)||container.innerHTML.includes(StopWidgetClassName);return hasNestedWidget&&console.warn("Fixed Widget: Detected nested widget in ",container),!hasNestedWidget})),options)},Sidebars}(),Plugin=function Plugin(options,version){void 0===options&&(options=[]),Plugin.version=version,Plugin.sidebars?Plugin.sidebars.render():(Plugin.sidebars=Sidebars.new(options.reduce((function(prev,cur){return __assign(__assign(__assign({},prev),cur),{stop_elements_selectors:"".concat(prev.stop_elements_selectors,"\n").concat(cur.stop_elements_selectors),widgets:(prev.widgets||[]).concat(cur.widgets||[])})}))),document.addEventListener("scroll",Plugin.sidebars.render),window.addEventListener("resize",(function(){Plugin.sidebars.unmonut(),setTimeout((function(){Plugin.sidebars.mount(),Plugin.sidebars.render()}))})),Plugin.sidebars.mount())};function onDocumentLoaded(){var admin_panel=document.querySelector("#wpadminbar"),options=(window.q2w3_sidebar_options||[{}]).map((function(option){return option.margin_top=(option.margin_top||0)+(admin_panel&&admin_panel.clientHeight||0),option}));options.some((function(option){return option.screen_max_width&&document.body.clientWidth<option.screen_max_width||option.screen_max_height&&document.body.clientHeight<option.screen_max_height}))||new Plugin(options,"6.0.7-20")}document.addEventListener("DOMContentLoaded",onDocumentLoaded),"complete"===document.readyState&&onDocumentLoaded();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.