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