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