@wix/interact 2.0.4 → 2.1.1

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.
@@ -5,11 +5,11 @@ function C(e, t) {
5
5
  const n = st(t);
6
6
  let s = 0;
7
7
  return n.length ? e.replace(/\[]/g, () => {
8
- const i = n[s++];
9
- return i !== void 0 ? `[${i}]` : "[]";
8
+ const r = n[s++];
9
+ return r !== void 0 ? `[${r}]` : "[]";
10
10
  }) : e;
11
11
  }
12
- class N {
12
+ class G {
13
13
  animations;
14
14
  options;
15
15
  ready;
@@ -38,7 +38,7 @@ class N {
38
38
  }
39
39
  progress(t) {
40
40
  for (const n of this.animations) {
41
- const { delay: s, duration: i, iterations: r } = n.effect.getTiming(), o = (Number.isFinite(i) ? i : 0) * (Number.isFinite(r) ? r : 1);
41
+ const { delay: s, duration: r, iterations: i } = n.effect.getTiming(), o = (Number.isFinite(r) ? r : 0) * (Number.isFinite(i) ? i : 1);
42
42
  n.currentTime = ((s || 0) + o) * t;
43
43
  }
44
44
  }
@@ -57,8 +57,8 @@ class N {
57
57
  if (n && !this.isCSS) {
58
58
  const s = n.effect?.target;
59
59
  if (s) {
60
- const i = new Event("animationend");
61
- s.dispatchEvent(i);
60
+ const r = new Event("animationend");
61
+ s.dispatchEvent(r);
62
62
  }
63
63
  }
64
64
  t();
@@ -74,16 +74,16 @@ class N {
74
74
  }
75
75
  getTimingOptions() {
76
76
  return this.animations.map((t) => {
77
- const n = t.effect?.getTiming(), s = n?.delay ?? 0, i = Number(n?.duration) || 0, r = n?.iterations ?? 1;
77
+ const n = t.effect?.getTiming(), s = n?.delay ?? 0, r = Number(n?.duration) || 0, i = n?.iterations ?? 1;
78
78
  return {
79
79
  delay: s,
80
- duration: i,
81
- iterations: r
80
+ duration: r,
81
+ iterations: i
82
82
  };
83
83
  });
84
84
  }
85
85
  }
86
- const Re = (e) => e, it = (e) => 1 - Math.cos(e * Math.PI / 2), rt = (e) => Math.sin(e * Math.PI / 2), ot = (e) => -(Math.cos(Math.PI * e) - 1) / 2, ct = (e) => e ** 2, at = (e) => 1 - (1 - e) ** 2, ft = (e) => e < 0.5 ? 2 * e ** 2 : 1 - (-2 * e + 2) ** 2 / 2, lt = (e) => e ** 3, ut = (e) => 1 - (1 - e) ** 3, dt = (e) => e < 0.5 ? 4 * e ** 3 : 1 - (-2 * e + 2) ** 3 / 2, ht = (e) => e ** 4, mt = (e) => 1 - (1 - e) ** 4, pt = (e) => e < 0.5 ? 8 * e ** 4 : 1 - (-2 * e + 2) ** 4 / 2, gt = (e) => e ** 5, vt = (e) => 1 - (1 - e) ** 5, yt = (e) => e < 0.5 ? 16 * e ** 5 : 1 - (-2 * e + 2) ** 5 / 2, Et = (e) => e === 0 ? 0 : 2 ** (10 * e - 10), wt = (e) => e === 1 ? 1 : 1 - 2 ** (-10 * e), bt = (e) => e === 0 ? 0 : e === 1 ? 1 : e < 0.5 ? 2 ** (20 * e - 10) / 2 : (2 - 2 ** (-20 * e + 10)) / 2, St = (e) => 1 - Math.sqrt(1 - e ** 2), It = (e) => Math.sqrt(1 - (e - 1) ** 2), Tt = (e) => e < 0.5 ? (1 - Math.sqrt(1 - 4 * e ** 2)) / 2 : (Math.sqrt(-(2 * e - 3) * (2 * e - 1)) + 1) / 2, Ot = (e) => 2.70158 * e ** 3 - 1.70158 * e ** 2, Ct = (e) => 1 + 2.70158 * (e - 1) ** 3 + 1.70158 * (e - 1) ** 2, _t = (e, t = 1.70158 * 1.525) => e < 0.5 ? (2 * e) ** 2 * ((t + 1) * 2 * e - t) / 2 : ((2 * e - 2) ** 2 * ((t + 1) * (e * 2 - 2) + t) + 2) / 2, we = {
86
+ const Re = (e) => e, it = (e) => 1 - Math.cos(e * Math.PI / 2), rt = (e) => Math.sin(e * Math.PI / 2), ot = (e) => -(Math.cos(Math.PI * e) - 1) / 2, ct = (e) => e ** 2, at = (e) => 1 - (1 - e) ** 2, ft = (e) => e < 0.5 ? 2 * e ** 2 : 1 - (-2 * e + 2) ** 2 / 2, lt = (e) => e ** 3, ut = (e) => 1 - (1 - e) ** 3, dt = (e) => e < 0.5 ? 4 * e ** 3 : 1 - (-2 * e + 2) ** 3 / 2, ht = (e) => e ** 4, mt = (e) => 1 - (1 - e) ** 4, pt = (e) => e < 0.5 ? 8 * e ** 4 : 1 - (-2 * e + 2) ** 4 / 2, gt = (e) => e ** 5, vt = (e) => 1 - (1 - e) ** 5, yt = (e) => e < 0.5 ? 16 * e ** 5 : 1 - (-2 * e + 2) ** 5 / 2, Et = (e) => e === 0 ? 0 : 2 ** (10 * e - 10), wt = (e) => e === 1 ? 1 : 1 - 2 ** (-10 * e), bt = (e) => e === 0 ? 0 : e === 1 ? 1 : e < 0.5 ? 2 ** (20 * e - 10) / 2 : (2 - 2 ** (-20 * e + 10)) / 2, St = (e) => 1 - Math.sqrt(1 - e ** 2), It = (e) => Math.sqrt(1 - (e - 1) ** 2), Tt = (e) => e < 0.5 ? (1 - Math.sqrt(1 - 4 * e ** 2)) / 2 : (Math.sqrt(-(2 * e - 3) * (2 * e - 1)) + 1) / 2, Ot = (e) => 2.70158 * e ** 3 - 1.70158 * e ** 2, Ct = (e) => 1 + 2.70158 * (e - 1) ** 3 + 1.70158 * (e - 1) ** 2, kt = (e, t = 1.70158 * 1.525) => e < 0.5 ? (2 * e) ** 2 * ((t + 1) * 2 * e - t) / 2 : ((2 * e - 2) ** 2 * ((t + 1) * (e * 2 - 2) + t) + 2) / 2, we = {
87
87
  linear: Re,
88
88
  sineIn: it,
89
89
  sineOut: rt,
@@ -108,7 +108,7 @@ const Re = (e) => e, it = (e) => 1 - Math.cos(e * Math.PI / 2), rt = (e) => Math
108
108
  circInOut: Tt,
109
109
  backIn: Ot,
110
110
  backOut: Ct,
111
- backInOut: _t
111
+ backInOut: kt
112
112
  }, be = {
113
113
  linear: "linear",
114
114
  ease: "ease",
@@ -140,22 +140,22 @@ const Re = (e) => e, it = (e) => 1 - Math.cos(e * Math.PI / 2), rt = (e) => Math
140
140
  backOut: "cubic-bezier(0.175, 0.885, 0.32, 1.275)",
141
141
  backInOut: "cubic-bezier(0.68, -0.55, 0.265, 1.55)"
142
142
  };
143
- function kt(e) {
143
+ function qt(e) {
144
144
  return e === "percentage" ? "%" : e || "px";
145
145
  }
146
146
  function B(e) {
147
147
  return e ? be[e] || e : be.linear;
148
148
  }
149
149
  function At(e, t, n, s) {
150
- const i = 3 * e, r = 3 * (n - e) - i, o = 1 - i - r, c = 3 * t, u = 3 * (s - t) - c, f = 1 - c - u, a = (d) => ((o * d + r) * d + i) * d, l = (d) => ((f * d + u) * d + c) * d, m = (d) => (3 * o * d + 2 * r) * d + i;
150
+ const r = 3 * e, i = 3 * (n - e) - r, o = 1 - r - i, c = 3 * t, u = 3 * (s - t) - c, f = 1 - c - u, a = (d) => ((o * d + i) * d + r) * d, l = (d) => ((f * d + u) * d + c) * d, m = (d) => (3 * o * d + 2 * i) * d + r;
151
151
  function g(d) {
152
152
  let h = d;
153
153
  for (let v = 0; v < 8; v++) {
154
- const E = a(h) - d;
155
- if (Math.abs(E) < 1e-7) return h;
154
+ const w = a(h) - d;
155
+ if (Math.abs(w) < 1e-7) return h;
156
156
  const b = m(h);
157
157
  if (Math.abs(b) < 1e-6) break;
158
- h -= E / b;
158
+ h -= w / b;
159
159
  }
160
160
  let p = 0, y = 1;
161
161
  for (h = (p + y) / 2; y - p > 1e-7; ) {
@@ -167,16 +167,16 @@ function At(e, t, n, s) {
167
167
  }
168
168
  return (d) => d <= 0 ? 0 : d >= 1 ? 1 : l(g(d));
169
169
  }
170
- function xt(e) {
170
+ function _t(e) {
171
171
  const t = e.match(
172
172
  /^cubic-bezier\(\s*(-?[\d.]+)\s*,\s*(-?[\d.]+)\s*,\s*(-?[\d.]+)\s*,\s*(-?[\d.]+)\s*\)$/
173
173
  );
174
174
  if (!t) return;
175
- const n = parseFloat(t[1]), s = parseFloat(t[2]), i = parseFloat(t[3]), r = parseFloat(t[4]);
176
- if (![n, s, i, r].some(isNaN))
177
- return At(n, s, i, r);
175
+ const n = parseFloat(t[1]), s = parseFloat(t[2]), r = parseFloat(t[3]), i = parseFloat(t[4]);
176
+ if (![n, s, r, i].some(isNaN))
177
+ return At(n, s, r, i);
178
178
  }
179
- function qt(e) {
179
+ function xt(e) {
180
180
  const t = e.match(/^linear\((.+)\)$/);
181
181
  if (!t) return;
182
182
  const n = t[1].split(",").map((o) => o.trim()).filter(Boolean);
@@ -196,52 +196,52 @@ function qt(e) {
196
196
  }
197
197
  if (s.length === 0) return;
198
198
  s[0].pos === null && (s[0].pos = 0), s[s.length - 1].pos === null && (s[s.length - 1].pos = 1);
199
- let i = 0;
200
- for (; i < s.length; )
201
- if (s[i].pos === null) {
202
- const o = i - 1;
203
- let c = i;
199
+ let r = 0;
200
+ for (; r < s.length; )
201
+ if (s[r].pos === null) {
202
+ const o = r - 1;
203
+ let c = r;
204
204
  for (; c < s.length && s[c].pos === null; ) c++;
205
205
  const u = s[o].pos, f = s[c].pos, a = c - o;
206
206
  for (let l = o + 1; l < c; l++)
207
207
  s[l].pos = u + (f - u) * (l - o) / a;
208
- i = c + 1;
208
+ r = c + 1;
209
209
  } else
210
- i++;
210
+ r++;
211
211
  for (let o = 1; o < s.length; o++)
212
212
  s[o].pos < s[o - 1].pos && (s[o].pos = s[o - 1].pos);
213
- const r = s;
213
+ const i = s;
214
214
  return (o) => {
215
- if (o <= r[0].pos) return r[0].output;
216
- const c = r[r.length - 1];
215
+ if (o <= i[0].pos) return i[0].output;
216
+ const c = i[i.length - 1];
217
217
  if (o >= c.pos) return c.output;
218
- let u = 0, f = r.length - 1;
218
+ let u = 0, f = i.length - 1;
219
219
  for (; u < f - 1; ) {
220
220
  const m = u + f >>> 1;
221
- r[m].pos <= o ? u = m : f = m;
221
+ i[m].pos <= o ? u = m : f = m;
222
222
  }
223
- const a = r[u], l = r[f];
223
+ const a = i[u], l = i[f];
224
224
  return l.pos === a.pos ? l.output : a.output + (l.output - a.output) * (o - a.pos) / (l.pos - a.pos);
225
225
  };
226
226
  }
227
227
  function ze(e) {
228
228
  if (!e) return;
229
229
  const t = we[e];
230
- return t || (xt(e) ?? qt(e) ?? we.linear);
230
+ return t || (_t(e) ?? xt(e) ?? we.linear);
231
231
  }
232
- class Lt extends N {
232
+ class Mt extends G {
233
233
  animationGroups;
234
234
  delay;
235
235
  offset;
236
236
  offsetEasing;
237
237
  timingOptions;
238
238
  constructor(t, n = {}) {
239
- const s = t.flatMap((i) => [...i.animations]);
240
- super(s), this.animationGroups = t, this.delay = n.delay ?? 0, this.offset = n.offset ?? 0, this.offsetEasing = typeof n.offsetEasing == "function" ? n.offsetEasing : ze(n.offsetEasing) ?? Re, this.timingOptions = this.animationGroups.map((i) => i.getTimingOptions().map(({ delay: r, duration: o, iterations: c }) => ({
241
- delay: r,
239
+ const s = t.flatMap((r) => [...r.animations]);
240
+ super(s), this.animationGroups = t, this.delay = n.delay ?? 0, this.offset = n.offset ?? 0, this.offsetEasing = typeof n.offsetEasing == "function" ? n.offsetEasing : ze(n.offsetEasing) ?? Re, this.timingOptions = this.animationGroups.map((r) => r.getTimingOptions().map(({ delay: i, duration: o, iterations: c }) => ({
241
+ delay: i,
242
242
  duration: Number.isFinite(o) ? o : 0,
243
243
  iterations: Number.isFinite(c) ? c : 1
244
- }))), this.applyOffsets(), this.ready = Promise.all(t.map((i) => i.ready)).then(() => {
244
+ }))), this.applyOffsets(), this.ready = Promise.all(t.map((r) => r.ready)).then(() => {
245
245
  });
246
246
  }
247
247
  /**
@@ -255,16 +255,17 @@ class Lt extends N {
255
255
  const n = t - 1;
256
256
  return Array.from(
257
257
  { length: t },
258
- (s, i) => this.offsetEasing(i / n) * n * this.offset | 0
258
+ (s, r) => this.offsetEasing(r / n) * n * this.offset | 0
259
259
  );
260
260
  }
261
261
  applyOffsets() {
262
+ if (this.animationGroups.length === 0 || this.animations.length === 0) return;
262
263
  const t = this.calculateOffsets(), n = this.getSequenceActiveDuration(t);
263
- this.animationGroups.forEach((s, i) => {
264
- s.animations.forEach((r, o) => {
265
- const c = r.effect;
264
+ this.animationGroups.forEach((s, r) => {
265
+ s.animations.forEach((i, o) => {
266
+ const c = i.effect;
266
267
  if (!c) return;
267
- const { delay: u, duration: f, iterations: a } = this.timingOptions[i][o], l = u + t[i], m = n - (l + f * a);
268
+ const { delay: u, duration: f, iterations: a } = this.timingOptions[r][o], l = u + t[r], m = n - (l + f * a);
268
269
  c.updateTiming({ delay: l + this.delay, endDelay: m });
269
270
  });
270
271
  });
@@ -272,12 +273,12 @@ class Lt extends N {
272
273
  getSequenceActiveDuration(t) {
273
274
  const n = [];
274
275
  for (let s = 0; s < this.timingOptions.length; s++) {
275
- const i = this.timingOptions[s].reduce((r, o) => {
276
- if (!o) return r;
276
+ const r = this.timingOptions[s].reduce((i, o) => {
277
+ if (!o) return i;
277
278
  const { delay: c, duration: u, iterations: f } = o;
278
- return Math.max(r, c + u * f);
279
+ return Math.max(i, c + u * f);
279
280
  }, 0);
280
- n.push(t[s] + i);
281
+ n.push(t[s] + r);
281
282
  }
282
283
  return Math.max(...n);
283
284
  }
@@ -288,16 +289,31 @@ class Lt extends N {
288
289
  */
289
290
  addGroups(t) {
290
291
  if (t.length === 0) return;
291
- const n = [...t].sort((s, i) => i.index - s.index);
292
- for (const { index: s, group: i } of n) {
293
- const r = Math.min(s, this.animationGroups.length);
294
- this.animationGroups.splice(r, 0, i), this.timingOptions.splice(r, 0, i.getTimingOptions());
295
- const o = [...i.animations], c = this.animationGroups.slice(0, r).reduce((u, f) => u + f.animations.length, 0);
292
+ const n = [...t].sort((s, r) => r.index - s.index);
293
+ for (const { index: s, group: r } of n) {
294
+ const i = Math.min(s, this.animationGroups.length);
295
+ this.animationGroups.splice(i, 0, r), this.timingOptions.splice(i, 0, r.getTimingOptions());
296
+ const o = [...r.animations], c = this.animationGroups.slice(0, i).reduce((u, f) => u + f.animations.length, 0);
296
297
  this.animations.splice(c, 0, ...o);
297
298
  }
298
299
  this.applyOffsets(), this.ready = Promise.all(this.animationGroups.map((s) => s.ready)).then(() => {
299
300
  });
300
301
  }
302
+ /**
303
+ * Removes AnimationGroups that match the predicate, then recalculates
304
+ * stagger offsets for remaining groups. Cancelled animations in removed
305
+ * groups are returned.
306
+ */
307
+ removeGroups(t) {
308
+ const n = [], s = [], r = [];
309
+ for (let i = 0; i < this.animationGroups.length; i++)
310
+ t(this.animationGroups[i]) ? n.push(this.animationGroups[i]) : (s.push(this.animationGroups[i]), r.push(this.timingOptions[i]));
311
+ if (n.length === 0) return n;
312
+ for (const i of n)
313
+ i.cancel();
314
+ return this.animationGroups = s, this.timingOptions = r, this.animations = s.flatMap((i) => [...i.animations]), this.applyOffsets(), this.ready = Promise.all(this.animationGroups.map((i) => i.ready)).then(() => {
315
+ }), n;
316
+ }
301
317
  async onFinish(t) {
302
318
  try {
303
319
  await Promise.all(this.animationGroups.map((n) => n.finished)), t();
@@ -306,18 +322,18 @@ class Lt extends N {
306
322
  }
307
323
  }
308
324
  }
309
- class Mt {
325
+ class Lt {
310
326
  _animation;
311
327
  customEffect;
312
328
  progress;
313
329
  _tickCbId;
314
330
  _finishHandler;
315
- constructor(t, n, s, i) {
316
- const r = new KeyframeEffect(n, [], {
331
+ constructor(t, n, s, r) {
332
+ const i = new KeyframeEffect(n, [], {
317
333
  ...s,
318
334
  composite: "add"
319
- }), { timeline: o } = i;
320
- this._animation = new Animation(r, o), this._tickCbId = null, this.progress = null, this.customEffect = (c) => t(r.target, c), this._finishHandler = (c) => {
335
+ }), { timeline: o } = r;
336
+ this._animation = new Animation(i, o), this._tickCbId = null, this.progress = null, this.customEffect = (c) => t(i.target, c), this._finishHandler = (c) => {
321
337
  this.effect.target?.getAnimations().find((u) => u === this._animation) || this.cancel();
322
338
  }, this.addEventListener("finish", this._finishHandler), this.addEventListener("remove", this._finishHandler);
323
339
  }
@@ -446,23 +462,23 @@ class Mt {
446
462
  return this._animation.dispatchEvent(t);
447
463
  }
448
464
  }
449
- function $t(e) {
465
+ function Pt(e) {
450
466
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
451
467
  }
452
468
  var K = { exports: {} }, Se = K.exports, Ie;
453
- function Pt() {
469
+ function $t() {
454
470
  return Ie || (Ie = 1, (function(e) {
455
471
  (function(t) {
456
472
  var n = function() {
457
473
  }, s = t.requestAnimationFrame || t.webkitRequestAnimationFrame || t.mozRequestAnimationFrame || t.msRequestAnimationFrame || function(a) {
458
474
  return setTimeout(a, 16);
459
475
  };
460
- function i() {
476
+ function r() {
461
477
  var a = this;
462
478
  a.reads = [], a.writes = [], a.raf = s.bind(t);
463
479
  }
464
- i.prototype = {
465
- constructor: i,
480
+ r.prototype = {
481
+ constructor: r,
466
482
  /**
467
483
  * We run this inside a try catch
468
484
  * so that if any jobs error, we
@@ -484,7 +500,7 @@ function Pt() {
484
500
  */
485
501
  measure: function(a, l) {
486
502
  var m = l ? a.bind(l) : a;
487
- return this.reads.push(m), r(this), m;
503
+ return this.reads.push(m), i(this), m;
488
504
  },
489
505
  /**
490
506
  * Adds a job to the
@@ -497,7 +513,7 @@ function Pt() {
497
513
  */
498
514
  mutate: function(a, l) {
499
515
  var m = l ? a.bind(l) : a;
500
- return this.writes.push(m), r(this), m;
516
+ return this.writes.push(m), i(this), m;
501
517
  },
502
518
  /**
503
519
  * Clears a scheduled 'read' or 'write' task.
@@ -553,7 +569,7 @@ function Pt() {
553
569
  // when tasks throw
554
570
  catch: null
555
571
  };
556
- function r(a) {
572
+ function i(a) {
557
573
  a.scheduled || (a.scheduled = !0, a.raf(o.bind(null, a)));
558
574
  }
559
575
  function o(a) {
@@ -563,7 +579,7 @@ function Pt() {
563
579
  } catch (d) {
564
580
  g = d;
565
581
  }
566
- if (a.scheduled = !1, (m.length || l.length) && r(a), g)
582
+ if (a.scheduled = !1, (m.length || l.length) && i(a), g)
567
583
  if (n("task errored", g.message), a.catch) a.catch(g);
568
584
  else throw g;
569
585
  }
@@ -575,13 +591,13 @@ function Pt() {
575
591
  for (var m in l)
576
592
  l.hasOwnProperty(m) && (a[m] = l[m]);
577
593
  }
578
- var f = t.fastdom = t.fastdom || new i();
594
+ var f = t.fastdom = t.fastdom || new r();
579
595
  e.exports = f;
580
596
  })(typeof window < "u" ? window : typeof Se < "u" ? Se : globalThis);
581
597
  })(K)), K.exports;
582
598
  }
583
- var Ft = Pt();
584
- const I = /* @__PURE__ */ $t(Ft), fe = {};
599
+ var Ft = $t();
600
+ const T = /* @__PURE__ */ Pt(Ft), fe = {};
585
601
  function Rt(e) {
586
602
  Object.assign(fe, e);
587
603
  }
@@ -590,33 +606,33 @@ function zt(e) {
590
606
  `${e} not found in registry. Please make sure to import and register the preset.`
591
607
  ), null);
592
608
  }
593
- function L(e, t) {
609
+ function M(e, t) {
594
610
  return e ? document.getElementById(e) : null;
595
611
  }
596
612
  function Ht(e, t) {
597
613
  return e?.matches(`[data-motion-part~="${t}"]`) ? e : e?.querySelector(`[data-motion-part~="${t}"]`);
598
614
  }
599
- function Nt(e) {
615
+ function Gt(e) {
600
616
  const t = e.alternate ? "alternate" : "";
601
617
  return e.reversed ? `${t ? `${t}-` : ""}reverse` : t || "normal";
602
618
  }
603
619
  function re(e) {
604
- return `${e.value}${kt(e.unit)}`;
620
+ return `${e.value}${qt(e.unit)}`;
605
621
  }
606
622
  function Te(e, t, n) {
607
623
  return `${e.name || "cover"} ${n && e.offset.unit !== "percentage" ? `calc(100% + ${re(e.offset)}${t ? ` + ${t}` : ""})` : t ? `calc(${re(e.offset)} + ${t})` : re(e.offset)}`;
608
624
  }
609
- function Dt(e) {
625
+ function Nt(e) {
610
626
  return {
611
627
  start: Te(e.startOffset, e.startOffsetAdd),
612
628
  end: Te(e.endOffset, e.endOffsetAdd, !0)
613
629
  };
614
630
  }
615
631
  function He(e) {
616
- return (t) => I.measure(() => t(e));
632
+ return (t) => T.measure(() => t(e));
617
633
  }
618
- function Ne(e) {
619
- return (t) => I.mutate(() => t(e));
634
+ function Ge(e) {
635
+ return (t) => T.mutate(() => t(e));
620
636
  }
621
637
  function Z(e) {
622
638
  if (e.namedEffect) {
@@ -624,51 +640,51 @@ function Z(e) {
624
640
  return typeof t == "string" ? zt(t) : null;
625
641
  } else if (e.keyframeEffect) {
626
642
  const t = (s) => {
627
- const { name: i, keyframes: r } = s.keyframeEffect;
628
- return [{ ...s, name: i, keyframes: r }];
643
+ const { name: r, keyframes: i } = s.keyframeEffect;
644
+ return [{ ...s, name: r, keyframes: i }];
629
645
  };
630
646
  return { web: t, style: t, getNames: (s) => {
631
- const { effectId: i } = s, { name: r } = s.keyframeEffect, o = r || i;
647
+ const { effectId: r } = s, { name: i } = s.keyframeEffect, o = i || r;
632
648
  return o ? [o] : [];
633
649
  } };
634
650
  } else if (e.customEffect)
635
651
  return (t) => [{ ...t, keyframes: [] }];
636
652
  return null;
637
653
  }
638
- function Gt(e, t, n) {
639
- return e.map((s, i) => {
640
- const r = {
654
+ function Dt(e, t, n) {
655
+ return e.map((s, r) => {
656
+ const i = {
641
657
  fill: s.fill,
642
658
  easing: B(s.easing),
643
659
  iterations: s.iterations === 0 ? 1 / 0 : s.iterations || 1,
644
660
  composite: s.composite,
645
- direction: Nt(s)
661
+ direction: Gt(s)
646
662
  };
647
- return De(t) ? (r.duration = s.duration, r.delay = s.delay || 0) : window.ViewTimeline && t?.trigger === "view-progress" ? r.duration = "auto" : (r.duration = 99.99, r.delay = 0.01), {
663
+ return Ne(t) ? (i.duration = s.duration, i.delay = s.delay || 0) : window.ViewTimeline && t?.trigger === "view-progress" ? i.duration = "auto" : (i.duration = 99.99, i.delay = 0.01), {
648
664
  effect: s,
649
- options: r,
650
- id: n && `${n}-${i + 1}`,
665
+ options: i,
666
+ id: n && `${n}-${r + 1}`,
651
667
  part: s.part
652
668
  };
653
669
  });
654
670
  }
655
- function De(e) {
671
+ function Ne(e) {
656
672
  return !e || e.trigger !== "pointer-move" && e.trigger !== "view-progress";
657
673
  }
658
- function Oe(e, t, n, s, i) {
674
+ function Oe(e, t, n, s, r) {
659
675
  if (e) {
660
- if (De(s) && (t.duration = t.duration || 1, i?.reducedMotion))
676
+ if (Ne(s) && (t.duration = t.duration || 1, r?.reducedMotion))
661
677
  if (t.iterations === 1 || t.iterations == null)
662
678
  t = { ...t, duration: 1 };
663
679
  else
664
680
  return [];
665
- let r;
666
- return n instanceof HTMLElement && (r = { measure: He(n), mutate: Ne(n) }), e.web ? e.web(t, r, i) : e(t, r, i);
681
+ let i;
682
+ return n instanceof HTMLElement && (i = { measure: He(n), mutate: Ge(n) }), e.web ? e.web(t, i, r) : e(t, i, r);
667
683
  }
668
684
  return [];
669
685
  }
670
- function ve(e, t, n, s, i) {
671
- const r = e instanceof HTMLElement ? e : L(e);
686
+ function ve(e, t, n, s, r) {
687
+ const i = e instanceof HTMLElement ? e : M(e);
672
688
  if (n?.trigger === "pointer-move" && !t.keyframeEffect) {
673
689
  let m = t;
674
690
  t.customEffect && (m = {
@@ -680,33 +696,33 @@ function ve(e, t, n, s, i) {
680
696
  ), d = Oe(
681
697
  g,
682
698
  t,
683
- r,
699
+ i,
684
700
  n,
685
701
  s
686
702
  );
687
- return typeof d != "function" ? null : d(r);
703
+ return typeof d != "function" ? null : d(i);
688
704
  }
689
705
  const o = Z(t), c = Oe(
690
706
  o,
691
707
  t,
692
- r,
708
+ i,
693
709
  n,
694
710
  s
695
711
  );
696
712
  if (!c || c.length === 0)
697
713
  return null;
698
- const u = Gt(c, n, t.effectId);
714
+ const u = Dt(c, n, t.effectId);
699
715
  let f;
700
716
  const a = n?.trigger === "view-progress";
701
717
  a && window.ViewTimeline && (f = new ViewTimeline({
702
- subject: n.element || L(n.componentId)
718
+ subject: n.element || M(n.componentId)
703
719
  }));
704
720
  const l = u.map(({ effect: m, options: g, id: d, part: h }) => {
705
- const p = h ? Ht(r, h) : r, y = new KeyframeEffect(p || null, [], g);
706
- I.mutate(() => {
721
+ const p = h ? Ht(i, h) : i, y = new KeyframeEffect(p || null, [], g);
722
+ T.mutate(() => {
707
723
  "timing" in m && y.updateTiming(m.timing), y.setKeyframes(m.keyframes);
708
724
  });
709
- const v = a && f ? { timeline: f } : {}, E = typeof m.customEffect == "function" ? new Mt(
725
+ const v = a && f ? { timeline: f } : {}, w = typeof m.customEffect == "function" ? new Lt(
710
726
  m.customEffect,
711
727
  p || null,
712
728
  g,
@@ -714,72 +730,72 @@ function ve(e, t, n, s, i) {
714
730
  ) : new Animation(y, v.timeline);
715
731
  if (a)
716
732
  if (f)
717
- I.mutate(() => {
718
- const { start: b, end: S } = Dt(m);
719
- E.rangeStart = b, E.rangeEnd = S, E.play();
733
+ T.mutate(() => {
734
+ const { start: b, end: S } = Nt(m);
735
+ w.rangeStart = b, w.rangeEnd = S, w.play();
720
736
  });
721
737
  else {
722
738
  const { startOffset: b, endOffset: S } = t;
723
- I.mutate(() => {
724
- const T = m.startOffset || b, P = m.endOffset || S;
725
- Object.assign(E, {
739
+ T.mutate(() => {
740
+ const I = m.startOffset || b, $ = m.endOffset || S;
741
+ Object.assign(w, {
726
742
  start: {
727
- name: T.name,
728
- offset: T.offset?.value,
743
+ name: I.name,
744
+ offset: I.offset?.value,
729
745
  add: m.startOffsetAdd
730
746
  },
731
747
  end: {
732
- name: P.name,
733
- offset: P.offset?.value,
748
+ name: $.name,
749
+ offset: $.offset?.value,
734
750
  add: m.endOffsetAdd
735
751
  }
736
752
  });
737
753
  });
738
754
  }
739
- return d && (E.id = d), E;
755
+ return d && (w.id = d), w;
740
756
  });
741
- return new N(l, {
757
+ return new G(l, {
742
758
  ...t,
743
759
  trigger: { ...n || {} },
744
760
  // make sure the group is ready after all animation targets are measured and mutated
745
- measured: new Promise((m) => I.mutate(m))
761
+ measured: new Promise((m) => T.mutate(m))
746
762
  });
747
763
  }
748
764
  function Vt(e, t, n) {
749
- const s = Z(t), i = e instanceof HTMLElement ? e : L(e);
750
- if (s && s.prepare && i) {
751
- const r = { measure: He(i), mutate: Ne(i) };
752
- s.prepare(t, r);
765
+ const s = Z(t), r = e instanceof HTMLElement ? e : M(e);
766
+ if (s && s.prepare && r) {
767
+ const i = { measure: He(r), mutate: Ge(r) };
768
+ s.prepare(t, i);
753
769
  }
754
- n && I.mutate(n);
770
+ n && T.mutate(n);
755
771
  }
756
- function jt(e, t) {
772
+ function Wt(e, t) {
757
773
  const n = Z(t);
758
774
  if (!n)
759
775
  return null;
760
776
  if (!n.style)
761
- return t.effectId && e ? Wt(e, t.effectId) : null;
762
- const s = n.getNames(t), r = (typeof e == "string" ? L(e) : e)?.getAnimations(), o = r?.map((u) => u.animationName) || [], c = [];
777
+ return t.effectId && e ? jt(e, t.effectId) : null;
778
+ const s = n.getNames(t), i = (typeof e == "string" ? M(e) : e)?.getAnimations(), o = i?.map((u) => u.animationName) || [], c = [];
763
779
  return s.forEach((u) => {
764
780
  o.includes(u) && c.push(
765
- r?.find((f) => f.animationName === u)
781
+ i?.find((f) => f.animationName === u)
766
782
  );
767
- }), c?.length ? new N(c) : null;
783
+ }), c?.length ? new G(c) : null;
768
784
  }
769
- function Wt(e, t) {
770
- const s = (typeof e == "string" ? L(e) : e)?.getAnimations().filter((i) => {
771
- const r = i.id || i.animationName;
772
- return r ? r.startsWith(t) : !0;
785
+ function jt(e, t) {
786
+ const s = (typeof e == "string" ? M(e) : e)?.getAnimations().filter((r) => {
787
+ const i = r.id || r.animationName;
788
+ return i ? i.startsWith(t) : !0;
773
789
  });
774
- return s?.length ? new N(s) : null;
790
+ return s?.length ? new G(s) : null;
775
791
  }
776
- function Ge(e, t, n, s = {}) {
777
- const { disabled: i, allowActiveEvent: r, ...o } = s, c = ve(e, t, n, o);
792
+ function De(e, t, n, s = {}) {
793
+ const { disabled: r, allowActiveEvent: i, ...o } = s, c = ve(e, t, n, o);
778
794
  if (!c)
779
795
  return null;
780
796
  let u = {};
781
797
  if (n.trigger === "view-progress" && !window.ViewTimeline) {
782
- const f = n.element || L(n.componentId), { ready: a } = c;
798
+ const f = n.element || M(n.componentId), { ready: a } = c;
783
799
  return c.animations.map((l) => ({
784
800
  /* we use getters for start and end in order to access the animation's start and end
785
801
  only when initializing the scrub scene rather than immediately */
@@ -798,7 +814,7 @@ function Ge(e, t, n, s = {}) {
798
814
  const { activeDuration: d } = l.effect.getComputedTiming(), { delay: h } = l.effect.getTiming();
799
815
  l.currentTime = ((h || 0) + (d || 0)) * g;
800
816
  },
801
- disabled: i,
817
+ disabled: r,
802
818
  destroy() {
803
819
  l.cancel();
804
820
  }
@@ -819,7 +835,7 @@ function Ge(e, t, n, s = {}) {
819
835
  const v = g === "x" ? y.x : y.y;
820
836
  this._currentProgress = v, d.progress(v);
821
837
  },
822
- disabled: i ?? !1,
838
+ disabled: r ?? !1,
823
839
  destroy() {
824
840
  d.cancel();
825
841
  }
@@ -827,7 +843,7 @@ function Ge(e, t, n, s = {}) {
827
843
  }
828
844
  u = {
829
845
  centeredToTarget: a,
830
- allowActiveEvent: r
846
+ allowActiveEvent: i
831
847
  }, t.customEffect && l && (u.transitionDuration = l, u.transitionEasing = ze(m)), u.target = c.target;
832
848
  }
833
849
  return {
@@ -845,45 +861,45 @@ function Ge(e, t, n, s = {}) {
845
861
  } : a
846
862
  );
847
863
  },
848
- disabled: i,
864
+ disabled: r,
849
865
  destroy() {
850
866
  c.cancel();
851
867
  }
852
868
  };
853
869
  }
854
870
  function ne(e, t, n, s = !1) {
855
- const i = jt(e, t);
856
- return i ? (i.ready = new Promise((r) => {
857
- Vt(e, t, r);
858
- }), i) : ve(e, t, n, { reducedMotion: s });
871
+ const r = Wt(e, t);
872
+ return r ? (r.ready = new Promise((i) => {
873
+ Vt(e, t, i);
874
+ }), r) : ve(e, t, n, { reducedMotion: s });
859
875
  }
860
876
  function Yt(e) {
861
877
  return e === null ? [null] : typeof e == "string" ? Array.from(document.querySelectorAll(e)) : Array.isArray(e) ? e : [e];
862
878
  }
863
879
  function Ve(e, t) {
864
880
  const n = [];
865
- for (const { target: s, options: i } of e) {
866
- const r = Yt(s);
867
- for (const o of r) {
881
+ for (const { target: s, options: r } of e) {
882
+ const i = Yt(s);
883
+ for (const o of i) {
868
884
  const c = ne(
869
885
  o,
870
- i,
886
+ r,
871
887
  void 0,
872
888
  t?.reducedMotion
873
889
  );
874
- c instanceof N && n.push(c);
890
+ c instanceof G && n.push(c);
875
891
  }
876
892
  }
877
893
  return n;
878
894
  }
879
895
  function Bt(e, t, n) {
880
896
  const s = Ve(t, n);
881
- return new Lt(s, e);
897
+ return new Mt(s, e);
882
898
  }
883
899
  function Q(e, t) {
884
900
  return t.includes("&") ? t.replace(/&/g, e) : `${e}${t}`;
885
901
  }
886
- function x() {
902
+ function _() {
887
903
  return "wi-12343210".replace(
888
904
  /\d/g,
889
905
  (e) => String.fromCharCode(
@@ -897,8 +913,8 @@ function Kt({
897
913
  effectId: t,
898
914
  transition: n,
899
915
  properties: s,
900
- childSelector: i = "> :first-child",
901
- selectorCondition: r
916
+ childSelector: r = "> :first-child",
917
+ selectorCondition: i
902
918
  }) {
903
919
  let o = [];
904
920
  if (n?.styleProperties) {
@@ -917,7 +933,7 @@ function Kt({
917
933
  o = s?.filter((d) => d.duration).map(
918
934
  (d) => `${d.name} ${d.duration}ms ${B(d.easing) || "ease"}${d.delay ? ` ${d.delay}ms` : ""}`
919
935
  ) || [];
920
- const c = s?.map((d) => `${d.name}: ${d.value};`) || [], u = e.replace(/"/g, "'"), f = `:is(:state(${t}), :--${t}) ${i}`, a = `[data-interact-effect~="${t}"] ${i}`, l = r ? Q(f, r) : f, m = r ? Q(a, r) : a, g = [
936
+ const c = s?.map((d) => `${d.name}: ${d.value};`) || [], u = e.replace(/"/g, "'"), f = `:is(:state(${t}), :--${t}) ${r}`, a = `[data-interact-effect~="${t}"] ${r}`, l = i ? Q(f, i) : f, m = i ? Q(a, i) : a, g = [
921
937
  `${l},
922
938
  ${m} {
923
939
  ${c.join(`
@@ -925,49 +941,49 @@ function Kt({
925
941
  }`
926
942
  ];
927
943
  if (o.length) {
928
- const d = `[data-interact-key="${u}"] ${i}`, h = r ? Q(d, r) : d;
944
+ const d = `[data-interact-key="${u}"] ${r}`, h = i ? Q(d, i) : d;
929
945
  g.push(`@media (prefers-reduced-motion: no-preference) { ${h} {
930
946
  transition: ${o.join(", ")};
931
947
  } }`);
932
948
  }
933
949
  return g;
934
950
  }
935
- function _(e, t) {
936
- const n = (e || []).filter((r) => t[r]?.type === "media" && t[r].predicate).map((r) => t[r].predicate).join(") and ("), s = n && `(${n})`;
951
+ function k(e, t) {
952
+ const n = (e || []).filter((i) => t[i]?.type === "media" && t[i].predicate).map((i) => t[i].predicate).join(") and ("), s = n && `(${n})`;
937
953
  return s && window.matchMedia(s);
938
954
  }
939
- function M(e, t) {
955
+ function L(e, t) {
940
956
  for (const n of e || []) {
941
957
  const s = t[n];
942
958
  if (s?.type === "selector" && s.predicate)
943
959
  return s.predicate;
944
960
  }
945
961
  }
946
- const G = {
962
+ const D = {
947
963
  rangeStart: { name: "cover", offset: { value: 0, unit: "percentage" } },
948
964
  rangeEnd: { name: "cover", offset: { value: 100, unit: "percentage" } }
949
965
  };
950
966
  function Qt(e, t) {
951
- const n = e?.name ?? G.rangeStart.name, s = t?.name ?? e?.name ?? G.rangeEnd.name, i = {
967
+ const n = e?.name ?? D.rangeStart.name, s = t?.name ?? e?.name ?? D.rangeEnd.name, r = {
952
968
  name: n,
953
- offset: e?.offset || G.rangeStart.offset
954
- }, r = {
969
+ offset: e?.offset || D.rangeStart.offset
970
+ }, i = {
955
971
  name: s,
956
- offset: t?.offset || G.rangeEnd.offset
972
+ offset: t?.offset || D.rangeEnd.offset
957
973
  };
958
- return { startOffset: i, endOffset: r };
974
+ return { startOffset: r, endOffset: i };
959
975
  }
960
- function $(e) {
976
+ function P(e) {
961
977
  if ("keyframeEffect" in e && !e.keyframeEffect.name && "effectId" in e && (e.keyframeEffect.name = e.effectId), "duration" in e)
962
978
  return {
963
979
  id: "",
964
980
  ...e
965
981
  };
966
- const { rangeStart: t, rangeEnd: n, ...s } = e, { startOffset: i, endOffset: r } = Qt(t, n);
982
+ const { rangeStart: t, rangeEnd: n, ...s } = e, { startOffset: r, endOffset: i } = Qt(t, n);
967
983
  return {
968
984
  id: "",
969
- startOffset: i,
970
- endOffset: r,
985
+ startOffset: r,
986
+ endOffset: i,
971
987
  ...s
972
988
  };
973
989
  }
@@ -975,11 +991,11 @@ function O(e, t, n) {
975
991
  let s = e.get(t);
976
992
  s || (s = /* @__PURE__ */ new Set(), e.set(t, s)), s.add(n);
977
993
  }
978
- function D(e, t) {
994
+ function N(e, t) {
979
995
  e.get(t)?.forEach((s) => {
980
- const { source: i, target: r, cleanup: o } = s;
996
+ const { source: r, target: i, cleanup: o } = s;
981
997
  o();
982
- const c = i === t ? r : i;
998
+ const c = r === t ? i : r;
983
999
  e.get(c)?.delete(s);
984
1000
  }), e.delete(t);
985
1001
  }
@@ -992,20 +1008,20 @@ const Xt = {
992
1008
  rootMargin: "0px",
993
1009
  threshold: [0]
994
1010
  }, z = {}, ee = /* @__PURE__ */ new WeakMap(), X = /* @__PURE__ */ new WeakSet(), U = /* @__PURE__ */ new WeakMap();
995
- let je = {}, F = null;
1011
+ let We = {}, F = null;
996
1012
  function Jt(e) {
997
- je = e;
1013
+ We = e;
998
1014
  }
999
- function We(e, t) {
1000
- ee.get(e)?.forEach(({ source: s, handler: i }) => {
1001
- s === e && i(t);
1015
+ function je(e, t) {
1016
+ ee.get(e)?.forEach(({ source: s, handler: r }) => {
1017
+ s === e && r(t);
1002
1018
  });
1003
1019
  }
1004
1020
  function Ce() {
1005
1021
  return F || (F = new IntersectionObserver((e) => {
1006
1022
  e.forEach((t) => {
1007
1023
  const n = t.target;
1008
- t.isIntersecting || We(n, !1);
1024
+ t.isIntersecting || je(n, !1);
1009
1025
  });
1010
1026
  }, Ut), F);
1011
1027
  }
@@ -1017,17 +1033,17 @@ function Ye(e, t = !1) {
1017
1033
  root: null,
1018
1034
  rootMargin: e.inset ? `${e.inset} 0px ${e.inset}` : "0px",
1019
1035
  threshold: e.threshold
1020
- }, i = new IntersectionObserver((r) => {
1021
- r.forEach((o) => {
1036
+ }, r = new IntersectionObserver((i) => {
1037
+ i.forEach((o) => {
1022
1038
  const c = o.target, u = !X.has(c);
1023
1039
  if (u && (X.add(c), e.useSafeViewEnter && !o.isIntersecting)) {
1024
- I.measure(() => {
1040
+ T.measure(() => {
1025
1041
  const a = o.boundingClientRect.height, l = o.rootBounds?.height;
1026
1042
  if (!l)
1027
1043
  return;
1028
1044
  const m = Array.isArray(e.threshold) ? Math.min(...e.threshold) : e.threshold;
1029
- m && a * m > l && I.mutate(() => {
1030
- i.unobserve(c);
1045
+ m && a * m > l && T.mutate(() => {
1046
+ r.unobserve(c);
1031
1047
  const d = Ye(e, !0);
1032
1048
  U.set(c, d), d.observe(c);
1033
1049
  });
@@ -1035,17 +1051,17 @@ function Ye(e, t = !1) {
1035
1051
  return;
1036
1052
  }
1037
1053
  const f = e.type || "once";
1038
- (o.isIntersecting || f === "alternate" && !u) && (We(c, o.isIntersecting), f === "once" && (i.unobserve(o.target), X.delete(c)));
1054
+ (o.isIntersecting || f === "alternate" && !u) && (je(c, o.isIntersecting), f === "once" && (r.unobserve(o.target), X.delete(c)));
1039
1055
  });
1040
1056
  }, s);
1041
- return z[n] = i, i;
1057
+ return z[n] = r, r;
1042
1058
  }
1043
- function Zt(e, t, n, s = {}, { reducedMotion: i, selectorCondition: r, animation: o } = {}) {
1044
- const c = { ...je, ...s }, u = c.type || "once", f = o || ne(
1059
+ function Zt(e, t, n, s = {}, { reducedMotion: r, selectorCondition: i, animation: o } = {}) {
1060
+ const c = { ...We, ...s }, u = c.type || "once", f = o || ne(
1045
1061
  t,
1046
- $(n),
1062
+ P(n),
1047
1063
  void 0,
1048
- i
1064
+ r
1049
1065
  );
1050
1066
  if (!f)
1051
1067
  return;
@@ -1053,17 +1069,17 @@ function Zt(e, t, n, s = {}, { reducedMotion: i, selectorCondition: r, animation
1053
1069
  u !== "once" && f.persist?.();
1054
1070
  let l = !0;
1055
1071
  const d = { source: e, target: t, handler: (h) => {
1056
- r && !t.matches(r) || (u === "once" ? h && f.play(() => {
1072
+ i && !t.matches(i) || (u === "once" ? h && f.play(() => {
1057
1073
  const p = () => {
1058
1074
  t.dataset.interactEnter = "start";
1059
1075
  };
1060
- f.isCSS ? (I.mutate(() => {
1076
+ f.isCSS ? (T.mutate(() => {
1061
1077
  requestAnimationFrame(p);
1062
1078
  }), f.onFinish(() => {
1063
- I.mutate(() => {
1079
+ T.mutate(() => {
1064
1080
  t.dataset.interactEnter = "done";
1065
1081
  });
1066
- })) : I.mutate(p);
1082
+ })) : T.mutate(p);
1067
1083
  }) : u === "alternate" ? l && h ? (l = !1, f.play()) : l || f.reverse() : u === "repeat" ? h ? (f.progress(0), f.play()) : (f.pause(), f.progress(0)) : u === "state" && (h ? f.play() : f.pause()));
1068
1084
  }, cleanup: () => {
1069
1085
  (U.get(e) || a).unobserve(e), (u === "repeat" || u === "state") && Ce().unobserve(e), f.cancel(), X.delete(e), U.delete(e);
@@ -1071,12 +1087,12 @@ function Zt(e, t, n, s = {}, { reducedMotion: i, selectorCondition: r, animation
1071
1087
  O(ee, e, d), O(ee, t, d), U.set(e, a), a.observe(e), (u === "repeat" || u === "state") && Ce().observe(e);
1072
1088
  }
1073
1089
  function en(e) {
1074
- D(ee, e);
1090
+ N(ee, e);
1075
1091
  }
1076
1092
  function tn() {
1077
1093
  F = null, Object.keys(z).forEach((e) => delete z[e]);
1078
1094
  }
1079
- const _e = {
1095
+ const ke = {
1080
1096
  add: Zt,
1081
1097
  remove: en,
1082
1098
  setOptions: Jt,
@@ -1086,15 +1102,15 @@ function Be(e, t) {
1086
1102
  return Object.assign(Object.create(t), e);
1087
1103
  }
1088
1104
  function nn(e, t, n, s) {
1089
- let i = e * (1 - n) + t * n;
1105
+ let r = e * (1 - n) + t * n;
1090
1106
  if (s) {
1091
- const r = i - e;
1092
- Math.abs(r) < s && (i = e + s * Math.sign(r));
1093
- const o = t - i;
1107
+ const i = r - e;
1108
+ Math.abs(i) < s && (r = e + s * Math.sign(i));
1109
+ const o = t - r;
1094
1110
  if (Math.abs(o) < s)
1095
1111
  return t;
1096
1112
  }
1097
- return i;
1113
+ return r;
1098
1114
  }
1099
1115
  function sn(e) {
1100
1116
  let t = !1;
@@ -1104,7 +1120,7 @@ function sn(e) {
1104
1120
  }));
1105
1121
  };
1106
1122
  }
1107
- function ke(e, t) {
1123
+ function qe(e, t) {
1108
1124
  let n = 0;
1109
1125
  return function() {
1110
1126
  n && window.clearTimeout(n), n = window.setTimeout(() => {
@@ -1120,30 +1136,30 @@ function te(e, t) {
1120
1136
  return e ? /^-?\d+px$/.test(e) ? parseInt(e) : /^-?\d+[lsd]?vh$/.test(e) ? parseInt(e) * t.viewportHeight / 100 : /^-?\d+[lsd]?vw$/.test(e) ? parseInt(e) * t.viewportWidth / 100 : /^calc\s*\(\s*-?\d+((px)|([lsd]?vh)|([lsd]?vw))\s*\+\s*-?\d+((px)|([lsd]?vh)|([lsd]?vw))\s*\)\s*$/.test(e) ? rn(e, t) : parseInt(e) || 0 : 0;
1121
1137
  }
1122
1138
  function A(e, t, n) {
1123
- const { name: s, offset: i = 0 } = e, { start: r, end: o } = n, c = o - r, u = i / 100;
1139
+ const { name: s, offset: r = 0 } = e, { start: i, end: o } = n, c = o - i, u = r / 100;
1124
1140
  let f, a;
1125
- return s === "entry" ? (f = r - t, a = Math.min(t, c)) : s === "entry-crossing" ? (f = r - t, a = c) : s === "contain" ? (f = Math.min(o - t, r), a = Math.abs(t - c)) : s === "exit" ? (f = Math.max(r, o - t), a = Math.min(t, c)) : s === "exit-crossing" ? (f = r, a = c) : s === "cover" && (f = r - t, a = c + t), f + u * a | 0;
1141
+ return s === "entry" ? (f = i - t, a = Math.min(t, c)) : s === "entry-crossing" ? (f = i - t, a = c) : s === "contain" ? (f = Math.min(o - t, i), a = Math.abs(t - c)) : s === "exit" ? (f = Math.max(i, o - t), a = Math.min(t, c)) : s === "exit-crossing" ? (f = i, a = c) : s === "cover" && (f = i - t, a = c + t), f + u * a | 0;
1126
1142
  }
1127
- function oe(e, t, n, s, i) {
1128
- let r = 0;
1143
+ function oe(e, t, n, s, r) {
1144
+ let i = 0;
1129
1145
  const o = { start: t, end: n };
1130
1146
  return e.forEach((c, u) => {
1131
- r += c.offset;
1147
+ i += c.offset;
1132
1148
  const f = c.sticky;
1133
1149
  if (f) {
1134
1150
  if ("end" in f && e[u - 1]?.element) {
1135
- const m = ((i ? c.element.offsetWidth : c.element.offsetHeight) || 0) + f.end - s, g = r + m - c.offset, d = g < o.start, h = !d && g <= n;
1151
+ const m = ((r ? c.element.offsetWidth : c.element.offsetHeight) || 0) + f.end - s, g = i + m - c.offset, d = g < o.start, h = !d && g <= n;
1136
1152
  let p = 0;
1137
1153
  (d || h) && (p = c.offset, o.end += p), d && (o.start += p);
1138
1154
  }
1139
1155
  if ("start" in f) {
1140
- const a = r - f.start, l = a < o.start, m = !l && a <= o.end;
1156
+ const a = i - f.start, l = a < o.start, m = !l && a <= o.end;
1141
1157
  let g = 0;
1142
1158
  const d = e[u - 1]?.element;
1143
1159
  if (d) {
1144
1160
  if (l || m) {
1145
- const h = (i ? d.offsetWidth : d.offsetHeight) || 0, p = c.offset, y = (i ? c.element.offsetWidth : c.element.offsetHeight) || 0;
1146
- g = h - (p + y), r += g, o.end += g;
1161
+ const h = (r ? d.offsetWidth : d.offsetHeight) || 0, p = c.offset, y = (r ? c.element.offsetWidth : c.element.offsetHeight) || 0;
1162
+ g = h - (p + y), i += g, o.end += g;
1147
1163
  }
1148
1164
  l && (o.start += g);
1149
1165
  }
@@ -1151,22 +1167,22 @@ function oe(e, t, n, s, i) {
1151
1167
  }
1152
1168
  }), o;
1153
1169
  }
1154
- function on(e, t, n, s, i, r) {
1170
+ function on(e, t, n, s, r, i) {
1155
1171
  const { start: o, end: c, duration: u } = e;
1156
1172
  let f = o, a = c, l = e.startRange, m = e.endRange, g;
1157
1173
  if (typeof u == "string") {
1158
1174
  l = { name: u, offset: 0 }, m = { name: u, offset: 100 }, f = A(l, n, t), a = A(m, n, t), g = a - f;
1159
- const d = oe(r, f, a, n, s);
1175
+ const d = oe(i, f, a, n, s);
1160
1176
  f = d.start, a = d.end;
1161
1177
  } else {
1162
1178
  if (l || o?.name) {
1163
1179
  l = l || o;
1164
- const d = te(l.add, i), h = A({ ...l, offset: 0 }, n, t), p = A({ ...l, offset: 100 }, n, t), y = oe(r, h, p, n, s);
1180
+ const d = te(l.add, r), h = A({ ...l, offset: 0 }, n, t), p = A({ ...l, offset: 100 }, n, t), y = oe(i, h, p, n, s);
1165
1181
  f = y.start + l.offset / 100 * (y.end - y.start) + d;
1166
1182
  }
1167
1183
  if (m || c?.name) {
1168
1184
  m = m || c;
1169
- const d = te(m.add, i), h = A({ ...m, offset: 0 }, n, t), p = A({ ...m, offset: 100 }, n, t), y = oe(r, h, p, n, s);
1185
+ const d = te(m.add, r), h = A({ ...m, offset: 0 }, n, t), p = A({ ...m, offset: 100 }, n, t), y = oe(i, h, p, n, s);
1170
1186
  a = y.start + m.offset / 100 * (y.end - y.start) + d;
1171
1187
  } else typeof u == "number" && (a = f + u);
1172
1188
  }
@@ -1191,12 +1207,12 @@ function un(e, t, n) {
1191
1207
  }
1192
1208
  function dn(e, t) {
1193
1209
  let n;
1194
- const s = fn(e, t), i = ln(e, t), r = !isNaN(s), o = !isNaN(i);
1195
- return (r || o) && (n = {}, r && (n.start = s), o && (n.end = i)), n;
1210
+ const s = fn(e, t), r = ln(e, t), i = !isNaN(s), o = !isNaN(r);
1211
+ return (i || o) && (n = {}, i && (n.start = s), o && (n.end = r)), n;
1196
1212
  }
1197
- function V(e, t, n, s, i) {
1198
- const r = e[0].viewSource, o = [];
1199
- let c = (s ? r.offsetWidth : r.offsetHeight) || 0, u = 0, f = r;
1213
+ function V(e, t, n, s, r) {
1214
+ const i = e[0].viewSource, o = [];
1215
+ let c = (s ? i.offsetWidth : i.offsetHeight) || 0, u = 0, f = i;
1200
1216
  for (; f; ) {
1201
1217
  const l = window.getComputedStyle(f), m = cn(l), g = m ? dn(l, s) : void 0, d = un(f, s, m);
1202
1218
  if ((!g || !("end" in g)) && (u += d), o.push({ element: f, offset: d, sticky: g }), f = f.offsetParent, an(l, f, t))
@@ -1212,7 +1228,7 @@ function V(e, t, n, s, i) {
1212
1228
  { start: u, end: u + c },
1213
1229
  n,
1214
1230
  s,
1215
- i,
1231
+ r,
1216
1232
  o
1217
1233
  )
1218
1234
  }));
@@ -1226,10 +1242,10 @@ const Ae = 100, hn = {
1226
1242
  observeContentResize: !1
1227
1243
  };
1228
1244
  function mn(e, t, n, s) {
1229
- let i = 0;
1230
- return e >= t && e <= n ? i = s ? (e - t) / s : 1 : e > n && (i = 1), i;
1245
+ let r = 0;
1246
+ return e >= t && e <= n ? r = s ? (e - t) / s : 1 : e > n && (r = 1), r;
1231
1247
  }
1232
- function xe(e, t) {
1248
+ function _e(e, t) {
1233
1249
  return e === window ? t ? window.document.documentElement.clientWidth : window.document.documentElement.clientHeight : t ? e.clientWidth : e.clientHeight;
1234
1250
  }
1235
1251
  function pn() {
@@ -1239,8 +1255,8 @@ function pn() {
1239
1255
  };
1240
1256
  }
1241
1257
  function gn(e) {
1242
- const t = Be(e, hn), n = t.root, s = t.horizontal, i = /* @__PURE__ */ new WeakMap();
1243
- let r = xe(n, s), o, c, u, f, a;
1258
+ const t = Be(e, hn), n = t.root, s = t.horizontal, r = /* @__PURE__ */ new WeakMap();
1259
+ let i = _e(n, s), o, c, u, f, a;
1244
1260
  const l = [], m = pn();
1245
1261
  if (t.scenes = Object.values(
1246
1262
  // TODO(ameerf): find a polyfill and use groupBy instead of following reduce
@@ -1251,7 +1267,7 @@ function gn(e) {
1251
1267
  },
1252
1268
  {}
1253
1269
  )
1254
- ).flatMap((h) => (h.every((p) => p.viewSource && (typeof p.duration == "string" || p.start?.name)) ? (h = V(h, n, r, s, m), (t.observeSourcesResize || t.observeContentResize) && l.push(h)) : h.forEach((p) => {
1270
+ ).flatMap((h) => (h.every((p) => p.viewSource && (typeof p.duration == "string" || p.start?.name)) ? (h = V(h, n, i, s, m), (t.observeSourcesResize || t.observeContentResize) && l.push(h)) : h.forEach((p) => {
1255
1271
  p.end == null && (p.end = p.start + p.duration), p.duration == null && (p.duration = p.end - p.start);
1256
1272
  }), h)), t.scenes.forEach((h, p) => {
1257
1273
  h.index = p;
@@ -1259,29 +1275,29 @@ function gn(e) {
1259
1275
  const h = /* @__PURE__ */ new Map();
1260
1276
  window.ResizeObserver && (u = new window.ResizeObserver(function(p) {
1261
1277
  p.forEach((y) => {
1262
- const v = h.get(y.target), E = V(v, n, r, s, m);
1263
- E.forEach((b, S) => {
1264
- t.scenes[b.index] = E[S];
1265
- }), l.splice(l.indexOf(v), 1, E);
1278
+ const v = h.get(y.target), w = V(v, n, i, s, m);
1279
+ w.forEach((b, S) => {
1280
+ t.scenes[b.index] = w[S];
1281
+ }), l.splice(l.indexOf(v), 1, w);
1266
1282
  });
1267
1283
  }), l.forEach((p) => {
1268
1284
  u.observe(p[0].viewSource, { box: "border-box" }), h.set(p[0].viewSource, p);
1269
- }), t.observeContentResize && t.contentRoot && new window.ResizeObserver(ke(() => {
1285
+ }), t.observeContentResize && t.contentRoot && new window.ResizeObserver(qe(() => {
1270
1286
  const y = l.map((v) => {
1271
- const E = V(v, n, r, s, m);
1272
- return E.forEach((b, S) => {
1273
- t.scenes[b.index] = E[S];
1274
- }), E;
1287
+ const w = V(v, n, i, s, m);
1288
+ return w.forEach((b, S) => {
1289
+ t.scenes[b.index] = w[S];
1290
+ }), w;
1275
1291
  });
1276
1292
  l.length = 0, l.push(...y), l.forEach((v) => {
1277
1293
  h.set(v[0].viewSource, v);
1278
1294
  });
1279
- }, Ae)).observe(t.contentRoot, { box: "border-box" })), t.observeViewportResize && (f = ke(function() {
1280
- r = xe(n, s);
1295
+ }, Ae)).observe(t.contentRoot, { box: "border-box" })), t.observeViewportResize && (f = qe(function() {
1296
+ i = _e(n, s);
1281
1297
  const p = l.map((y) => {
1282
- const v = V(y, n, r, s, m);
1283
- return v.forEach((E, b) => {
1284
- t.scenes[E.index] = v[b];
1298
+ const v = V(y, n, i, s, m);
1299
+ return v.forEach((w, b) => {
1300
+ t.scenes[w.index] = v[b];
1285
1301
  }), v;
1286
1302
  });
1287
1303
  l.length = 0, l.push(...p), l.forEach((y) => {
@@ -1291,7 +1307,7 @@ function gn(e) {
1291
1307
  }
1292
1308
  t.observeViewportEntry && window.IntersectionObserver && (c = new window.IntersectionObserver(function(h) {
1293
1309
  h.forEach((p) => {
1294
- (i.get(p.target) || []).forEach((y) => {
1310
+ (r.get(p.target) || []).forEach((y) => {
1295
1311
  y.disabled = !p.isIntersecting;
1296
1312
  });
1297
1313
  });
@@ -1301,8 +1317,8 @@ function gn(e) {
1301
1317
  threshold: 0
1302
1318
  }), t.scenes.forEach((h) => {
1303
1319
  if (h.viewSource) {
1304
- let p = i.get(h.viewSource);
1305
- p || (p = [], i.set(h.viewSource, p), c.observe(h.viewSource)), p.push(h);
1320
+ let p = r.get(h.viewSource);
1321
+ p || (p = [], r.set(h.viewSource, p), c.observe(h.viewSource)), p.push(h);
1306
1322
  }
1307
1323
  }));
1308
1324
  function g({ p: h, vp: p }) {
@@ -1311,8 +1327,8 @@ function gn(e) {
1311
1327
  if (h !== o) {
1312
1328
  for (let v of t.scenes)
1313
1329
  if (!v.disabled) {
1314
- const { start: E, end: b, duration: S } = v, T = mn(h, E, b, S);
1315
- v.effect(v, T, y);
1330
+ const { start: w, end: b, duration: S } = v, I = mn(h, w, b, S);
1331
+ v.effect(v, I, y);
1316
1332
  }
1317
1333
  o = h;
1318
1334
  }
@@ -1371,8 +1387,8 @@ class yn {
1371
1387
  * @param {number} [scrollPosition.y]
1372
1388
  */
1373
1389
  resetProgress(t = {}) {
1374
- const n = this.config.root, s = t.x || t.x === 0 ? t.x : n.scrollX || n.scrollLeft || 0, i = t.y || t.y === 0 ? t.y : n.scrollY || n.scrollTop || 0, r = this.config.horizontal ? s : i;
1375
- this.progress.p = r, this.progress.prevP = r, this.progress.vp = 0, this.config.transitionActive && (this.currentProgress.p = r, this.currentProgress.prevP = r, this.currentProgress.vp = 0), t && this.config.root.scrollTo(s, i);
1390
+ const n = this.config.root, s = t.x || t.x === 0 ? t.x : n.scrollX || n.scrollLeft || 0, r = t.y || t.y === 0 ? t.y : n.scrollY || n.scrollTop || 0, i = this.config.horizontal ? s : r;
1391
+ this.progress.p = i, this.progress.prevP = i, this.progress.vp = 0, this.config.transitionActive && (this.currentProgress.p = i, this.currentProgress.prevP = i, this.currentProgress.vp = 0), t && this.config.root.scrollTo(s, r);
1376
1392
  }
1377
1393
  /**
1378
1394
  * Handle animation frame work.
@@ -1384,8 +1400,8 @@ class yn {
1384
1400
  n && this.lerp();
1385
1401
  const s = n ? this.currentProgress : this.progress;
1386
1402
  if (this.config.velocityActive) {
1387
- const i = s.p - s.prevP, r = i < 0 ? -1 : 1;
1388
- s.vp = Math.min(this.config.velocityMax, Math.abs(i)) / this.config.velocityMax * r;
1403
+ const r = s.p - s.prevP, i = r < 0 ? -1 : 1;
1404
+ s.vp = Math.min(this.config.velocityMax, Math.abs(r)) / this.config.velocityMax * i;
1389
1405
  }
1390
1406
  this.effect.tick(s), n && s.p !== this.progress.p && (t && this._lerpFrameId && window.cancelAnimationFrame(this._lerpFrameId), this._lerpFrameId = window.requestAnimationFrame(() => this.tick())), s.prevP = s.p;
1391
1407
  }
@@ -1431,23 +1447,23 @@ let Ke = () => ({});
1431
1447
  function En(e) {
1432
1448
  Ke = e;
1433
1449
  }
1434
- function wn(e, t, n, s, { reducedMotion: i }) {
1435
- if (i)
1450
+ function wn(e, t, n, s, { reducedMotion: r }) {
1451
+ if (r)
1436
1452
  return;
1437
- const r = {
1453
+ const i = {
1438
1454
  trigger: "view-progress",
1439
1455
  element: e
1440
- }, o = $(n);
1456
+ }, o = P(n);
1441
1457
  let c;
1442
1458
  if ("ViewTimeline" in window) {
1443
- const f = ve(t, o, r);
1459
+ const f = ve(t, o, i);
1444
1460
  f && (f.play(), c = () => {
1445
1461
  f.ready.then(() => {
1446
1462
  f.cancel();
1447
1463
  });
1448
1464
  });
1449
1465
  } else {
1450
- const f = Ge(t, o, r);
1466
+ const f = De(t, o, i);
1451
1467
  if (f) {
1452
1468
  const a = Array.isArray(f) ? f : [f], l = new yn({
1453
1469
  viewSource: e,
@@ -1472,17 +1488,17 @@ function wn(e, t, n, s, { reducedMotion: i }) {
1472
1488
  O(le, e, u), O(le, t, u);
1473
1489
  }
1474
1490
  function bn(e) {
1475
- D(le, e);
1491
+ N(le, e);
1476
1492
  }
1477
1493
  const Sn = {
1478
1494
  add: wn,
1479
1495
  remove: bn,
1480
1496
  registerOptionsGetter: En
1481
1497
  };
1482
- function qe(e, t, n) {
1498
+ function xe(e, t, n) {
1483
1499
  return Math.min(Math.max(e, n), t);
1484
1500
  }
1485
- function Le(e) {
1501
+ function Me(e) {
1486
1502
  let t = !1;
1487
1503
  return function() {
1488
1504
  if (!t)
@@ -1521,7 +1537,7 @@ function On() {
1521
1537
  return new Promise((e) => {
1522
1538
  const t = window.scrollY;
1523
1539
  let n = !1, s;
1524
- function i() {
1540
+ function r() {
1525
1541
  document.body.addEventListener("pointerdown", (c) => {
1526
1542
  s === void 0 ? s = c.offsetY : n = c.offsetY === s;
1527
1543
  }, { once: !0 });
@@ -1530,10 +1546,10 @@ function On() {
1530
1546
  });
1531
1547
  document.body.dispatchEvent(o);
1532
1548
  }
1533
- function r() {
1534
- window.scrollY !== t && (window.removeEventListener("scroll", r), i(), e(n));
1549
+ function i() {
1550
+ window.scrollY !== t && (window.removeEventListener("scroll", i), r(), e(n));
1535
1551
  }
1536
- i(), window.addEventListener("scroll", r), window.scrollY > 0 && window.scrollBy(0, -1);
1552
+ r(), window.addEventListener("scroll", i), window.scrollY > 0 && window.scrollBy(0, -1);
1537
1553
  });
1538
1554
  }
1539
1555
  function Cn(e) {
@@ -1541,9 +1557,9 @@ function Cn(e) {
1541
1557
  e.fixRequired = t, t && (window.addEventListener("scroll", e.scrollHandler), e.scrollHandler());
1542
1558
  });
1543
1559
  }
1544
- let j = 0;
1560
+ let W = 0;
1545
1561
  const J = /* @__PURE__ */ new Set();
1546
- function _n() {
1562
+ function kn() {
1547
1563
  const e = (n) => {
1548
1564
  for (let s of n.changedTouches)
1549
1565
  J.add(s.identifier);
@@ -1555,41 +1571,41 @@ function _n() {
1555
1571
  J.clear(), document.removeEventListener("touchstart", e), document.removeEventListener("touchend", t);
1556
1572
  };
1557
1573
  }
1558
- function kn(e, t) {
1574
+ function qn(e, t) {
1559
1575
  if ("onscrollend" in window)
1560
1576
  return e.addEventListener("scrollend", t), function() {
1561
1577
  e.removeEventListener("scrollend", t);
1562
1578
  };
1563
1579
  let n = 0, s;
1564
- j || (s = _n()), j += 1;
1565
- function i(r) {
1580
+ W || (s = kn()), W += 1;
1581
+ function r(i) {
1566
1582
  clearTimeout(n), n = setTimeout(() => {
1567
- J.size ? setTimeout(i, 100) : (t(r), n = 0);
1583
+ J.size ? setTimeout(r, 100) : (t(i), n = 0);
1568
1584
  }, 100);
1569
1585
  }
1570
- return e.addEventListener("scroll", i), function() {
1571
- e.removeEventListener("scroll", i), j -= 1, j || s();
1586
+ return e.addEventListener("scroll", r), function() {
1587
+ e.removeEventListener("scroll", r), W -= 1, W || s();
1572
1588
  };
1573
1589
  }
1574
1590
  function An(e, t, n) {
1575
1591
  return {
1576
1592
  x(s) {
1577
- const i = e.left - n.x + e.width / 2, r = i >= t.width / 2, o = (r ? i : t.width - i) * 2, c = r ? 0 : i - o / 2;
1593
+ const r = e.left - n.x + e.width / 2, i = r >= t.width / 2, o = (i ? r : t.width - r) * 2, c = i ? 0 : r - o / 2;
1578
1594
  return (s - c) / o;
1579
1595
  },
1580
1596
  y(s) {
1581
- const i = e.top - n.y + e.height / 2, r = i >= t.height / 2, o = (r ? i : t.height - i) * 2, c = r ? 0 : i - o / 2;
1597
+ const r = e.top - n.y + e.height / 2, i = r >= t.height / 2, o = (i ? r : t.height - r) * 2, c = i ? 0 : r - o / 2;
1582
1598
  return (s - c) / o;
1583
1599
  }
1584
1600
  };
1585
1601
  }
1586
- function xn(e, t) {
1602
+ function _n(e, t) {
1587
1603
  this.x = window.scrollX, this.y = window.scrollY, requestAnimationFrame(() => e && e(t));
1588
1604
  }
1589
- function qn(e) {
1605
+ function xn(e) {
1590
1606
  e.rect.width = window.document.documentElement.clientWidth, e.rect.height = window.document.documentElement.clientHeight;
1591
1607
  }
1592
- function Ln(e) {
1608
+ function Mn(e) {
1593
1609
  const t = new ResizeObserver((n) => {
1594
1610
  n.forEach((s) => {
1595
1611
  e.rect.width = s.borderBoxSize[0].inlineSize, e.rect.height = s.borderBoxSize[0].blockSize;
@@ -1597,38 +1613,38 @@ function Ln(e) {
1597
1613
  });
1598
1614
  return t.observe(e.root, { box: "border-box" }), t;
1599
1615
  }
1600
- function Mn(e) {
1601
- let t = !1, n = { x: e.rect.width / 2, y: e.rect.height / 2, vx: 0, vy: 0 }, s, i, r, o, c;
1616
+ function Ln(e) {
1617
+ let t = !1, n = { x: e.rect.width / 2, y: e.rect.height / 2, vx: 0, vy: 0 }, s, r, i, o, c;
1602
1618
  const u = { x: 0, y: 0 };
1603
1619
  e.scenes.forEach((a) => {
1604
- a.target && a.centeredToTarget && (a.transform = An(In(a.target), e.rect, u), t = !0), e.root ? i = Ln(e) : (r = qn.bind(null, e), window.addEventListener("resize", r));
1620
+ a.target && a.centeredToTarget && (a.transform = An(In(a.target), e.rect, u), t = !0), e.root ? r = Mn(e) : (i = xn.bind(null, e), window.addEventListener("resize", i));
1605
1621
  }), s = function(a) {
1606
1622
  for (let l of e.scenes)
1607
1623
  if (!l.disabled) {
1608
- const m = l.transform?.x(a.x) || a.x / e.rect.width, g = l.transform?.y(a.y) || a.y / e.rect.height, d = +qe(0, 1, m).toPrecision(4), h = +qe(0, 1, g).toPrecision(4), p = { x: a.vx, y: a.vy };
1624
+ const m = l.transform?.x(a.x) || a.x / e.rect.width, g = l.transform?.y(a.y) || a.y / e.rect.height, d = +xe(0, 1, m).toPrecision(4), h = +xe(0, 1, g).toPrecision(4), p = { x: a.vx, y: a.vy };
1609
1625
  e.allowActiveEvent && (a.active = m <= 1 && g <= 1 && m >= 0 && g >= 0), l.effect(l, { x: d, y: h }, p, a.active);
1610
1626
  }
1611
1627
  Object.assign(n, a);
1612
- }, t && (o = xn.bind(u, s, n), c = kn(document, o));
1628
+ }, t && (o = _n.bind(u, s, n), c = qn(document, o));
1613
1629
  function f() {
1614
- e.scenes.forEach((a) => a.destroy?.()), c?.(), i ? (i.disconnect(), i = null) : (window.removeEventListener("resize", r), r = null), s = null, n = null;
1630
+ e.scenes.forEach((a) => a.destroy?.()), c?.(), r ? (r.disconnect(), r = null) : (window.removeEventListener("resize", i), i = null), s = null, n = null;
1615
1631
  }
1616
1632
  return {
1617
1633
  tick: s,
1618
1634
  destroy: f
1619
1635
  };
1620
1636
  }
1621
- const $n = 1e3 / 60 * 3;
1622
- let W;
1623
- function Pn() {
1624
- q.x = window.scrollX, q.y = window.scrollY;
1637
+ const Pn = 1e3 / 60 * 3;
1638
+ let j;
1639
+ function $n() {
1640
+ x.x = window.scrollX, x.y = window.scrollY;
1625
1641
  }
1626
- const q = { x: 0, y: 0, scrollHandler: Pn, fixRequired: void 0 };
1642
+ const x = { x: 0, y: 0, scrollHandler: $n, fixRequired: void 0 };
1627
1643
  class Fn {
1628
1644
  constructor(t = {}) {
1629
1645
  this.config = { ...t }, this.effect = null, this._nextTick = null, this._nextTransitionTick = null, this._startTime = 0;
1630
1646
  let n;
1631
- this.config.transitionDuration ? n = this.config.noThrottle ? () => this.transition() : Le(() => this.transition()) : n = this.config.noThrottle ? () => (this.tick(), null) : Le(() => {
1647
+ this.config.transitionDuration ? n = this.config.noThrottle ? () => this.transition() : Me(() => this.transition()) : n = this.config.noThrottle ? () => (this.tick(), null) : Me(() => {
1632
1648
  this.tick();
1633
1649
  }), this.config.rect = this.config.root ? {
1634
1650
  width: this.config.root.offsetWidth,
@@ -1642,28 +1658,28 @@ class Fn {
1642
1658
  vx: 0,
1643
1659
  vy: 0
1644
1660
  }, this.previousProgress = { ...this.progress }, this.currentProgress = null;
1645
- const s = (i) => {
1646
- const r = this.config.root ? i.offsetX : i.x, o = this.config.root ? i.offsetY : i.y;
1647
- this.progress.vx = r - this.progress.x, this.progress.vy = o - this.progress.y, this.progress.x = r, this.progress.y = o, this._nextTick = n();
1661
+ const s = (r) => {
1662
+ const i = this.config.root ? r.offsetX : r.x, o = this.config.root ? r.offsetY : r.y;
1663
+ this.progress.vx = i - this.progress.x, this.progress.vy = o - this.progress.y, this.progress.x = i, this.progress.y = o, this._nextTick = n();
1648
1664
  };
1649
1665
  if (this._pointerLeave = () => {
1650
1666
  this.progress.active = !1, this.progress.vx = 0, this.progress.vy = 0, this._nextTick = n();
1651
1667
  }, this._pointerEnter = () => {
1652
1668
  this.progress.active = !0, this._nextTick = n();
1653
1669
  }, this.config.root) {
1654
- W = typeof W == "boolean" ? W : Tn();
1655
- const i = W ? window.devicePixelRatio : 1;
1656
- typeof q.fixRequired > "u" && Cn(q), this._measure = (r) => {
1657
- if (r.target !== this.config.root) {
1670
+ j = typeof j == "boolean" ? j : Tn();
1671
+ const r = j ? window.devicePixelRatio : 1;
1672
+ typeof x.fixRequired > "u" && Cn(x), this._measure = (i) => {
1673
+ if (i.target !== this.config.root) {
1658
1674
  const o = new PointerEvent("pointermove", {
1659
1675
  bubbles: !0,
1660
1676
  cancelable: !0,
1661
- clientX: r.x * i + q.x,
1662
- clientY: r.y * i + q.y
1677
+ clientX: i.x * r + x.x,
1678
+ clientY: i.y * r + x.y
1663
1679
  });
1664
- r.stopPropagation(), this.config.root.dispatchEvent(o);
1680
+ i.stopPropagation(), this.config.root.dispatchEvent(o);
1665
1681
  } else
1666
- s(r);
1682
+ s(i);
1667
1683
  };
1668
1684
  } else
1669
1685
  this._measure = s;
@@ -1693,12 +1709,12 @@ class Fn {
1693
1709
  */
1694
1710
  transition() {
1695
1711
  const t = this.config.transitionDuration, n = this.config.transitionEasing || ((o) => o), s = performance.now();
1696
- let i = !1;
1697
- const r = (o) => {
1712
+ let r = !1;
1713
+ const i = (o) => {
1698
1714
  const c = (o - this._startTime) / t, u = n(Math.min(1, c));
1699
- i && (this.progress.vx = 0, this.progress.vy = 0, i = !1), this.currentProgress = Object.entries(this.progress).reduce((f, [a, l]) => (a === "active" ? f[a] = l : f[a] = this.previousProgress[a] + (l - this.previousProgress[a]) * u, f), this.currentProgress || {}), c < 1 && (this._nextTransitionTick = requestAnimationFrame(r), i = o - this._startTime > $n), this.effect.tick(this.currentProgress);
1715
+ r && (this.progress.vx = 0, this.progress.vy = 0, r = !1), this.currentProgress = Object.entries(this.progress).reduce((f, [a, l]) => (a === "active" ? f[a] = l : f[a] = this.previousProgress[a] + (l - this.previousProgress[a]) * u, f), this.currentProgress || {}), c < 1 && (this._nextTransitionTick = requestAnimationFrame(i), r = o - this._startTime > Pn), this.effect.tick(this.currentProgress);
1700
1716
  };
1701
- return this._startTime ? (this._nextTransitionTick && cancelAnimationFrame(this._nextTransitionTick), Object.assign(this.previousProgress, this.currentProgress), this._startTime = s, r(s)) : this._startTime = s, this._nextTransitionTick;
1717
+ return this._startTime ? (this._nextTransitionTick && cancelAnimationFrame(this._nextTransitionTick), Object.assign(this.previousProgress, this.currentProgress), this._startTime = s, i(s)) : this._startTime = s, this._nextTransitionTick;
1702
1718
  }
1703
1719
  /**
1704
1720
  * Stop the event and effect, and remove all DOM side effects.
@@ -1725,7 +1741,7 @@ class Fn {
1725
1741
  * Reset registered effect.
1726
1742
  */
1727
1743
  setupEffect() {
1728
- this.removeEffect(), this.effect = Mn(this.config);
1744
+ this.removeEffect(), this.effect = Ln(this.config);
1729
1745
  }
1730
1746
  /**
1731
1747
  * Remove registered effect.
@@ -1739,14 +1755,14 @@ let Qe = () => ({});
1739
1755
  function Rn(e) {
1740
1756
  Qe = e;
1741
1757
  }
1742
- function zn(e, t, n, s = {}, { reducedMotion: i }) {
1743
- if (i)
1758
+ function zn(e, t, n, s = {}, { reducedMotion: r }) {
1759
+ if (r)
1744
1760
  return;
1745
- const r = {
1761
+ const i = {
1746
1762
  trigger: "pointer-move",
1747
1763
  element: e,
1748
1764
  axis: s.axis ?? "y"
1749
- }, o = Ge(t, $(n), r);
1765
+ }, o = De(t, P(n), i);
1750
1766
  if (o) {
1751
1767
  const c = Array.isArray(o) ? o : [o], u = new Fn({
1752
1768
  root: s.hitArea === "self" ? e : void 0,
@@ -1763,40 +1779,40 @@ function zn(e, t, n, s = {}, { reducedMotion: i }) {
1763
1779
  }
1764
1780
  }
1765
1781
  function Hn(e) {
1766
- D(ue, e);
1782
+ N(ue, e);
1767
1783
  }
1768
- const Nn = {
1784
+ const Gn = {
1769
1785
  add: zn,
1770
1786
  remove: Hn,
1771
1787
  registerOptionsGetter: Rn
1772
1788
  }, de = /* @__PURE__ */ new WeakMap();
1773
- function Dn(e, t, n, s, { reducedMotion: i, selectorCondition: r, animation: o }) {
1789
+ function Nn(e, t, n, s, { reducedMotion: r, selectorCondition: i, animation: o }) {
1774
1790
  const c = o || ne(
1775
1791
  t,
1776
- $(n),
1792
+ P(n),
1777
1793
  void 0,
1778
- i
1794
+ r
1779
1795
  );
1780
1796
  if (!c)
1781
1797
  return;
1782
1798
  const u = () => {
1783
- r && !t.matches(r) || c.play();
1799
+ i && !t.matches(i) || c.play();
1784
1800
  }, a = { source: e, target: t, cleanup: () => {
1785
1801
  c.cancel(), e.removeEventListener("animationend", u);
1786
1802
  } };
1787
1803
  O(de, e, a), O(de, t, a), e.addEventListener("animationend", u);
1788
1804
  }
1789
- function Gn(e) {
1790
- D(de, e);
1805
+ function Dn(e) {
1806
+ N(de, e);
1791
1807
  }
1792
1808
  const Vn = {
1793
- add: Dn,
1794
- remove: Gn
1809
+ add: Nn,
1810
+ remove: Dn
1795
1811
  };
1796
- function jn(e, t, n, s = !1, i, r, o) {
1812
+ function Wn(e, t, n, s = !1, r, i, o) {
1797
1813
  const c = o || ne(
1798
1814
  e,
1799
- $(t),
1815
+ P(t),
1800
1816
  void 0,
1801
1817
  s
1802
1818
  );
@@ -1805,37 +1821,37 @@ function jn(e, t, n, s = !1, i, r, o) {
1805
1821
  let u = !0;
1806
1822
  const f = n.type || "alternate";
1807
1823
  return (a) => {
1808
- if (i && !e.matches(i)) return;
1809
- const l = !r, m = r?.enter?.includes(a.type), g = r?.leave?.includes(a.type);
1824
+ if (r && !e.matches(r)) return;
1825
+ const l = !i, m = i?.enter?.includes(a.type), g = i?.leave?.includes(a.type);
1810
1826
  if (m || l) {
1811
1827
  f === "alternate" || f === "state" ? u ? (u = !1, c.play()) : f === "alternate" ? c.reverse() : f === "state" && (c.playState === "running" ? c.pause() : c.playState !== "finished" && c.play()) : (c.progress(0), delete e.dataset.interactEnter, c.isCSS && c.onFinish(() => {
1812
- I.mutate(() => {
1828
+ T.mutate(() => {
1813
1829
  e.dataset.interactEnter = "done";
1814
1830
  });
1815
1831
  }), c.play());
1816
1832
  return;
1817
1833
  }
1818
- g && (f === "alternate" ? c.reverse() : f === "repeat" ? (c.cancel(), I.mutate(() => {
1834
+ g && (f === "alternate" ? c.reverse() : f === "repeat" ? (c.cancel(), T.mutate(() => {
1819
1835
  delete e.dataset.interactEnter;
1820
1836
  })) : f === "state" && c.playState === "running" && c.pause());
1821
1837
  };
1822
1838
  }
1823
- function Wn(e, t, {
1839
+ function jn(e, t, {
1824
1840
  effectId: n,
1825
1841
  listContainer: s,
1826
- listItemSelector: i
1827
- }, r, o, c) {
1828
- const u = !!s, f = r.method || "toggle", a = f === "toggle";
1842
+ listItemSelector: r
1843
+ }, i, o, c) {
1844
+ const u = !!s, f = i.method || "toggle", a = f === "toggle";
1829
1845
  return (l) => {
1830
1846
  if (o && !e.matches(o)) return;
1831
1847
  const m = u ? e.closest(
1832
- `${s} > ${i || ""}:has(:scope)`
1848
+ `${s} > ${r || ""}:has(:scope)`
1833
1849
  ) : void 0, g = !c, d = c?.enter?.includes(l.type), h = c?.leave?.includes(l.type);
1834
1850
  g ? t.toggleEffect(n, f, m) : (d && t.toggleEffect(n, a ? "add" : f, m), h && a && t.toggleEffect(n, "remove", m));
1835
1851
  };
1836
1852
  }
1837
1853
  const he = /* @__PURE__ */ new WeakMap();
1838
- function Me(e, t) {
1854
+ function Le(e, t) {
1839
1855
  return (n) => {
1840
1856
  const s = n;
1841
1857
  e.contains(s.relatedTarget) || t(s);
@@ -1854,14 +1870,14 @@ function Bn(e) {
1854
1870
  };
1855
1871
  }
1856
1872
  const Kn = {
1857
- focusin: (e, t) => Me(e, t),
1858
- focusout: (e, t) => Me(e, t),
1873
+ focusin: (e, t) => Le(e, t),
1874
+ focusout: (e, t) => Le(e, t),
1859
1875
  click: (e, t) => Yn(t),
1860
1876
  keydown: (e, t) => Bn(t)
1861
1877
  };
1862
1878
  function Qn(e, t, n) {
1863
1879
  const s = Kn[e];
1864
- return s ? s(t, n) : (i) => n(i);
1880
+ return s ? s(t, n) : (r) => n(r);
1865
1881
  }
1866
1882
  function Xn(e) {
1867
1883
  return typeof e == "object" && !Array.isArray(e) && ("enter" in e || "leave" in e);
@@ -1884,56 +1900,58 @@ function Zn(e) {
1884
1900
  return Jn(e) ? { enter: e.enter ?? [], leave: e.leave ?? [] } : void 0;
1885
1901
  }
1886
1902
  function es(e, t, n, s, {
1887
- reducedMotion: i,
1888
- targetController: r,
1903
+ reducedMotion: r,
1904
+ targetController: i,
1889
1905
  selectorCondition: o,
1890
1906
  animation: c
1891
1907
  }) {
1892
1908
  const u = Un(s.eventConfig), f = n.transition || n.transitionProperties, a = Zn(u);
1893
1909
  let l, m = !1;
1894
- if (f ? l = Wn(
1910
+ if (f ? l = jn(
1895
1911
  t,
1896
- r,
1912
+ i,
1897
1913
  n,
1898
1914
  s,
1899
1915
  o,
1900
1916
  a
1901
- ) : (l = jn(
1917
+ ) : (l = Wn(
1902
1918
  t,
1903
1919
  n,
1904
1920
  s,
1905
- i,
1921
+ r,
1906
1922
  o,
1907
1923
  a,
1908
1924
  c
1909
1925
  ), m = s.type === "once"), !l)
1910
1926
  return;
1911
1927
  const g = l, d = new AbortController();
1912
- function h(v, E, b) {
1913
- const S = Qn(E, e, g);
1914
- v.addEventListener(E, S, { ...b, signal: d.signal });
1928
+ function h(v, w, b) {
1929
+ const S = Qn(w, e, g);
1930
+ v.addEventListener(w, S, { ...b, signal: d.signal });
1915
1931
  }
1916
1932
  const y = { source: e, target: t, cleanup: () => {
1917
1933
  d.abort();
1918
1934
  } };
1919
1935
  if (O(he, e, y), O(he, t, y), a) {
1920
- const v = u.enter, E = u.leave;
1921
- v.forEach((S) => {
1922
- S === "focusin" && (e.tabIndex = 0), h(e, S, { passive: !0, once: m });
1923
- }), (f ? s.method === "toggle" : s.type !== "once") && E.forEach((S) => {
1924
- if (S === "focusout") {
1925
- h(e, S, { once: m });
1936
+ const v = u.enter, w = u.leave;
1937
+ v.forEach((I) => {
1938
+ I === "focusin" && (e.tabIndex = 0), h(e, I, { passive: !0, once: m });
1939
+ });
1940
+ const b = !s.method || s.method === "toggle";
1941
+ (f ? b : s.type !== "once") && w.forEach((I) => {
1942
+ if (I === "focusout") {
1943
+ h(e, I, { once: m });
1926
1944
  return;
1927
1945
  }
1928
- h(e, S, { passive: !0 });
1946
+ h(e, I, { passive: !0 });
1929
1947
  });
1930
1948
  } else
1931
- (u.toggle ?? []).forEach((E) => {
1932
- h(e, E, { once: m, passive: E !== "keydown" });
1949
+ (u.toggle ?? []).forEach((w) => {
1950
+ h(e, w, { once: m, passive: w !== "keydown" });
1933
1951
  });
1934
1952
  }
1935
1953
  function ts(e) {
1936
- D(he, e);
1954
+ N(he, e);
1937
1955
  }
1938
1956
  const R = {
1939
1957
  add: es,
@@ -1946,19 +1964,19 @@ const R = {
1946
1964
  enter: ["mouseenter", "focusin"],
1947
1965
  leave: ["mouseleave", "focusout"]
1948
1966
  }
1949
- }, $e = {
1967
+ }, Pe = {
1950
1968
  click: me.activate,
1951
1969
  hover: me.interest
1952
1970
  };
1953
1971
  function Y(e) {
1954
1972
  const t = me[e];
1955
- return (n, s, i, r, o) => {
1956
- const c = o?.allowA11yTriggers && e in $e ? $e[e] : t;
1957
- R.add(n, s, i, { ...r, eventConfig: c }, o ?? {});
1973
+ return (n, s, r, i, o) => {
1974
+ const c = o?.allowA11yTriggers && e in Pe ? Pe[e] : t;
1975
+ R.add(n, s, r, { ...i, eventConfig: c }, o ?? {});
1958
1976
  };
1959
1977
  }
1960
- const k = {
1961
- viewEnter: _e,
1978
+ const q = {
1979
+ viewEnter: ke,
1962
1980
  hover: {
1963
1981
  add: Y("hover"),
1964
1982
  remove: R.remove
@@ -1967,10 +1985,10 @@ const k = {
1967
1985
  add: Y("click"),
1968
1986
  remove: R.remove
1969
1987
  },
1970
- pageVisible: _e,
1988
+ pageVisible: ke,
1971
1989
  animationEnd: Vn,
1972
1990
  viewProgress: Sn,
1973
- pointerMove: Nn,
1991
+ pointerMove: Gn,
1974
1992
  activate: {
1975
1993
  add: Y("activate"),
1976
1994
  remove: R.remove
@@ -1983,7 +2001,7 @@ const k = {
1983
2001
  function ns(e) {
1984
2002
  return e.replace(/\[([-\w]+)]/g, "[]");
1985
2003
  }
1986
- class w {
2004
+ class E {
1987
2005
  static defineInteractElement;
1988
2006
  dataCache;
1989
2007
  addedInteractions;
@@ -1995,19 +2013,20 @@ class w {
1995
2013
  static instances = [];
1996
2014
  static controllerCache = /* @__PURE__ */ new Map();
1997
2015
  static sequenceCache = /* @__PURE__ */ new Map();
2016
+ static elementSequenceMap = /* @__PURE__ */ new WeakMap();
1998
2017
  constructor() {
1999
2018
  this.dataCache = { effects: {}, sequences: {}, conditions: {}, interactions: {} }, this.addedInteractions = {}, this.mediaQueryListeners = /* @__PURE__ */ new Map(), this.listInteractionsCache = {}, this.controllers = /* @__PURE__ */ new Set();
2000
2019
  }
2001
2020
  init(t, n) {
2002
2021
  if (typeof window > "u" || !window.customElements)
2003
2022
  return;
2004
- const s = n?.useCutsomElement ?? !!w.defineInteractElement;
2023
+ const s = n?.useCutsomElement ?? !!E.defineInteractElement;
2005
2024
  this.dataCache = is(t, s);
2006
- const i = w.defineInteractElement?.();
2007
- s && i === !1 ? document.querySelectorAll("interact-element").forEach((r) => {
2008
- r.connect();
2009
- }) : w.controllerCache.forEach(
2010
- (r, o) => r.connect(o)
2025
+ const r = E.defineInteractElement?.();
2026
+ s && r === !1 ? document.querySelectorAll("interact-element").forEach((i) => {
2027
+ i.connect();
2028
+ }) : E.controllerCache.forEach(
2029
+ (i, o) => i.connect(o)
2011
2030
  );
2012
2031
  }
2013
2032
  destroy() {
@@ -2015,14 +2034,14 @@ class w {
2015
2034
  t.disconnect();
2016
2035
  for (const [, t] of this.mediaQueryListeners.entries())
2017
2036
  t.mql.removeEventListener("change", t.handler);
2018
- this.mediaQueryListeners.clear(), this.addedInteractions = {}, this.listInteractionsCache = {}, this.controllers.clear(), this.dataCache = { effects: {}, sequences: {}, conditions: {}, interactions: {} }, w.instances.splice(w.instances.indexOf(this), 1);
2037
+ this.mediaQueryListeners.clear(), this.addedInteractions = {}, this.listInteractionsCache = {}, this.controllers.clear(), this.dataCache = { effects: {}, sequences: {}, conditions: {}, interactions: {} }, E.instances.splice(E.instances.indexOf(this), 1);
2019
2038
  }
2020
2039
  setController(t, n) {
2021
- this.controllers.add(n), w.setController(t, n);
2040
+ this.controllers.add(n), E.setController(t, n);
2022
2041
  }
2023
2042
  deleteController(t, n = !1) {
2024
- const s = w.controllerCache.get(t);
2025
- this.clearInteractionStateForKey(t), this.clearMediaQueryListenersForKey(t), s && n && (this.controllers.delete(s), w.deleteController(t));
2043
+ const s = E.controllerCache.get(t);
2044
+ this.clearInteractionStateForKey(t), this.clearMediaQueryListenersForKey(t), s && n && (this.controllers.delete(s), E.deleteController(t));
2026
2045
  }
2027
2046
  has(t) {
2028
2047
  return !!this.get(t);
@@ -2036,66 +2055,87 @@ class w {
2036
2055
  s.key === t && (s.mql.removeEventListener("change", s.handler), this.mediaQueryListeners.delete(n));
2037
2056
  }
2038
2057
  clearInteractionStateForKey(t) {
2039
- (this.get(t)?.interactionIds || []).forEach((i) => {
2040
- const r = C(i, t);
2041
- delete this.addedInteractions[r];
2058
+ (this.get(t)?.interactionIds || []).forEach((r) => {
2059
+ const i = C(r, t);
2060
+ delete this.addedInteractions[i];
2042
2061
  });
2043
2062
  const s = `${t}::seq::`;
2044
- for (const i of w.sequenceCache.keys())
2045
- i.startsWith(s) && (w.sequenceCache.delete(i), delete this.addedInteractions[i]);
2063
+ for (const r of E.sequenceCache.keys())
2064
+ r.startsWith(s) && (E.sequenceCache.delete(r), delete this.addedInteractions[r]);
2046
2065
  }
2047
- setupMediaQueryListener(t, n, s, i) {
2048
- this.mediaQueryListeners.has(t) || (n.addEventListener("change", i), this.mediaQueryListeners.set(t, {
2066
+ setupMediaQueryListener(t, n, s, r) {
2067
+ this.mediaQueryListeners.has(t) || (n.addEventListener("change", r), this.mediaQueryListeners.set(t, {
2049
2068
  mql: n,
2050
- handler: i,
2069
+ handler: r,
2051
2070
  key: s
2052
2071
  }));
2053
2072
  }
2054
2073
  static create(t, n) {
2055
- const s = new w();
2056
- return w.instances.push(s), s.init(t, n), s;
2074
+ const s = new E();
2075
+ return E.instances.push(s), s.init(t, n), s;
2057
2076
  }
2058
2077
  static destroy() {
2059
- w.controllerCache.forEach((t) => {
2078
+ E.controllerCache.forEach((t) => {
2060
2079
  t.disconnect();
2061
- }), w.instances.length = 0, w.controllerCache.clear(), w.sequenceCache.clear();
2080
+ }), E.instances.length = 0, E.controllerCache.clear(), E.sequenceCache.clear(), E.elementSequenceMap = /* @__PURE__ */ new WeakMap();
2062
2081
  }
2063
2082
  static setup(t) {
2064
- t.scrollOptionsGetter && k.viewProgress.registerOptionsGetter?.(
2083
+ t.scrollOptionsGetter && q.viewProgress.registerOptionsGetter?.(
2065
2084
  t.scrollOptionsGetter
2066
- ), t.pointerOptionsGetter && k.pointerMove.registerOptionsGetter?.(
2085
+ ), t.pointerOptionsGetter && q.pointerMove.registerOptionsGetter?.(
2067
2086
  t.pointerOptionsGetter
2068
- ), t.viewEnter && k.viewEnter.setOptions(
2087
+ ), t.viewEnter && q.viewEnter.setOptions(
2069
2088
  t.viewEnter
2070
- ), t.allowA11yTriggers !== void 0 && (w.allowA11yTriggers = t.allowA11yTriggers);
2089
+ ), t.allowA11yTriggers !== void 0 && (E.allowA11yTriggers = t.allowA11yTriggers);
2071
2090
  }
2072
2091
  static getInstance(t) {
2073
- return w.instances.find((n) => n.has(t));
2092
+ return E.instances.find((n) => n.has(t));
2074
2093
  }
2075
2094
  static getController(t) {
2076
- return t ? w.controllerCache.get(t) : void 0;
2095
+ return t ? E.controllerCache.get(t) : void 0;
2077
2096
  }
2078
2097
  static setController(t, n) {
2079
- w.controllerCache.set(t, n);
2098
+ E.controllerCache.set(t, n);
2080
2099
  }
2081
2100
  static deleteController(t) {
2082
- w.controllerCache.delete(t);
2101
+ E.controllerCache.delete(t);
2083
2102
  }
2084
2103
  static registerEffects = Rt;
2085
- static getSequence(t, n, s, i) {
2086
- const r = w.sequenceCache.get(t);
2087
- if (r) return r;
2088
- const o = Bt(n, s, i);
2089
- return w.sequenceCache.set(t, o), o;
2090
- }
2091
- static addToSequence(t, n, s, i) {
2092
- const r = w.sequenceCache.get(t);
2093
- if (!r) return !1;
2094
- const c = Ve(n, i).map((u, f) => ({
2095
- index: s[f] ?? r.animationGroups.length,
2104
+ static getSequence(t, n, s, r) {
2105
+ const i = E.sequenceCache.get(t);
2106
+ if (i) return i;
2107
+ const o = Bt(n, s, r);
2108
+ return E.sequenceCache.set(t, o), E._registerSequenceElements(s, o), o;
2109
+ }
2110
+ static addToSequence(t, n, s, r) {
2111
+ const i = E.sequenceCache.get(t);
2112
+ if (!i) return !1;
2113
+ const c = Ve(n, r).map((u, f) => ({
2114
+ index: s[f] ?? i.animationGroups.length,
2096
2115
  group: u
2097
2116
  }));
2098
- return r.addGroups(c), !0;
2117
+ return i.addGroups(c), E._registerSequenceElements(n, i), !0;
2118
+ }
2119
+ static _registerSequenceElements(t, n) {
2120
+ for (const { target: s } of t) {
2121
+ const r = Array.isArray(s) ? s : s instanceof HTMLElement ? [s] : [];
2122
+ for (const i of r) {
2123
+ let o = E.elementSequenceMap.get(i);
2124
+ o || (o = /* @__PURE__ */ new Set(), E.elementSequenceMap.set(i, o)), o.add(n);
2125
+ }
2126
+ }
2127
+ }
2128
+ static removeFromSequences(t) {
2129
+ for (const n of t) {
2130
+ const s = E.elementSequenceMap.get(n);
2131
+ if (s) {
2132
+ for (const r of s)
2133
+ r.removeGroups(
2134
+ (i) => i.animations.some((o) => o.effect?.target === n)
2135
+ );
2136
+ E.elementSequenceMap.delete(n);
2137
+ }
2138
+ }
2099
2139
  }
2100
2140
  }
2101
2141
  let ss = 0;
@@ -2105,13 +2145,13 @@ function H(e, {
2105
2145
  useFirstChild: s = !1
2106
2146
  } = {}) {
2107
2147
  if (e.listContainer) {
2108
- const i = `${n && e.listItemSelector ? ` > ${e.listItemSelector}` : ""}`;
2109
- return e.selector ? `${e.listContainer}${i} ${e.selector}` : `${e.listContainer}${i || " > *"}`;
2148
+ const r = `${n && e.listItemSelector ? ` > ${e.listItemSelector}` : ""}`;
2149
+ return e.selector ? `${e.listContainer}${r} ${e.selector}` : `${e.listContainer}${r || " > *"}`;
2110
2150
  } else if (e.selector)
2111
2151
  return e.selector;
2112
2152
  return s ? t ? "> :first-child" : ":scope > :first-child" : "";
2113
2153
  }
2114
- function Pe(e) {
2154
+ function $e(e) {
2115
2155
  return "sequenceId" in e && !("effects" in e);
2116
2156
  }
2117
2157
  function ce(e, t) {
@@ -2125,58 +2165,58 @@ function ce(e, t) {
2125
2165
  }
2126
2166
  function is(e, t = !1) {
2127
2167
  const n = e.conditions || {}, s = {};
2128
- return e.interactions?.forEach((i) => {
2129
- const r = i.key, o = ++ss, { effects: c, sequences: u, ...f } = i;
2130
- if (!r) {
2168
+ return e.interactions?.forEach((r) => {
2169
+ const i = r.key, o = ++ss, { effects: c, sequences: u, ...f } = r;
2170
+ if (!i) {
2131
2171
  console.error(`Interaction ${o} is missing a key for source element.`);
2132
2172
  return;
2133
2173
  }
2134
- ce(s, r);
2174
+ ce(s, i);
2135
2175
  const a = c ? Array.from(c) : [];
2136
2176
  a.reverse();
2137
2177
  const l = u?.map((d) => {
2138
- if (Pe(d)) {
2178
+ if ($e(d)) {
2139
2179
  const p = e.sequences?.[d.sequenceId];
2140
2180
  return p ? { ...p, ...d } : (console.warn(`Interact: Sequence "${d.sequenceId}" not found in config`), d);
2141
2181
  }
2142
2182
  const h = d;
2143
- return h.sequenceId || (h.sequenceId = x()), h;
2183
+ return h.sequenceId || (h.sequenceId = _()), h;
2144
2184
  }), m = {
2145
2185
  ...f,
2146
2186
  effects: a.length > 0 ? a : void 0,
2147
2187
  sequences: l
2148
2188
  };
2149
- s[r].triggers.push(m), s[r].selectors.add(
2189
+ s[i].triggers.push(m), s[i].selectors.add(
2150
2190
  H(m, { useFirstChild: t })
2151
2191
  );
2152
2192
  const g = m.listContainer;
2153
2193
  a.forEach((d) => {
2154
2194
  let h = d.key;
2155
2195
  if (!h && d.effectId) {
2156
- const E = e.effects[d.effectId];
2157
- E && (h = E.key);
2196
+ const w = e.effects[d.effectId];
2197
+ w && (h = w.key);
2158
2198
  }
2159
- d.effectId || (d.effectId = x()), h = h || r, d.key = h;
2199
+ d.effectId || (d.effectId = _()), h = h || i, d.key = h;
2160
2200
  const p = d.effectId;
2161
- if (g && d.listContainer && (h !== r || d.listContainer !== g))
2201
+ if (g && d.listContainer && (h !== i || d.listContainer !== g))
2162
2202
  return;
2163
- const y = `${r}::${h}::${p}::${o}`;
2164
- if (d.interactionId = y, s[r].interactionIds.add(y), h === r)
2203
+ const y = `${i}::${h}::${p}::${o}`;
2204
+ if (d.interactionId = y, s[i].interactionIds.add(y), h === i)
2165
2205
  return;
2166
2206
  const v = ce(s, h);
2167
2207
  v.effects[y] || (v.effects[y] = [], v.interactionIds.add(y)), v.effects[y].push({ ...f, effect: d }), v.selectors.add(H(d, { useFirstChild: t }));
2168
2208
  }), l?.forEach((d) => {
2169
- if (!d || Pe(d)) return;
2170
- const h = d, p = h.sequenceId || x(), y = h.effects;
2209
+ if (!d || $e(d)) return;
2210
+ const h = d, p = h.sequenceId || _(), y = h.effects;
2171
2211
  for (const v of y) {
2172
- v.effectId || (v.effectId = x());
2173
- let E = v.key;
2174
- if (!E && v.effectId) {
2212
+ v.effectId || (v.effectId = _());
2213
+ let w = v.key;
2214
+ if (!w && v.effectId) {
2175
2215
  const b = e.effects[v.effectId];
2176
- b && (E = b.key);
2216
+ b && (w = b.key);
2177
2217
  }
2178
- if (E = E || r, E !== r) {
2179
- const b = ce(s, E), S = `${E}::seq::${p}::${o}`;
2218
+ if (w = w || i, w !== i) {
2219
+ const b = ce(s, w), S = `${w}::seq::${p}::${o}`;
2180
2220
  b.sequences[S] || (b.sequences[S] = [], b.interactionIds.add(S)), b.sequences[S].push({
2181
2221
  ...f,
2182
2222
  sequence: h
@@ -2207,16 +2247,16 @@ function pe(e, t, n) {
2207
2247
  function ge(e, t) {
2208
2248
  return t.map((n) => e.selector ? n.querySelector(e.selector) : n).filter(Boolean);
2209
2249
  }
2210
- function Xe(e, t, n, s, i, r, o, c) {
2250
+ function Xe(e, t, n, s, r, i, o, c) {
2211
2251
  return [
2212
2252
  o ? ge(e, o) : pe(e, n, s),
2213
- c ? ge(t, c) : pe(t, i, r)
2253
+ c ? ge(t, c) : pe(t, r, i)
2214
2254
  ];
2215
2255
  }
2216
- function Ue(e, t, n, s, i, r, o) {
2217
- const c = Array.isArray(s), u = Array.isArray(i);
2256
+ function Ue(e, t, n, s, r, i, o) {
2257
+ const c = Array.isArray(s), u = Array.isArray(r);
2218
2258
  c ? s.forEach((f, a) => {
2219
- const l = u ? i[a] : i;
2259
+ const l = u ? r[a] : r;
2220
2260
  l && Fe(
2221
2261
  e,
2222
2262
  f,
@@ -2224,10 +2264,10 @@ function Ue(e, t, n, s, i, r, o) {
2224
2264
  l,
2225
2265
  n,
2226
2266
  t.params,
2227
- r,
2267
+ i,
2228
2268
  o
2229
2269
  );
2230
- }) : (u ? i : [i]).forEach((a) => {
2270
+ }) : (u ? r : [r]).forEach((a) => {
2231
2271
  Fe(
2232
2272
  e,
2233
2273
  s,
@@ -2235,30 +2275,30 @@ function Ue(e, t, n, s, i, r, o) {
2235
2275
  a,
2236
2276
  n,
2237
2277
  t.params,
2238
- r,
2278
+ i,
2239
2279
  o
2240
2280
  );
2241
2281
  });
2242
2282
  }
2243
- function Je(e, t, n, s, i) {
2244
- const r = {}, o = [];
2283
+ function Je(e, t, n, s, r) {
2284
+ const i = {}, o = [];
2245
2285
  (s.effects || []).forEach((c) => {
2246
2286
  const u = c.effectId, f = {
2247
2287
  ...n.dataCache.effects[u] || {},
2248
2288
  ...c,
2249
2289
  effectId: u
2250
2290
  }, a = f.key, l = C(c.interactionId, e);
2251
- if (r[l] || n.addedInteractions[l] && !i)
2291
+ if (i[l] || n.addedInteractions[l] && !r)
2252
2292
  return;
2253
- const m = _(f.conditions || [], n.dataCache.conditions);
2293
+ const m = k(f.conditions || [], n.dataCache.conditions);
2254
2294
  if (m && n.setupMediaQueryListener(l, m, e, () => {
2255
2295
  t.update();
2256
2296
  }), !m || m.matches) {
2257
- r[l] = !0;
2297
+ i[l] = !0;
2258
2298
  const g = a && C(a, e);
2259
2299
  let d;
2260
2300
  if (g) {
2261
- if (d = w.getController(g), !d)
2301
+ if (d = E.getController(g), !d)
2262
2302
  return;
2263
2303
  f.listContainer && d.watchChildList(f.listContainer);
2264
2304
  } else
@@ -2270,12 +2310,12 @@ function Je(e, t, n, s, i) {
2270
2310
  t.useFirstChild,
2271
2311
  d.element,
2272
2312
  d.useFirstChild,
2273
- i
2313
+ r
2274
2314
  );
2275
2315
  if (!h || !p)
2276
2316
  return;
2277
2317
  n.addedInteractions[l] = !0;
2278
- const y = g || s.key, v = M(
2318
+ const y = g || s.key, v = L(
2279
2319
  f.conditions || [],
2280
2320
  n.dataCache.conditions
2281
2321
  );
@@ -2291,73 +2331,73 @@ function Je(e, t, n, s, i) {
2291
2331
  }
2292
2332
  }), o.reverse().forEach((c) => {
2293
2333
  Ue(...c);
2294
- }), os(e, t, n, s, i);
2334
+ }), os(e, t, n, s, r);
2295
2335
  }
2296
2336
  function rs(e) {
2297
2337
  return "sequenceId" in e && !("effects" in e);
2298
2338
  }
2299
- function Ze(e, t, n, s, i, r, o) {
2300
- const c = _(e.conditions || [], i.dataCache.conditions);
2301
- if (c && i.setupMediaQueryListener(t, c, r.updateKey, r.onUpdate), c && !c.matches) return null;
2339
+ function Ze(e, t, n, s, r, i, o) {
2340
+ const c = k(e.conditions || [], r.dataCache.conditions);
2341
+ if (c && r.setupMediaQueryListener(t, c, i.updateKey, i.onUpdate), c && !c.matches) return null;
2302
2342
  const u = e.effects || [], f = [];
2303
2343
  let a = !1;
2304
2344
  for (const l of u) {
2305
2345
  const m = l.effectId, d = {
2306
- ...m ? i.dataCache.effects[m] || {} : {},
2346
+ ...m ? r.dataCache.effects[m] || {} : {},
2307
2347
  ...l
2308
- }, h = _(d.conditions || [], i.dataCache.conditions);
2348
+ }, h = k(d.conditions || [], r.dataCache.conditions);
2309
2349
  if (h) {
2310
- const T = `${t}::${m || "eff"}`;
2311
- i.setupMediaQueryListener(
2312
- T,
2350
+ const I = `${t}::${m || "eff"}`;
2351
+ r.setupMediaQueryListener(
2352
+ I,
2313
2353
  h,
2314
- r.updateKey,
2315
- r.onUpdate
2354
+ i.updateKey,
2355
+ i.onUpdate
2316
2356
  );
2317
2357
  }
2318
2358
  if (h && !h.matches) continue;
2319
2359
  const p = d.key, y = p && C(p, n);
2320
2360
  let v;
2321
2361
  if (y) {
2322
- if (v = w.getController(y), !v) return null;
2362
+ if (v = E.getController(y), !v) return null;
2323
2363
  } else
2324
2364
  v = s;
2325
- const E = y || n;
2365
+ const w = y || n;
2326
2366
  let b;
2327
- if (o && E === o.controllerKey && d.listContainer === o.listContainer ? (b = ge(d, o.elements), b.length > 0 && (a = !0)) : b = pe(
2367
+ if (o && w === o.controllerKey && d.listContainer === o.listContainer ? (b = ge(d, o.elements), b.length > 0 && (a = !0)) : b = pe(
2328
2368
  d,
2329
2369
  v.element,
2330
2370
  v.useFirstChild
2331
2371
  ), !b || Array.isArray(b) && b.length === 0) return null;
2332
- const S = $(d);
2372
+ const S = P(d);
2333
2373
  f.push({ target: b, options: S });
2334
2374
  }
2335
2375
  return o && !a ? null : f.length > 0 ? f : null;
2336
2376
  }
2337
2377
  function et(e, t, n) {
2338
- const r = (e.useFirstChild ? e.element.firstElementChild : e.element)?.querySelector(t);
2339
- if (!r) return n.map((c, u) => u);
2340
- const o = Array.from(r.children);
2378
+ const i = (e.useFirstChild ? e.element.firstElementChild : e.element)?.querySelector(t);
2379
+ if (!i) return n.map((c, u) => u);
2380
+ const o = Array.from(i.children);
2341
2381
  return n.map((c) => {
2342
2382
  const u = o.indexOf(c);
2343
2383
  return u >= 0 ? u : o.length;
2344
2384
  });
2345
2385
  }
2346
- function os(e, t, n, s, i) {
2347
- s.sequences?.forEach((r) => {
2386
+ function os(e, t, n, s, r) {
2387
+ s.sequences?.forEach((i) => {
2348
2388
  let o;
2349
- if (rs(r)) {
2350
- const g = n.dataCache.sequences[r.sequenceId];
2389
+ if (rs(i)) {
2390
+ const g = n.dataCache.sequences[i.sequenceId];
2351
2391
  if (!g) {
2352
- console.warn(`Interact: Sequence "${r.sequenceId}" not found in cache`);
2392
+ console.warn(`Interact: Sequence "${i.sequenceId}" not found in cache`);
2353
2393
  return;
2354
2394
  }
2355
- o = { ...g, ...r };
2395
+ o = { ...g, ...i };
2356
2396
  } else
2357
- o = r;
2358
- const c = o.sequenceId || x(), u = C(`${e}::seq::${c}`, e);
2359
- if (n.addedInteractions[u] && !i) return;
2360
- const f = i && s.listContainer ? { controllerKey: e, listContainer: s.listContainer, elements: i } : void 0, a = Ze(
2397
+ o = i;
2398
+ const c = o.sequenceId || _(), u = C(`${e}::seq::${c}`, e);
2399
+ if (n.addedInteractions[u] && !r) return;
2400
+ const f = r && s.listContainer ? { controllerKey: e, listContainer: s.listContainer, elements: r } : void 0, a = Ze(
2361
2401
  o,
2362
2402
  u,
2363
2403
  e,
@@ -2367,54 +2407,54 @@ function os(e, t, n, s, i) {
2367
2407
  f
2368
2408
  );
2369
2409
  if (!a) return;
2370
- if (i && n.addedInteractions[u]) {
2410
+ if (r && n.addedInteractions[u]) {
2371
2411
  const g = et(
2372
2412
  t,
2373
2413
  s.listContainer,
2374
- i
2414
+ r
2375
2415
  );
2376
- w.addToSequence(u, a, g, {
2377
- reducedMotion: w.forceReducedMotion
2416
+ E.addToSequence(u, a, g, {
2417
+ reducedMotion: E.forceReducedMotion
2378
2418
  });
2379
2419
  return;
2380
2420
  }
2381
- const l = w.getSequence(u, o, a, {
2382
- reducedMotion: w.forceReducedMotion
2421
+ const l = E.getSequence(u, o, a, {
2422
+ reducedMotion: E.forceReducedMotion
2383
2423
  });
2384
2424
  n.addedInteractions[u] = !0;
2385
- const m = M(
2425
+ const m = L(
2386
2426
  s.conditions || [],
2387
2427
  n.dataCache.conditions
2388
2428
  );
2389
- k[s.trigger]?.add(
2429
+ q[s.trigger]?.add(
2390
2430
  t.element,
2391
2431
  t.element,
2392
2432
  {},
2393
2433
  s.params || {},
2394
2434
  {
2395
- reducedMotion: w.forceReducedMotion,
2435
+ reducedMotion: E.forceReducedMotion,
2396
2436
  selectorCondition: m,
2397
2437
  animation: l,
2398
- allowA11yTriggers: w.allowA11yTriggers
2438
+ allowA11yTriggers: E.allowA11yTriggers
2399
2439
  }
2400
2440
  );
2401
2441
  });
2402
2442
  }
2403
- function cs(e, t, n, s, i) {
2404
- const r = n.get(e)?.sequences || {};
2405
- Object.keys(r).forEach((c) => {
2406
- r[c].some(({ sequence: f, ...a }) => {
2407
- const l = _(
2443
+ function cs(e, t, n, s, r) {
2444
+ const i = n.get(e)?.sequences || {};
2445
+ Object.keys(i).forEach((c) => {
2446
+ i[c].some(({ sequence: f, ...a }) => {
2447
+ const l = k(
2408
2448
  a.conditions || [],
2409
2449
  n.dataCache.conditions
2410
2450
  );
2411
2451
  if (l && !l.matches)
2412
2452
  return !1;
2413
- const m = a.key && C(a.key, e), g = w.getController(m);
2453
+ const m = a.key && C(a.key, e), g = E.getController(m);
2414
2454
  if (!g)
2415
2455
  return !0;
2416
- const d = f.sequenceId || x(), h = C(`${m}::seq::${d}`, m);
2417
- if (n.addedInteractions[h] && !i)
2456
+ const d = f.sequenceId || _(), h = C(`${m}::seq::${d}`, m);
2457
+ if (n.addedInteractions[h] && !r)
2418
2458
  return !0;
2419
2459
  const y = Ze(
2420
2460
  f,
@@ -2423,46 +2463,46 @@ function cs(e, t, n, s, i) {
2423
2463
  g,
2424
2464
  n,
2425
2465
  { updateKey: e, onUpdate: () => t.update() },
2426
- i && s ? { controllerKey: e, listContainer: s, elements: i } : void 0
2466
+ r && s ? { controllerKey: e, listContainer: s, elements: r } : void 0
2427
2467
  );
2428
2468
  if (!y) return !0;
2429
- if (i && n.addedInteractions[h]) {
2430
- const b = et(t, s, i);
2431
- return w.addToSequence(h, y, b, {
2432
- reducedMotion: w.forceReducedMotion
2469
+ if (r && n.addedInteractions[h]) {
2470
+ const b = et(t, s, r);
2471
+ return E.addToSequence(h, y, b, {
2472
+ reducedMotion: E.forceReducedMotion
2433
2473
  }), !0;
2434
2474
  }
2435
- const v = w.getSequence(h, f, y, {
2436
- reducedMotion: w.forceReducedMotion
2475
+ const v = E.getSequence(h, f, y, {
2476
+ reducedMotion: E.forceReducedMotion
2437
2477
  });
2438
2478
  n.addedInteractions[h] = !0;
2439
- const E = M(
2479
+ const w = L(
2440
2480
  a.conditions || [],
2441
2481
  n.dataCache.conditions
2442
2482
  );
2443
- return k[a.trigger]?.add(
2483
+ return q[a.trigger]?.add(
2444
2484
  g.element,
2445
2485
  g.element,
2446
2486
  {},
2447
2487
  a.params || {},
2448
2488
  {
2449
- reducedMotion: w.forceReducedMotion,
2450
- selectorCondition: E,
2489
+ reducedMotion: E.forceReducedMotion,
2490
+ selectorCondition: w,
2451
2491
  animation: v,
2452
- allowA11yTriggers: w.allowA11yTriggers
2492
+ allowA11yTriggers: E.allowA11yTriggers
2453
2493
  }
2454
2494
  ), !0;
2455
2495
  });
2456
2496
  });
2457
2497
  }
2458
- function tt(e, t, n, s, i) {
2459
- const r = n.get(e), o = r?.effects || {}, c = Object.keys(o), u = [];
2498
+ function tt(e, t, n, s, r) {
2499
+ const i = n.get(e), o = i?.effects || {}, c = Object.keys(o), u = [];
2460
2500
  c.forEach((a) => {
2461
2501
  const l = C(a, e);
2462
- if (n.addedInteractions[l] && !i)
2502
+ if (n.addedInteractions[l] && !r)
2463
2503
  return;
2464
2504
  o[a].some(({ effect: g, ...d }) => {
2465
- const h = _(
2505
+ const h = k(
2466
2506
  d.conditions || [],
2467
2507
  n.dataCache.conditions
2468
2508
  );
@@ -2475,15 +2515,15 @@ function tt(e, t, n, s, i) {
2475
2515
  };
2476
2516
  if (s && y.listContainer !== s)
2477
2517
  return !1;
2478
- const v = _(y.conditions || [], n.dataCache.conditions);
2518
+ const v = k(y.conditions || [], n.dataCache.conditions);
2479
2519
  if (v && n.setupMediaQueryListener(l, v, e, () => {
2480
2520
  t.update();
2481
2521
  }), !v || v.matches) {
2482
- const E = d.key && C(d.key, e), b = w.getController(E);
2522
+ const w = d.key && C(d.key, e), b = E.getController(w);
2483
2523
  if (!b)
2484
2524
  return !0;
2485
2525
  y.listContainer && t.watchChildList(y.listContainer);
2486
- const [S, T] = Xe(
2526
+ const [S, I] = Xe(
2487
2527
  d,
2488
2528
  y,
2489
2529
  b.element,
@@ -2491,12 +2531,12 @@ function tt(e, t, n, s, i) {
2491
2531
  t.element,
2492
2532
  t.useFirstChild,
2493
2533
  void 0,
2494
- i
2534
+ r
2495
2535
  );
2496
- if (!S || !T)
2536
+ if (!S || !I)
2497
2537
  return !0;
2498
2538
  n.addedInteractions[l] = !0;
2499
- const P = M(
2539
+ const $ = L(
2500
2540
  y.conditions || [],
2501
2541
  n.dataCache.conditions
2502
2542
  );
@@ -2505,8 +2545,8 @@ function tt(e, t, n, s, i) {
2505
2545
  d,
2506
2546
  y,
2507
2547
  S,
2508
- T,
2509
- P,
2548
+ I,
2549
+ $,
2510
2550
  t.useFirstChild
2511
2551
  ]), !0;
2512
2552
  }
@@ -2514,43 +2554,43 @@ function tt(e, t, n, s, i) {
2514
2554
  });
2515
2555
  }), u.reverse().forEach((a) => {
2516
2556
  Ue(...a);
2517
- }), cs(e, t, n, s, i);
2518
- const f = Object.keys(r?.sequences || {}).length > 0;
2557
+ }), cs(e, t, n, s, r);
2558
+ const f = Object.keys(i?.sequences || {}).length > 0;
2519
2559
  return c.length > 0 || f;
2520
2560
  }
2521
- function Fe(e, t, n, s, i, r, o, c) {
2561
+ function Fe(e, t, n, s, r, i, o, c) {
2522
2562
  let u;
2523
- if (i.transition || i.transitionProperties) {
2563
+ if (r.transition || r.transitionProperties) {
2524
2564
  const f = {
2525
2565
  key: e,
2526
- effectId: i.effectId,
2527
- transition: i.transition,
2528
- properties: i.transitionProperties,
2529
- childSelector: H(i, {
2566
+ effectId: r.effectId,
2567
+ transition: r.transition,
2568
+ properties: r.transitionProperties,
2569
+ childSelector: H(r, {
2530
2570
  asCombinator: !0,
2531
2571
  addItemFilter: !0,
2532
2572
  useFirstChild: c
2533
2573
  }),
2534
2574
  selectorCondition: o
2535
2575
  };
2536
- if (u = w.getController(e), !u)
2576
+ if (u = E.getController(e), !u)
2537
2577
  return;
2538
2578
  u.renderStyle(Kt(f));
2539
2579
  }
2540
- k[n]?.add(t, s, i, r, {
2541
- reducedMotion: w.forceReducedMotion,
2580
+ q[n]?.add(t, s, r, i, {
2581
+ reducedMotion: E.forceReducedMotion,
2542
2582
  targetController: u,
2543
2583
  selectorCondition: o,
2544
- allowA11yTriggers: w.allowA11yTriggers
2584
+ allowA11yTriggers: E.allowA11yTriggers
2545
2585
  });
2546
2586
  }
2547
2587
  function as(e) {
2548
- const t = e.key, n = w.getInstance(t);
2588
+ const t = e.key, n = E.getInstance(t);
2549
2589
  if (!n)
2550
- return console.warn(`No instance found for key: ${t}`), w.setController(t, e), !1;
2551
- const { triggers: s = [] } = n?.get(t) || {}, i = s.length > 0;
2590
+ return console.warn(`No instance found for key: ${t}`), E.setController(t, e), !1;
2591
+ const { triggers: s = [] } = n?.get(t) || {}, r = s.length > 0;
2552
2592
  n.setController(t, e), s.forEach((o, c) => {
2553
- const u = _(o.conditions, n.dataCache.conditions);
2593
+ const u = k(o.conditions, n.dataCache.conditions);
2554
2594
  if (u) {
2555
2595
  const f = `${t}::trigger::${c}`;
2556
2596
  n.setupMediaQueryListener(f, u, t, () => {
@@ -2559,40 +2599,41 @@ function as(e) {
2559
2599
  }
2560
2600
  (!u || u.matches) && (o.listContainer && e.watchChildList(o.listContainer), Je(t, e, n, o));
2561
2601
  });
2562
- let r = !1;
2563
- return n && (r = tt(t, e, n)), i || r;
2602
+ let i = !1;
2603
+ return n && (i = tt(t, e, n)), r || i;
2564
2604
  }
2565
2605
  function fs(e, t, n) {
2566
- const s = e.key, i = w.getInstance(s);
2567
- if (i) {
2568
- const { triggers: r = [] } = i?.get(s) || {};
2569
- r.forEach((o, c) => {
2606
+ const s = e.key, r = E.getInstance(s);
2607
+ if (r) {
2608
+ const { triggers: i = [] } = r?.get(s) || {};
2609
+ i.forEach((o, c) => {
2570
2610
  if (o.listContainer !== t)
2571
2611
  return;
2572
- const u = _(o.conditions, i.dataCache.conditions);
2612
+ const u = k(o.conditions, r.dataCache.conditions);
2573
2613
  if (u) {
2574
2614
  const f = `${s}::listTrigger::${t}::${c}`;
2575
- i.setupMediaQueryListener(f, u, s, () => {
2615
+ r.setupMediaQueryListener(f, u, s, () => {
2576
2616
  e.update();
2577
2617
  });
2578
2618
  }
2579
- (!u || u.matches) && Je(s, e, i, o, n);
2580
- }), tt(s, e, i, t, n);
2619
+ (!u || u.matches) && Je(s, e, r, o, n);
2620
+ }), tt(s, e, r, t, n);
2581
2621
  }
2582
2622
  }
2583
2623
  function ls(e, t = !1) {
2584
- const n = e.key, s = w.getInstance(n);
2624
+ const n = e.key, s = E.getInstance(n);
2585
2625
  if (!s)
2586
2626
  return;
2587
- const i = [...s.get(n)?.selectors.values() || []].filter(Boolean).join(",");
2588
- let r;
2589
- i ? (r = [...e.element.querySelectorAll(i)], e.useFirstChild || r.push(e.element)) : r = [e.element], nt(r), s.deleteController(n, t);
2627
+ const r = [...s.get(n)?.selectors.values() || []].filter(Boolean).join(",");
2628
+ let i;
2629
+ r ? (i = [...e.element.querySelectorAll(r)], e.useFirstChild || i.push(e.element)) : i = [e.element], nt(i), s.deleteController(n, t);
2590
2630
  }
2591
2631
  function nt(e) {
2592
- const t = Object.values(k);
2632
+ const t = Object.values(q);
2593
2633
  for (const n of e)
2594
2634
  for (const s of t)
2595
2635
  s.remove(n);
2636
+ E.removeFromSequences(e);
2596
2637
  }
2597
2638
  const ae = "interactEffect";
2598
2639
  class us {
@@ -2636,22 +2677,22 @@ class us {
2636
2677
  for (const s of t)
2637
2678
  try {
2638
2679
  this.sheet.insertRule(s, n), n++;
2639
- } catch (i) {
2640
- console.error(i);
2680
+ } catch (r) {
2681
+ console.error(r);
2641
2682
  }
2642
2683
  }
2643
2684
  }
2644
- toggleEffect(t, n, s, i) {
2685
+ toggleEffect(t, n, s, r) {
2645
2686
  if (s === null)
2646
2687
  return;
2647
- if (!i && this.element.toggleEffect) {
2688
+ if (!r && this.element.toggleEffect) {
2648
2689
  this.element.toggleEffect(t, n, s);
2649
2690
  return;
2650
2691
  }
2651
- const r = new Set(
2692
+ const i = new Set(
2652
2693
  this.element.dataset[ae]?.split(" ") || []
2653
2694
  );
2654
- n === "toggle" ? r.has(t) ? r.delete(t) : r.add(t) : n === "add" ? r.add(t) : n === "remove" ? r.delete(t) : n === "clear" && r.clear(), (s || this.element).dataset[ae] = Array.from(r).join(" ");
2695
+ n === "toggle" ? i.has(t) ? i.delete(t) : i.add(t) : n === "add" ? i.add(t) : n === "remove" ? i.delete(t) : n === "clear" && i.clear(), (s || this.element).dataset[ae] = Array.from(i).join(" ");
2655
2696
  }
2656
2697
  getActiveEffects() {
2657
2698
  const n = (this.element.dataset[ae] || "").trim();
@@ -2665,34 +2706,34 @@ class us {
2665
2706
  }
2666
2707
  }
2667
2708
  _childListChangeHandler(t, n) {
2668
- const s = this.key || this.element.dataset.interactKey, i = [], r = [];
2709
+ const s = this.key || this.element.dataset.interactKey, r = [], i = [];
2669
2710
  n.forEach((o) => {
2670
2711
  o.removedNodes.forEach((c) => {
2671
- c instanceof HTMLElement && i.push(c);
2672
- }), o.addedNodes.forEach((c) => {
2673
2712
  c instanceof HTMLElement && r.push(c);
2713
+ }), o.addedNodes.forEach((c) => {
2714
+ c instanceof HTMLElement && i.push(c);
2674
2715
  });
2675
- }), nt(i), s && fs(this, t, r);
2716
+ }), nt(r), s && fs(this, t, i);
2676
2717
  }
2677
2718
  }
2678
2719
  function gs(e, t) {
2679
2720
  new us(e, t).connect();
2680
2721
  }
2681
2722
  function vs(e) {
2682
- const t = w.getController(e);
2723
+ const t = E.getController(e);
2683
2724
  t && t.disconnect({ removeFromCache: !0 });
2684
2725
  }
2685
2726
  const ds = (e, t, n, s) => {
2686
- let r = `[data-interact-key="${e.replace(/"/g, "'")}"]`;
2727
+ let i = `[data-interact-key="${e.replace(/"/g, "'")}"]`;
2687
2728
  const o = H(t, { asCombinator: !0, useFirstChild: s });
2688
- return o && (r = `${r} ${o}`), n && (r = Q(r, n)), r;
2729
+ return o && (i = `${i} ${o}`), n && (i = Q(i, n)), i;
2689
2730
  };
2690
2731
  function ys(e, t = !1) {
2691
2732
  const n = [], s = /* @__PURE__ */ new Set();
2692
2733
  return e.interactions.forEach(
2693
2734
  ({
2694
- key: i,
2695
- selector: r,
2735
+ key: r,
2736
+ selector: i,
2696
2737
  listContainer: o,
2697
2738
  listItemSelector: c,
2698
2739
  trigger: u,
@@ -2706,21 +2747,21 @@ function ys(e, t = !1) {
2706
2747
  const p = h?.effectId && e.effects[h.effectId] || h, {
2707
2748
  key: y,
2708
2749
  selector: v,
2709
- listContainer: E,
2750
+ listContainer: w,
2710
2751
  listItemSelector: b,
2711
2752
  conditions: S
2712
2753
  } = p;
2713
- if (!(!y || y === i) || !(!v && !r || v === r) || !(!E && !o || E === o) || !(!b && !c || b === c)) return;
2714
- const ye = e.conditions || {}, Ee = M(
2754
+ if (!(!y || y === r) || !(!v && !i || v === i) || !(!w && !o || w === o) || !(!b && !c || b === c)) return;
2755
+ const ye = e.conditions || {}, Ee = L(
2715
2756
  S,
2716
2757
  ye
2717
- ), se = M(
2758
+ ), se = L(
2718
2759
  l,
2719
2760
  ye
2720
2761
  );
2721
2762
  if (!(!Ee && !se || Ee === se)) return;
2722
2763
  const ie = ds(
2723
- i,
2764
+ r,
2724
2765
  p,
2725
2766
  se,
2726
2767
  t
@@ -2742,9 +2783,9 @@ function ys(e, t = !1) {
2742
2783
  }
2743
2784
  export {
2744
2785
  us as I,
2745
- w as a,
2786
+ E as a,
2746
2787
  gs as b,
2747
2788
  ys as g,
2748
2789
  vs as r
2749
2790
  };
2750
- //# sourceMappingURL=index-BZL18ynN.mjs.map
2791
+ //# sourceMappingURL=index-BtEG0cjF.mjs.map