@wix/interact 2.5.13 → 2.5.15

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.
@@ -1,30 +1,22 @@
1
- function _t(e) {
1
+ function At(e) {
2
2
  return [...e.matchAll(/\[([-\w]+)]/g)].map(([t, n]) => n);
3
3
  }
4
- function _(e, t) {
5
- const n = _t(t);
4
+ function q(e, t) {
5
+ const n = At(t);
6
6
  let s = 0;
7
7
  return n.length ? e.replace(/\[]/g, () => {
8
8
  const i = n[s++];
9
9
  return i !== void 0 ? `[${i}]` : "[]";
10
10
  }) : e;
11
11
  }
12
- function kt(e, t) {
13
- return e.trigger === "viewEnter" && t.triggerType === "once" && V(e) === V(t);
12
+ function qt(e, t) {
13
+ return e.trigger === "viewEnter" && t.triggerType === "once" && ue(e) === ue(t);
14
14
  }
15
- function V(e) {
15
+ function ue(e) {
16
16
  const { key: t, listContainer: n, listItemSelector: s, selector: i } = e;
17
17
  return `${t}\0${n || ""}\0${s || ""}\0${i || ""}`;
18
18
  }
19
- function Ye(e) {
20
- let t = 0, n = 0;
21
- for (let s = 0; s < e.length; s++) {
22
- const i = e.charCodeAt(s);
23
- t = (t << 5) - t + i | 0, n = n << 3 ^ n >>> 2 ^ i | 0;
24
- }
25
- return ((t >>> 0) * 1048576 + (n >>> 0) % 1048576).toString(36);
26
- }
27
- class K {
19
+ class Q {
28
20
  animations;
29
21
  options;
30
22
  ready;
@@ -60,8 +52,8 @@ class K {
60
52
  }
61
53
  progress(t) {
62
54
  for (const n of this.animations) {
63
- const { delay: s, duration: i, iterations: r } = n.effect.getTiming(), o = (Number.isFinite(i) ? i : 0) * (Number.isFinite(r) ? r : 1);
64
- n.currentTime = ((s || 0) + o) * t;
55
+ const { delay: s, duration: i, iterations: o } = n.effect.getTiming(), r = (Number.isFinite(i) ? i : 0) * (Number.isFinite(o) ? o : 1);
56
+ n.currentTime = ((s || 0) + r) * t;
65
57
  }
66
58
  }
67
59
  cancel() {
@@ -79,8 +71,8 @@ class K {
79
71
  if (n && !this.isCSS) {
80
72
  const s = n.effect?.target;
81
73
  if (s) {
82
- const i = this.options?.effectId || n.id, r = new CustomEvent("animationend", { detail: { effectId: i } });
83
- s.dispatchEvent(r);
74
+ const i = this.options?.effectId || n.id, o = new CustomEvent("animationend", { detail: { effectId: i } });
75
+ s.dispatchEvent(o);
84
76
  }
85
77
  }
86
78
  t();
@@ -97,8 +89,8 @@ class K {
97
89
  if (s && !this.isCSS) {
98
90
  const i = s.effect?.target;
99
91
  if (i) {
100
- const r = new Event("animationcancel");
101
- i.dispatchEvent(r);
92
+ const o = new Event("animationcancel");
93
+ i.dispatchEvent(o);
102
94
  }
103
95
  }
104
96
  t();
@@ -119,73 +111,73 @@ class K {
119
111
  }
120
112
  getTimingOptions() {
121
113
  return this.animations.map((t) => {
122
- const n = t.effect?.getTiming(), s = n?.delay ?? 0, i = Number(n?.duration) || 0, r = n?.iterations ?? 1;
114
+ const n = t.effect?.getTiming(), s = n?.delay ?? 0, i = Number(n?.duration) || 0, o = n?.iterations ?? 1;
123
115
  return {
124
116
  delay: s,
125
117
  duration: i,
126
- iterations: r
118
+ iterations: o
127
119
  };
128
120
  });
129
121
  }
130
122
  }
131
- const Be = (e) => e, Pt = (e) => 1 - Math.cos(e * Math.PI / 2), Mt = (e) => Math.sin(e * Math.PI / 2), xt = (e) => -(Math.cos(Math.PI * e) - 1) / 2, Lt = (e) => e ** 2, Ft = (e) => 1 - (1 - e) ** 2, Rt = (e) => e < 0.5 ? 2 * e ** 2 : 1 - (-2 * e + 2) ** 2 / 2, Nt = (e) => e ** 3, zt = (e) => 1 - (1 - e) ** 3, jt = (e) => e < 0.5 ? 4 * e ** 3 : 1 - (-2 * e + 2) ** 3 / 2, Dt = (e) => e ** 4, Gt = (e) => 1 - (1 - e) ** 4, Ht = (e) => e < 0.5 ? 8 * e ** 4 : 1 - (-2 * e + 2) ** 4 / 2, Wt = (e) => e ** 5, Vt = (e) => 1 - (1 - e) ** 5, Yt = (e) => e < 0.5 ? 16 * e ** 5 : 1 - (-2 * e + 2) ** 5 / 2, Bt = (e) => e === 0 ? 0 : 2 ** (10 * e - 10), Kt = (e) => e === 1 ? 1 : 1 - 2 ** (-10 * e), Ut = (e) => e === 0 ? 0 : e === 1 ? 1 : e < 0.5 ? 2 ** (20 * e - 10) / 2 : (2 - 2 ** (-20 * e + 10)) / 2, Qt = (e) => 1 - Math.sqrt(1 - e ** 2), Xt = (e) => Math.sqrt(1 - (e - 1) ** 2), Zt = (e) => e < 0.5 ? (1 - Math.sqrt(1 - 4 * e ** 2)) / 2 : (Math.sqrt(-(2 * e - 3) * (2 * e - 1)) + 1) / 2, Jt = (e) => 2.70158 * e ** 3 - 1.70158 * e ** 2, en = (e) => 1 + 2.70158 * (e - 1) ** 3 + 1.70158 * (e - 1) ** 2, tn = (e, t = 1.70158 * 1.525) => e < 0.5 ? (2 * e) ** 2 * ((t + 1) * 2 * e - t) / 2 : ((2 * e - 2) ** 2 * ((t + 1) * (e * 2 - 2) + t) + 2) / 2, qe = {
132
- linear: Be,
133
- sineIn: Pt,
123
+ const Qe = (e) => e, kt = (e) => 1 - Math.cos(e * Math.PI / 2), Mt = (e) => Math.sin(e * Math.PI / 2), Pt = (e) => -(Math.cos(Math.PI * e) - 1) / 2, xt = (e) => e ** 2, Lt = (e) => 1 - (1 - e) ** 2, Ft = (e) => e < 0.5 ? 2 * e ** 2 : 1 - (-2 * e + 2) ** 2 / 2, Rt = (e) => e ** 3, Nt = (e) => 1 - (1 - e) ** 3, zt = (e) => e < 0.5 ? 4 * e ** 3 : 1 - (-2 * e + 2) ** 3 / 2, jt = (e) => e ** 4, Dt = (e) => 1 - (1 - e) ** 4, Ht = (e) => e < 0.5 ? 8 * e ** 4 : 1 - (-2 * e + 2) ** 4 / 2, Gt = (e) => e ** 5, Wt = (e) => 1 - (1 - e) ** 5, Vt = (e) => e < 0.5 ? 16 * e ** 5 : 1 - (-2 * e + 2) ** 5 / 2, Yt = (e) => e === 0 ? 0 : 2 ** (10 * e - 10), Kt = (e) => e === 1 ? 1 : 1 - 2 ** (-10 * e), Bt = (e) => e === 0 ? 0 : e === 1 ? 1 : e < 0.5 ? 2 ** (20 * e - 10) / 2 : (2 - 2 ** (-20 * e + 10)) / 2, Ut = (e) => 1 - Math.sqrt(1 - e ** 2), Qt = (e) => Math.sqrt(1 - (e - 1) ** 2), Xt = (e) => e < 0.5 ? (1 - Math.sqrt(1 - 4 * e ** 2)) / 2 : (Math.sqrt(-(2 * e - 3) * (2 * e - 1)) + 1) / 2, Zt = (e) => 2.70158 * e ** 3 - 1.70158 * e ** 2, Jt = (e) => 1 + 2.70158 * (e - 1) ** 3 + 1.70158 * (e - 1) ** 2, en = (e, t = 1.70158 * 1.525) => e < 0.5 ? (2 * e) ** 2 * ((t + 1) * 2 * e - t) / 2 : ((2 * e - 2) ** 2 * ((t + 1) * (e * 2 - 2) + t) + 2) / 2, Pe = {
124
+ linear: Qe,
125
+ sineIn: kt,
134
126
  sineOut: Mt,
135
- sineInOut: xt,
136
- quadIn: Lt,
137
- quadOut: Ft,
138
- quadInOut: Rt,
139
- cubicIn: Nt,
140
- cubicOut: zt,
141
- cubicInOut: jt,
142
- quartIn: Dt,
143
- quartOut: Gt,
127
+ sineInOut: Pt,
128
+ quadIn: xt,
129
+ quadOut: Lt,
130
+ quadInOut: Ft,
131
+ cubicIn: Rt,
132
+ cubicOut: Nt,
133
+ cubicInOut: zt,
134
+ quartIn: jt,
135
+ quartOut: Dt,
144
136
  quartInOut: Ht,
145
- quintIn: Wt,
146
- quintOut: Vt,
147
- quintInOut: Yt,
148
- expoIn: Bt,
137
+ quintIn: Gt,
138
+ quintOut: Wt,
139
+ quintInOut: Vt,
140
+ expoIn: Yt,
149
141
  expoOut: Kt,
150
- expoInOut: Ut,
151
- circIn: Qt,
152
- circOut: Xt,
153
- circInOut: Zt,
154
- backIn: Jt,
155
- backOut: en,
156
- backInOut: tn
157
- }, j = (e, t, n, s, i) => {
158
- const r = 3 * t, o = 3 * (s - 2 * t), c = 1 - 3 * s + 3 * t, a = 3 * n, f = 3 * (i - 2 * n), u = 1 - 3 * i + 3 * n;
142
+ expoInOut: Bt,
143
+ circIn: Ut,
144
+ circOut: Qt,
145
+ circInOut: Xt,
146
+ backIn: Zt,
147
+ backOut: Jt,
148
+ backInOut: en
149
+ }, G = (e, t, n, s, i) => {
150
+ const o = 3 * t, r = 3 * (s - 2 * t), a = 1 - 3 * s + 3 * t, c = 3 * n, f = 3 * (i - 2 * n), u = 1 - 3 * i + 3 * n;
159
151
  let l;
160
- if (c === 0)
161
- l = o === 0 ? `(${e} / ${r})` : `((sqrt(max(0, ${r * r} + ${4 * o} * ${e})) - ${r}) / ${2 * o})`;
152
+ if (a === 0)
153
+ l = r === 0 ? `(${e} / ${o})` : `((sqrt(max(0, ${o * o} + ${4 * r} * ${e})) - ${o}) / ${2 * r})`;
162
154
  else {
163
- const d = o / (3 * c), v = 2 * Math.pow(o, 3) - 9 * r * o * c, h = 54 * Math.pow(c, 3), m = (3 * c * r - o * o) / (9 * c * c), p = `((${v} - ${27 * c * c} * ${e}) / ${h})`;
164
- if (m < 0) {
165
- const g = 2 * Math.sqrt(-m);
166
- let E = 0;
167
- for (const w of [0, 1, 2])
155
+ const d = r / (3 * a), m = 2 * Math.pow(r, 3) - 9 * o * r * a, h = 54 * Math.pow(a, 3), p = (3 * a * o - r * r) / (9 * a * a), g = `((${m} - ${27 * a * a} * ${e}) / ${h})`;
156
+ if (p < 0) {
157
+ const v = 2 * Math.sqrt(-p);
158
+ let y = 0;
159
+ for (const $ of [0, 1, 2])
168
160
  [0, 0.25, 0.5, 0.75, 1].every((S) => {
169
161
  const I = Math.min(
170
- Math.max(2 * (v - 27 * c * c * S) / (h * m * g), -1),
162
+ Math.max(2 * (m - 27 * a * a * S) / (h * p * v), -1),
171
163
  1
172
- ), T = g * Math.cos((Math.acos(I) - w * 2 * Math.PI) / 3) - d;
173
- return T >= -1e-6 && T <= 1.000001;
174
- }) && (E = w);
175
- const y = `(acos(clamp(-1, ${2 / (m * g)} * ${p}, 1)) - ${360 * E}deg) / 3`;
176
- l = `(${g} * cos(${y}) - ${d})`;
164
+ ), O = v * Math.cos((Math.acos(I) - $ * 2 * Math.PI) / 3) - d;
165
+ return O >= -1e-6 && O <= 1.000001;
166
+ }) && (y = $);
167
+ const E = `(acos(clamp(-1, ${2 / (p * v)} * ${g}, 1)) - ${360 * y}deg) / 3`;
168
+ l = `(${v} * cos(${E}) - ${d})`;
177
169
  } else {
178
- const g = `sqrt(pow(${p}, 2) + ${Math.pow(m, 3)})`;
179
- l = `(pow(${g} - ${p}, 1 / 3) - pow(${g} + ${p}, 1 / 3) - ${d})`;
170
+ const v = `sqrt(pow(${g}, 2) + ${Math.pow(p, 3)})`;
171
+ l = `(pow(${v} - ${g}, 1 / 3) - pow(${v} + ${g}, 1 / 3) - ${d})`;
180
172
  }
181
173
  }
182
- return `(${u} * pow(${l}, 3) + ${f} * pow(${l}, 2) + ${a} * ${l})`;
183
- }, _e = {
174
+ return `(${u} * pow(${l}, 3) + ${f} * pow(${l}, 2) + ${c} * ${l})`;
175
+ }, xe = {
184
176
  linear: (e) => e,
185
- ease: (e) => j(e, 0.25, 0.1, 0.25, 1),
186
- easeIn: (e) => j(e, 0.42, 0, 1, 1),
187
- easeOut: (e) => j(e, 0, 0, 0.58, 1),
188
- easeInOut: (e) => j(e, 0.42, 0, 0.58, 1),
177
+ ease: (e) => G(e, 0.25, 0.1, 0.25, 1),
178
+ easeIn: (e) => G(e, 0.42, 0, 1, 1),
179
+ easeOut: (e) => G(e, 0, 0, 0.58, 1),
180
+ easeInOut: (e) => G(e, 0.42, 0, 0.58, 1),
189
181
  sineIn: (e) => `(1 - cos(${e} * 90deg))`,
190
182
  sineOut: (e) => `(sin(${e} * 90deg))`,
191
183
  sineInOut: (e) => `((1 - cos(${e} * 180deg)) / 2)`,
@@ -210,7 +202,7 @@ const Be = (e) => e, Pt = (e) => 1 - Math.cos(e * Math.PI / 2), Mt = (e) => Math
210
202
  backIn: (e) => `(2.70158 * pow(${e}, 3) - 1.70158 * ${e} * ${e})`,
211
203
  backOut: (e) => `(1 + 2.70158 * pow(${e} - 1, 3) + 1.70158 * (${e} - 1) * (${e} - 1))`,
212
204
  backInOut: (e) => `((round(${e}) * (2 + (2 * ${e} - 2) * (2 * ${e} - 2) * (2.5949095 + 3.5949095 * (2 * ${e} - 2))) + (1 - round(${e})) * 4 * ${e} * ${e} * (3.5949095 * 2 * ${e} - 2.5949095)) / 2)`
213
- }, ke = {
205
+ }, Le = {
214
206
  linear: "linear",
215
207
  ease: "ease",
216
208
  easeIn: "ease-in",
@@ -241,26 +233,26 @@ const Be = (e) => e, Pt = (e) => 1 - Math.cos(e * Math.PI / 2), Mt = (e) => Math
241
233
  backOut: "cubic-bezier(0.175, 0.885, 0.32, 1.275)",
242
234
  backInOut: "cubic-bezier(0.68, -0.55, 0.265, 1.55)"
243
235
  };
244
- function nn(e) {
236
+ function tn(e) {
245
237
  return e === "percentage" ? "%" : e || "px";
246
238
  }
247
- const sn = /^(webkit|moz|ms|o)(?=[A-Z])/, rn = Object.assign(/* @__PURE__ */ Object.create(null), {
239
+ const nn = /^(webkit|moz|ms|o)(?=[A-Z])/, sn = Object.assign(/* @__PURE__ */ Object.create(null), {
248
240
  float: "cssFloat",
249
241
  "animation-timing-function": "easing",
250
242
  "animation-composition": "composite"
251
243
  });
252
- function ue(e) {
253
- return e.startsWith("--") ? e : (sn.test(e) ? `-${e}` : e).replace(/[A-Z]/g, (n) => `-${n.toLowerCase()}`);
244
+ function fe(e) {
245
+ return e.startsWith("--") ? e : (nn.test(e) ? `-${e}` : e).replace(/[A-Z]/g, (n) => `-${n.toLowerCase()}`);
254
246
  }
255
247
  function on(e) {
256
248
  return e.startsWith("--") || !e.includes("-") ? e : e.replace(/^-/, "").replace(/-([a-z])/g, (t, n) => n.toUpperCase());
257
249
  }
258
- function Ke(e) {
259
- return rn[e] || on(e);
250
+ function Xe(e) {
251
+ return sn[e] || on(e);
260
252
  }
261
- function cn(e) {
253
+ function rn(e) {
262
254
  for (const t in e)
263
- if (Object.hasOwn(e, t) && Ke(t) !== t)
255
+ if (Object.hasOwn(e, t) && Xe(t) !== t)
264
256
  return !0;
265
257
  return !1;
266
258
  }
@@ -269,138 +261,138 @@ function an(e) {
269
261
  return e;
270
262
  let t;
271
263
  return e.forEach((n, s) => {
272
- if (!n || typeof n != "object" || !cn(n))
264
+ if (!n || typeof n != "object" || !rn(n))
273
265
  return;
274
266
  t ??= e.slice();
275
267
  const i = {};
276
- for (const r in n)
277
- Object.hasOwn(n, r) && (i[Ke(r)] = n[r]);
268
+ for (const o in n)
269
+ Object.hasOwn(n, o) && (i[Xe(o)] = n[o]);
278
270
  t[s] = i;
279
271
  }), t || e;
280
272
  }
281
- function se(e) {
282
- return e ? ke[e] || e : ke.linear;
283
- }
284
- function un(e, t, n, s) {
285
- const i = 3 * e, r = 3 * (n - e) - i, o = 1 - i - r, c = 3 * t, a = 3 * (s - t) - c, f = 1 - c - a, u = (h) => ((o * h + r) * h + i) * h, l = (h) => ((f * h + a) * h + c) * h, d = (h) => (3 * o * h + 2 * r) * h + i;
286
- function v(h) {
287
- let m = h;
288
- for (let E = 0; E < 8; E++) {
289
- const y = u(m) - h;
290
- if (Math.abs(y) < 1e-7) return m;
291
- const w = d(m);
292
- if (Math.abs(w) < 1e-6) break;
293
- m -= y / w;
273
+ function oe(e) {
274
+ return e ? Le[e] || e : Le.linear;
275
+ }
276
+ function cn(e, t, n, s) {
277
+ const i = 3 * e, o = 3 * (n - e) - i, r = 1 - i - o, a = 3 * t, c = 3 * (s - t) - a, f = 1 - a - c, u = (h) => ((r * h + o) * h + i) * h, l = (h) => ((f * h + c) * h + a) * h, d = (h) => (3 * r * h + 2 * o) * h + i;
278
+ function m(h) {
279
+ let p = h;
280
+ for (let y = 0; y < 8; y++) {
281
+ const E = u(p) - h;
282
+ if (Math.abs(E) < 1e-7) return p;
283
+ const $ = d(p);
284
+ if (Math.abs($) < 1e-6) break;
285
+ p -= E / $;
294
286
  }
295
- let p = 0, g = 1;
296
- for (m = (p + g) / 2; g - p > 1e-7; ) {
297
- const E = u(m);
298
- if (Math.abs(E - h) < 1e-7) return m;
299
- h > E ? p = m : g = m, m = (p + g) / 2;
287
+ let g = 0, v = 1;
288
+ for (p = (g + v) / 2; v - g > 1e-7; ) {
289
+ const y = u(p);
290
+ if (Math.abs(y - h) < 1e-7) return p;
291
+ h > y ? g = p : v = p, p = (g + v) / 2;
300
292
  }
301
- return m;
293
+ return p;
302
294
  }
303
- return (h) => h <= 0 ? 0 : h >= 1 ? 1 : l(v(h));
295
+ return (h) => h <= 0 ? 0 : h >= 1 ? 1 : l(m(h));
304
296
  }
305
- function Ue(e) {
297
+ function Ze(e) {
306
298
  const t = e.match(
307
299
  /^cubic-bezier\(\s*(-?[\d.]+)\s*,\s*(-?[\d.]+)\s*,\s*(-?[\d.]+)\s*,\s*(-?[\d.]+)\s*\)$/
308
300
  );
309
301
  if (!t) return;
310
- const n = parseFloat(t[1]), s = parseFloat(t[2]), i = parseFloat(t[3]), r = parseFloat(t[4]);
311
- if (![n, s, i, r].some(isNaN))
312
- return [n, s, i, r];
302
+ const n = parseFloat(t[1]), s = parseFloat(t[2]), i = parseFloat(t[3]), o = parseFloat(t[4]);
303
+ if (![n, s, i, o].some(isNaN))
304
+ return [n, s, i, o];
313
305
  }
314
- function fn(e) {
315
- const t = Ue(e);
306
+ function un(e) {
307
+ const t = Ze(e);
316
308
  if (!(!t || t.some(isNaN)))
317
- return un(...t);
309
+ return cn(...t);
318
310
  }
319
- function ln(e) {
320
- const t = Ue(e);
311
+ function fn(e) {
312
+ const t = Ze(e);
321
313
  if (!(!t || t.some(isNaN)))
322
- return (n) => j(n, ...t);
314
+ return (n) => G(n, ...t);
323
315
  }
324
- function Qe(e) {
316
+ function Je(e) {
325
317
  const t = e.match(/^linear\((.+)\)$/);
326
318
  if (!t) return;
327
- const n = t[1].split(",").map((r) => r.trim()).filter(Boolean);
319
+ const n = t[1].split(",").map((o) => o.trim()).filter(Boolean);
328
320
  if (n.length === 0) return;
329
321
  const s = [];
330
- for (const r of n) {
331
- const o = r.split(/\s+/), c = parseFloat(o[0]);
332
- if (isNaN(c)) return;
333
- const a = [];
334
- for (let f = 1; f < o.length; f++)
335
- if (o[f].endsWith("%")) {
336
- const u = parseFloat(o[f]) / 100;
322
+ for (const o of n) {
323
+ const r = o.split(/\s+/), a = parseFloat(r[0]);
324
+ if (isNaN(a)) return;
325
+ const c = [];
326
+ for (let f = 1; f < r.length; f++)
327
+ if (r[f].endsWith("%")) {
328
+ const u = parseFloat(r[f]) / 100;
337
329
  if (isNaN(u)) return;
338
- a.push(u);
330
+ c.push(u);
339
331
  }
340
- a.length === 0 ? s.push({ output: c, pos: null }) : a.length === 1 ? s.push({ output: c, pos: a[0] }) : (s.push({ output: c, pos: a[0] }), s.push({ output: c, pos: a[1] }));
332
+ c.length === 0 ? s.push({ output: a, pos: null }) : c.length === 1 ? s.push({ output: a, pos: c[0] }) : (s.push({ output: a, pos: c[0] }), s.push({ output: a, pos: c[1] }));
341
333
  }
342
334
  if (s.length === 0) return;
343
335
  s[0].pos === null && (s[0].pos = 0), s[s.length - 1].pos === null && (s[s.length - 1].pos = 1);
344
336
  let i = 0;
345
337
  for (; i < s.length; )
346
338
  if (s[i].pos === null) {
347
- const r = i - 1;
348
- let o = i;
349
- for (; o < s.length && s[o].pos === null; ) o++;
350
- const c = s[r].pos, a = s[o].pos, f = o - r;
351
- for (let u = r + 1; u < o; u++)
352
- s[u].pos = c + (a - c) * (u - r) / f;
353
- i = o + 1;
339
+ const o = i - 1;
340
+ let r = i;
341
+ for (; r < s.length && s[r].pos === null; ) r++;
342
+ const a = s[o].pos, c = s[r].pos, f = r - o;
343
+ for (let u = o + 1; u < r; u++)
344
+ s[u].pos = a + (c - a) * (u - o) / f;
345
+ i = r + 1;
354
346
  } else
355
347
  i++;
356
- for (let r = 1; r < s.length; r++)
357
- s[r].pos < s[r - 1].pos && (s[r].pos = s[r - 1].pos);
348
+ for (let o = 1; o < s.length; o++)
349
+ s[o].pos < s[o - 1].pos && (s[o].pos = s[o - 1].pos);
358
350
  return s;
359
351
  }
360
- function dn(e) {
361
- const t = Qe(e);
352
+ function ln(e) {
353
+ const t = Je(e);
362
354
  if (t)
363
355
  return (n) => {
364
356
  if (n <= t[0].pos) return t[0].output;
365
357
  const s = t[t.length - 1];
366
358
  if (n >= s.pos) return s.output;
367
- let i = 0, r = t.length - 1;
368
- for (; i < r - 1; ) {
369
- const a = i + r >>> 1;
370
- t[a].pos <= n ? i = a : r = a;
359
+ let i = 0, o = t.length - 1;
360
+ for (; i < o - 1; ) {
361
+ const c = i + o >>> 1;
362
+ t[c].pos <= n ? i = c : o = c;
371
363
  }
372
- const o = t[i], c = t[r];
373
- return c.pos === o.pos ? c.output : o.output + (c.output - o.output) * (n - o.pos) / (c.pos - o.pos);
364
+ const r = t[i], a = t[o];
365
+ return a.pos === r.pos ? a.output : r.output + (a.output - r.output) * (n - r.pos) / (a.pos - r.pos);
374
366
  };
375
367
  }
376
- function hn(e) {
377
- const t = Qe(e);
368
+ function dn(e) {
369
+ const t = Je(e);
378
370
  if (t)
379
371
  return (n) => {
380
372
  const s = [`${t[0].output}`];
381
373
  for (let i = 1; i < t.length; i++) {
382
- const r = t[i].pos - t[i - 1].pos, o = t[i].output - t[i - 1].output;
383
- if (r === 0 && t[i - 1].pos === 0)
384
- s.push(`${o}`);
374
+ const o = t[i].pos - t[i - 1].pos, r = t[i].output - t[i - 1].output;
375
+ if (o === 0 && t[i - 1].pos === 0)
376
+ s.push(`${r}`);
385
377
  else {
386
- const c = r === 0 ? `round(${n} / ${2 * t[i - 1].pos})` : `(${n} - ${t[i - 1].pos}) / ${r}`;
387
- s.push(`clamp(0, ${c}, 1) * ${o}`);
378
+ const a = o === 0 ? `round(${n} / ${2 * t[i - 1].pos})` : `(${n} - ${t[i - 1].pos}) / ${o}`;
379
+ s.push(`clamp(0, ${a}, 1) * ${r}`);
388
380
  }
389
381
  }
390
382
  return `(${s.join(" + ")})`;
391
383
  };
392
384
  }
393
- function Xe(e) {
385
+ function et(e) {
394
386
  if (!e) return;
395
- const t = qe[e];
396
- return t || (fn(e) ?? dn(e) ?? qe.linear);
387
+ const t = Pe[e];
388
+ return t || (un(e) ?? ln(e) ?? Pe.linear);
397
389
  }
398
- function mn(e) {
390
+ function hn(e) {
399
391
  if (!e) return;
400
- const t = _e[e];
401
- return t || (ln(e) ?? hn(e) ?? _e.linear);
392
+ const t = xe[e];
393
+ return t || (fn(e) ?? dn(e) ?? xe.linear);
402
394
  }
403
- class pn extends K {
395
+ class mn extends Q {
404
396
  animationGroups;
405
397
  delay;
406
398
  offset;
@@ -409,10 +401,10 @@ class pn extends K {
409
401
  timingOptions;
410
402
  constructor(t, n = {}) {
411
403
  const s = t.flatMap((i) => [...i.animations]);
412
- super(s), this.animationGroups = t, this.delay = n.delay ?? 0, this.offset = n.offset ?? 0, this.sequenceId = n.sequenceId, this.offsetEasing = typeof n.offsetEasing == "function" ? n.offsetEasing : Xe(n.offsetEasing) ?? Be, this.timingOptions = this.animationGroups.map((i) => i.getTimingOptions().map(({ delay: r, duration: o, iterations: c }) => ({
413
- delay: r,
414
- duration: Number.isFinite(o) ? o : 0,
415
- iterations: Number.isFinite(c) ? c : 1
404
+ super(s), this.animationGroups = t, this.delay = n.delay ?? 0, this.offset = n.offset ?? 0, this.sequenceId = n.sequenceId, this.offsetEasing = typeof n.offsetEasing == "function" ? n.offsetEasing : et(n.offsetEasing) ?? Qe, this.timingOptions = this.animationGroups.map((i) => i.getTimingOptions().map(({ delay: o, duration: r, iterations: a }) => ({
405
+ delay: o,
406
+ duration: Number.isFinite(r) ? r : 0,
407
+ iterations: Number.isFinite(a) ? a : 1
416
408
  }))), this.applyOffsets(), this.ready = Promise.all(t.map((i) => i.ready)).then(() => {
417
409
  });
418
410
  }
@@ -433,26 +425,26 @@ class pn extends K {
433
425
  applyOffsets() {
434
426
  if (this.animationGroups.length === 0 || this.animations.length === 0) return;
435
427
  const t = this.calculateOffsets(), n = this.getSequenceActiveDuration(t), s = this.animationGroups.length - 1;
436
- this.animationGroups.forEach((i, r) => {
437
- i.animations.forEach((o, c) => {
438
- const a = o.effect;
439
- if (!a) return;
440
- const { delay: f, duration: u, iterations: l } = this.timingOptions[r][c], d = f + t[r], v = n - (d + u * l);
428
+ this.animationGroups.forEach((i, o) => {
429
+ i.animations.forEach((r, a) => {
430
+ const c = r.effect;
431
+ if (!c) return;
432
+ const { delay: f, duration: u, iterations: l } = this.timingOptions[o][a], d = f + t[o], m = n - (d + u * l);
441
433
  if (i.isCSS && this.sequenceId) {
442
- const { target: h } = a;
443
- h instanceof HTMLElement && (h.style.setProperty(`--motion-${this.sequenceId}-index`, `${r}`), h.style.setProperty(`--motion-${this.sequenceId}-last`, `${s}`)), a.updateTiming({ endDelay: v });
434
+ const { target: h } = c;
435
+ h instanceof HTMLElement && (h.style.setProperty(`--motion-${this.sequenceId}-index`, `${o}`), h.style.setProperty(`--motion-${this.sequenceId}-last`, `${s}`)), c.updateTiming({ endDelay: m });
444
436
  } else
445
- a.updateTiming({ delay: d + this.delay, endDelay: v });
437
+ c.updateTiming({ delay: d + this.delay, endDelay: m });
446
438
  });
447
439
  });
448
440
  }
449
441
  getSequenceActiveDuration(t) {
450
442
  const n = [];
451
443
  for (let s = 0; s < this.timingOptions.length; s++) {
452
- const i = this.timingOptions[s].reduce((r, o) => {
453
- if (!o) return r;
454
- const { delay: c, duration: a, iterations: f } = o;
455
- return Math.max(r, c + a * f);
444
+ const i = this.timingOptions[s].reduce((o, r) => {
445
+ if (!r) return o;
446
+ const { delay: a, duration: c, iterations: f } = r;
447
+ return Math.max(o, a + c * f);
456
448
  }, 0);
457
449
  n.push(t[s] + i);
458
450
  }
@@ -467,10 +459,10 @@ class pn extends K {
467
459
  if (t.length === 0) return;
468
460
  const n = [...t].sort((s, i) => i.index - s.index);
469
461
  for (const { index: s, group: i } of n) {
470
- const r = Math.min(s, this.animationGroups.length);
471
- this.animationGroups.splice(r, 0, i), this.timingOptions.splice(r, 0, i.getTimingOptions());
472
- const o = [...i.animations], c = this.animationGroups.slice(0, r).reduce((a, f) => a + f.animations.length, 0);
473
- this.animations.splice(c, 0, ...o);
462
+ const o = Math.min(s, this.animationGroups.length);
463
+ this.animationGroups.splice(o, 0, i), this.timingOptions.splice(o, 0, i.getTimingOptions());
464
+ const r = [...i.animations], a = this.animationGroups.slice(0, o).reduce((c, f) => c + f.animations.length, 0);
465
+ this.animations.splice(a, 0, ...r);
474
466
  }
475
467
  this.applyOffsets(), this.ready = Promise.all(this.animationGroups.map((s) => s.ready)).then(() => {
476
468
  });
@@ -482,12 +474,12 @@ class pn extends K {
482
474
  */
483
475
  removeGroups(t) {
484
476
  const n = [], s = [], i = [];
485
- for (let r = 0; r < this.animationGroups.length; r++)
486
- t(this.animationGroups[r]) ? n.push(this.animationGroups[r]) : (s.push(this.animationGroups[r]), i.push(this.timingOptions[r]));
477
+ for (let o = 0; o < this.animationGroups.length; o++)
478
+ t(this.animationGroups[o]) ? n.push(this.animationGroups[o]) : (s.push(this.animationGroups[o]), i.push(this.timingOptions[o]));
487
479
  if (n.length === 0) return n;
488
- for (const r of n)
489
- r.cancel();
490
- return this.animationGroups = s, this.timingOptions = i, this.animations = s.flatMap((r) => [...r.animations]), this.applyOffsets(), this.ready = Promise.all(this.animationGroups.map((r) => r.ready)).then(() => {
480
+ for (const o of n)
481
+ o.cancel();
482
+ return this.animationGroups = s, this.timingOptions = i, this.animations = s.flatMap((o) => [...o.animations]), this.applyOffsets(), this.ready = Promise.all(this.animationGroups.map((o) => o.ready)).then(() => {
491
483
  }), n;
492
484
  }
493
485
  async onFinish(t) {
@@ -498,19 +490,19 @@ class pn extends K {
498
490
  }
499
491
  }
500
492
  }
501
- class gn {
493
+ class pn {
502
494
  _animation;
503
495
  customEffect;
504
496
  progress;
505
497
  _tickCbId;
506
498
  _finishHandler;
507
499
  constructor(t, n, s, i) {
508
- const r = new KeyframeEffect(n, [], {
500
+ const o = new KeyframeEffect(n, [], {
509
501
  ...s,
510
502
  composite: "add"
511
- }), { timeline: o } = i;
512
- this._animation = new Animation(r, o), this._tickCbId = null, this.progress = null, this.customEffect = (c) => t(r.target, c), this._finishHandler = (c) => {
513
- this.effect.target?.getAnimations().find((a) => a === this._animation) || this.cancel();
503
+ }), { timeline: r } = i;
504
+ this._animation = new Animation(o, r), this._tickCbId = null, this.progress = null, this.customEffect = (a) => t(o.target, a), this._finishHandler = (a) => {
505
+ this.effect.target?.getAnimations().find((c) => c === this._animation) || this.cancel();
514
506
  }, this.addEventListener("finish", this._finishHandler), this.addEventListener("remove", this._finishHandler);
515
507
  }
516
508
  // private tick method for customEffect loop implementation
@@ -638,12 +630,12 @@ class gn {
638
630
  return this._animation.dispatchEvent(t);
639
631
  }
640
632
  }
641
- function vn(e) {
633
+ function gn(e) {
642
634
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
643
635
  }
644
- var ie = { exports: {} }, Pe = ie.exports, Me;
645
- function yn() {
646
- return Me || (Me = 1, (function(e) {
636
+ var re = { exports: {} }, Fe = re.exports, Re;
637
+ function vn() {
638
+ return Re || (Re = 1, (function(e) {
647
639
  (function(t) {
648
640
  var n = function() {
649
641
  }, s = t.requestAnimationFrame || t.webkitRequestAnimationFrame || t.mozRequestAnimationFrame || t.msRequestAnimationFrame || function(u) {
@@ -676,7 +668,7 @@ function yn() {
676
668
  */
677
669
  measure: function(u, l) {
678
670
  var d = l ? u.bind(l) : u;
679
- return this.reads.push(d), r(this), d;
671
+ return this.reads.push(d), o(this), d;
680
672
  },
681
673
  /**
682
674
  * Adds a job to the
@@ -689,7 +681,7 @@ function yn() {
689
681
  */
690
682
  mutate: function(u, l) {
691
683
  var d = l ? u.bind(l) : u;
692
- return this.writes.push(d), r(this), d;
684
+ return this.writes.push(d), o(this), d;
693
685
  },
694
686
  /**
695
687
  * Clears a scheduled 'read' or 'write' task.
@@ -699,7 +691,7 @@ function yn() {
699
691
  * @public
700
692
  */
701
693
  clear: function(u) {
702
- return c(this.reads, u) || c(this.writes, u);
694
+ return a(this.reads, u) || a(this.writes, u);
703
695
  },
704
696
  /**
705
697
  * Extend this FastDom with some
@@ -738,185 +730,185 @@ function yn() {
738
730
  extend: function(u) {
739
731
  if (typeof u != "object") throw new Error("expected object");
740
732
  var l = Object.create(this);
741
- return a(l, u), l.fastdom = this, l.initialize && l.initialize(), l;
733
+ return c(l, u), l.fastdom = this, l.initialize && l.initialize(), l;
742
734
  },
743
735
  // override this with a function
744
736
  // to prevent Errors in console
745
737
  // when tasks throw
746
738
  catch: null
747
739
  };
748
- function r(u) {
749
- u.scheduled || (u.scheduled = !0, u.raf(o.bind(null, u)));
750
- }
751
740
  function o(u) {
752
- var l = u.writes, d = u.reads, v;
741
+ u.scheduled || (u.scheduled = !0, u.raf(r.bind(null, u)));
742
+ }
743
+ function r(u) {
744
+ var l = u.writes, d = u.reads, m;
753
745
  try {
754
746
  n("flushing reads", d.length), u.runTasks(d), n("flushing writes", l.length), u.runTasks(l);
755
747
  } catch (h) {
756
- v = h;
748
+ m = h;
757
749
  }
758
- if (u.scheduled = !1, (d.length || l.length) && r(u), v)
759
- if (n("task errored", v.message), u.catch) u.catch(v);
760
- else throw v;
750
+ if (u.scheduled = !1, (d.length || l.length) && o(u), m)
751
+ if (n("task errored", m.message), u.catch) u.catch(m);
752
+ else throw m;
761
753
  }
762
- function c(u, l) {
754
+ function a(u, l) {
763
755
  var d = u.indexOf(l);
764
756
  return !!~d && !!u.splice(d, 1);
765
757
  }
766
- function a(u, l) {
758
+ function c(u, l) {
767
759
  for (var d in l)
768
760
  l.hasOwnProperty(d) && (u[d] = l[d]);
769
761
  }
770
762
  var f = t.fastdom = t.fastdom || new i();
771
763
  e.exports = f;
772
- })(typeof window < "u" ? window : typeof Pe < "u" ? Pe : globalThis);
773
- })(ie)), ie.exports;
764
+ })(typeof window < "u" ? window : typeof Fe < "u" ? Fe : globalThis);
765
+ })(re)), re.exports;
774
766
  }
775
- var En = yn();
776
- const O = /* @__PURE__ */ vn(En), Ee = {};
777
- function wn(e) {
778
- Object.assign(Ee, e);
767
+ var yn = vn();
768
+ const C = /* @__PURE__ */ gn(yn), $e = {};
769
+ function En(e) {
770
+ Object.assign($e, e);
779
771
  }
780
- function bn(e) {
781
- return e in Ee ? Ee[e] : (console.warn(
772
+ function wn(e) {
773
+ return e in $e ? $e[e] : (console.warn(
782
774
  `${e} not found in registry. Please make sure to import and register the preset.`
783
775
  ), null);
784
776
  }
785
- function z(e, t) {
777
+ function H(e, t) {
786
778
  return e ? (t || document).getElementById(e) : null;
787
779
  }
788
780
  function $n(e, t) {
789
781
  return e?.matches(`[data-motion-part~="${t}"]`) ? e : e?.querySelector(`[data-motion-part~="${t}"]`);
790
782
  }
791
- function Sn(e) {
783
+ function bn(e) {
792
784
  const t = e.alternate ? "alternate" : "";
793
785
  return e.reversed ? `${t ? `${t}-` : ""}reverse` : t || "normal";
794
786
  }
795
- function pe(e) {
796
- return `${e.value}${nn(e.unit)}`;
787
+ function ve(e) {
788
+ return `${e.value}${tn(e.unit)}`;
797
789
  }
798
- function xe(e, t, n) {
799
- return `${e.name || "cover"} ${n && e.offset.unit !== "percentage" ? `calc(100% + ${pe(e.offset)}${t ? ` + ${t}` : ""})` : t ? `calc(${pe(e.offset)} + ${t})` : pe(e.offset)}`;
790
+ function Ne(e, t, n) {
791
+ return `${e.name || "cover"} ${n && e.offset.unit !== "percentage" ? `calc(100% + ${ve(e.offset)}${t ? ` + ${t}` : ""})` : t ? `calc(${ve(e.offset)} + ${t})` : ve(e.offset)}`;
800
792
  }
801
- function Ze(e) {
793
+ function tt(e) {
802
794
  return {
803
- start: xe(e.startOffset, e.startOffsetAdd),
804
- end: xe(e.endOffset, e.endOffsetAdd, !0)
795
+ start: Ne(e.startOffset, e.startOffsetAdd),
796
+ end: Ne(e.endOffset, e.endOffsetAdd, !0)
805
797
  };
806
798
  }
807
- function Je(e) {
808
- return (t) => O.measure(() => t(e));
799
+ function nt(e) {
800
+ return (t) => C.measure(() => t(e));
809
801
  }
810
- function et(e) {
811
- return (t) => O.mutate(() => t(e));
802
+ function st(e) {
803
+ return (t) => C.mutate(() => t(e));
812
804
  }
813
- function Y(e) {
805
+ function B(e) {
814
806
  if (e.namedEffect) {
815
807
  const t = e.namedEffect.type;
816
- return typeof t == "string" ? bn(t) : null;
808
+ return typeof t == "string" ? wn(t) : null;
817
809
  } else if (e.keyframeEffect) {
818
810
  const t = (s) => {
819
- const { name: i, keyframes: r } = s.keyframeEffect;
820
- return [{ ...s, name: i, keyframes: r }];
811
+ const { name: i, keyframes: o } = s.keyframeEffect;
812
+ return [{ ...s, name: i, keyframes: o }];
821
813
  };
822
814
  return { web: t, style: t, getNames: (s) => {
823
- const { effectId: i } = s, { name: r } = s.keyframeEffect, o = r || i;
824
- return o ? [o] : [];
815
+ const { effectId: i } = s, { name: o } = s.keyframeEffect, r = o || i;
816
+ return r ? [r] : [];
825
817
  } };
826
818
  } else if (e.customEffect)
827
819
  return (t) => [{ ...t, keyframes: [] }];
828
820
  return null;
829
821
  }
830
- function tt(e, t, n, s) {
831
- return e.map((i, r) => {
832
- const o = {
822
+ function it(e, t, n, s) {
823
+ return e.map((i, o) => {
824
+ const r = {
833
825
  fill: i.fill,
834
- easing: se(i.easing),
826
+ easing: oe(i.easing),
835
827
  iterations: i.iterations === 0 ? 1 / 0 : i.iterations || 1,
836
828
  composite: i.composite,
837
- direction: Sn(i)
829
+ direction: bn(i)
838
830
  };
839
- Ae(t) ? (o.duration = i.duration, o.delay = i.delay || 0) : t?.trigger === "view-progress" && (s || window.ViewTimeline) ? o.duration = "auto" : (o.duration = 99.99, o.delay = 0.01);
840
- const c = an(i.keyframes);
831
+ qe(t) ? (r.duration = i.duration, r.delay = i.delay || 0) : t?.trigger === "view-progress" && (s || window.ViewTimeline) ? r.duration = "auto" : (r.duration = 99.99, r.delay = 0.01);
832
+ const a = an(i.keyframes);
841
833
  return {
842
- effect: c === i.keyframes ? i : { ...i, keyframes: c },
843
- options: o,
844
- id: n && `${n}-${r + 1}`,
834
+ effect: a === i.keyframes ? i : { ...i, keyframes: a },
835
+ options: r,
836
+ id: n && `${n}-${o + 1}`,
845
837
  part: i.part
846
838
  };
847
839
  });
848
840
  }
849
- function Ae(e) {
841
+ function qe(e) {
850
842
  return !e || e.trigger !== "pointer-move" && e.trigger !== "view-progress";
851
843
  }
852
- function Le(e, t, n, s, i) {
844
+ function ze(e, t, n, s, i) {
853
845
  if (e) {
854
- if (Ae(s) && (t.duration = t.duration || 1, i?.reducedMotion))
846
+ if (qe(s) && (t.duration = t.duration || 1, i?.reducedMotion))
855
847
  if (t.iterations === 1 || t.iterations == null)
856
848
  t = { ...t, duration: 1 };
857
849
  else
858
850
  return [];
859
- let r;
860
- return n instanceof HTMLElement && (r = { measure: Je(n), mutate: et(n) }), e.web ? e.web(t, r, i) : e(t, r, i);
851
+ let o;
852
+ return n instanceof HTMLElement && (o = { measure: nt(n), mutate: st(n) }), e.web ? e.web(t, o, i) : e(t, o, i);
861
853
  }
862
854
  return [];
863
855
  }
864
- function nt(e, t, n, s, i) {
865
- const r = typeof e == "string" ? z(e, i) : e;
856
+ function ot(e, t, n, s, i) {
857
+ const o = typeof e == "string" ? H(e, i) : e;
866
858
  if (n?.trigger === "pointer-move" && !t.keyframeEffect) {
867
859
  let d = t;
868
860
  t.customEffect && (d = {
869
861
  ...t,
870
862
  namedEffect: { id: "", type: "CustomMouse" }
871
863
  });
872
- const v = Y(
864
+ const m = B(
873
865
  d
874
- ), h = Le(
875
- v,
866
+ ), h = ze(
867
+ m,
876
868
  t,
877
- r,
869
+ o,
878
870
  n,
879
871
  s
880
872
  );
881
- return typeof h != "function" ? null : h(r);
873
+ return typeof h != "function" ? null : h(o);
882
874
  }
883
- const o = Y(t), c = Le(
884
- o,
885
- t,
875
+ const r = B(t), a = ze(
886
876
  r,
877
+ t,
878
+ o,
887
879
  n,
888
880
  s
889
881
  );
890
- if (!c || c.length === 0)
882
+ if (!a || a.length === 0)
891
883
  return null;
892
- const a = tt(c, n, t.effectId);
884
+ const c = it(a, n, t.effectId);
893
885
  let f;
894
886
  const u = n?.trigger === "view-progress";
895
887
  u && window.ViewTimeline && (f = new ViewTimeline({
896
- subject: n.element || z(n.componentId)
888
+ subject: n.element || H(n.componentId)
897
889
  }));
898
- const l = a.map(({ effect: d, options: v, id: h, part: m }) => {
899
- const p = m ? $n(r, m) : r, g = new KeyframeEffect(p || null, [], v);
900
- O.mutate(() => {
901
- "timing" in d && g.updateTiming(d.timing), g.setKeyframes(d.keyframes);
890
+ const l = c.map(({ effect: d, options: m, id: h, part: p }) => {
891
+ const g = p ? $n(o, p) : o, v = new KeyframeEffect(g || null, [], m);
892
+ C.mutate(() => {
893
+ "timing" in d && v.updateTiming(d.timing), v.setKeyframes(d.keyframes);
902
894
  });
903
- const E = u && f ? { timeline: f } : {}, y = typeof d.customEffect == "function" ? new gn(
895
+ const y = u && f ? { timeline: f } : {}, E = typeof d.customEffect == "function" ? new pn(
904
896
  d.customEffect,
905
- p || null,
906
- v,
907
- E
908
- ) : new Animation(g, E.timeline);
897
+ g || null,
898
+ m,
899
+ y
900
+ ) : new Animation(v, y.timeline);
909
901
  if (u)
910
902
  if (f)
911
- O.mutate(() => {
912
- const { start: w, end: $ } = Ze(d);
913
- y.rangeStart = w, y.rangeEnd = $, y.play();
903
+ C.mutate(() => {
904
+ const { start: $, end: b } = tt(d);
905
+ E.rangeStart = $, E.rangeEnd = b, E.play();
914
906
  });
915
907
  else {
916
- const { startOffset: w, endOffset: $ } = t;
917
- O.mutate(() => {
918
- const S = d.startOffset || w, I = d.endOffset || $;
919
- Object.assign(y, {
908
+ const { startOffset: $, endOffset: b } = t;
909
+ C.mutate(() => {
910
+ const S = d.startOffset || $, I = d.endOffset || b;
911
+ Object.assign(E, {
920
912
  start: {
921
913
  name: S.name,
922
914
  offset: S.offset?.value,
@@ -930,92 +922,92 @@ function nt(e, t, n, s, i) {
930
922
  });
931
923
  });
932
924
  }
933
- return h && (y.id = h), y;
925
+ return h && (E.id = h), E;
934
926
  });
935
- return new K(l, {
927
+ return new Q(l, {
936
928
  ...t,
937
929
  trigger: { ...n || {} },
938
930
  // make sure the group is ready after all animation targets are measured and mutated
939
- measured: new Promise((d) => O.mutate(d))
931
+ measured: new Promise((d) => C.mutate(d))
940
932
  });
941
933
  }
942
- function In(e, t) {
934
+ function Sn(e, t) {
943
935
  return e ? `#${e}${t ? `[data-motion-part~="${t}"]` : ""}` : "";
944
936
  }
945
- function Tn(e, t, n) {
946
- const { duration: s, delay: i, iterations: r = 1, fill: o, easing: c = "linear", direction: a } = e.options, f = e.effect.name, u = s === "auto", { sequenceId: l, delay: d, offset: v, offsetEasing: h = "linear" } = n || {};
947
- let m = `${i ?? 0}ms`;
937
+ function In(e, t, n) {
938
+ const { duration: s, delay: i, iterations: o = 1, fill: r, easing: a = "linear", direction: c } = e.options, f = e.effect.name, u = s === "auto", { sequenceId: l, delay: d, offset: m, offsetEasing: h = "linear" } = n || {};
939
+ let p = `${i ?? 0}ms`;
948
940
  if (l && typeof h == "string") {
949
- const p = mn(h);
950
- if (p) {
951
- const g = (i ?? 0) + (d ?? 0);
952
- if (v) {
953
- const E = p(
941
+ const g = hn(h);
942
+ if (g) {
943
+ const v = (i ?? 0) + (d ?? 0);
944
+ if (m) {
945
+ const y = g(
954
946
  `(var(--motion-${l}-index, 0) / var(--motion-${l}-last, 1))`
955
947
  );
956
- m = `calc(${`(${g} + ${E} * ${v} * var(--motion-${l}-last, 1))`} * 1ms)`;
948
+ p = `calc(${`(${v} + ${y} * ${m} * var(--motion-${l}-last, 1))`} * 1ms)`;
957
949
  } else
958
- m = `${g}ms`;
950
+ p = `${v}ms`;
959
951
  }
960
952
  }
961
- return `${f} ${u ? "auto" : `${s}ms`}${u ? " " : ` ${m} `}${c}${o && o !== "none" ? ` ${o}` : ""} ${!r || r === 1 / 0 ? "infinite" : r}${a === "normal" ? "" : ` ${a}`} ${t ? "" : "paused"}`;
953
+ return `${f} ${u ? "auto" : `${s}ms`}${u ? " " : ` ${p} `}${a}${r && r !== "none" ? ` ${r}` : ""} ${!o || o === 1 / 0 ? "infinite" : o}${c === "normal" ? "" : ` ${c}`} ${t ? "" : "paused"}`;
962
954
  }
963
- function On(e, t, n) {
964
- return e?.style ? (Ae(n) && (t.duration = t.duration || 1), e.style(t)) : [];
955
+ function Tn(e, t, n) {
956
+ return e?.style ? (qe(n) && (t.duration = t.duration || 1), e.style(t)) : [];
965
957
  }
966
958
  function Cn(e, t, n, s) {
967
- const i = Y(t), r = On(i, t), o = tt(r, n, t.effectId, !0), c = n?.trigger === "view-progress";
968
- return o.map((a, f) => {
969
- const { start: u, end: l } = c ? Ze(a.effect) : {};
959
+ const i = B(t), o = Tn(i, t), r = it(o, n, t.effectId, !0), a = n?.trigger === "view-progress";
960
+ return r.map((c, f) => {
961
+ const { start: u, end: l } = a ? tt(c.effect) : {};
970
962
  return {
971
- target: In(e, a.part),
972
- animation: Tn(a, c, s),
973
- composition: a.options.composite,
974
- custom: a.effect.custom,
975
- name: a.effect.name,
976
- keyframes: a.effect.keyframes,
977
- id: a.id && `${a.id}-${f + 1}`,
978
- animationTimeline: c ? `--${n?.id}` : "",
963
+ target: Sn(e, c.part),
964
+ animation: In(c, a, s),
965
+ composition: c.options.composite,
966
+ custom: c.effect.custom,
967
+ name: c.effect.name,
968
+ keyframes: c.effect.keyframes,
969
+ id: c.id && `${c.id}-${f + 1}`,
970
+ animationTimeline: a ? `--${n?.id}` : "",
979
971
  animationRange: u || l ? `${u} ${l}` : ""
980
972
  };
981
973
  });
982
974
  }
983
- function An(e, t, n) {
984
- const s = Y(t), i = e instanceof HTMLElement ? e : z(e);
975
+ function On(e, t, n) {
976
+ const s = B(t), i = e instanceof HTMLElement ? e : H(e);
985
977
  if (s && s.prepare && i) {
986
- const r = { measure: Je(i), mutate: et(i) };
987
- s.prepare(t, r);
978
+ const o = { measure: nt(i), mutate: st(i) };
979
+ s.prepare(t, o);
988
980
  }
989
- n && O.mutate(n);
981
+ n && C.mutate(n);
990
982
  }
991
- function st(e, t) {
992
- const n = Y(t);
983
+ function rt(e, t) {
984
+ const n = B(t);
993
985
  if (!n)
994
986
  return null;
995
987
  if (!n.style)
996
- return t.effectId && e ? qn(e, t.effectId) : null;
997
- const s = n.getNames(t), r = (typeof e == "string" ? z(e) : e)?.getAnimations(), o = r?.map((a) => a.animationName) || [], c = [];
998
- return s.forEach((a) => {
999
- o.includes(a) && c.push(
1000
- r?.find((f) => f.animationName === a)
988
+ return t.effectId && e ? _n(e, t.effectId) : null;
989
+ const s = n.getNames(t), o = (typeof e == "string" ? H(e) : e)?.getAnimations(), r = o?.map((c) => c.animationName) || [], a = [];
990
+ return s.forEach((c) => {
991
+ r.includes(c) && a.push(
992
+ o?.find((f) => f.animationName === c)
1001
993
  );
1002
- }), c?.length ? new K(c) : null;
994
+ }), a?.length ? new Q(a) : null;
1003
995
  }
1004
- function qn(e, t) {
1005
- const s = (typeof e == "string" ? z(e) : e)?.getAnimations().filter((i) => {
1006
- const r = i.id || i.animationName;
1007
- return r ? r.startsWith(t) : !0;
996
+ function _n(e, t) {
997
+ const s = (typeof e == "string" ? H(e) : e)?.getAnimations().filter((i) => {
998
+ const o = i.id || i.animationName;
999
+ return o ? o.startsWith(t) : !0;
1008
1000
  });
1009
- return s?.length ? new K(s) : null;
1001
+ return s?.length ? new Q(s) : null;
1010
1002
  }
1011
- function it(e, t, n, s = {}) {
1012
- const { disabled: i, allowActiveEvent: r, ...o } = s, c = nt(e, t, n, o);
1013
- if (!c)
1003
+ function at(e, t, n, s = {}) {
1004
+ const { disabled: i, allowActiveEvent: o, ...r } = s, a = ot(e, t, n, r);
1005
+ if (!a)
1014
1006
  return null;
1015
- let a = {};
1007
+ let c = {};
1016
1008
  if (n.trigger === "view-progress" && !window.ViewTimeline) {
1017
- const f = n.element || z(n.componentId), { ready: u } = c;
1018
- return c.animations.map((l) => ({
1009
+ const f = n.element || H(n.componentId), { ready: u } = a;
1010
+ return a.animations.map((l) => ({
1019
1011
  /* we use getters for start and end in order to access the animation's start and end
1020
1012
  only when initializing the scrub scene rather than immediately */
1021
1013
  get start() {
@@ -1027,11 +1019,11 @@ function it(e, t, n, s = {}) {
1027
1019
  viewSource: f,
1028
1020
  ready: u,
1029
1021
  getProgress() {
1030
- return c.getProgress();
1022
+ return a.getProgress();
1031
1023
  },
1032
- effect(d, v) {
1033
- const { activeDuration: h } = l.effect.getComputedTiming(), { delay: m } = l.effect.getTiming();
1034
- l.currentTime = ((m || 0) + (h || 0)) * v;
1024
+ effect(d, m) {
1025
+ const { activeDuration: h } = l.effect.getComputedTiming(), { delay: p } = l.effect.getTiming();
1026
+ l.currentTime = ((p || 0) + (h || 0)) * m;
1035
1027
  },
1036
1028
  disabled: i,
1037
1029
  destroy() {
@@ -1039,9 +1031,9 @@ function it(e, t, n, s = {}) {
1039
1031
  }
1040
1032
  }));
1041
1033
  } else if (n.trigger === "pointer-move") {
1042
- const f = t, { centeredToTarget: u, transitionDuration: l, transitionEasing: d } = f, v = n.axis;
1034
+ const f = t, { centeredToTarget: u, transitionDuration: l, transitionEasing: d } = f, m = n.axis;
1043
1035
  if (f.keyframeEffect) {
1044
- const h = c;
1036
+ const h = a;
1045
1037
  return h.animations?.length === 0 ? null : {
1046
1038
  target: void 0,
1047
1039
  centeredToTarget: u,
@@ -1050,9 +1042,9 @@ function it(e, t, n, s = {}) {
1050
1042
  getProgress() {
1051
1043
  return this._currentProgress;
1052
1044
  },
1053
- effect(p, g) {
1054
- const E = v === "x" ? g.x : g.y;
1055
- this._currentProgress = E, h.progress(E);
1045
+ effect(g, v) {
1046
+ const y = m === "x" ? v.x : v.y;
1047
+ this._currentProgress = y, h.progress(y);
1056
1048
  },
1057
1049
  disabled: i ?? !1,
1058
1050
  destroy() {
@@ -1060,18 +1052,18 @@ function it(e, t, n, s = {}) {
1060
1052
  }
1061
1053
  };
1062
1054
  }
1063
- a = {
1055
+ c = {
1064
1056
  centeredToTarget: u,
1065
- allowActiveEvent: r
1066
- }, t.customEffect && l && (a.transitionDuration = l, a.transitionEasing = Xe(d)), a.target = c.target;
1057
+ allowActiveEvent: o
1058
+ }, t.customEffect && l && (c.transitionDuration = l, c.transitionEasing = et(d)), c.target = a.target;
1067
1059
  }
1068
1060
  return {
1069
- ...a,
1061
+ ...c,
1070
1062
  getProgress() {
1071
- return c.getProgress();
1063
+ return a.getProgress();
1072
1064
  },
1073
1065
  effect(f, u, l, d) {
1074
- c.progress(
1066
+ a.progress(
1075
1067
  l ? {
1076
1068
  // @ts-expect-error spread error on p
1077
1069
  ...u,
@@ -1082,203 +1074,205 @@ function it(e, t, n, s = {}) {
1082
1074
  },
1083
1075
  disabled: i,
1084
1076
  destroy() {
1085
- c.cancel();
1077
+ a.cancel();
1086
1078
  }
1087
1079
  };
1088
1080
  }
1089
- function U(e, t, n, s = !1) {
1090
- const i = st(e, t);
1091
- return i ? (i.ready = new Promise((r) => {
1092
- An(e, t, r);
1093
- }), i) : nt(e, t, n, { reducedMotion: s });
1081
+ function X(e, t, n, s = !1) {
1082
+ const i = rt(e, t);
1083
+ return i ? (i.ready = new Promise((o) => {
1084
+ On(e, t, o);
1085
+ }), i) : ot(e, t, n, { reducedMotion: s });
1094
1086
  }
1095
- function _n(e) {
1087
+ function An(e) {
1096
1088
  return e === null ? [null] : typeof e == "string" ? Array.from(document.querySelectorAll(e)) : Array.isArray(e) ? e : [e];
1097
1089
  }
1098
- function rt(e, t) {
1090
+ function ct(e, t) {
1099
1091
  const n = [];
1100
1092
  for (const { target: s, options: i } of e) {
1101
- const r = _n(s);
1102
- for (const o of r) {
1103
- const c = U(
1104
- o,
1093
+ const o = An(s);
1094
+ for (const r of o) {
1095
+ const a = X(
1096
+ r,
1105
1097
  i,
1106
1098
  void 0,
1107
1099
  t?.reducedMotion
1108
1100
  );
1109
- c instanceof K && n.push(c);
1101
+ a instanceof Q && n.push(a);
1110
1102
  }
1111
1103
  }
1112
1104
  return n;
1113
1105
  }
1114
- function kn(e, t, n) {
1115
- const s = rt(t, n);
1116
- return new pn(s, e);
1106
+ function qn(e, t, n) {
1107
+ const s = ct(t, n);
1108
+ return new mn(s, e);
1117
1109
  }
1118
- const Z = {
1110
+ const ee = {
1119
1111
  rangeStart: { name: "cover", offset: { value: 0, unit: "percentage" } },
1120
1112
  rangeEnd: { name: "cover", offset: { value: 100, unit: "percentage" } }
1121
1113
  };
1122
- function Pn(e, t) {
1123
- const n = e?.name ?? Z.rangeStart.name, s = t?.name ?? e?.name ?? Z.rangeEnd.name, i = {
1114
+ function kn(e, t) {
1115
+ const n = e?.name ?? ee.rangeStart.name, s = t?.name ?? e?.name ?? ee.rangeEnd.name, i = {
1124
1116
  name: n,
1125
- offset: e?.offset || Z.rangeStart.offset
1126
- }, r = {
1117
+ offset: e?.offset || ee.rangeStart.offset
1118
+ }, o = {
1127
1119
  name: s,
1128
- offset: t?.offset || Z.rangeEnd.offset
1120
+ offset: t?.offset || ee.rangeEnd.offset
1129
1121
  };
1130
- return { startOffset: i, endOffset: r };
1122
+ return { startOffset: i, endOffset: o };
1131
1123
  }
1132
- function M(e) {
1124
+ function P(e) {
1133
1125
  if ("keyframeEffect" in e && !e.keyframeEffect.name && "effectId" in e && (e.keyframeEffect.name = e.effectId), "duration" in e)
1134
1126
  return {
1135
1127
  id: "",
1136
1128
  ...e
1137
1129
  };
1138
- const { rangeStart: t, rangeEnd: n, ...s } = e, { startOffset: i, endOffset: r } = Pn(t, n);
1130
+ const { rangeStart: t, rangeEnd: n, ...s } = e, { startOffset: i, endOffset: o } = kn(t, n);
1139
1131
  return {
1140
1132
  id: "",
1141
1133
  startOffset: i,
1142
- endOffset: r,
1134
+ endOffset: o,
1143
1135
  ...s
1144
1136
  };
1145
1137
  }
1146
- function q(e, t, n) {
1138
+ function A(e, t, n) {
1147
1139
  let s = e.get(t);
1148
1140
  s || (s = /* @__PURE__ */ new Set(), e.set(t, s)), s.add(n);
1149
1141
  }
1150
- function Q(e, t) {
1142
+ function Z(e, t) {
1151
1143
  e.get(t)?.forEach((s) => {
1152
- const { source: i, target: r, cleanup: o } = s;
1153
- o();
1154
- const c = i === t ? r : i;
1155
- e.get(c)?.delete(s);
1144
+ const { source: i, target: o, cleanup: r } = s;
1145
+ r();
1146
+ const a = i === t ? o : i;
1147
+ e.get(a)?.delete(s);
1156
1148
  }), e.delete(t);
1157
1149
  }
1158
1150
  const Mn = {
1159
1151
  root: null,
1160
1152
  rootMargin: "0px 0px -10% 0px",
1161
1153
  threshold: [0]
1162
- }, xn = {
1154
+ }, Pn = {
1163
1155
  root: null,
1164
1156
  rootMargin: "0px",
1165
1157
  threshold: [0]
1166
- }, Ln = 0.2;
1167
- function Fn(e) {
1168
- const t = e.trim().split(/\s+/), n = t[0], s = t.length > 1 ? t[1] : t[0], i = (r) => r.startsWith("-") ? r.slice(1) : parseFloat(r) ? `-${r}` : r;
1158
+ }, xn = 0.2;
1159
+ function Ln(e) {
1160
+ const t = e.trim().split(/\s+/), n = t[0], s = t.length > 1 ? t[1] : t[0], i = (o) => o.startsWith("-") ? o.slice(1) : parseFloat(o) ? `-${o}` : o;
1169
1161
  return `${i(n)} 0px ${i(s)}`;
1170
1162
  }
1171
- const W = {}, x = /* @__PURE__ */ new WeakMap(), fe = /* @__PURE__ */ new WeakSet(), D = /* @__PURE__ */ new WeakMap();
1172
- let ot = {}, G = null;
1173
- function Rn(e) {
1174
- ot = e;
1163
+ const K = {}, L = /* @__PURE__ */ new WeakMap(), le = /* @__PURE__ */ new WeakSet(), W = /* @__PURE__ */ new WeakMap();
1164
+ let ut = {}, V = null;
1165
+ function Fn(e) {
1166
+ ut = e;
1175
1167
  }
1176
- function ct(e, t, n) {
1177
- x.get(e)?.forEach(({ source: i, handler: r }) => {
1178
- i === e && r(t, n);
1168
+ function ft(e, t, n) {
1169
+ L.get(e)?.forEach(({ source: i, handler: o }) => {
1170
+ i === e && o(t, n);
1179
1171
  });
1180
1172
  }
1181
- function Fe() {
1182
- return G || (G = new IntersectionObserver((e) => {
1173
+ function je() {
1174
+ return V || (V = new IntersectionObserver((e) => {
1183
1175
  e.forEach((t) => {
1184
1176
  const n = t.target;
1185
- t.isIntersecting || ct(n, !1, !0);
1177
+ t.isIntersecting || ft(n, !1, !0);
1186
1178
  });
1187
- }, xn), G);
1179
+ }, Pn), V);
1188
1180
  }
1189
- function at(e, t = !1) {
1181
+ function lt(e, t = !1) {
1190
1182
  const n = JSON.stringify({ ...e, isSafeMode: t });
1191
- if (W[n])
1192
- return W[n];
1193
- const s = e.threshold ?? Ln, i = t ? Mn : {
1183
+ if (K[n])
1184
+ return K[n];
1185
+ const s = e.threshold ?? xn, i = t ? Mn : {
1194
1186
  root: null,
1195
- rootMargin: e.inset ? Fn(e.inset) : "0px",
1187
+ rootMargin: e.inset ? Ln(e.inset) : "0px",
1196
1188
  threshold: s
1197
- }, r = new IntersectionObserver((o) => {
1198
- o.forEach((c) => {
1199
- const a = c.target, f = !fe.has(a);
1200
- if (f && (fe.add(a), e.useSafeViewEnter && !c.isIntersecting)) {
1201
- O.measure(() => {
1202
- const u = c.boundingClientRect.height, l = c.rootBounds?.height;
1189
+ }, o = new IntersectionObserver((r) => {
1190
+ r.forEach((a) => {
1191
+ const c = a.target, f = !le.has(c);
1192
+ if (f && (le.add(c), e.useSafeViewEnter && !a.isIntersecting)) {
1193
+ C.measure(() => {
1194
+ const u = a.boundingClientRect.height, l = a.rootBounds?.height;
1203
1195
  if (!l)
1204
1196
  return;
1205
1197
  const d = Array.isArray(e.threshold) ? Math.min(...e.threshold) : e.threshold;
1206
- d && u * d > l && O.mutate(() => {
1207
- r.unobserve(a);
1208
- const h = at(e, !0);
1209
- D.set(a, h), h.observe(a);
1198
+ d && u * d > l && C.mutate(() => {
1199
+ o.unobserve(c);
1200
+ const h = lt(e, !0);
1201
+ W.set(c, h), h.observe(c);
1210
1202
  });
1211
1203
  });
1212
1204
  return;
1213
1205
  }
1214
- (c.isIntersecting || !f) && ct(a, c.isIntersecting);
1206
+ (a.isIntersecting || !f) && ft(c, a.isIntersecting);
1215
1207
  });
1216
1208
  }, i);
1217
- return W[n] = r, r;
1209
+ return K[n] = o, o;
1218
1210
  }
1219
- function Nn(e, t, n, s = {}, { reducedMotion: i, selectorCondition: r, animation: o } = {}) {
1220
- const c = { ...ot, ...s }, a = n.triggerType || "once", f = o || U(
1211
+ function Rn(e, t, n, s = {}, { reducedMotion: i, selectorCondition: o, animation: r } = {}) {
1212
+ const a = { ...ut, ...s }, c = n.triggerType || "once", f = r || X(
1221
1213
  t,
1222
- M(n),
1214
+ P(n),
1223
1215
  void 0,
1224
1216
  i
1225
1217
  );
1226
1218
  if (!f)
1227
1219
  return;
1228
- const u = at(c);
1229
- a !== "once" && f.persist?.();
1230
- let l = !0, d = !1, v;
1231
- v = { source: e, target: t, handler: (p, g) => {
1232
- if (!(r && !t.matches(r)))
1233
- if (a === "once") {
1234
- if (p && !d) {
1235
- d = !0, x.get(e)?.delete(v), x.get(t)?.delete(v);
1236
- const E = x.get(e);
1237
- (!E || E.size === 0) && ((D.get(e) || u).unobserve(e), fe.delete(e)), f.play(() => {
1238
- const y = () => {
1220
+ const u = lt(a);
1221
+ c !== "once" && f.persist?.();
1222
+ let l = !0, d = !1, m;
1223
+ m = { source: e, target: t, handler: (g, v) => {
1224
+ if (!(o && !t.matches(o)))
1225
+ if (c === "once") {
1226
+ if (g && !d) {
1227
+ d = !0;
1228
+ const y = L.get(e);
1229
+ (!y || y.size === 0 || y.size === 1 && y.has(m)) && ((W.get(e) || u).unobserve(e), le.delete(e)), f.onFinish(() => {
1230
+ L.get(e)?.delete(m), L.get(t)?.delete(m);
1231
+ }), f.play(() => {
1232
+ const E = () => {
1239
1233
  t.dataset.interactEnter = "start";
1240
1234
  };
1241
1235
  if (f.isCSS) {
1242
- O.mutate(() => {
1243
- requestAnimationFrame(y);
1236
+ C.mutate(() => {
1237
+ requestAnimationFrame(E);
1244
1238
  });
1245
- const w = () => {
1246
- O.mutate(() => {
1239
+ const $ = () => {
1240
+ C.mutate(() => {
1247
1241
  t.dataset.interactEnter = "done";
1248
1242
  });
1249
1243
  };
1250
- f.onFinish(w), f.onAbort(w);
1244
+ f.onFinish($), f.onAbort($);
1251
1245
  } else
1252
- O.mutate(y);
1246
+ C.mutate(E);
1253
1247
  });
1254
1248
  }
1255
- } else a === "alternate" ? l && p ? (l = !1, f.play()) : l || f.reverse() : a === "repeat" ? p ? (f.progress(0), f.play()) : g && (f.pause(), f.progress(0)) : a === "state" && (p ? f.play() : g && f.pause());
1249
+ } else c === "alternate" ? l && g ? (l = !1, f.play()) : l || f.reverse() : c === "repeat" ? g ? (f.progress(0), f.play()) : v && (f.pause(), f.progress(0)) : c === "state" && (g ? f.play() : v && f.pause());
1256
1250
  }, cleanup: () => {
1257
- (D.get(e) || u).unobserve(e), (a === "repeat" || a === "state") && Fe().unobserve(e), f.cancel(), fe.delete(e), D.delete(e);
1258
- } }, q(x, e, v), q(x, t, v), D.set(e, u), u.observe(e), (a === "repeat" || a === "state") && Fe().observe(e);
1251
+ (W.get(e) || u).unobserve(e), (c === "repeat" || c === "state") && je().unobserve(e), f.cancel(), le.delete(e), W.delete(e);
1252
+ } }, A(L, e, m), A(L, t, m), W.set(e, u), u.observe(e), (c === "repeat" || c === "state") && je().observe(e);
1259
1253
  }
1260
- function zn(e) {
1261
- Q(x, e);
1254
+ function Nn(e) {
1255
+ Z(L, e);
1262
1256
  }
1263
- function jn() {
1264
- G = null, Object.keys(W).forEach((e) => delete W[e]);
1257
+ function zn() {
1258
+ V = null, Object.keys(K).forEach((e) => delete K[e]);
1265
1259
  }
1266
- const Dn = {
1267
- add: Nn,
1268
- remove: zn,
1269
- setOptions: Rn,
1270
- reset: jn
1260
+ const jn = {
1261
+ add: Rn,
1262
+ remove: Nn,
1263
+ setOptions: Fn,
1264
+ reset: zn
1271
1265
  };
1272
- function ut(e, t) {
1266
+ function dt(e, t) {
1273
1267
  return Object.assign(Object.create(t), e);
1274
1268
  }
1275
- function Gn(e, t, n, s) {
1269
+ function Dn(e, t, n, s) {
1276
1270
  let i = e * (1 - n) + t * n;
1277
1271
  if (s) {
1278
- const r = i - e;
1279
- Math.abs(r) < s && (i = e + s * Math.sign(r));
1280
- const o = t - i;
1281
- if (Math.abs(o) < s)
1272
+ const o = i - e;
1273
+ Math.abs(o) < s && (i = e + s * Math.sign(o));
1274
+ const r = t - i;
1275
+ if (Math.abs(r) < s)
1282
1276
  return t;
1283
1277
  }
1284
1278
  return i;
@@ -1291,7 +1285,7 @@ function Hn(e) {
1291
1285
  }));
1292
1286
  };
1293
1287
  }
1294
- function Re(e, t) {
1288
+ function De(e, t) {
1295
1289
  let n = 0;
1296
1290
  return function() {
1297
1291
  n && window.clearTimeout(n), n = window.setTimeout(() => {
@@ -1299,112 +1293,112 @@ function Re(e, t) {
1299
1293
  }, t);
1300
1294
  };
1301
1295
  }
1302
- function Wn(e, t) {
1296
+ function Gn(e, t) {
1303
1297
  const n = e.match(/^calc\s*\(\s*(-?\d+((px)|([lsd]?vh)|([lsd]?vw)))\s*\+\s*(-?\d+((px)|([lsd]?vh)|([lsd]?vw)))\s*\)\s*$/);
1304
- return le(n[1], t) + le(n[6], t);
1298
+ return de(n[1], t) + de(n[6], t);
1305
1299
  }
1306
- function le(e, t) {
1307
- return e ? /^-?\d+px$/.test(e) ? parseInt(e) : /^-?\d+[lsd]?vh$/.test(e) ? parseInt(e) * t.viewportHeight / 100 : /^-?\d+[lsd]?vw$/.test(e) ? parseInt(e) * t.viewportWidth / 100 : /^calc\s*\(\s*-?\d+((px)|([lsd]?vh)|([lsd]?vw))\s*\+\s*-?\d+((px)|([lsd]?vh)|([lsd]?vw))\s*\)\s*$/.test(e) ? Wn(e, t) : parseInt(e) || 0 : 0;
1300
+ function de(e, t) {
1301
+ return e ? /^-?\d+px$/.test(e) ? parseInt(e) : /^-?\d+[lsd]?vh$/.test(e) ? parseInt(e) * t.viewportHeight / 100 : /^-?\d+[lsd]?vw$/.test(e) ? parseInt(e) * t.viewportWidth / 100 : /^calc\s*\(\s*-?\d+((px)|([lsd]?vh)|([lsd]?vw))\s*\+\s*-?\d+((px)|([lsd]?vh)|([lsd]?vw))\s*\)\s*$/.test(e) ? Gn(e, t) : parseInt(e) || 0 : 0;
1308
1302
  }
1309
- function F(e, t, n) {
1310
- const { name: s, offset: i = 0 } = e, { start: r, end: o } = n, c = o - r, a = i / 100;
1303
+ function R(e, t, n) {
1304
+ const { name: s, offset: i = 0 } = e, { start: o, end: r } = n, a = r - o, c = i / 100;
1311
1305
  let f, u;
1312
- return s === "entry" ? (f = r - t, u = Math.min(t, c)) : s === "entry-crossing" ? (f = r - t, u = c) : s === "contain" ? (f = Math.min(o - t, r), u = Math.abs(t - c)) : s === "exit" ? (f = Math.max(r, o - t), u = Math.min(t, c)) : s === "exit-crossing" ? (f = r, u = c) : s === "cover" && (f = r - t, u = c + t), f + a * u | 0;
1313
- }
1314
- function ge(e, t, n, s, i) {
1315
- let r = 0;
1316
- const o = { start: t, end: n };
1317
- return e.forEach((c, a) => {
1318
- r += c.offset;
1319
- const f = c.sticky;
1306
+ return s === "entry" ? (f = o - t, u = Math.min(t, a)) : s === "entry-crossing" ? (f = o - t, u = a) : s === "contain" ? (f = Math.min(r - t, o), u = Math.abs(t - a)) : s === "exit" ? (f = Math.max(o, r - t), u = Math.min(t, a)) : s === "exit-crossing" ? (f = o, u = a) : s === "cover" && (f = o - t, u = a + t), f + c * u | 0;
1307
+ }
1308
+ function ye(e, t, n, s, i) {
1309
+ let o = 0;
1310
+ const r = { start: t, end: n };
1311
+ return e.forEach((a, c) => {
1312
+ o += a.offset;
1313
+ const f = a.sticky;
1320
1314
  if (f) {
1321
- if ("end" in f && e[a - 1]?.element) {
1322
- const d = ((i ? c.element.offsetWidth : c.element.offsetHeight) || 0) + f.end - s, v = r + d - c.offset, h = v < o.start, m = !h && v <= n;
1323
- let p = 0;
1324
- (h || m) && (p = c.offset, o.end += p), h && (o.start += p);
1315
+ if ("end" in f && e[c - 1]?.element) {
1316
+ const d = ((i ? a.element.offsetWidth : a.element.offsetHeight) || 0) + f.end - s, m = o + d - a.offset, h = m < r.start, p = !h && m <= n;
1317
+ let g = 0;
1318
+ (h || p) && (g = a.offset, r.end += g), h && (r.start += g);
1325
1319
  }
1326
1320
  if ("start" in f) {
1327
- const u = r - f.start, l = u < o.start, d = !l && u <= o.end;
1328
- let v = 0;
1329
- const h = e[a - 1]?.element;
1321
+ const u = o - f.start, l = u < r.start, d = !l && u <= r.end;
1322
+ let m = 0;
1323
+ const h = e[c - 1]?.element;
1330
1324
  if (h) {
1331
1325
  if (l || d) {
1332
- const m = (i ? h.offsetWidth : h.offsetHeight) || 0, p = c.offset, g = (i ? c.element.offsetWidth : c.element.offsetHeight) || 0;
1333
- v = m - (p + g), r += v, o.end += v;
1326
+ const p = (i ? h.offsetWidth : h.offsetHeight) || 0, g = a.offset, v = (i ? a.element.offsetWidth : a.element.offsetHeight) || 0;
1327
+ m = p - (g + v), o += m, r.end += m;
1334
1328
  }
1335
- l && (o.start += v);
1329
+ l && (r.start += m);
1336
1330
  }
1337
1331
  }
1338
1332
  }
1339
- }), o;
1340
- }
1341
- function Vn(e, t, n, s, i, r) {
1342
- const { start: o, end: c, duration: a } = e;
1343
- let f = o, u = c, l = e.startRange, d = e.endRange, v;
1344
- if (typeof a == "string") {
1345
- l = { name: a, offset: 0 }, d = { name: a, offset: 100 }, f = F(l, n, t), u = F(d, n, t), v = u - f;
1346
- const h = ge(r, f, u, n, s);
1333
+ }), r;
1334
+ }
1335
+ function Wn(e, t, n, s, i, o) {
1336
+ const { start: r, end: a, duration: c } = e;
1337
+ let f = r, u = a, l = e.startRange, d = e.endRange, m;
1338
+ if (typeof c == "string") {
1339
+ l = { name: c, offset: 0 }, d = { name: c, offset: 100 }, f = R(l, n, t), u = R(d, n, t), m = u - f;
1340
+ const h = ye(o, f, u, n, s);
1347
1341
  f = h.start, u = h.end;
1348
1342
  } else {
1349
- if (l || o?.name) {
1350
- l = l || o;
1351
- const h = le(l.add, i), m = F({ ...l, offset: 0 }, n, t), p = F({ ...l, offset: 100 }, n, t), g = ge(r, m, p, n, s);
1352
- f = g.start + l.offset / 100 * (g.end - g.start) + h;
1343
+ if (l || r?.name) {
1344
+ l = l || r;
1345
+ const h = de(l.add, i), p = R({ ...l, offset: 0 }, n, t), g = R({ ...l, offset: 100 }, n, t), v = ye(o, p, g, n, s);
1346
+ f = v.start + l.offset / 100 * (v.end - v.start) + h;
1353
1347
  }
1354
- if (d || c?.name) {
1355
- d = d || c;
1356
- const h = le(d.add, i), m = F({ ...d, offset: 0 }, n, t), p = F({ ...d, offset: 100 }, n, t), g = ge(r, m, p, n, s);
1357
- u = g.start + d.offset / 100 * (g.end - g.start) + h;
1358
- } else typeof a == "number" && (u = f + a);
1348
+ if (d || a?.name) {
1349
+ d = d || a;
1350
+ const h = de(d.add, i), p = R({ ...d, offset: 0 }, n, t), g = R({ ...d, offset: 100 }, n, t), v = ye(o, p, g, n, s);
1351
+ u = v.start + d.offset / 100 * (v.end - v.start) + h;
1352
+ } else typeof c == "number" && (u = f + c);
1359
1353
  }
1360
- return !v && !a && (v = u - f), { ...e, start: f, end: u, startRange: l, endRange: d, duration: v || a };
1354
+ return !m && !c && (m = u - f), { ...e, start: f, end: u, startRange: l, endRange: d, duration: m || c };
1361
1355
  }
1362
- function Yn(e) {
1356
+ function Vn(e) {
1363
1357
  return e.position === "sticky";
1364
1358
  }
1365
- function Bn(e, t, n) {
1359
+ function Yn(e, t, n) {
1366
1360
  return e.position === "fixed" && (!t || t === window.document.body || t === n);
1367
1361
  }
1368
1362
  function Kn(e, t) {
1369
1363
  return parseInt(t ? e.left : e.top);
1370
1364
  }
1371
- function Un(e, t) {
1365
+ function Bn(e, t) {
1372
1366
  return parseInt(t ? e.right : e.bottom);
1373
1367
  }
1374
- function Qn(e, t, n) {
1368
+ function Un(e, t, n) {
1375
1369
  n && (e.style.position = "static");
1376
1370
  const s = (t ? e.offsetLeft : e.offsetTop) || 0;
1377
1371
  return n && (e.style.position = null), s;
1378
1372
  }
1379
- function Xn(e, t) {
1373
+ function Qn(e, t) {
1380
1374
  let n;
1381
- const s = Kn(e, t), i = Un(e, t), r = !isNaN(s), o = !isNaN(i);
1382
- return (r || o) && (n = {}, r && (n.start = s), o && (n.end = i)), n;
1375
+ const s = Kn(e, t), i = Bn(e, t), o = !isNaN(s), r = !isNaN(i);
1376
+ return (o || r) && (n = {}, o && (n.start = s), r && (n.end = i)), n;
1383
1377
  }
1384
- function J(e, t, n, s, i) {
1385
- const r = e[0].viewSource, o = [];
1386
- let c = (s ? r.offsetWidth : r.offsetHeight) || 0, a = 0, f = r;
1378
+ function te(e, t, n, s, i) {
1379
+ const o = e[0].viewSource, r = [];
1380
+ let a = (s ? o.offsetWidth : o.offsetHeight) || 0, c = 0, f = o;
1387
1381
  for (; f; ) {
1388
- const l = window.getComputedStyle(f), d = Yn(l), v = d ? Xn(l, s) : void 0, h = Qn(f, s, d);
1389
- if ((!v || !("end" in v)) && (a += h), o.push({ element: f, offset: h, sticky: v }), f = f.offsetParent, Bn(l, f, t))
1382
+ const l = window.getComputedStyle(f), d = Vn(l), m = d ? Qn(l, s) : void 0, h = Un(f, s, d);
1383
+ if ((!m || !("end" in m)) && (c += h), r.push({ element: f, offset: h, sticky: m }), f = f.offsetParent, Yn(l, f, t))
1390
1384
  break;
1391
1385
  if (f === t) {
1392
- o.push({ element: f, offset: 0 });
1386
+ r.push({ element: f, offset: 0 });
1393
1387
  break;
1394
1388
  }
1395
1389
  }
1396
- return o.reverse(), e.map((l) => ({
1397
- ...Vn(
1390
+ return r.reverse(), e.map((l) => ({
1391
+ ...Wn(
1398
1392
  l,
1399
- { start: a, end: a + c },
1393
+ { start: c, end: c + a },
1400
1394
  n,
1401
1395
  s,
1402
1396
  i,
1403
- o
1397
+ r
1404
1398
  )
1405
1399
  }));
1406
1400
  }
1407
- const Ne = 100, Zn = {
1401
+ const He = 100, Xn = {
1408
1402
  horizontal: !1,
1409
1403
  observeViewportEntry: !0,
1410
1404
  viewportRootMargin: "7% 7%",
@@ -1412,116 +1406,116 @@ const Ne = 100, Zn = {
1412
1406
  observeSourcesResize: !1,
1413
1407
  observeContentResize: !1
1414
1408
  };
1415
- function Jn(e, t, n, s) {
1409
+ function Zn(e, t, n, s) {
1416
1410
  let i = 0;
1417
1411
  return e >= t && e <= n ? i = s ? (e - t) / s : 1 : e > n && (i = 1), i;
1418
1412
  }
1419
- function ze(e, t) {
1413
+ function Ge(e, t) {
1420
1414
  return e === window ? t ? window.document.documentElement.clientWidth : window.document.documentElement.clientHeight : t ? e.clientWidth : e.clientHeight;
1421
1415
  }
1422
- function es() {
1416
+ function Jn() {
1423
1417
  return {
1424
1418
  viewportWidth: window.document.documentElement.clientWidth,
1425
1419
  viewportHeight: window.document.documentElement.clientHeight
1426
1420
  };
1427
1421
  }
1428
- function ts(e) {
1429
- const t = ut(e, Zn), n = t.root, s = t.horizontal, i = /* @__PURE__ */ new WeakMap();
1430
- let r = ze(n, s), o, c, a, f, u;
1431
- const l = [], d = es();
1422
+ function es(e) {
1423
+ const t = dt(e, Xn), n = t.root, s = t.horizontal, i = /* @__PURE__ */ new WeakMap();
1424
+ let o = Ge(n, s), r, a, c, f, u;
1425
+ const l = [], d = Jn();
1432
1426
  if (t.scenes = Object.values(
1433
1427
  // TODO(ameerf): find a polyfill and use groupBy instead of following reduce
1434
1428
  e.scenes.reduce(
1435
- (m, p, g) => {
1436
- const E = p.groupId ? `group-${p.groupId}` : String(g);
1437
- return m[E] ? m[E].push(p) : m[E] = [p], m;
1429
+ (p, g, v) => {
1430
+ const y = g.groupId ? `group-${g.groupId}` : String(v);
1431
+ return p[y] ? p[y].push(g) : p[y] = [g], p;
1438
1432
  },
1439
1433
  {}
1440
1434
  )
1441
- ).flatMap((m) => (m.every((p) => p.viewSource && (typeof p.duration == "string" || p.start?.name)) ? (m = J(m, n, r, s, d), (t.observeSourcesResize || t.observeContentResize) && l.push(m)) : m.forEach((p) => {
1442
- p.end == null && (p.end = p.start + p.duration), p.duration == null && (p.duration = p.end - p.start);
1443
- }), m)), t.scenes.forEach((m, p) => {
1444
- m.index = p;
1435
+ ).flatMap((p) => (p.every((g) => g.viewSource && (typeof g.duration == "string" || g.start?.name)) ? (p = te(p, n, o, s, d), (t.observeSourcesResize || t.observeContentResize) && l.push(p)) : p.forEach((g) => {
1436
+ g.end == null && (g.end = g.start + g.duration), g.duration == null && (g.duration = g.end - g.start);
1437
+ }), p)), t.scenes.forEach((p, g) => {
1438
+ p.index = g;
1445
1439
  }), l.length) {
1446
- const m = /* @__PURE__ */ new Map();
1447
- window.ResizeObserver && (a = new window.ResizeObserver(function(p) {
1448
- p.forEach((g) => {
1449
- const E = m.get(g.target), y = J(E, n, r, s, d);
1450
- y.forEach((w, $) => {
1451
- t.scenes[w.index] = y[$];
1452
- }), l.splice(l.indexOf(E), 1, y);
1440
+ const p = /* @__PURE__ */ new Map();
1441
+ window.ResizeObserver && (c = new window.ResizeObserver(function(g) {
1442
+ g.forEach((v) => {
1443
+ const y = p.get(v.target), E = te(y, n, o, s, d);
1444
+ E.forEach(($, b) => {
1445
+ t.scenes[$.index] = E[b];
1446
+ }), l.splice(l.indexOf(y), 1, E);
1453
1447
  });
1454
- }), l.forEach((p) => {
1455
- a.observe(p[0].viewSource, { box: "border-box" }), m.set(p[0].viewSource, p);
1456
- }), t.observeContentResize && t.contentRoot && new window.ResizeObserver(Re(() => {
1457
- const g = l.map((E) => {
1458
- const y = J(E, n, r, s, d);
1459
- return y.forEach((w, $) => {
1460
- t.scenes[w.index] = y[$];
1461
- }), y;
1448
+ }), l.forEach((g) => {
1449
+ c.observe(g[0].viewSource, { box: "border-box" }), p.set(g[0].viewSource, g);
1450
+ }), t.observeContentResize && t.contentRoot && new window.ResizeObserver(De(() => {
1451
+ const v = l.map((y) => {
1452
+ const E = te(y, n, o, s, d);
1453
+ return E.forEach(($, b) => {
1454
+ t.scenes[$.index] = E[b];
1455
+ }), E;
1462
1456
  });
1463
- l.length = 0, l.push(...g), l.forEach((E) => {
1464
- m.set(E[0].viewSource, E);
1457
+ l.length = 0, l.push(...v), l.forEach((y) => {
1458
+ p.set(y[0].viewSource, y);
1465
1459
  });
1466
- }, Ne)).observe(t.contentRoot, { box: "border-box" })), t.observeViewportResize && (f = Re(function() {
1467
- r = ze(n, s);
1468
- const p = l.map((g) => {
1469
- const E = J(g, n, r, s, d);
1470
- return E.forEach((y, w) => {
1471
- t.scenes[y.index] = E[w];
1472
- }), E;
1460
+ }, He)).observe(t.contentRoot, { box: "border-box" })), t.observeViewportResize && (f = De(function() {
1461
+ o = Ge(n, s);
1462
+ const g = l.map((v) => {
1463
+ const y = te(v, n, o, s, d);
1464
+ return y.forEach((E, $) => {
1465
+ t.scenes[E.index] = y[$];
1466
+ }), y;
1473
1467
  });
1474
- l.length = 0, l.push(...p), l.forEach((g) => {
1475
- m.set(g[0].viewSource, g);
1468
+ l.length = 0, l.push(...g), l.forEach((v) => {
1469
+ p.set(v[0].viewSource, v);
1476
1470
  });
1477
- }, Ne), n === window ? window.addEventListener("resize", f) : window.ResizeObserver && (u = new window.ResizeObserver(f), u.observe(n, { box: "border-box" })));
1471
+ }, He), n === window ? window.addEventListener("resize", f) : window.ResizeObserver && (u = new window.ResizeObserver(f), u.observe(n, { box: "border-box" })));
1478
1472
  }
1479
- t.observeViewportEntry && window.IntersectionObserver && (c = new window.IntersectionObserver(function(m) {
1480
- m.forEach((p) => {
1481
- (i.get(p.target) || []).forEach((g) => {
1482
- g.disabled = !p.isIntersecting;
1473
+ t.observeViewportEntry && window.IntersectionObserver && (a = new window.IntersectionObserver(function(p) {
1474
+ p.forEach((g) => {
1475
+ (i.get(g.target) || []).forEach((v) => {
1476
+ v.disabled = !g.isIntersecting;
1483
1477
  });
1484
1478
  });
1485
1479
  }, {
1486
1480
  root: n === window ? window.document : n,
1487
1481
  rootMargin: t.viewportRootMargin,
1488
1482
  threshold: 0
1489
- }), t.scenes.forEach((m) => {
1490
- if (m.viewSource) {
1491
- let p = i.get(m.viewSource);
1492
- p || (p = [], i.set(m.viewSource, p), c.observe(m.viewSource)), p.push(m);
1483
+ }), t.scenes.forEach((p) => {
1484
+ if (p.viewSource) {
1485
+ let g = i.get(p.viewSource);
1486
+ g || (g = [], i.set(p.viewSource, g), a.observe(p.viewSource)), g.push(p);
1493
1487
  }
1494
1488
  }));
1495
- function v({ p: m, vp: p }) {
1496
- m = +m.toFixed(1);
1497
- const g = +p.toFixed(4);
1498
- if (m !== o) {
1499
- for (let E of t.scenes)
1500
- if (!E.disabled) {
1501
- const { start: y, end: w, duration: $ } = E, S = Jn(m, y, w, $);
1502
- E.effect(E, S, g);
1489
+ function m({ p, vp: g }) {
1490
+ p = +p.toFixed(1);
1491
+ const v = +g.toFixed(4);
1492
+ if (p !== r) {
1493
+ for (let y of t.scenes)
1494
+ if (!y.disabled) {
1495
+ const { start: E, end: $, duration: b } = y, S = Zn(p, E, $, b);
1496
+ y.effect(y, S, v);
1503
1497
  }
1504
- o = m;
1498
+ r = p;
1505
1499
  }
1506
1500
  }
1507
1501
  function h() {
1508
- t.scenes.forEach((m) => m.destroy?.()), c && (c.disconnect(), c = null), a && (a.disconnect(), a = null), f && (u ? (u.disconnect(), u = null) : window.removeEventListener("resize", f));
1502
+ t.scenes.forEach((p) => p.destroy?.()), a && (a.disconnect(), a = null), c && (c.disconnect(), c = null), f && (u ? (u.disconnect(), u = null) : window.removeEventListener("resize", f));
1509
1503
  }
1510
1504
  return {
1511
- tick: v,
1505
+ tick: m,
1512
1506
  destroy: h
1513
1507
  };
1514
1508
  }
1515
- const ns = {
1509
+ const ts = {
1516
1510
  transitionActive: !1,
1517
1511
  transitionFriction: 0.9,
1518
1512
  transitionEpsilon: 1,
1519
1513
  velocityActive: !1,
1520
1514
  velocityMax: 1
1521
1515
  };
1522
- class ss {
1516
+ class ns {
1523
1517
  constructor(t = {}) {
1524
- this.config = ut(t, ns), this.progress = {
1518
+ this.config = dt(t, ts), this.progress = {
1525
1519
  p: 0,
1526
1520
  prevP: 0,
1527
1521
  vp: 0
@@ -1558,8 +1552,8 @@ class ss {
1558
1552
  * @param {number} [scrollPosition.y]
1559
1553
  */
1560
1554
  resetProgress(t = {}) {
1561
- const n = this.config.root, s = t.x || t.x === 0 ? t.x : n.scrollX || n.scrollLeft || 0, i = t.y || t.y === 0 ? t.y : n.scrollY || n.scrollTop || 0, r = this.config.horizontal ? s : i;
1562
- this.progress.p = r, this.progress.prevP = r, this.progress.vp = 0, this.config.transitionActive && (this.currentProgress.p = r, this.currentProgress.prevP = r, this.currentProgress.vp = 0), t && this.config.root.scrollTo(s, i);
1555
+ const n = this.config.root, s = t.x || t.x === 0 ? t.x : n.scrollX || n.scrollLeft || 0, i = t.y || t.y === 0 ? t.y : n.scrollY || n.scrollTop || 0, o = this.config.horizontal ? s : i;
1556
+ this.progress.p = o, this.progress.prevP = o, this.progress.vp = 0, this.config.transitionActive && (this.currentProgress.p = o, this.currentProgress.prevP = o, this.currentProgress.vp = 0), t && this.config.root.scrollTo(s, i);
1563
1557
  }
1564
1558
  /**
1565
1559
  * Handle animation frame work.
@@ -1571,8 +1565,8 @@ class ss {
1571
1565
  n && this.lerp();
1572
1566
  const s = n ? this.currentProgress : this.progress;
1573
1567
  if (this.config.velocityActive) {
1574
- const i = s.p - s.prevP, r = i < 0 ? -1 : 1;
1575
- s.vp = Math.min(this.config.velocityMax, Math.abs(i)) / this.config.velocityMax * r;
1568
+ const i = s.p - s.prevP, o = i < 0 ? -1 : 1;
1569
+ s.vp = Math.min(this.config.velocityMax, Math.abs(i)) / this.config.velocityMax * o;
1576
1570
  }
1577
1571
  this.effect.tick(s), n && s.p !== this.progress.p && (t && this._lerpFrameId && window.cancelAnimationFrame(this._lerpFrameId), this._lerpFrameId = window.requestAnimationFrame(() => this.tick())), s.prevP = s.p;
1578
1572
  }
@@ -1580,7 +1574,7 @@ class ss {
1580
1574
  * Calculate current progress.
1581
1575
  */
1582
1576
  lerp() {
1583
- this.currentProgress.p = Gn(this.currentProgress.p, this.progress.p, +(1 - this.config.transitionFriction).toFixed(3), this.config.transitionEpsilon);
1577
+ this.currentProgress.p = Dn(this.currentProgress.p, this.progress.p, +(1 - this.config.transitionFriction).toFixed(3), this.config.transitionEpsilon);
1584
1578
  }
1585
1579
  /**
1586
1580
  * Stop the event and effect, and remove all DOM side-effects.
@@ -1604,7 +1598,7 @@ class ss {
1604
1598
  * Reset registered effect.
1605
1599
  */
1606
1600
  setupEffect() {
1607
- this.removeEffect(), this.effect = ts(this.config);
1601
+ this.removeEffect(), this.effect = es(this.config);
1608
1602
  }
1609
1603
  /**
1610
1604
  * Remove registered effect.
@@ -1613,43 +1607,43 @@ class ss {
1613
1607
  this.effect && this.effect.destroy(), this.effect = null;
1614
1608
  }
1615
1609
  }
1616
- const we = /* @__PURE__ */ new WeakMap();
1617
- let ft = () => ({});
1618
- function is(e) {
1619
- ft = e;
1610
+ const be = /* @__PURE__ */ new WeakMap();
1611
+ let ht = () => ({});
1612
+ function ss(e) {
1613
+ ht = e;
1620
1614
  }
1621
- function rs(e, t, n, s, { reducedMotion: i }) {
1615
+ function is(e, t, n, s, { reducedMotion: i }) {
1622
1616
  if (i)
1623
1617
  return;
1624
- const r = {
1618
+ const o = {
1625
1619
  trigger: "view-progress",
1626
1620
  element: e
1627
- }, o = M(n);
1628
- let c;
1621
+ }, r = P(n);
1622
+ let a;
1629
1623
  if ("ViewTimeline" in window) {
1630
- const f = U(
1624
+ const f = X(
1631
1625
  t,
1632
- o,
1633
- r
1626
+ r,
1627
+ o
1634
1628
  );
1635
- f && !f.isCSS && (f.play(), c = () => {
1629
+ f && !f.isCSS && (f.play(), a = () => {
1636
1630
  f.ready.then(() => {
1637
1631
  f.cancel();
1638
1632
  });
1639
1633
  });
1640
1634
  } else {
1641
- const f = it(t, o, r);
1635
+ const f = at(t, r, o);
1642
1636
  if (f) {
1643
- const u = Array.isArray(f) ? f : [f], l = new ss({
1637
+ const u = Array.isArray(f) ? f : [f], l = new ns({
1644
1638
  viewSource: e,
1645
1639
  scenes: u,
1646
1640
  observeViewportEntry: !1,
1647
1641
  observeViewportResize: !1,
1648
1642
  observeSourcesResize: !0,
1649
1643
  root: document.body,
1650
- ...ft()
1644
+ ...ht()
1651
1645
  });
1652
- c = () => {
1646
+ a = () => {
1653
1647
  l.destroy();
1654
1648
  }, Promise.all(u.map((d) => d.ready || Promise.resolve())).then(
1655
1649
  () => {
@@ -1658,22 +1652,22 @@ function rs(e, t, n, s, { reducedMotion: i }) {
1658
1652
  );
1659
1653
  }
1660
1654
  }
1661
- if (!c) return;
1662
- const a = { source: e, target: t, cleanup: c };
1663
- q(we, e, a), q(we, t, a);
1655
+ if (!a) return;
1656
+ const c = { source: e, target: t, cleanup: a };
1657
+ A(be, e, c), A(be, t, c);
1664
1658
  }
1665
1659
  function os(e) {
1666
- Q(we, e);
1660
+ Z(be, e);
1667
1661
  }
1668
- const cs = {
1669
- add: rs,
1662
+ const rs = {
1663
+ add: is,
1670
1664
  remove: os,
1671
- registerOptionsGetter: is
1665
+ registerOptionsGetter: ss
1672
1666
  };
1673
- function je(e, t, n) {
1667
+ function We(e, t, n) {
1674
1668
  return Math.min(Math.max(e, n), t);
1675
1669
  }
1676
- function De(e) {
1670
+ function Ve(e) {
1677
1671
  let t = !1;
1678
1672
  return function() {
1679
1673
  if (!t)
@@ -1695,7 +1689,7 @@ function as(e) {
1695
1689
  height: e.offsetHeight
1696
1690
  };
1697
1691
  }
1698
- function us() {
1692
+ function cs() {
1699
1693
  const e = window.devicePixelRatio;
1700
1694
  let t = !1;
1701
1695
  if (e === 1)
@@ -1708,79 +1702,79 @@ function us() {
1708
1702
  });
1709
1703
  return document.body.dispatchEvent(n), t;
1710
1704
  }
1711
- function fs() {
1705
+ function us() {
1712
1706
  return new Promise((e) => {
1713
1707
  const t = window.scrollY;
1714
1708
  let n = !1, s;
1715
1709
  function i() {
1716
- document.body.addEventListener("pointerdown", (c) => {
1717
- s === void 0 ? s = c.offsetY : n = c.offsetY === s;
1710
+ document.body.addEventListener("pointerdown", (a) => {
1711
+ s === void 0 ? s = a.offsetY : n = a.offsetY === s;
1718
1712
  }, { once: !0 });
1719
- const o = new PointerEvent("pointerdown", {
1713
+ const r = new PointerEvent("pointerdown", {
1720
1714
  clientY: 500
1721
1715
  });
1722
- document.body.dispatchEvent(o);
1716
+ document.body.dispatchEvent(r);
1723
1717
  }
1724
- function r() {
1725
- window.scrollY !== t && (window.removeEventListener("scroll", r), i(), e(n));
1718
+ function o() {
1719
+ window.scrollY !== t && (window.removeEventListener("scroll", o), i(), e(n));
1726
1720
  }
1727
- i(), window.addEventListener("scroll", r), window.scrollY > 0 && window.scrollBy(0, -1);
1721
+ i(), window.addEventListener("scroll", o), window.scrollY > 0 && window.scrollBy(0, -1);
1728
1722
  });
1729
1723
  }
1730
- function ls(e) {
1731
- fs().then((t) => {
1724
+ function fs(e) {
1725
+ us().then((t) => {
1732
1726
  e.fixRequired = t, t && (window.addEventListener("scroll", e.scrollHandler), e.scrollHandler());
1733
1727
  });
1734
1728
  }
1735
- let ee = 0;
1736
- const re = /* @__PURE__ */ new Set();
1737
- function ds() {
1729
+ let ne = 0;
1730
+ const ae = /* @__PURE__ */ new Set();
1731
+ function ls() {
1738
1732
  const e = (n) => {
1739
1733
  for (let s of n.changedTouches)
1740
- re.add(s.identifier);
1734
+ ae.add(s.identifier);
1741
1735
  }, t = (n) => {
1742
1736
  for (let s of n.changedTouches)
1743
- re.delete(s.identifier);
1737
+ ae.delete(s.identifier);
1744
1738
  };
1745
1739
  return document.addEventListener("touchstart", e, { passive: !0 }), document.addEventListener("touchend", t, { passive: !0 }), function() {
1746
- re.clear(), document.removeEventListener("touchstart", e), document.removeEventListener("touchend", t);
1740
+ ae.clear(), document.removeEventListener("touchstart", e), document.removeEventListener("touchend", t);
1747
1741
  };
1748
1742
  }
1749
- function hs(e, t) {
1743
+ function ds(e, t) {
1750
1744
  if ("onscrollend" in window)
1751
1745
  return e.addEventListener("scrollend", t), function() {
1752
1746
  e.removeEventListener("scrollend", t);
1753
1747
  };
1754
1748
  let n = 0, s;
1755
- ee || (s = ds()), ee += 1;
1756
- function i(r) {
1749
+ ne || (s = ls()), ne += 1;
1750
+ function i(o) {
1757
1751
  clearTimeout(n), n = setTimeout(() => {
1758
- re.size ? setTimeout(i, 100) : (t(r), n = 0);
1752
+ ae.size ? setTimeout(i, 100) : (t(o), n = 0);
1759
1753
  }, 100);
1760
1754
  }
1761
1755
  return e.addEventListener("scroll", i), function() {
1762
- e.removeEventListener("scroll", i), ee -= 1, ee || s();
1756
+ e.removeEventListener("scroll", i), ne -= 1, ne || s();
1763
1757
  };
1764
1758
  }
1765
- function ms(e, t, n) {
1759
+ function hs(e, t, n) {
1766
1760
  return {
1767
1761
  x(s) {
1768
- const i = e.left - n.x + e.width / 2, r = i >= t.width / 2, o = (r ? i : t.width - i) * 2, c = r ? 0 : i - o / 2;
1769
- return (s - c) / o;
1762
+ const i = e.left - n.x + e.width / 2, o = i >= t.width / 2, r = (o ? i : t.width - i) * 2, a = o ? 0 : i - r / 2;
1763
+ return (s - a) / r;
1770
1764
  },
1771
1765
  y(s) {
1772
- const i = e.top - n.y + e.height / 2, r = i >= t.height / 2, o = (r ? i : t.height - i) * 2, c = r ? 0 : i - o / 2;
1773
- return (s - c) / o;
1766
+ const i = e.top - n.y + e.height / 2, o = i >= t.height / 2, r = (o ? i : t.height - i) * 2, a = o ? 0 : i - r / 2;
1767
+ return (s - a) / r;
1774
1768
  }
1775
1769
  };
1776
1770
  }
1777
- function ps(e, t) {
1771
+ function ms(e, t) {
1778
1772
  this.x = window.scrollX, this.y = window.scrollY, requestAnimationFrame(() => e && e(t));
1779
1773
  }
1780
- function gs(e) {
1774
+ function ps(e) {
1781
1775
  e.rect.width = window.document.documentElement.clientWidth, e.rect.height = window.document.documentElement.clientHeight;
1782
1776
  }
1783
- function vs(e) {
1777
+ function gs(e) {
1784
1778
  const t = new ResizeObserver((n) => {
1785
1779
  n.forEach((s) => {
1786
1780
  e.rect.width = s.borderBoxSize[0].inlineSize, e.rect.height = s.borderBoxSize[0].blockSize;
@@ -1788,38 +1782,38 @@ function vs(e) {
1788
1782
  });
1789
1783
  return t.observe(e.root, { box: "border-box" }), t;
1790
1784
  }
1791
- function ys(e) {
1792
- let t = !1, n = { x: e.rect.width / 2, y: e.rect.height / 2, vx: 0, vy: 0 }, s, i, r, o, c;
1793
- const a = { x: 0, y: 0 };
1785
+ function vs(e) {
1786
+ let t = !1, n = { x: e.rect.width / 2, y: e.rect.height / 2, vx: 0, vy: 0 }, s, i, o, r, a;
1787
+ const c = { x: 0, y: 0 };
1794
1788
  e.scenes.forEach((u) => {
1795
- u.target && u.centeredToTarget && (u.transform = ms(as(u.target), e.rect, a), t = !0), e.root ? i = vs(e) : (r = gs.bind(null, e), window.addEventListener("resize", r));
1789
+ u.target && u.centeredToTarget && (u.transform = hs(as(u.target), e.rect, c), t = !0), e.root ? i = gs(e) : (o = ps.bind(null, e), window.addEventListener("resize", o));
1796
1790
  }), s = function(u) {
1797
1791
  for (let l of e.scenes)
1798
1792
  if (!l.disabled) {
1799
- const d = l.transform?.x(u.x) || u.x / e.rect.width, v = l.transform?.y(u.y) || u.y / e.rect.height, h = +je(0, 1, d).toPrecision(4), m = +je(0, 1, v).toPrecision(4), p = { x: u.vx, y: u.vy };
1800
- e.allowActiveEvent && (u.active = d <= 1 && v <= 1 && d >= 0 && v >= 0), l.effect(l, { x: h, y: m }, p, u.active);
1793
+ const d = l.transform?.x(u.x) || u.x / e.rect.width, m = l.transform?.y(u.y) || u.y / e.rect.height, h = +We(0, 1, d).toPrecision(4), p = +We(0, 1, m).toPrecision(4), g = { x: u.vx, y: u.vy };
1794
+ e.allowActiveEvent && (u.active = d <= 1 && m <= 1 && d >= 0 && m >= 0), l.effect(l, { x: h, y: p }, g, u.active);
1801
1795
  }
1802
1796
  Object.assign(n, u);
1803
- }, t && (o = ps.bind(a, s, n), c = hs(document, o));
1797
+ }, t && (r = ms.bind(c, s, n), a = ds(document, r));
1804
1798
  function f() {
1805
- e.scenes.forEach((u) => u.destroy?.()), c?.(), i ? (i.disconnect(), i = null) : (window.removeEventListener("resize", r), r = null), s = null, n = null;
1799
+ e.scenes.forEach((u) => u.destroy?.()), a?.(), i ? (i.disconnect(), i = null) : (window.removeEventListener("resize", o), o = null), s = null, n = null;
1806
1800
  }
1807
1801
  return {
1808
1802
  tick: s,
1809
1803
  destroy: f
1810
1804
  };
1811
1805
  }
1812
- const Es = 1e3 / 60 * 3;
1813
- let te;
1814
- function ws() {
1815
- R.x = window.scrollX, R.y = window.scrollY;
1806
+ const ys = 1e3 / 60 * 3;
1807
+ let se;
1808
+ function Es() {
1809
+ N.x = window.scrollX, N.y = window.scrollY;
1816
1810
  }
1817
- const R = { x: 0, y: 0, scrollHandler: ws, fixRequired: void 0 };
1818
- class bs {
1811
+ const N = { x: 0, y: 0, scrollHandler: Es, fixRequired: void 0 };
1812
+ class ws {
1819
1813
  constructor(t = {}) {
1820
1814
  this.config = { ...t }, this.effect = null, this._nextTick = null, this._nextTransitionTick = null, this._startTime = 0;
1821
1815
  let n;
1822
- this.config.transitionDuration ? n = this.config.noThrottle ? () => this.transition() : De(() => this.transition()) : n = this.config.noThrottle ? () => (this.tick(), null) : De(() => {
1816
+ this.config.transitionDuration ? n = this.config.noThrottle ? () => this.transition() : Ve(() => this.transition()) : n = this.config.noThrottle ? () => (this.tick(), null) : Ve(() => {
1823
1817
  this.tick();
1824
1818
  }), this.config.rect = this.config.root ? {
1825
1819
  width: this.config.root.offsetWidth,
@@ -1834,27 +1828,27 @@ class bs {
1834
1828
  vy: 0
1835
1829
  }, this.previousProgress = { ...this.progress }, this.currentProgress = null;
1836
1830
  const s = (i) => {
1837
- const r = this.config.root ? i.offsetX : i.x, o = this.config.root ? i.offsetY : i.y;
1838
- this.progress.vx = r - this.progress.x, this.progress.vy = o - this.progress.y, this.progress.x = r, this.progress.y = o, this._nextTick = n();
1831
+ const o = this.config.root ? i.offsetX : i.x, r = this.config.root ? i.offsetY : i.y;
1832
+ this.progress.vx = o - this.progress.x, this.progress.vy = r - this.progress.y, this.progress.x = o, this.progress.y = r, this._nextTick = n();
1839
1833
  };
1840
1834
  if (this._pointerLeave = () => {
1841
1835
  this.progress.active = !1, this.progress.vx = 0, this.progress.vy = 0, this._nextTick = n();
1842
1836
  }, this._pointerEnter = () => {
1843
1837
  this.progress.active = !0, this._nextTick = n();
1844
1838
  }, this.config.root) {
1845
- te = typeof te == "boolean" ? te : us();
1846
- const i = te ? window.devicePixelRatio : 1;
1847
- typeof R.fixRequired > "u" && ls(R), this._measure = (r) => {
1848
- if (r.target !== this.config.root) {
1849
- const o = new PointerEvent("pointermove", {
1839
+ se = typeof se == "boolean" ? se : cs();
1840
+ const i = se ? window.devicePixelRatio : 1;
1841
+ typeof N.fixRequired > "u" && fs(N), this._measure = (o) => {
1842
+ if (o.target !== this.config.root) {
1843
+ const r = new PointerEvent("pointermove", {
1850
1844
  bubbles: !0,
1851
1845
  cancelable: !0,
1852
- clientX: r.x * i + R.x,
1853
- clientY: r.y * i + R.y
1846
+ clientX: o.x * i + N.x,
1847
+ clientY: o.y * i + N.y
1854
1848
  });
1855
- r.stopPropagation(), this.config.root.dispatchEvent(o);
1849
+ o.stopPropagation(), this.config.root.dispatchEvent(r);
1856
1850
  } else
1857
- s(r);
1851
+ s(o);
1858
1852
  };
1859
1853
  } else
1860
1854
  this._measure = s;
@@ -1883,13 +1877,13 @@ class bs {
1883
1877
  * @returns {number} the requestAnimationFrame id for the transition tick.
1884
1878
  */
1885
1879
  transition() {
1886
- const t = this.config.transitionDuration, n = this.config.transitionEasing || ((o) => o), s = performance.now();
1880
+ const t = this.config.transitionDuration, n = this.config.transitionEasing || ((r) => r), s = performance.now();
1887
1881
  let i = !1;
1888
- const r = (o) => {
1889
- const c = (o - this._startTime) / t, a = n(Math.min(1, c));
1890
- i && (this.progress.vx = 0, this.progress.vy = 0, i = !1), this.currentProgress = Object.entries(this.progress).reduce((f, [u, l]) => (u === "active" ? f[u] = l : f[u] = this.previousProgress[u] + (l - this.previousProgress[u]) * a, f), this.currentProgress || {}), c < 1 && (this._nextTransitionTick = requestAnimationFrame(r), i = o - this._startTime > Es), this.effect.tick(this.currentProgress);
1882
+ const o = (r) => {
1883
+ const a = (r - this._startTime) / t, c = n(Math.min(1, a));
1884
+ i && (this.progress.vx = 0, this.progress.vy = 0, i = !1), this.currentProgress = Object.entries(this.progress).reduce((f, [u, l]) => (u === "active" ? f[u] = l : f[u] = this.previousProgress[u] + (l - this.previousProgress[u]) * c, f), this.currentProgress || {}), a < 1 && (this._nextTransitionTick = requestAnimationFrame(o), i = r - this._startTime > ys), this.effect.tick(this.currentProgress);
1891
1885
  };
1892
- return this._startTime ? (this._nextTransitionTick && cancelAnimationFrame(this._nextTransitionTick), Object.assign(this.previousProgress, this.currentProgress), this._startTime = s, r(s)) : this._startTime = s, this._nextTransitionTick;
1886
+ return this._startTime ? (this._nextTransitionTick && cancelAnimationFrame(this._nextTransitionTick), Object.assign(this.previousProgress, this.currentProgress), this._startTime = s, o(s)) : this._startTime = s, this._nextTransitionTick;
1893
1887
  }
1894
1888
  /**
1895
1889
  * Stop the event and effect, and remove all DOM side effects.
@@ -1916,7 +1910,7 @@ class bs {
1916
1910
  * Reset registered effect.
1917
1911
  */
1918
1912
  setupEffect() {
1919
- this.removeEffect(), this.effect = ys(this.config);
1913
+ this.removeEffect(), this.effect = vs(this.config);
1920
1914
  }
1921
1915
  /**
1922
1916
  * Remove registered effect.
@@ -1925,233 +1919,233 @@ class bs {
1925
1919
  this.effect && this.effect.destroy(), this.effect = null;
1926
1920
  }
1927
1921
  }
1928
- const be = /* @__PURE__ */ new WeakMap();
1929
- let lt = () => ({});
1922
+ const Se = /* @__PURE__ */ new WeakMap();
1923
+ let mt = () => ({});
1930
1924
  function $s(e) {
1931
- lt = e;
1925
+ mt = e;
1932
1926
  }
1933
- function Ss(e, t, n, s = {}, { reducedMotion: i }) {
1927
+ function bs(e, t, n, s = {}, { reducedMotion: i }) {
1934
1928
  if (i)
1935
1929
  return;
1936
- const r = {
1930
+ const o = {
1937
1931
  trigger: "pointer-move",
1938
1932
  element: e,
1939
1933
  axis: s.axis ?? "y"
1940
- }, o = it(t, M(n), r);
1941
- if (o) {
1942
- const c = Array.isArray(o) ? o : [o], a = new bs({
1934
+ }, r = at(t, P(n), o);
1935
+ if (r) {
1936
+ const a = Array.isArray(r) ? r : [r], c = new ws({
1943
1937
  root: s.hitArea === "self" ? e : void 0,
1944
- scenes: c,
1945
- ...lt()
1938
+ scenes: a,
1939
+ ...mt()
1946
1940
  }), u = { source: e, target: t, cleanup: () => {
1947
- a.destroy();
1941
+ c.destroy();
1948
1942
  } };
1949
- q(be, e, u), q(be, t, u), Promise.all(
1950
- c.map((l) => l.ready || Promise.resolve())
1943
+ A(Se, e, u), A(Se, t, u), Promise.all(
1944
+ a.map((l) => l.ready || Promise.resolve())
1951
1945
  ).then(() => {
1952
- a.start();
1946
+ c.start();
1953
1947
  });
1954
1948
  }
1955
1949
  }
1956
- function Is(e) {
1957
- Q(be, e);
1950
+ function Ss(e) {
1951
+ Z(Se, e);
1958
1952
  }
1959
- const Ts = {
1960
- add: Ss,
1961
- remove: Is,
1953
+ const Is = {
1954
+ add: bs,
1955
+ remove: Ss,
1962
1956
  registerOptionsGetter: $s
1963
- }, $e = /* @__PURE__ */ new WeakMap();
1964
- function Os(e, t, n, s, {
1957
+ }, Ie = /* @__PURE__ */ new WeakMap();
1958
+ function Ts(e, t, n, s, {
1965
1959
  reducedMotion: i,
1966
- selectorCondition: r,
1967
- animation: o,
1968
- sourceAnimationOptions: c
1960
+ selectorCondition: o,
1961
+ animation: r,
1962
+ sourceAnimationOptions: a
1969
1963
  }) {
1970
- const a = o || U(
1964
+ const c = r || X(
1971
1965
  t,
1972
- M(n),
1966
+ P(n),
1973
1967
  void 0,
1974
1968
  i
1975
1969
  );
1976
- if (!a)
1970
+ if (!c)
1977
1971
  return;
1978
- const { effectId: f } = s, u = (v) => {
1979
- if (r && !t.matches(r)) return;
1980
- const h = v.animationName, m = v.detail?.effectId, p = c ? st(e, c) : null;
1981
- if (p) {
1982
- if (p.playState === "running" || h && !p.hasAnimationName(h))
1972
+ const { effectId: f } = s, u = (m) => {
1973
+ if (o && !t.matches(o)) return;
1974
+ const h = m.animationName, p = m.detail?.effectId, g = a ? rt(e, a) : null;
1975
+ if (g) {
1976
+ if (g.playState === "running" || h && !g.hasAnimationName(h))
1983
1977
  return;
1984
- if (m && m !== f && !p.hasAnimationId(m))
1978
+ if (p && p !== f && !g.hasAnimationId(p))
1985
1979
  return;
1986
1980
  }
1987
- a.play();
1981
+ c.play();
1988
1982
  }, d = { source: e, target: t, cleanup: () => {
1989
- a.cancel(), e.removeEventListener("animationend", u);
1983
+ c.cancel(), e.removeEventListener("animationend", u);
1990
1984
  } };
1991
- q($e, e, d), q($e, t, d), e.addEventListener("animationend", u);
1985
+ A(Ie, e, d), A(Ie, t, d), e.addEventListener("animationend", u);
1992
1986
  }
1993
1987
  function Cs(e) {
1994
- Q($e, e);
1988
+ Z(Ie, e);
1995
1989
  }
1996
- const As = {
1997
- add: Os,
1990
+ const Os = {
1991
+ add: Ts,
1998
1992
  remove: Cs
1999
1993
  };
2000
- function qs(e, t, n = !1, s, i, r) {
2001
- const o = r || U(
1994
+ function _s(e, t, n = !1, s, i, o) {
1995
+ const r = o || X(
2002
1996
  e,
2003
- M(t),
1997
+ P(t),
2004
1998
  void 0,
2005
1999
  n
2006
2000
  );
2007
- if (!o)
2001
+ if (!r)
2008
2002
  return null;
2009
- let c = !0;
2010
- const a = t.triggerType || "alternate";
2003
+ let a = !0;
2004
+ const c = t.triggerType || "alternate";
2011
2005
  return (f) => {
2012
2006
  if (s && !e.matches(s)) return;
2013
2007
  const u = !i, l = i?.enter?.includes(f.type), d = i?.leave?.includes(f.type);
2014
2008
  if (l || u) {
2015
- if (a === "alternate" || a === "state")
2016
- c ? (c = !1, o.play()) : a === "alternate" ? o.reverse() : a === "state" && (o.playState === "running" ? o.pause() : o.playState !== "finished" && o.play());
2009
+ if (c === "alternate" || c === "state")
2010
+ a ? (a = !1, r.play()) : c === "alternate" ? r.reverse() : c === "state" && (r.playState === "running" ? r.pause() : r.playState !== "finished" && r.play());
2017
2011
  else {
2018
- if (o.progress(0), delete e.dataset.interactEnter, o.isCSS) {
2019
- const v = () => {
2020
- O.mutate(() => {
2012
+ if (r.progress(0), delete e.dataset.interactEnter, r.isCSS) {
2013
+ const m = () => {
2014
+ C.mutate(() => {
2021
2015
  e.dataset.interactEnter = "done";
2022
2016
  });
2023
2017
  };
2024
- o.onFinish(v), o.onAbort(v);
2018
+ r.onFinish(m), r.onAbort(m);
2025
2019
  }
2026
- o.play();
2020
+ r.play();
2027
2021
  }
2028
2022
  return;
2029
2023
  }
2030
- d && (a === "alternate" ? o.reverse() : a === "repeat" ? (o.cancel(), O.mutate(() => {
2024
+ d && (c === "alternate" ? r.reverse() : c === "repeat" ? (r.cancel(), C.mutate(() => {
2031
2025
  delete e.dataset.interactEnter;
2032
- })) : a === "state" && o.playState === "running" && o.pause());
2026
+ })) : c === "state" && r.playState === "running" && r.pause());
2033
2027
  };
2034
2028
  }
2035
- function _s(e, t, {
2029
+ function As(e, t, {
2036
2030
  effectId: n,
2037
2031
  listContainer: s,
2038
2032
  listItemSelector: i,
2039
- stateAction: r
2040
- }, o, c) {
2041
- const a = !!s, f = r ?? "toggle", u = f === "toggle";
2033
+ stateAction: o
2034
+ }, r, a) {
2035
+ const c = !!s, f = o ?? "toggle", u = f === "toggle";
2042
2036
  return (l) => {
2043
- if (o && !e.matches(o)) return;
2044
- const d = a ? e.closest(
2037
+ if (r && !e.matches(r)) return;
2038
+ const d = c ? e.closest(
2045
2039
  `${s} > ${i || ""}:has(:scope)`
2046
- ) : void 0, v = !c, h = c?.enter?.includes(l.type), m = c?.leave?.includes(l.type);
2047
- v ? t.toggleEffect(n, f, d) : (h && t.toggleEffect(n, u ? "add" : f, d), m && u && t.toggleEffect(n, "remove", d));
2040
+ ) : void 0, m = !a, h = a?.enter?.includes(l.type), p = a?.leave?.includes(l.type);
2041
+ m ? t.toggleEffect(n, f, d) : (h && t.toggleEffect(n, u ? "add" : f, d), p && u && t.toggleEffect(n, "remove", d));
2048
2042
  };
2049
2043
  }
2050
- const Se = /* @__PURE__ */ new WeakMap();
2051
- function Ge(e, t) {
2044
+ const Te = /* @__PURE__ */ new WeakMap();
2045
+ function Ye(e, t) {
2052
2046
  return (n) => {
2053
2047
  const s = n;
2054
2048
  e.contains(s.relatedTarget) || t(s);
2055
2049
  };
2056
2050
  }
2057
- function ks(e) {
2051
+ function qs(e) {
2058
2052
  return (t) => {
2059
2053
  const n = t;
2060
2054
  n.pointerType && e(n);
2061
2055
  };
2062
2056
  }
2063
- function Ps(e) {
2057
+ function ks(e) {
2064
2058
  return (t) => {
2065
2059
  const n = t;
2066
2060
  n.code === "Space" ? (n.preventDefault(), e(n)) : n.code === "Enter" && e(n);
2067
2061
  };
2068
2062
  }
2069
2063
  const Ms = {
2070
- focusin: (e, t) => Ge(e, t),
2071
- focusout: (e, t) => Ge(e, t),
2072
- click: (e, t) => ks(t),
2073
- keydown: (e, t) => Ps(t)
2064
+ focusin: (e, t) => Ye(e, t),
2065
+ focusout: (e, t) => Ye(e, t),
2066
+ click: (e, t) => qs(t),
2067
+ keydown: (e, t) => ks(t)
2074
2068
  };
2075
- function xs(e, t, n) {
2069
+ function Ps(e, t, n) {
2076
2070
  const s = Ms[e];
2077
2071
  return s ? s(t, n) : (i) => n(i);
2078
2072
  }
2079
- function Ls(e) {
2073
+ function xs(e) {
2080
2074
  return typeof e == "object" && !Array.isArray(e) && ("enter" in e || "leave" in e);
2081
2075
  }
2082
- function Fs(e) {
2076
+ function Ls(e) {
2083
2077
  if (typeof e == "string")
2084
2078
  return { toggle: [e] };
2085
2079
  if (Array.isArray(e))
2086
2080
  return { toggle: [...e] };
2087
- if (Ls(e)) {
2081
+ if (xs(e)) {
2088
2082
  const t = e.enter ? [...e.enter] : [], n = e.leave ? [...e.leave] : [];
2089
2083
  return { enter: t, leave: n };
2090
2084
  }
2091
2085
  return {};
2092
2086
  }
2093
- function Rs(e) {
2087
+ function Fs(e) {
2094
2088
  return !!(e.enter?.length || e.leave?.length);
2095
2089
  }
2096
- function Ns(e) {
2097
- return Rs(e) ? { enter: e.enter ?? [], leave: e.leave ?? [] } : void 0;
2090
+ function Rs(e) {
2091
+ return Fs(e) ? { enter: e.enter ?? [], leave: e.leave ?? [] } : void 0;
2098
2092
  }
2099
- function zs(e, t, n, s, {
2093
+ function Ns(e, t, n, s, {
2100
2094
  reducedMotion: i,
2101
- targetController: r,
2102
- selectorCondition: o,
2103
- animation: c
2095
+ targetController: o,
2096
+ selectorCondition: r,
2097
+ animation: a
2104
2098
  }) {
2105
- const a = Fs(s.eventConfig), f = n.transition || n.transitionProperties, u = Ns(a);
2099
+ const c = Ls(s.eventConfig), f = n.transition || n.transitionProperties, u = Rs(c);
2106
2100
  let l, d = !1;
2107
- if (f ? l = _s(
2101
+ if (f ? l = As(
2108
2102
  t,
2109
- r,
2110
- n,
2111
2103
  o,
2104
+ n,
2105
+ r,
2112
2106
  u
2113
- ) : (l = qs(
2107
+ ) : (l = _s(
2114
2108
  t,
2115
2109
  n,
2116
2110
  i,
2117
- o,
2111
+ r,
2118
2112
  u,
2119
- c
2113
+ a
2120
2114
  ), d = n.triggerType === "once"), !l)
2121
2115
  return;
2122
- const v = l, h = new AbortController();
2123
- function m(E, y, w) {
2124
- const $ = xs(y, e, v);
2125
- E.addEventListener(y, $, { ...w, signal: h.signal });
2116
+ const m = l, h = new AbortController();
2117
+ function p(y, E, $) {
2118
+ const b = Ps(E, e, m);
2119
+ y.addEventListener(E, b, { ...$, signal: h.signal });
2126
2120
  }
2127
- const g = { source: e, target: t, cleanup: () => {
2121
+ const v = { source: e, target: t, cleanup: () => {
2128
2122
  h.abort();
2129
2123
  } };
2130
- if (q(Se, e, g), q(Se, t, g), u) {
2131
- const E = a.enter, y = a.leave;
2132
- E.forEach((S) => {
2133
- S === "focusin" && (e.tabIndex = 0), m(e, S, { passive: !0, once: d });
2124
+ if (A(Te, e, v), A(Te, t, v), u) {
2125
+ const y = c.enter, E = c.leave;
2126
+ y.forEach((S) => {
2127
+ S === "focusin" && (e.tabIndex = 0), p(e, S, { passive: !0, once: d });
2134
2128
  });
2135
- const w = !n.stateAction || n.stateAction === "toggle";
2136
- (f ? w : n.triggerType !== "once") && y.forEach((S) => {
2129
+ const $ = !n.stateAction || n.stateAction === "toggle";
2130
+ (f ? $ : n.triggerType !== "once") && E.forEach((S) => {
2137
2131
  if (S === "focusout") {
2138
- m(e, S, { once: d });
2132
+ p(e, S, { once: d });
2139
2133
  return;
2140
2134
  }
2141
- m(e, S, { passive: !0 });
2135
+ p(e, S, { passive: !0 });
2142
2136
  });
2143
2137
  } else
2144
- (a.toggle ?? []).forEach((y) => {
2145
- m(e, y, { once: d, passive: y !== "keydown" });
2138
+ (c.toggle ?? []).forEach((E) => {
2139
+ p(e, E, { once: d, passive: E !== "keydown" });
2146
2140
  });
2147
2141
  }
2148
- function js(e) {
2149
- Q(Se, e);
2142
+ function zs(e) {
2143
+ Z(Te, e);
2150
2144
  }
2151
- const H = {
2152
- add: zs,
2153
- remove: js
2154
- }, Ie = {
2145
+ const Y = {
2146
+ add: Ns,
2147
+ remove: zs
2148
+ }, Ce = {
2155
2149
  click: ["click"],
2156
2150
  activate: ["click", "keydown"],
2157
2151
  hover: { enter: ["mouseenter"], leave: ["mouseleave"] },
@@ -2159,43 +2153,43 @@ const H = {
2159
2153
  enter: ["mouseenter", "focusin"],
2160
2154
  leave: ["mouseleave", "focusout"]
2161
2155
  }
2162
- }, He = {
2163
- click: Ie.activate,
2164
- hover: Ie.interest
2156
+ }, Ke = {
2157
+ click: Ce.activate,
2158
+ hover: Ce.interest
2165
2159
  };
2166
- function ne(e) {
2167
- const t = Ie[e];
2168
- return (n, s, i, r, o) => {
2169
- const c = o?.allowA11yTriggers && e in He ? He[e] : t;
2170
- H.add(n, s, i, { eventConfig: c }, o ?? {});
2160
+ function ie(e) {
2161
+ const t = Ce[e];
2162
+ return (n, s, i, o, r) => {
2163
+ const a = r?.allowA11yTriggers && e in Ke ? Ke[e] : t;
2164
+ Y.add(n, s, i, { eventConfig: a }, r ?? {});
2171
2165
  };
2172
2166
  }
2173
- const N = {
2174
- viewEnter: Dn,
2167
+ const j = {
2168
+ viewEnter: jn,
2175
2169
  hover: {
2176
- add: ne("hover"),
2177
- remove: H.remove
2170
+ add: ie("hover"),
2171
+ remove: Y.remove
2178
2172
  },
2179
2173
  click: {
2180
- add: ne("click"),
2181
- remove: H.remove
2174
+ add: ie("click"),
2175
+ remove: Y.remove
2182
2176
  },
2183
- animationEnd: As,
2184
- viewProgress: cs,
2185
- pointerMove: Ts,
2177
+ animationEnd: Os,
2178
+ viewProgress: rs,
2179
+ pointerMove: Is,
2186
2180
  activate: {
2187
- add: ne("activate"),
2188
- remove: H.remove
2181
+ add: ie("activate"),
2182
+ remove: Y.remove
2189
2183
  },
2190
2184
  interest: {
2191
- add: ne("interest"),
2192
- remove: H.remove
2185
+ add: ie("interest"),
2186
+ remove: Y.remove
2193
2187
  }
2194
2188
  };
2195
- function Ds(e) {
2189
+ function js(e) {
2196
2190
  return e.replace(/\[([-\w]+)]/g, "[]");
2197
2191
  }
2198
- class b {
2192
+ class w {
2199
2193
  static defineInteractElement;
2200
2194
  dataCache;
2201
2195
  addedInteractions;
@@ -2215,13 +2209,13 @@ class b {
2215
2209
  init(t, n) {
2216
2210
  if (typeof window > "u" || !window.customElements)
2217
2211
  return;
2218
- const s = n?.useCustomElement ?? !!b.defineInteractElement;
2212
+ const s = n?.useCustomElement ?? !!w.defineInteractElement;
2219
2213
  this.dataCache = Hs(t, s);
2220
- const i = b.defineInteractElement?.();
2221
- s && i === !1 ? document.querySelectorAll("interact-element").forEach((r) => {
2222
- r.connect();
2223
- }) : b.controllerCache.forEach(
2224
- (r, o) => r.connect(o)
2214
+ const i = w.defineInteractElement?.();
2215
+ s && i === !1 ? document.querySelectorAll("interact-element").forEach((o) => {
2216
+ o.connect();
2217
+ }) : w.controllerCache.forEach(
2218
+ (o, r) => o.connect(r)
2225
2219
  );
2226
2220
  }
2227
2221
  destroy({ clearCache: t = !1 } = {}) {
@@ -2229,20 +2223,20 @@ class b {
2229
2223
  n.disconnect({ removeFromCache: t });
2230
2224
  for (const [, n] of this.mediaQueryListeners.entries())
2231
2225
  n.mql.removeEventListener("change", n.handler);
2232
- this.mediaQueryListeners.clear(), this.addedInteractions = {}, this.listInteractionsCache = {}, this.controllers.clear(), this.dataCache = { effects: {}, sequences: {}, conditions: {}, interactions: {} }, b.instances.splice(b.instances.indexOf(this), 1);
2226
+ this.mediaQueryListeners.clear(), this.addedInteractions = {}, this.listInteractionsCache = {}, this.controllers.clear(), this.dataCache = { effects: {}, sequences: {}, conditions: {}, interactions: {} }, w.instances.splice(w.instances.indexOf(this), 1);
2233
2227
  }
2234
2228
  setController(t, n) {
2235
- this.controllers.add(n), b.setController(t, n);
2229
+ this.controllers.add(n), w.setController(t, n);
2236
2230
  }
2237
2231
  deleteController(t, n = !1) {
2238
- const s = b.controllerCache.get(t);
2239
- this.clearInteractionStateForKey(t), this.clearMediaQueryListenersForKey(t), s && n && (this.controllers.delete(s), b.deleteController(t));
2232
+ const s = w.controllerCache.get(t);
2233
+ this.clearInteractionStateForKey(t), this.clearMediaQueryListenersForKey(t), s && n && (this.controllers.delete(s), w.deleteController(t));
2240
2234
  }
2241
2235
  has(t) {
2242
2236
  return !!this.get(t);
2243
2237
  }
2244
2238
  get(t) {
2245
- const n = Ds(t);
2239
+ const n = js(t);
2246
2240
  return this.dataCache.interactions[n];
2247
2241
  }
2248
2242
  clearMediaQueryListenersForKey(t) {
@@ -2251,12 +2245,12 @@ class b {
2251
2245
  }
2252
2246
  clearInteractionStateForKey(t) {
2253
2247
  (this.get(t)?.interactionIds || []).forEach((i) => {
2254
- const r = _(i, t);
2255
- delete this.addedInteractions[r];
2248
+ const o = q(i, t);
2249
+ delete this.addedInteractions[o];
2256
2250
  });
2257
2251
  const s = `${t}::seq::`;
2258
- for (const i of b.sequenceCache.keys())
2259
- i.startsWith(s) && (b.sequenceCache.delete(i), delete this.addedInteractions[i]);
2252
+ for (const i of w.sequenceCache.keys())
2253
+ i.startsWith(s) && (w.sequenceCache.delete(i), delete this.addedInteractions[i]);
2260
2254
  }
2261
2255
  setupMediaQueryListener(t, n, s, i) {
2262
2256
  this.mediaQueryListeners.has(t) || (n.addEventListener("change", i), this.mediaQueryListeners.set(t, {
@@ -2266,91 +2260,91 @@ class b {
2266
2260
  }));
2267
2261
  }
2268
2262
  static create(t, n) {
2269
- const s = new b();
2270
- return b.instances.push(s), s.init(t, n), s;
2263
+ const s = new w();
2264
+ return w.instances.push(s), s.init(t, n), s;
2271
2265
  }
2272
2266
  static destroy() {
2273
- b.controllerCache.forEach((t) => {
2267
+ w.controllerCache.forEach((t) => {
2274
2268
  t.disconnect();
2275
- }), b.instances.length = 0, b.controllerCache.clear(), b.sequenceCache.clear(), b.elementSequenceMap = /* @__PURE__ */ new WeakMap();
2269
+ }), w.instances.length = 0, w.controllerCache.clear(), w.sequenceCache.clear(), w.elementSequenceMap = /* @__PURE__ */ new WeakMap();
2276
2270
  }
2277
2271
  static setup(t) {
2278
- t.scrollOptionsGetter && N.viewProgress.registerOptionsGetter?.(
2272
+ t.scrollOptionsGetter && j.viewProgress.registerOptionsGetter?.(
2279
2273
  t.scrollOptionsGetter
2280
- ), t.pointerOptionsGetter && N.pointerMove.registerOptionsGetter?.(
2274
+ ), t.pointerOptionsGetter && j.pointerMove.registerOptionsGetter?.(
2281
2275
  t.pointerOptionsGetter
2282
- ), t.viewEnter && N.viewEnter.setOptions(
2276
+ ), t.viewEnter && j.viewEnter.setOptions(
2283
2277
  t.viewEnter
2284
- ), t.allowA11yTriggers !== void 0 && (b.allowA11yTriggers = t.allowA11yTriggers);
2278
+ ), t.allowA11yTriggers !== void 0 && (w.allowA11yTriggers = t.allowA11yTriggers);
2285
2279
  }
2286
2280
  static getInstance(t) {
2287
- const n = b.instances.find((s) => s.has(t));
2281
+ const n = w.instances.find((s) => s.has(t));
2288
2282
  return n || console.warn(`Interact: Instance for key "${t}" not found`), n;
2289
2283
  }
2290
2284
  static getController(t) {
2291
- const n = t ? b.controllerCache.get(t) : void 0;
2285
+ const n = t ? w.controllerCache.get(t) : void 0;
2292
2286
  return n || console.warn(`Interact: Controller for key "${t}" not found`), n;
2293
2287
  }
2294
2288
  static setController(t, n) {
2295
- b.controllerCache.set(t, n);
2289
+ w.controllerCache.set(t, n);
2296
2290
  }
2297
2291
  static deleteController(t) {
2298
- b.controllerCache.delete(t);
2292
+ w.controllerCache.delete(t);
2299
2293
  }
2300
- static registerEffects = wn;
2294
+ static registerEffects = En;
2301
2295
  /**
2302
2296
  * Registers a plugin under a name. When the config carries a plugin field (e.g. `$splitText`) with a matching key
2303
2297
  * (on an interaction or effect), Interact invokes the plugin with the field's value and a
2304
2298
  * context. Interact is agnostic to what the plugin does — see the `InteractPlugin` type.
2305
2299
  */
2306
2300
  static use(t, n) {
2307
- b.plugins.set(t, n);
2301
+ w.plugins.set(t, n);
2308
2302
  }
2309
2303
  static getPlugin(t) {
2310
- return b.plugins.get(t);
2304
+ return w.plugins.get(t);
2311
2305
  }
2312
2306
  static getPluginsNames() {
2313
- return new Set(b.plugins.keys());
2307
+ return new Set(w.plugins.keys());
2314
2308
  }
2315
2309
  static getSequence(t, n, s, i) {
2316
- const r = b.sequenceCache.get(t);
2317
- if (r) return r;
2318
- const o = kn(n, s, i);
2319
- return b.sequenceCache.set(t, o), b._registerSequenceElements(s, o), o;
2310
+ const o = w.sequenceCache.get(t);
2311
+ if (o) return o;
2312
+ const r = qn(n, s, i);
2313
+ return w.sequenceCache.set(t, r), w._registerSequenceElements(s, r), r;
2320
2314
  }
2321
2315
  static addToSequence(t, n, s, i) {
2322
- const r = b.sequenceCache.get(t);
2323
- if (!r) return !1;
2324
- const c = rt(n, i).map((a, f) => ({
2325
- index: s[f] ?? r.animationGroups.length,
2326
- group: a
2316
+ const o = w.sequenceCache.get(t);
2317
+ if (!o) return !1;
2318
+ const a = ct(n, i).map((c, f) => ({
2319
+ index: s[f] ?? o.animationGroups.length,
2320
+ group: c
2327
2321
  }));
2328
- return r.addGroups(c), b._registerSequenceElements(n, r), !0;
2322
+ return o.addGroups(a), w._registerSequenceElements(n, o), !0;
2329
2323
  }
2330
2324
  static _registerSequenceElements(t, n) {
2331
2325
  for (const { target: s } of t) {
2332
2326
  const i = Array.isArray(s) ? s : s instanceof HTMLElement ? [s] : [];
2333
- for (const r of i) {
2334
- let o = b.elementSequenceMap.get(r);
2335
- o || (o = /* @__PURE__ */ new Set(), b.elementSequenceMap.set(r, o)), o.add(n);
2327
+ for (const o of i) {
2328
+ let r = w.elementSequenceMap.get(o);
2329
+ r || (r = /* @__PURE__ */ new Set(), w.elementSequenceMap.set(o, r)), r.add(n);
2336
2330
  }
2337
2331
  }
2338
2332
  }
2339
2333
  static removeFromSequences(t) {
2340
2334
  for (const n of t) {
2341
- const s = b.elementSequenceMap.get(n);
2335
+ const s = w.elementSequenceMap.get(n);
2342
2336
  if (s) {
2343
2337
  for (const i of s)
2344
2338
  i.removeGroups(
2345
- (r) => r.animations.some((o) => o.effect?.target === n)
2339
+ (o) => o.animations.some((r) => r.effect?.target === n)
2346
2340
  );
2347
- b.elementSequenceMap.delete(n);
2341
+ w.elementSequenceMap.delete(n);
2348
2342
  }
2349
2343
  }
2350
2344
  }
2351
2345
  }
2352
- let Gs = 0;
2353
- function L(e, {
2346
+ let Ds = 0;
2347
+ function D(e, {
2354
2348
  asCombinator: t = !1,
2355
2349
  addItemFilter: n = !1,
2356
2350
  useFirstChild: s = !1
@@ -2362,10 +2356,10 @@ function L(e, {
2362
2356
  return e.selector;
2363
2357
  return s ? t ? "> :first-child" : ":scope > :first-child" : "";
2364
2358
  }
2365
- function We(e) {
2359
+ function Be(e) {
2366
2360
  return "sequenceId" in e && !("effects" in e);
2367
2361
  }
2368
- function ve(e, t) {
2362
+ function Ee(e, t) {
2369
2363
  return e[t] || (e[t] = {
2370
2364
  triggers: [],
2371
2365
  effects: {},
@@ -2375,65 +2369,65 @@ function ve(e, t) {
2375
2369
  }), e[t];
2376
2370
  }
2377
2371
  function Hs(e, t = !1) {
2378
- const { effects: n = {}, sequences: s = {}, conditions: i = {} } = e, r = {};
2379
- return e.interactions?.forEach((o, c) => {
2380
- const a = o.key, f = ++Gs, { effects: u, sequences: l, ...d } = o;
2381
- if (!a) {
2372
+ const { effects: n = {}, sequences: s = {}, conditions: i = {} } = e, o = {};
2373
+ return e.interactions?.forEach((r, a) => {
2374
+ const c = r.key, f = ++Ds, { effects: u, sequences: l, ...d } = r;
2375
+ if (!c) {
2382
2376
  console.error(`Interaction ${f} is missing a key for source element.`);
2383
2377
  return;
2384
2378
  }
2385
- ve(r, a);
2386
- const v = u ? Array.from(u) : [];
2387
- v.reverse();
2388
- const h = l?.map((g, E) => {
2389
- if (We(g)) {
2390
- const w = s[g.sequenceId];
2391
- return w ? { ...w, ...g } : (console.warn(`Interact: Sequence "${g.sequenceId}" not found in config`), g);
2379
+ Ee(o, c);
2380
+ const m = u ? Array.from(u) : [];
2381
+ m.reverse();
2382
+ const h = l?.map((v, y) => {
2383
+ if (Be(v)) {
2384
+ const $ = s[v.sequenceId];
2385
+ return $ ? { ...$, ...v } : (console.warn(`Interact: Sequence "${v.sequenceId}" not found in config`), v);
2392
2386
  }
2393
- const y = g;
2394
- return y.sequenceId || (y.sequenceId = `seq-${c}-${E}`), y;
2395
- }), m = {
2387
+ const E = v;
2388
+ return E.sequenceId || (E.sequenceId = `seq-${a}-${y}`), E;
2389
+ }), p = {
2396
2390
  ...d,
2397
- effects: v.length > 0 ? v : void 0,
2391
+ effects: m.length > 0 ? m : void 0,
2398
2392
  sequences: h
2399
2393
  };
2400
- r[a].triggers.push(m), r[a].selectors.add(
2401
- L(m, { useFirstChild: t })
2394
+ o[c].triggers.push(p), o[c].selectors.add(
2395
+ D(p, { useFirstChild: t })
2402
2396
  );
2403
- const p = m.listContainer;
2404
- v.forEach((g, E) => {
2405
- let y = g.key;
2406
- if (!y && g.effectId) {
2407
- const I = n[g.effectId];
2408
- I && (y = I.key);
2397
+ const g = p.listContainer;
2398
+ m.forEach((v, y) => {
2399
+ let E = v.key;
2400
+ if (!E && v.effectId) {
2401
+ const I = n[v.effectId];
2402
+ I && (E = I.key);
2409
2403
  }
2410
- g.effectId || (g.effectId = `eff-${c}-${v.length - 1 - E}`), y = y || a, g.key = y;
2411
- const w = g.effectId;
2412
- if (p && g.listContainer && (y !== a || g.listContainer !== p))
2404
+ v.effectId || (v.effectId = `eff-${a}-${m.length - 1 - y}`), E = E || c, v.key = E;
2405
+ const $ = v.effectId;
2406
+ if (g && v.listContainer && (E !== c || v.listContainer !== g))
2413
2407
  return;
2414
- const $ = `${a}::${y}::${w}::${f}`;
2415
- if (g.interactionId = $, r[a].interactionIds.add($), y === a)
2408
+ const b = `${c}::${E}::${$}::${f}`;
2409
+ if (v.interactionId = b, o[c].interactionIds.add(b), E === c)
2416
2410
  return;
2417
- const S = ve(r, y);
2418
- S.effects[$] || (S.effects[$] = [], S.interactionIds.add($)), S.effects[$].push({ ...d, effect: g }), S.selectors.add(L(g, { useFirstChild: t }));
2419
- }), h?.forEach((g) => {
2420
- if (!g || We(g)) return;
2421
- const E = g, y = E.sequenceId;
2422
- E.effects.forEach(($, S) => {
2423
- $.effectId || ($.effectId = `eff-${y}-${S}`);
2424
- let I = $.key;
2425
- if (!I && $.effectId) {
2426
- const C = n[$.effectId];
2427
- C && (I = C.key);
2411
+ const S = Ee(o, E);
2412
+ S.effects[b] || (S.effects[b] = [], S.interactionIds.add(b)), S.effects[b].push({ ...d, effect: v }), S.selectors.add(D(v, { useFirstChild: t }));
2413
+ }), h?.forEach((v) => {
2414
+ if (!v || Be(v)) return;
2415
+ const y = v, E = y.sequenceId;
2416
+ y.effects.forEach((b, S) => {
2417
+ b.effectId || (b.effectId = `eff-${E}-${S}`);
2418
+ let I = b.key;
2419
+ if (!I && b.effectId) {
2420
+ const T = n[b.effectId];
2421
+ T && (I = T.key);
2428
2422
  }
2429
- I = I || a;
2430
- const T = L($, { useFirstChild: t });
2431
- if (T && r[a].selectors.add(T), I !== a) {
2432
- const C = ve(r, I), A = `${I}::seq::${y}::${f}`;
2433
- C.sequences[A] || (C.sequences[A] = [], C.interactionIds.add(A)), C.sequences[A].push({
2423
+ I = I || c;
2424
+ const O = D(b, { useFirstChild: t });
2425
+ if (O && o[c].selectors.add(O), I !== c) {
2426
+ const T = Ee(o, I), _ = `${I}::seq::${E}::${f}`;
2427
+ T.sequences[_] || (T.sequences[_] = [], T.interactionIds.add(_)), T.sequences[_].push({
2434
2428
  ...d,
2435
- sequence: E
2436
- }), C.selectors.add(T);
2429
+ sequence: y
2430
+ }), T.selectors.add(O);
2437
2431
  }
2438
2432
  });
2439
2433
  });
@@ -2441,26 +2435,23 @@ function Hs(e, t = !1) {
2441
2435
  effects: n,
2442
2436
  sequences: s,
2443
2437
  conditions: i,
2444
- interactions: r
2438
+ interactions: o
2445
2439
  };
2446
2440
  }
2447
- const dt = "$";
2448
- function Ws(e, t = 2) {
2441
+ const pt = "$";
2442
+ function Gs(e, t = 2) {
2449
2443
  return parseFloat(e.toFixed(t));
2450
2444
  }
2451
- function Vs(e) {
2445
+ function Ws(e) {
2452
2446
  return /\[]/g.test(e);
2453
2447
  }
2454
- function Ys(e) {
2455
- return `--${e.join("-")}`;
2456
- }
2457
- function Bs(e) {
2448
+ function Vs(e) {
2458
2449
  return e.replace(/[A-Z]/g, (t) => `-${t.toLowerCase()}`);
2459
2450
  }
2460
- function oe(e, t) {
2451
+ function ce(e, t) {
2461
2452
  return t.includes("&") ? t.replace(/&/g, e) : `${e}${t}`;
2462
2453
  }
2463
- function B() {
2454
+ function U() {
2464
2455
  return "wi-12343210".replace(
2465
2456
  /\d/g,
2466
2457
  (e) => String.fromCharCode(
@@ -2469,89 +2460,89 @@ function B() {
2469
2460
  // 97 for "a"
2470
2461
  );
2471
2462
  }
2472
- function ht(e) {
2463
+ function gt(e) {
2473
2464
  const { transition: t, transitionProperties: n } = e;
2474
2465
  return (t?.styleProperties || n || []).map((i) => ({
2475
2466
  ...i,
2476
- name: ue(i.name)
2467
+ name: fe(i.name)
2477
2468
  }));
2478
2469
  }
2479
- function mt(e) {
2470
+ function vt(e) {
2480
2471
  let { transition: t, transitionProperties: n } = e, s = [];
2481
2472
  if (t?.styleProperties) {
2482
- const { duration: i, easing: r, delay: o } = t;
2473
+ const { duration: i, easing: o, delay: r } = t;
2483
2474
  i && (t.styleProperties.some(
2484
- (a) => a.name.startsWith("--")
2475
+ (c) => c.name.startsWith("--")
2485
2476
  ) ? s = [
2486
- `all ${i}ms ${se(r || "ease")}${o ? ` ${o}ms` : ""}`,
2477
+ `all ${i}ms ${oe(o || "ease")}${r ? ` ${r}ms` : ""}`,
2487
2478
  "visibility 0s"
2488
2479
  ] : s = t.styleProperties.map(
2489
- (a) => `${ue(a.name)} ${i}ms ${se(
2490
- r || "ease"
2491
- )}${o ? ` ${o}ms` : ""}`
2480
+ (c) => `${fe(c.name)} ${i}ms ${oe(
2481
+ o || "ease"
2482
+ )}${r ? ` ${r}ms` : ""}`
2492
2483
  ));
2493
2484
  } else
2494
2485
  s = n?.filter((i) => i.duration).map(
2495
- (i) => `${ue(i.name)} ${i.duration}ms ${se(i.easing) || "ease"}${i.delay ? ` ${i.delay}ms` : ""}`
2486
+ (i) => `${fe(i.name)} ${i.duration}ms ${oe(i.easing) || "ease"}${i.delay ? ` ${i.delay}ms` : ""}`
2496
2487
  ) || [];
2497
2488
  return s;
2498
2489
  }
2499
- function Ks({
2490
+ function Ys({
2500
2491
  key: e,
2501
2492
  effectId: t,
2502
2493
  transition: n,
2503
2494
  transitionProperties: s,
2504
2495
  childSelector: i = "> :first-child",
2505
- selectorCondition: r
2496
+ selectorCondition: o
2506
2497
  }) {
2507
- const o = mt({
2498
+ const r = vt({
2508
2499
  transition: n,
2509
2500
  transitionProperties: s
2510
- }), c = ht({ transition: n, transitionProperties: s }).map(
2501
+ }), a = gt({ transition: n, transitionProperties: s }).map(
2511
2502
  (h) => `${h.name}: ${h.value};`
2512
- ), a = e.replace(/"/g, "'"), f = `:is(:state(${t}), :--${t}) ${i}`, u = `[data-interact-effect~="${t}"] ${i}`, l = r ? oe(f, r) : f, d = r ? oe(u, r) : u, v = [
2503
+ ), c = e.replace(/"/g, "'"), f = `:is(:state(${t}), :--${t}) ${i}`, u = `[data-interact-effect~="${t}"] ${i}`, l = o ? ce(f, o) : f, d = o ? ce(u, o) : u, m = [
2513
2504
  `${l},
2514
2505
  ${d} {
2515
- ${c.join(`
2506
+ ${a.join(`
2516
2507
  `)}
2517
2508
  }`
2518
2509
  ];
2519
- if (o.length) {
2520
- const h = `[data-interact-key="${a}"] ${i}`, m = r ? oe(h, r) : h;
2521
- v.push(`@media (prefers-reduced-motion: no-preference) { ${m} {
2522
- transition: ${o.join(", ")};
2510
+ if (r.length) {
2511
+ const h = `[data-interact-key="${c}"] ${i}`, p = o ? ce(h, o) : h;
2512
+ m.push(`@media (prefers-reduced-motion: no-preference) { ${p} {
2513
+ transition: ${r.join(", ")};
2523
2514
  } }`);
2524
2515
  }
2525
- return v;
2516
+ return m;
2526
2517
  }
2527
- function X(e, t, n) {
2518
+ function J(e, t, n) {
2528
2519
  const s = (e || []).filter((i) => t[i]?.type === n && t[i].predicate).map((i) => t[i].predicate).join(") and (");
2529
2520
  return s && `(${s})`;
2530
2521
  }
2531
2522
  function k(e, t) {
2532
- const n = X(e, t, "media");
2523
+ const n = J(e, t, "media");
2533
2524
  return n && window.matchMedia(n);
2534
2525
  }
2535
- function P(e, t) {
2526
+ function M(e, t) {
2536
2527
  return (e || []).filter((n) => t[n]?.type === "selector" && t[n].predicate).map((n) => `:is(${t[n].predicate})`).join("");
2537
2528
  }
2538
- function me(e, t, n, s, i) {
2539
- const r = b.getPluginsNames();
2540
- for (const o of r) {
2541
- const c = `${dt}${o}`;
2542
- if (!(c in n))
2529
+ function ge(e, t, n, s, i) {
2530
+ const o = w.getPluginsNames();
2531
+ for (const r of o) {
2532
+ const a = `${pt}${r}`;
2533
+ if (!(a in n))
2543
2534
  continue;
2544
- const a = n[c];
2545
- if (a !== null && typeof a == "object") {
2546
- if (e._appliedPlugins.has(a))
2535
+ const c = n[a];
2536
+ if (c !== null && typeof c == "object") {
2537
+ if (e._appliedPlugins.has(c))
2547
2538
  continue;
2548
- e._appliedPlugins.add(a);
2539
+ e._appliedPlugins.add(c);
2549
2540
  }
2550
- const u = b.getPlugin(o)(a, { root: t, key: s, scope: i, config: n });
2541
+ const u = w.getPlugin(r)(c, { root: t, key: s, scope: i, config: n });
2551
2542
  typeof u == "function" && e._pluginCleanups.push(u);
2552
2543
  }
2553
2544
  }
2554
- function de(e, t, n) {
2545
+ function he(e, t, n) {
2555
2546
  if (e.listContainer) {
2556
2547
  const s = t.querySelector(e.listContainer);
2557
2548
  return s ? e.selector ? Array.from(s.querySelectorAll(e.selector)) : Array.from(s.children) : (console.warn(`Interact: No container found for list container "${e.listContainer}"`), []);
@@ -2564,75 +2555,75 @@ function de(e, t, n) {
2564
2555
  }
2565
2556
  return n ? t.firstElementChild : t;
2566
2557
  }
2567
- function he(e, t) {
2558
+ function me(e, t) {
2568
2559
  return t.map((n) => e.selector ? n.querySelector(e.selector) : n).filter(Boolean);
2569
2560
  }
2570
- function pt(e, t, n, s, i, r, o, c) {
2561
+ function yt(e, t, n, s, i, o, r, a) {
2571
2562
  return [
2572
- o ? he(e, o) : de(e, n, s),
2573
- c ? he(t, c) : de(t, i, r)
2563
+ r ? me(e, r) : he(e, n, s),
2564
+ a ? me(t, a) : he(t, i, o)
2574
2565
  ];
2575
2566
  }
2576
- function gt(e, t, n, s, i, r, o, c) {
2577
- const a = Array.isArray(s), f = Array.isArray(i);
2578
- a ? s.forEach((u, l) => {
2567
+ function Et(e, t, n, s, i, o, r, a) {
2568
+ const c = Array.isArray(s), f = Array.isArray(i);
2569
+ c ? s.forEach((u, l) => {
2579
2570
  const d = f ? i[l] : i;
2580
- d && Ve(
2571
+ d && Ue(
2581
2572
  e,
2582
2573
  u,
2583
2574
  t.trigger,
2584
2575
  d,
2585
2576
  n,
2586
2577
  t.params,
2587
- r,
2588
2578
  o,
2589
- c
2579
+ r,
2580
+ a
2590
2581
  );
2591
2582
  }) : (f ? i : [i]).forEach((l) => {
2592
- Ve(
2583
+ Ue(
2593
2584
  e,
2594
2585
  s,
2595
2586
  t.trigger,
2596
2587
  l,
2597
2588
  n,
2598
2589
  t.params,
2599
- r,
2600
2590
  o,
2601
- c
2591
+ r,
2592
+ a
2602
2593
  );
2603
2594
  });
2604
2595
  }
2605
- function vt(e, t, n, s, i) {
2606
- const r = {}, o = [];
2607
- (s.effects || []).forEach((c) => {
2608
- const a = c.effectId, f = {
2609
- ...n.dataCache.effects[a] || {},
2610
- ...c,
2611
- effectId: a
2612
- }, u = f.key, l = _(c.interactionId, e);
2613
- if (r[l] || n.addedInteractions[l] && !i)
2596
+ function wt(e, t, n, s, i) {
2597
+ const o = {}, r = [];
2598
+ (s.effects || []).forEach((a) => {
2599
+ const c = a.effectId, f = {
2600
+ ...n.dataCache.effects[c] || {},
2601
+ ...a,
2602
+ effectId: c
2603
+ }, u = f.key, l = q(a.interactionId, e);
2604
+ if (o[l] || n.addedInteractions[l] && !i)
2614
2605
  return;
2615
2606
  const d = k(f.conditions || [], n.dataCache.conditions);
2616
2607
  if (d && n.setupMediaQueryListener(l, d, e, () => {
2617
2608
  t.update();
2618
2609
  }), !d || d.matches) {
2619
- r[l] = !0;
2620
- const v = u && _(u, e);
2610
+ o[l] = !0;
2611
+ const m = u && q(u, e);
2621
2612
  let h;
2622
- if (v) {
2623
- if (h = b.getController(v), !h)
2613
+ if (m) {
2614
+ if (h = w.getController(m), !h)
2624
2615
  return;
2625
2616
  f.listContainer && h.watchChildList(f.listContainer);
2626
2617
  } else
2627
2618
  h = t;
2628
- me(
2619
+ ge(
2629
2620
  h,
2630
2621
  h.element,
2631
2622
  f,
2632
- v || s.key,
2623
+ m || s.key,
2633
2624
  "effect"
2634
2625
  );
2635
- const [m, p] = pt(
2626
+ const [p, g] = yt(
2636
2627
  s,
2637
2628
  f,
2638
2629
  t.element,
@@ -2641,122 +2632,122 @@ function vt(e, t, n, s, i) {
2641
2632
  h.useFirstChild,
2642
2633
  i
2643
2634
  );
2644
- if (!m || !p)
2635
+ if (!p || !g)
2645
2636
  return;
2646
2637
  n.addedInteractions[l] = !0;
2647
- const g = v || s.key, E = P(
2638
+ const v = m || s.key, y = M(
2648
2639
  f.conditions || [],
2649
2640
  n.dataCache.conditions
2650
2641
  );
2651
- o.push([
2652
- g,
2642
+ r.push([
2643
+ v,
2653
2644
  s,
2654
2645
  f,
2655
- m,
2656
2646
  p,
2657
- E,
2647
+ g,
2648
+ y,
2658
2649
  h.useFirstChild,
2659
2650
  e
2660
2651
  ]);
2661
2652
  }
2662
- }), o.reverse().forEach((c) => {
2663
- gt(...c);
2664
- }), Qs(e, t, n, s, i);
2653
+ }), r.reverse().forEach((a) => {
2654
+ Et(...a);
2655
+ }), Bs(e, t, n, s, i);
2665
2656
  }
2666
- function Us(e) {
2657
+ function Ks(e) {
2667
2658
  return "sequenceId" in e && !("effects" in e);
2668
2659
  }
2669
- function yt(e, t, n, s, i, r, o) {
2670
- const c = k(e.conditions || [], i.dataCache.conditions);
2671
- if (c && i.setupMediaQueryListener(t, c, r.updateKey, r.onUpdate), c && !c.matches) return null;
2672
- const a = e.effects || [], f = [];
2660
+ function $t(e, t, n, s, i, o, r) {
2661
+ const a = k(e.conditions || [], i.dataCache.conditions);
2662
+ if (a && i.setupMediaQueryListener(t, a, o.updateKey, o.onUpdate), a && !a.matches) return null;
2663
+ const c = e.effects || [], f = [];
2673
2664
  let u = !1;
2674
- for (const l of a) {
2665
+ for (const l of c) {
2675
2666
  const d = l.effectId, h = {
2676
2667
  ...d ? i.dataCache.effects[d] || {} : {},
2677
2668
  ...l
2678
- }, m = k(h.conditions || [], i.dataCache.conditions);
2679
- if (m) {
2669
+ }, p = k(h.conditions || [], i.dataCache.conditions);
2670
+ if (p) {
2680
2671
  const S = `${t}::${d || "eff"}`;
2681
2672
  i.setupMediaQueryListener(
2682
2673
  S,
2683
- m,
2684
- r.updateKey,
2685
- r.onUpdate
2674
+ p,
2675
+ o.updateKey,
2676
+ o.onUpdate
2686
2677
  );
2687
2678
  }
2688
- if (m && !m.matches) continue;
2689
- const p = h.key, g = p && _(p, n);
2690
- let E;
2691
- if (g) {
2692
- if (E = b.getController(g), !E) return null;
2679
+ if (p && !p.matches) continue;
2680
+ const g = h.key, v = g && q(g, n);
2681
+ let y;
2682
+ if (v) {
2683
+ if (y = w.getController(v), !y) return null;
2693
2684
  } else
2694
- E = s;
2695
- const y = g || n;
2696
- me(
2697
- E,
2698
- E.element,
2699
- h,
2685
+ y = s;
2686
+ const E = v || n;
2687
+ ge(
2700
2688
  y,
2689
+ y.element,
2690
+ h,
2691
+ E,
2701
2692
  "effect"
2702
2693
  );
2703
- let w;
2704
- if (o && y === o.controllerKey && h.listContainer === o.listContainer ? (w = he(h, o.elements), w.length > 0 && (u = !0)) : w = de(
2694
+ let $;
2695
+ if (r && E === r.controllerKey && h.listContainer === r.listContainer ? ($ = me(h, r.elements), $.length > 0 && (u = !0)) : $ = he(
2705
2696
  h,
2706
- E.element,
2707
- E.useFirstChild
2708
- ), !w || Array.isArray(w) && w.length === 0) return null;
2709
- const $ = M(h);
2710
- f.push({ target: w, options: $ });
2697
+ y.element,
2698
+ y.useFirstChild
2699
+ ), !$ || Array.isArray($) && $.length === 0) return null;
2700
+ const b = P(h);
2701
+ f.push({ target: $, options: b });
2711
2702
  }
2712
- return o && !u ? null : f.length > 0 ? f : null;
2703
+ return r && !u ? null : f.length > 0 ? f : null;
2713
2704
  }
2714
- function Te(e, t, n) {
2715
- const s = n ? he(e, n) : de(e, t.element, t.useFirstChild);
2705
+ function Oe(e, t, n) {
2706
+ const s = n ? me(e, n) : he(e, t.element, t.useFirstChild);
2716
2707
  return Array.isArray(s) && s.length === 0 ? null : s;
2717
2708
  }
2718
- function Oe(e, t, n, s, i) {
2719
- (Array.isArray(n) ? n : [n]).forEach((o) => {
2720
- N[e.trigger]?.add(
2721
- o,
2722
- o,
2709
+ function _e(e, t, n, s, i) {
2710
+ (Array.isArray(n) ? n : [n]).forEach((r) => {
2711
+ j[e.trigger]?.add(
2712
+ r,
2713
+ r,
2723
2714
  { triggerType: t.triggerType },
2724
2715
  e.params || {},
2725
2716
  {
2726
- reducedMotion: b.forceReducedMotion,
2717
+ reducedMotion: w.forceReducedMotion,
2727
2718
  selectorCondition: i,
2728
2719
  animation: s,
2729
- allowA11yTriggers: b.allowA11yTriggers
2720
+ allowA11yTriggers: w.allowA11yTriggers
2730
2721
  }
2731
2722
  );
2732
2723
  });
2733
2724
  }
2734
- function Et(e, t, n) {
2735
- const r = (e.useFirstChild ? e.element.firstElementChild : e.element)?.querySelector(t);
2736
- if (!r) return n.map((c, a) => a);
2737
- const o = Array.from(r.children);
2738
- return n.map((c) => {
2739
- const a = o.indexOf(c);
2740
- return a >= 0 ? a : o.length;
2725
+ function bt(e, t, n) {
2726
+ const o = (e.useFirstChild ? e.element.firstElementChild : e.element)?.querySelector(t);
2727
+ if (!o) return n.map((a, c) => c);
2728
+ const r = Array.from(o.children);
2729
+ return n.map((a) => {
2730
+ const c = r.indexOf(a);
2731
+ return c >= 0 ? c : r.length;
2741
2732
  });
2742
2733
  }
2743
- function Qs(e, t, n, s, i) {
2744
- s.sequences?.forEach((r) => {
2745
- let o;
2746
- if (Us(r)) {
2747
- const h = n.dataCache.sequences[r.sequenceId];
2734
+ function Bs(e, t, n, s, i) {
2735
+ s.sequences?.forEach((o) => {
2736
+ let r;
2737
+ if (Ks(o)) {
2738
+ const h = n.dataCache.sequences[o.sequenceId];
2748
2739
  if (!h) {
2749
- console.warn(`Interact: Sequence "${r.sequenceId}" not found in cache`);
2740
+ console.warn(`Interact: Sequence "${o.sequenceId}" not found in cache`);
2750
2741
  return;
2751
2742
  }
2752
- o = { ...h, ...r };
2743
+ r = { ...h, ...o };
2753
2744
  } else
2754
- o = r;
2755
- const c = o.sequenceId || B(), a = _(`${e}::seq::${c}`, e);
2756
- if (n.addedInteractions[a] && !i) return;
2757
- const f = i && s.listContainer ? { controllerKey: e, listContainer: s.listContainer, elements: i } : void 0, u = yt(
2758
- o,
2759
- a,
2745
+ r = o;
2746
+ const a = r.sequenceId || U(), c = q(`${e}::seq::${a}`, e);
2747
+ if (n.addedInteractions[c] && !i) return;
2748
+ const f = i && s.listContainer ? { controllerKey: e, listContainer: s.listContainer, elements: i } : void 0, u = $t(
2749
+ r,
2750
+ c,
2760
2751
  e,
2761
2752
  t,
2762
2753
  n,
@@ -2764,164 +2755,164 @@ function Qs(e, t, n, s, i) {
2764
2755
  f
2765
2756
  );
2766
2757
  if (!u) return;
2767
- if (i && n.addedInteractions[a]) {
2768
- const h = Et(
2758
+ if (i && n.addedInteractions[c]) {
2759
+ const h = bt(
2769
2760
  t,
2770
2761
  s.listContainer,
2771
2762
  i
2772
2763
  );
2773
- b.addToSequence(a, u, h, {
2774
- reducedMotion: b.forceReducedMotion
2764
+ w.addToSequence(c, u, h, {
2765
+ reducedMotion: w.forceReducedMotion
2775
2766
  });
2776
- const m = b.getSequence(a, o, u, {
2777
- reducedMotion: b.forceReducedMotion
2778
- }), p = P(
2767
+ const p = w.getSequence(c, r, u, {
2768
+ reducedMotion: w.forceReducedMotion
2769
+ }), g = M(
2779
2770
  s.conditions || [],
2780
2771
  n.dataCache.conditions
2781
- ), g = Te(s, t, i);
2782
- g && Oe(
2772
+ ), v = Oe(s, t, i);
2773
+ v && _e(
2783
2774
  s,
2784
- o,
2785
- g,
2786
- m,
2787
- p
2775
+ r,
2776
+ v,
2777
+ p,
2778
+ g
2788
2779
  );
2789
2780
  return;
2790
2781
  }
2791
- const l = b.getSequence(a, o, u, {
2792
- reducedMotion: b.forceReducedMotion
2793
- }), d = P(
2782
+ const l = w.getSequence(c, r, u, {
2783
+ reducedMotion: w.forceReducedMotion
2784
+ }), d = M(
2794
2785
  s.conditions || [],
2795
2786
  n.dataCache.conditions
2796
- ), v = Te(s, t, i);
2797
- v && (n.addedInteractions[a] = !0, Oe(
2787
+ ), m = Oe(s, t, i);
2788
+ m && (n.addedInteractions[c] = !0, _e(
2798
2789
  s,
2799
- o,
2800
- v,
2790
+ r,
2791
+ m,
2801
2792
  l,
2802
2793
  d
2803
2794
  ));
2804
2795
  });
2805
2796
  }
2806
- function Xs(e, t, n, s, i) {
2807
- const r = n.get(e)?.sequences || {};
2808
- Object.keys(r).forEach((c) => {
2809
- r[c].some(({ sequence: f, ...u }) => {
2797
+ function Us(e, t, n, s, i) {
2798
+ const o = n.get(e)?.sequences || {};
2799
+ Object.keys(o).forEach((a) => {
2800
+ o[a].some(({ sequence: f, ...u }) => {
2810
2801
  const l = k(
2811
2802
  u.conditions || [],
2812
2803
  n.dataCache.conditions
2813
2804
  );
2814
2805
  if (l && !l.matches)
2815
2806
  return !1;
2816
- const d = u.key && _(u.key, e), v = b.getController(d);
2817
- if (!v)
2807
+ const d = u.key && q(u.key, e), m = w.getController(d);
2808
+ if (!m)
2818
2809
  return !0;
2819
- const h = f.sequenceId || B(), m = _(`${d}::seq::${h}`, d);
2820
- if (n.addedInteractions[m] && !i)
2810
+ const h = f.sequenceId || U(), p = q(`${d}::seq::${h}`, d);
2811
+ if (n.addedInteractions[p] && !i)
2821
2812
  return !0;
2822
- const g = yt(
2813
+ const v = $t(
2823
2814
  f,
2824
- m,
2815
+ p,
2825
2816
  d,
2826
- v,
2817
+ m,
2827
2818
  n,
2828
2819
  { updateKey: e, onUpdate: () => t.update() },
2829
2820
  i && s ? { controllerKey: e, listContainer: s, elements: i } : void 0
2830
2821
  );
2831
- if (!g) return !0;
2832
- if (i && n.addedInteractions[m]) {
2833
- const $ = Et(t, s, i);
2834
- return b.addToSequence(m, g, $, {
2835
- reducedMotion: b.forceReducedMotion
2822
+ if (!v) return !0;
2823
+ if (i && n.addedInteractions[p]) {
2824
+ const b = bt(t, s, i);
2825
+ return w.addToSequence(p, v, b, {
2826
+ reducedMotion: w.forceReducedMotion
2836
2827
  }), !0;
2837
2828
  }
2838
- const E = b.getSequence(m, f, g, {
2839
- reducedMotion: b.forceReducedMotion
2840
- }), y = P(
2829
+ const y = w.getSequence(p, f, v, {
2830
+ reducedMotion: w.forceReducedMotion
2831
+ }), E = M(
2841
2832
  u.conditions || [],
2842
2833
  n.dataCache.conditions
2843
- ), w = Te(u, v);
2844
- return w && (n.addedInteractions[m] = !0, Oe(
2834
+ ), $ = Oe(u, m);
2835
+ return $ && (n.addedInteractions[p] = !0, _e(
2845
2836
  u,
2846
2837
  f,
2847
- w,
2848
- E,
2849
- y
2838
+ $,
2839
+ y,
2840
+ E
2850
2841
  )), !0;
2851
2842
  });
2852
2843
  });
2853
2844
  }
2854
- function wt(e, t, n, s, i) {
2855
- const r = n.get(e), o = r?.effects || {}, c = Object.keys(o), a = [];
2856
- c.forEach((u) => {
2857
- const l = _(u, e);
2845
+ function St(e, t, n, s, i) {
2846
+ const o = n.get(e), r = o?.effects || {}, a = Object.keys(r), c = [];
2847
+ a.forEach((u) => {
2848
+ const l = q(u, e);
2858
2849
  if (n.addedInteractions[l] && !i)
2859
2850
  return;
2860
- o[u].some(({ effect: v, ...h }) => {
2861
- const m = k(
2851
+ r[u].some(({ effect: m, ...h }) => {
2852
+ const p = k(
2862
2853
  h.conditions || [],
2863
2854
  n.dataCache.conditions
2864
2855
  );
2865
- if (m && !m.matches)
2856
+ if (p && !p.matches)
2866
2857
  return !1;
2867
- const p = v.effectId, g = {
2868
- ...n.dataCache.effects[p] || {},
2869
- ...v,
2870
- effectId: p
2858
+ const g = m.effectId, v = {
2859
+ ...n.dataCache.effects[g] || {},
2860
+ ...m,
2861
+ effectId: g
2871
2862
  };
2872
- if (s && g.listContainer !== s)
2863
+ if (s && v.listContainer !== s)
2873
2864
  return !1;
2874
- const E = k(g.conditions || [], n.dataCache.conditions);
2875
- if (E && n.setupMediaQueryListener(l, E, e, () => {
2865
+ const y = k(v.conditions || [], n.dataCache.conditions);
2866
+ if (y && n.setupMediaQueryListener(l, y, e, () => {
2876
2867
  t.update();
2877
- }), !E || E.matches) {
2878
- const y = h.key && _(h.key, e), w = b.getController(y);
2879
- if (!w)
2868
+ }), !y || y.matches) {
2869
+ const E = h.key && q(h.key, e), $ = w.getController(E);
2870
+ if (!$)
2880
2871
  return !0;
2881
- me(
2872
+ ge(
2882
2873
  t,
2883
2874
  t.element,
2884
- g,
2875
+ v,
2885
2876
  e,
2886
2877
  "effect"
2887
- ), g.listContainer && t.watchChildList(g.listContainer);
2888
- const [$, S] = pt(
2878
+ ), v.listContainer && t.watchChildList(v.listContainer);
2879
+ const [b, S] = yt(
2889
2880
  h,
2890
- g,
2891
- w.element,
2892
- w.useFirstChild,
2881
+ v,
2882
+ $.element,
2883
+ $.useFirstChild,
2893
2884
  t.element,
2894
2885
  t.useFirstChild,
2895
2886
  void 0,
2896
2887
  i
2897
2888
  );
2898
- if (!$ || !S)
2889
+ if (!b || !S)
2899
2890
  return !0;
2900
2891
  n.addedInteractions[l] = !0;
2901
- const I = P(
2902
- g.conditions || [],
2892
+ const I = M(
2893
+ v.conditions || [],
2903
2894
  n.dataCache.conditions
2904
2895
  );
2905
- return a.push([
2896
+ return c.push([
2906
2897
  e,
2907
2898
  h,
2908
- g,
2909
- $,
2899
+ v,
2900
+ b,
2910
2901
  S,
2911
2902
  I,
2912
2903
  t.useFirstChild,
2913
- y || void 0
2904
+ E || void 0
2914
2905
  ]), !0;
2915
2906
  }
2916
2907
  return !1;
2917
2908
  });
2918
- }), a.reverse().forEach((u) => {
2919
- gt(...u);
2920
- }), Xs(e, t, n, s, i);
2921
- const f = Object.keys(r?.sequences || {}).length > 0;
2922
- return c.length > 0 || f;
2909
+ }), c.reverse().forEach((u) => {
2910
+ Et(...u);
2911
+ }), Us(e, t, n, s, i);
2912
+ const f = Object.keys(o?.sequences || {}).length > 0;
2913
+ return a.length > 0 || f;
2923
2914
  }
2924
- function Ve(e, t, n, s, i, r, o, c, a) {
2915
+ function Ue(e, t, n, s, i, o, r, a, c) {
2925
2916
  let f;
2926
2917
  if (i.transition || i.transitionProperties) {
2927
2918
  const l = {
@@ -2929,83 +2920,83 @@ function Ve(e, t, n, s, i, r, o, c, a) {
2929
2920
  effectId: i.effectId,
2930
2921
  transition: i.transition,
2931
2922
  transitionProperties: i.transitionProperties,
2932
- childSelector: L(i, {
2923
+ childSelector: D(i, {
2933
2924
  asCombinator: !0,
2934
2925
  addItemFilter: !0,
2935
- useFirstChild: c
2926
+ useFirstChild: a
2936
2927
  }),
2937
- selectorCondition: o
2928
+ selectorCondition: r
2938
2929
  };
2939
- if (f = b.getController(e), !f)
2930
+ if (f = w.getController(e), !f)
2940
2931
  return;
2941
- f.renderStyle(Ks(l));
2932
+ f.renderStyle(Ys(l));
2942
2933
  }
2943
2934
  let u;
2944
2935
  if (n === "animationEnd") {
2945
- const l = r.effectId, v = (a ? b.getInstance(a) : void 0)?.dataCache.effects[l];
2946
- v && (u = M(v));
2936
+ const l = o.effectId, m = (c ? w.getInstance(c) : void 0)?.dataCache.effects[l];
2937
+ m && (u = P(m));
2947
2938
  }
2948
- N[n]?.add(t, s, i, r, {
2949
- reducedMotion: b.forceReducedMotion,
2939
+ j[n]?.add(t, s, i, o, {
2940
+ reducedMotion: w.forceReducedMotion,
2950
2941
  targetController: f,
2951
- selectorCondition: o,
2952
- allowA11yTriggers: b.allowA11yTriggers,
2942
+ selectorCondition: r,
2943
+ allowA11yTriggers: w.allowA11yTriggers,
2953
2944
  sourceAnimationOptions: u
2954
2945
  });
2955
2946
  }
2956
- function Zs(e) {
2957
- const t = e.key, n = b.getInstance(t);
2947
+ function Qs(e) {
2948
+ const t = e.key, n = w.getInstance(t);
2958
2949
  if (!n)
2959
- return console.warn(`No instance found for key: ${t}`), b.setController(t, e), !1;
2950
+ return console.warn(`No instance found for key: ${t}`), w.setController(t, e), !1;
2960
2951
  const { triggers: s = [] } = n?.get(t) || {}, i = s.length > 0;
2961
- n.setController(t, e), s.forEach((o, c) => {
2962
- const a = k(o.conditions, n.dataCache.conditions);
2963
- if (a) {
2964
- const f = `${t}::trigger::${c}`;
2965
- n.setupMediaQueryListener(f, a, t, () => {
2952
+ n.setController(t, e), s.forEach((r, a) => {
2953
+ const c = k(r.conditions, n.dataCache.conditions);
2954
+ if (c) {
2955
+ const f = `${t}::trigger::${a}`;
2956
+ n.setupMediaQueryListener(f, c, t, () => {
2966
2957
  e.update();
2967
2958
  });
2968
2959
  }
2969
- (!a || a.matches) && (me(e, e.element, o, t, "interaction"), o.listContainer && e.watchChildList(o.listContainer), vt(t, e, n, o));
2960
+ (!c || c.matches) && (ge(e, e.element, r, t, "interaction"), r.listContainer && e.watchChildList(r.listContainer), wt(t, e, n, r));
2970
2961
  });
2971
- let r = !1;
2972
- return n && (r = wt(t, e, n)), i || r;
2962
+ let o = !1;
2963
+ return n && (o = St(t, e, n)), i || o;
2973
2964
  }
2974
- function Js(e, t, n) {
2975
- const s = e.key, i = b.getInstance(s);
2965
+ function Xs(e, t, n) {
2966
+ const s = e.key, i = w.getInstance(s);
2976
2967
  if (i) {
2977
- const { triggers: r = [] } = i?.get(s) || {};
2978
- r.forEach((o, c) => {
2979
- if (o.listContainer !== t)
2968
+ const { triggers: o = [] } = i?.get(s) || {};
2969
+ o.forEach((r, a) => {
2970
+ if (r.listContainer !== t)
2980
2971
  return;
2981
- const a = k(o.conditions, i.dataCache.conditions);
2982
- if (a) {
2983
- const f = `${s}::listTrigger::${t}::${c}`;
2984
- i.setupMediaQueryListener(f, a, s, () => {
2972
+ const c = k(r.conditions, i.dataCache.conditions);
2973
+ if (c) {
2974
+ const f = `${s}::listTrigger::${t}::${a}`;
2975
+ i.setupMediaQueryListener(f, c, s, () => {
2985
2976
  e.update();
2986
2977
  });
2987
2978
  }
2988
- (!a || a.matches) && vt(s, e, i, o, n);
2989
- }), wt(s, e, i, t, n);
2979
+ (!c || c.matches) && wt(s, e, i, r, n);
2980
+ }), St(s, e, i, t, n);
2990
2981
  }
2991
2982
  }
2992
- function ei(e, t = !1) {
2993
- const n = e.key, s = b.getInstance(n);
2983
+ function Zs(e, t = !1) {
2984
+ const n = e.key, s = w.getInstance(n);
2994
2985
  if (!s)
2995
2986
  return;
2996
2987
  const i = [...s.get(n)?.selectors.values() || []].filter(Boolean).join(",");
2997
- let r;
2998
- i ? (r = [...e.element.querySelectorAll(i)], e.useFirstChild || r.push(e.element)) : r = [e.element], bt(r), s.deleteController(n, t);
2988
+ let o;
2989
+ i ? (o = [...e.element.querySelectorAll(i)], e.useFirstChild || o.push(e.element)) : o = [e.element], It(o), s.deleteController(n, t);
2999
2990
  }
3000
- function bt(e) {
3001
- const t = Object.values(N);
2991
+ function It(e) {
2992
+ const t = Object.values(j);
3002
2993
  for (const n of e)
3003
2994
  for (const s of t)
3004
2995
  s.remove(n);
3005
- b.removeFromSequences(e);
2996
+ w.removeFromSequences(e);
3006
2997
  }
3007
- const ye = "interactEffect";
3008
- class ti {
2998
+ const we = "interactEffect";
2999
+ class Js {
3009
3000
  element;
3010
3001
  key;
3011
3002
  connected;
@@ -3027,10 +3018,10 @@ class ti {
3027
3018
  }
3028
3019
  n !== t && (n && console.warn(
3029
3020
  `Interact: Key mismatch between element ${n} and parameter ${t}, updating element key`
3030
- ), this.element.dataset.interactKey = t), this.key = t, this.connected = Zs(this);
3021
+ ), this.element.dataset.interactKey = t), this.key = t, this.connected = Qs(this);
3031
3022
  }
3032
3023
  disconnect({ removeFromCache: t = !1 } = {}) {
3033
- if ((this.key || this.element.dataset.interactKey) && ei(this, t), this._pluginCleanups.length) {
3024
+ if ((this.key || this.element.dataset.interactKey) && Zs(this, t), this._pluginCleanups.length) {
3034
3025
  for (const s of this._pluginCleanups)
3035
3026
  try {
3036
3027
  s();
@@ -3042,7 +3033,7 @@ class ti {
3042
3033
  if (this._appliedPlugins = /* @__PURE__ */ new WeakSet(), this.sheet) {
3043
3034
  const s = this.element?.getRootNode(), i = s.host ? s : document;
3044
3035
  i.adoptedStyleSheets.indexOf(this.sheet) !== -1 && (i.adoptedStyleSheets = i.adoptedStyleSheets.filter(
3045
- (o) => o !== this.sheet
3036
+ (r) => r !== this.sheet
3046
3037
  ));
3047
3038
  }
3048
3039
  this._observers = /* @__PURE__ */ new WeakMap(), this.sheet = null, this.connected = !1;
@@ -3057,11 +3048,11 @@ class ti {
3057
3048
  `)), s.adoptedStyleSheets = [...s.adoptedStyleSheets || [], this.sheet];
3058
3049
  else {
3059
3050
  let i = this.sheet.cssRules.length;
3060
- for (const r of t)
3051
+ for (const o of t)
3061
3052
  try {
3062
- this.sheet.insertRule(r, i), i++;
3063
- } catch (o) {
3064
- console.error(o);
3053
+ this.sheet.insertRule(o, i), i++;
3054
+ } catch (r) {
3055
+ console.error(r);
3065
3056
  }
3066
3057
  }
3067
3058
  }
@@ -3072,13 +3063,13 @@ class ti {
3072
3063
  this.element.toggleEffect(t, n, s);
3073
3064
  return;
3074
3065
  }
3075
- const r = new Set(
3076
- this.element.dataset[ye]?.split(" ") || []
3066
+ const o = new Set(
3067
+ this.element.dataset[we]?.split(" ") || []
3077
3068
  );
3078
- n === "toggle" ? r.has(t) ? r.delete(t) : r.add(t) : n === "add" ? r.add(t) : n === "remove" ? r.delete(t) : n === "clear" && r.clear(), (s || this.element).dataset[ye] = Array.from(r).join(" ");
3069
+ n === "toggle" ? o.has(t) ? o.delete(t) : o.add(t) : n === "add" ? o.add(t) : n === "remove" ? o.delete(t) : n === "clear" && o.clear(), (s || this.element).dataset[we] = Array.from(o).join(" ");
3079
3070
  }
3080
3071
  getActiveEffects() {
3081
- const n = (this.element.dataset[ye] || "").trim();
3072
+ const n = (this.element.dataset[we] || "").trim();
3082
3073
  return n ? n.split(/\s+/) : [];
3083
3074
  }
3084
3075
  watchChildList(t) {
@@ -3089,24 +3080,24 @@ class ti {
3089
3080
  }
3090
3081
  }
3091
3082
  _childListChangeHandler(t, n) {
3092
- const s = this.key || this.element.dataset.interactKey, i = [], r = [];
3093
- n.forEach((o) => {
3094
- o.removedNodes.forEach((c) => {
3095
- c instanceof HTMLElement && i.push(c);
3096
- }), o.addedNodes.forEach((c) => {
3097
- c instanceof HTMLElement && r.push(c);
3083
+ const s = this.key || this.element.dataset.interactKey, i = [], o = [];
3084
+ n.forEach((r) => {
3085
+ r.removedNodes.forEach((a) => {
3086
+ a instanceof HTMLElement && i.push(a);
3087
+ }), r.addedNodes.forEach((a) => {
3088
+ a instanceof HTMLElement && o.push(a);
3098
3089
  });
3099
- }), bt(i), s && Js(this, t, r);
3090
+ }), It(i), s && Xs(this, t, o);
3100
3091
  }
3101
3092
  }
3102
- function yi(e, t) {
3103
- new ti(e, t).connect();
3093
+ function Ti(e, t) {
3094
+ new Js(e, t).connect();
3104
3095
  }
3105
- function Ei(e) {
3106
- const t = b.getController(e);
3096
+ function Ci(e) {
3097
+ const t = w.getController(e);
3107
3098
  t && t.disconnect({ removeFromCache: !0 });
3108
3099
  }
3109
- const $t = /* @__PURE__ */ new Map([
3100
+ const Tt = /* @__PURE__ */ new Map([
3110
3101
  ["viewEnter", "once"],
3111
3102
  ["animationEnd", "once"],
3112
3103
  ["hover", "alternate"],
@@ -3114,70 +3105,75 @@ const $t = /* @__PURE__ */ new Map([
3114
3105
  ["activate", "alternate"],
3115
3106
  ["interest", "alternate"]
3116
3107
  ]);
3117
- function St(e, t, n, s) {
3118
- const { effects: i = {}, conditions: r = {} } = n, { key: o, trigger: c } = t, a = c === "pointerMove";
3119
- e.effectId || (e.effectId = s || B());
3108
+ function Ct(e, t, n, s) {
3109
+ const { effects: i = {}, conditions: o = {} } = n, { key: r, trigger: a } = t, c = a === "pointerMove";
3110
+ e.effectId || (e.effectId = s || U());
3120
3111
  const { effectId: f } = e, u = { ...i[f] || {}, ...e };
3121
- let { key: l, conditions: d, triggerType: v } = u;
3112
+ let { key: l, conditions: d, triggerType: m } = u;
3122
3113
  if (!l) {
3123
- if (!o)
3114
+ if (!r)
3124
3115
  return null;
3125
- l = o;
3116
+ l = r;
3126
3117
  }
3127
- if (Vs(l))
3118
+ if (Ws(l))
3128
3119
  return null;
3129
3120
  d = [
3130
- ...new Set((d || []).filter(($) => r[$]))
3131
- ], v || (v = $t.get(c));
3132
- const { namedEffect: h, customEffect: m, keyframeEffect: p, transition: g, transitionProperties: E, ...y } = {
3121
+ ...new Set((d || []).filter((b) => o[b]))
3122
+ ], m || (m = Tt.get(a));
3123
+ const { namedEffect: h, customEffect: p, keyframeEffect: g, transition: v, transitionProperties: y, ...E } = {
3133
3124
  ...u,
3134
3125
  key: l,
3135
3126
  conditions: d,
3136
3127
  effectId: f,
3137
- triggerType: v
3138
- }, w = kt(t, y);
3128
+ triggerType: m
3129
+ }, $ = qt(t, E);
3139
3130
  if (h)
3140
- return a || !h.type ? null : { namedEffect: h, initial: w, ...y };
3141
- if (p) {
3142
- if (!p.name) {
3143
- const $ = f && !(i[f] && "keyframeEffect" in e);
3144
- p.name = $ ? f : B();
3131
+ return c || !h.type ? null : { namedEffect: h, initial: $, ...E };
3132
+ if (g) {
3133
+ if (!g.name) {
3134
+ const b = f && !(i[f] && "keyframeEffect" in e);
3135
+ g.name = b ? f : U();
3145
3136
  }
3146
- return { keyframeEffect: p, initial: w, ...y };
3147
- } else return m ? a ? null : { initial: w, ...y } : g ? { transition: g, initial: w, ...y } : E ? { transitionProperties: E, initial: w, ...y } : { initial: w, ...y };
3137
+ return { keyframeEffect: g, initial: $, ...E };
3138
+ } else return p ? c ? null : { initial: $, ...E } : v ? { transition: v, initial: $, ...E } : y ? { transitionProperties: y, initial: $, ...E } : { initial: $, ...E };
3148
3139
  }
3149
- function ni(e, t, n, s) {
3150
- const { sequences: i = {}, conditions: r = {} } = n;
3151
- e.sequenceId || (e.sequenceId = s || B());
3152
- const { sequenceId: o } = e, c = { ...i[o] || {}, ...e };
3140
+ function ei(e, t, n, s) {
3141
+ const { sequences: i = {}, conditions: o = {} } = n;
3142
+ e.sequenceId || (e.sequenceId = s || U());
3143
+ const { sequenceId: r } = e, a = { ...i[r] || {}, ...e };
3153
3144
  let {
3154
- effects: a,
3145
+ effects: c,
3155
3146
  conditions: f,
3156
3147
  triggerType: u,
3157
3148
  delay: l = 0,
3158
3149
  offset: d = 0,
3159
- offsetEasing: v = "linear"
3160
- } = c;
3161
- if (typeof v == "function")
3150
+ offsetEasing: m = "linear"
3151
+ } = a;
3152
+ if (typeof m == "function")
3162
3153
  return null;
3163
- u || (u = $t.get(t.trigger)), f = [
3164
- ...new Set((f || []).filter((p) => r[p]))
3154
+ u || (u = Tt.get(t.trigger)), f = [
3155
+ ...new Set((f || []).filter((g) => o[g]))
3165
3156
  ];
3166
- const m = a.map((p) => (p.conditions ? p.conditions.push(...f) : p.conditions = [...f], St({ ...p, triggerType: u }, t, n))).filter((p) => p !== null);
3167
- return m.length ? {
3168
- sequenceId: o,
3157
+ const p = c.map((g, v) => (g.conditions ? g.conditions.push(...f) : g.conditions = [...f], Ct(
3158
+ { ...g, triggerType: u },
3159
+ t,
3160
+ n,
3161
+ `${r}-eff-${v}`
3162
+ ))).filter((g) => g !== null);
3163
+ return p.length ? {
3164
+ sequenceId: r,
3169
3165
  triggerType: u,
3170
3166
  conditions: f,
3171
3167
  delay: l,
3172
3168
  offset: d,
3173
- offsetEasing: v,
3174
- effects: m
3169
+ offsetEasing: m,
3170
+ effects: p
3175
3171
  } : null;
3176
3172
  }
3177
- function si(e) {
3178
- return e === "cssFloat" ? "float" : e === "easing" ? "animation-timing-function" : e === "cssOffset" ? "offset" : e === "composite" ? "animation-composition" : ue(e);
3173
+ function ti(e) {
3174
+ return e === "cssFloat" ? "float" : e === "easing" ? "animation-timing-function" : e === "cssOffset" ? "offset" : e === "composite" ? "animation-composition" : fe(e);
3179
3175
  }
3180
- function ii(e) {
3176
+ function ni(e) {
3181
3177
  if (!e.length)
3182
3178
  return [];
3183
3179
  const t = e.map((i) => ({ ...i }));
@@ -3185,132 +3181,221 @@ function ii(e) {
3185
3181
  let n = 0, s = t[0].offset;
3186
3182
  for (let i = 1; i < t.length; i++)
3187
3183
  if (t[i].offset !== void 0) {
3188
- const r = t[i].offset;
3189
- if (r < s)
3184
+ const o = t[i].offset;
3185
+ if (o < s)
3190
3186
  return console.error("Offsets must be monotonically non-decreasing"), [];
3191
- if (r > 1)
3187
+ if (o > 1)
3192
3188
  return console.error("Offsets must be in the range [0,1]"), [];
3193
- const o = i - n;
3194
- for (let c = n + 1; c < i; c++) {
3195
- const a = (c - n) / o;
3196
- t[c].offset = s + (r - s) * a;
3189
+ const r = i - n;
3190
+ for (let a = n + 1; a < i; a++) {
3191
+ const c = (a - n) / r;
3192
+ t[a].offset = s + (o - s) * c;
3197
3193
  }
3198
- n = i, s = r;
3194
+ n = i, s = o;
3199
3195
  }
3200
3196
  return t;
3201
3197
  }
3202
- function ri(e, t) {
3203
- const n = Object.entries(e).filter(([s, i]) => s !== "offset" && i !== void 0 && i !== null).map(([s, i]) => `${si(s)}: ${i};`).join(`
3204
- `);
3198
+ function si(e, t) {
3199
+ const n = Object.entries(e).filter(([s, i]) => s !== "offset" && i !== void 0 && i !== null).map(([s, i]) => `${ti(s)}: ${i};`).join(`
3200
+ `);
3205
3201
  return `${t}% {
3206
- ${n}
3207
- }`;
3202
+ ${n}
3203
+ }`;
3208
3204
  }
3209
- function oi(e, t) {
3210
- const n = ii(t);
3205
+ function ii(e, t) {
3206
+ const n = ni(t);
3211
3207
  if (!n.length)
3212
3208
  return "";
3213
3209
  let s = n.map((i) => {
3214
- const r = i.offset, o = Ws(r * 100);
3215
- return ri(i, o);
3210
+ const o = i.offset, r = Gs(o * 100);
3211
+ return si(i, r);
3216
3212
  }).join(`
3217
- `);
3213
+ `);
3218
3214
  return `@keyframes ${e} {
3219
- ${s}
3215
+ ${s}
3220
3216
  }`;
3221
3217
  }
3222
- function ci(e) {
3223
- const { key: t, childSelector: n, declarations: s, media: i, states: r, selectorCondition: o, selectorSuffix: c } = e;
3218
+ function oi(e) {
3219
+ const { key: t, childSelector: n, declarations: s, media: i, states: o, selectorCondition: r, selectorSuffix: a } = e;
3224
3220
  if (!s.length)
3225
3221
  return "";
3226
- let a = `[data-interact-key="${t}"]`;
3227
- if (r && r.length) {
3228
- const l = r.map((d) => `:state(${d}), :--${d}, [data-interact-effect~="${d}"]`).join(", ");
3229
- a = `${a}:is(${l})`;
3230
- }
3231
- n && (a = `${a} ${n}`), c && (a = `${a}${c}`), o && (a = oe(a, o));
3232
- const f = s.map(({ name: l, value: d, important: v }) => `${l}: ${d}${v ? " !important" : ""};`).join(`
3233
- `), u = `${a} {
3234
- ${f}
3222
+ let c = `[data-interact-key="${t}"]`;
3223
+ if (o && o.length) {
3224
+ const l = o.map((d) => `:state(${d}), :--${d}, [data-interact-effect~="${d}"]`).join(", ");
3225
+ c = `${c}:is(${l})`;
3226
+ }
3227
+ n && (c = `${c} ${n}`), a && (c = `${c}${a}`), r && (c = ce(c, r));
3228
+ const f = s.map(({ name: l, value: d, important: m }) => `${l}: ${d}${m ? " !important" : ""};`).join(`
3229
+ `), u = `${c} {
3230
+ ${f}
3235
3231
  }`;
3236
3232
  return i ? `@media ${i} {
3237
3233
  ${u}
3238
3234
  }` : u;
3239
3235
  }
3240
- function It(e, t, n, s) {
3241
- const { key: i, childSelector: r, properties: o } = e, c = Object.entries(o).filter(
3242
- (f) => f[1] && f[1].varNames.length
3243
- ).map(([f, { fallback: u, varNames: l }]) => ({
3244
- name: f,
3245
- value: l.map((d) => `var(${d}, ${u})`).join(", ")
3246
- })), a = { key: i, childSelector: r, declarations: c };
3247
- return t && a.declarations.forEach((f) => {
3248
- f.name = t[f.name];
3249
- }), n && (a.media = X(n, s || {}, "media"), a.selectorCondition = P(n, s || {})), a;
3250
- }
3251
- const ai = [
3252
- { name: "visibility", value: "hidden" },
3253
- { name: "transform", value: "none", important: !0 },
3254
- { name: "translate", value: "none", important: !0 },
3255
- { name: "scale", value: "none", important: !0 },
3256
- { name: "rotate", value: "none", important: !0 }
3257
- ], ce = [
3236
+ const pe = [
3258
3237
  "animation",
3259
3238
  "animation-composition",
3260
3239
  "animation-timeline",
3261
3240
  "animation-range"
3262
- ], Ce = ["transition", ...ce], ui = {
3263
- animation: "animation",
3264
- "animation-composition": "composition",
3265
- "animation-timeline": "animationTimeline",
3266
- "animation-range": "animationRange"
3267
- }, ae = {
3241
+ ], ke = [
3242
+ ...pe,
3243
+ "transition"
3244
+ ], Me = ["animation", "transition"];
3245
+ function Ae(e) {
3246
+ return e === "transition" ? "transition" : "animation";
3247
+ }
3248
+ const z = {
3249
+ transition: "_",
3268
3250
  animation: "none",
3269
3251
  "animation-composition": "replace",
3270
- transition: "_",
3271
3252
  "animation-timeline": "auto",
3272
3253
  "animation-range": "normal"
3273
3254
  };
3274
- function Tt(e, t, n) {
3275
- const s = e.get(t);
3276
- s ? n.forEach((i) => s.add(i)) : e.set(t, new Set(n));
3277
- }
3278
- function Ot(e, t, n, s) {
3279
- const { key: i, childSelector: r } = n, o = s ? Ce.filter((a) => s.has(a)) : Ce;
3280
- e.has(t) || e.set(t, { key: i, childSelector: r, properties: {} });
3281
- const { properties: c } = e.get(t);
3282
- for (const a of o)
3283
- c[a] || (c[a] = { fallback: ae[a], varNames: [] }), c[a].varNames.push(n[a]);
3284
- }
3285
- function Ct(e, t) {
3286
- return Ce.reduce(
3287
- (n, s) => (n[s] = Ys([s, ...e, t]), n),
3288
- {}
3255
+ function F(e, t, n = !1) {
3256
+ return `--${e.replace(new RegExp("(?<!(^|-))([aeiou]|tion)", "g"), "")}${n ? "-slot" : ""}-${t}`;
3257
+ }
3258
+ function ri(e, t, n, s) {
3259
+ return ke.flatMap((i) => [
3260
+ ...Array.from(
3261
+ { length: i === "transition" ? t : e },
3262
+ (o, r) => `@property ${F(i, r)} { syntax: "*"; inherits: false; initial-value: ${z[i]}; }`
3263
+ ),
3264
+ ...Array.from(
3265
+ { length: i === "transition" ? s : n },
3266
+ (o, r) => `@property ${F(i, r, !0)} { syntax: "*"; inherits: false; initial-value: ${z[i]}; }`
3267
+ )
3268
+ ]);
3269
+ }
3270
+ function ai(e, t, n) {
3271
+ const s = ke.filter(
3272
+ (r) => e[Ae(r)].slotsInSequence > 0
3289
3273
  );
3274
+ if (s.length === 0)
3275
+ return null;
3276
+ const i = s.map((r) => {
3277
+ const { listIndex: a, slotCursor: c, slotsInSequence: f } = e[Ae(r)];
3278
+ return {
3279
+ name: F(r, a),
3280
+ value: Array.from(
3281
+ { length: f },
3282
+ (u, l) => `var(${F(r, c + l, !0)})`
3283
+ ).join(", ")
3284
+ };
3285
+ }), o = { key: e.key, childSelector: e.childSelector, declarations: i };
3286
+ return t && (o.media = J(t, n || {}, "media"), o.selectorCondition = M(t, n || {})), o;
3290
3287
  }
3291
- function fi(e, t, n, s, i) {
3292
- return s.has(e) || s.set(e, {
3293
- key: t,
3294
- childSelector: i,
3295
- ...Ct([n], Ye(e))
3296
- }), s.get(e);
3288
+ function ci(e, t, n) {
3289
+ if (e.length === 0)
3290
+ return "";
3291
+ const s = [
3292
+ ...t <= 0 ? [] : pe,
3293
+ ...n <= 0 ? [] : ["transition"]
3294
+ ];
3295
+ if (s.length === 0)
3296
+ return "";
3297
+ const i = s.map((r) => ({
3298
+ name: r,
3299
+ value: Array.from(
3300
+ { length: r === "transition" ? n : t },
3301
+ // TODO: maybe add `-intrct` to names? --anm-0 or --trns-0 could collide with user-defined names
3302
+ (a, c) => `var(${F(r, c)})`
3303
+ ).join(", ")
3304
+ }));
3305
+ return `${e.map(
3306
+ ({ key: r, childSelector: a }) => `[data-interact-key="${r}"]${a ? ` ${a}` : ""}`
3307
+ ).join(", ")} {
3308
+ ${i.map(({ name: r, value: a }) => ` ${r}: ${a};`).join(`
3309
+ `)}
3310
+ }`;
3297
3311
  }
3298
- function li(e, t, n) {
3299
- return Ct([t, n], Ye(e));
3312
+ const ui = [
3313
+ { name: "visibility", value: "hidden" },
3314
+ { name: "transform", value: "none", important: !0 },
3315
+ { name: "translate", value: "none", important: !0 },
3316
+ { name: "scale", value: "none", important: !0 },
3317
+ { name: "rotate", value: "none", important: !0 }
3318
+ ], fi = { animation: !1, transition: !1 };
3319
+ function li(e, t) {
3320
+ const n = () => ({
3321
+ listIndex: 0,
3322
+ slotCursor: 0,
3323
+ slotsInInteraction: 0,
3324
+ slotsInSequence: 0,
3325
+ touched: !1
3326
+ });
3327
+ return {
3328
+ key: e,
3329
+ childSelector: t,
3330
+ assigned: /* @__PURE__ */ new Set(),
3331
+ animation: n(),
3332
+ transition: n()
3333
+ };
3300
3334
  }
3301
- function di(e, t, n, s = !0) {
3302
- const { key: i, conditions: r } = e, o = X(r, t, "media"), c = P(r, t), a = L(e, {
3335
+ function di(e, t) {
3336
+ return Object.fromEntries(
3337
+ ke.map((n) => {
3338
+ const s = Ae(n), { listIndex: i, slotCursor: o, slotsInSequence: r } = e[s];
3339
+ return [
3340
+ n,
3341
+ t[s] ? F(n, o + r, !0) : F(n, i)
3342
+ ];
3343
+ })
3344
+ );
3345
+ }
3346
+ function hi(e, t, n) {
3347
+ Me.forEach((s) => {
3348
+ t[s] && (e[s].touched = !0, n[s] && (e[s].slotsInSequence += 1));
3349
+ });
3350
+ }
3351
+ function mi(e) {
3352
+ const { namedEffect: t, keyframeEffect: n, transition: s, transitionProperties: i } = e;
3353
+ return t || n ? "animation" : s || i ? "transition" : null;
3354
+ }
3355
+ function pi(e) {
3356
+ const t = /* @__PURE__ */ new Map();
3357
+ return e.effects.forEach((n) => {
3358
+ const s = mi(n);
3359
+ if (!s)
3360
+ return;
3361
+ const i = ue(n), o = t.get(i) || { animation: 0, transition: 0 };
3362
+ o[s] += 1, t.set(i, o);
3363
+ }), new Map(
3364
+ [...t].map(([n, { animation: s, transition: i }]) => [
3365
+ n,
3366
+ { animation: s > 1, transition: i > 1 }
3367
+ ])
3368
+ );
3369
+ }
3370
+ function gi(e) {
3371
+ Me.forEach((t) => {
3372
+ const n = e[t];
3373
+ n.slotsInInteraction = Math.max(n.slotsInInteraction, n.slotsInSequence), n.slotsInSequence = 0;
3374
+ });
3375
+ }
3376
+ function vi(e) {
3377
+ Me.forEach((t) => {
3378
+ const n = e[t];
3379
+ n.listIndex += n.touched ? 1 : 0, n.slotCursor += n.slotsInInteraction, n.slotsInInteraction = 0, n.touched = !1;
3380
+ });
3381
+ }
3382
+ const yi = {
3383
+ animation: "animation",
3384
+ "animation-composition": "composition",
3385
+ "animation-timeline": "animationTimeline",
3386
+ "animation-range": "animationRange"
3387
+ };
3388
+ function Ei(e, t, n) {
3389
+ const { key: s, conditions: i } = t, o = J(i, e.configConditions, "media"), r = M(i, e.configConditions), a = D(t, {
3303
3390
  asCombinator: !0,
3304
- useFirstChild: s,
3391
+ useFirstChild: e.useFirstChild,
3305
3392
  addItemFilter: !0
3306
3393
  });
3307
3394
  return {
3308
- key: i,
3395
+ key: s,
3309
3396
  media: o,
3310
- selectorCondition: c,
3397
+ selectorCondition: r,
3311
3398
  childSelector: a,
3312
- // invalidating earlier cascaded custom properties affected from earlier transitionEffects
3313
- // to implement same-interaction-cascade
3314
3399
  declarations: [
3315
3400
  {
3316
3401
  name: "view-timeline",
@@ -3319,247 +3404,203 @@ function di(e, t, n, s = !0) {
3319
3404
  ]
3320
3405
  };
3321
3406
  }
3322
- function At(e, t, n, s, i) {
3323
- const r = [];
3324
- for (const o of Object.keys(i)) {
3325
- const c = `${dt}${o}`;
3326
- c in t && r.push(
3327
- ...i[o](t[c], {
3407
+ function Ot(e, t, n, s, i) {
3408
+ const o = [];
3409
+ for (const r of Object.keys(i)) {
3410
+ const a = `${pt}${r}`;
3411
+ a in t && o.push(
3412
+ ...i[r](t[a], {
3328
3413
  key: n,
3329
3414
  scope: e,
3330
3415
  config: t
3331
- }).map((a) => ({ ...a, key: n, media: s }))
3416
+ }).map((c) => ({ ...c, key: n, media: s }))
3332
3417
  );
3333
3418
  }
3334
- return r;
3335
- }
3336
- function hi(e, t, n, s, i, r, o) {
3337
- const {
3338
- key: c,
3339
- effectId: a,
3340
- conditions: f,
3341
- namedEffect: u,
3342
- keyframeEffect: l,
3343
- transition: d,
3344
- transitionProperties: v,
3345
- initial: h
3346
- } = e, m = X(f, t, "media"), p = P(f, t), g = [
3419
+ return o;
3420
+ }
3421
+ function wi(e, t, n, s, i, o) {
3422
+ const { assigned: r, childSelector: a } = n, c = { animation: !1, transition: !1 }, {
3423
+ key: f,
3424
+ effectId: u,
3425
+ conditions: l,
3426
+ namedEffect: d,
3427
+ keyframeEffect: m,
3428
+ transition: h,
3429
+ transitionProperties: p,
3430
+ initial: g
3431
+ } = t, v = J(l, e.configConditions, "media"), y = M(l, e.configConditions), E = [
3347
3432
  {
3348
- key: c,
3349
- media: m,
3350
- selectorCondition: p,
3351
- childSelector: i,
3433
+ key: f,
3434
+ media: v,
3435
+ selectorCondition: y,
3436
+ childSelector: a,
3352
3437
  declarations: []
3353
3438
  }
3354
3439
  ];
3355
- let E = [];
3356
- const { declarations: y } = g[0];
3357
- let w = [];
3358
- if (r && g.push(...At("effect", e, c, m, r)), u || l) {
3359
- w = [...ce];
3360
- const $ = M(e), S = Cn(null, $, s, o).filter(
3440
+ let $ = [];
3441
+ const { declarations: b } = E[0];
3442
+ if (e.plugins && E.push(...Ot("effect", t, f, v, e.plugins)), d || m) {
3443
+ const S = P(t), I = Cn(null, S, s, o).filter(
3361
3444
  (T) => T.name
3362
3445
  );
3363
- E = S.map((T) => ({
3446
+ $ = I.map((T) => ({
3364
3447
  name: T.name,
3365
3448
  keyframes: T.keyframes
3366
- })), y.push(
3367
- ...S.flatMap(
3368
- ({ custom: T }) => Object.entries(T || {}).filter(([C, A]) => A !== void 0).map(([C, A]) => ({ name: C, value: A }))
3449
+ })), b.push(
3450
+ ...I.flatMap(
3451
+ ({ custom: T }) => Object.entries(T || {}).filter(([_, x]) => x !== void 0).map(([_, x]) => ({ name: _, value: x }))
3369
3452
  )
3370
3453
  );
3371
- const I = ce.map((T) => ({
3372
- name: n[T],
3373
- value: S.map((C) => {
3374
- const A = ui[T];
3375
- return C[A];
3376
- }).join(", ") || ae[T]
3377
- }));
3378
- h ? (g.push({
3379
- key: c,
3380
- media: m,
3381
- selectorCondition: p,
3382
- childSelector: i,
3383
- declarations: ai,
3454
+ const O = pe.map((T) => ({
3455
+ _listPropertyName: T,
3456
+ name: i[T],
3457
+ value: I.map((_) => {
3458
+ const x = yi[T];
3459
+ return _[x] || z[T];
3460
+ }).join(", ")
3461
+ })).filter(
3462
+ ({ _listPropertyName: T, name: _, value: x }) => x !== z[T] || r.has(_)
3463
+ );
3464
+ O.forEach(({ name: T }) => r.add(T)), c.animation = O.length > 0, g ? (E.push({
3465
+ key: f,
3466
+ media: v,
3467
+ selectorCondition: y,
3468
+ childSelector: a,
3469
+ declarations: ui,
3384
3470
  selectorSuffix: ":not([data-interact-enter])"
3385
- }), g.push({
3386
- key: c,
3387
- media: m,
3388
- selectorCondition: p,
3389
- childSelector: i,
3390
- declarations: I,
3471
+ }), E.push({
3472
+ key: f,
3473
+ media: v,
3474
+ selectorCondition: y,
3475
+ childSelector: a,
3476
+ declarations: O,
3391
3477
  selectorSuffix: ':not([data-interact-enter="done"])'
3392
- })) : y.push(...I);
3393
- } else if (d || v) {
3394
- w = ["transition"];
3395
- const $ = ht(e), S = mt(e);
3396
- y.push({
3397
- name: n.transition,
3398
- value: S.join(", ") || ae.transition
3399
- }), g.push({
3400
- key: c,
3401
- media: m,
3402
- selectorCondition: p,
3403
- childSelector: i,
3404
- states: [a],
3405
- declarations: $
3478
+ })) : b.push(...O);
3479
+ } else if (h || p) {
3480
+ const S = gt(t), I = vt(t);
3481
+ (I.length || r.has(i.transition)) && (b.push({
3482
+ name: i.transition,
3483
+ value: I.join(", ") || z.transition
3484
+ }), r.add(i.transition), c.transition = !0), E.push({
3485
+ key: f,
3486
+ media: v,
3487
+ selectorCondition: y,
3488
+ childSelector: a,
3489
+ states: [u],
3490
+ declarations: S
3406
3491
  });
3407
3492
  } else
3408
- y.push(
3409
- ...ce.map(($) => ({
3410
- name: n[$],
3411
- value: ae[$]
3493
+ b.push(
3494
+ ...pe.filter(
3495
+ (S) => r.has(i[S])
3496
+ ).map((S) => ({
3497
+ name: i[S],
3498
+ value: z[S]
3412
3499
  }))
3413
3500
  );
3414
- return { rules: g.filter(($) => $.declarations.length), keyframes: E, usedProperties: w };
3501
+ return { rules: E.filter((S) => S.declarations.length), keyframes: $, wrote: c };
3415
3502
  }
3416
- function qt(e, t, n, s, i, r, o = !0, c, a, f, u) {
3417
- const { key: l } = n, d = f ?? V(n), v = L(n, {
3418
- asCombinator: !0,
3419
- useFirstChild: o,
3420
- addItemFilter: !0
3421
- }), m = { ...fi(
3422
- d,
3423
- l,
3503
+ function _t(e, t, n, s, i, o) {
3504
+ const r = ue(t), a = e.targetsMap.get(r) || li(
3505
+ t.key,
3506
+ D(t, {
3507
+ asCombinator: !0,
3508
+ useFirstChild: e.useFirstChild,
3509
+ addItemFilter: !0
3510
+ })
3511
+ );
3512
+ s.add(r);
3513
+ const c = o?.get(r) || fi, f = di(a, c), { rules: u, keyframes: l, wrote: d } = wi(
3514
+ e,
3424
3515
  t,
3425
- s,
3426
- v
3427
- ) };
3428
- a && Object.assign(m, a);
3429
- const { rules: p, keyframes: g, usedProperties: E } = hi(
3516
+ a,
3430
3517
  n,
3431
- e,
3432
- m,
3433
- r,
3434
- v,
3435
- c,
3436
- u
3518
+ f,
3519
+ i
3437
3520
  );
3438
- return g.forEach(({ name: y, keyframes: w }) => i.set(y, w)), { rules: p, usedProperties: E };
3521
+ return l.forEach(({ name: m, keyframes: h }) => e.keyframesMap.set(m, h)), hi(a, d, c), e.targetsMap.set(r, a), u;
3439
3522
  }
3440
- function mi(e, t, n, s, i, r, o = !0, c, a) {
3441
- const f = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Map(), l = [];
3442
- for (const v of n.effects) {
3443
- const h = V(v), { key: m } = v, p = L(v, {
3444
- asCombinator: !0,
3445
- useFirstChild: o,
3446
- addItemFilter: !0
3447
- }), g = u.get(h) || 0;
3448
- u.set(h, g + 1);
3449
- const E = li(h, t, g), { rules: y, usedProperties: w } = qt(
3450
- e,
3451
- t,
3452
- v,
3453
- s,
3454
- i,
3455
- r,
3456
- o,
3457
- a,
3458
- E,
3459
- h,
3460
- n
3461
- );
3462
- l.push(...y);
3463
- const $ = new Set(w);
3464
- Ot(
3465
- f,
3466
- h,
3467
- { key: m, childSelector: p, ...E },
3468
- $
3469
- ), c && Tt(c, h, w);
3470
- }
3471
- const { conditions: d } = n;
3472
- return f.forEach((v, h) => {
3473
- const m = s.get(h);
3474
- l.push(It(v, m, d, e));
3475
- }), l;
3476
- }
3477
- function pi(e, t, n, s, i, r = !0, o) {
3478
- const { key: c, conditions: a, effects: f = [], sequences: u = [] } = t, l = e.conditions || {}, d = /* @__PURE__ */ new Map(), v = /* @__PURE__ */ new Map(), h = f.map(
3479
- (y, w) => St(y, t, e, `eff-${n}-${w}`)
3480
- ).filter((y) => y !== null), m = o ? At(
3523
+ function $i(e, t, n, s) {
3524
+ const i = [], o = /* @__PURE__ */ new Set(), r = pi(t);
3525
+ i.push(
3526
+ ...t.effects.flatMap(
3527
+ (c) => _t(e, c, n, o, t, r)
3528
+ )
3529
+ );
3530
+ const { conditions: a } = t;
3531
+ return o.forEach((c) => {
3532
+ s.add(c);
3533
+ const f = e.targetsMap.get(c), u = ai(f, a, e.configConditions);
3534
+ u && (u.declarations.forEach(({ name: l }) => f.assigned.add(l)), i.push(u)), gi(f);
3535
+ }), i;
3536
+ }
3537
+ function bi(e, t, n) {
3538
+ const { key: s, conditions: i, effects: o = [], sequences: r = [] } = t, a = e.plugins ? Ot(
3481
3539
  "interaction",
3482
3540
  t,
3483
- c,
3484
- X(a, l, "media"),
3485
- o
3486
- ) : [], { trigger: p } = t, g = {
3487
- trigger: Bs(p),
3541
+ s,
3542
+ J(i, e.configConditions, "media"),
3543
+ e.plugins
3544
+ ) : [], { trigger: c } = t, f = {
3545
+ trigger: Vs(c),
3488
3546
  id: ["trigger", n].join("-")
3489
3547
  };
3490
- p === "viewProgress" && m.push(di(t, l, g.id, r));
3491
- for (const y of h) {
3492
- const w = V(y), { rules: $, usedProperties: S } = qt(
3493
- l,
3494
- n,
3495
- y,
3496
- d,
3497
- i,
3498
- g,
3499
- r,
3500
- o
3501
- );
3502
- m.push(...$), Tt(v, w, S);
3503
- }
3504
- const E = u.map(
3505
- (y, w) => ni(y, t, e, `seq-${n}-${w}`)
3506
- ).filter((y) => y !== null);
3507
- return m.push(
3508
- ...E.flatMap(
3509
- (y) => mi(
3510
- l,
3511
- n,
3512
- y,
3513
- d,
3514
- i,
3515
- g,
3516
- r,
3517
- v,
3518
- o
3519
- )
3548
+ c === "viewProgress" && a.push(Ei(e, t, f.id));
3549
+ const u = /* @__PURE__ */ new Set(), l = o.map(
3550
+ (m, h) => Ct(m, t, e.config, `eff-${n}-${h}`)
3551
+ ).filter((m) => m !== null);
3552
+ a.push(
3553
+ ...l.flatMap((m) => _t(e, m, f, u))
3554
+ );
3555
+ const d = r.map(
3556
+ (m, h) => ei(m, t, e.config, `seq-${n}-${h}`)
3557
+ ).filter((m) => m !== null);
3558
+ return a.push(
3559
+ ...d.flatMap(
3560
+ (m) => $i(e, m, f, u)
3520
3561
  )
3521
- ), d.forEach((y, w) => {
3522
- Ot(
3523
- s,
3524
- w,
3525
- y,
3526
- v.get(w)
3527
- );
3528
- }), m;
3562
+ ), u.forEach((m) => vi(e.targetsMap.get(m))), a;
3529
3563
  }
3530
- function gi(e = {}) {
3564
+ function Si(e = {}) {
3531
3565
  const { useFirstChild: t = !0, plugins: n } = typeof e == "boolean" ? { useFirstChild: e, plugins: void 0 } : e;
3532
3566
  return { useFirstChild: t, plugins: n };
3533
3567
  }
3534
- function vi(e, t) {
3535
- const { useFirstChild: n, plugins: s } = gi(t), i = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), o = e.interactions.flatMap(
3536
- (c, a) => pi(
3537
- e,
3538
- c,
3539
- a,
3540
- i,
3541
- r,
3542
- n,
3543
- s
3544
- )
3568
+ function Ii(e, t) {
3569
+ const { useFirstChild: n, plugins: s } = Si(t), i = {
3570
+ config: e,
3571
+ configConditions: e.conditions || {},
3572
+ targetsMap: /* @__PURE__ */ new Map(),
3573
+ keyframesMap: /* @__PURE__ */ new Map(),
3574
+ useFirstChild: n,
3575
+ plugins: s
3576
+ }, o = e.interactions.flatMap(
3577
+ (m, h) => bi(i, m, h)
3578
+ ), r = [...i.targetsMap.values()], a = Math.max(0, ...r.map(({ animation: m }) => m.listIndex)), c = Math.max(0, ...r.map(({ transition: m }) => m.listIndex)), f = ci(r, a, c), u = Math.max(0, ...r.map(({ animation: m }) => m.slotCursor)), l = Math.max(
3579
+ 0,
3580
+ ...r.map(({ transition: m }) => m.slotCursor)
3581
+ ), d = ri(
3582
+ a,
3583
+ c,
3584
+ u,
3585
+ l
3545
3586
  );
3546
- return i.forEach((c) => {
3547
- o.push(It(c));
3548
- }), { keyframes: r, cssRules: o };
3587
+ return { keyframes: i.keyframesMap, atProperty: d, cssRules: o, listsRule: f };
3549
3588
  }
3550
- function wi(e, t) {
3551
- const { cssRules: n, keyframes: s } = vi(e, t);
3589
+ function Oi(e, t) {
3590
+ const { cssRules: n, keyframes: s, atProperty: i, listsRule: o } = Ii(e, t);
3552
3591
  return [
3553
- ...[...s.entries()].map(([r, o]) => oi(r, o)),
3554
- ...n.map(ci)
3555
- ].join(`
3592
+ ...i,
3593
+ ...[...s.entries()].map(([a, c]) => ii(a, c)),
3594
+ ...n.map(oi),
3595
+ o
3596
+ ].filter((a) => a).join(`
3556
3597
  `);
3557
3598
  }
3558
3599
  export {
3559
- ti as I,
3560
- b as a,
3561
- yi as b,
3562
- wi as g,
3563
- Ei as r
3600
+ Js as I,
3601
+ w as a,
3602
+ Ti as b,
3603
+ Oi as g,
3604
+ Ci as r
3564
3605
  };
3565
- //# sourceMappingURL=index-Cy5DK4f-.mjs.map
3606
+ //# sourceMappingURL=index-Cv5FJznH.mjs.map