import{L as e,a as t,i as n,o as r,t as i}from"./create-player-QjiNZlh7.js";import{t as a}from"./safe-define-GrHW3P9e.js";import{t as o}from"./media-attach-mixin-tFNcHnvo.js";function s(e){let t={};for(let n of e)t[n.name]=n.value;return t}const{ProviderMixin:c}=i({features:e});a(class extends c(t){static{this.tagName=`background-video-player`}}),a(n);function l(e){return`<media-container><slot name="media"></slot><slot></slot></media-container>`}a(class extends r{static{this.tagName=`background-video-skin`}static{this.shadowRootOptions={mode:`open`}}static{this.getTemplateHTML=l}constructor(){super(),this.shadowRoot||(this.attachShadow(this.constructor.shadowRootOptions),this.shadowRoot.innerHTML=l(s(this.attributes)))}});function u(e){return`<style> :host { position: relative; } video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: var(--media-object-fit, inherit); object-position: var(--media-object-position, 50% 50%); } </style><slot></slot><video ${p(e)}></video>`}var d=class extends o(HTMLElement){static{this.shadowRootOptions={mode:`open`}}static{this.getTemplateHTML=u}static get observedAttributes(){return[`src`]}constructor(){if(super(),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e={...s(this.attributes),...!this.hasAttribute(`nomuted`)&&{muted:``},...!this.hasAttribute(`noloop`)&&{loop:``},...!this.hasAttribute(`noautoplay`)&&{autoplay:``},playsinline:``,disableremoteplayback:``,disablepictureinpicture:``};this.shadowRoot.innerHTML=u(e)}this.target.muted=!this.hasAttribute(`nomuted`)}getMediaTarget(){return this.target}attributeChangedCallback(e,t,n){e===`src`&&t!==n&&(this.target.src=n??``)}get target(){return this.querySelector(`:scope > [slot=media]`)??this.querySelector(`video`)??this.shadowRoot?.querySelector(`video`)??null}};const f=[`autoplay`,`controls`,`controlslist`,`crossorigin`,`disablepictureinpicture`,`disableremoteplayback`,`loop`,`muted`,`playsinline`,`preload`];function p(e){let t=``;for(let n in e){if(!f.includes(n))continue;let r=e[n];r===``?t+=` ${n}`:t+=` ${n}="${r}"`}return t}a(class extends d{static{this.tagName=`background-video`}});
//# sourceMappingURL=background.js.map