aptechka 0.37.1 → 0.37.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-DN95L7Xo.js → Animation-DRQRcOQg.js} +1 -1
- package/lib/{Animation-B9m8bw96.cjs → Animation-DgE_dc5D.cjs} +1 -1
- package/lib/{Damped-CTsV8tl_.cjs → Damped-DbVDDRZi.cjs} +1 -1
- package/lib/{Damped-Chu29wn-.js → Damped-GT4z9D9j.js} +2 -2
- package/lib/{Tweened-lT5myPAZ.cjs → Tweened-DEqfwKKF.cjs} +1 -1
- package/lib/{Tweened-DJzAFsVZ.js → Tweened-YkiLB0BU.js} +2 -2
- 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 +2 -2
- package/lib/need_redo_tweaker/index.cjs +1 -1
- package/lib/need_redo_tweaker/index.js +1 -1
- package/lib/pointer/index.cjs +1 -1
- package/lib/pointer/index.js +1 -1
- package/lib/polyfills-BANSrI_m.cjs +1 -0
- package/lib/polyfills-CxfUK5OU.js +37 -0
- package/lib/scroll/vanilla/index.cjs +1 -1
- package/lib/scroll/vanilla/index.js +39 -38
- package/lib/scroll-segment/index.cjs +1 -1
- package/lib/scroll-segment/index.js +1 -1
- package/lib/utils/index.cjs +1 -1
- package/lib/utils/index.js +34 -33
- package/lib/utils/number.d.ts +1 -0
- package/package.json +1 -1
- package/lib/polyfills-CM4SCDTt.cjs +0 -1
- package/lib/polyfills-X6KXuHg-.js +0 -33
|
@@ -5,7 +5,7 @@ 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 F } from "./polyfills-
|
|
8
|
+
import { p as z, n as F } from "./polyfills-CxfUK5OU.js";
|
|
9
9
|
import { ticker as O } from "./ticker/vanilla/index.js";
|
|
10
10
|
import { TICK_ORDER as N } from "./order/index.js";
|
|
11
11
|
var f, d, A, l, b, s, n, m, c, g, M, R, x;
|
|
@@ -1 +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-
|
|
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-BANSrI_m.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;
|
|
@@ -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-
|
|
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-BANSrI_m.cjs"),B=require("./Animation-DgE_dc5D.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;
|
|
@@ -16,8 +16,8 @@ var f = (s, e, t) => e in s ? v(s, e, { enumerable: !0, configurable: !0, writab
|
|
|
16
16
|
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
|
-
import { n as u, p as F } from "./polyfills-
|
|
20
|
-
import { A as q } from "./Animation-
|
|
19
|
+
import { n as u, p as F } from "./polyfills-CxfUK5OU.js";
|
|
20
|
+
import { A as q } from "./Animation-DRQRcOQg.js";
|
|
21
21
|
var i, h;
|
|
22
22
|
class j extends q {
|
|
23
23
|
constructor(t, r) {
|
|
@@ -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,a,e)=>a in i?y(i,a,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[a]=e,g=(i,a)=>{for(var e in a||(a={}))w.call(a,e)&&m(i,e,a[e]);if(h)for(var e of h(a))S.call(a,e)&&m(i,e,a[e]);return i},f=(i,a)=>O(i,b(a));var A=(i,a,e)=>a.has(i)||d("Cannot "+e);var s=(i,a,e)=>(A(i,a,"read from private field"),e?e.call(i):a.get(i)),l=(i,a,e)=>a.has(i)?d("Cannot add the same private member more than once"):a instanceof WeakSet?a.add(i):a.set(i,e),c=(i,a,e,r)=>(A(i,a,"write to private field"),r?r.call(i,e):a.set(i,e),e);const u=require("./easings-GegIwET5.cjs"),T=require("./math-GDWEqu7y.cjs"),q=require("./polyfills-
|
|
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,a,e)=>a in i?y(i,a,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[a]=e,g=(i,a)=>{for(var e in a||(a={}))w.call(a,e)&&m(i,e,a[e]);if(h)for(var e of h(a))S.call(a,e)&&m(i,e,a[e]);return i},f=(i,a)=>O(i,b(a));var A=(i,a,e)=>a.has(i)||d("Cannot "+e);var s=(i,a,e)=>(A(i,a,"read from private field"),e?e.call(i):a.get(i)),l=(i,a,e)=>a.has(i)?d("Cannot add the same private member more than once"):a instanceof WeakSet?a.add(i):a.set(i,e),c=(i,a,e,r)=>(A(i,a,"write to private field"),r?r.call(i,e):a.set(i,e),e);const u=require("./easings-GegIwET5.cjs"),T=require("./math-GDWEqu7y.cjs"),q=require("./polyfills-BANSrI_m.cjs"),x=require("./Animation-DgE_dc5D.cjs");var n,t;class z extends x.Animation{constructor(e,r){super(e||0,r);l(this,n,u.linear);l(this,t,1e3);this.updateOptions(f(g({},r),{equalize:!0}))}updateOptions(e){super.updateOptions(e),c(this,n,typeof(e==null?void 0:e.easing)=="function"?e.easing:typeof(e==null?void 0:e.easing)=="string"&&u.easings[e.easing]||u.linear),c(this,t,(e==null?void 0:e.duration)===!1?0:q.nullishCoalescing(e==null?void 0:e.duration,s(this,t)))}handleAnimationFrame(e){const r=e.timeElapsedSinceSubscription/1e3/(s(this,t)/1e3)||0,F=s(this,n).call(this,T.clamp(r,0,1));this.current=q.preciseNumber(this.from+(this.target-this.from)*F,6),r>1&&this.unlistenAnimationFrame()}start(){this.unlistenAnimationFrame(),this.listenAnimationFrame()}}n=new WeakMap,t=new WeakMap;exports.Tweened=z;
|
|
@@ -17,8 +17,8 @@ var A = (a, r, e) => r.has(a) || f("Cannot " + e);
|
|
|
17
17
|
var m = (a, r, e) => (A(a, r, "read from private field"), e ? e.call(a) : r.get(a)), n = (a, r, e) => r.has(a) ? f("Cannot add the same private member more than once") : r instanceof WeakSet ? r.add(a) : r.set(a, e), u = (a, r, e, i) => (A(a, r, "write to private field"), i ? i.call(a, e) : r.set(a, e), e);
|
|
18
18
|
import { l as h, e as T } from "./easings-BEmRlrDd.js";
|
|
19
19
|
import { c as q } from "./math-BOBiC4TN.js";
|
|
20
|
-
import { n as w, p as z } from "./polyfills-
|
|
21
|
-
import { A as C } from "./Animation-
|
|
20
|
+
import { n as w, p as z } from "./polyfills-CxfUK5OU.js";
|
|
21
|
+
import { A as C } from "./Animation-DRQRcOQg.js";
|
|
22
22
|
var s, t;
|
|
23
23
|
class B extends C {
|
|
24
24
|
constructor(e, i) {
|
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-DgE_dc5D.cjs"),n=require("../Damped-DbVDDRZi.cjs"),i=require("../Tweened-DEqfwKKF.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-DRQRcOQg.js";
|
|
2
|
+
import { D as m } from "../Damped-GT4z9D9j.js";
|
|
3
|
+
import { T as t } from "../Tweened-YkiLB0BU.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-DEqfwKKF.cjs"),_=require("../gestures-DHLrn6Q8.cjs"),$=require("../polyfills-BANSrI_m.cjs"),p=require("../order/index.cjs");var R;class Y{constructor(){s(this,R,new G.Notifier)}get changeEvent(){return t(this,R)}}R=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,O,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,O).call(this)}set speed(e){i(this,g,e),t(this,f)&&k(this,w,O).call(this)}connect(){t(this,f)||(i(this,f,!0),k(this,w,O).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,O=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)*1||this.axis==="y"&&Math.abs(e.deltaX)>Math.abs(e.deltaY)*1))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,S=!1;i(this,l,0),document.documentElement.classList.add("grabbing");let K=0,N=0;_.setupDrag(L=>{t(E,M)&&t(E,M)!==t(this,o)||(K=a.x-L.x,N=a.y-L.y,this.axis==="x"?i(this,l,K):i(this,l,N),a=L,S=this.axis==="x"&&Math.abs(K)>Math.abs(N)||this.axis==="y"&&Math.abs(N)>Math.abs(K),S&&(i(E,M,t(this,o)),this.changeEvent.notify("drag",t(this,l))))},()=>{i(E,M,null),S&&!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,9 +9,9 @@ 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-YkiLB0BU.js";
|
|
13
13
|
import { s as $ } from "../gestures-D2Fdra_G.js";
|
|
14
|
-
import { p } from "../polyfills-
|
|
14
|
+
import { p } from "../polyfills-CxfUK5OU.js";
|
|
15
15
|
import { TICK_ORDER as _ } from "../order/index.js";
|
|
16
16
|
var O;
|
|
17
17
|
class B {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var bt=r=>{throw TypeError(r)};var Ge=(r,s,t)=>s.has(r)||bt("Cannot "+t);var e=(r,s,t)=>(Ge(r,s,"read from private field"),t?t.call(r):s.get(r)),o=(r,s,t)=>s.has(r)?bt("Cannot add the same private member more than once"):s instanceof WeakSet?s.add(r):s.set(r,t),c=(r,s,t,i)=>(Ge(r,s,"write to private field"),i?i.call(r,t):s.set(r,t),t),l=(r,s,t)=>(Ge(r,s,"access private method"),t);const U=require("../browser-CpzFX2xg.cjs"),m=require("../Store-CDb6RMce.cjs"),Yt=require("../file-EevnUtRj.cjs"),Gt=require("../function-MthRj-GJ.cjs"),St=require("../gestures-DHLrn6Q8.cjs");require("../ticker/vanilla/index.cjs");const pe=require("../string-DhgS_iFl.cjs"),vt=require("../object-CCiXnER2.cjs"),Ut=require("../connector/index.cjs"),Xt=require("../device/index.cjs"),Qt=require("../math-GDWEqu7y.cjs"),Ue=require("../polyfills-CM4SCDTt.cjs"),yt=require("../element-resizer/vanilla/index.cjs"),jt=require("../style-At6aDoqG.cjs"),es=new Set(["animate","animateMotion","animateTransform","circle","clipPath","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","foreignObject","g","image","line","linearGradient","listener","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","solidColor","stop","svg","switch","symbol","text","textPath","title","tspan","view","use"]);var d,$,y,we,I,H,a,kt,Et,xt,Xe,Qe,Ct,Tt,Lt,zt,je,et,Rt,tt,st,Mt,it,qe,nt,ot,rt,Ke,Oe;const Ze=class Ze{constructor(...s){o(this,a);o(this,d,null);o(this,$,new Set);o(this,y,new Set);o(this,we);o(this,I);o(this,H);o(this,Ke,s=>{e(this,$).forEach(t=>{t(s)}),e(this,$).clear()});o(this,Oe,(s,t)=>{e(this,y).forEach(i=>{i(s,t)}),e(this,y).clear(),l(this,a,st).call(this)});if(U.isBrowser){const t=s[0],i=s[1];c(this,d,l(this,a,kt).call(this,t,i==null?void 0:i.forceSvg)),l(this,a,xt).call(this,i)}}get node(){return e(this,d)}set node(s){var t;l(this,a,st).call(this),c(this,d,s),(t=e(this,we))==null||t.call(this),e(this,d)instanceof Element&&c(this,I,[...e(this,d).querySelectorAll("store-root")]),l(this,a,tt).call(this),l(this,a,Xe).call(this)}};d=new WeakMap,$=new WeakMap,y=new WeakMap,we=new WeakMap,I=new WeakMap,H=new WeakMap,a=new WeakSet,kt=function(s,t){let i=null;if(s instanceof Node)i=s;else if(typeof s=="string")if(!s.includes("<")&&s.includes("-"))i=new(customElements.get(s));else if(s.includes("<")){const n=document.createElement("div");n.innerHTML=s,i=n.firstElementChild}else es.has(s)||t?i=document.createElementNS("http://www.w3.org/2000/svg",s):i=document.createElement(s);else i=document.createElement("div");return i},Et=function(s){return s instanceof HTMLElement||s instanceof SVGElement},xt=function(s){if(!s)return;const t=l(this,a,Et).call(this,e(this,d)),i=s.ref;delete s.ref,s!=null&&s.onConnect&&(e(this,$).add(s.onConnect),delete s.onConnect),s!=null&&s.onDisconnect&&(e(this,y).add(s.onDisconnect),delete s.onDisconnect);let n,h;for(const u in s){const g=s[u];u==="class"&&t?l(this,a,Qe).call(this,g):u==="style"&&t?l(this,a,Lt).call(this,g):u==="lightChildren"?l(this,a,qe).call(this,e(this,d),g):u==="children"?l(this,a,qe).call(this,e(this,d)instanceof Element?e(this,d).shadowRoot||e(this,d):e(this,d),g):u==="connectedClass"?e(this,$).add(()=>{requestAnimationFrame(()=>{e(this,d).classList.add(typeof g=="boolean"?"connected":g)})}):u.startsWith("on")?(h||(h={}),h[u]=g):(n||(n={}),n[u]=g)}l(this,a,Mt).call(this,n),l(this,a,Rt).call(this,h),i&&(typeof i=="function"?i(e(this,d)):i.current=e(this,d)),l(this,a,Xe).call(this)},Xe=function(){if(U.isBrowser&&(e(this,y).size||e(this,$).size)){const s=e(this,d)instanceof DocumentFragment?e(this,d).firstChild:e(this,d);c(this,we,Ut.connector.subscribe(s,{connectCallback:e(this,Ke),disconnectCallback:e(this,Oe),unsubscribeAfterDisconnect:!0,maxWaitSec:20}))}},Qe=function(s){if(s){if(typeof s=="string")e(this,d).classList.add(s);else if(Array.isArray(s))s.forEach(t=>{t&&l(this,a,Qe).call(this,t)});else if(typeof s=="object")if(s instanceof m.Store)l(this,a,Ct).call(this,s);else for(const t in s){const i=s[t];i instanceof m.Store?l(this,a,Tt).call(this,t,i):i?e(this,d).classList.add(t):e(this,d).classList.remove(t)}}else return},Ct=function(s){e(this,y).add(s.subscribe(({current:t,previous:i})=>{i&&[i].flat().forEach(n=>{n&&e(this,d).classList.remove(n)}),t&&[t].flat().forEach(n=>{n&&e(this,d).classList.add(n)})}))},Tt=function(s,t){e(this,y).add(t.subscribe(({current:i})=>{i?e(this,d).classList.add(s):e(this,d).classList.remove(s)}))},Lt=function(s){if(!s)return;e(this,d).tagName==="style"||e(this,d).tagName==="STYLE"?l(this,a,je).call(this,s):l(this,a,zt).call(this,s)},zt=function(s){for(const t in s){const i=t,n=s[i];n instanceof m.Store?e(this,y).add(n.subscribe(({current:h})=>{l(this,a,et).call(this,i,h)})):l(this,a,et).call(this,i,n)}},je=function(s){for(const t in s){const i=s[t];if(typeof i=="object"&&!(i instanceof m.Store))e(this,d).appendChild(document.createTextNode(`${t} {`)),l(this,a,je).call(this,i),e(this,d).appendChild(document.createTextNode("}"));else if(i instanceof m.Store){const n=document.createTextNode("");e(this,y).add(i.subscribe(h=>{h.current?n.nodeValue=`${pe.camelToKebab(t)}: ${h.current};`:n.nodeValue=""})),e(this,d).appendChild(n)}else e(this,d).appendChild(document.createTextNode(`${pe.camelToKebab(t)}: ${i};`))}},et=function(s,t){s.includes("--")?t?e(this,d).style.setProperty(s,t.toString()):e(this,d).style.removeProperty(s):t?e(this,d).style[s]=t.toString():e(this,d).style[s]=""},Rt=function(s){if(s){e(this,H)||c(this,H,[]);for(const t in s){const i=t,n=pe.uncapitalize(i.split("on").slice(1).join("on")),h=s[i];typeof h=="object"?e(this,H).push({name:n,callback:h.callback,options:h.options}):typeof h=="function"&&e(this,H).push({name:n,callback:h})}l(this,a,tt).call(this)}},tt=function(){var s;(s=e(this,H))==null||s.forEach(t=>{e(this,d).addEventListener(t.name,t.callback,t.options)})},st=function(){var s;(s=e(this,H))==null||s.forEach(t=>{e(this,d).removeEventListener(t.name,t.callback,t.options)})},Mt=function(s){for(const t in s){const i=s[t];i instanceof m.Store?e(this,y).add(i.subscribe(({current:n})=>{l(this,a,it).call(this,t,n)})):l(this,a,it).call(this,t,i)}},it=function(s,t){var n,h;const i=e(this,d);if(s in i&&!((h=(n=i.constructor)==null?void 0:n.observedAttributes)!=null&&h.includes(s)))t!=null&&(i[s]=t.toString());else if(t!=null){const u=t.toString();s.includes("xlink")?i.setAttributeNS("http://www.w3.org/1999/xlink",s,u):i.setAttribute(s,u)}},qe=function(s,t){t&&(t=[t].flat(),t.forEach(i=>{if(i instanceof m.Store){const n=document.createElement("div");n.style.display="contents",s.appendChild(n),e(this,I)||c(this,I,[]);const h=e(this,I).length;n.setAttribute("store-root",""),e(this,I).push(n),e(this,y).add(i.subscribe(({current:u,previous:g})=>{const k=e(this,I)[h];k.dispatchEvent(new CustomEvent("beforeChildrenChange",{bubbles:!0,composed:!0}));const T=Array.from(k.childNodes),v=Array.isArray(u)?u:[u],ge=Array.isArray(g)?g:[g],Ve=[],x=[];T.length&&ge.forEach((N,P)=>{v.includes(N)?x.push(N):Ve.push(T[P])}),v.forEach((N,P)=>{if(x[P]!=null){if(N!==x[P]){const q=l(this,a,ot).call(this,N),O=T[P];q instanceof Node&&!O.isEqualNode(q)?k.replaceChild(q,O):k.removeChild(O)}}else{const q=l(this,a,ot).call(this,N);q instanceof Node&&n.appendChild(q)}}),Ve.forEach(N=>{k.removeChild(N)}),k.dispatchEvent(new CustomEvent("afterChildrenChange",{bubbles:!0,composed:!0}))}))}else if(i instanceof Ze)l(this,a,nt).call(this,s,i.node);else if(i instanceof Function)l(this,a,qe).call(this,s,vt.isESClass(i)?new i:i());else{const n=l(this,a,rt).call(this,i);n instanceof Node&&l(this,a,nt).call(this,s,n)}}))},nt=function(s,t){!(s instanceof ShadowRoot)&&t instanceof HTMLElement&&t.tagName==="STYLE"?(e(this,$).add(()=>{[...document.head.querySelectorAll("style")].find(n=>n.outerHTML===t.outerHTML)||document.head.appendChild(t)}),e(this,y).add(()=>{t.remove()})):s.appendChild(t)},ot=function(s){return s instanceof Ze?s.node:typeof s=="function"?vt.isESClass(s)?new s:s():l(this,a,rt).call(this,s)},rt=function(s){if(s instanceof Node)return s;if(s!=null){const t=String(s);if(t.trim().startsWith("<")&&t.trim().endsWith(">")){const i=document.createElement("div");return i.innerHTML=t,i.firstElementChild}else return document.createTextNode(t)}else return},Ke=new WeakMap,Oe=new WeakMap;let A=Ze;function p(...r){return new A(...r)}function ts(r){return new A("a",r)}function Q(r){return new A("button",r)}function b(r){return new A("div",r)}function De(r){return new A("input",r)}function At(r){return new A("label",r)}function ue(r){return new A("slot",r)}function at(r){return new A("span",r)}function Nt(r){return new A("style",{style:r})}function E(r){const s=new CSSStyleSheet;return s.replaceSync(Nt(r).node.innerHTML),s}function ss(r,s){const t=s==null?void 0:s.prefix,i={style:{}};for(const n in r)i[n]={var:`var(--${t}${pe.camelToKebab(n)})`,value:r[n]},i.style[`--${t}${pe.camelToKebab(n)}`]=r[n];return i}const f=ss({colorMain:"#1c1c1c",colorMainAux:"#282828",colorFont:"#ffffff",colorActive:"#00E5B0",borderRadius:"12px",borderRadiusSmall:"4px"},{prefix:"aptechka-"});if(U.isBrowser){const r=Nt({":root":f.style}).node;r.setAttribute("data-permanent",""),document.head.appendChild(r)}const Ft='<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M20.536 3.464C19.07 2 16.714 2 12 2C7.286 2 4.929 2 3.464 3.464C2 4.93 2 7.286 2 12c0 4.714 0 7.071 1.464 8.535C4.93 22 7.286 22 12 22c4.714 0 7.071 0 8.535-1.465C22 19.072 22 16.714 22 12s0-7.071-1.465-8.536M16.75 12a.75.75 0 0 1-.75.75H9.81l1.72 1.72a.75.75 0 1 1-1.06 1.06l-3-3a.75.75 0 0 1 0-1.06l3-3a.75.75 0 1 1 1.06 1.06l-1.72 1.72H16a.75.75 0 0 1 .75.75" clip-rule="evenodd"/></svg>',Pt='<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><path d="M15.24 2h-3.894c-1.764 0-3.162 0-4.255.148c-1.126.152-2.037.472-2.755 1.193c-.719.721-1.038 1.636-1.189 2.766C3 7.205 3 8.608 3 10.379v5.838c0 1.508.92 2.8 2.227 3.342c-.067-.91-.067-2.185-.067-3.247v-5.01c0-1.281 0-2.386.118-3.27c.127-.948.413-1.856 1.147-2.593c.734-.737 1.639-1.024 2.583-1.152c.88-.118 1.98-.118 3.257-.118h3.07c1.276 0 2.374 0 3.255.118A3.601 3.601 0 0 0 15.24 2Z"/><path d="M6.6 11.397c0-2.726 0-4.089.844-4.936c.843-.847 2.2-.847 4.916-.847h2.88c2.715 0 4.073 0 4.917.847c.843.847.843 2.21.843 4.936v4.82c0 2.726 0 4.089-.843 4.936c-.844.847-2.202.847-4.917.847h-2.88c-2.715 0-4.073 0-4.916-.847c-.844-.847-.844-2.21-.844-4.936v-4.82Z"/></svg>',is='<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M2 12c0-4.714 0-7.071 1.464-8.536C4.93 2 7.286 2 12 2c4.714 0 7.071 0 8.535 1.464C22 4.93 22 7.286 22 12c0 4.714 0 7.071-1.465 8.535C19.072 22 16.714 22 12 22s-7.071 0-8.536-1.465C2 19.072 2 16.714 2 12Zm10-5.75a.75.75 0 0 1 .75.75v5.19l1.72-1.72a.75.75 0 1 1 1.06 1.06l-3 3a.75.75 0 0 1-1.06 0l-3-3a.75.75 0 1 1 1.06-1.06l1.72 1.72V7a.75.75 0 0 1 .75-.75Zm-4 10a.75.75 0 0 0 0 1.5h8a.75.75 0 0 0 0-1.5H8Z" clip-rule="evenodd"/></svg>',ns='<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M2 12c0-4.714 0-7.071 1.464-8.536C4.93 2 7.286 2 12 2c4.714 0 7.071 0 8.535 1.464C22 4.93 22 7.286 22 12c0 4.714 0 7.071-1.465 8.535C19.072 22 16.714 22 12 22s-7.071 0-8.536-1.465C2 19.072 2 16.714 2 12Zm10 5.75a.75.75 0 0 0 .75-.75v-5.19l1.72 1.72a.75.75 0 1 0 1.06-1.06l-3-3a.75.75 0 0 0-1.06 0l-3 3a.75.75 0 1 0 1.06 1.06l1.72-1.72V17c0 .414.336.75.75.75Zm-4-10a.75.75 0 0 1 0-1.5h8a.75.75 0 0 1 0 1.5H8Z" clip-rule="evenodd"/></svg>',$t=`<svg
|
|
1
|
+
"use strict";var bt=r=>{throw TypeError(r)};var Ge=(r,s,t)=>s.has(r)||bt("Cannot "+t);var e=(r,s,t)=>(Ge(r,s,"read from private field"),t?t.call(r):s.get(r)),o=(r,s,t)=>s.has(r)?bt("Cannot add the same private member more than once"):s instanceof WeakSet?s.add(r):s.set(r,t),c=(r,s,t,i)=>(Ge(r,s,"write to private field"),i?i.call(r,t):s.set(r,t),t),l=(r,s,t)=>(Ge(r,s,"access private method"),t);const U=require("../browser-CpzFX2xg.cjs"),m=require("../Store-CDb6RMce.cjs"),Yt=require("../file-EevnUtRj.cjs"),Gt=require("../function-MthRj-GJ.cjs"),St=require("../gestures-DHLrn6Q8.cjs");require("../ticker/vanilla/index.cjs");const pe=require("../string-DhgS_iFl.cjs"),vt=require("../object-CCiXnER2.cjs"),Ut=require("../connector/index.cjs"),Xt=require("../device/index.cjs"),Qt=require("../math-GDWEqu7y.cjs"),Ue=require("../polyfills-BANSrI_m.cjs"),yt=require("../element-resizer/vanilla/index.cjs"),jt=require("../style-At6aDoqG.cjs"),es=new Set(["animate","animateMotion","animateTransform","circle","clipPath","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","foreignObject","g","image","line","linearGradient","listener","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","solidColor","stop","svg","switch","symbol","text","textPath","title","tspan","view","use"]);var d,$,y,we,I,H,a,kt,Et,xt,Xe,Qe,Ct,Tt,Lt,zt,je,et,Rt,tt,st,Mt,it,qe,nt,ot,rt,Ke,Oe;const Ze=class Ze{constructor(...s){o(this,a);o(this,d,null);o(this,$,new Set);o(this,y,new Set);o(this,we);o(this,I);o(this,H);o(this,Ke,s=>{e(this,$).forEach(t=>{t(s)}),e(this,$).clear()});o(this,Oe,(s,t)=>{e(this,y).forEach(i=>{i(s,t)}),e(this,y).clear(),l(this,a,st).call(this)});if(U.isBrowser){const t=s[0],i=s[1];c(this,d,l(this,a,kt).call(this,t,i==null?void 0:i.forceSvg)),l(this,a,xt).call(this,i)}}get node(){return e(this,d)}set node(s){var t;l(this,a,st).call(this),c(this,d,s),(t=e(this,we))==null||t.call(this),e(this,d)instanceof Element&&c(this,I,[...e(this,d).querySelectorAll("store-root")]),l(this,a,tt).call(this),l(this,a,Xe).call(this)}};d=new WeakMap,$=new WeakMap,y=new WeakMap,we=new WeakMap,I=new WeakMap,H=new WeakMap,a=new WeakSet,kt=function(s,t){let i=null;if(s instanceof Node)i=s;else if(typeof s=="string")if(!s.includes("<")&&s.includes("-"))i=new(customElements.get(s));else if(s.includes("<")){const n=document.createElement("div");n.innerHTML=s,i=n.firstElementChild}else es.has(s)||t?i=document.createElementNS("http://www.w3.org/2000/svg",s):i=document.createElement(s);else i=document.createElement("div");return i},Et=function(s){return s instanceof HTMLElement||s instanceof SVGElement},xt=function(s){if(!s)return;const t=l(this,a,Et).call(this,e(this,d)),i=s.ref;delete s.ref,s!=null&&s.onConnect&&(e(this,$).add(s.onConnect),delete s.onConnect),s!=null&&s.onDisconnect&&(e(this,y).add(s.onDisconnect),delete s.onDisconnect);let n,h;for(const u in s){const g=s[u];u==="class"&&t?l(this,a,Qe).call(this,g):u==="style"&&t?l(this,a,Lt).call(this,g):u==="lightChildren"?l(this,a,qe).call(this,e(this,d),g):u==="children"?l(this,a,qe).call(this,e(this,d)instanceof Element?e(this,d).shadowRoot||e(this,d):e(this,d),g):u==="connectedClass"?e(this,$).add(()=>{requestAnimationFrame(()=>{e(this,d).classList.add(typeof g=="boolean"?"connected":g)})}):u.startsWith("on")?(h||(h={}),h[u]=g):(n||(n={}),n[u]=g)}l(this,a,Mt).call(this,n),l(this,a,Rt).call(this,h),i&&(typeof i=="function"?i(e(this,d)):i.current=e(this,d)),l(this,a,Xe).call(this)},Xe=function(){if(U.isBrowser&&(e(this,y).size||e(this,$).size)){const s=e(this,d)instanceof DocumentFragment?e(this,d).firstChild:e(this,d);c(this,we,Ut.connector.subscribe(s,{connectCallback:e(this,Ke),disconnectCallback:e(this,Oe),unsubscribeAfterDisconnect:!0,maxWaitSec:20}))}},Qe=function(s){if(s){if(typeof s=="string")e(this,d).classList.add(s);else if(Array.isArray(s))s.forEach(t=>{t&&l(this,a,Qe).call(this,t)});else if(typeof s=="object")if(s instanceof m.Store)l(this,a,Ct).call(this,s);else for(const t in s){const i=s[t];i instanceof m.Store?l(this,a,Tt).call(this,t,i):i?e(this,d).classList.add(t):e(this,d).classList.remove(t)}}else return},Ct=function(s){e(this,y).add(s.subscribe(({current:t,previous:i})=>{i&&[i].flat().forEach(n=>{n&&e(this,d).classList.remove(n)}),t&&[t].flat().forEach(n=>{n&&e(this,d).classList.add(n)})}))},Tt=function(s,t){e(this,y).add(t.subscribe(({current:i})=>{i?e(this,d).classList.add(s):e(this,d).classList.remove(s)}))},Lt=function(s){if(!s)return;e(this,d).tagName==="style"||e(this,d).tagName==="STYLE"?l(this,a,je).call(this,s):l(this,a,zt).call(this,s)},zt=function(s){for(const t in s){const i=t,n=s[i];n instanceof m.Store?e(this,y).add(n.subscribe(({current:h})=>{l(this,a,et).call(this,i,h)})):l(this,a,et).call(this,i,n)}},je=function(s){for(const t in s){const i=s[t];if(typeof i=="object"&&!(i instanceof m.Store))e(this,d).appendChild(document.createTextNode(`${t} {`)),l(this,a,je).call(this,i),e(this,d).appendChild(document.createTextNode("}"));else if(i instanceof m.Store){const n=document.createTextNode("");e(this,y).add(i.subscribe(h=>{h.current?n.nodeValue=`${pe.camelToKebab(t)}: ${h.current};`:n.nodeValue=""})),e(this,d).appendChild(n)}else e(this,d).appendChild(document.createTextNode(`${pe.camelToKebab(t)}: ${i};`))}},et=function(s,t){s.includes("--")?t?e(this,d).style.setProperty(s,t.toString()):e(this,d).style.removeProperty(s):t?e(this,d).style[s]=t.toString():e(this,d).style[s]=""},Rt=function(s){if(s){e(this,H)||c(this,H,[]);for(const t in s){const i=t,n=pe.uncapitalize(i.split("on").slice(1).join("on")),h=s[i];typeof h=="object"?e(this,H).push({name:n,callback:h.callback,options:h.options}):typeof h=="function"&&e(this,H).push({name:n,callback:h})}l(this,a,tt).call(this)}},tt=function(){var s;(s=e(this,H))==null||s.forEach(t=>{e(this,d).addEventListener(t.name,t.callback,t.options)})},st=function(){var s;(s=e(this,H))==null||s.forEach(t=>{e(this,d).removeEventListener(t.name,t.callback,t.options)})},Mt=function(s){for(const t in s){const i=s[t];i instanceof m.Store?e(this,y).add(i.subscribe(({current:n})=>{l(this,a,it).call(this,t,n)})):l(this,a,it).call(this,t,i)}},it=function(s,t){var n,h;const i=e(this,d);if(s in i&&!((h=(n=i.constructor)==null?void 0:n.observedAttributes)!=null&&h.includes(s)))t!=null&&(i[s]=t.toString());else if(t!=null){const u=t.toString();s.includes("xlink")?i.setAttributeNS("http://www.w3.org/1999/xlink",s,u):i.setAttribute(s,u)}},qe=function(s,t){t&&(t=[t].flat(),t.forEach(i=>{if(i instanceof m.Store){const n=document.createElement("div");n.style.display="contents",s.appendChild(n),e(this,I)||c(this,I,[]);const h=e(this,I).length;n.setAttribute("store-root",""),e(this,I).push(n),e(this,y).add(i.subscribe(({current:u,previous:g})=>{const k=e(this,I)[h];k.dispatchEvent(new CustomEvent("beforeChildrenChange",{bubbles:!0,composed:!0}));const T=Array.from(k.childNodes),v=Array.isArray(u)?u:[u],ge=Array.isArray(g)?g:[g],Ve=[],x=[];T.length&&ge.forEach((N,P)=>{v.includes(N)?x.push(N):Ve.push(T[P])}),v.forEach((N,P)=>{if(x[P]!=null){if(N!==x[P]){const q=l(this,a,ot).call(this,N),O=T[P];q instanceof Node&&!O.isEqualNode(q)?k.replaceChild(q,O):k.removeChild(O)}}else{const q=l(this,a,ot).call(this,N);q instanceof Node&&n.appendChild(q)}}),Ve.forEach(N=>{k.removeChild(N)}),k.dispatchEvent(new CustomEvent("afterChildrenChange",{bubbles:!0,composed:!0}))}))}else if(i instanceof Ze)l(this,a,nt).call(this,s,i.node);else if(i instanceof Function)l(this,a,qe).call(this,s,vt.isESClass(i)?new i:i());else{const n=l(this,a,rt).call(this,i);n instanceof Node&&l(this,a,nt).call(this,s,n)}}))},nt=function(s,t){!(s instanceof ShadowRoot)&&t instanceof HTMLElement&&t.tagName==="STYLE"?(e(this,$).add(()=>{[...document.head.querySelectorAll("style")].find(n=>n.outerHTML===t.outerHTML)||document.head.appendChild(t)}),e(this,y).add(()=>{t.remove()})):s.appendChild(t)},ot=function(s){return s instanceof Ze?s.node:typeof s=="function"?vt.isESClass(s)?new s:s():l(this,a,rt).call(this,s)},rt=function(s){if(s instanceof Node)return s;if(s!=null){const t=String(s);if(t.trim().startsWith("<")&&t.trim().endsWith(">")){const i=document.createElement("div");return i.innerHTML=t,i.firstElementChild}else return document.createTextNode(t)}else return},Ke=new WeakMap,Oe=new WeakMap;let A=Ze;function p(...r){return new A(...r)}function ts(r){return new A("a",r)}function Q(r){return new A("button",r)}function b(r){return new A("div",r)}function De(r){return new A("input",r)}function At(r){return new A("label",r)}function ue(r){return new A("slot",r)}function at(r){return new A("span",r)}function Nt(r){return new A("style",{style:r})}function E(r){const s=new CSSStyleSheet;return s.replaceSync(Nt(r).node.innerHTML),s}function ss(r,s){const t=s==null?void 0:s.prefix,i={style:{}};for(const n in r)i[n]={var:`var(--${t}${pe.camelToKebab(n)})`,value:r[n]},i.style[`--${t}${pe.camelToKebab(n)}`]=r[n];return i}const f=ss({colorMain:"#1c1c1c",colorMainAux:"#282828",colorFont:"#ffffff",colorActive:"#00E5B0",borderRadius:"12px",borderRadiusSmall:"4px"},{prefix:"aptechka-"});if(U.isBrowser){const r=Nt({":root":f.style}).node;r.setAttribute("data-permanent",""),document.head.appendChild(r)}const Ft='<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M20.536 3.464C19.07 2 16.714 2 12 2C7.286 2 4.929 2 3.464 3.464C2 4.93 2 7.286 2 12c0 4.714 0 7.071 1.464 8.535C4.93 22 7.286 22 12 22c4.714 0 7.071 0 8.535-1.465C22 19.072 22 16.714 22 12s0-7.071-1.465-8.536M16.75 12a.75.75 0 0 1-.75.75H9.81l1.72 1.72a.75.75 0 1 1-1.06 1.06l-3-3a.75.75 0 0 1 0-1.06l3-3a.75.75 0 1 1 1.06 1.06l-1.72 1.72H16a.75.75 0 0 1 .75.75" clip-rule="evenodd"/></svg>',Pt='<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><path d="M15.24 2h-3.894c-1.764 0-3.162 0-4.255.148c-1.126.152-2.037.472-2.755 1.193c-.719.721-1.038 1.636-1.189 2.766C3 7.205 3 8.608 3 10.379v5.838c0 1.508.92 2.8 2.227 3.342c-.067-.91-.067-2.185-.067-3.247v-5.01c0-1.281 0-2.386.118-3.27c.127-.948.413-1.856 1.147-2.593c.734-.737 1.639-1.024 2.583-1.152c.88-.118 1.98-.118 3.257-.118h3.07c1.276 0 2.374 0 3.255.118A3.601 3.601 0 0 0 15.24 2Z"/><path d="M6.6 11.397c0-2.726 0-4.089.844-4.936c.843-.847 2.2-.847 4.916-.847h2.88c2.715 0 4.073 0 4.917.847c.843.847.843 2.21.843 4.936v4.82c0 2.726 0 4.089-.843 4.936c-.844.847-2.202.847-4.917.847h-2.88c-2.715 0-4.073 0-4.916-.847c-.844-.847-.844-2.21-.844-4.936v-4.82Z"/></svg>',is='<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M2 12c0-4.714 0-7.071 1.464-8.536C4.93 2 7.286 2 12 2c4.714 0 7.071 0 8.535 1.464C22 4.93 22 7.286 22 12c0 4.714 0 7.071-1.465 8.535C19.072 22 16.714 22 12 22s-7.071 0-8.536-1.465C2 19.072 2 16.714 2 12Zm10-5.75a.75.75 0 0 1 .75.75v5.19l1.72-1.72a.75.75 0 1 1 1.06 1.06l-3 3a.75.75 0 0 1-1.06 0l-3-3a.75.75 0 1 1 1.06-1.06l1.72 1.72V7a.75.75 0 0 1 .75-.75Zm-4 10a.75.75 0 0 0 0 1.5h8a.75.75 0 0 0 0-1.5H8Z" clip-rule="evenodd"/></svg>',ns='<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M2 12c0-4.714 0-7.071 1.464-8.536C4.93 2 7.286 2 12 2c4.714 0 7.071 0 8.535 1.464C22 4.93 22 7.286 22 12c0 4.714 0 7.071-1.465 8.535C19.072 22 16.714 22 12 22s-7.071 0-8.536-1.465C2 19.072 2 16.714 2 12Zm10 5.75a.75.75 0 0 0 .75-.75v-5.19l1.72 1.72a.75.75 0 1 0 1.06-1.06l-3-3a.75.75 0 0 0-1.06 0l-3 3a.75.75 0 1 0 1.06 1.06l1.72-1.72V17c0 .414.336.75.75.75Zm-4-10a.75.75 0 0 1 0-1.5h8a.75.75 0 0 1 0 1.5H8Z" clip-rule="evenodd"/></svg>',$t=`<svg
|
|
2
2
|
xmlns="http://www.w3.org/2000/svg"
|
|
3
3
|
width="32"
|
|
4
4
|
height="32"
|
|
@@ -14,7 +14,7 @@ import { i as yt } from "../object-D6MVWB4l.js";
|
|
|
14
14
|
import { connector as jt } from "../connector/index.js";
|
|
15
15
|
import { ViewportMediaRules as es } from "../device/index.js";
|
|
16
16
|
import { c as ts } from "../math-BOBiC4TN.js";
|
|
17
|
-
import { n as St, t as ss } from "../polyfills-
|
|
17
|
+
import { n as St, t as ss } from "../polyfills-CxfUK5OU.js";
|
|
18
18
|
import { elementResizer as kt } from "../element-resizer/vanilla/index.js";
|
|
19
19
|
import { g as is } from "../style-j2TwriJ_.js";
|
|
20
20
|
const ns = /* @__PURE__ */ new Set([
|
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-DbVDDRZi.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-GT4z9D9j.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";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const o=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10];function i(e,n=5){return Math.round(e*o[n])/o[n]}function u(e,n){return Math.round(e/n)*n}function c(e,n){var t;const r=((t=n.toString().split(".")[1])==null?void 0:t.length)||0;return r?+e.toFixed(r):Math.ceil(e)}function s(e,n){return e=e%n,e=e<0?n+e:e,e}function p(e,n){return typeof e=="undefined"?n:e}exports.loopNumber=s;exports.nullishCoalescing=p;exports.preciseNumber=i;exports.roundNumberTo=u;exports.toStep=c;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
const o = [
|
|
2
|
+
1,
|
|
3
|
+
10,
|
|
4
|
+
100,
|
|
5
|
+
1e3,
|
|
6
|
+
1e4,
|
|
7
|
+
1e5,
|
|
8
|
+
1e6,
|
|
9
|
+
1e7,
|
|
10
|
+
1e8,
|
|
11
|
+
1e9,
|
|
12
|
+
1e10
|
|
13
|
+
];
|
|
14
|
+
function i(n, t = 5) {
|
|
15
|
+
return Math.round(n * o[t]) / o[t];
|
|
16
|
+
}
|
|
17
|
+
function s(n, t) {
|
|
18
|
+
return Math.round(n / t) * t;
|
|
19
|
+
}
|
|
20
|
+
function c(n, t) {
|
|
21
|
+
var r;
|
|
22
|
+
const e = ((r = t.toString().split(".")[1]) == null ? void 0 : r.length) || 0;
|
|
23
|
+
return e ? +n.toFixed(e) : Math.ceil(n);
|
|
24
|
+
}
|
|
25
|
+
function u(n, t) {
|
|
26
|
+
return n = n % t, n = n < 0 ? t + n : n, n;
|
|
27
|
+
}
|
|
28
|
+
function f(n, t) {
|
|
29
|
+
return typeof n == "undefined" ? t : n;
|
|
30
|
+
}
|
|
31
|
+
export {
|
|
32
|
+
u as l,
|
|
33
|
+
f as n,
|
|
34
|
+
i as p,
|
|
35
|
+
s as r,
|
|
36
|
+
c as t
|
|
37
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var Be=Object.defineProperty;var Pe=Object.getOwnPropertySymbols;var _e=Object.prototype.hasOwnProperty,He=Object.prototype.propertyIsEnumerable;var Ee=u=>{throw TypeError(u)};var we=(u,h,e)=>h in u?Be(u,h,{enumerable:!0,configurable:!0,writable:!0,value:e}):u[h]=e,xe=(u,h)=>{for(var e in h||(h={}))_e.call(h,e)&&we(u,e,h[e]);if(Pe)for(var e of Pe(h))He.call(h,e)&&we(u,e,h[e]);return u};var be=(u,h,e)=>h.has(u)||Ee("Cannot "+e);var t=(u,h,e)=>(be(u,h,"read from private field"),e?e.call(u):h.get(u)),s=(u,h,e)=>h.has(u)?Ee("Cannot add the same private member more than once"):h instanceof WeakSet?h.add(u):h.set(u,e),r=(u,h,e,i)=>(be(u,h,"write to private field"),i?i.call(u,e):h.set(u,e),e),c=(u,h,e)=>(be(u,h,"access private method"),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const We=require("../../Store-CDb6RMce.cjs"),Se=require("../../browser-CpzFX2xg.cjs"),Fe=require("../../easings-GegIwET5.cjs"),le=require("../../events-KVanG9sR.cjs"),ze=require("../../jss-GJLvaNfT.cjs"),zt=require("../../layout-8ryRAMGJ.cjs"),ke=require("../../math-GDWEqu7y.cjs");require("../../ticker/vanilla/index.cjs");const ce=require("../../order/index.cjs"),$e=require("../../Damped-CTsV8tl_.cjs"),Ue=require("../../Tweened-lT5myPAZ.cjs"),oe=require("../../controls/index.cjs"),kt=require("../../window-resizer/vanilla/index.cjs"),bt=require("../../scroll-entries/index.cjs"),Le=require("../../css-unit-parser/index.cjs"),S=require("../../css-property/index.cjs"),Ne=require("../../device/index.cjs"),Jt=require("../../element-resizer/vanilla/index.cjs"),Ge=require("../../gestures-DHLrn6Q8.cjs"),Re=require("../../dom-JBOkFLTh.cjs"),Ze=require("../../function-MthRj-GJ.cjs"),je=require("../../scroll-segment/index.cjs");var f,Qt,g,ft,V,Q;class Ke{constructor(h,e,i){s(this,f);s(this,Qt);s(this,g);s(this,ft,0);s(this,V,0);s(this,Q,null);r(this,f,h),r(this,Qt,e),r(this,g,i),bt.scrollEntries.register(t(this,f))}get index(){return t(this,Qt)}get size(){return t(this,ft)}get position(){return t(this,V)}destroy(){bt.scrollEntries.unregister(t(this,f)),this.unsetTransform()}unsetTransform(){t(this,f).style.transform="",this.mark(null),this.setSize()}setSize(h){h?(t(this,f).style.setProperty("--size",h+"px"),t(this,g).axisCSSProperty.current==="x"?(t(this,f).style.width=h+"px",t(this,f).style.height=""):(t(this,f).style.height=h+"px",t(this,f).style.width="")):(t(this,f).style.width="",t(this,f).style.height="",t(this,f).style.removeProperty("--size"))}resize(){r(this,ft,t(this,g).vertical?t(this,f).offsetHeight:t(this,f).offsetWidth),r(this,V,t(this,g).vertical?zt.getCumulativeOffsetTop(t(this,f)):zt.getCumulativeOffsetLeft(t(this,f))),r(this,V,t(this,V)-t(this,g).contentPosition)}transform(){let h=0;const e=t(this,g).viewportSize*t(this,g).sectionDistanceScaleCSSProperty.current;t(this,g).loopCSSProperty.current&&t(this,g).overscroll&&t(this,V)+t(this,ft)<t(this,g).currentScrollValue&&(h=t(this,g).distance*-1-t(this,g).gap),bt.scrollEntries.update(t(this,f),t(this,g).axisCSSProperty.current,h);const i=t(this,g).currentScrollValue+h,n=t(this,V)-t(this,g).viewportSize-e,d=t(this,V)+t(this,ft)+e,b=ke.clamp(i,n,d);t(this,g).vertical?t(this,f).style.transform=`translate3d(0px, ${b*-1}px, 0px)`:t(this,f).style.transform=`translate3d(${b*-1}px, 0px, 0px)`}mark(h){t(this,Q)!==h&&(t(this,Q)&&t(this,f).classList.remove(t(this,Q)),h&&t(this,f).classList.add(h),r(this,Q,h),le.dispatchEvent(t(this,f),"scrollSectionMarkChange",{composed:!0,detail:{mark:t(this,Q)},custom:!0}))}}f=new WeakMap,Qt=new WeakMap,g=new WeakMap,ft=new WeakMap,V=new WeakMap,Q=new WeakMap;const Je=ze.createStylesheet({":host":{position:"relative",width:"100%",height:"100%",display:"block",outline:"none"},".static":{position:"var(--static-position, absolute)",top:"var(--static-top, 0)",left:"var(--static-left, 0)",width:"var(--static-width, 100%)",height:"var(--static-height, 100%)"},".content-wrapper":{width:"100%",height:"100%",overflow:"var(--overflow, initial)"},".content":{position:"relative",display:"flex",width:"100%",height:"100%",gap:"var(--gap, 0px)",willChange:"var(--will-change, transform)"},":host(.hibernated) .content-wrapper":{display:"contents"},":host(.hibernated) .content":{display:"contents"},"::slotted(*)":{flexShrink:"0"}});var a,mt,x,X,B,_,H,T,Y,tt,W,et,gt,D,v,yt,vt,Ct,Pt,Rt,I,wt,st,q,it,F,rt,Et,$,U,nt,p,It,l,Xt,Yt,y,m,z,A,ht,M,P,w,Tt,ot,N,lt,xt,Dt,ct,G,qt,O,E,o,fe,Kt,Lt,ue,ae,me,ge,k,At,Ie,Mt,te,ye,ve,pt,de,ee;class Zt extends HTMLElement{constructor(){super();s(this,o);s(this,a,null);s(this,mt,new S.CSSProperty(this,"--controls",!0));s(this,x,new S.CSSProperty(this,"--axis","y"));s(this,X,new S.CSSProperty(this,"--reverse",!1));s(this,B,new S.CSSProperty(this,"--direction",0));s(this,_,new S.CSSProperty(this,"--pages",0,{validate:e=>Math.max(0,e-1)}));s(this,H,new S.CSSProperty(this,"--split",!1));s(this,T,new S.CSSProperty(this,"--sectional",!1));s(this,Y,new S.CSSProperty(this,"--tween-easing",!1));s(this,tt,new S.CSSProperty(this,"--tween-duration",!1));s(this,W,new S.CSSProperty(this,"--auto-size",!1));s(this,et,new S.CSSProperty(this,"--wheel-max-delta",!1));s(this,gt,new S.CSSProperty(this,"--drag-inertion",1));s(this,D,new S.CSSProperty(this,"--sections-in-view",1));s(this,v,new S.CSSProperty(this,"--loop",!1));s(this,yt,new S.CSSProperty(this,"--damping",20));s(this,vt,new S.CSSProperty(this,"--mass",0));s(this,Ct,new S.CSSProperty(this,"--stiffness",0));s(this,Pt,new S.CSSProperty(this,"--mouse-drag",!1));s(this,Rt,new S.CSSProperty(this,"--section-distance-scale",.5));s(this,I,new S.CSSProperty(this,"--autoplay",0));s(this,wt,new S.CSSProperty(this,"--autoplay-pause-duration",0));s(this,st,new S.CSSProperty(this,"--autoplay-user-direction",!1));s(this,q,new S.CSSProperty(this,"--classes",!1));s(this,it,new S.CSSProperty(this,"--current-index-start-offset",0));s(this,F,new S.CSSProperty(this,"--current-index-end-offset",0));s(this,rt,new S.CSSProperty(this,"--focus-delay",0));s(this,Et,new S.CSSProperty(this,"--focus-duration",3e3));s(this,$,new S.CSSProperty(this,"--disabled",!1));s(this,U,new S.CSSProperty(this,"--hibernate",!1));s(this,nt,null);s(this,p,null);s(this,It,null);s(this,l,[]);s(this,Xt,0);s(this,Yt,0);s(this,y,0);s(this,m,0);s(this,z,0);s(this,A,null);s(this,ht,null);s(this,M,null);s(this,P,null);s(this,w,new We.Store(0));s(this,Tt,0);s(this,ot,0);s(this,N,!1);s(this,lt,!0);s(this,xt,!0);s(this,Dt);s(this,ct);s(this,G,new Ue.Tweened);s(this,qt,!1);s(this,O,null);s(this,E,!1);s(this,k,()=>{if(t(this,U).current)return;t(this,a).unlistenAnimationFrame();const e=this.currentScrollValue/t(this,m)||0,i=t(this,w).current;if(r(this,Xt,this.vertical?zt.getCumulativeOffsetTop(this):zt.getCumulativeOffsetLeft(this)),r(this,Yt,this.vertical?zt.getCumulativeOffsetTop(t(this,p)):zt.getCumulativeOffsetLeft(t(this,p))),r(this,y,this.vertical?this.offsetHeight:this.offsetWidth),this.vertical?r(this,z,Le.cssUnitParser.parse(getComputedStyle(t(this,p)).rowGap)):r(this,z,Le.cssUnitParser.parse(getComputedStyle(t(this,p)).columnGap)),t(this,W).current&&t(this,l).length){const n=t(this,D).current,d=(t(this,y)-t(this,z)*(n-1))/n;t(this,l).forEach(b=>{b.setSize(d)})}else t(this,l).forEach(n=>{n.setSize()});if(t(this,l).forEach(n=>{n.resize()}),t(this,_).current){r(this,m,t(this,y)*t(this,_).current);const n=t(this,m)+t(this,y);this.vertical?(t(this,p).style.width=n+"px",t(this,p).style.height="100%"):(t(this,p).style.height=n+"px",t(this,p).style.width="100%")}else this.vertical?(t(this,p).style.width="100%",t(this,p).style.height="max-content",r(this,m,t(this,p).offsetHeight-t(this,y))):(t(this,p).style.width="max-content",t(this,p).style.height="100%",r(this,m,t(this,p).offsetWidth-t(this,y)));if(!t(this,v).current){const n=getComputedStyle(this),d=this.vertical?parseFloat(n.paddingBlockStart)+parseFloat(n.paddingBlockEnd):parseFloat(n.paddingInlineStart)+parseFloat(n.paddingInlineEnd);r(this,m,t(this,m)+d),t(this,a).max=t(this,m)}if(t(this,v).current&&t(this,l).length){const n=t(this,l)[t(this,l).length-1],d=n.position+n.size-t(this,y),b=t(this,m)-d;r(this,ot,n.position+n.size+b)}else r(this,ot,t(this,m));if(t(this,T).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,m),{equalize:!0});r(this,N,(this.vertical?t(this,p).offsetHeight:t(this,p).offsetWidth)>t(this,y)),this.classList.toggle("has-overflow",t(this,N)),t(this,N)?t(this,$).current||c(this,o,ae).call(this):c(this,o,ue).call(this),t(this,At).call(this)});s(this,At,()=>{if(!t(this,N)||t(this,U).current||t(this,$).current)return;const e=this.currentScrollValue;if(r(this,Tt,Math.max(0,e-t(this,m))),t(this,l).length){for(let i=0;i<t(this,l).length;i++)t(this,l)[i].transform();t(this,w).current=c(this,o,de).call(this)}else this.vertical?t(this,p).style.transform=`translate3d(0px, ${e*-1}px, 0px)`:t(this,p).style.transform=`translate3d(${e*-1}px, 0px, 0px)`;bt.scrollEntries.update(this,t(this,x).current,e)});s(this,Mt,(e,i)=>{t(this,mt).current&&(c(this,o,ye).call(this,Math.sign(i)||1),t(this,te).call(this,e,i))});s(this,te,(e,i)=>{if(t(this,B).current){if(t(this,B).current<0&&i>0)return;if(t(this,B).current>0&&i<0)return}if(t(this,ct)||t(this,G).unlistenAnimationFrame(),!t(this,I).current&&t(this,rt).current&&(clearInterval(t(this,Dt)),r(this,Dt,setTimeout(()=>{const n=t(this,l)[c(this,o,de).call(this)];n&&this.scrollToSection(n.index,{tween:{duration:t(this,Et).current,easing:Fe.easeInOutExpo}})},t(this,rt).current))),!(e.includes("drag")&&!Ne.device.isMobile&&!t(this,Pt).current)){if(t(this,T).current&&e!=="drag"){const n=Math.sign(i);if(t(this,l).length){const d={tween:t(this,Y).current||t(this,tt).current?{easing:t(this,Y).current||"easeInOutCubic",duration:t(this,tt).current||500}:void 0};t(this,qt)?this.scrollToSection(t(this,w).current,d):this.shiftSections(n,d)}else t(this,a).shift(n*t(this,y))}else t(this,a).shift(i);r(this,qt,e==="drag")}});s(this,ee,()=>{r(this,E,!0),this.hibernatedCSSProperty.current||c(this,o,ge).call(this)});if(Se.isBrowser){const e=this.attachShadow({mode:"open"});e.adoptedStyleSheets=[Je];const i=document.createElement("div");i.className="static",i.innerHTML='<slot name="static"></slot>',e.appendChild(i),r(this,nt,document.createElement("div")),t(this,nt).className="content-wrapper",r(this,p,document.createElement("div")),t(this,p).className="content",r(this,It,document.createElement("slot")),t(this,p).appendChild(t(this,It)),t(this,nt).appendChild(t(this,p)),e.appendChild(t(this,nt))}}get damped(){return t(this,a)}get controlsCSSProperty(){return t(this,mt)}get axisCSSProperty(){return t(this,x)}get reverseCSSProperty(){return t(this,X)}get directionCSSProperty(){return t(this,B)}get pagesCSSProperty(){return t(this,_)}get splitCSSProperty(){return t(this,H)}get sectionalCSSProperty(){return t(this,T)}get easingCSSProperty(){return t(this,Y)}get durationCSSProperty(){return t(this,tt)}get autoSizeCSSProperty(){return t(this,W)}get wheelMaxDeltaCSSProperty(){return t(this,et)}get dragInertionCSSProperty(){return t(this,gt)}get sectionsInViewCSSProperty(){return t(this,D)}get loopCSSProperty(){return t(this,v)}get dampingCSSProperty(){return t(this,yt)}get massCSSProperty(){return t(this,vt)}get stiffnessCSSProperty(){return t(this,Ct)}get mouseDragCSSProperty(){return t(this,Pt)}get sectionDistanceScaleCSSProperty(){return t(this,Rt)}get autoplayCSSProperty(){return t(this,I)}get autoplayPauseDurationCSSProperty(){return t(this,wt)}get autoplayUserDirectionCSSProperty(){return t(this,st)}get classesCSSProperty(){return t(this,q)}get currentIndexStartOffsetCSSProperty(){return t(this,it)}get currentIndexEndOffsetCSSProperty(){return t(this,F)}get focusDelayCSSProperty(){return t(this,rt)}get focusDurationCSSProperty(){return t(this,Et)}get disabledCSSProperty(){return t(this,$)}get hibernatedCSSProperty(){return t(this,U)}get currentScrollValue(){return c(this,o,ve).call(this,"current")}get targetScrollValue(){return c(this,o,ve).call(this,"target")}get contentWrapperElement(){return t(this,nt)}get contentElement(){return t(this,p)}get sections(){return t(this,l)}get position(){return t(this,Xt)}get contentPosition(){return t(this,Yt)}get viewportSize(){return t(this,y)}get scrollSize(){return t(this,m)}get gap(){return t(this,z)}get counter(){return t(this,w)}get limit(){return Math.ceil(t(this,l).length-t(this,D).current)}get distance(){return t(this,ot)}get loopDistance(){return t(this,v).current?t(this,ot)+t(this,z):t(this,ot)}get hasOverflow(){return t(this,N)}get overscroll(){return t(this,Tt)}get scrollLine(){return t(this,O)}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 d=e-n,b=d+i+n*2;return this.currentProgress<d?0:this.currentProgress>b?1:(this.currentProgress-d)/(b-d)}curve(e,i,n=0){return Math.sin(this.range(e,i,n)*Math.PI)}visible(e,i,n=0){const d=e-n,b=d+i+n*2;return this.currentProgress>=d&&this.currentProgress<=b}scrollToSection(e,i){if(!t(this,l).length)return;const n=t(this,w).current,d=c(this,o,Ie).call(this,e),b=t(this,l)[n],C=t(this,l)[d];if(b&&C){let R=0;const pe=c(this,o,de).call(this),jt=t(this,l)[pe],Ve=jt?this.targetScrollValue-jt.position:0;t(this,v).current?d===0&&n===t(this,l).length-1?R=t(this,m)+t(this,y)-b.position+t(this,z):d===t(this,l).length-1&&n===0?R=C.position-(t(this,m)+t(this,y)+t(this,z)):R=C.position-b.position:R=C.position-b.position,this.shiftPosition(R-Ve,i)}}shiftSections(e,i){t(this,l).length&&this.scrollToSection(t(this,w).current+e,i)}setPosition(e,i){c(this,o,ye).call(this,Math.sign(e)||1),i!=null&&i.tween?t(this,ct)||(t(this,G).set(t(this,a).current,{equalize:!0}),t(this,G).set(e,xe({},i.tween)),r(this,ct,setTimeout(()=>{r(this,ct,void 0)},i.tween.duration||0))):t(this,a).set(e,{equalize:(i==null?void 0:i.behaviour)==="instant"})}shiftPosition(e,i){this.setPosition(t(this,a).target+e,i)}connectedCallback(){bt.scrollEntries.register(this),r(this,a,new $e.Damped(0,{damping:.01,min:0,order:ce.TICK_ORDER.SCROLL})),this.setAttribute("tabindex","0"),r(this,A,new oe.WheelControls({element:t(this,p)})),t(this,A).changeEvent.subscribe(t(this,Mt)),r(this,ht,new oe.KeyboardControls({element:this})),t(this,ht).changeEvent.subscribe(t(this,Mt)),r(this,M,new oe.DragControls({element:t(this,p)})),t(this,M).changeEvent.subscribe(t(this,Mt)),r(this,P,new oe.AutoplayControls({culling:this})),t(this,P).changeEvent.subscribe(t(this,te)),t(this,x).subscribe(()=>{c(this,o,fe).call(this)}),t(this,X).subscribe(()=>{c(this,o,fe).call(this)}),t(this,et).subscribe(e=>{t(this,A).axis=e.current?"max":t(this,x).current}),t(this,gt).subscribe(e=>{t(this,M).inertion=typeof e.current=="number"?e.current:1}),t(this,_).subscribe(()=>{t(this,E)&&t(this,k).call(this)}),t(this,H).subscribe(({current:e})=>{t(this,E)&&(e?c(this,o,Kt).call(this):c(this,o,Lt).call(this))}),t(this,T).subscribe(e=>{t(this,A).debounce=e.current,t(this,M).swipe=e.current,t(this,P).interval=e.current,t(this,E)&&(e.current&&!e.previous&&!t(this,l).length?c(this,o,Kt).call(this):!e.current&&e.previous&&t(this,l).length&&c(this,o,Lt).call(this))}),t(this,W).subscribe(e=>{t(this,E)&&(t(this,k).call(this),e.current&&!e.previous&&!t(this,l).length?c(this,o,Kt).call(this):!e.current&&e.previous&&t(this,l).length&&c(this,o,Lt).call(this))}),t(this,D).subscribe(e=>{t(this,E)&&(t(this,k).call(this),c(this,o,pt).call(this))}),t(this,v).subscribe(e=>{e.current?(t(this,E)&&(t(this,l).length||(t(this,H).current=!0)),t(this,a).max=1/0,t(this,a).min=-1/0):(r(this,Tt,0),t(this,a).max=t(this,m),t(this,a).min=0)}),t(this,yt).subscribe(e=>{t(this,a).damping=e.current}),t(this,vt).subscribe(e=>{t(this,a).mass=e.current}),t(this,Ct).subscribe(e=>{t(this,a).stiffness=e.current}),t(this,I).subscribe(e=>{t(this,P).speed=e.current,!t(this,lt)&&e.current&&!e.previous?t(this,P).connect():!e.current&&e.previous&&t(this,P).disconnect()}),t(this,st).subscribe(e=>{e.current||(t(this,P).direction=1)}),t(this,q).subscribe(e=>{t(this,E)&&c(this,o,pt).call(this)}),t(this,it).subscribe(e=>{t(this,E)&&t(this,q).current&&c(this,o,pt).call(this)}),t(this,F).subscribe(e=>{t(this,E)&&t(this,q).current&&c(this,o,pt).call(this)}),t(this,a).isRunning.subscribe(e=>{this.classList.toggle("active",e.current)}),t(this,w).subscribe(e=>{t(this,l).length&&c(this,o,pt).call(this)}),t(this,G).subscribe(e=>{t(this,G).isRunning.current&&t(this,a).set(e.current,{equalize:!0})}),t(this,$).subscribe(e=>{e.current&&!e.previous?(this.classList.add("disabled"),c(this,o,ue).call(this)):!e.current&&e.previous&&(this.classList.remove("disabled"),c(this,o,ae).call(this))}),t(this,U).subscribe(e=>{e.current&&!e.previous?(this.classList.add("hibernated"),c(this,o,me).call(this)):!e.current&&e.previous&&(this.classList.remove("hibernated"),c(this,o,ge).call(this))}),t(this,mt).observe(),t(this,x).observe(),t(this,X).observe(),t(this,B).observe(),t(this,_).observe(),t(this,H).observe(),t(this,T).observe(),t(this,Y).observe(),t(this,tt).observe(),t(this,W).observe(),t(this,et).observe(),t(this,gt).observe(),t(this,D).observe(),t(this,v).observe(),t(this,yt).observe(),t(this,vt).observe(),t(this,Ct).observe(),t(this,Pt).observe(),t(this,Rt).observe(),t(this,I).observe(),t(this,I).observe(),t(this,wt).observe(),t(this,st).observe(),t(this,q).observe(),t(this,it).observe(),t(this,F).observe(),t(this,rt).observe(),t(this,Et).observe(),t(this,$).observe(),t(this,U).observe(),kt.windowResizer.subscribe(t(this,ee),ce.RESIZE_ORDER.LAST)}disconnectedCallback(){this.removeAttribute("tabindex"),this.classList.remove("disabled"),this.classList.remove("hibernated"),t(this,mt).unobserve(),t(this,x).unobserve(),t(this,X).unobserve(),t(this,B).unobserve(),t(this,_).unobserve(),t(this,H).unobserve(),t(this,T).unobserve(),t(this,Y).unobserve(),t(this,tt).unobserve(),t(this,W).unobserve(),t(this,et).unobserve(),t(this,gt).unobserve(),t(this,D).unobserve(),t(this,v).unobserve(),t(this,yt).unobserve(),t(this,vt).unobserve(),t(this,Ct).unobserve(),t(this,Pt).unobserve(),t(this,Rt).unobserve(),t(this,I).unobserve(),t(this,wt).unobserve(),t(this,st).unobserve(),t(this,q).unobserve(),t(this,it).unobserve(),t(this,F).unobserve(),t(this,rt).unobserve(),t(this,Et).unobserve(),t(this,$).unobserve(),t(this,U).unobserve(),kt.windowResizer.unsubscribe(t(this,ee)),c(this,o,me).call(this)}}a=new WeakMap,mt=new WeakMap,x=new WeakMap,X=new WeakMap,B=new WeakMap,_=new WeakMap,H=new WeakMap,T=new WeakMap,Y=new WeakMap,tt=new WeakMap,W=new WeakMap,et=new WeakMap,gt=new WeakMap,D=new WeakMap,v=new WeakMap,yt=new WeakMap,vt=new WeakMap,Ct=new WeakMap,Pt=new WeakMap,Rt=new WeakMap,I=new WeakMap,wt=new WeakMap,st=new WeakMap,q=new WeakMap,it=new WeakMap,F=new WeakMap,rt=new WeakMap,Et=new WeakMap,$=new WeakMap,U=new WeakMap,nt=new WeakMap,p=new WeakMap,It=new WeakMap,l=new WeakMap,Xt=new WeakMap,Yt=new WeakMap,y=new WeakMap,m=new WeakMap,z=new WeakMap,A=new WeakMap,ht=new WeakMap,M=new WeakMap,P=new WeakMap,w=new WeakMap,Tt=new WeakMap,ot=new WeakMap,N=new WeakMap,lt=new WeakMap,xt=new WeakMap,Dt=new WeakMap,ct=new WeakMap,G=new WeakMap,qt=new WeakMap,O=new WeakMap,E=new WeakMap,o=new WeakSet,fe=function(){const e=t(this,x).current,i=t(this,X).current?"-reverse":"";t(this,p).style.flexDirection=e==="x"?`row${i}`:`column${i}`,t(this,A).axis=t(this,et).current?"max":e,t(this,ht).dimension=e==="x"?"width":"height",t(this,M).axis=e,e==="x"?this.style.touchAction="pan-y":e==="y"&&(this.style.touchAction="pan-x"),t(this,E)&&t(this,k).call(this)},Kt=function(){c(this,o,Lt).call(this),t(this,It).assignedElements().forEach((e,i)=>{e instanceof HTMLElement&&t(this,l).push(new Ke(e,i,this))}),t(this,p).style.transform="",le.dispatchEvent(this,"scrollSectionsChange",{custom:!0,composed:!0}),t(this,k).call(this),c(this,o,pt).call(this)},Lt=function(){t(this,l).forEach(e=>{e.destroy()}),r(this,l,[]),t(this,w).reset(),t(this,a).reset(),le.dispatchEvent(this,"scrollSectionsChange",{custom:!0,composed:!0})},ue=function(){t(this,lt)||(r(this,lt,!0),t(this,a).unsubscribe(t(this,At)),t(this,a).unlistenAnimationFrame(),clearInterval(t(this,Dt)),clearInterval(t(this,ct)),t(this,G).unlistenAnimationFrame(),t(this,A).disconnect(),t(this,ht).disconnect(),t(this,M).disconnect(),t(this,P).disconnect(),t(this,N)||this.sections.forEach(e=>{e.unsetTransform()}))},ae=function(){t(this,lt)&&(r(this,lt,!1),t(this,a).subscribe(t(this,At)),t(this,A).connect(),t(this,ht).connect(),t(this,M).connect(),t(this,I).current&&t(this,P).connect())},me=function(){t(this,xt)||(r(this,xt,!0),kt.windowResizer.unsubscribe(t(this,k)),Jt.elementResizer.unsubscribe(t(this,k)),c(this,o,ue).call(this),t(this,p).style.transform="",t(this,p).style.height="",t(this,p).style.width="",this.classList.remove("has-overflow","start","end"),t(this,l).length?c(this,o,Lt).call(this):(t(this,w).reset(),t(this,a).reset()),bt.scrollEntries.unregister(this))},ge=function(){t(this,xt)&&(r(this,xt,!1),bt.scrollEntries.register(this),(t(this,v).current||t(this,H).current||t(this,v).current||t(this,W).current||t(this,T).current)&&c(this,o,Kt).call(this),c(this,o,ae).call(this),kt.windowResizer.subscribe(t(this,k),ce.RESIZE_ORDER.SCROLL),Jt.elementResizer.subscribe(this,t(this,k)))},k=new WeakMap,At=new WeakMap,Ie=function(e){let i=t(this,w).current;return t(this,v).current?(i=e%t(this,l).length,i=i<0?t(this,l).length+i:i):i=ke.clamp(e,0,this.limit),i},Mt=new WeakMap,te=new WeakMap,ye=function(e=1){t(this,st).current&&(t(this,P).direction=e),t(this,I).current&&t(this,P).pauseAndContinue(t(this,wt).current,this.sectionalCSSProperty.current)},ve=function(e="current"){if(t(this,v).current&&t(this,l).length){const i=t(this,a)[e]%(t(this,m)+t(this,y)+t(this,z));return i<0?t(this,m)+i+t(this,y)+t(this,z):i}else return t(this,a)[e]},pt=function(){if(t(this,l).length){const e=t(this,w).current+t(this,it).current;if(e===0?r(this,O,"start"):e===this.limit?r(this,O,"end"):r(this,O,null),le.dispatchEvent(this,"scrollLine",{detail:{line:t(this,O)}}),t(this,q).current){this.classList.remove("end","start"),t(this,O)&&this.classList.add(t(this,O));const i=t(this,D).current+t(this,F).current;t(this,l).forEach((n,d)=>{const b=e-this.limit-1+t(this,F).current,C=e+i,R=this.sections.length-C;d>=e&&d<C||d<=b?n.mark("current"):d>=C&&d<C+R/2||d<=b+i?n.mark("next"):n.mark("previous")})}}},de=function(){let e=this.targetScrollValue,i=1/0,n=0;const d=t(this,a).direction;for(let b=0;b<t(this,l).length;b++){const C=t(this,l)[b];let R=t(this,qt)?C.size*d*-1*.4:0,pe=C.position;const jt=Math.abs(pe+R-e);jt<i&&(i=jt,n=b)}return n},ee=new WeakMap;customElements.get("e-scroll")||customElements.define("e-scroll",Zt);var se;class Ce extends HTMLElement{constructor(){super(...arguments);s(this,se,null)}get scrollElement(){return t(this,se)}connectedCallback(){const e=Re.findParentElement(this,Zt);e instanceof Zt?r(this,se,e):console.error(this,"e-scroll not found")}}se=new WeakMap;var ut,L,Z,j,Ot,Vt,at,Bt,ie,re;class Te extends Ce{constructor(){super();s(this,ut,null);s(this,L,null);s(this,Z,!1);s(this,j,0);s(this,Ot,0);s(this,Vt,0);s(this,at,()=>{r(this,Z,this.offsetWidth>this.offsetHeight);const e=t(this,Z)?this.offsetWidth:this.offsetHeight;r(this,j,e/((this.scrollElement.scrollSize+this.scrollElement.viewportSize)/e)),r(this,j,Math.max(t(this,j),30)),t(this,Z)?(t(this,L).style.width=t(this,j)+"px",t(this,L).style.height="100%"):(t(this,L).style.width="100%",t(this,L).style.height=t(this,j)+"px"),r(this,Ot,e-t(this,j)),this.scrollElement.scrollSize<=0?this.style.display="none":this.style.display="",t(this,Bt).call(this)});s(this,Bt,()=>{r(this,Vt,this.scrollElement.currentProgress*t(this,Ot)),t(this,Z)?t(this,L).style.transform=`translate3d(${t(this,Vt)}px, 0px, 0px)`:t(this,L).style.transform=`translate3d(0px, ${t(this,Vt)}px, 0px)`});s(this,ie,()=>{this.setAttribute("axis",this.scrollElement.axisCSSProperty.current)});s(this,re,e=>{document.documentElement.classList.add("grabbing"),Ge.setupDrag(d=>{const b=t(this,Z)?d.x:d.y,C=this.scrollElement.distance/t(this,Ot),R=(b-n)*C;this.scrollElement.setPosition(i+R)},()=>{document.documentElement.classList.remove("grabbing")});const i=this.scrollElement.damped.target,n=t(this,Z)?e.x:e.y});if(Se.isBrowser){const e=this.attachShadow({mode:"open"});e.adoptedStyleSheets=[ze.createStylesheet({":host":{display:"inline-block",zIndex:"1",backgroundColor:"#ebebeb"},':host([axis="y"])':{position:"absolute",right:"0",top:"0",width:"1vmin",height:"100%"},':host([axis="x"])':{position:"absolute",left:"0",bottom:"0",width:"100%",height:"1vmin"},".default-thumb":{backgroundColor:"var(--thumb-color, black)",borderRadius:"var(--thumb-radius, 0px)",touchAction:"none"},"::slotted(*)":{touchAction:"none"}})],r(this,ut,document.createElement("slot")),t(this,ut).innerHTML='<div class="default-thumb"></div>',e.appendChild(t(this,ut))}}get thumbElement(){return t(this,L)}connectedCallback(){super.connectedCallback(),this.setAttribute("drag-dead-zone","");const e=t(this,ut).assignedElements()[0]||t(this,ut).firstElementChild;r(this,L,e),t(this,L).addEventListener("pointerdown",t(this,re)),kt.windowResizer.subscribe(t(this,at),ce.RESIZE_ORDER.SCROLL),Jt.elementResizer.subscribe(this,t(this,at)),Jt.elementResizer.subscribe(this.scrollElement,t(this,at)),this.scrollElement.onScroll(t(this,Bt)),this.scrollElement.axisCSSProperty.subscribe(t(this,ie))}disconnectedCallback(){this.removeAttribute("drag-dead-zone"),this.style.display="",t(this,L).removeEventListener("pointerdown",t(this,re)),kt.windowResizer.unsubscribe(t(this,at)),Jt.elementResizer.unsubscribe(t(this,at)),this.scrollElement.offScroll(t(this,Bt)),this.scrollElement.axisCSSProperty.unsubscribe(t(this,ie))}}ut=new WeakMap,L=new WeakMap,Z=new WeakMap,j=new WeakMap,Ot=new WeakMap,Vt=new WeakMap,at=new WeakMap,Bt=new WeakMap,ie=new WeakMap,re=new WeakMap;customElements.get("e-scrollbar")||customElements.define("e-scrollbar",Te);var _t,Ht,Wt;class De extends Ce{constructor(){super();s(this,_t,new S.CSSProperty(this,"--behaviour","smooth"));s(this,Ht,new S.CSSProperty(this,"--tween-easing",!1));s(this,Wt,new S.CSSProperty(this,"--tween-duration",0));Se.isBrowser&&this.addEventListener("click",()=>{const e=t(this,_t).current,i=t(this,Ht).current,n=t(this,Wt).current;this.handleClick({behaviour:e,tween:i||n?{easing:i,duration:n}:void 0})})}connectedCallback(){super.connectedCallback(),t(this,_t).observe(),t(this,Ht).observe(),t(this,Wt).observe()}disconnectedCallback(){t(this,_t).close(),t(this,Ht).close(),t(this,Wt).close()}}_t=new WeakMap,Ht=new WeakMap,Wt=new WeakMap;var Ft;class qe extends De{constructor(){super(...arguments);s(this,Ft,new S.CSSProperty(this,"--set",1))}handleClick(e){this.scrollElement.scrollToSection(t(this,Ft).current,e)}connectedCallback(){super.connectedCallback(),t(this,Ft).observe()}disconnectedCallback(){super.disconnectedCallback(),t(this,Ft).close()}}Ft=new WeakMap;customElements.get("e-scroll-set-button")||customElements.define("e-scroll-set-button",qe);var K,$t;class Ae extends De{constructor(){super(...arguments);s(this,K,new S.CSSProperty(this,"--step",1));s(this,$t,()=>{this.scrollElement.loopCSSProperty.current?this.removeAttribute("disabled"):t(this,K).current>0&&this.scrollElement.scrollLine==="end"||t(this,K).current<0&&this.scrollElement.scrollLine==="start"?this.setAttribute("disabled",""):this.removeAttribute("disabled")})}handleClick(e){this.scrollElement.shiftSections(t(this,K).current,e)}connectedCallback(){super.connectedCallback(),this.scrollElement&&(t(this,K).subscribe(()=>{t(this,$t).call(this)}),t(this,K).observe(),this.scrollElement.addEventListener("scrollLine",t(this,$t)),t(this,$t).call(this))}disconnectedCallback(){super.disconnectedCallback(),t(this,K).close(),this.removeAttribute("disabled")}}K=new WeakMap,$t=new WeakMap;customElements.get("e-scroll-step-button")||customElements.define("e-scroll-step-button",Ae);var J,dt,Ut,ne,he,Nt;class Qe{constructor(h,e,i){s(this,J,null);s(this,dt,null);s(this,Ut,null);s(this,ne,null);s(this,he,()=>{t(this,dt).scrollToSection(t(this,Ut),{behaviour:t(this,ne)})});s(this,Nt,()=>{t(this,J).classList.toggle("current",t(this,dt).counter.current===t(this,Ut))});Se.isBrowser&&(r(this,J,document.createElement("button")),r(this,dt,h),r(this,ne,i),r(this,Ut,e),t(this,J).addEventListener("click",t(this,he)),t(this,dt).counter.subscribe(t(this,Nt)),t(this,Nt).call(this))}get element(){return t(this,J)}destroy(){t(this,J).removeEventListener("click",t(this,he)),t(this,dt).counter.unsubscribe(t(this,Nt)),t(this,J).remove()}}J=new WeakMap,dt=new WeakMap,Ut=new WeakMap,ne=new WeakMap,he=new WeakMap,Nt=new WeakMap;var St,Gt;class Me extends Ce{constructor(){super(...arguments);s(this,St,[]);s(this,Gt,Ze.debounce(()=>{t(this,St).forEach(e=>e.destroy()),r(this,St,[]);for(let e=0;e<this.scrollElement.sections.length;e++){const i=new Qe(this.scrollElement,e,this.getAttribute("behaviour")||"smooth");this.appendChild(i.element),t(this,St).push(i)}},0))}connectedCallback(){super.connectedCallback(),this.scrollElement.addEventListener("sectionsChange",t(this,Gt)),t(this,Gt).call(this)}disconnectedCallback(){this.scrollElement.removeEventListener("sectionsChange",t(this,Gt)),t(this,St).forEach(e=>e.destroy()),r(this,St,[])}}St=new WeakMap,Gt=new WeakMap;customElements.get("e-scroll-bullet-buttons")||customElements.define("e-scroll-bullet-buttons",Me);class Oe extends je.ScrollSegmentElement{connectedCallback(){const h=Re.findParentElement(this,Zt);h instanceof Zt?(this.scrollContainer=h,this.scrollContainer.addEventListener("scrollSectionsChange",this.findAnotherScrollEntries)):console.error(this,"e-scroll not found")}}customElements.get("e-scroll-segment")||customElements.define("e-scroll-segment",Oe);exports.ScrollBulletButtonsElement=Me;exports.ScrollElement=Zt;exports.ScrollSegmentElement=Oe;exports.ScrollSetButtonElement=qe;exports.ScrollStepButtonElement=Ae;exports.ScrollbarElement=Te;
|
|
1
|
+
"use strict";var Be=Object.defineProperty;var Pe=Object.getOwnPropertySymbols;var _e=Object.prototype.hasOwnProperty,He=Object.prototype.propertyIsEnumerable;var Ee=u=>{throw TypeError(u)};var we=(u,h,e)=>h in u?Be(u,h,{enumerable:!0,configurable:!0,writable:!0,value:e}):u[h]=e,xe=(u,h)=>{for(var e in h||(h={}))_e.call(h,e)&&we(u,e,h[e]);if(Pe)for(var e of Pe(h))He.call(h,e)&&we(u,e,h[e]);return u};var be=(u,h,e)=>h.has(u)||Ee("Cannot "+e);var t=(u,h,e)=>(be(u,h,"read from private field"),e?e.call(u):h.get(u)),s=(u,h,e)=>h.has(u)?Ee("Cannot add the same private member more than once"):h instanceof WeakSet?h.add(u):h.set(u,e),r=(u,h,e,i)=>(be(u,h,"write to private field"),i?i.call(u,e):h.set(u,e),e),c=(u,h,e)=>(be(u,h,"access private method"),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const We=require("../../Store-CDb6RMce.cjs"),Se=require("../../browser-CpzFX2xg.cjs"),Fe=require("../../easings-GegIwET5.cjs"),le=require("../../events-KVanG9sR.cjs"),ze=require("../../jss-GJLvaNfT.cjs"),zt=require("../../layout-8ryRAMGJ.cjs"),ke=require("../../math-GDWEqu7y.cjs"),$e=require("../../polyfills-BANSrI_m.cjs");require("../../ticker/vanilla/index.cjs");const ce=require("../../order/index.cjs"),Ne=require("../../Damped-DbVDDRZi.cjs"),Ue=require("../../Tweened-DEqfwKKF.cjs"),oe=require("../../controls/index.cjs"),kt=require("../../window-resizer/vanilla/index.cjs"),bt=require("../../scroll-entries/index.cjs"),Le=require("../../css-unit-parser/index.cjs"),S=require("../../css-property/index.cjs"),Ge=require("../../device/index.cjs"),Jt=require("../../element-resizer/vanilla/index.cjs"),Ze=require("../../gestures-DHLrn6Q8.cjs"),Re=require("../../dom-JBOkFLTh.cjs"),je=require("../../function-MthRj-GJ.cjs"),Ke=require("../../scroll-segment/index.cjs");var f,Qt,g,ft,V,Q;class Je{constructor(h,e,i){s(this,f);s(this,Qt);s(this,g);s(this,ft,0);s(this,V,0);s(this,Q,null);r(this,f,h),r(this,Qt,e),r(this,g,i),bt.scrollEntries.register(t(this,f))}get index(){return t(this,Qt)}get size(){return t(this,ft)}get position(){return t(this,V)}destroy(){bt.scrollEntries.unregister(t(this,f)),this.unsetTransform()}unsetTransform(){t(this,f).style.transform="",this.mark(null),this.setSize()}setSize(h){h?(t(this,f).style.setProperty("--size",h+"px"),t(this,g).axisCSSProperty.current==="x"?(t(this,f).style.width=h+"px",t(this,f).style.height=""):(t(this,f).style.height=h+"px",t(this,f).style.width="")):(t(this,f).style.width="",t(this,f).style.height="",t(this,f).style.removeProperty("--size"))}resize(){r(this,ft,t(this,g).vertical?t(this,f).offsetHeight:t(this,f).offsetWidth),r(this,V,t(this,g).vertical?zt.getCumulativeOffsetTop(t(this,f)):zt.getCumulativeOffsetLeft(t(this,f))),r(this,V,t(this,V)-t(this,g).contentPosition)}transform(){let h=0;const e=t(this,g).viewportSize*t(this,g).sectionDistanceScaleCSSProperty.current;t(this,g).loopCSSProperty.current&&t(this,g).overscroll&&t(this,V)+t(this,ft)<t(this,g).currentScrollValue&&(h=t(this,g).distance*-1-t(this,g).gap),bt.scrollEntries.update(t(this,f),t(this,g).axisCSSProperty.current,h);const i=t(this,g).currentScrollValue+h,n=t(this,V)-t(this,g).viewportSize-e,d=t(this,V)+t(this,ft)+e,b=ke.clamp(i,n,d);t(this,g).vertical?t(this,f).style.transform=`translate3d(0px, ${b*-1}px, 0px)`:t(this,f).style.transform=`translate3d(${b*-1}px, 0px, 0px)`}mark(h){t(this,Q)!==h&&(t(this,Q)&&t(this,f).classList.remove(t(this,Q)),h&&t(this,f).classList.add(h),r(this,Q,h),le.dispatchEvent(t(this,f),"scrollSectionMarkChange",{composed:!0,detail:{mark:t(this,Q)},custom:!0}))}}f=new WeakMap,Qt=new WeakMap,g=new WeakMap,ft=new WeakMap,V=new WeakMap,Q=new WeakMap;const Qe=ze.createStylesheet({":host":{position:"relative",width:"100%",height:"100%",display:"block",outline:"none"},".static":{position:"var(--static-position, absolute)",top:"var(--static-top, 0)",left:"var(--static-left, 0)",width:"var(--static-width, 100%)",height:"var(--static-height, 100%)"},".content-wrapper":{width:"100%",height:"100%",overflow:"var(--overflow, initial)"},".content":{position:"relative",display:"flex",width:"100%",height:"100%",gap:"var(--gap, 0px)",willChange:"var(--will-change, transform)"},":host(.hibernated) .content-wrapper":{display:"contents"},":host(.hibernated) .content":{display:"contents"},"::slotted(*)":{flexShrink:"0"}});var a,mt,x,X,B,_,H,T,Y,tt,W,et,gt,q,v,yt,vt,Ct,Pt,Rt,I,wt,st,D,it,F,rt,Et,$,N,nt,p,It,l,Xt,Yt,y,m,z,A,ht,M,P,w,Tt,ot,U,lt,xt,qt,ct,G,Dt,O,E,o,fe,Kt,Lt,ue,ae,me,ge,k,At,Ie,Mt,te,ye,ve,pt,de,ee;class Zt extends HTMLElement{constructor(){super();s(this,o);s(this,a,null);s(this,mt,new S.CSSProperty(this,"--controls",!0));s(this,x,new S.CSSProperty(this,"--axis","y"));s(this,X,new S.CSSProperty(this,"--reverse",!1));s(this,B,new S.CSSProperty(this,"--direction",0));s(this,_,new S.CSSProperty(this,"--pages",0,{validate:e=>Math.max(0,e-1)}));s(this,H,new S.CSSProperty(this,"--split",!1));s(this,T,new S.CSSProperty(this,"--sectional",!1));s(this,Y,new S.CSSProperty(this,"--tween-easing",!1));s(this,tt,new S.CSSProperty(this,"--tween-duration",!1));s(this,W,new S.CSSProperty(this,"--auto-size",!1));s(this,et,new S.CSSProperty(this,"--wheel-max-delta",!1));s(this,gt,new S.CSSProperty(this,"--drag-inertion",1));s(this,q,new S.CSSProperty(this,"--sections-in-view",1));s(this,v,new S.CSSProperty(this,"--loop",!1));s(this,yt,new S.CSSProperty(this,"--damping",20));s(this,vt,new S.CSSProperty(this,"--mass",0));s(this,Ct,new S.CSSProperty(this,"--stiffness",0));s(this,Pt,new S.CSSProperty(this,"--mouse-drag",!1));s(this,Rt,new S.CSSProperty(this,"--section-distance-scale",.5));s(this,I,new S.CSSProperty(this,"--autoplay",0));s(this,wt,new S.CSSProperty(this,"--autoplay-pause-duration",0));s(this,st,new S.CSSProperty(this,"--autoplay-user-direction",!1));s(this,D,new S.CSSProperty(this,"--classes",!1));s(this,it,new S.CSSProperty(this,"--current-index-start-offset",0));s(this,F,new S.CSSProperty(this,"--current-index-end-offset",0));s(this,rt,new S.CSSProperty(this,"--focus-delay",0));s(this,Et,new S.CSSProperty(this,"--focus-duration",3e3));s(this,$,new S.CSSProperty(this,"--disabled",!1));s(this,N,new S.CSSProperty(this,"--hibernate",!1));s(this,nt,null);s(this,p,null);s(this,It,null);s(this,l,[]);s(this,Xt,0);s(this,Yt,0);s(this,y,0);s(this,m,0);s(this,z,0);s(this,A,null);s(this,ht,null);s(this,M,null);s(this,P,null);s(this,w,new We.Store(0));s(this,Tt,0);s(this,ot,0);s(this,U,!1);s(this,lt,!0);s(this,xt,!0);s(this,qt);s(this,ct);s(this,G,new Ue.Tweened);s(this,Dt,!1);s(this,O,null);s(this,E,!1);s(this,k,()=>{if(t(this,N).current)return;t(this,a).unlistenAnimationFrame();const e=this.currentScrollValue/t(this,m)||0,i=t(this,w).current;if(r(this,Xt,this.vertical?zt.getCumulativeOffsetTop(this):zt.getCumulativeOffsetLeft(this)),r(this,Yt,this.vertical?zt.getCumulativeOffsetTop(t(this,p)):zt.getCumulativeOffsetLeft(t(this,p))),r(this,y,this.vertical?this.offsetHeight:this.offsetWidth),this.vertical?r(this,z,Le.cssUnitParser.parse(getComputedStyle(t(this,p)).rowGap)):r(this,z,Le.cssUnitParser.parse(getComputedStyle(t(this,p)).columnGap)),t(this,W).current&&t(this,l).length){const n=t(this,q).current,d=(t(this,y)-t(this,z)*(n-1))/n;t(this,l).forEach(b=>{b.setSize(d)})}else t(this,l).forEach(n=>{n.setSize()});if(t(this,l).forEach(n=>{n.resize()}),t(this,_).current){r(this,m,t(this,y)*t(this,_).current);const n=t(this,m)+t(this,y);this.vertical?(t(this,p).style.width=n+"px",t(this,p).style.height="100%"):(t(this,p).style.height=n+"px",t(this,p).style.width="100%")}else this.vertical?(t(this,p).style.width="100%",t(this,p).style.height="max-content",r(this,m,t(this,p).offsetHeight-t(this,y))):(t(this,p).style.width="max-content",t(this,p).style.height="100%",r(this,m,t(this,p).offsetWidth-t(this,y)));if(!t(this,v).current){const n=getComputedStyle(this),d=this.vertical?parseFloat(n.paddingBlockStart)+parseFloat(n.paddingBlockEnd):parseFloat(n.paddingInlineStart)+parseFloat(n.paddingInlineEnd);r(this,m,t(this,m)+d),t(this,a).max=t(this,m)}if(t(this,v).current&&t(this,l).length){const n=t(this,l)[t(this,l).length-1],d=n.position+n.size-t(this,y),b=t(this,m)-d;r(this,ot,n.position+n.size+b)}else r(this,ot,t(this,m));if(t(this,T).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,m),{equalize:!0});r(this,U,(this.vertical?t(this,p).offsetHeight:t(this,p).offsetWidth)>t(this,y)),this.classList.toggle("has-overflow",t(this,U)),t(this,U)?t(this,$).current||c(this,o,ae).call(this):c(this,o,ue).call(this),t(this,At).call(this)});s(this,At,()=>{if(!t(this,U)||t(this,N).current||t(this,$).current)return;const e=this.currentScrollValue;if(r(this,Tt,Math.max(0,e-t(this,m))),t(this,l).length){for(let i=0;i<t(this,l).length;i++)t(this,l)[i].transform();t(this,w).current=c(this,o,de).call(this)}else this.vertical?t(this,p).style.transform=`translate3d(0px, ${e*-1}px, 0px)`:t(this,p).style.transform=`translate3d(${e*-1}px, 0px, 0px)`;bt.scrollEntries.update(this,t(this,x).current,e)});s(this,Mt,(e,i)=>{t(this,mt).current&&(c(this,o,ye).call(this,Math.sign(i)||1),t(this,te).call(this,e,i))});s(this,te,(e,i)=>{if(t(this,B).current){if(t(this,B).current<0&&i>0)return;if(t(this,B).current>0&&i<0)return}if(t(this,ct)||t(this,G).unlistenAnimationFrame(),!t(this,I).current&&t(this,rt).current&&(clearInterval(t(this,qt)),r(this,qt,setTimeout(()=>{const n=t(this,l)[c(this,o,de).call(this)];n&&this.scrollToSection(n.index,{tween:{duration:t(this,Et).current,easing:Fe.easeInOutExpo}})},t(this,rt).current))),!(e.includes("drag")&&!Ge.device.isMobile&&!t(this,Pt).current)){if(t(this,T).current&&e!=="drag"){const n=Math.sign(i);if(t(this,l).length){const d={tween:t(this,Y).current||t(this,tt).current?{easing:t(this,Y).current||"easeInOutCubic",duration:t(this,tt).current||500}:void 0};t(this,Dt)?this.scrollToSection(t(this,w).current,d):this.shiftSections(n,d)}else t(this,a).shift(n*t(this,y))}else t(this,a).shift(i);r(this,Dt,e==="drag")}});s(this,ee,()=>{r(this,E,!0),this.hibernatedCSSProperty.current||c(this,o,ge).call(this)});if(Se.isBrowser){const e=this.attachShadow({mode:"open"});e.adoptedStyleSheets=[Qe];const i=document.createElement("div");i.className="static",i.innerHTML='<slot name="static"></slot>',e.appendChild(i),r(this,nt,document.createElement("div")),t(this,nt).className="content-wrapper",r(this,p,document.createElement("div")),t(this,p).className="content",r(this,It,document.createElement("slot")),t(this,p).appendChild(t(this,It)),t(this,nt).appendChild(t(this,p)),e.appendChild(t(this,nt))}}get damped(){return t(this,a)}get controlsCSSProperty(){return t(this,mt)}get axisCSSProperty(){return t(this,x)}get reverseCSSProperty(){return t(this,X)}get directionCSSProperty(){return t(this,B)}get pagesCSSProperty(){return t(this,_)}get splitCSSProperty(){return t(this,H)}get sectionalCSSProperty(){return t(this,T)}get easingCSSProperty(){return t(this,Y)}get durationCSSProperty(){return t(this,tt)}get autoSizeCSSProperty(){return t(this,W)}get wheelMaxDeltaCSSProperty(){return t(this,et)}get dragInertionCSSProperty(){return t(this,gt)}get sectionsInViewCSSProperty(){return t(this,q)}get loopCSSProperty(){return t(this,v)}get dampingCSSProperty(){return t(this,yt)}get massCSSProperty(){return t(this,vt)}get stiffnessCSSProperty(){return t(this,Ct)}get mouseDragCSSProperty(){return t(this,Pt)}get sectionDistanceScaleCSSProperty(){return t(this,Rt)}get autoplayCSSProperty(){return t(this,I)}get autoplayPauseDurationCSSProperty(){return t(this,wt)}get autoplayUserDirectionCSSProperty(){return t(this,st)}get classesCSSProperty(){return t(this,D)}get currentIndexStartOffsetCSSProperty(){return t(this,it)}get currentIndexEndOffsetCSSProperty(){return t(this,F)}get focusDelayCSSProperty(){return t(this,rt)}get focusDurationCSSProperty(){return t(this,Et)}get disabledCSSProperty(){return t(this,$)}get hibernatedCSSProperty(){return t(this,N)}get currentScrollValue(){return c(this,o,ve).call(this,"current")}get targetScrollValue(){return c(this,o,ve).call(this,"target")}get contentWrapperElement(){return t(this,nt)}get contentElement(){return t(this,p)}get sections(){return t(this,l)}get position(){return t(this,Xt)}get contentPosition(){return t(this,Yt)}get viewportSize(){return t(this,y)}get scrollSize(){return t(this,m)}get gap(){return t(this,z)}get counter(){return t(this,w)}get limit(){return Math.ceil(t(this,l).length-t(this,q).current)}get distance(){return t(this,ot)}get loopDistance(){return t(this,v).current?t(this,ot)+t(this,z):t(this,ot)}get hasOverflow(){return t(this,U)}get overscroll(){return t(this,Tt)}get scrollLine(){return t(this,O)}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 d=e-n,b=d+i+n*2;return this.currentProgress<d?0:this.currentProgress>b?1:(this.currentProgress-d)/(b-d)}curve(e,i,n=0){return Math.sin(this.range(e,i,n)*Math.PI)}visible(e,i,n=0){const d=e-n,b=d+i+n*2;return this.currentProgress>=d&&this.currentProgress<=b}scrollToSection(e,i){if(!t(this,l).length)return;const n=t(this,w).current,d=c(this,o,Ie).call(this,e),b=t(this,l)[n],C=t(this,l)[d];if(b&&C){let R=0;const pe=c(this,o,de).call(this),jt=t(this,l)[pe],Ve=jt?this.targetScrollValue-jt.position:0;t(this,v).current?d===0&&n===t(this,l).length-1?R=t(this,m)+t(this,y)-b.position+t(this,z):d===t(this,l).length-1&&n===0?R=C.position-(t(this,m)+t(this,y)+t(this,z)):R=C.position-b.position:R=C.position-b.position,this.shiftPosition(R-Ve,i)}}shiftSections(e,i){t(this,l).length&&this.scrollToSection(t(this,w).current+e,i)}setPosition(e,i){c(this,o,ye).call(this,Math.sign(e)||1),i!=null&&i.tween?t(this,ct)||(t(this,G).set(t(this,a).current,{equalize:!0}),t(this,G).set(e,xe({},i.tween)),r(this,ct,setTimeout(()=>{r(this,ct,void 0)},i.tween.duration||0))):t(this,a).set(e,{equalize:(i==null?void 0:i.behaviour)==="instant"})}shiftPosition(e,i){this.setPosition(t(this,a).target+e,i)}connectedCallback(){bt.scrollEntries.register(this),r(this,a,new Ne.Damped(0,{damping:.01,min:0,order:ce.TICK_ORDER.SCROLL})),this.setAttribute("tabindex","0"),r(this,A,new oe.WheelControls({element:t(this,p)})),t(this,A).changeEvent.subscribe(t(this,Mt)),r(this,ht,new oe.KeyboardControls({element:this})),t(this,ht).changeEvent.subscribe(t(this,Mt)),r(this,M,new oe.DragControls({element:t(this,p)})),t(this,M).changeEvent.subscribe(t(this,Mt)),r(this,P,new oe.AutoplayControls({culling:this})),t(this,P).changeEvent.subscribe(t(this,te)),t(this,x).subscribe(()=>{c(this,o,fe).call(this)}),t(this,X).subscribe(()=>{c(this,o,fe).call(this)}),t(this,et).subscribe(e=>{t(this,A).axis=e.current?"max":t(this,x).current}),t(this,gt).subscribe(e=>{t(this,M).inertion=typeof e.current=="number"?e.current:1}),t(this,_).subscribe(()=>{t(this,E)&&t(this,k).call(this)}),t(this,H).subscribe(({current:e})=>{t(this,E)&&(e?c(this,o,Kt).call(this):c(this,o,Lt).call(this))}),t(this,T).subscribe(e=>{t(this,A).debounce=e.current,t(this,M).swipe=e.current,t(this,P).interval=e.current,t(this,E)&&(e.current&&!e.previous&&!t(this,l).length?c(this,o,Kt).call(this):!e.current&&e.previous&&t(this,l).length&&c(this,o,Lt).call(this))}),t(this,W).subscribe(e=>{t(this,E)&&(t(this,k).call(this),e.current&&!e.previous&&!t(this,l).length?c(this,o,Kt).call(this):!e.current&&e.previous&&t(this,l).length&&c(this,o,Lt).call(this))}),t(this,q).subscribe(e=>{t(this,E)&&(t(this,k).call(this),c(this,o,pt).call(this))}),t(this,v).subscribe(e=>{e.current?(t(this,E)&&(t(this,l).length||(t(this,H).current=!0)),t(this,a).max=1/0,t(this,a).min=-1/0):(r(this,Tt,0),t(this,a).max=t(this,m),t(this,a).min=0)}),t(this,yt).subscribe(e=>{t(this,a).damping=e.current}),t(this,vt).subscribe(e=>{t(this,a).mass=e.current}),t(this,Ct).subscribe(e=>{t(this,a).stiffness=e.current}),t(this,I).subscribe(e=>{t(this,P).speed=e.current,!t(this,lt)&&e.current&&!e.previous?t(this,P).connect():!e.current&&e.previous&&t(this,P).disconnect()}),t(this,st).subscribe(e=>{e.current||(t(this,P).direction=1)}),t(this,D).subscribe(e=>{t(this,E)&&c(this,o,pt).call(this)}),t(this,it).subscribe(e=>{t(this,E)&&t(this,D).current&&c(this,o,pt).call(this)}),t(this,F).subscribe(e=>{t(this,E)&&t(this,D).current&&c(this,o,pt).call(this)}),t(this,a).isRunning.subscribe(e=>{this.classList.toggle("active",e.current)}),t(this,w).subscribe(e=>{t(this,l).length&&c(this,o,pt).call(this)}),t(this,G).subscribe(e=>{t(this,G).isRunning.current&&t(this,a).set(e.current,{equalize:!0})}),t(this,$).subscribe(e=>{e.current&&!e.previous?(this.classList.add("disabled"),c(this,o,ue).call(this)):!e.current&&e.previous&&(this.classList.remove("disabled"),c(this,o,ae).call(this))}),t(this,N).subscribe(e=>{e.current&&!e.previous?(this.classList.add("hibernated"),c(this,o,me).call(this)):!e.current&&e.previous&&(this.classList.remove("hibernated"),c(this,o,ge).call(this))}),t(this,mt).observe(),t(this,x).observe(),t(this,X).observe(),t(this,B).observe(),t(this,_).observe(),t(this,H).observe(),t(this,T).observe(),t(this,Y).observe(),t(this,tt).observe(),t(this,W).observe(),t(this,et).observe(),t(this,gt).observe(),t(this,q).observe(),t(this,v).observe(),t(this,yt).observe(),t(this,vt).observe(),t(this,Ct).observe(),t(this,Pt).observe(),t(this,Rt).observe(),t(this,I).observe(),t(this,I).observe(),t(this,wt).observe(),t(this,st).observe(),t(this,D).observe(),t(this,it).observe(),t(this,F).observe(),t(this,rt).observe(),t(this,Et).observe(),t(this,$).observe(),t(this,N).observe(),kt.windowResizer.subscribe(t(this,ee),ce.RESIZE_ORDER.LAST)}disconnectedCallback(){this.removeAttribute("tabindex"),this.classList.remove("disabled"),this.classList.remove("hibernated"),t(this,mt).unobserve(),t(this,x).unobserve(),t(this,X).unobserve(),t(this,B).unobserve(),t(this,_).unobserve(),t(this,H).unobserve(),t(this,T).unobserve(),t(this,Y).unobserve(),t(this,tt).unobserve(),t(this,W).unobserve(),t(this,et).unobserve(),t(this,gt).unobserve(),t(this,q).unobserve(),t(this,v).unobserve(),t(this,yt).unobserve(),t(this,vt).unobserve(),t(this,Ct).unobserve(),t(this,Pt).unobserve(),t(this,Rt).unobserve(),t(this,I).unobserve(),t(this,wt).unobserve(),t(this,st).unobserve(),t(this,D).unobserve(),t(this,it).unobserve(),t(this,F).unobserve(),t(this,rt).unobserve(),t(this,Et).unobserve(),t(this,$).unobserve(),t(this,N).unobserve(),kt.windowResizer.unsubscribe(t(this,ee)),c(this,o,me).call(this)}}a=new WeakMap,mt=new WeakMap,x=new WeakMap,X=new WeakMap,B=new WeakMap,_=new WeakMap,H=new WeakMap,T=new WeakMap,Y=new WeakMap,tt=new WeakMap,W=new WeakMap,et=new WeakMap,gt=new WeakMap,q=new WeakMap,v=new WeakMap,yt=new WeakMap,vt=new WeakMap,Ct=new WeakMap,Pt=new WeakMap,Rt=new WeakMap,I=new WeakMap,wt=new WeakMap,st=new WeakMap,D=new WeakMap,it=new WeakMap,F=new WeakMap,rt=new WeakMap,Et=new WeakMap,$=new WeakMap,N=new WeakMap,nt=new WeakMap,p=new WeakMap,It=new WeakMap,l=new WeakMap,Xt=new WeakMap,Yt=new WeakMap,y=new WeakMap,m=new WeakMap,z=new WeakMap,A=new WeakMap,ht=new WeakMap,M=new WeakMap,P=new WeakMap,w=new WeakMap,Tt=new WeakMap,ot=new WeakMap,U=new WeakMap,lt=new WeakMap,xt=new WeakMap,qt=new WeakMap,ct=new WeakMap,G=new WeakMap,Dt=new WeakMap,O=new WeakMap,E=new WeakMap,o=new WeakSet,fe=function(){const e=t(this,x).current,i=t(this,X).current?"-reverse":"";t(this,p).style.flexDirection=e==="x"?`row${i}`:`column${i}`,t(this,A).axis=t(this,et).current?"max":e,t(this,ht).dimension=e==="x"?"width":"height",t(this,M).axis=e,e==="x"?this.style.touchAction="pan-y":e==="y"&&(this.style.touchAction="pan-x"),t(this,E)&&t(this,k).call(this)},Kt=function(){c(this,o,Lt).call(this),t(this,It).assignedElements().forEach((e,i)=>{e instanceof HTMLElement&&t(this,l).push(new Je(e,i,this))}),t(this,p).style.transform="",le.dispatchEvent(this,"scrollSectionsChange",{custom:!0,composed:!0}),t(this,k).call(this),c(this,o,pt).call(this)},Lt=function(){t(this,l).forEach(e=>{e.destroy()}),r(this,l,[]),t(this,w).reset(),t(this,a).reset(),le.dispatchEvent(this,"scrollSectionsChange",{custom:!0,composed:!0})},ue=function(){t(this,lt)||(r(this,lt,!0),t(this,a).unsubscribe(t(this,At)),t(this,a).unlistenAnimationFrame(),clearInterval(t(this,qt)),clearInterval(t(this,ct)),t(this,G).unlistenAnimationFrame(),t(this,A).disconnect(),t(this,ht).disconnect(),t(this,M).disconnect(),t(this,P).disconnect(),t(this,U)||this.sections.forEach(e=>{e.unsetTransform()}))},ae=function(){t(this,lt)&&(r(this,lt,!1),t(this,a).subscribe(t(this,At)),t(this,A).connect(),t(this,ht).connect(),t(this,M).connect(),t(this,I).current&&t(this,P).connect())},me=function(){t(this,xt)||(r(this,xt,!0),kt.windowResizer.unsubscribe(t(this,k)),Jt.elementResizer.unsubscribe(t(this,k)),c(this,o,ue).call(this),t(this,p).style.transform="",t(this,p).style.height="",t(this,p).style.width="",this.classList.remove("has-overflow","start","end"),t(this,l).length?c(this,o,Lt).call(this):(t(this,w).reset(),t(this,a).reset()),bt.scrollEntries.unregister(this))},ge=function(){t(this,xt)&&(r(this,xt,!1),bt.scrollEntries.register(this),(t(this,v).current||t(this,H).current||t(this,v).current||t(this,W).current||t(this,T).current)&&c(this,o,Kt).call(this),c(this,o,ae).call(this),kt.windowResizer.subscribe(t(this,k),ce.RESIZE_ORDER.SCROLL),Jt.elementResizer.subscribe(this,t(this,k)))},k=new WeakMap,At=new WeakMap,Ie=function(e){let i=t(this,w).current;return t(this,v).current?i=$e.loopNumber(e,t(this,l).length):i=ke.clamp(e,0,this.limit),i},Mt=new WeakMap,te=new WeakMap,ye=function(e=1){t(this,st).current&&(t(this,P).direction=e),t(this,I).current&&t(this,P).pauseAndContinue(t(this,wt).current,this.sectionalCSSProperty.current)},ve=function(e="current"){if(t(this,v).current&&t(this,l).length){const i=t(this,a)[e]%(t(this,m)+t(this,y)+t(this,z));return i<0?t(this,m)+i+t(this,y)+t(this,z):i}else return t(this,a)[e]},pt=function(){if(t(this,l).length){const e=t(this,w).current+t(this,it).current;if(e===0?r(this,O,"start"):e===this.limit?r(this,O,"end"):r(this,O,null),le.dispatchEvent(this,"scrollLine",{detail:{line:t(this,O)}}),t(this,D).current){this.classList.remove("end","start"),t(this,O)&&this.classList.add(t(this,O));const i=t(this,q).current+t(this,F).current;t(this,l).forEach((n,d)=>{const b=e-this.limit-1+t(this,F).current,C=e+i,R=this.sections.length-C;d>=e&&d<C||d<=b?n.mark("current"):d>=C&&d<C+R/2||d<=b+i?n.mark("next"):n.mark("previous")})}}},de=function(){let e=this.targetScrollValue,i=1/0,n=0;const d=t(this,a).direction;for(let b=0;b<t(this,l).length;b++){const C=t(this,l)[b];let R=t(this,Dt)?C.size*d*-1*.4:0,pe=C.position;const jt=Math.abs(pe+R-e);jt<i&&(i=jt,n=b)}return n},ee=new WeakMap;customElements.get("e-scroll")||customElements.define("e-scroll",Zt);var se;class Ce extends HTMLElement{constructor(){super(...arguments);s(this,se,null)}get scrollElement(){return t(this,se)}connectedCallback(){const e=Re.findParentElement(this,Zt);e instanceof Zt?r(this,se,e):console.error(this,"e-scroll not found")}}se=new WeakMap;var ut,L,Z,j,Ot,Vt,at,Bt,ie,re;class Te extends Ce{constructor(){super();s(this,ut,null);s(this,L,null);s(this,Z,!1);s(this,j,0);s(this,Ot,0);s(this,Vt,0);s(this,at,()=>{r(this,Z,this.offsetWidth>this.offsetHeight);const e=t(this,Z)?this.offsetWidth:this.offsetHeight;r(this,j,e/((this.scrollElement.scrollSize+this.scrollElement.viewportSize)/e)),r(this,j,Math.max(t(this,j),30)),t(this,Z)?(t(this,L).style.width=t(this,j)+"px",t(this,L).style.height="100%"):(t(this,L).style.width="100%",t(this,L).style.height=t(this,j)+"px"),r(this,Ot,e-t(this,j)),this.scrollElement.scrollSize<=0?this.style.display="none":this.style.display="",t(this,Bt).call(this)});s(this,Bt,()=>{r(this,Vt,this.scrollElement.currentProgress*t(this,Ot)),t(this,Z)?t(this,L).style.transform=`translate3d(${t(this,Vt)}px, 0px, 0px)`:t(this,L).style.transform=`translate3d(0px, ${t(this,Vt)}px, 0px)`});s(this,ie,()=>{this.setAttribute("axis",this.scrollElement.axisCSSProperty.current)});s(this,re,e=>{document.documentElement.classList.add("grabbing"),Ze.setupDrag(d=>{const b=t(this,Z)?d.x:d.y,C=this.scrollElement.distance/t(this,Ot),R=(b-n)*C;this.scrollElement.setPosition(i+R)},()=>{document.documentElement.classList.remove("grabbing")});const i=this.scrollElement.damped.target,n=t(this,Z)?e.x:e.y});if(Se.isBrowser){const e=this.attachShadow({mode:"open"});e.adoptedStyleSheets=[ze.createStylesheet({":host":{display:"inline-block",zIndex:"1",backgroundColor:"#ebebeb"},':host([axis="y"])':{position:"absolute",right:"0",top:"0",width:"1vmin",height:"100%"},':host([axis="x"])':{position:"absolute",left:"0",bottom:"0",width:"100%",height:"1vmin"},".default-thumb":{backgroundColor:"var(--thumb-color, black)",borderRadius:"var(--thumb-radius, 0px)",touchAction:"none"},"::slotted(*)":{touchAction:"none"}})],r(this,ut,document.createElement("slot")),t(this,ut).innerHTML='<div class="default-thumb"></div>',e.appendChild(t(this,ut))}}get thumbElement(){return t(this,L)}connectedCallback(){super.connectedCallback(),this.setAttribute("drag-dead-zone","");const e=t(this,ut).assignedElements()[0]||t(this,ut).firstElementChild;r(this,L,e),t(this,L).addEventListener("pointerdown",t(this,re)),kt.windowResizer.subscribe(t(this,at),ce.RESIZE_ORDER.SCROLL),Jt.elementResizer.subscribe(this,t(this,at)),Jt.elementResizer.subscribe(this.scrollElement,t(this,at)),this.scrollElement.onScroll(t(this,Bt)),this.scrollElement.axisCSSProperty.subscribe(t(this,ie))}disconnectedCallback(){this.removeAttribute("drag-dead-zone"),this.style.display="",t(this,L).removeEventListener("pointerdown",t(this,re)),kt.windowResizer.unsubscribe(t(this,at)),Jt.elementResizer.unsubscribe(t(this,at)),this.scrollElement.offScroll(t(this,Bt)),this.scrollElement.axisCSSProperty.unsubscribe(t(this,ie))}}ut=new WeakMap,L=new WeakMap,Z=new WeakMap,j=new WeakMap,Ot=new WeakMap,Vt=new WeakMap,at=new WeakMap,Bt=new WeakMap,ie=new WeakMap,re=new WeakMap;customElements.get("e-scrollbar")||customElements.define("e-scrollbar",Te);var _t,Ht,Wt;class qe extends Ce{constructor(){super();s(this,_t,new S.CSSProperty(this,"--behaviour","smooth"));s(this,Ht,new S.CSSProperty(this,"--tween-easing",!1));s(this,Wt,new S.CSSProperty(this,"--tween-duration",0));Se.isBrowser&&this.addEventListener("click",()=>{const e=t(this,_t).current,i=t(this,Ht).current,n=t(this,Wt).current;this.handleClick({behaviour:e,tween:i||n?{easing:i,duration:n}:void 0})})}connectedCallback(){super.connectedCallback(),t(this,_t).observe(),t(this,Ht).observe(),t(this,Wt).observe()}disconnectedCallback(){t(this,_t).close(),t(this,Ht).close(),t(this,Wt).close()}}_t=new WeakMap,Ht=new WeakMap,Wt=new WeakMap;var Ft;class De extends qe{constructor(){super(...arguments);s(this,Ft,new S.CSSProperty(this,"--set",1))}handleClick(e){this.scrollElement.scrollToSection(t(this,Ft).current,e)}connectedCallback(){super.connectedCallback(),t(this,Ft).observe()}disconnectedCallback(){super.disconnectedCallback(),t(this,Ft).close()}}Ft=new WeakMap;customElements.get("e-scroll-set-button")||customElements.define("e-scroll-set-button",De);var K,$t;class Ae extends qe{constructor(){super(...arguments);s(this,K,new S.CSSProperty(this,"--step",1));s(this,$t,()=>{this.scrollElement.loopCSSProperty.current?this.removeAttribute("disabled"):t(this,K).current>0&&this.scrollElement.scrollLine==="end"||t(this,K).current<0&&this.scrollElement.scrollLine==="start"?this.setAttribute("disabled",""):this.removeAttribute("disabled")})}handleClick(e){this.scrollElement.shiftSections(t(this,K).current,e)}connectedCallback(){super.connectedCallback(),this.scrollElement&&(t(this,K).subscribe(()=>{t(this,$t).call(this)}),t(this,K).observe(),this.scrollElement.addEventListener("scrollLine",t(this,$t)),t(this,$t).call(this))}disconnectedCallback(){super.disconnectedCallback(),t(this,K).close(),this.removeAttribute("disabled")}}K=new WeakMap,$t=new WeakMap;customElements.get("e-scroll-step-button")||customElements.define("e-scroll-step-button",Ae);var J,dt,Nt,ne,he,Ut;class Xe{constructor(h,e,i){s(this,J,null);s(this,dt,null);s(this,Nt,null);s(this,ne,null);s(this,he,()=>{t(this,dt).scrollToSection(t(this,Nt),{behaviour:t(this,ne)})});s(this,Ut,()=>{t(this,J).classList.toggle("current",t(this,dt).counter.current===t(this,Nt))});Se.isBrowser&&(r(this,J,document.createElement("button")),r(this,dt,h),r(this,ne,i),r(this,Nt,e),t(this,J).addEventListener("click",t(this,he)),t(this,dt).counter.subscribe(t(this,Ut)),t(this,Ut).call(this))}get element(){return t(this,J)}destroy(){t(this,J).removeEventListener("click",t(this,he)),t(this,dt).counter.unsubscribe(t(this,Ut)),t(this,J).remove()}}J=new WeakMap,dt=new WeakMap,Nt=new WeakMap,ne=new WeakMap,he=new WeakMap,Ut=new WeakMap;var St,Gt;class Me extends Ce{constructor(){super(...arguments);s(this,St,[]);s(this,Gt,je.debounce(()=>{t(this,St).forEach(e=>e.destroy()),r(this,St,[]);for(let e=0;e<this.scrollElement.sections.length;e++){const i=new Xe(this.scrollElement,e,this.getAttribute("behaviour")||"smooth");this.appendChild(i.element),t(this,St).push(i)}},0))}connectedCallback(){super.connectedCallback(),this.scrollElement.addEventListener("sectionsChange",t(this,Gt)),t(this,Gt).call(this)}disconnectedCallback(){this.scrollElement.removeEventListener("sectionsChange",t(this,Gt)),t(this,St).forEach(e=>e.destroy()),r(this,St,[])}}St=new WeakMap,Gt=new WeakMap;customElements.get("e-scroll-bullet-buttons")||customElements.define("e-scroll-bullet-buttons",Me);class Oe extends Ke.ScrollSegmentElement{connectedCallback(){const h=Re.findParentElement(this,Zt);h instanceof Zt?(this.scrollContainer=h,this.scrollContainer.addEventListener("scrollSectionsChange",this.findAnotherScrollEntries)):console.error(this,"e-scroll not found")}}customElements.get("e-scroll-segment")||customElements.define("e-scroll-segment",Oe);exports.ScrollBulletButtonsElement=Me;exports.ScrollElement=Zt;exports.ScrollSegmentElement=Oe;exports.ScrollSetButtonElement=De;exports.ScrollStepButtonElement=Ae;exports.ScrollbarElement=Te;
|
|
@@ -21,23 +21,24 @@ import { d as he } from "../../events-CsVF98U6.js";
|
|
|
21
21
|
import { c as ke } from "../../jss-CjccJC-K.js";
|
|
22
22
|
import { a as pe, g as fe } from "../../layout-HoBT_Da2.js";
|
|
23
23
|
import { c as ze } from "../../math-BOBiC4TN.js";
|
|
24
|
+
import { l as Be } from "../../polyfills-CxfUK5OU.js";
|
|
24
25
|
import "../../ticker/vanilla/index.js";
|
|
25
|
-
import { TICK_ORDER as
|
|
26
|
-
import { D as
|
|
27
|
-
import { T as
|
|
28
|
-
import { WheelControls as
|
|
26
|
+
import { TICK_ORDER as We, RESIZE_ORDER as me } from "../../order/index.js";
|
|
27
|
+
import { D as Fe } from "../../Damped-GT4z9D9j.js";
|
|
28
|
+
import { T as $e } from "../../Tweened-YkiLB0BU.js";
|
|
29
|
+
import { WheelControls as qe, KeyboardControls as Ne, DragControls as Ue, AutoplayControls as Ge } from "../../controls/index.js";
|
|
29
30
|
import { windowResizer as kt } from "../../window-resizer/vanilla/index.js";
|
|
30
31
|
import { scrollEntries as mt } from "../../scroll-entries/index.js";
|
|
31
32
|
import { cssUnitParser as Le } from "../../css-unit-parser/index.js";
|
|
32
33
|
import { CSSProperty as p } from "../../css-property/index.js";
|
|
33
|
-
import { device as
|
|
34
|
+
import { device as Ke } from "../../device/index.js";
|
|
34
35
|
import { elementResizer as Zt } from "../../element-resizer/vanilla/index.js";
|
|
35
|
-
import { s as
|
|
36
|
+
import { s as _e } from "../../gestures-D2Fdra_G.js";
|
|
36
37
|
import { f as Ie } from "../../dom-0S_WDL4g.js";
|
|
37
|
-
import { d as
|
|
38
|
-
import { ScrollSegmentElement as
|
|
38
|
+
import { d as Ze } from "../../function-C10DGppn.js";
|
|
39
|
+
import { ScrollSegmentElement as je } from "../../scroll-segment/index.js";
|
|
39
40
|
var b, Jt, g, bt, H, Q;
|
|
40
|
-
class
|
|
41
|
+
class Je {
|
|
41
42
|
constructor(h, e, i) {
|
|
42
43
|
s(this, b);
|
|
43
44
|
s(this, Jt);
|
|
@@ -90,7 +91,7 @@ class je {
|
|
|
90
91
|
}
|
|
91
92
|
}
|
|
92
93
|
b = new WeakMap(), Jt = new WeakMap(), g = new WeakMap(), bt = new WeakMap(), H = new WeakMap(), Q = new WeakMap();
|
|
93
|
-
const
|
|
94
|
+
const Qe = ke({
|
|
94
95
|
":host": {
|
|
95
96
|
position: "relative",
|
|
96
97
|
width: "100%",
|
|
@@ -226,7 +227,7 @@ class jt extends HTMLElement {
|
|
|
226
227
|
s(this, Pt, !0);
|
|
227
228
|
s(this, Dt);
|
|
228
229
|
s(this, ct);
|
|
229
|
-
s(this, K, new
|
|
230
|
+
s(this, K, new $e());
|
|
230
231
|
s(this, Tt, !1);
|
|
231
232
|
s(this, R, null);
|
|
232
233
|
s(this, x, !1);
|
|
@@ -310,7 +311,7 @@ class jt extends HTMLElement {
|
|
|
310
311
|
easing: He
|
|
311
312
|
}
|
|
312
313
|
});
|
|
313
|
-
}, t(this, rt).current))), !(e.includes("drag") && !
|
|
314
|
+
}, t(this, rt).current))), !(e.includes("drag") && !Ke.isMobile && !t(this, wt).current)) {
|
|
314
315
|
if (t(this, D).current && e !== "drag") {
|
|
315
316
|
const n = Math.sign(i);
|
|
316
317
|
if (t(this, l).length) {
|
|
@@ -333,7 +334,7 @@ class jt extends HTMLElement {
|
|
|
333
334
|
});
|
|
334
335
|
if (ae) {
|
|
335
336
|
const e = this.attachShadow({ mode: "open" });
|
|
336
|
-
e.adoptedStyleSheets = [
|
|
337
|
+
e.adoptedStyleSheets = [Qe];
|
|
337
338
|
const i = document.createElement("div");
|
|
338
339
|
i.className = "static", i.innerHTML = '<slot name="static"></slot>', e.appendChild(i), r(this, nt, document.createElement("div")), t(this, nt).className = "content-wrapper", r(this, f, document.createElement("div")), t(this, f).className = "content", r(this, It, document.createElement("slot")), t(this, f).appendChild(t(this, It)), t(this, nt).appendChild(t(this, f)), e.appendChild(t(this, nt));
|
|
339
340
|
}
|
|
@@ -538,15 +539,15 @@ class jt extends HTMLElement {
|
|
|
538
539
|
this.setPosition(t(this, u).target + e, i);
|
|
539
540
|
}
|
|
540
541
|
connectedCallback() {
|
|
541
|
-
mt.register(this), r(this, u, new
|
|
542
|
+
mt.register(this), r(this, u, new Fe(0, {
|
|
542
543
|
damping: 0.01,
|
|
543
544
|
min: 0,
|
|
544
|
-
order:
|
|
545
|
-
})), this.setAttribute("tabindex", "0"), r(this, V, new
|
|
545
|
+
order: We.SCROLL
|
|
546
|
+
})), this.setAttribute("tabindex", "0"), r(this, V, new qe({ element: t(this, f) })), t(this, V).changeEvent.subscribe(t(this, Vt)), r(this, ht, new Ne({
|
|
546
547
|
element: this
|
|
547
548
|
})), t(this, ht).changeEvent.subscribe(
|
|
548
549
|
t(this, Vt)
|
|
549
|
-
), r(this, O, new
|
|
550
|
+
), r(this, O, new Ue({ element: t(this, f) })), t(this, O).changeEvent.subscribe(t(this, Vt)), r(this, w, new Ge({
|
|
550
551
|
culling: this
|
|
551
552
|
})), t(this, w).changeEvent.subscribe(t(this, Yt)), t(this, P).subscribe(() => {
|
|
552
553
|
c(this, o, be).call(this);
|
|
@@ -605,7 +606,7 @@ u = new WeakMap(), St = new WeakMap(), P = new WeakMap(), X = new WeakMap(), B =
|
|
|
605
606
|
t(this, f).style.flexDirection = e === "x" ? `row${i}` : `column${i}`, t(this, V).axis = t(this, et).current ? "max" : e, t(this, ht).dimension = e === "x" ? "width" : "height", t(this, O).axis = e, e === "x" ? this.style.touchAction = "pan-y" : e === "y" && (this.style.touchAction = "pan-x"), t(this, x) && t(this, z).call(this);
|
|
606
607
|
}, _t = function() {
|
|
607
608
|
c(this, o, Lt).call(this), t(this, It).assignedElements().forEach((e, i) => {
|
|
608
|
-
e instanceof HTMLElement && t(this, l).push(new
|
|
609
|
+
e instanceof HTMLElement && t(this, l).push(new Je(e, i, this));
|
|
609
610
|
}), t(this, f).style.transform = "", he(this, "scrollSectionsChange", {
|
|
610
611
|
custom: !0,
|
|
611
612
|
composed: !0
|
|
@@ -629,7 +630,7 @@ u = new WeakMap(), St = new WeakMap(), P = new WeakMap(), X = new WeakMap(), B =
|
|
|
629
630
|
t(this, Pt) && (r(this, Pt, !1), mt.register(this), (t(this, y).current || t(this, F).current || t(this, y).current || t(this, $).current || t(this, D).current) && c(this, o, _t).call(this), c(this, o, le).call(this), kt.subscribe(t(this, z), me.SCROLL), Zt.subscribe(this, t(this, z)));
|
|
630
631
|
}, z = new WeakMap(), Mt = new WeakMap(), Ae = function(e) {
|
|
631
632
|
let i = t(this, E).current;
|
|
632
|
-
return t(this, y).current ?
|
|
633
|
+
return t(this, y).current ? i = Be(e, t(this, l).length) : i = ze(e, 0, this.limit), i;
|
|
633
634
|
}, Vt = new WeakMap(), Yt = new WeakMap(), ve = function(e = 1) {
|
|
634
635
|
t(this, st).current && (t(this, w).direction = e), t(this, A).current && t(this, w).pauseAndContinue(
|
|
635
636
|
t(this, Et).current,
|
|
@@ -684,7 +685,7 @@ class Ce extends HTMLElement {
|
|
|
684
685
|
}
|
|
685
686
|
ee = new WeakMap();
|
|
686
687
|
var at, L, _, Z, Ot, Rt, ut, Ht, se, ie;
|
|
687
|
-
class
|
|
688
|
+
class Xe extends Ce {
|
|
688
689
|
constructor() {
|
|
689
690
|
super();
|
|
690
691
|
s(this, at, null);
|
|
@@ -705,7 +706,7 @@ class Qe extends Ce {
|
|
|
705
706
|
this.setAttribute("axis", this.scrollElement.axisCSSProperty.current);
|
|
706
707
|
});
|
|
707
708
|
s(this, ie, (e) => {
|
|
708
|
-
document.documentElement.classList.add("grabbing"),
|
|
709
|
+
document.documentElement.classList.add("grabbing"), _e(
|
|
709
710
|
(d) => {
|
|
710
711
|
const m = t(this, _) ? d.x : d.y, C = this.scrollElement.distance / t(this, Ot), I = (m - n) * C;
|
|
711
712
|
this.scrollElement.setPosition(i + I);
|
|
@@ -764,7 +765,7 @@ class Qe extends Ce {
|
|
|
764
765
|
}
|
|
765
766
|
}
|
|
766
767
|
at = new WeakMap(), L = new WeakMap(), _ = new WeakMap(), Z = new WeakMap(), Ot = new WeakMap(), Rt = new WeakMap(), ut = new WeakMap(), Ht = new WeakMap(), se = new WeakMap(), ie = new WeakMap();
|
|
767
|
-
customElements.get("e-scrollbar") || customElements.define("e-scrollbar",
|
|
768
|
+
customElements.get("e-scrollbar") || customElements.define("e-scrollbar", Xe);
|
|
768
769
|
var Bt, Wt, Ft;
|
|
769
770
|
class De extends Ce {
|
|
770
771
|
constructor() {
|
|
@@ -793,7 +794,7 @@ class De extends Ce {
|
|
|
793
794
|
}
|
|
794
795
|
Bt = new WeakMap(), Wt = new WeakMap(), Ft = new WeakMap();
|
|
795
796
|
var $t;
|
|
796
|
-
class
|
|
797
|
+
class Ye extends De {
|
|
797
798
|
constructor() {
|
|
798
799
|
super(...arguments);
|
|
799
800
|
s(this, $t, new p(this, "--set", 1));
|
|
@@ -809,9 +810,9 @@ class Xe extends De {
|
|
|
809
810
|
}
|
|
810
811
|
}
|
|
811
812
|
$t = new WeakMap();
|
|
812
|
-
customElements.get("e-scroll-set-button") || customElements.define("e-scroll-set-button",
|
|
813
|
+
customElements.get("e-scroll-set-button") || customElements.define("e-scroll-set-button", Ye);
|
|
813
814
|
var j, qt;
|
|
814
|
-
class
|
|
815
|
+
class ts extends De {
|
|
815
816
|
constructor() {
|
|
816
817
|
super(...arguments);
|
|
817
818
|
s(this, j, new p(this, "--step", 1));
|
|
@@ -835,9 +836,9 @@ class Ye extends De {
|
|
|
835
836
|
}
|
|
836
837
|
}
|
|
837
838
|
j = new WeakMap(), qt = new WeakMap();
|
|
838
|
-
customElements.get("e-scroll-step-button") || customElements.define("e-scroll-step-button",
|
|
839
|
+
customElements.get("e-scroll-step-button") || customElements.define("e-scroll-step-button", ts);
|
|
839
840
|
var J, dt, Nt, re, ne, Ut;
|
|
840
|
-
class
|
|
841
|
+
class es {
|
|
841
842
|
constructor(h, e, i) {
|
|
842
843
|
s(this, J, null);
|
|
843
844
|
s(this, dt, null);
|
|
@@ -865,14 +866,14 @@ class ts {
|
|
|
865
866
|
}
|
|
866
867
|
J = new WeakMap(), dt = new WeakMap(), Nt = new WeakMap(), re = new WeakMap(), ne = new WeakMap(), Ut = new WeakMap();
|
|
867
868
|
var pt, Gt;
|
|
868
|
-
class
|
|
869
|
+
class ss extends Ce {
|
|
869
870
|
constructor() {
|
|
870
871
|
super(...arguments);
|
|
871
872
|
s(this, pt, []);
|
|
872
|
-
s(this, Gt,
|
|
873
|
+
s(this, Gt, Ze(() => {
|
|
873
874
|
t(this, pt).forEach((e) => e.destroy()), r(this, pt, []);
|
|
874
875
|
for (let e = 0; e < this.scrollElement.sections.length; e++) {
|
|
875
|
-
const i = new
|
|
876
|
+
const i = new es(
|
|
876
877
|
this.scrollElement,
|
|
877
878
|
e,
|
|
878
879
|
this.getAttribute("behaviour") || "smooth"
|
|
@@ -895,8 +896,8 @@ class es extends Ce {
|
|
|
895
896
|
}
|
|
896
897
|
}
|
|
897
898
|
pt = new WeakMap(), Gt = new WeakMap();
|
|
898
|
-
customElements.get("e-scroll-bullet-buttons") || customElements.define("e-scroll-bullet-buttons",
|
|
899
|
-
class
|
|
899
|
+
customElements.get("e-scroll-bullet-buttons") || customElements.define("e-scroll-bullet-buttons", ss);
|
|
900
|
+
class is extends je {
|
|
900
901
|
connectedCallback() {
|
|
901
902
|
const h = Ie(this, jt);
|
|
902
903
|
h instanceof jt ? (this.scrollContainer = h, this.scrollContainer.addEventListener(
|
|
@@ -905,12 +906,12 @@ class ss extends Ze {
|
|
|
905
906
|
)) : console.error(this, "e-scroll not found");
|
|
906
907
|
}
|
|
907
908
|
}
|
|
908
|
-
customElements.get("e-scroll-segment") || customElements.define("e-scroll-segment",
|
|
909
|
+
customElements.get("e-scroll-segment") || customElements.define("e-scroll-segment", is);
|
|
909
910
|
export {
|
|
910
|
-
|
|
911
|
+
ss as ScrollBulletButtonsElement,
|
|
911
912
|
jt as ScrollElement,
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
913
|
+
is as ScrollSegmentElement,
|
|
914
|
+
Ye as ScrollSetButtonElement,
|
|
915
|
+
ts as ScrollStepButtonElement,
|
|
916
|
+
Xe as ScrollbarElement
|
|
916
917
|
};
|
|
@@ -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-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;
|
|
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-DbVDDRZi.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-GT4z9D9j.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/lib/utils/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("../attributes-Bf2svn4j.cjs"),E=require("../browser-CpzFX2xg.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("../attributes-Bf2svn4j.cjs"),E=require("../browser-CpzFX2xg.cjs"),m=require("../canvas-CU5Xjahf.cjs"),d=require("../coordinates-D8Np3cPD.cjs"),p=require("../dom-JBOkFLTh.cjs"),s=require("../easings-GegIwET5.cjs"),S=require("../events-KVanG9sR.cjs"),I=require("../file-EevnUtRj.cjs"),h=require("../function-MthRj-GJ.cjs"),T=require("../gestures-DHLrn6Q8.cjs"),C=require("../jss-GJLvaNfT.cjs"),f=require("../layout-8ryRAMGJ.cjs"),o=require("../math-GDWEqu7y.cjs"),l=require("../polyfills-BANSrI_m.cjs"),r=require("../object-CCiXnER2.cjs"),u=require("../string-DhgS_iFl.cjs"),O=require("../style-At6aDoqG.cjs"),g=require("../url-qZNgg7IM.cjs");function P(t,e,...n){return[...t.slice(0,e),...n,...t.slice(e)]}function q(t,e){const n=t.length;e=e%n;const a=new Array(n);for(let i=0;i<n;i++){const c=(i+e)%n;a[c]=t[i]}return a}function v(t,e=2){if(!+t)return"0 Bytes";const n=1024,a=e<0?0:e,i=["Bytes","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],c=Math.floor(Math.log(t)/Math.log(n));return`${parseFloat((t/Math.pow(n,c)).toFixed(a))} ${i[c]}`}function w(t,e){return t.x<e.x+e.width&&t.x>e.x&&t.y<e.y+e.height&&t.y>e.y}function x(t,e){return Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2)<e.radius}function y(t,e){const n=t.style.getPropertyValue(e);if(n){const a=n.toString();return a.startsWith("var")?y(t,a.slice(4,-1)):a}}function Q(...t){const e={};return Array.from(document.styleSheets).forEach(n=>{Array.from(n.cssRules).forEach(a=>{a instanceof CSSStyleRule&&a.selectorText===":root"&&t.forEach(i=>{const c=y(a,i);c&&(e[i]=c)})})}),t.forEach(n=>{e[n]||console.warn(`variable named ${n} not found`)}),e}function B(t){const e=window.atob(t);return decodeURIComponent(window.escape(e))}function D(t){const e=window.unescape(encodeURIComponent(t));return window.btoa(e)}function A(t){return new Promise(e=>{setTimeout(()=>{e()},t)})}exports.parseAttribute=b.parseAttribute;exports.parseAttributeValue=b.parseAttributeValue;exports.isBrowser=E.isBrowser;exports.contain=m.contain;exports.cover=m.cover;exports.fixPosition=m.fixPosition;exports.measureText=m.measureText;exports.getPointerPosition=d.getPointerPosition;exports.normalize=d.normalize;exports.screenToCartesian=d.screenToCartesian;exports.findParentElement=p.findParentElement;exports.findScrollParentElement=p.findScrollParentElement;exports.getAllParentElements=p.getAllParentElements;exports.getElement=p.getElement;exports.easeInCubic=s.easeInCubic;exports.easeInExpo=s.easeInExpo;exports.easeInOutCubic=s.easeInOutCubic;exports.easeInOutExpo=s.easeInOutExpo;exports.easeInOutQuad=s.easeInOutQuad;exports.easeInOutQuart=s.easeInOutQuart;exports.easeInOutQuint=s.easeInOutQuint;exports.easeInQuad=s.easeInQuad;exports.easeInQuart=s.easeInQuart;exports.easeInQuint=s.easeInQuint;exports.easeOutCubic=s.easeOutCubic;exports.easeOutExpo=s.easeOutExpo;exports.easeOutQuad=s.easeOutQuad;exports.easeOutQuart=s.easeOutQuart;exports.easeOutQuint=s.easeOutQuint;exports.linear=s.linear;exports.dispatchEvent=S.dispatchEvent;exports.createJSONAndSave=I.createJSONAndSave;exports.debounce=h.debounce;exports.throttle=h.throttle;exports.setupDrag=T.setupDrag;exports.createStylesheet=C.createStylesheet;exports.styleToString=C.styleToString;exports.getCumulativeOffsetLeft=f.getCumulativeOffsetLeft;exports.getCumulativeOffsetTop=f.getCumulativeOffsetTop;exports.getCumulativePosition=f.getCumulativePosition;exports.calculateDistance=o.calculateDistance;exports.calculateDistanceWithRadius=o.calculateDistanceWithRadius;exports.clamp=o.clamp;exports.damp=o.damp;exports.lerp=o.lerp;exports.mapRange=o.mapRange;exports.round=o.round;exports.smootherstep=o.smootherstep;exports.smoothstep=o.smoothstep;exports.step=o.step;exports.loopNumber=l.loopNumber;exports.nullishCoalescing=l.nullishCoalescing;exports.preciseNumber=l.preciseNumber;exports.roundNumberTo=l.roundNumberTo;exports.toStep=l.toStep;exports.cloneDeep=r.cloneDeep;exports.compareObjects=r.compareObjects;exports.isESClass=r.isESClass;exports.isNullish=r.isNullish;exports.isObject=r.isObject;exports.mergeDeep=r.mergeDeep;exports.mixin=r.mixin;exports.omit=r.omit;exports.pick=r.pick;exports.camelToKebab=u.camelToKebab;exports.capitalize=u.capitalize;exports.generateId=u.generateId;exports.isUppercase=u.isUppercase;exports.kebabToCamel=u.kebabToCamel;exports.snakeToDotted=u.snakeToDotted;exports.toPascalCase=u.toPascalCase;exports.uncapitalize=u.uncapitalize;exports.getElementTransitionDurationMS=O.getElementTransitionDurationMS;exports.getElementTransitionDurationS=O.getElementTransitionDurationS;exports.changeHistory=g.changeHistory;exports.normalizeBase=g.normalizeBase;exports.splitPath=g.splitPath;exports.decode=D;exports.dotCircleCollision=x;exports.dotRectCollision=w;exports.encode=B;exports.formatBytes=v;exports.getRootVariables=Q;exports.insert=P;exports.shiftArray=q;exports.wait=A;
|
package/lib/utils/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import { i as w } from "../browser-0zX67oeU.js";
|
|
|
3
3
|
import { a as S, c as O, f as B, m as I } from "../canvas-DeZ0SLUJ.js";
|
|
4
4
|
import { g as T, n as v, s as A } from "../coordinates-CgdGoSYs.js";
|
|
5
5
|
import { f as D, b as R, a as M, g as k } from "../dom-0S_WDL4g.js";
|
|
6
|
-
import { d as
|
|
6
|
+
import { d as N, o as V, g as j, q as U, c as $, j as q, n as F, a as K, h as W, k as G, f as H, p as J, b as L, i as Y, m as Z, l as X } from "../easings-BEmRlrDd.js";
|
|
7
7
|
import { d as ee } from "../events-CsVF98U6.js";
|
|
8
8
|
import { c as te } from "../file-lxi_oXJf.js";
|
|
9
9
|
import { d as oe, t as ne } from "../function-C10DGppn.js";
|
|
@@ -11,11 +11,11 @@ import { s as ie } from "../gestures-D2Fdra_G.js";
|
|
|
11
11
|
import { c as ce, s as le } from "../jss-CjccJC-K.js";
|
|
12
12
|
import { g as pe, a as me, b as de } from "../layout-HoBT_Da2.js";
|
|
13
13
|
import { e as ge, f as he, c as be, d as ye, l as Ce, m as we, r as Ee, b as Se, a as Oe, s as Be } from "../math-BOBiC4TN.js";
|
|
14
|
-
import {
|
|
15
|
-
import { c as
|
|
16
|
-
import { c as
|
|
17
|
-
import { g as
|
|
18
|
-
import { c as
|
|
14
|
+
import { l as Pe, n as Te, p as ve, r as Ae, t as Qe } from "../polyfills-CxfUK5OU.js";
|
|
15
|
+
import { c as Re, d as Me, i as ke, b as ze, a as Ne, m as Ve, e as je, o as Ue, p as $e } from "../object-D6MVWB4l.js";
|
|
16
|
+
import { c as Fe, a as Ke, g as We, i as Ge, k as He, s as Je, t as Le, u as Ye } from "../string-f0Dnk0L1.js";
|
|
17
|
+
import { g as Xe, a as _e } from "../style-j2TwriJ_.js";
|
|
18
|
+
import { c as aa, n as ta, s as sa } from "../url-BuZrUXAO.js";
|
|
19
19
|
function i(a, e, ...t) {
|
|
20
20
|
return [...a.slice(0, e), ...t, ...a.slice(e)];
|
|
21
21
|
}
|
|
@@ -88,12 +88,12 @@ function x(a) {
|
|
|
88
88
|
export {
|
|
89
89
|
ge as calculateDistance,
|
|
90
90
|
he as calculateDistanceWithRadius,
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
91
|
+
Fe as camelToKebab,
|
|
92
|
+
Ke as capitalize,
|
|
93
|
+
aa as changeHistory,
|
|
94
94
|
be as clamp,
|
|
95
|
-
|
|
96
|
-
|
|
95
|
+
Re as cloneDeep,
|
|
96
|
+
Me as compareObjects,
|
|
97
97
|
S as contain,
|
|
98
98
|
O as cover,
|
|
99
99
|
te as createJSONAndSave,
|
|
@@ -104,9 +104,9 @@ export {
|
|
|
104
104
|
ee as dispatchEvent,
|
|
105
105
|
f as dotCircleCollision,
|
|
106
106
|
l as dotRectCollision,
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
107
|
+
N as easeInCubic,
|
|
108
|
+
V as easeInExpo,
|
|
109
|
+
j as easeInOutCubic,
|
|
110
110
|
U as easeInOutExpo,
|
|
111
111
|
$ as easeInOutQuad,
|
|
112
112
|
q as easeInOutQuart,
|
|
@@ -124,51 +124,52 @@ export {
|
|
|
124
124
|
R as findScrollParentElement,
|
|
125
125
|
B as fixPosition,
|
|
126
126
|
c as formatBytes,
|
|
127
|
-
|
|
127
|
+
We as generateId,
|
|
128
128
|
M as getAllParentElements,
|
|
129
129
|
pe as getCumulativeOffsetLeft,
|
|
130
130
|
me as getCumulativeOffsetTop,
|
|
131
131
|
de as getCumulativePosition,
|
|
132
132
|
k as getElement,
|
|
133
|
-
|
|
134
|
-
|
|
133
|
+
Xe as getElementTransitionDurationMS,
|
|
134
|
+
_e as getElementTransitionDurationS,
|
|
135
135
|
T as getPointerPosition,
|
|
136
136
|
p as getRootVariables,
|
|
137
137
|
i as insert,
|
|
138
138
|
w as isBrowser,
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
139
|
+
ke as isESClass,
|
|
140
|
+
ze as isNullish,
|
|
141
|
+
Ne as isObject,
|
|
142
|
+
Ge as isUppercase,
|
|
143
|
+
He as kebabToCamel,
|
|
144
144
|
Ce as lerp,
|
|
145
145
|
X as linear,
|
|
146
|
+
Pe as loopNumber,
|
|
146
147
|
we as mapRange,
|
|
147
148
|
I as measureText,
|
|
148
149
|
Ve as mergeDeep,
|
|
149
150
|
je as mixin,
|
|
150
151
|
v as normalize,
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
152
|
+
ta as normalizeBase,
|
|
153
|
+
Te as nullishCoalescing,
|
|
154
|
+
Ue as omit,
|
|
154
155
|
b as parseAttribute,
|
|
155
156
|
y as parseAttributeValue,
|
|
156
|
-
|
|
157
|
-
|
|
157
|
+
$e as pick,
|
|
158
|
+
ve as preciseNumber,
|
|
158
159
|
Ee as round,
|
|
159
|
-
|
|
160
|
+
Ae as roundNumberTo,
|
|
160
161
|
A as screenToCartesian,
|
|
161
162
|
ie as setupDrag,
|
|
162
163
|
u as shiftArray,
|
|
163
164
|
Se as smootherstep,
|
|
164
165
|
Oe as smoothstep,
|
|
165
|
-
|
|
166
|
-
|
|
166
|
+
Je as snakeToDotted,
|
|
167
|
+
sa as splitPath,
|
|
167
168
|
Be as step,
|
|
168
169
|
le as styleToString,
|
|
169
170
|
ne as throttle,
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
171
|
+
Le as toPascalCase,
|
|
172
|
+
Qe as toStep,
|
|
173
|
+
Ye as uncapitalize,
|
|
173
174
|
x as wait
|
|
174
175
|
};
|
package/lib/utils/number.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export declare function preciseNumber(number: number, n?: number): number;
|
|
2
2
|
export declare function roundNumberTo(number: number, to: number): number;
|
|
3
3
|
export declare function toStep(value: number, step: number): number;
|
|
4
|
+
export declare function loopNumber(value: number, max: number): number;
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const i=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10];function o(e,n=5){return Math.round(e*i[n])/i[n]}function u(e,n){return Math.round(e/n)*n}function c(e,n){var r;const t=((r=n.toString().split(".")[1])==null?void 0:r.length)||0;return t?+e.toFixed(t):Math.ceil(e)}function s(e,n){return typeof e=="undefined"?n:e}exports.nullishCoalescing=s;exports.preciseNumber=o;exports.roundNumberTo=u;exports.toStep=c;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
const i = [
|
|
2
|
-
1,
|
|
3
|
-
10,
|
|
4
|
-
100,
|
|
5
|
-
1e3,
|
|
6
|
-
1e4,
|
|
7
|
-
1e5,
|
|
8
|
-
1e6,
|
|
9
|
-
1e7,
|
|
10
|
-
1e8,
|
|
11
|
-
1e9,
|
|
12
|
-
1e10
|
|
13
|
-
];
|
|
14
|
-
function o(e, n = 5) {
|
|
15
|
-
return Math.round(e * i[n]) / i[n];
|
|
16
|
-
}
|
|
17
|
-
function u(e, n) {
|
|
18
|
-
return Math.round(e / n) * n;
|
|
19
|
-
}
|
|
20
|
-
function s(e, n) {
|
|
21
|
-
var r;
|
|
22
|
-
const t = ((r = n.toString().split(".")[1]) == null ? void 0 : r.length) || 0;
|
|
23
|
-
return t ? +e.toFixed(t) : Math.ceil(e);
|
|
24
|
-
}
|
|
25
|
-
function c(e, n) {
|
|
26
|
-
return typeof e == "undefined" ? n : e;
|
|
27
|
-
}
|
|
28
|
-
export {
|
|
29
|
-
c as n,
|
|
30
|
-
o as p,
|
|
31
|
-
u as r,
|
|
32
|
-
s as t
|
|
33
|
-
};
|