import{h}from"@stencil/core";import fitText from"../../../../../library/fittext.js";export class PrestoDynamicOverlayUi{constructor(){this.href=void 0,this.target=void 0,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,{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",null))}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",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>`."},attribute:"href",reflect:!1},target:{type:"string",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."},attribute:"target",reflect:!1},position:{type:"string",mutable:!1,complexType:{original:"'top-left' | 'top-right'",resolved:'"top-left" | "top-right"',references:{}},required:!1,optional:!1,docs:{tags:[],text:""},attribute:"position",reflect:!1,defaultValue:"'top-right'"}}}static get elementRef(){return"el"}}