import{proxyCustomElement,HTMLElement,h}from"@stencil/core/internal/client";import{d as defineCustomElement$3}from"./presto-email-overlay-controller2.js";import{d as defineCustomElement$2}from"./presto-email-overlay-ui2.js";import{d as defineCustomElement$1}from"./presto-spinner.js";const prestoEmailOverlayCss=":host{display:block}",PrestoEmailOverlayStyle0=prestoEmailOverlayCss,PrestoEmailOverlay=proxyCustomElement(class extends HTMLElement{constructor(){super(),this.__registerHost(),this.player=void 0,this.direction=void 0,this.preset=void 0,this.videoId=void 0,this.i18n=void 0,this.provider=void 0,this.currentTime=void 0,this.duration=void 0,this.ended=void 0}componentWillLoad(){this.player&&(this.player.on("ended",(()=>this.setEnded())),this.player.on("timeupdate",(e=>this.setCurrentTime(e))))}setEnded(){this.ended=!0}setCurrentTime(e){var t,i;this.currentTime=null===(t=null==e?void 0:e.detail)||void 0===t?void 0:t.plyr.currentTime,this.duration=null===(i=null==e?void 0:e.detail)||void 0===i?void 0:i.plyr.duration}disconnectedCallback(){this.player&&(this.player.off("ended",this.setEnded),this.player.off("timeupdate",this.setCurrentTime))}render(){var e,t;return h("presto-email-overlay-controller",{key:"ccdb3335179aced53bfe8ba1c0f4594e5aa6051c",ended:this.ended,currentTime:this.currentTime,videoId:this.videoId,duration:this.duration,direction:this.direction,presetId:null===(e=this.preset)||void 0===e?void 0:e.id,emailCollection:null===(t=this.preset)||void 0===t?void 0:t.email_collection,i18n:this.i18n,provider:this.provider})}static get style(){return PrestoEmailOverlayStyle0}},[0,"presto-email-overlay",{player:[8],direction:[1],preset:[16],videoId:[2,"video-id"],i18n:[16],provider:[1],currentTime:[32],duration:[32],ended:[32]}]);function defineCustomElement(){"undefined"!=typeof customElements&&["presto-email-overlay","presto-email-overlay-controller","presto-email-overlay-ui","presto-player-spinner"].forEach((e=>{switch(e){case"presto-email-overlay":customElements.get(e)||customElements.define(e,PrestoEmailOverlay);break;case"presto-email-overlay-controller":customElements.get(e)||defineCustomElement$3();break;case"presto-email-overlay-ui":customElements.get(e)||defineCustomElement$2();break;case"presto-player-spinner":customElements.get(e)||defineCustomElement$1()}}))}export{PrestoEmailOverlay as P,defineCustomElement as d};