aptechka 0.37.3 → 0.38.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
- "use strict";var Y=r=>{throw TypeError(r)};var D=(r,i,t)=>i.has(r)||Y("Cannot "+t);var e=(r,i,t)=>(D(r,i,"read from private field"),t?t.call(r):i.get(r)),s=(r,i,t)=>i.has(r)?Y("Cannot add the same private member more than once"):i instanceof WeakSet?i.add(r):i.set(r,t),a=(r,i,t,n)=>(D(r,i,"write to private field"),n?n.call(r,t):i.set(r,t),t),H=(r,i,t)=>(D(r,i,"access private method"),t);var G=(r,i,t)=>new Promise((n,l)=>{var S=d=>{try{b(t.next(d))}catch(h){l(h)}},$=d=>{try{b(t.throw(d))}catch(h){l(h)}},b=d=>d.done?n(d.value):Promise.resolve(d.value).then(S,$);b((t=t.apply(r,i)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const re=require("../device/index.cjs"),ne=require("../source/index.cjs"),ae=require("../class-linked-status/index.cjs"),Z=require("../browser-CpzFX2xg.cjs"),N=require("../events-KVanG9sR.cjs"),oe=require("../string-DhgS_iFl.cjs"),U=require("../loading/index.cjs"),O=require("../css-property/index.cjs"),J=require("../element-resizer/vanilla/index.cjs"),Q=require("../canvas-CU5Xjahf.cjs"),ce=require("../canvas/index.cjs"),K=require("../ticker/vanilla/index.cjs");let he=0;var u,o,p,I,m,_,C,c,q,P,R,V,W,T,F;class j extends HTMLElement{constructor(){super();s(this,R);s(this,u,null);s(this,o,null);s(this,p,!1);s(this,I,!1);s(this,m,!1);s(this,_,"");s(this,C,"");s(this,c,new ae.ClassLinkedStatus(this,{loading:!1,loaded:!1,error:!1,clear:!1}));s(this,q,null);s(this,P);s(this,W,t=>{const n=t[0];e(this,m)&&(!e(this,I)||this.hasAttribute("reload-source"))&&n.isIntersecting&&this.triggerLazyLoad(),n.isIntersecting?N.dispatchEvent(this,"sourceCapture",{custom:!0}):(this.hasAttribute("reload-source")&&H(this,R,V).call(this,void 0),N.dispatchEvent(this,"sourceRelease",{custom:!0}))});s(this,T,()=>{e(this,c).set("loaded",!0),e(this,c).set("error",!1),e(this,c).set("loading",!1),!e(this,m)&&!e(this,p)&&U.loading.complete(e(this,C));const t=getComputedStyle(this).getPropertyValue("--clear-duration");t&&a(this,P,setTimeout(()=>e(this,c).set("clear",!0),parseFloat(t)*1e3)),a(this,p,!0)});s(this,F,t=>{e(this,c).set("loaded",!1),e(this,c).set("error",!0),e(this,c).set("loading",!1),!e(this,m)&&!e(this,p)&&U.loading.error(e(this,C)),a(this,p,!0)});Z.isBrowser&&window.IntersectionObserver&&(a(this,_,`source-consumer-${++he}`),a(this,q,new IntersectionObserver(e(this,W))))}get consumerElement(){return e(this,o)}get sourceManager(){return e(this,u)}get status(){return e(this,c)}get isLazy(){return e(this,m)}triggerLazyLoad(){e(this,u).current&&e(this,u).current!==e(this,u).previous&&H(this,R,V).call(this,e(this,u).current),a(this,I,!0)}connectedCallback(){const t=this.getAttribute("srcset");t&&(a(this,o,this.createConsumer()),e(this,o).style.cssText=`
1
+ "use strict";var oe=a=>{throw TypeError(a)};var se=(a,r,t)=>r.has(a)||oe("Cannot "+t);var e=(a,r,t)=>(se(a,r,"read from private field"),t?t.call(a):r.get(a)),s=(a,r,t)=>r.has(a)?oe("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(a):r.set(a,t),n=(a,r,t,i)=>(se(a,r,"write to private field"),i?i.call(a,t):r.set(a,t),t),x=(a,r,t)=>(se(a,r,"access private method"),t);var he=(a,r,t)=>new Promise((i,u)=>{var b=m=>{try{g(t.next(m))}catch(l){u(l)}},N=m=>{try{g(t.throw(m))}catch(l){u(l)}},g=m=>m.done?i(m.value):Promise.resolve(m.value).then(b,N);g((t=t.apply(a,r)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ye=require("../device/index.cjs"),ge=require("../source/index.cjs"),Ee=require("../class-linked-status/index.cjs"),le=require("../browser-CpzFX2xg.cjs"),X=require("../events-KVanG9sR.cjs"),de=require("../string-DhgS_iFl.cjs"),ie=require("../loading/index.cjs"),D=require("../css-property/index.cjs"),ce=require("../element-resizer/vanilla/index.cjs"),ue=require("../canvas-CU5Xjahf.cjs"),ve=require("../canvas/index.cjs"),re=require("../ticker/vanilla/index.cjs");let Se=0;var d,o,E,_,f,$,C,h,q,V,v,z,K,J,H,Q;class F extends HTMLElement{constructor(){super();s(this,z);s(this,d,null);s(this,o,null);s(this,E,!1);s(this,_,!1);s(this,f,!1);s(this,$,"");s(this,C,"");s(this,h,new Ee.ClassLinkedStatus(this,{loading:!1,loaded:!1,error:!1,clear:!1}));s(this,q,null);s(this,V);s(this,v,null);s(this,J,t=>{const i=t[0];e(this,f)&&(!e(this,_)||this.hasAttribute("reload-source"))&&i.isIntersecting&&this.triggerLazyLoad(),i.isIntersecting?X.dispatchEvent(this,"sourceCapture",{custom:!0}):(this.hasAttribute("reload-source")&&x(this,z,K).call(this,void 0),X.dispatchEvent(this,"sourceRelease",{custom:!0}))});s(this,H,()=>{e(this,h).set("loaded",!0),e(this,h).set("error",!1),e(this,h).set("loading",!1),!e(this,f)&&!e(this,E)&&ie.loading.complete(e(this,C));const t=getComputedStyle(this).getPropertyValue("--clear-duration");t?n(this,V,setTimeout(()=>{e(this,h).set("clear",!0)},parseFloat(t)*1e3)):e(this,h).set("clear",!0),n(this,E,!0)});s(this,Q,t=>{e(this,h).set("loaded",!1),e(this,h).set("error",!0),e(this,h).set("loading",!1),!e(this,f)&&!e(this,E)&&ie.loading.error(e(this,C)),n(this,E,!0)});le.isBrowser&&window.IntersectionObserver&&(n(this,$,`source-consumer-${++Se}`),n(this,q,new IntersectionObserver(e(this,J))))}get consumerElement(){return e(this,o)}get sourceManager(){return e(this,d)}get status(){return e(this,h)}get isLazy(){return e(this,f)}get currentURL(){return e(this,v)}triggerLazyLoad(){e(this,d).current&&e(this,d).current!==e(this,d).previous&&x(this,z,K).call(this,e(this,d).current),n(this,_,!0)}connectedCallback(){const t=this.getAttribute("srcset");t&&(n(this,o,this.createConsumer()),e(this,o).style.cssText=`
2
2
  display: block;
3
3
  width: 100%;
4
4
  height: 100%;
5
- `,e(this,o).classList.add("source-consumer"),Array.from(this.attributes).forEach(n=>{if(n.name!=="srcset"){const l=n.nodeValue||"",S=oe.kebabToCamel(n.name);S in e(this,o)&&(e(this,o)[S]=l||!0)}}),this.appendChild(e(this,o)),a(this,u,new ne.SourceManager({srcset:t})),a(this,m,this.hasAttribute("lazy")),e(this,u).subscribe(n=>{(!e(this,m)||e(this,m)&&e(this,I))&&H(this,R,V).call(this,n.current)}),e(this,q).observe(this),e(this,u).connect())}disconnectedCallback(){e(this,q).disconnect(),e(this,u).close(),e(this,o).onloadeddata=null,e(this,o).onload=null,e(this,o).onerror=null,e(this,o).remove(),e(this,c).reset(),clearTimeout(e(this,P))}}u=new WeakMap,o=new WeakMap,p=new WeakMap,I=new WeakMap,m=new WeakMap,_=new WeakMap,C=new WeakMap,c=new WeakMap,q=new WeakMap,P=new WeakMap,R=new WeakSet,V=function(t){if(clearTimeout(e(this,P)),e(this,o).onloadeddata=null,e(this,o).onload=null,e(this,o).onerror=null,e(this,c).set("loaded",!1),e(this,c).set("error",!1),e(this,c).set("loading",!1),e(this,c).set("clear",!1),t){a(this,C,`${e(this,_)}-${t.url}`);const n=this.hasAttribute("keep-source-parameters");e(this,c).set("loading",!0);const l=n?t.url:t.name+t.extension;this.consumeSource(l),!e(this,m)&&!e(this,p)&&U.loading.add(e(this,C)),e(this,o).onloadeddata=()=>{e(this,T).call(this)},e(this,o).onload=()=>{e(this,T).call(this)},e(this,o).onerror=()=>{e(this,F).call(this,l)}}else this.consumeSource(null)},W=new WeakMap,T=new WeakMap,F=new WeakMap;class ee extends j{createConsumer(){return document.createElement("img")}consumeSource(i){if(i&&this.hasAttribute("webp")&&re.device.isWebp){const t=i.split(".").slice(0,-1).join(".")+".webp";this.consumerElement.src=t}else this.consumerElement.src=i||""}}customElements.get("e-image")||customElements.define("e-image",ee);function le(r){const i=r.match(/\{([\d-]+)\}/);if(i){const t=i[1].split("-");if(t.length===2){const n=parseInt(t[0],10),l=parseInt(t[1],10);return{start:n,end:l}}}return null}var f,w,A,E,v,L,k,M,g,y;class te extends j{constructor(t){super();s(this,f,[]);s(this,w,new O.CSSProperty(this,"--fit","contain"));s(this,A,new O.CSSProperty(this,"--autoplay",!1));s(this,E,new O.CSSProperty(this,"--offset-x",.5));s(this,v,new O.CSSProperty(this,"--offset-y",.5));s(this,L,null);s(this,k,0);s(this,M,1);s(this,g,()=>{if(e(this,f).length){const t=e(this,f)[0];e(this,w).current==="cover"?a(this,L,Q.cover(t.naturalWidth,t.naturalHeight,this.consumerElement.width,this.consumerElement.height,e(this,E).current,e(this,v).current)):a(this,L,Q.contain(t.naturalWidth,t.naturalHeight,this.consumerElement.width,this.consumerElement.height,e(this,E).current,e(this,v).current))}});s(this,y,t=>{if(this.status.isFalse("loaded")||!e(this,L))return;t.detail.context.clearRect(0,0,t.detail.width,t.detail.height);const n=e(this,f)[e(this,k)];n&&t.detail.context.drawImage(n,...e(this,L)),e(this,A).current&&a(this,k,(e(this,k)+1)%e(this,f).length)});Z.isBrowser&&(a(this,M,parseInt(((t==null?void 0:t.pad)||this.getAttribute("pad")||"1").toString())),e(this,w).subscribe(e(this,g)),e(this,E).subscribe(e(this,g)),e(this,v).subscribe(e(this,g)),this.addEventListener("sourceCapture",n=>{this.consumerElement.addEventListener("canvasRender",e(this,y))}),this.addEventListener("sourceRelease",n=>{this.consumerElement.removeEventListener("canvasRender",e(this,y))}))}setProgress(t){e(this,f).length&&a(this,k,Math.floor((e(this,f).length-1)*t))}connectedCallback(){super.connectedCallback(),e(this,A).observe(),e(this,w).observe(),e(this,E).observe(),e(this,v).observe(),J.elementResizer.subscribe(this,e(this,g))}disconnectedCallback(){super.disconnectedCallback(),e(this,A).unobserve(),e(this,w).unobserve(),e(this,E).unobserve(),e(this,v).unobserve(),a(this,f,[]),J.elementResizer.unsubscribe(e(this,g)),this.consumerElement.removeEventListener("canvasRender",e(this,y))}createConsumer(){return new ce.CanvasElement}consumeSource(t){return G(this,null,function*(){var n,l,S,$;if(t){this.consumerElement.removeEventListener("canvasRender",e(this,y));const b=[],d=le(t);if(d)for(let h=d.start;h<=d.end;h++){const X=t.replace(/\{([^}]+)\}/,h.toString().padStart(e(this,M),"0")),B=new Image;B.src=X,b.push(B)}else{const h=new Image;h.src=t,b.push(h)}try{yield Promise.all(b.map((h,X)=>new Promise((B,ie)=>{h.onload=()=>{B()},h.onerror=ue=>{ie(`${h.src} Image not found`)}}))),a(this,f,b),e(this,g).call(this),(l=(n=this.consumerElement).onload)==null||l.call(n,new Event("load")),this.isLazy||this.consumerElement.addEventListener("canvasRender",e(this,y))}catch(h){console.error(h),($=(S=this.consumerElement).onerror)==null||$.call(S,new Event("error"))}}})}}f=new WeakMap,w=new WeakMap,A=new WeakMap,E=new WeakMap,v=new WeakMap,L=new WeakMap,k=new WeakMap,M=new WeakMap,g=new WeakMap,y=new WeakMap;customElements.get("e-sequence")||customElements.define("e-sequence",te);var x,z;class se extends j{constructor(){super(...arguments);s(this,x,0);s(this,z,()=>{this.classList.add(`state-${this.consumerElement.readyState}`);const t=this.consumerElement.readyState/4;t>e(this,x)&&a(this,x,t),N.dispatchEvent(this,"videoReadyStateChange",{detail:{readyState:this.consumerElement.readyState,progress:e(this,x)}}),this.consumerElement.readyState===4&&K.ticker.unsubscribe(e(this,z))})}connectedCallback(){super.connectedCallback(),this.addEventListener("sourceCapture",()=>{K.ticker.subscribe(e(this,z)),this.hasAttribute("capture-autoplay")&&this.consumerElement.play()}),this.addEventListener("sourceRelease",()=>{this.hasAttribute("capture-autoplay")&&(this.consumerElement.pause(),this.hasAttribute("replay")&&(this.consumerElement.currentTime=0)),this.hasAttribute("reload-source")&&this.classList.remove("state-0","state-1","state-2","state-3","state-4")})}disconnectedCallback(){super.disconnectedCallback(),K.ticker.unsubscribe(e(this,z)),a(this,x,0)}createConsumer(){return document.createElement("video")}consumeSource(t){this.consumerElement.src=t||"",this.consumerElement.autoplay=!0}}x=new WeakMap,z=new WeakMap;customElements.get("e-video")||customElements.define("e-video",se);exports.ImageElement=ee;exports.SequenceElement=te;exports.SourceElement=j;exports.VideoElement=se;
5
+ `,e(this,o).classList.add("source-consumer"),Array.from(this.attributes).forEach(i=>{if(i.name!=="srcset"){const u=i.nodeValue||"",b=de.kebabToCamel(i.name);b in e(this,o)&&(e(this,o)[b]=u||!0)}}),this.appendChild(e(this,o)),n(this,d,new ge.SourceManager({srcset:t})),n(this,f,this.hasAttribute("lazy")),e(this,d).subscribe(i=>{(!e(this,f)||e(this,f)&&e(this,_))&&x(this,z,K).call(this,i.current)}),e(this,q).observe(this),e(this,d).connect())}disconnectedCallback(){e(this,q).disconnect(),e(this,d).close(),e(this,o).onloadeddata=null,e(this,o).onload=null,e(this,o).onerror=null,e(this,o).remove(),e(this,h).reset(),clearTimeout(e(this,V))}}d=new WeakMap,o=new WeakMap,E=new WeakMap,_=new WeakMap,f=new WeakMap,$=new WeakMap,C=new WeakMap,h=new WeakMap,q=new WeakMap,V=new WeakMap,v=new WeakMap,z=new WeakSet,K=function(t){if(clearTimeout(e(this,V)),e(this,o).onloadeddata=null,e(this,o).onload=null,e(this,o).onerror=null,e(this,h).set("loaded",!1),e(this,h).set("error",!1),e(this,h).set("loading",!1),e(this,h).set("clear",!1),t){n(this,C,`${e(this,$)}-${t.url}`);const i=this.hasAttribute("keep-source-parameters");e(this,h).set("loading",!0),n(this,v,i?t.url:t.name+t.extension),this.consumeSource(e(this,v)),!e(this,f)&&!e(this,E)&&ie.loading.add(e(this,C)),e(this,o).onloadeddata=()=>{e(this,H).call(this)},e(this,o).onload=()=>{e(this,H).call(this)},e(this,o).onerror=()=>{e(this,Q).call(this,e(this,v))}}else n(this,v,null),this.consumeSource(null)},J=new WeakMap,H=new WeakMap,Q=new WeakMap;class me extends F{createConsumer(){return document.createElement("img")}consumeSource(r){if(r&&this.hasAttribute("webp")&&ye.device.isWebp){const t=r.split(".").slice(0,-1).join(".")+".webp";this.consumerElement.src=t}else this.consumerElement.src=r||""}}customElements.get("e-image")||customElements.define("e-image",me);function we(a){const r=a.match(/\{([\d-]+)\}/);if(r){const t=r[1].split("-");if(t.length===2){const i=parseInt(t[0],10),u=parseInt(t[1],10);return{start:i,end:u}}}return null}var p,R,U,S,w,I,A,O,y,L;class fe extends F{constructor(t){super();s(this,p,[]);s(this,R,new D.CSSProperty(this,"--fit","contain"));s(this,U,new D.CSSProperty(this,"--autoplay",!1));s(this,S,new D.CSSProperty(this,"--offset-x",.5));s(this,w,new D.CSSProperty(this,"--offset-y",.5));s(this,I,null);s(this,A,0);s(this,O,1);s(this,y,()=>{if(e(this,p).length){const t=e(this,p)[0];e(this,R).current==="cover"?n(this,I,ue.cover(t.naturalWidth,t.naturalHeight,this.consumerElement.width,this.consumerElement.height,e(this,S).current,e(this,w).current)):n(this,I,ue.contain(t.naturalWidth,t.naturalHeight,this.consumerElement.width,this.consumerElement.height,e(this,S).current,e(this,w).current))}});s(this,L,t=>{if(this.status.isFalse("loaded")||!e(this,I))return;t.detail.context.clearRect(0,0,t.detail.width,t.detail.height);const i=e(this,p)[e(this,A)];i&&t.detail.context.drawImage(i,...e(this,I)),e(this,U).current&&n(this,A,(e(this,A)+1)%e(this,p).length)});le.isBrowser&&(n(this,O,parseInt(((t==null?void 0:t.pad)||this.getAttribute("pad")||"1").toString())),e(this,R).subscribe(e(this,y)),e(this,S).subscribe(e(this,y)),e(this,w).subscribe(e(this,y)),this.addEventListener("sourceCapture",i=>{this.consumerElement.addEventListener("canvasRender",e(this,L))}),this.addEventListener("sourceRelease",i=>{this.consumerElement.removeEventListener("canvasRender",e(this,L))}))}setProgress(t){e(this,p).length&&n(this,A,Math.floor((e(this,p).length-1)*t))}connectedCallback(){super.connectedCallback(),e(this,U).observe(),e(this,R).observe(),e(this,S).observe(),e(this,w).observe(),ce.elementResizer.subscribe(this,e(this,y))}disconnectedCallback(){super.disconnectedCallback(),e(this,U).unobserve(),e(this,R).unobserve(),e(this,S).unobserve(),e(this,w).unobserve(),n(this,p,[]),ce.elementResizer.unsubscribe(e(this,y)),this.consumerElement.removeEventListener("canvasRender",e(this,L))}createConsumer(){return new ve.CanvasElement}consumeSource(t){return he(this,null,function*(){var i,u,b,N;if(t){this.consumerElement.removeEventListener("canvasRender",e(this,L));const g=[],m=we(t);if(m)for(let l=m.start;l<=m.end;l++){const ae=t.replace(/\{([^}]+)\}/,l.toString().padStart(e(this,O),"0")),j=new Image;j.src=ae,g.push(j)}else{const l=new Image;l.src=t,g.push(l)}try{yield Promise.all(g.map((l,ae)=>new Promise((j,be)=>{l.onload=()=>{j()},l.onerror=Le=>{be(`${l.src} Image not found`)}}))),n(this,p,g),e(this,y).call(this),(u=(i=this.consumerElement).onload)==null||u.call(i,new Event("load")),this.isLazy||this.consumerElement.addEventListener("canvasRender",e(this,L))}catch(l){console.error(l),(N=(b=this.consumerElement).onerror)==null||N.call(b,new Event("error"))}}})}}p=new WeakMap,R=new WeakMap,U=new WeakMap,S=new WeakMap,w=new WeakMap,I=new WeakMap,A=new WeakMap,O=new WeakMap,y=new WeakMap,L=new WeakMap;customElements.get("e-sequence")||customElements.define("e-sequence",fe);var P,B;class pe extends F{constructor(){super(...arguments);s(this,P,0);s(this,B,()=>{this.classList.add(`state-${this.consumerElement.readyState}`);const t=this.consumerElement.readyState/4;t>e(this,P)&&n(this,P,t),X.dispatchEvent(this,"videoReadyStateChange",{detail:{readyState:this.consumerElement.readyState,progress:e(this,P)}}),this.consumerElement.readyState===4&&re.ticker.unsubscribe(e(this,B))})}connectedCallback(){super.connectedCallback(),this.addEventListener("sourceCapture",()=>{re.ticker.subscribe(e(this,B)),this.hasAttribute("capture-autoplay")&&this.consumerElement.play()}),this.addEventListener("sourceRelease",()=>{this.hasAttribute("capture-autoplay")&&(this.consumerElement.pause(),this.hasAttribute("replay")&&(this.consumerElement.currentTime=0)),this.hasAttribute("reload-source")&&this.classList.remove("state-0","state-1","state-2","state-3","state-4")})}disconnectedCallback(){super.disconnectedCallback(),re.ticker.unsubscribe(e(this,B)),n(this,P,0)}createConsumer(){return document.createElement("video")}consumeSource(t){this.consumerElement.src=t||"",this.consumerElement.autoplay=!0}}P=new WeakMap,B=new WeakMap;customElements.get("e-video")||customElements.define("e-video",pe);var c,M,k,W,Z,ee,te,Y,ne;const T=class T extends F{constructor(){super();s(this,Y);s(this,c);s(this,M);s(this,k,!1);s(this,W,()=>{n(this,k,this.hasAttribute("autoplay")&&!this.hasAttribute("capture-autoplay")),n(this,c,new window.YT.Player(e(this,M),{playerVars:{mute:this.hasAttribute("muted")?1:0,controls:this.hasAttribute("controls")?1:0},events:{onReady:e(this,Z),onError:e(this,ee),onStateChange:e(this,te)}}))});s(this,Z,()=>{x(this,Y,ne).call(this)});s(this,ee,t=>{var i,u;console.error("YouTube: Ошибка при загрузке видео:",this.currentURL,t),(u=(i=this.consumerElement).onerror)==null||u.call(i,new Event("error"))});s(this,te,()=>{});n(this,M,"yt-"+de.generateId(10)),T.__apiReady||(window.onYouTubeIframeAPIReady=()=>{T.__apiReady=!0,X.dispatchEvent(window,"youTubeIframeAPIReady")}),this.addEventListener("sourceCapture",()=>{this.hasAttribute("capture-autoplay")&&(e(this,c)?e(this,c).playVideo():n(this,k,!0))}),this.addEventListener("sourceRelease",()=>{e(this,c)&&this.hasAttribute("capture-autoplay")&&(e(this,c).pauseVideo(),this.hasAttribute("replay")&&e(this,c).seekTo(0))})}static __onYouTubeIframeAPIReady(){this.__apiReady=!0}createConsumer(){const t=document.createElement("div");return t.id=e(this,M),t}consumeSource(t){var i;if(t){if(!document.getElementById("youtube-script")){const u=document.createElement("script");u.id,u.src="https://www.youtube.com/iframe_api";const b=document.getElementsByTagName("script")[0];(i=b.parentNode)==null||i.insertBefore(u,b)}e(this,c)?x(this,Y,ne).call(this):T.__apiReady?e(this,W).call(this):addEventListener("youTubeIframeAPIReady",e(this,W))}else e(this,c)&&e(this,c).stopVideo()}disconnectedCallback(){super.disconnectedCallback(),e(this,c)&&e(this,c).destroy(),removeEventListener("youTubeIframeAPIReady",e(this,W))}};c=new WeakMap,M=new WeakMap,k=new WeakMap,W=new WeakMap,Z=new WeakMap,ee=new WeakMap,te=new WeakMap,Y=new WeakSet,ne=function(){var t,i;this.currentURL&&(this.currentURL.startsWith("http")?e(this,c).loadVideoByUrl(this.currentURL):e(this,c).loadVideoById(this.currentURL)),e(this,k)?e(this,c).playVideo():e(this,c).stopVideo(),n(this,k,!1),(i=(t=this.consumerElement).onload)==null||i.call(t,new Event("load"))},T.__apiReady=!1;let G=T;customElements.get("e-youtube")||customElements.define("e-youtube",G);exports.ImageElement=me;exports.SequenceElement=fe;exports.SourceElement=F;exports.VideoElement=pe;exports.YouTubeElement=G;
@@ -2,3 +2,4 @@ export { ImageElement } from './image';
2
2
  export { SequenceElement, type SequenceElementParameters } from './sequence';
3
3
  export { SourceElement, type SourceEvents } from './source';
4
4
  export { VideoElement, type VideoEvents } from './video';
5
+ export { YouTubeElement } from './youtube';
@@ -1,286 +1,287 @@
1
- var G = (r) => {
2
- throw TypeError(r);
1
+ var oe = (a) => {
2
+ throw TypeError(a);
3
3
  };
4
- var U = (r, i, t) => i.has(r) || G("Cannot " + t);
5
- var e = (r, i, t) => (U(r, i, "read from private field"), t ? t.call(r) : i.get(r)), s = (r, i, t) => i.has(r) ? G("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(r) : i.set(r, t), o = (r, i, t, n) => (U(r, i, "write to private field"), n ? n.call(r, t) : i.set(r, t), t), B = (r, i, t) => (U(r, i, "access private method"), t);
6
- var J = (r, i, t) => new Promise((n, l) => {
7
- var S = (m) => {
4
+ var te = (a, r, t) => r.has(a) || oe("Cannot " + t);
5
+ var e = (a, r, t) => (te(a, r, "read from private field"), t ? t.call(a) : r.get(a)), s = (a, r, t) => r.has(a) ? oe("Cannot add the same private member more than once") : r instanceof WeakSet ? r.add(a) : r.set(a, t), n = (a, r, t, i) => (te(a, r, "write to private field"), i ? i.call(a, t) : r.set(a, t), t), T = (a, r, t) => (te(a, r, "access private method"), t);
6
+ var he = (a, r, t) => new Promise((i, u) => {
7
+ var b = (m) => {
8
8
  try {
9
- b(t.next(m));
10
- } catch (c) {
11
- l(c);
9
+ g(t.next(m));
10
+ } catch (l) {
11
+ u(l);
12
12
  }
13
- }, W = (m) => {
13
+ }, O = (m) => {
14
14
  try {
15
- b(t.throw(m));
16
- } catch (c) {
17
- l(c);
15
+ g(t.throw(m));
16
+ } catch (l) {
17
+ u(l);
18
18
  }
19
- }, b = (m) => m.done ? n(m.value) : Promise.resolve(m.value).then(S, W);
20
- b((t = t.apply(r, i)).next());
19
+ }, g = (m) => m.done ? i(m.value) : Promise.resolve(m.value).then(b, O);
20
+ g((t = t.apply(a, r)).next());
21
21
  });
22
- import { device as ee } from "../device/index.js";
23
- import { SourceManager as te } from "../source/index.js";
24
- import { ClassLinkedStatus as se } from "../class-linked-status/index.js";
25
- import { i as Z } from "../browser-0zX67oeU.js";
26
- import { d as N } from "../events-CsVF98U6.js";
27
- import { k as ie } from "../string-f0Dnk0L1.js";
28
- import { loading as j } from "../loading/index.js";
29
- import { CSSProperty as F } from "../css-property/index.js";
30
- import { elementResizer as Q } from "../element-resizer/vanilla/index.js";
31
- import { c as re, a as ne } from "../canvas-DeZ0SLUJ.js";
32
- import { CanvasElement as oe } from "../canvas/index.js";
33
- import { ticker as K } from "../ticker/vanilla/index.js";
34
- let ae = 0;
35
- var u, a, g, x, d, M, C, h, A, R, P, O, V, $, D;
36
- class X extends HTMLElement {
22
+ import { device as de } from "../device/index.js";
23
+ import { SourceManager as me } from "../source/index.js";
24
+ import { ClassLinkedStatus as fe } from "../class-linked-status/index.js";
25
+ import { i as ue } from "../browser-0zX67oeU.js";
26
+ import { d as K } from "../events-CsVF98U6.js";
27
+ import { k as pe, g as be } from "../string-f0Dnk0L1.js";
28
+ import { loading as se } from "../loading/index.js";
29
+ import { CSSProperty as D } from "../css-property/index.js";
30
+ import { elementResizer as ce } from "../element-resizer/vanilla/index.js";
31
+ import { c as ye, a as ge } from "../canvas-DeZ0SLUJ.js";
32
+ import { CanvasElement as Ee } from "../canvas/index.js";
33
+ import { ticker as ie } from "../ticker/vanilla/index.js";
34
+ let ve = 0;
35
+ var d, o, E, V, f, H, S, h, U, z, v, _, j, X, q, G;
36
+ class ee extends HTMLElement {
37
37
  constructor() {
38
38
  super();
39
- s(this, P);
40
- s(this, u, null);
41
- s(this, a, null);
42
- s(this, g, !1);
43
- s(this, x, !1);
44
- s(this, d, !1);
45
- s(this, M, "");
46
- s(this, C, "");
47
- s(this, h, new se(this, {
39
+ s(this, _);
40
+ s(this, d, null);
41
+ s(this, o, null);
42
+ s(this, E, !1);
43
+ s(this, V, !1);
44
+ s(this, f, !1);
45
+ s(this, H, "");
46
+ s(this, S, "");
47
+ s(this, h, new fe(this, {
48
48
  loading: !1,
49
49
  loaded: !1,
50
50
  error: !1,
51
51
  clear: !1
52
52
  }));
53
- s(this, A, null);
54
- s(this, R);
55
- s(this, V, (t) => {
56
- const n = t[0];
57
- e(this, d) && (!e(this, x) || this.hasAttribute("reload-source")) && n.isIntersecting && this.triggerLazyLoad(), n.isIntersecting ? N(this, "sourceCapture", { custom: !0 }) : (this.hasAttribute("reload-source") && B(this, P, O).call(this, void 0), N(this, "sourceRelease", { custom: !0 }));
53
+ s(this, U, null);
54
+ s(this, z);
55
+ s(this, v, null);
56
+ s(this, X, (t) => {
57
+ const i = t[0];
58
+ e(this, f) && (!e(this, V) || this.hasAttribute("reload-source")) && i.isIntersecting && this.triggerLazyLoad(), i.isIntersecting ? K(this, "sourceCapture", { custom: !0 }) : (this.hasAttribute("reload-source") && T(this, _, j).call(this, void 0), K(this, "sourceRelease", { custom: !0 }));
58
59
  });
59
- s(this, $, () => {
60
- e(this, h).set("loaded", !0), e(this, h).set("error", !1), e(this, h).set("loading", !1), !e(this, d) && !e(this, g) && j.complete(e(this, C));
60
+ s(this, q, () => {
61
+ e(this, h).set("loaded", !0), e(this, h).set("error", !1), e(this, h).set("loading", !1), !e(this, f) && !e(this, E) && se.complete(e(this, S));
61
62
  const t = getComputedStyle(this).getPropertyValue("--clear-duration");
62
- t && o(this, R, setTimeout(
63
- () => e(this, h).set("clear", !0),
64
- parseFloat(t) * 1e3
65
- )), o(this, g, !0);
63
+ t ? n(this, z, setTimeout(() => {
64
+ e(this, h).set("clear", !0);
65
+ }, parseFloat(t) * 1e3)) : e(this, h).set("clear", !0), n(this, E, !0);
66
66
  });
67
- s(this, D, (t) => {
68
- e(this, h).set("loaded", !1), e(this, h).set("error", !0), e(this, h).set("loading", !1), !e(this, d) && !e(this, g) && j.error(e(this, C)), o(this, g, !0);
67
+ s(this, G, (t) => {
68
+ e(this, h).set("loaded", !1), e(this, h).set("error", !0), e(this, h).set("loading", !1), !e(this, f) && !e(this, E) && se.error(e(this, S)), n(this, E, !0);
69
69
  });
70
- Z && window.IntersectionObserver && (o(this, M, `source-consumer-${++ae}`), o(this, A, new IntersectionObserver(
71
- e(this, V)
70
+ ue && window.IntersectionObserver && (n(this, H, `source-consumer-${++ve}`), n(this, U, new IntersectionObserver(
71
+ e(this, X)
72
72
  )));
73
73
  }
74
74
  get consumerElement() {
75
- return e(this, a);
75
+ return e(this, o);
76
76
  }
77
77
  get sourceManager() {
78
- return e(this, u);
78
+ return e(this, d);
79
79
  }
80
80
  get status() {
81
81
  return e(this, h);
82
82
  }
83
83
  get isLazy() {
84
- return e(this, d);
84
+ return e(this, f);
85
+ }
86
+ get currentURL() {
87
+ return e(this, v);
85
88
  }
86
89
  triggerLazyLoad() {
87
- e(this, u).current && e(this, u).current !== e(this, u).previous && B(this, P, O).call(this, e(this, u).current), o(this, x, !0);
90
+ e(this, d).current && e(this, d).current !== e(this, d).previous && T(this, _, j).call(this, e(this, d).current), n(this, V, !0);
88
91
  }
89
92
  connectedCallback() {
90
93
  const t = this.getAttribute("srcset");
91
- t && (o(this, a, this.createConsumer()), e(this, a).style.cssText = `
94
+ t && (n(this, o, this.createConsumer()), e(this, o).style.cssText = `
92
95
  display: block;
93
96
  width: 100%;
94
97
  height: 100%;
95
- `, e(this, a).classList.add("source-consumer"), Array.from(this.attributes).forEach((n) => {
96
- if (n.name !== "srcset") {
97
- const l = n.nodeValue || "", S = ie(n.name);
98
- S in e(this, a) && (e(this, a)[S] = l || !0);
98
+ `, e(this, o).classList.add("source-consumer"), Array.from(this.attributes).forEach((i) => {
99
+ if (i.name !== "srcset") {
100
+ const u = i.nodeValue || "", b = pe(i.name);
101
+ b in e(this, o) && (e(this, o)[b] = u || !0);
99
102
  }
100
- }), this.appendChild(e(this, a)), o(this, u, new te({
103
+ }), this.appendChild(e(this, o)), n(this, d, new me({
101
104
  srcset: t
102
- })), o(this, d, this.hasAttribute("lazy")), e(this, u).subscribe((n) => {
103
- (!e(this, d) || e(this, d) && e(this, x)) && B(this, P, O).call(this, n.current);
104
- }), e(this, A).observe(this), e(this, u).connect());
105
+ })), n(this, f, this.hasAttribute("lazy")), e(this, d).subscribe((i) => {
106
+ (!e(this, f) || e(this, f) && e(this, V)) && T(this, _, j).call(this, i.current);
107
+ }), e(this, U).observe(this), e(this, d).connect());
105
108
  }
106
109
  disconnectedCallback() {
107
- e(this, A).disconnect(), e(this, u).close(), e(this, a).onloadeddata = null, e(this, a).onload = null, e(this, a).onerror = null, e(this, a).remove(), e(this, h).reset(), clearTimeout(e(this, R));
110
+ e(this, U).disconnect(), e(this, d).close(), e(this, o).onloadeddata = null, e(this, o).onload = null, e(this, o).onerror = null, e(this, o).remove(), e(this, h).reset(), clearTimeout(e(this, z));
108
111
  }
109
112
  }
110
- u = new WeakMap(), a = new WeakMap(), g = new WeakMap(), x = new WeakMap(), d = new WeakMap(), M = new WeakMap(), C = new WeakMap(), h = new WeakMap(), A = new WeakMap(), R = new WeakMap(), P = new WeakSet(), O = function(t) {
111
- if (clearTimeout(e(this, R)), e(this, a).onloadeddata = null, e(this, a).onload = null, e(this, a).onerror = null, e(this, h).set("loaded", !1), e(this, h).set("error", !1), e(this, h).set("loading", !1), e(this, h).set("clear", !1), t) {
112
- o(this, C, `${e(this, M)}-${t.url}`);
113
- const n = this.hasAttribute("keep-source-parameters");
114
- e(this, h).set("loading", !0);
115
- const l = n ? t.url : t.name + t.extension;
116
- this.consumeSource(l), !e(this, d) && !e(this, g) && j.add(e(this, C)), e(this, a).onloadeddata = () => {
117
- e(this, $).call(this);
118
- }, e(this, a).onload = () => {
119
- e(this, $).call(this);
120
- }, e(this, a).onerror = () => {
121
- e(this, D).call(this, l);
113
+ d = new WeakMap(), o = new WeakMap(), E = new WeakMap(), V = new WeakMap(), f = new WeakMap(), H = new WeakMap(), S = new WeakMap(), h = new WeakMap(), U = new WeakMap(), z = new WeakMap(), v = new WeakMap(), _ = new WeakSet(), j = function(t) {
114
+ if (clearTimeout(e(this, z)), e(this, o).onloadeddata = null, e(this, o).onload = null, e(this, o).onerror = null, e(this, h).set("loaded", !1), e(this, h).set("error", !1), e(this, h).set("loading", !1), e(this, h).set("clear", !1), t) {
115
+ n(this, S, `${e(this, H)}-${t.url}`);
116
+ const i = this.hasAttribute("keep-source-parameters");
117
+ e(this, h).set("loading", !0), n(this, v, i ? t.url : t.name + t.extension), this.consumeSource(e(this, v)), !e(this, f) && !e(this, E) && se.add(e(this, S)), e(this, o).onloadeddata = () => {
118
+ e(this, q).call(this);
119
+ }, e(this, o).onload = () => {
120
+ e(this, q).call(this);
121
+ }, e(this, o).onerror = () => {
122
+ e(this, G).call(this, e(this, v));
122
123
  };
123
124
  } else
124
- this.consumeSource(null);
125
- }, V = new WeakMap(), $ = new WeakMap(), D = new WeakMap();
126
- class he extends X {
125
+ n(this, v, null), this.consumeSource(null);
126
+ }, X = new WeakMap(), q = new WeakMap(), G = new WeakMap();
127
+ class we extends ee {
127
128
  createConsumer() {
128
129
  return document.createElement("img");
129
130
  }
130
- consumeSource(i) {
131
- if (i && this.hasAttribute("webp") && ee.isWebp) {
132
- const t = i.split(".").slice(0, -1).join(".") + ".webp";
131
+ consumeSource(r) {
132
+ if (r && this.hasAttribute("webp") && de.isWebp) {
133
+ const t = r.split(".").slice(0, -1).join(".") + ".webp";
133
134
  this.consumerElement.src = t;
134
135
  } else
135
- this.consumerElement.src = i || "";
136
+ this.consumerElement.src = r || "";
136
137
  }
137
138
  }
138
- customElements.get("e-image") || customElements.define("e-image", he);
139
- function ce(r) {
140
- const i = r.match(/\{([\d-]+)\}/);
141
- if (i) {
142
- const t = i[1].split("-");
139
+ customElements.get("e-image") || customElements.define("e-image", we);
140
+ function Le(a) {
141
+ const r = a.match(/\{([\d-]+)\}/);
142
+ if (r) {
143
+ const t = r[1].split("-");
143
144
  if (t.length === 2) {
144
- const n = parseInt(t[0], 10), l = parseInt(t[1], 10);
145
- return { start: n, end: l };
145
+ const i = parseInt(t[0], 10), u = parseInt(t[1], 10);
146
+ return { start: i, end: u };
146
147
  }
147
148
  }
148
149
  return null;
149
150
  }
150
- var f, w, z, E, v, L, k, H, p, y;
151
- class le extends X {
151
+ var p, R, B, w, L, I, A, F, y, C;
152
+ class Ce extends ee {
152
153
  constructor(t) {
153
154
  super();
154
- s(this, f, []);
155
- s(this, w, new F(
155
+ s(this, p, []);
156
+ s(this, R, new D(
156
157
  this,
157
158
  "--fit",
158
159
  "contain"
159
160
  ));
160
- s(this, z, new F(this, "--autoplay", !1));
161
- s(this, E, new F(this, "--offset-x", 0.5));
162
- s(this, v, new F(this, "--offset-y", 0.5));
163
- s(this, L, null);
164
- s(this, k, 0);
165
- s(this, H, 1);
166
- s(this, p, () => {
167
- if (e(this, f).length) {
168
- const t = e(this, f)[0];
169
- e(this, w).current === "cover" ? o(this, L, re(
161
+ s(this, B, new D(this, "--autoplay", !1));
162
+ s(this, w, new D(this, "--offset-x", 0.5));
163
+ s(this, L, new D(this, "--offset-y", 0.5));
164
+ s(this, I, null);
165
+ s(this, A, 0);
166
+ s(this, F, 1);
167
+ s(this, y, () => {
168
+ if (e(this, p).length) {
169
+ const t = e(this, p)[0];
170
+ e(this, R).current === "cover" ? n(this, I, ye(
170
171
  t.naturalWidth,
171
172
  t.naturalHeight,
172
173
  this.consumerElement.width,
173
174
  this.consumerElement.height,
174
- e(this, E).current,
175
- e(this, v).current
176
- )) : o(this, L, ne(
175
+ e(this, w).current,
176
+ e(this, L).current
177
+ )) : n(this, I, ge(
177
178
  t.naturalWidth,
178
179
  t.naturalHeight,
179
180
  this.consumerElement.width,
180
181
  this.consumerElement.height,
181
- e(this, E).current,
182
- e(this, v).current
182
+ e(this, w).current,
183
+ e(this, L).current
183
184
  ));
184
185
  }
185
186
  });
186
- s(this, y, (t) => {
187
- if (this.status.isFalse("loaded") || !e(this, L))
187
+ s(this, C, (t) => {
188
+ if (this.status.isFalse("loaded") || !e(this, I))
188
189
  return;
189
190
  t.detail.context.clearRect(0, 0, t.detail.width, t.detail.height);
190
- const n = e(this, f)[e(this, k)];
191
- n && t.detail.context.drawImage(n, ...e(this, L)), e(this, z).current && o(this, k, (e(this, k) + 1) % e(this, f).length);
191
+ const i = e(this, p)[e(this, A)];
192
+ i && t.detail.context.drawImage(i, ...e(this, I)), e(this, B).current && n(this, A, (e(this, A) + 1) % e(this, p).length);
192
193
  });
193
- Z && (o(this, H, parseInt(
194
+ ue && (n(this, F, parseInt(
194
195
  ((t == null ? void 0 : t.pad) || this.getAttribute("pad") || "1").toString()
195
- )), e(this, w).subscribe(e(this, p)), e(this, E).subscribe(e(this, p)), e(this, v).subscribe(e(this, p)), this.addEventListener("sourceCapture", (n) => {
196
+ )), e(this, R).subscribe(e(this, y)), e(this, w).subscribe(e(this, y)), e(this, L).subscribe(e(this, y)), this.addEventListener("sourceCapture", (i) => {
196
197
  this.consumerElement.addEventListener(
197
198
  "canvasRender",
198
- e(this, y)
199
+ e(this, C)
199
200
  );
200
- }), this.addEventListener("sourceRelease", (n) => {
201
+ }), this.addEventListener("sourceRelease", (i) => {
201
202
  this.consumerElement.removeEventListener(
202
203
  "canvasRender",
203
- e(this, y)
204
+ e(this, C)
204
205
  );
205
206
  }));
206
207
  }
207
208
  setProgress(t) {
208
- e(this, f).length && o(this, k, Math.floor((e(this, f).length - 1) * t));
209
+ e(this, p).length && n(this, A, Math.floor((e(this, p).length - 1) * t));
209
210
  }
210
211
  connectedCallback() {
211
- super.connectedCallback(), e(this, z).observe(), e(this, w).observe(), e(this, E).observe(), e(this, v).observe(), Q.subscribe(this, e(this, p));
212
+ super.connectedCallback(), e(this, B).observe(), e(this, R).observe(), e(this, w).observe(), e(this, L).observe(), ce.subscribe(this, e(this, y));
212
213
  }
213
214
  disconnectedCallback() {
214
- super.disconnectedCallback(), e(this, z).unobserve(), e(this, w).unobserve(), e(this, E).unobserve(), e(this, v).unobserve(), o(this, f, []), Q.unsubscribe(e(this, p)), this.consumerElement.removeEventListener(
215
+ super.disconnectedCallback(), e(this, B).unobserve(), e(this, R).unobserve(), e(this, w).unobserve(), e(this, L).unobserve(), n(this, p, []), ce.unsubscribe(e(this, y)), this.consumerElement.removeEventListener(
215
216
  "canvasRender",
216
- e(this, y)
217
+ e(this, C)
217
218
  );
218
219
  }
219
220
  createConsumer() {
220
- return new oe();
221
+ return new Ee();
221
222
  }
222
223
  consumeSource(t) {
223
- return J(this, null, function* () {
224
- var n, l, S, W;
224
+ return he(this, null, function* () {
225
+ var i, u, b, O;
225
226
  if (t) {
226
227
  this.consumerElement.removeEventListener(
227
228
  "canvasRender",
228
- e(this, y)
229
+ e(this, C)
229
230
  );
230
- const b = [], m = ce(t);
231
+ const g = [], m = Le(t);
231
232
  if (m)
232
- for (let c = m.start; c <= m.end; c++) {
233
- const Y = t.replace(
233
+ for (let l = m.start; l <= m.end; l++) {
234
+ const ae = t.replace(
234
235
  /\{([^}]+)\}/,
235
- c.toString().padStart(e(this, H), "0")
236
- ), q = new Image();
237
- q.src = Y, b.push(q);
236
+ l.toString().padStart(e(this, F), "0")
237
+ ), Y = new Image();
238
+ Y.src = ae, g.push(Y);
238
239
  }
239
240
  else {
240
- const c = new Image();
241
- c.src = t, b.push(c);
241
+ const l = new Image();
242
+ l.src = t, g.push(l);
242
243
  }
243
244
  try {
244
245
  yield Promise.all(
245
- b.map((c, Y) => new Promise((q, _) => {
246
- c.onload = () => {
247
- q();
248
- }, c.onerror = (me) => {
249
- _(`${c.src} Image not found`);
246
+ g.map((l, ae) => new Promise((Y, le) => {
247
+ l.onload = () => {
248
+ Y();
249
+ }, l.onerror = (Re) => {
250
+ le(`${l.src} Image not found`);
250
251
  };
251
252
  }))
252
- ), o(this, f, b), e(this, p).call(this), (l = (n = this.consumerElement).onload) == null || l.call(n, new Event("load")), this.isLazy || this.consumerElement.addEventListener(
253
+ ), n(this, p, g), e(this, y).call(this), (u = (i = this.consumerElement).onload) == null || u.call(i, new Event("load")), this.isLazy || this.consumerElement.addEventListener(
253
254
  "canvasRender",
254
- e(this, y)
255
+ e(this, C)
255
256
  );
256
- } catch (c) {
257
- console.error(c), (W = (S = this.consumerElement).onerror) == null || W.call(S, new Event("error"));
257
+ } catch (l) {
258
+ console.error(l), (O = (b = this.consumerElement).onerror) == null || O.call(b, new Event("error"));
258
259
  }
259
260
  }
260
261
  });
261
262
  }
262
263
  }
263
- f = new WeakMap(), w = new WeakMap(), z = new WeakMap(), E = new WeakMap(), v = new WeakMap(), L = new WeakMap(), k = new WeakMap(), H = new WeakMap(), p = new WeakMap(), y = new WeakMap();
264
- customElements.get("e-sequence") || customElements.define("e-sequence", le);
265
- var I, T;
266
- class ue extends X {
264
+ p = new WeakMap(), R = new WeakMap(), B = new WeakMap(), w = new WeakMap(), L = new WeakMap(), I = new WeakMap(), A = new WeakMap(), F = new WeakMap(), y = new WeakMap(), C = new WeakMap();
265
+ customElements.get("e-sequence") || customElements.define("e-sequence", Ce);
266
+ var k, M;
267
+ class Se extends ee {
267
268
  constructor() {
268
269
  super(...arguments);
269
- s(this, I, 0);
270
- s(this, T, () => {
270
+ s(this, k, 0);
271
+ s(this, M, () => {
271
272
  this.classList.add(`state-${this.consumerElement.readyState}`);
272
273
  const t = this.consumerElement.readyState / 4;
273
- t > e(this, I) && o(this, I, t), N(this, "videoReadyStateChange", {
274
+ t > e(this, k) && n(this, k, t), K(this, "videoReadyStateChange", {
274
275
  detail: {
275
276
  readyState: this.consumerElement.readyState,
276
- progress: e(this, I)
277
+ progress: e(this, k)
277
278
  }
278
- }), this.consumerElement.readyState === 4 && K.unsubscribe(e(this, T));
279
+ }), this.consumerElement.readyState === 4 && ie.unsubscribe(e(this, M));
279
280
  });
280
281
  }
281
282
  connectedCallback() {
282
283
  super.connectedCallback(), this.addEventListener("sourceCapture", () => {
283
- K.subscribe(e(this, T)), this.hasAttribute("capture-autoplay") && this.consumerElement.play();
284
+ ie.subscribe(e(this, M)), this.hasAttribute("capture-autoplay") && this.consumerElement.play();
284
285
  }), this.addEventListener("sourceRelease", () => {
285
286
  this.hasAttribute("capture-autoplay") && (this.consumerElement.pause(), this.hasAttribute("replay") && (this.consumerElement.currentTime = 0)), this.hasAttribute("reload-source") && this.classList.remove(
286
287
  "state-0",
@@ -292,7 +293,7 @@ class ue extends X {
292
293
  });
293
294
  }
294
295
  disconnectedCallback() {
295
- super.disconnectedCallback(), K.unsubscribe(e(this, T)), o(this, I, 0);
296
+ super.disconnectedCallback(), ie.unsubscribe(e(this, M)), n(this, k, 0);
296
297
  }
297
298
  createConsumer() {
298
299
  return document.createElement("video");
@@ -301,11 +302,79 @@ class ue extends X {
301
302
  this.consumerElement.src = t || "", this.consumerElement.autoplay = !0;
302
303
  }
303
304
  }
304
- I = new WeakMap(), T = new WeakMap();
305
- customElements.get("e-video") || customElements.define("e-video", ue);
305
+ k = new WeakMap(), M = new WeakMap();
306
+ customElements.get("e-video") || customElements.define("e-video", Se);
307
+ var c, W, P, $, J, Q, Z, N, ne;
308
+ const x = class x extends ee {
309
+ constructor() {
310
+ super();
311
+ s(this, N);
312
+ s(this, c);
313
+ s(this, W);
314
+ s(this, P, !1);
315
+ s(this, $, () => {
316
+ n(this, P, this.hasAttribute("autoplay") && !this.hasAttribute("capture-autoplay")), n(this, c, new window.YT.Player(e(this, W), {
317
+ playerVars: {
318
+ mute: this.hasAttribute("muted") ? 1 : 0,
319
+ controls: this.hasAttribute("controls") ? 1 : 0
320
+ },
321
+ events: {
322
+ onReady: e(this, J),
323
+ onError: e(this, Q),
324
+ onStateChange: e(this, Z)
325
+ }
326
+ }));
327
+ });
328
+ s(this, J, () => {
329
+ T(this, N, ne).call(this);
330
+ });
331
+ s(this, Q, (t) => {
332
+ var i, u;
333
+ console.error("YouTube: Ошибка при загрузке видео:", this.currentURL, t), (u = (i = this.consumerElement).onerror) == null || u.call(i, new Event("error"));
334
+ });
335
+ s(this, Z, () => {
336
+ });
337
+ n(this, W, "yt-" + be(10)), x.__apiReady || (window.onYouTubeIframeAPIReady = () => {
338
+ x.__apiReady = !0, K(window, "youTubeIframeAPIReady");
339
+ }), this.addEventListener("sourceCapture", () => {
340
+ this.hasAttribute("capture-autoplay") && (e(this, c) ? e(this, c).playVideo() : n(this, P, !0));
341
+ }), this.addEventListener("sourceRelease", () => {
342
+ e(this, c) && this.hasAttribute("capture-autoplay") && (e(this, c).pauseVideo(), this.hasAttribute("replay") && e(this, c).seekTo(0));
343
+ });
344
+ }
345
+ static __onYouTubeIframeAPIReady() {
346
+ this.__apiReady = !0;
347
+ }
348
+ createConsumer() {
349
+ const t = document.createElement("div");
350
+ return t.id = e(this, W), t;
351
+ }
352
+ consumeSource(t) {
353
+ var i;
354
+ if (t) {
355
+ if (!document.getElementById("youtube-script")) {
356
+ const u = document.createElement("script");
357
+ u.id, u.src = "https://www.youtube.com/iframe_api";
358
+ const b = document.getElementsByTagName("script")[0];
359
+ (i = b.parentNode) == null || i.insertBefore(u, b);
360
+ }
361
+ e(this, c) ? T(this, N, ne).call(this) : x.__apiReady ? e(this, $).call(this) : addEventListener("youTubeIframeAPIReady", e(this, $));
362
+ } else e(this, c) && e(this, c).stopVideo();
363
+ }
364
+ disconnectedCallback() {
365
+ super.disconnectedCallback(), e(this, c) && e(this, c).destroy(), removeEventListener("youTubeIframeAPIReady", e(this, $));
366
+ }
367
+ };
368
+ c = new WeakMap(), W = new WeakMap(), P = new WeakMap(), $ = new WeakMap(), J = new WeakMap(), Q = new WeakMap(), Z = new WeakMap(), N = new WeakSet(), ne = function() {
369
+ var t, i;
370
+ this.currentURL && (this.currentURL.startsWith("http") ? e(this, c).loadVideoByUrl(this.currentURL) : e(this, c).loadVideoById(this.currentURL)), e(this, P) ? e(this, c).playVideo() : e(this, c).stopVideo(), n(this, P, !1), (i = (t = this.consumerElement).onload) == null || i.call(t, new Event("load"));
371
+ }, x.__apiReady = !1;
372
+ let re = x;
373
+ customElements.get("e-youtube") || customElements.define("e-youtube", re);
306
374
  export {
307
- he as ImageElement,
308
- le as SequenceElement,
309
- X as SourceElement,
310
- ue as VideoElement
375
+ we as ImageElement,
376
+ Ce as SequenceElement,
377
+ ee as SourceElement,
378
+ Se as VideoElement,
379
+ re as YouTubeElement
311
380
  };
@@ -17,6 +17,7 @@ export declare abstract class SourceElement<T extends HTMLElement> extends HTMLE
17
17
  clear: false;
18
18
  }>;
19
19
  get isLazy(): boolean;
20
+ get currentURL(): string | null;
20
21
  triggerLazyLoad(): void;
21
22
  protected abstract createConsumer(): T;
22
23
  protected abstract consumeSource(url: string | null): void;
@@ -0,0 +1,23 @@
1
+ import { SourceElement } from '../source';
2
+
3
+ export declare class YouTubeElement extends SourceElement<HTMLDivElement> {
4
+ #private;
5
+ static __apiReady: boolean;
6
+ static __onYouTubeIframeAPIReady(): void;
7
+ constructor();
8
+ protected createConsumer(): HTMLDivElement;
9
+ protected consumeSource(id: string | null): void;
10
+ protected disconnectedCallback(): void;
11
+ }
12
+ declare global {
13
+ interface Window {
14
+ onYouTubeIframeAPIReady: () => void;
15
+ YT: any;
16
+ }
17
+ interface WindowEventMap {
18
+ youTubeIframeAPIReady: CustomEvent;
19
+ }
20
+ interface HTMLElementTagNameMap {
21
+ 'e-youtube': YouTubeElement;
22
+ }
23
+ }
@@ -1 +1 @@
1
- "use strict";var b=a=>{throw TypeError(a)};var T=(a,e,t)=>e.has(a)||b("Cannot "+t);var s=(a,e,t)=>(T(a,e,"read from private field"),t?t.call(a):e.get(a)),o=(a,e,t)=>e.has(a)?b("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(a):e.set(a,t),n=(a,e,t,r)=>(T(a,e,"write to private field"),r?r.call(a,t):e.set(a,t),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const A=require("../order/index.cjs"),_=require("../window-resizer/vanilla/index.cjs"),B=require("../Store-CDb6RMce.cjs");var g,f,q,d,c,u,w;class k{constructor(e){o(this,g);o(this,f);o(this,q);o(this,d);o(this,c);o(this,u);o(this,w);n(this,g,e);const t=e.indexOf("?");t>=0&&(e=e.slice(0,t));const r=e.split(".");n(this,f,r.slice(0,-1).join("."));const x=/\d+x/g,h=r.find(m=>m.match(x));n(this,q,h?parseInt(h):1);const y=/\d+max/g,S=/\d+min/g,i=/\d+mar/g,l=/\d+mir/g,E=r.find(m=>m.match(y)),I=r.find(m=>m.match(S)),V=r.find(m=>m.match(i)),$=r.find(m=>m.match(l));V?(n(this,c,parseInt(V)),n(this,u,"max"),n(this,d,`(max-aspect-ratio: ${s(this,c)})`)):$?(n(this,c,parseInt($)),n(this,u,"max"),n(this,d,`(min-aspect-ratio: ${s(this,c)})`)):E?(n(this,c,parseInt(E)),n(this,u,"max"),n(this,d,`(max-width: ${s(this,c)}px)`)):I?(n(this,c,parseInt(I)),n(this,d,`(min-width: ${s(this,c)}px)`),n(this,u,"min")):(n(this,c,0),n(this,d,`(min-width: ${s(this,c)}px)`),n(this,u,"min")),n(this,f,s(this,f).replace(`.${s(this,c)}${s(this,u)}`,"")),n(this,w,"."+r[r.length-1])}get url(){return s(this,g)}get name(){return s(this,f)}get density(){return s(this,q)}get query(){return s(this,d)}get extension(){return s(this,w)}get queryType(){return s(this,u)}get queryValue(){return s(this,c)}}g=new WeakMap,f=new WeakMap,q=new WeakMap,d=new WeakMap,c=new WeakMap,u=new WeakMap,w=new WeakMap;var p;class z{constructor(e){o(this,p);n(this,p,new Map);const t=typeof e=="string"?e.trim().split(",").map(i=>i.trim()).filter(i=>!!i):e,r=[];t.forEach(i=>{const l=new k(i);r.push([l.query,l])});const x=r.filter(i=>i[1].queryType.includes("max")).sort((i,l)=>l[1].queryValue-i[1].queryValue),h=r.filter(i=>i[1].queryType.includes("min")&&i[1].queryValue!==0).sort((i,l)=>i[1].queryValue-l[1].queryValue),y=r.filter(i=>i[0]==="(min-width: 0px)");(y?[...y,...x,...h]:[...x,...h]).forEach(i=>{s(this,p).has(i[0])||s(this,p).set(i[0],[]),s(this,p).get(i[0]).push(i[1])})}get mediaBuckets(){return s(this,p)}}p=new WeakMap;var R,M;class O extends B.Store{constructor(t){super(void 0);o(this,R);o(this,M,()=>{let t;s(this,R).mediaBuckets.forEach((h,y)=>{matchMedia(y).matches&&(t=h)});let r,x=0;t==null||t.forEach(h=>{h.density>x&&h.density<=Math.max(devicePixelRatio,1)&&(x=h.density,r=h)}),t!=null&&t.length&&!r&&(r=t[0]),this.current=r});n(this,R,new z(t.srcset))}close(){super.close(),this.disconnect()}connect(){_.windowResizer.subscribe(s(this,M),A.RESIZE_ORDER.SOURCE_MANAGER)}disconnect(){_.windowResizer.unsubscribe(s(this,M))}}R=new WeakMap,M=new WeakMap;exports.Source=k;exports.SourceManager=O;exports.SourceSet=z;
1
+ "use strict";var b=r=>{throw TypeError(r)};var I=(r,n,t)=>n.has(r)||b("Cannot "+t);var e=(r,n,t)=>(I(r,n,"read from private field"),t?t.call(r):n.get(r)),o=(r,n,t)=>n.has(r)?b("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(r):n.set(r,t),i=(r,n,t,h)=>(I(r,n,"write to private field"),h?h.call(r,t):n.set(r,t),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const z=require("../order/index.cjs"),T=require("../window-resizer/vanilla/index.cjs"),A=require("../Store-CDb6RMce.cjs");var q,x,w,d,a,u,f;class _{constructor(n){o(this,q);o(this,x);o(this,w);o(this,d);o(this,a);o(this,u);o(this,f);i(this,q,n);const t=n.split(".");i(this,x,t.length>1?t.slice(0,-1).join("."):t.join("."));const h=/\d+x/g,p=t.find(l=>l.match(h));i(this,w,p?parseInt(p):1);const c=/\d+max/g,g=/\d+min/g,S=/\d+mar/g,s=/\d+mir/g,m=t.find(l=>l.match(c)),E=t.find(l=>l.match(g)),$=t.find(l=>l.match(S)),V=t.find(l=>l.match(s));$?(i(this,a,parseInt($)),i(this,u,"max"),i(this,d,`(max-aspect-ratio: ${e(this,a)})`)):V?(i(this,a,parseInt(V)),i(this,u,"max"),i(this,d,`(min-aspect-ratio: ${e(this,a)})`)):m?(i(this,a,parseInt(m)),i(this,u,"max"),i(this,d,`(max-width: ${e(this,a)}px)`)):E?(i(this,a,parseInt(E)),i(this,d,`(min-width: ${e(this,a)}px)`),i(this,u,"min")):(i(this,a,0),i(this,d,`(min-width: ${e(this,a)}px)`),i(this,u,"min")),i(this,x,e(this,x).replace(`.${e(this,a)}${e(this,u)}`,"")),i(this,f,t[t.length-1]===e(this,x)?"":"."+t[t.length-1]),i(this,f,e(this,f).replace(`.${e(this,a)}${e(this,u)}`,""))}get url(){return e(this,q)}get name(){return e(this,x)}get density(){return e(this,w)}get query(){return e(this,d)}get extension(){return e(this,f)}get queryType(){return e(this,u)}get queryValue(){return e(this,a)}}q=new WeakMap,x=new WeakMap,w=new WeakMap,d=new WeakMap,a=new WeakMap,u=new WeakMap,f=new WeakMap;var y;class k{constructor(n){o(this,y);i(this,y,new Map);const t=typeof n=="string"?n.trim().split(",").map(s=>s.trim()).filter(s=>!!s):n,h=[];t.forEach(s=>{const m=new _(s);h.push([m.query,m])});const p=h.filter(s=>s[1].queryType.includes("max")).sort((s,m)=>m[1].queryValue-s[1].queryValue),c=h.filter(s=>s[1].queryType.includes("min")&&s[1].queryValue!==0).sort((s,m)=>s[1].queryValue-m[1].queryValue),g=h.filter(s=>s[0]==="(min-width: 0px)");(g?[...g,...p,...c]:[...p,...c]).forEach(s=>{e(this,y).has(s[0])||e(this,y).set(s[0],[]),e(this,y).get(s[0]).push(s[1])})}get mediaBuckets(){return e(this,y)}}y=new WeakMap;var R,M;class B extends A.Store{constructor(t){super(void 0);o(this,R);o(this,M,()=>{let t;e(this,R).mediaBuckets.forEach((c,g)=>{matchMedia(g).matches&&(t=c)});let h,p=0;t==null||t.forEach(c=>{c.density>p&&c.density<=Math.max(devicePixelRatio,1)&&(p=c.density,h=c)}),t!=null&&t.length&&!h&&(h=t[0]),this.current=h});i(this,R,new k(t.srcset))}close(){super.close(),this.disconnect()}connect(){T.windowResizer.subscribe(e(this,M),z.RESIZE_ORDER.SOURCE_MANAGER)}disconnect(){T.windowResizer.unsubscribe(e(this,M))}}R=new WeakMap,M=new WeakMap;exports.Source=_;exports.SourceManager=B;exports.SourceSet=k;
@@ -1,107 +1,108 @@
1
- var k = (a) => {
2
- throw TypeError(a);
1
+ var b = (r) => {
2
+ throw TypeError(r);
3
3
  };
4
- var A = (a, e, t) => e.has(a) || k("Cannot " + t);
5
- var i = (a, e, t) => (A(a, e, "read from private field"), t ? t.call(a) : e.get(a)), o = (a, e, t) => e.has(a) ? k("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(a) : e.set(a, t), n = (a, e, t, r) => (A(a, e, "write to private field"), r ? r.call(a, t) : e.set(a, t), t);
6
- import { RESIZE_ORDER as S } from "../order/index.js";
7
- import { windowResizer as B } from "../window-resizer/vanilla/index.js";
8
- import { S as T } from "../Store-OTdcl6SX.js";
9
- var g, x, q, d, h, m, w;
10
- class O {
11
- constructor(e) {
12
- o(this, g);
13
- o(this, x);
4
+ var k = (r, n, t) => n.has(r) || b("Cannot " + t);
5
+ var e = (r, n, t) => (k(r, n, "read from private field"), t ? t.call(r) : n.get(r)), o = (r, n, t) => n.has(r) ? b("Cannot add the same private member more than once") : n instanceof WeakSet ? n.add(r) : n.set(r, t), s = (r, n, t, a) => (k(r, n, "write to private field"), a ? a.call(r, t) : n.set(r, t), t);
6
+ import { RESIZE_ORDER as B } from "../order/index.js";
7
+ import { windowResizer as A } from "../window-resizer/vanilla/index.js";
8
+ import { S } from "../Store-OTdcl6SX.js";
9
+ var q, f, w, p, h, m, y;
10
+ class T {
11
+ constructor(n) {
14
12
  o(this, q);
15
- o(this, d);
13
+ o(this, f);
14
+ o(this, w);
15
+ o(this, p);
16
16
  o(this, h);
17
17
  o(this, m);
18
- o(this, w);
19
- n(this, g, e);
20
- const t = e.indexOf("?");
21
- t >= 0 && (e = e.slice(0, t));
22
- const r = e.split(".");
23
- n(this, x, r.slice(0, -1).join("."));
24
- const f = /\d+x/g, c = r.find((u) => u.match(f));
25
- n(this, q, c ? parseInt(c) : 1);
26
- const y = /\d+max/g, M = /\d+min/g, s = /\d+mar/g, p = /\d+mir/g, I = r.find((u) => u.match(y)), V = r.find((u) => u.match(M)), $ = r.find((u) => u.match(s)), b = r.find((u) => u.match(p));
27
- $ ? (n(this, h, parseInt($)), n(this, m, "max"), n(this, d, `(max-aspect-ratio: ${i(this, h)})`)) : b ? (n(this, h, parseInt(b)), n(this, m, "max"), n(this, d, `(min-aspect-ratio: ${i(this, h)})`)) : I ? (n(this, h, parseInt(I)), n(this, m, "max"), n(this, d, `(max-width: ${i(this, h)}px)`)) : V ? (n(this, h, parseInt(V)), n(this, d, `(min-width: ${i(this, h)}px)`), n(this, m, "min")) : (n(this, h, 0), n(this, d, `(min-width: ${i(this, h)}px)`), n(this, m, "min")), n(this, x, i(this, x).replace(
28
- `.${i(this, h)}${i(this, m)}`,
18
+ o(this, y);
19
+ s(this, q, n);
20
+ const t = n.split(".");
21
+ s(this, f, t.length > 1 ? t.slice(0, -1).join(".") : t.join("."));
22
+ const a = /\d+x/g, d = t.find((l) => l.match(a));
23
+ s(this, w, d ? parseInt(d) : 1);
24
+ const c = /\d+max/g, g = /\d+min/g, $ = /\d+mar/g, i = /\d+mir/g, u = t.find((l) => l.match(c)), M = t.find((l) => l.match(g)), V = t.find((l) => l.match($)), I = t.find((l) => l.match(i));
25
+ V ? (s(this, h, parseInt(V)), s(this, m, "max"), s(this, p, `(max-aspect-ratio: ${e(this, h)})`)) : I ? (s(this, h, parseInt(I)), s(this, m, "max"), s(this, p, `(min-aspect-ratio: ${e(this, h)})`)) : u ? (s(this, h, parseInt(u)), s(this, m, "max"), s(this, p, `(max-width: ${e(this, h)}px)`)) : M ? (s(this, h, parseInt(M)), s(this, p, `(min-width: ${e(this, h)}px)`), s(this, m, "min")) : (s(this, h, 0), s(this, p, `(min-width: ${e(this, h)}px)`), s(this, m, "min")), s(this, f, e(this, f).replace(
26
+ `.${e(this, h)}${e(this, m)}`,
29
27
  ""
30
- )), n(this, w, "." + r[r.length - 1]);
28
+ )), s(this, y, t[t.length - 1] === e(this, f) ? "" : "." + t[t.length - 1]), s(this, y, e(this, y).replace(
29
+ `.${e(this, h)}${e(this, m)}`,
30
+ ""
31
+ ));
31
32
  }
32
33
  get url() {
33
- return i(this, g);
34
+ return e(this, q);
34
35
  }
35
36
  get name() {
36
- return i(this, x);
37
+ return e(this, f);
37
38
  }
38
39
  get density() {
39
- return i(this, q);
40
+ return e(this, w);
40
41
  }
41
42
  get query() {
42
- return i(this, d);
43
+ return e(this, p);
43
44
  }
44
45
  get extension() {
45
- return i(this, w);
46
+ return e(this, y);
46
47
  }
47
48
  get queryType() {
48
- return i(this, m);
49
+ return e(this, m);
49
50
  }
50
51
  get queryValue() {
51
- return i(this, h);
52
+ return e(this, h);
52
53
  }
53
54
  }
54
- g = new WeakMap(), x = new WeakMap(), q = new WeakMap(), d = new WeakMap(), h = new WeakMap(), m = new WeakMap(), w = new WeakMap();
55
- var l;
55
+ q = new WeakMap(), f = new WeakMap(), w = new WeakMap(), p = new WeakMap(), h = new WeakMap(), m = new WeakMap(), y = new WeakMap();
56
+ var x;
56
57
  class P {
57
- constructor(e) {
58
- o(this, l);
59
- n(this, l, /* @__PURE__ */ new Map());
60
- const t = typeof e == "string" ? e.trim().split(",").map((s) => s.trim()).filter((s) => !!s) : e, r = [];
61
- t.forEach((s) => {
62
- const p = new O(s);
63
- r.push([p.query, p]);
58
+ constructor(n) {
59
+ o(this, x);
60
+ s(this, x, /* @__PURE__ */ new Map());
61
+ const t = typeof n == "string" ? n.trim().split(",").map((i) => i.trim()).filter((i) => !!i) : n, a = [];
62
+ t.forEach((i) => {
63
+ const u = new T(i);
64
+ a.push([u.query, u]);
64
65
  });
65
- const f = r.filter((s) => s[1].queryType.includes("max")).sort((s, p) => p[1].queryValue - s[1].queryValue), c = r.filter((s) => s[1].queryType.includes("min") && s[1].queryValue !== 0).sort((s, p) => s[1].queryValue - p[1].queryValue), y = r.filter((s) => s[0] === "(min-width: 0px)");
66
- (y ? [...y, ...f, ...c] : [...f, ...c]).forEach((s) => {
67
- i(this, l).has(s[0]) || i(this, l).set(s[0], []), i(this, l).get(s[0]).push(s[1]);
66
+ const d = a.filter((i) => i[1].queryType.includes("max")).sort((i, u) => u[1].queryValue - i[1].queryValue), c = a.filter((i) => i[1].queryType.includes("min") && i[1].queryValue !== 0).sort((i, u) => i[1].queryValue - u[1].queryValue), g = a.filter((i) => i[0] === "(min-width: 0px)");
67
+ (g ? [...g, ...d, ...c] : [...d, ...c]).forEach((i) => {
68
+ e(this, x).has(i[0]) || e(this, x).set(i[0], []), e(this, x).get(i[0]).push(i[1]);
68
69
  });
69
70
  }
70
71
  get mediaBuckets() {
71
- return i(this, l);
72
+ return e(this, x);
72
73
  }
73
74
  }
74
- l = new WeakMap();
75
+ x = new WeakMap();
75
76
  var E, R;
76
- class C extends T {
77
+ class _ extends S {
77
78
  constructor(t) {
78
79
  super(void 0);
79
80
  o(this, E);
80
81
  o(this, R, () => {
81
82
  let t;
82
- i(this, E).mediaBuckets.forEach((c, y) => {
83
- matchMedia(y).matches && (t = c);
83
+ e(this, E).mediaBuckets.forEach((c, g) => {
84
+ matchMedia(g).matches && (t = c);
84
85
  });
85
- let r, f = 0;
86
+ let a, d = 0;
86
87
  t == null || t.forEach((c) => {
87
- c.density > f && c.density <= Math.max(devicePixelRatio, 1) && (f = c.density, r = c);
88
- }), t != null && t.length && !r && (r = t[0]), this.current = r;
88
+ c.density > d && c.density <= Math.max(devicePixelRatio, 1) && (d = c.density, a = c);
89
+ }), t != null && t.length && !a && (a = t[0]), this.current = a;
89
90
  });
90
- n(this, E, new P(t.srcset));
91
+ s(this, E, new P(t.srcset));
91
92
  }
92
93
  close() {
93
94
  super.close(), this.disconnect();
94
95
  }
95
96
  connect() {
96
- B.subscribe(i(this, R), S.SOURCE_MANAGER);
97
+ A.subscribe(e(this, R), B.SOURCE_MANAGER);
97
98
  }
98
99
  disconnect() {
99
- B.unsubscribe(i(this, R));
100
+ A.unsubscribe(e(this, R));
100
101
  }
101
102
  }
102
103
  E = new WeakMap(), R = new WeakMap();
103
104
  export {
104
- O as Source,
105
- C as SourceManager,
105
+ T as Source,
106
+ _ as SourceManager,
106
107
  P as SourceSet
107
108
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aptechka",
3
- "version": "0.37.3",
3
+ "version": "0.38.1",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/denisavitski/aptechka.git"