aptechka 0.92.4 → 0.92.6
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/{DragControls-QzcTE5Pt.js → DragControls-DSG2Orh3.js} +1 -1
- package/lib/{DragControls-Cwnszjzf.cjs → DragControls-DZ0Np8yt.cjs} +1 -1
- package/lib/{Tweened-DuJCwQl7.js → Tweened-CZeS3EqK.js} +5 -3
- package/lib/{Tweened-BZoUkI7O.cjs → Tweened-j_TwbxEI.cjs} +1 -1
- package/lib/animation/index.cjs +1 -1
- package/lib/animation/index.js +1 -1
- package/lib/api-fetcher/index.cjs +1 -1
- package/lib/api-fetcher/index.d.ts +4 -0
- package/lib/api-fetcher/index.js +49 -28
- package/lib/controls/index.cjs +1 -1
- package/lib/controls/index.js +1 -1
- package/lib/morph/index.cjs +1 -1
- package/lib/morph/index.js +1 -1
- package/lib/scroll/ScrollElement.d.ts +1 -1
- package/lib/scroll/index.cjs +1 -1
- package/lib/scroll/index.js +2 -2
- package/lib/{scroll-DbYCgAnW.cjs → scroll-CTDesBpj.cjs} +1 -1
- package/lib/{scroll-CqF_88wv.js → scroll-D1MT0QMY.js} +1 -1
- package/lib/scroll-kit/index.cjs +1 -1
- package/lib/scroll-kit/index.js +1 -1
- package/lib/utils/easings.d.ts +2 -0
- package/lib/utils/index.cjs +1 -1
- package/lib/utils/index.js +38 -13
- package/lib/utils/progress.d.ts +4 -0
- package/package.json +1 -1
|
@@ -9,7 +9,7 @@ import { i as isBrowser } from "./Store-CAGUSjFX.js";
|
|
|
9
9
|
import { g as getElement } from "./dom-D8D-_9ty.js";
|
|
10
10
|
import { i as intersector, t as ticker } from "./index-DAG0CtYo.js";
|
|
11
11
|
import "construct-style-sheets-polyfill";
|
|
12
|
-
import { T as Tweened, e as easeInQuad } from "./Tweened-
|
|
12
|
+
import { T as Tweened, e as easeInQuad } from "./Tweened-CZeS3EqK.js";
|
|
13
13
|
import { s as setupDrag } from "./gestures-DmKKNnh4.js";
|
|
14
14
|
import { p as preciseNumber } from "./number-DiVt2xnh.js";
|
|
15
15
|
import { TICK_ORDER } from "./order/index.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var __defProp=Object.defineProperty;var __typeError=msg=>{throw TypeError(msg)};var __name=(target,value)=>__defProp(target,"name",{value,configurable:!0});var __accessCheck=(obj,member,msg)=>member.has(obj)||__typeError("Cannot "+msg);var __privateGet=(obj,member,getter)=>(__accessCheck(obj,member,"read from private field"),getter?getter.call(obj):member.get(obj)),__privateAdd=(obj,member,value)=>member.has(obj)?__typeError("Cannot add the same private member more than once"):member instanceof WeakSet?member.add(obj):member.set(obj,value),__privateSet=(obj,member,value,setter)=>(__accessCheck(obj,member,"write to private field"),setter?setter.call(obj,value):member.set(obj,value),value),__privateMethod=(obj,member,method)=>(__accessCheck(obj,member,"access private method"),method);const Store=require("./Store-B96mD8mD.cjs"),dom=require("./dom-B40i6NXw.cjs"),ticker_index=require("./index-BoGx2BWX.cjs");require("construct-style-sheets-polyfill");const Tweened=require("./Tweened-BZoUkI7O.cjs"),gestures=require("./gestures-DtYbQr49.cjs"),number=require("./number-Bu4sGvW7.cjs"),order_index=require("./order/index.cjs"),notifier_index=require("./notifier/index.cjs");var _changeEvent;const _Controls=class _Controls{constructor(){__privateAdd(this,_changeEvent,new notifier_index.Notifier)}get changeEvent(){return __privateGet(this,_changeEvent)}};_changeEvent=new WeakMap,__name(_Controls,"Controls");let Controls=_Controls;var _element,_dimensionElement,_dimension,_keydownListener;const _KeyboardControls=class _KeyboardControls extends Controls{constructor(options){super();__privateAdd(this,_element,null);__privateAdd(this,_dimensionElement,null);__privateAdd(this,_dimension,"offsetHeight");__privateAdd(this,_keydownListener,__name(e=>{const dir=e.shiftKey?-1:1;let value;e.code==="Space"?value=dir*__privateGet(this,_dimensionElement)[__privateGet(this,_dimension)]*.4:e.code==="ArrowLeft"?value=-1*__privateGet(this,_dimensionElement)[__privateGet(this,_dimension)]*.2:e.code==="ArrowRight"?value=1*__privateGet(this,_dimensionElement)[__privateGet(this,_dimension)]*.2:e.code==="ArrowUp"?value=-1*__privateGet(this,_dimensionElement)[__privateGet(this,_dimension)]*.2:e.code==="ArrowDown"?value=1*__privateGet(this,_dimensionElement)[__privateGet(this,_dimension)]*.2:e.code==="PageUp"?value=-1*__privateGet(this,_dimensionElement)[__privateGet(this,_dimension)]:e.code==="PageDown"?value=1*__privateGet(this,_dimensionElement)[__privateGet(this,_dimension)]:e.code==="Home"?value=0:e.code==="End"&&(value=__privateGet(this,_dimension)==="offsetWidth"?__privateGet(this,_dimensionElement).scrollWidth:__privateGet(this,_dimensionElement).scrollHeight),value&&(e.stopPropagation(),this.changeEvent.notify("keyboard",value,e))},"#keydownListener"));Store.isBrowser&&(__privateSet(this,_element,options!=null&&options.element&&dom.getElement(options.element)||window),__privateSet(this,_dimensionElement,__privateGet(this,_element)instanceof HTMLElement?__privateGet(this,_element):document.documentElement),this.dimension=options==null?void 0:options.dimension)}set dimension(value){__privateSet(this,_dimension,value==="width"?"offsetWidth":"offsetHeight")}connect(){Store.isBrowser&&__privateGet(this,_element).addEventListener("keydown",__privateGet(this,_keydownListener))}disconnect(){Store.isBrowser&&__privateGet(this,_element).removeEventListener("keydown",__privateGet(this,_keydownListener))}};_element=new WeakMap,_dimensionElement=new WeakMap,_dimension=new WeakMap,_keydownListener=new WeakMap,__name(_KeyboardControls,"KeyboardControls");let KeyboardControls=_KeyboardControls;var _speed,_interval,_options,_intervalId,_paused,_pauseTimeoutId,_connected,_isIntersecting,_AutoplayControls_instances,setup_fn,clear_fn,startInterval_fn,_animationFrameCallback,_intervalCallback,_documentVisibilityChangeListener,_intersectionListener;const _AutoplayControls=class _AutoplayControls extends Controls{constructor(options){super();__privateAdd(this,_AutoplayControls_instances);__privateAdd(this,_speed);__privateAdd(this,_interval);__privateAdd(this,_options);__privateAdd(this,_intervalId);__privateAdd(this,_paused);__privateAdd(this,_pauseTimeoutId);__privateAdd(this,_connected);__privateAdd(this,_isIntersecting);__privateAdd(this,_animationFrameCallback);__privateAdd(this,_intervalCallback);__privateAdd(this,_documentVisibilityChangeListener);__privateAdd(this,_intersectionListener);this.direction=1,__privateSet(this,_paused,new Tweened.Tweened(0,{easing:Tweened.easeInQuad})),__privateSet(this,_connected,!1),__privateSet(this,_isIntersecting,!1),__privateSet(this,_animationFrameCallback,e=>{__privateGet(this,_paused).current!==1&&this.changeEvent.notify("autoplay",e.timeBetweenFrames*__privateGet(this,_speed)*this.direction*(1-__privateGet(this,_paused).current),e)}),__privateSet(this,_intervalCallback,()=>{__privateGet(this,_isIntersecting)&&__privateGet(this,_paused).current!==1&&this.changeEvent.notify("autoplay",Math.sign(__privateGet(this,_speed))*this.direction*(1-__privateGet(this,_paused).current),null)}),__privateSet(this,_documentVisibilityChangeListener,()=>{__privateGet(this,_interval)&&(document.hidden?__privateGet(this,_paused).set(1,{equalize:!0}):__privateGet(this,_paused).set(0,{equalize:!0}))}),__privateSet(this,_intersectionListener,e=>{__privateSet(this,_isIntersecting,e.isIntersecting),__privateGet(this,_isIntersecting)?__privateMethod(this,_AutoplayControls_instances,startInterval_fn).call(this):clearInterval(__privateGet(this,_intervalId))}),__privateSet(this,_speed,(options==null?void 0:options.speed)||1),__privateSet(this,_interval,(options==null?void 0:options.interval)||!1),__privateSet(this,_options,options)}set interval(value){__privateSet(this,_interval,value),__privateGet(this,_connected)&&__privateMethod(this,_AutoplayControls_instances,setup_fn).call(this)}set speed(value){__privateSet(this,_speed,value),__privateGet(this,_connected)&&__privateMethod(this,_AutoplayControls_instances,setup_fn).call(this)}connect(){__privateGet(this,_connected)||(__privateSet(this,_connected,!0),__privateMethod(this,_AutoplayControls_instances,setup_fn).call(this))}disconnect(){__privateGet(this,_connected)&&(__privateSet(this,_connected,!1),__privateMethod(this,_AutoplayControls_instances,clear_fn).call(this))}pauseAndContinue(duration,instant){__privateGet(this,_connected)&&duration&&(clearTimeout(__privateGet(this,_pauseTimeoutId)),__privateGet(this,_paused).set(1,{duration:Math.min(duration,1e3),equalize:instant}),__privateSet(this,_pauseTimeoutId,setTimeout(()=>{__privateGet(this,_paused).set(0,{duration:Math.min(duration,5e3),equalize:instant})},duration)))}};_speed=new WeakMap,_interval=new WeakMap,_options=new WeakMap,_intervalId=new WeakMap,_paused=new WeakMap,_pauseTimeoutId=new WeakMap,_connected=new WeakMap,_isIntersecting=new WeakMap,_AutoplayControls_instances=new WeakSet,setup_fn=__name(function(){var _a,_b;__privateMethod(this,_AutoplayControls_instances,clear_fn).call(this),__privateGet(this,_interval)?(_a=__privateGet(this,_options))!=null&&_a.culling?ticker_index.intersector.subscribe((_b=__privateGet(this,_options))==null?void 0:_b.culling,__privateGet(this,_intersectionListener)):__privateMethod(this,_AutoplayControls_instances,startInterval_fn).call(this):ticker_index.ticker.subscribe(__privateGet(this,_animationFrameCallback),__privateGet(this,_options)),document.addEventListener("visibilitychange",__privateGet(this,_documentVisibilityChangeListener))},"#setup"),clear_fn=__name(function(){clearInterval(__privateGet(this,_intervalId)),ticker_index.ticker.unsubscribe(__privateGet(this,_animationFrameCallback)),ticker_index.intersector.unsubscribe(__privateGet(this,_intersectionListener)),clearTimeout(__privateGet(this,_pauseTimeoutId)),__privateGet(this,_paused).close(),document.removeEventListener("visibilitychange",__privateGet(this,_documentVisibilityChangeListener))},"#clear"),startInterval_fn=__name(function(){clearInterval(__privateGet(this,_intervalId)),__privateSet(this,_intervalId,setInterval(__privateGet(this,_intervalCallback),Math.abs(__privateGet(this,_speed))))},"#startInterval"),_animationFrameCallback=new WeakMap,_intervalCallback=new WeakMap,_documentVisibilityChangeListener=new WeakMap,_intersectionListener=new WeakMap,__name(_AutoplayControls,"AutoplayControls");let AutoplayControls=_AutoplayControls;var _element2,_timeoutId,_prevEventDate,_wheelListener;const _WheelControls=class _WheelControls extends Controls{constructor(options){super();__privateAdd(this,_element2,null);__privateAdd(this,_timeoutId);__privateAdd(this,_prevEventDate);__privateAdd(this,_wheelListener,__name(event=>{let delta=0;const absY=Math.abs(event.deltaY),absX=Math.abs(event.deltaX);if(!(this.axis==="x"&&absY>absX||this.axis==="y"&&absX>absY)&&(event.preventDefault(),!(this.debounce&&this.axis==="x"&&absX<5||this.debounce&&this.axis==="y"&&absY<5)))if(delta=(this.axis==="max"?absX>absY?event.deltaX:event.deltaY:this.axis==="x"?event.deltaX:event.deltaY)*this.speed,event.stopPropagation(),this.debounce){const now=Date.now();if(now-__privateGet(this,_prevEventDate)>40&&(delta=100*Math.sign(delta)),__privateSet(this,_prevEventDate,now),Math.abs(delta)<100||__privateGet(this,_timeoutId))return;this.changeEvent.notify("wheel",delta,event),__privateSet(this,_timeoutId,setTimeout(()=>{__privateSet(this,_timeoutId,void 0)},80))}else this.changeEvent.notify("wheel",delta,event)},"#wheelListener"));this.axis=(options==null?void 0:options.axis)||"y",this.speed=(options==null?void 0:options.speed)||1,this.debounce=(options==null?void 0:options.debounce)||!1,__privateSet(this,_prevEventDate,Date.now()),Store.isBrowser&&__privateSet(this,_element2,options!=null&&options.element&&dom.getElement(options.element)||window)}connect(){Store.isBrowser&&__privateGet(this,_element2).addEventListener("wheel",__privateGet(this,_wheelListener),{passive:!1})}disconnect(){Store.isBrowser&&(__privateGet(this,_element2).removeEventListener("wheel",__privateGet(this,_wheelListener)),clearTimeout(__privateGet(this,_timeoutId)))}};_element2=new WeakMap,_timeoutId=new WeakMap,_prevEventDate=new WeakMap,_wheelListener=new WeakMap,__name(_WheelControls,"WheelControls");let WheelControls=_WheelControls;var _currentElement,_rootElement,_element3,_delta,_linkElements,_dragDelta,_linkClickListener,_pointerdownListener,_tickListener;const _DragControls=class _DragControls extends Controls{constructor(options){super();__privateAdd(this,_rootElement);__privateAdd(this,_element3);__privateAdd(this,_delta);__privateAdd(this,_linkElements);__privateAdd(this,_dragDelta);__privateAdd(this,_linkClickListener);__privateAdd(this,_pointerdownListener);__privateAdd(this,_tickListener);this.inertion=1,__privateSet(this,_rootElement,null),__privateSet(this,_element3,null),__privateSet(this,_delta,0),__privateSet(this,_linkElements,[]),__privateSet(this,_dragDelta,0),__privateSet(this,_linkClickListener,e=>{Math.abs(__privateGet(this,_dragDelta))>2&&e.preventDefault()}),__privateSet(this,_pointerdownListener,grabEvent=>{if(__privateSet(this,_dragDelta,0),__privateSet(this,_delta,0),grabEvent.button!==0||grabEvent.composedPath().find(p=>p instanceof HTMLElement&&p.hasAttribute("drag-dead-zone")))return;this.swipe||ticker_index.ticker.unsubscribe(__privateGet(this,_tickListener));let prev=grabEvent,okToNotify=!1;document.documentElement.classList.add("grabbing");let dx=0,dy=0,ddx=0,ddy=0;gestures.setupDrag(moveEvent=>{__privateGet(_DragControls,_currentElement)&&__privateGet(_DragControls,_currentElement)!==__privateGet(this,_element3)||(dx=prev.x-moveEvent.x,dy=prev.y-moveEvent.y,ddx=moveEvent.x-grabEvent.x,ddy=moveEvent.y-grabEvent.y,this.axis==="x"?(__privateSet(this,_dragDelta,ddx),__privateSet(this,_delta,dx)):(__privateSet(this,_dragDelta,ddy),__privateSet(this,_delta,dy)),prev=moveEvent,okToNotify=this.axis==="x"&&Math.abs(ddx)>Math.abs(ddy)||this.axis==="y"&&Math.abs(ddy)>Math.abs(ddx),okToNotify&&(document.documentElement.classList.add("dragging"),document.documentElement.classList.add("click-disabled"),__privateSet(_DragControls,_currentElement,__privateGet(this,_element3)),this.changeEvent.notify("drag",__privateGet(this,_delta),moveEvent)))},e=>{__privateSet(_DragControls,_currentElement,null),okToNotify&&(!this.swipe&&this.inertion?(__privateSet(this,_delta,__privateGet(this,_delta)*this.inertion),ticker_index.ticker.subscribe(__privateGet(this,_tickListener),{order:order_index.TICK_ORDER.CONTROLS-1})):this.swipe&&this.changeEvent.notify("drag-end",__privateGet(this,_delta),e)),setTimeout(()=>{document.documentElement.classList.remove("grabbing"),document.documentElement.classList.remove("dragging"),document.documentElement.classList.remove("click-disabled")})})}),__privateSet(this,_tickListener,()=>{Math.floor(Math.abs(__privateGet(this,_delta)))||ticker_index.ticker.unsubscribe(__privateGet(this,_tickListener)),__privateSet(this,_delta,__privateGet(this,_delta)*.95),__privateSet(this,_delta,number.preciseNumber(__privateGet(this,_delta),3)),this.changeEvent.notify("drag",__privateGet(this,_delta),null)}),this.axis=(options==null?void 0:options.axis)||"y",this.swipe=(options==null?void 0:options.swipe)||!1,Store.isBrowser&&(__privateSet(this,_element3,options!=null&&options.element&&dom.getElement(options.element)||document.documentElement),__privateSet(this,_rootElement,(options==null?void 0:options.rootElement)||__privateGet(this,_element3)))}connect(){Store.isBrowser&&(__privateSet(this,_linkElements,[...__privateGet(this,_rootElement).querySelectorAll("a")]),__privateGet(this,_linkElements).forEach(element=>{element.addEventListener("click",__privateGet(this,_linkClickListener))}),__privateGet(this,_element3).addEventListener("pointerdown",__privateGet(this,_pointerdownListener)))}disconnect(){Store.isBrowser&&(__privateGet(this,_linkElements).forEach(element=>{element.removeEventListener("click",__privateGet(this,_linkClickListener))}),__privateGet(this,_element3).removeEventListener("pointerdown",__privateGet(this,_pointerdownListener)),ticker_index.ticker.unsubscribe(__privateGet(this,_tickListener)))}};_currentElement=new WeakMap,_rootElement=new WeakMap,_element3=new WeakMap,_delta=new WeakMap,_linkElements=new WeakMap,_dragDelta=new WeakMap,_linkClickListener=new WeakMap,_pointerdownListener=new WeakMap,_tickListener=new WeakMap,__name(_DragControls,"DragControls"),__privateAdd(_DragControls,_currentElement,null);let DragControls=_DragControls;exports.AutoplayControls=AutoplayControls;exports.Controls=Controls;exports.DragControls=DragControls;exports.KeyboardControls=KeyboardControls;exports.WheelControls=WheelControls;
|
|
1
|
+
"use strict";var __defProp=Object.defineProperty;var __typeError=msg=>{throw TypeError(msg)};var __name=(target,value)=>__defProp(target,"name",{value,configurable:!0});var __accessCheck=(obj,member,msg)=>member.has(obj)||__typeError("Cannot "+msg);var __privateGet=(obj,member,getter)=>(__accessCheck(obj,member,"read from private field"),getter?getter.call(obj):member.get(obj)),__privateAdd=(obj,member,value)=>member.has(obj)?__typeError("Cannot add the same private member more than once"):member instanceof WeakSet?member.add(obj):member.set(obj,value),__privateSet=(obj,member,value,setter)=>(__accessCheck(obj,member,"write to private field"),setter?setter.call(obj,value):member.set(obj,value),value),__privateMethod=(obj,member,method)=>(__accessCheck(obj,member,"access private method"),method);const Store=require("./Store-B96mD8mD.cjs"),dom=require("./dom-B40i6NXw.cjs"),ticker_index=require("./index-BoGx2BWX.cjs");require("construct-style-sheets-polyfill");const Tweened=require("./Tweened-j_TwbxEI.cjs"),gestures=require("./gestures-DtYbQr49.cjs"),number=require("./number-Bu4sGvW7.cjs"),order_index=require("./order/index.cjs"),notifier_index=require("./notifier/index.cjs");var _changeEvent;const _Controls=class _Controls{constructor(){__privateAdd(this,_changeEvent,new notifier_index.Notifier)}get changeEvent(){return __privateGet(this,_changeEvent)}};_changeEvent=new WeakMap,__name(_Controls,"Controls");let Controls=_Controls;var _element,_dimensionElement,_dimension,_keydownListener;const _KeyboardControls=class _KeyboardControls extends Controls{constructor(options){super();__privateAdd(this,_element,null);__privateAdd(this,_dimensionElement,null);__privateAdd(this,_dimension,"offsetHeight");__privateAdd(this,_keydownListener,__name(e=>{const dir=e.shiftKey?-1:1;let value;e.code==="Space"?value=dir*__privateGet(this,_dimensionElement)[__privateGet(this,_dimension)]*.4:e.code==="ArrowLeft"?value=-1*__privateGet(this,_dimensionElement)[__privateGet(this,_dimension)]*.2:e.code==="ArrowRight"?value=1*__privateGet(this,_dimensionElement)[__privateGet(this,_dimension)]*.2:e.code==="ArrowUp"?value=-1*__privateGet(this,_dimensionElement)[__privateGet(this,_dimension)]*.2:e.code==="ArrowDown"?value=1*__privateGet(this,_dimensionElement)[__privateGet(this,_dimension)]*.2:e.code==="PageUp"?value=-1*__privateGet(this,_dimensionElement)[__privateGet(this,_dimension)]:e.code==="PageDown"?value=1*__privateGet(this,_dimensionElement)[__privateGet(this,_dimension)]:e.code==="Home"?value=0:e.code==="End"&&(value=__privateGet(this,_dimension)==="offsetWidth"?__privateGet(this,_dimensionElement).scrollWidth:__privateGet(this,_dimensionElement).scrollHeight),value&&(e.stopPropagation(),this.changeEvent.notify("keyboard",value,e))},"#keydownListener"));Store.isBrowser&&(__privateSet(this,_element,options!=null&&options.element&&dom.getElement(options.element)||window),__privateSet(this,_dimensionElement,__privateGet(this,_element)instanceof HTMLElement?__privateGet(this,_element):document.documentElement),this.dimension=options==null?void 0:options.dimension)}set dimension(value){__privateSet(this,_dimension,value==="width"?"offsetWidth":"offsetHeight")}connect(){Store.isBrowser&&__privateGet(this,_element).addEventListener("keydown",__privateGet(this,_keydownListener))}disconnect(){Store.isBrowser&&__privateGet(this,_element).removeEventListener("keydown",__privateGet(this,_keydownListener))}};_element=new WeakMap,_dimensionElement=new WeakMap,_dimension=new WeakMap,_keydownListener=new WeakMap,__name(_KeyboardControls,"KeyboardControls");let KeyboardControls=_KeyboardControls;var _speed,_interval,_options,_intervalId,_paused,_pauseTimeoutId,_connected,_isIntersecting,_AutoplayControls_instances,setup_fn,clear_fn,startInterval_fn,_animationFrameCallback,_intervalCallback,_documentVisibilityChangeListener,_intersectionListener;const _AutoplayControls=class _AutoplayControls extends Controls{constructor(options){super();__privateAdd(this,_AutoplayControls_instances);__privateAdd(this,_speed);__privateAdd(this,_interval);__privateAdd(this,_options);__privateAdd(this,_intervalId);__privateAdd(this,_paused);__privateAdd(this,_pauseTimeoutId);__privateAdd(this,_connected);__privateAdd(this,_isIntersecting);__privateAdd(this,_animationFrameCallback);__privateAdd(this,_intervalCallback);__privateAdd(this,_documentVisibilityChangeListener);__privateAdd(this,_intersectionListener);this.direction=1,__privateSet(this,_paused,new Tweened.Tweened(0,{easing:Tweened.easeInQuad})),__privateSet(this,_connected,!1),__privateSet(this,_isIntersecting,!1),__privateSet(this,_animationFrameCallback,e=>{__privateGet(this,_paused).current!==1&&this.changeEvent.notify("autoplay",e.timeBetweenFrames*__privateGet(this,_speed)*this.direction*(1-__privateGet(this,_paused).current),e)}),__privateSet(this,_intervalCallback,()=>{__privateGet(this,_isIntersecting)&&__privateGet(this,_paused).current!==1&&this.changeEvent.notify("autoplay",Math.sign(__privateGet(this,_speed))*this.direction*(1-__privateGet(this,_paused).current),null)}),__privateSet(this,_documentVisibilityChangeListener,()=>{__privateGet(this,_interval)&&(document.hidden?__privateGet(this,_paused).set(1,{equalize:!0}):__privateGet(this,_paused).set(0,{equalize:!0}))}),__privateSet(this,_intersectionListener,e=>{__privateSet(this,_isIntersecting,e.isIntersecting),__privateGet(this,_isIntersecting)?__privateMethod(this,_AutoplayControls_instances,startInterval_fn).call(this):clearInterval(__privateGet(this,_intervalId))}),__privateSet(this,_speed,(options==null?void 0:options.speed)||1),__privateSet(this,_interval,(options==null?void 0:options.interval)||!1),__privateSet(this,_options,options)}set interval(value){__privateSet(this,_interval,value),__privateGet(this,_connected)&&__privateMethod(this,_AutoplayControls_instances,setup_fn).call(this)}set speed(value){__privateSet(this,_speed,value),__privateGet(this,_connected)&&__privateMethod(this,_AutoplayControls_instances,setup_fn).call(this)}connect(){__privateGet(this,_connected)||(__privateSet(this,_connected,!0),__privateMethod(this,_AutoplayControls_instances,setup_fn).call(this))}disconnect(){__privateGet(this,_connected)&&(__privateSet(this,_connected,!1),__privateMethod(this,_AutoplayControls_instances,clear_fn).call(this))}pauseAndContinue(duration,instant){__privateGet(this,_connected)&&duration&&(clearTimeout(__privateGet(this,_pauseTimeoutId)),__privateGet(this,_paused).set(1,{duration:Math.min(duration,1e3),equalize:instant}),__privateSet(this,_pauseTimeoutId,setTimeout(()=>{__privateGet(this,_paused).set(0,{duration:Math.min(duration,5e3),equalize:instant})},duration)))}};_speed=new WeakMap,_interval=new WeakMap,_options=new WeakMap,_intervalId=new WeakMap,_paused=new WeakMap,_pauseTimeoutId=new WeakMap,_connected=new WeakMap,_isIntersecting=new WeakMap,_AutoplayControls_instances=new WeakSet,setup_fn=__name(function(){var _a,_b;__privateMethod(this,_AutoplayControls_instances,clear_fn).call(this),__privateGet(this,_interval)?(_a=__privateGet(this,_options))!=null&&_a.culling?ticker_index.intersector.subscribe((_b=__privateGet(this,_options))==null?void 0:_b.culling,__privateGet(this,_intersectionListener)):__privateMethod(this,_AutoplayControls_instances,startInterval_fn).call(this):ticker_index.ticker.subscribe(__privateGet(this,_animationFrameCallback),__privateGet(this,_options)),document.addEventListener("visibilitychange",__privateGet(this,_documentVisibilityChangeListener))},"#setup"),clear_fn=__name(function(){clearInterval(__privateGet(this,_intervalId)),ticker_index.ticker.unsubscribe(__privateGet(this,_animationFrameCallback)),ticker_index.intersector.unsubscribe(__privateGet(this,_intersectionListener)),clearTimeout(__privateGet(this,_pauseTimeoutId)),__privateGet(this,_paused).close(),document.removeEventListener("visibilitychange",__privateGet(this,_documentVisibilityChangeListener))},"#clear"),startInterval_fn=__name(function(){clearInterval(__privateGet(this,_intervalId)),__privateSet(this,_intervalId,setInterval(__privateGet(this,_intervalCallback),Math.abs(__privateGet(this,_speed))))},"#startInterval"),_animationFrameCallback=new WeakMap,_intervalCallback=new WeakMap,_documentVisibilityChangeListener=new WeakMap,_intersectionListener=new WeakMap,__name(_AutoplayControls,"AutoplayControls");let AutoplayControls=_AutoplayControls;var _element2,_timeoutId,_prevEventDate,_wheelListener;const _WheelControls=class _WheelControls extends Controls{constructor(options){super();__privateAdd(this,_element2,null);__privateAdd(this,_timeoutId);__privateAdd(this,_prevEventDate);__privateAdd(this,_wheelListener,__name(event=>{let delta=0;const absY=Math.abs(event.deltaY),absX=Math.abs(event.deltaX);if(!(this.axis==="x"&&absY>absX||this.axis==="y"&&absX>absY)&&(event.preventDefault(),!(this.debounce&&this.axis==="x"&&absX<5||this.debounce&&this.axis==="y"&&absY<5)))if(delta=(this.axis==="max"?absX>absY?event.deltaX:event.deltaY:this.axis==="x"?event.deltaX:event.deltaY)*this.speed,event.stopPropagation(),this.debounce){const now=Date.now();if(now-__privateGet(this,_prevEventDate)>40&&(delta=100*Math.sign(delta)),__privateSet(this,_prevEventDate,now),Math.abs(delta)<100||__privateGet(this,_timeoutId))return;this.changeEvent.notify("wheel",delta,event),__privateSet(this,_timeoutId,setTimeout(()=>{__privateSet(this,_timeoutId,void 0)},80))}else this.changeEvent.notify("wheel",delta,event)},"#wheelListener"));this.axis=(options==null?void 0:options.axis)||"y",this.speed=(options==null?void 0:options.speed)||1,this.debounce=(options==null?void 0:options.debounce)||!1,__privateSet(this,_prevEventDate,Date.now()),Store.isBrowser&&__privateSet(this,_element2,options!=null&&options.element&&dom.getElement(options.element)||window)}connect(){Store.isBrowser&&__privateGet(this,_element2).addEventListener("wheel",__privateGet(this,_wheelListener),{passive:!1})}disconnect(){Store.isBrowser&&(__privateGet(this,_element2).removeEventListener("wheel",__privateGet(this,_wheelListener)),clearTimeout(__privateGet(this,_timeoutId)))}};_element2=new WeakMap,_timeoutId=new WeakMap,_prevEventDate=new WeakMap,_wheelListener=new WeakMap,__name(_WheelControls,"WheelControls");let WheelControls=_WheelControls;var _currentElement,_rootElement,_element3,_delta,_linkElements,_dragDelta,_linkClickListener,_pointerdownListener,_tickListener;const _DragControls=class _DragControls extends Controls{constructor(options){super();__privateAdd(this,_rootElement);__privateAdd(this,_element3);__privateAdd(this,_delta);__privateAdd(this,_linkElements);__privateAdd(this,_dragDelta);__privateAdd(this,_linkClickListener);__privateAdd(this,_pointerdownListener);__privateAdd(this,_tickListener);this.inertion=1,__privateSet(this,_rootElement,null),__privateSet(this,_element3,null),__privateSet(this,_delta,0),__privateSet(this,_linkElements,[]),__privateSet(this,_dragDelta,0),__privateSet(this,_linkClickListener,e=>{Math.abs(__privateGet(this,_dragDelta))>2&&e.preventDefault()}),__privateSet(this,_pointerdownListener,grabEvent=>{if(__privateSet(this,_dragDelta,0),__privateSet(this,_delta,0),grabEvent.button!==0||grabEvent.composedPath().find(p=>p instanceof HTMLElement&&p.hasAttribute("drag-dead-zone")))return;this.swipe||ticker_index.ticker.unsubscribe(__privateGet(this,_tickListener));let prev=grabEvent,okToNotify=!1;document.documentElement.classList.add("grabbing");let dx=0,dy=0,ddx=0,ddy=0;gestures.setupDrag(moveEvent=>{__privateGet(_DragControls,_currentElement)&&__privateGet(_DragControls,_currentElement)!==__privateGet(this,_element3)||(dx=prev.x-moveEvent.x,dy=prev.y-moveEvent.y,ddx=moveEvent.x-grabEvent.x,ddy=moveEvent.y-grabEvent.y,this.axis==="x"?(__privateSet(this,_dragDelta,ddx),__privateSet(this,_delta,dx)):(__privateSet(this,_dragDelta,ddy),__privateSet(this,_delta,dy)),prev=moveEvent,okToNotify=this.axis==="x"&&Math.abs(ddx)>Math.abs(ddy)||this.axis==="y"&&Math.abs(ddy)>Math.abs(ddx),okToNotify&&(document.documentElement.classList.add("dragging"),document.documentElement.classList.add("click-disabled"),__privateSet(_DragControls,_currentElement,__privateGet(this,_element3)),this.changeEvent.notify("drag",__privateGet(this,_delta),moveEvent)))},e=>{__privateSet(_DragControls,_currentElement,null),okToNotify&&(!this.swipe&&this.inertion?(__privateSet(this,_delta,__privateGet(this,_delta)*this.inertion),ticker_index.ticker.subscribe(__privateGet(this,_tickListener),{order:order_index.TICK_ORDER.CONTROLS-1})):this.swipe&&this.changeEvent.notify("drag-end",__privateGet(this,_delta),e)),setTimeout(()=>{document.documentElement.classList.remove("grabbing"),document.documentElement.classList.remove("dragging"),document.documentElement.classList.remove("click-disabled")})})}),__privateSet(this,_tickListener,()=>{Math.floor(Math.abs(__privateGet(this,_delta)))||ticker_index.ticker.unsubscribe(__privateGet(this,_tickListener)),__privateSet(this,_delta,__privateGet(this,_delta)*.95),__privateSet(this,_delta,number.preciseNumber(__privateGet(this,_delta),3)),this.changeEvent.notify("drag",__privateGet(this,_delta),null)}),this.axis=(options==null?void 0:options.axis)||"y",this.swipe=(options==null?void 0:options.swipe)||!1,Store.isBrowser&&(__privateSet(this,_element3,options!=null&&options.element&&dom.getElement(options.element)||document.documentElement),__privateSet(this,_rootElement,(options==null?void 0:options.rootElement)||__privateGet(this,_element3)))}connect(){Store.isBrowser&&(__privateSet(this,_linkElements,[...__privateGet(this,_rootElement).querySelectorAll("a")]),__privateGet(this,_linkElements).forEach(element=>{element.addEventListener("click",__privateGet(this,_linkClickListener))}),__privateGet(this,_element3).addEventListener("pointerdown",__privateGet(this,_pointerdownListener)))}disconnect(){Store.isBrowser&&(__privateGet(this,_linkElements).forEach(element=>{element.removeEventListener("click",__privateGet(this,_linkClickListener))}),__privateGet(this,_element3).removeEventListener("pointerdown",__privateGet(this,_pointerdownListener)),ticker_index.ticker.unsubscribe(__privateGet(this,_tickListener)))}};_currentElement=new WeakMap,_rootElement=new WeakMap,_element3=new WeakMap,_delta=new WeakMap,_linkElements=new WeakMap,_dragDelta=new WeakMap,_linkClickListener=new WeakMap,_pointerdownListener=new WeakMap,_tickListener=new WeakMap,__name(_DragControls,"DragControls"),__privateAdd(_DragControls,_currentElement,null);let DragControls=_DragControls;exports.AutoplayControls=AutoplayControls;exports.Controls=Controls;exports.DragControls=DragControls;exports.KeyboardControls=KeyboardControls;exports.WheelControls=WheelControls;
|
|
@@ -19,7 +19,7 @@ import { c as clamp } from "./math-r8V23YFe.js";
|
|
|
19
19
|
import { p as preciseNumber } from "./number-DiVt2xnh.js";
|
|
20
20
|
import { n as nullishCoalescing } from "./polyfills-CG1XJNia.js";
|
|
21
21
|
import { A as Animation } from "./Animation-DwOegoQA.js";
|
|
22
|
-
const linear = /* @__PURE__ */ __name((t) => t, "linear"), easeInQuad = /* @__PURE__ */ __name((t) => t * t, "easeInQuad"), easeOutQuad = /* @__PURE__ */ __name((t) => t * (2 - t), "easeOutQuad"), easeInOutQuad = /* @__PURE__ */ __name((t) => t < 0.5 ? 2 * t * t : -1 + (4 - 2 * t) * t, "easeInOutQuad"), easeInCubic = /* @__PURE__ */ __name((t) => t * t * t, "easeInCubic"), easeOutCubic = /* @__PURE__ */ __name((t) => --t * t * t + 1, "easeOutCubic"), easeInOutCubic = /* @__PURE__ */ __name((t) => t < 0.5 ? 4 * t * t * t : (t - 1) * (2 * t - 2) * (2 * t - 2) + 1, "easeInOutCubic"), easeInQuart = /* @__PURE__ */ __name((t) => t * t * t * t, "easeInQuart"), easeOutQuart = /* @__PURE__ */ __name((t) => 1 - --t * t * t * t, "easeOutQuart"), easeInOutQuart = /* @__PURE__ */ __name((t) => t < 0.5 ? 8 * t * t * t * t : 1 - 8 * --t * t * t * t, "easeInOutQuart"), easeInQuint = /* @__PURE__ */ __name((t) => t * t * t * t * t, "easeInQuint"), easeOutQuint = /* @__PURE__ */ __name((t) => 1 + --t * t * t * t * t, "easeOutQuint"), easeInOutQuint = /* @__PURE__ */ __name((t) => t < 0.5 ? 16 * t * t * t * t * t : 1 + 16 * --t * t * t * t * t, "easeInOutQuint"), easeInExpo = /* @__PURE__ */ __name((t) => t === 0 ? 0 : 2 ** (10 * (t - 1)), "easeInExpo"), easeOutExpo = /* @__PURE__ */ __name((t) => t === 1 ? 1 : 1 - 2 ** (-10 * t), "easeOutExpo"), easeInOutExpo = /* @__PURE__ */ __name((t) => t === 0 || t === 1 ? t : t < 0.5 ? 0.5 * 2 ** (10 * 2 * (t - 0.5)) : 0.5 * (2 - Math.abs(2 ** (-10 * 2 * (t - 0.5)))), "easeInOutExpo"), easings = {
|
|
22
|
+
const linear = /* @__PURE__ */ __name((t) => t, "linear"), easeInQuad = /* @__PURE__ */ __name((t) => t * t, "easeInQuad"), easeOutQuad = /* @__PURE__ */ __name((t) => t * (2 - t), "easeOutQuad"), easeInOutQuad = /* @__PURE__ */ __name((t) => t < 0.5 ? 2 * t * t : -1 + (4 - 2 * t) * t, "easeInOutQuad"), easeInCubic = /* @__PURE__ */ __name((t) => t * t * t, "easeInCubic"), easeOutCubic = /* @__PURE__ */ __name((t) => --t * t * t + 1, "easeOutCubic"), easeInOutCubic = /* @__PURE__ */ __name((t) => t < 0.5 ? 4 * t * t * t : (t - 1) * (2 * t - 2) * (2 * t - 2) + 1, "easeInOutCubic"), easeInQuart = /* @__PURE__ */ __name((t) => t * t * t * t, "easeInQuart"), easeOutQuart = /* @__PURE__ */ __name((t) => 1 - --t * t * t * t, "easeOutQuart"), easeInOutQuart = /* @__PURE__ */ __name((t) => t < 0.5 ? 8 * t * t * t * t : 1 - 8 * --t * t * t * t, "easeInOutQuart"), easeInQuint = /* @__PURE__ */ __name((t) => t * t * t * t * t, "easeInQuint"), easeOutQuint = /* @__PURE__ */ __name((t) => 1 + --t * t * t * t * t, "easeOutQuint"), easeInOutQuint = /* @__PURE__ */ __name((t) => t < 0.5 ? 16 * t * t * t * t * t : 1 + 16 * --t * t * t * t * t, "easeInOutQuint"), easeInExpo = /* @__PURE__ */ __name((t) => t === 0 ? 0 : 2 ** (10 * (t - 1)), "easeInExpo"), easeOutExpo = /* @__PURE__ */ __name((t) => t === 1 ? 1 : 1 - 2 ** (-10 * t), "easeOutExpo"), easeInOutExpo = /* @__PURE__ */ __name((t) => t === 0 || t === 1 ? t : t < 0.5 ? 0.5 * 2 ** (10 * 2 * (t - 0.5)) : 0.5 * (2 - Math.abs(2 ** (-10 * 2 * (t - 0.5)))), "easeInOutExpo"), easeOvershoot = /* @__PURE__ */ __name((t) => 3 * (1 - t) * (1 - t) * t * 0.33 + 3 * (1 - t) * t * t * 1.42 + t * t * t * 0.05, "easeOvershoot"), easings = {
|
|
23
23
|
linear,
|
|
24
24
|
easeInQuad,
|
|
25
25
|
easeOutQuad,
|
|
@@ -35,7 +35,8 @@ const linear = /* @__PURE__ */ __name((t) => t, "linear"), easeInQuad = /* @__PU
|
|
|
35
35
|
easeInOutQuint,
|
|
36
36
|
easeInExpo,
|
|
37
37
|
easeOutExpo,
|
|
38
|
-
easeInOutExpo
|
|
38
|
+
easeInOutExpo,
|
|
39
|
+
easeOvershoot
|
|
39
40
|
};
|
|
40
41
|
var _easing, _duration;
|
|
41
42
|
const _Tweened = class _Tweened extends Animation {
|
|
@@ -76,5 +77,6 @@ export {
|
|
|
76
77
|
easeInOutQuint as n,
|
|
77
78
|
easeInExpo as o,
|
|
78
79
|
easeOutExpo as p,
|
|
79
|
-
|
|
80
|
+
easeOvershoot as q,
|
|
81
|
+
easings as r
|
|
80
82
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var __defProp=Object.defineProperty,__defProps=Object.defineProperties;var __getOwnPropDescs=Object.getOwnPropertyDescriptors;var __getOwnPropSymbols=Object.getOwnPropertySymbols;var __hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable;var __typeError=msg=>{throw TypeError(msg)};var __defNormalProp=(obj,key,value)=>key in obj?__defProp(obj,key,{enumerable:!0,configurable:!0,writable:!0,value}):obj[key]=value,__spreadValues=(a,b)=>{for(var prop in b||(b={}))__hasOwnProp.call(b,prop)&&__defNormalProp(a,prop,b[prop]);if(__getOwnPropSymbols)for(var prop of __getOwnPropSymbols(b))__propIsEnum.call(b,prop)&&__defNormalProp(a,prop,b[prop]);return a},__spreadProps=(a,b)=>__defProps(a,__getOwnPropDescs(b)),__name=(target,value)=>__defProp(target,"name",{value,configurable:!0});var __accessCheck=(obj,member,msg)=>member.has(obj)||__typeError("Cannot "+msg);var __privateGet=(obj,member,getter)=>(__accessCheck(obj,member,"read from private field"),getter?getter.call(obj):member.get(obj)),__privateAdd=(obj,member,value)=>member.has(obj)?__typeError("Cannot add the same private member more than once"):member instanceof WeakSet?member.add(obj):member.set(obj,value),__privateSet=(obj,member,value,setter)=>(__accessCheck(obj,member,"write to private field"),setter?setter.call(obj,value):member.set(obj,value),value);const math=require("./math-C-knY2TL.cjs"),number=require("./number-Bu4sGvW7.cjs"),polyfills=require("./polyfills-DZCuDBkA.cjs"),Animation=require("./Animation-CS32dwF1.cjs"),linear=__name(t=>t,"linear"),easeInQuad=__name(t=>t*t,"easeInQuad"),easeOutQuad=__name(t=>t*(2-t),"easeOutQuad"),easeInOutQuad=__name(t=>t<.5?2*t*t:-1+(4-2*t)*t,"easeInOutQuad"),easeInCubic=__name(t=>t*t*t,"easeInCubic"),easeOutCubic=__name(t=>--t*t*t+1,"easeOutCubic"),easeInOutCubic=__name(t=>t<.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1,"easeInOutCubic"),easeInQuart=__name(t=>t*t*t*t,"easeInQuart"),easeOutQuart=__name(t=>1- --t*t*t*t,"easeOutQuart"),easeInOutQuart=__name(t=>t<.5?8*t*t*t*t:1-8*--t*t*t*t,"easeInOutQuart"),easeInQuint=__name(t=>t*t*t*t*t,"easeInQuint"),easeOutQuint=__name(t=>1+--t*t*t*t*t,"easeOutQuint"),easeInOutQuint=__name(t=>t<.5?16*t*t*t*t*t:1+16*--t*t*t*t*t,"easeInOutQuint"),easeInExpo=__name(t=>t===0?0:2**(10*(t-1)),"easeInExpo"),easeOutExpo=__name(t=>t===1?1:1-2**(-10*t),"easeOutExpo"),easeInOutExpo=__name(t=>t===0||t===1?t:t<.5?.5*2**(10*2*(t-.5)):.5*(2-Math.abs(2**(-10*2*(t-.5)))),"easeInOutExpo"),easings={linear,easeInQuad,easeOutQuad,easeInOutQuad,easeInCubic,easeOutCubic,easeInOutCubic,easeInQuart,easeOutQuart,easeInOutQuart,easeInQuint,easeOutQuint,easeInOutQuint,easeInExpo,easeOutExpo,easeInOutExpo};var _easing,_duration;const _Tweened=class _Tweened extends Animation.Animation{constructor(initial,options){super(initial||0,options);__privateAdd(this,_easing,linear);__privateAdd(this,_duration,1e3);this.updateOptions(__spreadProps(__spreadValues({},options),{equalize:!0}))}updateOptions(options){super.updateOptions(options),__privateSet(this,_easing,typeof(options==null?void 0:options.easing)=="function"?options.easing:typeof(options==null?void 0:options.easing)=="string"?easings[options.easing]||easings.linear:__privateGet(this,_easing)),__privateSet(this,_duration,(options==null?void 0:options.duration)===!1?0:polyfills.nullishCoalescing(options==null?void 0:options.duration,__privateGet(this,_duration)))}handleAnimationFrame(e){const t=e.timeElapsedSinceSubscription/1e3/(__privateGet(this,_duration)/1e3)||0,et=__privateGet(this,_easing).call(this,math.clamp(t,0,1));this.current=number.preciseNumber(this.from+(this.target-this.from)*et,6),t>1&&this.unlistenAnimationFrame()}start(){this.unlistenAnimationFrame(),super.start()}};_easing=new WeakMap,_duration=new WeakMap,__name(_Tweened,"Tweened");let Tweened=_Tweened;exports.Tweened=Tweened;exports.easeInCubic=easeInCubic;exports.easeInExpo=easeInExpo;exports.easeInOutCubic=easeInOutCubic;exports.easeInOutExpo=easeInOutExpo;exports.easeInOutQuad=easeInOutQuad;exports.easeInOutQuart=easeInOutQuart;exports.easeInOutQuint=easeInOutQuint;exports.easeInQuad=easeInQuad;exports.easeInQuart=easeInQuart;exports.easeInQuint=easeInQuint;exports.easeOutCubic=easeOutCubic;exports.easeOutExpo=easeOutExpo;exports.easeOutQuad=easeOutQuad;exports.easeOutQuart=easeOutQuart;exports.easeOutQuint=easeOutQuint;exports.easings=easings;exports.linear=linear;
|
|
1
|
+
"use strict";var __defProp=Object.defineProperty,__defProps=Object.defineProperties;var __getOwnPropDescs=Object.getOwnPropertyDescriptors;var __getOwnPropSymbols=Object.getOwnPropertySymbols;var __hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable;var __typeError=msg=>{throw TypeError(msg)};var __defNormalProp=(obj,key,value)=>key in obj?__defProp(obj,key,{enumerable:!0,configurable:!0,writable:!0,value}):obj[key]=value,__spreadValues=(a,b)=>{for(var prop in b||(b={}))__hasOwnProp.call(b,prop)&&__defNormalProp(a,prop,b[prop]);if(__getOwnPropSymbols)for(var prop of __getOwnPropSymbols(b))__propIsEnum.call(b,prop)&&__defNormalProp(a,prop,b[prop]);return a},__spreadProps=(a,b)=>__defProps(a,__getOwnPropDescs(b)),__name=(target,value)=>__defProp(target,"name",{value,configurable:!0});var __accessCheck=(obj,member,msg)=>member.has(obj)||__typeError("Cannot "+msg);var __privateGet=(obj,member,getter)=>(__accessCheck(obj,member,"read from private field"),getter?getter.call(obj):member.get(obj)),__privateAdd=(obj,member,value)=>member.has(obj)?__typeError("Cannot add the same private member more than once"):member instanceof WeakSet?member.add(obj):member.set(obj,value),__privateSet=(obj,member,value,setter)=>(__accessCheck(obj,member,"write to private field"),setter?setter.call(obj,value):member.set(obj,value),value);const math=require("./math-C-knY2TL.cjs"),number=require("./number-Bu4sGvW7.cjs"),polyfills=require("./polyfills-DZCuDBkA.cjs"),Animation=require("./Animation-CS32dwF1.cjs"),linear=__name(t=>t,"linear"),easeInQuad=__name(t=>t*t,"easeInQuad"),easeOutQuad=__name(t=>t*(2-t),"easeOutQuad"),easeInOutQuad=__name(t=>t<.5?2*t*t:-1+(4-2*t)*t,"easeInOutQuad"),easeInCubic=__name(t=>t*t*t,"easeInCubic"),easeOutCubic=__name(t=>--t*t*t+1,"easeOutCubic"),easeInOutCubic=__name(t=>t<.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1,"easeInOutCubic"),easeInQuart=__name(t=>t*t*t*t,"easeInQuart"),easeOutQuart=__name(t=>1- --t*t*t*t,"easeOutQuart"),easeInOutQuart=__name(t=>t<.5?8*t*t*t*t:1-8*--t*t*t*t,"easeInOutQuart"),easeInQuint=__name(t=>t*t*t*t*t,"easeInQuint"),easeOutQuint=__name(t=>1+--t*t*t*t*t,"easeOutQuint"),easeInOutQuint=__name(t=>t<.5?16*t*t*t*t*t:1+16*--t*t*t*t*t,"easeInOutQuint"),easeInExpo=__name(t=>t===0?0:2**(10*(t-1)),"easeInExpo"),easeOutExpo=__name(t=>t===1?1:1-2**(-10*t),"easeOutExpo"),easeInOutExpo=__name(t=>t===0||t===1?t:t<.5?.5*2**(10*2*(t-.5)):.5*(2-Math.abs(2**(-10*2*(t-.5)))),"easeInOutExpo"),easeOvershoot=__name(t=>3*(1-t)*(1-t)*t*.33+3*(1-t)*t*t*1.42+t*t*t*.05,"easeOvershoot"),easings={linear,easeInQuad,easeOutQuad,easeInOutQuad,easeInCubic,easeOutCubic,easeInOutCubic,easeInQuart,easeOutQuart,easeInOutQuart,easeInQuint,easeOutQuint,easeInOutQuint,easeInExpo,easeOutExpo,easeInOutExpo,easeOvershoot};var _easing,_duration;const _Tweened=class _Tweened extends Animation.Animation{constructor(initial,options){super(initial||0,options);__privateAdd(this,_easing,linear);__privateAdd(this,_duration,1e3);this.updateOptions(__spreadProps(__spreadValues({},options),{equalize:!0}))}updateOptions(options){super.updateOptions(options),__privateSet(this,_easing,typeof(options==null?void 0:options.easing)=="function"?options.easing:typeof(options==null?void 0:options.easing)=="string"?easings[options.easing]||easings.linear:__privateGet(this,_easing)),__privateSet(this,_duration,(options==null?void 0:options.duration)===!1?0:polyfills.nullishCoalescing(options==null?void 0:options.duration,__privateGet(this,_duration)))}handleAnimationFrame(e){const t=e.timeElapsedSinceSubscription/1e3/(__privateGet(this,_duration)/1e3)||0,et=__privateGet(this,_easing).call(this,math.clamp(t,0,1));this.current=number.preciseNumber(this.from+(this.target-this.from)*et,6),t>1&&this.unlistenAnimationFrame()}start(){this.unlistenAnimationFrame(),super.start()}};_easing=new WeakMap,_duration=new WeakMap,__name(_Tweened,"Tweened");let Tweened=_Tweened;exports.Tweened=Tweened;exports.easeInCubic=easeInCubic;exports.easeInExpo=easeInExpo;exports.easeInOutCubic=easeInOutCubic;exports.easeInOutExpo=easeInOutExpo;exports.easeInOutQuad=easeInOutQuad;exports.easeInOutQuart=easeInOutQuart;exports.easeInOutQuint=easeInOutQuint;exports.easeInQuad=easeInQuad;exports.easeInQuart=easeInQuart;exports.easeInQuint=easeInQuint;exports.easeOutCubic=easeOutCubic;exports.easeOutExpo=easeOutExpo;exports.easeOutQuad=easeOutQuad;exports.easeOutQuart=easeOutQuart;exports.easeOutQuint=easeOutQuint;exports.easeOvershoot=easeOvershoot;exports.easings=easings;exports.linear=linear;
|
package/lib/animation/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Animation=require("../Animation-CS32dwF1.cjs"),Damped=require("../Damped-B_mVO810.cjs"),Tweened=require("../Tweened-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Animation=require("../Animation-CS32dwF1.cjs"),Damped=require("../Damped-B_mVO810.cjs"),Tweened=require("../Tweened-j_TwbxEI.cjs");exports.Animation=Animation.Animation;exports.Damped=Damped.Damped;exports.Tweened=Tweened.Tweened;
|
package/lib/animation/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var __defProp=Object.defineProperty,__defProps=Object.defineProperties;var __getOwnPropDescs=Object.getOwnPropertyDescriptors;var __getOwnPropSymbols=Object.getOwnPropertySymbols;var __hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable;var __defNormalProp=(obj,key,value)=>key in obj?__defProp(obj,key,{enumerable:!0,configurable:!0,writable:!0,value}):obj[key]=value,__spreadValues=(a,b)=>{for(var prop in b||(b={}))__hasOwnProp.call(b,prop)&&__defNormalProp(a,prop,b[prop]);if(__getOwnPropSymbols)for(var prop of __getOwnPropSymbols(b))__propIsEnum.call(b,prop)&&__defNormalProp(a,prop,b[prop]);return a},__spreadProps=(a,b)=>__defProps(a,__getOwnPropDescs(b)),__name=(target,value)=>__defProp(target,"name",{value,configurable:!0});var __async=(__this,__arguments,generator)=>new Promise((resolve,reject)=>{var fulfilled=value=>{try{step(generator.next(value))}catch(e){reject(e)}},rejected=value=>{try{step(generator.throw(value))}catch(e){reject(e)}},step=x=>x.done?resolve(x.value):Promise.resolve(x.value).then(fulfilled,rejected);step((generator=generator.apply(__this,__arguments)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const cache_index=require("../cache/index.cjs");require("../Store-B96mD8mD.cjs");require("../index-BoGx2BWX.cjs");require("construct-style-sheets-polyfill");const url=require("../url-D0rESDQq.cjs"),
|
|
1
|
+
"use strict";var __defProp=Object.defineProperty,__defProps=Object.defineProperties;var __getOwnPropDescs=Object.getOwnPropertyDescriptors;var __getOwnPropSymbols=Object.getOwnPropertySymbols;var __hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable;var __defNormalProp=(obj,key,value)=>key in obj?__defProp(obj,key,{enumerable:!0,configurable:!0,writable:!0,value}):obj[key]=value,__spreadValues=(a,b)=>{for(var prop in b||(b={}))__hasOwnProp.call(b,prop)&&__defNormalProp(a,prop,b[prop]);if(__getOwnPropSymbols)for(var prop of __getOwnPropSymbols(b))__propIsEnum.call(b,prop)&&__defNormalProp(a,prop,b[prop]);return a},__spreadProps=(a,b)=>__defProps(a,__getOwnPropDescs(b)),__name=(target,value)=>__defProp(target,"name",{value,configurable:!0});var __async=(__this,__arguments,generator)=>new Promise((resolve,reject)=>{var fulfilled=value=>{try{step(generator.next(value))}catch(e){reject(e)}},rejected=value=>{try{step(generator.throw(value))}catch(e){reject(e)}},step=x=>x.done?resolve(x.value):Promise.resolve(x.value).then(fulfilled,rejected);step((generator=generator.apply(__this,__arguments)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const cache_index=require("../cache/index.cjs");require("../Store-B96mD8mD.cjs");require("../index-BoGx2BWX.cjs");require("construct-style-sheets-polyfill");const url=require("../url-D0rESDQq.cjs"),apiFetcherCache=new cache_index.Cache,pendingRequests=new Map;function apiFetcherClearPendingRequests(){pendingRequests.clear()}__name(apiFetcherClearPendingRequests,"apiFetcherClearPendingRequests");function apiFetcherGetPendingRequestsCount(){return pendingRequests.size}__name(apiFetcherGetPendingRequestsCount,"apiFetcherGetPendingRequestsCount");function apiFetcher(input,options){return __async(this,null,function*(){var _a,_b;const startTime=Date.now(),baseResult={data:null,error:null,status:"unknown",headers:new Headers};try{let url$1=input;if(options!=null&&options.params){const params=url.searchParamsObjectToString(options.params);if(params){const separator=url$1.includes("?")?"&":"?";url$1+=`${separator}${params}`}}const cacheKey=(_a=options==null?void 0:options.cacheKey)!=null?_a:url$1,cacheTTL=(_b=options==null?void 0:options.cacheTTLMinutes)!=null?_b:0,cacheAllowed=cacheTTL>0;if((options!=null&&options.forceClearCache||globalThis.forceClearCache)&&(apiFetcherCache.delete(cacheKey),pendingRequests.delete(cacheKey)),cacheAllowed){const cached=apiFetcherCache.get(cacheKey);if(cached)return __spreadProps(__spreadValues({},baseResult),{data:cached,cached:!0,status:"success",time:Date.now()-startTime})}const pendingRequest=pendingRequests.get(cacheKey);if(pendingRequest)return pendingRequest;const requestPromise=__async(this,null,function*(){try{const response=yield fetch(url$1,options==null?void 0:options.init);if(!response.ok){const errorText=yield response.text();return __spreadProps(__spreadValues({},baseResult),{error:errorText,status:"error",time:Date.now()-startTime,headers:response.headers})}const contentType=response.headers.get("content-type");if(!(contentType!=null&&contentType.includes("application/json")))return __spreadProps(__spreadValues({},baseResult),{error:"Endpoint did not return JSON",status:"error",time:Date.now()-startTime,headers:response.headers});const jsonData=yield response.json();return cacheAllowed&&apiFetcherCache.set(cacheKey,jsonData,cacheTTL),__spreadProps(__spreadValues({},baseResult),{data:jsonData,status:"success",time:Date.now()-startTime,headers:response.headers})}finally{pendingRequests.delete(cacheKey)}});return pendingRequests.set(cacheKey,requestPromise),yield requestPromise}catch(error){const errorMessage=error instanceof Error?error.message:String(error);return __spreadProps(__spreadValues({},baseResult),{error:errorMessage,status:"error",time:Date.now()-startTime})}})}__name(apiFetcher,"apiFetcher");exports.apiFetcher=apiFetcher;exports.apiFetcherCache=apiFetcherCache;exports.apiFetcherClearPendingRequests=apiFetcherClearPendingRequests;exports.apiFetcherGetPendingRequestsCount=apiFetcherGetPendingRequestsCount;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Cache } from '../cache';
|
|
1
2
|
export interface IAPIFetcherOptions<Params extends object = {}> {
|
|
2
3
|
init?: RequestInit;
|
|
3
4
|
cacheKey?: string;
|
|
@@ -13,4 +14,7 @@ export interface IAPIResponseJSON<T = null> {
|
|
|
13
14
|
cached?: boolean;
|
|
14
15
|
headers: Headers;
|
|
15
16
|
}
|
|
17
|
+
export declare const apiFetcherCache: Cache;
|
|
18
|
+
export declare function apiFetcherClearPendingRequests(): void;
|
|
19
|
+
export declare function apiFetcherGetPendingRequestsCount(): number;
|
|
16
20
|
export declare function apiFetcher<Params extends object = {}, Result = any>(input: string, options?: IAPIFetcherOptions<Params>): Promise<IAPIResponseJSON<Result>>;
|
package/lib/api-fetcher/index.js
CHANGED
|
@@ -31,7 +31,15 @@ import "../Store-CAGUSjFX.js";
|
|
|
31
31
|
import "../index-DAG0CtYo.js";
|
|
32
32
|
import "construct-style-sheets-polyfill";
|
|
33
33
|
import { s as searchParamsObjectToString } from "../url-DTxLpq5m.js";
|
|
34
|
-
const
|
|
34
|
+
const apiFetcherCache = new Cache(), pendingRequests = /* @__PURE__ */ new Map();
|
|
35
|
+
function apiFetcherClearPendingRequests() {
|
|
36
|
+
pendingRequests.clear();
|
|
37
|
+
}
|
|
38
|
+
__name(apiFetcherClearPendingRequests, "apiFetcherClearPendingRequests");
|
|
39
|
+
function apiFetcherGetPendingRequestsCount() {
|
|
40
|
+
return pendingRequests.size;
|
|
41
|
+
}
|
|
42
|
+
__name(apiFetcherGetPendingRequestsCount, "apiFetcherGetPendingRequestsCount");
|
|
35
43
|
function apiFetcher(input, options) {
|
|
36
44
|
return __async(this, null, function* () {
|
|
37
45
|
var _a, _b;
|
|
@@ -51,8 +59,8 @@ function apiFetcher(input, options) {
|
|
|
51
59
|
}
|
|
52
60
|
}
|
|
53
61
|
const cacheKey = (_a = options == null ? void 0 : options.cacheKey) != null ? _a : url, cacheTTL = (_b = options == null ? void 0 : options.cacheTTLMinutes) != null ? _b : 0, cacheAllowed = cacheTTL > 0;
|
|
54
|
-
if ((options != null && options.forceClearCache || globalThis.forceClearCache) &&
|
|
55
|
-
const cached =
|
|
62
|
+
if ((options != null && options.forceClearCache || globalThis.forceClearCache) && (apiFetcherCache.delete(cacheKey), pendingRequests.delete(cacheKey)), cacheAllowed) {
|
|
63
|
+
const cached = apiFetcherCache.get(cacheKey);
|
|
56
64
|
if (cached)
|
|
57
65
|
return __spreadProps(__spreadValues({}, baseResult), {
|
|
58
66
|
data: cached,
|
|
@@ -61,31 +69,41 @@ function apiFetcher(input, options) {
|
|
|
61
69
|
time: Date.now() - startTime
|
|
62
70
|
});
|
|
63
71
|
}
|
|
64
|
-
const
|
|
65
|
-
if (
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
72
|
+
const pendingRequest = pendingRequests.get(cacheKey);
|
|
73
|
+
if (pendingRequest)
|
|
74
|
+
return pendingRequest;
|
|
75
|
+
const requestPromise = __async(this, null, function* () {
|
|
76
|
+
try {
|
|
77
|
+
const response = yield fetch(url, options == null ? void 0 : options.init);
|
|
78
|
+
if (!response.ok) {
|
|
79
|
+
const errorText = yield response.text();
|
|
80
|
+
return __spreadProps(__spreadValues({}, baseResult), {
|
|
81
|
+
error: errorText,
|
|
82
|
+
status: "error",
|
|
83
|
+
time: Date.now() - startTime,
|
|
84
|
+
headers: response.headers
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
const contentType = response.headers.get("content-type");
|
|
88
|
+
if (!(contentType != null && contentType.includes("application/json")))
|
|
89
|
+
return __spreadProps(__spreadValues({}, baseResult), {
|
|
90
|
+
error: "Endpoint did not return JSON",
|
|
91
|
+
status: "error",
|
|
92
|
+
time: Date.now() - startTime,
|
|
93
|
+
headers: response.headers
|
|
94
|
+
});
|
|
95
|
+
const jsonData = yield response.json();
|
|
96
|
+
return cacheAllowed && apiFetcherCache.set(cacheKey, jsonData, cacheTTL), __spreadProps(__spreadValues({}, baseResult), {
|
|
97
|
+
data: jsonData,
|
|
98
|
+
status: "success",
|
|
99
|
+
time: Date.now() - startTime,
|
|
100
|
+
headers: response.headers
|
|
101
|
+
});
|
|
102
|
+
} finally {
|
|
103
|
+
pendingRequests.delete(cacheKey);
|
|
104
|
+
}
|
|
88
105
|
});
|
|
106
|
+
return pendingRequests.set(cacheKey, requestPromise), yield requestPromise;
|
|
89
107
|
} catch (error) {
|
|
90
108
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
91
109
|
return __spreadProps(__spreadValues({}, baseResult), {
|
|
@@ -98,5 +116,8 @@ function apiFetcher(input, options) {
|
|
|
98
116
|
}
|
|
99
117
|
__name(apiFetcher, "apiFetcher");
|
|
100
118
|
export {
|
|
101
|
-
apiFetcher
|
|
119
|
+
apiFetcher,
|
|
120
|
+
apiFetcherCache,
|
|
121
|
+
apiFetcherClearPendingRequests,
|
|
122
|
+
apiFetcherGetPendingRequestsCount
|
|
102
123
|
};
|
package/lib/controls/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const DragControls=require("../DragControls-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const DragControls=require("../DragControls-DZ0Np8yt.cjs");exports.AutoplayControls=DragControls.AutoplayControls;exports.Controls=DragControls.Controls;exports.DragControls=DragControls.DragControls;exports.KeyboardControls=DragControls.KeyboardControls;exports.WheelControls=DragControls.WheelControls;
|
package/lib/controls/index.js
CHANGED
package/lib/morph/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var __defProp=Object.defineProperty,__defProps=Object.defineProperties;var __getOwnPropDescs=Object.getOwnPropertyDescriptors;var __getOwnPropSymbols=Object.getOwnPropertySymbols;var __hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable;var __knownSymbol=(name,symbol)=>(symbol=Symbol[name])?symbol:Symbol.for("Symbol."+name),__typeError=msg=>{throw TypeError(msg)};var __defNormalProp=(obj,key,value)=>key in obj?__defProp(obj,key,{enumerable:!0,configurable:!0,writable:!0,value}):obj[key]=value,__spreadValues=(a,b)=>{for(var prop in b||(b={}))__hasOwnProp.call(b,prop)&&__defNormalProp(a,prop,b[prop]);if(__getOwnPropSymbols)for(var prop of __getOwnPropSymbols(b))__propIsEnum.call(b,prop)&&__defNormalProp(a,prop,b[prop]);return a},__spreadProps=(a,b)=>__defProps(a,__getOwnPropDescs(b)),__name=(target,value)=>__defProp(target,"name",{value,configurable:!0});var __accessCheck=(obj,member,msg)=>member.has(obj)||__typeError("Cannot "+msg);var __privateGet=(obj,member,getter)=>(__accessCheck(obj,member,"read from private field"),getter?getter.call(obj):member.get(obj)),__privateAdd=(obj,member,value)=>member.has(obj)?__typeError("Cannot add the same private member more than once"):member instanceof WeakSet?member.add(obj):member.set(obj,value),__privateSet=(obj,member,value,setter)=>(__accessCheck(obj,member,"write to private field"),setter?setter.call(obj,value):member.set(obj,value),value),__privateMethod=(obj,member,method)=>(__accessCheck(obj,member,"access private method"),method);var __async=(__this,__arguments,generator)=>new Promise((resolve,reject)=>{var fulfilled=value=>{try{step(generator.next(value))}catch(e){reject(e)}},rejected=value=>{try{step(generator.throw(value))}catch(e){reject(e)}},step=x=>x.done?resolve(x.value):Promise.resolve(x.value).then(fulfilled,rejected);step((generator=generator.apply(__this,__arguments)).next())});var __forAwait=(obj,it,method)=>(it=obj[__knownSymbol("asyncIterator")])?it.call(obj):(obj=obj[__knownSymbol("iterator")](),it={},method=(key,fn)=>(fn=obj[key])&&(it[key]=arg=>new Promise((yes,no,done)=>(arg=fn.call(obj,arg),done=arg.done,Promise.resolve(arg.value).then(value=>yes({value,done}),no)))),method("next"),method("return"),it);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Store=require("../Store-B96mD8mD.cjs"),dom=require("../dom-B40i6NXw.cjs"),events=require("../events-UlGk63iC.cjs"),promises=require("../promises-nDm8_iG6.cjs"),scroll=require("../scroll-DbYCgAnW.cjs");require("construct-style-sheets-polyfill");require("../index-BoGx2BWX.cjs");const url=require("../url-D0rESDQq.cjs"),cssValueParser_index=require("../css-value-parser/index.cjs"),historyManager=require("../historyManager-DB2fSEtH.cjs"),_MorphAnnouncer=class _MorphAnnouncer extends HTMLElement{connectedCallback(){const attrs={"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[key,value]of Object.entries(attrs))this.setAttribute(key,value)}};__name(_MorphAnnouncer,"MorphAnnouncer");let MorphAnnouncer=_MorphAnnouncer;Store.isBrowser&&!customElements.get("morph-announcer")&&customElements.define("morph-announcer",MorphAnnouncer);var _morph,_element,_MorphLink_instances,path_get,click_fn,_clickListener,_pointerListener;const _MorphLink=class _MorphLink{constructor(element,morph){__privateAdd(this,_MorphLink_instances);__privateAdd(this,_morph);__privateAdd(this,_element);__privateAdd(this,_clickListener,__name(e=>{e.preventDefault(),__privateMethod(this,_MorphLink_instances,click_fn).call(this)},"#clickListener"));__privateAdd(this,_pointerListener,__name(()=>{const revalidate=__privateGet(this,_element).hasAttribute("data-revalidate");__privateGet(this,_morph).prefetch(__privateGet(this,_MorphLink_instances,path_get),revalidate),__privateGet(this,_element).removeEventListener("pointerenter",__privateGet(this,_pointerListener))},"#pointerListener"));__privateSet(this,_morph,morph),__privateSet(this,_element,element),__privateGet(this,_element).addEventListener("click",__privateGet(this,_clickListener)),this.checkCurrent(location.href.replace(location.origin,"")),__privateGet(this,_element).hasAttribute("data-prefetch")&&__privateGet(this,_element).addEventListener("pointerenter",__privateGet(this,_pointerListener))}get element(){return __privateGet(this,_element)}checkCurrent(path){var _a,_b;const locationUrl=__privateGet(this,_morph).normalizePath(path),linkUrl=__privateGet(this,_morph).normalizePath(__privateGet(this,_MorphLink_instances,path_get));__privateGet(this,_element).hasAttribute("data-include")&&locationUrl.pathname.includes(linkUrl.pathname)?__privateGet(this,_element).classList.add("current"):linkUrl.pathname===locationUrl.pathname?__privateGet(this,_element).classList.add("current"):(_a=__privateGet(this,_element).getAttribute("data-associated-paths"))!=null&&_a.split(",").find(path2=>locationUrl.pathname.includes(path2))?__privateGet(this,_element).classList.add("current"):__privateGet(this,_element).classList.remove("current"),locationUrl.path===linkUrl.path?__privateGet(this,_element).classList.add("exact"):__privateGet(this,_element).classList.remove("exact");const[pathWithoutParams,pathParamsStr]=(_b=__privateGet(this,_MorphLink_instances,path_get).split("#")[0])==null?void 0:_b.split("?"),pathParams=new URLSearchParams(pathParamsStr),locationParams=new URLSearchParams(location.search);let matchCounter=0;for(const[key]of locationParams)pathParams.has(key)&&locationParams.get(key)===pathParams.get(key)&&matchCounter++;matchCounter?(__privateGet(this,_element).classList.toggle("all-params-matched",locationParams.size===matchCounter),__privateGet(this,_element).classList.toggle("some-params-matched",locationParams.size!==matchCounter)):!locationParams.size&&__privateGet(this,_element).hasAttribute("data-match-no-params")?__privateGet(this,_element).classList.add("all-params-matched"):(__privateGet(this,_element).classList.remove("all-params-matched"),__privateGet(this,_element).classList.remove("some-params-matched"));for(const key in __privateGet(this,_element).dataset){const kebabKey=Store.camelToKebab(key);if(kebabKey.startsWith("match-param-")){const name=kebabKey.split("match-param-")[1],value=__privateGet(this,_element).dataset[key],className=`param-${name}-matched`;locationParams.has(name)&&locationParams.get(name)===value||!locationParams.has(name)&&(value===""||value==="*"||value==="all"||value==="any"||value==="vse")?__privateGet(this,_element).classList.add(className):__privateGet(this,_element).classList.remove(className)}}}destroy(){__privateGet(this,_element).removeEventListener("click",__privateGet(this,_clickListener)),__privateGet(this,_element).removeEventListener("pointerenter",__privateGet(this,_pointerListener)),__privateGet(this,_element).classList.remove("current","exact")}};_morph=new WeakMap,_element=new WeakMap,_MorphLink_instances=new WeakSet,path_get=__name(function(){const url2=new URL(__privateGet(this,_element).href);return __privateGet(this,_morph).normalizePath(url2.pathname+url2.search+url2.hash).path},"#path"),click_fn=__name(function(){var _a;if(document.documentElement.classList.contains("click-disabled"))return;if(__privateGet(this,_element).hasAttribute("data-back")&&__privateGet(this,_morph).previousURL)history.back();else{const historyAction=__privateGet(this,_element).getAttribute("data-history-action")||"push",centerScroll=__privateGet(this,_element).hasAttribute("data-center-scroll"),offsetScrollRawValue=getComputedStyle(__privateGet(this,_element)).getPropertyValue("--offset-scroll").trim(),offsetScroll=offsetScrollRawValue?cssValueParser_index.cssValueParser.parse(offsetScrollRawValue):void 0,scrollDuration=parseFloat(__privateGet(this,_element).getAttribute("data-scroll-duration")||"0")||void 0,scrollEasing=__privateGet(this,_element).getAttribute("data-scroll-easing")||void 0,revalidate=__privateGet(this,_element).hasAttribute("data-revalidate")||__privateGet(this,_element).hasAttribute("data-pagination-more-link")||__privateGet(this,_element).hasAttribute("data-pagination-set-link")||__privateGet(this,_element).hasAttribute("data-pagination-next-link")||__privateGet(this,_element).hasAttribute("data-pagination-prev-link"),keepSearchParameters=__privateGet(this,_element).hasAttribute("data-keep-search-parameters"),keepScrollPosition=__privateGet(this,_element).hasAttribute("data-keep-scroll-position")||__privateGet(this,_element).hasAttribute("data-pagination-more-link"),scrollBehaviour=__privateGet(this,_element).getAttribute("data-scroll-behaviour"),submorph=(_a=__privateGet(this,_element).getAttribute("data-submorph")||__privateGet(this,_element).getAttribute("data-submorph-append"))==null?void 0:_a.split(",").map(v=>v.trim()),clearState=__privateGet(this,_element).hasAttribute("data-clear-state");let path=__privateGet(this,_MorphLink_instances,path_get);if(__privateGet(this,_element).hasAttribute("data-toggle-params")){const[pathWithoutParams,pathParamsStr]=__privateGet(this,_MorphLink_instances,path_get).split("?"),pathParams=new URLSearchParams(pathParamsStr),locationParams=new URLSearchParams(location.search),resultParams=new URLSearchParams;for(const[key]of pathParams)(!locationParams.has(key)||locationParams.has(key)&&locationParams.get(key)!==pathParams.get(key))&&resultParams.append(key,pathParams.get(key));if(__privateGet(this,_element).hasAttribute("data-merge-params"))for(const[key]of locationParams)pathParams.has(key)||resultParams.append(key,locationParams.get(key));path=`${pathWithoutParams}?${resultParams.toString()}`}__privateGet(this,_morph).navigate(path,{historyAction,centerScroll,offsetScroll,revalidate,keepSearchParameters,submorph,clearState,keepScrollPosition,scrollBehaviour,scrollDuration,scrollEasing,submorphAppend:__privateGet(this,_element).hasAttribute("data-submorph-append"),mergeParams:__privateGet(this,_element).hasAttribute("data-merge-params")&&!__privateGet(this,_element).hasAttribute("data-toggle-params"),detail:__privateGet(this,_element).getAttribute("data-detail"),removeParams:__privateGet(this,_element).getAttribute("data-remove-params")||void 0,scrollTo:__privateGet(this,_element).getAttribute("data-scroll-to")||void 0})}},"#click"),_clickListener=new WeakMap,_pointerListener=new WeakMap,__name(_MorphLink,"MorphLink");let MorphLink=_MorphLink;var _element2,_params,_MorphParamsDependent_instances,update_fn,_urlChangeListener;const _MorphParamsDependent=class _MorphParamsDependent{constructor(element){__privateAdd(this,_MorphParamsDependent_instances);__privateAdd(this,_element2);__privateAdd(this,_params,[]);__privateAdd(this,_urlChangeListener,__name(()=>{__privateMethod(this,_MorphParamsDependent_instances,update_fn).call(this)},"#urlChangeListener"));__privateSet(this,_element2,element);for(const key in __privateGet(this,_element2).dataset){const kebabKey=Store.camelToKebab(key);if(kebabKey.startsWith("param-")){const name=kebabKey.split("param-")[1],value=__privateGet(this,_element2).dataset[key];__privateGet(this,_params).push({name,value})}}document.addEventListener("morphURLParametersChange",__privateGet(this,_urlChangeListener)),__privateMethod(this,_MorphParamsDependent_instances,update_fn).call(this)}destroy(){document.removeEventListener("morphURLParametersChange",__privateGet(this,_urlChangeListener))}};_element2=new WeakMap,_params=new WeakMap,_MorphParamsDependent_instances=new WeakSet,update_fn=__name(function(){const locationParams=new URLSearchParams(location.search);let matched=!!__privateGet(this,_params).find(param=>locationParams.has(param.name)&&(locationParams.get(param.name)===param.value||param.value==="*"||param.value==="all"||param.value==="any"||param.value==="vse"||locationParams.get(param.name)==="*"||locationParams.get(param.name)==="all"||locationParams.get(param.name)==="any"||locationParams.get(param.name)==="vse"));!matched&&__privateGet(this,_element2).hasAttribute("data-match-no-params")&&(matched=!__privateGet(this,_params).filter(param=>locationParams.has(param.name)).length);const hideClass=__privateGet(this,_element2).getAttribute("data-hide-class");matched?hideClass?__privateGet(this,_element2).classList.remove(hideClass):__privateGet(this,_element2).style.display="":hideClass?__privateGet(this,_element2).classList.add(hideClass):__privateGet(this,_element2).style.display="none",requestAnimationFrame(()=>{window.dispatchEvent(new CustomEvent("resize"))})},"#update"),_urlChangeListener=new WeakMap,__name(_MorphParamsDependent,"MorphParamsDependent");let MorphParamsDependent=_MorphParamsDependent;const domParser=new DOMParser;var _morph2,_pathname,_scrollState,_initialDocument,_modifiedDocument,_currentDocument,_savedState,_abortController,_fetching,_headers,_needRavalidation;const _MorphRoute=class _MorphRoute{constructor(morph,pathname){__privateAdd(this,_morph2);__privateAdd(this,_pathname);__privateAdd(this,_scrollState,{x:0,y:0});__privateAdd(this,_initialDocument,null);__privateAdd(this,_modifiedDocument,null);__privateAdd(this,_currentDocument,null);__privateAdd(this,_savedState,null);__privateAdd(this,_abortController,null);__privateAdd(this,_fetching,null);__privateAdd(this,_headers);__privateAdd(this,_needRavalidation,!1);__privateSet(this,_morph2,morph),__privateSet(this,_pathname,pathname)}get pathname(){return __privateGet(this,_pathname)}get scrollState(){return __privateGet(this,_scrollState)}get document(){return __privateGet(this,_currentDocument)}needRavalidation(){__privateSet(this,_needRavalidation,!0)}setHeaders(headers){__privateSet(this,_headers,headers)}setInitialDocument(document2){__privateSet(this,_initialDocument,document2.cloneNode(!0))}abort(){var _a;return(_a=__privateGet(this,_abortController))==null?void 0:_a.abort(`[${__privateGet(this,_pathname)}] page loading cancelled`)}fetch(path,currentPath,revalidate){return __async(this,null,function*(){var _a;if(!revalidate&&!__privateGet(this,_needRavalidation)){const shouldUseCache=((_a=__privateGet(this,_initialDocument))==null?void 0:_a.documentElement.getAttribute("data-cache"))&¤tPath!==path,isPopstateNavigation=__privateGet(this,_initialDocument)&&__privateGet(this,_morph2).isPopstateNavigation;if(__privateGet(this,_fetching)||shouldUseCache||isPopstateNavigation)return __privateGet(this,_fetching)}return __privateSet(this,_fetching,new Promise(res=>__async(this,null,function*(){try{__privateSet(this,_abortController,new AbortController);const text=yield(yield fetch(path,{signal:__privateGet(this,_abortController).signal,headers:__spreadValues({"X-MORPH":"true","X-MORPH-REVALIDATE":revalidate?"true":"false","X-MORPH-CURRENT-PATH":encodeURIComponent(currentPath),"X-MORPH-NEW-PATH":encodeURIComponent(path)},__privateGet(this,_headers))})).text(),document2=domParser.parseFromString(text,"text/html");this.setInitialDocument(document2),__privateSet(this,_needRavalidation,!1)}catch(e){console.warn(e)}finally{__privateSet(this,_abortController,null),__privateSet(this,_fetching,null),res()}}))),__privateGet(this,_fetching)})}cloneDocument(){__privateSet(this,_currentDocument,(__privateGet(this,_modifiedDocument)||__privateGet(this,_initialDocument)).cloneNode(!0))}get title(){let title="";if(__privateGet(this,_currentDocument).title)title=__privateGet(this,_currentDocument).title;else{const h1=__privateGet(this,_currentDocument).querySelector("h1");title=(h1==null?void 0:h1.innerText)||(h1==null?void 0:h1.textContent)||__privateGet(this,_pathname)}return title}clearScrollState(){__privateGet(this,_scrollState).x=0,__privateGet(this,_scrollState).y=0}clearDocumentState(){__privateSet(this,_modifiedDocument,null)}saveScrollState(){__privateGet(this,_initialDocument).documentElement.hasAttribute("data-no-scroll-restoration")?(__privateGet(this,_scrollState).x=0,__privateGet(this,_scrollState).y=0):(__privateGet(this,_scrollState).x=__privateGet(this,_morph2).scrollValue.left,__privateGet(this,_scrollState).y=__privateGet(this,_morph2).scrollValue.top)}restoreScrollPosition(){__privateGet(this,_morph2).scrollElement.scroll({top:__privateGet(this,_scrollState).y,left:__privateGet(this,_scrollState).x,behavior:"instant"})}saveDocumentState(){__privateGet(this,_initialDocument).documentElement.hasAttribute("data-no-page-restoration")?__privateSet(this,_modifiedDocument,null):__privateSet(this,_modifiedDocument,document.cloneNode(!0))}renewScrollPosition(){__privateGet(this,_morph2).scrollElement.scroll({top:0,left:0,behavior:"instant"})}saveState(state){__privateSet(this,_savedState,state)}clearState(){const state=__privateGet(this,_savedState);return __privateSet(this,_savedState,null),state}};_morph2=new WeakMap,_pathname=new WeakMap,_scrollState=new WeakMap,_initialDocument=new WeakMap,_modifiedDocument=new WeakMap,_currentDocument=new WeakMap,_savedState=new WeakMap,_abortController=new WeakMap,_fetching=new WeakMap,_headers=new WeakMap,_needRavalidation=new WeakMap,__name(_MorphRoute,"MorphRoute");let MorphRoute=_MorphRoute;var _options,_morphElements,_links,_candidateURL,_currentURL,_previousURL,_promises,_isPopstateNavigation,_currentScrollElement,_isWindowScroll,_routes,_paramDependent,_announcer,_currentScrollX,_currentScrollY,_lastSubmorph,_lastRevalidate,_lastKeepScrollPosition,_checkLink,_Morph_instances,getRoute_fn,getMorphElements_fn,isElementEmitsLoadEvent_fn,updateCurrentScrollElement_fn,tryScrollToElement_fn,_popStateListener,_scrollListener;const _Morph=class _Morph{constructor(parameters){__privateAdd(this,_Morph_instances);__privateAdd(this,_options,null);__privateAdd(this,_morphElements,null);__privateAdd(this,_links,[]);__privateAdd(this,_candidateURL);__privateAdd(this,_currentURL,null);__privateAdd(this,_previousURL);__privateAdd(this,_promises,[]);__privateAdd(this,_isPopstateNavigation,!1);__privateAdd(this,_currentScrollElement,null);__privateAdd(this,_isWindowScroll,!1);__privateAdd(this,_routes,new Map);__privateAdd(this,_paramDependent,[]);__privateAdd(this,_announcer,null);__privateAdd(this,_currentScrollX,0);__privateAdd(this,_currentScrollY,0);__privateAdd(this,_lastSubmorph);__privateAdd(this,_lastRevalidate);__privateAdd(this,_lastKeepScrollPosition);__privateAdd(this,_checkLink,__name(element=>{var _a,_b;return(((_a=element.getAttribute("href"))==null?void 0:_a.startsWith("/"))||((_b=element.getAttribute("href"))==null?void 0:_b.startsWith("?")))&&!element.hasAttribute("download")&&!element.hasAttribute("data-morph-skip")&&!element.closest("[data-morph-skip]")&&element.getAttribute("target")!=="_blank"},"#checkLink"));__privateAdd(this,_popStateListener,__name(event=>__async(this,null,function*(){var _a,_b,_c,_d;(_b=(_a=event.state)==null?void 0:_a.data)!=null&&_b.popover||(_d=(_c=event.previousState)==null?void 0:_c.data)!=null&&_d.popover||(__privateSet(this,_isPopstateNavigation,!0),yield this.navigate(location.href.replace(location.origin,""),{historyAction:"none",submorph:__privateGet(this,_lastRevalidate)?void 0:__privateGet(this,_lastSubmorph),revalidate:__privateGet(this,_lastRevalidate),keepScrollPosition:__privateGet(this,_lastKeepScrollPosition)}),__privateSet(this,_isPopstateNavigation,!1))}),"#popStateListener"));__privateAdd(this,_scrollListener,__name(()=>{const{left,top}=this.scrollValue,directionY=top-__privateGet(this,_currentScrollY),directionX=left-__privateGet(this,_currentScrollX);__privateSet(this,_currentScrollY,top),__privateSet(this,_currentScrollX,left),document.documentElement.classList.toggle("scroll-y",top>0),document.documentElement.classList.toggle("scroll-x",left>0),document.documentElement.classList.toggle("scroll-y-forward",directionY>0),document.documentElement.classList.toggle("scroll-y-backward",directionY<0),document.documentElement.classList.toggle("scroll-x-forward",directionX>0),document.documentElement.classList.toggle("scroll-x-backward",directionX<0),events.dispatchEvent(document,"morphScroll",{detail:{left,top}})},"#scrollListener"));if(Store.isBrowser&&!_Morph.instance){_Morph.instance=this,__privateSet(this,_options,{base:url.normalizeBase(parameters==null?void 0:parameters.base),waitForHeadToLoad:(parameters==null?void 0:parameters.waitForHeadToLoad)!==!1,trailingSlash:(parameters==null?void 0:parameters.trailingSlash)||!1,scrollSelector:parameters==null?void 0:parameters.scrollSelector,morphInsideScrollContainer:(parameters==null?void 0:parameters.morphInsideScrollContainer)||!1}),__privateSet(this,_morphElements,__privateMethod(this,_Morph_instances,getMorphElements_fn).call(this,document.body));const normalizedURL=this.normalizePath(location.pathname+location.search+location.hash);__privateSet(this,_currentURL,normalizedURL);const initialRoute=new MorphRoute(this,__privateGet(this,_currentURL).pathname);initialRoute.setInitialDocument(document),__privateGet(this,_routes).set(__privateGet(this,_currentURL).pathname,initialRoute),document.documentElement.setAttribute("data-current-pathname",__privateGet(this,_currentURL).pathname),document.documentElement.setAttribute("data-current-leaf",normalizedURL.leaf),this.findLinks(),this.findParamsDependent(),historyManager.historyManager.addPopStateHandler(__privateGet(this,_popStateListener)),historyManager.historyManager.__change({action:"replace",pathname:normalizedURL.pathname,searchParameters:normalizedURL.parameters,hash:normalizedURL.hash}),__privateSet(this,_announcer,new MorphAnnouncer),__privateMethod(this,_Morph_instances,updateCurrentScrollElement_fn).call(this,document)}}get currentURL(){return __privateGet(this,_currentURL)}get previousURL(){return __privateGet(this,_previousURL)}get links(){return __privateGet(this,_links)}get scrollElement(){return __privateGet(this,_currentScrollElement)}get isPopstateNavigation(){return __privateGet(this,_isPopstateNavigation)}get scrollValue(){let top=0,left=0;return __privateGet(this,_isWindowScroll)?(top=window.scrollY,left=window.scrollX):(top=__privateGet(this,_currentScrollElement).scrollTop,left=__privateGet(this,_currentScrollElement).scrollLeft),{top,left}}get isNavigating(){return!!__privateGet(this,_promises).length}saveState(state){const route=__privateGet(this,_routes).get(__privateGet(this,_currentURL).path);route&&route.saveState(state)}getState(){const route=__privateGet(this,_routes).get(__privateGet(this,_currentURL).path);return route==null?void 0:route.clearState()}normalizePath(path,options){return url.splitPath(path,{base:__privateGet(this,_options).base,trailingSlash:__privateGet(this,_options).trailingSlash,mergeParams:options!=null&&options.mergeParams?location.search:"",removeParams:options==null?void 0:options.removeParams})}prefetch(path,revalidate){return __async(this,null,function*(){var _a;if(__privateGet(this,_promises).length)return;path=((_a=this.pathnameModifier)==null?void 0:_a.call(this,path))||path;const route=__privateMethod(this,_Morph_instances,getRoute_fn).call(this,path);route==null||route.fetch(path,__privateGet(this,_currentURL).path,revalidate)})}excludeHeadChild(child){return!1}needRavalidation(path){const normalizedURL=this.normalizePath(path),route=__privateMethod(this,_Morph_instances,getRoute_fn).call(this,normalizedURL.path);route==null||route.needRavalidation()}navigate(_0){return __async(this,arguments,function*(path,{historyAction="push",centerScroll,offsetScroll,scrollDuration,scrollEasing,scrollBehaviour,revalidate,keepSearchParameters,submorph,submorphAppend,clearState,keepScrollPosition,mergeParams,removeParams,detail,scrollTo}={}){var _a,_b,_c,_d;if(__privateGet(this,_promises).length)return;__privateSet(this,_lastSubmorph,submorph),__privateSet(this,_lastRevalidate,revalidate),__privateSet(this,_lastKeepScrollPosition,keepScrollPosition);const modifiedPath=((_a=this.pathnameModifier)==null?void 0:_a.call(this,path))||path,normalizedURL=this.normalizePath(modifiedPath,{mergeParams,removeParams});if(!revalidate&&(((_b=__privateGet(this,_candidateURL))==null?void 0:_b.pathname)===normalizedURL.pathname||__privateGet(this,_currentURL).pathname===normalizedURL.pathname)){keepScrollPosition||__privateMethod(this,_Morph_instances,tryScrollToElement_fn).call(this,scrollTo||normalizedURL.hash||0,{center:centerScroll,offset:offsetScroll,duration:scrollDuration,easing:scrollEasing,behavior:"smooth"}),events.dispatchEvent(document,"morphSamePath",{detail:{detail}}),((_c=__privateGet(this,_currentURL))==null?void 0:_c.parameters)!==normalizedURL.parameters&&(__privateSet(this,_previousURL,__privateGet(this,_currentURL)),__privateSet(this,_currentURL,normalizedURL),historyManager.historyManager.__change({action:((_d=__privateGet(this,_currentURL))==null?void 0:_d.hash)!==normalizedURL.hash?"replace":historyAction,pathname:normalizedURL.pathname,searchParameters:normalizedURL.parameters,hash:normalizedURL.hash}),events.dispatchEvent(document,"morphURLParametersChange",{detail:{newURL:__privateGet(this,_currentURL),previousURL:__privateGet(this,_previousURL),detail}})),__privateGet(this,_links).forEach(link=>{link.checkCurrent(normalizedURL.path)});return}else __privateGet(this,_links).forEach(link=>{link.checkCurrent(normalizedURL.path)});__privateSet(this,_candidateURL,normalizedURL);try{let preprocessedSuccesfully=!0;if(this.preprocessor)try{yield new Promise((resolve,reject)=>{var _a2;(_a2=this.preprocessor)==null||_a2.call(this,{url:normalizedURL,resolve,reject,submorph,detail})})}catch(e){e?console.error(e):console.log("Route change canceled"),preprocessedSuccesfully=!1}if(!preprocessedSuccesfully||__privateGet(this,_candidateURL).pathname!==normalizedURL.pathname){__privateGet(this,_links).forEach(link=>{link.checkCurrent(__privateGet(this,_currentURL).path)});return}const navigationEntry={url:normalizedURL,submorph,detail};submorph?submorphAppend||submorph.forEach(sel=>{document.querySelectorAll(sel).forEach(el=>{el.classList.add("out"),el.setAttribute("data-morph-out","")})}):__privateGet(this,_morphElements).forEach(el=>{var _a2,_b2;(_a2=el.firstElementChild)==null||_a2.classList.add("out"),(_b2=el.firstElementChild)==null||_b2.setAttribute("data-morph-out","")}),events.dispatchEvent(document,"morphNavigation",{detail:navigationEntry});const currentRoute=__privateMethod(this,_Morph_instances,getRoute_fn).call(this,__privateGet(this,_currentURL).pathname),nextRoute=__privateMethod(this,_Morph_instances,getRoute_fn).call(this,normalizedURL.pathname);if(__privateGet(this,_routes).forEach(el=>{el.pathname!==normalizedURL.pathname&&el.abort()}),yield nextRoute==null?void 0:nextRoute.fetch(modifiedPath,__privateGet(this,_currentURL).path,revalidate),__privateGet(this,_candidateURL).pathname!==normalizedURL.pathname){__privateGet(this,_links).forEach(link=>{link.checkCurrent(__privateGet(this,_currentURL).path)});return}currentRoute.clearState(),currentRoute.saveScrollState(),currentRoute.saveDocumentState(),(!__privateGet(this,_isPopstateNavigation)||revalidate)&&(nextRoute.clearScrollState(),nextRoute.clearDocumentState()),clearState&&nextRoute.clearState(),nextRoute.cloneDocument(),__privateGet(this,_announcer).textContent=nextRoute.title,document.body.appendChild(__privateGet(this,_announcer));const documentFetchedEntry=__spreadProps(__spreadValues({},navigationEntry),{document:nextRoute.document});submorphAppend||documentFetchedEntry.document.querySelectorAll("[data-morph-out]").forEach(el=>{el.classList.remove("out")}),events.dispatchEvent(document,"morphStart",{detail:documentFetchedEntry});const currentHeadChildren=Array.from(document.head.children),newHeadChildren=Array.from(nextRoute.document.head.children),identicalHeadChildren=dom.intersectElements(currentHeadChildren,newHeadChildren),removeHeadChildren=dom.excludeElements(currentHeadChildren,identicalHeadChildren),addHeadChildren=dom.excludeElements(newHeadChildren,identicalHeadChildren).filter(child=>!this.excludeHeadChild(child));addHeadChildren.forEach((child,index)=>{child.tagName==="SCRIPT"&&(addHeadChildren[index]=dom.createScriptElement(child))}),addHeadChildren.forEach(child=>{document.head.appendChild(child)});const elementsWithLoad=addHeadChildren.filter(child=>{if(child.hasAttribute("data-no-waiting"))return!1;if(__privateMethod(this,_Morph_instances,isElementEmitsLoadEvent_fn).call(this,child))return!0});__privateGet(this,_options).waitForHeadToLoad&&elementsWithLoad.length&&(yield new Promise(res=>__async(this,null,function*(){let counter=0;try{for(var iter=__forAwait(elementsWithLoad),more,temp,error;more=!(temp=yield iter.next()).done;more=!1){const element=temp.value;element.onload=()=>{counter++,counter===elementsWithLoad.length&&res()}}}catch(temp){error=[temp]}finally{try{more&&(temp=iter.return)&&(yield temp.call(iter))}finally{if(error)throw error[0]}}}))),yield promises.wait(10);const oldElementsWithLoadEvent=[];submorphAppend||removeHeadChildren.forEach(child=>{child.hasAttribute("data-permanent")||(__privateMethod(this,_Morph_instances,isElementEmitsLoadEvent_fn).call(this,child)?oldElementsWithLoadEvent.push(child):child.remove())});const newMorphElements=__privateMethod(this,_Morph_instances,getMorphElements_fn).call(this,nextRoute.document.body);!__privateGet(this,_options).morphInsideScrollContainer&&!submorph&&__privateMethod(this,_Morph_instances,updateCurrentScrollElement_fn).call(this,nextRoute.document),document.documentElement.setAttribute("data-current-pathname",normalizedURL.pathname),document.documentElement.setAttribute("data-current-leaf",normalizedURL.leaf),historyManager.historyManager.__change({action:historyAction,pathname:normalizedURL.pathname,searchParameters:normalizedURL.parameters||(keepSearchParameters?location.search:""),hash:normalizedURL.hash}),__privateGet(this,_announcer).remove(),__privateSet(this,_previousURL,__privateGet(this,_currentURL)),__privateSet(this,_currentURL,normalizedURL);const morphedElements=[];__privateGet(this,_morphElements).forEach((morphElement,i)=>{const newMorphElement=newMorphElements[i],duration=getComputedStyle(morphElement).getPropertyValue("--morph-duration");let newMorphElementChildNodes=[],currentMorphElementChildNodes=[];submorph?(submorph.forEach(selector=>{const curSubMorphElement=morphElement.querySelector(selector),newSubMorphElement=newMorphElement.querySelector(selector);curSubMorphElement&&newSubMorphElement&&(currentMorphElementChildNodes.push(curSubMorphElement),newMorphElementChildNodes.push(newSubMorphElement))}),currentMorphElementChildNodes.forEach(el=>{el.parentElement&&morphedElements.push(el.parentElement)})):(newMorphElementChildNodes.push(...newMorphElement.childNodes),currentMorphElementChildNodes.push(...morphElement.childNodes),morphedElements.push(morphElement));const transfer=[];submorphAppend||currentMorphElementChildNodes.forEach(element=>{element instanceof HTMLElement&&(this.destroyOldLinks(element),element.classList.add("old"),element.querySelectorAll("[data-morph-transfer]").forEach(el=>{const selector=el.getAttribute("data-morph-transfer");transfer.push({element:el,selector})}))}),newMorphElementChildNodes.forEach(element=>{element instanceof HTMLElement&&(transfer.forEach(item=>{const nestlement=element.querySelector(item.selector);nestlement&&nestlement.replaceWith(nextRoute.document.importNode(item.element,!0))}),this.findNewLinks(element),element.classList.add("new"))}),submorph?submorphAppend?newMorphElementChildNodes.forEach((el,i2)=>{currentMorphElementChildNodes[i2]instanceof HTMLElement&¤tMorphElementChildNodes[i2].append(...el.childNodes)}):newMorphElementChildNodes.forEach((el,i2)=>{var _a2;(_a2=currentMorphElementChildNodes[i2].parentElement)==null||_a2.insertBefore(el,currentMorphElementChildNodes[i2])}):morphElement.prepend(...newMorphElementChildNodes),setTimeout(()=>{submorphAppend||currentMorphElementChildNodes.forEach(element=>{element instanceof HTMLElement&&element.classList.add("old-idle")}),newMorphElementChildNodes.forEach(element=>{var _a2;element instanceof HTMLElement&&((_a2=element.parentElement)==null||_a2.style.setProperty("--new-content-height",element.offsetHeight+"px"),element.classList.add("new-idle"))})},0);const detail2=__spreadProps(__spreadValues({},documentFetchedEntry),{morphElement});events.dispatchEvent(document,"morphNewChildrenAdded",{detail:detail2});const promise=new Promise(res=>{setTimeout(()=>{submorphAppend||currentMorphElementChildNodes.forEach(el=>{el.remove()}),newMorphElementChildNodes.forEach(element=>{var _a2;element instanceof HTMLElement&&((_a2=element.parentElement)==null||_a2.style.removeProperty("--new-content-height"),element.classList.remove("new-idle","new"))}),submorphAppend||events.dispatchEvent(document,"morphOldChildrenRemoved",{detail:detail2}),res()},(parseFloat(duration)||0)*1e3+10)});__privateGet(this,_promises).push(promise)}),this.isPopstateNavigation?document.documentElement.style.setProperty("--new-document-scroll-position",(this.scrollValue.top-nextRoute.scrollState.y)*1+"px"):document.documentElement.style.setProperty("--new-document-scroll-position",this.scrollValue.top+"px"),events.dispatchEvent(document,"morphBeforeNavigationScroll",{detail:nextRoute.scrollState}),scrollTo?(nextRoute.clearScrollState(),__privateMethod(this,_Morph_instances,tryScrollToElement_fn).call(this,scrollTo,{center:centerScroll,offset:offsetScroll,duration:scrollDuration,easing:scrollEasing,behavior:scrollBehaviour})):normalizedURL.hash?(nextRoute.clearScrollState(),__privateMethod(this,_Morph_instances,tryScrollToElement_fn).call(this,normalizedURL.hash,{center:centerScroll,offset:offsetScroll,duration:scrollDuration,easing:scrollEasing,behavior:scrollBehaviour})):__privateGet(this,_isPopstateNavigation)?nextRoute.restoreScrollPosition():keepScrollPosition||nextRoute.renewScrollPosition(),yield Promise.all(__privateGet(this,_promises)),submorphAppend||oldElementsWithLoadEvent.forEach(child=>child.remove()),__privateSet(this,_promises,[]),morphedElements.forEach(el=>{el.querySelectorAll("script").forEach(element=>{element.replaceWith(dom.createScriptElement(element))})}),__privateGet(this,_links).forEach(link=>{link.checkCurrent(__privateGet(this,_currentURL).path)}),this.findParamsDependent(),events.dispatchEvent(document,"morphComplete",{detail:documentFetchedEntry}),document.documentElement.style.removeProperty("--new-document-scroll-position"),window.dispatchEvent(new Event("resize"))}catch(e){console.error(e)}__privateSet(this,_candidateURL,void 0)})}addLink(element){__privateGet(this,_links).push(new MorphLink(element,this))}addLinks(elements){elements.forEach(element=>{this.addLink(element)})}removeLink(element){__privateSet(this,_links,__privateGet(this,_links).filter(link=>link.element===element?(link.destroy(),!1):!0))}destroyOldLinks(morphElement){__privateSet(this,_links,__privateGet(this,_links).filter(link=>morphElement.contains(link.element)?(link.destroy(),!1):!0))}findNewLinks(morphElement){const linkElements=[...morphElement.querySelectorAll("a")].filter(__privateGet(this,_checkLink));__privateGet(this,_links).push(...linkElements.map(element=>new MorphLink(element,this)))}findLinks(){const linkElements=[...document.documentElement.querySelectorAll("a")].filter(__privateGet(this,_checkLink));__privateGet(this,_links).forEach(link=>link.destroy()),__privateSet(this,_links,linkElements.map(element=>new MorphLink(element,this)))}findParamsDependent(){const elements=[...document.documentElement.querySelectorAll("[data-morph-params-dependent]")];__privateGet(this,_paramDependent).forEach(link=>link.destroy()),__privateSet(this,_paramDependent,elements.map(element=>new MorphParamsDependent(element)))}};_options=new WeakMap,_morphElements=new WeakMap,_links=new WeakMap,_candidateURL=new WeakMap,_currentURL=new WeakMap,_previousURL=new WeakMap,_promises=new WeakMap,_isPopstateNavigation=new WeakMap,_currentScrollElement=new WeakMap,_isWindowScroll=new WeakMap,_routes=new WeakMap,_paramDependent=new WeakMap,_announcer=new WeakMap,_currentScrollX=new WeakMap,_currentScrollY=new WeakMap,_lastSubmorph=new WeakMap,_lastRevalidate=new WeakMap,_lastKeepScrollPosition=new WeakMap,_checkLink=new WeakMap,_Morph_instances=new WeakSet,getRoute_fn=__name(function(path){const normalizedURL=this.normalizePath(path);let route=__privateGet(this,_routes).get(normalizedURL.pathname);return route||(route=new MorphRoute(this,normalizedURL.pathname),__privateGet(this,_routes).set(normalizedURL.pathname,route)),route},"#getRoute"),getMorphElements_fn=__name(function(el){const morphElements=[...el.querySelectorAll("[data-morph]")];return morphElements.length?morphElements:[el]},"#getMorphElements"),isElementEmitsLoadEvent_fn=__name(function(element){return element.tagName==="SCRIPT"||element.tagName==="STYLE"||element.tagName==="LINK"&&element.getAttribute("rel")==="stylesheet"},"#isElementEmitsLoadEvent"),updateCurrentScrollElement_fn=__name(function(document2){var _a,_b;(_a=__privateGet(this,_currentScrollElement))==null||_a.removeEventListener("scroll",__privateGet(this,_scrollListener)),__privateSet(this,_currentScrollY,0),__privateSet(this,_currentScrollX,0),__privateSet(this,_currentScrollElement,__privateGet(this,_options).scrollSelector&&document2.querySelector(__privateGet(this,_options).scrollSelector)||window),__privateSet(this,_isWindowScroll,__privateGet(this,_currentScrollElement)===window),(_b=__privateGet(this,_currentScrollElement))==null||_b.addEventListener("scroll",__privateGet(this,_scrollListener)),__privateGet(this,_scrollListener).call(this)},"#updateCurrentScrollElement"),tryScrollToElement_fn=__name(function(id,options){const value=typeof id=="string"?document.querySelector(id):id;(typeof value=="number"||value)&&scroll.scrollToElement(value,__spreadValues({scrollElement:__privateGet(this,_currentScrollElement)},options))},"#tryScrollToElement"),_popStateListener=new WeakMap,_scrollListener=new WeakMap,__name(_Morph,"Morph"),_Morph.instance=null;let Morph=_Morph;exports.Morph=Morph;
|
|
1
|
+
"use strict";var __defProp=Object.defineProperty,__defProps=Object.defineProperties;var __getOwnPropDescs=Object.getOwnPropertyDescriptors;var __getOwnPropSymbols=Object.getOwnPropertySymbols;var __hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable;var __knownSymbol=(name,symbol)=>(symbol=Symbol[name])?symbol:Symbol.for("Symbol."+name),__typeError=msg=>{throw TypeError(msg)};var __defNormalProp=(obj,key,value)=>key in obj?__defProp(obj,key,{enumerable:!0,configurable:!0,writable:!0,value}):obj[key]=value,__spreadValues=(a,b)=>{for(var prop in b||(b={}))__hasOwnProp.call(b,prop)&&__defNormalProp(a,prop,b[prop]);if(__getOwnPropSymbols)for(var prop of __getOwnPropSymbols(b))__propIsEnum.call(b,prop)&&__defNormalProp(a,prop,b[prop]);return a},__spreadProps=(a,b)=>__defProps(a,__getOwnPropDescs(b)),__name=(target,value)=>__defProp(target,"name",{value,configurable:!0});var __accessCheck=(obj,member,msg)=>member.has(obj)||__typeError("Cannot "+msg);var __privateGet=(obj,member,getter)=>(__accessCheck(obj,member,"read from private field"),getter?getter.call(obj):member.get(obj)),__privateAdd=(obj,member,value)=>member.has(obj)?__typeError("Cannot add the same private member more than once"):member instanceof WeakSet?member.add(obj):member.set(obj,value),__privateSet=(obj,member,value,setter)=>(__accessCheck(obj,member,"write to private field"),setter?setter.call(obj,value):member.set(obj,value),value),__privateMethod=(obj,member,method)=>(__accessCheck(obj,member,"access private method"),method);var __async=(__this,__arguments,generator)=>new Promise((resolve,reject)=>{var fulfilled=value=>{try{step(generator.next(value))}catch(e){reject(e)}},rejected=value=>{try{step(generator.throw(value))}catch(e){reject(e)}},step=x=>x.done?resolve(x.value):Promise.resolve(x.value).then(fulfilled,rejected);step((generator=generator.apply(__this,__arguments)).next())});var __forAwait=(obj,it,method)=>(it=obj[__knownSymbol("asyncIterator")])?it.call(obj):(obj=obj[__knownSymbol("iterator")](),it={},method=(key,fn)=>(fn=obj[key])&&(it[key]=arg=>new Promise((yes,no,done)=>(arg=fn.call(obj,arg),done=arg.done,Promise.resolve(arg.value).then(value=>yes({value,done}),no)))),method("next"),method("return"),it);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Store=require("../Store-B96mD8mD.cjs"),dom=require("../dom-B40i6NXw.cjs"),events=require("../events-UlGk63iC.cjs"),promises=require("../promises-nDm8_iG6.cjs"),scroll=require("../scroll-CTDesBpj.cjs");require("construct-style-sheets-polyfill");require("../index-BoGx2BWX.cjs");const url=require("../url-D0rESDQq.cjs"),cssValueParser_index=require("../css-value-parser/index.cjs"),historyManager=require("../historyManager-DB2fSEtH.cjs"),_MorphAnnouncer=class _MorphAnnouncer extends HTMLElement{connectedCallback(){const attrs={"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[key,value]of Object.entries(attrs))this.setAttribute(key,value)}};__name(_MorphAnnouncer,"MorphAnnouncer");let MorphAnnouncer=_MorphAnnouncer;Store.isBrowser&&!customElements.get("morph-announcer")&&customElements.define("morph-announcer",MorphAnnouncer);var _morph,_element,_MorphLink_instances,path_get,click_fn,_clickListener,_pointerListener;const _MorphLink=class _MorphLink{constructor(element,morph){__privateAdd(this,_MorphLink_instances);__privateAdd(this,_morph);__privateAdd(this,_element);__privateAdd(this,_clickListener,__name(e=>{e.preventDefault(),__privateMethod(this,_MorphLink_instances,click_fn).call(this)},"#clickListener"));__privateAdd(this,_pointerListener,__name(()=>{const revalidate=__privateGet(this,_element).hasAttribute("data-revalidate");__privateGet(this,_morph).prefetch(__privateGet(this,_MorphLink_instances,path_get),revalidate),__privateGet(this,_element).removeEventListener("pointerenter",__privateGet(this,_pointerListener))},"#pointerListener"));__privateSet(this,_morph,morph),__privateSet(this,_element,element),__privateGet(this,_element).addEventListener("click",__privateGet(this,_clickListener)),this.checkCurrent(location.href.replace(location.origin,"")),__privateGet(this,_element).hasAttribute("data-prefetch")&&__privateGet(this,_element).addEventListener("pointerenter",__privateGet(this,_pointerListener))}get element(){return __privateGet(this,_element)}checkCurrent(path){var _a,_b;const locationUrl=__privateGet(this,_morph).normalizePath(path),linkUrl=__privateGet(this,_morph).normalizePath(__privateGet(this,_MorphLink_instances,path_get));__privateGet(this,_element).hasAttribute("data-include")&&locationUrl.pathname.includes(linkUrl.pathname)?__privateGet(this,_element).classList.add("current"):linkUrl.pathname===locationUrl.pathname?__privateGet(this,_element).classList.add("current"):(_a=__privateGet(this,_element).getAttribute("data-associated-paths"))!=null&&_a.split(",").find(path2=>locationUrl.pathname.includes(path2))?__privateGet(this,_element).classList.add("current"):__privateGet(this,_element).classList.remove("current"),locationUrl.path===linkUrl.path?__privateGet(this,_element).classList.add("exact"):__privateGet(this,_element).classList.remove("exact");const[pathWithoutParams,pathParamsStr]=(_b=__privateGet(this,_MorphLink_instances,path_get).split("#")[0])==null?void 0:_b.split("?"),pathParams=new URLSearchParams(pathParamsStr),locationParams=new URLSearchParams(location.search);let matchCounter=0;for(const[key]of locationParams)pathParams.has(key)&&locationParams.get(key)===pathParams.get(key)&&matchCounter++;matchCounter?(__privateGet(this,_element).classList.toggle("all-params-matched",locationParams.size===matchCounter),__privateGet(this,_element).classList.toggle("some-params-matched",locationParams.size!==matchCounter)):!locationParams.size&&__privateGet(this,_element).hasAttribute("data-match-no-params")?__privateGet(this,_element).classList.add("all-params-matched"):(__privateGet(this,_element).classList.remove("all-params-matched"),__privateGet(this,_element).classList.remove("some-params-matched"));for(const key in __privateGet(this,_element).dataset){const kebabKey=Store.camelToKebab(key);if(kebabKey.startsWith("match-param-")){const name=kebabKey.split("match-param-")[1],value=__privateGet(this,_element).dataset[key],className=`param-${name}-matched`;locationParams.has(name)&&locationParams.get(name)===value||!locationParams.has(name)&&(value===""||value==="*"||value==="all"||value==="any"||value==="vse")?__privateGet(this,_element).classList.add(className):__privateGet(this,_element).classList.remove(className)}}}destroy(){__privateGet(this,_element).removeEventListener("click",__privateGet(this,_clickListener)),__privateGet(this,_element).removeEventListener("pointerenter",__privateGet(this,_pointerListener)),__privateGet(this,_element).classList.remove("current","exact")}};_morph=new WeakMap,_element=new WeakMap,_MorphLink_instances=new WeakSet,path_get=__name(function(){const url2=new URL(__privateGet(this,_element).href);return __privateGet(this,_morph).normalizePath(url2.pathname+url2.search+url2.hash).path},"#path"),click_fn=__name(function(){var _a;if(document.documentElement.classList.contains("click-disabled"))return;if(__privateGet(this,_element).hasAttribute("data-back")&&__privateGet(this,_morph).previousURL)history.back();else{const historyAction=__privateGet(this,_element).getAttribute("data-history-action")||"push",centerScroll=__privateGet(this,_element).hasAttribute("data-center-scroll"),offsetScrollRawValue=getComputedStyle(__privateGet(this,_element)).getPropertyValue("--offset-scroll").trim(),offsetScroll=offsetScrollRawValue?cssValueParser_index.cssValueParser.parse(offsetScrollRawValue):void 0,scrollDuration=parseFloat(__privateGet(this,_element).getAttribute("data-scroll-duration")||"0")||void 0,scrollEasing=__privateGet(this,_element).getAttribute("data-scroll-easing")||void 0,revalidate=__privateGet(this,_element).hasAttribute("data-revalidate")||__privateGet(this,_element).hasAttribute("data-pagination-more-link")||__privateGet(this,_element).hasAttribute("data-pagination-set-link")||__privateGet(this,_element).hasAttribute("data-pagination-next-link")||__privateGet(this,_element).hasAttribute("data-pagination-prev-link"),keepSearchParameters=__privateGet(this,_element).hasAttribute("data-keep-search-parameters"),keepScrollPosition=__privateGet(this,_element).hasAttribute("data-keep-scroll-position")||__privateGet(this,_element).hasAttribute("data-pagination-more-link"),scrollBehaviour=__privateGet(this,_element).getAttribute("data-scroll-behaviour"),submorph=(_a=__privateGet(this,_element).getAttribute("data-submorph")||__privateGet(this,_element).getAttribute("data-submorph-append"))==null?void 0:_a.split(",").map(v=>v.trim()),clearState=__privateGet(this,_element).hasAttribute("data-clear-state");let path=__privateGet(this,_MorphLink_instances,path_get);if(__privateGet(this,_element).hasAttribute("data-toggle-params")){const[pathWithoutParams,pathParamsStr]=__privateGet(this,_MorphLink_instances,path_get).split("?"),pathParams=new URLSearchParams(pathParamsStr),locationParams=new URLSearchParams(location.search),resultParams=new URLSearchParams;for(const[key]of pathParams)(!locationParams.has(key)||locationParams.has(key)&&locationParams.get(key)!==pathParams.get(key))&&resultParams.append(key,pathParams.get(key));if(__privateGet(this,_element).hasAttribute("data-merge-params"))for(const[key]of locationParams)pathParams.has(key)||resultParams.append(key,locationParams.get(key));path=`${pathWithoutParams}?${resultParams.toString()}`}__privateGet(this,_morph).navigate(path,{historyAction,centerScroll,offsetScroll,revalidate,keepSearchParameters,submorph,clearState,keepScrollPosition,scrollBehaviour,scrollDuration,scrollEasing,submorphAppend:__privateGet(this,_element).hasAttribute("data-submorph-append"),mergeParams:__privateGet(this,_element).hasAttribute("data-merge-params")&&!__privateGet(this,_element).hasAttribute("data-toggle-params"),detail:__privateGet(this,_element).getAttribute("data-detail"),removeParams:__privateGet(this,_element).getAttribute("data-remove-params")||void 0,scrollTo:__privateGet(this,_element).getAttribute("data-scroll-to")||void 0})}},"#click"),_clickListener=new WeakMap,_pointerListener=new WeakMap,__name(_MorphLink,"MorphLink");let MorphLink=_MorphLink;var _element2,_params,_MorphParamsDependent_instances,update_fn,_urlChangeListener;const _MorphParamsDependent=class _MorphParamsDependent{constructor(element){__privateAdd(this,_MorphParamsDependent_instances);__privateAdd(this,_element2);__privateAdd(this,_params,[]);__privateAdd(this,_urlChangeListener,__name(()=>{__privateMethod(this,_MorphParamsDependent_instances,update_fn).call(this)},"#urlChangeListener"));__privateSet(this,_element2,element);for(const key in __privateGet(this,_element2).dataset){const kebabKey=Store.camelToKebab(key);if(kebabKey.startsWith("param-")){const name=kebabKey.split("param-")[1],value=__privateGet(this,_element2).dataset[key];__privateGet(this,_params).push({name,value})}}document.addEventListener("morphURLParametersChange",__privateGet(this,_urlChangeListener)),__privateMethod(this,_MorphParamsDependent_instances,update_fn).call(this)}destroy(){document.removeEventListener("morphURLParametersChange",__privateGet(this,_urlChangeListener))}};_element2=new WeakMap,_params=new WeakMap,_MorphParamsDependent_instances=new WeakSet,update_fn=__name(function(){const locationParams=new URLSearchParams(location.search);let matched=!!__privateGet(this,_params).find(param=>locationParams.has(param.name)&&(locationParams.get(param.name)===param.value||param.value==="*"||param.value==="all"||param.value==="any"||param.value==="vse"||locationParams.get(param.name)==="*"||locationParams.get(param.name)==="all"||locationParams.get(param.name)==="any"||locationParams.get(param.name)==="vse"));!matched&&__privateGet(this,_element2).hasAttribute("data-match-no-params")&&(matched=!__privateGet(this,_params).filter(param=>locationParams.has(param.name)).length);const hideClass=__privateGet(this,_element2).getAttribute("data-hide-class");matched?hideClass?__privateGet(this,_element2).classList.remove(hideClass):__privateGet(this,_element2).style.display="":hideClass?__privateGet(this,_element2).classList.add(hideClass):__privateGet(this,_element2).style.display="none",requestAnimationFrame(()=>{window.dispatchEvent(new CustomEvent("resize"))})},"#update"),_urlChangeListener=new WeakMap,__name(_MorphParamsDependent,"MorphParamsDependent");let MorphParamsDependent=_MorphParamsDependent;const domParser=new DOMParser;var _morph2,_pathname,_scrollState,_initialDocument,_modifiedDocument,_currentDocument,_savedState,_abortController,_fetching,_headers,_needRavalidation;const _MorphRoute=class _MorphRoute{constructor(morph,pathname){__privateAdd(this,_morph2);__privateAdd(this,_pathname);__privateAdd(this,_scrollState,{x:0,y:0});__privateAdd(this,_initialDocument,null);__privateAdd(this,_modifiedDocument,null);__privateAdd(this,_currentDocument,null);__privateAdd(this,_savedState,null);__privateAdd(this,_abortController,null);__privateAdd(this,_fetching,null);__privateAdd(this,_headers);__privateAdd(this,_needRavalidation,!1);__privateSet(this,_morph2,morph),__privateSet(this,_pathname,pathname)}get pathname(){return __privateGet(this,_pathname)}get scrollState(){return __privateGet(this,_scrollState)}get document(){return __privateGet(this,_currentDocument)}needRavalidation(){__privateSet(this,_needRavalidation,!0)}setHeaders(headers){__privateSet(this,_headers,headers)}setInitialDocument(document2){__privateSet(this,_initialDocument,document2.cloneNode(!0))}abort(){var _a;return(_a=__privateGet(this,_abortController))==null?void 0:_a.abort(`[${__privateGet(this,_pathname)}] page loading cancelled`)}fetch(path,currentPath,revalidate){return __async(this,null,function*(){var _a;if(!revalidate&&!__privateGet(this,_needRavalidation)){const shouldUseCache=((_a=__privateGet(this,_initialDocument))==null?void 0:_a.documentElement.getAttribute("data-cache"))&¤tPath!==path,isPopstateNavigation=__privateGet(this,_initialDocument)&&__privateGet(this,_morph2).isPopstateNavigation;if(__privateGet(this,_fetching)||shouldUseCache||isPopstateNavigation)return __privateGet(this,_fetching)}return __privateSet(this,_fetching,new Promise(res=>__async(this,null,function*(){try{__privateSet(this,_abortController,new AbortController);const text=yield(yield fetch(path,{signal:__privateGet(this,_abortController).signal,headers:__spreadValues({"X-MORPH":"true","X-MORPH-REVALIDATE":revalidate?"true":"false","X-MORPH-CURRENT-PATH":encodeURIComponent(currentPath),"X-MORPH-NEW-PATH":encodeURIComponent(path)},__privateGet(this,_headers))})).text(),document2=domParser.parseFromString(text,"text/html");this.setInitialDocument(document2),__privateSet(this,_needRavalidation,!1)}catch(e){console.warn(e)}finally{__privateSet(this,_abortController,null),__privateSet(this,_fetching,null),res()}}))),__privateGet(this,_fetching)})}cloneDocument(){__privateSet(this,_currentDocument,(__privateGet(this,_modifiedDocument)||__privateGet(this,_initialDocument)).cloneNode(!0))}get title(){let title="";if(__privateGet(this,_currentDocument).title)title=__privateGet(this,_currentDocument).title;else{const h1=__privateGet(this,_currentDocument).querySelector("h1");title=(h1==null?void 0:h1.innerText)||(h1==null?void 0:h1.textContent)||__privateGet(this,_pathname)}return title}clearScrollState(){__privateGet(this,_scrollState).x=0,__privateGet(this,_scrollState).y=0}clearDocumentState(){__privateSet(this,_modifiedDocument,null)}saveScrollState(){__privateGet(this,_initialDocument).documentElement.hasAttribute("data-no-scroll-restoration")?(__privateGet(this,_scrollState).x=0,__privateGet(this,_scrollState).y=0):(__privateGet(this,_scrollState).x=__privateGet(this,_morph2).scrollValue.left,__privateGet(this,_scrollState).y=__privateGet(this,_morph2).scrollValue.top)}restoreScrollPosition(){__privateGet(this,_morph2).scrollElement.scroll({top:__privateGet(this,_scrollState).y,left:__privateGet(this,_scrollState).x,behavior:"instant"})}saveDocumentState(){__privateGet(this,_initialDocument).documentElement.hasAttribute("data-no-page-restoration")?__privateSet(this,_modifiedDocument,null):__privateSet(this,_modifiedDocument,document.cloneNode(!0))}renewScrollPosition(){__privateGet(this,_morph2).scrollElement.scroll({top:0,left:0,behavior:"instant"})}saveState(state){__privateSet(this,_savedState,state)}clearState(){const state=__privateGet(this,_savedState);return __privateSet(this,_savedState,null),state}};_morph2=new WeakMap,_pathname=new WeakMap,_scrollState=new WeakMap,_initialDocument=new WeakMap,_modifiedDocument=new WeakMap,_currentDocument=new WeakMap,_savedState=new WeakMap,_abortController=new WeakMap,_fetching=new WeakMap,_headers=new WeakMap,_needRavalidation=new WeakMap,__name(_MorphRoute,"MorphRoute");let MorphRoute=_MorphRoute;var _options,_morphElements,_links,_candidateURL,_currentURL,_previousURL,_promises,_isPopstateNavigation,_currentScrollElement,_isWindowScroll,_routes,_paramDependent,_announcer,_currentScrollX,_currentScrollY,_lastSubmorph,_lastRevalidate,_lastKeepScrollPosition,_checkLink,_Morph_instances,getRoute_fn,getMorphElements_fn,isElementEmitsLoadEvent_fn,updateCurrentScrollElement_fn,tryScrollToElement_fn,_popStateListener,_scrollListener;const _Morph=class _Morph{constructor(parameters){__privateAdd(this,_Morph_instances);__privateAdd(this,_options,null);__privateAdd(this,_morphElements,null);__privateAdd(this,_links,[]);__privateAdd(this,_candidateURL);__privateAdd(this,_currentURL,null);__privateAdd(this,_previousURL);__privateAdd(this,_promises,[]);__privateAdd(this,_isPopstateNavigation,!1);__privateAdd(this,_currentScrollElement,null);__privateAdd(this,_isWindowScroll,!1);__privateAdd(this,_routes,new Map);__privateAdd(this,_paramDependent,[]);__privateAdd(this,_announcer,null);__privateAdd(this,_currentScrollX,0);__privateAdd(this,_currentScrollY,0);__privateAdd(this,_lastSubmorph);__privateAdd(this,_lastRevalidate);__privateAdd(this,_lastKeepScrollPosition);__privateAdd(this,_checkLink,__name(element=>{var _a,_b;return(((_a=element.getAttribute("href"))==null?void 0:_a.startsWith("/"))||((_b=element.getAttribute("href"))==null?void 0:_b.startsWith("?")))&&!element.hasAttribute("download")&&!element.hasAttribute("data-morph-skip")&&!element.closest("[data-morph-skip]")&&element.getAttribute("target")!=="_blank"},"#checkLink"));__privateAdd(this,_popStateListener,__name(event=>__async(this,null,function*(){var _a,_b,_c,_d;(_b=(_a=event.state)==null?void 0:_a.data)!=null&&_b.popover||(_d=(_c=event.previousState)==null?void 0:_c.data)!=null&&_d.popover||(__privateSet(this,_isPopstateNavigation,!0),yield this.navigate(location.href.replace(location.origin,""),{historyAction:"none",submorph:__privateGet(this,_lastRevalidate)?void 0:__privateGet(this,_lastSubmorph),revalidate:__privateGet(this,_lastRevalidate),keepScrollPosition:__privateGet(this,_lastKeepScrollPosition)}),__privateSet(this,_isPopstateNavigation,!1))}),"#popStateListener"));__privateAdd(this,_scrollListener,__name(()=>{const{left,top}=this.scrollValue,directionY=top-__privateGet(this,_currentScrollY),directionX=left-__privateGet(this,_currentScrollX);__privateSet(this,_currentScrollY,top),__privateSet(this,_currentScrollX,left),document.documentElement.classList.toggle("scroll-y",top>0),document.documentElement.classList.toggle("scroll-x",left>0),document.documentElement.classList.toggle("scroll-y-forward",directionY>0),document.documentElement.classList.toggle("scroll-y-backward",directionY<0),document.documentElement.classList.toggle("scroll-x-forward",directionX>0),document.documentElement.classList.toggle("scroll-x-backward",directionX<0),events.dispatchEvent(document,"morphScroll",{detail:{left,top}})},"#scrollListener"));if(Store.isBrowser&&!_Morph.instance){_Morph.instance=this,__privateSet(this,_options,{base:url.normalizeBase(parameters==null?void 0:parameters.base),waitForHeadToLoad:(parameters==null?void 0:parameters.waitForHeadToLoad)!==!1,trailingSlash:(parameters==null?void 0:parameters.trailingSlash)||!1,scrollSelector:parameters==null?void 0:parameters.scrollSelector,morphInsideScrollContainer:(parameters==null?void 0:parameters.morphInsideScrollContainer)||!1}),__privateSet(this,_morphElements,__privateMethod(this,_Morph_instances,getMorphElements_fn).call(this,document.body));const normalizedURL=this.normalizePath(location.pathname+location.search+location.hash);__privateSet(this,_currentURL,normalizedURL);const initialRoute=new MorphRoute(this,__privateGet(this,_currentURL).pathname);initialRoute.setInitialDocument(document),__privateGet(this,_routes).set(__privateGet(this,_currentURL).pathname,initialRoute),document.documentElement.setAttribute("data-current-pathname",__privateGet(this,_currentURL).pathname),document.documentElement.setAttribute("data-current-leaf",normalizedURL.leaf),this.findLinks(),this.findParamsDependent(),historyManager.historyManager.addPopStateHandler(__privateGet(this,_popStateListener)),historyManager.historyManager.__change({action:"replace",pathname:normalizedURL.pathname,searchParameters:normalizedURL.parameters,hash:normalizedURL.hash}),__privateSet(this,_announcer,new MorphAnnouncer),__privateMethod(this,_Morph_instances,updateCurrentScrollElement_fn).call(this,document)}}get currentURL(){return __privateGet(this,_currentURL)}get previousURL(){return __privateGet(this,_previousURL)}get links(){return __privateGet(this,_links)}get scrollElement(){return __privateGet(this,_currentScrollElement)}get isPopstateNavigation(){return __privateGet(this,_isPopstateNavigation)}get scrollValue(){let top=0,left=0;return __privateGet(this,_isWindowScroll)?(top=window.scrollY,left=window.scrollX):(top=__privateGet(this,_currentScrollElement).scrollTop,left=__privateGet(this,_currentScrollElement).scrollLeft),{top,left}}get isNavigating(){return!!__privateGet(this,_promises).length}saveState(state){const route=__privateGet(this,_routes).get(__privateGet(this,_currentURL).path);route&&route.saveState(state)}getState(){const route=__privateGet(this,_routes).get(__privateGet(this,_currentURL).path);return route==null?void 0:route.clearState()}normalizePath(path,options){return url.splitPath(path,{base:__privateGet(this,_options).base,trailingSlash:__privateGet(this,_options).trailingSlash,mergeParams:options!=null&&options.mergeParams?location.search:"",removeParams:options==null?void 0:options.removeParams})}prefetch(path,revalidate){return __async(this,null,function*(){var _a;if(__privateGet(this,_promises).length)return;path=((_a=this.pathnameModifier)==null?void 0:_a.call(this,path))||path;const route=__privateMethod(this,_Morph_instances,getRoute_fn).call(this,path);route==null||route.fetch(path,__privateGet(this,_currentURL).path,revalidate)})}excludeHeadChild(child){return!1}needRavalidation(path){const normalizedURL=this.normalizePath(path),route=__privateMethod(this,_Morph_instances,getRoute_fn).call(this,normalizedURL.path);route==null||route.needRavalidation()}navigate(_0){return __async(this,arguments,function*(path,{historyAction="push",centerScroll,offsetScroll,scrollDuration,scrollEasing,scrollBehaviour,revalidate,keepSearchParameters,submorph,submorphAppend,clearState,keepScrollPosition,mergeParams,removeParams,detail,scrollTo}={}){var _a,_b,_c,_d;if(__privateGet(this,_promises).length)return;__privateSet(this,_lastSubmorph,submorph),__privateSet(this,_lastRevalidate,revalidate),__privateSet(this,_lastKeepScrollPosition,keepScrollPosition);const modifiedPath=((_a=this.pathnameModifier)==null?void 0:_a.call(this,path))||path,normalizedURL=this.normalizePath(modifiedPath,{mergeParams,removeParams});if(!revalidate&&(((_b=__privateGet(this,_candidateURL))==null?void 0:_b.pathname)===normalizedURL.pathname||__privateGet(this,_currentURL).pathname===normalizedURL.pathname)){keepScrollPosition||__privateMethod(this,_Morph_instances,tryScrollToElement_fn).call(this,scrollTo||normalizedURL.hash||0,{center:centerScroll,offset:offsetScroll,duration:scrollDuration,easing:scrollEasing,behavior:"smooth"}),events.dispatchEvent(document,"morphSamePath",{detail:{detail}}),((_c=__privateGet(this,_currentURL))==null?void 0:_c.parameters)!==normalizedURL.parameters&&(__privateSet(this,_previousURL,__privateGet(this,_currentURL)),__privateSet(this,_currentURL,normalizedURL),historyManager.historyManager.__change({action:((_d=__privateGet(this,_currentURL))==null?void 0:_d.hash)!==normalizedURL.hash?"replace":historyAction,pathname:normalizedURL.pathname,searchParameters:normalizedURL.parameters,hash:normalizedURL.hash}),events.dispatchEvent(document,"morphURLParametersChange",{detail:{newURL:__privateGet(this,_currentURL),previousURL:__privateGet(this,_previousURL),detail}})),__privateGet(this,_links).forEach(link=>{link.checkCurrent(normalizedURL.path)});return}else __privateGet(this,_links).forEach(link=>{link.checkCurrent(normalizedURL.path)});__privateSet(this,_candidateURL,normalizedURL);try{let preprocessedSuccesfully=!0;if(this.preprocessor)try{yield new Promise((resolve,reject)=>{var _a2;(_a2=this.preprocessor)==null||_a2.call(this,{url:normalizedURL,resolve,reject,submorph,detail})})}catch(e){e?console.error(e):console.log("Route change canceled"),preprocessedSuccesfully=!1}if(!preprocessedSuccesfully||__privateGet(this,_candidateURL).pathname!==normalizedURL.pathname){__privateGet(this,_links).forEach(link=>{link.checkCurrent(__privateGet(this,_currentURL).path)});return}const navigationEntry={url:normalizedURL,submorph,detail};submorph?submorphAppend||submorph.forEach(sel=>{document.querySelectorAll(sel).forEach(el=>{el.classList.add("out"),el.setAttribute("data-morph-out","")})}):__privateGet(this,_morphElements).forEach(el=>{var _a2,_b2;(_a2=el.firstElementChild)==null||_a2.classList.add("out"),(_b2=el.firstElementChild)==null||_b2.setAttribute("data-morph-out","")}),events.dispatchEvent(document,"morphNavigation",{detail:navigationEntry});const currentRoute=__privateMethod(this,_Morph_instances,getRoute_fn).call(this,__privateGet(this,_currentURL).pathname),nextRoute=__privateMethod(this,_Morph_instances,getRoute_fn).call(this,normalizedURL.pathname);if(__privateGet(this,_routes).forEach(el=>{el.pathname!==normalizedURL.pathname&&el.abort()}),yield nextRoute==null?void 0:nextRoute.fetch(modifiedPath,__privateGet(this,_currentURL).path,revalidate),__privateGet(this,_candidateURL).pathname!==normalizedURL.pathname){__privateGet(this,_links).forEach(link=>{link.checkCurrent(__privateGet(this,_currentURL).path)});return}currentRoute.clearState(),currentRoute.saveScrollState(),currentRoute.saveDocumentState(),(!__privateGet(this,_isPopstateNavigation)||revalidate)&&(nextRoute.clearScrollState(),nextRoute.clearDocumentState()),clearState&&nextRoute.clearState(),nextRoute.cloneDocument(),__privateGet(this,_announcer).textContent=nextRoute.title,document.body.appendChild(__privateGet(this,_announcer));const documentFetchedEntry=__spreadProps(__spreadValues({},navigationEntry),{document:nextRoute.document});submorphAppend||documentFetchedEntry.document.querySelectorAll("[data-morph-out]").forEach(el=>{el.classList.remove("out")}),events.dispatchEvent(document,"morphStart",{detail:documentFetchedEntry});const currentHeadChildren=Array.from(document.head.children),newHeadChildren=Array.from(nextRoute.document.head.children),identicalHeadChildren=dom.intersectElements(currentHeadChildren,newHeadChildren),removeHeadChildren=dom.excludeElements(currentHeadChildren,identicalHeadChildren),addHeadChildren=dom.excludeElements(newHeadChildren,identicalHeadChildren).filter(child=>!this.excludeHeadChild(child));addHeadChildren.forEach((child,index)=>{child.tagName==="SCRIPT"&&(addHeadChildren[index]=dom.createScriptElement(child))}),addHeadChildren.forEach(child=>{document.head.appendChild(child)});const elementsWithLoad=addHeadChildren.filter(child=>{if(child.hasAttribute("data-no-waiting"))return!1;if(__privateMethod(this,_Morph_instances,isElementEmitsLoadEvent_fn).call(this,child))return!0});__privateGet(this,_options).waitForHeadToLoad&&elementsWithLoad.length&&(yield new Promise(res=>__async(this,null,function*(){let counter=0;try{for(var iter=__forAwait(elementsWithLoad),more,temp,error;more=!(temp=yield iter.next()).done;more=!1){const element=temp.value;element.onload=()=>{counter++,counter===elementsWithLoad.length&&res()}}}catch(temp){error=[temp]}finally{try{more&&(temp=iter.return)&&(yield temp.call(iter))}finally{if(error)throw error[0]}}}))),yield promises.wait(10);const oldElementsWithLoadEvent=[];submorphAppend||removeHeadChildren.forEach(child=>{child.hasAttribute("data-permanent")||(__privateMethod(this,_Morph_instances,isElementEmitsLoadEvent_fn).call(this,child)?oldElementsWithLoadEvent.push(child):child.remove())});const newMorphElements=__privateMethod(this,_Morph_instances,getMorphElements_fn).call(this,nextRoute.document.body);!__privateGet(this,_options).morphInsideScrollContainer&&!submorph&&__privateMethod(this,_Morph_instances,updateCurrentScrollElement_fn).call(this,nextRoute.document),document.documentElement.setAttribute("data-current-pathname",normalizedURL.pathname),document.documentElement.setAttribute("data-current-leaf",normalizedURL.leaf),historyManager.historyManager.__change({action:historyAction,pathname:normalizedURL.pathname,searchParameters:normalizedURL.parameters||(keepSearchParameters?location.search:""),hash:normalizedURL.hash}),__privateGet(this,_announcer).remove(),__privateSet(this,_previousURL,__privateGet(this,_currentURL)),__privateSet(this,_currentURL,normalizedURL);const morphedElements=[];__privateGet(this,_morphElements).forEach((morphElement,i)=>{const newMorphElement=newMorphElements[i],duration=getComputedStyle(morphElement).getPropertyValue("--morph-duration");let newMorphElementChildNodes=[],currentMorphElementChildNodes=[];submorph?(submorph.forEach(selector=>{const curSubMorphElement=morphElement.querySelector(selector),newSubMorphElement=newMorphElement.querySelector(selector);curSubMorphElement&&newSubMorphElement&&(currentMorphElementChildNodes.push(curSubMorphElement),newMorphElementChildNodes.push(newSubMorphElement))}),currentMorphElementChildNodes.forEach(el=>{el.parentElement&&morphedElements.push(el.parentElement)})):(newMorphElementChildNodes.push(...newMorphElement.childNodes),currentMorphElementChildNodes.push(...morphElement.childNodes),morphedElements.push(morphElement));const transfer=[];submorphAppend||currentMorphElementChildNodes.forEach(element=>{element instanceof HTMLElement&&(this.destroyOldLinks(element),element.classList.add("old"),element.querySelectorAll("[data-morph-transfer]").forEach(el=>{const selector=el.getAttribute("data-morph-transfer");transfer.push({element:el,selector})}))}),newMorphElementChildNodes.forEach(element=>{element instanceof HTMLElement&&(transfer.forEach(item=>{const nestlement=element.querySelector(item.selector);nestlement&&nestlement.replaceWith(nextRoute.document.importNode(item.element,!0))}),this.findNewLinks(element),element.classList.add("new"))}),submorph?submorphAppend?newMorphElementChildNodes.forEach((el,i2)=>{currentMorphElementChildNodes[i2]instanceof HTMLElement&¤tMorphElementChildNodes[i2].append(...el.childNodes)}):newMorphElementChildNodes.forEach((el,i2)=>{var _a2;(_a2=currentMorphElementChildNodes[i2].parentElement)==null||_a2.insertBefore(el,currentMorphElementChildNodes[i2])}):morphElement.prepend(...newMorphElementChildNodes),setTimeout(()=>{submorphAppend||currentMorphElementChildNodes.forEach(element=>{element instanceof HTMLElement&&element.classList.add("old-idle")}),newMorphElementChildNodes.forEach(element=>{var _a2;element instanceof HTMLElement&&((_a2=element.parentElement)==null||_a2.style.setProperty("--new-content-height",element.offsetHeight+"px"),element.classList.add("new-idle"))})},0);const detail2=__spreadProps(__spreadValues({},documentFetchedEntry),{morphElement});events.dispatchEvent(document,"morphNewChildrenAdded",{detail:detail2});const promise=new Promise(res=>{setTimeout(()=>{submorphAppend||currentMorphElementChildNodes.forEach(el=>{el.remove()}),newMorphElementChildNodes.forEach(element=>{var _a2;element instanceof HTMLElement&&((_a2=element.parentElement)==null||_a2.style.removeProperty("--new-content-height"),element.classList.remove("new-idle","new"))}),submorphAppend||events.dispatchEvent(document,"morphOldChildrenRemoved",{detail:detail2}),res()},(parseFloat(duration)||0)*1e3+10)});__privateGet(this,_promises).push(promise)}),this.isPopstateNavigation?document.documentElement.style.setProperty("--new-document-scroll-position",(this.scrollValue.top-nextRoute.scrollState.y)*1+"px"):document.documentElement.style.setProperty("--new-document-scroll-position",this.scrollValue.top+"px"),events.dispatchEvent(document,"morphBeforeNavigationScroll",{detail:nextRoute.scrollState}),scrollTo?(nextRoute.clearScrollState(),__privateMethod(this,_Morph_instances,tryScrollToElement_fn).call(this,scrollTo,{center:centerScroll,offset:offsetScroll,duration:scrollDuration,easing:scrollEasing,behavior:scrollBehaviour})):normalizedURL.hash?(nextRoute.clearScrollState(),__privateMethod(this,_Morph_instances,tryScrollToElement_fn).call(this,normalizedURL.hash,{center:centerScroll,offset:offsetScroll,duration:scrollDuration,easing:scrollEasing,behavior:scrollBehaviour})):__privateGet(this,_isPopstateNavigation)?nextRoute.restoreScrollPosition():keepScrollPosition||nextRoute.renewScrollPosition(),yield Promise.all(__privateGet(this,_promises)),submorphAppend||oldElementsWithLoadEvent.forEach(child=>child.remove()),__privateSet(this,_promises,[]),morphedElements.forEach(el=>{el.querySelectorAll("script").forEach(element=>{element.replaceWith(dom.createScriptElement(element))})}),__privateGet(this,_links).forEach(link=>{link.checkCurrent(__privateGet(this,_currentURL).path)}),this.findParamsDependent(),events.dispatchEvent(document,"morphComplete",{detail:documentFetchedEntry}),document.documentElement.style.removeProperty("--new-document-scroll-position"),window.dispatchEvent(new Event("resize"))}catch(e){console.error(e)}__privateSet(this,_candidateURL,void 0)})}addLink(element){__privateGet(this,_links).push(new MorphLink(element,this))}addLinks(elements){elements.forEach(element=>{this.addLink(element)})}removeLink(element){__privateSet(this,_links,__privateGet(this,_links).filter(link=>link.element===element?(link.destroy(),!1):!0))}destroyOldLinks(morphElement){__privateSet(this,_links,__privateGet(this,_links).filter(link=>morphElement.contains(link.element)?(link.destroy(),!1):!0))}findNewLinks(morphElement){const linkElements=[...morphElement.querySelectorAll("a")].filter(__privateGet(this,_checkLink));__privateGet(this,_links).push(...linkElements.map(element=>new MorphLink(element,this)))}findLinks(){const linkElements=[...document.documentElement.querySelectorAll("a")].filter(__privateGet(this,_checkLink));__privateGet(this,_links).forEach(link=>link.destroy()),__privateSet(this,_links,linkElements.map(element=>new MorphLink(element,this)))}findParamsDependent(){const elements=[...document.documentElement.querySelectorAll("[data-morph-params-dependent]")];__privateGet(this,_paramDependent).forEach(link=>link.destroy()),__privateSet(this,_paramDependent,elements.map(element=>new MorphParamsDependent(element)))}};_options=new WeakMap,_morphElements=new WeakMap,_links=new WeakMap,_candidateURL=new WeakMap,_currentURL=new WeakMap,_previousURL=new WeakMap,_promises=new WeakMap,_isPopstateNavigation=new WeakMap,_currentScrollElement=new WeakMap,_isWindowScroll=new WeakMap,_routes=new WeakMap,_paramDependent=new WeakMap,_announcer=new WeakMap,_currentScrollX=new WeakMap,_currentScrollY=new WeakMap,_lastSubmorph=new WeakMap,_lastRevalidate=new WeakMap,_lastKeepScrollPosition=new WeakMap,_checkLink=new WeakMap,_Morph_instances=new WeakSet,getRoute_fn=__name(function(path){const normalizedURL=this.normalizePath(path);let route=__privateGet(this,_routes).get(normalizedURL.pathname);return route||(route=new MorphRoute(this,normalizedURL.pathname),__privateGet(this,_routes).set(normalizedURL.pathname,route)),route},"#getRoute"),getMorphElements_fn=__name(function(el){const morphElements=[...el.querySelectorAll("[data-morph]")];return morphElements.length?morphElements:[el]},"#getMorphElements"),isElementEmitsLoadEvent_fn=__name(function(element){return element.tagName==="SCRIPT"||element.tagName==="STYLE"||element.tagName==="LINK"&&element.getAttribute("rel")==="stylesheet"},"#isElementEmitsLoadEvent"),updateCurrentScrollElement_fn=__name(function(document2){var _a,_b;(_a=__privateGet(this,_currentScrollElement))==null||_a.removeEventListener("scroll",__privateGet(this,_scrollListener)),__privateSet(this,_currentScrollY,0),__privateSet(this,_currentScrollX,0),__privateSet(this,_currentScrollElement,__privateGet(this,_options).scrollSelector&&document2.querySelector(__privateGet(this,_options).scrollSelector)||window),__privateSet(this,_isWindowScroll,__privateGet(this,_currentScrollElement)===window),(_b=__privateGet(this,_currentScrollElement))==null||_b.addEventListener("scroll",__privateGet(this,_scrollListener)),__privateGet(this,_scrollListener).call(this)},"#updateCurrentScrollElement"),tryScrollToElement_fn=__name(function(id,options){const value=typeof id=="string"?document.querySelector(id):id;(typeof value=="number"||value)&&scroll.scrollToElement(value,__spreadValues({scrollElement:__privateGet(this,_currentScrollElement)},options))},"#tryScrollToElement"),_popStateListener=new WeakMap,_scrollListener=new WeakMap,__name(_Morph,"Morph"),_Morph.instance=null;let Morph=_Morph;exports.Morph=Morph;
|
package/lib/morph/index.js
CHANGED
|
@@ -36,7 +36,7 @@ import { i as isBrowser, c as camelToKebab } from "../Store-CAGUSjFX.js";
|
|
|
36
36
|
import { i as intersectElements, e as excludeElements, c as createScriptElement } from "../dom-D8D-_9ty.js";
|
|
37
37
|
import { d as dispatchEvent } from "../events-Ds-TuvYW.js";
|
|
38
38
|
import { w as wait } from "../promises-BsIKOEDq.js";
|
|
39
|
-
import { s as scrollToElement } from "../scroll-
|
|
39
|
+
import { s as scrollToElement } from "../scroll-D1MT0QMY.js";
|
|
40
40
|
import "construct-style-sheets-polyfill";
|
|
41
41
|
import "../index-DAG0CtYo.js";
|
|
42
42
|
import { a as normalizeBase, c as splitPath } from "../url-DTxLpq5m.js";
|
|
@@ -30,7 +30,7 @@ export declare class ScrollElement extends HTMLElement {
|
|
|
30
30
|
get pagesCSSProperty(): CSSProperty<number>;
|
|
31
31
|
get splitCSSProperty(): CSSProperty<boolean>;
|
|
32
32
|
get sectionalCSSProperty(): CSSProperty<boolean>;
|
|
33
|
-
get easingCSSProperty(): CSSProperty<false | "linear" | "easeInQuad" | "easeOutQuad" | "easeInOutQuad" | "easeInCubic" | "easeOutCubic" | "easeInOutCubic" | "easeInQuart" | "easeOutQuart" | "easeInOutQuart" | "easeInQuint" | "easeOutQuint" | "easeInOutQuint" | "easeInExpo" | "easeOutExpo" | "easeInOutExpo">;
|
|
33
|
+
get easingCSSProperty(): CSSProperty<false | "linear" | "easeInQuad" | "easeOutQuad" | "easeInOutQuad" | "easeInCubic" | "easeOutCubic" | "easeInOutCubic" | "easeInQuart" | "easeOutQuart" | "easeInOutQuart" | "easeInQuint" | "easeOutQuint" | "easeInOutQuint" | "easeInExpo" | "easeOutExpo" | "easeInOutExpo" | "easeOvershoot">;
|
|
34
34
|
get durationCSSProperty(): CSSProperty<number | false>;
|
|
35
35
|
get autoSizeCSSProperty(): CSSProperty<boolean>;
|
|
36
36
|
get wheelMaxDeltaCSSProperty(): CSSProperty<boolean>;
|