aptechka 0.71.1 → 0.71.3
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.
- package/lib/morph/index.cjs +1 -1
- package/lib/morph/index.js +114 -114
- package/package.json +1 -1
package/lib/morph/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var jt=Object.defineProperty,Kt=Object.defineProperties;var $t=Object.getOwnPropertyDescriptors;var Nt=Object.getOwnPropertySymbols;var Gt=Object.prototype.hasOwnProperty,Jt=Object.prototype.propertyIsEnumerable;var qt=(n,t)=>(t=Symbol[n])?t:Symbol.for("Symbol."+n),Ut=n=>{throw TypeError(n)};var Dt=(n,t,s)=>t in n?jt(n,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):n[t]=s,gt=(n,t)=>{for(var s in t||(t={}))Gt.call(t,s)&&Dt(n,s,t[s]);if(Nt)for(var s of Nt(t))Jt.call(t,s)&&Dt(n,s,t[s]);return n},vt=(n,t)=>Kt(n,$t(t));var St=(n,t,s)=>t.has(n)||Ut("Cannot "+s);var e=(n,t,s)=>(St(n,t,"read from private field"),s?s.call(n):t.get(n)),o=(n,t,s)=>t.has(n)?Ut("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(n):t.set(n,s),r=(n,t,s,i)=>(St(n,t,"write to private field"),i?i.call(n,s):t.set(n,s),s),E=(n,t,s)=>(St(n,t,"access private method"),s);var W=(n,t,s)=>new Promise((i,d)=>{var y=v=>{try{w(s.next(v))}catch(O){d(O)}},P=v=>{try{w(s.throw(v))}catch(O){d(O)}},w=v=>v.done?i(v.value):Promise.resolve(v.value).then(y,P);w((s=s.apply(n,t)).next())});var zt=(n,t,s)=>(t=n[qt("asyncIterator")])?t.call(n):(n=n[qt("iterator")](),t={},s=(i,d)=>(d=n[i])&&(t[i]=y=>new Promise((P,w,v)=>(y=d.call(n,y),v=y.done,Promise.resolve(y.value).then(O=>P({value:O,done:v}),w)))),s("next"),s("return"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Ft=require("../index-DekP7OZe.cjs"),U=require("../events-KVanG9sR.cjs"),Qt=require("../polyfills-Df4r-ETT.cjs"),It=require("../scroll-CIdNtj3G.cjs");require("construct-style-sheets-polyfill");const it=require("../url-YEESIcRn.cjs"),Zt=require("../css-value-parser/index.cjs");class Bt 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)}}Ft.isBrowser&&!customElements.get("morph-announcer")&&customElements.define("morph-announcer",Bt);var H,l,z,rt,J;class wt{constructor(t,s){o(this,H);o(this,l);o(this,z);o(this,rt,t=>{var i;if(t.preventDefault(),e(this,l).hasAttribute("data-back")&&e(this,H).previousURL)history.back();else{r(this,z,e(this,l).getAttribute("href")||"/");const d=e(this,l).getAttribute("data-history-action")||"push",y=e(this,l).hasAttribute("data-center-scroll"),P=getComputedStyle(e(this,l)).getPropertyValue("--offset-scroll").trim(),w=P?Zt.cssValueParser.parse(P):void 0,v=e(this,l).hasAttribute("data-revalidate"),O=e(this,l).hasAttribute("data-keep-search-parameters"),h=(i=e(this,l).getAttribute("data-submorph"))==null?void 0:i.split(",").map(ht=>ht.trim()),lt=e(this,l).hasAttribute("data-clear-state");e(this,H).navigate(e(this,z),{historyAction:d,centerScroll:y,offsetScroll:w,revalidate:v,keepSearchParameters:O,submorph:h,clearState:lt})}});o(this,J,()=>{const t=e(this,l).hasAttribute("data-revalidate");e(this,H).prefetch(e(this,z),t),e(this,l).removeEventListener("pointerenter",e(this,J))});r(this,H,s),r(this,l,t),r(this,z,e(this,l).getAttribute("href")||"/"),e(this,l).addEventListener("click",e(this,rt)),this.checkCurrent(location.pathname),e(this,l).hasAttribute("data-prefetch")&&e(this,l).addEventListener("pointerenter",e(this,J))}get element(){return e(this,l)}checkCurrent(t){const s=e(this,H).normalizePath(t),i=e(this,H).normalizePath(e(this,z));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,rt)),e(this,l).removeEventListener("pointerenter",e(this,J)),e(this,l).classList.remove("current")}}H=new WeakMap,l=new WeakMap,z=new WeakMap,rt=new WeakMap,J=new WeakMap;const _t=new DOMParser;var R,Y,L,C,X,I,Q,j,V,Z;class Vt{constructor(t,s){o(this,R);o(this,Y);o(this,L,{x:0,y:0});o(this,C,null);o(this,X,null);o(this,I,null);o(this,Q,null);o(this,j,null);o(this,V,null);o(this,Z);r(this,R,t),r(this,Y,s),r(this,Z,s)}get pathname(){return e(this,Y)}get scrollState(){return e(this,L)}get document(){return e(this,I)}setInitialDocument(t){r(this,C,t.cloneNode(!0))}abort(){var t;return(t=e(this,j))==null?void 0:t.abort(`[${e(this,Y)}] page loading cancelled`)}fetch(t,s){return W(this,null,function*(){return e(this,V)||e(this,C)&&e(this,C).documentElement.hasAttribute("data-cache")&&!s&&e(this,Z)!==t||e(this,C)&&e(this,R).isPopstateNavigation?e(this,V):(r(this,V,new Promise(i=>W(this,null,function*(){try{r(this,j,new AbortController);const y=yield(yield fetch(t,{signal:e(this,j).signal})).text(),P=_t.parseFromString(y,"text/html");this.setInitialDocument(P)}catch(d){console.warn(d)}finally{r(this,Z,t),r(this,j,null),r(this,V,null),i()}}))),e(this,V))})}cloneDocument(){r(this,I,(e(this,X)||e(this,C)).cloneNode(!0))}get title(){let t="";if(e(this,I).title)t=e(this,I).title;else{const s=e(this,I).querySelector("h1");t=(s==null?void 0:s.innerText)||(s==null?void 0:s.textContent)||e(this,Y)}return t}clearScrollState(){e(this,L).x=0,e(this,L).y=0}clearDocumentState(){r(this,X,null)}saveScrollState(){e(this,C).documentElement.hasAttribute("data-no-scroll-restoration")?(e(this,L).x=0,e(this,L).y=0):(e(this,L).x=e(this,R).scrollValue.left,e(this,L).y=e(this,R).scrollValue.top)}restoreScrollPosition(){e(this,R).scrollElement.scroll({top:e(this,L).y,left:e(this,L).x,behavior:"instant"})}saveDocumentState(){e(this,C).documentElement.hasAttribute("data-no-page-restoration")?r(this,X,null):r(this,X,document.cloneNode(!0))}renewScrollPosition(){e(this,R).scrollElement.scroll({top:0,left:0,behavior:"instant"})}saveState(t){r(this,Q,t)}clearState(){const t=e(this,Q);return r(this,Q,null),t}}R=new WeakMap,Y=new WeakMap,L=new WeakMap,C=new WeakMap,X=new WeakMap,I=new WeakMap,Q=new WeakMap,j=new WeakMap,V=new WeakMap,Z=new WeakMap;var T,_,g,F,m,K,B,x,A,at,N,$,tt,et,ot,c,dt,Lt,Ot,bt,At,Pt,kt,mt,st;const nt=class nt{constructor(t){o(this,c);o(this,T,null);o(this,_,null);o(this,g,[]);o(this,F);o(this,m,null);o(this,K);o(this,B,[]);o(this,x,!1);o(this,A,null);o(this,at,!1);o(this,N,new Map);o(this,$,null);o(this,tt,0);o(this,et,0);o(this,ot,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"});o(this,mt,t=>W(this,null,function*(){var s;(s=t.state)!=null&&s.path&&(t.preventDefault(),r(this,x,!0),yield this.navigate(t.state.path,{historyAction:"none"}),r(this,x,!1))}));o(this,st,()=>{const{left:t,top:s}=this.scrollValue,i=s-e(this,et),d=t-e(this,tt);r(this,et,s),r(this,tt,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",d>0),document.documentElement.classList.toggle("scroll-x-backward",d<0),U.dispatchEvent(document,"morphScroll",{detail:{left:t,top:s}})});if(Ft.isBrowser&&!nt.instance){nt.instance=this,r(this,T,{base:it.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}),r(this,_,E(this,c,Lt).call(this,document.body));const s=this.normalizePath(location.pathname+location.hash+location.search);r(this,m,s);const i=new Vt(this,e(this,m).pathname);i.setInitialDocument(document),e(this,N).set(e(this,m).path,i),document.documentElement.setAttribute("data-current-pathname",e(this,m).pathname),document.documentElement.setAttribute("data-current-leaf",s.leaf),this.findLinks(),history.scrollRestoration="manual",addEventListener("popstate",e(this,mt)),it.changeHistory({action:"replace",pathname:s.pathname,searchParameters:s.parameters,hash:s.hash}),r(this,$,new Bt),E(this,c,Pt).call(this,document)}}get currentURL(){return e(this,m)}get previousURL(){return e(this,K)}get links(){return e(this,g)}get scrollElement(){return e(this,A)}get isPopstateNavigation(){return e(this,x)}get scrollValue(){let t=0,s=0;return e(this,at)?(t=window.scrollY,s=window.scrollX):(t=e(this,A).scrollTop,s=e(this,A).scrollLeft),{top:t,left:s}}saveState(t){const s=e(this,N).get(e(this,m).path);s&&s.saveState(t)}getState(){const t=e(this,N).get(e(this,m).path);return t==null?void 0:t.clearState()}normalizePath(t){return it.splitPath(t,{base:e(this,T).base,trailingSlash:e(this,T).trailingSlash})}prefetch(t,s){return W(this,null,function*(){if(e(this,B).length)return;const i=E(this,c,dt).call(this,t);i==null||i.fetch(t,s)})}navigate(O){return W(this,arguments,function*(t,{historyAction:s="push",centerScroll:i,offsetScroll:d,revalidate:y,keepSearchParameters:P,submorph:w,clearState:v}={}){var lt,ht,Ct;if(e(this,B).length)return;const h=this.normalizePath(((lt=this.pathnameModifier)==null?void 0:lt.call(this,t))||t);if(((ht=e(this,F))==null?void 0:ht.pathname)===h.pathname||e(this,m).pathname===h.pathname){e(this,x)||E(this,c,kt).call(this,h.hash||0,{centerScroll:i,offsetScroll:d,behavior:"smooth"}),((Ct=e(this,m))==null?void 0:Ct.parameters)!==h.parameters&&(r(this,K,e(this,m)),r(this,m,h),it.changeHistory({action:s,pathname:h.pathname,searchParameters:h.parameters,hash:h.hash}),U.dispatchEvent(document,"morphURLParametersChange",{detail:{newURL:e(this,m),previousURL:e(this,K)}}));return}r(this,F,h),e(this,g).forEach(G=>{G.checkCurrent(h.pathname)});try{let G=!0;if(this.preprocessor)try{yield new Promise((a,M)=>{var p;(p=this.preprocessor)==null||p.call(this,{url:h,resolve:a,reject:M,submorph:w})})}catch(a){a?console.error(a):console.log("Route change canceled"),G=!1}if(!G||e(this,F).pathname!==h.pathname){e(this,g).forEach(a=>{a.checkCurrent(e(this,m).pathname)});return}const Tt={url:h,submorph:w};U.dispatchEvent(document,"morphNavigation",{detail:Tt});const ft=E(this,c,dt).call(this,e(this,m).pathname),f=E(this,c,dt).call(this,t);if(e(this,N).forEach(a=>{a.pathname!==h.pathname&&a.abort()}),yield f==null?void 0:f.fetch(t,y),e(this,F).pathname!==h.pathname){e(this,g).forEach(a=>{a.checkCurrent(e(this,m).path)});return}ft.clearState(),ft.saveScrollState(),ft.saveDocumentState(),e(this,x)||(f.clearScrollState(),f.clearDocumentState()),v&&f.clearState(),f.cloneDocument(),e(this,$).textContent=f.title,document.body.appendChild(e(this,$));const pt=vt(gt({},Tt),{document:f.document});U.dispatchEvent(document,"morphStart",{detail:pt});const Mt=Array.from(document.head.children),Ht=Array.from(f.document.head.children),Rt=E(this,c,Ot).call(this,Mt,Ht),Wt=E(this,c,bt).call(this,Mt,Rt),ct=E(this,c,bt).call(this,Ht,Rt);ct.forEach((a,M)=>{if(a.tagName==="SCRIPT"&&a.getAttribute("src")){const p=document.createElement("script"),q=a.getAttribute("src");q.includes("http")||(p.type="module"),p.src=q,ct[M]=p}}),ct.forEach(a=>{document.head.appendChild(a)});const Et=ct.filter(a=>{if(a.hasAttribute("data-no-waiting"))return!1;if(E(this,c,At).call(this,a))return!0});e(this,T).waitForHeadToLoad&&Et.length&&(yield new Promise(a=>W(this,null,function*(){let M=0;try{for(var p=zt(Et),q,b,k;q=!(b=yield p.next()).done;q=!1){const ut=b.value;ut.onload=()=>{M++,M===Et.length&&a()}}}catch(b){k=[b]}finally{try{q&&(b=p.return)&&(yield b.call(p))}finally{if(k)throw k[0]}}}))),yield It.wait(10);const xt=[];Wt.forEach(a=>{a.hasAttribute("data-permanent")||(E(this,c,At).call(this,a)?xt.push(a):a.remove())});const Yt=E(this,c,Lt).call(this,f.document.body);e(this,T).morphInsideScrollContainer||E(this,c,Pt).call(this,f.document),document.documentElement.setAttribute("data-current-pathname",h.pathname),document.documentElement.setAttribute("data-current-leaf",h.leaf),it.changeHistory({action:s,pathname:h.pathname,searchParameters:h.parameters||(P?location.search:""),hash:h.hash}),e(this,$).remove(),r(this,K,e(this,m)),r(this,m,h),e(this,_).forEach((a,M)=>{const p=Yt[M],q=getComputedStyle(a).getPropertyValue("--morph-duration");let b=[],k=[];w?w.forEach(u=>{const S=a.querySelector(u),D=p.querySelector(u);S&&D&&(k.push(S),b.push(D))}):(b.push(...p.childNodes),k.push(...a.childNodes)),k.forEach(u=>{u instanceof HTMLElement&&(this.destroyOldLinks(u),u.classList.add("old"))}),b.forEach(u=>{u instanceof HTMLElement&&(this.findNewLinks(u),u.classList.add("new"))}),w?b.forEach((u,S)=>{var D;(D=k[S].parentElement)==null||D.insertBefore(u,k[S])}):a.prepend(...b),Qt.requestIdleCallback(()=>{k.forEach(u=>{u instanceof HTMLElement&&u.classList.add("old-idle")}),b.forEach(u=>{var S;u instanceof HTMLElement&&((S=u.parentElement)==null||S.style.setProperty("--new-content-height",u.offsetHeight+"px"),u.classList.add("new-idle"))})});const ut=vt(gt({},pt),{morphElement:a});U.dispatchEvent(document,"morphNewChildrenAdded",{detail:ut});const Xt=new Promise(u=>{setTimeout(()=>{k.forEach(S=>S.remove()),b.forEach(S=>{var D;S instanceof HTMLElement&&((D=S.parentElement)==null||D.style.removeProperty("--new-content-height"),S.classList.remove("new-idle","new"))}),U.dispatchEvent(document,"morphOldChildrenRemoved",{detail:ut}),u()},(parseFloat(q)||0)*1e3+10)});e(this,B).push(Xt)}),this.isPopstateNavigation?document.documentElement.style.setProperty("--new-document-scroll-position",(this.scrollValue.top-f.scrollState.y)*1+"px"):document.documentElement.style.setProperty("--new-document-scroll-position",this.scrollValue.top+"px"),U.dispatchEvent(document,"morphBeforeNavigationScroll",{detail:f.scrollState}),h.hash?(f.clearScrollState(),E(this,c,kt).call(this,h.hash,{centerScroll:i,offsetScroll:d})):e(this,x)?f.restoreScrollPosition():f.renewScrollPosition(),yield Promise.all(e(this,B)),xt.forEach(a=>a.remove()),r(this,B,[]),e(this,_).forEach(a=>{a.querySelectorAll("script").forEach(p=>{const q=document.createElement("script");for(let b=0;b<p.attributes.length;b++){const k=p.attributes[b];q.setAttribute(k.name,k.value)}p.hasAttribute("src")||(q.innerHTML=p.innerHTML),p.replaceWith(q)})}),U.dispatchEvent(document,"morphComplete",{detail:pt}),document.documentElement.style.removeProperty("--new-document-scroll-position"),window.dispatchEvent(new Event("resize"))}catch(G){console.error(G)}r(this,F,void 0)})}addLink(t){e(this,g).push(new wt(t,this))}addLinks(t){t.forEach(s=>{this.addLink(s)})}removeLink(t){r(this,g,e(this,g).filter(s=>s.element===t?(s.destroy(),!1):!0))}destroyOldLinks(t){r(this,g,e(this,g).filter(s=>t.contains(s.element)?(s.destroy(),!1):!0))}findNewLinks(t){const s=[...t.querySelectorAll("a")].filter(e(this,ot));e(this,g).push(...s.map(i=>new wt(i,this)))}findLinks(){const t=[...document.documentElement.querySelectorAll("a")].filter(e(this,ot));e(this,g).forEach(s=>s.destroy()),r(this,g,t.map(s=>new wt(s,this)))}};T=new WeakMap,_=new WeakMap,g=new WeakMap,F=new WeakMap,m=new WeakMap,K=new WeakMap,B=new WeakMap,x=new WeakMap,A=new WeakMap,at=new WeakMap,N=new WeakMap,$=new WeakMap,tt=new WeakMap,et=new WeakMap,ot=new WeakMap,c=new WeakSet,dt=function(t){const s=this.normalizePath(t);let i=e(this,N).get(s.pathname);return i||(i=new Vt(this,s.pathname),e(this,N).set(s.pathname,i)),i},Lt=function(t){const s=[...t.querySelectorAll("[data-morph]")];return s.length?s:[t]},Ot=function(t,s){return t.filter(i=>s.find(d=>d.outerHTML===i.outerHTML))},bt=function(t,s){return t.filter(i=>!s.find(d=>d.outerHTML===i.outerHTML))},At=function(t){return t.tagName==="SCRIPT"||t.tagName==="STYLE"||t.tagName==="LINK"&&t.getAttribute("rel")==="stylesheet"},Pt=function(t){var s,i;(s=e(this,A))==null||s.removeEventListener("scroll",e(this,st)),r(this,et,0),r(this,tt,0),r(this,A,e(this,T).scrollSelector&&t.querySelector(e(this,T).scrollSelector)||window),r(this,at,e(this,A)===window),(i=e(this,A))==null||i.addEventListener("scroll",e(this,st)),e(this,st).call(this)},kt=function(t,s){const i=typeof t=="string"?document.getElementById(t):t;(typeof i=="number"||i)&&It.scrollToElement(i,{scrollElement:e(this,A),behavior:(s==null?void 0:s.behavior)||"instant",center:s==null?void 0:s.centerScroll,offset:s==null?void 0:s.offsetScroll})},mt=new WeakMap,st=new WeakMap,nt.instance=null;let yt=nt;exports.Morph=yt;
|
|
1
|
+
"use strict";var jt=Object.defineProperty,Kt=Object.defineProperties;var $t=Object.getOwnPropertyDescriptors;var Nt=Object.getOwnPropertySymbols;var Gt=Object.prototype.hasOwnProperty,Jt=Object.prototype.propertyIsEnumerable;var qt=(n,t)=>(t=Symbol[n])?t:Symbol.for("Symbol."+n),Ut=n=>{throw TypeError(n)};var Dt=(n,t,s)=>t in n?jt(n,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):n[t]=s,gt=(n,t)=>{for(var s in t||(t={}))Gt.call(t,s)&&Dt(n,s,t[s]);if(Nt)for(var s of Nt(t))Jt.call(t,s)&&Dt(n,s,t[s]);return n},vt=(n,t)=>Kt(n,$t(t));var St=(n,t,s)=>t.has(n)||Ut("Cannot "+s);var e=(n,t,s)=>(St(n,t,"read from private field"),s?s.call(n):t.get(n)),o=(n,t,s)=>t.has(n)?Ut("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(n):t.set(n,s),r=(n,t,s,i)=>(St(n,t,"write to private field"),i?i.call(n,s):t.set(n,s),s),E=(n,t,s)=>(St(n,t,"access private method"),s);var W=(n,t,s)=>new Promise((i,d)=>{var y=v=>{try{w(s.next(v))}catch(O){d(O)}},P=v=>{try{w(s.throw(v))}catch(O){d(O)}},w=v=>v.done?i(v.value):Promise.resolve(v.value).then(y,P);w((s=s.apply(n,t)).next())});var zt=(n,t,s)=>(t=n[qt("asyncIterator")])?t.call(n):(n=n[qt("iterator")](),t={},s=(i,d)=>(d=n[i])&&(t[i]=y=>new Promise((P,w,v)=>(y=d.call(n,y),v=y.done,Promise.resolve(y.value).then(O=>P({value:O,done:v}),w)))),s("next"),s("return"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Ft=require("../index-DekP7OZe.cjs"),U=require("../events-KVanG9sR.cjs"),Qt=require("../polyfills-Df4r-ETT.cjs"),It=require("../scroll-CIdNtj3G.cjs");require("construct-style-sheets-polyfill");const it=require("../url-YEESIcRn.cjs"),Zt=require("../css-value-parser/index.cjs");class Bt 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)}}Ft.isBrowser&&!customElements.get("morph-announcer")&&customElements.define("morph-announcer",Bt);var H,l,z,rt,J;class wt{constructor(t,s){o(this,H);o(this,l);o(this,z);o(this,rt,t=>{var i;if(t.preventDefault(),e(this,l).hasAttribute("data-back")&&e(this,H).previousURL)history.back();else{r(this,z,e(this,l).getAttribute("href")||"/");const d=e(this,l).getAttribute("data-history-action")||"push",y=e(this,l).hasAttribute("data-center-scroll"),P=getComputedStyle(e(this,l)).getPropertyValue("--offset-scroll").trim(),w=P?Zt.cssValueParser.parse(P):void 0,v=e(this,l).hasAttribute("data-revalidate"),O=e(this,l).hasAttribute("data-keep-search-parameters"),h=(i=e(this,l).getAttribute("data-submorph"))==null?void 0:i.split(",").map(ht=>ht.trim()),lt=e(this,l).hasAttribute("data-clear-state");e(this,H).navigate(e(this,z),{historyAction:d,centerScroll:y,offsetScroll:w,revalidate:v,keepSearchParameters:O,submorph:h,clearState:lt})}});o(this,J,()=>{const t=e(this,l).hasAttribute("data-revalidate");e(this,H).prefetch(e(this,z),t),e(this,l).removeEventListener("pointerenter",e(this,J))});r(this,H,s),r(this,l,t),r(this,z,e(this,l).getAttribute("href")||"/"),e(this,l).addEventListener("click",e(this,rt)),this.checkCurrent(location.pathname),e(this,l).hasAttribute("data-prefetch")&&e(this,l).addEventListener("pointerenter",e(this,J))}get element(){return e(this,l)}checkCurrent(t){const s=e(this,H).normalizePath(t),i=e(this,H).normalizePath(e(this,z));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,rt)),e(this,l).removeEventListener("pointerenter",e(this,J)),e(this,l).classList.remove("current")}}H=new WeakMap,l=new WeakMap,z=new WeakMap,rt=new WeakMap,J=new WeakMap;const _t=new DOMParser;var R,Y,L,C,X,I,Q,j,V,Z;class Vt{constructor(t,s){o(this,R);o(this,Y);o(this,L,{x:0,y:0});o(this,C,null);o(this,X,null);o(this,I,null);o(this,Q,null);o(this,j,null);o(this,V,null);o(this,Z);r(this,R,t),r(this,Y,s),r(this,Z,s)}get pathname(){return e(this,Y)}get scrollState(){return e(this,L)}get document(){return e(this,I)}setInitialDocument(t){r(this,C,t.cloneNode(!0))}abort(){var t;return(t=e(this,j))==null?void 0:t.abort(`[${e(this,Y)}] page loading cancelled`)}fetch(t,s){return W(this,null,function*(){return e(this,V)||e(this,C)&&e(this,C).documentElement.hasAttribute("data-cache")&&!s&&e(this,Z)!==t||e(this,C)&&e(this,R).isPopstateNavigation?e(this,V):(r(this,V,new Promise(i=>W(this,null,function*(){try{r(this,j,new AbortController);const y=yield(yield fetch(t,{signal:e(this,j).signal})).text(),P=_t.parseFromString(y,"text/html");this.setInitialDocument(P)}catch(d){console.warn(d)}finally{r(this,Z,t),r(this,j,null),r(this,V,null),i()}}))),e(this,V))})}cloneDocument(){r(this,I,(e(this,X)||e(this,C)).cloneNode(!0))}get title(){let t="";if(e(this,I).title)t=e(this,I).title;else{const s=e(this,I).querySelector("h1");t=(s==null?void 0:s.innerText)||(s==null?void 0:s.textContent)||e(this,Y)}return t}clearScrollState(){e(this,L).x=0,e(this,L).y=0}clearDocumentState(){r(this,X,null)}saveScrollState(){e(this,C).documentElement.hasAttribute("data-no-scroll-restoration")?(e(this,L).x=0,e(this,L).y=0):(e(this,L).x=e(this,R).scrollValue.left,e(this,L).y=e(this,R).scrollValue.top)}restoreScrollPosition(){e(this,R).scrollElement.scroll({top:e(this,L).y,left:e(this,L).x,behavior:"instant"})}saveDocumentState(){e(this,C).documentElement.hasAttribute("data-no-page-restoration")?r(this,X,null):r(this,X,document.cloneNode(!0))}renewScrollPosition(){e(this,R).scrollElement.scroll({top:0,left:0,behavior:"instant"})}saveState(t){r(this,Q,t)}clearState(){const t=e(this,Q);return r(this,Q,null),t}}R=new WeakMap,Y=new WeakMap,L=new WeakMap,C=new WeakMap,X=new WeakMap,I=new WeakMap,Q=new WeakMap,j=new WeakMap,V=new WeakMap,Z=new WeakMap;var T,_,g,F,m,K,B,x,A,at,N,$,tt,et,ot,c,dt,Lt,Ot,bt,At,Pt,kt,mt,st;const nt=class nt{constructor(t){o(this,c);o(this,T,null);o(this,_,null);o(this,g,[]);o(this,F);o(this,m,null);o(this,K);o(this,B,[]);o(this,x,!1);o(this,A,null);o(this,at,!1);o(this,N,new Map);o(this,$,null);o(this,tt,0);o(this,et,0);o(this,ot,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"});o(this,mt,t=>W(this,null,function*(){var s;(s=t.state)!=null&&s.path&&(t.preventDefault(),r(this,x,!0),yield this.navigate(t.state.path,{historyAction:"none"}),r(this,x,!1))}));o(this,st,()=>{const{left:t,top:s}=this.scrollValue,i=s-e(this,et),d=t-e(this,tt);r(this,et,s),r(this,tt,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",d>0),document.documentElement.classList.toggle("scroll-x-backward",d<0),U.dispatchEvent(document,"morphScroll",{detail:{left:t,top:s}})});if(Ft.isBrowser&&!nt.instance){nt.instance=this,r(this,T,{base:it.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}),r(this,_,E(this,c,Lt).call(this,document.body));const s=this.normalizePath(location.pathname+location.hash+location.search);r(this,m,s);const i=new Vt(this,e(this,m).pathname);i.setInitialDocument(document),e(this,N).set(e(this,m).pathname,i),document.documentElement.setAttribute("data-current-pathname",e(this,m).pathname),document.documentElement.setAttribute("data-current-leaf",s.leaf),this.findLinks(),history.scrollRestoration="manual",addEventListener("popstate",e(this,mt)),it.changeHistory({action:"replace",pathname:s.pathname,searchParameters:s.parameters,hash:s.hash}),r(this,$,new Bt),E(this,c,Pt).call(this,document)}}get currentURL(){return e(this,m)}get previousURL(){return e(this,K)}get links(){return e(this,g)}get scrollElement(){return e(this,A)}get isPopstateNavigation(){return e(this,x)}get scrollValue(){let t=0,s=0;return e(this,at)?(t=window.scrollY,s=window.scrollX):(t=e(this,A).scrollTop,s=e(this,A).scrollLeft),{top:t,left:s}}saveState(t){const s=e(this,N).get(e(this,m).path);s&&s.saveState(t)}getState(){const t=e(this,N).get(e(this,m).path);return t==null?void 0:t.clearState()}normalizePath(t){return it.splitPath(t,{base:e(this,T).base,trailingSlash:e(this,T).trailingSlash})}prefetch(t,s){return W(this,null,function*(){if(e(this,B).length)return;const i=E(this,c,dt).call(this,t);i==null||i.fetch(t,s)})}navigate(O){return W(this,arguments,function*(t,{historyAction:s="push",centerScroll:i,offsetScroll:d,revalidate:y,keepSearchParameters:P,submorph:w,clearState:v}={}){var lt,ht,Ct;if(e(this,B).length)return;const h=this.normalizePath(((lt=this.pathnameModifier)==null?void 0:lt.call(this,t))||t);if(((ht=e(this,F))==null?void 0:ht.pathname)===h.pathname||e(this,m).pathname===h.pathname){e(this,x)||E(this,c,kt).call(this,h.hash||0,{centerScroll:i,offsetScroll:d,behavior:"smooth"}),((Ct=e(this,m))==null?void 0:Ct.parameters)!==h.parameters&&(r(this,K,e(this,m)),r(this,m,h),it.changeHistory({action:s,pathname:h.pathname,searchParameters:h.parameters,hash:h.hash}),U.dispatchEvent(document,"morphURLParametersChange",{detail:{newURL:e(this,m),previousURL:e(this,K)}}));return}r(this,F,h),e(this,g).forEach(G=>{G.checkCurrent(h.pathname)});try{let G=!0;if(this.preprocessor)try{yield new Promise((a,M)=>{var p;(p=this.preprocessor)==null||p.call(this,{url:h,resolve:a,reject:M,submorph:w})})}catch(a){a?console.error(a):console.log("Route change canceled"),G=!1}if(!G||e(this,F).pathname!==h.pathname){e(this,g).forEach(a=>{a.checkCurrent(e(this,m).pathname)});return}const Tt={url:h,submorph:w};U.dispatchEvent(document,"morphNavigation",{detail:Tt});const ft=E(this,c,dt).call(this,e(this,m).pathname),f=E(this,c,dt).call(this,h.pathname);if(e(this,N).forEach(a=>{a.pathname!==h.pathname&&a.abort()}),yield f==null?void 0:f.fetch(t,y),e(this,F).pathname!==h.pathname){e(this,g).forEach(a=>{a.checkCurrent(e(this,m).path)});return}ft.clearState(),ft.saveScrollState(),ft.saveDocumentState(),e(this,x)||(f.clearScrollState(),f.clearDocumentState()),v&&f.clearState(),f.cloneDocument(),e(this,$).textContent=f.title,document.body.appendChild(e(this,$));const pt=vt(gt({},Tt),{document:f.document});U.dispatchEvent(document,"morphStart",{detail:pt});const Mt=Array.from(document.head.children),Ht=Array.from(f.document.head.children),Rt=E(this,c,Ot).call(this,Mt,Ht),Wt=E(this,c,bt).call(this,Mt,Rt),ct=E(this,c,bt).call(this,Ht,Rt);ct.forEach((a,M)=>{if(a.tagName==="SCRIPT"&&a.getAttribute("src")){const p=document.createElement("script"),q=a.getAttribute("src");q.includes("http")||(p.type="module"),p.src=q,ct[M]=p}}),ct.forEach(a=>{document.head.appendChild(a)});const Et=ct.filter(a=>{if(a.hasAttribute("data-no-waiting"))return!1;if(E(this,c,At).call(this,a))return!0});e(this,T).waitForHeadToLoad&&Et.length&&(yield new Promise(a=>W(this,null,function*(){let M=0;try{for(var p=zt(Et),q,b,k;q=!(b=yield p.next()).done;q=!1){const ut=b.value;ut.onload=()=>{M++,M===Et.length&&a()}}}catch(b){k=[b]}finally{try{q&&(b=p.return)&&(yield b.call(p))}finally{if(k)throw k[0]}}}))),yield It.wait(10);const xt=[];Wt.forEach(a=>{a.hasAttribute("data-permanent")||(E(this,c,At).call(this,a)?xt.push(a):a.remove())});const Yt=E(this,c,Lt).call(this,f.document.body);e(this,T).morphInsideScrollContainer||E(this,c,Pt).call(this,f.document),document.documentElement.setAttribute("data-current-pathname",h.pathname),document.documentElement.setAttribute("data-current-leaf",h.leaf),it.changeHistory({action:s,pathname:h.pathname,searchParameters:h.parameters||(P?location.search:""),hash:h.hash}),e(this,$).remove(),r(this,K,e(this,m)),r(this,m,h),e(this,_).forEach((a,M)=>{const p=Yt[M],q=getComputedStyle(a).getPropertyValue("--morph-duration");let b=[],k=[];w?w.forEach(u=>{const S=a.querySelector(u),D=p.querySelector(u);S&&D&&(k.push(S),b.push(D))}):(b.push(...p.childNodes),k.push(...a.childNodes)),k.forEach(u=>{u instanceof HTMLElement&&(this.destroyOldLinks(u),u.classList.add("old"))}),b.forEach(u=>{u instanceof HTMLElement&&(this.findNewLinks(u),u.classList.add("new"))}),w?b.forEach((u,S)=>{var D;(D=k[S].parentElement)==null||D.insertBefore(u,k[S])}):a.prepend(...b),Qt.requestIdleCallback(()=>{k.forEach(u=>{u instanceof HTMLElement&&u.classList.add("old-idle")}),b.forEach(u=>{var S;u instanceof HTMLElement&&((S=u.parentElement)==null||S.style.setProperty("--new-content-height",u.offsetHeight+"px"),u.classList.add("new-idle"))})});const ut=vt(gt({},pt),{morphElement:a});U.dispatchEvent(document,"morphNewChildrenAdded",{detail:ut});const Xt=new Promise(u=>{setTimeout(()=>{k.forEach(S=>S.remove()),b.forEach(S=>{var D;S instanceof HTMLElement&&((D=S.parentElement)==null||D.style.removeProperty("--new-content-height"),S.classList.remove("new-idle","new"))}),U.dispatchEvent(document,"morphOldChildrenRemoved",{detail:ut}),u()},(parseFloat(q)||0)*1e3+10)});e(this,B).push(Xt)}),this.isPopstateNavigation?document.documentElement.style.setProperty("--new-document-scroll-position",(this.scrollValue.top-f.scrollState.y)*1+"px"):document.documentElement.style.setProperty("--new-document-scroll-position",this.scrollValue.top+"px"),U.dispatchEvent(document,"morphBeforeNavigationScroll",{detail:f.scrollState}),h.hash?(f.clearScrollState(),E(this,c,kt).call(this,h.hash,{centerScroll:i,offsetScroll:d})):e(this,x)?f.restoreScrollPosition():f.renewScrollPosition(),yield Promise.all(e(this,B)),xt.forEach(a=>a.remove()),r(this,B,[]),e(this,_).forEach(a=>{a.querySelectorAll("script").forEach(p=>{const q=document.createElement("script");for(let b=0;b<p.attributes.length;b++){const k=p.attributes[b];q.setAttribute(k.name,k.value)}p.hasAttribute("src")||(q.innerHTML=p.innerHTML),p.replaceWith(q)})}),U.dispatchEvent(document,"morphComplete",{detail:pt}),document.documentElement.style.removeProperty("--new-document-scroll-position"),window.dispatchEvent(new Event("resize"))}catch(G){console.error(G)}r(this,F,void 0)})}addLink(t){e(this,g).push(new wt(t,this))}addLinks(t){t.forEach(s=>{this.addLink(s)})}removeLink(t){r(this,g,e(this,g).filter(s=>s.element===t?(s.destroy(),!1):!0))}destroyOldLinks(t){r(this,g,e(this,g).filter(s=>t.contains(s.element)?(s.destroy(),!1):!0))}findNewLinks(t){const s=[...t.querySelectorAll("a")].filter(e(this,ot));e(this,g).push(...s.map(i=>new wt(i,this)))}findLinks(){const t=[...document.documentElement.querySelectorAll("a")].filter(e(this,ot));e(this,g).forEach(s=>s.destroy()),r(this,g,t.map(s=>new wt(s,this)))}};T=new WeakMap,_=new WeakMap,g=new WeakMap,F=new WeakMap,m=new WeakMap,K=new WeakMap,B=new WeakMap,x=new WeakMap,A=new WeakMap,at=new WeakMap,N=new WeakMap,$=new WeakMap,tt=new WeakMap,et=new WeakMap,ot=new WeakMap,c=new WeakSet,dt=function(t){const s=this.normalizePath(t);let i=e(this,N).get(s.pathname);return i||(i=new Vt(this,s.pathname),e(this,N).set(s.pathname,i)),i},Lt=function(t){const s=[...t.querySelectorAll("[data-morph]")];return s.length?s:[t]},Ot=function(t,s){return t.filter(i=>s.find(d=>d.outerHTML===i.outerHTML))},bt=function(t,s){return t.filter(i=>!s.find(d=>d.outerHTML===i.outerHTML))},At=function(t){return t.tagName==="SCRIPT"||t.tagName==="STYLE"||t.tagName==="LINK"&&t.getAttribute("rel")==="stylesheet"},Pt=function(t){var s,i;(s=e(this,A))==null||s.removeEventListener("scroll",e(this,st)),r(this,et,0),r(this,tt,0),r(this,A,e(this,T).scrollSelector&&t.querySelector(e(this,T).scrollSelector)||window),r(this,at,e(this,A)===window),(i=e(this,A))==null||i.addEventListener("scroll",e(this,st)),e(this,st).call(this)},kt=function(t,s){const i=typeof t=="string"?document.getElementById(t):t;(typeof i=="number"||i)&&It.scrollToElement(i,{scrollElement:e(this,A),behavior:(s==null?void 0:s.behavior)||"instant",center:s==null?void 0:s.centerScroll,offset:s==null?void 0:s.offsetScroll})},mt=new WeakMap,st=new WeakMap,nt.instance=null;let yt=nt;exports.Morph=yt;
|
package/lib/morph/index.js
CHANGED
|
@@ -2,20 +2,20 @@ var Xt = Object.defineProperty, jt = Object.defineProperties;
|
|
|
2
2
|
var Kt = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var xt = Object.getOwnPropertySymbols;
|
|
4
4
|
var $t = Object.prototype.hasOwnProperty, Gt = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var Nt = (
|
|
6
|
-
throw TypeError(
|
|
5
|
+
var Nt = (n, t) => (t = Symbol[n]) ? t : Symbol.for("Symbol." + n), Ut = (n) => {
|
|
6
|
+
throw TypeError(n);
|
|
7
7
|
};
|
|
8
|
-
var Dt = (
|
|
8
|
+
var Dt = (n, t, s) => t in n ? Xt(n, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : n[t] = s, Et = (n, t) => {
|
|
9
9
|
for (var s in t || (t = {}))
|
|
10
|
-
$t.call(t, s) && Dt(
|
|
10
|
+
$t.call(t, s) && Dt(n, s, t[s]);
|
|
11
11
|
if (xt)
|
|
12
12
|
for (var s of xt(t))
|
|
13
|
-
Gt.call(t, s) && Dt(
|
|
14
|
-
return
|
|
15
|
-
}, gt = (
|
|
16
|
-
var wt = (
|
|
17
|
-
var e = (
|
|
18
|
-
var W = (
|
|
13
|
+
Gt.call(t, s) && Dt(n, s, t[s]);
|
|
14
|
+
return n;
|
|
15
|
+
}, gt = (n, t) => jt(n, Kt(t));
|
|
16
|
+
var wt = (n, t, s) => t.has(n) || Ut("Cannot " + s);
|
|
17
|
+
var e = (n, t, s) => (wt(n, t, "read from private field"), s ? s.call(n) : t.get(n)), o = (n, t, s) => t.has(n) ? Ut("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(n) : t.set(n, s), r = (n, t, s, i) => (wt(n, t, "write to private field"), i ? i.call(n, s) : t.set(n, s), s), E = (n, t, s) => (wt(n, t, "access private method"), s);
|
|
18
|
+
var W = (n, t, s) => new Promise((i, d) => {
|
|
19
19
|
var v = (w) => {
|
|
20
20
|
try {
|
|
21
21
|
L(s.next(w));
|
|
@@ -29,9 +29,9 @@ var W = (r, t, s) => new Promise((i, d) => {
|
|
|
29
29
|
d(O);
|
|
30
30
|
}
|
|
31
31
|
}, L = (w) => w.done ? i(w.value) : Promise.resolve(w.value).then(v, k);
|
|
32
|
-
L((s = s.apply(
|
|
32
|
+
L((s = s.apply(n, t)).next());
|
|
33
33
|
});
|
|
34
|
-
var zt = (
|
|
34
|
+
var zt = (n, t, s) => (t = n[Nt("asyncIterator")]) ? t.call(n) : (n = n[Nt("iterator")](), t = {}, s = (i, d) => (d = n[i]) && (t[i] = (v) => new Promise((k, L, w) => (v = d.call(n, v), w = v.done, Promise.resolve(v.value).then((O) => k({ value: O, done: w }), L)))), s("next"), s("return"), t);
|
|
35
35
|
import { i as qt } from "../index-Bv9zgfdb.js";
|
|
36
36
|
import { d as z } from "../events-CsVF98U6.js";
|
|
37
37
|
import { r as Jt } from "../polyfills-DJrTJQky.js";
|
|
@@ -51,23 +51,23 @@ class Ft extends HTMLElement {
|
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
qt && !customElements.get("morph-announcer") && customElements.define("morph-announcer", Ft);
|
|
54
|
-
var R, l, I,
|
|
54
|
+
var R, l, I, nt, J;
|
|
55
55
|
class Lt {
|
|
56
56
|
constructor(t, s) {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
57
|
+
o(this, R);
|
|
58
|
+
o(this, l);
|
|
59
|
+
o(this, I);
|
|
60
|
+
o(this, nt, (t) => {
|
|
61
61
|
var i;
|
|
62
62
|
if (t.preventDefault(), e(this, l).hasAttribute("data-back") && e(this, R).previousURL)
|
|
63
63
|
history.back();
|
|
64
64
|
else {
|
|
65
|
-
|
|
65
|
+
r(this, I, e(this, l).getAttribute("href") || "/");
|
|
66
66
|
const d = e(this, l).getAttribute(
|
|
67
67
|
"data-history-action"
|
|
68
68
|
) || "push", v = e(this, l).hasAttribute("data-center-scroll"), k = getComputedStyle(e(this, l)).getPropertyValue("--offset-scroll").trim(), L = k ? ee.parse(k) : void 0, w = e(this, l).hasAttribute("data-revalidate"), O = e(this, l).hasAttribute(
|
|
69
69
|
"data-keep-search-parameters"
|
|
70
|
-
), h = (i = e(this, l).getAttribute("data-submorph")) == null ? void 0 : i.split(",").map((lt) => lt.trim()),
|
|
70
|
+
), h = (i = e(this, l).getAttribute("data-submorph")) == null ? void 0 : i.split(",").map((lt) => lt.trim()), ot = e(this, l).hasAttribute("data-clear-state");
|
|
71
71
|
e(this, R).navigate(e(this, I), {
|
|
72
72
|
historyAction: d,
|
|
73
73
|
centerScroll: v,
|
|
@@ -75,15 +75,15 @@ class Lt {
|
|
|
75
75
|
revalidate: w,
|
|
76
76
|
keepSearchParameters: O,
|
|
77
77
|
submorph: h,
|
|
78
|
-
clearState:
|
|
78
|
+
clearState: ot
|
|
79
79
|
});
|
|
80
80
|
}
|
|
81
81
|
});
|
|
82
|
-
|
|
82
|
+
o(this, J, () => {
|
|
83
83
|
const t = e(this, l).hasAttribute("data-revalidate");
|
|
84
84
|
e(this, R).prefetch(e(this, I), t), e(this, l).removeEventListener("pointerenter", e(this, J));
|
|
85
85
|
});
|
|
86
|
-
|
|
86
|
+
r(this, R, s), r(this, l, t), r(this, I, e(this, l).getAttribute("href") || "/"), e(this, l).addEventListener("click", e(this, nt)), this.checkCurrent(location.pathname), e(this, l).hasAttribute("data-prefetch") && e(this, l).addEventListener("pointerenter", e(this, J));
|
|
87
87
|
}
|
|
88
88
|
get element() {
|
|
89
89
|
return e(this, l);
|
|
@@ -93,25 +93,25 @@ class Lt {
|
|
|
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,
|
|
96
|
+
e(this, l).removeEventListener("click", e(this, nt)), e(this, l).removeEventListener("pointerenter", e(this, J)), e(this, l).classList.remove("current");
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
|
-
R = new WeakMap(), l = new WeakMap(), I = new WeakMap(),
|
|
99
|
+
R = new WeakMap(), l = new WeakMap(), I = new WeakMap(), nt = new WeakMap(), J = new WeakMap();
|
|
100
100
|
const se = new DOMParser();
|
|
101
101
|
var H, Y, y, C, X, V, Q, j, q, Z;
|
|
102
102
|
class It {
|
|
103
103
|
constructor(t, s) {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
104
|
+
o(this, H);
|
|
105
|
+
o(this, Y);
|
|
106
|
+
o(this, y, { x: 0, y: 0 });
|
|
107
|
+
o(this, C, null);
|
|
108
|
+
o(this, X, null);
|
|
109
|
+
o(this, V, null);
|
|
110
|
+
o(this, Q, null);
|
|
111
|
+
o(this, j, null);
|
|
112
|
+
o(this, q, null);
|
|
113
|
+
o(this, Z);
|
|
114
|
+
r(this, H, t), r(this, Y, s), r(this, Z, s);
|
|
115
115
|
}
|
|
116
116
|
get pathname() {
|
|
117
117
|
return e(this, Y);
|
|
@@ -123,7 +123,7 @@ class It {
|
|
|
123
123
|
return e(this, V);
|
|
124
124
|
}
|
|
125
125
|
setInitialDocument(t) {
|
|
126
|
-
|
|
126
|
+
r(this, C, t.cloneNode(!0));
|
|
127
127
|
}
|
|
128
128
|
abort() {
|
|
129
129
|
var t;
|
|
@@ -133,9 +133,9 @@ class It {
|
|
|
133
133
|
}
|
|
134
134
|
fetch(t, s) {
|
|
135
135
|
return W(this, null, function* () {
|
|
136
|
-
return e(this, q) || e(this, C) && e(this, C).documentElement.hasAttribute("data-cache") && !s && e(this, Z) !== t || e(this, C) && e(this, H).isPopstateNavigation ? e(this, q) : (
|
|
136
|
+
return e(this, q) || e(this, C) && e(this, C).documentElement.hasAttribute("data-cache") && !s && e(this, Z) !== t || e(this, C) && e(this, H).isPopstateNavigation ? e(this, q) : (r(this, q, new Promise((i) => W(this, null, function* () {
|
|
137
137
|
try {
|
|
138
|
-
|
|
138
|
+
r(this, j, new AbortController());
|
|
139
139
|
const v = yield (yield fetch(t, {
|
|
140
140
|
signal: e(this, j).signal
|
|
141
141
|
})).text(), k = se.parseFromString(v, "text/html");
|
|
@@ -143,13 +143,13 @@ class It {
|
|
|
143
143
|
} catch (d) {
|
|
144
144
|
console.warn(d);
|
|
145
145
|
} finally {
|
|
146
|
-
|
|
146
|
+
r(this, Z, t), r(this, j, null), r(this, q, null), i();
|
|
147
147
|
}
|
|
148
148
|
}))), e(this, q));
|
|
149
149
|
});
|
|
150
150
|
}
|
|
151
151
|
cloneDocument() {
|
|
152
|
-
|
|
152
|
+
r(this, V, (e(this, X) || e(this, C)).cloneNode(!0));
|
|
153
153
|
}
|
|
154
154
|
get title() {
|
|
155
155
|
let t = "";
|
|
@@ -165,7 +165,7 @@ class It {
|
|
|
165
165
|
e(this, y).x = 0, e(this, y).y = 0;
|
|
166
166
|
}
|
|
167
167
|
clearDocumentState() {
|
|
168
|
-
|
|
168
|
+
r(this, X, null);
|
|
169
169
|
}
|
|
170
170
|
saveScrollState() {
|
|
171
171
|
e(this, C).documentElement.hasAttribute(
|
|
@@ -182,7 +182,7 @@ class It {
|
|
|
182
182
|
saveDocumentState() {
|
|
183
183
|
e(this, C).documentElement.hasAttribute(
|
|
184
184
|
"data-no-page-restoration"
|
|
185
|
-
) ?
|
|
185
|
+
) ? r(this, X, null) : r(this, X, document.cloneNode(!0));
|
|
186
186
|
}
|
|
187
187
|
renewScrollPosition() {
|
|
188
188
|
e(this, H).scrollElement.scroll({
|
|
@@ -192,43 +192,43 @@ class It {
|
|
|
192
192
|
});
|
|
193
193
|
}
|
|
194
194
|
saveState(t) {
|
|
195
|
-
|
|
195
|
+
r(this, Q, t);
|
|
196
196
|
}
|
|
197
197
|
clearState() {
|
|
198
198
|
const t = e(this, Q);
|
|
199
|
-
return
|
|
199
|
+
return r(this, Q, null), t;
|
|
200
200
|
}
|
|
201
201
|
}
|
|
202
202
|
H = new WeakMap(), Y = new WeakMap(), y = new WeakMap(), C = new WeakMap(), X = new WeakMap(), V = new WeakMap(), Q = new WeakMap(), j = new WeakMap(), q = new WeakMap(), Z = new WeakMap();
|
|
203
|
-
var T, _, g, F, m, K, B, x, A,
|
|
203
|
+
var T, _, g, F, m, K, B, x, A, rt, N, $, tt, et, at, c, ut, vt, Bt, yt, bt, At, kt, dt, st;
|
|
204
204
|
const it = class it {
|
|
205
205
|
constructor(t) {
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
206
|
+
o(this, c);
|
|
207
|
+
o(this, T, null);
|
|
208
|
+
o(this, _, null);
|
|
209
|
+
o(this, g, []);
|
|
210
|
+
o(this, F);
|
|
211
|
+
o(this, m, null);
|
|
212
|
+
o(this, K);
|
|
213
|
+
o(this, B, []);
|
|
214
|
+
o(this, x, !1);
|
|
215
|
+
o(this, A, null);
|
|
216
|
+
o(this, rt, !1);
|
|
217
|
+
o(this, N, /* @__PURE__ */ new Map());
|
|
218
|
+
o(this, $, null);
|
|
219
|
+
o(this, tt, 0);
|
|
220
|
+
o(this, et, 0);
|
|
221
|
+
o(this, at, (t) => {
|
|
222
222
|
var s;
|
|
223
223
|
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";
|
|
224
224
|
});
|
|
225
|
-
|
|
225
|
+
o(this, dt, (t) => W(this, null, function* () {
|
|
226
226
|
var s;
|
|
227
|
-
(s = t.state) != null && s.path && (t.preventDefault(),
|
|
227
|
+
(s = t.state) != null && s.path && (t.preventDefault(), r(this, x, !0), yield this.navigate(t.state.path, { historyAction: "none" }), r(this, x, !1));
|
|
228
228
|
}));
|
|
229
|
-
|
|
229
|
+
o(this, st, () => {
|
|
230
230
|
const { left: t, top: s } = this.scrollValue, i = s - e(this, et), d = t - e(this, tt);
|
|
231
|
-
|
|
231
|
+
r(this, et, s), r(this, tt, t), document.documentElement.classList.toggle("scroll-y", s > 0), document.documentElement.classList.toggle("scroll-x", t > 0), document.documentElement.classList.toggle(
|
|
232
232
|
"scroll-y-forward",
|
|
233
233
|
i > 0
|
|
234
234
|
), document.documentElement.classList.toggle(
|
|
@@ -248,19 +248,19 @@ const it = class it {
|
|
|
248
248
|
});
|
|
249
249
|
});
|
|
250
250
|
if (qt && !it.instance) {
|
|
251
|
-
it.instance = this,
|
|
251
|
+
it.instance = this, r(this, T, {
|
|
252
252
|
base: _t(t == null ? void 0 : t.base),
|
|
253
253
|
waitForHeadToLoad: (t == null ? void 0 : t.waitForHeadToLoad) !== !1,
|
|
254
254
|
trailingSlash: (t == null ? void 0 : t.trailingSlash) || !1,
|
|
255
255
|
scrollSelector: t == null ? void 0 : t.scrollSelector,
|
|
256
256
|
morphInsideScrollContainer: (t == null ? void 0 : t.morphInsideScrollContainer) || !1
|
|
257
|
-
}),
|
|
257
|
+
}), r(this, _, E(this, c, vt).call(this, document.body));
|
|
258
258
|
const s = this.normalizePath(
|
|
259
259
|
location.pathname + location.hash + location.search
|
|
260
260
|
);
|
|
261
|
-
|
|
261
|
+
r(this, m, s);
|
|
262
262
|
const i = new It(this, e(this, m).pathname);
|
|
263
|
-
i.setInitialDocument(document), e(this, N).set(e(this, m).
|
|
263
|
+
i.setInitialDocument(document), e(this, N).set(e(this, m).pathname, i), document.documentElement.setAttribute(
|
|
264
264
|
"data-current-pathname",
|
|
265
265
|
e(this, m).pathname
|
|
266
266
|
), document.documentElement.setAttribute(
|
|
@@ -271,7 +271,7 @@ const it = class it {
|
|
|
271
271
|
pathname: s.pathname,
|
|
272
272
|
searchParameters: s.parameters,
|
|
273
273
|
hash: s.hash
|
|
274
|
-
}),
|
|
274
|
+
}), r(this, $, new Ft()), E(this, c, At).call(this, document);
|
|
275
275
|
}
|
|
276
276
|
}
|
|
277
277
|
get currentURL() {
|
|
@@ -291,7 +291,7 @@ const it = class it {
|
|
|
291
291
|
}
|
|
292
292
|
get scrollValue() {
|
|
293
293
|
let t = 0, s = 0;
|
|
294
|
-
return e(this,
|
|
294
|
+
return e(this, rt) ? (t = window.scrollY, s = window.scrollX) : (t = e(this, A).scrollTop, s = e(this, A).scrollLeft), { top: t, left: s };
|
|
295
295
|
}
|
|
296
296
|
saveState(t) {
|
|
297
297
|
const s = e(this, N).get(e(this, m).path);
|
|
@@ -325,18 +325,18 @@ const it = class it {
|
|
|
325
325
|
submorph: L,
|
|
326
326
|
clearState: w
|
|
327
327
|
} = {}) {
|
|
328
|
-
var
|
|
328
|
+
var ot, lt, Pt;
|
|
329
329
|
if (e(this, B).length)
|
|
330
330
|
return;
|
|
331
331
|
const h = this.normalizePath(
|
|
332
|
-
((
|
|
332
|
+
((ot = this.pathnameModifier) == null ? void 0 : ot.call(this, t)) || t
|
|
333
333
|
);
|
|
334
334
|
if (((lt = e(this, F)) == null ? void 0 : lt.pathname) === h.pathname || e(this, m).pathname === h.pathname) {
|
|
335
335
|
e(this, x) || E(this, c, kt).call(this, h.hash || 0, {
|
|
336
336
|
centerScroll: i,
|
|
337
337
|
offsetScroll: d,
|
|
338
338
|
behavior: "smooth"
|
|
339
|
-
}), ((Pt = e(this, m)) == null ? void 0 : Pt.parameters) !== h.parameters && (
|
|
339
|
+
}), ((Pt = e(this, m)) == null ? void 0 : Pt.parameters) !== h.parameters && (r(this, K, e(this, m)), r(this, m, h), St({
|
|
340
340
|
action: s,
|
|
341
341
|
pathname: h.pathname,
|
|
342
342
|
searchParameters: h.parameters,
|
|
@@ -349,28 +349,28 @@ const it = class it {
|
|
|
349
349
|
}));
|
|
350
350
|
return;
|
|
351
351
|
}
|
|
352
|
-
|
|
352
|
+
r(this, F, h), e(this, g).forEach((G) => {
|
|
353
353
|
G.checkCurrent(h.pathname);
|
|
354
354
|
});
|
|
355
355
|
try {
|
|
356
356
|
let G = !0;
|
|
357
357
|
if (this.preprocessor)
|
|
358
358
|
try {
|
|
359
|
-
yield new Promise((
|
|
359
|
+
yield new Promise((a, M) => {
|
|
360
360
|
var p;
|
|
361
361
|
(p = this.preprocessor) == null || p.call(this, {
|
|
362
362
|
url: h,
|
|
363
|
-
resolve:
|
|
363
|
+
resolve: a,
|
|
364
364
|
reject: M,
|
|
365
365
|
submorph: L
|
|
366
366
|
});
|
|
367
367
|
});
|
|
368
|
-
} catch (
|
|
369
|
-
|
|
368
|
+
} catch (a) {
|
|
369
|
+
a ? console.error(a) : console.log("Route change canceled"), G = !1;
|
|
370
370
|
}
|
|
371
371
|
if (!G || e(this, F).pathname !== h.pathname) {
|
|
372
|
-
e(this, g).forEach((
|
|
373
|
-
|
|
372
|
+
e(this, g).forEach((a) => {
|
|
373
|
+
a.checkCurrent(e(this, m).pathname);
|
|
374
374
|
});
|
|
375
375
|
return;
|
|
376
376
|
}
|
|
@@ -381,12 +381,12 @@ const it = class it {
|
|
|
381
381
|
z(document, "morphNavigation", {
|
|
382
382
|
detail: Ct
|
|
383
383
|
});
|
|
384
|
-
const mt = E(this, c, ut).call(this, e(this, m).pathname), f = E(this, c, ut).call(this,
|
|
385
|
-
if (e(this, N).forEach((
|
|
386
|
-
|
|
384
|
+
const mt = E(this, c, ut).call(this, e(this, m).pathname), f = E(this, c, ut).call(this, h.pathname);
|
|
385
|
+
if (e(this, N).forEach((a) => {
|
|
386
|
+
a.pathname !== h.pathname && a.abort();
|
|
387
387
|
}), yield f == null ? void 0 : f.fetch(t, v), e(this, F).pathname !== h.pathname) {
|
|
388
|
-
e(this, g).forEach((
|
|
389
|
-
|
|
388
|
+
e(this, g).forEach((a) => {
|
|
389
|
+
a.checkCurrent(e(this, m).path);
|
|
390
390
|
});
|
|
391
391
|
return;
|
|
392
392
|
}
|
|
@@ -398,27 +398,27 @@ const it = class it {
|
|
|
398
398
|
detail: ft
|
|
399
399
|
});
|
|
400
400
|
const Tt = Array.from(document.head.children), Mt = Array.from(f.document.head.children), Rt = E(this, c, Bt).call(this, Tt, Mt), Ot = E(this, c, yt).call(this, Tt, Rt), ht = E(this, c, yt).call(this, Mt, Rt);
|
|
401
|
-
ht.forEach((
|
|
402
|
-
if (
|
|
403
|
-
const p = document.createElement("script"), D =
|
|
401
|
+
ht.forEach((a, M) => {
|
|
402
|
+
if (a.tagName === "SCRIPT" && a.getAttribute("src")) {
|
|
403
|
+
const p = document.createElement("script"), D = a.getAttribute("src");
|
|
404
404
|
D.includes("http") || (p.type = "module"), p.src = D, ht[M] = p;
|
|
405
405
|
}
|
|
406
|
-
}), ht.forEach((
|
|
407
|
-
document.head.appendChild(
|
|
406
|
+
}), ht.forEach((a) => {
|
|
407
|
+
document.head.appendChild(a);
|
|
408
408
|
});
|
|
409
|
-
const pt = ht.filter((
|
|
410
|
-
if (
|
|
409
|
+
const pt = ht.filter((a) => {
|
|
410
|
+
if (a.hasAttribute("data-no-waiting"))
|
|
411
411
|
return !1;
|
|
412
|
-
if (E(this, c, bt).call(this,
|
|
412
|
+
if (E(this, c, bt).call(this, a))
|
|
413
413
|
return !0;
|
|
414
414
|
});
|
|
415
|
-
e(this, T).waitForHeadToLoad && pt.length && (yield new Promise((
|
|
415
|
+
e(this, T).waitForHeadToLoad && pt.length && (yield new Promise((a) => W(this, null, function* () {
|
|
416
416
|
let M = 0;
|
|
417
417
|
try {
|
|
418
418
|
for (var p = zt(pt), D, b, P; D = !(b = yield p.next()).done; D = !1) {
|
|
419
419
|
const ct = b.value;
|
|
420
420
|
ct.onload = () => {
|
|
421
|
-
M++, M === pt.length &&
|
|
421
|
+
M++, M === pt.length && a();
|
|
422
422
|
};
|
|
423
423
|
}
|
|
424
424
|
} catch (b) {
|
|
@@ -433,8 +433,8 @@ const it = class it {
|
|
|
433
433
|
}
|
|
434
434
|
}))), yield Qt(10);
|
|
435
435
|
const Ht = [];
|
|
436
|
-
Ot.forEach((
|
|
437
|
-
|
|
436
|
+
Ot.forEach((a) => {
|
|
437
|
+
a.hasAttribute("data-permanent") || (E(this, c, bt).call(this, a) ? Ht.push(a) : a.remove());
|
|
438
438
|
});
|
|
439
439
|
const Wt = E(this, c, vt).call(this, f.document.body);
|
|
440
440
|
e(this, T).morphInsideScrollContainer || E(this, c, At).call(this, f.document), document.documentElement.setAttribute(
|
|
@@ -448,13 +448,13 @@ const it = class it {
|
|
|
448
448
|
pathname: h.pathname,
|
|
449
449
|
searchParameters: h.parameters || (k ? location.search : ""),
|
|
450
450
|
hash: h.hash
|
|
451
|
-
}), e(this, $).remove(),
|
|
452
|
-
const p = Wt[M], D = getComputedStyle(
|
|
451
|
+
}), e(this, $).remove(), r(this, K, e(this, m)), r(this, m, h), e(this, _).forEach((a, M) => {
|
|
452
|
+
const p = Wt[M], D = getComputedStyle(a).getPropertyValue("--morph-duration");
|
|
453
453
|
let b = [], P = [];
|
|
454
454
|
L ? L.forEach((u) => {
|
|
455
|
-
const S =
|
|
455
|
+
const S = a.querySelector(u), U = p.querySelector(u);
|
|
456
456
|
S && U && (P.push(S), b.push(U));
|
|
457
|
-
}) : (b.push(...p.childNodes), P.push(...
|
|
457
|
+
}) : (b.push(...p.childNodes), P.push(...a.childNodes)), P.forEach((u) => {
|
|
458
458
|
u instanceof HTMLElement && (this.destroyOldLinks(u), u.classList.add("old"));
|
|
459
459
|
}), b.forEach((u) => {
|
|
460
460
|
u instanceof HTMLElement && (this.findNewLinks(u), u.classList.add("new"));
|
|
@@ -464,7 +464,7 @@ const it = class it {
|
|
|
464
464
|
u,
|
|
465
465
|
P[S]
|
|
466
466
|
);
|
|
467
|
-
}) :
|
|
467
|
+
}) : a.prepend(...b), Jt(() => {
|
|
468
468
|
P.forEach((u) => {
|
|
469
469
|
u instanceof HTMLElement && u.classList.add("old-idle");
|
|
470
470
|
}), b.forEach((u) => {
|
|
@@ -476,7 +476,7 @@ const it = class it {
|
|
|
476
476
|
});
|
|
477
477
|
});
|
|
478
478
|
const ct = gt(Et({}, ft), {
|
|
479
|
-
morphElement:
|
|
479
|
+
morphElement: a
|
|
480
480
|
});
|
|
481
481
|
z(document, "morphNewChildrenAdded", {
|
|
482
482
|
detail: ct
|
|
@@ -505,8 +505,8 @@ const it = class it {
|
|
|
505
505
|
}), h.hash ? (f.clearScrollState(), E(this, c, kt).call(this, h.hash, {
|
|
506
506
|
centerScroll: i,
|
|
507
507
|
offsetScroll: d
|
|
508
|
-
})) : e(this, x) ? f.restoreScrollPosition() : f.renewScrollPosition(), yield Promise.all(e(this, B)), Ht.forEach((
|
|
509
|
-
|
|
508
|
+
})) : e(this, x) ? f.restoreScrollPosition() : f.renewScrollPosition(), yield Promise.all(e(this, B)), Ht.forEach((a) => a.remove()), r(this, B, []), e(this, _).forEach((a) => {
|
|
509
|
+
a.querySelectorAll("script").forEach((p) => {
|
|
510
510
|
const D = document.createElement("script");
|
|
511
511
|
for (let b = 0; b < p.attributes.length; b++) {
|
|
512
512
|
const P = p.attributes[b];
|
|
@@ -522,7 +522,7 @@ const it = class it {
|
|
|
522
522
|
} catch (G) {
|
|
523
523
|
console.error(G);
|
|
524
524
|
}
|
|
525
|
-
|
|
525
|
+
r(this, F, void 0);
|
|
526
526
|
});
|
|
527
527
|
}
|
|
528
528
|
addLink(t) {
|
|
@@ -534,14 +534,14 @@ const it = class it {
|
|
|
534
534
|
});
|
|
535
535
|
}
|
|
536
536
|
removeLink(t) {
|
|
537
|
-
|
|
537
|
+
r(this, g, e(this, g).filter((s) => s.element === t ? (s.destroy(), !1) : !0));
|
|
538
538
|
}
|
|
539
539
|
destroyOldLinks(t) {
|
|
540
|
-
|
|
540
|
+
r(this, g, e(this, g).filter((s) => t.contains(s.element) ? (s.destroy(), !1) : !0));
|
|
541
541
|
}
|
|
542
542
|
findNewLinks(t) {
|
|
543
543
|
const s = [...t.querySelectorAll("a")].filter(
|
|
544
|
-
e(this,
|
|
544
|
+
e(this, at)
|
|
545
545
|
);
|
|
546
546
|
e(this, g).push(
|
|
547
547
|
...s.map((i) => new Lt(i, this))
|
|
@@ -550,11 +550,11 @@ const it = class it {
|
|
|
550
550
|
findLinks() {
|
|
551
551
|
const t = [
|
|
552
552
|
...document.documentElement.querySelectorAll("a")
|
|
553
|
-
].filter(e(this,
|
|
554
|
-
e(this, g).forEach((s) => s.destroy()),
|
|
553
|
+
].filter(e(this, at));
|
|
554
|
+
e(this, g).forEach((s) => s.destroy()), r(this, g, t.map((s) => new Lt(s, this)));
|
|
555
555
|
}
|
|
556
556
|
};
|
|
557
|
-
T = new WeakMap(), _ = new WeakMap(), g = new WeakMap(), F = new WeakMap(), m = new WeakMap(), K = new WeakMap(), B = new WeakMap(), x = new WeakMap(), A = new WeakMap(),
|
|
557
|
+
T = new WeakMap(), _ = new WeakMap(), g = new WeakMap(), F = new WeakMap(), m = new WeakMap(), K = new WeakMap(), B = new WeakMap(), x = new WeakMap(), A = new WeakMap(), rt = new WeakMap(), N = new WeakMap(), $ = new WeakMap(), tt = new WeakMap(), et = new WeakMap(), at = new WeakMap(), c = new WeakSet(), ut = function(t) {
|
|
558
558
|
const s = this.normalizePath(t);
|
|
559
559
|
let i = e(this, N).get(s.pathname);
|
|
560
560
|
return i || (i = new It(this, s.pathname), e(this, N).set(s.pathname, i)), i;
|
|
@@ -580,7 +580,7 @@ T = new WeakMap(), _ = new WeakMap(), g = new WeakMap(), F = new WeakMap(), m =
|
|
|
580
580
|
(s = e(this, A)) == null || s.removeEventListener(
|
|
581
581
|
"scroll",
|
|
582
582
|
e(this, st)
|
|
583
|
-
),
|
|
583
|
+
), r(this, et, 0), r(this, tt, 0), r(this, A, e(this, T).scrollSelector && t.querySelector(e(this, T).scrollSelector) || window), r(this, rt, e(this, A) === window), (i = e(this, A)) == null || i.addEventListener("scroll", e(this, st)), e(this, st).call(this);
|
|
584
584
|
}, kt = function(t, s) {
|
|
585
585
|
const i = typeof t == "string" ? document.getElementById(t) : t;
|
|
586
586
|
(typeof i == "number" || i) && Zt(i, {
|