import{proxyCustomElement,HTMLElement,h}from"@stencil/core/internal/client";import{d as defineCustomElement$4}from"./presto-action-bar-controller2.js";import{d as defineCustomElement$3}from"./presto-action-bar-ui2.js";import{d as defineCustomElement$2}from"./presto-player-button2.js";import{d as defineCustomElement$1}from"./presto-youtube-subscribe-button2.js";const prestoActionBarCss=":host{display:block}",PrestoActionBar=proxyCustomElement(class extends HTMLElement{constructor(){super(),this.__registerHost(),this.__attachShadow()}componentWillLoad(){this.player&&(this.player.on("ended",()=>this.setEnded()),this.player.on("timeupdate",e=>this.setCurrentTime(e)))}handlePlayerChange(){this.player&&(this.player.on("ended",()=>this.setEnded()),this.player.on("timeupdate",e=>this.setCurrentTime(e)))}setEnded(){this.ended=!0}setCurrentTime(e){var t,r;this.currentTime=null===(t=null==e?void 0:e.detail)||void 0===t?void 0:t.plyr.currentTime,this.duration=null===(r=null==e?void 0:e.detail)||void 0===r?void 0:r.plyr.duration}disconnectedCallback(){this.player&&(this.player.off("ended",this.setEnded),this.player.off("timeupdate",this.setCurrentTime))}render(){return h("presto-action-bar-controller",{key:"b3e5ee805698aa3db15cd161ead5687cdc8dd527",ended:this.ended,config:this.config,currentTime:this.currentTime,duration:this.duration,direction:this.direction,youtube:this.youtube})}get el(){return this}static get watchers(){return{player:["handlePlayerChange"]}}static get style(){return prestoActionBarCss}},[257,"presto-action-bar",{player:[8],config:[16],direction:[1],youtube:[16],currentTime:[32],duration:[32],ended:[32]},void 0,{player:["handlePlayerChange"]}]);function defineCustomElement(){"undefined"!=typeof customElements&&["presto-action-bar","presto-action-bar-controller","presto-action-bar-ui","presto-player-button","presto-youtube-subscribe-button"].forEach(e=>{switch(e){case"presto-action-bar":customElements.get(e)||customElements.define(e,PrestoActionBar);break;case"presto-action-bar-controller":customElements.get(e)||defineCustomElement$4();break;case"presto-action-bar-ui":customElements.get(e)||defineCustomElement$3();break;case"presto-player-button":customElements.get(e)||defineCustomElement$2();break;case"presto-youtube-subscribe-button":customElements.get(e)||defineCustomElement$1()}})}export{PrestoActionBar as P,defineCustomElement as d};