@algorisys/tinyfly 0.65.0 → 0.66.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -6
- package/lib/browser/tinyfly.iife.js +21 -2
- package/lib/browser/tinyfly.js +1313 -1118
- package/lib/browser/tinyfly.umd.js +21 -2
- package/lib/embed/tinyfly-embed.iife.js +2 -2
- package/lib/embed/tinyfly-embed.js +19 -18
- package/lib/types/browser/index.d.ts +10 -0
- package/lib/types/embed/auto-mount.d.ts +7 -0
- package/package.json +1 -1
package/lib/browser/tinyfly.js
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
function
|
|
1
|
+
function Hi(i) {
|
|
2
2
|
return typeof i == "object" && i !== null && i.type === "cubic-bezier";
|
|
3
3
|
}
|
|
4
|
-
function
|
|
4
|
+
function Et(i) {
|
|
5
5
|
return typeof i == "object" && i !== null && i.type !== "cubic-bezier";
|
|
6
6
|
}
|
|
7
7
|
const _t = 1;
|
|
8
|
-
function
|
|
8
|
+
function fe(i) {
|
|
9
9
|
return i.property === "text" && "textConfig" in i;
|
|
10
10
|
}
|
|
11
|
-
function
|
|
11
|
+
function Z(i) {
|
|
12
12
|
return i.kind === "inertia" && "inertia" in i;
|
|
13
13
|
}
|
|
14
|
-
function
|
|
14
|
+
function Q(i) {
|
|
15
15
|
return i.kind === "spring" && "spring" in i;
|
|
16
16
|
}
|
|
17
|
-
function
|
|
17
|
+
function ai(i) {
|
|
18
18
|
return i.property === "motionPath" && "motionPathConfig" in i;
|
|
19
19
|
}
|
|
20
|
-
function
|
|
20
|
+
function ao(i) {
|
|
21
21
|
return typeof i == "object" && i !== null && "x" in i && "y" in i && "angle" in i;
|
|
22
22
|
}
|
|
23
|
-
function
|
|
23
|
+
function Gi(i) {
|
|
24
24
|
return "keyframes" in i;
|
|
25
25
|
}
|
|
26
|
-
class
|
|
26
|
+
class co {
|
|
27
27
|
_currentTime = 0;
|
|
28
28
|
_isRunning = !1;
|
|
29
29
|
onTick = null;
|
|
@@ -49,7 +49,7 @@ class Gr {
|
|
|
49
49
|
this._currentTime = t;
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
|
-
class
|
|
52
|
+
class lo {
|
|
53
53
|
_currentTime = 0;
|
|
54
54
|
_isRunning = !1;
|
|
55
55
|
_lastFrameTime = null;
|
|
@@ -96,7 +96,7 @@ class Zr {
|
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
|
-
function
|
|
99
|
+
function ci(i, t, e = "start") {
|
|
100
100
|
if (t <= 1) return 0;
|
|
101
101
|
if (typeof e == "number") {
|
|
102
102
|
const s = Math.max(0, Math.min(t - 1, e));
|
|
@@ -113,36 +113,36 @@ function ni(i, t, e = "start") {
|
|
|
113
113
|
return i;
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
|
-
function
|
|
116
|
+
function li(i, t = "start") {
|
|
117
117
|
if (i <= 1) return 0;
|
|
118
118
|
let e = 0;
|
|
119
119
|
for (let s = 0; s < i; s++)
|
|
120
|
-
e = Math.max(e,
|
|
120
|
+
e = Math.max(e, ci(s, i, t));
|
|
121
121
|
return e;
|
|
122
122
|
}
|
|
123
|
-
function
|
|
123
|
+
function de(i, t, e) {
|
|
124
124
|
if (e.offsets) return e.offsets[i] ?? 0;
|
|
125
|
-
const s = e.from ?? "start", n =
|
|
125
|
+
const s = e.from ?? "start", n = ci(i, t, s);
|
|
126
126
|
if (e.amount !== void 0) {
|
|
127
|
-
const r =
|
|
127
|
+
const r = li(t, s);
|
|
128
128
|
return r === 0 ? 0 : e.amount * n / r;
|
|
129
129
|
}
|
|
130
130
|
return e.each !== void 0 ? e.each * n : 0;
|
|
131
131
|
}
|
|
132
|
-
function
|
|
133
|
-
return Array.from({ length: i }, (e, s) =>
|
|
132
|
+
function ie(i, t) {
|
|
133
|
+
return Array.from({ length: i }, (e, s) => de(s, i, t));
|
|
134
134
|
}
|
|
135
|
-
function
|
|
136
|
-
return i <= 1 ? 0 : Math.max(...
|
|
135
|
+
function Dt(i, t) {
|
|
136
|
+
return i <= 1 ? 0 : Math.max(...ie(i, t));
|
|
137
137
|
}
|
|
138
|
-
const
|
|
138
|
+
const dt = 1, hi = 6e4, Tt = hi / dt, N = {
|
|
139
139
|
stiffness: 180,
|
|
140
140
|
damping: 12,
|
|
141
141
|
mass: 1,
|
|
142
142
|
velocity: 0,
|
|
143
143
|
restDelta: 0.01,
|
|
144
144
|
restSpeed: 0.1
|
|
145
|
-
},
|
|
145
|
+
}, Yt = {
|
|
146
146
|
gentle: { stiffness: 120, damping: 18, mass: 1 },
|
|
147
147
|
default: { stiffness: 180, damping: 12, mass: 1 },
|
|
148
148
|
snappy: { stiffness: 280, damping: 20, mass: 1 },
|
|
@@ -150,7 +150,7 @@ const ft = 1, oi = 6e4, Tt = oi / ft, O = {
|
|
|
150
150
|
wobbly: { stiffness: 180, damping: 5, mass: 1 },
|
|
151
151
|
stiff: { stiffness: 400, damping: 30, mass: 1 }
|
|
152
152
|
};
|
|
153
|
-
class
|
|
153
|
+
class Ot {
|
|
154
154
|
from;
|
|
155
155
|
to;
|
|
156
156
|
stiffness;
|
|
@@ -175,7 +175,7 @@ class Lt {
|
|
|
175
175
|
/** Once at rest we stop simulating; every later time returns `to`. */
|
|
176
176
|
settledStep = null;
|
|
177
177
|
constructor(t) {
|
|
178
|
-
this.from = t.from, this.to = t.to, this.stiffness = t.stiffness ??
|
|
178
|
+
this.from = t.from, this.to = t.to, this.stiffness = t.stiffness ?? N.stiffness, this.damping = t.damping ?? N.damping, this.mass = t.mass ?? N.mass, this.restDelta = t.restDelta ?? N.restDelta, this.restSpeed = t.restSpeed ?? N.restSpeed, this.distance = Math.abs(this.to - this.from) || 1, this.samples = [this.from], this.velocity = t.velocity ?? N.velocity, this.isAtRest(this.from) && (this.settledStep = 0);
|
|
179
179
|
}
|
|
180
180
|
/**
|
|
181
181
|
* Whether a position/velocity pair counts as settled.
|
|
@@ -193,10 +193,10 @@ class Lt {
|
|
|
193
193
|
*/
|
|
194
194
|
valueAt(t) {
|
|
195
195
|
if (t <= 0) return this.from;
|
|
196
|
-
const e = Math.floor(t /
|
|
196
|
+
const e = Math.floor(t / dt);
|
|
197
197
|
if (this.simulateTo(e + 1), this.settledStep !== null && e >= this.settledStep)
|
|
198
198
|
return this.to;
|
|
199
|
-
const s = this.samples[Math.min(e, this.samples.length - 1)], n = this.samples[Math.min(e + 1, this.samples.length - 1)], r = t /
|
|
199
|
+
const s = this.samples[Math.min(e, this.samples.length - 1)], n = this.samples[Math.min(e + 1, this.samples.length - 1)], r = t / dt - e;
|
|
200
200
|
return s + (n - s) * r;
|
|
201
201
|
}
|
|
202
202
|
/**
|
|
@@ -204,12 +204,12 @@ class Lt {
|
|
|
204
204
|
* of a spring track. Runs the simulation to completion once.
|
|
205
205
|
*/
|
|
206
206
|
settleTime() {
|
|
207
|
-
return this.simulateTo(Tt + 1), this.settledStep !== null ? this.settledStep *
|
|
207
|
+
return this.simulateTo(Tt + 1), this.settledStep !== null ? this.settledStep * dt : hi;
|
|
208
208
|
}
|
|
209
209
|
/** Advance the cached simulation until it holds at least `steps` samples. */
|
|
210
210
|
simulateTo(t) {
|
|
211
211
|
if (this.settledStep !== null) return;
|
|
212
|
-
const e = Math.min(t, Tt + 1), s =
|
|
212
|
+
const e = Math.min(t, Tt + 1), s = dt / 1e3;
|
|
213
213
|
for (; this.samples.length < e; ) {
|
|
214
214
|
const n = this.samples[this.samples.length - 1], r = n - this.to, o = -this.stiffness * r, a = -this.damping * this.velocity, c = (o + a) / this.mass;
|
|
215
215
|
this.velocity += c * s;
|
|
@@ -222,29 +222,29 @@ class Lt {
|
|
|
222
222
|
this.samples.length > Tt && (this.settledStep = Tt);
|
|
223
223
|
}
|
|
224
224
|
}
|
|
225
|
-
function
|
|
226
|
-
return new
|
|
225
|
+
function ho(i, t) {
|
|
226
|
+
return new Ot(i).valueAt(t);
|
|
227
227
|
}
|
|
228
|
-
function
|
|
229
|
-
return new
|
|
228
|
+
function Ki(i) {
|
|
229
|
+
return new Ot(i).settleTime();
|
|
230
230
|
}
|
|
231
|
-
function
|
|
232
|
-
const t = i.stiffness ??
|
|
231
|
+
function uo(i) {
|
|
232
|
+
const t = i.stiffness ?? N.stiffness, e = i.damping ?? N.damping, s = i.mass ?? N.mass;
|
|
233
233
|
return e < 2 * Math.sqrt(t * s);
|
|
234
234
|
}
|
|
235
|
-
function
|
|
236
|
-
const t = i.stiffness ??
|
|
235
|
+
function fo(i) {
|
|
236
|
+
const t = i.stiffness ?? N.stiffness, e = i.mass ?? N.mass;
|
|
237
237
|
return 2 * Math.sqrt(t * e);
|
|
238
238
|
}
|
|
239
|
-
const
|
|
240
|
-
function
|
|
241
|
-
const t = i.friction ??
|
|
242
|
-
return t > 0 ? t :
|
|
239
|
+
const we = 4, Zi = 2e-3, Qi = 1e-4, Ji = 6e4;
|
|
240
|
+
function Bt(i) {
|
|
241
|
+
const t = i.friction ?? we;
|
|
242
|
+
return t > 0 ? t : we;
|
|
243
243
|
}
|
|
244
|
-
function
|
|
245
|
-
return i.from + i.velocity /
|
|
244
|
+
function Ct(i) {
|
|
245
|
+
return i.from + i.velocity / Bt(i);
|
|
246
246
|
}
|
|
247
|
-
function
|
|
247
|
+
function ts(i, t) {
|
|
248
248
|
if (t === void 0) return i;
|
|
249
249
|
if (typeof t == "number")
|
|
250
250
|
return t > 0 ? Math.round(i / t) * t : i;
|
|
@@ -254,59 +254,59 @@ function Ki(i, t) {
|
|
|
254
254
|
Math.abs(s - i) < Math.abs(e - i) && (e = s);
|
|
255
255
|
return e;
|
|
256
256
|
}
|
|
257
|
-
function
|
|
258
|
-
let t =
|
|
257
|
+
function yt(i) {
|
|
258
|
+
let t = ts(Ct(i), i.end);
|
|
259
259
|
return i.min !== void 0 && (t = Math.max(i.min, t)), i.max !== void 0 && (t = Math.min(i.max, t)), t;
|
|
260
260
|
}
|
|
261
|
-
function
|
|
262
|
-
const t = Math.abs(
|
|
261
|
+
function bt(i) {
|
|
262
|
+
const t = Math.abs(yt(i) - i.from);
|
|
263
263
|
if (t === 0) return 0;
|
|
264
|
-
const e = i.restDelta ?? Math.max(
|
|
264
|
+
const e = i.restDelta ?? Math.max(Qi, t * Zi);
|
|
265
265
|
if (e >= t) return 0;
|
|
266
|
-
const s = Math.log(t / e) /
|
|
267
|
-
return Math.min(
|
|
266
|
+
const s = Math.log(t / e) / Bt(i);
|
|
267
|
+
return Math.min(Ji, s * 1e3);
|
|
268
268
|
}
|
|
269
|
-
function
|
|
269
|
+
function se(i, t) {
|
|
270
270
|
if (t <= 0) return i.from;
|
|
271
|
-
const e =
|
|
272
|
-
if (t >=
|
|
273
|
-
const s =
|
|
271
|
+
const e = yt(i);
|
|
272
|
+
if (t >= bt(i)) return e;
|
|
273
|
+
const s = Bt(i);
|
|
274
274
|
return i.from + (e - i.from) * (1 - Math.exp(-s * t / 1e3));
|
|
275
275
|
}
|
|
276
|
-
function
|
|
277
|
-
const e =
|
|
278
|
-
return t >=
|
|
279
|
-
}
|
|
280
|
-
const
|
|
281
|
-
linear:
|
|
282
|
-
"ease-in":
|
|
283
|
-
"ease-out":
|
|
284
|
-
"ease-in-out":
|
|
285
|
-
"ease-in-quad":
|
|
286
|
-
"ease-out-quad":
|
|
287
|
-
"ease-in-out-quad":
|
|
288
|
-
"ease-in-cubic":
|
|
289
|
-
"ease-out-cubic":
|
|
290
|
-
"ease-in-out-cubic":
|
|
276
|
+
function po(i, t) {
|
|
277
|
+
const e = Bt(i), s = yt(i);
|
|
278
|
+
return t >= bt(i) ? 0 : (s - i.from) * e * Math.exp(-e * Math.max(0, t) / 1e3);
|
|
279
|
+
}
|
|
280
|
+
const ne = (i) => i, es = (i) => i * i, is = (i) => 1 - (1 - i) * (1 - i), ss = (i) => i < 0.5 ? 2 * i * i : 1 - Math.pow(-2 * i + 2, 2) / 2, ui = (i) => i * i * i, fi = (i) => 1 - Math.pow(1 - i, 3), Nt = (i) => i < 0.5 ? 4 * i * i * i : 1 - Math.pow(-2 * i + 2, 3) / 2, ns = ui, rs = fi, os = Nt, as = {
|
|
281
|
+
linear: ne,
|
|
282
|
+
"ease-in": ns,
|
|
283
|
+
"ease-out": rs,
|
|
284
|
+
"ease-in-out": os,
|
|
285
|
+
"ease-in-quad": es,
|
|
286
|
+
"ease-out-quad": is,
|
|
287
|
+
"ease-in-out-quad": ss,
|
|
288
|
+
"ease-in-cubic": ui,
|
|
289
|
+
"ease-out-cubic": fi,
|
|
290
|
+
"ease-in-out-cubic": Nt
|
|
291
291
|
};
|
|
292
|
-
function
|
|
292
|
+
function cs(i) {
|
|
293
293
|
const [t, e, s, n] = i, r = 3 * t, o = 3 * (s - t) - r, a = 1 - r - o, c = 3 * e, l = 3 * (n - e) - c, h = 1 - c - l, f = (p) => ((a * p + o) * p + r) * p, u = (p) => ((h * p + l) * p + c) * p, d = (p) => (3 * a * p + 2 * o) * p + r, m = (p) => {
|
|
294
294
|
let g = p;
|
|
295
|
-
for (let
|
|
296
|
-
const
|
|
297
|
-
if (Math.abs(
|
|
295
|
+
for (let v = 0; v < 8; v++) {
|
|
296
|
+
const T = f(g) - p;
|
|
297
|
+
if (Math.abs(T) < 1e-7)
|
|
298
298
|
return g;
|
|
299
|
-
const
|
|
300
|
-
if (Math.abs(
|
|
299
|
+
const w = d(g);
|
|
300
|
+
if (Math.abs(w) < 1e-7)
|
|
301
301
|
break;
|
|
302
|
-
g -=
|
|
302
|
+
g -= T / w;
|
|
303
303
|
}
|
|
304
304
|
let y = 0, b = 1;
|
|
305
305
|
for (g = p; y < b; ) {
|
|
306
|
-
const
|
|
307
|
-
if (Math.abs(
|
|
306
|
+
const v = f(g);
|
|
307
|
+
if (Math.abs(v - p) < 1e-7)
|
|
308
308
|
return g;
|
|
309
|
-
p >
|
|
309
|
+
p > v ? y = g : b = g, g = (y + b) / 2;
|
|
310
310
|
}
|
|
311
311
|
return g;
|
|
312
312
|
};
|
|
@@ -317,16 +317,16 @@ function rs(i) {
|
|
|
317
317
|
return u(g);
|
|
318
318
|
};
|
|
319
319
|
}
|
|
320
|
-
function
|
|
320
|
+
function Vt(i, t = "out") {
|
|
321
321
|
if (t === "out") return i;
|
|
322
322
|
const e = (s) => 1 - i(1 - s);
|
|
323
323
|
return t === "in" ? e : (s) => s < 0.5 ? e(s * 2) / 2 : i(s * 2 - 1) / 2 + 0.5;
|
|
324
324
|
}
|
|
325
|
-
function
|
|
325
|
+
function ls(i = 1, t = 0.3) {
|
|
326
326
|
const e = Math.max(1, i), s = t / (2 * Math.PI) * Math.asin(1 / e);
|
|
327
327
|
return (n) => n <= 0 ? 0 : n >= 1 ? 1 : e * Math.pow(2, -10 * n) * Math.sin((n - s) * (2 * Math.PI) / t) + 1;
|
|
328
328
|
}
|
|
329
|
-
const
|
|
329
|
+
const hs = (i) => {
|
|
330
330
|
if (i <= 0) return 0;
|
|
331
331
|
if (i >= 1) return 1;
|
|
332
332
|
if (i < 1 / 2.75) return 7.5625 * i * i;
|
|
@@ -341,7 +341,7 @@ const as = (i) => {
|
|
|
341
341
|
const s = i - 2.625 / 2.75;
|
|
342
342
|
return 7.5625 * s * s + 0.984375;
|
|
343
343
|
};
|
|
344
|
-
function
|
|
344
|
+
function us(i = 1.70158) {
|
|
345
345
|
return (t) => {
|
|
346
346
|
if (t <= 0) return 0;
|
|
347
347
|
if (t >= 1) return 1;
|
|
@@ -349,7 +349,7 @@ function cs(i = 1.70158) {
|
|
|
349
349
|
return e * e * ((i + 1) * e + i) + 1;
|
|
350
350
|
};
|
|
351
351
|
}
|
|
352
|
-
function
|
|
352
|
+
function fs(i, t = "end") {
|
|
353
353
|
const e = Math.max(1, Math.floor(i));
|
|
354
354
|
return (s) => {
|
|
355
355
|
if (s >= 1) return 1;
|
|
@@ -367,22 +367,22 @@ function ls(i, t = "end") {
|
|
|
367
367
|
}
|
|
368
368
|
};
|
|
369
369
|
}
|
|
370
|
-
function
|
|
370
|
+
function ds(i) {
|
|
371
371
|
switch (i.type) {
|
|
372
372
|
case "steps":
|
|
373
|
-
return
|
|
373
|
+
return fs(i.count, i.position);
|
|
374
374
|
case "elastic":
|
|
375
|
-
return
|
|
375
|
+
return Vt(ls(i.amplitude, i.period), i.mode);
|
|
376
376
|
case "bounce":
|
|
377
|
-
return
|
|
377
|
+
return Vt(hs, i.mode);
|
|
378
378
|
case "back":
|
|
379
|
-
return
|
|
379
|
+
return Vt(us(i.overshoot), i.mode);
|
|
380
380
|
}
|
|
381
381
|
}
|
|
382
382
|
function W(i) {
|
|
383
|
-
return i === void 0 ?
|
|
383
|
+
return i === void 0 ? ne : Hi(i) ? cs(i.points) : Et(i) ? ds(i) : as[i] ?? ne;
|
|
384
384
|
}
|
|
385
|
-
const
|
|
385
|
+
const Te = 32, ps = 256, tt = /* @__PURE__ */ new Map(), ms = /[MmLlHhVvCcSsQqTtAaZz]/, gs = /^[-+]?(?:\d+\.?\d*|\.\d+)(?:[eE][-+]?\d+)?/, ys = {
|
|
386
386
|
M: 2,
|
|
387
387
|
L: 2,
|
|
388
388
|
H: 1,
|
|
@@ -394,7 +394,7 @@ const be = 32, us = 256, Q = /* @__PURE__ */ new Map(), fs = /[MmLlHhVvCcSsQqTtA
|
|
|
394
394
|
A: 7,
|
|
395
395
|
Z: 0
|
|
396
396
|
};
|
|
397
|
-
function
|
|
397
|
+
function bs(i) {
|
|
398
398
|
const t = [];
|
|
399
399
|
let e = 0, s = null;
|
|
400
400
|
const n = () => {
|
|
@@ -402,7 +402,7 @@ function ms(i) {
|
|
|
402
402
|
};
|
|
403
403
|
for (; e < i.length && (n(), !(e >= i.length)); ) {
|
|
404
404
|
const r = i[e];
|
|
405
|
-
if (
|
|
405
|
+
if (ms.test(r)) {
|
|
406
406
|
s = { type: r, args: [] }, t.push(s), e++;
|
|
407
407
|
continue;
|
|
408
408
|
}
|
|
@@ -413,49 +413,49 @@ function ms(i) {
|
|
|
413
413
|
s.args.push(r === "1" ? 1 : 0), e++;
|
|
414
414
|
continue;
|
|
415
415
|
}
|
|
416
|
-
const c =
|
|
416
|
+
const c = gs.exec(i.slice(e));
|
|
417
417
|
if (!c) break;
|
|
418
418
|
s.args.push(parseFloat(c[0])), e += c[0].length;
|
|
419
419
|
}
|
|
420
420
|
return t;
|
|
421
421
|
}
|
|
422
|
-
function
|
|
422
|
+
function vs(i, t, e, s, n, r, o, a, c) {
|
|
423
423
|
if (i === a && t === c) return [];
|
|
424
424
|
let l = Math.abs(e), h = Math.abs(s);
|
|
425
425
|
if (l === 0 || h === 0) return [[i, t, a, c, a, c]];
|
|
426
426
|
const f = n * Math.PI / 180, u = Math.cos(f), d = Math.sin(f), m = (i - a) / 2, p = (t - c) / 2, g = u * m + d * p, y = -d * m + u * p, b = g * g / (l * l) + y * y / (h * h);
|
|
427
427
|
if (b > 1) {
|
|
428
|
-
const
|
|
429
|
-
l *=
|
|
430
|
-
}
|
|
431
|
-
const
|
|
432
|
-
const
|
|
433
|
-
return
|
|
434
|
-
},
|
|
435
|
-
let
|
|
436
|
-
!o &&
|
|
437
|
-
const
|
|
438
|
-
const
|
|
439
|
-
return [u *
|
|
440
|
-
},
|
|
441
|
-
const
|
|
442
|
-
return [u *
|
|
443
|
-
},
|
|
444
|
-
for (let
|
|
445
|
-
const
|
|
446
|
-
|
|
447
|
-
}
|
|
448
|
-
return
|
|
449
|
-
}
|
|
450
|
-
function
|
|
428
|
+
const I = Math.sqrt(b);
|
|
429
|
+
l *= I, h *= I;
|
|
430
|
+
}
|
|
431
|
+
const v = r === o ? -1 : 1, T = l * l * h * h - l * l * y * y - h * h * g * g, w = l * l * y * y + h * h * g * g, x = v * Math.sqrt(Math.max(0, T / w)), S = x * l * y / h, _ = -x * h * g / l, L = u * S - d * _ + (i + a) / 2, A = d * S + u * _ + (t + c) / 2, M = (I, D, O, J) => {
|
|
432
|
+
const Xt = I * O + D * J, wt = Math.sqrt((I * I + D * D) * (O * O + J * J)), at = Math.acos(Math.max(-1, Math.min(1, Xt / wt)));
|
|
433
|
+
return I * J - D * O < 0 ? -at : at;
|
|
434
|
+
}, E = M(1, 0, (g - S) / l, (y - _) / h);
|
|
435
|
+
let k = M((g - S) / l, (y - _) / h, (-g - S) / l, (-y - _) / h);
|
|
436
|
+
!o && k > 0 && (k -= 2 * Math.PI), o && k < 0 && (k += 2 * Math.PI);
|
|
437
|
+
const P = Math.max(1, Math.ceil(Math.abs(k) / (Math.PI / 2))), C = k / P, $ = 4 / 3 * Math.tan(C / 4), R = (I) => {
|
|
438
|
+
const D = l * Math.cos(I), O = h * Math.sin(I);
|
|
439
|
+
return [u * D - d * O + L, d * D + u * O + A];
|
|
440
|
+
}, j = (I) => {
|
|
441
|
+
const D = -l * Math.sin(I), O = h * Math.cos(I);
|
|
442
|
+
return [u * D - d * O, d * D + u * O];
|
|
443
|
+
}, H = [];
|
|
444
|
+
for (let I = 0; I < P; I++) {
|
|
445
|
+
const D = E + I * C, O = D + C, [J, Xt] = R(D), [wt, at] = I === P - 1 ? [a, c] : R(O), [Wi, ji] = j(D), [Ui, zi] = j(O);
|
|
446
|
+
H.push([J + $ * Wi, Xt + $ * ji, wt - $ * Ui, at - $ * zi, wt, at]);
|
|
447
|
+
}
|
|
448
|
+
return H;
|
|
449
|
+
}
|
|
450
|
+
function z(i, t, e, s, n) {
|
|
451
451
|
const r = 1 - n;
|
|
452
452
|
return r * r * r * i + 3 * r * r * n * t + 3 * r * n * n * e + n * n * n * s;
|
|
453
453
|
}
|
|
454
|
-
function
|
|
454
|
+
function xe(i, t, e, s, n) {
|
|
455
455
|
const r = 1 - n;
|
|
456
456
|
return 3 * r * r * (t - i) + 6 * r * n * (e - t) + 3 * n * n * (s - e);
|
|
457
457
|
}
|
|
458
|
-
function
|
|
458
|
+
function ct(i, t, e, s) {
|
|
459
459
|
return {
|
|
460
460
|
subpath: 0,
|
|
461
461
|
type: "L",
|
|
@@ -467,11 +467,11 @@ function at(i, t, e, s) {
|
|
|
467
467
|
length: Math.hypot(e - i, s - t)
|
|
468
468
|
};
|
|
469
469
|
}
|
|
470
|
-
function
|
|
470
|
+
function xt(i, t, e) {
|
|
471
471
|
const [s, n, r, o, a, c] = e, l = [0];
|
|
472
472
|
let h = i, f = t, u = 0;
|
|
473
|
-
for (let d = 1; d <=
|
|
474
|
-
const m = d /
|
|
473
|
+
for (let d = 1; d <= Te; d++) {
|
|
474
|
+
const m = d / Te, p = z(i, s, r, a, m), g = z(t, n, o, c, m);
|
|
475
475
|
u += Math.hypot(p - h, g - f), l.push(u), h = p, f = g;
|
|
476
476
|
}
|
|
477
477
|
return {
|
|
@@ -486,73 +486,73 @@ function kt(i, t, e) {
|
|
|
486
486
|
lengths: l
|
|
487
487
|
};
|
|
488
488
|
}
|
|
489
|
-
function
|
|
490
|
-
const t =
|
|
489
|
+
function nt(i) {
|
|
490
|
+
const t = tt.get(i);
|
|
491
491
|
if (t) return t;
|
|
492
492
|
const e = [];
|
|
493
493
|
let s = 0, n = 0, r = 0, o = 0, a = null, c = null, l = -1;
|
|
494
494
|
const h = /* @__PURE__ */ new Set(), f = (p) => {
|
|
495
495
|
l < 0 && (l = 0), p.subpath = l, e.push(p);
|
|
496
496
|
};
|
|
497
|
-
for (const { type: p, args: g } of
|
|
498
|
-
const y = p.toUpperCase(), b = p !== y,
|
|
497
|
+
for (const { type: p, args: g } of bs(i)) {
|
|
498
|
+
const y = p.toUpperCase(), b = p !== y, v = ys[y];
|
|
499
499
|
if (y === "Z") {
|
|
500
|
-
(s !== r || n !== o) && f(
|
|
500
|
+
(s !== r || n !== o) && f(ct(s, n, r, o)), l >= 0 && h.add(l), s = r, n = o, a = c = null;
|
|
501
501
|
continue;
|
|
502
502
|
}
|
|
503
|
-
for (let
|
|
504
|
-
const
|
|
505
|
-
let _ = null,
|
|
503
|
+
for (let T = 0; T + v <= g.length; T += v) {
|
|
504
|
+
const w = g.slice(T, T + v), x = b ? s : 0, S = b ? n : 0;
|
|
505
|
+
let _ = null, L = null;
|
|
506
506
|
switch (y) {
|
|
507
507
|
case "M":
|
|
508
|
-
|
|
508
|
+
T === 0 ? (s = w[0] + x, n = w[1] + S, r = s, o = n, (l < 0 || e[e.length - 1]?.subpath === l) && l++) : (f(ct(s, n, w[0] + x, w[1] + S)), s = w[0] + x, n = w[1] + S);
|
|
509
509
|
break;
|
|
510
510
|
case "L":
|
|
511
|
-
f(
|
|
511
|
+
f(ct(s, n, w[0] + x, w[1] + S)), s = w[0] + x, n = w[1] + S;
|
|
512
512
|
break;
|
|
513
513
|
case "H":
|
|
514
|
-
f(
|
|
514
|
+
f(ct(s, n, w[0] + x, n)), s = w[0] + x;
|
|
515
515
|
break;
|
|
516
516
|
case "V":
|
|
517
|
-
f(
|
|
517
|
+
f(ct(s, n, s, w[0] + S)), n = w[0] + S;
|
|
518
518
|
break;
|
|
519
519
|
case "C": {
|
|
520
|
-
const
|
|
521
|
-
f(
|
|
520
|
+
const A = [w[0] + x, w[1] + S, w[2] + x, w[3] + S, w[4] + x, w[5] + S];
|
|
521
|
+
f(xt(s, n, A)), _ = [A[2], A[3]], s = A[4], n = A[5];
|
|
522
522
|
break;
|
|
523
523
|
}
|
|
524
524
|
case "S": {
|
|
525
|
-
const [
|
|
526
|
-
f(
|
|
525
|
+
const [A, M] = a ? [2 * s - a[0], 2 * n - a[1]] : [s, n], E = [A, M, w[0] + x, w[1] + S, w[2] + x, w[3] + S];
|
|
526
|
+
f(xt(s, n, E)), _ = [E[2], E[3]], s = E[4], n = E[5];
|
|
527
527
|
break;
|
|
528
528
|
}
|
|
529
529
|
case "Q":
|
|
530
530
|
case "T": {
|
|
531
|
-
let
|
|
532
|
-
y === "Q" ? (
|
|
533
|
-
const
|
|
531
|
+
let A = s, M = n;
|
|
532
|
+
y === "Q" ? (A = w[0] + x, M = w[1] + S) : c && (A = 2 * s - c[0], M = 2 * n - c[1]);
|
|
533
|
+
const E = y === "Q" ? w[2] + x : w[0] + x, k = y === "Q" ? w[3] + S : w[1] + S;
|
|
534
534
|
f(
|
|
535
|
-
|
|
536
|
-
s + 2 / 3 * (
|
|
537
|
-
n + 2 / 3 * (
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
535
|
+
xt(s, n, [
|
|
536
|
+
s + 2 / 3 * (A - s),
|
|
537
|
+
n + 2 / 3 * (M - n),
|
|
538
|
+
E + 2 / 3 * (A - E),
|
|
539
|
+
k + 2 / 3 * (M - k),
|
|
540
|
+
E,
|
|
541
|
+
k
|
|
542
542
|
])
|
|
543
|
-
),
|
|
543
|
+
), L = [A, M], s = E, n = k;
|
|
544
544
|
break;
|
|
545
545
|
}
|
|
546
546
|
case "A": {
|
|
547
|
-
const
|
|
548
|
-
let
|
|
549
|
-
for (const
|
|
550
|
-
f(
|
|
551
|
-
s =
|
|
547
|
+
const A = w[5] + x, M = w[6] + S;
|
|
548
|
+
let E = s, k = n;
|
|
549
|
+
for (const P of vs(s, n, w[0], w[1], w[2], w[3], w[4], A, M))
|
|
550
|
+
f(xt(E, k, P)), E = P[4], k = P[5];
|
|
551
|
+
s = A, n = M;
|
|
552
552
|
break;
|
|
553
553
|
}
|
|
554
554
|
}
|
|
555
|
-
a = _, c =
|
|
555
|
+
a = _, c = L;
|
|
556
556
|
}
|
|
557
557
|
}
|
|
558
558
|
const u = e.reduce((p, g) => p + g.length, 0), d = [];
|
|
@@ -560,13 +560,13 @@ function it(i) {
|
|
|
560
560
|
const g = e[p].subpath;
|
|
561
561
|
let y = p, b = 0;
|
|
562
562
|
for (; y < e.length && e[y].subpath === g; ) b += e[y++].length;
|
|
563
|
-
const
|
|
564
|
-
d.push({ start: p, end: y, length: b, closed:
|
|
563
|
+
const v = e[p], T = e[y - 1], w = h.has(g) || Math.abs(T.endX - v.startX) < 1e-9 && Math.abs(T.endY - v.startY) < 1e-9;
|
|
564
|
+
d.push({ start: p, end: y, length: b, closed: w }), p = y;
|
|
565
565
|
}
|
|
566
566
|
const m = { segments: e, totalLength: u, subpaths: d };
|
|
567
|
-
return
|
|
567
|
+
return tt.size >= ps && tt.delete(tt.keys().next().value), tt.set(i, m), m;
|
|
568
568
|
}
|
|
569
|
-
function
|
|
569
|
+
function ws(i, t) {
|
|
570
570
|
const e = i.lengths;
|
|
571
571
|
if (t <= 0) return 0;
|
|
572
572
|
if (t >= i.length) return 1;
|
|
@@ -578,7 +578,7 @@ function ys(i, t) {
|
|
|
578
578
|
const r = e[n] - e[s], o = r > 0 ? (t - e[s]) / r : 0;
|
|
579
579
|
return (s + o) / (e.length - 1);
|
|
580
580
|
}
|
|
581
|
-
function
|
|
581
|
+
function Ts(i, t) {
|
|
582
582
|
if (i.type === "L") {
|
|
583
583
|
const f = i.length > 0 ? Math.max(0, Math.min(1, t / i.length)) : 0;
|
|
584
584
|
return {
|
|
@@ -587,44 +587,44 @@ function bs(i, t) {
|
|
|
587
587
|
angle: Math.atan2(i.endY - i.startY, i.endX - i.startX) * 180 / Math.PI
|
|
588
588
|
};
|
|
589
589
|
}
|
|
590
|
-
const [e, s, n, r, o, a] = i.points, c =
|
|
591
|
-
let l =
|
|
590
|
+
const [e, s, n, r, o, a] = i.points, c = ws(i, t);
|
|
591
|
+
let l = xe(i.startX, e, n, o, c), h = xe(i.startY, s, r, a, c);
|
|
592
592
|
if (Math.hypot(l, h) < 1e-9) {
|
|
593
|
-
const f = c < 0.5 ? Math.min(1, c + 1e-3) : Math.max(0, c - 1e-3), u =
|
|
593
|
+
const f = c < 0.5 ? Math.min(1, c + 1e-3) : Math.max(0, c - 1e-3), u = z(i.startX, e, n, o, f), d = z(i.startY, s, r, a, f), m = z(i.startX, e, n, o, c), p = z(i.startY, s, r, a, c);
|
|
594
594
|
l = c < 0.5 ? u - m : m - u, h = c < 0.5 ? d - p : p - d;
|
|
595
595
|
}
|
|
596
596
|
return {
|
|
597
|
-
x:
|
|
598
|
-
y:
|
|
597
|
+
x: z(i.startX, e, n, o, c),
|
|
598
|
+
y: z(i.startY, s, r, a, c),
|
|
599
599
|
angle: Math.atan2(h, l) * 180 / Math.PI
|
|
600
600
|
};
|
|
601
601
|
}
|
|
602
|
-
function
|
|
602
|
+
function di(i, t, e = 0, s = i.length) {
|
|
603
603
|
if (s <= e) return { x: 0, y: 0, angle: 0 };
|
|
604
604
|
let n = 0;
|
|
605
605
|
for (let r = e; r < s; r++) {
|
|
606
606
|
const o = i[r];
|
|
607
607
|
if (n + o.length >= t || r === s - 1)
|
|
608
|
-
return
|
|
608
|
+
return Ts(o, t - n);
|
|
609
609
|
n += o.length;
|
|
610
610
|
}
|
|
611
611
|
return { x: 0, y: 0, angle: 0 };
|
|
612
612
|
}
|
|
613
|
-
function
|
|
614
|
-
const { segments: e, totalLength: s } =
|
|
615
|
-
return
|
|
613
|
+
function xs(i, t) {
|
|
614
|
+
const { segments: e, totalLength: s } = nt(i);
|
|
615
|
+
return di(e, Math.max(0, Math.min(1, t)) * s);
|
|
616
616
|
}
|
|
617
|
-
function
|
|
618
|
-
|
|
617
|
+
function mo() {
|
|
618
|
+
tt.clear();
|
|
619
619
|
}
|
|
620
|
-
function
|
|
621
|
-
return
|
|
620
|
+
function go(i) {
|
|
621
|
+
return nt(i).totalLength;
|
|
622
622
|
}
|
|
623
|
-
const
|
|
624
|
-
let
|
|
625
|
-
const
|
|
626
|
-
function
|
|
627
|
-
const { segments: e, subpaths: s, totalLength: n } =
|
|
623
|
+
const ks = 24, Ss = 320, Ms = 2.5, lt = 72, yo = 64, As = 0.2, Ps = 128, pt = /* @__PURE__ */ new Map();
|
|
624
|
+
let At = 0, U;
|
|
625
|
+
const ke = (i) => Math.round(i * 100) / 100;
|
|
626
|
+
function Se(i, t) {
|
|
627
|
+
const { segments: e, subpaths: s, totalLength: n } = nt(i);
|
|
628
628
|
if (e.length === 0) return [];
|
|
629
629
|
if (t) {
|
|
630
630
|
const r = s.every((o) => o.closed);
|
|
@@ -632,34 +632,34 @@ function Te(i, t) {
|
|
|
632
632
|
}
|
|
633
633
|
return s.filter((r) => r.length > 0).map((r) => ({ segments: e, start: r.start, end: r.end, length: r.length, closed: r.closed }));
|
|
634
634
|
}
|
|
635
|
-
function
|
|
636
|
-
const e = i.closed ? (t % 1 + 1) % 1 : Math.max(0, Math.min(1, t)), s =
|
|
635
|
+
function re(i, t) {
|
|
636
|
+
const e = i.closed ? (t % 1 + 1) % 1 : Math.max(0, Math.min(1, t)), s = di(i.segments, e * i.length, i.start, i.end);
|
|
637
637
|
return [s.x, s.y];
|
|
638
638
|
}
|
|
639
|
-
function
|
|
639
|
+
function Me(i) {
|
|
640
640
|
const t = [];
|
|
641
641
|
let e = 0;
|
|
642
642
|
for (let s = i.start; s < i.end; s++)
|
|
643
643
|
e += i.segments[s].length, i.length > 0 && t.push(e / i.length);
|
|
644
644
|
return t;
|
|
645
645
|
}
|
|
646
|
-
function
|
|
646
|
+
function Ae(i, t) {
|
|
647
647
|
const e = [];
|
|
648
648
|
for (let s = 0; s < t; s++)
|
|
649
|
-
e.push(
|
|
649
|
+
e.push(re(i, i.closed ? s / t : s / (t - 1)));
|
|
650
650
|
return e;
|
|
651
651
|
}
|
|
652
|
-
function
|
|
652
|
+
function Pe(i) {
|
|
653
653
|
let t = 0, e = 0;
|
|
654
654
|
for (const [s, n] of i)
|
|
655
655
|
t += s, e += n;
|
|
656
656
|
return t /= i.length, e /= i.length, i.map(([s, n]) => [s - t, n - e]);
|
|
657
657
|
}
|
|
658
|
-
function
|
|
658
|
+
function Es(i, t, e) {
|
|
659
659
|
const s = i.closed && t.closed;
|
|
660
660
|
if (e !== void 0)
|
|
661
|
-
return { offset: s ? Math.abs(e) %
|
|
662
|
-
const n =
|
|
661
|
+
return { offset: s ? Math.abs(e) % lt / lt : 0, reversed: e < 0 };
|
|
662
|
+
const n = Pe(Ae(i, lt)), r = Pe(Ae(t, lt)), o = lt;
|
|
663
663
|
let a = { offset: 0, reversed: !1 }, c = 1 / 0;
|
|
664
664
|
for (const l of [!1, !0]) {
|
|
665
665
|
const h = s ? o : 1;
|
|
@@ -674,28 +674,28 @@ function Ms(i, t, e) {
|
|
|
674
674
|
}
|
|
675
675
|
return a;
|
|
676
676
|
}
|
|
677
|
-
function
|
|
677
|
+
function _s(i, t, e) {
|
|
678
678
|
return e ? ((t.reversed ? t.offset - i : i + t.offset) % 1 + 1) % 1 : t.reversed ? 1 - i : i;
|
|
679
679
|
}
|
|
680
|
-
function
|
|
680
|
+
function Cs(i, t, e) {
|
|
681
681
|
return e ? ((t.reversed ? t.offset - i : i - t.offset) % 1 + 1) % 1 : t.reversed ? 1 - i : i;
|
|
682
682
|
}
|
|
683
|
-
function
|
|
684
|
-
const s = i.closed && t.closed, n =
|
|
685
|
-
|
|
686
|
-
Math.min(
|
|
683
|
+
function Rs(i, t, e) {
|
|
684
|
+
const s = i.closed && t.closed, n = Es(i, t, e.shapeIndex), r = Math.max(
|
|
685
|
+
ks,
|
|
686
|
+
Math.min(Ss, Math.ceil(Math.max(i.length, t.length) / Ms))
|
|
687
687
|
), o = /* @__PURE__ */ new Set(), a = (f) => o.add(Math.round(f * 1e7) / 1e7);
|
|
688
688
|
for (let f = 0; f <= r; f++) a(f / r);
|
|
689
|
-
for (const f of
|
|
690
|
-
for (const f of
|
|
689
|
+
for (const f of Me(i)) a(f);
|
|
690
|
+
for (const f of Me(t)) a(Cs(f, n, s));
|
|
691
691
|
let c = [...o].sort((f, u) => f - u);
|
|
692
692
|
s && (c = c.filter((f) => f < 1));
|
|
693
693
|
const l = [], h = [];
|
|
694
694
|
for (const f of c)
|
|
695
|
-
l.push(...
|
|
696
|
-
return
|
|
695
|
+
l.push(...re(i, f)), h.push(...re(t, _s(f, n, s)));
|
|
696
|
+
return Is({ from: l, to: h, closed: s });
|
|
697
697
|
}
|
|
698
|
-
function
|
|
698
|
+
function Is(i) {
|
|
699
699
|
const t = i.from.length / 2;
|
|
700
700
|
if (t <= 3) return i;
|
|
701
701
|
const e = new Uint8Array(t);
|
|
@@ -703,9 +703,9 @@ function Es(i) {
|
|
|
703
703
|
const s = [[0, t - 1]];
|
|
704
704
|
for (; s.length > 0; ) {
|
|
705
705
|
const [o, a] = s.pop();
|
|
706
|
-
let c = -1, l =
|
|
706
|
+
let c = -1, l = As;
|
|
707
707
|
for (let h = o + 1; h < a; h++) {
|
|
708
|
-
const f = Math.max(
|
|
708
|
+
const f = Math.max(Ee(i.from, o, a, h), Ee(i.to, o, a, h));
|
|
709
709
|
f > l && (l = f, c = h);
|
|
710
710
|
}
|
|
711
711
|
c !== -1 && (e[c] = 1, s.push([o, c], [c, a]));
|
|
@@ -715,118 +715,118 @@ function Es(i) {
|
|
|
715
715
|
e[o] && (n.push(i.from[o * 2], i.from[o * 2 + 1]), r.push(i.to[o * 2], i.to[o * 2 + 1]));
|
|
716
716
|
return { from: n, to: r, closed: i.closed };
|
|
717
717
|
}
|
|
718
|
-
function
|
|
718
|
+
function Ee(i, t, e, s) {
|
|
719
719
|
const n = i[t * 2], r = i[t * 2 + 1], o = i[e * 2] - n, a = i[e * 2 + 1] - r, c = i[s * 2] - n, l = i[s * 2 + 1] - r, h = o * o + a * a, f = h === 0 ? 0 : Math.max(0, Math.min(1, (c * o + l * a) / h));
|
|
720
720
|
return Math.hypot(c - f * o, l - f * a);
|
|
721
721
|
}
|
|
722
|
-
function
|
|
722
|
+
function $s(i, t, e) {
|
|
723
723
|
const s = e.shapeIndex;
|
|
724
|
-
if (
|
|
725
|
-
const r =
|
|
724
|
+
if (U && U.from === i && U.to === t && U.shapeIndex === s) return U.plan;
|
|
725
|
+
const r = pt.get(String(s ?? "auto"))?.get(i)?.get(t);
|
|
726
726
|
if (r)
|
|
727
|
-
return
|
|
728
|
-
const o =
|
|
729
|
-
pairs: a.map((d, m) =>
|
|
727
|
+
return U = { from: i, to: t, shapeIndex: s, plan: r }, r;
|
|
728
|
+
const o = nt(i).subpaths.filter((d) => d.length > 0).length === nt(t).subpaths.filter((d) => d.length > 0).length, a = Se(i, !o), c = Se(t, !o), l = {
|
|
729
|
+
pairs: a.map((d, m) => Rs(d, c[m], e))
|
|
730
730
|
};
|
|
731
|
-
|
|
732
|
-
const h = String(s ?? "auto"), f =
|
|
733
|
-
|
|
731
|
+
At >= Ps && (pt.clear(), At = 0);
|
|
732
|
+
const h = String(s ?? "auto"), f = pt.get(h) ?? /* @__PURE__ */ new Map();
|
|
733
|
+
pt.set(h, f);
|
|
734
734
|
const u = f.get(i) ?? /* @__PURE__ */ new Map();
|
|
735
|
-
return f.set(i, u), u.set(t, l),
|
|
735
|
+
return f.set(i, u), u.set(t, l), At++, U = { from: i, to: t, shapeIndex: s, plan: l }, l;
|
|
736
736
|
}
|
|
737
|
-
function
|
|
737
|
+
function Fs(i, t, e, s = {}) {
|
|
738
738
|
if (!i) return t;
|
|
739
739
|
if (!t) return i;
|
|
740
740
|
const n = Math.max(0, Math.min(1, e));
|
|
741
741
|
if (n === 0) return i;
|
|
742
742
|
if (n === 1) return t;
|
|
743
|
-
const r =
|
|
743
|
+
const r = $s(i, t, s);
|
|
744
744
|
if (r.pairs.length === 0) return n < 0.5 ? i : t;
|
|
745
745
|
let o = "";
|
|
746
746
|
for (const a of r.pairs) {
|
|
747
747
|
for (let c = 0; c < a.from.length; c += 2) {
|
|
748
|
-
const l =
|
|
748
|
+
const l = ke(a.from[c] + (a.to[c] - a.from[c]) * n), h = ke(a.from[c + 1] + (a.to[c + 1] - a.from[c + 1]) * n);
|
|
749
749
|
o += `${c === 0 ? o ? " M" : "M" : " L"}${l} ${h}`;
|
|
750
750
|
}
|
|
751
751
|
a.closed && (o += " Z");
|
|
752
752
|
}
|
|
753
753
|
return o;
|
|
754
754
|
}
|
|
755
|
-
function
|
|
756
|
-
|
|
755
|
+
function bo() {
|
|
756
|
+
pt.clear(), At = 0, U = void 0;
|
|
757
757
|
}
|
|
758
|
-
function
|
|
758
|
+
function vt(i) {
|
|
759
759
|
return /^\s*[Mm]\s*[-+]?(?:\d|\.\d)/.test(i);
|
|
760
760
|
}
|
|
761
|
-
const
|
|
762
|
-
function
|
|
763
|
-
const t =
|
|
761
|
+
const Y = (i, t, e) => i + (t - i) * e, pi = 512, Wt = /* @__PURE__ */ new Map(), jt = /* @__PURE__ */ new Map();
|
|
762
|
+
function _e(i) {
|
|
763
|
+
const t = Wt.get(i);
|
|
764
764
|
if (t) return t;
|
|
765
765
|
const e = i.replace("#", ""), s = [
|
|
766
766
|
parseInt(e.slice(0, 2), 16),
|
|
767
767
|
parseInt(e.slice(2, 4), 16),
|
|
768
768
|
parseInt(e.slice(4, 6), 16)
|
|
769
769
|
];
|
|
770
|
-
return
|
|
770
|
+
return Wt.size < pi && Wt.set(i, s), s;
|
|
771
771
|
}
|
|
772
|
-
const
|
|
773
|
-
function
|
|
774
|
-
return `#${
|
|
772
|
+
const Ce = (i) => i.charCodeAt(0) === 35, Re = (i) => i.startsWith("rgb"), Ie = (i) => i.startsWith("rgba"), Ls = /rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*([\d.]+))?\s*\)/, Ut = (i) => Math.round(i).toString(16).padStart(2, "0");
|
|
773
|
+
function Ds(i, t, e) {
|
|
774
|
+
return `#${Ut(i)}${Ut(t)}${Ut(e)}`;
|
|
775
775
|
}
|
|
776
|
-
function
|
|
777
|
-
const t =
|
|
776
|
+
function $e(i) {
|
|
777
|
+
const t = jt.get(i);
|
|
778
778
|
if (t) return t;
|
|
779
|
-
const e = i.match(
|
|
779
|
+
const e = i.match(Ls);
|
|
780
780
|
if (!e)
|
|
781
781
|
throw new Error(`Invalid rgb color: ${i}`);
|
|
782
782
|
const s = parseInt(e[1], 10), n = parseInt(e[2], 10), r = parseInt(e[3], 10), o = e[4] !== void 0 ? [s, n, r, parseFloat(e[4])] : [s, n, r];
|
|
783
|
-
return
|
|
783
|
+
return jt.size < pi && jt.set(i, o), o;
|
|
784
784
|
}
|
|
785
|
-
const
|
|
786
|
-
if (
|
|
787
|
-
const [s, n, r] =
|
|
788
|
-
return
|
|
785
|
+
const Os = (i, t, e) => {
|
|
786
|
+
if (Ce(i) && Ce(t)) {
|
|
787
|
+
const [s, n, r] = _e(i), [o, a, c] = _e(t), l = Y(s, o, e), h = Y(n, a, e), f = Y(r, c, e);
|
|
788
|
+
return Ds(l, h, f);
|
|
789
789
|
}
|
|
790
|
-
if ((
|
|
791
|
-
const s =
|
|
790
|
+
if ((Re(i) || Ie(i)) && (Re(t) || Ie(t))) {
|
|
791
|
+
const s = $e(i), n = $e(t), r = Math.round(Y(s[0], n[0], e)), o = Math.round(Y(s[1], n[1], e)), a = Math.round(Y(s[2], n[2], e));
|
|
792
792
|
if (s.length === 4 || n.length === 4) {
|
|
793
|
-
const c = s[3] ?? 1, l = n[3] ?? 1, h =
|
|
793
|
+
const c = s[3] ?? 1, l = n[3] ?? 1, h = Y(c, l, e);
|
|
794
794
|
return `rgba(${r}, ${o}, ${a}, ${h})`;
|
|
795
795
|
}
|
|
796
796
|
return `rgb(${r}, ${o}, ${a})`;
|
|
797
797
|
}
|
|
798
798
|
return e < 1 ? i : t;
|
|
799
|
-
},
|
|
799
|
+
}, Bs = (i, t, e) => {
|
|
800
800
|
const s = Math.min(i.length, t.length), n = [];
|
|
801
801
|
for (let r = 0; r < s; r++)
|
|
802
|
-
n.push(
|
|
802
|
+
n.push(Y(i[r], t[r], e));
|
|
803
803
|
return n;
|
|
804
|
-
},
|
|
805
|
-
function
|
|
806
|
-
return typeof i == "number" ?
|
|
804
|
+
}, Fe = (i, t, e) => e < 1 ? i : t, Ns = (i, t, e) => Fs(i, t, e);
|
|
805
|
+
function Rt(i) {
|
|
806
|
+
return typeof i == "number" ? Y : Array.isArray(i) ? Bs : typeof i == "string" ? i.startsWith("#") || i.startsWith("rgb") ? Os : vt(i) ? Ns : Fe : Fe;
|
|
807
807
|
}
|
|
808
|
-
const
|
|
809
|
-
function
|
|
810
|
-
if (!
|
|
808
|
+
const mi = 1e3 / 60;
|
|
809
|
+
function gi(i, t = {}) {
|
|
810
|
+
if (!Q(i))
|
|
811
811
|
throw new Error(`bakeSpringTrack: track "${i.id}" is not a spring track`);
|
|
812
|
-
const e = new
|
|
813
|
-
return
|
|
812
|
+
const e = new Ot(i.spring);
|
|
813
|
+
return bi(i, (s) => e.valueAt(s), e.settleTime(), i.spring.from, i.spring.to, t);
|
|
814
814
|
}
|
|
815
|
-
function
|
|
816
|
-
if (!
|
|
815
|
+
function yi(i, t = {}) {
|
|
816
|
+
if (!Z(i))
|
|
817
817
|
throw new Error(`bakeInertiaTrack: track "${i.id}" is not an inertia track`);
|
|
818
818
|
const e = i.inertia;
|
|
819
|
-
return
|
|
819
|
+
return bi(
|
|
820
820
|
i,
|
|
821
|
-
(s) =>
|
|
822
|
-
|
|
821
|
+
(s) => se(e, s),
|
|
822
|
+
bt(e),
|
|
823
823
|
e.from,
|
|
824
|
-
|
|
824
|
+
yt(e),
|
|
825
825
|
t
|
|
826
826
|
);
|
|
827
827
|
}
|
|
828
|
-
function
|
|
829
|
-
const o = r.intervalMs ??
|
|
828
|
+
function bi(i, t, e, s, n, r) {
|
|
829
|
+
const o = r.intervalMs ?? mi, a = r.tolerance ?? 0.01, c = i.delay ?? 0, l = [];
|
|
830
830
|
for (let f = 0; f <= e; f += o)
|
|
831
831
|
l.push({ time: f + c, value: t(f), easing: "linear" });
|
|
832
832
|
const h = l[l.length - 1];
|
|
@@ -834,13 +834,13 @@ function pi(i, t, e, s, n, r) {
|
|
|
834
834
|
id: i.id,
|
|
835
835
|
target: i.target,
|
|
836
836
|
property: i.property,
|
|
837
|
-
keyframes: a > 0 ?
|
|
837
|
+
keyframes: a > 0 ? Xs(l, a) : l,
|
|
838
838
|
...i.targets && { targets: [...i.targets] },
|
|
839
839
|
...i.stagger && { stagger: { ...i.stagger } }
|
|
840
840
|
};
|
|
841
841
|
}
|
|
842
|
-
function
|
|
843
|
-
const n = s.intervalMs ??
|
|
842
|
+
function vi(i, t, e, s = {}) {
|
|
843
|
+
const n = s.intervalMs ?? mi, r = typeof e == "function" ? e : W(e), o = Rt(i.value), a = t.time - i.time;
|
|
844
844
|
if (a <= 0) return [t];
|
|
845
845
|
const c = [];
|
|
846
846
|
for (let h = n; h < a; h += n) {
|
|
@@ -854,26 +854,26 @@ function mi(i, t, e, s = {}) {
|
|
|
854
854
|
const l = r(1);
|
|
855
855
|
return c.push({ ...t, ...l !== 1 && { value: o(i.value, t.value, l) }, easing: "linear" }), c;
|
|
856
856
|
}
|
|
857
|
-
function
|
|
858
|
-
return
|
|
857
|
+
function vo(i, t) {
|
|
858
|
+
return Q(i) ? gi(i, t) : Z(i) ? yi(i, t) : i;
|
|
859
859
|
}
|
|
860
|
-
function
|
|
860
|
+
function qs(i, t = {}) {
|
|
861
861
|
const e = i.keyframes;
|
|
862
|
-
if (!e.some((n) =>
|
|
862
|
+
if (!e.some((n) => Et(n.easing))) return i;
|
|
863
863
|
const s = e.length > 0 ? [e[0]] : [];
|
|
864
864
|
for (let n = 1; n < e.length; n++) {
|
|
865
865
|
const r = e[n];
|
|
866
|
-
|
|
866
|
+
Et(r.easing) ? s.push(...vi(e[n - 1], r, r.easing, t)) : s.push(r);
|
|
867
867
|
}
|
|
868
868
|
return { ...i, keyframes: s };
|
|
869
869
|
}
|
|
870
|
-
function
|
|
871
|
-
return i.filter(
|
|
872
|
-
i.filter(
|
|
873
|
-
i.filter(
|
|
870
|
+
function wo(i, t) {
|
|
871
|
+
return i.filter(Gi).map((e) => qs(e, t)).concat(
|
|
872
|
+
i.filter(Q).map((e) => gi(e, t)),
|
|
873
|
+
i.filter(Z).map((e) => yi(e, t))
|
|
874
874
|
);
|
|
875
875
|
}
|
|
876
|
-
function
|
|
876
|
+
function Xs(i, t) {
|
|
877
877
|
if (i.length <= 2) return i;
|
|
878
878
|
const e = [i[0]];
|
|
879
879
|
for (let s = 1; s < i.length - 1; s++) {
|
|
@@ -884,25 +884,25 @@ function Bs(i, t) {
|
|
|
884
884
|
}
|
|
885
885
|
return e.push(i[i.length - 1]), e;
|
|
886
886
|
}
|
|
887
|
-
function
|
|
887
|
+
function oe(i) {
|
|
888
888
|
const t = [...i.keyframes].sort((e, s) => e.time - s.time);
|
|
889
889
|
return {
|
|
890
890
|
...i,
|
|
891
891
|
keyframes: t
|
|
892
892
|
};
|
|
893
893
|
}
|
|
894
|
-
function
|
|
894
|
+
function G(i) {
|
|
895
895
|
return i.targets && i.targets.length > 0 ? i.targets : [i.target];
|
|
896
896
|
}
|
|
897
|
-
function
|
|
897
|
+
function rt(i, t, e, s) {
|
|
898
898
|
const n = e ?? 0;
|
|
899
|
-
return !s || t <= 1 ? n : n +
|
|
899
|
+
return !s || t <= 1 ? n : n + de(i, t, s);
|
|
900
900
|
}
|
|
901
|
-
class
|
|
901
|
+
class zt {
|
|
902
902
|
track;
|
|
903
903
|
targets;
|
|
904
904
|
constructor(t) {
|
|
905
|
-
this.track = t, this.targets =
|
|
905
|
+
this.track = t, this.targets = G(t);
|
|
906
906
|
}
|
|
907
907
|
/**
|
|
908
908
|
* Get the interpolated value at a specific time.
|
|
@@ -911,7 +911,7 @@ class jt {
|
|
|
911
911
|
* that need every target should use `getTargetValues`.
|
|
912
912
|
*/
|
|
913
913
|
getValueAtTime(t) {
|
|
914
|
-
return this.valueForOffset(t -
|
|
914
|
+
return this.valueForOffset(t - rt(0, this.targets.length, this.track.delay, this.track.stagger));
|
|
915
915
|
}
|
|
916
916
|
/**
|
|
917
917
|
* Every target's value at a specific time, in target order.
|
|
@@ -922,7 +922,7 @@ class jt {
|
|
|
922
922
|
getTargetValues(t) {
|
|
923
923
|
const e = this.targets.length, s = [];
|
|
924
924
|
for (let n = 0; n < e; n++) {
|
|
925
|
-
const r =
|
|
925
|
+
const r = rt(n, e, this.track.delay, this.track.stagger), o = this.valueForOffset(t - r);
|
|
926
926
|
o !== void 0 && s.push({ target: this.targets[n], value: o, start: r + this.track.keyframes[0].time });
|
|
927
927
|
}
|
|
928
928
|
return s;
|
|
@@ -935,7 +935,7 @@ class jt {
|
|
|
935
935
|
const { keyframes: t } = this.track;
|
|
936
936
|
if (t.length === 0)
|
|
937
937
|
return 0;
|
|
938
|
-
const e = t[t.length - 1].time, s = this.track.stagger ?
|
|
938
|
+
const e = t[t.length - 1].time, s = this.track.stagger ? Dt(this.targets.length, this.track.stagger) : 0;
|
|
939
939
|
return e + (this.track.delay ?? 0) + s + (this.track.endDelay ?? 0);
|
|
940
940
|
}
|
|
941
941
|
/**
|
|
@@ -959,7 +959,7 @@ class jt {
|
|
|
959
959
|
if (s.time === t)
|
|
960
960
|
return s.value;
|
|
961
961
|
const r = n.time - s.time, o = (t - s.time) / r, c = W(n.easing)(o);
|
|
962
|
-
return
|
|
962
|
+
return Rt(s.value)(s.value, n.value, c);
|
|
963
963
|
}
|
|
964
964
|
/**
|
|
965
965
|
* Find the keyframes surrounding a given time.
|
|
@@ -972,62 +972,62 @@ class jt {
|
|
|
972
972
|
return { from: null, to: null };
|
|
973
973
|
}
|
|
974
974
|
}
|
|
975
|
-
class
|
|
975
|
+
class Ys {
|
|
976
976
|
track;
|
|
977
977
|
targets;
|
|
978
978
|
sampler;
|
|
979
979
|
constructor(t) {
|
|
980
|
-
this.track = t, this.targets =
|
|
980
|
+
this.track = t, this.targets = G(t), this.sampler = new Ot(t.spring);
|
|
981
981
|
}
|
|
982
982
|
getValueAtTime(t) {
|
|
983
|
-
return this.sampler.valueAt(t -
|
|
983
|
+
return this.sampler.valueAt(t - rt(0, this.targets.length, this.track.delay, this.track.stagger));
|
|
984
984
|
}
|
|
985
985
|
getTargetValues(t) {
|
|
986
986
|
const e = this.targets.length, s = [];
|
|
987
987
|
for (let n = 0; n < e; n++) {
|
|
988
|
-
const r =
|
|
988
|
+
const r = rt(n, e, this.track.delay, this.track.stagger);
|
|
989
989
|
s.push({ target: this.targets[n], value: this.sampler.valueAt(t - r), start: r });
|
|
990
990
|
}
|
|
991
991
|
return s;
|
|
992
992
|
}
|
|
993
993
|
/** Settle time plus delay and the widest stagger offset. */
|
|
994
994
|
getDuration() {
|
|
995
|
-
const t = this.track.stagger ?
|
|
995
|
+
const t = this.track.stagger ? Dt(this.targets.length, this.track.stagger) : 0;
|
|
996
996
|
return this.sampler.settleTime() + (this.track.delay ?? 0) + t;
|
|
997
997
|
}
|
|
998
998
|
getTrack() {
|
|
999
999
|
return this.track;
|
|
1000
1000
|
}
|
|
1001
1001
|
}
|
|
1002
|
-
class
|
|
1002
|
+
class Vs {
|
|
1003
1003
|
track;
|
|
1004
1004
|
targets;
|
|
1005
1005
|
duration;
|
|
1006
1006
|
constructor(t) {
|
|
1007
|
-
this.track = t, this.targets =
|
|
1007
|
+
this.track = t, this.targets = G(t), this.duration = bt(t.inertia);
|
|
1008
1008
|
}
|
|
1009
1009
|
getValueAtTime(t) {
|
|
1010
|
-
return
|
|
1010
|
+
return se(this.track.inertia, t - rt(0, this.targets.length, this.track.delay, this.track.stagger));
|
|
1011
1011
|
}
|
|
1012
1012
|
getTargetValues(t) {
|
|
1013
1013
|
const e = this.targets.length, s = [];
|
|
1014
1014
|
for (let n = 0; n < e; n++) {
|
|
1015
|
-
const r =
|
|
1016
|
-
s.push({ target: this.targets[n], value:
|
|
1015
|
+
const r = rt(n, e, this.track.delay, this.track.stagger);
|
|
1016
|
+
s.push({ target: this.targets[n], value: se(this.track.inertia, t - r), start: r });
|
|
1017
1017
|
}
|
|
1018
1018
|
return s;
|
|
1019
1019
|
}
|
|
1020
1020
|
/** Settle time plus delay and the widest stagger offset. */
|
|
1021
1021
|
getDuration() {
|
|
1022
|
-
const t = this.track.stagger ?
|
|
1022
|
+
const t = this.track.stagger ? Dt(this.targets.length, this.track.stagger) : 0;
|
|
1023
1023
|
return this.duration + (this.track.delay ?? 0) + t;
|
|
1024
1024
|
}
|
|
1025
1025
|
getTrack() {
|
|
1026
1026
|
return this.track;
|
|
1027
1027
|
}
|
|
1028
1028
|
}
|
|
1029
|
-
function
|
|
1030
|
-
const e = { ...
|
|
1029
|
+
function wi(i, t) {
|
|
1030
|
+
const e = { ...xs(i.pathData, t) };
|
|
1031
1031
|
if (i.matrix) {
|
|
1032
1032
|
const [s, n, r, o, a, c] = i.matrix, { x: l, y: h } = e;
|
|
1033
1033
|
e.x = s * l + r * h + a, e.y = n * l + o * h + c;
|
|
@@ -1036,25 +1036,25 @@ function gi(i, t) {
|
|
|
1036
1036
|
}
|
|
1037
1037
|
return i.autoRotate && i.rotateOffset && (e.angle += i.rotateOffset), e;
|
|
1038
1038
|
}
|
|
1039
|
-
function
|
|
1039
|
+
function To(i, t, e, s) {
|
|
1040
1040
|
const n = t + (e - t) * s;
|
|
1041
|
-
return
|
|
1041
|
+
return wi(i, n);
|
|
1042
1042
|
}
|
|
1043
|
-
const
|
|
1043
|
+
const Ht = {
|
|
1044
1044
|
upperCase: "ABCDEFGHIJKLMNOPQRSTUVWXYZ",
|
|
1045
1045
|
lowerCase: "abcdefghijklmnopqrstuvwxyz",
|
|
1046
1046
|
upperAndLowerCase: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",
|
|
1047
1047
|
numbers: "0123456789"
|
|
1048
|
-
},
|
|
1049
|
-
function
|
|
1050
|
-
const t =
|
|
1051
|
-
return e.length > 0 ? e : Array.from(
|
|
1048
|
+
}, Ws = 20;
|
|
1049
|
+
function js(i) {
|
|
1050
|
+
const t = Ht[i ?? "upperCase"] ?? i ?? Ht.upperCase, e = Array.from(t);
|
|
1051
|
+
return e.length > 0 ? e : Array.from(Ht.upperCase);
|
|
1052
1052
|
}
|
|
1053
|
-
function
|
|
1053
|
+
function Us(i, t, e) {
|
|
1054
1054
|
let s = (i | 0) ^ Math.imul(t + 1, 2654435761) ^ Math.imul(e + 1, 2246822507);
|
|
1055
1055
|
return s = Math.imul(s ^ s >>> 16, 2146121005), s = Math.imul(s ^ s >>> 15, 2221713035), (s ^ s >>> 16) >>> 0;
|
|
1056
1056
|
}
|
|
1057
|
-
function
|
|
1057
|
+
function zs(i, t, e = 0) {
|
|
1058
1058
|
const s = i.from ?? "", n = i.to, r = Math.max(0, Math.min(1, t));
|
|
1059
1059
|
if (r <= 0) return s;
|
|
1060
1060
|
if (r >= 1) return n;
|
|
@@ -1063,16 +1063,16 @@ function Ws(i, t, e = 0) {
|
|
|
1063
1063
|
const b = Math.round(r * Math.max(o.length, a.length));
|
|
1064
1064
|
return c ? o.slice(0, Math.max(0, o.length - b)).join("") + a.slice(Math.max(0, a.length - b)).join("") : a.slice(0, b).join("") + o.slice(b).join("");
|
|
1065
1065
|
}
|
|
1066
|
-
const l = Math.max(0, Math.min(0.999, i.revealDelay ?? 0)), h = Math.max(0, (r - l) / (1 - l)), f = Math.floor(h * a.length), u = i.tweenLength === !1 ? a.length : Math.round(o.length + (a.length - o.length) * r), d =
|
|
1066
|
+
const l = Math.max(0, Math.min(0.999, i.revealDelay ?? 0)), h = Math.max(0, (r - l) / (1 - l)), f = Math.floor(h * a.length), u = i.tweenLength === !1 ? a.length : Math.round(o.length + (a.length - o.length) * r), d = js(i.chars), m = i.refreshRate ?? Ws, p = m > 0 ? Math.floor(e * m / 1e3) : 0, g = i.seed ?? 1;
|
|
1067
1067
|
let y = "";
|
|
1068
1068
|
for (let b = 0; b < u; b++) {
|
|
1069
|
-
const
|
|
1070
|
-
|
|
1071
|
-
` ? y +=
|
|
1069
|
+
const v = c ? b >= u - f : b < f, T = c ? a[a.length - (u - b)] : a[b];
|
|
1070
|
+
v && T !== void 0 || T === " " || T === `
|
|
1071
|
+
` ? y += T : y += d[Us(g, b, p) % d.length];
|
|
1072
1072
|
}
|
|
1073
1073
|
return y;
|
|
1074
1074
|
}
|
|
1075
|
-
class
|
|
1075
|
+
class Ti {
|
|
1076
1076
|
id;
|
|
1077
1077
|
name;
|
|
1078
1078
|
_captions;
|
|
@@ -1271,12 +1271,12 @@ class yi {
|
|
|
1271
1271
|
a || (a = /* @__PURE__ */ new Map(), t.set(s, a));
|
|
1272
1272
|
const c = this._textTracks.get(e);
|
|
1273
1273
|
if (c && typeof r == "number") {
|
|
1274
|
-
a.set("text",
|
|
1274
|
+
a.set("text", zs(c.textConfig, r, Math.max(0, o)));
|
|
1275
1275
|
return;
|
|
1276
1276
|
}
|
|
1277
1277
|
const l = this._motionPathTracks.get(e);
|
|
1278
1278
|
if (l && typeof r == "number") {
|
|
1279
|
-
const h =
|
|
1279
|
+
const h = wi(l.motionPathConfig, r);
|
|
1280
1280
|
a.set("motionPathX", h.x), a.set("motionPathY", h.y), l.motionPathConfig.autoRotate && a.set("motionPathRotate", h.angle);
|
|
1281
1281
|
} else
|
|
1282
1282
|
a.set(n, r);
|
|
@@ -1288,7 +1288,7 @@ class yi {
|
|
|
1288
1288
|
const t = /* @__PURE__ */ new Set();
|
|
1289
1289
|
this._sharedWrites = !1;
|
|
1290
1290
|
t: for (const e of this._tracks)
|
|
1291
|
-
for (const s of
|
|
1291
|
+
for (const s of G(e)) {
|
|
1292
1292
|
const n = `${s}\0${e.property}`;
|
|
1293
1293
|
if (t.has(n)) {
|
|
1294
1294
|
this._sharedWrites = !0;
|
|
@@ -1303,17 +1303,17 @@ class yi {
|
|
|
1303
1303
|
* Add a track to the timeline.
|
|
1304
1304
|
*/
|
|
1305
1305
|
addTrack(t) {
|
|
1306
|
-
if (this._tracks.push(t), this._sharedWrites = null,
|
|
1307
|
-
this._trackPlayers.set(t.id, new
|
|
1306
|
+
if (this._tracks.push(t), this._sharedWrites = null, Z(t)) {
|
|
1307
|
+
this._trackPlayers.set(t.id, new Vs(t));
|
|
1308
1308
|
return;
|
|
1309
1309
|
}
|
|
1310
|
-
if (
|
|
1311
|
-
this._trackPlayers.set(t.id, new
|
|
1310
|
+
if (Q(t)) {
|
|
1311
|
+
this._trackPlayers.set(t.id, new Ys(t)), this._springTracks.set(t.id, t);
|
|
1312
1312
|
return;
|
|
1313
1313
|
}
|
|
1314
|
-
if (
|
|
1315
|
-
this._trackPlayers.set(t.id, new
|
|
1316
|
-
else if (
|
|
1314
|
+
if (fe(t))
|
|
1315
|
+
this._trackPlayers.set(t.id, new zt(t)), this._textTracks.set(t.id, t);
|
|
1316
|
+
else if (ai(t)) {
|
|
1317
1317
|
const e = {
|
|
1318
1318
|
id: t.id,
|
|
1319
1319
|
target: t.target,
|
|
@@ -1324,9 +1324,9 @@ class yi {
|
|
|
1324
1324
|
targets: t.targets,
|
|
1325
1325
|
stagger: t.stagger
|
|
1326
1326
|
};
|
|
1327
|
-
this._trackPlayers.set(t.id, new
|
|
1327
|
+
this._trackPlayers.set(t.id, new zt(e)), this._motionPathTracks.set(t.id, t);
|
|
1328
1328
|
} else
|
|
1329
|
-
this._trackPlayers.set(t.id, new
|
|
1329
|
+
this._trackPlayers.set(t.id, new zt(t));
|
|
1330
1330
|
}
|
|
1331
1331
|
/**
|
|
1332
1332
|
* Replace a track with a new version, keeping its place in the track order
|
|
@@ -1377,7 +1377,7 @@ class yi {
|
|
|
1377
1377
|
const e = this._trackPlayers.get(t);
|
|
1378
1378
|
if (!e) return;
|
|
1379
1379
|
const s = e.getTrack(), n = s.delay ?? 0;
|
|
1380
|
-
if (
|
|
1380
|
+
if (Q(s) || Z(s))
|
|
1381
1381
|
return { from: n, to: e.getDuration() };
|
|
1382
1382
|
const r = s.keyframes;
|
|
1383
1383
|
if (!(!r || r.length === 0))
|
|
@@ -1399,7 +1399,7 @@ class yi {
|
|
|
1399
1399
|
for (let r = 0; r < e; r++) {
|
|
1400
1400
|
const o = this._tracks[r];
|
|
1401
1401
|
if (o.property !== s.property) continue;
|
|
1402
|
-
const a =
|
|
1402
|
+
const a = G(o).filter((f) => G(s).includes(f));
|
|
1403
1403
|
if (a.length === 0) continue;
|
|
1404
1404
|
const c = this.getTrackSpan(o.id);
|
|
1405
1405
|
if (!c || !(c.from <= n.to && n.from <= c.to)) continue;
|
|
@@ -1416,7 +1416,7 @@ class yi {
|
|
|
1416
1416
|
return t;
|
|
1417
1417
|
}
|
|
1418
1418
|
_matches(t, e) {
|
|
1419
|
-
if (e.id !== void 0 && t.id !== e.id || e.property !== void 0 && t.property !== e.property || e.target !== void 0 && !
|
|
1419
|
+
if (e.id !== void 0 && t.id !== e.id || e.property !== void 0 && t.property !== e.property || e.target !== void 0 && !G(t).includes(e.target)) return !1;
|
|
1420
1420
|
if (e.timeRange) {
|
|
1421
1421
|
const s = this.getTrackSpan(t.id);
|
|
1422
1422
|
if (!s || s.to < e.timeRange.from || s.from > e.timeRange.to) return !1;
|
|
@@ -1486,72 +1486,72 @@ class yi {
|
|
|
1486
1486
|
return this._config.alternate && (t === -1 || this._loopIteration < t) ? (this._loopIteration++, this._armRepeatDelay(), this._direction = "forward", this._repeatDelayRemaining === 0) : (this._playbackState = "idle", this.onComplete?.(), !1);
|
|
1487
1487
|
}
|
|
1488
1488
|
}
|
|
1489
|
-
const
|
|
1490
|
-
function
|
|
1489
|
+
const Hs = 100;
|
|
1490
|
+
function xi(i, t, e, s) {
|
|
1491
1491
|
const n = [], r = [], { duration: o, alternate: a } = s, c = (d, m, p, g) => {
|
|
1492
1492
|
r.push([d, m]);
|
|
1493
1493
|
const y = [];
|
|
1494
|
-
i.forEach((b,
|
|
1495
|
-
(p === "forward" ? (g ? b >= d : b > d) && b <= m : (g ? b <= d : b < d) && b >= m) && y.push(
|
|
1496
|
-
}), y.sort((b,
|
|
1494
|
+
i.forEach((b, v) => {
|
|
1495
|
+
(p === "forward" ? (g ? b >= d : b > d) && b <= m : (g ? b <= d : b < d) && b >= m) && y.push(v);
|
|
1496
|
+
}), y.sort((b, v) => (p === "forward" ? i[b] - i[v] : i[v] - i[b]) || b - v);
|
|
1497
1497
|
for (const b of y) n.push({ kind: "event", index: b, direction: p });
|
|
1498
1498
|
};
|
|
1499
1499
|
let l = t.time, h = t.direction, f = t.fresh === !0;
|
|
1500
|
-
const u = Math.min(
|
|
1500
|
+
const u = Math.min(Hs, Math.max(0, e.iteration - t.iteration));
|
|
1501
1501
|
for (let d = 0; d < u; d++) {
|
|
1502
1502
|
const m = h === "forward" ? o : 0;
|
|
1503
1503
|
c(l, m, h, f), n.push({ kind: "repeat" }), a ? (h = h === "forward" ? "reverse" : "forward", l = m, f = !1) : (l = h === "forward" ? 0 : o, f = !0);
|
|
1504
1504
|
}
|
|
1505
1505
|
return u > 0 && s.holding && !a ? { crossings: n, passes: r } : (c(l, e.time, h, f), { crossings: n, passes: r });
|
|
1506
1506
|
}
|
|
1507
|
-
function
|
|
1508
|
-
return
|
|
1507
|
+
function Gs(i) {
|
|
1508
|
+
return Z(i) ? {
|
|
1509
1509
|
id: i.id,
|
|
1510
1510
|
target: i.target,
|
|
1511
1511
|
property: i.property,
|
|
1512
1512
|
kind: "inertia",
|
|
1513
|
-
inertia:
|
|
1514
|
-
...
|
|
1515
|
-
} :
|
|
1513
|
+
inertia: ki(i.inertia),
|
|
1514
|
+
...X(i)
|
|
1515
|
+
} : Q(i) ? {
|
|
1516
1516
|
id: i.id,
|
|
1517
1517
|
target: i.target,
|
|
1518
1518
|
property: i.property,
|
|
1519
1519
|
kind: "spring",
|
|
1520
1520
|
spring: { ...i.spring },
|
|
1521
|
-
...
|
|
1522
|
-
} :
|
|
1521
|
+
...X(i)
|
|
1522
|
+
} : fe(i) ? {
|
|
1523
1523
|
id: i.id,
|
|
1524
1524
|
target: i.target,
|
|
1525
1525
|
property: "text",
|
|
1526
1526
|
textConfig: { ...i.textConfig },
|
|
1527
|
-
keyframes: i.keyframes.map(
|
|
1528
|
-
...
|
|
1529
|
-
} :
|
|
1527
|
+
keyframes: i.keyframes.map(Gt),
|
|
1528
|
+
...X(i)
|
|
1529
|
+
} : ai(i) ? {
|
|
1530
1530
|
id: i.id,
|
|
1531
1531
|
target: i.target,
|
|
1532
1532
|
property: "motionPath",
|
|
1533
1533
|
motionPathConfig: { ...i.motionPathConfig },
|
|
1534
|
-
keyframes: i.keyframes.map(
|
|
1535
|
-
...
|
|
1534
|
+
keyframes: i.keyframes.map(Gt),
|
|
1535
|
+
...X(i)
|
|
1536
1536
|
} : {
|
|
1537
1537
|
id: i.id,
|
|
1538
1538
|
target: i.target,
|
|
1539
1539
|
property: i.property,
|
|
1540
|
-
keyframes: i.keyframes.map(
|
|
1541
|
-
...
|
|
1540
|
+
keyframes: i.keyframes.map(Gt),
|
|
1541
|
+
...X(i)
|
|
1542
1542
|
};
|
|
1543
1543
|
}
|
|
1544
|
-
function
|
|
1544
|
+
function ki(i) {
|
|
1545
1545
|
return { ...i, ...Array.isArray(i.end) && { end: [...i.end] } };
|
|
1546
1546
|
}
|
|
1547
|
-
function
|
|
1547
|
+
function Gt(i) {
|
|
1548
1548
|
return {
|
|
1549
1549
|
time: i.time,
|
|
1550
1550
|
value: i.value,
|
|
1551
1551
|
...i.easing && { easing: i.easing }
|
|
1552
1552
|
};
|
|
1553
1553
|
}
|
|
1554
|
-
function
|
|
1554
|
+
function X(i) {
|
|
1555
1555
|
const t = i.endDelay;
|
|
1556
1556
|
return {
|
|
1557
1557
|
...i.delay !== void 0 && { delay: i.delay },
|
|
@@ -1560,19 +1560,19 @@ function N(i) {
|
|
|
1560
1560
|
...i.stagger !== void 0 && { stagger: { ...i.stagger } }
|
|
1561
1561
|
};
|
|
1562
1562
|
}
|
|
1563
|
-
function
|
|
1564
|
-
if (
|
|
1563
|
+
function Ks(i) {
|
|
1564
|
+
if (Z(i)) {
|
|
1565
1565
|
const t = i;
|
|
1566
1566
|
return {
|
|
1567
1567
|
id: t.id,
|
|
1568
1568
|
target: t.target,
|
|
1569
1569
|
property: t.property,
|
|
1570
1570
|
kind: "inertia",
|
|
1571
|
-
inertia:
|
|
1572
|
-
...
|
|
1571
|
+
inertia: ki(t.inertia),
|
|
1572
|
+
...X(t)
|
|
1573
1573
|
};
|
|
1574
1574
|
}
|
|
1575
|
-
if (
|
|
1575
|
+
if (Q(i)) {
|
|
1576
1576
|
const t = i;
|
|
1577
1577
|
return {
|
|
1578
1578
|
id: t.id,
|
|
@@ -1580,10 +1580,10 @@ function zs(i) {
|
|
|
1580
1580
|
property: t.property,
|
|
1581
1581
|
kind: "spring",
|
|
1582
1582
|
spring: { ...t.spring },
|
|
1583
|
-
...
|
|
1583
|
+
...X(t)
|
|
1584
1584
|
};
|
|
1585
1585
|
}
|
|
1586
|
-
if (
|
|
1586
|
+
if (fe(i)) {
|
|
1587
1587
|
const t = i;
|
|
1588
1588
|
return {
|
|
1589
1589
|
id: t.id,
|
|
@@ -1591,7 +1591,7 @@ function zs(i) {
|
|
|
1591
1591
|
property: "text",
|
|
1592
1592
|
textConfig: { ...t.textConfig },
|
|
1593
1593
|
keyframes: [...t.keyframes].sort((e, s) => e.time - s.time),
|
|
1594
|
-
...
|
|
1594
|
+
...X(t)
|
|
1595
1595
|
};
|
|
1596
1596
|
}
|
|
1597
1597
|
if (i.property === "motionPath" && "motionPathConfig" in i) {
|
|
@@ -1602,18 +1602,18 @@ function zs(i) {
|
|
|
1602
1602
|
property: "motionPath",
|
|
1603
1603
|
motionPathConfig: { ...t.motionPathConfig },
|
|
1604
1604
|
keyframes: e,
|
|
1605
|
-
...
|
|
1605
|
+
...X(t)
|
|
1606
1606
|
};
|
|
1607
1607
|
}
|
|
1608
|
-
return
|
|
1608
|
+
return oe({
|
|
1609
1609
|
id: i.id,
|
|
1610
1610
|
target: i.target,
|
|
1611
1611
|
property: i.property,
|
|
1612
1612
|
keyframes: i.keyframes,
|
|
1613
|
-
...
|
|
1613
|
+
...X(i)
|
|
1614
1614
|
});
|
|
1615
1615
|
}
|
|
1616
|
-
function
|
|
1616
|
+
function Zs(i) {
|
|
1617
1617
|
const t = i._config.markers;
|
|
1618
1618
|
return {
|
|
1619
1619
|
formatVersion: _t,
|
|
@@ -1627,38 +1627,38 @@ function Hs(i) {
|
|
|
1627
1627
|
repeatDelay: i._config.repeatDelay,
|
|
1628
1628
|
...t && { markers: t.map((e) => ({ ...e })) }
|
|
1629
1629
|
},
|
|
1630
|
-
tracks: i.tracks.map(
|
|
1630
|
+
tracks: i.tracks.map(Gs),
|
|
1631
1631
|
...i.captions && { captions: JSON.parse(JSON.stringify(i.captions)) }
|
|
1632
1632
|
};
|
|
1633
1633
|
}
|
|
1634
|
-
function
|
|
1634
|
+
function mt(i) {
|
|
1635
1635
|
const t = i.formatVersion ?? 1;
|
|
1636
1636
|
if (t > _t)
|
|
1637
1637
|
throw new Error(
|
|
1638
1638
|
`tinyfly: this animation uses format version ${t}, but this tinyfly reads up to version ${_t}. Update tinyfly to play it.`
|
|
1639
1639
|
);
|
|
1640
|
-
return new
|
|
1640
|
+
return new Ti({
|
|
1641
1641
|
id: i.id,
|
|
1642
1642
|
name: i.name,
|
|
1643
1643
|
config: i.config,
|
|
1644
|
-
tracks: i.tracks.map(
|
|
1644
|
+
tracks: i.tracks.map(Ks),
|
|
1645
1645
|
captions: i.captions
|
|
1646
1646
|
});
|
|
1647
1647
|
}
|
|
1648
|
-
function
|
|
1649
|
-
return JSON.stringify(
|
|
1648
|
+
function xo(i) {
|
|
1649
|
+
return JSON.stringify(Zs(i));
|
|
1650
1650
|
}
|
|
1651
|
-
function
|
|
1651
|
+
function ko(i) {
|
|
1652
1652
|
const t = JSON.parse(i);
|
|
1653
|
-
return
|
|
1653
|
+
return mt(t);
|
|
1654
1654
|
}
|
|
1655
|
-
function
|
|
1655
|
+
function So(i) {
|
|
1656
1656
|
let t = 2166136261;
|
|
1657
1657
|
for (let e = 0; e < i.length; e++)
|
|
1658
1658
|
t ^= i.charCodeAt(e), t = Math.imul(t, 16777619);
|
|
1659
1659
|
return t >>> 0;
|
|
1660
1660
|
}
|
|
1661
|
-
function
|
|
1661
|
+
function Qs(i) {
|
|
1662
1662
|
let t = i >>> 0 || 2654435769;
|
|
1663
1663
|
return {
|
|
1664
1664
|
seed: i >>> 0,
|
|
@@ -1667,25 +1667,25 @@ function Gs(i) {
|
|
|
1667
1667
|
}
|
|
1668
1668
|
};
|
|
1669
1669
|
}
|
|
1670
|
-
function
|
|
1670
|
+
function Si(i, t, e) {
|
|
1671
1671
|
return t + i.next() * (e - t);
|
|
1672
1672
|
}
|
|
1673
|
-
function
|
|
1674
|
-
if (s <= 0) return
|
|
1673
|
+
function Js(i, t, e, s) {
|
|
1674
|
+
if (s <= 0) return Si(i, t, e);
|
|
1675
1675
|
const n = Math.floor((e - t) / s), r = Math.round(i.next() * n);
|
|
1676
1676
|
return t + r * s;
|
|
1677
1677
|
}
|
|
1678
|
-
function
|
|
1678
|
+
function Mo(i, t) {
|
|
1679
1679
|
if (t.length !== 0)
|
|
1680
1680
|
return t[Math.floor(i.next() * t.length)];
|
|
1681
1681
|
}
|
|
1682
|
-
const
|
|
1683
|
-
function
|
|
1684
|
-
return typeof i != "string" ? !1 :
|
|
1682
|
+
const Mi = /^([+\-*/])=\s*(-?[\d.]+)$/, Ai = /^random\(\s*(-?[\d.]+)\s*,\s*(-?[\d.]+)\s*(?:,\s*(-?[\d.]+)\s*)?\)$/i;
|
|
1683
|
+
function Ao(i) {
|
|
1684
|
+
return typeof i != "string" ? !1 : Mi.test(i.trim()) || Ai.test(i.trim());
|
|
1685
1685
|
}
|
|
1686
|
-
function
|
|
1686
|
+
function Pi(i, t = {}) {
|
|
1687
1687
|
if (typeof i != "string") return i;
|
|
1688
|
-
const e = i.trim(), s =
|
|
1688
|
+
const e = i.trim(), s = Mi.exec(e);
|
|
1689
1689
|
if (s) {
|
|
1690
1690
|
const [, r, o] = s, a = t.base ?? 0, c = Number.parseFloat(o);
|
|
1691
1691
|
switch (r) {
|
|
@@ -1699,66 +1699,66 @@ function Si(i, t = {}) {
|
|
|
1699
1699
|
return c === 0 ? a : a / c;
|
|
1700
1700
|
}
|
|
1701
1701
|
}
|
|
1702
|
-
const n =
|
|
1702
|
+
const n = Ai.exec(e);
|
|
1703
1703
|
if (n) {
|
|
1704
1704
|
if (!t.random)
|
|
1705
1705
|
throw new Error(
|
|
1706
1706
|
`resolveValue: "${e}" needs a random source — pass one via context.random`
|
|
1707
1707
|
);
|
|
1708
1708
|
const r = Number.parseFloat(n[1]), o = Number.parseFloat(n[2]), a = n[3] !== void 0 ? Number.parseFloat(n[3]) : void 0;
|
|
1709
|
-
return a !== void 0 ?
|
|
1709
|
+
return a !== void 0 ? Js(t.random, r, o, a) : Si(t.random, r, o);
|
|
1710
1710
|
}
|
|
1711
1711
|
return i;
|
|
1712
1712
|
}
|
|
1713
|
-
function
|
|
1713
|
+
function tn(i, t = 0, e) {
|
|
1714
1714
|
const s = [];
|
|
1715
1715
|
let n = t;
|
|
1716
1716
|
for (const r of i) {
|
|
1717
|
-
const o =
|
|
1717
|
+
const o = Pi(r, { base: n, random: e });
|
|
1718
1718
|
s.push(o), typeof o == "number" && (n = o);
|
|
1719
1719
|
}
|
|
1720
1720
|
return s;
|
|
1721
1721
|
}
|
|
1722
|
-
class
|
|
1722
|
+
class Po {
|
|
1723
1723
|
random;
|
|
1724
1724
|
constructor(t) {
|
|
1725
|
-
this.random =
|
|
1725
|
+
this.random = Qs(t);
|
|
1726
1726
|
}
|
|
1727
1727
|
/** The seed, to be stored alongside the timeline so this can be reproduced. */
|
|
1728
1728
|
get seed() {
|
|
1729
1729
|
return this.random.seed;
|
|
1730
1730
|
}
|
|
1731
1731
|
resolve(t, e = 0) {
|
|
1732
|
-
return
|
|
1732
|
+
return Pi(t, { base: e, random: this.random });
|
|
1733
1733
|
}
|
|
1734
1734
|
resolveSequence(t, e = 0) {
|
|
1735
|
-
return
|
|
1735
|
+
return tn(t, e, this.random);
|
|
1736
1736
|
}
|
|
1737
1737
|
}
|
|
1738
|
-
const
|
|
1739
|
-
function
|
|
1738
|
+
const en = 600;
|
|
1739
|
+
function sn(i) {
|
|
1740
1740
|
if (Array.isArray(i)) {
|
|
1741
1741
|
const [u, d, m, p] = i;
|
|
1742
|
-
return { fn:
|
|
1742
|
+
return { fn: Le(u, d, m, p), bezier: [u, d, m, p] };
|
|
1743
1743
|
}
|
|
1744
|
-
const { segments: t } =
|
|
1744
|
+
const { segments: t } = nt(i);
|
|
1745
1745
|
if (t.length === 0) throw new Error(`customEase: no curve in "${i}"`);
|
|
1746
1746
|
const e = t[0].startX, s = t[0].startY, n = t[t.length - 1], r = n.endX - e, o = n.endY - s;
|
|
1747
1747
|
if (r === 0 || o === 0) throw new Error(`customEase: "${i}" must move along both axes`);
|
|
1748
1748
|
const a = (u) => (u - e) / r, c = (u) => (u - s) / o;
|
|
1749
1749
|
if (t.length === 1 && n.type === "C") {
|
|
1750
1750
|
const [u, d, m, p] = n.points, g = [a(u), c(d), a(m), c(p)];
|
|
1751
|
-
return { fn:
|
|
1751
|
+
return { fn: Le(...g), bezier: g };
|
|
1752
1752
|
}
|
|
1753
|
-
const l = [], h = [], f = Math.max(8, Math.ceil(
|
|
1753
|
+
const l = [], h = [], f = Math.max(8, Math.ceil(en / t.length));
|
|
1754
1754
|
for (const u of t)
|
|
1755
1755
|
for (let d = l.length === 0 ? 0 : 1; d <= f; d++) {
|
|
1756
|
-
const [m, p] =
|
|
1756
|
+
const [m, p] = on(u, d / f);
|
|
1757
1757
|
l.push(a(m)), h.push(c(p));
|
|
1758
1758
|
}
|
|
1759
|
-
return { fn:
|
|
1759
|
+
return { fn: an(l, h) };
|
|
1760
1760
|
}
|
|
1761
|
-
function
|
|
1761
|
+
function nn(i = {}) {
|
|
1762
1762
|
const e = 0.1 + Math.max(0, Math.min(1, i.strength ?? 0.7)) * 0.7, s = [1];
|
|
1763
1763
|
for (let r = e; r > 2e-3; r *= e) s.push(2 * Math.sqrt(r));
|
|
1764
1764
|
const n = s.reduce((r, o) => r + o, 0);
|
|
@@ -1777,11 +1777,11 @@ function tn(i = {}) {
|
|
|
1777
1777
|
return 1;
|
|
1778
1778
|
};
|
|
1779
1779
|
}
|
|
1780
|
-
function
|
|
1780
|
+
function rn(i = {}) {
|
|
1781
1781
|
const t = Math.max(1, i.wiggles ?? 10), e = i.type ?? "easeOut", s = (n) => e === "uniform" ? 1 : e === "easeInOut" ? Math.sin(Math.PI * n) : (1 - n) ** 2;
|
|
1782
1782
|
return (n) => n <= 0 || n >= 1 ? 0 : Math.sin(n * t * Math.PI * 2) * s(n);
|
|
1783
1783
|
}
|
|
1784
|
-
function
|
|
1784
|
+
function on(i, t) {
|
|
1785
1785
|
if (i.type === "L") {
|
|
1786
1786
|
const [l, h] = i.points;
|
|
1787
1787
|
return [i.startX + (l - i.startX) * t, i.startY + (h - i.startY) * t];
|
|
@@ -1792,7 +1792,7 @@ function sn(i, t) {
|
|
|
1792
1792
|
c * c * c * i.startY + 3 * c * c * t * s + 3 * c * t * t * r + t * t * t * a
|
|
1793
1793
|
];
|
|
1794
1794
|
}
|
|
1795
|
-
function
|
|
1795
|
+
function an(i, t) {
|
|
1796
1796
|
return (e) => {
|
|
1797
1797
|
if (e <= i[0]) return t[0];
|
|
1798
1798
|
if (e >= i[i.length - 1]) return t[t.length - 1];
|
|
@@ -1805,7 +1805,7 @@ function nn(i, t) {
|
|
|
1805
1805
|
return r === 0 ? t[n] : t[s] + (e - i[s]) / r * (t[n] - t[s]);
|
|
1806
1806
|
};
|
|
1807
1807
|
}
|
|
1808
|
-
function
|
|
1808
|
+
function Le(i, t, e, s) {
|
|
1809
1809
|
const n = (o, a, c) => 3 * (1 - o) * (1 - o) * o * a + 3 * (1 - o) * o * o * c + o * o * o, r = (o, a, c) => 3 * (1 - o) * (1 - o) * a + 6 * (1 - o) * o * (c - a) + 3 * o * o * (1 - c);
|
|
1810
1810
|
return (o) => {
|
|
1811
1811
|
if (o <= 0) return 0;
|
|
@@ -1824,53 +1824,53 @@ function Ie(i, t, e, s) {
|
|
|
1824
1824
|
return n(a, t, s);
|
|
1825
1825
|
};
|
|
1826
1826
|
}
|
|
1827
|
-
const
|
|
1828
|
-
function
|
|
1827
|
+
const q = (i) => Math.round(i * 1e3) / 1e3;
|
|
1828
|
+
function cn(i, t = {}) {
|
|
1829
1829
|
if (i.length === 0) return "";
|
|
1830
1830
|
const e = t.curviness ?? 1, s = t.closed ?? !1, n = i.length;
|
|
1831
|
-
let r = `M${
|
|
1831
|
+
let r = `M${q(i[0].x)} ${q(i[0].y)}`;
|
|
1832
1832
|
if (n === 1) return r;
|
|
1833
1833
|
const o = (c) => s ? i[(c % n + n) % n] : i[Math.max(0, Math.min(n - 1, c))], a = s ? n : n - 1;
|
|
1834
1834
|
for (let c = 0; c < a; c++) {
|
|
1835
1835
|
const l = o(c - 1), h = o(c), f = o(c + 1), u = o(c + 2);
|
|
1836
1836
|
if (e === 0) {
|
|
1837
|
-
r += ` L${
|
|
1837
|
+
r += ` L${q(f.x)} ${q(f.y)}`;
|
|
1838
1838
|
continue;
|
|
1839
1839
|
}
|
|
1840
1840
|
const d = e / 6, m = h.x + (f.x - l.x) * d, p = h.y + (f.y - l.y) * d, g = f.x - (u.x - h.x) * d, y = f.y - (u.y - h.y) * d;
|
|
1841
|
-
r += ` C${
|
|
1841
|
+
r += ` C${q(m)} ${q(p)} ${q(g)} ${q(y)} ${q(f.x)} ${q(f.y)}`;
|
|
1842
1842
|
}
|
|
1843
1843
|
return s ? `${r} Z` : r;
|
|
1844
1844
|
}
|
|
1845
|
-
const
|
|
1845
|
+
const F = (i, t = 0) => {
|
|
1846
1846
|
const e = parseFloat(i ?? "");
|
|
1847
1847
|
return Number.isFinite(e) ? e : t;
|
|
1848
1848
|
};
|
|
1849
|
-
function
|
|
1849
|
+
function ln(i) {
|
|
1850
1850
|
const t = (i ?? "").trim().split(/[\s,]+/).filter(Boolean).map(Number), e = [];
|
|
1851
1851
|
for (let s = 0; s + 1 < t.length; s += 2) e.push({ x: t[s], y: t[s + 1] });
|
|
1852
1852
|
return e;
|
|
1853
1853
|
}
|
|
1854
|
-
function
|
|
1854
|
+
function pe(i) {
|
|
1855
1855
|
const t = i.attributes;
|
|
1856
1856
|
switch (i.tag.toLowerCase()) {
|
|
1857
1857
|
case "path":
|
|
1858
1858
|
return t.d ?? null;
|
|
1859
1859
|
case "circle":
|
|
1860
1860
|
case "ellipse": {
|
|
1861
|
-
const e =
|
|
1861
|
+
const e = F(t.cx), s = F(t.cy), n = i.tag.toLowerCase() === "circle" ? F(t.r) : F(t.rx), r = i.tag.toLowerCase() === "circle" ? F(t.r) : F(t.ry);
|
|
1862
1862
|
return `M${e + n} ${s} A${n} ${r} 0 1 1 ${e - n} ${s} A${n} ${r} 0 1 1 ${e + n} ${s} Z`;
|
|
1863
1863
|
}
|
|
1864
1864
|
case "rect": {
|
|
1865
|
-
const e =
|
|
1866
|
-
let o = t.rx != null ?
|
|
1865
|
+
const e = F(t.x), s = F(t.y), n = F(t.width), r = F(t.height);
|
|
1866
|
+
let o = t.rx != null ? F(t.rx) : t.ry != null ? F(t.ry) : 0, a = t.ry != null ? F(t.ry) : o;
|
|
1867
1867
|
return o = Math.min(o, n / 2), a = Math.min(a, r / 2), o === 0 || a === 0 ? `M${e} ${s} H${e + n} V${s + r} H${e} Z` : `M${e + o} ${s} H${e + n - o} A${o} ${a} 0 0 1 ${e + n} ${s + a} V${s + r - a} A${o} ${a} 0 0 1 ${e + n - o} ${s + r} H${e + o} A${o} ${a} 0 0 1 ${e} ${s + r - a} V${s + a} A${o} ${a} 0 0 1 ${e + o} ${s} Z`;
|
|
1868
1868
|
}
|
|
1869
1869
|
case "line":
|
|
1870
|
-
return `M${
|
|
1870
|
+
return `M${F(t.x1)} ${F(t.y1)} L${F(t.x2)} ${F(t.y2)}`;
|
|
1871
1871
|
case "polyline":
|
|
1872
1872
|
case "polygon": {
|
|
1873
|
-
const e =
|
|
1873
|
+
const e = ln(t.points);
|
|
1874
1874
|
if (e.length === 0) return null;
|
|
1875
1875
|
const s = e.map((n, r) => `${r === 0 ? "M" : "L"}${n.x} ${n.y}`).join(" ");
|
|
1876
1876
|
return i.tag.toLowerCase() === "polygon" ? `${s} Z` : s;
|
|
@@ -1879,7 +1879,7 @@ function fe(i) {
|
|
|
1879
1879
|
return null;
|
|
1880
1880
|
}
|
|
1881
1881
|
}
|
|
1882
|
-
const
|
|
1882
|
+
const kt = {
|
|
1883
1883
|
"power1.in": [0.55, 0.085, 0.68, 0.53],
|
|
1884
1884
|
"power1.out": [0.25, 0.46, 0.45, 0.94],
|
|
1885
1885
|
"power1.inout": [0.455, 0.03, 0.515, 0.955],
|
|
@@ -1904,7 +1904,7 @@ const St = {
|
|
|
1904
1904
|
"back.in": [0.6, -0.28, 0.735, 0.045],
|
|
1905
1905
|
"back.out": [0.175, 0.885, 0.32, 1.275],
|
|
1906
1906
|
"back.inout": [0.68, -0.55, 0.265, 1.55]
|
|
1907
|
-
},
|
|
1907
|
+
}, De = {
|
|
1908
1908
|
none: "linear",
|
|
1909
1909
|
linear: "linear",
|
|
1910
1910
|
"linear.none": "linear",
|
|
@@ -1916,7 +1916,7 @@ const St = {
|
|
|
1916
1916
|
"power2.out": "ease-out-cubic",
|
|
1917
1917
|
"power2.inout": "ease-in-out-cubic"
|
|
1918
1918
|
};
|
|
1919
|
-
function
|
|
1919
|
+
function hn(i) {
|
|
1920
1920
|
let t = i.trim().toLowerCase();
|
|
1921
1921
|
t = t.replace(/\.ease(in|out|inout)$/, ".$1");
|
|
1922
1922
|
const e = /^([a-z]+\d?)(\(.*\))?$/.exec(t);
|
|
@@ -1924,10 +1924,10 @@ function an(i) {
|
|
|
1924
1924
|
}
|
|
1925
1925
|
W({ type: "bounce", mode: "in" });
|
|
1926
1926
|
W({ type: "bounce", mode: "in-out" });
|
|
1927
|
-
function
|
|
1928
|
-
const t =
|
|
1927
|
+
function It(i) {
|
|
1928
|
+
const t = Ei.get(i.trim().toLowerCase());
|
|
1929
1929
|
if (t) return t;
|
|
1930
|
-
const e =
|
|
1930
|
+
const e = hn(i), s = /^steps\(\s*(\d+)\s*\)$/.exec(e);
|
|
1931
1931
|
if (s) {
|
|
1932
1932
|
const o = { type: "steps", count: Math.max(1, Number.parseInt(s[1], 10)) + 1, position: "none" };
|
|
1933
1933
|
return { easing: o, fn: W(o) };
|
|
@@ -1935,21 +1935,21 @@ function Rt(i) {
|
|
|
1935
1935
|
const n = /^(elastic|bounce|back)\.(in|out|inout)(?:\(([^)]*)\))?$/.exec(e);
|
|
1936
1936
|
if (n) {
|
|
1937
1937
|
const [, r, o, a] = n, c = (a ?? "").split(",").map((f) => Number.parseFloat(f)).filter((f) => Number.isFinite(f)), l = o === "inout" ? "in-out" : o;
|
|
1938
|
-
if (r === "back" && c.length === 0 && e in
|
|
1939
|
-
return { easing: { type: "cubic-bezier", points:
|
|
1938
|
+
if (r === "back" && c.length === 0 && e in kt)
|
|
1939
|
+
return { easing: { type: "cubic-bezier", points: kt[e] } };
|
|
1940
1940
|
const h = r === "elastic" ? { type: "elastic", mode: l, ...c[0] !== void 0 && { amplitude: c[0] }, ...c[1] !== void 0 && { period: c[1] } } : r === "bounce" ? { type: "bounce", mode: l } : { type: "back", mode: l, ...c[0] !== void 0 && { overshoot: c[0] } };
|
|
1941
1941
|
return { easing: h, fn: W(h) };
|
|
1942
1942
|
}
|
|
1943
|
-
return e in
|
|
1943
|
+
return e in De ? { easing: De[e] } : e in kt ? { easing: { type: "cubic-bezier", points: kt[e] } } : { easing: "ease-out" };
|
|
1944
1944
|
}
|
|
1945
|
-
const
|
|
1946
|
-
function
|
|
1947
|
-
return
|
|
1945
|
+
const Ei = /* @__PURE__ */ new Map();
|
|
1946
|
+
function me(i, t) {
|
|
1947
|
+
return Ei.set(
|
|
1948
1948
|
i.trim().toLowerCase(),
|
|
1949
1949
|
t.bezier ? { easing: { type: "cubic-bezier", points: t.bezier }, fn: t.fn } : { fn: t.fn, requiresBaking: "custom" }
|
|
1950
1950
|
), i;
|
|
1951
1951
|
}
|
|
1952
|
-
function
|
|
1952
|
+
function ae(i) {
|
|
1953
1953
|
let t = i >>> 0;
|
|
1954
1954
|
return () => {
|
|
1955
1955
|
t = t + 1831565813 >>> 0;
|
|
@@ -1957,16 +1957,16 @@ function re(i) {
|
|
|
1957
1957
|
return e = Math.imul(e ^ e >>> 15, e | 1), e ^= e + Math.imul(e ^ e >>> 7, e | 61), ((e ^ e >>> 14) >>> 0) / 4294967296;
|
|
1958
1958
|
};
|
|
1959
1959
|
}
|
|
1960
|
-
const
|
|
1961
|
-
function
|
|
1962
|
-
return typeof i == "string" &&
|
|
1960
|
+
const _i = /^\s*random\(\s*(\[.*\]|[^)]*)\s*\)\s*$/;
|
|
1961
|
+
function Ci(i) {
|
|
1962
|
+
return typeof i == "string" && _i.test(i);
|
|
1963
1963
|
}
|
|
1964
|
-
function
|
|
1965
|
-
let t =
|
|
1964
|
+
function un(i = 1) {
|
|
1965
|
+
let t = ae(i);
|
|
1966
1966
|
const e = (c, l) => ((...h) => h.length >= c ? l(...h) : (f) => l(...h, f)), s = (c, l, h) => Math.min(Math.max(h, Math.min(c, l)), Math.max(c, l)), n = (c, l, h, f, u) => l === c ? h : h + (u - c) / (l - c) * (f - h), r = (c, l) => {
|
|
1967
1967
|
if (typeof c == "number") return c === 0 ? l : Math.round(l / c) * c;
|
|
1968
|
-
if (Array.isArray(c)) return
|
|
1969
|
-
if ("values" in c) return
|
|
1968
|
+
if (Array.isArray(c)) return Oe(c, l, 1 / 0);
|
|
1969
|
+
if ("values" in c) return Oe(c.values, l, c.radius ?? 1 / 0);
|
|
1970
1970
|
const h = Math.round(l / c.increment) * c.increment;
|
|
1971
1971
|
return Math.abs(h - l) <= (c.radius ?? 1 / 0) ? h : l;
|
|
1972
1972
|
}, o = (c, l, h) => {
|
|
@@ -1981,10 +1981,10 @@ function cn(i = 1) {
|
|
|
1981
1981
|
if (typeof c == "object" && !Array.isArray(c)) {
|
|
1982
1982
|
const f = {};
|
|
1983
1983
|
for (const u of Object.keys(c))
|
|
1984
|
-
f[u] =
|
|
1984
|
+
f[u] = Rt(c[u])(c[u], l[u], h);
|
|
1985
1985
|
return f;
|
|
1986
1986
|
}
|
|
1987
|
-
return
|
|
1987
|
+
return Rt(c)(c, l, h);
|
|
1988
1988
|
}),
|
|
1989
1989
|
wrap: ((c, l, h) => {
|
|
1990
1990
|
if (Array.isArray(c)) {
|
|
@@ -2017,17 +2017,17 @@ function cn(i = 1) {
|
|
|
2017
2017
|
return c;
|
|
2018
2018
|
},
|
|
2019
2019
|
distribute: ({ base: c = 0, amount: l, each: h, from: f = "start", ease: u }) => (d, m, p) => {
|
|
2020
|
-
const g = p.length, b =
|
|
2021
|
-
return c +
|
|
2020
|
+
const g = p.length, b = de(d, g, { ...l !== void 0 ? { amount: l } : { each: h ?? 1 }, from: f }), v = l !== void 0 ? l : (h ?? 1) * li(g, f), T = u && v > 0 ? u(b / v) * v : b;
|
|
2021
|
+
return c + T;
|
|
2022
2022
|
},
|
|
2023
2023
|
pipe: (...c) => (l) => c.reduce((h, f) => f(h), l),
|
|
2024
|
-
splitColor: (c) =>
|
|
2024
|
+
splitColor: (c) => fn(c),
|
|
2025
2025
|
getUnit: (c) => typeof c == "number" ? "" : /^-?[\d.]+(?:e[-+]?\d+)?([a-z%]*)$/i.exec(c.trim())?.[1] ?? "",
|
|
2026
2026
|
seed: (c) => {
|
|
2027
|
-
t =
|
|
2027
|
+
t = ae(c);
|
|
2028
2028
|
},
|
|
2029
2029
|
resolveRandomString: (c) => {
|
|
2030
|
-
const l =
|
|
2030
|
+
const l = _i.exec(c)?.[1] ?? "";
|
|
2031
2031
|
if (l.startsWith("[")) {
|
|
2032
2032
|
const m = l.slice(1, -1).split(",").map((p) => p.trim()).filter(Boolean).map((p) => Number.isFinite(Number(p)) ? Number(p) : p.replace(/^['"]|['"]$/g, ""));
|
|
2033
2033
|
return m[Math.floor(t() * m.length)];
|
|
@@ -2037,7 +2037,7 @@ function cn(i = 1) {
|
|
|
2037
2037
|
}
|
|
2038
2038
|
};
|
|
2039
2039
|
}
|
|
2040
|
-
function
|
|
2040
|
+
function Oe(i, t, e) {
|
|
2041
2041
|
let s = t, n = 1 / 0;
|
|
2042
2042
|
for (const r of i) {
|
|
2043
2043
|
const o = Math.abs(r - t);
|
|
@@ -2045,7 +2045,7 @@ function Fe(i, t, e) {
|
|
|
2045
2045
|
}
|
|
2046
2046
|
return n <= e ? s : t;
|
|
2047
2047
|
}
|
|
2048
|
-
function
|
|
2048
|
+
function fn(i) {
|
|
2049
2049
|
const t = i.trim(), e = /^#([0-9a-f]{3,8})$/i.exec(t)?.[1];
|
|
2050
2050
|
if (e) {
|
|
2051
2051
|
const r = (e.length <= 4 ? [...e].map((o) => o + o).join("") : e).match(/../g).map((o) => Number.parseInt(o, 16));
|
|
@@ -2054,19 +2054,19 @@ function ln(i) {
|
|
|
2054
2054
|
const s = (/rgba?\(([^)]+)\)/i.exec(t)?.[1] ?? "0,0,0").split(/[\s,/]+/).filter(Boolean).map((n) => Number.parseFloat(n));
|
|
2055
2055
|
return s.length >= 4 ? [s[0], s[1], s[2], s[3]] : [s[0] ?? 0, s[1] ?? 0, s[2] ?? 0];
|
|
2056
2056
|
}
|
|
2057
|
-
const
|
|
2058
|
-
function
|
|
2057
|
+
const dn = /^([+-])=\s*(-?[\d.]+)$/, pn = /^([<>])\s*(?:([+-])?=?\s*(-?[\d.]+))?$/;
|
|
2058
|
+
function ht(i, t) {
|
|
2059
2059
|
const e = t.scale ?? 1, s = (l) => Number.parseFloat(l) * e;
|
|
2060
2060
|
if (i === void 0) return t.cursor;
|
|
2061
2061
|
if (typeof i == "number") return i * e;
|
|
2062
2062
|
const n = i.trim();
|
|
2063
2063
|
if (n === "") return t.cursor;
|
|
2064
|
-
const r =
|
|
2064
|
+
const r = dn.exec(n);
|
|
2065
2065
|
if (r) {
|
|
2066
2066
|
const l = s(r[2]);
|
|
2067
2067
|
return t.cursor + (r[1] === "-" ? -l : l);
|
|
2068
2068
|
}
|
|
2069
|
-
const o =
|
|
2069
|
+
const o = pn.exec(n);
|
|
2070
2070
|
if (o) {
|
|
2071
2071
|
const l = o[1] === "<" ? t.previousStart : t.previousEnd;
|
|
2072
2072
|
if (o[3] === void 0) return l;
|
|
@@ -2084,12 +2084,12 @@ function lt(i, t) {
|
|
|
2084
2084
|
const c = t.labels.get(n);
|
|
2085
2085
|
return c !== void 0 ? c : /^-?[\d.]+$/.test(n) ? s(n) : t.cursor;
|
|
2086
2086
|
}
|
|
2087
|
-
function
|
|
2087
|
+
function mn(i) {
|
|
2088
2088
|
if (typeof i != "object" || i === null) return !1;
|
|
2089
2089
|
const t = i;
|
|
2090
2090
|
return t.grid !== void 0 || t.from === "random" || Array.isArray(t.from) || t.ease !== void 0 || t.axis !== void 0;
|
|
2091
2091
|
}
|
|
2092
|
-
function
|
|
2092
|
+
function gn(i, t, e = {}) {
|
|
2093
2093
|
if (i === 0) return [];
|
|
2094
2094
|
const s = t.grid === "auto" ? Math.max(1, Math.min(i, e.columnsFromLayout?.() ?? i)) : Array.isArray(t.grid) ? Math.max(1, t.grid[1]) : i, n = Array.isArray(t.grid) ? Math.max(1, t.grid[0]) : Math.ceil(i / s), r = (m) => ({ x: m % s, y: Math.floor(m / s) }), o = t.from ?? "start", a = Array.isArray(o) ? { x: o[0] * (s - 1), y: o[1] * (n - 1) } : typeof o == "number" ? r(Math.max(0, Math.min(i - 1, o))) : o === "end" ? r(i - 1) : o === "center" || o === "edges" ? { x: (s - 1) / 2, y: (n - 1) / 2 } : { x: 0, y: 0 }, c = (m) => {
|
|
2095
2095
|
const { x: p, y: g } = r(m), y = Math.abs(p - a.x), b = Math.abs(g - a.y);
|
|
@@ -2101,13 +2101,13 @@ function dn(i, t, e = {}) {
|
|
|
2101
2101
|
const m = e.random ?? Math.random;
|
|
2102
2102
|
l = l.map(() => m() * h);
|
|
2103
2103
|
}
|
|
2104
|
-
const f = t.amount !== void 0 ? t.amount : (t.each ?? 0) * h, u = t.ease ?
|
|
2104
|
+
const f = t.amount !== void 0 ? t.amount : (t.each ?? 0) * h, u = t.ease ? It(t.ease) : void 0, d = u ? u.fn ?? W(u.easing) : void 0;
|
|
2105
2105
|
return l.map((m) => {
|
|
2106
2106
|
const p = h === 0 ? 0 : m / h;
|
|
2107
2107
|
return (d ? d(p) : p) * f;
|
|
2108
2108
|
});
|
|
2109
2109
|
}
|
|
2110
|
-
const
|
|
2110
|
+
const ge = /* @__PURE__ */ new Set([
|
|
2111
2111
|
"duration",
|
|
2112
2112
|
"delay",
|
|
2113
2113
|
"ease",
|
|
@@ -2131,24 +2131,24 @@ const pe = /* @__PURE__ */ new Set([
|
|
|
2131
2131
|
"scrollTrigger",
|
|
2132
2132
|
"spring"
|
|
2133
2133
|
]);
|
|
2134
|
-
function
|
|
2134
|
+
function Pt(i) {
|
|
2135
2135
|
const t = {}, e = {};
|
|
2136
2136
|
for (const [s, n] of Object.entries(i))
|
|
2137
|
-
|
|
2137
|
+
ge.has(s) ? t[s] = n : e[s] = n;
|
|
2138
2138
|
return { config: t, properties: e };
|
|
2139
2139
|
}
|
|
2140
|
-
function
|
|
2140
|
+
function $t(i, t) {
|
|
2141
2141
|
return i === void 0 ? t : i * 1e3;
|
|
2142
2142
|
}
|
|
2143
|
-
function
|
|
2143
|
+
function ce(i, t) {
|
|
2144
2144
|
if (i !== void 0)
|
|
2145
|
-
return typeof i == "number" ? { each: i * 1e3 } :
|
|
2145
|
+
return typeof i == "number" ? { each: i * 1e3 } : mn(i) ? { offsets: gn(t?.count ?? 0, i, t ?? {}).map((s) => s * 1e3) } : {
|
|
2146
2146
|
...i.each !== void 0 && { each: i.each * 1e3 },
|
|
2147
2147
|
...i.amount !== void 0 && { amount: i.amount * 1e3 },
|
|
2148
2148
|
...i.from !== void 0 && { from: i.from }
|
|
2149
2149
|
};
|
|
2150
2150
|
}
|
|
2151
|
-
const
|
|
2151
|
+
const yn = {
|
|
2152
2152
|
opacity: 1,
|
|
2153
2153
|
x: 0,
|
|
2154
2154
|
y: 0,
|
|
@@ -2174,17 +2174,17 @@ const pn = {
|
|
|
2174
2174
|
clipBottom: 0,
|
|
2175
2175
|
clipLeft: 0
|
|
2176
2176
|
};
|
|
2177
|
-
function
|
|
2178
|
-
return
|
|
2177
|
+
function Ri(i) {
|
|
2178
|
+
return yn[i];
|
|
2179
2179
|
}
|
|
2180
|
-
function
|
|
2180
|
+
function bn(i) {
|
|
2181
2181
|
const t = typeof i == "string" || Array.isArray(i) ? { path: i } : i;
|
|
2182
2182
|
if (!t || typeof t.path != "string" && !Array.isArray(t.path))
|
|
2183
2183
|
throw new Error("gsap-compat: motionPath needs a path — SVG path data or an array of { x, y } points.");
|
|
2184
2184
|
let e;
|
|
2185
2185
|
if (Array.isArray(t.path))
|
|
2186
|
-
e =
|
|
2187
|
-
else if (
|
|
2186
|
+
e = cn(t.path, { curviness: t.curviness });
|
|
2187
|
+
else if (vt(t.path))
|
|
2188
2188
|
e = t.path;
|
|
2189
2189
|
else
|
|
2190
2190
|
throw new Error(
|
|
@@ -2193,61 +2193,61 @@ function mn(i) {
|
|
|
2193
2193
|
const s = { pathData: e };
|
|
2194
2194
|
return t.autoRotate !== void 0 && t.autoRotate !== !1 && (s.autoRotate = !0, typeof t.autoRotate == "number" && (s.rotateOffset = t.autoRotate)), t.matrix && (s.matrix = t.matrix), { config: s, start: t.start ?? 0, end: t.end ?? 1 };
|
|
2195
2195
|
}
|
|
2196
|
-
function
|
|
2196
|
+
function vn(i) {
|
|
2197
2197
|
const t = typeof i == "string" || Array.isArray(i) ? { path: i } : { ...i };
|
|
2198
2198
|
return { ...t, start: t.end ?? 1, end: t.start ?? 0 };
|
|
2199
2199
|
}
|
|
2200
|
-
function
|
|
2200
|
+
function Ii(i) {
|
|
2201
2201
|
return typeof i == "object" && i !== null && "shape" in i ? i.shape : i;
|
|
2202
2202
|
}
|
|
2203
|
-
function
|
|
2203
|
+
function wn(i) {
|
|
2204
2204
|
if (i.morphSVG === void 0) return i;
|
|
2205
|
-
const { morphSVG: t, ...e } = i, s =
|
|
2206
|
-
if (typeof s != "string" || !
|
|
2205
|
+
const { morphSVG: t, ...e } = i, s = Ii(t);
|
|
2206
|
+
if (typeof s != "string" || !vt(s))
|
|
2207
2207
|
throw new Error(
|
|
2208
2208
|
`gsap-compat: morphSVG "${String(s)}" is not path data. Selectors and elements are resolved by live.to(); timeline() and tf need the path data itself.`
|
|
2209
2209
|
);
|
|
2210
2210
|
return { ...e, d: s };
|
|
2211
2211
|
}
|
|
2212
|
-
function
|
|
2212
|
+
function Tn(i, t) {
|
|
2213
2213
|
if (i === !0) return [0, t];
|
|
2214
2214
|
if (i === !1) return [0, 0];
|
|
2215
|
-
if (typeof i == "number") return [0,
|
|
2215
|
+
if (typeof i == "number") return [0, Be(i, t)];
|
|
2216
2216
|
const e = i.trim().split(/[\s,]+/).filter(Boolean), s = (o) => {
|
|
2217
2217
|
const a = Number.parseFloat(o);
|
|
2218
2218
|
if (Number.isNaN(a)) throw new Error(`gsap-compat: drawSVG "${i}" is not a length or percentage`);
|
|
2219
|
-
return
|
|
2219
|
+
return Be(o.endsWith("%") ? t * a / 100 : a, t);
|
|
2220
2220
|
};
|
|
2221
2221
|
if (e.length === 0) return [0, t];
|
|
2222
2222
|
if (e.length === 1) return [0, s(e[0])];
|
|
2223
2223
|
const n = s(e[0]), r = s(e[1]);
|
|
2224
2224
|
return n <= r ? [n, r] : [r, n];
|
|
2225
2225
|
}
|
|
2226
|
-
function
|
|
2227
|
-
const [e, s] =
|
|
2226
|
+
function xn(i, t) {
|
|
2227
|
+
const [e, s] = Tn(i, t);
|
|
2228
2228
|
return { strokeDasharray: [s - e, t], strokeDashoffset: -e };
|
|
2229
2229
|
}
|
|
2230
|
-
function
|
|
2230
|
+
function kn(i, t) {
|
|
2231
2231
|
if (i.drawSVG === void 0) return i;
|
|
2232
2232
|
const { drawSVG: e, ...s } = i;
|
|
2233
|
-
return { ...s, ...
|
|
2233
|
+
return { ...s, ...xn(e, t) };
|
|
2234
2234
|
}
|
|
2235
|
-
function
|
|
2235
|
+
function Sn(i) {
|
|
2236
2236
|
if (i.drawSVG !== void 0)
|
|
2237
2237
|
throw new Error(
|
|
2238
2238
|
"gsap-compat: drawSVG needs the stroke length from the page. Use live.to(), or animate strokeDasharray / strokeDashoffset directly (see drawSvgProperties)."
|
|
2239
2239
|
);
|
|
2240
2240
|
return i;
|
|
2241
2241
|
}
|
|
2242
|
-
function
|
|
2242
|
+
function Be(i, t) {
|
|
2243
2243
|
return Math.max(0, Math.min(t, i));
|
|
2244
2244
|
}
|
|
2245
|
-
function
|
|
2245
|
+
function Mn(i) {
|
|
2246
2246
|
let t = 2166136261;
|
|
2247
2247
|
for (let e = 0; e < i.length; e++) t = Math.imul(t ^ i.charCodeAt(e), 16777619);
|
|
2248
2248
|
return t >>> 0;
|
|
2249
2249
|
}
|
|
2250
|
-
function
|
|
2250
|
+
function An(i, t, e) {
|
|
2251
2251
|
if (i.scrambleText !== void 0) {
|
|
2252
2252
|
const s = i.scrambleText, n = typeof s == "string" ? { text: s } : s;
|
|
2253
2253
|
if (typeof n?.text != "string")
|
|
@@ -2261,7 +2261,7 @@ function Sn(i, t, e) {
|
|
|
2261
2261
|
...r !== void 0 && { revealDelay: Math.min(r, 0.999) },
|
|
2262
2262
|
...n.tweenLength !== void 0 && { tweenLength: n.tweenLength },
|
|
2263
2263
|
...n.rightToLeft !== void 0 && { rightToLeft: n.rightToLeft },
|
|
2264
|
-
seed: n.seed ??
|
|
2264
|
+
seed: n.seed ?? Mn(`${t}|${n.text}`)
|
|
2265
2265
|
};
|
|
2266
2266
|
}
|
|
2267
2267
|
if (i.text !== void 0) {
|
|
@@ -2275,47 +2275,47 @@ function Sn(i, t, e) {
|
|
|
2275
2275
|
};
|
|
2276
2276
|
}
|
|
2277
2277
|
}
|
|
2278
|
-
function
|
|
2278
|
+
function ye(i) {
|
|
2279
2279
|
return Math.max(0.1, i / 25);
|
|
2280
2280
|
}
|
|
2281
|
-
function
|
|
2281
|
+
function Pn(i, t) {
|
|
2282
2282
|
const e = typeof t == "number" ? { velocity: t } : t;
|
|
2283
2283
|
if (typeof e?.velocity != "number" || !Number.isFinite(e.velocity))
|
|
2284
2284
|
throw new Error("gsap-compat: inertia needs a velocity for each property — a number, or { velocity }.");
|
|
2285
|
-
const s = e.friction ?? (e.resistance !== void 0 ?
|
|
2285
|
+
const s = e.friction ?? (e.resistance !== void 0 ? ye(e.resistance) : void 0), n = {
|
|
2286
2286
|
from: i,
|
|
2287
2287
|
velocity: e.velocity,
|
|
2288
2288
|
...s !== void 0 && { friction: s },
|
|
2289
2289
|
...e.min !== void 0 && { min: e.min },
|
|
2290
2290
|
...e.max !== void 0 && { max: e.max }
|
|
2291
2291
|
};
|
|
2292
|
-
return typeof e.end == "function" ? n.end = [e.end(
|
|
2292
|
+
return typeof e.end == "function" ? n.end = [e.end(Ct(n))] : e.end !== void 0 && (n.end = Array.isArray(e.end) ? [...e.end] : e.end), n;
|
|
2293
2293
|
}
|
|
2294
|
-
function
|
|
2294
|
+
function En(i) {
|
|
2295
2295
|
const t = i === !0 ? {} : typeof i == "string" ? { preset: i } : i;
|
|
2296
|
-
if (t.preset !== void 0 && !(t.preset in
|
|
2296
|
+
if (t.preset !== void 0 && !(t.preset in Yt))
|
|
2297
2297
|
throw new Error(
|
|
2298
|
-
`gsap-compat: unknown spring preset "${t.preset}" — use one of ${Object.keys(
|
|
2298
|
+
`gsap-compat: unknown spring preset "${t.preset}" — use one of ${Object.keys(Yt).join(", ")}`
|
|
2299
2299
|
);
|
|
2300
2300
|
return {
|
|
2301
|
-
...t.preset ?
|
|
2301
|
+
...t.preset ? Yt[t.preset] : {},
|
|
2302
2302
|
...t.stiffness !== void 0 && { stiffness: t.stiffness },
|
|
2303
2303
|
...t.damping !== void 0 && { damping: t.damping },
|
|
2304
2304
|
...t.mass !== void 0 && { mass: t.mass },
|
|
2305
2305
|
...t.restDelta !== void 0 && { restDelta: t.restDelta }
|
|
2306
2306
|
};
|
|
2307
2307
|
}
|
|
2308
|
-
function
|
|
2308
|
+
function _n(i, t) {
|
|
2309
2309
|
if (i === !0 || typeof i == "string") return;
|
|
2310
2310
|
const e = i.velocity;
|
|
2311
2311
|
return typeof e == "number" ? e : e?.[t];
|
|
2312
2312
|
}
|
|
2313
|
-
class
|
|
2313
|
+
class st {
|
|
2314
2314
|
/** The engine timeline. Use it for anything the facade does not cover. */
|
|
2315
2315
|
timeline;
|
|
2316
2316
|
options;
|
|
2317
2317
|
cursor = 0;
|
|
2318
|
-
fallbackRandom =
|
|
2318
|
+
fallbackRandom = ae(1);
|
|
2319
2319
|
previousStart = 0;
|
|
2320
2320
|
previousEnd = 0;
|
|
2321
2321
|
labels = /* @__PURE__ */ new Map();
|
|
@@ -2323,7 +2323,7 @@ class et {
|
|
|
2323
2323
|
/** Last authored value per "target|property", for the resolution chain. */
|
|
2324
2324
|
lastValues = /* @__PURE__ */ new Map();
|
|
2325
2325
|
constructor(t = {}) {
|
|
2326
|
-
this.options = t, this.timeline = new
|
|
2326
|
+
this.options = t, this.timeline = new Ti({
|
|
2327
2327
|
// A timestamped default would make the same script compile to different
|
|
2328
2328
|
// JSON on every run, which breaks the determinism contract. Callers that
|
|
2329
2329
|
// need distinct ids pass one.
|
|
@@ -2340,25 +2340,25 @@ class et {
|
|
|
2340
2340
|
// --- tween creation -----------------------------------------------------
|
|
2341
2341
|
/** Animate to the given values. */
|
|
2342
2342
|
to(t, e, s) {
|
|
2343
|
-
return this.build(t, void 0,
|
|
2343
|
+
return this.build(t, void 0, ut(e), s);
|
|
2344
2344
|
}
|
|
2345
2345
|
/** Animate from the given values to where the property already is. */
|
|
2346
2346
|
from(t, e, s) {
|
|
2347
|
-
const { config: n, properties: r } =
|
|
2347
|
+
const { config: n, properties: r } = Pt(ut(e)), { motionPath: o, text: a, scrambleText: c, ...l } = r, h = this.targetsOf(t)[0], f = { ...n };
|
|
2348
2348
|
for (const m of Object.keys(l))
|
|
2349
2349
|
f[m] = this.resolveStart(h, m);
|
|
2350
|
-
o !== void 0 && (f.motionPath =
|
|
2350
|
+
o !== void 0 && (f.motionPath = vn(o));
|
|
2351
2351
|
const u = {}, d = String(this.resolveStart(h, "text"));
|
|
2352
|
-
return a !== void 0 && (u.text =
|
|
2352
|
+
return a !== void 0 && (u.text = Kt(a), f.text = typeof a == "object" ? { ...a, value: d } : d), c !== void 0 && (u.text = Kt(c), f.scrambleText = typeof c == "object" ? { ...c, text: d } : d), this.build(t, { ...l, ...u }, f, s);
|
|
2353
2353
|
}
|
|
2354
2354
|
/** Animate between two explicit sets of values. */
|
|
2355
2355
|
fromTo(t, e, s, n) {
|
|
2356
|
-
const { properties: r } =
|
|
2357
|
-
return this.build(t, r,
|
|
2356
|
+
const { properties: r } = Pt(ut(e));
|
|
2357
|
+
return this.build(t, r, ut(s), n);
|
|
2358
2358
|
}
|
|
2359
2359
|
/** Set values instantly — a single held keyframe. */
|
|
2360
2360
|
set(t, e, s) {
|
|
2361
|
-
return this.build(t, void 0, { ...
|
|
2361
|
+
return this.build(t, void 0, { ...ut(e), duration: 0 }, s);
|
|
2362
2362
|
}
|
|
2363
2363
|
// --- sequencing ---------------------------------------------------------
|
|
2364
2364
|
/** Start of the tween (after its delay) or call added last, in milliseconds. */
|
|
@@ -2374,16 +2374,16 @@ class et {
|
|
|
2374
2374
|
* no duration would be: `'<'` and `'>'` after it refer to it. Returns its time in ms.
|
|
2375
2375
|
*/
|
|
2376
2376
|
addEvent(t) {
|
|
2377
|
-
const e = Math.max(0,
|
|
2377
|
+
const e = Math.max(0, ht(t, this.context()));
|
|
2378
2378
|
return this.previousStart = e, this.previousEnd = e, this.cursor = Math.max(this.cursor, e), e;
|
|
2379
2379
|
}
|
|
2380
2380
|
/** Resolve a position (seconds, label, relative) to milliseconds without adding anything. */
|
|
2381
2381
|
timeOf(t) {
|
|
2382
|
-
return
|
|
2382
|
+
return ht(t, this.context());
|
|
2383
2383
|
}
|
|
2384
2384
|
/** Name a point in time, for use as a position parameter. */
|
|
2385
2385
|
addLabel(t, e) {
|
|
2386
|
-
return this.labels.set(t,
|
|
2386
|
+
return this.labels.set(t, ht(e, this.context())), this;
|
|
2387
2387
|
}
|
|
2388
2388
|
/** Time of a label, in milliseconds. */
|
|
2389
2389
|
/** Every label's time in milliseconds, in time order. */
|
|
@@ -2401,10 +2401,10 @@ class et {
|
|
|
2401
2401
|
* one flat, serializable track list.
|
|
2402
2402
|
*/
|
|
2403
2403
|
add(t, e) {
|
|
2404
|
-
const s =
|
|
2404
|
+
const s = ht(e, this.context());
|
|
2405
2405
|
for (const r of t.timeline.tracks) {
|
|
2406
2406
|
if (!("keyframes" in r)) continue;
|
|
2407
|
-
const o =
|
|
2407
|
+
const o = oe({
|
|
2408
2408
|
...r,
|
|
2409
2409
|
id: this.nextTrackId(`nested-${r.id}`),
|
|
2410
2410
|
keyframes: r.keyframes.map((a) => ({ ...a, time: a.time + s }))
|
|
@@ -2474,107 +2474,107 @@ class et {
|
|
|
2474
2474
|
* each property's start comes from the resolution chain.
|
|
2475
2475
|
*/
|
|
2476
2476
|
build(t, e, s, n) {
|
|
2477
|
-
const { config: r, properties: o } =
|
|
2477
|
+
const { config: r, properties: o } = Pt(s), { motionPath: a, text: c, scrambleText: l, inertia: h, ...f } = o, u = this.targetsOf(t), d = ht(n, this.context()), m = $t(r.delay, 0), p = $t(r.duration, 500), g = ce(r.stagger, {
|
|
2478
2478
|
count: u.length,
|
|
2479
2479
|
columnsFromLayout: this.options.layoutColumns ? () => this.options.layoutColumns(u) : void 0,
|
|
2480
2480
|
random: this.options.random ?? this.fallbackRandom
|
|
2481
|
-
}), y = this.easingFor(r.ease), b = [],
|
|
2482
|
-
let
|
|
2483
|
-
for (const [
|
|
2484
|
-
const
|
|
2485
|
-
let
|
|
2486
|
-
if (typeof
|
|
2487
|
-
`no usable start value for "${
|
|
2488
|
-
),
|
|
2489
|
-
const
|
|
2490
|
-
...
|
|
2491
|
-
from:
|
|
2492
|
-
to:
|
|
2493
|
-
velocity:
|
|
2494
|
-
},
|
|
2495
|
-
id:
|
|
2481
|
+
}), y = this.easingFor(r.ease), b = [], v = r.spring;
|
|
2482
|
+
let T = 0, w = !1;
|
|
2483
|
+
for (const [M, E] of Object.entries(f)) {
|
|
2484
|
+
const k = E;
|
|
2485
|
+
let P = e?.[M] !== void 0 ? e[M] : this.resolveStart(u[0], M);
|
|
2486
|
+
if (typeof P != typeof k && (this.warn(
|
|
2487
|
+
`no usable start value for "${M}" on "${u[0]}" — it will snap to ${String(k)}. Use fromTo() to animate it.`
|
|
2488
|
+
), P = k), v !== void 0 && typeof P == "number" && typeof k == "number") {
|
|
2489
|
+
const R = {
|
|
2490
|
+
...En(v),
|
|
2491
|
+
from: P,
|
|
2492
|
+
to: k,
|
|
2493
|
+
velocity: _n(v, M) ?? this.options.startVelocity?.(u[0], M) ?? 0
|
|
2494
|
+
}, j = this.nextTrackId(`${u[0]}-${M}-spring`), H = {
|
|
2495
|
+
id: j,
|
|
2496
2496
|
target: u[0],
|
|
2497
2497
|
...u.length > 1 && { targets: u },
|
|
2498
2498
|
...g && u.length > 1 && { stagger: g },
|
|
2499
|
-
property:
|
|
2499
|
+
property: M,
|
|
2500
2500
|
kind: "spring",
|
|
2501
|
-
spring:
|
|
2501
|
+
spring: R,
|
|
2502
2502
|
delay: d + m
|
|
2503
2503
|
};
|
|
2504
|
-
this.timeline.addTrack(
|
|
2505
|
-
for (const
|
|
2504
|
+
this.timeline.addTrack(H), b.push(j), T = Math.max(T, Ki(R));
|
|
2505
|
+
for (const I of u) this.lastValues.set(`${I}|${M}`, k);
|
|
2506
2506
|
continue;
|
|
2507
2507
|
}
|
|
2508
|
-
|
|
2509
|
-
const
|
|
2508
|
+
w = !0;
|
|
2509
|
+
const C = this.keyframesFor(P, k, p, y, r.ease), $ = this.nextTrackId(`${u[0]}-${M}`);
|
|
2510
2510
|
this.timeline.addTrack(
|
|
2511
|
-
|
|
2512
|
-
id:
|
|
2511
|
+
oe({
|
|
2512
|
+
id: $,
|
|
2513
2513
|
target: u[0],
|
|
2514
2514
|
...u.length > 1 && { targets: u },
|
|
2515
2515
|
...g && u.length > 1 && { stagger: g },
|
|
2516
|
-
property:
|
|
2516
|
+
property: M,
|
|
2517
2517
|
delay: d + m,
|
|
2518
|
-
keyframes:
|
|
2518
|
+
keyframes: C
|
|
2519
2519
|
})
|
|
2520
|
-
), b.push(
|
|
2521
|
-
for (const
|
|
2520
|
+
), b.push($);
|
|
2521
|
+
for (const R of u) this.lastValues.set(`${R}|${M}`, k);
|
|
2522
2522
|
}
|
|
2523
|
-
const
|
|
2524
|
-
if (
|
|
2525
|
-
const
|
|
2526
|
-
id:
|
|
2523
|
+
const x = An({ text: c, scrambleText: l }, u[0], p);
|
|
2524
|
+
if (x) {
|
|
2525
|
+
const M = e?.text ?? e?.scrambleText, E = M !== void 0 ? Kt(M) : this.resolveStart(u[0], "text"), k = this.nextTrackId(`${u[0]}-text`), P = {
|
|
2526
|
+
id: k,
|
|
2527
2527
|
target: u[0],
|
|
2528
2528
|
...u.length > 1 && { targets: u },
|
|
2529
2529
|
...g && u.length > 1 && { stagger: g },
|
|
2530
2530
|
property: "text",
|
|
2531
|
-
textConfig: { from: typeof
|
|
2531
|
+
textConfig: { from: typeof E == "string" ? E : String(E ?? ""), ...x },
|
|
2532
2532
|
delay: d + m,
|
|
2533
2533
|
keyframes: this.keyframesFor(0, 1, p, y, r.ease)
|
|
2534
2534
|
};
|
|
2535
|
-
this.timeline.addTrack(
|
|
2536
|
-
for (const
|
|
2535
|
+
this.timeline.addTrack(P), b.push(k);
|
|
2536
|
+
for (const C of u) this.lastValues.set(`${C}|text`, x.to);
|
|
2537
2537
|
}
|
|
2538
2538
|
if (a !== void 0) {
|
|
2539
|
-
const { config:
|
|
2540
|
-
id:
|
|
2539
|
+
const { config: M, start: E, end: k } = bn(a), P = this.nextTrackId(`${u[0]}-motionPath`), C = {
|
|
2540
|
+
id: P,
|
|
2541
2541
|
target: u[0],
|
|
2542
2542
|
...u.length > 1 && { targets: u },
|
|
2543
2543
|
...g && u.length > 1 && { stagger: g },
|
|
2544
2544
|
property: "motionPath",
|
|
2545
|
-
motionPathConfig:
|
|
2545
|
+
motionPathConfig: M,
|
|
2546
2546
|
delay: d + m,
|
|
2547
|
-
keyframes: this.keyframesFor(
|
|
2547
|
+
keyframes: this.keyframesFor(E, k, p, y, r.ease)
|
|
2548
2548
|
};
|
|
2549
|
-
this.timeline.addTrack(
|
|
2549
|
+
this.timeline.addTrack(C), b.push(P);
|
|
2550
2550
|
}
|
|
2551
2551
|
if (h !== void 0)
|
|
2552
|
-
for (const [
|
|
2553
|
-
const
|
|
2554
|
-
if (typeof
|
|
2555
|
-
this.warn(`inertia on "${
|
|
2552
|
+
for (const [M, E] of Object.entries(h)) {
|
|
2553
|
+
const k = this.resolveStart(u[0], M);
|
|
2554
|
+
if (typeof k != "number") {
|
|
2555
|
+
this.warn(`inertia on "${M}" needs a numeric start value; skipped`);
|
|
2556
2556
|
continue;
|
|
2557
2557
|
}
|
|
2558
|
-
const
|
|
2559
|
-
id:
|
|
2558
|
+
const P = Pn(k, E), C = this.nextTrackId(`${u[0]}-${M}-inertia`), $ = {
|
|
2559
|
+
id: C,
|
|
2560
2560
|
target: u[0],
|
|
2561
2561
|
...u.length > 1 && { targets: u },
|
|
2562
2562
|
...g && u.length > 1 && { stagger: g },
|
|
2563
|
-
property:
|
|
2563
|
+
property: M,
|
|
2564
2564
|
kind: "inertia",
|
|
2565
|
-
inertia:
|
|
2565
|
+
inertia: P,
|
|
2566
2566
|
delay: d + m
|
|
2567
2567
|
};
|
|
2568
|
-
this.timeline.addTrack(
|
|
2569
|
-
for (const
|
|
2568
|
+
this.timeline.addTrack($), b.push(C), T = Math.max(T, bt(P));
|
|
2569
|
+
for (const R of u) this.lastValues.set(`${R}|${M}`, yt(P));
|
|
2570
2570
|
}
|
|
2571
|
-
const
|
|
2572
|
-
return this.previousStart = d + m, this.previousEnd =
|
|
2571
|
+
const L = ((h !== void 0 || v !== void 0) && !w && !x && a === void 0 ? T : Math.max(p, T)) + (g && u.length > 1 ? Dt(u.length, g) : 0), A = d + m + L;
|
|
2572
|
+
return this.previousStart = d + m, this.previousEnd = A, this.cursor = Math.max(this.cursor, A), {
|
|
2573
2573
|
trackIds: b,
|
|
2574
2574
|
start: d + m,
|
|
2575
|
-
end:
|
|
2575
|
+
end: A,
|
|
2576
2576
|
kill: () => {
|
|
2577
|
-
for (const
|
|
2577
|
+
for (const M of b) this.timeline.removeTrack(M);
|
|
2578
2578
|
}
|
|
2579
2579
|
};
|
|
2580
2580
|
}
|
|
@@ -2585,10 +2585,10 @@ class et {
|
|
|
2585
2585
|
const o = { time: 0, value: t };
|
|
2586
2586
|
if (s <= 0)
|
|
2587
2587
|
return [{ time: 0, value: e }];
|
|
2588
|
-
const a = typeof r == "string" ?
|
|
2589
|
-
if (a?.requiresBaking === "custom" || this.options.bakeEases &&
|
|
2588
|
+
const a = typeof r == "string" ? It(r) : void 0;
|
|
2589
|
+
if (a?.requiresBaking === "custom" || this.options.bakeEases && Et(n)) {
|
|
2590
2590
|
const l = a?.fn ?? W(n);
|
|
2591
|
-
return [o, ...
|
|
2591
|
+
return [o, ...vi(o, { time: s, value: e }, l, { intervalMs: this.options.bakeIntervalMs })];
|
|
2592
2592
|
}
|
|
2593
2593
|
return [o, { time: s, value: e, ...n && { easing: n } }];
|
|
2594
2594
|
}
|
|
@@ -2605,14 +2605,14 @@ class et {
|
|
|
2605
2605
|
throw new Error(
|
|
2606
2606
|
`gsap-compat: no starting shape for "${t}". Use fromTo({ d: … }, { morphSVG: … }), or live.to(), which reads the element's current shape.`
|
|
2607
2607
|
);
|
|
2608
|
-
const o =
|
|
2608
|
+
const o = Ri(e);
|
|
2609
2609
|
return o !== void 0 ? (this.warn(
|
|
2610
2610
|
`no start value for "${e}" on "${t}" — using the static default ${o}. GSAP would read the live DOM here; tinyfly cannot, so pass an explicit fromTo() or a defaults map.`
|
|
2611
2611
|
), o) : (this.warn(`no start value or default for "${e}" on "${t}" — using 0`), 0);
|
|
2612
2612
|
}
|
|
2613
2613
|
easingFor(t) {
|
|
2614
2614
|
if (t !== void 0) {
|
|
2615
|
-
if (typeof t == "string") return
|
|
2615
|
+
if (typeof t == "string") return It(t).easing;
|
|
2616
2616
|
if (typeof t == "function")
|
|
2617
2617
|
throw new Error(
|
|
2618
2618
|
'gsap-compat: function eases cannot be serialized. Use a named ease, or a cubic-bezier via { type: "cubic-bezier", points: [...] }.'
|
|
@@ -2640,7 +2640,7 @@ class et {
|
|
|
2640
2640
|
this.options.onWarning?.(`gsap-compat: ${t}`);
|
|
2641
2641
|
}
|
|
2642
2642
|
}
|
|
2643
|
-
function
|
|
2643
|
+
function Kt(i) {
|
|
2644
2644
|
if (typeof i == "string") return i;
|
|
2645
2645
|
if (i && typeof i == "object") {
|
|
2646
2646
|
const t = i;
|
|
@@ -2648,13 +2648,13 @@ function Ht(i) {
|
|
|
2648
2648
|
}
|
|
2649
2649
|
return String(i ?? "");
|
|
2650
2650
|
}
|
|
2651
|
-
function
|
|
2652
|
-
return new
|
|
2651
|
+
function Cn(i) {
|
|
2652
|
+
return new st(i);
|
|
2653
2653
|
}
|
|
2654
|
-
function
|
|
2655
|
-
return
|
|
2654
|
+
function ut(i) {
|
|
2655
|
+
return Sn(wn(i));
|
|
2656
2656
|
}
|
|
2657
|
-
const
|
|
2657
|
+
const Rn = /* @__PURE__ */ new Set([
|
|
2658
2658
|
"blur",
|
|
2659
2659
|
"brightness",
|
|
2660
2660
|
"glow",
|
|
@@ -2663,16 +2663,16 @@ const _n = /* @__PURE__ */ new Set([
|
|
|
2663
2663
|
"shadowY",
|
|
2664
2664
|
"shadowBlur",
|
|
2665
2665
|
"shadowColor"
|
|
2666
|
-
]),
|
|
2667
|
-
function
|
|
2666
|
+
]), In = "#ffffff", $n = "rgba(0, 0, 0, 0.5)";
|
|
2667
|
+
function Fn(i) {
|
|
2668
2668
|
const t = [];
|
|
2669
|
-
if (i.blur !== void 0 && t.push(`blur(${Math.max(0, i.blur)}px)`), i.brightness !== void 0 && t.push(`brightness(${Math.max(0, i.brightness)})`), i.glow !== void 0 && t.push(`drop-shadow(0 0 ${Math.max(0, i.glow)}px ${i.glowColor ??
|
|
2669
|
+
if (i.blur !== void 0 && t.push(`blur(${Math.max(0, i.blur)}px)`), i.brightness !== void 0 && t.push(`brightness(${Math.max(0, i.brightness)})`), i.glow !== void 0 && t.push(`drop-shadow(0 0 ${Math.max(0, i.glow)}px ${i.glowColor ?? In})`), i.shadowX !== void 0 || i.shadowY !== void 0 || i.shadowBlur !== void 0) {
|
|
2670
2670
|
const e = i.shadowX ?? 0, s = i.shadowY ?? 0, n = Math.max(0, i.shadowBlur ?? 0);
|
|
2671
|
-
t.push(`drop-shadow(${e}px ${s}px ${n}px ${i.shadowColor ??
|
|
2671
|
+
t.push(`drop-shadow(${e}px ${s}px ${n}px ${i.shadowColor ?? $n})`);
|
|
2672
2672
|
}
|
|
2673
2673
|
return t.length > 0 ? t.join(" ") : null;
|
|
2674
2674
|
}
|
|
2675
|
-
function
|
|
2675
|
+
function Ln(i, t) {
|
|
2676
2676
|
const e = i.childNodes.length === 1 ? i.firstChild : null;
|
|
2677
2677
|
if (e && e.nodeType === 3) {
|
|
2678
2678
|
const s = e;
|
|
@@ -2681,12 +2681,12 @@ function In(i, t) {
|
|
|
2681
2681
|
}
|
|
2682
2682
|
i.textContent !== t && (i.textContent = t);
|
|
2683
2683
|
}
|
|
2684
|
-
function
|
|
2684
|
+
function Dn(i) {
|
|
2685
2685
|
if (!("ownerSVGElement" in i)) return;
|
|
2686
2686
|
const t = i.style;
|
|
2687
2687
|
!t || t.transformBox || (t.transformBox = "fill-box", t.transformOrigin || (t.transformOrigin = "50% 50%"));
|
|
2688
2688
|
}
|
|
2689
|
-
const
|
|
2689
|
+
const Ne = /* @__PURE__ */ new Set([
|
|
2690
2690
|
"width",
|
|
2691
2691
|
"height",
|
|
2692
2692
|
"top",
|
|
@@ -2712,7 +2712,7 @@ const De = /* @__PURE__ */ new Set([
|
|
|
2712
2712
|
"gap",
|
|
2713
2713
|
"rowGap",
|
|
2714
2714
|
"columnGap"
|
|
2715
|
-
]),
|
|
2715
|
+
]), On = /* @__PURE__ */ new Set([
|
|
2716
2716
|
"x",
|
|
2717
2717
|
"y",
|
|
2718
2718
|
"z",
|
|
@@ -2730,14 +2730,14 @@ const De = /* @__PURE__ */ new Set([
|
|
|
2730
2730
|
"motionPathX",
|
|
2731
2731
|
"motionPathY",
|
|
2732
2732
|
"motionPathRotate"
|
|
2733
|
-
]),
|
|
2733
|
+
]), Bn = /* @__PURE__ */ new Set(["originX", "originY"]), Nn = /* @__PURE__ */ new Set(["clipTop", "clipRight", "clipBottom", "clipLeft"]), qn = {
|
|
2734
2734
|
fill: "backgroundColor",
|
|
2735
2735
|
stroke: "borderColor",
|
|
2736
2736
|
strokeWidth: "borderWidth",
|
|
2737
2737
|
color: "color",
|
|
2738
2738
|
backgroundColor: "backgroundColor",
|
|
2739
2739
|
borderColor: "borderColor"
|
|
2740
|
-
},
|
|
2740
|
+
}, qe = {
|
|
2741
2741
|
fill: "fill",
|
|
2742
2742
|
stroke: "stroke",
|
|
2743
2743
|
strokeWidth: "strokeWidth",
|
|
@@ -2745,8 +2745,8 @@ const De = /* @__PURE__ */ new Set([
|
|
|
2745
2745
|
strokeDashoffset: "strokeDashoffset",
|
|
2746
2746
|
fillOpacity: "fillOpacity",
|
|
2747
2747
|
strokeOpacity: "strokeOpacity"
|
|
2748
|
-
},
|
|
2749
|
-
class
|
|
2748
|
+
}, Xn = "http://www.w3.org/2000/svg";
|
|
2749
|
+
class K {
|
|
2750
2750
|
targets = /* @__PURE__ */ new Map();
|
|
2751
2751
|
/**
|
|
2752
2752
|
* Register an HTML element as an animation target.
|
|
@@ -2790,18 +2790,18 @@ class H {
|
|
|
2790
2790
|
const a = e.has("motionPathX"), c = e.has("motionPathY"), l = e.has("motionPathRotate");
|
|
2791
2791
|
for (const [u, d] of e)
|
|
2792
2792
|
if (!(u === "x" && a) && !(u === "y" && c) && !((u === "rotate" || u === "rotateZ") && l)) {
|
|
2793
|
-
if (
|
|
2793
|
+
if (On.has(u)) {
|
|
2794
2794
|
const m = this.buildTransformPart(u, d);
|
|
2795
2795
|
m && s.push(m);
|
|
2796
|
-
} else if (
|
|
2796
|
+
} else if (Bn.has(u))
|
|
2797
2797
|
typeof d == "number" && ((n ??= {})[u] = d);
|
|
2798
|
-
else if (
|
|
2798
|
+
else if (Nn.has(u))
|
|
2799
2799
|
typeof d == "number" && ((r ??= {})[u] = d);
|
|
2800
|
-
else if (
|
|
2800
|
+
else if (Rn.has(u))
|
|
2801
2801
|
(o ??= {})[u] = d;
|
|
2802
2802
|
else if (u !== "perspective") {
|
|
2803
2803
|
if (u !== "shine") if (u === "text" && typeof d == "string")
|
|
2804
|
-
|
|
2804
|
+
Ln(t, d);
|
|
2805
2805
|
else if (u === "d" && typeof d == "string") {
|
|
2806
2806
|
const m = t;
|
|
2807
2807
|
(m.tagName?.toLowerCase() === "path" ? m : m.querySelector?.("path"))?.setAttribute?.("d", d);
|
|
@@ -2812,7 +2812,7 @@ class H {
|
|
|
2812
2812
|
const h = e.get("shine");
|
|
2813
2813
|
typeof h == "number" && this.applyShine(t, h);
|
|
2814
2814
|
const f = e.get("perspective");
|
|
2815
|
-
if (typeof f == "number" && s.unshift(`perspective(${f}px)`), s.length > 0 && (t.style.transform = s.join(" "),
|
|
2815
|
+
if (typeof f == "number" && s.unshift(`perspective(${f}px)`), s.length > 0 && (t.style.transform = s.join(" "), Dn(t)), n) {
|
|
2816
2816
|
const u = n.originX ?? 50, d = n.originY ?? 50;
|
|
2817
2817
|
t.style.transformOrigin = `${u}% ${d}%`;
|
|
2818
2818
|
}
|
|
@@ -2821,7 +2821,7 @@ class H {
|
|
|
2821
2821
|
t.style.clipPath = `inset(${u}% ${d}% ${m}% ${p}%)`;
|
|
2822
2822
|
}
|
|
2823
2823
|
if (o) {
|
|
2824
|
-
const u =
|
|
2824
|
+
const u = Fn(o);
|
|
2825
2825
|
u && (t.style.filter = u);
|
|
2826
2826
|
}
|
|
2827
2827
|
}
|
|
@@ -2881,21 +2881,21 @@ class H {
|
|
|
2881
2881
|
*/
|
|
2882
2882
|
applyStyleProperty(t, e, s) {
|
|
2883
2883
|
let n;
|
|
2884
|
-
if (t.namespaceURI ===
|
|
2884
|
+
if (t.namespaceURI === Xn && e in qe) {
|
|
2885
2885
|
const a = Array.isArray(s) ? s.join(", ") : String(s);
|
|
2886
|
-
t.style[
|
|
2886
|
+
t.style[qe[e]] = a;
|
|
2887
2887
|
return;
|
|
2888
|
-
} else e === "fill" && t.dataset?.elementType === "text" ? n = "color" : n =
|
|
2888
|
+
} else e === "fill" && t.dataset?.elementType === "text" ? n = "color" : n = qn[e] ?? e;
|
|
2889
2889
|
let o;
|
|
2890
|
-
typeof s == "number" ?
|
|
2890
|
+
typeof s == "number" ? Ne.has(e) || Ne.has(n) ? o = `${s}px` : o = String(s) : Array.isArray(s) ? o = s.join(", ") : o = s, t.style[n] = o;
|
|
2891
2891
|
}
|
|
2892
2892
|
}
|
|
2893
|
-
const
|
|
2893
|
+
const Yn = {
|
|
2894
2894
|
request: (i) => requestAnimationFrame(i),
|
|
2895
2895
|
cancel: (i) => cancelAnimationFrame(i)
|
|
2896
2896
|
};
|
|
2897
|
-
class
|
|
2898
|
-
adapter = new
|
|
2897
|
+
class Vn {
|
|
2898
|
+
adapter = new K();
|
|
2899
2899
|
scheduler;
|
|
2900
2900
|
rootOption;
|
|
2901
2901
|
/** Element → engine target name. The engine only ever sees names. */
|
|
@@ -2917,7 +2917,7 @@ class Xn {
|
|
|
2917
2917
|
*/
|
|
2918
2918
|
liveTimelines = /* @__PURE__ */ new Set();
|
|
2919
2919
|
/** GSAP-style utilities, with this stage's seeded random sequence (`live.utils`). */
|
|
2920
|
-
utils =
|
|
2920
|
+
utils = un();
|
|
2921
2921
|
/** Playing timelines, in activation order. */
|
|
2922
2922
|
active = /* @__PURE__ */ new Map();
|
|
2923
2923
|
/** Last applied value per target name and property. */
|
|
@@ -2928,7 +2928,7 @@ class Xn {
|
|
|
2928
2928
|
lastTimestamp = null;
|
|
2929
2929
|
destroyed = !1;
|
|
2930
2930
|
constructor(t = {}) {
|
|
2931
|
-
this.scheduler = t.scheduler ??
|
|
2931
|
+
this.scheduler = t.scheduler ?? Yn, this.rootOption = t.root;
|
|
2932
2932
|
}
|
|
2933
2933
|
// --- targets ------------------------------------------------------------
|
|
2934
2934
|
/**
|
|
@@ -2949,7 +2949,7 @@ class Xn {
|
|
|
2949
2949
|
const e = [];
|
|
2950
2950
|
for (const s of this.targetsOf(t)) {
|
|
2951
2951
|
const n = this.nameFor(s);
|
|
2952
|
-
|
|
2952
|
+
Zt(s) && this.currentCollector?.touch(s, n), e.push(n);
|
|
2953
2953
|
}
|
|
2954
2954
|
return e;
|
|
2955
2955
|
}
|
|
@@ -3124,15 +3124,15 @@ class Xn {
|
|
|
3124
3124
|
targetsOf(t) {
|
|
3125
3125
|
if (typeof t == "string")
|
|
3126
3126
|
return Array.from(this.selectorRoot.querySelectorAll(t));
|
|
3127
|
-
if (
|
|
3128
|
-
if (!
|
|
3127
|
+
if (Zt(t)) return [t];
|
|
3128
|
+
if (!Wn(t)) return [t];
|
|
3129
3129
|
const e = [];
|
|
3130
3130
|
for (const s of Array.from(t))
|
|
3131
3131
|
e.push(...this.targetsOf(s));
|
|
3132
3132
|
return e;
|
|
3133
3133
|
}
|
|
3134
3134
|
nameFor(t) {
|
|
3135
|
-
return
|
|
3135
|
+
return Zt(t) ? this.elementName(t) : this.objectName(t);
|
|
3136
3136
|
}
|
|
3137
3137
|
objectName(t) {
|
|
3138
3138
|
const e = this.objectNames.get(t);
|
|
@@ -3154,15 +3154,15 @@ class Xn {
|
|
|
3154
3154
|
return this.names.set(t, s), this.elements.set(s, t), this.adapter.registerTarget(s, t), s;
|
|
3155
3155
|
}
|
|
3156
3156
|
}
|
|
3157
|
-
function
|
|
3157
|
+
function Zt(i) {
|
|
3158
3158
|
return typeof i == "object" && i !== null && i.nodeType === 1;
|
|
3159
3159
|
}
|
|
3160
|
-
function
|
|
3160
|
+
function Wn(i) {
|
|
3161
3161
|
if (Array.isArray(i)) return !0;
|
|
3162
3162
|
const t = i;
|
|
3163
3163
|
return typeof t.length == "number" && typeof t.item == "function";
|
|
3164
3164
|
}
|
|
3165
|
-
function
|
|
3165
|
+
function Ft(i) {
|
|
3166
3166
|
const t = i.style;
|
|
3167
3167
|
if (!t) return i.getBoundingClientRect();
|
|
3168
3168
|
const e = t.transform;
|
|
@@ -3170,30 +3170,30 @@ function $t(i) {
|
|
|
3170
3170
|
const s = i.getBoundingClientRect();
|
|
3171
3171
|
return t.transform = e, s;
|
|
3172
3172
|
}
|
|
3173
|
-
const
|
|
3174
|
-
function
|
|
3173
|
+
const Xe = (i) => typeof i == "object" && i !== null && i.nodeType === 1;
|
|
3174
|
+
function jn(i) {
|
|
3175
3175
|
const t = {};
|
|
3176
3176
|
for (const e of Array.from(i.attributes)) t[e.name] = e.value;
|
|
3177
3177
|
return t;
|
|
3178
3178
|
}
|
|
3179
|
-
function
|
|
3179
|
+
function Un(i) {
|
|
3180
3180
|
const t = i.getScreenCTM?.();
|
|
3181
3181
|
if (t) return [t.a, t.b, t.c, t.d, t.e, t.f];
|
|
3182
3182
|
const e = i.getBoundingClientRect();
|
|
3183
3183
|
return [1, 0, 0, 1, e.left, e.top];
|
|
3184
3184
|
}
|
|
3185
|
-
function
|
|
3186
|
-
const e = typeof i == "string" || Array.isArray(i) ||
|
|
3187
|
-
const S =
|
|
3188
|
-
return S || t.warn(`gsap-compat: motionPath could not find "${String(
|
|
3185
|
+
function zn(i, t) {
|
|
3186
|
+
const e = typeof i == "string" || Array.isArray(i) || Xe(i) ? { path: i } : i, { align: s, alignOrigin: n, path: r, ...o } = e, a = (x) => {
|
|
3187
|
+
const S = Xe(x) ? x : t.query(x);
|
|
3188
|
+
return S || t.warn(`gsap-compat: motionPath could not find "${String(x)}"`), S;
|
|
3189
3189
|
};
|
|
3190
3190
|
let c = null, l = "";
|
|
3191
|
-
if (Array.isArray(r) || typeof r == "string" &&
|
|
3191
|
+
if (Array.isArray(r) || typeof r == "string" && vt(r))
|
|
3192
3192
|
l = r;
|
|
3193
3193
|
else {
|
|
3194
3194
|
c = a(r);
|
|
3195
|
-
const
|
|
3196
|
-
c && !
|
|
3195
|
+
const x = c && pe({ tag: c.localName, attributes: jn(c) });
|
|
3196
|
+
c && !x && t.warn(`gsap-compat: motionPath element <${c.localName}> has no path geometry`), l = x ?? "";
|
|
3197
3197
|
}
|
|
3198
3198
|
const h = { ...o, path: l };
|
|
3199
3199
|
if (s === void 0 || s === !1) return h;
|
|
@@ -3202,47 +3202,47 @@ function Wn(i, t) {
|
|
|
3202
3202
|
return s === !0 && t.warn("gsap-compat: motionPath align: true needs the path to be an element"), h;
|
|
3203
3203
|
const u = t.targets[0];
|
|
3204
3204
|
if (!u) return h;
|
|
3205
|
-
const [d, m, p, g, y, b] =
|
|
3206
|
-
for (const
|
|
3207
|
-
const S =
|
|
3208
|
-
if (Math.abs(S.left -
|
|
3205
|
+
const [d, m, p, g, y, b] = Un(f), v = Ft(u), [T, w] = n ?? [0.5, 0.5];
|
|
3206
|
+
for (const x of t.targets.slice(1)) {
|
|
3207
|
+
const S = Ft(x);
|
|
3208
|
+
if (Math.abs(S.left - v.left) > 0.5 || Math.abs(S.top - v.top) > 0.5) {
|
|
3209
3209
|
t.warn("gsap-compat: motionPath align measures the first target; the others are laid out elsewhere");
|
|
3210
3210
|
break;
|
|
3211
3211
|
}
|
|
3212
3212
|
}
|
|
3213
|
-
return h.matrix = [d, m, p, g, y -
|
|
3213
|
+
return h.matrix = [d, m, p, g, y - v.left - T * v.width, b - v.top - w * v.height], h;
|
|
3214
3214
|
}
|
|
3215
|
-
const
|
|
3216
|
-
function
|
|
3215
|
+
const $i = (i) => typeof i == "object" && i !== null && i.nodeType === 1;
|
|
3216
|
+
function Fi(i) {
|
|
3217
3217
|
const t = {};
|
|
3218
3218
|
for (const e of Array.from(i.attributes)) t[e.name] = e.value;
|
|
3219
3219
|
return t;
|
|
3220
3220
|
}
|
|
3221
|
-
function
|
|
3221
|
+
function Li(i) {
|
|
3222
3222
|
if (!i) return null;
|
|
3223
|
-
const t =
|
|
3223
|
+
const t = pe({ tag: i.localName, attributes: Fi(i) });
|
|
3224
3224
|
return t || (i.querySelector("path")?.getAttribute("d") ?? null);
|
|
3225
3225
|
}
|
|
3226
|
-
function
|
|
3227
|
-
const s =
|
|
3228
|
-
if (typeof s == "string" &&
|
|
3229
|
-
const n =
|
|
3226
|
+
function Hn(i, t, e) {
|
|
3227
|
+
const s = Ii(i);
|
|
3228
|
+
if (typeof s == "string" && vt(s)) return s;
|
|
3229
|
+
const n = $i(s) ? s : typeof s == "string" ? t(s) : null, r = Li(n);
|
|
3230
3230
|
return r || (e(`gsap-compat: morphSVG could not find a shape for "${String(s)}"`), "");
|
|
3231
3231
|
}
|
|
3232
|
-
const
|
|
3233
|
-
function
|
|
3234
|
-
return (typeof i == "string" ? Array.from(t.querySelectorAll(i)) :
|
|
3232
|
+
const Gn = /* @__PURE__ */ new Set(["cx", "cy", "r", "rx", "ry", "x", "y", "width", "height", "x1", "y1", "x2", "y2", "points"]);
|
|
3233
|
+
function Kn(i, t = document) {
|
|
3234
|
+
return (typeof i == "string" ? Array.from(t.querySelectorAll(i)) : $i(i) ? [i] : Array.from(i)).map((s) => {
|
|
3235
3235
|
if (s.localName === "path") return s;
|
|
3236
|
-
const n =
|
|
3236
|
+
const n = pe({ tag: s.localName, attributes: Fi(s) });
|
|
3237
3237
|
if (!n || !s.parentNode) return s;
|
|
3238
3238
|
const r = s.ownerDocument.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
3239
3239
|
for (const o of Array.from(s.attributes))
|
|
3240
|
-
|
|
3240
|
+
Gn.has(o.name) || r.setAttribute(o.name, o.value);
|
|
3241
3241
|
return r.setAttribute("d", n), s.parentNode.replaceChild(r, s), r;
|
|
3242
3242
|
});
|
|
3243
3243
|
}
|
|
3244
|
-
const
|
|
3245
|
-
class
|
|
3244
|
+
const Ye = 0.3;
|
|
3245
|
+
class Zn {
|
|
3246
3246
|
options;
|
|
3247
3247
|
target;
|
|
3248
3248
|
running = !1;
|
|
@@ -3276,7 +3276,7 @@ class Hn {
|
|
|
3276
3276
|
}
|
|
3277
3277
|
// --- gesture lifecycle --------------------------------------------------
|
|
3278
3278
|
begin(t, e, s) {
|
|
3279
|
-
this.dragging = !0, this.passedTolerance = !1, this.startX = t, this.startY = e, this.lastX = t, this.lastY = e, this.velocityX = 0, this.velocityY = 0, this.lastTime =
|
|
3279
|
+
this.dragging = !0, this.passedTolerance = !1, this.startX = t, this.startY = e, this.lastX = t, this.lastY = e, this.velocityX = 0, this.velocityY = 0, this.lastTime = Ve(), this.options.onPress?.(this.stateFrom(0, 0, s));
|
|
3280
3280
|
}
|
|
3281
3281
|
move(t, e, s) {
|
|
3282
3282
|
if (!this.dragging) return;
|
|
@@ -3293,10 +3293,10 @@ class Hn {
|
|
|
3293
3293
|
this.dragging && (this.dragging = !1, this.options.onRelease?.(this.stateFrom(0, 0, t)));
|
|
3294
3294
|
}
|
|
3295
3295
|
updateVelocity(t, e) {
|
|
3296
|
-
const s =
|
|
3296
|
+
const s = Ve(), n = Math.max(1, s - this.lastTime);
|
|
3297
3297
|
this.lastTime = s;
|
|
3298
3298
|
const r = t / n * 1e3, o = e / n * 1e3;
|
|
3299
|
-
this.velocityX += (r - this.velocityX) *
|
|
3299
|
+
this.velocityX += (r - this.velocityX) * Ye, this.velocityY += (o - this.velocityY) * Ye;
|
|
3300
3300
|
}
|
|
3301
3301
|
stateFrom(t, e, s) {
|
|
3302
3302
|
return {
|
|
@@ -3348,10 +3348,10 @@ class Hn {
|
|
|
3348
3348
|
});
|
|
3349
3349
|
};
|
|
3350
3350
|
}
|
|
3351
|
-
function
|
|
3351
|
+
function Ve() {
|
|
3352
3352
|
return typeof performance < "u" ? performance.now() : Date.now();
|
|
3353
3353
|
}
|
|
3354
|
-
function
|
|
3354
|
+
function Qn(i, t, e) {
|
|
3355
3355
|
let s = { delta: 0, line: null }, n = e;
|
|
3356
3356
|
for (const r of i)
|
|
3357
3357
|
for (const o of t) {
|
|
@@ -3360,10 +3360,10 @@ function Gn(i, t, e) {
|
|
|
3360
3360
|
}
|
|
3361
3361
|
return s;
|
|
3362
3362
|
}
|
|
3363
|
-
function
|
|
3363
|
+
function Jn(i, t) {
|
|
3364
3364
|
return t <= 0 ? [] : i.map((e) => Math.round(e / t) * t);
|
|
3365
3365
|
}
|
|
3366
|
-
class
|
|
3366
|
+
class Di {
|
|
3367
3367
|
options;
|
|
3368
3368
|
observer;
|
|
3369
3369
|
x;
|
|
@@ -3375,7 +3375,7 @@ class Ii {
|
|
|
3375
3375
|
snappedX = null;
|
|
3376
3376
|
snappedY = null;
|
|
3377
3377
|
constructor(t) {
|
|
3378
|
-
this.options = t, this.x = t.initialX ?? 0, this.y = t.initialY ?? 0, this.observer = new
|
|
3378
|
+
this.options = t, this.x = t.initialX ?? 0, this.y = t.initialY ?? 0, this.observer = new Zn({
|
|
3379
3379
|
target: t.target,
|
|
3380
3380
|
onPress: (e) => {
|
|
3381
3381
|
const s = t.getPosition?.();
|
|
@@ -3428,7 +3428,7 @@ class Ii {
|
|
|
3428
3428
|
if (e <= 0) return;
|
|
3429
3429
|
const s = this.options.scrubDistance ?? 500;
|
|
3430
3430
|
if (s === 0) return;
|
|
3431
|
-
const n = (this.options.axis ?? "both") === "y" ? this.y : this.x, r =
|
|
3431
|
+
const n = (this.options.axis ?? "both") === "y" ? this.y : this.x, r = tr(n / s);
|
|
3432
3432
|
t.pause(), t.seek(r * e);
|
|
3433
3433
|
}
|
|
3434
3434
|
/**
|
|
@@ -3441,9 +3441,9 @@ class Ii {
|
|
|
3441
3441
|
applyConstraints(t, e) {
|
|
3442
3442
|
let s = t;
|
|
3443
3443
|
const n = [
|
|
3444
|
-
...
|
|
3444
|
+
...Jn([s], this.options.snap ?? 0),
|
|
3445
3445
|
...(e === "x" ? this.options.snapLinesX : this.options.snapLinesY) ?? []
|
|
3446
|
-
], r =
|
|
3446
|
+
], r = Qn([s], n, this.snapThreshold());
|
|
3447
3447
|
s += r.delta, e === "x" ? this.snappedX = r.line : this.snappedY = r.line;
|
|
3448
3448
|
const o = this.options.bounds;
|
|
3449
3449
|
if (o) {
|
|
@@ -3453,16 +3453,16 @@ class Ii {
|
|
|
3453
3453
|
return s;
|
|
3454
3454
|
}
|
|
3455
3455
|
}
|
|
3456
|
-
function
|
|
3456
|
+
function tr(i) {
|
|
3457
3457
|
return i < 0 ? 0 : i > 1 ? 1 : i;
|
|
3458
3458
|
}
|
|
3459
|
-
function
|
|
3460
|
-
const t = new
|
|
3459
|
+
function Eo(i) {
|
|
3460
|
+
const t = new Di(i);
|
|
3461
3461
|
return t.start(), t;
|
|
3462
3462
|
}
|
|
3463
|
-
const
|
|
3464
|
-
function
|
|
3465
|
-
const e =
|
|
3463
|
+
const er = { x: "x", y: "y", "x,y": "both" }, le = (i) => typeof i == "object" && i !== null && i.nodeType === 1;
|
|
3464
|
+
function We(i, t) {
|
|
3465
|
+
const e = Ft(i), s = t.getBoundingClientRect();
|
|
3466
3466
|
return {
|
|
3467
3467
|
minX: s.left - e.left,
|
|
3468
3468
|
maxX: s.right - e.right,
|
|
@@ -3470,35 +3470,35 @@ function Ye(i, t) {
|
|
|
3470
3470
|
maxY: s.bottom - e.bottom
|
|
3471
3471
|
};
|
|
3472
3472
|
}
|
|
3473
|
-
function
|
|
3473
|
+
function je(i) {
|
|
3474
3474
|
return Array.isArray(i) ? [...i] : i;
|
|
3475
3475
|
}
|
|
3476
|
-
function
|
|
3476
|
+
function ir(i, t, e, s = {}) {
|
|
3477
3477
|
const [n] = t.resolveTargets(e), r = n ? t.elementFor(n) : void 0;
|
|
3478
3478
|
if (!n || !r)
|
|
3479
3479
|
throw new Error(`gsap-compat: live.draggable could not find ${String(e)}`);
|
|
3480
|
-
if (s.type === "rotation") return
|
|
3481
|
-
const o =
|
|
3480
|
+
if (s.type === "rotation") return sr(i, t, n, r, s);
|
|
3481
|
+
const o = er[s.type ?? "x,y"], a = () => {
|
|
3482
3482
|
const p = t.appliedValue(n, "x"), g = t.appliedValue(n, "y");
|
|
3483
3483
|
return { x: typeof p == "number" ? p : 0, y: typeof g == "number" ? g : 0 };
|
|
3484
|
-
}, c = typeof s.bounds == "string" ? t.query(s.bounds) :
|
|
3484
|
+
}, c = typeof s.bounds == "string" ? t.query(s.bounds) : le(s.bounds) ? s.bounds : null, h = { bounds: (!c && s.bounds && !le(s.bounds) ? s.bounds : void 0) ?? (c ? We(r, c) : void 0) };
|
|
3485
3485
|
let f = null;
|
|
3486
3486
|
const u = () => {
|
|
3487
3487
|
f?.kill(), f = null;
|
|
3488
3488
|
}, d = (p) => {
|
|
3489
|
-
const g = s.inertia === !0 ? {} : s.inertia, y = g.friction ?? (g.resistance !== void 0 ?
|
|
3490
|
-
let
|
|
3491
|
-
const
|
|
3492
|
-
if (Array.isArray(
|
|
3493
|
-
const _ =
|
|
3494
|
-
let
|
|
3495
|
-
for (const
|
|
3496
|
-
Math.hypot(
|
|
3497
|
-
|
|
3498
|
-
} else typeof
|
|
3489
|
+
const g = s.inertia === !0 ? {} : s.inertia, y = g.friction ?? (g.resistance !== void 0 ? ye(g.resistance) : 4), b = a(), v = h.bounds ?? {};
|
|
3490
|
+
let T, w;
|
|
3491
|
+
const x = g.end;
|
|
3492
|
+
if (Array.isArray(x)) {
|
|
3493
|
+
const _ = Ct({ from: b.x, velocity: o === "y" ? 0 : p.x, friction: y }), L = Ct({ from: b.y, velocity: o === "x" ? 0 : p.y, friction: y });
|
|
3494
|
+
let A = x[0];
|
|
3495
|
+
for (const M of x)
|
|
3496
|
+
Math.hypot(M.x - _, M.y - L) < Math.hypot(A.x - _, A.y - L) && (A = M);
|
|
3497
|
+
A && (T = [A.x], w = [A.y]);
|
|
3498
|
+
} else typeof x == "number" ? (T = x, w = x) : x && (T = je(x.x), w = je(x.y));
|
|
3499
3499
|
const S = {};
|
|
3500
|
-
o !== "y" && (S.x = { velocity: p.x, friction: y, min:
|
|
3501
|
-
}, m = new
|
|
3500
|
+
o !== "y" && (S.x = { velocity: p.x, friction: y, min: v.minX, max: v.maxX, end: T }), o !== "x" && (S.y = { velocity: p.y, friction: y, min: v.minY, max: v.maxY, end: w }), f = i.to(r, { inertia: S, onComplete: () => s.onThrowComplete?.() });
|
|
3501
|
+
}, m = new Di({
|
|
3502
3502
|
target: r,
|
|
3503
3503
|
axis: o,
|
|
3504
3504
|
snap: s.snap,
|
|
@@ -3507,7 +3507,7 @@ function Jn(i, t, e, s = {}) {
|
|
|
3507
3507
|
},
|
|
3508
3508
|
getPosition: a,
|
|
3509
3509
|
onPress: () => {
|
|
3510
|
-
u(), c && (h.bounds =
|
|
3510
|
+
u(), c && (h.bounds = We(r, c)), s.onPress?.();
|
|
3511
3511
|
},
|
|
3512
3512
|
onDrag: (p) => {
|
|
3513
3513
|
t.apply(n, o === "x" ? { x: p.x } : o === "y" ? { y: p.y } : { x: p.x, y: p.y }), s.onDrag?.(p);
|
|
@@ -3531,42 +3531,42 @@ function Jn(i, t, e, s = {}) {
|
|
|
3531
3531
|
}
|
|
3532
3532
|
};
|
|
3533
3533
|
}
|
|
3534
|
-
function
|
|
3535
|
-
const r = typeof n.bounds == "object" && n.bounds !== null && !
|
|
3536
|
-
const
|
|
3537
|
-
return typeof
|
|
3538
|
-
}, a = (
|
|
3534
|
+
function sr(i, t, e, s, n) {
|
|
3535
|
+
const r = typeof n.bounds == "object" && n.bounds !== null && !le(n.bounds) ? n.bounds : {}, o = () => {
|
|
3536
|
+
const v = t.appliedValue(e, "rotate");
|
|
3537
|
+
return typeof v == "number" ? v : 0;
|
|
3538
|
+
}, a = (v) => Math.min(r.maxRotation ?? 1 / 0, Math.max(r.minRotation ?? -1 / 0, v));
|
|
3539
3539
|
let c = null, l = !1, h, f = { x: 0, y: 0 }, u = 0, d = 0, m = [];
|
|
3540
|
-
const p = (
|
|
3540
|
+
const p = (v) => Math.atan2(v.clientY - f.y, v.clientX - f.x) * 180 / Math.PI, g = (v) => {
|
|
3541
3541
|
if (l) return;
|
|
3542
|
-
c?.kill(), c = null, l = !0, h =
|
|
3543
|
-
const
|
|
3544
|
-
f = { x:
|
|
3545
|
-
}, y = (
|
|
3546
|
-
if (!l ||
|
|
3547
|
-
const
|
|
3548
|
-
let
|
|
3549
|
-
|
|
3550
|
-
let
|
|
3551
|
-
n.snap && (
|
|
3542
|
+
c?.kill(), c = null, l = !0, h = v.pointerId, s.setPointerCapture?.(v.pointerId);
|
|
3543
|
+
const T = s.getBoundingClientRect();
|
|
3544
|
+
f = { x: T.left + T.width / 2, y: T.top + T.height / 2 }, u = p(v), d = o(), m = [{ time: performance.now(), rotation: d }], n.onPress?.();
|
|
3545
|
+
}, y = (v) => {
|
|
3546
|
+
if (!l || v.pointerId !== h) return;
|
|
3547
|
+
const T = p(v);
|
|
3548
|
+
let w = T - u;
|
|
3549
|
+
w > 180 && (w -= 360), w < -180 && (w += 360), u = T, d += w;
|
|
3550
|
+
let x = a(d);
|
|
3551
|
+
n.snap && (x = a(Math.round(x / n.snap) * n.snap)), t.apply(e, { rotate: x });
|
|
3552
3552
|
const S = performance.now();
|
|
3553
|
-
for (m.push({ time: S, rotation:
|
|
3553
|
+
for (m.push({ time: S, rotation: x }); m.length > 2 && S - m[0].time > 100; ) m.shift();
|
|
3554
3554
|
const _ = { x: 0, y: 0 };
|
|
3555
3555
|
n.onDrag?.(_);
|
|
3556
|
-
}, b = (
|
|
3557
|
-
if (!l ||
|
|
3556
|
+
}, b = (v) => {
|
|
3557
|
+
if (!l || v.pointerId !== h) return;
|
|
3558
3558
|
l = !1;
|
|
3559
|
-
const
|
|
3559
|
+
const T = m[0], w = m[m.length - 1], x = T && w ? (w.time - T.time) / 1e3 : 0, S = x > 0 ? (w.rotation - T.rotation) / x : 0;
|
|
3560
3560
|
if (n.onRelease?.({ x: S, y: 0 }), !n.inertia) return;
|
|
3561
|
-
const _ = n.inertia === !0 ? {} : n.inertia,
|
|
3561
|
+
const _ = n.inertia === !0 ? {} : n.inertia, L = _.friction ?? (_.resistance !== void 0 ? ye(_.resistance) : 4), A = typeof _.end == "number" || Array.isArray(_.end) ? _.end : void 0;
|
|
3562
3562
|
c = i.to(s, {
|
|
3563
3563
|
inertia: {
|
|
3564
3564
|
rotate: {
|
|
3565
3565
|
velocity: S,
|
|
3566
|
-
friction:
|
|
3566
|
+
friction: L,
|
|
3567
3567
|
min: r.minRotation,
|
|
3568
3568
|
max: r.maxRotation,
|
|
3569
|
-
end: Array.isArray(
|
|
3569
|
+
end: Array.isArray(A) ? A.filter((M) => typeof M == "number") : A
|
|
3570
3570
|
}
|
|
3571
3571
|
},
|
|
3572
3572
|
onComplete: () => n.onThrowComplete?.()
|
|
@@ -3583,28 +3583,28 @@ function tr(i, t, e, s, n) {
|
|
|
3583
3583
|
}
|
|
3584
3584
|
};
|
|
3585
3585
|
}
|
|
3586
|
-
const
|
|
3587
|
-
function
|
|
3586
|
+
const nr = { opacity: 0, scale: 0.6 };
|
|
3587
|
+
function rr(i) {
|
|
3588
3588
|
const t = i.getBoundingClientRect();
|
|
3589
3589
|
return t.width === 0 && t.height === 0 ? null : { cx: t.left + t.width / 2, cy: t.top + t.height / 2, width: t.width, height: t.height };
|
|
3590
3590
|
}
|
|
3591
|
-
function
|
|
3592
|
-
const t =
|
|
3591
|
+
function Ue(i) {
|
|
3592
|
+
const t = Ft(i);
|
|
3593
3593
|
return t.width === 0 && t.height === 0 ? null : { cx: t.left + t.width / 2, cy: t.top + t.height / 2, width: t.width, height: t.height };
|
|
3594
3594
|
}
|
|
3595
|
-
function
|
|
3595
|
+
function he(i, t) {
|
|
3596
3596
|
const s = i.resolveTargets(t).map((o) => i.elementFor(o)).filter((o) => !!o), n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map();
|
|
3597
3597
|
for (const o of s) {
|
|
3598
|
-
const a =
|
|
3598
|
+
const a = rr(o);
|
|
3599
3599
|
n.set(o, a);
|
|
3600
|
-
const c =
|
|
3600
|
+
const c = Oi(o);
|
|
3601
3601
|
a && c !== void 0 && !r.has(c) && r.set(c, { element: o, box: a });
|
|
3602
3602
|
}
|
|
3603
3603
|
return { elements: s, boxes: n, ids: r };
|
|
3604
3604
|
}
|
|
3605
|
-
const
|
|
3606
|
-
function
|
|
3607
|
-
const n = s.duration ?? 0.6, r = s.ease ?? "power2.inOut", o = s.stagger ?? 0, a = s.scale !== !1, c = s.enter === void 0 ?
|
|
3605
|
+
const Qt = /* @__PURE__ */ new WeakMap();
|
|
3606
|
+
function ue(i, t, e, s = {}) {
|
|
3607
|
+
const n = s.duration ?? 0.6, r = s.ease ?? "power2.inOut", o = s.stagger ?? 0, a = s.scale !== !1, c = s.enter === void 0 ? nr : s.enter, l = new Set(e.elements);
|
|
3608
3608
|
if (s.targets !== void 0)
|
|
3609
3609
|
for (const d of i.resolveTargets(s.targets)) {
|
|
3610
3610
|
const m = i.elementFor(d);
|
|
@@ -3615,48 +3615,48 @@ function le(i, t, e, s = {}) {
|
|
|
3615
3615
|
), f = t({ onComplete: s.onComplete });
|
|
3616
3616
|
let u = 0;
|
|
3617
3617
|
for (const d of h) {
|
|
3618
|
-
const m =
|
|
3618
|
+
const m = Ue(d);
|
|
3619
3619
|
if (!m) continue;
|
|
3620
3620
|
let p = e.boxes.get(d) ?? null, g;
|
|
3621
|
-
const y =
|
|
3621
|
+
const y = Oi(d), b = !p && y !== void 0 ? e.ids.get(y) : void 0;
|
|
3622
3622
|
b && b.element !== d && (p = b.box, g = b.element);
|
|
3623
|
-
const [
|
|
3624
|
-
|
|
3625
|
-
const
|
|
3623
|
+
const [v] = i.resolveTargets(d);
|
|
3624
|
+
Qt.get(d)?.timeline.removeTracks({ target: v });
|
|
3625
|
+
const T = u * o;
|
|
3626
3626
|
if (!p) {
|
|
3627
3627
|
if (c === !1) continue;
|
|
3628
|
-
f.fromTo(d, { x: 0, y: 0, scaleX: 1, scaleY: 1, ...c }, { ...
|
|
3628
|
+
f.fromTo(d, { x: 0, y: 0, scaleX: 1, scaleY: 1, ...c }, { ...Bi(c), x: 0, y: 0, scaleX: 1, scaleY: 1, duration: n, ease: r, delay: T }, 0), Qt.set(d, f), u++;
|
|
3629
3629
|
continue;
|
|
3630
3630
|
}
|
|
3631
|
-
const
|
|
3632
|
-
if (!(Math.abs(
|
|
3633
|
-
const
|
|
3634
|
-
const
|
|
3635
|
-
return typeof
|
|
3631
|
+
const w = p.cx - m.cx, x = p.cy - m.cy, S = a ? p.width / m.width : 1, _ = a ? p.height / m.height : 1;
|
|
3632
|
+
if (!(Math.abs(w) > 0.5 || Math.abs(x) > 0.5 || Math.abs(S - 1) > 1e-3 || Math.abs(_ - 1) > 1e-3)) {
|
|
3633
|
+
const M = (E, k) => {
|
|
3634
|
+
const P = i.appliedValue(v, E);
|
|
3635
|
+
return typeof P == "number" && Math.abs(P - k) > 1e-6;
|
|
3636
3636
|
};
|
|
3637
|
-
(
|
|
3637
|
+
(M("x", 0) || M("y", 0) || M("scaleX", 1) || M("scaleY", 1)) && f.set(d, { x: 0, y: 0, scaleX: 1, scaleY: 1 }, 0);
|
|
3638
3638
|
continue;
|
|
3639
3639
|
}
|
|
3640
|
-
const
|
|
3640
|
+
const A = s.fade === !0 && g !== void 0;
|
|
3641
3641
|
f.fromTo(
|
|
3642
3642
|
d,
|
|
3643
|
-
{ x:
|
|
3644
|
-
{ x: 0, y: 0, scaleX: 1, scaleY: 1, ...
|
|
3643
|
+
{ x: w, y: x, scaleX: S, scaleY: _, ...A && { opacity: 0 } },
|
|
3644
|
+
{ x: 0, y: 0, scaleX: 1, scaleY: 1, ...A && { opacity: 1 }, duration: n, ease: r, delay: T },
|
|
3645
3645
|
0
|
|
3646
|
-
),
|
|
3646
|
+
), A && g && Ue(g) && f.fromTo(g, { opacity: 1 }, { opacity: 0, duration: n, ease: r, delay: T }, 0), Qt.set(d, f), u++;
|
|
3647
3647
|
}
|
|
3648
3648
|
return f;
|
|
3649
3649
|
}
|
|
3650
|
-
function
|
|
3650
|
+
function Oi(i) {
|
|
3651
3651
|
return i.dataset?.flipId;
|
|
3652
3652
|
}
|
|
3653
|
-
function
|
|
3653
|
+
function Bi(i) {
|
|
3654
3654
|
const t = {};
|
|
3655
3655
|
for (const e of Object.keys(i))
|
|
3656
3656
|
t[e] = e === "opacity" || e.startsWith("scale") ? 1 : 0;
|
|
3657
3657
|
return t;
|
|
3658
3658
|
}
|
|
3659
|
-
function
|
|
3659
|
+
function or(i, t = {}) {
|
|
3660
3660
|
const e = new Set((t.type ?? "chars,words,lines").split(",").map((p) => p.trim())), s = {
|
|
3661
3661
|
chars: t.charsClass ?? "char",
|
|
3662
3662
|
words: t.wordsClass ?? "word",
|
|
@@ -3675,16 +3675,16 @@ function sr(i, t = {}) {
|
|
|
3675
3675
|
}, u = () => {
|
|
3676
3676
|
const p = { chars: [], words: [], lines: [], masks: [] };
|
|
3677
3677
|
for (const { element: g } of r) {
|
|
3678
|
-
const y = (g.textContent ?? "").replace(/\s+/g, " ").trim(), b =
|
|
3678
|
+
const y = (g.textContent ?? "").replace(/\s+/g, " ").trim(), b = ar(g, s.words), v = e.has("chars") ? b.flatMap((x) => cr(x, s.chars)) : [], T = e.has("lines") ? hr(g, b, s.lines) : [];
|
|
3679
3679
|
if (n) {
|
|
3680
3680
|
!g.hasAttribute("aria-label") && y && g.setAttribute("aria-label", y);
|
|
3681
|
-
for (const
|
|
3681
|
+
for (const x of b) x.setAttribute("aria-hidden", "true");
|
|
3682
3682
|
}
|
|
3683
3683
|
if (e.has("words")) p.words.push(...b);
|
|
3684
|
-
else for (const
|
|
3685
|
-
p.chars.push(...
|
|
3686
|
-
const
|
|
3687
|
-
for (const
|
|
3684
|
+
else for (const x of b) x.removeAttribute("class");
|
|
3685
|
+
p.chars.push(...v), p.lines.push(...T);
|
|
3686
|
+
const w = t.mask === "lines" ? T : t.mask === "words" ? b : t.mask === "chars" ? v : [];
|
|
3687
|
+
for (const x of w) p.masks.push(ur(x, `${s[t.mask]}-mask`));
|
|
3688
3688
|
}
|
|
3689
3689
|
o = p;
|
|
3690
3690
|
}, d = {
|
|
@@ -3715,28 +3715,28 @@ function sr(i, t = {}) {
|
|
|
3715
3715
|
const y = () => {
|
|
3716
3716
|
if (g) return;
|
|
3717
3717
|
g = !0;
|
|
3718
|
-
const
|
|
3718
|
+
const v = () => {
|
|
3719
3719
|
g = !1, d.split();
|
|
3720
3720
|
};
|
|
3721
|
-
typeof requestAnimationFrame == "function" ? requestAnimationFrame(
|
|
3721
|
+
typeof requestAnimationFrame == "function" ? requestAnimationFrame(v) : setTimeout(v, 0);
|
|
3722
3722
|
};
|
|
3723
3723
|
if (typeof ResizeObserver == "function") {
|
|
3724
|
-
c = new ResizeObserver((
|
|
3725
|
-
let
|
|
3726
|
-
for (const
|
|
3727
|
-
const
|
|
3728
|
-
p.set(
|
|
3724
|
+
c = new ResizeObserver((v) => {
|
|
3725
|
+
let T = !1;
|
|
3726
|
+
for (const w of v) {
|
|
3727
|
+
const x = Math.round(w.contentRect.width), S = p.get(w.target);
|
|
3728
|
+
p.set(w.target, x), S !== void 0 && S !== x && (T = !0);
|
|
3729
3729
|
}
|
|
3730
|
-
|
|
3730
|
+
T && y();
|
|
3731
3731
|
});
|
|
3732
|
-
for (const
|
|
3732
|
+
for (const v of i) c.observe(v);
|
|
3733
3733
|
}
|
|
3734
3734
|
const b = i[0]?.ownerDocument?.fonts;
|
|
3735
3735
|
b && b.status !== "loaded" && b.ready.then(() => y());
|
|
3736
3736
|
}
|
|
3737
3737
|
return d;
|
|
3738
3738
|
}
|
|
3739
|
-
function
|
|
3739
|
+
function ar(i, t) {
|
|
3740
3740
|
const e = i.ownerDocument, s = [], n = e.createTreeWalker(
|
|
3741
3741
|
i,
|
|
3742
3742
|
4
|
|
@@ -3759,18 +3759,18 @@ function nr(i, t) {
|
|
|
3759
3759
|
}
|
|
3760
3760
|
return s;
|
|
3761
3761
|
}
|
|
3762
|
-
function
|
|
3763
|
-
const e = i.ownerDocument, s =
|
|
3762
|
+
function cr(i, t) {
|
|
3763
|
+
const e = i.ownerDocument, s = lr(i.textContent ?? "").map((n) => {
|
|
3764
3764
|
const r = e.createElement("span");
|
|
3765
3765
|
return r.className = t, r.style.display = "inline-block", r.textContent = n, r;
|
|
3766
3766
|
});
|
|
3767
3767
|
return i.replaceChildren(...s), s;
|
|
3768
3768
|
}
|
|
3769
|
-
function
|
|
3769
|
+
function lr(i) {
|
|
3770
3770
|
const t = Intl.Segmenter;
|
|
3771
3771
|
return t ? Array.from(new t(void 0, { granularity: "grapheme" }).segment(i), (e) => e.segment) : Array.from(i);
|
|
3772
3772
|
}
|
|
3773
|
-
function
|
|
3773
|
+
function hr(i, t, e) {
|
|
3774
3774
|
const s = i.ownerDocument, n = new Map(t.map((m) => [m, m.getBoundingClientRect()])), r = [], o = (m) => {
|
|
3775
3775
|
for (const p of Array.from(m.childNodes))
|
|
3776
3776
|
p.nodeType === 3 || n.has(p) || p.tagName === "BR" ? r.push(p) : o(p);
|
|
@@ -3789,24 +3789,24 @@ function ar(i, t, e) {
|
|
|
3789
3789
|
const p = n.get(m);
|
|
3790
3790
|
if (p && (!c || f || p.top > l + h) && (d(), l = p.top, h = p.height / 2, f = !1), !c) continue;
|
|
3791
3791
|
const g = [];
|
|
3792
|
-
for (let
|
|
3792
|
+
for (let v = m.parentNode; v && v !== i; v = v.parentNode) g.unshift(v);
|
|
3793
3793
|
let y = 0;
|
|
3794
3794
|
for (; y < u.length && y < g.length && u[y].original === g[y]; ) y++;
|
|
3795
3795
|
u.length = y;
|
|
3796
3796
|
let b = y === 0 ? c : u[y - 1].clone;
|
|
3797
|
-
for (const
|
|
3798
|
-
const
|
|
3799
|
-
b.appendChild(
|
|
3797
|
+
for (const v of g.slice(y)) {
|
|
3798
|
+
const T = v.cloneNode(!1);
|
|
3799
|
+
b.appendChild(T), u.push({ original: v, clone: T }), b = T;
|
|
3800
3800
|
}
|
|
3801
3801
|
b.appendChild(m);
|
|
3802
3802
|
}
|
|
3803
3803
|
return i.replaceChildren(...a), a;
|
|
3804
3804
|
}
|
|
3805
|
-
function
|
|
3805
|
+
function ur(i, t) {
|
|
3806
3806
|
const e = i.ownerDocument.createElement("span");
|
|
3807
3807
|
return e.className = t, e.style.display = i.style.display === "block" ? "block" : "inline-block", e.style.overflow = "clip", e.style.paddingBottom = "0.12em", e.style.marginBottom = "-0.12em", i.replaceWith(e), e.appendChild(i), e;
|
|
3808
3808
|
}
|
|
3809
|
-
const
|
|
3809
|
+
const ze = {
|
|
3810
3810
|
top: 0,
|
|
3811
3811
|
left: 0,
|
|
3812
3812
|
start: 0,
|
|
@@ -3817,15 +3817,15 @@ const We = {
|
|
|
3817
3817
|
right: 1,
|
|
3818
3818
|
end: 1
|
|
3819
3819
|
};
|
|
3820
|
-
function
|
|
3820
|
+
function He(i) {
|
|
3821
3821
|
const t = i.trim().toLowerCase();
|
|
3822
|
-
if (t in
|
|
3822
|
+
if (t in ze) return ze[t];
|
|
3823
3823
|
if (t.endsWith("%")) {
|
|
3824
3824
|
const e = Number.parseFloat(t.slice(0, -1));
|
|
3825
3825
|
return Number.isNaN(e) ? void 0 : e / 100;
|
|
3826
3826
|
}
|
|
3827
3827
|
}
|
|
3828
|
-
function
|
|
3828
|
+
function Ni(i) {
|
|
3829
3829
|
if (typeof i == "number")
|
|
3830
3830
|
return { elementFraction: 0, viewportFraction: 0, offsetPx: 0, absolutePx: i };
|
|
3831
3831
|
let t = 0;
|
|
@@ -3837,31 +3837,31 @@ function Li(i) {
|
|
|
3837
3837
|
offsetPx: 0,
|
|
3838
3838
|
absolutePx: Number.parseFloat(s[0]) + t
|
|
3839
3839
|
};
|
|
3840
|
-
const n = s[0] !== void 0 ?
|
|
3840
|
+
const n = s[0] !== void 0 ? He(s[0]) : void 0, r = s[1] !== void 0 ? He(s[1]) : void 0;
|
|
3841
3841
|
return {
|
|
3842
3842
|
elementFraction: n ?? 0,
|
|
3843
3843
|
viewportFraction: r ?? 0,
|
|
3844
3844
|
offsetPx: t
|
|
3845
3845
|
};
|
|
3846
3846
|
}
|
|
3847
|
-
function
|
|
3848
|
-
const s =
|
|
3847
|
+
function gt(i, t, e) {
|
|
3848
|
+
const s = Ni(e), n = s.absolutePx !== void 0 ? i.top + s.absolutePx : i.top + i.height * s.elementFraction, r = t * s.viewportFraction;
|
|
3849
3849
|
return n - r + s.offsetPx;
|
|
3850
3850
|
}
|
|
3851
|
-
function
|
|
3852
|
-
const n =
|
|
3853
|
-
return o <= 0 ? n <= 0 ? 1 : 0 :
|
|
3851
|
+
function _o(i, t, e, s) {
|
|
3852
|
+
const n = gt(i, t, e), o = gt(i, t, s) - n;
|
|
3853
|
+
return o <= 0 ? n <= 0 ? 1 : 0 : qi(-n / o);
|
|
3854
3854
|
}
|
|
3855
|
-
function
|
|
3855
|
+
function qi(i) {
|
|
3856
3856
|
return i < 0 ? 0 : i > 1 ? 1 : i === 0 ? 0 : i;
|
|
3857
3857
|
}
|
|
3858
|
-
function
|
|
3858
|
+
function fr(i, t, e, s) {
|
|
3859
3859
|
if (e <= 0) return t;
|
|
3860
3860
|
const n = 1 - Math.exp(-(s / 1e3) / e);
|
|
3861
3861
|
return i + (t - i) * n;
|
|
3862
3862
|
}
|
|
3863
|
-
function
|
|
3864
|
-
const r = (h) =>
|
|
3863
|
+
function Ge(i, t, e, s, n) {
|
|
3864
|
+
const r = (h) => gt({ top: i + n(h), bottom: i + n(h) + t, height: t }, e, s), o = r(0), a = r(1);
|
|
3865
3865
|
if (Math.sign(o) === Math.sign(a) || o === 0 || a === 0)
|
|
3866
3866
|
return o === 0 ? 0 : a === 0 ? 1 : Math.abs(o) < Math.abs(a) ? 0 : 1;
|
|
3867
3867
|
let c = 0, l = 1;
|
|
@@ -3871,7 +3871,7 @@ function Ue(i, t, e, s, n) {
|
|
|
3871
3871
|
}
|
|
3872
3872
|
return (c + l) / 2;
|
|
3873
3873
|
}
|
|
3874
|
-
class
|
|
3874
|
+
class dr {
|
|
3875
3875
|
timeline;
|
|
3876
3876
|
trigger;
|
|
3877
3877
|
behaviour;
|
|
@@ -3918,11 +3918,11 @@ class hr {
|
|
|
3918
3918
|
this.options.onLeave?.(), this.behaviour === "reset" && this.timeline.stop();
|
|
3919
3919
|
}
|
|
3920
3920
|
}
|
|
3921
|
-
function
|
|
3922
|
-
const t = new
|
|
3921
|
+
function Co(i) {
|
|
3922
|
+
const t = new dr(i);
|
|
3923
3923
|
return t.start(), t;
|
|
3924
3924
|
}
|
|
3925
|
-
class
|
|
3925
|
+
class pr {
|
|
3926
3926
|
element;
|
|
3927
3927
|
spacer;
|
|
3928
3928
|
saved;
|
|
@@ -3951,28 +3951,28 @@ class ur {
|
|
|
3951
3951
|
this.element.style.position = this.saved.position, this.element.style.top = this.saved.top, this.element.style.left = this.saved.left, this.spacer.parentNode && this.spacer.replaceWith(this.element);
|
|
3952
3952
|
}
|
|
3953
3953
|
}
|
|
3954
|
-
const
|
|
3955
|
-
function
|
|
3954
|
+
const mr = 0.15;
|
|
3955
|
+
function gr(i) {
|
|
3956
3956
|
return typeof i == "object" && !Array.isArray(i) ? i : { snapTo: i };
|
|
3957
3957
|
}
|
|
3958
|
-
function
|
|
3959
|
-
const s =
|
|
3960
|
-
if (typeof e == "function") return
|
|
3958
|
+
function yr(i, t, e) {
|
|
3959
|
+
const s = St(i + t * mr);
|
|
3960
|
+
if (typeof e == "function") return St(e(s));
|
|
3961
3961
|
if (typeof e == "number")
|
|
3962
|
-
return e <= 0 ? i :
|
|
3962
|
+
return e <= 0 ? i : St(Math.round(s / e) * e);
|
|
3963
3963
|
if (e.length === 0) return i;
|
|
3964
3964
|
let n = e[0];
|
|
3965
3965
|
for (const r of e)
|
|
3966
3966
|
Math.abs(r - s) < Math.abs(n - s) && (n = r);
|
|
3967
|
-
return
|
|
3967
|
+
return St(n);
|
|
3968
3968
|
}
|
|
3969
|
-
function
|
|
3969
|
+
function br(i, t, e) {
|
|
3970
3970
|
const s = i.duration ?? { min: 0.2, max: 0.8 };
|
|
3971
3971
|
if (typeof s == "number") return s;
|
|
3972
3972
|
const n = Math.min(1, Math.abs(t) / Math.max(1, e));
|
|
3973
3973
|
return s.min + (s.max - s.min) * n;
|
|
3974
3974
|
}
|
|
3975
|
-
class
|
|
3975
|
+
class vr {
|
|
3976
3976
|
rafId = null;
|
|
3977
3977
|
cancelEvents = ["wheel", "touchstart", "pointerdown", "keydown"];
|
|
3978
3978
|
onInterrupt = () => this.cancel();
|
|
@@ -3984,7 +3984,7 @@ class gr {
|
|
|
3984
3984
|
get active() {
|
|
3985
3985
|
return this.rafId !== null;
|
|
3986
3986
|
}
|
|
3987
|
-
animate(t, e, s, n =
|
|
3987
|
+
animate(t, e, s, n = Nt, r) {
|
|
3988
3988
|
if (this.cancel(), typeof requestAnimationFrame > "u" || s <= 0) {
|
|
3989
3989
|
this.write(e), r?.();
|
|
3990
3990
|
return;
|
|
@@ -4005,10 +4005,10 @@ class gr {
|
|
|
4005
4005
|
for (const t of this.cancelEvents) this.eventTarget?.removeEventListener(t, this.onInterrupt);
|
|
4006
4006
|
}
|
|
4007
4007
|
}
|
|
4008
|
-
function
|
|
4008
|
+
function St(i) {
|
|
4009
4009
|
return Math.max(0, Math.min(1, i));
|
|
4010
4010
|
}
|
|
4011
|
-
class
|
|
4011
|
+
class wr {
|
|
4012
4012
|
options;
|
|
4013
4013
|
scroller;
|
|
4014
4014
|
nodes = [];
|
|
@@ -4049,24 +4049,24 @@ class yr {
|
|
|
4049
4049
|
for (const t of this.nodes.splice(0)) t.remove();
|
|
4050
4050
|
}
|
|
4051
4051
|
}
|
|
4052
|
-
const
|
|
4053
|
-
let
|
|
4054
|
-
const
|
|
4055
|
-
|
|
4056
|
-
|
|
4057
|
-
for (const i of
|
|
4052
|
+
const Tr = 120, et = [], ot = /* @__PURE__ */ new Set();
|
|
4053
|
+
let Jt = !1;
|
|
4054
|
+
const xr = () => {
|
|
4055
|
+
Jt || ot.size === 0 || (Jt = !0, queueMicrotask(() => {
|
|
4056
|
+
Jt = !1;
|
|
4057
|
+
for (const i of ot) i.afterRefresh();
|
|
4058
4058
|
}));
|
|
4059
|
-
},
|
|
4060
|
-
for (const i of
|
|
4061
|
-
for (const i of
|
|
4062
|
-
for (const i of
|
|
4059
|
+
}, Xi = () => {
|
|
4060
|
+
for (const i of ot) i.beforeRefresh();
|
|
4061
|
+
for (const i of et) i.refresh();
|
|
4062
|
+
for (const i of ot) i.afterRefresh();
|
|
4063
4063
|
};
|
|
4064
|
-
let
|
|
4065
|
-
const
|
|
4066
|
-
const i = window.innerWidth, t = window.innerHeight, e = i ===
|
|
4067
|
-
e && s && n || (
|
|
4064
|
+
let it = { width: 0, height: 0 };
|
|
4065
|
+
const Ke = () => {
|
|
4066
|
+
const i = window.innerWidth, t = window.innerHeight, e = i === it.width && t !== it.height, s = Math.abs(t - it.height) < it.height * 0.25, n = typeof navigator < "u" && (navigator.maxTouchPoints ?? 0) > 0;
|
|
4067
|
+
e && s && n || (it = { width: i, height: t }, Xi());
|
|
4068
4068
|
};
|
|
4069
|
-
class
|
|
4069
|
+
class qt {
|
|
4070
4070
|
timeline;
|
|
4071
4071
|
options;
|
|
4072
4072
|
running = !1;
|
|
@@ -4096,16 +4096,16 @@ class Bt {
|
|
|
4096
4096
|
markers = null;
|
|
4097
4097
|
markerGeometry = null;
|
|
4098
4098
|
constructor(t) {
|
|
4099
|
-
this.timeline = t.timeline, this.options = t, this.snapper = new
|
|
4099
|
+
this.timeline = t.timeline, this.options = t, this.snapper = new vr((e) => this.scrollTo(e), typeof window < "u" ? window : null);
|
|
4100
4100
|
}
|
|
4101
4101
|
start() {
|
|
4102
4102
|
if (this.running) return;
|
|
4103
4103
|
this.running = !0, this.timeline?.pause();
|
|
4104
4104
|
const t = this.options.pin === !0 ? this.options.trigger : this.options.pin || null;
|
|
4105
|
-
t && !this.options.container && (this.pin = new
|
|
4105
|
+
t && !this.options.container && (this.pin = new pr(t, { axis: this.options.horizontal ? "x" : "y", spacing: this.options.pinSpacing !== !1 })), this.options.markers && !this.options.horizontal && typeof document < "u" && (this.markers = new wr(document, this.options.scroller ?? null, this.options.markers)), this.scrollTarget()?.addEventListener("scroll", this.onScroll, { passive: !0 }), et.length === 0 && typeof window < "u" && (it = { width: window.innerWidth, height: window.innerHeight }, window.addEventListener("resize", Ke, { passive: !0 })), et.push(this), this.refresh();
|
|
4106
4106
|
}
|
|
4107
4107
|
stop() {
|
|
4108
|
-
this.running && (this.running = !1, this.scrollTarget()?.removeEventListener("scroll", this.onScroll),
|
|
4108
|
+
this.running && (this.running = !1, this.scrollTarget()?.removeEventListener("scroll", this.onScroll), et.splice(et.indexOf(this), 1), et.length === 0 && typeof window < "u" && window.removeEventListener("resize", Ke), this.stopSmoothing(), this.idleTimer !== null && clearTimeout(this.idleTimer), this.idleTimer = null, this.snapTimer !== null && clearTimeout(this.snapTimer), this.snapTimer = null, this.snapper.cancel());
|
|
4109
4109
|
}
|
|
4110
4110
|
/** Stop, and remove any pin spacer. */
|
|
4111
4111
|
destroy() {
|
|
@@ -4123,11 +4123,11 @@ class Bt {
|
|
|
4123
4123
|
* layout change a resize would not catch (images or fonts loading).
|
|
4124
4124
|
*/
|
|
4125
4125
|
static refreshAll() {
|
|
4126
|
-
|
|
4126
|
+
Xi();
|
|
4127
4127
|
}
|
|
4128
4128
|
/** Be told around every re-measure; returns a function that stops it. */
|
|
4129
4129
|
static onRefresh(t) {
|
|
4130
|
-
return
|
|
4130
|
+
return ot.add(t), () => ot.delete(t);
|
|
4131
4131
|
}
|
|
4132
4132
|
/** Current scroll progress, 0..1. */
|
|
4133
4133
|
get progress() {
|
|
@@ -4153,13 +4153,13 @@ class Bt {
|
|
|
4153
4153
|
this.measureInContainer(this.options.container);
|
|
4154
4154
|
else if (e) {
|
|
4155
4155
|
const s = this.viewportHeight();
|
|
4156
|
-
if (this.startPx = t +
|
|
4156
|
+
if (this.startPx = t + gt(e, s, ft(this.options.start) ?? "top bottom"), this.endPx = this.resolveEnd(e, s, t), this.pin) {
|
|
4157
4157
|
const n = this.relativeRect(this.pin.element.getBoundingClientRect());
|
|
4158
4158
|
this.pin.apply(n.top - (this.startPx - t), this.endPx - this.startPx);
|
|
4159
4159
|
}
|
|
4160
4160
|
this.markerGeometry = this.markers ? this.markersFor(s) : null;
|
|
4161
4161
|
}
|
|
4162
|
-
this.markers && this.markerGeometry && this.markers.place(this.markerGeometry, t), this.lastScroll = null, this.updateFrom(t, !this.measured), this.measured = !0,
|
|
4162
|
+
this.markers && this.markerGeometry && this.markers.place(this.markerGeometry, t), this.lastScroll = null, this.updateFrom(t, !this.measured), this.measured = !0, xr();
|
|
4163
4163
|
}
|
|
4164
4164
|
/** Same as `refresh()`. */
|
|
4165
4165
|
sample() {
|
|
@@ -4177,7 +4177,7 @@ class Bt {
|
|
|
4177
4177
|
updateFrom(t, e) {
|
|
4178
4178
|
this.trackVelocity(t), this.markers && this.markerGeometry && this.markers.follow(this.markerGeometry, t);
|
|
4179
4179
|
const s = this.endPx - this.startPx, n = this.zone;
|
|
4180
|
-
this.targetProgress = s > 0 ?
|
|
4180
|
+
this.targetProgress = s > 0 ? qi((t - this.startPx) / s) : t >= this.startPx ? 1 : 0, this.zone = s > 0 ? t <= this.startPx ? "before" : t >= this.endPx ? "after" : "active" : t >= this.startPx ? "after" : "before", this.fireBoundaryCallbacks(n, this.zone), e || this.smoothing() <= 0 ? (this.displayProgress = this.targetProgress, this.applyProgress()) : (this.emitUpdate(), this.startSmoothing());
|
|
4181
4181
|
}
|
|
4182
4182
|
/** Seconds of smoothing, or 0 for exact tracking. */
|
|
4183
4183
|
smoothing() {
|
|
@@ -4185,12 +4185,12 @@ class Bt {
|
|
|
4185
4185
|
return typeof t == "number" ? Math.max(0, t) : 0;
|
|
4186
4186
|
}
|
|
4187
4187
|
resolveEnd(t, e, s) {
|
|
4188
|
-
const n =
|
|
4188
|
+
const n = ft(this.options.end) ?? "bottom top", r = typeof n == "string" ? n.trim().match(/^\+=\s*(-?[\d.]+)\s*(%|px)?$/) : null;
|
|
4189
4189
|
if (r) {
|
|
4190
4190
|
const o = Number.parseFloat(r[1]);
|
|
4191
4191
|
return this.startPx + (r[2] === "%" ? e * o / 100 : o);
|
|
4192
4192
|
}
|
|
4193
|
-
return s +
|
|
4193
|
+
return s + gt(t, e, n);
|
|
4194
4194
|
}
|
|
4195
4195
|
applyProgress() {
|
|
4196
4196
|
const t = this.timeline?.duration ?? 0;
|
|
@@ -4205,7 +4205,7 @@ class Bt {
|
|
|
4205
4205
|
const e = typeof performance < "u" ? performance.now() : Date.now();
|
|
4206
4206
|
this.lastScroll !== null && e > this.lastScrollTime && t !== this.lastScroll && (this.velocityPxPerSecond = (t - this.lastScroll) / (e - this.lastScrollTime) * 1e3), (this.lastScroll === null || t !== this.lastScroll) && (this.lastScroll = t, this.lastScrollTime = e), !(this.velocityPxPerSecond === 0 || typeof setTimeout > "u") && (this.idleTimer !== null && clearTimeout(this.idleTimer), this.idleTimer = setTimeout(() => {
|
|
4207
4207
|
this.idleTimer = null, this.releaseVelocity = this.velocityPxPerSecond, this.velocityPxPerSecond = 0, this.emitUpdate(), this.scheduleSnap();
|
|
4208
|
-
},
|
|
4208
|
+
}, Tr));
|
|
4209
4209
|
}
|
|
4210
4210
|
/**
|
|
4211
4211
|
* Emit enter/leave callbacks as the scroll position moves between zones. A jump
|
|
@@ -4221,12 +4221,12 @@ class Bt {
|
|
|
4221
4221
|
scheduleSnap() {
|
|
4222
4222
|
const t = this.options.snap;
|
|
4223
4223
|
if (t === void 0 || this.snapper.active) return;
|
|
4224
|
-
const e =
|
|
4224
|
+
const e = gr(t), s = () => {
|
|
4225
4225
|
this.snapTimer = null;
|
|
4226
4226
|
const n = this.endPx - this.startPx, r = this.scrollPosition();
|
|
4227
4227
|
if (!this.running || n <= 0 || r <= this.startPx || r >= this.endPx) return;
|
|
4228
|
-
const o = (r - this.startPx) / n, a = this.startPx +
|
|
4229
|
-
Math.abs(a - r) < 1 || this.snapper.animate(r, a,
|
|
4228
|
+
const o = (r - this.startPx) / n, a = this.startPx + yr(o, this.releaseVelocity / n, e.snapTo) * n;
|
|
4229
|
+
Math.abs(a - r) < 1 || this.snapper.animate(r, a, br(e, a - r, this.viewportHeight()), e.ease);
|
|
4230
4230
|
};
|
|
4231
4231
|
e.delay ? this.snapTimer = setTimeout(s, e.delay * 1e3) : s();
|
|
4232
4232
|
}
|
|
@@ -4242,18 +4242,18 @@ class Bt {
|
|
|
4242
4242
|
measureInContainer(t) {
|
|
4243
4243
|
const e = this.options.trigger;
|
|
4244
4244
|
if (typeof e?.getBoundingClientRect != "function") return;
|
|
4245
|
-
const s = e.getBoundingClientRect(), n = this.options.scroller?.getBoundingClientRect?.().left ?? 0, r = this.options.scroller ? this.options.scroller.clientWidth : typeof window < "u" ? window.innerWidth : 0, o = s.left - n - t.shiftAt(t.progress()), { start: a, end: c } = t.range(), l = (d) => a + d * (c - a), h =
|
|
4245
|
+
const s = e.getBoundingClientRect(), n = this.options.scroller?.getBoundingClientRect?.().left ?? 0, r = this.options.scroller ? this.options.scroller.clientWidth : typeof window < "u" ? window.innerWidth : 0, o = s.left - n - t.shiftAt(t.progress()), { start: a, end: c } = t.range(), l = (d) => a + d * (c - a), h = Ge(o, s.width, r, ft(this.options.start) ?? "left right", t.shiftAt);
|
|
4246
4246
|
this.startPx = l(h);
|
|
4247
|
-
const f =
|
|
4248
|
-
this.endPx = u ? this.startPx + Number.parseFloat(u[1]) : l(
|
|
4247
|
+
const f = ft(this.options.end) ?? "right left", u = typeof f == "string" ? f.trim().match(/^\+=\s*(-?[\d.]+)\s*(px)?$/) : null;
|
|
4248
|
+
this.endPx = u ? this.startPx + Number.parseFloat(u[1]) : l(Ge(o, s.width, r, f, t.shiftAt)), this.markerGeometry = null;
|
|
4249
4249
|
}
|
|
4250
4250
|
/** Where the markers go: the element points on the page, and the viewport lines they meet. */
|
|
4251
4251
|
markersFor(t) {
|
|
4252
4252
|
const e = (r, o) => {
|
|
4253
|
-
const a =
|
|
4253
|
+
const a = ft(r) ?? o;
|
|
4254
4254
|
if (typeof a == "number") return 0;
|
|
4255
4255
|
if (/^\s*\+=/.test(a)) return;
|
|
4256
|
-
const c =
|
|
4256
|
+
const c = Ni(a);
|
|
4257
4257
|
return t * c.viewportFraction - c.offsetPx;
|
|
4258
4258
|
}, s = e(this.options.start, "top bottom") ?? 0, n = e(this.options.end, "bottom top") ?? s;
|
|
4259
4259
|
return {
|
|
@@ -4268,7 +4268,7 @@ class Bt {
|
|
|
4268
4268
|
const t = (e) => {
|
|
4269
4269
|
if (this.rafId = null, !this.running) return;
|
|
4270
4270
|
const s = this.lastFrameTime === null ? 16.67 : e - this.lastFrameTime;
|
|
4271
|
-
this.lastFrameTime = e, this.displayProgress =
|
|
4271
|
+
this.lastFrameTime = e, this.displayProgress = fr(this.displayProgress, this.targetProgress, this.smoothing(), s);
|
|
4272
4272
|
const n = Math.abs(this.targetProgress - this.displayProgress) < 1e-4;
|
|
4273
4273
|
n && (this.displayProgress = this.targetProgress), this.applyProgress(), n ? this.lastFrameTime = null : this.rafId = requestAnimationFrame(t);
|
|
4274
4274
|
};
|
|
@@ -4306,15 +4306,15 @@ class Bt {
|
|
|
4306
4306
|
return t ? e ? t.clientWidth : t.clientHeight : typeof window < "u" ? e ? window.innerWidth : window.innerHeight : 0;
|
|
4307
4307
|
}
|
|
4308
4308
|
}
|
|
4309
|
-
function
|
|
4309
|
+
function ft(i) {
|
|
4310
4310
|
return typeof i == "function" ? i() : i;
|
|
4311
4311
|
}
|
|
4312
|
-
function
|
|
4313
|
-
const t = new
|
|
4312
|
+
function Ro(i) {
|
|
4313
|
+
const t = new qt(i);
|
|
4314
4314
|
return t.start(), t;
|
|
4315
4315
|
}
|
|
4316
|
-
const
|
|
4317
|
-
class
|
|
4316
|
+
const te = /* @__PURE__ */ new Set(), kr = 16, Ze = 0.5, Sr = 2;
|
|
4317
|
+
class Qe {
|
|
4318
4318
|
options;
|
|
4319
4319
|
frames;
|
|
4320
4320
|
running = !1;
|
|
@@ -4344,22 +4344,22 @@ class Ge {
|
|
|
4344
4344
|
if (this.running || typeof window > "u") return this;
|
|
4345
4345
|
this.running = !0, this.reduced = this.options.reducedMotion ?? (typeof window.matchMedia == "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches), this.current = this.target = this.position();
|
|
4346
4346
|
const t = this.options.scroller ?? window;
|
|
4347
|
-
return t.addEventListener("wheel", this.onWheel, { passive: !1 }), t.addEventListener("scroll", this.onScroll, { passive: !0 }), window.addEventListener("resize", this.onResize, { passive: !0 }), window.addEventListener("load", this.onLoad),
|
|
4347
|
+
return t.addEventListener("wheel", this.onWheel, { passive: !1 }), t.addEventListener("scroll", this.onScroll, { passive: !0 }), window.addEventListener("resize", this.onResize, { passive: !0 }), window.addEventListener("load", this.onLoad), te.add(this), this.stopListening = qt.onRefresh({ beforeRefresh: () => this.rest(), afterRefresh: () => this.refresh() }), this.refresh(), this;
|
|
4348
4348
|
}
|
|
4349
4349
|
/** Re-measure every started smoother, after layout changes a resize would not catch. */
|
|
4350
4350
|
static refreshAll() {
|
|
4351
|
-
for (const t of
|
|
4351
|
+
for (const t of te) t.refresh();
|
|
4352
4352
|
}
|
|
4353
4353
|
stop() {
|
|
4354
4354
|
if (!this.running) return this;
|
|
4355
4355
|
this.running = !1;
|
|
4356
4356
|
const t = this.options.scroller ?? window;
|
|
4357
|
-
return t.removeEventListener("wheel", this.onWheel), t.removeEventListener("scroll", this.onScroll), window.removeEventListener("resize", this.onResize), window.removeEventListener("load", this.onLoad),
|
|
4357
|
+
return t.removeEventListener("wheel", this.onWheel), t.removeEventListener("scroll", this.onScroll), window.removeEventListener("resize", this.onResize), window.removeEventListener("load", this.onLoad), te.delete(this), this.stopListening?.(), this.stopListening = null, this.cancelFrame(), this.journey = null, this;
|
|
4358
4358
|
}
|
|
4359
4359
|
/** Stop, and put every effect element back where it was. */
|
|
4360
4360
|
destroy() {
|
|
4361
4361
|
this.stop();
|
|
4362
|
-
for (const t of this.effects)
|
|
4362
|
+
for (const t of this.effects) ee(t.element, t.saved);
|
|
4363
4363
|
this.effects = [];
|
|
4364
4364
|
}
|
|
4365
4365
|
/** GSAP's name for `destroy()`. */
|
|
@@ -4385,7 +4385,7 @@ class Ge {
|
|
|
4385
4385
|
this.journey = null, this.current = this.target = s, this.write(s), this.applyEffects(0);
|
|
4386
4386
|
return;
|
|
4387
4387
|
}
|
|
4388
|
-
this.target = s, this.journey = { from: this.current, to: s, ms: r * 1e3, ease: e.ease ??
|
|
4388
|
+
this.target = s, this.journey = { from: this.current, to: s, ms: r * 1e3, ease: e.ease ?? Nt, elapsed: 0 }, this.requestFrame();
|
|
4389
4389
|
}
|
|
4390
4390
|
/** Re-measure the scrollable length and every effect element (resizes do this). */
|
|
4391
4391
|
refresh() {
|
|
@@ -4411,18 +4411,18 @@ class Ge {
|
|
|
4411
4411
|
}
|
|
4412
4412
|
/** Put effect elements at their natural place, for measuring. */
|
|
4413
4413
|
rest() {
|
|
4414
|
-
for (const t of this.effects)
|
|
4414
|
+
for (const t of this.effects) ee(t.element, t.saved);
|
|
4415
4415
|
}
|
|
4416
4416
|
// --- input ----------------------------------------------------------------
|
|
4417
4417
|
wheel(t) {
|
|
4418
4418
|
if (this.pausedState || this.reduced || (this.options.smooth ?? 0.8) <= 0 || t.ctrlKey || Math.abs(t.deltaX) > Math.abs(t.deltaY) || this.nestedScrollerTakes(t)) return;
|
|
4419
|
-
const e = t.deltaMode === 1 ?
|
|
4419
|
+
const e = t.deltaMode === 1 ? kr : t.deltaMode === 2 ? this.viewportHeight() : 1, s = t.deltaY * e * (this.options.wheelMultiplier ?? 1), n = this.clamp(this.target + s);
|
|
4420
4420
|
n === this.target && n === this.current || (t.preventDefault(), this.journey = null, this.target = n, this.requestFrame());
|
|
4421
4421
|
}
|
|
4422
4422
|
/** A scroll that this smoother did not write: follow it. */
|
|
4423
4423
|
nativeScroll() {
|
|
4424
4424
|
const t = this.position();
|
|
4425
|
-
this.written !== null && Math.abs(t - this.written) <=
|
|
4425
|
+
this.written !== null && Math.abs(t - this.written) <= Sr || (this.written = null, this.journey = null, this.cancelFrame(), this.current = this.target = t, this.requestFrame());
|
|
4426
4426
|
}
|
|
4427
4427
|
nestedScrollerTakes(t) {
|
|
4428
4428
|
const e = this.options.scroller ?? document.documentElement;
|
|
@@ -4453,7 +4453,7 @@ class Ge {
|
|
|
4453
4453
|
this.current = r.from + (r.to - r.from) * r.ease(o), o >= 1 && (this.journey = null);
|
|
4454
4454
|
} else if (this.current !== this.target) {
|
|
4455
4455
|
const r = (this.options.smooth ?? 0.8) * 1e3 / 3;
|
|
4456
|
-
this.current += (this.target - this.current) * (1 - Math.exp(-e / r)), Math.abs(this.target - this.current) <
|
|
4456
|
+
this.current += (this.target - this.current) * (1 - Math.exp(-e / r)), Math.abs(this.target - this.current) < Ze && (this.current = this.target);
|
|
4457
4457
|
}
|
|
4458
4458
|
this.current !== s && this.write(this.current), this.velocityPxPerSecond = e > 0 ? (this.current - s) * 1e3 / e : 0;
|
|
4459
4459
|
const n = this.applyEffects(e);
|
|
@@ -4467,9 +4467,9 @@ class Ge {
|
|
|
4467
4467
|
let r = 0;
|
|
4468
4468
|
if (n.speed !== void 0 && (r += (s - n.centre) * (1 - n.speed)), n.lag !== void 0) {
|
|
4469
4469
|
const o = n.lag * 1e3 / 3;
|
|
4470
|
-
n.lagged = t === 0 ? s : n.lagged + (s - n.lagged) * (1 - Math.exp(-t / o)), Math.abs(s - n.lagged) <
|
|
4470
|
+
n.lagged = t === 0 ? s : n.lagged + (s - n.lagged) * (1 - Math.exp(-t / o)), Math.abs(s - n.lagged) < Ze ? n.lagged = s : e = !0, r += s - n.lagged;
|
|
4471
4471
|
}
|
|
4472
|
-
|
|
4472
|
+
ee(n.element, r === 0 ? n.saved : `0 ${Mr(r)}px`), n.shift = r;
|
|
4473
4473
|
}
|
|
4474
4474
|
return e;
|
|
4475
4475
|
}
|
|
@@ -4503,13 +4503,13 @@ class Ge {
|
|
|
4503
4503
|
return s.getBoundingClientRect().top - n + this.position() - r;
|
|
4504
4504
|
}
|
|
4505
4505
|
}
|
|
4506
|
-
function
|
|
4506
|
+
function ee(i, t) {
|
|
4507
4507
|
t ? i.style.setProperty("translate", t) : i.style.removeProperty("translate");
|
|
4508
4508
|
}
|
|
4509
|
-
function
|
|
4509
|
+
function Mr(i) {
|
|
4510
4510
|
return Math.round(i * 100) / 100;
|
|
4511
4511
|
}
|
|
4512
|
-
function
|
|
4512
|
+
function Ar(i, t) {
|
|
4513
4513
|
switch (t) {
|
|
4514
4514
|
// Play forward from wherever it is; reverse() flips a reversed timeline and plays.
|
|
4515
4515
|
// Neither restarts an animation that is already at that end.
|
|
@@ -4538,7 +4538,7 @@ function Sr(i, t) {
|
|
|
4538
4538
|
break;
|
|
4539
4539
|
}
|
|
4540
4540
|
}
|
|
4541
|
-
function
|
|
4541
|
+
function be(i, t, e, s, n = () => {
|
|
4542
4542
|
}) {
|
|
4543
4543
|
const r = (d) => typeof d == "string" ? i.query(d) ?? void 0 : d, o = r(t.trigger) ?? s;
|
|
4544
4544
|
if (!o) {
|
|
@@ -4548,9 +4548,9 @@ function ge(i, t, e, s, n = () => {
|
|
|
4548
4548
|
const a = t.scrub === void 0 || t.scrub === !1 ? !1 : t.scrub, c = (t.toggleActions ?? "play none none none").trim().split(/\s+/);
|
|
4549
4549
|
let l = 0, h;
|
|
4550
4550
|
const f = (d, m) => () => {
|
|
4551
|
-
m?.(), e && !a &&
|
|
4552
|
-
}, u = t.containerAnimation ?
|
|
4553
|
-
return h = new
|
|
4551
|
+
m?.(), e && !a && Ar(e, c[d] ?? "none"), t.once && d === 0 && queueMicrotask(() => h.destroy());
|
|
4552
|
+
}, u = t.containerAnimation ? _r(i, t.containerAnimation, o, n) : void 0;
|
|
4553
|
+
return h = new qt({
|
|
4554
4554
|
trigger: o,
|
|
4555
4555
|
start: t.start,
|
|
4556
4556
|
end: t.end,
|
|
@@ -4560,7 +4560,7 @@ function ge(i, t, e, s, n = () => {
|
|
|
4560
4560
|
horizontal: t.horizontal,
|
|
4561
4561
|
pinSpacing: t.pinSpacing,
|
|
4562
4562
|
onRefresh: t.invalidateOnRefresh && e?.invalidate ? () => e.invalidate() : void 0,
|
|
4563
|
-
snap: t.snap === void 0 ? void 0 :
|
|
4563
|
+
snap: t.snap === void 0 ? void 0 : Pr(t.snap, e),
|
|
4564
4564
|
markers: t.markers,
|
|
4565
4565
|
container: u,
|
|
4566
4566
|
onUpdate: (d, m) => {
|
|
@@ -4576,10 +4576,10 @@ function ge(i, t, e, s, n = () => {
|
|
|
4576
4576
|
onLeaveBack: f(3, t.onLeaveBack)
|
|
4577
4577
|
}), e && a === !1 && e.progress(0), h.start(), i.own(h);
|
|
4578
4578
|
}
|
|
4579
|
-
function
|
|
4580
|
-
const e = (n) => n === "labels" ? (r) =>
|
|
4579
|
+
function Pr(i, t) {
|
|
4580
|
+
const e = (n) => n === "labels" ? (r) => Er(r, t?.labelProgresses?.() ?? []) : n;
|
|
4581
4581
|
if (typeof i != "object" || Array.isArray(i)) return e(i);
|
|
4582
|
-
const s = i.ease ?
|
|
4582
|
+
const s = i.ease ? It(i.ease) : void 0;
|
|
4583
4583
|
return {
|
|
4584
4584
|
snapTo: e(i.snapTo),
|
|
4585
4585
|
duration: i.duration,
|
|
@@ -4587,10 +4587,10 @@ function xr(i, t) {
|
|
|
4587
4587
|
ease: s ? s.fn ?? W(s.easing) : void 0
|
|
4588
4588
|
};
|
|
4589
4589
|
}
|
|
4590
|
-
function
|
|
4590
|
+
function Er(i, t) {
|
|
4591
4591
|
return t.reduce((e, s) => Math.abs(s - i) < Math.abs(e - i) ? s : e, t[0] ?? i);
|
|
4592
4592
|
}
|
|
4593
|
-
function
|
|
4593
|
+
function _r(i, t, e, s) {
|
|
4594
4594
|
const n = () => t.timeline.getTracks({ property: "x" }).map((r) => r.target).filter((r) => {
|
|
4595
4595
|
const o = i.elementFor(r);
|
|
4596
4596
|
return !!o && o !== e && o.contains(e);
|
|
@@ -4612,7 +4612,7 @@ function Ar(i, t, e, s) {
|
|
|
4612
4612
|
}
|
|
4613
4613
|
};
|
|
4614
4614
|
}
|
|
4615
|
-
class
|
|
4615
|
+
class Yi {
|
|
4616
4616
|
/** For contexts made by matchMedia: which named queries match */
|
|
4617
4617
|
conditions = {};
|
|
4618
4618
|
scope;
|
|
@@ -4655,7 +4655,7 @@ class Bi {
|
|
|
4655
4655
|
this.revert();
|
|
4656
4656
|
}
|
|
4657
4657
|
}
|
|
4658
|
-
class
|
|
4658
|
+
class Cr {
|
|
4659
4659
|
host;
|
|
4660
4660
|
scope;
|
|
4661
4661
|
entries = [];
|
|
@@ -4695,11 +4695,11 @@ class Pr {
|
|
|
4695
4695
|
for (const [o, a] of t.queries) e[o] = a.matches;
|
|
4696
4696
|
const s = Object.values(e).some(Boolean), n = s ? JSON.stringify(e) : void 0;
|
|
4697
4697
|
if (n === t.key || (t.context?.revert(), t.context = void 0, t.key = n, !s)) return;
|
|
4698
|
-
const r = new
|
|
4698
|
+
const r = new Yi(this.host, this.scope);
|
|
4699
4699
|
r.conditions = e, r.add(() => t.setup(r)), t.context = r;
|
|
4700
4700
|
}
|
|
4701
4701
|
}
|
|
4702
|
-
class
|
|
4702
|
+
class Rr {
|
|
4703
4703
|
frames;
|
|
4704
4704
|
canvas;
|
|
4705
4705
|
context;
|
|
@@ -4773,29 +4773,29 @@ class _r {
|
|
|
4773
4773
|
e.onload = () => s(!0), e.onerror = () => s(!1), e.src = this.options.url(t);
|
|
4774
4774
|
}
|
|
4775
4775
|
}
|
|
4776
|
-
const
|
|
4777
|
-
async function
|
|
4776
|
+
const Ir = { opacity: 0, y: -16 }, $r = { opacity: 0, y: 16 };
|
|
4777
|
+
async function Fr(i, t, e, s) {
|
|
4778
4778
|
const n = t.collector?.scope ?? t.root, r = n.ownerDocument ?? n, o = () => s.shared ? [...n.querySelectorAll(s.shared)] : [];
|
|
4779
4779
|
if (s.native && typeof r.startViewTransition == "function")
|
|
4780
|
-
return
|
|
4780
|
+
return Lr(r, s, o);
|
|
4781
4781
|
const a = s.duration ?? 0.35, c = s.ease ?? "power2.inOut", l = (g) => new Promise((y) => {
|
|
4782
4782
|
g(y) || y();
|
|
4783
|
-
}), h = o(), f = h.length ?
|
|
4783
|
+
}), h = o(), f = h.length ? he(t, h) : void 0, u = s.from !== void 0 ? Je(t, s.from, s.shared) : [];
|
|
4784
4784
|
if (u.length && s.leave !== !1) {
|
|
4785
|
-
const g = s.leave ??
|
|
4785
|
+
const g = s.leave ?? Ir;
|
|
4786
4786
|
await l((y) => i.to(u, { ...g, duration: a, ease: c, onComplete: y }));
|
|
4787
4787
|
}
|
|
4788
4788
|
await s.update();
|
|
4789
|
-
const d = [], m = typeof s.to == "function" ? s.to() : s.to, p = m !== void 0 ?
|
|
4789
|
+
const d = [], m = typeof s.to == "function" ? s.to() : s.to, p = m !== void 0 ? Je(t, m, s.shared) : [];
|
|
4790
4790
|
if (p.length && s.enter !== !1) {
|
|
4791
|
-
const g = s.enter ??
|
|
4792
|
-
d.push(l((y) => i.fromTo(p, g, { ...
|
|
4791
|
+
const g = s.enter ?? $r;
|
|
4792
|
+
d.push(l((y) => i.fromTo(p, g, { ...Bi(g), duration: a, ease: c, onComplete: y })));
|
|
4793
4793
|
}
|
|
4794
4794
|
if (f) {
|
|
4795
4795
|
const g = o().filter((y) => !h.includes(y));
|
|
4796
4796
|
g.length && d.push(
|
|
4797
4797
|
l(
|
|
4798
|
-
(y) =>
|
|
4798
|
+
(y) => ue(t, e, f, {
|
|
4799
4799
|
targets: g,
|
|
4800
4800
|
duration: a * 1.4,
|
|
4801
4801
|
ease: c,
|
|
@@ -4807,11 +4807,11 @@ async function Rr(i, t, e, s) {
|
|
|
4807
4807
|
}
|
|
4808
4808
|
await Promise.all(d);
|
|
4809
4809
|
}
|
|
4810
|
-
function
|
|
4810
|
+
function Je(i, t, e) {
|
|
4811
4811
|
const s = i.resolveTargets(t).map((n) => i.elementFor(n)).filter((n) => !!n);
|
|
4812
4812
|
return e ? s.flatMap((n) => !n.querySelector(e) && !n.matches(e) ? [n] : [...n.children].filter((r) => !r.matches(e) && !r.querySelector(e))) : s;
|
|
4813
4813
|
}
|
|
4814
|
-
async function
|
|
4814
|
+
async function Lr(i, t, e) {
|
|
4815
4815
|
const s = (a, c) => {
|
|
4816
4816
|
const l = a.dataset?.flipId;
|
|
4817
4817
|
l && a.style.setProperty("view-transition-name", c ? `tf-${l.replace(/[^\w-]/g, "-")}` : "");
|
|
@@ -4822,16 +4822,16 @@ async function Ir(i, t, e) {
|
|
|
4822
4822
|
n.forEach((a) => s(a, !1)), await t.update(), r = e(), r.forEach((a) => s(a, !0));
|
|
4823
4823
|
}).finished, r.forEach((a) => s(a, !1));
|
|
4824
4824
|
}
|
|
4825
|
-
const
|
|
4825
|
+
const Dr = {
|
|
4826
4826
|
/** Register a curve from SVG path data or bezier points. Returns the name. */
|
|
4827
|
-
create: (i, t) =>
|
|
4828
|
-
},
|
|
4827
|
+
create: (i, t) => me(i, sn(t))
|
|
4828
|
+
}, Or = {
|
|
4829
4829
|
/** Register a bouncing ease that lands and settles on the end value. Returns the name. */
|
|
4830
|
-
create: (i, t) =>
|
|
4831
|
-
},
|
|
4830
|
+
create: (i, t) => me(i, { fn: nn(t) })
|
|
4831
|
+
}, Br = {
|
|
4832
4832
|
/** Register a wiggle that swings around the start value and returns to it. Returns the name. */
|
|
4833
|
-
create: (i, t) =>
|
|
4834
|
-
},
|
|
4833
|
+
create: (i, t) => me(i, { fn: rn(t) })
|
|
4834
|
+
}, Nr = /* @__PURE__ */ new Set([
|
|
4835
4835
|
"keyframes",
|
|
4836
4836
|
"duration",
|
|
4837
4837
|
"delay",
|
|
@@ -4850,20 +4850,20 @@ const $r = {
|
|
|
4850
4850
|
"onRepeat",
|
|
4851
4851
|
"onReverseComplete",
|
|
4852
4852
|
"scrollTrigger"
|
|
4853
|
-
]),
|
|
4854
|
-
function
|
|
4853
|
+
]), ti = 0.5, qr = "power1.inOut";
|
|
4854
|
+
function Xr(i) {
|
|
4855
4855
|
return i.keyframes !== void 0 && i.keyframes !== null;
|
|
4856
4856
|
}
|
|
4857
|
-
function
|
|
4857
|
+
function Yr(i) {
|
|
4858
4858
|
const t = i.keyframes, e = {};
|
|
4859
|
-
for (const [l, h] of Object.entries(i))
|
|
4859
|
+
for (const [l, h] of Object.entries(i)) Nr.has(l) || (e[l] = h);
|
|
4860
4860
|
if (Array.isArray(t))
|
|
4861
4861
|
return t.map((l) => ({
|
|
4862
4862
|
...e,
|
|
4863
4863
|
...l,
|
|
4864
|
-
duration: l.duration ?? i.duration ??
|
|
4864
|
+
duration: l.duration ?? i.duration ?? ti
|
|
4865
4865
|
}));
|
|
4866
|
-
const s = Object.entries(t), n = i.duration ??
|
|
4866
|
+
const s = Object.entries(t), n = i.duration ?? ti, r = t.easeEach ?? i.easeEach ?? qr;
|
|
4867
4867
|
if (s.length > 0 && s.every(([l]) => /^\s*-?\d+(\.\d+)?\s*%\s*$/.test(l) || l === "easeEach")) {
|
|
4868
4868
|
const l = s.filter(([u]) => u !== "easeEach").map(([u, d]) => ({ at: Number.parseFloat(u) / 100, step: d })).sort((u, d) => u.at - d.at), h = [];
|
|
4869
4869
|
let f = 0;
|
|
@@ -4882,21 +4882,21 @@ function Nr(i) {
|
|
|
4882
4882
|
}
|
|
4883
4883
|
return c;
|
|
4884
4884
|
}
|
|
4885
|
-
function
|
|
4885
|
+
function ei(i, t, e, s = {}) {
|
|
4886
4886
|
const n = t.collector?.scope ?? t.root, r = typeof s.scroller == "string" ? n.querySelector(s.scroller) : s.scroller ?? null, o = {
|
|
4887
4887
|
x: r ? r.scrollLeft : window.scrollX,
|
|
4888
4888
|
y: r ? r.scrollTop : window.scrollY
|
|
4889
4889
|
}, a = {
|
|
4890
4890
|
x: r ? r.scrollWidth - r.clientWidth : document.documentElement.scrollWidth - window.innerWidth,
|
|
4891
4891
|
y: r ? r.scrollHeight - r.clientHeight : document.documentElement.scrollHeight - window.innerHeight
|
|
4892
|
-
}, c = (b,
|
|
4893
|
-
if (
|
|
4894
|
-
if (typeof
|
|
4895
|
-
if (
|
|
4896
|
-
const
|
|
4897
|
-
if (!
|
|
4898
|
-
const
|
|
4899
|
-
return b === "x" ?
|
|
4892
|
+
}, c = (b, v) => {
|
|
4893
|
+
if (v === void 0) return o[b];
|
|
4894
|
+
if (typeof v == "number") return v;
|
|
4895
|
+
if (v === "max") return a[b];
|
|
4896
|
+
const T = typeof v == "string" ? n.querySelector(v) : v;
|
|
4897
|
+
if (!T) return o[b];
|
|
4898
|
+
const w = T.getBoundingClientRect(), x = r?.getBoundingClientRect(), S = (b === "x" ? s.offsetX : s.offsetY) ?? s.offset ?? 0;
|
|
4899
|
+
return b === "x" ? w.left - (x?.left ?? 0) + o.x - S : w.top - (x?.top ?? 0) + o.y - S;
|
|
4900
4900
|
}, l = typeof e == "object" && e !== null && !("nodeType" in e) ? { x: c("x", e.x), y: c("y", e.y) } : { x: o.x, y: c("y", e) }, h = { x: Math.max(0, Math.min(a.x, l.x)), y: Math.max(0, Math.min(a.y, l.y)) }, f = { ...o }, u = () => {
|
|
4901
4901
|
r ? (r.scrollLeft = f.x, r.scrollTop = f.y) : window.scrollTo({ left: f.x, top: f.y, behavior: "instant" });
|
|
4902
4902
|
}, d = ["wheel", "touchstart", "keydown"], m = r ?? window, p = () => {
|
|
@@ -4919,7 +4919,7 @@ function Qe(i, t, e, s = {}) {
|
|
|
4919
4919
|
if (s.autoKill !== !1) for (const b of d) m.addEventListener(b, p, { passive: !0 });
|
|
4920
4920
|
return y;
|
|
4921
4921
|
}
|
|
4922
|
-
function
|
|
4922
|
+
function Vr(i, t, e) {
|
|
4923
4923
|
const s = i.collector?.scope ?? i.root, n = typeof t == "string" ? [...s.querySelectorAll(t)] : "nodeType" in t ? [t] : Array.from(t), { interval: r = 0.1, batchMax: o, onEnter: a, onLeave: c, onEnterBack: l, onLeaveBack: h, ...f } = e, u = { onEnter: a, onLeave: c, onEnterBack: l, onLeaveBack: h }, d = { onEnter: [], onLeave: [], onEnterBack: [], onLeaveBack: [] }, m = {}, p = (y) => {
|
|
4924
4924
|
m[y] !== void 0 && clearTimeout(m[y]), m[y] = void 0;
|
|
4925
4925
|
const b = d[y].splice(0);
|
|
@@ -4931,7 +4931,7 @@ function Xr(i, t, e) {
|
|
|
4931
4931
|
}
|
|
4932
4932
|
};
|
|
4933
4933
|
return n.map(
|
|
4934
|
-
(y) =>
|
|
4934
|
+
(y) => be(i, {
|
|
4935
4935
|
...f,
|
|
4936
4936
|
trigger: y,
|
|
4937
4937
|
onEnter: () => g("onEnter", y),
|
|
@@ -4967,29 +4967,29 @@ class V {
|
|
|
4967
4967
|
/** Set by `reverse()`: arriving at the start is a reverse completion */
|
|
4968
4968
|
backwards = !1;
|
|
4969
4969
|
constructor(t, e = {}) {
|
|
4970
|
-
if (this.stage = t, this.options = e, this.compat = new
|
|
4970
|
+
if (this.stage = t, this.options = e, this.compat = new st({
|
|
4971
4971
|
...e,
|
|
4972
4972
|
startValue: (s, n) => {
|
|
4973
4973
|
const r = t.objectFor(s);
|
|
4974
|
-
if (r) return
|
|
4974
|
+
if (r) return zr(r[n]);
|
|
4975
4975
|
const o = t.appliedValue(s, n);
|
|
4976
4976
|
if (o !== void 0) return o;
|
|
4977
|
-
if (n === "d") return
|
|
4977
|
+
if (n === "d") return Li(t.elementFor(s)) ?? void 0;
|
|
4978
4978
|
if (n === "text") return t.elementFor(s)?.textContent ?? void 0;
|
|
4979
4979
|
if (n === "strokeDasharray" || n === "strokeDashoffset") {
|
|
4980
|
-
const a =
|
|
4980
|
+
const a = ni(t.elementFor(s));
|
|
4981
4981
|
if (a !== void 0) return n === "strokeDasharray" ? [a, a] : 0;
|
|
4982
4982
|
}
|
|
4983
4983
|
},
|
|
4984
4984
|
startVelocity: (s, n) => t.velocityOf(s, n),
|
|
4985
|
-
layoutColumns: (s) =>
|
|
4985
|
+
layoutColumns: (s) => si(s.map((n) => t.elementFor(n))),
|
|
4986
4986
|
random: () => t.utils.random(0, 1)
|
|
4987
4987
|
}), this.compat.timeline.onComplete = () => {
|
|
4988
4988
|
this.finishedThisFrame = !0;
|
|
4989
4989
|
}, t.collector?.track(this), t.liveTimelines.add(this), this.autoplayPending = !e.paused && !e.scrollTrigger, e.scrollTrigger) {
|
|
4990
4990
|
const s = e.scrollTrigger;
|
|
4991
4991
|
queueMicrotask(() => {
|
|
4992
|
-
this.killed || (this.scrollDriver =
|
|
4992
|
+
this.killed || (this.scrollDriver = be(t, s, this, this.firstElement, (n) => e.onWarning?.(n)));
|
|
4993
4993
|
});
|
|
4994
4994
|
}
|
|
4995
4995
|
this.autoplayPending && queueMicrotask(() => {
|
|
@@ -5006,7 +5006,7 @@ class V {
|
|
|
5006
5006
|
}
|
|
5007
5007
|
// --- building -----------------------------------------------------------
|
|
5008
5008
|
to(t, e, s) {
|
|
5009
|
-
return
|
|
5009
|
+
return Xr(e) ? this.record(() => this.keyframed(t, e, s)) : this.record(() => this.tween(t, [e], s, ([n], r, o) => this.compat.to(r, n, o)));
|
|
5010
5010
|
}
|
|
5011
5011
|
from(t, e, s) {
|
|
5012
5012
|
return this.record(() => this.tween(t, [e], s, ([n], r, o) => this.compat.from(r, n, o)));
|
|
@@ -5210,7 +5210,7 @@ class V {
|
|
|
5210
5210
|
/** Fire events and repeats between two playheads. Returns true if a pause stopped it. */
|
|
5211
5211
|
runCrossings(t, e, s) {
|
|
5212
5212
|
if (this.events.length === 0 && this.ranges.length === 0 && !this.options.onRepeat && !this.options.repeatRefresh) return !1;
|
|
5213
|
-
const n = this.events, { crossings: r, passes: o } =
|
|
5213
|
+
const n = this.events, { crossings: r, passes: o } = xi(
|
|
5214
5214
|
n.map((a) => a.time),
|
|
5215
5215
|
t,
|
|
5216
5216
|
e,
|
|
@@ -5263,14 +5263,14 @@ class V {
|
|
|
5263
5263
|
keyframed(t, e, s) {
|
|
5264
5264
|
const n = this.resolve(t);
|
|
5265
5265
|
if (!n) return;
|
|
5266
|
-
const r =
|
|
5266
|
+
const r = Yr(e);
|
|
5267
5267
|
if (r.length === 0) return;
|
|
5268
|
-
const o = n.length > 1 ?
|
|
5268
|
+
const o = n.length > 1 ? ce(e.stagger, this.staggerContext(n)) : void 0, a = n.map((g) => this.targetFor(g)).filter((g) => g !== void 0), c = o ? a.map((g) => [g]) : [a], l = o ? ie(n.length, o).map((g) => g / 1e3) : [0], h = this.compat.timeOf(s) / 1e3 + $t(e.delay, 0) / 1e3;
|
|
5269
5269
|
let f = 1 / 0, u = -1 / 0;
|
|
5270
5270
|
if (c.forEach((g, y) => {
|
|
5271
|
-
r.forEach((b,
|
|
5272
|
-
const
|
|
5273
|
-
this.tween(g, [b],
|
|
5271
|
+
r.forEach((b, v) => {
|
|
5272
|
+
const T = v === 0 ? h + l[y] : ">";
|
|
5273
|
+
this.tween(g, [b], T, ([w], x, S) => this.compat.to(x, w, S)), f = Math.min(f, this.compat.lastStart), u = Math.max(u, this.compat.lastEnd);
|
|
5274
5274
|
});
|
|
5275
5275
|
}), f === 1 / 0) return;
|
|
5276
5276
|
const { onStart: d, onUpdate: m, onComplete: p } = e;
|
|
@@ -5279,20 +5279,20 @@ class V {
|
|
|
5279
5279
|
staggerContext(t) {
|
|
5280
5280
|
return {
|
|
5281
5281
|
count: t.length,
|
|
5282
|
-
columnsFromLayout: () =>
|
|
5282
|
+
columnsFromLayout: () => si(t.map((e) => this.stage.elementFor(e))),
|
|
5283
5283
|
random: () => this.stage.utils.random(0, 1)
|
|
5284
5284
|
};
|
|
5285
5285
|
}
|
|
5286
5286
|
buildTween(t, e, s, n) {
|
|
5287
5287
|
const r = t.map((u) => this.targetFor(u));
|
|
5288
|
-
if (!(t.length > 1 && (e.some(
|
|
5288
|
+
if (!(t.length > 1 && (e.some(Ur) || t.some((u) => this.stage.objectFor(u) !== void 0)))) {
|
|
5289
5289
|
const u = this.targetFor(t[0]);
|
|
5290
|
-
n(e.map((d) => this.prepare(
|
|
5290
|
+
n(e.map((d) => this.prepare(ii(d, 0, u, this.stage.utils, r), t)), t, s);
|
|
5291
5291
|
return;
|
|
5292
5292
|
}
|
|
5293
|
-
const a = e.length - 1, { stagger: c, ...l } = e[a], h =
|
|
5293
|
+
const a = e.length - 1, { stagger: c, ...l } = e[a], h = ce(c, this.staggerContext(t)), f = h ? ie(t.length, h).map((u) => u / 1e3) : t.map(() => 0);
|
|
5294
5294
|
t.forEach((u, d) => {
|
|
5295
|
-
const m = d === 0 ?
|
|
5295
|
+
const m = d === 0 ? $t(l.delay, 0) / 1e3 + f[0] : 0, p = d === 0 ? 0 : f[d] - f[d - 1], g = d === 0 ? s : `<${p < 0 ? "-" : "+"}${Math.abs(p).toFixed(6)}`, b = e.map((v, T) => T === a ? { ...l, delay: m } : v).map((v) => this.prepare(ii(v, d, this.targetFor(u), this.stage.utils, r), [u]));
|
|
5296
5296
|
n(b, [u], g);
|
|
5297
5297
|
});
|
|
5298
5298
|
}
|
|
@@ -5308,7 +5308,7 @@ class V {
|
|
|
5308
5308
|
const s = (o) => this.options.onWarning?.(o), n = (o) => this.stage.query(o);
|
|
5309
5309
|
let r = t;
|
|
5310
5310
|
if (t.motionPath !== void 0) {
|
|
5311
|
-
const o =
|
|
5311
|
+
const o = zn(t.motionPath, {
|
|
5312
5312
|
query: n,
|
|
5313
5313
|
targets: e.map((a) => this.stage.elementFor(a)).filter((a) => !!a),
|
|
5314
5314
|
warn: s
|
|
@@ -5316,32 +5316,32 @@ class V {
|
|
|
5316
5316
|
r = { ...r, motionPath: o };
|
|
5317
5317
|
}
|
|
5318
5318
|
if (t.morphSVG !== void 0) {
|
|
5319
|
-
const o =
|
|
5319
|
+
const o = Hn(t.morphSVG, n, s), { morphSVG: a, ...c } = r;
|
|
5320
5320
|
r = o ? { ...r, morphSVG: o } : c;
|
|
5321
5321
|
}
|
|
5322
5322
|
if (t.drawSVG !== void 0) {
|
|
5323
|
-
const o =
|
|
5323
|
+
const o = ni(this.stage.elementFor(e[0]));
|
|
5324
5324
|
if (o === void 0) {
|
|
5325
5325
|
s("gsap-compat: drawSVG needs an SVG shape with a stroke (path, line, circle…)");
|
|
5326
5326
|
const { drawSVG: a, ...c } = r;
|
|
5327
5327
|
r = c;
|
|
5328
5328
|
} else
|
|
5329
|
-
r =
|
|
5329
|
+
r = kn(r, o);
|
|
5330
5330
|
}
|
|
5331
5331
|
return r;
|
|
5332
5332
|
}
|
|
5333
5333
|
resolve(t) {
|
|
5334
5334
|
const e = this.stage.resolveTargets(t);
|
|
5335
5335
|
if (e.length === 0) {
|
|
5336
|
-
this.options.onWarning?.(`gsap-compat: no elements found for target ${
|
|
5336
|
+
this.options.onWarning?.(`gsap-compat: no elements found for target ${Hr(t)}`);
|
|
5337
5337
|
return;
|
|
5338
5338
|
}
|
|
5339
5339
|
return this.firstElement ??= e.map((s) => this.stage.elementFor(s)).find((s) => s !== void 0), e;
|
|
5340
5340
|
}
|
|
5341
5341
|
}
|
|
5342
|
-
function
|
|
5342
|
+
function Wr(i = new Vn()) {
|
|
5343
5343
|
const t = (r) => {
|
|
5344
|
-
const { config: o } =
|
|
5344
|
+
const { config: o } = Pt(r);
|
|
5345
5345
|
return new V(i, {
|
|
5346
5346
|
repeat: o.repeat,
|
|
5347
5347
|
yoyo: o.yoyo,
|
|
@@ -5366,31 +5366,31 @@ function Yr(i = new Xn()) {
|
|
|
5366
5366
|
const [a] = i.resolveTargets(r);
|
|
5367
5367
|
if (a === void 0) return;
|
|
5368
5368
|
const c = i.objectFor(a);
|
|
5369
|
-
return c ? c[o] : i.appliedValue(a, o) ??
|
|
5369
|
+
return c ? c[o] : i.appliedValue(a, o) ?? Ri(o);
|
|
5370
5370
|
},
|
|
5371
|
-
scrollTrigger: (r) => s(
|
|
5372
|
-
scrollBatch: (r, o) =>
|
|
5373
|
-
scrollTo: (r, o) =>
|
|
5371
|
+
scrollTrigger: (r) => s(be(i, r)),
|
|
5372
|
+
scrollBatch: (r, o) => Vr(i, r, o).map((a) => s(a)),
|
|
5373
|
+
scrollTo: (r, o) => ei(n, i, r, o),
|
|
5374
5374
|
refreshScroll: () => {
|
|
5375
|
-
|
|
5375
|
+
qt.refreshAll(), Qe.refreshAll();
|
|
5376
5376
|
},
|
|
5377
5377
|
smoothScroll: (r = {}) => {
|
|
5378
5378
|
const o = typeof r.scroller == "string" ? (i.collector?.scope ?? i.root).querySelector(r.scroller) : r.scroller;
|
|
5379
|
-
return s(new
|
|
5379
|
+
return s(new Qe({ ...r, scroller: o }).start());
|
|
5380
5380
|
},
|
|
5381
5381
|
context: (r, o) => {
|
|
5382
|
-
const a = new
|
|
5382
|
+
const a = new Yi(i, o);
|
|
5383
5383
|
return r && a.add(() => r(a)), a;
|
|
5384
5384
|
},
|
|
5385
|
-
matchMedia: (r) => new
|
|
5386
|
-
customEase:
|
|
5387
|
-
customBounce:
|
|
5388
|
-
customWiggle:
|
|
5389
|
-
pageTransition: (r) =>
|
|
5385
|
+
matchMedia: (r) => new Cr(i, r),
|
|
5386
|
+
customEase: Dr.create,
|
|
5387
|
+
customBounce: Or.create,
|
|
5388
|
+
customWiggle: Br.create,
|
|
5389
|
+
pageTransition: (r) => Fr(n, i, (o) => new V(i, o), r),
|
|
5390
5390
|
imageSequence: (r, o) => {
|
|
5391
5391
|
const a = typeof r == "string" ? (i.collector?.scope ?? i.root).querySelector(r) : r;
|
|
5392
5392
|
if (!(a instanceof HTMLCanvasElement)) throw new Error(`gsap-compat: imageSequence needs a <canvas>, got ${String(r)}`);
|
|
5393
|
-
return s(new
|
|
5393
|
+
return s(new Rr(a, o));
|
|
5394
5394
|
},
|
|
5395
5395
|
quickTo: (r, o, a = {}) => {
|
|
5396
5396
|
const c = new V(i, { paused: !0 }), [l] = i.resolveTargets(r);
|
|
@@ -5401,7 +5401,7 @@ function Yr(i = new Xn()) {
|
|
|
5401
5401
|
[o]: f,
|
|
5402
5402
|
duration: a.duration ?? 0.4,
|
|
5403
5403
|
ease: a.ease ?? "power3.out",
|
|
5404
|
-
...a.spring !== void 0 && { spring:
|
|
5404
|
+
...a.spring !== void 0 && { spring: jr(a.spring, o, u) }
|
|
5405
5405
|
}), c.timeline.stop(), c.timeline.play(), i.activate(c.timeline);
|
|
5406
5406
|
}, { tween: c, kill: () => c.kill() });
|
|
5407
5407
|
},
|
|
@@ -5410,7 +5410,7 @@ function Yr(i = new Xn()) {
|
|
|
5410
5410
|
to: (r, o) => {
|
|
5411
5411
|
if (o.scrollTo !== void 0) {
|
|
5412
5412
|
const { scrollTo: a, ...c } = o, l = typeof a == "object" && a !== null && !("nodeType" in a) ? a : {}, h = typeof r != "string" && r !== window && r.nodeType === 1;
|
|
5413
|
-
return
|
|
5413
|
+
return ei(n, i, a, {
|
|
5414
5414
|
...c,
|
|
5415
5415
|
offsetX: l.offsetX,
|
|
5416
5416
|
offsetY: l.offsetY,
|
|
@@ -5427,39 +5427,39 @@ function Yr(i = new Xn()) {
|
|
|
5427
5427
|
const a = i.resolveTargets(r), c = typeof o == "string" ? o.split(",").map((l) => l.trim()).filter(Boolean) : o;
|
|
5428
5428
|
for (const l of [...i.liveTimelines]) l.killTweensOf(a, c);
|
|
5429
5429
|
},
|
|
5430
|
-
convertToPath: (r) =>
|
|
5430
|
+
convertToPath: (r) => Kn(r, i.root),
|
|
5431
5431
|
splitText: (r, o) => {
|
|
5432
5432
|
const a = i.collector?.scope ?? i.root, c = typeof r == "string" ? Array.from(a.querySelectorAll(r)) : "nodeType" in r ? [r] : Array.from(r);
|
|
5433
|
-
return s(
|
|
5433
|
+
return s(or(c, o));
|
|
5434
5434
|
},
|
|
5435
|
-
draggable: (r, o) => s(
|
|
5436
|
-
getFlipState: (r) =>
|
|
5437
|
-
flipFrom: (r, o) =>
|
|
5435
|
+
draggable: (r, o) => s(ir(n, i, r, o)),
|
|
5436
|
+
getFlipState: (r) => he(i, r),
|
|
5437
|
+
flipFrom: (r, o) => ue(i, (a) => new V(i, a), r, o),
|
|
5438
5438
|
flip: (r, o, a) => {
|
|
5439
|
-
const c =
|
|
5440
|
-
return o(),
|
|
5439
|
+
const c = he(i, r);
|
|
5440
|
+
return o(), ue(i, (l) => new V(i, l), c, { targets: r, ...a });
|
|
5441
5441
|
}
|
|
5442
5442
|
};
|
|
5443
5443
|
return n;
|
|
5444
5444
|
}
|
|
5445
|
-
const
|
|
5446
|
-
function
|
|
5445
|
+
const B = /* @__PURE__ */ Wr();
|
|
5446
|
+
function jr(i, t, e) {
|
|
5447
5447
|
return i === !0 ? { velocity: { [t]: e } } : typeof i == "string" ? { preset: i, velocity: { [t]: e } } : { ...i, velocity: { [t]: e } };
|
|
5448
5448
|
}
|
|
5449
|
-
function
|
|
5450
|
-
return i.morphSVG !== void 0 || i.drawSVG !== void 0 || i.text !== void 0 || i.scrambleText !== void 0 ||
|
|
5449
|
+
function Ur(i) {
|
|
5450
|
+
return i.morphSVG !== void 0 || i.drawSVG !== void 0 || i.text !== void 0 || i.scrambleText !== void 0 || Vi(i);
|
|
5451
5451
|
}
|
|
5452
|
-
function
|
|
5453
|
-
return Object.entries(i).some(([t, e]) => (typeof e == "function" ||
|
|
5452
|
+
function Vi(i) {
|
|
5453
|
+
return Object.entries(i).some(([t, e]) => (typeof e == "function" || Ci(e)) && !ge.has(t));
|
|
5454
5454
|
}
|
|
5455
|
-
function
|
|
5456
|
-
if (!
|
|
5455
|
+
function ii(i, t, e, s, n) {
|
|
5456
|
+
if (!Vi(i)) return i;
|
|
5457
5457
|
const r = {};
|
|
5458
5458
|
for (const [o, a] of Object.entries(i))
|
|
5459
|
-
|
|
5459
|
+
ge.has(o) ? r[o] = a : typeof a == "function" ? r[o] = a(t, e, n) : Ci(a) ? r[o] = s.resolveRandomString(a) : r[o] = a;
|
|
5460
5460
|
return r;
|
|
5461
5461
|
}
|
|
5462
|
-
function
|
|
5462
|
+
function si(i) {
|
|
5463
5463
|
const t = i.map((s) => s?.getBoundingClientRect().top);
|
|
5464
5464
|
if (t[0] === void 0) return i.length;
|
|
5465
5465
|
let e = 0;
|
|
@@ -5469,18 +5469,18 @@ function ti(i) {
|
|
|
5469
5469
|
}
|
|
5470
5470
|
return Math.max(1, e);
|
|
5471
5471
|
}
|
|
5472
|
-
function
|
|
5472
|
+
function ni(i) {
|
|
5473
5473
|
const t = i;
|
|
5474
5474
|
if (typeof t?.getTotalLength == "function")
|
|
5475
5475
|
return t.getTotalLength();
|
|
5476
5476
|
}
|
|
5477
|
-
function
|
|
5477
|
+
function zr(i) {
|
|
5478
5478
|
if (typeof i == "number" || typeof i == "string" || Array.isArray(i) && i.every((t) => typeof t == "number")) return i;
|
|
5479
5479
|
}
|
|
5480
|
-
function
|
|
5480
|
+
function Hr(i) {
|
|
5481
5481
|
return typeof i == "string" ? `"${i}"` : String(i);
|
|
5482
5482
|
}
|
|
5483
|
-
class
|
|
5483
|
+
class ri {
|
|
5484
5484
|
media;
|
|
5485
5485
|
offset;
|
|
5486
5486
|
driftTolerance;
|
|
@@ -5519,7 +5519,7 @@ class ii {
|
|
|
5519
5519
|
});
|
|
5520
5520
|
}
|
|
5521
5521
|
}
|
|
5522
|
-
function
|
|
5522
|
+
function Gr(i, t, e, s, n) {
|
|
5523
5523
|
const r = e - n;
|
|
5524
5524
|
if (r < 0) {
|
|
5525
5525
|
t.paused || t.pause(), t.currentTime = 0;
|
|
@@ -5527,7 +5527,7 @@ function Ur(i, t, e, s, n) {
|
|
|
5527
5527
|
}
|
|
5528
5528
|
i.update(r, s);
|
|
5529
5529
|
}
|
|
5530
|
-
class
|
|
5530
|
+
class ve {
|
|
5531
5531
|
container;
|
|
5532
5532
|
timeline = null;
|
|
5533
5533
|
adapter;
|
|
@@ -5563,7 +5563,7 @@ class Xi {
|
|
|
5563
5563
|
this.container = s;
|
|
5564
5564
|
} else
|
|
5565
5565
|
this.container = t;
|
|
5566
|
-
this.options = e, this.adapter = new
|
|
5566
|
+
this.options = e, this.adapter = new K();
|
|
5567
5567
|
}
|
|
5568
5568
|
/**
|
|
5569
5569
|
* Load animation from a URL or JSON object.
|
|
@@ -5577,7 +5577,7 @@ class Xi {
|
|
|
5577
5577
|
e = await s.json();
|
|
5578
5578
|
} else
|
|
5579
5579
|
e = t;
|
|
5580
|
-
this.options.speed !== void 0 && (e.config = { ...e.config, speed: this.options.speed }), this.options.loop !== void 0 && (e.config = { ...e.config, loop: this.options.loop }), this.options.alternate !== void 0 && (e.config = { ...e.config, alternate: this.options.alternate }), this.timeline =
|
|
5580
|
+
this.options.speed !== void 0 && (e.config = { ...e.config, speed: this.options.speed }), this.options.loop !== void 0 && (e.config = { ...e.config, loop: this.options.loop }), this.options.alternate !== void 0 && (e.config = { ...e.config, alternate: this.options.alternate }), this.timeline = mt(e), this.markerList = this.timeline.markers, this.lastMarkerId = null, this.options.onComplete && (this.timeline.onComplete = this.options.onComplete), this.options.onUpdate && (this.timeline.onUpdate = this.options.onUpdate), this.autoRegisterTargets(), this.setupSymbolInstances(), this.scanMedia(), this.showInitialFrame(), this.watchReducedMotion(), this.watchVisibility(), this.options.autoplay && !this.reducedMotion && (this.options.playWhenVisible && !this.onScreen ? this.autoplayWhenSeen = !0 : this.play());
|
|
5581
5581
|
}
|
|
5582
5582
|
// --- teaching: frames, markers, reduced motion, visibility -----------------
|
|
5583
5583
|
/**
|
|
@@ -5687,13 +5687,13 @@ class Xi {
|
|
|
5687
5687
|
scanMedia() {
|
|
5688
5688
|
this.mediaTargets = [], this.container.querySelectorAll("[data-tinyfly-media]").forEach((e) => {
|
|
5689
5689
|
const s = e, n = Number(s.getAttribute("data-tinyfly-start") ?? "0") || 0, r = s.getAttribute("data-volume");
|
|
5690
|
-
r !== null && (s.volume = Math.max(0, Math.min(1, Number(r) || 0))), this.mediaTargets.push({ el: s, startTime: n, sync: new
|
|
5690
|
+
r !== null && (s.volume = Math.max(0, Math.min(1, Number(r) || 0))), this.mediaTargets.push({ el: s, startTime: n, sync: new ri(s) });
|
|
5691
5691
|
});
|
|
5692
5692
|
}
|
|
5693
5693
|
/** Sync all discovered media targets to a timeline time. */
|
|
5694
5694
|
syncAllMedia(t, e) {
|
|
5695
5695
|
for (const s of this.mediaTargets)
|
|
5696
|
-
|
|
5696
|
+
Gr(s.sync, s.el, t, e, s.startTime);
|
|
5697
5697
|
}
|
|
5698
5698
|
/**
|
|
5699
5699
|
* Load animation from inline JSON string.
|
|
@@ -5743,11 +5743,11 @@ class Xi {
|
|
|
5743
5743
|
if (!n) return;
|
|
5744
5744
|
const r = e.get(n);
|
|
5745
5745
|
if (!r || !r.timeline.tracks?.length) return;
|
|
5746
|
-
const o = new
|
|
5746
|
+
const o = new K();
|
|
5747
5747
|
s.querySelectorAll("[data-tinyfly]").forEach((a) => {
|
|
5748
5748
|
const c = a.getAttribute("data-tinyfly");
|
|
5749
5749
|
c && o.registerTarget(c, a);
|
|
5750
|
-
}), this.symbolInstances.push({ adapter: o, timeline:
|
|
5750
|
+
}), this.symbolInstances.push({ adapter: o, timeline: mt(r.timeline) });
|
|
5751
5751
|
});
|
|
5752
5752
|
}
|
|
5753
5753
|
/**
|
|
@@ -5757,7 +5757,7 @@ class Xi {
|
|
|
5757
5757
|
* plays. Pass `{ offset }` to start the media at a timeline offset.
|
|
5758
5758
|
*/
|
|
5759
5759
|
attachMedia(t, e) {
|
|
5760
|
-
this.mediaSync = new
|
|
5760
|
+
this.mediaSync = new ri(t, e), this.timeline && (this.mediaSync.setRate(this.timeline.speed), this.mediaSync.update(this.timeline.currentTime, this.isPlaying));
|
|
5761
5761
|
}
|
|
5762
5762
|
/** Detach and pause the currently synced media, if any. */
|
|
5763
5763
|
detachMedia() {
|
|
@@ -5856,7 +5856,7 @@ class Xi {
|
|
|
5856
5856
|
this.playhead = s;
|
|
5857
5857
|
const n = this.markers;
|
|
5858
5858
|
if (n.length === 0) return;
|
|
5859
|
-
const { crossings: r } =
|
|
5859
|
+
const { crossings: r } = xi(
|
|
5860
5860
|
n.map((o) => o.time),
|
|
5861
5861
|
t,
|
|
5862
5862
|
s,
|
|
@@ -5884,14 +5884,203 @@ class Xi {
|
|
|
5884
5884
|
}
|
|
5885
5885
|
}
|
|
5886
5886
|
}
|
|
5887
|
-
async function
|
|
5888
|
-
const s = new
|
|
5887
|
+
async function Io(i, t, e = {}) {
|
|
5888
|
+
const s = new ve(i, { ...e, autoplay: !0 });
|
|
5889
5889
|
return await s.load(t), s;
|
|
5890
5890
|
}
|
|
5891
|
-
function
|
|
5892
|
-
return new
|
|
5891
|
+
function $o(i, t = {}) {
|
|
5892
|
+
return new ve(i, t);
|
|
5893
|
+
}
|
|
5894
|
+
const Kr = {
|
|
5895
|
+
play: "Play",
|
|
5896
|
+
pause: "Pause",
|
|
5897
|
+
prev: "Previous step",
|
|
5898
|
+
next: "Next step",
|
|
5899
|
+
restart: "Restart",
|
|
5900
|
+
scrub: "Position",
|
|
5901
|
+
speed: "Speed",
|
|
5902
|
+
reveal: "Reveal",
|
|
5903
|
+
step: "Step",
|
|
5904
|
+
of: "of",
|
|
5905
|
+
stepFormat: "{index} / {total}"
|
|
5906
|
+
}, oi = "tinyfly-controls-style", Zr = `
|
|
5907
|
+
.tf-ctl { --tf-ctl-fg: #1d1d1f; --tf-ctl-bg: #f4f2ee; --tf-ctl-accent: #c2410c; --tf-ctl-radius: 8px;
|
|
5908
|
+
font: 14px/1.4 var(--tf-ctl-font, system-ui, sans-serif); color: var(--tf-ctl-fg); margin-top: 8px; }
|
|
5909
|
+
.tf-ctl-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px; border-radius: var(--tf-ctl-radius); background: var(--tf-ctl-bg); }
|
|
5910
|
+
.tf-ctl-btn { min-width: 36px; height: 36px; padding: 0 10px; border: 0; border-radius: calc(var(--tf-ctl-radius) - 2px); background: transparent; color: inherit; font: inherit; cursor: pointer; }
|
|
5911
|
+
.tf-ctl-btn:hover { background: color-mix(in srgb, var(--tf-ctl-fg) 8%, transparent); }
|
|
5912
|
+
.tf-ctl-btn:focus-visible, .tf-ctl-scrub:focus-visible, .tf-ctl-speed:focus-visible { outline: 2px solid var(--tf-ctl-accent); outline-offset: 2px; }
|
|
5913
|
+
.tf-ctl-btn[disabled] { opacity: 0.4; cursor: default; }
|
|
5914
|
+
.tf-ctl-primary { background: var(--tf-ctl-accent); color: #fff; }
|
|
5915
|
+
.tf-ctl-primary:hover { background: var(--tf-ctl-accent); filter: brightness(1.08); }
|
|
5916
|
+
.tf-ctl-scrub { flex: 1 1 120px; min-width: 80px; accent-color: var(--tf-ctl-accent); }
|
|
5917
|
+
.tf-ctl-speed { height: 32px; border: 0; border-radius: 6px; background: transparent; color: inherit; font: inherit; }
|
|
5918
|
+
.tf-ctl-step { font-variant-numeric: tabular-nums; opacity: 0.75; padding: 0 4px; }
|
|
5919
|
+
.tf-ctl-caption { margin: 6px 2px 0; min-height: 1.4em; }
|
|
5920
|
+
.tf-ctl-question { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 6px 2px 0; font-weight: 600; }
|
|
5921
|
+
.tf-ctl-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
|
|
5922
|
+
/* The hidden attribute only hides through the browser's default stylesheet; any rule
|
|
5923
|
+
above that sets display would override it, so enforce it for everything here. */
|
|
5924
|
+
.tf-ctl [hidden] { display: none !important; }
|
|
5925
|
+
`;
|
|
5926
|
+
function Qr(i) {
|
|
5927
|
+
if (i.getElementById(oi)) return;
|
|
5928
|
+
const t = i.createElement("style");
|
|
5929
|
+
t.id = oi, t.textContent = Zr, i.head.appendChild(t);
|
|
5930
|
+
}
|
|
5931
|
+
function Jr(i, t, e = {}) {
|
|
5932
|
+
const s = t.ownerDocument;
|
|
5933
|
+
Qr(s);
|
|
5934
|
+
const n = { ...Kr, ...e.labels }, r = e.speeds ?? [0.5, 1, 2], o = () => i.markers.length > 0, a = () => i.markers.some((k) => k.label !== void 0 || i.caption(k.id) !== void 0), c = s.createElement("div");
|
|
5935
|
+
c.className = "tf-ctl";
|
|
5936
|
+
const l = s.createElement("div");
|
|
5937
|
+
l.className = "tf-ctl-bar", l.setAttribute("role", "group");
|
|
5938
|
+
const h = (k, P, C, $ = "") => {
|
|
5939
|
+
const R = s.createElement("button");
|
|
5940
|
+
return R.type = "button", R.className = `tf-ctl-btn ${$}`.trim(), R.setAttribute("aria-label", k), R.title = k, R.textContent = P, R.addEventListener("click", C), R;
|
|
5941
|
+
}, f = h(n.restart, "⟲", () => {
|
|
5942
|
+
i.pause(), i.seek(0);
|
|
5943
|
+
}), u = h(n.prev, "◀", () => i.prev()), d = h(n.play, "▶", () => i.isPlaying ? i.pause() : p(), "tf-ctl-primary"), m = h(n.next, "▶|", () => i.next()), p = () => {
|
|
5944
|
+
i.currentTime >= i.duration - 0.5 && i.seek(0), i.play();
|
|
5945
|
+
}, g = s.createElement("input");
|
|
5946
|
+
g.type = "range", g.className = "tf-ctl-scrub", g.min = "0", g.max = "1000", g.step = "1", g.setAttribute("aria-label", n.scrub), g.addEventListener("input", () => {
|
|
5947
|
+
i.pause(), i.seek(Number(g.value) / 1e3 * i.duration);
|
|
5948
|
+
});
|
|
5949
|
+
const y = s.createElement("span");
|
|
5950
|
+
y.className = "tf-ctl-step";
|
|
5951
|
+
const b = s.createElement("select");
|
|
5952
|
+
b.className = "tf-ctl-speed", b.setAttribute("aria-label", n.speed);
|
|
5953
|
+
for (const k of r) {
|
|
5954
|
+
const P = s.createElement("option");
|
|
5955
|
+
P.value = String(k), P.textContent = `${k}×`, k === 1 && (P.selected = !0), b.appendChild(P);
|
|
5956
|
+
}
|
|
5957
|
+
b.addEventListener("change", () => i.setSpeed(Number(b.value))), l.append(f, u, d, m, g, y), r.length > 0 && l.append(b), c.append(l);
|
|
5958
|
+
const v = s.createElement("p");
|
|
5959
|
+
v.className = "tf-ctl-caption", v.setAttribute("aria-live", "polite"), e.captions !== !1 && c.append(v);
|
|
5960
|
+
const T = s.createElement("div");
|
|
5961
|
+
T.className = "tf-ctl-question", T.hidden = !0;
|
|
5962
|
+
const w = s.createElement("span"), x = h(n.reveal, n.reveal, () => i.play(), "tf-ctl-primary");
|
|
5963
|
+
T.append(w, x), c.append(T);
|
|
5964
|
+
const S = e.mount;
|
|
5965
|
+
S ? S.appendChild(c) : t.insertAdjacentElement("afterend", c);
|
|
5966
|
+
const _ = () => {
|
|
5967
|
+
const k = i.isPlaying;
|
|
5968
|
+
d.textContent = k ? "❚❚" : "▶", d.setAttribute("aria-label", k ? n.pause : n.play), d.title = k ? n.pause : n.play;
|
|
5969
|
+
const P = i.duration;
|
|
5970
|
+
s.activeElement !== g && (g.value = String(P > 0 ? Math.round(i.currentTime / P * 1e3) : 0));
|
|
5971
|
+
const C = i.markers;
|
|
5972
|
+
if (u.hidden = m.hidden = y.hidden = C.length === 0, C.length > 0) {
|
|
5973
|
+
const $ = i.currentMarker, R = $ ? C.indexOf($) + 1 : 0;
|
|
5974
|
+
y.textContent = n.stepFormat.replace("{index}", String(R)).replace("{total}", String(C.length)), y.setAttribute("aria-label", `${n.step} ${R} ${n.of} ${C.length}`), u.disabled = i.currentTime <= 0.5, m.disabled = i.currentTime >= P - 0.5;
|
|
5975
|
+
const j = i.caption() ?? "";
|
|
5976
|
+
v.textContent !== j && (v.textContent = j), v.hidden = !a();
|
|
5977
|
+
const H = !k && $?.question !== void 0 && Math.abs(i.currentTime - $.time) < 1;
|
|
5978
|
+
T.hidden = !H, H && w.textContent !== $.question && (w.textContent = $.question);
|
|
5979
|
+
} else
|
|
5980
|
+
T.hidden = !0, v.hidden = !0;
|
|
5981
|
+
}, L = i.subscribe(_);
|
|
5982
|
+
_();
|
|
5983
|
+
const A = e.keyboardScope ?? t;
|
|
5984
|
+
!A.hasAttribute("tabindex") && A.tabIndex < 0 && (A.tabIndex = 0);
|
|
5985
|
+
const M = /* @__PURE__ */ new WeakSet(), E = (k) => {
|
|
5986
|
+
if (M.has(k) || (M.add(k), k.defaultPrevented || k.altKey || k.ctrlKey || k.metaKey)) return;
|
|
5987
|
+
const P = k.target;
|
|
5988
|
+
if (!(P.tagName === "INPUT" || P.tagName === "SELECT") && !(k.key === " " && P.tagName === "BUTTON"))
|
|
5989
|
+
switch (k.key) {
|
|
5990
|
+
case " ":
|
|
5991
|
+
k.preventDefault(), i.isPlaying ? i.pause() : p();
|
|
5992
|
+
break;
|
|
5993
|
+
case "ArrowRight":
|
|
5994
|
+
if (!o()) return;
|
|
5995
|
+
k.preventDefault(), i.next();
|
|
5996
|
+
break;
|
|
5997
|
+
case "ArrowLeft":
|
|
5998
|
+
if (!o()) return;
|
|
5999
|
+
k.preventDefault(), i.prev();
|
|
6000
|
+
break;
|
|
6001
|
+
case "Home":
|
|
6002
|
+
k.preventDefault(), i.pause(), i.seek(0);
|
|
6003
|
+
break;
|
|
6004
|
+
}
|
|
6005
|
+
};
|
|
6006
|
+
return A.addEventListener("keydown", E), c.addEventListener("keydown", E), {
|
|
6007
|
+
element: c,
|
|
6008
|
+
destroy() {
|
|
6009
|
+
L(), A.removeEventListener("keydown", E), c.removeEventListener("keydown", E), c.remove();
|
|
6010
|
+
}
|
|
6011
|
+
};
|
|
5893
6012
|
}
|
|
5894
|
-
|
|
6013
|
+
const Lt = /* @__PURE__ */ new WeakMap();
|
|
6014
|
+
let to = 0;
|
|
6015
|
+
function Mt(i, t, e) {
|
|
6016
|
+
if (i)
|
|
6017
|
+
try {
|
|
6018
|
+
return JSON.parse(i);
|
|
6019
|
+
} catch (s) {
|
|
6020
|
+
console.warn(`tinyfly: invalid ${t} JSON on`, e, s);
|
|
6021
|
+
return;
|
|
6022
|
+
}
|
|
6023
|
+
}
|
|
6024
|
+
async function eo(i, t = {}) {
|
|
6025
|
+
const e = Lt.get(i);
|
|
6026
|
+
if (e) return e;
|
|
6027
|
+
const s = i.querySelector("script[data-tinyfly-timeline]"), n = i.getAttribute("data-src");
|
|
6028
|
+
let r = s ? Mt(s.textContent, "timeline", i) : void 0;
|
|
6029
|
+
const o = io(i.getAttribute("data-markers"));
|
|
6030
|
+
if (!r && n && o) {
|
|
6031
|
+
const f = await fetch(n);
|
|
6032
|
+
f.ok && (r = await f.json());
|
|
6033
|
+
}
|
|
6034
|
+
if (r && o && !r.config.markers?.length && (r.config = { ...r.config, markers: o.map((f, u) => ({ id: `step-${u + 1}`, time: f })) }), !r && !n) {
|
|
6035
|
+
console.warn('tinyfly: embed has no timeline (a <script type="application/json" data-tinyfly-timeline> or data-src)', i);
|
|
6036
|
+
return;
|
|
6037
|
+
}
|
|
6038
|
+
const a = Mt(i.querySelector("script[data-tinyfly-captions]")?.textContent, "captions", i), c = {
|
|
6039
|
+
playWhenVisible: !0,
|
|
6040
|
+
...t.player,
|
|
6041
|
+
...a && { captions: a },
|
|
6042
|
+
...Mt(i.getAttribute("data-options"), "data-options", i)
|
|
6043
|
+
};
|
|
6044
|
+
no(i);
|
|
6045
|
+
const l = new ve(i, c), h = { element: i, player: l };
|
|
6046
|
+
if (Lt.set(i, h), i.setAttribute("data-tinyfly-mounted", ""), await l.load(r ?? n), i.getAttribute("data-controls") !== "false") {
|
|
6047
|
+
const f = Mt(i.getAttribute("data-labels"), "data-labels", i), u = i.querySelector("figcaption");
|
|
6048
|
+
h.controls = Jr(l, i, {
|
|
6049
|
+
...t.controls,
|
|
6050
|
+
labels: { ...t.controls?.labels, ...f },
|
|
6051
|
+
// Inside the figure, before its figcaption, so the caption stays last.
|
|
6052
|
+
mount: void 0
|
|
6053
|
+
}), u ? i.insertBefore(h.controls.element, u) : i.appendChild(h.controls.element);
|
|
6054
|
+
}
|
|
6055
|
+
return h;
|
|
6056
|
+
}
|
|
6057
|
+
function io(i) {
|
|
6058
|
+
if (!i) return;
|
|
6059
|
+
const t = i.split(/[\s,]+/).filter(Boolean).map(Number).filter((e) => Number.isFinite(e) && e >= 0).sort((e, s) => e - s);
|
|
6060
|
+
return t.length > 0 ? t : void 0;
|
|
6061
|
+
}
|
|
6062
|
+
async function so(i = document, t = {}) {
|
|
6063
|
+
const e = Array.from(i.querySelectorAll("[data-tinyfly-embed]"));
|
|
6064
|
+
return (await Promise.all(e.map((n) => eo(n, t)))).filter((n) => n !== void 0);
|
|
6065
|
+
}
|
|
6066
|
+
function Fo(i) {
|
|
6067
|
+
const t = Lt.get(i);
|
|
6068
|
+
t && (t.controls?.destroy(), t.player.destroy(), Lt.delete(i), i.removeAttribute("data-tinyfly-mounted"));
|
|
6069
|
+
}
|
|
6070
|
+
function no(i) {
|
|
6071
|
+
const t = i.querySelector("svg");
|
|
6072
|
+
if (!t || t.hasAttribute("role") || t.hasAttribute("aria-hidden")) return;
|
|
6073
|
+
const e = i.getAttribute("data-alt"), s = i.querySelector("figcaption");
|
|
6074
|
+
t.setAttribute("role", "img"), e ? t.setAttribute("aria-label", e) : s && (s.id ||= `tinyfly-caption-${++to}`, t.setAttribute("aria-labelledby", s.id));
|
|
6075
|
+
}
|
|
6076
|
+
function ro() {
|
|
6077
|
+
if (!(typeof document < "u" ? document.currentScript : null)?.hasAttribute("data-tinyfly-auto")) return;
|
|
6078
|
+
const t = () => {
|
|
6079
|
+
so();
|
|
6080
|
+
};
|
|
6081
|
+
document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", t, { once: !0 }) : t();
|
|
6082
|
+
}
|
|
6083
|
+
class oo {
|
|
5895
6084
|
container;
|
|
5896
6085
|
containerA;
|
|
5897
6086
|
containerB;
|
|
@@ -5921,7 +6110,7 @@ class zr {
|
|
|
5921
6110
|
this.container = s;
|
|
5922
6111
|
} else
|
|
5923
6112
|
this.container = t;
|
|
5924
|
-
this.options = e, this.container.style.position = "relative", this.container.style.overflow = "hidden", this.containerA = this.createSceneContainer(), this.containerB = this.createSceneContainer(), this.container.appendChild(this.containerA), this.container.appendChild(this.containerB), this.containerB.style.visibility = "hidden", this.adapterA = new
|
|
6113
|
+
this.options = e, this.container.style.position = "relative", this.container.style.overflow = "hidden", this.containerA = this.createSceneContainer(), this.containerB = this.createSceneContainer(), this.container.appendChild(this.containerA), this.container.appendChild(this.containerB), this.containerB.style.visibility = "hidden", this.adapterA = new K(), this.adapterB = new K();
|
|
5925
6114
|
}
|
|
5926
6115
|
/**
|
|
5927
6116
|
* Load a sequence from a URL or inline definition.
|
|
@@ -6041,11 +6230,11 @@ class zr {
|
|
|
6041
6230
|
if (!r) return;
|
|
6042
6231
|
const o = this.symbolDefs.get(r);
|
|
6043
6232
|
if (!o) return;
|
|
6044
|
-
const a = new
|
|
6233
|
+
const a = new K();
|
|
6045
6234
|
n.querySelectorAll("[data-tinyfly]").forEach((c) => {
|
|
6046
6235
|
const l = c.getAttribute("data-tinyfly");
|
|
6047
6236
|
l && a.registerTarget(l, c);
|
|
6048
|
-
}), s.push({ adapter: a, timeline:
|
|
6237
|
+
}), s.push({ adapter: a, timeline: mt(o) });
|
|
6049
6238
|
}), s.length ? this.nestedByAdapter.set(e, s) : this.nestedByAdapter.delete(e);
|
|
6050
6239
|
}
|
|
6051
6240
|
/** Apply the nested symbol states for a slot at a given scene time. */
|
|
@@ -6061,7 +6250,7 @@ class zr {
|
|
|
6061
6250
|
t.innerHTML = "";
|
|
6062
6251
|
}
|
|
6063
6252
|
createTimeline(t) {
|
|
6064
|
-
return t.timeline ?
|
|
6253
|
+
return t.timeline ? mt(t.timeline) : null;
|
|
6065
6254
|
}
|
|
6066
6255
|
onSceneComplete() {
|
|
6067
6256
|
if (this._isDestroyed || !this.sequence) return;
|
|
@@ -6160,13 +6349,13 @@ class zr {
|
|
|
6160
6349
|
this.animationFrameId !== void 0 && (cancelAnimationFrame(this.animationFrameId), this.animationFrameId = void 0);
|
|
6161
6350
|
}
|
|
6162
6351
|
}
|
|
6163
|
-
async function
|
|
6164
|
-
const s = new
|
|
6352
|
+
async function Lo(i, t, e = {}) {
|
|
6353
|
+
const s = new oo(i, { ...e, autoplay: !0 });
|
|
6165
6354
|
return await s.load(t), s;
|
|
6166
6355
|
}
|
|
6167
|
-
const
|
|
6168
|
-
function
|
|
6169
|
-
const { timeline: t } = i, e = new
|
|
6356
|
+
const Do = { type: "none", duration: 0 };
|
|
6357
|
+
function Oo(i) {
|
|
6358
|
+
const { timeline: t } = i, e = new K();
|
|
6170
6359
|
for (const [l, h] of Object.entries(i.targets)) {
|
|
6171
6360
|
const f = typeof h == "string" ? document.querySelector(h) : h;
|
|
6172
6361
|
if (!f)
|
|
@@ -6206,181 +6395,187 @@ function So(i) {
|
|
|
6206
6395
|
}
|
|
6207
6396
|
};
|
|
6208
6397
|
}
|
|
6209
|
-
const
|
|
6210
|
-
timeline:
|
|
6398
|
+
const Bo = {
|
|
6399
|
+
timeline: Cn,
|
|
6211
6400
|
to(i, t, e) {
|
|
6212
|
-
const s = new
|
|
6401
|
+
const s = new st(e);
|
|
6213
6402
|
return s.to(i, t), s;
|
|
6214
6403
|
},
|
|
6215
6404
|
from(i, t, e) {
|
|
6216
|
-
const s = new
|
|
6405
|
+
const s = new st(e);
|
|
6217
6406
|
return s.from(i, t), s;
|
|
6218
6407
|
},
|
|
6219
6408
|
fromTo(i, t, e, s) {
|
|
6220
|
-
const n = new
|
|
6409
|
+
const n = new st(s);
|
|
6221
6410
|
return n.fromTo(i, t, e), n;
|
|
6222
6411
|
},
|
|
6223
6412
|
set(i, t, e) {
|
|
6224
|
-
const s = new
|
|
6413
|
+
const s = new st(e);
|
|
6225
6414
|
return s.set(i, t), s;
|
|
6226
6415
|
}
|
|
6227
|
-
},
|
|
6416
|
+
}, No = B.to, qo = B.from, Xo = B.fromTo, Yo = B.set, Vo = B.timeline, Wo = B.ticker, jo = B.splitText, Uo = B.context, zo = B.matchMedia, Ho = B.quickTo, Go = B.imageSequence, Ko = B.pageTransition;
|
|
6417
|
+
ro();
|
|
6228
6418
|
export {
|
|
6229
|
-
|
|
6230
|
-
|
|
6231
|
-
|
|
6232
|
-
|
|
6233
|
-
|
|
6234
|
-
|
|
6235
|
-
|
|
6236
|
-
|
|
6237
|
-
|
|
6238
|
-
|
|
6419
|
+
lo as Clock,
|
|
6420
|
+
st as CompatTimeline,
|
|
6421
|
+
Or as CustomBounce,
|
|
6422
|
+
Dr as CustomEase,
|
|
6423
|
+
Br as CustomWiggle,
|
|
6424
|
+
mi as DEFAULT_BAKE_INTERVAL_MS,
|
|
6425
|
+
we as DEFAULT_INERTIA_FRICTION,
|
|
6426
|
+
Kr as DEFAULT_LABELS,
|
|
6427
|
+
N as DEFAULT_SPRING,
|
|
6428
|
+
Do as DEFAULT_TRANSITION,
|
|
6429
|
+
Di as Draggable,
|
|
6239
6430
|
_t as FORMAT_VERSION,
|
|
6240
|
-
|
|
6241
|
-
|
|
6431
|
+
Ji as INERTIA_MAX_DURATION_MS,
|
|
6432
|
+
Vs as InertiaTrackPlayer,
|
|
6242
6433
|
V as LiveTimeline,
|
|
6243
|
-
|
|
6244
|
-
|
|
6245
|
-
|
|
6246
|
-
|
|
6247
|
-
|
|
6248
|
-
|
|
6249
|
-
|
|
6250
|
-
|
|
6251
|
-
|
|
6252
|
-
|
|
6253
|
-
|
|
6254
|
-
|
|
6255
|
-
|
|
6256
|
-
|
|
6257
|
-
|
|
6258
|
-
|
|
6259
|
-
|
|
6260
|
-
|
|
6261
|
-
|
|
6262
|
-
|
|
6263
|
-
|
|
6264
|
-
|
|
6265
|
-
|
|
6266
|
-
|
|
6267
|
-
|
|
6268
|
-
|
|
6269
|
-
|
|
6270
|
-
|
|
6271
|
-
|
|
6272
|
-
|
|
6273
|
-
|
|
6274
|
-
|
|
6275
|
-
|
|
6276
|
-
|
|
6277
|
-
|
|
6278
|
-
|
|
6279
|
-
|
|
6280
|
-
|
|
6281
|
-
|
|
6282
|
-
|
|
6283
|
-
|
|
6284
|
-
|
|
6285
|
-
|
|
6286
|
-
|
|
6287
|
-
|
|
6288
|
-
|
|
6289
|
-
|
|
6290
|
-
|
|
6291
|
-
|
|
6292
|
-
|
|
6293
|
-
|
|
6294
|
-
|
|
6295
|
-
|
|
6296
|
-
|
|
6297
|
-
|
|
6298
|
-
|
|
6299
|
-
|
|
6300
|
-
|
|
6434
|
+
yo as MORPH_SAMPLES,
|
|
6435
|
+
co as ManualClock,
|
|
6436
|
+
ri as MediaSync,
|
|
6437
|
+
Zn as Observer,
|
|
6438
|
+
hi as SPRING_MAX_DURATION_MS,
|
|
6439
|
+
Yt as SPRING_PRESETS,
|
|
6440
|
+
dt as SPRING_STEP_MS,
|
|
6441
|
+
vr as ScrollAnimator,
|
|
6442
|
+
qt as ScrollDriver,
|
|
6443
|
+
wr as ScrollMarkers,
|
|
6444
|
+
pr as ScrollPin,
|
|
6445
|
+
Qe as SmoothScroll,
|
|
6446
|
+
Ot as SpringSampler,
|
|
6447
|
+
Ys as SpringTrackPlayer,
|
|
6448
|
+
Vn as Stage,
|
|
6449
|
+
Ti as Timeline,
|
|
6450
|
+
ve as TinyflyPlayer,
|
|
6451
|
+
oo as TinyflySequencer,
|
|
6452
|
+
zt as TrackPlayer,
|
|
6453
|
+
Po as ValueResolver,
|
|
6454
|
+
dr as VisibilityDriver,
|
|
6455
|
+
us as backOut,
|
|
6456
|
+
vi as bakeEasing,
|
|
6457
|
+
yi as bakeInertiaTrack,
|
|
6458
|
+
gi as bakeSpringTrack,
|
|
6459
|
+
hs as bounceOut,
|
|
6460
|
+
js as charactersFor,
|
|
6461
|
+
qi as clamp01,
|
|
6462
|
+
bo as clearMorphCache,
|
|
6463
|
+
mo as clearPathCache,
|
|
6464
|
+
Ge as containerProgressAt,
|
|
6465
|
+
Uo as context,
|
|
6466
|
+
$o as create,
|
|
6467
|
+
Jr as createControls,
|
|
6468
|
+
cs as createCubicBezier,
|
|
6469
|
+
Wr as createLive,
|
|
6470
|
+
Qs as createRandom,
|
|
6471
|
+
oe as createTrack,
|
|
6472
|
+
fo as criticalDamping,
|
|
6473
|
+
nn as customBounce,
|
|
6474
|
+
sn as customEase,
|
|
6475
|
+
rn as customWiggle,
|
|
6476
|
+
mt as deserializeTimeline,
|
|
6477
|
+
Ks as deserializeTrack,
|
|
6478
|
+
Eo as draggable,
|
|
6479
|
+
ns as easeIn,
|
|
6480
|
+
ui as easeInCubic,
|
|
6481
|
+
os as easeInOut,
|
|
6482
|
+
Nt as easeInOutCubic,
|
|
6483
|
+
ss as easeInOutQuad,
|
|
6484
|
+
es as easeInQuad,
|
|
6485
|
+
rs as easeOut,
|
|
6486
|
+
fi as easeOutCubic,
|
|
6487
|
+
is as easeOutQuad,
|
|
6488
|
+
ls as elasticOut,
|
|
6489
|
+
qs as expandParametricEasings,
|
|
6490
|
+
qo as from,
|
|
6491
|
+
ko as fromJSON,
|
|
6492
|
+
Xo as fromTo,
|
|
6301
6493
|
W as getEasingFunction,
|
|
6302
|
-
|
|
6303
|
-
|
|
6304
|
-
|
|
6305
|
-
|
|
6306
|
-
|
|
6307
|
-
|
|
6308
|
-
|
|
6309
|
-
|
|
6310
|
-
|
|
6311
|
-
|
|
6312
|
-
|
|
6313
|
-
|
|
6314
|
-
|
|
6315
|
-
|
|
6316
|
-
|
|
6317
|
-
|
|
6318
|
-
|
|
6319
|
-
|
|
6320
|
-
|
|
6321
|
-
|
|
6322
|
-
|
|
6323
|
-
|
|
6324
|
-
|
|
6325
|
-
|
|
6326
|
-
|
|
6327
|
-
|
|
6328
|
-
|
|
6329
|
-
|
|
6330
|
-
|
|
6331
|
-
|
|
6332
|
-
|
|
6333
|
-
|
|
6334
|
-
|
|
6335
|
-
|
|
6336
|
-
|
|
6337
|
-
|
|
6338
|
-
|
|
6339
|
-
|
|
6340
|
-
|
|
6341
|
-
|
|
6342
|
-
|
|
6343
|
-
|
|
6344
|
-
|
|
6345
|
-
|
|
6346
|
-
|
|
6347
|
-
|
|
6348
|
-
|
|
6349
|
-
|
|
6350
|
-
|
|
6351
|
-
|
|
6352
|
-
|
|
6353
|
-
|
|
6354
|
-
|
|
6355
|
-
|
|
6356
|
-
|
|
6357
|
-
|
|
6358
|
-
|
|
6359
|
-
|
|
6360
|
-
|
|
6361
|
-
|
|
6362
|
-
|
|
6363
|
-
|
|
6364
|
-
|
|
6365
|
-
|
|
6366
|
-
|
|
6367
|
-
|
|
6368
|
-
|
|
6369
|
-
|
|
6370
|
-
|
|
6371
|
-
|
|
6372
|
-
|
|
6373
|
-
|
|
6374
|
-
|
|
6375
|
-
|
|
6376
|
-
|
|
6377
|
-
|
|
6378
|
-
|
|
6379
|
-
|
|
6380
|
-
|
|
6381
|
-
|
|
6382
|
-
|
|
6383
|
-
|
|
6384
|
-
|
|
6385
|
-
|
|
6494
|
+
Rt as getInterpolator,
|
|
6495
|
+
wi as getMotionPathPoint,
|
|
6496
|
+
go as getPathLength,
|
|
6497
|
+
xs as getPointAtProgress,
|
|
6498
|
+
Jn as gridLinesFor,
|
|
6499
|
+
Gi as hasKeyframes,
|
|
6500
|
+
So as hashSeed,
|
|
6501
|
+
Go as imageSequence,
|
|
6502
|
+
bt as inertiaDuration,
|
|
6503
|
+
yt as inertiaRest,
|
|
6504
|
+
se as inertiaValueAt,
|
|
6505
|
+
po as inertiaVelocityAt,
|
|
6506
|
+
Bs as interpolateArray,
|
|
6507
|
+
Os as interpolateColor,
|
|
6508
|
+
To as interpolateMotionPath,
|
|
6509
|
+
Y as interpolateNumber,
|
|
6510
|
+
Ns as interpolatePathString,
|
|
6511
|
+
Fe as interpolateString,
|
|
6512
|
+
Hi as isCubicBezierEasing,
|
|
6513
|
+
Z as isInertiaTrack,
|
|
6514
|
+
ao as isMotionPathPoint,
|
|
6515
|
+
ai as isMotionPathTrack,
|
|
6516
|
+
Et as isParametricEasing,
|
|
6517
|
+
vt as isPathData,
|
|
6518
|
+
Q as isSpringTrack,
|
|
6519
|
+
fe as isTextTrack,
|
|
6520
|
+
uo as isUnderdamped,
|
|
6521
|
+
Ao as isUnresolved,
|
|
6522
|
+
ne as linear,
|
|
6523
|
+
B as live,
|
|
6524
|
+
It as mapEase,
|
|
6525
|
+
zo as matchMedia,
|
|
6526
|
+
li as maxStaggerDistance,
|
|
6527
|
+
Fs as morphPath,
|
|
6528
|
+
eo as mount,
|
|
6529
|
+
so as mountAll,
|
|
6530
|
+
Ct as naturalRest,
|
|
6531
|
+
Ko as pageTransition,
|
|
6532
|
+
ds as parametricEasing,
|
|
6533
|
+
He as parseEdge,
|
|
6534
|
+
nt as parsePath,
|
|
6535
|
+
Ni as parseTrigger,
|
|
6536
|
+
Io as play,
|
|
6537
|
+
Lo as playSequence,
|
|
6538
|
+
Co as playWhenVisible,
|
|
6539
|
+
xi as playheadCrossings,
|
|
6540
|
+
di as pointAtDistance,
|
|
6541
|
+
cn as pointsToPath,
|
|
6542
|
+
Oo as quickPlay,
|
|
6543
|
+
Ho as quickTo,
|
|
6544
|
+
Si as randomBetween,
|
|
6545
|
+
Mo as randomChoice,
|
|
6546
|
+
Js as randomSnapped,
|
|
6547
|
+
tn as resolveSequence,
|
|
6548
|
+
Pi as resolveValue,
|
|
6549
|
+
_o as scrollProgress,
|
|
6550
|
+
Ro as scrubOnScroll,
|
|
6551
|
+
Zs as serializeTimeline,
|
|
6552
|
+
Gs as serializeTrack,
|
|
6553
|
+
Yo as set,
|
|
6554
|
+
pe as shapeToPathData,
|
|
6555
|
+
Xs as simplifyKeyframes,
|
|
6556
|
+
fr as smoothToward,
|
|
6557
|
+
Qn as snapAxis,
|
|
6558
|
+
gr as snapConfig,
|
|
6559
|
+
br as snapDuration,
|
|
6560
|
+
yr as snapProgress,
|
|
6561
|
+
jo as splitText,
|
|
6562
|
+
Ki as springDuration,
|
|
6563
|
+
ho as springValueAt,
|
|
6564
|
+
ci as staggerDistance,
|
|
6565
|
+
de as staggerOffset,
|
|
6566
|
+
ie as staggerOffsets,
|
|
6567
|
+
Dt as staggerSpan,
|
|
6568
|
+
fs as stepsEasing,
|
|
6569
|
+
Gr as syncMediaElement,
|
|
6570
|
+
zs as textAt,
|
|
6571
|
+
Bo as tf,
|
|
6572
|
+
Wo as ticker,
|
|
6573
|
+
Vo as timeline,
|
|
6574
|
+
No as to,
|
|
6575
|
+
xo as toJSON,
|
|
6576
|
+
vo as toKeyframedTrack,
|
|
6577
|
+
wo as toKeyframedTracks,
|
|
6578
|
+
G as trackTargets,
|
|
6579
|
+
gt as triggerDistance,
|
|
6580
|
+
Fo as unmount
|
|
6386
6581
|
};
|