aptechka 0.92.3 → 0.92.4

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.
@@ -17,11 +17,11 @@ function getCumulativeOffsetTop(target, stopElement) {
17
17
  }
18
18
  __name(getCumulativeOffsetTop, "getCumulativeOffsetTop");
19
19
  function getStickyOffset(el, type) {
20
- const stickyParents = [];
21
- let parent = el.parentElement;
22
- for (; parent; )
23
- window.getComputedStyle(parent).position === "sticky" && stickyParents.push(parent), parent = parent.parentElement;
24
- return stickyParents.reduce(
20
+ const stickyElements = [];
21
+ let currentElement = el;
22
+ for (; currentElement; )
23
+ window.getComputedStyle(currentElement).position === "sticky" && stickyElements.push(currentElement), currentElement = currentElement.parentElement;
24
+ return stickyElements.reduce(
25
25
  (p, c) => p + (type === "top" ? c.offsetTop : c.offsetLeft),
26
26
  0
27
27
  );
@@ -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);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const cssUnitParser_index=require("../css-unit-parser/index.cjs"),elementResizer_index=require("../element-resizer/index.cjs"),ladder_index=require("../ladder/index.cjs"),notifier_index=require("../notifier/index.cjs"),order_index=require("../order/index.cjs"),scrollEntries_index=require("../scroll-entries/index.cjs"),ticker_index=require("../index-BoGx2BWX.cjs"),Store=require("../Store-B96mD8mD.cjs"),dom=require("../dom-B40i6NXw.cjs"),layout=require("../layout-CnGLl7oe.cjs");require("construct-style-sheets-polyfill");const windowResizer_index=require("../window-resizer/index.cjs");function decomposeCSSMatrix(matrix){const scaleX=Math.sqrt(matrix.m11*matrix.m11+matrix.m12*matrix.m12+matrix.m13*matrix.m13),scaleY=Math.sqrt(matrix.m21*matrix.m21+matrix.m22*matrix.m22+matrix.m23*matrix.m23),scaleZ=Math.sqrt(matrix.m31*matrix.m31+matrix.m32*matrix.m32+matrix.m33*matrix.m33),rotationX=Math.atan2(matrix.m32,matrix.m33),rotationY=Math.atan2(-matrix.m31,Math.sqrt(matrix.m32*matrix.m32+matrix.m33*matrix.m33)),rotationZ=Math.atan2(matrix.m21,matrix.m11),translationX=matrix.m41,translationY=matrix.m42*-1,translationZ=matrix.m43;return{scaleX,scaleY,scaleZ,rotationX,rotationY,rotationZ,translationX,translationY,translationZ}}__name(decomposeCSSMatrix,"decomposeCSSMatrix");var _element,_containerElement,_scrollStepSetterCallbacks,_scrollAxis,_frontSide,_isCartesian,_isSizeStep,_isPositionStep,_isTransformStep,_isScrollStep,_width,_height,_depth,_top,_left,_front,_x,_y,_z,_CSSTranslation,_CSSRotation,_CSSScale,_rotation,_position,_scale,_scrollValue,_scrollEntries,_resizeNotifier,_LayoutBox_instances,recalculate_fn,composeSteps_fn,updateDimensions_fn,updateScrollPosition_fn,_resizeListener,_tickListener,_scrollEntriesListener;const _LayoutBox=class _LayoutBox{constructor(element,options){__privateAdd(this,_LayoutBox_instances);__privateAdd(this,_element,null);__privateAdd(this,_containerElement,null);__privateAdd(this,_scrollStepSetterCallbacks,[]);__privateAdd(this,_scrollAxis,"auto");__privateAdd(this,_frontSide,"top");__privateAdd(this,_isCartesian,!1);__privateAdd(this,_isSizeStep,!0);__privateAdd(this,_isPositionStep,!0);__privateAdd(this,_isTransformStep,!0);__privateAdd(this,_isScrollStep,!0);__privateAdd(this,_width,0);__privateAdd(this,_height,0);__privateAdd(this,_depth,0);__privateAdd(this,_top,0);__privateAdd(this,_left,0);__privateAdd(this,_front,0);__privateAdd(this,_x,0);__privateAdd(this,_y,0);__privateAdd(this,_z,0);__privateAdd(this,_CSSTranslation,{x:0,y:0,z:0});__privateAdd(this,_CSSRotation,{x:0,y:0,z:0});__privateAdd(this,_CSSScale,{x:1,y:1,z:1});__privateAdd(this,_rotation,new ladder_index.Ladder({x:0,y:0,z:0}));__privateAdd(this,_position,new ladder_index.Ladder({x:0,y:0,z:0}));__privateAdd(this,_scale,new ladder_index.Ladder({x:0,y:0,z:0}));__privateAdd(this,_scrollValue,{x:0,y:0,z:0});__privateAdd(this,_scrollEntries,new Map);__privateAdd(this,_resizeNotifier,new notifier_index.Notifier);__privateAdd(this,_resizeListener,__name(()=>{Store.isBrowser&&__privateMethod(this,_LayoutBox_instances,updateDimensions_fn).call(this)},"#resizeListener"));__privateAdd(this,_tickListener,__name(()=>{__privateMethod(this,_LayoutBox_instances,updateScrollPosition_fn).call(this),__privateMethod(this,_LayoutBox_instances,recalculate_fn).call(this)},"#tickListener"));__privateAdd(this,_scrollEntriesListener,__name(()=>{const allEntries=scrollEntries_index.scrollEntries.getAll(this.element);__privateGet(this,_scrollEntries).forEach((value,key)=>{allEntries.includes(key)||(this.deleteScrollStep(value),__privateGet(this,_scrollEntries).delete(key))}),allEntries.forEach(entry=>{if(!__privateGet(this,_scrollEntries).has(entry)){const callback=__name(()=>entry,"callback");__privateGet(this,_scrollEntries).set(entry,callback),this.setScrollStep(callback)}})},"#scrollEntriesListener"));Store.isBrowser&&(__privateSet(this,_element,dom.getElement(element)||document.body),__privateSet(this,_containerElement,dom.getElement(options==null?void 0:options.containerElement)||document.body),__privateSet(this,_scrollAxis,(options==null?void 0:options.scrollAxis)||"auto"),__privateSet(this,_frontSide,(options==null?void 0:options.frontSide)||"top"),__privateSet(this,_isCartesian,(options==null?void 0:options.cartesian)||!1),__privateSet(this,_isSizeStep,(options==null?void 0:options.sizeStep)!==void 0?options.sizeStep:!0),__privateSet(this,_isPositionStep,(options==null?void 0:options.positionStep)!==void 0?options.positionStep:!0),__privateSet(this,_isTransformStep,(options==null?void 0:options.transformStep)!==void 0?options.transformStep:!0),__privateSet(this,_isScrollStep,(options==null?void 0:options.scrollStep)!==void 0?options.scrollStep:!0),__privateGet(this,_scale).setStep("_size","+",{x:1,y:1,z:1}),__privateGet(this,_position).setStep("_position","+",{x:0,y:0,z:0}),__privateGet(this,_scale).setStep("_scale","*",{x:1,y:1,z:1}),__privateGet(this,_position).setStep("_translation","+",{x:0,y:0,z:0}),__privateGet(this,_rotation).setStep("_rotation","+",{x:0,y:0,z:0}),__privateGet(this,_isScrollStep)&&(scrollEntries_index.scrollEntries.notifier.subscribe(__privateGet(this,_scrollEntriesListener)),__privateGet(this,_scrollEntriesListener).call(this),this.setScrollStep(()=>({axis:"y",value:layout.getStickyOffset(this.element,"top")*-1})),this.setScrollStep(()=>({axis:"x",value:layout.getStickyOffset(this.element,"left")*-1}))),elementResizer_index.elementResizer.subscribe(this.element,__privateGet(this,_resizeListener)),windowResizer_index.windowResizer.subscribe(__privateGet(this,_resizeListener),order_index.RESIZE_ORDER.LAYOUT_BOX),ticker_index.ticker.subscribe(__privateGet(this,_tickListener),{order:order_index.TICK_ORDER.LAYOUT_BOX,culling:options!=null&&options.culling?this.element:void 0}))}get element(){return __privateGet(this,_element)}get containerElement(){return __privateGet(this,_containerElement)}get position(){return __privateGet(this,_position).current}get rotation(){return __privateGet(this,_rotation).current}get scale(){return __privateGet(this,_scale).current}get scrollValue(){return __privateGet(this,_scrollValue)}get left(){return __privateGet(this,_left)}get top(){return __privateGet(this,_top)}get CSSTranslation(){return __privateGet(this,_CSSTranslation)}get CSSRotation(){return __privateGet(this,_CSSRotation)}get CSSScale(){return __privateGet(this,_CSSScale)}get front(){return __privateGet(this,_front)}get width(){return __privateGet(this,_width)}get height(){return __privateGet(this,_height)}get depth(){return __privateGet(this,_depth)}destroy(){ticker_index.ticker.unsubscribe(__privateGet(this,_tickListener)),elementResizer_index.elementResizer.unsubscribe(__privateGet(this,_resizeListener)),windowResizer_index.windowResizer.unsubscribe(__privateGet(this,_resizeListener)),scrollEntries_index.scrollEntries.notifier.unsubscribe(__privateGet(this,_scrollEntriesListener)),__privateGet(this,_scrollEntries).clear(),__privateGet(this,_position).close(),__privateGet(this,_rotation).close(),__privateGet(this,_scale).close()}bindObject(object){object.position&&__privateGet(this,_position).bind(object.position),object.rotation&&__privateGet(this,_rotation).bind(object.rotation),object.scale&&__privateGet(this,_scale).bind(object.scale)}unbindObject(object){object.position&&__privateGet(this,_position).unbind(object.position),object.rotation&&__privateGet(this,_rotation).unbind(object.rotation),object.scale&&__privateGet(this,_scale).unbind(object.scale)}setScrollStep(callback){return __privateGet(this,_scrollStepSetterCallbacks).includes(callback)||__privateGet(this,_scrollStepSetterCallbacks).push(callback),()=>this.deleteScrollStep(callback)}deleteScrollStep(callback){__privateSet(this,_scrollStepSetterCallbacks,__privateGet(this,_scrollStepSetterCallbacks).filter(s=>s!==callback))}setPositionStep(...args){__privateGet(this,_position).setStep(...args)}getPositionStep(...args){return __privateGet(this,_position).getStepValue(...args)}setRotationStep(...args){__privateGet(this,_rotation).setStep(...args)}getRotationStep(...args){return __privateGet(this,_rotation).getStepValue(...args)}getExcludedRotationSteps(...args){return __privateGet(this,_rotation).getExcludedStepsValue(...args)}getIncludedRotationSteps(...args){return __privateGet(this,_rotation).getIncludedStepsValue(...args)}setScaleStep(...args){__privateGet(this,_scale).setStep(...args)}getScaleStep(...args){return __privateGet(this,_scale).getStepValue(...args)}getExcludedScaleSteps(...args){return __privateGet(this,_scale).getExcludedStepsValue(...args)}getIncludedScaleSteps(...args){return __privateGet(this,_scale).getIncludedStepsValue(...args)}deletePositionStep(...args){__privateGet(this,_position).deleteStep(...args)}getExcludedPositionSteps(...args){return __privateGet(this,_position).getExcludedStepsValue(...args)}getIncludedPositionSteps(...args){return __privateGet(this,_position).getIncludedStepsValue(...args)}deleteRotationStep(...args){__privateGet(this,_rotation).deleteStep(...args)}deleteScaleStep(...args){__privateGet(this,_scale).deleteStep(...args)}onPosition(...args){return __privateGet(this,_position).subscribe(...args)}offPosition(...args){__privateGet(this,_position).unsubscribe(...args)}onScale(...args){return __privateGet(this,_scale).subscribe(...args)}offScale(...args){__privateGet(this,_scale).unsubscribe(...args)}onRotation(...args){return __privateGet(this,_rotation).subscribe(...args)}offRotation(...args){__privateGet(this,_rotation).unsubscribe(...args)}onResize(...args){return __privateGet(this,_resizeNotifier).subscribe(...args)}offResize(...args){return __privateGet(this,_resizeNotifier).unsubscribe(...args)}};_element=new WeakMap,_containerElement=new WeakMap,_scrollStepSetterCallbacks=new WeakMap,_scrollAxis=new WeakMap,_frontSide=new WeakMap,_isCartesian=new WeakMap,_isSizeStep=new WeakMap,_isPositionStep=new WeakMap,_isTransformStep=new WeakMap,_isScrollStep=new WeakMap,_width=new WeakMap,_height=new WeakMap,_depth=new WeakMap,_top=new WeakMap,_left=new WeakMap,_front=new WeakMap,_x=new WeakMap,_y=new WeakMap,_z=new WeakMap,_CSSTranslation=new WeakMap,_CSSRotation=new WeakMap,_CSSScale=new WeakMap,_rotation=new WeakMap,_position=new WeakMap,_scale=new WeakMap,_scrollValue=new WeakMap,_scrollEntries=new WeakMap,_resizeNotifier=new WeakMap,_LayoutBox_instances=new WeakSet,recalculate_fn=__name(function(){__privateGet(this,_scale).calculate(),__privateGet(this,_position).calculate(),__privateGet(this,_rotation).calculate()},"#recalculate"),composeSteps_fn=__name(function(){__privateGet(this,_scale).setStep("_size","+",{x:__privateGet(this,_isSizeStep)?__privateGet(this,_width):1,y:__privateGet(this,_isSizeStep)?__privateGet(this,_height):1,z:__privateGet(this,_isSizeStep)?__privateGet(this,_depth):1});const xPosition=__privateGet(this,_isPositionStep)?__privateGet(this,_x):0,yPosition=__privateGet(this,_isPositionStep)?__privateGet(this,_y):0,zPosition=__privateGet(this,_isPositionStep)?__privateGet(this,_z):0;__privateGet(this,_position).setStep("_position","+",{x:xPosition,y:yPosition,z:zPosition}),__privateGet(this,_isTransformStep)?(__privateGet(this,_scale).setStep("_scale","*",{x:__privateGet(this,_CSSScale).x,y:__privateGet(this,_CSSScale).y,z:__privateGet(this,_CSSScale).z}),__privateGet(this,_position).setStep("_translation","+",{x:__privateGet(this,_CSSTranslation).x,y:__privateGet(this,_CSSTranslation).y,z:__privateGet(this,_CSSTranslation).z}),__privateGet(this,_rotation).setStep("_rotation","+",{x:__privateGet(this,_CSSRotation).x,y:__privateGet(this,_CSSRotation).y,z:__privateGet(this,_CSSRotation).z})):(__privateGet(this,_scale).setStep("_scale","*",{x:1,y:1,z:1}),__privateGet(this,_position).setStep("_translation","+",{x:0,y:0,z:0}),__privateGet(this,_rotation).setStep("_rotation","+",{x:0,y:0,z:0}))},"#composeSteps"),updateDimensions_fn=__name(function(){const computed=getComputedStyle(__privateGet(this,_element));__privateSet(this,_width,Math.max(__privateGet(this,_element).clientWidth,1)),__privateSet(this,_height,Math.max(__privateGet(this,_element).clientHeight,1)),__privateSet(this,_depth,Math.max(cssUnitParser_index.cssUnitParser.parse(computed.getPropertyValue("--depth")||"0px")||0,1));const vl=layout.getCumulativeOffsetLeft(__privateGet(this,_containerElement)),vt=layout.getCumulativeOffsetTop(__privateGet(this,_containerElement)),vw=__privateGet(this,_containerElement).clientWidth,vh=__privateGet(this,_containerElement).clientHeight;if(__privateSet(this,_left,layout.getCumulativeOffsetLeft(__privateGet(this,_element))-vl),__privateSet(this,_top,layout.getCumulativeOffsetTop(__privateGet(this,_element))-vt),__privateGet(this,_scrollAxis)==="z"){const nl=__privateGet(this,_left)/vw,nt=__privateGet(this,_top)/vh;__privateSet(this,_left,(nl-Math.floor(nl))*vw),__privateSet(this,_top,(nt-Math.floor(nt))*vh),__privateGet(this,_frontSide)==="left"?__privateSet(this,_front,layout.getCumulativeOffsetLeft(__privateGet(this,_element))-vl-__privateGet(this,_left)):__privateSet(this,_front,layout.getCumulativeOffsetTop(__privateGet(this,_element))-vt-__privateGet(this,_top))}if(__privateSet(this,_left,__privateGet(this,_left)+__privateGet(this,_element).clientLeft),__privateSet(this,_top,__privateGet(this,_top)+__privateGet(this,_element).clientTop),__privateSet(this,_left,__privateGet(this,_left)+layout.getStickyOffset(this.element,"left")*-1),__privateSet(this,_top,__privateGet(this,_top)+layout.getStickyOffset(this.element,"top")*-1),__privateGet(this,_isCartesian)){const viewHalfWidth=Math.round(vw/2),viewHalfHeight=Math.round(vh/2),thisHalfWidth=__privateGet(this,_width)?Math.round(__privateGet(this,_width)/2):0,thisHalfHeight=__privateGet(this,_height)?Math.round(__privateGet(this,_height)/2):0,positionX=__privateGet(this,_left)-viewHalfWidth+thisHalfWidth,positionY=(__privateGet(this,_top)-viewHalfHeight+thisHalfHeight)*-1;__privateSet(this,_x,positionX),__privateSet(this,_y,positionY)}else __privateSet(this,_x,__privateGet(this,_left)),__privateSet(this,_y,__privateGet(this,_top));__privateSet(this,_z,__privateGet(this,_front)*-1);const cssMatrix=new WebKitCSSMatrix(computed.transform),decomposedMatrix=decomposeCSSMatrix(cssMatrix);__privateGet(this,_CSSTranslation).x=decomposedMatrix.translationX,__privateGet(this,_CSSTranslation).y=decomposedMatrix.translationY,__privateGet(this,_CSSTranslation).z=decomposedMatrix.translationZ,__privateGet(this,_CSSScale).x=decomposedMatrix.scaleX,__privateGet(this,_CSSScale).y=decomposedMatrix.scaleY,__privateGet(this,_CSSScale).z=decomposedMatrix.scaleZ,__privateGet(this,_CSSRotation).x=decomposedMatrix.rotationX,__privateGet(this,_CSSRotation).y=decomposedMatrix.rotationY,__privateGet(this,_CSSRotation).z=decomposedMatrix.rotationZ,__privateMethod(this,_LayoutBox_instances,composeSteps_fn).call(this),__privateMethod(this,_LayoutBox_instances,recalculate_fn).call(this),__privateGet(this,_resizeNotifier).notify()},"#updateDimensions"),updateScrollPosition_fn=__name(function(){__privateGet(this,_scrollValue).x=0,__privateGet(this,_scrollValue).y=0,__privateGet(this,_scrollValue).z=0;for(let index=0;index<__privateGet(this,_scrollStepSetterCallbacks).length;index++){const callbackReturn=__privateGet(this,_scrollStepSetterCallbacks)[index]();let axis=callbackReturn.axis;__privateGet(this,_scrollAxis)!=="auto"&&(axis=__privateGet(this,_scrollAxis));const value=callbackReturn.value*(axis==="x"?-1:__privateGet(this,_isCartesian)?1:-1);__privateGet(this,_scrollValue)[axis]+=value,__privateGet(this,_position).setStep(`_scroll_${index}`,"+",{[axis]:value})}},"#updateScrollPosition"),_resizeListener=new WeakMap,_tickListener=new WeakMap,_scrollEntriesListener=new WeakMap,__name(_LayoutBox,"LayoutBox");let LayoutBox=_LayoutBox;exports.LayoutBox=LayoutBox;exports.decomposeCSSMatrix=decomposeCSSMatrix;
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);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const cssUnitParser_index=require("../css-unit-parser/index.cjs"),elementResizer_index=require("../element-resizer/index.cjs"),ladder_index=require("../ladder/index.cjs"),notifier_index=require("../notifier/index.cjs"),order_index=require("../order/index.cjs"),scrollEntries_index=require("../scroll-entries/index.cjs"),ticker_index=require("../index-BoGx2BWX.cjs"),Store=require("../Store-B96mD8mD.cjs"),dom=require("../dom-B40i6NXw.cjs"),layout=require("../layout-rR4-aYTY.cjs");require("construct-style-sheets-polyfill");const windowResizer_index=require("../window-resizer/index.cjs");function decomposeCSSMatrix(matrix){const scaleX=Math.sqrt(matrix.m11*matrix.m11+matrix.m12*matrix.m12+matrix.m13*matrix.m13),scaleY=Math.sqrt(matrix.m21*matrix.m21+matrix.m22*matrix.m22+matrix.m23*matrix.m23),scaleZ=Math.sqrt(matrix.m31*matrix.m31+matrix.m32*matrix.m32+matrix.m33*matrix.m33),rotationX=Math.atan2(matrix.m32,matrix.m33),rotationY=Math.atan2(-matrix.m31,Math.sqrt(matrix.m32*matrix.m32+matrix.m33*matrix.m33)),rotationZ=Math.atan2(matrix.m21,matrix.m11),translationX=matrix.m41,translationY=matrix.m42*-1,translationZ=matrix.m43;return{scaleX,scaleY,scaleZ,rotationX,rotationY,rotationZ,translationX,translationY,translationZ}}__name(decomposeCSSMatrix,"decomposeCSSMatrix");var _element,_containerElement,_scrollStepSetterCallbacks,_scrollAxis,_frontSide,_isCartesian,_isSizeStep,_isPositionStep,_isTransformStep,_isScrollStep,_width,_height,_depth,_top,_left,_front,_x,_y,_z,_CSSTranslation,_CSSRotation,_CSSScale,_rotation,_position,_scale,_scrollValue,_scrollEntries,_resizeNotifier,_LayoutBox_instances,recalculate_fn,composeSteps_fn,updateDimensions_fn,updateScrollPosition_fn,_resizeListener,_tickListener,_scrollEntriesListener;const _LayoutBox=class _LayoutBox{constructor(element,options){__privateAdd(this,_LayoutBox_instances);__privateAdd(this,_element,null);__privateAdd(this,_containerElement,null);__privateAdd(this,_scrollStepSetterCallbacks,[]);__privateAdd(this,_scrollAxis,"auto");__privateAdd(this,_frontSide,"top");__privateAdd(this,_isCartesian,!1);__privateAdd(this,_isSizeStep,!0);__privateAdd(this,_isPositionStep,!0);__privateAdd(this,_isTransformStep,!0);__privateAdd(this,_isScrollStep,!0);__privateAdd(this,_width,0);__privateAdd(this,_height,0);__privateAdd(this,_depth,0);__privateAdd(this,_top,0);__privateAdd(this,_left,0);__privateAdd(this,_front,0);__privateAdd(this,_x,0);__privateAdd(this,_y,0);__privateAdd(this,_z,0);__privateAdd(this,_CSSTranslation,{x:0,y:0,z:0});__privateAdd(this,_CSSRotation,{x:0,y:0,z:0});__privateAdd(this,_CSSScale,{x:1,y:1,z:1});__privateAdd(this,_rotation,new ladder_index.Ladder({x:0,y:0,z:0}));__privateAdd(this,_position,new ladder_index.Ladder({x:0,y:0,z:0}));__privateAdd(this,_scale,new ladder_index.Ladder({x:0,y:0,z:0}));__privateAdd(this,_scrollValue,{x:0,y:0,z:0});__privateAdd(this,_scrollEntries,new Map);__privateAdd(this,_resizeNotifier,new notifier_index.Notifier);__privateAdd(this,_resizeListener,__name(()=>{Store.isBrowser&&__privateMethod(this,_LayoutBox_instances,updateDimensions_fn).call(this)},"#resizeListener"));__privateAdd(this,_tickListener,__name(()=>{__privateMethod(this,_LayoutBox_instances,updateScrollPosition_fn).call(this),__privateMethod(this,_LayoutBox_instances,recalculate_fn).call(this)},"#tickListener"));__privateAdd(this,_scrollEntriesListener,__name(()=>{const allEntries=scrollEntries_index.scrollEntries.getAll(this.element);__privateGet(this,_scrollEntries).forEach((value,key)=>{allEntries.includes(key)||(this.deleteScrollStep(value),__privateGet(this,_scrollEntries).delete(key))}),allEntries.forEach(entry=>{if(!__privateGet(this,_scrollEntries).has(entry)){const callback=__name(()=>entry,"callback");__privateGet(this,_scrollEntries).set(entry,callback),this.setScrollStep(callback)}})},"#scrollEntriesListener"));Store.isBrowser&&(__privateSet(this,_element,dom.getElement(element)||document.body),__privateSet(this,_containerElement,dom.getElement(options==null?void 0:options.containerElement)||document.body),__privateSet(this,_scrollAxis,(options==null?void 0:options.scrollAxis)||"auto"),__privateSet(this,_frontSide,(options==null?void 0:options.frontSide)||"top"),__privateSet(this,_isCartesian,(options==null?void 0:options.cartesian)||!1),__privateSet(this,_isSizeStep,(options==null?void 0:options.sizeStep)!==void 0?options.sizeStep:!0),__privateSet(this,_isPositionStep,(options==null?void 0:options.positionStep)!==void 0?options.positionStep:!0),__privateSet(this,_isTransformStep,(options==null?void 0:options.transformStep)!==void 0?options.transformStep:!0),__privateSet(this,_isScrollStep,(options==null?void 0:options.scrollStep)!==void 0?options.scrollStep:!0),__privateGet(this,_scale).setStep("_size","+",{x:1,y:1,z:1}),__privateGet(this,_position).setStep("_position","+",{x:0,y:0,z:0}),__privateGet(this,_scale).setStep("_scale","*",{x:1,y:1,z:1}),__privateGet(this,_position).setStep("_translation","+",{x:0,y:0,z:0}),__privateGet(this,_rotation).setStep("_rotation","+",{x:0,y:0,z:0}),__privateGet(this,_isScrollStep)&&(scrollEntries_index.scrollEntries.notifier.subscribe(__privateGet(this,_scrollEntriesListener)),__privateGet(this,_scrollEntriesListener).call(this),this.setScrollStep(()=>({axis:"y",value:layout.getStickyOffset(this.element,"top")*-1})),this.setScrollStep(()=>({axis:"x",value:layout.getStickyOffset(this.element,"left")*-1}))),elementResizer_index.elementResizer.subscribe(this.element,__privateGet(this,_resizeListener)),windowResizer_index.windowResizer.subscribe(__privateGet(this,_resizeListener),order_index.RESIZE_ORDER.LAYOUT_BOX),ticker_index.ticker.subscribe(__privateGet(this,_tickListener),{order:order_index.TICK_ORDER.LAYOUT_BOX,culling:options!=null&&options.culling?this.element:void 0}))}get element(){return __privateGet(this,_element)}get containerElement(){return __privateGet(this,_containerElement)}get position(){return __privateGet(this,_position).current}get rotation(){return __privateGet(this,_rotation).current}get scale(){return __privateGet(this,_scale).current}get scrollValue(){return __privateGet(this,_scrollValue)}get left(){return __privateGet(this,_left)}get top(){return __privateGet(this,_top)}get CSSTranslation(){return __privateGet(this,_CSSTranslation)}get CSSRotation(){return __privateGet(this,_CSSRotation)}get CSSScale(){return __privateGet(this,_CSSScale)}get front(){return __privateGet(this,_front)}get width(){return __privateGet(this,_width)}get height(){return __privateGet(this,_height)}get depth(){return __privateGet(this,_depth)}destroy(){ticker_index.ticker.unsubscribe(__privateGet(this,_tickListener)),elementResizer_index.elementResizer.unsubscribe(__privateGet(this,_resizeListener)),windowResizer_index.windowResizer.unsubscribe(__privateGet(this,_resizeListener)),scrollEntries_index.scrollEntries.notifier.unsubscribe(__privateGet(this,_scrollEntriesListener)),__privateGet(this,_scrollEntries).clear(),__privateGet(this,_position).close(),__privateGet(this,_rotation).close(),__privateGet(this,_scale).close()}bindObject(object){object.position&&__privateGet(this,_position).bind(object.position),object.rotation&&__privateGet(this,_rotation).bind(object.rotation),object.scale&&__privateGet(this,_scale).bind(object.scale)}unbindObject(object){object.position&&__privateGet(this,_position).unbind(object.position),object.rotation&&__privateGet(this,_rotation).unbind(object.rotation),object.scale&&__privateGet(this,_scale).unbind(object.scale)}setScrollStep(callback){return __privateGet(this,_scrollStepSetterCallbacks).includes(callback)||__privateGet(this,_scrollStepSetterCallbacks).push(callback),()=>this.deleteScrollStep(callback)}deleteScrollStep(callback){__privateSet(this,_scrollStepSetterCallbacks,__privateGet(this,_scrollStepSetterCallbacks).filter(s=>s!==callback))}setPositionStep(...args){__privateGet(this,_position).setStep(...args)}getPositionStep(...args){return __privateGet(this,_position).getStepValue(...args)}setRotationStep(...args){__privateGet(this,_rotation).setStep(...args)}getRotationStep(...args){return __privateGet(this,_rotation).getStepValue(...args)}getExcludedRotationSteps(...args){return __privateGet(this,_rotation).getExcludedStepsValue(...args)}getIncludedRotationSteps(...args){return __privateGet(this,_rotation).getIncludedStepsValue(...args)}setScaleStep(...args){__privateGet(this,_scale).setStep(...args)}getScaleStep(...args){return __privateGet(this,_scale).getStepValue(...args)}getExcludedScaleSteps(...args){return __privateGet(this,_scale).getExcludedStepsValue(...args)}getIncludedScaleSteps(...args){return __privateGet(this,_scale).getIncludedStepsValue(...args)}deletePositionStep(...args){__privateGet(this,_position).deleteStep(...args)}getExcludedPositionSteps(...args){return __privateGet(this,_position).getExcludedStepsValue(...args)}getIncludedPositionSteps(...args){return __privateGet(this,_position).getIncludedStepsValue(...args)}deleteRotationStep(...args){__privateGet(this,_rotation).deleteStep(...args)}deleteScaleStep(...args){__privateGet(this,_scale).deleteStep(...args)}onPosition(...args){return __privateGet(this,_position).subscribe(...args)}offPosition(...args){__privateGet(this,_position).unsubscribe(...args)}onScale(...args){return __privateGet(this,_scale).subscribe(...args)}offScale(...args){__privateGet(this,_scale).unsubscribe(...args)}onRotation(...args){return __privateGet(this,_rotation).subscribe(...args)}offRotation(...args){__privateGet(this,_rotation).unsubscribe(...args)}onResize(...args){return __privateGet(this,_resizeNotifier).subscribe(...args)}offResize(...args){return __privateGet(this,_resizeNotifier).unsubscribe(...args)}};_element=new WeakMap,_containerElement=new WeakMap,_scrollStepSetterCallbacks=new WeakMap,_scrollAxis=new WeakMap,_frontSide=new WeakMap,_isCartesian=new WeakMap,_isSizeStep=new WeakMap,_isPositionStep=new WeakMap,_isTransformStep=new WeakMap,_isScrollStep=new WeakMap,_width=new WeakMap,_height=new WeakMap,_depth=new WeakMap,_top=new WeakMap,_left=new WeakMap,_front=new WeakMap,_x=new WeakMap,_y=new WeakMap,_z=new WeakMap,_CSSTranslation=new WeakMap,_CSSRotation=new WeakMap,_CSSScale=new WeakMap,_rotation=new WeakMap,_position=new WeakMap,_scale=new WeakMap,_scrollValue=new WeakMap,_scrollEntries=new WeakMap,_resizeNotifier=new WeakMap,_LayoutBox_instances=new WeakSet,recalculate_fn=__name(function(){__privateGet(this,_scale).calculate(),__privateGet(this,_position).calculate(),__privateGet(this,_rotation).calculate()},"#recalculate"),composeSteps_fn=__name(function(){__privateGet(this,_scale).setStep("_size","+",{x:__privateGet(this,_isSizeStep)?__privateGet(this,_width):1,y:__privateGet(this,_isSizeStep)?__privateGet(this,_height):1,z:__privateGet(this,_isSizeStep)?__privateGet(this,_depth):1});const xPosition=__privateGet(this,_isPositionStep)?__privateGet(this,_x):0,yPosition=__privateGet(this,_isPositionStep)?__privateGet(this,_y):0,zPosition=__privateGet(this,_isPositionStep)?__privateGet(this,_z):0;__privateGet(this,_position).setStep("_position","+",{x:xPosition,y:yPosition,z:zPosition}),__privateGet(this,_isTransformStep)?(__privateGet(this,_scale).setStep("_scale","*",{x:__privateGet(this,_CSSScale).x,y:__privateGet(this,_CSSScale).y,z:__privateGet(this,_CSSScale).z}),__privateGet(this,_position).setStep("_translation","+",{x:__privateGet(this,_CSSTranslation).x,y:__privateGet(this,_CSSTranslation).y,z:__privateGet(this,_CSSTranslation).z}),__privateGet(this,_rotation).setStep("_rotation","+",{x:__privateGet(this,_CSSRotation).x,y:__privateGet(this,_CSSRotation).y,z:__privateGet(this,_CSSRotation).z})):(__privateGet(this,_scale).setStep("_scale","*",{x:1,y:1,z:1}),__privateGet(this,_position).setStep("_translation","+",{x:0,y:0,z:0}),__privateGet(this,_rotation).setStep("_rotation","+",{x:0,y:0,z:0}))},"#composeSteps"),updateDimensions_fn=__name(function(){const computed=getComputedStyle(__privateGet(this,_element));__privateSet(this,_width,Math.max(__privateGet(this,_element).clientWidth,1)),__privateSet(this,_height,Math.max(__privateGet(this,_element).clientHeight,1)),__privateSet(this,_depth,Math.max(cssUnitParser_index.cssUnitParser.parse(computed.getPropertyValue("--depth")||"0px")||0,1));const vl=layout.getCumulativeOffsetLeft(__privateGet(this,_containerElement)),vt=layout.getCumulativeOffsetTop(__privateGet(this,_containerElement)),vw=__privateGet(this,_containerElement).clientWidth,vh=__privateGet(this,_containerElement).clientHeight;if(__privateSet(this,_left,layout.getCumulativeOffsetLeft(__privateGet(this,_element))-vl),__privateSet(this,_top,layout.getCumulativeOffsetTop(__privateGet(this,_element))-vt),__privateGet(this,_scrollAxis)==="z"){const nl=__privateGet(this,_left)/vw,nt=__privateGet(this,_top)/vh;__privateSet(this,_left,(nl-Math.floor(nl))*vw),__privateSet(this,_top,(nt-Math.floor(nt))*vh),__privateGet(this,_frontSide)==="left"?__privateSet(this,_front,layout.getCumulativeOffsetLeft(__privateGet(this,_element))-vl-__privateGet(this,_left)):__privateSet(this,_front,layout.getCumulativeOffsetTop(__privateGet(this,_element))-vt-__privateGet(this,_top))}if(__privateSet(this,_left,__privateGet(this,_left)+__privateGet(this,_element).clientLeft),__privateSet(this,_top,__privateGet(this,_top)+__privateGet(this,_element).clientTop),__privateSet(this,_left,__privateGet(this,_left)+layout.getStickyOffset(this.element,"left")*-1),__privateSet(this,_top,__privateGet(this,_top)+layout.getStickyOffset(this.element,"top")*-1),__privateGet(this,_isCartesian)){const viewHalfWidth=Math.round(vw/2),viewHalfHeight=Math.round(vh/2),thisHalfWidth=__privateGet(this,_width)?Math.round(__privateGet(this,_width)/2):0,thisHalfHeight=__privateGet(this,_height)?Math.round(__privateGet(this,_height)/2):0,positionX=__privateGet(this,_left)-viewHalfWidth+thisHalfWidth,positionY=(__privateGet(this,_top)-viewHalfHeight+thisHalfHeight)*-1;__privateSet(this,_x,positionX),__privateSet(this,_y,positionY)}else __privateSet(this,_x,__privateGet(this,_left)),__privateSet(this,_y,__privateGet(this,_top));__privateSet(this,_z,__privateGet(this,_front)*-1);const cssMatrix=new WebKitCSSMatrix(computed.transform),decomposedMatrix=decomposeCSSMatrix(cssMatrix);__privateGet(this,_CSSTranslation).x=decomposedMatrix.translationX,__privateGet(this,_CSSTranslation).y=decomposedMatrix.translationY,__privateGet(this,_CSSTranslation).z=decomposedMatrix.translationZ,__privateGet(this,_CSSScale).x=decomposedMatrix.scaleX,__privateGet(this,_CSSScale).y=decomposedMatrix.scaleY,__privateGet(this,_CSSScale).z=decomposedMatrix.scaleZ,__privateGet(this,_CSSRotation).x=decomposedMatrix.rotationX,__privateGet(this,_CSSRotation).y=decomposedMatrix.rotationY,__privateGet(this,_CSSRotation).z=decomposedMatrix.rotationZ,__privateMethod(this,_LayoutBox_instances,composeSteps_fn).call(this),__privateMethod(this,_LayoutBox_instances,recalculate_fn).call(this),__privateGet(this,_resizeNotifier).notify()},"#updateDimensions"),updateScrollPosition_fn=__name(function(){__privateGet(this,_scrollValue).x=0,__privateGet(this,_scrollValue).y=0,__privateGet(this,_scrollValue).z=0;for(let index=0;index<__privateGet(this,_scrollStepSetterCallbacks).length;index++){const callbackReturn=__privateGet(this,_scrollStepSetterCallbacks)[index]();let axis=callbackReturn.axis;__privateGet(this,_scrollAxis)!=="auto"&&(axis=__privateGet(this,_scrollAxis));const value=callbackReturn.value*(axis==="x"?-1:__privateGet(this,_isCartesian)?1:-1);__privateGet(this,_scrollValue)[axis]+=value,__privateGet(this,_position).setStep(`_scroll_${index}`,"+",{[axis]:value})}},"#updateScrollPosition"),_resizeListener=new WeakMap,_tickListener=new WeakMap,_scrollEntriesListener=new WeakMap,__name(_LayoutBox,"LayoutBox");let LayoutBox=_LayoutBox;exports.LayoutBox=LayoutBox;exports.decomposeCSSMatrix=decomposeCSSMatrix;
@@ -14,7 +14,7 @@ import { scrollEntries } from "../scroll-entries/index.js";
14
14
  import { t as ticker } from "../index-DAG0CtYo.js";
15
15
  import { i as isBrowser } from "../Store-CAGUSjFX.js";
16
16
  import { g as getElement } from "../dom-D8D-_9ty.js";
17
- import { g as getStickyOffset, a as getCumulativeOffsetLeft, b as getCumulativeOffsetTop } from "../layout-BL6AX9-r.js";
17
+ import { g as getStickyOffset, a as getCumulativeOffsetLeft, b as getCumulativeOffsetTop } from "../layout-DxOCR4qe.js";
18
18
  import "construct-style-sheets-polyfill";
19
19
  import { windowResizer } from "../window-resizer/index.js";
20
20
  function decomposeCSSMatrix(matrix) {
@@ -1 +1 @@
1
- "use strict";var __defProp=Object.defineProperty;var __name=(target,value)=>__defProp(target,"name",{value,configurable:!0});function getCumulativePosition(target,from="offsetLeft",stopElement){let acc=0;do acc+=target[from]||0,target=target.offsetParent;while(target&&target!==stopElement);return acc}__name(getCumulativePosition,"getCumulativePosition");function getCumulativeOffsetLeft(target,stopElement){return getCumulativePosition(target,"offsetLeft",stopElement)}__name(getCumulativeOffsetLeft,"getCumulativeOffsetLeft");function getCumulativeOffsetTop(target,stopElement){return getCumulativePosition(target,"offsetTop",stopElement)}__name(getCumulativeOffsetTop,"getCumulativeOffsetTop");function getStickyOffset(el,type){const stickyParents=[];let parent=el.parentElement;for(;parent;)window.getComputedStyle(parent).position==="sticky"&&stickyParents.push(parent),parent=parent.parentElement;return stickyParents.reduce((p,c)=>p+(type==="top"?c.offsetTop:c.offsetLeft),0)}__name(getStickyOffset,"getStickyOffset");exports.getCumulativeOffsetLeft=getCumulativeOffsetLeft;exports.getCumulativeOffsetTop=getCumulativeOffsetTop;exports.getCumulativePosition=getCumulativePosition;exports.getStickyOffset=getStickyOffset;
1
+ "use strict";var __defProp=Object.defineProperty;var __name=(target,value)=>__defProp(target,"name",{value,configurable:!0});function getCumulativePosition(target,from="offsetLeft",stopElement){let acc=0;do acc+=target[from]||0,target=target.offsetParent;while(target&&target!==stopElement);return acc}__name(getCumulativePosition,"getCumulativePosition");function getCumulativeOffsetLeft(target,stopElement){return getCumulativePosition(target,"offsetLeft",stopElement)}__name(getCumulativeOffsetLeft,"getCumulativeOffsetLeft");function getCumulativeOffsetTop(target,stopElement){return getCumulativePosition(target,"offsetTop",stopElement)}__name(getCumulativeOffsetTop,"getCumulativeOffsetTop");function getStickyOffset(el,type){const stickyElements=[];let currentElement=el;for(;currentElement;)window.getComputedStyle(currentElement).position==="sticky"&&stickyElements.push(currentElement),currentElement=currentElement.parentElement;return stickyElements.reduce((p,c)=>p+(type==="top"?c.offsetTop:c.offsetLeft),0)}__name(getStickyOffset,"getStickyOffset");exports.getCumulativeOffsetLeft=getCumulativeOffsetLeft;exports.getCumulativeOffsetTop=getCumulativeOffsetTop;exports.getCumulativePosition=getCumulativePosition;exports.getStickyOffset=getStickyOffset;
@@ -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-DfvKl-On.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"))&&currentPath!==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&&currentMorphElementChildNodes[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-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"))&&currentPath!==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&&currentMorphElementChildNodes[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;
@@ -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-IQwW3E-B.js";
39
+ import { s as scrollToElement } from "../scroll-CqF_88wv.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";
@@ -1 +1 @@
1
- "use strict";var __defProp=Object.defineProperty;var __getOwnPropSymbols=Object.getOwnPropertySymbols,__getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__reflectGet=Reflect.get;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};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);var __superGet=(cls,obj,key)=>__reflectGet(__getProtoOf(cls),key,obj);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 order_index=require("../order/index.cjs"),Store=require("../Store-B96mD8mD.cjs"),_function=require("../function-H4b_gTg6.cjs");require("../index-BoGx2BWX.cjs");const math=require("../math-C-knY2TL.cjs"),number=require("../number-Bu4sGvW7.cjs"),Damped=require("../Damped-B_mVO810.cjs"),Tweened=require("../Tweened-BZoUkI7O.cjs"),DragControls=require("../DragControls-Cwnszjzf.cjs"),cssProperty_index=require("../css-property/index.cjs"),cssUnitParser_index=require("../css-unit-parser/index.cjs"),Viewport=require("../Viewport-Blxv_yl_.cjs"),elementResizer_index=require("../element-resizer/index.cjs"),scrollEntries_index=require("../scroll-entries/index.cjs"),element=require("../element-CqD0jqBJ.cjs"),events=require("../events-UlGk63iC.cjs"),layout=require("../layout-CnGLl7oe.cjs"),stylesheet$1=require("../stylesheet-DQv6_0na.cjs"),windowResizer_index=require("../window-resizer/index.cjs");require("construct-style-sheets-polyfill");const gestures=require("../gestures-DtYbQr49.cjs"),dom=require("../dom-B40i6NXw.cjs");var _element,_index,_scrollElement,_width,_height,_size,_position,_currentMark,_transformPosition,_ScrollSection_instances,setVar_fn;const _ScrollSection=class _ScrollSection{constructor(element2,index,scrollElement){__privateAdd(this,_ScrollSection_instances);__privateAdd(this,_element);__privateAdd(this,_index);__privateAdd(this,_scrollElement);__privateAdd(this,_width,0);__privateAdd(this,_height,0);__privateAdd(this,_size,0);__privateAdd(this,_position,0);__privateAdd(this,_currentMark,null);__privateAdd(this,_transformPosition,0);__privateSet(this,_element,element2),__privateSet(this,_index,index),__privateSet(this,_scrollElement,scrollElement),scrollEntries_index.scrollEntries.register(__privateGet(this,_element)),this.setIndex(__privateGet(this,_index))}get element(){return __privateGet(this,_element)}get index(){return __privateGet(this,_index)}get size(){return __privateGet(this,_size)}get width(){return __privateGet(this,_width)}get height(){return __privateGet(this,_height)}get position(){return __privateGet(this,_position)}get transformPosition(){return __privateGet(this,_transformPosition)}destroy(){scrollEntries_index.scrollEntries.unregister(__privateGet(this,_element)),this.unsetTransform()}unsetTransform(){__privateGet(this,_element).style.transform="",this.setMark(null),this.setIndex(null),this.setCurrentIndex(null),this.setCurrentIndexArc(null),this.setCurrentIndexArcAbs(null),this.setOffsetIndex(null),this.setMiddle(!1),this.setSize()}setSize(value){value?(__privateGet(this,_element).style.setProperty("--size",value+"px"),__privateGet(this,_scrollElement).axisCSSProperty.current==="x"?(__privateGet(this,_element).style.width=value+"px",__privateGet(this,_element).style.height=""):(__privateGet(this,_element).style.height=value+"px",__privateGet(this,_element).style.width="")):(__privateGet(this,_element).style.width="",__privateGet(this,_element).style.height="",__privateGet(this,_element).style.removeProperty("--size"))}resize(){__privateSet(this,_width,__privateGet(this,_element).offsetWidth),__privateSet(this,_height,__privateGet(this,_element).offsetHeight),__privateSet(this,_size,__privateGet(this,_scrollElement).vertical?__privateGet(this,_element).offsetHeight:__privateGet(this,_element).offsetWidth),__privateSet(this,_position,__privateGet(this,_scrollElement).vertical?layout.getCumulativeOffsetTop(__privateGet(this,_element)):layout.getCumulativeOffsetLeft(__privateGet(this,_element))),__privateSet(this,_position,__privateGet(this,_position)-__privateGet(this,_scrollElement).contentPosition)}transform(){const cssOffset=__privateGet(this,_scrollElement).shiftSectionPositionCSSProperty.current;let offset=cssOffset;const distanceAddition=__privateGet(this,_scrollElement).viewportSize*__privateGet(this,_scrollElement).sectionDistanceScaleCSSProperty.current;__privateGet(this,_scrollElement).loopCSSProperty.current&&__privateGet(this,_position)+__privateGet(this,_size)<=__privateGet(this,_scrollElement).currentScrollValue-cssOffset/2&&(offset=(__privateGet(this,_scrollElement).distance-cssOffset)*-1-__privateGet(this,_scrollElement).gap),scrollEntries_index.scrollEntries.update(__privateGet(this,_element),__privateGet(this,_scrollElement).axisCSSProperty.current,offset);const valueToClamp=__privateGet(this,_scrollElement).currentScrollValue+offset,min=__privateGet(this,_position)-__privateGet(this,_scrollElement).viewportSize-distanceAddition,max=__privateGet(this,_position)+__privateGet(this,_size)+distanceAddition,value=number.preciseNumber(math.clamp(valueToClamp,min,max),3);__privateSet(this,_transformPosition,value*-1),__privateGet(this,_scrollElement).vertical?__privateGet(this,_element).style.transform=`translate3d(0px, ${__privateGet(this,_transformPosition)}px, 0px)`:__privateGet(this,_element).style.transform=`translate3d(${__privateGet(this,_transformPosition)}px, 0px, 0px)`}setMark(mark){__privateGet(this,_currentMark)!==mark&&(__privateGet(this,_currentMark)&&__privateGet(this,_element).classList.remove(__privateGet(this,_currentMark)),mark&&__privateGet(this,_element).classList.add(mark),__privateSet(this,_currentMark,mark),events.dispatchEvent(__privateGet(this,_element),"scrollSectionMarkChange",{composed:!0,detail:{mark:__privateGet(this,_currentMark)},custom:!0}))}setMiddle(bool){__privateGet(this,_element).classList.toggle("middle",bool)}setIndex(value){__privateMethod(this,_ScrollSection_instances,setVar_fn).call(this,"index",value)}setCurrentIndex(value){__privateMethod(this,_ScrollSection_instances,setVar_fn).call(this,"current-index",value)}setCurrentIndexArc(value){__privateMethod(this,_ScrollSection_instances,setVar_fn).call(this,"current-index-arc",value)}setOffsetIndex(value){__privateMethod(this,_ScrollSection_instances,setVar_fn).call(this,"offset-index",value)}setCurrentIndexArcAbs(value){__privateMethod(this,_ScrollSection_instances,setVar_fn).call(this,"current-index-arc-abs",value)}};_element=new WeakMap,_index=new WeakMap,_scrollElement=new WeakMap,_width=new WeakMap,_height=new WeakMap,_size=new WeakMap,_position=new WeakMap,_currentMark=new WeakMap,_transformPosition=new WeakMap,_ScrollSection_instances=new WeakSet,setVar_fn=__name(function(name,value){value!==null?(__privateGet(this,_element).style.setProperty(`--${name}`,value.toString()),__privateGet(this,_element).setAttribute(`data-${name}`,value.toString())):(__privateGet(this,_element).style.removeProperty(`--${name}`),__privateGet(this,_element).removeAttribute(`data-${name}`))},"#setVar"),__name(_ScrollSection,"ScrollSection");let ScrollSection=_ScrollSection;const stylesheet=stylesheet$1.createStylesheet({":host":{position:"relative",width:"100%",height:"100%",display:"block",outline:"none"},".static":{position:"var(--static-position, absolute)",top:"var(--static-top, 0)",left:"var(--static-left, 0)",width:"var(--static-width, 100%)",height:"var(--static-height, 100%)"},".content-wrapper":{width:"var(--content-wrapper-width, 100%)",height:"var(--content-wrapper-height, 100%)",overflow:"var(--overflow, initial)",borderRadius:"var(--border-radius, unset)"},".content":{position:"relative",display:"flex",width:"100%",height:"100%",gap:"var(--gap, 0px)",willChange:"var(--will-change, transform)"},":host(.hibernated) .content-wrapper":{display:"contents"},":host(.hibernated) .content":{display:"contents"},"::slotted(*)":{flexShrink:"0"}});var _damped,_controlsCSSProperty,_axisCSSProperty,_reverseCSSProperty,_directionCSSProperty,_pagesCSSProperty,_splitCSSProperty,_sectionalCSSProperty,_easingCSSProperty,_durationCSSProperty,_autoSizeCSSProperty,_wheelMaxDeltaCSSProperty,_dragInertionCSSProperty,_sectionsInViewCSSProperty,_loopCSSProperty,_dampingCSSProperty,_massCSSProperty,_stiffnessCSSProperty,_mouseDragCSSProperty,_sectionDistanceScaleCSSProperty,_startSectionCSSProperty,_autoplayCSSProperty,_autoplayPauseDurationCSSProperty,_autoplayUserDirectionCSSProperty,_classesCSSProperty,_currentIndexStartOffsetCSSProperty,_currentIndexEndOffsetCSSProperty,_shiftSectionPositionCSSProperty,_focusDelayCSSProperty,_focusDurationCSSProperty,_shiftLimitCSSProperty,_disabledCSSProperty,_hibernatedCSSProperty,_contentWrapperElement,_contentElement,_slotElement,_sections,_visibleSections,_position2,_contentPosition,_viewportSize,_scrollSize,_gap,_wheelControls,_keyboardControls,_dragControls,_autoplayControls,_counter,_overscroll,_distance,_hasOverflow,_disabled,_hibernated,_focusTimeoutId,_tweenTimeoutId,_setTween,_isGrabbing,_scrollLine,_isConnected,_mutationObserver,_currentSections,_skipNextResize,_maxSectionSizeTimeoutId,_ScrollElement_instances,updateAxis_fn,split_fn,unsplit_fn,disable_fn,enable_fn,hibernate_fn,awake_fn,_resizeListener,_animatedChangeListener,clampCounter_fn,_notAutoplayControlListener,_controlsListener,processAutoplay_fn,getScrollValue_fn,updateMarks_fn,updateIndexes_fn,_updateMaxSectionsSize,getNearestSectionIndex_fn,_connectListener;const _ScrollElement=class _ScrollElement extends HTMLElement{constructor(){super();__privateAdd(this,_ScrollElement_instances);__privateAdd(this,_damped,null);__privateAdd(this,_controlsCSSProperty,new cssProperty_index.CSSProperty(this,"--controls",!0));__privateAdd(this,_axisCSSProperty,new cssProperty_index.CSSProperty(this,"--axis","y"));__privateAdd(this,_reverseCSSProperty,new cssProperty_index.CSSProperty(this,"--reverse",!1));__privateAdd(this,_directionCSSProperty,new cssProperty_index.CSSProperty(this,"--direction",0));__privateAdd(this,_pagesCSSProperty,new cssProperty_index.CSSProperty(this,"--pages",0,{validate:__name(v=>Math.max(0,v-1),"validate")}));__privateAdd(this,_splitCSSProperty,new cssProperty_index.CSSProperty(this,"--split",!1));__privateAdd(this,_sectionalCSSProperty,new cssProperty_index.CSSProperty(this,"--sectional",!1));__privateAdd(this,_easingCSSProperty,new cssProperty_index.CSSProperty(this,"--tween-easing",!1));__privateAdd(this,_durationCSSProperty,new cssProperty_index.CSSProperty(this,"--tween-duration",!1));__privateAdd(this,_autoSizeCSSProperty,new cssProperty_index.CSSProperty(this,"--auto-size",!1));__privateAdd(this,_wheelMaxDeltaCSSProperty,new cssProperty_index.CSSProperty(this,"--wheel-max-delta",!1));__privateAdd(this,_dragInertionCSSProperty,new cssProperty_index.CSSProperty(this,"--drag-inertion",1));__privateAdd(this,_sectionsInViewCSSProperty,new cssProperty_index.CSSProperty(this,"--sections-in-view",1));__privateAdd(this,_loopCSSProperty,new cssProperty_index.CSSProperty(this,"--loop",!1));__privateAdd(this,_dampingCSSProperty,new cssProperty_index.CSSProperty(this,"--damping",20));__privateAdd(this,_massCSSProperty,new cssProperty_index.CSSProperty(this,"--mass",0));__privateAdd(this,_stiffnessCSSProperty,new cssProperty_index.CSSProperty(this,"--stiffness",0));__privateAdd(this,_mouseDragCSSProperty,new cssProperty_index.CSSProperty(this,"--mouse-drag",!1));__privateAdd(this,_sectionDistanceScaleCSSProperty,new cssProperty_index.CSSProperty(this,"--section-distance-scale",.5));__privateAdd(this,_startSectionCSSProperty,new cssProperty_index.CSSProperty(this,"--start-section",0));__privateAdd(this,_autoplayCSSProperty,new cssProperty_index.CSSProperty(this,"--autoplay",0));__privateAdd(this,_autoplayPauseDurationCSSProperty,new cssProperty_index.CSSProperty(this,"--autoplay-pause-duration",0));__privateAdd(this,_autoplayUserDirectionCSSProperty,new cssProperty_index.CSSProperty(this,"--autoplay-user-direction",!1));__privateAdd(this,_classesCSSProperty,new cssProperty_index.CSSProperty(this,"--classes",!1));__privateAdd(this,_currentIndexStartOffsetCSSProperty,new cssProperty_index.CSSProperty(this,"--current-index-start-offset",0));__privateAdd(this,_currentIndexEndOffsetCSSProperty,new cssProperty_index.CSSProperty(this,"--current-index-end-offset",0));__privateAdd(this,_shiftSectionPositionCSSProperty,new cssProperty_index.CSSProperty(this,"--shift-section-position",0,{rawValueCheck:!1}));__privateAdd(this,_focusDelayCSSProperty,new cssProperty_index.CSSProperty(this,"--focus-delay",0));__privateAdd(this,_focusDurationCSSProperty,new cssProperty_index.CSSProperty(this,"--focus-duration",3e3));__privateAdd(this,_shiftLimitCSSProperty,new cssProperty_index.CSSProperty(this,"--shift-limit",0));__privateAdd(this,_disabledCSSProperty,new cssProperty_index.CSSProperty(this,"--disabled",!1));__privateAdd(this,_hibernatedCSSProperty,new cssProperty_index.CSSProperty(this,"--hibernate",!1));__privateAdd(this,_contentWrapperElement,null);__privateAdd(this,_contentElement,null);__privateAdd(this,_slotElement,null);__privateAdd(this,_sections,[]);__privateAdd(this,_visibleSections,[]);__privateAdd(this,_position2,0);__privateAdd(this,_contentPosition,0);__privateAdd(this,_viewportSize,0);__privateAdd(this,_scrollSize,0);__privateAdd(this,_gap,0);__privateAdd(this,_wheelControls,null);__privateAdd(this,_keyboardControls,null);__privateAdd(this,_dragControls,null);__privateAdd(this,_autoplayControls,null);__privateAdd(this,_counter,new Store.Store(0));__privateAdd(this,_overscroll,0);__privateAdd(this,_distance,0);__privateAdd(this,_hasOverflow,!1);__privateAdd(this,_disabled,!0);__privateAdd(this,_hibernated,!0);__privateAdd(this,_focusTimeoutId);__privateAdd(this,_tweenTimeoutId);__privateAdd(this,_setTween,new Tweened.Tweened);__privateAdd(this,_isGrabbing,!1);__privateAdd(this,_scrollLine,null);__privateAdd(this,_isConnected,!1);__privateAdd(this,_mutationObserver,null);__privateAdd(this,_currentSections,[]);__privateAdd(this,_skipNextResize,!1);__privateAdd(this,_maxSectionSizeTimeoutId);__privateAdd(this,_resizeListener,__name(e=>{if(e&&__privateGet(this,_skipNextResize)){__privateSet(this,_skipNextResize,!1);return}this.resize()},"#resizeListener"));__privateAdd(this,_animatedChangeListener,__name(()=>{if(!__privateGet(this,_hasOverflow)||__privateGet(this,_hibernated)||__privateGet(this,_disabled))return;const currentScrollValue=this.currentScrollValue;if(__privateSet(this,_overscroll,Math.max(0,currentScrollValue-__privateGet(this,_scrollSize))),__privateGet(this,_visibleSections).length){for(let i=0;i<__privateGet(this,_sections).length;i++)__privateGet(this,_sections)[i].transform();(__privateGet(this,_isGrabbing)||!__privateGet(this,_sectionalCSSProperty).current)&&(__privateGet(this,_counter).current=__privateMethod(this,_ScrollElement_instances,getNearestSectionIndex_fn).call(this))}else this.vertical?__privateGet(this,_contentElement).style.transform=`translate3d(0px, ${currentScrollValue*-1}px, 0px)`:__privateGet(this,_contentElement).style.transform=`translate3d(${currentScrollValue*-1}px, 0px, 0px)`;__privateMethod(this,_ScrollElement_instances,updateIndexes_fn).call(this),scrollEntries_index.scrollEntries.update(this,__privateGet(this,_axisCSSProperty).current,currentScrollValue)},"#animatedChangeListener"));__privateAdd(this,_notAutoplayControlListener,__name((type,value)=>{__privateGet(this,_controlsCSSProperty).current&&(__privateMethod(this,_ScrollElement_instances,processAutoplay_fn).call(this,Math.sign(value)||1),__privateGet(this,_controlsListener).call(this,type,value))},"#notAutoplayControlListener"));__privateAdd(this,_controlsListener,__name((type,value)=>{if(!__privateGet(this,_tweenTimeoutId)){if(__privateGet(this,_directionCSSProperty).current){if(__privateGet(this,_directionCSSProperty).current<0&&value>0)return;if(__privateGet(this,_directionCSSProperty).current>0&&value<0)return}if(!__privateGet(this,_autoplayCSSProperty).current&&__privateGet(this,_focusDelayCSSProperty).current&&(clearInterval(__privateGet(this,_focusTimeoutId)),__privateSet(this,_focusTimeoutId,setTimeout(()=>{const section=__privateGet(this,_visibleSections)[__privateMethod(this,_ScrollElement_instances,getNearestSectionIndex_fn).call(this)];section&&this.scrollToSection(section.index,{tween:{duration:__privateGet(this,_focusDurationCSSProperty).current,easing:Tweened.easeInOutExpo}})},__privateGet(this,_focusDelayCSSProperty).current))),!(type.includes("drag")&&!Viewport.device.isTouch&&!__privateGet(this,_mouseDragCSSProperty).current)){if(__privateGet(this,_sectionalCSSProperty).current&&type!=="drag"){const direction=Math.sign(value);__privateGet(this,_visibleSections).length?__privateGet(this,_isGrabbing)?this.scrollToSection(__privateMethod(this,_ScrollElement_instances,getNearestSectionIndex_fn).call(this,!0)):this.shiftSections(direction,{tween:__privateGet(this,_easingCSSProperty).current||__privateGet(this,_durationCSSProperty).current?{easing:__privateGet(this,_easingCSSProperty).current||"easeInOutCubic",duration:__privateGet(this,_durationCSSProperty).current||500}:void 0}):__privateGet(this,_damped).shift(direction*__privateGet(this,_viewportSize))}else __privateGet(this,_damped).shift(value);__privateSet(this,_isGrabbing,type==="drag")}}},"#controlsListener"));__privateAdd(this,_updateMaxSectionsSize,_function.debounce(()=>{const maxSectionSize=__privateGet(this,_currentSections).reduce((p,c)=>{const s=this.vertical?c.width:c.height;return s>p?s:p},0);clearTimeout(__privateGet(this,_maxSectionSizeTimeoutId)),__privateSet(this,_skipNextResize,!0),this.style.setProperty("--max-section-size",""),__privateSet(this,_maxSectionSizeTimeoutId,setTimeout(()=>{__privateSet(this,_skipNextResize,!0),this.style.setProperty("--max-section-size",maxSectionSize+"px")},10))},20));__privateAdd(this,_connectListener,__name(()=>{__privateSet(this,_isConnected,!0),this.hibernatedCSSProperty.current||__privateMethod(this,_ScrollElement_instances,awake_fn).call(this),elementResizer_index.elementResizer.subscribe(this,__privateGet(this,_resizeListener)),windowResizer_index.windowResizer.unsubscribe(__privateGet(this,_connectListener))},"#connectListener"));if(Store.isBrowser){const shadow=this.attachShadow({mode:"open"});shadow.adoptedStyleSheets=[stylesheet];const staticElement=document.createElement("div");staticElement.className="static",staticElement.innerHTML='<slot name="static"></slot>',shadow.appendChild(staticElement),__privateSet(this,_contentWrapperElement,document.createElement("div")),__privateGet(this,_contentWrapperElement).className="content-wrapper",__privateSet(this,_contentElement,document.createElement("div")),__privateGet(this,_contentElement).className="content",__privateSet(this,_slotElement,document.createElement("slot")),__privateGet(this,_contentElement).appendChild(__privateGet(this,_slotElement)),__privateGet(this,_contentWrapperElement).appendChild(__privateGet(this,_contentElement)),shadow.appendChild(__privateGet(this,_contentWrapperElement)),__privateSet(this,_mutationObserver,new MutationObserver(_function.debounce(()=>{this.tryResplit()},10)))}}get damped(){return __privateGet(this,_damped)}get controlsCSSProperty(){return __privateGet(this,_controlsCSSProperty)}get axisCSSProperty(){return __privateGet(this,_axisCSSProperty)}get reverseCSSProperty(){return __privateGet(this,_reverseCSSProperty)}get directionCSSProperty(){return __privateGet(this,_directionCSSProperty)}get pagesCSSProperty(){return __privateGet(this,_pagesCSSProperty)}get splitCSSProperty(){return __privateGet(this,_splitCSSProperty)}get sectionalCSSProperty(){return __privateGet(this,_sectionalCSSProperty)}get easingCSSProperty(){return __privateGet(this,_easingCSSProperty)}get durationCSSProperty(){return __privateGet(this,_durationCSSProperty)}get autoSizeCSSProperty(){return __privateGet(this,_autoSizeCSSProperty)}get wheelMaxDeltaCSSProperty(){return __privateGet(this,_wheelMaxDeltaCSSProperty)}get dragInertionCSSProperty(){return __privateGet(this,_dragInertionCSSProperty)}get sectionsInViewCSSProperty(){return __privateGet(this,_sectionsInViewCSSProperty)}get loopCSSProperty(){return __privateGet(this,_loopCSSProperty)}get dampingCSSProperty(){return __privateGet(this,_dampingCSSProperty)}get massCSSProperty(){return __privateGet(this,_massCSSProperty)}get stiffnessCSSProperty(){return __privateGet(this,_stiffnessCSSProperty)}get mouseDragCSSProperty(){return __privateGet(this,_mouseDragCSSProperty)}get sectionDistanceScaleCSSProperty(){return __privateGet(this,_sectionDistanceScaleCSSProperty)}get startSectionCSSProperty(){return __privateGet(this,_startSectionCSSProperty)}get autoplayCSSProperty(){return __privateGet(this,_autoplayCSSProperty)}get autoplayPauseDurationCSSProperty(){return __privateGet(this,_autoplayPauseDurationCSSProperty)}get autoplayUserDirectionCSSProperty(){return __privateGet(this,_autoplayUserDirectionCSSProperty)}get classesCSSProperty(){return __privateGet(this,_classesCSSProperty)}get currentIndexStartOffsetCSSProperty(){return __privateGet(this,_currentIndexStartOffsetCSSProperty)}get currentIndexEndOffsetCSSProperty(){return __privateGet(this,_currentIndexEndOffsetCSSProperty)}get shiftSectionPositionCSSProperty(){return __privateGet(this,_shiftSectionPositionCSSProperty)}get focusDelayCSSProperty(){return __privateGet(this,_focusDelayCSSProperty)}get focusDurationCSSProperty(){return __privateGet(this,_focusDurationCSSProperty)}get shiftLimitCSSProperty(){return __privateGet(this,_shiftLimitCSSProperty)}get disabledCSSProperty(){return __privateGet(this,_disabledCSSProperty)}get hibernatedCSSProperty(){return __privateGet(this,_hibernatedCSSProperty)}get currentScrollValue(){return __privateMethod(this,_ScrollElement_instances,getScrollValue_fn).call(this,"current")}get targetScrollValue(){return __privateMethod(this,_ScrollElement_instances,getScrollValue_fn).call(this,"target")}get contentWrapperElement(){return __privateGet(this,_contentWrapperElement)}get contentElement(){return __privateGet(this,_contentElement)}get sections(){return __privateGet(this,_sections)}get visibleSections(){return __privateGet(this,_visibleSections)}get position(){return __privateGet(this,_position2)}get contentPosition(){return __privateGet(this,_contentPosition)}get viewportSize(){return __privateGet(this,_viewportSize)}get scrollSize(){return __privateGet(this,_scrollSize)}get gap(){return __privateGet(this,_gap)}get counter(){return __privateGet(this,_counter)}get limit(){return Math.ceil(__privateGet(this,_visibleSections).length-__privateGet(this,_sectionsInViewCSSProperty).current+__privateGet(this,_shiftLimitCSSProperty).current)}get distance(){return __privateGet(this,_distance)}get loopDistance(){return __privateGet(this,_loopCSSProperty).current?__privateGet(this,_distance)+__privateGet(this,_gap):__privateGet(this,_distance)}get hasOverflow(){return __privateGet(this,_hasOverflow)}get overscroll(){return __privateGet(this,_overscroll)}get scrollLine(){return __privateGet(this,_scrollLine)}get vertical(){return __privateGet(this,_axisCSSProperty).current==="y"}get currentProgress(){return this.currentScrollValue/this.loopDistance||0}get targetProgress(){return this.targetScrollValue/this.loopDistance||0}get scrollWidth(){return __privateGet(this,_axisCSSProperty).current==="y"?0:__privateGet(this,_damped).distance}get scrollHeight(){return __privateGet(this,_axisCSSProperty).current==="x"?0:__privateGet(this,_damped).distance}tryResplit(){!__privateGet(this,_hibernated)&&(__privateGet(this,_loopCSSProperty).current||__privateGet(this,_splitCSSProperty).current||__privateGet(this,_loopCSSProperty).current||__privateGet(this,_autoSizeCSSProperty).current||__privateGet(this,_sectionalCSSProperty).current)&&__privateMethod(this,_ScrollElement_instances,split_fn).call(this)}onScroll(...parameters){return __privateGet(this,_damped).subscribe(...parameters)}offScroll(...parameters){__privateGet(this,_damped).unsubscribe(...parameters)}range(from,distance,margin=0){const start=from-margin,end=start+distance+margin*2;return this.currentProgress<start?0:this.currentProgress>end?1:(this.currentProgress-start)/(end-start)}curve(from,distance,margin=0){return Math.sin(this.range(from,distance,margin)*Math.PI)}visible(from,distance,margin=0){const start=from-margin,end=start+distance+margin*2;return this.currentProgress>=start&&this.currentProgress<=end}scrollToSection(sectionIndex,options){if(!__privateGet(this,_visibleSections).length||__privateGet(this,_hibernated)||__privateGet(this,_tweenTimeoutId))return;const previousCounter=__privateGet(this,_counter).current,newCounterValue=__privateMethod(this,_ScrollElement_instances,clampCounter_fn).call(this,sectionIndex);__privateGet(this,_isGrabbing)||(__privateGet(this,_counter).current=newCounterValue);const previousSection=__privateGet(this,_visibleSections)[previousCounter],currentSection=__privateGet(this,_visibleSections)[newCounterValue];if(previousSection&&currentSection){let shiftValue=0;const nearestSectionIndex=__privateMethod(this,_ScrollElement_instances,getNearestSectionIndex_fn).call(this),nearestSection=__privateGet(this,_visibleSections)[nearestSectionIndex];let scrolledFromNearestSection=nearestSection?this.targetScrollValue-nearestSection.position:0;__privateGet(this,_loopCSSProperty).current?newCounterValue===0&&previousCounter===__privateGet(this,_visibleSections).length-1?(shiftValue=__privateGet(this,_scrollSize)+__privateGet(this,_viewportSize)-previousSection.position+__privateGet(this,_gap),__privateGet(this,_isGrabbing)||(scrolledFromNearestSection=0)):newCounterValue===__privateGet(this,_visibleSections).length-1&&previousCounter===0?shiftValue=currentSection.position-(__privateGet(this,_scrollSize)+__privateGet(this,_viewportSize)+__privateGet(this,_gap)):shiftValue=currentSection.position-previousSection.position:shiftValue=currentSection.position-previousSection.position,this.shiftPosition(shiftValue-scrolledFromNearestSection,options)}}shiftSections(step,options){__privateGet(this,_visibleSections).length&&this.scrollToSection(__privateGet(this,_counter).current+step,options)}setPosition(value,options){__privateGet(this,_hibernated)||(__privateMethod(this,_ScrollElement_instances,processAutoplay_fn).call(this,Math.sign(value)||1),options!=null&&options.tween?(clearTimeout(__privateGet(this,_tweenTimeoutId)),__privateGet(this,_setTween).set(__privateGet(this,_damped).current,{equalize:!0}),__privateGet(this,_setTween).set(value,__spreadValues({},options.tween)),__privateSet(this,_tweenTimeoutId,setTimeout(()=>{__privateSet(this,_tweenTimeoutId,void 0)},options.tween.duration||0))):__privateGet(this,_damped).set(value,{equalize:(options==null?void 0:options.behaviour)==="instant"}))}shiftPosition(value,options){this.setPosition(__privateGet(this,_damped).target+value,options)}resize(){if(__privateGet(this,_hibernatedCSSProperty).current)return;__privateSet(this,_visibleSections,__privateGet(this,_sections).filter(s=>element.isElementVisible(s.element))),this.style.setProperty("--sections",__privateGet(this,_visibleSections).length.toString()),__privateGet(this,_damped).unlistenAnimationFrame();const prevProgress=this.currentScrollValue/__privateGet(this,_scrollSize)||0,prevCounter=__privateGet(this,_counter).current;if(__privateSet(this,_position2,this.vertical?layout.getCumulativeOffsetTop(this):layout.getCumulativeOffsetLeft(this)),__privateSet(this,_contentPosition,this.vertical?layout.getCumulativeOffsetTop(__privateGet(this,_contentElement)):layout.getCumulativeOffsetLeft(__privateGet(this,_contentElement))),__privateSet(this,_viewportSize,this.vertical?this.offsetHeight:this.offsetWidth),this.vertical?__privateSet(this,_gap,cssUnitParser_index.cssUnitParser.parse(getComputedStyle(__privateGet(this,_contentElement)).rowGap)||0):__privateSet(this,_gap,cssUnitParser_index.cssUnitParser.parse(getComputedStyle(__privateGet(this,_contentElement)).columnGap)||0),__privateGet(this,_autoSizeCSSProperty).current&&__privateGet(this,_visibleSections).length){const ivc=__privateGet(this,_sectionsInViewCSSProperty).current,sectionSize=(__privateGet(this,_viewportSize)-__privateGet(this,_gap)*(ivc-1))/ivc;__privateGet(this,_visibleSections).forEach(section=>{section.setSize(sectionSize)})}else __privateGet(this,_visibleSections).forEach(section=>{section.setSize()});if(__privateGet(this,_visibleSections).forEach(section=>{section.resize()}),__privateGet(this,_pagesCSSProperty).current){__privateSet(this,_scrollSize,__privateGet(this,_viewportSize)*__privateGet(this,_pagesCSSProperty).current);const contentSize=__privateGet(this,_scrollSize)+__privateGet(this,_viewportSize);this.vertical?(__privateGet(this,_contentElement).style.width=contentSize+"px",__privateGet(this,_contentElement).style.height="100%"):(__privateGet(this,_contentElement).style.height=contentSize+"px",__privateGet(this,_contentElement).style.width="100%")}else this.vertical?(__privateGet(this,_contentElement).style.width="100%",__privateGet(this,_contentElement).style.height="max-content",__privateSet(this,_scrollSize,__privateGet(this,_contentElement).offsetHeight-__privateGet(this,_viewportSize))):(__privateGet(this,_contentElement).style.width="max-content",__privateGet(this,_contentElement).style.height="100%",__privateSet(this,_scrollSize,__privateGet(this,_contentElement).offsetWidth-__privateGet(this,_viewportSize)));if(!__privateGet(this,_loopCSSProperty).current){const cs=getComputedStyle(this),padding=this.vertical?parseFloat(cs.paddingBlockStart)+parseFloat(cs.paddingBlockEnd):parseFloat(cs.paddingInlineStart)+parseFloat(cs.paddingInlineEnd);__privateSet(this,_scrollSize,__privateGet(this,_scrollSize)+padding),__privateGet(this,_damped).max=__privateGet(this,_scrollSize)}if(__privateGet(this,_loopCSSProperty).current&&__privateGet(this,_visibleSections).length){const lastSection=__privateGet(this,_visibleSections)[__privateGet(this,_visibleSections).length-1],lastSectionMax=lastSection.position+lastSection.size-__privateGet(this,_viewportSize),lastSectionMargin=__privateGet(this,_scrollSize)-lastSectionMax;__privateSet(this,_distance,lastSection.position+lastSection.size+lastSectionMargin)}else __privateSet(this,_distance,__privateGet(this,_scrollSize));if(__privateGet(this,_sectionalCSSProperty).current&&__privateGet(this,_visibleSections).length){const section=__privateGet(this,_visibleSections)[prevCounter];__privateGet(this,_damped).set(section.position,{equalize:!0})}else __privateGet(this,_damped).set(prevProgress*__privateGet(this,_scrollSize),{equalize:!0});__privateSet(this,_hasOverflow,(this.vertical?__privateGet(this,_contentElement).offsetHeight:__privateGet(this,_contentElement).offsetWidth)>__privateGet(this,_viewportSize)),this.classList.toggle("has-overflow",__privateGet(this,_hasOverflow)),__privateGet(this,_hasOverflow)?__privateGet(this,_disabledCSSProperty).current||__privateMethod(this,_ScrollElement_instances,enable_fn).call(this):__privateMethod(this,_ScrollElement_instances,disable_fn).call(this),__privateGet(this,_updateMaxSectionsSize).call(this),events.dispatchEvent(this,"scrollResize",{custom:!0}),__privateGet(this,_damped).notify()}connectedCallback(){scrollEntries_index.scrollEntries.register(this),__privateSet(this,_damped,new Damped.Damped(0,{damping:.01,min:0,order:order_index.TICK_ORDER.SCROLL})),this.setAttribute("tabindex","0"),__privateSet(this,_wheelControls,new DragControls.WheelControls({element:__privateGet(this,_contentElement)})),__privateGet(this,_wheelControls).changeEvent.subscribe(__privateGet(this,_notAutoplayControlListener)),__privateSet(this,_keyboardControls,new DragControls.KeyboardControls({element:this})),__privateGet(this,_keyboardControls).changeEvent.subscribe(__privateGet(this,_notAutoplayControlListener)),__privateSet(this,_dragControls,new DragControls.DragControls({element:__privateGet(this,_contentElement),rootElement:this})),__privateGet(this,_dragControls).changeEvent.subscribe(__privateGet(this,_notAutoplayControlListener)),__privateSet(this,_autoplayControls,new DragControls.AutoplayControls({culling:this})),__privateGet(this,_autoplayControls).changeEvent.subscribe(__privateGet(this,_controlsListener)),__privateGet(this,_axisCSSProperty).subscribe(()=>{__privateMethod(this,_ScrollElement_instances,updateAxis_fn).call(this)}),__privateGet(this,_reverseCSSProperty).subscribe(()=>{__privateMethod(this,_ScrollElement_instances,updateAxis_fn).call(this)}),__privateGet(this,_wheelMaxDeltaCSSProperty).subscribe(e=>{__privateGet(this,_wheelControls).axis=e.current?"max":__privateGet(this,_axisCSSProperty).current}),__privateGet(this,_dragInertionCSSProperty).subscribe(e=>{__privateGet(this,_dragControls).inertion=typeof e.current=="number"?e.current:1}),__privateGet(this,_pagesCSSProperty).subscribe(()=>{__privateGet(this,_isConnected)&&__privateGet(this,_resizeListener).call(this)}),__privateGet(this,_splitCSSProperty).subscribe(({current})=>{__privateGet(this,_isConnected)&&(current?__privateMethod(this,_ScrollElement_instances,split_fn).call(this):__privateMethod(this,_ScrollElement_instances,unsplit_fn).call(this))}),__privateGet(this,_sectionalCSSProperty).subscribe(e=>{__privateGet(this,_wheelControls).debounce=e.current,__privateGet(this,_dragControls).swipe=e.current,__privateGet(this,_autoplayControls).interval=e.current,__privateGet(this,_isConnected)&&(e.current&&!e.previous&&!__privateGet(this,_visibleSections).length?__privateMethod(this,_ScrollElement_instances,split_fn).call(this):!e.current&&e.previous&&__privateGet(this,_visibleSections).length&&__privateMethod(this,_ScrollElement_instances,unsplit_fn).call(this))}),__privateGet(this,_autoSizeCSSProperty).subscribe(e=>{__privateGet(this,_isConnected)&&(__privateGet(this,_resizeListener).call(this),e.current&&!e.previous&&!__privateGet(this,_visibleSections).length?__privateMethod(this,_ScrollElement_instances,split_fn).call(this):!e.current&&e.previous&&__privateGet(this,_visibleSections).length&&__privateMethod(this,_ScrollElement_instances,unsplit_fn).call(this))}),__privateGet(this,_sectionsInViewCSSProperty).subscribe(e=>{__privateGet(this,_isConnected)&&(__privateGet(this,_resizeListener).call(this),__privateMethod(this,_ScrollElement_instances,updateMarks_fn).call(this))}),__privateGet(this,_loopCSSProperty).subscribe(e=>{e.current?(__privateGet(this,_isConnected)&&(__privateGet(this,_visibleSections).length||(__privateGet(this,_splitCSSProperty).current=!0)),__privateGet(this,_damped).max=1/0,__privateGet(this,_damped).min=-1/0):(__privateSet(this,_overscroll,0),__privateGet(this,_damped).max=__privateGet(this,_scrollSize),__privateGet(this,_damped).min=0),this.classList.toggle("loop",!!e.current)}),__privateGet(this,_dampingCSSProperty).subscribe(e=>{__privateGet(this,_damped).damping=e.current}),__privateGet(this,_massCSSProperty).subscribe(e=>{__privateGet(this,_damped).mass=e.current}),__privateGet(this,_stiffnessCSSProperty).subscribe(e=>{__privateGet(this,_damped).stiffness=e.current}),__privateGet(this,_autoplayCSSProperty).subscribe(e=>{__privateGet(this,_autoplayControls).speed=e.current,!__privateGet(this,_disabled)&&e.current&&!e.previous?__privateGet(this,_autoplayControls).connect():!e.current&&e.previous&&__privateGet(this,_autoplayControls).disconnect()}),__privateGet(this,_autoplayUserDirectionCSSProperty).subscribe(e=>{e.current||(__privateGet(this,_autoplayControls).direction=1)}),__privateGet(this,_classesCSSProperty).subscribe(e=>{__privateGet(this,_isConnected)&&__privateMethod(this,_ScrollElement_instances,updateMarks_fn).call(this)}),__privateGet(this,_currentIndexStartOffsetCSSProperty).subscribe(e=>{__privateGet(this,_isConnected)&&__privateGet(this,_classesCSSProperty).current&&__privateMethod(this,_ScrollElement_instances,updateMarks_fn).call(this)}),__privateGet(this,_currentIndexEndOffsetCSSProperty).subscribe(e=>{__privateGet(this,_isConnected)&&__privateGet(this,_classesCSSProperty).current&&__privateMethod(this,_ScrollElement_instances,updateMarks_fn).call(this)}),__privateGet(this,_shiftSectionPositionCSSProperty).subscribe(e=>{__privateGet(this,_isConnected)&&__privateGet(this,_damped).notify()}),__privateGet(this,_damped).isRunning.subscribe(e=>{this.classList.toggle("active",e.current)}),__privateGet(this,_counter).subscribe(e=>{__privateGet(this,_hibernated)||(__privateGet(this,_visibleSections).length&&__privateMethod(this,_ScrollElement_instances,updateMarks_fn).call(this),this.style.setProperty("--counter",e.current+""))}),__privateGet(this,_setTween).subscribe(e=>{__privateGet(this,_setTween).isRunning.current&&__privateGet(this,_damped).set(e.current,{equalize:!0})}),__privateGet(this,_disabledCSSProperty).subscribe(e=>{e.current&&!e.previous?(this.classList.add("disabled"),__privateMethod(this,_ScrollElement_instances,disable_fn).call(this)):!e.current&&e.previous&&(this.classList.remove("disabled"),__privateMethod(this,_ScrollElement_instances,enable_fn).call(this))}),__privateGet(this,_hibernatedCSSProperty).subscribe(e=>{e.current&&!e.previous?(this.classList.add("hibernated"),__privateMethod(this,_ScrollElement_instances,hibernate_fn).call(this)):!e.current&&e.previous&&(this.classList.remove("hibernated"),__privateMethod(this,_ScrollElement_instances,awake_fn).call(this))}),__privateGet(this,_controlsCSSProperty).observe(),__privateGet(this,_axisCSSProperty).observe(),__privateGet(this,_reverseCSSProperty).observe(),__privateGet(this,_directionCSSProperty).observe(),__privateGet(this,_pagesCSSProperty).observe(),__privateGet(this,_splitCSSProperty).observe(),__privateGet(this,_sectionalCSSProperty).observe(),__privateGet(this,_easingCSSProperty).observe(),__privateGet(this,_durationCSSProperty).observe(),__privateGet(this,_autoSizeCSSProperty).observe(),__privateGet(this,_wheelMaxDeltaCSSProperty).observe(),__privateGet(this,_dragInertionCSSProperty).observe(),__privateGet(this,_sectionsInViewCSSProperty).observe(),__privateGet(this,_loopCSSProperty).observe(),__privateGet(this,_dampingCSSProperty).observe(),__privateGet(this,_massCSSProperty).observe(),__privateGet(this,_stiffnessCSSProperty).observe(),__privateGet(this,_mouseDragCSSProperty).observe(),__privateGet(this,_sectionDistanceScaleCSSProperty).observe(),__privateGet(this,_startSectionCSSProperty).observe(),__privateGet(this,_autoplayCSSProperty).observe(),__privateGet(this,_autoplayCSSProperty).observe(),__privateGet(this,_autoplayPauseDurationCSSProperty).observe(),__privateGet(this,_autoplayUserDirectionCSSProperty).observe(),__privateGet(this,_classesCSSProperty).observe(),__privateGet(this,_currentIndexStartOffsetCSSProperty).observe(),__privateGet(this,_currentIndexEndOffsetCSSProperty).observe(),__privateGet(this,_shiftSectionPositionCSSProperty).observe(),__privateGet(this,_focusDelayCSSProperty).observe(),__privateGet(this,_focusDurationCSSProperty).observe(),__privateGet(this,_shiftLimitCSSProperty).observe(),__privateGet(this,_disabledCSSProperty).observe(),__privateGet(this,_hibernatedCSSProperty).observe(),windowResizer_index.windowResizer.subscribe(__privateGet(this,_connectListener),order_index.RESIZE_ORDER.LAST),__privateGet(this,_mutationObserver).observe(this,{childList:!0})}disconnectedCallback(){this.removeAttribute("tabindex"),this.classList.remove("disabled"),this.classList.remove("hibernated"),__privateGet(this,_controlsCSSProperty).unobserve(),__privateGet(this,_axisCSSProperty).unobserve(),__privateGet(this,_reverseCSSProperty).unobserve(),__privateGet(this,_directionCSSProperty).unobserve(),__privateGet(this,_pagesCSSProperty).unobserve(),__privateGet(this,_splitCSSProperty).unobserve(),__privateGet(this,_sectionalCSSProperty).unobserve(),__privateGet(this,_easingCSSProperty).unobserve(),__privateGet(this,_durationCSSProperty).unobserve(),__privateGet(this,_autoSizeCSSProperty).unobserve(),__privateGet(this,_wheelMaxDeltaCSSProperty).unobserve(),__privateGet(this,_dragInertionCSSProperty).unobserve(),__privateGet(this,_sectionsInViewCSSProperty).unobserve(),__privateGet(this,_loopCSSProperty).unobserve(),__privateGet(this,_dampingCSSProperty).unobserve(),__privateGet(this,_massCSSProperty).unobserve(),__privateGet(this,_stiffnessCSSProperty).unobserve(),__privateGet(this,_mouseDragCSSProperty).unobserve(),__privateGet(this,_sectionDistanceScaleCSSProperty).unobserve(),__privateGet(this,_startSectionCSSProperty).unobserve(),__privateGet(this,_autoplayCSSProperty).unobserve(),__privateGet(this,_autoplayPauseDurationCSSProperty).unobserve(),__privateGet(this,_autoplayUserDirectionCSSProperty).unobserve(),__privateGet(this,_classesCSSProperty).unobserve(),__privateGet(this,_currentIndexStartOffsetCSSProperty).unobserve(),__privateGet(this,_currentIndexEndOffsetCSSProperty).unobserve(),__privateGet(this,_shiftSectionPositionCSSProperty).unobserve(),__privateGet(this,_focusDelayCSSProperty).unobserve(),__privateGet(this,_focusDurationCSSProperty).unobserve(),__privateGet(this,_shiftLimitCSSProperty).unobserve(),__privateGet(this,_disabledCSSProperty).unobserve(),__privateGet(this,_hibernatedCSSProperty).unobserve(),windowResizer_index.windowResizer.unsubscribe(__privateGet(this,_connectListener)),windowResizer_index.windowResizer.unsubscribe(__privateGet(this,_resizeListener)),elementResizer_index.elementResizer.unsubscribe(__privateGet(this,_resizeListener)),__privateMethod(this,_ScrollElement_instances,hibernate_fn).call(this),__privateGet(this,_mutationObserver).disconnect()}};_damped=new WeakMap,_controlsCSSProperty=new WeakMap,_axisCSSProperty=new WeakMap,_reverseCSSProperty=new WeakMap,_directionCSSProperty=new WeakMap,_pagesCSSProperty=new WeakMap,_splitCSSProperty=new WeakMap,_sectionalCSSProperty=new WeakMap,_easingCSSProperty=new WeakMap,_durationCSSProperty=new WeakMap,_autoSizeCSSProperty=new WeakMap,_wheelMaxDeltaCSSProperty=new WeakMap,_dragInertionCSSProperty=new WeakMap,_sectionsInViewCSSProperty=new WeakMap,_loopCSSProperty=new WeakMap,_dampingCSSProperty=new WeakMap,_massCSSProperty=new WeakMap,_stiffnessCSSProperty=new WeakMap,_mouseDragCSSProperty=new WeakMap,_sectionDistanceScaleCSSProperty=new WeakMap,_startSectionCSSProperty=new WeakMap,_autoplayCSSProperty=new WeakMap,_autoplayPauseDurationCSSProperty=new WeakMap,_autoplayUserDirectionCSSProperty=new WeakMap,_classesCSSProperty=new WeakMap,_currentIndexStartOffsetCSSProperty=new WeakMap,_currentIndexEndOffsetCSSProperty=new WeakMap,_shiftSectionPositionCSSProperty=new WeakMap,_focusDelayCSSProperty=new WeakMap,_focusDurationCSSProperty=new WeakMap,_shiftLimitCSSProperty=new WeakMap,_disabledCSSProperty=new WeakMap,_hibernatedCSSProperty=new WeakMap,_contentWrapperElement=new WeakMap,_contentElement=new WeakMap,_slotElement=new WeakMap,_sections=new WeakMap,_visibleSections=new WeakMap,_position2=new WeakMap,_contentPosition=new WeakMap,_viewportSize=new WeakMap,_scrollSize=new WeakMap,_gap=new WeakMap,_wheelControls=new WeakMap,_keyboardControls=new WeakMap,_dragControls=new WeakMap,_autoplayControls=new WeakMap,_counter=new WeakMap,_overscroll=new WeakMap,_distance=new WeakMap,_hasOverflow=new WeakMap,_disabled=new WeakMap,_hibernated=new WeakMap,_focusTimeoutId=new WeakMap,_tweenTimeoutId=new WeakMap,_setTween=new WeakMap,_isGrabbing=new WeakMap,_scrollLine=new WeakMap,_isConnected=new WeakMap,_mutationObserver=new WeakMap,_currentSections=new WeakMap,_skipNextResize=new WeakMap,_maxSectionSizeTimeoutId=new WeakMap,_ScrollElement_instances=new WeakSet,updateAxis_fn=__name(function(){const axis=__privateGet(this,_axisCSSProperty).current,reverse=__privateGet(this,_reverseCSSProperty).current?"-reverse":"";__privateGet(this,_contentElement).style.flexDirection=axis==="x"?`row${reverse}`:`column${reverse}`,__privateGet(this,_wheelControls).axis=__privateGet(this,_wheelMaxDeltaCSSProperty).current?"max":axis,__privateGet(this,_keyboardControls).dimension=axis==="x"?"width":"height",__privateGet(this,_dragControls).axis=axis,axis==="x"?this.style.touchAction="pan-y":axis==="y"&&(this.style.touchAction="pan-x"),__privateGet(this,_isConnected)&&__privateGet(this,_resizeListener).call(this)},"#updateAxis"),split_fn=__name(function(){__privateMethod(this,_ScrollElement_instances,unsplit_fn).call(this),__privateGet(this,_slotElement).assignedElements().forEach((element2,i)=>{element2 instanceof HTMLElement&&element2.tagName!=="SCRIPT"&&__privateGet(this,_sections).push(new ScrollSection(element2,i,this))}),__privateSet(this,_visibleSections,[...__privateGet(this,_sections)]),__privateGet(this,_contentElement).style.transform="",events.dispatchEvent(this,"scrollSectionsChange",{custom:!0,composed:!0}),__privateGet(this,_resizeListener).call(this),__privateMethod(this,_ScrollElement_instances,updateMarks_fn).call(this)},"#split"),unsplit_fn=__name(function(){__privateGet(this,_sections).forEach(section=>{section.destroy()}),__privateSet(this,_sections,[]),__privateSet(this,_visibleSections,[]),__privateGet(this,_counter).reset(),__privateGet(this,_damped).reset(),this.style.removeProperty("--max-section-size"),events.dispatchEvent(this,"scrollSectionsChange",{custom:!0,composed:!0})},"#unsplit"),disable_fn=__name(function(){__privateGet(this,_disabled)||(__privateSet(this,_disabled,!0),__privateGet(this,_damped).unsubscribe(__privateGet(this,_animatedChangeListener)),__privateGet(this,_damped).unlistenAnimationFrame(),clearInterval(__privateGet(this,_focusTimeoutId)),clearInterval(__privateGet(this,_tweenTimeoutId)),__privateGet(this,_setTween).unlistenAnimationFrame(),__privateGet(this,_wheelControls).disconnect(),__privateGet(this,_keyboardControls).disconnect(),__privateGet(this,_dragControls).disconnect(),__privateGet(this,_autoplayControls).disconnect(),__privateGet(this,_hasOverflow)||(this.sections.forEach(section=>{section.unsetTransform()}),__privateGet(this,_resizeListener).call(this)))},"#disable"),enable_fn=__name(function(){__privateGet(this,_disabled)&&(__privateSet(this,_disabled,!1),__privateGet(this,_damped).subscribe(__privateGet(this,_animatedChangeListener),-1e4),__privateGet(this,_damped).notify(),__privateGet(this,_wheelControls).connect(),__privateGet(this,_keyboardControls).connect(),__privateGet(this,_dragControls).connect(),__privateGet(this,_autoplayCSSProperty).current&&__privateGet(this,_autoplayControls).connect())},"#enable"),hibernate_fn=__name(function(){__privateGet(this,_hibernated)||(__privateSet(this,_hibernated,!0),clearTimeout(__privateGet(this,_maxSectionSizeTimeoutId)),windowResizer_index.windowResizer.unsubscribe(__privateGet(this,_resizeListener)),__privateMethod(this,_ScrollElement_instances,disable_fn).call(this),__privateGet(this,_contentElement).style.transform="",__privateGet(this,_contentElement).style.height="",__privateGet(this,_contentElement).style.width="",this.classList.remove("has-overflow","start","end"),this.style.removeProperty("--counter"),__privateGet(this,_sections).length?__privateMethod(this,_ScrollElement_instances,unsplit_fn).call(this):(__privateGet(this,_counter).reset(),__privateGet(this,_damped).reset()),scrollEntries_index.scrollEntries.unregister(this))},"#hibernate"),awake_fn=__name(function(){__privateGet(this,_hibernated)&&(__privateSet(this,_hibernated,!1),scrollEntries_index.scrollEntries.register(this),this.tryResplit(),__privateMethod(this,_ScrollElement_instances,enable_fn).call(this),this.scrollToSection(__privateGet(this,_startSectionCSSProperty).current,{behaviour:"instant"}),windowResizer_index.windowResizer.subscribe(__privateGet(this,_resizeListener),order_index.RESIZE_ORDER.SCROLL))},"#awake"),_resizeListener=new WeakMap,_animatedChangeListener=new WeakMap,clampCounter_fn=__name(function(value){let counter=__privateGet(this,_counter).current;return __privateGet(this,_loopCSSProperty).current?counter=number.loopNumber(value,__privateGet(this,_visibleSections).length):counter=math.clamp(value,0,this.limit),counter},"#clampCounter"),_notAutoplayControlListener=new WeakMap,_controlsListener=new WeakMap,processAutoplay_fn=__name(function(direction=1){__privateGet(this,_autoplayUserDirectionCSSProperty).current&&(__privateGet(this,_autoplayControls).direction=direction),__privateGet(this,_autoplayCSSProperty).current&&__privateGet(this,_autoplayControls).pauseAndContinue(__privateGet(this,_autoplayPauseDurationCSSProperty).current,this.sectionalCSSProperty.current)},"#processAutoplay"),getScrollValue_fn=__name(function(type="current"){if(__privateGet(this,_loopCSSProperty).current&&__privateGet(this,_visibleSections).length){const mod=Math.floor(__privateGet(this,_damped)[type])%Math.floor(__privateGet(this,_scrollSize)+__privateGet(this,_viewportSize)+__privateGet(this,_gap));return mod<0?__privateGet(this,_scrollSize)+mod+__privateGet(this,_viewportSize)+__privateGet(this,_gap):mod}else return __privateGet(this,_damped)[type]},"#getScrollValue"),updateMarks_fn=__name(function(){if(__privateGet(this,_visibleSections).length){const counter=__privateGet(this,_counter).current+__privateGet(this,_currentIndexStartOffsetCSSProperty).current;if(counter===__privateGet(this,_currentIndexStartOffsetCSSProperty).current?__privateSet(this,_scrollLine,"start"):counter===this.limit?__privateSet(this,_scrollLine,"end"):__privateSet(this,_scrollLine,null),events.dispatchEvent(this,"scrollLine",{detail:{line:__privateGet(this,_scrollLine)}}),__privateGet(this,_classesCSSProperty).current){this.classList.remove("end","start"),__privateGet(this,_scrollLine)&&this.classList.add(__privateGet(this,_scrollLine));const sectionsInView=__privateGet(this,_sectionsInViewCSSProperty).current+__privateGet(this,_currentIndexEndOffsetCSSProperty).current;__privateSet(this,_currentSections,[]),__privateGet(this,_visibleSections).forEach((section,index)=>{section.setCurrentIndex(null),section.setCurrentIndexArc(null),section.setCurrentIndexArcAbs(null),section.setMiddle(!1);const overflow=counter-this.limit-1+__privateGet(this,_currentIndexEndOffsetCSSProperty).current,currentRange=counter+sectionsInView,vv=this.sections.length-currentRange;index>=counter&&index<currentRange||index<=overflow?(section.setMark("current"),__privateGet(this,_currentSections).push(section)):index>=currentRange&&index<currentRange+vv/2||index<=overflow+sectionsInView?section.setMark("next"):section.setMark("previous")}),__privateGet(this,_updateMaxSectionsSize).call(this)}}},"#updateMarks"),updateIndexes_fn=__name(function(){if(__privateGet(this,_classesCSSProperty).current){const middle=Math.floor(__privateGet(this,_currentSections).length/2);__privateGet(this,_currentSections).sort((a,b)=>a.element.getBoundingClientRect().left-b.element.getBoundingClientRect().left),__privateGet(this,_currentSections).forEach((section,i)=>{const arcIndex=i-middle;section.setCurrentIndex(i),section.setCurrentIndexArc(arcIndex),section.setCurrentIndexArcAbs(Math.abs(arcIndex)),section.setMiddle(i===middle)}),__privateGet(this,_visibleSections).forEach((section,i)=>{section.setOffsetIndex(i-(__privateGet(this,_counter).current+__privateGet(this,_sectionsInViewCSSProperty).current))})}},"#updateIndexes"),_updateMaxSectionsSize=new WeakMap,getNearestSectionIndex_fn=__name(function(NAMEIT=!1){let scrollValue=this.targetScrollValue,minDiff=1/0,nearestIndex=0;const dir=__privateGet(this,_damped).direction;for(let i=0;i<__privateGet(this,_visibleSections).length;i++){const section=__privateGet(this,_visibleSections)[i];let offset=__privateGet(this,_isGrabbing)?section.size*dir*-1*.4:0,position=section.position;this.overscroll&&position===0&&NAMEIT&&(position=__privateGet(this,_distance));let diff=Math.abs(position+offset-scrollValue);diff<=minDiff&&(minDiff=diff,nearestIndex=i)}return nearestIndex},"#getNearestSectionIndex"),_connectListener=new WeakMap,__name(_ScrollElement,"ScrollElement");let ScrollElement=_ScrollElement;Store.isBrowser&&!customElements.get("e-scroll")&&customElements.define("e-scroll",ScrollElement);var _scrollElement2;const _ScrollUserElement=class _ScrollUserElement extends HTMLElement{constructor(){super(...arguments);__privateAdd(this,_scrollElement2,null)}get scrollElement(){return __privateGet(this,_scrollElement2)}connectedCallback(){const scrollElement=dom.findParentElement(this,ScrollElement);scrollElement instanceof ScrollElement?__privateSet(this,_scrollElement2,scrollElement):console.error(this,"e-scroll not found")}};_scrollElement2=new WeakMap,__name(_ScrollUserElement,"ScrollUserElement");let ScrollUserElement=_ScrollUserElement;var _slotElement2,_thumbElement,_isHorisontal,_thumbSize,_thumbScrollSize,_position3,_resizeListener2,_scrollListener,_axisListener,_grabListener;const _ScrollScrollbarElement=class _ScrollScrollbarElement extends ScrollUserElement{constructor(){super();__privateAdd(this,_slotElement2,null);__privateAdd(this,_thumbElement,null);__privateAdd(this,_isHorisontal,!1);__privateAdd(this,_thumbSize,0);__privateAdd(this,_thumbScrollSize,0);__privateAdd(this,_position3,0);__privateAdd(this,_resizeListener2,__name(()=>{__privateSet(this,_isHorisontal,this.offsetWidth>this.offsetHeight);const barSize=__privateGet(this,_isHorisontal)?this.offsetWidth:this.offsetHeight;__privateSet(this,_thumbSize,barSize/((this.scrollElement.scrollSize+this.scrollElement.viewportSize)/barSize)),__privateSet(this,_thumbSize,Math.max(__privateGet(this,_thumbSize),30)),__privateGet(this,_isHorisontal)?(__privateGet(this,_thumbElement).style.width=__privateGet(this,_thumbSize)+"px",__privateGet(this,_thumbElement).style.height="100%"):(__privateGet(this,_thumbElement).style.width="100%",__privateGet(this,_thumbElement).style.height=__privateGet(this,_thumbSize)+"px"),__privateSet(this,_thumbScrollSize,barSize-__privateGet(this,_thumbSize)),this.scrollElement.scrollSize<=0?this.style.display="none":this.style.display="",__privateGet(this,_scrollListener).call(this)},"#resizeListener"));__privateAdd(this,_scrollListener,__name(()=>{__privateSet(this,_position3,this.scrollElement.currentProgress*__privateGet(this,_thumbScrollSize)),__privateGet(this,_isHorisontal)?__privateGet(this,_thumbElement).style.transform=`translate3d(${__privateGet(this,_position3)}px, 0px, 0px)`:__privateGet(this,_thumbElement).style.transform=`translate3d(0px, ${__privateGet(this,_position3)}px, 0px)`},"#scrollListener"));__privateAdd(this,_axisListener,__name(()=>{this.setAttribute("axis",this.scrollElement.axisCSSProperty.current)},"#axisListener"));__privateAdd(this,_grabListener,__name(grabEvent=>{gestures.setupDrag(moveEvent=>{const moveCursor=__privateGet(this,_isHorisontal)?moveEvent.x:moveEvent.y,mult=this.scrollElement.distance/__privateGet(this,_thumbScrollSize),delta=(moveCursor-grabCursor)*mult;this.scrollElement.setPosition(startValue+delta)});const startValue=this.scrollElement.damped.target,grabCursor=__privateGet(this,_isHorisontal)?grabEvent.x:grabEvent.y},"#grabListener"));if(Store.isBrowser){const shadow=this.attachShadow({mode:"open"});shadow.adoptedStyleSheets=[stylesheet$1.createStylesheet({":host":{display:"inline-block",zIndex:"1",backgroundColor:"#ebebeb"},':host([axis="y"])':{position:"absolute",right:"0",top:"0",width:"1vmin",height:"100%"},':host([axis="x"])':{position:"absolute",left:"0",bottom:"0",width:"100%",height:"1vmin"},".default-thumb":{backgroundColor:"var(--thumb-color, black)",borderRadius:"var(--thumb-radius, 0px)",touchAction:"none"},"::slotted(*)":{touchAction:"none"}})],__privateSet(this,_slotElement2,document.createElement("slot")),__privateGet(this,_slotElement2).innerHTML='<div class="default-thumb"></div>',shadow.appendChild(__privateGet(this,_slotElement2))}}get thumbElement(){return __privateGet(this,_thumbElement)}connectedCallback(){super.connectedCallback(),this.setAttribute("drag-dead-zone","");const slottedThumb=__privateGet(this,_slotElement2).assignedElements()[0]||__privateGet(this,_slotElement2).firstElementChild;__privateSet(this,_thumbElement,slottedThumb),__privateGet(this,_thumbElement).addEventListener("pointerdown",__privateGet(this,_grabListener)),windowResizer_index.windowResizer.subscribe(__privateGet(this,_resizeListener2),order_index.RESIZE_ORDER.SCROLL),elementResizer_index.elementResizer.subscribe(this,__privateGet(this,_resizeListener2)),elementResizer_index.elementResizer.subscribe(this.scrollElement,__privateGet(this,_resizeListener2)),this.scrollElement.onScroll(__privateGet(this,_scrollListener)),this.scrollElement.axisCSSProperty.subscribe(__privateGet(this,_axisListener))}disconnectedCallback(){this.removeAttribute("drag-dead-zone"),this.style.display="",__privateGet(this,_thumbElement).removeEventListener("pointerdown",__privateGet(this,_grabListener)),windowResizer_index.windowResizer.unsubscribe(__privateGet(this,_resizeListener2)),elementResizer_index.elementResizer.unsubscribe(__privateGet(this,_resizeListener2)),this.scrollElement.offScroll(__privateGet(this,_scrollListener)),this.scrollElement.axisCSSProperty.unsubscribe(__privateGet(this,_axisListener))}};_slotElement2=new WeakMap,_thumbElement=new WeakMap,_isHorisontal=new WeakMap,_thumbSize=new WeakMap,_thumbScrollSize=new WeakMap,_position3=new WeakMap,_resizeListener2=new WeakMap,_scrollListener=new WeakMap,_axisListener=new WeakMap,_grabListener=new WeakMap,__name(_ScrollScrollbarElement,"ScrollScrollbarElement");let ScrollScrollbarElement=_ScrollScrollbarElement;Store.isBrowser&&!customElements.get("e-scroll-scrollbar")&&customElements.define("e-scroll-scrollbar",ScrollScrollbarElement);var _behaviour,_easing,_duration;const _ScrollButtonElement=class _ScrollButtonElement extends ScrollUserElement{constructor(){super();__privateAdd(this,_behaviour,new cssProperty_index.CSSProperty(this,"--behaviour","smooth"));__privateAdd(this,_easing,new cssProperty_index.CSSProperty(this,"--tween-easing",!1));__privateAdd(this,_duration,new cssProperty_index.CSSProperty(this,"--tween-duration",0));Store.isBrowser&&this.addEventListener("click",()=>{const behaviour=__privateGet(this,_behaviour).current,easing=__privateGet(this,_easing).current,duration=__privateGet(this,_duration).current;this.handleClick({behaviour,tween:easing||duration?{easing,duration}:void 0})})}connectedCallback(){super.connectedCallback(),this.hasAttribute("tabindex")||this.setAttribute("tabindex","0"),this.hasAttribute("role")||this.setAttribute("role","button"),__privateGet(this,_behaviour).observe(),__privateGet(this,_easing).observe(),__privateGet(this,_duration).observe()}disconnectedCallback(){this.removeAttribute("tabindex"),this.removeAttribute("role"),__privateGet(this,_behaviour).close(),__privateGet(this,_easing).close(),__privateGet(this,_duration).close()}};_behaviour=new WeakMap,_easing=new WeakMap,_duration=new WeakMap,__name(_ScrollButtonElement,"ScrollButtonElement");let ScrollButtonElement=_ScrollButtonElement;var _set;const _ScrollSetButtonElement=class _ScrollSetButtonElement extends ScrollButtonElement{constructor(){super(...arguments);__privateAdd(this,_set,new cssProperty_index.CSSProperty(this,"--set",1))}handleClick(options){this.scrollElement.scrollToSection(__privateGet(this,_set).current,options)}connectedCallback(){super.connectedCallback(),__privateGet(this,_set).observe()}disconnectedCallback(){super.disconnectedCallback(),__privateGet(this,_set).close()}};_set=new WeakMap,__name(_ScrollSetButtonElement,"ScrollSetButtonElement");let ScrollSetButtonElement=_ScrollSetButtonElement;Store.isBrowser&&!customElements.get("e-scroll-set-button")&&customElements.define("e-scroll-set-button",ScrollSetButtonElement);var _step,_scrollLineListener;const _ScrollStepButtonElement=class _ScrollStepButtonElement extends ScrollButtonElement{constructor(){super(...arguments);__privateAdd(this,_step,new cssProperty_index.CSSProperty(this,"--step",1));__privateAdd(this,_scrollLineListener,__name(()=>{this.scrollElement.loopCSSProperty.current?this.removeAttribute("disabled"):__privateGet(this,_step).current>0&&this.scrollElement.scrollLine==="end"||__privateGet(this,_step).current<0&&this.scrollElement.scrollLine==="start"?this.setAttribute("disabled",""):this.removeAttribute("disabled")},"#scrollLineListener"))}handleClick(options){this.scrollElement.shiftSections(__privateGet(this,_step).current,options)}connectedCallback(){super.connectedCallback(),this.scrollElement&&(__privateGet(this,_step).subscribe(()=>{__privateGet(this,_scrollLineListener).call(this)}),__privateGet(this,_step).observe(),this.scrollElement.addEventListener("scrollLine",__privateGet(this,_scrollLineListener)),__privateGet(this,_scrollLineListener).call(this))}disconnectedCallback(){super.disconnectedCallback(),__privateGet(this,_step).close(),this.removeAttribute("disabled")}};_step=new WeakMap,_scrollLineListener=new WeakMap,__name(_ScrollStepButtonElement,"ScrollStepButtonElement");let ScrollStepButtonElement=_ScrollStepButtonElement;Store.isBrowser&&!customElements.get("e-scroll-step-button")&&customElements.define("e-scroll-step-button",ScrollStepButtonElement);var _element2,_scrollElement3,_index2,_behaviour2,_clickListener,_counterChangeListener;const _BulletButton=class _BulletButton{constructor(scrollElement,index,behaviour){__privateAdd(this,_element2,null);__privateAdd(this,_scrollElement3,null);__privateAdd(this,_index2,null);__privateAdd(this,_behaviour2,null);__privateAdd(this,_clickListener,__name(()=>{__privateGet(this,_scrollElement3).scrollToSection(__privateGet(this,_index2),{behaviour:__privateGet(this,_behaviour2)})},"#clickListener"));__privateAdd(this,_counterChangeListener,__name(()=>{__privateGet(this,_element2).classList.toggle("current",__privateGet(this,_scrollElement3).counter.current===__privateGet(this,_index2))},"#counterChangeListener"));Store.isBrowser&&(__privateSet(this,_element2,document.createElement("button")),__privateGet(this,_element2).setAttribute("aria-label",`Go to section ${index+1}`),__privateSet(this,_scrollElement3,scrollElement),__privateSet(this,_behaviour2,behaviour),__privateSet(this,_index2,index),__privateGet(this,_element2).addEventListener("click",__privateGet(this,_clickListener)),__privateGet(this,_scrollElement3).counter.subscribe(__privateGet(this,_counterChangeListener)),__privateGet(this,_counterChangeListener).call(this))}get element(){return __privateGet(this,_element2)}destroy(){__privateGet(this,_element2).removeEventListener("click",__privateGet(this,_clickListener)),__privateGet(this,_scrollElement3).counter.unsubscribe(__privateGet(this,_counterChangeListener)),__privateGet(this,_element2).remove()}};_element2=new WeakMap,_scrollElement3=new WeakMap,_index2=new WeakMap,_behaviour2=new WeakMap,_clickListener=new WeakMap,_counterChangeListener=new WeakMap,__name(_BulletButton,"BulletButton");let BulletButton=_BulletButton;var _contentElement2,_buttons,_sectionsChangeListener;const _ScrollBulletButtonsElement=class _ScrollBulletButtonsElement extends ScrollUserElement{constructor(){super(...arguments);__privateAdd(this,_contentElement2,null);__privateAdd(this,_buttons,[]);__privateAdd(this,_sectionsChangeListener,_function.debounce(()=>{__privateGet(this,_buttons).forEach(b=>b.destroy()),__privateSet(this,_buttons,[]);let length=0;this.scrollElement.loopCSSProperty.current?length=this.scrollElement.visibleSections.length:length=this.scrollElement.visibleSections.length-Math.max(this.scrollElement.sectionsInViewCSSProperty.current-1,0);for(let index=0;index<length;index++){const button=new BulletButton(this.scrollElement,index,this.getAttribute("behaviour")||"smooth");__privateGet(this,_contentElement2).appendChild(button.element),__privateGet(this,_buttons).push(button)}},0))}connectedCallback(){super.connectedCallback(),this.innerHTML="",__privateSet(this,_contentElement2,document.createElement("div")),this.appendChild(__privateGet(this,_contentElement2)),this.scrollElement.addEventListener("scrollSectionsChange",__privateGet(this,_sectionsChangeListener)),this.scrollElement.sectionsInViewCSSProperty.subscribe(__privateGet(this,_sectionsChangeListener)),this.scrollElement.loopCSSProperty.subscribe(__privateGet(this,_sectionsChangeListener)),__privateGet(this,_sectionsChangeListener).call(this)}disconnectedCallback(){this.scrollElement.removeEventListener("scrollSectionsChange",__privateGet(this,_sectionsChangeListener)),this.scrollElement.sectionsInViewCSSProperty.unsubscribe(__privateGet(this,_sectionsChangeListener)),this.scrollElement.loopCSSProperty.unsubscribe(__privateGet(this,_sectionsChangeListener)),__privateGet(this,_buttons).forEach(b=>b.destroy()),__privateSet(this,_buttons,[]),__privateGet(this,_contentElement2).remove()}};_contentElement2=new WeakMap,_buttons=new WeakMap,_sectionsChangeListener=new WeakMap,__name(_ScrollBulletButtonsElement,"ScrollBulletButtonsElement");let ScrollBulletButtonsElement=_ScrollBulletButtonsElement;Store.isBrowser&&!customElements.get("e-scroll-bullet-buttons")&&customElements.define("e-scroll-bullet-buttons",ScrollBulletButtonsElement);var _dampingCSSProperty2,_massCSSProperty2,_stiffnessCSSProperty2,_targetCSSProperty,_disabledCSSProperty2,_distanceOffsetCSSProperty,_startOffsetCSSProperty,_captureOnceCSSProperty,_capturedCSSProperty,_releasedCSSProperty,_capturedFromStartCSSProperty,_capturedFromFinishCSSProperty,_releasedFromStartCSSProperty,_releasedFromFinishCSSProperty,_passedVarCSSProperty,_progressVarCSSProperty,_progressArcVarCSSProperty,_progressArcMultCSSProperty,_animationVarTypeCSSProperty,_distanceVarCSSProperty,_startVarCSSProperty,_finishVarCSSProperty,_isCaptured,_isReleased,_isCapturedFromStart,_isReleasedFromStart,_isCapturedFromFinish,_isReleasedFromFinish,_anotherScrollEntries,_targetElement,_directionPosition,_directionSize,_moverDirectionSize,_passed,_progress,_start,_distance2,_finish,_isResized,_isCapturedOnce,_isDisabled,_skipPassNotification,_ScrollSegmentElement_instances,captureListener_fn,releaseListener_fn,captureFromStartListener_fn,captureFromFinishListener_fn,releaseFromStartListener_fn,releaseFromFinishListener_fn,_resizeListener3,_tickListener,updateProgress_fn,handleClassSetting_fn,removeClasses_fn,removeVars_fn,removeCurrentMarks_fn;const _ScrollSegmentElement=class _ScrollSegmentElement extends ScrollUserElement{constructor(){super(...arguments);__privateAdd(this,_ScrollSegmentElement_instances);__privateAdd(this,_dampingCSSProperty2);__privateAdd(this,_massCSSProperty2);__privateAdd(this,_stiffnessCSSProperty2);__privateAdd(this,_targetCSSProperty);__privateAdd(this,_disabledCSSProperty2);__privateAdd(this,_distanceOffsetCSSProperty);__privateAdd(this,_startOffsetCSSProperty);__privateAdd(this,_captureOnceCSSProperty);__privateAdd(this,_capturedCSSProperty);__privateAdd(this,_releasedCSSProperty);__privateAdd(this,_capturedFromStartCSSProperty);__privateAdd(this,_capturedFromFinishCSSProperty);__privateAdd(this,_releasedFromStartCSSProperty);__privateAdd(this,_releasedFromFinishCSSProperty);__privateAdd(this,_passedVarCSSProperty);__privateAdd(this,_progressVarCSSProperty);__privateAdd(this,_progressArcVarCSSProperty);__privateAdd(this,_progressArcMultCSSProperty);__privateAdd(this,_animationVarTypeCSSProperty);__privateAdd(this,_distanceVarCSSProperty);__privateAdd(this,_startVarCSSProperty);__privateAdd(this,_finishVarCSSProperty);__privateAdd(this,_isCaptured);__privateAdd(this,_isReleased);__privateAdd(this,_isCapturedFromStart);__privateAdd(this,_isReleasedFromStart);__privateAdd(this,_isCapturedFromFinish);__privateAdd(this,_isReleasedFromFinish);__privateAdd(this,_anotherScrollEntries);__privateAdd(this,_targetElement);__privateAdd(this,_directionPosition);__privateAdd(this,_directionSize);__privateAdd(this,_moverDirectionSize);__privateAdd(this,_passed);__privateAdd(this,_progress);__privateAdd(this,_start);__privateAdd(this,_distance2);__privateAdd(this,_finish);__privateAdd(this,_isResized);__privateAdd(this,_isCapturedOnce);__privateAdd(this,_isDisabled);__privateAdd(this,_skipPassNotification);__privateAdd(this,_resizeListener3);__privateAdd(this,_tickListener);__privateSet(this,_dampingCSSProperty2,new cssProperty_index.CSSProperty(this,"--damping",20)),__privateSet(this,_massCSSProperty2,new cssProperty_index.CSSProperty(this,"--mass",0)),__privateSet(this,_stiffnessCSSProperty2,new cssProperty_index.CSSProperty(this,"--stiffness",0)),__privateSet(this,_targetCSSProperty,new cssProperty_index.CSSProperty(this,"--target","")),__privateSet(this,_disabledCSSProperty2,new cssProperty_index.CSSProperty(this,"--disabled",!1)),__privateSet(this,_distanceOffsetCSSProperty,new cssProperty_index.CSSProperty(this,"--distance-offset",0,{rawValueCheck:!1})),__privateSet(this,_startOffsetCSSProperty,new cssProperty_index.CSSProperty(this,"--start-offset",0,{rawValueCheck:!1})),__privateSet(this,_captureOnceCSSProperty,new cssProperty_index.CSSProperty(this,"--capture-once",!1)),__privateSet(this,_capturedCSSProperty,new cssProperty_index.CSSProperty(this,"--captured","")),__privateSet(this,_releasedCSSProperty,new cssProperty_index.CSSProperty(this,"--released","")),__privateSet(this,_capturedFromStartCSSProperty,new cssProperty_index.CSSProperty(this,"--captured-from-start","")),__privateSet(this,_capturedFromFinishCSSProperty,new cssProperty_index.CSSProperty(this,"--captured-from-finish","")),__privateSet(this,_releasedFromStartCSSProperty,new cssProperty_index.CSSProperty(this,"--released-from-start","")),__privateSet(this,_releasedFromFinishCSSProperty,new cssProperty_index.CSSProperty(this,"--released-from-finish","")),__privateSet(this,_passedVarCSSProperty,new cssProperty_index.CSSProperty(this,"--passed-var","")),__privateSet(this,_progressVarCSSProperty,new cssProperty_index.CSSProperty(this,"--progress-var","")),__privateSet(this,_progressArcVarCSSProperty,new cssProperty_index.CSSProperty(this,"--progress-arc-var","")),__privateSet(this,_progressArcMultCSSProperty,new cssProperty_index.CSSProperty(this,"--progress-arc-mult",1)),__privateSet(this,_animationVarTypeCSSProperty,new cssProperty_index.CSSProperty(this,"--animation-var-type","target")),__privateSet(this,_distanceVarCSSProperty,new cssProperty_index.CSSProperty(this,"--distance-var","")),__privateSet(this,_startVarCSSProperty,new cssProperty_index.CSSProperty(this,"--start-var","")),__privateSet(this,_finishVarCSSProperty,new cssProperty_index.CSSProperty(this,"--finish-var","")),__privateSet(this,_isCaptured,new Store.Store(!1)),__privateSet(this,_isReleased,new Store.Store(!1)),__privateSet(this,_isCapturedFromStart,new Store.Store(!1)),__privateSet(this,_isReleasedFromStart,new Store.Store(!1)),__privateSet(this,_isCapturedFromFinish,new Store.Store(!1)),__privateSet(this,_isReleasedFromFinish,new Store.Store(!1)),__privateSet(this,_anotherScrollEntries,[]),__privateSet(this,_targetElement,this),__privateSet(this,_directionPosition,0),__privateSet(this,_directionSize,0),__privateSet(this,_moverDirectionSize,0),__privateSet(this,_passed,new Damped.Damped(0,{order:order_index.TICK_ORDER.SEGMENT,min:0,max:1})),__privateSet(this,_progress,0),__privateSet(this,_start,0),__privateSet(this,_distance2,0),__privateSet(this,_finish,0),__privateSet(this,_isResized,!1),__privateSet(this,_isCapturedOnce,!1),__privateSet(this,_isDisabled,!0),__privateSet(this,_skipPassNotification,!1),this.resize=()=>{__privateSet(this,_directionSize,this.scrollElement.vertical?this.offsetHeight:this.offsetWidth),__privateSet(this,_directionPosition,this.scrollElement.vertical?layout.getCumulativeOffsetTop(this,this.scrollElement):layout.getCumulativeOffsetLeft(this,this.scrollElement));const stickyOffset=layout.getStickyOffset(this,this.scrollElement.vertical?"top":"left");__privateSet(this,_directionPosition,__privateGet(this,_directionPosition)-stickyOffset),__privateSet(this,_start,this.getStart()),__privateSet(this,_distance2,this.getDistance()),__privateSet(this,_start,__privateGet(this,_start)+__privateGet(this,_startOffsetCSSProperty).current),__privateSet(this,_distance2,__privateGet(this,_distance2)+__privateGet(this,_distanceOffsetCSSProperty).current),__privateSet(this,_finish,__privateGet(this,_start)+__privateGet(this,_distance2)),this.scrollElement.currentScrollValue>__privateGet(this,_finish)&&!__privateGet(this,_isCaptured).current&&!__privateGet(this,_isReleased).current&&(__privateGet(this,_isCaptured).current=!0),this.setVar(__privateGet(this,_startVarCSSProperty).current,__privateGet(this,_start)),this.setVar(__privateGet(this,_finishVarCSSProperty).current,__privateGet(this,_finish)),this.setVar(__privateGet(this,_distanceVarCSSProperty).current,__privateGet(this,_distance2)),__privateGet(this,_passed).max=__privateGet(this,_distance2),__privateSet(this,_isResized,!0),__privateGet(this,_tickListener).call(this)},this.findAnotherScrollEntries=_function.debounce(()=>{const allScrollEntriesAbove=scrollEntries_index.scrollEntries.getAll(this).reverse();let scrollIndex=0;allScrollEntriesAbove.forEach((entry,i)=>{entry.element===this.scrollElement&&(scrollIndex=i)}),__privateSet(this,_anotherScrollEntries,allScrollEntriesAbove.slice(scrollIndex+1)),this.tick()},0),__privateSet(this,_resizeListener3,()=>{__privateGet(this,_isDisabled)||this.resize()}),__privateSet(this,_tickListener,()=>{!__privateGet(this,_isDisabled)&&__privateGet(this,_isResized)&&this.tick()})}get distanceOffsetCSSProperty(){return __privateGet(this,_distanceOffsetCSSProperty)}get startOffsetCSSProperty(){return __privateGet(this,_startOffsetCSSProperty)}get captureOnceCSSProperty(){return __privateGet(this,_captureOnceCSSProperty)}get capturedCSSProperty(){return __privateGet(this,_capturedCSSProperty)}get releasedCSSProperty(){return __privateGet(this,_releasedCSSProperty)}get capturedFromStartCSSProperty(){return __privateGet(this,_capturedFromStartCSSProperty)}get capturedFromFinishCSSProperty(){return __privateGet(this,_capturedFromFinishCSSProperty)}get releasedFromStartCSSProperty(){return __privateGet(this,_releasedFromStartCSSProperty)}get releasedFromFinishCSSProperty(){return __privateGet(this,_releasedFromFinishCSSProperty)}get passedVarCSSProperty(){return __privateGet(this,_passedVarCSSProperty)}get progressVarCSSProperty(){return __privateGet(this,_progressVarCSSProperty)}get progressArcVarCSSProperty(){return __privateGet(this,_progressArcVarCSSProperty)}get progressArcMultCSSProperty(){return __privateGet(this,_progressArcMultCSSProperty)}get animationVarTypeCSSProperty(){return __privateGet(this,_animationVarTypeCSSProperty)}get distanceVarCSSProperty(){return __privateGet(this,_distanceVarCSSProperty)}get startVarCSSProperty(){return __privateGet(this,_startVarCSSProperty)}get finishVarCSSProperty(){return __privateGet(this,_finishVarCSSProperty)}get disabledCSSProperty(){return __privateGet(this,_disabledCSSProperty2)}get dampingCSSProperty(){return __privateGet(this,_dampingCSSProperty2)}get massCSSProperty(){return __privateGet(this,_massCSSProperty2)}get stiffnessCSSProperty(){return __privateGet(this,_stiffnessCSSProperty2)}get targetCSSProperty(){return __privateGet(this,_targetCSSProperty)}get isCaptured(){return __privateGet(this,_isCaptured)}get isReleased(){return __privateGet(this,_isReleased)}get isCapturedFromStart(){return __privateGet(this,_isCapturedFromStart)}get isReleasedFromStart(){return __privateGet(this,_isReleasedFromStart)}get isCapturedFromFinish(){return __privateGet(this,_isCapturedFromFinish)}get isReleasedFromFinish(){return __privateGet(this,_isReleasedFromFinish)}get directionPosition(){return __privateGet(this,_directionPosition)}get directionSize(){return __privateGet(this,_directionSize)}get passed(){return __privateGet(this,_passed)}get progress(){return __privateGet(this,_progress)}get progressArc(){return Math.abs(Math.cos(__privateGet(this,_progress)*Math.PI))*__privateGet(this,_progressArcMultCSSProperty).current}get start(){return __privateGet(this,_start)}get finish(){return __privateGet(this,_finish)}get distance(){return __privateGet(this,_distance2)}get isCapturedOnce(){return __privateGet(this,_isCapturedOnce)}get isDisabled(){return __privateGet(this,_isDisabled)}tick(){let scrollValue=this.scrollElement.currentScrollValue;__privateGet(this,_anotherScrollEntries).forEach(se=>{scrollValue+=se.value});const delta=scrollValue-__privateGet(this,_start);__privateGet(this,_skipPassNotification)||__privateSet(this,_skipPassNotification,__privateGet(this,_passed).previous?Math.abs(__privateGet(this,_passed).previous-delta)>1e3:!1),__privateGet(this,_passed).set(delta);const fscrollValue=Math.round(scrollValue);__privateGet(this,_isCaptured).current&&(fscrollValue>=__privateGet(this,_start)?__privateGet(this,_isCapturedFromStart).current||__privateMethod(this,_ScrollSegmentElement_instances,captureFromStartListener_fn).call(this):__privateGet(this,_isCapturedFromStart).current&&!__privateGet(this,_isReleasedFromStart).current&&__privateMethod(this,_ScrollSegmentElement_instances,releaseFromStartListener_fn).call(this),fscrollValue<__privateGet(this,_finish)?__privateGet(this,_isReleasedFromFinish).current&&!__privateGet(this,_isCapturedFromFinish).current&&__privateMethod(this,_ScrollSegmentElement_instances,captureFromFinishListener_fn).call(this):__privateGet(this,_isCapturedFromStart).current&&!__privateGet(this,_isReleasedFromFinish).current&&__privateMethod(this,_ScrollSegmentElement_instances,releaseFromFinishListener_fn).call(this)),fscrollValue>=__privateGet(this,_start)&&fscrollValue<__privateGet(this,_finish)?__privateGet(this,_isCaptured).current||__privateMethod(this,_ScrollSegmentElement_instances,captureListener_fn).call(this):__privateGet(this,_isCaptured).current&&(__privateGet(this,_passed).set(math.step(__privateGet(this,_distance2)/2,__privateGet(this,_passed).target,0,__privateGet(this,_distance2))),__privateMethod(this,_ScrollSegmentElement_instances,releaseListener_fn).call(this)),__privateGet(this,_isCapturedOnce)&&__privateGet(this,_captureOnceCSSProperty).current&&(__privateGet(this,_capturedCSSProperty).current&&__privateGet(this,_targetElement).classList.add(__privateGet(this,_capturedCSSProperty).current),__privateSet(this,_isDisabled,!0))}disable(){this.style.cssText="",__privateSet(this,_directionPosition,0),__privateSet(this,_directionSize,0),__privateGet(this,_passed).reset(),__privateSet(this,_progress,0),__privateSet(this,_start,0),__privateSet(this,_distance2,0),__privateSet(this,_finish,0),__privateSet(this,_isResized,!1),__privateGet(this,_isCaptured).current=!1,__privateGet(this,_isReleased).current=!1,__privateGet(this,_isCapturedFromStart).current=!1,__privateGet(this,_isReleasedFromStart).current=!1,__privateGet(this,_isCapturedFromFinish).current=!1,__privateGet(this,_isReleasedFromFinish).current=!1,__privateSet(this,_isCapturedOnce,!1),__privateSet(this,_isDisabled,!0),__privateMethod(this,_ScrollSegmentElement_instances,removeCurrentMarks_fn).call(this)}enable(){__privateSet(this,_isDisabled,!1)}connectedCallback(){super.connectedCallback(),__privateGet(this,_isCaptured).subscribe(state=>{state.current&&events.dispatchEvent(this,"scrollSegmentCapture",{composed:!0,custom:!0})}),__privateGet(this,_isCapturedFromStart).subscribe(state=>{state.current&&events.dispatchEvent(this,"scrollSegmentCaptureFromStart",{composed:!0,custom:!0})}),__privateGet(this,_isCapturedFromFinish).subscribe(state=>{state.current&&events.dispatchEvent(this,"scrollSegmentCaptureFromFinish",{composed:!0,custom:!0})}),__privateGet(this,_isReleased).subscribe(state=>{state.current&&events.dispatchEvent(this,"scrollSegmentRelease",{composed:!0,custom:!0})}),__privateGet(this,_isReleasedFromStart).subscribe(state=>{state.current&&events.dispatchEvent(this,"scrollSegmentReleaseFromStart",{composed:!0,custom:!0})}),__privateGet(this,_isReleasedFromFinish).subscribe(state=>{state.current&&events.dispatchEvent(this,"scrollSegmentReleaseFromFinish",{composed:!0,custom:!0})}),__privateGet(this,_dampingCSSProperty2).observe(),__privateGet(this,_massCSSProperty2).observe(),__privateGet(this,_stiffnessCSSProperty2).observe(),__privateGet(this,_targetCSSProperty).observe(),__privateGet(this,_disabledCSSProperty2).observe(),__privateGet(this,_distanceOffsetCSSProperty).observe(),__privateGet(this,_startOffsetCSSProperty).observe(),__privateGet(this,_captureOnceCSSProperty).observe(),__privateGet(this,_capturedCSSProperty).observe(),__privateGet(this,_releasedCSSProperty).observe(),__privateGet(this,_capturedFromStartCSSProperty).observe(),__privateGet(this,_capturedFromFinishCSSProperty).observe(),__privateGet(this,_releasedFromStartCSSProperty).observe(),__privateGet(this,_releasedFromFinishCSSProperty).observe(),__privateGet(this,_passedVarCSSProperty).observe(),__privateGet(this,_progressVarCSSProperty).observe(),__privateGet(this,_progressArcVarCSSProperty).observe(),__privateGet(this,_progressArcMultCSSProperty).observe(),__privateGet(this,_animationVarTypeCSSProperty).observe(),__privateGet(this,_distanceVarCSSProperty).observe(),__privateGet(this,_startVarCSSProperty).observe(),__privateGet(this,_finishVarCSSProperty).observe();let isConnected=!1;this.findAnotherScrollEntries(),__privateGet(this,_disabledCSSProperty2).current||this.enable(),__privateGet(this,_dampingCSSProperty2).subscribe(e=>{__privateGet(this,_passed).damping=e.current}),__privateGet(this,_massCSSProperty2).subscribe(e=>{__privateGet(this,_passed).mass=e.current}),__privateGet(this,_stiffnessCSSProperty2).subscribe(e=>{__privateGet(this,_passed).stiffness=e.current}),__privateGet(this,_targetCSSProperty).subscribe(e=>{e.previous&&__privateMethod(this,_ScrollSegmentElement_instances,removeCurrentMarks_fn).call(this),e.current?e.current==="parent"?__privateSet(this,_targetElement,this.parentElement||this):__privateSet(this,_targetElement,document.querySelector(e.current)||this):__privateSet(this,_targetElement,this)}),__privateGet(this,_disabledCSSProperty2).subscribe(e=>{e.current&&!e.previous?this.disable():!e.current&&e.previous&&(this.resize(),this.enable())}),__privateGet(this,_startOffsetCSSProperty).subscribe(()=>{isConnected&&!__privateGet(this,_isDisabled)&&this.resize()}),__privateGet(this,_distanceOffsetCSSProperty).subscribe(()=>{isConnected&&!__privateGet(this,_isDisabled)&&this.resize()}),__privateGet(this,_capturedCSSProperty).subscribe(e=>{__privateMethod(this,_ScrollSegmentElement_instances,handleClassSetting_fn).call(this,e)}),__privateGet(this,_capturedFromStartCSSProperty).subscribe(e=>{__privateMethod(this,_ScrollSegmentElement_instances,handleClassSetting_fn).call(this,e)}),__privateGet(this,_capturedFromFinishCSSProperty).subscribe(e=>{__privateMethod(this,_ScrollSegmentElement_instances,handleClassSetting_fn).call(this,e)}),__privateGet(this,_releasedCSSProperty).subscribe(e=>{__privateMethod(this,_ScrollSegmentElement_instances,handleClassSetting_fn).call(this,e)}),__privateGet(this,_releasedFromStartCSSProperty).subscribe(e=>{__privateMethod(this,_ScrollSegmentElement_instances,handleClassSetting_fn).call(this,e)}),__privateGet(this,_releasedFromFinishCSSProperty).subscribe(e=>{__privateMethod(this,_ScrollSegmentElement_instances,handleClassSetting_fn).call(this,e)}),__privateGet(this,_captureOnceCSSProperty).subscribe(v=>{__privateGet(this,_isDisabled)||!v.current&&v.previous&&(this.resize(),this.enable())}),__privateGet(this,_passedVarCSSProperty).subscribe(v=>{__privateGet(this,_isDisabled)||(this.removeVar(v.previous),this.setVar(v.current,this.passed.current))}),__privateGet(this,_progressVarCSSProperty).subscribe(v=>{__privateGet(this,_isDisabled)||(this.removeVar(v.previous),this.setVar(v.current,__privateGet(this,_progress)))}),__privateGet(this,_progressArcVarCSSProperty).subscribe(v=>{__privateGet(this,_isDisabled)||(this.removeVar(v.previous),this.setVar(v.current,this.progressArc))}),__privateGet(this,_progressArcMultCSSProperty).subscribe(v=>{__privateGet(this,_isDisabled)||__privateMethod(this,_ScrollSegmentElement_instances,updateProgress_fn).call(this)}),__privateGet(this,_startVarCSSProperty).subscribe(v=>{__privateGet(this,_isDisabled)||(this.removeVar(v.previous),this.setVar(v.current,__privateGet(this,_start)))}),__privateGet(this,_finishVarCSSProperty).subscribe(v=>{__privateGet(this,_isDisabled)||(this.removeVar(v.previous),this.setVar(v.current,__privateGet(this,_finish)))}),__privateGet(this,_distanceVarCSSProperty).subscribe(v=>{__privateGet(this,_isDisabled)||(this.removeVar(v.previous),this.setVar(v.current,__privateGet(this,_distance2)))}),__privateGet(this,_passed).subscribe(e=>{if(__privateGet(this,_skipPassNotification)){__privateSet(this,_skipPassNotification,!1);return}__privateMethod(this,_ScrollSegmentElement_instances,updateProgress_fn).call(this)}),this.scrollElement.addEventListener("scrollSectionsChange",this.findAnotherScrollEntries),this.scrollElement.addEventListener("scrollResize",this.resize),windowResizer_index.windowResizer.subscribe(__privateGet(this,_resizeListener3),order_index.RESIZE_ORDER.SCROLL+1),this.scrollElement.onScroll(__privateGet(this,_tickListener)),isConnected=!0}disconnectedCallback(){windowResizer_index.windowResizer.unsubscribe(__privateGet(this,_resizeListener3)),this.scrollElement.offScroll(__privateGet(this,_tickListener)),this.scrollElement.removeEventListener("scrollSectionsChange",this.findAnotherScrollEntries),this.scrollElement.removeEventListener("scrollResize",this.resize),__privateGet(this,_dampingCSSProperty2).close(),__privateGet(this,_massCSSProperty2).close(),__privateGet(this,_stiffnessCSSProperty2).close(),__privateGet(this,_targetCSSProperty).close(),__privateGet(this,_disabledCSSProperty2).close(),__privateGet(this,_distanceOffsetCSSProperty).close(),__privateGet(this,_startOffsetCSSProperty).close(),__privateGet(this,_captureOnceCSSProperty).close(),__privateGet(this,_capturedCSSProperty).close(),__privateGet(this,_releasedCSSProperty).close(),__privateGet(this,_capturedFromStartCSSProperty).close(),__privateGet(this,_capturedFromFinishCSSProperty).close(),__privateGet(this,_releasedFromStartCSSProperty).close(),__privateGet(this,_releasedFromFinishCSSProperty).close(),__privateGet(this,_passedVarCSSProperty).close(),__privateGet(this,_progressVarCSSProperty).close(),__privateGet(this,_progressArcVarCSSProperty).close(),__privateGet(this,_progressArcMultCSSProperty).close(),__privateGet(this,_distanceVarCSSProperty).close(),__privateGet(this,_startVarCSSProperty).close(),__privateGet(this,_finishVarCSSProperty).close(),__privateGet(this,_isCaptured).close(),__privateGet(this,_isReleased).close(),__privateGet(this,_isCapturedFromStart).close(),__privateGet(this,_isReleasedFromStart).close(),__privateGet(this,_isCapturedFromFinish).close(),__privateGet(this,_isReleasedFromFinish).close(),this.disable(),__privateGet(this,_passed).close()}removeVar(name){name&&__privateGet(this,_targetElement).style.removeProperty(`--${name}`)}setVar(name,value){if(name){const v=typeof value=="number"?value.toFixed(6):value;__privateGet(this,_targetElement).style.setProperty(`--${name}`,v)}}getDistance(){return __privateGet(this,_directionSize)+__privateGet(this,_moverDirectionSize)}getStart(){return __privateGet(this,_directionPosition)-__privateGet(this,_moverDirectionSize)}};_dampingCSSProperty2=new WeakMap,_massCSSProperty2=new WeakMap,_stiffnessCSSProperty2=new WeakMap,_targetCSSProperty=new WeakMap,_disabledCSSProperty2=new WeakMap,_distanceOffsetCSSProperty=new WeakMap,_startOffsetCSSProperty=new WeakMap,_captureOnceCSSProperty=new WeakMap,_capturedCSSProperty=new WeakMap,_releasedCSSProperty=new WeakMap,_capturedFromStartCSSProperty=new WeakMap,_capturedFromFinishCSSProperty=new WeakMap,_releasedFromStartCSSProperty=new WeakMap,_releasedFromFinishCSSProperty=new WeakMap,_passedVarCSSProperty=new WeakMap,_progressVarCSSProperty=new WeakMap,_progressArcVarCSSProperty=new WeakMap,_progressArcMultCSSProperty=new WeakMap,_animationVarTypeCSSProperty=new WeakMap,_distanceVarCSSProperty=new WeakMap,_startVarCSSProperty=new WeakMap,_finishVarCSSProperty=new WeakMap,_isCaptured=new WeakMap,_isReleased=new WeakMap,_isCapturedFromStart=new WeakMap,_isReleasedFromStart=new WeakMap,_isCapturedFromFinish=new WeakMap,_isReleasedFromFinish=new WeakMap,_anotherScrollEntries=new WeakMap,_targetElement=new WeakMap,_directionPosition=new WeakMap,_directionSize=new WeakMap,_moverDirectionSize=new WeakMap,_passed=new WeakMap,_progress=new WeakMap,_start=new WeakMap,_distance2=new WeakMap,_finish=new WeakMap,_isResized=new WeakMap,_isCapturedOnce=new WeakMap,_isDisabled=new WeakMap,_skipPassNotification=new WeakMap,_ScrollSegmentElement_instances=new WeakSet,captureListener_fn=__name(function(){__privateGet(this,_isCaptured).current=!0,__privateGet(this,_isReleased).current=!1,__privateSet(this,_isCapturedOnce,!0),__privateGet(this,_releasedCSSProperty).current&&__privateGet(this,_targetElement).classList.remove(__privateGet(this,_releasedCSSProperty).current),__privateGet(this,_releasedFromFinishCSSProperty).current&&__privateGet(this,_targetElement).classList.remove(__privateGet(this,_releasedFromFinishCSSProperty).current),__privateGet(this,_releasedFromFinishCSSProperty).current&&__privateGet(this,_targetElement).classList.remove(__privateGet(this,_releasedFromFinishCSSProperty).current),__privateGet(this,_capturedCSSProperty).current&&__privateGet(this,_targetElement).classList.add(__privateGet(this,_capturedCSSProperty).current)},"#captureListener"),releaseListener_fn=__name(function(){__privateGet(this,_isReleased).current=!0,__privateGet(this,_isCaptured).current=!1,__privateSet(this,_isCapturedOnce,!0),__privateGet(this,_capturedCSSProperty).current&&__privateGet(this,_targetElement).classList.remove(__privateGet(this,_capturedCSSProperty).current),__privateGet(this,_capturedFromStartCSSProperty).current&&__privateGet(this,_targetElement).classList.remove(__privateGet(this,_capturedFromStartCSSProperty).current),__privateGet(this,_capturedFromFinishCSSProperty).current&&__privateGet(this,_targetElement).classList.remove(__privateGet(this,_capturedFromFinishCSSProperty).current),__privateGet(this,_releasedCSSProperty).current&&__privateGet(this,_targetElement).classList.add(__privateGet(this,_releasedCSSProperty).current)},"#releaseListener"),captureFromStartListener_fn=__name(function(){__privateGet(this,_isCaptured).current=!0,__privateGet(this,_isCapturedFromStart).current=!0,__privateGet(this,_isReleasedFromStart).current=!1,__privateGet(this,_capturedFromStartCSSProperty).current&&__privateGet(this,_targetElement).classList.add(__privateGet(this,_capturedFromStartCSSProperty).current)},"#captureFromStartListener"),captureFromFinishListener_fn=__name(function(){__privateGet(this,_isCaptured).current=!0,__privateGet(this,_isCapturedFromFinish).current=!0,__privateGet(this,_isReleasedFromFinish).current=!1,__privateGet(this,_capturedFromFinishCSSProperty).current&&__privateGet(this,_targetElement).classList.add(__privateGet(this,_capturedFromFinishCSSProperty).current)},"#captureFromFinishListener"),releaseFromStartListener_fn=__name(function(){__privateGet(this,_isReleased).current=!0,__privateGet(this,_isReleasedFromStart).current=!0,__privateGet(this,_isCapturedFromStart).current=!1,__privateGet(this,_releasedFromFinishCSSProperty).current&&__privateGet(this,_targetElement).classList.add(__privateGet(this,_releasedFromFinishCSSProperty).current)},"#releaseFromStartListener"),releaseFromFinishListener_fn=__name(function(){__privateGet(this,_isReleased).current=!0,__privateGet(this,_isReleasedFromFinish).current=!0,__privateGet(this,_isCapturedFromFinish).current=!1,__privateGet(this,_releasedFromFinishCSSProperty).current&&__privateGet(this,_targetElement).classList.add(__privateGet(this,_releasedFromFinishCSSProperty).current)},"#releaseFromFinishListener"),_resizeListener3=new WeakMap,_tickListener=new WeakMap,updateProgress_fn=__name(function(){const passedValue=__privateGet(this,_passed)[__privateGet(this,_animationVarTypeCSSProperty).current];this.setVar(__privateGet(this,_passedVarCSSProperty).current,passedValue),__privateSet(this,_progress,passedValue/__privateGet(this,_distance2)||0),this.setVar(__privateGet(this,_progressVarCSSProperty).current,__privateGet(this,_progress)),__privateGet(this,_progressArcVarCSSProperty).current&&this.setVar(__privateGet(this,_progressArcVarCSSProperty).current,this.progressArc)},"#updateProgress"),handleClassSetting_fn=__name(function(e){if(__privateGet(this,_isDisabled)){e.previous&&__privateGet(this,_targetElement).classList.remove(e.previous),e.current&&__privateGet(this,_targetElement).classList.remove(e.current);return}e.current&&__privateGet(this,_isCaptured).current?(e.previous&&__privateGet(this,_targetElement).classList.remove(e.previous),__privateGet(this,_targetElement).classList.add(e.current)):!e.current&&e.previous&&__privateGet(this,_targetElement).classList.remove(e.previous)},"#handleClassSetting"),removeClasses_fn=__name(function(...className){className.forEach(c=>{c&&__privateGet(this,_targetElement).classList.remove(c)})},"#removeClasses"),removeVars_fn=__name(function(...vars){vars.forEach(v=>{v&&__privateGet(this,_targetElement).style.removeProperty(`--${v}`)})},"#removeVars"),removeCurrentMarks_fn=__name(function(){__privateMethod(this,_ScrollSegmentElement_instances,removeClasses_fn).call(this,__privateGet(this,_capturedCSSProperty).current,__privateGet(this,_capturedFromStartCSSProperty).current,__privateGet(this,_capturedFromFinishCSSProperty).current,__privateGet(this,_releasedCSSProperty).current,__privateGet(this,_releasedFromStartCSSProperty).current,__privateGet(this,_releasedFromFinishCSSProperty).current),__privateMethod(this,_ScrollSegmentElement_instances,removeVars_fn).call(this,__privateGet(this,_passedVarCSSProperty).current,__privateGet(this,_progressVarCSSProperty).current,__privateGet(this,_progressArcVarCSSProperty).current,__privateGet(this,_distanceVarCSSProperty).current,__privateGet(this,_startVarCSSProperty).current,__privateGet(this,_finishVarCSSProperty).current)},"#removeCurrentMarks"),__name(_ScrollSegmentElement,"ScrollSegmentElement");let ScrollSegmentElement=_ScrollSegmentElement;Store.isBrowser&&!customElements.get("e-scroll-segment")&&customElements.define("e-scroll-segment",ScrollSegmentElement);const _ScrollSectionButtonElement=class _ScrollSectionButtonElement extends ScrollButtonElement{handleClick(options){this.scrollElement.setPosition(this.scrollElement.vertical?layout.getCumulativeOffsetTop(this):layout.getCumulativeOffsetLeft(this),options)}connectedCallback(){super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback()}};__name(_ScrollSectionButtonElement,"ScrollSectionButtonElement");let ScrollSectionButtonElement=_ScrollSectionButtonElement;Store.isBrowser&&!customElements.get("e-scroll-section-button")&&customElements.define("e-scroll-section-button",ScrollSectionButtonElement);var _counterChangeListener2;const _ScrollCounterElement=class _ScrollCounterElement extends ScrollUserElement{constructor(){super(...arguments);__privateAdd(this,_counterChangeListener2,__name(()=>{const value=this.scrollElement.counter.current+1,pad=parseInt(this.getAttribute("pad")||"0");this.textContent=value.toString().padStart(pad,"0")},"#counterChangeListener"))}connectedCallback(){return __async(this,null,function*(){__superGet(_ScrollCounterElement.prototype,this,"connectedCallback").call(this),this.scrollElement.counter.subscribe(__privateGet(this,_counterChangeListener2))})}disconnectedCallback(){this.scrollElement.counter.unsubscribe(__privateGet(this,_counterChangeListener2))}};_counterChangeListener2=new WeakMap,__name(_ScrollCounterElement,"ScrollCounterElement");let ScrollCounterElement=_ScrollCounterElement;Store.isBrowser&&!customElements.get("e-scroll-counter")&&customElements.define("e-scroll-counter",ScrollCounterElement);var _sectionsChangeListener2;const _ScrollTotalElement=class _ScrollTotalElement extends ScrollUserElement{constructor(){super(...arguments);__privateAdd(this,_sectionsChangeListener2,__name(()=>{const value=this.scrollElement.limit+1,pad=parseInt(this.getAttribute("pad")||"0");this.textContent=value.toString().padStart(pad,"0")},"#sectionsChangeListener"))}connectedCallback(){return __async(this,null,function*(){__superGet(_ScrollTotalElement.prototype,this,"connectedCallback").call(this),this.scrollElement.sectionsInViewCSSProperty.subscribe(__privateGet(this,_sectionsChangeListener2)),this.scrollElement.addEventListener("scrollSectionsChange",__privateGet(this,_sectionsChangeListener2)),__privateGet(this,_sectionsChangeListener2).call(this)})}disconnectedCallback(){this.scrollElement.sectionsInViewCSSProperty.unsubscribe(__privateGet(this,_sectionsChangeListener2)),this.scrollElement.removeEventListener("scrollSectionsChange",__privateGet(this,_sectionsChangeListener2))}};_sectionsChangeListener2=new WeakMap,__name(_ScrollTotalElement,"ScrollTotalElement");let ScrollTotalElement=_ScrollTotalElement;Store.isBrowser&&!customElements.get("e-scroll-total")&&customElements.define("e-scroll-total",ScrollTotalElement);exports.ScrollBulletButtonsElement=ScrollBulletButtonsElement;exports.ScrollCounterElement=ScrollCounterElement;exports.ScrollElement=ScrollElement;exports.ScrollScrollbarElement=ScrollScrollbarElement;exports.ScrollSectionButtonElement=ScrollSectionButtonElement;exports.ScrollSegmentElement=ScrollSegmentElement;exports.ScrollSetButtonElement=ScrollSetButtonElement;exports.ScrollStepButtonElement=ScrollStepButtonElement;exports.ScrollTotalElement=ScrollTotalElement;
1
+ "use strict";var __defProp=Object.defineProperty;var __getOwnPropSymbols=Object.getOwnPropertySymbols,__getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__reflectGet=Reflect.get;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};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);var __superGet=(cls,obj,key)=>__reflectGet(__getProtoOf(cls),key,obj);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 order_index=require("../order/index.cjs"),Store=require("../Store-B96mD8mD.cjs"),_function=require("../function-H4b_gTg6.cjs");require("../index-BoGx2BWX.cjs");const math=require("../math-C-knY2TL.cjs"),number=require("../number-Bu4sGvW7.cjs"),Damped=require("../Damped-B_mVO810.cjs"),Tweened=require("../Tweened-BZoUkI7O.cjs"),DragControls=require("../DragControls-Cwnszjzf.cjs"),cssProperty_index=require("../css-property/index.cjs"),cssUnitParser_index=require("../css-unit-parser/index.cjs"),Viewport=require("../Viewport-Blxv_yl_.cjs"),elementResizer_index=require("../element-resizer/index.cjs"),scrollEntries_index=require("../scroll-entries/index.cjs"),element=require("../element-CqD0jqBJ.cjs"),events=require("../events-UlGk63iC.cjs"),layout=require("../layout-rR4-aYTY.cjs"),stylesheet$1=require("../stylesheet-DQv6_0na.cjs"),windowResizer_index=require("../window-resizer/index.cjs");require("construct-style-sheets-polyfill");const gestures=require("../gestures-DtYbQr49.cjs"),dom=require("../dom-B40i6NXw.cjs");var _element,_index,_scrollElement,_width,_height,_size,_position,_currentMark,_transformPosition,_ScrollSection_instances,setVar_fn;const _ScrollSection=class _ScrollSection{constructor(element2,index,scrollElement){__privateAdd(this,_ScrollSection_instances);__privateAdd(this,_element);__privateAdd(this,_index);__privateAdd(this,_scrollElement);__privateAdd(this,_width,0);__privateAdd(this,_height,0);__privateAdd(this,_size,0);__privateAdd(this,_position,0);__privateAdd(this,_currentMark,null);__privateAdd(this,_transformPosition,0);__privateSet(this,_element,element2),__privateSet(this,_index,index),__privateSet(this,_scrollElement,scrollElement),scrollEntries_index.scrollEntries.register(__privateGet(this,_element)),this.setIndex(__privateGet(this,_index))}get element(){return __privateGet(this,_element)}get index(){return __privateGet(this,_index)}get size(){return __privateGet(this,_size)}get width(){return __privateGet(this,_width)}get height(){return __privateGet(this,_height)}get position(){return __privateGet(this,_position)}get transformPosition(){return __privateGet(this,_transformPosition)}destroy(){scrollEntries_index.scrollEntries.unregister(__privateGet(this,_element)),this.unsetTransform()}unsetTransform(){__privateGet(this,_element).style.transform="",this.setMark(null),this.setIndex(null),this.setCurrentIndex(null),this.setCurrentIndexArc(null),this.setCurrentIndexArcAbs(null),this.setOffsetIndex(null),this.setMiddle(!1),this.setSize()}setSize(value){value?(__privateGet(this,_element).style.setProperty("--size",value+"px"),__privateGet(this,_scrollElement).axisCSSProperty.current==="x"?(__privateGet(this,_element).style.width=value+"px",__privateGet(this,_element).style.height=""):(__privateGet(this,_element).style.height=value+"px",__privateGet(this,_element).style.width="")):(__privateGet(this,_element).style.width="",__privateGet(this,_element).style.height="",__privateGet(this,_element).style.removeProperty("--size"))}resize(){__privateSet(this,_width,__privateGet(this,_element).offsetWidth),__privateSet(this,_height,__privateGet(this,_element).offsetHeight),__privateSet(this,_size,__privateGet(this,_scrollElement).vertical?__privateGet(this,_element).offsetHeight:__privateGet(this,_element).offsetWidth),__privateSet(this,_position,__privateGet(this,_scrollElement).vertical?layout.getCumulativeOffsetTop(__privateGet(this,_element)):layout.getCumulativeOffsetLeft(__privateGet(this,_element))),__privateSet(this,_position,__privateGet(this,_position)-__privateGet(this,_scrollElement).contentPosition)}transform(){const cssOffset=__privateGet(this,_scrollElement).shiftSectionPositionCSSProperty.current;let offset=cssOffset;const distanceAddition=__privateGet(this,_scrollElement).viewportSize*__privateGet(this,_scrollElement).sectionDistanceScaleCSSProperty.current;__privateGet(this,_scrollElement).loopCSSProperty.current&&__privateGet(this,_position)+__privateGet(this,_size)<=__privateGet(this,_scrollElement).currentScrollValue-cssOffset/2&&(offset=(__privateGet(this,_scrollElement).distance-cssOffset)*-1-__privateGet(this,_scrollElement).gap),scrollEntries_index.scrollEntries.update(__privateGet(this,_element),__privateGet(this,_scrollElement).axisCSSProperty.current,offset);const valueToClamp=__privateGet(this,_scrollElement).currentScrollValue+offset,min=__privateGet(this,_position)-__privateGet(this,_scrollElement).viewportSize-distanceAddition,max=__privateGet(this,_position)+__privateGet(this,_size)+distanceAddition,value=number.preciseNumber(math.clamp(valueToClamp,min,max),3);__privateSet(this,_transformPosition,value*-1),__privateGet(this,_scrollElement).vertical?__privateGet(this,_element).style.transform=`translate3d(0px, ${__privateGet(this,_transformPosition)}px, 0px)`:__privateGet(this,_element).style.transform=`translate3d(${__privateGet(this,_transformPosition)}px, 0px, 0px)`}setMark(mark){__privateGet(this,_currentMark)!==mark&&(__privateGet(this,_currentMark)&&__privateGet(this,_element).classList.remove(__privateGet(this,_currentMark)),mark&&__privateGet(this,_element).classList.add(mark),__privateSet(this,_currentMark,mark),events.dispatchEvent(__privateGet(this,_element),"scrollSectionMarkChange",{composed:!0,detail:{mark:__privateGet(this,_currentMark)},custom:!0}))}setMiddle(bool){__privateGet(this,_element).classList.toggle("middle",bool)}setIndex(value){__privateMethod(this,_ScrollSection_instances,setVar_fn).call(this,"index",value)}setCurrentIndex(value){__privateMethod(this,_ScrollSection_instances,setVar_fn).call(this,"current-index",value)}setCurrentIndexArc(value){__privateMethod(this,_ScrollSection_instances,setVar_fn).call(this,"current-index-arc",value)}setOffsetIndex(value){__privateMethod(this,_ScrollSection_instances,setVar_fn).call(this,"offset-index",value)}setCurrentIndexArcAbs(value){__privateMethod(this,_ScrollSection_instances,setVar_fn).call(this,"current-index-arc-abs",value)}};_element=new WeakMap,_index=new WeakMap,_scrollElement=new WeakMap,_width=new WeakMap,_height=new WeakMap,_size=new WeakMap,_position=new WeakMap,_currentMark=new WeakMap,_transformPosition=new WeakMap,_ScrollSection_instances=new WeakSet,setVar_fn=__name(function(name,value){value!==null?(__privateGet(this,_element).style.setProperty(`--${name}`,value.toString()),__privateGet(this,_element).setAttribute(`data-${name}`,value.toString())):(__privateGet(this,_element).style.removeProperty(`--${name}`),__privateGet(this,_element).removeAttribute(`data-${name}`))},"#setVar"),__name(_ScrollSection,"ScrollSection");let ScrollSection=_ScrollSection;const stylesheet=stylesheet$1.createStylesheet({":host":{position:"relative",width:"100%",height:"100%",display:"block",outline:"none"},".static":{position:"var(--static-position, absolute)",top:"var(--static-top, 0)",left:"var(--static-left, 0)",width:"var(--static-width, 100%)",height:"var(--static-height, 100%)"},".content-wrapper":{width:"var(--content-wrapper-width, 100%)",height:"var(--content-wrapper-height, 100%)",overflow:"var(--overflow, initial)",borderRadius:"var(--border-radius, unset)"},".content":{position:"relative",display:"flex",width:"100%",height:"100%",gap:"var(--gap, 0px)",willChange:"var(--will-change, transform)"},":host(.hibernated) .content-wrapper":{display:"contents"},":host(.hibernated) .content":{display:"contents"},"::slotted(*)":{flexShrink:"0"}});var _damped,_controlsCSSProperty,_axisCSSProperty,_reverseCSSProperty,_directionCSSProperty,_pagesCSSProperty,_splitCSSProperty,_sectionalCSSProperty,_easingCSSProperty,_durationCSSProperty,_autoSizeCSSProperty,_wheelMaxDeltaCSSProperty,_dragInertionCSSProperty,_sectionsInViewCSSProperty,_loopCSSProperty,_dampingCSSProperty,_massCSSProperty,_stiffnessCSSProperty,_mouseDragCSSProperty,_sectionDistanceScaleCSSProperty,_startSectionCSSProperty,_autoplayCSSProperty,_autoplayPauseDurationCSSProperty,_autoplayUserDirectionCSSProperty,_classesCSSProperty,_currentIndexStartOffsetCSSProperty,_currentIndexEndOffsetCSSProperty,_shiftSectionPositionCSSProperty,_focusDelayCSSProperty,_focusDurationCSSProperty,_shiftLimitCSSProperty,_disabledCSSProperty,_hibernatedCSSProperty,_contentWrapperElement,_contentElement,_slotElement,_sections,_visibleSections,_position2,_contentPosition,_viewportSize,_scrollSize,_gap,_wheelControls,_keyboardControls,_dragControls,_autoplayControls,_counter,_overscroll,_distance,_hasOverflow,_disabled,_hibernated,_focusTimeoutId,_tweenTimeoutId,_setTween,_isGrabbing,_scrollLine,_isConnected,_mutationObserver,_currentSections,_skipNextResize,_maxSectionSizeTimeoutId,_ScrollElement_instances,updateAxis_fn,split_fn,unsplit_fn,disable_fn,enable_fn,hibernate_fn,awake_fn,_resizeListener,_animatedChangeListener,clampCounter_fn,_notAutoplayControlListener,_controlsListener,processAutoplay_fn,getScrollValue_fn,updateMarks_fn,updateIndexes_fn,_updateMaxSectionsSize,getNearestSectionIndex_fn,_connectListener;const _ScrollElement=class _ScrollElement extends HTMLElement{constructor(){super();__privateAdd(this,_ScrollElement_instances);__privateAdd(this,_damped,null);__privateAdd(this,_controlsCSSProperty,new cssProperty_index.CSSProperty(this,"--controls",!0));__privateAdd(this,_axisCSSProperty,new cssProperty_index.CSSProperty(this,"--axis","y"));__privateAdd(this,_reverseCSSProperty,new cssProperty_index.CSSProperty(this,"--reverse",!1));__privateAdd(this,_directionCSSProperty,new cssProperty_index.CSSProperty(this,"--direction",0));__privateAdd(this,_pagesCSSProperty,new cssProperty_index.CSSProperty(this,"--pages",0,{validate:__name(v=>Math.max(0,v-1),"validate")}));__privateAdd(this,_splitCSSProperty,new cssProperty_index.CSSProperty(this,"--split",!1));__privateAdd(this,_sectionalCSSProperty,new cssProperty_index.CSSProperty(this,"--sectional",!1));__privateAdd(this,_easingCSSProperty,new cssProperty_index.CSSProperty(this,"--tween-easing",!1));__privateAdd(this,_durationCSSProperty,new cssProperty_index.CSSProperty(this,"--tween-duration",!1));__privateAdd(this,_autoSizeCSSProperty,new cssProperty_index.CSSProperty(this,"--auto-size",!1));__privateAdd(this,_wheelMaxDeltaCSSProperty,new cssProperty_index.CSSProperty(this,"--wheel-max-delta",!1));__privateAdd(this,_dragInertionCSSProperty,new cssProperty_index.CSSProperty(this,"--drag-inertion",1));__privateAdd(this,_sectionsInViewCSSProperty,new cssProperty_index.CSSProperty(this,"--sections-in-view",1));__privateAdd(this,_loopCSSProperty,new cssProperty_index.CSSProperty(this,"--loop",!1));__privateAdd(this,_dampingCSSProperty,new cssProperty_index.CSSProperty(this,"--damping",20));__privateAdd(this,_massCSSProperty,new cssProperty_index.CSSProperty(this,"--mass",0));__privateAdd(this,_stiffnessCSSProperty,new cssProperty_index.CSSProperty(this,"--stiffness",0));__privateAdd(this,_mouseDragCSSProperty,new cssProperty_index.CSSProperty(this,"--mouse-drag",!1));__privateAdd(this,_sectionDistanceScaleCSSProperty,new cssProperty_index.CSSProperty(this,"--section-distance-scale",.5));__privateAdd(this,_startSectionCSSProperty,new cssProperty_index.CSSProperty(this,"--start-section",0));__privateAdd(this,_autoplayCSSProperty,new cssProperty_index.CSSProperty(this,"--autoplay",0));__privateAdd(this,_autoplayPauseDurationCSSProperty,new cssProperty_index.CSSProperty(this,"--autoplay-pause-duration",0));__privateAdd(this,_autoplayUserDirectionCSSProperty,new cssProperty_index.CSSProperty(this,"--autoplay-user-direction",!1));__privateAdd(this,_classesCSSProperty,new cssProperty_index.CSSProperty(this,"--classes",!1));__privateAdd(this,_currentIndexStartOffsetCSSProperty,new cssProperty_index.CSSProperty(this,"--current-index-start-offset",0));__privateAdd(this,_currentIndexEndOffsetCSSProperty,new cssProperty_index.CSSProperty(this,"--current-index-end-offset",0));__privateAdd(this,_shiftSectionPositionCSSProperty,new cssProperty_index.CSSProperty(this,"--shift-section-position",0,{rawValueCheck:!1}));__privateAdd(this,_focusDelayCSSProperty,new cssProperty_index.CSSProperty(this,"--focus-delay",0));__privateAdd(this,_focusDurationCSSProperty,new cssProperty_index.CSSProperty(this,"--focus-duration",3e3));__privateAdd(this,_shiftLimitCSSProperty,new cssProperty_index.CSSProperty(this,"--shift-limit",0));__privateAdd(this,_disabledCSSProperty,new cssProperty_index.CSSProperty(this,"--disabled",!1));__privateAdd(this,_hibernatedCSSProperty,new cssProperty_index.CSSProperty(this,"--hibernate",!1));__privateAdd(this,_contentWrapperElement,null);__privateAdd(this,_contentElement,null);__privateAdd(this,_slotElement,null);__privateAdd(this,_sections,[]);__privateAdd(this,_visibleSections,[]);__privateAdd(this,_position2,0);__privateAdd(this,_contentPosition,0);__privateAdd(this,_viewportSize,0);__privateAdd(this,_scrollSize,0);__privateAdd(this,_gap,0);__privateAdd(this,_wheelControls,null);__privateAdd(this,_keyboardControls,null);__privateAdd(this,_dragControls,null);__privateAdd(this,_autoplayControls,null);__privateAdd(this,_counter,new Store.Store(0));__privateAdd(this,_overscroll,0);__privateAdd(this,_distance,0);__privateAdd(this,_hasOverflow,!1);__privateAdd(this,_disabled,!0);__privateAdd(this,_hibernated,!0);__privateAdd(this,_focusTimeoutId);__privateAdd(this,_tweenTimeoutId);__privateAdd(this,_setTween,new Tweened.Tweened);__privateAdd(this,_isGrabbing,!1);__privateAdd(this,_scrollLine,null);__privateAdd(this,_isConnected,!1);__privateAdd(this,_mutationObserver,null);__privateAdd(this,_currentSections,[]);__privateAdd(this,_skipNextResize,!1);__privateAdd(this,_maxSectionSizeTimeoutId);__privateAdd(this,_resizeListener,__name(e=>{if(e&&__privateGet(this,_skipNextResize)){__privateSet(this,_skipNextResize,!1);return}this.resize()},"#resizeListener"));__privateAdd(this,_animatedChangeListener,__name(()=>{if(!__privateGet(this,_hasOverflow)||__privateGet(this,_hibernated)||__privateGet(this,_disabled))return;const currentScrollValue=this.currentScrollValue;if(__privateSet(this,_overscroll,Math.max(0,currentScrollValue-__privateGet(this,_scrollSize))),__privateGet(this,_visibleSections).length){for(let i=0;i<__privateGet(this,_sections).length;i++)__privateGet(this,_sections)[i].transform();(__privateGet(this,_isGrabbing)||!__privateGet(this,_sectionalCSSProperty).current)&&(__privateGet(this,_counter).current=__privateMethod(this,_ScrollElement_instances,getNearestSectionIndex_fn).call(this))}else this.vertical?__privateGet(this,_contentElement).style.transform=`translate3d(0px, ${currentScrollValue*-1}px, 0px)`:__privateGet(this,_contentElement).style.transform=`translate3d(${currentScrollValue*-1}px, 0px, 0px)`;__privateMethod(this,_ScrollElement_instances,updateIndexes_fn).call(this),scrollEntries_index.scrollEntries.update(this,__privateGet(this,_axisCSSProperty).current,currentScrollValue)},"#animatedChangeListener"));__privateAdd(this,_notAutoplayControlListener,__name((type,value)=>{__privateGet(this,_controlsCSSProperty).current&&(__privateMethod(this,_ScrollElement_instances,processAutoplay_fn).call(this,Math.sign(value)||1),__privateGet(this,_controlsListener).call(this,type,value))},"#notAutoplayControlListener"));__privateAdd(this,_controlsListener,__name((type,value)=>{if(!__privateGet(this,_tweenTimeoutId)){if(__privateGet(this,_directionCSSProperty).current){if(__privateGet(this,_directionCSSProperty).current<0&&value>0)return;if(__privateGet(this,_directionCSSProperty).current>0&&value<0)return}if(!__privateGet(this,_autoplayCSSProperty).current&&__privateGet(this,_focusDelayCSSProperty).current&&(clearInterval(__privateGet(this,_focusTimeoutId)),__privateSet(this,_focusTimeoutId,setTimeout(()=>{const section=__privateGet(this,_visibleSections)[__privateMethod(this,_ScrollElement_instances,getNearestSectionIndex_fn).call(this)];section&&this.scrollToSection(section.index,{tween:{duration:__privateGet(this,_focusDurationCSSProperty).current,easing:Tweened.easeInOutExpo}})},__privateGet(this,_focusDelayCSSProperty).current))),!(type.includes("drag")&&!Viewport.device.isTouch&&!__privateGet(this,_mouseDragCSSProperty).current)){if(__privateGet(this,_sectionalCSSProperty).current&&type!=="drag"){const direction=Math.sign(value);__privateGet(this,_visibleSections).length?__privateGet(this,_isGrabbing)?this.scrollToSection(__privateMethod(this,_ScrollElement_instances,getNearestSectionIndex_fn).call(this,!0)):this.shiftSections(direction,{tween:__privateGet(this,_easingCSSProperty).current||__privateGet(this,_durationCSSProperty).current?{easing:__privateGet(this,_easingCSSProperty).current||"easeInOutCubic",duration:__privateGet(this,_durationCSSProperty).current||500}:void 0}):__privateGet(this,_damped).shift(direction*__privateGet(this,_viewportSize))}else __privateGet(this,_damped).shift(value);__privateSet(this,_isGrabbing,type==="drag")}}},"#controlsListener"));__privateAdd(this,_updateMaxSectionsSize,_function.debounce(()=>{const maxSectionSize=__privateGet(this,_currentSections).reduce((p,c)=>{const s=this.vertical?c.width:c.height;return s>p?s:p},0);clearTimeout(__privateGet(this,_maxSectionSizeTimeoutId)),__privateSet(this,_skipNextResize,!0),this.style.setProperty("--max-section-size",""),__privateSet(this,_maxSectionSizeTimeoutId,setTimeout(()=>{__privateSet(this,_skipNextResize,!0),this.style.setProperty("--max-section-size",maxSectionSize+"px")},10))},20));__privateAdd(this,_connectListener,__name(()=>{__privateSet(this,_isConnected,!0),this.hibernatedCSSProperty.current||__privateMethod(this,_ScrollElement_instances,awake_fn).call(this),elementResizer_index.elementResizer.subscribe(this,__privateGet(this,_resizeListener)),windowResizer_index.windowResizer.unsubscribe(__privateGet(this,_connectListener))},"#connectListener"));if(Store.isBrowser){const shadow=this.attachShadow({mode:"open"});shadow.adoptedStyleSheets=[stylesheet];const staticElement=document.createElement("div");staticElement.className="static",staticElement.innerHTML='<slot name="static"></slot>',shadow.appendChild(staticElement),__privateSet(this,_contentWrapperElement,document.createElement("div")),__privateGet(this,_contentWrapperElement).className="content-wrapper",__privateSet(this,_contentElement,document.createElement("div")),__privateGet(this,_contentElement).className="content",__privateSet(this,_slotElement,document.createElement("slot")),__privateGet(this,_contentElement).appendChild(__privateGet(this,_slotElement)),__privateGet(this,_contentWrapperElement).appendChild(__privateGet(this,_contentElement)),shadow.appendChild(__privateGet(this,_contentWrapperElement)),__privateSet(this,_mutationObserver,new MutationObserver(_function.debounce(()=>{this.tryResplit()},10)))}}get damped(){return __privateGet(this,_damped)}get controlsCSSProperty(){return __privateGet(this,_controlsCSSProperty)}get axisCSSProperty(){return __privateGet(this,_axisCSSProperty)}get reverseCSSProperty(){return __privateGet(this,_reverseCSSProperty)}get directionCSSProperty(){return __privateGet(this,_directionCSSProperty)}get pagesCSSProperty(){return __privateGet(this,_pagesCSSProperty)}get splitCSSProperty(){return __privateGet(this,_splitCSSProperty)}get sectionalCSSProperty(){return __privateGet(this,_sectionalCSSProperty)}get easingCSSProperty(){return __privateGet(this,_easingCSSProperty)}get durationCSSProperty(){return __privateGet(this,_durationCSSProperty)}get autoSizeCSSProperty(){return __privateGet(this,_autoSizeCSSProperty)}get wheelMaxDeltaCSSProperty(){return __privateGet(this,_wheelMaxDeltaCSSProperty)}get dragInertionCSSProperty(){return __privateGet(this,_dragInertionCSSProperty)}get sectionsInViewCSSProperty(){return __privateGet(this,_sectionsInViewCSSProperty)}get loopCSSProperty(){return __privateGet(this,_loopCSSProperty)}get dampingCSSProperty(){return __privateGet(this,_dampingCSSProperty)}get massCSSProperty(){return __privateGet(this,_massCSSProperty)}get stiffnessCSSProperty(){return __privateGet(this,_stiffnessCSSProperty)}get mouseDragCSSProperty(){return __privateGet(this,_mouseDragCSSProperty)}get sectionDistanceScaleCSSProperty(){return __privateGet(this,_sectionDistanceScaleCSSProperty)}get startSectionCSSProperty(){return __privateGet(this,_startSectionCSSProperty)}get autoplayCSSProperty(){return __privateGet(this,_autoplayCSSProperty)}get autoplayPauseDurationCSSProperty(){return __privateGet(this,_autoplayPauseDurationCSSProperty)}get autoplayUserDirectionCSSProperty(){return __privateGet(this,_autoplayUserDirectionCSSProperty)}get classesCSSProperty(){return __privateGet(this,_classesCSSProperty)}get currentIndexStartOffsetCSSProperty(){return __privateGet(this,_currentIndexStartOffsetCSSProperty)}get currentIndexEndOffsetCSSProperty(){return __privateGet(this,_currentIndexEndOffsetCSSProperty)}get shiftSectionPositionCSSProperty(){return __privateGet(this,_shiftSectionPositionCSSProperty)}get focusDelayCSSProperty(){return __privateGet(this,_focusDelayCSSProperty)}get focusDurationCSSProperty(){return __privateGet(this,_focusDurationCSSProperty)}get shiftLimitCSSProperty(){return __privateGet(this,_shiftLimitCSSProperty)}get disabledCSSProperty(){return __privateGet(this,_disabledCSSProperty)}get hibernatedCSSProperty(){return __privateGet(this,_hibernatedCSSProperty)}get currentScrollValue(){return __privateMethod(this,_ScrollElement_instances,getScrollValue_fn).call(this,"current")}get targetScrollValue(){return __privateMethod(this,_ScrollElement_instances,getScrollValue_fn).call(this,"target")}get contentWrapperElement(){return __privateGet(this,_contentWrapperElement)}get contentElement(){return __privateGet(this,_contentElement)}get sections(){return __privateGet(this,_sections)}get visibleSections(){return __privateGet(this,_visibleSections)}get position(){return __privateGet(this,_position2)}get contentPosition(){return __privateGet(this,_contentPosition)}get viewportSize(){return __privateGet(this,_viewportSize)}get scrollSize(){return __privateGet(this,_scrollSize)}get gap(){return __privateGet(this,_gap)}get counter(){return __privateGet(this,_counter)}get limit(){return Math.ceil(__privateGet(this,_visibleSections).length-__privateGet(this,_sectionsInViewCSSProperty).current+__privateGet(this,_shiftLimitCSSProperty).current)}get distance(){return __privateGet(this,_distance)}get loopDistance(){return __privateGet(this,_loopCSSProperty).current?__privateGet(this,_distance)+__privateGet(this,_gap):__privateGet(this,_distance)}get hasOverflow(){return __privateGet(this,_hasOverflow)}get overscroll(){return __privateGet(this,_overscroll)}get scrollLine(){return __privateGet(this,_scrollLine)}get vertical(){return __privateGet(this,_axisCSSProperty).current==="y"}get currentProgress(){return this.currentScrollValue/this.loopDistance||0}get targetProgress(){return this.targetScrollValue/this.loopDistance||0}get scrollWidth(){return __privateGet(this,_axisCSSProperty).current==="y"?0:__privateGet(this,_damped).distance}get scrollHeight(){return __privateGet(this,_axisCSSProperty).current==="x"?0:__privateGet(this,_damped).distance}tryResplit(){!__privateGet(this,_hibernated)&&(__privateGet(this,_loopCSSProperty).current||__privateGet(this,_splitCSSProperty).current||__privateGet(this,_loopCSSProperty).current||__privateGet(this,_autoSizeCSSProperty).current||__privateGet(this,_sectionalCSSProperty).current)&&__privateMethod(this,_ScrollElement_instances,split_fn).call(this)}onScroll(...parameters){return __privateGet(this,_damped).subscribe(...parameters)}offScroll(...parameters){__privateGet(this,_damped).unsubscribe(...parameters)}range(from,distance,margin=0){const start=from-margin,end=start+distance+margin*2;return this.currentProgress<start?0:this.currentProgress>end?1:(this.currentProgress-start)/(end-start)}curve(from,distance,margin=0){return Math.sin(this.range(from,distance,margin)*Math.PI)}visible(from,distance,margin=0){const start=from-margin,end=start+distance+margin*2;return this.currentProgress>=start&&this.currentProgress<=end}scrollToSection(sectionIndex,options){if(!__privateGet(this,_visibleSections).length||__privateGet(this,_hibernated)||__privateGet(this,_tweenTimeoutId))return;const previousCounter=__privateGet(this,_counter).current,newCounterValue=__privateMethod(this,_ScrollElement_instances,clampCounter_fn).call(this,sectionIndex);__privateGet(this,_isGrabbing)||(__privateGet(this,_counter).current=newCounterValue);const previousSection=__privateGet(this,_visibleSections)[previousCounter],currentSection=__privateGet(this,_visibleSections)[newCounterValue];if(previousSection&&currentSection){let shiftValue=0;const nearestSectionIndex=__privateMethod(this,_ScrollElement_instances,getNearestSectionIndex_fn).call(this),nearestSection=__privateGet(this,_visibleSections)[nearestSectionIndex];let scrolledFromNearestSection=nearestSection?this.targetScrollValue-nearestSection.position:0;__privateGet(this,_loopCSSProperty).current?newCounterValue===0&&previousCounter===__privateGet(this,_visibleSections).length-1?(shiftValue=__privateGet(this,_scrollSize)+__privateGet(this,_viewportSize)-previousSection.position+__privateGet(this,_gap),__privateGet(this,_isGrabbing)||(scrolledFromNearestSection=0)):newCounterValue===__privateGet(this,_visibleSections).length-1&&previousCounter===0?shiftValue=currentSection.position-(__privateGet(this,_scrollSize)+__privateGet(this,_viewportSize)+__privateGet(this,_gap)):shiftValue=currentSection.position-previousSection.position:shiftValue=currentSection.position-previousSection.position,this.shiftPosition(shiftValue-scrolledFromNearestSection,options)}}shiftSections(step,options){__privateGet(this,_visibleSections).length&&this.scrollToSection(__privateGet(this,_counter).current+step,options)}setPosition(value,options){__privateGet(this,_hibernated)||(__privateMethod(this,_ScrollElement_instances,processAutoplay_fn).call(this,Math.sign(value)||1),options!=null&&options.tween?(clearTimeout(__privateGet(this,_tweenTimeoutId)),__privateGet(this,_setTween).set(__privateGet(this,_damped).current,{equalize:!0}),__privateGet(this,_setTween).set(value,__spreadValues({},options.tween)),__privateSet(this,_tweenTimeoutId,setTimeout(()=>{__privateSet(this,_tweenTimeoutId,void 0)},options.tween.duration||0))):__privateGet(this,_damped).set(value,{equalize:(options==null?void 0:options.behaviour)==="instant"}))}shiftPosition(value,options){this.setPosition(__privateGet(this,_damped).target+value,options)}resize(){if(__privateGet(this,_hibernatedCSSProperty).current)return;__privateSet(this,_visibleSections,__privateGet(this,_sections).filter(s=>element.isElementVisible(s.element))),this.style.setProperty("--sections",__privateGet(this,_visibleSections).length.toString()),__privateGet(this,_damped).unlistenAnimationFrame();const prevProgress=this.currentScrollValue/__privateGet(this,_scrollSize)||0,prevCounter=__privateGet(this,_counter).current;if(__privateSet(this,_position2,this.vertical?layout.getCumulativeOffsetTop(this):layout.getCumulativeOffsetLeft(this)),__privateSet(this,_contentPosition,this.vertical?layout.getCumulativeOffsetTop(__privateGet(this,_contentElement)):layout.getCumulativeOffsetLeft(__privateGet(this,_contentElement))),__privateSet(this,_viewportSize,this.vertical?this.offsetHeight:this.offsetWidth),this.vertical?__privateSet(this,_gap,cssUnitParser_index.cssUnitParser.parse(getComputedStyle(__privateGet(this,_contentElement)).rowGap)||0):__privateSet(this,_gap,cssUnitParser_index.cssUnitParser.parse(getComputedStyle(__privateGet(this,_contentElement)).columnGap)||0),__privateGet(this,_autoSizeCSSProperty).current&&__privateGet(this,_visibleSections).length){const ivc=__privateGet(this,_sectionsInViewCSSProperty).current,sectionSize=(__privateGet(this,_viewportSize)-__privateGet(this,_gap)*(ivc-1))/ivc;__privateGet(this,_visibleSections).forEach(section=>{section.setSize(sectionSize)})}else __privateGet(this,_visibleSections).forEach(section=>{section.setSize()});if(__privateGet(this,_visibleSections).forEach(section=>{section.resize()}),__privateGet(this,_pagesCSSProperty).current){__privateSet(this,_scrollSize,__privateGet(this,_viewportSize)*__privateGet(this,_pagesCSSProperty).current);const contentSize=__privateGet(this,_scrollSize)+__privateGet(this,_viewportSize);this.vertical?(__privateGet(this,_contentElement).style.width=contentSize+"px",__privateGet(this,_contentElement).style.height="100%"):(__privateGet(this,_contentElement).style.height=contentSize+"px",__privateGet(this,_contentElement).style.width="100%")}else this.vertical?(__privateGet(this,_contentElement).style.width="100%",__privateGet(this,_contentElement).style.height="max-content",__privateSet(this,_scrollSize,__privateGet(this,_contentElement).offsetHeight-__privateGet(this,_viewportSize))):(__privateGet(this,_contentElement).style.width="max-content",__privateGet(this,_contentElement).style.height="100%",__privateSet(this,_scrollSize,__privateGet(this,_contentElement).offsetWidth-__privateGet(this,_viewportSize)));if(!__privateGet(this,_loopCSSProperty).current){const cs=getComputedStyle(this),padding=this.vertical?parseFloat(cs.paddingBlockStart)+parseFloat(cs.paddingBlockEnd):parseFloat(cs.paddingInlineStart)+parseFloat(cs.paddingInlineEnd);__privateSet(this,_scrollSize,__privateGet(this,_scrollSize)+padding),__privateGet(this,_damped).max=__privateGet(this,_scrollSize)}if(__privateGet(this,_loopCSSProperty).current&&__privateGet(this,_visibleSections).length){const lastSection=__privateGet(this,_visibleSections)[__privateGet(this,_visibleSections).length-1],lastSectionMax=lastSection.position+lastSection.size-__privateGet(this,_viewportSize),lastSectionMargin=__privateGet(this,_scrollSize)-lastSectionMax;__privateSet(this,_distance,lastSection.position+lastSection.size+lastSectionMargin)}else __privateSet(this,_distance,__privateGet(this,_scrollSize));if(__privateGet(this,_sectionalCSSProperty).current&&__privateGet(this,_visibleSections).length){const section=__privateGet(this,_visibleSections)[prevCounter];__privateGet(this,_damped).set(section.position,{equalize:!0})}else __privateGet(this,_damped).set(prevProgress*__privateGet(this,_scrollSize),{equalize:!0});__privateSet(this,_hasOverflow,(this.vertical?__privateGet(this,_contentElement).offsetHeight:__privateGet(this,_contentElement).offsetWidth)>__privateGet(this,_viewportSize)),this.classList.toggle("has-overflow",__privateGet(this,_hasOverflow)),__privateGet(this,_hasOverflow)?__privateGet(this,_disabledCSSProperty).current||__privateMethod(this,_ScrollElement_instances,enable_fn).call(this):__privateMethod(this,_ScrollElement_instances,disable_fn).call(this),__privateGet(this,_updateMaxSectionsSize).call(this),events.dispatchEvent(this,"scrollResize",{custom:!0}),__privateGet(this,_damped).notify()}connectedCallback(){scrollEntries_index.scrollEntries.register(this),__privateSet(this,_damped,new Damped.Damped(0,{damping:.01,min:0,order:order_index.TICK_ORDER.SCROLL})),this.setAttribute("tabindex","0"),__privateSet(this,_wheelControls,new DragControls.WheelControls({element:__privateGet(this,_contentElement)})),__privateGet(this,_wheelControls).changeEvent.subscribe(__privateGet(this,_notAutoplayControlListener)),__privateSet(this,_keyboardControls,new DragControls.KeyboardControls({element:this})),__privateGet(this,_keyboardControls).changeEvent.subscribe(__privateGet(this,_notAutoplayControlListener)),__privateSet(this,_dragControls,new DragControls.DragControls({element:__privateGet(this,_contentElement),rootElement:this})),__privateGet(this,_dragControls).changeEvent.subscribe(__privateGet(this,_notAutoplayControlListener)),__privateSet(this,_autoplayControls,new DragControls.AutoplayControls({culling:this})),__privateGet(this,_autoplayControls).changeEvent.subscribe(__privateGet(this,_controlsListener)),__privateGet(this,_axisCSSProperty).subscribe(()=>{__privateMethod(this,_ScrollElement_instances,updateAxis_fn).call(this)}),__privateGet(this,_reverseCSSProperty).subscribe(()=>{__privateMethod(this,_ScrollElement_instances,updateAxis_fn).call(this)}),__privateGet(this,_wheelMaxDeltaCSSProperty).subscribe(e=>{__privateGet(this,_wheelControls).axis=e.current?"max":__privateGet(this,_axisCSSProperty).current}),__privateGet(this,_dragInertionCSSProperty).subscribe(e=>{__privateGet(this,_dragControls).inertion=typeof e.current=="number"?e.current:1}),__privateGet(this,_pagesCSSProperty).subscribe(()=>{__privateGet(this,_isConnected)&&__privateGet(this,_resizeListener).call(this)}),__privateGet(this,_splitCSSProperty).subscribe(({current})=>{__privateGet(this,_isConnected)&&(current?__privateMethod(this,_ScrollElement_instances,split_fn).call(this):__privateMethod(this,_ScrollElement_instances,unsplit_fn).call(this))}),__privateGet(this,_sectionalCSSProperty).subscribe(e=>{__privateGet(this,_wheelControls).debounce=e.current,__privateGet(this,_dragControls).swipe=e.current,__privateGet(this,_autoplayControls).interval=e.current,__privateGet(this,_isConnected)&&(e.current&&!e.previous&&!__privateGet(this,_visibleSections).length?__privateMethod(this,_ScrollElement_instances,split_fn).call(this):!e.current&&e.previous&&__privateGet(this,_visibleSections).length&&__privateMethod(this,_ScrollElement_instances,unsplit_fn).call(this))}),__privateGet(this,_autoSizeCSSProperty).subscribe(e=>{__privateGet(this,_isConnected)&&(__privateGet(this,_resizeListener).call(this),e.current&&!e.previous&&!__privateGet(this,_visibleSections).length?__privateMethod(this,_ScrollElement_instances,split_fn).call(this):!e.current&&e.previous&&__privateGet(this,_visibleSections).length&&__privateMethod(this,_ScrollElement_instances,unsplit_fn).call(this))}),__privateGet(this,_sectionsInViewCSSProperty).subscribe(e=>{__privateGet(this,_isConnected)&&(__privateGet(this,_resizeListener).call(this),__privateMethod(this,_ScrollElement_instances,updateMarks_fn).call(this))}),__privateGet(this,_loopCSSProperty).subscribe(e=>{e.current?(__privateGet(this,_isConnected)&&(__privateGet(this,_visibleSections).length||(__privateGet(this,_splitCSSProperty).current=!0)),__privateGet(this,_damped).max=1/0,__privateGet(this,_damped).min=-1/0):(__privateSet(this,_overscroll,0),__privateGet(this,_damped).max=__privateGet(this,_scrollSize),__privateGet(this,_damped).min=0),this.classList.toggle("loop",!!e.current)}),__privateGet(this,_dampingCSSProperty).subscribe(e=>{__privateGet(this,_damped).damping=e.current}),__privateGet(this,_massCSSProperty).subscribe(e=>{__privateGet(this,_damped).mass=e.current}),__privateGet(this,_stiffnessCSSProperty).subscribe(e=>{__privateGet(this,_damped).stiffness=e.current}),__privateGet(this,_autoplayCSSProperty).subscribe(e=>{__privateGet(this,_autoplayControls).speed=e.current,!__privateGet(this,_disabled)&&e.current&&!e.previous?__privateGet(this,_autoplayControls).connect():!e.current&&e.previous&&__privateGet(this,_autoplayControls).disconnect()}),__privateGet(this,_autoplayUserDirectionCSSProperty).subscribe(e=>{e.current||(__privateGet(this,_autoplayControls).direction=1)}),__privateGet(this,_classesCSSProperty).subscribe(e=>{__privateGet(this,_isConnected)&&__privateMethod(this,_ScrollElement_instances,updateMarks_fn).call(this)}),__privateGet(this,_currentIndexStartOffsetCSSProperty).subscribe(e=>{__privateGet(this,_isConnected)&&__privateGet(this,_classesCSSProperty).current&&__privateMethod(this,_ScrollElement_instances,updateMarks_fn).call(this)}),__privateGet(this,_currentIndexEndOffsetCSSProperty).subscribe(e=>{__privateGet(this,_isConnected)&&__privateGet(this,_classesCSSProperty).current&&__privateMethod(this,_ScrollElement_instances,updateMarks_fn).call(this)}),__privateGet(this,_shiftSectionPositionCSSProperty).subscribe(e=>{__privateGet(this,_isConnected)&&__privateGet(this,_damped).notify()}),__privateGet(this,_damped).isRunning.subscribe(e=>{this.classList.toggle("active",e.current)}),__privateGet(this,_counter).subscribe(e=>{__privateGet(this,_hibernated)||(__privateGet(this,_visibleSections).length&&__privateMethod(this,_ScrollElement_instances,updateMarks_fn).call(this),this.style.setProperty("--counter",e.current+""))}),__privateGet(this,_setTween).subscribe(e=>{__privateGet(this,_setTween).isRunning.current&&__privateGet(this,_damped).set(e.current,{equalize:!0})}),__privateGet(this,_disabledCSSProperty).subscribe(e=>{e.current&&!e.previous?(this.classList.add("disabled"),__privateMethod(this,_ScrollElement_instances,disable_fn).call(this)):!e.current&&e.previous&&(this.classList.remove("disabled"),__privateMethod(this,_ScrollElement_instances,enable_fn).call(this))}),__privateGet(this,_hibernatedCSSProperty).subscribe(e=>{e.current&&!e.previous?(this.classList.add("hibernated"),__privateMethod(this,_ScrollElement_instances,hibernate_fn).call(this)):!e.current&&e.previous&&(this.classList.remove("hibernated"),__privateMethod(this,_ScrollElement_instances,awake_fn).call(this))}),__privateGet(this,_controlsCSSProperty).observe(),__privateGet(this,_axisCSSProperty).observe(),__privateGet(this,_reverseCSSProperty).observe(),__privateGet(this,_directionCSSProperty).observe(),__privateGet(this,_pagesCSSProperty).observe(),__privateGet(this,_splitCSSProperty).observe(),__privateGet(this,_sectionalCSSProperty).observe(),__privateGet(this,_easingCSSProperty).observe(),__privateGet(this,_durationCSSProperty).observe(),__privateGet(this,_autoSizeCSSProperty).observe(),__privateGet(this,_wheelMaxDeltaCSSProperty).observe(),__privateGet(this,_dragInertionCSSProperty).observe(),__privateGet(this,_sectionsInViewCSSProperty).observe(),__privateGet(this,_loopCSSProperty).observe(),__privateGet(this,_dampingCSSProperty).observe(),__privateGet(this,_massCSSProperty).observe(),__privateGet(this,_stiffnessCSSProperty).observe(),__privateGet(this,_mouseDragCSSProperty).observe(),__privateGet(this,_sectionDistanceScaleCSSProperty).observe(),__privateGet(this,_startSectionCSSProperty).observe(),__privateGet(this,_autoplayCSSProperty).observe(),__privateGet(this,_autoplayCSSProperty).observe(),__privateGet(this,_autoplayPauseDurationCSSProperty).observe(),__privateGet(this,_autoplayUserDirectionCSSProperty).observe(),__privateGet(this,_classesCSSProperty).observe(),__privateGet(this,_currentIndexStartOffsetCSSProperty).observe(),__privateGet(this,_currentIndexEndOffsetCSSProperty).observe(),__privateGet(this,_shiftSectionPositionCSSProperty).observe(),__privateGet(this,_focusDelayCSSProperty).observe(),__privateGet(this,_focusDurationCSSProperty).observe(),__privateGet(this,_shiftLimitCSSProperty).observe(),__privateGet(this,_disabledCSSProperty).observe(),__privateGet(this,_hibernatedCSSProperty).observe(),windowResizer_index.windowResizer.subscribe(__privateGet(this,_connectListener),order_index.RESIZE_ORDER.LAST),__privateGet(this,_mutationObserver).observe(this,{childList:!0})}disconnectedCallback(){this.removeAttribute("tabindex"),this.classList.remove("disabled"),this.classList.remove("hibernated"),__privateGet(this,_controlsCSSProperty).unobserve(),__privateGet(this,_axisCSSProperty).unobserve(),__privateGet(this,_reverseCSSProperty).unobserve(),__privateGet(this,_directionCSSProperty).unobserve(),__privateGet(this,_pagesCSSProperty).unobserve(),__privateGet(this,_splitCSSProperty).unobserve(),__privateGet(this,_sectionalCSSProperty).unobserve(),__privateGet(this,_easingCSSProperty).unobserve(),__privateGet(this,_durationCSSProperty).unobserve(),__privateGet(this,_autoSizeCSSProperty).unobserve(),__privateGet(this,_wheelMaxDeltaCSSProperty).unobserve(),__privateGet(this,_dragInertionCSSProperty).unobserve(),__privateGet(this,_sectionsInViewCSSProperty).unobserve(),__privateGet(this,_loopCSSProperty).unobserve(),__privateGet(this,_dampingCSSProperty).unobserve(),__privateGet(this,_massCSSProperty).unobserve(),__privateGet(this,_stiffnessCSSProperty).unobserve(),__privateGet(this,_mouseDragCSSProperty).unobserve(),__privateGet(this,_sectionDistanceScaleCSSProperty).unobserve(),__privateGet(this,_startSectionCSSProperty).unobserve(),__privateGet(this,_autoplayCSSProperty).unobserve(),__privateGet(this,_autoplayPauseDurationCSSProperty).unobserve(),__privateGet(this,_autoplayUserDirectionCSSProperty).unobserve(),__privateGet(this,_classesCSSProperty).unobserve(),__privateGet(this,_currentIndexStartOffsetCSSProperty).unobserve(),__privateGet(this,_currentIndexEndOffsetCSSProperty).unobserve(),__privateGet(this,_shiftSectionPositionCSSProperty).unobserve(),__privateGet(this,_focusDelayCSSProperty).unobserve(),__privateGet(this,_focusDurationCSSProperty).unobserve(),__privateGet(this,_shiftLimitCSSProperty).unobserve(),__privateGet(this,_disabledCSSProperty).unobserve(),__privateGet(this,_hibernatedCSSProperty).unobserve(),windowResizer_index.windowResizer.unsubscribe(__privateGet(this,_connectListener)),windowResizer_index.windowResizer.unsubscribe(__privateGet(this,_resizeListener)),elementResizer_index.elementResizer.unsubscribe(__privateGet(this,_resizeListener)),__privateMethod(this,_ScrollElement_instances,hibernate_fn).call(this),__privateGet(this,_mutationObserver).disconnect()}};_damped=new WeakMap,_controlsCSSProperty=new WeakMap,_axisCSSProperty=new WeakMap,_reverseCSSProperty=new WeakMap,_directionCSSProperty=new WeakMap,_pagesCSSProperty=new WeakMap,_splitCSSProperty=new WeakMap,_sectionalCSSProperty=new WeakMap,_easingCSSProperty=new WeakMap,_durationCSSProperty=new WeakMap,_autoSizeCSSProperty=new WeakMap,_wheelMaxDeltaCSSProperty=new WeakMap,_dragInertionCSSProperty=new WeakMap,_sectionsInViewCSSProperty=new WeakMap,_loopCSSProperty=new WeakMap,_dampingCSSProperty=new WeakMap,_massCSSProperty=new WeakMap,_stiffnessCSSProperty=new WeakMap,_mouseDragCSSProperty=new WeakMap,_sectionDistanceScaleCSSProperty=new WeakMap,_startSectionCSSProperty=new WeakMap,_autoplayCSSProperty=new WeakMap,_autoplayPauseDurationCSSProperty=new WeakMap,_autoplayUserDirectionCSSProperty=new WeakMap,_classesCSSProperty=new WeakMap,_currentIndexStartOffsetCSSProperty=new WeakMap,_currentIndexEndOffsetCSSProperty=new WeakMap,_shiftSectionPositionCSSProperty=new WeakMap,_focusDelayCSSProperty=new WeakMap,_focusDurationCSSProperty=new WeakMap,_shiftLimitCSSProperty=new WeakMap,_disabledCSSProperty=new WeakMap,_hibernatedCSSProperty=new WeakMap,_contentWrapperElement=new WeakMap,_contentElement=new WeakMap,_slotElement=new WeakMap,_sections=new WeakMap,_visibleSections=new WeakMap,_position2=new WeakMap,_contentPosition=new WeakMap,_viewportSize=new WeakMap,_scrollSize=new WeakMap,_gap=new WeakMap,_wheelControls=new WeakMap,_keyboardControls=new WeakMap,_dragControls=new WeakMap,_autoplayControls=new WeakMap,_counter=new WeakMap,_overscroll=new WeakMap,_distance=new WeakMap,_hasOverflow=new WeakMap,_disabled=new WeakMap,_hibernated=new WeakMap,_focusTimeoutId=new WeakMap,_tweenTimeoutId=new WeakMap,_setTween=new WeakMap,_isGrabbing=new WeakMap,_scrollLine=new WeakMap,_isConnected=new WeakMap,_mutationObserver=new WeakMap,_currentSections=new WeakMap,_skipNextResize=new WeakMap,_maxSectionSizeTimeoutId=new WeakMap,_ScrollElement_instances=new WeakSet,updateAxis_fn=__name(function(){const axis=__privateGet(this,_axisCSSProperty).current,reverse=__privateGet(this,_reverseCSSProperty).current?"-reverse":"";__privateGet(this,_contentElement).style.flexDirection=axis==="x"?`row${reverse}`:`column${reverse}`,__privateGet(this,_wheelControls).axis=__privateGet(this,_wheelMaxDeltaCSSProperty).current?"max":axis,__privateGet(this,_keyboardControls).dimension=axis==="x"?"width":"height",__privateGet(this,_dragControls).axis=axis,axis==="x"?this.style.touchAction="pan-y":axis==="y"&&(this.style.touchAction="pan-x"),__privateGet(this,_isConnected)&&__privateGet(this,_resizeListener).call(this)},"#updateAxis"),split_fn=__name(function(){__privateMethod(this,_ScrollElement_instances,unsplit_fn).call(this),__privateGet(this,_slotElement).assignedElements().forEach((element2,i)=>{element2 instanceof HTMLElement&&element2.tagName!=="SCRIPT"&&__privateGet(this,_sections).push(new ScrollSection(element2,i,this))}),__privateSet(this,_visibleSections,[...__privateGet(this,_sections)]),__privateGet(this,_contentElement).style.transform="",events.dispatchEvent(this,"scrollSectionsChange",{custom:!0,composed:!0}),__privateGet(this,_resizeListener).call(this),__privateMethod(this,_ScrollElement_instances,updateMarks_fn).call(this)},"#split"),unsplit_fn=__name(function(){__privateGet(this,_sections).forEach(section=>{section.destroy()}),__privateSet(this,_sections,[]),__privateSet(this,_visibleSections,[]),__privateGet(this,_counter).reset(),__privateGet(this,_damped).reset(),this.style.removeProperty("--max-section-size"),events.dispatchEvent(this,"scrollSectionsChange",{custom:!0,composed:!0})},"#unsplit"),disable_fn=__name(function(){__privateGet(this,_disabled)||(__privateSet(this,_disabled,!0),__privateGet(this,_damped).unsubscribe(__privateGet(this,_animatedChangeListener)),__privateGet(this,_damped).unlistenAnimationFrame(),clearInterval(__privateGet(this,_focusTimeoutId)),clearInterval(__privateGet(this,_tweenTimeoutId)),__privateGet(this,_setTween).unlistenAnimationFrame(),__privateGet(this,_wheelControls).disconnect(),__privateGet(this,_keyboardControls).disconnect(),__privateGet(this,_dragControls).disconnect(),__privateGet(this,_autoplayControls).disconnect(),__privateGet(this,_hasOverflow)||(this.sections.forEach(section=>{section.unsetTransform()}),__privateGet(this,_resizeListener).call(this)))},"#disable"),enable_fn=__name(function(){__privateGet(this,_disabled)&&(__privateSet(this,_disabled,!1),__privateGet(this,_damped).subscribe(__privateGet(this,_animatedChangeListener),-1e4),__privateGet(this,_damped).notify(),__privateGet(this,_wheelControls).connect(),__privateGet(this,_keyboardControls).connect(),__privateGet(this,_dragControls).connect(),__privateGet(this,_autoplayCSSProperty).current&&__privateGet(this,_autoplayControls).connect())},"#enable"),hibernate_fn=__name(function(){__privateGet(this,_hibernated)||(__privateSet(this,_hibernated,!0),clearTimeout(__privateGet(this,_maxSectionSizeTimeoutId)),windowResizer_index.windowResizer.unsubscribe(__privateGet(this,_resizeListener)),__privateMethod(this,_ScrollElement_instances,disable_fn).call(this),__privateGet(this,_contentElement).style.transform="",__privateGet(this,_contentElement).style.height="",__privateGet(this,_contentElement).style.width="",this.classList.remove("has-overflow","start","end"),this.style.removeProperty("--counter"),__privateGet(this,_sections).length?__privateMethod(this,_ScrollElement_instances,unsplit_fn).call(this):(__privateGet(this,_counter).reset(),__privateGet(this,_damped).reset()),scrollEntries_index.scrollEntries.unregister(this))},"#hibernate"),awake_fn=__name(function(){__privateGet(this,_hibernated)&&(__privateSet(this,_hibernated,!1),scrollEntries_index.scrollEntries.register(this),this.tryResplit(),__privateMethod(this,_ScrollElement_instances,enable_fn).call(this),this.scrollToSection(__privateGet(this,_startSectionCSSProperty).current,{behaviour:"instant"}),windowResizer_index.windowResizer.subscribe(__privateGet(this,_resizeListener),order_index.RESIZE_ORDER.SCROLL))},"#awake"),_resizeListener=new WeakMap,_animatedChangeListener=new WeakMap,clampCounter_fn=__name(function(value){let counter=__privateGet(this,_counter).current;return __privateGet(this,_loopCSSProperty).current?counter=number.loopNumber(value,__privateGet(this,_visibleSections).length):counter=math.clamp(value,0,this.limit),counter},"#clampCounter"),_notAutoplayControlListener=new WeakMap,_controlsListener=new WeakMap,processAutoplay_fn=__name(function(direction=1){__privateGet(this,_autoplayUserDirectionCSSProperty).current&&(__privateGet(this,_autoplayControls).direction=direction),__privateGet(this,_autoplayCSSProperty).current&&__privateGet(this,_autoplayControls).pauseAndContinue(__privateGet(this,_autoplayPauseDurationCSSProperty).current,this.sectionalCSSProperty.current)},"#processAutoplay"),getScrollValue_fn=__name(function(type="current"){if(__privateGet(this,_loopCSSProperty).current&&__privateGet(this,_visibleSections).length){const mod=Math.floor(__privateGet(this,_damped)[type])%Math.floor(__privateGet(this,_scrollSize)+__privateGet(this,_viewportSize)+__privateGet(this,_gap));return mod<0?__privateGet(this,_scrollSize)+mod+__privateGet(this,_viewportSize)+__privateGet(this,_gap):mod}else return __privateGet(this,_damped)[type]},"#getScrollValue"),updateMarks_fn=__name(function(){if(__privateGet(this,_visibleSections).length){const counter=__privateGet(this,_counter).current+__privateGet(this,_currentIndexStartOffsetCSSProperty).current;if(counter===__privateGet(this,_currentIndexStartOffsetCSSProperty).current?__privateSet(this,_scrollLine,"start"):counter===this.limit?__privateSet(this,_scrollLine,"end"):__privateSet(this,_scrollLine,null),events.dispatchEvent(this,"scrollLine",{detail:{line:__privateGet(this,_scrollLine)}}),__privateGet(this,_classesCSSProperty).current){this.classList.remove("end","start"),__privateGet(this,_scrollLine)&&this.classList.add(__privateGet(this,_scrollLine));const sectionsInView=__privateGet(this,_sectionsInViewCSSProperty).current+__privateGet(this,_currentIndexEndOffsetCSSProperty).current;__privateSet(this,_currentSections,[]),__privateGet(this,_visibleSections).forEach((section,index)=>{section.setCurrentIndex(null),section.setCurrentIndexArc(null),section.setCurrentIndexArcAbs(null),section.setMiddle(!1);const overflow=counter-this.limit-1+__privateGet(this,_currentIndexEndOffsetCSSProperty).current,currentRange=counter+sectionsInView,vv=this.sections.length-currentRange;index>=counter&&index<currentRange||index<=overflow?(section.setMark("current"),__privateGet(this,_currentSections).push(section)):index>=currentRange&&index<currentRange+vv/2||index<=overflow+sectionsInView?section.setMark("next"):section.setMark("previous")}),__privateGet(this,_updateMaxSectionsSize).call(this)}}},"#updateMarks"),updateIndexes_fn=__name(function(){if(__privateGet(this,_classesCSSProperty).current){const middle=Math.floor(__privateGet(this,_currentSections).length/2);__privateGet(this,_currentSections).sort((a,b)=>a.element.getBoundingClientRect().left-b.element.getBoundingClientRect().left),__privateGet(this,_currentSections).forEach((section,i)=>{const arcIndex=i-middle;section.setCurrentIndex(i),section.setCurrentIndexArc(arcIndex),section.setCurrentIndexArcAbs(Math.abs(arcIndex)),section.setMiddle(i===middle)}),__privateGet(this,_visibleSections).forEach((section,i)=>{section.setOffsetIndex(i-(__privateGet(this,_counter).current+__privateGet(this,_sectionsInViewCSSProperty).current))})}},"#updateIndexes"),_updateMaxSectionsSize=new WeakMap,getNearestSectionIndex_fn=__name(function(NAMEIT=!1){let scrollValue=this.targetScrollValue,minDiff=1/0,nearestIndex=0;const dir=__privateGet(this,_damped).direction;for(let i=0;i<__privateGet(this,_visibleSections).length;i++){const section=__privateGet(this,_visibleSections)[i];let offset=__privateGet(this,_isGrabbing)?section.size*dir*-1*.4:0,position=section.position;this.overscroll&&position===0&&NAMEIT&&(position=__privateGet(this,_distance));let diff=Math.abs(position+offset-scrollValue);diff<=minDiff&&(minDiff=diff,nearestIndex=i)}return nearestIndex},"#getNearestSectionIndex"),_connectListener=new WeakMap,__name(_ScrollElement,"ScrollElement");let ScrollElement=_ScrollElement;Store.isBrowser&&!customElements.get("e-scroll")&&customElements.define("e-scroll",ScrollElement);var _scrollElement2;const _ScrollUserElement=class _ScrollUserElement extends HTMLElement{constructor(){super(...arguments);__privateAdd(this,_scrollElement2,null)}get scrollElement(){return __privateGet(this,_scrollElement2)}connectedCallback(){const scrollElement=dom.findParentElement(this,ScrollElement);scrollElement instanceof ScrollElement?__privateSet(this,_scrollElement2,scrollElement):console.error(this,"e-scroll not found")}};_scrollElement2=new WeakMap,__name(_ScrollUserElement,"ScrollUserElement");let ScrollUserElement=_ScrollUserElement;var _slotElement2,_thumbElement,_isHorisontal,_thumbSize,_thumbScrollSize,_position3,_resizeListener2,_scrollListener,_axisListener,_grabListener;const _ScrollScrollbarElement=class _ScrollScrollbarElement extends ScrollUserElement{constructor(){super();__privateAdd(this,_slotElement2,null);__privateAdd(this,_thumbElement,null);__privateAdd(this,_isHorisontal,!1);__privateAdd(this,_thumbSize,0);__privateAdd(this,_thumbScrollSize,0);__privateAdd(this,_position3,0);__privateAdd(this,_resizeListener2,__name(()=>{__privateSet(this,_isHorisontal,this.offsetWidth>this.offsetHeight);const barSize=__privateGet(this,_isHorisontal)?this.offsetWidth:this.offsetHeight;__privateSet(this,_thumbSize,barSize/((this.scrollElement.scrollSize+this.scrollElement.viewportSize)/barSize)),__privateSet(this,_thumbSize,Math.max(__privateGet(this,_thumbSize),30)),__privateGet(this,_isHorisontal)?(__privateGet(this,_thumbElement).style.width=__privateGet(this,_thumbSize)+"px",__privateGet(this,_thumbElement).style.height="100%"):(__privateGet(this,_thumbElement).style.width="100%",__privateGet(this,_thumbElement).style.height=__privateGet(this,_thumbSize)+"px"),__privateSet(this,_thumbScrollSize,barSize-__privateGet(this,_thumbSize)),this.scrollElement.scrollSize<=0?this.style.display="none":this.style.display="",__privateGet(this,_scrollListener).call(this)},"#resizeListener"));__privateAdd(this,_scrollListener,__name(()=>{__privateSet(this,_position3,this.scrollElement.currentProgress*__privateGet(this,_thumbScrollSize)),__privateGet(this,_isHorisontal)?__privateGet(this,_thumbElement).style.transform=`translate3d(${__privateGet(this,_position3)}px, 0px, 0px)`:__privateGet(this,_thumbElement).style.transform=`translate3d(0px, ${__privateGet(this,_position3)}px, 0px)`},"#scrollListener"));__privateAdd(this,_axisListener,__name(()=>{this.setAttribute("axis",this.scrollElement.axisCSSProperty.current)},"#axisListener"));__privateAdd(this,_grabListener,__name(grabEvent=>{gestures.setupDrag(moveEvent=>{const moveCursor=__privateGet(this,_isHorisontal)?moveEvent.x:moveEvent.y,mult=this.scrollElement.distance/__privateGet(this,_thumbScrollSize),delta=(moveCursor-grabCursor)*mult;this.scrollElement.setPosition(startValue+delta)});const startValue=this.scrollElement.damped.target,grabCursor=__privateGet(this,_isHorisontal)?grabEvent.x:grabEvent.y},"#grabListener"));if(Store.isBrowser){const shadow=this.attachShadow({mode:"open"});shadow.adoptedStyleSheets=[stylesheet$1.createStylesheet({":host":{display:"inline-block",zIndex:"1",backgroundColor:"#ebebeb"},':host([axis="y"])':{position:"absolute",right:"0",top:"0",width:"1vmin",height:"100%"},':host([axis="x"])':{position:"absolute",left:"0",bottom:"0",width:"100%",height:"1vmin"},".default-thumb":{backgroundColor:"var(--thumb-color, black)",borderRadius:"var(--thumb-radius, 0px)",touchAction:"none"},"::slotted(*)":{touchAction:"none"}})],__privateSet(this,_slotElement2,document.createElement("slot")),__privateGet(this,_slotElement2).innerHTML='<div class="default-thumb"></div>',shadow.appendChild(__privateGet(this,_slotElement2))}}get thumbElement(){return __privateGet(this,_thumbElement)}connectedCallback(){super.connectedCallback(),this.setAttribute("drag-dead-zone","");const slottedThumb=__privateGet(this,_slotElement2).assignedElements()[0]||__privateGet(this,_slotElement2).firstElementChild;__privateSet(this,_thumbElement,slottedThumb),__privateGet(this,_thumbElement).addEventListener("pointerdown",__privateGet(this,_grabListener)),windowResizer_index.windowResizer.subscribe(__privateGet(this,_resizeListener2),order_index.RESIZE_ORDER.SCROLL),elementResizer_index.elementResizer.subscribe(this,__privateGet(this,_resizeListener2)),elementResizer_index.elementResizer.subscribe(this.scrollElement,__privateGet(this,_resizeListener2)),this.scrollElement.onScroll(__privateGet(this,_scrollListener)),this.scrollElement.axisCSSProperty.subscribe(__privateGet(this,_axisListener))}disconnectedCallback(){this.removeAttribute("drag-dead-zone"),this.style.display="",__privateGet(this,_thumbElement).removeEventListener("pointerdown",__privateGet(this,_grabListener)),windowResizer_index.windowResizer.unsubscribe(__privateGet(this,_resizeListener2)),elementResizer_index.elementResizer.unsubscribe(__privateGet(this,_resizeListener2)),this.scrollElement.offScroll(__privateGet(this,_scrollListener)),this.scrollElement.axisCSSProperty.unsubscribe(__privateGet(this,_axisListener))}};_slotElement2=new WeakMap,_thumbElement=new WeakMap,_isHorisontal=new WeakMap,_thumbSize=new WeakMap,_thumbScrollSize=new WeakMap,_position3=new WeakMap,_resizeListener2=new WeakMap,_scrollListener=new WeakMap,_axisListener=new WeakMap,_grabListener=new WeakMap,__name(_ScrollScrollbarElement,"ScrollScrollbarElement");let ScrollScrollbarElement=_ScrollScrollbarElement;Store.isBrowser&&!customElements.get("e-scroll-scrollbar")&&customElements.define("e-scroll-scrollbar",ScrollScrollbarElement);var _behaviour,_easing,_duration;const _ScrollButtonElement=class _ScrollButtonElement extends ScrollUserElement{constructor(){super();__privateAdd(this,_behaviour,new cssProperty_index.CSSProperty(this,"--behaviour","smooth"));__privateAdd(this,_easing,new cssProperty_index.CSSProperty(this,"--tween-easing",!1));__privateAdd(this,_duration,new cssProperty_index.CSSProperty(this,"--tween-duration",0));Store.isBrowser&&this.addEventListener("click",()=>{const behaviour=__privateGet(this,_behaviour).current,easing=__privateGet(this,_easing).current,duration=__privateGet(this,_duration).current;this.handleClick({behaviour,tween:easing||duration?{easing,duration}:void 0})})}connectedCallback(){super.connectedCallback(),this.hasAttribute("tabindex")||this.setAttribute("tabindex","0"),this.hasAttribute("role")||this.setAttribute("role","button"),__privateGet(this,_behaviour).observe(),__privateGet(this,_easing).observe(),__privateGet(this,_duration).observe()}disconnectedCallback(){this.removeAttribute("tabindex"),this.removeAttribute("role"),__privateGet(this,_behaviour).close(),__privateGet(this,_easing).close(),__privateGet(this,_duration).close()}};_behaviour=new WeakMap,_easing=new WeakMap,_duration=new WeakMap,__name(_ScrollButtonElement,"ScrollButtonElement");let ScrollButtonElement=_ScrollButtonElement;var _set;const _ScrollSetButtonElement=class _ScrollSetButtonElement extends ScrollButtonElement{constructor(){super(...arguments);__privateAdd(this,_set,new cssProperty_index.CSSProperty(this,"--set",1))}handleClick(options){this.scrollElement.scrollToSection(__privateGet(this,_set).current,options)}connectedCallback(){super.connectedCallback(),__privateGet(this,_set).observe()}disconnectedCallback(){super.disconnectedCallback(),__privateGet(this,_set).close()}};_set=new WeakMap,__name(_ScrollSetButtonElement,"ScrollSetButtonElement");let ScrollSetButtonElement=_ScrollSetButtonElement;Store.isBrowser&&!customElements.get("e-scroll-set-button")&&customElements.define("e-scroll-set-button",ScrollSetButtonElement);var _step,_scrollLineListener;const _ScrollStepButtonElement=class _ScrollStepButtonElement extends ScrollButtonElement{constructor(){super(...arguments);__privateAdd(this,_step,new cssProperty_index.CSSProperty(this,"--step",1));__privateAdd(this,_scrollLineListener,__name(()=>{this.scrollElement.loopCSSProperty.current?this.removeAttribute("disabled"):__privateGet(this,_step).current>0&&this.scrollElement.scrollLine==="end"||__privateGet(this,_step).current<0&&this.scrollElement.scrollLine==="start"?this.setAttribute("disabled",""):this.removeAttribute("disabled")},"#scrollLineListener"))}handleClick(options){this.scrollElement.shiftSections(__privateGet(this,_step).current,options)}connectedCallback(){super.connectedCallback(),this.scrollElement&&(__privateGet(this,_step).subscribe(()=>{__privateGet(this,_scrollLineListener).call(this)}),__privateGet(this,_step).observe(),this.scrollElement.addEventListener("scrollLine",__privateGet(this,_scrollLineListener)),__privateGet(this,_scrollLineListener).call(this))}disconnectedCallback(){super.disconnectedCallback(),__privateGet(this,_step).close(),this.removeAttribute("disabled")}};_step=new WeakMap,_scrollLineListener=new WeakMap,__name(_ScrollStepButtonElement,"ScrollStepButtonElement");let ScrollStepButtonElement=_ScrollStepButtonElement;Store.isBrowser&&!customElements.get("e-scroll-step-button")&&customElements.define("e-scroll-step-button",ScrollStepButtonElement);var _element2,_scrollElement3,_index2,_behaviour2,_clickListener,_counterChangeListener;const _BulletButton=class _BulletButton{constructor(scrollElement,index,behaviour){__privateAdd(this,_element2,null);__privateAdd(this,_scrollElement3,null);__privateAdd(this,_index2,null);__privateAdd(this,_behaviour2,null);__privateAdd(this,_clickListener,__name(()=>{__privateGet(this,_scrollElement3).scrollToSection(__privateGet(this,_index2),{behaviour:__privateGet(this,_behaviour2)})},"#clickListener"));__privateAdd(this,_counterChangeListener,__name(()=>{__privateGet(this,_element2).classList.toggle("current",__privateGet(this,_scrollElement3).counter.current===__privateGet(this,_index2))},"#counterChangeListener"));Store.isBrowser&&(__privateSet(this,_element2,document.createElement("button")),__privateGet(this,_element2).setAttribute("aria-label",`Go to section ${index+1}`),__privateSet(this,_scrollElement3,scrollElement),__privateSet(this,_behaviour2,behaviour),__privateSet(this,_index2,index),__privateGet(this,_element2).addEventListener("click",__privateGet(this,_clickListener)),__privateGet(this,_scrollElement3).counter.subscribe(__privateGet(this,_counterChangeListener)),__privateGet(this,_counterChangeListener).call(this))}get element(){return __privateGet(this,_element2)}destroy(){__privateGet(this,_element2).removeEventListener("click",__privateGet(this,_clickListener)),__privateGet(this,_scrollElement3).counter.unsubscribe(__privateGet(this,_counterChangeListener)),__privateGet(this,_element2).remove()}};_element2=new WeakMap,_scrollElement3=new WeakMap,_index2=new WeakMap,_behaviour2=new WeakMap,_clickListener=new WeakMap,_counterChangeListener=new WeakMap,__name(_BulletButton,"BulletButton");let BulletButton=_BulletButton;var _contentElement2,_buttons,_sectionsChangeListener;const _ScrollBulletButtonsElement=class _ScrollBulletButtonsElement extends ScrollUserElement{constructor(){super(...arguments);__privateAdd(this,_contentElement2,null);__privateAdd(this,_buttons,[]);__privateAdd(this,_sectionsChangeListener,_function.debounce(()=>{__privateGet(this,_buttons).forEach(b=>b.destroy()),__privateSet(this,_buttons,[]);let length=0;this.scrollElement.loopCSSProperty.current?length=this.scrollElement.visibleSections.length:length=this.scrollElement.visibleSections.length-Math.max(this.scrollElement.sectionsInViewCSSProperty.current-1,0);for(let index=0;index<length;index++){const button=new BulletButton(this.scrollElement,index,this.getAttribute("behaviour")||"smooth");__privateGet(this,_contentElement2).appendChild(button.element),__privateGet(this,_buttons).push(button)}},0))}connectedCallback(){super.connectedCallback(),this.innerHTML="",__privateSet(this,_contentElement2,document.createElement("div")),this.appendChild(__privateGet(this,_contentElement2)),this.scrollElement.addEventListener("scrollSectionsChange",__privateGet(this,_sectionsChangeListener)),this.scrollElement.sectionsInViewCSSProperty.subscribe(__privateGet(this,_sectionsChangeListener)),this.scrollElement.loopCSSProperty.subscribe(__privateGet(this,_sectionsChangeListener)),__privateGet(this,_sectionsChangeListener).call(this)}disconnectedCallback(){this.scrollElement.removeEventListener("scrollSectionsChange",__privateGet(this,_sectionsChangeListener)),this.scrollElement.sectionsInViewCSSProperty.unsubscribe(__privateGet(this,_sectionsChangeListener)),this.scrollElement.loopCSSProperty.unsubscribe(__privateGet(this,_sectionsChangeListener)),__privateGet(this,_buttons).forEach(b=>b.destroy()),__privateSet(this,_buttons,[]),__privateGet(this,_contentElement2).remove()}};_contentElement2=new WeakMap,_buttons=new WeakMap,_sectionsChangeListener=new WeakMap,__name(_ScrollBulletButtonsElement,"ScrollBulletButtonsElement");let ScrollBulletButtonsElement=_ScrollBulletButtonsElement;Store.isBrowser&&!customElements.get("e-scroll-bullet-buttons")&&customElements.define("e-scroll-bullet-buttons",ScrollBulletButtonsElement);var _dampingCSSProperty2,_massCSSProperty2,_stiffnessCSSProperty2,_targetCSSProperty,_disabledCSSProperty2,_distanceOffsetCSSProperty,_startOffsetCSSProperty,_captureOnceCSSProperty,_capturedCSSProperty,_releasedCSSProperty,_capturedFromStartCSSProperty,_capturedFromFinishCSSProperty,_releasedFromStartCSSProperty,_releasedFromFinishCSSProperty,_passedVarCSSProperty,_progressVarCSSProperty,_progressArcVarCSSProperty,_progressArcMultCSSProperty,_animationVarTypeCSSProperty,_distanceVarCSSProperty,_startVarCSSProperty,_finishVarCSSProperty,_isCaptured,_isReleased,_isCapturedFromStart,_isReleasedFromStart,_isCapturedFromFinish,_isReleasedFromFinish,_anotherScrollEntries,_targetElement,_directionPosition,_directionSize,_moverDirectionSize,_passed,_progress,_start,_distance2,_finish,_isResized,_isCapturedOnce,_isDisabled,_skipPassNotification,_ScrollSegmentElement_instances,captureListener_fn,releaseListener_fn,captureFromStartListener_fn,captureFromFinishListener_fn,releaseFromStartListener_fn,releaseFromFinishListener_fn,_resizeListener3,_tickListener,updateProgress_fn,handleClassSetting_fn,removeClasses_fn,removeVars_fn,removeCurrentMarks_fn;const _ScrollSegmentElement=class _ScrollSegmentElement extends ScrollUserElement{constructor(){super(...arguments);__privateAdd(this,_ScrollSegmentElement_instances);__privateAdd(this,_dampingCSSProperty2);__privateAdd(this,_massCSSProperty2);__privateAdd(this,_stiffnessCSSProperty2);__privateAdd(this,_targetCSSProperty);__privateAdd(this,_disabledCSSProperty2);__privateAdd(this,_distanceOffsetCSSProperty);__privateAdd(this,_startOffsetCSSProperty);__privateAdd(this,_captureOnceCSSProperty);__privateAdd(this,_capturedCSSProperty);__privateAdd(this,_releasedCSSProperty);__privateAdd(this,_capturedFromStartCSSProperty);__privateAdd(this,_capturedFromFinishCSSProperty);__privateAdd(this,_releasedFromStartCSSProperty);__privateAdd(this,_releasedFromFinishCSSProperty);__privateAdd(this,_passedVarCSSProperty);__privateAdd(this,_progressVarCSSProperty);__privateAdd(this,_progressArcVarCSSProperty);__privateAdd(this,_progressArcMultCSSProperty);__privateAdd(this,_animationVarTypeCSSProperty);__privateAdd(this,_distanceVarCSSProperty);__privateAdd(this,_startVarCSSProperty);__privateAdd(this,_finishVarCSSProperty);__privateAdd(this,_isCaptured);__privateAdd(this,_isReleased);__privateAdd(this,_isCapturedFromStart);__privateAdd(this,_isReleasedFromStart);__privateAdd(this,_isCapturedFromFinish);__privateAdd(this,_isReleasedFromFinish);__privateAdd(this,_anotherScrollEntries);__privateAdd(this,_targetElement);__privateAdd(this,_directionPosition);__privateAdd(this,_directionSize);__privateAdd(this,_moverDirectionSize);__privateAdd(this,_passed);__privateAdd(this,_progress);__privateAdd(this,_start);__privateAdd(this,_distance2);__privateAdd(this,_finish);__privateAdd(this,_isResized);__privateAdd(this,_isCapturedOnce);__privateAdd(this,_isDisabled);__privateAdd(this,_skipPassNotification);__privateAdd(this,_resizeListener3);__privateAdd(this,_tickListener);__privateSet(this,_dampingCSSProperty2,new cssProperty_index.CSSProperty(this,"--damping",20)),__privateSet(this,_massCSSProperty2,new cssProperty_index.CSSProperty(this,"--mass",0)),__privateSet(this,_stiffnessCSSProperty2,new cssProperty_index.CSSProperty(this,"--stiffness",0)),__privateSet(this,_targetCSSProperty,new cssProperty_index.CSSProperty(this,"--target","")),__privateSet(this,_disabledCSSProperty2,new cssProperty_index.CSSProperty(this,"--disabled",!1)),__privateSet(this,_distanceOffsetCSSProperty,new cssProperty_index.CSSProperty(this,"--distance-offset",0,{rawValueCheck:!1})),__privateSet(this,_startOffsetCSSProperty,new cssProperty_index.CSSProperty(this,"--start-offset",0,{rawValueCheck:!1})),__privateSet(this,_captureOnceCSSProperty,new cssProperty_index.CSSProperty(this,"--capture-once",!1)),__privateSet(this,_capturedCSSProperty,new cssProperty_index.CSSProperty(this,"--captured","")),__privateSet(this,_releasedCSSProperty,new cssProperty_index.CSSProperty(this,"--released","")),__privateSet(this,_capturedFromStartCSSProperty,new cssProperty_index.CSSProperty(this,"--captured-from-start","")),__privateSet(this,_capturedFromFinishCSSProperty,new cssProperty_index.CSSProperty(this,"--captured-from-finish","")),__privateSet(this,_releasedFromStartCSSProperty,new cssProperty_index.CSSProperty(this,"--released-from-start","")),__privateSet(this,_releasedFromFinishCSSProperty,new cssProperty_index.CSSProperty(this,"--released-from-finish","")),__privateSet(this,_passedVarCSSProperty,new cssProperty_index.CSSProperty(this,"--passed-var","")),__privateSet(this,_progressVarCSSProperty,new cssProperty_index.CSSProperty(this,"--progress-var","")),__privateSet(this,_progressArcVarCSSProperty,new cssProperty_index.CSSProperty(this,"--progress-arc-var","")),__privateSet(this,_progressArcMultCSSProperty,new cssProperty_index.CSSProperty(this,"--progress-arc-mult",1)),__privateSet(this,_animationVarTypeCSSProperty,new cssProperty_index.CSSProperty(this,"--animation-var-type","target")),__privateSet(this,_distanceVarCSSProperty,new cssProperty_index.CSSProperty(this,"--distance-var","")),__privateSet(this,_startVarCSSProperty,new cssProperty_index.CSSProperty(this,"--start-var","")),__privateSet(this,_finishVarCSSProperty,new cssProperty_index.CSSProperty(this,"--finish-var","")),__privateSet(this,_isCaptured,new Store.Store(!1)),__privateSet(this,_isReleased,new Store.Store(!1)),__privateSet(this,_isCapturedFromStart,new Store.Store(!1)),__privateSet(this,_isReleasedFromStart,new Store.Store(!1)),__privateSet(this,_isCapturedFromFinish,new Store.Store(!1)),__privateSet(this,_isReleasedFromFinish,new Store.Store(!1)),__privateSet(this,_anotherScrollEntries,[]),__privateSet(this,_targetElement,this),__privateSet(this,_directionPosition,0),__privateSet(this,_directionSize,0),__privateSet(this,_moverDirectionSize,0),__privateSet(this,_passed,new Damped.Damped(0,{order:order_index.TICK_ORDER.SEGMENT,min:0,max:1})),__privateSet(this,_progress,0),__privateSet(this,_start,0),__privateSet(this,_distance2,0),__privateSet(this,_finish,0),__privateSet(this,_isResized,!1),__privateSet(this,_isCapturedOnce,!1),__privateSet(this,_isDisabled,!0),__privateSet(this,_skipPassNotification,!1),this.resize=()=>{__privateSet(this,_directionSize,this.scrollElement.vertical?this.offsetHeight:this.offsetWidth),__privateSet(this,_directionPosition,this.scrollElement.vertical?layout.getCumulativeOffsetTop(this,this.scrollElement):layout.getCumulativeOffsetLeft(this,this.scrollElement));const stickyOffset=layout.getStickyOffset(this,this.scrollElement.vertical?"top":"left");__privateSet(this,_directionPosition,__privateGet(this,_directionPosition)-stickyOffset),__privateSet(this,_start,this.getStart()),__privateSet(this,_distance2,this.getDistance()),__privateSet(this,_start,__privateGet(this,_start)+__privateGet(this,_startOffsetCSSProperty).current),__privateSet(this,_distance2,__privateGet(this,_distance2)+__privateGet(this,_distanceOffsetCSSProperty).current),__privateSet(this,_finish,__privateGet(this,_start)+__privateGet(this,_distance2)),this.scrollElement.currentScrollValue>__privateGet(this,_finish)&&!__privateGet(this,_isCaptured).current&&!__privateGet(this,_isReleased).current&&(__privateGet(this,_isCaptured).current=!0),this.setVar(__privateGet(this,_startVarCSSProperty).current,__privateGet(this,_start)),this.setVar(__privateGet(this,_finishVarCSSProperty).current,__privateGet(this,_finish)),this.setVar(__privateGet(this,_distanceVarCSSProperty).current,__privateGet(this,_distance2)),__privateGet(this,_passed).max=__privateGet(this,_distance2),__privateSet(this,_isResized,!0),__privateGet(this,_tickListener).call(this)},this.findAnotherScrollEntries=_function.debounce(()=>{const allScrollEntriesAbove=scrollEntries_index.scrollEntries.getAll(this).reverse();let scrollIndex=0;allScrollEntriesAbove.forEach((entry,i)=>{entry.element===this.scrollElement&&(scrollIndex=i)}),__privateSet(this,_anotherScrollEntries,allScrollEntriesAbove.slice(scrollIndex+1)),this.tick()},0),__privateSet(this,_resizeListener3,()=>{__privateGet(this,_isDisabled)||this.resize()}),__privateSet(this,_tickListener,()=>{!__privateGet(this,_isDisabled)&&__privateGet(this,_isResized)&&this.tick()})}get distanceOffsetCSSProperty(){return __privateGet(this,_distanceOffsetCSSProperty)}get startOffsetCSSProperty(){return __privateGet(this,_startOffsetCSSProperty)}get captureOnceCSSProperty(){return __privateGet(this,_captureOnceCSSProperty)}get capturedCSSProperty(){return __privateGet(this,_capturedCSSProperty)}get releasedCSSProperty(){return __privateGet(this,_releasedCSSProperty)}get capturedFromStartCSSProperty(){return __privateGet(this,_capturedFromStartCSSProperty)}get capturedFromFinishCSSProperty(){return __privateGet(this,_capturedFromFinishCSSProperty)}get releasedFromStartCSSProperty(){return __privateGet(this,_releasedFromStartCSSProperty)}get releasedFromFinishCSSProperty(){return __privateGet(this,_releasedFromFinishCSSProperty)}get passedVarCSSProperty(){return __privateGet(this,_passedVarCSSProperty)}get progressVarCSSProperty(){return __privateGet(this,_progressVarCSSProperty)}get progressArcVarCSSProperty(){return __privateGet(this,_progressArcVarCSSProperty)}get progressArcMultCSSProperty(){return __privateGet(this,_progressArcMultCSSProperty)}get animationVarTypeCSSProperty(){return __privateGet(this,_animationVarTypeCSSProperty)}get distanceVarCSSProperty(){return __privateGet(this,_distanceVarCSSProperty)}get startVarCSSProperty(){return __privateGet(this,_startVarCSSProperty)}get finishVarCSSProperty(){return __privateGet(this,_finishVarCSSProperty)}get disabledCSSProperty(){return __privateGet(this,_disabledCSSProperty2)}get dampingCSSProperty(){return __privateGet(this,_dampingCSSProperty2)}get massCSSProperty(){return __privateGet(this,_massCSSProperty2)}get stiffnessCSSProperty(){return __privateGet(this,_stiffnessCSSProperty2)}get targetCSSProperty(){return __privateGet(this,_targetCSSProperty)}get isCaptured(){return __privateGet(this,_isCaptured)}get isReleased(){return __privateGet(this,_isReleased)}get isCapturedFromStart(){return __privateGet(this,_isCapturedFromStart)}get isReleasedFromStart(){return __privateGet(this,_isReleasedFromStart)}get isCapturedFromFinish(){return __privateGet(this,_isCapturedFromFinish)}get isReleasedFromFinish(){return __privateGet(this,_isReleasedFromFinish)}get directionPosition(){return __privateGet(this,_directionPosition)}get directionSize(){return __privateGet(this,_directionSize)}get passed(){return __privateGet(this,_passed)}get progress(){return __privateGet(this,_progress)}get progressArc(){return Math.abs(Math.cos(__privateGet(this,_progress)*Math.PI))*__privateGet(this,_progressArcMultCSSProperty).current}get start(){return __privateGet(this,_start)}get finish(){return __privateGet(this,_finish)}get distance(){return __privateGet(this,_distance2)}get isCapturedOnce(){return __privateGet(this,_isCapturedOnce)}get isDisabled(){return __privateGet(this,_isDisabled)}tick(){let scrollValue=this.scrollElement.currentScrollValue;__privateGet(this,_anotherScrollEntries).forEach(se=>{scrollValue+=se.value});const delta=scrollValue-__privateGet(this,_start);__privateGet(this,_skipPassNotification)||__privateSet(this,_skipPassNotification,__privateGet(this,_passed).previous?Math.abs(__privateGet(this,_passed).previous-delta)>1e3:!1),__privateGet(this,_passed).set(delta);const fscrollValue=Math.round(scrollValue);__privateGet(this,_isCaptured).current&&(fscrollValue>=__privateGet(this,_start)?__privateGet(this,_isCapturedFromStart).current||__privateMethod(this,_ScrollSegmentElement_instances,captureFromStartListener_fn).call(this):__privateGet(this,_isCapturedFromStart).current&&!__privateGet(this,_isReleasedFromStart).current&&__privateMethod(this,_ScrollSegmentElement_instances,releaseFromStartListener_fn).call(this),fscrollValue<__privateGet(this,_finish)?__privateGet(this,_isReleasedFromFinish).current&&!__privateGet(this,_isCapturedFromFinish).current&&__privateMethod(this,_ScrollSegmentElement_instances,captureFromFinishListener_fn).call(this):__privateGet(this,_isCapturedFromStart).current&&!__privateGet(this,_isReleasedFromFinish).current&&__privateMethod(this,_ScrollSegmentElement_instances,releaseFromFinishListener_fn).call(this)),fscrollValue>=__privateGet(this,_start)&&fscrollValue<__privateGet(this,_finish)?__privateGet(this,_isCaptured).current||__privateMethod(this,_ScrollSegmentElement_instances,captureListener_fn).call(this):__privateGet(this,_isCaptured).current&&(__privateGet(this,_passed).set(math.step(__privateGet(this,_distance2)/2,__privateGet(this,_passed).target,0,__privateGet(this,_distance2))),__privateMethod(this,_ScrollSegmentElement_instances,releaseListener_fn).call(this)),__privateGet(this,_isCapturedOnce)&&__privateGet(this,_captureOnceCSSProperty).current&&(__privateGet(this,_capturedCSSProperty).current&&__privateGet(this,_targetElement).classList.add(__privateGet(this,_capturedCSSProperty).current),__privateSet(this,_isDisabled,!0))}disable(){this.style.cssText="",__privateSet(this,_directionPosition,0),__privateSet(this,_directionSize,0),__privateGet(this,_passed).reset(),__privateSet(this,_progress,0),__privateSet(this,_start,0),__privateSet(this,_distance2,0),__privateSet(this,_finish,0),__privateSet(this,_isResized,!1),__privateGet(this,_isCaptured).current=!1,__privateGet(this,_isReleased).current=!1,__privateGet(this,_isCapturedFromStart).current=!1,__privateGet(this,_isReleasedFromStart).current=!1,__privateGet(this,_isCapturedFromFinish).current=!1,__privateGet(this,_isReleasedFromFinish).current=!1,__privateSet(this,_isCapturedOnce,!1),__privateSet(this,_isDisabled,!0),__privateMethod(this,_ScrollSegmentElement_instances,removeCurrentMarks_fn).call(this)}enable(){__privateSet(this,_isDisabled,!1)}connectedCallback(){super.connectedCallback(),__privateGet(this,_isCaptured).subscribe(state=>{state.current&&events.dispatchEvent(this,"scrollSegmentCapture",{composed:!0,custom:!0})}),__privateGet(this,_isCapturedFromStart).subscribe(state=>{state.current&&events.dispatchEvent(this,"scrollSegmentCaptureFromStart",{composed:!0,custom:!0})}),__privateGet(this,_isCapturedFromFinish).subscribe(state=>{state.current&&events.dispatchEvent(this,"scrollSegmentCaptureFromFinish",{composed:!0,custom:!0})}),__privateGet(this,_isReleased).subscribe(state=>{state.current&&events.dispatchEvent(this,"scrollSegmentRelease",{composed:!0,custom:!0})}),__privateGet(this,_isReleasedFromStart).subscribe(state=>{state.current&&events.dispatchEvent(this,"scrollSegmentReleaseFromStart",{composed:!0,custom:!0})}),__privateGet(this,_isReleasedFromFinish).subscribe(state=>{state.current&&events.dispatchEvent(this,"scrollSegmentReleaseFromFinish",{composed:!0,custom:!0})}),__privateGet(this,_dampingCSSProperty2).observe(),__privateGet(this,_massCSSProperty2).observe(),__privateGet(this,_stiffnessCSSProperty2).observe(),__privateGet(this,_targetCSSProperty).observe(),__privateGet(this,_disabledCSSProperty2).observe(),__privateGet(this,_distanceOffsetCSSProperty).observe(),__privateGet(this,_startOffsetCSSProperty).observe(),__privateGet(this,_captureOnceCSSProperty).observe(),__privateGet(this,_capturedCSSProperty).observe(),__privateGet(this,_releasedCSSProperty).observe(),__privateGet(this,_capturedFromStartCSSProperty).observe(),__privateGet(this,_capturedFromFinishCSSProperty).observe(),__privateGet(this,_releasedFromStartCSSProperty).observe(),__privateGet(this,_releasedFromFinishCSSProperty).observe(),__privateGet(this,_passedVarCSSProperty).observe(),__privateGet(this,_progressVarCSSProperty).observe(),__privateGet(this,_progressArcVarCSSProperty).observe(),__privateGet(this,_progressArcMultCSSProperty).observe(),__privateGet(this,_animationVarTypeCSSProperty).observe(),__privateGet(this,_distanceVarCSSProperty).observe(),__privateGet(this,_startVarCSSProperty).observe(),__privateGet(this,_finishVarCSSProperty).observe();let isConnected=!1;this.findAnotherScrollEntries(),__privateGet(this,_disabledCSSProperty2).current||this.enable(),__privateGet(this,_dampingCSSProperty2).subscribe(e=>{__privateGet(this,_passed).damping=e.current}),__privateGet(this,_massCSSProperty2).subscribe(e=>{__privateGet(this,_passed).mass=e.current}),__privateGet(this,_stiffnessCSSProperty2).subscribe(e=>{__privateGet(this,_passed).stiffness=e.current}),__privateGet(this,_targetCSSProperty).subscribe(e=>{e.previous&&__privateMethod(this,_ScrollSegmentElement_instances,removeCurrentMarks_fn).call(this),e.current?e.current==="parent"?__privateSet(this,_targetElement,this.parentElement||this):__privateSet(this,_targetElement,document.querySelector(e.current)||this):__privateSet(this,_targetElement,this)}),__privateGet(this,_disabledCSSProperty2).subscribe(e=>{e.current&&!e.previous?this.disable():!e.current&&e.previous&&(this.resize(),this.enable())}),__privateGet(this,_startOffsetCSSProperty).subscribe(()=>{isConnected&&!__privateGet(this,_isDisabled)&&this.resize()}),__privateGet(this,_distanceOffsetCSSProperty).subscribe(()=>{isConnected&&!__privateGet(this,_isDisabled)&&this.resize()}),__privateGet(this,_capturedCSSProperty).subscribe(e=>{__privateMethod(this,_ScrollSegmentElement_instances,handleClassSetting_fn).call(this,e)}),__privateGet(this,_capturedFromStartCSSProperty).subscribe(e=>{__privateMethod(this,_ScrollSegmentElement_instances,handleClassSetting_fn).call(this,e)}),__privateGet(this,_capturedFromFinishCSSProperty).subscribe(e=>{__privateMethod(this,_ScrollSegmentElement_instances,handleClassSetting_fn).call(this,e)}),__privateGet(this,_releasedCSSProperty).subscribe(e=>{__privateMethod(this,_ScrollSegmentElement_instances,handleClassSetting_fn).call(this,e)}),__privateGet(this,_releasedFromStartCSSProperty).subscribe(e=>{__privateMethod(this,_ScrollSegmentElement_instances,handleClassSetting_fn).call(this,e)}),__privateGet(this,_releasedFromFinishCSSProperty).subscribe(e=>{__privateMethod(this,_ScrollSegmentElement_instances,handleClassSetting_fn).call(this,e)}),__privateGet(this,_captureOnceCSSProperty).subscribe(v=>{__privateGet(this,_isDisabled)||!v.current&&v.previous&&(this.resize(),this.enable())}),__privateGet(this,_passedVarCSSProperty).subscribe(v=>{__privateGet(this,_isDisabled)||(this.removeVar(v.previous),this.setVar(v.current,this.passed.current))}),__privateGet(this,_progressVarCSSProperty).subscribe(v=>{__privateGet(this,_isDisabled)||(this.removeVar(v.previous),this.setVar(v.current,__privateGet(this,_progress)))}),__privateGet(this,_progressArcVarCSSProperty).subscribe(v=>{__privateGet(this,_isDisabled)||(this.removeVar(v.previous),this.setVar(v.current,this.progressArc))}),__privateGet(this,_progressArcMultCSSProperty).subscribe(v=>{__privateGet(this,_isDisabled)||__privateMethod(this,_ScrollSegmentElement_instances,updateProgress_fn).call(this)}),__privateGet(this,_startVarCSSProperty).subscribe(v=>{__privateGet(this,_isDisabled)||(this.removeVar(v.previous),this.setVar(v.current,__privateGet(this,_start)))}),__privateGet(this,_finishVarCSSProperty).subscribe(v=>{__privateGet(this,_isDisabled)||(this.removeVar(v.previous),this.setVar(v.current,__privateGet(this,_finish)))}),__privateGet(this,_distanceVarCSSProperty).subscribe(v=>{__privateGet(this,_isDisabled)||(this.removeVar(v.previous),this.setVar(v.current,__privateGet(this,_distance2)))}),__privateGet(this,_passed).subscribe(e=>{if(__privateGet(this,_skipPassNotification)){__privateSet(this,_skipPassNotification,!1);return}__privateMethod(this,_ScrollSegmentElement_instances,updateProgress_fn).call(this)}),this.scrollElement.addEventListener("scrollSectionsChange",this.findAnotherScrollEntries),this.scrollElement.addEventListener("scrollResize",this.resize),windowResizer_index.windowResizer.subscribe(__privateGet(this,_resizeListener3),order_index.RESIZE_ORDER.SCROLL+1),this.scrollElement.onScroll(__privateGet(this,_tickListener)),isConnected=!0}disconnectedCallback(){windowResizer_index.windowResizer.unsubscribe(__privateGet(this,_resizeListener3)),this.scrollElement.offScroll(__privateGet(this,_tickListener)),this.scrollElement.removeEventListener("scrollSectionsChange",this.findAnotherScrollEntries),this.scrollElement.removeEventListener("scrollResize",this.resize),__privateGet(this,_dampingCSSProperty2).close(),__privateGet(this,_massCSSProperty2).close(),__privateGet(this,_stiffnessCSSProperty2).close(),__privateGet(this,_targetCSSProperty).close(),__privateGet(this,_disabledCSSProperty2).close(),__privateGet(this,_distanceOffsetCSSProperty).close(),__privateGet(this,_startOffsetCSSProperty).close(),__privateGet(this,_captureOnceCSSProperty).close(),__privateGet(this,_capturedCSSProperty).close(),__privateGet(this,_releasedCSSProperty).close(),__privateGet(this,_capturedFromStartCSSProperty).close(),__privateGet(this,_capturedFromFinishCSSProperty).close(),__privateGet(this,_releasedFromStartCSSProperty).close(),__privateGet(this,_releasedFromFinishCSSProperty).close(),__privateGet(this,_passedVarCSSProperty).close(),__privateGet(this,_progressVarCSSProperty).close(),__privateGet(this,_progressArcVarCSSProperty).close(),__privateGet(this,_progressArcMultCSSProperty).close(),__privateGet(this,_distanceVarCSSProperty).close(),__privateGet(this,_startVarCSSProperty).close(),__privateGet(this,_finishVarCSSProperty).close(),__privateGet(this,_isCaptured).close(),__privateGet(this,_isReleased).close(),__privateGet(this,_isCapturedFromStart).close(),__privateGet(this,_isReleasedFromStart).close(),__privateGet(this,_isCapturedFromFinish).close(),__privateGet(this,_isReleasedFromFinish).close(),this.disable(),__privateGet(this,_passed).close()}removeVar(name){name&&__privateGet(this,_targetElement).style.removeProperty(`--${name}`)}setVar(name,value){if(name){const v=typeof value=="number"?value.toFixed(6):value;__privateGet(this,_targetElement).style.setProperty(`--${name}`,v)}}getDistance(){return __privateGet(this,_directionSize)+__privateGet(this,_moverDirectionSize)}getStart(){return __privateGet(this,_directionPosition)-__privateGet(this,_moverDirectionSize)}};_dampingCSSProperty2=new WeakMap,_massCSSProperty2=new WeakMap,_stiffnessCSSProperty2=new WeakMap,_targetCSSProperty=new WeakMap,_disabledCSSProperty2=new WeakMap,_distanceOffsetCSSProperty=new WeakMap,_startOffsetCSSProperty=new WeakMap,_captureOnceCSSProperty=new WeakMap,_capturedCSSProperty=new WeakMap,_releasedCSSProperty=new WeakMap,_capturedFromStartCSSProperty=new WeakMap,_capturedFromFinishCSSProperty=new WeakMap,_releasedFromStartCSSProperty=new WeakMap,_releasedFromFinishCSSProperty=new WeakMap,_passedVarCSSProperty=new WeakMap,_progressVarCSSProperty=new WeakMap,_progressArcVarCSSProperty=new WeakMap,_progressArcMultCSSProperty=new WeakMap,_animationVarTypeCSSProperty=new WeakMap,_distanceVarCSSProperty=new WeakMap,_startVarCSSProperty=new WeakMap,_finishVarCSSProperty=new WeakMap,_isCaptured=new WeakMap,_isReleased=new WeakMap,_isCapturedFromStart=new WeakMap,_isReleasedFromStart=new WeakMap,_isCapturedFromFinish=new WeakMap,_isReleasedFromFinish=new WeakMap,_anotherScrollEntries=new WeakMap,_targetElement=new WeakMap,_directionPosition=new WeakMap,_directionSize=new WeakMap,_moverDirectionSize=new WeakMap,_passed=new WeakMap,_progress=new WeakMap,_start=new WeakMap,_distance2=new WeakMap,_finish=new WeakMap,_isResized=new WeakMap,_isCapturedOnce=new WeakMap,_isDisabled=new WeakMap,_skipPassNotification=new WeakMap,_ScrollSegmentElement_instances=new WeakSet,captureListener_fn=__name(function(){__privateGet(this,_isCaptured).current=!0,__privateGet(this,_isReleased).current=!1,__privateSet(this,_isCapturedOnce,!0),__privateGet(this,_releasedCSSProperty).current&&__privateGet(this,_targetElement).classList.remove(__privateGet(this,_releasedCSSProperty).current),__privateGet(this,_releasedFromFinishCSSProperty).current&&__privateGet(this,_targetElement).classList.remove(__privateGet(this,_releasedFromFinishCSSProperty).current),__privateGet(this,_releasedFromFinishCSSProperty).current&&__privateGet(this,_targetElement).classList.remove(__privateGet(this,_releasedFromFinishCSSProperty).current),__privateGet(this,_capturedCSSProperty).current&&__privateGet(this,_targetElement).classList.add(__privateGet(this,_capturedCSSProperty).current)},"#captureListener"),releaseListener_fn=__name(function(){__privateGet(this,_isReleased).current=!0,__privateGet(this,_isCaptured).current=!1,__privateSet(this,_isCapturedOnce,!0),__privateGet(this,_capturedCSSProperty).current&&__privateGet(this,_targetElement).classList.remove(__privateGet(this,_capturedCSSProperty).current),__privateGet(this,_capturedFromStartCSSProperty).current&&__privateGet(this,_targetElement).classList.remove(__privateGet(this,_capturedFromStartCSSProperty).current),__privateGet(this,_capturedFromFinishCSSProperty).current&&__privateGet(this,_targetElement).classList.remove(__privateGet(this,_capturedFromFinishCSSProperty).current),__privateGet(this,_releasedCSSProperty).current&&__privateGet(this,_targetElement).classList.add(__privateGet(this,_releasedCSSProperty).current)},"#releaseListener"),captureFromStartListener_fn=__name(function(){__privateGet(this,_isCaptured).current=!0,__privateGet(this,_isCapturedFromStart).current=!0,__privateGet(this,_isReleasedFromStart).current=!1,__privateGet(this,_capturedFromStartCSSProperty).current&&__privateGet(this,_targetElement).classList.add(__privateGet(this,_capturedFromStartCSSProperty).current)},"#captureFromStartListener"),captureFromFinishListener_fn=__name(function(){__privateGet(this,_isCaptured).current=!0,__privateGet(this,_isCapturedFromFinish).current=!0,__privateGet(this,_isReleasedFromFinish).current=!1,__privateGet(this,_capturedFromFinishCSSProperty).current&&__privateGet(this,_targetElement).classList.add(__privateGet(this,_capturedFromFinishCSSProperty).current)},"#captureFromFinishListener"),releaseFromStartListener_fn=__name(function(){__privateGet(this,_isReleased).current=!0,__privateGet(this,_isReleasedFromStart).current=!0,__privateGet(this,_isCapturedFromStart).current=!1,__privateGet(this,_releasedFromFinishCSSProperty).current&&__privateGet(this,_targetElement).classList.add(__privateGet(this,_releasedFromFinishCSSProperty).current)},"#releaseFromStartListener"),releaseFromFinishListener_fn=__name(function(){__privateGet(this,_isReleased).current=!0,__privateGet(this,_isReleasedFromFinish).current=!0,__privateGet(this,_isCapturedFromFinish).current=!1,__privateGet(this,_releasedFromFinishCSSProperty).current&&__privateGet(this,_targetElement).classList.add(__privateGet(this,_releasedFromFinishCSSProperty).current)},"#releaseFromFinishListener"),_resizeListener3=new WeakMap,_tickListener=new WeakMap,updateProgress_fn=__name(function(){const passedValue=__privateGet(this,_passed)[__privateGet(this,_animationVarTypeCSSProperty).current];this.setVar(__privateGet(this,_passedVarCSSProperty).current,passedValue),__privateSet(this,_progress,passedValue/__privateGet(this,_distance2)||0),this.setVar(__privateGet(this,_progressVarCSSProperty).current,__privateGet(this,_progress)),__privateGet(this,_progressArcVarCSSProperty).current&&this.setVar(__privateGet(this,_progressArcVarCSSProperty).current,this.progressArc)},"#updateProgress"),handleClassSetting_fn=__name(function(e){if(__privateGet(this,_isDisabled)){e.previous&&__privateGet(this,_targetElement).classList.remove(e.previous),e.current&&__privateGet(this,_targetElement).classList.remove(e.current);return}e.current&&__privateGet(this,_isCaptured).current?(e.previous&&__privateGet(this,_targetElement).classList.remove(e.previous),__privateGet(this,_targetElement).classList.add(e.current)):!e.current&&e.previous&&__privateGet(this,_targetElement).classList.remove(e.previous)},"#handleClassSetting"),removeClasses_fn=__name(function(...className){className.forEach(c=>{c&&__privateGet(this,_targetElement).classList.remove(c)})},"#removeClasses"),removeVars_fn=__name(function(...vars){vars.forEach(v=>{v&&__privateGet(this,_targetElement).style.removeProperty(`--${v}`)})},"#removeVars"),removeCurrentMarks_fn=__name(function(){__privateMethod(this,_ScrollSegmentElement_instances,removeClasses_fn).call(this,__privateGet(this,_capturedCSSProperty).current,__privateGet(this,_capturedFromStartCSSProperty).current,__privateGet(this,_capturedFromFinishCSSProperty).current,__privateGet(this,_releasedCSSProperty).current,__privateGet(this,_releasedFromStartCSSProperty).current,__privateGet(this,_releasedFromFinishCSSProperty).current),__privateMethod(this,_ScrollSegmentElement_instances,removeVars_fn).call(this,__privateGet(this,_passedVarCSSProperty).current,__privateGet(this,_progressVarCSSProperty).current,__privateGet(this,_progressArcVarCSSProperty).current,__privateGet(this,_distanceVarCSSProperty).current,__privateGet(this,_startVarCSSProperty).current,__privateGet(this,_finishVarCSSProperty).current)},"#removeCurrentMarks"),__name(_ScrollSegmentElement,"ScrollSegmentElement");let ScrollSegmentElement=_ScrollSegmentElement;Store.isBrowser&&!customElements.get("e-scroll-segment")&&customElements.define("e-scroll-segment",ScrollSegmentElement);const _ScrollSectionButtonElement=class _ScrollSectionButtonElement extends ScrollButtonElement{handleClick(options){this.scrollElement.setPosition(this.scrollElement.vertical?layout.getCumulativeOffsetTop(this):layout.getCumulativeOffsetLeft(this),options)}connectedCallback(){super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback()}};__name(_ScrollSectionButtonElement,"ScrollSectionButtonElement");let ScrollSectionButtonElement=_ScrollSectionButtonElement;Store.isBrowser&&!customElements.get("e-scroll-section-button")&&customElements.define("e-scroll-section-button",ScrollSectionButtonElement);var _counterChangeListener2;const _ScrollCounterElement=class _ScrollCounterElement extends ScrollUserElement{constructor(){super(...arguments);__privateAdd(this,_counterChangeListener2,__name(()=>{const value=this.scrollElement.counter.current+1,pad=parseInt(this.getAttribute("pad")||"0");this.textContent=value.toString().padStart(pad,"0")},"#counterChangeListener"))}connectedCallback(){return __async(this,null,function*(){__superGet(_ScrollCounterElement.prototype,this,"connectedCallback").call(this),this.scrollElement.counter.subscribe(__privateGet(this,_counterChangeListener2))})}disconnectedCallback(){this.scrollElement.counter.unsubscribe(__privateGet(this,_counterChangeListener2))}};_counterChangeListener2=new WeakMap,__name(_ScrollCounterElement,"ScrollCounterElement");let ScrollCounterElement=_ScrollCounterElement;Store.isBrowser&&!customElements.get("e-scroll-counter")&&customElements.define("e-scroll-counter",ScrollCounterElement);var _sectionsChangeListener2;const _ScrollTotalElement=class _ScrollTotalElement extends ScrollUserElement{constructor(){super(...arguments);__privateAdd(this,_sectionsChangeListener2,__name(()=>{const value=this.scrollElement.limit+1,pad=parseInt(this.getAttribute("pad")||"0");this.textContent=value.toString().padStart(pad,"0")},"#sectionsChangeListener"))}connectedCallback(){return __async(this,null,function*(){__superGet(_ScrollTotalElement.prototype,this,"connectedCallback").call(this),this.scrollElement.sectionsInViewCSSProperty.subscribe(__privateGet(this,_sectionsChangeListener2)),this.scrollElement.addEventListener("scrollSectionsChange",__privateGet(this,_sectionsChangeListener2)),__privateGet(this,_sectionsChangeListener2).call(this)})}disconnectedCallback(){this.scrollElement.sectionsInViewCSSProperty.unsubscribe(__privateGet(this,_sectionsChangeListener2)),this.scrollElement.removeEventListener("scrollSectionsChange",__privateGet(this,_sectionsChangeListener2))}};_sectionsChangeListener2=new WeakMap,__name(_ScrollTotalElement,"ScrollTotalElement");let ScrollTotalElement=_ScrollTotalElement;Store.isBrowser&&!customElements.get("e-scroll-total")&&customElements.define("e-scroll-total",ScrollTotalElement);exports.ScrollBulletButtonsElement=ScrollBulletButtonsElement;exports.ScrollCounterElement=ScrollCounterElement;exports.ScrollElement=ScrollElement;exports.ScrollScrollbarElement=ScrollScrollbarElement;exports.ScrollSectionButtonElement=ScrollSectionButtonElement;exports.ScrollSegmentElement=ScrollSegmentElement;exports.ScrollSetButtonElement=ScrollSetButtonElement;exports.ScrollStepButtonElement=ScrollStepButtonElement;exports.ScrollTotalElement=ScrollTotalElement;
@@ -47,7 +47,7 @@ import { elementResizer } from "../element-resizer/index.js";
47
47
  import { scrollEntries } from "../scroll-entries/index.js";
48
48
  import { i as isElementVisible } from "../element-DKw5H-Tu.js";
49
49
  import { d as dispatchEvent } from "../events-Ds-TuvYW.js";
50
- import { b as getCumulativeOffsetTop, a as getCumulativeOffsetLeft, g as getStickyOffset } from "../layout-BL6AX9-r.js";
50
+ import { b as getCumulativeOffsetTop, a as getCumulativeOffsetLeft, g as getStickyOffset } from "../layout-DxOCR4qe.js";
51
51
  import { c as createStylesheet } from "../stylesheet-GIzIJ_Xj.js";
52
52
  import { windowResizer } from "../window-resizer/index.js";
53
53
  import "construct-style-sheets-polyfill";
@@ -3,7 +3,7 @@ var __name = (target, value) => __defProp(target, "name", { value, configurable:
3
3
  import { T as Tweened } from "./Tweened-DuJCwQl7.js";
4
4
  import { TICK_ORDER } from "./order/index.js";
5
5
  import { g as getElement, f as findScrollParentElement } from "./dom-D8D-_9ty.js";
6
- import { b as getCumulativeOffsetTop } from "./layout-BL6AX9-r.js";
6
+ import { b as getCumulativeOffsetTop } from "./layout-DxOCR4qe.js";
7
7
  import "construct-style-sheets-polyfill";
8
8
  import "./index-DAG0CtYo.js";
9
9
  const scrollToElementTweened = { value: null };
@@ -1 +1 @@
1
- "use strict";var __defProp=Object.defineProperty;var __name=(target,value)=>__defProp(target,"name",{value,configurable:!0});const Tweened=require("./Tweened-BZoUkI7O.cjs"),order_index=require("./order/index.cjs"),dom=require("./dom-B40i6NXw.cjs"),layout=require("./layout-CnGLl7oe.cjs");require("construct-style-sheets-polyfill");require("./index-BoGx2BWX.cjs");const scrollToElementTweened={value:null};function scrollToElement(elementOrSelectorOrNumber,{behavior="instant",offset=0,center=!1,scrollElement,scrollCallback,duration,easing,startValue}={}){var _a;let elementPosition,centerElement=scrollElement,scrollContainerElement=scrollElement;if(typeof elementOrSelectorOrNumber=="number")elementPosition=elementOrSelectorOrNumber;else{const element=dom.getElement(elementOrSelectorOrNumber);element&&(centerElement=element,scrollContainerElement=scrollElement||dom.findScrollParentElement(element),elementPosition=layout.getCumulativeOffsetTop(element))}if(centerElement&&scrollContainerElement&&typeof elementPosition=="number"){const offsetValue=typeof offset=="number"?offset:typeof offset=="string"&&!isNaN(parseFloat(offset))?parseFloat(offset):(((_a=dom.getElement(offset))==null?void 0:_a.offsetHeight)||0)*-1,height=centerElement instanceof HTMLElement?centerElement.offsetHeight:innerHeight,centerValue=center?innerHeight/2*-1+height/2:0,top=elementPosition+offsetValue+centerValue,scrollToValue=__name(value=>{scrollContainerElement instanceof HTMLElement&&scrollContainerElement.tagName==="E-SMOOTH-SCROLL"?scrollContainerElement.scrollToValue(value,duration?"instant":behavior):scrollContainerElement.scroll({top:value,behavior:duration?"instant":behavior})},"scrollToValue");if(duration){scrollToElementTweened.value&&scrollToElementTweened.value.close();let tweenedStart=0;startValue?tweenedStart=startValue:scrollContainerElement instanceof HTMLElement?tweenedStart=scrollContainerElement.scrollTop:tweenedStart=window.scrollY,scrollToElementTweened.value=new Tweened.Tweened(tweenedStart,{order:order_index.TICK_ORDER.SCROLL}),scrollToElementTweened.value.subscribe(e=>{scrollCallback?scrollCallback(e.current):scrollToValue(e.current)}),scrollToElementTweened.value.set(top,{duration:Math.min(duration,duration*(Math.abs(tweenedStart-top)/3e3)),easing})}else scrollCallback?scrollCallback(top):scrollToValue(top)}}__name(scrollToElement,"scrollToElement");exports.scrollToElement=scrollToElement;exports.scrollToElementTweened=scrollToElementTweened;
1
+ "use strict";var __defProp=Object.defineProperty;var __name=(target,value)=>__defProp(target,"name",{value,configurable:!0});const Tweened=require("./Tweened-BZoUkI7O.cjs"),order_index=require("./order/index.cjs"),dom=require("./dom-B40i6NXw.cjs"),layout=require("./layout-rR4-aYTY.cjs");require("construct-style-sheets-polyfill");require("./index-BoGx2BWX.cjs");const scrollToElementTweened={value:null};function scrollToElement(elementOrSelectorOrNumber,{behavior="instant",offset=0,center=!1,scrollElement,scrollCallback,duration,easing,startValue}={}){var _a;let elementPosition,centerElement=scrollElement,scrollContainerElement=scrollElement;if(typeof elementOrSelectorOrNumber=="number")elementPosition=elementOrSelectorOrNumber;else{const element=dom.getElement(elementOrSelectorOrNumber);element&&(centerElement=element,scrollContainerElement=scrollElement||dom.findScrollParentElement(element),elementPosition=layout.getCumulativeOffsetTop(element))}if(centerElement&&scrollContainerElement&&typeof elementPosition=="number"){const offsetValue=typeof offset=="number"?offset:typeof offset=="string"&&!isNaN(parseFloat(offset))?parseFloat(offset):(((_a=dom.getElement(offset))==null?void 0:_a.offsetHeight)||0)*-1,height=centerElement instanceof HTMLElement?centerElement.offsetHeight:innerHeight,centerValue=center?innerHeight/2*-1+height/2:0,top=elementPosition+offsetValue+centerValue,scrollToValue=__name(value=>{scrollContainerElement instanceof HTMLElement&&scrollContainerElement.tagName==="E-SMOOTH-SCROLL"?scrollContainerElement.scrollToValue(value,duration?"instant":behavior):scrollContainerElement.scroll({top:value,behavior:duration?"instant":behavior})},"scrollToValue");if(duration){scrollToElementTweened.value&&scrollToElementTweened.value.close();let tweenedStart=0;startValue?tweenedStart=startValue:scrollContainerElement instanceof HTMLElement?tweenedStart=scrollContainerElement.scrollTop:tweenedStart=window.scrollY,scrollToElementTweened.value=new Tweened.Tweened(tweenedStart,{order:order_index.TICK_ORDER.SCROLL}),scrollToElementTweened.value.subscribe(e=>{scrollCallback?scrollCallback(e.current):scrollToValue(e.current)}),scrollToElementTweened.value.set(top,{duration:Math.min(duration,duration*(Math.abs(tweenedStart-top)/3e3)),easing})}else scrollCallback?scrollCallback(top):scrollToValue(top)}}__name(scrollToElement,"scrollToElement");exports.scrollToElement=scrollToElement;exports.scrollToElementTweened=scrollToElementTweened;
@@ -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),__privateMethod=(obj,member,method)=>(__accessCheck(obj,member,"access private method"),method);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ticker_index=require("../index-BoGx2BWX.cjs"),Store=require("../Store-B96mD8mD.cjs"),dom=require("../dom-B40i6NXw.cjs"),gestures=require("../gestures-DtYbQr49.cjs");require("construct-style-sheets-polyfill");const order_index=require("../order/index.cjs"),Damped=require("../Damped-B_mVO810.cjs"),cssProperty_index=require("../css-property/index.cjs"),Viewport=require("../Viewport-Blxv_yl_.cjs"),scrollEntries_index=require("../scroll-entries/index.cjs"),scroll=require("../scroll-DfvKl-On.cjs"),elementLinkedStore_index=require("../element-linked-store/index.cjs"),elementResizer_index=require("../element-resizer/index.cjs"),events=require("../events-UlGk63iC.cjs"),layout=require("../layout-CnGLl7oe.cjs"),loading=require("../loading-7Ju1mFST.cjs"),math=require("../math-C-knY2TL.cjs"),windowResizer_index=require("../window-resizer/index.cjs");var _scrollElement,_thumbElement,_thumbScrollSize,_limit,_isHorizontal,_activeTimeoutId,_ScrollbarElement_instances,init_fn,destroy_fn,scrollPosition_get,scrollSize_get,scrollViewportSize_get,_scrollListener,_resizeListener,_grabListener,_tickListener,_intersectionListener,_spaUpdateListener;const _ScrollbarElement=class _ScrollbarElement extends HTMLElement{constructor(){super(...arguments);__privateAdd(this,_ScrollbarElement_instances);__privateAdd(this,_scrollElement,null);__privateAdd(this,_thumbElement,null);__privateAdd(this,_thumbScrollSize,0);__privateAdd(this,_limit,0);__privateAdd(this,_isHorizontal,!1);__privateAdd(this,_activeTimeoutId);__privateAdd(this,_scrollListener,__name(()=>{this.classList.add("active"),clearTimeout(__privateGet(this,_activeTimeoutId));const position=__privateGet(this,_ScrollbarElement_instances,scrollPosition_get)/__privateGet(this,_limit)*__privateGet(this,_thumbScrollSize);__privateGet(this,_isHorizontal)?__privateGet(this,_thumbElement).style.transform=`translate3d(${position}px, 0px, 0px)`:__privateGet(this,_thumbElement).style.transform=`translate3d(0px, ${position}px, 0px)`,__privateSet(this,_activeTimeoutId,setTimeout(()=>{this.classList.remove("active")},1e3))},"#scrollListener"));__privateAdd(this,_resizeListener,__name(()=>{const barSize=__privateGet(this,_isHorizontal)?this.offsetWidth:this.offsetHeight,scrollSize=__privateGet(this,_ScrollbarElement_instances,scrollSize_get),viewportSize=__privateGet(this,_ScrollbarElement_instances,scrollViewportSize_get);__privateSet(this,_limit,scrollSize-viewportSize);let thumbSize=barSize*barSize/(__privateGet(this,_limit)+barSize);thumbSize=Math.max(thumbSize,30),__privateGet(this,_isHorizontal)?(__privateGet(this,_thumbElement).style.width=thumbSize+"px",__privateGet(this,_thumbElement).style.height="100%"):(__privateGet(this,_thumbElement).style.width="100%",__privateGet(this,_thumbElement).style.height=thumbSize+"px"),__privateSet(this,_thumbScrollSize,barSize-thumbSize),scrollSize<=viewportSize?this.style.display="none":this.style.display="block"},"#resizeListener"));__privateAdd(this,_grabListener,__name(grabEvent=>{const startValue=__privateGet(this,_ScrollbarElement_instances,scrollPosition_get),grabCursor=__privateGet(this,_isHorizontal)?grabEvent.x:grabEvent.y;gestures.setupDrag(moveEvent=>{const mult=__privateGet(this,_limit)/__privateGet(this,_thumbScrollSize),delta=(__privateGet(this,_isHorizontal)?moveEvent.x-grabCursor:moveEvent.y-grabCursor)*mult;__privateGet(this,_isHorizontal)?__privateGet(this,_scrollElement).scroll({left:startValue+delta,behavior:"instant"}):__privateGet(this,_scrollElement).scroll({top:startValue+delta,behavior:"instant"})})},"#grabListener"));__privateAdd(this,_tickListener,__name(()=>{__privateGet(this,_resizeListener).call(this)},"#tickListener"));__privateAdd(this,_intersectionListener,__name(e=>{e.isIntersecting?(ticker_index.ticker.subscribe(__privateGet(this,_tickListener),{maxFPS:5}),__privateGet(this,_tickListener).call(this)):ticker_index.ticker.unsubscribe(__privateGet(this,_tickListener))},"#intersectionListener"));__privateAdd(this,_spaUpdateListener,__name(()=>{__privateMethod(this,_ScrollbarElement_instances,destroy_fn).call(this),__privateMethod(this,_ScrollbarElement_instances,init_fn).call(this)},"#spaUpdateListener"))}connectedCallback(){__privateMethod(this,_ScrollbarElement_instances,init_fn).call(this),document.addEventListener("spaAfterUpdate",__privateGet(this,_spaUpdateListener))}disconnectedCallback(){__privateMethod(this,_ScrollbarElement_instances,destroy_fn).call(this),document.removeEventListener("spaAfterUpdate",__privateGet(this,_spaUpdateListener))}};_scrollElement=new WeakMap,_thumbElement=new WeakMap,_thumbScrollSize=new WeakMap,_limit=new WeakMap,_isHorizontal=new WeakMap,_activeTimeoutId=new WeakMap,_ScrollbarElement_instances=new WeakSet,init_fn=__name(function(){const scrollSelector=this.getAttribute("data-scroll");let scrollElement=null;scrollSelector&&(scrollSelector==="parent"?scrollElement=this.parentElement:scrollElement=document.querySelector(scrollSelector)),scrollElement||(scrollElement=dom.findScrollParentElement(this),scrollElement===document.body&&(scrollElement=window)),__privateSet(this,_isHorizontal,this.hasAttribute("horisontal"));const thumbElement=this.querySelector("[data-thumb]");scrollElement&&thumbElement&&(__privateSet(this,_scrollElement,scrollElement),__privateSet(this,_thumbElement,thumbElement),__privateGet(this,_scrollElement).addEventListener("scroll",__privateGet(this,_scrollListener)),__privateGet(this,_thumbElement).addEventListener("pointerdown",__privateGet(this,_grabListener)),ticker_index.intersector.subscribe(this.parentElement===document.body?this:this.parentElement,__privateGet(this,_intersectionListener)))},"#init"),destroy_fn=__name(function(){var _a,_b;(_a=__privateGet(this,_scrollElement))==null||_a.removeEventListener("scroll",__privateGet(this,_scrollListener)),(_b=__privateGet(this,_thumbElement))==null||_b.removeEventListener("pointerdown",__privateGet(this,_grabListener)),clearTimeout(__privateGet(this,_activeTimeoutId)),ticker_index.intersector.unsubscribe(__privateGet(this,_intersectionListener)),ticker_index.ticker.unsubscribe(__privateGet(this,_tickListener))},"#destroy"),scrollPosition_get=__name(function(){return __privateGet(this,_scrollElement)instanceof HTMLElement?__privateGet(this,_isHorizontal)?__privateGet(this,_scrollElement).scrollLeft:__privateGet(this,_scrollElement).scrollTop:__privateGet(this,_isHorizontal)?__privateGet(this,_scrollElement).scrollX:__privateGet(this,_scrollElement).scrollY},"#scrollPosition"),scrollSize_get=__name(function(){return __privateGet(this,_scrollElement)instanceof HTMLElement?__privateGet(this,_isHorizontal)?__privateGet(this,_scrollElement).scrollWidth:__privateGet(this,_scrollElement).scrollHeight:__privateGet(this,_isHorizontal)?Math.max(document.body.scrollWidth,document.documentElement.scrollWidth,document.body.offsetWidth,document.documentElement.offsetWidth,document.body.clientWidth,document.documentElement.clientWidth):Math.max(document.body.scrollHeight,document.documentElement.scrollHeight,document.body.offsetHeight,document.documentElement.offsetHeight,document.body.clientHeight,document.documentElement.clientHeight)},"#scrollSize"),scrollViewportSize_get=__name(function(){return __privateGet(this,_scrollElement)instanceof HTMLElement?__privateGet(this,_isHorizontal)?__privateGet(this,_scrollElement).offsetWidth:__privateGet(this,_scrollElement).offsetHeight:__privateGet(this,_isHorizontal)?innerWidth:innerHeight},"#scrollViewportSize"),_scrollListener=new WeakMap,_resizeListener=new WeakMap,_grabListener=new WeakMap,_tickListener=new WeakMap,_intersectionListener=new WeakMap,_spaUpdateListener=new WeakMap,__name(_ScrollbarElement,"ScrollbarElement");let ScrollbarElement=_ScrollbarElement;Store.isBrowser&&!customElements.get("e-scrollbar")&&customElements.define("e-scrollbar",ScrollbarElement);const scrollKeys=new Set(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight","PageUp","PageDown","Home","End","Space"]);var _cssDisabled,_cssDamping,_value,_currentRoundedValue,_needSync,_SmoothScrollElement_instances,checkDisabled_fn,_wheelListener,_pointerdownListener,_resizeListener2,_keydownListener,_scrollListener2;const _SmoothScrollElement=class _SmoothScrollElement extends HTMLElement{constructor(){super(...arguments);__privateAdd(this,_SmoothScrollElement_instances);__privateAdd(this,_cssDisabled,new cssProperty_index.CSSProperty(this,"--smooth-scroll-disabled",!1));__privateAdd(this,_cssDamping,new cssProperty_index.CSSProperty(this,"--smooth-scroll-damping",10));__privateAdd(this,_value,new Damped.Damped(0,{order:order_index.TICK_ORDER.SCROLL}));__privateAdd(this,_currentRoundedValue,0);__privateAdd(this,_needSync,!1);__privateAdd(this,_wheelListener,__name(e=>{if(!(__privateMethod(this,_SmoothScrollElement_instances,checkDisabled_fn).call(this)||Viewport.device.isMobile)){if(Math.sign(e.deltaY)<0&&__privateGet(this,_value).target===0&&__privateGet(this,_value).direction<0||Math.sign(e.deltaY)>0&&__privateGet(this,_value).target===__privateGet(this,_value).max&&__privateGet(this,_value).direction>0||e.stopPropagation(),e.target instanceof Element){const preventElement=e.target.closest("[data-prevent-smooth-scroll]");if(preventElement){const attrValue=preventElement.getAttribute("data-prevent-smooth-scroll");if(attrValue){if(matchMedia(attrValue).matches)return}else return}}Math.abs(e.deltaX)>Math.abs(e.deltaY)||(e.preventDefault(),this.shiftPosition(e.deltaY))}},"#wheelListener"));__privateAdd(this,_pointerdownListener,__name(e=>{if(e.target instanceof Element){const anchorElement=e.target.closest("a");if(e.button!==0||__privateMethod(this,_SmoothScrollElement_instances,checkDisabled_fn).call(this)&&!anchorElement)return;if(anchorElement&&!anchorElement.hasAttribute("data-smooth-scroll-skip")&&this.contains(anchorElement)){this.stop();const url=new URL(anchorElement.href);url.hash&&(e.preventDefault(),this.scrollToElement(url.hash,{behavior:anchorElement.getAttribute("data-scroll-behavior")||"smooth",offset:anchorElement.getAttribute("data-scroll-offset")||void 0,center:anchorElement.hasAttribute("data-scroll-center"),duration:parseFloat(anchorElement.getAttribute("data-scroll-duration")||"0")||void 0,easing:anchorElement.getAttribute("data-scroll-easing")||void 0}))}}},"#pointerdownListener"));__privateAdd(this,_resizeListener2,__name(()=>{this.resize(),this.sync()},"#resizeListener"));__privateAdd(this,_keydownListener,__name(e=>{__privateMethod(this,_SmoothScrollElement_instances,checkDisabled_fn).call(this)||scrollKeys.has(e.code)&&this.stop()},"#keydownListener"));__privateAdd(this,_scrollListener2,__name(()=>{Viewport.device.isMobile&&this.sync()},"#scrollListener"))}resize(){__privateGet(this,_value).min=0,__privateGet(this,_value).max=this.scrollHeight-this.offsetHeight}stop(){var _a;(_a=scroll.scrollToElementTweened.value)==null||_a.set(this.scrollTop,{equalize:!0}),__privateGet(this,_value).unlistenAnimationFrame(),__privateSet(this,_needSync,!0)}sync(){const currentValue=this.scrollTop;(Viewport.device.isMobile||__privateGet(this,_needSync)||Math.abs(currentValue-__privateGet(this,_value).current)>100)&&(__privateSet(this,_needSync,!1),__privateGet(this,_value).set(currentValue,{equalize:!0}))}shiftPosition(value){this.resize(),this.sync(),__privateGet(this,_value).shift(value)}setPosition(value,options){this.resize(),this.sync(),__privateGet(this,_value).set(value,options)}scrollToValue(value,behavior){Viewport.device.isMobile?this.scroll({top:value,behavior}):this.setPosition(value,{equalize:behavior==="instant"})}scrollToElement(elementOrSelector,options){scroll.scrollToElement(elementOrSelector,__spreadProps(__spreadValues({},options),{scrollElement:this,startValue:__privateGet(this,_value).current,scrollCallback:__name(top=>{this.scrollToValue(top,options!=null&&options.duration?"instant":options==null?void 0:options.behavior)},"scrollCallback")}))}connectedCallback(){window.addEventListener("resize",__privateGet(this,_resizeListener2)),this.addEventListener("keydown",__privateGet(this,_keydownListener)),document.documentElement.addEventListener("pointerdown",__privateGet(this,_pointerdownListener)),this.addEventListener("wheel",__privateGet(this,_wheelListener),{passive:!1}),this.addEventListener("scroll",__privateGet(this,_scrollListener2)),__privateGet(this,_value).set(this.scrollTop,{equalize:!0}),__privateGet(this,_value).subscribe(e=>{const roundedCurrent=Math.round(e.current);scrollEntries_index.scrollEntries.update(this,"y",e.current),roundedCurrent!==__privateGet(this,_currentRoundedValue)&&!Viewport.device.isMobile&&this.scroll({top:roundedCurrent,behavior:"instant"}),__privateSet(this,_currentRoundedValue,roundedCurrent)}),__privateGet(this,_cssDamping).observe(),__privateGet(this,_cssDisabled).observe(),__privateGet(this,_cssDamping).subscribe(e=>{__privateGet(this,_value).damping=e.current}),scrollEntries_index.scrollEntries.register(this),this.resize()}disconnectedCallback(){__privateGet(this,_value).close(),__privateGet(this,_cssDamping).close(),__privateGet(this,_cssDisabled).close(),scrollEntries_index.scrollEntries.unregister(this),window.removeEventListener("resize",__privateGet(this,_resizeListener2)),this.removeEventListener("keydown",__privateGet(this,_keydownListener)),document.documentElement.removeEventListener("pointerdown",__privateGet(this,_pointerdownListener)),this.removeEventListener("wheel",__privateGet(this,_wheelListener)),this.removeEventListener("scroll",__privateGet(this,_scrollListener2))}};_cssDisabled=new WeakMap,_cssDamping=new WeakMap,_value=new WeakMap,_currentRoundedValue=new WeakMap,_needSync=new WeakMap,_SmoothScrollElement_instances=new WeakSet,checkDisabled_fn=__name(function(){return __privateGet(this,_cssDisabled).current||getComputedStyle(this).getPropertyValue("overflow")==="hidden"},"#checkDisabled"),_wheelListener=new WeakMap,_pointerdownListener=new WeakMap,_resizeListener2=new WeakMap,_keydownListener=new WeakMap,_scrollListener2=new WeakMap,__name(_SmoothScrollElement,"SmoothScrollElement");let SmoothScrollElement=_SmoothScrollElement;customElements.get("e-smooth-scroll")||customElements.define("e-smooth-scroll",SmoothScrollElement);var _statusHolderElements,_progressHolderElements,_scrollElement2,_statusHolderCSSProperty,_progressHolderCSSProperty,_disabledCSSProperty,_startOffsetCSSProperty,_startOffsetMinCSSProperty,_startExtraOffsetCSSProperty,_distanceCSSProperty,_distanceOffsetCSSProperty,_progressVarCSSProperty,_enterOnceCSSProperty,_status,_initialPosition,_start,_finish,_distance,_scrolled,_progress,_visible,_loadingUnsub,_ScrollRegionElement_instances,addGlobalClasses_fn,removeGlobalClasses_fn,init_fn2,_resizeListener3,_tickListener2,enter_fn,exit_fn,cssVar_fn,_loadingListener;const _ScrollRegionElement=class _ScrollRegionElement extends HTMLElement{constructor(){super(...arguments);__privateAdd(this,_ScrollRegionElement_instances);__privateAdd(this,_statusHolderElements,[this]);__privateAdd(this,_progressHolderElements,[this]);__privateAdd(this,_scrollElement2,null);__privateAdd(this,_statusHolderCSSProperty,new cssProperty_index.CSSProperty(this,"--scroll-region-status-holder",!1));__privateAdd(this,_progressHolderCSSProperty,new cssProperty_index.CSSProperty(this,"--scroll-region-progress-holder",!1));__privateAdd(this,_disabledCSSProperty,new cssProperty_index.CSSProperty(this,"--scroll-region-disabled",!1));__privateAdd(this,_startOffsetCSSProperty,new cssProperty_index.CSSProperty(this,"--scroll-region-start-offset",0,{rawValueCheck:!1}));__privateAdd(this,_startOffsetMinCSSProperty,new cssProperty_index.CSSProperty(this,"--scroll-region-start-offset-min",!1,{rawValueCheck:!1}));__privateAdd(this,_startExtraOffsetCSSProperty,new cssProperty_index.CSSProperty(this,"--scroll-region-start-extra-offset",0,{rawValueCheck:!1}));__privateAdd(this,_distanceCSSProperty,new cssProperty_index.CSSProperty(this,"--scroll-region-distance",0,{rawValueCheck:!1}));__privateAdd(this,_distanceOffsetCSSProperty,new cssProperty_index.CSSProperty(this,"--scroll-region-distance-offset",0,{rawValueCheck:!1}));__privateAdd(this,_progressVarCSSProperty,new cssProperty_index.CSSProperty(this,"--scroll-region-progress-var",""));__privateAdd(this,_enterOnceCSSProperty,new cssProperty_index.CSSProperty(this,"--scroll-region-enter-once",!1));__privateAdd(this,_status,new elementLinkedStore_index.ElementLinkedStore(this,{enabled:!1,entered:!1,enteredOnLoad:!1,activated:!1}));__privateAdd(this,_initialPosition,0);__privateAdd(this,_start,0);__privateAdd(this,_finish,0);__privateAdd(this,_distance,0);__privateAdd(this,_scrolled,0);__privateAdd(this,_progress,0);__privateAdd(this,_visible,!1);__privateAdd(this,_loadingUnsub);__privateAdd(this,_resizeListener3,__name(()=>{this.resize()},"#resizeListener"));__privateAdd(this,_tickListener2,__name(()=>{this.tick()},"#tickListener"));__privateAdd(this,_loadingListener,__name(()=>{__privateMethod(this,_ScrollRegionElement_instances,init_fn2).call(this)},"#loadingListener"))}get start(){return __privateGet(this,_start)}get finish(){return __privateGet(this,_finish)}get distance(){return __privateGet(this,_distance)}get scrolled(){return __privateGet(this,_scrolled)}get progress(){return __privateGet(this,_progress)}get status(){return __privateGet(this,_status)}get scrollValue(){return __privateGet(this,_scrollElement2)instanceof HTMLElement?__privateGet(this,_scrollElement2).scrollTop:__privateGet(this,_scrollElement2).scrollY}resize(){__privateGet(this,_disabledCSSProperty).current||(__privateSet(this,_initialPosition,layout.getCumulativeOffsetTop(this)),__privateSet(this,_start,__privateGet(this,_initialPosition)),typeof __privateGet(this,_startOffsetMinCSSProperty).current=="number"?__privateSet(this,_start,__privateGet(this,_start)+Math.max(__privateGet(this,_startOffsetCSSProperty).current,__privateGet(this,_startOffsetMinCSSProperty).current)):__privateSet(this,_start,__privateGet(this,_start)+__privateGet(this,_startOffsetCSSProperty).current),__privateSet(this,_start,__privateGet(this,_start)+__privateGet(this,_startExtraOffsetCSSProperty).current),__privateSet(this,_start,__privateGet(this,_start)-layout.getStickyOffset(this,"top")),__privateSet(this,_finish,__privateGet(this,_start)),__privateGet(this,_distanceCSSProperty).current?__privateSet(this,_finish,__privateGet(this,_finish)+__privateGet(this,_distanceCSSProperty).current):__privateSet(this,_finish,__privateGet(this,_finish)+this.offsetHeight),__privateSet(this,_finish,__privateGet(this,_finish)+__privateGet(this,_distanceOffsetCSSProperty).current),__privateSet(this,_distance,__privateGet(this,_finish)-__privateGet(this,_start)),__privateSet(this,_visible,this.offsetWidth!==0&&this.offsetHeight!==0),this.tick())}tick(){if(__privateGet(this,_disabledCSSProperty).current)return;const scrollValue=this.scrollValue;if(__privateSet(this,_scrolled,math.clamp(scrollValue-__privateGet(this,_start),0,__privateGet(this,_distance))),__privateSet(this,_progress,__privateGet(this,_scrolled)/__privateGet(this,_distance)||0),__privateGet(this,_progressVarCSSProperty).current)for(let index=0;index<__privateGet(this,_progressHolderElements).length;index++)__privateGet(this,_progressHolderElements)[index].style.setProperty(__privateMethod(this,_ScrollRegionElement_instances,cssVar_fn).call(this,__privateGet(this,_progressVarCSSProperty).current),__privateGet(this,_progress).toFixed(6));__privateGet(this,_status).set("activated",scrollValue>=__privateGet(this,_start)),__privateGet(this,_visible)&&__privateGet(this,_status).isFalse("entered")&&scrollValue>=__privateGet(this,_start)&&scrollValue<=__privateGet(this,_finish)?__privateMethod(this,_ScrollRegionElement_instances,enter_fn).call(this):__privateGet(this,_visible)&&!__privateGet(this,_enterOnceCSSProperty).current&&__privateGet(this,_status).isTrue("entered")&&(scrollValue<__privateGet(this,_start)||scrollValue>__privateGet(this,_finish))&&__privateMethod(this,_ScrollRegionElement_instances,exit_fn).call(this),__privateGet(this,_enterOnceCSSProperty).current&&__privateGet(this,_progress)===1&&(__privateGet(this,_status).current.entered||__privateMethod(this,_ScrollRegionElement_instances,enter_fn).call(this),this.destroy()),events.dispatchEvent(this,"scrollRegionProgress",{detail:{progress:__privateGet(this,_progress),scrolled:__privateGet(this,_scrolled)}})}destroy(){var _a;(_a=__privateGet(this,_loadingUnsub))==null||_a.call(this),this.disable(!1),__privateGet(this,_statusHolderCSSProperty).close(),__privateGet(this,_progressHolderCSSProperty).close(),__privateGet(this,_disabledCSSProperty).close(),__privateGet(this,_startOffsetCSSProperty).close(),__privateGet(this,_startOffsetMinCSSProperty).close(),__privateGet(this,_startExtraOffsetCSSProperty).close(),__privateGet(this,_distanceCSSProperty).close(),__privateGet(this,_distanceOffsetCSSProperty).close(),__privateGet(this,_progressVarCSSProperty).close(),__privateGet(this,_enterOnceCSSProperty).close()}enable(){ticker_index.ticker.subscribe(__privateGet(this,_tickListener2),{culling:this}),elementResizer_index.elementResizer.subscribe(this,__privateGet(this,_resizeListener3)),windowResizer_index.windowResizer.subscribe(__privateGet(this,_resizeListener3)),__privateGet(this,_tickListener2).call(this),__privateGet(this,_status).set("enabled",!0)}disable(resetStatus=!0){ticker_index.ticker.unsubscribe(__privateGet(this,_tickListener2)),elementResizer_index.elementResizer.unsubscribe(__privateGet(this,_resizeListener3)),windowResizer_index.windowResizer.unsubscribe(__privateGet(this,_resizeListener3)),resetStatus&&__privateGet(this,_status).reset(),__privateMethod(this,_ScrollRegionElement_instances,removeGlobalClasses_fn).call(this)}connectedCallback(){const scrollSelector=this.getAttribute("data-scroll")||".page-scroll";__privateSet(this,_scrollElement2,document.querySelector(scrollSelector)),__privateSet(this,_loadingUnsub,loading.requestLoadingCallback("load",__privateGet(this,_loadingListener)))}disconnectedCallback(){this.destroy()}};_statusHolderElements=new WeakMap,_progressHolderElements=new WeakMap,_scrollElement2=new WeakMap,_statusHolderCSSProperty=new WeakMap,_progressHolderCSSProperty=new WeakMap,_disabledCSSProperty=new WeakMap,_startOffsetCSSProperty=new WeakMap,_startOffsetMinCSSProperty=new WeakMap,_startExtraOffsetCSSProperty=new WeakMap,_distanceCSSProperty=new WeakMap,_distanceOffsetCSSProperty=new WeakMap,_progressVarCSSProperty=new WeakMap,_enterOnceCSSProperty=new WeakMap,_status=new WeakMap,_initialPosition=new WeakMap,_start=new WeakMap,_finish=new WeakMap,_distance=new WeakMap,_scrolled=new WeakMap,_progress=new WeakMap,_visible=new WeakMap,_loadingUnsub=new WeakMap,_ScrollRegionElement_instances=new WeakSet,addGlobalClasses_fn=__name(function(){this.hasAttribute("data-global-class")&&document.documentElement.classList.add(this.getAttribute("data-global-class"))},"#addGlobalClasses"),removeGlobalClasses_fn=__name(function(){this.hasAttribute("data-global-class")&&document.documentElement.classList.remove(this.getAttribute("data-global-class"))},"#removeGlobalClasses"),init_fn2=__name(function(){__privateGet(this,_statusHolderCSSProperty).subscribe(e=>{__privateGet(this,_statusHolderElements).length&&__privateGet(this,_statusHolderElements).forEach(el=>{__privateGet(this,_status).removeElement(el)}),__privateSet(this,_statusHolderElements,[]),e.current?e.current.split(",").map(v=>v.trim()).forEach(selector=>{const element=document.querySelector(selector);element instanceof HTMLElement&&(__privateGet(this,_statusHolderElements).push(element),__privateGet(this,_status).addElement(element))}):(__privateSet(this,_statusHolderElements,[this]),__privateGet(this,_status).addElement(this))}),__privateGet(this,_progressHolderCSSProperty).subscribe(e=>{__privateGet(this,_progressHolderElements).length&&__privateGet(this,_progressHolderElements).forEach(el=>{el.style.removeProperty(__privateMethod(this,_ScrollRegionElement_instances,cssVar_fn).call(this,__privateGet(this,_progressVarCSSProperty).current))}),__privateSet(this,_progressHolderElements,[]),e.current?e.current.split(",").map(v=>v.trim()).forEach(selector=>{const element=document.querySelector(selector);element instanceof HTMLElement&&__privateGet(this,_progressHolderElements).push(element)}):__privateSet(this,_progressHolderElements,[this])}),__privateGet(this,_disabledCSSProperty).subscribe(e=>{e.current&&!e.previous?this.disable():this.enable()}),__privateGet(this,_progressVarCSSProperty).subscribe(e=>{e.current?__privateGet(this,_tickListener2).call(this):e.previous&&__privateGet(this,_progressHolderElements).forEach(el=>{el.style.removeProperty(__privateMethod(this,_ScrollRegionElement_instances,cssVar_fn).call(this,e.previous))})}),__privateGet(this,_distanceCSSProperty).subscribe(()=>{__privateGet(this,_resizeListener3).call(this)}),__privateGet(this,_statusHolderCSSProperty).observe(),__privateGet(this,_progressHolderCSSProperty).observe(),__privateGet(this,_disabledCSSProperty).observe(),__privateGet(this,_startOffsetCSSProperty).observe(),__privateGet(this,_startOffsetMinCSSProperty).observe(),__privateGet(this,_startExtraOffsetCSSProperty).observe(),__privateGet(this,_distanceCSSProperty).observe(),__privateGet(this,_distanceOffsetCSSProperty).observe(),__privateGet(this,_progressVarCSSProperty).observe(),__privateGet(this,_enterOnceCSSProperty).observe()},"#init"),_resizeListener3=new WeakMap,_tickListener2=new WeakMap,enter_fn=__name(function(){const scrollValue=this.scrollValue;__privateGet(this,_status).set("entered",!0),scrollValue===0&&__privateGet(this,_status).set("enteredOnLoad",!0),__privateMethod(this,_ScrollRegionElement_instances,addGlobalClasses_fn).call(this),events.dispatchEvent(this,"scrollRegionEnter")},"#enter"),exit_fn=__name(function(){__privateGet(this,_status).set("entered",!1),__privateMethod(this,_ScrollRegionElement_instances,removeGlobalClasses_fn).call(this),events.dispatchEvent(this,"scrollRegionExit")},"#exit"),cssVar_fn=__name(function(value){return`--${value}`},"#cssVar"),_loadingListener=new WeakMap,__name(_ScrollRegionElement,"ScrollRegionElement");let ScrollRegionElement=_ScrollRegionElement;customElements.get("e-scroll-region")||customElements.define("e-scroll-region",ScrollRegionElement);exports.ScrollRegionElement=ScrollRegionElement;exports.ScrollbarElement=ScrollbarElement;exports.SmoothScrollElement=SmoothScrollElement;
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),__privateMethod=(obj,member,method)=>(__accessCheck(obj,member,"access private method"),method);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ticker_index=require("../index-BoGx2BWX.cjs"),Store=require("../Store-B96mD8mD.cjs"),dom=require("../dom-B40i6NXw.cjs"),gestures=require("../gestures-DtYbQr49.cjs");require("construct-style-sheets-polyfill");const order_index=require("../order/index.cjs"),Damped=require("../Damped-B_mVO810.cjs"),cssProperty_index=require("../css-property/index.cjs"),Viewport=require("../Viewport-Blxv_yl_.cjs"),scrollEntries_index=require("../scroll-entries/index.cjs"),scroll=require("../scroll-DbYCgAnW.cjs"),elementLinkedStore_index=require("../element-linked-store/index.cjs"),elementResizer_index=require("../element-resizer/index.cjs"),events=require("../events-UlGk63iC.cjs"),layout=require("../layout-rR4-aYTY.cjs"),loading=require("../loading-7Ju1mFST.cjs"),math=require("../math-C-knY2TL.cjs"),windowResizer_index=require("../window-resizer/index.cjs");var _scrollElement,_thumbElement,_thumbScrollSize,_limit,_isHorizontal,_activeTimeoutId,_ScrollbarElement_instances,init_fn,destroy_fn,scrollPosition_get,scrollSize_get,scrollViewportSize_get,_scrollListener,_resizeListener,_grabListener,_tickListener,_intersectionListener,_spaUpdateListener;const _ScrollbarElement=class _ScrollbarElement extends HTMLElement{constructor(){super(...arguments);__privateAdd(this,_ScrollbarElement_instances);__privateAdd(this,_scrollElement,null);__privateAdd(this,_thumbElement,null);__privateAdd(this,_thumbScrollSize,0);__privateAdd(this,_limit,0);__privateAdd(this,_isHorizontal,!1);__privateAdd(this,_activeTimeoutId);__privateAdd(this,_scrollListener,__name(()=>{this.classList.add("active"),clearTimeout(__privateGet(this,_activeTimeoutId));const position=__privateGet(this,_ScrollbarElement_instances,scrollPosition_get)/__privateGet(this,_limit)*__privateGet(this,_thumbScrollSize);__privateGet(this,_isHorizontal)?__privateGet(this,_thumbElement).style.transform=`translate3d(${position}px, 0px, 0px)`:__privateGet(this,_thumbElement).style.transform=`translate3d(0px, ${position}px, 0px)`,__privateSet(this,_activeTimeoutId,setTimeout(()=>{this.classList.remove("active")},1e3))},"#scrollListener"));__privateAdd(this,_resizeListener,__name(()=>{const barSize=__privateGet(this,_isHorizontal)?this.offsetWidth:this.offsetHeight,scrollSize=__privateGet(this,_ScrollbarElement_instances,scrollSize_get),viewportSize=__privateGet(this,_ScrollbarElement_instances,scrollViewportSize_get);__privateSet(this,_limit,scrollSize-viewportSize);let thumbSize=barSize*barSize/(__privateGet(this,_limit)+barSize);thumbSize=Math.max(thumbSize,30),__privateGet(this,_isHorizontal)?(__privateGet(this,_thumbElement).style.width=thumbSize+"px",__privateGet(this,_thumbElement).style.height="100%"):(__privateGet(this,_thumbElement).style.width="100%",__privateGet(this,_thumbElement).style.height=thumbSize+"px"),__privateSet(this,_thumbScrollSize,barSize-thumbSize),scrollSize<=viewportSize?this.style.display="none":this.style.display="block"},"#resizeListener"));__privateAdd(this,_grabListener,__name(grabEvent=>{const startValue=__privateGet(this,_ScrollbarElement_instances,scrollPosition_get),grabCursor=__privateGet(this,_isHorizontal)?grabEvent.x:grabEvent.y;gestures.setupDrag(moveEvent=>{const mult=__privateGet(this,_limit)/__privateGet(this,_thumbScrollSize),delta=(__privateGet(this,_isHorizontal)?moveEvent.x-grabCursor:moveEvent.y-grabCursor)*mult;__privateGet(this,_isHorizontal)?__privateGet(this,_scrollElement).scroll({left:startValue+delta,behavior:"instant"}):__privateGet(this,_scrollElement).scroll({top:startValue+delta,behavior:"instant"})})},"#grabListener"));__privateAdd(this,_tickListener,__name(()=>{__privateGet(this,_resizeListener).call(this)},"#tickListener"));__privateAdd(this,_intersectionListener,__name(e=>{e.isIntersecting?(ticker_index.ticker.subscribe(__privateGet(this,_tickListener),{maxFPS:5}),__privateGet(this,_tickListener).call(this)):ticker_index.ticker.unsubscribe(__privateGet(this,_tickListener))},"#intersectionListener"));__privateAdd(this,_spaUpdateListener,__name(()=>{__privateMethod(this,_ScrollbarElement_instances,destroy_fn).call(this),__privateMethod(this,_ScrollbarElement_instances,init_fn).call(this)},"#spaUpdateListener"))}connectedCallback(){__privateMethod(this,_ScrollbarElement_instances,init_fn).call(this),document.addEventListener("spaAfterUpdate",__privateGet(this,_spaUpdateListener))}disconnectedCallback(){__privateMethod(this,_ScrollbarElement_instances,destroy_fn).call(this),document.removeEventListener("spaAfterUpdate",__privateGet(this,_spaUpdateListener))}};_scrollElement=new WeakMap,_thumbElement=new WeakMap,_thumbScrollSize=new WeakMap,_limit=new WeakMap,_isHorizontal=new WeakMap,_activeTimeoutId=new WeakMap,_ScrollbarElement_instances=new WeakSet,init_fn=__name(function(){const scrollSelector=this.getAttribute("data-scroll");let scrollElement=null;scrollSelector&&(scrollSelector==="parent"?scrollElement=this.parentElement:scrollElement=document.querySelector(scrollSelector)),scrollElement||(scrollElement=dom.findScrollParentElement(this),scrollElement===document.body&&(scrollElement=window)),__privateSet(this,_isHorizontal,this.hasAttribute("horisontal"));const thumbElement=this.querySelector("[data-thumb]");scrollElement&&thumbElement&&(__privateSet(this,_scrollElement,scrollElement),__privateSet(this,_thumbElement,thumbElement),__privateGet(this,_scrollElement).addEventListener("scroll",__privateGet(this,_scrollListener)),__privateGet(this,_thumbElement).addEventListener("pointerdown",__privateGet(this,_grabListener)),ticker_index.intersector.subscribe(this.parentElement===document.body?this:this.parentElement,__privateGet(this,_intersectionListener)))},"#init"),destroy_fn=__name(function(){var _a,_b;(_a=__privateGet(this,_scrollElement))==null||_a.removeEventListener("scroll",__privateGet(this,_scrollListener)),(_b=__privateGet(this,_thumbElement))==null||_b.removeEventListener("pointerdown",__privateGet(this,_grabListener)),clearTimeout(__privateGet(this,_activeTimeoutId)),ticker_index.intersector.unsubscribe(__privateGet(this,_intersectionListener)),ticker_index.ticker.unsubscribe(__privateGet(this,_tickListener))},"#destroy"),scrollPosition_get=__name(function(){return __privateGet(this,_scrollElement)instanceof HTMLElement?__privateGet(this,_isHorizontal)?__privateGet(this,_scrollElement).scrollLeft:__privateGet(this,_scrollElement).scrollTop:__privateGet(this,_isHorizontal)?__privateGet(this,_scrollElement).scrollX:__privateGet(this,_scrollElement).scrollY},"#scrollPosition"),scrollSize_get=__name(function(){return __privateGet(this,_scrollElement)instanceof HTMLElement?__privateGet(this,_isHorizontal)?__privateGet(this,_scrollElement).scrollWidth:__privateGet(this,_scrollElement).scrollHeight:__privateGet(this,_isHorizontal)?Math.max(document.body.scrollWidth,document.documentElement.scrollWidth,document.body.offsetWidth,document.documentElement.offsetWidth,document.body.clientWidth,document.documentElement.clientWidth):Math.max(document.body.scrollHeight,document.documentElement.scrollHeight,document.body.offsetHeight,document.documentElement.offsetHeight,document.body.clientHeight,document.documentElement.clientHeight)},"#scrollSize"),scrollViewportSize_get=__name(function(){return __privateGet(this,_scrollElement)instanceof HTMLElement?__privateGet(this,_isHorizontal)?__privateGet(this,_scrollElement).offsetWidth:__privateGet(this,_scrollElement).offsetHeight:__privateGet(this,_isHorizontal)?innerWidth:innerHeight},"#scrollViewportSize"),_scrollListener=new WeakMap,_resizeListener=new WeakMap,_grabListener=new WeakMap,_tickListener=new WeakMap,_intersectionListener=new WeakMap,_spaUpdateListener=new WeakMap,__name(_ScrollbarElement,"ScrollbarElement");let ScrollbarElement=_ScrollbarElement;Store.isBrowser&&!customElements.get("e-scrollbar")&&customElements.define("e-scrollbar",ScrollbarElement);const scrollKeys=new Set(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight","PageUp","PageDown","Home","End","Space"]);var _cssDisabled,_cssDamping,_value,_currentRoundedValue,_needSync,_SmoothScrollElement_instances,checkDisabled_fn,_wheelListener,_pointerdownListener,_resizeListener2,_keydownListener,_scrollListener2;const _SmoothScrollElement=class _SmoothScrollElement extends HTMLElement{constructor(){super(...arguments);__privateAdd(this,_SmoothScrollElement_instances);__privateAdd(this,_cssDisabled,new cssProperty_index.CSSProperty(this,"--smooth-scroll-disabled",!1));__privateAdd(this,_cssDamping,new cssProperty_index.CSSProperty(this,"--smooth-scroll-damping",10));__privateAdd(this,_value,new Damped.Damped(0,{order:order_index.TICK_ORDER.SCROLL}));__privateAdd(this,_currentRoundedValue,0);__privateAdd(this,_needSync,!1);__privateAdd(this,_wheelListener,__name(e=>{if(!(__privateMethod(this,_SmoothScrollElement_instances,checkDisabled_fn).call(this)||Viewport.device.isMobile)){if(Math.sign(e.deltaY)<0&&__privateGet(this,_value).target===0&&__privateGet(this,_value).direction<0||Math.sign(e.deltaY)>0&&__privateGet(this,_value).target===__privateGet(this,_value).max&&__privateGet(this,_value).direction>0||e.stopPropagation(),e.target instanceof Element){const preventElement=e.target.closest("[data-prevent-smooth-scroll]");if(preventElement){const attrValue=preventElement.getAttribute("data-prevent-smooth-scroll");if(attrValue){if(matchMedia(attrValue).matches)return}else return}}Math.abs(e.deltaX)>Math.abs(e.deltaY)||(e.preventDefault(),this.shiftPosition(e.deltaY))}},"#wheelListener"));__privateAdd(this,_pointerdownListener,__name(e=>{if(e.target instanceof Element){const anchorElement=e.target.closest("a");if(e.button!==0||__privateMethod(this,_SmoothScrollElement_instances,checkDisabled_fn).call(this)&&!anchorElement)return;if(anchorElement&&!anchorElement.hasAttribute("data-smooth-scroll-skip")&&this.contains(anchorElement)){this.stop();const url=new URL(anchorElement.href);url.hash&&(e.preventDefault(),this.scrollToElement(url.hash,{behavior:anchorElement.getAttribute("data-scroll-behavior")||"smooth",offset:anchorElement.getAttribute("data-scroll-offset")||void 0,center:anchorElement.hasAttribute("data-scroll-center"),duration:parseFloat(anchorElement.getAttribute("data-scroll-duration")||"0")||void 0,easing:anchorElement.getAttribute("data-scroll-easing")||void 0}))}}},"#pointerdownListener"));__privateAdd(this,_resizeListener2,__name(()=>{this.resize(),this.sync()},"#resizeListener"));__privateAdd(this,_keydownListener,__name(e=>{__privateMethod(this,_SmoothScrollElement_instances,checkDisabled_fn).call(this)||scrollKeys.has(e.code)&&this.stop()},"#keydownListener"));__privateAdd(this,_scrollListener2,__name(()=>{Viewport.device.isMobile&&this.sync()},"#scrollListener"))}resize(){__privateGet(this,_value).min=0,__privateGet(this,_value).max=this.scrollHeight-this.offsetHeight}stop(){var _a;(_a=scroll.scrollToElementTweened.value)==null||_a.set(this.scrollTop,{equalize:!0}),__privateGet(this,_value).unlistenAnimationFrame(),__privateSet(this,_needSync,!0)}sync(){const currentValue=this.scrollTop;(Viewport.device.isMobile||__privateGet(this,_needSync)||Math.abs(currentValue-__privateGet(this,_value).current)>100)&&(__privateSet(this,_needSync,!1),__privateGet(this,_value).set(currentValue,{equalize:!0}))}shiftPosition(value){this.resize(),this.sync(),__privateGet(this,_value).shift(value)}setPosition(value,options){this.resize(),this.sync(),__privateGet(this,_value).set(value,options)}scrollToValue(value,behavior){Viewport.device.isMobile?this.scroll({top:value,behavior}):this.setPosition(value,{equalize:behavior==="instant"})}scrollToElement(elementOrSelector,options){scroll.scrollToElement(elementOrSelector,__spreadProps(__spreadValues({},options),{scrollElement:this,startValue:__privateGet(this,_value).current,scrollCallback:__name(top=>{this.scrollToValue(top,options!=null&&options.duration?"instant":options==null?void 0:options.behavior)},"scrollCallback")}))}connectedCallback(){window.addEventListener("resize",__privateGet(this,_resizeListener2)),this.addEventListener("keydown",__privateGet(this,_keydownListener)),document.documentElement.addEventListener("pointerdown",__privateGet(this,_pointerdownListener)),this.addEventListener("wheel",__privateGet(this,_wheelListener),{passive:!1}),this.addEventListener("scroll",__privateGet(this,_scrollListener2)),__privateGet(this,_value).set(this.scrollTop,{equalize:!0}),__privateGet(this,_value).subscribe(e=>{const roundedCurrent=Math.round(e.current);scrollEntries_index.scrollEntries.update(this,"y",e.current),roundedCurrent!==__privateGet(this,_currentRoundedValue)&&!Viewport.device.isMobile&&this.scroll({top:roundedCurrent,behavior:"instant"}),__privateSet(this,_currentRoundedValue,roundedCurrent)}),__privateGet(this,_cssDamping).observe(),__privateGet(this,_cssDisabled).observe(),__privateGet(this,_cssDamping).subscribe(e=>{__privateGet(this,_value).damping=e.current}),scrollEntries_index.scrollEntries.register(this),this.resize()}disconnectedCallback(){__privateGet(this,_value).close(),__privateGet(this,_cssDamping).close(),__privateGet(this,_cssDisabled).close(),scrollEntries_index.scrollEntries.unregister(this),window.removeEventListener("resize",__privateGet(this,_resizeListener2)),this.removeEventListener("keydown",__privateGet(this,_keydownListener)),document.documentElement.removeEventListener("pointerdown",__privateGet(this,_pointerdownListener)),this.removeEventListener("wheel",__privateGet(this,_wheelListener)),this.removeEventListener("scroll",__privateGet(this,_scrollListener2))}};_cssDisabled=new WeakMap,_cssDamping=new WeakMap,_value=new WeakMap,_currentRoundedValue=new WeakMap,_needSync=new WeakMap,_SmoothScrollElement_instances=new WeakSet,checkDisabled_fn=__name(function(){return __privateGet(this,_cssDisabled).current||getComputedStyle(this).getPropertyValue("overflow")==="hidden"},"#checkDisabled"),_wheelListener=new WeakMap,_pointerdownListener=new WeakMap,_resizeListener2=new WeakMap,_keydownListener=new WeakMap,_scrollListener2=new WeakMap,__name(_SmoothScrollElement,"SmoothScrollElement");let SmoothScrollElement=_SmoothScrollElement;customElements.get("e-smooth-scroll")||customElements.define("e-smooth-scroll",SmoothScrollElement);var _statusHolderElements,_progressHolderElements,_scrollElement2,_statusHolderCSSProperty,_progressHolderCSSProperty,_disabledCSSProperty,_startOffsetCSSProperty,_startOffsetMinCSSProperty,_startExtraOffsetCSSProperty,_distanceCSSProperty,_distanceOffsetCSSProperty,_progressVarCSSProperty,_enterOnceCSSProperty,_status,_initialPosition,_start,_finish,_distance,_scrolled,_progress,_visible,_loadingUnsub,_ScrollRegionElement_instances,addGlobalClasses_fn,removeGlobalClasses_fn,init_fn2,_resizeListener3,_tickListener2,enter_fn,exit_fn,cssVar_fn,_loadingListener;const _ScrollRegionElement=class _ScrollRegionElement extends HTMLElement{constructor(){super(...arguments);__privateAdd(this,_ScrollRegionElement_instances);__privateAdd(this,_statusHolderElements,[this]);__privateAdd(this,_progressHolderElements,[this]);__privateAdd(this,_scrollElement2,null);__privateAdd(this,_statusHolderCSSProperty,new cssProperty_index.CSSProperty(this,"--scroll-region-status-holder",!1));__privateAdd(this,_progressHolderCSSProperty,new cssProperty_index.CSSProperty(this,"--scroll-region-progress-holder",!1));__privateAdd(this,_disabledCSSProperty,new cssProperty_index.CSSProperty(this,"--scroll-region-disabled",!1));__privateAdd(this,_startOffsetCSSProperty,new cssProperty_index.CSSProperty(this,"--scroll-region-start-offset",0,{rawValueCheck:!1}));__privateAdd(this,_startOffsetMinCSSProperty,new cssProperty_index.CSSProperty(this,"--scroll-region-start-offset-min",!1,{rawValueCheck:!1}));__privateAdd(this,_startExtraOffsetCSSProperty,new cssProperty_index.CSSProperty(this,"--scroll-region-start-extra-offset",0,{rawValueCheck:!1}));__privateAdd(this,_distanceCSSProperty,new cssProperty_index.CSSProperty(this,"--scroll-region-distance",0,{rawValueCheck:!1}));__privateAdd(this,_distanceOffsetCSSProperty,new cssProperty_index.CSSProperty(this,"--scroll-region-distance-offset",0,{rawValueCheck:!1}));__privateAdd(this,_progressVarCSSProperty,new cssProperty_index.CSSProperty(this,"--scroll-region-progress-var",""));__privateAdd(this,_enterOnceCSSProperty,new cssProperty_index.CSSProperty(this,"--scroll-region-enter-once",!1));__privateAdd(this,_status,new elementLinkedStore_index.ElementLinkedStore(this,{enabled:!1,entered:!1,enteredOnLoad:!1,activated:!1}));__privateAdd(this,_initialPosition,0);__privateAdd(this,_start,0);__privateAdd(this,_finish,0);__privateAdd(this,_distance,0);__privateAdd(this,_scrolled,0);__privateAdd(this,_progress,0);__privateAdd(this,_visible,!1);__privateAdd(this,_loadingUnsub);__privateAdd(this,_resizeListener3,__name(()=>{this.resize()},"#resizeListener"));__privateAdd(this,_tickListener2,__name(()=>{this.tick()},"#tickListener"));__privateAdd(this,_loadingListener,__name(()=>{__privateMethod(this,_ScrollRegionElement_instances,init_fn2).call(this)},"#loadingListener"))}get start(){return __privateGet(this,_start)}get finish(){return __privateGet(this,_finish)}get distance(){return __privateGet(this,_distance)}get scrolled(){return __privateGet(this,_scrolled)}get progress(){return __privateGet(this,_progress)}get status(){return __privateGet(this,_status)}get scrollValue(){return __privateGet(this,_scrollElement2)instanceof HTMLElement?__privateGet(this,_scrollElement2).scrollTop:__privateGet(this,_scrollElement2).scrollY}resize(){__privateGet(this,_disabledCSSProperty).current||(__privateSet(this,_initialPosition,layout.getCumulativeOffsetTop(this)),__privateSet(this,_start,__privateGet(this,_initialPosition)),typeof __privateGet(this,_startOffsetMinCSSProperty).current=="number"?__privateSet(this,_start,__privateGet(this,_start)+Math.max(__privateGet(this,_startOffsetCSSProperty).current,__privateGet(this,_startOffsetMinCSSProperty).current)):__privateSet(this,_start,__privateGet(this,_start)+__privateGet(this,_startOffsetCSSProperty).current),__privateSet(this,_start,__privateGet(this,_start)+__privateGet(this,_startExtraOffsetCSSProperty).current),__privateSet(this,_start,__privateGet(this,_start)-layout.getStickyOffset(this,"top")),__privateSet(this,_finish,__privateGet(this,_start)),__privateGet(this,_distanceCSSProperty).current?__privateSet(this,_finish,__privateGet(this,_finish)+__privateGet(this,_distanceCSSProperty).current):__privateSet(this,_finish,__privateGet(this,_finish)+this.offsetHeight),__privateSet(this,_finish,__privateGet(this,_finish)+__privateGet(this,_distanceOffsetCSSProperty).current),__privateSet(this,_distance,__privateGet(this,_finish)-__privateGet(this,_start)),__privateSet(this,_visible,this.offsetWidth!==0&&this.offsetHeight!==0),this.tick())}tick(){if(__privateGet(this,_disabledCSSProperty).current)return;const scrollValue=this.scrollValue;if(__privateSet(this,_scrolled,math.clamp(scrollValue-__privateGet(this,_start),0,__privateGet(this,_distance))),__privateSet(this,_progress,__privateGet(this,_scrolled)/__privateGet(this,_distance)||0),__privateGet(this,_progressVarCSSProperty).current)for(let index=0;index<__privateGet(this,_progressHolderElements).length;index++)__privateGet(this,_progressHolderElements)[index].style.setProperty(__privateMethod(this,_ScrollRegionElement_instances,cssVar_fn).call(this,__privateGet(this,_progressVarCSSProperty).current),__privateGet(this,_progress).toFixed(6));__privateGet(this,_status).set("activated",scrollValue>=__privateGet(this,_start)),__privateGet(this,_visible)&&__privateGet(this,_status).isFalse("entered")&&scrollValue>=__privateGet(this,_start)&&scrollValue<=__privateGet(this,_finish)?__privateMethod(this,_ScrollRegionElement_instances,enter_fn).call(this):__privateGet(this,_visible)&&!__privateGet(this,_enterOnceCSSProperty).current&&__privateGet(this,_status).isTrue("entered")&&(scrollValue<__privateGet(this,_start)||scrollValue>__privateGet(this,_finish))&&__privateMethod(this,_ScrollRegionElement_instances,exit_fn).call(this),__privateGet(this,_enterOnceCSSProperty).current&&__privateGet(this,_progress)===1&&(__privateGet(this,_status).current.entered||__privateMethod(this,_ScrollRegionElement_instances,enter_fn).call(this),this.destroy()),events.dispatchEvent(this,"scrollRegionProgress",{detail:{progress:__privateGet(this,_progress),scrolled:__privateGet(this,_scrolled)}})}destroy(){var _a;(_a=__privateGet(this,_loadingUnsub))==null||_a.call(this),this.disable(!1),__privateGet(this,_statusHolderCSSProperty).close(),__privateGet(this,_progressHolderCSSProperty).close(),__privateGet(this,_disabledCSSProperty).close(),__privateGet(this,_startOffsetCSSProperty).close(),__privateGet(this,_startOffsetMinCSSProperty).close(),__privateGet(this,_startExtraOffsetCSSProperty).close(),__privateGet(this,_distanceCSSProperty).close(),__privateGet(this,_distanceOffsetCSSProperty).close(),__privateGet(this,_progressVarCSSProperty).close(),__privateGet(this,_enterOnceCSSProperty).close()}enable(){ticker_index.ticker.subscribe(__privateGet(this,_tickListener2),{culling:this}),elementResizer_index.elementResizer.subscribe(this,__privateGet(this,_resizeListener3)),windowResizer_index.windowResizer.subscribe(__privateGet(this,_resizeListener3)),__privateGet(this,_tickListener2).call(this),__privateGet(this,_status).set("enabled",!0)}disable(resetStatus=!0){ticker_index.ticker.unsubscribe(__privateGet(this,_tickListener2)),elementResizer_index.elementResizer.unsubscribe(__privateGet(this,_resizeListener3)),windowResizer_index.windowResizer.unsubscribe(__privateGet(this,_resizeListener3)),resetStatus&&__privateGet(this,_status).reset(),__privateMethod(this,_ScrollRegionElement_instances,removeGlobalClasses_fn).call(this)}connectedCallback(){const scrollSelector=this.getAttribute("data-scroll")||".page-scroll";__privateSet(this,_scrollElement2,document.querySelector(scrollSelector)),__privateSet(this,_loadingUnsub,loading.requestLoadingCallback("load",__privateGet(this,_loadingListener)))}disconnectedCallback(){this.destroy()}};_statusHolderElements=new WeakMap,_progressHolderElements=new WeakMap,_scrollElement2=new WeakMap,_statusHolderCSSProperty=new WeakMap,_progressHolderCSSProperty=new WeakMap,_disabledCSSProperty=new WeakMap,_startOffsetCSSProperty=new WeakMap,_startOffsetMinCSSProperty=new WeakMap,_startExtraOffsetCSSProperty=new WeakMap,_distanceCSSProperty=new WeakMap,_distanceOffsetCSSProperty=new WeakMap,_progressVarCSSProperty=new WeakMap,_enterOnceCSSProperty=new WeakMap,_status=new WeakMap,_initialPosition=new WeakMap,_start=new WeakMap,_finish=new WeakMap,_distance=new WeakMap,_scrolled=new WeakMap,_progress=new WeakMap,_visible=new WeakMap,_loadingUnsub=new WeakMap,_ScrollRegionElement_instances=new WeakSet,addGlobalClasses_fn=__name(function(){this.hasAttribute("data-global-class")&&document.documentElement.classList.add(this.getAttribute("data-global-class"))},"#addGlobalClasses"),removeGlobalClasses_fn=__name(function(){this.hasAttribute("data-global-class")&&document.documentElement.classList.remove(this.getAttribute("data-global-class"))},"#removeGlobalClasses"),init_fn2=__name(function(){__privateGet(this,_statusHolderCSSProperty).subscribe(e=>{__privateGet(this,_statusHolderElements).length&&__privateGet(this,_statusHolderElements).forEach(el=>{__privateGet(this,_status).removeElement(el)}),__privateSet(this,_statusHolderElements,[]),e.current?e.current.split(",").map(v=>v.trim()).forEach(selector=>{const element=document.querySelector(selector);element instanceof HTMLElement&&(__privateGet(this,_statusHolderElements).push(element),__privateGet(this,_status).addElement(element))}):(__privateSet(this,_statusHolderElements,[this]),__privateGet(this,_status).addElement(this))}),__privateGet(this,_progressHolderCSSProperty).subscribe(e=>{__privateGet(this,_progressHolderElements).length&&__privateGet(this,_progressHolderElements).forEach(el=>{el.style.removeProperty(__privateMethod(this,_ScrollRegionElement_instances,cssVar_fn).call(this,__privateGet(this,_progressVarCSSProperty).current))}),__privateSet(this,_progressHolderElements,[]),e.current?e.current.split(",").map(v=>v.trim()).forEach(selector=>{const element=document.querySelector(selector);element instanceof HTMLElement&&__privateGet(this,_progressHolderElements).push(element)}):__privateSet(this,_progressHolderElements,[this])}),__privateGet(this,_disabledCSSProperty).subscribe(e=>{e.current&&!e.previous?this.disable():this.enable()}),__privateGet(this,_progressVarCSSProperty).subscribe(e=>{e.current?__privateGet(this,_tickListener2).call(this):e.previous&&__privateGet(this,_progressHolderElements).forEach(el=>{el.style.removeProperty(__privateMethod(this,_ScrollRegionElement_instances,cssVar_fn).call(this,e.previous))})}),__privateGet(this,_distanceCSSProperty).subscribe(()=>{__privateGet(this,_resizeListener3).call(this)}),__privateGet(this,_statusHolderCSSProperty).observe(),__privateGet(this,_progressHolderCSSProperty).observe(),__privateGet(this,_disabledCSSProperty).observe(),__privateGet(this,_startOffsetCSSProperty).observe(),__privateGet(this,_startOffsetMinCSSProperty).observe(),__privateGet(this,_startExtraOffsetCSSProperty).observe(),__privateGet(this,_distanceCSSProperty).observe(),__privateGet(this,_distanceOffsetCSSProperty).observe(),__privateGet(this,_progressVarCSSProperty).observe(),__privateGet(this,_enterOnceCSSProperty).observe()},"#init"),_resizeListener3=new WeakMap,_tickListener2=new WeakMap,enter_fn=__name(function(){const scrollValue=this.scrollValue;__privateGet(this,_status).set("entered",!0),scrollValue===0&&__privateGet(this,_status).set("enteredOnLoad",!0),__privateMethod(this,_ScrollRegionElement_instances,addGlobalClasses_fn).call(this),events.dispatchEvent(this,"scrollRegionEnter")},"#enter"),exit_fn=__name(function(){__privateGet(this,_status).set("entered",!1),__privateMethod(this,_ScrollRegionElement_instances,removeGlobalClasses_fn).call(this),events.dispatchEvent(this,"scrollRegionExit")},"#exit"),cssVar_fn=__name(function(value){return`--${value}`},"#cssVar"),_loadingListener=new WeakMap,__name(_ScrollRegionElement,"ScrollRegionElement");let ScrollRegionElement=_ScrollRegionElement;customElements.get("e-scroll-region")||customElements.define("e-scroll-region",ScrollRegionElement);exports.ScrollRegionElement=ScrollRegionElement;exports.ScrollbarElement=ScrollbarElement;exports.SmoothScrollElement=SmoothScrollElement;
@@ -25,11 +25,11 @@ import { D as Damped } from "../Damped-m3PWu4LD.js";
25
25
  import { CSSProperty } from "../css-property/index.js";
26
26
  import { d as device } from "../Viewport-B3kVX27H.js";
27
27
  import { scrollEntries } from "../scroll-entries/index.js";
28
- import { s as scrollToElement, a as scrollToElementTweened } from "../scroll-IQwW3E-B.js";
28
+ import { s as scrollToElement, a as scrollToElementTweened } from "../scroll-CqF_88wv.js";
29
29
  import { ElementLinkedStore } from "../element-linked-store/index.js";
30
30
  import { elementResizer } from "../element-resizer/index.js";
31
31
  import { d as dispatchEvent } from "../events-Ds-TuvYW.js";
32
- import { b as getCumulativeOffsetTop, g as getStickyOffset } from "../layout-BL6AX9-r.js";
32
+ import { b as getCumulativeOffsetTop, g as getStickyOffset } from "../layout-DxOCR4qe.js";
33
33
  import { r as requestLoadingCallback } from "../loading-BYWPyUhc.js";
34
34
  import { c as clamp } from "../math-r8V23YFe.js";
35
35
  import { windowResizer } from "../window-resizer/index.js";
@@ -1 +1 @@
1
- "use strict";var __defProp=Object.defineProperty;var __name=(target,value)=>__defProp(target,"name",{value,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const attributes=require("../attributes-BADnRZpK.cjs"),Store=require("../Store-B96mD8mD.cjs"),canvas=require("../canvas-BP1ceie3.cjs"),coordinates=require("../coordinates-DQ9XV9M1.cjs"),customElements=require("../custom-elements-BfZCJde6.cjs"),dom=require("../dom-B40i6NXw.cjs"),Tweened=require("../Tweened-BZoUkI7O.cjs"),element=require("../element-CqD0jqBJ.cjs"),events=require("../events-UlGk63iC.cjs"),file=require("../file-RHfA3OS-.cjs"),_function=require("../function-H4b_gTg6.cjs"),gestures=require("../gestures-DtYbQr49.cjs"),stylesheet=require("../stylesheet-DQv6_0na.cjs"),layout=require("../layout-CnGLl7oe.cjs"),loading=require("../loading-7Ju1mFST.cjs"),math=require("../math-C-knY2TL.cjs"),metadata=require("../metadata-BrHUfpV9.cjs"),morph=require("../morph-C71wnWQv.cjs"),number=require("../number-Bu4sGvW7.cjs"),object=require("../object-DTY_W6xG.cjs"),polyfills=require("../polyfills-DZCuDBkA.cjs"),promises=require("../promises-nDm8_iG6.cjs"),scroll=require("../scroll-DfvKl-On.cjs"),style=require("../style-IDJ6db6n.cjs"),ticker_index=require("../index-BoGx2BWX.cjs"),url=require("../url-D0rESDQq.cjs");function insert(arr,index,...newItems){return[...arr.slice(0,index),...newItems,...arr.slice(index)]}__name(insert,"insert");function shiftArray(arr,positions){const len=arr.length;positions=positions%len;const result=new Array(len);for(let i=0;i<len;i++){const newPos=(i+positions)%len;result[newPos]=arr[i]}return result}__name(shiftArray,"shiftArray");function formatBytes(bytes,decimals=2){if(!+bytes)return"0 Bytes";const k=1024,dm=decimals<0?0:decimals,sizes=["Bytes","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],i=Math.floor(Math.log(bytes)/Math.log(k));return`${parseFloat((bytes/Math.pow(k,i)).toFixed(dm))} ${sizes[i]}`}__name(formatBytes,"formatBytes");function copyTextToClipboard(text){if(navigator.clipboard)navigator.clipboard.writeText(text).then(()=>{console.log("Text copied to clipboard successfully!")}).catch(err=>{console.error("Failed to copy text to clipboard:",err)});else{const textArea=document.createElement("textarea");textArea.value=text,textArea.style.position="fixed",textArea.style.top="0",textArea.style.left="0",document.body.appendChild(textArea),textArea.select();try{document.execCommand("copy")?console.log("Text copied to clipboard successfully!"):console.error("Failed to copy text to clipboard.")}catch(err){console.error("Failed to copy text to clipboard:",err)}document.body.removeChild(textArea)}}__name(copyTextToClipboard,"copyTextToClipboard");function dotRectCollision(dot,rect){return dot.x<rect.x+rect.width&&dot.x>rect.x&&dot.y<rect.y+rect.height&&dot.y>rect.y}__name(dotRectCollision,"dotRectCollision");function dotCircleCollision(dot,circle){return Math.sqrt((dot.x-circle.x)**2+(dot.y-circle.y)**2)<circle.radius}__name(dotCircleCollision,"dotCircleCollision");function dotPolygonCollision(dot,polygon){let inside=!1;const{x,y}=dot;for(let i=0,j=polygon.length-1;i<polygon.length;j=i++){const xi=polygon[i].x,yi=polygon[i].y,xj=polygon[j].x,yj=polygon[j].y;yi>y!=yj>y&&x<(xj-xi)*(y-yi)/(yj-yi)+xi&&(inside=!inside)}return inside}__name(dotPolygonCollision,"dotPolygonCollision");function rgbToHex(r,g,b){const toHex=__name(c=>{const hex=c.toString(16);return hex.length===1?"0"+hex:hex},"toHex");return`#${toHex(r)}${toHex(g)}${toHex(b)}`}__name(rgbToHex,"rgbToHex");function getStyleRuleActualValue(rule,name){const obj=rule.style.getPropertyValue(name);if(obj){const stringValue=obj.toString();return stringValue.startsWith("var")?getStyleRuleActualValue(rule,stringValue.slice(4,-1)):stringValue}}__name(getStyleRuleActualValue,"getStyleRuleActualValue");function getRootVariables(...names){const variables={};return Array.from(document.styleSheets).forEach(stylesheet2=>{Array.from(stylesheet2.cssRules).forEach(rule=>{rule instanceof CSSStyleRule&&rule.selectorText===":root"&&names.forEach(name=>{const value=getStyleRuleActualValue(rule,name);value&&(variables[name]=value)})})}),names.forEach(name=>{variables[name]||console.warn(`variable named ${name} not found`)}),variables}__name(getRootVariables,"getRootVariables");function encode(string){const decodedStr=window.atob(string);return decodeURIComponent(window.escape(decodedStr))}__name(encode,"encode");function decode(string){const encodedStr=window.unescape(encodeURIComponent(string));return window.btoa(encodedStr)}__name(decode,"decode");const phoneRegex=/^(\+?\d{1,3}[-.\s]?)?(\(?\d{3}\)?[-.\s]?)?\d{1,4}[-.\s]?\d{2,4}[-.\s]?\d{2,4}$/,emailRegex=/^[\w.-]+@[a-zA-Z\d.-]+\.[a-zA-Z]{2,}$/;function tryCreateHrefFromContact(contact){let href,type;return emailRegex.test(contact)?(href=`mailto:${contact.trim()}`,type="email"):phoneRegex.test(contact)&&(href=`tel:${contact.replace(/[^0-9\\.\\+]+/g,"")}`,type="phone"),{href,type,contact}}__name(tryCreateHrefFromContact,"tryCreateHrefFromContact");function transliterate(text,options={}){const{separator="-",lowercase=!0,replaceNumbers=!0,maxLength=60}=options,charMap={а:"a",б:"b",в:"v",г:"g",д:"d",е:"e",ё:"e",ж:"zh",з:"z",и:"i",й:"j",к:"k",л:"l",м:"m",н:"n",о:"o",п:"p",р:"r",с:"s",т:"t",у:"u",ф:"f",х:"h",ц:"c",ч:"ch",ш:"sh",щ:"sh",ъ:"",ы:"y",ь:"",э:"e",ю:"yu",я:"ya"};let result=text.replace(/[а-яё]/gi,char=>{const lowerChar=char.toLowerCase(),replacement=charMap[lowerChar]||"";return char===lowerChar?replacement:replacement.toUpperCase()});if(replaceNumbers){const numberMap={0:"zero",1:"one",2:"two",3:"three",4:"four",5:"five",6:"six",7:"seven",8:"eight",9:"nine"};result=result.replace(/[0-9]/g,num=>numberMap[num]||num)}return lowercase&&(result=result.toLowerCase()),result=result.replace(/[^\w\-]+/g,separator).replace(new RegExp(`\\${separator}+`,"g"),separator).replace(new RegExp(`(^\\${separator}|\\${separator}$)`,"g"),""),maxLength>0&&result.length>maxLength&&(result=result.substring(0,maxLength).replace(new RegExp(`\\${separator}[^\\${separator}]*$`),"")),result}__name(transliterate,"transliterate");function splitProgress(progress,items,initialItemsWithFullProgress=0){const totalItems=items-initialItemsWithFullProgress,splitted=[];for(let item=0;item<items;item++){const offset=item/totalItems-initialItemsWithFullProgress/totalItems,itemProgress=Math.min(1,Math.max(0,(progress-offset)*totalItems));splitted.push(itemProgress)}return splitted}__name(splitProgress,"splitProgress");function setElementsProgress(progress,elements,initialItemsWithFullProgress=0){const totalItems=elements.length-initialItemsWithFullProgress;elements.forEach((el,index)=>{const offset=index/totalItems-initialItemsWithFullProgress/totalItems,itemProgress=Math.min(1,Math.max(0,(progress-offset)*totalItems));el.style.setProperty("--item-progress",itemProgress.toString())})}__name(setElementsProgress,"setElementsProgress");function setActiveContentClasses(index,elements){elements.forEach((el,i)=>{i>index?(el.classList.remove("current","previous"),el.classList.add("next")):i<index?(el.classList.remove("current","next"),el.classList.add("previous")):(el.classList.remove("previous","next"),el.classList.add("current"))})}__name(setActiveContentClasses,"setActiveContentClasses");function cloneTemplateContent(templateElement,callback){if(templateElement){const element2=templateElement.content.cloneNode(!0).firstElementChild;return element2&&(callback==null||callback(element2)),element2}return null}__name(cloneTemplateContent,"cloneTemplateContent");function setIntervalOnIntersection(element2,delay,callback,options){let intervalId,isIntersecting=!1,current=0,previous=0,tickerUnsubsribe;const toggleInterval=__name(()=>{clearInterval(intervalId),tickerUnsubsribe==null||tickerUnsubsribe(),options!=null&&options.restartCounter&&(current=0),isIntersecting&&(callback({current,previous,progress:0}),previous=current,tickerUnsubsribe=restartTicker(),intervalId=setInterval(()=>{tickerUnsubsribe==null||tickerUnsubsribe(),current++,callback({current,previous,progress:0}),previous=current,tickerUnsubsribe=restartTicker()},delay))},"toggleInterval"),restartTicker=__name(()=>ticker_index.ticker.subscribe(e=>{const progress=e.timeElapsedSinceSubscription/delay;callback({current,previous,progress})}),"restartTicker"),intersectorUnsubscribe=ticker_index.intersector.subscribe(element2,e=>{isIntersecting=e.isIntersecting,toggleInterval()});return{destroy:__name(()=>{tickerUnsubsribe==null||tickerUnsubsribe(),intersectorUnsubscribe(),clearInterval(intervalId)},"destroy"),restart:__name((currentValue,previousValue)=>{current=currentValue||0,previousValue&&(previous=previousValue),toggleInterval()},"restart"),stop:__name(()=>{clearInterval(intervalId),tickerUnsubsribe==null||tickerUnsubsribe()},"stop")}}__name(setIntervalOnIntersection,"setIntervalOnIntersection");exports.getElementAttributesAdvanced=attributes.getElementAttributesAdvanced;exports.parseAttribute=attributes.parseAttribute;exports.parseAttributeValue=attributes.parseAttributeValue;exports.parseAttributeValueAdvanced=attributes.parseAttributeValueAdvanced;exports.camelToKebab=Store.camelToKebab;exports.capitalize=Store.capitalize;exports.declension=Store.declension;exports.decodeHtmlEntities=Store.decodeHtmlEntities;exports.generateId=Store.generateId;exports.getRandomChar=Store.getRandomChar;exports.isBrowser=Store.isBrowser;exports.isUppercase=Store.isUppercase;exports.kebabToCamel=Store.kebabToCamel;exports.snakeToDotted=Store.snakeToDotted;exports.toPascalCase=Store.toPascalCase;exports.uncapitalize=Store.uncapitalize;exports.contain=canvas.contain;exports.cover=canvas.cover;exports.fixPosition=canvas.fixPosition;exports.measureText=canvas.measureText;exports.getPointerPosition=coordinates.getPointerPosition;exports.normalize=coordinates.normalize;exports.screenToCartesian=coordinates.screenToCartesian;exports.whenDefined=customElements.whenDefined;exports.createScriptElement=dom.createScriptElement;exports.deepQuerySelectorAll=dom.deepQuerySelectorAll;exports.excludeElements=dom.excludeElements;exports.findParentElement=dom.findParentElement;exports.findScrollParentElement=dom.findScrollParentElement;exports.getAllParentElements=dom.getAllParentElements;exports.getElement=dom.getElement;exports.intersectElements=dom.intersectElements;exports.traverseNodes=dom.traverseNodes;exports.traverseShadowRoots=dom.traverseShadowRoots;exports.easeInCubic=Tweened.easeInCubic;exports.easeInExpo=Tweened.easeInExpo;exports.easeInOutCubic=Tweened.easeInOutCubic;exports.easeInOutExpo=Tweened.easeInOutExpo;exports.easeInOutQuad=Tweened.easeInOutQuad;exports.easeInOutQuart=Tweened.easeInOutQuart;exports.easeInOutQuint=Tweened.easeInOutQuint;exports.easeInQuad=Tweened.easeInQuad;exports.easeInQuart=Tweened.easeInQuart;exports.easeInQuint=Tweened.easeInQuint;exports.easeOutCubic=Tweened.easeOutCubic;exports.easeOutExpo=Tweened.easeOutExpo;exports.easeOutQuad=Tweened.easeOutQuad;exports.easeOutQuart=Tweened.easeOutQuart;exports.easeOutQuint=Tweened.easeOutQuint;exports.easings=Tweened.easings;exports.linear=Tweened.linear;exports.isElementVisible=element.isElementVisible;exports.dispatchEvent=events.dispatchEvent;exports.createJSONAndSave=file.createJSONAndSave;exports.downloadURI=file.downloadURI;exports.debounce=_function.debounce;exports.throttle=_function.throttle;exports.setupDrag=gestures.setupDrag;exports.createStylesheet=stylesheet.createStylesheet;exports.styleToString=stylesheet.styleToString;exports.getCumulativeOffsetLeft=layout.getCumulativeOffsetLeft;exports.getCumulativeOffsetTop=layout.getCumulativeOffsetTop;exports.getCumulativePosition=layout.getCumulativePosition;exports.getStickyOffset=layout.getStickyOffset;exports.requestLoadingCallback=loading.requestLoadingCallback;exports.calculateDistance=math.calculateDistance;exports.calculateDistanceWithRadius=math.calculateDistanceWithRadius;exports.clamp=math.clamp;exports.damp=math.damp;exports.lerp=math.lerp;exports.mapRange=math.mapRange;exports.round=math.round;exports.smootherstep=math.smootherstep;exports.smoothstep=math.smoothstep;exports.step=math.step;exports.formatMediaDuration=metadata.formatMediaDuration;exports.ACTION_CREATE=morph.ACTION_CREATE;exports.ACTION_PRESERVE=morph.ACTION_PRESERVE;exports.ACTION_REMOVE=morph.ACTION_REMOVE;exports.ACTION_REMOVE_ATTR=morph.ACTION_REMOVE_ATTR;exports.ACTION_REPLACE=morph.ACTION_REPLACE;exports.ACTION_SET_ATTR=morph.ACTION_SET_ATTR;exports.ACTION_SKIP=morph.ACTION_SKIP;exports.ACTION_UPDATE=morph.ACTION_UPDATE;exports.NODE_TYPE_COMMENT=morph.NODE_TYPE_COMMENT;exports.NODE_TYPE_DOCUMENT=morph.NODE_TYPE_DOCUMENT;exports.NODE_TYPE_ELEMENT=morph.NODE_TYPE_ELEMENT;exports.NODE_TYPE_TEXT=morph.NODE_TYPE_TEXT;exports.diff=morph.diff;exports.morph=morph.morph;exports.patch=morph.patch;exports.beautifyNumber=number.beautifyNumber;exports.loopNumber=number.loopNumber;exports.preciseNumber=number.preciseNumber;exports.roundNumberTo=number.roundNumberTo;exports.toStep=number.toStep;exports.cloneDeep=object.cloneDeep;exports.compareObjects=object.compareObjects;exports.isESClass=object.isESClass;exports.isNullish=object.isNullish;exports.isObject=object.isObject;exports.mergeDeep=object.mergeDeep;exports.mixin=object.mixin;exports.omit=object.omit;exports.pick=object.pick;exports.nullishCoalescing=polyfills.nullishCoalescing;exports.requestIdleCallback=polyfills.requestIdleCallback;exports.wait=promises.wait;exports.scrollToElement=scroll.scrollToElement;exports.scrollToElementTweened=scroll.scrollToElementTweened;exports.getElementTransitionDurationMS=style.getElementTransitionDurationMS;exports.getElementTransitionDurationS=style.getElementTransitionDurationS;exports.changeHistory=url.changeHistory;exports.isLocalUrl=url.isLocalUrl;exports.normalizeBase=url.normalizeBase;exports.normalizeRelativeURLs=url.normalizeRelativeURLs;exports.normalizeURL=url.normalizeURL;exports.parseSearchParameters=url.parseSearchParameters;exports.searchParamsObjectToString=url.searchParamsObjectToString;exports.searchParamsToObject=url.searchParamsToObject;exports.splitPath=url.splitPath;exports.updateSearchParameter=url.updateSearchParameter;exports.cloneTemplateContent=cloneTemplateContent;exports.copyTextToClipboard=copyTextToClipboard;exports.decode=decode;exports.dotCircleCollision=dotCircleCollision;exports.dotPolygonCollision=dotPolygonCollision;exports.dotRectCollision=dotRectCollision;exports.encode=encode;exports.formatBytes=formatBytes;exports.getRootVariables=getRootVariables;exports.getStyleRuleActualValue=getStyleRuleActualValue;exports.insert=insert;exports.rgbToHex=rgbToHex;exports.setActiveContentClasses=setActiveContentClasses;exports.setElementsProgress=setElementsProgress;exports.setIntervalOnIntersection=setIntervalOnIntersection;exports.shiftArray=shiftArray;exports.splitProgress=splitProgress;exports.transliterate=transliterate;exports.tryCreateHrefFromContact=tryCreateHrefFromContact;
1
+ "use strict";var __defProp=Object.defineProperty;var __name=(target,value)=>__defProp(target,"name",{value,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const attributes=require("../attributes-BADnRZpK.cjs"),Store=require("../Store-B96mD8mD.cjs"),canvas=require("../canvas-BP1ceie3.cjs"),coordinates=require("../coordinates-DQ9XV9M1.cjs"),customElements=require("../custom-elements-BfZCJde6.cjs"),dom=require("../dom-B40i6NXw.cjs"),Tweened=require("../Tweened-BZoUkI7O.cjs"),element=require("../element-CqD0jqBJ.cjs"),events=require("../events-UlGk63iC.cjs"),file=require("../file-RHfA3OS-.cjs"),_function=require("../function-H4b_gTg6.cjs"),gestures=require("../gestures-DtYbQr49.cjs"),stylesheet=require("../stylesheet-DQv6_0na.cjs"),layout=require("../layout-rR4-aYTY.cjs"),loading=require("../loading-7Ju1mFST.cjs"),math=require("../math-C-knY2TL.cjs"),metadata=require("../metadata-BrHUfpV9.cjs"),morph=require("../morph-C71wnWQv.cjs"),number=require("../number-Bu4sGvW7.cjs"),object=require("../object-DTY_W6xG.cjs"),polyfills=require("../polyfills-DZCuDBkA.cjs"),promises=require("../promises-nDm8_iG6.cjs"),scroll=require("../scroll-DbYCgAnW.cjs"),style=require("../style-IDJ6db6n.cjs"),ticker_index=require("../index-BoGx2BWX.cjs"),url=require("../url-D0rESDQq.cjs");function insert(arr,index,...newItems){return[...arr.slice(0,index),...newItems,...arr.slice(index)]}__name(insert,"insert");function shiftArray(arr,positions){const len=arr.length;positions=positions%len;const result=new Array(len);for(let i=0;i<len;i++){const newPos=(i+positions)%len;result[newPos]=arr[i]}return result}__name(shiftArray,"shiftArray");function formatBytes(bytes,decimals=2){if(!+bytes)return"0 Bytes";const k=1024,dm=decimals<0?0:decimals,sizes=["Bytes","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],i=Math.floor(Math.log(bytes)/Math.log(k));return`${parseFloat((bytes/Math.pow(k,i)).toFixed(dm))} ${sizes[i]}`}__name(formatBytes,"formatBytes");function copyTextToClipboard(text){if(navigator.clipboard)navigator.clipboard.writeText(text).then(()=>{console.log("Text copied to clipboard successfully!")}).catch(err=>{console.error("Failed to copy text to clipboard:",err)});else{const textArea=document.createElement("textarea");textArea.value=text,textArea.style.position="fixed",textArea.style.top="0",textArea.style.left="0",document.body.appendChild(textArea),textArea.select();try{document.execCommand("copy")?console.log("Text copied to clipboard successfully!"):console.error("Failed to copy text to clipboard.")}catch(err){console.error("Failed to copy text to clipboard:",err)}document.body.removeChild(textArea)}}__name(copyTextToClipboard,"copyTextToClipboard");function dotRectCollision(dot,rect){return dot.x<rect.x+rect.width&&dot.x>rect.x&&dot.y<rect.y+rect.height&&dot.y>rect.y}__name(dotRectCollision,"dotRectCollision");function dotCircleCollision(dot,circle){return Math.sqrt((dot.x-circle.x)**2+(dot.y-circle.y)**2)<circle.radius}__name(dotCircleCollision,"dotCircleCollision");function dotPolygonCollision(dot,polygon){let inside=!1;const{x,y}=dot;for(let i=0,j=polygon.length-1;i<polygon.length;j=i++){const xi=polygon[i].x,yi=polygon[i].y,xj=polygon[j].x,yj=polygon[j].y;yi>y!=yj>y&&x<(xj-xi)*(y-yi)/(yj-yi)+xi&&(inside=!inside)}return inside}__name(dotPolygonCollision,"dotPolygonCollision");function rgbToHex(r,g,b){const toHex=__name(c=>{const hex=c.toString(16);return hex.length===1?"0"+hex:hex},"toHex");return`#${toHex(r)}${toHex(g)}${toHex(b)}`}__name(rgbToHex,"rgbToHex");function getStyleRuleActualValue(rule,name){const obj=rule.style.getPropertyValue(name);if(obj){const stringValue=obj.toString();return stringValue.startsWith("var")?getStyleRuleActualValue(rule,stringValue.slice(4,-1)):stringValue}}__name(getStyleRuleActualValue,"getStyleRuleActualValue");function getRootVariables(...names){const variables={};return Array.from(document.styleSheets).forEach(stylesheet2=>{Array.from(stylesheet2.cssRules).forEach(rule=>{rule instanceof CSSStyleRule&&rule.selectorText===":root"&&names.forEach(name=>{const value=getStyleRuleActualValue(rule,name);value&&(variables[name]=value)})})}),names.forEach(name=>{variables[name]||console.warn(`variable named ${name} not found`)}),variables}__name(getRootVariables,"getRootVariables");function encode(string){const decodedStr=window.atob(string);return decodeURIComponent(window.escape(decodedStr))}__name(encode,"encode");function decode(string){const encodedStr=window.unescape(encodeURIComponent(string));return window.btoa(encodedStr)}__name(decode,"decode");const phoneRegex=/^(\+?\d{1,3}[-.\s]?)?(\(?\d{3}\)?[-.\s]?)?\d{1,4}[-.\s]?\d{2,4}[-.\s]?\d{2,4}$/,emailRegex=/^[\w.-]+@[a-zA-Z\d.-]+\.[a-zA-Z]{2,}$/;function tryCreateHrefFromContact(contact){let href,type;return emailRegex.test(contact)?(href=`mailto:${contact.trim()}`,type="email"):phoneRegex.test(contact)&&(href=`tel:${contact.replace(/[^0-9\\.\\+]+/g,"")}`,type="phone"),{href,type,contact}}__name(tryCreateHrefFromContact,"tryCreateHrefFromContact");function transliterate(text,options={}){const{separator="-",lowercase=!0,replaceNumbers=!0,maxLength=60}=options,charMap={а:"a",б:"b",в:"v",г:"g",д:"d",е:"e",ё:"e",ж:"zh",з:"z",и:"i",й:"j",к:"k",л:"l",м:"m",н:"n",о:"o",п:"p",р:"r",с:"s",т:"t",у:"u",ф:"f",х:"h",ц:"c",ч:"ch",ш:"sh",щ:"sh",ъ:"",ы:"y",ь:"",э:"e",ю:"yu",я:"ya"};let result=text.replace(/[а-яё]/gi,char=>{const lowerChar=char.toLowerCase(),replacement=charMap[lowerChar]||"";return char===lowerChar?replacement:replacement.toUpperCase()});if(replaceNumbers){const numberMap={0:"zero",1:"one",2:"two",3:"three",4:"four",5:"five",6:"six",7:"seven",8:"eight",9:"nine"};result=result.replace(/[0-9]/g,num=>numberMap[num]||num)}return lowercase&&(result=result.toLowerCase()),result=result.replace(/[^\w\-]+/g,separator).replace(new RegExp(`\\${separator}+`,"g"),separator).replace(new RegExp(`(^\\${separator}|\\${separator}$)`,"g"),""),maxLength>0&&result.length>maxLength&&(result=result.substring(0,maxLength).replace(new RegExp(`\\${separator}[^\\${separator}]*$`),"")),result}__name(transliterate,"transliterate");function splitProgress(progress,items,initialItemsWithFullProgress=0){const totalItems=items-initialItemsWithFullProgress,splitted=[];for(let item=0;item<items;item++){const offset=item/totalItems-initialItemsWithFullProgress/totalItems,itemProgress=Math.min(1,Math.max(0,(progress-offset)*totalItems));splitted.push(itemProgress)}return splitted}__name(splitProgress,"splitProgress");function setElementsProgress(progress,elements,initialItemsWithFullProgress=0){const totalItems=elements.length-initialItemsWithFullProgress;elements.forEach((el,index)=>{const offset=index/totalItems-initialItemsWithFullProgress/totalItems,itemProgress=Math.min(1,Math.max(0,(progress-offset)*totalItems));el.style.setProperty("--item-progress",itemProgress.toString())})}__name(setElementsProgress,"setElementsProgress");function setActiveContentClasses(index,elements){elements.forEach((el,i)=>{i>index?(el.classList.remove("current","previous"),el.classList.add("next")):i<index?(el.classList.remove("current","next"),el.classList.add("previous")):(el.classList.remove("previous","next"),el.classList.add("current"))})}__name(setActiveContentClasses,"setActiveContentClasses");function cloneTemplateContent(templateElement,callback){if(templateElement){const element2=templateElement.content.cloneNode(!0).firstElementChild;return element2&&(callback==null||callback(element2)),element2}return null}__name(cloneTemplateContent,"cloneTemplateContent");function setIntervalOnIntersection(element2,delay,callback,options){let intervalId,isIntersecting=!1,current=0,previous=0,tickerUnsubsribe;const toggleInterval=__name(()=>{clearInterval(intervalId),tickerUnsubsribe==null||tickerUnsubsribe(),options!=null&&options.restartCounter&&(current=0),isIntersecting&&(callback({current,previous,progress:0}),previous=current,tickerUnsubsribe=restartTicker(),intervalId=setInterval(()=>{tickerUnsubsribe==null||tickerUnsubsribe(),current++,callback({current,previous,progress:0}),previous=current,tickerUnsubsribe=restartTicker()},delay))},"toggleInterval"),restartTicker=__name(()=>ticker_index.ticker.subscribe(e=>{const progress=e.timeElapsedSinceSubscription/delay;callback({current,previous,progress})}),"restartTicker"),intersectorUnsubscribe=ticker_index.intersector.subscribe(element2,e=>{isIntersecting=e.isIntersecting,toggleInterval()});return{destroy:__name(()=>{tickerUnsubsribe==null||tickerUnsubsribe(),intersectorUnsubscribe(),clearInterval(intervalId)},"destroy"),restart:__name((currentValue,previousValue)=>{current=currentValue||0,previousValue&&(previous=previousValue),toggleInterval()},"restart"),stop:__name(()=>{clearInterval(intervalId),tickerUnsubsribe==null||tickerUnsubsribe()},"stop")}}__name(setIntervalOnIntersection,"setIntervalOnIntersection");exports.getElementAttributesAdvanced=attributes.getElementAttributesAdvanced;exports.parseAttribute=attributes.parseAttribute;exports.parseAttributeValue=attributes.parseAttributeValue;exports.parseAttributeValueAdvanced=attributes.parseAttributeValueAdvanced;exports.camelToKebab=Store.camelToKebab;exports.capitalize=Store.capitalize;exports.declension=Store.declension;exports.decodeHtmlEntities=Store.decodeHtmlEntities;exports.generateId=Store.generateId;exports.getRandomChar=Store.getRandomChar;exports.isBrowser=Store.isBrowser;exports.isUppercase=Store.isUppercase;exports.kebabToCamel=Store.kebabToCamel;exports.snakeToDotted=Store.snakeToDotted;exports.toPascalCase=Store.toPascalCase;exports.uncapitalize=Store.uncapitalize;exports.contain=canvas.contain;exports.cover=canvas.cover;exports.fixPosition=canvas.fixPosition;exports.measureText=canvas.measureText;exports.getPointerPosition=coordinates.getPointerPosition;exports.normalize=coordinates.normalize;exports.screenToCartesian=coordinates.screenToCartesian;exports.whenDefined=customElements.whenDefined;exports.createScriptElement=dom.createScriptElement;exports.deepQuerySelectorAll=dom.deepQuerySelectorAll;exports.excludeElements=dom.excludeElements;exports.findParentElement=dom.findParentElement;exports.findScrollParentElement=dom.findScrollParentElement;exports.getAllParentElements=dom.getAllParentElements;exports.getElement=dom.getElement;exports.intersectElements=dom.intersectElements;exports.traverseNodes=dom.traverseNodes;exports.traverseShadowRoots=dom.traverseShadowRoots;exports.easeInCubic=Tweened.easeInCubic;exports.easeInExpo=Tweened.easeInExpo;exports.easeInOutCubic=Tweened.easeInOutCubic;exports.easeInOutExpo=Tweened.easeInOutExpo;exports.easeInOutQuad=Tweened.easeInOutQuad;exports.easeInOutQuart=Tweened.easeInOutQuart;exports.easeInOutQuint=Tweened.easeInOutQuint;exports.easeInQuad=Tweened.easeInQuad;exports.easeInQuart=Tweened.easeInQuart;exports.easeInQuint=Tweened.easeInQuint;exports.easeOutCubic=Tweened.easeOutCubic;exports.easeOutExpo=Tweened.easeOutExpo;exports.easeOutQuad=Tweened.easeOutQuad;exports.easeOutQuart=Tweened.easeOutQuart;exports.easeOutQuint=Tweened.easeOutQuint;exports.easings=Tweened.easings;exports.linear=Tweened.linear;exports.isElementVisible=element.isElementVisible;exports.dispatchEvent=events.dispatchEvent;exports.createJSONAndSave=file.createJSONAndSave;exports.downloadURI=file.downloadURI;exports.debounce=_function.debounce;exports.throttle=_function.throttle;exports.setupDrag=gestures.setupDrag;exports.createStylesheet=stylesheet.createStylesheet;exports.styleToString=stylesheet.styleToString;exports.getCumulativeOffsetLeft=layout.getCumulativeOffsetLeft;exports.getCumulativeOffsetTop=layout.getCumulativeOffsetTop;exports.getCumulativePosition=layout.getCumulativePosition;exports.getStickyOffset=layout.getStickyOffset;exports.requestLoadingCallback=loading.requestLoadingCallback;exports.calculateDistance=math.calculateDistance;exports.calculateDistanceWithRadius=math.calculateDistanceWithRadius;exports.clamp=math.clamp;exports.damp=math.damp;exports.lerp=math.lerp;exports.mapRange=math.mapRange;exports.round=math.round;exports.smootherstep=math.smootherstep;exports.smoothstep=math.smoothstep;exports.step=math.step;exports.formatMediaDuration=metadata.formatMediaDuration;exports.ACTION_CREATE=morph.ACTION_CREATE;exports.ACTION_PRESERVE=morph.ACTION_PRESERVE;exports.ACTION_REMOVE=morph.ACTION_REMOVE;exports.ACTION_REMOVE_ATTR=morph.ACTION_REMOVE_ATTR;exports.ACTION_REPLACE=morph.ACTION_REPLACE;exports.ACTION_SET_ATTR=morph.ACTION_SET_ATTR;exports.ACTION_SKIP=morph.ACTION_SKIP;exports.ACTION_UPDATE=morph.ACTION_UPDATE;exports.NODE_TYPE_COMMENT=morph.NODE_TYPE_COMMENT;exports.NODE_TYPE_DOCUMENT=morph.NODE_TYPE_DOCUMENT;exports.NODE_TYPE_ELEMENT=morph.NODE_TYPE_ELEMENT;exports.NODE_TYPE_TEXT=morph.NODE_TYPE_TEXT;exports.diff=morph.diff;exports.morph=morph.morph;exports.patch=morph.patch;exports.beautifyNumber=number.beautifyNumber;exports.loopNumber=number.loopNumber;exports.preciseNumber=number.preciseNumber;exports.roundNumberTo=number.roundNumberTo;exports.toStep=number.toStep;exports.cloneDeep=object.cloneDeep;exports.compareObjects=object.compareObjects;exports.isESClass=object.isESClass;exports.isNullish=object.isNullish;exports.isObject=object.isObject;exports.mergeDeep=object.mergeDeep;exports.mixin=object.mixin;exports.omit=object.omit;exports.pick=object.pick;exports.nullishCoalescing=polyfills.nullishCoalescing;exports.requestIdleCallback=polyfills.requestIdleCallback;exports.wait=promises.wait;exports.scrollToElement=scroll.scrollToElement;exports.scrollToElementTweened=scroll.scrollToElementTweened;exports.getElementTransitionDurationMS=style.getElementTransitionDurationMS;exports.getElementTransitionDurationS=style.getElementTransitionDurationS;exports.changeHistory=url.changeHistory;exports.isLocalUrl=url.isLocalUrl;exports.normalizeBase=url.normalizeBase;exports.normalizeRelativeURLs=url.normalizeRelativeURLs;exports.normalizeURL=url.normalizeURL;exports.parseSearchParameters=url.parseSearchParameters;exports.searchParamsObjectToString=url.searchParamsObjectToString;exports.searchParamsToObject=url.searchParamsToObject;exports.splitPath=url.splitPath;exports.updateSearchParameter=url.updateSearchParameter;exports.cloneTemplateContent=cloneTemplateContent;exports.copyTextToClipboard=copyTextToClipboard;exports.decode=decode;exports.dotCircleCollision=dotCircleCollision;exports.dotPolygonCollision=dotPolygonCollision;exports.dotRectCollision=dotRectCollision;exports.encode=encode;exports.formatBytes=formatBytes;exports.getRootVariables=getRootVariables;exports.getStyleRuleActualValue=getStyleRuleActualValue;exports.insert=insert;exports.rgbToHex=rgbToHex;exports.setActiveContentClasses=setActiveContentClasses;exports.setElementsProgress=setElementsProgress;exports.setIntervalOnIntersection=setIntervalOnIntersection;exports.shiftArray=shiftArray;exports.splitProgress=splitProgress;exports.transliterate=transliterate;exports.tryCreateHrefFromContact=tryCreateHrefFromContact;
@@ -13,7 +13,7 @@ import { c as c5, d as d5 } from "../file-DwQs6bB6.js";
13
13
  import { d as d6, t as t3 } from "../function-UmbPrOHm.js";
14
14
  import { s as s3 } from "../gestures-DmKKNnh4.js";
15
15
  import { c as c6, s as s4 } from "../stylesheet-GIzIJ_Xj.js";
16
- import { a as a5, b as b5, c as c7, g as g6 } from "../layout-BL6AX9-r.js";
16
+ import { a as a5, b as b5, c as c7, g as g6 } from "../layout-DxOCR4qe.js";
17
17
  import { r } from "../loading-BYWPyUhc.js";
18
18
  import { e as e4, f as f5, c as c8, d as d7, l as l2, m as m3, r as r2, b as b6, a as a6, s as s5 } from "../math-r8V23YFe.js";
19
19
  import { f as f6 } from "../metadata-BNdkmeeD.js";
@@ -22,7 +22,7 @@ import { b as b8, l as l3, p as p4, r as r3, t as t4 } from "../number-DiVt2xnh.
22
22
  import { c as c10, d as d9, i as i6, b as b9, a as a8, m as m5, e as e6, o as o2, p as p5 } from "../object-CiIdEmJx.js";
23
23
  import { n as n3, r as r4 } from "../polyfills-CG1XJNia.js";
24
24
  import { w as w2 } from "../promises-BsIKOEDq.js";
25
- import { s as s6, a as a9 } from "../scroll-IQwW3E-B.js";
25
+ import { s as s6, a as a9 } from "../scroll-CqF_88wv.js";
26
26
  import { g as g8, a as a10 } from "../style-DBoQWK0d.js";
27
27
  import { i as intersector, t as ticker } from "../index-DAG0CtYo.js";
28
28
  import { d as d10, i as i7, a as a11, b as b10, n as n4, p as p6, s as s7, e as e7, c as c11, u as u2 } from "../url-DTxLpq5m.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aptechka",
3
- "version": "0.92.3",
3
+ "version": "0.92.4",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/denisavitski/aptechka.git"