aptechka 0.70.11 → 0.70.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- "use strict";var ht=h=>{throw TypeError(h)};var st=(h,r,e)=>r.has(h)||ht("Cannot "+e);var t=(h,r,e)=>(st(h,r,"read from private field"),e?e.call(h):r.get(h)),s=(h,r,e)=>r.has(h)?ht("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(h):r.set(h,e),l=(h,r,e,i)=>(st(h,r,"write to private field"),i?i.call(h,e):r.set(h,e),e),c=(h,r,e)=>(st(h,r,"access private method"),e);var z=(h,r,e)=>new Promise((i,n)=>{var a=B=>{try{tt(e.next(B))}catch(et){n(et)}},y=B=>{try{tt(e.throw(B))}catch(et){n(et)}},tt=B=>B.done?i(B.value):Promise.resolve(B.value).then(a,y);tt((e=e.apply(h,r)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const $=require("../index-DekP7OZe.cjs"),nt=require("../custom-elements-Dh4TWRDJ.cjs"),Z=require("../dom-JBOkFLTh.cjs");require("construct-style-sheets-polyfill");const M=require("../css-property/index.cjs"),pt=require("../events-KVanG9sR.cjs"),gt=require("../gestures-C7gbKx11.cjs"),Et=require("../math-GDWEqu7y.cjs"),lt=require("../number-ChAm68cm.cjs");var m,I,R,f,ot,ct,ut,it;class at{constructor(r,e){s(this,f);s(this,m);s(this,I,null);s(this,R,!1);this.element=r,l(this,m,e)}destroy(){c(this,f,it).call(this)}updateClasses(r){const e=r===t(this,m).counter;t(this,R)&&!e?this.element.classList.add("was-current"):this.element.classList.remove("was-current"),c(this,f,ut).call(this),c(this,f,it).call(this),r===t(this,m).counter?c(this,f,ot).call(this):r<t(this,m).counter?this.element.classList.add("previous"):this.element.classList.add("next"),c(this,f,ct).call(this,r)}}m=new WeakMap,I=new WeakMap,R=new WeakMap,f=new WeakSet,ot=function(){l(this,R,!0),this.element.classList.add("current"),l(this,I,requestAnimationFrame(()=>{this.element.classList.add("current-active")}))},ct=function(r){r===lt.loopNumber(t(this,m).counter-1,t(this,m).length)?this.element.classList.add("previous-sibling"):r===(t(this,m).counter+1)%t(this,m).length&&this.element.classList.add("next-sibling")},ut=function(){this.element.classList.remove("current","previous","next","previous-sibling","next-sibling","current-active")},it=function(){t(this,I)&&(cancelAnimationFrame(t(this,I)),l(this,I,null))};var F,P,L,C,S,k,T,q,p,o,d,D,u,rt,V,N,W,Q,X,Y;class K extends HTMLElement{constructor(){super(...arguments);s(this,u);s(this,F,new M.CSSProperty(this,"--resize",!0));s(this,P,new M.CSSProperty(this,"--loop",!0));s(this,L,new M.CSSProperty(this,"--autoplay",!1));s(this,C,new M.CSSProperty(this,"--swipe","x"));s(this,S,new M.CSSProperty(this,"--length-offset",0));s(this,k);s(this,T,!1);s(this,q,[]);s(this,p,new Map);s(this,o,-1);s(this,d,0);s(this,D,[]);s(this,N,e=>{l(this,T,e.isIntersecting),t(this,T)?c(this,u,V).call(this):clearInterval(t(this,k))});s(this,W,()=>{clearInterval(t(this,k)),t(this,T)&&l(this,k,setInterval(t(this,X),this.autoplayDuration))});s(this,X,()=>{c(this,u,Q).call(this,t(this,o)+1)});s(this,Y,e=>{if(!t(this,C).current)return;let i=0;gt.setupDrag(n=>{const a=e.x-n.x,y=e.y-n.y;t(this,C).current==="x"?Math.abs(a)>Math.abs(y)&&Math.abs(a)>10&&(i=Math.sign(a)):t(this,C).current==="y"&&Math.abs(y)>Math.abs(a)&&Math.abs(y)>10&&(i=Math.sign(y))},()=>{i&&this.shift(i)})})}get counter(){return t(this,o)}get loop(){return t(this,P)}get autoplay(){return t(this,L)}get autoplayDuration(){return parseFloat(t(this,L).current||"0")*1e3}get swipe(){return t(this,C)}get lengthOffset(){return t(this,S)}get items(){return t(this,q)}get groups(){return t(this,p)}get length(){return t(this,d)}addItem(e){const i=new at(e,this);t(this,q).push(i);const n=e.getAttribute("data-billboard-item-group")||"default";let a=t(this,p).get(n);a||(a=[],t(this,p).set(n,a)),a.push(i),c(this,u,rt).call(this)}set(e){(!this.handleSet||this.handleSet(e))&&(c(this,u,Q).call(this,e),c(this,u,V).call(this))}shift(e){this.set(t(this,o)+e)}connectedCallback(){[...this.querySelectorAll(`[data-billboard-item${this.id?`="${this.id}"`:""}]`)].forEach(i=>{this.addItem(i)}),t(this,p).forEach(i=>{var n;(n=i[0])==null||n.element.classList.add("current")}),t(this,L).subscribe(i=>{i.current?($.intersector.subscribe(this,t(this,N)),c(this,u,V).call(this)):(l(this,T,!0),$.intersector.unsubscribe(t(this,N)),clearInterval(t(this,k)),c(this,u,Q).call(this,0))}),t(this,S).subscribe(()=>{c(this,u,rt).call(this)}),t(this,L).observe(),t(this,C).observe(),t(this,S).observe(),t(this,P).observe(),t(this,F).observe(),c(this,u,Q).call(this,0),this.addEventListener("pointerdown",t(this,Y))}disconnectedCallback(){t(this,L).unobserve(),t(this,C).unobserve(),t(this,S).unobserve(),t(this,P).unobserve(),t(this,F).unobserve(),t(this,q).forEach(e=>e.destroy()),l(this,q,[]),t(this,p).clear(),$.intersector.unsubscribe(t(this,N)),clearInterval(t(this,k)),t(this,D).forEach(e=>{clearTimeout(e)})}}F=new WeakMap,P=new WeakMap,L=new WeakMap,C=new WeakMap,S=new WeakMap,k=new WeakMap,T=new WeakMap,q=new WeakMap,p=new WeakMap,o=new WeakMap,d=new WeakMap,D=new WeakMap,u=new WeakSet,rt=function(){l(this,d,0),t(this,p).forEach(e=>{e.length>t(this,d)&&l(this,d,e.length)}),l(this,d,t(this,d)+t(this,S).current)},V=function(){t(this,L).current!==!1&&t(this,W).call(this)},N=new WeakMap,W=new WeakMap,Q=function(){return z(this,arguments,function*(e=t(this,o)){const i=t(this,o);t(this,P).current?l(this,o,lt.loopNumber(e,t(this,d))):l(this,o,Et.clamp(e,0,t(this,d)-1)),i!==t(this,o)&&(t(this,D).forEach(n=>{clearTimeout(n)}),this.classList.remove("forward","backward","next-round","prev-round"),t(this,o)-i>=0?this.classList.add("forward"):t(this,o)-i<0&&this.classList.add("backward"),t(this,p).forEach(n=>{n.forEach((a,y)=>{a.updateClasses(y)})}),this.classList.toggle("has-length",t(this,d)>1),this.classList.toggle("start",t(this,o)===0),this.classList.toggle("end",t(this,o)===t(this,d)-1),this.style.setProperty("--counter",t(this,o).toString()),this.style.setProperty("--sections",t(this,d).toString()),pt.dispatchEvent(this,"billboardChange",{detail:{counter:t(this,o)}}),t(this,F).current&&t(this,D).push(setTimeout(()=>{window.dispatchEvent(new Event("resize"))},0)),t(this,D).push(setTimeout(()=>{this.classList.remove("next-round","prev-round")},10)))})},X=new WeakMap,Y=new WeakMap;customElements.get("e-billboard")||customElements.define("e-billboard",K);var g,O,E,U,_;class dt extends HTMLElement{constructor(){super(...arguments);s(this,g,null);s(this,O,null);s(this,E,[]);s(this,U,e=>{const i=e.currentTarget,n=t(this,E).findIndex(a=>a===i);n>=0&&t(this,g).set(n)});s(this,_,()=>{t(this,E).forEach((e,i)=>{i===t(this,g).counter?e.classList.add("current"):e.classList.remove("current")})})}get buttonElements(){return t(this,E)}connectedCallback(){return z(this,null,function*(){var e;if(yield nt.whenDefined("e-billboard"),l(this,g,Z.findParentElement(this,K)),t(this,g)&&this.isConnected){this.innerHTML="";const i=t(this,g).length;l(this,O,document.createElement("div"));for(let n=0;n<i;n++){const a=document.createElement("button");a.setAttribute("aria-label",`Go to item ${n+1}`),t(this,E).push(a),t(this,O).appendChild(a)}this.appendChild(t(this,O)),t(this,E).forEach(n=>{n.addEventListener("click",t(this,U))}),(e=t(this,g))==null||e.addEventListener("billboardChange",t(this,_)),t(this,_).call(this)}})}disconnectedCallback(){var e;t(this,E).forEach(i=>{i.removeEventListener("click",t(this,U))}),(e=t(this,g))==null||e.removeEventListener("billboardChange",t(this,_)),this.innerHTML="",l(this,E,[])}}g=new WeakMap,O=new WeakMap,E=new WeakMap,U=new WeakMap,_=new WeakMap;$.isBrowser&&!customElements.get("e-billboard-bullets")&&customElements.define("e-billboard-bullets",dt);var H,j;class bt extends HTMLElement{constructor(){super(...arguments);s(this,H,null);s(this,j,()=>{var n;const e=(((n=t(this,H))==null?void 0:n.counter)||0)+1,i=parseInt(this.getAttribute("pad")||"0");this.textContent=e.toString().padStart(i,"0")})}connectedCallback(){return z(this,null,function*(){var e;yield nt.whenDefined("e-billboard"),l(this,H,Z.findParentElement(this,K)),(e=t(this,H))==null||e.addEventListener("billboardChange",t(this,j)),t(this,j).call(this)})}disconnectedCallback(){var e;(e=t(this,H))==null||e.removeEventListener("billboardChange",t(this,j))}}H=new WeakMap,j=new WeakMap;$.isBrowser&&!customElements.get("e-billboard-counter")&&customElements.define("e-billboard-counter",bt);var G,w,v,x;class mt extends HTMLElement{constructor(){super();s(this,G,null);s(this,w,new M.CSSProperty(this,"--index",0));s(this,v,null);s(this,x,()=>{t(this,G).updateClasses(t(this,w).current)});this.addEventListener("click",e=>{t(this,v)&&(!this.handleClick||this.handleClick(e))&&t(this,v).set(t(this,w).current)}),this.addEventListener("keydown",e=>{e.code==="Space"&&!this.hasAttribute("keydown-disabled")&&(e.preventDefault(),this.click())})}connectedCallback(){return z(this,null,function*(){yield nt.whenDefined("e-billboard"),this.hasAttribute("tabindex")||this.setAttribute("tabindex","0"),this.hasAttribute("role")||this.setAttribute("role","button"),l(this,v,Z.findParentElement(this,K)),t(this,v)&&(l(this,G,new at(this,t(this,v))),t(this,v).addEventListener("billboardChange",t(this,x)),t(this,x).call(this),t(this,w).subscribe(t(this,x)),t(this,w).observe())})}disconnectedCallback(){var e;this.removeAttribute("tabindex"),this.removeAttribute("role"),t(this,w).unsubscribe(t(this,x)),t(this,w).unobserve(),(e=t(this,v))==null||e.removeEventListener("billboardChange",t(this,x)),t(this,G).destroy()}}G=new WeakMap,w=new WeakMap,v=new WeakMap,x=new WeakMap;$.isBrowser&&!customElements.get("e-billboard-set-button")&&customElements.define("e-billboard-set-button",mt);var A,b,J;class ft extends HTMLElement{constructor(){super();s(this,A,new M.CSSProperty(this,"--step",1));s(this,b,null);s(this,J,()=>{t(this,b)&&(!t(this,b).loop.current&&(t(this,b).counter===0&&t(this,A).current<=0||t(this,b).counter===t(this,b).length-1&&t(this,A).current>=0)?this.setAttribute("disabled",""):this.removeAttribute("disabled"))});this.addEventListener("click",e=>{t(this,b)&&(!this.handleClick||this.handleClick(e))&&t(this,b).shift(t(this,A).current)}),this.addEventListener("keydown",e=>{e.code==="Space"&&!this.hasAttribute("keydown-disabled")&&(e.preventDefault(),this.click())})}connectedCallback(){return z(this,null,function*(){var e;yield customElements.whenDefined("e-billboard"),this.hasAttribute("tabindex")||this.setAttribute("tabindex","0"),this.hasAttribute("role")||this.setAttribute("role","button"),t(this,A).observe(),this.tabIndex=0,l(this,b,Z.findParentElement(this,K)),(e=t(this,b))==null||e.addEventListener("billboardChange",t(this,J)),setTimeout(()=>{t(this,J).call(this)},0)})}disconnectedCallback(){var e;this.removeAttribute("tabindex"),this.removeAttribute("role"),t(this,A).unobserve(),(e=t(this,b))==null||e.removeEventListener("billboardChange",t(this,J))}}A=new WeakMap,b=new WeakMap,J=new WeakMap;$.isBrowser&&!customElements.get("e-billboard-step-button")&&customElements.define("e-billboard-step-button",ft);exports.BillboardBulletsElement=dt;exports.BillboardCounterElement=bt;exports.BillboardElement=K;exports.BillboardSetButtonElement=mt;exports.BillboardStepButtonElement=ft;
1
+ "use strict";var ht=h=>{throw TypeError(h)};var st=(h,n,e)=>n.has(h)||ht("Cannot "+e);var t=(h,n,e)=>(st(h,n,"read from private field"),e?e.call(h):n.get(h)),s=(h,n,e)=>n.has(h)?ht("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(h):n.set(h,e),l=(h,n,e,i)=>(st(h,n,"write to private field"),i?i.call(h,e):n.set(h,e),e),c=(h,n,e)=>(st(h,n,"access private method"),e);var z=(h,n,e)=>new Promise((i,r)=>{var a=B=>{try{tt(e.next(B))}catch(et){r(et)}},y=B=>{try{tt(e.throw(B))}catch(et){r(et)}},tt=B=>B.done?i(B.value):Promise.resolve(B.value).then(a,y);tt((e=e.apply(h,n)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const $=require("../index-DekP7OZe.cjs"),rt=require("../custom-elements-Dh4TWRDJ.cjs"),Z=require("../dom-JBOkFLTh.cjs");require("construct-style-sheets-polyfill");const M=require("../css-property/index.cjs"),pt=require("../events-KVanG9sR.cjs"),gt=require("../gestures-C7gbKx11.cjs"),vt=require("../math-GDWEqu7y.cjs"),lt=require("../number-ChAm68cm.cjs");var m,I,R,f,ot,ct,ut,it;class at{constructor(n,e){s(this,f);s(this,m);s(this,I,null);s(this,R,!1);this.element=n,l(this,m,e)}destroy(){c(this,f,it).call(this)}updateClasses(n){const e=n===t(this,m).counter;t(this,R)&&!e?this.element.classList.add("was-current"):this.element.classList.remove("was-current");const i=this.element.classList.contains("current-active");c(this,f,ut).call(this),c(this,f,it).call(this),i&&this.element.classList.add("previous-active"),n===t(this,m).counter?c(this,f,ot).call(this):n<t(this,m).counter?this.element.classList.add("previous"):this.element.classList.add("next"),c(this,f,ct).call(this,n)}}m=new WeakMap,I=new WeakMap,R=new WeakMap,f=new WeakSet,ot=function(){l(this,R,!0),this.element.classList.add("current"),l(this,I,requestAnimationFrame(()=>{this.element.classList.add("current-active")}))},ct=function(n){n===lt.loopNumber(t(this,m).counter-1,t(this,m).length)?this.element.classList.add("previous-sibling"):n===(t(this,m).counter+1)%t(this,m).length&&this.element.classList.add("next-sibling")},ut=function(){this.element.classList.remove("current","previous","next","previous-sibling","next-sibling","current-active","previous-active")},it=function(){t(this,I)&&(cancelAnimationFrame(t(this,I)),l(this,I,null))};var F,P,L,C,S,k,T,q,p,o,d,D,u,nt,V,N,W,Q,X,Y;class K extends HTMLElement{constructor(){super(...arguments);s(this,u);s(this,F,new M.CSSProperty(this,"--resize",!0));s(this,P,new M.CSSProperty(this,"--loop",!0));s(this,L,new M.CSSProperty(this,"--autoplay",!1));s(this,C,new M.CSSProperty(this,"--swipe","x"));s(this,S,new M.CSSProperty(this,"--length-offset",0));s(this,k);s(this,T,!1);s(this,q,[]);s(this,p,new Map);s(this,o,-1);s(this,d,0);s(this,D,[]);s(this,N,e=>{l(this,T,e.isIntersecting),t(this,T)?c(this,u,V).call(this):clearInterval(t(this,k))});s(this,W,()=>{clearInterval(t(this,k)),t(this,T)&&l(this,k,setInterval(t(this,X),this.autoplayDuration))});s(this,X,()=>{c(this,u,Q).call(this,t(this,o)+1)});s(this,Y,e=>{if(!t(this,C).current)return;let i=0;gt.setupDrag(r=>{const a=e.x-r.x,y=e.y-r.y;t(this,C).current==="x"?Math.abs(a)>Math.abs(y)&&Math.abs(a)>10&&(i=Math.sign(a)):t(this,C).current==="y"&&Math.abs(y)>Math.abs(a)&&Math.abs(y)>10&&(i=Math.sign(y))},()=>{i&&this.shift(i)})})}get counter(){return t(this,o)}get loop(){return t(this,P)}get autoplay(){return t(this,L)}get autoplayDuration(){return parseFloat(t(this,L).current||"0")*1e3}get swipe(){return t(this,C)}get lengthOffset(){return t(this,S)}get items(){return t(this,q)}get groups(){return t(this,p)}get length(){return t(this,d)}addItem(e){const i=new at(e,this);t(this,q).push(i);const r=e.getAttribute("data-billboard-item-group")||"default";let a=t(this,p).get(r);a||(a=[],t(this,p).set(r,a)),a.push(i),c(this,u,nt).call(this)}set(e){(!this.handleSet||this.handleSet(e))&&(c(this,u,Q).call(this,e),c(this,u,V).call(this))}shift(e){this.set(t(this,o)+e)}connectedCallback(){[...this.querySelectorAll(`[data-billboard-item${this.id?`="${this.id}"`:""}]`)].forEach(i=>{this.addItem(i)}),t(this,p).forEach(i=>{var r;(r=i[0])==null||r.element.classList.add("current")}),t(this,L).subscribe(i=>{i.current?($.intersector.subscribe(this,t(this,N)),c(this,u,V).call(this)):(l(this,T,!0),$.intersector.unsubscribe(t(this,N)),clearInterval(t(this,k)),c(this,u,Q).call(this,0))}),t(this,S).subscribe(()=>{c(this,u,nt).call(this)}),t(this,L).observe(),t(this,C).observe(),t(this,S).observe(),t(this,P).observe(),t(this,F).observe(),c(this,u,Q).call(this,0),this.addEventListener("pointerdown",t(this,Y))}disconnectedCallback(){t(this,L).unobserve(),t(this,C).unobserve(),t(this,S).unobserve(),t(this,P).unobserve(),t(this,F).unobserve(),t(this,q).forEach(e=>e.destroy()),l(this,q,[]),t(this,p).clear(),$.intersector.unsubscribe(t(this,N)),clearInterval(t(this,k)),t(this,D).forEach(e=>{clearTimeout(e)})}}F=new WeakMap,P=new WeakMap,L=new WeakMap,C=new WeakMap,S=new WeakMap,k=new WeakMap,T=new WeakMap,q=new WeakMap,p=new WeakMap,o=new WeakMap,d=new WeakMap,D=new WeakMap,u=new WeakSet,nt=function(){l(this,d,0),t(this,p).forEach(e=>{e.length>t(this,d)&&l(this,d,e.length)}),l(this,d,t(this,d)+t(this,S).current)},V=function(){t(this,L).current!==!1&&t(this,W).call(this)},N=new WeakMap,W=new WeakMap,Q=function(){return z(this,arguments,function*(e=t(this,o)){const i=t(this,o);t(this,P).current?l(this,o,lt.loopNumber(e,t(this,d))):l(this,o,vt.clamp(e,0,t(this,d)-1)),i!==t(this,o)&&(t(this,D).forEach(r=>{clearTimeout(r)}),this.classList.remove("forward","backward","next-round","prev-round"),t(this,o)-i>=0?this.classList.add("forward"):t(this,o)-i<0&&this.classList.add("backward"),t(this,p).forEach(r=>{r.forEach((a,y)=>{a.updateClasses(y)})}),this.classList.toggle("has-length",t(this,d)>1),this.classList.toggle("start",t(this,o)===0),this.classList.toggle("end",t(this,o)===t(this,d)-1),this.style.setProperty("--counter",t(this,o).toString()),this.style.setProperty("--sections",t(this,d).toString()),pt.dispatchEvent(this,"billboardChange",{detail:{counter:t(this,o)}}),t(this,F).current&&t(this,D).push(setTimeout(()=>{window.dispatchEvent(new Event("resize"))},0)),t(this,D).push(setTimeout(()=>{this.classList.remove("next-round","prev-round")},10)))})},X=new WeakMap,Y=new WeakMap;customElements.get("e-billboard")||customElements.define("e-billboard",K);var g,O,v,U,_;class dt extends HTMLElement{constructor(){super(...arguments);s(this,g,null);s(this,O,null);s(this,v,[]);s(this,U,e=>{const i=e.currentTarget,r=t(this,v).findIndex(a=>a===i);r>=0&&t(this,g).set(r)});s(this,_,()=>{t(this,v).forEach((e,i)=>{i===t(this,g).counter?e.classList.add("current"):e.classList.remove("current")})})}get buttonElements(){return t(this,v)}connectedCallback(){return z(this,null,function*(){var e;if(yield rt.whenDefined("e-billboard"),l(this,g,Z.findParentElement(this,K)),t(this,g)&&this.isConnected){this.innerHTML="";const i=t(this,g).length;l(this,O,document.createElement("div"));for(let r=0;r<i;r++){const a=document.createElement("button");a.setAttribute("aria-label",`Go to item ${r+1}`),t(this,v).push(a),t(this,O).appendChild(a)}this.appendChild(t(this,O)),t(this,v).forEach(r=>{r.addEventListener("click",t(this,U))}),(e=t(this,g))==null||e.addEventListener("billboardChange",t(this,_)),t(this,_).call(this)}})}disconnectedCallback(){var e;t(this,v).forEach(i=>{i.removeEventListener("click",t(this,U))}),(e=t(this,g))==null||e.removeEventListener("billboardChange",t(this,_)),this.innerHTML="",l(this,v,[])}}g=new WeakMap,O=new WeakMap,v=new WeakMap,U=new WeakMap,_=new WeakMap;$.isBrowser&&!customElements.get("e-billboard-bullets")&&customElements.define("e-billboard-bullets",dt);var H,j;class bt extends HTMLElement{constructor(){super(...arguments);s(this,H,null);s(this,j,()=>{var r;const e=(((r=t(this,H))==null?void 0:r.counter)||0)+1,i=parseInt(this.getAttribute("pad")||"0");this.textContent=e.toString().padStart(i,"0")})}connectedCallback(){return z(this,null,function*(){var e;yield rt.whenDefined("e-billboard"),l(this,H,Z.findParentElement(this,K)),(e=t(this,H))==null||e.addEventListener("billboardChange",t(this,j)),t(this,j).call(this)})}disconnectedCallback(){var e;(e=t(this,H))==null||e.removeEventListener("billboardChange",t(this,j))}}H=new WeakMap,j=new WeakMap;$.isBrowser&&!customElements.get("e-billboard-counter")&&customElements.define("e-billboard-counter",bt);var G,w,E,x;class mt extends HTMLElement{constructor(){super();s(this,G,null);s(this,w,new M.CSSProperty(this,"--index",0));s(this,E,null);s(this,x,()=>{t(this,G).updateClasses(t(this,w).current)});this.addEventListener("click",e=>{t(this,E)&&(!this.handleClick||this.handleClick(e))&&t(this,E).set(t(this,w).current)}),this.addEventListener("keydown",e=>{e.code==="Space"&&!this.hasAttribute("keydown-disabled")&&(e.preventDefault(),this.click())})}connectedCallback(){return z(this,null,function*(){yield rt.whenDefined("e-billboard"),this.hasAttribute("tabindex")||this.setAttribute("tabindex","0"),this.hasAttribute("role")||this.setAttribute("role","button"),l(this,E,Z.findParentElement(this,K)),t(this,E)&&(l(this,G,new at(this,t(this,E))),t(this,E).addEventListener("billboardChange",t(this,x)),t(this,x).call(this),t(this,w).subscribe(t(this,x)),t(this,w).observe())})}disconnectedCallback(){var e;this.removeAttribute("tabindex"),this.removeAttribute("role"),t(this,w).unsubscribe(t(this,x)),t(this,w).unobserve(),(e=t(this,E))==null||e.removeEventListener("billboardChange",t(this,x)),t(this,G).destroy()}}G=new WeakMap,w=new WeakMap,E=new WeakMap,x=new WeakMap;$.isBrowser&&!customElements.get("e-billboard-set-button")&&customElements.define("e-billboard-set-button",mt);var A,b,J;class ft extends HTMLElement{constructor(){super();s(this,A,new M.CSSProperty(this,"--step",1));s(this,b,null);s(this,J,()=>{t(this,b)&&(!t(this,b).loop.current&&(t(this,b).counter===0&&t(this,A).current<=0||t(this,b).counter===t(this,b).length-1&&t(this,A).current>=0)?this.setAttribute("disabled",""):this.removeAttribute("disabled"))});this.addEventListener("click",e=>{t(this,b)&&(!this.handleClick||this.handleClick(e))&&t(this,b).shift(t(this,A).current)}),this.addEventListener("keydown",e=>{e.code==="Space"&&!this.hasAttribute("keydown-disabled")&&(e.preventDefault(),this.click())})}connectedCallback(){return z(this,null,function*(){var e;yield customElements.whenDefined("e-billboard"),this.hasAttribute("tabindex")||this.setAttribute("tabindex","0"),this.hasAttribute("role")||this.setAttribute("role","button"),t(this,A).observe(),this.tabIndex=0,l(this,b,Z.findParentElement(this,K)),(e=t(this,b))==null||e.addEventListener("billboardChange",t(this,J)),setTimeout(()=>{t(this,J).call(this)},0)})}disconnectedCallback(){var e;this.removeAttribute("tabindex"),this.removeAttribute("role"),t(this,A).unobserve(),(e=t(this,b))==null||e.removeEventListener("billboardChange",t(this,J))}}A=new WeakMap,b=new WeakMap,J=new WeakMap;$.isBrowser&&!customElements.get("e-billboard-step-button")&&customElements.define("e-billboard-step-button",ft);exports.BillboardBulletsElement=dt;exports.BillboardCounterElement=bt;exports.BillboardElement=K;exports.BillboardSetButtonElement=mt;exports.BillboardStepButtonElement=ft;
@@ -28,7 +28,7 @@ import { d as bt } from "../events-CsVF98U6.js";
28
28
  import { s as mt } from "../gestures-CcXV6fCp.js";
29
29
  import { c as ft } from "../math-BOBiC4TN.js";
30
30
  import { l as at } from "../number-CumqY64S.js";
31
- var m, T, Q, f, ct, dt, ut, nt;
31
+ var m, T, Q, f, ct, ut, dt, nt;
32
32
  class ot {
33
33
  constructor(n, e) {
34
34
  s(this, f);
@@ -42,32 +42,35 @@ class ot {
42
42
  }
43
43
  updateClasses(n) {
44
44
  const e = n === t(this, m).counter;
45
- t(this, Q) && !e ? this.element.classList.add("was-current") : this.element.classList.remove("was-current"), c(this, f, ut).call(this), c(this, f, nt).call(this), n === t(this, m).counter ? c(this, f, ct).call(this) : n < t(this, m).counter ? this.element.classList.add("previous") : this.element.classList.add("next"), c(this, f, dt).call(this, n);
45
+ t(this, Q) && !e ? this.element.classList.add("was-current") : this.element.classList.remove("was-current");
46
+ const i = this.element.classList.contains("current-active");
47
+ c(this, f, dt).call(this), c(this, f, nt).call(this), i && this.element.classList.add("previous-active"), n === t(this, m).counter ? c(this, f, ct).call(this) : n < t(this, m).counter ? this.element.classList.add("previous") : this.element.classList.add("next"), c(this, f, ut).call(this, n);
46
48
  }
47
49
  }
48
50
  m = new WeakMap(), T = new WeakMap(), Q = new WeakMap(), f = new WeakSet(), ct = function() {
49
51
  l(this, Q, !0), this.element.classList.add("current"), l(this, T, requestAnimationFrame(() => {
50
52
  this.element.classList.add("current-active");
51
53
  }));
52
- }, dt = function(n) {
54
+ }, ut = function(n) {
53
55
  n === at(t(this, m).counter - 1, t(this, m).length) ? this.element.classList.add("previous-sibling") : n === (t(this, m).counter + 1) % t(this, m).length && this.element.classList.add("next-sibling");
54
- }, ut = function() {
56
+ }, dt = function() {
55
57
  this.element.classList.remove(
56
58
  "current",
57
59
  "previous",
58
60
  "next",
59
61
  "previous-sibling",
60
62
  "next-sibling",
61
- "current-active"
63
+ "current-active",
64
+ "previous-active"
62
65
  );
63
66
  }, nt = function() {
64
67
  t(this, T) && (cancelAnimationFrame(t(this, T)), l(this, T, null));
65
68
  };
66
- var $, B, L, C, k, x, D, H, p, o, u, P, d, rt, V, q, W, K, X, Y;
69
+ var $, B, L, C, k, x, D, H, p, o, d, P, u, rt, V, q, W, K, X, Y;
67
70
  class U extends HTMLElement {
68
71
  constructor() {
69
72
  super(...arguments);
70
- s(this, d);
73
+ s(this, u);
71
74
  s(this, $, new S(this, "--resize", !0));
72
75
  s(this, B, new S(this, "--loop", !0));
73
76
  s(this, L, new S(this, "--autoplay", !1));
@@ -78,16 +81,16 @@ class U extends HTMLElement {
78
81
  s(this, H, []);
79
82
  s(this, p, /* @__PURE__ */ new Map());
80
83
  s(this, o, -1);
81
- s(this, u, 0);
84
+ s(this, d, 0);
82
85
  s(this, P, []);
83
86
  s(this, q, (e) => {
84
- l(this, D, e.isIntersecting), t(this, D) ? c(this, d, V).call(this) : clearInterval(t(this, x));
87
+ l(this, D, e.isIntersecting), t(this, D) ? c(this, u, V).call(this) : clearInterval(t(this, x));
85
88
  });
86
89
  s(this, W, () => {
87
90
  clearInterval(t(this, x)), t(this, D) && l(this, x, setInterval(t(this, X), this.autoplayDuration));
88
91
  });
89
92
  s(this, X, () => {
90
- c(this, d, K).call(this, t(this, o) + 1);
93
+ c(this, u, K).call(this, t(this, o) + 1);
91
94
  });
92
95
  s(this, Y, (e) => {
93
96
  if (!t(this, C).current)
@@ -129,17 +132,17 @@ class U extends HTMLElement {
129
132
  return t(this, p);
130
133
  }
131
134
  get length() {
132
- return t(this, u);
135
+ return t(this, d);
133
136
  }
134
137
  addItem(e) {
135
138
  const i = new ot(e, this);
136
139
  t(this, H).push(i);
137
140
  const r = e.getAttribute("data-billboard-item-group") || "default";
138
141
  let a = t(this, p).get(r);
139
- a || (a = [], t(this, p).set(r, a)), a.push(i), c(this, d, rt).call(this);
142
+ a || (a = [], t(this, p).set(r, a)), a.push(i), c(this, u, rt).call(this);
140
143
  }
141
144
  set(e) {
142
- (!this.handleSet || this.handleSet(e)) && (c(this, d, K).call(this, e), c(this, d, V).call(this));
145
+ (!this.handleSet || this.handleSet(e)) && (c(this, u, K).call(this, e), c(this, u, V).call(this));
143
146
  }
144
147
  shift(e) {
145
148
  this.set(t(this, o) + e);
@@ -155,10 +158,10 @@ class U extends HTMLElement {
155
158
  var r;
156
159
  (r = i[0]) == null || r.element.classList.add("current");
157
160
  }), t(this, L).subscribe((i) => {
158
- i.current ? (it.subscribe(this, t(this, q)), c(this, d, V).call(this)) : (l(this, D, !0), it.unsubscribe(t(this, q)), clearInterval(t(this, x)), c(this, d, K).call(this, 0));
161
+ i.current ? (it.subscribe(this, t(this, q)), c(this, u, V).call(this)) : (l(this, D, !0), it.unsubscribe(t(this, q)), clearInterval(t(this, x)), c(this, u, K).call(this, 0));
159
162
  }), t(this, k).subscribe(() => {
160
- c(this, d, rt).call(this);
161
- }), t(this, L).observe(), t(this, C).observe(), t(this, k).observe(), t(this, B).observe(), t(this, $).observe(), c(this, d, K).call(this, 0), this.addEventListener("pointerdown", t(this, Y));
163
+ c(this, u, rt).call(this);
164
+ }), t(this, L).observe(), t(this, C).observe(), t(this, k).observe(), t(this, B).observe(), t(this, $).observe(), c(this, u, K).call(this, 0), this.addEventListener("pointerdown", t(this, Y));
162
165
  }
163
166
  disconnectedCallback() {
164
167
  t(this, L).unobserve(), t(this, C).unobserve(), t(this, k).unobserve(), t(this, B).unobserve(), t(this, $).unobserve(), t(this, H).forEach((e) => e.destroy()), l(this, H, []), t(this, p).clear(), it.unsubscribe(t(this, q)), clearInterval(t(this, x)), t(this, P).forEach((e) => {
@@ -166,22 +169,22 @@ class U extends HTMLElement {
166
169
  });
167
170
  }
168
171
  }
169
- $ = new WeakMap(), B = new WeakMap(), L = new WeakMap(), C = new WeakMap(), k = new WeakMap(), x = new WeakMap(), D = new WeakMap(), H = new WeakMap(), p = new WeakMap(), o = new WeakMap(), u = new WeakMap(), P = new WeakMap(), d = new WeakSet(), rt = function() {
170
- l(this, u, 0), t(this, p).forEach((e) => {
171
- e.length > t(this, u) && l(this, u, e.length);
172
- }), l(this, u, t(this, u) + t(this, k).current);
172
+ $ = new WeakMap(), B = new WeakMap(), L = new WeakMap(), C = new WeakMap(), k = new WeakMap(), x = new WeakMap(), D = new WeakMap(), H = new WeakMap(), p = new WeakMap(), o = new WeakMap(), d = new WeakMap(), P = new WeakMap(), u = new WeakSet(), rt = function() {
173
+ l(this, d, 0), t(this, p).forEach((e) => {
174
+ e.length > t(this, d) && l(this, d, e.length);
175
+ }), l(this, d, t(this, d) + t(this, k).current);
173
176
  }, V = function() {
174
177
  t(this, L).current !== !1 && t(this, W).call(this);
175
178
  }, q = new WeakMap(), W = new WeakMap(), K = function() {
176
179
  return F(this, arguments, function* (e = t(this, o)) {
177
180
  const i = t(this, o);
178
- t(this, B).current ? l(this, o, at(e, t(this, u))) : l(this, o, ft(e, 0, t(this, u) - 1)), i !== t(this, o) && (t(this, P).forEach((r) => {
181
+ t(this, B).current ? l(this, o, at(e, t(this, d))) : l(this, o, ft(e, 0, t(this, d) - 1)), i !== t(this, o) && (t(this, P).forEach((r) => {
179
182
  clearTimeout(r);
180
183
  }), this.classList.remove("forward", "backward", "next-round", "prev-round"), t(this, o) - i >= 0 ? this.classList.add("forward") : t(this, o) - i < 0 && this.classList.add("backward"), t(this, p).forEach((r) => {
181
184
  r.forEach((a, y) => {
182
185
  a.updateClasses(y);
183
186
  });
184
- }), this.classList.toggle("has-length", t(this, u) > 1), this.classList.toggle("start", t(this, o) === 0), this.classList.toggle("end", t(this, o) === t(this, u) - 1), this.style.setProperty("--counter", t(this, o).toString()), this.style.setProperty("--sections", t(this, u).toString()), bt(this, "billboardChange", {
187
+ }), this.classList.toggle("has-length", t(this, d) > 1), this.classList.toggle("start", t(this, o) === 0), this.classList.toggle("end", t(this, o) === t(this, d) - 1), this.style.setProperty("--counter", t(this, o).toString()), this.style.setProperty("--sections", t(this, d).toString()), bt(this, "billboardChange", {
185
188
  detail: {
186
189
  counter: t(this, o)
187
190
  }
@@ -1 +1 @@
1
- "use strict";var Yt=Object.defineProperty,Xt=Object.defineProperties;var jt=Object.getOwnPropertyDescriptors;var xt=Object.getOwnPropertySymbols;var Ut=Object.prototype.hasOwnProperty,Kt=Object.prototype.propertyIsEnumerable;var Ht=(r,t)=>(t=Symbol[r])?t:Symbol.for("Symbol."+r),qt=r=>{throw TypeError(r)};var Nt=(r,t,s)=>t in r?Yt(r,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):r[t]=s,pt=(r,t)=>{for(var s in t||(t={}))Ut.call(t,s)&&Nt(r,s,t[s]);if(xt)for(var s of xt(t))Kt.call(t,s)&&Nt(r,s,t[s]);return r},Et=(r,t)=>Xt(r,jt(t));var gt=(r,t,s)=>t.has(r)||qt("Cannot "+s);var e=(r,t,s)=>(gt(r,t,"read from private field"),s?s.call(r):t.get(r)),a=(r,t,s)=>t.has(r)?qt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(r):t.set(r,s),n=(r,t,s,i)=>(gt(r,t,"write to private field"),i?i.call(r,s):t.set(r,s),s),p=(r,t,s)=>(gt(r,t,"access private method"),s);var Y=(r,t,s)=>new Promise((i,u)=>{var w=g=>{try{v(s.next(g))}catch(F){u(F)}},H=g=>{try{v(s.throw(g))}catch(F){u(F)}},v=g=>g.done?i(g.value):Promise.resolve(g.value).then(w,H);v((s=s.apply(r,t)).next())});var Dt=(r,t,s)=>(t=r[Ht("asyncIterator")])?t.call(r):(r=r[Ht("iterator")](),t={},s=(i,u)=>(u=r[i])&&(t[i]=w=>new Promise((H,v,g)=>(w=u.call(r,w),g=w.done,Promise.resolve(w.value).then(F=>H({value:F,done:g}),v)))),s("next"),s("return"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Vt=require("../index-DekP7OZe.cjs"),X=require("../events-KVanG9sR.cjs"),$t=require("../polyfills-Df4r-ETT.cjs"),It=require("../scroll-CIdNtj3G.cjs");require("construct-style-sheets-polyfill");const ct=require("../url-BT4fssbO.cjs"),Gt=require("../css-value-parser/index.cjs");class zt extends HTMLElement{connectedCallback(){const t={"aria-live":"assertive","aria-atomic":"true",style:"position: absolute; left: 0; top: 0; clip: rect(0 0 0 0); clip-path: inset(50%); overflow: hidden; white-space: nowrap; width: 1px; height: 1px"};for(const[s,i]of Object.entries(t))this.setAttribute(s,i)}}Vt.isBrowser&&!customElements.get("morph-announcer")&&customElements.define("morph-announcer",zt);var C,l,D,st,$;class St{constructor(t,s){a(this,C);a(this,l);a(this,D);a(this,st,t=>{var i;if(t.preventDefault(),e(this,l).hasAttribute("data-back")&&e(this,C).previousPathname)history.back();else{n(this,D,e(this,l).getAttribute("href")||"/");const u=e(this,l).getAttribute("data-history-action")||"push",w=e(this,l).hasAttribute("data-center-scroll"),H=getComputedStyle(e(this,l)).getPropertyValue("--offset-scroll").trim(),v=H?Gt.cssValueParser.parse(H):void 0,g=e(this,l).hasAttribute("data-revalidate"),F=e(this,l).hasAttribute("data-keep-search-parameters"),d=(i=e(this,l).getAttribute("data-submorph"))==null?void 0:i.split(",").map(N=>N.trim()),ot=e(this,l).hasAttribute("data-clear-state");e(this,C).navigate(e(this,D),{historyAction:u,centerScroll:w,offsetScroll:v,revalidate:g,keepSearchParameters:F,submorph:d,clearState:ot})}});a(this,$,()=>{const t=e(this,l).hasAttribute("data-revalidate");e(this,C).prefetch(e(this,D),t),e(this,l).removeEventListener("pointerenter",e(this,$))});n(this,C,s),n(this,l,t),n(this,D,e(this,l).getAttribute("href")||"/"),e(this,l).addEventListener("click",e(this,st)),this.checkCurrent(location.pathname),e(this,l).hasAttribute("data-prefetch")&&e(this,l).addEventListener("pointerenter",e(this,$))}get element(){return e(this,l)}checkCurrent(t){const s=e(this,C).normalizePath(t),i=e(this,C).normalizePath(e(this,D));e(this,l).hasAttribute("data-include")&&s.pathname.includes(i.pathname)?e(this,l).classList.add("current"):i.pathname===s.pathname?e(this,l).classList.add("current"):e(this,l).classList.remove("current")}destroy(){e(this,l).removeEventListener("click",e(this,st)),e(this,l).removeEventListener("pointerenter",e(this,$)),e(this,l).classList.remove("current")}}C=new WeakMap,l=new WeakMap,D=new WeakMap,st=new WeakMap,$=new WeakMap;const Jt=new DOMParser;var T,I,b,P,j,R,G,U,V;class Rt{constructor(t,s){a(this,T);a(this,I);a(this,b,{x:0,y:0});a(this,P,null);a(this,j,null);a(this,R,null);a(this,G,null);a(this,U,null);a(this,V,null);n(this,T,t),n(this,I,s)}get path(){return e(this,I)}get scrollState(){return e(this,b)}get document(){return e(this,R)}setInitialDocument(t){n(this,P,t.cloneNode(!0))}abort(){var t;return(t=e(this,U))==null?void 0:t.abort(`[${e(this,I)}] page loading cancelled`)}fetch(t){return Y(this,null,function*(){return e(this,V)||e(this,P)&&e(this,P).documentElement.hasAttribute("data-cache")&&!t||e(this,P)&&e(this,T).isPopstateNavigation?e(this,V):(n(this,V,new Promise(s=>Y(this,null,function*(){try{n(this,U,new AbortController);const u=yield(yield fetch(e(this,I),{signal:e(this,U).signal})).text(),w=Jt.parseFromString(u,"text/html");this.setInitialDocument(w)}catch(i){console.warn(i)}finally{n(this,U,null),n(this,V,null),s()}}))),e(this,V))})}cloneDocument(){n(this,R,(e(this,j)||e(this,P)).cloneNode(!0))}get title(){let t="";if(e(this,R).title)t=e(this,R).title;else{const s=e(this,R).querySelector("h1");t=(s==null?void 0:s.innerText)||(s==null?void 0:s.textContent)||e(this,I)}return t}clearScrollState(){e(this,b).x=0,e(this,b).y=0}clearDocumentState(){n(this,j,null)}saveScrollState(){e(this,P).documentElement.hasAttribute("data-no-scroll-restoration")?(e(this,b).x=0,e(this,b).y=0):(e(this,b).x=e(this,T).scrollValue.left,e(this,b).y=e(this,T).scrollValue.top)}restoreScrollPosition(){e(this,T).scrollElement.scroll({top:e(this,b).y,left:e(this,b).x,behavior:"instant"})}saveDocumentState(){e(this,P).documentElement.hasAttribute("data-no-page-restoration")?n(this,j,null):n(this,j,document.cloneNode(!0))}renewScrollPosition(){e(this,T).scrollElement.scroll({top:0,left:0,behavior:"instant"})}saveState(t){n(this,G,t)}clearState(){const t=e(this,G);return n(this,G,null),t}}T=new WeakMap,I=new WeakMap,b=new WeakMap,P=new WeakMap,j=new WeakMap,R=new WeakMap,G=new WeakMap,U=new WeakMap,V=new WeakMap;var A,J,E,z,f,it,B,M,L,rt,x,K,Q,Z,nt,c,ht,wt,Bt,yt,bt,Lt,Pt,ut,_;const et=class et{constructor(t){a(this,c);a(this,A,null);a(this,J,null);a(this,E,[]);a(this,z);a(this,f,null);a(this,it);a(this,B,[]);a(this,M,!1);a(this,L,null);a(this,rt,!1);a(this,x,new Map);a(this,K,null);a(this,Q,0);a(this,Z,0);a(this,nt,t=>{var s;return((s=t.getAttribute("href"))==null?void 0:s.startsWith("/"))&&!t.hasAttribute("download")&&!t.hasAttribute("data-morph-skip")&&!t.closest("[data-morph-skip]")&&t.getAttribute("target")!=="_blank"});a(this,ut,t=>Y(this,null,function*(){var s;(s=t.state)!=null&&s.path&&(t.preventDefault(),n(this,M,!0),yield this.navigate(t.state.path,{historyAction:"none"}),n(this,M,!1))}));a(this,_,()=>{const{left:t,top:s}=this.scrollValue,i=s-e(this,Z),u=t-e(this,Q);n(this,Z,s),n(this,Q,t),document.documentElement.classList.toggle("scroll-y",s>0),document.documentElement.classList.toggle("scroll-x",t>0),document.documentElement.classList.toggle("scroll-y-forward",i>0),document.documentElement.classList.toggle("scroll-y-backward",i<0),document.documentElement.classList.toggle("scroll-x-forward",u>0),document.documentElement.classList.toggle("scroll-x-backward",u<0),X.dispatchEvent(document,"morphScroll",{detail:{left:t,top:s}})});if(Vt.isBrowser&&!et.instance){et.instance=this,n(this,A,{base:ct.normalizeBase(t==null?void 0:t.base),waitForHeadToLoad:(t==null?void 0:t.waitForHeadToLoad)!==!1,trailingSlash:(t==null?void 0:t.trailingSlash)||!1,scrollSelector:t==null?void 0:t.scrollSelector,morphInsideScrollContainer:(t==null?void 0:t.morphInsideScrollContainer)||!1}),n(this,J,p(this,c,wt).call(this,document.body));const s=this.normalizePath(location.pathname+location.hash+location.search);n(this,f,s.path);const i=new Rt(this,e(this,f));i.setInitialDocument(document),e(this,x).set(e(this,f),i),document.documentElement.setAttribute("data-current-pathname",e(this,f)),document.documentElement.setAttribute("data-current-leaf",s.leaf),this.findLinks(),history.scrollRestoration="manual",addEventListener("popstate",e(this,ut)),ct.changeHistory({action:"replace",pathname:s.pathname,searchParameters:s.parameters,hash:s.hash}),n(this,K,new zt),p(this,c,Lt).call(this,document)}}get currentPath(){return e(this,f)}get previousPathname(){return e(this,it)}get links(){return e(this,E)}get scrollElement(){return e(this,L)}get isPopstateNavigation(){return e(this,M)}get scrollValue(){let t=0,s=0;return e(this,rt)?(t=window.scrollY,s=window.scrollX):(t=e(this,L).scrollTop,s=e(this,L).scrollLeft),{top:t,left:s}}saveState(t){const s=e(this,x).get(e(this,f));s&&s.saveState(t)}getState(){const t=e(this,x).get(e(this,f));return t==null?void 0:t.clearState()}normalizePath(t){return ct.splitPath(t,{base:e(this,A).base,trailingSlash:e(this,A).trailingSlash})}prefetch(t,s){return Y(this,null,function*(){if(e(this,B).length)return;const i=p(this,c,ht).call(this,t);i==null||i.fetch(s)})}navigate(F){return Y(this,arguments,function*(t,{historyAction:s="push",centerScroll:i,offsetScroll:u,revalidate:w,keepSearchParameters:H,submorph:v,clearState:g}={}){var ot;if(e(this,B).length)return;const d=this.normalizePath(((ot=this.pathnameModifier)==null?void 0:ot.call(this,t))||t);if(e(this,z)===d.path||e(this,f)===d.path){e(this,M)||p(this,c,Pt).call(this,d.hash||0,{centerScroll:i,offsetScroll:u,behavior:"smooth"});return}n(this,z,d.path),e(this,E).forEach(N=>{N.checkCurrent(d.path)});try{let N=!0;if(this.preprocessor)try{yield new Promise((o,k)=>{var y;(y=this.preprocessor)==null||y.call(this,{path:t,resolve:o,reject:k,submorph:v})})}catch(o){o?console.error(o):console.log("Route change canceled"),N=!1}if(!N||e(this,z)!==d.path){e(this,E).forEach(o=>{o.checkCurrent(e(this,f))});return}const At={path:d.path,submorph:v};X.dispatchEvent(document,"morphNavigation",{detail:At});const dt=p(this,c,ht).call(this,e(this,f)),m=p(this,c,ht).call(this,t);if(e(this,x).forEach(o=>{o.path!==d.path&&o.abort()}),yield m==null?void 0:m.fetch(w),e(this,z)!==d.path){e(this,E).forEach(o=>{o.checkCurrent(e(this,f))});return}dt.clearState(),dt.saveScrollState(),dt.saveDocumentState(),e(this,M)||(m.clearScrollState(),m.clearDocumentState()),g&&m.clearState(),m.cloneDocument(),e(this,K).textContent=m.title,document.body.appendChild(e(this,K));const mt=Et(pt({},At),{document:m.document});X.dispatchEvent(document,"morphStart",{detail:mt});const kt=Array.from(document.head.children),Ct=Array.from(m.document.head.children),Tt=p(this,c,Bt).call(this,kt,Ct),Ft=p(this,c,yt).call(this,kt,Tt),at=p(this,c,yt).call(this,Ct,Tt);at.forEach((o,k)=>{if(o.tagName==="SCRIPT"&&o.getAttribute("src")){const y=document.createElement("script");y.type="module",y.src=o.getAttribute("src"),at[k]=y}}),at.forEach(o=>{document.head.appendChild(o)});const ft=at.filter(o=>{if(o.hasAttribute("data-no-waiting"))return!1;if(p(this,c,bt).call(this,o))return!0});e(this,A).waitForHeadToLoad&&ft.length&&(yield new Promise(o=>Y(this,null,function*(){let k=0;try{for(var y=Dt(ft),tt,O,W;tt=!(O=yield y.next()).done;tt=!1){const lt=O.value;lt.onload=()=>{k++,k===ft.length&&o()}}}catch(O){W=[O]}finally{try{tt&&(O=y.return)&&(yield O.call(y))}finally{if(W)throw W[0]}}}))),yield It.wait(10);const Mt=[];Ft.forEach(o=>{o.hasAttribute("data-permanent")||(p(this,c,bt).call(this,o)?Mt.push(o):o.remove())});const Ot=p(this,c,wt).call(this,m.document.body);e(this,A).morphInsideScrollContainer||p(this,c,Lt).call(this,m.document),document.documentElement.setAttribute("data-current-pathname",d.pathname),document.documentElement.setAttribute("data-current-leaf",d.leaf),ct.changeHistory({action:s,pathname:d.pathname,searchParameters:d.parameters||(H?location.search:""),hash:d.hash}),e(this,K).remove(),n(this,it,e(this,f)),n(this,f,d.path),e(this,J).forEach((o,k)=>{const y=Ot[k],tt=getComputedStyle(o).getPropertyValue("--morph-duration");let O=[],W=[];v?v.forEach(h=>{const S=o.querySelector(h),q=y.querySelector(h);S&&q&&(W.push(S),O.push(q))}):(O.push(...y.childNodes),W.push(...o.childNodes)),W.forEach(h=>{h instanceof HTMLElement&&(this.destroyOldLinks(h),h.classList.add("old"))}),O.forEach(h=>{h instanceof HTMLElement&&(this.findNewLinks(h),h.classList.add("new"))}),v?O.forEach((h,S)=>{var q;(q=W[S].parentElement)==null||q.insertBefore(h,W[S])}):o.prepend(...O),$t.requestIdleCallback(()=>{W.forEach(h=>{h instanceof HTMLElement&&h.classList.add("old-idle")}),O.forEach(h=>{var S;h instanceof HTMLElement&&((S=h.parentElement)==null||S.style.setProperty("--new-content-height",h.offsetHeight+"px"),h.classList.add("new-idle"))})});const lt=Et(pt({},mt),{morphElement:o});X.dispatchEvent(document,"morphNewChildrenAdded",{detail:lt});const Wt=new Promise(h=>{setTimeout(()=>{W.forEach(S=>S.remove()),O.forEach(S=>{var q;S instanceof HTMLElement&&((q=S.parentElement)==null||q.style.removeProperty("--new-content-height"),S.classList.remove("new-idle","new"))}),X.dispatchEvent(document,"morphOldChildrenRemoved",{detail:lt}),h()},(parseFloat(tt)||0)*1e3+10)});e(this,B).push(Wt)}),this.isPopstateNavigation?document.documentElement.style.setProperty("--new-document-scroll-position",(this.scrollValue.top-m.scrollState.y)*1+"px"):document.documentElement.style.setProperty("--new-document-scroll-position",this.scrollValue.top+"px"),X.dispatchEvent(document,"morphBeforeNavigationScroll",{detail:m.scrollState}),d.hash?(m.clearScrollState(),p(this,c,Pt).call(this,d.hash,{centerScroll:i,offsetScroll:u})):e(this,M)?m.restoreScrollPosition():m.renewScrollPosition(),yield Promise.all(e(this,B)),Mt.forEach(o=>o.remove()),n(this,B,[]),e(this,J).forEach(o=>{o.querySelectorAll("script").forEach(y=>{const tt=document.createElement("script");tt.type="module",tt.src=y.getAttribute("src"),y.replaceWith(tt)})}),X.dispatchEvent(document,"morphComplete",{detail:mt}),document.documentElement.style.removeProperty("--new-document-scroll-position"),window.dispatchEvent(new Event("resize"))}catch(N){console.error(N)}n(this,z,void 0)})}addLink(t){e(this,E).push(new St(t,this))}addLinks(t){t.forEach(s=>{this.addLink(s)})}removeLink(t){n(this,E,e(this,E).filter(s=>s.element===t?(s.destroy(),!1):!0))}destroyOldLinks(t){n(this,E,e(this,E).filter(s=>t.contains(s.element)?(s.destroy(),!1):!0))}findNewLinks(t){const s=[...t.querySelectorAll("a")].filter(e(this,nt));e(this,E).push(...s.map(i=>new St(i,this)))}findLinks(){const t=[...document.documentElement.querySelectorAll("a")].filter(e(this,nt));e(this,E).forEach(s=>s.destroy()),n(this,E,t.map(s=>new St(s,this)))}};A=new WeakMap,J=new WeakMap,E=new WeakMap,z=new WeakMap,f=new WeakMap,it=new WeakMap,B=new WeakMap,M=new WeakMap,L=new WeakMap,rt=new WeakMap,x=new WeakMap,K=new WeakMap,Q=new WeakMap,Z=new WeakMap,nt=new WeakMap,c=new WeakSet,ht=function(t){let s=t.split("#")[0],i=e(this,x).get(s);return i||(i=new Rt(this,s),e(this,x).set(s,i)),i},wt=function(t){const s=[...t.querySelectorAll("[data-morph]")];return s.length?s:[t]},Bt=function(t,s){return t.filter(i=>s.find(u=>u.outerHTML===i.outerHTML))},yt=function(t,s){return t.filter(i=>!s.find(u=>u.outerHTML===i.outerHTML))},bt=function(t){return t.tagName==="SCRIPT"||t.tagName==="STYLE"||t.tagName==="LINK"&&t.getAttribute("rel")==="stylesheet"},Lt=function(t){var s,i;(s=e(this,L))==null||s.removeEventListener("scroll",e(this,_)),n(this,Z,0),n(this,Q,0),n(this,L,e(this,A).scrollSelector&&t.querySelector(e(this,A).scrollSelector)||window),n(this,rt,e(this,L)===window),(i=e(this,L))==null||i.addEventListener("scroll",e(this,_)),e(this,_).call(this)},Pt=function(t,s){const i=typeof t=="string"?document.getElementById(t):t;(typeof i=="number"||i)&&It.scrollToElement(i,{scrollElement:e(this,L),behavior:(s==null?void 0:s.behavior)||"instant",center:s==null?void 0:s.centerScroll,offset:s==null?void 0:s.offsetScroll})},ut=new WeakMap,_=new WeakMap,et.instance=null;let vt=et;exports.Morph=vt;
1
+ "use strict";var Yt=Object.defineProperty,Xt=Object.defineProperties;var jt=Object.getOwnPropertyDescriptors;var xt=Object.getOwnPropertySymbols;var Ut=Object.prototype.hasOwnProperty,Kt=Object.prototype.propertyIsEnumerable;var Ht=(r,t)=>(t=Symbol[r])?t:Symbol.for("Symbol."+r),qt=r=>{throw TypeError(r)};var Nt=(r,t,s)=>t in r?Yt(r,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):r[t]=s,pt=(r,t)=>{for(var s in t||(t={}))Ut.call(t,s)&&Nt(r,s,t[s]);if(xt)for(var s of xt(t))Kt.call(t,s)&&Nt(r,s,t[s]);return r},Et=(r,t)=>Xt(r,jt(t));var gt=(r,t,s)=>t.has(r)||qt("Cannot "+s);var e=(r,t,s)=>(gt(r,t,"read from private field"),s?s.call(r):t.get(r)),a=(r,t,s)=>t.has(r)?qt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(r):t.set(r,s),n=(r,t,s,i)=>(gt(r,t,"write to private field"),i?i.call(r,s):t.set(r,s),s),p=(r,t,s)=>(gt(r,t,"access private method"),s);var X=(r,t,s)=>new Promise((i,u)=>{var w=g=>{try{v(s.next(g))}catch(O){u(O)}},H=g=>{try{v(s.throw(g))}catch(O){u(O)}},v=g=>g.done?i(g.value):Promise.resolve(g.value).then(w,H);v((s=s.apply(r,t)).next())});var Dt=(r,t,s)=>(t=r[Ht("asyncIterator")])?t.call(r):(r=r[Ht("iterator")](),t={},s=(i,u)=>(u=r[i])&&(t[i]=w=>new Promise((H,v,g)=>(w=u.call(r,w),g=w.done,Promise.resolve(w.value).then(O=>H({value:O,done:g}),v)))),s("next"),s("return"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Vt=require("../index-DekP7OZe.cjs"),j=require("../events-KVanG9sR.cjs"),$t=require("../polyfills-Df4r-ETT.cjs"),It=require("../scroll-CIdNtj3G.cjs");require("construct-style-sheets-polyfill");const ct=require("../url-BT4fssbO.cjs"),Gt=require("../css-value-parser/index.cjs");class zt extends HTMLElement{connectedCallback(){const t={"aria-live":"assertive","aria-atomic":"true",style:"position: absolute; left: 0; top: 0; clip: rect(0 0 0 0); clip-path: inset(50%); overflow: hidden; white-space: nowrap; width: 1px; height: 1px"};for(const[s,i]of Object.entries(t))this.setAttribute(s,i)}}Vt.isBrowser&&!customElements.get("morph-announcer")&&customElements.define("morph-announcer",zt);var C,l,I,st,G;class St{constructor(t,s){a(this,C);a(this,l);a(this,I);a(this,st,t=>{var i;if(t.preventDefault(),e(this,l).hasAttribute("data-back")&&e(this,C).previousPathname)history.back();else{n(this,I,e(this,l).getAttribute("href")||"/");const u=e(this,l).getAttribute("data-history-action")||"push",w=e(this,l).hasAttribute("data-center-scroll"),H=getComputedStyle(e(this,l)).getPropertyValue("--offset-scroll").trim(),v=H?Gt.cssValueParser.parse(H):void 0,g=e(this,l).hasAttribute("data-revalidate"),O=e(this,l).hasAttribute("data-keep-search-parameters"),d=(i=e(this,l).getAttribute("data-submorph"))==null?void 0:i.split(",").map(N=>N.trim()),ot=e(this,l).hasAttribute("data-clear-state");e(this,C).navigate(e(this,I),{historyAction:u,centerScroll:w,offsetScroll:v,revalidate:g,keepSearchParameters:O,submorph:d,clearState:ot})}});a(this,G,()=>{const t=e(this,l).hasAttribute("data-revalidate");e(this,C).prefetch(e(this,I),t),e(this,l).removeEventListener("pointerenter",e(this,G))});n(this,C,s),n(this,l,t),n(this,I,e(this,l).getAttribute("href")||"/"),e(this,l).addEventListener("click",e(this,st)),this.checkCurrent(location.pathname),e(this,l).hasAttribute("data-prefetch")&&e(this,l).addEventListener("pointerenter",e(this,G))}get element(){return e(this,l)}checkCurrent(t){const s=e(this,C).normalizePath(t),i=e(this,C).normalizePath(e(this,I));e(this,l).hasAttribute("data-include")&&s.pathname.includes(i.pathname)?e(this,l).classList.add("current"):i.pathname===s.pathname?e(this,l).classList.add("current"):e(this,l).classList.remove("current")}destroy(){e(this,l).removeEventListener("click",e(this,st)),e(this,l).removeEventListener("pointerenter",e(this,G)),e(this,l).classList.remove("current")}}C=new WeakMap,l=new WeakMap,I=new WeakMap,st=new WeakMap,G=new WeakMap;const Jt=new DOMParser;var T,R,b,P,U,V,J,K,z;class Rt{constructor(t,s){a(this,T);a(this,R);a(this,b,{x:0,y:0});a(this,P,null);a(this,U,null);a(this,V,null);a(this,J,null);a(this,K,null);a(this,z,null);n(this,T,t),n(this,R,s)}get path(){return e(this,R)}get scrollState(){return e(this,b)}get document(){return e(this,V)}setInitialDocument(t){n(this,P,t.cloneNode(!0))}abort(){var t;return(t=e(this,K))==null?void 0:t.abort(`[${e(this,R)}] page loading cancelled`)}fetch(t){return X(this,null,function*(){return e(this,z)||e(this,P)&&e(this,P).documentElement.hasAttribute("data-cache")&&!t||e(this,P)&&e(this,T).isPopstateNavigation?e(this,z):(n(this,z,new Promise(s=>X(this,null,function*(){try{n(this,K,new AbortController);const u=yield(yield fetch(e(this,R),{signal:e(this,K).signal})).text(),w=Jt.parseFromString(u,"text/html");this.setInitialDocument(w)}catch(i){console.warn(i)}finally{n(this,K,null),n(this,z,null),s()}}))),e(this,z))})}cloneDocument(){n(this,V,(e(this,U)||e(this,P)).cloneNode(!0))}get title(){let t="";if(e(this,V).title)t=e(this,V).title;else{const s=e(this,V).querySelector("h1");t=(s==null?void 0:s.innerText)||(s==null?void 0:s.textContent)||e(this,R)}return t}clearScrollState(){e(this,b).x=0,e(this,b).y=0}clearDocumentState(){n(this,U,null)}saveScrollState(){e(this,P).documentElement.hasAttribute("data-no-scroll-restoration")?(e(this,b).x=0,e(this,b).y=0):(e(this,b).x=e(this,T).scrollValue.left,e(this,b).y=e(this,T).scrollValue.top)}restoreScrollPosition(){e(this,T).scrollElement.scroll({top:e(this,b).y,left:e(this,b).x,behavior:"instant"})}saveDocumentState(){e(this,P).documentElement.hasAttribute("data-no-page-restoration")?n(this,U,null):n(this,U,document.cloneNode(!0))}renewScrollPosition(){e(this,T).scrollElement.scroll({top:0,left:0,behavior:"instant"})}saveState(t){n(this,J,t)}clearState(){const t=e(this,J);return n(this,J,null),t}}T=new WeakMap,R=new WeakMap,b=new WeakMap,P=new WeakMap,U=new WeakMap,V=new WeakMap,J=new WeakMap,K=new WeakMap,z=new WeakMap;var A,Q,E,B,f,it,F,M,L,rt,x,$,Z,_,nt,c,ht,wt,Bt,yt,bt,Lt,Pt,ut,tt;const et=class et{constructor(t){a(this,c);a(this,A,null);a(this,Q,null);a(this,E,[]);a(this,B);a(this,f,null);a(this,it);a(this,F,[]);a(this,M,!1);a(this,L,null);a(this,rt,!1);a(this,x,new Map);a(this,$,null);a(this,Z,0);a(this,_,0);a(this,nt,t=>{var s;return((s=t.getAttribute("href"))==null?void 0:s.startsWith("/"))&&!t.hasAttribute("download")&&!t.hasAttribute("data-morph-skip")&&!t.closest("[data-morph-skip]")&&t.getAttribute("target")!=="_blank"});a(this,ut,t=>X(this,null,function*(){var s;(s=t.state)!=null&&s.path&&(t.preventDefault(),n(this,M,!0),yield this.navigate(t.state.path,{historyAction:"none"}),n(this,M,!1))}));a(this,tt,()=>{const{left:t,top:s}=this.scrollValue,i=s-e(this,_),u=t-e(this,Z);n(this,_,s),n(this,Z,t),document.documentElement.classList.toggle("scroll-y",s>0),document.documentElement.classList.toggle("scroll-x",t>0),document.documentElement.classList.toggle("scroll-y-forward",i>0),document.documentElement.classList.toggle("scroll-y-backward",i<0),document.documentElement.classList.toggle("scroll-x-forward",u>0),document.documentElement.classList.toggle("scroll-x-backward",u<0),j.dispatchEvent(document,"morphScroll",{detail:{left:t,top:s}})});if(Vt.isBrowser&&!et.instance){et.instance=this,n(this,A,{base:ct.normalizeBase(t==null?void 0:t.base),waitForHeadToLoad:(t==null?void 0:t.waitForHeadToLoad)!==!1,trailingSlash:(t==null?void 0:t.trailingSlash)||!1,scrollSelector:t==null?void 0:t.scrollSelector,morphInsideScrollContainer:(t==null?void 0:t.morphInsideScrollContainer)||!1}),n(this,Q,p(this,c,wt).call(this,document.body));const s=this.normalizePath(location.pathname+location.hash+location.search);n(this,f,s.path);const i=new Rt(this,e(this,f));i.setInitialDocument(document),e(this,x).set(e(this,f),i),document.documentElement.setAttribute("data-current-pathname",e(this,f)),document.documentElement.setAttribute("data-current-leaf",s.leaf),this.findLinks(),history.scrollRestoration="manual",addEventListener("popstate",e(this,ut)),ct.changeHistory({action:"replace",pathname:s.pathname,searchParameters:s.parameters,hash:s.hash}),n(this,$,new zt),p(this,c,Lt).call(this,document)}}get currentPath(){return e(this,f)}get previousPathname(){return e(this,it)}get links(){return e(this,E)}get scrollElement(){return e(this,L)}get isPopstateNavigation(){return e(this,M)}get scrollValue(){let t=0,s=0;return e(this,rt)?(t=window.scrollY,s=window.scrollX):(t=e(this,L).scrollTop,s=e(this,L).scrollLeft),{top:t,left:s}}saveState(t){const s=e(this,x).get(e(this,f));s&&s.saveState(t)}getState(){const t=e(this,x).get(e(this,f));return t==null?void 0:t.clearState()}normalizePath(t){return ct.splitPath(t,{base:e(this,A).base,trailingSlash:e(this,A).trailingSlash})}prefetch(t,s){return X(this,null,function*(){if(e(this,F).length)return;const i=p(this,c,ht).call(this,t);i==null||i.fetch(s)})}navigate(O){return X(this,arguments,function*(t,{historyAction:s="push",centerScroll:i,offsetScroll:u,revalidate:w,keepSearchParameters:H,submorph:v,clearState:g}={}){var ot;if(e(this,F).length)return;const d=this.normalizePath(((ot=this.pathnameModifier)==null?void 0:ot.call(this,t))||t);if(e(this,B)===d.path||e(this,f)===d.path){e(this,M)||p(this,c,Pt).call(this,d.hash||0,{centerScroll:i,offsetScroll:u,behavior:"smooth"});return}n(this,B,d.path),e(this,E).forEach(N=>{N.checkCurrent(d.path)});try{let N=!0;if(this.preprocessor)try{yield new Promise((o,k)=>{var y;(y=this.preprocessor)==null||y.call(this,{path:t,resolve:o,reject:k,submorph:v})})}catch(o){o?console.error(o):console.log("Route change canceled"),N=!1}if(!N||e(this,B)!==d.path){e(this,E).forEach(o=>{o.checkCurrent(e(this,f))});return}const At={path:d.path,submorph:v};j.dispatchEvent(document,"morphNavigation",{detail:At});const dt=p(this,c,ht).call(this,e(this,f)),m=p(this,c,ht).call(this,t);if(e(this,x).forEach(o=>{o.path!==d.path&&o.abort()}),yield m==null?void 0:m.fetch(w),e(this,B)!==d.path){e(this,E).forEach(o=>{o.checkCurrent(e(this,f))});return}dt.clearState(),dt.saveScrollState(),dt.saveDocumentState(),e(this,M)||(m.clearScrollState(),m.clearDocumentState()),g&&m.clearState(),m.cloneDocument(),e(this,$).textContent=m.title,document.body.appendChild(e(this,$));const mt=Et(pt({},At),{document:m.document});j.dispatchEvent(document,"morphStart",{detail:mt});const kt=Array.from(document.head.children),Ct=Array.from(m.document.head.children),Tt=p(this,c,Bt).call(this,kt,Ct),Ft=p(this,c,yt).call(this,kt,Tt),at=p(this,c,yt).call(this,Ct,Tt);at.forEach((o,k)=>{if(o.tagName==="SCRIPT"&&o.getAttribute("src")){const y=document.createElement("script"),q=o.getAttribute("src");q.includes("http")||(y.type="module"),y.src=q,at[k]=y}}),at.forEach(o=>{document.head.appendChild(o)});const ft=at.filter(o=>{if(o.hasAttribute("data-no-waiting"))return!1;if(p(this,c,bt).call(this,o))return!0});e(this,A).waitForHeadToLoad&&ft.length&&(yield new Promise(o=>X(this,null,function*(){let k=0;try{for(var y=Dt(ft),q,W,Y;q=!(W=yield y.next()).done;q=!1){const lt=W.value;lt.onload=()=>{k++,k===ft.length&&o()}}}catch(W){Y=[W]}finally{try{q&&(W=y.return)&&(yield W.call(y))}finally{if(Y)throw Y[0]}}}))),yield It.wait(10);const Mt=[];Ft.forEach(o=>{o.hasAttribute("data-permanent")||(p(this,c,bt).call(this,o)?Mt.push(o):o.remove())});const Ot=p(this,c,wt).call(this,m.document.body);e(this,A).morphInsideScrollContainer||p(this,c,Lt).call(this,m.document),document.documentElement.setAttribute("data-current-pathname",d.pathname),document.documentElement.setAttribute("data-current-leaf",d.leaf),ct.changeHistory({action:s,pathname:d.pathname,searchParameters:d.parameters||(H?location.search:""),hash:d.hash}),e(this,$).remove(),n(this,it,e(this,f)),n(this,f,d.path),e(this,Q).forEach((o,k)=>{const y=Ot[k],q=getComputedStyle(o).getPropertyValue("--morph-duration");let W=[],Y=[];v?v.forEach(h=>{const S=o.querySelector(h),D=y.querySelector(h);S&&D&&(Y.push(S),W.push(D))}):(W.push(...y.childNodes),Y.push(...o.childNodes)),Y.forEach(h=>{h instanceof HTMLElement&&(this.destroyOldLinks(h),h.classList.add("old"))}),W.forEach(h=>{h instanceof HTMLElement&&(this.findNewLinks(h),h.classList.add("new"))}),v?W.forEach((h,S)=>{var D;(D=Y[S].parentElement)==null||D.insertBefore(h,Y[S])}):o.prepend(...W),$t.requestIdleCallback(()=>{Y.forEach(h=>{h instanceof HTMLElement&&h.classList.add("old-idle")}),W.forEach(h=>{var S;h instanceof HTMLElement&&((S=h.parentElement)==null||S.style.setProperty("--new-content-height",h.offsetHeight+"px"),h.classList.add("new-idle"))})});const lt=Et(pt({},mt),{morphElement:o});j.dispatchEvent(document,"morphNewChildrenAdded",{detail:lt});const Wt=new Promise(h=>{setTimeout(()=>{Y.forEach(S=>S.remove()),W.forEach(S=>{var D;S instanceof HTMLElement&&((D=S.parentElement)==null||D.style.removeProperty("--new-content-height"),S.classList.remove("new-idle","new"))}),j.dispatchEvent(document,"morphOldChildrenRemoved",{detail:lt}),h()},(parseFloat(q)||0)*1e3+10)});e(this,F).push(Wt)}),this.isPopstateNavigation?document.documentElement.style.setProperty("--new-document-scroll-position",(this.scrollValue.top-m.scrollState.y)*1+"px"):document.documentElement.style.setProperty("--new-document-scroll-position",this.scrollValue.top+"px"),j.dispatchEvent(document,"morphBeforeNavigationScroll",{detail:m.scrollState}),d.hash?(m.clearScrollState(),p(this,c,Pt).call(this,d.hash,{centerScroll:i,offsetScroll:u})):e(this,M)?m.restoreScrollPosition():m.renewScrollPosition(),yield Promise.all(e(this,F)),Mt.forEach(o=>o.remove()),n(this,F,[]),e(this,Q).forEach(o=>{o.querySelectorAll("script").forEach(y=>{const q=document.createElement("script");q.type="module",q.src=y.getAttribute("src"),y.replaceWith(q)})}),j.dispatchEvent(document,"morphComplete",{detail:mt}),document.documentElement.style.removeProperty("--new-document-scroll-position"),window.dispatchEvent(new Event("resize"))}catch(N){console.error(N)}n(this,B,void 0)})}addLink(t){e(this,E).push(new St(t,this))}addLinks(t){t.forEach(s=>{this.addLink(s)})}removeLink(t){n(this,E,e(this,E).filter(s=>s.element===t?(s.destroy(),!1):!0))}destroyOldLinks(t){n(this,E,e(this,E).filter(s=>t.contains(s.element)?(s.destroy(),!1):!0))}findNewLinks(t){const s=[...t.querySelectorAll("a")].filter(e(this,nt));e(this,E).push(...s.map(i=>new St(i,this)))}findLinks(){const t=[...document.documentElement.querySelectorAll("a")].filter(e(this,nt));e(this,E).forEach(s=>s.destroy()),n(this,E,t.map(s=>new St(s,this)))}};A=new WeakMap,Q=new WeakMap,E=new WeakMap,B=new WeakMap,f=new WeakMap,it=new WeakMap,F=new WeakMap,M=new WeakMap,L=new WeakMap,rt=new WeakMap,x=new WeakMap,$=new WeakMap,Z=new WeakMap,_=new WeakMap,nt=new WeakMap,c=new WeakSet,ht=function(t){let s=t.split("#")[0],i=e(this,x).get(s);return i||(i=new Rt(this,s),e(this,x).set(s,i)),i},wt=function(t){const s=[...t.querySelectorAll("[data-morph]")];return s.length?s:[t]},Bt=function(t,s){return t.filter(i=>s.find(u=>u.outerHTML===i.outerHTML))},yt=function(t,s){return t.filter(i=>!s.find(u=>u.outerHTML===i.outerHTML))},bt=function(t){return t.tagName==="SCRIPT"||t.tagName==="STYLE"||t.tagName==="LINK"&&t.getAttribute("rel")==="stylesheet"},Lt=function(t){var s,i;(s=e(this,L))==null||s.removeEventListener("scroll",e(this,tt)),n(this,_,0),n(this,Z,0),n(this,L,e(this,A).scrollSelector&&t.querySelector(e(this,A).scrollSelector)||window),n(this,rt,e(this,L)===window),(i=e(this,L))==null||i.addEventListener("scroll",e(this,tt)),e(this,tt).call(this)},Pt=function(t,s){const i=typeof t=="string"?document.getElementById(t):t;(typeof i=="number"||i)&&It.scrollToElement(i,{scrollElement:e(this,L),behavior:(s==null?void 0:s.behavior)||"instant",center:s==null?void 0:s.centerScroll,offset:s==null?void 0:s.offsetScroll})},ut=new WeakMap,tt=new WeakMap,et.instance=null;let vt=et;exports.Morph=vt;
@@ -15,25 +15,25 @@ var Ht = (r, t, s) => t in r ? Ot(r, t, { enumerable: !0, configurable: !0, writ
15
15
  }, pt = (r, t) => Yt(r, Xt(t));
16
16
  var Et = (r, t, s) => t.has(r) || Mt("Cannot " + s);
17
17
  var e = (r, t, s) => (Et(r, t, "read from private field"), s ? s.call(r) : t.get(r)), a = (r, t, s) => t.has(r) ? Mt("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(r) : t.set(r, s), n = (r, t, s, i) => (Et(r, t, "write to private field"), i ? i.call(r, s) : t.set(r, s), s), p = (r, t, s) => (Et(r, t, "access private method"), s);
18
- var Y = (r, t, s) => new Promise((i, u) => {
18
+ var X = (r, t, s) => new Promise((i, u) => {
19
19
  var y = (g) => {
20
20
  try {
21
21
  w(s.next(g));
22
- } catch (W) {
23
- u(W);
22
+ } catch (B) {
23
+ u(B);
24
24
  }
25
25
  }, M = (g) => {
26
26
  try {
27
27
  w(s.throw(g));
28
- } catch (W) {
29
- u(W);
28
+ } catch (B) {
29
+ u(B);
30
30
  }
31
31
  }, w = (g) => g.done ? i(g.value) : Promise.resolve(g.value).then(y, M);
32
32
  w((s = s.apply(r, t)).next());
33
33
  });
34
- var Nt = (r, t, s) => (t = r[xt("asyncIterator")]) ? t.call(r) : (r = r[xt("iterator")](), t = {}, s = (i, u) => (u = r[i]) && (t[i] = (y) => new Promise((M, w, g) => (y = u.call(r, y), g = y.done, Promise.resolve(y.value).then((W) => M({ value: W, done: g }), w)))), s("next"), s("return"), t);
34
+ var Nt = (r, t, s) => (t = r[xt("asyncIterator")]) ? t.call(r) : (r = r[xt("iterator")](), t = {}, s = (i, u) => (u = r[i]) && (t[i] = (y) => new Promise((M, w, g) => (y = u.call(r, y), g = y.done, Promise.resolve(y.value).then((B) => M({ value: B, done: g }), w)))), s("next"), s("return"), t);
35
35
  import { i as Vt } from "../index-Bv9zgfdb.js";
36
- import { d as X } from "../events-CsVF98U6.js";
36
+ import { d as U } from "../events-CsVF98U6.js";
37
37
  import { r as Kt } from "../polyfills-DJrTJQky.js";
38
38
  import { w as $t, s as Gt } from "../scroll-DPkCFTxg.js";
39
39
  import "construct-style-sheets-polyfill";
@@ -51,112 +51,112 @@ class qt extends HTMLElement {
51
51
  }
52
52
  }
53
53
  Vt && !customElements.get("morph-announcer") && customElements.define("morph-announcer", qt);
54
- var C, l, I, st, $;
54
+ var C, l, R, st, G;
55
55
  class gt {
56
56
  constructor(t, s) {
57
57
  a(this, C);
58
58
  a(this, l);
59
- a(this, I);
59
+ a(this, R);
60
60
  a(this, st, (t) => {
61
61
  var i;
62
62
  if (t.preventDefault(), e(this, l).hasAttribute("data-back") && e(this, C).previousPathname)
63
63
  history.back();
64
64
  else {
65
- n(this, I, e(this, l).getAttribute("href") || "/");
65
+ n(this, R, e(this, l).getAttribute("href") || "/");
66
66
  const u = e(this, l).getAttribute(
67
67
  "data-history-action"
68
- ) || "push", y = e(this, l).hasAttribute("data-center-scroll"), M = getComputedStyle(e(this, l)).getPropertyValue("--offset-scroll").trim(), w = M ? Zt.parse(M) : void 0, g = e(this, l).hasAttribute("data-revalidate"), W = e(this, l).hasAttribute(
68
+ ) || "push", y = e(this, l).hasAttribute("data-center-scroll"), M = getComputedStyle(e(this, l)).getPropertyValue("--offset-scroll").trim(), w = M ? Zt.parse(M) : void 0, g = e(this, l).hasAttribute("data-revalidate"), B = e(this, l).hasAttribute(
69
69
  "data-keep-search-parameters"
70
70
  ), d = (i = e(this, l).getAttribute("data-submorph")) == null ? void 0 : i.split(",").map((N) => N.trim()), ot = e(this, l).hasAttribute("data-clear-state");
71
- e(this, C).navigate(e(this, I), {
71
+ e(this, C).navigate(e(this, R), {
72
72
  historyAction: u,
73
73
  centerScroll: y,
74
74
  offsetScroll: w,
75
75
  revalidate: g,
76
- keepSearchParameters: W,
76
+ keepSearchParameters: B,
77
77
  submorph: d,
78
78
  clearState: ot
79
79
  });
80
80
  }
81
81
  });
82
- a(this, $, () => {
82
+ a(this, G, () => {
83
83
  const t = e(this, l).hasAttribute("data-revalidate");
84
- e(this, C).prefetch(e(this, I), t), e(this, l).removeEventListener("pointerenter", e(this, $));
84
+ e(this, C).prefetch(e(this, R), t), e(this, l).removeEventListener("pointerenter", e(this, G));
85
85
  });
86
- n(this, C, s), n(this, l, t), n(this, I, e(this, l).getAttribute("href") || "/"), e(this, l).addEventListener("click", e(this, st)), this.checkCurrent(location.pathname), e(this, l).hasAttribute("data-prefetch") && e(this, l).addEventListener("pointerenter", e(this, $));
86
+ n(this, C, s), n(this, l, t), n(this, R, e(this, l).getAttribute("href") || "/"), e(this, l).addEventListener("click", e(this, st)), this.checkCurrent(location.pathname), e(this, l).hasAttribute("data-prefetch") && e(this, l).addEventListener("pointerenter", e(this, G));
87
87
  }
88
88
  get element() {
89
89
  return e(this, l);
90
90
  }
91
91
  checkCurrent(t) {
92
- const s = e(this, C).normalizePath(t), i = e(this, C).normalizePath(e(this, I));
92
+ const s = e(this, C).normalizePath(t), i = e(this, C).normalizePath(e(this, R));
93
93
  e(this, l).hasAttribute("data-include") && s.pathname.includes(i.pathname) ? e(this, l).classList.add("current") : i.pathname === s.pathname ? e(this, l).classList.add("current") : e(this, l).classList.remove("current");
94
94
  }
95
95
  destroy() {
96
- e(this, l).removeEventListener("click", e(this, st)), e(this, l).removeEventListener("pointerenter", e(this, $)), e(this, l).classList.remove("current");
96
+ e(this, l).removeEventListener("click", e(this, st)), e(this, l).removeEventListener("pointerenter", e(this, G)), e(this, l).classList.remove("current");
97
97
  }
98
98
  }
99
- C = new WeakMap(), l = new WeakMap(), I = new WeakMap(), st = new WeakMap(), $ = new WeakMap();
99
+ C = new WeakMap(), l = new WeakMap(), R = new WeakMap(), st = new WeakMap(), G = new WeakMap();
100
100
  const _t = new DOMParser();
101
- var T, R, b, P, U, V, G, j, q;
101
+ var T, V, b, P, j, q, J, K, z;
102
102
  class It {
103
103
  constructor(t, s) {
104
104
  a(this, T);
105
- a(this, R);
105
+ a(this, V);
106
106
  a(this, b, { x: 0, y: 0 });
107
107
  a(this, P, null);
108
- a(this, U, null);
109
- a(this, V, null);
110
- a(this, G, null);
111
108
  a(this, j, null);
112
109
  a(this, q, null);
113
- n(this, T, t), n(this, R, s);
110
+ a(this, J, null);
111
+ a(this, K, null);
112
+ a(this, z, null);
113
+ n(this, T, t), n(this, V, s);
114
114
  }
115
115
  get path() {
116
- return e(this, R);
116
+ return e(this, V);
117
117
  }
118
118
  get scrollState() {
119
119
  return e(this, b);
120
120
  }
121
121
  get document() {
122
- return e(this, V);
122
+ return e(this, q);
123
123
  }
124
124
  setInitialDocument(t) {
125
125
  n(this, P, t.cloneNode(!0));
126
126
  }
127
127
  abort() {
128
128
  var t;
129
- return (t = e(this, j)) == null ? void 0 : t.abort(
130
- `[${e(this, R)}] page loading cancelled`
129
+ return (t = e(this, K)) == null ? void 0 : t.abort(
130
+ `[${e(this, V)}] page loading cancelled`
131
131
  );
132
132
  }
133
133
  fetch(t) {
134
- return Y(this, null, function* () {
135
- return e(this, q) || e(this, P) && e(this, P).documentElement.hasAttribute("data-cache") && !t || e(this, P) && e(this, T).isPopstateNavigation ? e(this, q) : (n(this, q, new Promise((s) => Y(this, null, function* () {
134
+ return X(this, null, function* () {
135
+ return e(this, z) || e(this, P) && e(this, P).documentElement.hasAttribute("data-cache") && !t || e(this, P) && e(this, T).isPopstateNavigation ? e(this, z) : (n(this, z, new Promise((s) => X(this, null, function* () {
136
136
  try {
137
- n(this, j, new AbortController());
138
- const u = yield (yield fetch(e(this, R), {
139
- signal: e(this, j).signal
137
+ n(this, K, new AbortController());
138
+ const u = yield (yield fetch(e(this, V), {
139
+ signal: e(this, K).signal
140
140
  })).text(), y = _t.parseFromString(u, "text/html");
141
141
  this.setInitialDocument(y);
142
142
  } catch (i) {
143
143
  console.warn(i);
144
144
  } finally {
145
- n(this, j, null), n(this, q, null), s();
145
+ n(this, K, null), n(this, z, null), s();
146
146
  }
147
- }))), e(this, q));
147
+ }))), e(this, z));
148
148
  });
149
149
  }
150
150
  cloneDocument() {
151
- n(this, V, (e(this, U) || e(this, P)).cloneNode(!0));
151
+ n(this, q, (e(this, j) || e(this, P)).cloneNode(!0));
152
152
  }
153
153
  get title() {
154
154
  let t = "";
155
- if (e(this, V).title)
156
- t = e(this, V).title;
155
+ if (e(this, q).title)
156
+ t = e(this, q).title;
157
157
  else {
158
- const s = e(this, V).querySelector("h1");
159
- t = (s == null ? void 0 : s.innerText) || (s == null ? void 0 : s.textContent) || e(this, R);
158
+ const s = e(this, q).querySelector("h1");
159
+ t = (s == null ? void 0 : s.innerText) || (s == null ? void 0 : s.textContent) || e(this, V);
160
160
  }
161
161
  return t;
162
162
  }
@@ -164,7 +164,7 @@ class It {
164
164
  e(this, b).x = 0, e(this, b).y = 0;
165
165
  }
166
166
  clearDocumentState() {
167
- n(this, U, null);
167
+ n(this, j, null);
168
168
  }
169
169
  saveScrollState() {
170
170
  e(this, P).documentElement.hasAttribute(
@@ -181,7 +181,7 @@ class It {
181
181
  saveDocumentState() {
182
182
  e(this, P).documentElement.hasAttribute(
183
183
  "data-no-page-restoration"
184
- ) ? n(this, U, null) : n(this, U, document.cloneNode(!0));
184
+ ) ? n(this, j, null) : n(this, j, document.cloneNode(!0));
185
185
  }
186
186
  renewScrollPosition() {
187
187
  e(this, T).scrollElement.scroll({
@@ -191,43 +191,43 @@ class It {
191
191
  });
192
192
  }
193
193
  saveState(t) {
194
- n(this, G, t);
194
+ n(this, J, t);
195
195
  }
196
196
  clearState() {
197
- const t = e(this, G);
198
- return n(this, G, null), t;
197
+ const t = e(this, J);
198
+ return n(this, J, null), t;
199
199
  }
200
200
  }
201
- T = new WeakMap(), R = new WeakMap(), b = new WeakMap(), P = new WeakMap(), U = new WeakMap(), V = new WeakMap(), G = new WeakMap(), j = new WeakMap(), q = new WeakMap();
202
- var A, J, E, z, f, it, F, x, L, rt, H, K, Q, Z, nt, c, ct, St, zt, wt, yt, vt, bt, ht, _;
201
+ T = new WeakMap(), V = new WeakMap(), b = new WeakMap(), P = new WeakMap(), j = new WeakMap(), q = new WeakMap(), J = new WeakMap(), K = new WeakMap(), z = new WeakMap();
202
+ var A, Q, E, F, f, it, W, x, L, rt, H, $, Z, _, nt, c, ct, St, zt, wt, yt, vt, bt, ht, tt;
203
203
  const et = class et {
204
204
  constructor(t) {
205
205
  a(this, c);
206
206
  a(this, A, null);
207
- a(this, J, null);
207
+ a(this, Q, null);
208
208
  a(this, E, []);
209
- a(this, z);
209
+ a(this, F);
210
210
  a(this, f, null);
211
211
  a(this, it);
212
- a(this, F, []);
212
+ a(this, W, []);
213
213
  a(this, x, !1);
214
214
  a(this, L, null);
215
215
  a(this, rt, !1);
216
216
  a(this, H, /* @__PURE__ */ new Map());
217
- a(this, K, null);
218
- a(this, Q, 0);
217
+ a(this, $, null);
219
218
  a(this, Z, 0);
219
+ a(this, _, 0);
220
220
  a(this, nt, (t) => {
221
221
  var s;
222
222
  return ((s = t.getAttribute("href")) == null ? void 0 : s.startsWith("/")) && !t.hasAttribute("download") && !t.hasAttribute("data-morph-skip") && !t.closest("[data-morph-skip]") && t.getAttribute("target") !== "_blank";
223
223
  });
224
- a(this, ht, (t) => Y(this, null, function* () {
224
+ a(this, ht, (t) => X(this, null, function* () {
225
225
  var s;
226
226
  (s = t.state) != null && s.path && (t.preventDefault(), n(this, x, !0), yield this.navigate(t.state.path, { historyAction: "none" }), n(this, x, !1));
227
227
  }));
228
- a(this, _, () => {
229
- const { left: t, top: s } = this.scrollValue, i = s - e(this, Z), u = t - e(this, Q);
230
- n(this, Z, s), n(this, Q, t), document.documentElement.classList.toggle("scroll-y", s > 0), document.documentElement.classList.toggle("scroll-x", t > 0), document.documentElement.classList.toggle(
228
+ a(this, tt, () => {
229
+ const { left: t, top: s } = this.scrollValue, i = s - e(this, _), u = t - e(this, Z);
230
+ n(this, _, s), n(this, Z, t), document.documentElement.classList.toggle("scroll-y", s > 0), document.documentElement.classList.toggle("scroll-x", t > 0), document.documentElement.classList.toggle(
231
231
  "scroll-y-forward",
232
232
  i > 0
233
233
  ), document.documentElement.classList.toggle(
@@ -239,7 +239,7 @@ const et = class et {
239
239
  ), document.documentElement.classList.toggle(
240
240
  "scroll-x-backward",
241
241
  u < 0
242
- ), X(document, "morphScroll", {
242
+ ), U(document, "morphScroll", {
243
243
  detail: {
244
244
  left: t,
245
245
  top: s
@@ -253,7 +253,7 @@ const et = class et {
253
253
  trailingSlash: (t == null ? void 0 : t.trailingSlash) || !1,
254
254
  scrollSelector: t == null ? void 0 : t.scrollSelector,
255
255
  morphInsideScrollContainer: (t == null ? void 0 : t.morphInsideScrollContainer) || !1
256
- }), n(this, J, p(this, c, St).call(this, document.body));
256
+ }), n(this, Q, p(this, c, St).call(this, document.body));
257
257
  const s = this.normalizePath(
258
258
  location.pathname + location.hash + location.search
259
259
  );
@@ -270,7 +270,7 @@ const et = class et {
270
270
  pathname: s.pathname,
271
271
  searchParameters: s.parameters,
272
272
  hash: s.hash
273
- }), n(this, K, new qt()), p(this, c, vt).call(this, document);
273
+ }), n(this, $, new qt()), p(this, c, vt).call(this, document);
274
274
  }
275
275
  }
276
276
  get currentPath() {
@@ -307,15 +307,15 @@ const et = class et {
307
307
  });
308
308
  }
309
309
  prefetch(t, s) {
310
- return Y(this, null, function* () {
311
- if (e(this, F).length)
310
+ return X(this, null, function* () {
311
+ if (e(this, W).length)
312
312
  return;
313
313
  const i = p(this, c, ct).call(this, t);
314
314
  i == null || i.fetch(s);
315
315
  });
316
316
  }
317
- navigate(W) {
318
- return Y(this, arguments, function* (t, {
317
+ navigate(B) {
318
+ return X(this, arguments, function* (t, {
319
319
  historyAction: s = "push",
320
320
  centerScroll: i,
321
321
  offsetScroll: u,
@@ -325,12 +325,12 @@ const et = class et {
325
325
  clearState: g
326
326
  } = {}) {
327
327
  var ot;
328
- if (e(this, F).length)
328
+ if (e(this, W).length)
329
329
  return;
330
330
  const d = this.normalizePath(
331
331
  ((ot = this.pathnameModifier) == null ? void 0 : ot.call(this, t)) || t
332
332
  );
333
- if (e(this, z) === d.path || e(this, f) === d.path) {
333
+ if (e(this, F) === d.path || e(this, f) === d.path) {
334
334
  e(this, x) || p(this, c, bt).call(this, d.hash || 0, {
335
335
  centerScroll: i,
336
336
  offsetScroll: u,
@@ -338,7 +338,7 @@ const et = class et {
338
338
  });
339
339
  return;
340
340
  }
341
- n(this, z, d.path), e(this, E).forEach((N) => {
341
+ n(this, F, d.path), e(this, E).forEach((N) => {
342
342
  N.checkCurrent(d.path);
343
343
  });
344
344
  try {
@@ -357,7 +357,7 @@ const et = class et {
357
357
  } catch (o) {
358
358
  o ? console.error(o) : console.log("Route change canceled"), N = !1;
359
359
  }
360
- if (!N || e(this, z) !== d.path) {
360
+ if (!N || e(this, F) !== d.path) {
361
361
  e(this, E).forEach((o) => {
362
362
  o.checkCurrent(e(this, f));
363
363
  });
@@ -367,30 +367,30 @@ const et = class et {
367
367
  path: d.path,
368
368
  submorph: w
369
369
  };
370
- X(document, "morphNavigation", {
370
+ U(document, "morphNavigation", {
371
371
  detail: Lt
372
372
  });
373
373
  const ut = p(this, c, ct).call(this, e(this, f)), m = p(this, c, ct).call(this, t);
374
374
  if (e(this, H).forEach((o) => {
375
375
  o.path !== d.path && o.abort();
376
- }), yield m == null ? void 0 : m.fetch(y), e(this, z) !== d.path) {
376
+ }), yield m == null ? void 0 : m.fetch(y), e(this, F) !== d.path) {
377
377
  e(this, E).forEach((o) => {
378
378
  o.checkCurrent(e(this, f));
379
379
  });
380
380
  return;
381
381
  }
382
- ut.clearState(), ut.saveScrollState(), ut.saveDocumentState(), e(this, x) || (m.clearScrollState(), m.clearDocumentState()), g && m.clearState(), m.cloneDocument(), e(this, K).textContent = m.title, document.body.appendChild(e(this, K));
382
+ ut.clearState(), ut.saveScrollState(), ut.saveDocumentState(), e(this, x) || (m.clearScrollState(), m.clearDocumentState()), g && m.clearState(), m.cloneDocument(), e(this, $).textContent = m.title, document.body.appendChild(e(this, $));
383
383
  const dt = pt(ft({}, Lt), {
384
384
  document: m.document
385
385
  });
386
- X(document, "morphStart", {
386
+ U(document, "morphStart", {
387
387
  detail: dt
388
388
  });
389
389
  const Pt = Array.from(document.head.children), At = Array.from(m.document.head.children), kt = p(this, c, zt).call(this, Pt, At), Ft = p(this, c, wt).call(this, Pt, kt), at = p(this, c, wt).call(this, At, kt);
390
390
  at.forEach((o, k) => {
391
391
  if (o.tagName === "SCRIPT" && o.getAttribute("src")) {
392
- const v = document.createElement("script");
393
- v.type = "module", v.src = o.getAttribute("src"), at[k] = v;
392
+ const v = document.createElement("script"), D = o.getAttribute("src");
393
+ D.includes("http") || (v.type = "module"), v.src = D, at[k] = v;
394
394
  }
395
395
  }), at.forEach((o) => {
396
396
  document.head.appendChild(o);
@@ -401,23 +401,23 @@ const et = class et {
401
401
  if (p(this, c, yt).call(this, o))
402
402
  return !0;
403
403
  });
404
- e(this, A).waitForHeadToLoad && mt.length && (yield new Promise((o) => Y(this, null, function* () {
404
+ e(this, A).waitForHeadToLoad && mt.length && (yield new Promise((o) => X(this, null, function* () {
405
405
  let k = 0;
406
406
  try {
407
- for (var v = Nt(mt), tt, B, O; tt = !(B = yield v.next()).done; tt = !1) {
408
- const lt = B.value;
407
+ for (var v = Nt(mt), D, O, Y; D = !(O = yield v.next()).done; D = !1) {
408
+ const lt = O.value;
409
409
  lt.onload = () => {
410
410
  k++, k === mt.length && o();
411
411
  };
412
412
  }
413
- } catch (B) {
414
- O = [B];
413
+ } catch (O) {
414
+ Y = [O];
415
415
  } finally {
416
416
  try {
417
- tt && (B = v.return) && (yield B.call(v));
417
+ D && (O = v.return) && (yield O.call(v));
418
418
  } finally {
419
- if (O)
420
- throw O[0];
419
+ if (Y)
420
+ throw Y[0];
421
421
  }
422
422
  }
423
423
  }))), yield $t(10);
@@ -437,26 +437,26 @@ const et = class et {
437
437
  pathname: d.pathname,
438
438
  searchParameters: d.parameters || (M ? location.search : ""),
439
439
  hash: d.hash
440
- }), e(this, K).remove(), n(this, it, e(this, f)), n(this, f, d.path), e(this, J).forEach((o, k) => {
441
- const v = Wt[k], tt = getComputedStyle(o).getPropertyValue("--morph-duration");
442
- let B = [], O = [];
440
+ }), e(this, $).remove(), n(this, it, e(this, f)), n(this, f, d.path), e(this, Q).forEach((o, k) => {
441
+ const v = Wt[k], D = getComputedStyle(o).getPropertyValue("--morph-duration");
442
+ let O = [], Y = [];
443
443
  w ? w.forEach((h) => {
444
- const S = o.querySelector(h), D = v.querySelector(h);
445
- S && D && (O.push(S), B.push(D));
446
- }) : (B.push(...v.childNodes), O.push(...o.childNodes)), O.forEach((h) => {
444
+ const S = o.querySelector(h), I = v.querySelector(h);
445
+ S && I && (Y.push(S), O.push(I));
446
+ }) : (O.push(...v.childNodes), Y.push(...o.childNodes)), Y.forEach((h) => {
447
447
  h instanceof HTMLElement && (this.destroyOldLinks(h), h.classList.add("old"));
448
- }), B.forEach((h) => {
448
+ }), O.forEach((h) => {
449
449
  h instanceof HTMLElement && (this.findNewLinks(h), h.classList.add("new"));
450
- }), w ? B.forEach((h, S) => {
451
- var D;
452
- (D = O[S].parentElement) == null || D.insertBefore(
450
+ }), w ? O.forEach((h, S) => {
451
+ var I;
452
+ (I = Y[S].parentElement) == null || I.insertBefore(
453
453
  h,
454
- O[S]
454
+ Y[S]
455
455
  );
456
- }) : o.prepend(...B), Kt(() => {
457
- O.forEach((h) => {
456
+ }) : o.prepend(...O), Kt(() => {
457
+ Y.forEach((h) => {
458
458
  h instanceof HTMLElement && h.classList.add("old-idle");
459
- }), B.forEach((h) => {
459
+ }), O.forEach((h) => {
460
460
  var S;
461
461
  h instanceof HTMLElement && ((S = h.parentElement) == null || S.style.setProperty(
462
462
  "--new-content-height",
@@ -467,39 +467,39 @@ const et = class et {
467
467
  const lt = pt(ft({}, dt), {
468
468
  morphElement: o
469
469
  });
470
- X(document, "morphNewChildrenAdded", {
470
+ U(document, "morphNewChildrenAdded", {
471
471
  detail: lt
472
472
  });
473
473
  const Bt = new Promise((h) => {
474
474
  setTimeout(() => {
475
- O.forEach((S) => S.remove()), B.forEach((S) => {
476
- var D;
477
- S instanceof HTMLElement && ((D = S.parentElement) == null || D.style.removeProperty(
475
+ Y.forEach((S) => S.remove()), O.forEach((S) => {
476
+ var I;
477
+ S instanceof HTMLElement && ((I = S.parentElement) == null || I.style.removeProperty(
478
478
  "--new-content-height"
479
479
  ), S.classList.remove("new-idle", "new"));
480
- }), X(document, "morphOldChildrenRemoved", {
480
+ }), U(document, "morphOldChildrenRemoved", {
481
481
  detail: lt
482
482
  }), h();
483
- }, (parseFloat(tt) || 0) * 1e3 + 10);
483
+ }, (parseFloat(D) || 0) * 1e3 + 10);
484
484
  });
485
- e(this, F).push(Bt);
485
+ e(this, W).push(Bt);
486
486
  }), this.isPopstateNavigation ? document.documentElement.style.setProperty(
487
487
  "--new-document-scroll-position",
488
488
  (this.scrollValue.top - m.scrollState.y) * 1 + "px"
489
489
  ) : document.documentElement.style.setProperty(
490
490
  "--new-document-scroll-position",
491
491
  this.scrollValue.top + "px"
492
- ), X(document, "morphBeforeNavigationScroll", {
492
+ ), U(document, "morphBeforeNavigationScroll", {
493
493
  detail: m.scrollState
494
494
  }), d.hash ? (m.clearScrollState(), p(this, c, bt).call(this, d.hash, {
495
495
  centerScroll: i,
496
496
  offsetScroll: u
497
- })) : e(this, x) ? m.restoreScrollPosition() : m.renewScrollPosition(), yield Promise.all(e(this, F)), Ct.forEach((o) => o.remove()), n(this, F, []), e(this, J).forEach((o) => {
497
+ })) : e(this, x) ? m.restoreScrollPosition() : m.renewScrollPosition(), yield Promise.all(e(this, W)), Ct.forEach((o) => o.remove()), n(this, W, []), e(this, Q).forEach((o) => {
498
498
  o.querySelectorAll("script").forEach((v) => {
499
- const tt = document.createElement("script");
500
- tt.type = "module", tt.src = v.getAttribute("src"), v.replaceWith(tt);
499
+ const D = document.createElement("script");
500
+ D.type = "module", D.src = v.getAttribute("src"), v.replaceWith(D);
501
501
  });
502
- }), X(document, "morphComplete", {
502
+ }), U(document, "morphComplete", {
503
503
  detail: dt
504
504
  }), document.documentElement.style.removeProperty(
505
505
  "--new-document-scroll-position"
@@ -507,7 +507,7 @@ const et = class et {
507
507
  } catch (N) {
508
508
  console.error(N);
509
509
  }
510
- n(this, z, void 0);
510
+ n(this, F, void 0);
511
511
  });
512
512
  }
513
513
  addLink(t) {
@@ -539,7 +539,7 @@ const et = class et {
539
539
  e(this, E).forEach((s) => s.destroy()), n(this, E, t.map((s) => new gt(s, this)));
540
540
  }
541
541
  };
542
- A = new WeakMap(), J = new WeakMap(), E = new WeakMap(), z = new WeakMap(), f = new WeakMap(), it = new WeakMap(), F = new WeakMap(), x = new WeakMap(), L = new WeakMap(), rt = new WeakMap(), H = new WeakMap(), K = new WeakMap(), Q = new WeakMap(), Z = new WeakMap(), nt = new WeakMap(), c = new WeakSet(), ct = function(t) {
542
+ A = new WeakMap(), Q = new WeakMap(), E = new WeakMap(), F = new WeakMap(), f = new WeakMap(), it = new WeakMap(), W = new WeakMap(), x = new WeakMap(), L = new WeakMap(), rt = new WeakMap(), H = new WeakMap(), $ = new WeakMap(), Z = new WeakMap(), _ = new WeakMap(), nt = new WeakMap(), c = new WeakSet(), ct = function(t) {
543
543
  let s = t.split("#")[0], i = e(this, H).get(s);
544
544
  return i || (i = new It(this, s), e(this, H).set(s, i)), i;
545
545
  }, St = function(t) {
@@ -563,8 +563,8 @@ A = new WeakMap(), J = new WeakMap(), E = new WeakMap(), z = new WeakMap(), f =
563
563
  var s, i;
564
564
  (s = e(this, L)) == null || s.removeEventListener(
565
565
  "scroll",
566
- e(this, _)
567
- ), n(this, Z, 0), n(this, Q, 0), n(this, L, e(this, A).scrollSelector && t.querySelector(e(this, A).scrollSelector) || window), n(this, rt, e(this, L) === window), (i = e(this, L)) == null || i.addEventListener("scroll", e(this, _)), e(this, _).call(this);
566
+ e(this, tt)
567
+ ), n(this, _, 0), n(this, Z, 0), n(this, L, e(this, A).scrollSelector && t.querySelector(e(this, A).scrollSelector) || window), n(this, rt, e(this, L) === window), (i = e(this, L)) == null || i.addEventListener("scroll", e(this, tt)), e(this, tt).call(this);
568
568
  }, bt = function(t, s) {
569
569
  const i = typeof t == "string" ? document.getElementById(t) : t;
570
570
  (typeof i == "number" || i) && Gt(i, {
@@ -573,7 +573,7 @@ A = new WeakMap(), J = new WeakMap(), E = new WeakMap(), z = new WeakMap(), f =
573
573
  center: s == null ? void 0 : s.centerScroll,
574
574
  offset: s == null ? void 0 : s.offsetScroll
575
575
  });
576
- }, ht = new WeakMap(), _ = new WeakMap(), et.instance = null;
576
+ }, ht = new WeakMap(), tt = new WeakMap(), et.instance = null;
577
577
  let Rt = et;
578
578
  export {
579
579
  Rt as Morph
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aptechka",
3
- "version": "0.70.11",
3
+ "version": "0.70.13",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/denisavitski/aptechka.git"