import{h}from"@stencil/core";import fitText from"../../../../../library/fittext.js";export class PrestoDynamicOverlayUi{constructor(){this.position="top-right"}closestElement(t,e){return e&&e!=document&&e!=window&&e.closest(t)||e&&this.closestElement(t,e.getRootNode().host)}componentDidLoad(){let t=this.closestElement("presto-player",this.el);fitText(this.text,3,{maxFontSize:16,minFontSize:10,container:t})}render(){const t=this.href?"a":"span";return h(t,{key:"aba93930fd5449cfccd632ecd9983841c5333d9f",class:{"overlay-text":!0,"overlay--top-left":"top-left"===this.position,"overlay--top-right":"top-right"===this.position},href:this.href,target:this.target,part:"overlay-text",ref:t=>this.text=t},h("slot",{key:"be2b2aa9b5c71e613ccef9e62f828451964649fe"}))}static get is(){return"presto-dynamic-overlay-ui"}static get encapsulation(){return"shadow"}static get originalStyleUrls(){return{$:["presto-dynamic-overlay-ui.scss"]}}static get styleUrls(){return{$:["presto-dynamic-overlay-ui.css"]}}static get properties(){return{href:{type:"string",attribute:"href",mutable:!1,complexType:{original:"string",resolved:"string",references:{}},required:!1,optional:!1,docs:{tags:[],text:"When set, the underlying button will be rendered as an `<a>` with this `href` instead of a `<button>`."},getter:!1,setter:!1,reflect:!1},target:{type:"string",attribute:"target",mutable:!1,complexType:{original:"'_blank' | '_parent' | '_self' | '_top'",resolved:'"_blank" | "_parent" | "_self" | "_top"',references:{}},required:!1,optional:!1,docs:{tags:[],text:"Tells the browser where to open the link. Only used when `href` is set."},getter:!1,setter:!1,reflect:!1},position:{type:"string",attribute:"position",mutable:!1,complexType:{original:"'top-left' | 'top-right'",resolved:'"top-left" | "top-right"',references:{}},required:!1,optional:!1,docs:{tags:[],text:""},getter:!1,setter:!1,reflect:!1,defaultValue:"'top-right'"}}}static get elementRef(){return"el"}}