@ssgoi/core 2.3.1 → 2.5.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.
package/dist/index.js CHANGED
@@ -1,108 +1,109 @@
1
- var U = Object.defineProperty;
2
- var _ = (n, t, o) => t in n ? U(n, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : n[t] = o;
3
- var y = (n, t, o) => _(n, typeof t != "symbol" ? t + "" : t, o);
4
- import { animate as P } from "popmotion";
5
- class C {
1
+ var I = Object.defineProperty;
2
+ var _ = (e, t, n) => t in e ? I(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
+ var v = (e, t, n) => _(e, typeof t != "symbol" ? t + "" : t, n);
4
+ import { animate as x } from "popmotion";
5
+ import { j as nt } from "./jaemin-BAi8PTrj.js";
6
+ class A {
6
7
  constructor(t) {
7
- y(this, "options");
8
- y(this, "currentValue");
9
- y(this, "velocity");
10
- y(this, "isAnimating", !1);
11
- y(this, "controls", null);
8
+ v(this, "options");
9
+ v(this, "currentValue");
10
+ v(this, "velocity");
11
+ v(this, "isAnimating", !1);
12
+ v(this, "controls", null);
12
13
  // For object animations
13
- y(this, "animationMap", null);
14
- y(this, "activeAnimations", /* @__PURE__ */ new Set());
15
- y(this, "completedAnimations", /* @__PURE__ */ new Set());
16
- y(this, "updatedProperties", /* @__PURE__ */ new Set());
17
- y(this, "animate", (t = !1) => {
14
+ v(this, "animationMap", null);
15
+ v(this, "activeAnimations", /* @__PURE__ */ new Set());
16
+ v(this, "completedAnimations", /* @__PURE__ */ new Set());
17
+ v(this, "updatedProperties", /* @__PURE__ */ new Set());
18
+ v(this, "animate", (t = !1) => {
18
19
  !this.isAnimating && this.options.onStart && this.options.onStart(), this.isAnimating = !0;
19
- const o = t ? this.options.from : this.options.to;
20
+ const n = t ? this.options.from : this.options.to;
20
21
  if (typeof this.currentValue == "object" && this.currentValue !== null) {
21
- this.animateObject(o);
22
+ this.animateObject(n);
22
23
  return;
23
24
  }
24
- let i = this.currentValue, e = performance.now();
25
- const m = {
25
+ let o = this.currentValue, s = performance.now();
26
+ const i = {
26
27
  from: this.currentValue,
27
- to: o,
28
+ to: n,
28
29
  stiffness: this.options.spring.stiffness,
29
30
  damping: this.options.spring.damping,
30
31
  mass: 1
31
32
  };
32
- typeof this.velocity == "number" && (m.velocity = this.velocity * 1e3), this.controls = P({
33
- ...m,
34
- onUpdate: (l) => {
35
- const p = performance.now(), r = (p - e) / 1e3;
36
- if (r > 0) {
37
- if (typeof l == "number" && typeof i == "number") {
38
- const u = (l - i) / r;
39
- this.velocity = u / 1e3;
40
- } else if (typeof l == "object" && l !== null) {
41
- const u = {};
42
- Object.keys(l).forEach((f) => {
43
- const c = l[f], a = i[f];
44
- if (typeof c == "number" && typeof a == "number") {
45
- const h = (c - a) / r;
46
- u[f] = h / 1e3;
33
+ typeof this.velocity == "number" && (i.velocity = this.velocity * 1e3), this.controls = x({
34
+ ...i,
35
+ onUpdate: (u) => {
36
+ const d = performance.now(), a = (d - s) / 1e3;
37
+ if (a > 0) {
38
+ if (typeof u == "number" && typeof o == "number") {
39
+ const m = (u - o) / a;
40
+ this.velocity = m / 1e3;
41
+ } else if (typeof u == "object" && u !== null) {
42
+ const m = {};
43
+ Object.keys(u).forEach((l) => {
44
+ const r = u[l], f = o[l];
45
+ if (typeof r == "number" && typeof f == "number") {
46
+ const g = (r - f) / a;
47
+ m[l] = g / 1e3;
47
48
  }
48
- }), this.velocity = u;
49
+ }), this.velocity = m;
49
50
  }
50
- i = l, e = p;
51
+ o = u, s = d;
51
52
  }
52
- this.currentValue = l, this.options.onUpdate(l);
53
+ this.currentValue = u, this.options.onUpdate(u);
53
54
  },
54
55
  onComplete: () => {
55
- this.currentValue = o, this.isAnimating = !1, this.controls = null, typeof this.velocity == "object" && this.velocity !== null ? Object.keys(this.velocity).forEach((l) => {
56
- this.velocity[l] = 0;
56
+ this.currentValue = n, this.isAnimating = !1, this.controls = null, typeof this.velocity == "object" && this.velocity !== null ? Object.keys(this.velocity).forEach((u) => {
57
+ this.velocity[u] = 0;
57
58
  }) : this.velocity = 0, this.options.onComplete();
58
59
  }
59
60
  });
60
61
  });
61
- y(this, "animateObject", (t) => {
62
- const o = this.currentValue, i = Object.keys(o);
62
+ v(this, "animateObject", (t) => {
63
+ const n = this.currentValue, o = Object.keys(n);
63
64
  this.animationMap = /* @__PURE__ */ new Map(), this.activeAnimations.clear(), this.completedAnimations.clear(), this.updatedProperties.clear();
64
- const e = { ...o }, m = {};
65
- let l = !1;
66
- const p = () => {
67
- const r = i.filter((f) => !this.completedAnimations.has(f));
68
- if (r.every(
69
- (f) => this.updatedProperties.has(f)
70
- ) && r.length > 0) {
65
+ const s = { ...n }, i = {};
66
+ let u = !1;
67
+ const d = () => {
68
+ const a = o.filter((l) => !this.completedAnimations.has(l));
69
+ if (a.every(
70
+ (l) => this.updatedProperties.has(l)
71
+ ) && a.length > 0) {
71
72
  if (typeof this.velocity == "object" && this.velocity) {
72
- const f = performance.now();
73
- Object.keys(e).forEach((c) => {
74
- if (m[c]) {
75
- const a = (f - m[c]) / 1e3, h = this.currentValue[c], s = e[c];
76
- typeof h == "number" && typeof s == "number" && a > 0 && (this.velocity[c] = (s - h) / a / 1e3);
73
+ const l = performance.now();
74
+ Object.keys(s).forEach((r) => {
75
+ if (i[r]) {
76
+ const f = (l - i[r]) / 1e3, g = this.currentValue[r], c = s[r];
77
+ typeof g == "number" && typeof c == "number" && f > 0 && (this.velocity[r] = (c - g) / f / 1e3);
77
78
  }
78
- m[c] = f;
79
+ i[r] = l;
79
80
  });
80
81
  }
81
- this.currentValue = { ...e }, this.options.onUpdate(this.currentValue), this.updatedProperties.clear(), !l && this.options.onStart && (l = !0, this.options.onStart());
82
+ this.currentValue = { ...s }, this.options.onUpdate(this.currentValue), this.updatedProperties.clear(), !u && this.options.onStart && (u = !0, this.options.onStart());
82
83
  }
83
84
  };
84
- i.forEach((r) => {
85
- this.activeAnimations.add(r);
86
- const u = {
87
- from: o[r],
88
- to: t[r],
85
+ o.forEach((a) => {
86
+ this.activeAnimations.add(a);
87
+ const m = {
88
+ from: n[a],
89
+ to: t[a],
89
90
  stiffness: this.options.spring.stiffness,
90
91
  damping: this.options.spring.damping,
91
92
  mass: 1
92
93
  };
93
- typeof this.velocity == "object" && this.velocity && r in this.velocity && (u.velocity = this.velocity[r] * 1e3);
94
- const f = P({
95
- ...u,
96
- onUpdate: (c) => {
97
- e[r] = c, this.updatedProperties.add(r), p();
94
+ typeof this.velocity == "object" && this.velocity && a in this.velocity && (m.velocity = this.velocity[a] * 1e3);
95
+ const l = x({
96
+ ...m,
97
+ onUpdate: (r) => {
98
+ s[a] = r, this.updatedProperties.add(a), d();
98
99
  },
99
100
  onComplete: () => {
100
- this.completedAnimations.add(r), this.updatedProperties.delete(r), 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((c) => {
101
- this.velocity[c] = 0;
101
+ this.completedAnimations.add(a), this.updatedProperties.delete(a), this.completedAnimations.size === o.length && (this.currentValue = t, this.isAnimating = !1, this.animationMap = null, typeof this.velocity == "object" && this.velocity && Object.keys(this.velocity).forEach((r) => {
102
+ this.velocity[r] = 0;
102
103
  }), this.options.onComplete());
103
104
  }
104
105
  });
105
- this.animationMap.set(r, f);
106
+ this.animationMap.set(a, l);
106
107
  });
107
108
  });
108
109
  if (this.options = {
@@ -115,10 +116,10 @@ class C {
115
116
  }),
116
117
  onStart: t.onStart
117
118
  }, this.currentValue = this.options.from, typeof this.options.from == "object" && this.options.from !== null) {
118
- const o = {};
119
- Object.keys(this.options.from).forEach((i) => {
120
- o[i] = 0;
121
- }), this.velocity = o;
119
+ const n = {};
120
+ Object.keys(this.options.from).forEach((o) => {
121
+ n[o] = 0;
122
+ }), this.velocity = n;
122
123
  } else
123
124
  this.velocity = 0;
124
125
  }
@@ -132,8 +133,8 @@ class C {
132
133
  reverse() {
133
134
  const t = this.options.from;
134
135
  if (this.options.from = this.options.to, this.options.to = t, this.isAnimating) {
135
- const o = this.shouldReverse();
136
- this.stop(), this.animate(!o);
136
+ const n = this.shouldReverse();
137
+ this.stop(), this.animate(!n);
137
138
  }
138
139
  }
139
140
  shouldReverse() {
@@ -172,37 +173,37 @@ class C {
172
173
  // Configuration
173
174
  updateOptions(t) {
174
175
  if (this.options = { ...this.options, ...t }, this.isAnimating && this.controls) {
175
- const o = this.shouldReverse();
176
- this.stop(), this.animate(!o);
176
+ const n = this.shouldReverse();
177
+ this.stop(), this.animate(!n);
177
178
  }
178
179
  }
179
180
  // Static factory method
180
- static fromState(t, o) {
181
- const i = new C(o);
182
- return i.setValue(t.position), i.setVelocity(t.velocity), i;
181
+ static fromState(t, n) {
182
+ const o = new A(n);
183
+ return o.setValue(t.position), o.setVelocity(t.velocity), o;
183
184
  }
184
185
  }
185
- const x = Symbol.for("TRANSITION_STRATEGY"), I = (n) => ({
186
+ const j = Symbol.for("TRANSITION_STRATEGY"), D = (e) => ({
186
187
  runIn: async (t) => {
187
- const { currentAnimation: o } = n;
188
- if (o && o.direction === "out") {
189
- const l = o.animator.getCurrentState();
190
- if (o.animator.stop(), t.out) {
191
- const p = await t.out, { from: r = 1, to: u = 0 } = p;
188
+ const { currentAnimation: n } = e;
189
+ if (n && n.direction === "out") {
190
+ const u = n.animator.getCurrentState();
191
+ if (n.animator.stop(), t.out) {
192
+ const d = await t.out, { from: a = 1, to: m = 0 } = d;
192
193
  return {
193
- config: p,
194
- state: l,
195
- from: r,
194
+ config: d,
195
+ state: u,
196
+ from: a,
196
197
  // OUT animation's from
197
- to: u,
198
+ to: m,
198
199
  // OUT animation's to
199
200
  direction: "backward"
200
201
  // Will actually go 0→1
201
202
  };
202
203
  }
203
204
  }
204
- const i = await t.in;
205
- if (!i)
205
+ const o = await t.in;
206
+ if (!o)
206
207
  return {
207
208
  state: {
208
209
  position: 0,
@@ -212,41 +213,41 @@ const x = Symbol.for("TRANSITION_STRATEGY"), I = (n) => ({
212
213
  to: 1,
213
214
  direction: "forward"
214
215
  };
215
- const { from: e = 0, to: m = 1 } = i;
216
+ const { from: s = 0, to: i = 1 } = o;
216
217
  return {
217
- config: i,
218
+ config: o,
218
219
  state: {
219
- position: e,
220
+ position: s,
220
221
  velocity: 0
221
222
  },
222
- from: e,
223
- to: m,
223
+ from: s,
224
+ to: i,
224
225
  direction: "forward"
225
226
  };
226
227
  },
227
228
  runOut: async (t) => {
228
- const { currentAnimation: o } = n;
229
- if (o && o.direction === "in") {
230
- const l = o.animator.getCurrentState();
231
- if (o.animator.stop(), t.in) {
232
- const p = await t.in, { from: r = 0, to: u = 1 } = p;
229
+ const { currentAnimation: n } = e;
230
+ if (n && n.direction === "in") {
231
+ const u = n.animator.getCurrentState();
232
+ if (n.animator.stop(), t.in) {
233
+ const d = await t.in, { from: a = 0, to: m = 1 } = d;
233
234
  return {
234
- config: p,
235
+ config: d,
235
236
  state: {
236
- position: l.position,
237
- velocity: l.velocity
237
+ position: u.position,
238
+ velocity: u.velocity
238
239
  },
239
- from: r,
240
+ from: a,
240
241
  // IN animation's from
241
- to: u,
242
+ to: m,
242
243
  // IN animation's to
243
244
  direction: "backward"
244
245
  // Will actually go 1→0
245
246
  };
246
247
  }
247
248
  }
248
- const i = await t.out;
249
- if (!i)
249
+ const o = await t.out;
250
+ if (!o)
250
251
  return {
251
252
  state: {
252
253
  position: 1,
@@ -256,21 +257,21 @@ const x = Symbol.for("TRANSITION_STRATEGY"), I = (n) => ({
256
257
  to: 0,
257
258
  direction: "forward"
258
259
  };
259
- const { from: e = 1, to: m = 0 } = i;
260
+ const { from: s = 1, to: i = 0 } = o;
260
261
  return {
261
- config: i,
262
+ config: o,
262
263
  state: {
263
- position: e,
264
+ position: s,
264
265
  velocity: 0
265
266
  },
266
- from: e,
267
- to: m,
267
+ from: s,
268
+ to: i,
268
269
  direction: "forward"
269
270
  };
270
271
  }
271
- }), N = () => ({
272
- runIn: async (n) => {
273
- const t = await n.in;
272
+ }), z = () => ({
273
+ runIn: async (e) => {
274
+ const t = await e.in;
274
275
  if (!t)
275
276
  return {
276
277
  state: {
@@ -281,20 +282,20 @@ const x = Symbol.for("TRANSITION_STRATEGY"), I = (n) => ({
281
282
  to: 1,
282
283
  direction: "forward"
283
284
  };
284
- const { from: o = 0, to: i = 1 } = t;
285
+ const { from: n = 0, to: o = 1 } = t;
285
286
  return {
286
287
  config: t,
287
288
  state: {
288
- position: o,
289
+ position: n,
289
290
  velocity: 0
290
291
  },
291
- from: o,
292
- to: i,
292
+ from: n,
293
+ to: o,
293
294
  direction: "forward"
294
295
  };
295
296
  },
296
- runOut: async (n) => {
297
- const t = await n.out;
297
+ runOut: async (e) => {
298
+ const t = await e.out;
298
299
  if (!t)
299
300
  return {
300
301
  state: {
@@ -305,282 +306,309 @@ const x = Symbol.for("TRANSITION_STRATEGY"), I = (n) => ({
305
306
  to: 0,
306
307
  direction: "forward"
307
308
  };
308
- const { from: o = 1, to: i = 0 } = t;
309
+ const { from: n = 1, to: o = 0 } = t;
309
310
  return {
310
311
  config: t,
311
312
  state: {
312
- position: o,
313
+ position: n,
313
314
  velocity: 0
314
315
  },
315
- from: o,
316
- to: i,
316
+ from: n,
317
+ to: o,
317
318
  direction: "forward"
318
319
  };
319
320
  }
320
321
  });
321
- function k(n, t) {
322
- var f;
323
- let o = null, i = null, e = null, m = null;
324
- const l = {
322
+ function N(e, t) {
323
+ var l;
324
+ let n = null, o = null, s = null, i = null;
325
+ const u = {
325
326
  get currentAnimation() {
326
- return o;
327
+ return n;
327
328
  }
328
- }, p = ((f = t == null ? void 0 : t.strategy) == null ? void 0 : f.call(t, l)) || I(l), r = async (c) => {
329
- var w, S;
330
- i && (i.remove(), i = null);
331
- const a = n(), h = {
332
- in: a.in && Promise.resolve(a.in(c)),
333
- out: a.out && Promise.resolve(a.out(c))
334
- }, s = await p.runIn(h);
335
- if (!s.config)
329
+ }, d = ((l = t == null ? void 0 : t.strategy) == null ? void 0 : l.call(t, u)) || D(u), a = async (r) => {
330
+ var p, h;
331
+ o && (o.remove(), o = null);
332
+ const f = e(), g = {
333
+ in: f.in && Promise.resolve(f.in(r)),
334
+ out: f.out && Promise.resolve(f.out(r))
335
+ }, c = await d.runIn(g);
336
+ if (!c.config)
336
337
  return;
337
- (S = (w = s.config).prepare) == null || S.call(w, c), s.config.wait && await s.config.wait();
338
- const g = C.fromState(s.state, {
339
- from: s.from,
340
- to: s.to,
341
- spring: s.config.spring,
342
- onStart: s.config.onStart,
343
- onUpdate: s.config.tick,
338
+ (h = (p = c.config).prepare) == null || h.call(p, r), c.config.wait && await c.config.wait();
339
+ const S = A.fromState(c.state, {
340
+ from: c.from,
341
+ to: c.to,
342
+ spring: c.config.spring,
343
+ onStart: c.config.onStart,
344
+ onUpdate: c.config.tick,
344
345
  onComplete: () => {
345
- var v, d;
346
- o = null, (d = (v = s.config) == null ? void 0 : v.onEnd) == null || d.call(v);
346
+ var y, w;
347
+ n = null, (w = (y = c.config) == null ? void 0 : y.onEnd) == null || w.call(y);
347
348
  }
348
349
  });
349
- o = { animator: g, direction: "in" }, s.direction === "forward" ? g.forward() : g.backward();
350
- }, u = async (c) => {
351
- var S, v;
352
- i = c;
353
- const a = n(), h = {
354
- in: a.in && Promise.resolve(a.in(c)),
355
- out: a.out && Promise.resolve(a.out(c))
356
- }, s = await p.runOut(h);
357
- if (!s.config)
350
+ n = { animator: S, direction: "in" }, c.direction === "forward" ? S.forward() : S.backward();
351
+ }, m = async (r) => {
352
+ var h, y;
353
+ o = r;
354
+ const f = e(), g = {
355
+ in: f.in && Promise.resolve(f.in(r)),
356
+ out: f.out && Promise.resolve(f.out(r))
357
+ }, c = await d.runOut(g);
358
+ if (!c.config)
358
359
  return;
359
- (v = (S = s.config).prepare) == null || v.call(S, c), w(), s.config.wait && await s.config.wait();
360
- const g = C.fromState(s.state, {
361
- from: s.from,
362
- to: s.to,
363
- spring: s.config.spring,
364
- onStart: s.config.onStart,
365
- onUpdate: s.config.tick,
360
+ (y = (h = c.config).prepare) == null || y.call(h, r), p(), c.config.wait && await c.config.wait();
361
+ const S = A.fromState(c.state, {
362
+ from: c.from,
363
+ to: c.to,
364
+ spring: c.config.spring,
365
+ onStart: c.config.onStart,
366
+ onUpdate: c.config.tick,
366
367
  onComplete: () => {
367
- var d, V, T;
368
- (V = (d = s.config) == null ? void 0 : d.onEnd) == null || V.call(d), i && (i.remove(), i = null), o = null, (T = t == null ? void 0 : t.onCleanupEnd) == null || T.call(t);
368
+ var w, b, C;
369
+ (b = (w = c.config) == null ? void 0 : w.onEnd) == null || b.call(w), o && (o.remove(), o = null), n = null, (C = t == null ? void 0 : t.onCleanupEnd) == null || C.call(t);
369
370
  }
370
371
  });
371
- o = { animator: g, direction: "out" }, s.direction === "forward" ? g.forward() : g.backward();
372
- function w() {
373
- !e || !i || (m && e.contains(m) ? e.insertBefore(i, m) : e.appendChild(i));
372
+ n = { animator: S, direction: "out" }, c.direction === "forward" ? S.forward() : S.backward();
373
+ function p() {
374
+ !s || !o || (i && s.contains(i) ? s.insertBefore(o, i) : s.appendChild(o));
374
375
  }
375
376
  };
376
- return (c) => {
377
- if (c)
378
- return e = c.parentElement, m = c.nextElementSibling, r(c), () => {
379
- const a = c.cloneNode(!0);
380
- u(a);
377
+ return (r) => {
378
+ if (r)
379
+ return s = r.parentElement, i = r.nextElementSibling, a(r), () => {
380
+ const f = r.cloneNode(!0);
381
+ m(f);
381
382
  };
382
383
  };
383
384
  }
384
- const D = 3, $ = (n) => {
385
- if (!n) return null;
386
- const t = n.split(`
387
- `).map((o) => o.trim());
388
- for (let o = D; o < Math.min(t.length, 6); o++) {
389
- const i = t[o], e = i == null ? void 0 : i.match(/\(?([^):]+):(\d+):(\d+)\)?$/);
390
- if (!e)
385
+ const L = 3, $ = (e) => {
386
+ if (!e) return null;
387
+ const t = e.split(`
388
+ `).map((n) => n.trim());
389
+ for (let n = L; n < Math.min(t.length, 6); n++) {
390
+ const o = t[n], s = o == null ? void 0 : o.match(/\(?([^):]+):(\d+):(\d+)\)?$/);
391
+ if (!s)
391
392
  continue;
392
- const m = e[1] ?? "", l = e[2] ?? "0", p = e[3] ?? "0";
393
- return { file: m.split(/[\\/]/).pop() || m, line: l, column: p };
393
+ const i = s[1] ?? "", u = s[2] ?? "0", d = s[3] ?? "0";
394
+ return { file: i.split(/[\\/]/).pop() || i, line: u, column: d };
394
395
  }
395
396
  return null;
396
- }, A = /* @__PURE__ */ new Map(), E = /* @__PURE__ */ new Map();
397
- function F(n, t, o) {
398
- A.set(n, t);
399
- let i = E.get(n);
400
- return i || (i = k(
397
+ }, V = /* @__PURE__ */ new Map(), T = /* @__PURE__ */ new Map();
398
+ function k(e, t, n) {
399
+ V.set(e, t);
400
+ let o = T.get(e);
401
+ return o || (o = N(
401
402
  () => {
402
- const e = A.get(n);
403
- return e || (console.warn(`Transition "${String(n)}" not found`), {});
403
+ const s = V.get(e);
404
+ return s || (console.warn(`Transition "${String(e)}" not found`), {});
404
405
  },
405
406
  {
406
- strategy: o,
407
- onCleanupEnd: () => M(n)
407
+ strategy: n,
408
+ onCleanupEnd: () => M(e)
408
409
  }
409
- ), E.set(n, i), i);
410
+ ), T.set(e, o), o);
410
411
  }
411
- function M(n) {
412
- A.delete(n), E.delete(n);
412
+ function M(e) {
413
+ V.delete(e), T.delete(e);
413
414
  }
414
- function K() {
415
- const n = $(new Error().stack);
416
- return n ? `auto_${n.file}_${n.line}_${n.column}` : Symbol(`ssgoi_auto_${Date.now()}`);
415
+ function F() {
416
+ const e = $(new Error().stack);
417
+ return e ? `auto_${e.file}_${e.line}_${e.column}` : Symbol(`ssgoi_auto_${Date.now()}`);
417
418
  }
418
- const R = globalThis.FinalizationRegistry, O = R ? new R((n) => {
419
+ const O = globalThis.FinalizationRegistry, R = O ? new O((e) => {
419
420
  try {
420
- M(n);
421
+ M(e);
421
422
  } catch {
422
423
  }
423
424
  }) : void 0;
424
- function X(n) {
425
- const t = n.key ?? K();
426
- if (n.ref && O)
425
+ function J(e) {
426
+ const t = e.key ?? F();
427
+ if (e.ref && R)
427
428
  try {
428
- O.register(n.ref, t);
429
+ R.register(e.ref, t);
429
430
  } catch {
430
431
  }
431
- return F(
432
+ return k(
432
433
  t,
433
434
  {
434
- in: n.in,
435
- out: n.out
435
+ in: e.in,
436
+ out: e.out
436
437
  },
437
- n[x]
438
+ e[j]
438
439
  );
439
440
  }
440
- const W = (n) => {
441
- let t = n.parentElement;
441
+ const K = (e) => {
442
+ let t = e.parentElement;
442
443
  for (; t && t !== document.body; ) {
443
- const o = window.getComputedStyle(t), i = o.overflow + o.overflowY + o.overflowX;
444
- if (i.includes("auto") || i.includes("scroll") || t.scrollHeight > t.clientHeight || t.scrollWidth > t.clientWidth)
444
+ const n = window.getComputedStyle(t), o = n.overflow + n.overflowY + n.overflowX;
445
+ if (o.includes("auto") || o.includes("scroll") || t.scrollHeight > t.clientHeight || t.scrollWidth > t.clientWidth)
445
446
  return t;
446
447
  t = t.parentElement;
447
448
  }
448
449
  return document.documentElement;
449
- }, j = (n) => {
450
- let t = n.parentElement;
450
+ }, W = (e) => {
451
+ let t = e.parentElement;
451
452
  for (; t && t !== document.body; ) {
452
- const o = window.getComputedStyle(t).position;
453
- if (o === "relative" || o === "absolute" || o === "fixed" || o === "sticky")
453
+ const n = window.getComputedStyle(t).position;
454
+ if (n === "relative" || n === "absolute" || n === "fixed" || n === "sticky")
454
455
  return t;
455
456
  t = t.parentElement;
456
457
  }
457
458
  return document.body;
458
459
  };
459
- function L(n) {
460
- const t = n.filter((o) => o.symmetric).map((o) => ({
461
- from: o.to,
462
- to: o.from,
463
- transition: o.transition
460
+ function X(e) {
461
+ const t = e.filter((n) => n.symmetric).map((n) => ({
462
+ from: n.to,
463
+ to: n.from,
464
+ transition: n.transition
464
465
  }));
465
- return [...n, ...t];
466
+ return [...e, ...t];
466
467
  }
467
- function z() {
468
- let n = null;
469
- const t = /* @__PURE__ */ new Map();
468
+ function Y(e) {
469
+ let t = !1, n = !1;
470
+ const o = (a) => {
471
+ if (!e) return;
472
+ const m = a.touches[0];
473
+ m && (n = m.clientX < 50);
474
+ }, s = () => {
475
+ e && (n && (t = !0, setTimeout(() => {
476
+ t = !1;
477
+ }, 500)), n = !1);
478
+ };
479
+ return {
480
+ initialize: () => {
481
+ typeof window > "u" || e && (window.addEventListener("touchstart", o, { passive: !0 }), window.addEventListener("touchend", s, { passive: !0 }));
482
+ },
483
+ cleanup: () => {
484
+ typeof window > "u" || (window.removeEventListener("touchstart", o), window.removeEventListener("touchend", s));
485
+ },
486
+ isSwipePending: () => t
487
+ };
488
+ }
489
+ function G() {
490
+ let e = null, t = null;
491
+ const n = /* @__PURE__ */ new Map();
470
492
  let o = null;
471
- const i = () => {
472
- n && o && t.set(o, {
473
- x: n.scrollLeft,
474
- y: n.scrollTop
493
+ const s = () => {
494
+ e && o && n.set(o, {
495
+ x: e.scrollLeft,
496
+ y: e.scrollTop
475
497
  });
476
498
  };
477
499
  return {
478
- startScrollTracking: (r, u) => {
479
- n || (n = W(r), (n === document.documentElement ? window : n).addEventListener("scroll", i, {
500
+ initializeContext: (l, r) => {
501
+ t = l, e || (e = K(l), (e === document.documentElement ? window : e).addEventListener("scroll", s, {
480
502
  passive: !0
481
- })), o = u;
503
+ })), o = r;
482
504
  },
483
- calculateScrollOffset: (r, u) => {
484
- const f = r && t.has(r) ? t.get(r) : { x: 0, y: 0 }, c = u && t.has(u) ? t.get(u) : { x: 0, y: 0 };
505
+ calculateScrollOffset: (l, r) => {
506
+ const f = l && n.has(l) ? n.get(l) : { x: 0, y: 0 }, g = r && n.has(r) ? n.get(r) : { x: 0, y: 0 };
485
507
  return {
486
- x: -c.x + f.x,
487
- y: -c.y + f.y
508
+ x: -g.x + f.x,
509
+ y: -g.y + f.y
488
510
  };
489
511
  },
490
- getScrollContainer: () => n,
491
- getScrollPosition: (r) => r && t.has(r) ? t.get(r) : { x: 0, y: 0 }
512
+ getScrollContainer: () => e,
513
+ getPositionedParentElement: () => t ? W(t) : document.body,
514
+ getScrollPosition: (l) => l && n.has(l) ? n.get(l) : { x: 0, y: 0 }
492
515
  };
493
516
  }
494
- function B(n) {
517
+ function Q(e) {
495
518
  const {
496
519
  transitions: t = [],
497
- defaultTransition: o,
498
- middleware: i = (a, h) => ({ from: a, to: h })
520
+ defaultTransition: n,
521
+ middleware: o = (p, h) => ({ from: p, to: h }),
499
522
  // Identity function as default
500
- } = n;
501
- let e = null;
502
- const m = L(t), {
503
- startScrollTracking: l,
504
- calculateScrollOffset: p,
505
- getScrollContainer: r,
506
- getScrollPosition: u
507
- } = z();
508
- function f() {
509
- if (e != null && e.from && (e != null && e.to)) {
510
- const { from: a, to: h } = i(
511
- e.from,
512
- e.to
513
- ), g = Y(
514
- a,
523
+ skipOnIosSwipe: s = !0
524
+ // Default to true - skip animations on iOS swipe
525
+ } = e;
526
+ let i = null;
527
+ const u = X(t), {
528
+ initializeContext: d,
529
+ calculateScrollOffset: a,
530
+ getScrollContainer: m,
531
+ getPositionedParentElement: l,
532
+ getScrollPosition: r
533
+ } = G(), f = Y(s);
534
+ f.initialize();
535
+ function g() {
536
+ if (i != null && i.from && (i != null && i.to)) {
537
+ const { from: p, to: h } = o(
538
+ i.from,
539
+ i.to
540
+ ), w = H(
541
+ p,
515
542
  h,
516
- m
517
- ) || o, w = p(
518
- e.from,
519
- e.to
520
- ), S = {
521
- scrollOffset: w,
522
- scroll: u(e.from),
543
+ u
544
+ ) || n, b = a(
545
+ i.from,
546
+ i.to
547
+ ), C = {
548
+ scrollOffset: b,
549
+ scroll: r(i.from),
523
550
  get scrollingElement() {
524
- return r() || document.documentElement;
551
+ return m() || document.documentElement;
525
552
  },
526
553
  get positionedParent() {
527
- const d = r();
528
- return d ? j(d) : document.body;
554
+ return l();
529
555
  }
530
- }, v = {
531
- scrollOffset: w,
532
- scroll: u(e.to),
556
+ }, U = {
557
+ scrollOffset: b,
558
+ get scroll() {
559
+ return i ? r(i.to) : { x: 0, y: 0 };
560
+ },
533
561
  get scrollingElement() {
534
- return r() || document.documentElement;
562
+ return m() || document.documentElement;
535
563
  },
536
564
  get positionedParent() {
537
- const d = r();
538
- return d ? j(d) : document.body;
565
+ return l();
539
566
  }
540
567
  };
541
- g && (g.out && e.outResolve && e.outResolve(
542
- (d) => g.out(d, S)
543
- ), g.in && e.inResolve && e.inResolve(
544
- (d) => g.in(d, v)
545
- )), e = null;
568
+ w && (w.out && i.outResolve && i.outResolve(
569
+ (P) => w.out(P, C)
570
+ ), w.in && i.inResolve && i.inResolve(
571
+ (P) => w.in(P, U)
572
+ )), i = null;
546
573
  }
547
574
  }
548
- const c = async (a, h) => h === "in" && (!e || !e.from) ? () => ({}) : (e || (e = {}), h === "out" ? (e.from = a, new Promise((s) => {
549
- e.outResolve = s, f();
550
- })) : (e.to = a, new Promise((s) => {
551
- e.inResolve = s, f();
575
+ const c = async (p, h) => f.isSwipePending() ? () => ({}) : h === "in" && (!i || !i.from) ? () => ({}) : (i || (i = {}), h === "out" ? (i.from = p, new Promise((y) => {
576
+ i.outResolve = y, g();
577
+ })) : (i.to = p, new Promise((y) => {
578
+ i.inResolve = y, g();
552
579
  })));
553
- return (a) => ({
554
- key: a,
555
- in: async (h) => (l(h, a), (await c(a, "in"))(h)),
556
- out: async (h) => (await c(a, "out"))(h),
580
+ return (p) => ({
581
+ key: p,
582
+ in: async (h) => (d(h, p), (await c(p, "in"))(h)),
583
+ out: async (h) => (await c(p, "out"))(h),
557
584
  // Add page transition strategy for page-level transitions
558
- [x]: N
585
+ [j]: z
559
586
  });
560
587
  }
561
- function Y(n, t, o) {
562
- for (const i of o)
563
- if (b(n, i.from) && b(t, i.to))
564
- return i.transition;
565
- for (const i of o)
566
- if ((i.from === "*" || b(n, i.from)) && (i.to === "*" || b(t, i.to)))
567
- return i.transition;
588
+ function H(e, t, n) {
589
+ for (const o of n)
590
+ if (E(e, o.from) && E(t, o.to))
591
+ return o.transition;
592
+ for (const o of n)
593
+ if ((o.from === "*" || E(e, o.from)) && (o.to === "*" || E(t, o.to)))
594
+ return o.transition;
568
595
  return null;
569
596
  }
570
- function b(n, t) {
597
+ function E(e, t) {
571
598
  if (t === "*")
572
599
  return !0;
573
600
  if (t.endsWith("/*")) {
574
- const o = t.slice(0, -2);
575
- return n === o || n.startsWith(o + "/");
601
+ const n = t.slice(0, -2);
602
+ return e === n || e.startsWith(n + "/");
576
603
  }
577
- return n === t;
604
+ return e === t;
578
605
  }
579
606
  export {
580
- x as TRANSITION_STRATEGY,
581
- I as createDefaultStrategy,
582
- N as createPageTransitionStrategy,
583
- B as createSggoiTransitionContext,
584
- K as generateAutoKey,
585
- X as transition
607
+ j as TRANSITION_STRATEGY,
608
+ D as createDefaultStrategy,
609
+ z as createPageTransitionStrategy,
610
+ Q as createSggoiTransitionContext,
611
+ F as generateAutoKey,
612
+ nt as jaeminInternal,
613
+ J as transition
586
614
  };