(()=>{"use strict";document.addEventListener("DOMContentLoaded",function(){t.init()});const t={init:function(){this.holder=document.querySelectorAll(".qi-block-progress-bar-circle"),this.holder.length&&[...this.holder].map(e=>{t.initItem(e)})},getRealCurrentItem:function(t){return"string"==typeof t&&""!==t&&(t=qiBlocksEditor.qodefGetCurrentBlockElement.get(t)),t},initItem:function(e,i){if(!(e=t.getRealCurrentItem(e)))return;const r="object"!=typeof qiBlocksEditor?qiBlocks:qiBlocksEditor;i&&e.classList.remove("qodef--init"),r.qodefIsInViewport.check(e,()=>{e.classList.contains("qodef--init")||t.initCircleBar(e,i)})},generateBarData:function(t){const e=parseInt(t.getAttribute("data-active-line-width"),10),i=t.getAttribute("data-active-line-color"),r=parseInt(t.getAttribute("data-inactive-line-width"),10),n=t.getAttribute("data-inactive-line-color"),o=t.getAttribute("data-duration")&&!isNaN(t.getAttribute("data-duration"))?parseInt(t.getAttribute("data-duration"),10):1200,a=t.getAttribute("data-text-color")||"",c=t.clientWidth;let l={strokeWidth:100*e/c,trailWidth:100*r/c,svgStyle:{display:"block",width:"100%"},text:{className:"qodef-m-value",autoStyleContainer:!1},easing:"linear",duration:o,step:function(t,e){e.setText(Math.round(100*e.value())+'<sup class="qodef-m-percentage">%</sup>')}};return a&&(l.text.style={color:a}),i&&(l.color=i,l.to={color:i}),n&&(l.trailColor=n,l.from={color:n}),l},initCircleBar:function(e,i){const r=e.querySelector(".qodef-m-canvas"),n=t.generateBarData(e),o=parseInt(e.getAttribute("data-number"),10)/100;i&&(r.innerHTML="");const a=new ProgressBar.Circle(r,n);e.classList.add("qodef--init"),a.animate(o)}}})();