var ToxProgressBar=function(a){this.element=a;this.size=+a.dataset.size;this.thickness=+a.dataset.thickness;this.color=a.dataset.color;this.backgroundColor=a.dataset.background;this.progress=a.dataset.progress;this.speed=+a.dataset.speed};ToxProgressBar.prototype.create=function(){var a=this.element.querySelector(".tox-progress-content");this.element.style.width=this.size+"px";this.element.style.height=this.size+"px";this.element.innerHTML='<div style="width:'+this.size+"px;height:"+this.size+'px;">   <div class="radial-outer" style="background-color: '+this.color+"; width: "+this.size+"px; height: "+this.size+'px"></div>   <div class="radial-mask-1" style="border-top-left-radius: '+((this.size/2)+2)+"px; border-top-right-radius: "+((this.size/2)+2)+"px; background-color: "+this.backgroundColor+"; width: "+(this.size+2)+"px; height: "+((this.size/2)+2)+"px; top: -"+((this.size)+2)+'px;left:-1px;"></div>   <div class="radial-mask-2" style="border-top-left-radius: '+((this.size/2)+2)+"px; border-top-right-radius: "+((this.size/2)+2)+"px; background-color: "+this.backgroundColor+"; width: "+(this.size+2)+"px; height: "+((this.size/2)+2)+"px; top: -"+(((this.size)+this.size/2)+4)+'px;left:-1px;"></div>   <div class="radial-mask-3" style="visibility: hidden; border-top-left-radius: '+((this.size/2)+2)+"px; border-top-right-radius: "+((this.size/2)+2)+"px; background-color: "+this.color+"; width: "+this.size+"px; height: "+(this.size/2)+"px;top: -"+((this.size*2)+4)+'px;"></div>   <div class="radial-inner" style="background-color: '+this.backgroundColor+"; width: "+(this.size-(this.thickness*2))+"px; height: "+(this.size-(this.thickness*2)+2)+"px; top: -"+((this.size)*2.5-this.thickness+6)+"px; left: "+this.thickness+'px"></div></div>'+(a?('<div class="'+a.className+'" data-vcenter="'+a.dataset.vcenter+'" style="'+(a.dataset.vcenter==="true"?("display: flex; align-items: center;"):"")+"top: "+-this.size+"px;width:"+this.size+"px;height:"+this.size+'px;">'+(a?a.innerHTML:"")+"</div>"):"")};ToxProgressBar.prototype.animate=function(){var b=this.element;var c=this.speed;var a=this.progress;if(a>50){b.querySelector(".radial-mask-1").style.transition="transform "+(c/2)+"ms ease-in";b.querySelector(".radial-mask-2").style.transition="transform "+(c*((a-50)/100))+"ms ease-out"}else{b.querySelector(".radial-mask-1").style.transition="transform "+(c*(a/100))+"ms ease-in"}setTimeout(function(){if(a>50){b.querySelector(".radial-mask-1").style.transform="rotate(270deg)";setTimeout(function(){b.querySelector(".radial-mask-1").style.visibility="hidden";b.querySelector(".radial-mask-2").style.transform="rotate("+(90+(a*3.6))+"deg)";b.querySelector(".radial-mask-3").style.visibility="visible";if(+a===100){setTimeout(function(){b.querySelector(".radial-mask-2").style.visibility="hidden"},c/2)}},c/2)}else{b.querySelector(".radial-mask-1").style.transform="rotate("+(90+(a*3.6))+"deg)"}},50)};var ToxProgress={toxProgressBars:[],init:function(){var a=this.toxProgressBars=[];var b=document.querySelectorAll(".tox-progress");[].forEach.call(b,function(c){a.push(new ToxProgressBar(c))})},create:function(){this.init();var a=this.toxProgressBars;a.forEach(function(b){b.create()})},animate:function(){var a=this.toxProgressBars;a.forEach(function(b){b.animate()})}};