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