var strict;
/*!------------------------------------------------------
 * jQuery nearest v1.0.3
 * http://github.com/jjenzz/jQuery.nearest
 * ------------------------------------------------------
 * Copyright (c) 2012 J. Smith (@jjenzz)
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 */!function(e,t){e.fn.nearest=function(n){var s,i,r,a,o,h=t.querySelectorAll;function update(t){i=i?i.add(t):e(t)}return this.each((function(){s=this,e.each(n.split(","),(function(){if((a=e.trim(this)).indexOf("#"))for(o=s.parentNode;o;){if((r=h?o.querySelectorAll(a):e(o).find(a)).length){update(r);break}o=o.parentNode}else update(h?t.querySelectorAll(a):e(a))}))})),i||e()}}(jQuery,document),jQuery(document).ready((function(e){(navigator.userAgent.match(/(iPhone)/i)||navigator.userAgent.match(/(Android)/i))&&e(".mashicon-whatsapp").show();function mashsb_is_rate_limit(){if(void 0===mashsb.servertime)return!0;var e=Number(mashsb.servertime);return Math.floor(Date.now()/1e3)>e+30?(console.log("rate limited: "+(e+30)),!0):(console.log("not rate limited: "+(e+30)),!1)}function roundShares(e){if("undefined"!=typeof mashsb&&1==mashsb.round_shares){if(e>1e6)return shares=Math.round(e/1e6*10)/10+"M",shares;if(e>1e3)return shares=Math.round(e/1e3*10)/10+"k",shares}return e.toFixed(0)}e("body").off("click",".mashicon-pinterest").on("click",".mashicon-pinterest",(function(t){t.preventDefault(),console.log("preventDefault:"+t),winWidth=520,winHeight=350;var n=screen.height/2-winHeight/2,s=screen.width/2-winWidth/2,i=e(this).attr("data-mashsb-url");window.open(i,"sharer","top="+n+",left="+s+",toolbar=0,status=0,width="+winWidth+",height="+winHeight+",resizable=yes")})),""==e(".mashsbcount").text()&&e(".mashsbcount").text(0),function mashsb_check_cache(){if(mashsb_is_rate_limit())return!1;setTimeout((function(){"1"==mashsb.refresh&&function mashsb_update_cache(){var e=window.location.href;e.indexOf("?")>-1?e+="&mashsb-refresh":e+="?mashsb-refresh";var t=new XMLHttpRequest;t.open("GET",e,!0),t.send()}()}),6e3)}(),e(".onoffswitch").on("click",(function(){var t=e(this).parents(".mashsb-container");t.find(".onoffswitch").hide(),t.find(".secondary-shares").show(),t.find(".onoffswitch2").show()})),e(".onoffswitch2").on("click",(function(){var t=e(this).parents(".mashsb-container");t.find(".onoffswitch").show(),t.find(".secondary-shares").hide()})),"undefined"==typeof lashare_fb&&"undefined"!=typeof mashsb&&e(".mashicon-facebook").click((function(t){winWidth=520,winHeight=550;var n=screen.height/2-winHeight/2,s=screen.width/2-winWidth/2,i=e(this).attr("href");return window.open(i,"sharer","top="+n+",left="+s+",toolbar=0,status=0,width="+winWidth+",height="+winHeight),t.preventDefault(),!1})),"undefined"!=typeof mashsb&&e(".mashicon-twitter").click((function(t){winWidth=520,winHeight=350;var n=screen.height/2-winHeight/2,s=screen.width/2-winWidth/2,i=e(this).attr("href");return"1"===mashsb.twitter_popup&&window.open(i,"sharer","top="+n+",left="+s+",toolbar=0,status=0,width="+winWidth+",height="+winHeight),t.preventDefault(),!1})),"undefined"!=typeof mashsb&&"content"===mashsb.subscribe&&(e(".mashicon-subscribe").not(".trigger_active").nearest(".mashsb-toggle-container").hide(),e(".mashicon-subscribe").click((function(){var t=e(this);return t.hasClass("trigger_active")?(e(t).nearest(".mashsb-toggle-container").slideToggle("fast"),t.removeClass("trigger_active")):(e(".trigger_active").nearest(".mashsb-toggle-container").slideToggle("slow"),e(".trigger_active").removeClass("trigger_active"),e(t).nearest(".mashsb-toggle-container").slideToggle("fast"),t.addClass("trigger_active")),!1}))),"undefined"!=typeof mashsb&&"link"===mashsb.subscribe&&e(".mashicon-subscribe").click((function(){var t=mashsb.subscribe_url;e(this).attr("href",t)})),function(e){e.fn.countTo=function(t){return t=t||{},e(this).each((function(){var n=e.extend({},e.fn.countTo.defaults,{from:e(this).data("from"),to:e(this).data("to"),speed:e(this).data("speed"),refreshInterval:e(this).data("refresh-interval"),decimals:e(this).data("decimals")},t),s=Math.ceil(n.speed/n.refreshInterval),i=(n.to-n.from)/s,r=this,a=e(this),o=0,h=n.from,c=a.data("countTo")||{};function render(e){var t=n.formatter.call(r,e,n);a.text(t)}a.data("countTo",c),c.interval&&clearInterval(c.interval),c.interval=setInterval((function updateTimer(){o++,render(h+=i),"function"==typeof n.onUpdate&&n.onUpdate.call(r,h);o>=s&&(a.removeData("countTo"),clearInterval(c.interval),h=n.to,"function"==typeof n.onComplete&&n.onComplete.call(r,h))}),n.refreshInterval),render(h)}))},e.fn.countTo.defaults={from:0,to:0,speed:1e3,refreshInterval:100,decimals:0,formatter:roundShares,onUpdate:null,onComplete:null}}(jQuery),"undefined"!=typeof mashsb&&1==mashsb.animate_shares&&e(".mashsbcount").length&&e(".mashsbcount").countTo({from:0,to:mashsb.shares,speed:1e3,refreshInterval:100})}));