aptechka 0.72.8 → 0.73.0

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.
@@ -36,6 +36,7 @@ export interface MorphNavigateOptions {
36
36
  revalidate?: boolean;
37
37
  keepSearchParameters?: boolean;
38
38
  submorph?: Array<string>;
39
+ submorphAppend?: boolean;
39
40
  clearState?: boolean;
40
41
  keepScrollPosition?: boolean;
41
42
  }
@@ -97,7 +98,7 @@ export declare class Morph {
97
98
  prefetch(path: string, revalidate?: boolean): Promise<void>;
98
99
  excludeHeadChild(child: Node): boolean;
99
100
  setHeaders(path: string): void;
100
- navigate(path: string, { historyAction, centerScroll, offsetScroll, scrollBehaviour, revalidate, keepSearchParameters, submorph, clearState, keepScrollPosition, }?: MorphNavigateOptions): Promise<void>;
101
+ navigate(path: string, { historyAction, centerScroll, offsetScroll, scrollBehaviour, revalidate, keepSearchParameters, submorph, submorphAppend, clearState, keepScrollPosition, }?: MorphNavigateOptions): Promise<void>;
101
102
  addLink(element: HTMLAnchorElement): void;
102
103
  addLinks(elements: Array<HTMLAnchorElement>): void;
103
104
  removeLink(element: HTMLAnchorElement): void;
@@ -4,5 +4,6 @@ export declare class MorphLink {
4
4
  constructor(element: HTMLAnchorElement, morph: Morph);
5
5
  get element(): HTMLAnchorElement;
6
6
  checkCurrent(path: string): void;
7
+ updatePagination(newPage: number, selector: string): void;
7
8
  destroy(): void;
8
9
  }
@@ -1 +1 @@
1
- "use strict";var te=Object.defineProperty,ee=Object.defineProperties;var se=Object.getOwnPropertyDescriptors;var Vt=Object.getOwnPropertySymbols;var ie=Object.prototype.hasOwnProperty,re=Object.prototype.propertyIsEnumerable;var Ot=(a,t)=>(t=Symbol[a])?t:Symbol.for("Symbol."+a),Ft=a=>{throw TypeError(a)};var Bt=(a,t,s)=>t in a?te(a,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):a[t]=s,ft=(a,t)=>{for(var s in t||(t={}))ie.call(t,s)&&Bt(a,s,t[s]);if(Vt)for(var s of Vt(t))re.call(t,s)&&Bt(a,s,t[s]);return a},wt=(a,t)=>ee(a,se(t));var yt=(a,t,s)=>t.has(a)||Ft("Cannot "+s);var e=(a,t,s)=>(yt(a,t,"read from private field"),s?s.call(a):t.get(a)),o=(a,t,s)=>t.has(a)?Ft("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(a):t.set(a,s),n=(a,t,s,i)=>(yt(a,t,"write to private field"),i?i.call(a,s):t.set(a,s),s),E=(a,t,s)=>(yt(a,t,"access private method"),s);var F=(a,t,s)=>new Promise((i,h)=>{var v=f=>{try{b(s.next(f))}catch(H){h(H)}},y=f=>{try{b(s.throw(f))}catch(H){h(H)}},b=f=>f.done?i(f.value):Promise.resolve(f.value).then(v,y);b((s=s.apply(a,t)).next())});var Wt=(a,t,s)=>(t=a[Ot("asyncIterator")])?t.call(a):(a=a[Ot("iterator")](),t={},s=(i,h)=>(h=a[i])&&(t[i]=v=>new Promise((y,b,f)=>(v=h.call(a,v),f=v.done,Promise.resolve(v.value).then(H=>y({value:H,done:f}),b)))),s("next"),s("return"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const jt=require("../index-DekP7OZe.cjs"),R=require("../events-KVanG9sR.cjs"),ne=require("../polyfills-Df4r-ETT.cjs"),Xt=require("../scroll-CIdNtj3G.cjs");require("construct-style-sheets-polyfill");const st=require("../url-DGcX4fGV.cjs"),ae=require("../css-value-parser/index.cjs");class Kt 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)}}jt.isBrowser&&!customElements.get("morph-announcer")&&customElements.define("morph-announcer",Kt);var M,l,U,rt,G;class bt{constructor(t,s){o(this,M);o(this,l);o(this,U);o(this,rt,t=>{var i;if(t.preventDefault(),document.documentElement.classList.contains("click-disabled"))return;if(e(this,l).hasAttribute("data-back")&&e(this,M).previousURL)history.back();else{n(this,U,e(this,l).getAttribute("href")||"/");const h=e(this,l).getAttribute("data-history-action")||"push",v=e(this,l).hasAttribute("data-center-scroll"),y=getComputedStyle(e(this,l)).getPropertyValue("--offset-scroll").trim(),b=y?ae.cssValueParser.parse(y):void 0,f=e(this,l).hasAttribute("data-revalidate"),H=e(this,l).hasAttribute("data-keep-search-parameters"),gt=e(this,l).hasAttribute("data-keep-scroll-position"),Gt=e(this,l).getAttribute("data-scroll-behaviour"),ht=(i=e(this,l).getAttribute("data-submorph"))==null?void 0:i.split(",").map(ct=>ct.trim()),c=e(this,l).hasAttribute("data-clear-state");e(this,M).navigate(e(this,U),{historyAction:h,centerScroll:v,offsetScroll:b,revalidate:f,keepSearchParameters:H,submorph:ht,clearState:c,keepScrollPosition:gt,scrollBehaviour:Gt})}});o(this,G,()=>{const t=e(this,l).hasAttribute("data-revalidate");e(this,M).prefetch(e(this,U),t),e(this,l).removeEventListener("pointerenter",e(this,G))});n(this,M,s),n(this,l,t),n(this,U,e(this,l).getAttribute("href")||"/"),e(this,l).addEventListener("click",e(this,rt)),this.checkCurrent(location.href.replace(location.origin,"")),e(this,l).hasAttribute("data-prefetch")&&e(this,l).addEventListener("pointerenter",e(this,G))}get element(){return e(this,l)}checkCurrent(t){var h;const s=e(this,M).normalizePath(t),i=e(this,M).normalizePath(e(this,U));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"):(h=e(this,l).getAttribute("data-associated-paths"))!=null&&h.split(",").find(v=>s.pathname.includes(v))?e(this,l).classList.add("current"):e(this,l).classList.remove("current"),s.path===i.path?e(this,l).classList.add("exact"):e(this,l).classList.remove("exact")}destroy(){e(this,l).removeEventListener("click",e(this,rt)),e(this,l).removeEventListener("pointerenter",e(this,G)),e(this,l).classList.remove("current","exact")}}M=new WeakMap,l=new WeakMap,U=new WeakMap,rt=new WeakMap,G=new WeakMap;const oe=new DOMParser;var T,W,w,k,X,D,J,Y,I,Q,nt;class Yt{constructor(t,s){o(this,T);o(this,W);o(this,w,{x:0,y:0});o(this,k,null);o(this,X,null);o(this,D,null);o(this,J,null);o(this,Y,null);o(this,I,null);o(this,Q);o(this,nt);n(this,T,t),n(this,W,s),n(this,Q,s)}get pathname(){return e(this,W)}get scrollState(){return e(this,w)}get document(){return e(this,D)}setHeaders(t){n(this,nt,t)}setInitialDocument(t){n(this,k,t.cloneNode(!0))}abort(){var t;return(t=e(this,Y))==null?void 0:t.abort(`[${e(this,W)}] page loading cancelled`)}fetch(t,s,i){return F(this,null,function*(){return!i&&(e(this,I)||e(this,k)&&e(this,k).documentElement.hasAttribute("data-cache")&&e(this,Q)!==t||e(this,k)&&e(this,T).isPopstateNavigation)?e(this,I):(n(this,Q,t),n(this,I,new Promise(h=>F(this,null,function*(){try{n(this,Y,new AbortController);const y=yield(yield fetch(t,{signal:e(this,Y).signal,headers:ft({"X-MORPH":"true","X-MORPH-CURRENT-PATH":encodeURIComponent(s),"X-MORPH-NEW-PATH":encodeURIComponent(t)},e(this,nt))})).text(),b=oe.parseFromString(y,"text/html");this.setInitialDocument(b)}catch(v){console.warn(v)}finally{n(this,Y,null),n(this,I,null),h()}}))),e(this,I))})}cloneDocument(){n(this,D,(e(this,X)||e(this,k)).cloneNode(!0))}get title(){let t="";if(e(this,D).title)t=e(this,D).title;else{const s=e(this,D).querySelector("h1");t=(s==null?void 0:s.innerText)||(s==null?void 0:s.textContent)||e(this,W)}return t}clearScrollState(){e(this,w).x=0,e(this,w).y=0}clearDocumentState(){n(this,X,null)}saveScrollState(){e(this,k).documentElement.hasAttribute("data-no-scroll-restoration")?(e(this,w).x=0,e(this,w).y=0):(e(this,w).x=e(this,T).scrollValue.left,e(this,w).y=e(this,T).scrollValue.top)}restoreScrollPosition(){e(this,T).scrollElement.scroll({top:e(this,w).y,left:e(this,w).x,behavior:"instant"})}saveDocumentState(){e(this,k).documentElement.hasAttribute("data-no-page-restoration")?n(this,X,null):n(this,X,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,W=new WeakMap,w=new WeakMap,k=new WeakMap,X=new WeakMap,D=new WeakMap,J=new WeakMap,Y=new WeakMap,I=new WeakMap,Q=new WeakMap,nt=new WeakMap;var C,Z,g,z,m,j,V,O,P,at,x,K,_,tt,ot,u,Pt,lt,pt,kt,$t,Ct,Ht,Rt,Mt,Et,et;const it=class it{constructor(t){o(this,u);o(this,C,null);o(this,Z,null);o(this,g,[]);o(this,z);o(this,m,null);o(this,j);o(this,V,[]);o(this,O,!1);o(this,P,null);o(this,at,!1);o(this,x,new Map);o(this,K,null);o(this,_,0);o(this,tt,0);o(this,ot,null);o(this,lt,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,Et,t=>F(this,null,function*(){t.preventDefault(),n(this,O,!0),yield this.navigate(location.href.replace(location.origin,""),{historyAction:"none",submorph:e(this,ot)||void 0}),n(this,O,!1)}));o(this,et,()=>{const{left:t,top:s}=this.scrollValue,i=s-e(this,tt),h=t-e(this,_);n(this,tt,s),n(this,_,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",h>0),document.documentElement.classList.toggle("scroll-x-backward",h<0),R.dispatchEvent(document,"morphScroll",{detail:{left:t,top:s}})});if(jt.isBrowser&&!it.instance){it.instance=this,n(this,C,{base:st.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,Z,E(this,u,kt).call(this,document.body));const s=this.normalizePath(location.pathname+location.search+location.hash);n(this,m,s);const i=new Yt(this,e(this,m).pathname);i.setInitialDocument(document),e(this,x).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,Et)),st.changeHistory({action:"replace",pathname:s.pathname,searchParameters:s.parameters,hash:s.hash}),n(this,K,new Kt),E(this,u,Rt).call(this,document)}}get currentURL(){return e(this,m)}get previousURL(){return e(this,j)}get links(){return e(this,g)}get scrollElement(){return e(this,P)}get isPopstateNavigation(){return e(this,O)}get scrollValue(){let t=0,s=0;return e(this,at)?(t=window.scrollY,s=window.scrollX):(t=e(this,P).scrollTop,s=e(this,P).scrollLeft),{top:t,left:s}}saveState(t){const s=e(this,x).get(e(this,m).path);s&&s.saveState(t)}getState(){const t=e(this,x).get(e(this,m).path);return t==null?void 0:t.clearState()}normalizePath(t){return st.splitPath(t,{base:e(this,C).base,trailingSlash:e(this,C).trailingSlash})}prefetch(t,s){return F(this,null,function*(){var h;if(e(this,V).length)return;t=((h=this.pathnameModifier)==null?void 0:h.call(this,t))||t;const i=E(this,u,pt).call(this,t);i==null||i.fetch(t,e(this,m).path,s)})}excludeHeadChild(t){return!1}setHeaders(t){}navigate(Gt){return F(this,arguments,function*(t,{historyAction:s="push",centerScroll:i,offsetScroll:h,scrollBehaviour:v,revalidate:y,keepSearchParameters:b,submorph:f,clearState:H,keepScrollPosition:gt}={}){var ct,Tt,xt,Nt;if(e(this,V).length)return;n(this,ot,f||null);const ht=((ct=this.pathnameModifier)==null?void 0:ct.call(this,t))||t,c=this.normalizePath(ht);if(e(this,g).forEach($=>{$.checkCurrent(c.path)}),!y&&(((Tt=e(this,z))==null?void 0:Tt.pathname)===c.pathname||e(this,m).pathname===c.pathname)){E(this,u,Mt).call(this,c.hash||0,{centerScroll:i,offsetScroll:h,behavior:"smooth"}),R.dispatchEvent(document,"morphSamePath",{custom:!0}),((xt=e(this,m))==null?void 0:xt.parameters)!==c.parameters&&(n(this,j,e(this,m)),n(this,m,c),st.changeHistory({action:((Nt=e(this,m))==null?void 0:Nt.hash)!==c.hash?"replace":s,pathname:c.pathname,searchParameters:c.parameters,hash:c.hash}),R.dispatchEvent(document,"morphURLParametersChange",{detail:{newURL:e(this,m),previousURL:e(this,j)}}));return}n(this,z,c);try{let $=!0;if(this.preprocessor)try{yield new Promise((r,S)=>{var A;(A=this.preprocessor)==null||A.call(this,{url:c,resolve:r,reject:S,submorph:f})})}catch(r){r?console.error(r):console.log("Route change canceled"),$=!1}if(!$||e(this,z).pathname!==c.pathname){e(this,g).forEach(r=>{r.checkCurrent(e(this,m).path)});return}const qt={url:c,submorph:f};f?f.forEach(r=>{document.querySelectorAll(r).forEach(S=>{S.classList.add("out"),S.setAttribute("data-morph-out","")})}):e(this,Z).forEach(r=>{var S,A;(S=r.firstElementChild)==null||S.classList.add("out"),(A=r.firstElementChild)==null||A.setAttribute("data-morph-out","")}),R.dispatchEvent(document,"morphNavigation",{detail:qt});const vt=E(this,u,pt).call(this,e(this,m).pathname),p=E(this,u,pt).call(this,c.pathname);if(e(this,x).forEach(r=>{r.pathname!==c.pathname&&r.abort()}),yield p==null?void 0:p.fetch(ht,e(this,m).path,y),e(this,z).pathname!==c.pathname){e(this,g).forEach(r=>{r.checkCurrent(e(this,m).path)});return}vt.clearState(),vt.saveScrollState(),vt.saveDocumentState(),e(this,O)||(p.clearScrollState(),p.clearDocumentState()),H&&p.clearState(),p.cloneDocument(),e(this,K).textContent=p.title,document.body.appendChild(e(this,K));const ut=wt(ft({},qt),{document:p.document});ut.document.querySelectorAll("[data-morph-out]").forEach(r=>{r.classList.remove("out")}),R.dispatchEvent(document,"morphStart",{detail:ut});const Ut=Array.from(document.head.children),Dt=Array.from(p.document.head.children),It=E(this,u,$t).call(this,Ut,Dt),Jt=E(this,u,Ct).call(this,Ut,It),dt=E(this,u,Ct).call(this,Dt,It).filter(r=>!this.excludeHeadChild(r));dt.forEach((r,S)=>{r.tagName==="SCRIPT"&&(dt[S]=E(this,u,Pt).call(this,r))}),dt.forEach(r=>{document.head.appendChild(r)});const St=dt.filter(r=>{if(r.hasAttribute("data-no-waiting"))return!1;if(E(this,u,Ht).call(this,r))return!0});e(this,C).waitForHeadToLoad&&St.length&&(yield new Promise(r=>F(this,null,function*(){let S=0;try{for(var A=Wt(St),Zt,B,N;Zt=!(B=yield A.next()).done;Zt=!1){const mt=B.value;mt.onload=()=>{S++,S===St.length&&r()}}}catch(B){N=[B]}finally{try{Zt&&(B=A.return)&&(yield B.call(A))}finally{if(N)throw N[0]}}}))),yield Xt.wait(10);const zt=[];Jt.forEach(r=>{r.hasAttribute("data-permanent")||(E(this,u,Ht).call(this,r)?zt.push(r):r.remove())});const Qt=E(this,u,kt).call(this,p.document.body);!e(this,C).morphInsideScrollContainer&&!f&&E(this,u,Rt).call(this,p.document),document.documentElement.setAttribute("data-current-pathname",c.pathname),document.documentElement.setAttribute("data-current-leaf",c.leaf),st.changeHistory({action:s,pathname:c.pathname,searchParameters:c.parameters||(b?location.search:""),hash:c.hash}),e(this,K).remove(),n(this,j,e(this,m)),n(this,m,c);const Lt=[];e(this,Z).forEach((r,S)=>{const A=Qt[S],Zt=getComputedStyle(r).getPropertyValue("--morph-duration");let B=[],N=[];f?(f.forEach(d=>{const L=r.querySelector(d),q=A.querySelector(d);L&&q&&(N.push(L),B.push(q))}),N.forEach(d=>{d.parentElement&&Lt.push(d.parentElement)})):(B.push(...A.childNodes),N.push(...r.childNodes),Lt.push(r)),N.forEach(d=>{d instanceof HTMLElement&&(this.destroyOldLinks(d),d.classList.add("old"))}),B.forEach(d=>{d instanceof HTMLElement&&(this.findNewLinks(d),d.classList.add("new"))}),f?B.forEach((d,L)=>{var q;(q=N[L].parentElement)==null||q.insertBefore(d,N[L])}):r.prepend(...B),ne.requestIdleCallback(()=>{N.forEach(d=>{d instanceof HTMLElement&&d.classList.add("old-idle")}),B.forEach(d=>{var L;d instanceof HTMLElement&&((L=d.parentElement)==null||L.style.setProperty("--new-content-height",d.offsetHeight+"px"),d.classList.add("new-idle"))})});const mt=wt(ft({},ut),{morphElement:r});R.dispatchEvent(document,"morphNewChildrenAdded",{detail:mt});const _t=new Promise(d=>{setTimeout(()=>{N.forEach(L=>L.remove()),B.forEach(L=>{var q;L instanceof HTMLElement&&((q=L.parentElement)==null||q.style.removeProperty("--new-content-height"),L.classList.remove("new-idle","new"))}),R.dispatchEvent(document,"morphOldChildrenRemoved",{detail:mt}),d()},(parseFloat(Zt)||0)*1e3+10)});e(this,V).push(_t)}),this.isPopstateNavigation?document.documentElement.style.setProperty("--new-document-scroll-position",(this.scrollValue.top-p.scrollState.y)*1+"px"):document.documentElement.style.setProperty("--new-document-scroll-position",this.scrollValue.top+"px"),R.dispatchEvent(document,"morphBeforeNavigationScroll",{detail:p.scrollState}),c.hash?(p.clearScrollState(),E(this,u,Mt).call(this,c.hash,{centerScroll:i,offsetScroll:h,behavior:v})):e(this,O)?p.restoreScrollPosition():gt||p.renewScrollPosition(),yield Promise.all(e(this,V)),zt.forEach(r=>r.remove()),n(this,V,[]),Lt.forEach(r=>{r.querySelectorAll("script").forEach(A=>{A.replaceWith(E(this,u,Pt).call(this,A))})}),e(this,g).forEach(r=>{r.checkCurrent(e(this,m).path)}),R.dispatchEvent(document,"morphComplete",{detail:ut}),document.documentElement.style.removeProperty("--new-document-scroll-position"),window.dispatchEvent(new Event("resize"))}catch($){console.error($)}n(this,z,void 0)})}addLink(t){e(this,g).push(new bt(t,this))}addLinks(t){t.forEach(s=>{this.addLink(s)})}removeLink(t){n(this,g,e(this,g).filter(s=>s.element===t?(s.destroy(),!1):!0))}destroyOldLinks(t){n(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,lt));e(this,g).push(...s.map(i=>new bt(i,this)))}findLinks(){const t=[...document.documentElement.querySelectorAll("a")].filter(e(this,lt));e(this,g).forEach(s=>s.destroy()),n(this,g,t.map(s=>new bt(s,this)))}};C=new WeakMap,Z=new WeakMap,g=new WeakMap,z=new WeakMap,m=new WeakMap,j=new WeakMap,V=new WeakMap,O=new WeakMap,P=new WeakMap,at=new WeakMap,x=new WeakMap,K=new WeakMap,_=new WeakMap,tt=new WeakMap,ot=new WeakMap,u=new WeakSet,Pt=function(t){const s=document.createElement("script");for(let i=0;i<t.attributes.length;i++){const h=t.attributes[i];s.setAttribute(h.name,h.value)}return t.hasAttribute("src")||(s.innerHTML=t.innerHTML),s},lt=new WeakMap,pt=function(t){const s=this.normalizePath(t);let i=e(this,x).get(s.pathname);return i||(i=new Yt(this,s.pathname),e(this,x).set(s.pathname,i)),i},kt=function(t){const s=[...t.querySelectorAll("[data-morph]")];return s.length?s:[t]},$t=function(t,s){return t.filter(i=>s.find(h=>h.outerHTML===i.outerHTML))},Ct=function(t,s){return t.filter(i=>!s.find(h=>h.outerHTML===i.outerHTML))},Ht=function(t){return t.tagName==="SCRIPT"||t.tagName==="STYLE"||t.tagName==="LINK"&&t.getAttribute("rel")==="stylesheet"},Rt=function(t){var s,i;(s=e(this,P))==null||s.removeEventListener("scroll",e(this,et)),n(this,tt,0),n(this,_,0),n(this,P,e(this,C).scrollSelector&&t.querySelector(e(this,C).scrollSelector)||window),n(this,at,e(this,P)===window),(i=e(this,P))==null||i.addEventListener("scroll",e(this,et)),e(this,et).call(this)},Mt=function(t,s){const i=typeof t=="string"?document.getElementById(t):t;(typeof i=="number"||i)&&Xt.scrollToElement(i,{scrollElement:e(this,P),behavior:(s==null?void 0:s.behavior)||"instant",center:s==null?void 0:s.centerScroll,offset:s==null?void 0:s.offsetScroll})},Et=new WeakMap,et=new WeakMap,it.instance=null;let At=it;exports.Morph=At;
1
+ "use strict";var ae=Object.defineProperty,ne=Object.defineProperties;var re=Object.getOwnPropertyDescriptors;var Xt=Object.getOwnPropertySymbols;var oe=Object.prototype.hasOwnProperty,le=Object.prototype.propertyIsEnumerable;var Yt=(o,e)=>(e=Symbol[o])?e:Symbol.for("Symbol."+o),Kt=o=>{throw TypeError(o)};var jt=(o,e,i)=>e in o?ae(o,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):o[e]=i,Et=(o,e)=>{for(var i in e||(e={}))oe.call(e,i)&&jt(o,i,e[i]);if(Xt)for(var i of Xt(e))le.call(e,i)&&jt(o,i,e[i]);return o},Pt=(o,e)=>ne(o,re(e));var Ct=(o,e,i)=>e.has(o)||Kt("Cannot "+i);var t=(o,e,i)=>(Ct(o,e,"read from private field"),i?i.call(o):e.get(o)),l=(o,e,i)=>e.has(o)?Kt("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(o):e.set(o,i),r=(o,e,i,s)=>(Ct(o,e,"write to private field"),s?s.call(o,i):e.set(o,i),i),p=(o,e,i)=>(Ct(o,e,"access private method"),i);var W=(o,e,i)=>new Promise((s,h)=>{var g=f=>{try{w(i.next(f))}catch(v){h(v)}},E=f=>{try{w(i.throw(f))}catch(v){h(v)}},w=f=>f.done?s(f.value):Promise.resolve(f.value).then(g,E);w((i=i.apply(o,e)).next())});var $t=(o,e,i)=>(e=o[Yt("asyncIterator")])?e.call(o):(o=o[Yt("iterator")](),e={},i=(s,h)=>(h=o[s])&&(e[s]=g=>new Promise((E,w,f)=>(g=h.call(o,g),f=g.done,Promise.resolve(g.value).then(v=>E({value:v,done:f}),w)))),i("next"),i("return"),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Qt=require("../index-DekP7OZe.cjs"),T=require("../events-KVanG9sR.cjs"),he=require("../polyfills-Df4r-ETT.cjs"),Gt=require("../scroll-CIdNtj3G.cjs");require("construct-style-sheets-polyfill");const nt=require("../url-DGcX4fGV.cjs"),ce=require("../css-value-parser/index.cjs");class Zt extends HTMLElement{connectedCallback(){const e={"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[i,s]of Object.entries(e))this.setAttribute(i,s)}}Qt.isBrowser&&!customElements.get("morph-announcer")&&customElements.define("morph-announcer",Zt);var P,a,D,J,vt,ot,Q;class Ht{constructor(e,i){l(this,J);l(this,P);l(this,a);l(this,D);l(this,ot,e=>{var s;if(e.preventDefault(),document.documentElement.classList.contains("click-disabled"))return;if(t(this,a).hasAttribute("data-back")&&t(this,P).previousURL)history.back();else{r(this,D,t(this,a).getAttribute("href")||"/");const h=t(this,a).getAttribute("data-history-action")||"push",g=t(this,a).hasAttribute("data-center-scroll"),E=getComputedStyle(t(this,a)).getPropertyValue("--offset-scroll").trim(),w=E?ce.cssValueParser.parse(E):void 0,f=t(this,a).hasAttribute("data-revalidate")||t(this,a).hasAttribute("data-pagination-more-link")||t(this,a).hasAttribute("data-pagination-set-link"),v=t(this,a).hasAttribute("data-keep-search-parameters"),Lt=t(this,a).hasAttribute("data-keep-scroll-position")||t(this,a).hasAttribute("data-pagination-more-link"),yt=t(this,a).getAttribute("data-scroll-behaviour"),dt=p(this,J,vt).call(this,t(this,a).getAttribute("data-pagination-set-link")||t(this,a).getAttribute("data-pagination-more-link"));dt&&(t(this,a).hasAttribute("data-pagination-set-link")?t(this,P).links.forEach(q=>{q.updatePagination(parseInt(t(this,a).getAttribute("data-value")||"1"),dt.selector)}):t(this,a).hasAttribute("data-pagination-more-link")&&t(this,P).links.forEach(q=>{q.updatePagination(dt.currentPage+1,dt.selector)}));const mt=((s=t(this,a).getAttribute("data-submorph"))==null?void 0:s.split(",").map(q=>q.trim()))||t(this,a).hasAttribute("data-pagination-more-link")&&[t(this,a).getAttribute("data-pagination-more-link")]||t(this,a).hasAttribute("data-pagination-set-link")&&[t(this,a).getAttribute("data-pagination-set-link")]||void 0,c=t(this,a).hasAttribute("data-clear-state");t(this,P).navigate(t(this,D),{historyAction:h,centerScroll:g,offsetScroll:w,revalidate:f,keepSearchParameters:v,submorph:mt,clearState:c,keepScrollPosition:Lt,scrollBehaviour:yt,submorphAppend:t(this,a).hasAttribute("data-pagination-more-link")})}});l(this,Q,()=>{const e=t(this,a).hasAttribute("data-revalidate");t(this,P).prefetch(t(this,D),e),t(this,a).removeEventListener("pointerenter",t(this,Q))});r(this,P,i),r(this,a,e),t(this,a).addEventListener("click",t(this,ot)),r(this,D,t(this,a).getAttribute("href")||"/"),this.checkCurrent(location.href.replace(location.origin,""));const s=p(this,J,vt).call(this,t(this,a).getAttribute("data-pagination-set-link")||t(this,a).getAttribute("data-pagination-more-link"));s&&this.updatePagination(s.currentPage,s.selector),t(this,a).hasAttribute("data-prefetch")&&t(this,a).addEventListener("pointerenter",t(this,Q))}get element(){return t(this,a)}checkCurrent(e){var h;const i=t(this,P).normalizePath(e),s=t(this,P).normalizePath(t(this,D));t(this,a).hasAttribute("data-include")&&i.pathname.includes(s.pathname)?t(this,a).classList.add("current"):s.pathname===i.pathname?t(this,a).classList.add("current"):(h=t(this,a).getAttribute("data-associated-paths"))!=null&&h.split(",").find(g=>i.pathname.includes(g))?t(this,a).classList.add("current"):t(this,a).classList.remove("current"),i.path===s.path?t(this,a).classList.add("exact"):t(this,a).classList.remove("exact")}updatePagination(e,i){const s=p(this,J,vt).call(this,i);if(s)if(s.element.setAttribute("data-current-page",e.toString()),t(this,a).hasAttribute("data-pagination-more-link"))if(e<s.totalPages){t(this,a).style.display="";const h=t(this,a).querySelector("[data-pagination-more-link-counter]");h&&(h.textContent=(s.totalPages-e).toString());const g=t(this,a).getAttribute("href"),E=new URL(g,window.location.origin);E.searchParams.set("page",(e+1).toString());const w=E.href.replace(E.origin,"").toString();t(this,a).setAttribute("href",w),this.checkCurrent(w)}else t(this,a).style.display="none";else t(this,a).hasAttribute("data-pagination-set-link")&&(t(this,a).getAttribute("data-value")===e.toString()?t(this,a).classList.add("pagination-current"):t(this,a).classList.remove("pagination-current"))}destroy(){t(this,a).removeEventListener("click",t(this,ot)),t(this,a).removeEventListener("pointerenter",t(this,Q)),t(this,a).classList.remove("current","exact","pagination-current")}}P=new WeakMap,a=new WeakMap,D=new WeakMap,J=new WeakSet,vt=function(e){if(!e)return;const i=document.querySelector(e);if(i){const s=parseInt(i.getAttribute("data-current-page")||"1"),h=parseInt(i.getAttribute("data-total-pages")||"1");return{element:i,currentPage:s,totalPages:h,selector:e}}},ot=new WeakMap,Q=new WeakMap;const ue=new DOMParser;var x,X,A,R,Y,z,Z,j,V,_,lt;class Jt{constructor(e,i){l(this,x);l(this,X);l(this,A,{x:0,y:0});l(this,R,null);l(this,Y,null);l(this,z,null);l(this,Z,null);l(this,j,null);l(this,V,null);l(this,_);l(this,lt);r(this,x,e),r(this,X,i),r(this,_,i)}get pathname(){return t(this,X)}get scrollState(){return t(this,A)}get document(){return t(this,z)}setHeaders(e){r(this,lt,e)}setInitialDocument(e){r(this,R,e.cloneNode(!0))}abort(){var e;return(e=t(this,j))==null?void 0:e.abort(`[${t(this,X)}] page loading cancelled`)}fetch(e,i,s){return W(this,null,function*(){return!s&&(t(this,V)||t(this,R)&&t(this,R).documentElement.hasAttribute("data-cache")&&t(this,_)!==e||t(this,R)&&t(this,x).isPopstateNavigation)?t(this,V):(r(this,_,e),r(this,V,new Promise(h=>W(this,null,function*(){try{r(this,j,new AbortController);const E=yield(yield fetch(e,{signal:t(this,j).signal,headers:Et({"X-MORPH":"true","X-MORPH-CURRENT-PATH":encodeURIComponent(i),"X-MORPH-NEW-PATH":encodeURIComponent(e)},t(this,lt))})).text(),w=ue.parseFromString(E,"text/html");this.setInitialDocument(w)}catch(g){console.warn(g)}finally{r(this,j,null),r(this,V,null),h()}}))),t(this,V))})}cloneDocument(){r(this,z,(t(this,Y)||t(this,R)).cloneNode(!0))}get title(){let e="";if(t(this,z).title)e=t(this,z).title;else{const i=t(this,z).querySelector("h1");e=(i==null?void 0:i.innerText)||(i==null?void 0:i.textContent)||t(this,X)}return e}clearScrollState(){t(this,A).x=0,t(this,A).y=0}clearDocumentState(){r(this,Y,null)}saveScrollState(){t(this,R).documentElement.hasAttribute("data-no-scroll-restoration")?(t(this,A).x=0,t(this,A).y=0):(t(this,A).x=t(this,x).scrollValue.left,t(this,A).y=t(this,x).scrollValue.top)}restoreScrollPosition(){t(this,x).scrollElement.scroll({top:t(this,A).y,left:t(this,A).x,behavior:"instant"})}saveDocumentState(){t(this,R).documentElement.hasAttribute("data-no-page-restoration")?r(this,Y,null):r(this,Y,document.cloneNode(!0))}renewScrollPosition(){t(this,x).scrollElement.scroll({top:0,left:0,behavior:"instant"})}saveState(e){r(this,Z,e)}clearState(){const e=t(this,Z);return r(this,Z,null),e}}x=new WeakMap,X=new WeakMap,A=new WeakMap,R=new WeakMap,Y=new WeakMap,z=new WeakMap,Z=new WeakMap,j=new WeakMap,V=new WeakMap,_=new WeakMap,lt=new WeakMap;var M,tt,L,O,m,K,B,F,C,ht,N,$,et,it,ct,st,d,Mt,ut,St,Tt,_t,xt,Nt,qt,Ut,bt,at;const rt=class rt{constructor(e){l(this,d);l(this,M,null);l(this,tt,null);l(this,L,[]);l(this,O);l(this,m,null);l(this,K);l(this,B,[]);l(this,F,!1);l(this,C,null);l(this,ht,!1);l(this,N,new Map);l(this,$,null);l(this,et,0);l(this,it,0);l(this,ct);l(this,st);l(this,ut,e=>{var i;return((i=e.getAttribute("href"))==null?void 0:i.startsWith("/"))&&!e.hasAttribute("download")&&!e.hasAttribute("data-morph-skip")&&!e.closest("[data-morph-skip]")&&e.getAttribute("target")!=="_blank"});l(this,bt,e=>W(this,null,function*(){e.preventDefault(),r(this,F,!0),yield this.navigate(location.href.replace(location.origin,""),{historyAction:"none",submorph:t(this,st)?void 0:t(this,ct),revalidate:t(this,st)}),r(this,F,!1)}));l(this,at,()=>{const{left:e,top:i}=this.scrollValue,s=i-t(this,it),h=e-t(this,et);r(this,it,i),r(this,et,e),document.documentElement.classList.toggle("scroll-y",i>0),document.documentElement.classList.toggle("scroll-x",e>0),document.documentElement.classList.toggle("scroll-y-forward",s>0),document.documentElement.classList.toggle("scroll-y-backward",s<0),document.documentElement.classList.toggle("scroll-x-forward",h>0),document.documentElement.classList.toggle("scroll-x-backward",h<0),T.dispatchEvent(document,"morphScroll",{detail:{left:e,top:i}})});if(Qt.isBrowser&&!rt.instance){rt.instance=this,r(this,M,{base:nt.normalizeBase(e==null?void 0:e.base),waitForHeadToLoad:(e==null?void 0:e.waitForHeadToLoad)!==!1,trailingSlash:(e==null?void 0:e.trailingSlash)||!1,scrollSelector:e==null?void 0:e.scrollSelector,morphInsideScrollContainer:(e==null?void 0:e.morphInsideScrollContainer)||!1}),r(this,tt,p(this,d,Tt).call(this,document.body));const i=this.normalizePath(location.pathname+location.search+location.hash);r(this,m,i);const s=new Jt(this,t(this,m).pathname);s.setInitialDocument(document),t(this,N).set(t(this,m).pathname,s),document.documentElement.setAttribute("data-current-pathname",t(this,m).pathname),document.documentElement.setAttribute("data-current-leaf",i.leaf),this.findLinks(),history.scrollRestoration="manual",addEventListener("popstate",t(this,bt)),nt.changeHistory({action:"replace",pathname:i.pathname,searchParameters:i.parameters,hash:i.hash}),r(this,$,new Zt),p(this,d,qt).call(this,document)}}get currentURL(){return t(this,m)}get previousURL(){return t(this,K)}get links(){return t(this,L)}get scrollElement(){return t(this,C)}get isPopstateNavigation(){return t(this,F)}get scrollValue(){let e=0,i=0;return t(this,ht)?(e=window.scrollY,i=window.scrollX):(e=t(this,C).scrollTop,i=t(this,C).scrollLeft),{top:e,left:i}}saveState(e){const i=t(this,N).get(t(this,m).path);i&&i.saveState(e)}getState(){const e=t(this,N).get(t(this,m).path);return e==null?void 0:e.clearState()}normalizePath(e){return nt.splitPath(e,{base:t(this,M).base,trailingSlash:t(this,M).trailingSlash})}prefetch(e,i){return W(this,null,function*(){var h;if(t(this,B).length)return;e=((h=this.pathnameModifier)==null?void 0:h.call(this,e))||e;const s=p(this,d,St).call(this,e);s==null||s.fetch(e,t(this,m).path,i)})}excludeHeadChild(e){return!1}setHeaders(e){}navigate(dt){return W(this,arguments,function*(e,{historyAction:i="push",centerScroll:s,offsetScroll:h,scrollBehaviour:g,revalidate:E,keepSearchParameters:w,submorph:f,submorphAppend:v,clearState:Lt,keepScrollPosition:yt}={}){var q,It,Dt,zt;if(t(this,B).length)return;r(this,ct,f),r(this,st,E);const mt=((q=this.pathnameModifier)==null?void 0:q.call(this,e))||e,c=this.normalizePath(mt);if(t(this,L).forEach(G=>{G.checkCurrent(c.path)}),!E&&(((It=t(this,O))==null?void 0:It.pathname)===c.pathname||t(this,m).pathname===c.pathname)){p(this,d,Ut).call(this,c.hash||0,{centerScroll:s,offsetScroll:h,behavior:"smooth"}),T.dispatchEvent(document,"morphSamePath",{custom:!0}),((Dt=t(this,m))==null?void 0:Dt.parameters)!==c.parameters&&(r(this,K,t(this,m)),r(this,m,c),nt.changeHistory({action:((zt=t(this,m))==null?void 0:zt.hash)!==c.hash?"replace":i,pathname:c.pathname,searchParameters:c.parameters,hash:c.hash}),T.dispatchEvent(document,"morphURLParametersChange",{detail:{newURL:t(this,m),previousURL:t(this,K)}}));return}r(this,O,c);try{let G=!0;if(this.preprocessor)try{yield new Promise((n,y)=>{var k;(k=this.preprocessor)==null||k.call(this,{url:c,resolve:n,reject:y,submorph:f})})}catch(n){n?console.error(n):console.log("Route change canceled"),G=!1}if(!G||t(this,O).pathname!==c.pathname){t(this,L).forEach(n=>{n.checkCurrent(t(this,m).path)});return}const Vt={url:c,submorph:f};f?v||f.forEach(n=>{document.querySelectorAll(n).forEach(y=>{y.classList.add("out"),y.setAttribute("data-morph-out","")})}):t(this,tt).forEach(n=>{var y,k;(y=n.firstElementChild)==null||y.classList.add("out"),(k=n.firstElementChild)==null||k.setAttribute("data-morph-out","")}),T.dispatchEvent(document,"morphNavigation",{detail:Vt});const wt=p(this,d,St).call(this,t(this,m).pathname),S=p(this,d,St).call(this,c.pathname);if(t(this,N).forEach(n=>{n.pathname!==c.pathname&&n.abort()}),yield S==null?void 0:S.fetch(mt,t(this,m).path,E),t(this,O).pathname!==c.pathname){t(this,L).forEach(n=>{n.checkCurrent(t(this,m).path)});return}wt.clearState(),wt.saveScrollState(),wt.saveDocumentState(),(!t(this,F)||E)&&(S.clearScrollState(),S.clearDocumentState()),Lt&&S.clearState(),S.cloneDocument(),t(this,$).textContent=S.title,document.body.appendChild(t(this,$));const ft=Pt(Et({},Vt),{document:S.document});v||ft.document.querySelectorAll("[data-morph-out]").forEach(n=>{n.classList.remove("out")}),T.dispatchEvent(document,"morphStart",{detail:ft});const Ot=Array.from(document.head.children),Bt=Array.from(S.document.head.children),Ft=p(this,d,_t).call(this,Ot,Bt),te=p(this,d,xt).call(this,Ot,Ft),pt=p(this,d,xt).call(this,Bt,Ft).filter(n=>!this.excludeHeadChild(n));pt.forEach((n,y)=>{n.tagName==="SCRIPT"&&(pt[y]=p(this,d,Mt).call(this,n))}),pt.forEach(n=>{document.head.appendChild(n)});const At=pt.filter(n=>{if(n.hasAttribute("data-no-waiting"))return!1;if(p(this,d,Nt).call(this,n))return!0});t(this,M).waitForHeadToLoad&&At.length&&(yield new Promise(n=>W(this,null,function*(){let y=0;try{for(var k=$t(At),ie,U,H;ie=!(U=yield k.next()).done;ie=!1){const gt=U.value;gt.onload=()=>{y++,y===At.length&&n()}}}catch(U){H=[U]}finally{try{ie&&(U=k.return)&&(yield U.call(k))}finally{if(H)throw H[0]}}}))),yield Gt.wait(10);const Wt=[];v||te.forEach(n=>{n.hasAttribute("data-permanent")||(p(this,d,Nt).call(this,n)?Wt.push(n):n.remove())});const ee=p(this,d,Tt).call(this,S.document.body);!t(this,M).morphInsideScrollContainer&&!f&&p(this,d,qt).call(this,S.document),document.documentElement.setAttribute("data-current-pathname",c.pathname),document.documentElement.setAttribute("data-current-leaf",c.leaf),nt.changeHistory({action:i,pathname:c.pathname,searchParameters:c.parameters||(w?location.search:""),hash:c.hash}),t(this,$).remove(),r(this,K,t(this,m)),r(this,m,c);const kt=[];t(this,tt).forEach((n,y)=>{const k=ee[y],ie=getComputedStyle(n).getPropertyValue("--morph-duration");let U=[],H=[];f?(f.forEach(u=>{const b=n.querySelector(u),I=k.querySelector(u);b&&I&&(H.push(b),U.push(I))}),H.forEach(u=>{u.parentElement&&kt.push(u.parentElement)})):(U.push(...k.childNodes),H.push(...n.childNodes),kt.push(n)),v||H.forEach(u=>{u instanceof HTMLElement&&(this.destroyOldLinks(u),u.classList.add("old"))}),U.forEach(u=>{u instanceof HTMLElement&&(this.findNewLinks(u),u.classList.add("new"))}),f?v?U.forEach((u,b)=>{H[b]instanceof HTMLElement&&H[b].append(...u.childNodes)}):U.forEach((u,b)=>{var I;(I=H[b].parentElement)==null||I.insertBefore(u,H[b])}):n.prepend(...U),he.requestIdleCallback(()=>{v||H.forEach(u=>{u instanceof HTMLElement&&u.classList.add("old-idle")}),U.forEach(u=>{var b;u instanceof HTMLElement&&((b=u.parentElement)==null||b.style.setProperty("--new-content-height",u.offsetHeight+"px"),u.classList.add("new-idle"))})});const gt=Pt(Et({},ft),{morphElement:n});T.dispatchEvent(document,"morphNewChildrenAdded",{detail:gt});const se=new Promise(u=>{setTimeout(()=>{v||H.forEach(b=>b.remove()),U.forEach(b=>{var I;b instanceof HTMLElement&&((I=b.parentElement)==null||I.style.removeProperty("--new-content-height"),b.classList.remove("new-idle","new"))}),v||T.dispatchEvent(document,"morphOldChildrenRemoved",{detail:gt}),u()},(parseFloat(ie)||0)*1e3+10)});t(this,B).push(se)}),this.isPopstateNavigation?document.documentElement.style.setProperty("--new-document-scroll-position",(this.scrollValue.top-S.scrollState.y)*1+"px"):document.documentElement.style.setProperty("--new-document-scroll-position",this.scrollValue.top+"px"),T.dispatchEvent(document,"morphBeforeNavigationScroll",{detail:S.scrollState}),c.hash?(S.clearScrollState(),p(this,d,Ut).call(this,c.hash,{centerScroll:s,offsetScroll:h,behavior:g})):t(this,F)?S.restoreScrollPosition():yt||S.renewScrollPosition(),yield Promise.all(t(this,B)),v||Wt.forEach(n=>n.remove()),r(this,B,[]),kt.forEach(n=>{n.querySelectorAll("script").forEach(k=>{k.replaceWith(p(this,d,Mt).call(this,k))})}),t(this,L).forEach(n=>{n.checkCurrent(t(this,m).path)}),T.dispatchEvent(document,"morphComplete",{detail:ft}),document.documentElement.style.removeProperty("--new-document-scroll-position"),window.dispatchEvent(new Event("resize"))}catch(G){console.error(G)}r(this,O,void 0)})}addLink(e){t(this,L).push(new Ht(e,this))}addLinks(e){e.forEach(i=>{this.addLink(i)})}removeLink(e){r(this,L,t(this,L).filter(i=>i.element===e?(i.destroy(),!1):!0))}destroyOldLinks(e){r(this,L,t(this,L).filter(i=>e.contains(i.element)?(i.destroy(),!1):!0))}findNewLinks(e){const i=[...e.querySelectorAll("a")].filter(t(this,ut));t(this,L).push(...i.map(s=>new Ht(s,this)))}findLinks(){const e=[...document.documentElement.querySelectorAll("a")].filter(t(this,ut));t(this,L).forEach(i=>i.destroy()),r(this,L,e.map(i=>new Ht(i,this)))}};M=new WeakMap,tt=new WeakMap,L=new WeakMap,O=new WeakMap,m=new WeakMap,K=new WeakMap,B=new WeakMap,F=new WeakMap,C=new WeakMap,ht=new WeakMap,N=new WeakMap,$=new WeakMap,et=new WeakMap,it=new WeakMap,ct=new WeakMap,st=new WeakMap,d=new WeakSet,Mt=function(e){const i=document.createElement("script");for(let s=0;s<e.attributes.length;s++){const h=e.attributes[s];i.setAttribute(h.name,h.value)}return e.hasAttribute("src")||(i.innerHTML=e.innerHTML),i},ut=new WeakMap,St=function(e){const i=this.normalizePath(e);let s=t(this,N).get(i.pathname);return s||(s=new Jt(this,i.pathname),t(this,N).set(i.pathname,s)),s},Tt=function(e){const i=[...e.querySelectorAll("[data-morph]")];return i.length?i:[e]},_t=function(e,i){return e.filter(s=>i.find(h=>h.outerHTML===s.outerHTML))},xt=function(e,i){return e.filter(s=>!i.find(h=>h.outerHTML===s.outerHTML))},Nt=function(e){return e.tagName==="SCRIPT"||e.tagName==="STYLE"||e.tagName==="LINK"&&e.getAttribute("rel")==="stylesheet"},qt=function(e){var i,s;(i=t(this,C))==null||i.removeEventListener("scroll",t(this,at)),r(this,it,0),r(this,et,0),r(this,C,t(this,M).scrollSelector&&e.querySelector(t(this,M).scrollSelector)||window),r(this,ht,t(this,C)===window),(s=t(this,C))==null||s.addEventListener("scroll",t(this,at)),t(this,at).call(this)},Ut=function(e,i){const s=typeof e=="string"?document.getElementById(e):e;(typeof s=="number"||s)&&Gt.scrollToElement(s,{scrollElement:t(this,C),behavior:(i==null?void 0:i.behavior)||"instant",center:i==null?void 0:i.centerScroll,offset:i==null?void 0:i.offsetScroll})},bt=new WeakMap,at=new WeakMap,rt.instance=null;let Rt=rt;exports.Morph=Rt;