@ssgoi/core 2.4.0 → 2.5.1

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.
Files changed (42) hide show
  1. package/dist/animate.d.ts +35 -0
  2. package/dist/animate.d.ts.map +1 -0
  3. package/dist/animation-scheduler.d.ts +47 -0
  4. package/dist/animation-scheduler.d.ts.map +1 -0
  5. package/dist/animator.d.ts +3 -8
  6. package/dist/animator.d.ts.map +1 -1
  7. package/dist/create-ssgoi-transition-context.d.ts.map +1 -1
  8. package/dist/create-transition-callback.d.ts.map +1 -1
  9. package/dist/index.cjs +2 -2
  10. package/dist/index.d.ts +1 -0
  11. package/dist/index.d.ts.map +1 -1
  12. package/dist/index.js +787 -306
  13. package/dist/jaemin-BAi8PTrj.js +130 -0
  14. package/dist/jaemin-DL1-g_B5.cjs +1 -0
  15. package/dist/test-utils.d.ts +46 -0
  16. package/dist/test-utils.d.ts.map +1 -0
  17. package/dist/ticker.d.ts +37 -0
  18. package/dist/ticker.d.ts.map +1 -0
  19. package/dist/transition-strategy.d.ts +2 -3
  20. package/dist/transition-strategy.d.ts.map +1 -1
  21. package/dist/types.cjs +1 -1
  22. package/dist/types.d.ts +164 -4
  23. package/dist/types.d.ts.map +1 -1
  24. package/dist/types.js +10 -1
  25. package/dist/view-transitions/blind.d.ts.map +1 -1
  26. package/dist/view-transitions/curtain-reveal.d.ts +19 -0
  27. package/dist/view-transitions/curtain-reveal.d.ts.map +1 -0
  28. package/dist/view-transitions/fade.d.ts.map +1 -1
  29. package/dist/view-transitions/film.d.ts.map +1 -1
  30. package/dist/view-transitions/hero.d.ts +1 -0
  31. package/dist/view-transitions/hero.d.ts.map +1 -1
  32. package/dist/view-transitions/index.cjs +19 -19
  33. package/dist/view-transitions/index.d.ts +3 -1
  34. package/dist/view-transitions/index.d.ts.map +1 -1
  35. package/dist/view-transitions/index.js +620 -547
  36. package/dist/view-transitions/jaemin.d.ts +4 -0
  37. package/dist/view-transitions/jaemin.d.ts.map +1 -1
  38. package/dist/view-transitions/strip.d.ts +3 -0
  39. package/dist/view-transitions/strip.d.ts.map +1 -0
  40. package/package.json +16 -13
  41. package/dist/view-transitions/hero-rotate.d.ts +0 -28
  42. package/dist/view-transitions/hero-rotate.d.ts.map +0 -1
package/dist/index.js CHANGED
@@ -1,108 +1,207 @@
1
- var M = Object.defineProperty;
2
- var U = (o, t, n) => t in o ? M(o, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : o[t] = n;
3
- var g = (o, t, n) => U(o, typeof t != "symbol" ? t + "" : t, n);
4
- import { animate as T } from "popmotion";
5
- class A {
1
+ var _ = Object.defineProperty;
2
+ var $ = (n, t, e) => t in n ? _(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
3
+ var d = (n, t, e) => $(n, typeof t != "symbol" ? t + "" : t, e);
4
+ import { isMultiSpring as R } from "./types.js";
5
+ import { isSingleSpring as at } from "./types.js";
6
+ import { j as lt } from "./jaemin-BAi8PTrj.js";
7
+ class F {
8
+ constructor() {
9
+ d(this, "listeners", /* @__PURE__ */ new Set());
10
+ d(this, "rafId", null);
11
+ d(this, "isRunning", !1);
12
+ // Timing
13
+ d(this, "startTime", Date.now());
14
+ d(this, "lastUpdate", this.startTime);
15
+ d(this, "elapsed", 0);
16
+ // Lag smoothing (mobile optimization)
17
+ d(this, "lagThreshold", 500);
18
+ // ms - detect tab switches, backgrounding
19
+ d(this, "adjustedLag", 33);
20
+ // ms - max time jump to prevent animation skip
21
+ // FPS throttling
22
+ d(this, "gap", 1e3 / 240);
23
+ // max 240fps
24
+ d(this, "nextTime", this.gap);
25
+ d(this, "tick", () => {
26
+ const t = Date.now();
27
+ let e = t - this.lastUpdate;
28
+ (e > this.lagThreshold || e < 0) && (this.startTime += e - this.adjustedLag, e = this.adjustedLag), this.lastUpdate = t;
29
+ const i = t - this.startTime, r = i - this.nextTime;
30
+ if (r > 0) {
31
+ const o = e / 1e3;
32
+ this.elapsed = i / 1e3, this.nextTime += r + (r >= this.gap ? 4 : this.gap - r), this.listeners.forEach((s) => {
33
+ s(o, this.elapsed);
34
+ });
35
+ }
36
+ this.listeners.size > 0 ? this.rafId = requestAnimationFrame(this.tick) : (this.isRunning = !1, this.rafId = null);
37
+ });
38
+ }
39
+ subscribe(t) {
40
+ return this.listeners.add(t), this.isRunning || (this.isRunning = !0, this.rafId = requestAnimationFrame(this.tick)), () => {
41
+ this.unsubscribe(t);
42
+ };
43
+ }
44
+ unsubscribe(t) {
45
+ this.listeners.delete(t), this.listeners.size === 0 && this.rafId !== null && (cancelAnimationFrame(this.rafId), this.isRunning = !1, this.rafId = null);
46
+ }
47
+ /**
48
+ * Configure lag smoothing behavior
49
+ * @param threshold - Time threshold to detect lag (default: 500ms)
50
+ * @param adjustedLag - Max time jump when lag detected (default: 33ms)
51
+ */
52
+ lagSmoothing(t, e) {
53
+ this.lagThreshold = t, this.adjustedLag = Math.min(e, t);
54
+ }
55
+ /**
56
+ * Set maximum FPS
57
+ * @param fps - Target FPS (default: 240)
58
+ */
59
+ fps(t) {
60
+ this.gap = 1e3 / t, this.nextTime = this.elapsed * 1e3 + this.gap;
61
+ }
62
+ getListenerCount() {
63
+ return this.listeners.size;
64
+ }
65
+ getElapsed() {
66
+ return this.elapsed;
67
+ }
68
+ }
69
+ const I = new F();
70
+ function k(n) {
71
+ const {
72
+ from: t,
73
+ to: e,
74
+ stiffness: i,
75
+ damping: r,
76
+ mass: o,
77
+ velocity: s = 0,
78
+ onUpdate: m,
79
+ onComplete: l
80
+ } = n;
81
+ let h = t, u = s, a = !0;
82
+ const p = Math.sqrt(i / o), c = r / (2 * Math.sqrt(i * o)), S = 0.01, w = 0.01;
83
+ let f = 0;
84
+ const g = 0.05, v = (A) => {
85
+ if (!a) return;
86
+ const C = Math.min(A, 0.033), y = -2 * C * c * p * u, b = C * p * p * (e - h);
87
+ u += y + b, h += C * u;
88
+ const E = Math.abs(e - h), T = Math.abs(u);
89
+ if (E < S && T < w) {
90
+ if (f += C, f >= g) {
91
+ h = e, u = 0, a = !1, m(h), I.unsubscribe(v), l();
92
+ return;
93
+ }
94
+ } else
95
+ f = 0;
96
+ m(h);
97
+ };
98
+ return I.subscribe(v), {
99
+ stop: () => {
100
+ a && (a = !1, I.unsubscribe(v));
101
+ }
102
+ };
103
+ }
104
+ class O {
6
105
  constructor(t) {
7
- g(this, "options");
8
- g(this, "currentValue");
9
- g(this, "velocity");
10
- g(this, "isAnimating", !1);
11
- g(this, "controls", null);
106
+ d(this, "options");
107
+ d(this, "currentValue");
108
+ d(this, "velocity");
109
+ d(this, "isAnimating", !1);
110
+ d(this, "controls", null);
12
111
  // For object animations
13
- g(this, "animationMap", null);
14
- g(this, "activeAnimations", /* @__PURE__ */ new Set());
15
- g(this, "completedAnimations", /* @__PURE__ */ new Set());
16
- g(this, "updatedProperties", /* @__PURE__ */ new Set());
17
- g(this, "animate", (t = !1) => {
112
+ d(this, "animationMap", null);
113
+ d(this, "activeAnimations", /* @__PURE__ */ new Set());
114
+ d(this, "completedAnimations", /* @__PURE__ */ new Set());
115
+ d(this, "updatedProperties", /* @__PURE__ */ new Set());
116
+ d(this, "animate", (t = !1) => {
18
117
  !this.isAnimating && this.options.onStart && this.options.onStart(), this.isAnimating = !0;
19
- const n = t ? this.options.from : this.options.to;
118
+ const e = t ? this.options.from : this.options.to;
20
119
  if (typeof this.currentValue == "object" && this.currentValue !== null) {
21
- this.animateObject(n);
120
+ this.animateObject(e);
22
121
  return;
23
122
  }
24
- let e = this.currentValue, i = performance.now();
25
- const f = {
123
+ let i = this.currentValue, r = performance.now();
124
+ const o = {
26
125
  from: this.currentValue,
27
- to: n,
126
+ to: e,
28
127
  stiffness: this.options.spring.stiffness,
29
128
  damping: this.options.spring.damping,
30
129
  mass: 1
31
130
  };
32
- typeof this.velocity == "number" && (f.velocity = this.velocity * 1e3), this.controls = T({
33
- ...f,
34
- onUpdate: (l) => {
35
- const h = performance.now(), a = (h - i) / 1e3;
36
- if (a > 0) {
37
- if (typeof l == "number" && typeof e == "number") {
38
- const p = (l - e) / a;
39
- this.velocity = p / 1e3;
40
- } else if (typeof l == "object" && l !== null) {
41
- const p = {};
42
- Object.keys(l).forEach((c) => {
43
- const s = l[c], u = e[c];
44
- if (typeof s == "number" && typeof u == "number") {
45
- const d = (s - u) / a;
46
- p[c] = d / 1e3;
131
+ typeof this.velocity == "number" && (o.velocity = this.velocity * 1e3), this.controls = k({
132
+ ...o,
133
+ onUpdate: (s) => {
134
+ const m = performance.now(), l = (m - r) / 1e3;
135
+ if (l > 0) {
136
+ if (typeof s == "number" && typeof i == "number") {
137
+ const h = (s - i) / l;
138
+ this.velocity = h / 1e3;
139
+ } else if (typeof s == "object" && s !== null) {
140
+ const h = {};
141
+ Object.keys(s).forEach((u) => {
142
+ const a = s[u], p = i[u];
143
+ if (typeof a == "number" && typeof p == "number") {
144
+ const c = (a - p) / l;
145
+ h[u] = c / 1e3;
47
146
  }
48
- }), this.velocity = p;
147
+ }), this.velocity = h;
49
148
  }
50
- e = l, i = h;
149
+ i = s, r = m;
51
150
  }
52
- this.currentValue = l, this.options.onUpdate(l);
151
+ this.currentValue = s, this.options.onUpdate(s);
53
152
  },
54
153
  onComplete: () => {
55
- this.currentValue = n, this.isAnimating = !1, this.controls = null, typeof this.velocity == "object" && this.velocity !== null ? Object.keys(this.velocity).forEach((l) => {
56
- this.velocity[l] = 0;
154
+ this.currentValue = e, this.isAnimating = !1, this.controls = null, typeof this.velocity == "object" && this.velocity !== null ? Object.keys(this.velocity).forEach((s) => {
155
+ this.velocity[s] = 0;
57
156
  }) : this.velocity = 0, this.options.onComplete();
58
157
  }
59
158
  });
60
159
  });
61
- g(this, "animateObject", (t) => {
62
- const n = this.currentValue, e = Object.keys(n);
160
+ d(this, "animateObject", (t) => {
161
+ const e = this.currentValue, i = Object.keys(e);
63
162
  this.animationMap = /* @__PURE__ */ new Map(), this.activeAnimations.clear(), this.completedAnimations.clear(), this.updatedProperties.clear();
64
- const i = { ...n }, f = {};
65
- let l = !1;
66
- const h = () => {
67
- const a = e.filter((c) => !this.completedAnimations.has(c));
68
- if (a.every(
69
- (c) => this.updatedProperties.has(c)
70
- ) && a.length > 0) {
163
+ const r = { ...e }, o = {};
164
+ let s = !1;
165
+ const m = () => {
166
+ const l = i.filter((u) => !this.completedAnimations.has(u));
167
+ if (l.every(
168
+ (u) => this.updatedProperties.has(u)
169
+ ) && l.length > 0) {
71
170
  if (typeof this.velocity == "object" && this.velocity) {
72
- const c = performance.now();
73
- Object.keys(i).forEach((s) => {
74
- if (f[s]) {
75
- const u = (c - f[s]) / 1e3, d = this.currentValue[s], r = i[s];
76
- typeof d == "number" && typeof r == "number" && u > 0 && (this.velocity[s] = (r - d) / u / 1e3);
171
+ const u = performance.now();
172
+ Object.keys(r).forEach((a) => {
173
+ if (o[a]) {
174
+ const p = (u - o[a]) / 1e3, c = this.currentValue[a], S = r[a];
175
+ typeof c == "number" && typeof S == "number" && p > 0 && (this.velocity[a] = (S - c) / p / 1e3);
77
176
  }
78
- f[s] = c;
177
+ o[a] = u;
79
178
  });
80
179
  }
81
- this.currentValue = { ...i }, this.options.onUpdate(this.currentValue), this.updatedProperties.clear(), !l && this.options.onStart && (l = !0, this.options.onStart());
180
+ this.currentValue = { ...r }, this.options.onUpdate(this.currentValue), this.updatedProperties.clear(), !s && this.options.onStart && (s = !0, this.options.onStart());
82
181
  }
83
182
  };
84
- e.forEach((a) => {
85
- this.activeAnimations.add(a);
86
- const p = {
87
- from: n[a],
88
- to: t[a],
183
+ i.forEach((l) => {
184
+ this.activeAnimations.add(l);
185
+ const h = {
186
+ from: e[l],
187
+ to: t[l],
89
188
  stiffness: this.options.spring.stiffness,
90
189
  damping: this.options.spring.damping,
91
190
  mass: 1
92
191
  };
93
- typeof this.velocity == "object" && this.velocity && a in this.velocity && (p.velocity = this.velocity[a] * 1e3);
94
- const c = T({
95
- ...p,
96
- onUpdate: (s) => {
97
- i[a] = s, this.updatedProperties.add(a), h();
192
+ typeof this.velocity == "object" && this.velocity && l in this.velocity && (h.velocity = this.velocity[l] * 1e3);
193
+ const u = k({
194
+ ...h,
195
+ onUpdate: (a) => {
196
+ r[l] = a, this.updatedProperties.add(l), m();
98
197
  },
99
198
  onComplete: () => {
100
- this.completedAnimations.add(a), this.updatedProperties.delete(a), this.completedAnimations.size === e.length && (this.currentValue = t, this.isAnimating = !1, this.animationMap = null, typeof this.velocity == "object" && this.velocity && Object.keys(this.velocity).forEach((s) => {
101
- this.velocity[s] = 0;
199
+ this.completedAnimations.add(l), this.updatedProperties.delete(l), this.completedAnimations.size === i.length && (this.currentValue = t, this.isAnimating = !1, this.animationMap = null, typeof this.velocity == "object" && this.velocity && Object.keys(this.velocity).forEach((a) => {
200
+ this.velocity[a] = 0;
102
201
  }), this.options.onComplete());
103
202
  }
104
203
  });
105
- this.animationMap.set(a, c);
204
+ this.animationMap.set(l, u);
106
205
  });
107
206
  });
108
207
  if (this.options = {
@@ -115,10 +214,10 @@ class A {
115
214
  }),
116
215
  onStart: t.onStart
117
216
  }, this.currentValue = this.options.from, typeof this.options.from == "object" && this.options.from !== null) {
118
- const n = {};
119
- Object.keys(this.options.from).forEach((e) => {
120
- n[e] = 0;
121
- }), this.velocity = n;
217
+ const e = {};
218
+ Object.keys(this.options.from).forEach((i) => {
219
+ e[i] = 0;
220
+ }), this.velocity = e;
122
221
  } else
123
222
  this.velocity = 0;
124
223
  }
@@ -132,8 +231,8 @@ class A {
132
231
  reverse() {
133
232
  const t = this.options.from;
134
233
  if (this.options.from = this.options.to, this.options.to = t, this.isAnimating) {
135
- const n = this.shouldReverse();
136
- this.stop(), this.animate(!n);
234
+ const e = this.shouldReverse();
235
+ this.stop(), this.animate(!e);
137
236
  }
138
237
  }
139
238
  shouldReverse() {
@@ -156,6 +255,7 @@ class A {
156
255
  }
157
256
  getCurrentState() {
158
257
  return {
258
+ type: "single",
159
259
  position: this.currentValue,
160
260
  velocity: this.velocity,
161
261
  from: this.options.from,
@@ -172,37 +272,275 @@ class A {
172
272
  // Configuration
173
273
  updateOptions(t) {
174
274
  if (this.options = { ...this.options, ...t }, this.isAnimating && this.controls) {
175
- const n = this.shouldReverse();
176
- this.stop(), this.animate(!n);
275
+ const e = this.shouldReverse();
276
+ this.stop(), this.animate(!e);
177
277
  }
178
278
  }
179
279
  // Static factory method
180
- static fromState(t, n) {
181
- const e = new A(n);
182
- return e.setValue(t.position), e.setVelocity(t.velocity), e;
280
+ static fromState(t, e) {
281
+ const i = new O(e);
282
+ return i.setValue(t.position), i.setVelocity(t.velocity), i;
283
+ }
284
+ }
285
+ class j {
286
+ constructor(t) {
287
+ d(this, "config");
288
+ d(this, "animators", /* @__PURE__ */ new Map());
289
+ d(this, "springOrder", []);
290
+ d(this, "completedCount", 0);
291
+ d(this, "completedAnimators", /* @__PURE__ */ new Set());
292
+ d(this, "direction", "forward");
293
+ d(this, "idCounter", 0);
294
+ d(this, "timeoutIds", []);
295
+ this.config = t, this.initializeAnimators();
296
+ }
297
+ generateId() {
298
+ return `spring_${this.idCounter++}`;
299
+ }
300
+ initializeAnimators() {
301
+ this.config.springs.forEach((t) => {
302
+ const e = this.generateId(), i = new O({
303
+ from: t.from,
304
+ to: t.to,
305
+ spring: t.spring,
306
+ onUpdate: t.tick,
307
+ onComplete: () => this.onAnimatorComplete(e),
308
+ onStart: t.onStart
309
+ });
310
+ this.animators.set(e, {
311
+ id: e,
312
+ item: t,
313
+ animator: i,
314
+ startTime: null
315
+ }), this.springOrder.push(e);
316
+ });
317
+ }
318
+ /**
319
+ * Normalize schedule configuration to unified internal representation
320
+ * Uses discriminated union and early return pattern
321
+ *
322
+ * @param direction - "forward" or "backward" direction
323
+ */
324
+ normalizeSchedule(t) {
325
+ const e = this.config.schedule ?? "overlap";
326
+ return this.springOrder.map((i, r) => {
327
+ const o = this.animators.get(i);
328
+ if (!o)
329
+ throw new Error(
330
+ `AnimationScheduler: animator with id "${i}" not found during normalization`
331
+ );
332
+ if (e === "overlap")
333
+ return {
334
+ type: "offset",
335
+ id: i,
336
+ delay: 0
337
+ };
338
+ if (e === "wait")
339
+ return t === "forward" && r === 0 ? {
340
+ type: "offset",
341
+ id: i,
342
+ delay: 0
343
+ } : t === "backward" && r === this.springOrder.length - 1 ? {
344
+ type: "offset",
345
+ id: i,
346
+ delay: 0
347
+ } : {
348
+ type: "wait",
349
+ id: i
350
+ };
351
+ const s = o.item.offset ?? 0;
352
+ if (t === "forward")
353
+ return {
354
+ type: "offset",
355
+ id: i,
356
+ delay: s
357
+ };
358
+ const m = this.animators.size === 0 ? 0 : Math.max(
359
+ ...Array.from(this.animators.values()).map(
360
+ (l) => l.item.offset ?? 0
361
+ )
362
+ );
363
+ return {
364
+ type: "offset",
365
+ id: i,
366
+ delay: m - s
367
+ };
368
+ });
369
+ }
370
+ onAnimatorComplete(t) {
371
+ var i, r, o, s, m, l;
372
+ const e = this.animators.get(t);
373
+ if (!e) {
374
+ console.warn(
375
+ `AnimationScheduler: animator with id "${t}" not found on completion`
376
+ );
377
+ return;
378
+ }
379
+ this.completedAnimators.has(t) || (this.completedAnimators.add(t), this.completedCount++, (r = (i = e.item).onComplete) == null || r.call(i), (s = (o = this.config).onProgress) == null || s.call(o, this.completedCount, this.config.springs.length), this.handleWaitModeChaining(t), this.completedCount === this.config.springs.length && ((l = (m = this.config).onEnd) == null || l.call(m)));
380
+ }
381
+ /**
382
+ * Handle wait mode chaining: start next/previous spring after completion
383
+ */
384
+ handleWaitModeChaining(t) {
385
+ if (this.config.schedule !== "wait")
386
+ return;
387
+ const e = this.springOrder.indexOf(t);
388
+ if (this.direction === "forward") {
389
+ const o = this.springOrder[e + 1];
390
+ if (!o)
391
+ return;
392
+ const s = this.animators.get(o);
393
+ s && s.startTime === null && this.startAnimator(o);
394
+ return;
395
+ }
396
+ const i = this.springOrder[e - 1];
397
+ if (!i)
398
+ return;
399
+ const r = this.animators.get(i);
400
+ r && r.startTime === null && this.startBackwardAnimator(i);
401
+ }
402
+ startAnimator(t) {
403
+ const e = this.animators.get(t);
404
+ if (!e) {
405
+ console.warn(
406
+ `AnimationScheduler: animator with id "${t}" not found on start`
407
+ );
408
+ return;
409
+ }
410
+ if (e.startTime !== null) {
411
+ console.warn(
412
+ `AnimationScheduler: animator with id "${t}" already started`
413
+ );
414
+ return;
415
+ }
416
+ e.startTime = Date.now(), e.animator.forward();
417
+ }
418
+ startBackwardAnimator(t) {
419
+ const e = this.animators.get(t);
420
+ if (!e) {
421
+ console.warn(
422
+ `AnimationScheduler: animator with id "${t}" not found on backward start`
423
+ );
424
+ return;
425
+ }
426
+ if (e.startTime !== null) {
427
+ console.warn(
428
+ `AnimationScheduler: animator with id "${t}" already started`
429
+ );
430
+ return;
431
+ }
432
+ e.startTime = Date.now(), e.animator.backward();
433
+ }
434
+ forward() {
435
+ var e, i;
436
+ this.stop(), this.direction = "forward", this.completedCount = 0, this.completedAnimators.clear(), (i = (e = this.config).onStart) == null || i.call(e), this.normalizeSchedule("forward").forEach((r) => {
437
+ if (r.type === "wait")
438
+ return;
439
+ if (r.delay === 0) {
440
+ this.startAnimator(r.id);
441
+ return;
442
+ }
443
+ const o = window.setTimeout(
444
+ () => this.startAnimator(r.id),
445
+ r.delay
446
+ );
447
+ this.timeoutIds.push(o);
448
+ });
449
+ }
450
+ backward() {
451
+ var e, i;
452
+ this.stop(), this.direction = "backward", this.completedCount = 0, this.completedAnimators.clear(), (i = (e = this.config).onStart) == null || i.call(e), this.normalizeSchedule("backward").forEach((r) => {
453
+ if (r.type === "wait")
454
+ return;
455
+ if (r.delay === 0) {
456
+ this.startBackwardAnimator(r.id);
457
+ return;
458
+ }
459
+ const o = window.setTimeout(
460
+ () => this.startBackwardAnimator(r.id),
461
+ r.delay
462
+ );
463
+ this.timeoutIds.push(o);
464
+ });
465
+ }
466
+ stop() {
467
+ this.timeoutIds.forEach((t) => clearTimeout(t)), this.timeoutIds = [], this.animators.forEach((t) => {
468
+ t.animator.stop(), t.startTime = null;
469
+ });
470
+ }
471
+ reverse(t) {
472
+ ((t == null ? void 0 : t.offsetMode) ?? "immediate") !== "immediate" && console.warn(
473
+ 'AnimationScheduler.reverse(): Only "immediate" offsetMode is currently supported. Falling back to "immediate".'
474
+ ), this.direction = this.direction === "forward" ? "backward" : "forward", this.animators.forEach((i) => {
475
+ if (i.startTime === null)
476
+ return;
477
+ const r = i.animator.getCurrentState();
478
+ if (r.type !== "single")
479
+ return;
480
+ if (r.position === r.to) {
481
+ const s = O.fromState(
482
+ {
483
+ position: 1,
484
+ velocity: 0
485
+ },
486
+ {
487
+ from: i.item.to ?? 1,
488
+ to: i.item.from ?? 0,
489
+ spring: i.item.spring,
490
+ onUpdate: i.item.tick,
491
+ onComplete: () => this.onAnimatorComplete(i.id),
492
+ onStart: i.item.onStart
493
+ }
494
+ );
495
+ s.forward(), i.animator = s;
496
+ return;
497
+ }
498
+ i.animator.reverse();
499
+ });
500
+ }
501
+ getCurrentState() {
502
+ return {
503
+ type: "multi",
504
+ completed: this.completedCount,
505
+ total: this.config.springs.length,
506
+ direction: this.direction
507
+ };
183
508
  }
184
509
  }
185
- const O = Symbol.for("TRANSITION_STRATEGY"), _ = (o) => ({
510
+ const L = Symbol.for("TRANSITION_STRATEGY"), N = (n) => ({
186
511
  runIn: async (t) => {
187
- const { currentAnimation: n } = o;
188
- if (n && n.direction === "out") {
189
- const l = n.animator.getCurrentState();
190
- if (n.animator.stop(), t.out) {
191
- const h = await t.out, { from: a = 1, to: p = 0 } = h;
512
+ const { currentAnimation: e } = n;
513
+ if (e && e.direction === "out") {
514
+ const s = e.controller.getCurrentState();
515
+ if (e.controller.stop(), s.type === "multi")
516
+ return e.controller.reverse(), {
517
+ state: {
518
+ position: 0,
519
+ velocity: 0
520
+ },
521
+ from: 0,
522
+ to: 1,
523
+ direction: "forward"
524
+ };
525
+ if (t.out) {
526
+ const m = await t.out, { from: l = 1, to: h = 0 } = m;
192
527
  return {
193
- config: h,
194
- state: l,
195
- from: a,
528
+ config: m,
529
+ state: {
530
+ position: s.position,
531
+ velocity: s.velocity
532
+ },
533
+ from: l,
196
534
  // OUT animation's from
197
- to: p,
535
+ to: h,
198
536
  // OUT animation's to
199
537
  direction: "backward"
200
538
  // Will actually go 0→1
201
539
  };
202
540
  }
203
541
  }
204
- const e = await t.in;
205
- if (!e)
542
+ const i = await t.in;
543
+ if (!i)
206
544
  return {
207
545
  state: {
208
546
  position: 0,
@@ -212,42 +550,74 @@ const O = Symbol.for("TRANSITION_STRATEGY"), _ = (o) => ({
212
550
  to: 1,
213
551
  direction: "forward"
214
552
  };
215
- const { from: i = 0, to: f = 1 } = e;
553
+ if ("springs" in i)
554
+ return {
555
+ config: i,
556
+ state: {
557
+ position: 0,
558
+ velocity: 0
559
+ },
560
+ from: 0,
561
+ to: 1,
562
+ direction: "forward"
563
+ };
564
+ const { from: r = 0, to: o = 1 } = i;
216
565
  return {
217
- config: e,
566
+ config: i,
218
567
  state: {
219
- position: i,
568
+ position: r,
220
569
  velocity: 0
221
570
  },
222
- from: i,
223
- to: f,
571
+ from: r,
572
+ to: o,
224
573
  direction: "forward"
225
574
  };
226
575
  },
227
576
  runOut: async (t) => {
228
- const { currentAnimation: n } = o;
229
- if (n && n.direction === "in") {
230
- const l = n.animator.getCurrentState();
231
- if (n.animator.stop(), t.in) {
232
- const h = await t.in, { from: a = 0, to: p = 1 } = h;
577
+ const { currentAnimation: e } = n;
578
+ if (e && e.direction === "in") {
579
+ const s = e.controller.getCurrentState();
580
+ if (e.controller.stop(), s.type === "multi")
581
+ return e.controller.reverse(), {
582
+ state: {
583
+ position: 1,
584
+ velocity: 0
585
+ },
586
+ from: 1,
587
+ to: 0,
588
+ direction: "forward"
589
+ };
590
+ if (t.in) {
591
+ const m = await t.in, { from: l = 0, to: h = 1 } = m;
233
592
  return {
234
- config: h,
593
+ config: m,
235
594
  state: {
236
- position: l.position,
237
- velocity: l.velocity
595
+ position: s.position,
596
+ velocity: s.velocity
238
597
  },
239
- from: a,
598
+ from: l,
240
599
  // IN animation's from
241
- to: p,
600
+ to: h,
242
601
  // IN animation's to
243
602
  direction: "backward"
244
603
  // Will actually go 1→0
245
604
  };
246
605
  }
247
606
  }
248
- const e = await t.out;
249
- if (!e)
607
+ const i = await t.out;
608
+ if (!i)
609
+ return {
610
+ state: {
611
+ position: 1,
612
+ velocity: 0
613
+ },
614
+ from: 1,
615
+ to: 0,
616
+ direction: "forward"
617
+ };
618
+ if ("springs" in i)
250
619
  return {
620
+ config: i,
251
621
  state: {
252
622
  position: 1,
253
623
  velocity: 0
@@ -256,21 +626,21 @@ const O = Symbol.for("TRANSITION_STRATEGY"), _ = (o) => ({
256
626
  to: 0,
257
627
  direction: "forward"
258
628
  };
259
- const { from: i = 1, to: f = 0 } = e;
629
+ const { from: r = 1, to: o = 0 } = i;
260
630
  return {
261
- config: e,
631
+ config: i,
262
632
  state: {
263
- position: i,
633
+ position: r,
264
634
  velocity: 0
265
635
  },
266
- from: i,
267
- to: f,
636
+ from: r,
637
+ to: o,
268
638
  direction: "forward"
269
639
  };
270
640
  }
271
- }), I = () => ({
272
- runIn: async (o) => {
273
- const t = await o.in;
641
+ }), H = () => ({
642
+ runIn: async (n) => {
643
+ const t = await n.in;
274
644
  if (!t)
275
645
  return {
276
646
  state: {
@@ -281,20 +651,31 @@ const O = Symbol.for("TRANSITION_STRATEGY"), _ = (o) => ({
281
651
  to: 1,
282
652
  direction: "forward"
283
653
  };
284
- const { from: n = 0, to: e = 1 } = t;
654
+ if ("springs" in t)
655
+ return {
656
+ config: t,
657
+ state: {
658
+ position: 0,
659
+ velocity: 0
660
+ },
661
+ from: 0,
662
+ to: 1,
663
+ direction: "forward"
664
+ };
665
+ const { from: e = 0, to: i = 1 } = t;
285
666
  return {
286
667
  config: t,
287
668
  state: {
288
- position: n,
669
+ position: e,
289
670
  velocity: 0
290
671
  },
291
- from: n,
292
- to: e,
672
+ from: e,
673
+ to: i,
293
674
  direction: "forward"
294
675
  };
295
676
  },
296
- runOut: async (o) => {
297
- const t = await o.out;
677
+ runOut: async (n) => {
678
+ const t = await n.out;
298
679
  if (!t)
299
680
  return {
300
681
  state: {
@@ -305,284 +686,384 @@ const O = Symbol.for("TRANSITION_STRATEGY"), _ = (o) => ({
305
686
  to: 0,
306
687
  direction: "forward"
307
688
  };
308
- const { from: n = 1, to: e = 0 } = t;
689
+ if ("springs" in t)
690
+ return {
691
+ config: t,
692
+ state: {
693
+ position: 1,
694
+ velocity: 0
695
+ },
696
+ from: 1,
697
+ to: 0,
698
+ direction: "forward"
699
+ };
700
+ const { from: e = 1, to: i = 0 } = t;
309
701
  return {
310
702
  config: t,
311
703
  state: {
312
- position: n,
704
+ position: e,
313
705
  velocity: 0
314
706
  },
315
- from: n,
316
- to: e,
707
+ from: e,
708
+ to: i,
317
709
  direction: "forward"
318
710
  };
319
711
  }
320
712
  });
321
- function N(o, t) {
322
- var c;
323
- let n = null, e = null, i = null, f = null;
324
- const l = {
713
+ function W(n, t) {
714
+ var u;
715
+ let e = null, i = null, r = null, o = null;
716
+ const s = {
325
717
  get currentAnimation() {
326
- return n;
718
+ return e;
327
719
  }
328
- }, h = ((c = t == null ? void 0 : t.strategy) == null ? void 0 : c.call(t, l)) || _(l), a = async (s) => {
329
- var y, v;
330
- e && (e.remove(), e = null);
331
- const u = o(), d = {
332
- in: u.in && Promise.resolve(u.in(s)),
333
- out: u.out && Promise.resolve(u.out(s))
334
- }, r = await h.runIn(d);
335
- if (!r.config)
720
+ }, m = ((u = t == null ? void 0 : t.strategy) == null ? void 0 : u.call(t, s)) || N(s), l = async (a) => {
721
+ var v, A, C;
722
+ i && (i.remove(), i = null);
723
+ const p = n(), c = p.in && await p.in(a), S = !(t != null && t.strategy) && p.out ? await p.out(a) : void 0;
724
+ if (!c)
336
725
  return;
337
- (v = (y = r.config).prepare) == null || v.call(y, s), r.config.wait && await r.config.wait();
338
- const m = A.fromState(r.state, {
339
- from: r.from,
340
- to: r.to,
341
- spring: r.config.spring,
342
- onStart: r.config.onStart,
343
- onUpdate: r.config.tick,
726
+ if (R(c)) {
727
+ const y = {
728
+ in: Promise.resolve(c),
729
+ out: S && Promise.resolve(S)
730
+ };
731
+ if (!(await m.runIn(y)).config) {
732
+ e && (e.direction = "in");
733
+ return;
734
+ }
735
+ (v = c.prepare) == null || v.call(c, a), c.wait && await c.wait();
736
+ const E = new j({
737
+ ...c,
738
+ onEnd: () => {
739
+ var T;
740
+ e = null, (T = c.onEnd) == null || T.call(c);
741
+ }
742
+ });
743
+ e = {
744
+ controller: E,
745
+ direction: "in"
746
+ }, E.forward();
747
+ return;
748
+ }
749
+ const w = {
750
+ in: Promise.resolve(c),
751
+ out: S && Promise.resolve(S)
752
+ }, f = await m.runIn(w);
753
+ if (!f.config)
754
+ return;
755
+ if ("springs" in f.config) {
756
+ console.error("Unexpected MultiSpringConfig in single-spring path");
757
+ return;
758
+ }
759
+ (C = (A = f.config).prepare) == null || C.call(A, a), f.config.wait && await f.config.wait();
760
+ const g = O.fromState(f.state, {
761
+ from: f.from,
762
+ to: f.to,
763
+ spring: f.config.spring,
764
+ onStart: f.config.onStart,
765
+ onUpdate: f.config.tick,
344
766
  onComplete: () => {
345
- var w, S;
346
- n = null, (S = (w = r.config) == null ? void 0 : w.onEnd) == null || S.call(w);
767
+ var y, b;
768
+ e = null, (b = (y = f.config) == null ? void 0 : y.onEnd) == null || b.call(y);
347
769
  }
348
770
  });
349
- n = { animator: m, direction: "in" }, r.direction === "forward" ? m.forward() : m.backward();
350
- }, p = async (s) => {
351
- var v, w;
352
- e = s;
353
- const u = o(), d = {
354
- in: u.in && Promise.resolve(u.in(s)),
355
- out: u.out && Promise.resolve(u.out(s))
356
- }, r = await h.runOut(d);
357
- if (!r.config)
771
+ e = { controller: g, direction: "in" }, f.direction === "forward" ? g.forward() : g.backward();
772
+ }, h = async (a) => {
773
+ var v, A, C;
774
+ i = a;
775
+ const p = n(), c = p.out && await p.out(a);
776
+ if (!c)
358
777
  return;
359
- (w = (v = r.config).prepare) == null || w.call(v, s), y(), r.config.wait && await r.config.wait();
360
- const m = A.fromState(r.state, {
361
- from: r.from,
362
- to: r.to,
363
- spring: r.config.spring,
364
- onStart: r.config.onStart,
365
- onUpdate: r.config.tick,
778
+ if (R(c)) {
779
+ const y = {
780
+ in: void 0,
781
+ // Don't fetch IN config for exit transitions
782
+ out: Promise.resolve(c)
783
+ };
784
+ if (!(await m.runOut(y)).config) {
785
+ e && (e.direction = "out"), i && (i.remove(), i = null);
786
+ return;
787
+ }
788
+ (v = c.prepare) == null || v.call(c, a), g(), c.wait && await c.wait();
789
+ const E = new j({
790
+ ...c,
791
+ onEnd: () => {
792
+ var T, x;
793
+ (T = c.onEnd) == null || T.call(c), i && (i.remove(), i = null), e = null, (x = t == null ? void 0 : t.onCleanupEnd) == null || x.call(t);
794
+ }
795
+ });
796
+ e = {
797
+ controller: E,
798
+ direction: "out"
799
+ }, E.forward();
800
+ return;
801
+ }
802
+ const S = {
803
+ in: void 0,
804
+ // Don't fetch IN config for exit transitions
805
+ out: Promise.resolve(c)
806
+ }, w = await m.runOut(S);
807
+ if (!w.config)
808
+ return;
809
+ if ("springs" in w.config) {
810
+ console.error("Unexpected MultiSpringConfig in single-spring path");
811
+ return;
812
+ }
813
+ (C = (A = w.config).prepare) == null || C.call(A, a), g(), w.config.wait && await w.config.wait();
814
+ const f = O.fromState(w.state, {
815
+ from: w.from,
816
+ to: w.to,
817
+ spring: w.config.spring,
818
+ onStart: w.config.onStart,
819
+ onUpdate: w.config.tick,
366
820
  onComplete: () => {
367
- var S, C, b;
368
- (C = (S = r.config) == null ? void 0 : S.onEnd) == null || C.call(S), e && (e.remove(), e = null), n = null, (b = t == null ? void 0 : t.onCleanupEnd) == null || b.call(t);
821
+ var y, b, E;
822
+ (b = (y = w.config) == null ? void 0 : y.onEnd) == null || b.call(y), i && (i.remove(), i = null), e = null, (E = t == null ? void 0 : t.onCleanupEnd) == null || E.call(t);
369
823
  }
370
824
  });
371
- n = { animator: m, direction: "out" }, r.direction === "forward" ? m.forward() : m.backward();
372
- function y() {
373
- !i || !e || (f && i.contains(f) ? i.insertBefore(e, f) : i.appendChild(e));
825
+ e = { controller: f, direction: "out" }, w.direction === "forward" ? f.forward() : f.backward();
826
+ function g() {
827
+ !r || !i || (o && r.contains(o) ? r.insertBefore(i, o) : r.appendChild(i));
374
828
  }
375
829
  };
376
- return (s) => {
377
- if (s)
378
- return i = s.parentElement, f = s.nextElementSibling, a(s), () => {
379
- const u = s.cloneNode(!0);
380
- p(u);
830
+ return (a) => {
831
+ if (a)
832
+ return r = a.parentElement, o = a.nextElementSibling, l(a), () => {
833
+ const p = a.cloneNode(!0);
834
+ h(p);
381
835
  };
382
836
  };
383
837
  }
384
- const D = 3, z = (o) => {
385
- if (!o) return null;
386
- const t = o.split(`
387
- `).map((n) => n.trim());
388
- for (let n = D; n < Math.min(t.length, 6); n++) {
389
- const e = t[n], i = e == null ? void 0 : e.match(/\(?([^):]+):(\d+):(\d+)\)?$/);
390
- if (!i)
838
+ const B = 3, K = (n) => {
839
+ if (!n) return null;
840
+ const t = n.split(`
841
+ `).map((e) => e.trim());
842
+ for (let e = B; e < Math.min(t.length, 6); e++) {
843
+ const i = t[e], r = i == null ? void 0 : i.match(/\(?([^):]+):(\d+):(\d+)\)?$/);
844
+ if (!r)
391
845
  continue;
392
- const f = i[1] ?? "", l = i[2] ?? "0", h = i[3] ?? "0";
393
- return { file: f.split(/[\\/]/).pop() || f, line: l, column: h };
846
+ const o = r[1] ?? "", s = r[2] ?? "0", m = r[3] ?? "0";
847
+ return { file: o.split(/[\\/]/).pop() || o, line: s, column: m };
394
848
  }
395
849
  return null;
396
- }, V = /* @__PURE__ */ new Map(), P = /* @__PURE__ */ new Map();
397
- function $(o, t, n) {
398
- V.set(o, t);
399
- let e = P.get(o);
400
- return e || (e = N(
850
+ }, V = /* @__PURE__ */ new Map(), M = /* @__PURE__ */ new Map();
851
+ function q(n, t, e) {
852
+ V.set(n, t);
853
+ let i = M.get(n);
854
+ return i || (i = W(
401
855
  () => {
402
- const i = V.get(o);
403
- return i || (console.warn(`Transition "${String(o)}" not found`), {});
856
+ const r = V.get(n);
857
+ return r || (console.warn(`Transition "${String(n)}" not found`), {});
404
858
  },
405
859
  {
406
- strategy: n,
407
- onCleanupEnd: () => j(o)
860
+ strategy: e,
861
+ onCleanupEnd: () => D(n)
408
862
  }
409
- ), P.set(o, e), e);
863
+ ), M.set(n, i), i);
410
864
  }
411
- function j(o) {
412
- V.delete(o), P.delete(o);
865
+ function D(n) {
866
+ V.delete(n), M.delete(n);
413
867
  }
414
- function F() {
415
- const o = z(new Error().stack);
416
- return o ? `auto_${o.file}_${o.line}_${o.column}` : Symbol(`ssgoi_auto_${Date.now()}`);
868
+ function Y() {
869
+ const n = K(new Error().stack);
870
+ return n ? `auto_${n.file}_${n.line}_${n.column}` : Symbol(`ssgoi_auto_${Date.now()}`);
417
871
  }
418
- const x = globalThis.FinalizationRegistry, R = x ? new x((o) => {
872
+ const U = globalThis.FinalizationRegistry, z = U ? new U((n) => {
419
873
  try {
420
- j(o);
874
+ D(n);
421
875
  } catch {
422
876
  }
423
877
  }) : void 0;
424
- function X(o) {
425
- const t = o.key ?? F();
426
- if (o.ref && R)
878
+ function nt(n) {
879
+ const t = n.key ?? Y();
880
+ if (n.ref && z)
427
881
  try {
428
- R.register(o.ref, t);
882
+ z.register(n.ref, t);
429
883
  } catch {
430
884
  }
431
- return $(
885
+ return q(
432
886
  t,
433
887
  {
434
- in: o.in,
435
- out: o.out
888
+ in: n.in,
889
+ out: n.out
436
890
  },
437
- o[O]
891
+ n[L]
438
892
  );
439
893
  }
440
- const K = (o) => {
441
- let t = o.parentElement;
894
+ const X = (n) => {
895
+ let t = n.parentElement;
442
896
  for (; t && t !== document.body; ) {
443
- const n = window.getComputedStyle(t), e = n.overflow + n.overflowY + n.overflowX;
444
- if (e.includes("auto") || e.includes("scroll") || t.scrollHeight > t.clientHeight || t.scrollWidth > t.clientWidth)
897
+ const e = window.getComputedStyle(t), i = e.overflow + e.overflowY + e.overflowX;
898
+ if (i.includes("auto") || i.includes("scroll") || t.scrollHeight > t.clientHeight || t.scrollWidth > t.clientWidth)
445
899
  return t;
446
900
  t = t.parentElement;
447
901
  }
448
902
  return document.documentElement;
449
- }, W = (o) => {
450
- let t = o.parentElement;
903
+ }, G = (n) => {
904
+ let t = n.parentElement;
451
905
  for (; t && t !== document.body; ) {
452
- const n = window.getComputedStyle(t).position;
453
- if (n === "relative" || n === "absolute" || n === "fixed" || n === "sticky")
906
+ const e = window.getComputedStyle(t).position;
907
+ if (e === "relative" || e === "absolute" || e === "fixed" || e === "sticky")
454
908
  return t;
455
909
  t = t.parentElement;
456
910
  }
457
911
  return document.body;
458
912
  };
459
- function k(o) {
460
- const t = o.filter((n) => n.symmetric).map((n) => ({
461
- from: n.to,
462
- to: n.from,
463
- transition: n.transition
913
+ function J(n) {
914
+ const t = n.filter((e) => e.symmetric).map((e) => ({
915
+ from: e.to,
916
+ to: e.from,
917
+ transition: e.transition
464
918
  }));
465
- return [...o, ...t];
919
+ return [...n, ...t];
466
920
  }
467
- function L() {
468
- let o = null, t = null;
469
- const n = /* @__PURE__ */ new Map();
470
- let e = null;
471
- const i = () => {
472
- o && e && n.set(e, {
473
- x: o.scrollLeft,
474
- y: o.scrollTop
921
+ function Q(n) {
922
+ let t = !1, e = !1;
923
+ const i = (l) => {
924
+ if (!n) return;
925
+ const h = l.touches[0];
926
+ h && (e = h.clientX < 50);
927
+ }, r = () => {
928
+ n && (e && (t = !0, setTimeout(() => {
929
+ t = !1;
930
+ }, 500)), e = !1);
931
+ };
932
+ return {
933
+ initialize: () => {
934
+ typeof window > "u" || n && (window.addEventListener("touchstart", i, { passive: !0 }), window.addEventListener("touchend", r, { passive: !0 }));
935
+ },
936
+ cleanup: () => {
937
+ typeof window > "u" || (window.removeEventListener("touchstart", i), window.removeEventListener("touchend", r));
938
+ },
939
+ isSwipePending: () => t
940
+ };
941
+ }
942
+ function Z() {
943
+ let n = null, t = null;
944
+ const e = /* @__PURE__ */ new Map();
945
+ let i = null;
946
+ const r = () => {
947
+ n && i && e.set(i, {
948
+ x: n.scrollLeft,
949
+ y: n.scrollTop
475
950
  });
476
951
  };
477
952
  return {
478
- initializeContext: (c, s) => {
479
- t = c, o || (o = K(c), (o === document.documentElement ? window : o).addEventListener("scroll", i, {
953
+ initializeContext: (u, a) => {
954
+ t = u, n || (n = X(u), (n === document.documentElement ? window : n).addEventListener("scroll", r, {
480
955
  passive: !0
481
- })), e = s;
956
+ })), i = a;
482
957
  },
483
- calculateScrollOffset: (c, s) => {
484
- const u = c && n.has(c) ? n.get(c) : { x: 0, y: 0 }, d = s && n.has(s) ? n.get(s) : { x: 0, y: 0 };
958
+ calculateScrollOffset: (u, a) => {
959
+ const p = u && e.has(u) ? e.get(u) : { x: 0, y: 0 }, c = a && e.has(a) ? e.get(a) : { x: 0, y: 0 };
485
960
  return {
486
- x: -d.x + u.x,
487
- y: -d.y + u.y
961
+ x: -c.x + p.x,
962
+ y: -c.y + p.y
488
963
  };
489
964
  },
490
- getScrollContainer: () => o,
491
- getPositionedParentElement: () => t ? W(t) : document.body,
492
- getScrollPosition: (c) => c && n.has(c) ? n.get(c) : { x: 0, y: 0 }
965
+ getScrollContainer: () => n,
966
+ getPositionedParentElement: () => t ? G(t) : document.body,
967
+ getScrollPosition: (u) => u && e.has(u) ? e.get(u) : { x: 0, y: 0 }
493
968
  };
494
969
  }
495
- function B(o) {
970
+ function ot(n) {
496
971
  const {
497
972
  transitions: t = [],
498
- defaultTransition: n,
499
- middleware: e = (r, m) => ({ from: r, to: m })
973
+ defaultTransition: e,
974
+ middleware: i = (f, g) => ({ from: f, to: g }),
500
975
  // Identity function as default
501
- } = o;
502
- let i = null;
503
- const f = k(t), {
504
- initializeContext: l,
505
- calculateScrollOffset: h,
506
- getScrollContainer: a,
507
- getPositionedParentElement: p,
508
- getScrollPosition: c
509
- } = L();
510
- function s() {
511
- if (i != null && i.from && (i != null && i.to)) {
512
- const { from: r, to: m } = e(
513
- i.from,
514
- i.to
515
- ), v = Y(
516
- r,
517
- m,
518
- f
519
- ) || n, w = h(
520
- i.from,
521
- i.to
522
- ), S = {
523
- scrollOffset: w,
524
- scroll: c(i.from),
976
+ skipOnIosSwipe: r = !1
977
+ // Default to true - skip animations on iOS swipe
978
+ } = n;
979
+ let o = null;
980
+ const s = J(t), {
981
+ initializeContext: m,
982
+ calculateScrollOffset: l,
983
+ getScrollContainer: h,
984
+ getPositionedParentElement: u,
985
+ getScrollPosition: a
986
+ } = Z(), p = Q(r);
987
+ p.initialize();
988
+ function c() {
989
+ if (o != null && o.from && (o != null && o.to)) {
990
+ const { from: f, to: g } = i(
991
+ o.from,
992
+ o.to
993
+ ), A = tt(
994
+ f,
995
+ g,
996
+ s
997
+ ) || e, C = l(
998
+ o.from,
999
+ o.to
1000
+ ), y = {
1001
+ scrollOffset: C,
1002
+ scroll: a(o.from),
525
1003
  get scrollingElement() {
526
- return a() || document.documentElement;
1004
+ return h() || document.documentElement;
527
1005
  },
528
1006
  get positionedParent() {
529
- return p();
1007
+ return u();
530
1008
  }
531
- }, C = {
532
- scrollOffset: w,
1009
+ }, b = {
1010
+ scrollOffset: C,
533
1011
  get scroll() {
534
- return i ? c(i.to) : { x: 0, y: 0 };
1012
+ return o ? a(o.to) : { x: 0, y: 0 };
535
1013
  },
536
1014
  get scrollingElement() {
537
- return a() || document.documentElement;
1015
+ return h() || document.documentElement;
538
1016
  },
539
1017
  get positionedParent() {
540
- return p();
1018
+ return u();
541
1019
  }
542
1020
  };
543
- v && (v.out && i.outResolve && i.outResolve(
544
- (b) => v.out(b, S)
545
- ), v.in && i.inResolve && i.inResolve(
546
- (b) => v.in(b, C)
547
- )), i = null;
1021
+ A && (A.out && o.outResolve && o.outResolve(
1022
+ (E) => A.out(E, y)
1023
+ ), A.in && o.inResolve && o.inResolve(
1024
+ (E) => A.in(E, b)
1025
+ )), o = null;
548
1026
  }
549
1027
  }
550
- const u = async (r, m) => m === "in" && (!i || !i.from) ? () => ({}) : (i || (i = {}), m === "out" ? (i.from = r, new Promise((y) => {
551
- i.outResolve = y, s();
552
- })) : (i.to = r, new Promise((y) => {
553
- i.inResolve = y, s();
1028
+ const S = async (f, g) => p.isSwipePending() ? () => ({}) : g === "in" && (!o || !o.from) ? () => ({}) : (o || (o = {}), g === "out" ? (o.from = f, new Promise((v) => {
1029
+ o.outResolve = v, c();
1030
+ })) : (o.to = f, new Promise((v) => {
1031
+ o.inResolve = v, c();
554
1032
  })));
555
- return (r) => ({
556
- key: r,
557
- in: async (m) => (l(m, r), (await u(r, "in"))(m)),
558
- out: async (m) => (await u(r, "out"))(m),
1033
+ return (f) => ({
1034
+ key: f,
1035
+ in: async (g) => (m(g, f), (await S(f, "in"))(g)),
1036
+ out: async (g) => (await S(f, "out"))(g),
559
1037
  // Add page transition strategy for page-level transitions
560
- [O]: I
1038
+ [L]: H
561
1039
  });
562
1040
  }
563
- function Y(o, t, n) {
564
- for (const e of n)
565
- if (E(o, e.from) && E(t, e.to))
566
- return e.transition;
567
- for (const e of n)
568
- if ((e.from === "*" || E(o, e.from)) && (e.to === "*" || E(t, e.to)))
569
- return e.transition;
1041
+ function tt(n, t, e) {
1042
+ for (const i of e)
1043
+ if (P(n, i.from) && P(t, i.to))
1044
+ return i.transition;
1045
+ for (const i of e)
1046
+ if ((i.from === "*" || P(n, i.from)) && (i.to === "*" || P(t, i.to)))
1047
+ return i.transition;
570
1048
  return null;
571
1049
  }
572
- function E(o, t) {
1050
+ function P(n, t) {
573
1051
  if (t === "*")
574
1052
  return !0;
575
1053
  if (t.endsWith("/*")) {
576
- const n = t.slice(0, -2);
577
- return o === n || o.startsWith(n + "/");
1054
+ const e = t.slice(0, -2);
1055
+ return n === e || n.startsWith(e + "/");
578
1056
  }
579
- return o === t;
1057
+ return n === t;
580
1058
  }
581
1059
  export {
582
- O as TRANSITION_STRATEGY,
583
- _ as createDefaultStrategy,
584
- I as createPageTransitionStrategy,
585
- B as createSggoiTransitionContext,
586
- F as generateAutoKey,
587
- X as transition
1060
+ L as TRANSITION_STRATEGY,
1061
+ N as createDefaultStrategy,
1062
+ H as createPageTransitionStrategy,
1063
+ ot as createSggoiTransitionContext,
1064
+ Y as generateAutoKey,
1065
+ R as isMultiSpring,
1066
+ at as isSingleSpring,
1067
+ lt as jaeminInternal,
1068
+ nt as transition
588
1069
  };