aptechka 0.32.0 → 0.32.2
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/Animation-B9m8bw96.cjs +1 -0
- package/lib/{Animation-B1AS8IQG.js → Animation-DN95L7Xo.js} +9 -9
- package/lib/{Damped-C3MyWa5_.cjs → Damped-CTsV8tl_.cjs} +1 -1
- package/lib/{Damped-cQCN3d0W.js → Damped-Chu29wn-.js} +1 -1
- package/lib/{Tweened-CynwDTYT.js → Tweened-B_ZFQKGQ.js} +1 -1
- package/lib/{Tweened-ChIsd14E.cjs → Tweened-C0-UzxN-.cjs} +1 -1
- package/lib/animation/index.cjs +1 -1
- package/lib/animation/index.js +3 -3
- package/lib/controls/index.cjs +1 -1
- package/lib/controls/index.js +1 -1
- package/lib/pointer/index.cjs +1 -1
- package/lib/pointer/index.js +1 -1
- package/lib/scroll/vanilla/index.cjs +1 -1
- package/lib/scroll/vanilla/index.js +3 -3
- package/lib/scroll-segment/index.cjs +1 -1
- package/lib/scroll-segment/index.js +1 -1
- package/package.json +1 -1
- package/lib/Animation-CN0h3D4p.cjs +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var C=i=>{throw TypeError(i)};var S=(i,s,t)=>s.has(i)||C("Cannot "+t);var e=(i,s,t)=>(S(i,s,"read from private field"),t?t.call(i):s.get(i)),a=(i,s,t)=>s.has(i)?C("Cannot add the same private member more than once"):s instanceof WeakSet?s.add(i):s.set(i,t),h=(i,s,t,n)=>(S(i,s,"write to private field"),n?n.call(i,t):s.set(i,t),t),M=(i,s,t)=>(S(i,s,"access private method"),t);const I=require("./Store-CDb6RMce.cjs"),z=require("./math-GDWEqu7y.cjs"),m=require("./polyfills-CM4SCDTt.cjs"),P=require("./ticker/vanilla/index.cjs"),N=require("./order/index.cjs");var f,b,A,c,F,r,u,l,g,d,q,y,x;class O extends I.Store{constructor(t,n){super(t||0,n);a(this,q);a(this,f);a(this,b,N.TICK_ORDER.ANIMATION);a(this,A);a(this,c,new I.Store(!1));a(this,F,0);a(this,r,0);a(this,u,-1/0);a(this,l,1/0);a(this,g,0);a(this,d,null);a(this,x,t=>{this.handleAnimationFrame(t)});h(this,r,this.current)}get direction(){return e(this,F)}get target(){return e(this,r)}get min(){return e(this,u)}set min(t){h(this,u,t),this.set(e(this,r),{equalize:!0})}get max(){return e(this,l)}set max(t){h(this,l,t),this.set(e(this,r),{equalize:!0})}get from(){return e(this,g)}get isRunning(){return e(this,c)}get delta(){return Math.abs(e(this,r)-e(this,g))}get deltaProgress(){return this.delta?m.preciseNumber(Math.abs(this.current-e(this,g))/this.delta,6):0}get distance(){return Math.abs(e(this,l)-e(this,u))}get distanceProgress(){return this.distance?m.preciseNumber(Math.abs(this.current-e(this,u))/this.distance,6):0}set(t,n){(e(this,r)!==t||n!=null&&n.restart)&&(h(this,d,t),this.updateOptions(n),h(this,d,null),e(this,r)!==this.current&&this.start())}shift(t,n){this.set(e(this,r)+t,n)}reset(){super.reset(),this.set(this.initial,{equalize:!0})}close(){super.close(),this.reset(),this.unlistenAnimationFrame()}listenAnimationFrame(){e(this,c).current||(e(this,c).current=!0,P.ticker.subscribe(e(this,x),{maxFPS:e(this,f),order:e(this,b),culling:e(this,A)}))}unlistenAnimationFrame(){e(this,c).current&&(e(this,c).current=!1,P.ticker.unsubscribe(e(this,x)))}updateOptions(t){h(this,f,m.nullishCoalescing(t==null?void 0:t.maxFPS,e(this,f))),h(this,b,m.nullishCoalescing(t==null?void 0:t.order,e(this,b))),h(this,A,m.nullishCoalescing(t==null?void 0:t.culling,e(this,A))),h(this,u,m.nullishCoalescing(t==null?void 0:t.min,e(this,u))),h(this,l,m.nullishCoalescing(t==null?void 0:t.max,e(this,l))),M(this,q,y).call(this,typeof e(this,d)=="number"?e(this,d):e(this,r)),t!=null&&t.equalize&&(this.unlistenAnimationFrame(),this.current=e(this,r)),t!=null&&t.restart&&(this.unlistenAnimationFrame(),this.current=this.initial)}start(){this.listenAnimationFrame()}}f=new WeakMap,b=new WeakMap,A=new WeakMap,c=new WeakMap,F=new WeakMap,r=new WeakMap,u=new WeakMap,l=new WeakMap,g=new WeakMap,d=new WeakMap,q=new WeakSet,y=function(t){h(this,F,Math.sign(t-e(this,r))),h(this,r,z.clamp(t,e(this,u),e(this,l))),h(this,g,this.current)},x=new WeakMap;exports.Animation=O;
|
|
@@ -5,19 +5,19 @@ var S = (i, r, t) => r.has(i) || I("Cannot " + t);
|
|
|
5
5
|
var e = (i, r, t) => (S(i, r, "read from private field"), t ? t.call(i) : r.get(i)), a = (i, r, t) => r.has(i) ? I("Cannot add the same private member more than once") : r instanceof WeakSet ? r.add(i) : r.set(i, t), h = (i, r, t, u) => (S(i, r, "write to private field"), u ? u.call(i, t) : r.set(i, t), t), P = (i, r, t) => (S(i, r, "access private method"), t);
|
|
6
6
|
import { S as q } from "./Store-OTdcl6SX.js";
|
|
7
7
|
import { c as y } from "./math-BOBiC4TN.js";
|
|
8
|
-
import { p as z, n as
|
|
8
|
+
import { p as z, n as F } from "./polyfills-X6KXuHg-.js";
|
|
9
9
|
import { ticker as O } from "./ticker/vanilla/index.js";
|
|
10
10
|
import { TICK_ORDER as N } from "./order/index.js";
|
|
11
|
-
var f, d,
|
|
11
|
+
var f, d, A, l, b, s, n, m, c, g, M, R, x;
|
|
12
12
|
class K extends q {
|
|
13
13
|
constructor(t, u) {
|
|
14
14
|
super(t || 0, u);
|
|
15
15
|
a(this, M);
|
|
16
16
|
a(this, f);
|
|
17
17
|
a(this, d, N.ANIMATION);
|
|
18
|
-
a(this,
|
|
18
|
+
a(this, A);
|
|
19
19
|
a(this, l, new q(!1));
|
|
20
|
-
a(this,
|
|
20
|
+
a(this, b, 0);
|
|
21
21
|
a(this, s, 0);
|
|
22
22
|
a(this, n, -1 / 0);
|
|
23
23
|
a(this, m, 1 / 0);
|
|
@@ -29,7 +29,7 @@ class K extends q {
|
|
|
29
29
|
h(this, s, this.current);
|
|
30
30
|
}
|
|
31
31
|
get direction() {
|
|
32
|
-
return e(this,
|
|
32
|
+
return e(this, b);
|
|
33
33
|
}
|
|
34
34
|
get target() {
|
|
35
35
|
return e(this, s);
|
|
@@ -84,21 +84,21 @@ class K extends q {
|
|
|
84
84
|
e(this, l).current || (e(this, l).current = !0, O.subscribe(e(this, x), {
|
|
85
85
|
maxFPS: e(this, f),
|
|
86
86
|
order: e(this, d),
|
|
87
|
-
culling: e(this,
|
|
87
|
+
culling: e(this, A)
|
|
88
88
|
}));
|
|
89
89
|
}
|
|
90
90
|
unlistenAnimationFrame() {
|
|
91
91
|
e(this, l).current && (e(this, l).current = !1, O.unsubscribe(e(this, x)));
|
|
92
92
|
}
|
|
93
93
|
updateOptions(t) {
|
|
94
|
-
h(this, f,
|
|
94
|
+
h(this, f, F(t == null ? void 0 : t.maxFPS, e(this, f))), h(this, d, F(t == null ? void 0 : t.order, e(this, d))), h(this, A, F(t == null ? void 0 : t.culling, e(this, A))), h(this, n, F(t == null ? void 0 : t.min, e(this, n))), h(this, m, F(t == null ? void 0 : t.max, e(this, m))), P(this, M, R).call(this, typeof e(this, g) == "number" ? e(this, g) : e(this, s)), t != null && t.equalize && (this.unlistenAnimationFrame(), this.current = e(this, s)), t != null && t.restart && (this.unlistenAnimationFrame(), this.current = this.initial);
|
|
95
95
|
}
|
|
96
96
|
start() {
|
|
97
97
|
this.listenAnimationFrame();
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
|
-
f = new WeakMap(), d = new WeakMap(),
|
|
101
|
-
h(this,
|
|
100
|
+
f = new WeakMap(), d = new WeakMap(), A = new WeakMap(), l = new WeakMap(), b = new WeakMap(), s = new WeakMap(), n = new WeakMap(), m = new WeakMap(), c = new WeakMap(), g = new WeakMap(), M = new WeakSet(), R = function(t) {
|
|
101
|
+
h(this, b, Math.sign(t - e(this, s))), h(this, s, y(t, e(this, n), e(this, m))), h(this, c, this.current);
|
|
102
102
|
}, x = new WeakMap();
|
|
103
103
|
export {
|
|
104
104
|
K as A
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var b=Object.defineProperty,y=Object.defineProperties;var C=Object.getOwnPropertyDescriptors;var l=Object.getOwnPropertySymbols;var O=Object.prototype.hasOwnProperty,v=Object.prototype.propertyIsEnumerable;var g=t=>{throw TypeError(t)};var d=(t,e,s)=>e in t?b(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s,f=(t,e)=>{for(var s in e||(e={}))O.call(e,s)&&d(t,s,e[s]);if(l)for(var s of l(e))v.call(e,s)&&d(t,s,e[s]);return t},p=(t,e)=>y(t,C(e));var q=(t,e,s)=>e.has(t)||g("Cannot "+s);var a=(t,e,s)=>(q(t,e,"read from private field"),s?s.call(t):e.get(t)),u=(t,e,s)=>e.has(t)?g("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,s),n=(t,e,s,r)=>(q(t,e,"write to private field"),r?r.call(t,s):e.set(t,s),s);const w=require("./math-GDWEqu7y.cjs"),c=require("./polyfills-CM4SCDTt.cjs"),B=require("./Animation-
|
|
1
|
+
"use strict";var b=Object.defineProperty,y=Object.defineProperties;var C=Object.getOwnPropertyDescriptors;var l=Object.getOwnPropertySymbols;var O=Object.prototype.hasOwnProperty,v=Object.prototype.propertyIsEnumerable;var g=t=>{throw TypeError(t)};var d=(t,e,s)=>e in t?b(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s,f=(t,e)=>{for(var s in e||(e={}))O.call(e,s)&&d(t,s,e[s]);if(l)for(var s of l(e))v.call(e,s)&&d(t,s,e[s]);return t},p=(t,e)=>y(t,C(e));var q=(t,e,s)=>e.has(t)||g("Cannot "+s);var a=(t,e,s)=>(q(t,e,"read from private field"),s?s.call(t):e.get(t)),u=(t,e,s)=>e.has(t)?g("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,s),n=(t,e,s,r)=>(q(t,e,"write to private field"),r?r.call(t,s):e.set(t,s),s);const w=require("./math-GDWEqu7y.cjs"),c=require("./polyfills-CM4SCDTt.cjs"),B=require("./Animation-B9m8bw96.cjs");var i,h;class D extends B.Animation{constructor(s,r){super(s,r);u(this,i);u(this,h);this.damping=20,this.stiffness=0,this.mass=0,n(this,i,0),n(this,h,0),this.updateOptions(p(f({},r),{equalize:!0}))}get velocity(){return a(this,i)}get speed(){return a(this,h)}updateOptions(s){this.damping=c.nullishCoalescing(s==null?void 0:s.damping,this.damping),this.mass=c.nullishCoalescing(s==null?void 0:s.mass,this.mass),this.stiffness=c.nullishCoalescing(s==null?void 0:s.stiffness,this.stiffness),super.updateOptions(s)}handleAnimationFrame(s){c.preciseNumber(this.current,6)===c.preciseNumber(this.target,6)&&(this.unlistenAnimationFrame(),this.current=this.target);const r=this.current,A=Math.abs(r-this.target);n(this,h,A/s.timeBetweenFrames);const m=s.timeBetweenFrames/1e3;if(this.mass||this.stiffness){const F=(this.target-this.current)*this.stiffness-a(this,i)*this.damping;n(this,i,a(this,i)+F/this.mass*m),this.current+=a(this,i)*m}else this.current=w.damp(this.current,this.target,this.damping,m)}}i=new WeakMap,h=new WeakMap;exports.Damped=D;
|
|
@@ -17,7 +17,7 @@ var A = (s, e, t) => e.has(s) || g("Cannot " + t);
|
|
|
17
17
|
var a = (s, e, t) => (A(s, e, "read from private field"), t ? t.call(s) : e.get(s)), c = (s, e, t) => e.has(s) ? g("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(s) : e.set(s, t), m = (s, e, t, r) => (A(s, e, "write to private field"), r ? r.call(s, t) : e.set(s, t), t);
|
|
18
18
|
import { d as D } from "./math-BOBiC4TN.js";
|
|
19
19
|
import { n as u, p as F } from "./polyfills-X6KXuHg-.js";
|
|
20
|
-
import { A as q } from "./Animation-
|
|
20
|
+
import { A as q } from "./Animation-DN95L7Xo.js";
|
|
21
21
|
var i, h;
|
|
22
22
|
class j extends q {
|
|
23
23
|
constructor(t, r) {
|
|
@@ -18,7 +18,7 @@ var n = (a, i, e) => (A(a, i, "read from private field"), e ? e.call(a) : i.get(
|
|
|
18
18
|
import { l as h, e as S } from "./easings-BEmRlrDd.js";
|
|
19
19
|
import { c as T } from "./math-BOBiC4TN.js";
|
|
20
20
|
import { n as q, p as w } from "./polyfills-X6KXuHg-.js";
|
|
21
|
-
import { A as z } from "./Animation-
|
|
21
|
+
import { A as z } from "./Animation-DN95L7Xo.js";
|
|
22
22
|
var s, r;
|
|
23
23
|
class v extends z {
|
|
24
24
|
constructor(e, t) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var y=Object.defineProperty,O=Object.defineProperties;var b=Object.getOwnPropertyDescriptors;var h=Object.getOwnPropertySymbols;var w=Object.prototype.hasOwnProperty,S=Object.prototype.propertyIsEnumerable;var d=i=>{throw TypeError(i)};var m=(i,t,e)=>t in i?y(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e,g=(i,t)=>{for(var e in t||(t={}))w.call(t,e)&&m(i,e,t[e]);if(h)for(var e of h(t))S.call(t,e)&&m(i,e,t[e]);return i},f=(i,t)=>O(i,b(t));var A=(i,t,e)=>t.has(i)||d("Cannot "+e);var s=(i,t,e)=>(A(i,t,"read from private field"),e?e.call(i):t.get(i)),c=(i,t,e)=>t.has(i)?d("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(i):t.set(i,e),l=(i,t,e,a)=>(A(i,t,"write to private field"),a?a.call(i,e):t.set(i,e),e);const u=require("./easings-GegIwET5.cjs"),T=require("./math-GDWEqu7y.cjs"),q=require("./polyfills-CM4SCDTt.cjs"),x=require("./Animation-
|
|
1
|
+
"use strict";var y=Object.defineProperty,O=Object.defineProperties;var b=Object.getOwnPropertyDescriptors;var h=Object.getOwnPropertySymbols;var w=Object.prototype.hasOwnProperty,S=Object.prototype.propertyIsEnumerable;var d=i=>{throw TypeError(i)};var m=(i,t,e)=>t in i?y(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e,g=(i,t)=>{for(var e in t||(t={}))w.call(t,e)&&m(i,e,t[e]);if(h)for(var e of h(t))S.call(t,e)&&m(i,e,t[e]);return i},f=(i,t)=>O(i,b(t));var A=(i,t,e)=>t.has(i)||d("Cannot "+e);var s=(i,t,e)=>(A(i,t,"read from private field"),e?e.call(i):t.get(i)),c=(i,t,e)=>t.has(i)?d("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(i):t.set(i,e),l=(i,t,e,a)=>(A(i,t,"write to private field"),a?a.call(i,e):t.set(i,e),e);const u=require("./easings-GegIwET5.cjs"),T=require("./math-GDWEqu7y.cjs"),q=require("./polyfills-CM4SCDTt.cjs"),x=require("./Animation-B9m8bw96.cjs");var r,n;class z extends x.Animation{constructor(e,a){super(e||0,a);c(this,r,u.linear);c(this,n,1e3);this.updateOptions(f(g({},a),{equalize:!0}))}updateOptions(e){super.updateOptions(e),l(this,r,typeof(e==null?void 0:e.easing)=="function"?e.easing:typeof(e==null?void 0:e.easing)=="string"&&u.easings[e.easing]||u.linear),l(this,n,q.nullishCoalescing(e==null?void 0:e.duration,s(this,n)))}handleAnimationFrame(e){const a=e.timeElapsedSinceSubscription/1e3/(s(this,n)/1e3)||0,F=s(this,r).call(this,T.clamp(a,0,1));this.current=q.preciseNumber(this.from+(this.target-this.from)*F,6),a>1&&this.unlistenAnimationFrame()}start(){this.unlistenAnimationFrame(),this.listenAnimationFrame()}}r=new WeakMap,n=new WeakMap;exports.Tweened=z;
|
package/lib/animation/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../Animation-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../Animation-B9m8bw96.cjs"),n=require("../Damped-CTsV8tl_.cjs"),i=require("../Tweened-C0-UzxN-.cjs");exports.Animation=e.Animation;exports.Damped=n.Damped;exports.Tweened=i.Tweened;
|
package/lib/animation/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { A as r } from "../Animation-
|
|
2
|
-
import { D as m } from "../Damped-
|
|
3
|
-
import { T as t } from "../Tweened-
|
|
1
|
+
import { A as r } from "../Animation-DN95L7Xo.js";
|
|
2
|
+
import { D as m } from "../Damped-Chu29wn-.js";
|
|
3
|
+
import { T as t } from "../Tweened-B_ZFQKGQ.js";
|
|
4
4
|
export {
|
|
5
5
|
r as Animation,
|
|
6
6
|
m as Damped,
|
package/lib/controls/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var V=h=>{throw TypeError(h)};var F=(h,n,e)=>n.has(h)||V("Cannot "+e);var t=(h,n,e)=>(F(h,n,"read from private field"),e?e.call(h):n.get(h)),s=(h,n,e)=>n.has(h)?V("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(h):n.set(h,e),i=(h,n,e,r)=>(F(h,n,"write to private field"),r?r.call(h,e):n.set(h,e),e),k=(h,n,e)=>(F(h,n,"access private method"),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const G=require("../notifier/index.cjs"),m=require("../browser-CpzFX2xg.cjs"),Q=require("../dom-JBOkFLTh.cjs"),q=require("../ticker/vanilla/index.cjs");require("../Store-CDb6RMce.cjs");const J=require("../easings-GegIwET5.cjs"),Z=require("../Tweened-
|
|
1
|
+
"use strict";var V=h=>{throw TypeError(h)};var F=(h,n,e)=>n.has(h)||V("Cannot "+e);var t=(h,n,e)=>(F(h,n,"read from private field"),e?e.call(h):n.get(h)),s=(h,n,e)=>n.has(h)?V("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(h):n.set(h,e),i=(h,n,e,r)=>(F(h,n,"write to private field"),r?r.call(h,e):n.set(h,e),e),k=(h,n,e)=>(F(h,n,"access private method"),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const G=require("../notifier/index.cjs"),m=require("../browser-CpzFX2xg.cjs"),Q=require("../dom-JBOkFLTh.cjs"),q=require("../ticker/vanilla/index.cjs");require("../Store-CDb6RMce.cjs");const J=require("../easings-GegIwET5.cjs"),Z=require("../Tweened-C0-UzxN-.cjs"),_=require("../gestures-DHLrn6Q8.cjs"),$=require("../polyfills-CM4SCDTt.cjs"),p=require("../order/index.cjs");var N;class Y{constructor(){s(this,N,new G.Notifier)}get changeEvent(){return t(this,N)}}N=new WeakMap;var b,c,u,H;class ee extends Y{constructor(e){super();s(this,b,null);s(this,c,null);s(this,u,"offsetHeight");s(this,H,e=>{const r=e.shiftKey?-1:1;let a;e.code==="Space"?a=r*t(this,c)[t(this,u)]*.4:e.code==="ArrowLeft"?a=-1*t(this,c)[t(this,u)]*.2:e.code==="ArrowRight"?a=1*t(this,c)[t(this,u)]*.2:e.code==="ArrowUp"?a=-1*t(this,c)[t(this,u)]*.2:e.code==="ArrowDown"?a=1*t(this,c)[t(this,u)]*.2:e.code==="PageUp"?a=-1*t(this,c)[t(this,u)]:e.code==="PageDown"?a=1*t(this,c)[t(this,u)]:e.code==="Home"?a=0:e.code==="End"&&(a=t(this,u)==="offsetWidth"?t(this,c).scrollWidth:t(this,c).scrollHeight),a&&(e.stopPropagation(),this.changeEvent.notify("keyboard",a))});m.isBrowser&&(i(this,b,e!=null&&e.element&&Q.getElement(e.element)||window),i(this,c,t(this,b)instanceof HTMLElement?t(this,b):document.documentElement),this.dimension=e==null?void 0:e.dimension)}set dimension(e){i(this,u,e==="width"?"offsetWidth":"offsetHeight")}connect(){m.isBrowser&&t(this,b).addEventListener("keydown",t(this,H))}disconnect(){m.isBrowser&&t(this,b).removeEventListener("keydown",t(this,H))}}b=new WeakMap,c=new WeakMap,u=new WeakMap,H=new WeakMap;var g,x,P,z,d,T,f,w,K,U,C,W,B;class te extends Y{constructor(e){super();s(this,w);s(this,g);s(this,x);s(this,P);s(this,z);s(this,d);s(this,T);s(this,f);s(this,C);s(this,W);s(this,B);this.direction=1,i(this,d,new Z.Tweened(0,{easing:J.easeInQuad})),i(this,f,!1),i(this,C,r=>{t(this,d).current!==1&&this.changeEvent.notify("autoplay",r.timeBetweenFrames*t(this,g)*this.direction*(1-t(this,d).current))}),i(this,W,()=>{t(this,d).current!==1&&this.changeEvent.notify("autoplay",Math.sign(t(this,g))*this.direction*(1-t(this,d).current))}),i(this,B,()=>{t(this,x)&&(document.hidden?t(this,d).set(1,{equalize:!0}):t(this,d).set(0,{equalize:!0}))}),i(this,g,(e==null?void 0:e.speed)||1),i(this,x,(e==null?void 0:e.interval)||!1),i(this,P,e)}set interval(e){i(this,x,e),t(this,f)&&k(this,w,K).call(this)}set speed(e){i(this,g,e),t(this,f)&&k(this,w,K).call(this)}connect(){t(this,f)||(i(this,f,!0),k(this,w,K).call(this))}disconnect(){t(this,f)&&(i(this,f,!1),k(this,w,U).call(this))}pauseAndContinue(e,r){t(this,f)&&e&&(clearTimeout(t(this,T)),t(this,d).set(1,{duration:Math.min(e,1e3),equalize:r}),i(this,T,setTimeout(()=>{t(this,d).set(0,{duration:Math.min(e,5e3),equalize:r})},e)))}}g=new WeakMap,x=new WeakMap,P=new WeakMap,z=new WeakMap,d=new WeakMap,T=new WeakMap,f=new WeakMap,w=new WeakSet,K=function(){k(this,w,U).call(this),t(this,x)?i(this,z,setInterval(t(this,W),Math.abs(t(this,g)))):q.ticker.subscribe(t(this,C),t(this,P)),document.addEventListener("visibilitychange",t(this,B))},U=function(){clearInterval(t(this,z)),q.ticker.unsubscribe(t(this,C)),clearTimeout(t(this,T)),t(this,d).close(),document.removeEventListener("visibilitychange",t(this,B))},C=new WeakMap,W=new WeakMap,B=new WeakMap;var A,v,D,X;class ie extends Y{constructor(e){super();s(this,A,null);s(this,v);s(this,D);s(this,X,e=>{let r=0;if(!(this.axis==="x"&&Math.abs(e.deltaY)>Math.abs(e.deltaX)*.5||this.axis==="y"&&Math.abs(e.deltaX)>Math.abs(e.deltaY)*.5))if(e.preventDefault(),r=(this.axis==="max"?Math.abs(e.deltaX)>Math.abs(e.deltaY)?e.deltaX:e.deltaY:this.axis==="x"?e.deltaX:e.deltaY)*this.speed,e.stopPropagation(),this.debounce){const a=Date.now();if(a-t(this,D)>40&&(r=100*Math.sign(r)),i(this,D,a),Math.abs(r)<100||t(this,v))return;this.changeEvent.notify("wheel",r),i(this,v,setTimeout(()=>{i(this,v,void 0)},80))}else this.changeEvent.notify("wheel",r)});this.axis=(e==null?void 0:e.axis)||"y",this.speed=(e==null?void 0:e.speed)||1,this.debounce=(e==null?void 0:e.debounce)||!1,i(this,D,Date.now()),m.isBrowser&&i(this,A,e!=null&&e.element&&Q.getElement(e.element)||window)}connect(){m.isBrowser&&t(this,A).addEventListener("wheel",t(this,X),{passive:!1})}disconnect(){m.isBrowser&&(t(this,A).removeEventListener("wheel",t(this,X)),clearTimeout(t(this,v)))}}A=new WeakMap,v=new WeakMap,D=new WeakMap,X=new WeakMap;var M,o,l,I,y;const E=class E extends Y{constructor(e){super();s(this,o);s(this,l);s(this,I);s(this,y);this.inertion=1,i(this,o,null),i(this,l,0),i(this,I,r=>{if(r.composedPath().find(L=>L instanceof HTMLElement&&L.hasAttribute("drag-dead-zone")))return;this.swipe||q.ticker.unsubscribe(t(this,y));let a=r,O=!1;i(this,l,0),document.documentElement.classList.add("grabbing"),_.setupDrag(L=>{if(t(E,M)&&t(E,M)!==t(this,o))return;const R=a.x-L.x,S=a.y-L.y;this.axis==="x"?i(this,l,R):i(this,l,S),a=L,O=this.axis==="x"&&Math.abs(R)>Math.abs(S)||this.axis==="y"&&Math.abs(S)>Math.abs(R),O&&(i(E,M,t(this,o)),this.changeEvent.notify("drag",t(this,l)))},()=>{i(E,M,null),O&&(!this.swipe&&this.inertion?(i(this,l,t(this,l)*this.inertion),q.ticker.subscribe(t(this,y),{order:p.TICK_ORDER.CONTROLS-1})):this.swipe&&this.changeEvent.notify("drag-end",t(this,l))),document.documentElement.classList.remove("grabbing")})}),i(this,y,()=>{Math.floor(Math.abs(t(this,l)))||q.ticker.unsubscribe(t(this,y)),i(this,l,t(this,l)*.95),i(this,l,$.preciseNumber(t(this,l),3)),this.changeEvent.notify("drag",t(this,l))}),this.axis=(e==null?void 0:e.axis)||"y",this.swipe=(e==null?void 0:e.swipe)||!1,m.isBrowser&&i(this,o,e!=null&&e.element&&Q.getElement(e.element)||document.documentElement)}connect(){m.isBrowser&&t(this,o).addEventListener("pointerdown",t(this,I))}disconnect(){m.isBrowser&&(t(this,o).removeEventListener("pointerdown",t(this,I)),q.ticker.unsubscribe(t(this,y)))}};M=new WeakMap,o=new WeakMap,l=new WeakMap,I=new WeakMap,y=new WeakMap,s(E,M,null);let j=E;exports.AutoplayControls=te;exports.Controls=Y;exports.DragControls=j;exports.KeyboardControls=ee;exports.WheelControls=ie;
|
package/lib/controls/index.js
CHANGED
|
@@ -9,7 +9,7 @@ import { g as Q } from "../dom-0S_WDL4g.js";
|
|
|
9
9
|
import { ticker as k } from "../ticker/vanilla/index.js";
|
|
10
10
|
import "../Store-OTdcl6SX.js";
|
|
11
11
|
import { a as J } from "../easings-BEmRlrDd.js";
|
|
12
|
-
import { T as Z } from "../Tweened-
|
|
12
|
+
import { T as Z } from "../Tweened-B_ZFQKGQ.js";
|
|
13
13
|
import { s as $ } from "../gestures-D2Fdra_G.js";
|
|
14
14
|
import { p } from "../polyfills-X6KXuHg-.js";
|
|
15
15
|
import { TICK_ORDER as _ } from "../order/index.js";
|
package/lib/pointer/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var A=Object.defineProperty;var _=Object.getOwnPropertySymbols;var F=Object.prototype.hasOwnProperty,G=Object.prototype.propertyIsEnumerable;var M=i=>{throw TypeError(i)};var D=(i,s,t)=>s in i?A(i,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[s]=t,T=(i,s)=>{for(var t in s||(s={}))F.call(s,t)&&D(i,t,s[t]);if(_)for(var t of _(s))G.call(s,t)&&D(i,t,s[t]);return i};var k=(i,s,t)=>s.has(i)||M("Cannot "+t);var e=(i,s,t)=>(k(i,s,"read from private field"),t?t.call(i):s.get(i)),n=(i,s,t)=>s.has(i)?M("Cannot add the same private member more than once"):s instanceof WeakSet?s.add(i):s.set(i,t),c=(i,s,t,a)=>(k(i,s,"write to private field"),a?a.call(i,t):s.set(i,t),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../Store-CDb6RMce.cjs");const q=require("../coordinates-D8Np3cPD.cjs"),I=require("../dom-JBOkFLTh.cjs"),H=require("../math-GDWEqu7y.cjs");require("../ticker/vanilla/index.cjs");const R=require("../Damped-
|
|
1
|
+
"use strict";var A=Object.defineProperty;var _=Object.getOwnPropertySymbols;var F=Object.prototype.hasOwnProperty,G=Object.prototype.propertyIsEnumerable;var M=i=>{throw TypeError(i)};var D=(i,s,t)=>s in i?A(i,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[s]=t,T=(i,s)=>{for(var t in s||(s={}))F.call(s,t)&&D(i,t,s[t]);if(_)for(var t of _(s))G.call(s,t)&&D(i,t,s[t]);return i};var k=(i,s,t)=>s.has(i)||M("Cannot "+t);var e=(i,s,t)=>(k(i,s,"read from private field"),t?t.call(i):s.get(i)),n=(i,s,t)=>s.has(i)?M("Cannot add the same private member more than once"):s instanceof WeakSet?s.add(i):s.set(i,t),c=(i,s,t,a)=>(k(i,s,"write to private field"),a?a.call(i,t):s.set(i,t),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../Store-CDb6RMce.cjs");const q=require("../coordinates-D8Np3cPD.cjs"),I=require("../dom-JBOkFLTh.cjs"),H=require("../math-GDWEqu7y.cjs");require("../ticker/vanilla/index.cjs");const R=require("../Damped-CTsV8tl_.cjs"),j=require("../element-resizer/vanilla/index.cjs"),B=require("../window-resizer/vanilla/index.cjs"),P=require("../css-property/index.cjs");var o,l,m,d,y,u,b,v,f,w,C,p;class O{constructor(s){n(this,o);n(this,l);n(this,m);n(this,d);n(this,y);n(this,u);n(this,b,0);n(this,v,0);n(this,f,s=>{e(this,d).set(1)});n(this,w,s=>{e(this,d).set(0)});n(this,C,s=>{const t=q.getPointerPosition(s,e(this,o).getBoundingClientRect()),a={width:e(this,b),height:e(this,v)},h={x:t.x,y:t.y};if(e(this,y)){const z=q.screenToCartesian(h,a);h.x=z.x,h.y=z.y}if(e(this,u)){const z=q.normalize(h,a);h.x=H.clamp(z.x*2,-1,1),h.y=H.clamp(z.y*2,-1,1)}e(this,l).set(h.x),e(this,m).set(h.y)});n(this,p,()=>{c(this,b,this.element.clientWidth),c(this,v,this.element.clientHeight);let s=0,t=0,a=0,h=0;e(this,y)?e(this,u)?(s=-1,t=1,a=-1,h=1):(s=e(this,b)/2*-1,t=e(this,b)/2*1,a=e(this,v)/2*-1,h=e(this,v)/2*1):e(this,u)?(s=0,t=1,a=0,h=1):(s=0,t=e(this,b),a=0,h=e(this,v)),e(this,l).min=s,e(this,l).max=t,e(this,m).min=a,e(this,m).max=h});c(this,o,I.getElement(s.element)),c(this,l,new R.Damped(0,s.damped)),c(this,m,new R.Damped(0,s.damped)),c(this,d,new R.Damped(0,T({min:0,max:1},s.damped))),c(this,y,s.cartesian||!1),c(this,u,s.normalize||!1)}get element(){return e(this,o)}get x(){return e(this,l)}get y(){return e(this,m)}get z(){return e(this,d)}get cartesian(){return e(this,y)}set cartesian(s){c(this,y,s),e(this,p).call(this)}get normalize(){return e(this,u)}set normalize(s){c(this,u,s),e(this,p).call(this)}connect(){e(this,o).addEventListener("pointerenter",e(this,f)),e(this,o).addEventListener("pointerleave",e(this,w)),e(this,o).addEventListener("pointermove",e(this,C)),j.elementResizer.subscribe(e(this,o),e(this,p)),B.windowResizer.subscribe(e(this,p))}disconnect(){e(this,o).removeEventListener("pointerenter",e(this,f)),e(this,o).removeEventListener("pointerleave",e(this,w)),e(this,o).removeEventListener("pointermove",e(this,C)),j.elementResizer.unsubscribe(e(this,p)),B.windowResizer.unsubscribe(e(this,p)),e(this,l).reset(),e(this,m).reset(),e(this,d).reset()}}o=new WeakMap,l=new WeakMap,m=new WeakMap,d=new WeakMap,y=new WeakMap,u=new WeakMap,b=new WeakMap,v=new WeakMap,f=new WeakMap,w=new WeakMap,C=new WeakMap,p=new WeakMap;var r,x,g,S,E,L;class W extends HTMLElement{constructor(){super();n(this,r);n(this,x,new P.CSSProperty(this,"--damping",20));n(this,g,new P.CSSProperty(this,"--mass",0));n(this,S,new P.CSSProperty(this,"--stiffness",0));n(this,E,new P.CSSProperty(this,"--cartesian",!1));n(this,L,new P.CSSProperty(this,"--normalize",!1));c(this,r,new O({element:this})),e(this,x).subscribe(t=>{e(this,r).x.damping=t.current,e(this,r).y.damping=t.current,e(this,r).z.damping=t.current}),e(this,E).subscribe(t=>{e(this,r).cartesian=t.current}),e(this,L).subscribe(t=>{e(this,r).normalize=t.current}),e(this,g).subscribe(t=>{e(this,r).x.mass=t.current,e(this,r).y.mass=t.current,e(this,r).z.mass=t.current}),e(this,S).subscribe(t=>{e(this,r).x.stiffness=t.current,e(this,r).y.stiffness=t.current,e(this,r).z.stiffness=t.current}),e(this,r).x.subscribe(t=>{this.style.setProperty("--x",t.current.toString())}),e(this,r).y.subscribe(t=>{this.style.setProperty("--y",t.current.toString())}),e(this,r).z.subscribe(t=>{this.style.setProperty("--z",t.current.toString())})}get pointer(){return e(this,r)}connectedCallback(){e(this,r).connect(),e(this,x).observe(),e(this,g).observe(),e(this,S).observe()}disconnectedCallback(){e(this,r).disconnect(),e(this,x).unobserve(),e(this,g).unobserve(),e(this,S).unobserve(),this.style.removeProperty("--x"),this.style.removeProperty("--y"),this.style.removeProperty("--z")}}r=new WeakMap,x=new WeakMap,g=new WeakMap,S=new WeakMap,E=new WeakMap,L=new WeakMap;customElements.get("e-pointer")||customElements.define("e-pointer",W);exports.Pointer=O;exports.PointerElement=W;
|
package/lib/pointer/index.js
CHANGED
|
@@ -19,7 +19,7 @@ import { g as G, s as I, n as J } from "../coordinates-CgdGoSYs.js";
|
|
|
19
19
|
import { g as K } from "../dom-0S_WDL4g.js";
|
|
20
20
|
import { c as B } from "../math-BOBiC4TN.js";
|
|
21
21
|
import "../ticker/vanilla/index.js";
|
|
22
|
-
import { D as R } from "../Damped-
|
|
22
|
+
import { D as R } from "../Damped-Chu29wn-.js";
|
|
23
23
|
import { elementResizer as W } from "../element-resizer/vanilla/index.js";
|
|
24
24
|
import { windowResizer as j } from "../window-resizer/vanilla/index.js";
|
|
25
25
|
import { CSSProperty as P } from "../css-property/index.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var we=Object.defineProperty;var le=Object.getOwnPropertySymbols;var xe=Object.prototype.hasOwnProperty,ze=Object.prototype.propertyIsEnumerable;var ue=u=>{throw TypeError(u)};var ce=(u,r,e)=>r in u?we(u,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):u[r]=e,ae=(u,r)=>{for(var e in r||(r={}))xe.call(r,e)&&ce(u,e,r[e]);if(le)for(var e of le(r))ze.call(r,e)&&ce(u,e,r[e]);return u};var Yt=(u,r,e)=>r.has(u)||ue("Cannot "+e);var t=(u,r,e)=>(Yt(u,r,"read from private field"),e?e.call(u):r.get(u)),s=(u,r,e)=>r.has(u)?ue("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(u):r.set(u,e),h=(u,r,e,i)=>(Yt(u,r,"write to private field"),i?i.call(u,e):r.set(u,e),e),d=(u,r,e)=>(Yt(u,r,"access private method"),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Le=require("../../Store-CDb6RMce.cjs"),Xt=require("../../browser-CpzFX2xg.cjs"),ke=require("../../easings-GegIwET5.cjs"),te=require("../../events-KVanG9sR.cjs"),Se=require("../../jss-GJLvaNfT.cjs"),Et=require("../../layout-8ryRAMGJ.cjs"),pe=require("../../math-GDWEqu7y.cjs");require("../../ticker/vanilla/index.cjs");const ee=require("../../order/index.cjs"),Ie=require("../../Damped-C3MyWa5_.cjs"),qe=require("../../Tweened-ChIsd14E.cjs"),Gt=require("../../controls/index.cjs"),Jt=require("../../window-resizer/vanilla/index.cjs"),lt=require("../../scroll-entries/index.cjs"),de=require("../../css-unit-parser/index.cjs"),p=require("../../css-property/index.cjs"),De=require("../../device/index.cjs"),Qt=require("../../element-resizer/vanilla/index.cjs"),Te=require("../../gestures-DHLrn6Q8.cjs"),fe=require("../../dom-JBOkFLTh.cjs"),Ae=require("../../function-MthRj-GJ.cjs"),Re=require("../../scroll-segment/index.cjs");var f,Vt,y,ct,R,N;class Me{constructor(r,e,i){s(this,f);s(this,Vt);s(this,y);s(this,ct,0);s(this,R,0);s(this,N,null);h(this,f,r),h(this,Vt,e),h(this,y,i),lt.scrollEntries.register(t(this,f))}get index(){return t(this,Vt)}get size(){return t(this,ct)}get position(){return t(this,R)}destroy(){lt.scrollEntries.unregister(t(this,f)),this.unsetTransform()}unsetTransform(){t(this,f).style.transform="",this.mark(null)}setSize(r){r?(t(this,f).style.setProperty("--size",r+"px"),t(this,y).axisCSSProperty.current==="x"?(t(this,f).style.width=r+"px",t(this,f).style.height=""):(t(this,f).style.height=r+"px",t(this,f).style.width="")):(t(this,f).style.width="",t(this,f).style.height="",t(this,f).style.removeProperty("--size"))}resize(){h(this,ct,t(this,y).vertical?t(this,f).offsetHeight:t(this,f).offsetWidth),h(this,R,t(this,y).vertical?Et.getCumulativeOffsetTop(t(this,f)):Et.getCumulativeOffsetLeft(t(this,f))),h(this,R,t(this,R)-t(this,y).contentPosition)}transform(){let r=0;const e=t(this,y).viewportSize*t(this,y).sectionDistanceScaleCSSProperty.current;t(this,y).loopCSSProperty.current&&t(this,y).overscroll&&t(this,R)+t(this,ct)<t(this,y).currentScrollValue&&(r=t(this,y).distance*-1-t(this,y).gap),lt.scrollEntries.update(t(this,f),t(this,y).axisCSSProperty.current,r);const i=t(this,y).currentScrollValue+r,n=t(this,R)-t(this,y).viewportSize-e,c=t(this,R)+t(this,ct)+e,m=pe.clamp(i,n,c);t(this,y).vertical?t(this,f).style.transform=`translate3d(0px, ${m*-1}px, 0px)`:t(this,f).style.transform=`translate3d(${m*-1}px, 0px, 0px)`}mark(r){t(this,N)!==r&&(t(this,N)&&t(this,f).classList.remove(t(this,N)),r&&t(this,f).classList.add(r),h(this,N,r),te.dispatchEvent(t(this,f),"scrollSectionMarkChange",{composed:!0,detail:{mark:t(this,N)},custom:!0}))}}f=new WeakMap,Vt=new WeakMap,y=new WeakMap,ct=new WeakMap,R=new WeakMap,N=new WeakMap;const Oe=Se.createStylesheet({":host":{position:"relative",width:"100%",height:"100%",display:"block",outline:"none"},':host([hibernated="true"])':{display:"contents"},".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="true"]) .content':{display:"contents"},"::slotted(*)":{flexShrink:"0"}});var a,ut,x,M,O,V,I,j,G,B,K,at,q,C,dt,St,pt,ft,wt,k,mt,Z,D,J,_,Q,gt,bt,X,Y,S,xt,l,Bt,_t,v,b,z,T,tt,A,P,g,zt,et,H,st,yt,Lt,it,F,o,Ot,Pt,Kt,Zt,se,ie,L,kt,me,It,Ht,re,ne,ot,he;class Mt extends HTMLElement{constructor(){super();s(this,o);s(this,a,null);s(this,ut,new p.CSSProperty(this,"--controls",!0));s(this,x,new p.CSSProperty(this,"--axis","y"));s(this,M,new p.CSSProperty(this,"--direction",0));s(this,O,new p.CSSProperty(this,"--pages",0,{validate:e=>Math.max(0,e-1)}));s(this,V,new p.CSSProperty(this,"--split",!1));s(this,I,new p.CSSProperty(this,"--sectional",!1));s(this,j,new p.CSSProperty(this,"--easing",!1));s(this,G,new p.CSSProperty(this,"--duration",!1));s(this,B,new p.CSSProperty(this,"--auto-size",!1));s(this,K,new p.CSSProperty(this,"--wheel-max-delta",!1));s(this,at,new p.CSSProperty(this,"--drag-inertion",1));s(this,q,new p.CSSProperty(this,"--sections-in-view",1));s(this,C,new p.CSSProperty(this,"--loop",!1));s(this,dt,new p.CSSProperty(this,"--damping",20));s(this,St,new p.CSSProperty(this,"--mass",0));s(this,pt,new p.CSSProperty(this,"--stiffness",0));s(this,ft,new p.CSSProperty(this,"--mouse-drag",!1));s(this,wt,new p.CSSProperty(this,"--section-distance-scale",.5));s(this,k,new p.CSSProperty(this,"--autoplay",0));s(this,mt,new p.CSSProperty(this,"--autoplay-pause-duration",0));s(this,Z,new p.CSSProperty(this,"--autoplay-user-direction",!1));s(this,D,new p.CSSProperty(this,"--classes",!1));s(this,J,new p.CSSProperty(this,"--current-index-start-offset",0));s(this,_,new p.CSSProperty(this,"--current-index-end-offset",0));s(this,Q,new p.CSSProperty(this,"--focus-delay",0));s(this,gt,new p.CSSProperty(this,"--focus-duration",3e3));s(this,bt,new p.CSSProperty(this,"--disabled",!1));s(this,X,new p.CSSProperty(this,"--hibernated",!1));s(this,Y,null);s(this,S,null);s(this,xt,null);s(this,l,[]);s(this,Bt,0);s(this,_t,0);s(this,v,0);s(this,b,0);s(this,z,0);s(this,T,null);s(this,tt,null);s(this,A,null);s(this,P,null);s(this,g,new Le.Store(0));s(this,zt,0);s(this,et,0);s(this,H,!1);s(this,st,!0);s(this,yt,!0);s(this,Lt);s(this,it);s(this,F,new qe.Tweened);s(this,L,()=>{t(this,a).unlistenAnimationFrame();const e=this.currentScrollValue/t(this,b)||0,i=t(this,g).current;if(h(this,Bt,this.vertical?Et.getCumulativeOffsetTop(this):Et.getCumulativeOffsetLeft(this)),h(this,_t,this.vertical?Et.getCumulativeOffsetTop(t(this,S)):Et.getCumulativeOffsetLeft(t(this,S))),h(this,v,this.vertical?this.offsetHeight:this.offsetWidth),this.vertical?h(this,z,de.cssUnitParser.parse(getComputedStyle(t(this,S)).rowGap)):h(this,z,de.cssUnitParser.parse(getComputedStyle(t(this,S)).columnGap)),t(this,B).current&&t(this,l).length){const n=t(this,q).current,c=(t(this,v)-t(this,z)*(n-1))/n;t(this,l).forEach(m=>{m.setSize(c)})}else t(this,l).forEach(n=>{n.setSize()});if(t(this,l).forEach(n=>{n.resize()}),t(this,O).current){h(this,b,t(this,v)*t(this,O).current);const n=t(this,b)+t(this,v);this.vertical?(t(this,S).style.width=n+"px",t(this,S).style.height="100%"):(t(this,S).style.height=n+"px",t(this,S).style.width="100%")}else this.vertical?(t(this,S).style.width="100%",t(this,S).style.height="max-content",h(this,b,t(this,S).offsetHeight-t(this,v))):(t(this,S).style.width="max-content",t(this,S).style.height="100%",h(this,b,t(this,S).offsetWidth-t(this,v)));if(!t(this,C).current){const n=getComputedStyle(this),c=this.vertical?parseFloat(n.paddingBlockStart)+parseFloat(n.paddingBlockEnd):parseFloat(n.paddingInlineStart)+parseFloat(n.paddingInlineEnd);h(this,b,t(this,b)+c),t(this,a).max=t(this,b)}if(t(this,C).current&&t(this,l).length){const n=t(this,l)[t(this,l).length-1],c=n.position+n.size-t(this,v),m=t(this,b)-c;h(this,et,n.position+n.size+m)}else h(this,et,t(this,b));if(t(this,I).current&&t(this,l).length){const n=t(this,l)[i];t(this,a).set(n.position,{equalize:!0})}else t(this,a).set(e*t(this,b),{equalize:!0});h(this,H,(this.vertical?t(this,S).offsetHeight:t(this,S).offsetWidth)>t(this,v)),this.classList.toggle("has-overflow",t(this,H)),t(this,H)?d(this,o,Zt).call(this):d(this,o,Kt).call(this),t(this,kt).call(this)});s(this,kt,()=>{if(!t(this,H))return;const e=this.currentScrollValue;if(h(this,zt,Math.max(0,e-t(this,b))),t(this,l).length){let i=0;for(let n=0;n<t(this,l).length;n++){const c=t(this,l)[n];c.transform(),this.targetScrollValue+c.size/2>=c.position&&(i=n)}t(this,g).current=i}else this.vertical?t(this,S).style.transform=`translate3d(0px, ${e*-1}px, 0px)`:t(this,S).style.transform=`translate3d(${e*-1}px, 0px, 0px)`;lt.scrollEntries.update(this,t(this,x).current,e)});s(this,It,(e,i)=>{t(this,ut).current&&(d(this,o,re).call(this,Math.sign(i)||1),t(this,Ht).call(this,e,i))});s(this,Ht,(e,i)=>{if(t(this,M).current){if(t(this,M).current<0&&i>0)return;if(t(this,M).current>0&&i<0)return}if(t(this,it)||t(this,F).unlistenAnimationFrame(),!t(this,k).current&&t(this,Q).current&&(clearInterval(t(this,Lt)),h(this,Lt,setTimeout(()=>{const n=d(this,o,he).call(this);n&&this.scrollToSection(n.index,{tween:{duration:t(this,gt).current,easing:ke.easeInOutExpo}})},t(this,Q).current))),!(e.includes("drag")&&!De.device.isMobile&&!t(this,ft).current))if(t(this,I).current&&e==="drag-end"){const n=Math.sign(i);t(this,l).length?this.shiftSections(n,{tween:t(this,j).current||t(this,G).current?{easing:t(this,j).current||"easeInOutCubic",duration:t(this,G).current||500}:void 0}):t(this,a).shift(n*t(this,v))}else t(this,a).shift(i)});if(Xt.isBrowser){const e=this.attachShadow({mode:"open"});e.adoptedStyleSheets.push(Oe);const i=document.createElement("div");i.className="static",i.innerHTML='<slot name="static"></slot>',e.appendChild(i),h(this,Y,document.createElement("div")),t(this,Y).className="content-wrapper",h(this,S,document.createElement("div")),t(this,S).className="content",h(this,xt,document.createElement("slot")),t(this,S).appendChild(t(this,xt)),t(this,Y).appendChild(t(this,S)),e.appendChild(t(this,Y))}}get damped(){return t(this,a)}get controlsCSSProperty(){return t(this,ut)}get axisCSSProperty(){return t(this,x)}get directionCSSProperty(){return t(this,M)}get pagesCSSProperty(){return t(this,O)}get splitCSSProperty(){return t(this,V)}get sectionalCSSProperty(){return t(this,I)}get easingCSSProperty(){return t(this,j)}get durationCSSProperty(){return t(this,G)}get autoSizeCSSProperty(){return t(this,B)}get wheelMaxDeltaCSSProperty(){return t(this,K)}get dragInertionCSSProperty(){return t(this,at)}get sectionsInViewCSSProperty(){return t(this,q)}get loopCSSProperty(){return t(this,C)}get dampingCSSProperty(){return t(this,dt)}get massCSSProperty(){return t(this,St)}get stiffnessCSSProperty(){return t(this,pt)}get mouseDragCSSProperty(){return t(this,ft)}get sectionDistanceScaleCSSProperty(){return t(this,wt)}get autoplayCSSProperty(){return t(this,k)}get autoplayPauseDurationCSSProperty(){return t(this,mt)}get autoplayUserDirectionCSSProperty(){return t(this,Z)}get classesCSSProperty(){return t(this,D)}get currentIndexStartOffsetCSSProperty(){return t(this,J)}get currentIndexEndOffsetCSSProperty(){return t(this,_)}get focusDelayCSSProperty(){return t(this,Q)}get focusDurationCSSProperty(){return t(this,gt)}get disabledCSSProperty(){return t(this,bt)}get hibernatedCSSProperty(){return t(this,X)}get currentScrollValue(){return d(this,o,ne).call(this,"current")}get targetScrollValue(){return d(this,o,ne).call(this,"target")}get contentWrapperElement(){return t(this,Y)}get contentElement(){return t(this,S)}get sections(){return t(this,l)}get position(){return t(this,Bt)}get contentPosition(){return t(this,_t)}get viewportSize(){return t(this,v)}get scrollSize(){return t(this,b)}get gap(){return t(this,z)}get counter(){return t(this,g)}get limit(){return t(this,l).length-t(this,q).current}get distance(){return t(this,et)}get loopDistance(){return t(this,C).current?t(this,et)+t(this,z):t(this,et)}get hasOverflow(){return t(this,H)}get overscroll(){return t(this,zt)}get vertical(){return t(this,x).current==="y"}get currentProgress(){return this.currentScrollValue/this.loopDistance||0}get targetProgress(){return this.targetScrollValue/this.loopDistance||0}get scrollWidth(){return t(this,x).current==="y"?0:t(this,a).distance}get scrollHeight(){return t(this,x).current==="x"?0:t(this,a).distance}onScroll(...e){return t(this,a).subscribe(...e)}offScroll(...e){t(this,a).unsubscribe(...e)}range(e,i,n=0){const c=e-n,m=c+i+n*2;return this.currentProgress<c?0:this.currentProgress>m?1:(this.currentProgress-c)/(m-c)}curve(e,i,n=0){return Math.sin(this.range(e,i,n)*Math.PI)}visible(e,i,n=0){const c=e-n,m=c+i+n*2;return this.currentProgress>=c&&this.currentProgress<=m}scrollToSection(e,i){if(!t(this,l).length)return;const n=t(this,g).current;d(this,o,me).call(this,e);const c=t(this,l)[n],m=t(this,l)[t(this,g).current];if(c&&m){let w=0;const Ct=d(this,o,he).call(this),Ee=Ct?this.targetScrollValue-Ct.position:0;t(this,C).current?t(this,g).current===0&&n===t(this,l).length-1?w=t(this,b)+t(this,v)-c.position+t(this,z):t(this,g).current===t(this,l).length-1&&n===0?w=m.position-(t(this,b)+t(this,v)+t(this,z)):w=m.position-c.position:w=m.position-c.position,this.shiftPosition(w-Ee,i)}}shiftSections(e,i){t(this,l).length&&this.scrollToSection(t(this,g).current+e,i)}setPosition(e,i){d(this,o,re).call(this,Math.sign(e)||1),i!=null&&i.tween?t(this,it)||(t(this,F).set(t(this,a).current,{equalize:!0}),t(this,F).set(e,ae({},i.tween)),h(this,it,setTimeout(()=>{h(this,it,void 0)},i.tween.duration))):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(){lt.scrollEntries.register(this),h(this,a,new Ie.Damped(0,{damping:.01,min:0,order:ee.TICK_ORDER.SCROLL})),this.setAttribute("tabindex","0"),h(this,T,new Gt.WheelControls({element:t(this,S)})),t(this,T).changeEvent.subscribe(t(this,It)),h(this,tt,new Gt.KeyboardControls({element:this})),t(this,tt).changeEvent.subscribe(t(this,It)),h(this,A,new Gt.DragControls({element:t(this,S)})),t(this,A).changeEvent.subscribe(t(this,It)),h(this,P,new Gt.AutoplayControls({culling:this})),t(this,P).changeEvent.subscribe(t(this,Ht)),t(this,x).subscribe(({current:e})=>{t(this,S).style.flexDirection=e==="x"?"row":"column",t(this,T).axis=t(this,K).current?"max":e,t(this,tt).dimension=e==="x"?"width":"height",t(this,A).axis=e,e==="x"?this.style.touchAction="pan-y":e==="y"&&(this.style.touchAction="pan-x"),this.isConnected&&t(this,L).call(this)}),t(this,K).subscribe(e=>{t(this,T).axis=e.current?"max":t(this,x).current}),t(this,at).subscribe(e=>{t(this,A).inertion=typeof e.current=="number"?e.current:1}),t(this,O).subscribe(()=>{this.isConnected&&t(this,L).call(this)}),t(this,V).subscribe(({current:e})=>{this.isConnected&&(e?d(this,o,Ot).call(this):d(this,o,Pt).call(this))}),t(this,I).subscribe(e=>{t(this,T).debounce=e.current,t(this,A).swipe=e.current,t(this,P).interval=e.current,this.isConnected&&(e.current&&!e.previous&&!t(this,l).length?d(this,o,Ot).call(this):!e.current&&e.previous&&t(this,l).length&&d(this,o,Pt).call(this))}),t(this,B).subscribe(e=>{this.isConnected&&(t(this,L).call(this),e.current&&!e.previous&&!t(this,l).length?d(this,o,Ot).call(this):!e.current&&e.previous&&t(this,l).length&&d(this,o,Pt).call(this))}),t(this,q).subscribe(e=>{this.isConnected&&(t(this,L).call(this),d(this,o,ot).call(this))}),t(this,C).subscribe(e=>{e.current?(this.isConnected&&(t(this,l).length||(t(this,V).current=!0)),t(this,l).length&&(t(this,a).max=1/0,t(this,a).min=-1/0)):(h(this,zt,0),t(this,a).max=t(this,b),t(this,a).min=0)}),t(this,dt).subscribe(e=>{t(this,a).damping=e.current}),t(this,St).subscribe(e=>{t(this,a).mass=e.current}),t(this,pt).subscribe(e=>{t(this,a).stiffness=e.current}),t(this,k).subscribe(e=>{t(this,P).speed=e.current,!t(this,st)&&e.current&&!e.previous?t(this,P).connect():!e.current&&e.previous&&t(this,P).disconnect()}),t(this,Z).subscribe(e=>{e.current||(t(this,P).direction=1)}),t(this,D).subscribe(e=>{this.isConnected&&d(this,o,ot).call(this)}),t(this,J).subscribe(e=>{this.isConnected&&t(this,D).current&&d(this,o,ot).call(this)}),t(this,_).subscribe(e=>{this.isConnected&&t(this,D).current&&d(this,o,ot).call(this)}),t(this,a).isRunning.subscribe(e=>{this.classList.toggle("active",e.current)}),t(this,g).subscribe(e=>{t(this,l).length&&d(this,o,ot).call(this)}),t(this,F).subscribe(e=>{t(this,F).isRunning.current&&t(this,a).set(e.current,{equalize:!0})}),t(this,bt).subscribe(e=>{e.current&&!e.previous?d(this,o,Kt).call(this):!e.current&&e.previous&&d(this,o,Zt).call(this)}),t(this,X).subscribe(e=>{e.current&&!e.previous?d(this,o,se).call(this):!e.current&&e.previous&&d(this,o,ie).call(this)}),t(this,ut).observe(),t(this,x).observe(),t(this,M).observe(),t(this,O).observe(),t(this,V).observe(),t(this,I).observe(),t(this,j).observe(),t(this,G).observe(),t(this,B).observe(),t(this,K).observe(),t(this,at).observe(),t(this,q).observe(),t(this,C).observe(),t(this,dt).observe(),t(this,St).observe(),t(this,pt).observe(),t(this,ft).observe(),t(this,wt).observe(),t(this,k).observe(),t(this,k).observe(),t(this,mt).observe(),t(this,Z).observe(),t(this,D).observe(),t(this,J).observe(),t(this,_).observe(),t(this,Q).observe(),t(this,gt).observe(),t(this,bt).observe(),t(this,X).observe(),t(this,X).current||d(this,o,ie).call(this)}disconnectedCallback(){this.removeAttribute("tabindex"),this.classList.remove("has-overflow"),t(this,ut).unobserve(),t(this,x).unobserve(),t(this,M).unobserve(),t(this,O).unobserve(),t(this,V).unobserve(),t(this,I).unobserve(),t(this,j).unobserve(),t(this,G).unobserve(),t(this,B).unobserve(),t(this,K).unobserve(),t(this,at).unobserve(),t(this,q).unobserve(),t(this,C).unobserve(),t(this,dt).unobserve(),t(this,St).unobserve(),t(this,pt).unobserve(),t(this,ft).unobserve(),t(this,wt).unobserve(),t(this,k).unobserve(),t(this,mt).unobserve(),t(this,Z).unobserve(),t(this,D).unobserve(),t(this,J).unobserve(),t(this,_).unobserve(),t(this,Q).unobserve(),t(this,gt).unobserve(),t(this,bt).unobserve(),t(this,X).unobserve(),d(this,o,se).call(this)}}a=new WeakMap,ut=new WeakMap,x=new WeakMap,M=new WeakMap,O=new WeakMap,V=new WeakMap,I=new WeakMap,j=new WeakMap,G=new WeakMap,B=new WeakMap,K=new WeakMap,at=new WeakMap,q=new WeakMap,C=new WeakMap,dt=new WeakMap,St=new WeakMap,pt=new WeakMap,ft=new WeakMap,wt=new WeakMap,k=new WeakMap,mt=new WeakMap,Z=new WeakMap,D=new WeakMap,J=new WeakMap,_=new WeakMap,Q=new WeakMap,gt=new WeakMap,bt=new WeakMap,X=new WeakMap,Y=new WeakMap,S=new WeakMap,xt=new WeakMap,l=new WeakMap,Bt=new WeakMap,_t=new WeakMap,v=new WeakMap,b=new WeakMap,z=new WeakMap,T=new WeakMap,tt=new WeakMap,A=new WeakMap,P=new WeakMap,g=new WeakMap,zt=new WeakMap,et=new WeakMap,H=new WeakMap,st=new WeakMap,yt=new WeakMap,Lt=new WeakMap,it=new WeakMap,F=new WeakMap,o=new WeakSet,Ot=function(){d(this,o,Pt).call(this),t(this,xt).assignedElements().forEach((e,i)=>{e instanceof HTMLElement&&t(this,l).push(new Me(e,i,this))}),t(this,S).style.transform="",te.dispatchEvent(this,"scrollSectionsChange",{custom:!0,composed:!0}),t(this,L).call(this),d(this,o,ot).call(this)},Pt=function(){t(this,l).forEach(e=>{e.destroy()}),h(this,l,[]),t(this,g).reset(),t(this,a).reset(),te.dispatchEvent(this,"scrollSectionsChange",{custom:!0,composed:!0})},Kt=function(){t(this,st)||(h(this,st,!0),t(this,a).unsubscribe(t(this,kt)),t(this,a).unlistenAnimationFrame(),clearInterval(t(this,Lt)),clearInterval(t(this,it)),t(this,F).unlistenAnimationFrame(),t(this,T).disconnect(),t(this,tt).disconnect(),t(this,A).disconnect(),t(this,P).disconnect(),t(this,H)||this.sections.forEach(e=>{e.unsetTransform()}))},Zt=function(){t(this,st)&&(h(this,st,!1),t(this,a).subscribe(t(this,kt)),t(this,T).connect(),t(this,tt).connect(),t(this,A).connect(),t(this,k).current&&t(this,P).connect())},se=function(){t(this,yt)||(h(this,yt,!0),Jt.windowResizer.unsubscribe(t(this,L)),Qt.elementResizer.unsubscribe(t(this,L)),d(this,o,Kt).call(this),t(this,S).style.transform="",t(this,l).length?d(this,o,Pt).call(this):(t(this,g).reset(),t(this,a).reset()),lt.scrollEntries.unregister(this))},ie=function(){t(this,yt)&&(h(this,yt,!1),lt.scrollEntries.register(this),(t(this,C).current||t(this,V).current||t(this,C).current||t(this,B).current||t(this,I).current)&&d(this,o,Ot).call(this),d(this,o,Zt).call(this),Jt.windowResizer.subscribe(t(this,L),ee.RESIZE_ORDER.SCROLL),Qt.elementResizer.subscribe(this,t(this,L)))},L=new WeakMap,kt=new WeakMap,me=function(e){t(this,C).current?(t(this,g).current=e%t(this,l).length,t(this,g).current=t(this,g).current<0?t(this,l).length+t(this,g).current:t(this,g).current):t(this,g).current=pe.clamp(e,0,this.limit)},It=new WeakMap,Ht=new WeakMap,re=function(e=1){t(this,Z).current&&(t(this,P).direction=e),t(this,k).current&&t(this,P).pauseAndContinue(t(this,mt).current,this.sectionalCSSProperty.current)},ne=function(e="current"){if(t(this,C).current&&t(this,l).length){const i=t(this,a)[e]%(t(this,b)+t(this,v)+t(this,z));return i<0?t(this,b)+i+t(this,v)+t(this,z):i}else return t(this,a)[e]},ot=function(){if(t(this,D).current&&t(this,l).length){const e=t(this,g).current+t(this,J).current;e===0?this.classList.add("start"):this.classList.remove("start"),e===this.limit?this.classList.add("end"):this.classList.remove("end");const i=t(this,q).current+t(this,_).current;t(this,l).forEach((n,c)=>{const m=e-this.limit-1+t(this,_).current,w=e+i,Ct=this.sections.length-w;c>=e&&c<w||c<=m?n.mark("current"):c>=w&&c<w+Ct/2||c<=m+i?n.mark("next"):n.mark("previous")})}},he=function(e=this.targetScrollValue){let i=null,n=1/0;for(let c=0;c<t(this,l).length;c++){const m=Math.abs(t(this,l)[c].position-e);m<n&&(n=m,i=c)}return i!==null?t(this,l)[i]:null};customElements.get("e-scroll")||customElements.define("e-scroll",Mt);var Ft;class oe extends HTMLElement{constructor(){super(...arguments);s(this,Ft,null)}get scrollElement(){return t(this,Ft)}connectedCallback(){const e=fe.findParentElement(this,Mt);e instanceof Mt?h(this,Ft,e):console.error(this,"e-scroll not found")}}Ft=new WeakMap;var rt,E,W,U,qt,Dt,vt,Wt,Ut,$t;class ge extends oe{constructor(){super();s(this,rt,null);s(this,E,null);s(this,W,!1);s(this,U,0);s(this,qt,0);s(this,Dt,0);s(this,vt,()=>{h(this,W,this.offsetWidth>this.offsetHeight);const e=t(this,W)?this.offsetWidth:this.offsetHeight;h(this,U,e/((this.scrollElement.scrollSize+this.scrollElement.viewportSize)/e)),h(this,U,Math.max(t(this,U),30)),t(this,W)?(t(this,E).style.width=t(this,U)+"px",t(this,E).style.height="100%"):(t(this,E).style.width="100%",t(this,E).style.height=t(this,U)+"px"),h(this,qt,e-t(this,U)),this.scrollElement.scrollSize||(this.style.display="none")});s(this,Wt,()=>{h(this,Dt,this.scrollElement.currentProgress*t(this,qt)),t(this,W)?t(this,E).style.transform=`translate3d(${t(this,Dt)}px, 0px, 0px)`:t(this,E).style.transform=`translate3d(0px, ${t(this,Dt)}px, 0px)`});s(this,Ut,()=>{this.setAttribute("axis",this.scrollElement.axisCSSProperty.current)});s(this,$t,e=>{document.documentElement.classList.add("grabbing"),Te.setupDrag(c=>{const m=t(this,W)?c.x:c.y,w=this.scrollElement.distance/t(this,qt),Ct=(m-n)*w;this.scrollElement.setPosition(i+Ct)},()=>{document.documentElement.classList.remove("grabbing")});const i=this.scrollElement.damped.target,n=t(this,W)?e.x:e.y});if(Xt.isBrowser){const e=this.attachShadow({mode:"open"});e.adoptedStyleSheets.push(Se.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:"black",borderRadius:"0.3vmin",touchAction:"none"},"::slotted(*)":{touchAction:"none"}})),h(this,rt,document.createElement("slot")),t(this,rt).innerHTML='<div class="default-thumb"></div>',e.appendChild(t(this,rt))}}get thumbElement(){return t(this,E)}connectedCallback(){super.connectedCallback(),this.setAttribute("drag-dead-zone","");const e=t(this,rt).assignedElements()[0]||t(this,rt).firstElementChild;h(this,E,e),t(this,E).addEventListener("pointerdown",t(this,$t)),Jt.windowResizer.subscribe(t(this,vt),ee.RESIZE_ORDER.SCROLL),Qt.elementResizer.subscribe(this,t(this,vt)),this.scrollElement.onScroll(t(this,Wt)),this.scrollElement.axisCSSProperty.subscribe(t(this,Ut))}disconnectedCallback(){this.removeAttribute("drag-dead-zone"),t(this,E).removeEventListener("pointerdown",t(this,$t)),Jt.windowResizer.unsubscribe(t(this,vt)),Qt.elementResizer.unsubscribe(t(this,vt)),this.scrollElement.offScroll(t(this,Wt)),this.scrollElement.axisCSSProperty.unsubscribe(t(this,Ut))}}rt=new WeakMap,E=new WeakMap,W=new WeakMap,U=new WeakMap,qt=new WeakMap,Dt=new WeakMap,vt=new WeakMap,Wt=new WeakMap,Ut=new WeakMap,$t=new WeakMap;customElements.get("e-scrollbar")||customElements.define("e-scrollbar",ge);class be extends oe{constructor(){super(),Xt.isBrowser&&this.addEventListener("click",()=>{const r=this.getAttribute("behaviour"),e=this.getAttribute("easing")||void 0,i=e?parseFloat(this.getAttribute("duration")||"0"):void 0;this.handleClick({behaviour:r,tween:e?{easing:e,duration:i}:void 0})})}}class ye extends be{handleClick(r){const e=this.getAttribute("index");this.scrollElement.scrollToSection(parseInt(e||"0"),r)}}customElements.get("e-scroll-set-button")||customElements.define("e-scroll-set-button",ye);class ve extends be{handleClick(r){const e=this.getAttribute("step");this.scrollElement.shiftSections(parseInt(e||"1"),r)}}customElements.get("e-scroll-step-button")||customElements.define("e-scroll-step-button",ve);var $,nt,Tt,Nt,jt,At;class Ve{constructor(r,e,i){s(this,$,null);s(this,nt,null);s(this,Tt,null);s(this,Nt,null);s(this,jt,()=>{t(this,nt).scrollToSection(t(this,Tt),{behaviour:t(this,Nt)})});s(this,At,()=>{t(this,$).classList.toggle("current",t(this,nt).counter.current===t(this,Tt))});Xt.isBrowser&&(h(this,$,document.createElement("button")),h(this,nt,r),h(this,Nt,i),h(this,Tt,e),t(this,$).addEventListener("click",t(this,jt)),t(this,nt).counter.subscribe(t(this,At)),t(this,At).call(this))}get element(){return t(this,$)}destroy(){t(this,$).removeEventListener("click",t(this,jt)),t(this,nt).counter.unsubscribe(t(this,At)),t(this,$).remove()}}$=new WeakMap,nt=new WeakMap,Tt=new WeakMap,Nt=new WeakMap,jt=new WeakMap,At=new WeakMap;var ht,Rt;class Ce extends oe{constructor(){super(...arguments);s(this,ht,[]);s(this,Rt,Ae.debounce(()=>{t(this,ht).forEach(e=>e.destroy()),h(this,ht,[]);for(let e=0;e<this.scrollElement.sections.length;e++){const i=new Ve(this.scrollElement,e,this.getAttribute("behaviour")||"smooth");this.appendChild(i.element),t(this,ht).push(i)}},0))}connectedCallback(){super.connectedCallback(),this.scrollElement.addEventListener("sectionsChange",t(this,Rt)),t(this,Rt).call(this)}disconnectedCallback(){this.scrollElement.removeEventListener("sectionsChange",t(this,Rt)),t(this,ht).forEach(e=>e.destroy()),h(this,ht,[])}}ht=new WeakMap,Rt=new WeakMap;customElements.get("e-scroll-bullet-buttons")||customElements.define("e-scroll-bullet-buttons",Ce);class Pe extends Re.ScrollSegmentElement{connectedCallback(){const r=fe.findParentElement(this,Mt);r instanceof Mt?(this.scrollContainer=r,this.scrollContainer.addEventListener("scrollSectionsChange",this.findAnotherScrollEntries)):console.error(this,"e-scroll not found")}}customElements.get("e-scroll-segment")||customElements.define("e-scroll-segment",Pe);exports.ScrollBulletButtonsElement=Ce;exports.ScrollElement=Mt;exports.ScrollSegmentElement=Pe;exports.ScrollSetButtonElement=ye;exports.ScrollStepButtonElement=ve;exports.ScrollbarElement=ge;
|
|
1
|
+
"use strict";var we=Object.defineProperty;var le=Object.getOwnPropertySymbols;var xe=Object.prototype.hasOwnProperty,ze=Object.prototype.propertyIsEnumerable;var ue=u=>{throw TypeError(u)};var ce=(u,r,e)=>r in u?we(u,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):u[r]=e,ae=(u,r)=>{for(var e in r||(r={}))xe.call(r,e)&&ce(u,e,r[e]);if(le)for(var e of le(r))ze.call(r,e)&&ce(u,e,r[e]);return u};var Yt=(u,r,e)=>r.has(u)||ue("Cannot "+e);var t=(u,r,e)=>(Yt(u,r,"read from private field"),e?e.call(u):r.get(u)),s=(u,r,e)=>r.has(u)?ue("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(u):r.set(u,e),h=(u,r,e,i)=>(Yt(u,r,"write to private field"),i?i.call(u,e):r.set(u,e),e),d=(u,r,e)=>(Yt(u,r,"access private method"),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Le=require("../../Store-CDb6RMce.cjs"),Xt=require("../../browser-CpzFX2xg.cjs"),ke=require("../../easings-GegIwET5.cjs"),te=require("../../events-KVanG9sR.cjs"),Se=require("../../jss-GJLvaNfT.cjs"),Et=require("../../layout-8ryRAMGJ.cjs"),pe=require("../../math-GDWEqu7y.cjs");require("../../ticker/vanilla/index.cjs");const ee=require("../../order/index.cjs"),Ie=require("../../Damped-CTsV8tl_.cjs"),qe=require("../../Tweened-C0-UzxN-.cjs"),Gt=require("../../controls/index.cjs"),Jt=require("../../window-resizer/vanilla/index.cjs"),lt=require("../../scroll-entries/index.cjs"),de=require("../../css-unit-parser/index.cjs"),p=require("../../css-property/index.cjs"),De=require("../../device/index.cjs"),Qt=require("../../element-resizer/vanilla/index.cjs"),Te=require("../../gestures-DHLrn6Q8.cjs"),fe=require("../../dom-JBOkFLTh.cjs"),Ae=require("../../function-MthRj-GJ.cjs"),Re=require("../../scroll-segment/index.cjs");var f,Vt,y,ct,R,N;class Me{constructor(r,e,i){s(this,f);s(this,Vt);s(this,y);s(this,ct,0);s(this,R,0);s(this,N,null);h(this,f,r),h(this,Vt,e),h(this,y,i),lt.scrollEntries.register(t(this,f))}get index(){return t(this,Vt)}get size(){return t(this,ct)}get position(){return t(this,R)}destroy(){lt.scrollEntries.unregister(t(this,f)),this.unsetTransform()}unsetTransform(){t(this,f).style.transform="",this.mark(null)}setSize(r){r?(t(this,f).style.setProperty("--size",r+"px"),t(this,y).axisCSSProperty.current==="x"?(t(this,f).style.width=r+"px",t(this,f).style.height=""):(t(this,f).style.height=r+"px",t(this,f).style.width="")):(t(this,f).style.width="",t(this,f).style.height="",t(this,f).style.removeProperty("--size"))}resize(){h(this,ct,t(this,y).vertical?t(this,f).offsetHeight:t(this,f).offsetWidth),h(this,R,t(this,y).vertical?Et.getCumulativeOffsetTop(t(this,f)):Et.getCumulativeOffsetLeft(t(this,f))),h(this,R,t(this,R)-t(this,y).contentPosition)}transform(){let r=0;const e=t(this,y).viewportSize*t(this,y).sectionDistanceScaleCSSProperty.current;t(this,y).loopCSSProperty.current&&t(this,y).overscroll&&t(this,R)+t(this,ct)<t(this,y).currentScrollValue&&(r=t(this,y).distance*-1-t(this,y).gap),lt.scrollEntries.update(t(this,f),t(this,y).axisCSSProperty.current,r);const i=t(this,y).currentScrollValue+r,n=t(this,R)-t(this,y).viewportSize-e,c=t(this,R)+t(this,ct)+e,m=pe.clamp(i,n,c);t(this,y).vertical?t(this,f).style.transform=`translate3d(0px, ${m*-1}px, 0px)`:t(this,f).style.transform=`translate3d(${m*-1}px, 0px, 0px)`}mark(r){t(this,N)!==r&&(t(this,N)&&t(this,f).classList.remove(t(this,N)),r&&t(this,f).classList.add(r),h(this,N,r),te.dispatchEvent(t(this,f),"scrollSectionMarkChange",{composed:!0,detail:{mark:t(this,N)},custom:!0}))}}f=new WeakMap,Vt=new WeakMap,y=new WeakMap,ct=new WeakMap,R=new WeakMap,N=new WeakMap;const Oe=Se.createStylesheet({":host":{position:"relative",width:"100%",height:"100%",display:"block",outline:"none"},':host([hibernated="true"])':{display:"contents"},".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="true"]) .content':{display:"contents"},"::slotted(*)":{flexShrink:"0"}});var a,ut,x,M,O,V,I,j,G,B,K,at,q,C,dt,St,pt,ft,wt,k,mt,Z,D,J,_,Q,gt,bt,X,Y,S,xt,l,Bt,_t,v,b,z,T,tt,A,P,g,zt,et,H,st,yt,Lt,it,F,o,Ot,Pt,Kt,Zt,se,ie,L,kt,me,It,Ht,re,ne,ot,he;class Mt extends HTMLElement{constructor(){super();s(this,o);s(this,a,null);s(this,ut,new p.CSSProperty(this,"--controls",!0));s(this,x,new p.CSSProperty(this,"--axis","y"));s(this,M,new p.CSSProperty(this,"--direction",0));s(this,O,new p.CSSProperty(this,"--pages",0,{validate:e=>Math.max(0,e-1)}));s(this,V,new p.CSSProperty(this,"--split",!1));s(this,I,new p.CSSProperty(this,"--sectional",!1));s(this,j,new p.CSSProperty(this,"--easing",!1));s(this,G,new p.CSSProperty(this,"--duration",!1));s(this,B,new p.CSSProperty(this,"--auto-size",!1));s(this,K,new p.CSSProperty(this,"--wheel-max-delta",!1));s(this,at,new p.CSSProperty(this,"--drag-inertion",1));s(this,q,new p.CSSProperty(this,"--sections-in-view",1));s(this,C,new p.CSSProperty(this,"--loop",!1));s(this,dt,new p.CSSProperty(this,"--damping",20));s(this,St,new p.CSSProperty(this,"--mass",0));s(this,pt,new p.CSSProperty(this,"--stiffness",0));s(this,ft,new p.CSSProperty(this,"--mouse-drag",!1));s(this,wt,new p.CSSProperty(this,"--section-distance-scale",.5));s(this,k,new p.CSSProperty(this,"--autoplay",0));s(this,mt,new p.CSSProperty(this,"--autoplay-pause-duration",0));s(this,Z,new p.CSSProperty(this,"--autoplay-user-direction",!1));s(this,D,new p.CSSProperty(this,"--classes",!1));s(this,J,new p.CSSProperty(this,"--current-index-start-offset",0));s(this,_,new p.CSSProperty(this,"--current-index-end-offset",0));s(this,Q,new p.CSSProperty(this,"--focus-delay",0));s(this,gt,new p.CSSProperty(this,"--focus-duration",3e3));s(this,bt,new p.CSSProperty(this,"--disabled",!1));s(this,X,new p.CSSProperty(this,"--hibernated",!1));s(this,Y,null);s(this,S,null);s(this,xt,null);s(this,l,[]);s(this,Bt,0);s(this,_t,0);s(this,v,0);s(this,b,0);s(this,z,0);s(this,T,null);s(this,tt,null);s(this,A,null);s(this,P,null);s(this,g,new Le.Store(0));s(this,zt,0);s(this,et,0);s(this,H,!1);s(this,st,!0);s(this,yt,!0);s(this,Lt);s(this,it);s(this,F,new qe.Tweened);s(this,L,()=>{t(this,a).unlistenAnimationFrame();const e=this.currentScrollValue/t(this,b)||0,i=t(this,g).current;if(h(this,Bt,this.vertical?Et.getCumulativeOffsetTop(this):Et.getCumulativeOffsetLeft(this)),h(this,_t,this.vertical?Et.getCumulativeOffsetTop(t(this,S)):Et.getCumulativeOffsetLeft(t(this,S))),h(this,v,this.vertical?this.offsetHeight:this.offsetWidth),this.vertical?h(this,z,de.cssUnitParser.parse(getComputedStyle(t(this,S)).rowGap)):h(this,z,de.cssUnitParser.parse(getComputedStyle(t(this,S)).columnGap)),t(this,B).current&&t(this,l).length){const n=t(this,q).current,c=(t(this,v)-t(this,z)*(n-1))/n;t(this,l).forEach(m=>{m.setSize(c)})}else t(this,l).forEach(n=>{n.setSize()});if(t(this,l).forEach(n=>{n.resize()}),t(this,O).current){h(this,b,t(this,v)*t(this,O).current);const n=t(this,b)+t(this,v);this.vertical?(t(this,S).style.width=n+"px",t(this,S).style.height="100%"):(t(this,S).style.height=n+"px",t(this,S).style.width="100%")}else this.vertical?(t(this,S).style.width="100%",t(this,S).style.height="max-content",h(this,b,t(this,S).offsetHeight-t(this,v))):(t(this,S).style.width="max-content",t(this,S).style.height="100%",h(this,b,t(this,S).offsetWidth-t(this,v)));if(!t(this,C).current){const n=getComputedStyle(this),c=this.vertical?parseFloat(n.paddingBlockStart)+parseFloat(n.paddingBlockEnd):parseFloat(n.paddingInlineStart)+parseFloat(n.paddingInlineEnd);h(this,b,t(this,b)+c),t(this,a).max=t(this,b)}if(t(this,C).current&&t(this,l).length){const n=t(this,l)[t(this,l).length-1],c=n.position+n.size-t(this,v),m=t(this,b)-c;h(this,et,n.position+n.size+m)}else h(this,et,t(this,b));if(t(this,I).current&&t(this,l).length){const n=t(this,l)[i];t(this,a).set(n.position,{equalize:!0})}else t(this,a).set(e*t(this,b),{equalize:!0});h(this,H,(this.vertical?t(this,S).offsetHeight:t(this,S).offsetWidth)>t(this,v)),this.classList.toggle("has-overflow",t(this,H)),t(this,H)?d(this,o,Zt).call(this):d(this,o,Kt).call(this),t(this,kt).call(this)});s(this,kt,()=>{if(!t(this,H))return;const e=this.currentScrollValue;if(h(this,zt,Math.max(0,e-t(this,b))),t(this,l).length){let i=0;for(let n=0;n<t(this,l).length;n++){const c=t(this,l)[n];c.transform(),this.targetScrollValue+c.size/2>=c.position&&(i=n)}t(this,g).current=i}else this.vertical?t(this,S).style.transform=`translate3d(0px, ${e*-1}px, 0px)`:t(this,S).style.transform=`translate3d(${e*-1}px, 0px, 0px)`;lt.scrollEntries.update(this,t(this,x).current,e)});s(this,It,(e,i)=>{t(this,ut).current&&(d(this,o,re).call(this,Math.sign(i)||1),t(this,Ht).call(this,e,i))});s(this,Ht,(e,i)=>{if(t(this,M).current){if(t(this,M).current<0&&i>0)return;if(t(this,M).current>0&&i<0)return}if(t(this,it)||t(this,F).unlistenAnimationFrame(),!t(this,k).current&&t(this,Q).current&&(clearInterval(t(this,Lt)),h(this,Lt,setTimeout(()=>{const n=d(this,o,he).call(this);n&&this.scrollToSection(n.index,{tween:{duration:t(this,gt).current,easing:ke.easeInOutExpo}})},t(this,Q).current))),!(e.includes("drag")&&!De.device.isMobile&&!t(this,ft).current))if(t(this,I).current&&e!=="drag"){const n=Math.sign(i);t(this,l).length?this.shiftSections(n,{tween:t(this,j).current||t(this,G).current?{easing:t(this,j).current||"easeInOutCubic",duration:t(this,G).current||500}:void 0}):t(this,a).shift(n*t(this,v))}else t(this,a).shift(i)});if(Xt.isBrowser){const e=this.attachShadow({mode:"open"});e.adoptedStyleSheets.push(Oe);const i=document.createElement("div");i.className="static",i.innerHTML='<slot name="static"></slot>',e.appendChild(i),h(this,Y,document.createElement("div")),t(this,Y).className="content-wrapper",h(this,S,document.createElement("div")),t(this,S).className="content",h(this,xt,document.createElement("slot")),t(this,S).appendChild(t(this,xt)),t(this,Y).appendChild(t(this,S)),e.appendChild(t(this,Y))}}get damped(){return t(this,a)}get controlsCSSProperty(){return t(this,ut)}get axisCSSProperty(){return t(this,x)}get directionCSSProperty(){return t(this,M)}get pagesCSSProperty(){return t(this,O)}get splitCSSProperty(){return t(this,V)}get sectionalCSSProperty(){return t(this,I)}get easingCSSProperty(){return t(this,j)}get durationCSSProperty(){return t(this,G)}get autoSizeCSSProperty(){return t(this,B)}get wheelMaxDeltaCSSProperty(){return t(this,K)}get dragInertionCSSProperty(){return t(this,at)}get sectionsInViewCSSProperty(){return t(this,q)}get loopCSSProperty(){return t(this,C)}get dampingCSSProperty(){return t(this,dt)}get massCSSProperty(){return t(this,St)}get stiffnessCSSProperty(){return t(this,pt)}get mouseDragCSSProperty(){return t(this,ft)}get sectionDistanceScaleCSSProperty(){return t(this,wt)}get autoplayCSSProperty(){return t(this,k)}get autoplayPauseDurationCSSProperty(){return t(this,mt)}get autoplayUserDirectionCSSProperty(){return t(this,Z)}get classesCSSProperty(){return t(this,D)}get currentIndexStartOffsetCSSProperty(){return t(this,J)}get currentIndexEndOffsetCSSProperty(){return t(this,_)}get focusDelayCSSProperty(){return t(this,Q)}get focusDurationCSSProperty(){return t(this,gt)}get disabledCSSProperty(){return t(this,bt)}get hibernatedCSSProperty(){return t(this,X)}get currentScrollValue(){return d(this,o,ne).call(this,"current")}get targetScrollValue(){return d(this,o,ne).call(this,"target")}get contentWrapperElement(){return t(this,Y)}get contentElement(){return t(this,S)}get sections(){return t(this,l)}get position(){return t(this,Bt)}get contentPosition(){return t(this,_t)}get viewportSize(){return t(this,v)}get scrollSize(){return t(this,b)}get gap(){return t(this,z)}get counter(){return t(this,g)}get limit(){return t(this,l).length-t(this,q).current}get distance(){return t(this,et)}get loopDistance(){return t(this,C).current?t(this,et)+t(this,z):t(this,et)}get hasOverflow(){return t(this,H)}get overscroll(){return t(this,zt)}get vertical(){return t(this,x).current==="y"}get currentProgress(){return this.currentScrollValue/this.loopDistance||0}get targetProgress(){return this.targetScrollValue/this.loopDistance||0}get scrollWidth(){return t(this,x).current==="y"?0:t(this,a).distance}get scrollHeight(){return t(this,x).current==="x"?0:t(this,a).distance}onScroll(...e){return t(this,a).subscribe(...e)}offScroll(...e){t(this,a).unsubscribe(...e)}range(e,i,n=0){const c=e-n,m=c+i+n*2;return this.currentProgress<c?0:this.currentProgress>m?1:(this.currentProgress-c)/(m-c)}curve(e,i,n=0){return Math.sin(this.range(e,i,n)*Math.PI)}visible(e,i,n=0){const c=e-n,m=c+i+n*2;return this.currentProgress>=c&&this.currentProgress<=m}scrollToSection(e,i){if(!t(this,l).length)return;const n=t(this,g).current;d(this,o,me).call(this,e);const c=t(this,l)[n],m=t(this,l)[t(this,g).current];if(c&&m){let w=0;const Ct=d(this,o,he).call(this),Ee=Ct?this.targetScrollValue-Ct.position:0;t(this,C).current?t(this,g).current===0&&n===t(this,l).length-1?w=t(this,b)+t(this,v)-c.position+t(this,z):t(this,g).current===t(this,l).length-1&&n===0?w=m.position-(t(this,b)+t(this,v)+t(this,z)):w=m.position-c.position:w=m.position-c.position,this.shiftPosition(w-Ee,i)}}shiftSections(e,i){t(this,l).length&&this.scrollToSection(t(this,g).current+e,i)}setPosition(e,i){d(this,o,re).call(this,Math.sign(e)||1),i!=null&&i.tween?t(this,it)||(t(this,F).set(t(this,a).current,{equalize:!0}),t(this,F).set(e,ae({},i.tween)),h(this,it,setTimeout(()=>{h(this,it,void 0)},i.tween.duration))):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(){lt.scrollEntries.register(this),h(this,a,new Ie.Damped(0,{damping:.01,min:0,order:ee.TICK_ORDER.SCROLL})),this.setAttribute("tabindex","0"),h(this,T,new Gt.WheelControls({element:t(this,S)})),t(this,T).changeEvent.subscribe(t(this,It)),h(this,tt,new Gt.KeyboardControls({element:this})),t(this,tt).changeEvent.subscribe(t(this,It)),h(this,A,new Gt.DragControls({element:t(this,S)})),t(this,A).changeEvent.subscribe(t(this,It)),h(this,P,new Gt.AutoplayControls({culling:this})),t(this,P).changeEvent.subscribe(t(this,Ht)),t(this,x).subscribe(({current:e})=>{t(this,S).style.flexDirection=e==="x"?"row":"column",t(this,T).axis=t(this,K).current?"max":e,t(this,tt).dimension=e==="x"?"width":"height",t(this,A).axis=e,e==="x"?this.style.touchAction="pan-y":e==="y"&&(this.style.touchAction="pan-x"),this.isConnected&&t(this,L).call(this)}),t(this,K).subscribe(e=>{t(this,T).axis=e.current?"max":t(this,x).current}),t(this,at).subscribe(e=>{t(this,A).inertion=typeof e.current=="number"?e.current:1}),t(this,O).subscribe(()=>{this.isConnected&&t(this,L).call(this)}),t(this,V).subscribe(({current:e})=>{this.isConnected&&(e?d(this,o,Ot).call(this):d(this,o,Pt).call(this))}),t(this,I).subscribe(e=>{t(this,T).debounce=e.current,t(this,A).swipe=e.current,t(this,P).interval=e.current,this.isConnected&&(e.current&&!e.previous&&!t(this,l).length?d(this,o,Ot).call(this):!e.current&&e.previous&&t(this,l).length&&d(this,o,Pt).call(this))}),t(this,B).subscribe(e=>{this.isConnected&&(t(this,L).call(this),e.current&&!e.previous&&!t(this,l).length?d(this,o,Ot).call(this):!e.current&&e.previous&&t(this,l).length&&d(this,o,Pt).call(this))}),t(this,q).subscribe(e=>{this.isConnected&&(t(this,L).call(this),d(this,o,ot).call(this))}),t(this,C).subscribe(e=>{e.current?(this.isConnected&&(t(this,l).length||(t(this,V).current=!0)),t(this,l).length&&(t(this,a).max=1/0,t(this,a).min=-1/0)):(h(this,zt,0),t(this,a).max=t(this,b),t(this,a).min=0)}),t(this,dt).subscribe(e=>{t(this,a).damping=e.current}),t(this,St).subscribe(e=>{t(this,a).mass=e.current}),t(this,pt).subscribe(e=>{t(this,a).stiffness=e.current}),t(this,k).subscribe(e=>{t(this,P).speed=e.current,!t(this,st)&&e.current&&!e.previous?t(this,P).connect():!e.current&&e.previous&&t(this,P).disconnect()}),t(this,Z).subscribe(e=>{e.current||(t(this,P).direction=1)}),t(this,D).subscribe(e=>{this.isConnected&&d(this,o,ot).call(this)}),t(this,J).subscribe(e=>{this.isConnected&&t(this,D).current&&d(this,o,ot).call(this)}),t(this,_).subscribe(e=>{this.isConnected&&t(this,D).current&&d(this,o,ot).call(this)}),t(this,a).isRunning.subscribe(e=>{this.classList.toggle("active",e.current)}),t(this,g).subscribe(e=>{t(this,l).length&&d(this,o,ot).call(this)}),t(this,F).subscribe(e=>{t(this,F).isRunning.current&&t(this,a).set(e.current,{equalize:!0})}),t(this,bt).subscribe(e=>{e.current&&!e.previous?d(this,o,Kt).call(this):!e.current&&e.previous&&d(this,o,Zt).call(this)}),t(this,X).subscribe(e=>{e.current&&!e.previous?d(this,o,se).call(this):!e.current&&e.previous&&d(this,o,ie).call(this)}),t(this,ut).observe(),t(this,x).observe(),t(this,M).observe(),t(this,O).observe(),t(this,V).observe(),t(this,I).observe(),t(this,j).observe(),t(this,G).observe(),t(this,B).observe(),t(this,K).observe(),t(this,at).observe(),t(this,q).observe(),t(this,C).observe(),t(this,dt).observe(),t(this,St).observe(),t(this,pt).observe(),t(this,ft).observe(),t(this,wt).observe(),t(this,k).observe(),t(this,k).observe(),t(this,mt).observe(),t(this,Z).observe(),t(this,D).observe(),t(this,J).observe(),t(this,_).observe(),t(this,Q).observe(),t(this,gt).observe(),t(this,bt).observe(),t(this,X).observe(),t(this,X).current||d(this,o,ie).call(this)}disconnectedCallback(){this.removeAttribute("tabindex"),this.classList.remove("has-overflow"),t(this,ut).unobserve(),t(this,x).unobserve(),t(this,M).unobserve(),t(this,O).unobserve(),t(this,V).unobserve(),t(this,I).unobserve(),t(this,j).unobserve(),t(this,G).unobserve(),t(this,B).unobserve(),t(this,K).unobserve(),t(this,at).unobserve(),t(this,q).unobserve(),t(this,C).unobserve(),t(this,dt).unobserve(),t(this,St).unobserve(),t(this,pt).unobserve(),t(this,ft).unobserve(),t(this,wt).unobserve(),t(this,k).unobserve(),t(this,mt).unobserve(),t(this,Z).unobserve(),t(this,D).unobserve(),t(this,J).unobserve(),t(this,_).unobserve(),t(this,Q).unobserve(),t(this,gt).unobserve(),t(this,bt).unobserve(),t(this,X).unobserve(),d(this,o,se).call(this)}}a=new WeakMap,ut=new WeakMap,x=new WeakMap,M=new WeakMap,O=new WeakMap,V=new WeakMap,I=new WeakMap,j=new WeakMap,G=new WeakMap,B=new WeakMap,K=new WeakMap,at=new WeakMap,q=new WeakMap,C=new WeakMap,dt=new WeakMap,St=new WeakMap,pt=new WeakMap,ft=new WeakMap,wt=new WeakMap,k=new WeakMap,mt=new WeakMap,Z=new WeakMap,D=new WeakMap,J=new WeakMap,_=new WeakMap,Q=new WeakMap,gt=new WeakMap,bt=new WeakMap,X=new WeakMap,Y=new WeakMap,S=new WeakMap,xt=new WeakMap,l=new WeakMap,Bt=new WeakMap,_t=new WeakMap,v=new WeakMap,b=new WeakMap,z=new WeakMap,T=new WeakMap,tt=new WeakMap,A=new WeakMap,P=new WeakMap,g=new WeakMap,zt=new WeakMap,et=new WeakMap,H=new WeakMap,st=new WeakMap,yt=new WeakMap,Lt=new WeakMap,it=new WeakMap,F=new WeakMap,o=new WeakSet,Ot=function(){d(this,o,Pt).call(this),t(this,xt).assignedElements().forEach((e,i)=>{e instanceof HTMLElement&&t(this,l).push(new Me(e,i,this))}),t(this,S).style.transform="",te.dispatchEvent(this,"scrollSectionsChange",{custom:!0,composed:!0}),t(this,L).call(this),d(this,o,ot).call(this)},Pt=function(){t(this,l).forEach(e=>{e.destroy()}),h(this,l,[]),t(this,g).reset(),t(this,a).reset(),te.dispatchEvent(this,"scrollSectionsChange",{custom:!0,composed:!0})},Kt=function(){t(this,st)||(h(this,st,!0),t(this,a).unsubscribe(t(this,kt)),t(this,a).unlistenAnimationFrame(),clearInterval(t(this,Lt)),clearInterval(t(this,it)),t(this,F).unlistenAnimationFrame(),t(this,T).disconnect(),t(this,tt).disconnect(),t(this,A).disconnect(),t(this,P).disconnect(),t(this,H)||this.sections.forEach(e=>{e.unsetTransform()}))},Zt=function(){t(this,st)&&(h(this,st,!1),t(this,a).subscribe(t(this,kt)),t(this,T).connect(),t(this,tt).connect(),t(this,A).connect(),t(this,k).current&&t(this,P).connect())},se=function(){t(this,yt)||(h(this,yt,!0),Jt.windowResizer.unsubscribe(t(this,L)),Qt.elementResizer.unsubscribe(t(this,L)),d(this,o,Kt).call(this),t(this,S).style.transform="",t(this,l).length?d(this,o,Pt).call(this):(t(this,g).reset(),t(this,a).reset()),lt.scrollEntries.unregister(this))},ie=function(){t(this,yt)&&(h(this,yt,!1),lt.scrollEntries.register(this),(t(this,C).current||t(this,V).current||t(this,C).current||t(this,B).current||t(this,I).current)&&d(this,o,Ot).call(this),d(this,o,Zt).call(this),Jt.windowResizer.subscribe(t(this,L),ee.RESIZE_ORDER.SCROLL),Qt.elementResizer.subscribe(this,t(this,L)))},L=new WeakMap,kt=new WeakMap,me=function(e){t(this,C).current?(t(this,g).current=e%t(this,l).length,t(this,g).current=t(this,g).current<0?t(this,l).length+t(this,g).current:t(this,g).current):t(this,g).current=pe.clamp(e,0,this.limit)},It=new WeakMap,Ht=new WeakMap,re=function(e=1){t(this,Z).current&&(t(this,P).direction=e),t(this,k).current&&t(this,P).pauseAndContinue(t(this,mt).current,this.sectionalCSSProperty.current)},ne=function(e="current"){if(t(this,C).current&&t(this,l).length){const i=t(this,a)[e]%(t(this,b)+t(this,v)+t(this,z));return i<0?t(this,b)+i+t(this,v)+t(this,z):i}else return t(this,a)[e]},ot=function(){if(t(this,D).current&&t(this,l).length){const e=t(this,g).current+t(this,J).current;e===0?this.classList.add("start"):this.classList.remove("start"),e===this.limit?this.classList.add("end"):this.classList.remove("end");const i=t(this,q).current+t(this,_).current;t(this,l).forEach((n,c)=>{const m=e-this.limit-1+t(this,_).current,w=e+i,Ct=this.sections.length-w;c>=e&&c<w||c<=m?n.mark("current"):c>=w&&c<w+Ct/2||c<=m+i?n.mark("next"):n.mark("previous")})}},he=function(e=this.targetScrollValue){let i=null,n=1/0;for(let c=0;c<t(this,l).length;c++){const m=Math.abs(t(this,l)[c].position-e);m<n&&(n=m,i=c)}return i!==null?t(this,l)[i]:null};customElements.get("e-scroll")||customElements.define("e-scroll",Mt);var Ft;class oe extends HTMLElement{constructor(){super(...arguments);s(this,Ft,null)}get scrollElement(){return t(this,Ft)}connectedCallback(){const e=fe.findParentElement(this,Mt);e instanceof Mt?h(this,Ft,e):console.error(this,"e-scroll not found")}}Ft=new WeakMap;var rt,E,W,U,qt,Dt,vt,Wt,Ut,$t;class ge extends oe{constructor(){super();s(this,rt,null);s(this,E,null);s(this,W,!1);s(this,U,0);s(this,qt,0);s(this,Dt,0);s(this,vt,()=>{h(this,W,this.offsetWidth>this.offsetHeight);const e=t(this,W)?this.offsetWidth:this.offsetHeight;h(this,U,e/((this.scrollElement.scrollSize+this.scrollElement.viewportSize)/e)),h(this,U,Math.max(t(this,U),30)),t(this,W)?(t(this,E).style.width=t(this,U)+"px",t(this,E).style.height="100%"):(t(this,E).style.width="100%",t(this,E).style.height=t(this,U)+"px"),h(this,qt,e-t(this,U)),this.scrollElement.scrollSize||(this.style.display="none")});s(this,Wt,()=>{h(this,Dt,this.scrollElement.currentProgress*t(this,qt)),t(this,W)?t(this,E).style.transform=`translate3d(${t(this,Dt)}px, 0px, 0px)`:t(this,E).style.transform=`translate3d(0px, ${t(this,Dt)}px, 0px)`});s(this,Ut,()=>{this.setAttribute("axis",this.scrollElement.axisCSSProperty.current)});s(this,$t,e=>{document.documentElement.classList.add("grabbing"),Te.setupDrag(c=>{const m=t(this,W)?c.x:c.y,w=this.scrollElement.distance/t(this,qt),Ct=(m-n)*w;this.scrollElement.setPosition(i+Ct)},()=>{document.documentElement.classList.remove("grabbing")});const i=this.scrollElement.damped.target,n=t(this,W)?e.x:e.y});if(Xt.isBrowser){const e=this.attachShadow({mode:"open"});e.adoptedStyleSheets.push(Se.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:"black",borderRadius:"0.3vmin",touchAction:"none"},"::slotted(*)":{touchAction:"none"}})),h(this,rt,document.createElement("slot")),t(this,rt).innerHTML='<div class="default-thumb"></div>',e.appendChild(t(this,rt))}}get thumbElement(){return t(this,E)}connectedCallback(){super.connectedCallback(),this.setAttribute("drag-dead-zone","");const e=t(this,rt).assignedElements()[0]||t(this,rt).firstElementChild;h(this,E,e),t(this,E).addEventListener("pointerdown",t(this,$t)),Jt.windowResizer.subscribe(t(this,vt),ee.RESIZE_ORDER.SCROLL),Qt.elementResizer.subscribe(this,t(this,vt)),this.scrollElement.onScroll(t(this,Wt)),this.scrollElement.axisCSSProperty.subscribe(t(this,Ut))}disconnectedCallback(){this.removeAttribute("drag-dead-zone"),t(this,E).removeEventListener("pointerdown",t(this,$t)),Jt.windowResizer.unsubscribe(t(this,vt)),Qt.elementResizer.unsubscribe(t(this,vt)),this.scrollElement.offScroll(t(this,Wt)),this.scrollElement.axisCSSProperty.unsubscribe(t(this,Ut))}}rt=new WeakMap,E=new WeakMap,W=new WeakMap,U=new WeakMap,qt=new WeakMap,Dt=new WeakMap,vt=new WeakMap,Wt=new WeakMap,Ut=new WeakMap,$t=new WeakMap;customElements.get("e-scrollbar")||customElements.define("e-scrollbar",ge);class be extends oe{constructor(){super(),Xt.isBrowser&&this.addEventListener("click",()=>{const r=this.getAttribute("behaviour"),e=this.getAttribute("easing")||void 0,i=e?parseFloat(this.getAttribute("duration")||"0"):void 0;this.handleClick({behaviour:r,tween:e?{easing:e,duration:i}:void 0})})}}class ye extends be{handleClick(r){const e=this.getAttribute("index");this.scrollElement.scrollToSection(parseInt(e||"0"),r)}}customElements.get("e-scroll-set-button")||customElements.define("e-scroll-set-button",ye);class ve extends be{handleClick(r){const e=this.getAttribute("step");this.scrollElement.shiftSections(parseInt(e||"1"),r)}}customElements.get("e-scroll-step-button")||customElements.define("e-scroll-step-button",ve);var $,nt,Tt,Nt,jt,At;class Ve{constructor(r,e,i){s(this,$,null);s(this,nt,null);s(this,Tt,null);s(this,Nt,null);s(this,jt,()=>{t(this,nt).scrollToSection(t(this,Tt),{behaviour:t(this,Nt)})});s(this,At,()=>{t(this,$).classList.toggle("current",t(this,nt).counter.current===t(this,Tt))});Xt.isBrowser&&(h(this,$,document.createElement("button")),h(this,nt,r),h(this,Nt,i),h(this,Tt,e),t(this,$).addEventListener("click",t(this,jt)),t(this,nt).counter.subscribe(t(this,At)),t(this,At).call(this))}get element(){return t(this,$)}destroy(){t(this,$).removeEventListener("click",t(this,jt)),t(this,nt).counter.unsubscribe(t(this,At)),t(this,$).remove()}}$=new WeakMap,nt=new WeakMap,Tt=new WeakMap,Nt=new WeakMap,jt=new WeakMap,At=new WeakMap;var ht,Rt;class Ce extends oe{constructor(){super(...arguments);s(this,ht,[]);s(this,Rt,Ae.debounce(()=>{t(this,ht).forEach(e=>e.destroy()),h(this,ht,[]);for(let e=0;e<this.scrollElement.sections.length;e++){const i=new Ve(this.scrollElement,e,this.getAttribute("behaviour")||"smooth");this.appendChild(i.element),t(this,ht).push(i)}},0))}connectedCallback(){super.connectedCallback(),this.scrollElement.addEventListener("sectionsChange",t(this,Rt)),t(this,Rt).call(this)}disconnectedCallback(){this.scrollElement.removeEventListener("sectionsChange",t(this,Rt)),t(this,ht).forEach(e=>e.destroy()),h(this,ht,[])}}ht=new WeakMap,Rt=new WeakMap;customElements.get("e-scroll-bullet-buttons")||customElements.define("e-scroll-bullet-buttons",Ce);class Pe extends Re.ScrollSegmentElement{connectedCallback(){const r=fe.findParentElement(this,Mt);r instanceof Mt?(this.scrollContainer=r,this.scrollContainer.addEventListener("scrollSectionsChange",this.findAnotherScrollEntries)):console.error(this,"e-scroll not found")}}customElements.get("e-scroll-segment")||customElements.define("e-scroll-segment",Pe);exports.ScrollBulletButtonsElement=Ce;exports.ScrollElement=Mt;exports.ScrollSegmentElement=Pe;exports.ScrollSetButtonElement=ye;exports.ScrollStepButtonElement=ve;exports.ScrollbarElement=ge;
|
|
@@ -23,8 +23,8 @@ import { a as Yt, g as te } from "../../layout-HoBT_Da2.js";
|
|
|
23
23
|
import { c as pe } from "../../math-BOBiC4TN.js";
|
|
24
24
|
import "../../ticker/vanilla/index.js";
|
|
25
25
|
import { TICK_ORDER as xe, RESIZE_ORDER as fe } from "../../order/index.js";
|
|
26
|
-
import { D as Pe } from "../../Damped-
|
|
27
|
-
import { T as Le } from "../../Tweened-
|
|
26
|
+
import { D as Pe } from "../../Damped-Chu29wn-.js";
|
|
27
|
+
import { T as Le } from "../../Tweened-B_ZFQKGQ.js";
|
|
28
28
|
import { WheelControls as ze, KeyboardControls as ke, DragControls as Ie, AutoplayControls as De } from "../../controls/index.js";
|
|
29
29
|
import { windowResizer as Zt } from "../../window-resizer/vanilla/index.js";
|
|
30
30
|
import { scrollEntries as lt } from "../../scroll-entries/index.js";
|
|
@@ -308,7 +308,7 @@ class Ot extends HTMLElement {
|
|
|
308
308
|
}
|
|
309
309
|
});
|
|
310
310
|
}, t(this, Q).current))), !(e.includes("drag") && !Ae.isMobile && !t(this, mt).current))
|
|
311
|
-
if (t(this, I).current && e
|
|
311
|
+
if (t(this, I).current && e !== "drag") {
|
|
312
312
|
const n = Math.sign(i);
|
|
313
313
|
t(this, l).length ? this.shiftSections(n, {
|
|
314
314
|
tween: t(this, K).current || t(this, _).current ? {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var ot=a=>{throw TypeError(a)};var rt=(a,f,r)=>f.has(a)||ot("Cannot "+r);var t=(a,f,r)=>(rt(a,f,"read from private field"),r?r.call(a):f.get(a)),i=(a,f,r)=>f.has(a)?ot("Cannot add the same private member more than once"):f instanceof WeakSet?f.add(a):f.set(a,r),e=(a,f,r,s)=>(rt(a,f,"write to private field"),s?s.call(a,r):f.set(a,r),r),c=(a,f,r)=>(rt(a,f,"access private method"),r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("../css-property/index.cjs"),ut=require("../order/index.cjs"),at=require("../window-resizer/vanilla/index.cjs"),U=require("../events-KVanG9sR.cjs"),wt=require("../function-MthRj-GJ.cjs"),lt=require("../layout-8ryRAMGJ.cjs"),Ft=require("../math-GDWEqu7y.cjs"),X=require("../Store-CDb6RMce.cjs"),Vt=require("../scroll-entries/index.cjs");require("../ticker/vanilla/index.cjs");const Et=require("../Damped-C3MyWa5_.cjs");var S,j,G,K,N,T,D,_,M,d,y,g,v,A,p,R,O,B,k,z,q,l,P,w,E,L,F,Y,n,$,W,tt,m,H,C,b,V,J,I,u,h,ft,it,ht,dt,mt,bt,Ct,yt,gt,st,Q,Z,vt,Pt,nt,St;let pt=(St=class extends HTMLElement{constructor(){super();i(this,h);i(this,S);i(this,j);i(this,G);i(this,K);i(this,N);i(this,T);i(this,D);i(this,_);i(this,M);i(this,d);i(this,y);i(this,g);i(this,v);i(this,A);i(this,p);i(this,R);i(this,O);i(this,B);i(this,k);i(this,z);i(this,q);i(this,l);i(this,P);i(this,w);i(this,E);i(this,L);i(this,F);i(this,Y);i(this,n);i(this,$);i(this,W);i(this,tt);i(this,m);i(this,H);i(this,C);i(this,b);i(this,V);i(this,J);i(this,I);i(this,u);i(this,st);i(this,Q);e(this,S,null),e(this,j,new o.CSSProperty(this,"--damping",20)),e(this,G,new o.CSSProperty(this,"--mass",0)),e(this,K,new o.CSSProperty(this,"--stiffness",0)),e(this,N,new o.CSSProperty(this,"--target","")),e(this,T,new o.CSSProperty(this,"--disabled",!1)),e(this,D,new o.CSSProperty(this,"--distance-offset",0,{rawValueCheck:!1})),e(this,_,new o.CSSProperty(this,"--start-offset",0,{rawValueCheck:!1})),e(this,M,new o.CSSProperty(this,"--capture-once",!1)),e(this,d,new o.CSSProperty(this,"--captured","")),e(this,y,new o.CSSProperty(this,"--released","")),e(this,g,new o.CSSProperty(this,"--captured-from-start","")),e(this,v,new o.CSSProperty(this,"--captured-from-finish","")),e(this,A,new o.CSSProperty(this,"--released-from-start","")),e(this,p,new o.CSSProperty(this,"--released-from-finish","")),e(this,R,new o.CSSProperty(this,"--passed-var","")),e(this,O,new o.CSSProperty(this,"--progress-var","")),e(this,B,new o.CSSProperty(this,"--animation-var-type","current")),e(this,k,new o.CSSProperty(this,"--distance-var","")),e(this,z,new o.CSSProperty(this,"--start-var","")),e(this,q,new o.CSSProperty(this,"--finish-var","")),e(this,l,new X.Store(!1)),e(this,P,new X.Store(!1)),e(this,w,new X.Store(!1)),e(this,E,new X.Store(!1)),e(this,L,new X.Store(!1)),e(this,F,new X.Store(!1)),e(this,Y,[]),e(this,n,this),e(this,$,0),e(this,W,0),e(this,tt,0),e(this,m,new Et.Damped(0,{order:ut.TICK_ORDER.SEGMENT,min:0,max:1})),e(this,H,0),e(this,C,0),e(this,b,0),e(this,V,0),e(this,J,!1),e(this,I,!1),e(this,u,!0),this.findAnotherScrollEntries=wt.debounce(()=>{const r=Vt.scrollEntries.getAll(this).reverse();let s=0;r.forEach((x,et)=>{x.element===t(this,S)&&(s=et)}),e(this,Y,r.slice(s+1))},0),e(this,st,()=>{t(this,u)||(this.resize(),t(this,Q).call(this))}),e(this,Q,()=>{!t(this,u)&&t(this,J)&&this.tick()})}get scrollContainer(){return t(this,S)}set scrollContainer(r){c(this,h,ht).call(this),e(this,S,r),c(this,h,it).call(this)}get distanceOffsetCSSProperty(){return t(this,D)}get startOffsetCSSProperty(){return t(this,_)}get captureOnceCSSProperty(){return t(this,M)}get capturedCSSProperty(){return t(this,d)}get releasedCSSProperty(){return t(this,y)}get capturedFromStartCSSProperty(){return t(this,g)}get capturedFromFinishCSSProperty(){return t(this,v)}get releasedFromStartCSSProperty(){return t(this,A)}get releasedFromFinishCSSProperty(){return t(this,p)}get passedVarCSSProperty(){return t(this,R)}get progressVarCSSProperty(){return t(this,O)}get animationVarTypeCSSProperty(){return t(this,B)}get distanceVarCSSProperty(){return t(this,k)}get startVarCSSProperty(){return t(this,z)}get finishVarCSSProperty(){return t(this,q)}get disabledCSSProperty(){return t(this,T)}get dampingCSSProperty(){return t(this,j)}get massCSSProperty(){return t(this,G)}get stiffnessCSSProperty(){return t(this,K)}get targetCSSProperty(){return t(this,N)}get isCaptured(){return t(this,l)}get isReleased(){return t(this,P)}get isCapturedFromStart(){return t(this,w)}get isReleasedFromStart(){return t(this,E)}get isCapturedFromFinish(){return t(this,L)}get isReleasedFromFinish(){return t(this,F)}get directionPosition(){return t(this,$)}get directionSize(){return t(this,W)}get passed(){return t(this,m)}get progress(){return t(this,H)}get start(){return t(this,C)}get finish(){return t(this,V)}get distance(){return t(this,b)}get isCapturedOnce(){return t(this,I)}get isDisabled(){return t(this,u)}resize(){e(this,W,t(this,S).vertical?this.offsetHeight:this.offsetWidth);const r=t(this,S)instanceof HTMLElement?t(this,S):t(this,S).element;e(this,$,t(this,S).vertical?lt.getCumulativeOffsetTop(this,r):lt.getCumulativeOffsetLeft(this,r));const x=c(this,h,ft).call(this).reduce((et,ct)=>et+(t(this,S).vertical?ct.offsetTop:ct.offsetLeft),0);e(this,$,t(this,$)-x),e(this,C,this.getStart()),e(this,b,this.getDistance()),e(this,C,t(this,C)+t(this,_).current),e(this,b,t(this,b)+t(this,D).current),e(this,V,t(this,C)+t(this,b)),t(this,S).currentScrollValue>t(this,V)&&!t(this,l).current&&!t(this,P).current&&(t(this,l).current=!0),this.setVar(t(this,z).current,t(this,C)),this.setVar(t(this,q).current,t(this,V)),this.setVar(t(this,k).current,t(this,b)),t(this,m).max=t(this,b),e(this,J,!0)}tick(){let r=t(this,S).currentScrollValue;t(this,Y).forEach(x=>{r+=x.value}),t(this,m).set(r-t(this,C));const s=Math.round(r);t(this,l).current&&(s>=t(this,C)?t(this,w).current||c(this,h,bt).call(this):t(this,w).current&&!t(this,E).current&&c(this,h,yt).call(this),s<t(this,V)?t(this,F).current&&!t(this,L).current&&c(this,h,Ct).call(this):t(this,w).current&&!t(this,F).current&&c(this,h,gt).call(this)),s>=t(this,C)&&s<t(this,V)?t(this,l).current||c(this,h,dt).call(this):t(this,l).current&&(t(this,m).set(Ft.step(t(this,b)/2,t(this,m).target,0,t(this,b))),c(this,h,mt).call(this)),t(this,I)&&t(this,M).current&&(t(this,d).current&&t(this,n).classList.add(t(this,d).current),e(this,u,!0))}disable(){this.style.cssText="",e(this,$,0),e(this,W,0),t(this,m).reset(),e(this,H,0),e(this,C,0),e(this,b,0),e(this,V,0),e(this,J,!1),t(this,l).current=!1,t(this,P).current=!1,t(this,w).current=!1,t(this,E).current=!1,t(this,L).current=!1,t(this,F).current=!1,e(this,I,!1),e(this,u,!0),c(this,h,nt).call(this)}enable(){e(this,u,!1)}connectedCallback(){c(this,h,it).call(this)}disconnectedCallback(){c(this,h,ht).call(this)}removeVar(r){r&&t(this,n).style.removeProperty(`--${r}`)}setVar(r,s){r&&t(this,n).style.setProperty(`--${r}`,s.toString())}getDistance(){return t(this,W)+t(this,tt)}getStart(){return t(this,$)-t(this,tt)}},S=new WeakMap,j=new WeakMap,G=new WeakMap,K=new WeakMap,N=new WeakMap,T=new WeakMap,D=new WeakMap,_=new WeakMap,M=new WeakMap,d=new WeakMap,y=new WeakMap,g=new WeakMap,v=new WeakMap,A=new WeakMap,p=new WeakMap,R=new WeakMap,O=new WeakMap,B=new WeakMap,k=new WeakMap,z=new WeakMap,q=new WeakMap,l=new WeakMap,P=new WeakMap,w=new WeakMap,E=new WeakMap,L=new WeakMap,F=new WeakMap,Y=new WeakMap,n=new WeakMap,$=new WeakMap,W=new WeakMap,tt=new WeakMap,m=new WeakMap,H=new WeakMap,C=new WeakMap,b=new WeakMap,V=new WeakMap,J=new WeakMap,I=new WeakMap,u=new WeakMap,h=new WeakSet,ft=function(){const r=[];let s=this.parentElement;for(;s;)window.getComputedStyle(s).position==="sticky"&&r.push(s),s=s.parentElement;return r},it=function(){if(!t(this,S))return;t(this,l).subscribe(s=>{s.current&&U.dispatchEvent(this,"scrollSegmentCapture",{composed:!0,custom:!0})}),t(this,w).subscribe(s=>{s.current&&U.dispatchEvent(this,"scrollSegmentCaptureFromStart",{composed:!0,custom:!0})}),t(this,L).subscribe(s=>{s.current&&U.dispatchEvent(this,"scrollSegmentCaptureFromFinish",{composed:!0,custom:!0})}),t(this,P).subscribe(s=>{s.current&&U.dispatchEvent(this,"scrollSegmentRelease",{composed:!0,custom:!0})}),t(this,E).subscribe(s=>{s.current&&U.dispatchEvent(this,"scrollSegmentReleaseFromStart",{composed:!0,custom:!0})}),t(this,F).subscribe(s=>{s.current&&U.dispatchEvent(this,"scrollSegmentReleaseFromFinish",{composed:!0,custom:!0})}),t(this,j).observe(),t(this,G).observe(),t(this,K).observe(),t(this,N).observe(),t(this,T).observe(),t(this,D).observe(),t(this,_).observe(),t(this,M).observe(),t(this,d).observe(),t(this,y).observe(),t(this,g).observe(),t(this,v).observe(),t(this,A).observe(),t(this,p).observe(),t(this,R).observe(),t(this,O).observe(),t(this,B).observe(),t(this,k).observe(),t(this,z).observe(),t(this,q).observe();let r=!1;this.findAnotherScrollEntries(),t(this,T).current||this.enable(),t(this,j).subscribe(s=>{t(this,m).damping=s.current}),t(this,G).subscribe(s=>{t(this,m).mass=s.current}),t(this,K).subscribe(s=>{t(this,m).stiffness=s.current}),t(this,N).subscribe(s=>{s.previous&&c(this,h,nt).call(this),s.current?s.current==="parent"?e(this,n,this.parentElement||this):e(this,n,document.querySelector(s.current)||this):e(this,n,this)}),t(this,T).subscribe(s=>{s.current&&!s.previous?this.disable():!s.current&&s.previous&&(this.resize(),this.enable())}),t(this,_).subscribe(()=>{r&&!t(this,u)&&this.resize()}),t(this,D).subscribe(()=>{r&&!t(this,u)&&this.resize()}),t(this,d).subscribe(s=>{c(this,h,Z).call(this,s)}),t(this,g).subscribe(s=>{c(this,h,Z).call(this,s)}),t(this,v).subscribe(s=>{c(this,h,Z).call(this,s)}),t(this,y).subscribe(s=>{c(this,h,Z).call(this,s)}),t(this,A).subscribe(s=>{c(this,h,Z).call(this,s)}),t(this,p).subscribe(s=>{c(this,h,Z).call(this,s)}),t(this,M).subscribe(s=>{t(this,u)||!s.current&&s.previous&&(this.resize(),this.enable())}),t(this,R).subscribe(s=>{t(this,u)||(this.removeVar(s.previous),this.setVar(s.current,this.passed.current))}),t(this,O).subscribe(s=>{t(this,u)||(this.removeVar(s.previous),this.setVar(s.current,t(this,H)))}),t(this,z).subscribe(s=>{t(this,u)||(this.removeVar(s.previous),this.setVar(s.current,t(this,C)))}),t(this,q).subscribe(s=>{t(this,u)||(this.removeVar(s.previous),this.setVar(s.current,t(this,V)))}),t(this,k).subscribe(s=>{t(this,u)||(this.removeVar(s.previous),this.setVar(s.current,t(this,b)))}),t(this,m).subscribe(s=>{const x=t(this,m)[t(this,B).current];e(this,H,x/t(this,b)||0),this.setVar(t(this,R).current,x.toFixed(6)),this.setVar(t(this,O).current,t(this,H).toFixed(6))}),at.windowResizer.subscribe(t(this,st),ut.RESIZE_ORDER.SCROLL),this.scrollContainer.onScroll(t(this,Q)),r=!0},ht=function(){t(this,S)&&(at.windowResizer.unsubscribe(t(this,st)),this.scrollContainer.offScroll(t(this,Q)),t(this,j).close(),t(this,G).close(),t(this,K).close(),t(this,N).close(),t(this,T).close(),t(this,D).close(),t(this,_).close(),t(this,M).close(),t(this,d).close(),t(this,y).close(),t(this,g).close(),t(this,v).close(),t(this,A).close(),t(this,p).close(),t(this,R).close(),t(this,O).close(),t(this,k).close(),t(this,z).close(),t(this,q).close(),t(this,l).close(),t(this,P).close(),t(this,w).close(),t(this,E).close(),t(this,L).close(),t(this,F).close(),this.disable())},dt=function(){t(this,l).current=!0,t(this,P).current=!1,e(this,I,!0),t(this,y).current&&t(this,n).classList.remove(t(this,y).current),t(this,p).current&&t(this,n).classList.remove(t(this,p).current),t(this,p).current&&t(this,n).classList.remove(t(this,p).current),t(this,d).current&&t(this,n).classList.add(t(this,d).current)},mt=function(){t(this,P).current=!0,t(this,l).current=!1,e(this,I,!0),t(this,d).current&&t(this,n).classList.remove(t(this,d).current),t(this,g).current&&t(this,n).classList.remove(t(this,g).current),t(this,v).current&&t(this,n).classList.remove(t(this,v).current),t(this,y).current&&t(this,n).classList.add(t(this,y).current)},bt=function(){t(this,l).current=!0,t(this,w).current=!0,t(this,E).current=!1,t(this,g).current&&t(this,n).classList.add(t(this,g).current)},Ct=function(){t(this,l).current=!0,t(this,L).current=!0,t(this,F).current=!1,t(this,v).current&&t(this,n).classList.add(t(this,v).current)},yt=function(){t(this,P).current=!0,t(this,E).current=!0,t(this,w).current=!1,t(this,p).current&&t(this,n).classList.add(t(this,p).current)},gt=function(){t(this,P).current=!0,t(this,F).current=!0,t(this,L).current=!1,t(this,p).current&&t(this,n).classList.add(t(this,p).current)},st=new WeakMap,Q=new WeakMap,Z=function(r){if(t(this,u)){r.previous&&t(this,n).classList.remove(r.previous),r.current&&t(this,n).classList.remove(r.current);return}r.current&&t(this,l).current?(r.previous&&t(this,n).classList.remove(r.previous),t(this,n).classList.add(r.current)):!r.current&&r.previous&&t(this,n).classList.remove(r.previous)},vt=function(...r){r.forEach(s=>{s&&t(this,n).classList.remove(s)})},Pt=function(...r){r.forEach(s=>{s&&t(this,n).style.removeProperty(`--${s}`)})},nt=function(){c(this,h,vt).call(this,t(this,d).current,t(this,g).current,t(this,v).current,t(this,y).current,t(this,A).current,t(this,p).current),c(this,h,Pt).call(this,t(this,R).current,t(this,O).current,t(this,k).current,t(this,z).current,t(this,q).current)},St);customElements.get("scroll-segment")||customElements.define("scroll-segment",pt);exports.ScrollSegmentElement=pt;
|
|
1
|
+
"use strict";var ot=a=>{throw TypeError(a)};var rt=(a,f,r)=>f.has(a)||ot("Cannot "+r);var t=(a,f,r)=>(rt(a,f,"read from private field"),r?r.call(a):f.get(a)),i=(a,f,r)=>f.has(a)?ot("Cannot add the same private member more than once"):f instanceof WeakSet?f.add(a):f.set(a,r),e=(a,f,r,s)=>(rt(a,f,"write to private field"),s?s.call(a,r):f.set(a,r),r),c=(a,f,r)=>(rt(a,f,"access private method"),r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("../css-property/index.cjs"),ut=require("../order/index.cjs"),at=require("../window-resizer/vanilla/index.cjs"),U=require("../events-KVanG9sR.cjs"),wt=require("../function-MthRj-GJ.cjs"),lt=require("../layout-8ryRAMGJ.cjs"),Ft=require("../math-GDWEqu7y.cjs"),X=require("../Store-CDb6RMce.cjs"),Vt=require("../scroll-entries/index.cjs");require("../ticker/vanilla/index.cjs");const Et=require("../Damped-CTsV8tl_.cjs");var S,j,G,K,N,T,D,_,M,d,y,g,v,A,p,R,O,B,k,z,q,l,P,w,E,L,F,Y,n,$,W,tt,m,H,C,b,V,J,I,u,h,ft,it,ht,dt,mt,bt,Ct,yt,gt,st,Q,Z,vt,Pt,nt,St;let pt=(St=class extends HTMLElement{constructor(){super();i(this,h);i(this,S);i(this,j);i(this,G);i(this,K);i(this,N);i(this,T);i(this,D);i(this,_);i(this,M);i(this,d);i(this,y);i(this,g);i(this,v);i(this,A);i(this,p);i(this,R);i(this,O);i(this,B);i(this,k);i(this,z);i(this,q);i(this,l);i(this,P);i(this,w);i(this,E);i(this,L);i(this,F);i(this,Y);i(this,n);i(this,$);i(this,W);i(this,tt);i(this,m);i(this,H);i(this,C);i(this,b);i(this,V);i(this,J);i(this,I);i(this,u);i(this,st);i(this,Q);e(this,S,null),e(this,j,new o.CSSProperty(this,"--damping",20)),e(this,G,new o.CSSProperty(this,"--mass",0)),e(this,K,new o.CSSProperty(this,"--stiffness",0)),e(this,N,new o.CSSProperty(this,"--target","")),e(this,T,new o.CSSProperty(this,"--disabled",!1)),e(this,D,new o.CSSProperty(this,"--distance-offset",0,{rawValueCheck:!1})),e(this,_,new o.CSSProperty(this,"--start-offset",0,{rawValueCheck:!1})),e(this,M,new o.CSSProperty(this,"--capture-once",!1)),e(this,d,new o.CSSProperty(this,"--captured","")),e(this,y,new o.CSSProperty(this,"--released","")),e(this,g,new o.CSSProperty(this,"--captured-from-start","")),e(this,v,new o.CSSProperty(this,"--captured-from-finish","")),e(this,A,new o.CSSProperty(this,"--released-from-start","")),e(this,p,new o.CSSProperty(this,"--released-from-finish","")),e(this,R,new o.CSSProperty(this,"--passed-var","")),e(this,O,new o.CSSProperty(this,"--progress-var","")),e(this,B,new o.CSSProperty(this,"--animation-var-type","current")),e(this,k,new o.CSSProperty(this,"--distance-var","")),e(this,z,new o.CSSProperty(this,"--start-var","")),e(this,q,new o.CSSProperty(this,"--finish-var","")),e(this,l,new X.Store(!1)),e(this,P,new X.Store(!1)),e(this,w,new X.Store(!1)),e(this,E,new X.Store(!1)),e(this,L,new X.Store(!1)),e(this,F,new X.Store(!1)),e(this,Y,[]),e(this,n,this),e(this,$,0),e(this,W,0),e(this,tt,0),e(this,m,new Et.Damped(0,{order:ut.TICK_ORDER.SEGMENT,min:0,max:1})),e(this,H,0),e(this,C,0),e(this,b,0),e(this,V,0),e(this,J,!1),e(this,I,!1),e(this,u,!0),this.findAnotherScrollEntries=wt.debounce(()=>{const r=Vt.scrollEntries.getAll(this).reverse();let s=0;r.forEach((x,et)=>{x.element===t(this,S)&&(s=et)}),e(this,Y,r.slice(s+1))},0),e(this,st,()=>{t(this,u)||(this.resize(),t(this,Q).call(this))}),e(this,Q,()=>{!t(this,u)&&t(this,J)&&this.tick()})}get scrollContainer(){return t(this,S)}set scrollContainer(r){c(this,h,ht).call(this),e(this,S,r),c(this,h,it).call(this)}get distanceOffsetCSSProperty(){return t(this,D)}get startOffsetCSSProperty(){return t(this,_)}get captureOnceCSSProperty(){return t(this,M)}get capturedCSSProperty(){return t(this,d)}get releasedCSSProperty(){return t(this,y)}get capturedFromStartCSSProperty(){return t(this,g)}get capturedFromFinishCSSProperty(){return t(this,v)}get releasedFromStartCSSProperty(){return t(this,A)}get releasedFromFinishCSSProperty(){return t(this,p)}get passedVarCSSProperty(){return t(this,R)}get progressVarCSSProperty(){return t(this,O)}get animationVarTypeCSSProperty(){return t(this,B)}get distanceVarCSSProperty(){return t(this,k)}get startVarCSSProperty(){return t(this,z)}get finishVarCSSProperty(){return t(this,q)}get disabledCSSProperty(){return t(this,T)}get dampingCSSProperty(){return t(this,j)}get massCSSProperty(){return t(this,G)}get stiffnessCSSProperty(){return t(this,K)}get targetCSSProperty(){return t(this,N)}get isCaptured(){return t(this,l)}get isReleased(){return t(this,P)}get isCapturedFromStart(){return t(this,w)}get isReleasedFromStart(){return t(this,E)}get isCapturedFromFinish(){return t(this,L)}get isReleasedFromFinish(){return t(this,F)}get directionPosition(){return t(this,$)}get directionSize(){return t(this,W)}get passed(){return t(this,m)}get progress(){return t(this,H)}get start(){return t(this,C)}get finish(){return t(this,V)}get distance(){return t(this,b)}get isCapturedOnce(){return t(this,I)}get isDisabled(){return t(this,u)}resize(){e(this,W,t(this,S).vertical?this.offsetHeight:this.offsetWidth);const r=t(this,S)instanceof HTMLElement?t(this,S):t(this,S).element;e(this,$,t(this,S).vertical?lt.getCumulativeOffsetTop(this,r):lt.getCumulativeOffsetLeft(this,r));const x=c(this,h,ft).call(this).reduce((et,ct)=>et+(t(this,S).vertical?ct.offsetTop:ct.offsetLeft),0);e(this,$,t(this,$)-x),e(this,C,this.getStart()),e(this,b,this.getDistance()),e(this,C,t(this,C)+t(this,_).current),e(this,b,t(this,b)+t(this,D).current),e(this,V,t(this,C)+t(this,b)),t(this,S).currentScrollValue>t(this,V)&&!t(this,l).current&&!t(this,P).current&&(t(this,l).current=!0),this.setVar(t(this,z).current,t(this,C)),this.setVar(t(this,q).current,t(this,V)),this.setVar(t(this,k).current,t(this,b)),t(this,m).max=t(this,b),e(this,J,!0)}tick(){let r=t(this,S).currentScrollValue;t(this,Y).forEach(x=>{r+=x.value}),t(this,m).set(r-t(this,C));const s=Math.round(r);t(this,l).current&&(s>=t(this,C)?t(this,w).current||c(this,h,bt).call(this):t(this,w).current&&!t(this,E).current&&c(this,h,yt).call(this),s<t(this,V)?t(this,F).current&&!t(this,L).current&&c(this,h,Ct).call(this):t(this,w).current&&!t(this,F).current&&c(this,h,gt).call(this)),s>=t(this,C)&&s<t(this,V)?t(this,l).current||c(this,h,dt).call(this):t(this,l).current&&(t(this,m).set(Ft.step(t(this,b)/2,t(this,m).target,0,t(this,b))),c(this,h,mt).call(this)),t(this,I)&&t(this,M).current&&(t(this,d).current&&t(this,n).classList.add(t(this,d).current),e(this,u,!0))}disable(){this.style.cssText="",e(this,$,0),e(this,W,0),t(this,m).reset(),e(this,H,0),e(this,C,0),e(this,b,0),e(this,V,0),e(this,J,!1),t(this,l).current=!1,t(this,P).current=!1,t(this,w).current=!1,t(this,E).current=!1,t(this,L).current=!1,t(this,F).current=!1,e(this,I,!1),e(this,u,!0),c(this,h,nt).call(this)}enable(){e(this,u,!1)}connectedCallback(){c(this,h,it).call(this)}disconnectedCallback(){c(this,h,ht).call(this)}removeVar(r){r&&t(this,n).style.removeProperty(`--${r}`)}setVar(r,s){r&&t(this,n).style.setProperty(`--${r}`,s.toString())}getDistance(){return t(this,W)+t(this,tt)}getStart(){return t(this,$)-t(this,tt)}},S=new WeakMap,j=new WeakMap,G=new WeakMap,K=new WeakMap,N=new WeakMap,T=new WeakMap,D=new WeakMap,_=new WeakMap,M=new WeakMap,d=new WeakMap,y=new WeakMap,g=new WeakMap,v=new WeakMap,A=new WeakMap,p=new WeakMap,R=new WeakMap,O=new WeakMap,B=new WeakMap,k=new WeakMap,z=new WeakMap,q=new WeakMap,l=new WeakMap,P=new WeakMap,w=new WeakMap,E=new WeakMap,L=new WeakMap,F=new WeakMap,Y=new WeakMap,n=new WeakMap,$=new WeakMap,W=new WeakMap,tt=new WeakMap,m=new WeakMap,H=new WeakMap,C=new WeakMap,b=new WeakMap,V=new WeakMap,J=new WeakMap,I=new WeakMap,u=new WeakMap,h=new WeakSet,ft=function(){const r=[];let s=this.parentElement;for(;s;)window.getComputedStyle(s).position==="sticky"&&r.push(s),s=s.parentElement;return r},it=function(){if(!t(this,S))return;t(this,l).subscribe(s=>{s.current&&U.dispatchEvent(this,"scrollSegmentCapture",{composed:!0,custom:!0})}),t(this,w).subscribe(s=>{s.current&&U.dispatchEvent(this,"scrollSegmentCaptureFromStart",{composed:!0,custom:!0})}),t(this,L).subscribe(s=>{s.current&&U.dispatchEvent(this,"scrollSegmentCaptureFromFinish",{composed:!0,custom:!0})}),t(this,P).subscribe(s=>{s.current&&U.dispatchEvent(this,"scrollSegmentRelease",{composed:!0,custom:!0})}),t(this,E).subscribe(s=>{s.current&&U.dispatchEvent(this,"scrollSegmentReleaseFromStart",{composed:!0,custom:!0})}),t(this,F).subscribe(s=>{s.current&&U.dispatchEvent(this,"scrollSegmentReleaseFromFinish",{composed:!0,custom:!0})}),t(this,j).observe(),t(this,G).observe(),t(this,K).observe(),t(this,N).observe(),t(this,T).observe(),t(this,D).observe(),t(this,_).observe(),t(this,M).observe(),t(this,d).observe(),t(this,y).observe(),t(this,g).observe(),t(this,v).observe(),t(this,A).observe(),t(this,p).observe(),t(this,R).observe(),t(this,O).observe(),t(this,B).observe(),t(this,k).observe(),t(this,z).observe(),t(this,q).observe();let r=!1;this.findAnotherScrollEntries(),t(this,T).current||this.enable(),t(this,j).subscribe(s=>{t(this,m).damping=s.current}),t(this,G).subscribe(s=>{t(this,m).mass=s.current}),t(this,K).subscribe(s=>{t(this,m).stiffness=s.current}),t(this,N).subscribe(s=>{s.previous&&c(this,h,nt).call(this),s.current?s.current==="parent"?e(this,n,this.parentElement||this):e(this,n,document.querySelector(s.current)||this):e(this,n,this)}),t(this,T).subscribe(s=>{s.current&&!s.previous?this.disable():!s.current&&s.previous&&(this.resize(),this.enable())}),t(this,_).subscribe(()=>{r&&!t(this,u)&&this.resize()}),t(this,D).subscribe(()=>{r&&!t(this,u)&&this.resize()}),t(this,d).subscribe(s=>{c(this,h,Z).call(this,s)}),t(this,g).subscribe(s=>{c(this,h,Z).call(this,s)}),t(this,v).subscribe(s=>{c(this,h,Z).call(this,s)}),t(this,y).subscribe(s=>{c(this,h,Z).call(this,s)}),t(this,A).subscribe(s=>{c(this,h,Z).call(this,s)}),t(this,p).subscribe(s=>{c(this,h,Z).call(this,s)}),t(this,M).subscribe(s=>{t(this,u)||!s.current&&s.previous&&(this.resize(),this.enable())}),t(this,R).subscribe(s=>{t(this,u)||(this.removeVar(s.previous),this.setVar(s.current,this.passed.current))}),t(this,O).subscribe(s=>{t(this,u)||(this.removeVar(s.previous),this.setVar(s.current,t(this,H)))}),t(this,z).subscribe(s=>{t(this,u)||(this.removeVar(s.previous),this.setVar(s.current,t(this,C)))}),t(this,q).subscribe(s=>{t(this,u)||(this.removeVar(s.previous),this.setVar(s.current,t(this,V)))}),t(this,k).subscribe(s=>{t(this,u)||(this.removeVar(s.previous),this.setVar(s.current,t(this,b)))}),t(this,m).subscribe(s=>{const x=t(this,m)[t(this,B).current];e(this,H,x/t(this,b)||0),this.setVar(t(this,R).current,x.toFixed(6)),this.setVar(t(this,O).current,t(this,H).toFixed(6))}),at.windowResizer.subscribe(t(this,st),ut.RESIZE_ORDER.SCROLL),this.scrollContainer.onScroll(t(this,Q)),r=!0},ht=function(){t(this,S)&&(at.windowResizer.unsubscribe(t(this,st)),this.scrollContainer.offScroll(t(this,Q)),t(this,j).close(),t(this,G).close(),t(this,K).close(),t(this,N).close(),t(this,T).close(),t(this,D).close(),t(this,_).close(),t(this,M).close(),t(this,d).close(),t(this,y).close(),t(this,g).close(),t(this,v).close(),t(this,A).close(),t(this,p).close(),t(this,R).close(),t(this,O).close(),t(this,k).close(),t(this,z).close(),t(this,q).close(),t(this,l).close(),t(this,P).close(),t(this,w).close(),t(this,E).close(),t(this,L).close(),t(this,F).close(),this.disable())},dt=function(){t(this,l).current=!0,t(this,P).current=!1,e(this,I,!0),t(this,y).current&&t(this,n).classList.remove(t(this,y).current),t(this,p).current&&t(this,n).classList.remove(t(this,p).current),t(this,p).current&&t(this,n).classList.remove(t(this,p).current),t(this,d).current&&t(this,n).classList.add(t(this,d).current)},mt=function(){t(this,P).current=!0,t(this,l).current=!1,e(this,I,!0),t(this,d).current&&t(this,n).classList.remove(t(this,d).current),t(this,g).current&&t(this,n).classList.remove(t(this,g).current),t(this,v).current&&t(this,n).classList.remove(t(this,v).current),t(this,y).current&&t(this,n).classList.add(t(this,y).current)},bt=function(){t(this,l).current=!0,t(this,w).current=!0,t(this,E).current=!1,t(this,g).current&&t(this,n).classList.add(t(this,g).current)},Ct=function(){t(this,l).current=!0,t(this,L).current=!0,t(this,F).current=!1,t(this,v).current&&t(this,n).classList.add(t(this,v).current)},yt=function(){t(this,P).current=!0,t(this,E).current=!0,t(this,w).current=!1,t(this,p).current&&t(this,n).classList.add(t(this,p).current)},gt=function(){t(this,P).current=!0,t(this,F).current=!0,t(this,L).current=!1,t(this,p).current&&t(this,n).classList.add(t(this,p).current)},st=new WeakMap,Q=new WeakMap,Z=function(r){if(t(this,u)){r.previous&&t(this,n).classList.remove(r.previous),r.current&&t(this,n).classList.remove(r.current);return}r.current&&t(this,l).current?(r.previous&&t(this,n).classList.remove(r.previous),t(this,n).classList.add(r.current)):!r.current&&r.previous&&t(this,n).classList.remove(r.previous)},vt=function(...r){r.forEach(s=>{s&&t(this,n).classList.remove(s)})},Pt=function(...r){r.forEach(s=>{s&&t(this,n).style.removeProperty(`--${s}`)})},nt=function(){c(this,h,vt).call(this,t(this,d).current,t(this,g).current,t(this,v).current,t(this,y).current,t(this,A).current,t(this,p).current),c(this,h,Pt).call(this,t(this,R).current,t(this,O).current,t(this,k).current,t(this,z).current,t(this,q).current)},St);customElements.get("scroll-segment")||customElements.define("scroll-segment",pt);exports.ScrollSegmentElement=pt;
|
|
@@ -13,7 +13,7 @@ import { s as wt } from "../math-BOBiC4TN.js";
|
|
|
13
13
|
import { S as X } from "../Store-OTdcl6SX.js";
|
|
14
14
|
import { scrollEntries as Lt } from "../scroll-entries/index.js";
|
|
15
15
|
import "../ticker/vanilla/index.js";
|
|
16
|
-
import { D as Et } from "../Damped-
|
|
16
|
+
import { D as Et } from "../Damped-Chu29wn-.js";
|
|
17
17
|
var f, G, K, N, W, x, M, A, $, m, C, v, y, H, p, R, k, B, O, z, D, l, P, F, L, E, V, Y, n, I, Z, tt, d, _, g, b, w, J, q, u, h, lt, it, ht, ft, pt, St, mt, dt, bt, st, Q, j, gt, Ct, nt, at;
|
|
18
18
|
let Rt = (at = class extends HTMLElement {
|
|
19
19
|
constructor() {
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var C=i=>{throw TypeError(i)};var S=(i,r,t)=>r.has(i)||C("Cannot "+t);var e=(i,r,t)=>(S(i,r,"read from private field"),t?t.call(i):r.get(i)),a=(i,r,t)=>r.has(i)?C("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(i):r.set(i,t),h=(i,r,t,n)=>(S(i,r,"write to private field"),n?n.call(i,t):r.set(i,t),t),M=(i,r,t)=>(S(i,r,"access private method"),t);const I=require("./Store-CDb6RMce.cjs"),z=require("./math-GDWEqu7y.cjs"),m=require("./polyfills-CM4SCDTt.cjs"),P=require("./ticker/vanilla/index.cjs"),N=require("./order/index.cjs");var f,b,x,c,A,s,u,l,g,d,q,y,F;class O extends I.Store{constructor(t,n){super(t||0,n);a(this,q);a(this,f);a(this,b,N.TICK_ORDER.ANIMATION);a(this,x);a(this,c,new I.Store(!1));a(this,A,0);a(this,s,0);a(this,u,-1/0);a(this,l,1/0);a(this,g,0);a(this,d,null);a(this,F,t=>{this.handleAnimationFrame(t)});h(this,s,this.current)}get direction(){return e(this,A)}get target(){return e(this,s)}get min(){return e(this,u)}set min(t){h(this,u,t),this.set(e(this,s),{equalize:!0})}get max(){return e(this,l)}set max(t){h(this,l,t),this.set(e(this,s),{equalize:!0})}get from(){return e(this,g)}get isRunning(){return e(this,c)}get delta(){return Math.abs(e(this,s)-e(this,g))}get deltaProgress(){return this.delta?m.preciseNumber(Math.abs(this.current-e(this,g))/this.delta,6):0}get distance(){return Math.abs(e(this,l)-e(this,u))}get distanceProgress(){return this.distance?m.preciseNumber(Math.abs(this.current-e(this,u))/this.distance,6):0}set(t,n){(e(this,s)!==t||n!=null&&n.restart)&&(h(this,d,t),this.updateOptions(n),h(this,d,null),e(this,s)!==this.current&&this.start())}shift(t,n){this.set(e(this,s)+t,n)}reset(){super.reset(),this.set(this.initial,{equalize:!0})}close(){super.close(),this.reset(),this.unlistenAnimationFrame()}listenAnimationFrame(){e(this,c).current||(e(this,c).current=!0,P.ticker.subscribe(e(this,F),{maxFPS:e(this,f),order:e(this,b),culling:e(this,x)}))}unlistenAnimationFrame(){e(this,c).current&&(e(this,c).current=!1,P.ticker.unsubscribe(e(this,F)))}updateOptions(t){h(this,f,m.nullishCoalescing(t==null?void 0:t.maxFPS,e(this,f))),h(this,b,m.nullishCoalescing(t==null?void 0:t.order,e(this,b))),h(this,x,m.nullishCoalescing(t==null?void 0:t.culling,e(this,x))),h(this,u,m.nullishCoalescing(t==null?void 0:t.min,e(this,u))),h(this,l,m.nullishCoalescing(t==null?void 0:t.max,e(this,l))),M(this,q,y).call(this,typeof e(this,d)=="number"?e(this,d):e(this,s)),t!=null&&t.equalize&&(this.current=e(this,s)),t!=null&&t.restart&&(this.unlistenAnimationFrame(),this.current=this.initial)}start(){this.listenAnimationFrame()}}f=new WeakMap,b=new WeakMap,x=new WeakMap,c=new WeakMap,A=new WeakMap,s=new WeakMap,u=new WeakMap,l=new WeakMap,g=new WeakMap,d=new WeakMap,q=new WeakSet,y=function(t){h(this,A,Math.sign(t-e(this,s))),h(this,s,z.clamp(t,e(this,u),e(this,l))),h(this,g,this.current)},F=new WeakMap;exports.Animation=O;
|