@wix/interact 2.3.0 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +322 -246
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/react.js +1 -1
- package/dist/cjs/web.js +1 -1
- package/dist/es/index.js +1 -1
- package/dist/es/react.js +2 -2
- package/dist/es/web.js +2 -2
- package/dist/{index-CBaynReP.mjs → index-C6u4q815.mjs} +531 -502
- package/dist/index-C6u4q815.mjs.map +1 -0
- package/dist/index-Qg46rn0Y.js +21 -0
- package/dist/index-Qg46rn0Y.js.map +1 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/types/core/add.d.ts.map +1 -1
- package/dist/types/core/cssUtils.d.ts.map +1 -1
- package/dist/types/handlers/animationEnd.d.ts +1 -1
- package/dist/types/handlers/animationEnd.d.ts.map +1 -1
- package/dist/types/types/handlers.d.ts +2 -1
- package/dist/types/types/handlers.d.ts.map +1 -1
- package/docs/api/functions.md +2 -2
- package/package.json +4 -2
- package/dist/index-B9B40HvU.js +0 -21
- package/dist/index-B9B40HvU.js.map +0 -1
- package/dist/index-CBaynReP.mjs.map +0 -1
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
function
|
|
1
|
+
function vt(t) {
|
|
2
2
|
return [...t.matchAll(/\[([-\w]+)]/g)].map(([e, n]) => n);
|
|
3
3
|
}
|
|
4
4
|
function $(t, e) {
|
|
5
|
-
const n =
|
|
5
|
+
const n = vt(e);
|
|
6
6
|
let s = 0;
|
|
7
7
|
return n.length ? t.replace(/\[]/g, () => {
|
|
8
8
|
const i = n[s++];
|
|
9
9
|
return i !== void 0 ? `[${i}]` : "[]";
|
|
10
10
|
}) : t;
|
|
11
11
|
}
|
|
12
|
-
function
|
|
12
|
+
function yt(t, e) {
|
|
13
13
|
return t.trigger === "viewEnter" && e.triggerType === "once" && G(t) === G(e);
|
|
14
14
|
}
|
|
15
15
|
function G(t) {
|
|
@@ -79,8 +79,8 @@ class V {
|
|
|
79
79
|
if (n && !this.isCSS) {
|
|
80
80
|
const s = n.effect?.target;
|
|
81
81
|
if (s) {
|
|
82
|
-
const i = new
|
|
83
|
-
s.dispatchEvent(
|
|
82
|
+
const i = this.options?.effectId || n.id, r = new CustomEvent("animationend", { detail: { effectId: i } });
|
|
83
|
+
s.dispatchEvent(r);
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
86
|
e();
|
|
@@ -109,7 +109,13 @@ class V {
|
|
|
109
109
|
return Promise.all(this.animations.map((e) => e.finished));
|
|
110
110
|
}
|
|
111
111
|
get playState() {
|
|
112
|
-
return this.animations[0]?.playState;
|
|
112
|
+
return this.animations.some((e) => e.playState === "running") ? "running" : this.animations[0]?.playState;
|
|
113
|
+
}
|
|
114
|
+
hasAnimationName(e) {
|
|
115
|
+
return this.animations.some((n) => n.animationName === e);
|
|
116
|
+
}
|
|
117
|
+
hasAnimationId(e) {
|
|
118
|
+
return this.animations.some((n) => n.id === e);
|
|
113
119
|
}
|
|
114
120
|
getTimingOptions() {
|
|
115
121
|
return this.animations.map((e) => {
|
|
@@ -122,32 +128,32 @@ class V {
|
|
|
122
128
|
});
|
|
123
129
|
}
|
|
124
130
|
}
|
|
125
|
-
const je = (t) => t,
|
|
131
|
+
const je = (t) => t, Et = (t) => 1 - Math.cos(t * Math.PI / 2), wt = (t) => Math.sin(t * Math.PI / 2), bt = (t) => -(Math.cos(Math.PI * t) - 1) / 2, St = (t) => t ** 2, Tt = (t) => 1 - (1 - t) ** 2, It = (t) => t < 0.5 ? 2 * t ** 2 : 1 - (-2 * t + 2) ** 2 / 2, Ot = (t) => t ** 3, At = (t) => 1 - (1 - t) ** 3, Ct = (t) => t < 0.5 ? 4 * t ** 3 : 1 - (-2 * t + 2) ** 3 / 2, kt = (t) => t ** 4, $t = (t) => 1 - (1 - t) ** 4, _t = (t) => t < 0.5 ? 8 * t ** 4 : 1 - (-2 * t + 2) ** 4 / 2, qt = (t) => t ** 5, Mt = (t) => 1 - (1 - t) ** 5, xt = (t) => t < 0.5 ? 16 * t ** 5 : 1 - (-2 * t + 2) ** 5 / 2, Pt = (t) => t === 0 ? 0 : 2 ** (10 * t - 10), Lt = (t) => t === 1 ? 1 : 1 - 2 ** (-10 * t), Rt = (t) => t === 0 ? 0 : t === 1 ? 1 : t < 0.5 ? 2 ** (20 * t - 10) / 2 : (2 - 2 ** (-20 * t + 10)) / 2, Ft = (t) => 1 - Math.sqrt(1 - t ** 2), Nt = (t) => Math.sqrt(1 - (t - 1) ** 2), zt = (t) => t < 0.5 ? (1 - Math.sqrt(1 - 4 * t ** 2)) / 2 : (Math.sqrt(-(2 * t - 3) * (2 * t - 1)) + 1) / 2, Ht = (t) => 2.70158 * t ** 3 - 1.70158 * t ** 2, jt = (t) => 1 + 2.70158 * (t - 1) ** 3 + 1.70158 * (t - 1) ** 2, Dt = (t, e = 1.70158 * 1.525) => t < 0.5 ? (2 * t) ** 2 * ((e + 1) * 2 * t - e) / 2 : ((2 * t - 2) ** 2 * ((e + 1) * (t * 2 - 2) + e) + 2) / 2, Te = {
|
|
126
132
|
linear: je,
|
|
127
|
-
sineIn:
|
|
128
|
-
sineOut:
|
|
129
|
-
sineInOut:
|
|
130
|
-
quadIn:
|
|
131
|
-
quadOut:
|
|
132
|
-
quadInOut:
|
|
133
|
-
cubicIn:
|
|
134
|
-
cubicOut:
|
|
133
|
+
sineIn: Et,
|
|
134
|
+
sineOut: wt,
|
|
135
|
+
sineInOut: bt,
|
|
136
|
+
quadIn: St,
|
|
137
|
+
quadOut: Tt,
|
|
138
|
+
quadInOut: It,
|
|
139
|
+
cubicIn: Ot,
|
|
140
|
+
cubicOut: At,
|
|
135
141
|
cubicInOut: Ct,
|
|
136
142
|
quartIn: kt,
|
|
137
|
-
quartOut:
|
|
138
|
-
quartInOut:
|
|
139
|
-
quintIn:
|
|
140
|
-
quintOut:
|
|
141
|
-
quintInOut:
|
|
142
|
-
expoIn:
|
|
143
|
-
expoOut:
|
|
144
|
-
expoInOut:
|
|
145
|
-
circIn:
|
|
146
|
-
circOut:
|
|
147
|
-
circInOut:
|
|
148
|
-
backIn:
|
|
149
|
-
backOut:
|
|
150
|
-
backInOut:
|
|
143
|
+
quartOut: $t,
|
|
144
|
+
quartInOut: _t,
|
|
145
|
+
quintIn: qt,
|
|
146
|
+
quintOut: Mt,
|
|
147
|
+
quintInOut: xt,
|
|
148
|
+
expoIn: Pt,
|
|
149
|
+
expoOut: Lt,
|
|
150
|
+
expoInOut: Rt,
|
|
151
|
+
circIn: Ft,
|
|
152
|
+
circOut: Nt,
|
|
153
|
+
circInOut: zt,
|
|
154
|
+
backIn: Ht,
|
|
155
|
+
backOut: jt,
|
|
156
|
+
backInOut: Dt
|
|
151
157
|
}, Ie = {
|
|
152
158
|
linear: "linear",
|
|
153
159
|
ease: "ease",
|
|
@@ -179,14 +185,14 @@ const je = (t) => t, yt = (t) => 1 - Math.cos(t * Math.PI / 2), Et = (t) => Math
|
|
|
179
185
|
backOut: "cubic-bezier(0.175, 0.885, 0.32, 1.275)",
|
|
180
186
|
backInOut: "cubic-bezier(0.68, -0.55, 0.265, 1.55)"
|
|
181
187
|
};
|
|
182
|
-
function
|
|
188
|
+
function Gt(t) {
|
|
183
189
|
return t === "percentage" ? "%" : t || "px";
|
|
184
190
|
}
|
|
185
191
|
function J(t) {
|
|
186
192
|
return t ? Ie[t] || t : Ie.linear;
|
|
187
193
|
}
|
|
188
|
-
function
|
|
189
|
-
const i = 3 * t, r = 3 * (n - t) - i, o = 1 - i - r,
|
|
194
|
+
function Wt(t, e, n, s) {
|
|
195
|
+
const i = 3 * t, r = 3 * (n - t) - i, o = 1 - i - r, a = 3 * e, c = 3 * (s - e) - a, l = 1 - a - c, f = (p) => ((o * p + r) * p + i) * p, u = (p) => ((l * p + c) * p + a) * p, d = (p) => (3 * o * p + 2 * r) * p + i;
|
|
190
196
|
function g(p) {
|
|
191
197
|
let m = p;
|
|
192
198
|
for (let y = 0; y < 8; y++) {
|
|
@@ -206,32 +212,32 @@ function Gt(t, e, n, s) {
|
|
|
206
212
|
}
|
|
207
213
|
return (p) => p <= 0 ? 0 : p >= 1 ? 1 : u(g(p));
|
|
208
214
|
}
|
|
209
|
-
function
|
|
215
|
+
function Vt(t) {
|
|
210
216
|
const e = t.match(
|
|
211
217
|
/^cubic-bezier\(\s*(-?[\d.]+)\s*,\s*(-?[\d.]+)\s*,\s*(-?[\d.]+)\s*,\s*(-?[\d.]+)\s*\)$/
|
|
212
218
|
);
|
|
213
219
|
if (!e) return;
|
|
214
220
|
const n = parseFloat(e[1]), s = parseFloat(e[2]), i = parseFloat(e[3]), r = parseFloat(e[4]);
|
|
215
221
|
if (![n, s, i, r].some(isNaN))
|
|
216
|
-
return
|
|
222
|
+
return Wt(n, s, i, r);
|
|
217
223
|
}
|
|
218
|
-
function
|
|
224
|
+
function Yt(t) {
|
|
219
225
|
const e = t.match(/^linear\((.+)\)$/);
|
|
220
226
|
if (!e) return;
|
|
221
227
|
const n = e[1].split(",").map((o) => o.trim()).filter(Boolean);
|
|
222
228
|
if (n.length === 0) return;
|
|
223
229
|
const s = [];
|
|
224
230
|
for (const o of n) {
|
|
225
|
-
const
|
|
226
|
-
if (isNaN(
|
|
231
|
+
const a = o.split(/\s+/), c = parseFloat(a[0]);
|
|
232
|
+
if (isNaN(c)) return;
|
|
227
233
|
const l = [];
|
|
228
|
-
for (let f = 1; f <
|
|
229
|
-
if (
|
|
230
|
-
const u = parseFloat(
|
|
234
|
+
for (let f = 1; f < a.length; f++)
|
|
235
|
+
if (a[f].endsWith("%")) {
|
|
236
|
+
const u = parseFloat(a[f]) / 100;
|
|
231
237
|
if (isNaN(u)) return;
|
|
232
238
|
l.push(u);
|
|
233
239
|
}
|
|
234
|
-
l.length === 0 ? s.push({ output:
|
|
240
|
+
l.length === 0 ? s.push({ output: c, pos: null }) : l.length === 1 ? s.push({ output: c, pos: l[0] }) : (s.push({ output: c, pos: l[0] }), s.push({ output: c, pos: l[1] }));
|
|
235
241
|
}
|
|
236
242
|
if (s.length === 0) return;
|
|
237
243
|
s[0].pos === null && (s[0].pos = 0), s[s.length - 1].pos === null && (s[s.length - 1].pos = 1);
|
|
@@ -239,12 +245,12 @@ function Vt(t) {
|
|
|
239
245
|
for (; i < s.length; )
|
|
240
246
|
if (s[i].pos === null) {
|
|
241
247
|
const o = i - 1;
|
|
242
|
-
let
|
|
243
|
-
for (;
|
|
244
|
-
const
|
|
245
|
-
for (let u = o + 1; u <
|
|
246
|
-
s[u].pos =
|
|
247
|
-
i =
|
|
248
|
+
let a = i;
|
|
249
|
+
for (; a < s.length && s[a].pos === null; ) a++;
|
|
250
|
+
const c = s[o].pos, l = s[a].pos, f = a - o;
|
|
251
|
+
for (let u = o + 1; u < a; u++)
|
|
252
|
+
s[u].pos = c + (l - c) * (u - o) / f;
|
|
253
|
+
i = a + 1;
|
|
248
254
|
} else
|
|
249
255
|
i++;
|
|
250
256
|
for (let o = 1; o < s.length; o++)
|
|
@@ -252,23 +258,23 @@ function Vt(t) {
|
|
|
252
258
|
const r = s;
|
|
253
259
|
return (o) => {
|
|
254
260
|
if (o <= r[0].pos) return r[0].output;
|
|
255
|
-
const
|
|
256
|
-
if (o >=
|
|
257
|
-
let
|
|
258
|
-
for (;
|
|
259
|
-
const d =
|
|
260
|
-
r[d].pos <= o ?
|
|
261
|
+
const a = r[r.length - 1];
|
|
262
|
+
if (o >= a.pos) return a.output;
|
|
263
|
+
let c = 0, l = r.length - 1;
|
|
264
|
+
for (; c < l - 1; ) {
|
|
265
|
+
const d = c + l >>> 1;
|
|
266
|
+
r[d].pos <= o ? c = d : l = d;
|
|
261
267
|
}
|
|
262
|
-
const f = r[
|
|
268
|
+
const f = r[c], u = r[l];
|
|
263
269
|
return u.pos === f.pos ? u.output : f.output + (u.output - f.output) * (o - f.pos) / (u.pos - f.pos);
|
|
264
270
|
};
|
|
265
271
|
}
|
|
266
272
|
function be(t) {
|
|
267
273
|
if (!t) return;
|
|
268
274
|
const e = Te[t];
|
|
269
|
-
return e || (
|
|
275
|
+
return e || (Vt(t) ?? Yt(t) ?? Te.linear);
|
|
270
276
|
}
|
|
271
|
-
class
|
|
277
|
+
class Bt extends V {
|
|
272
278
|
animationGroups;
|
|
273
279
|
delay;
|
|
274
280
|
offset;
|
|
@@ -276,10 +282,10 @@ class Yt extends V {
|
|
|
276
282
|
timingOptions;
|
|
277
283
|
constructor(e, n = {}) {
|
|
278
284
|
const s = e.flatMap((i) => [...i.animations]);
|
|
279
|
-
super(s), this.animationGroups = e, this.delay = n.delay ?? 0, this.offset = n.offset ?? 0, this.offsetEasing = typeof n.offsetEasing == "function" ? n.offsetEasing : be(n.offsetEasing) ?? je, this.timingOptions = this.animationGroups.map((i) => i.getTimingOptions().map(({ delay: r, duration: o, iterations:
|
|
285
|
+
super(s), this.animationGroups = e, this.delay = n.delay ?? 0, this.offset = n.offset ?? 0, this.offsetEasing = typeof n.offsetEasing == "function" ? n.offsetEasing : be(n.offsetEasing) ?? je, this.timingOptions = this.animationGroups.map((i) => i.getTimingOptions().map(({ delay: r, duration: o, iterations: a }) => ({
|
|
280
286
|
delay: r,
|
|
281
287
|
duration: Number.isFinite(o) ? o : 0,
|
|
282
|
-
iterations: Number.isFinite(
|
|
288
|
+
iterations: Number.isFinite(a) ? a : 1
|
|
283
289
|
}))), this.applyOffsets(), this.ready = Promise.all(e.map((i) => i.ready)).then(() => {
|
|
284
290
|
});
|
|
285
291
|
}
|
|
@@ -302,10 +308,10 @@ class Yt extends V {
|
|
|
302
308
|
const e = this.calculateOffsets(), n = this.getSequenceActiveDuration(e);
|
|
303
309
|
this.animationGroups.forEach((s, i) => {
|
|
304
310
|
s.animations.forEach((r, o) => {
|
|
305
|
-
const
|
|
306
|
-
if (!
|
|
307
|
-
const { delay:
|
|
308
|
-
|
|
311
|
+
const a = r.effect;
|
|
312
|
+
if (!a) return;
|
|
313
|
+
const { delay: c, duration: l, iterations: f } = this.timingOptions[i][o], u = c + e[i], d = n - (u + l * f);
|
|
314
|
+
a.updateTiming({ delay: u + this.delay, endDelay: d });
|
|
309
315
|
});
|
|
310
316
|
});
|
|
311
317
|
}
|
|
@@ -314,8 +320,8 @@ class Yt extends V {
|
|
|
314
320
|
for (let s = 0; s < this.timingOptions.length; s++) {
|
|
315
321
|
const i = this.timingOptions[s].reduce((r, o) => {
|
|
316
322
|
if (!o) return r;
|
|
317
|
-
const { delay:
|
|
318
|
-
return Math.max(r,
|
|
323
|
+
const { delay: a, duration: c, iterations: l } = o;
|
|
324
|
+
return Math.max(r, a + c * l);
|
|
319
325
|
}, 0);
|
|
320
326
|
n.push(e[s] + i);
|
|
321
327
|
}
|
|
@@ -332,8 +338,8 @@ class Yt extends V {
|
|
|
332
338
|
for (const { index: s, group: i } of n) {
|
|
333
339
|
const r = Math.min(s, this.animationGroups.length);
|
|
334
340
|
this.animationGroups.splice(r, 0, i), this.timingOptions.splice(r, 0, i.getTimingOptions());
|
|
335
|
-
const o = [...i.animations],
|
|
336
|
-
this.animations.splice(
|
|
341
|
+
const o = [...i.animations], a = this.animationGroups.slice(0, r).reduce((c, l) => c + l.animations.length, 0);
|
|
342
|
+
this.animations.splice(a, 0, ...o);
|
|
337
343
|
}
|
|
338
344
|
this.applyOffsets(), this.ready = Promise.all(this.animationGroups.map((s) => s.ready)).then(() => {
|
|
339
345
|
});
|
|
@@ -372,8 +378,8 @@ class Kt {
|
|
|
372
378
|
...s,
|
|
373
379
|
composite: "add"
|
|
374
380
|
}), { timeline: o } = i;
|
|
375
|
-
this._animation = new Animation(r, o), this._tickCbId = null, this.progress = null, this.customEffect = (
|
|
376
|
-
this.effect.target?.getAnimations().find((
|
|
381
|
+
this._animation = new Animation(r, o), this._tickCbId = null, this.progress = null, this.customEffect = (a) => e(r.target, a), this._finishHandler = (a) => {
|
|
382
|
+
this.effect.target?.getAnimations().find((c) => c === this._animation) || this.cancel();
|
|
377
383
|
}, this.addEventListener("finish", this._finishHandler), this.addEventListener("remove", this._finishHandler);
|
|
378
384
|
}
|
|
379
385
|
// private tick method for customEffect loop implementation
|
|
@@ -501,12 +507,12 @@ class Kt {
|
|
|
501
507
|
return this._animation.dispatchEvent(e);
|
|
502
508
|
}
|
|
503
509
|
}
|
|
504
|
-
function
|
|
510
|
+
function Qt(t) {
|
|
505
511
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
506
512
|
}
|
|
507
|
-
var ee = { exports: {} }, Oe = ee.exports,
|
|
508
|
-
function
|
|
509
|
-
return
|
|
513
|
+
var ee = { exports: {} }, Oe = ee.exports, Ae;
|
|
514
|
+
function Ut() {
|
|
515
|
+
return Ae || (Ae = 1, (function(t) {
|
|
510
516
|
(function(e) {
|
|
511
517
|
var n = function() {
|
|
512
518
|
}, s = e.requestAnimationFrame || e.webkitRequestAnimationFrame || e.mozRequestAnimationFrame || e.msRequestAnimationFrame || function(f) {
|
|
@@ -562,7 +568,7 @@ function Qt() {
|
|
|
562
568
|
* @public
|
|
563
569
|
*/
|
|
564
570
|
clear: function(f) {
|
|
565
|
-
return
|
|
571
|
+
return a(this.reads, f) || a(this.writes, f);
|
|
566
572
|
},
|
|
567
573
|
/**
|
|
568
574
|
* Extend this FastDom with some
|
|
@@ -601,7 +607,7 @@ function Qt() {
|
|
|
601
607
|
extend: function(f) {
|
|
602
608
|
if (typeof f != "object") throw new Error("expected object");
|
|
603
609
|
var u = Object.create(this);
|
|
604
|
-
return
|
|
610
|
+
return c(u, f), u.fastdom = this, u.initialize && u.initialize(), u;
|
|
605
611
|
},
|
|
606
612
|
// override this with a function
|
|
607
613
|
// to prevent Errors in console
|
|
@@ -622,11 +628,11 @@ function Qt() {
|
|
|
622
628
|
if (n("task errored", g.message), f.catch) f.catch(g);
|
|
623
629
|
else throw g;
|
|
624
630
|
}
|
|
625
|
-
function
|
|
631
|
+
function a(f, u) {
|
|
626
632
|
var d = f.indexOf(u);
|
|
627
633
|
return !!~d && !!f.splice(d, 1);
|
|
628
634
|
}
|
|
629
|
-
function
|
|
635
|
+
function c(f, u) {
|
|
630
636
|
for (var d in u)
|
|
631
637
|
u.hasOwnProperty(d) && (f[d] = u[d]);
|
|
632
638
|
}
|
|
@@ -635,12 +641,12 @@ function Qt() {
|
|
|
635
641
|
})(typeof window < "u" ? window : typeof Oe < "u" ? Oe : globalThis);
|
|
636
642
|
})(ee)), ee.exports;
|
|
637
643
|
}
|
|
638
|
-
var
|
|
639
|
-
const O = /* @__PURE__ */
|
|
640
|
-
function
|
|
644
|
+
var Xt = Ut();
|
|
645
|
+
const O = /* @__PURE__ */ Qt(Xt), de = {};
|
|
646
|
+
function Zt(t) {
|
|
641
647
|
Object.assign(de, t);
|
|
642
648
|
}
|
|
643
|
-
function
|
|
649
|
+
function Jt(t) {
|
|
644
650
|
return t in de ? de[t] : (console.warn(
|
|
645
651
|
`${t} not found in registry. Please make sure to import and register the preset.`
|
|
646
652
|
), null);
|
|
@@ -648,23 +654,23 @@ function Zt(t) {
|
|
|
648
654
|
function N(t, e) {
|
|
649
655
|
return t ? (e || document).getElementById(t) : null;
|
|
650
656
|
}
|
|
651
|
-
function
|
|
657
|
+
function en(t, e) {
|
|
652
658
|
return t?.matches(`[data-motion-part~="${e}"]`) ? t : t?.querySelector(`[data-motion-part~="${e}"]`);
|
|
653
659
|
}
|
|
654
|
-
function
|
|
660
|
+
function tn(t) {
|
|
655
661
|
const e = t.alternate ? "alternate" : "";
|
|
656
662
|
return t.reversed ? `${e ? `${e}-` : ""}reverse` : e || "normal";
|
|
657
663
|
}
|
|
658
|
-
function
|
|
659
|
-
return `${t.value}${
|
|
664
|
+
function ce(t) {
|
|
665
|
+
return `${t.value}${Gt(t.unit)}`;
|
|
660
666
|
}
|
|
661
|
-
function
|
|
662
|
-
return `${t.name || "cover"} ${n && t.offset.unit !== "percentage" ? `calc(100% + ${
|
|
667
|
+
function Ce(t, e, n) {
|
|
668
|
+
return `${t.name || "cover"} ${n && t.offset.unit !== "percentage" ? `calc(100% + ${ce(t.offset)}${e ? ` + ${e}` : ""})` : e ? `calc(${ce(t.offset)} + ${e})` : ce(t.offset)}`;
|
|
663
669
|
}
|
|
664
670
|
function De(t) {
|
|
665
671
|
return {
|
|
666
|
-
start:
|
|
667
|
-
end:
|
|
672
|
+
start: Ce(t.startOffset, t.startOffsetAdd),
|
|
673
|
+
end: Ce(t.endOffset, t.endOffsetAdd, !0)
|
|
668
674
|
};
|
|
669
675
|
}
|
|
670
676
|
function Ge(t) {
|
|
@@ -676,7 +682,7 @@ function We(t) {
|
|
|
676
682
|
function W(t) {
|
|
677
683
|
if (t.namedEffect) {
|
|
678
684
|
const e = t.namedEffect.type;
|
|
679
|
-
return typeof e == "string" ?
|
|
685
|
+
return typeof e == "string" ? Jt(e) : null;
|
|
680
686
|
} else if (t.keyframeEffect) {
|
|
681
687
|
const e = (s) => {
|
|
682
688
|
const { name: i, keyframes: r } = s.keyframeEffect;
|
|
@@ -697,7 +703,7 @@ function Ve(t, e, n, s) {
|
|
|
697
703
|
easing: J(i.easing),
|
|
698
704
|
iterations: i.iterations === 0 ? 1 / 0 : i.iterations || 1,
|
|
699
705
|
composite: i.composite,
|
|
700
|
-
direction:
|
|
706
|
+
direction: tn(i)
|
|
701
707
|
};
|
|
702
708
|
return Se(e) ? (o.duration = i.duration, o.delay = i.delay || 0) : e?.trigger === "view-progress" && (s || window.ViewTimeline) ? o.duration = "auto" : (o.duration = 99.99, o.delay = 0.01), {
|
|
703
709
|
effect: i,
|
|
@@ -710,7 +716,7 @@ function Ve(t, e, n, s) {
|
|
|
710
716
|
function Se(t) {
|
|
711
717
|
return !t || t.trigger !== "pointer-move" && t.trigger !== "view-progress";
|
|
712
718
|
}
|
|
713
|
-
function
|
|
719
|
+
function ke(t, e, n, s, i) {
|
|
714
720
|
if (t) {
|
|
715
721
|
if (Se(s) && (e.duration = e.duration || 1, i?.reducedMotion))
|
|
716
722
|
if (e.iterations === 1 || e.iterations == null)
|
|
@@ -732,7 +738,7 @@ function Ye(t, e, n, s, i) {
|
|
|
732
738
|
});
|
|
733
739
|
const g = W(
|
|
734
740
|
d
|
|
735
|
-
), p =
|
|
741
|
+
), p = ke(
|
|
736
742
|
g,
|
|
737
743
|
e,
|
|
738
744
|
r,
|
|
@@ -741,23 +747,23 @@ function Ye(t, e, n, s, i) {
|
|
|
741
747
|
);
|
|
742
748
|
return typeof p != "function" ? null : p(r);
|
|
743
749
|
}
|
|
744
|
-
const o = W(e),
|
|
750
|
+
const o = W(e), a = ke(
|
|
745
751
|
o,
|
|
746
752
|
e,
|
|
747
753
|
r,
|
|
748
754
|
n,
|
|
749
755
|
s
|
|
750
756
|
);
|
|
751
|
-
if (!
|
|
757
|
+
if (!a || a.length === 0)
|
|
752
758
|
return null;
|
|
753
|
-
const
|
|
759
|
+
const c = Ve(a, n, e.effectId);
|
|
754
760
|
let l;
|
|
755
761
|
const f = n?.trigger === "view-progress";
|
|
756
762
|
f && window.ViewTimeline && (l = new ViewTimeline({
|
|
757
763
|
subject: n.element || N(n.componentId)
|
|
758
764
|
}));
|
|
759
|
-
const u =
|
|
760
|
-
const h = m ?
|
|
765
|
+
const u = c.map(({ effect: d, options: g, id: p, part: m }) => {
|
|
766
|
+
const h = m ? en(r, m) : r, v = new KeyframeEffect(h || null, [], g);
|
|
761
767
|
O.mutate(() => {
|
|
762
768
|
"timing" in d && v.updateTiming(d.timing), v.setKeyframes(d.keyframes);
|
|
763
769
|
});
|
|
@@ -800,34 +806,34 @@ function Ye(t, e, n, s, i) {
|
|
|
800
806
|
measured: new Promise((d) => O.mutate(d))
|
|
801
807
|
});
|
|
802
808
|
}
|
|
803
|
-
function
|
|
809
|
+
function nn(t, e) {
|
|
804
810
|
return t ? `#${t}${e ? `[data-motion-part~="${e}"]` : ""}` : "";
|
|
805
811
|
}
|
|
806
|
-
function
|
|
807
|
-
const { duration: n, delay: s, iterations: i = 1, fill: r, easing: o = "linear", direction:
|
|
808
|
-
return `${
|
|
812
|
+
function sn(t, e) {
|
|
813
|
+
const { duration: n, delay: s, iterations: i = 1, fill: r, easing: o = "linear", direction: a } = t.options, c = t.effect.name, l = n === "auto";
|
|
814
|
+
return `${c} ${l ? "auto" : `${n}ms`}${l ? " " : ` ${s || 1}ms `}${o}${r && r !== "none" ? ` ${r}` : ""} ${!i || i === 1 / 0 ? "infinite" : i}${a === "normal" ? "" : ` ${a}`} ${e ? "" : "paused"}`;
|
|
809
815
|
}
|
|
810
|
-
function
|
|
816
|
+
function rn(t, e, n) {
|
|
811
817
|
return t?.style ? (Se(n) && (e.duration = e.duration || 1), t.style(e)) : [];
|
|
812
818
|
}
|
|
813
|
-
function
|
|
814
|
-
const s = W(e), i =
|
|
815
|
-
return r.map((
|
|
816
|
-
const { start: l, end: f } = o ? De(
|
|
819
|
+
function on(t, e, n) {
|
|
820
|
+
const s = W(e), i = rn(s, e), r = Ve(i, n, e.effectId, !0), o = n?.trigger === "view-progress";
|
|
821
|
+
return r.map((a, c) => {
|
|
822
|
+
const { start: l, end: f } = o ? De(a.effect) : {};
|
|
817
823
|
return {
|
|
818
|
-
target:
|
|
819
|
-
animation:
|
|
820
|
-
composition:
|
|
821
|
-
custom:
|
|
822
|
-
name:
|
|
823
|
-
keyframes:
|
|
824
|
-
id:
|
|
824
|
+
target: nn(t, a.part),
|
|
825
|
+
animation: sn(a, o),
|
|
826
|
+
composition: a.options.composite,
|
|
827
|
+
custom: a.effect.custom,
|
|
828
|
+
name: a.effect.name,
|
|
829
|
+
keyframes: a.effect.keyframes,
|
|
830
|
+
id: a.id && `${a.id}-${c + 1}`,
|
|
825
831
|
animationTimeline: o ? `--${n?.id}` : "",
|
|
826
832
|
animationRange: l || f ? `${l} ${f}` : ""
|
|
827
833
|
};
|
|
828
834
|
});
|
|
829
835
|
}
|
|
830
|
-
function
|
|
836
|
+
function an(t, e, n) {
|
|
831
837
|
const s = W(e), i = t instanceof HTMLElement ? t : N(t);
|
|
832
838
|
if (s && s.prepare && i) {
|
|
833
839
|
const r = { measure: Ge(i), mutate: We(i) };
|
|
@@ -835,20 +841,20 @@ function on(t, e, n) {
|
|
|
835
841
|
}
|
|
836
842
|
n && O.mutate(n);
|
|
837
843
|
}
|
|
838
|
-
function
|
|
844
|
+
function Be(t, e) {
|
|
839
845
|
const n = W(e);
|
|
840
846
|
if (!n)
|
|
841
847
|
return null;
|
|
842
848
|
if (!n.style)
|
|
843
|
-
return e.effectId && t ?
|
|
844
|
-
const s = n.getNames(e), r = (typeof t == "string" ? N(t) : t)?.getAnimations(), o = r?.map((
|
|
845
|
-
return s.forEach((
|
|
846
|
-
o.includes(
|
|
847
|
-
r?.find((l) => l.animationName ===
|
|
849
|
+
return e.effectId && t ? cn(t, e.effectId) : null;
|
|
850
|
+
const s = n.getNames(e), r = (typeof t == "string" ? N(t) : t)?.getAnimations(), o = r?.map((c) => c.animationName) || [], a = [];
|
|
851
|
+
return s.forEach((c) => {
|
|
852
|
+
o.includes(c) && a.push(
|
|
853
|
+
r?.find((l) => l.animationName === c)
|
|
848
854
|
);
|
|
849
|
-
}),
|
|
855
|
+
}), a?.length ? new V(a) : null;
|
|
850
856
|
}
|
|
851
|
-
function
|
|
857
|
+
function cn(t, e) {
|
|
852
858
|
const s = (typeof t == "string" ? N(t) : t)?.getAnimations().filter((i) => {
|
|
853
859
|
const r = i.id || i.animationName;
|
|
854
860
|
return r ? r.startsWith(e) : !0;
|
|
@@ -856,13 +862,13 @@ function an(t, e) {
|
|
|
856
862
|
return s?.length ? new V(s) : null;
|
|
857
863
|
}
|
|
858
864
|
function Ke(t, e, n, s = {}) {
|
|
859
|
-
const { disabled: i, allowActiveEvent: r, ...o } = s,
|
|
860
|
-
if (!
|
|
865
|
+
const { disabled: i, allowActiveEvent: r, ...o } = s, a = Ye(t, e, n, o);
|
|
866
|
+
if (!a)
|
|
861
867
|
return null;
|
|
862
|
-
let
|
|
868
|
+
let c = {};
|
|
863
869
|
if (n.trigger === "view-progress" && !window.ViewTimeline) {
|
|
864
|
-
const l = n.element || N(n.componentId), { ready: f } =
|
|
865
|
-
return
|
|
870
|
+
const l = n.element || N(n.componentId), { ready: f } = a;
|
|
871
|
+
return a.animations.map((u) => ({
|
|
866
872
|
/* we use getters for start and end in order to access the animation's start and end
|
|
867
873
|
only when initializing the scrub scene rather than immediately */
|
|
868
874
|
get start() {
|
|
@@ -874,7 +880,7 @@ function Ke(t, e, n, s = {}) {
|
|
|
874
880
|
viewSource: l,
|
|
875
881
|
ready: f,
|
|
876
882
|
getProgress() {
|
|
877
|
-
return
|
|
883
|
+
return a.getProgress();
|
|
878
884
|
},
|
|
879
885
|
effect(d, g) {
|
|
880
886
|
const { activeDuration: p } = u.effect.getComputedTiming(), { delay: m } = u.effect.getTiming();
|
|
@@ -888,7 +894,7 @@ function Ke(t, e, n, s = {}) {
|
|
|
888
894
|
} else if (n.trigger === "pointer-move") {
|
|
889
895
|
const l = e, { centeredToTarget: f, transitionDuration: u, transitionEasing: d } = l, g = n.axis;
|
|
890
896
|
if (l.keyframeEffect) {
|
|
891
|
-
const p =
|
|
897
|
+
const p = a;
|
|
892
898
|
return p.animations?.length === 0 ? null : {
|
|
893
899
|
target: void 0,
|
|
894
900
|
centeredToTarget: f,
|
|
@@ -907,18 +913,18 @@ function Ke(t, e, n, s = {}) {
|
|
|
907
913
|
}
|
|
908
914
|
};
|
|
909
915
|
}
|
|
910
|
-
|
|
916
|
+
c = {
|
|
911
917
|
centeredToTarget: f,
|
|
912
918
|
allowActiveEvent: r
|
|
913
|
-
}, e.customEffect && u && (
|
|
919
|
+
}, e.customEffect && u && (c.transitionDuration = u, c.transitionEasing = be(d)), c.target = a.target;
|
|
914
920
|
}
|
|
915
921
|
return {
|
|
916
|
-
...
|
|
922
|
+
...c,
|
|
917
923
|
getProgress() {
|
|
918
|
-
return
|
|
924
|
+
return a.getProgress();
|
|
919
925
|
},
|
|
920
926
|
effect(l, f, u, d) {
|
|
921
|
-
|
|
927
|
+
a.progress(
|
|
922
928
|
u ? {
|
|
923
929
|
// @ts-expect-error spread error on p
|
|
924
930
|
...f,
|
|
@@ -929,38 +935,38 @@ function Ke(t, e, n, s = {}) {
|
|
|
929
935
|
},
|
|
930
936
|
disabled: i,
|
|
931
937
|
destroy() {
|
|
932
|
-
|
|
938
|
+
a.cancel();
|
|
933
939
|
}
|
|
934
940
|
};
|
|
935
941
|
}
|
|
936
942
|
function Y(t, e, n, s = !1) {
|
|
937
|
-
const i =
|
|
943
|
+
const i = Be(t, e);
|
|
938
944
|
return i ? (i.ready = new Promise((r) => {
|
|
939
|
-
|
|
945
|
+
an(t, e, r);
|
|
940
946
|
}), i) : Ye(t, e, n, { reducedMotion: s });
|
|
941
947
|
}
|
|
942
948
|
function fn(t) {
|
|
943
949
|
return t === null ? [null] : typeof t == "string" ? Array.from(document.querySelectorAll(t)) : Array.isArray(t) ? t : [t];
|
|
944
950
|
}
|
|
945
|
-
function
|
|
951
|
+
function Qe(t, e) {
|
|
946
952
|
const n = [];
|
|
947
953
|
for (const { target: s, options: i } of t) {
|
|
948
954
|
const r = fn(s);
|
|
949
955
|
for (const o of r) {
|
|
950
|
-
const
|
|
956
|
+
const a = Y(
|
|
951
957
|
o,
|
|
952
958
|
i,
|
|
953
959
|
void 0,
|
|
954
960
|
e?.reducedMotion
|
|
955
961
|
);
|
|
956
|
-
|
|
962
|
+
a instanceof V && n.push(a);
|
|
957
963
|
}
|
|
958
964
|
}
|
|
959
965
|
return n;
|
|
960
966
|
}
|
|
961
967
|
function ln(t, e, n) {
|
|
962
|
-
const s =
|
|
963
|
-
return new
|
|
968
|
+
const s = Qe(e, n);
|
|
969
|
+
return new Bt(s, t);
|
|
964
970
|
}
|
|
965
971
|
function un(t, e = 2) {
|
|
966
972
|
return parseFloat(t.toFixed(e));
|
|
@@ -978,15 +984,15 @@ function pn(t, e, n, s) {
|
|
|
978
984
|
const i = t.length - 1;
|
|
979
985
|
t.forEach((r, o) => {
|
|
980
986
|
if (r) {
|
|
981
|
-
const
|
|
982
|
-
r.delay = e +
|
|
987
|
+
const a = o ? s(o / i) * i * n | 0 : 0;
|
|
988
|
+
r.delay = e + a + (r.delay || 0);
|
|
983
989
|
}
|
|
984
990
|
});
|
|
985
991
|
}
|
|
986
992
|
function te(t, e) {
|
|
987
993
|
return e.includes("&") ? e.replace(/&/g, t) : `${t}${e}`;
|
|
988
994
|
}
|
|
989
|
-
function
|
|
995
|
+
function k() {
|
|
990
996
|
return "wi-12343210".replace(
|
|
991
997
|
/\d/g,
|
|
992
998
|
(t) => String.fromCharCode(
|
|
@@ -995,17 +1001,17 @@ function A() {
|
|
|
995
1001
|
// 97 for "a"
|
|
996
1002
|
);
|
|
997
1003
|
}
|
|
998
|
-
function
|
|
1004
|
+
function Ue(t) {
|
|
999
1005
|
let { transition: e, transitionProperties: n } = t, s = [];
|
|
1000
1006
|
if (e?.styleProperties) {
|
|
1001
1007
|
const { duration: i, easing: r, delay: o } = e;
|
|
1002
1008
|
i && (e.styleProperties.some(
|
|
1003
|
-
(
|
|
1009
|
+
(c) => c.name.startsWith("--")
|
|
1004
1010
|
) ? s = [
|
|
1005
1011
|
`all ${i}ms ${J(r || "ease")}${o ? ` ${o}ms` : ""}`,
|
|
1006
1012
|
"visibility 0s"
|
|
1007
1013
|
] : s = e.styleProperties.map(
|
|
1008
|
-
(
|
|
1014
|
+
(c) => `${c.name} ${i}ms ${J(
|
|
1009
1015
|
r || "ease"
|
|
1010
1016
|
)}${o ? ` ${o}ms` : ""}`
|
|
1011
1017
|
));
|
|
@@ -1023,52 +1029,52 @@ function gn({
|
|
|
1023
1029
|
childSelector: i = "> :first-child",
|
|
1024
1030
|
selectorCondition: r
|
|
1025
1031
|
}) {
|
|
1026
|
-
const o =
|
|
1032
|
+
const o = Ue({
|
|
1027
1033
|
transition: n,
|
|
1028
1034
|
transitionProperties: s
|
|
1029
|
-
}),
|
|
1035
|
+
}), a = (n?.styleProperties || s)?.map(
|
|
1030
1036
|
(p) => `${p.name}: ${p.value};`
|
|
1031
|
-
) || [],
|
|
1037
|
+
) || [], c = t.replace(/"/g, "'"), l = `:is(:state(${e}), :--${e}) ${i}`, f = `[data-interact-effect~="${e}"] ${i}`, u = r ? te(l, r) : l, d = r ? te(f, r) : f, g = [
|
|
1032
1038
|
`${u},
|
|
1033
1039
|
${d} {
|
|
1034
|
-
${
|
|
1040
|
+
${a.join(`
|
|
1035
1041
|
`)}
|
|
1036
1042
|
}`
|
|
1037
1043
|
];
|
|
1038
1044
|
if (o.length) {
|
|
1039
|
-
const p = `[data-interact-key="${
|
|
1045
|
+
const p = `[data-interact-key="${c}"] ${i}`, m = r ? te(p, r) : p;
|
|
1040
1046
|
g.push(`@media (prefers-reduced-motion: no-preference) { ${m} {
|
|
1041
1047
|
transition: ${o.join(", ")};
|
|
1042
1048
|
} }`);
|
|
1043
1049
|
}
|
|
1044
1050
|
return g;
|
|
1045
1051
|
}
|
|
1046
|
-
function
|
|
1052
|
+
function ae(t, e, n) {
|
|
1047
1053
|
const s = (t || []).filter((i) => e[i]?.type === n && e[i].predicate).map((i) => e[i].predicate).join(") and (");
|
|
1048
1054
|
return s && `(${s})`;
|
|
1049
1055
|
}
|
|
1050
1056
|
function _(t, e) {
|
|
1051
|
-
const n =
|
|
1057
|
+
const n = ae(t, e, "media");
|
|
1052
1058
|
return n && window.matchMedia(n);
|
|
1053
1059
|
}
|
|
1054
|
-
function
|
|
1060
|
+
function L(t, e) {
|
|
1055
1061
|
return (t || []).filter((n) => e[n]?.type === "selector" && e[n].predicate).map((n) => `:is(${e[n].predicate})`).join("");
|
|
1056
1062
|
}
|
|
1057
|
-
const
|
|
1063
|
+
const K = {
|
|
1058
1064
|
rangeStart: { name: "cover", offset: { value: 0, unit: "percentage" } },
|
|
1059
1065
|
rangeEnd: { name: "cover", offset: { value: 100, unit: "percentage" } }
|
|
1060
1066
|
};
|
|
1061
1067
|
function vn(t, e) {
|
|
1062
|
-
const n = t?.name ??
|
|
1068
|
+
const n = t?.name ?? K.rangeStart.name, s = e?.name ?? t?.name ?? K.rangeEnd.name, i = {
|
|
1063
1069
|
name: n,
|
|
1064
|
-
offset: t?.offset ||
|
|
1070
|
+
offset: t?.offset || K.rangeStart.offset
|
|
1065
1071
|
}, r = {
|
|
1066
1072
|
name: s,
|
|
1067
|
-
offset: e?.offset ||
|
|
1073
|
+
offset: e?.offset || K.rangeEnd.offset
|
|
1068
1074
|
};
|
|
1069
1075
|
return { startOffset: i, endOffset: r };
|
|
1070
1076
|
}
|
|
1071
|
-
function
|
|
1077
|
+
function q(t) {
|
|
1072
1078
|
if ("keyframeEffect" in t && !t.keyframeEffect.name && "effectId" in t && (t.keyframeEffect.name = t.effectId), "duration" in t)
|
|
1073
1079
|
return {
|
|
1074
1080
|
id: "",
|
|
@@ -1082,16 +1088,16 @@ function L(t) {
|
|
|
1082
1088
|
...s
|
|
1083
1089
|
};
|
|
1084
1090
|
}
|
|
1085
|
-
function
|
|
1091
|
+
function C(t, e, n) {
|
|
1086
1092
|
let s = t.get(e);
|
|
1087
1093
|
s || (s = /* @__PURE__ */ new Set(), t.set(e, s)), s.add(n);
|
|
1088
1094
|
}
|
|
1089
|
-
function
|
|
1095
|
+
function B(t, e) {
|
|
1090
1096
|
t.get(e)?.forEach((s) => {
|
|
1091
1097
|
const { source: i, target: r, cleanup: o } = s;
|
|
1092
1098
|
o();
|
|
1093
|
-
const
|
|
1094
|
-
t.get(
|
|
1099
|
+
const a = i === e ? r : i;
|
|
1100
|
+
t.get(a)?.delete(s);
|
|
1095
1101
|
}), t.delete(e);
|
|
1096
1102
|
}
|
|
1097
1103
|
const yn = {
|
|
@@ -1107,13 +1113,13 @@ function bn(t) {
|
|
|
1107
1113
|
const e = t.trim().split(/\s+/), n = e[0], s = e.length > 1 ? e[1] : e[0], i = (r) => r.startsWith("-") ? r.slice(1) : parseFloat(r) ? `-${r}` : r;
|
|
1108
1114
|
return `${i(n)} 0px ${i(s)}`;
|
|
1109
1115
|
}
|
|
1110
|
-
const D = {},
|
|
1111
|
-
let
|
|
1116
|
+
const D = {}, M = /* @__PURE__ */ new WeakMap(), re = /* @__PURE__ */ new WeakSet(), z = /* @__PURE__ */ new WeakMap();
|
|
1117
|
+
let Xe = {}, H = null;
|
|
1112
1118
|
function Sn(t) {
|
|
1113
|
-
|
|
1119
|
+
Xe = t;
|
|
1114
1120
|
}
|
|
1115
|
-
function
|
|
1116
|
-
|
|
1121
|
+
function Ze(t, e, n) {
|
|
1122
|
+
M.get(t)?.forEach(({ source: i, handler: r }) => {
|
|
1117
1123
|
i === t && r(e, n);
|
|
1118
1124
|
});
|
|
1119
1125
|
}
|
|
@@ -1121,11 +1127,11 @@ function $e() {
|
|
|
1121
1127
|
return H || (H = new IntersectionObserver((t) => {
|
|
1122
1128
|
t.forEach((e) => {
|
|
1123
1129
|
const n = e.target;
|
|
1124
|
-
e.isIntersecting ||
|
|
1130
|
+
e.isIntersecting || Ze(n, !1, !0);
|
|
1125
1131
|
});
|
|
1126
1132
|
}, En), H);
|
|
1127
1133
|
}
|
|
1128
|
-
function
|
|
1134
|
+
function Je(t, e = !1) {
|
|
1129
1135
|
const n = JSON.stringify({ ...t, isSafeMode: e });
|
|
1130
1136
|
if (D[n])
|
|
1131
1137
|
return D[n];
|
|
@@ -1134,45 +1140,45 @@ function Ze(t, e = !1) {
|
|
|
1134
1140
|
rootMargin: t.inset ? bn(t.inset) : "0px",
|
|
1135
1141
|
threshold: s
|
|
1136
1142
|
}, r = new IntersectionObserver((o) => {
|
|
1137
|
-
o.forEach((
|
|
1138
|
-
const
|
|
1139
|
-
if (l && (re.add(
|
|
1143
|
+
o.forEach((a) => {
|
|
1144
|
+
const c = a.target, l = !re.has(c);
|
|
1145
|
+
if (l && (re.add(c), t.useSafeViewEnter && !a.isIntersecting)) {
|
|
1140
1146
|
O.measure(() => {
|
|
1141
|
-
const f =
|
|
1147
|
+
const f = a.boundingClientRect.height, u = a.rootBounds?.height;
|
|
1142
1148
|
if (!u)
|
|
1143
1149
|
return;
|
|
1144
1150
|
const d = Array.isArray(t.threshold) ? Math.min(...t.threshold) : t.threshold;
|
|
1145
1151
|
d && f * d > u && O.mutate(() => {
|
|
1146
|
-
r.unobserve(
|
|
1147
|
-
const p =
|
|
1148
|
-
z.set(
|
|
1152
|
+
r.unobserve(c);
|
|
1153
|
+
const p = Je(t, !0);
|
|
1154
|
+
z.set(c, p), p.observe(c);
|
|
1149
1155
|
});
|
|
1150
1156
|
});
|
|
1151
1157
|
return;
|
|
1152
1158
|
}
|
|
1153
|
-
(
|
|
1159
|
+
(a.isIntersecting || !l) && Ze(c, a.isIntersecting);
|
|
1154
1160
|
});
|
|
1155
1161
|
}, i);
|
|
1156
1162
|
return D[n] = r, r;
|
|
1157
1163
|
}
|
|
1158
1164
|
function Tn(t, e, n, s = {}, { reducedMotion: i, selectorCondition: r, animation: o } = {}) {
|
|
1159
|
-
const
|
|
1165
|
+
const a = { ...Xe, ...s }, c = n.triggerType || "once", l = o || Y(
|
|
1160
1166
|
e,
|
|
1161
|
-
|
|
1167
|
+
q(n),
|
|
1162
1168
|
void 0,
|
|
1163
1169
|
i
|
|
1164
1170
|
);
|
|
1165
1171
|
if (!l)
|
|
1166
1172
|
return;
|
|
1167
|
-
const f =
|
|
1168
|
-
|
|
1173
|
+
const f = Je(a);
|
|
1174
|
+
c !== "once" && l.persist?.();
|
|
1169
1175
|
let u = !0, d = !1, g;
|
|
1170
1176
|
g = { source: t, target: e, handler: (h, v) => {
|
|
1171
1177
|
if (!(r && !e.matches(r)))
|
|
1172
|
-
if (
|
|
1178
|
+
if (c === "once") {
|
|
1173
1179
|
if (h && !d) {
|
|
1174
|
-
d = !0,
|
|
1175
|
-
const y =
|
|
1180
|
+
d = !0, M.get(t)?.delete(g), M.get(e)?.delete(g);
|
|
1181
|
+
const y = M.get(t);
|
|
1176
1182
|
(!y || y.size === 0) && ((z.get(t) || f).unobserve(t), re.delete(t)), l.play(() => {
|
|
1177
1183
|
const E = () => {
|
|
1178
1184
|
e.dataset.interactEnter = "start";
|
|
@@ -1191,13 +1197,13 @@ function Tn(t, e, n, s = {}, { reducedMotion: i, selectorCondition: r, animation
|
|
|
1191
1197
|
O.mutate(E);
|
|
1192
1198
|
});
|
|
1193
1199
|
}
|
|
1194
|
-
} else
|
|
1200
|
+
} else c === "alternate" ? u && h ? (u = !1, l.play()) : u || l.reverse() : c === "repeat" ? h ? (l.progress(0), l.play()) : v && (l.pause(), l.progress(0)) : c === "state" && (h ? l.play() : v && l.pause());
|
|
1195
1201
|
}, cleanup: () => {
|
|
1196
|
-
(z.get(t) || f).unobserve(t), (
|
|
1197
|
-
} },
|
|
1202
|
+
(z.get(t) || f).unobserve(t), (c === "repeat" || c === "state") && $e().unobserve(t), l.cancel(), re.delete(t), z.delete(t);
|
|
1203
|
+
} }, C(M, t, g), C(M, e, g), z.set(t, f), f.observe(t), (c === "repeat" || c === "state") && $e().observe(t);
|
|
1198
1204
|
}
|
|
1199
1205
|
function In(t) {
|
|
1200
|
-
|
|
1206
|
+
B(M, t);
|
|
1201
1207
|
}
|
|
1202
1208
|
function On() {
|
|
1203
1209
|
H = null, Object.keys(D).forEach((t) => delete D[t]);
|
|
@@ -1208,10 +1214,10 @@ const _e = {
|
|
|
1208
1214
|
setOptions: Sn,
|
|
1209
1215
|
reset: On
|
|
1210
1216
|
};
|
|
1211
|
-
function
|
|
1217
|
+
function et(t, e) {
|
|
1212
1218
|
return Object.assign(Object.create(e), t);
|
|
1213
1219
|
}
|
|
1214
|
-
function
|
|
1220
|
+
function An(t, e, n, s) {
|
|
1215
1221
|
let i = t * (1 - n) + e * n;
|
|
1216
1222
|
if (s) {
|
|
1217
1223
|
const r = i - t;
|
|
@@ -1222,7 +1228,7 @@ function Cn(t, e, n, s) {
|
|
|
1222
1228
|
}
|
|
1223
1229
|
return i;
|
|
1224
1230
|
}
|
|
1225
|
-
function
|
|
1231
|
+
function Cn(t) {
|
|
1226
1232
|
let e = !1;
|
|
1227
1233
|
return function() {
|
|
1228
1234
|
e || (e = !0, window.requestAnimationFrame(() => {
|
|
@@ -1238,37 +1244,37 @@ function qe(t, e) {
|
|
|
1238
1244
|
}, e);
|
|
1239
1245
|
};
|
|
1240
1246
|
}
|
|
1241
|
-
function
|
|
1247
|
+
function kn(t, e) {
|
|
1242
1248
|
const n = t.match(/^calc\s*\(\s*(-?\d+((px)|([lsd]?vh)|([lsd]?vw)))\s*\+\s*(-?\d+((px)|([lsd]?vh)|([lsd]?vw)))\s*\)\s*$/);
|
|
1243
1249
|
return oe(n[1], e) + oe(n[6], e);
|
|
1244
1250
|
}
|
|
1245
1251
|
function oe(t, e) {
|
|
1246
|
-
return t ? /^-?\d+px$/.test(t) ? parseInt(t) : /^-?\d+[lsd]?vh$/.test(t) ? parseInt(t) * e.viewportHeight / 100 : /^-?\d+[lsd]?vw$/.test(t) ? parseInt(t) * e.viewportWidth / 100 : /^calc\s*\(\s*-?\d+((px)|([lsd]?vh)|([lsd]?vw))\s*\+\s*-?\d+((px)|([lsd]?vh)|([lsd]?vw))\s*\)\s*$/.test(t) ?
|
|
1252
|
+
return t ? /^-?\d+px$/.test(t) ? parseInt(t) : /^-?\d+[lsd]?vh$/.test(t) ? parseInt(t) * e.viewportHeight / 100 : /^-?\d+[lsd]?vw$/.test(t) ? parseInt(t) * e.viewportWidth / 100 : /^calc\s*\(\s*-?\d+((px)|([lsd]?vh)|([lsd]?vw))\s*\+\s*-?\d+((px)|([lsd]?vh)|([lsd]?vw))\s*\)\s*$/.test(t) ? kn(t, e) : parseInt(t) || 0 : 0;
|
|
1247
1253
|
}
|
|
1248
1254
|
function R(t, e, n) {
|
|
1249
|
-
const { name: s, offset: i = 0 } = t, { start: r, end: o } = n,
|
|
1255
|
+
const { name: s, offset: i = 0 } = t, { start: r, end: o } = n, a = o - r, c = i / 100;
|
|
1250
1256
|
let l, f;
|
|
1251
|
-
return s === "entry" ? (l = r - e, f = Math.min(e,
|
|
1257
|
+
return s === "entry" ? (l = r - e, f = Math.min(e, a)) : s === "entry-crossing" ? (l = r - e, f = a) : s === "contain" ? (l = Math.min(o - e, r), f = Math.abs(e - a)) : s === "exit" ? (l = Math.max(r, o - e), f = Math.min(e, a)) : s === "exit-crossing" ? (l = r, f = a) : s === "cover" && (l = r - e, f = a + e), l + c * f | 0;
|
|
1252
1258
|
}
|
|
1253
1259
|
function fe(t, e, n, s, i) {
|
|
1254
1260
|
let r = 0;
|
|
1255
1261
|
const o = { start: e, end: n };
|
|
1256
|
-
return t.forEach((
|
|
1257
|
-
r +=
|
|
1258
|
-
const l =
|
|
1262
|
+
return t.forEach((a, c) => {
|
|
1263
|
+
r += a.offset;
|
|
1264
|
+
const l = a.sticky;
|
|
1259
1265
|
if (l) {
|
|
1260
|
-
if ("end" in l && t[
|
|
1261
|
-
const d = ((i ?
|
|
1266
|
+
if ("end" in l && t[c - 1]?.element) {
|
|
1267
|
+
const d = ((i ? a.element.offsetWidth : a.element.offsetHeight) || 0) + l.end - s, g = r + d - a.offset, p = g < o.start, m = !p && g <= n;
|
|
1262
1268
|
let h = 0;
|
|
1263
|
-
(p || m) && (h =
|
|
1269
|
+
(p || m) && (h = a.offset, o.end += h), p && (o.start += h);
|
|
1264
1270
|
}
|
|
1265
1271
|
if ("start" in l) {
|
|
1266
1272
|
const f = r - l.start, u = f < o.start, d = !u && f <= o.end;
|
|
1267
1273
|
let g = 0;
|
|
1268
|
-
const p = t[
|
|
1274
|
+
const p = t[c - 1]?.element;
|
|
1269
1275
|
if (p) {
|
|
1270
1276
|
if (u || d) {
|
|
1271
|
-
const m = (i ? p.offsetWidth : p.offsetHeight) || 0, h =
|
|
1277
|
+
const m = (i ? p.offsetWidth : p.offsetHeight) || 0, h = a.offset, v = (i ? a.element.offsetWidth : a.element.offsetHeight) || 0;
|
|
1272
1278
|
g = m - (h + v), r += g, o.end += g;
|
|
1273
1279
|
}
|
|
1274
1280
|
u && (o.start += g);
|
|
@@ -1278,10 +1284,10 @@ function fe(t, e, n, s, i) {
|
|
|
1278
1284
|
}), o;
|
|
1279
1285
|
}
|
|
1280
1286
|
function $n(t, e, n, s, i, r) {
|
|
1281
|
-
const { start: o, end:
|
|
1282
|
-
let l = o, f =
|
|
1283
|
-
if (typeof
|
|
1284
|
-
u = { name:
|
|
1287
|
+
const { start: o, end: a, duration: c } = t;
|
|
1288
|
+
let l = o, f = a, u = t.startRange, d = t.endRange, g;
|
|
1289
|
+
if (typeof c == "string") {
|
|
1290
|
+
u = { name: c, offset: 0 }, d = { name: c, offset: 100 }, l = R(u, n, e), f = R(d, n, e), g = f - l;
|
|
1285
1291
|
const p = fe(r, l, f, n, s);
|
|
1286
1292
|
l = p.start, f = p.end;
|
|
1287
1293
|
} else {
|
|
@@ -1290,13 +1296,13 @@ function $n(t, e, n, s, i, r) {
|
|
|
1290
1296
|
const p = oe(u.add, i), m = R({ ...u, offset: 0 }, n, e), h = R({ ...u, offset: 100 }, n, e), v = fe(r, m, h, n, s);
|
|
1291
1297
|
l = v.start + u.offset / 100 * (v.end - v.start) + p;
|
|
1292
1298
|
}
|
|
1293
|
-
if (d ||
|
|
1294
|
-
d = d ||
|
|
1299
|
+
if (d || a?.name) {
|
|
1300
|
+
d = d || a;
|
|
1295
1301
|
const p = oe(d.add, i), m = R({ ...d, offset: 0 }, n, e), h = R({ ...d, offset: 100 }, n, e), v = fe(r, m, h, n, s);
|
|
1296
1302
|
f = v.start + d.offset / 100 * (v.end - v.start) + p;
|
|
1297
|
-
} else typeof
|
|
1303
|
+
} else typeof c == "number" && (f = l + c);
|
|
1298
1304
|
}
|
|
1299
|
-
return !g && !
|
|
1305
|
+
return !g && !c && (g = f - l), { ...t, start: l, end: f, startRange: u, endRange: d, duration: g || c };
|
|
1300
1306
|
}
|
|
1301
1307
|
function _n(t) {
|
|
1302
1308
|
return t.position === "sticky";
|
|
@@ -1322,10 +1328,10 @@ function Ln(t, e) {
|
|
|
1322
1328
|
}
|
|
1323
1329
|
function Q(t, e, n, s, i) {
|
|
1324
1330
|
const r = t[0].viewSource, o = [];
|
|
1325
|
-
let
|
|
1331
|
+
let a = (s ? r.offsetWidth : r.offsetHeight) || 0, c = 0, l = r;
|
|
1326
1332
|
for (; l; ) {
|
|
1327
1333
|
const u = window.getComputedStyle(l), d = _n(u), g = d ? Ln(u, s) : void 0, p = Pn(l, s, d);
|
|
1328
|
-
if ((!g || !("end" in g)) && (
|
|
1334
|
+
if ((!g || !("end" in g)) && (c += p), o.push({ element: l, offset: p, sticky: g }), l = l.offsetParent, qn(u, l, e))
|
|
1329
1335
|
break;
|
|
1330
1336
|
if (l === e) {
|
|
1331
1337
|
o.push({ element: l, offset: 0 });
|
|
@@ -1335,7 +1341,7 @@ function Q(t, e, n, s, i) {
|
|
|
1335
1341
|
return o.reverse(), t.map((u) => ({
|
|
1336
1342
|
...$n(
|
|
1337
1343
|
u,
|
|
1338
|
-
{ start:
|
|
1344
|
+
{ start: c, end: c + a },
|
|
1339
1345
|
n,
|
|
1340
1346
|
s,
|
|
1341
1347
|
i,
|
|
@@ -1365,8 +1371,8 @@ function Nn() {
|
|
|
1365
1371
|
};
|
|
1366
1372
|
}
|
|
1367
1373
|
function zn(t) {
|
|
1368
|
-
const e =
|
|
1369
|
-
let r = xe(n, s), o,
|
|
1374
|
+
const e = et(t, Rn), n = e.root, s = e.horizontal, i = /* @__PURE__ */ new WeakMap();
|
|
1375
|
+
let r = xe(n, s), o, a, c, l, f;
|
|
1370
1376
|
const u = [], d = Nn();
|
|
1371
1377
|
if (e.scenes = Object.values(
|
|
1372
1378
|
// TODO(ameerf): find a polyfill and use groupBy instead of following reduce
|
|
@@ -1383,7 +1389,7 @@ function zn(t) {
|
|
|
1383
1389
|
m.index = h;
|
|
1384
1390
|
}), u.length) {
|
|
1385
1391
|
const m = /* @__PURE__ */ new Map();
|
|
1386
|
-
window.ResizeObserver && (
|
|
1392
|
+
window.ResizeObserver && (c = new window.ResizeObserver(function(h) {
|
|
1387
1393
|
h.forEach((v) => {
|
|
1388
1394
|
const y = m.get(v.target), E = Q(y, n, r, s, d);
|
|
1389
1395
|
E.forEach((w, S) => {
|
|
@@ -1391,7 +1397,7 @@ function zn(t) {
|
|
|
1391
1397
|
}), u.splice(u.indexOf(y), 1, E);
|
|
1392
1398
|
});
|
|
1393
1399
|
}), u.forEach((h) => {
|
|
1394
|
-
|
|
1400
|
+
c.observe(h[0].viewSource, { box: "border-box" }), m.set(h[0].viewSource, h);
|
|
1395
1401
|
}), e.observeContentResize && e.contentRoot && new window.ResizeObserver(qe(() => {
|
|
1396
1402
|
const v = u.map((y) => {
|
|
1397
1403
|
const E = Q(y, n, r, s, d);
|
|
@@ -1415,7 +1421,7 @@ function zn(t) {
|
|
|
1415
1421
|
});
|
|
1416
1422
|
}, Me), n === window ? window.addEventListener("resize", l) : window.ResizeObserver && (f = new window.ResizeObserver(l), f.observe(n, { box: "border-box" })));
|
|
1417
1423
|
}
|
|
1418
|
-
e.observeViewportEntry && window.IntersectionObserver && (
|
|
1424
|
+
e.observeViewportEntry && window.IntersectionObserver && (a = new window.IntersectionObserver(function(m) {
|
|
1419
1425
|
m.forEach((h) => {
|
|
1420
1426
|
(i.get(h.target) || []).forEach((v) => {
|
|
1421
1427
|
v.disabled = !h.isIntersecting;
|
|
@@ -1428,7 +1434,7 @@ function zn(t) {
|
|
|
1428
1434
|
}), e.scenes.forEach((m) => {
|
|
1429
1435
|
if (m.viewSource) {
|
|
1430
1436
|
let h = i.get(m.viewSource);
|
|
1431
|
-
h || (h = [], i.set(m.viewSource, h),
|
|
1437
|
+
h || (h = [], i.set(m.viewSource, h), a.observe(m.viewSource)), h.push(m);
|
|
1432
1438
|
}
|
|
1433
1439
|
}));
|
|
1434
1440
|
function g({ p: m, vp: h }) {
|
|
@@ -1444,7 +1450,7 @@ function zn(t) {
|
|
|
1444
1450
|
}
|
|
1445
1451
|
}
|
|
1446
1452
|
function p() {
|
|
1447
|
-
e.scenes.forEach((m) => m.destroy?.()),
|
|
1453
|
+
e.scenes.forEach((m) => m.destroy?.()), a && (a.disconnect(), a = null), c && (c.disconnect(), c = null), l && (f ? (f.disconnect(), f = null) : window.removeEventListener("resize", l));
|
|
1448
1454
|
}
|
|
1449
1455
|
return {
|
|
1450
1456
|
tick: g,
|
|
@@ -1460,7 +1466,7 @@ const Hn = {
|
|
|
1460
1466
|
};
|
|
1461
1467
|
class jn {
|
|
1462
1468
|
constructor(e = {}) {
|
|
1463
|
-
this.config =
|
|
1469
|
+
this.config = et(e, Hn), this.progress = {
|
|
1464
1470
|
p: 0,
|
|
1465
1471
|
prevP: 0,
|
|
1466
1472
|
vp: 0
|
|
@@ -1473,7 +1479,7 @@ class jn {
|
|
|
1473
1479
|
this.config.root = n ? window : this.config.root, this.config.contentRoot = this.config.contentRoot || (n ? window.document.body : this.config.root.firstElementChild), this.config.resetProgress = this.config.resetProgress || this.resetProgress.bind(this), this._measure = this.config.measure || (() => {
|
|
1474
1480
|
const s = this.config.root;
|
|
1475
1481
|
this.progress.p = this.config.horizontal ? s.scrollX || s.scrollLeft || 0 : s.scrollY || s.scrollTop || 0;
|
|
1476
|
-
}), this._trigger =
|
|
1482
|
+
}), this._trigger = Cn(() => {
|
|
1477
1483
|
this._measure?.(), this.tick(!0);
|
|
1478
1484
|
});
|
|
1479
1485
|
}
|
|
@@ -1519,7 +1525,7 @@ class jn {
|
|
|
1519
1525
|
* Calculate current progress.
|
|
1520
1526
|
*/
|
|
1521
1527
|
lerp() {
|
|
1522
|
-
this.currentProgress.p =
|
|
1528
|
+
this.currentProgress.p = An(this.currentProgress.p, this.progress.p, +(1 - this.config.transitionFriction).toFixed(3), this.config.transitionEpsilon);
|
|
1523
1529
|
}
|
|
1524
1530
|
/**
|
|
1525
1531
|
* Stop the event and effect, and remove all DOM side-effects.
|
|
@@ -1553,9 +1559,9 @@ class jn {
|
|
|
1553
1559
|
}
|
|
1554
1560
|
}
|
|
1555
1561
|
const he = /* @__PURE__ */ new WeakMap();
|
|
1556
|
-
let
|
|
1562
|
+
let tt = () => ({});
|
|
1557
1563
|
function Dn(t) {
|
|
1558
|
-
|
|
1564
|
+
tt = t;
|
|
1559
1565
|
}
|
|
1560
1566
|
function Gn(t, e, n, s, { reducedMotion: i }) {
|
|
1561
1567
|
if (i)
|
|
@@ -1563,15 +1569,15 @@ function Gn(t, e, n, s, { reducedMotion: i }) {
|
|
|
1563
1569
|
const r = {
|
|
1564
1570
|
trigger: "view-progress",
|
|
1565
1571
|
element: t
|
|
1566
|
-
}, o =
|
|
1567
|
-
let
|
|
1572
|
+
}, o = q(n);
|
|
1573
|
+
let a;
|
|
1568
1574
|
if ("ViewTimeline" in window) {
|
|
1569
1575
|
const l = Y(
|
|
1570
1576
|
e,
|
|
1571
1577
|
o,
|
|
1572
1578
|
r
|
|
1573
1579
|
);
|
|
1574
|
-
l && !l.isCSS && (l.play(),
|
|
1580
|
+
l && !l.isCSS && (l.play(), a = () => {
|
|
1575
1581
|
l.ready.then(() => {
|
|
1576
1582
|
l.cancel();
|
|
1577
1583
|
});
|
|
@@ -1586,9 +1592,9 @@ function Gn(t, e, n, s, { reducedMotion: i }) {
|
|
|
1586
1592
|
observeViewportResize: !1,
|
|
1587
1593
|
observeSourcesResize: !0,
|
|
1588
1594
|
root: document.body,
|
|
1589
|
-
...
|
|
1595
|
+
...tt()
|
|
1590
1596
|
});
|
|
1591
|
-
|
|
1597
|
+
a = () => {
|
|
1592
1598
|
u.destroy();
|
|
1593
1599
|
}, Promise.all(f.map((d) => d.ready || Promise.resolve())).then(
|
|
1594
1600
|
() => {
|
|
@@ -1597,12 +1603,12 @@ function Gn(t, e, n, s, { reducedMotion: i }) {
|
|
|
1597
1603
|
);
|
|
1598
1604
|
}
|
|
1599
1605
|
}
|
|
1600
|
-
if (!
|
|
1601
|
-
const
|
|
1602
|
-
|
|
1606
|
+
if (!a) return;
|
|
1607
|
+
const c = { source: t, target: e, cleanup: a };
|
|
1608
|
+
C(he, t, c), C(he, e, c);
|
|
1603
1609
|
}
|
|
1604
1610
|
function Wn(t) {
|
|
1605
|
-
|
|
1611
|
+
B(he, t);
|
|
1606
1612
|
}
|
|
1607
1613
|
const Vn = {
|
|
1608
1614
|
add: Gn,
|
|
@@ -1634,7 +1640,7 @@ function Yn(t) {
|
|
|
1634
1640
|
height: t.offsetHeight
|
|
1635
1641
|
};
|
|
1636
1642
|
}
|
|
1637
|
-
function
|
|
1643
|
+
function Bn() {
|
|
1638
1644
|
const t = window.devicePixelRatio;
|
|
1639
1645
|
let e = !1;
|
|
1640
1646
|
if (t === 1)
|
|
@@ -1647,13 +1653,13 @@ function Kn() {
|
|
|
1647
1653
|
});
|
|
1648
1654
|
return document.body.dispatchEvent(n), e;
|
|
1649
1655
|
}
|
|
1650
|
-
function
|
|
1656
|
+
function Kn() {
|
|
1651
1657
|
return new Promise((t) => {
|
|
1652
1658
|
const e = window.scrollY;
|
|
1653
1659
|
let n = !1, s;
|
|
1654
1660
|
function i() {
|
|
1655
|
-
document.body.addEventListener("pointerdown", (
|
|
1656
|
-
s === void 0 ? s =
|
|
1661
|
+
document.body.addEventListener("pointerdown", (a) => {
|
|
1662
|
+
s === void 0 ? s = a.offsetY : n = a.offsetY === s;
|
|
1657
1663
|
}, { once: !0 });
|
|
1658
1664
|
const o = new PointerEvent("pointerdown", {
|
|
1659
1665
|
clientY: 500
|
|
@@ -1667,7 +1673,7 @@ function Bn() {
|
|
|
1667
1673
|
});
|
|
1668
1674
|
}
|
|
1669
1675
|
function Qn(t) {
|
|
1670
|
-
|
|
1676
|
+
Kn().then((e) => {
|
|
1671
1677
|
t.fixRequired = e, e && (window.addEventListener("scroll", t.scrollHandler), t.scrollHandler());
|
|
1672
1678
|
});
|
|
1673
1679
|
}
|
|
@@ -1704,12 +1710,12 @@ function Xn(t, e) {
|
|
|
1704
1710
|
function Zn(t, e, n) {
|
|
1705
1711
|
return {
|
|
1706
1712
|
x(s) {
|
|
1707
|
-
const i = t.left - n.x + t.width / 2, r = i >= e.width / 2, o = (r ? i : e.width - i) * 2,
|
|
1708
|
-
return (s -
|
|
1713
|
+
const i = t.left - n.x + t.width / 2, r = i >= e.width / 2, o = (r ? i : e.width - i) * 2, a = r ? 0 : i - o / 2;
|
|
1714
|
+
return (s - a) / o;
|
|
1709
1715
|
},
|
|
1710
1716
|
y(s) {
|
|
1711
|
-
const i = t.top - n.y + t.height / 2, r = i >= e.height / 2, o = (r ? i : e.height - i) * 2,
|
|
1712
|
-
return (s -
|
|
1717
|
+
const i = t.top - n.y + t.height / 2, r = i >= e.height / 2, o = (r ? i : e.height - i) * 2, a = r ? 0 : i - o / 2;
|
|
1718
|
+
return (s - a) / o;
|
|
1713
1719
|
}
|
|
1714
1720
|
};
|
|
1715
1721
|
}
|
|
@@ -1728,10 +1734,10 @@ function ts(t) {
|
|
|
1728
1734
|
return e.observe(t.root, { box: "border-box" }), e;
|
|
1729
1735
|
}
|
|
1730
1736
|
function ns(t) {
|
|
1731
|
-
let e = !1, n = { x: t.rect.width / 2, y: t.rect.height / 2, vx: 0, vy: 0 }, s, i, r, o,
|
|
1732
|
-
const
|
|
1737
|
+
let e = !1, n = { x: t.rect.width / 2, y: t.rect.height / 2, vx: 0, vy: 0 }, s, i, r, o, a;
|
|
1738
|
+
const c = { x: 0, y: 0 };
|
|
1733
1739
|
t.scenes.forEach((f) => {
|
|
1734
|
-
f.target && f.centeredToTarget && (f.transform = Zn(Yn(f.target), t.rect,
|
|
1740
|
+
f.target && f.centeredToTarget && (f.transform = Zn(Yn(f.target), t.rect, c), e = !0), t.root ? i = ts(t) : (r = es.bind(null, t), window.addEventListener("resize", r));
|
|
1735
1741
|
}), s = function(f) {
|
|
1736
1742
|
for (let u of t.scenes)
|
|
1737
1743
|
if (!u.disabled) {
|
|
@@ -1739,9 +1745,9 @@ function ns(t) {
|
|
|
1739
1745
|
t.allowActiveEvent && (f.active = d <= 1 && g <= 1 && d >= 0 && g >= 0), u.effect(u, { x: p, y: m }, h, f.active);
|
|
1740
1746
|
}
|
|
1741
1747
|
Object.assign(n, f);
|
|
1742
|
-
}, e && (o = Jn.bind(
|
|
1748
|
+
}, e && (o = Jn.bind(c, s, n), a = Xn(document, o));
|
|
1743
1749
|
function l() {
|
|
1744
|
-
t.scenes.forEach((f) => f.destroy?.()),
|
|
1750
|
+
t.scenes.forEach((f) => f.destroy?.()), a?.(), i ? (i.disconnect(), i = null) : (window.removeEventListener("resize", r), r = null), s = null, n = null;
|
|
1745
1751
|
}
|
|
1746
1752
|
return {
|
|
1747
1753
|
tick: s,
|
|
@@ -1781,7 +1787,7 @@ class rs {
|
|
|
1781
1787
|
}, this._pointerEnter = () => {
|
|
1782
1788
|
this.progress.active = !0, this._nextTick = n();
|
|
1783
1789
|
}, this.config.root) {
|
|
1784
|
-
X = typeof X == "boolean" ? X :
|
|
1790
|
+
X = typeof X == "boolean" ? X : Bn();
|
|
1785
1791
|
const i = X ? window.devicePixelRatio : 1;
|
|
1786
1792
|
typeof F.fixRequired > "u" && Qn(F), this._measure = (r) => {
|
|
1787
1793
|
if (r.target !== this.config.root) {
|
|
@@ -1825,8 +1831,8 @@ class rs {
|
|
|
1825
1831
|
const e = this.config.transitionDuration, n = this.config.transitionEasing || ((o) => o), s = performance.now();
|
|
1826
1832
|
let i = !1;
|
|
1827
1833
|
const r = (o) => {
|
|
1828
|
-
const
|
|
1829
|
-
i && (this.progress.vx = 0, this.progress.vy = 0, i = !1), this.currentProgress = Object.entries(this.progress).reduce((l, [f, u]) => (f === "active" ? l[f] = u : l[f] = this.previousProgress[f] + (u - this.previousProgress[f]) *
|
|
1834
|
+
const a = (o - this._startTime) / e, c = n(Math.min(1, a));
|
|
1835
|
+
i && (this.progress.vx = 0, this.progress.vy = 0, i = !1), this.currentProgress = Object.entries(this.progress).reduce((l, [f, u]) => (f === "active" ? l[f] = u : l[f] = this.previousProgress[f] + (u - this.previousProgress[f]) * c, l), this.currentProgress || {}), a < 1 && (this._nextTransitionTick = requestAnimationFrame(r), i = o - this._startTime > ss), this.effect.tick(this.currentProgress);
|
|
1830
1836
|
};
|
|
1831
1837
|
return this._startTime ? (this._nextTransitionTick && cancelAnimationFrame(this._nextTransitionTick), Object.assign(this.previousProgress, this.currentProgress), this._startTime = s, r(s)) : this._startTime = s, this._nextTransitionTick;
|
|
1832
1838
|
}
|
|
@@ -1865,59 +1871,72 @@ class rs {
|
|
|
1865
1871
|
}
|
|
1866
1872
|
}
|
|
1867
1873
|
const me = /* @__PURE__ */ new WeakMap();
|
|
1868
|
-
let
|
|
1874
|
+
let nt = () => ({});
|
|
1869
1875
|
function os(t) {
|
|
1870
|
-
|
|
1876
|
+
nt = t;
|
|
1871
1877
|
}
|
|
1872
|
-
function
|
|
1878
|
+
function as(t, e, n, s = {}, { reducedMotion: i }) {
|
|
1873
1879
|
if (i)
|
|
1874
1880
|
return;
|
|
1875
1881
|
const r = {
|
|
1876
1882
|
trigger: "pointer-move",
|
|
1877
1883
|
element: t,
|
|
1878
1884
|
axis: s.axis ?? "y"
|
|
1879
|
-
}, o = Ke(e,
|
|
1885
|
+
}, o = Ke(e, q(n), r);
|
|
1880
1886
|
if (o) {
|
|
1881
|
-
const
|
|
1887
|
+
const a = Array.isArray(o) ? o : [o], c = new rs({
|
|
1882
1888
|
root: s.hitArea === "self" ? t : void 0,
|
|
1883
|
-
scenes:
|
|
1884
|
-
...
|
|
1889
|
+
scenes: a,
|
|
1890
|
+
...nt()
|
|
1885
1891
|
}), f = { source: t, target: e, cleanup: () => {
|
|
1886
|
-
|
|
1892
|
+
c.destroy();
|
|
1887
1893
|
} };
|
|
1888
|
-
|
|
1889
|
-
|
|
1894
|
+
C(me, t, f), C(me, e, f), Promise.all(
|
|
1895
|
+
a.map((u) => u.ready || Promise.resolve())
|
|
1890
1896
|
).then(() => {
|
|
1891
|
-
|
|
1897
|
+
c.start();
|
|
1892
1898
|
});
|
|
1893
1899
|
}
|
|
1894
1900
|
}
|
|
1895
|
-
function
|
|
1896
|
-
|
|
1901
|
+
function cs(t) {
|
|
1902
|
+
B(me, t);
|
|
1897
1903
|
}
|
|
1898
1904
|
const fs = {
|
|
1899
|
-
add:
|
|
1900
|
-
remove:
|
|
1905
|
+
add: as,
|
|
1906
|
+
remove: cs,
|
|
1901
1907
|
registerOptionsGetter: os
|
|
1902
1908
|
}, pe = /* @__PURE__ */ new WeakMap();
|
|
1903
|
-
function ls(t, e, n, s, {
|
|
1909
|
+
function ls(t, e, n, s, {
|
|
1910
|
+
reducedMotion: i,
|
|
1911
|
+
selectorCondition: r,
|
|
1912
|
+
animation: o,
|
|
1913
|
+
sourceAnimationOptions: a
|
|
1914
|
+
}) {
|
|
1904
1915
|
const c = o || Y(
|
|
1905
1916
|
e,
|
|
1906
|
-
|
|
1917
|
+
q(n),
|
|
1907
1918
|
void 0,
|
|
1908
1919
|
i
|
|
1909
1920
|
);
|
|
1910
1921
|
if (!c)
|
|
1911
1922
|
return;
|
|
1912
|
-
const
|
|
1913
|
-
r && !e.matches(r)
|
|
1914
|
-
|
|
1915
|
-
|
|
1923
|
+
const { effectId: l } = s, f = (g) => {
|
|
1924
|
+
if (r && !e.matches(r)) return;
|
|
1925
|
+
const p = g.animationName, m = g.detail?.effectId, h = a ? Be(t, a) : null;
|
|
1926
|
+
if (h) {
|
|
1927
|
+
if (h.playState === "running" || p && !h.hasAnimationName(p))
|
|
1928
|
+
return;
|
|
1929
|
+
if (m && m !== l && !h.hasAnimationId(m))
|
|
1930
|
+
return;
|
|
1931
|
+
}
|
|
1932
|
+
c.play();
|
|
1933
|
+
}, d = { source: t, target: e, cleanup: () => {
|
|
1934
|
+
c.cancel(), t.removeEventListener("animationend", f);
|
|
1916
1935
|
} };
|
|
1917
|
-
|
|
1936
|
+
C(pe, t, d), C(pe, e, d), t.addEventListener("animationend", f);
|
|
1918
1937
|
}
|
|
1919
1938
|
function us(t) {
|
|
1920
|
-
|
|
1939
|
+
B(pe, t);
|
|
1921
1940
|
}
|
|
1922
1941
|
const ds = {
|
|
1923
1942
|
add: ls,
|
|
@@ -1926,20 +1945,20 @@ const ds = {
|
|
|
1926
1945
|
function hs(t, e, n = !1, s, i, r) {
|
|
1927
1946
|
const o = r || Y(
|
|
1928
1947
|
t,
|
|
1929
|
-
|
|
1948
|
+
q(e),
|
|
1930
1949
|
void 0,
|
|
1931
1950
|
n
|
|
1932
1951
|
);
|
|
1933
1952
|
if (!o)
|
|
1934
1953
|
return null;
|
|
1935
|
-
let
|
|
1936
|
-
const
|
|
1954
|
+
let a = !0;
|
|
1955
|
+
const c = e.triggerType || "alternate";
|
|
1937
1956
|
return (l) => {
|
|
1938
1957
|
if (s && !t.matches(s)) return;
|
|
1939
1958
|
const f = !i, u = i?.enter?.includes(l.type), d = i?.leave?.includes(l.type);
|
|
1940
1959
|
if (u || f) {
|
|
1941
|
-
if (
|
|
1942
|
-
|
|
1960
|
+
if (c === "alternate" || c === "state")
|
|
1961
|
+
a ? (a = !1, o.play()) : c === "alternate" ? o.reverse() : c === "state" && (o.playState === "running" ? o.pause() : o.playState !== "finished" && o.play());
|
|
1943
1962
|
else {
|
|
1944
1963
|
if (o.progress(0), delete t.dataset.interactEnter, o.isCSS) {
|
|
1945
1964
|
const g = () => {
|
|
@@ -1953,9 +1972,9 @@ function hs(t, e, n = !1, s, i, r) {
|
|
|
1953
1972
|
}
|
|
1954
1973
|
return;
|
|
1955
1974
|
}
|
|
1956
|
-
d && (
|
|
1975
|
+
d && (c === "alternate" ? o.reverse() : c === "repeat" ? (o.cancel(), O.mutate(() => {
|
|
1957
1976
|
delete t.dataset.interactEnter;
|
|
1958
|
-
})) :
|
|
1977
|
+
})) : c === "state" && o.playState === "running" && o.pause());
|
|
1959
1978
|
};
|
|
1960
1979
|
}
|
|
1961
1980
|
function ms(t, e, {
|
|
@@ -1963,13 +1982,13 @@ function ms(t, e, {
|
|
|
1963
1982
|
listContainer: s,
|
|
1964
1983
|
listItemSelector: i,
|
|
1965
1984
|
stateAction: r
|
|
1966
|
-
}, o,
|
|
1967
|
-
const
|
|
1985
|
+
}, o, a) {
|
|
1986
|
+
const c = !!s, l = r ?? "toggle", f = l === "toggle";
|
|
1968
1987
|
return (u) => {
|
|
1969
1988
|
if (o && !t.matches(o)) return;
|
|
1970
|
-
const d =
|
|
1989
|
+
const d = c ? t.closest(
|
|
1971
1990
|
`${s} > ${i || ""}:has(:scope)`
|
|
1972
|
-
) : void 0, g = !
|
|
1991
|
+
) : void 0, g = !a, p = a?.enter?.includes(u.type), m = a?.leave?.includes(u.type);
|
|
1973
1992
|
g ? e.toggleEffect(n, l, d) : (p && e.toggleEffect(n, f ? "add" : l, d), m && f && e.toggleEffect(n, "remove", d));
|
|
1974
1993
|
};
|
|
1975
1994
|
}
|
|
@@ -2026,9 +2045,9 @@ function Ts(t, e, n, s, {
|
|
|
2026
2045
|
reducedMotion: i,
|
|
2027
2046
|
targetController: r,
|
|
2028
2047
|
selectorCondition: o,
|
|
2029
|
-
animation:
|
|
2048
|
+
animation: a
|
|
2030
2049
|
}) {
|
|
2031
|
-
const
|
|
2050
|
+
const c = ws(s.eventConfig), l = n.transition || n.transitionProperties, f = Ss(c);
|
|
2032
2051
|
let u, d = !1;
|
|
2033
2052
|
if (l ? u = ms(
|
|
2034
2053
|
e,
|
|
@@ -2042,7 +2061,7 @@ function Ts(t, e, n, s, {
|
|
|
2042
2061
|
i,
|
|
2043
2062
|
o,
|
|
2044
2063
|
f,
|
|
2045
|
-
|
|
2064
|
+
a
|
|
2046
2065
|
), d = n.triggerType === "once"), !u)
|
|
2047
2066
|
return;
|
|
2048
2067
|
const g = u, p = new AbortController();
|
|
@@ -2053,8 +2072,8 @@ function Ts(t, e, n, s, {
|
|
|
2053
2072
|
const v = { source: t, target: e, cleanup: () => {
|
|
2054
2073
|
p.abort();
|
|
2055
2074
|
} };
|
|
2056
|
-
if (
|
|
2057
|
-
const y =
|
|
2075
|
+
if (C(ge, t, v), C(ge, e, v), f) {
|
|
2076
|
+
const y = c.enter, E = c.leave;
|
|
2058
2077
|
y.forEach((T) => {
|
|
2059
2078
|
T === "focusin" && (t.tabIndex = 0), m(t, T, { passive: !0, once: d });
|
|
2060
2079
|
});
|
|
@@ -2067,12 +2086,12 @@ function Ts(t, e, n, s, {
|
|
|
2067
2086
|
m(t, T, { passive: !0 });
|
|
2068
2087
|
});
|
|
2069
2088
|
} else
|
|
2070
|
-
(
|
|
2089
|
+
(c.toggle ?? []).forEach((E) => {
|
|
2071
2090
|
m(t, E, { once: d, passive: E !== "keydown" });
|
|
2072
2091
|
});
|
|
2073
2092
|
}
|
|
2074
2093
|
function Is(t) {
|
|
2075
|
-
|
|
2094
|
+
B(ge, t);
|
|
2076
2095
|
}
|
|
2077
2096
|
const j = {
|
|
2078
2097
|
add: Ts,
|
|
@@ -2092,11 +2111,11 @@ const j = {
|
|
|
2092
2111
|
function Z(t) {
|
|
2093
2112
|
const e = ve[t];
|
|
2094
2113
|
return (n, s, i, r, o) => {
|
|
2095
|
-
const
|
|
2096
|
-
j.add(n, s, i, { eventConfig:
|
|
2114
|
+
const a = o?.allowA11yTriggers && t in Fe ? Fe[t] : e;
|
|
2115
|
+
j.add(n, s, i, { eventConfig: a }, o ?? {});
|
|
2097
2116
|
};
|
|
2098
2117
|
}
|
|
2099
|
-
const
|
|
2118
|
+
const x = {
|
|
2100
2119
|
viewEnter: _e,
|
|
2101
2120
|
hover: {
|
|
2102
2121
|
add: Z("hover"),
|
|
@@ -2142,7 +2161,7 @@ class b {
|
|
|
2142
2161
|
if (typeof window > "u" || !window.customElements)
|
|
2143
2162
|
return;
|
|
2144
2163
|
const s = n?.useCustomElement ?? !!b.defineInteractElement;
|
|
2145
|
-
this.dataCache =
|
|
2164
|
+
this.dataCache = Cs(e, s);
|
|
2146
2165
|
const i = b.defineInteractElement?.();
|
|
2147
2166
|
s && i === !1 ? document.querySelectorAll("interact-element").forEach((r) => {
|
|
2148
2167
|
r.connect();
|
|
@@ -2201,11 +2220,11 @@ class b {
|
|
|
2201
2220
|
}), b.instances.length = 0, b.controllerCache.clear(), b.sequenceCache.clear(), b.elementSequenceMap = /* @__PURE__ */ new WeakMap();
|
|
2202
2221
|
}
|
|
2203
2222
|
static setup(e) {
|
|
2204
|
-
e.scrollOptionsGetter &&
|
|
2223
|
+
e.scrollOptionsGetter && x.viewProgress.registerOptionsGetter?.(
|
|
2205
2224
|
e.scrollOptionsGetter
|
|
2206
|
-
), e.pointerOptionsGetter &&
|
|
2225
|
+
), e.pointerOptionsGetter && x.pointerMove.registerOptionsGetter?.(
|
|
2207
2226
|
e.pointerOptionsGetter
|
|
2208
|
-
), e.viewEnter &&
|
|
2227
|
+
), e.viewEnter && x.viewEnter.setOptions(
|
|
2209
2228
|
e.viewEnter
|
|
2210
2229
|
), e.allowA11yTriggers !== void 0 && (b.allowA11yTriggers = e.allowA11yTriggers);
|
|
2211
2230
|
}
|
|
@@ -2223,7 +2242,7 @@ class b {
|
|
|
2223
2242
|
static deleteController(e) {
|
|
2224
2243
|
b.controllerCache.delete(e);
|
|
2225
2244
|
}
|
|
2226
|
-
static registerEffects =
|
|
2245
|
+
static registerEffects = Zt;
|
|
2227
2246
|
static getSequence(e, n, s, i) {
|
|
2228
2247
|
const r = b.sequenceCache.get(e);
|
|
2229
2248
|
if (r) return r;
|
|
@@ -2233,11 +2252,11 @@ class b {
|
|
|
2233
2252
|
static addToSequence(e, n, s, i) {
|
|
2234
2253
|
const r = b.sequenceCache.get(e);
|
|
2235
2254
|
if (!r) return !1;
|
|
2236
|
-
const
|
|
2255
|
+
const a = Qe(n, i).map((c, l) => ({
|
|
2237
2256
|
index: s[l] ?? r.animationGroups.length,
|
|
2238
|
-
group:
|
|
2257
|
+
group: c
|
|
2239
2258
|
}));
|
|
2240
|
-
return r.addGroups(
|
|
2259
|
+
return r.addGroups(a), b._registerSequenceElements(n, r), !0;
|
|
2241
2260
|
}
|
|
2242
2261
|
static _registerSequenceElements(e, n) {
|
|
2243
2262
|
for (const { target: s } of e) {
|
|
@@ -2261,8 +2280,8 @@ class b {
|
|
|
2261
2280
|
}
|
|
2262
2281
|
}
|
|
2263
2282
|
}
|
|
2264
|
-
let
|
|
2265
|
-
function
|
|
2283
|
+
let As = 0;
|
|
2284
|
+
function P(t, {
|
|
2266
2285
|
asCombinator: e = !1,
|
|
2267
2286
|
addItemFilter: n = !1,
|
|
2268
2287
|
useFirstChild: s = !1
|
|
@@ -2286,15 +2305,15 @@ function le(t, e) {
|
|
|
2286
2305
|
selectors: /* @__PURE__ */ new Set()
|
|
2287
2306
|
}), t[e];
|
|
2288
2307
|
}
|
|
2289
|
-
function
|
|
2308
|
+
function Cs(t, e = !1) {
|
|
2290
2309
|
const { effects: n = {}, sequences: s = {}, conditions: i = {} } = t, r = {};
|
|
2291
2310
|
return t.interactions?.forEach((o) => {
|
|
2292
|
-
const
|
|
2293
|
-
if (!
|
|
2294
|
-
console.error(`Interaction ${
|
|
2311
|
+
const a = o.key, c = ++As, { effects: l, sequences: f, ...u } = o;
|
|
2312
|
+
if (!a) {
|
|
2313
|
+
console.error(`Interaction ${c} is missing a key for source element.`);
|
|
2295
2314
|
return;
|
|
2296
2315
|
}
|
|
2297
|
-
le(r,
|
|
2316
|
+
le(r, a);
|
|
2298
2317
|
const d = l ? Array.from(l) : [];
|
|
2299
2318
|
d.reverse();
|
|
2300
2319
|
const g = f?.map((h) => {
|
|
@@ -2303,14 +2322,14 @@ function ks(t, e = !1) {
|
|
|
2303
2322
|
return y ? { ...y, ...h } : (console.warn(`Interact: Sequence "${h.sequenceId}" not found in config`), h);
|
|
2304
2323
|
}
|
|
2305
2324
|
const v = h;
|
|
2306
|
-
return v.sequenceId || (v.sequenceId =
|
|
2325
|
+
return v.sequenceId || (v.sequenceId = k()), v;
|
|
2307
2326
|
}), p = {
|
|
2308
2327
|
...u,
|
|
2309
2328
|
effects: d.length > 0 ? d : void 0,
|
|
2310
2329
|
sequences: g
|
|
2311
2330
|
};
|
|
2312
|
-
r[
|
|
2313
|
-
|
|
2331
|
+
r[a].triggers.push(p), r[a].selectors.add(
|
|
2332
|
+
P(p, { useFirstChild: e })
|
|
2314
2333
|
);
|
|
2315
2334
|
const m = p.listContainer;
|
|
2316
2335
|
d.forEach((h) => {
|
|
@@ -2319,30 +2338,30 @@ function ks(t, e = !1) {
|
|
|
2319
2338
|
const S = n[h.effectId];
|
|
2320
2339
|
S && (v = S.key);
|
|
2321
2340
|
}
|
|
2322
|
-
h.effectId || (h.effectId =
|
|
2341
|
+
h.effectId || (h.effectId = k()), v = v || a, h.key = v;
|
|
2323
2342
|
const y = h.effectId;
|
|
2324
|
-
if (m && h.listContainer && (v !==
|
|
2343
|
+
if (m && h.listContainer && (v !== a || h.listContainer !== m))
|
|
2325
2344
|
return;
|
|
2326
|
-
const E = `${
|
|
2327
|
-
if (h.interactionId = E, r[
|
|
2345
|
+
const E = `${a}::${v}::${y}::${c}`;
|
|
2346
|
+
if (h.interactionId = E, r[a].interactionIds.add(E), v === a)
|
|
2328
2347
|
return;
|
|
2329
2348
|
const w = le(r, v);
|
|
2330
|
-
w.effects[E] || (w.effects[E] = [], w.interactionIds.add(E)), w.effects[E].push({ ...u, effect: h }), w.selectors.add(
|
|
2349
|
+
w.effects[E] || (w.effects[E] = [], w.interactionIds.add(E)), w.effects[E].push({ ...u, effect: h }), w.selectors.add(P(h, { useFirstChild: e }));
|
|
2331
2350
|
}), g?.forEach((h) => {
|
|
2332
2351
|
if (!h || Ne(h)) return;
|
|
2333
|
-
const v = h, y = v.sequenceId ||
|
|
2352
|
+
const v = h, y = v.sequenceId || k(), E = v.effects;
|
|
2334
2353
|
for (const w of E) {
|
|
2335
|
-
w.effectId || (w.effectId =
|
|
2354
|
+
w.effectId || (w.effectId = k());
|
|
2336
2355
|
let S = w.key;
|
|
2337
2356
|
if (!S && w.effectId) {
|
|
2338
2357
|
const I = n[w.effectId];
|
|
2339
2358
|
I && (S = I.key);
|
|
2340
2359
|
}
|
|
2341
|
-
S = S ||
|
|
2342
|
-
const T =
|
|
2343
|
-
if (T && r[
|
|
2344
|
-
const I = le(r, S),
|
|
2345
|
-
I.sequences[
|
|
2360
|
+
S = S || a;
|
|
2361
|
+
const T = P(w, { useFirstChild: e });
|
|
2362
|
+
if (T && r[a].selectors.add(T), S !== a) {
|
|
2363
|
+
const I = le(r, S), A = `${S}::seq::${y}::${c}`;
|
|
2364
|
+
I.sequences[A] || (I.sequences[A] = [], I.interactionIds.add(A)), I.sequences[A].push({
|
|
2346
2365
|
...u,
|
|
2347
2366
|
sequence: v
|
|
2348
2367
|
}), I.selectors.add(T);
|
|
@@ -2372,47 +2391,49 @@ function ye(t, e, n) {
|
|
|
2372
2391
|
function Ee(t, e) {
|
|
2373
2392
|
return e.map((n) => t.selector ? n.querySelector(t.selector) : n).filter(Boolean);
|
|
2374
2393
|
}
|
|
2375
|
-
function
|
|
2394
|
+
function st(t, e, n, s, i, r, o, a) {
|
|
2376
2395
|
return [
|
|
2377
2396
|
o ? Ee(t, o) : ye(t, n, s),
|
|
2378
|
-
|
|
2397
|
+
a ? Ee(e, a) : ye(e, i, r)
|
|
2379
2398
|
];
|
|
2380
2399
|
}
|
|
2381
|
-
function
|
|
2382
|
-
const c = Array.isArray(s),
|
|
2383
|
-
c ? s.forEach((
|
|
2384
|
-
const
|
|
2385
|
-
|
|
2400
|
+
function it(t, e, n, s, i, r, o, a) {
|
|
2401
|
+
const c = Array.isArray(s), l = Array.isArray(i);
|
|
2402
|
+
c ? s.forEach((f, u) => {
|
|
2403
|
+
const d = l ? i[u] : i;
|
|
2404
|
+
d && ze(
|
|
2386
2405
|
t,
|
|
2387
|
-
|
|
2406
|
+
f,
|
|
2388
2407
|
e.trigger,
|
|
2389
|
-
|
|
2408
|
+
d,
|
|
2390
2409
|
n,
|
|
2391
2410
|
e.params,
|
|
2392
2411
|
r,
|
|
2393
|
-
o
|
|
2412
|
+
o,
|
|
2413
|
+
a
|
|
2394
2414
|
);
|
|
2395
|
-
}) : (
|
|
2415
|
+
}) : (l ? i : [i]).forEach((u) => {
|
|
2396
2416
|
ze(
|
|
2397
2417
|
t,
|
|
2398
2418
|
s,
|
|
2399
2419
|
e.trigger,
|
|
2400
|
-
|
|
2420
|
+
u,
|
|
2401
2421
|
n,
|
|
2402
2422
|
e.params,
|
|
2403
2423
|
r,
|
|
2404
|
-
o
|
|
2424
|
+
o,
|
|
2425
|
+
a
|
|
2405
2426
|
);
|
|
2406
2427
|
});
|
|
2407
2428
|
}
|
|
2408
|
-
function
|
|
2429
|
+
function rt(t, e, n, s, i) {
|
|
2409
2430
|
const r = {}, o = [];
|
|
2410
|
-
(s.effects || []).forEach((
|
|
2411
|
-
const
|
|
2412
|
-
...n.dataCache.effects[
|
|
2413
|
-
...
|
|
2414
|
-
effectId:
|
|
2415
|
-
}, f = l.key, u = $(
|
|
2431
|
+
(s.effects || []).forEach((a) => {
|
|
2432
|
+
const c = a.effectId, l = {
|
|
2433
|
+
...n.dataCache.effects[c] || {},
|
|
2434
|
+
...a,
|
|
2435
|
+
effectId: c
|
|
2436
|
+
}, f = l.key, u = $(a.interactionId, t);
|
|
2416
2437
|
if (r[u] || n.addedInteractions[u] && !i)
|
|
2417
2438
|
return;
|
|
2418
2439
|
const d = _(l.conditions || [], n.dataCache.conditions);
|
|
@@ -2428,7 +2449,7 @@ function it(t, e, n, s, i) {
|
|
|
2428
2449
|
l.listContainer && p.watchChildList(l.listContainer);
|
|
2429
2450
|
} else
|
|
2430
2451
|
p = e;
|
|
2431
|
-
const [m, h] =
|
|
2452
|
+
const [m, h] = st(
|
|
2432
2453
|
s,
|
|
2433
2454
|
l,
|
|
2434
2455
|
e.element,
|
|
@@ -2440,7 +2461,7 @@ function it(t, e, n, s, i) {
|
|
|
2440
2461
|
if (!m || !h)
|
|
2441
2462
|
return;
|
|
2442
2463
|
n.addedInteractions[u] = !0;
|
|
2443
|
-
const v = g || s.key, y =
|
|
2464
|
+
const v = g || s.key, y = L(
|
|
2444
2465
|
l.conditions || [],
|
|
2445
2466
|
n.dataCache.conditions
|
|
2446
2467
|
);
|
|
@@ -2451,22 +2472,23 @@ function it(t, e, n, s, i) {
|
|
|
2451
2472
|
m,
|
|
2452
2473
|
h,
|
|
2453
2474
|
y,
|
|
2454
|
-
p.useFirstChild
|
|
2475
|
+
p.useFirstChild,
|
|
2476
|
+
t
|
|
2455
2477
|
]);
|
|
2456
2478
|
}
|
|
2457
|
-
}), o.reverse().forEach((
|
|
2458
|
-
|
|
2479
|
+
}), o.reverse().forEach((a) => {
|
|
2480
|
+
it(...a);
|
|
2459
2481
|
}), $s(t, e, n, s, i);
|
|
2460
2482
|
}
|
|
2461
|
-
function
|
|
2483
|
+
function ks(t) {
|
|
2462
2484
|
return "sequenceId" in t && !("effects" in t);
|
|
2463
2485
|
}
|
|
2464
|
-
function
|
|
2465
|
-
const
|
|
2466
|
-
if (
|
|
2467
|
-
const
|
|
2486
|
+
function ot(t, e, n, s, i, r, o) {
|
|
2487
|
+
const a = _(t.conditions || [], i.dataCache.conditions);
|
|
2488
|
+
if (a && i.setupMediaQueryListener(e, a, r.updateKey, r.onUpdate), a && !a.matches) return null;
|
|
2489
|
+
const c = t.effects || [], l = [];
|
|
2468
2490
|
let f = !1;
|
|
2469
|
-
for (const u of
|
|
2491
|
+
for (const u of c) {
|
|
2470
2492
|
const d = u.effectId, p = {
|
|
2471
2493
|
...d ? i.dataCache.effects[d] || {} : {},
|
|
2472
2494
|
...u
|
|
@@ -2494,24 +2516,24 @@ function rt(t, e, n, s, i, r, o) {
|
|
|
2494
2516
|
y.element,
|
|
2495
2517
|
y.useFirstChild
|
|
2496
2518
|
), !w || Array.isArray(w) && w.length === 0) return null;
|
|
2497
|
-
const S =
|
|
2519
|
+
const S = q(p);
|
|
2498
2520
|
l.push({ target: w, options: S });
|
|
2499
2521
|
}
|
|
2500
2522
|
return o && !f ? null : l.length > 0 ? l : null;
|
|
2501
2523
|
}
|
|
2502
|
-
function
|
|
2524
|
+
function at(t, e, n) {
|
|
2503
2525
|
const r = (t.useFirstChild ? t.element.firstElementChild : t.element)?.querySelector(e);
|
|
2504
|
-
if (!r) return n.map((
|
|
2526
|
+
if (!r) return n.map((a, c) => c);
|
|
2505
2527
|
const o = Array.from(r.children);
|
|
2506
|
-
return n.map((
|
|
2507
|
-
const
|
|
2508
|
-
return
|
|
2528
|
+
return n.map((a) => {
|
|
2529
|
+
const c = o.indexOf(a);
|
|
2530
|
+
return c >= 0 ? c : o.length;
|
|
2509
2531
|
});
|
|
2510
2532
|
}
|
|
2511
2533
|
function $s(t, e, n, s, i) {
|
|
2512
2534
|
s.sequences?.forEach((r) => {
|
|
2513
2535
|
let o;
|
|
2514
|
-
if (
|
|
2536
|
+
if (ks(r)) {
|
|
2515
2537
|
const g = n.dataCache.sequences[r.sequenceId];
|
|
2516
2538
|
if (!g) {
|
|
2517
2539
|
console.warn(`Interact: Sequence "${r.sequenceId}" not found in cache`);
|
|
@@ -2520,11 +2542,11 @@ function $s(t, e, n, s, i) {
|
|
|
2520
2542
|
o = { ...g, ...r };
|
|
2521
2543
|
} else
|
|
2522
2544
|
o = r;
|
|
2523
|
-
const
|
|
2524
|
-
if (n.addedInteractions[
|
|
2525
|
-
const l = i && s.listContainer ? { controllerKey: t, listContainer: s.listContainer, elements: i } : void 0, f =
|
|
2545
|
+
const a = o.sequenceId || k(), c = $(`${t}::seq::${a}`, t);
|
|
2546
|
+
if (n.addedInteractions[c] && !i) return;
|
|
2547
|
+
const l = i && s.listContainer ? { controllerKey: t, listContainer: s.listContainer, elements: i } : void 0, f = ot(
|
|
2526
2548
|
o,
|
|
2527
|
-
|
|
2549
|
+
c,
|
|
2528
2550
|
t,
|
|
2529
2551
|
e,
|
|
2530
2552
|
n,
|
|
@@ -2532,26 +2554,26 @@ function $s(t, e, n, s, i) {
|
|
|
2532
2554
|
l
|
|
2533
2555
|
);
|
|
2534
2556
|
if (!f) return;
|
|
2535
|
-
if (i && n.addedInteractions[
|
|
2536
|
-
const g =
|
|
2557
|
+
if (i && n.addedInteractions[c]) {
|
|
2558
|
+
const g = at(
|
|
2537
2559
|
e,
|
|
2538
2560
|
s.listContainer,
|
|
2539
2561
|
i
|
|
2540
2562
|
);
|
|
2541
|
-
b.addToSequence(
|
|
2563
|
+
b.addToSequence(c, f, g, {
|
|
2542
2564
|
reducedMotion: b.forceReducedMotion
|
|
2543
2565
|
});
|
|
2544
2566
|
return;
|
|
2545
2567
|
}
|
|
2546
|
-
const u = b.getSequence(
|
|
2568
|
+
const u = b.getSequence(c, o, f, {
|
|
2547
2569
|
reducedMotion: b.forceReducedMotion
|
|
2548
2570
|
});
|
|
2549
|
-
n.addedInteractions[
|
|
2550
|
-
const d =
|
|
2571
|
+
n.addedInteractions[c] = !0;
|
|
2572
|
+
const d = L(
|
|
2551
2573
|
s.conditions || [],
|
|
2552
2574
|
n.dataCache.conditions
|
|
2553
2575
|
);
|
|
2554
|
-
|
|
2576
|
+
x[s.trigger]?.add(
|
|
2555
2577
|
e.element,
|
|
2556
2578
|
e.element,
|
|
2557
2579
|
{ triggerType: o.triggerType },
|
|
@@ -2567,8 +2589,8 @@ function $s(t, e, n, s, i) {
|
|
|
2567
2589
|
}
|
|
2568
2590
|
function _s(t, e, n, s, i) {
|
|
2569
2591
|
const r = n.get(t)?.sequences || {};
|
|
2570
|
-
Object.keys(r).forEach((
|
|
2571
|
-
r[
|
|
2592
|
+
Object.keys(r).forEach((a) => {
|
|
2593
|
+
r[a].some(({ sequence: l, ...f }) => {
|
|
2572
2594
|
const u = _(
|
|
2573
2595
|
f.conditions || [],
|
|
2574
2596
|
n.dataCache.conditions
|
|
@@ -2578,10 +2600,10 @@ function _s(t, e, n, s, i) {
|
|
|
2578
2600
|
const d = f.key && $(f.key, t), g = b.getController(d);
|
|
2579
2601
|
if (!g)
|
|
2580
2602
|
return !0;
|
|
2581
|
-
const p = l.sequenceId ||
|
|
2603
|
+
const p = l.sequenceId || k(), m = $(`${d}::seq::${p}`, d);
|
|
2582
2604
|
if (n.addedInteractions[m] && !i)
|
|
2583
2605
|
return !0;
|
|
2584
|
-
const v =
|
|
2606
|
+
const v = ot(
|
|
2585
2607
|
l,
|
|
2586
2608
|
m,
|
|
2587
2609
|
d,
|
|
@@ -2592,7 +2614,7 @@ function _s(t, e, n, s, i) {
|
|
|
2592
2614
|
);
|
|
2593
2615
|
if (!v) return !0;
|
|
2594
2616
|
if (i && n.addedInteractions[m]) {
|
|
2595
|
-
const w =
|
|
2617
|
+
const w = at(e, s, i);
|
|
2596
2618
|
return b.addToSequence(m, v, w, {
|
|
2597
2619
|
reducedMotion: b.forceReducedMotion
|
|
2598
2620
|
}), !0;
|
|
@@ -2601,11 +2623,11 @@ function _s(t, e, n, s, i) {
|
|
|
2601
2623
|
reducedMotion: b.forceReducedMotion
|
|
2602
2624
|
});
|
|
2603
2625
|
n.addedInteractions[m] = !0;
|
|
2604
|
-
const E =
|
|
2626
|
+
const E = L(
|
|
2605
2627
|
f.conditions || [],
|
|
2606
2628
|
n.dataCache.conditions
|
|
2607
2629
|
);
|
|
2608
|
-
return
|
|
2630
|
+
return x[f.trigger]?.add(
|
|
2609
2631
|
g.element,
|
|
2610
2632
|
g.element,
|
|
2611
2633
|
{ triggerType: l.triggerType },
|
|
@@ -2621,8 +2643,8 @@ function _s(t, e, n, s, i) {
|
|
|
2621
2643
|
});
|
|
2622
2644
|
}
|
|
2623
2645
|
function ct(t, e, n, s, i) {
|
|
2624
|
-
const r = n.get(t), o = r?.effects || {},
|
|
2625
|
-
|
|
2646
|
+
const r = n.get(t), o = r?.effects || {}, a = Object.keys(o), c = [];
|
|
2647
|
+
a.forEach((f) => {
|
|
2626
2648
|
const u = $(f, t);
|
|
2627
2649
|
if (n.addedInteractions[u] && !i)
|
|
2628
2650
|
return;
|
|
@@ -2648,7 +2670,7 @@ function ct(t, e, n, s, i) {
|
|
|
2648
2670
|
if (!w)
|
|
2649
2671
|
return !0;
|
|
2650
2672
|
v.listContainer && e.watchChildList(v.listContainer);
|
|
2651
|
-
const [S, T] =
|
|
2673
|
+
const [S, T] = st(
|
|
2652
2674
|
p,
|
|
2653
2675
|
v,
|
|
2654
2676
|
w.element,
|
|
@@ -2661,52 +2683,59 @@ function ct(t, e, n, s, i) {
|
|
|
2661
2683
|
if (!S || !T)
|
|
2662
2684
|
return !0;
|
|
2663
2685
|
n.addedInteractions[u] = !0;
|
|
2664
|
-
const I =
|
|
2686
|
+
const I = L(
|
|
2665
2687
|
v.conditions || [],
|
|
2666
2688
|
n.dataCache.conditions
|
|
2667
2689
|
);
|
|
2668
|
-
return
|
|
2690
|
+
return c.push([
|
|
2669
2691
|
t,
|
|
2670
2692
|
p,
|
|
2671
2693
|
v,
|
|
2672
2694
|
S,
|
|
2673
2695
|
T,
|
|
2674
2696
|
I,
|
|
2675
|
-
e.useFirstChild
|
|
2697
|
+
e.useFirstChild,
|
|
2698
|
+
E || void 0
|
|
2676
2699
|
]), !0;
|
|
2677
2700
|
}
|
|
2678
2701
|
return !1;
|
|
2679
2702
|
});
|
|
2680
|
-
}),
|
|
2681
|
-
|
|
2703
|
+
}), c.reverse().forEach((f) => {
|
|
2704
|
+
it(...f);
|
|
2682
2705
|
}), _s(t, e, n, s, i);
|
|
2683
2706
|
const l = Object.keys(r?.sequences || {}).length > 0;
|
|
2684
|
-
return
|
|
2707
|
+
return a.length > 0 || l;
|
|
2685
2708
|
}
|
|
2686
|
-
function ze(t, e, n, s, i, r, o, c) {
|
|
2687
|
-
let
|
|
2709
|
+
function ze(t, e, n, s, i, r, o, a, c) {
|
|
2710
|
+
let l;
|
|
2688
2711
|
if (i.transition || i.transitionProperties) {
|
|
2689
|
-
const
|
|
2712
|
+
const u = {
|
|
2690
2713
|
key: t,
|
|
2691
2714
|
effectId: i.effectId,
|
|
2692
2715
|
transition: i.transition,
|
|
2693
2716
|
transitionProperties: i.transitionProperties,
|
|
2694
|
-
childSelector:
|
|
2717
|
+
childSelector: P(i, {
|
|
2695
2718
|
asCombinator: !0,
|
|
2696
2719
|
addItemFilter: !0,
|
|
2697
|
-
useFirstChild:
|
|
2720
|
+
useFirstChild: a
|
|
2698
2721
|
}),
|
|
2699
2722
|
selectorCondition: o
|
|
2700
2723
|
};
|
|
2701
|
-
if (
|
|
2724
|
+
if (l = b.getController(t), !l)
|
|
2702
2725
|
return;
|
|
2703
|
-
|
|
2726
|
+
l.renderStyle(gn(u));
|
|
2704
2727
|
}
|
|
2705
|
-
|
|
2728
|
+
let f;
|
|
2729
|
+
if (n === "animationEnd") {
|
|
2730
|
+
const u = r.effectId, g = (c ? b.getInstance(c) : void 0)?.dataCache.effects[u];
|
|
2731
|
+
g && (f = q(g));
|
|
2732
|
+
}
|
|
2733
|
+
x[n]?.add(e, s, i, r, {
|
|
2706
2734
|
reducedMotion: b.forceReducedMotion,
|
|
2707
|
-
targetController:
|
|
2735
|
+
targetController: l,
|
|
2708
2736
|
selectorCondition: o,
|
|
2709
|
-
allowA11yTriggers: b.allowA11yTriggers
|
|
2737
|
+
allowA11yTriggers: b.allowA11yTriggers,
|
|
2738
|
+
sourceAnimationOptions: f
|
|
2710
2739
|
});
|
|
2711
2740
|
}
|
|
2712
2741
|
function qs(t) {
|
|
@@ -2714,15 +2743,15 @@ function qs(t) {
|
|
|
2714
2743
|
if (!n)
|
|
2715
2744
|
return console.warn(`No instance found for key: ${e}`), b.setController(e, t), !1;
|
|
2716
2745
|
const { triggers: s = [] } = n?.get(e) || {}, i = s.length > 0;
|
|
2717
|
-
n.setController(e, t), s.forEach((o,
|
|
2718
|
-
const
|
|
2719
|
-
if (
|
|
2720
|
-
const l = `${e}::trigger::${
|
|
2721
|
-
n.setupMediaQueryListener(l,
|
|
2746
|
+
n.setController(e, t), s.forEach((o, a) => {
|
|
2747
|
+
const c = _(o.conditions, n.dataCache.conditions);
|
|
2748
|
+
if (c) {
|
|
2749
|
+
const l = `${e}::trigger::${a}`;
|
|
2750
|
+
n.setupMediaQueryListener(l, c, e, () => {
|
|
2722
2751
|
t.update();
|
|
2723
2752
|
});
|
|
2724
2753
|
}
|
|
2725
|
-
(!
|
|
2754
|
+
(!c || c.matches) && (o.listContainer && t.watchChildList(o.listContainer), rt(e, t, n, o));
|
|
2726
2755
|
});
|
|
2727
2756
|
let r = !1;
|
|
2728
2757
|
return n && (r = ct(e, t, n)), i || r;
|
|
@@ -2731,17 +2760,17 @@ function Ms(t, e, n) {
|
|
|
2731
2760
|
const s = t.key, i = b.getInstance(s);
|
|
2732
2761
|
if (i) {
|
|
2733
2762
|
const { triggers: r = [] } = i?.get(s) || {};
|
|
2734
|
-
r.forEach((o,
|
|
2763
|
+
r.forEach((o, a) => {
|
|
2735
2764
|
if (o.listContainer !== e)
|
|
2736
2765
|
return;
|
|
2737
|
-
const
|
|
2738
|
-
if (
|
|
2739
|
-
const l = `${s}::listTrigger::${e}::${
|
|
2740
|
-
i.setupMediaQueryListener(l,
|
|
2766
|
+
const c = _(o.conditions, i.dataCache.conditions);
|
|
2767
|
+
if (c) {
|
|
2768
|
+
const l = `${s}::listTrigger::${e}::${a}`;
|
|
2769
|
+
i.setupMediaQueryListener(l, c, s, () => {
|
|
2741
2770
|
t.update();
|
|
2742
2771
|
});
|
|
2743
2772
|
}
|
|
2744
|
-
(!
|
|
2773
|
+
(!c || c.matches) && rt(s, t, i, o, n);
|
|
2745
2774
|
}), ct(s, t, i, e, n);
|
|
2746
2775
|
}
|
|
2747
2776
|
}
|
|
@@ -2751,10 +2780,10 @@ function xs(t, e = !1) {
|
|
|
2751
2780
|
return;
|
|
2752
2781
|
const i = [...s.get(n)?.selectors.values() || []].filter(Boolean).join(",");
|
|
2753
2782
|
let r;
|
|
2754
|
-
i ? (r = [...t.element.querySelectorAll(i)], t.useFirstChild || r.push(t.element)) : r = [t.element],
|
|
2783
|
+
i ? (r = [...t.element.querySelectorAll(i)], t.useFirstChild || r.push(t.element)) : r = [t.element], ft(r), s.deleteController(n, e);
|
|
2755
2784
|
}
|
|
2756
|
-
function
|
|
2757
|
-
const e = Object.values(
|
|
2785
|
+
function ft(t) {
|
|
2786
|
+
const e = Object.values(x);
|
|
2758
2787
|
for (const n of t)
|
|
2759
2788
|
for (const s of e)
|
|
2760
2789
|
s.remove(n);
|
|
@@ -2836,12 +2865,12 @@ class Ps {
|
|
|
2836
2865
|
_childListChangeHandler(e, n) {
|
|
2837
2866
|
const s = this.key || this.element.dataset.interactKey, i = [], r = [];
|
|
2838
2867
|
n.forEach((o) => {
|
|
2839
|
-
o.removedNodes.forEach((
|
|
2840
|
-
|
|
2841
|
-
}), o.addedNodes.forEach((
|
|
2842
|
-
|
|
2868
|
+
o.removedNodes.forEach((a) => {
|
|
2869
|
+
a instanceof HTMLElement && i.push(a);
|
|
2870
|
+
}), o.addedNodes.forEach((a) => {
|
|
2871
|
+
a instanceof HTMLElement && r.push(a);
|
|
2843
2872
|
});
|
|
2844
|
-
}),
|
|
2873
|
+
}), ft(i), s && Ms(this, e, r);
|
|
2845
2874
|
}
|
|
2846
2875
|
}
|
|
2847
2876
|
function Us(t, e) {
|
|
@@ -2851,7 +2880,7 @@ function Xs(t) {
|
|
|
2851
2880
|
const e = b.getController(t);
|
|
2852
2881
|
e && e.disconnect({ removeFromCache: !0 });
|
|
2853
2882
|
}
|
|
2854
|
-
const
|
|
2883
|
+
const lt = /* @__PURE__ */ new Map([
|
|
2855
2884
|
["viewEnter", "once"],
|
|
2856
2885
|
["pageVisible", "once"],
|
|
2857
2886
|
["animationEnd", "once"],
|
|
@@ -2860,10 +2889,10 @@ const ft = /* @__PURE__ */ new Map([
|
|
|
2860
2889
|
["activate", "alternate"],
|
|
2861
2890
|
["interest", "alternate"]
|
|
2862
2891
|
]);
|
|
2863
|
-
function
|
|
2864
|
-
const { effects: s = {}, conditions: i = {} } = n, { key: r, trigger: o } = e,
|
|
2865
|
-
t.effectId || (t.effectId =
|
|
2866
|
-
const { effectId:
|
|
2892
|
+
function ut(t, e, n) {
|
|
2893
|
+
const { effects: s = {}, conditions: i = {} } = n, { key: r, trigger: o } = e, a = o === "pointerMove";
|
|
2894
|
+
t.effectId || (t.effectId = k());
|
|
2895
|
+
const { effectId: c } = t, l = { ...s[c] || {}, ...t };
|
|
2867
2896
|
let { key: f, conditions: u, triggerType: d } = l;
|
|
2868
2897
|
if (!f) {
|
|
2869
2898
|
if (!r)
|
|
@@ -2874,46 +2903,46 @@ function lt(t, e, n) {
|
|
|
2874
2903
|
return null;
|
|
2875
2904
|
u = [
|
|
2876
2905
|
...new Set((u || []).filter((w) => i[w]))
|
|
2877
|
-
], d || (d =
|
|
2906
|
+
], d || (d = lt.get(o));
|
|
2878
2907
|
const { namedEffect: g, customEffect: p, keyframeEffect: m, transition: h, transitionProperties: v, ...y } = {
|
|
2879
2908
|
...l,
|
|
2880
2909
|
key: f,
|
|
2881
2910
|
conditions: u,
|
|
2882
|
-
effectId:
|
|
2911
|
+
effectId: c,
|
|
2883
2912
|
triggerType: d
|
|
2884
|
-
}, E =
|
|
2913
|
+
}, E = yt(e, y);
|
|
2885
2914
|
if (g)
|
|
2886
|
-
return
|
|
2915
|
+
return a || !g.type ? null : { namedEffect: g, initial: E, ...y };
|
|
2887
2916
|
if (m) {
|
|
2888
2917
|
if (!m.name) {
|
|
2889
|
-
const w =
|
|
2890
|
-
m.name = w ?
|
|
2918
|
+
const w = c && !(s[c] && "keyframeEffect" in t);
|
|
2919
|
+
m.name = w ? c : k();
|
|
2891
2920
|
}
|
|
2892
2921
|
return { keyframeEffect: m, initial: E, ...y };
|
|
2893
|
-
} else return p ?
|
|
2922
|
+
} else return p ? a ? null : { initial: E, ...y } : h ? { transition: h, initial: E, ...y } : v ? { transitionProperties: v, initial: E, ...y } : { initial: E, ...y };
|
|
2894
2923
|
}
|
|
2895
2924
|
function Ls(t, e, n) {
|
|
2896
2925
|
const { sequences: s = {}, conditions: i = {} } = n;
|
|
2897
|
-
t.sequenceId || (t.sequenceId =
|
|
2926
|
+
t.sequenceId || (t.sequenceId = k());
|
|
2898
2927
|
const { sequenceId: r } = t, o = { ...s[r] || {}, ...t };
|
|
2899
2928
|
let {
|
|
2900
|
-
effects:
|
|
2901
|
-
conditions:
|
|
2929
|
+
effects: a,
|
|
2930
|
+
conditions: c,
|
|
2902
2931
|
triggerType: l,
|
|
2903
2932
|
delay: f = 0,
|
|
2904
2933
|
offset: u = 0,
|
|
2905
2934
|
offsetEasing: d = "linear"
|
|
2906
2935
|
} = o;
|
|
2907
|
-
l || (l =
|
|
2908
|
-
...new Set((
|
|
2936
|
+
l || (l = lt.get(e.trigger)), c = [
|
|
2937
|
+
...new Set((c || []).filter((m) => i[m]))
|
|
2909
2938
|
];
|
|
2910
|
-
const g =
|
|
2939
|
+
const g = a.map((m) => (m.conditions ? m.conditions.push(...c) : m.conditions = [...c], ut({ ...m, triggerType: l }, e, n)));
|
|
2911
2940
|
typeof d != "function" && (d = be(d) || ((m) => m)), pn(g, f, u, d);
|
|
2912
2941
|
const p = g.filter((m) => m !== null);
|
|
2913
2942
|
return p.length ? {
|
|
2914
2943
|
sequenceId: r,
|
|
2915
2944
|
triggerType: l,
|
|
2916
|
-
conditions:
|
|
2945
|
+
conditions: c,
|
|
2917
2946
|
delay: f,
|
|
2918
2947
|
offset: u,
|
|
2919
2948
|
offsetEasing: d,
|
|
@@ -2937,9 +2966,9 @@ function Fs(t) {
|
|
|
2937
2966
|
if (r > 1)
|
|
2938
2967
|
return console.error("Offsets must be in the range [0,1]"), [];
|
|
2939
2968
|
const o = i - n;
|
|
2940
|
-
for (let
|
|
2941
|
-
const
|
|
2942
|
-
e[
|
|
2969
|
+
for (let a = n + 1; a < i; a++) {
|
|
2970
|
+
const c = (a - n) / o;
|
|
2971
|
+
e[a].offset = s + (r - s) * c;
|
|
2943
2972
|
}
|
|
2944
2973
|
n = i, s = r;
|
|
2945
2974
|
}
|
|
@@ -2966,33 +2995,33 @@ ${s}
|
|
|
2966
2995
|
}`;
|
|
2967
2996
|
}
|
|
2968
2997
|
function Hs(t) {
|
|
2969
|
-
const { key: e, childSelector: n, declarations: s, media: i, states: r, selectorCondition: o, addInitialSelector:
|
|
2998
|
+
const { key: e, childSelector: n, declarations: s, media: i, states: r, selectorCondition: o, addInitialSelector: a } = t;
|
|
2970
2999
|
if (!s.length)
|
|
2971
3000
|
return "";
|
|
2972
|
-
let
|
|
3001
|
+
let c = `[data-interact-key="${e}"]`;
|
|
2973
3002
|
if (r && r.length) {
|
|
2974
3003
|
const u = r.map((d) => `:state(${d}), :--${d}, [data-interact-effect~="${d}"]`).join(", ");
|
|
2975
|
-
|
|
3004
|
+
c = `${c}:is(${u})`;
|
|
2976
3005
|
}
|
|
2977
|
-
n && (
|
|
3006
|
+
n && (c = `${c} ${n}`), a && (c = `${c}:not([data-interact-enter])`), o && (c = te(c, o));
|
|
2978
3007
|
const l = s.map(({ name: u, value: d }) => `${u}: ${d};`).join(`
|
|
2979
|
-
`), f = `${
|
|
3008
|
+
`), f = `${c} {
|
|
2980
3009
|
${l}
|
|
2981
3010
|
}`;
|
|
2982
3011
|
return i ? `@media ${i} {
|
|
2983
3012
|
${f}
|
|
2984
3013
|
}` : f;
|
|
2985
3014
|
}
|
|
2986
|
-
function
|
|
2987
|
-
const { key: i, childSelector: r, properties: o } = t,
|
|
3015
|
+
function dt(t, e, n, s) {
|
|
3016
|
+
const { key: i, childSelector: r, properties: o } = t, a = Object.entries(o).filter(
|
|
2988
3017
|
(l) => l[1] && l[1].varNames.length
|
|
2989
3018
|
).map(([l, { fallback: f, varNames: u }]) => ({
|
|
2990
3019
|
name: l,
|
|
2991
3020
|
value: u.map((d) => `var(${d}, ${f})`).join(", ")
|
|
2992
|
-
})),
|
|
2993
|
-
return e &&
|
|
3021
|
+
})), c = { key: i, childSelector: r, declarations: a };
|
|
3022
|
+
return e && c.declarations.forEach((l) => {
|
|
2994
3023
|
l.name = e[l.name];
|
|
2995
|
-
}), n && (
|
|
3024
|
+
}), n && (c.media = ae(n, s || {}, "media"), c.selectorCondition = L(n, s || {})), c;
|
|
2996
3025
|
}
|
|
2997
3026
|
const js = [
|
|
2998
3027
|
{ name: "visibility", value: "hidden" },
|
|
@@ -3017,18 +3046,18 @@ const js = [
|
|
|
3017
3046
|
"animation-timeline": "auto",
|
|
3018
3047
|
"animation-range": "normal"
|
|
3019
3048
|
};
|
|
3020
|
-
function
|
|
3049
|
+
function ht(t, e, n) {
|
|
3021
3050
|
const s = t.get(e);
|
|
3022
3051
|
s ? n.forEach((i) => s.add(i)) : t.set(e, new Set(n));
|
|
3023
3052
|
}
|
|
3024
|
-
function
|
|
3025
|
-
const { key: i, childSelector: r } = n, o = s ? we.filter((
|
|
3053
|
+
function mt(t, e, n, s) {
|
|
3054
|
+
const { key: i, childSelector: r } = n, o = s ? we.filter((c) => s.has(c)) : we;
|
|
3026
3055
|
t.has(e) || t.set(e, { key: i, childSelector: r, properties: {} });
|
|
3027
|
-
const { properties:
|
|
3028
|
-
for (const
|
|
3029
|
-
c
|
|
3056
|
+
const { properties: a } = t.get(e);
|
|
3057
|
+
for (const c of o)
|
|
3058
|
+
a[c] || (a[c] = { fallback: ie[c], varNames: [] }), a[c].varNames.push(n[c]);
|
|
3030
3059
|
}
|
|
3031
|
-
function
|
|
3060
|
+
function pt(t, e) {
|
|
3032
3061
|
return we.reduce(
|
|
3033
3062
|
(n, s) => (n[s] = hn([s, ...t, e]), n),
|
|
3034
3063
|
{}
|
|
@@ -3038,14 +3067,14 @@ function Gs(t, e, n, s, i) {
|
|
|
3038
3067
|
return s.has(t) || s.set(t, {
|
|
3039
3068
|
key: e,
|
|
3040
3069
|
childSelector: i,
|
|
3041
|
-
...
|
|
3070
|
+
...pt([n], He(t))
|
|
3042
3071
|
}), s.get(t);
|
|
3043
3072
|
}
|
|
3044
3073
|
function Ws(t, e, n) {
|
|
3045
|
-
return
|
|
3074
|
+
return pt([e, n], He(t));
|
|
3046
3075
|
}
|
|
3047
3076
|
function Vs(t, e, n, s = !0) {
|
|
3048
|
-
const { key: i, conditions: r } = t, o =
|
|
3077
|
+
const { key: i, conditions: r } = t, o = ae(r, e, "media"), a = L(r, e), c = P(t, {
|
|
3049
3078
|
asCombinator: !0,
|
|
3050
3079
|
useFirstChild: s,
|
|
3051
3080
|
addItemFilter: !0
|
|
@@ -3053,8 +3082,8 @@ function Vs(t, e, n, s = !0) {
|
|
|
3053
3082
|
return {
|
|
3054
3083
|
key: i,
|
|
3055
3084
|
media: o,
|
|
3056
|
-
selectorCondition:
|
|
3057
|
-
childSelector:
|
|
3085
|
+
selectorCondition: a,
|
|
3086
|
+
childSelector: c,
|
|
3058
3087
|
// invalidating earlier cascaded custom properties affected from earlier transitionEffects
|
|
3059
3088
|
// to implement same-interaction-cascade
|
|
3060
3089
|
declarations: [
|
|
@@ -3069,13 +3098,13 @@ function Ys(t, e, n, s, i) {
|
|
|
3069
3098
|
const {
|
|
3070
3099
|
key: r,
|
|
3071
3100
|
effectId: o,
|
|
3072
|
-
conditions:
|
|
3073
|
-
namedEffect:
|
|
3101
|
+
conditions: a,
|
|
3102
|
+
namedEffect: c,
|
|
3074
3103
|
keyframeEffect: l,
|
|
3075
3104
|
transition: f,
|
|
3076
3105
|
transitionProperties: u,
|
|
3077
3106
|
initial: d
|
|
3078
|
-
} = t, g =
|
|
3107
|
+
} = t, g = ae(a, e, "media"), p = L(a, e), m = [
|
|
3079
3108
|
{
|
|
3080
3109
|
key: r,
|
|
3081
3110
|
media: g,
|
|
@@ -3087,9 +3116,9 @@ function Ys(t, e, n, s, i) {
|
|
|
3087
3116
|
let h = [];
|
|
3088
3117
|
const { declarations: v } = m[0];
|
|
3089
3118
|
let y = [];
|
|
3090
|
-
if (
|
|
3119
|
+
if (c || l) {
|
|
3091
3120
|
y = [...se];
|
|
3092
|
-
const E =
|
|
3121
|
+
const E = q(t), w = on(null, E, s).filter(
|
|
3093
3122
|
(T) => T.name
|
|
3094
3123
|
);
|
|
3095
3124
|
h = w.map((T) => ({
|
|
@@ -3097,14 +3126,14 @@ function Ys(t, e, n, s, i) {
|
|
|
3097
3126
|
keyframes: T.keyframes
|
|
3098
3127
|
})), v.push(
|
|
3099
3128
|
...w.flatMap(
|
|
3100
|
-
({ custom: T }) => Object.entries(T || {}).filter(([I,
|
|
3129
|
+
({ custom: T }) => Object.entries(T || {}).filter(([I, A]) => A !== void 0).map(([I, A]) => ({ name: I, value: A }))
|
|
3101
3130
|
)
|
|
3102
3131
|
);
|
|
3103
3132
|
const S = se.map((T) => ({
|
|
3104
3133
|
name: n[T],
|
|
3105
3134
|
value: w.map((I) => {
|
|
3106
|
-
const
|
|
3107
|
-
return I[
|
|
3135
|
+
const A = Ds[T];
|
|
3136
|
+
return I[A];
|
|
3108
3137
|
}).join(", ") || ie[T]
|
|
3109
3138
|
}));
|
|
3110
3139
|
d ? m.push({
|
|
@@ -3117,7 +3146,7 @@ function Ys(t, e, n, s, i) {
|
|
|
3117
3146
|
}) : v.push(...S);
|
|
3118
3147
|
} else if (f || u) {
|
|
3119
3148
|
y = ["transition"];
|
|
3120
|
-
const E = f?.styleProperties || u || [], w =
|
|
3149
|
+
const E = f?.styleProperties || u || [], w = Ue(t);
|
|
3121
3150
|
v.push({
|
|
3122
3151
|
name: n.transition,
|
|
3123
3152
|
value: w.join(", ") || ie.transition
|
|
@@ -3138,8 +3167,8 @@ function Ys(t, e, n, s, i) {
|
|
|
3138
3167
|
);
|
|
3139
3168
|
return { rules: m.filter((E) => E.declarations.length), keyframes: h, usedProperties: y };
|
|
3140
3169
|
}
|
|
3141
|
-
function
|
|
3142
|
-
const { key: l } = n, f =
|
|
3170
|
+
function gt(t, e, n, s, i, r, o = !0, a, c) {
|
|
3171
|
+
const { key: l } = n, f = c ?? G(n), u = P(n, {
|
|
3143
3172
|
asCombinator: !0,
|
|
3144
3173
|
useFirstChild: o,
|
|
3145
3174
|
addItemFilter: !0
|
|
@@ -3150,7 +3179,7 @@ function pt(t, e, n, s, i, r, o = !0, c, a) {
|
|
|
3150
3179
|
s,
|
|
3151
3180
|
u
|
|
3152
3181
|
) };
|
|
3153
|
-
|
|
3182
|
+
a && Object.assign(g, a);
|
|
3154
3183
|
const { rules: p, keyframes: m, usedProperties: h } = Ys(
|
|
3155
3184
|
n,
|
|
3156
3185
|
t,
|
|
@@ -3160,16 +3189,16 @@ function pt(t, e, n, s, i, r, o = !0, c, a) {
|
|
|
3160
3189
|
);
|
|
3161
3190
|
return m.forEach(({ name: v, keyframes: y }) => i.set(v, y)), { rules: p, usedProperties: h };
|
|
3162
3191
|
}
|
|
3163
|
-
function
|
|
3164
|
-
const
|
|
3192
|
+
function Bs(t, e, n, s, i, r, o = !0, a) {
|
|
3193
|
+
const c = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map(), f = [];
|
|
3165
3194
|
for (const d of n.effects) {
|
|
3166
|
-
const g = G(d), { key: p } = d, m =
|
|
3195
|
+
const g = G(d), { key: p } = d, m = P(d, {
|
|
3167
3196
|
asCombinator: !0,
|
|
3168
3197
|
useFirstChild: o,
|
|
3169
3198
|
addItemFilter: !0
|
|
3170
3199
|
}), h = l.get(g) || 0;
|
|
3171
3200
|
l.set(g, h + 1);
|
|
3172
|
-
const v = Ws(g, e, h), { rules: y, usedProperties: E } =
|
|
3201
|
+
const v = Ws(g, e, h), { rules: y, usedProperties: E } = gt(
|
|
3173
3202
|
t,
|
|
3174
3203
|
e,
|
|
3175
3204
|
d,
|
|
@@ -3182,28 +3211,28 @@ function Ks(t, e, n, s, i, r, o = !0, c) {
|
|
|
3182
3211
|
);
|
|
3183
3212
|
f.push(...y);
|
|
3184
3213
|
const w = new Set(E);
|
|
3185
|
-
|
|
3186
|
-
|
|
3214
|
+
mt(
|
|
3215
|
+
c,
|
|
3187
3216
|
g,
|
|
3188
3217
|
{ key: p, childSelector: m, ...v },
|
|
3189
3218
|
w
|
|
3190
|
-
),
|
|
3219
|
+
), a && ht(a, g, E);
|
|
3191
3220
|
}
|
|
3192
3221
|
const { conditions: u } = n;
|
|
3193
|
-
return
|
|
3222
|
+
return c.forEach((d, g) => {
|
|
3194
3223
|
const p = s.get(g);
|
|
3195
|
-
f.push(
|
|
3224
|
+
f.push(dt(d, p, u, t));
|
|
3196
3225
|
}), f;
|
|
3197
3226
|
}
|
|
3198
|
-
function
|
|
3199
|
-
const { effects: o = [], sequences:
|
|
3227
|
+
function Ks(t, e, n, s, i, r = !0) {
|
|
3228
|
+
const { effects: o = [], sequences: a = [] } = e, c = t.conditions || {}, l = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new Map(), u = o.map((h) => ut(h, e, t)).filter((h) => h !== null), d = [], { trigger: g } = e, p = {
|
|
3200
3229
|
trigger: mn(g),
|
|
3201
3230
|
id: ["trigger", n].join("-")
|
|
3202
3231
|
};
|
|
3203
|
-
g === "viewProgress" && d.push(Vs(e,
|
|
3232
|
+
g === "viewProgress" && d.push(Vs(e, c, p.id, r));
|
|
3204
3233
|
for (const h of u) {
|
|
3205
|
-
const v = G(h), { rules: y, usedProperties: E } =
|
|
3206
|
-
|
|
3234
|
+
const v = G(h), { rules: y, usedProperties: E } = gt(
|
|
3235
|
+
c,
|
|
3207
3236
|
n,
|
|
3208
3237
|
h,
|
|
3209
3238
|
l,
|
|
@@ -3211,13 +3240,13 @@ function Bs(t, e, n, s, i, r = !0) {
|
|
|
3211
3240
|
p,
|
|
3212
3241
|
r
|
|
3213
3242
|
);
|
|
3214
|
-
d.push(...y),
|
|
3243
|
+
d.push(...y), ht(f, v, E);
|
|
3215
3244
|
}
|
|
3216
|
-
const m =
|
|
3245
|
+
const m = a.map((h) => Ls(h, e, t)).filter((h) => h !== null);
|
|
3217
3246
|
return d.push(
|
|
3218
3247
|
...m.flatMap(
|
|
3219
|
-
(h) =>
|
|
3220
|
-
|
|
3248
|
+
(h) => Bs(
|
|
3249
|
+
c,
|
|
3221
3250
|
n,
|
|
3222
3251
|
h,
|
|
3223
3252
|
l,
|
|
@@ -3228,7 +3257,7 @@ function Bs(t, e, n, s, i, r = !0) {
|
|
|
3228
3257
|
)
|
|
3229
3258
|
)
|
|
3230
3259
|
), l.forEach((h, v) => {
|
|
3231
|
-
|
|
3260
|
+
mt(
|
|
3232
3261
|
s,
|
|
3233
3262
|
v,
|
|
3234
3263
|
h,
|
|
@@ -3238,10 +3267,10 @@ function Bs(t, e, n, s, i, r = !0) {
|
|
|
3238
3267
|
}
|
|
3239
3268
|
function Qs(t, e = !0) {
|
|
3240
3269
|
const n = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), i = t.interactions.flatMap(
|
|
3241
|
-
(r, o) =>
|
|
3270
|
+
(r, o) => Ks(t, r, o, n, s, e)
|
|
3242
3271
|
);
|
|
3243
3272
|
return n.forEach((r) => {
|
|
3244
|
-
i.push(
|
|
3273
|
+
i.push(dt(r));
|
|
3245
3274
|
}), { keyframes: s, cssRules: i };
|
|
3246
3275
|
}
|
|
3247
3276
|
function Zs(t, e = !0) {
|
|
@@ -3259,4 +3288,4 @@ export {
|
|
|
3259
3288
|
Zs as g,
|
|
3260
3289
|
Xs as r
|
|
3261
3290
|
};
|
|
3262
|
-
//# sourceMappingURL=index-
|
|
3291
|
+
//# sourceMappingURL=index-C6u4q815.mjs.map
|