aptechka 0.51.11 → 0.51.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/accordion/index.cjs +1 -1
- package/lib/accordion/index.js +11 -11
- package/lib/scroll/ScrollElement.d.ts +1 -0
- package/lib/scroll/index.cjs +1 -1
- package/lib/scroll/index.js +47 -44
- package/package.json +1 -1
package/lib/accordion/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var I=s=>{throw TypeError(s)};var p=(s,i,t)=>i.has(s)||I("Cannot "+t);var e=(s,i,t)=>(p(s,i,"read from private field"),t?t.call(s):i.get(s)),l=(s,i,t)=>i.has(s)?I("Cannot add the same private member more than once"):i instanceof WeakSet?i.add(s):i.set(s,t),c=(s,i,t,r)=>(p(s,i,"write to private field"),r?r.call(s,t):i.set(s,t),t),m=(s,i,t)=>(p(s,i,"access private method"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";var I=s=>{throw TypeError(s)};var p=(s,i,t)=>i.has(s)||I("Cannot "+t);var e=(s,i,t)=>(p(s,i,"read from private field"),t?t.call(s):i.get(s)),l=(s,i,t)=>i.has(s)?I("Cannot add the same private member more than once"):i instanceof WeakSet?i.add(s):i.set(s,t),c=(s,i,t,r)=>(p(s,i,"write to private field"),r?r.call(s,t):i.set(s,t),t),m=(s,i,t)=>(p(s,i,"access private method"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C=require("../attribute/index.cjs"),q=require("../index-Cqw2NKev.cjs"),z=require("../events-KVanG9sR.cjs"),H=require("../style-At6aDoqG.cjs");var d,n,f,h,E,u,o,x,A,y,v,M;class S{constructor(i,t){l(this,o);l(this,d,null);l(this,n,null);l(this,f,null);l(this,h,null);l(this,E);l(this,u,!1);l(this,A,()=>{e(this,u)?this.close():this.open()});l(this,y,i=>{e(this,u)&&!(i instanceof CustomEvent)&&(m(this,o,v).call(this,0,!0),m(this,o,v).call(this,e(this,o,x)))});t.firstElementChild instanceof HTMLElement&&t.lastElementChild instanceof HTMLElement?(c(this,d,i),c(this,n,t),c(this,f,t.firstElementChild),c(this,h,t.lastElementChild),e(this,h).style.overflow="hidden",e(this,d).axisAttribute.current==="y"?e(this,h).style.height="0px":e(this,h).style.width="0px",addEventListener("resize",e(this,y)),e(this,f).addEventListener("click",e(this,A)),e(this,n).hasAttribute("data-opened")&&this.open({skipTransition:!0})):i.removeItem(e(this,n))}get element(){return e(this,n)}destroy(){e(this,f)&&(e(this,n).classList.remove("opened","triggered"),e(this,n).removeAttribute("data-opened"),e(this,f).style.cursor="",m(this,o,v).call(this,void 0),removeEventListener("resize",e(this,y)),e(this,f).removeEventListener("click",e(this,A)),clearTimeout(e(this,E)))}open(i){i!=null&&i.skipTransition&&m(this,o,M).call(this),e(this,d).multipleAttribute.current||e(this,d).closeAll({exclude:e(this,n)}),c(this,u,!0),clearTimeout(e(this,E)),e(this,n).classList.add("triggered"),m(this,o,v).call(this,e(this,o,x)),setTimeout(()=>{e(this,n).classList.add("opened"),e(this,n).setAttribute("data-opened",""),c(this,E,setTimeout(()=>{window.dispatchEvent(new Event("resize"))},H.getElementTransitionDurationMS(e(this,h))))},0),z.dispatchEvent(this.element,"accordionItemToggle",{bubbles:!0,composed:!0,detail:{opened:e(this,u),element:e(this,n)}})}close(i){i!=null&&i.skipTransition&&m(this,o,M).call(this),clearTimeout(e(this,E)),c(this,u,!1),e(this,n).classList.remove("opened"),m(this,o,v).call(this,0),c(this,E,setTimeout(()=>{e(this,n).classList.remove("triggered"),window.dispatchEvent(new Event("resize"))},H.getElementTransitionDurationMS(e(this,h)))),z.dispatchEvent(this.element,"accordionItemToggle",{bubbles:!0,composed:!0,detail:{opened:e(this,u),element:e(this,n)}})}}d=new WeakMap,n=new WeakMap,f=new WeakMap,h=new WeakMap,E=new WeakMap,u=new WeakMap,o=new WeakSet,x=function(){return e(this,d).axisAttribute.current==="x"?e(this,h).scrollWidth:e(this,h).scrollHeight},A=new WeakMap,y=new WeakMap,v=function(i,t=!1){t&&(e(this,h).style.transition="all 0s",setTimeout(()=>{e(this,h).style.transition=""}));const r=e(this,d).axisAttribute.current==="x"?"width":"height";i!=null?e(this,h).style[r]=`${i}px`:e(this,h).style[r]=""},M=function(){e(this,h).style.transition="all 0s",setTimeout(()=>{e(this,h).style.transition=""},50)};var b,T,a,g,L,k;class O extends HTMLElement{constructor(){super();l(this,L);l(this,b,new C.Attribute(this,"axis","y"));l(this,T,new C.Attribute(this,"multiple",!1));l(this,a,[]);l(this,g,null);q.isBrowser&&c(this,g,new MutationObserver(t=>{t.forEach(r=>{r.removedNodes.forEach(w=>{w instanceof HTMLElement&&this.removeItem(w)}),r.addedNodes.forEach(w=>{w instanceof HTMLElement&&this.createItem(w)})})}))}get axisAttribute(){return e(this,b)}get multipleAttribute(){return e(this,T)}createItem(t){e(this,a).find(r=>r.element===t)||e(this,a).push(new S(this,t))}removeItem(t){c(this,a,e(this,a).filter(r=>{if(r.element!==t)return!0;r.destroy()}))}closeAll(t){e(this,a).forEach(r=>{(t==null?void 0:t.exclude)!==r.element&&r.close(t)})}openAll(t){e(this,a).forEach(r=>{(t==null?void 0:t.exclude)!==r.element&&r.open(t)})}connectedCallback(){e(this,b).observe(),e(this,T).observe(),e(this,g).observe(e(this,L,k),{childList:!0}),c(this,a,[...e(this,L,k).children].map(t=>{if(t instanceof HTMLElement)return new S(this,t)}).filter(t=>!!t))}disconnectedCallback(){e(this,b).unobserve(),e(this,T).unobserve(),e(this,g).disconnect()}}b=new WeakMap,T=new WeakMap,a=new WeakMap,g=new WeakMap,L=new WeakSet,k=function(){return this.shadowRoot?this.shadowRoot:this};q.isBrowser&&!customElements.get("e-accordion")&&customElements.define("e-accordion",O);exports.AccordionElement=O;
|
package/lib/accordion/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
var
|
|
1
|
+
var C = (s) => {
|
|
2
2
|
throw TypeError(s);
|
|
3
3
|
};
|
|
4
|
-
var x = (s, i, t) => i.has(s) ||
|
|
5
|
-
var e = (s, i, t) => (x(s, i, "read from private field"), t ? t.call(s) : i.get(s)), n = (s, i, t) => i.has(s) ?
|
|
6
|
-
import { Attribute as
|
|
4
|
+
var x = (s, i, t) => i.has(s) || C("Cannot " + t);
|
|
5
|
+
var e = (s, i, t) => (x(s, i, "read from private field"), t ? t.call(s) : i.get(s)), n = (s, i, t) => i.has(s) ? C("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(s) : i.set(s, t), a = (s, i, t, r) => (x(s, i, "write to private field"), r ? r.call(s, t) : i.set(s, t), t), m = (s, i, t) => (x(s, i, "access private method"), t);
|
|
6
|
+
import { Attribute as M } from "../attribute/index.js";
|
|
7
7
|
import { i as R } from "../index-euf5anj6.js";
|
|
8
|
-
import { d as
|
|
8
|
+
import { d as z } from "../events-CsVF98U6.js";
|
|
9
9
|
import { g as H } from "../style-j2TwriJ_.js";
|
|
10
10
|
var d, h, f, l, E, u, o, y, w, L, v, k;
|
|
11
11
|
class S {
|
|
@@ -20,8 +20,8 @@ class S {
|
|
|
20
20
|
n(this, w, () => {
|
|
21
21
|
e(this, u) ? this.close() : this.open();
|
|
22
22
|
});
|
|
23
|
-
n(this, L, () => {
|
|
24
|
-
e(this, u) && (m(this, o, v).call(this, 0, !0), m(this, o, v).call(this, e(this, o, y)));
|
|
23
|
+
n(this, L, (i) => {
|
|
24
|
+
e(this, u) && !(i instanceof CustomEvent) && (m(this, o, v).call(this, 0, !0), m(this, o, v).call(this, e(this, o, y)));
|
|
25
25
|
});
|
|
26
26
|
t.firstElementChild instanceof HTMLElement && t.lastElementChild instanceof HTMLElement ? (a(this, d, i), a(this, h, t), a(this, f, t.firstElementChild), a(this, l, t.lastElementChild), e(this, l).style.overflow = "hidden", e(this, d).axisAttribute.current === "y" ? e(this, l).style.height = "0px" : e(this, l).style.width = "0px", addEventListener("resize", e(this, L)), e(this, f).addEventListener("click", e(this, w)), e(this, h).hasAttribute("data-opened") && this.open({ skipTransition: !0 })) : i.removeItem(e(this, h));
|
|
27
27
|
}
|
|
@@ -36,7 +36,7 @@ class S {
|
|
|
36
36
|
e(this, h).classList.add("opened"), e(this, h).setAttribute("data-opened", ""), a(this, E, setTimeout(() => {
|
|
37
37
|
window.dispatchEvent(new Event("resize"));
|
|
38
38
|
}, H(e(this, l))));
|
|
39
|
-
}, 0),
|
|
39
|
+
}, 0), z(this.element, "accordionItemToggle", {
|
|
40
40
|
bubbles: !0,
|
|
41
41
|
composed: !0,
|
|
42
42
|
detail: {
|
|
@@ -48,7 +48,7 @@ class S {
|
|
|
48
48
|
close(i) {
|
|
49
49
|
i != null && i.skipTransition && m(this, o, k).call(this), clearTimeout(e(this, E)), a(this, u, !1), e(this, h).classList.remove("opened"), m(this, o, v).call(this, 0), a(this, E, setTimeout(() => {
|
|
50
50
|
e(this, h).classList.remove("triggered"), window.dispatchEvent(new Event("resize"));
|
|
51
|
-
}, H(e(this, l)))),
|
|
51
|
+
}, H(e(this, l)))), z(this.element, "accordionItemToggle", {
|
|
52
52
|
bubbles: !0,
|
|
53
53
|
composed: !0,
|
|
54
54
|
detail: {
|
|
@@ -76,8 +76,8 @@ class N extends HTMLElement {
|
|
|
76
76
|
constructor() {
|
|
77
77
|
super();
|
|
78
78
|
n(this, A);
|
|
79
|
-
n(this, b, new
|
|
80
|
-
n(this, T, new
|
|
79
|
+
n(this, b, new M(this, "axis", "y"));
|
|
80
|
+
n(this, T, new M(this, "multiple", !1));
|
|
81
81
|
n(this, c, []);
|
|
82
82
|
n(this, g, null);
|
|
83
83
|
R && a(this, g, new MutationObserver((t) => {
|
|
@@ -85,6 +85,7 @@ export declare class ScrollElement extends HTMLElement {
|
|
|
85
85
|
shiftSections(step: number, options?: ScrollSetOptions): void;
|
|
86
86
|
setPosition(value: number, options?: ScrollSetOptions): void;
|
|
87
87
|
shiftPosition(value: number, options?: ScrollSetOptions): void;
|
|
88
|
+
resize(): void;
|
|
88
89
|
protected connectedCallback(): void;
|
|
89
90
|
protected disconnectedCallback(): void;
|
|
90
91
|
}
|
package/lib/scroll/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var Ze=Object.defineProperty;var Ae=Object.getOwnPropertySymbols;var je=Object.prototype.hasOwnProperty,Ke=Object.prototype.propertyIsEnumerable;var Me=d=>{throw TypeError(d)};var Re=(d,n,e)=>n in d?Ze(d,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):d[n]=e,Te=(d,n)=>{for(var e in n||(n={}))je.call(n,e)&&Re(d,e,n[e]);if(Ae)for(var e of Ae(n))Ke.call(n,e)&&Re(d,e,n[e]);return d};var Ee=(d,n,e)=>n.has(d)||Me("Cannot "+e);var t=(d,n,e)=>(Ee(d,n,"read from private field"),e?e.call(d):n.get(d)),s=(d,n,e)=>n.has(d)?Me("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(d):n.set(d,e),h=(d,n,e,i)=>(Ee(d,n,"write to private field"),i?i.call(d,e):n.set(d,e),e),c=(d,n,e)=>(Ee(d,n,"access private method"),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Je=require("../Store-GokLe_g-.cjs"),O=require("../index-Cqw2NKev.cjs"),Qe=require("../easings-GegIwET5.cjs"),se=require("../events-KVanG9sR.cjs"),De=require("../function-MthRj-GJ.cjs"),Be=require("../jss-CRBgdvJ3.cjs"),Bt=require("../layout-Ctc2p3uz.cjs"),Oe=require("../math-GDWEqu7y.cjs"),Xe=require("../number-0243DApo.cjs");require("../ticker/index.cjs");const ye=require("../order/index.cjs"),Ye=require("../Damped-DgAIjXp3.cjs"),ts=require("../Tweened-DpJDlbj9.cjs"),ge=require("../controls/index.cjs"),Ot=require("../window-resizer/index.cjs"),yt=require("../scroll-entries/index.cjs"),qe=require("../css-unit-parser/index.cjs"),S=require("../css-property/index.cjs"),es=require("../device/index.cjs"),he=require("../element-resizer/index.cjs"),ss=require("../gestures-C7gbKx11.cjs"),Ve=require("../dom-JBOkFLTh.cjs"),is=require("../scroll-segment/index.cjs");var b,Vt,g,Ct,V,tt,vt,Pt,ie;class rs{constructor(n,e,i){s(this,Pt);s(this,b);s(this,Vt);s(this,g);s(this,Ct,0);s(this,V,0);s(this,tt,null);s(this,vt,0);h(this,b,n),h(this,Vt,e),h(this,g,i),yt.scrollEntries.register(t(this,b)),this.setIndex(t(this,Vt))}get element(){return t(this,b)}get index(){return t(this,Vt)}get size(){return t(this,Ct)}get position(){return t(this,V)}get transformPosition(){return t(this,vt)}destroy(){yt.scrollEntries.unregister(t(this,b)),this.unsetTransform()}unsetTransform(){t(this,b).style.transform="",this.setMark(null),this.setIndex(null),this.setCurrentIndex(null),this.setCurrentIndexArc(null),this.setCurrentIndexArcAbs(null),this.setMiddle(!1),this.setSize()}setSize(n){n?(t(this,b).style.setProperty("--size",n+"px"),t(this,g).axisCSSProperty.current==="x"?(t(this,b).style.width=n+"px",t(this,b).style.height=""):(t(this,b).style.height=n+"px",t(this,b).style.width="")):(t(this,b).style.width="",t(this,b).style.height="",t(this,b).style.removeProperty("--size"))}resize(){h(this,Ct,t(this,g).vertical?t(this,b).offsetHeight:t(this,b).offsetWidth),h(this,V,t(this,g).vertical?Bt.getCumulativeOffsetTop(t(this,b)):Bt.getCumulativeOffsetLeft(t(this,b))),h(this,V,t(this,V)-t(this,g).contentPosition)}transform(){const n=t(this,g).shiftSectionPositionCSSProperty.current;let e=n;const i=t(this,g).viewportSize*t(this,g).sectionDistanceScaleCSSProperty.current;t(this,g).loopCSSProperty.current&&t(this,V)+t(this,Ct)<=t(this,g).currentScrollValue-n/2&&(e=(t(this,g).distance-n)*-1-t(this,g).gap),yt.scrollEntries.update(t(this,b),t(this,g).axisCSSProperty.current,e);const r=t(this,g).currentScrollValue+e,u=t(this,V)-t(this,g).viewportSize-i,f=t(this,V)+t(this,Ct)+i,y=Oe.clamp(r,u,f);h(this,vt,y*-1),t(this,g).vertical?t(this,b).style.transform=`translate3d(0px, ${t(this,vt)}px, 0px)`:t(this,b).style.transform=`translate3d(${t(this,vt)}px, 0px, 0px)`}setMark(n){t(this,tt)!==n&&(t(this,tt)&&t(this,b).classList.remove(t(this,tt)),n&&t(this,b).classList.add(n),h(this,tt,n),se.dispatchEvent(t(this,b),"scrollSectionMarkChange",{composed:!0,detail:{mark:t(this,tt)},custom:!0}))}setMiddle(n){t(this,b).classList.toggle("middle",n)}setIndex(n){c(this,Pt,ie).call(this,"index",n)}setCurrentIndex(n){c(this,Pt,ie).call(this,"current-index",n)}setCurrentIndexArc(n){c(this,Pt,ie).call(this,"current-index-arc",n)}setCurrentIndexArcAbs(n){c(this,Pt,ie).call(this,"current-index-arc-abs",n)}}b=new WeakMap,Vt=new WeakMap,g=new WeakMap,Ct=new WeakMap,V=new WeakMap,tt=new WeakMap,vt=new WeakMap,Pt=new WeakSet,ie=function(n,e){e!==null?(t(this,b).style.setProperty(`--${n}`,e.toString()),t(this,b).setAttribute(`data-${n}`,e.toString())):(t(this,b).style.removeProperty(`--${n}`),t(this,b).removeAttribute(`data-${n}`))};const ns=Be.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:"100%",height:"100%",overflow:"var(--overflow, initial)"},".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 a,Et,w,et,_,H,$,M,st,it,W,rt,wt,T,v,xt,Lt,zt,It,_t,A,kt,nt,R,ht,F,At,ot,Rt,lt,ct,ut,p,Ht,l,oe,le,C,m,k,q,at,D,E,x,$t,N,U,G,Z,Wt,dt,j,Ft,B,P,Nt,St,o,we,re,Dt,Ce,ve,xe,Le,L,ce,_e,Ut,ue,ze,Ie,gt,He,ne,ae;class Tt extends HTMLElement{constructor(){super();s(this,o);s(this,a,null);s(this,Et,new S.CSSProperty(this,"--controls",!0));s(this,w,new S.CSSProperty(this,"--axis","y"));s(this,et,new S.CSSProperty(this,"--reverse",!1));s(this,_,new S.CSSProperty(this,"--direction",0));s(this,H,new S.CSSProperty(this,"--pages",0,{validate:e=>Math.max(0,e-1)}));s(this,$,new S.CSSProperty(this,"--split",!1));s(this,M,new S.CSSProperty(this,"--sectional",!1));s(this,st,new S.CSSProperty(this,"--tween-easing",!1));s(this,it,new S.CSSProperty(this,"--tween-duration",!1));s(this,W,new S.CSSProperty(this,"--auto-size",!1));s(this,rt,new S.CSSProperty(this,"--wheel-max-delta",!1));s(this,wt,new S.CSSProperty(this,"--drag-inertion",1));s(this,T,new S.CSSProperty(this,"--sections-in-view",1));s(this,v,new S.CSSProperty(this,"--loop",!1));s(this,xt,new S.CSSProperty(this,"--damping",20));s(this,Lt,new S.CSSProperty(this,"--mass",0));s(this,zt,new S.CSSProperty(this,"--stiffness",0));s(this,It,new S.CSSProperty(this,"--mouse-drag",!1));s(this,_t,new S.CSSProperty(this,"--section-distance-scale",.5));s(this,A,new S.CSSProperty(this,"--autoplay",0));s(this,kt,new S.CSSProperty(this,"--autoplay-pause-duration",0));s(this,nt,new S.CSSProperty(this,"--autoplay-user-direction",!1));s(this,R,new S.CSSProperty(this,"--classes",!1));s(this,ht,new S.CSSProperty(this,"--current-index-start-offset",0));s(this,F,new S.CSSProperty(this,"--current-index-end-offset",0));s(this,At,new S.CSSProperty(this,"--shift-section-position",0,{rawValueCheck:!1}));s(this,ot,new S.CSSProperty(this,"--focus-delay",0));s(this,Rt,new S.CSSProperty(this,"--focus-duration",3e3));s(this,lt,new S.CSSProperty(this,"--disabled",!1));s(this,ct,new S.CSSProperty(this,"--hibernate",!1));s(this,ut,null);s(this,p,null);s(this,Ht,null);s(this,l,[]);s(this,oe,0);s(this,le,0);s(this,C,0);s(this,m,0);s(this,k,0);s(this,q,null);s(this,at,null);s(this,D,null);s(this,E,null);s(this,x,new Je.Store(0));s(this,$t,0);s(this,N,0);s(this,U,!1);s(this,G,!0);s(this,Z,!0);s(this,Wt);s(this,dt);s(this,j,new ts.Tweened);s(this,Ft,!1);s(this,B,null);s(this,P,!1);s(this,Nt,null);s(this,St,[]);s(this,L,()=>{if(t(this,ct).current)return;t(this,a).unlistenAnimationFrame();const e=this.currentScrollValue/t(this,m)||0,i=t(this,x).current;if(h(this,oe,this.vertical?Bt.getCumulativeOffsetTop(this):Bt.getCumulativeOffsetLeft(this)),h(this,le,this.vertical?Bt.getCumulativeOffsetTop(t(this,p)):Bt.getCumulativeOffsetLeft(t(this,p))),h(this,C,this.vertical?this.offsetHeight:this.offsetWidth),this.vertical?h(this,k,qe.cssUnitParser.parse(getComputedStyle(t(this,p)).rowGap)):h(this,k,qe.cssUnitParser.parse(getComputedStyle(t(this,p)).columnGap)),t(this,W).current&&t(this,l).length){const r=t(this,T).current,u=(t(this,C)-t(this,k)*(r-1))/r;t(this,l).forEach(f=>{f.setSize(u)})}else t(this,l).forEach(r=>{r.setSize()});if(t(this,l).forEach(r=>{r.resize()}),t(this,H).current){h(this,m,t(this,C)*t(this,H).current);const r=t(this,m)+t(this,C);this.vertical?(t(this,p).style.width=r+"px",t(this,p).style.height="100%"):(t(this,p).style.height=r+"px",t(this,p).style.width="100%")}else this.vertical?(t(this,p).style.width="100%",t(this,p).style.height="max-content",h(this,m,t(this,p).offsetHeight-t(this,C))):(t(this,p).style.width="max-content",t(this,p).style.height="100%",h(this,m,t(this,p).offsetWidth-t(this,C)));if(!t(this,v).current){const r=getComputedStyle(this),u=this.vertical?parseFloat(r.paddingBlockStart)+parseFloat(r.paddingBlockEnd):parseFloat(r.paddingInlineStart)+parseFloat(r.paddingInlineEnd);h(this,m,t(this,m)+u),t(this,a).max=t(this,m)}if(t(this,v).current&&t(this,l).length){const r=t(this,l)[t(this,l).length-1],u=r.position+r.size-t(this,C),f=t(this,m)-u;h(this,N,r.position+r.size+f)}else h(this,N,t(this,m));if(t(this,M).current&&t(this,l).length){const r=t(this,l)[i];t(this,a).set(r.position,{equalize:!0})}else t(this,a).set(e*t(this,m),{equalize:!0});h(this,U,(this.vertical?t(this,p).offsetHeight:t(this,p).offsetWidth)>t(this,C)),this.classList.toggle("has-overflow",t(this,U)),t(this,U)?t(this,lt).current||c(this,o,ve).call(this):c(this,o,Ce).call(this),se.dispatchEvent(this,"scrollResize",{custom:!0}),t(this,a).notify()});s(this,ce,()=>{if(!t(this,U)||t(this,Z)||t(this,G))return;const e=this.currentScrollValue;if(h(this,$t,Math.max(0,e-t(this,m))),t(this,l).length){for(let i=0;i<t(this,l).length;i++)t(this,l)[i].transform();t(this,x).current=c(this,o,ne).call(this)}else this.vertical?t(this,p).style.transform=`translate3d(0px, ${e*-1}px, 0px)`:t(this,p).style.transform=`translate3d(${e*-1}px, 0px, 0px)`;c(this,o,He).call(this),yt.scrollEntries.update(this,t(this,w).current,e)});s(this,Ut,(e,i)=>{t(this,Et).current&&(c(this,o,ze).call(this,Math.sign(i)||1),t(this,ue).call(this,e,i))});s(this,ue,(e,i)=>{if(t(this,_).current){if(t(this,_).current<0&&i>0)return;if(t(this,_).current>0&&i<0)return}if(t(this,dt)||t(this,j).unlistenAnimationFrame(),!t(this,A).current&&t(this,ot).current&&(clearInterval(t(this,Wt)),h(this,Wt,setTimeout(()=>{const r=t(this,l)[c(this,o,ne).call(this)];r&&this.scrollToSection(r.index,{tween:{duration:t(this,Rt).current,easing:Qe.easeInOutExpo}})},t(this,ot).current))),!(e.includes("drag")&&!es.device.isTouch&&!t(this,It).current)){if(t(this,M).current&&e!=="drag"){const r=Math.sign(i);if(t(this,l).length){const u={tween:t(this,st).current||t(this,it).current?{easing:t(this,st).current||"easeInOutCubic",duration:t(this,it).current||500}:void 0};t(this,Ft)?this.scrollToSection(c(this,o,ne).call(this,!0),u):this.shiftSections(r,u)}else t(this,a).shift(r*t(this,C))}else t(this,a).shift(i);h(this,Ft,e==="drag")}});s(this,ae,()=>{h(this,P,!0),this.hibernatedCSSProperty.current||c(this,o,Le).call(this)});if(O.isBrowser){const e=this.attachShadow({mode:"open"});e.adoptedStyleSheets=[ns];const i=document.createElement("div");i.className="static",i.innerHTML='<slot name="static"></slot>',e.appendChild(i),h(this,ut,document.createElement("div")),t(this,ut).className="content-wrapper",h(this,p,document.createElement("div")),t(this,p).className="content",h(this,Ht,document.createElement("slot")),t(this,p).appendChild(t(this,Ht)),t(this,ut).appendChild(t(this,p)),e.appendChild(t(this,ut)),h(this,Nt,new MutationObserver(De.debounce(()=>{this.tryResplit()},10)))}}get damped(){return t(this,a)}get controlsCSSProperty(){return t(this,Et)}get axisCSSProperty(){return t(this,w)}get reverseCSSProperty(){return t(this,et)}get directionCSSProperty(){return t(this,_)}get pagesCSSProperty(){return t(this,H)}get splitCSSProperty(){return t(this,$)}get sectionalCSSProperty(){return t(this,M)}get easingCSSProperty(){return t(this,st)}get durationCSSProperty(){return t(this,it)}get autoSizeCSSProperty(){return t(this,W)}get wheelMaxDeltaCSSProperty(){return t(this,rt)}get dragInertionCSSProperty(){return t(this,wt)}get sectionsInViewCSSProperty(){return t(this,T)}get loopCSSProperty(){return t(this,v)}get dampingCSSProperty(){return t(this,xt)}get massCSSProperty(){return t(this,Lt)}get stiffnessCSSProperty(){return t(this,zt)}get mouseDragCSSProperty(){return t(this,It)}get sectionDistanceScaleCSSProperty(){return t(this,_t)}get autoplayCSSProperty(){return t(this,A)}get autoplayPauseDurationCSSProperty(){return t(this,kt)}get autoplayUserDirectionCSSProperty(){return t(this,nt)}get classesCSSProperty(){return t(this,R)}get currentIndexStartOffsetCSSProperty(){return t(this,ht)}get currentIndexEndOffsetCSSProperty(){return t(this,F)}get shiftSectionPositionCSSProperty(){return t(this,At)}get focusDelayCSSProperty(){return t(this,ot)}get focusDurationCSSProperty(){return t(this,Rt)}get disabledCSSProperty(){return t(this,lt)}get hibernatedCSSProperty(){return t(this,ct)}get currentScrollValue(){return c(this,o,Ie).call(this,"current")}get targetScrollValue(){return c(this,o,Ie).call(this,"target")}get contentWrapperElement(){return t(this,ut)}get contentElement(){return t(this,p)}get sections(){return t(this,l)}get position(){return t(this,oe)}get contentPosition(){return t(this,le)}get viewportSize(){return t(this,C)}get scrollSize(){return t(this,m)}get gap(){return t(this,k)}get counter(){return t(this,x)}get limit(){return Math.ceil(t(this,l).length-t(this,T).current)}get distance(){return t(this,N)}get loopDistance(){return t(this,v).current?t(this,N)+t(this,k):t(this,N)}get hasOverflow(){return t(this,U)}get overscroll(){return t(this,$t)}get scrollLine(){return t(this,B)}get vertical(){return t(this,w).current==="y"}get currentProgress(){return this.currentScrollValue/this.loopDistance||0}get targetProgress(){return this.targetScrollValue/this.loopDistance||0}get scrollWidth(){return t(this,w).current==="y"?0:t(this,a).distance}get scrollHeight(){return t(this,w).current==="x"?0:t(this,a).distance}tryResplit(){!t(this,Z)&&(t(this,v).current||t(this,$).current||t(this,v).current||t(this,W).current||t(this,M).current)&&c(this,o,re).call(this)}onScroll(...e){return t(this,a).subscribe(...e)}offScroll(...e){t(this,a).unsubscribe(...e)}range(e,i,r=0){const u=e-r,f=u+i+r*2;return this.currentProgress<u?0:this.currentProgress>f?1:(this.currentProgress-u)/(f-u)}curve(e,i,r=0){return Math.sin(this.range(e,i,r)*Math.PI)}visible(e,i,r=0){const u=e-r,f=u+i+r*2;return this.currentProgress>=u&&this.currentProgress<=f}scrollToSection(e,i){if(!t(this,l).length)return;const r=t(this,x).current,u=c(this,o,_e).call(this,e),f=t(this,l)[r],y=t(this,l)[u];if(f&&y){let I=0;const Pe=c(this,o,ne).call(this),qt=t(this,l)[Pe],me=qt?this.targetScrollValue-qt.position:0;t(this,v).current?u===0&&r===t(this,l).length-1?I=t(this,m)+t(this,C)-f.position+t(this,k):u===t(this,l).length-1&&r===0?I=y.position-(t(this,m)+t(this,C)+t(this,k)):I=y.position-f.position:I=y.position-f.position,this.shiftPosition(I-me,i)}}shiftSections(e,i){t(this,l).length&&this.scrollToSection(t(this,x).current+e,i)}setPosition(e,i){c(this,o,ze).call(this,Math.sign(e)||1),i!=null&&i.tween?t(this,dt)||(t(this,j).set(t(this,a).current,{equalize:!0}),t(this,j).set(e,Te({},i.tween)),h(this,dt,setTimeout(()=>{h(this,dt,void 0)},i.tween.duration||0))):t(this,a).set(e,{equalize:(i==null?void 0:i.behaviour)==="instant"})}shiftPosition(e,i){this.setPosition(t(this,a).target+e,i)}connectedCallback(){yt.scrollEntries.register(this),h(this,a,new Ye.Damped(0,{damping:.01,min:0,order:ye.TICK_ORDER.SCROLL})),this.setAttribute("tabindex","0"),h(this,q,new ge.WheelControls({element:t(this,p)})),t(this,q).changeEvent.subscribe(t(this,Ut)),h(this,at,new ge.KeyboardControls({element:this})),t(this,at).changeEvent.subscribe(t(this,Ut)),h(this,D,new ge.DragControls({element:t(this,p),rootElement:this})),t(this,D).changeEvent.subscribe(t(this,Ut)),h(this,E,new ge.AutoplayControls({culling:this})),t(this,E).changeEvent.subscribe(t(this,ue)),t(this,w).subscribe(()=>{c(this,o,we).call(this)}),t(this,et).subscribe(()=>{c(this,o,we).call(this)}),t(this,rt).subscribe(e=>{t(this,q).axis=e.current?"max":t(this,w).current}),t(this,wt).subscribe(e=>{t(this,D).inertion=typeof e.current=="number"?e.current:1}),t(this,H).subscribe(()=>{t(this,P)&&t(this,L).call(this)}),t(this,$).subscribe(({current:e})=>{t(this,P)&&(e?c(this,o,re).call(this):c(this,o,Dt).call(this))}),t(this,M).subscribe(e=>{t(this,q).debounce=e.current,t(this,D).swipe=e.current,t(this,E).interval=e.current,t(this,P)&&(e.current&&!e.previous&&!t(this,l).length?c(this,o,re).call(this):!e.current&&e.previous&&t(this,l).length&&c(this,o,Dt).call(this))}),t(this,W).subscribe(e=>{t(this,P)&&(t(this,L).call(this),e.current&&!e.previous&&!t(this,l).length?c(this,o,re).call(this):!e.current&&e.previous&&t(this,l).length&&c(this,o,Dt).call(this))}),t(this,T).subscribe(e=>{t(this,P)&&(t(this,L).call(this),c(this,o,gt).call(this))}),t(this,v).subscribe(e=>{e.current?(t(this,P)&&(t(this,l).length||(t(this,$).current=!0)),t(this,a).max=1/0,t(this,a).min=-1/0):(h(this,$t,0),t(this,a).max=t(this,m),t(this,a).min=0)}),t(this,xt).subscribe(e=>{t(this,a).damping=e.current}),t(this,Lt).subscribe(e=>{t(this,a).mass=e.current}),t(this,zt).subscribe(e=>{t(this,a).stiffness=e.current}),t(this,A).subscribe(e=>{t(this,E).speed=e.current,!t(this,G)&&e.current&&!e.previous?t(this,E).connect():!e.current&&e.previous&&t(this,E).disconnect()}),t(this,nt).subscribe(e=>{e.current||(t(this,E).direction=1)}),t(this,R).subscribe(e=>{t(this,P)&&c(this,o,gt).call(this)}),t(this,ht).subscribe(e=>{t(this,P)&&t(this,R).current&&c(this,o,gt).call(this)}),t(this,F).subscribe(e=>{t(this,P)&&t(this,R).current&&c(this,o,gt).call(this)}),t(this,At).subscribe(e=>{t(this,P)&&t(this,a).notify()}),t(this,a).isRunning.subscribe(e=>{this.classList.toggle("active",e.current)}),t(this,x).subscribe(e=>{t(this,l).length&&c(this,o,gt).call(this),this.style.setProperty("--counter",e.current+"")}),t(this,j).subscribe(e=>{t(this,j).isRunning.current&&t(this,a).set(e.current,{equalize:!0})}),t(this,lt).subscribe(e=>{e.current&&!e.previous?(this.classList.add("disabled"),c(this,o,Ce).call(this)):!e.current&&e.previous&&(this.classList.remove("disabled"),c(this,o,ve).call(this))}),t(this,ct).subscribe(e=>{e.current&&!e.previous?(this.classList.add("hibernated"),c(this,o,xe).call(this)):!e.current&&e.previous&&(this.classList.remove("hibernated"),c(this,o,Le).call(this))}),t(this,Et).observe(),t(this,w).observe(),t(this,et).observe(),t(this,_).observe(),t(this,H).observe(),t(this,$).observe(),t(this,M).observe(),t(this,st).observe(),t(this,it).observe(),t(this,W).observe(),t(this,rt).observe(),t(this,wt).observe(),t(this,T).observe(),t(this,v).observe(),t(this,xt).observe(),t(this,Lt).observe(),t(this,zt).observe(),t(this,It).observe(),t(this,_t).observe(),t(this,A).observe(),t(this,A).observe(),t(this,kt).observe(),t(this,nt).observe(),t(this,R).observe(),t(this,ht).observe(),t(this,F).observe(),t(this,At).observe(),t(this,ot).observe(),t(this,Rt).observe(),t(this,lt).observe(),t(this,ct).observe(),Ot.windowResizer.subscribe(t(this,ae),ye.RESIZE_ORDER.LAST),t(this,Nt).observe(this,{childList:!0})}disconnectedCallback(){this.removeAttribute("tabindex"),this.classList.remove("disabled"),this.classList.remove("hibernated"),t(this,Et).unobserve(),t(this,w).unobserve(),t(this,et).unobserve(),t(this,_).unobserve(),t(this,H).unobserve(),t(this,$).unobserve(),t(this,M).unobserve(),t(this,st).unobserve(),t(this,it).unobserve(),t(this,W).unobserve(),t(this,rt).unobserve(),t(this,wt).unobserve(),t(this,T).unobserve(),t(this,v).unobserve(),t(this,xt).unobserve(),t(this,Lt).unobserve(),t(this,zt).unobserve(),t(this,It).unobserve(),t(this,_t).unobserve(),t(this,A).unobserve(),t(this,kt).unobserve(),t(this,nt).unobserve(),t(this,R).unobserve(),t(this,ht).unobserve(),t(this,F).unobserve(),t(this,At).unobserve(),t(this,ot).unobserve(),t(this,Rt).unobserve(),t(this,lt).unobserve(),t(this,ct).unobserve(),Ot.windowResizer.unsubscribe(t(this,ae)),c(this,o,xe).call(this),t(this,Nt).disconnect()}}a=new WeakMap,Et=new WeakMap,w=new WeakMap,et=new WeakMap,_=new WeakMap,H=new WeakMap,$=new WeakMap,M=new WeakMap,st=new WeakMap,it=new WeakMap,W=new WeakMap,rt=new WeakMap,wt=new WeakMap,T=new WeakMap,v=new WeakMap,xt=new WeakMap,Lt=new WeakMap,zt=new WeakMap,It=new WeakMap,_t=new WeakMap,A=new WeakMap,kt=new WeakMap,nt=new WeakMap,R=new WeakMap,ht=new WeakMap,F=new WeakMap,At=new WeakMap,ot=new WeakMap,Rt=new WeakMap,lt=new WeakMap,ct=new WeakMap,ut=new WeakMap,p=new WeakMap,Ht=new WeakMap,l=new WeakMap,oe=new WeakMap,le=new WeakMap,C=new WeakMap,m=new WeakMap,k=new WeakMap,q=new WeakMap,at=new WeakMap,D=new WeakMap,E=new WeakMap,x=new WeakMap,$t=new WeakMap,N=new WeakMap,U=new WeakMap,G=new WeakMap,Z=new WeakMap,Wt=new WeakMap,dt=new WeakMap,j=new WeakMap,Ft=new WeakMap,B=new WeakMap,P=new WeakMap,Nt=new WeakMap,St=new WeakMap,o=new WeakSet,we=function(){const e=t(this,w).current,i=t(this,et).current?"-reverse":"";t(this,p).style.flexDirection=e==="x"?`row${i}`:`column${i}`,t(this,q).axis=t(this,rt).current?"max":e,t(this,at).dimension=e==="x"?"width":"height",t(this,D).axis=e,e==="x"?this.style.touchAction="pan-y":e==="y"&&(this.style.touchAction="pan-x"),t(this,P)&&t(this,L).call(this)},re=function(){c(this,o,Dt).call(this),t(this,Ht).assignedElements().forEach((e,i)=>{e instanceof HTMLElement&&t(this,l).push(new rs(e,i,this))}),t(this,p).style.transform="",this.style.setProperty("--sections",t(this,l).length.toString()),se.dispatchEvent(this,"scrollSectionsChange",{custom:!0,composed:!0}),t(this,L).call(this),c(this,o,gt).call(this)},Dt=function(){t(this,l).forEach(e=>{e.destroy()}),h(this,l,[]),t(this,x).reset(),t(this,a).reset(),se.dispatchEvent(this,"scrollSectionsChange",{custom:!0,composed:!0})},Ce=function(){t(this,G)||(h(this,G,!0),t(this,a).unsubscribe(t(this,ce)),t(this,a).unlistenAnimationFrame(),clearInterval(t(this,Wt)),clearInterval(t(this,dt)),t(this,j).unlistenAnimationFrame(),t(this,q).disconnect(),t(this,at).disconnect(),t(this,D).disconnect(),t(this,E).disconnect(),t(this,U)||(this.sections.forEach(e=>{e.unsetTransform()}),t(this,L).call(this)))},ve=function(){t(this,G)&&(h(this,G,!1),t(this,a).subscribe(t(this,ce),-1e4),t(this,a).notify(),t(this,q).connect(),t(this,at).connect(),t(this,D).connect(),t(this,A).current&&t(this,E).connect())},xe=function(){t(this,Z)||(h(this,Z,!0),Ot.windowResizer.unsubscribe(t(this,L)),he.elementResizer.unsubscribe(t(this,L)),c(this,o,Ce).call(this),t(this,p).style.transform="",t(this,p).style.height="",t(this,p).style.width="",this.classList.remove("has-overflow","start","end"),t(this,l).length?c(this,o,Dt).call(this):(t(this,x).reset(),t(this,a).reset()),yt.scrollEntries.unregister(this))},Le=function(){t(this,Z)&&(h(this,Z,!1),yt.scrollEntries.register(this),this.tryResplit(),c(this,o,ve).call(this),Ot.windowResizer.subscribe(t(this,L),ye.RESIZE_ORDER.SCROLL),he.elementResizer.subscribe(this,t(this,L)))},L=new WeakMap,ce=new WeakMap,_e=function(e){let i=t(this,x).current;return t(this,v).current?i=Xe.loopNumber(e,t(this,l).length):i=Oe.clamp(e,0,this.limit),i},Ut=new WeakMap,ue=new WeakMap,ze=function(e=1){t(this,nt).current&&(t(this,E).direction=e),t(this,A).current&&t(this,E).pauseAndContinue(t(this,kt).current,this.sectionalCSSProperty.current)},Ie=function(e="current"){if(t(this,v).current&&t(this,l).length){const i=t(this,a)[e]%Math.round(t(this,m)+t(this,C)+t(this,k));return i<0?t(this,m)+i+t(this,C)+t(this,k):i}else return t(this,a)[e]},gt=function(){if(t(this,l).length){const e=t(this,x).current+t(this,ht).current;if(e===0?h(this,B,"start"):e===this.limit?h(this,B,"end"):h(this,B,null),se.dispatchEvent(this,"scrollLine",{detail:{line:t(this,B)}}),t(this,R).current){this.classList.remove("end","start"),t(this,B)&&this.classList.add(t(this,B));const i=t(this,T).current+t(this,F).current;h(this,St,[]),t(this,l).forEach((r,u)=>{r.setCurrentIndex(null),r.setCurrentIndexArc(null),r.setCurrentIndexArcAbs(null),r.setMiddle(!1);const f=e-this.limit-1+t(this,F).current,y=e+i,I=this.sections.length-y;u>=e&&u<y||u<=f?(r.setMark("current"),t(this,St).push(r)):u>=y&&u<y+I/2||u<=f+i?r.setMark("next"):r.setMark("previous")})}}},He=function(){if(t(this,R).current){const e=Math.floor(t(this,St).length/2);t(this,St).sort((i,r)=>i.element.getBoundingClientRect().left-r.element.getBoundingClientRect().left),t(this,St).forEach((i,r)=>{const u=r-e;i.setCurrentIndex(r),i.setCurrentIndexArc(u),i.setCurrentIndexArcAbs(Math.abs(u)),i.setMiddle(r===e)})}},ne=function(e=!1){let i=this.targetScrollValue,r=1/0,u=0;const f=t(this,a).direction;for(let y=0;y<t(this,l).length;y++){const I=t(this,l)[y];let Pe=t(this,Ft)?I.size*f*-1*.4:0,qt=I.position;this.overscroll&&qt===0&&e&&(qt=t(this,N));let me=Math.abs(qt+Pe-i);me<=r&&(r=me,u=y)}return u},ae=new WeakMap;O.isBrowser&&!customElements.get("e-scroll")&&customElements.define("e-scroll",Tt);var de;class ke extends HTMLElement{constructor(){super(...arguments);s(this,de,null)}get scrollElement(){return t(this,de)}connectedCallback(){const e=Ve.findParentElement(this,Tt);e instanceof Tt?h(this,de,e):console.error(this,"e-scroll not found")}}de=new WeakMap;var pt,z,K,J,Gt,Zt,bt,jt,Se,pe;class $e extends ke{constructor(){super();s(this,pt,null);s(this,z,null);s(this,K,!1);s(this,J,0);s(this,Gt,0);s(this,Zt,0);s(this,bt,()=>{h(this,K,this.offsetWidth>this.offsetHeight);const e=t(this,K)?this.offsetWidth:this.offsetHeight;h(this,J,e/((this.scrollElement.scrollSize+this.scrollElement.viewportSize)/e)),h(this,J,Math.max(t(this,J),30)),t(this,K)?(t(this,z).style.width=t(this,J)+"px",t(this,z).style.height="100%"):(t(this,z).style.width="100%",t(this,z).style.height=t(this,J)+"px"),h(this,Gt,e-t(this,J)),this.scrollElement.scrollSize<=0?this.style.display="none":this.style.display="",t(this,jt).call(this)});s(this,jt,()=>{h(this,Zt,this.scrollElement.currentProgress*t(this,Gt)),t(this,K)?t(this,z).style.transform=`translate3d(${t(this,Zt)}px, 0px, 0px)`:t(this,z).style.transform=`translate3d(0px, ${t(this,Zt)}px, 0px)`});s(this,Se,()=>{this.setAttribute("axis",this.scrollElement.axisCSSProperty.current)});s(this,pe,e=>{document.documentElement.classList.add("grabbing"),ss.setupDrag(u=>{const f=t(this,K)?u.x:u.y,y=this.scrollElement.distance/t(this,Gt),I=(f-r)*y;this.scrollElement.setPosition(i+I)},()=>{document.documentElement.classList.remove("grabbing")});const i=this.scrollElement.damped.target,r=t(this,K)?e.x:e.y});if(O.isBrowser){const e=this.attachShadow({mode:"open"});e.adoptedStyleSheets=[Be.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"}})],h(this,pt,document.createElement("slot")),t(this,pt).innerHTML='<div class="default-thumb"></div>',e.appendChild(t(this,pt))}}get thumbElement(){return t(this,z)}connectedCallback(){super.connectedCallback(),this.setAttribute("drag-dead-zone","");const e=t(this,pt).assignedElements()[0]||t(this,pt).firstElementChild;h(this,z,e),t(this,z).addEventListener("pointerdown",t(this,pe)),Ot.windowResizer.subscribe(t(this,bt),ye.RESIZE_ORDER.SCROLL),he.elementResizer.subscribe(this,t(this,bt)),he.elementResizer.subscribe(this.scrollElement,t(this,bt)),this.scrollElement.onScroll(t(this,jt)),this.scrollElement.axisCSSProperty.subscribe(t(this,Se))}disconnectedCallback(){this.removeAttribute("drag-dead-zone"),this.style.display="",t(this,z).removeEventListener("pointerdown",t(this,pe)),Ot.windowResizer.unsubscribe(t(this,bt)),he.elementResizer.unsubscribe(t(this,bt)),this.scrollElement.offScroll(t(this,jt)),this.scrollElement.axisCSSProperty.unsubscribe(t(this,Se))}}pt=new WeakMap,z=new WeakMap,K=new WeakMap,J=new WeakMap,Gt=new WeakMap,Zt=new WeakMap,bt=new WeakMap,jt=new WeakMap,Se=new WeakMap,pe=new WeakMap;O.isBrowser&&!customElements.get("e-scrollbar")&&customElements.define("e-scrollbar",$e);var Kt,Jt,Qt;class We extends ke{constructor(){super();s(this,Kt,new S.CSSProperty(this,"--behaviour","smooth"));s(this,Jt,new S.CSSProperty(this,"--tween-easing",!1));s(this,Qt,new S.CSSProperty(this,"--tween-duration",0));O.isBrowser&&this.addEventListener("click",()=>{const e=t(this,Kt).current,i=t(this,Jt).current,r=t(this,Qt).current;this.handleClick({behaviour:e,tween:i||r?{easing:i,duration:r}:void 0})})}connectedCallback(){super.connectedCallback(),t(this,Kt).observe(),t(this,Jt).observe(),t(this,Qt).observe()}disconnectedCallback(){t(this,Kt).close(),t(this,Jt).close(),t(this,Qt).close()}}Kt=new WeakMap,Jt=new WeakMap,Qt=new WeakMap;var Xt;class Fe extends We{constructor(){super(...arguments);s(this,Xt,new S.CSSProperty(this,"--set",1))}handleClick(e){this.scrollElement.scrollToSection(t(this,Xt).current,e)}connectedCallback(){super.connectedCallback(),t(this,Xt).observe()}disconnectedCallback(){super.disconnectedCallback(),t(this,Xt).close()}}Xt=new WeakMap;O.isBrowser&&!customElements.get("e-scroll-set-button")&&customElements.define("e-scroll-set-button",Fe);var Q,Yt;class Ne extends We{constructor(){super(...arguments);s(this,Q,new S.CSSProperty(this,"--step",1));s(this,Yt,()=>{this.scrollElement.loopCSSProperty.current?this.removeAttribute("disabled"):t(this,Q).current>0&&this.scrollElement.scrollLine==="end"||t(this,Q).current<0&&this.scrollElement.scrollLine==="start"?this.setAttribute("disabled",""):this.removeAttribute("disabled")})}handleClick(e){this.scrollElement.shiftSections(t(this,Q).current,e)}connectedCallback(){super.connectedCallback(),this.scrollElement&&(t(this,Q).subscribe(()=>{t(this,Yt).call(this)}),t(this,Q).observe(),this.scrollElement.addEventListener("scrollLine",t(this,Yt)),t(this,Yt).call(this))}disconnectedCallback(){super.disconnectedCallback(),t(this,Q).close(),this.removeAttribute("disabled")}}Q=new WeakMap,Yt=new WeakMap;O.isBrowser&&!customElements.get("e-scroll-step-button")&&customElements.define("e-scroll-step-button",Ne);var X,ft,te,be,fe,ee;class hs{constructor(n,e,i){s(this,X,null);s(this,ft,null);s(this,te,null);s(this,be,null);s(this,fe,()=>{t(this,ft).scrollToSection(t(this,te),{behaviour:t(this,be)})});s(this,ee,()=>{t(this,X).classList.toggle("current",t(this,ft).counter.current===t(this,te))});O.isBrowser&&(h(this,X,document.createElement("button")),h(this,ft,n),h(this,be,i),h(this,te,e),t(this,X).addEventListener("click",t(this,fe)),t(this,ft).counter.subscribe(t(this,ee)),t(this,ee).call(this))}get element(){return t(this,X)}destroy(){t(this,X).removeEventListener("click",t(this,fe)),t(this,ft).counter.unsubscribe(t(this,ee)),t(this,X).remove()}}X=new WeakMap,ft=new WeakMap,te=new WeakMap,be=new WeakMap,fe=new WeakMap,ee=new WeakMap;var Mt,mt,Y;class Ue extends ke{constructor(){super(...arguments);s(this,Mt,null);s(this,mt,[]);s(this,Y,De.debounce(()=>{t(this,mt).forEach(i=>i.destroy()),h(this,mt,[]);let e=0;this.scrollElement.loopCSSProperty.current?e=this.scrollElement.sections.length:e=this.scrollElement.sections.length-Math.max(this.scrollElement.sectionsInViewCSSProperty.current-1,0);for(let i=0;i<e;i++){const r=new hs(this.scrollElement,i,this.getAttribute("behaviour")||"smooth");t(this,Mt).appendChild(r.element),t(this,mt).push(r)}},0))}connectedCallback(){super.connectedCallback(),this.scrollElement.addEventListener("sectionsChange",t(this,Y)),this.scrollElement.sectionsInViewCSSProperty.subscribe(t(this,Y)),this.scrollElement.loopCSSProperty.subscribe(t(this,Y)),h(this,Mt,document.createElement("div")),this.appendChild(t(this,Mt))}disconnectedCallback(){this.scrollElement.removeEventListener("sectionsChange",t(this,Y)),this.scrollElement.sectionsInViewCSSProperty.unsubscribe(t(this,Y)),this.scrollElement.loopCSSProperty.unsubscribe(t(this,Y)),t(this,mt).forEach(e=>e.destroy()),h(this,mt,[]),t(this,Mt).remove()}}Mt=new WeakMap,mt=new WeakMap,Y=new WeakMap;O.isBrowser&&!customElements.get("e-scroll-bullet-buttons")&&customElements.define("e-scroll-bullet-buttons",Ue);class Ge extends is.ScrollSegmentElement{connectedCallback(){const n=Ve.findParentElement(this,Tt);n instanceof Tt?(this.scrollContainer=n,this.scrollContainer.addEventListener("scrollSectionsChange",this.findAnotherScrollEntries),this.scrollContainer.addEventListener("scrollResize",this.resize),this.resize()):console.error(this,"e-scroll not found")}disconnectedCallback(){super.disconnectedCallback(),this.scrollContainer instanceof Tt&&(this.scrollContainer.removeEventListener("scrollSectionsChange",this.findAnotherScrollEntries),this.scrollContainer.removeEventListener("scrollResize",this.resize))}}O.isBrowser&&!customElements.get("e-scroll-segment")&&customElements.define("e-scroll-segment",Ge);exports.ScrollBulletButtonsElement=Ue;exports.ScrollElement=Tt;exports.ScrollSegmentElement=Ge;exports.ScrollSetButtonElement=Fe;exports.ScrollStepButtonElement=Ne;exports.ScrollbarElement=$e;
|
|
1
|
+
"use strict";var Ze=Object.defineProperty;var Ae=Object.getOwnPropertySymbols;var je=Object.prototype.hasOwnProperty,Ke=Object.prototype.propertyIsEnumerable;var Me=d=>{throw TypeError(d)};var Re=(d,n,e)=>n in d?Ze(d,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):d[n]=e,Te=(d,n)=>{for(var e in n||(n={}))je.call(n,e)&&Re(d,e,n[e]);if(Ae)for(var e of Ae(n))Ke.call(n,e)&&Re(d,e,n[e]);return d};var Ee=(d,n,e)=>n.has(d)||Me("Cannot "+e);var t=(d,n,e)=>(Ee(d,n,"read from private field"),e?e.call(d):n.get(d)),s=(d,n,e)=>n.has(d)?Me("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(d):n.set(d,e),h=(d,n,e,i)=>(Ee(d,n,"write to private field"),i?i.call(d,e):n.set(d,e),e),c=(d,n,e)=>(Ee(d,n,"access private method"),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Je=require("../Store-GokLe_g-.cjs"),O=require("../index-Cqw2NKev.cjs"),Qe=require("../easings-GegIwET5.cjs"),se=require("../events-KVanG9sR.cjs"),De=require("../function-MthRj-GJ.cjs"),Be=require("../jss-CRBgdvJ3.cjs"),Bt=require("../layout-Ctc2p3uz.cjs"),Oe=require("../math-GDWEqu7y.cjs"),Xe=require("../number-0243DApo.cjs");require("../ticker/index.cjs");const ye=require("../order/index.cjs"),Ye=require("../Damped-DgAIjXp3.cjs"),ts=require("../Tweened-DpJDlbj9.cjs"),ge=require("../controls/index.cjs"),Ot=require("../window-resizer/index.cjs"),yt=require("../scroll-entries/index.cjs"),qe=require("../css-unit-parser/index.cjs"),S=require("../css-property/index.cjs"),es=require("../device/index.cjs"),he=require("../element-resizer/index.cjs"),ss=require("../gestures-C7gbKx11.cjs"),Ve=require("../dom-JBOkFLTh.cjs"),is=require("../scroll-segment/index.cjs");var b,Vt,g,Ct,V,tt,vt,Pt,ie;class rs{constructor(n,e,i){s(this,Pt);s(this,b);s(this,Vt);s(this,g);s(this,Ct,0);s(this,V,0);s(this,tt,null);s(this,vt,0);h(this,b,n),h(this,Vt,e),h(this,g,i),yt.scrollEntries.register(t(this,b)),this.setIndex(t(this,Vt))}get element(){return t(this,b)}get index(){return t(this,Vt)}get size(){return t(this,Ct)}get position(){return t(this,V)}get transformPosition(){return t(this,vt)}destroy(){yt.scrollEntries.unregister(t(this,b)),this.unsetTransform()}unsetTransform(){t(this,b).style.transform="",this.setMark(null),this.setIndex(null),this.setCurrentIndex(null),this.setCurrentIndexArc(null),this.setCurrentIndexArcAbs(null),this.setMiddle(!1),this.setSize()}setSize(n){n?(t(this,b).style.setProperty("--size",n+"px"),t(this,g).axisCSSProperty.current==="x"?(t(this,b).style.width=n+"px",t(this,b).style.height=""):(t(this,b).style.height=n+"px",t(this,b).style.width="")):(t(this,b).style.width="",t(this,b).style.height="",t(this,b).style.removeProperty("--size"))}resize(){h(this,Ct,t(this,g).vertical?t(this,b).offsetHeight:t(this,b).offsetWidth),h(this,V,t(this,g).vertical?Bt.getCumulativeOffsetTop(t(this,b)):Bt.getCumulativeOffsetLeft(t(this,b))),h(this,V,t(this,V)-t(this,g).contentPosition)}transform(){const n=t(this,g).shiftSectionPositionCSSProperty.current;let e=n;const i=t(this,g).viewportSize*t(this,g).sectionDistanceScaleCSSProperty.current;t(this,g).loopCSSProperty.current&&t(this,V)+t(this,Ct)<=t(this,g).currentScrollValue-n/2&&(e=(t(this,g).distance-n)*-1-t(this,g).gap),yt.scrollEntries.update(t(this,b),t(this,g).axisCSSProperty.current,e);const r=t(this,g).currentScrollValue+e,u=t(this,V)-t(this,g).viewportSize-i,f=t(this,V)+t(this,Ct)+i,y=Oe.clamp(r,u,f);h(this,vt,y*-1),t(this,g).vertical?t(this,b).style.transform=`translate3d(0px, ${t(this,vt)}px, 0px)`:t(this,b).style.transform=`translate3d(${t(this,vt)}px, 0px, 0px)`}setMark(n){t(this,tt)!==n&&(t(this,tt)&&t(this,b).classList.remove(t(this,tt)),n&&t(this,b).classList.add(n),h(this,tt,n),se.dispatchEvent(t(this,b),"scrollSectionMarkChange",{composed:!0,detail:{mark:t(this,tt)},custom:!0}))}setMiddle(n){t(this,b).classList.toggle("middle",n)}setIndex(n){c(this,Pt,ie).call(this,"index",n)}setCurrentIndex(n){c(this,Pt,ie).call(this,"current-index",n)}setCurrentIndexArc(n){c(this,Pt,ie).call(this,"current-index-arc",n)}setCurrentIndexArcAbs(n){c(this,Pt,ie).call(this,"current-index-arc-abs",n)}}b=new WeakMap,Vt=new WeakMap,g=new WeakMap,Ct=new WeakMap,V=new WeakMap,tt=new WeakMap,vt=new WeakMap,Pt=new WeakSet,ie=function(n,e){e!==null?(t(this,b).style.setProperty(`--${n}`,e.toString()),t(this,b).setAttribute(`data-${n}`,e.toString())):(t(this,b).style.removeProperty(`--${n}`),t(this,b).removeAttribute(`data-${n}`))};const ns=Be.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:"100%",height:"100%",overflow:"var(--overflow, initial)"},".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 a,Et,w,et,_,H,$,M,st,it,W,rt,wt,T,v,xt,Lt,zt,It,_t,A,kt,nt,R,ht,F,At,ot,Rt,lt,ct,ut,p,Ht,l,oe,le,C,m,k,q,at,D,E,x,$t,N,U,G,Z,Wt,dt,j,Ft,B,P,Nt,St,o,we,re,Dt,Ce,ve,xe,Le,L,ce,_e,Ut,ue,ze,Ie,gt,He,ne,ae;class Tt extends HTMLElement{constructor(){super();s(this,o);s(this,a,null);s(this,Et,new S.CSSProperty(this,"--controls",!0));s(this,w,new S.CSSProperty(this,"--axis","y"));s(this,et,new S.CSSProperty(this,"--reverse",!1));s(this,_,new S.CSSProperty(this,"--direction",0));s(this,H,new S.CSSProperty(this,"--pages",0,{validate:e=>Math.max(0,e-1)}));s(this,$,new S.CSSProperty(this,"--split",!1));s(this,M,new S.CSSProperty(this,"--sectional",!1));s(this,st,new S.CSSProperty(this,"--tween-easing",!1));s(this,it,new S.CSSProperty(this,"--tween-duration",!1));s(this,W,new S.CSSProperty(this,"--auto-size",!1));s(this,rt,new S.CSSProperty(this,"--wheel-max-delta",!1));s(this,wt,new S.CSSProperty(this,"--drag-inertion",1));s(this,T,new S.CSSProperty(this,"--sections-in-view",1));s(this,v,new S.CSSProperty(this,"--loop",!1));s(this,xt,new S.CSSProperty(this,"--damping",20));s(this,Lt,new S.CSSProperty(this,"--mass",0));s(this,zt,new S.CSSProperty(this,"--stiffness",0));s(this,It,new S.CSSProperty(this,"--mouse-drag",!1));s(this,_t,new S.CSSProperty(this,"--section-distance-scale",.5));s(this,A,new S.CSSProperty(this,"--autoplay",0));s(this,kt,new S.CSSProperty(this,"--autoplay-pause-duration",0));s(this,nt,new S.CSSProperty(this,"--autoplay-user-direction",!1));s(this,R,new S.CSSProperty(this,"--classes",!1));s(this,ht,new S.CSSProperty(this,"--current-index-start-offset",0));s(this,F,new S.CSSProperty(this,"--current-index-end-offset",0));s(this,At,new S.CSSProperty(this,"--shift-section-position",0,{rawValueCheck:!1}));s(this,ot,new S.CSSProperty(this,"--focus-delay",0));s(this,Rt,new S.CSSProperty(this,"--focus-duration",3e3));s(this,lt,new S.CSSProperty(this,"--disabled",!1));s(this,ct,new S.CSSProperty(this,"--hibernate",!1));s(this,ut,null);s(this,p,null);s(this,Ht,null);s(this,l,[]);s(this,oe,0);s(this,le,0);s(this,C,0);s(this,m,0);s(this,k,0);s(this,q,null);s(this,at,null);s(this,D,null);s(this,E,null);s(this,x,new Je.Store(0));s(this,$t,0);s(this,N,0);s(this,U,!1);s(this,G,!0);s(this,Z,!0);s(this,Wt);s(this,dt);s(this,j,new ts.Tweened);s(this,Ft,!1);s(this,B,null);s(this,P,!1);s(this,Nt,null);s(this,St,[]);s(this,L,()=>{this.resize()});s(this,ce,()=>{if(!t(this,U)||t(this,Z)||t(this,G))return;const e=this.currentScrollValue;if(h(this,$t,Math.max(0,e-t(this,m))),t(this,l).length){for(let i=0;i<t(this,l).length;i++)t(this,l)[i].transform();t(this,x).current=c(this,o,ne).call(this)}else this.vertical?t(this,p).style.transform=`translate3d(0px, ${e*-1}px, 0px)`:t(this,p).style.transform=`translate3d(${e*-1}px, 0px, 0px)`;c(this,o,He).call(this),yt.scrollEntries.update(this,t(this,w).current,e)});s(this,Ut,(e,i)=>{t(this,Et).current&&(c(this,o,ze).call(this,Math.sign(i)||1),t(this,ue).call(this,e,i))});s(this,ue,(e,i)=>{if(t(this,_).current){if(t(this,_).current<0&&i>0)return;if(t(this,_).current>0&&i<0)return}if(t(this,dt)||t(this,j).unlistenAnimationFrame(),!t(this,A).current&&t(this,ot).current&&(clearInterval(t(this,Wt)),h(this,Wt,setTimeout(()=>{const r=t(this,l)[c(this,o,ne).call(this)];r&&this.scrollToSection(r.index,{tween:{duration:t(this,Rt).current,easing:Qe.easeInOutExpo}})},t(this,ot).current))),!(e.includes("drag")&&!es.device.isTouch&&!t(this,It).current)){if(t(this,M).current&&e!=="drag"){const r=Math.sign(i);if(t(this,l).length){const u={tween:t(this,st).current||t(this,it).current?{easing:t(this,st).current||"easeInOutCubic",duration:t(this,it).current||500}:void 0};t(this,Ft)?this.scrollToSection(c(this,o,ne).call(this,!0),u):this.shiftSections(r,u)}else t(this,a).shift(r*t(this,C))}else t(this,a).shift(i);h(this,Ft,e==="drag")}});s(this,ae,()=>{h(this,P,!0),this.hibernatedCSSProperty.current||c(this,o,Le).call(this)});if(O.isBrowser){const e=this.attachShadow({mode:"open"});e.adoptedStyleSheets=[ns];const i=document.createElement("div");i.className="static",i.innerHTML='<slot name="static"></slot>',e.appendChild(i),h(this,ut,document.createElement("div")),t(this,ut).className="content-wrapper",h(this,p,document.createElement("div")),t(this,p).className="content",h(this,Ht,document.createElement("slot")),t(this,p).appendChild(t(this,Ht)),t(this,ut).appendChild(t(this,p)),e.appendChild(t(this,ut)),h(this,Nt,new MutationObserver(De.debounce(()=>{this.tryResplit()},10)))}}get damped(){return t(this,a)}get controlsCSSProperty(){return t(this,Et)}get axisCSSProperty(){return t(this,w)}get reverseCSSProperty(){return t(this,et)}get directionCSSProperty(){return t(this,_)}get pagesCSSProperty(){return t(this,H)}get splitCSSProperty(){return t(this,$)}get sectionalCSSProperty(){return t(this,M)}get easingCSSProperty(){return t(this,st)}get durationCSSProperty(){return t(this,it)}get autoSizeCSSProperty(){return t(this,W)}get wheelMaxDeltaCSSProperty(){return t(this,rt)}get dragInertionCSSProperty(){return t(this,wt)}get sectionsInViewCSSProperty(){return t(this,T)}get loopCSSProperty(){return t(this,v)}get dampingCSSProperty(){return t(this,xt)}get massCSSProperty(){return t(this,Lt)}get stiffnessCSSProperty(){return t(this,zt)}get mouseDragCSSProperty(){return t(this,It)}get sectionDistanceScaleCSSProperty(){return t(this,_t)}get autoplayCSSProperty(){return t(this,A)}get autoplayPauseDurationCSSProperty(){return t(this,kt)}get autoplayUserDirectionCSSProperty(){return t(this,nt)}get classesCSSProperty(){return t(this,R)}get currentIndexStartOffsetCSSProperty(){return t(this,ht)}get currentIndexEndOffsetCSSProperty(){return t(this,F)}get shiftSectionPositionCSSProperty(){return t(this,At)}get focusDelayCSSProperty(){return t(this,ot)}get focusDurationCSSProperty(){return t(this,Rt)}get disabledCSSProperty(){return t(this,lt)}get hibernatedCSSProperty(){return t(this,ct)}get currentScrollValue(){return c(this,o,Ie).call(this,"current")}get targetScrollValue(){return c(this,o,Ie).call(this,"target")}get contentWrapperElement(){return t(this,ut)}get contentElement(){return t(this,p)}get sections(){return t(this,l)}get position(){return t(this,oe)}get contentPosition(){return t(this,le)}get viewportSize(){return t(this,C)}get scrollSize(){return t(this,m)}get gap(){return t(this,k)}get counter(){return t(this,x)}get limit(){return Math.ceil(t(this,l).length-t(this,T).current)}get distance(){return t(this,N)}get loopDistance(){return t(this,v).current?t(this,N)+t(this,k):t(this,N)}get hasOverflow(){return t(this,U)}get overscroll(){return t(this,$t)}get scrollLine(){return t(this,B)}get vertical(){return t(this,w).current==="y"}get currentProgress(){return this.currentScrollValue/this.loopDistance||0}get targetProgress(){return this.targetScrollValue/this.loopDistance||0}get scrollWidth(){return t(this,w).current==="y"?0:t(this,a).distance}get scrollHeight(){return t(this,w).current==="x"?0:t(this,a).distance}tryResplit(){!t(this,Z)&&(t(this,v).current||t(this,$).current||t(this,v).current||t(this,W).current||t(this,M).current)&&c(this,o,re).call(this)}onScroll(...e){return t(this,a).subscribe(...e)}offScroll(...e){t(this,a).unsubscribe(...e)}range(e,i,r=0){const u=e-r,f=u+i+r*2;return this.currentProgress<u?0:this.currentProgress>f?1:(this.currentProgress-u)/(f-u)}curve(e,i,r=0){return Math.sin(this.range(e,i,r)*Math.PI)}visible(e,i,r=0){const u=e-r,f=u+i+r*2;return this.currentProgress>=u&&this.currentProgress<=f}scrollToSection(e,i){if(!t(this,l).length)return;const r=t(this,x).current,u=c(this,o,_e).call(this,e),f=t(this,l)[r],y=t(this,l)[u];if(f&&y){let I=0;const Pe=c(this,o,ne).call(this),qt=t(this,l)[Pe],me=qt?this.targetScrollValue-qt.position:0;t(this,v).current?u===0&&r===t(this,l).length-1?I=t(this,m)+t(this,C)-f.position+t(this,k):u===t(this,l).length-1&&r===0?I=y.position-(t(this,m)+t(this,C)+t(this,k)):I=y.position-f.position:I=y.position-f.position,this.shiftPosition(I-me,i)}}shiftSections(e,i){t(this,l).length&&this.scrollToSection(t(this,x).current+e,i)}setPosition(e,i){c(this,o,ze).call(this,Math.sign(e)||1),i!=null&&i.tween?t(this,dt)||(t(this,j).set(t(this,a).current,{equalize:!0}),t(this,j).set(e,Te({},i.tween)),h(this,dt,setTimeout(()=>{h(this,dt,void 0)},i.tween.duration||0))):t(this,a).set(e,{equalize:(i==null?void 0:i.behaviour)==="instant"})}shiftPosition(e,i){this.setPosition(t(this,a).target+e,i)}resize(){if(t(this,ct).current)return;t(this,a).unlistenAnimationFrame();const e=this.currentScrollValue/t(this,m)||0,i=t(this,x).current;if(h(this,oe,this.vertical?Bt.getCumulativeOffsetTop(this):Bt.getCumulativeOffsetLeft(this)),h(this,le,this.vertical?Bt.getCumulativeOffsetTop(t(this,p)):Bt.getCumulativeOffsetLeft(t(this,p))),h(this,C,this.vertical?this.offsetHeight:this.offsetWidth),this.vertical?h(this,k,qe.cssUnitParser.parse(getComputedStyle(t(this,p)).rowGap)):h(this,k,qe.cssUnitParser.parse(getComputedStyle(t(this,p)).columnGap)),t(this,W).current&&t(this,l).length){const r=t(this,T).current,u=(t(this,C)-t(this,k)*(r-1))/r;t(this,l).forEach(f=>{f.setSize(u)})}else t(this,l).forEach(r=>{r.setSize()});if(t(this,l).forEach(r=>{r.resize()}),t(this,H).current){h(this,m,t(this,C)*t(this,H).current);const r=t(this,m)+t(this,C);this.vertical?(t(this,p).style.width=r+"px",t(this,p).style.height="100%"):(t(this,p).style.height=r+"px",t(this,p).style.width="100%")}else this.vertical?(t(this,p).style.width="100%",t(this,p).style.height="max-content",h(this,m,t(this,p).offsetHeight-t(this,C))):(t(this,p).style.width="max-content",t(this,p).style.height="100%",h(this,m,t(this,p).offsetWidth-t(this,C)));if(!t(this,v).current){const r=getComputedStyle(this),u=this.vertical?parseFloat(r.paddingBlockStart)+parseFloat(r.paddingBlockEnd):parseFloat(r.paddingInlineStart)+parseFloat(r.paddingInlineEnd);h(this,m,t(this,m)+u),t(this,a).max=t(this,m)}if(t(this,v).current&&t(this,l).length){const r=t(this,l)[t(this,l).length-1],u=r.position+r.size-t(this,C),f=t(this,m)-u;h(this,N,r.position+r.size+f)}else h(this,N,t(this,m));if(t(this,M).current&&t(this,l).length){const r=t(this,l)[i];t(this,a).set(r.position,{equalize:!0})}else t(this,a).set(e*t(this,m),{equalize:!0});h(this,U,(this.vertical?t(this,p).offsetHeight:t(this,p).offsetWidth)>t(this,C)),this.classList.toggle("has-overflow",t(this,U)),t(this,U)?t(this,lt).current||c(this,o,ve).call(this):c(this,o,Ce).call(this),se.dispatchEvent(this,"scrollResize",{custom:!0}),t(this,a).notify()}connectedCallback(){yt.scrollEntries.register(this),h(this,a,new Ye.Damped(0,{damping:.01,min:0,order:ye.TICK_ORDER.SCROLL})),this.setAttribute("tabindex","0"),h(this,q,new ge.WheelControls({element:t(this,p)})),t(this,q).changeEvent.subscribe(t(this,Ut)),h(this,at,new ge.KeyboardControls({element:this})),t(this,at).changeEvent.subscribe(t(this,Ut)),h(this,D,new ge.DragControls({element:t(this,p),rootElement:this})),t(this,D).changeEvent.subscribe(t(this,Ut)),h(this,E,new ge.AutoplayControls({culling:this})),t(this,E).changeEvent.subscribe(t(this,ue)),t(this,w).subscribe(()=>{c(this,o,we).call(this)}),t(this,et).subscribe(()=>{c(this,o,we).call(this)}),t(this,rt).subscribe(e=>{t(this,q).axis=e.current?"max":t(this,w).current}),t(this,wt).subscribe(e=>{t(this,D).inertion=typeof e.current=="number"?e.current:1}),t(this,H).subscribe(()=>{t(this,P)&&t(this,L).call(this)}),t(this,$).subscribe(({current:e})=>{t(this,P)&&(e?c(this,o,re).call(this):c(this,o,Dt).call(this))}),t(this,M).subscribe(e=>{t(this,q).debounce=e.current,t(this,D).swipe=e.current,t(this,E).interval=e.current,t(this,P)&&(e.current&&!e.previous&&!t(this,l).length?c(this,o,re).call(this):!e.current&&e.previous&&t(this,l).length&&c(this,o,Dt).call(this))}),t(this,W).subscribe(e=>{t(this,P)&&(t(this,L).call(this),e.current&&!e.previous&&!t(this,l).length?c(this,o,re).call(this):!e.current&&e.previous&&t(this,l).length&&c(this,o,Dt).call(this))}),t(this,T).subscribe(e=>{t(this,P)&&(t(this,L).call(this),c(this,o,gt).call(this))}),t(this,v).subscribe(e=>{e.current?(t(this,P)&&(t(this,l).length||(t(this,$).current=!0)),t(this,a).max=1/0,t(this,a).min=-1/0):(h(this,$t,0),t(this,a).max=t(this,m),t(this,a).min=0)}),t(this,xt).subscribe(e=>{t(this,a).damping=e.current}),t(this,Lt).subscribe(e=>{t(this,a).mass=e.current}),t(this,zt).subscribe(e=>{t(this,a).stiffness=e.current}),t(this,A).subscribe(e=>{t(this,E).speed=e.current,!t(this,G)&&e.current&&!e.previous?t(this,E).connect():!e.current&&e.previous&&t(this,E).disconnect()}),t(this,nt).subscribe(e=>{e.current||(t(this,E).direction=1)}),t(this,R).subscribe(e=>{t(this,P)&&c(this,o,gt).call(this)}),t(this,ht).subscribe(e=>{t(this,P)&&t(this,R).current&&c(this,o,gt).call(this)}),t(this,F).subscribe(e=>{t(this,P)&&t(this,R).current&&c(this,o,gt).call(this)}),t(this,At).subscribe(e=>{t(this,P)&&t(this,a).notify()}),t(this,a).isRunning.subscribe(e=>{this.classList.toggle("active",e.current)}),t(this,x).subscribe(e=>{t(this,l).length&&c(this,o,gt).call(this),this.style.setProperty("--counter",e.current+"")}),t(this,j).subscribe(e=>{t(this,j).isRunning.current&&t(this,a).set(e.current,{equalize:!0})}),t(this,lt).subscribe(e=>{e.current&&!e.previous?(this.classList.add("disabled"),c(this,o,Ce).call(this)):!e.current&&e.previous&&(this.classList.remove("disabled"),c(this,o,ve).call(this))}),t(this,ct).subscribe(e=>{e.current&&!e.previous?(this.classList.add("hibernated"),c(this,o,xe).call(this)):!e.current&&e.previous&&(this.classList.remove("hibernated"),c(this,o,Le).call(this))}),t(this,Et).observe(),t(this,w).observe(),t(this,et).observe(),t(this,_).observe(),t(this,H).observe(),t(this,$).observe(),t(this,M).observe(),t(this,st).observe(),t(this,it).observe(),t(this,W).observe(),t(this,rt).observe(),t(this,wt).observe(),t(this,T).observe(),t(this,v).observe(),t(this,xt).observe(),t(this,Lt).observe(),t(this,zt).observe(),t(this,It).observe(),t(this,_t).observe(),t(this,A).observe(),t(this,A).observe(),t(this,kt).observe(),t(this,nt).observe(),t(this,R).observe(),t(this,ht).observe(),t(this,F).observe(),t(this,At).observe(),t(this,ot).observe(),t(this,Rt).observe(),t(this,lt).observe(),t(this,ct).observe(),Ot.windowResizer.subscribe(t(this,ae),ye.RESIZE_ORDER.LAST),t(this,Nt).observe(this,{childList:!0})}disconnectedCallback(){this.removeAttribute("tabindex"),this.classList.remove("disabled"),this.classList.remove("hibernated"),t(this,Et).unobserve(),t(this,w).unobserve(),t(this,et).unobserve(),t(this,_).unobserve(),t(this,H).unobserve(),t(this,$).unobserve(),t(this,M).unobserve(),t(this,st).unobserve(),t(this,it).unobserve(),t(this,W).unobserve(),t(this,rt).unobserve(),t(this,wt).unobserve(),t(this,T).unobserve(),t(this,v).unobserve(),t(this,xt).unobserve(),t(this,Lt).unobserve(),t(this,zt).unobserve(),t(this,It).unobserve(),t(this,_t).unobserve(),t(this,A).unobserve(),t(this,kt).unobserve(),t(this,nt).unobserve(),t(this,R).unobserve(),t(this,ht).unobserve(),t(this,F).unobserve(),t(this,At).unobserve(),t(this,ot).unobserve(),t(this,Rt).unobserve(),t(this,lt).unobserve(),t(this,ct).unobserve(),Ot.windowResizer.unsubscribe(t(this,ae)),c(this,o,xe).call(this),t(this,Nt).disconnect()}}a=new WeakMap,Et=new WeakMap,w=new WeakMap,et=new WeakMap,_=new WeakMap,H=new WeakMap,$=new WeakMap,M=new WeakMap,st=new WeakMap,it=new WeakMap,W=new WeakMap,rt=new WeakMap,wt=new WeakMap,T=new WeakMap,v=new WeakMap,xt=new WeakMap,Lt=new WeakMap,zt=new WeakMap,It=new WeakMap,_t=new WeakMap,A=new WeakMap,kt=new WeakMap,nt=new WeakMap,R=new WeakMap,ht=new WeakMap,F=new WeakMap,At=new WeakMap,ot=new WeakMap,Rt=new WeakMap,lt=new WeakMap,ct=new WeakMap,ut=new WeakMap,p=new WeakMap,Ht=new WeakMap,l=new WeakMap,oe=new WeakMap,le=new WeakMap,C=new WeakMap,m=new WeakMap,k=new WeakMap,q=new WeakMap,at=new WeakMap,D=new WeakMap,E=new WeakMap,x=new WeakMap,$t=new WeakMap,N=new WeakMap,U=new WeakMap,G=new WeakMap,Z=new WeakMap,Wt=new WeakMap,dt=new WeakMap,j=new WeakMap,Ft=new WeakMap,B=new WeakMap,P=new WeakMap,Nt=new WeakMap,St=new WeakMap,o=new WeakSet,we=function(){const e=t(this,w).current,i=t(this,et).current?"-reverse":"";t(this,p).style.flexDirection=e==="x"?`row${i}`:`column${i}`,t(this,q).axis=t(this,rt).current?"max":e,t(this,at).dimension=e==="x"?"width":"height",t(this,D).axis=e,e==="x"?this.style.touchAction="pan-y":e==="y"&&(this.style.touchAction="pan-x"),t(this,P)&&t(this,L).call(this)},re=function(){c(this,o,Dt).call(this),t(this,Ht).assignedElements().forEach((e,i)=>{e instanceof HTMLElement&&t(this,l).push(new rs(e,i,this))}),t(this,p).style.transform="",this.style.setProperty("--sections",t(this,l).length.toString()),se.dispatchEvent(this,"scrollSectionsChange",{custom:!0,composed:!0}),t(this,L).call(this),c(this,o,gt).call(this)},Dt=function(){t(this,l).forEach(e=>{e.destroy()}),h(this,l,[]),t(this,x).reset(),t(this,a).reset(),se.dispatchEvent(this,"scrollSectionsChange",{custom:!0,composed:!0})},Ce=function(){t(this,G)||(h(this,G,!0),t(this,a).unsubscribe(t(this,ce)),t(this,a).unlistenAnimationFrame(),clearInterval(t(this,Wt)),clearInterval(t(this,dt)),t(this,j).unlistenAnimationFrame(),t(this,q).disconnect(),t(this,at).disconnect(),t(this,D).disconnect(),t(this,E).disconnect(),t(this,U)||(this.sections.forEach(e=>{e.unsetTransform()}),t(this,L).call(this)))},ve=function(){t(this,G)&&(h(this,G,!1),t(this,a).subscribe(t(this,ce),-1e4),t(this,a).notify(),t(this,q).connect(),t(this,at).connect(),t(this,D).connect(),t(this,A).current&&t(this,E).connect())},xe=function(){t(this,Z)||(h(this,Z,!0),Ot.windowResizer.unsubscribe(t(this,L)),he.elementResizer.unsubscribe(t(this,L)),c(this,o,Ce).call(this),t(this,p).style.transform="",t(this,p).style.height="",t(this,p).style.width="",this.classList.remove("has-overflow","start","end"),t(this,l).length?c(this,o,Dt).call(this):(t(this,x).reset(),t(this,a).reset()),yt.scrollEntries.unregister(this))},Le=function(){t(this,Z)&&(h(this,Z,!1),yt.scrollEntries.register(this),this.tryResplit(),c(this,o,ve).call(this),Ot.windowResizer.subscribe(t(this,L),ye.RESIZE_ORDER.SCROLL),he.elementResizer.subscribe(this,t(this,L)))},L=new WeakMap,ce=new WeakMap,_e=function(e){let i=t(this,x).current;return t(this,v).current?i=Xe.loopNumber(e,t(this,l).length):i=Oe.clamp(e,0,this.limit),i},Ut=new WeakMap,ue=new WeakMap,ze=function(e=1){t(this,nt).current&&(t(this,E).direction=e),t(this,A).current&&t(this,E).pauseAndContinue(t(this,kt).current,this.sectionalCSSProperty.current)},Ie=function(e="current"){if(t(this,v).current&&t(this,l).length){const i=t(this,a)[e]%Math.round(t(this,m)+t(this,C)+t(this,k));return i<0?t(this,m)+i+t(this,C)+t(this,k):i}else return t(this,a)[e]},gt=function(){if(t(this,l).length){const e=t(this,x).current+t(this,ht).current;if(e===0?h(this,B,"start"):e===this.limit?h(this,B,"end"):h(this,B,null),se.dispatchEvent(this,"scrollLine",{detail:{line:t(this,B)}}),t(this,R).current){this.classList.remove("end","start"),t(this,B)&&this.classList.add(t(this,B));const i=t(this,T).current+t(this,F).current;h(this,St,[]),t(this,l).forEach((r,u)=>{r.setCurrentIndex(null),r.setCurrentIndexArc(null),r.setCurrentIndexArcAbs(null),r.setMiddle(!1);const f=e-this.limit-1+t(this,F).current,y=e+i,I=this.sections.length-y;u>=e&&u<y||u<=f?(r.setMark("current"),t(this,St).push(r)):u>=y&&u<y+I/2||u<=f+i?r.setMark("next"):r.setMark("previous")})}}},He=function(){if(t(this,R).current){const e=Math.floor(t(this,St).length/2);t(this,St).sort((i,r)=>i.element.getBoundingClientRect().left-r.element.getBoundingClientRect().left),t(this,St).forEach((i,r)=>{const u=r-e;i.setCurrentIndex(r),i.setCurrentIndexArc(u),i.setCurrentIndexArcAbs(Math.abs(u)),i.setMiddle(r===e)})}},ne=function(e=!1){let i=this.targetScrollValue,r=1/0,u=0;const f=t(this,a).direction;for(let y=0;y<t(this,l).length;y++){const I=t(this,l)[y];let Pe=t(this,Ft)?I.size*f*-1*.4:0,qt=I.position;this.overscroll&&qt===0&&e&&(qt=t(this,N));let me=Math.abs(qt+Pe-i);me<=r&&(r=me,u=y)}return u},ae=new WeakMap;O.isBrowser&&!customElements.get("e-scroll")&&customElements.define("e-scroll",Tt);var de;class ke extends HTMLElement{constructor(){super(...arguments);s(this,de,null)}get scrollElement(){return t(this,de)}connectedCallback(){const e=Ve.findParentElement(this,Tt);e instanceof Tt?h(this,de,e):console.error(this,"e-scroll not found")}}de=new WeakMap;var pt,z,K,J,Gt,Zt,bt,jt,Se,pe;class $e extends ke{constructor(){super();s(this,pt,null);s(this,z,null);s(this,K,!1);s(this,J,0);s(this,Gt,0);s(this,Zt,0);s(this,bt,()=>{h(this,K,this.offsetWidth>this.offsetHeight);const e=t(this,K)?this.offsetWidth:this.offsetHeight;h(this,J,e/((this.scrollElement.scrollSize+this.scrollElement.viewportSize)/e)),h(this,J,Math.max(t(this,J),30)),t(this,K)?(t(this,z).style.width=t(this,J)+"px",t(this,z).style.height="100%"):(t(this,z).style.width="100%",t(this,z).style.height=t(this,J)+"px"),h(this,Gt,e-t(this,J)),this.scrollElement.scrollSize<=0?this.style.display="none":this.style.display="",t(this,jt).call(this)});s(this,jt,()=>{h(this,Zt,this.scrollElement.currentProgress*t(this,Gt)),t(this,K)?t(this,z).style.transform=`translate3d(${t(this,Zt)}px, 0px, 0px)`:t(this,z).style.transform=`translate3d(0px, ${t(this,Zt)}px, 0px)`});s(this,Se,()=>{this.setAttribute("axis",this.scrollElement.axisCSSProperty.current)});s(this,pe,e=>{document.documentElement.classList.add("grabbing"),ss.setupDrag(u=>{const f=t(this,K)?u.x:u.y,y=this.scrollElement.distance/t(this,Gt),I=(f-r)*y;this.scrollElement.setPosition(i+I)},()=>{document.documentElement.classList.remove("grabbing")});const i=this.scrollElement.damped.target,r=t(this,K)?e.x:e.y});if(O.isBrowser){const e=this.attachShadow({mode:"open"});e.adoptedStyleSheets=[Be.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"}})],h(this,pt,document.createElement("slot")),t(this,pt).innerHTML='<div class="default-thumb"></div>',e.appendChild(t(this,pt))}}get thumbElement(){return t(this,z)}connectedCallback(){super.connectedCallback(),this.setAttribute("drag-dead-zone","");const e=t(this,pt).assignedElements()[0]||t(this,pt).firstElementChild;h(this,z,e),t(this,z).addEventListener("pointerdown",t(this,pe)),Ot.windowResizer.subscribe(t(this,bt),ye.RESIZE_ORDER.SCROLL),he.elementResizer.subscribe(this,t(this,bt)),he.elementResizer.subscribe(this.scrollElement,t(this,bt)),this.scrollElement.onScroll(t(this,jt)),this.scrollElement.axisCSSProperty.subscribe(t(this,Se))}disconnectedCallback(){this.removeAttribute("drag-dead-zone"),this.style.display="",t(this,z).removeEventListener("pointerdown",t(this,pe)),Ot.windowResizer.unsubscribe(t(this,bt)),he.elementResizer.unsubscribe(t(this,bt)),this.scrollElement.offScroll(t(this,jt)),this.scrollElement.axisCSSProperty.unsubscribe(t(this,Se))}}pt=new WeakMap,z=new WeakMap,K=new WeakMap,J=new WeakMap,Gt=new WeakMap,Zt=new WeakMap,bt=new WeakMap,jt=new WeakMap,Se=new WeakMap,pe=new WeakMap;O.isBrowser&&!customElements.get("e-scrollbar")&&customElements.define("e-scrollbar",$e);var Kt,Jt,Qt;class We extends ke{constructor(){super();s(this,Kt,new S.CSSProperty(this,"--behaviour","smooth"));s(this,Jt,new S.CSSProperty(this,"--tween-easing",!1));s(this,Qt,new S.CSSProperty(this,"--tween-duration",0));O.isBrowser&&this.addEventListener("click",()=>{const e=t(this,Kt).current,i=t(this,Jt).current,r=t(this,Qt).current;this.handleClick({behaviour:e,tween:i||r?{easing:i,duration:r}:void 0})})}connectedCallback(){super.connectedCallback(),t(this,Kt).observe(),t(this,Jt).observe(),t(this,Qt).observe()}disconnectedCallback(){t(this,Kt).close(),t(this,Jt).close(),t(this,Qt).close()}}Kt=new WeakMap,Jt=new WeakMap,Qt=new WeakMap;var Xt;class Fe extends We{constructor(){super(...arguments);s(this,Xt,new S.CSSProperty(this,"--set",1))}handleClick(e){this.scrollElement.scrollToSection(t(this,Xt).current,e)}connectedCallback(){super.connectedCallback(),t(this,Xt).observe()}disconnectedCallback(){super.disconnectedCallback(),t(this,Xt).close()}}Xt=new WeakMap;O.isBrowser&&!customElements.get("e-scroll-set-button")&&customElements.define("e-scroll-set-button",Fe);var Q,Yt;class Ne extends We{constructor(){super(...arguments);s(this,Q,new S.CSSProperty(this,"--step",1));s(this,Yt,()=>{this.scrollElement.loopCSSProperty.current?this.removeAttribute("disabled"):t(this,Q).current>0&&this.scrollElement.scrollLine==="end"||t(this,Q).current<0&&this.scrollElement.scrollLine==="start"?this.setAttribute("disabled",""):this.removeAttribute("disabled")})}handleClick(e){this.scrollElement.shiftSections(t(this,Q).current,e)}connectedCallback(){super.connectedCallback(),this.scrollElement&&(t(this,Q).subscribe(()=>{t(this,Yt).call(this)}),t(this,Q).observe(),this.scrollElement.addEventListener("scrollLine",t(this,Yt)),t(this,Yt).call(this))}disconnectedCallback(){super.disconnectedCallback(),t(this,Q).close(),this.removeAttribute("disabled")}}Q=new WeakMap,Yt=new WeakMap;O.isBrowser&&!customElements.get("e-scroll-step-button")&&customElements.define("e-scroll-step-button",Ne);var X,ft,te,be,fe,ee;class hs{constructor(n,e,i){s(this,X,null);s(this,ft,null);s(this,te,null);s(this,be,null);s(this,fe,()=>{t(this,ft).scrollToSection(t(this,te),{behaviour:t(this,be)})});s(this,ee,()=>{t(this,X).classList.toggle("current",t(this,ft).counter.current===t(this,te))});O.isBrowser&&(h(this,X,document.createElement("button")),h(this,ft,n),h(this,be,i),h(this,te,e),t(this,X).addEventListener("click",t(this,fe)),t(this,ft).counter.subscribe(t(this,ee)),t(this,ee).call(this))}get element(){return t(this,X)}destroy(){t(this,X).removeEventListener("click",t(this,fe)),t(this,ft).counter.unsubscribe(t(this,ee)),t(this,X).remove()}}X=new WeakMap,ft=new WeakMap,te=new WeakMap,be=new WeakMap,fe=new WeakMap,ee=new WeakMap;var Mt,mt,Y;class Ue extends ke{constructor(){super(...arguments);s(this,Mt,null);s(this,mt,[]);s(this,Y,De.debounce(()=>{t(this,mt).forEach(i=>i.destroy()),h(this,mt,[]);let e=0;this.scrollElement.loopCSSProperty.current?e=this.scrollElement.sections.length:e=this.scrollElement.sections.length-Math.max(this.scrollElement.sectionsInViewCSSProperty.current-1,0);for(let i=0;i<e;i++){const r=new hs(this.scrollElement,i,this.getAttribute("behaviour")||"smooth");t(this,Mt).appendChild(r.element),t(this,mt).push(r)}},0))}connectedCallback(){super.connectedCallback(),this.scrollElement.addEventListener("sectionsChange",t(this,Y)),this.scrollElement.sectionsInViewCSSProperty.subscribe(t(this,Y)),this.scrollElement.loopCSSProperty.subscribe(t(this,Y)),h(this,Mt,document.createElement("div")),this.appendChild(t(this,Mt))}disconnectedCallback(){this.scrollElement.removeEventListener("sectionsChange",t(this,Y)),this.scrollElement.sectionsInViewCSSProperty.unsubscribe(t(this,Y)),this.scrollElement.loopCSSProperty.unsubscribe(t(this,Y)),t(this,mt).forEach(e=>e.destroy()),h(this,mt,[]),t(this,Mt).remove()}}Mt=new WeakMap,mt=new WeakMap,Y=new WeakMap;O.isBrowser&&!customElements.get("e-scroll-bullet-buttons")&&customElements.define("e-scroll-bullet-buttons",Ue);class Ge extends is.ScrollSegmentElement{connectedCallback(){const n=Ve.findParentElement(this,Tt);n instanceof Tt?(this.scrollContainer=n,this.scrollContainer.addEventListener("scrollSectionsChange",this.findAnotherScrollEntries),this.scrollContainer.addEventListener("scrollResize",this.resize),this.resize()):console.error(this,"e-scroll not found")}disconnectedCallback(){super.disconnectedCallback(),this.scrollContainer instanceof Tt&&(this.scrollContainer.removeEventListener("scrollSectionsChange",this.findAnotherScrollEntries),this.scrollContainer.removeEventListener("scrollResize",this.resize))}}O.isBrowser&&!customElements.get("e-scroll-segment")&&customElements.define("e-scroll-segment",Ge);exports.ScrollBulletButtonsElement=Ue;exports.ScrollElement=Tt;exports.ScrollSegmentElement=Ge;exports.ScrollSetButtonElement=Fe;exports.ScrollStepButtonElement=Ne;exports.ScrollbarElement=$e;
|
package/lib/scroll/index.js
CHANGED
|
@@ -266,50 +266,7 @@ class Ot extends HTMLElement {
|
|
|
266
266
|
s(this, qt, null);
|
|
267
267
|
s(this, pt, []);
|
|
268
268
|
s(this, L, () => {
|
|
269
|
-
|
|
270
|
-
return;
|
|
271
|
-
t(this, u).unlistenAnimationFrame();
|
|
272
|
-
const e = this.currentScrollValue / t(this, S) || 0, i = t(this, P).current;
|
|
273
|
-
if (h(this, he, this.vertical ? Ce(this) : Ee(this)), h(this, oe, this.vertical ? Ce(t(this, f)) : Ee(t(this, f))), h(this, y, this.vertical ? this.offsetHeight : this.offsetWidth), this.vertical ? h(this, k, Ve.parse(
|
|
274
|
-
getComputedStyle(t(this, f)).rowGap
|
|
275
|
-
)) : h(this, k, Ve.parse(
|
|
276
|
-
getComputedStyle(t(this, f)).columnGap
|
|
277
|
-
)), t(this, N).current && t(this, l).length) {
|
|
278
|
-
const r = t(this, D).current, a = (t(this, y) - t(this, k) * (r - 1)) / r;
|
|
279
|
-
t(this, l).forEach((m) => {
|
|
280
|
-
m.setSize(a);
|
|
281
|
-
});
|
|
282
|
-
} else
|
|
283
|
-
t(this, l).forEach((r) => {
|
|
284
|
-
r.setSize();
|
|
285
|
-
});
|
|
286
|
-
if (t(this, l).forEach((r) => {
|
|
287
|
-
r.resize();
|
|
288
|
-
}), t(this, W).current) {
|
|
289
|
-
h(this, S, t(this, y) * t(this, W).current);
|
|
290
|
-
const r = t(this, S) + t(this, y);
|
|
291
|
-
this.vertical ? (t(this, f).style.width = r + "px", t(this, f).style.height = "100%") : (t(this, f).style.height = r + "px", t(this, f).style.width = "100%");
|
|
292
|
-
} else
|
|
293
|
-
this.vertical ? (t(this, f).style.width = "100%", t(this, f).style.height = "max-content", h(this, S, t(this, f).offsetHeight - t(this, y))) : (t(this, f).style.width = "max-content", t(this, f).style.height = "100%", h(this, S, t(this, f).offsetWidth - t(this, y)));
|
|
294
|
-
if (!t(this, C).current) {
|
|
295
|
-
const r = getComputedStyle(this), a = this.vertical ? parseFloat(r.paddingBlockStart) + parseFloat(r.paddingBlockEnd) : parseFloat(r.paddingInlineStart) + parseFloat(r.paddingInlineEnd);
|
|
296
|
-
h(this, S, t(this, S) + a), t(this, u).max = t(this, S);
|
|
297
|
-
}
|
|
298
|
-
if (t(this, C).current && t(this, l).length) {
|
|
299
|
-
const r = t(this, l)[t(this, l).length - 1], a = r.position + r.size - t(this, y), m = t(this, S) - a;
|
|
300
|
-
h(this, U, r.position + r.size + m);
|
|
301
|
-
} else
|
|
302
|
-
h(this, U, t(this, S));
|
|
303
|
-
if (t(this, T).current && t(this, l).length) {
|
|
304
|
-
const r = t(this, l)[i];
|
|
305
|
-
t(this, u).set(r.position, {
|
|
306
|
-
equalize: !0
|
|
307
|
-
});
|
|
308
|
-
} else
|
|
309
|
-
t(this, u).set(e * t(this, S), {
|
|
310
|
-
equalize: !0
|
|
311
|
-
});
|
|
312
|
-
h(this, G, (this.vertical ? t(this, f).offsetHeight : t(this, f).offsetWidth) > t(this, y)), this.classList.toggle("has-overflow", t(this, G)), t(this, G) ? t(this, lt).current || c(this, o, ge).call(this) : c(this, o, Se).call(this), ee(this, "scrollResize", { custom: !0 }), t(this, u).notify();
|
|
269
|
+
this.resize();
|
|
313
270
|
});
|
|
314
271
|
s(this, le, () => {
|
|
315
272
|
if (!t(this, G) || t(this, _) || t(this, K))
|
|
@@ -582,6 +539,52 @@ class Ot extends HTMLElement {
|
|
|
582
539
|
shiftPosition(e, i) {
|
|
583
540
|
this.setPosition(t(this, u).target + e, i);
|
|
584
541
|
}
|
|
542
|
+
resize() {
|
|
543
|
+
if (t(this, ct).current)
|
|
544
|
+
return;
|
|
545
|
+
t(this, u).unlistenAnimationFrame();
|
|
546
|
+
const e = this.currentScrollValue / t(this, S) || 0, i = t(this, P).current;
|
|
547
|
+
if (h(this, he, this.vertical ? Ce(this) : Ee(this)), h(this, oe, this.vertical ? Ce(t(this, f)) : Ee(t(this, f))), h(this, y, this.vertical ? this.offsetHeight : this.offsetWidth), this.vertical ? h(this, k, Ve.parse(
|
|
548
|
+
getComputedStyle(t(this, f)).rowGap
|
|
549
|
+
)) : h(this, k, Ve.parse(
|
|
550
|
+
getComputedStyle(t(this, f)).columnGap
|
|
551
|
+
)), t(this, N).current && t(this, l).length) {
|
|
552
|
+
const r = t(this, D).current, a = (t(this, y) - t(this, k) * (r - 1)) / r;
|
|
553
|
+
t(this, l).forEach((m) => {
|
|
554
|
+
m.setSize(a);
|
|
555
|
+
});
|
|
556
|
+
} else
|
|
557
|
+
t(this, l).forEach((r) => {
|
|
558
|
+
r.setSize();
|
|
559
|
+
});
|
|
560
|
+
if (t(this, l).forEach((r) => {
|
|
561
|
+
r.resize();
|
|
562
|
+
}), t(this, W).current) {
|
|
563
|
+
h(this, S, t(this, y) * t(this, W).current);
|
|
564
|
+
const r = t(this, S) + t(this, y);
|
|
565
|
+
this.vertical ? (t(this, f).style.width = r + "px", t(this, f).style.height = "100%") : (t(this, f).style.height = r + "px", t(this, f).style.width = "100%");
|
|
566
|
+
} else
|
|
567
|
+
this.vertical ? (t(this, f).style.width = "100%", t(this, f).style.height = "max-content", h(this, S, t(this, f).offsetHeight - t(this, y))) : (t(this, f).style.width = "max-content", t(this, f).style.height = "100%", h(this, S, t(this, f).offsetWidth - t(this, y)));
|
|
568
|
+
if (!t(this, C).current) {
|
|
569
|
+
const r = getComputedStyle(this), a = this.vertical ? parseFloat(r.paddingBlockStart) + parseFloat(r.paddingBlockEnd) : parseFloat(r.paddingInlineStart) + parseFloat(r.paddingInlineEnd);
|
|
570
|
+
h(this, S, t(this, S) + a), t(this, u).max = t(this, S);
|
|
571
|
+
}
|
|
572
|
+
if (t(this, C).current && t(this, l).length) {
|
|
573
|
+
const r = t(this, l)[t(this, l).length - 1], a = r.position + r.size - t(this, y), m = t(this, S) - a;
|
|
574
|
+
h(this, U, r.position + r.size + m);
|
|
575
|
+
} else
|
|
576
|
+
h(this, U, t(this, S));
|
|
577
|
+
if (t(this, T).current && t(this, l).length) {
|
|
578
|
+
const r = t(this, l)[i];
|
|
579
|
+
t(this, u).set(r.position, {
|
|
580
|
+
equalize: !0
|
|
581
|
+
});
|
|
582
|
+
} else
|
|
583
|
+
t(this, u).set(e * t(this, S), {
|
|
584
|
+
equalize: !0
|
|
585
|
+
});
|
|
586
|
+
h(this, G, (this.vertical ? t(this, f).offsetHeight : t(this, f).offsetWidth) > t(this, y)), this.classList.toggle("has-overflow", t(this, G)), t(this, G) ? t(this, lt).current || c(this, o, ge).call(this) : c(this, o, Se).call(this), ee(this, "scrollResize", { custom: !0 }), t(this, u).notify();
|
|
587
|
+
}
|
|
585
588
|
connectedCallback() {
|
|
586
589
|
vt.register(this), h(this, u, new je(0, {
|
|
587
590
|
damping: 0.01,
|