@ssgoi/core 3.5.0 → 4.1.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.
Files changed (110) hide show
  1. package/dist/animator/integrator/double-spring-integrator.d.ts +31 -0
  2. package/dist/animator/integrator/double-spring-integrator.d.ts.map +1 -0
  3. package/dist/animator/integrator/index.d.ts +13 -0
  4. package/dist/animator/integrator/index.d.ts.map +1 -0
  5. package/dist/animator/integrator/inertia-integrator.d.ts +34 -0
  6. package/dist/animator/integrator/inertia-integrator.d.ts.map +1 -0
  7. package/dist/animator/integrator/provider.d.ts +22 -0
  8. package/dist/animator/integrator/provider.d.ts.map +1 -0
  9. package/dist/animator/integrator/spring-integrator.d.ts +19 -0
  10. package/dist/animator/integrator/spring-integrator.d.ts.map +1 -0
  11. package/dist/animator/integrator/types.d.ts +34 -0
  12. package/dist/animator/integrator/types.d.ts.map +1 -0
  13. package/dist/animator/multi-animator.d.ts +18 -13
  14. package/dist/animator/multi-animator.d.ts.map +1 -1
  15. package/dist/animator/{animate → runner}/css-runner.d.ts +2 -2
  16. package/dist/animator/runner/css-runner.d.ts.map +1 -0
  17. package/dist/animator/runner/provider.d.ts +35 -0
  18. package/dist/animator/runner/provider.d.ts.map +1 -0
  19. package/dist/animator/{animate → runner}/tick-runner.d.ts +2 -2
  20. package/dist/animator/runner/tick-runner.d.ts.map +1 -0
  21. package/dist/animator/runner/ticker.d.ts.map +1 -0
  22. package/dist/animator/{animate → runner}/types.d.ts +6 -3
  23. package/dist/animator/runner/types.d.ts.map +1 -0
  24. package/dist/animator/{index.d.ts → single-animator.d.ts} +22 -12
  25. package/dist/animator/single-animator.d.ts.map +1 -0
  26. package/dist/animator/{animation.d.ts → types.d.ts} +2 -2
  27. package/dist/animator/types.d.ts.map +1 -0
  28. package/dist/index.cjs +1 -1
  29. package/dist/index.js +552 -569
  30. package/dist/provider-Cs5iBqRD.cjs +1 -0
  31. package/dist/provider-Cu4NSF1Q.js +167 -0
  32. package/dist/transition/create-transition-callback.d.ts.map +1 -1
  33. package/dist/transition/transition-strategy.d.ts +8 -8
  34. package/dist/transition/transition-strategy.d.ts.map +1 -1
  35. package/dist/transitions/blur.d.ts +4 -4
  36. package/dist/transitions/blur.d.ts.map +1 -1
  37. package/dist/transitions/bounce.d.ts +4 -4
  38. package/dist/transitions/bounce.d.ts.map +1 -1
  39. package/dist/transitions/fade.d.ts +4 -4
  40. package/dist/transitions/fade.d.ts.map +1 -1
  41. package/dist/transitions/index.cjs +1 -1
  42. package/dist/transitions/index.d.ts +5 -0
  43. package/dist/transitions/index.d.ts.map +1 -1
  44. package/dist/transitions/index.js +141 -191
  45. package/dist/transitions/rotate.d.ts +4 -4
  46. package/dist/transitions/rotate.d.ts.map +1 -1
  47. package/dist/transitions/scale.d.ts +4 -4
  48. package/dist/transitions/scale.d.ts.map +1 -1
  49. package/dist/transitions/slide.d.ts +4 -4
  50. package/dist/transitions/slide.d.ts.map +1 -1
  51. package/dist/transitions/utils.d.ts +8 -0
  52. package/dist/transitions/utils.d.ts.map +1 -0
  53. package/dist/types.cjs +1 -1
  54. package/dist/types.d.ts +124 -38
  55. package/dist/types.d.ts.map +1 -1
  56. package/dist/types.js +41 -48
  57. package/dist/utils/index.d.ts +1 -0
  58. package/dist/utils/index.d.ts.map +1 -1
  59. package/dist/utils/wait-paint.d.ts +15 -0
  60. package/dist/utils/wait-paint.d.ts.map +1 -0
  61. package/dist/view-transitions/blind.d.ts +2 -3
  62. package/dist/view-transitions/blind.d.ts.map +1 -1
  63. package/dist/view-transitions/curtain-reveal.d.ts +2 -3
  64. package/dist/view-transitions/curtain-reveal.d.ts.map +1 -1
  65. package/dist/view-transitions/depth.d.ts +2 -2
  66. package/dist/view-transitions/depth.d.ts.map +1 -1
  67. package/dist/view-transitions/drill.d.ts +2 -2
  68. package/dist/view-transitions/drill.d.ts.map +1 -1
  69. package/dist/view-transitions/fade.d.ts +2 -3
  70. package/dist/view-transitions/fade.d.ts.map +1 -1
  71. package/dist/view-transitions/film.d.ts +2 -1
  72. package/dist/view-transitions/film.d.ts.map +1 -1
  73. package/dist/view-transitions/hero.d.ts +2 -2
  74. package/dist/view-transitions/hero.d.ts.map +1 -1
  75. package/dist/view-transitions/index.cjs +19 -19
  76. package/dist/view-transitions/index.d.ts +1 -0
  77. package/dist/view-transitions/index.d.ts.map +1 -1
  78. package/dist/view-transitions/index.js +874 -869
  79. package/dist/view-transitions/instagram.d.ts +2 -2
  80. package/dist/view-transitions/instagram.d.ts.map +1 -1
  81. package/dist/view-transitions/jaemin.d.ts +2 -2
  82. package/dist/view-transitions/jaemin.d.ts.map +1 -1
  83. package/dist/view-transitions/pinterest.d.ts +2 -2
  84. package/dist/view-transitions/pinterest.d.ts.map +1 -1
  85. package/dist/view-transitions/rotate.d.ts +5 -2
  86. package/dist/view-transitions/rotate.d.ts.map +1 -1
  87. package/dist/view-transitions/scroll.d.ts +2 -2
  88. package/dist/view-transitions/scroll.d.ts.map +1 -1
  89. package/dist/view-transitions/sheet.d.ts +2 -2
  90. package/dist/view-transitions/sheet.d.ts.map +1 -1
  91. package/dist/view-transitions/slide.d.ts +2 -2
  92. package/dist/view-transitions/slide.d.ts.map +1 -1
  93. package/dist/view-transitions/snap.d.ts +14 -0
  94. package/dist/view-transitions/snap.d.ts.map +1 -0
  95. package/dist/view-transitions/strip.d.ts +6 -2
  96. package/dist/view-transitions/strip.d.ts.map +1 -1
  97. package/dist/view-transitions/swap.d.ts +2 -2
  98. package/dist/view-transitions/swap.d.ts.map +1 -1
  99. package/package.json +1 -1
  100. package/dist/animator/animate/css-runner.d.ts.map +0 -1
  101. package/dist/animator/animate/index.d.ts +0 -42
  102. package/dist/animator/animate/index.d.ts.map +0 -1
  103. package/dist/animator/animate/tick-runner.d.ts.map +0 -1
  104. package/dist/animator/animate/types.d.ts.map +0 -1
  105. package/dist/animator/animation.d.ts.map +0 -1
  106. package/dist/animator/index.d.ts.map +0 -1
  107. package/dist/animator/spring-core.d.ts +0 -82
  108. package/dist/animator/spring-core.d.ts.map +0 -1
  109. package/dist/animator/ticker.d.ts.map +0 -1
  110. /package/dist/animator/{ticker.d.ts → runner/ticker.d.ts} +0 -0
@@ -1,44 +1,46 @@
1
- const m = (t, n) => {
2
- var r;
3
- t.style.position = "absolute", t.style.width = "100%", t.style.top = `${-1 * (((r = n == null ? void 0 : n.scrollOffset) == null ? void 0 : r.y) ?? 0)}px`, t.style.left = "0";
4
- }, W = (t) => new Promise((n) => setTimeout(n, t));
5
- function x(t, n) {
6
- function r(o) {
7
- let d = 0, s = 0;
8
- const c = o.offsetWidth, e = o.offsetHeight;
9
- let i = o;
10
- for (; i; )
11
- d += i.offsetTop, s += i.offsetLeft, i = i.offsetParent;
12
- return d -= window.scrollY, s -= window.scrollX, { top: d, left: s, width: c, height: e };
1
+ const g = (t, i) => {
2
+ var l;
3
+ t.style.position = "absolute", t.style.width = "100%", t.style.top = `${-1 * (((l = i == null ? void 0 : i.scrollOffset) == null ? void 0 : l.y) ?? 0)}px`, t.style.left = "0";
4
+ }, F = (t) => new Promise((i) => setTimeout(i, t));
5
+ function x(t, i) {
6
+ function l(s) {
7
+ let r = 0, e = 0;
8
+ const c = s.offsetWidth, y = s.offsetHeight;
9
+ let o = s;
10
+ for (; o; )
11
+ r += o.offsetTop, e += o.offsetLeft, o = o.offsetParent;
12
+ return r -= window.scrollY, e -= window.scrollX, { top: r, left: e, width: c, height: y };
13
13
  }
14
- const p = r(t), a = r(n);
14
+ const a = l(t), n = l(i);
15
15
  return new DOMRect(
16
- a.left - p.left,
17
- a.top - p.top,
18
- a.width,
19
- a.height
16
+ n.left - a.left,
17
+ n.top - a.top,
18
+ n.width,
19
+ n.height
20
20
  );
21
21
  }
22
- function S() {
23
- let t, n;
24
- return { promise: new Promise((p, a) => {
25
- t = p, n = a;
26
- }), resolve: t, reject: n };
22
+ function E() {
23
+ let t, i;
24
+ return { promise: new Promise((a, n) => {
25
+ t = a, i = n;
26
+ }), resolve: t, reject: i };
27
27
  }
28
- const Q = { stiffness: 80, damping: 25 }, R = { stiffness: 75, damping: 25 }, tt = 300, nt = 10, it = "horizontal", st = "#000000", Nt = (t = {}) => {
28
+ const W = {
29
+ spring: { stiffness: 200, damping: 22 }
30
+ }, M = {
31
+ spring: { stiffness: 200, damping: 22 }
32
+ }, B = 300, q = 10, j = "horizontal", N = "#000000", Wt = (t = {}) => {
29
33
  const {
30
- inSpring: n = R,
31
- outSpring: r = Q,
32
- transitionDelay: p = tt,
33
- blindCount: a = nt,
34
- direction: o = it,
35
- blindColor: d = st
36
- } = t;
37
- let s, c = null;
38
- const e = (i, y, h = "left") => {
39
- window.getComputedStyle(i).position === "static" && (i.style.position = "relative");
40
- const l = document.createElement("div");
41
- l.className = "blind-container", l.style.cssText = `
34
+ transitionDelay: i = B,
35
+ blindCount: l = q,
36
+ direction: a = j,
37
+ blindColor: n = N
38
+ } = t, s = t.physics ?? M, r = t.physics ?? W;
39
+ let e, c = null;
40
+ const y = (o, p, d = "left") => {
41
+ window.getComputedStyle(o).position === "static" && (o.style.position = "relative");
42
+ const f = document.createElement("div");
43
+ f.className = "blind-container", f.style.cssText = `
42
44
  position: absolute;
43
45
  top: 0;
44
46
  left: 0;
@@ -48,67 +50,67 @@ const Q = { stiffness: 80, damping: 25 }, R = { stiffness: 75, damping: 25 }, tt
48
50
  z-index: 9999;
49
51
  overflow: hidden;
50
52
  `;
51
- const u = [];
52
- for (let b = 0; b < a; b++) {
53
- const f = document.createElement("div");
54
- if (o === "horizontal") {
55
- const $ = 100 / a, w = `calc(${$}% + 1px)`;
56
- f.style.cssText = `
53
+ const h = [];
54
+ for (let $ = 0; $ < l; $++) {
55
+ const w = document.createElement("div");
56
+ if (a === "horizontal") {
57
+ const b = 100 / l, C = `calc(${b}% + 1px)`;
58
+ w.style.cssText = `
57
59
  position: absolute;
58
- top: ${$ * b}%;
60
+ top: ${b * $}%;
59
61
  left: 0;
60
62
  width: 100%;
61
- height: ${w};
62
- background: ${d};
63
- transform: scaleX(${y === "hidden" ? 0 : 1});
64
- transform-origin: ${h} center;
63
+ height: ${C};
64
+ background: ${n};
65
+ transform: scaleX(${p === "hidden" ? 0 : 1});
66
+ transform-origin: ${d} center;
65
67
  will-change: transform;
66
68
  `;
67
69
  } else {
68
- const $ = 100 / a, w = `calc(${$}% + 1px)`;
69
- f.style.cssText = `
70
+ const b = 100 / l, C = `calc(${b}% + 1px)`;
71
+ w.style.cssText = `
70
72
  position: absolute;
71
73
  top: 0;
72
- left: ${$ * b}%;
73
- width: ${w};
74
+ left: ${b * $}%;
75
+ width: ${C};
74
76
  height: 100%;
75
- background: ${d};
76
- transform: scaleY(${y === "hidden" ? 0 : 1});
77
- transform-origin: ${h === "left" ? "top" : "bottom"} center;
77
+ background: ${n};
78
+ transform: scaleY(${p === "hidden" ? 0 : 1});
79
+ transform-origin: ${d === "left" ? "top" : "bottom"} center;
78
80
  will-change: transform;
79
81
  `;
80
82
  }
81
- u.push(f), l.appendChild(f);
83
+ h.push(w), f.appendChild(w);
82
84
  }
83
- return i.appendChild(l), { container: l, blinds: u };
85
+ return o.appendChild(f), { container: f, blinds: h };
84
86
  };
85
87
  return {
86
- out: () => {
87
- let i = null;
88
- s = new Promise((g) => {
89
- c = g;
88
+ out: (o) => {
89
+ let p = null;
90
+ e = new Promise((f) => {
91
+ c = f;
90
92
  });
91
- const y = (g) => {
92
- const l = 1 - g;
93
+ const d = (f) => {
94
+ const h = 1 - f;
93
95
  return {
94
- transform: o === "horizontal" ? `scaleX(${l})` : `scaleY(${l})`
96
+ transform: a === "horizontal" ? `scaleX(${h})` : `scaleY(${h})`
95
97
  };
96
98
  };
97
99
  return {
98
- springs: Array.from({ length: a }, (g, l) => ({
99
- spring: r,
100
+ items: Array.from({ length: l }, (f, h) => ({
101
+ physics: r,
100
102
  offset: 0.2,
101
103
  css: {
102
104
  // Use getter for lazy element access (evaluated after prepare)
103
105
  get element() {
104
- return i == null ? void 0 : i.blinds[l];
106
+ return p == null ? void 0 : p.blinds[h];
105
107
  },
106
- style: y
108
+ style: d
107
109
  }
108
110
  })),
109
111
  schedule: "stagger",
110
- prepare: (g) => {
111
- m(g), g.style.zIndex = "1000", i = e(g, "hidden", "left");
112
+ prepare: () => {
113
+ g(o), o.style.zIndex = "1000", p = y(o, "hidden", "left");
112
114
  },
113
115
  onStart: () => {
114
116
  },
@@ -117,42 +119,46 @@ const Q = { stiffness: 80, damping: 25 }, R = { stiffness: 75, damping: 25 }, tt
117
119
  }
118
120
  };
119
121
  },
120
- in: () => {
121
- let i = null;
122
- const y = (g) => {
123
- const l = 1 - g;
122
+ in: (o) => {
123
+ let p = null;
124
+ const d = (f) => {
125
+ const h = 1 - f;
124
126
  return {
125
- transform: o === "horizontal" ? `scaleX(${l})` : `scaleY(${l})`
127
+ transform: a === "horizontal" ? `scaleX(${h})` : `scaleY(${h})`
126
128
  };
127
129
  };
128
130
  return {
129
- springs: Array.from({ length: a }, (g, l) => ({
130
- spring: n,
131
+ items: Array.from({ length: l }, (f, h) => ({
132
+ physics: s,
131
133
  offset: 0.2,
132
134
  css: {
133
135
  // Use getter for lazy element access (evaluated after prepare)
134
136
  get element() {
135
- return i == null ? void 0 : i.blinds[l];
137
+ return p == null ? void 0 : p.blinds[h];
136
138
  },
137
- style: y
139
+ style: d
138
140
  }
139
141
  })),
140
142
  schedule: "stagger",
141
- prepare: (g) => {
142
- g.style.position = "relative", g.style.zIndex = "0", i = e(g, "closed", "right");
143
+ prepare: () => {
144
+ o.style.position = "relative", o.style.zIndex = "0", p = y(o, "closed", "right");
143
145
  },
144
146
  onStart: () => {
145
147
  },
146
148
  wait: async () => {
147
- s && await s, await W(p);
149
+ e && await e, await F(i);
148
150
  },
149
151
  onEnd: () => {
150
- i && i.container && i.container.remove();
152
+ p && p.container && p.container.remove();
151
153
  }
152
154
  };
153
155
  }
154
156
  };
155
- }, et = { stiffness: 1, damping: 1 }, rt = { stiffness: 20, damping: 25 }, at = "#000000", ot = "circle", F = "CURTAIN_REVEAL_OVERLAY_ID", lt = {
157
+ }, G = {
158
+ spring: { stiffness: 1, damping: 1 }
159
+ }, Z = {
160
+ spring: { stiffness: 20, damping: 25 }
161
+ }, J = "#000000", K = "circle", m = "CURTAIN_REVEAL_OVERLAY_ID", Q = {
156
162
  position: "fixed",
157
163
  inset: "0",
158
164
  width: "100vw",
@@ -162,17 +168,17 @@ const Q = { stiffness: 80, damping: 25 }, R = { stiffness: 75, damping: 25 }, tt
162
168
  alignItems: "center",
163
169
  justifyContent: "center",
164
170
  overflow: "hidden"
165
- }, ct = {
171
+ }, R = {
166
172
  position: "relative",
167
173
  display: "inline-block",
168
174
  height: "5.5rem",
169
175
  overflow: "hidden"
170
- }, dt = {
176
+ }, tt = {
171
177
  display: "flex",
172
178
  height: "100%",
173
179
  willChange: "transform",
174
180
  transition: "transform 0.3s ease"
175
- }, pt = {
181
+ }, st = {
176
182
  display: "inline-flex",
177
183
  alignItems: "center",
178
184
  justifyContent: "center",
@@ -181,1316 +187,1315 @@ const Q = { stiffness: 80, damping: 25 }, R = { stiffness: 75, damping: 25 }, tt
181
187
  fontWeight: "900",
182
188
  letterSpacing: "0.02em",
183
189
  color: "#FFFFFF"
184
- }, yt = 0.4, k = 0.5, ht = 0.2;
185
- function gt(t, n) {
190
+ }, it = 0.4, A = 0.5, nt = 0.2;
191
+ function et(t, i) {
186
192
  switch (t) {
187
193
  case "circle":
188
- return `circle(${n * 100}% at 50% 50%)`;
194
+ return `circle(${i * 100}% at 50% 50%)`;
189
195
  case "square":
190
- return `inset(${(1 - n) * 50}% round ${10 * n}%)`;
196
+ return `inset(${(1 - i) * 50}% round ${10 * i}%)`;
191
197
  case "triangle": {
192
- const r = n * 100;
193
- return `polygon(50% ${50 - r}%, ${50 - r}% ${50 + r}%, ${50 + r}% ${50 + r}%)`;
198
+ const l = i * 100;
199
+ return `polygon(50% ${50 - l}%, ${50 - l}% ${50 + l}%, ${50 + l}% ${50 + l}%)`;
194
200
  }
195
201
  }
196
202
  }
197
- const ut = (t) => t.reduce((n, r) => n + r, 0), Wt = (t = {}) => {
203
+ const rt = (t) => t.reduce((i, l) => i + l, 0), Mt = (t = {}) => {
198
204
  const {
199
- background: n = at,
200
- texts: r = [],
201
- shape: p = ot,
202
- inSpring: a = rt,
203
- outSpring: o = et,
204
- textStyle: d = {}
205
- } = t;
205
+ background: i = J,
206
+ texts: l = [],
207
+ shape: a = K,
208
+ textStyle: n = {}
209
+ } = t, s = t.physics ?? Z, r = t.physics ?? G;
206
210
  return {
207
- out: (s, c) => {
208
- const e = s.style.opacity;
211
+ out: (e, c) => {
212
+ const y = e.style.opacity;
209
213
  return {
210
- spring: o,
214
+ physics: r,
211
215
  from: 1,
212
216
  to: 0,
213
- prepare: (i) => {
214
- m(i, c), i.style.opacity = "1";
217
+ prepare: () => {
218
+ g(e, c), e.style.opacity = "1";
215
219
  },
216
- tick: (i) => {
217
- const y = Math.max(0, i - yt);
218
- s.style.opacity = String(y);
220
+ tick: (o) => {
221
+ const p = Math.max(0, o - it);
222
+ e.style.opacity = String(p);
219
223
  },
220
224
  onEnd: () => {
221
- s.style.opacity = e;
225
+ e.style.opacity = y;
222
226
  }
223
227
  };
224
228
  },
225
- in: (s) => {
226
- let c = null, e = null, i = null;
227
- const y = document.body.style.overflow, h = document.getElementById(
228
- F
229
+ in: (e) => {
230
+ let c = null, y = null, o = null;
231
+ const p = document.body.style.overflow, d = document.getElementById(
232
+ m
229
233
  );
230
- let g = [];
231
- const l = () => {
232
- c = document.createElement("div"), c.id = F, Object.assign(c.style, lt, { background: n }), document.body.appendChild(c), e = document.createElement("div"), Object.assign(e.style, ct), c.appendChild(e), i = document.createElement("div"), Object.assign(i.style, dt), e.appendChild(i), r.forEach((u) => {
233
- const b = document.createElement("div");
234
- b.textContent = u, Object.assign(b.style, pt, d), i.appendChild(b);
235
- }), g = Array.from(i.children).map(
236
- (u) => u.getBoundingClientRect().width
234
+ let u = [];
235
+ const f = () => {
236
+ c = document.createElement("div"), c.id = m, Object.assign(c.style, Q, { background: i }), document.body.appendChild(c), y = document.createElement("div"), Object.assign(y.style, R), c.appendChild(y), o = document.createElement("div"), Object.assign(o.style, tt), y.appendChild(o), l.forEach((h) => {
237
+ const $ = document.createElement("div");
238
+ $.textContent = h, Object.assign($.style, st, n), o.appendChild($);
239
+ }), u = Array.from(o.children).map(
240
+ (h) => h.getBoundingClientRect().width
237
241
  );
238
242
  };
239
243
  return {
240
- spring: a,
244
+ physics: s,
241
245
  from: 0,
242
246
  to: 1,
243
247
  prepare: () => {
244
- document.body.style.overflow = "hidden", s.style.opacity = "1", h == null || h.remove(), l(), c && e && (c.style.clipPath = "none", e.style.transform = "scale(1)");
248
+ document.body.style.overflow = "hidden", e.style.opacity = "1", d == null || d.remove(), f(), c && y && (c.style.clipPath = "none", y.style.transform = "scale(1)");
245
249
  },
246
- tick: (u) => {
247
- if (!(!c || !e || !i)) {
248
- if (u <= k && r.length > 0) {
249
- const b = u / k, f = Math.min(
250
- Math.floor(b * r.length),
251
- r.length - 1
252
- ), $ = g[f] ?? 0, w = ut(g.slice(0, f));
253
- e.style.width = `${$}px`, i.style.transform = `translateX(-${w}px)`;
250
+ tick: (h) => {
251
+ if (!(!c || !y || !o)) {
252
+ if (h <= A && l.length > 0) {
253
+ const $ = h / A, w = Math.min(
254
+ Math.floor($ * l.length),
255
+ l.length - 1
256
+ ), b = u[w] ?? 0, C = rt(u.slice(0, w));
257
+ y.style.width = `${b}px`, o.style.transform = `translateX(-${C}px)`;
254
258
  }
255
- if (u > k) {
256
- const f = 1 - Math.max(
259
+ if (h > A) {
260
+ const w = 1 - Math.max(
257
261
  0,
258
- Math.min(1, (u - k) / ht)
262
+ Math.min(1, (h - A) / nt)
259
263
  );
260
- c.style.clipPath = gt(p, f), e.style.transform = `scale(${f})`;
264
+ c.style.clipPath = et(a, w), y.style.transform = `scale(${w})`;
261
265
  }
262
266
  }
263
267
  },
264
268
  onEnd: () => {
265
- c == null || c.remove(), c = e = i = null, document.body.style.overflow = y;
269
+ c == null || c.remove(), c = y = o = null, document.body.style.overflow = p;
266
270
  }
267
271
  };
268
272
  }
269
273
  };
270
- }, ft = {
271
- stiffness: 300,
272
- damping: 22,
273
- doubleSpring: 0.5
274
- }, wt = {
275
- stiffness: 300,
276
- damping: 22,
277
- doubleSpring: 0.5
278
- }, C = 0.05;
279
- function P(t) {
280
- const n = x(document.body, t.positionedParent), r = t.scroll.y, p = window.innerHeight - n.top;
274
+ }, at = {
275
+ spring: {
276
+ stiffness: 600,
277
+ damping: 40,
278
+ restDelta: 0.1,
279
+ restSpeed: 1e14
280
+ }
281
+ }, ot = {
282
+ spring: {
283
+ stiffness: 600,
284
+ damping: 40,
285
+ restDelta: 0.1,
286
+ restSpeed: 1e14
287
+ }
288
+ }, O = 0.05;
289
+ function T(t) {
290
+ const i = x(document.body, t.positionedParent), l = t.scroll.y, a = window.innerHeight - i.top;
281
291
  return {
282
- top: r,
292
+ top: l,
283
293
  left: 0,
284
- width: n.width,
285
- height: p
294
+ width: i.width,
295
+ height: a
286
296
  };
287
297
  }
288
- const Mt = (t = {}) => {
289
- var d, s, c;
290
- const { direction: n = "enter" } = t, r = n === "enter" ? ft : wt, p = {
291
- stiffness: ((d = t.spring) == null ? void 0 : d.stiffness) ?? r.stiffness,
292
- damping: ((s = t.spring) == null ? void 0 : s.damping) ?? r.damping,
293
- doubleSpring: ((c = t.spring) == null ? void 0 : c.doubleSpring) ?? r.doubleSpring
294
- };
295
- let { promise: a, resolve: o } = S();
296
- return n === "enter" ? {
298
+ const Bt = (t = {}) => {
299
+ const { direction: i = "enter" } = t, l = t.physics ?? (i === "enter" ? at : ot);
300
+ let { promise: a, resolve: n } = E();
301
+ return i === "enter" ? {
297
302
  // Entering page: scales up from small (0.8 → 1) with fade in
298
- in: (e, i) => {
299
- const y = P(i), h = y.left + y.width / 2, g = y.top + y.height / 2;
303
+ in: (s, r) => {
304
+ const e = T(r), c = e.left + e.width / 2, y = e.top + e.height / 2;
300
305
  return {
301
- spring: p,
306
+ physics: l,
302
307
  prepare: () => {
303
- e.style.opacity = "0", e.style.willChange = "transform, opacity", e.style.backfaceVisibility = "hidden", e.style.contain = "layout paint", e.style.transformOrigin = `${h}px ${g}px`;
308
+ s.style.opacity = "0", s.style.willChange = "transform, opacity", s.style.backfaceVisibility = "hidden", s.style.contain = "layout paint", s.style.transformOrigin = `${c}px ${y}px`;
304
309
  },
305
310
  wait: async () => {
306
311
  if (a) {
307
312
  await a;
308
- const l = S();
309
- a = l.promise, o = l.resolve;
313
+ const o = E();
314
+ a = o.promise, n = o.resolve;
310
315
  }
311
316
  },
312
- css: (l) => ({
313
- transform: `scale(${1 - C + l * C})`,
314
- opacity: l
317
+ css: (o) => ({
318
+ transform: `scale(${1 - O + o * O})`,
319
+ opacity: o
315
320
  }),
316
321
  onEnd: () => {
317
- e.style.opacity = "1", e.style.willChange = "auto", e.style.backfaceVisibility = "", e.style.contain = "", e.style.transformOrigin = "";
322
+ s.style.opacity = "1", s.style.willChange = "auto", s.style.backfaceVisibility = "", s.style.contain = "", s.style.transformOrigin = "";
318
323
  }
319
324
  };
320
325
  },
321
326
  // Exiting page: scales up (1 → 1.2) with fade out, goes to back
322
- out: (e, i) => {
323
- const y = P(i), h = y.left + y.width / 2, g = y.top + y.height / 2 + i.scrollOffset.y;
327
+ out: (s, r) => {
328
+ const e = T(r), c = e.left + e.width / 2, y = e.top + e.height / 2 + r.scrollOffset.y;
324
329
  return {
325
- spring: p,
326
- prepare: (l) => {
327
- m(l, i), l.style.zIndex = "-1", l.style.willChange = "transform, opacity", l.style.backfaceVisibility = "hidden", l.style.contain = "layout paint", l.style.pointerEvents = "none", l.style.transformOrigin = `${h}px ${g}px`;
330
+ physics: l,
331
+ prepare: () => {
332
+ g(s, r), s.style.zIndex = "-1", s.style.willChange = "transform, opacity", s.style.backfaceVisibility = "hidden", s.style.contain = "layout paint", s.style.pointerEvents = "none", s.style.transformOrigin = `${c}px ${y}px`;
328
333
  },
329
- css: (l) => ({
330
- transform: `scale(${1 + (1 - l) * C})`,
331
- opacity: l
334
+ css: (o) => ({
335
+ transform: `scale(${1 + (1 - o) * O})`,
336
+ opacity: o
332
337
  }),
333
338
  onEnd: () => {
334
- o && o();
339
+ n && n();
335
340
  }
336
341
  };
337
342
  }
338
343
  } : {
339
344
  // Entering page: scales down from large (1.2 → 1) with fade in
340
- in: (e, i) => {
341
- const y = P(i), h = y.left + y.width / 2, g = y.top + y.height / 2;
345
+ in: (s, r) => {
346
+ const e = T(r), c = e.left + e.width / 2, y = e.top + e.height / 2;
342
347
  return {
343
- spring: p,
348
+ physics: l,
344
349
  prepare: () => {
345
- e.style.opacity = "0", e.style.willChange = "transform, opacity", e.style.backfaceVisibility = "hidden", e.style.contain = "layout paint", e.style.transformOrigin = `${h}px ${g}px`;
350
+ s.style.opacity = "0", s.style.willChange = "transform, opacity", s.style.backfaceVisibility = "hidden", s.style.contain = "layout paint", s.style.transformOrigin = `${c}px ${y}px`;
346
351
  },
347
352
  wait: async () => {
348
353
  if (a) {
349
354
  await a;
350
- const l = S();
351
- a = l.promise, o = l.resolve;
355
+ const o = E();
356
+ a = o.promise, n = o.resolve;
352
357
  }
353
358
  },
354
- css: (l) => ({
355
- transform: `scale(${1 + C - l * C})`,
356
- opacity: l
359
+ css: (o) => ({
360
+ transform: `scale(${1 + O - o * O})`,
361
+ opacity: o
357
362
  }),
358
363
  onEnd: () => {
359
- e.style.opacity = "1", e.style.willChange = "auto", e.style.backfaceVisibility = "", e.style.contain = "", e.style.transformOrigin = "";
364
+ s.style.opacity = "1", s.style.willChange = "auto", s.style.backfaceVisibility = "", s.style.contain = "", s.style.transformOrigin = "";
360
365
  }
361
366
  };
362
367
  },
363
368
  // Exiting page: scales down to small (1 → 0.8) with fade out
364
- out: (e, i) => {
365
- const y = P(i), h = y.left + y.width / 2, g = y.top + y.height / 2 + i.scrollOffset.y;
369
+ out: (s, r) => {
370
+ const e = T(r), c = e.left + e.width / 2, y = e.top + e.height / 2 + r.scrollOffset.y;
366
371
  return {
367
- spring: p,
368
- prepare: (l) => {
369
- m(l, i), l.style.zIndex = "100", l.style.willChange = "transform, opacity", l.style.backfaceVisibility = "hidden", l.style.contain = "layout paint", l.style.pointerEvents = "none", l.style.transformOrigin = `${h}px ${g}px`;
372
+ physics: l,
373
+ prepare: () => {
374
+ g(s, r), s.style.zIndex = "100", s.style.willChange = "transform, opacity", s.style.backfaceVisibility = "hidden", s.style.contain = "layout paint", s.style.pointerEvents = "none", s.style.transformOrigin = `${c}px ${y}px`;
370
375
  },
371
- css: (l) => ({
372
- transform: `scale(${1 - (1 - l) * C})`,
373
- opacity: l
376
+ css: (o) => ({
377
+ transform: `scale(${1 - (1 - o) * O})`,
378
+ opacity: o
374
379
  }),
375
380
  onEnd: () => {
376
- o && o();
381
+ n && n();
377
382
  }
378
383
  };
379
384
  }
380
385
  };
381
- }, bt = {
382
- stiffness: 125,
383
- damping: 14,
384
- doubleSpring: 0.5
385
- }, $t = {
386
- stiffness: 128,
387
- damping: 14,
388
- doubleSpring: 0.5
389
- }, Gt = (t = {}) => {
390
- var o, d, s;
391
- const { opacity: n = !1, direction: r = "enter" } = t, p = r === "enter" ? bt : $t, a = {
392
- stiffness: ((o = t.spring) == null ? void 0 : o.stiffness) ?? p.stiffness,
393
- damping: ((d = t.spring) == null ? void 0 : d.damping) ?? p.damping,
394
- doubleSpring: ((s = t.spring) == null ? void 0 : s.doubleSpring) ?? p.doubleSpring
395
- };
396
- return r === "enter" ? {
397
- in: (c) => ({
398
- spring: a,
386
+ }, lt = {
387
+ spring: {
388
+ stiffness: 170,
389
+ damping: 22
390
+ }
391
+ }, ct = {
392
+ spring: {
393
+ stiffness: 170,
394
+ damping: 22
395
+ }
396
+ }, qt = (t = {}) => {
397
+ const { opacity: i = !1, direction: l = "enter" } = t, a = t.physics ?? (l === "enter" ? lt : ct);
398
+ return l === "enter" ? {
399
+ in: (n) => ({
400
+ physics: a,
399
401
  prepare: () => {
400
- c.style.willChange = n ? "transform, opacity" : "transform", c.style.backfaceVisibility = "hidden", c.style.contain = "layout paint";
402
+ n.style.willChange = i ? "transform, opacity" : "transform", n.style.backfaceVisibility = "hidden", n.style.contain = "layout paint";
401
403
  },
402
- css: (e) => {
403
- const i = {
404
- transform: `translate3d(${(1 - e) * 100}%, 0, 0)`
404
+ css: (s) => {
405
+ const r = {
406
+ transform: `translate3d(${(1 - s) * 100}%, 0, 0)`
405
407
  };
406
- return n && (i.opacity = e), i;
408
+ return i && (r.opacity = s), r;
407
409
  },
408
410
  onEnd: () => {
409
- c.style.willChange = "auto", c.style.backfaceVisibility = "", c.style.contain = "";
411
+ n.style.willChange = "auto", n.style.backfaceVisibility = "", n.style.contain = "";
410
412
  }
411
413
  }),
412
- out: (c, e) => ({
413
- spring: a,
414
- prepare: (i) => {
415
- m(i, e), i.style.zIndex = "-1", i.style.willChange = n ? "transform, opacity" : "transform", i.style.backfaceVisibility = "hidden", i.style.contain = "layout paint", i.style.pointerEvents = "none";
414
+ out: (n, s) => ({
415
+ physics: a,
416
+ prepare: () => {
417
+ g(n, s), n.style.zIndex = "-1", n.style.willChange = i ? "transform, opacity" : "transform", n.style.backfaceVisibility = "hidden", n.style.contain = "layout paint", n.style.pointerEvents = "none";
416
418
  },
417
- css: (i) => {
418
- const y = {
419
- transform: `translate3d(${-(1 - i) * 20}%, 0, 0)`
419
+ css: (r) => {
420
+ const e = {
421
+ transform: `translate3d(${-(1 - r) * 20}%, 0, 0)`
420
422
  };
421
- return n && (y.opacity = i), y;
423
+ return i && (e.opacity = r), e;
422
424
  }
423
425
  })
424
426
  } : {
425
- in: (c) => ({
426
- spring: a,
427
+ in: (n) => ({
428
+ physics: a,
427
429
  prepare: () => {
428
- c.style.willChange = n ? "transform, opacity" : "transform", c.style.backfaceVisibility = "hidden", c.style.contain = "layout paint";
430
+ n.style.willChange = i ? "transform, opacity" : "transform", n.style.backfaceVisibility = "hidden", n.style.contain = "layout paint";
429
431
  },
430
- css: (e) => {
431
- const i = {
432
- transform: `translate3d(${-(1 - e) * 20}%, 0, 0)`
432
+ css: (s) => {
433
+ const r = {
434
+ transform: `translate3d(${-(1 - s) * 20}%, 0, 0)`
433
435
  };
434
- return n && (i.opacity = e), i;
436
+ return i && (r.opacity = s), r;
435
437
  },
436
438
  onEnd: () => {
437
- c.style.willChange = "auto", c.style.backfaceVisibility = "", c.style.contain = "";
439
+ n.style.willChange = "auto", n.style.backfaceVisibility = "", n.style.contain = "";
438
440
  }
439
441
  }),
440
- out: (c, e) => ({
441
- spring: a,
442
- prepare: (i) => {
443
- m(i, e), i.style.zIndex = "100", i.style.willChange = n ? "transform, opacity" : "transform", i.style.backfaceVisibility = "hidden", i.style.contain = "layout paint", i.style.pointerEvents = "none";
442
+ out: (n, s) => ({
443
+ physics: a,
444
+ prepare: () => {
445
+ g(n, s), n.style.zIndex = "100", n.style.willChange = i ? "transform, opacity" : "transform", n.style.backfaceVisibility = "hidden", n.style.contain = "layout paint", n.style.pointerEvents = "none";
444
446
  },
445
- css: (i) => {
446
- const y = {
447
- transform: `translate3d(${(1 - i) * 100}%, 0, 0)`
447
+ css: (r) => {
448
+ const e = {
449
+ transform: `translate3d(${(1 - r) * 100}%, 0, 0)`
448
450
  };
449
- return n && (y.opacity = i), y;
451
+ return i && (e.opacity = r), e;
450
452
  }
451
453
  })
452
454
  };
453
- }, mt = {
454
- stiffness: 180,
455
- damping: 20,
456
- doubleSpring: !0
457
- }, xt = {
458
- stiffness: 170,
459
- damping: 20,
460
- doubleSpring: !0
461
- }, Et = 0, Bt = (t = {}) => {
462
- const {
463
- inSpring: n = xt,
464
- outSpring: r = mt,
465
- transitionDelay: p = Et
466
- } = t;
467
- let { promise: a, resolve: o } = S();
455
+ }, yt = {
456
+ spring: { stiffness: 180, damping: 20, doubleSpring: !0 }
457
+ }, ht = {
458
+ spring: { stiffness: 170, damping: 20, doubleSpring: !0 }
459
+ }, pt = 0, jt = (t = {}) => {
460
+ const { transitionDelay: i = pt } = t, l = t.physics ?? ht, a = t.physics ?? yt;
461
+ let { promise: n, resolve: s } = E();
468
462
  return {
469
- in: (d) => ({
470
- spring: n,
463
+ in: (r) => ({
464
+ physics: l,
471
465
  prepare: () => {
472
- d.style.opacity = "0", d.style.willChange = "opacity";
466
+ r.style.opacity = "0", r.style.willChange = "opacity";
473
467
  },
474
468
  wait: async () => {
475
- if (a) {
476
- await a;
477
- const s = S();
478
- a = s.promise, o = s.resolve, await W(p);
469
+ if (n) {
470
+ await n;
471
+ const e = E();
472
+ n = e.promise, s = e.resolve, await F(i);
479
473
  }
480
474
  },
481
- css: (s) => ({
482
- opacity: s
475
+ css: (e) => ({
476
+ opacity: e
483
477
  }),
484
478
  onEnd: () => {
485
- d.style.willChange = "auto", d.style.opacity = "1";
479
+ r.style.willChange = "auto", r.style.opacity = "1";
486
480
  }
487
481
  }),
488
- out: (d, s) => ({
489
- spring: r,
482
+ out: (r, e) => ({
483
+ physics: a,
490
484
  css: (c) => ({
491
485
  opacity: c
492
486
  }),
493
487
  prepare: () => {
494
- m(d, s), d.style.willChange = "opacity";
488
+ g(r, e), r.style.willChange = "opacity";
495
489
  },
496
490
  onEnd: () => {
497
- o && o(), d.style.willChange = "auto";
491
+ s && s(), r.style.willChange = "auto";
498
492
  }
499
493
  })
500
494
  };
501
- }, St = {
495
+ }, dt = {
502
496
  scaleDown: { stiffness: 20, damping: 7 },
503
497
  // Soft start for cinematic scale
504
498
  translate: { stiffness: 15, damping: 7 },
505
499
  // Medium for movement
506
500
  scaleUp: { stiffness: 20, damping: 7 }
507
501
  // Crisp return to full size
508
- }, A = {
502
+ }, S = {
509
503
  scaleDown: 0,
510
504
  // Start immediately
511
505
  translate: 0.2,
512
506
  // Start when scaleDown is 25% complete
513
507
  scaleUp: 0.8
514
508
  // Start when translate is 70% complete
515
- }, Ct = 0.8, At = "white", qt = (t) => {
516
- var a;
517
- const n = St, r = Ct, p = ((a = t == null ? void 0 : t.border) == null ? void 0 : a.color) ?? At;
509
+ }, ut = 0.8, ft = "white", Nt = (t) => {
510
+ var n;
511
+ const i = dt, l = ut, a = ((n = t == null ? void 0 : t.border) == null ? void 0 : n.color) ?? ft;
518
512
  return {
519
- out: async (o, d) => {
520
- const s = Y(d), c = x(document.body, d.positionedParent), e = Pt(p, {
521
- ...s,
513
+ out: async (s, r) => {
514
+ const e = I(r), c = x(document.body, r.positionedParent), y = wt(a, {
515
+ ...e,
522
516
  top: c.top
523
- }), i = {
517
+ }), o = {
524
518
  scale: 1,
525
- translateY: -s.top
526
- }, y = () => {
527
- o.style.transform = `translateY(${i.translateY}px) scale(${i.scale})`;
528
- const h = (s.width - s.width * i.scale) / 2, g = (s.height - s.height * i.scale) / 2;
529
- kt(e, h, g);
519
+ translateY: -e.top
520
+ }, p = () => {
521
+ s.style.transform = `translateY(${o.translateY}px) scale(${o.scale})`;
522
+ const d = (e.width - e.width * o.scale) / 2, u = (e.height - e.height * o.scale) / 2;
523
+ gt(y, d, u);
530
524
  };
531
525
  return {
532
- springs: [
526
+ items: [
533
527
  // Spring 1: Scale Down (1 → scale)
534
528
  {
535
- spring: n.scaleDown,
536
- offset: A.scaleDown,
537
- tick: (h) => {
538
- const g = 1 - h;
539
- i.scale = 1 - (1 - r) * g, y();
529
+ physics: (t == null ? void 0 : t.physics) ?? { spring: i.scaleDown },
530
+ offset: S.scaleDown,
531
+ tick: (d) => {
532
+ const u = 1 - d;
533
+ o.scale = 1 - (1 - l) * u, p();
540
534
  }
541
535
  },
542
536
  // Spring 2: Translate (vertical movement)
543
537
  {
544
- spring: n.translate,
545
- offset: A.translate,
546
- tick: (h) => {
547
- const g = 1 - h;
548
- i.translateY = -s.top - s.height * g, y();
538
+ physics: (t == null ? void 0 : t.physics) ?? { spring: i.translate },
539
+ offset: S.translate,
540
+ tick: (d) => {
541
+ const u = 1 - d;
542
+ o.translateY = -e.top - e.height * u, p();
549
543
  }
550
544
  },
551
545
  // Spring 3: Scale Up (scale → 1)
552
546
  {
553
- spring: n.scaleUp,
554
- offset: A.scaleUp,
555
- tick: (h) => {
556
- const g = 1 - h;
557
- i.scale = r + (1 - r) * g, y();
547
+ physics: (t == null ? void 0 : t.physics) ?? { spring: i.scaleUp },
548
+ offset: S.scaleUp,
549
+ tick: (d) => {
550
+ const u = 1 - d;
551
+ o.scale = l + (1 - l) * u, p();
558
552
  }
559
553
  }
560
554
  ],
561
555
  schedule: "stagger",
562
556
  prepare: () => {
563
- m(o), V(o, s), U(o, s), Tt(o, s);
564
- for (const h of e)
565
- d.positionedParent.appendChild(h);
557
+ g(s), Y(s, e), _(s, e), $t(s, e);
558
+ for (const d of y)
559
+ r.positionedParent.appendChild(d);
566
560
  },
567
561
  onEnd: () => {
568
- o.style.clipPath = "", o.style.transformOrigin = "", setTimeout(() => {
569
- for (const h of e)
570
- d.positionedParent.removeChild(h);
562
+ s.style.clipPath = "", s.style.transformOrigin = "", setTimeout(() => {
563
+ for (const d of y)
564
+ r.positionedParent.removeChild(d);
571
565
  }, 1e3);
572
566
  }
573
567
  };
574
568
  },
575
- in: async (o, d) => {
576
- const s = Y(d), c = {
577
- scale: r,
578
- translateY: -s.top + s.height
579
- }, e = () => {
580
- o.style.transform = `translateY(${c.translateY}px) scale(${c.scale})`;
569
+ in: async (s, r) => {
570
+ const e = I(r), c = {
571
+ scale: l,
572
+ translateY: -e.top + e.height
573
+ }, y = () => {
574
+ s.style.transform = `translateY(${c.translateY}px) scale(${c.scale})`;
581
575
  };
582
576
  return {
583
- springs: [
577
+ items: [
584
578
  // Spring 1: Scale Down (1 → scale) - element starts scaled, shrinks further
585
579
  {
586
- spring: n.scaleDown,
587
- offset: A.scaleDown,
588
- tick: (i) => {
589
- c.scale = 1 - (1 - r) * i, e();
580
+ physics: (t == null ? void 0 : t.physics) ?? { spring: i.scaleDown },
581
+ offset: S.scaleDown,
582
+ tick: (o) => {
583
+ c.scale = 1 - (1 - l) * o, y();
590
584
  }
591
585
  },
592
586
  // Spring 2: Translate (vertical movement from bottom to top)
593
587
  {
594
- spring: n.translate,
595
- offset: A.translate,
596
- tick: (i) => {
597
- c.translateY = -s.top + s.height * (1 - i), e();
588
+ physics: (t == null ? void 0 : t.physics) ?? { spring: i.translate },
589
+ offset: S.translate,
590
+ tick: (o) => {
591
+ c.translateY = -e.top + e.height * (1 - o), y();
598
592
  }
599
593
  },
600
594
  // Spring 3: Scale Up (scale → 1) - element returns to full size
601
595
  {
602
- spring: n.scaleUp,
603
- offset: A.scaleUp,
604
- tick: (i) => {
605
- c.scale = r + (1 - r) * i, e();
596
+ physics: (t == null ? void 0 : t.physics) ?? { spring: i.scaleUp },
597
+ offset: S.scaleUp,
598
+ tick: (o) => {
599
+ c.scale = l + (1 - l) * o, y();
606
600
  }
607
601
  }
608
602
  ],
609
603
  schedule: "stagger",
610
604
  prepare: () => {
611
- V(o, s), U(o, s), o.style.transform = `translateY(${-s.top + s.height}px) scale(${r})`;
605
+ Y(s, e), _(s, e), s.style.transform = `translateY(${-e.top + e.height}px) scale(${l})`;
612
606
  },
613
607
  onEnd: () => {
614
- o.style.clipPath = "", o.style.transformOrigin = "", o.style.transform = "";
608
+ s.style.clipPath = "", s.style.transformOrigin = "", s.style.transform = "";
615
609
  }
616
610
  };
617
611
  }
618
612
  };
619
613
  };
620
- function kt(t, n, r) {
621
- const p = n * 0.7, a = r * 0.7;
622
- t.topLeft.style.transform = `translate(${p}px, ${a}px)`, t.topRight.style.transform = `translate(${-p}px, ${a}px)`, t.bottomLeft.style.transform = `translate(${p}px, ${-a}px)`, t.bottomRight.style.transform = `translate(${-p}px, ${-a}px)`;
614
+ function gt(t, i, l) {
615
+ const a = i * 0.7, n = l * 0.7;
616
+ t.topLeft.style.transform = `translate(${a}px, ${n}px)`, t.topRight.style.transform = `translate(${-a}px, ${n}px)`, t.bottomLeft.style.transform = `translate(${a}px, ${-n}px)`, t.bottomRight.style.transform = `translate(${-a}px, ${-n}px)`;
623
617
  }
624
- function Pt(t = "white", n) {
625
- const a = document.createElement("div");
626
- a.style.position = "fixed", a.style.pointerEvents = "none", a.style.zIndex = "9999", a.style.top = `${n.top - 1}px`, a.style.left = `${n.left - 1}px`, a.style.width = "15px", a.style.height = "15px";
627
- const o = document.createElement("div");
628
- o.style.position = "absolute", o.style.width = "15px", o.style.height = "1px", o.style.backgroundColor = t, o.style.top = "0", o.style.left = "0";
629
- const d = document.createElement("div");
630
- d.style.position = "absolute", d.style.width = "1px", d.style.height = "15px", d.style.backgroundColor = t, d.style.top = "0", d.style.left = "0", a.appendChild(o), a.appendChild(d);
618
+ function wt(t = "white", i) {
619
+ const n = document.createElement("div");
620
+ n.style.position = "fixed", n.style.pointerEvents = "none", n.style.zIndex = "9999", n.style.top = `${i.top - 1}px`, n.style.left = `${i.left - 1}px`, n.style.width = "15px", n.style.height = "15px";
631
621
  const s = document.createElement("div");
632
- s.style.position = "fixed", s.style.pointerEvents = "none", s.style.zIndex = "9999", s.style.top = `${n.top - 1}px`, s.style.left = `${n.left + n.width - 15 + 1}px`, s.style.width = "15px", s.style.height = "15px";
622
+ s.style.position = "absolute", s.style.width = "15px", s.style.height = "1px", s.style.backgroundColor = t, s.style.top = "0", s.style.left = "0";
623
+ const r = document.createElement("div");
624
+ r.style.position = "absolute", r.style.width = "1px", r.style.height = "15px", r.style.backgroundColor = t, r.style.top = "0", r.style.left = "0", n.appendChild(s), n.appendChild(r);
625
+ const e = document.createElement("div");
626
+ e.style.position = "fixed", e.style.pointerEvents = "none", e.style.zIndex = "9999", e.style.top = `${i.top - 1}px`, e.style.left = `${i.left + i.width - 15 + 1}px`, e.style.width = "15px", e.style.height = "15px";
633
627
  const c = document.createElement("div");
634
628
  c.style.position = "absolute", c.style.width = "15px", c.style.height = "1px", c.style.backgroundColor = t, c.style.top = "0", c.style.right = "0";
635
- const e = document.createElement("div");
636
- e.style.position = "absolute", e.style.width = "1px", e.style.height = "15px", e.style.backgroundColor = t, e.style.top = "0", e.style.right = "0", s.appendChild(c), s.appendChild(e);
637
- const i = document.createElement("div");
638
- i.style.position = "fixed", i.style.pointerEvents = "none", i.style.zIndex = "9999", i.style.top = `${n.top + n.height - 15 + 1}px`, i.style.left = `${n.left - 1}px`, i.style.width = "15px", i.style.height = "15px";
639
629
  const y = document.createElement("div");
640
- y.style.position = "absolute", y.style.width = "15px", y.style.height = "1px", y.style.backgroundColor = t, y.style.bottom = "0", y.style.left = "0";
641
- const h = document.createElement("div");
642
- h.style.position = "absolute", h.style.width = "1px", h.style.height = "15px", h.style.backgroundColor = t, h.style.bottom = "0", h.style.left = "0", i.appendChild(y), i.appendChild(h);
643
- const g = document.createElement("div");
644
- g.style.position = "fixed", g.style.pointerEvents = "none", g.style.zIndex = "9999", g.style.top = `${n.top + n.height - 15 + 1}px`, g.style.left = `${n.left + n.width - 15 + 1}px`, g.style.width = "15px", g.style.height = "15px";
645
- const l = document.createElement("div");
646
- l.style.position = "absolute", l.style.width = "15px", l.style.height = "1px", l.style.backgroundColor = t, l.style.bottom = "0", l.style.right = "0";
630
+ y.style.position = "absolute", y.style.width = "1px", y.style.height = "15px", y.style.backgroundColor = t, y.style.top = "0", y.style.right = "0", e.appendChild(c), e.appendChild(y);
631
+ const o = document.createElement("div");
632
+ o.style.position = "fixed", o.style.pointerEvents = "none", o.style.zIndex = "9999", o.style.top = `${i.top + i.height - 15 + 1}px`, o.style.left = `${i.left - 1}px`, o.style.width = "15px", o.style.height = "15px";
633
+ const p = document.createElement("div");
634
+ p.style.position = "absolute", p.style.width = "15px", p.style.height = "1px", p.style.backgroundColor = t, p.style.bottom = "0", p.style.left = "0";
635
+ const d = document.createElement("div");
636
+ d.style.position = "absolute", d.style.width = "1px", d.style.height = "15px", d.style.backgroundColor = t, d.style.bottom = "0", d.style.left = "0", o.appendChild(p), o.appendChild(d);
647
637
  const u = document.createElement("div");
648
- return u.style.position = "absolute", u.style.width = "1px", u.style.height = "15px", u.style.backgroundColor = t, u.style.bottom = "0", u.style.right = "0", g.appendChild(l), g.appendChild(u), {
649
- topLeft: a,
650
- topRight: s,
651
- bottomLeft: i,
652
- bottomRight: g,
638
+ u.style.position = "fixed", u.style.pointerEvents = "none", u.style.zIndex = "9999", u.style.top = `${i.top + i.height - 15 + 1}px`, u.style.left = `${i.left + i.width - 15 + 1}px`, u.style.width = "15px", u.style.height = "15px";
639
+ const f = document.createElement("div");
640
+ f.style.position = "absolute", f.style.width = "15px", f.style.height = "1px", f.style.backgroundColor = t, f.style.bottom = "0", f.style.right = "0";
641
+ const h = document.createElement("div");
642
+ return h.style.position = "absolute", h.style.width = "1px", h.style.height = "15px", h.style.backgroundColor = t, h.style.bottom = "0", h.style.right = "0", u.appendChild(f), u.appendChild(h), {
643
+ topLeft: n,
644
+ topRight: e,
645
+ bottomLeft: o,
646
+ bottomRight: u,
653
647
  *[Symbol.iterator]() {
654
- yield a, yield s, yield i, yield g;
648
+ yield n, yield e, yield o, yield u;
655
649
  }
656
650
  };
657
651
  }
658
- function Y(t) {
659
- const n = x(document.body, t.positionedParent);
652
+ function I(t) {
653
+ const i = x(document.body, t.positionedParent);
660
654
  return {
661
655
  top: t.scroll.y,
662
656
  left: 0,
663
- width: n.width,
664
- height: window.innerHeight - n.top
657
+ width: i.width,
658
+ height: window.innerHeight - i.top
665
659
  };
666
660
  }
667
- function V(t, n) {
668
- const r = n.left + n.width / 2, p = n.top + n.height / 2;
669
- t.style.transformOrigin = `${r}px ${p}px`;
661
+ function Y(t, i) {
662
+ const l = i.left + i.width / 2, a = i.top + i.height / 2;
663
+ t.style.transformOrigin = `${l}px ${a}px`;
670
664
  }
671
- function U(t, n) {
665
+ function _(t, i) {
672
666
  t.style.clipPath = `polygon(
673
- ${n.left}px ${n.top}px,
674
- ${n.left + n.width}px ${n.top}px,
675
- ${n.left + n.width}px ${n.top + n.height}px,
676
- ${n.left}px ${n.top + n.height}px
667
+ ${i.left}px ${i.top}px,
668
+ ${i.left + i.width}px ${i.top}px,
669
+ ${i.left + i.width}px ${i.top + i.height}px,
670
+ ${i.left}px ${i.top + i.height}px
677
671
  )`;
678
672
  }
679
- function Tt(t, n) {
680
- t.style.transform = `translateY(${-n.top}px)`;
673
+ function $t(t, i) {
674
+ t.style.transform = `translateY(${-i.top}px)`;
681
675
  }
682
- function Ot(t, n) {
683
- return t.querySelector(`[data-hero-key="${n}"]`);
676
+ const bt = {
677
+ spring: { stiffness: 300, damping: 30 }
678
+ };
679
+ function xt(t, i) {
680
+ return t.querySelector(`[data-hero-key="${i}"]`);
684
681
  }
685
- const jt = (t = {}) => {
686
- var d, s;
687
- const n = {
688
- stiffness: ((d = t.spring) == null ? void 0 : d.stiffness) ?? 300,
689
- damping: ((s = t.spring) == null ? void 0 : s.damping) ?? 30
690
- }, r = t.timeout ?? 300, p = t.maxDistance ?? 700;
691
- let a = null, o = null;
682
+ const Gt = (t = {}) => {
683
+ const i = t.physics ?? bt, l = t.maxDistance ?? 700;
684
+ let a = null, n = E();
692
685
  return {
693
- in: async (c, e) => {
694
- const i = c, y = Array.from(i.querySelectorAll("[data-hero-key]"));
695
- if (y.length === 0)
696
- return {
697
- spring: n,
698
- tick: () => {
699
- }
700
- // No hero elements, skip animation
701
- };
702
- if (!await new Promise((l) => {
703
- a ? l(!0) : (o = l, setTimeout(() => {
704
- o = null, l(!1);
705
- }, r));
706
- }) || !a)
707
- return a = null, {
708
- spring: n,
709
- tick: () => {
710
- }
711
- // No fromNode, skip animation
712
- };
713
- const g = y.map((l) => {
714
- const u = l.getAttribute("data-hero-key");
715
- if (!u) return null;
716
- const b = Ot(a, u);
717
- if (!b) return null;
718
- const f = l, $ = x(a, b), w = x(i, f), E = $.left - w.left - e.scrollOffset.x, M = $.top - w.top - e.scrollOffset.y, G = $.width / w.width, B = $.height / w.height, q = f.style.transform, j = f.style.position, Z = f.style.transformOrigin, J = f.style.zIndex, K = f.style.willChange;
686
+ in: async (s, r) => {
687
+ const e = s, c = Array.from(e.querySelectorAll("[data-hero-key]"));
688
+ await n.promise;
689
+ const y = c.map((o) => {
690
+ const p = o.getAttribute("data-hero-key");
691
+ if (!p) return null;
692
+ const d = xt(a, p);
693
+ if (!d) return null;
694
+ const u = o, f = x(a, d), h = x(e, u), $ = f.left - h.left - r.scrollOffset.x, w = f.top - h.top - r.scrollOffset.y, b = f.width / h.width, C = f.height / h.height, V = u.style.transform, U = u.style.position, H = u.style.transformOrigin, X = u.style.zIndex, z = u.style.willChange;
719
695
  return {
720
- toEl: f,
721
- dx: E,
722
- dy: M,
723
- dw: G,
724
- dh: B,
725
- originalTransform: q,
726
- originalPosition: j,
727
- originalTransformOrigin: Z,
728
- originalZIndex: J,
729
- originalWillChange: K
696
+ toEl: u,
697
+ dx: $,
698
+ dy: w,
699
+ dw: b,
700
+ dh: C,
701
+ originalTransform: V,
702
+ originalPosition: U,
703
+ originalTransformOrigin: H,
704
+ originalZIndex: X,
705
+ originalWillChange: z
730
706
  };
731
707
  }).filter(
732
- (l) => l !== null && Math.abs(l.dy) <= p
708
+ (o) => o !== null && Math.abs(o.dy) <= l
733
709
  );
734
- return a = null, g.length === 0 ? {
735
- spring: n,
710
+ return a = null, n = E(), y.length === 0 ? {
711
+ physics: i,
736
712
  tick: () => {
737
713
  }
738
714
  // No matching hero elements
739
715
  } : {
740
- springs: g.map(({ toEl: l, dx: u, dy: b, dw: f, dh: $ }) => ({
741
- spring: n,
742
- tick: (w) => {
743
- l.style.transform = `translate(${(1 - w) * u}px, ${(1 - w) * b}px) scale(${w + (1 - w) * f}, ${w + (1 - w) * $})`;
716
+ items: y.map(({ toEl: o, dx: p, dy: d, dw: u, dh: f }) => ({
717
+ physics: i,
718
+ tick: (h) => {
719
+ o.style.transform = `translate(${(1 - h) * p}px, ${(1 - h) * d}px) scale(${h + (1 - h) * u}, ${h + (1 - h) * f})`;
744
720
  }
745
721
  })),
746
722
  schedule: "parallel",
747
723
  prepare: () => {
748
- g.forEach(({ toEl: l }) => {
749
- l.style.position = "relative", l.style.transformOrigin = "top left", l.style.zIndex = "1000", l.style.willChange = "transform";
724
+ y.forEach(({ toEl: o }) => {
725
+ o.style.position = "relative", o.style.transformOrigin = "top left", o.style.zIndex = "1000", o.style.willChange = "transform";
750
726
  });
751
727
  },
752
728
  onEnd: () => {
753
- g.forEach(
729
+ y.forEach(
754
730
  ({
755
- toEl: l,
756
- originalTransform: u,
757
- originalPosition: b,
758
- originalTransformOrigin: f,
759
- originalZIndex: $,
760
- originalWillChange: w
731
+ toEl: o,
732
+ originalTransform: p,
733
+ originalPosition: d,
734
+ originalTransformOrigin: u,
735
+ originalZIndex: f,
736
+ originalWillChange: h
761
737
  }) => {
762
- l.style.transform = u, l.style.position = b, l.style.transformOrigin = f, l.style.zIndex = $, l.style.willChange = w;
738
+ o.style.transform = p, o.style.position = d, o.style.transformOrigin = u, o.style.zIndex = f, o.style.willChange = h;
763
739
  }
764
740
  );
765
741
  }
766
742
  };
767
743
  },
768
- out: async (c) => ({
769
- spring: n,
770
- onStart: () => {
771
- a = c, o && (o(!0), o = null);
772
- },
744
+ out: async (s) => ({
745
+ physics: i,
773
746
  tick: () => {
774
747
  },
775
- prepare: (e) => {
776
- m(e), e.style.opacity = "0";
748
+ prepare: () => {
749
+ a = s, n.resolve(), g(s), s.style.opacity = "0";
777
750
  }
778
751
  })
779
752
  };
780
- }, L = {
781
- stiffness: 140,
782
- damping: 19,
783
- doubleSpring: 0.8
753
+ }, Et = {
754
+ spring: { stiffness: 180, damping: 22, doubleSpring: 1 }
784
755
  };
785
- function Lt({
756
+ function Ct({
786
757
  detailRect: t,
787
- galleryRect: n,
788
- pageRect: r,
789
- scrollOffset: p
758
+ galleryRect: i,
759
+ pageRect: l,
760
+ scrollOffset: a
790
761
  }) {
791
- const a = n.left - t.left + (n.width - t.width) / 2 - p.x, o = n.top - t.top + (n.height - t.height) / 2 - p.y, d = n.width / t.width, s = n.height / t.height, c = Math.max(d, s), e = t.top / r.height * 100, i = (r.width - (t.left + t.width)) / r.width * 100, y = (r.height - (t.top + t.height)) / r.height * 100, h = t.left / r.width * 100;
762
+ const n = i.left - t.left + (i.width - t.width) / 2 - a.x, s = i.top - t.top + (i.height - t.height) / 2 - a.y, r = i.width / t.width, e = i.height / t.height, c = Math.max(r, e), y = t.top / l.height * 100, o = (l.width - (t.left + t.width)) / l.width * 100, p = (l.height - (t.top + t.height)) / l.height * 100, d = t.left / l.width * 100;
792
763
  return {
793
764
  transformOrigin: `${t.left + t.width / 2}px ${t.top + t.height / 2}px`,
794
- animate: (l) => {
795
- const u = 1 - l;
765
+ animate: (f) => {
766
+ const h = 1 - f;
796
767
  return {
797
- clipPath: `inset(${e * u}% ${i * u}% ${y * u}% ${h * u}%)`,
798
- transform: `translate(${a * u}px, ${o * u}px) scale(${1 + (c - 1) * u})`
768
+ clipPath: `inset(${y * h}% ${o * h}% ${p * h}% ${d * h}%)`,
769
+ transform: `translate(${n * h}px, ${s * h}px) scale(${1 + (c - 1) * h})`
799
770
  };
800
771
  }
801
772
  };
802
773
  }
803
- function vt({
774
+ function Ot({
804
775
  detailRect: t,
805
- galleryRect: n,
806
- pageRect: r,
807
- scrollOffset: p
776
+ galleryRect: i,
777
+ pageRect: l,
778
+ scrollOffset: a
808
779
  }) {
809
- const a = n.left - t.left + (n.width - t.width) / 2 + p.x, o = n.top - t.top + (n.height - t.height) / 2 + p.y, d = n.width / t.width, s = n.height / t.height, c = Math.min(d, s), e = t.top / r.height * 100, i = (r.width - (t.left + t.width)) / r.width * 100, y = (r.height - (t.top + t.height)) / r.height * 100, h = t.left / r.width * 100;
780
+ const n = i.left - t.left + (i.width - t.width) / 2 + a.x, s = i.top - t.top + (i.height - t.height) / 2 + a.y, r = i.width / t.width, e = i.height / t.height, c = Math.min(r, e), y = t.top / l.height * 100, o = (l.width - (t.left + t.width)) / l.width * 100, p = (l.height - (t.top + t.height)) / l.height * 100, d = t.left / l.width * 100;
810
781
  return {
811
782
  transformOrigin: `${t.left + t.width / 2}px ${t.top + t.height / 2}px`,
812
- animate: (l) => {
813
- const u = 1 - l;
783
+ animate: (f) => {
784
+ const h = 1 - f;
814
785
  return {
815
- clipPath: `inset(${e * u}% ${i * u}% ${y * u}% ${h * u}%)`,
816
- transform: `translate(${a * u - p.x}px, ${o * u - p.y}px) scale(${1 + (c - 1) * u})`
786
+ clipPath: `inset(${y * h}% ${o * h}% ${p * h}% ${d * h}%)`,
787
+ transform: `translate(${n * h - a.x}px, ${s * h - a.y}px) scale(${1 + (c - 1) * h})`
817
788
  };
818
789
  }
819
790
  };
820
791
  }
821
- function It(t, n, r) {
822
- const p = t.querySelector(
792
+ function St(t, i, l) {
793
+ const a = t.querySelector(
823
794
  "[data-instagram-detail-key]"
824
- ), a = n.querySelector(
795
+ ), n = i.querySelector(
825
796
  "[data-instagram-detail-key]"
826
797
  );
827
- if (t.querySelectorAll("[data-instagram-detail-key]").length > 1 || n.querySelectorAll("[data-instagram-detail-key]").length > 1)
798
+ if (t.querySelectorAll("[data-instagram-detail-key]").length > 1 || i.querySelectorAll("[data-instagram-detail-key]").length > 1)
828
799
  return null;
829
- let o = null, d = null, s = !1;
830
- if (!p && a) {
831
- d = a;
832
- const i = d.getAttribute("data-instagram-detail-key");
833
- if (!i) return null;
834
- o = t.querySelector(
835
- `[data-instagram-gallery-key="${i}"]`
836
- ), o && (s = !0);
837
- } else if (p && !a) {
838
- d = p;
839
- const i = d.getAttribute("data-instagram-detail-key");
840
- if (!i) return null;
841
- o = n.querySelector(
842
- `[data-instagram-gallery-key="${i}"]`
843
- ), o && (s = !1);
800
+ let s = null, r = null, e = !1;
801
+ if (!a && n) {
802
+ r = n;
803
+ const o = r.getAttribute("data-instagram-detail-key");
804
+ if (!o) return null;
805
+ s = t.querySelector(
806
+ `[data-instagram-gallery-key="${o}"]`
807
+ ), s && (e = !0);
808
+ } else if (a && !n) {
809
+ r = a;
810
+ const o = r.getAttribute("data-instagram-detail-key");
811
+ if (!o) return null;
812
+ s = i.querySelector(
813
+ `[data-instagram-gallery-key="${o}"]`
814
+ ), s && (e = !1);
844
815
  }
845
- if (!o || !d)
816
+ if (!s || !r)
846
817
  return null;
847
- const c = x(s ? t : n, o), e = x(s ? n : t, d);
848
- if (s) {
849
- const i = Lt({
850
- detailRect: e,
818
+ const c = x(e ? t : i, s), y = x(e ? i : t, r);
819
+ if (e) {
820
+ const o = Ct({
821
+ detailRect: y,
851
822
  galleryRect: c,
852
- pageRect: n.getBoundingClientRect(),
853
- scrollOffset: r
823
+ pageRect: i.getBoundingClientRect(),
824
+ scrollOffset: l
854
825
  });
855
- return n.style.transformOrigin = i.transformOrigin, {
826
+ return i.style.transformOrigin = o.transformOrigin, {
856
827
  isEnterMode: !0,
857
- inAnimation: i.animate
828
+ inAnimation: o.animate
858
829
  // No outAnimation - gallery stays visible
859
830
  };
860
831
  } else {
861
- const i = vt({
862
- detailRect: e,
832
+ const o = Ot({
833
+ detailRect: y,
863
834
  galleryRect: c,
864
835
  pageRect: t.getBoundingClientRect(),
865
- scrollOffset: r
836
+ scrollOffset: l
866
837
  });
867
- return t.style.transformOrigin = i.transformOrigin, {
838
+ return t.style.transformOrigin = o.transformOrigin, {
868
839
  isEnterMode: !1,
869
- outAnimation: i.animate
840
+ outAnimation: o.animate
870
841
  // No inAnimation - gallery stays visible
871
842
  };
872
843
  }
873
844
  }
874
845
  const Zt = (t = {}) => {
875
- var s, c, e;
876
- const n = {
877
- stiffness: ((s = t.spring) == null ? void 0 : s.stiffness) ?? L.stiffness,
878
- damping: ((c = t.spring) == null ? void 0 : c.damping) ?? L.damping,
879
- doubleSpring: ((e = t.spring) == null ? void 0 : e.doubleSpring) ?? L.doubleSpring
880
- }, r = t.timeout ?? 300;
881
- let p = null, a = null, o = null, d = null;
846
+ const i = t.physics ?? Et, l = t.timeout ?? 300;
847
+ let a = null, n = null, s = null, r = null;
882
848
  return {
883
- in: async (i, { scrollOffset: y }) => {
884
- const h = i;
885
- return !await new Promise((l) => {
886
- p ? l(!0) : (a = l, setTimeout(() => {
887
- a = null, l(!1);
888
- }, r));
889
- }) || !p ? (d == null || d(), d = null, p = null, {
890
- spring: n,
849
+ in: async (e, { scrollOffset: c }) => {
850
+ const y = e;
851
+ return !await new Promise((p) => {
852
+ a ? p(!0) : (n = p, setTimeout(() => {
853
+ n = null, p(!1);
854
+ }, l));
855
+ }) || !a ? (r == null || r(), r = null, a = null, {
856
+ physics: i,
891
857
  css: () => ({})
892
- }) : (o = It(p, h, y), d == null || d(), d = null, o ? (p = null, {
893
- spring: n,
894
- css: (l) => o != null && o.inAnimation ? o.inAnimation(l) : {}
895
- }) : (p = null, {
896
- spring: n,
858
+ }) : (s = St(a, y, c), r == null || r(), r = null, s ? (a = null, {
859
+ physics: i,
860
+ css: (p) => s != null && s.inAnimation ? s.inAnimation(p) : {}
861
+ }) : (a = null, {
862
+ physics: i,
897
863
  css: () => ({})
898
864
  }));
899
865
  },
900
- out: async (i, y) => {
901
- const h = new Promise((g) => {
902
- d = g;
866
+ out: async (e, c) => {
867
+ const y = new Promise((o) => {
868
+ r = o;
903
869
  });
904
870
  return {
905
- spring: n,
906
- prepare: (g) => {
907
- o != null && o.isEnterMode ? m(g) : (m(g, y), g.style.zIndex = "-1");
871
+ physics: i,
872
+ prepare: () => {
873
+ s != null && s.isEnterMode ? g(e) : (g(e, c), e.style.zIndex = "-1");
908
874
  },
909
875
  wait: async () => {
910
- p = i, a && (a(!0), a = null), await h;
876
+ a = e, n && (n(!0), n = null), await y;
911
877
  },
912
- css: (g) => o != null && o.outAnimation ? o.outAnimation(g) : {}
878
+ css: (o) => s != null && s.outAnimation ? s.outAnimation(o) : {}
913
879
  };
914
880
  }
915
881
  };
882
+ }, At = {
883
+ spring: { stiffness: 50, damping: 30 }
916
884
  };
917
- function _t(t) {
918
- const n = x(document.body, t.positionedParent);
885
+ function Tt(t) {
886
+ const i = x(document.body, t.positionedParent);
919
887
  return {
920
888
  top: t.scroll.y,
921
889
  left: 0,
922
- width: n.width,
923
- height: window.innerHeight - n.top
890
+ width: i.width,
891
+ height: window.innerHeight - i.top
924
892
  };
925
893
  }
926
894
  const Jt = (t = {}) => {
927
- var o, d;
928
- const n = {
929
- stiffness: ((o = t.spring) == null ? void 0 : o.stiffness) ?? 50,
930
- damping: ((d = t.spring) == null ? void 0 : d.damping) ?? 30
931
- }, r = t.initialRotation ?? 45, p = t.initialScale ?? 0.01, a = t.rotationTriggerPoint ?? 0.8;
895
+ const i = t.physics ?? At, l = t.initialRotation ?? 45, a = t.initialScale ?? 0.01, n = t.rotationTriggerPoint ?? 0.8;
932
896
  return {
933
- out: async (s, c) => {
897
+ out: async (s, r) => {
934
898
  const e = s.style.opacity;
935
899
  return {
936
- spring: {
937
- stiffness: 80,
938
- damping: 25
900
+ physics: {
901
+ spring: {
902
+ stiffness: 80,
903
+ damping: 25
904
+ }
939
905
  },
940
906
  from: 1,
941
907
  to: 0,
942
908
  prepare: () => {
943
- m(s, c), s.style.opacity = "1";
909
+ g(s, r), s.style.opacity = "1";
944
910
  },
945
- tick: (i) => {
946
- s.style.opacity = String(i);
911
+ tick: (c) => {
912
+ s.style.opacity = String(c);
947
913
  },
948
914
  onEnd: () => {
949
915
  s.style.opacity = e;
950
916
  }
951
917
  };
952
918
  },
953
- in: async (s, c) => {
954
- const e = _t(c), i = s.style.transform, y = s.style.transformOrigin, h = s.style.position, g = s.style.zIndex;
919
+ in: async (s, r) => {
920
+ const e = Tt(r), c = s.style.transform, y = s.style.transformOrigin, o = s.style.position, p = s.style.zIndex;
955
921
  return {
956
- spring: n,
922
+ physics: i,
957
923
  from: 0,
958
924
  to: 1,
959
925
  prepare: () => {
960
- const l = Math.min(e.width, e.height) * 0.4;
926
+ const d = Math.min(e.width, e.height) * 0.4;
961
927
  s.style.setProperty(
962
928
  "--max-border-radius",
963
- `${l}px`
929
+ `${d}px`
964
930
  ), s.style.setProperty("--border-radius-scale", "1"), s.style.willChange = "transform", s.style.backfaceVisibility = "hidden";
965
- const u = e.left + e.width / 2, b = e.top + e.height / 2;
966
- s.style.transformOrigin = `${u}px ${b}px`, s.style.position = "fixed", s.style.top = `${e.top}px`, s.style.left = `${e.left}px`, s.style.width = `${e.width}px`, s.style.height = `${e.height}px`, s.style.zIndex = "1000", s.style.overflow = "hidden", s.style.transform = `rotate(${r}deg) scale(${p}) translateZ(0)`, s.style.borderRadius = "calc(var(--max-border-radius) * var(--border-radius-scale))", s.style.opacity = "1";
931
+ const u = e.left + e.width / 2, f = e.top + e.height / 2;
932
+ s.style.transformOrigin = `${u}px ${f}px`, s.style.position = "fixed", s.style.top = `${e.top}px`, s.style.left = `${e.left}px`, s.style.width = `${e.width}px`, s.style.height = `${e.height}px`, s.style.zIndex = "1000", s.style.overflow = "hidden", s.style.transform = `rotate(${l}deg) scale(${a}) translateZ(0)`, s.style.borderRadius = "calc(var(--max-border-radius) * var(--border-radius-scale))", s.style.opacity = "1";
967
933
  },
968
- tick: (l) => {
934
+ tick: (d) => {
969
935
  let u;
970
- if (l <= 0.05)
971
- u = p;
972
- else if (l <= a) {
973
- const w = (l - 0.05) / (a - 0.05), E = Math.pow(w, 9);
974
- u = p + (0.8 - p) * E;
936
+ if (d <= 0.05)
937
+ u = a;
938
+ else if (d <= n) {
939
+ const w = (d - 0.05) / (n - 0.05), b = Math.pow(w, 9);
940
+ u = a + (0.8 - a) * b;
975
941
  } else {
976
- const w = (l - a) / (1 - a);
942
+ const w = (d - n) / (1 - n);
977
943
  u = 0.8 + 0.2 * (1 - Math.pow(1 - w, 3));
978
944
  }
979
- let b;
980
- const f = 0.7;
981
- if (l <= f)
982
- b = r;
945
+ let f;
946
+ const h = 0.7;
947
+ if (d <= h)
948
+ f = l;
983
949
  else {
984
- const w = (l - f) / (1 - f), E = 1 - Math.pow(1 - w, 2);
985
- b = r * (1 - E);
950
+ const w = (d - h) / (1 - h), b = 1 - Math.pow(1 - w, 2);
951
+ f = l * (1 - b);
986
952
  }
987
953
  let $;
988
- if (l <= f)
954
+ if (d <= h)
989
955
  $ = 1;
990
956
  else {
991
- const w = (l - f) / (1 - f);
957
+ const w = (d - h) / (1 - h);
992
958
  $ = 1 - Math.pow(w, 0.5);
993
959
  }
994
- s.style.transform = `rotate(${b.toFixed(2)}deg) scale(${u.toFixed(4)}) translateZ(0)`, s.style.setProperty(
960
+ s.style.transform = `rotate(${f.toFixed(2)}deg) scale(${u.toFixed(4)}) translateZ(0)`, s.style.setProperty(
995
961
  "--border-radius-scale",
996
962
  $.toFixed(4)
997
963
  );
998
964
  },
999
965
  onEnd: () => {
1000
- s.style.willChange = "", s.style.backfaceVisibility = "", s.style.removeProperty("--max-border-radius"), s.style.removeProperty("--border-radius-scale"), s.style.transform = i, s.style.transformOrigin = y, s.style.position = h, s.style.zIndex = g, s.style.top = "", s.style.left = "", s.style.width = "", s.style.height = "", s.style.overflow = "", s.style.borderRadius = "";
966
+ s.style.willChange = "", s.style.backfaceVisibility = "", s.style.removeProperty("--max-border-radius"), s.style.removeProperty("--border-radius-scale"), s.style.transform = c, s.style.transformOrigin = y, s.style.position = o, s.style.zIndex = p, s.style.top = "", s.style.left = "", s.style.width = "", s.style.height = "", s.style.overflow = "", s.style.borderRadius = "";
1001
967
  }
1002
968
  };
1003
969
  }
1004
970
  };
1005
- }, v = {
1006
- stiffness: 140,
1007
- damping: 19,
1008
- doubleSpring: 0.7
971
+ }, Pt = {
972
+ spring: { stiffness: 200, damping: 23, doubleSpring: 1 }
1009
973
  };
1010
- function Dt({
974
+ function kt({
1011
975
  detailRect: t,
1012
- galleryRect: n,
1013
- pageRect: r,
1014
- scrollOffset: p
976
+ galleryRect: i,
977
+ pageRect: l,
978
+ scrollOffset: a
1015
979
  }) {
1016
- const a = n.left - t.left + (n.width - t.width) / 2 - p.x, o = n.top - t.top + (n.height - t.height) / 2 - p.y, d = n.width / t.width, s = n.height / t.height, c = Math.max(d, s), e = t.top / r.height * 100, i = (r.width - (t.left + t.width)) / r.width * 100, y = (r.height - (t.top + t.height)) / r.height * 100, h = t.left / r.width * 100;
980
+ const n = i.left - t.left + (i.width - t.width) / 2 - a.x, s = i.top - t.top + (i.height - t.height) / 2 - a.y, r = i.width / t.width, e = i.height / t.height, c = Math.max(r, e), y = t.top / l.height * 100, o = (l.width - (t.left + t.width)) / l.width * 100, p = (l.height - (t.top + t.height)) / l.height * 100, d = t.left / l.width * 100;
1017
981
  return {
1018
982
  transformOrigin: `${t.left + t.width / 2}px ${t.top + t.height / 2}px`,
1019
- animate: (l) => {
1020
- const u = 1 - l;
983
+ animate: (f) => {
984
+ const h = 1 - f;
1021
985
  return {
1022
- clipPath: `inset(${e * u}% ${i * u}% ${y * u}% ${h * u}%)`,
1023
- transform: `translate(${a * u}px, ${o * u}px) scale(${1 + (c - 1) * u})`
986
+ clipPath: `inset(${y * h}% ${o * h}% ${p * h}% ${d * h}%)`,
987
+ transform: `translate(${n * h}px, ${s * h}px) scale(${1 + (c - 1) * h})`
1024
988
  };
1025
989
  }
1026
990
  };
1027
991
  }
1028
- function Ft({
992
+ function Lt({
1029
993
  galleryRect: t,
1030
- detailRect: n,
1031
- scrollOffset: r
994
+ detailRect: i,
995
+ scrollOffset: l
1032
996
  }) {
1033
- const p = n.left - t.left + (n.width - t.width) / 2 + r.x, a = n.top - t.top + (n.height - t.height) / 2 + r.y, o = n.width / t.width, d = n.height / t.height, s = Math.max(o, d);
997
+ const a = i.left - t.left + (i.width - t.width) / 2 + l.x, n = i.top - t.top + (i.height - t.height) / 2 + l.y, s = i.width / t.width, r = i.height / t.height, e = Math.max(s, r);
1034
998
  return {
1035
999
  transformOrigin: `${t.left + t.width / 2}px ${t.top + t.height / 2}px`,
1036
- animate: (e) => {
1037
- const i = 1 - e;
1000
+ animate: (y) => {
1001
+ const o = 1 - y;
1038
1002
  return {
1039
- transform: `translate(${p * i - r.x}px, ${a * i - r.y}px) scale(${1 + (s - 1) * i})`,
1040
- opacity: `${1 - i}`
1003
+ transform: `translate(${a * o - l.x}px, ${n * o - l.y}px) scale(${1 + (e - 1) * o})`,
1004
+ opacity: `${1 - o}`
1041
1005
  };
1042
1006
  }
1043
1007
  };
1044
1008
  }
1045
- function Yt({
1009
+ function vt({
1046
1010
  galleryRect: t,
1047
- detailRect: n,
1048
- scrollOffset: r
1011
+ detailRect: i,
1012
+ scrollOffset: l
1049
1013
  }) {
1050
- const p = n.left - t.left + (n.width - t.width) / 2 - r.x, a = n.top - t.top + (n.height - t.height) / 2 - r.y, o = n.width / t.width, d = n.height / t.height, s = Math.max(o, d);
1014
+ const a = i.left - t.left + (i.width - t.width) / 2 - l.x, n = i.top - t.top + (i.height - t.height) / 2 - l.y, s = i.width / t.width, r = i.height / t.height, e = Math.max(s, r);
1051
1015
  return {
1052
1016
  transformOrigin: `${t.left + t.width / 2}px ${t.top + t.height / 2}px`,
1053
- animate: (e) => {
1054
- const i = 1 - e, y = e;
1017
+ animate: (y) => {
1018
+ const o = 1 - y, p = y;
1055
1019
  return {
1056
- transform: `translate(${p * i}px, ${a * i}px) scale(${1 + (s - 1) * i})`,
1057
- opacity: `${y}`
1020
+ transform: `translate(${a * o}px, ${n * o}px) scale(${1 + (e - 1) * o})`,
1021
+ opacity: `${p}`
1058
1022
  };
1059
1023
  }
1060
1024
  };
1061
1025
  }
1062
- function Vt({
1026
+ function mt({
1063
1027
  detailRect: t,
1064
- galleryRect: n,
1065
- pageRect: r,
1066
- scrollOffset: p
1028
+ galleryRect: i,
1029
+ pageRect: l,
1030
+ scrollOffset: a
1067
1031
  }) {
1068
- const a = n.left - t.left + (n.width - t.width) / 2 + p.x, o = n.top - t.top + (n.height - t.height) / 2 + p.y, d = n.width / t.width, s = n.height / t.height, c = Math.min(d, s), e = t.top / r.height * 100, i = (r.width - (t.left + t.width)) / r.width * 100, y = (r.height - (t.top + t.height)) / r.height * 100, h = t.left / r.width * 100;
1032
+ const n = i.left - t.left + (i.width - t.width) / 2 + a.x, s = i.top - t.top + (i.height - t.height) / 2 + a.y, r = i.width / t.width, e = i.height / t.height, c = Math.min(r, e), y = t.top / l.height * 100, o = (l.width - (t.left + t.width)) / l.width * 100, p = (l.height - (t.top + t.height)) / l.height * 100, d = t.left / l.width * 100;
1069
1033
  return {
1070
1034
  transformOrigin: `${t.left + t.width / 2}px ${t.top + t.height / 2}px`,
1071
- animate: (l) => {
1072
- const u = 1 - l;
1035
+ animate: (f) => {
1036
+ const h = 1 - f;
1073
1037
  return {
1074
- clipPath: `inset(${e * u}% ${i * u}% ${y * u}% ${h * u}%)`,
1075
- transform: `translate(${a * u - p.x}px, ${o * u - p.y}px) scale(${1 + (c - 1) * u})`
1038
+ clipPath: `inset(${y * h}% ${o * h}% ${p * h}% ${d * h}%)`,
1039
+ transform: `translate(${n * h - a.x}px, ${s * h - a.y}px) scale(${1 + (c - 1) * h})`
1076
1040
  };
1077
1041
  }
1078
1042
  };
1079
1043
  }
1080
- function Ut(t, n, r) {
1081
- const p = t.querySelector(
1044
+ function It(t, i, l) {
1045
+ const a = t.querySelector(
1082
1046
  "[data-pinterest-detail-key]"
1083
- ), a = n.querySelector(
1047
+ ), n = i.querySelector(
1084
1048
  "[data-pinterest-detail-key]"
1085
1049
  );
1086
- if (t.querySelectorAll("[data-pinterest-detail-key]").length > 1 || n.querySelectorAll("[data-pinterest-detail-key]").length > 1)
1050
+ if (t.querySelectorAll("[data-pinterest-detail-key]").length > 1 || i.querySelectorAll("[data-pinterest-detail-key]").length > 1)
1087
1051
  return null;
1088
- let o = null, d = null, s = !1;
1089
- if (!p && a) {
1090
- d = a;
1091
- const i = d.getAttribute("data-pinterest-detail-key");
1092
- if (!i) return null;
1093
- o = t.querySelector(
1094
- `[data-pinterest-gallery-key="${i}"]`
1095
- ), o && (s = !0);
1096
- } else if (p && !a) {
1097
- d = p;
1098
- const i = d.getAttribute("data-pinterest-detail-key");
1099
- if (!i) return null;
1100
- o = n.querySelector(
1101
- `[data-pinterest-gallery-key="${i}"]`
1102
- ), o && (s = !1);
1052
+ let s = null, r = null, e = !1;
1053
+ if (!a && n) {
1054
+ r = n;
1055
+ const o = r.getAttribute("data-pinterest-detail-key");
1056
+ if (!o) return null;
1057
+ s = t.querySelector(
1058
+ `[data-pinterest-gallery-key="${o}"]`
1059
+ ), s && (e = !0);
1060
+ } else if (a && !n) {
1061
+ r = a;
1062
+ const o = r.getAttribute("data-pinterest-detail-key");
1063
+ if (!o) return null;
1064
+ s = i.querySelector(
1065
+ `[data-pinterest-gallery-key="${o}"]`
1066
+ ), s && (e = !1);
1103
1067
  }
1104
- if (!o || !d)
1068
+ if (!s || !r)
1105
1069
  return null;
1106
- const c = x(s ? t : n, o), e = x(s ? n : t, d);
1107
- if (s) {
1108
- const i = Dt({
1109
- detailRect: e,
1070
+ const c = x(e ? t : i, s), y = x(e ? i : t, r);
1071
+ if (e) {
1072
+ const o = kt({
1073
+ detailRect: y,
1110
1074
  galleryRect: c,
1111
- pageRect: n.getBoundingClientRect(),
1112
- scrollOffset: r
1113
- }), y = Ft({
1075
+ pageRect: i.getBoundingClientRect(),
1076
+ scrollOffset: l
1077
+ }), p = Lt({
1114
1078
  galleryRect: c,
1115
- detailRect: e,
1116
- scrollOffset: r
1079
+ detailRect: y,
1080
+ scrollOffset: l
1117
1081
  });
1118
- return n.style.transformOrigin = i.transformOrigin, t.style.transformOrigin = y.transformOrigin, {
1119
- inAnimation: i.animate,
1120
- outAnimation: y.animate
1082
+ return i.style.transformOrigin = o.transformOrigin, t.style.transformOrigin = p.transformOrigin, {
1083
+ inAnimation: o.animate,
1084
+ outAnimation: p.animate
1121
1085
  };
1122
1086
  } else {
1123
- const i = Yt({
1087
+ const o = vt({
1124
1088
  galleryRect: c,
1125
- detailRect: e,
1126
- scrollOffset: r
1127
- }), y = Vt({
1128
- detailRect: e,
1089
+ detailRect: y,
1090
+ scrollOffset: l
1091
+ }), p = mt({
1092
+ detailRect: y,
1129
1093
  galleryRect: c,
1130
1094
  pageRect: t.getBoundingClientRect(),
1131
- scrollOffset: r
1095
+ scrollOffset: l
1132
1096
  });
1133
- return n.style.transformOrigin = i.transformOrigin, t.style.transformOrigin = y.transformOrigin, {
1134
- inAnimation: i.animate,
1135
- outAnimation: y.animate
1097
+ return i.style.transformOrigin = o.transformOrigin, t.style.transformOrigin = p.transformOrigin, {
1098
+ inAnimation: o.animate,
1099
+ outAnimation: p.animate
1136
1100
  };
1137
1101
  }
1138
1102
  }
1139
1103
  const Kt = (t = {}) => {
1140
- var s, c, e;
1141
- const n = {
1142
- stiffness: ((s = t.spring) == null ? void 0 : s.stiffness) ?? v.stiffness,
1143
- damping: ((c = t.spring) == null ? void 0 : c.damping) ?? v.damping,
1144
- doubleSpring: ((e = t.spring) == null ? void 0 : e.doubleSpring) ?? v.doubleSpring
1145
- }, r = t.timeout ?? 300;
1146
- let p = null, a = null, o = null, d = null;
1104
+ const i = t.physics ?? Pt, l = t.timeout ?? 300;
1105
+ let a = null, n = null, s = null, r = null;
1147
1106
  return {
1148
- in: async (i, { scrollOffset: y }) => {
1149
- const h = i;
1150
- return !await new Promise((l) => {
1151
- p ? l(!0) : (a = l, setTimeout(() => {
1152
- a = null, l(!1);
1153
- }, r));
1154
- }) || !p ? (d == null || d(), d = null, p = null, {
1155
- spring: n,
1107
+ in: async (e, { scrollOffset: c }) => {
1108
+ const y = e;
1109
+ return !await new Promise((p) => {
1110
+ a ? p(!0) : (n = p, setTimeout(() => {
1111
+ n = null, p(!1);
1112
+ }, l));
1113
+ }) || !a ? (r == null || r(), r = null, a = null, {
1114
+ physics: i,
1156
1115
  css: () => ({})
1157
- }) : (o = Ut(p, h, y), d == null || d(), d = null, o ? (p = null, {
1158
- spring: n,
1159
- css: (l) => o ? o.inAnimation(l) : {}
1160
- }) : (p = null, {
1161
- spring: n,
1116
+ }) : (s = It(a, y, c), r == null || r(), r = null, s ? (a = null, {
1117
+ physics: i,
1118
+ css: (p) => s ? s.inAnimation(p) : {}
1119
+ }) : (a = null, {
1120
+ physics: i,
1162
1121
  css: () => ({})
1163
1122
  }));
1164
1123
  },
1165
- out: async (i) => {
1166
- const y = new Promise((h) => {
1167
- d = h;
1124
+ out: async (e) => {
1125
+ const c = new Promise((y) => {
1126
+ r = y;
1168
1127
  });
1169
1128
  return {
1170
- spring: n,
1171
- prepare: (h) => {
1172
- m(h), h.style.zIndex = "-1";
1129
+ physics: i,
1130
+ prepare: () => {
1131
+ g(e), e.style.zIndex = "-1", a = e, n && (n(!0), n = null);
1173
1132
  },
1174
1133
  wait: async () => {
1175
- p = i, a && (a(!0), a = null), await y;
1134
+ await c;
1176
1135
  },
1177
- css: (h) => o ? o.outAnimation(h) : {}
1136
+ css: (y) => s ? s.outAnimation(y) : {}
1178
1137
  };
1179
1138
  }
1180
1139
  };
1181
- }, X = { stiffness: 100, damping: 30 }, Qt = () => ({
1182
- in: (t) => ({
1183
- spring: X,
1184
- prepare: () => {
1185
- t.style.opacity = "0", t.style.transform = "rotate(-180deg)", t.style.transformOrigin = "center center", t.style.willChange = "transform, opacity";
1186
- },
1187
- css: (n) => ({
1188
- // -180deg → 0deg, show after 90deg (progress > 0.5)
1189
- transform: `rotate(${(n - 1) * 180}deg)`,
1190
- opacity: n > 0.5 ? 1 : 0
1191
- }),
1192
- onEnd: () => {
1193
- t.style.willChange = "auto", t.style.transform = "", t.style.transformOrigin = "", t.style.opacity = "";
1194
- }
1195
- }),
1196
- out: (t, n) => ({
1197
- spring: X,
1198
- prepare: () => {
1199
- m(t, n), t.style.transformOrigin = "center center", t.style.willChange = "transform, opacity";
1200
- },
1201
- css: (r) => ({
1202
- // 0deg → 180deg, hide after 90deg (progress < 0.5)
1203
- transform: `rotate(${(1 - r) * 180}deg)`,
1204
- opacity: r > 0.5 ? 1 : 0
1140
+ }, Yt = {
1141
+ spring: { stiffness: 100, damping: 30 }
1142
+ }, Qt = (t = {}) => {
1143
+ const i = t.physics ?? Yt;
1144
+ return {
1145
+ in: (l) => ({
1146
+ physics: i,
1147
+ prepare: () => {
1148
+ l.style.opacity = "0", l.style.transform = "rotate(-180deg)", l.style.transformOrigin = "center center", l.style.willChange = "transform, opacity";
1149
+ },
1150
+ css: (a) => ({
1151
+ // -180deg → 0deg, show after 90deg (progress > 0.5)
1152
+ transform: `rotate(${(a - 1) * 180}deg)`,
1153
+ opacity: a > 0.5 ? 1 : 0
1154
+ }),
1155
+ onEnd: () => {
1156
+ l.style.willChange = "auto", l.style.transform = "", l.style.transformOrigin = "", l.style.opacity = "";
1157
+ }
1205
1158
  }),
1206
- onEnd: () => {
1207
- t.style.willChange = "auto";
1208
- }
1209
- })
1210
- }), z = {
1211
- stiffness: 5,
1212
- damping: 4
1159
+ out: (l, a) => ({
1160
+ physics: i,
1161
+ prepare: () => {
1162
+ g(l, a), l.style.transformOrigin = "center center", l.style.willChange = "transform, opacity";
1163
+ },
1164
+ css: (n) => ({
1165
+ // 0deg → 180deg, hide after 90deg (progress < 0.5)
1166
+ transform: `rotate(${(1 - n) * 180}deg)`,
1167
+ opacity: n > 0.5 ? 1 : 0
1168
+ }),
1169
+ onEnd: () => {
1170
+ l.style.willChange = "auto";
1171
+ }
1172
+ })
1173
+ };
1174
+ }, _t = {
1175
+ spring: { stiffness: 5, damping: 4 }
1213
1176
  }, Rt = (t = {}) => {
1214
- var c, e;
1215
- const n = t.direction ?? "up", r = {
1216
- stiffness: ((c = t.spring) == null ? void 0 : c.stiffness) ?? z.stiffness,
1217
- damping: ((e = t.spring) == null ? void 0 : e.damping) ?? z.damping
1218
- }, p = n === "up";
1219
- let a = null, o = null, d = null;
1220
- const s = () => {
1221
- if (a === null || o === null)
1177
+ const i = t.direction ?? "up", l = t.physics ?? _t, a = i === "up";
1178
+ let n = null, s = null, r = null;
1179
+ const e = () => {
1180
+ if (n === null || s === null)
1222
1181
  return null;
1223
- const i = Math.min(a, o), y = window.innerHeight;
1224
- return Math.max(i, y);
1182
+ const c = Math.min(n, s), y = window.innerHeight;
1183
+ return Math.max(c, y);
1225
1184
  };
1226
1185
  return {
1227
- in: (i) => (o = i.offsetHeight, a !== null && (d = s()), {
1228
- spring: r,
1186
+ in: (c) => (s = c.offsetHeight, n !== null && (r = e()), {
1187
+ physics: l,
1229
1188
  prepare: () => {
1230
- i.style.willChange = "transform", i.style.backfaceVisibility = "hidden", i.style.contain = "layout paint";
1189
+ c.style.willChange = "transform", c.style.backfaceVisibility = "hidden", c.style.contain = "layout paint";
1231
1190
  },
1232
1191
  tick: (y) => {
1233
- d === null && (d = s());
1234
- const h = d ?? window.innerHeight, g = p ? (1 - y) * h : (1 - y) * -h;
1235
- i.style.transform = `translate3d(0, ${g}px, 0)`;
1192
+ r === null && (r = e());
1193
+ const o = r ?? window.innerHeight, p = a ? (1 - y) * o : (1 - y) * -o;
1194
+ c.style.transform = `translate3d(0, ${p}px, 0)`;
1236
1195
  },
1237
1196
  onEnd: () => {
1238
- i.style.willChange = "auto", i.style.backfaceVisibility = "", i.style.contain = "";
1197
+ c.style.willChange = "auto", c.style.backfaceVisibility = "", c.style.contain = "";
1239
1198
  }
1240
1199
  }),
1241
- out: (i, y) => ({
1242
- spring: r,
1243
- onStart: () => {
1244
- a = i.offsetHeight, o !== null && (d = s());
1245
- },
1246
- tick: (h) => {
1247
- d === null && (d = s());
1248
- const g = d ?? window.innerHeight, l = p ? (1 - h) * -g : (1 - h) * g;
1249
- i.style.transform = `translate3d(0, ${l}px, 0)`;
1200
+ out: (c, y) => ({
1201
+ physics: l,
1202
+ tick: (o) => {
1203
+ r === null && (r = e());
1204
+ const p = r ?? window.innerHeight, d = a ? (1 - o) * -p : (1 - o) * p;
1205
+ c.style.transform = `translate3d(0, ${d}px, 0)`;
1250
1206
  },
1251
- prepare: (h) => {
1252
- m(h, y), h.style.zIndex = p ? "-1" : "1", h.style.willChange = "transform", h.style.backfaceVisibility = "hidden", h.style.contain = "layout paint", h.style.pointerEvents = "none";
1207
+ prepare: () => {
1208
+ n = c.offsetHeight, s !== null && (r = e()), g(c, y), c.style.zIndex = a ? "-1" : "1", c.style.willChange = "transform", c.style.backfaceVisibility = "hidden", c.style.contain = "layout paint", c.style.pointerEvents = "none";
1253
1209
  }
1254
1210
  })
1255
1211
  };
1256
- }, Xt = {
1257
- stiffness: 140,
1258
- damping: 15,
1259
- doubleSpring: 0.5
1260
- }, zt = {
1261
- stiffness: 145,
1262
- damping: 15,
1263
- doubleSpring: 0.5
1212
+ }, Dt = {
1213
+ inertia: {
1214
+ acceleration: 20,
1215
+ resistance: 1.5
1216
+ }
1217
+ }, Ft = {
1218
+ inertia: {
1219
+ acceleration: 20,
1220
+ resistance: 1
1221
+ }
1264
1222
  };
1265
- function T(t) {
1266
- const n = x(document.body, t.positionedParent), r = t.scroll.y, p = window.innerHeight - n.top;
1223
+ function P(t) {
1224
+ const i = x(document.body, t.positionedParent), l = t.scroll.y, a = window.innerHeight - i.top;
1267
1225
  return {
1268
- top: r,
1226
+ top: l,
1269
1227
  left: 0,
1270
- width: n.width,
1271
- height: p
1228
+ width: i.width,
1229
+ height: a
1272
1230
  };
1273
1231
  }
1274
- const tn = (t = {}) => {
1275
- var a, o, d;
1276
- const { direction: n = "enter" } = t, r = n === "enter" ? Xt : zt, p = {
1277
- stiffness: ((a = t.spring) == null ? void 0 : a.stiffness) ?? r.stiffness,
1278
- damping: ((o = t.spring) == null ? void 0 : o.damping) ?? r.damping,
1279
- doubleSpring: ((d = t.spring) == null ? void 0 : d.doubleSpring) ?? r.doubleSpring
1280
- };
1281
- return n === "enter" ? {
1232
+ const ts = (t = {}) => {
1233
+ const { direction: i = "enter" } = t, l = t.physics ?? (i === "enter" ? Dt : Ft);
1234
+ return i === "enter" ? {
1282
1235
  // Entering sheet: slides up from bottom
1283
- in: (s, c) => {
1284
- const i = T(c).height;
1236
+ in: (a, n) => {
1237
+ const r = P(n).height;
1285
1238
  return {
1286
- spring: p,
1239
+ physics: l,
1287
1240
  prepare: () => {
1288
- s.style.willChange = "transform", s.style.backfaceVisibility = "hidden", s.style.contain = "layout paint";
1241
+ a.style.willChange = "transform", a.style.backfaceVisibility = "hidden", a.style.contain = "layout paint";
1289
1242
  },
1290
- css: (y) => ({
1291
- transform: `translate3d(0, ${(1 - y) * i}px, 0)`
1243
+ css: (e) => ({
1244
+ transform: `translate3d(0, ${(1 - e) * r}px, 0)`
1292
1245
  }),
1293
1246
  onEnd: () => {
1294
- s.style.willChange = "auto", s.style.backfaceVisibility = "", s.style.contain = "";
1247
+ a.style.willChange = "auto", a.style.backfaceVisibility = "", a.style.contain = "";
1295
1248
  }
1296
1249
  };
1297
1250
  },
1298
1251
  // Exiting background: scales down with fade
1299
- out: (s, c) => {
1300
- const e = T(c), i = e.left + e.width / 2, y = e.top + e.height / 2 + c.scrollOffset.y;
1252
+ out: (a, n) => {
1253
+ const s = P(n), r = s.left + s.width / 2, e = s.top + s.height / 2 + n.scrollOffset.y;
1301
1254
  return {
1302
- spring: p,
1303
- prepare: (h) => {
1304
- m(h, c), h.style.zIndex = "-1", h.style.willChange = "transform, opacity", h.style.backfaceVisibility = "hidden", h.style.contain = "layout paint", h.style.pointerEvents = "none", h.style.transformOrigin = `${i}px ${y}px`;
1255
+ physics: l,
1256
+ prepare: () => {
1257
+ g(a, n), a.style.zIndex = "-1", a.style.willChange = "transform, opacity", a.style.backfaceVisibility = "hidden", a.style.contain = "layout paint", a.style.pointerEvents = "none", a.style.transformOrigin = `${r}px ${e}px`;
1305
1258
  },
1306
- css: (h) => ({
1307
- transform: `scale(${0.8 + h * 0.2})`,
1308
- opacity: h
1259
+ css: (c) => ({
1260
+ transform: `scale(${0.8 + c * 0.2})`,
1261
+ opacity: c
1309
1262
  })
1310
1263
  };
1311
1264
  }
1312
1265
  } : {
1313
1266
  // Entering background: scales up with fade
1314
- in: (s, c) => {
1315
- const e = T(c), i = e.left + e.width / 2, y = e.top + e.height / 2;
1267
+ in: (a, n) => {
1268
+ const s = P(n), r = s.left + s.width / 2, e = s.top + s.height / 2;
1316
1269
  return {
1317
- spring: p,
1270
+ physics: l,
1318
1271
  prepare: () => {
1319
- s.style.willChange = "transform, opacity", s.style.backfaceVisibility = "hidden", s.style.contain = "layout paint", s.style.transformOrigin = `${i}px ${y}px`;
1272
+ a.style.willChange = "transform, opacity", a.style.backfaceVisibility = "hidden", a.style.contain = "layout paint", a.style.transformOrigin = `${r}px ${e}px`;
1320
1273
  },
1321
- css: (h) => ({
1322
- transform: `scale(${0.8 + h * 0.2})`,
1323
- opacity: h
1274
+ css: (c) => ({
1275
+ transform: `scale(${0.8 + c * 0.2})`,
1276
+ opacity: c
1324
1277
  }),
1325
1278
  onEnd: () => {
1326
- s.style.willChange = "auto", s.style.backfaceVisibility = "", s.style.contain = "", s.style.transformOrigin = "";
1279
+ a.style.willChange = "auto", a.style.backfaceVisibility = "", a.style.contain = "", a.style.transformOrigin = "";
1327
1280
  }
1328
1281
  };
1329
1282
  },
1330
1283
  // Exiting sheet: slides down with high z-index
1331
- out: (s, c) => {
1332
- const i = T(c).height;
1284
+ out: (a, n) => {
1285
+ const r = P(n).height;
1333
1286
  return {
1334
- spring: p,
1335
- prepare: (y) => {
1336
- m(y, c), y.style.zIndex = "100", y.style.willChange = "transform", y.style.backfaceVisibility = "hidden", y.style.contain = "layout paint", y.style.pointerEvents = "none";
1287
+ physics: l,
1288
+ prepare: () => {
1289
+ g(a, n), a.style.zIndex = "100", a.style.willChange = "transform", a.style.backfaceVisibility = "hidden", a.style.contain = "layout paint", a.style.pointerEvents = "none";
1337
1290
  },
1338
- css: (y) => ({
1339
- transform: `translate3d(0, ${(1 - y) * i}px, 0)`
1291
+ css: (e) => ({
1292
+ transform: `translate3d(0, ${(1 - e) * r}px, 0)`
1340
1293
  })
1341
1294
  };
1342
1295
  }
1343
1296
  };
1344
- }, I = {
1345
- stiffness: 140,
1346
- damping: 19,
1347
- doubleSpring: 0.8
1348
- }, nn = (t = {}) => {
1349
- var a, o, d;
1350
- const n = t.direction ?? "left", r = {
1351
- stiffness: ((a = t.spring) == null ? void 0 : a.stiffness) ?? I.stiffness,
1352
- damping: ((o = t.spring) == null ? void 0 : o.damping) ?? I.damping,
1353
- doubleSpring: ((d = t.spring) == null ? void 0 : d.doubleSpring) ?? I.doubleSpring
1354
- }, p = n === "left";
1297
+ }, Vt = {
1298
+ spring: {
1299
+ stiffness: 140,
1300
+ damping: 19,
1301
+ doubleSpring: 0.8
1302
+ }
1303
+ }, ss = (t = {}) => {
1304
+ const i = t.direction ?? "left", l = t.physics ?? Vt, a = i === "left";
1355
1305
  return {
1356
- in: (s) => ({
1357
- spring: r,
1306
+ in: (n) => ({
1307
+ physics: l,
1358
1308
  prepare: () => {
1359
- s.style.willChange = "transform", s.style.backfaceVisibility = "hidden", s.style.contain = "layout paint";
1309
+ n.style.willChange = "transform", n.style.backfaceVisibility = "hidden", n.style.contain = "layout paint";
1360
1310
  },
1361
- css: (c) => ({
1362
- transform: `translate3d(${p ? (1 - c) * 100 : (1 - c) * -100}%, 0, 0)`
1311
+ css: (s) => ({
1312
+ transform: `translate3d(${a ? (1 - s) * 100 : (1 - s) * -100}%, 0, 0)`
1363
1313
  }),
1364
1314
  onEnd: () => {
1365
- s.style.willChange = "auto", s.style.backfaceVisibility = "", s.style.contain = "";
1315
+ n.style.willChange = "auto", n.style.backfaceVisibility = "", n.style.contain = "";
1366
1316
  }
1367
1317
  }),
1368
- out: (s, c) => ({
1369
- spring: r,
1370
- css: (e) => ({
1371
- transform: `translate3d(${p ? (1 - e) * -100 : (1 - e) * 100}%, 0, 0)`
1318
+ out: (n, s) => ({
1319
+ physics: l,
1320
+ css: (r) => ({
1321
+ transform: `translate3d(${a ? (1 - r) * -100 : (1 - r) * 100}%, 0, 0)`
1372
1322
  }),
1373
- prepare: (e) => {
1374
- m(e, c), e.style.willChange = "transform", e.style.backfaceVisibility = "hidden", e.style.contain = "layout paint", e.style.pointerEvents = "none";
1323
+ prepare: () => {
1324
+ g(n, s), n.style.willChange = "transform", n.style.backfaceVisibility = "hidden", n.style.contain = "layout paint", n.style.pointerEvents = "none";
1375
1325
  }
1376
1326
  })
1377
1327
  };
1378
- }, H = { stiffness: 17, damping: 6 }, _ = 20, O = 800, sn = () => {
1379
- let t, n = null;
1328
+ }, k = 8, Ut = {
1329
+ spring: {
1330
+ stiffness: 600,
1331
+ damping: 40,
1332
+ restDelta: 0.1,
1333
+ restSpeed: 1e14
1334
+ }
1335
+ }, is = (t = {}) => {
1336
+ const i = t.direction ?? "left", l = t.physics ?? Ut, a = i === "left";
1337
+ let { promise: n, resolve: s } = E();
1380
1338
  return {
1339
+ // Entering page: fades in + slides from opposite direction
1381
1340
  in: (r) => ({
1382
- spring: H,
1341
+ physics: l,
1383
1342
  prepare: () => {
1384
- r.style.willChange = "transform", r.style.backfaceVisibility = "hidden", r.style.contain = "layout paint", r.style.transform = `perspective(${O}px) rotateY(${_}deg) translate3d(-100%, 0, 0)`;
1343
+ r.style.opacity = "0", r.style.willChange = "transform, opacity", r.style.backfaceVisibility = "hidden", r.style.contain = "layout paint";
1385
1344
  },
1386
1345
  wait: async () => {
1387
- t && await t;
1346
+ if (n) {
1347
+ await n;
1348
+ const e = E();
1349
+ n = e.promise, s = e.resolve;
1350
+ }
1388
1351
  },
1389
- css: (p) => {
1390
- const a = (1 - p) * _, o = -(1 - p) * 100;
1352
+ css: (e) => {
1353
+ const c = a ? (1 - e) * k : (1 - e) * -k, y = `${e}`;
1391
1354
  return {
1392
- transform: `perspective(${O}px) rotateY(${a}deg) translate3d(${o}%, 0, 0)`
1355
+ transform: `translate3d(${c}px, 0, 0)`,
1356
+ opacity: y
1393
1357
  };
1394
1358
  },
1395
1359
  onEnd: () => {
1396
- r.style.transform = "", r.style.willChange = "auto", r.style.backfaceVisibility = "", r.style.contain = "";
1360
+ r.style.opacity = "1", r.style.willChange = "auto", r.style.backfaceVisibility = "", r.style.contain = "";
1397
1361
  }
1398
1362
  }),
1399
- out: (r, p) => (t = new Promise((a) => {
1400
- n = a;
1363
+ // Exiting page: fade out + slide in same direction as navigation
1364
+ out: (r, e) => ({
1365
+ physics: l,
1366
+ prepare: () => {
1367
+ g(r, e), r.style.willChange = "transform, opacity", r.style.backfaceVisibility = "hidden", r.style.contain = "layout paint", r.style.pointerEvents = "none";
1368
+ },
1369
+ css: (c) => {
1370
+ const y = a ? (1 - c) * -k : (1 - c) * k, o = `${c}`;
1371
+ return {
1372
+ transform: `translate3d(${y}px, 0, 0)`,
1373
+ opacity: o
1374
+ };
1375
+ },
1376
+ onEnd: () => {
1377
+ s && s(), r.style.willChange = "auto", r.style.backfaceVisibility = "", r.style.contain = "";
1378
+ }
1379
+ })
1380
+ };
1381
+ }, Ht = {
1382
+ spring: { stiffness: 17, damping: 6 }
1383
+ }, v = 20, L = 800, ns = (t = {}) => {
1384
+ const i = t.physics ?? Ht;
1385
+ let l, a = null;
1386
+ return {
1387
+ in: (n) => ({
1388
+ physics: i,
1389
+ prepare: () => {
1390
+ n.style.willChange = "transform", n.style.backfaceVisibility = "hidden", n.style.contain = "layout paint", n.style.transform = `perspective(${L}px) rotateY(${v}deg) translate3d(-100%, 0, 0)`;
1391
+ },
1392
+ wait: async () => {
1393
+ l && await l;
1394
+ },
1395
+ css: (s) => {
1396
+ const r = (1 - s) * v, e = -(1 - s) * 100;
1397
+ return {
1398
+ transform: `perspective(${L}px) rotateY(${r}deg) translate3d(${e}%, 0, 0)`
1399
+ };
1400
+ },
1401
+ onEnd: () => {
1402
+ n.style.transform = "", n.style.willChange = "auto", n.style.backfaceVisibility = "", n.style.contain = "";
1403
+ }
1404
+ }),
1405
+ out: (n, s) => (l = new Promise((r) => {
1406
+ a = r;
1401
1407
  }), {
1402
- spring: H,
1403
- prepare: (a) => {
1404
- m(a, p), a.style.willChange = "transform", a.style.backfaceVisibility = "hidden", a.style.contain = "layout paint", a.style.pointerEvents = "none", a.style.transform = `perspective(${O}px) rotateY(0deg) translate3d(0%, 0, 0)`;
1408
+ physics: i,
1409
+ prepare: () => {
1410
+ g(n, s), n.style.willChange = "transform", n.style.backfaceVisibility = "hidden", n.style.contain = "layout paint", n.style.pointerEvents = "none", n.style.transform = `perspective(${L}px) rotateY(0deg) translate3d(0%, 0, 0)`;
1405
1411
  },
1406
- css: (a) => {
1407
- const o = 1 - a, d = o * _, s = o * 100;
1412
+ css: (r) => {
1413
+ const e = 1 - r, c = e * v, y = e * 100;
1408
1414
  return {
1409
- transform: `perspective(${O}px) rotateY(${-d}deg) translate3d(${s}%, 0, 0)`
1415
+ transform: `perspective(${L}px) rotateY(${-c}deg) translate3d(${y}%, 0, 0)`
1410
1416
  };
1411
1417
  },
1412
1418
  onEnd: () => {
1413
- n && n(), r.style.transform = "";
1419
+ a && a(), n.style.transform = "";
1414
1420
  }
1415
1421
  })
1416
1422
  };
1417
- }, D = {
1418
- stiffness: 300,
1419
- damping: 22,
1420
- doubleSpring: 0.5
1421
- }, N = 0.05;
1422
- function Ht(t) {
1423
- const n = x(document.body, t.positionedParent), r = t.scroll.y, p = window.innerHeight - n.top;
1423
+ }, Xt = {
1424
+ spring: {
1425
+ stiffness: 600,
1426
+ damping: 40,
1427
+ restDelta: 0.1,
1428
+ restSpeed: 1e14
1429
+ }
1430
+ }, D = 0.05;
1431
+ function zt(t) {
1432
+ const i = x(document.body, t.positionedParent), l = t.scroll.y, a = window.innerHeight - i.top;
1424
1433
  return {
1425
- top: r,
1434
+ top: l,
1426
1435
  left: 0,
1427
- width: n.width,
1428
- height: p
1436
+ width: i.width,
1437
+ height: a
1429
1438
  };
1430
1439
  }
1431
- const en = (t = {}) => {
1432
- var a, o, d;
1433
- const n = {
1434
- stiffness: ((a = t.spring) == null ? void 0 : a.stiffness) ?? D.stiffness,
1435
- damping: ((o = t.spring) == null ? void 0 : o.damping) ?? D.damping,
1436
- doubleSpring: ((d = t.spring) == null ? void 0 : d.doubleSpring) ?? D.doubleSpring
1437
- };
1438
- let { promise: r, resolve: p } = S();
1440
+ const es = (t = {}) => {
1441
+ const i = t.physics ?? Xt;
1442
+ let { promise: l, resolve: a } = E();
1439
1443
  return {
1440
1444
  // Entering page: scales up from small (0.95 → 1) with fade in
1441
- in: (s, c) => {
1442
- const e = Ht(c), i = e.left + e.width / 2, y = e.top + e.height / 2;
1445
+ in: (n, s) => {
1446
+ const r = zt(s), e = r.left + r.width / 2, c = r.top + r.height / 2;
1443
1447
  return {
1444
- spring: n,
1448
+ physics: i,
1445
1449
  prepare: () => {
1446
- s.style.opacity = "0", s.style.willChange = "transform, opacity", s.style.backfaceVisibility = "hidden", s.style.contain = "layout paint", s.style.transformOrigin = `${i}px ${y}px`;
1450
+ n.style.opacity = "0", n.style.willChange = "transform, opacity", n.style.backfaceVisibility = "hidden", n.style.contain = "layout paint", n.style.transformOrigin = `${e}px ${c}px`;
1447
1451
  },
1448
1452
  wait: async () => {
1449
- if (r) {
1450
- await r;
1451
- const h = S();
1452
- r = h.promise, p = h.resolve;
1453
+ if (l) {
1454
+ await l;
1455
+ const y = E();
1456
+ l = y.promise, a = y.resolve;
1453
1457
  }
1454
1458
  },
1455
- css: (h) => ({
1456
- transform: `scale(${1 - N + h * N})`,
1457
- opacity: h
1459
+ css: (y) => ({
1460
+ transform: `scale(${1 - D + y * D})`,
1461
+ opacity: y
1458
1462
  }),
1459
1463
  onEnd: () => {
1460
- s.style.opacity = "1", s.style.willChange = "auto", s.style.backfaceVisibility = "", s.style.contain = "", s.style.transformOrigin = "";
1464
+ n.style.opacity = "1", n.style.willChange = "auto", n.style.backfaceVisibility = "", n.style.contain = "", n.style.transformOrigin = "";
1461
1465
  }
1462
1466
  };
1463
1467
  },
1464
1468
  // Exiting page: fade out only (no scale)
1465
- out: (s, c) => ({
1466
- spring: n,
1467
- prepare: (e) => {
1468
- m(e, c), e.style.willChange = "opacity", e.style.backfaceVisibility = "hidden", e.style.contain = "layout paint", e.style.pointerEvents = "none";
1469
+ out: (n, s) => ({
1470
+ physics: i,
1471
+ prepare: () => {
1472
+ g(n, s), n.style.willChange = "opacity", n.style.backfaceVisibility = "hidden", n.style.contain = "layout paint", n.style.pointerEvents = "none";
1469
1473
  },
1470
- css: (e) => ({
1471
- opacity: e
1474
+ css: (r) => ({
1475
+ opacity: r
1472
1476
  }),
1473
1477
  onEnd: () => {
1474
- p && p();
1478
+ a && a();
1475
1479
  }
1476
1480
  })
1477
1481
  };
1478
1482
  };
1479
1483
  export {
1480
- Nt as blind,
1481
- Wt as curtainReveal,
1482
- Mt as depth,
1483
- Gt as drill,
1484
- Bt as fade,
1485
- qt as film,
1486
- jt as hero,
1484
+ Wt as blind,
1485
+ Mt as curtainReveal,
1486
+ Bt as depth,
1487
+ qt as drill,
1488
+ jt as fade,
1489
+ Nt as film,
1490
+ Gt as hero,
1487
1491
  Zt as instagram,
1488
1492
  Jt as jaemin,
1489
1493
  Kt as pinterest,
1490
1494
  Qt as rotate,
1491
1495
  Rt as scroll,
1492
- tn as sheet,
1493
- nn as slide,
1494
- sn as strip,
1495
- en as swap
1496
+ ts as sheet,
1497
+ ss as slide,
1498
+ is as snap,
1499
+ ns as strip,
1500
+ es as swap
1496
1501
  };