define(["exports"],function(_exports){function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(_isNativeReflectConstruct=function(){return!!t})()}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(){babelHelpers.classCallCheck(this,EmbyProgressRing),t=this,o=EmbyProgressRing,o=babelHelpers.getPrototypeOf(o);var o,e,t=o=babelHelpers.possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],babelHelpers.getPrototypeOf(t).constructor):o.apply(t,e));return onInit.call(t),babelHelpers.possibleConstructorReturn(o,t)}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});