define(["exports"],function(_exports){function onInit(){this.hasInit||(this.hasInit=!0,this.classList.add("progressring"),this.innerHTML='<div class="progressring-bg">\n    <div class="progressring-text"></div>\n</div>\n<div class="spiner-holder-one animate-0-25-a">\n    <div class="spiner-holder-two animate-0-25-b">\n        <div class="progressring-spiner"></div>\n    </div>\n</div>\n<div class="spiner-holder-one animate-25-50-a">\n    <div class="spiner-holder-two animate-25-50-b">\n        <div class="progressring-spiner"></div>\n    </div>\n</div>\n<div class="spiner-holder-one animate-50-75-a">\n    <div class="spiner-holder-two animate-50-75-b">\n        <div class="progressring-spiner"></div>\n    </div>\n</div>\n<div class="spiner-holder-one animate-75-100-a">\n    <div class="spiner-holder-two animate-75-100-b">\n        <div class="progressring-spiner"></div>\n    </div>\n</div>',this.setProgress(parseFloat(this.getAttribute("data-progress")||"0")))}Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.default=void 0,require(["css!modules/emby-elements/emby-progressring/emby-progressring.css"]);var EmbyProgressRing=function(_HTMLDivElement){function EmbyProgressRing(){var _this,self=_this=_HTMLDivElement.call(this)||this;return onInit.call(self),babelHelpers.possibleConstructorReturn(_this,self)}return babelHelpers.inherits(EmbyProgressRing,_HTMLDivElement),babelHelpers.createClass(EmbyProgressRing,[{key:"connectedCallback",value:function(){onInit.call(this)}},{key:"disconnectedCallback",value:function(){var observer=this.observer;observer&&(observer.disconnect(),this.observer=null)}},{key:"setProgress",value:function(progress){var angle;(progress=Math.floor(progress))<25?(angle=progress/100*360-90,this.querySelector(".animate-0-25-b").style.transform="rotate("+angle+"deg)",this.querySelector(".animate-25-50-b").style.transform="rotate(-90deg)",this.querySelector(".animate-50-75-b").style.transform="rotate(-90deg)",this.querySelector(".animate-75-100-b").style.transform="rotate(-90deg)"):25<=progress&&progress<50?(angle=(progress-25)/100*360-90,this.querySelector(".animate-0-25-b").style.transform="none",this.querySelector(".animate-25-50-b").style.transform="rotate("+angle+"deg)",this.querySelector(".animate-50-75-b").style.transform="rotate(-90deg)",this.querySelector(".animate-75-100-b").style.transform="rotate(-90deg)"):50<=progress&&progress<75?(angle=(progress-50)/100*360-90,this.querySelector(".animate-0-25-b").style.transform="none",this.querySelector(".animate-25-50-b").style.transform="none",this.querySelector(".animate-50-75-b").style.transform="rotate("+angle+"deg)",this.querySelector(".animate-75-100-b").style.transform="rotate(-90deg)"):75<=progress&&progress<=100&&(angle=(progress-75)/100*360-90,this.querySelector(".animate-0-25-b").style.transform="none",this.querySelector(".animate-25-50-b").style.transform="none",this.querySelector(".animate-50-75-b").style.transform="none",this.querySelector(".animate-75-100-b").style.transform="rotate("+angle+"deg)"),this.querySelector(".progressring-text").innerHTML=progress+"%"}}])}(babelHelpers.wrapNativeSuper(HTMLDivElement));customElements.define("emby-progressring",EmbyProgressRing,{extends:"div"}),_exports.default=EmbyProgressRing});