@wix/interact 2.8.4 → 2.8.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/dist/cjs/index.js +1 -1
  2. package/dist/cjs/react.js +1 -1
  3. package/dist/cjs/web.js +1 -1
  4. package/dist/es/index.js +1 -1
  5. package/dist/es/react.js +2 -2
  6. package/dist/es/web.js +2 -2
  7. package/dist/index-D8zv4Q-3.js +29 -0
  8. package/dist/index-D8zv4Q-3.js.map +1 -0
  9. package/dist/{index-DxihyZYQ.mjs → index-DSREj0qw.mjs} +1628 -1427
  10. package/dist/index-DSREj0qw.mjs.map +1 -0
  11. package/dist/tsconfig.build.tsbuildinfo +1 -1
  12. package/dist/types/core/Interact.d.ts +2 -2
  13. package/dist/types/core/InteractionController.d.ts +6 -1
  14. package/dist/types/core/InteractionController.d.ts.map +1 -1
  15. package/dist/types/core/add.d.ts.map +1 -1
  16. package/dist/types/handlers/animationEnd.d.ts +15 -0
  17. package/dist/types/handlers/animationEnd.d.ts.map +1 -1
  18. package/dist/types/handlers/viewEnter.d.ts +8 -0
  19. package/dist/types/handlers/viewEnter.d.ts.map +1 -1
  20. package/dist/types/react/Interaction.d.ts +1 -1
  21. package/dist/types/types/controller.d.ts +15 -2
  22. package/dist/types/types/controller.d.ts.map +1 -1
  23. package/dist/types/types/handlers.d.ts +18 -0
  24. package/dist/types/types/handlers.d.ts.map +1 -1
  25. package/dist/types/types/internal.d.ts +2 -0
  26. package/dist/types/types/internal.d.ts.map +1 -1
  27. package/dist/types/types/plugins.d.ts +12 -4
  28. package/dist/types/types/plugins.d.ts.map +1 -1
  29. package/docs/api/interact-class.md +1 -1
  30. package/docs/api/types.md +3 -1
  31. package/docs/guides/plugins.md +28 -3
  32. package/package.json +2 -2
  33. package/rules/full-lean.md +2 -1
  34. package/rules/plugins.md +5 -1
  35. package/dist/index-DxihyZYQ.mjs.map +0 -1
  36. package/dist/index-OM5ScKV3.js +0 -29
  37. package/dist/index-OM5ScKV3.js.map +0 -1
@@ -1,23 +1,23 @@
1
- function hn(e) {
1
+ function In(e) {
2
2
  return [...e.matchAll(/\[([^\]]+)]/g)].map(([t, n]) => n);
3
3
  }
4
- function A(e, t) {
5
- const n = hn(t);
4
+ function R(e, t) {
5
+ const n = In(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 mn(e, t) {
12
+ function _n(e, t) {
13
13
  return e.trigger === "viewEnter" && t.triggerType === "once" && B(e) === B(t);
14
14
  }
15
15
  function B(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
- const Ke = "$";
20
- class ie {
19
+ const Xe = "$";
20
+ class ce {
21
21
  animations;
22
22
  options;
23
23
  ready;
@@ -121,64 +121,64 @@ class ie {
121
121
  });
122
122
  }
123
123
  }
124
- const $t = (e) => e, pn = (e) => 1 - Math.cos(e * Math.PI / 2), gn = (e) => Math.sin(e * Math.PI / 2), vn = (e) => -(Math.cos(Math.PI * e) - 1) / 2, yn = (e) => e ** 2, En = (e) => 1 - (1 - e) ** 2, wn = (e) => e < 0.5 ? 2 * e ** 2 : 1 - (-2 * e + 2) ** 2 / 2, $n = (e) => e ** 3, Sn = (e) => 1 - (1 - e) ** 3, bn = (e) => e < 0.5 ? 4 * e ** 3 : 1 - (-2 * e + 2) ** 3 / 2, In = (e) => e ** 4, Tn = (e) => 1 - (1 - e) ** 4, On = (e) => e < 0.5 ? 8 * e ** 4 : 1 - (-2 * e + 2) ** 4 / 2, Cn = (e) => e ** 5, Mn = (e) => 1 - (1 - e) ** 5, _n = (e) => e < 0.5 ? 16 * e ** 5 : 1 - (-2 * e + 2) ** 5 / 2, Pn = (e) => e === 0 ? 0 : 2 ** (10 * e - 10), kn = (e) => e === 1 ? 1 : 1 - 2 ** (-10 * e), An = (e) => e === 0 ? 0 : e === 1 ? 1 : e < 0.5 ? 2 ** (20 * e - 10) / 2 : (2 - 2 ** (-20 * e + 10)) / 2, qn = (e) => 1 - Math.sqrt(1 - e ** 2), Rn = (e) => Math.sqrt(1 - (e - 1) ** 2), Ln = (e) => e < 0.5 ? (1 - Math.sqrt(1 - 4 * e ** 2)) / 2 : (Math.sqrt(-(2 * e - 3) * (2 * e - 1)) + 1) / 2, Fn = (e) => 2.70158 * e ** 3 - 1.70158 * e ** 2, xn = (e) => 1 + 2.70158 * (e - 1) ** 3 + 1.70158 * (e - 1) ** 2, Nn = (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, Je = {
125
- linear: $t,
126
- sineIn: pn,
127
- sineOut: gn,
128
- sineInOut: vn,
129
- quadIn: yn,
130
- quadOut: En,
131
- quadInOut: wn,
132
- cubicIn: $n,
133
- cubicOut: Sn,
134
- cubicInOut: bn,
135
- quartIn: In,
136
- quartOut: Tn,
137
- quartInOut: On,
138
- quintIn: Cn,
139
- quintOut: Mn,
140
- quintInOut: _n,
141
- expoIn: Pn,
142
- expoOut: kn,
143
- expoInOut: An,
144
- circIn: qn,
145
- circOut: Rn,
146
- circInOut: Ln,
147
- backIn: Fn,
148
- backOut: xn,
149
- backInOut: Nn
150
- }, U = (e, t, n, s, i) => {
151
- const o = 3 * t, r = 3 * (s - 2 * t), a = 1 - 3 * s + 3 * t, l = 3 * n, u = 3 * (i - 2 * n), c = 1 - 3 * i + 3 * n;
152
- let f;
124
+ const Pt = (e) => e, Tn = (e) => 1 - Math.cos(e * Math.PI / 2), Mn = (e) => Math.sin(e * Math.PI / 2), On = (e) => -(Math.cos(Math.PI * e) - 1) / 2, Pn = (e) => e ** 2, Cn = (e) => 1 - (1 - e) ** 2, An = (e) => e < 0.5 ? 2 * e ** 2 : 1 - (-2 * e + 2) ** 2 / 2, kn = (e) => e ** 3, qn = (e) => 1 - (1 - e) ** 3, Rn = (e) => e < 0.5 ? 4 * e ** 3 : 1 - (-2 * e + 2) ** 3 / 2, Ln = (e) => e ** 4, Fn = (e) => 1 - (1 - e) ** 4, xn = (e) => e < 0.5 ? 8 * e ** 4 : 1 - (-2 * e + 2) ** 4 / 2, Nn = (e) => e ** 5, Dn = (e) => 1 - (1 - e) ** 5, jn = (e) => e < 0.5 ? 16 * e ** 5 : 1 - (-2 * e + 2) ** 5 / 2, zn = (e) => e === 0 ? 0 : 2 ** (10 * e - 10), Hn = (e) => e === 1 ? 1 : 1 - 2 ** (-10 * e), Gn = (e) => e === 0 ? 0 : e === 1 ? 1 : e < 0.5 ? 2 ** (20 * e - 10) / 2 : (2 - 2 ** (-20 * e + 10)) / 2, Wn = (e) => 1 - Math.sqrt(1 - e ** 2), Vn = (e) => Math.sqrt(1 - (e - 1) ** 2), Bn = (e) => e < 0.5 ? (1 - Math.sqrt(1 - 4 * e ** 2)) / 2 : (Math.sqrt(-(2 * e - 3) * (2 * e - 1)) + 1) / 2, Yn = (e) => 2.70158 * e ** 3 - 1.70158 * e ** 2, Un = (e) => 1 + 2.70158 * (e - 1) ** 3 + 1.70158 * (e - 1) ** 2, Kn = (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, at = {
125
+ linear: Pt,
126
+ sineIn: Tn,
127
+ sineOut: Mn,
128
+ sineInOut: On,
129
+ quadIn: Pn,
130
+ quadOut: Cn,
131
+ quadInOut: An,
132
+ cubicIn: kn,
133
+ cubicOut: qn,
134
+ cubicInOut: Rn,
135
+ quartIn: Ln,
136
+ quartOut: Fn,
137
+ quartInOut: xn,
138
+ quintIn: Nn,
139
+ quintOut: Dn,
140
+ quintInOut: jn,
141
+ expoIn: zn,
142
+ expoOut: Hn,
143
+ expoInOut: Gn,
144
+ circIn: Wn,
145
+ circOut: Vn,
146
+ circInOut: Bn,
147
+ backIn: Yn,
148
+ backOut: Un,
149
+ backInOut: Kn
150
+ }, Q = (e, t, n, s, i) => {
151
+ const o = 3 * t, r = 3 * (s - 2 * t), a = 1 - 3 * s + 3 * t, c = 3 * n, u = 3 * (i - 2 * n), f = 1 - 3 * i + 3 * n;
152
+ let l;
153
153
  if (a === 0)
154
- f = r === 0 ? `(${e} / ${o})` : `((sqrt(max(0, ${o * o} + ${4 * r} * ${e})) - ${o}) / ${2 * r})`;
154
+ l = r === 0 ? `(${e} / ${o})` : `((sqrt(max(0, ${o * o} + ${4 * r} * ${e})) - ${o}) / ${2 * r})`;
155
155
  else {
156
- const d = r / (3 * a), m = 2 * Math.pow(r, 3) - 9 * o * r * a, p = 54 * Math.pow(a, 3), h = (3 * a * o - r * r) / (9 * a * a), g = `((${m} - ${27 * a * a} * ${e}) / ${p})`;
157
- if (h < 0) {
158
- const v = 2 * Math.sqrt(-h);
156
+ const d = r / (3 * a), h = 2 * Math.pow(r, 3) - 9 * o * r * a, p = 54 * Math.pow(a, 3), m = (3 * a * o - r * r) / (9 * a * a), g = `((${h} - ${27 * a * a} * ${e}) / ${p})`;
157
+ if (m < 0) {
158
+ const v = 2 * Math.sqrt(-m);
159
159
  let y = 0;
160
160
  for (const E of [0, 1, 2])
161
- [0, 0.25, 0.5, 0.75, 1].every((S) => {
162
- const T = Math.min(
163
- Math.max(2 * (m - 27 * a * a * S) / (p * h * v), -1),
161
+ [0, 0.25, 0.5, 0.75, 1].every(($) => {
162
+ const _ = Math.min(
163
+ Math.max(2 * (h - 27 * a * a * $) / (p * m * v), -1),
164
164
  1
165
- ), I = v * Math.cos((Math.acos(T) - E * 2 * Math.PI) / 3) - d;
165
+ ), I = v * Math.cos((Math.acos(_) - E * 2 * Math.PI) / 3) - d;
166
166
  return I >= -1e-6 && I <= 1.000001;
167
167
  }) && (y = E);
168
- const $ = `(acos(clamp(-1, ${2 / (h * v)} * ${g}, 1)) - ${360 * y}deg) / 3`;
169
- f = `(${v} * cos(${$}) - ${d})`;
168
+ const b = `(acos(clamp(-1, ${2 / (m * v)} * ${g}, 1)) - ${360 * y}deg) / 3`;
169
+ l = `(${v} * cos(${b}) - ${d})`;
170
170
  } else {
171
- const v = `sqrt(pow(${g}, 2) + ${Math.pow(h, 3)})`;
172
- f = `(pow(${v} - ${g}, 1 / 3) - pow(${v} + ${g}, 1 / 3) - ${d})`;
171
+ const v = `sqrt(pow(${g}, 2) + ${Math.pow(m, 3)})`;
172
+ l = `(pow(${v} - ${g}, 1 / 3) - pow(${v} + ${g}, 1 / 3) - ${d})`;
173
173
  }
174
174
  }
175
- return `(${c} * pow(${f}, 3) + ${u} * pow(${f}, 2) + ${l} * ${f})`;
176
- }, et = {
175
+ return `(${f} * pow(${l}, 3) + ${u} * pow(${l}, 2) + ${c} * ${l})`;
176
+ }, ct = {
177
177
  linear: (e) => e,
178
- ease: (e) => U(e, 0.25, 0.1, 0.25, 1),
179
- easeIn: (e) => U(e, 0.42, 0, 1, 1),
180
- easeOut: (e) => U(e, 0, 0, 0.58, 1),
181
- easeInOut: (e) => U(e, 0.42, 0, 0.58, 1),
178
+ ease: (e) => Q(e, 0.25, 0.1, 0.25, 1),
179
+ easeIn: (e) => Q(e, 0.42, 0, 1, 1),
180
+ easeOut: (e) => Q(e, 0, 0, 0.58, 1),
181
+ easeInOut: (e) => Q(e, 0.42, 0, 0.58, 1),
182
182
  sineIn: (e) => `(1 - cos(${e} * 90deg))`,
183
183
  sineOut: (e) => `(sin(${e} * 90deg))`,
184
184
  sineInOut: (e) => `((1 - cos(${e} * 180deg)) / 2)`,
@@ -203,7 +203,7 @@ const $t = (e) => e, pn = (e) => 1 - Math.cos(e * Math.PI / 2), gn = (e) => Math
203
203
  backIn: (e) => `(2.70158 * pow(${e}, 3) - 1.70158 * ${e} * ${e})`,
204
204
  backOut: (e) => `(1 + 2.70158 * pow(${e} - 1, 3) + 1.70158 * (${e} - 1) * (${e} - 1))`,
205
205
  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)`
206
- }, tt = {
206
+ }, ft = {
207
207
  linear: "linear",
208
208
  ease: "ease",
209
209
  easeIn: "ease-in",
@@ -234,68 +234,68 @@ const $t = (e) => e, pn = (e) => 1 - Math.cos(e * Math.PI / 2), gn = (e) => Math
234
234
  backOut: "cubic-bezier(0.175, 0.885, 0.32, 1.275)",
235
235
  backInOut: "cubic-bezier(0.68, -0.55, 0.265, 1.55)"
236
236
  };
237
- function Dn(e) {
237
+ function Xn(e) {
238
238
  return e === "percentage" ? "%" : e || "px";
239
239
  }
240
- const jn = /^(webkit|moz|ms|o)(?=[A-Z])/, zn = Object.assign(/* @__PURE__ */ Object.create(null), {
240
+ const Qn = /^(webkit|moz|ms|o)(?=[A-Z])/, Zn = Object.assign(/* @__PURE__ */ Object.create(null), {
241
241
  float: "cssFloat",
242
242
  "animation-timing-function": "easing",
243
243
  "animation-composition": "composite"
244
244
  });
245
- function ye(e) {
246
- return e.startsWith("--") ? e : (jn.test(e) ? `-${e}` : e).replace(/[A-Z]/g, (n) => `-${n.toLowerCase()}`);
245
+ function $e(e) {
246
+ return e.startsWith("--") ? e : (Qn.test(e) ? `-${e}` : e).replace(/[A-Z]/g, (n) => `-${n.toLowerCase()}`);
247
247
  }
248
- function Hn(e) {
248
+ function Jn(e) {
249
249
  return e.startsWith("--") || !e.includes("-") ? e : e.replace(/^-/, "").replace(/-([a-z])/g, (t, n) => n.toUpperCase());
250
250
  }
251
- function St(e) {
252
- return zn[e] || Hn(e);
251
+ function Ct(e) {
252
+ return Zn[e] || Jn(e);
253
253
  }
254
- function Gn(e) {
254
+ function es(e) {
255
255
  for (const t in e)
256
- if (Object.hasOwn(e, t) && St(t) !== t)
256
+ if (Object.hasOwn(e, t) && Ct(t) !== t)
257
257
  return !0;
258
258
  return !1;
259
259
  }
260
- function bt(e) {
260
+ function At(e) {
261
261
  if (!Array.isArray(e))
262
262
  return e;
263
263
  let t;
264
264
  return e.forEach((n, s) => {
265
- if (!n || typeof n != "object" || !Gn(n))
265
+ if (!n || typeof n != "object" || !es(n))
266
266
  return;
267
267
  t ??= e.slice();
268
268
  const i = {};
269
269
  for (const o in n)
270
- Object.hasOwn(n, o) && (i[St(o)] = n[o]);
270
+ Object.hasOwn(n, o) && (i[Ct(o)] = n[o]);
271
271
  t[s] = i;
272
272
  }), t || e;
273
273
  }
274
- function me(e) {
275
- return e ? tt[e] || e : tt.linear;
274
+ function ye(e) {
275
+ return e ? ft[e] || e : ft.linear;
276
276
  }
277
- function Wn(e, t, n, s) {
278
- const i = 3 * e, o = 3 * (n - e) - i, r = 1 - i - o, a = 3 * t, l = 3 * (s - t) - a, u = 1 - a - l, c = (p) => ((r * p + o) * p + i) * p, f = (p) => ((u * p + l) * p + a) * p, d = (p) => (3 * r * p + 2 * o) * p + i;
279
- function m(p) {
280
- let h = p;
277
+ function ts(e, t, n, s) {
278
+ const i = 3 * e, o = 3 * (n - e) - i, r = 1 - i - o, a = 3 * t, c = 3 * (s - t) - a, u = 1 - a - c, f = (p) => ((r * p + o) * p + i) * p, l = (p) => ((u * p + c) * p + a) * p, d = (p) => (3 * r * p + 2 * o) * p + i;
279
+ function h(p) {
280
+ let m = p;
281
281
  for (let y = 0; y < 8; y++) {
282
- const $ = c(h) - p;
283
- if (Math.abs($) < 1e-7) return h;
284
- const E = d(h);
282
+ const b = f(m) - p;
283
+ if (Math.abs(b) < 1e-7) return m;
284
+ const E = d(m);
285
285
  if (Math.abs(E) < 1e-6) break;
286
- h -= $ / E;
286
+ m -= b / E;
287
287
  }
288
288
  let g = 0, v = 1;
289
- for (h = (g + v) / 2; v - g > 1e-7; ) {
290
- const y = c(h);
291
- if (Math.abs(y - p) < 1e-7) return h;
292
- p > y ? g = h : v = h, h = (g + v) / 2;
289
+ for (m = (g + v) / 2; v - g > 1e-7; ) {
290
+ const y = f(m);
291
+ if (Math.abs(y - p) < 1e-7) return m;
292
+ p > y ? g = m : v = m, m = (g + v) / 2;
293
293
  }
294
- return h;
294
+ return m;
295
295
  }
296
- return (p) => p <= 0 ? 0 : p >= 1 ? 1 : f(m(p));
296
+ return (p) => p <= 0 ? 0 : p >= 1 ? 1 : l(h(p));
297
297
  }
298
- function It(e) {
298
+ function kt(e) {
299
299
  const t = e.match(
300
300
  /^cubic-bezier\(\s*(-?[\d.]+)\s*,\s*(-?[\d.]+)\s*,\s*(-?[\d.]+)\s*,\s*(-?[\d.]+)\s*\)$/
301
301
  );
@@ -304,17 +304,17 @@ function It(e) {
304
304
  if (![n, s, i, o].some(isNaN))
305
305
  return [n, s, i, o];
306
306
  }
307
- function Vn(e) {
308
- const t = It(e);
307
+ function ns(e) {
308
+ const t = kt(e);
309
309
  if (!(!t || t.some(isNaN)))
310
- return Wn(...t);
310
+ return ts(...t);
311
311
  }
312
- function Bn(e) {
313
- const t = It(e);
312
+ function ss(e) {
313
+ const t = kt(e);
314
314
  if (!(!t || t.some(isNaN)))
315
- return (n) => U(n, ...t);
315
+ return (n) => Q(n, ...t);
316
316
  }
317
- function Tt(e) {
317
+ function qt(e) {
318
318
  const t = e.match(/^linear\((.+)\)$/);
319
319
  if (!t) return;
320
320
  const n = t[1].split(",").map((o) => o.trim()).filter(Boolean);
@@ -323,14 +323,14 @@ function Tt(e) {
323
323
  for (const o of n) {
324
324
  const r = o.split(/\s+/), a = parseFloat(r[0]);
325
325
  if (isNaN(a)) return;
326
- const l = [];
326
+ const c = [];
327
327
  for (let u = 1; u < r.length; u++)
328
328
  if (r[u].endsWith("%")) {
329
- const c = parseFloat(r[u]) / 100;
330
- if (isNaN(c)) return;
331
- l.push(c);
329
+ const f = parseFloat(r[u]) / 100;
330
+ if (isNaN(f)) return;
331
+ c.push(f);
332
332
  }
333
- l.length === 0 ? s.push({ output: a, pos: null }) : l.length === 1 ? s.push({ output: a, pos: l[0] }) : (s.push({ output: a, pos: l[0] }), s.push({ output: a, pos: l[1] }));
333
+ 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] }));
334
334
  }
335
335
  if (s.length === 0) return;
336
336
  s[0].pos === null && (s[0].pos = 0), s[s.length - 1].pos === null && (s[s.length - 1].pos = 1);
@@ -340,9 +340,9 @@ function Tt(e) {
340
340
  const o = i - 1;
341
341
  let r = i;
342
342
  for (; r < s.length && s[r].pos === null; ) r++;
343
- const a = s[o].pos, l = s[r].pos, u = r - o;
344
- for (let c = o + 1; c < r; c++)
345
- s[c].pos = a + (l - a) * (c - o) / u;
343
+ const a = s[o].pos, c = s[r].pos, u = r - o;
344
+ for (let f = o + 1; f < r; f++)
345
+ s[f].pos = a + (c - a) * (f - o) / u;
346
346
  i = r + 1;
347
347
  } else
348
348
  i++;
@@ -350,8 +350,8 @@ function Tt(e) {
350
350
  s[o].pos < s[o - 1].pos && (s[o].pos = s[o - 1].pos);
351
351
  return s;
352
352
  }
353
- function Yn(e) {
354
- const t = Tt(e);
353
+ function is(e) {
354
+ const t = qt(e);
355
355
  if (t)
356
356
  return (n) => {
357
357
  if (n <= t[0].pos) return t[0].output;
@@ -359,15 +359,15 @@ function Yn(e) {
359
359
  if (n >= s.pos) return s.output;
360
360
  let i = 0, o = t.length - 1;
361
361
  for (; i < o - 1; ) {
362
- const l = i + o >>> 1;
363
- t[l].pos <= n ? i = l : o = l;
362
+ const c = i + o >>> 1;
363
+ t[c].pos <= n ? i = c : o = c;
364
364
  }
365
365
  const r = t[i], a = t[o];
366
366
  return a.pos === r.pos ? a.output : r.output + (a.output - r.output) * (n - r.pos) / (a.pos - r.pos);
367
367
  };
368
368
  }
369
- function Un(e) {
370
- const t = Tt(e);
369
+ function os(e) {
370
+ const t = qt(e);
371
371
  if (t)
372
372
  return (n) => {
373
373
  const s = [`${t[0].output}`];
@@ -383,17 +383,17 @@ function Un(e) {
383
383
  return `(${s.join(" + ")})`;
384
384
  };
385
385
  }
386
- function Xe(e) {
386
+ function Qe(e) {
387
387
  if (!e) return;
388
- const t = Je[e];
389
- return t || (Vn(e) ?? Yn(e) ?? Je.linear);
388
+ const t = at[e];
389
+ return t || (ns(e) ?? is(e) ?? at.linear);
390
390
  }
391
- function Kn(e) {
391
+ function rs(e) {
392
392
  if (!e) return;
393
- const t = et[e];
394
- return t || (Bn(e) ?? Un(e) ?? et.linear);
393
+ const t = ct[e];
394
+ return t || (ss(e) ?? os(e) ?? ct.linear);
395
395
  }
396
- class Xn extends ie {
396
+ class as extends ce {
397
397
  animationGroups;
398
398
  delay;
399
399
  offset;
@@ -402,7 +402,7 @@ class Xn extends ie {
402
402
  timingOptions;
403
403
  constructor(t, n = {}) {
404
404
  const s = t.flatMap((i) => [...i.animations]);
405
- 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) ?? $t, this.timingOptions = this.animationGroups.map((i) => i.getTimingOptions().map(({ delay: o, duration: r, iterations: a }) => ({
405
+ 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 : Qe(n.offsetEasing) ?? Pt, this.timingOptions = this.animationGroups.map((i) => i.getTimingOptions().map(({ delay: o, duration: r, iterations: a }) => ({
406
406
  delay: o,
407
407
  duration: Number.isFinite(r) ? r : 0,
408
408
  iterations: Number.isFinite(a) ? a : 1
@@ -428,14 +428,14 @@ class Xn extends ie {
428
428
  const t = this.calculateOffsets(), n = this.getSequenceActiveDuration(t), s = this.animationGroups.length - 1;
429
429
  this.animationGroups.forEach((i, o) => {
430
430
  i.animations.forEach((r, a) => {
431
- const l = r.effect;
432
- if (!l) return;
433
- const { delay: u, duration: c, iterations: f } = this.timingOptions[o][a], d = u + t[o], m = n - (d + c * f);
431
+ const c = r.effect;
432
+ if (!c) return;
433
+ const { delay: u, duration: f, iterations: l } = this.timingOptions[o][a], d = u + t[o], h = n - (d + f * l);
434
434
  if (i.isCSS && this.sequenceId) {
435
- const { target: p } = l;
436
- p instanceof HTMLElement && (p.style.setProperty(`--motion-${this.sequenceId}-index`, `${o}`), p.style.setProperty(`--motion-${this.sequenceId}-last`, `${s}`)), l.updateTiming({ endDelay: m });
435
+ const { target: p } = c;
436
+ p instanceof HTMLElement && (p.style.setProperty(`--motion-${this.sequenceId}-index`, `${o}`), p.style.setProperty(`--motion-${this.sequenceId}-last`, `${s}`)), c.updateTiming({ endDelay: h });
437
437
  } else
438
- l.updateTiming({ delay: d + this.delay, endDelay: m });
438
+ c.updateTiming({ delay: d + this.delay, endDelay: h });
439
439
  });
440
440
  });
441
441
  }
@@ -444,8 +444,8 @@ class Xn extends ie {
444
444
  for (let s = 0; s < this.timingOptions.length; s++) {
445
445
  const i = this.timingOptions[s].reduce((o, r) => {
446
446
  if (!r) return o;
447
- const { delay: a, duration: l, iterations: u } = r;
448
- return Math.max(o, a + l * u);
447
+ const { delay: a, duration: c, iterations: u } = r;
448
+ return Math.max(o, a + c * u);
449
449
  }, 0);
450
450
  n.push(t[s] + i);
451
451
  }
@@ -462,7 +462,7 @@ class Xn extends ie {
462
462
  for (const { index: s, group: i } of n) {
463
463
  const o = Math.min(s, this.animationGroups.length);
464
464
  this.animationGroups.splice(o, 0, i), this.timingOptions.splice(o, 0, i.getTimingOptions());
465
- const r = [...i.animations], a = this.animationGroups.slice(0, o).reduce((l, u) => l + u.animations.length, 0);
465
+ const r = [...i.animations], a = this.animationGroups.slice(0, o).reduce((c, u) => c + u.animations.length, 0);
466
466
  this.animations.splice(a, 0, ...r);
467
467
  }
468
468
  this.applyOffsets(), this.ready = Promise.all(this.animationGroups.map((s) => s.ready)).then(() => {
@@ -491,7 +491,7 @@ class Xn extends ie {
491
491
  }
492
492
  }
493
493
  }
494
- class Qn {
494
+ class cs {
495
495
  _animation;
496
496
  customEffect;
497
497
  progress;
@@ -503,7 +503,7 @@ class Qn {
503
503
  composite: "add"
504
504
  }), { timeline: r } = i;
505
505
  this._animation = new Animation(o, r), this._tickCbId = null, this.progress = null, this.customEffect = (a) => t(o.target, a), this._finishHandler = (a) => {
506
- this.effect.target?.getAnimations().find((l) => l === this._animation) || this.cancel();
506
+ this.effect.target?.getAnimations().find((c) => c === this._animation) || this.cancel();
507
507
  }, this.addEventListener("finish", this._finishHandler), this.addEventListener("remove", this._finishHandler);
508
508
  }
509
509
  // private tick method for customEffect loop implementation
@@ -631,20 +631,20 @@ class Qn {
631
631
  return this._animation.dispatchEvent(t);
632
632
  }
633
633
  }
634
- function Zn(e) {
634
+ function fs(e) {
635
635
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
636
636
  }
637
- var pe = { exports: {} }, nt = pe.exports, st;
638
- function Jn() {
639
- return st || (st = 1, (function(e) {
637
+ var Ee = { exports: {} }, ut = Ee.exports, lt;
638
+ function us() {
639
+ return lt || (lt = 1, (function(e) {
640
640
  (function(t) {
641
641
  var n = function() {
642
- }, s = t.requestAnimationFrame || t.webkitRequestAnimationFrame || t.mozRequestAnimationFrame || t.msRequestAnimationFrame || function(c) {
643
- return setTimeout(c, 16);
642
+ }, s = t.requestAnimationFrame || t.webkitRequestAnimationFrame || t.mozRequestAnimationFrame || t.msRequestAnimationFrame || function(f) {
643
+ return setTimeout(f, 16);
644
644
  };
645
645
  function i() {
646
- var c = this;
647
- c.reads = [], c.writes = [], c.raf = s.bind(t);
646
+ var f = this;
647
+ f.reads = [], f.writes = [], f.raf = s.bind(t);
648
648
  }
649
649
  i.prototype = {
650
650
  constructor: i,
@@ -656,8 +656,8 @@ function Jn() {
656
656
  *
657
657
  * @param {Array} tasks
658
658
  */
659
- runTasks: function(c) {
660
- for (var f; f = c.shift(); ) f();
659
+ runTasks: function(f) {
660
+ for (var l; l = f.shift(); ) l();
661
661
  },
662
662
  /**
663
663
  * Adds a job to the read batch and
@@ -667,8 +667,8 @@ function Jn() {
667
667
  * @param {Object} ctx the context to be bound to `fn` (optional).
668
668
  * @public
669
669
  */
670
- measure: function(c, f) {
671
- var d = f ? c.bind(f) : c;
670
+ measure: function(f, l) {
671
+ var d = l ? f.bind(l) : f;
672
672
  return this.reads.push(d), o(this), d;
673
673
  },
674
674
  /**
@@ -680,8 +680,8 @@ function Jn() {
680
680
  * @param {Object} ctx the context to be bound to `fn` (optional).
681
681
  * @public
682
682
  */
683
- mutate: function(c, f) {
684
- var d = f ? c.bind(f) : c;
683
+ mutate: function(f, l) {
684
+ var d = l ? f.bind(l) : f;
685
685
  return this.writes.push(d), o(this), d;
686
686
  },
687
687
  /**
@@ -691,8 +691,8 @@ function Jn() {
691
691
  * @return {Boolean} success
692
692
  * @public
693
693
  */
694
- clear: function(c) {
695
- return a(this.reads, c) || a(this.writes, c);
694
+ clear: function(f) {
695
+ return a(this.reads, f) || a(this.writes, f);
696
696
  },
697
697
  /**
698
698
  * Extend this FastDom with some
@@ -728,89 +728,89 @@ function Jn() {
728
728
  * @param {Object} props properties to mixin
729
729
  * @return {FastDom}
730
730
  */
731
- extend: function(c) {
732
- if (typeof c != "object") throw new Error("expected object");
733
- var f = Object.create(this);
734
- return l(f, c), f.fastdom = this, f.initialize && f.initialize(), f;
731
+ extend: function(f) {
732
+ if (typeof f != "object") throw new Error("expected object");
733
+ var l = Object.create(this);
734
+ return c(l, f), l.fastdom = this, l.initialize && l.initialize(), l;
735
735
  },
736
736
  // override this with a function
737
737
  // to prevent Errors in console
738
738
  // when tasks throw
739
739
  catch: null
740
740
  };
741
- function o(c) {
742
- c.scheduled || (c.scheduled = !0, c.raf(r.bind(null, c)));
741
+ function o(f) {
742
+ f.scheduled || (f.scheduled = !0, f.raf(r.bind(null, f)));
743
743
  }
744
- function r(c) {
745
- var f = c.writes, d = c.reads, m;
744
+ function r(f) {
745
+ var l = f.writes, d = f.reads, h;
746
746
  try {
747
- n("flushing reads", d.length), c.runTasks(d), n("flushing writes", f.length), c.runTasks(f);
747
+ n("flushing reads", d.length), f.runTasks(d), n("flushing writes", l.length), f.runTasks(l);
748
748
  } catch (p) {
749
- m = p;
749
+ h = p;
750
750
  }
751
- if (c.scheduled = !1, (d.length || f.length) && o(c), m)
752
- if (n("task errored", m.message), c.catch) c.catch(m);
753
- else throw m;
751
+ if (f.scheduled = !1, (d.length || l.length) && o(f), h)
752
+ if (n("task errored", h.message), f.catch) f.catch(h);
753
+ else throw h;
754
754
  }
755
- function a(c, f) {
756
- var d = c.indexOf(f);
757
- return !!~d && !!c.splice(d, 1);
755
+ function a(f, l) {
756
+ var d = f.indexOf(l);
757
+ return !!~d && !!f.splice(d, 1);
758
758
  }
759
- function l(c, f) {
760
- for (var d in f)
761
- f.hasOwnProperty(d) && (c[d] = f[d]);
759
+ function c(f, l) {
760
+ for (var d in l)
761
+ l.hasOwnProperty(d) && (f[d] = l[d]);
762
762
  }
763
763
  var u = t.fastdom = t.fastdom || new i();
764
764
  e.exports = u;
765
- })(typeof window < "u" ? window : typeof nt < "u" ? nt : globalThis);
766
- })(pe)), pe.exports;
765
+ })(typeof window < "u" ? window : typeof ut < "u" ? ut : globalThis);
766
+ })(Ee)), Ee.exports;
767
767
  }
768
- var es = Jn();
769
- const _ = /* @__PURE__ */ Zn(es), Fe = {};
770
- function ts(e) {
771
- Object.assign(Fe, e);
768
+ var ls = us();
769
+ const A = /* @__PURE__ */ fs(ls), De = {};
770
+ function ds(e) {
771
+ Object.assign(De, e);
772
772
  }
773
- function Qe(e, t = !0) {
774
- return e in Fe ? Fe[e] : (t && console.warn(
773
+ function Ze(e, t = !0) {
774
+ return e in De ? De[e] : (t && console.warn(
775
775
  `${e} not found in registry. Please make sure to import and register the preset.`
776
776
  ), null);
777
777
  }
778
778
  function Y(e, t) {
779
779
  return e ? (t || document).getElementById(e) : null;
780
780
  }
781
- function Ot(e, t) {
781
+ function Rt(e, t) {
782
782
  return e?.matches(`[data-motion-part~="${t}"]`) ? e : e?.querySelector(`[data-motion-part~="${t}"]`);
783
783
  }
784
- function Ct(e, t) {
784
+ function Lt(e, t) {
785
785
  const n = typeof e == "string" ? Y(e) : e;
786
- return t?.length ? t.map((s) => Ot(n, s)).filter(Boolean) : n ? [n] : [];
786
+ return t?.length ? t.map((s) => Rt(n, s)).filter(Boolean) : n ? [n] : [];
787
787
  }
788
- function ns(e) {
788
+ function hs(e) {
789
789
  const t = e.alternate ? "alternate" : "";
790
790
  return e.reversed ? `${t ? `${t}-` : ""}reverse` : t || "normal";
791
791
  }
792
- function Ae(e) {
793
- return `${e.value}${Dn(e.unit)}`;
792
+ function Le(e) {
793
+ return `${e.value}${Xn(e.unit)}`;
794
794
  }
795
- function it(e, t, n) {
796
- return `${e.name || "cover"} ${n && e.offset.unit !== "percentage" ? `calc(100% + ${Ae(e.offset)}${t ? ` + ${t}` : ""})` : t ? `calc(${Ae(e.offset)} + ${t})` : Ae(e.offset)}`;
795
+ function dt(e, t, n) {
796
+ return `${e.name || "cover"} ${n && e.offset.unit !== "percentage" ? `calc(100% + ${Le(e.offset)}${t ? ` + ${t}` : ""})` : t ? `calc(${Le(e.offset)} + ${t})` : Le(e.offset)}`;
797
797
  }
798
- function Mt(e) {
798
+ function Ft(e) {
799
799
  return {
800
- start: it(e.startOffset, e.startOffsetAdd),
801
- end: it(e.endOffset, e.endOffsetAdd, !0)
800
+ start: dt(e.startOffset, e.startOffsetAdd),
801
+ end: dt(e.endOffset, e.endOffsetAdd, !0)
802
802
  };
803
803
  }
804
- function _t(e) {
805
- return (t) => _.measure(() => t(e));
804
+ function xt(e) {
805
+ return (t) => A.measure(() => t(e));
806
806
  }
807
- function Pt(e) {
808
- return (t) => _.mutate(() => t(e));
807
+ function Nt(e) {
808
+ return (t) => A.mutate(() => t(e));
809
809
  }
810
- function te(e) {
810
+ function se(e) {
811
811
  if (e.namedEffect) {
812
812
  const t = e.namedEffect.type;
813
- return typeof t == "string" ? Qe(t) : null;
813
+ return typeof t == "string" ? Ze(t) : null;
814
814
  } else if (e.keyframeEffect) {
815
815
  const t = (s) => {
816
816
  const { name: i, keyframes: o } = s.keyframeEffect;
@@ -824,16 +824,16 @@ function te(e) {
824
824
  return (t) => [{ ...t, keyframes: [] }];
825
825
  return null;
826
826
  }
827
- function kt(e, t, n, s) {
827
+ function Dt(e, t, n, s) {
828
828
  return e.map((i, o) => {
829
829
  const r = {
830
830
  fill: i.fill,
831
- easing: me(i.easing),
831
+ easing: ye(i.easing),
832
832
  iterations: i.iterations === 0 ? 1 / 0 : i.iterations || 1,
833
833
  composite: i.composite,
834
- direction: ns(i)
834
+ direction: hs(i)
835
835
  };
836
- return Ze(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), {
836
+ return Je(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), {
837
837
  // pass the preset's object as is - its keyframes and ranges may be getters
838
838
  // that must only be read after its measure() callbacks ran
839
839
  effect: i,
@@ -843,22 +843,22 @@ function kt(e, t, n, s) {
843
843
  };
844
844
  });
845
845
  }
846
- function Ze(e) {
846
+ function Je(e) {
847
847
  return !e || e.trigger !== "pointer-move" && e.trigger !== "view-progress";
848
848
  }
849
- function ot(e, t, n, s, i) {
849
+ function ht(e, t, n, s, i) {
850
850
  if (e) {
851
- if (Ze(s) && (t.duration = t.duration || 1, i?.reducedMotion))
851
+ if (Je(s) && (t.duration = t.duration || 1, i?.reducedMotion))
852
852
  if (t.iterations === 1 || t.iterations == null)
853
853
  t = { ...t, duration: 1 };
854
854
  else
855
855
  return [];
856
856
  let o;
857
- return n instanceof HTMLElement && (o = { measure: _t(n), mutate: Pt(n) }), e.web ? e.web(t, o, i) : e(t, o, i);
857
+ return n instanceof HTMLElement && (o = { measure: xt(n), mutate: Nt(n) }), e.web ? e.web(t, o, i) : e(t, o, i);
858
858
  }
859
859
  return [];
860
860
  }
861
- function At(e, t, n, s, i) {
861
+ function jt(e, t, n, s, i) {
862
862
  const o = typeof e == "string" ? Y(e, i) : e;
863
863
  if (n?.trigger === "pointer-move" && !t.keyframeEffect) {
864
864
  let d = t;
@@ -866,10 +866,10 @@ function At(e, t, n, s, i) {
866
866
  ...t,
867
867
  namedEffect: { id: "", type: "CustomMouse" }
868
868
  });
869
- const m = te(
869
+ const h = se(
870
870
  d
871
- ), p = ot(
872
- m,
871
+ ), p = ht(
872
+ h,
873
873
  t,
874
874
  o,
875
875
  n,
@@ -877,7 +877,7 @@ function At(e, t, n, s, i) {
877
877
  );
878
878
  return typeof p != "function" ? null : p(o);
879
879
  }
880
- const r = te(t), a = ot(
880
+ const r = se(t), a = ht(
881
881
  r,
882
882
  t,
883
883
  o,
@@ -886,169 +886,169 @@ function At(e, t, n, s, i) {
886
886
  );
887
887
  if (!a || a.length === 0)
888
888
  return null;
889
- const l = kt(a, n, t.effectId);
889
+ const c = Dt(a, n, t.effectId);
890
890
  let u;
891
- const c = n?.trigger === "view-progress";
892
- c && window.ViewTimeline && (u = new ViewTimeline({
891
+ const f = n?.trigger === "view-progress";
892
+ f && window.ViewTimeline && (u = new ViewTimeline({
893
893
  subject: n.element || Y(n.componentId)
894
894
  }));
895
- const f = l.map(({ effect: d, options: m, id: p, part: h }) => {
896
- const g = h ? Ot(o, h) : o, v = new KeyframeEffect(g || null, [], m);
897
- _.mutate(() => {
898
- "timing" in d && v.updateTiming(d.timing), v.setKeyframes(bt(d.keyframes));
895
+ const l = c.map(({ effect: d, options: h, id: p, part: m }) => {
896
+ const g = m ? Rt(o, m) : o, v = new KeyframeEffect(g || null, [], h);
897
+ A.mutate(() => {
898
+ "timing" in d && v.updateTiming(d.timing), v.setKeyframes(At(d.keyframes));
899
899
  });
900
- const y = c && u ? { timeline: u } : {}, $ = typeof d.customEffect == "function" ? new Qn(
900
+ const y = f && u ? { timeline: u } : {}, b = typeof d.customEffect == "function" ? new cs(
901
901
  d.customEffect,
902
902
  g || null,
903
- m,
903
+ h,
904
904
  y
905
905
  ) : new Animation(v, y.timeline);
906
- if (c)
906
+ if (f)
907
907
  if (u)
908
- _.mutate(() => {
908
+ A.mutate(() => {
909
909
  if (g) {
910
- const { start: E, end: b } = Mt(d);
911
- $.rangeStart = E, $.rangeEnd = b;
910
+ const { start: E, end: S } = Ft(d);
911
+ b.rangeStart = E, b.rangeEnd = S;
912
912
  }
913
- $.play();
913
+ b.play();
914
914
  });
915
915
  else {
916
- const { startOffset: E, endOffset: b } = t;
917
- _.mutate(() => {
918
- const S = d.startOffset || E, T = d.endOffset || b;
919
- Object.assign($, {
916
+ const { startOffset: E, endOffset: S } = t;
917
+ A.mutate(() => {
918
+ const $ = d.startOffset || E, _ = d.endOffset || S;
919
+ Object.assign(b, {
920
920
  start: {
921
- name: S.name,
922
- offset: S.offset?.value,
921
+ name: $.name,
922
+ offset: $.offset?.value,
923
923
  add: d.startOffsetAdd
924
924
  },
925
925
  end: {
926
- name: T.name,
927
- offset: T.offset?.value,
926
+ name: _.name,
927
+ offset: _.offset?.value,
928
928
  add: d.endOffsetAdd
929
929
  }
930
930
  });
931
931
  });
932
932
  }
933
- return p && ($.id = p), $;
933
+ return p && (b.id = p), b;
934
934
  });
935
- return f.length > 1 && f.forEach((d) => d.persist?.()), new ie(f, {
935
+ return l.length > 1 && l.forEach((d) => d.persist?.()), new ce(l, {
936
936
  ...t,
937
937
  trigger: { ...n || {} },
938
938
  // make sure the group is ready after all animation targets are measured and mutated
939
- measured: new Promise((d) => _.mutate(d))
939
+ measured: new Promise((d) => A.mutate(d))
940
940
  });
941
941
  }
942
- function ss(e, t, n) {
943
- const { duration: s, delay: i, iterations: o = 1, fill: r, easing: a = "linear", direction: l } = e.options, u = e.effect.name, c = s === "auto", { sequenceId: f, delay: d, offset: m, offsetEasing: p = "linear" } = n || {};
944
- let h = `${i ?? 0}ms`;
945
- if (f && typeof p == "string") {
946
- const g = Kn(p);
942
+ function ms(e, t, n) {
943
+ const { duration: s, delay: i, iterations: o = 1, fill: r, easing: a = "linear", direction: c } = e.options, u = e.effect.name, f = s === "auto", { sequenceId: l, delay: d, offset: h, offsetEasing: p = "linear" } = n || {};
944
+ let m = `${i ?? 0}ms`;
945
+ if (l && typeof p == "string") {
946
+ const g = rs(p);
947
947
  if (g) {
948
948
  const v = (i ?? 0) + (d ?? 0);
949
- if (m) {
949
+ if (h) {
950
950
  const y = g(
951
- `(var(--motion-${f}-index, 0) / var(--motion-${f}-last, 1))`
951
+ `(var(--motion-${l}-index, 0) / var(--motion-${l}-last, 1))`
952
952
  );
953
- h = `calc(${`(${v} + ${y} * ${m} * var(--motion-${f}-last, 1))`} * 1ms)`;
953
+ m = `calc(${`(${v} + ${y} * ${h} * var(--motion-${l}-last, 1))`} * 1ms)`;
954
954
  } else
955
- h = `${v}ms`;
955
+ m = `${v}ms`;
956
956
  }
957
957
  }
958
- return `${u} ${c ? "auto" : `${s}ms`}${c ? " " : ` ${h} `}${a}${r && r !== "none" ? ` ${r}` : ""} ${!o || o === 1 / 0 ? "infinite" : o}${l === "normal" ? "" : ` ${l}`} ${t ? "" : "paused"}`;
958
+ return `${u} ${f ? "auto" : `${s}ms`}${f ? " " : ` ${m} `}${a}${r && r !== "none" ? ` ${r}` : ""} ${!o || o === 1 / 0 ? "infinite" : o}${c === "normal" ? "" : ` ${c}`} ${t ? "" : "paused"}`;
959
959
  }
960
- function is(e, t, n) {
961
- return e?.style ? (Ze(n) && (t.duration = t.duration || 1), e.style(t)) : [];
960
+ function ps(e, t, n) {
961
+ return e?.style ? (Je(n) && (t.duration = t.duration || 1), e.style(t)) : [];
962
962
  }
963
- function os(e, t, n, s) {
964
- const i = te(t), o = is(i, t), r = kt(o, n, t.effectId, !0), a = n?.trigger === "view-progress";
965
- return r.map((l, u) => {
966
- const { start: c, end: f } = a ? Mt(l.effect) : {};
963
+ function gs(e, t, n, s) {
964
+ const i = se(t), o = ps(i, t), r = Dt(o, n, t.effectId, !0), a = n?.trigger === "view-progress";
965
+ return r.map((c, u) => {
966
+ const { start: f, end: l } = a ? Ft(c.effect) : {};
967
967
  return {
968
- part: l.part,
969
- animation: ss(l, a, s),
970
- composition: l.options.composite,
971
- custom: l.effect.custom,
972
- name: l.effect.name,
973
- keyframes: bt(l.effect.keyframes),
974
- id: l.id && `${l.id}-${u + 1}`,
968
+ part: c.part,
969
+ animation: ms(c, a, s),
970
+ composition: c.options.composite,
971
+ custom: c.effect.custom,
972
+ name: c.effect.name,
973
+ keyframes: At(c.effect.keyframes),
974
+ id: c.id && `${c.id}-${u + 1}`,
975
975
  animationTimeline: a ? `--${n?.id}` : "",
976
- animationRange: c || f ? `${c} ${f}` : ""
976
+ animationRange: f || l ? `${f} ${l}` : ""
977
977
  };
978
978
  });
979
979
  }
980
- function rs(e, t, n) {
981
- const s = te(t), i = e instanceof HTMLElement ? e : Y(e);
980
+ function vs(e, t, n) {
981
+ const s = se(t), i = e instanceof HTMLElement ? e : Y(e);
982
982
  if (s && s.prepare && i) {
983
- const o = { measure: _t(i), mutate: Pt(i) };
983
+ const o = { measure: xt(i), mutate: Nt(i) };
984
984
  s.prepare(t, o);
985
985
  }
986
- n && _.mutate(n);
986
+ n && A.mutate(n);
987
987
  }
988
- function qt(e, t) {
989
- const n = te(t);
988
+ function zt(e, t) {
989
+ const n = se(t);
990
990
  if (!n)
991
991
  return null;
992
992
  if (!n.style)
993
- return t.effectId && e ? as(e, t.effectId, n.parts) : null;
994
- const s = n.getNames(t), o = Ct(e, n.parts)?.flatMap((l) => l.getAnimations()), r = o?.map((l) => l.animationName) || [], a = [];
995
- return s.forEach((l) => {
996
- r.includes(l) && a.push(
997
- o?.find((u) => u.animationName === l)
993
+ return t.effectId && e ? ys(e, t.effectId, n.parts) : null;
994
+ const s = n.getNames(t), o = Lt(e, n.parts)?.flatMap((c) => c.getAnimations()), r = o?.map((c) => c.animationName) || [], a = [];
995
+ return s.forEach((c) => {
996
+ r.includes(c) && a.push(
997
+ o?.find((u) => u.animationName === c)
998
998
  );
999
- }), a?.length ? new ie(a) : null;
999
+ }), a?.length ? new ce(a) : null;
1000
1000
  }
1001
- function as(e, t, n) {
1002
- const i = Ct(e, n)?.flatMap((o) => o.getAnimations()).filter((o) => {
1001
+ function ys(e, t, n) {
1002
+ const i = Lt(e, n)?.flatMap((o) => o.getAnimations()).filter((o) => {
1003
1003
  const r = o.id || o.animationName;
1004
1004
  return r ? r.startsWith(t) : !0;
1005
1005
  });
1006
- return i?.length ? new ie(i) : null;
1006
+ return i?.length ? new ce(i) : null;
1007
1007
  }
1008
- function Rt(e, t, n, s = {}) {
1009
- const { disabled: i, allowActiveEvent: o, ...r } = s, a = At(e, t, n, r);
1008
+ function Ht(e, t, n, s = {}) {
1009
+ const { disabled: i, allowActiveEvent: o, ...r } = s, a = jt(e, t, n, r);
1010
1010
  if (!a)
1011
1011
  return null;
1012
- let l = {};
1012
+ let c = {};
1013
1013
  if (n.trigger === "view-progress" && !window.ViewTimeline) {
1014
- const u = n.element || Y(n.componentId), { ready: c } = a;
1015
- return a.animations.map((f) => ({
1014
+ const u = n.element || Y(n.componentId), { ready: f } = a;
1015
+ return a.animations.map((l) => ({
1016
1016
  /* we use getters for start and end in order to access the animation's start and end
1017
1017
  only when initializing the scrub scene rather than immediately */
1018
1018
  get start() {
1019
- return f.start;
1019
+ return l.start;
1020
1020
  },
1021
1021
  get end() {
1022
- return f.end;
1022
+ return l.end;
1023
1023
  },
1024
1024
  viewSource: u,
1025
- ready: c,
1025
+ ready: f,
1026
1026
  getProgress() {
1027
1027
  return a.getProgress();
1028
1028
  },
1029
- effect(d, m) {
1030
- const { activeDuration: p } = f.effect.getComputedTiming(), { delay: h } = f.effect.getTiming();
1031
- f.currentTime = ((h || 0) + (p || 0)) * m;
1029
+ effect(d, h) {
1030
+ const { activeDuration: p } = l.effect.getComputedTiming(), { delay: m } = l.effect.getTiming();
1031
+ l.currentTime = ((m || 0) + (p || 0)) * h;
1032
1032
  },
1033
1033
  disabled: i,
1034
1034
  destroy() {
1035
- f.cancel();
1035
+ l.cancel();
1036
1036
  }
1037
1037
  }));
1038
1038
  } else if (n.trigger === "pointer-move") {
1039
- const u = t, { centeredToTarget: c, transitionDuration: f, transitionEasing: d } = u, m = n.axis;
1039
+ const u = t, { centeredToTarget: f, transitionDuration: l, transitionEasing: d } = u, h = n.axis;
1040
1040
  if (u.keyframeEffect) {
1041
1041
  const p = a;
1042
1042
  return p.animations?.length === 0 ? null : {
1043
1043
  target: (typeof e == "string" ? Y(e) : e) ?? void 0,
1044
- centeredToTarget: c,
1044
+ centeredToTarget: f,
1045
1045
  ready: p.ready,
1046
1046
  _currentProgress: 0,
1047
1047
  getProgress() {
1048
1048
  return this._currentProgress;
1049
1049
  },
1050
1050
  effect(g, v) {
1051
- const y = m === "x" ? v.x : v.y;
1051
+ const y = h === "x" ? v.x : v.y;
1052
1052
  this._currentProgress = y, p.progress(y);
1053
1053
  },
1054
1054
  disabled: i ?? !1,
@@ -1057,24 +1057,24 @@ function Rt(e, t, n, s = {}) {
1057
1057
  }
1058
1058
  };
1059
1059
  }
1060
- l = {
1061
- centeredToTarget: c,
1060
+ c = {
1061
+ centeredToTarget: f,
1062
1062
  allowActiveEvent: o
1063
- }, t.customEffect && f && (l.transitionDuration = f, l.transitionEasing = Xe(d)), l.target = a.target;
1063
+ }, t.customEffect && l && (c.transitionDuration = l, c.transitionEasing = Qe(d)), c.target = a.target;
1064
1064
  }
1065
1065
  return {
1066
- ...l,
1066
+ ...c,
1067
1067
  getProgress() {
1068
1068
  return a.getProgress();
1069
1069
  },
1070
- effect(u, c, f, d) {
1070
+ effect(u, f, l, d) {
1071
1071
  a.progress(
1072
- f ? {
1072
+ l ? {
1073
1073
  // @ts-expect-error spread error on p
1074
- ...c,
1075
- v: f,
1074
+ ...f,
1075
+ v: l,
1076
1076
  active: d
1077
- } : c
1077
+ } : f
1078
1078
  );
1079
1079
  },
1080
1080
  disabled: i,
@@ -1083,48 +1083,48 @@ function Rt(e, t, n, s = {}) {
1083
1083
  }
1084
1084
  };
1085
1085
  }
1086
- function oe(e, t, n, s = !1) {
1087
- const i = qt(e, t);
1086
+ function fe(e, t, n, s = !1) {
1087
+ const i = zt(e, t);
1088
1088
  return i ? (i.ready = new Promise((o) => {
1089
- rs(e, t, o);
1090
- }), i) : At(e, t, n, { reducedMotion: s });
1089
+ vs(e, t, o);
1090
+ }), i) : jt(e, t, n, { reducedMotion: s });
1091
1091
  }
1092
- function cs(e) {
1092
+ function Es(e) {
1093
1093
  return e === null ? [null] : typeof e == "string" ? Array.from(document.querySelectorAll(e)) : Array.isArray(e) ? e : [e];
1094
1094
  }
1095
- function Lt(e, t) {
1095
+ function Gt(e, t) {
1096
1096
  const n = [];
1097
1097
  for (const { target: s, options: i } of e) {
1098
- const o = cs(s);
1098
+ const o = Es(s);
1099
1099
  for (const r of o) {
1100
- const a = oe(
1100
+ const a = fe(
1101
1101
  r,
1102
1102
  i,
1103
1103
  void 0,
1104
1104
  t?.reducedMotion
1105
1105
  );
1106
- a instanceof ie && n.push(a);
1106
+ a instanceof ce && n.push(a);
1107
1107
  }
1108
1108
  }
1109
1109
  return n;
1110
1110
  }
1111
- function ls(e, t, n) {
1112
- const s = Lt(t, n);
1113
- return new Xn(s, e);
1111
+ function ws(e, t, n) {
1112
+ const s = Gt(t, n);
1113
+ return new as(s, e);
1114
1114
  }
1115
- function us(e, t = 2) {
1115
+ function bs(e, t = 2) {
1116
1116
  return parseFloat(e.toFixed(t));
1117
1117
  }
1118
- function fs(e) {
1118
+ function $s(e) {
1119
1119
  return /\[]/g.test(e);
1120
1120
  }
1121
- function ds(e) {
1121
+ function Ss(e) {
1122
1122
  return e.replace(/[A-Z]/g, (t) => `-${t.toLowerCase()}`);
1123
1123
  }
1124
- function ge(e, t) {
1124
+ function we(e, t) {
1125
1125
  return t.includes("&") ? t.replace(/&/g, e) : `${e}${t}`;
1126
1126
  }
1127
- function ne() {
1127
+ function ie() {
1128
1128
  return "wi-12343210".replace(
1129
1129
  /\d/g,
1130
1130
  (e) => String.fromCharCode(
@@ -1133,37 +1133,37 @@ function ne() {
1133
1133
  // 97 for "a"
1134
1134
  );
1135
1135
  }
1136
- function Ft(e) {
1136
+ function Wt(e) {
1137
1137
  return !!(e.transition || e.transitionProperties);
1138
1138
  }
1139
- function xt(e) {
1139
+ function Vt(e) {
1140
1140
  const { transition: t, transitionProperties: n } = e;
1141
1141
  return (t?.styleProperties || n || []).map((i) => ({
1142
1142
  ...i,
1143
- name: ye(i.name)
1143
+ name: $e(i.name)
1144
1144
  }));
1145
1145
  }
1146
- function Nt(e) {
1146
+ function Bt(e) {
1147
1147
  let { transition: t, transitionProperties: n } = e, s = [];
1148
1148
  if (t?.styleProperties) {
1149
1149
  const { duration: i, easing: o, delay: r } = t;
1150
1150
  (i || r) && (t.styleProperties.some(
1151
- (l) => l.name.startsWith("--")
1151
+ (c) => c.name.startsWith("--")
1152
1152
  ) ? s = [
1153
- `all ${i || 0}ms ${me(o || "ease")}${r ? ` ${r}ms` : ""}`,
1153
+ `all ${i || 0}ms ${ye(o || "ease")}${r ? ` ${r}ms` : ""}`,
1154
1154
  "visibility 0s"
1155
1155
  ] : s = t.styleProperties.map(
1156
- (l) => `${ye(l.name)} ${i || 0}ms ${me(
1156
+ (c) => `${$e(c.name)} ${i || 0}ms ${ye(
1157
1157
  o || "ease"
1158
1158
  )}${r ? ` ${r}ms` : ""}`
1159
1159
  ));
1160
1160
  } else
1161
1161
  s = n?.filter((i) => i.duration || i.delay).map(
1162
- (i) => `${ye(i.name)} ${i.duration || 0}ms ${me(i.easing) || "ease"}${i.delay ? ` ${i.delay}ms` : ""}`
1162
+ (i) => `${$e(i.name)} ${i.duration || 0}ms ${ye(i.easing) || "ease"}${i.delay ? ` ${i.delay}ms` : ""}`
1163
1163
  ) || [];
1164
1164
  return s;
1165
1165
  }
1166
- function hs({
1166
+ function Is({
1167
1167
  key: e,
1168
1168
  effectId: t,
1169
1169
  transition: n,
@@ -1171,44 +1171,44 @@ function hs({
1171
1171
  childSelector: i = "> :first-child",
1172
1172
  selectorCondition: o
1173
1173
  }) {
1174
- const r = Nt({
1174
+ const r = Bt({
1175
1175
  transition: n,
1176
1176
  transitionProperties: s
1177
- }), a = xt({ transition: n, transitionProperties: s }).map(
1177
+ }), a = Vt({ transition: n, transitionProperties: s }).map(
1178
1178
  (p) => `${p.name}: ${p.value};`
1179
- ), l = e.replace(/"/g, "'"), u = `:is(:state(${t}), :--${t}) ${i}`, c = `[data-interact-effect~="${t}"] ${i}`, f = o ? ge(u, o) : u, d = o ? ge(c, o) : c, m = [
1180
- `${f},
1179
+ ), c = e.replace(/"/g, "'"), u = `:is(:state(${t}), :--${t}) ${i}`, f = `[data-interact-effect~="${t}"] ${i}`, l = o ? we(u, o) : u, d = o ? we(f, o) : f, h = [
1180
+ `${l},
1181
1181
  ${d} {
1182
1182
  ${a.join(`
1183
1183
  `)}
1184
1184
  }`
1185
1185
  ];
1186
1186
  if (r.length) {
1187
- const p = `[data-interact-key="${l}"] ${i}`, h = o ? ge(p, o) : p;
1188
- m.push(`${h} {
1187
+ const p = `[data-interact-key="${c}"] ${i}`, m = o ? we(p, o) : p;
1188
+ h.push(`${m} {
1189
1189
  transition: ${r.join(", ")};
1190
1190
  }`);
1191
1191
  }
1192
- return m;
1192
+ return h;
1193
1193
  }
1194
- function re(e, t, n) {
1194
+ function ue(e, t, n) {
1195
1195
  const s = (e || []).filter((i) => t[i]?.type === n && t[i].predicate).map((i) => t[i].predicate).join(") and (");
1196
1196
  return s && `(${s})`;
1197
1197
  }
1198
- function F(e, t) {
1199
- const n = re(e, t, "media");
1198
+ function H(e, t) {
1199
+ const n = ue(e, t, "media");
1200
1200
  return n && window.matchMedia(n);
1201
1201
  }
1202
- function x(e, t) {
1202
+ function U(e, t) {
1203
1203
  return (e || []).filter((n) => t[n]?.type === "selector" && t[n].predicate).map((n) => `:is(${t[n].predicate})`).join("");
1204
1204
  }
1205
- const Ie = "__rm-reduce", Dt = "__rm-no-preference", ms = {
1206
- [Ie]: { type: "media", predicate: "prefers-reduced-motion: reduce" },
1207
- [Dt]: {
1205
+ const Oe = "__rm-reduce", Yt = "__rm-no-preference", _s = {
1206
+ [Oe]: { type: "media", predicate: "prefers-reduced-motion: reduce" },
1207
+ [Yt]: {
1208
1208
  type: "media",
1209
1209
  predicate: "prefers-reduced-motion: no-preference"
1210
1210
  }
1211
- }, ps = /* @__PURE__ */ new Set([
1211
+ }, Ts = /* @__PURE__ */ new Set([
1212
1212
  "namedEffect",
1213
1213
  "keyframeEffect",
1214
1214
  "customEffect",
@@ -1228,17 +1228,17 @@ const Ie = "__rm-reduce", Dt = "__rm-no-preference", ms = {
1228
1228
  "transitionDuration",
1229
1229
  "transitionEasing"
1230
1230
  ]);
1231
- function jt(e = {}) {
1232
- return { ...e, ...ms };
1231
+ function Ut(e = {}) {
1232
+ return { ...e, ..._s };
1233
1233
  }
1234
- function Te(...e) {
1234
+ function Pe(...e) {
1235
1235
  return e.find(Boolean) ?? "collapse";
1236
1236
  }
1237
- function xe(e) {
1238
- return Ft(e) ? "state" : "duration" in e ? "time" : "scrub";
1237
+ function je(e) {
1238
+ return Wt(e) ? "state" : "duration" in e ? "time" : "scrub";
1239
1239
  }
1240
- function rt(e) {
1241
- const t = xe(e);
1240
+ function mt(e) {
1241
+ const t = je(e);
1242
1242
  if (t === "state") {
1243
1243
  const { transition: s, transitionProperties: i } = e;
1244
1244
  return {
@@ -1255,8 +1255,8 @@ function rt(e) {
1255
1255
  const { iterations: n = 1 } = e;
1256
1256
  return t === "scrub" || !n || n === 1 / 0 ? null : { ...e, duration: 0 };
1257
1257
  }
1258
- function gs(e, t, n) {
1259
- const s = ([o]) => ps.has(o), { keyframeEffect: i } = n;
1258
+ function Ms(e, t, n) {
1259
+ const s = ([o]) => Ts.has(o), { keyframeEffect: i } = n;
1260
1260
  return {
1261
1261
  ...Object.fromEntries(Object.entries(e).filter((o) => !s(o))),
1262
1262
  ...Object.fromEntries(Object.entries(n).filter(s)),
@@ -1266,39 +1266,39 @@ function gs(e, t, n) {
1266
1266
  }
1267
1267
  };
1268
1268
  }
1269
- function vs(e, t, n) {
1269
+ function Os(e, t, n) {
1270
1270
  switch (t) {
1271
1271
  case "ignore":
1272
1272
  return e;
1273
1273
  case "cancel":
1274
1274
  return null;
1275
1275
  case "collapse":
1276
- return rt(e);
1276
+ return mt(e);
1277
1277
  default: {
1278
1278
  const s = n[t];
1279
- return s && xe(s) === xe(e) ? gs(e, t, s) : rt(e);
1279
+ return s && je(s) === je(e) ? Ms(e, t, s) : mt(e);
1280
1280
  }
1281
1281
  }
1282
1282
  }
1283
- function at(e, t) {
1283
+ function pt(e, t) {
1284
1284
  return {
1285
1285
  ...e,
1286
1286
  conditions: [...e.conditions || [], t]
1287
1287
  };
1288
1288
  }
1289
- function ys(e) {
1290
- return !!e.conditions?.includes(Ie);
1289
+ function Ps(e) {
1290
+ return !!e.conditions?.includes(Oe);
1291
1291
  }
1292
- function zt(e, t, { effects: n, force: s, collapsesStagger: i }) {
1293
- const o = vs(e, t, n);
1292
+ function Kt(e, t, { effects: n, force: s, collapsesStagger: i }) {
1293
+ const o = Os(e, t, n);
1294
1294
  if (s)
1295
1295
  return o ? [o] : [];
1296
1296
  if (o === e && !i)
1297
1297
  return [e];
1298
- const r = at(e, Dt);
1299
- return o ? [r, at(o, Ie)] : [r];
1298
+ const r = pt(e, Yt);
1299
+ return o ? [r, pt(o, Oe)] : [r];
1300
1300
  }
1301
- const Ht = /* @__PURE__ */ new Map([
1301
+ const Xt = /* @__PURE__ */ new Map([
1302
1302
  ["viewEnter", "once"],
1303
1303
  ["animationEnd", "once"],
1304
1304
  ["hover", "alternate"],
@@ -1306,108 +1306,108 @@ const Ht = /* @__PURE__ */ new Map([
1306
1306
  ["activate", "alternate"],
1307
1307
  ["interest", "alternate"]
1308
1308
  ]);
1309
- function Es({ namedEffect: e, keyframeEffect: t, customEffect: n }, s) {
1309
+ function Cs({ namedEffect: e, keyframeEffect: t, customEffect: n }, s) {
1310
1310
  return e ? !s && !!e.type : !!t || !(n && s);
1311
1311
  }
1312
- function ct(e, t) {
1312
+ function gt(e, t) {
1313
1313
  const { namedEffect: n, customEffect: s, keyframeEffect: i, transition: o, transitionProperties: r, ...a } = e;
1314
1314
  return n ? t || !n.type ? a : { namedEffect: n, ...a } : i ? { keyframeEffect: i, ...a } : s ? a : o ? { transition: o, ...a } : r ? { transitionProperties: r, ...a } : a;
1315
1315
  }
1316
- function Gt(e, t, n, s, i = {}) {
1317
- const { effects: o = {}, conditions: r = {} } = n, { key: a, trigger: l, conditions: u = [] } = t, c = l === "pointerMove";
1318
- e.effectId || (e.effectId = s || ne());
1319
- const { effectId: f } = e, d = { ...o[f] || {}, ...e };
1320
- let { key: m, conditions: p, triggerType: h } = d;
1321
- if (!m) {
1316
+ function Qt(e, t, n, s, i = {}) {
1317
+ const { effects: o = {}, conditions: r = {} } = n, { key: a, trigger: c, conditions: u = [] } = t, f = c === "pointerMove";
1318
+ e.effectId || (e.effectId = s || ie());
1319
+ const { effectId: l } = e, d = { ...o[l] || {}, ...e };
1320
+ let { key: h, conditions: p, triggerType: m } = d;
1321
+ if (!h) {
1322
1322
  if (!a)
1323
1323
  return null;
1324
- m = a;
1324
+ h = a;
1325
1325
  }
1326
- if (fs(m))
1326
+ if ($s(h))
1327
1327
  return null;
1328
1328
  const g = u.filter(
1329
- (S) => r[S].type === "media"
1329
+ ($) => r[$].type === "media"
1330
1330
  );
1331
1331
  p = [
1332
1332
  ...new Set(
1333
1333
  [...p || [], ...g].filter(
1334
- (S) => r[S]
1334
+ ($) => r[$]
1335
1335
  )
1336
1336
  )
1337
- ], h || (h = Ht.get(l));
1337
+ ], m || (m = Xt.get(c));
1338
1338
  const { namedEffect: v, keyframeEffect: y } = d;
1339
1339
  if (!v && y && !y.name) {
1340
- const S = f && !(o[f] && "keyframeEffect" in e);
1341
- y.name = S ? f : ne();
1340
+ const $ = l && !(o[l] && "keyframeEffect" in e);
1341
+ y.name = $ ? l : ie();
1342
1342
  }
1343
- if (!Es(d, c))
1343
+ if (!Cs(d, f))
1344
1344
  return null;
1345
- const $ = { ...d, key: m, conditions: p, effectId: f, triggerType: h }, E = { ...$, initial: mn(t, $) }, b = zt(
1345
+ const b = { ...d, key: h, conditions: p, effectId: l, triggerType: m }, E = { ...b, initial: _n(t, b) }, S = Kt(
1346
1346
  E,
1347
- Te(
1347
+ Pe(
1348
1348
  d.reducedMotionPolicy,
1349
1349
  i.policy,
1350
1350
  t.reducedMotionPolicy,
1351
1351
  i.defaultPolicy
1352
1352
  ),
1353
1353
  { effects: o, force: i.force, collapsesStagger: i.collapsesStagger }
1354
- ).map((S) => ct(S, c));
1355
- return b.length ? { ...ct(E, c), variants: b } : null;
1356
- }
1357
- function ws(e, t, n, s, i, o = {}) {
1358
- const { sequences: r = {}, conditions: a = {} } = n, { trigger: l, conditions: u = [] } = t;
1359
- e.sequenceId || (e.sequenceId = s || ne());
1360
- const { sequenceId: c } = e, f = { ...r[c] || {}, ...e }, d = Te(
1361
- f.reducedMotionPolicy,
1354
+ ).map(($) => gt($, f));
1355
+ return S.length ? { ...gt(E, f), variants: S } : null;
1356
+ }
1357
+ function As(e, t, n, s, i, o = {}) {
1358
+ const { sequences: r = {}, conditions: a = {} } = n, { trigger: c, conditions: u = [] } = t;
1359
+ e.sequenceId || (e.sequenceId = s || ie());
1360
+ const { sequenceId: f } = e, l = { ...r[f] || {}, ...e }, d = Pe(
1361
+ l.reducedMotionPolicy,
1362
1362
  t.reducedMotionPolicy,
1363
1363
  o.defaultPolicy
1364
1364
  );
1365
1365
  let {
1366
- effects: m,
1366
+ effects: h,
1367
1367
  conditions: p,
1368
- triggerType: h,
1368
+ triggerType: m,
1369
1369
  delay: g = 0,
1370
1370
  offset: v = 0,
1371
1371
  offsetEasing: y = "linear"
1372
- } = f;
1373
- if (typeof y == "function" || !m)
1372
+ } = l;
1373
+ if (typeof y == "function" || !h)
1374
1374
  return null;
1375
- h || (h = Ht.get(l));
1376
- const $ = u.filter(
1377
- (S) => a[S].type === "media"
1375
+ m || (m = Xt.get(c));
1376
+ const b = u.filter(
1377
+ ($) => a[$].type === "media"
1378
1378
  );
1379
1379
  p = [
1380
1380
  ...new Set(
1381
- [...p || [], ...$].filter(
1382
- (S) => a[S]
1381
+ [...p || [], ...b].filter(
1382
+ ($) => a[$]
1383
1383
  )
1384
1384
  )
1385
1385
  ];
1386
- const b = m.map((S, T) => {
1387
- const I = Gt(
1388
- { ...S, triggerType: h, conditions: [...S.conditions || [], ...p] },
1386
+ const S = h.map(($, _) => {
1387
+ const I = Qt(
1388
+ { ...$, triggerType: m, conditions: [...$.conditions || [], ...p] },
1389
1389
  t,
1390
1390
  n,
1391
- `${c}-eff-${T}`,
1391
+ `${f}-eff-${_}`,
1392
1392
  { ...o, policy: d, collapsesStagger: d !== "ignore" }
1393
1393
  );
1394
- return I && Object.assign(I, { slotKey: i?.(T) });
1395
- }).filter((S) => S !== null);
1396
- return b.length ? {
1397
- sequenceId: c,
1398
- triggerType: h,
1394
+ return I && Object.assign(I, { slotKey: i?.(_) });
1395
+ }).filter(($) => $ !== null);
1396
+ return S.length ? {
1397
+ sequenceId: f,
1398
+ triggerType: m,
1399
1399
  conditions: p,
1400
1400
  delay: g,
1401
1401
  offset: v,
1402
1402
  offsetEasing: y,
1403
1403
  reducedMotionPolicy: d,
1404
- effects: b
1404
+ effects: S
1405
1405
  } : null;
1406
1406
  }
1407
- function $s(e) {
1408
- return e === "cssFloat" ? "float" : e === "easing" ? "animation-timing-function" : e === "cssOffset" ? "offset" : e === "composite" ? "animation-composition" : ye(e);
1407
+ function ks(e) {
1408
+ return e === "cssFloat" ? "float" : e === "easing" ? "animation-timing-function" : e === "cssOffset" ? "offset" : e === "composite" ? "animation-composition" : $e(e);
1409
1409
  }
1410
- function Ss(e) {
1410
+ function qs(e) {
1411
1411
  if (!e.length)
1412
1412
  return [];
1413
1413
  const t = e.map((i) => ({ ...i }));
@@ -1422,65 +1422,65 @@ function Ss(e) {
1422
1422
  return console.error("Offsets must be in the range [0,1]"), [];
1423
1423
  const r = i - n;
1424
1424
  for (let a = n + 1; a < i; a++) {
1425
- const l = (a - n) / r;
1426
- t[a].offset = s + (o - s) * l;
1425
+ const c = (a - n) / r;
1426
+ t[a].offset = s + (o - s) * c;
1427
1427
  }
1428
1428
  n = i, s = o;
1429
1429
  }
1430
1430
  return t;
1431
1431
  }
1432
- function bs(e, t) {
1433
- const n = Object.entries(e).filter(([s, i]) => s !== "offset" && i !== void 0 && i !== null).map(([s, i]) => `${$s(s)}: ${i};`).join(`
1432
+ function Rs(e, t) {
1433
+ const n = Object.entries(e).filter(([s, i]) => s !== "offset" && i !== void 0 && i !== null).map(([s, i]) => `${ks(s)}: ${i};`).join(`
1434
1434
  `);
1435
1435
  return `${t}% {
1436
1436
  ${n}
1437
1437
  }`;
1438
1438
  }
1439
- function Is(e, t) {
1440
- const n = Ss(t);
1439
+ function Ls(e, t) {
1440
+ const n = qs(t);
1441
1441
  if (!n.length)
1442
1442
  return "";
1443
1443
  let s = n.map((i) => {
1444
- const o = i.offset, r = us(o * 100);
1445
- return bs(i, r);
1444
+ const o = i.offset, r = bs(o * 100);
1445
+ return Rs(i, r);
1446
1446
  }).join(`
1447
1447
  `);
1448
1448
  return `@keyframes ${e} {
1449
1449
  ${s}
1450
1450
  }`;
1451
1451
  }
1452
- function Ts(e) {
1452
+ function Fs(e) {
1453
1453
  const { key: t, childSelector: n, declarations: s, media: i, states: o, selectorCondition: r, selectorSuffix: a } = e;
1454
1454
  if (!s.length)
1455
1455
  return "";
1456
- let l = `[data-interact-key="${t}"]`;
1456
+ let c = `[data-interact-key="${t}"]`;
1457
1457
  if (o && o.length) {
1458
- const f = o.map((d) => `:state(${d}), :--${d}, [data-interact-effect~="${d}"]`).join(", ");
1459
- l = `${l}:is(${f})`;
1458
+ const l = o.map((d) => `:state(${d}), :--${d}, [data-interact-effect~="${d}"]`).join(", ");
1459
+ c = `${c}:is(${l})`;
1460
1460
  }
1461
- n && (l = `${l} ${n}`), a && (l = `${l}${a}`), r && (l = ge(l, r));
1462
- const u = s.map(({ name: f, value: d, important: m }) => `${f}: ${d}${m ? " !important" : ""};`).join(`
1463
- `), c = `${l} {
1461
+ n && (c = `${c} ${n}`), a && (c = `${c}${a}`), r && (c = we(c, r));
1462
+ const u = s.map(({ name: l, value: d, important: h }) => `${l}: ${d}${h ? " !important" : ""};`).join(`
1463
+ `), f = `${c} {
1464
1464
  ${u}
1465
1465
  }`;
1466
1466
  return i ? `@media ${i} {
1467
- ${c}
1468
- }` : c;
1467
+ ${f}
1468
+ }` : f;
1469
1469
  }
1470
- const Ne = [
1470
+ const ze = [
1471
1471
  "animation",
1472
1472
  "animation-composition",
1473
1473
  "animation-timeline",
1474
1474
  "animation-range"
1475
- ], Oe = [
1476
- ...Ne,
1475
+ ], Ce = [
1476
+ ...ze,
1477
1477
  "transition",
1478
1478
  "view-timeline"
1479
- ], Ce = ["animation", "transition", "timeline"];
1480
- function L(e) {
1479
+ ], Ae = ["animation", "transition", "timeline"];
1480
+ function F(e) {
1481
1481
  return e === "transition" ? "transition" : e === "view-timeline" ? "timeline" : "animation";
1482
1482
  }
1483
- const K = {
1483
+ const Z = {
1484
1484
  transition: "_",
1485
1485
  animation: "none",
1486
1486
  "animation-composition": "replace",
@@ -1488,23 +1488,23 @@ const K = {
1488
1488
  "animation-range": "normal",
1489
1489
  "view-timeline": "none"
1490
1490
  };
1491
- function Wt(e) {
1491
+ function Zt(e) {
1492
1492
  return e.replace(new RegExp("(?<!(^|-))([aeiou]|tion)", "g"), "");
1493
1493
  }
1494
- function j(e, t, n = !1, s) {
1494
+ function z(e, t, n = !1, s) {
1495
1495
  const i = s === void 0 ? "" : `-c${s}`;
1496
- return `--${Wt(e)}${i}${n ? "-slot" : ""}-${t}`;
1496
+ return `--${Zt(e)}${i}${n ? "-slot" : ""}-${t}`;
1497
1497
  }
1498
- function se(e, t) {
1499
- return `--${Wt(e)}-c${t}`;
1498
+ function oe(e, t) {
1499
+ return `--${Zt(e)}-c${t}`;
1500
1500
  }
1501
- function Os(e, t) {
1501
+ function xs(e, t) {
1502
1502
  return Array.from(
1503
1503
  { length: t + 1 },
1504
- (n, s) => `var(${se(e, s)})`
1504
+ (n, s) => `var(${oe(e, s)})`
1505
1505
  ).join(", ");
1506
1506
  }
1507
- function Cs(e, t, n, s, i = 0, o) {
1507
+ function Ns(e, t, n, s, i = 0, o) {
1508
1508
  const r = {
1509
1509
  animation: e,
1510
1510
  transition: t,
@@ -1513,70 +1513,70 @@ function Cs(e, t, n, s, i = 0, o) {
1513
1513
  animation: n,
1514
1514
  transition: s,
1515
1515
  timeline: 0
1516
- }, l = (u, c) => `@property ${c} { syntax: "*"; inherits: false; initial-value: ${K[u]}; }`;
1517
- return Oe.flatMap((u) => [
1516
+ }, c = (u, f) => `@property ${f} { syntax: "*"; inherits: false; initial-value: ${Z[u]}; }`;
1517
+ return Ce.flatMap((u) => [
1518
1518
  ...Array.from(
1519
- { length: r[L(u)] },
1520
- (c, f) => l(u, j(u, f, !1, o))
1519
+ { length: r[F(u)] },
1520
+ (f, l) => c(u, z(u, l, !1, o))
1521
1521
  ),
1522
1522
  ...Array.from(
1523
- { length: a[L(u)] },
1524
- (c, f) => l(u, j(u, f, !0, o))
1523
+ { length: a[F(u)] },
1524
+ (f, l) => c(u, z(u, l, !0, o))
1525
1525
  ),
1526
1526
  // registers the lists of the configs before it too, for elements they don't target
1527
1527
  ...Array.from(
1528
- { length: o !== void 0 && r[L(u)] ? o + 1 : 0 },
1529
- (c, f) => l(u, se(u, f))
1528
+ { length: o !== void 0 && r[F(u)] ? o + 1 : 0 },
1529
+ (f, l) => c(u, oe(u, l))
1530
1530
  )
1531
1531
  ]);
1532
1532
  }
1533
- function Ms(e, t, n, s) {
1534
- const i = Oe.filter(
1535
- (a) => e[L(a)].slotsInSequence > 0
1533
+ function Ds(e, t, n, s) {
1534
+ const i = Ce.filter(
1535
+ (a) => e[F(a)].slotsInSequence > 0
1536
1536
  );
1537
1537
  if (i.length === 0)
1538
1538
  return null;
1539
1539
  const o = i.map((a) => {
1540
- const { listIndex: l, slotCursor: u, slotsInSequence: c } = e[L(a)];
1540
+ const { listIndex: c, slotCursor: u, slotsInSequence: f } = e[F(a)];
1541
1541
  return {
1542
- name: j(a, l, !1, s),
1542
+ name: z(a, c, !1, s),
1543
1543
  value: Array.from(
1544
- { length: c },
1545
- (f, d) => `var(${j(a, u + d, !0, s)})`
1544
+ { length: f },
1545
+ (l, d) => `var(${z(a, u + d, !0, s)})`
1546
1546
  ).join(", ")
1547
1547
  };
1548
1548
  }), r = { key: e.key, childSelector: e.childSelector, declarations: o };
1549
- return t && (r.media = re(t, n || {}, "media"), r.selectorCondition = x(t, n || {})), r;
1549
+ return t && (r.media = ue(t, n || {}, "media"), r.selectorCondition = U(t, n || {})), r;
1550
1550
  }
1551
- function _s(e, t, n, s = 0, i) {
1551
+ function js(e, t, n, s = 0, i) {
1552
1552
  if (e.length === 0)
1553
1553
  return "";
1554
1554
  const o = {
1555
1555
  animation: t,
1556
1556
  transition: n,
1557
1557
  timeline: s
1558
- }, r = Oe.filter((u) => o[L(u)] > 0);
1558
+ }, r = Ce.filter((u) => o[F(u)] > 0);
1559
1559
  if (r.length === 0)
1560
1560
  return "";
1561
1561
  const a = r.flatMap((u) => {
1562
- const c = Array.from(
1563
- { length: o[L(u)] },
1562
+ const f = Array.from(
1563
+ { length: o[F(u)] },
1564
1564
  // TODO: maybe add `-intrct` to names? --anm-0 or --trns-0 could collide with user-defined names
1565
- (f, d) => `var(${j(u, d, !1, i)})`
1565
+ (l, d) => `var(${z(u, d, !1, i)})`
1566
1566
  ).join(", ");
1567
- return i === void 0 ? [{ name: u, value: c }] : [
1568
- { name: se(u, i), value: c },
1569
- { name: u, value: Os(u, i) }
1567
+ return i === void 0 ? [{ name: u, value: f }] : [
1568
+ { name: oe(u, i), value: f },
1569
+ { name: u, value: xs(u, i) }
1570
1570
  ];
1571
1571
  });
1572
1572
  return `${e.map(
1573
- ({ key: u, childSelector: c }) => `[data-interact-key="${u}"]${c ? ` ${c}` : ""}`
1573
+ ({ key: u, childSelector: f }) => `[data-interact-key="${u}"]${f ? ` ${f}` : ""}`
1574
1574
  ).join(", ")} {
1575
- ${a.map(({ name: u, value: c }) => ` ${u}: ${c};`).join(`
1575
+ ${a.map(({ name: u, value: f }) => ` ${u}: ${f};`).join(`
1576
1576
  `)}
1577
1577
  }`;
1578
1578
  }
1579
- function Ps(e, t) {
1579
+ function zs(e, t) {
1580
1580
  if (e.length === 0)
1581
1581
  return "";
1582
1582
  if (t === void 0)
@@ -1585,34 +1585,34 @@ function Ps(e, t) {
1585
1585
  }`;
1586
1586
  const n = Array.from(
1587
1587
  { length: t + 1 },
1588
- (s, i) => `var(${se("timeline-scope", i)}, --_)`
1588
+ (s, i) => `var(${oe("timeline-scope", i)}, --_)`
1589
1589
  ).join(", ");
1590
1590
  return `:root {
1591
- ${se("timeline-scope", t)}: ${e.join(", ")};
1591
+ ${oe("timeline-scope", t)}: ${e.join(", ")};
1592
1592
  timeline-scope: ${n};
1593
1593
  }`;
1594
1594
  }
1595
- const le = {
1595
+ const he = {
1596
1596
  rangeStart: { name: "cover", offset: { value: 0, unit: "percentage" } },
1597
1597
  rangeEnd: { name: "cover", offset: { value: 100, unit: "percentage" } }
1598
1598
  };
1599
- function ks(e, t) {
1600
- const n = e?.name ?? le.rangeStart.name, s = t?.name ?? e?.name ?? le.rangeEnd.name, i = {
1599
+ function Hs(e, t) {
1600
+ const n = e?.name ?? he.rangeStart.name, s = t?.name ?? e?.name ?? he.rangeEnd.name, i = {
1601
1601
  name: n,
1602
- offset: e?.offset || le.rangeStart.offset
1602
+ offset: e?.offset || he.rangeStart.offset
1603
1603
  }, o = {
1604
1604
  name: s,
1605
- offset: t?.offset || le.rangeEnd.offset
1605
+ offset: t?.offset || he.rangeEnd.offset
1606
1606
  };
1607
1607
  return { startOffset: i, endOffset: o };
1608
1608
  }
1609
- function N(e) {
1609
+ function x(e) {
1610
1610
  if ("keyframeEffect" in e && !e.keyframeEffect.name && "effectId" in e && (e.keyframeEffect.name = e.effectId), "duration" in e)
1611
1611
  return {
1612
1612
  id: "",
1613
1613
  ...e
1614
1614
  };
1615
- const { rangeStart: t, rangeEnd: n, ...s } = e, { startOffset: i, endOffset: o } = ks(t, n);
1615
+ const { rangeStart: t, rangeEnd: n, ...s } = e, { startOffset: i, endOffset: o } = Hs(t, n);
1616
1616
  return {
1617
1617
  id: "",
1618
1618
  startOffset: i,
@@ -1620,11 +1620,11 @@ function N(e) {
1620
1620
  ...s
1621
1621
  };
1622
1622
  }
1623
- function q(e, t, n) {
1623
+ function k(e, t, n) {
1624
1624
  let s = e.get(t);
1625
1625
  s || (s = /* @__PURE__ */ new Set(), e.set(t, s)), s.add(n);
1626
1626
  }
1627
- function ae(e, t) {
1627
+ function le(e, t) {
1628
1628
  e.get(t)?.forEach((s) => {
1629
1629
  const { source: i, target: o, cleanup: r } = s;
1630
1630
  r();
@@ -1632,15 +1632,15 @@ function ae(e, t) {
1632
1632
  e.get(a)?.delete(s);
1633
1633
  }), e.delete(t);
1634
1634
  }
1635
- const lt = [
1635
+ const vt = [
1636
1636
  { name: "visibility", value: "hidden" },
1637
1637
  { name: "clip-path", value: "none", important: !0 },
1638
1638
  { name: "transform", value: "none", important: !0 },
1639
1639
  { name: "translate", value: "none", important: !0 },
1640
1640
  { name: "scale", value: "none", important: !0 },
1641
1641
  { name: "rotate", value: "none", important: !0 }
1642
- ], De = { animation: !1, transition: !1, timeline: !1 };
1643
- function Vt(e, t) {
1642
+ ], He = { animation: !1, transition: !1, timeline: !1 };
1643
+ function Jt(e, t) {
1644
1644
  const n = () => ({
1645
1645
  listIndex: 0,
1646
1646
  slotCursor: 0,
@@ -1659,33 +1659,33 @@ function Vt(e, t) {
1659
1659
  keyframeEntries: /* @__PURE__ */ new Map()
1660
1660
  };
1661
1661
  }
1662
- function Bt(e, t, n) {
1662
+ function en(e, t, n) {
1663
1663
  return Object.fromEntries(
1664
- Oe.map((s) => {
1665
- const i = L(s), { listIndex: o, slotCursor: r, slotsInSequence: a } = e[i];
1664
+ Ce.map((s) => {
1665
+ const i = F(s), { listIndex: o, slotCursor: r, slotsInSequence: a } = e[i];
1666
1666
  return [
1667
1667
  s,
1668
- t[i] ? j(s, r + a, !0, n) : j(s, o, !1, n)
1668
+ t[i] ? z(s, r + a, !0, n) : z(s, o, !1, n)
1669
1669
  ];
1670
1670
  })
1671
1671
  );
1672
1672
  }
1673
- function je(e, t, n) {
1674
- Ce.forEach((s) => {
1673
+ function Ge(e, t, n) {
1674
+ Ae.forEach((s) => {
1675
1675
  t[s] && (e[s].touched = !0, n[s] && (e[s].slotsInSequence += 1));
1676
1676
  });
1677
1677
  }
1678
- function As(e) {
1678
+ function Gs(e) {
1679
1679
  const { namedEffect: t, keyframeEffect: n, transition: s, transitionProperties: i } = e;
1680
1680
  return t || n ? "animation" : s || i ? "transition" : null;
1681
1681
  }
1682
- function Yt(e) {
1683
- return (e.variants || [e]).map(As).find(Boolean) || null;
1682
+ function tn(e) {
1683
+ return (e.variants || [e]).map(Gs).find(Boolean) || null;
1684
1684
  }
1685
- function qs(e) {
1685
+ function Ws(e) {
1686
1686
  const t = /* @__PURE__ */ new Map();
1687
1687
  return e.effects.forEach((n) => {
1688
- const s = Yt(n);
1688
+ const s = tn(n);
1689
1689
  if (!s)
1690
1690
  return;
1691
1691
  const i = B(n), o = t.get(i) || { animation: 0, transition: 0, timeline: 0 };
@@ -1697,162 +1697,162 @@ function qs(e) {
1697
1697
  ])
1698
1698
  );
1699
1699
  }
1700
- function Rs(e) {
1701
- Ce.forEach((t) => {
1700
+ function Vs(e) {
1701
+ Ae.forEach((t) => {
1702
1702
  const n = e[t];
1703
1703
  n.slotsInInteraction = Math.max(n.slotsInInteraction, n.slotsInSequence), n.slotsInSequence = 0;
1704
1704
  });
1705
1705
  }
1706
- function Ls(e) {
1707
- Ce.forEach((t) => {
1706
+ function Bs(e) {
1707
+ Ae.forEach((t) => {
1708
1708
  const n = e[t];
1709
1709
  n.listIndex += n.touched ? 1 : 0, n.slotCursor += n.slotsInInteraction, n.slotsInInteraction = 0, n.touched = !1;
1710
1710
  });
1711
1711
  }
1712
- const Fs = {
1712
+ const Ys = {
1713
1713
  animation: "animation",
1714
1714
  "animation-composition": "composition",
1715
1715
  "animation-timeline": "animationTimeline",
1716
1716
  "animation-range": "animationRange"
1717
1717
  };
1718
- function xs(e, t, n, s) {
1719
- const { key: i, conditions: o } = t, r = re(o, e.configConditions, "media"), a = x(o, e.configConditions), l = V(t, {
1718
+ function Us(e, t, n, s) {
1719
+ const { key: i, conditions: o } = t, r = ue(o, e.configConditions, "media"), a = U(o, e.configConditions), c = j(t, {
1720
1720
  asCombinator: !0,
1721
1721
  useFirstChild: e.useFirstChild,
1722
1722
  addItemFilter: !0
1723
- }), u = B(t), c = e.targetsMap.get(u) || Vt(i, l), f = Bt(c, De, e.configIndex)["view-timeline"];
1724
- return je(c, { animation: !1, transition: !1, timeline: !0 }, De), e.targetsMap.set(u, c), s.add(u), {
1723
+ }), u = B(t), f = e.targetsMap.get(u) || Jt(i, c), l = en(f, He, e.configIndex)["view-timeline"];
1724
+ return Ge(f, { animation: !1, transition: !1, timeline: !0 }, He), e.targetsMap.set(u, f), s.add(u), {
1725
1725
  key: i,
1726
1726
  media: r,
1727
1727
  selectorCondition: a,
1728
- childSelector: l,
1728
+ childSelector: c,
1729
1729
  declarations: [
1730
1730
  {
1731
- name: f,
1731
+ name: l,
1732
1732
  value: `--${n}`
1733
1733
  }
1734
1734
  ]
1735
1735
  };
1736
1736
  }
1737
- function Ut(e, t, n, s, i) {
1737
+ function nn(e, t, n, s, i) {
1738
1738
  const o = [];
1739
1739
  for (const r of Object.keys(i)) {
1740
- const a = `${Ke}${r}`;
1740
+ const a = `${Xe}${r}`;
1741
1741
  a in t && o.push(
1742
1742
  ...i[r](t[a], {
1743
1743
  key: n,
1744
1744
  scope: e,
1745
1745
  config: t
1746
- }).map((l) => ({ ...l, key: n, media: s }))
1746
+ }).map((c) => ({ ...c, key: n, media: s }))
1747
1747
  );
1748
1748
  }
1749
1749
  return o;
1750
1750
  }
1751
- function Ns(e, t, n, s, i, o) {
1752
- const { assigned: r, childSelector: a, partSelectors: l } = n, u = { animation: !1, transition: !1, timeline: !1 }, {
1753
- key: c,
1754
- effectId: f,
1751
+ function Ks(e, t, n, s, i, o) {
1752
+ const { assigned: r, childSelector: a, partSelectors: c } = n, u = { animation: !1, transition: !1, timeline: !1 }, {
1753
+ key: f,
1754
+ effectId: l,
1755
1755
  conditions: d,
1756
- namedEffect: m,
1756
+ namedEffect: h,
1757
1757
  keyframeEffect: p,
1758
- transition: h,
1758
+ transition: m,
1759
1759
  transitionProperties: g,
1760
1760
  initial: v
1761
- } = t, y = re(d, e.configConditions, "media"), $ = x(d, e.configConditions), E = [
1761
+ } = t, y = ue(d, e.configConditions, "media"), b = U(d, e.configConditions), E = [
1762
1762
  {
1763
- key: c,
1763
+ key: f,
1764
1764
  media: y,
1765
- selectorCondition: $,
1765
+ selectorCondition: b,
1766
1766
  childSelector: a,
1767
1767
  declarations: []
1768
1768
  }
1769
1769
  ];
1770
- let b = [];
1771
- const { declarations: S } = E[0];
1772
- e.plugins && E.push(...Ut("effect", t, c, y, e.plugins));
1773
- const T = v && t.duration === 0;
1774
- if ((m || p) && !T) {
1775
- const I = N(t), P = os(null, I, s, o).filter(
1776
- (O) => O.name
1777
- ), k = P.length ? {} : { "": [] };
1778
- P.forEach((O) => {
1779
- const C = O.part || "";
1780
- (k[C] ||= []).push(O);
1781
- }), b = P.map((O) => ({
1782
- name: O.name,
1783
- keyframes: O.keyframes
1784
- })), S.push(
1785
- ...P.flatMap(
1786
- ({ custom: O }) => Object.entries(O || {}).filter(([C, M]) => M !== void 0).map(([C, M]) => ({ name: C, value: M }))
1770
+ let S = [];
1771
+ const { declarations: $ } = E[0];
1772
+ e.plugins && E.push(...nn("effect", t, f, y, e.plugins));
1773
+ const _ = v && t.duration === 0;
1774
+ if ((h || p) && !_) {
1775
+ const I = x(t), O = gs(null, I, s, o).filter(
1776
+ (T) => T.name
1777
+ ), C = O.length ? {} : { "": [] };
1778
+ O.forEach((T) => {
1779
+ const M = T.part || "";
1780
+ (C[M] ||= []).push(T);
1781
+ }), S = O.map((T) => ({
1782
+ name: T.name,
1783
+ keyframes: T.keyframes
1784
+ })), $.push(
1785
+ ...O.flatMap(
1786
+ ({ custom: T }) => Object.entries(T || {}).filter(([M, P]) => P !== void 0).map(([M, P]) => ({ name: M, value: P }))
1787
1787
  )
1788
- ), Object.entries(k).forEach(([O, C]) => {
1789
- const M = Ne.map((R) => ({
1790
- _listPropertyName: R,
1791
- name: i[R],
1792
- value: C.map((Pe) => {
1793
- const ke = Fs[R];
1794
- return Pe[ke] || K[R];
1788
+ ), Object.entries(C).forEach(([T, M]) => {
1789
+ const P = ze.map((L) => ({
1790
+ _listPropertyName: L,
1791
+ name: i[L],
1792
+ value: M.map((qe) => {
1793
+ const Re = Ys[L];
1794
+ return qe[Re] || Z[L];
1795
1795
  }).join(", ")
1796
1796
  })).filter(
1797
- ({ _listPropertyName: R, name: Pe, value: ke }) => ke !== K[R] || r.has(Pe)
1797
+ ({ _listPropertyName: L, name: qe, value: Re }) => Re !== Z[L] || r.has(qe)
1798
1798
  );
1799
- M.forEach(({ name: R }) => r.add(R)), u.animation = u.animation || M.length > 0;
1800
- const ce = O ? `[data-motion-part~="${O}"]` : a;
1801
- O && M.length && l.add(ce), v ? (E.push({
1802
- key: c,
1799
+ P.forEach(({ name: L }) => r.add(L)), u.animation = u.animation || P.length > 0;
1800
+ const de = T ? `[data-motion-part~="${T}"]` : a;
1801
+ T && P.length && c.add(de), v ? (E.push({
1802
+ key: f,
1803
1803
  media: y,
1804
- selectorCondition: $,
1805
- childSelector: ce,
1806
- declarations: lt,
1804
+ selectorCondition: b,
1805
+ childSelector: de,
1806
+ declarations: vt,
1807
1807
  selectorSuffix: ":not([data-interact-enter])"
1808
1808
  }), E.push({
1809
- key: c,
1809
+ key: f,
1810
1810
  media: y,
1811
- selectorCondition: $,
1812
- childSelector: ce,
1813
- declarations: M,
1811
+ selectorCondition: b,
1812
+ childSelector: de,
1813
+ declarations: P,
1814
1814
  selectorSuffix: ':not([data-interact-enter="done"])'
1815
- })) : O ? E.push({
1816
- key: c,
1815
+ })) : T ? E.push({
1816
+ key: f,
1817
1817
  media: y,
1818
- selectorCondition: $,
1819
- childSelector: ce,
1820
- declarations: M
1821
- }) : S.push(...M);
1818
+ selectorCondition: b,
1819
+ childSelector: de,
1820
+ declarations: P
1821
+ }) : $.push(...P);
1822
1822
  });
1823
- } else if (h || g) {
1824
- const I = xt(t), P = Nt(t);
1825
- (P.length || r.has(i.transition)) && (S.push({
1823
+ } else if (m || g) {
1824
+ const I = Vt(t), O = Bt(t);
1825
+ (O.length || r.has(i.transition)) && ($.push({
1826
1826
  name: i.transition,
1827
- value: P.join(", ") || K.transition
1827
+ value: O.join(", ") || Z.transition
1828
1828
  }), r.add(i.transition), u.transition = !0), E.push({
1829
- key: c,
1829
+ key: f,
1830
1830
  media: y,
1831
- selectorCondition: $,
1831
+ selectorCondition: b,
1832
1832
  childSelector: a,
1833
- states: [f],
1833
+ states: [l],
1834
1834
  declarations: I
1835
1835
  });
1836
1836
  } else
1837
- T && E.push({
1838
- key: c,
1837
+ _ && E.push({
1838
+ key: f,
1839
1839
  media: y,
1840
- selectorCondition: $,
1840
+ selectorCondition: b,
1841
1841
  childSelector: a,
1842
- declarations: lt,
1842
+ declarations: vt,
1843
1843
  selectorSuffix: ":not([data-interact-enter])"
1844
- }), S.push(
1845
- ...Ne.filter(
1844
+ }), $.push(
1845
+ ...ze.filter(
1846
1846
  (I) => r.has(i[I])
1847
1847
  ).map((I) => ({
1848
1848
  name: i[I],
1849
- value: K[I]
1849
+ value: Z[I]
1850
1850
  }))
1851
1851
  );
1852
- return { rules: E.filter((I) => I.declarations.length), keyframes: b, wrote: u };
1852
+ return { rules: E.filter((I) => I.declarations.length), keyframes: S, wrote: u };
1853
1853
  }
1854
- function Ds(e, t, n, s) {
1855
- const i = t.namedEffect && Qe(t.namedEffect.type, !1);
1854
+ function Xs(e, t, n, s) {
1855
+ const i = t.namedEffect && Ze(t.namedEffect.type, !1);
1856
1856
  if (!i?.getNames)
1857
1857
  return;
1858
1858
  const o = (a) => i.getNames({ ...t, suffix: a });
@@ -1861,107 +1861,107 @@ function Ds(e, t, n, s) {
1861
1861
  const r = e.keyframeEntries.get(n) || [];
1862
1862
  e.keyframeEntries.set(n, [...r, { slotKey: s, getNames: o }]);
1863
1863
  }
1864
- function js(e, t, n) {
1865
- const s = e.forceReducedMotion || ys(t);
1864
+ function Qs(e, t, n) {
1865
+ const s = e.forceReducedMotion || Ps(t);
1866
1866
  return n && s && n.reducedMotionPolicy !== "ignore" ? { ...n, offset: 0 } : n;
1867
1867
  }
1868
- function Kt(e, t, n, s, i, o) {
1869
- const r = B(t), a = e.targetsMap.get(r) || Vt(
1868
+ function sn(e, t, n, s, i, o) {
1869
+ const r = B(t), a = e.targetsMap.get(r) || Jt(
1870
1870
  t.key,
1871
- V(t, {
1871
+ j(t, {
1872
1872
  asCombinator: !0,
1873
1873
  useFirstChild: e.useFirstChild,
1874
1874
  addItemFilter: !0
1875
1875
  })
1876
1876
  );
1877
1877
  s.add(r);
1878
- const l = o?.get(r) || De, u = Bt(a, l, e.configIndex), c = t.variants || [t], f = Yt(t);
1878
+ const c = o?.get(r) || He, u = en(a, c, e.configIndex), f = t.variants || [t], l = tn(t);
1879
1879
  if (e.collectSlots)
1880
- return c.forEach(
1881
- (h) => Ds(a, h, u.animation, t.slotKey)
1882
- ), je(
1880
+ return f.forEach(
1881
+ (m) => Xs(a, m, u.animation, t.slotKey)
1882
+ ), Ge(
1883
1883
  a,
1884
- { animation: f === "animation", transition: f === "transition", timeline: !1 },
1885
- l
1884
+ { animation: l === "animation", transition: l === "transition", timeline: !1 },
1885
+ c
1886
1886
  ), e.targetsMap.set(r, a), [];
1887
- const d = a.assigned, m = c.map((h) => (h.namedEffect && (h.suffix = e.keyframeSlots.get(t.slotKey)), a.assigned = new Set(d), {
1888
- ...Ns(
1887
+ const d = a.assigned, h = f.map((m) => (m.namedEffect && (m.suffix = e.keyframeSlots.get(t.slotKey)), a.assigned = new Set(d), {
1888
+ ...Ks(
1889
1889
  e,
1890
- h,
1890
+ m,
1891
1891
  a,
1892
1892
  n,
1893
1893
  u,
1894
- js(e, h, i)
1894
+ Qs(e, m, i)
1895
1895
  ),
1896
1896
  assigned: a.assigned
1897
1897
  }));
1898
- a.assigned = new Set(m.flatMap((h) => [...h.assigned])), m.forEach(
1899
- ({ keyframes: h }) => h.forEach(({ name: g, keyframes: v }) => e.keyframesMap.set(g, v))
1898
+ a.assigned = new Set(h.flatMap((m) => [...m.assigned])), h.forEach(
1899
+ ({ keyframes: m }) => m.forEach(({ name: g, keyframes: v }) => e.keyframesMap.set(g, v))
1900
1900
  );
1901
1901
  const p = Object.fromEntries(
1902
- Ce.map((h) => [h, m.some((g) => g.wrote[h])])
1902
+ Ae.map((m) => [m, h.some((g) => g.wrote[m])])
1903
1903
  );
1904
- return je(a, p, l), e.targetsMap.set(r, a), m.flatMap(({ rules: h }) => h);
1904
+ return Ge(a, p, c), e.targetsMap.set(r, a), h.flatMap(({ rules: m }) => m);
1905
1905
  }
1906
- function zs(e, t, n, s) {
1907
- const i = [], o = /* @__PURE__ */ new Set(), r = qs(t);
1906
+ function Zs(e, t, n, s) {
1907
+ const i = [], o = /* @__PURE__ */ new Set(), r = Ws(t);
1908
1908
  i.push(
1909
1909
  ...t.effects.flatMap(
1910
- (l) => Kt(e, l, n, o, t, r)
1910
+ (c) => sn(e, c, n, o, t, r)
1911
1911
  )
1912
1912
  );
1913
1913
  const { conditions: a } = t;
1914
- return o.forEach((l) => {
1915
- s.add(l);
1916
- const u = e.targetsMap.get(l), c = Ms(u, a, e.configConditions, e.configIndex);
1917
- c && (c.declarations.forEach(({ name: f }) => u.assigned.add(f)), i.push(c)), Rs(u);
1914
+ return o.forEach((c) => {
1915
+ s.add(c);
1916
+ const u = e.targetsMap.get(c), f = Ds(u, a, e.configConditions, e.configIndex);
1917
+ f && (f.declarations.forEach(({ name: l }) => u.assigned.add(l)), i.push(f)), Vs(u);
1918
1918
  }), i;
1919
1919
  }
1920
- function Hs(e, t, n) {
1921
- const { key: s, conditions: i, effects: o = [], sequences: r = [] } = t, a = e.plugins ? Ut(
1920
+ function Js(e, t, n) {
1921
+ const { key: s, conditions: i, effects: o = [], sequences: r = [] } = t, a = e.plugins ? nn(
1922
1922
  "interaction",
1923
1923
  t,
1924
1924
  s,
1925
- re(i, e.configConditions, "media"),
1925
+ ue(i, e.configConditions, "media"),
1926
1926
  e.plugins
1927
- ) : [], { trigger: l } = t, u = {
1928
- trigger: ds(l),
1929
- id: J("trigger", [n], e.configIndex)
1930
- }, c = /* @__PURE__ */ new Set();
1931
- l === "viewProgress" && a.push(xs(e, t, u.id, c));
1932
- const f = o.map((m, p) => {
1933
- const h = Gt(
1934
- m,
1927
+ ) : [], { trigger: c } = t, u = {
1928
+ trigger: Ss(c),
1929
+ id: te("trigger", [n], e.configIndex)
1930
+ }, f = /* @__PURE__ */ new Set();
1931
+ c === "viewProgress" && a.push(Us(e, t, u.id, f));
1932
+ const l = o.map((h, p) => {
1933
+ const m = Qt(
1934
+ h,
1935
1935
  t,
1936
1936
  e.config,
1937
- J("eff", [n, p], e.configIndex),
1937
+ te("eff", [n, p], e.configIndex),
1938
1938
  { force: e.forceReducedMotion, defaultPolicy: e.reducedMotionPolicy }
1939
1939
  );
1940
- return h && Object.assign(h, { slotKey: Ee(n, p) });
1941
- }).filter((m) => m !== null);
1940
+ return m && Object.assign(m, { slotKey: Se(n, p) });
1941
+ }).filter((h) => h !== null);
1942
1942
  a.push(
1943
- ...f.flatMap((m) => Kt(e, m, u, c))
1943
+ ...l.flatMap((h) => sn(e, h, u, f))
1944
1944
  );
1945
1945
  const d = r.map(
1946
- (m, p) => ws(
1947
- m,
1946
+ (h, p) => As(
1947
+ h,
1948
1948
  t,
1949
1949
  e.config,
1950
- J("seq", [n, p], e.configIndex),
1951
- (h) => Ee(n, h, p),
1950
+ te("seq", [n, p], e.configIndex),
1951
+ (m) => Se(n, m, p),
1952
1952
  { force: e.forceReducedMotion, defaultPolicy: e.reducedMotionPolicy }
1953
1953
  )
1954
- ).filter((m) => m !== null);
1954
+ ).filter((h) => h !== null);
1955
1955
  return a.push(
1956
1956
  ...d.flatMap(
1957
- (m) => zs(e, m, u, c)
1957
+ (h) => Zs(e, h, u, f)
1958
1958
  )
1959
- ), l === "viewProgress" && c.size > 1 && e.scopedTimelines.push(`--${u.id}`), c.forEach((m) => Ls(e.targetsMap.get(m))), a;
1959
+ ), c === "viewProgress" && f.size > 1 && e.scopedTimelines.push(`--${u.id}`), f.forEach((h) => Bs(e.targetsMap.get(h))), a;
1960
1960
  }
1961
- function Gs(e = {}) {
1961
+ function ei(e = {}) {
1962
1962
  return typeof e == "boolean" ? { useFirstChild: e } : e;
1963
1963
  }
1964
- function Xt(e, t) {
1964
+ function on(e, t) {
1965
1965
  const {
1966
1966
  useFirstChild: n = !0,
1967
1967
  plugins: s,
@@ -1969,12 +1969,12 @@ function Xt(e, t) {
1969
1969
  collectSlots: o = !1,
1970
1970
  forceReducedMotion: r = w.forceReducedMotion,
1971
1971
  reducedMotionPolicy: a = w.reducedMotionPolicy
1972
- } = t, l = {
1972
+ } = t, c = {
1973
1973
  config: e,
1974
- configConditions: jt(e.conditions),
1974
+ configConditions: Ut(e.conditions),
1975
1975
  targetsMap: /* @__PURE__ */ new Map(),
1976
1976
  keyframesMap: /* @__PURE__ */ new Map(),
1977
- keyframeSlots: o ? /* @__PURE__ */ new Map() : Qt(e, { configIndex: i, forceReducedMotion: r, reducedMotionPolicy: a }),
1977
+ keyframeSlots: o ? /* @__PURE__ */ new Map() : rn(e, { configIndex: i, forceReducedMotion: r, reducedMotionPolicy: a }),
1978
1978
  scopedTimelines: [],
1979
1979
  collectSlots: o,
1980
1980
  useFirstChild: n,
@@ -1983,176 +1983,204 @@ function Xt(e, t) {
1983
1983
  plugins: s,
1984
1984
  configIndex: i
1985
1985
  }, u = e.interactions.flatMap(
1986
- (c, f) => Hs(l, c, f)
1986
+ (f, l) => Js(c, f, l)
1987
1987
  );
1988
- return { ctx: l, cssRules: u };
1988
+ return { ctx: c, cssRules: u };
1989
1989
  }
1990
- function J(e, t, n) {
1990
+ function te(e, t, n) {
1991
1991
  return [e, ...n === void 0 ? [] : [`c${n}`], ...t].join("-");
1992
1992
  }
1993
- function Ee(e, t, n) {
1993
+ function Se(e, t, n) {
1994
1994
  return [e, n, t].filter((s) => s !== void 0).join(":");
1995
1995
  }
1996
- function Qt(e, t = {}) {
1997
- const { ctx: n } = Xt(e, { ...t, collectSlots: !0 }), s = /* @__PURE__ */ new Map(), i = (o) => o ? `-${o}` : void 0;
1996
+ function rn(e, t = {}) {
1997
+ const { ctx: n } = on(e, { ...t, collectSlots: !0 }), s = /* @__PURE__ */ new Map(), i = (o) => o ? `-${o}` : void 0;
1998
1998
  return n.targetsMap.forEach(({ keyframeEntries: o }) => {
1999
1999
  const r = /* @__PURE__ */ new Set();
2000
2000
  o.forEach((a) => {
2001
- const l = (f) => a.flatMap(({ getNames: d }) => d(i(f)));
2002
- let u = 0, c = l(u);
2003
- for (; c.some((f) => r.has(f)); )
2004
- c = l(++u);
2005
- c.forEach((f) => r.add(f)), u && a.forEach(({ slotKey: f }) => s.set(f, i(u)));
2001
+ const c = (l) => a.flatMap(({ getNames: d }) => d(i(l)));
2002
+ let u = 0, f = c(u);
2003
+ for (; f.some((l) => r.has(l)); )
2004
+ f = c(++u);
2005
+ f.forEach((l) => r.add(l)), u && a.forEach(({ slotKey: l }) => s.set(l, i(u)));
2006
2006
  });
2007
2007
  }), s;
2008
2008
  }
2009
- function Ws(e, t) {
2010
- const { ctx: n, cssRules: s } = Xt(e, Gs(t)), i = [...n.targetsMap.values()], o = Math.max(0, ...i.map(({ animation: m }) => m.listIndex)), r = Math.max(0, ...i.map(({ transition: m }) => m.listIndex)), a = Math.max(0, ...i.map(({ timeline: m }) => m.listIndex)), l = _s(
2011
- i.flatMap((m) => [
2012
- m,
2013
- ...[...m.partSelectors].map((p) => ({ key: m.key, childSelector: p }))
2009
+ function ti(e, t) {
2010
+ const { ctx: n, cssRules: s } = on(e, ei(t)), i = [...n.targetsMap.values()], o = Math.max(0, ...i.map(({ animation: h }) => h.listIndex)), r = Math.max(0, ...i.map(({ transition: h }) => h.listIndex)), a = Math.max(0, ...i.map(({ timeline: h }) => h.listIndex)), c = js(
2011
+ i.flatMap((h) => [
2012
+ h,
2013
+ ...[...h.partSelectors].map((p) => ({ key: h.key, childSelector: p }))
2014
2014
  ]),
2015
2015
  o,
2016
2016
  r,
2017
2017
  a,
2018
2018
  n.configIndex
2019
- ), u = Math.max(0, ...i.map(({ animation: m }) => m.slotCursor)), c = Math.max(
2019
+ ), u = Math.max(0, ...i.map(({ animation: h }) => h.slotCursor)), f = Math.max(
2020
2020
  0,
2021
- ...i.map(({ transition: m }) => m.slotCursor)
2022
- ), f = Cs(
2021
+ ...i.map(({ transition: h }) => h.slotCursor)
2022
+ ), l = Ns(
2023
2023
  o,
2024
2024
  r,
2025
2025
  u,
2026
- c,
2026
+ f,
2027
2027
  a,
2028
2028
  n.configIndex
2029
- ), d = Ps(n.scopedTimelines, n.configIndex);
2030
- return { keyframes: n.keyframesMap, atProperty: f, cssRules: s, listsRule: l, timelineScopeRule: d };
2029
+ ), d = zs(n.scopedTimelines, n.configIndex);
2030
+ return { keyframes: n.keyframesMap, atProperty: l, cssRules: s, listsRule: c, timelineScopeRule: d };
2031
2031
  }
2032
- function uo(e, t) {
2033
- const { cssRules: n, keyframes: s, atProperty: i, listsRule: o, timelineScopeRule: r } = Ws(
2032
+ function qo(e, t) {
2033
+ const { cssRules: n, keyframes: s, atProperty: i, listsRule: o, timelineScopeRule: r } = ti(
2034
2034
  e,
2035
2035
  t
2036
2036
  );
2037
2037
  return [
2038
2038
  ...i,
2039
- ...[...s.entries()].map(([l, u]) => Is(l, u)),
2040
- ...n.map(Ts),
2039
+ ...[...s.entries()].map(([c, u]) => Ls(c, u)),
2040
+ ...n.map(Fs),
2041
2041
  o,
2042
2042
  r
2043
- ].filter((l) => l).join(`
2043
+ ].filter((c) => c).join(`
2044
2044
  `);
2045
2045
  }
2046
- const Vs = {
2046
+ const ni = {
2047
2047
  root: null,
2048
2048
  rootMargin: "0px 0px -10% 0px",
2049
2049
  threshold: [0]
2050
- }, Bs = {
2050
+ }, si = {
2051
2051
  root: null,
2052
2052
  rootMargin: "0px",
2053
2053
  threshold: [0]
2054
- }, Ys = 0.2;
2055
- function Us(e) {
2054
+ }, ii = 0.2;
2055
+ function oi(e) {
2056
2056
  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;
2057
2057
  return `${i(n)} 0px ${i(s)}`;
2058
2058
  }
2059
- const ee = {}, D = /* @__PURE__ */ new WeakMap(), we = /* @__PURE__ */ new WeakSet(), X = /* @__PURE__ */ new WeakMap();
2060
- let Zt = {}, Q = null;
2061
- function Ks(e) {
2062
- Zt = e;
2059
+ const ne = {}, q = /* @__PURE__ */ new WeakMap(), We = /* @__PURE__ */ new WeakSet(), re = /* @__PURE__ */ new WeakMap(), W = /* @__PURE__ */ new WeakMap();
2060
+ let et = {}, J = null;
2061
+ function Ie(e, t, n) {
2062
+ (re.get(e) || t).unobserve(e), We.delete(e), n && re.delete(e);
2063
2063
  }
2064
- function Jt(e, t, n) {
2065
- D.get(e)?.forEach(({ source: i, handler: o }) => {
2064
+ function ri(e) {
2065
+ et = e;
2066
+ }
2067
+ function an(e, t, n) {
2068
+ q.get(e)?.forEach(({ source: i, handler: o }) => {
2066
2069
  i === e && o(t, n);
2067
2070
  });
2068
2071
  }
2069
- function ut() {
2070
- return Q || (Q = new IntersectionObserver((e) => {
2072
+ function yt() {
2073
+ return J || (J = new IntersectionObserver((e) => {
2071
2074
  e.forEach((t) => {
2072
2075
  const n = t.target;
2073
- t.isIntersecting || Jt(n, !1, !0);
2076
+ t.isIntersecting || an(n, !1, !0);
2074
2077
  });
2075
- }, Bs), Q);
2078
+ }, si), J);
2079
+ }
2080
+ function tt(e, t = !1) {
2081
+ return JSON.stringify({ ...e, isSafeMode: t });
2076
2082
  }
2077
- function en(e, t = !1) {
2078
- const n = JSON.stringify({ ...e, isSafeMode: t });
2079
- if (ee[n])
2080
- return ee[n];
2081
- const s = e.threshold ?? Ys, i = t ? Vs : {
2083
+ function nt(e, t = !1) {
2084
+ const n = tt(e, t);
2085
+ if (ne[n])
2086
+ return ne[n];
2087
+ const s = e.threshold ?? ii, i = t ? ni : {
2082
2088
  root: null,
2083
- rootMargin: e.inset ? Us(e.inset) : "0px",
2089
+ rootMargin: e.inset ? oi(e.inset) : "0px",
2084
2090
  threshold: s
2085
2091
  }, o = new IntersectionObserver((r) => {
2086
2092
  r.forEach((a) => {
2087
- const l = a.target, u = !we.has(l);
2088
- if (u && (we.add(l), e.useSafeViewEnter && !a.isIntersecting)) {
2089
- _.measure(() => {
2090
- const c = a.boundingClientRect.height, f = a.rootBounds?.height;
2091
- if (!f)
2093
+ const c = a.target, u = !We.has(c);
2094
+ if (u && (We.add(c), e.useSafeViewEnter && !a.isIntersecting)) {
2095
+ A.measure(() => {
2096
+ const f = a.boundingClientRect.height, l = a.rootBounds?.height;
2097
+ if (!l)
2092
2098
  return;
2093
2099
  const d = Array.isArray(e.threshold) ? Math.min(...e.threshold) : e.threshold;
2094
- d && c * d > f && _.mutate(() => {
2095
- o.unobserve(l);
2096
- const p = en(e, !0);
2097
- X.set(l, p), p.observe(l);
2100
+ d && f * d > l && A.mutate(() => {
2101
+ o.unobserve(c);
2102
+ const p = nt(e, !0);
2103
+ re.set(c, p), p.observe(c);
2098
2104
  });
2099
2105
  });
2100
2106
  return;
2101
2107
  }
2102
- (a.isIntersecting || !u) && Jt(l, a.isIntersecting);
2108
+ (a.isIntersecting || !u) && an(c, a.isIntersecting);
2103
2109
  });
2104
2110
  }, i);
2105
- return ee[n] = o, o;
2111
+ return ne[n] = o, o;
2106
2112
  }
2107
- function Xs(e, t, n, s = {}, { selectorCondition: i, animation: o } = {}) {
2108
- const r = { ...Zt, ...s }, a = n.triggerType || "once", l = o || oe(t, N(n));
2109
- if (!l)
2113
+ function ai(e, t, n, s = {}, { selectorCondition: i, animation: o } = {}) {
2114
+ const r = { ...et, ...s }, a = n.triggerType || "once", c = o || fe(t, x(n));
2115
+ if (!c)
2110
2116
  return;
2111
- const u = en(r);
2112
- a !== "once" && l.persist?.();
2113
- let c = !0, f = !1, d;
2114
- d = { source: e, target: t, handler: (h, g) => {
2117
+ const u = nt(r);
2118
+ a !== "once" && c.persist?.();
2119
+ let f = !0, l = !1, d;
2120
+ const h = (m, g) => {
2115
2121
  if (!(i && !t.matches(i)))
2116
2122
  if (a === "once") {
2117
- if (h && !f) {
2118
- f = !0;
2119
- const v = D.get(e);
2120
- (!v || v.size === 0 || v.size === 1 && v.has(d)) && ((X.get(e) || u).unobserve(e), we.delete(e)), l.onFinish(() => {
2121
- D.get(e)?.delete(d), D.get(t)?.delete(d);
2122
- }), l.play(() => {
2123
+ if (m && !l) {
2124
+ l = !0;
2125
+ const v = q.get(e);
2126
+ (!v || v.size === 0 || v.size === 1 && v.has(d)) && Ie(e, u), c.onFinish(() => {
2127
+ q.get(e)?.delete(d), q.get(t)?.delete(d);
2128
+ }), c.play(() => {
2123
2129
  const y = () => {
2124
2130
  t.dataset.interactEnter = "start";
2125
- }, $ = () => {
2126
- _.mutate(() => {
2131
+ }, b = () => {
2132
+ A.mutate(() => {
2127
2133
  t.dataset.interactEnter = "done";
2128
2134
  });
2129
2135
  };
2130
- l.isCSS ? (_.mutate(() => {
2136
+ c.isCSS ? (A.mutate(() => {
2131
2137
  requestAnimationFrame(y);
2132
- }), l.onFinish($), l.onAbort($)) : (_.mutate(y), l.onFinish($));
2138
+ }), c.onFinish(b), c.onAbort(b)) : (A.mutate(y), c.onFinish(b));
2133
2139
  });
2134
2140
  }
2135
- } else a === "alternate" ? c && h ? (c = !1, l.play()) : c || l.reverse() : a === "repeat" ? h ? (l.progress(0), l.play()) : g && (l.pause(), l.progress(0)) : a === "state" && (h ? l.play() : g && l.pause());
2136
- }, cleanup: () => {
2137
- (X.get(e) || u).unobserve(e), (a === "repeat" || a === "state") && ut().unobserve(e), l.cancel(), we.delete(e), X.delete(e);
2138
- } }, q(D, e, d), q(D, t, d), X.set(e, u), u.observe(e), (a === "repeat" || a === "state") && ut().observe(e);
2139
- }
2140
- function Qs(e) {
2141
- ae(D, e);
2142
- }
2143
- function Zs() {
2144
- Q = null, Object.keys(ee).forEach((e) => delete ee[e]);
2145
- }
2146
- const Js = {
2147
- add: Xs,
2148
- remove: Qs,
2149
- setOptions: Ks,
2150
- reset: Zs
2141
+ } else a === "alternate" ? f && m ? (f = !1, c.play()) : f || c.reverse() : a === "repeat" ? m ? (c.progress(0), c.play()) : g && (c.pause(), c.progress(0)) : a === "state" && (m ? c.play() : g && c.pause());
2142
+ };
2143
+ d = { source: e, target: t, handler: h, cleanup: () => {
2144
+ Ie(e, u, !0), (a === "repeat" || a === "state") && yt().unobserve(e), c.cancel();
2145
+ } }, k(q, e, d), k(q, t, d), re.set(e, u), u.observe(e), (a === "repeat" || a === "state") && yt().observe(e), a === "once" && W.get(e)?.get(tt(r)) && h(!0);
2146
+ }
2147
+ function ci(e, t = {}) {
2148
+ const n = { ...et, ...t }, s = tt(n);
2149
+ let i = W.get(e);
2150
+ if (i || (i = /* @__PURE__ */ new Map(), W.set(e, i)), i.has(s))
2151
+ return;
2152
+ i.set(s, !1);
2153
+ const o = nt(n);
2154
+ let r;
2155
+ const a = (u) => {
2156
+ if (!u) return;
2157
+ i.set(s, !0);
2158
+ const f = q.get(e);
2159
+ f?.delete(r), (!f || f.size === 0) && Ie(e, o);
2160
+ }, c = () => Ie(e, o, !0);
2161
+ return r = { source: e, target: e, handler: a, cleanup: c }, k(q, e, r), re.set(e, o), o.observe(e), () => {
2162
+ i.delete(s), !i.size && W.get(e) === i && W.delete(e);
2163
+ const u = q.get(e);
2164
+ u?.delete(r) && u.size === 0 && c();
2165
+ };
2166
+ }
2167
+ function fi(e) {
2168
+ le(q, e), W.delete(e);
2169
+ }
2170
+ function ui() {
2171
+ J = null, Object.keys(ne).forEach((e) => delete ne[e]);
2172
+ }
2173
+ const li = {
2174
+ add: ai,
2175
+ remove: fi,
2176
+ latch: ci,
2177
+ setOptions: ri,
2178
+ reset: ui
2151
2179
  };
2152
- function tn(e, t) {
2180
+ function cn(e, t) {
2153
2181
  return Object.assign(Object.create(t), e);
2154
2182
  }
2155
- function ei(e, t, n, s) {
2183
+ function di(e, t, n, s) {
2156
2184
  let i = e * (1 - n) + t * n;
2157
2185
  if (s) {
2158
2186
  const o = i - e;
@@ -2163,7 +2191,7 @@ function ei(e, t, n, s) {
2163
2191
  }
2164
2192
  return i;
2165
2193
  }
2166
- function ti(e) {
2194
+ function hi(e) {
2167
2195
  let t = !1;
2168
2196
  return function() {
2169
2197
  t || (t = !0, window.requestAnimationFrame(() => {
@@ -2171,7 +2199,7 @@ function ti(e) {
2171
2199
  }));
2172
2200
  };
2173
2201
  }
2174
- function ft(e, t) {
2202
+ function Et(e, t) {
2175
2203
  let n = 0;
2176
2204
  return function() {
2177
2205
  n && window.clearTimeout(n), n = window.setTimeout(() => {
@@ -2179,104 +2207,104 @@ function ft(e, t) {
2179
2207
  }, t);
2180
2208
  };
2181
2209
  }
2182
- function ni(e, t) {
2210
+ function mi(e, t) {
2183
2211
  const n = e.match(/^calc\s*\(\s*(-?\d+((px)|([lsd]?vh)|([lsd]?vw)))\s*\+\s*(-?\d+((px)|([lsd]?vh)|([lsd]?vw)))\s*\)\s*$/);
2184
- return $e(n[1], t) + $e(n[6], t);
2212
+ return _e(n[1], t) + _e(n[6], t);
2185
2213
  }
2186
- function $e(e, t) {
2187
- 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) ? ni(e, t) : parseInt(e) || 0 : 0;
2214
+ function _e(e, t) {
2215
+ 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) ? mi(e, t) : parseInt(e) || 0 : 0;
2188
2216
  }
2189
- function H(e, t, n) {
2190
- const { name: s, offset: i = 0 } = e, { start: o, end: r } = n, a = r - o, l = i / 100;
2191
- let u, c;
2192
- return s === "entry" ? (u = o - t, c = Math.min(t, a)) : s === "entry-crossing" ? (u = o - t, c = a) : s === "contain" ? (u = Math.min(r - t, o), c = Math.abs(t - a)) : s === "exit" ? (u = Math.max(o, r - t), c = Math.min(t, a)) : s === "exit-crossing" ? (u = o, c = a) : s === "cover" && (u = o - t, c = a + t), u + l * c | 0;
2217
+ function G(e, t, n) {
2218
+ const { name: s, offset: i = 0 } = e, { start: o, end: r } = n, a = r - o, c = i / 100;
2219
+ let u, f;
2220
+ return s === "entry" ? (u = o - t, f = Math.min(t, a)) : s === "entry-crossing" ? (u = o - t, f = a) : s === "contain" ? (u = Math.min(r - t, o), f = Math.abs(t - a)) : s === "exit" ? (u = Math.max(o, r - t), f = Math.min(t, a)) : s === "exit-crossing" ? (u = o, f = a) : s === "cover" && (u = o - t, f = a + t), u + c * f | 0;
2193
2221
  }
2194
- function qe(e, t, n, s, i) {
2222
+ function Fe(e, t, n, s, i) {
2195
2223
  let o = 0;
2196
2224
  const r = { start: t, end: n };
2197
- return e.forEach((a, l) => {
2225
+ return e.forEach((a, c) => {
2198
2226
  o += a.offset;
2199
2227
  const u = a.sticky;
2200
2228
  if (u) {
2201
- if ("end" in u && e[l - 1]?.element) {
2202
- const d = ((i ? a.element.offsetWidth : a.element.offsetHeight) || 0) + u.end - s, m = o + d - a.offset, p = m < r.start, h = !p && m <= n;
2229
+ if ("end" in u && e[c - 1]?.element) {
2230
+ const d = ((i ? a.element.offsetWidth : a.element.offsetHeight) || 0) + u.end - s, h = o + d - a.offset, p = h < r.start, m = !p && h <= n;
2203
2231
  let g = 0;
2204
- (p || h) && (g = a.offset, r.end += g), p && (r.start += g);
2232
+ (p || m) && (g = a.offset, r.end += g), p && (r.start += g);
2205
2233
  }
2206
2234
  if ("start" in u) {
2207
- const c = o - u.start, f = c < r.start, d = !f && c <= r.end;
2208
- let m = 0;
2209
- const p = e[l - 1]?.element;
2235
+ const f = o - u.start, l = f < r.start, d = !l && f <= r.end;
2236
+ let h = 0;
2237
+ const p = e[c - 1]?.element;
2210
2238
  if (p) {
2211
- if (f || d) {
2212
- const h = (i ? p.offsetWidth : p.offsetHeight) || 0, g = a.offset, v = (i ? a.element.offsetWidth : a.element.offsetHeight) || 0;
2213
- m = h - (g + v), o += m, r.end += m;
2239
+ if (l || d) {
2240
+ const m = (i ? p.offsetWidth : p.offsetHeight) || 0, g = a.offset, v = (i ? a.element.offsetWidth : a.element.offsetHeight) || 0;
2241
+ h = m - (g + v), o += h, r.end += h;
2214
2242
  }
2215
- f && (r.start += m);
2243
+ l && (r.start += h);
2216
2244
  }
2217
2245
  }
2218
2246
  }
2219
2247
  }), r;
2220
2248
  }
2221
- function si(e, t, n, s, i, o) {
2222
- const { start: r, end: a, duration: l } = e;
2223
- let u = r, c = a, f = e.startRange, d = e.endRange, m;
2224
- if (typeof l == "string") {
2225
- f = { name: l, offset: 0 }, d = { name: l, offset: 100 }, u = H(f, n, t), c = H(d, n, t), m = c - u;
2226
- const p = qe(o, u, c, n, s);
2227
- u = p.start, c = p.end;
2249
+ function pi(e, t, n, s, i, o) {
2250
+ const { start: r, end: a, duration: c } = e;
2251
+ let u = r, f = a, l = e.startRange, d = e.endRange, h;
2252
+ if (typeof c == "string") {
2253
+ l = { name: c, offset: 0 }, d = { name: c, offset: 100 }, u = G(l, n, t), f = G(d, n, t), h = f - u;
2254
+ const p = Fe(o, u, f, n, s);
2255
+ u = p.start, f = p.end;
2228
2256
  } else {
2229
- if (f || r?.name) {
2230
- f = f || r;
2231
- const p = $e(f.add, i), h = H({ ...f, offset: 0 }, n, t), g = H({ ...f, offset: 100 }, n, t), v = qe(o, h, g, n, s);
2232
- u = v.start + f.offset / 100 * (v.end - v.start) + p;
2257
+ if (l || r?.name) {
2258
+ l = l || r;
2259
+ const p = _e(l.add, i), m = G({ ...l, offset: 0 }, n, t), g = G({ ...l, offset: 100 }, n, t), v = Fe(o, m, g, n, s);
2260
+ u = v.start + l.offset / 100 * (v.end - v.start) + p;
2233
2261
  }
2234
2262
  if (d || a?.name) {
2235
2263
  d = d || a;
2236
- const p = $e(d.add, i), h = H({ ...d, offset: 0 }, n, t), g = H({ ...d, offset: 100 }, n, t), v = qe(o, h, g, n, s);
2237
- c = v.start + d.offset / 100 * (v.end - v.start) + p;
2238
- } else typeof l == "number" && (c = u + l);
2264
+ const p = _e(d.add, i), m = G({ ...d, offset: 0 }, n, t), g = G({ ...d, offset: 100 }, n, t), v = Fe(o, m, g, n, s);
2265
+ f = v.start + d.offset / 100 * (v.end - v.start) + p;
2266
+ } else typeof c == "number" && (f = u + c);
2239
2267
  }
2240
- return !m && !l && (m = c - u), { ...e, start: u, end: c, startRange: f, endRange: d, duration: m || l };
2268
+ return !h && !c && (h = f - u), { ...e, start: u, end: f, startRange: l, endRange: d, duration: h || c };
2241
2269
  }
2242
- function ii(e) {
2270
+ function gi(e) {
2243
2271
  return e.position === "sticky";
2244
2272
  }
2245
- function oi(e, t, n) {
2273
+ function vi(e, t, n) {
2246
2274
  return e.position === "fixed" && (!t || t === window.document.body || t === n);
2247
2275
  }
2248
- function ri(e, t) {
2276
+ function yi(e, t) {
2249
2277
  return parseInt(t ? e.left : e.top);
2250
2278
  }
2251
- function ai(e, t) {
2279
+ function Ei(e, t) {
2252
2280
  return parseInt(t ? e.right : e.bottom);
2253
2281
  }
2254
- function ci(e, t, n) {
2282
+ function wi(e, t, n) {
2255
2283
  n && (e.style.position = "static");
2256
2284
  const s = (t ? e.offsetLeft : e.offsetTop) || 0;
2257
2285
  return n && (e.style.position = null), s;
2258
2286
  }
2259
- function li(e, t) {
2287
+ function bi(e, t) {
2260
2288
  let n;
2261
- const s = ri(e, t), i = ai(e, t), o = !isNaN(s), r = !isNaN(i);
2289
+ const s = yi(e, t), i = Ei(e, t), o = !isNaN(s), r = !isNaN(i);
2262
2290
  return (o || r) && (n = {}, o && (n.start = s), r && (n.end = i)), n;
2263
2291
  }
2264
- function ue(e, t, n, s, i) {
2292
+ function me(e, t, n, s, i) {
2265
2293
  const o = e[0].viewSource, r = [];
2266
- let a = (s ? o.offsetWidth : o.offsetHeight) || 0, l = 0, u = o;
2294
+ let a = (s ? o.offsetWidth : o.offsetHeight) || 0, c = 0, u = o;
2267
2295
  for (; u; ) {
2268
- const f = window.getComputedStyle(u), d = ii(f), m = d ? li(f, s) : void 0, p = ci(u, s, d);
2269
- if ((!m || !("end" in m)) && (l += p), r.push({ element: u, offset: p, sticky: m }), u = u.offsetParent, oi(f, u, t))
2296
+ const l = window.getComputedStyle(u), d = gi(l), h = d ? bi(l, s) : void 0, p = wi(u, s, d);
2297
+ if ((!h || !("end" in h)) && (c += p), r.push({ element: u, offset: p, sticky: h }), u = u.offsetParent, vi(l, u, t))
2270
2298
  break;
2271
2299
  if (u === t) {
2272
2300
  r.push({ element: u, offset: 0 });
2273
2301
  break;
2274
2302
  }
2275
2303
  }
2276
- return r.reverse(), e.map((f) => ({
2277
- ...si(
2278
- f,
2279
- { start: l, end: l + a },
2304
+ return r.reverse(), e.map((l) => ({
2305
+ ...pi(
2306
+ l,
2307
+ { start: c, end: c + a },
2280
2308
  n,
2281
2309
  s,
2282
2310
  i,
@@ -2284,7 +2312,7 @@ function ue(e, t, n, s, i) {
2284
2312
  )
2285
2313
  }));
2286
2314
  }
2287
- const dt = 100, ui = {
2315
+ const wt = 100, $i = {
2288
2316
  horizontal: !1,
2289
2317
  observeViewportEntry: !0,
2290
2318
  viewportRootMargin: "7% 7%",
@@ -2292,72 +2320,72 @@ const dt = 100, ui = {
2292
2320
  observeSourcesResize: !1,
2293
2321
  observeContentResize: !1
2294
2322
  };
2295
- function fi(e, t, n, s) {
2323
+ function Si(e, t, n, s) {
2296
2324
  let i = 0;
2297
2325
  return e >= t && e <= n ? i = s ? (e - t) / s : 1 : e > n && (i = 1), i;
2298
2326
  }
2299
- function ht(e, t) {
2327
+ function bt(e, t) {
2300
2328
  return e === window ? t ? window.document.documentElement.clientWidth : window.document.documentElement.clientHeight : t ? e.clientWidth : e.clientHeight;
2301
2329
  }
2302
- function di() {
2330
+ function Ii() {
2303
2331
  return {
2304
2332
  viewportWidth: window.document.documentElement.clientWidth,
2305
2333
  viewportHeight: window.document.documentElement.clientHeight
2306
2334
  };
2307
2335
  }
2308
- function hi(e) {
2309
- const t = tn(e, ui), n = t.root, s = t.horizontal, i = /* @__PURE__ */ new WeakMap();
2310
- let o = ht(n, s), r, a, l, u, c;
2311
- const f = [], d = di();
2336
+ function _i(e) {
2337
+ const t = cn(e, $i), n = t.root, s = t.horizontal, i = /* @__PURE__ */ new WeakMap();
2338
+ let o = bt(n, s), r, a, c, u, f;
2339
+ const l = [], d = Ii();
2312
2340
  if (t.scenes = Object.values(
2313
2341
  // TODO(ameerf): find a polyfill and use groupBy instead of following reduce
2314
2342
  e.scenes.reduce(
2315
- (h, g, v) => {
2343
+ (m, g, v) => {
2316
2344
  const y = g.groupId ? `group-${g.groupId}` : String(v);
2317
- return h[y] ? h[y].push(g) : h[y] = [g], h;
2345
+ return m[y] ? m[y].push(g) : m[y] = [g], m;
2318
2346
  },
2319
2347
  {}
2320
2348
  )
2321
- ).flatMap((h) => (h.every((g) => g.viewSource && (typeof g.duration == "string" || g.start?.name)) ? (h = ue(h, n, o, s, d), (t.observeSourcesResize || t.observeContentResize) && f.push(h)) : h.forEach((g) => {
2349
+ ).flatMap((m) => (m.every((g) => g.viewSource && (typeof g.duration == "string" || g.start?.name)) ? (m = me(m, n, o, s, d), (t.observeSourcesResize || t.observeContentResize) && l.push(m)) : m.forEach((g) => {
2322
2350
  g.end == null && (g.end = g.start + g.duration), g.duration == null && (g.duration = g.end - g.start);
2323
- }), h)), t.scenes.forEach((h, g) => {
2324
- h.index = g;
2325
- }), f.length) {
2326
- const h = /* @__PURE__ */ new Map();
2327
- window.ResizeObserver && (l = new window.ResizeObserver(function(g) {
2351
+ }), m)), t.scenes.forEach((m, g) => {
2352
+ m.index = g;
2353
+ }), l.length) {
2354
+ const m = /* @__PURE__ */ new Map();
2355
+ window.ResizeObserver && (c = new window.ResizeObserver(function(g) {
2328
2356
  g.forEach((v) => {
2329
- const y = h.get(v.target), $ = ue(y, n, o, s, d);
2330
- $.forEach((E, b) => {
2331
- t.scenes[E.index] = $[b];
2332
- }), f.splice(f.indexOf(y), 1, $);
2357
+ const y = m.get(v.target), b = me(y, n, o, s, d);
2358
+ b.forEach((E, S) => {
2359
+ t.scenes[E.index] = b[S];
2360
+ }), l.splice(l.indexOf(y), 1, b);
2333
2361
  });
2334
- }), f.forEach((g) => {
2335
- l.observe(g[0].viewSource, { box: "border-box" }), h.set(g[0].viewSource, g);
2336
- }), t.observeContentResize && t.contentRoot && new window.ResizeObserver(ft(() => {
2337
- const v = f.map((y) => {
2338
- const $ = ue(y, n, o, s, d);
2339
- return $.forEach((E, b) => {
2340
- t.scenes[E.index] = $[b];
2341
- }), $;
2362
+ }), l.forEach((g) => {
2363
+ c.observe(g[0].viewSource, { box: "border-box" }), m.set(g[0].viewSource, g);
2364
+ }), t.observeContentResize && t.contentRoot && new window.ResizeObserver(Et(() => {
2365
+ const v = l.map((y) => {
2366
+ const b = me(y, n, o, s, d);
2367
+ return b.forEach((E, S) => {
2368
+ t.scenes[E.index] = b[S];
2369
+ }), b;
2342
2370
  });
2343
- f.length = 0, f.push(...v), f.forEach((y) => {
2344
- h.set(y[0].viewSource, y);
2371
+ l.length = 0, l.push(...v), l.forEach((y) => {
2372
+ m.set(y[0].viewSource, y);
2345
2373
  });
2346
- }, dt)).observe(t.contentRoot, { box: "border-box" })), t.observeViewportResize && (u = ft(function() {
2347
- o = ht(n, s);
2348
- const g = f.map((v) => {
2349
- const y = ue(v, n, o, s, d);
2350
- return y.forEach(($, E) => {
2351
- t.scenes[$.index] = y[E];
2374
+ }, wt)).observe(t.contentRoot, { box: "border-box" })), t.observeViewportResize && (u = Et(function() {
2375
+ o = bt(n, s);
2376
+ const g = l.map((v) => {
2377
+ const y = me(v, n, o, s, d);
2378
+ return y.forEach((b, E) => {
2379
+ t.scenes[b.index] = y[E];
2352
2380
  }), y;
2353
2381
  });
2354
- f.length = 0, f.push(...g), f.forEach((v) => {
2355
- h.set(v[0].viewSource, v);
2382
+ l.length = 0, l.push(...g), l.forEach((v) => {
2383
+ m.set(v[0].viewSource, v);
2356
2384
  });
2357
- }, dt), n === window ? window.addEventListener("resize", u) : window.ResizeObserver && (c = new window.ResizeObserver(u), c.observe(n, { box: "border-box" })));
2385
+ }, wt), n === window ? window.addEventListener("resize", u) : window.ResizeObserver && (f = new window.ResizeObserver(u), f.observe(n, { box: "border-box" })));
2358
2386
  }
2359
- t.observeViewportEntry && window.IntersectionObserver && (a = new window.IntersectionObserver(function(h) {
2360
- h.forEach((g) => {
2387
+ t.observeViewportEntry && window.IntersectionObserver && (a = new window.IntersectionObserver(function(m) {
2388
+ m.forEach((g) => {
2361
2389
  (i.get(g.target) || []).forEach((v) => {
2362
2390
  v.disabled = !g.isIntersecting;
2363
2391
  });
@@ -2366,42 +2394,42 @@ function hi(e) {
2366
2394
  root: n === window ? window.document : n,
2367
2395
  rootMargin: t.viewportRootMargin,
2368
2396
  threshold: 0
2369
- }), t.scenes.forEach((h) => {
2370
- if (h.viewSource) {
2371
- let g = i.get(h.viewSource);
2372
- g || (g = [], i.set(h.viewSource, g), a.observe(h.viewSource)), g.push(h);
2397
+ }), t.scenes.forEach((m) => {
2398
+ if (m.viewSource) {
2399
+ let g = i.get(m.viewSource);
2400
+ g || (g = [], i.set(m.viewSource, g), a.observe(m.viewSource)), g.push(m);
2373
2401
  }
2374
2402
  }));
2375
- function m({ p: h, vp: g }) {
2376
- h = +h.toFixed(1);
2403
+ function h({ p: m, vp: g }) {
2404
+ m = +m.toFixed(1);
2377
2405
  const v = +g.toFixed(4);
2378
- if (h !== r) {
2406
+ if (m !== r) {
2379
2407
  for (let y of t.scenes)
2380
2408
  if (!y.disabled) {
2381
- const { start: $, end: E, duration: b } = y, S = fi(h, $, E, b);
2382
- y.effect(y, S, v);
2409
+ const { start: b, end: E, duration: S } = y, $ = Si(m, b, E, S);
2410
+ y.effect(y, $, v);
2383
2411
  }
2384
- r = h;
2412
+ r = m;
2385
2413
  }
2386
2414
  }
2387
2415
  function p() {
2388
- t.scenes.forEach((h) => h.destroy?.()), a && (a.disconnect(), a = null), l && (l.disconnect(), l = null), u && (c ? (c.disconnect(), c = null) : window.removeEventListener("resize", u));
2416
+ t.scenes.forEach((m) => m.destroy?.()), a && (a.disconnect(), a = null), c && (c.disconnect(), c = null), u && (f ? (f.disconnect(), f = null) : window.removeEventListener("resize", u));
2389
2417
  }
2390
2418
  return {
2391
- tick: m,
2419
+ tick: h,
2392
2420
  destroy: p
2393
2421
  };
2394
2422
  }
2395
- const mi = {
2423
+ const Ti = {
2396
2424
  transitionActive: !1,
2397
2425
  transitionFriction: 0.9,
2398
2426
  transitionEpsilon: 1,
2399
2427
  velocityActive: !1,
2400
2428
  velocityMax: 1
2401
2429
  };
2402
- class pi {
2430
+ class Mi {
2403
2431
  constructor(t = {}) {
2404
- this.config = tn(t, mi), this.progress = {
2432
+ this.config = cn(t, Ti), this.progress = {
2405
2433
  p: 0,
2406
2434
  prevP: 0,
2407
2435
  vp: 0
@@ -2414,7 +2442,7 @@ class pi {
2414
2442
  this.config.root = n ? window : this.config.root, this.config.contentRoot = this.config.contentRoot || (n ? window.document.body : this.config.root.firstElementChild), this.config.resetProgress = this.config.resetProgress || this.resetProgress.bind(this), this._measure = this.config.measure || (() => {
2415
2443
  const s = this.config.root;
2416
2444
  this.progress.p = this.config.horizontal ? s.scrollX || s.scrollLeft || 0 : s.scrollY || s.scrollTop || 0;
2417
- }), this._trigger = ti(() => {
2445
+ }), this._trigger = hi(() => {
2418
2446
  this._measure?.(), this.tick(!0);
2419
2447
  });
2420
2448
  }
@@ -2460,7 +2488,7 @@ class pi {
2460
2488
  * Calculate current progress.
2461
2489
  */
2462
2490
  lerp() {
2463
- this.currentProgress.p = ei(this.currentProgress.p, this.progress.p, +(1 - this.config.transitionFriction).toFixed(3), this.config.transitionEpsilon);
2491
+ this.currentProgress.p = di(this.currentProgress.p, this.progress.p, +(1 - this.config.transitionFriction).toFixed(3), this.config.transitionEpsilon);
2464
2492
  }
2465
2493
  /**
2466
2494
  * Stop the event and effect, and remove all DOM side-effects.
@@ -2484,7 +2512,7 @@ class pi {
2484
2512
  * Reset registered effect.
2485
2513
  */
2486
2514
  setupEffect() {
2487
- this.removeEffect(), this.effect = hi(this.config);
2515
+ this.removeEffect(), this.effect = _i(this.config);
2488
2516
  }
2489
2517
  /**
2490
2518
  * Remove registered effect.
@@ -2493,20 +2521,20 @@ class pi {
2493
2521
  this.effect && this.effect.destroy(), this.effect = null;
2494
2522
  }
2495
2523
  }
2496
- const ze = /* @__PURE__ */ new WeakMap();
2497
- let nn = () => ({});
2498
- function gi(e) {
2499
- nn = e;
2524
+ const Ve = /* @__PURE__ */ new WeakMap();
2525
+ let fn = () => ({});
2526
+ function Oi(e) {
2527
+ fn = e;
2500
2528
  }
2501
- function vi(e, t, n, s, { selectorCondition: i }) {
2529
+ function Pi(e, t, n, s, { selectorCondition: i }) {
2502
2530
  if (i && !t.matches(i)) return;
2503
2531
  const o = {
2504
2532
  trigger: "view-progress",
2505
2533
  element: e
2506
- }, r = N(n);
2534
+ }, r = x(n);
2507
2535
  let a;
2508
2536
  if ("ViewTimeline" in window) {
2509
- const u = oe(
2537
+ const u = fe(
2510
2538
  t,
2511
2539
  r,
2512
2540
  o
@@ -2517,42 +2545,42 @@ function vi(e, t, n, s, { selectorCondition: i }) {
2517
2545
  });
2518
2546
  });
2519
2547
  } else {
2520
- const u = Rt(t, r, o);
2548
+ const u = Ht(t, r, o);
2521
2549
  if (u) {
2522
- const c = Array.isArray(u) ? u : [u], f = new pi({
2550
+ const f = Array.isArray(u) ? u : [u], l = new Mi({
2523
2551
  viewSource: e,
2524
- scenes: c,
2552
+ scenes: f,
2525
2553
  observeViewportEntry: !1,
2526
2554
  observeViewportResize: !1,
2527
2555
  observeSourcesResize: !0,
2528
2556
  root: document.body,
2529
- ...nn()
2557
+ ...fn()
2530
2558
  });
2531
2559
  a = () => {
2532
- f.destroy();
2533
- }, Promise.all(c.map((d) => d.ready || Promise.resolve())).then(
2560
+ l.destroy();
2561
+ }, Promise.all(f.map((d) => d.ready || Promise.resolve())).then(
2534
2562
  () => {
2535
- f.start();
2563
+ l.start();
2536
2564
  }
2537
2565
  );
2538
2566
  }
2539
2567
  }
2540
2568
  if (!a) return;
2541
- const l = { source: e, target: t, cleanup: a };
2542
- q(ze, e, l), q(ze, t, l);
2569
+ const c = { source: e, target: t, cleanup: a };
2570
+ k(Ve, e, c), k(Ve, t, c);
2543
2571
  }
2544
- function yi(e) {
2545
- ae(ze, e);
2572
+ function Ci(e) {
2573
+ le(Ve, e);
2546
2574
  }
2547
- const Ei = {
2548
- add: vi,
2549
- remove: yi,
2550
- registerOptionsGetter: gi
2575
+ const Ai = {
2576
+ add: Pi,
2577
+ remove: Ci,
2578
+ registerOptionsGetter: Oi
2551
2579
  };
2552
- function mt(e, t, n) {
2580
+ function $t(e, t, n) {
2553
2581
  return Math.min(Math.max(e, n), t);
2554
2582
  }
2555
- function pt(e) {
2583
+ function St(e) {
2556
2584
  let t = !1;
2557
2585
  return function() {
2558
2586
  if (!t)
@@ -2561,7 +2589,7 @@ function pt(e) {
2561
2589
  });
2562
2590
  };
2563
2591
  }
2564
- function wi(e) {
2592
+ function ki(e) {
2565
2593
  let t = e, n = 0, s = 0;
2566
2594
  if (t.offsetParent)
2567
2595
  do
@@ -2574,7 +2602,7 @@ function wi(e) {
2574
2602
  height: e.offsetHeight
2575
2603
  };
2576
2604
  }
2577
- function $i() {
2605
+ function qi() {
2578
2606
  const e = window.devicePixelRatio;
2579
2607
  let t = !1;
2580
2608
  if (e === 1)
@@ -2587,7 +2615,7 @@ function $i() {
2587
2615
  });
2588
2616
  return document.body.dispatchEvent(n), t;
2589
2617
  }
2590
- function Si() {
2618
+ function Ri() {
2591
2619
  return new Promise((e) => {
2592
2620
  const t = window.scrollY;
2593
2621
  let n = !1, s;
@@ -2606,42 +2634,42 @@ function Si() {
2606
2634
  i(), window.addEventListener("scroll", o), window.scrollY > 0 && window.scrollBy(0, -1);
2607
2635
  });
2608
2636
  }
2609
- function bi(e) {
2610
- Si().then((t) => {
2637
+ function Li(e) {
2638
+ Ri().then((t) => {
2611
2639
  e.fixRequired = t, t && (window.addEventListener("scroll", e.scrollHandler), e.scrollHandler());
2612
2640
  });
2613
2641
  }
2614
- let fe = 0;
2615
- const ve = /* @__PURE__ */ new Set();
2616
- function Ii() {
2642
+ let pe = 0;
2643
+ const be = /* @__PURE__ */ new Set();
2644
+ function Fi() {
2617
2645
  const e = (n) => {
2618
2646
  for (let s of n.changedTouches)
2619
- ve.add(s.identifier);
2647
+ be.add(s.identifier);
2620
2648
  }, t = (n) => {
2621
2649
  for (let s of n.changedTouches)
2622
- ve.delete(s.identifier);
2650
+ be.delete(s.identifier);
2623
2651
  };
2624
2652
  return document.addEventListener("touchstart", e, { passive: !0 }), document.addEventListener("touchend", t, { passive: !0 }), function() {
2625
- ve.clear(), document.removeEventListener("touchstart", e), document.removeEventListener("touchend", t);
2653
+ be.clear(), document.removeEventListener("touchstart", e), document.removeEventListener("touchend", t);
2626
2654
  };
2627
2655
  }
2628
- function Ti(e, t) {
2656
+ function xi(e, t) {
2629
2657
  if ("onscrollend" in window)
2630
2658
  return e.addEventListener("scrollend", t), function() {
2631
2659
  e.removeEventListener("scrollend", t);
2632
2660
  };
2633
2661
  let n = 0, s;
2634
- fe || (s = Ii()), fe += 1;
2662
+ pe || (s = Fi()), pe += 1;
2635
2663
  function i(o) {
2636
2664
  clearTimeout(n), n = setTimeout(() => {
2637
- ve.size ? setTimeout(i, 100) : (t(o), n = 0);
2665
+ be.size ? setTimeout(i, 100) : (t(o), n = 0);
2638
2666
  }, 100);
2639
2667
  }
2640
2668
  return e.addEventListener("scroll", i), function() {
2641
- e.removeEventListener("scroll", i), fe -= 1, fe || s();
2669
+ e.removeEventListener("scroll", i), pe -= 1, pe || s();
2642
2670
  };
2643
2671
  }
2644
- function Oi(e, t, n) {
2672
+ function Ni(e, t, n) {
2645
2673
  return {
2646
2674
  x(s) {
2647
2675
  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;
@@ -2653,13 +2681,13 @@ function Oi(e, t, n) {
2653
2681
  }
2654
2682
  };
2655
2683
  }
2656
- function Ci(e, t) {
2684
+ function Di(e, t) {
2657
2685
  this.x = window.scrollX, this.y = window.scrollY, requestAnimationFrame(() => e && e(t));
2658
2686
  }
2659
- function Mi(e) {
2687
+ function ji(e) {
2660
2688
  e.rect.width = window.document.documentElement.clientWidth, e.rect.height = window.document.documentElement.clientHeight;
2661
2689
  }
2662
- function _i(e) {
2690
+ function zi(e) {
2663
2691
  const t = new ResizeObserver((n) => {
2664
2692
  n.forEach((s) => {
2665
2693
  e.rect.width = s.borderBoxSize[0].inlineSize, e.rect.height = s.borderBoxSize[0].blockSize;
@@ -2667,38 +2695,38 @@ function _i(e) {
2667
2695
  });
2668
2696
  return t.observe(e.root, { box: "border-box" }), t;
2669
2697
  }
2670
- function Pi(e) {
2698
+ function Hi(e) {
2671
2699
  let t = !1, n = { x: e.rect.width / 2, y: e.rect.height / 2, vx: 0, vy: 0 }, s, i, o, r, a;
2672
- const l = { x: 0, y: 0 };
2673
- e.scenes.forEach((c) => {
2674
- c.target && c.centeredToTarget && (c.transform = Oi(wi(c.target), e.rect, l), t = !0), e.root ? i = _i(e) : (o = Mi.bind(null, e), window.addEventListener("resize", o));
2675
- }), s = function(c) {
2676
- for (let f of e.scenes)
2677
- if (!f.disabled) {
2678
- const d = f.transform?.x(c.x) || c.x / e.rect.width, m = f.transform?.y(c.y) || c.y / e.rect.height, p = +mt(0, 1, d).toPrecision(4), h = +mt(0, 1, m).toPrecision(4), g = { x: c.vx, y: c.vy };
2679
- e.allowActiveEvent && (c.active = d <= 1 && m <= 1 && d >= 0 && m >= 0), f.effect(f, { x: p, y: h }, g, c.active);
2700
+ const c = { x: 0, y: 0 };
2701
+ e.scenes.forEach((f) => {
2702
+ f.target && f.centeredToTarget && (f.transform = Ni(ki(f.target), e.rect, c), t = !0), e.root ? i = zi(e) : (o = ji.bind(null, e), window.addEventListener("resize", o));
2703
+ }), s = function(f) {
2704
+ for (let l of e.scenes)
2705
+ if (!l.disabled) {
2706
+ const d = l.transform?.x(f.x) || f.x / e.rect.width, h = l.transform?.y(f.y) || f.y / e.rect.height, p = +$t(0, 1, d).toPrecision(4), m = +$t(0, 1, h).toPrecision(4), g = { x: f.vx, y: f.vy };
2707
+ e.allowActiveEvent && (f.active = d <= 1 && h <= 1 && d >= 0 && h >= 0), l.effect(l, { x: p, y: m }, g, f.active);
2680
2708
  }
2681
- Object.assign(n, c);
2682
- }, t && (r = Ci.bind(l, s, n), a = Ti(document, r));
2709
+ Object.assign(n, f);
2710
+ }, t && (r = Di.bind(c, s, n), a = xi(document, r));
2683
2711
  function u() {
2684
- e.scenes.forEach((c) => c.destroy?.()), a?.(), i ? (i.disconnect(), i = null) : (window.removeEventListener("resize", o), o = null), s = null, n = null;
2712
+ e.scenes.forEach((f) => f.destroy?.()), a?.(), i ? (i.disconnect(), i = null) : (window.removeEventListener("resize", o), o = null), s = null, n = null;
2685
2713
  }
2686
2714
  return {
2687
2715
  tick: s,
2688
2716
  destroy: u
2689
2717
  };
2690
2718
  }
2691
- const ki = 1e3 / 60 * 3;
2692
- let de;
2693
- function Ai() {
2694
- G.x = window.scrollX, G.y = window.scrollY;
2719
+ const Gi = 1e3 / 60 * 3;
2720
+ let ge;
2721
+ function Wi() {
2722
+ V.x = window.scrollX, V.y = window.scrollY;
2695
2723
  }
2696
- const G = { x: 0, y: 0, scrollHandler: Ai, fixRequired: void 0 };
2697
- class qi {
2724
+ const V = { x: 0, y: 0, scrollHandler: Wi, fixRequired: void 0 };
2725
+ class Vi {
2698
2726
  constructor(t = {}) {
2699
2727
  this.config = { ...t }, this.effect = null, this._nextTick = null, this._nextTransitionTick = null, this._startTime = 0;
2700
2728
  let n;
2701
- this.config.transitionDuration ? n = this.config.noThrottle ? () => this.transition() : pt(() => this.transition()) : n = this.config.noThrottle ? () => (this.tick(), null) : pt(() => {
2729
+ this.config.transitionDuration ? n = this.config.noThrottle ? () => this.transition() : St(() => this.transition()) : n = this.config.noThrottle ? () => (this.tick(), null) : St(() => {
2702
2730
  this.tick();
2703
2731
  }), this.config.rect = this.config.root ? {
2704
2732
  width: this.config.root.offsetWidth,
@@ -2721,15 +2749,15 @@ class qi {
2721
2749
  }, this._pointerEnter = () => {
2722
2750
  this.progress.active = !0, this._nextTick = n();
2723
2751
  }, this.config.root) {
2724
- de = typeof de == "boolean" ? de : $i();
2725
- const i = de ? window.devicePixelRatio : 1;
2726
- typeof G.fixRequired > "u" && bi(G), this._measure = (o) => {
2752
+ ge = typeof ge == "boolean" ? ge : qi();
2753
+ const i = ge ? window.devicePixelRatio : 1;
2754
+ typeof V.fixRequired > "u" && Li(V), this._measure = (o) => {
2727
2755
  if (o.target !== this.config.root) {
2728
2756
  const r = new PointerEvent("pointermove", {
2729
2757
  bubbles: !0,
2730
2758
  cancelable: !0,
2731
- clientX: o.x * i + G.x,
2732
- clientY: o.y * i + G.y
2759
+ clientX: o.x * i + V.x,
2760
+ clientY: o.y * i + V.y
2733
2761
  });
2734
2762
  o.stopPropagation(), this.config.root.dispatchEvent(r);
2735
2763
  } else
@@ -2765,8 +2793,8 @@ class qi {
2765
2793
  const t = this.config.transitionDuration, n = this.config.transitionEasing || ((r) => r), s = performance.now();
2766
2794
  let i = !1;
2767
2795
  const o = (r) => {
2768
- const a = (r - this._startTime) / t, l = n(Math.min(1, a));
2769
- i && (this.progress.vx = 0, this.progress.vy = 0, i = !1), this.currentProgress = Object.entries(this.progress).reduce((u, [c, f]) => (c === "active" ? u[c] = f : u[c] = this.previousProgress[c] + (f - this.previousProgress[c]) * l, u), this.currentProgress || {}), a < 1 && (this._nextTransitionTick = requestAnimationFrame(o), i = r - this._startTime > ki), this.effect.tick(this.currentProgress);
2796
+ const a = (r - this._startTime) / t, c = n(Math.min(1, a));
2797
+ i && (this.progress.vx = 0, this.progress.vy = 0, i = !1), this.currentProgress = Object.entries(this.progress).reduce((u, [f, l]) => (f === "active" ? u[f] = l : u[f] = this.previousProgress[f] + (l - this.previousProgress[f]) * c, u), this.currentProgress || {}), a < 1 && (this._nextTransitionTick = requestAnimationFrame(o), i = r - this._startTime > Gi), this.effect.tick(this.currentProgress);
2770
2798
  };
2771
2799
  return this._startTime ? (this._nextTransitionTick && cancelAnimationFrame(this._nextTransitionTick), Object.assign(this.previousProgress, this.currentProgress), this._startTime = s, o(s)) : this._startTime = s, this._nextTransitionTick;
2772
2800
  }
@@ -2795,7 +2823,7 @@ class qi {
2795
2823
  * Reset registered effect.
2796
2824
  */
2797
2825
  setupEffect() {
2798
- this.removeEffect(), this.effect = Pi(this.config);
2826
+ this.removeEffect(), this.effect = Hi(this.config);
2799
2827
  }
2800
2828
  /**
2801
2829
  * Remove registered effect.
@@ -2804,76 +2832,124 @@ class qi {
2804
2832
  this.effect && this.effect.destroy(), this.effect = null;
2805
2833
  }
2806
2834
  }
2807
- const He = /* @__PURE__ */ new WeakMap();
2808
- let sn = () => ({});
2809
- function Ri(e) {
2810
- sn = e;
2835
+ const Be = /* @__PURE__ */ new WeakMap();
2836
+ let un = () => ({});
2837
+ function Bi(e) {
2838
+ un = e;
2811
2839
  }
2812
- function Li(e) {
2840
+ function Yi(e) {
2813
2841
  return !("keyframeEffect" in e || "customEffect" in e) || !e.transitionDuration ? {} : {
2814
2842
  transitionDuration: e.transitionDuration,
2815
- transitionEasing: Xe(e.transitionEasing)
2843
+ transitionEasing: Qe(e.transitionEasing)
2816
2844
  };
2817
2845
  }
2818
- function Fi(e, t, n, s = {}, { selectorCondition: i }) {
2846
+ function Ui(e, t, n, s = {}, { selectorCondition: i }) {
2819
2847
  if (i && !t.matches(i)) return;
2820
2848
  const o = {
2821
2849
  trigger: "pointer-move",
2822
2850
  element: e,
2823
2851
  axis: s.axis ?? "y"
2824
- }, r = Rt(t, N(n), o);
2852
+ }, r = Ht(t, x(n), o);
2825
2853
  if (r) {
2826
- const a = Array.isArray(r) ? r : [r], l = new qi({
2854
+ const a = Array.isArray(r) ? r : [r], c = new Vi({
2827
2855
  root: s.hitArea === "self" ? e : void 0,
2828
2856
  scenes: a,
2829
- ...sn(),
2830
- ...Li(n)
2831
- }), c = { source: e, target: t, cleanup: () => {
2832
- l.destroy();
2857
+ ...un(),
2858
+ ...Yi(n)
2859
+ }), f = { source: e, target: t, cleanup: () => {
2860
+ c.destroy();
2833
2861
  } };
2834
- q(He, e, c), q(He, t, c), Promise.all(
2835
- a.map((f) => f.ready || Promise.resolve())
2862
+ k(Be, e, f), k(Be, t, f), Promise.all(
2863
+ a.map((l) => l.ready || Promise.resolve())
2836
2864
  ).then(() => {
2837
- l.start();
2865
+ c.start();
2838
2866
  });
2839
2867
  }
2840
2868
  }
2841
- function xi(e) {
2842
- ae(He, e);
2869
+ function Ki(e) {
2870
+ le(Be, e);
2871
+ }
2872
+ const Xi = {
2873
+ add: Ui,
2874
+ remove: Ki,
2875
+ registerOptionsGetter: Bi
2876
+ }, Ye = /* @__PURE__ */ new WeakMap(), N = /* @__PURE__ */ new WeakMap();
2877
+ function ln(e, t) {
2878
+ return Array.from(e.querySelectorAll(t));
2879
+ }
2880
+ function Qi(e) {
2881
+ return e.animationName || `#${e.detail?.effectId}`;
2882
+ }
2883
+ function Zi(e) {
2884
+ const t = [];
2885
+ for (let n = e; n; n = n.parentElement)
2886
+ N.get(n)?.forEach(({ sourceSelector: s, events: i }) => {
2887
+ (s ? !ln(n, s).includes(e) : n !== e) || i.forEach((o, r) => {
2888
+ o.forEach((a) => {
2889
+ (r === e || a.bubbles && e.contains(r)) && t.push(a);
2890
+ });
2891
+ });
2892
+ });
2893
+ return t;
2894
+ }
2895
+ function Ji(e) {
2896
+ N.get(e)?.forEach(({ cleanup: t }) => t()), N.delete(e);
2843
2897
  }
2844
- const Ni = {
2845
- add: Fi,
2846
- remove: xi,
2847
- registerOptionsGetter: Ri
2848
- }, Ge = /* @__PURE__ */ new WeakMap();
2849
- function Di(e, t, n, s, { selectorCondition: i, animation: o, sourceAnimationOptions: r }) {
2850
- const a = o || oe(t, N(n));
2898
+ function eo(e, t, n, s, { selectorCondition: i, animation: o, sourceAnimationOptions: r }) {
2899
+ const a = o || fe(t, x(n));
2851
2900
  if (!a)
2852
2901
  return;
2853
- const { effectId: l } = s, u = (d) => {
2854
- if (i && !t.matches(i)) return;
2855
- const m = d.animationName, p = d.detail?.effectId, h = r ? qt(e, r) : null;
2856
- if (h) {
2857
- if (h.playState === "running" || m && !h.hasAnimationName(m))
2858
- return;
2859
- if (p && p !== l && !h.hasAnimationId(p))
2860
- return;
2902
+ const { effectId: c } = s, u = (h) => {
2903
+ if (i && !t.matches(i)) return !1;
2904
+ const p = h.animationName, m = h.detail?.effectId, g = r ? zt(e, r) : null;
2905
+ if (g) {
2906
+ if (g.playState === "running" || p && !g.hasAnimationName(p))
2907
+ return !1;
2908
+ if (m && m !== c && !g.hasAnimationId(m))
2909
+ return !1;
2861
2910
  }
2862
- a.play();
2863
- }, f = { source: e, target: t, cleanup: () => {
2864
- a.cancel(), e.removeEventListener("animationend", u);
2911
+ return !0;
2912
+ }, f = (h) => {
2913
+ u(h) && a.play();
2914
+ }, d = { source: e, target: t, cleanup: () => {
2915
+ a.cancel(), e.removeEventListener("animationend", f);
2865
2916
  } };
2866
- q(Ge, e, f), q(Ge, t, f), e.addEventListener("animationend", u);
2917
+ k(Ye, e, d), k(Ye, t, d), e.addEventListener("animationend", f), Zi(e).some(u) && a.play();
2867
2918
  }
2868
- function ji(e) {
2869
- ae(Ge, e);
2919
+ function to(e, t, n) {
2920
+ let s = N.get(e);
2921
+ if (s?.some((a) => a.sourceSelector === n))
2922
+ return;
2923
+ s || (s = [], N.set(e, s));
2924
+ const i = /* @__PURE__ */ new Map(), o = (a) => {
2925
+ const c = a.target;
2926
+ if (n && !ln(e, n).some(
2927
+ (l) => l === c || a.bubbles && l.contains(c)
2928
+ ))
2929
+ return;
2930
+ let u = i.get(c);
2931
+ u || (u = /* @__PURE__ */ new Map(), i.set(c, u)), u.set(Qi(a), a);
2932
+ }, r = {
2933
+ sourceSelector: n,
2934
+ events: i,
2935
+ cleanup: () => e.removeEventListener("animationend", o, !0)
2936
+ };
2937
+ return e.addEventListener("animationend", o, !0), s.push(r), () => {
2938
+ const a = N.get(e), c = a ? a.indexOf(r) : -1;
2939
+ c !== -1 && (r.cleanup(), a.splice(c, 1), a.length || N.delete(e));
2940
+ };
2941
+ }
2942
+ function no(e) {
2943
+ le(Ye, e), Ji(e);
2870
2944
  }
2871
- const zi = {
2872
- add: Di,
2873
- remove: ji
2945
+ const so = {
2946
+ add: eo,
2947
+ remove: no,
2948
+ latch: to,
2949
+ latchesSubtree: !0
2874
2950
  };
2875
- function Hi(e, t, n, s, i) {
2876
- const o = i || oe(e, N(t));
2951
+ function io(e, t, n, s, i) {
2952
+ const o = i || fe(e, x(t));
2877
2953
  if (!o)
2878
2954
  return null;
2879
2955
  let r = !0;
@@ -2881,99 +2957,99 @@ function Hi(e, t, n, s, i) {
2881
2957
  return {
2882
2958
  handler: (u) => {
2883
2959
  if (n && !e.matches(n)) return;
2884
- const c = !s, f = s?.enter?.includes(u.type), d = s?.leave?.includes(u.type);
2885
- if (f || c) {
2960
+ const f = !s, l = s?.enter?.includes(u.type), d = s?.leave?.includes(u.type);
2961
+ if (l || f) {
2886
2962
  if (a === "alternate" || a === "state")
2887
2963
  r ? (r = !1, o.play()) : a === "alternate" ? o.reverse() : a === "state" && (o.playState === "running" ? o.pause() : o.playState !== "finished" && o.play());
2888
2964
  else {
2889
2965
  if (o.progress(0), delete e.dataset.interactEnter, o.isCSS) {
2890
- const m = () => {
2891
- _.mutate(() => {
2966
+ const h = () => {
2967
+ A.mutate(() => {
2892
2968
  e.dataset.interactEnter = "done";
2893
2969
  });
2894
2970
  };
2895
- o.onFinish(m), o.onAbort(m);
2971
+ o.onFinish(h), o.onAbort(h);
2896
2972
  }
2897
2973
  o.play();
2898
2974
  }
2899
2975
  return;
2900
2976
  }
2901
- d && (a === "alternate" ? o.reverse() : a === "repeat" ? (o.cancel(), _.mutate(() => {
2977
+ d && (a === "alternate" ? o.reverse() : a === "repeat" ? (o.cancel(), A.mutate(() => {
2902
2978
  delete e.dataset.interactEnter;
2903
2979
  })) : a === "state" && o.playState === "running" && o.pause());
2904
2980
  },
2905
2981
  cleanup: () => o.cancel()
2906
2982
  };
2907
2983
  }
2908
- function Gi(e, t, {
2984
+ function oo(e, t, {
2909
2985
  effectId: n,
2910
2986
  listContainer: s,
2911
2987
  listItemSelector: i,
2912
2988
  stateAction: o
2913
2989
  }, r, a) {
2914
- const l = !!s, u = o ?? "toggle", c = u === "toggle";
2915
- return (f) => {
2990
+ const c = !!s, u = o ?? "toggle", f = u === "toggle";
2991
+ return (l) => {
2916
2992
  if (r && !e.matches(r)) return;
2917
- const d = l ? e.closest(
2993
+ const d = c ? e.closest(
2918
2994
  `${s} > ${i || ""}:has(:scope)`
2919
- ) : void 0, m = !a, p = a?.enter?.includes(f.type), h = a?.leave?.includes(f.type);
2920
- m ? t.toggleEffect(n, u, d) : (p && t.toggleEffect(n, c ? "add" : u, d), h && c && t.toggleEffect(n, "remove", d));
2995
+ ) : void 0, h = !a, p = a?.enter?.includes(l.type), m = a?.leave?.includes(l.type);
2996
+ h ? t.toggleEffect(n, u, d) : (p && t.toggleEffect(n, f ? "add" : u, d), m && f && t.toggleEffect(n, "remove", d));
2921
2997
  };
2922
2998
  }
2923
- const We = /* @__PURE__ */ new WeakMap();
2924
- function gt(e, t) {
2999
+ const Ue = /* @__PURE__ */ new WeakMap();
3000
+ function It(e, t) {
2925
3001
  return (n) => {
2926
3002
  const s = n;
2927
3003
  e.contains(s.relatedTarget) || t(s);
2928
3004
  };
2929
3005
  }
2930
- function Wi(e) {
3006
+ function ro(e) {
2931
3007
  return (t) => {
2932
3008
  const n = t;
2933
3009
  (n.pointerType || n.detail > 0) && e(n);
2934
3010
  };
2935
3011
  }
2936
- function Vi(e) {
3012
+ function ao(e) {
2937
3013
  return (t) => {
2938
3014
  const n = t;
2939
3015
  n.code === "Space" ? (n.preventDefault(), e(n)) : n.code === "Enter" && e(n);
2940
3016
  };
2941
3017
  }
2942
- const Bi = {
2943
- focusin: (e, t) => gt(e, t),
2944
- focusout: (e, t) => gt(e, t),
2945
- click: (e, t) => Wi(t),
2946
- keydown: (e, t) => Vi(t)
3018
+ const co = {
3019
+ focusin: (e, t) => It(e, t),
3020
+ focusout: (e, t) => It(e, t),
3021
+ click: (e, t) => ro(t),
3022
+ keydown: (e, t) => ao(t)
2947
3023
  };
2948
- function Yi(e, t, n) {
2949
- const s = Bi[e];
3024
+ function fo(e, t, n) {
3025
+ const s = co[e];
2950
3026
  return s ? s(t, n) : (i) => n(i);
2951
3027
  }
2952
- function Ui(e) {
3028
+ function uo(e) {
2953
3029
  return typeof e == "object" && !Array.isArray(e) && ("enter" in e || "leave" in e);
2954
3030
  }
2955
- function Ki(e) {
3031
+ function lo(e) {
2956
3032
  if (typeof e == "string")
2957
3033
  return { toggle: [e] };
2958
3034
  if (Array.isArray(e))
2959
3035
  return { toggle: [...e] };
2960
- if (Ui(e)) {
3036
+ if (uo(e)) {
2961
3037
  const t = e.enter ? [...e.enter] : [], n = e.leave ? [...e.leave] : [];
2962
3038
  return { enter: t, leave: n };
2963
3039
  }
2964
3040
  return {};
2965
3041
  }
2966
- function Xi(e) {
3042
+ function ho(e) {
2967
3043
  return !!(e.enter?.length || e.leave?.length);
2968
3044
  }
2969
- function Qi(e) {
2970
- return Xi(e) ? { enter: e.enter ?? [], leave: e.leave ?? [] } : void 0;
3045
+ function mo(e) {
3046
+ return ho(e) ? { enter: e.enter ?? [], leave: e.leave ?? [] } : void 0;
2971
3047
  }
2972
- function Zi(e, t, n, s, { targetController: i, selectorCondition: o, animation: r }) {
2973
- const a = Ki(s.eventConfig), l = n.transition || n.transitionProperties, u = Qi(a);
2974
- let c, f, d = !1;
2975
- if (l)
2976
- c = Gi(
3048
+ function po(e, t, n, s, { targetController: i, selectorCondition: o, animation: r }) {
3049
+ const a = lo(s.eventConfig), c = n.transition || n.transitionProperties, u = mo(a);
3050
+ let f, l, d = !1;
3051
+ if (c)
3052
+ f = oo(
2977
3053
  t,
2978
3054
  i,
2979
3055
  n,
@@ -2981,50 +3057,50 @@ function Zi(e, t, n, s, { targetController: i, selectorCondition: o, animation:
2981
3057
  u
2982
3058
  );
2983
3059
  else {
2984
- const y = Hi(
3060
+ const y = io(
2985
3061
  t,
2986
3062
  n,
2987
3063
  o,
2988
3064
  u,
2989
3065
  r
2990
3066
  );
2991
- c = y?.handler ?? null, f = y?.cleanup, d = n.triggerType === "once";
3067
+ f = y?.handler ?? null, l = y?.cleanup, d = n.triggerType === "once";
2992
3068
  }
2993
- if (!c)
3069
+ if (!f)
2994
3070
  return;
2995
- const m = c, p = new AbortController();
2996
- function h(y, $, E) {
2997
- const b = Yi($, e, m);
2998
- y.addEventListener($, b, { ...E, signal: p.signal });
3071
+ const h = f, p = new AbortController();
3072
+ function m(y, b, E) {
3073
+ const S = fo(b, e, h);
3074
+ y.addEventListener(b, S, { ...E, signal: p.signal });
2999
3075
  }
3000
3076
  const v = { source: e, target: t, cleanup: () => {
3001
- p.abort(), f?.();
3077
+ p.abort(), l?.();
3002
3078
  } };
3003
- if (q(We, e, v), q(We, t, v), u) {
3004
- const y = a.enter, $ = a.leave;
3005
- y.forEach((S) => {
3006
- S === "focusin" && (e.tabIndex = 0), h(e, S, { passive: !0, once: d });
3079
+ if (k(Ue, e, v), k(Ue, t, v), u) {
3080
+ const y = a.enter, b = a.leave;
3081
+ y.forEach(($) => {
3082
+ $ === "focusin" && (e.tabIndex = 0), m(e, $, { passive: !0, once: d });
3007
3083
  });
3008
3084
  const E = !n.stateAction || n.stateAction === "toggle";
3009
- (l ? E : n.triggerType !== "once") && $.forEach((S) => {
3010
- if (S === "focusout") {
3011
- h(e, S, { once: d });
3085
+ (c ? E : n.triggerType !== "once") && b.forEach(($) => {
3086
+ if ($ === "focusout") {
3087
+ m(e, $, { once: d });
3012
3088
  return;
3013
3089
  }
3014
- h(e, S, { passive: !0 });
3090
+ m(e, $, { passive: !0 });
3015
3091
  });
3016
3092
  } else
3017
- (a.toggle ?? []).forEach(($) => {
3018
- h(e, $, { once: d, passive: $ !== "keydown" });
3093
+ (a.toggle ?? []).forEach((b) => {
3094
+ m(e, b, { once: d, passive: b !== "keydown" });
3019
3095
  });
3020
3096
  }
3021
- function Ji(e) {
3022
- ae(We, e);
3097
+ function go(e) {
3098
+ le(Ue, e);
3023
3099
  }
3024
- const Z = {
3025
- add: Zi,
3026
- remove: Ji
3027
- }, Ve = {
3100
+ const ee = {
3101
+ add: po,
3102
+ remove: go
3103
+ }, Ke = {
3028
3104
  click: ["click"],
3029
3105
  activate: ["click", "keydown"],
3030
3106
  hover: { enter: ["mouseenter"], leave: ["mouseleave"] },
@@ -3032,40 +3108,40 @@ const Z = {
3032
3108
  enter: ["mouseenter", "focusin"],
3033
3109
  leave: ["mouseleave", "focusout"]
3034
3110
  }
3035
- }, vt = {
3036
- click: Ve.activate,
3037
- hover: Ve.interest
3111
+ }, _t = {
3112
+ click: Ke.activate,
3113
+ hover: Ke.interest
3038
3114
  };
3039
- function he(e) {
3040
- const t = Ve[e];
3115
+ function ve(e) {
3116
+ const t = Ke[e];
3041
3117
  return (n, s, i, o, r) => {
3042
- const a = r?.allowA11yTriggers && e in vt ? vt[e] : t;
3043
- Z.add(n, s, i, { eventConfig: a }, r ?? {});
3118
+ const a = r?.allowA11yTriggers && e in _t ? _t[e] : t;
3119
+ ee.add(n, s, i, { eventConfig: a }, r ?? {});
3044
3120
  };
3045
3121
  }
3046
- const W = {
3047
- viewEnter: Js,
3122
+ const D = {
3123
+ viewEnter: li,
3048
3124
  hover: {
3049
- add: he("hover"),
3050
- remove: Z.remove
3125
+ add: ve("hover"),
3126
+ remove: ee.remove
3051
3127
  },
3052
3128
  click: {
3053
- add: he("click"),
3054
- remove: Z.remove
3129
+ add: ve("click"),
3130
+ remove: ee.remove
3055
3131
  },
3056
- animationEnd: zi,
3057
- viewProgress: Ei,
3058
- pointerMove: Ni,
3132
+ animationEnd: so,
3133
+ viewProgress: Ai,
3134
+ pointerMove: Xi,
3059
3135
  activate: {
3060
- add: he("activate"),
3061
- remove: Z.remove
3136
+ add: ve("activate"),
3137
+ remove: ee.remove
3062
3138
  },
3063
3139
  interest: {
3064
- add: he("interest"),
3065
- remove: Z.remove
3140
+ add: ve("interest"),
3141
+ remove: ee.remove
3066
3142
  }
3067
3143
  };
3068
- function eo(e) {
3144
+ function vo(e) {
3069
3145
  return e.replace(/\[[^\]]+]/g, "[]");
3070
3146
  }
3071
3147
  class w {
@@ -3093,7 +3169,7 @@ class w {
3093
3169
  if (typeof window > "u" || !window.customElements)
3094
3170
  return;
3095
3171
  const s = n?.useCustomElement ?? !!w.defineInteractElement;
3096
- this.dataCache = so(t, s, {
3172
+ this.dataCache = wo(t, s, {
3097
3173
  configIndex: n?.configIndex,
3098
3174
  forceReducedMotion: n?.forceReducedMotion ?? w.forceReducedMotion,
3099
3175
  reducedMotionPolicy: n?.reducedMotionPolicy ?? w.reducedMotionPolicy
@@ -3123,7 +3199,7 @@ class w {
3123
3199
  return !!this.get(t);
3124
3200
  }
3125
3201
  get(t) {
3126
- const n = eo(t);
3202
+ const n = vo(t);
3127
3203
  return this.dataCache.interactions[n];
3128
3204
  }
3129
3205
  clearMediaQueryListenersForKey(t) {
@@ -3132,7 +3208,7 @@ class w {
3132
3208
  }
3133
3209
  clearInteractionStateForKey(t) {
3134
3210
  (this.get(t)?.interactionIds || []).forEach((i) => {
3135
- const o = A(i, t);
3211
+ const o = R(i, t);
3136
3212
  delete this.addedInteractions[o];
3137
3213
  });
3138
3214
  const s = `${t}::seq::`;
@@ -3156,11 +3232,11 @@ class w {
3156
3232
  }), w.instances.length = 0, w.controllerCache.clear(), w.sequenceCache.clear(), w.elementSequenceMap = /* @__PURE__ */ new WeakMap(), w._released.clear();
3157
3233
  }
3158
3234
  static setup(t) {
3159
- t.scrollOptionsGetter && W.viewProgress.registerOptionsGetter?.(
3235
+ t.scrollOptionsGetter && D.viewProgress.registerOptionsGetter?.(
3160
3236
  t.scrollOptionsGetter
3161
- ), t.pointerOptionsGetter && W.pointerMove.registerOptionsGetter?.(
3237
+ ), t.pointerOptionsGetter && D.pointerMove.registerOptionsGetter?.(
3162
3238
  t.pointerOptionsGetter
3163
- ), t.viewEnter && W.viewEnter.setOptions(
3239
+ ), t.viewEnter && D.viewEnter.setOptions(
3164
3240
  t.viewEnter
3165
3241
  ), t.allowA11yTriggers !== void 0 && (w.allowA11yTriggers = t.allowA11yTriggers), t.forceReducedMotion !== void 0 && (w.forceReducedMotion = t.forceReducedMotion), t.reducedMotionPolicy !== void 0 && (w.reducedMotionPolicy = t.reducedMotionPolicy);
3166
3242
  }
@@ -3176,15 +3252,15 @@ class w {
3176
3252
  static deleteController(t) {
3177
3253
  w.controllerCache.delete(t);
3178
3254
  }
3179
- static registerEffects = ts;
3180
- static getRegisteredEffect = Qe;
3255
+ static registerEffects = ds;
3256
+ static getRegisteredEffect = Ze;
3181
3257
  /**
3182
3258
  * Registers a plugin under a name. When the config carries a plugin field (e.g. `$splitText`) with a matching key
3183
3259
  * (on an interaction or effect), Interact invokes the plugin with the field's value and a
3184
3260
  * context. Interact is agnostic to what the plugin does — see the `InteractPlugin` type.
3185
3261
  *
3186
- * With `options.defer`, the plugin — and every interaction, effect, or sequence carrying its
3187
- * field — is deferred until each named event is released via `Interact.ready()`.
3262
+ * With `options.defer`, the plugin — and every interaction carrying its field, on itself or on
3263
+ * one of its effects or sequences — is deferred until each named event is released via `Interact.ready()`.
3188
3264
  */
3189
3265
  static use(t, n, s) {
3190
3266
  w.plugins.set(t, n);
@@ -3213,14 +3289,14 @@ class w {
3213
3289
  static getSequence(t, n, s) {
3214
3290
  const i = w.sequenceCache.get(t);
3215
3291
  if (i) return i;
3216
- const o = ls(n, s);
3292
+ const o = ws(n, s);
3217
3293
  return w.sequenceCache.set(t, o), w._registerSequenceElements(s, o), o;
3218
3294
  }
3219
3295
  static addToSequence(t, n, s) {
3220
3296
  const i = w.sequenceCache.get(t);
3221
3297
  if (!i) return !1;
3222
- const r = Lt(n).map((a, l) => ({
3223
- index: s[l] ?? i.animationGroups.length,
3298
+ const r = Gt(n).map((a, c) => ({
3299
+ index: s[c] ?? i.animationGroups.length,
3224
3300
  group: a
3225
3301
  }));
3226
3302
  return i.addGroups(r), w._registerSequenceElements(n, i), !0;
@@ -3247,8 +3323,8 @@ class w {
3247
3323
  }
3248
3324
  }
3249
3325
  }
3250
- let to = 0;
3251
- function V(e, {
3326
+ let yo = 0;
3327
+ function j(e, {
3252
3328
  asCombinator: t = !1,
3253
3329
  addItemFilter: n = !1,
3254
3330
  useFirstChild: s = !1
@@ -3260,10 +3336,10 @@ function V(e, {
3260
3336
  return e.selector;
3261
3337
  return s ? t ? "> :first-child" : ":scope > :first-child" : "";
3262
3338
  }
3263
- function yt(e) {
3339
+ function Tt(e) {
3264
3340
  return "sequenceId" in e && !("effects" in e);
3265
3341
  }
3266
- function Re(e, t) {
3342
+ function xe(e, t) {
3267
3343
  return e[t] || (e[t] = {
3268
3344
  triggers: [],
3269
3345
  effects: {},
@@ -3272,7 +3348,7 @@ function Re(e, t) {
3272
3348
  selectors: /* @__PURE__ */ new Set()
3273
3349
  }), e[t];
3274
3350
  }
3275
- function no(e, t, n) {
3351
+ function Eo(e, t, n) {
3276
3352
  const { effects: s = [] } = e;
3277
3353
  return s.some((i, o) => n.has(t(o))) ? {
3278
3354
  ...e,
@@ -3282,154 +3358,211 @@ function no(e, t, n) {
3282
3358
  })
3283
3359
  } : e;
3284
3360
  }
3285
- function so(e, t, n) {
3286
- const { configIndex: s } = n, { effects: i = {}, sequences: o = {}, conditions: r = {} } = e, a = {}, l = e.interactions ? Qt(e, n) : /* @__PURE__ */ new Map();
3287
- return e.interactions?.forEach((u, c) => {
3288
- const f = u.key, d = ++to, { effects: m, sequences: p, ...h } = u;
3289
- if (!f) {
3361
+ function wo(e, t, n) {
3362
+ const { configIndex: s } = n, { effects: i = {}, sequences: o = {}, conditions: r = {} } = e, a = {}, c = e.interactions ? rn(e, n) : /* @__PURE__ */ new Map();
3363
+ return e.interactions?.forEach((u, f) => {
3364
+ const l = u.key, d = ++yo, { effects: h, sequences: p, ...m } = u;
3365
+ if (!l) {
3290
3366
  console.error(`Interaction ${d} is missing a key for source element.`);
3291
3367
  return;
3292
3368
  }
3293
- Re(a, f);
3294
- const g = m ? Array.from(m) : [];
3369
+ xe(a, l);
3370
+ const g = h ? Array.from(h) : [];
3295
3371
  g.reverse();
3296
- const v = p?.map((E, b) => {
3297
- if (yt(E)) {
3298
- const T = o[E.sequenceId];
3299
- return T ? { ...T, ...E } : (console.warn(`Interact: Sequence "${E.sequenceId}" not found in config`), E);
3372
+ const v = p?.map((E, S) => {
3373
+ if (Tt(E)) {
3374
+ const _ = o[E.sequenceId];
3375
+ return _ ? { ..._, ...E } : (console.warn(`Interact: Sequence "${E.sequenceId}" not found in config`), E);
3300
3376
  }
3301
- const S = E;
3302
- return S.sequenceId || (S.sequenceId = J("seq", [c, b], s)), S;
3377
+ const $ = E;
3378
+ return $.sequenceId || ($.sequenceId = te("seq", [f, S], s)), $;
3303
3379
  }), y = {
3304
- ...h,
3380
+ ...m,
3305
3381
  effects: g.length > 0 ? g : void 0,
3306
3382
  sequences: v?.map(
3307
- (E, b) => no(
3383
+ (E, S) => Eo(
3308
3384
  E,
3309
- (S) => Ee(c, S, b),
3310
- l
3385
+ ($) => Se(f, $, S),
3386
+ c
3311
3387
  )
3312
3388
  )
3313
3389
  };
3314
- a[f].triggers.push(y), a[f].selectors.add(
3315
- V(y, { useFirstChild: t })
3390
+ a[l].triggers.push(y), a[l].selectors.add(
3391
+ j(y, { useFirstChild: t })
3316
3392
  );
3317
- const $ = y.listContainer;
3318
- g.forEach((E, b) => {
3319
- const S = E.effectId ? i[E.effectId] : void 0;
3320
- let T = E.key || S?.key;
3321
- const I = g.length - 1 - b;
3322
- E.effectId || (E.effectId = J(
3393
+ const b = y.listContainer;
3394
+ g.forEach((E, S) => {
3395
+ const $ = E.effectId ? i[E.effectId] : void 0;
3396
+ let _ = E.key || $?.key;
3397
+ const I = g.length - 1 - S;
3398
+ E.effectId || (E.effectId = te(
3323
3399
  "eff",
3324
- [c, I],
3400
+ [f, I],
3325
3401
  s
3326
3402
  ));
3327
- const P = l.get(Ee(c, I));
3328
- if (P && (E.suffix = P), T = T || f, E.key = T, $ && E.listContainer && (T !== f || E.listContainer !== $))
3403
+ const O = c.get(Se(f, I));
3404
+ if (O && (E.suffix = O), _ = _ || l, E.key = _, b && E.listContainer && (_ !== l || E.listContainer !== b))
3329
3405
  return;
3330
- const k = B({ ...S, ...E, key: T }), O = `${f}::${k}::${d}`;
3331
- if (E.interactionId = O, a[f].interactionIds.add(O), T === f)
3406
+ const C = B({ ...$, ...E, key: _ }), T = `${l}::${C}::${d}`;
3407
+ if (E.interactionId = T, a[l].interactionIds.add(T), _ === l)
3332
3408
  return;
3333
- const C = Re(a, T);
3334
- C.effects[O] || (C.effects[O] = [], C.interactionIds.add(O)), C.effects[O].push({ ...h, effect: E }), C.selectors.add(V(E, { useFirstChild: t }));
3409
+ const M = xe(a, _);
3410
+ M.effects[T] || (M.effects[T] = [], M.interactionIds.add(T)), M.effects[T].push({ ...m, effect: E, owner: y }), M.selectors.add(j(E, { useFirstChild: t }));
3335
3411
  }), v?.forEach((E) => {
3336
- if (!E || yt(E)) return;
3337
- const b = E, S = b.sequenceId;
3338
- b.effects.forEach((I, P) => {
3339
- I.effectId || (I.effectId = `eff-${S}-${P}`);
3340
- let k = I.key;
3341
- if (!k && I.effectId) {
3342
- const C = i[I.effectId];
3343
- C && (k = C.key);
3412
+ if (!E || Tt(E)) return;
3413
+ const S = E, $ = S.sequenceId;
3414
+ S.effects.forEach((I, O) => {
3415
+ I.effectId || (I.effectId = `eff-${$}-${O}`);
3416
+ let C = I.key;
3417
+ if (!C && I.effectId) {
3418
+ const M = i[I.effectId];
3419
+ M && (C = M.key);
3344
3420
  }
3345
- k = k || f;
3346
- const O = V(I, { useFirstChild: t });
3347
- if (O && a[f].selectors.add(O), k !== f) {
3348
- const C = Re(a, k), M = `${k}::seq::${S}::${d}`;
3349
- C.sequences[M] || (C.sequences[M] = [], C.interactionIds.add(M)), C.sequences[M].push({
3350
- ...h,
3351
- sequence: b
3352
- }), C.selectors.add(O);
3421
+ C = C || l;
3422
+ const T = j(I, { useFirstChild: t });
3423
+ if (T && a[l].selectors.add(T), C !== l) {
3424
+ const M = xe(a, C), P = `${C}::seq::${$}::${d}`;
3425
+ M.sequences[P] || (M.sequences[P] = [], M.interactionIds.add(P)), M.sequences[P].push({
3426
+ ...m,
3427
+ sequence: S,
3428
+ owner: y
3429
+ }), M.selectors.add(T);
3353
3430
  }
3354
3431
  });
3355
3432
  });
3356
3433
  }), {
3357
3434
  effects: i,
3358
3435
  sequences: o,
3359
- conditions: jt(r),
3436
+ conditions: Ut(r),
3360
3437
  reducedMotionPolicy: n.reducedMotionPolicy,
3361
3438
  forceReducedMotion: n.forceReducedMotion,
3362
3439
  interactions: a
3363
3440
  };
3364
3441
  }
3365
- function Me(e, t, n, s, i) {
3366
- const o = w.getPluginsNames();
3367
- for (const r of o) {
3368
- const a = `${Ke}${r}`;
3369
- if (!(a in n))
3370
- continue;
3371
- const l = n[a];
3372
- if (l !== null && typeof l == "object") {
3373
- if (e._appliedPlugins.has(l))
3374
- continue;
3375
- e._appliedPlugins.add(l);
3376
- }
3377
- const c = w.getPlugin(r)(l, { root: t, key: s, scope: i, config: n });
3378
- typeof c == "function" && e._pluginCleanups.push(c);
3379
- }
3442
+ const Te = /* @__PURE__ */ new WeakMap();
3443
+ function st(e) {
3444
+ return e !== null && (typeof e == "object" || typeof e == "function") && typeof e.then == "function";
3380
3445
  }
3381
- function z(e, t) {
3446
+ function it(e, t) {
3382
3447
  for (const n of w.getPluginsNames())
3383
- if (`${Ke}${n}` in t && !w._isPluginReleased(n, e))
3448
+ if (`${Xe}${n}` in t && !w._isPluginReleased(n, e))
3384
3449
  return !0;
3385
3450
  return !1;
3386
3451
  }
3387
- function Se(e, t, n) {
3452
+ function K(e, t, n, s, i, o = !0) {
3453
+ if (it(s, n))
3454
+ return !1;
3455
+ const r = [];
3456
+ for (const a of w.getPluginsNames()) {
3457
+ const c = `${Xe}${a}`;
3458
+ if (!(c in n))
3459
+ continue;
3460
+ const u = n[c], f = u !== null && typeof u == "object", l = f ? e._appliedPlugins.get(u) : void 0;
3461
+ if (l === !0)
3462
+ continue;
3463
+ if (l) {
3464
+ r.push(l);
3465
+ continue;
3466
+ }
3467
+ if (!o)
3468
+ continue;
3469
+ f && e._appliedPlugins.set(u, !0);
3470
+ const h = w.getPlugin(a)(u, { root: t, key: s, scope: i, config: n });
3471
+ if (st(h)) {
3472
+ const p = e._connectId, m = Promise.resolve(h).then(
3473
+ (g) => {
3474
+ if (e._connectId !== p) {
3475
+ try {
3476
+ typeof g == "function" && g();
3477
+ } catch (v) {
3478
+ console.error(v);
3479
+ }
3480
+ return;
3481
+ }
3482
+ typeof g == "function" && e._pluginCleanups.push(g), f && e._appliedPlugins.set(u, !0);
3483
+ },
3484
+ (g) => {
3485
+ console.error(g), f && e._connectId === p && e._appliedPlugins.set(u, !0);
3486
+ }
3487
+ );
3488
+ f && (e._appliedPlugins.set(u, m), r.push(m));
3489
+ } else typeof h == "function" && e._pluginCleanups.push(h);
3490
+ }
3491
+ return ot(...r);
3492
+ }
3493
+ function X(e, t, n, s, i, o) {
3494
+ if (st(e)) {
3495
+ const f = s._connectId, l = t._connectId, d = Te.get(t);
3496
+ e.then(() => {
3497
+ s.connected && s._connectId === f && t._connectId === l && Te.get(t) === d && t.resume();
3498
+ });
3499
+ }
3500
+ const r = D[n.trigger], a = r?.latch;
3501
+ if (!a)
3502
+ return;
3503
+ let c, u;
3504
+ i ? c = En(n, s, o) : r.latchesSubtree && (n.selector || n.listContainer) ? (c = s.element, u = j(n)) : c = ae(
3505
+ n,
3506
+ s.element,
3507
+ s.useFirstChild,
3508
+ !1
3509
+ ), c && (Array.isArray(c) ? c : [c]).forEach((f) => {
3510
+ const l = a(f, n.params, u);
3511
+ l && s._latches.push({ element: f, release: l });
3512
+ });
3513
+ }
3514
+ function bo(e) {
3515
+ e._latches = e._latches.filter(({ element: t, release: n }) => e.element.contains(t) ? !0 : (n(), !1));
3516
+ }
3517
+ function ot(...e) {
3518
+ const t = e.filter(st);
3519
+ return t.length ? Promise.all(t).then(() => {
3520
+ }) : e.every(Boolean);
3521
+ }
3522
+ function ae(e, t, n, s = !0) {
3388
3523
  if (e.listContainer) {
3389
- const s = t.querySelector(e.listContainer);
3390
- 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}"`), []);
3524
+ const i = t.querySelector(e.listContainer);
3525
+ return i ? e.selector ? Array.from(i.querySelectorAll(e.selector)) : Array.from(i.children) : (s && console.warn(`Interact: No container found for list container "${e.listContainer}"`), []);
3391
3526
  }
3392
3527
  if (e.selector) {
3393
- const s = t.querySelectorAll(e.selector);
3394
- if (s.length > 0)
3395
- return Array.from(s);
3396
- console.warn(`Interact: No elements found for selector "${e.selector}"`);
3528
+ const i = t.querySelectorAll(e.selector);
3529
+ return i.length > 0 ? Array.from(i) : (s && console.warn(`Interact: No elements found for selector "${e.selector}"`), null);
3397
3530
  }
3398
3531
  return n ? t.firstElementChild : t;
3399
3532
  }
3400
- function be(e, t) {
3533
+ function Me(e, t) {
3401
3534
  return t.map((n) => e.selector ? n.querySelector(e.selector) : n).filter(Boolean);
3402
3535
  }
3403
- function _e(e, t, n, s = {}) {
3404
- const { effects: i, conditions: o, reducedMotionPolicy: r, forceReducedMotion: a } = t.dataCache, l = zt(
3536
+ function ke(e, t, n, s = {}) {
3537
+ const { effects: i, conditions: o, reducedMotionPolicy: r, forceReducedMotion: a } = t.dataCache, c = Kt(
3405
3538
  e,
3406
- Te(e.reducedMotionPolicy, s.policy, r),
3539
+ Pe(e.reducedMotionPolicy, s.policy, r),
3407
3540
  { effects: i, force: a, collapsesStagger: s.collapsesStagger }
3408
3541
  );
3409
3542
  let u;
3410
- return l.forEach((c, f) => {
3411
- const d = F(c.conditions || [], o);
3543
+ return c.forEach((f, l) => {
3544
+ const d = H(f.conditions || [], o);
3412
3545
  d && t.setupMediaQueryListener(
3413
- f ? `${n.id}::rm${f}` : n.id,
3546
+ l ? `${n.id}::rm${l}` : n.id,
3414
3547
  d,
3415
3548
  n.key,
3416
3549
  n.onUpdate
3417
- ), !u && (!d || d.matches) && (u = c);
3550
+ ), !u && (!d || d.matches) && (u = f);
3418
3551
  }), u;
3419
3552
  }
3420
- function on(e, t, n, s, i, o, r, a) {
3553
+ function dn(e, t, n, s, i, o, r, a) {
3421
3554
  return [
3422
- r ? be(e, r) : Se(e, n, s),
3423
- a ? be(t, a) : Se(t, i, o)
3555
+ r ? Me(e, r) : ae(e, n, s),
3556
+ a ? Me(t, a) : ae(t, i, o)
3424
3557
  ];
3425
3558
  }
3426
- function rn(e, t, n, s, i, o, r, a) {
3427
- const l = Array.isArray(s), u = Array.isArray(i);
3428
- l ? s.forEach((c, f) => {
3429
- const d = u ? i[f] : i;
3430
- d && Et(
3559
+ function hn(e, t, n, s, i, o, r, a) {
3560
+ const c = Array.isArray(s), u = Array.isArray(i);
3561
+ c ? s.forEach((f, l) => {
3562
+ const d = u ? i[l] : i;
3563
+ d && Mt(
3431
3564
  e,
3432
- c,
3565
+ f,
3433
3566
  t.trigger,
3434
3567
  d,
3435
3568
  n,
@@ -3438,12 +3571,12 @@ function rn(e, t, n, s, i, o, r, a) {
3438
3571
  r,
3439
3572
  a
3440
3573
  );
3441
- }) : (u ? i : [i]).forEach((f) => {
3442
- Et(
3574
+ }) : (u ? i : [i]).forEach((l) => {
3575
+ Mt(
3443
3576
  e,
3444
3577
  s,
3445
3578
  t.trigger,
3446
- f,
3579
+ l,
3447
3580
  n,
3448
3581
  t.params,
3449
3582
  o,
@@ -3452,21 +3585,21 @@ function rn(e, t, n, s, i, o, r, a) {
3452
3585
  );
3453
3586
  });
3454
3587
  }
3455
- function an(e, t, n, s, i) {
3588
+ function $o(e, t, n, s, i) {
3456
3589
  const o = {}, r = [];
3457
- (s.effects || []).forEach((a, l) => {
3458
- const u = a.effectId, c = {
3590
+ return (s.effects || []).forEach((a, c) => {
3591
+ const u = a.effectId, f = {
3459
3592
  ...n.dataCache.effects[u] || {},
3460
3593
  ...a,
3461
3594
  effectId: u
3462
- }, f = c.key, d = A(a.interactionId, e);
3595
+ }, l = f.key, d = R(a.interactionId, e);
3463
3596
  if (o[d] || n.addedInteractions[d] && !i)
3464
3597
  return;
3465
- const m = _e(
3466
- c,
3598
+ const h = ke(
3599
+ f,
3467
3600
  n,
3468
3601
  {
3469
- id: `${d}::${l}`,
3602
+ id: `${d}::${c}`,
3470
3603
  key: e,
3471
3604
  onUpdate: () => {
3472
3605
  t.update();
@@ -3474,130 +3607,202 @@ function an(e, t, n, s, i) {
3474
3607
  },
3475
3608
  { policy: s.reducedMotionPolicy }
3476
3609
  );
3477
- if (m) {
3610
+ if (h) {
3478
3611
  o[d] = !0;
3479
- const p = f && A(f, e);
3480
- let h;
3481
- if (p) {
3482
- if (h = w.getController(p), !h)
3483
- return;
3484
- m.listContainer && h.watchChildList(m.listContainer);
3485
- } else
3486
- h = t;
3487
- if (z(p || s.key, m))
3488
- return;
3489
- Me(
3490
- h,
3491
- h.element,
3492
- m,
3493
- p || s.key,
3494
- "effect"
3495
- );
3496
- const [g, v] = on(
3497
- s,
3498
- m,
3499
- t.element,
3500
- t.useFirstChild,
3501
- h.element,
3502
- h.useFirstChild,
3503
- i
3504
- );
3505
- if (!g || !v)
3506
- return;
3507
- n.addedInteractions[d] = !0;
3508
- const y = p || s.key, $ = x(
3509
- m.conditions || [],
3510
- n.dataCache.conditions
3511
- );
3512
- r.push([
3513
- y,
3514
- s,
3515
- m,
3516
- g,
3517
- v,
3518
- $,
3519
- h.useFirstChild,
3520
- e
3521
- ]);
3612
+ const p = l && R(l, e);
3613
+ let m;
3614
+ p ? (m = w.getController(p), m && h.listContainer && m.watchChildList(h.listContainer)) : m = t, r.push({ interactionId: d, effectOptions: h, target: p, targetController: m });
3522
3615
  }
3523
- }), r.reverse().forEach((a) => {
3524
- rn(...a);
3525
- }), oo(e, t, n, s, i);
3616
+ }), r;
3617
+ }
3618
+ function So(e, t, n, s, i) {
3619
+ const o = [];
3620
+ return s.sequences?.forEach((r) => {
3621
+ let a;
3622
+ if (To(r)) {
3623
+ const d = n.dataCache.sequences[r.sequenceId];
3624
+ if (!d) {
3625
+ console.warn(`Interact: Sequence "${r.sequenceId}" not found in cache`);
3626
+ return;
3627
+ }
3628
+ a = { ...d, ...r };
3629
+ } else
3630
+ a = r;
3631
+ const c = a.sequenceId || ie(), u = R(`${e}::seq::${c}`, e);
3632
+ if (n.addedInteractions[u] && !i) return;
3633
+ const f = pn(
3634
+ a,
3635
+ s,
3636
+ u,
3637
+ e,
3638
+ n,
3639
+ {
3640
+ updateKey: e,
3641
+ onUpdate: () => t.update()
3642
+ }
3643
+ );
3644
+ if (!f) return;
3645
+ const l = i && s.listContainer && n.addedInteractions[u] ? { controllerKey: e, listContainer: s.listContainer, elements: i } : void 0;
3646
+ o.push({ sequenceConfig: a, cacheKey: u, listElements: l, effects: f });
3647
+ }), o;
3648
+ }
3649
+ function Io(e, t, n, s, i) {
3650
+ const o = $o(e, t, n, s, i), r = So(e, t, n, s, i);
3651
+ if (o.some(
3652
+ ({ effectOptions: l, target: d }) => it(d || s.key, l)
3653
+ ) || r.some((l) => gn(l.effects, e)))
3654
+ return { readiness: !1, effects: [], sequences: [] };
3655
+ const c = o.filter(
3656
+ (l) => !!l.targetController
3657
+ ), u = c.map(
3658
+ ({ effectOptions: l, target: d, targetController: h }) => K(
3659
+ h,
3660
+ h.element,
3661
+ l,
3662
+ d || s.key,
3663
+ "effect"
3664
+ )
3665
+ ), f = [];
3666
+ return r.forEach((l) => {
3667
+ const d = vn(l.effects, e, t);
3668
+ d && (f.push({ ...l, effects: d }), u.push(...d.map((h) => h.readiness)));
3669
+ }), {
3670
+ readiness: ot(...u),
3671
+ effects: c,
3672
+ sequences: f
3673
+ };
3526
3674
  }
3527
- function cn(e, t, n) {
3528
- return Te(
3675
+ function rt(e, t, n, s, i, o = t) {
3676
+ const r = Io(
3677
+ e,
3678
+ t,
3679
+ n,
3680
+ s,
3681
+ i
3682
+ );
3683
+ if (r.readiness !== !0) {
3684
+ X(r.readiness, o, s, t, !0, i);
3685
+ return;
3686
+ }
3687
+ const a = [];
3688
+ r.effects.forEach(({ interactionId: c, effectOptions: u, target: f, targetController: l }) => {
3689
+ const [d, h] = dn(
3690
+ s,
3691
+ u,
3692
+ t.element,
3693
+ t.useFirstChild,
3694
+ l.element,
3695
+ l.useFirstChild,
3696
+ // An item pass only extends an attached effect. Until then it attaches to every item at once —
3697
+ // marking it added for the new items alone would make the full pass skip the others (e.g. the
3698
+ // one about to resume once an async plugin settled).
3699
+ n.addedInteractions[c] ? i : void 0
3700
+ );
3701
+ if (!d || !h)
3702
+ return;
3703
+ n.addedInteractions[c] = !0;
3704
+ const p = f || s.key, m = U(
3705
+ u.conditions || [],
3706
+ n.dataCache.conditions
3707
+ );
3708
+ a.push([
3709
+ p,
3710
+ s,
3711
+ u,
3712
+ d,
3713
+ h,
3714
+ m,
3715
+ l.useFirstChild,
3716
+ e
3717
+ ]);
3718
+ }), a.reverse().forEach((c) => {
3719
+ hn(...c);
3720
+ }), Oo(t, n, s, r.sequences, i);
3721
+ }
3722
+ function mn(e, t, n) {
3723
+ return Pe(
3529
3724
  e.reducedMotionPolicy,
3530
3725
  t.reducedMotionPolicy,
3531
3726
  n.dataCache.reducedMotionPolicy
3532
3727
  );
3533
3728
  }
3534
- function Be(e, t, n) {
3535
- const { forceReducedMotion: s, conditions: i } = n.dataCache, o = F([Ie], i);
3536
- return (s || !!(o && o.matches)) && cn(e, t, n) !== "ignore" ? { ...e, offset: 0 } : e;
3729
+ function _o(e, t, n) {
3730
+ const { forceReducedMotion: s, conditions: i } = n.dataCache, o = H([Oe], i);
3731
+ return (s || !!(o && o.matches)) && mn(e, t, n) !== "ignore" ? { ...e, offset: 0 } : e;
3537
3732
  }
3538
- function io(e) {
3733
+ function To(e) {
3539
3734
  return "sequenceId" in e && !("effects" in e);
3540
3735
  }
3541
- function ln(e, t, n, s, i, o, r, a) {
3542
- const l = F(e.conditions || [], o.dataCache.conditions);
3543
- if (l && o.setupMediaQueryListener(n, l, r.updateKey, r.onUpdate), l && !l.matches) return null;
3544
- const u = e.effects || [], c = (h) => {
3545
- const g = h.effectId;
3546
- return { ...g ? o.dataCache.effects[g] || {} : {}, ...h };
3547
- };
3548
- if (u.some((h) => {
3549
- const g = c(h), v = F(g.conditions || [], o.dataCache.conditions);
3550
- if (v && !v.matches) return !1;
3551
- const y = g.key && A(g.key, s);
3552
- return z(y || s, g);
3553
- }))
3554
- return null;
3555
- const d = [], m = cn(e, t, o);
3556
- let p = !1;
3557
- for (const h of u) {
3558
- const g = h.effectId, v = _e(
3559
- c(h),
3560
- o,
3736
+ function pn(e, t, n, s, i, o) {
3737
+ const r = H(e.conditions || [], i.dataCache.conditions);
3738
+ if (r && i.setupMediaQueryListener(n, r, o.updateKey, o.onUpdate), r && !r.matches) return null;
3739
+ const a = e.effects || [], c = (l) => {
3740
+ const d = l.effectId;
3741
+ return { ...d ? i.dataCache.effects[d] || {} : {}, ...l };
3742
+ }, u = mn(e, t, i), f = [];
3743
+ for (const l of a) {
3744
+ const d = l.effectId, h = ke(
3745
+ c(l),
3746
+ i,
3561
3747
  {
3562
- id: `${n}::${g || "eff"}`,
3563
- key: r.updateKey,
3564
- onUpdate: r.onUpdate
3748
+ id: `${n}::${d || "eff"}`,
3749
+ key: o.updateKey,
3750
+ onUpdate: o.onUpdate
3565
3751
  },
3566
- { policy: m, collapsesStagger: m !== "ignore" }
3752
+ { policy: u, collapsesStagger: u !== "ignore" }
3567
3753
  );
3568
- if (!v) continue;
3569
- const y = v.key, $ = y && A(y, s);
3570
- let E;
3571
- if ($) {
3572
- if (E = w.getController($), !E) return null;
3754
+ if (!h) continue;
3755
+ const p = h.key && R(h.key, s);
3756
+ f.push({ effectOptions: h, target: p });
3757
+ }
3758
+ return f;
3759
+ }
3760
+ function gn(e, t) {
3761
+ return e.some(
3762
+ ({ effectOptions: n, target: s }) => it(s || t, n)
3763
+ );
3764
+ }
3765
+ function vn(e, t, n) {
3766
+ const s = [];
3767
+ for (const { effectOptions: i, target: o } of e) {
3768
+ let r;
3769
+ if (o) {
3770
+ if (r = w.getController(o), !r) return null;
3573
3771
  } else
3574
- E = i;
3575
- const b = $ || s;
3576
- Me(
3577
- E,
3578
- E.element,
3579
- v,
3580
- b,
3772
+ r = n;
3773
+ const a = o || t, c = K(
3774
+ r,
3775
+ r.element,
3776
+ i,
3777
+ a,
3581
3778
  "effect"
3582
3779
  );
3583
- let S;
3584
- if (a && b === a.controllerKey && v.listContainer === a.listContainer ? (S = be(v, a.elements), S.length > 0 && (p = !0)) : S = Se(
3585
- v,
3586
- E.element,
3587
- E.useFirstChild
3588
- ), !S || Array.isArray(S) && S.length === 0) return null;
3589
- const T = N(v);
3590
- d.push({ target: S, options: T });
3591
- }
3592
- return a && !p ? null : d.length > 0 ? d : null;
3593
- }
3594
- function Ye(e, t, n) {
3595
- const s = n ? be(e, n) : Se(e, t.element, t.useFirstChild);
3780
+ s.push({ effectOptions: i, targetController: r, resolvedTargetKey: a, readiness: c });
3781
+ }
3782
+ return s;
3783
+ }
3784
+ function yn(e, t) {
3785
+ const n = [];
3786
+ let s = !1;
3787
+ for (const { effectOptions: i, targetController: o, resolvedTargetKey: r } of e) {
3788
+ let a;
3789
+ if (t && r === t.controllerKey && i.listContainer === t.listContainer ? (a = Me(i, t.elements), a.length > 0 && (s = !0)) : a = ae(
3790
+ i,
3791
+ o.element,
3792
+ o.useFirstChild
3793
+ ), !a || Array.isArray(a) && a.length === 0) return null;
3794
+ const c = x(i);
3795
+ n.push({ target: a, options: c });
3796
+ }
3797
+ return t && !s ? null : n.length > 0 ? n : null;
3798
+ }
3799
+ function En(e, t, n) {
3800
+ const s = n ? Me(e, n) : ae(e, t.element, t.useFirstChild);
3596
3801
  return Array.isArray(s) && s.length === 0 ? null : s;
3597
3802
  }
3598
- function Ue(e, t, n, s, i) {
3803
+ function Mo(e, t, n, s, i) {
3599
3804
  (Array.isArray(n) ? n : [n]).forEach((r) => {
3600
- W[e.trigger]?.add(
3805
+ D[e.trigger]?.add(
3601
3806
  r,
3602
3807
  r,
3603
3808
  { triggerType: t.triggerType },
@@ -3610,224 +3815,196 @@ function Ue(e, t, n, s, i) {
3610
3815
  );
3611
3816
  });
3612
3817
  }
3613
- function un(e, t, n) {
3818
+ function wn(e, t, n) {
3614
3819
  const o = (e.useFirstChild ? e.element.firstElementChild : e.element)?.querySelector(t);
3615
- if (!o) return n.map((a, l) => l);
3820
+ if (!o) return n.map((a, c) => c);
3616
3821
  const r = Array.from(o.children);
3617
3822
  return n.map((a) => {
3618
- const l = r.indexOf(a);
3619
- return l >= 0 ? l : r.length;
3823
+ const c = r.indexOf(a);
3824
+ return c >= 0 ? c : r.length;
3620
3825
  });
3621
3826
  }
3622
- function oo(e, t, n, s, i) {
3623
- s.sequences?.forEach((o) => {
3624
- let r;
3625
- if (io(o)) {
3626
- const p = n.dataCache.sequences[o.sequenceId];
3627
- if (!p) {
3628
- console.warn(`Interact: Sequence "${o.sequenceId}" not found in cache`);
3629
- return;
3630
- }
3631
- r = { ...p, ...o };
3632
- } else
3633
- r = o;
3634
- const a = r.sequenceId || ne(), l = A(`${e}::seq::${a}`, e);
3635
- if (n.addedInteractions[l] && !i) return;
3636
- const u = i && s.listContainer ? { controllerKey: e, listContainer: s.listContainer, elements: i } : void 0, c = ln(
3827
+ function Oo(e, t, n, s, i) {
3828
+ s.forEach(({ sequenceConfig: o, cacheKey: r, listElements: a, effects: c }) => {
3829
+ const u = yn(c, a);
3830
+ if (!u) return;
3831
+ const f = t.addedInteractions[r] ? i : void 0;
3832
+ if (f) {
3833
+ const p = wn(e, n.listContainer, f);
3834
+ w.addToSequence(r, u, p);
3835
+ }
3836
+ const l = w.getSequence(
3637
3837
  r,
3638
- s,
3639
- l,
3640
- e,
3641
- t,
3642
- n,
3643
- {
3644
- updateKey: e,
3645
- onUpdate: () => t.update()
3646
- },
3838
+ _o(o, n, t),
3647
3839
  u
3648
- );
3649
- if (!c) return;
3650
- if (i && n.addedInteractions[l]) {
3651
- const p = un(
3652
- t,
3653
- s.listContainer,
3654
- i
3655
- );
3656
- w.addToSequence(l, c, p);
3657
- const h = w.getSequence(
3658
- l,
3659
- Be(r, s, n),
3660
- c
3661
- ), g = x(
3662
- s.conditions || [],
3663
- n.dataCache.conditions
3664
- ), v = Ye(s, t, i);
3665
- v && Ue(
3666
- s,
3667
- r,
3668
- v,
3669
- h,
3670
- g
3671
- );
3672
- return;
3673
- }
3674
- const f = w.getSequence(
3840
+ ), d = U(
3841
+ n.conditions || [],
3842
+ t.dataCache.conditions
3843
+ ), h = En(n, e, f);
3844
+ h && (t.addedInteractions[r] = !0, Mo(
3845
+ n,
3846
+ o,
3847
+ h,
3675
3848
  l,
3676
- Be(r, s, n),
3677
- c
3678
- ), d = x(
3679
- s.conditions || [],
3680
- n.dataCache.conditions
3681
- ), m = Ye(s, t, i);
3682
- m && (n.addedInteractions[l] = !0, Ue(
3683
- s,
3684
- r,
3685
- m,
3686
- f,
3687
3849
  d
3688
3850
  ));
3689
3851
  });
3690
3852
  }
3691
- function ro(e, t, n, s, i) {
3853
+ function bn(e, t, n, s, i, o) {
3854
+ const r = K(
3855
+ s,
3856
+ s.element,
3857
+ t,
3858
+ n,
3859
+ "interaction"
3860
+ );
3861
+ return r !== !0 ? (X(r, i, t, s, !1), !1) : o.addedInteractions[e] ? !0 : (rt(n, s, o, t, void 0, i), !1);
3862
+ }
3863
+ function Po(e, t, n, s, i) {
3692
3864
  const o = n.get(e)?.sequences || {};
3693
3865
  Object.keys(o).forEach((a) => {
3694
- o[a].some(({ sequence: u, ...c }) => {
3695
- const f = F(
3696
- c.conditions || [],
3866
+ o[a].some(({ sequence: u, owner: f, ...l }) => {
3867
+ const d = H(
3868
+ l.conditions || [],
3697
3869
  n.dataCache.conditions
3698
3870
  );
3699
- if (f && !f.matches)
3871
+ if (d && !d.matches)
3700
3872
  return !1;
3701
- const d = c.key && A(c.key, e), m = w.getController(d);
3702
- if (!m)
3873
+ const h = l.key && R(l.key, e), p = w.getController(h);
3874
+ if (!p)
3703
3875
  return !0;
3704
- const p = u.sequenceId || ne(), h = A(`${d}::seq::${p}`, d);
3705
- if (n.addedInteractions[h] && !i || z(d, c))
3876
+ const m = u.sequenceId || ie(), g = R(`${h}::seq::${m}`, h);
3877
+ if (n.addedInteractions[g] && !i || !bn(
3878
+ g,
3879
+ f,
3880
+ h,
3881
+ p,
3882
+ t,
3883
+ n
3884
+ ))
3706
3885
  return !0;
3707
- const v = ln(
3886
+ const v = pn(
3708
3887
  u,
3709
- c,
3888
+ l,
3889
+ g,
3710
3890
  h,
3711
- d,
3712
- m,
3713
3891
  n,
3714
- {
3715
- updateKey: e,
3716
- onUpdate: () => t.update()
3717
- },
3718
- i && s ? { controllerKey: e, listContainer: s, elements: i } : void 0
3892
+ { updateKey: e, onUpdate: () => t.update() }
3719
3893
  );
3720
3894
  if (!v) return !0;
3721
- if (i && n.addedInteractions[h]) {
3722
- const b = un(t, s, i);
3723
- return w.addToSequence(h, v, b), !0;
3895
+ const y = gn(v, h) ? null : vn(v, h, p), b = y ? ot(...y.map((S) => S.readiness)) : !1;
3896
+ if (b !== !0)
3897
+ return X(b, t, l, p, !0), !0;
3898
+ const E = yn(y, {
3899
+ controllerKey: e,
3900
+ listContainer: s,
3901
+ elements: i
3902
+ });
3903
+ if (E) {
3904
+ const S = wn(t, s, i);
3905
+ w.addToSequence(g, E, S);
3724
3906
  }
3725
- const y = w.getSequence(
3726
- h,
3727
- Be(u, c, n),
3728
- v
3729
- ), $ = x(
3730
- c.conditions || [],
3731
- n.dataCache.conditions
3732
- ), E = Ye(c, m);
3733
- return E && (n.addedInteractions[h] = !0, Ue(
3734
- c,
3735
- u,
3736
- E,
3737
- y,
3738
- $
3739
- )), !0;
3907
+ return !0;
3740
3908
  });
3741
3909
  });
3742
3910
  }
3743
- function fn(e, t, n, s, i) {
3744
- const o = n.get(e), r = o?.effects || {}, a = Object.keys(r), l = [];
3745
- a.forEach((c) => {
3746
- const f = A(c, e);
3747
- if (n.addedInteractions[f] && !i)
3911
+ function $n(e, t, n, s, i) {
3912
+ const o = n.get(e), r = o?.effects || {}, a = Object.keys(r), c = [];
3913
+ a.forEach((f) => {
3914
+ const l = R(f, e);
3915
+ if (n.addedInteractions[l] && !i)
3748
3916
  return;
3749
- r[c].some(({ effect: m, ...p }, h) => {
3750
- const g = F(
3751
- p.conditions || [],
3917
+ r[f].some(({ effect: h, owner: p, ...m }, g) => {
3918
+ const v = H(
3919
+ m.conditions || [],
3752
3920
  n.dataCache.conditions
3753
3921
  );
3754
- if (g && !g.matches)
3922
+ if (v && !v.matches)
3755
3923
  return !1;
3756
- const v = m.effectId, y = {
3757
- ...n.dataCache.effects[v] || {},
3758
- ...m,
3759
- effectId: v
3924
+ const y = h.effectId, b = {
3925
+ ...n.dataCache.effects[y] || {},
3926
+ ...h,
3927
+ effectId: y
3760
3928
  };
3761
- if (s && y.listContainer !== s)
3929
+ if (s && b.listContainer !== s)
3762
3930
  return !1;
3763
- const $ = _e(
3764
- y,
3931
+ const E = ke(
3932
+ b,
3765
3933
  n,
3766
3934
  {
3767
- id: `${f}::${h}`,
3935
+ id: `${l}::${g}`,
3768
3936
  key: e,
3769
3937
  onUpdate: () => {
3770
3938
  t.update();
3771
3939
  }
3772
3940
  },
3773
- { policy: p.reducedMotionPolicy }
3941
+ { policy: m.reducedMotionPolicy }
3774
3942
  );
3775
- if ($) {
3776
- const E = p.key && A(p.key, e), b = w.getController(E);
3777
- if (!b || z(E, p) || z(e, $))
3943
+ if (E) {
3944
+ const S = m.key && R(m.key, e), $ = w.getController(S);
3945
+ if (!$ || !bn(
3946
+ l,
3947
+ p,
3948
+ S,
3949
+ $,
3950
+ t,
3951
+ n
3952
+ ))
3778
3953
  return !0;
3779
- Me(
3954
+ const _ = K(
3780
3955
  t,
3781
3956
  t.element,
3782
- $,
3957
+ E,
3783
3958
  e,
3784
3959
  "effect"
3785
- ), $.listContainer && t.watchChildList($.listContainer);
3786
- const [S, T] = on(
3787
- p,
3788
- $,
3789
- b.element,
3790
- b.useFirstChild,
3960
+ );
3961
+ if (_ !== !0)
3962
+ return X(_, t, m, $, !0), !0;
3963
+ E.listContainer && t.watchChildList(E.listContainer);
3964
+ const [I, O] = dn(
3965
+ m,
3966
+ E,
3967
+ $.element,
3968
+ $.useFirstChild,
3791
3969
  t.element,
3792
3970
  t.useFirstChild,
3793
3971
  void 0,
3794
3972
  i
3795
3973
  );
3796
- if (!S || !T)
3974
+ if (!I || !O)
3797
3975
  return !0;
3798
- n.addedInteractions[f] = !0;
3799
- const I = x(
3800
- $.conditions || [],
3976
+ const C = U(
3977
+ E.conditions || [],
3801
3978
  n.dataCache.conditions
3802
3979
  );
3803
- return l.push([
3980
+ return c.push([
3804
3981
  e,
3805
- p,
3806
- $,
3807
- S,
3808
- T,
3982
+ m,
3983
+ E,
3809
3984
  I,
3985
+ O,
3986
+ C,
3810
3987
  t.useFirstChild,
3811
- E || void 0
3988
+ S || void 0
3812
3989
  ]), !0;
3813
3990
  }
3814
3991
  return !1;
3815
3992
  });
3816
- }), l.reverse().forEach((c) => {
3817
- rn(...c);
3818
- }), ro(e, t, n, s, i);
3993
+ }), c.reverse().forEach((f) => {
3994
+ hn(...f);
3995
+ }), Po(e, t, n, s, i);
3819
3996
  const u = Object.keys(o?.sequences || {}).length > 0;
3820
3997
  return a.length > 0 || u;
3821
3998
  }
3822
- function Et(e, t, n, s, i, o, r, a, l) {
3999
+ function Mt(e, t, n, s, i, o, r, a, c) {
3823
4000
  let u;
3824
- if (Ft(i)) {
3825
- const f = {
4001
+ if (Wt(i)) {
4002
+ const l = {
3826
4003
  key: e,
3827
4004
  effectId: i.effectId,
3828
4005
  transition: i.transition,
3829
4006
  transitionProperties: i.transitionProperties,
3830
- childSelector: V(i, {
4007
+ childSelector: j(i, {
3831
4008
  asCombinator: !0,
3832
4009
  addItemFilter: !0,
3833
4010
  useFirstChild: a
@@ -3836,87 +4013,106 @@ function Et(e, t, n, s, i, o, r, a, l) {
3836
4013
  };
3837
4014
  if (u = w.getController(e), !u)
3838
4015
  return;
3839
- u.renderStyle(hs(f));
4016
+ u.renderStyle(Is(l));
3840
4017
  }
3841
- let c;
4018
+ let f;
3842
4019
  if (n === "animationEnd") {
3843
- const f = o.effectId, d = l ? w.getInstance(l) : void 0, m = d?.dataCache.effects[f], p = m && _e(m, d, {
3844
- id: `${l}::animationEnd::${f}`,
3845
- key: l,
4020
+ const l = o.effectId, d = c ? w.getInstance(c) : void 0, h = d?.dataCache.effects[l], p = h && ke(h, d, {
4021
+ id: `${c}::animationEnd::${l}`,
4022
+ key: c,
3846
4023
  onUpdate: () => {
3847
- w.getController(l)?.update();
4024
+ w.getController(c)?.update();
3848
4025
  }
3849
4026
  });
3850
- p && (c = N(p));
4027
+ p && (f = x(p));
3851
4028
  }
3852
- W[n]?.add(t, s, i, o, {
4029
+ D[n]?.add(t, s, i, o, {
3853
4030
  targetController: u,
3854
4031
  selectorCondition: r,
3855
4032
  allowA11yTriggers: w.allowA11yTriggers,
3856
- sourceAnimationOptions: c
4033
+ sourceAnimationOptions: f
3857
4034
  });
3858
4035
  }
3859
- function wt(e) {
4036
+ function Ot(e) {
3860
4037
  const t = e.key, n = w.getInstance(t);
3861
4038
  if (!n)
3862
4039
  return w.setController(t, e), !1;
3863
4040
  const { triggers: s = [] } = n?.get(t) || {}, i = s.length > 0;
3864
- n.setController(t, e), s.forEach((r, a) => {
3865
- const l = F(r.conditions, n.dataCache.conditions);
3866
- if (l) {
4041
+ n.setController(t, e), Te.set(e, (Te.get(e) || 0) + 1), bo(e), s.forEach((r, a) => {
4042
+ const c = H(r.conditions, n.dataCache.conditions);
4043
+ if (c) {
3867
4044
  const u = `${t}::trigger::${a}`;
3868
- n.setupMediaQueryListener(u, l, t, () => {
4045
+ n.setupMediaQueryListener(u, c, t, () => {
3869
4046
  e.update();
3870
4047
  });
3871
4048
  }
3872
- if (!l || l.matches) {
3873
- if (z(t, r))
4049
+ if (!c || c.matches) {
4050
+ const u = K(
4051
+ e,
4052
+ e.element,
4053
+ r,
4054
+ t,
4055
+ "interaction"
4056
+ );
4057
+ if (u !== !0) {
4058
+ X(u, e, r, e, !1);
3874
4059
  return;
3875
- Me(e, e.element, r, t, "interaction"), r.listContainer && e.watchChildList(r.listContainer), an(t, e, n, r);
4060
+ }
4061
+ r.listContainer && e.watchChildList(r.listContainer), rt(t, e, n, r);
3876
4062
  }
3877
4063
  });
3878
4064
  let o = !1;
3879
- return n && (o = fn(t, e, n)), i || o;
4065
+ return n && (o = $n(t, e, n)), i || o;
3880
4066
  }
3881
- function ao(e, t, n) {
4067
+ function Co(e, t, n) {
3882
4068
  const s = e.key, i = w.getInstance(s);
3883
4069
  if (i) {
3884
4070
  const { triggers: o = [] } = i?.get(s) || {};
3885
4071
  o.forEach((r, a) => {
3886
4072
  if (r.listContainer !== t)
3887
4073
  return;
3888
- const l = F(r.conditions, i.dataCache.conditions);
3889
- if (l) {
4074
+ const c = H(r.conditions, i.dataCache.conditions);
4075
+ if (c) {
3890
4076
  const u = `${s}::listTrigger::${t}::${a}`;
3891
- i.setupMediaQueryListener(u, l, s, () => {
4077
+ i.setupMediaQueryListener(u, c, s, () => {
3892
4078
  e.update();
3893
4079
  });
3894
4080
  }
3895
- if (!l || l.matches) {
3896
- if (z(s, r))
4081
+ if (!c || c.matches) {
4082
+ const u = K(
4083
+ e,
4084
+ e.element,
4085
+ r,
4086
+ s,
4087
+ "interaction",
4088
+ !1
4089
+ );
4090
+ if (u !== !0) {
4091
+ X(u, e, r, e, !1);
3897
4092
  return;
3898
- an(s, e, i, r, n);
4093
+ }
4094
+ rt(s, e, i, r, n);
3899
4095
  }
3900
- }), fn(s, e, i, t, n);
4096
+ }), $n(s, e, i, t, n);
3901
4097
  }
3902
4098
  }
3903
- function co(e, t = !1) {
4099
+ function Ao(e, t = !1) {
3904
4100
  const n = e.key, s = w.getInstance(n);
3905
4101
  if (!s)
3906
4102
  return;
3907
4103
  const i = [...s.get(n)?.selectors.values() || []].filter(Boolean).join(",");
3908
4104
  let o;
3909
- i ? (o = [...e.element.querySelectorAll(i)], e.useFirstChild || o.push(e.element)) : o = [e.element], dn(o), s.deleteController(n, t);
4105
+ i ? (o = [...e.element.querySelectorAll(i)], e.useFirstChild || o.push(e.element)) : o = [e.element], Sn(o), s.deleteController(n, t);
3910
4106
  }
3911
- function dn(e) {
3912
- const t = Object.values(W);
4107
+ function Sn(e) {
4108
+ const t = Object.values(D);
3913
4109
  for (const n of e)
3914
4110
  for (const s of t)
3915
4111
  s.remove(n);
3916
4112
  w.removeFromSequences(e);
3917
4113
  }
3918
- const Le = "interactEffect";
3919
- class lo {
4114
+ const Ne = "interactEffect";
4115
+ class ko {
3920
4116
  element;
3921
4117
  key;
3922
4118
  connected;
@@ -3925,8 +4121,10 @@ class lo {
3925
4121
  _observers;
3926
4122
  _pluginCleanups;
3927
4123
  _appliedPlugins;
4124
+ _connectId;
4125
+ _latches;
3928
4126
  constructor(t, n, s) {
3929
- this.element = t, this.key = n, this.connected = !1, this.sheet = null, this._observers = /* @__PURE__ */ new WeakMap(), this._pluginCleanups = [], this._appliedPlugins = /* @__PURE__ */ new WeakSet(), this.useFirstChild = s?.useFirstChild ?? !1;
4127
+ this.element = t, this.key = n, this.connected = !1, this.sheet = null, this._observers = /* @__PURE__ */ new WeakMap(), this._pluginCleanups = [], this._appliedPlugins = /* @__PURE__ */ new WeakMap(), this._connectId = 0, this._latches = [], this.useFirstChild = s?.useFirstChild ?? !1;
3930
4128
  }
3931
4129
  connect(t) {
3932
4130
  if (this.connected)
@@ -3938,10 +4136,13 @@ class lo {
3938
4136
  }
3939
4137
  n !== t && (n && console.warn(
3940
4138
  `Interact: Key mismatch between element ${n} and parameter ${t}, updating element key`
3941
- ), this.element.dataset.interactKey = t), this.key = t, this.connected = wt(this);
4139
+ ), this.element.dataset.interactKey = t), this.key = t, this.connected = Ot(this);
3942
4140
  }
3943
4141
  disconnect({ removeFromCache: t = !1 } = {}) {
3944
- if ((this.key || this.element.dataset.interactKey) && co(this, t), this._pluginCleanups.length) {
4142
+ this._connectId++, (this.key || this.element.dataset.interactKey) && Ao(this, t);
4143
+ for (const { release: s } of this._latches)
4144
+ s();
4145
+ if (this._latches.length = 0, this._pluginCleanups.length) {
3945
4146
  for (const s of this._pluginCleanups)
3946
4147
  try {
3947
4148
  s();
@@ -3950,7 +4151,7 @@ class lo {
3950
4151
  }
3951
4152
  this._pluginCleanups.length = 0;
3952
4153
  }
3953
- if (this._appliedPlugins = /* @__PURE__ */ new WeakSet(), this.sheet) {
4154
+ if (this._appliedPlugins = /* @__PURE__ */ new WeakMap(), this.sheet) {
3954
4155
  const s = this.element?.getRootNode(), i = s.host ? s : document;
3955
4156
  i.adoptedStyleSheets.indexOf(this.sheet) !== -1 && (i.adoptedStyleSheets = i.adoptedStyleSheets.filter(
3956
4157
  (r) => r !== this.sheet
@@ -3962,7 +4163,7 @@ class lo {
3962
4163
  this.disconnect(), this.connect();
3963
4164
  }
3964
4165
  resume() {
3965
- this.connected && wt(this);
4166
+ this.connected && Ot(this);
3966
4167
  }
3967
4168
  renderStyle(t) {
3968
4169
  const n = this.element?.getRootNode(), s = n.host ? n : document;
@@ -3987,12 +4188,12 @@ class lo {
3987
4188
  return;
3988
4189
  }
3989
4190
  const o = new Set(
3990
- this.element.dataset[Le]?.split(" ") || []
4191
+ this.element.dataset[Ne]?.split(" ") || []
3991
4192
  );
3992
- 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[Le] = Array.from(o).join(" ");
4193
+ 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[Ne] = Array.from(o).join(" ");
3993
4194
  }
3994
4195
  getActiveEffects() {
3995
- const n = (this.element.dataset[Le] || "").trim();
4196
+ const n = (this.element.dataset[Ne] || "").trim();
3996
4197
  return n ? n.split(/\s+/) : [];
3997
4198
  }
3998
4199
  watchChildList(t) {
@@ -4010,21 +4211,21 @@ class lo {
4010
4211
  }), r.addedNodes.forEach((a) => {
4011
4212
  a instanceof HTMLElement && o.push(a);
4012
4213
  });
4013
- }), dn(i), s && ao(this, t, o);
4214
+ }), Sn(i), s && Co(this, t, o);
4014
4215
  }
4015
4216
  }
4016
- function fo(e, t) {
4017
- new lo(e, t).connect();
4217
+ function Ro(e, t) {
4218
+ new ko(e, t).connect();
4018
4219
  }
4019
- function ho(e) {
4220
+ function Lo(e) {
4020
4221
  const t = w.getController(e);
4021
4222
  t && t.disconnect({ removeFromCache: !0 });
4022
4223
  }
4023
4224
  export {
4024
- lo as I,
4225
+ ko as I,
4025
4226
  w as a,
4026
- fo as b,
4027
- uo as g,
4028
- ho as r
4227
+ Ro as b,
4228
+ qo as g,
4229
+ Lo as r
4029
4230
  };
4030
- //# sourceMappingURL=index-DxihyZYQ.mjs.map
4231
+ //# sourceMappingURL=index-DSREj0qw.mjs.map