window.wp=window.wp||{};(function(a){var b=function(){var s=this,e,c,A,m=typeof pagenow!="undefined"?pagenow:"",B,z=0,w={},C,h=0,i,q,x,f=true,p,j,g,v=-1;this.url=typeof ajaxurl!="undefined"?ajaxurl:"wp-admin/admin-ajax.php";this.autostart=true;if(typeof(window.heartbeatSettings!="undefined")){B=a.extend({},window.heartbeatSettings);window.heartbeatSettings=null;A=B.nonce||"";delete B.nonce;C=B.interval||15;delete B.interval;if(C<5){C=5}else{if(C>60){C=60}}C=C*1000;m=m||B.screenid||"site";delete B.screenid;a.extend(this,B)}function k(E){if(E){return parseInt((new Date()).getTime()/1000)}return(new Date()).getTime()}function y(F){try{if(F.contentWindow.document){return true}}catch(E){}return false}function u(){var E;if(h){E=k()-h,duration=f?120000:360000;if(E>duration){s.connectionLost=true;a(document).trigger("heartbeat-connection-lost",parseInt(E/1000))}else{if(s.connectionLost){s.connectionLost=false;a(document).trigger("heartbeat-connection-restored")}}}}function d(){var E={};z=k();E.data=a.extend({},w);a(document).trigger("heartbeat-send",[E.data]);E.interval=C/1000;E._nonce=A;E.action="heartbeat";E.screenid=m;E.has_focus=f;i=true;s.xhr=a.post(s.url,E,"json").done(function(H,I,G){var F;w={};h=k();if(s.connectionLost){u()}F=H.heartbeat_interval;delete H.heartbeat_interval;s.tick(H,I,G);if(F){s.interval.apply(s,H.heartbeat_interval)}}).always(function(){i=false;t()}).fail(function(G,H,F){u();s.error(G,H,F)})}function t(){var F=k()-z,E=C;if(!e){return}if(!f){E=120000}else{if(q&&x){E=x;q--}}window.clearTimeout(c);if(F300000&&f){o()}if(!j){a(document).on("mouseover.wp-heartbeat-active keyup.wp-heartbeat-active",function(){D()});a("iframe").each(function(F,G){if(!y(G)){return}a(G.contentWindow).on("mouseover.wp-heartbeat-active keyup.wp-heartbeat-active",function(){D()})});j=true}}window.setInterval(function(){l()},30000);if(this.autostart){a(document).ready(function(){e=true;z=k();t()})}this.winHasFocus=function(){return f};this.interval=function(G,F){var E,H;if(G){switch(G){case"fast":H=5;q=parseInt(F)||30;break;case"slow":H=60;q=parseInt(F)||0;break;case"long-polling":C=0;return 0;break;default:H=15;q=0}E=H*1000