File: /var/www/html/wpprm_old/wp-content/themes/ronneby/assets/js/odometer.min.js
/*! odometer 0.4.7 */
(function(){var l,t,s,u,A,o,d,i,p,n,e,c,H,r,a,h,m,f,g=[].slice;l=/^\(?([^)]*)\)?(?:(.)(D*)(d*))?$/,e=document.createElement("div").style,u=null!=e.transition||null!=e.webkitTransition||null!=e.mozTransition||null!=e.oTransition,p=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame,t=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver,o=function(t){var e;return(e=document.createElement("div")).innerHTML=t,e.children[0]},i=function(t,e){return t.className=t.className.replace(new RegExp("(^| )"+e.split(" ").join("|")+"( |$)","gi")," ")},A=function(t,e){return i(t,e),t.className+=" "+e},c=function(t,e){var n;return null!=document.createEvent?((n=document.createEvent("HTMLEvents")).initEvent(e,!0,!0),t.dispatchEvent(n)):void 0},d=function(){var t,e;return null!=(t=null!=(e=window.performance)&&"function"==typeof e.now?e.now():void 0)?t:+new Date},n=function(t,e){return null==e&&(e=0),e?(t*=Math.pow(10,e),t+=.5,t=Math.floor(t),t/=Math.pow(10,e)):Math.round(t)},a=!(H=function(t){return t<0?Math.ceil(t):Math.floor(t)}),(r=function(){var t,e,n,i,o;if(!a&&null!=window.jQuery){for(a=!0,o=[],e=0,n=(i=["html","text"]).length;e<n;e++)t=i[e],o.push(function(t){var n;return n=window.jQuery.fn[t],window.jQuery.fn[t]=function(t){var e;return null==t||null==(null!=(e=this[0])?e.odometer:void 0)?n.apply(this,arguments):this[0].odometer.update(t)}}(t));return o}})(),setTimeout(r,0),(s=function(){function h(t){var e,n,i,o,r,s,a,u,d,l=this;if(this.options=t,this.el=this.options.el,null!=this.el.odometer)return this.el.odometer;for(e in this.el.odometer=this,a=h.options)i=a[e],null==this.options[e]&&(this.options[e]=i);null==(o=this.options).duration&&(o.duration=2e3),this.MAX_VALUES=this.options.duration/(1e3/30)/2|0,this.resetFormat(),this.value=this.cleanValue(null!=(u=this.options.value)?u:""),this.renderInside(),this.render();try{for(r=0,s=(d=["innerHTML","innerText","textContent"]).length;r<s;r++)n=d[r],null!=this.el[n]&&function(e){Object.defineProperty(l.el,e,{get:function(){var t;return"innerHTML"===e?l.inside.outerHTML:null!=(t=l.inside.innerText)?t:l.inside.textContent},set:function(t){return l.update(t)}})}(n)}catch(t){t,this.watchForMutations()}}return h.prototype.renderInside=function(){return this.inside=document.createElement("div"),this.inside.className="odometer-inside",this.el.innerHTML="",this.el.appendChild(this.inside)},h.prototype.watchForMutations=function(){var n=this;if(null!=t)try{return null==this.observer&&(this.observer=new t(function(t){var e;return e=n.el.innerText,n.renderInside(),n.render(n.value),n.update(e)})),this.watchMutations=!0,this.startWatchingMutations()}catch(t){t}},h.prototype.startWatchingMutations=function(){return this.watchMutations?this.observer.observe(this.el,{childList:!0}):void 0},h.prototype.stopWatchingMutations=function(){var t;return null!=(t=this.observer)?t.disconnect():void 0},h.prototype.cleanValue=function(t){var e;return"string"==typeof t&&(t=(t=(t=t.replace(null!=(e=this.format.radix)?e:".","<radix>")).replace(/[.,]/g,"")).replace("<radix>","."),t=parseFloat(t,10)||0),n(t,this.format.precision)},h.prototype.bindTransitionEnd=function(){var t,e,n,i,o,r,s=this;if(!this.transitionEndBound){for(this.transitionEndBound=!0,e=!1,r=[],n=0,i=(o="transitionend webkitTransitionEnd oTransitionEnd otransitionend MSTransitionEnd".split(" ")).length;n<i;n++)t=o[n],r.push(this.el.addEventListener(t,function(){return e||(e=!0,setTimeout(function(){return s.render(),e=!1,c(s.el,"odometerdone")},0)),!0},!1));return r}},h.prototype.resetFormat=function(){var t,e,n,i,o,r,s,a,u,d;if((t=null!=(u=this.options.format)?u:"(,ddd).dd")||(t="d"),!(o=l.exec(t)))throw new Error("Odometer: Unparsable digit format");return a=(d=o.slice(1,5))[0],s=d[1],n=d[2],i=d[3],r=(e=(null!=n?n.length:void 0)||0)+(null!=i?i.length:void 0)||0,this.format={repeating:a,radix:s,precision:r,fractional:e}},h.prototype.render=function(t){var e,n,i,o,r,s,a;for(null==t&&(t=this.value),this.stopWatchingMutations(),this.resetFormat(),this.inside.innerHTML="",r=this.options.theme,o=[],s=0,a=(e=this.el.className.split(" ")).length;s<a;s++)(n=e[s]).length&&((i=/^odometer-theme-(.+)$/.exec(n))?r=i[1]:/^odometer(-|$)/.test(n)||o.push(n));return o.push("odometer"),u||o.push("odometer-no-transitions"),r?o.push("odometer-theme-"+r):o.push("odometer-auto-theme"),this.el.className=o.join(" "),this.ribbons={},this.formatDigits(t),this.startWatchingMutations()},h.prototype.formatDigits=function(t){var e,n,i,o,r,s,a,u,d,l,h;if(this.digits=[],this.options.formatFunction)for(a=0,d=(l=this.options.formatFunction(t).split("").reverse()).length;a<d;a++)(s=l[a]).match(/[0-9]/)?((e=this.renderDigit()).querySelector(".odometer-value").innerHTML=s,this.digits.push(e),this.insertDigit(e)):this.addSpacer(s);else{for(r=Math.abs(t),(n=Math.max(this.format.fractional,this.getFractionalDigitCount(r)))&&(r=Math.round(r*Math.pow(10,n))),i=0;0<r;)this.addDigit((r%10).toString(),n<=i),r=Math.floor(r/10),(i+=1)===n&&this.addDigit(".",!0);for(o=null!=(h=this.options.minIntegerLen)?h:0,i=u=i-n;u<o;i=u+=1)this.addDigit(0,!0);t<0&&this.addDigit("-",!0)}},h.prototype.update=function(t){var e,n=this;return(e=(t=this.cleanValue(t))-this.value)?(i(this.el,"odometer-animating-up odometer-animating-down odometer-animating"),A(this.el,0<e?"odometer-animating-up":"odometer-animating-down"),this.stopWatchingMutations(),this.animate(t),this.startWatchingMutations(),setTimeout(function(){return n.el.offsetHeight,A(n.el,"odometer-animating")},0),this.value=t):void 0},h.prototype.renderDigit=function(){return o('<span class="odometer-digit"><span class="odometer-digit-spacer">8</span><span class="odometer-digit-inner"><span class="odometer-ribbon"><span class="odometer-ribbon-inner"><span class="odometer-value"></span></span></span></span></span>')},h.prototype.insertDigit=function(t,e){return null!=e?this.inside.insertBefore(t,e):this.inside.children.length?this.inside.insertBefore(t,this.inside.children[0]):this.inside.appendChild(t)},h.prototype.addSpacer=function(t,e,n){var i;return(i=o('<span class="odometer-formatting-mark"></span>')).innerHTML=t,n&&A(i,n),this.insertDigit(i,e)},h.prototype.addDigit=function(t,e){var n,i,o,r;if(null==e&&(e=!0),"-"===t)return this.addSpacer(t,null,"odometer-negation-mark");if("."===t)return this.addSpacer(null!=(r=this.format.radix)?r:".",null,"odometer-radix-mark");if(e)for(o=!1;;){if(!this.format.repeating.length){if(o)throw new Error("Bad odometer format without digits");this.resetFormat(),o=!0}if(n=this.format.repeating[this.format.repeating.length-1],this.format.repeating=this.format.repeating.substring(0,this.format.repeating.length-1),"d"===n)break;this.addSpacer(n)}return(i=this.renderDigit()).querySelector(".odometer-value").innerHTML=t,this.digits.push(i),this.insertDigit(i)},h.prototype.animate=function(t){return u&&"count"!==this.options.animation?this.animateSlide(t):this.animateCount(t)},h.prototype.animateCount=function(n){var i,o,r,s,a,u=this;if(o=+n-this.value)return s=r=d(),i=this.value,(a=function(){var t,e;return d()-s>u.options.duration?(u.value=n,u.render(),void c(u.el,"odometerdone")):(50<(t=d()-r)&&(r=d(),e=t/u.options.duration,i+=o*e,u.render(Math.round(i))),null!=p?p(a):setTimeout(a,50))})()},h.prototype.getDigitCount=function(){var t,e,n,i,o,r;for(t=o=0,r=(i=1<=arguments.length?g.call(arguments,0):[]).length;o<r;t=++o)n=i[t],i[t]=Math.abs(n);return e=Math.max.apply(Math,i),Math.ceil(Math.log(e+1)/Math.log(10))},h.prototype.getFractionalDigitCount=function(){var t,e,n,i,o,r,s;for(e=/^\-?\d*\.(\d*?)0*$/,t=r=0,s=(o=1<=arguments.length?g.call(arguments,0):[]).length;r<s;t=++r)i=o[t],o[t]=i.toString(),n=e.exec(o[t]),o[t]=null==n?0:n[1].length;return Math.max.apply(Math,o)},h.prototype.resetDigits=function(){return this.digits=[],this.ribbons=[],this.inside.innerHTML="",this.resetFormat()},h.prototype.animateSlide=function(t){var e,n,i,o,r,s,a,u,d,l,h,p,c,m,f,g,v,M,w,y,b,T,x,E,D,L,S,F,C;if(v=this.value,(u=Math.max(this.format.fractional,this.getFractionalDigitCount(v,t)))&&(t=Math.round(t*Math.pow(10,u)),v=Math.round(v*Math.pow(10,u))),i=t-v){for(this.bindTransitionEnd(),f=null!=(S=this.options.minIntegerLen)?S:0,o=Math.max(this.getDigitCount(v,t),f+u),r=[],h=y=e=0;0<=o?y<o:o<y;h=0<=o?++y:--y){if(M=H(v/Math.pow(10,o-h-1)),s=(a=H(t/Math.pow(10,o-h-1)))-M,Math.abs(s)>this.MAX_VALUES){for(l=[],p=s/(this.MAX_VALUES+this.MAX_VALUES*e*.5),n=M;0<s&&n<a||s<0&&a<n;)l.push(Math.round(n)),n+=p;l[l.length-1]!==a&&l.push(a),e++}else l=function(){C=[];for(var t=M;M<=a?t<=a:a<=t;M<=a?t++:t--)C.push(t);return C}.apply(this);for(h=b=0,x=l.length;b<x;h=++b)d=l[h],l[h]=Math.abs(d%10);r.push(l)}for(this.resetDigits(),h=T=0,E=(F=r.reverse()).length;T<E;h=++T)for(l=F[h],this.digits[h]||this.addDigit(" ",u<=h),null==(w=this.ribbons)[h]&&(w[h]=this.digits[h].querySelector(".odometer-ribbon-inner")),this.ribbons[h].innerHTML="",i<0&&(l=l.reverse()),c=L=0,D=l.length;L<D;c=++L)d=l[c],(g=document.createElement("div")).className="odometer-value",g.innerHTML=d,this.ribbons[h].appendChild(g),c===l.length-1&&A(g,"odometer-last-value"),0===c&&A(g,"odometer-first-value");return M<0&&this.addDigit("-"),null!=(m=this.inside.querySelector(".odometer-radix-mark"))&&m.parent.removeChild(m),u?this.addSpacer(this.format.radix,this.digits[u-1],"odometer-radix-mark"):void 0}},h}()).options=null!=(m=window.odometerOptions)?m:{},setTimeout(function(){var t,e,n,i,o;if(window.odometerOptions){for(t in o=[],i=window.odometerOptions)e=i[t],o.push(null!=(n=s.options)[t]?(n=s.options)[t]:n[t]=e);return o}},0),s.init=function(){var t,e,n,i,o,r;if(null!=document.querySelectorAll){for(r=[],n=0,i=(e=document.querySelectorAll(s.options.selector||".odometer")).length;n<i;n++)t=e[n],r.push(t.odometer=new s({el:t,value:null!=(o=t.innerText)?o:t.textContent}));return r}},null!=(null!=(f=document.documentElement)?f.doScroll:void 0)&&null!=document.createEventObject?(h=document.onreadystatechange,document.onreadystatechange=function(){return"complete"===document.readyState&&!1!==s.options.auto&&s.init(),null!=h?h.apply(this,arguments):void 0}):document.addEventListener("DOMContentLoaded",function(){return!1!==s.options.auto?s.init():void 0},!1),"function"==typeof define&&define.amd?define(["jquery"],function(){return s}):"undefined"!=typeof exports&&null!==exports?module.exports=s:window.Odometer=s}).call(this);
odometerOptions = { auto: false }; // Disables auto-initialization
(function($) {
if (typeof $.fn.waypoint !== 'undefined') {
$('.facts-number').each(function () {
var $this = $(this);
var $anim = $this.data('animation');
if(!$this.hasClass('disable-animation')) {
if ('count' == $anim){
var odometer = new Odometer({el: $this[0], animation: 'count' });
} else {
var odometer = new Odometer({el: $this[0]});
}
$(this).on('on-waypoin', function () {
odometer.update($(this).data('max'));
});
}
});
}
})(jQuery);