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}",PrestoEmailOverlay=proxyCustomElement(class extends HTMLElement{constructor(){super(),this.__registerHost()}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,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(){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 prestoEmailOverlayCss}},[256,"presto-email-overlay",{player:[8],direction:[1],preset:[16],videoId:[2,"video-id"],i18n:[16,"i-1-8n"],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};