@mkbabb/keyframes.js 4.2.0 → 4.3.0

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.
@@ -0,0 +1,156 @@
1
+ import { f as e, l as t } from "./timeline-BjcmprQ6.js";
2
+ //#region src/animation/sequence.ts
3
+ var n = class {
4
+ entries = [];
5
+ labels = /* @__PURE__ */ new Map();
6
+ cursor = 0;
7
+ _time = 0;
8
+ respectReducedMotion;
9
+ playback = new t();
10
+ _boundFrame;
11
+ _resolvePlay = null;
12
+ _playOrigin = void 0;
13
+ _playingPromise = null;
14
+ _rate = 1;
15
+ _repeatCount = 1;
16
+ _yoyoOn = !1;
17
+ _paused = !1;
18
+ _lastClock = void 0;
19
+ constructor(e) {
20
+ this.respectReducedMotion = e?.respectReducedMotion ?? !1, this._boundFrame = this._frame.bind(this);
21
+ }
22
+ get duration() {
23
+ let e = 0;
24
+ for (let t of this.entries) {
25
+ let n = t.at + t.animation.options.duration;
26
+ n > e && (e = n);
27
+ }
28
+ return e;
29
+ }
30
+ get time() {
31
+ return this._time;
32
+ }
33
+ get progress() {
34
+ return this.duration === 0 ? 0 : this._time / this.duration;
35
+ }
36
+ set progress(t) {
37
+ this.seek(e(t, 0, 1) * this.duration);
38
+ }
39
+ get rate() {
40
+ return this._rate;
41
+ }
42
+ label(e, t) {
43
+ return this.labels.set(e, this.resolvePosition(t)), this;
44
+ }
45
+ add(e, t) {
46
+ let n = this.resolvePosition(t);
47
+ return this.entries.push({
48
+ animation: e,
49
+ at: n
50
+ }), this.entries.sort((e, t) => e.at - t.at), this.cursor = n + e.options.duration, this;
51
+ }
52
+ resolvePosition(e) {
53
+ if (e === void 0) return this.cursor;
54
+ if (typeof e == "number") return e;
55
+ let t = /^([+-])=(\d*\.?\d+)$/.exec(e);
56
+ if (t) {
57
+ let e = t[1] === "+" ? 1 : -1;
58
+ return this.cursor + e * Number.parseFloat(t[2]);
59
+ }
60
+ let n = this.labels.get(e);
61
+ if (n === void 0) throw Error(`Sequence: unknown position "${e}". Register it with .label("${e}", at) first, or pass a number / "+=n" / "-=n".`);
62
+ return n;
63
+ }
64
+ seek(e) {
65
+ return this._time = e, this._applyAt(e), this;
66
+ }
67
+ _applyAt(t) {
68
+ for (let { animation: n, at: r } of this.entries) {
69
+ let i = e(t - r, 0, n.options.duration);
70
+ n.interpFrames(i, !0);
71
+ }
72
+ }
73
+ _fold(t) {
74
+ let n = this.duration;
75
+ if (n <= 0) return 0;
76
+ let r = e(t, 0, n * this._repeatCount), i = Math.floor(r / n), a = r - i * n;
77
+ return a === 0 && i > 0 && (--i, a = n), this._yoyoOn && i % 2 == 1 ? n - a : a;
78
+ }
79
+ setTargets(...e) {
80
+ for (let { animation: t } of this.entries) t.setTargets(...e);
81
+ return this;
82
+ }
83
+ get finished() {
84
+ return this._playingPromise ?? Promise.resolve();
85
+ }
86
+ play() {
87
+ if (this._playingPromise) return this._playingPromise;
88
+ if (this.respectReducedMotion && r()) return this.seek(this.duration), Promise.resolve();
89
+ for (let { animation: e, at: t } of this.entries) e.startTime = t, e.started = !0, e.managed = !0;
90
+ this._time = 0, this._paused = !1, this._playOrigin = void 0, this._lastClock = void 0;
91
+ let e = new Promise((e) => {
92
+ this._resolvePlay = e, this.playback.loop(this._boundFrame);
93
+ });
94
+ return this._playingPromise = e, e.finally(() => {
95
+ this._playingPromise = null;
96
+ }), e;
97
+ }
98
+ async _frame(e) {
99
+ this._playOrigin === void 0 && (this._playOrigin = this._rate === 0 ? e : e - this._time / this._rate), this._lastClock = e;
100
+ let t = (e - this._playOrigin) * this._rate, n = this.duration * this._repeatCount, r = this._rate >= 0 ? t >= n : t <= 0, i = r ? this._rate >= 0 ? this._restPhase() : 0 : this._fold(t);
101
+ if (this._time = i, this._isForwardMonotone()) for (let { animation: e, at: t } of this.entries) i >= t && i - t < e.options.duration && await e.advanceTo(i);
102
+ if (this._applyAt(i), r) {
103
+ this._settle();
104
+ let e = this._resolvePlay;
105
+ return this._resolvePlay = null, e?.(), !1;
106
+ }
107
+ return !0;
108
+ }
109
+ _isForwardMonotone() {
110
+ return this._rate === 1 && this._repeatCount === 1 && !this._yoyoOn;
111
+ }
112
+ _restPhase() {
113
+ let e = this.duration;
114
+ return this._yoyoOn && (this._repeatCount - 1) % 2 == 1 ? 0 : e;
115
+ }
116
+ _reanchor() {
117
+ if (!this._playingPromise) return;
118
+ let e = this._lastClock;
119
+ if (e === void 0) {
120
+ this._playOrigin = void 0;
121
+ return;
122
+ }
123
+ this._playOrigin = this._rate === 0 ? e : e - this._time / this._rate;
124
+ }
125
+ _settle() {
126
+ for (let { animation: e } of this.entries) e.managed = !1, e.started = !1, e.startTime = void 0;
127
+ this._playOrigin = void 0, this._lastClock = void 0, this._paused = !1;
128
+ }
129
+ stop() {
130
+ this.playback.stop(), this._settle();
131
+ let e = this._resolvePlay;
132
+ return this._resolvePlay = null, e?.(), this;
133
+ }
134
+ pause() {
135
+ return !this._playingPromise || this._paused ? this : (this._paused = !0, this.playback.stop(), this._playOrigin = void 0, this);
136
+ }
137
+ resume() {
138
+ return !this._playingPromise || !this._paused ? this : (this._paused = !1, this._playOrigin = void 0, this._lastClock = void 0, this.playback.loop(this._boundFrame), this);
139
+ }
140
+ timeScale(e) {
141
+ if (!Number.isFinite(e)) throw Error(`Sequence.timeScale(n): n must be a finite number, got ${e}.`);
142
+ return this._rate = e, this._reanchor(), this;
143
+ }
144
+ reverse() {
145
+ return this._rate = -this._rate, this._reanchor(), this;
146
+ }
147
+ repeat(e) {
148
+ if (e !== Infinity && (!Number.isInteger(e) || e < 1)) throw Error(`Sequence.repeat(count): count must be a positive integer or Infinity, got ${e}.`);
149
+ return this._repeatCount = e, this;
150
+ }
151
+ yoyo(e = !0) {
152
+ return this._yoyoOn = e, this;
153
+ }
154
+ }, r = () => typeof matchMedia == "function" && matchMedia("(prefers-reduced-motion: reduce)").matches;
155
+ //#endregion
156
+ export { n as t };
@@ -0,0 +1,51 @@
1
+ import { a as e } from "./timeline-BjcmprQ6.js";
2
+ //#region src/animation/springLinearStops.ts
3
+ function t(t) {
4
+ let n = t.sampleCount ?? 24, r = t.settleThreshold ?? .001, i = t.maxDuration ?? t.response * 4, a = new e({
5
+ response: t.response,
6
+ dampingFraction: t.dampingFraction,
7
+ initial: 0,
8
+ settleThreshold: r,
9
+ velocitySettleThreshold: r
10
+ });
11
+ a.target = 1;
12
+ let o = ["0"], s = i / (n + 1);
13
+ for (let e = 1; e <= n; e++) {
14
+ a._stepSeconds(s);
15
+ let t = e / (n + 1) * 100, r = a.settled ? 1 : a.value;
16
+ o.push(`${r.toFixed(5)} ${t.toFixed(3)}%`);
17
+ }
18
+ return o.push("1"), a.dispose(), `linear(${o.join(", ")})`;
19
+ }
20
+ //#endregion
21
+ //#region src/animation/springTimingFunction.ts
22
+ function n(n) {
23
+ let r = n.sampleCount ?? 64, i = n.settleThreshold ?? .001, a = n.maxDuration ?? n.response * 4, o = new e({
24
+ response: n.response,
25
+ dampingFraction: n.dampingFraction,
26
+ initial: 0,
27
+ settleThreshold: i,
28
+ velocitySettleThreshold: i
29
+ });
30
+ o.target = 1;
31
+ let s = new Float64Array(r + 1);
32
+ s[0] = 0;
33
+ let c = a / r;
34
+ for (let e = 1; e <= r; e++) o._stepSeconds(c), s[e] = o.settled ? 1 : o.value;
35
+ s[r] = 1, o.dispose();
36
+ let l = (e) => {
37
+ if (e <= 0) return 0;
38
+ if (e >= 1) return 1;
39
+ let t = e * r, n = Math.floor(t), i = t - n, a = s[n];
40
+ return a + (s[n + 1] - a) * i;
41
+ }, u = {
42
+ response: n.response,
43
+ dampingFraction: n.dampingFraction
44
+ };
45
+ return n.settleThreshold !== void 0 && (u.settleThreshold = n.settleThreshold), n.maxDuration !== void 0 && (u.maxDuration = n.maxDuration), {
46
+ fn: l,
47
+ css: t(u)
48
+ };
49
+ }
50
+ //#endregion
51
+ export { t as n, n as t };
@@ -26,7 +26,7 @@ var i = (e) => typeof e == "function" ? { fn: e } : e, a = /^(linear|ease|ease-i
26
26
  async function c(e) {
27
27
  let t;
28
28
  try {
29
- t = await import("./engine-Gk4Q7ltr.js");
29
+ t = await import("./engine-BKm1GcJT.js");
30
30
  } catch (t) {
31
31
  throw Error(`keyframes: the engine chunk failed to load while resolving easing "${e}" — the easing registry is unreachable.`, { cause: t });
32
32
  }
@@ -36,40 +36,28 @@ async function c(e) {
36
36
  return a && (i.css = a), i;
37
37
  }
38
38
  //#endregion
39
- //#region src/animation/internal/binarySearch.ts
40
- function l(e, t, n, r) {
41
- let i = 0, a = e.length - 1;
42
- for (; i <= a;) {
43
- let o = i + a >> 1, s = e[o];
44
- if (t < n(s)) a = o - 1;
45
- else if (t > r(s)) i = o + 1;
46
- else return o;
47
- }
48
- return -1;
49
- }
50
- //#endregion
51
39
  //#region src/animation/internal/leaves.ts
52
- var u = 1e3 / 60;
53
- function d(e, t, n) {
40
+ var l = 1e3 / 60;
41
+ function u(e, t, n) {
54
42
  return Math.min(Math.max(e, t), n);
55
43
  }
56
- function f(e, t, n, r = 0, i = 1) {
44
+ function d(e, t, n, r = 0, i = 1) {
57
45
  if (n === t) throw Error("fromMax and fromMin cannot be equal");
58
46
  let a = (i - r) / (n - t);
59
47
  return (e - t) * a + r;
60
48
  }
61
- function p(e, t, n) {
49
+ function f(e, t, n) {
62
50
  return (1 - n) * e + n * t;
63
51
  }
64
- function m(e) {
52
+ function p(e) {
65
53
  if (typeof window < "u" && window.requestAnimationFrame) return window.requestAnimationFrame(e);
66
- let t = u, n = Date.now();
54
+ let t = l, n = Date.now();
67
55
  return setTimeout(() => {
68
56
  let r = Date.now(), i = r - n;
69
- n = r, t = Math.max(0, u - i), e(r);
57
+ n = r, t = Math.max(0, l - i), e(r);
70
58
  }, t);
71
59
  }
72
- function h(e) {
60
+ function m(e) {
73
61
  if (e != null) {
74
62
  if (typeof e == "number" && typeof window < "u" && window.cancelAnimationFrame) return window.cancelAnimationFrame(e);
75
63
  clearTimeout(e);
@@ -77,16 +65,19 @@ function h(e) {
77
65
  }
78
66
  //#endregion
79
67
  //#region src/animation/internal/reduced-motion.ts
80
- var g = "(prefers-reduced-motion: reduce)", _ = null, v;
81
- function y() {
68
+ var h = "(prefers-reduced-motion: reduce)", g = null, _;
69
+ function v() {
82
70
  let e = typeof window > "u" ? void 0 : window.matchMedia;
83
- return typeof e == "function" ? _ !== null && v === e ? _ : (v = e, _ = e.call(window, g), _) : (_ = null, v = e, null);
71
+ return typeof e == "function" ? g !== null && _ === e ? g : (_ = e, g = e.call(window, h), g) : (g = null, _ = e, null);
84
72
  }
85
- function b() {
86
- return y()?.matches ?? !1;
73
+ function y() {
74
+ return v()?.matches ?? !1;
75
+ }
76
+ function b(e) {
77
+ return e === !1 || e === void 0 || !y() ? 1 : e === !0 || e < 0 ? 0 : e > 1 ? 1 : e;
87
78
  }
88
79
  function x(e, t, n) {
89
- return e && b() ? t() : n();
80
+ return !e && e !== 0 || !y() ? n() : e === !0 || e === 0 ? t() : n();
90
81
  }
91
82
  //#endregion
92
83
  //#region src/animation/playback.ts
@@ -101,19 +92,19 @@ var S = class {
101
92
  }
102
93
  _run(e) {
103
94
  let t = ++this._gen, n = (e) => {
104
- t === this._gen && (e ? this._rafId = m(r) : this._cleanup());
95
+ t === this._gen && (e ? this._rafId = p(r) : this._cleanup());
105
96
  }, r = (t) => {
106
97
  let r = e(t);
107
98
  r && typeof r.then == "function" ? r.then(n) : n(r);
108
99
  };
109
- this._rafId = m(r);
100
+ this._rafId = p(r);
110
101
  }
111
102
  play = (e, t, n) => {
112
103
  if (e <= 0) throw Error("RAFPlayback.play() requires a duration > 0.");
113
104
  return this.stop(), x(n?.respectReducedMotion, () => (t(1), Promise.resolve()), () => new Promise((n) => {
114
105
  this._resolve = n, this._startTime = void 0, this._run((n) => {
115
106
  this._startTime === void 0 && (this._startTime = n);
116
- let r = d((n - this._startTime) / e, 0, 1);
107
+ let r = u((n - this._startTime) / e, 0, 1);
117
108
  return t(r), r < 1;
118
109
  });
119
110
  }));
@@ -128,7 +119,7 @@ var S = class {
128
119
  this.stop(), this._run(e);
129
120
  };
130
121
  stop = () => {
131
- this._gen++, this._rafId !== null && h(this._rafId), this._cleanup();
122
+ this._gen++, this._rafId !== null && m(this._rafId), this._cleanup();
132
123
  };
133
124
  _cleanup() {
134
125
  this._rafId = null, this._startTime = void 0, this._lastFrameT = 0;
@@ -165,7 +156,7 @@ var S = class {
165
156
  return this.isSettled;
166
157
  }
167
158
  setTarget(e) {
168
- this.options.clamp && (e = d(e, 0, 1));
159
+ this.options.clamp && (e = u(e, 0, 1));
169
160
  let t = Math.abs(e - this.targetValue);
170
161
  t > 0 && t >= this.options.targetEpsilon && (this.targetValue = e, x(this.options.respectReducedMotion, () => this._snapSettled(), () => {
171
162
  this.isSettled = !1, this._onFrame && this._startLoop();
@@ -177,7 +168,7 @@ var S = class {
177
168
  tickDt(e) {
178
169
  if (this.isSettled) return this.currentValue;
179
170
  let t = 1 - Math.exp(-this.options.damping * e / 16.667);
180
- return this.currentValue += (this.targetValue - this.currentValue) * t, Math.abs(this.targetValue - this.currentValue) < this.options.snapThreshold && (this.currentValue = this.targetValue, this.isSettled = !0), this.options.clamp && (this.currentValue = d(this.currentValue, 0, 1)), this.currentValue;
171
+ return this.currentValue += (this.targetValue - this.currentValue) * t, Math.abs(this.targetValue - this.currentValue) < this.options.snapThreshold && (this.currentValue = this.targetValue, this.isSettled = !0), this.options.clamp && (this.currentValue = u(this.currentValue, 0, 1)), this.currentValue;
181
172
  }
182
173
  snap() {
183
174
  this.currentValue = this.targetValue, this.isSettled = !0, this._playback.stop();
@@ -201,7 +192,150 @@ var S = class {
201
192
  _startLoop() {
202
193
  this._playback.drive(this, () => this._onFrame?.(this.currentValue));
203
194
  }
204
- }, T = class {
195
+ };
196
+ //#endregion
197
+ //#region src/animation/spring.ts
198
+ function T(e) {
199
+ let { visualDuration: t, duration: n, bounce: r = 0, ...i } = e, a = t ?? n ?? E.response, o = 1 - u(r, -1, 1);
200
+ return {
201
+ ...i,
202
+ response: a,
203
+ dampingFraction: o
204
+ };
205
+ }
206
+ var E = {
207
+ response: .5,
208
+ dampingFraction: .86,
209
+ initial: 0,
210
+ initialVelocity: 0,
211
+ settleThreshold: .001,
212
+ velocitySettleThreshold: .001,
213
+ respectReducedMotion: !1
214
+ }, D = class e {
215
+ options;
216
+ targetValue;
217
+ currentValue;
218
+ currentVelocity;
219
+ isSettled;
220
+ elapsed;
221
+ originValue;
222
+ originVelocity;
223
+ amplitudeScale = 1;
224
+ omega;
225
+ zeta;
226
+ omegaD;
227
+ subscribers = /* @__PURE__ */ new Set();
228
+ disposed = !1;
229
+ _playback = new S();
230
+ _onFrame = void 0;
231
+ constructor(e) {
232
+ this.options = {
233
+ ...E,
234
+ ...e
235
+ }, this.targetValue = this.options.initial, this.currentValue = this.options.initial, this.currentVelocity = this.options.initialVelocity, this.isSettled = this.options.initialVelocity === 0, this.elapsed = 0, this.originValue = this.currentValue, this.originVelocity = this.currentVelocity, this.amplitudeScale = b(this.options.respectReducedMotion), this.omega = 2 * Math.PI / this.options.response, this.zeta = this.options.dampingFraction, this.omegaD = this.zeta < 1 ? this.omega * Math.sqrt(1 - this.zeta * this.zeta) : 0;
236
+ }
237
+ static fromDuration(t) {
238
+ return new e(T(t ?? {}));
239
+ }
240
+ get target() {
241
+ return this.targetValue;
242
+ }
243
+ get value() {
244
+ return this.currentValue;
245
+ }
246
+ get velocity() {
247
+ return this.currentVelocity;
248
+ }
249
+ get settled() {
250
+ return this.isSettled;
251
+ }
252
+ set target(e) {
253
+ e === this.targetValue && !this.options.initialVelocity || this.reseatTarget(e);
254
+ }
255
+ reseatTarget(e) {
256
+ this.targetValue = e, x(this.options.respectReducedMotion, () => this._snapSettled(), () => {
257
+ this.originValue = this.currentValue, this.originVelocity = this.currentVelocity, this.elapsed = 0, this.isSettled = !1, this.amplitudeScale = b(this.options.respectReducedMotion), this._onFrame && this._startLoop();
258
+ });
259
+ }
260
+ _snapSettled() {
261
+ this.currentValue = this.targetValue, this.currentVelocity = 0, this.originValue = this.targetValue, this.originVelocity = 0, this.elapsed = 0, this.isSettled = !0, this.emit(), this._playback.stop();
262
+ }
263
+ tickDt(e) {
264
+ return this._stepSeconds(e / 1e3);
265
+ }
266
+ _stepSeconds(e) {
267
+ return this.disposed || this.isSettled || e <= 0 ? this.currentValue : (this.elapsed += e, this.evaluateAt(this.elapsed), this.checkSettled(), this.emit(), this.currentValue);
268
+ }
269
+ tickToTime(e) {
270
+ return this.disposed || this.isSettled ? this.currentValue : (this.elapsed = Math.max(0, e), this.evaluateAt(this.elapsed), this.checkSettled(), this.emit(), this.currentValue);
271
+ }
272
+ evaluateAt(e) {
273
+ let t = this.amplitudeScale, n = this.originValue + t * (this.targetValue - this.originValue), r = this.originValue - n, i = this.originVelocity, a = this.omega, o = this.zeta, s, c;
274
+ if (o < 1) {
275
+ let t = this.omegaD, n = Math.exp(-o * a * e), l = r, u = (i + o * a * r) / t, d = Math.cos(t * e), f = Math.sin(t * e);
276
+ s = n * (l * d + u * f), c = n * ((u * t - l * o * a) * d - (l * t + u * o * a) * f);
277
+ } else if (o === 1) {
278
+ let t = Math.exp(-a * e), n = r, o = i + a * r;
279
+ s = t * (n + o * e), c = t * (o - a * (n + o * e));
280
+ } else {
281
+ let t = a * Math.sqrt(o * o - 1), n = -o * a + t, l = -o * a - t, u = (i - l * r) / (n - l), d = r - u, f = Math.exp(n * e), p = Math.exp(l * e);
282
+ s = u * f + d * p, c = u * n * f + d * l * p;
283
+ }
284
+ this.currentValue = n + s, this.currentVelocity = c;
285
+ }
286
+ checkSettled() {
287
+ let e = this.amplitudeScale, t = this.originValue + e * (this.targetValue - this.originValue), n = Math.abs(this.currentValue - t), r = Math.abs(this.currentVelocity);
288
+ n < this.options.settleThreshold && r < this.options.velocitySettleThreshold && (this.currentValue = t, this.currentVelocity = 0, this.isSettled = !0);
289
+ }
290
+ snap() {
291
+ this._snapSettled();
292
+ }
293
+ reset(e, t) {
294
+ let n = e ?? 0, r = t ?? 0;
295
+ this.targetValue = n, this.currentValue = n, this.currentVelocity = r, this.originValue = n, this.originVelocity = r, this.elapsed = 0, this.amplitudeScale = b(this.options.respectReducedMotion), this.isSettled = r === 0, this.emit(), this._playback.stop();
296
+ }
297
+ subscribe(e) {
298
+ return this.subscribers.add(e), () => {
299
+ this.subscribers.delete(e);
300
+ };
301
+ }
302
+ emit() {
303
+ if (this.subscribers.size !== 0) for (let e of this.subscribers) e(this.currentValue, this.currentVelocity);
304
+ }
305
+ dispose() {
306
+ this.disposed = !0, this._playback.stop(), this.subscribers.clear();
307
+ }
308
+ play(e) {
309
+ this.disposed || (this._onFrame = e, x(this.options.respectReducedMotion, () => this._snapSettled(), () => {
310
+ if (this.isSettled) {
311
+ e?.(this.currentValue, this.currentVelocity);
312
+ return;
313
+ }
314
+ this._startLoop();
315
+ }));
316
+ }
317
+ stop() {
318
+ this._onFrame = void 0, this._playback.stop();
319
+ }
320
+ _startLoop() {
321
+ this._playback.drive(this, () => this._onFrame?.(this.currentValue, this.currentVelocity));
322
+ }
323
+ };
324
+ function O(e) {
325
+ let t = e.curr.time - e.prev.time;
326
+ return t <= 0 ? 0 : (e.curr.value - e.prev.value) / (t / 1e3);
327
+ }
328
+ function k(e, t, n) {
329
+ let r = O(e), i = new D({
330
+ ...n,
331
+ initial: e.curr.value,
332
+ initialVelocity: r
333
+ });
334
+ return i.target = t, i;
335
+ }
336
+ //#endregion
337
+ //#region src/animation/timeline.ts
338
+ var A = class {
205
339
  smoother;
206
340
  _easingFn;
207
341
  currentProgress = 0;
@@ -213,7 +347,7 @@ var S = class {
213
347
  this._easingFn = n == null ? (e) => e : i(n).fn, e?.smoothing === !1 ? this.smoother = null : this.smoother = new w(e?.smoothing);
214
348
  }
215
349
  applyPipeline() {
216
- let e = d(this.sample(), 0, 1);
350
+ let e = u(this.sample(), 0, 1);
217
351
  e = this._easingFn(e);
218
352
  let t = this.boundaryEpsilon;
219
353
  return e <= t ? e = 0 : e >= 1 - t && (e = 1), e;
@@ -241,7 +375,7 @@ var S = class {
241
375
  let t = e ?? 0;
242
376
  this.smoother && this.smoother.reset(t), this.currentProgress = t;
243
377
  }
244
- }, E = class extends T {
378
+ }, j = class extends A {
245
379
  threshold;
246
380
  getScrollY;
247
381
  getViewportHeight;
@@ -252,7 +386,7 @@ var S = class {
252
386
  let e = this.getViewportHeight() * this.threshold;
253
387
  return e <= 0 ? 0 : this.getScrollY() / e;
254
388
  }
255
- }, D = class extends T {
389
+ }, M = class extends A {
256
390
  value = 0;
257
391
  constructor(e) {
258
392
  super({
@@ -267,7 +401,7 @@ var S = class {
267
401
  return this.value;
268
402
  }
269
403
  };
270
- function O(e) {
404
+ function N(e) {
271
405
  if (typeof window > "u") return null;
272
406
  if (e.kind === "scroll") {
273
407
  if (globalThis.ScrollTimeline === void 0) return null;
@@ -279,4 +413,4 @@ function O(e) {
279
413
  return e.axis !== void 0 && (t.axis = e.axis), e.inset !== void 0 && (t.inset = e.inset), new globalThis.ViewTimeline(t);
280
414
  }
281
415
  //#endregion
282
- export { r as _, w as a, d as c, l as d, s as f, n as g, t as h, O as i, p as l, i as m, E as n, S as o, c as p, T as r, x as s, D as t, f as u };
416
+ export { i as _, D as a, r as b, w as c, x as d, u as f, c as g, s as h, N as i, S as l, d as m, j as n, O as o, f as p, A as r, k as s, M as t, b as u, t as v, n as y };