aptechka 0.40.5 → 0.40.7

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.
@@ -2,6 +2,7 @@ import { SourceElement } from '../source';
2
2
 
3
3
  export declare class IFrameElement extends SourceElement<HTMLElement> {
4
4
  #private;
5
+ constructor();
5
6
  protected createConsumer(): HTMLDivElement;
6
7
  protected consumeSource(code: string | null): void;
7
8
  }
@@ -1,5 +1,5 @@
1
- "use strict";var le=a=>{throw TypeError(a)};var ae=(a,n,t)=>n.has(a)||le("Cannot "+t);var e=(a,n,t)=>(ae(a,n,"read from private field"),t?t.call(a):n.get(a)),s=(a,n,t)=>n.has(a)?le("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(a):n.set(a,t),r=(a,n,t,i)=>(ae(a,n,"write to private field"),i?i.call(a,t):n.set(a,t),t),q=(a,n,t)=>(ae(a,n,"access private method"),t);var de=(a,n,t)=>new Promise((i,o)=>{var E=m=>{try{v(t.next(m))}catch(l){o(l)}},A=m=>{try{v(t.throw(m))}catch(l){o(l)}},v=m=>m.done?i(m.value):Promise.resolve(m.value).then(E,A);v((t=t.apply(a,n)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Se=require("../source/index.cjs"),we=require("../class-linked-status/index.cjs"),pe=require("../browser-CpzFX2xg.cjs"),V=require("../events-KVanG9sR.cjs"),Ee=require("../string-DhgS_iFl.cjs"),oe=require("../loading/index.cjs"),Ce=require("../device/index.cjs"),G=require("../css-property/index.cjs"),me=require("../element-resizer/vanilla/index.cjs"),fe=require("../canvas-CU5Xjahf.cjs"),Re=require("../canvas/index.cjs"),he=require("../ticker/vanilla/index.cjs");let Ie=0;var d,h,y,L,f,Y,P,c,U,B,S,M,J,Z,N,ee;class O extends HTMLElement{constructor(){super();s(this,M);s(this,d,null);s(this,h,null);s(this,y,!1);s(this,L,!1);s(this,f,!1);s(this,Y,"");s(this,P,"");s(this,c,new we.ClassLinkedStatus(this,{loading:!1,loaded:!1,error:!1,clear:!1}));s(this,U,null);s(this,B);s(this,S,null);s(this,Z,t=>{const i=t[0];e(this,f)&&(!e(this,L)||this.hasAttribute("reload-source"))&&i.isIntersecting&&this.triggerLazyLoad(),i.isIntersecting?V.dispatchEvent(this,"sourceCapture",{custom:!0}):(this.hasAttribute("reload-source")&&q(this,M,J).call(this,void 0),V.dispatchEvent(this,"sourceRelease",{custom:!0}))});s(this,N,()=>{e(this,c).set("loaded",!0),e(this,c).set("error",!1),e(this,c).set("loading",!1),!e(this,f)&&!e(this,y)&&oe.loading.complete(e(this,P)),V.dispatchEvent(this,"sourceLoaded",{custom:!0});const t=getComputedStyle(this).getPropertyValue("--clear-duration");t?r(this,B,setTimeout(()=>{e(this,c).set("clear",!0)},parseFloat(t)*1e3)):e(this,c).set("clear",!0),r(this,y,!0)});s(this,ee,t=>{e(this,c).set("loaded",!1),e(this,c).set("error",!0),e(this,c).set("loading",!1),!e(this,f)&&!e(this,y)&&oe.loading.error(e(this,P)),V.dispatchEvent(this,"sourceError",{custom:!0}),r(this,y,!0)});pe.isBrowser&&window.IntersectionObserver&&r(this,U,new IntersectionObserver(e(this,Z)))}get consumerElement(){return e(this,h)}get sourceManager(){return e(this,d)}get status(){return e(this,c)}get isLazy(){return e(this,f)}get currentURL(){return e(this,S)}get isFirstLoadHappened(){return e(this,y)}triggerLazyLoad(){!e(this,L)&&e(this,d).current&&e(this,d).current!==e(this,d).previous&&(r(this,L,!0),q(this,M,J).call(this,e(this,d).current))}connectedCallback(){r(this,Y,`source-consumer-${++Ie}`);const t=this.getAttribute("srcset");if(!t)return;const i=this.hasAttribute("notify")?this.closest(this.getAttribute("notify")):null;i&&e(this,c).addElement(i),r(this,h,this.createConsumer()),e(this,h).style.cssText=`
1
+ "use strict";var de=a=>{throw TypeError(a)};var oe=(a,n,t)=>n.has(a)||de("Cannot "+t);var e=(a,n,t)=>(oe(a,n,"read from private field"),t?t.call(a):n.get(a)),s=(a,n,t)=>n.has(a)?de("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(a):n.set(a,t),r=(a,n,t,i)=>(oe(a,n,"write to private field"),i?i.call(a,t):n.set(a,t),t),q=(a,n,t)=>(oe(a,n,"access private method"),t);var me=(a,n,t)=>new Promise((i,h)=>{var E=m=>{try{v(t.next(m))}catch(l){h(l)}},A=m=>{try{v(t.throw(m))}catch(l){h(l)}},v=m=>m.done?i(m.value):Promise.resolve(m.value).then(E,A);v((t=t.apply(a,n)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const we=require("../source/index.cjs"),Ce=require("../class-linked-status/index.cjs"),Ee=require("../browser-CpzFX2xg.cjs"),V=require("../events-KVanG9sR.cjs"),ye=require("../string-DhgS_iFl.cjs"),he=require("../loading/index.cjs"),Re=require("../device/index.cjs"),J=require("../css-property/index.cjs"),fe=require("../element-resizer/vanilla/index.cjs"),pe=require("../canvas-CU5Xjahf.cjs"),Ie=require("../canvas/index.cjs"),ce=require("../ticker/vanilla/index.cjs");let Ae=0;var d,o,y,S,f,Y,k,c,B,U,L,N,O,Q,ee,j,te;class $ extends HTMLElement{constructor(t){super();s(this,O);s(this,d,null);s(this,o,null);s(this,y,!1);s(this,S,!1);s(this,f,!1);s(this,Y,"");s(this,k,"");s(this,c,new Ce.ClassLinkedStatus(this,{loading:!1,loaded:!1,error:!1,clear:!1}));s(this,B,null);s(this,U);s(this,L,null);s(this,N);s(this,ee,t=>{const i=t[0];e(this,f)&&(!e(this,S)||this.hasAttribute("reload-source"))&&i.isIntersecting&&this.triggerLazyLoad(),i.isIntersecting?V.dispatchEvent(this,"sourceCapture",{custom:!0}):(this.hasAttribute("reload-source")&&q(this,O,Q).call(this,void 0),V.dispatchEvent(this,"sourceRelease",{custom:!0}))});s(this,j,()=>{e(this,c).set("loaded",!0),e(this,c).set("error",!1),e(this,c).set("loading",!1),!e(this,f)&&!e(this,y)&&he.loading.complete(e(this,k)),V.dispatchEvent(this,"sourceLoaded",{custom:!0});const t=getComputedStyle(this).getPropertyValue("--clear-duration");t?r(this,U,setTimeout(()=>{e(this,c).set("clear",!0)},parseFloat(t)*1e3)):e(this,c).set("clear",!0),r(this,y,!0)});s(this,te,t=>{e(this,c).set("loaded",!1),e(this,c).set("error",!0),e(this,c).set("loading",!1),!e(this,f)&&!e(this,y)&&he.loading.error(e(this,k)),V.dispatchEvent(this,"sourceError",{custom:!0}),r(this,y,!0)});r(this,N,t==null?void 0:t.sourceSetOptions),Ee.isBrowser&&window.IntersectionObserver&&r(this,B,new IntersectionObserver(e(this,ee)))}get consumerElement(){return e(this,o)}get sourceManager(){return e(this,d)}get status(){return e(this,c)}get isLazy(){return e(this,f)}get currentURL(){return e(this,L)}get isFirstLoadHappened(){return e(this,y)}triggerLazyLoad(){!e(this,S)&&e(this,d).current&&e(this,d).current!==e(this,d).previous&&(r(this,S,!0),q(this,O,Q).call(this,e(this,d).current))}connectedCallback(){r(this,Y,`source-consumer-${++Ae}`);const t=this.getAttribute("srcset")||"",i=this.hasAttribute("notify")?this.closest(this.getAttribute("notify")):null;i&&e(this,c).addElement(i),r(this,o,this.createConsumer()),e(this,o).style.cssText=`
2
2
  display: block;
3
3
  width: 100%;
4
4
  height: 100%;
5
- `,e(this,h).classList.add("source-consumer"),Array.from(this.attributes).forEach(o=>{if(o.name!=="srcset"){const E=o.nodeValue||"",A=Ee.kebabToCamel(o.name);A in e(this,h)&&(e(this,h)[A]=E||!0)}}),this.appendChild(e(this,h)),r(this,d,new Se.SourceManager({srcset:t})),r(this,f,this.hasAttribute("lazy")),e(this,d).subscribe(o=>{(!e(this,f)||e(this,f)&&e(this,L))&&q(this,M,J).call(this,o.current)}),e(this,d).connect(),e(this,U).observe(this)}disconnectedCallback(){e(this,U).disconnect(),e(this,d).close(),e(this,h).onloadeddata=null,e(this,h).onload=null,e(this,h).onerror=null,r(this,y,!1),r(this,L,!1),e(this,h).remove(),e(this,c).reset(),clearTimeout(e(this,B))}}d=new WeakMap,h=new WeakMap,y=new WeakMap,L=new WeakMap,f=new WeakMap,Y=new WeakMap,P=new WeakMap,c=new WeakMap,U=new WeakMap,B=new WeakMap,S=new WeakMap,M=new WeakSet,J=function(t){if(clearTimeout(e(this,B)),e(this,h).onloadeddata=null,e(this,h).onload=null,e(this,h).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){r(this,P,`${e(this,Y)}-${t.url}`);const i=this.hasAttribute("keep-source-parameters");e(this,c).set("loading",!0),r(this,S,i?t.url:t.name+t.extension),this.consumeSource(e(this,S)),!e(this,f)&&!e(this,y)&&oe.loading.add(e(this,P)),e(this,h).onloadeddata=()=>{e(this,N).call(this)},e(this,h).onload=()=>{e(this,N).call(this)},e(this,h).onerror=()=>{e(this,ee).call(this,e(this,S))}}else r(this,S,null),this.consumeSource(null)},Z=new WeakMap,N=new WeakMap,ee=new WeakMap;var b,te,se;class ye extends O{constructor(){super(...arguments);s(this,b,null);s(this,te,()=>{var t,i;(i=(t=this.consumerElement).onload)==null||i.call(t,new Event("load"))});s(this,se,()=>{var t,i;(i=(t=this.consumerElement).onload)==null||i.call(t,new Event("error"))})}createConsumer(){return document.createElement("div")}consumeSource(t){e(this,b)&&(e(this,b).onload=null,e(this,b).onerror=null),this.consumerElement.innerHTML=(t==null?void 0:t.replace(/\\u003C/g,"<").replace(/\\u003E/g,">").replace(/\\"/g,'"'))||"",r(this,b,this.consumerElement.querySelector("iframe")),e(this,b)&&(e(this,b).onload=e(this,te),e(this,b).onerror=e(this,se))}}b=new WeakMap,te=new WeakMap,se=new WeakMap;customElements.get("e-iframe")||customElements.define("e-iframe",ye);class be extends O{createConsumer(){return document.createElement("img")}consumeSource(n){if(n&&this.hasAttribute("webp")&&Ce.device.isWebp){const t=n.split(".").slice(0,-1).join(".")+".webp";this.consumerElement.src=t}else this.consumerElement.src=n||""}}customElements.get("e-image")||customElements.define("e-image",be);function Ae(a){const n=a.match(/\{([\d-]+)\}/);if(n){const t=n[1].split("-");if(t.length===2){const i=parseInt(t[0],10),o=parseInt(t[1],10);return{start:i,end:o}}}return null}var p,k,F,w,C,x,T,j,g,R;class ge extends O{constructor(t){super();s(this,p,[]);s(this,k,new G.CSSProperty(this,"--fit","contain"));s(this,F,new G.CSSProperty(this,"--autoplay",!1));s(this,w,new G.CSSProperty(this,"--offset-x",.5));s(this,C,new G.CSSProperty(this,"--offset-y",.5));s(this,x,null);s(this,T,0);s(this,j,1);s(this,g,()=>{if(e(this,p).length){const t=e(this,p)[0];e(this,k).current==="cover"?r(this,x,fe.cover(t.naturalWidth,t.naturalHeight,this.consumerElement.width,this.consumerElement.height,e(this,w).current,e(this,C).current)):r(this,x,fe.contain(t.naturalWidth,t.naturalHeight,this.consumerElement.width,this.consumerElement.height,e(this,w).current,e(this,C).current))}});s(this,R,t=>{if(this.status.isFalse("loaded")||!e(this,x))return;t.detail.context.clearRect(0,0,t.detail.width,t.detail.height);const i=e(this,p)[e(this,T)];i&&t.detail.context.drawImage(i,...e(this,x)),e(this,F).current&&r(this,T,(e(this,T)+1)%e(this,p).length)});pe.isBrowser&&(r(this,j,parseInt(((t==null?void 0:t.pad)||this.getAttribute("pad")||"1").toString())),e(this,k).subscribe(e(this,g)),e(this,w).subscribe(e(this,g)),e(this,C).subscribe(e(this,g)),this.addEventListener("sourceCapture",i=>{this.consumerElement.addEventListener("canvasRender",e(this,R))}),this.addEventListener("sourceRelease",i=>{this.consumerElement.removeEventListener("canvasRender",e(this,R))}))}setProgress(t){e(this,p).length&&r(this,T,Math.floor((e(this,p).length-1)*t))}connectedCallback(){super.connectedCallback(),e(this,F).observe(),e(this,k).observe(),e(this,w).observe(),e(this,C).observe(),me.elementResizer.subscribe(this,e(this,g))}disconnectedCallback(){super.disconnectedCallback(),e(this,F).unobserve(),e(this,k).unobserve(),e(this,w).unobserve(),e(this,C).unobserve(),r(this,p,[]),me.elementResizer.unsubscribe(e(this,g)),this.consumerElement.removeEventListener("canvasRender",e(this,R))}createConsumer(){return new Re.CanvasElement}consumeSource(t){return de(this,null,function*(){var i,o,E,A;if(t){this.consumerElement.removeEventListener("canvasRender",e(this,R));const v=[],m=Ae(t);if(m)for(let l=m.start;l<=m.end;l++){const ue=t.replace(/\{([^}]+)\}/,l.toString().padStart(e(this,j),"0")),X=new Image;X.src=ue,v.push(X)}else{const l=new Image;l.src=t,v.push(l)}try{yield Promise.all(v.map((l,ue)=>new Promise((X,Le)=>{l.onload=()=>{X()},l.onerror=Pe=>{Le(`${l.src} Image not found`)}}))),r(this,p,v),e(this,g).call(this),(o=(i=this.consumerElement).onload)==null||o.call(i,new Event("load")),this.isLazy||this.consumerElement.addEventListener("canvasRender",e(this,R))}catch(l){console.error(l),(A=(E=this.consumerElement).onerror)==null||A.call(E,new Event("error"))}}})}}p=new WeakMap,k=new WeakMap,F=new WeakMap,w=new WeakMap,C=new WeakMap,x=new WeakMap,T=new WeakMap,j=new WeakMap,g=new WeakMap,R=new WeakMap;customElements.get("e-sequence")||customElements.define("e-sequence",ge);var _,H;class ve extends O{constructor(){super(...arguments);s(this,_,0);s(this,H,()=>{this.classList.add(`state-${this.consumerElement.readyState}`);const t=this.consumerElement.readyState/4;t>e(this,_)&&r(this,_,t),V.dispatchEvent(this,"videoReadyStateChange",{detail:{readyState:this.consumerElement.readyState,progress:e(this,_)}}),this.consumerElement.readyState===4&&he.ticker.unsubscribe(e(this,H))})}connectedCallback(){super.connectedCallback(),this.addEventListener("sourceCapture",()=>{he.ticker.subscribe(e(this,H)),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(),he.ticker.unsubscribe(e(this,H)),r(this,_,0)}createConsumer(){return document.createElement("video")}consumeSource(t){this.consumerElement.src=t||"",this.consumerElement.autoplay=!0}}_=new WeakMap,H=new WeakMap;customElements.get("e-video")||customElements.define("e-video",ve);var u,W,I,D,$,ie,re,ne,K,ce;const z=class z extends O{constructor(){super();s(this,K);s(this,u);s(this,W);s(this,I,!1);s(this,D,!1);s(this,$,()=>{r(this,I,e(this,I)||this.hasAttribute("autoplay")&&!this.hasAttribute("capture-autoplay")),r(this,u,new window.YT.Player(e(this,W),{playerVars:{mute:this.hasAttribute("muted")?1:0,controls:this.hasAttribute("controls")?1:0},events:{onReady:e(this,ie),onError:e(this,re),onStateChange:e(this,ne)}}))});s(this,ie,()=>{r(this,D,!0),q(this,K,ce).call(this)});s(this,re,t=>{var i,o;console.error("YouTube: Ошибка при загрузке видео:",this.currentURL,t),(o=(i=this.consumerElement).onerror)==null||o.call(i,new Event("error"))});s(this,ne,()=>{});r(this,W,"yt-"+Ee.generateId(10)),z.__apiReady||(window.onYouTubeIframeAPIReady=()=>{z.__apiReady=!0,V.dispatchEvent(window,"youTubeIframeAPIReady")}),this.addEventListener("sourceCapture",()=>{this.hasAttribute("capture-autoplay")&&(e(this,D)?e(this,u).playVideo():r(this,I,!0))}),this.addEventListener("sourceRelease",()=>{e(this,u)&&this.hasAttribute("capture-autoplay")&&(e(this,u).pauseVideo(),this.hasAttribute("replay")&&e(this,u).seekTo(0))})}static __onYouTubeIframeAPIReady(){this.__apiReady=!0}createConsumer(){const t=document.createElement("div");return t.id=e(this,W),t}consumeSource(t){var i;if(t){if(!document.getElementById("youtube-script")){const o=document.createElement("script");o.id,o.src="https://www.youtube.com/iframe_api";const E=document.getElementsByTagName("script")[0];(i=E.parentNode)==null||i.insertBefore(o,E)}e(this,u)?q(this,K,ce).call(this):z.__apiReady?e(this,$).call(this):addEventListener("youTubeIframeAPIReady",e(this,$))}else e(this,u)&&e(this,u).stopVideo()}disconnectedCallback(){super.disconnectedCallback(),e(this,u)&&e(this,u).destroy(),removeEventListener("youTubeIframeAPIReady",e(this,$))}};u=new WeakMap,W=new WeakMap,I=new WeakMap,D=new WeakMap,$=new WeakMap,ie=new WeakMap,re=new WeakMap,ne=new WeakMap,K=new WeakSet,ce=function(){var t,i;this.currentURL&&(this.currentURL.startsWith("http")?e(this,u).loadVideoByUrl(this.currentURL):e(this,u).loadVideoById(this.currentURL)),e(this,I)?e(this,u).playVideo():e(this,u).stopVideo(),r(this,I,!1),(i=(t=this.consumerElement).onload)==null||i.call(t,new Event("load"))},z.__apiReady=!1;let Q=z;customElements.get("e-youtube")||customElements.define("e-youtube",Q);exports.IFrameElement=ye;exports.ImageElement=be;exports.SequenceElement=ge;exports.SourceElement=O;exports.VideoElement=ve;exports.YouTubeElement=Q;
5
+ `,e(this,o).classList.add("source-consumer"),Array.from(this.attributes).forEach(h=>{if(h.name!=="srcset"){const E=h.nodeValue||"",A=ye.kebabToCamel(h.name);A in e(this,o)&&(e(this,o)[A]=E||!0)}}),this.appendChild(e(this,o)),r(this,d,new we.SourceManager({srcset:t,sourceSetOptions:e(this,N)})),r(this,f,this.hasAttribute("lazy")),e(this,d).subscribe(h=>{(!e(this,f)||e(this,f)&&e(this,S))&&q(this,O,Q).call(this,h.current)}),e(this,d).connect(),e(this,B).observe(this)}disconnectedCallback(){var t;clearTimeout(e(this,U)),e(this,B).disconnect(),(t=e(this,d))==null||t.close(),e(this,o)&&(e(this,o).onloadeddata=null,e(this,o).onload=null,e(this,o).onerror=null,e(this,o).remove()),r(this,y,!1),r(this,S,!1),e(this,c).reset()}}d=new WeakMap,o=new WeakMap,y=new WeakMap,S=new WeakMap,f=new WeakMap,Y=new WeakMap,k=new WeakMap,c=new WeakMap,B=new WeakMap,U=new WeakMap,L=new WeakMap,N=new WeakMap,O=new WeakSet,Q=function(t){if(clearTimeout(e(this,U)),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){r(this,k,`${e(this,Y)}-${t.url}`);const i=this.hasAttribute("keep-source-parameters");e(this,c).set("loading",!0),r(this,L,i?t.url:t.name+t.extension),this.consumeSource(e(this,L)),!e(this,f)&&!e(this,y)&&he.loading.add(e(this,k)),e(this,o).onloadeddata=()=>{e(this,j).call(this)},e(this,o).onload=()=>{e(this,j).call(this)},e(this,o).onerror=()=>{e(this,te).call(this,e(this,L))}}else r(this,L,null),this.consumeSource(null)},ee=new WeakMap,j=new WeakMap,te=new WeakMap;var b,se,ie;class be extends ${constructor(){super({sourceSetOptions:{mediaBuckets:!1}});s(this,b,null);s(this,se,()=>{var t,i;(i=(t=this.consumerElement).onload)==null||i.call(t,new Event("load"))});s(this,ie,()=>{var t,i;(i=(t=this.consumerElement).onload)==null||i.call(t,new Event("error"))})}createConsumer(){return document.createElement("div")}consumeSource(t){e(this,b)&&(e(this,b).onload=null,e(this,b).onerror=null),this.consumerElement.innerHTML=(t==null?void 0:t.replace(/\\u003C/g,"<").replace(/\\u003E/g,">").replace(/\\"/g,'"'))||"",r(this,b,this.consumerElement.querySelector("iframe")),e(this,b)&&(e(this,b).onload=e(this,se),e(this,b).onerror=e(this,ie))}}b=new WeakMap,se=new WeakMap,ie=new WeakMap;customElements.get("e-iframe")||customElements.define("e-iframe",be);class ge extends ${createConsumer(){return document.createElement("img")}consumeSource(n){if(n&&this.hasAttribute("webp")&&Re.device.isWebp){const t=n.split(".").slice(0,-1).join(".")+".webp";this.consumerElement.src=t}else this.consumerElement.src=n||""}}customElements.get("e-image")||customElements.define("e-image",ge);function ke(a){const n=a.match(/\{([\d-]+)\}/);if(n){const t=n[1].split("-");if(t.length===2){const i=parseInt(t[0],10),h=parseInt(t[1],10);return{start:i,end:h}}}return null}var p,P,M,w,C,x,T,D,g,R;class ve extends ${constructor(t){super();s(this,p,[]);s(this,P,new J.CSSProperty(this,"--fit","contain"));s(this,M,new J.CSSProperty(this,"--autoplay",!1));s(this,w,new J.CSSProperty(this,"--offset-x",.5));s(this,C,new J.CSSProperty(this,"--offset-y",.5));s(this,x,null);s(this,T,0);s(this,D,1);s(this,g,()=>{if(e(this,p).length){const t=e(this,p)[0];e(this,P).current==="cover"?r(this,x,pe.cover(t.naturalWidth,t.naturalHeight,this.consumerElement.width,this.consumerElement.height,e(this,w).current,e(this,C).current)):r(this,x,pe.contain(t.naturalWidth,t.naturalHeight,this.consumerElement.width,this.consumerElement.height,e(this,w).current,e(this,C).current))}});s(this,R,t=>{if(this.status.isFalse("loaded")||!e(this,x))return;t.detail.context.clearRect(0,0,t.detail.width,t.detail.height);const i=e(this,p)[e(this,T)];i&&t.detail.context.drawImage(i,...e(this,x)),e(this,M).current&&r(this,T,(e(this,T)+1)%e(this,p).length)});Ee.isBrowser&&(r(this,D,parseInt(((t==null?void 0:t.pad)||this.getAttribute("pad")||"1").toString())),e(this,P).subscribe(e(this,g)),e(this,w).subscribe(e(this,g)),e(this,C).subscribe(e(this,g)),this.addEventListener("sourceCapture",i=>{this.consumerElement.addEventListener("canvasRender",e(this,R))}),this.addEventListener("sourceRelease",i=>{this.consumerElement.removeEventListener("canvasRender",e(this,R))}))}setProgress(t){e(this,p).length&&r(this,T,Math.floor((e(this,p).length-1)*t))}connectedCallback(){super.connectedCallback(),e(this,M).observe(),e(this,P).observe(),e(this,w).observe(),e(this,C).observe(),fe.elementResizer.subscribe(this,e(this,g))}disconnectedCallback(){super.disconnectedCallback(),e(this,M).unobserve(),e(this,P).unobserve(),e(this,w).unobserve(),e(this,C).unobserve(),r(this,p,[]),fe.elementResizer.unsubscribe(e(this,g)),this.consumerElement.removeEventListener("canvasRender",e(this,R))}createConsumer(){return new Ie.CanvasElement}consumeSource(t){return me(this,null,function*(){var i,h,E,A;if(t){this.consumerElement.removeEventListener("canvasRender",e(this,R));const v=[],m=ke(t);if(m)for(let l=m.start;l<=m.end;l++){const le=t.replace(/\{([^}]+)\}/,l.toString().padStart(e(this,D),"0")),G=new Image;G.src=le,v.push(G)}else{const l=new Image;l.src=t,v.push(l)}try{yield Promise.all(v.map((l,le)=>new Promise((G,Le)=>{l.onload=()=>{G()},l.onerror=Pe=>{Le(`${l.src} Image not found`)}}))),r(this,p,v),e(this,g).call(this),(h=(i=this.consumerElement).onload)==null||h.call(i,new Event("load")),this.isLazy||this.consumerElement.addEventListener("canvasRender",e(this,R))}catch(l){console.error(l),(A=(E=this.consumerElement).onerror)==null||A.call(E,new Event("error"))}}})}}p=new WeakMap,P=new WeakMap,M=new WeakMap,w=new WeakMap,C=new WeakMap,x=new WeakMap,T=new WeakMap,D=new WeakMap,g=new WeakMap,R=new WeakMap;customElements.get("e-sequence")||customElements.define("e-sequence",ve);var _,F;class Se extends ${constructor(){super(...arguments);s(this,_,0);s(this,F,()=>{this.classList.add(`state-${this.consumerElement.readyState}`);const t=this.consumerElement.readyState/4;t>e(this,_)&&r(this,_,t),V.dispatchEvent(this,"videoReadyStateChange",{detail:{readyState:this.consumerElement.readyState,progress:e(this,_)}}),this.consumerElement.readyState===4&&ce.ticker.unsubscribe(e(this,F))})}connectedCallback(){super.connectedCallback(),this.addEventListener("sourceCapture",()=>{ce.ticker.subscribe(e(this,F)),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(),ce.ticker.unsubscribe(e(this,F)),r(this,_,0)}createConsumer(){return document.createElement("video")}consumeSource(t){this.consumerElement.src=t||"",this.consumerElement.autoplay=!0}}_=new WeakMap,F=new WeakMap;customElements.get("e-video")||customElements.define("e-video",Se);var u,H,I,K,W,re,ne,ae,X,ue;const z=class z extends ${constructor(){super();s(this,X);s(this,u);s(this,H);s(this,I,!1);s(this,K,!1);s(this,W,()=>{r(this,I,e(this,I)||this.hasAttribute("autoplay")&&!this.hasAttribute("capture-autoplay")),r(this,u,new window.YT.Player(e(this,H),{playerVars:{mute:this.hasAttribute("muted")?1:0,controls:this.hasAttribute("controls")?1:0},events:{onReady:e(this,re),onError:e(this,ne),onStateChange:e(this,ae)}}))});s(this,re,()=>{r(this,K,!0),q(this,X,ue).call(this)});s(this,ne,t=>{var i,h;console.error("YouTube: Ошибка при загрузке видео:",this.currentURL,t),(h=(i=this.consumerElement).onerror)==null||h.call(i,new Event("error"))});s(this,ae,()=>{});r(this,H,"yt-"+ye.generateId(10)),z.__apiReady||(window.onYouTubeIframeAPIReady=()=>{z.__apiReady=!0,V.dispatchEvent(window,"youTubeIframeAPIReady")}),this.addEventListener("sourceCapture",()=>{this.hasAttribute("capture-autoplay")&&(e(this,K)?e(this,u).playVideo():r(this,I,!0))}),this.addEventListener("sourceRelease",()=>{e(this,u)&&this.hasAttribute("capture-autoplay")&&(e(this,u).pauseVideo(),this.hasAttribute("replay")&&e(this,u).seekTo(0))})}static __onYouTubeIframeAPIReady(){this.__apiReady=!0}createConsumer(){const t=document.createElement("div");return t.id=e(this,H),t}consumeSource(t){var i;if(t){if(!document.getElementById("youtube-script")){const h=document.createElement("script");h.id,h.src="https://www.youtube.com/iframe_api";const E=document.getElementsByTagName("script")[0];(i=E.parentNode)==null||i.insertBefore(h,E)}e(this,u)?q(this,X,ue).call(this):z.__apiReady?e(this,W).call(this):addEventListener("youTubeIframeAPIReady",e(this,W))}else e(this,u)&&e(this,u).stopVideo()}disconnectedCallback(){super.disconnectedCallback(),e(this,u)&&e(this,u).destroy(),removeEventListener("youTubeIframeAPIReady",e(this,W))}};u=new WeakMap,H=new WeakMap,I=new WeakMap,K=new WeakMap,W=new WeakMap,re=new WeakMap,ne=new WeakMap,ae=new WeakMap,X=new WeakSet,ue=function(){var t,i;this.currentURL&&(this.currentURL.startsWith("http")?e(this,u).loadVideoByUrl(this.currentURL):e(this,u).loadVideoById(this.currentURL)),e(this,I)?e(this,u).playVideo():e(this,u).stopVideo(),r(this,I,!1),(i=(t=this.consumerElement).onload)==null||i.call(t,new Event("load"))},z.__apiReady=!1;let Z=z;customElements.get("e-youtube")||customElements.define("e-youtube",Z);exports.IFrameElement=be;exports.ImageElement=ge;exports.SequenceElement=ve;exports.SourceElement=$;exports.VideoElement=Se;exports.YouTubeElement=Z;
@@ -1,78 +1,79 @@
1
- var ue = (a) => {
1
+ var de = (a) => {
2
2
  throw TypeError(a);
3
3
  };
4
- var ne = (a, n, t) => n.has(a) || ue("Cannot " + t);
5
- var e = (a, n, t) => (ne(a, n, "read from private field"), t ? t.call(a) : n.get(a)), s = (a, n, t) => n.has(a) ? ue("Cannot add the same private member more than once") : n instanceof WeakSet ? n.add(a) : n.set(a, t), r = (a, n, t, i) => (ne(a, n, "write to private field"), i ? i.call(a, t) : n.set(a, t), t), U = (a, n, t) => (ne(a, n, "access private method"), t);
6
- var de = (a, n, t) => new Promise((i, o) => {
4
+ var ae = (a, n, t) => n.has(a) || de("Cannot " + t);
5
+ var e = (a, n, t) => (ae(a, n, "read from private field"), t ? t.call(a) : n.get(a)), s = (a, n, t) => n.has(a) ? de("Cannot add the same private member more than once") : n instanceof WeakSet ? n.add(a) : n.set(a, t), r = (a, n, t, i) => (ae(a, n, "write to private field"), i ? i.call(a, t) : n.set(a, t), t), U = (a, n, t) => (ae(a, n, "access private method"), t);
6
+ var me = (a, n, t) => new Promise((i, h) => {
7
7
  var y = (m) => {
8
8
  try {
9
9
  v(t.next(m));
10
- } catch (u) {
11
- o(u);
10
+ } catch (l) {
11
+ h(l);
12
12
  }
13
13
  }, A = (m) => {
14
14
  try {
15
15
  v(t.throw(m));
16
- } catch (u) {
17
- o(u);
16
+ } catch (l) {
17
+ h(l);
18
18
  }
19
19
  }, v = (m) => m.done ? i(m.value) : Promise.resolve(m.value).then(y, A);
20
20
  v((t = t.apply(a, n)).next());
21
21
  });
22
- import { SourceManager as ye } from "../source/index.js";
23
- import { ClassLinkedStatus as Ee } from "../class-linked-status/index.js";
24
- import { i as fe } from "../browser-0zX67oeU.js";
22
+ import { SourceManager as Ee } from "../source/index.js";
23
+ import { ClassLinkedStatus as be } from "../class-linked-status/index.js";
24
+ import { i as pe } from "../browser-0zX67oeU.js";
25
25
  import { d as z } from "../events-CsVF98U6.js";
26
- import { k as be, g as ge } from "../string-f0Dnk0L1.js";
27
- import { loading as ae } from "../loading/index.js";
28
- import { device as ve } from "../device/index.js";
29
- import { CSSProperty as G } from "../css-property/index.js";
30
- import { elementResizer as me } from "../element-resizer/vanilla/index.js";
31
- import { c as Le, a as we } from "../canvas-DeZ0SLUJ.js";
26
+ import { k as ge, g as ve } from "../string-f0Dnk0L1.js";
27
+ import { loading as oe } from "../loading/index.js";
28
+ import { device as Le } from "../device/index.js";
29
+ import { CSSProperty as J } from "../css-property/index.js";
30
+ import { elementResizer as fe } from "../element-resizer/vanilla/index.js";
31
+ import { c as we, a as Se } from "../canvas-DeZ0SLUJ.js";
32
32
  import { CanvasElement as Ce } from "../canvas/index.js";
33
- import { ticker as oe } from "../ticker/vanilla/index.js";
34
- let Se = 0;
35
- var d, h, E, L, f, N, k, c, B, H, w, M, J, Q, O, Z;
36
- class K extends HTMLElement {
37
- constructor() {
33
+ import { ticker as he } from "../ticker/vanilla/index.js";
34
+ let Re = 0;
35
+ var d, o, E, L, f, q, k, c, _, O, w, N, H, Q, Z, Y, ee;
36
+ class X extends HTMLElement {
37
+ constructor(t) {
38
38
  super();
39
- s(this, M);
39
+ s(this, H);
40
40
  s(this, d, null);
41
- s(this, h, null);
41
+ s(this, o, null);
42
42
  s(this, E, !1);
43
43
  s(this, L, !1);
44
44
  s(this, f, !1);
45
- s(this, N, "");
45
+ s(this, q, "");
46
46
  s(this, k, "");
47
- s(this, c, new Ee(this, {
47
+ s(this, c, new be(this, {
48
48
  loading: !1,
49
49
  loaded: !1,
50
50
  error: !1,
51
51
  clear: !1
52
52
  }));
53
- s(this, B, null);
54
- s(this, H);
53
+ s(this, _, null);
54
+ s(this, O);
55
55
  s(this, w, null);
56
- s(this, Q, (t) => {
56
+ s(this, N);
57
+ s(this, Z, (t) => {
57
58
  const i = t[0];
58
- e(this, f) && (!e(this, L) || this.hasAttribute("reload-source")) && i.isIntersecting && this.triggerLazyLoad(), i.isIntersecting ? z(this, "sourceCapture", { custom: !0 }) : (this.hasAttribute("reload-source") && U(this, M, J).call(this, void 0), z(this, "sourceRelease", { custom: !0 }));
59
+ e(this, f) && (!e(this, L) || this.hasAttribute("reload-source")) && i.isIntersecting && this.triggerLazyLoad(), i.isIntersecting ? z(this, "sourceCapture", { custom: !0 }) : (this.hasAttribute("reload-source") && U(this, H, Q).call(this, void 0), z(this, "sourceRelease", { custom: !0 }));
59
60
  });
60
- s(this, O, () => {
61
- e(this, c).set("loaded", !0), e(this, c).set("error", !1), e(this, c).set("loading", !1), !e(this, f) && !e(this, E) && ae.complete(e(this, k)), z(this, "sourceLoaded", { custom: !0 });
61
+ s(this, Y, () => {
62
+ e(this, c).set("loaded", !0), e(this, c).set("error", !1), e(this, c).set("loading", !1), !e(this, f) && !e(this, E) && oe.complete(e(this, k)), z(this, "sourceLoaded", { custom: !0 });
62
63
  const t = getComputedStyle(this).getPropertyValue("--clear-duration");
63
- t ? r(this, H, setTimeout(() => {
64
+ t ? r(this, O, setTimeout(() => {
64
65
  e(this, c).set("clear", !0);
65
66
  }, parseFloat(t) * 1e3)) : e(this, c).set("clear", !0), r(this, E, !0);
66
67
  });
67
- s(this, Z, (t) => {
68
- e(this, c).set("loaded", !1), e(this, c).set("error", !0), e(this, c).set("loading", !1), !e(this, f) && !e(this, E) && ae.error(e(this, k)), z(this, "sourceError", { custom: !0 }), r(this, E, !0);
68
+ s(this, ee, (t) => {
69
+ e(this, c).set("loaded", !1), e(this, c).set("error", !0), e(this, c).set("loading", !1), !e(this, f) && !e(this, E) && oe.error(e(this, k)), z(this, "sourceError", { custom: !0 }), r(this, E, !0);
69
70
  });
70
- fe && window.IntersectionObserver && r(this, B, new IntersectionObserver(
71
- e(this, Q)
71
+ r(this, N, t == null ? void 0 : t.sourceSetOptions), pe && window.IntersectionObserver && r(this, _, new IntersectionObserver(
72
+ e(this, Z)
72
73
  ));
73
74
  }
74
75
  get consumerElement() {
75
- return e(this, h);
76
+ return e(this, o);
76
77
  }
77
78
  get sourceManager() {
78
79
  return e(this, d);
@@ -90,56 +91,60 @@ class K extends HTMLElement {
90
91
  return e(this, E);
91
92
  }
92
93
  triggerLazyLoad() {
93
- !e(this, L) && e(this, d).current && e(this, d).current !== e(this, d).previous && (r(this, L, !0), U(this, M, J).call(this, e(this, d).current));
94
+ !e(this, L) && e(this, d).current && e(this, d).current !== e(this, d).previous && (r(this, L, !0), U(this, H, Q).call(this, e(this, d).current));
94
95
  }
95
96
  connectedCallback() {
96
- r(this, N, `source-consumer-${++Se}`);
97
- const t = this.getAttribute("srcset");
98
- if (!t) return;
99
- const i = this.hasAttribute("notify") ? this.closest(this.getAttribute("notify")) : null;
100
- i && e(this, c).addElement(i), r(this, h, this.createConsumer()), e(this, h).style.cssText = `
97
+ r(this, q, `source-consumer-${++Re}`);
98
+ const t = this.getAttribute("srcset") || "", i = this.hasAttribute("notify") ? this.closest(this.getAttribute("notify")) : null;
99
+ i && e(this, c).addElement(i), r(this, o, this.createConsumer()), e(this, o).style.cssText = `
101
100
  display: block;
102
101
  width: 100%;
103
102
  height: 100%;
104
- `, e(this, h).classList.add("source-consumer"), Array.from(this.attributes).forEach((o) => {
105
- if (o.name !== "srcset") {
106
- const y = o.nodeValue || "", A = be(o.name);
107
- A in e(this, h) && (e(this, h)[A] = y || !0);
103
+ `, e(this, o).classList.add("source-consumer"), Array.from(this.attributes).forEach((h) => {
104
+ if (h.name !== "srcset") {
105
+ const y = h.nodeValue || "", A = ge(h.name);
106
+ A in e(this, o) && (e(this, o)[A] = y || !0);
108
107
  }
109
- }), this.appendChild(e(this, h)), r(this, d, new ye({
110
- srcset: t
111
- })), r(this, f, this.hasAttribute("lazy")), e(this, d).subscribe((o) => {
112
- (!e(this, f) || e(this, f) && e(this, L)) && U(this, M, J).call(this, o.current);
113
- }), e(this, d).connect(), e(this, B).observe(this);
108
+ }), this.appendChild(e(this, o)), r(this, d, new Ee({
109
+ srcset: t,
110
+ sourceSetOptions: e(this, N)
111
+ })), r(this, f, this.hasAttribute("lazy")), e(this, d).subscribe((h) => {
112
+ (!e(this, f) || e(this, f) && e(this, L)) && U(this, H, Q).call(this, h.current);
113
+ }), e(this, d).connect(), e(this, _).observe(this);
114
114
  }
115
115
  disconnectedCallback() {
116
- e(this, B).disconnect(), e(this, d).close(), e(this, h).onloadeddata = null, e(this, h).onload = null, e(this, h).onerror = null, r(this, E, !1), r(this, L, !1), e(this, h).remove(), e(this, c).reset(), clearTimeout(e(this, H));
116
+ var t;
117
+ clearTimeout(e(this, O)), e(this, _).disconnect(), (t = e(this, d)) == null || t.close(), e(this, o) && (e(this, o).onloadeddata = null, e(this, o).onload = null, e(this, o).onerror = null, e(this, o).remove()), r(this, E, !1), r(this, L, !1), e(this, c).reset();
117
118
  }
118
119
  }
119
- d = new WeakMap(), h = new WeakMap(), E = new WeakMap(), L = new WeakMap(), f = new WeakMap(), N = new WeakMap(), k = new WeakMap(), c = new WeakMap(), B = new WeakMap(), H = new WeakMap(), w = new WeakMap(), M = new WeakSet(), J = function(t) {
120
- if (clearTimeout(e(this, H)), e(this, h).onloadeddata = null, e(this, h).onload = null, e(this, h).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) {
121
- r(this, k, `${e(this, N)}-${t.url}`);
120
+ d = new WeakMap(), o = new WeakMap(), E = new WeakMap(), L = new WeakMap(), f = new WeakMap(), q = new WeakMap(), k = new WeakMap(), c = new WeakMap(), _ = new WeakMap(), O = new WeakMap(), w = new WeakMap(), N = new WeakMap(), H = new WeakSet(), Q = function(t) {
121
+ if (clearTimeout(e(this, O)), 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) {
122
+ r(this, k, `${e(this, q)}-${t.url}`);
122
123
  const i = this.hasAttribute("keep-source-parameters");
123
- e(this, c).set("loading", !0), r(this, w, i ? t.url : t.name + t.extension), this.consumeSource(e(this, w)), !e(this, f) && !e(this, E) && ae.add(e(this, k)), e(this, h).onloadeddata = () => {
124
- e(this, O).call(this);
125
- }, e(this, h).onload = () => {
126
- e(this, O).call(this);
127
- }, e(this, h).onerror = () => {
128
- e(this, Z).call(this, e(this, w));
124
+ e(this, c).set("loading", !0), r(this, w, i ? t.url : t.name + t.extension), this.consumeSource(e(this, w)), !e(this, f) && !e(this, E) && oe.add(e(this, k)), e(this, o).onloadeddata = () => {
125
+ e(this, Y).call(this);
126
+ }, e(this, o).onload = () => {
127
+ e(this, Y).call(this);
128
+ }, e(this, o).onerror = () => {
129
+ e(this, ee).call(this, e(this, w));
129
130
  };
130
131
  } else
131
132
  r(this, w, null), this.consumeSource(null);
132
- }, Q = new WeakMap(), O = new WeakMap(), Z = new WeakMap();
133
- var b, ee, te;
134
- class Re extends K {
133
+ }, Z = new WeakMap(), Y = new WeakMap(), ee = new WeakMap();
134
+ var b, te, se;
135
+ class Ie extends X {
135
136
  constructor() {
136
- super(...arguments);
137
+ super({
138
+ sourceSetOptions: {
139
+ mediaBuckets: !1
140
+ }
141
+ });
137
142
  s(this, b, null);
138
- s(this, ee, () => {
143
+ s(this, te, () => {
139
144
  var t, i;
140
145
  (i = (t = this.consumerElement).onload) == null || i.call(t, new Event("load"));
141
146
  });
142
- s(this, te, () => {
147
+ s(this, se, () => {
143
148
  var t, i;
144
149
  (i = (t = this.consumerElement).onload) == null || i.call(t, new Event("error"));
145
150
  });
@@ -148,68 +153,68 @@ class Re extends K {
148
153
  return document.createElement("div");
149
154
  }
150
155
  consumeSource(t) {
151
- e(this, b) && (e(this, b).onload = null, e(this, b).onerror = null), this.consumerElement.innerHTML = (t == null ? void 0 : t.replace(/\\u003C/g, "<").replace(/\\u003E/g, ">").replace(/\\"/g, '"')) || "", r(this, b, this.consumerElement.querySelector("iframe")), e(this, b) && (e(this, b).onload = e(this, ee), e(this, b).onerror = e(this, te));
156
+ e(this, b) && (e(this, b).onload = null, e(this, b).onerror = null), this.consumerElement.innerHTML = (t == null ? void 0 : t.replace(/\\u003C/g, "<").replace(/\\u003E/g, ">").replace(/\\"/g, '"')) || "", r(this, b, this.consumerElement.querySelector("iframe")), e(this, b) && (e(this, b).onload = e(this, te), e(this, b).onerror = e(this, se));
152
157
  }
153
158
  }
154
- b = new WeakMap(), ee = new WeakMap(), te = new WeakMap();
155
- customElements.get("e-iframe") || customElements.define("e-iframe", Re);
156
- class Ie extends K {
159
+ b = new WeakMap(), te = new WeakMap(), se = new WeakMap();
160
+ customElements.get("e-iframe") || customElements.define("e-iframe", Ie);
161
+ class Ae extends X {
157
162
  createConsumer() {
158
163
  return document.createElement("img");
159
164
  }
160
165
  consumeSource(n) {
161
- if (n && this.hasAttribute("webp") && ve.isWebp) {
166
+ if (n && this.hasAttribute("webp") && Le.isWebp) {
162
167
  const t = n.split(".").slice(0, -1).join(".") + ".webp";
163
168
  this.consumerElement.src = t;
164
169
  } else
165
170
  this.consumerElement.src = n || "";
166
171
  }
167
172
  }
168
- customElements.get("e-image") || customElements.define("e-image", Ie);
169
- function Ae(a) {
173
+ customElements.get("e-image") || customElements.define("e-image", Ae);
174
+ function ke(a) {
170
175
  const n = a.match(/\{([\d-]+)\}/);
171
176
  if (n) {
172
177
  const t = n[1].split("-");
173
178
  if (t.length === 2) {
174
- const i = parseInt(t[0], 10), o = parseInt(t[1], 10);
175
- return { start: i, end: o };
179
+ const i = parseInt(t[0], 10), h = parseInt(t[1], 10);
180
+ return { start: i, end: h };
176
181
  }
177
182
  }
178
183
  return null;
179
184
  }
180
- var p, P, F, C, S, T, x, Y, g, R;
181
- class ke extends K {
185
+ var p, P, M, S, C, T, x, D, g, R;
186
+ class Pe extends X {
182
187
  constructor(t) {
183
188
  super();
184
189
  s(this, p, []);
185
- s(this, P, new G(
190
+ s(this, P, new J(
186
191
  this,
187
192
  "--fit",
188
193
  "contain"
189
194
  ));
190
- s(this, F, new G(this, "--autoplay", !1));
191
- s(this, C, new G(this, "--offset-x", 0.5));
192
- s(this, S, new G(this, "--offset-y", 0.5));
195
+ s(this, M, new J(this, "--autoplay", !1));
196
+ s(this, S, new J(this, "--offset-x", 0.5));
197
+ s(this, C, new J(this, "--offset-y", 0.5));
193
198
  s(this, T, null);
194
199
  s(this, x, 0);
195
- s(this, Y, 1);
200
+ s(this, D, 1);
196
201
  s(this, g, () => {
197
202
  if (e(this, p).length) {
198
203
  const t = e(this, p)[0];
199
- e(this, P).current === "cover" ? r(this, T, Le(
204
+ e(this, P).current === "cover" ? r(this, T, we(
200
205
  t.naturalWidth,
201
206
  t.naturalHeight,
202
207
  this.consumerElement.width,
203
208
  this.consumerElement.height,
204
- e(this, C).current,
205
- e(this, S).current
206
- )) : r(this, T, we(
209
+ e(this, S).current,
210
+ e(this, C).current
211
+ )) : r(this, T, Se(
207
212
  t.naturalWidth,
208
213
  t.naturalHeight,
209
214
  this.consumerElement.width,
210
215
  this.consumerElement.height,
211
- e(this, C).current,
212
- e(this, S).current
216
+ e(this, S).current,
217
+ e(this, C).current
213
218
  ));
214
219
  }
215
220
  });
@@ -218,11 +223,11 @@ class ke extends K {
218
223
  return;
219
224
  t.detail.context.clearRect(0, 0, t.detail.width, t.detail.height);
220
225
  const i = e(this, p)[e(this, x)];
221
- i && t.detail.context.drawImage(i, ...e(this, T)), e(this, F).current && r(this, x, (e(this, x) + 1) % e(this, p).length);
226
+ i && t.detail.context.drawImage(i, ...e(this, T)), e(this, M).current && r(this, x, (e(this, x) + 1) % e(this, p).length);
222
227
  });
223
- fe && (r(this, Y, parseInt(
228
+ pe && (r(this, D, parseInt(
224
229
  ((t == null ? void 0 : t.pad) || this.getAttribute("pad") || "1").toString()
225
- )), e(this, P).subscribe(e(this, g)), e(this, C).subscribe(e(this, g)), e(this, S).subscribe(e(this, g)), this.addEventListener("sourceCapture", (i) => {
230
+ )), e(this, P).subscribe(e(this, g)), e(this, S).subscribe(e(this, g)), e(this, C).subscribe(e(this, g)), this.addEventListener("sourceCapture", (i) => {
226
231
  this.consumerElement.addEventListener(
227
232
  "canvasRender",
228
233
  e(this, R)
@@ -238,10 +243,10 @@ class ke extends K {
238
243
  e(this, p).length && r(this, x, Math.floor((e(this, p).length - 1) * t));
239
244
  }
240
245
  connectedCallback() {
241
- super.connectedCallback(), e(this, F).observe(), e(this, P).observe(), e(this, C).observe(), e(this, S).observe(), me.subscribe(this, e(this, g));
246
+ super.connectedCallback(), e(this, M).observe(), e(this, P).observe(), e(this, S).observe(), e(this, C).observe(), fe.subscribe(this, e(this, g));
242
247
  }
243
248
  disconnectedCallback() {
244
- super.disconnectedCallback(), e(this, F).unobserve(), e(this, P).unobserve(), e(this, C).unobserve(), e(this, S).unobserve(), r(this, p, []), me.unsubscribe(e(this, g)), this.consumerElement.removeEventListener(
249
+ super.disconnectedCallback(), e(this, M).unobserve(), e(this, P).unobserve(), e(this, S).unobserve(), e(this, C).unobserve(), r(this, p, []), fe.unsubscribe(e(this, g)), this.consumerElement.removeEventListener(
245
250
  "canvasRender",
246
251
  e(this, R)
247
252
  );
@@ -250,54 +255,54 @@ class ke extends K {
250
255
  return new Ce();
251
256
  }
252
257
  consumeSource(t) {
253
- return de(this, null, function* () {
254
- var i, o, y, A;
258
+ return me(this, null, function* () {
259
+ var i, h, y, A;
255
260
  if (t) {
256
261
  this.consumerElement.removeEventListener(
257
262
  "canvasRender",
258
263
  e(this, R)
259
264
  );
260
- const v = [], m = Ae(t);
265
+ const v = [], m = ke(t);
261
266
  if (m)
262
- for (let u = m.start; u <= m.end; u++) {
267
+ for (let l = m.start; l <= m.end; l++) {
263
268
  const le = t.replace(
264
269
  /\{([^}]+)\}/,
265
- u.toString().padStart(e(this, Y), "0")
266
- ), X = new Image();
267
- X.src = le, v.push(X);
270
+ l.toString().padStart(e(this, D), "0")
271
+ ), G = new Image();
272
+ G.src = le, v.push(G);
268
273
  }
269
274
  else {
270
- const u = new Image();
271
- u.src = t, v.push(u);
275
+ const l = new Image();
276
+ l.src = t, v.push(l);
272
277
  }
273
278
  try {
274
279
  yield Promise.all(
275
- v.map((u, le) => new Promise((X, pe) => {
276
- u.onload = () => {
277
- X();
278
- }, u.onerror = (Te) => {
279
- pe(`${u.src} Image not found`);
280
+ v.map((l, le) => new Promise((G, ye) => {
281
+ l.onload = () => {
282
+ G();
283
+ }, l.onerror = (xe) => {
284
+ ye(`${l.src} Image not found`);
280
285
  };
281
286
  }))
282
- ), r(this, p, v), e(this, g).call(this), (o = (i = this.consumerElement).onload) == null || o.call(i, new Event("load")), this.isLazy || this.consumerElement.addEventListener(
287
+ ), r(this, p, v), e(this, g).call(this), (h = (i = this.consumerElement).onload) == null || h.call(i, new Event("load")), this.isLazy || this.consumerElement.addEventListener(
283
288
  "canvasRender",
284
289
  e(this, R)
285
290
  );
286
- } catch (u) {
287
- console.error(u), (A = (y = this.consumerElement).onerror) == null || A.call(y, new Event("error"));
291
+ } catch (l) {
292
+ console.error(l), (A = (y = this.consumerElement).onerror) == null || A.call(y, new Event("error"));
288
293
  }
289
294
  }
290
295
  });
291
296
  }
292
297
  }
293
- p = new WeakMap(), P = new WeakMap(), F = new WeakMap(), C = new WeakMap(), S = new WeakMap(), T = new WeakMap(), x = new WeakMap(), Y = new WeakMap(), g = new WeakMap(), R = new WeakMap();
294
- customElements.get("e-sequence") || customElements.define("e-sequence", ke);
295
- var V, W;
296
- class Pe extends K {
298
+ p = new WeakMap(), P = new WeakMap(), M = new WeakMap(), S = new WeakMap(), C = new WeakMap(), T = new WeakMap(), x = new WeakMap(), D = new WeakMap(), g = new WeakMap(), R = new WeakMap();
299
+ customElements.get("e-sequence") || customElements.define("e-sequence", Pe);
300
+ var V, F;
301
+ class Te extends X {
297
302
  constructor() {
298
303
  super(...arguments);
299
304
  s(this, V, 0);
300
- s(this, W, () => {
305
+ s(this, F, () => {
301
306
  this.classList.add(`state-${this.consumerElement.readyState}`);
302
307
  const t = this.consumerElement.readyState / 4;
303
308
  t > e(this, V) && r(this, V, t), z(this, "videoReadyStateChange", {
@@ -305,12 +310,12 @@ class Pe extends K {
305
310
  readyState: this.consumerElement.readyState,
306
311
  progress: e(this, V)
307
312
  }
308
- }), this.consumerElement.readyState === 4 && oe.unsubscribe(e(this, W));
313
+ }), this.consumerElement.readyState === 4 && he.unsubscribe(e(this, F));
309
314
  });
310
315
  }
311
316
  connectedCallback() {
312
317
  super.connectedCallback(), this.addEventListener("sourceCapture", () => {
313
- oe.subscribe(e(this, W)), this.hasAttribute("capture-autoplay") && this.consumerElement.play();
318
+ he.subscribe(e(this, F)), this.hasAttribute("capture-autoplay") && this.consumerElement.play();
314
319
  }), this.addEventListener("sourceRelease", () => {
315
320
  this.hasAttribute("capture-autoplay") && (this.consumerElement.pause(), this.hasAttribute("replay") && (this.consumerElement.currentTime = 0)), this.hasAttribute("reload-source") && this.classList.remove(
316
321
  "state-0",
@@ -322,7 +327,7 @@ class Pe extends K {
322
327
  });
323
328
  }
324
329
  disconnectedCallback() {
325
- super.disconnectedCallback(), oe.unsubscribe(e(this, W)), r(this, V, 0);
330
+ super.disconnectedCallback(), he.unsubscribe(e(this, F)), r(this, V, 0);
326
331
  }
327
332
  createConsumer() {
328
333
  return document.createElement("video");
@@ -331,45 +336,45 @@ class Pe extends K {
331
336
  this.consumerElement.src = t || "", this.consumerElement.autoplay = !0;
332
337
  }
333
338
  }
334
- V = new WeakMap(), W = new WeakMap();
335
- customElements.get("e-video") || customElements.define("e-video", Pe);
336
- var l, $, I, D, q, se, ie, re, j, ce;
337
- const _ = class _ extends K {
339
+ V = new WeakMap(), F = new WeakMap();
340
+ customElements.get("e-video") || customElements.define("e-video", Te);
341
+ var u, W, I, j, $, ie, re, ne, K, ue;
342
+ const B = class B extends X {
338
343
  constructor() {
339
344
  super();
340
- s(this, j);
341
- s(this, l);
342
- s(this, $);
345
+ s(this, K);
346
+ s(this, u);
347
+ s(this, W);
343
348
  s(this, I, !1);
344
- s(this, D, !1);
345
- s(this, q, () => {
346
- r(this, I, e(this, I) || this.hasAttribute("autoplay") && !this.hasAttribute("capture-autoplay")), r(this, l, new window.YT.Player(e(this, $), {
349
+ s(this, j, !1);
350
+ s(this, $, () => {
351
+ r(this, I, e(this, I) || this.hasAttribute("autoplay") && !this.hasAttribute("capture-autoplay")), r(this, u, new window.YT.Player(e(this, W), {
347
352
  playerVars: {
348
353
  mute: this.hasAttribute("muted") ? 1 : 0,
349
354
  controls: this.hasAttribute("controls") ? 1 : 0
350
355
  },
351
356
  events: {
352
- onReady: e(this, se),
353
- onError: e(this, ie),
354
- onStateChange: e(this, re)
357
+ onReady: e(this, ie),
358
+ onError: e(this, re),
359
+ onStateChange: e(this, ne)
355
360
  }
356
361
  }));
357
362
  });
358
- s(this, se, () => {
359
- r(this, D, !0), U(this, j, ce).call(this);
363
+ s(this, ie, () => {
364
+ r(this, j, !0), U(this, K, ue).call(this);
360
365
  });
361
- s(this, ie, (t) => {
362
- var i, o;
363
- console.error("YouTube: Ошибка при загрузке видео:", this.currentURL, t), (o = (i = this.consumerElement).onerror) == null || o.call(i, new Event("error"));
366
+ s(this, re, (t) => {
367
+ var i, h;
368
+ console.error("YouTube: Ошибка при загрузке видео:", this.currentURL, t), (h = (i = this.consumerElement).onerror) == null || h.call(i, new Event("error"));
364
369
  });
365
- s(this, re, () => {
370
+ s(this, ne, () => {
366
371
  });
367
- r(this, $, "yt-" + ge(10)), _.__apiReady || (window.onYouTubeIframeAPIReady = () => {
368
- _.__apiReady = !0, z(window, "youTubeIframeAPIReady");
372
+ r(this, W, "yt-" + ve(10)), B.__apiReady || (window.onYouTubeIframeAPIReady = () => {
373
+ B.__apiReady = !0, z(window, "youTubeIframeAPIReady");
369
374
  }), this.addEventListener("sourceCapture", () => {
370
- this.hasAttribute("capture-autoplay") && (e(this, D) ? e(this, l).playVideo() : r(this, I, !0));
375
+ this.hasAttribute("capture-autoplay") && (e(this, j) ? e(this, u).playVideo() : r(this, I, !0));
371
376
  }), this.addEventListener("sourceRelease", () => {
372
- e(this, l) && this.hasAttribute("capture-autoplay") && (e(this, l).pauseVideo(), this.hasAttribute("replay") && e(this, l).seekTo(0));
377
+ e(this, u) && this.hasAttribute("capture-autoplay") && (e(this, u).pauseVideo(), this.hasAttribute("replay") && e(this, u).seekTo(0));
373
378
  });
374
379
  }
375
380
  static __onYouTubeIframeAPIReady() {
@@ -377,35 +382,35 @@ const _ = class _ extends K {
377
382
  }
378
383
  createConsumer() {
379
384
  const t = document.createElement("div");
380
- return t.id = e(this, $), t;
385
+ return t.id = e(this, W), t;
381
386
  }
382
387
  consumeSource(t) {
383
388
  var i;
384
389
  if (t) {
385
390
  if (!document.getElementById("youtube-script")) {
386
- const o = document.createElement("script");
387
- o.id, o.src = "https://www.youtube.com/iframe_api";
391
+ const h = document.createElement("script");
392
+ h.id, h.src = "https://www.youtube.com/iframe_api";
388
393
  const y = document.getElementsByTagName("script")[0];
389
- (i = y.parentNode) == null || i.insertBefore(o, y);
394
+ (i = y.parentNode) == null || i.insertBefore(h, y);
390
395
  }
391
- e(this, l) ? U(this, j, ce).call(this) : _.__apiReady ? e(this, q).call(this) : addEventListener("youTubeIframeAPIReady", e(this, q));
392
- } else e(this, l) && e(this, l).stopVideo();
396
+ e(this, u) ? U(this, K, ue).call(this) : B.__apiReady ? e(this, $).call(this) : addEventListener("youTubeIframeAPIReady", e(this, $));
397
+ } else e(this, u) && e(this, u).stopVideo();
393
398
  }
394
399
  disconnectedCallback() {
395
- super.disconnectedCallback(), e(this, l) && e(this, l).destroy(), removeEventListener("youTubeIframeAPIReady", e(this, q));
400
+ super.disconnectedCallback(), e(this, u) && e(this, u).destroy(), removeEventListener("youTubeIframeAPIReady", e(this, $));
396
401
  }
397
402
  };
398
- l = new WeakMap(), $ = new WeakMap(), I = new WeakMap(), D = new WeakMap(), q = new WeakMap(), se = new WeakMap(), ie = new WeakMap(), re = new WeakMap(), j = new WeakSet(), ce = function() {
403
+ u = new WeakMap(), W = new WeakMap(), I = new WeakMap(), j = new WeakMap(), $ = new WeakMap(), ie = new WeakMap(), re = new WeakMap(), ne = new WeakMap(), K = new WeakSet(), ue = function() {
399
404
  var t, i;
400
- this.currentURL && (this.currentURL.startsWith("http") ? e(this, l).loadVideoByUrl(this.currentURL) : e(this, l).loadVideoById(this.currentURL)), e(this, I) ? e(this, l).playVideo() : e(this, l).stopVideo(), r(this, I, !1), (i = (t = this.consumerElement).onload) == null || i.call(t, new Event("load"));
401
- }, _.__apiReady = !1;
402
- let he = _;
403
- customElements.get("e-youtube") || customElements.define("e-youtube", he);
405
+ this.currentURL && (this.currentURL.startsWith("http") ? e(this, u).loadVideoByUrl(this.currentURL) : e(this, u).loadVideoById(this.currentURL)), e(this, I) ? e(this, u).playVideo() : e(this, u).stopVideo(), r(this, I, !1), (i = (t = this.consumerElement).onload) == null || i.call(t, new Event("load"));
406
+ }, B.__apiReady = !1;
407
+ let ce = B;
408
+ customElements.get("e-youtube") || customElements.define("e-youtube", ce);
404
409
  export {
405
- Re as IFrameElement,
406
- Ie as ImageElement,
407
- ke as SequenceElement,
408
- K as SourceElement,
409
- Pe as VideoElement,
410
- he as YouTubeElement
410
+ Ie as IFrameElement,
411
+ Ae as ImageElement,
412
+ Pe as SequenceElement,
413
+ X as SourceElement,
414
+ Te as VideoElement,
415
+ ce as YouTubeElement
411
416
  };
@@ -1,5 +1,6 @@
1
1
  import { SourceManager } from '../../source';
2
2
  import { ClassLinkedStatus } from '../../class-linked-status';
3
+ import { SourceSetOptions } from '../../source/SourceSet';
3
4
 
4
5
  export interface SourceEvents {
5
6
  sourceCapture: CustomEvent;
@@ -7,9 +8,12 @@ export interface SourceEvents {
7
8
  sourceLoaded: CustomEvent;
8
9
  sourceError: CustomEvent;
9
10
  }
11
+ export interface SourceElementOptions {
12
+ sourceSetOptions?: SourceSetOptions;
13
+ }
10
14
  export declare abstract class SourceElement<T extends HTMLElement> extends HTMLElement {
11
15
  #private;
12
- constructor();
16
+ constructor(options?: SourceElementOptions);
13
17
  get consumerElement(): T;
14
18
  get sourceManager(): SourceManager;
15
19
  get status(): ClassLinkedStatus<{
@@ -3,5 +3,6 @@ import { Morph } from './Morph';
3
3
  export declare class Link {
4
4
  #private;
5
5
  constructor(element: HTMLAnchorElement, morph: Morph);
6
+ get element(): HTMLAnchorElement;
6
7
  destroy(): void;
7
8
  }
@@ -41,6 +41,8 @@ export declare class Morph {
41
41
  afterNavigationEvent(callback: MorphNavigationCallback): () => void;
42
42
  prefetch(path: string): Promise<Document>;
43
43
  navigate(path: string, { historyAction, state }?: MorphNavigateOptions): Promise<void>;
44
+ addLink(element: HTMLAnchorElement): void;
44
45
  addLinks(elements: Array<HTMLAnchorElement>): void;
46
+ removeLink(element: HTMLAnchorElement): void;
45
47
  findLinks(): void;
46
48
  }
@@ -1 +1 @@
1
- "use strict";var at=(s,t)=>(t=Symbol[s])?t:Symbol.for("Symbol."+s),ot=s=>{throw TypeError(s)};var V=(s,t,i)=>t.has(s)||ot("Cannot "+i);var e=(s,t,i)=>(V(s,t,"read from private field"),i?i.call(s):t.get(s)),r=(s,t,i)=>t.has(s)?ot("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(s):t.set(s,i),c=(s,t,i,n)=>(V(s,t,"write to private field"),n?n.call(s,i):t.set(s,i),i),b=(s,t,i)=>(V(s,t,"access private method"),i);var N=(s,t,i)=>new Promise((n,l)=>{var u=m=>{try{g(i.next(m))}catch(w){l(w)}},o=m=>{try{g(i.throw(m))}catch(w){l(w)}},g=m=>m.done?n(m.value):Promise.resolve(m.value).then(u,o);g((i=i.apply(s,t)).next())});var ht=(s,t,i)=>(t=s[at("asyncIterator")])?t.call(s):(s=s[at("iterator")](),t={},i=(n,l)=>(l=s[n])&&(t[n]=u=>new Promise((o,g,m)=>(u=l.call(s,u),m=u.done,Promise.resolve(u.value).then(w=>o({value:w,done:m}),g)))),i("next"),i("return"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ct=require("../notifier/index.cjs"),gt=require("../browser-CpzFX2xg.cjs"),K=require("../url-BiHPIsKq.cjs"),lt=require("../loading/index.cjs");var A,h,f,T,S,M,C,k;class ut{constructor(t,i){r(this,A);r(this,h);r(this,f);r(this,T);r(this,S);r(this,M);r(this,C,t=>{t.preventDefault(),e(this,A).links.forEach(i=>{var n;e(this,f)===e(i,f)||(n=e(i,M))!=null&&n.includes(e(this,f))?e(i,h).classList.add("clicked"):e(i,h).classList.remove("clicked")}),e(this,A).navigate(e(this,f),{historyAction:e(this,T),state:e(this,S)})});r(this,k,()=>{e(this,A).prefetch(e(this,f)),e(this,h).removeEventListener("pointerenter",e(this,k))});var u,o;c(this,A,i),c(this,h,t),c(this,f,e(this,h).getAttribute("href")||"/"),c(this,T,e(this,h).getAttribute("data-history-action")||"push"),c(this,S,e(this,h).getAttribute("data-state")||void 0),e(this,h).addEventListener("click",e(this,C));const n=i.normalizePath(e(this,f)),l=i.normalizePath(location.pathname);c(this,M,(u=e(this,h).getAttribute("data-match-paths"))==null?void 0:u.split(",").map(g=>i.normalizePath(g.trim()).pathname)),e(this,h).hasAttribute("data-include")?l.pathname.includes(n.pathname)&&e(this,h).classList.add("current"):n.pathname===l.pathname||(o=e(this,M))!=null&&o.includes(l.pathname)?(e(this,h).classList.add("current"),e(this,h).classList.add("clicked")):e(this,h).classList.remove("clicked"),e(this,h).hasAttribute("data-prefetch")&&e(this,h).addEventListener("pointerenter",e(this,k))}destroy(){e(this,h).removeEventListener("click",e(this,C)),e(this,h).removeEventListener("pointerenter",e(this,k)),e(this,h).classList.remove("current")}}A=new WeakMap,h=new WeakMap,f=new WeakMap,T=new WeakMap,S=new WeakMap,M=new WeakMap,C=new WeakMap,k=new WeakMap;var z,q,x,_,y,Y,P,L,p,D,R,F,I,d,X,Z,dt,$,G;class Et{constructor(t){r(this,d);r(this,z,null);r(this,q,null);r(this,x,null);r(this,_,null);r(this,y,[]);r(this,Y,new DOMParser);r(this,P,new Map);r(this,L);r(this,p,null);r(this,D);r(this,R);r(this,F,new ct.Notifier);r(this,I,new ct.Notifier);r(this,G,t=>{t.state&&this.navigate(t.state,{historyAction:"none"})});if(gt.isBrowser){c(this,z,K.normalizeBase(t==null?void 0:t.base)),c(this,q,(t==null?void 0:t.waitForHeadToLoad)!==!1),c(this,x,(t==null?void 0:t.cachePages)!==!1),c(this,_,b(this,d,Z).call(this,document.body));const i=this.normalizePath(location.pathname);c(this,p,i.pathname),document.documentElement.setAttribute("data-current-pathname",e(this,p)),document.documentElement.setAttribute("data-current-leaf",i.leaf),this.findLinks(),addEventListener("popstate",e(this,G)),K.changeHistory("replace",e(this,p),i.parameters,i.hash)}}get currentPathname(){return e(this,p)}get previousPathname(){return e(this,D)}get currentState(){return e(this,R)}get links(){return e(this,y)}normalizePath(t){return K.splitPath(t,e(this,z))}beforeNavigationEvent(t){return e(this,F).subscribe(t)}afterNavigationEvent(t){return e(this,I).subscribe(t)}prefetch(t){return N(this,null,function*(){const i=this.normalizePath(t);return b(this,d,X).call(this,i.pathname)})}navigate(l){return N(this,arguments,function*(t,{historyAction:i="push",state:n}={}){var tt;const u=this.normalizePath(t);let{pathname:o,hash:g,parameters:m,leaf:w}=u;if(e(this,L)===o||e(this,p)===o)return;c(this,R,n),c(this,L,o);const O=e(this,P).has(o);try{lt.loading.add("__morph");let B=!0;if(e(this,F).notify({pathname:o,isCached:O,state:n}),this.preprocessor)try{yield new Promise((a,E)=>{var v;(v=this.preprocessor)==null||v.call(this,{pathname:o,resolve:a,reject:E,isCached:O,state:n})})}catch(a){a?console.error(a):console.log("Route change canceled"),B=!1}if(!B||e(this,L)!==o)return;const et=e(this,P).get(o)||(yield b(this,d,X).call(this,o));if(e(this,L)!==o)return;const it=Array.from(document.head.children),st=Array.from(et.head.cloneNode(!0).children),nt=b(this,d,dt).call(this,it,st),mt=b(this,d,$).call(this,it,nt),W=b(this,d,$).call(this,st,nt);W.forEach((a,E)=>{if(a.tagName==="SCRIPT"&&a.getAttribute("src")){const v=document.createElement("script");v.type="module",v.src=a.getAttribute("src"),W[E]=v}}),W.forEach(a=>{document.head.appendChild(a)});const J=W.filter(a=>(a.tagName==="STYLE"||a.tagName==="SCRIPT"||a.tagName==="LINK")&&a.getAttribute("rel")!=="canonical");e(this,q)&&J.length&&(yield new Promise(a=>N(this,null,function*(){let E=0;try{for(var v=ht(J),pt,Q,j;pt=!(Q=yield v.next()).done;pt=!1){const H=Q.value;H.onload=()=>{E++,E===J.length&&a()}}}catch(Q){j=[Q]}finally{try{pt&&(Q=v.return)&&(yield Q.call(v))}finally{if(j)throw j[0]}}}))),mt.forEach(a=>{a.hasAttribute("data-permanent")||a.remove()}),c(this,D,e(this,p)),c(this,p,o),K.changeHistory(i,o,m,g);const ft=b(this,d,Z).call(this,et.body.cloneNode(!0));e(this,_).forEach((a,E)=>{const v=ft[E];let pt=[...a.childNodes],Q=[...v.childNodes];pt.forEach(j=>{if(j instanceof HTMLElement){const H=j.getAttribute("data-remain");let rt;Q=Q.filter(U=>U instanceof HTMLElement&&H&&U.getAttribute("data-remain")===H?(rt=U,!1):!0),H&&rt||j.remove()}else j.remove()}),a.append(...Q)}),this.findLinks(),document.documentElement.setAttribute("data-current-pathname",o),document.documentElement.setAttribute("data-current-leaf",w),(tt=this.postprocessor)==null||tt.call(this,{pathname:o,isCached:O,state:n}),e(this,I).notify({pathname:o,isCached:O,state:n}),lt.loading.complete("__morph")}catch(B){console.error(B)}c(this,L,void 0)})}addLinks(t){t.forEach(i=>{e(this,y).push(new ut(i,this))})}findLinks(){const t=[...document.documentElement.querySelectorAll("a")].filter(i=>{var n;return((n=i.getAttribute("href"))==null?void 0:n.startsWith("/"))&&!i.hasAttribute("download")&&!i.hasAttribute("data-morph-skip")});e(this,y).forEach(i=>i.destroy()),c(this,y,t.map(i=>new ut(i,this)))}}z=new WeakMap,q=new WeakMap,x=new WeakMap,_=new WeakMap,y=new WeakMap,Y=new WeakMap,P=new WeakMap,L=new WeakMap,p=new WeakMap,D=new WeakMap,R=new WeakMap,F=new WeakMap,I=new WeakMap,d=new WeakSet,X=function(t){return N(this,null,function*(){const i=e(this,P).get(t);if(i)return i;const l=yield(yield fetch(t)).text(),u=e(this,Y).parseFromString(l,"text/html");return e(this,x)&&e(this,P).set(t,u),u})},Z=function(t){return[...t.querySelectorAll("[data-morph]")]},dt=function(t,i){return t.filter(n=>i.find(l=>l.outerHTML===n.outerHTML))},$=function(t,i){return t.filter(n=>!i.find(l=>l.outerHTML===n.outerHTML))},G=new WeakMap;exports.Morph=Et;
1
+ "use strict";var at=(s,t)=>(t=Symbol[s])?t:Symbol.for("Symbol."+s),ot=s=>{throw TypeError(s)};var V=(s,t,i)=>t.has(s)||ot("Cannot "+i);var e=(s,t,i)=>(V(s,t,"read from private field"),i?i.call(s):t.get(s)),r=(s,t,i)=>t.has(s)?ot("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(s):t.set(s,i),c=(s,t,i,n)=>(V(s,t,"write to private field"),n?n.call(s,i):t.set(s,i),i),b=(s,t,i)=>(V(s,t,"access private method"),i);var N=(s,t,i)=>new Promise((n,l)=>{var u=m=>{try{g(i.next(m))}catch(y){l(y)}},h=m=>{try{g(i.throw(m))}catch(y){l(y)}},g=m=>m.done?n(m.value):Promise.resolve(m.value).then(u,h);g((i=i.apply(s,t)).next())});var ht=(s,t,i)=>(t=s[at("asyncIterator")])?t.call(s):(s=s[at("iterator")](),t={},i=(n,l)=>(l=s[n])&&(t[n]=u=>new Promise((h,g,m)=>(u=l.call(s,u),m=u.done,Promise.resolve(u.value).then(y=>h({value:y,done:m}),g)))),i("next"),i("return"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ct=require("../notifier/index.cjs"),gt=require("../browser-CpzFX2xg.cjs"),K=require("../url-BiHPIsKq.cjs"),lt=require("../loading/index.cjs");var A,o,f,T,S,k,C,M;class ut{constructor(t,i){r(this,A);r(this,o);r(this,f);r(this,T);r(this,S);r(this,k);r(this,C,t=>{t.preventDefault(),e(this,A).links.forEach(i=>{var n;e(this,f)===e(i,f)||(n=e(i,k))!=null&&n.includes(e(this,f))?e(i,o).classList.add("clicked"):e(i,o).classList.remove("clicked")}),e(this,A).navigate(e(this,f),{historyAction:e(this,T),state:e(this,S)})});r(this,M,()=>{e(this,A).prefetch(e(this,f)),e(this,o).removeEventListener("pointerenter",e(this,M))});var u,h;c(this,A,i),c(this,o,t),c(this,f,e(this,o).getAttribute("href")||"/"),c(this,T,e(this,o).getAttribute("data-history-action")||"push"),c(this,S,e(this,o).getAttribute("data-state")||void 0),e(this,o).addEventListener("click",e(this,C));const n=i.normalizePath(e(this,f)),l=i.normalizePath(location.pathname);c(this,k,(u=e(this,o).getAttribute("data-match-paths"))==null?void 0:u.split(",").map(g=>i.normalizePath(g.trim()).pathname)),e(this,o).hasAttribute("data-include")?l.pathname.includes(n.pathname)&&e(this,o).classList.add("current"):n.pathname===l.pathname||(h=e(this,k))!=null&&h.includes(l.pathname)?(e(this,o).classList.add("current"),e(this,o).classList.add("clicked")):e(this,o).classList.remove("clicked"),e(this,o).hasAttribute("data-prefetch")&&e(this,o).addEventListener("pointerenter",e(this,M))}get element(){return e(this,o)}destroy(){e(this,o).removeEventListener("click",e(this,C)),e(this,o).removeEventListener("pointerenter",e(this,M)),e(this,o).classList.remove("current")}}A=new WeakMap,o=new WeakMap,f=new WeakMap,T=new WeakMap,S=new WeakMap,k=new WeakMap,C=new WeakMap,M=new WeakMap;var z,q,x,_,E,Y,P,w,p,D,R,F,I,d,X,Z,dt,$,G;class Et{constructor(t){r(this,d);r(this,z,null);r(this,q,null);r(this,x,null);r(this,_,null);r(this,E,[]);r(this,Y,new DOMParser);r(this,P,new Map);r(this,w);r(this,p,null);r(this,D);r(this,R);r(this,F,new ct.Notifier);r(this,I,new ct.Notifier);r(this,G,t=>{t.state&&this.navigate(t.state,{historyAction:"none"})});if(gt.isBrowser){c(this,z,K.normalizeBase(t==null?void 0:t.base)),c(this,q,(t==null?void 0:t.waitForHeadToLoad)!==!1),c(this,x,(t==null?void 0:t.cachePages)!==!1),c(this,_,b(this,d,Z).call(this,document.body));const i=this.normalizePath(location.pathname);c(this,p,i.pathname),document.documentElement.setAttribute("data-current-pathname",e(this,p)),document.documentElement.setAttribute("data-current-leaf",i.leaf),this.findLinks(),addEventListener("popstate",e(this,G)),K.changeHistory("replace",e(this,p),i.parameters,i.hash)}}get currentPathname(){return e(this,p)}get previousPathname(){return e(this,D)}get currentState(){return e(this,R)}get links(){return e(this,E)}normalizePath(t){return K.splitPath(t,e(this,z))}beforeNavigationEvent(t){return e(this,F).subscribe(t)}afterNavigationEvent(t){return e(this,I).subscribe(t)}prefetch(t){return N(this,null,function*(){const i=this.normalizePath(t);return b(this,d,X).call(this,i.pathname)})}navigate(l){return N(this,arguments,function*(t,{historyAction:i="push",state:n}={}){var tt;const u=this.normalizePath(t);let{pathname:h,hash:g,parameters:m,leaf:y}=u;if(e(this,w)===h||e(this,p)===h)return;c(this,R,n),c(this,w,h);const O=e(this,P).has(h);try{lt.loading.add("__morph");let B=!0;if(e(this,F).notify({pathname:h,isCached:O,state:n}),this.preprocessor)try{yield new Promise((a,L)=>{var v;(v=this.preprocessor)==null||v.call(this,{pathname:h,resolve:a,reject:L,isCached:O,state:n})})}catch(a){a?console.error(a):console.log("Route change canceled"),B=!1}if(!B||e(this,w)!==h)return;const et=e(this,P).get(h)||(yield b(this,d,X).call(this,h));if(e(this,w)!==h)return;const it=Array.from(document.head.children),st=Array.from(et.head.cloneNode(!0).children),nt=b(this,d,dt).call(this,it,st),mt=b(this,d,$).call(this,it,nt),W=b(this,d,$).call(this,st,nt);W.forEach((a,L)=>{if(a.tagName==="SCRIPT"&&a.getAttribute("src")){const v=document.createElement("script");v.type="module",v.src=a.getAttribute("src"),W[L]=v}}),W.forEach(a=>{document.head.appendChild(a)});const J=W.filter(a=>(a.tagName==="STYLE"||a.tagName==="SCRIPT"||a.tagName==="LINK")&&a.getAttribute("rel")!=="canonical");e(this,q)&&J.length&&(yield new Promise(a=>N(this,null,function*(){let L=0;try{for(var v=ht(J),pt,Q,j;pt=!(Q=yield v.next()).done;pt=!1){const H=Q.value;H.onload=()=>{L++,L===J.length&&a()}}}catch(Q){j=[Q]}finally{try{pt&&(Q=v.return)&&(yield Q.call(v))}finally{if(j)throw j[0]}}}))),mt.forEach(a=>{a.hasAttribute("data-permanent")||a.remove()}),c(this,D,e(this,p)),c(this,p,h),K.changeHistory(i,h,m,g);const ft=b(this,d,Z).call(this,et.body.cloneNode(!0));e(this,_).forEach((a,L)=>{const v=ft[L];let pt=[...a.childNodes],Q=[...v.childNodes];pt.forEach(j=>{if(j instanceof HTMLElement){const H=j.getAttribute("data-remain");let rt;Q=Q.filter(U=>U instanceof HTMLElement&&H&&U.getAttribute("data-remain")===H?(rt=U,!1):!0),H&&rt||j.remove()}else j.remove()}),a.append(...Q)}),this.findLinks(),document.documentElement.setAttribute("data-current-pathname",h),document.documentElement.setAttribute("data-current-leaf",y),(tt=this.postprocessor)==null||tt.call(this,{pathname:h,isCached:O,state:n}),e(this,I).notify({pathname:h,isCached:O,state:n}),lt.loading.complete("__morph")}catch(B){console.error(B)}c(this,w,void 0)})}addLink(t){e(this,E).push(new ut(t,this))}addLinks(t){t.forEach(i=>{this.addLink(i)})}removeLink(t){c(this,E,e(this,E).filter(i=>i.element===t?(i.destroy(),!1):!0))}findLinks(){const t=[...document.documentElement.querySelectorAll("a")].filter(i=>{var n;return((n=i.getAttribute("href"))==null?void 0:n.startsWith("/"))&&!i.hasAttribute("download")&&!i.hasAttribute("data-morph-skip")});e(this,E).forEach(i=>i.destroy()),c(this,E,t.map(i=>new ut(i,this)))}}z=new WeakMap,q=new WeakMap,x=new WeakMap,_=new WeakMap,E=new WeakMap,Y=new WeakMap,P=new WeakMap,w=new WeakMap,p=new WeakMap,D=new WeakMap,R=new WeakMap,F=new WeakMap,I=new WeakMap,d=new WeakSet,X=function(t){return N(this,null,function*(){const i=e(this,P).get(t);if(i)return i;const l=yield(yield fetch(t)).text(),u=e(this,Y).parseFromString(l,"text/html");return e(this,x)&&e(this,P).set(t,u),u})},Z=function(t){const i=[...t.querySelectorAll("[data-morph]")];return i.length?i:[t]},dt=function(t,i){return t.filter(n=>i.find(l=>l.outerHTML===n.outerHTML))},$=function(t,i){return t.filter(n=>!i.find(l=>l.outerHTML===n.outerHTML))},G=new WeakMap;exports.Morph=Et;
@@ -2,73 +2,76 @@ var rt = (s, t) => (t = Symbol[s]) ? t : Symbol.for("Symbol." + s), at = (s) =>
2
2
  throw TypeError(s);
3
3
  };
4
4
  var U = (s, t, i) => t.has(s) || at("Cannot " + i);
5
- var e = (s, t, i) => (U(s, t, "read from private field"), i ? i.call(s) : t.get(s)), r = (s, t, i) => t.has(s) ? at("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(s) : t.set(s, i), c = (s, t, i, n) => (U(s, t, "write to private field"), n ? n.call(s, i) : t.set(s, i), i), L = (s, t, i) => (U(s, t, "access private method"), i);
5
+ var e = (s, t, i) => (U(s, t, "read from private field"), i ? i.call(s) : t.get(s)), r = (s, t, i) => t.has(s) ? at("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(s) : t.set(s, i), c = (s, t, i, n) => (U(s, t, "write to private field"), n ? n.call(s, i) : t.set(s, i), i), b = (s, t, i) => (U(s, t, "access private method"), i);
6
6
  var N = (s, t, i) => new Promise((n, l) => {
7
7
  var u = (m) => {
8
8
  try {
9
9
  g(i.next(m));
10
- } catch (A) {
11
- l(A);
10
+ } catch (w) {
11
+ l(w);
12
12
  }
13
- }, h = (m) => {
13
+ }, o = (m) => {
14
14
  try {
15
15
  g(i.throw(m));
16
- } catch (A) {
17
- l(A);
16
+ } catch (w) {
17
+ l(w);
18
18
  }
19
- }, g = (m) => m.done ? n(m.value) : Promise.resolve(m.value).then(u, h);
19
+ }, g = (m) => m.done ? n(m.value) : Promise.resolve(m.value).then(u, o);
20
20
  g((i = i.apply(s, t)).next());
21
21
  });
22
- var ht = (s, t, i) => (t = s[rt("asyncIterator")]) ? t.call(s) : (s = s[rt("iterator")](), t = {}, i = (n, l) => (l = s[n]) && (t[n] = (u) => new Promise((h, g, m) => (u = l.call(s, u), m = u.done, Promise.resolve(u.value).then((A) => h({ value: A, done: m }), g)))), i("next"), i("return"), t);
22
+ var ht = (s, t, i) => (t = s[rt("asyncIterator")]) ? t.call(s) : (s = s[rt("iterator")](), t = {}, i = (n, l) => (l = s[n]) && (t[n] = (u) => new Promise((o, g, m) => (u = l.call(s, u), m = u.done, Promise.resolve(u.value).then((w) => o({ value: w, done: m }), g)))), i("next"), i("return"), t);
23
23
  import { Notifier as ot } from "../notifier/index.js";
24
24
  import { i as gt } from "../browser-0zX67oeU.js";
25
- import { n as Et, c as ct, s as vt } from "../url-B5eH5z6S.js";
25
+ import { n as Et, c as ct, s as Lt } from "../url-B5eH5z6S.js";
26
26
  import { loading as lt } from "../loading/index.js";
27
- var w, o, f, T, C, k, S, H;
27
+ var y, h, f, T, C, k, S, H;
28
28
  class ut {
29
29
  constructor(t, i) {
30
- r(this, w);
31
- r(this, o);
30
+ r(this, y);
31
+ r(this, h);
32
32
  r(this, f);
33
33
  r(this, T);
34
34
  r(this, C);
35
35
  r(this, k);
36
36
  r(this, S, (t) => {
37
- t.preventDefault(), e(this, w).links.forEach((i) => {
37
+ t.preventDefault(), e(this, y).links.forEach((i) => {
38
38
  var n;
39
- e(this, f) === e(i, f) || (n = e(i, k)) != null && n.includes(e(this, f)) ? e(i, o).classList.add("clicked") : e(i, o).classList.remove("clicked");
40
- }), e(this, w).navigate(e(this, f), {
39
+ e(this, f) === e(i, f) || (n = e(i, k)) != null && n.includes(e(this, f)) ? e(i, h).classList.add("clicked") : e(i, h).classList.remove("clicked");
40
+ }), e(this, y).navigate(e(this, f), {
41
41
  historyAction: e(this, T),
42
42
  state: e(this, C)
43
43
  });
44
44
  });
45
45
  r(this, H, () => {
46
- e(this, w).prefetch(e(this, f)), e(this, o).removeEventListener("pointerenter", e(this, H));
46
+ e(this, y).prefetch(e(this, f)), e(this, h).removeEventListener("pointerenter", e(this, H));
47
47
  });
48
- var u, h;
49
- c(this, w, i), c(this, o, t), c(this, f, e(this, o).getAttribute("href") || "/"), c(this, T, e(this, o).getAttribute(
48
+ var u, o;
49
+ c(this, y, i), c(this, h, t), c(this, f, e(this, h).getAttribute("href") || "/"), c(this, T, e(this, h).getAttribute(
50
50
  "data-history-action"
51
- ) || "push"), c(this, C, e(this, o).getAttribute("data-state") || void 0), e(this, o).addEventListener("click", e(this, S));
51
+ ) || "push"), c(this, C, e(this, h).getAttribute("data-state") || void 0), e(this, h).addEventListener("click", e(this, S));
52
52
  const n = i.normalizePath(e(this, f)), l = i.normalizePath(location.pathname);
53
- c(this, k, (u = e(this, o).getAttribute("data-match-paths")) == null ? void 0 : u.split(",").map((g) => i.normalizePath(g.trim()).pathname)), e(this, o).hasAttribute("data-include") ? l.pathname.includes(n.pathname) && e(this, o).classList.add("current") : n.pathname === l.pathname || (h = e(this, k)) != null && h.includes(l.pathname) ? (e(this, o).classList.add("current"), e(this, o).classList.add("clicked")) : e(this, o).classList.remove("clicked"), e(this, o).hasAttribute("data-prefetch") && e(this, o).addEventListener("pointerenter", e(this, H));
53
+ c(this, k, (u = e(this, h).getAttribute("data-match-paths")) == null ? void 0 : u.split(",").map((g) => i.normalizePath(g.trim()).pathname)), e(this, h).hasAttribute("data-include") ? l.pathname.includes(n.pathname) && e(this, h).classList.add("current") : n.pathname === l.pathname || (o = e(this, k)) != null && o.includes(l.pathname) ? (e(this, h).classList.add("current"), e(this, h).classList.add("clicked")) : e(this, h).classList.remove("clicked"), e(this, h).hasAttribute("data-prefetch") && e(this, h).addEventListener("pointerenter", e(this, H));
54
+ }
55
+ get element() {
56
+ return e(this, h);
54
57
  }
55
58
  destroy() {
56
- e(this, o).removeEventListener("click", e(this, S)), e(this, o).removeEventListener("pointerenter", e(this, H)), e(this, o).classList.remove("current");
59
+ e(this, h).removeEventListener("click", e(this, S)), e(this, h).removeEventListener("pointerenter", e(this, H)), e(this, h).classList.remove("current");
57
60
  }
58
61
  }
59
- w = new WeakMap(), o = new WeakMap(), f = new WeakMap(), T = new WeakMap(), C = new WeakMap(), k = new WeakMap(), S = new WeakMap(), H = new WeakMap();
60
- var z, x, D, R, P, Y, y, b, p, _, F, I, q, d, V, X, dt, Z, j;
61
- class yt {
62
+ y = new WeakMap(), h = new WeakMap(), f = new WeakMap(), T = new WeakMap(), C = new WeakMap(), k = new WeakMap(), S = new WeakMap(), H = new WeakMap();
63
+ var z, x, D, R, E, Y, P, A, p, _, F, I, q, d, V, X, dt, Z, j;
64
+ class Pt {
62
65
  constructor(t) {
63
66
  r(this, d);
64
67
  r(this, z, null);
65
68
  r(this, x, null);
66
69
  r(this, D, null);
67
70
  r(this, R, null);
68
- r(this, P, []);
71
+ r(this, E, []);
69
72
  r(this, Y, new DOMParser());
70
- r(this, y, /* @__PURE__ */ new Map());
71
- r(this, b);
73
+ r(this, P, /* @__PURE__ */ new Map());
74
+ r(this, A);
72
75
  r(this, p, null);
73
76
  r(this, _);
74
77
  r(this, F);
@@ -78,7 +81,7 @@ class yt {
78
81
  t.state && this.navigate(t.state, { historyAction: "none" });
79
82
  });
80
83
  if (gt) {
81
- c(this, z, Et(t == null ? void 0 : t.base)), c(this, x, (t == null ? void 0 : t.waitForHeadToLoad) !== !1), c(this, D, (t == null ? void 0 : t.cachePages) !== !1), c(this, R, L(this, d, X).call(this, document.body));
84
+ c(this, z, Et(t == null ? void 0 : t.base)), c(this, x, (t == null ? void 0 : t.waitForHeadToLoad) !== !1), c(this, D, (t == null ? void 0 : t.cachePages) !== !1), c(this, R, b(this, d, X).call(this, document.body));
82
85
  const i = this.normalizePath(location.pathname);
83
86
  c(this, p, i.pathname), document.documentElement.setAttribute(
84
87
  "data-current-pathname",
@@ -104,10 +107,10 @@ class yt {
104
107
  return e(this, F);
105
108
  }
106
109
  get links() {
107
- return e(this, P);
110
+ return e(this, E);
108
111
  }
109
112
  normalizePath(t) {
110
- return vt(t, e(this, z));
113
+ return Lt(t, e(this, z));
111
114
  }
112
115
  beforeNavigationEvent(t) {
113
116
  return e(this, I).subscribe(t);
@@ -118,46 +121,46 @@ class yt {
118
121
  prefetch(t) {
119
122
  return N(this, null, function* () {
120
123
  const i = this.normalizePath(t);
121
- return L(this, d, V).call(this, i.pathname);
124
+ return b(this, d, V).call(this, i.pathname);
122
125
  });
123
126
  }
124
127
  navigate(l) {
125
128
  return N(this, arguments, function* (t, { historyAction: i = "push", state: n } = {}) {
126
129
  var $;
127
130
  const u = this.normalizePath(t);
128
- let { pathname: h, hash: g, parameters: m, leaf: A } = u;
129
- if (e(this, b) === h || e(this, p) === h)
131
+ let { pathname: o, hash: g, parameters: m, leaf: w } = u;
132
+ if (e(this, A) === o || e(this, p) === o)
130
133
  return;
131
- c(this, F, n), c(this, b, h);
132
- const B = e(this, y).has(h);
134
+ c(this, F, n), c(this, A, o);
135
+ const B = e(this, P).has(o);
133
136
  try {
134
137
  lt.add("__morph");
135
138
  let O = !0;
136
139
  if (e(this, I).notify({
137
- pathname: h,
140
+ pathname: o,
138
141
  isCached: B,
139
142
  state: n
140
143
  }), this.preprocessor)
141
144
  try {
142
- yield new Promise((a, E) => {
145
+ yield new Promise((a, L) => {
143
146
  var v;
144
- (v = this.preprocessor) == null || v.call(this, { pathname: h, resolve: a, reject: E, isCached: B, state: n });
147
+ (v = this.preprocessor) == null || v.call(this, { pathname: o, resolve: a, reject: L, isCached: B, state: n });
145
148
  });
146
149
  } catch (a) {
147
150
  a ? console.error(a) : console.log("Route change canceled"), O = !1;
148
151
  }
149
- if (!O || e(this, b) !== h)
152
+ if (!O || e(this, A) !== o)
150
153
  return;
151
- const tt = e(this, y).get(h) || (yield L(this, d, V).call(this, h));
152
- if (e(this, b) !== h)
154
+ const tt = e(this, P).get(o) || (yield b(this, d, V).call(this, o));
155
+ if (e(this, A) !== o)
153
156
  return;
154
157
  const et = Array.from(document.head.children), it = Array.from(
155
158
  tt.head.cloneNode(!0).children
156
- ), st = L(this, d, dt).call(this, et, it), mt = L(this, d, Z).call(this, et, st), W = L(this, d, Z).call(this, it, st);
157
- W.forEach((a, E) => {
159
+ ), st = b(this, d, dt).call(this, et, it), mt = b(this, d, Z).call(this, et, st), W = b(this, d, Z).call(this, it, st);
160
+ W.forEach((a, L) => {
158
161
  if (a.tagName === "SCRIPT" && a.getAttribute("src")) {
159
162
  const v = document.createElement("script");
160
- v.type = "module", v.src = a.getAttribute("src"), W[E] = v;
163
+ v.type = "module", v.src = a.getAttribute("src"), W[L] = v;
161
164
  }
162
165
  }), W.forEach((a) => {
163
166
  document.head.appendChild(a);
@@ -166,12 +169,12 @@ class yt {
166
169
  (a) => (a.tagName === "STYLE" || a.tagName === "SCRIPT" || a.tagName === "LINK") && a.getAttribute("rel") !== "canonical"
167
170
  );
168
171
  e(this, x) && G.length && (yield new Promise((a) => N(this, null, function* () {
169
- let E = 0;
172
+ let L = 0;
170
173
  try {
171
174
  for (var v = ht(G), pt, J, K; pt = !(J = yield v.next()).done; pt = !1) {
172
175
  const M = J.value;
173
176
  M.onload = () => {
174
- E++, E === G.length && a();
177
+ L++, L === G.length && a();
175
178
  };
176
179
  }
177
180
  } catch (J) {
@@ -186,10 +189,10 @@ class yt {
186
189
  }
187
190
  }))), mt.forEach((a) => {
188
191
  a.hasAttribute("data-permanent") || a.remove();
189
- }), c(this, _, e(this, p)), c(this, p, h), ct(i, h, m, g);
190
- const ft = L(this, d, X).call(this, tt.body.cloneNode(!0));
191
- e(this, R).forEach((a, E) => {
192
- const v = ft[E];
192
+ }), c(this, _, e(this, p)), c(this, p, o), ct(i, o, m, g);
193
+ const ft = b(this, d, X).call(this, tt.body.cloneNode(!0));
194
+ e(this, R).forEach((a, L) => {
195
+ const v = ft[L];
193
196
  let pt = [...a.childNodes], J = [...v.childNodes];
194
197
  pt.forEach((K) => {
195
198
  if (K instanceof HTMLElement) {
@@ -201,18 +204,24 @@ class yt {
201
204
  } else
202
205
  K.remove();
203
206
  }), a.append(...J);
204
- }), this.findLinks(), document.documentElement.setAttribute("data-current-pathname", h), document.documentElement.setAttribute("data-current-leaf", A), ($ = this.postprocessor) == null || $.call(this, { pathname: h, isCached: B, state: n }), e(this, q).notify({ pathname: h, isCached: B, state: n }), lt.complete("__morph");
207
+ }), this.findLinks(), document.documentElement.setAttribute("data-current-pathname", o), document.documentElement.setAttribute("data-current-leaf", w), ($ = this.postprocessor) == null || $.call(this, { pathname: o, isCached: B, state: n }), e(this, q).notify({ pathname: o, isCached: B, state: n }), lt.complete("__morph");
205
208
  } catch (O) {
206
209
  console.error(O);
207
210
  }
208
- c(this, b, void 0);
211
+ c(this, A, void 0);
209
212
  });
210
213
  }
214
+ addLink(t) {
215
+ e(this, E).push(new ut(t, this));
216
+ }
211
217
  addLinks(t) {
212
218
  t.forEach((i) => {
213
- e(this, P).push(new ut(i, this));
219
+ this.addLink(i);
214
220
  });
215
221
  }
222
+ removeLink(t) {
223
+ c(this, E, e(this, E).filter((i) => i.element === t ? (i.destroy(), !1) : !0));
224
+ }
216
225
  findLinks() {
217
226
  const t = [
218
227
  ...document.documentElement.querySelectorAll("a")
@@ -222,19 +231,20 @@ class yt {
222
231
  return ((n = i.getAttribute("href")) == null ? void 0 : n.startsWith("/")) && !i.hasAttribute("download") && !i.hasAttribute("data-morph-skip");
223
232
  }
224
233
  );
225
- e(this, P).forEach((i) => i.destroy()), c(this, P, t.map((i) => new ut(i, this)));
234
+ e(this, E).forEach((i) => i.destroy()), c(this, E, t.map((i) => new ut(i, this)));
226
235
  }
227
236
  }
228
- z = new WeakMap(), x = new WeakMap(), D = new WeakMap(), R = new WeakMap(), P = new WeakMap(), Y = new WeakMap(), y = new WeakMap(), b = new WeakMap(), p = new WeakMap(), _ = new WeakMap(), F = new WeakMap(), I = new WeakMap(), q = new WeakMap(), d = new WeakSet(), V = function(t) {
237
+ z = new WeakMap(), x = new WeakMap(), D = new WeakMap(), R = new WeakMap(), E = new WeakMap(), Y = new WeakMap(), P = new WeakMap(), A = new WeakMap(), p = new WeakMap(), _ = new WeakMap(), F = new WeakMap(), I = new WeakMap(), q = new WeakMap(), d = new WeakSet(), V = function(t) {
229
238
  return N(this, null, function* () {
230
- const i = e(this, y).get(t);
239
+ const i = e(this, P).get(t);
231
240
  if (i)
232
241
  return i;
233
242
  const l = yield (yield fetch(t)).text(), u = e(this, Y).parseFromString(l, "text/html");
234
- return e(this, D) && e(this, y).set(t, u), u;
243
+ return e(this, D) && e(this, P).set(t, u), u;
235
244
  });
236
245
  }, X = function(t) {
237
- return [...t.querySelectorAll("[data-morph]")];
246
+ const i = [...t.querySelectorAll("[data-morph]")];
247
+ return i.length ? i : [t];
238
248
  }, dt = function(t, i) {
239
249
  return t.filter(
240
250
  (n) => i.find(
@@ -249,5 +259,5 @@ z = new WeakMap(), x = new WeakMap(), D = new WeakMap(), R = new WeakMap(), P =
249
259
  );
250
260
  }, j = new WeakMap();
251
261
  export {
252
- yt as Morph
262
+ Pt as Morph
253
263
  };
@@ -1,9 +1,11 @@
1
1
  import { Store } from '../store/vanilla';
2
2
  import { Source } from './SourceClass';
3
+ import { SourceSetOptions } from './SourceSet';
3
4
 
4
5
  export type SourceManagerSourceSet = string | Array<string>;
5
6
  export interface SourceManagerParameters {
6
7
  srcset: SourceManagerSourceSet;
8
+ sourceSetOptions?: SourceSetOptions;
7
9
  }
8
10
  export declare class SourceManager extends Store<Source | undefined> {
9
11
  #private;
@@ -2,8 +2,11 @@ import { Source } from './SourceClass';
2
2
 
3
3
  export type SourceSetMediaSources = Array<Source>;
4
4
  export type SourceSetMediaBucket = Map<string, SourceSetMediaSources>;
5
+ export interface SourceSetOptions {
6
+ mediaBuckets?: boolean;
7
+ }
5
8
  export declare class SourceSet {
6
9
  #private;
7
- constructor(sourceSet: string | Array<string>);
10
+ constructor(sourceSet: string | Array<string>, options?: SourceSetOptions);
8
11
  get mediaBuckets(): SourceSetMediaBucket;
9
12
  }
@@ -1 +1 @@
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-C2J4Q87x.cjs");var w,x,R,d,a,u,f;class _{constructor(n){o(this,w);o(this,x);o(this,R);o(this,d);o(this,a);o(this,u);o(this,f);i(this,w,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,R,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,w)}get name(){return e(this,x)}get density(){return e(this,R)}get query(){return e(this,d)}get extension(){return e(this,f)}get queryType(){return e(this,u)}get queryValue(){return e(this,a)}}w=new WeakMap,x=new WeakMap,R=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 M,q;class B extends A.Store{constructor(t){super(void 0);o(this,M);o(this,q,()=>{let t;e(this,M).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,M,new k(t.srcset))}close(){super.close(),this.disconnect()}connect(){T.windowResizer.subscribe(e(this,q),z.RESIZE_ORDER.SOURCE_MANAGER),e(this,q).call(this)}disconnect(){T.windowResizer.unsubscribe(e(this,q))}}M=new WeakMap,q=new WeakMap;exports.Source=_;exports.SourceManager=B;exports.SourceSet=k;
1
+ "use strict";var b=r=>{throw TypeError(r)};var k=(r,n,t)=>n.has(r)||b("Cannot "+t);var e=(r,n,t)=>(k(r,n,"read from private field"),t?t.call(r):n.get(r)),u=(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,h)=>(k(r,n,"write to private field"),h?h.call(r,t):n.set(r,t),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("../order/index.cjs"),B=require("../window-resizer/vanilla/index.cjs"),z=require("../Store-C2J4Q87x.cjs");var w,p,M,d,a,o,f;class I{constructor(n){u(this,w);u(this,p);u(this,M);u(this,d);u(this,a);u(this,o);u(this,f);s(this,w,n);const t=n.split(".");s(this,p,t.length>1?t.slice(0,-1).join("."):t.join("."));const h=/\d+x/g,y=t.find(l=>l.match(h));s(this,M,y?parseInt(y):1);const c=/\d+max/g,g=/\d+min/g,S=/\d+mar/g,E=/\d+mir/g,$=t.find(l=>l.match(c)),i=t.find(l=>l.match(g)),m=t.find(l=>l.match(S)),V=t.find(l=>l.match(E));m?(s(this,a,parseInt(m)),s(this,o,"max"),s(this,d,`(max-aspect-ratio: ${e(this,a)})`)):V?(s(this,a,parseInt(V)),s(this,o,"max"),s(this,d,`(min-aspect-ratio: ${e(this,a)})`)):$?(s(this,a,parseInt($)),s(this,o,"max"),s(this,d,`(max-width: ${e(this,a)}px)`)):i?(s(this,a,parseInt(i)),s(this,d,`(min-width: ${e(this,a)}px)`),s(this,o,"min")):(s(this,a,0),s(this,d,`(min-width: ${e(this,a)}px)`),s(this,o,"min")),s(this,p,e(this,p).replace(`.${e(this,a)}${e(this,o)}`,"")),s(this,f,t[t.length-1]===e(this,p)?"":"."+t[t.length-1]),s(this,f,e(this,f).replace(`.${e(this,a)}${e(this,o)}`,""))}get url(){return e(this,w)}get name(){return e(this,p)}get density(){return e(this,M)}get query(){return e(this,d)}get extension(){return e(this,f)}get queryType(){return e(this,o)}get queryValue(){return e(this,a)}}w=new WeakMap,p=new WeakMap,M=new WeakMap,d=new WeakMap,a=new WeakMap,o=new WeakMap,f=new WeakMap;var x;class T{constructor(n,t){u(this,x);s(this,x,new Map);const h=(t==null?void 0:t.mediaBuckets)!==!1,y=typeof n=="string"?h?n.trim().split(",").map(i=>i.trim()).filter(i=>!!i):[n]:n,c=[];y.forEach(i=>{const m=new I(i);c.push([m.query,m])});const g=c.filter(i=>i[1].queryType.includes("max")).sort((i,m)=>m[1].queryValue-i[1].queryValue),S=c.filter(i=>i[1].queryType.includes("min")&&i[1].queryValue!==0).sort((i,m)=>i[1].queryValue-m[1].queryValue),E=c.filter(i=>i[0]==="(min-width: 0px)");(E?[...E,...g,...S]:[...g,...S]).forEach(i=>{e(this,x).has(i[0])||e(this,x).set(i[0],[]),e(this,x).get(i[0]).push(i[1])})}get mediaBuckets(){return e(this,x)}}x=new WeakMap;var R,q;class A extends z.Store{constructor(t){super(void 0);u(this,R);u(this,q,()=>{let t;e(this,R).mediaBuckets.forEach((c,g)=>{matchMedia(g).matches&&(t=c)});let h,y=0;t==null||t.forEach(c=>{c.density>y&&c.density<=Math.max(devicePixelRatio,1)&&(y=c.density,h=c)}),t!=null&&t.length&&!h&&(h=t[0]),this.current=h});s(this,R,new T(t.srcset,t.sourceSetOptions))}close(){super.close(),this.disconnect()}connect(){B.windowResizer.subscribe(e(this,q),_.RESIZE_ORDER.SOURCE_MANAGER),e(this,q).call(this)}disconnect(){B.windowResizer.unsubscribe(e(this,q))}}R=new WeakMap,q=new WeakMap;exports.Source=I;exports.SourceManager=A;exports.SourceSet=T;
@@ -1,32 +1,32 @@
1
- var b = (r) => {
1
+ var B = (r) => {
2
2
  throw TypeError(r);
3
3
  };
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";
4
+ var I = (r, n, t) => n.has(r) || B("Cannot " + t);
5
+ var e = (r, n, t) => (I(r, n, "read from private field"), t ? t.call(r) : n.get(r)), m = (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, c) => (I(r, n, "write to private field"), c ? c.call(r, t) : n.set(r, t), t);
6
+ import { RESIZE_ORDER as A } from "../order/index.js";
7
+ import { windowResizer as b } from "../window-resizer/vanilla/index.js";
8
8
  import { S } from "../Store-Cm3LPXlx.js";
9
- var w, f, E, p, h, m, y;
9
+ var w, p, E, d, h, o, y;
10
10
  class T {
11
11
  constructor(n) {
12
- o(this, w);
13
- o(this, f);
14
- o(this, E);
15
- o(this, p);
16
- o(this, h);
17
- o(this, m);
18
- o(this, y);
19
- s(this, w, n);
12
+ m(this, w);
13
+ m(this, p);
14
+ m(this, E);
15
+ m(this, d);
16
+ m(this, h);
17
+ m(this, o);
18
+ m(this, y);
19
+ i(this, w, n);
20
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, E, 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)}`,
21
+ i(this, p, t.length > 1 ? t.slice(0, -1).join(".") : t.join("."));
22
+ const c = /\d+x/g, x = t.find((l) => l.match(c));
23
+ i(this, E, x ? parseInt(x) : 1);
24
+ const a = /\d+max/g, g = /\d+min/g, R = /\d+mar/g, $ = /\d+mir/g, V = t.find((l) => l.match(a)), s = t.find((l) => l.match(g)), u = t.find((l) => l.match(R)), k = t.find((l) => l.match($));
25
+ u ? (i(this, h, parseInt(u)), i(this, o, "max"), i(this, d, `(max-aspect-ratio: ${e(this, h)})`)) : k ? (i(this, h, parseInt(k)), i(this, o, "max"), i(this, d, `(min-aspect-ratio: ${e(this, h)})`)) : V ? (i(this, h, parseInt(V)), i(this, o, "max"), i(this, d, `(max-width: ${e(this, h)}px)`)) : s ? (i(this, h, parseInt(s)), i(this, d, `(min-width: ${e(this, h)}px)`), i(this, o, "min")) : (i(this, h, 0), i(this, d, `(min-width: ${e(this, h)}px)`), i(this, o, "min")), i(this, p, e(this, p).replace(
26
+ `.${e(this, h)}${e(this, o)}`,
27
27
  ""
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)}`,
28
+ )), i(this, y, t[t.length - 1] === e(this, p) ? "" : "." + t[t.length - 1]), i(this, y, e(this, y).replace(
29
+ `.${e(this, h)}${e(this, o)}`,
30
30
  ""
31
31
  ));
32
32
  }
@@ -34,75 +34,75 @@ class T {
34
34
  return e(this, w);
35
35
  }
36
36
  get name() {
37
- return e(this, f);
37
+ return e(this, p);
38
38
  }
39
39
  get density() {
40
40
  return e(this, E);
41
41
  }
42
42
  get query() {
43
- return e(this, p);
43
+ return e(this, d);
44
44
  }
45
45
  get extension() {
46
46
  return e(this, y);
47
47
  }
48
48
  get queryType() {
49
- return e(this, m);
49
+ return e(this, o);
50
50
  }
51
51
  get queryValue() {
52
52
  return e(this, h);
53
53
  }
54
54
  }
55
- w = new WeakMap(), f = new WeakMap(), E = new WeakMap(), p = new WeakMap(), h = new WeakMap(), m = new WeakMap(), y = new WeakMap();
56
- var x;
57
- class 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);
55
+ w = new WeakMap(), p = new WeakMap(), E = new WeakMap(), d = new WeakMap(), h = new WeakMap(), o = new WeakMap(), y = new WeakMap();
56
+ var f;
57
+ class O {
58
+ constructor(n, t) {
59
+ m(this, f);
60
+ i(this, f, /* @__PURE__ */ new Map());
61
+ const c = (t == null ? void 0 : t.mediaBuckets) !== !1, x = typeof n == "string" ? c ? n.trim().split(",").map((s) => s.trim()).filter((s) => !!s) : [n] : n, a = [];
62
+ x.forEach((s) => {
63
+ const u = new T(s);
64
64
  a.push([u.query, u]);
65
65
  });
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]);
66
+ const g = a.filter((s) => s[1].queryType.includes("max")).sort((s, u) => u[1].queryValue - s[1].queryValue), R = a.filter((s) => s[1].queryType.includes("min") && s[1].queryValue !== 0).sort((s, u) => s[1].queryValue - u[1].queryValue), $ = a.filter((s) => s[0] === "(min-width: 0px)");
67
+ ($ ? [...$, ...g, ...R] : [...g, ...R]).forEach((s) => {
68
+ e(this, f).has(s[0]) || e(this, f).set(s[0], []), e(this, f).get(s[0]).push(s[1]);
69
69
  });
70
70
  }
71
71
  get mediaBuckets() {
72
- return e(this, x);
72
+ return e(this, f);
73
73
  }
74
74
  }
75
- x = new WeakMap();
76
- var R, q;
75
+ f = new WeakMap();
76
+ var M, q;
77
77
  class _ extends S {
78
78
  constructor(t) {
79
79
  super(void 0);
80
- o(this, R);
81
- o(this, q, () => {
80
+ m(this, M);
81
+ m(this, q, () => {
82
82
  let t;
83
- e(this, R).mediaBuckets.forEach((c, g) => {
84
- matchMedia(g).matches && (t = c);
83
+ e(this, M).mediaBuckets.forEach((a, g) => {
84
+ matchMedia(g).matches && (t = a);
85
85
  });
86
- let a, d = 0;
87
- t == null || t.forEach((c) => {
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;
86
+ let c, x = 0;
87
+ t == null || t.forEach((a) => {
88
+ a.density > x && a.density <= Math.max(devicePixelRatio, 1) && (x = a.density, c = a);
89
+ }), t != null && t.length && !c && (c = t[0]), this.current = c;
90
90
  });
91
- s(this, R, new P(t.srcset));
91
+ i(this, M, new O(t.srcset, t.sourceSetOptions));
92
92
  }
93
93
  close() {
94
94
  super.close(), this.disconnect();
95
95
  }
96
96
  connect() {
97
- A.subscribe(e(this, q), B.SOURCE_MANAGER), e(this, q).call(this);
97
+ b.subscribe(e(this, q), A.SOURCE_MANAGER), e(this, q).call(this);
98
98
  }
99
99
  disconnect() {
100
- A.unsubscribe(e(this, q));
100
+ b.unsubscribe(e(this, q));
101
101
  }
102
102
  }
103
- R = new WeakMap(), q = new WeakMap();
103
+ M = new WeakMap(), q = new WeakMap();
104
104
  export {
105
105
  T as Source,
106
106
  _ as SourceManager,
107
- P as SourceSet
107
+ O as SourceSet
108
108
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aptechka",
3
- "version": "0.40.5",
3
+ "version": "0.40.7",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/denisavitski/aptechka.git"