Peach: Local-first video metadata scraper and media manager.
/*! Video.js | https://videojs.org/help */
import{t as e}from"../context-0Uf4tShw.js";import{t}from"../context-provider-ivCWVZbp.js";import{r as n,t as r}from"../controller-BLxk0Jv5.js";import{t as i}from"../listen-4VrUltMW.js";import{t as a}from"../ui-element-tYNJ8-5H.js";import{t as o}from"../focus-Cg-_ddlb.js";import{t as s}from"../tree-DWhDt8U_.js";import{t as c}from"../safe-define-DXxmf7BV.js";import{i as l,t as u}from"../context-BEwcGq-j.js";import{t as d}from"../controller-BPemWnqI.js";import{r as f}from"../selectors-DvmfDt7q.js";import{t as p}from"../state-data-attrs-CjNZtRJA.js";import{t as m}from"../popup-group-context-DtGmevFv.js";function h(e){e.hasAttribute(`role`)||e.setAttribute(`role`,`group`),e.hasAttribute(`tabindex`)||e.setAttribute(`tabindex`,`0`)}function g(e){let t=o(e.ownerDocument);(!t||t===e.ownerDocument.body||!s(e,t))&&e.focus({preventScroll:!0})}function _(){let e=null,t=/* @__PURE__ */ new Set;function n(){for(let e of t)e()}return{open(t){if(e===t)return;let r=e;e=t,r?.close(`group-open`),n()},close(t){e===t&&(e=null,n())},isOpenFor(t){return t!==null&&e?.triggerElement===t},subscribe(e){return t.add(e),()=>t.delete(e)}}}var v=class{#e=null;setMedia(e){this.#e=e}getState(){return{controlsVisible:this.#e.controlsVisible}}};const y={controlsVisible:`data-controls-visible`},b={key:`container.label`,text:`Media player`};var x=class extends a{static{this.tagName=`media-container`}#e=null;#t=null;#n=null;#r=new v;#i=new d(this,l,f);#a=new r(this,n);#o=_();#s=new t(this,{context:m,initialValue:this.#o});#c=new e(this,{context:u,callback:e=>this.#l(e)});connectedCallback(){super.connectedCallback(),this.#s.setValue(this.#o),this.#l(this.#c.value),h(this),this.#u(),this.#t=new AbortController,i(this,`pointerup`,this.#d,{signal:this.#t.signal})}disconnectedCallback(){this.#e?.(),this.#e=null,this.#t?.abort(),this.#t=null,super.disconnectedCallback()}update(e){super.update(e),this.#u();let t=this.#i.value;t?(this.#r.setMedia(t),p(this,this.#r.getState(),y)):this.removeAttribute(y.controlsVisible)}#l(e){this.#e?.(),this.#e=null,this.isConnected&&e&&(this.#e=e.registerContainer(this))}#u(){let e=this.getAttribute(`aria-label`);if(e&&e!==this.#n)return;if(this.hasAttribute(`aria-labelledby`)){e===this.#n&&(this.removeAttribute(`aria-label`),this.#n=null);return}let t=this.#a.value(b);this.setAttribute(`aria-label`,t),this.#n=t}#d=()=>{g(this)}};c(x);
//# sourceMappingURL=container.js.map