UNPKG

@aidenlx/player

Version:

Headless web components that make integrating media on the a web a breeze.

2 lines (1 loc) 2.15 kB
import{c as a,d as u}from"./chunk.PWTX2M5C.js";var{H:E}=u;var f=t=>t.strings===void 0;var p={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},d=t=>(...e)=>({nt:t,values:e}),c=class{constructor(e){}get g(){return this.a.g}at(e,i,s){this.Ge=e,this.a=i,this.os=s}Mi(e,i){return this.update(e,i)}update(e,i){return this.render(...i)}};var n=(t,e)=>{var i,s;let o=t.x;if(o===void 0)return!1;for(let r of o)(s=(i=r).tr)===null||s===void 0||s.call(i,e,!1),n(r,e);return!0},l=t=>{let e,i;do{if((e=t.a)===void 0)break;i=e.x,i.delete(t),t=e}while(i?.size===0)},m=t=>{for(let e;e=t.a;t=e){let i=e.x;if(i===void 0)e.x=i=new Set;else if(i.has(t))break;i.add(t),U(e)}};function T(t){this.x!==void 0?(l(this),this.a=t,m(this)):this.a=t}function x(t,e=!1,i=0){let s=this.s,o=this.x;if(o!==void 0&&o.size!==0)if(e)if(Array.isArray(s))for(let r=i;r<s.length;r++)n(s[r],!1),l(s[r]);else s!=null&&(n(s,!1),l(s));else n(this,t)}var U=t=>{var e,i,s,o;t.type==p.CHILD&&((e=(s=t).ae)!==null&&e!==void 0||(s.ae=x),(i=(o=t).Gr)!==null&&i!==void 0||(o.Gr=T))},h=class extends c{constructor(){super(...arguments),this.x=void 0}at(e,i,s){super.at(e,i,s),m(this),this.isConnected=e.g}tr(e,i=!0){var s,o;e!==this.isConnected&&(this.isConnected=e,e?(s=this.reconnected)===null||s===void 0||s.call(this):(o=this.disconnected)===null||o===void 0||o.call(this)),i&&(n(this,e),l(this))}setValue(e){if(f(this.Ge))this.Ge.w(e,this);else{let i=[...this.Ge.s];i[this.os]=e,this.Ge.w(i,this,0)}}disconnected(){}reconnected(){}};var V=()=>new g,g=class{},v=new WeakMap,w=d(class extends h{render(t){return a}update(t,[e]){var i;let s=e!==this.U;return s&&this.U!==void 0&&this.ot(void 0),(s||this.rt!==this.lt)&&(this.U=e,this.ht=(i=t.options)===null||i===void 0?void 0:i.host,this.ot(this.lt=t.element)),a}ot(t){typeof this.U=="function"?(v.get(this.U)!==void 0&&this.U.call(this.ht,void 0),v.set(this.U,t),t!==void 0&&this.U.call(this.ht,t)):this.U.value=t}get rt(){var t;return typeof this.U=="function"?v.get(this.U):(t=this.U)===null||t===void 0?void 0:t.value}disconnected(){this.rt===this.lt&&this.ot(void 0)}reconnected(){this.ot(this.lt)}});export{V as a,w as b};