kss-modern 0.0.21 → 0.0.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/node/lib/index.mjs +110 -5
- package/dist/styleguide-assets/.vite/manifest.json +27 -21
- package/dist/styleguide-assets/{axe-B2M3jwef.js → axe-A2Ows1Aj.js} +13363 -13160
- package/dist/styleguide-assets/{browser-ImNvK64W.js → browser-Bjhprfz3.js} +1924 -1906
- package/dist/styleguide-assets/{clipboard-CmSioy8N.js → clipboard-CQ7U7_P0.js} +1 -1
- package/dist/styleguide-assets/{client-fullpage-CUwCohIj.js → fullpage-BEOBUDsG.js} +7 -2
- package/dist/styleguide-assets/{html-validator-BlXeWTXJ.js → html-validator-M0X8x6ag.js} +114 -94
- package/dist/styleguide-assets/{icons-DfSfd5nI.js → icons-IQYIngUi.js} +1 -1
- package/dist/styleguide-assets/kss-modern-BpMIuK1b.css +1 -0
- package/dist/styleguide-assets/preview-BqaqMVtQ.js +1 -0
- package/dist/styleguide-assets/{main-DJu5Mg_E.js → preview-DxsvGJsw.js} +947 -1045
- package/dist/styleguide-assets/preview-inline-D_Sx3c3_.js +101 -0
- package/package.json +12 -12
- package/dist/styleguide-assets/client-Dr95NpXp.js +0 -1
- package/dist/styleguide-assets/kss-modern-CSsz22uP.css +0 -1
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
function
|
|
1
|
+
function ks(e, t) {
|
|
2
2
|
e.indexOf(t) === -1 && e.push(t);
|
|
3
3
|
}
|
|
4
|
-
function
|
|
4
|
+
function hn(e, t) {
|
|
5
5
|
const n = e.indexOf(t);
|
|
6
6
|
n > -1 && e.splice(n, 1);
|
|
7
7
|
}
|
|
8
|
-
const
|
|
9
|
-
let
|
|
8
|
+
const _ = (e, t, n) => n > t ? t : n < e ? e : n;
|
|
9
|
+
let et = () => {
|
|
10
10
|
};
|
|
11
|
-
const
|
|
12
|
-
function
|
|
11
|
+
const R = {}, mn = (e) => /^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);
|
|
12
|
+
function Cs(e) {
|
|
13
13
|
return typeof e == "object" && e !== null;
|
|
14
14
|
}
|
|
15
|
-
const
|
|
15
|
+
const pn = (e) => /^0[^.\s]+$/u.test(e);
|
|
16
16
|
// @__NO_SIDE_EFFECTS__
|
|
17
|
-
function
|
|
17
|
+
function tt(e) {
|
|
18
18
|
let t;
|
|
19
19
|
return () => (t === void 0 && (t = e()), t);
|
|
20
20
|
}
|
|
21
|
-
const Z = /* @__NO_SIDE_EFFECTS__ */ (e) => e,
|
|
21
|
+
const Z = /* @__NO_SIDE_EFFECTS__ */ (e) => e, Ds = (e, t) => (n) => t(e(n)), nt = (...e) => e.reduce(Ds), st = /* @__NO_SIDE_EFFECTS__ */ (e, t, n) => {
|
|
22
22
|
const s = t - e;
|
|
23
23
|
return s === 0 ? 1 : (n - e) / s;
|
|
24
24
|
};
|
|
25
|
-
class
|
|
25
|
+
class gn {
|
|
26
26
|
constructor() {
|
|
27
27
|
this.subscriptions = [];
|
|
28
28
|
}
|
|
29
29
|
add(t) {
|
|
30
|
-
return
|
|
30
|
+
return ks(this.subscriptions, t), () => hn(this.subscriptions, t);
|
|
31
31
|
}
|
|
32
32
|
notify(t, n, s) {
|
|
33
33
|
const r = this.subscriptions.length;
|
|
@@ -47,50 +47,50 @@ class vn {
|
|
|
47
47
|
this.subscriptions.length = 0;
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
|
-
const
|
|
51
|
-
function
|
|
50
|
+
const P = /* @__NO_SIDE_EFFECTS__ */ (e) => e * 1e3, I = /* @__NO_SIDE_EFFECTS__ */ (e) => e / 1e3;
|
|
51
|
+
function yn(e, t) {
|
|
52
52
|
return t ? e * (1e3 / t) : 0;
|
|
53
53
|
}
|
|
54
|
-
const
|
|
54
|
+
const Fs = (e, t, n) => {
|
|
55
55
|
const s = t - e;
|
|
56
56
|
return ((n - e) % s + s) % s + e;
|
|
57
|
-
},
|
|
58
|
-
function
|
|
57
|
+
}, bn = (e, t, n) => (((1 - 3 * n + 3 * t) * e + (3 * n - 6 * t)) * e + 3 * t) * e, Ls = 1e-7, Is = 12;
|
|
58
|
+
function Os(e, t, n, s, r) {
|
|
59
59
|
let i, o, a = 0;
|
|
60
60
|
do
|
|
61
|
-
o = t + (n - t) / 2, i =
|
|
62
|
-
while (Math.abs(i) >
|
|
61
|
+
o = t + (n - t) / 2, i = bn(o, s, r) - e, i > 0 ? n = o : t = o;
|
|
62
|
+
while (Math.abs(i) > Ls && ++a < Is);
|
|
63
63
|
return o;
|
|
64
64
|
}
|
|
65
65
|
function he(e, t, n, s) {
|
|
66
66
|
if (e === t && n === s)
|
|
67
67
|
return Z;
|
|
68
|
-
const r = (i) =>
|
|
69
|
-
return (i) => i === 0 || i === 1 ? i :
|
|
68
|
+
const r = (i) => Os(i, 0, 1, e, n);
|
|
69
|
+
return (i) => i === 0 || i === 1 ? i : bn(r(i), t, s);
|
|
70
70
|
}
|
|
71
|
-
const
|
|
72
|
-
function
|
|
73
|
-
return
|
|
71
|
+
const wn = (e) => (t) => t <= 0.5 ? e(2 * t) / 2 : (2 - e(2 * (1 - t))) / 2, Tn = (e) => (t) => 1 - e(1 - t), An = /* @__PURE__ */ he(0.33, 1.53, 0.69, 0.99), rt = /* @__PURE__ */ Tn(An), vn = /* @__PURE__ */ wn(rt), Sn = (e) => (e *= 2) < 1 ? 0.5 * rt(e) : 0.5 * (2 - Math.pow(2, -10 * (e - 1))), it = (e) => 1 - Math.sin(Math.acos(e)), Ps = Tn(it), xn = wn(it), Ns = /* @__PURE__ */ he(0.42, 0, 1, 1), Rs = /* @__PURE__ */ he(0, 0, 0.58, 1), En = /* @__PURE__ */ he(0.42, 0, 0.58, 1), Vn = (e) => Array.isArray(e) && typeof e[0] != "number";
|
|
72
|
+
function Mn(e, t) {
|
|
73
|
+
return Vn(e) ? e[Fs(0, e.length, t)] : e;
|
|
74
74
|
}
|
|
75
|
-
const
|
|
75
|
+
const kn = (e) => Array.isArray(e) && typeof e[0] == "number", Ks = {
|
|
76
76
|
linear: Z,
|
|
77
|
-
easeIn:
|
|
78
|
-
easeInOut:
|
|
79
|
-
easeOut:
|
|
80
|
-
circIn:
|
|
81
|
-
circInOut:
|
|
82
|
-
circOut:
|
|
83
|
-
backIn:
|
|
84
|
-
backInOut:
|
|
85
|
-
backOut:
|
|
86
|
-
anticipate:
|
|
87
|
-
},
|
|
88
|
-
if (
|
|
89
|
-
|
|
77
|
+
easeIn: Ns,
|
|
78
|
+
easeInOut: En,
|
|
79
|
+
easeOut: Rs,
|
|
80
|
+
circIn: it,
|
|
81
|
+
circInOut: xn,
|
|
82
|
+
circOut: Ps,
|
|
83
|
+
backIn: rt,
|
|
84
|
+
backInOut: vn,
|
|
85
|
+
backOut: An,
|
|
86
|
+
anticipate: Sn
|
|
87
|
+
}, Bs = (e) => typeof e == "string", Mt = (e) => {
|
|
88
|
+
if (kn(e)) {
|
|
89
|
+
et(e.length === 4);
|
|
90
90
|
const [t, n, s, r] = e;
|
|
91
91
|
return he(t, n, s, r);
|
|
92
|
-
} else if (
|
|
93
|
-
return
|
|
92
|
+
} else if (Bs(e))
|
|
93
|
+
return Ks[e];
|
|
94
94
|
return e;
|
|
95
95
|
}, we = [
|
|
96
96
|
"setup",
|
|
@@ -110,7 +110,7 @@ const Fn = (e) => Array.isArray(e) && typeof e[0] == "number", _s = {
|
|
|
110
110
|
"postRender"
|
|
111
111
|
// Compute
|
|
112
112
|
];
|
|
113
|
-
function
|
|
113
|
+
function $s(e, t) {
|
|
114
114
|
let n = /* @__PURE__ */ new Set(), s = /* @__PURE__ */ new Set(), r = !1, i = !1;
|
|
115
115
|
const o = /* @__PURE__ */ new WeakSet();
|
|
116
116
|
let a = {
|
|
@@ -118,100 +118,100 @@ function js(e, t) {
|
|
|
118
118
|
timestamp: 0,
|
|
119
119
|
isProcessing: !1
|
|
120
120
|
};
|
|
121
|
-
function l(
|
|
122
|
-
o.has(
|
|
121
|
+
function l(u) {
|
|
122
|
+
o.has(u) && (c.schedule(u), e()), u(a);
|
|
123
123
|
}
|
|
124
|
-
const
|
|
124
|
+
const c = {
|
|
125
125
|
/**
|
|
126
126
|
* Schedule a process to run on the next frame.
|
|
127
127
|
*/
|
|
128
|
-
schedule: (
|
|
128
|
+
schedule: (u, f = !1, d = !1) => {
|
|
129
129
|
const m = d && r ? n : s;
|
|
130
|
-
return
|
|
130
|
+
return f && o.add(u), m.has(u) || m.add(u), u;
|
|
131
131
|
},
|
|
132
132
|
/**
|
|
133
133
|
* Cancel the provided callback from running on the next frame.
|
|
134
134
|
*/
|
|
135
|
-
cancel: (
|
|
136
|
-
s.delete(
|
|
135
|
+
cancel: (u) => {
|
|
136
|
+
s.delete(u), o.delete(u);
|
|
137
137
|
},
|
|
138
138
|
/**
|
|
139
139
|
* Execute all schedule callbacks.
|
|
140
140
|
*/
|
|
141
|
-
process: (
|
|
142
|
-
if (a =
|
|
141
|
+
process: (u) => {
|
|
142
|
+
if (a = u, r) {
|
|
143
143
|
i = !0;
|
|
144
144
|
return;
|
|
145
145
|
}
|
|
146
|
-
r = !0, [n, s] = [s, n], n.forEach(l), n.clear(), r = !1, i && (i = !1,
|
|
146
|
+
r = !0, [n, s] = [s, n], n.forEach(l), n.clear(), r = !1, i && (i = !1, c.process(u));
|
|
147
147
|
}
|
|
148
148
|
};
|
|
149
|
-
return
|
|
149
|
+
return c;
|
|
150
150
|
}
|
|
151
|
-
const
|
|
152
|
-
function
|
|
151
|
+
const qs = 40;
|
|
152
|
+
function Cn(e, t) {
|
|
153
153
|
let n = !1, s = !0;
|
|
154
154
|
const r = {
|
|
155
155
|
delta: 0,
|
|
156
156
|
timestamp: 0,
|
|
157
157
|
isProcessing: !1
|
|
158
|
-
}, i = () => n = !0, o = we.reduce((
|
|
159
|
-
const
|
|
160
|
-
n = !1,
|
|
158
|
+
}, i = () => n = !0, o = we.reduce((A, S) => (A[S] = $s(i), A), {}), { setup: a, read: l, resolveKeyframes: c, preUpdate: u, update: f, preRender: d, render: h, postRender: m } = o, y = () => {
|
|
159
|
+
const A = R.useManualTiming ? r.timestamp : performance.now();
|
|
160
|
+
n = !1, R.useManualTiming || (r.delta = s ? 1e3 / 60 : Math.max(Math.min(A - r.timestamp, qs), 1)), r.timestamp = A, r.isProcessing = !0, a.process(r), l.process(r), c.process(r), u.process(r), f.process(r), d.process(r), h.process(r), m.process(r), r.isProcessing = !1, n && t && (s = !1, e(y));
|
|
161
161
|
}, T = () => {
|
|
162
162
|
n = !0, s = !0, r.isProcessing || e(y);
|
|
163
163
|
};
|
|
164
|
-
return { schedule: we.reduce((
|
|
164
|
+
return { schedule: we.reduce((A, S) => {
|
|
165
165
|
const g = o[S];
|
|
166
|
-
return
|
|
167
|
-
}, {}), cancel: (
|
|
166
|
+
return A[S] = (v, V = !1, w = !1) => (n || T(), g.schedule(v, V, w)), A;
|
|
167
|
+
}, {}), cancel: (A) => {
|
|
168
168
|
for (let S = 0; S < we.length; S++)
|
|
169
|
-
o[we[S]].cancel(
|
|
169
|
+
o[we[S]].cancel(A);
|
|
170
170
|
}, state: r, steps: o };
|
|
171
171
|
}
|
|
172
|
-
const { schedule: K, cancel:
|
|
173
|
-
let
|
|
174
|
-
function
|
|
175
|
-
|
|
172
|
+
const { schedule: K, cancel: Ke, state: Ve } = /* @__PURE__ */ Cn(typeof requestAnimationFrame < "u" ? requestAnimationFrame : Z, !0);
|
|
173
|
+
let Ee;
|
|
174
|
+
function Ws() {
|
|
175
|
+
Ee = void 0;
|
|
176
176
|
}
|
|
177
|
-
const
|
|
178
|
-
now: () => (
|
|
177
|
+
const F = {
|
|
178
|
+
now: () => (Ee === void 0 && F.set(Ve.isProcessing || R.useManualTiming ? Ve.timestamp : performance.now()), Ee),
|
|
179
179
|
set: (e) => {
|
|
180
|
-
|
|
180
|
+
Ee = e, queueMicrotask(Ws);
|
|
181
181
|
}
|
|
182
|
-
},
|
|
182
|
+
}, Dn = (e) => (t) => typeof t == "string" && t.startsWith(e), Fn = /* @__PURE__ */ Dn("--"), Hs = /* @__PURE__ */ Dn("var(--"), ot = (e) => Hs(e) ? Us.test(e.split("/*")[0].trim()) : !1, Us = /var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu, J = {
|
|
183
183
|
test: (e) => typeof e == "number",
|
|
184
184
|
parse: parseFloat,
|
|
185
185
|
transform: (e) => e
|
|
186
|
-
},
|
|
186
|
+
}, ue = {
|
|
187
187
|
...J,
|
|
188
|
-
transform: (e) =>
|
|
188
|
+
transform: (e) => _(0, 1, e)
|
|
189
189
|
}, Te = {
|
|
190
190
|
...J,
|
|
191
191
|
default: 1
|
|
192
|
-
}, ae = (e) => Math.round(e * 1e5) / 1e5,
|
|
193
|
-
function
|
|
192
|
+
}, ae = (e) => Math.round(e * 1e5) / 1e5, at = /-?(?:\d+(?:\.\d+)?|\.\d+)/gu;
|
|
193
|
+
function _s(e) {
|
|
194
194
|
return e == null;
|
|
195
195
|
}
|
|
196
|
-
const
|
|
196
|
+
const js = /^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu, lt = (e, t) => (n) => !!(typeof n == "string" && js.test(n) && n.startsWith(e) || t && !_s(n) && Object.prototype.hasOwnProperty.call(n, t)), Ln = (e, t, n) => (s) => {
|
|
197
197
|
if (typeof s != "string")
|
|
198
198
|
return s;
|
|
199
|
-
const [r, i, o, a] = s.match(
|
|
199
|
+
const [r, i, o, a] = s.match(at);
|
|
200
200
|
return {
|
|
201
201
|
[e]: parseFloat(r),
|
|
202
202
|
[t]: parseFloat(i),
|
|
203
203
|
[n]: parseFloat(o),
|
|
204
204
|
alpha: a !== void 0 ? parseFloat(a) : 1
|
|
205
205
|
};
|
|
206
|
-
},
|
|
206
|
+
}, Gs = (e) => _(0, 255, e), De = {
|
|
207
207
|
...J,
|
|
208
|
-
transform: (e) => Math.round(
|
|
209
|
-
},
|
|
210
|
-
test: /* @__PURE__ */
|
|
211
|
-
parse: /* @__PURE__ */
|
|
212
|
-
transform: ({ red: e, green: t, blue: n, alpha: s = 1 }) => "rgba(" +
|
|
208
|
+
transform: (e) => Math.round(Gs(e))
|
|
209
|
+
}, q = {
|
|
210
|
+
test: /* @__PURE__ */ lt("rgb", "red"),
|
|
211
|
+
parse: /* @__PURE__ */ Ln("red", "green", "blue"),
|
|
212
|
+
transform: ({ red: e, green: t, blue: n, alpha: s = 1 }) => "rgba(" + De.transform(e) + ", " + De.transform(t) + ", " + De.transform(n) + ", " + ae(ue.transform(s)) + ")"
|
|
213
213
|
};
|
|
214
|
-
function
|
|
214
|
+
function zs(e) {
|
|
215
215
|
let t = "", n = "", s = "", r = "";
|
|
216
216
|
return e.length > 5 ? (t = e.substring(1, 3), n = e.substring(3, 5), s = e.substring(5, 7), r = e.substring(7, 9)) : (t = e.substring(1, 2), n = e.substring(2, 3), s = e.substring(3, 4), r = e.substring(4, 5), t += t, n += n, s += s, r += r), {
|
|
217
217
|
red: parseInt(t, 16),
|
|
@@ -220,82 +220,82 @@ function er(e) {
|
|
|
220
220
|
alpha: r ? parseInt(r, 16) / 255 : 1
|
|
221
221
|
};
|
|
222
222
|
}
|
|
223
|
-
const
|
|
224
|
-
test: /* @__PURE__ */
|
|
225
|
-
parse:
|
|
226
|
-
transform:
|
|
223
|
+
const Be = {
|
|
224
|
+
test: /* @__PURE__ */ lt("#"),
|
|
225
|
+
parse: zs,
|
|
226
|
+
transform: q.transform
|
|
227
227
|
}, me = /* @__NO_SIDE_EFFECTS__ */ (e) => ({
|
|
228
228
|
test: (t) => typeof t == "string" && t.endsWith(e) && t.split(" ").length === 1,
|
|
229
229
|
parse: parseFloat,
|
|
230
230
|
transform: (t) => `${t}${e}`
|
|
231
|
-
}),
|
|
231
|
+
}), $ = /* @__PURE__ */ me("deg"), z = /* @__PURE__ */ me("%"), p = /* @__PURE__ */ me("px"), Ys = /* @__PURE__ */ me("vh"), Xs = /* @__PURE__ */ me("vw"), kt = {
|
|
232
232
|
...z,
|
|
233
233
|
parse: (e) => z.parse(e) / 100,
|
|
234
234
|
transform: (e) => z.transform(e * 100)
|
|
235
235
|
}, G = {
|
|
236
|
-
test: /* @__PURE__ */
|
|
237
|
-
parse: /* @__PURE__ */
|
|
238
|
-
transform: ({ hue: e, saturation: t, lightness: n, alpha: s = 1 }) => "hsla(" + Math.round(e) + ", " + z.transform(ae(t)) + ", " + z.transform(ae(n)) + ", " + ae(
|
|
236
|
+
test: /* @__PURE__ */ lt("hsl", "hue"),
|
|
237
|
+
parse: /* @__PURE__ */ Ln("hue", "saturation", "lightness"),
|
|
238
|
+
transform: ({ hue: e, saturation: t, lightness: n, alpha: s = 1 }) => "hsla(" + Math.round(e) + ", " + z.transform(ae(t)) + ", " + z.transform(ae(n)) + ", " + ae(ue.transform(s)) + ")"
|
|
239
239
|
}, k = {
|
|
240
|
-
test: (e) =>
|
|
241
|
-
parse: (e) =>
|
|
242
|
-
transform: (e) => typeof e == "string" ? e : e.hasOwnProperty("red") ?
|
|
240
|
+
test: (e) => q.test(e) || Be.test(e) || G.test(e),
|
|
241
|
+
parse: (e) => q.test(e) ? q.parse(e) : G.test(e) ? G.parse(e) : Be.parse(e),
|
|
242
|
+
transform: (e) => typeof e == "string" ? e : e.hasOwnProperty("red") ? q.transform(e) : G.transform(e),
|
|
243
243
|
getAnimatableNone: (e) => {
|
|
244
244
|
const t = k.parse(e);
|
|
245
245
|
return t.alpha = 0, k.transform(t);
|
|
246
246
|
}
|
|
247
|
-
},
|
|
248
|
-
function
|
|
249
|
-
return isNaN(e) && typeof e == "string" && (e.match(
|
|
247
|
+
}, Zs = /(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;
|
|
248
|
+
function Js(e) {
|
|
249
|
+
return isNaN(e) && typeof e == "string" && (e.match(at)?.length || 0) + (e.match(Zs)?.length || 0) > 0;
|
|
250
250
|
}
|
|
251
|
-
const
|
|
252
|
-
function
|
|
251
|
+
const In = "number", On = "color", Qs = "var", er = "var(", Ct = "${}", tr = /var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;
|
|
252
|
+
function ce(e) {
|
|
253
253
|
const t = e.toString(), n = [], s = {
|
|
254
254
|
color: [],
|
|
255
255
|
number: [],
|
|
256
256
|
var: []
|
|
257
257
|
}, r = [];
|
|
258
258
|
let i = 0;
|
|
259
|
-
const a = t.replace(
|
|
259
|
+
const a = t.replace(tr, (l) => (k.test(l) ? (s.color.push(i), r.push(On), n.push(k.parse(l))) : l.startsWith(er) ? (s.var.push(i), r.push(Qs), n.push(l)) : (s.number.push(i), r.push(In), n.push(parseFloat(l))), ++i, Ct)).split(Ct);
|
|
260
260
|
return { values: n, split: a, indexes: s, types: r };
|
|
261
261
|
}
|
|
262
|
-
function
|
|
263
|
-
return
|
|
262
|
+
function Pn(e) {
|
|
263
|
+
return ce(e).values;
|
|
264
264
|
}
|
|
265
|
-
function
|
|
266
|
-
const { split: t, types: n } =
|
|
265
|
+
function Nn(e) {
|
|
266
|
+
const { split: t, types: n } = ce(e), s = t.length;
|
|
267
267
|
return (r) => {
|
|
268
268
|
let i = "";
|
|
269
269
|
for (let o = 0; o < s; o++)
|
|
270
270
|
if (i += t[o], r[o] !== void 0) {
|
|
271
271
|
const a = n[o];
|
|
272
|
-
a ===
|
|
272
|
+
a === In ? i += ae(r[o]) : a === On ? i += k.transform(r[o]) : i += r[o];
|
|
273
273
|
}
|
|
274
274
|
return i;
|
|
275
275
|
};
|
|
276
276
|
}
|
|
277
|
-
const
|
|
278
|
-
function
|
|
279
|
-
const t =
|
|
280
|
-
return
|
|
277
|
+
const nr = (e) => typeof e == "number" ? 0 : k.test(e) ? k.getAnimatableNone(e) : e;
|
|
278
|
+
function sr(e) {
|
|
279
|
+
const t = Pn(e);
|
|
280
|
+
return Nn(e)(t.map(nr));
|
|
281
281
|
}
|
|
282
282
|
const Q = {
|
|
283
|
-
test:
|
|
284
|
-
parse:
|
|
285
|
-
createTransformer:
|
|
286
|
-
getAnimatableNone:
|
|
283
|
+
test: Js,
|
|
284
|
+
parse: Pn,
|
|
285
|
+
createTransformer: Nn,
|
|
286
|
+
getAnimatableNone: sr
|
|
287
287
|
};
|
|
288
|
-
function
|
|
288
|
+
function Fe(e, t, n) {
|
|
289
289
|
return n < 0 && (n += 1), n > 1 && (n -= 1), n < 1 / 6 ? e + (t - e) * 6 * n : n < 1 / 2 ? t : n < 2 / 3 ? e + (t - e) * (2 / 3 - n) * 6 : e;
|
|
290
290
|
}
|
|
291
|
-
function
|
|
291
|
+
function rr({ hue: e, saturation: t, lightness: n, alpha: s }) {
|
|
292
292
|
e /= 360, t /= 100, n /= 100;
|
|
293
293
|
let r = 0, i = 0, o = 0;
|
|
294
294
|
if (!t)
|
|
295
295
|
r = i = o = n;
|
|
296
296
|
else {
|
|
297
297
|
const a = n < 0.5 ? n * (1 + t) : n + t - n * t, l = 2 * n - a;
|
|
298
|
-
r =
|
|
298
|
+
r = Fe(l, a, e + 1 / 3), i = Fe(l, a, e), o = Fe(l, a, e - 1 / 3);
|
|
299
299
|
}
|
|
300
300
|
return {
|
|
301
301
|
red: Math.round(r * 255),
|
|
@@ -304,55 +304,55 @@ function ur({ hue: e, saturation: t, lightness: n, alpha: s }) {
|
|
|
304
304
|
alpha: s
|
|
305
305
|
};
|
|
306
306
|
}
|
|
307
|
-
function
|
|
307
|
+
function Me(e, t) {
|
|
308
308
|
return (n) => n > 0 ? t : e;
|
|
309
309
|
}
|
|
310
|
-
const pe = (e, t, n) => e + (t - e) * n,
|
|
310
|
+
const pe = (e, t, n) => e + (t - e) * n, Le = (e, t, n) => {
|
|
311
311
|
const s = e * e, r = n * (t * t - s) + s;
|
|
312
312
|
return r < 0 ? 0 : Math.sqrt(r);
|
|
313
|
-
},
|
|
314
|
-
function
|
|
315
|
-
const t =
|
|
313
|
+
}, ir = [Be, q, G], or = (e) => ir.find((t) => t.test(e));
|
|
314
|
+
function Dt(e) {
|
|
315
|
+
const t = or(e);
|
|
316
316
|
if (!t)
|
|
317
317
|
return !1;
|
|
318
318
|
let n = t.parse(e);
|
|
319
|
-
return t === G && (n =
|
|
319
|
+
return t === G && (n = rr(n)), n;
|
|
320
320
|
}
|
|
321
|
-
const
|
|
322
|
-
const n =
|
|
321
|
+
const Ft = (e, t) => {
|
|
322
|
+
const n = Dt(e), s = Dt(t);
|
|
323
323
|
if (!n || !s)
|
|
324
|
-
return
|
|
324
|
+
return Me(e, t);
|
|
325
325
|
const r = { ...n };
|
|
326
|
-
return (i) => (r.red =
|
|
327
|
-
},
|
|
328
|
-
function
|
|
329
|
-
return
|
|
326
|
+
return (i) => (r.red = Le(n.red, s.red, i), r.green = Le(n.green, s.green, i), r.blue = Le(n.blue, s.blue, i), r.alpha = pe(n.alpha, s.alpha, i), q.transform(r));
|
|
327
|
+
}, $e = /* @__PURE__ */ new Set(["none", "hidden"]);
|
|
328
|
+
function ar(e, t) {
|
|
329
|
+
return $e.has(e) ? (n) => n <= 0 ? e : t : (n) => n >= 1 ? t : e;
|
|
330
330
|
}
|
|
331
|
-
function
|
|
331
|
+
function lr(e, t) {
|
|
332
332
|
return (n) => pe(e, t, n);
|
|
333
333
|
}
|
|
334
|
-
function
|
|
335
|
-
return typeof e == "number" ?
|
|
334
|
+
function ut(e) {
|
|
335
|
+
return typeof e == "number" ? lr : typeof e == "string" ? ot(e) ? Me : k.test(e) ? Ft : fr : Array.isArray(e) ? Rn : typeof e == "object" ? k.test(e) ? Ft : ur : Me;
|
|
336
336
|
}
|
|
337
|
-
function
|
|
338
|
-
const n = [...e], s = n.length, r = e.map((i, o) =>
|
|
337
|
+
function Rn(e, t) {
|
|
338
|
+
const n = [...e], s = n.length, r = e.map((i, o) => ut(i)(i, t[o]));
|
|
339
339
|
return (i) => {
|
|
340
340
|
for (let o = 0; o < s; o++)
|
|
341
341
|
n[o] = r[o](i);
|
|
342
342
|
return n;
|
|
343
343
|
};
|
|
344
344
|
}
|
|
345
|
-
function
|
|
345
|
+
function ur(e, t) {
|
|
346
346
|
const n = { ...e, ...t }, s = {};
|
|
347
347
|
for (const r in n)
|
|
348
|
-
e[r] !== void 0 && t[r] !== void 0 && (s[r] =
|
|
348
|
+
e[r] !== void 0 && t[r] !== void 0 && (s[r] = ut(e[r])(e[r], t[r]));
|
|
349
349
|
return (r) => {
|
|
350
350
|
for (const i in s)
|
|
351
351
|
n[i] = s[i](r);
|
|
352
352
|
return n;
|
|
353
353
|
};
|
|
354
354
|
}
|
|
355
|
-
function
|
|
355
|
+
function cr(e, t) {
|
|
356
356
|
const n = [], s = { color: 0, var: 0, number: 0 };
|
|
357
357
|
for (let r = 0; r < t.values.length; r++) {
|
|
358
358
|
const i = t.types[r], o = e.indexes[i][s[i]], a = e.values[o] ?? 0;
|
|
@@ -360,51 +360,51 @@ function gr(e, t) {
|
|
|
360
360
|
}
|
|
361
361
|
return n;
|
|
362
362
|
}
|
|
363
|
-
const
|
|
364
|
-
const n = Q.createTransformer(t), s =
|
|
365
|
-
return s.indexes.var.length === r.indexes.var.length && s.indexes.color.length === r.indexes.color.length && s.indexes.number.length >= r.indexes.number.length ?
|
|
363
|
+
const fr = (e, t) => {
|
|
364
|
+
const n = Q.createTransformer(t), s = ce(e), r = ce(t);
|
|
365
|
+
return s.indexes.var.length === r.indexes.var.length && s.indexes.color.length === r.indexes.color.length && s.indexes.number.length >= r.indexes.number.length ? $e.has(e) && !r.values.length || $e.has(t) && !s.values.length ? ar(e, t) : nt(Rn(cr(s, r), r.values), n) : Me(e, t);
|
|
366
366
|
};
|
|
367
|
-
function
|
|
368
|
-
return typeof e == "number" && typeof t == "number" && typeof n == "number" ? pe(e, t, n) :
|
|
367
|
+
function Kn(e, t, n) {
|
|
368
|
+
return typeof e == "number" && typeof t == "number" && typeof n == "number" ? pe(e, t, n) : ut(e)(e, t);
|
|
369
369
|
}
|
|
370
|
-
const
|
|
370
|
+
const dr = (e) => {
|
|
371
371
|
const t = ({ timestamp: n }) => e(n);
|
|
372
372
|
return {
|
|
373
373
|
start: (n = !0) => K.update(t, n),
|
|
374
|
-
stop: () =>
|
|
374
|
+
stop: () => Ke(t),
|
|
375
375
|
/**
|
|
376
376
|
* If we're processing this frame we can use the
|
|
377
377
|
* framelocked timestamp to keep things in sync.
|
|
378
378
|
*/
|
|
379
|
-
now: () =>
|
|
379
|
+
now: () => Ve.isProcessing ? Ve.timestamp : F.now()
|
|
380
380
|
};
|
|
381
|
-
},
|
|
381
|
+
}, Bn = (e, t, n = 10) => {
|
|
382
382
|
let s = "";
|
|
383
383
|
const r = Math.max(Math.round(t / n), 2);
|
|
384
384
|
for (let i = 0; i < r; i++)
|
|
385
385
|
s += Math.round(e(i / (r - 1)) * 1e4) / 1e4 + ", ";
|
|
386
386
|
return `linear(${s.substring(0, s.length - 2)})`;
|
|
387
|
-
},
|
|
388
|
-
function
|
|
387
|
+
}, ke = 2e4;
|
|
388
|
+
function ct(e) {
|
|
389
389
|
let t = 0;
|
|
390
390
|
const n = 50;
|
|
391
391
|
let s = e.next(t);
|
|
392
|
-
for (; !s.done && t <
|
|
392
|
+
for (; !s.done && t < ke; )
|
|
393
393
|
t += n, s = e.next(t);
|
|
394
|
-
return t >=
|
|
394
|
+
return t >= ke ? 1 / 0 : t;
|
|
395
395
|
}
|
|
396
|
-
function
|
|
397
|
-
const s = n({ ...e, keyframes: [0, t] }), r = Math.min(
|
|
396
|
+
function $n(e, t = 100, n) {
|
|
397
|
+
const s = n({ ...e, keyframes: [0, t] }), r = Math.min(ct(s), ke);
|
|
398
398
|
return {
|
|
399
399
|
type: "keyframes",
|
|
400
400
|
ease: (i) => s.next(r * i).value / t,
|
|
401
|
-
duration: /* @__PURE__ */
|
|
401
|
+
duration: /* @__PURE__ */ I(r)
|
|
402
402
|
};
|
|
403
403
|
}
|
|
404
|
-
const
|
|
405
|
-
function
|
|
406
|
-
const s = Math.max(t -
|
|
407
|
-
return
|
|
404
|
+
const hr = 5;
|
|
405
|
+
function qn(e, t, n) {
|
|
406
|
+
const s = Math.max(t - hr, 0);
|
|
407
|
+
return yn(n - e(s), t - s);
|
|
408
408
|
}
|
|
409
409
|
const M = {
|
|
410
410
|
// Default spring physics
|
|
@@ -434,53 +434,53 @@ const M = {
|
|
|
434
434
|
// in seconds
|
|
435
435
|
minDamping: 0.05,
|
|
436
436
|
maxDamping: 1
|
|
437
|
-
},
|
|
438
|
-
function
|
|
437
|
+
}, Ie = 1e-3;
|
|
438
|
+
function mr({ duration: e = M.duration, bounce: t = M.bounce, velocity: n = M.velocity, mass: s = M.mass }) {
|
|
439
439
|
let r, i, o = 1 - t;
|
|
440
|
-
o =
|
|
441
|
-
const
|
|
442
|
-
return
|
|
443
|
-
}, i = (
|
|
444
|
-
const
|
|
445
|
-
return (-r(
|
|
446
|
-
}) : (r = (
|
|
447
|
-
const
|
|
448
|
-
return -
|
|
449
|
-
}, i = (
|
|
450
|
-
const
|
|
451
|
-
return
|
|
440
|
+
o = _(M.minDamping, M.maxDamping, o), e = _(M.minDuration, M.maxDuration, /* @__PURE__ */ I(e)), o < 1 ? (r = (c) => {
|
|
441
|
+
const u = c * o, f = u * e, d = u - n, h = qe(c, o), m = Math.exp(-f);
|
|
442
|
+
return Ie - d / h * m;
|
|
443
|
+
}, i = (c) => {
|
|
444
|
+
const f = c * o * e, d = f * n + n, h = Math.pow(o, 2) * Math.pow(c, 2) * e, m = Math.exp(-f), y = qe(Math.pow(c, 2), o);
|
|
445
|
+
return (-r(c) + Ie > 0 ? -1 : 1) * ((d - h) * m) / y;
|
|
446
|
+
}) : (r = (c) => {
|
|
447
|
+
const u = Math.exp(-c * e), f = (c - n) * e + 1;
|
|
448
|
+
return -Ie + u * f;
|
|
449
|
+
}, i = (c) => {
|
|
450
|
+
const u = Math.exp(-c * e), f = (n - c) * (e * e);
|
|
451
|
+
return u * f;
|
|
452
452
|
});
|
|
453
|
-
const a = 5 / e, l =
|
|
454
|
-
if (e = /* @__PURE__ */
|
|
453
|
+
const a = 5 / e, l = gr(r, i, a);
|
|
454
|
+
if (e = /* @__PURE__ */ P(e), isNaN(l))
|
|
455
455
|
return {
|
|
456
456
|
stiffness: M.stiffness,
|
|
457
457
|
damping: M.damping,
|
|
458
458
|
duration: e
|
|
459
459
|
};
|
|
460
460
|
{
|
|
461
|
-
const
|
|
461
|
+
const c = Math.pow(l, 2) * s;
|
|
462
462
|
return {
|
|
463
|
-
stiffness:
|
|
464
|
-
damping: o * 2 * Math.sqrt(s *
|
|
463
|
+
stiffness: c,
|
|
464
|
+
damping: o * 2 * Math.sqrt(s * c),
|
|
465
465
|
duration: e
|
|
466
466
|
};
|
|
467
467
|
}
|
|
468
468
|
}
|
|
469
|
-
const
|
|
470
|
-
function
|
|
469
|
+
const pr = 12;
|
|
470
|
+
function gr(e, t, n) {
|
|
471
471
|
let s = n;
|
|
472
|
-
for (let r = 1; r <
|
|
472
|
+
for (let r = 1; r < pr; r++)
|
|
473
473
|
s = s - e(s) / t(s);
|
|
474
474
|
return s;
|
|
475
475
|
}
|
|
476
|
-
function
|
|
476
|
+
function qe(e, t) {
|
|
477
477
|
return e * Math.sqrt(1 - t * t);
|
|
478
478
|
}
|
|
479
|
-
const
|
|
480
|
-
function
|
|
479
|
+
const yr = ["duration", "bounce"], br = ["stiffness", "damping", "mass"];
|
|
480
|
+
function Lt(e, t) {
|
|
481
481
|
return t.some((n) => e[n] !== void 0);
|
|
482
482
|
}
|
|
483
|
-
function
|
|
483
|
+
function wr(e) {
|
|
484
484
|
let t = {
|
|
485
485
|
velocity: M.velocity,
|
|
486
486
|
stiffness: M.stiffness,
|
|
@@ -489,9 +489,9 @@ function Er(e) {
|
|
|
489
489
|
isResolvedFromDuration: !1,
|
|
490
490
|
...e
|
|
491
491
|
};
|
|
492
|
-
if (!
|
|
492
|
+
if (!Lt(e, br) && Lt(e, yr))
|
|
493
493
|
if (e.visualDuration) {
|
|
494
|
-
const n = e.visualDuration, s = 2 * Math.PI / (n * 1.2), r = s * s, i = 2 *
|
|
494
|
+
const n = e.visualDuration, s = 2 * Math.PI / (n * 1.2), r = s * s, i = 2 * _(0.05, 1, 1 - (e.bounce || 0)) * Math.sqrt(r);
|
|
495
495
|
t = {
|
|
496
496
|
...t,
|
|
497
497
|
mass: M.mass,
|
|
@@ -499,7 +499,7 @@ function Er(e) {
|
|
|
499
499
|
damping: i
|
|
500
500
|
};
|
|
501
501
|
} else {
|
|
502
|
-
const n =
|
|
502
|
+
const n = mr(e);
|
|
503
503
|
t = {
|
|
504
504
|
...t,
|
|
505
505
|
...n,
|
|
@@ -515,44 +515,44 @@ function X(e = M.visualDuration, t = M.bounce) {
|
|
|
515
515
|
bounce: t
|
|
516
516
|
} : e;
|
|
517
517
|
let { restSpeed: s, restDelta: r } = n;
|
|
518
|
-
const i = n.keyframes[0], o = n.keyframes[n.keyframes.length - 1], a = { done: !1, value: i }, { stiffness: l, damping:
|
|
518
|
+
const i = n.keyframes[0], o = n.keyframes[n.keyframes.length - 1], a = { done: !1, value: i }, { stiffness: l, damping: c, mass: u, duration: f, velocity: d, isResolvedFromDuration: h } = wr({
|
|
519
519
|
...n,
|
|
520
|
-
velocity: -/* @__PURE__ */
|
|
521
|
-
}), m = d || 0, y =
|
|
520
|
+
velocity: -/* @__PURE__ */ I(n.velocity || 0)
|
|
521
|
+
}), m = d || 0, y = c / (2 * Math.sqrt(l * u)), T = o - i, b = /* @__PURE__ */ I(Math.sqrt(l / u)), x = Math.abs(T) < 5;
|
|
522
522
|
s || (s = x ? M.restSpeed.granular : M.restSpeed.default), r || (r = x ? M.restDelta.granular : M.restDelta.default);
|
|
523
|
-
let
|
|
523
|
+
let A;
|
|
524
524
|
if (y < 1) {
|
|
525
|
-
const g =
|
|
526
|
-
|
|
527
|
-
const V = Math.exp(-y * b *
|
|
528
|
-
return o - V * ((m + y * b * T) / g * Math.sin(g *
|
|
525
|
+
const g = qe(b, y);
|
|
526
|
+
A = (v) => {
|
|
527
|
+
const V = Math.exp(-y * b * v);
|
|
528
|
+
return o - V * ((m + y * b * T) / g * Math.sin(g * v) + T * Math.cos(g * v));
|
|
529
529
|
};
|
|
530
530
|
} else if (y === 1)
|
|
531
|
-
|
|
531
|
+
A = (g) => o - Math.exp(-b * g) * (T + (m + b * T) * g);
|
|
532
532
|
else {
|
|
533
533
|
const g = b * Math.sqrt(y * y - 1);
|
|
534
|
-
|
|
535
|
-
const V = Math.exp(-y * b *
|
|
534
|
+
A = (v) => {
|
|
535
|
+
const V = Math.exp(-y * b * v), w = Math.min(g * v, 300);
|
|
536
536
|
return o - V * ((m + y * b * T) * Math.sinh(w) + g * T * Math.cosh(w)) / g;
|
|
537
537
|
};
|
|
538
538
|
}
|
|
539
539
|
const S = {
|
|
540
|
-
calculatedDuration: h &&
|
|
540
|
+
calculatedDuration: h && f || null,
|
|
541
541
|
next: (g) => {
|
|
542
|
-
const
|
|
542
|
+
const v = A(g);
|
|
543
543
|
if (h)
|
|
544
|
-
a.done = g >=
|
|
544
|
+
a.done = g >= f;
|
|
545
545
|
else {
|
|
546
546
|
let V = g === 0 ? m : 0;
|
|
547
|
-
y < 1 && (V = g === 0 ? /* @__PURE__ */
|
|
548
|
-
const w = Math.abs(V) <= s, E = Math.abs(o -
|
|
547
|
+
y < 1 && (V = g === 0 ? /* @__PURE__ */ P(m) : qn(A, g, v));
|
|
548
|
+
const w = Math.abs(V) <= s, E = Math.abs(o - v) <= r;
|
|
549
549
|
a.done = w && E;
|
|
550
550
|
}
|
|
551
|
-
return a.value = a.done ? o :
|
|
551
|
+
return a.value = a.done ? o : v, a;
|
|
552
552
|
},
|
|
553
553
|
toString: () => {
|
|
554
|
-
const g = Math.min(
|
|
555
|
-
return g + "ms " +
|
|
554
|
+
const g = Math.min(ct(S), ke), v = Bn((V) => S.next(g * V).value, g, 30);
|
|
555
|
+
return g + "ms " + v;
|
|
556
556
|
},
|
|
557
557
|
toTransition: () => {
|
|
558
558
|
}
|
|
@@ -560,123 +560,123 @@ function X(e = M.visualDuration, t = M.bounce) {
|
|
|
560
560
|
return S;
|
|
561
561
|
}
|
|
562
562
|
X.applyToOptions = (e) => {
|
|
563
|
-
const t =
|
|
564
|
-
return e.ease = t.ease, e.duration = /* @__PURE__ */
|
|
563
|
+
const t = $n(e, 100, X);
|
|
564
|
+
return e.ease = t.ease, e.duration = /* @__PURE__ */ P(t.duration), e.type = "keyframes", e;
|
|
565
565
|
};
|
|
566
|
-
function
|
|
567
|
-
const
|
|
566
|
+
function We({ keyframes: e, velocity: t = 0, power: n = 0.8, timeConstant: s = 325, bounceDamping: r = 10, bounceStiffness: i = 500, modifyTarget: o, min: a, max: l, restDelta: c = 0.5, restSpeed: u }) {
|
|
567
|
+
const f = e[0], d = {
|
|
568
568
|
done: !1,
|
|
569
|
-
value:
|
|
569
|
+
value: f
|
|
570
570
|
}, h = (w) => a !== void 0 && w < a || l !== void 0 && w > l, m = (w) => a === void 0 ? l : l === void 0 || Math.abs(a - w) < Math.abs(l - w) ? a : l;
|
|
571
571
|
let y = n * t;
|
|
572
|
-
const T =
|
|
573
|
-
b !== T && (y = b -
|
|
574
|
-
const x = (w) => -y * Math.exp(-w / s),
|
|
575
|
-
const E = x(w), D =
|
|
576
|
-
d.done = Math.abs(E) <=
|
|
572
|
+
const T = f + y, b = o === void 0 ? T : o(T);
|
|
573
|
+
b !== T && (y = b - f);
|
|
574
|
+
const x = (w) => -y * Math.exp(-w / s), A = (w) => b + x(w), S = (w) => {
|
|
575
|
+
const E = x(w), D = A(w);
|
|
576
|
+
d.done = Math.abs(E) <= c, d.value = d.done ? b : D;
|
|
577
577
|
};
|
|
578
|
-
let g,
|
|
578
|
+
let g, v;
|
|
579
579
|
const V = (w) => {
|
|
580
|
-
h(d.value) && (g = w,
|
|
580
|
+
h(d.value) && (g = w, v = X({
|
|
581
581
|
keyframes: [d.value, m(d.value)],
|
|
582
|
-
velocity:
|
|
582
|
+
velocity: qn(A, w, d.value),
|
|
583
583
|
// TODO: This should be passing * 1000
|
|
584
584
|
damping: r,
|
|
585
585
|
stiffness: i,
|
|
586
|
-
restDelta:
|
|
587
|
-
restSpeed:
|
|
586
|
+
restDelta: c,
|
|
587
|
+
restSpeed: u
|
|
588
588
|
}));
|
|
589
589
|
};
|
|
590
590
|
return V(0), {
|
|
591
591
|
calculatedDuration: null,
|
|
592
592
|
next: (w) => {
|
|
593
593
|
let E = !1;
|
|
594
|
-
return !
|
|
594
|
+
return !v && g === void 0 && (E = !0, S(w), V(w)), g !== void 0 && w >= g ? v.next(w - g) : (!E && S(w), d);
|
|
595
595
|
}
|
|
596
596
|
};
|
|
597
597
|
}
|
|
598
|
-
function
|
|
599
|
-
const s = [], r = n ||
|
|
598
|
+
function Tr(e, t, n) {
|
|
599
|
+
const s = [], r = n || R.mix || Kn, i = e.length - 1;
|
|
600
600
|
for (let o = 0; o < i; o++) {
|
|
601
601
|
let a = r(e[o], e[o + 1]);
|
|
602
602
|
if (t) {
|
|
603
603
|
const l = Array.isArray(t) ? t[o] || Z : t;
|
|
604
|
-
a =
|
|
604
|
+
a = nt(l, a);
|
|
605
605
|
}
|
|
606
606
|
s.push(a);
|
|
607
607
|
}
|
|
608
608
|
return s;
|
|
609
609
|
}
|
|
610
|
-
function
|
|
610
|
+
function Ar(e, t, { clamp: n = !0, ease: s, mixer: r } = {}) {
|
|
611
611
|
const i = e.length;
|
|
612
|
-
if (
|
|
612
|
+
if (et(i === t.length), i === 1)
|
|
613
613
|
return () => t[0];
|
|
614
614
|
if (i === 2 && t[0] === t[1])
|
|
615
615
|
return () => t[1];
|
|
616
616
|
const o = e[0] === e[1];
|
|
617
617
|
e[0] > e[i - 1] && (e = [...e].reverse(), t = [...t].reverse());
|
|
618
|
-
const a =
|
|
619
|
-
if (o &&
|
|
618
|
+
const a = Tr(t, s, r), l = a.length, c = (u) => {
|
|
619
|
+
if (o && u < e[0])
|
|
620
620
|
return t[0];
|
|
621
|
-
let
|
|
621
|
+
let f = 0;
|
|
622
622
|
if (l > 1)
|
|
623
|
-
for (;
|
|
623
|
+
for (; f < e.length - 2 && !(u < e[f + 1]); f++)
|
|
624
624
|
;
|
|
625
|
-
const d = /* @__PURE__ */
|
|
626
|
-
return a[
|
|
625
|
+
const d = /* @__PURE__ */ st(e[f], e[f + 1], u);
|
|
626
|
+
return a[f](d);
|
|
627
627
|
};
|
|
628
|
-
return n ? (
|
|
628
|
+
return n ? (u) => c(_(e[0], e[i - 1], u)) : c;
|
|
629
629
|
}
|
|
630
|
-
function
|
|
630
|
+
function Wn(e, t) {
|
|
631
631
|
const n = e[e.length - 1];
|
|
632
632
|
for (let s = 1; s <= t; s++) {
|
|
633
|
-
const r = /* @__PURE__ */
|
|
633
|
+
const r = /* @__PURE__ */ st(0, t, s);
|
|
634
634
|
e.push(pe(n, 1, r));
|
|
635
635
|
}
|
|
636
636
|
}
|
|
637
|
-
function
|
|
637
|
+
function Hn(e) {
|
|
638
638
|
const t = [0];
|
|
639
|
-
return
|
|
639
|
+
return Wn(t, e.length - 1), t;
|
|
640
640
|
}
|
|
641
|
-
function
|
|
641
|
+
function vr(e, t) {
|
|
642
642
|
return e.map((n) => n * t);
|
|
643
643
|
}
|
|
644
|
-
function
|
|
645
|
-
return e.map(() => t ||
|
|
644
|
+
function Sr(e, t) {
|
|
645
|
+
return e.map(() => t || En).splice(0, e.length - 1);
|
|
646
646
|
}
|
|
647
647
|
function le({ duration: e = 300, keyframes: t, times: n, ease: s = "easeInOut" }) {
|
|
648
|
-
const r =
|
|
648
|
+
const r = Vn(s) ? s.map(Mt) : Mt(s), i = {
|
|
649
649
|
done: !1,
|
|
650
650
|
value: t[0]
|
|
651
|
-
}, o =
|
|
651
|
+
}, o = vr(
|
|
652
652
|
// Only use the provided offsets if they're the correct length
|
|
653
653
|
// TODO Maybe we should warn here if there's a length mismatch
|
|
654
|
-
n && n.length === t.length ? n :
|
|
654
|
+
n && n.length === t.length ? n : Hn(t),
|
|
655
655
|
e
|
|
656
|
-
), a =
|
|
657
|
-
ease: Array.isArray(r) ? r :
|
|
656
|
+
), a = Ar(o, t, {
|
|
657
|
+
ease: Array.isArray(r) ? r : Sr(t, r)
|
|
658
658
|
});
|
|
659
659
|
return {
|
|
660
660
|
calculatedDuration: e,
|
|
661
661
|
next: (l) => (i.value = a(l), i.done = l >= e, i)
|
|
662
662
|
};
|
|
663
663
|
}
|
|
664
|
-
const
|
|
665
|
-
function
|
|
666
|
-
const i = e.filter(
|
|
664
|
+
const xr = (e) => e !== null;
|
|
665
|
+
function ft(e, { repeat: t, repeatType: n = "loop" }, s, r = 1) {
|
|
666
|
+
const i = e.filter(xr), a = r < 0 || t && n !== "loop" && t % 2 === 1 ? 0 : i.length - 1;
|
|
667
667
|
return !a || s === void 0 ? i[a] : s;
|
|
668
668
|
}
|
|
669
|
-
const
|
|
670
|
-
decay:
|
|
671
|
-
inertia:
|
|
669
|
+
const Er = {
|
|
670
|
+
decay: We,
|
|
671
|
+
inertia: We,
|
|
672
672
|
tween: le,
|
|
673
673
|
keyframes: le,
|
|
674
674
|
spring: X
|
|
675
675
|
};
|
|
676
|
-
function
|
|
677
|
-
typeof e.type == "string" && (e.type =
|
|
676
|
+
function Un(e) {
|
|
677
|
+
typeof e.type == "string" && (e.type = Er[e.type]);
|
|
678
678
|
}
|
|
679
|
-
class
|
|
679
|
+
class dt {
|
|
680
680
|
constructor() {
|
|
681
681
|
this.updateFinished();
|
|
682
682
|
}
|
|
@@ -700,29 +700,29 @@ class pt {
|
|
|
700
700
|
return this.finished.then(t, n);
|
|
701
701
|
}
|
|
702
702
|
}
|
|
703
|
-
const
|
|
704
|
-
class
|
|
703
|
+
const Vr = (e) => e / 100;
|
|
704
|
+
class ht extends dt {
|
|
705
705
|
constructor(t) {
|
|
706
706
|
super(), this.state = "idle", this.startTime = null, this.isStopped = !1, this.currentTime = 0, this.holdTime = null, this.playbackSpeed = 1, this.stop = () => {
|
|
707
707
|
const { motionValue: n } = this.options;
|
|
708
|
-
n && n.updatedAt !==
|
|
708
|
+
n && n.updatedAt !== F.now() && this.tick(F.now()), this.isStopped = !0, this.state !== "idle" && (this.teardown(), this.options.onStop?.());
|
|
709
709
|
}, this.options = t, this.initAnimation(), this.play(), t.autoplay === !1 && this.pause();
|
|
710
710
|
}
|
|
711
711
|
initAnimation() {
|
|
712
712
|
const { options: t } = this;
|
|
713
|
-
|
|
713
|
+
Un(t);
|
|
714
714
|
const { type: n = le, repeat: s = 0, repeatDelay: r = 0, repeatType: i, velocity: o = 0 } = t;
|
|
715
715
|
let { keyframes: a } = t;
|
|
716
716
|
const l = n || le;
|
|
717
|
-
l !== le && typeof a[0] != "number" && (this.mixKeyframes =
|
|
718
|
-
const
|
|
717
|
+
l !== le && typeof a[0] != "number" && (this.mixKeyframes = nt(Vr, Kn(a[0], a[1])), a = [0, 100]);
|
|
718
|
+
const c = l({ ...t, keyframes: a });
|
|
719
719
|
i === "mirror" && (this.mirroredGenerator = l({
|
|
720
720
|
...t,
|
|
721
721
|
keyframes: [...a].reverse(),
|
|
722
722
|
velocity: -o
|
|
723
|
-
})),
|
|
724
|
-
const { calculatedDuration:
|
|
725
|
-
this.calculatedDuration =
|
|
723
|
+
})), c.calculatedDuration === null && (c.calculatedDuration = ct(c));
|
|
724
|
+
const { calculatedDuration: u } = c;
|
|
725
|
+
this.calculatedDuration = u, this.resolvedDuration = u + r, this.totalDuration = this.resolvedDuration * (s + 1) - r, this.generator = c;
|
|
726
726
|
}
|
|
727
727
|
updateTime(t) {
|
|
728
728
|
const n = Math.round(t - this.startTime) * this.playbackSpeed;
|
|
@@ -732,22 +732,22 @@ class gt extends pt {
|
|
|
732
732
|
const { generator: s, totalDuration: r, mixKeyframes: i, mirroredGenerator: o, resolvedDuration: a, calculatedDuration: l } = this;
|
|
733
733
|
if (this.startTime === null)
|
|
734
734
|
return s.next(0);
|
|
735
|
-
const { delay:
|
|
735
|
+
const { delay: c = 0, keyframes: u, repeat: f, repeatType: d, repeatDelay: h, type: m, onUpdate: y, finalKeyframe: T } = this.options;
|
|
736
736
|
this.speed > 0 ? this.startTime = Math.min(this.startTime, t) : this.speed < 0 && (this.startTime = Math.min(t - r / this.speed, this.startTime)), n ? this.currentTime = t : this.updateTime(t);
|
|
737
|
-
const b = this.currentTime -
|
|
737
|
+
const b = this.currentTime - c * (this.playbackSpeed >= 0 ? 1 : -1), x = this.playbackSpeed >= 0 ? b < 0 : b > r;
|
|
738
738
|
this.currentTime = Math.max(b, 0), this.state === "finished" && this.holdTime === null && (this.currentTime = r);
|
|
739
|
-
let
|
|
740
|
-
if (
|
|
739
|
+
let A = this.currentTime, S = s;
|
|
740
|
+
if (f) {
|
|
741
741
|
const w = Math.min(this.currentTime, r) / a;
|
|
742
742
|
let E = Math.floor(w), D = w % 1;
|
|
743
|
-
!D && w >= 1 && (D = 1), D === 1 && E--, E = Math.min(E,
|
|
743
|
+
!D && w >= 1 && (D = 1), D === 1 && E--, E = Math.min(E, f + 1), !!(E % 2) && (d === "reverse" ? (D = 1 - D, h && (D -= h / a)) : d === "mirror" && (S = o)), A = _(0, 1, D) * a;
|
|
744
744
|
}
|
|
745
|
-
const g = x ? { done: !1, value:
|
|
745
|
+
const g = x ? { done: !1, value: u[0] } : S.next(A);
|
|
746
746
|
i && (g.value = i(g.value));
|
|
747
|
-
let { done:
|
|
748
|
-
!x && l !== null && (
|
|
749
|
-
const V = this.holdTime === null && (this.state === "finished" || this.state === "running" &&
|
|
750
|
-
return V && m !==
|
|
747
|
+
let { done: v } = g;
|
|
748
|
+
!x && l !== null && (v = this.playbackSpeed >= 0 ? this.currentTime >= r : this.currentTime <= 0);
|
|
749
|
+
const V = this.holdTime === null && (this.state === "finished" || this.state === "running" && v);
|
|
750
|
+
return V && m !== We && (g.value = ft(u, this.options, T, this.speed)), y && y(g.value), V && this.finish(), g;
|
|
751
751
|
}
|
|
752
752
|
/**
|
|
753
753
|
* Allows the returned animation to be awaited or promise-chained. Currently
|
|
@@ -758,36 +758,36 @@ class gt extends pt {
|
|
|
758
758
|
return this.finished.then(t, n);
|
|
759
759
|
}
|
|
760
760
|
get duration() {
|
|
761
|
-
return /* @__PURE__ */
|
|
761
|
+
return /* @__PURE__ */ I(this.calculatedDuration);
|
|
762
762
|
}
|
|
763
763
|
get iterationDuration() {
|
|
764
764
|
const { delay: t = 0 } = this.options || {};
|
|
765
|
-
return this.duration + /* @__PURE__ */
|
|
765
|
+
return this.duration + /* @__PURE__ */ I(t);
|
|
766
766
|
}
|
|
767
767
|
get time() {
|
|
768
|
-
return /* @__PURE__ */
|
|
768
|
+
return /* @__PURE__ */ I(this.currentTime);
|
|
769
769
|
}
|
|
770
770
|
set time(t) {
|
|
771
|
-
t = /* @__PURE__ */
|
|
771
|
+
t = /* @__PURE__ */ P(t), this.currentTime = t, this.startTime === null || this.holdTime !== null || this.playbackSpeed === 0 ? this.holdTime = t : this.driver && (this.startTime = this.driver.now() - t / this.playbackSpeed), this.driver?.start(!1);
|
|
772
772
|
}
|
|
773
773
|
get speed() {
|
|
774
774
|
return this.playbackSpeed;
|
|
775
775
|
}
|
|
776
776
|
set speed(t) {
|
|
777
|
-
this.updateTime(
|
|
777
|
+
this.updateTime(F.now());
|
|
778
778
|
const n = this.playbackSpeed !== t;
|
|
779
|
-
this.playbackSpeed = t, n && (this.time = /* @__PURE__ */
|
|
779
|
+
this.playbackSpeed = t, n && (this.time = /* @__PURE__ */ I(this.currentTime));
|
|
780
780
|
}
|
|
781
781
|
play() {
|
|
782
782
|
if (this.isStopped)
|
|
783
783
|
return;
|
|
784
|
-
const { driver: t =
|
|
784
|
+
const { driver: t = dr, startTime: n } = this.options;
|
|
785
785
|
this.driver || (this.driver = t((r) => this.tick(r))), this.options.onPlay?.();
|
|
786
786
|
const s = this.driver.now();
|
|
787
787
|
this.state === "finished" ? (this.updateFinished(), this.startTime = s) : this.holdTime !== null ? this.startTime = s - this.holdTime : this.startTime || (this.startTime = n ?? s), this.state === "finished" && this.speed < 0 && (this.startTime += this.calculatedDuration), this.holdTime = null, this.state = "running", this.driver.start();
|
|
788
788
|
}
|
|
789
789
|
pause() {
|
|
790
|
-
this.state = "paused", this.updateTime(
|
|
790
|
+
this.state = "paused", this.updateTime(F.now()), this.holdTime = this.currentTime;
|
|
791
791
|
}
|
|
792
792
|
complete() {
|
|
793
793
|
this.state !== "running" && this.play(), this.state = "finished", this.holdTime = null;
|
|
@@ -811,14 +811,14 @@ class gt extends pt {
|
|
|
811
811
|
return this.options.allowFlatten && (this.options.type = "keyframes", this.options.ease = "linear", this.initAnimation()), this.driver?.stop(), t.observe(this);
|
|
812
812
|
}
|
|
813
813
|
}
|
|
814
|
-
function
|
|
814
|
+
function Mr(e) {
|
|
815
815
|
for (let t = 1; t < e.length; t++)
|
|
816
816
|
e[t] ?? (e[t] = e[t - 1]);
|
|
817
817
|
}
|
|
818
|
-
const
|
|
819
|
-
const t =
|
|
820
|
-
return
|
|
821
|
-
},
|
|
818
|
+
const W = (e) => e * 180 / Math.PI, He = (e) => {
|
|
819
|
+
const t = W(Math.atan2(e[1], e[0]));
|
|
820
|
+
return Ue(t);
|
|
821
|
+
}, kr = {
|
|
822
822
|
x: 4,
|
|
823
823
|
y: 5,
|
|
824
824
|
translateX: 4,
|
|
@@ -826,53 +826,53 @@ const H = (e) => e * 180 / Math.PI, je = (e) => {
|
|
|
826
826
|
scaleX: 0,
|
|
827
827
|
scaleY: 3,
|
|
828
828
|
scale: (e) => (Math.abs(e[0]) + Math.abs(e[3])) / 2,
|
|
829
|
-
rotate:
|
|
830
|
-
rotateZ:
|
|
831
|
-
skewX: (e) =>
|
|
832
|
-
skewY: (e) =>
|
|
829
|
+
rotate: He,
|
|
830
|
+
rotateZ: He,
|
|
831
|
+
skewX: (e) => W(Math.atan(e[1])),
|
|
832
|
+
skewY: (e) => W(Math.atan(e[2])),
|
|
833
833
|
skew: (e) => (Math.abs(e[1]) + Math.abs(e[2])) / 2
|
|
834
|
-
},
|
|
834
|
+
}, Ue = (e) => (e = e % 360, e < 0 && (e += 360), e), It = He, Ot = (e) => Math.sqrt(e[0] * e[0] + e[1] * e[1]), Pt = (e) => Math.sqrt(e[4] * e[4] + e[5] * e[5]), Cr = {
|
|
835
835
|
x: 12,
|
|
836
836
|
y: 13,
|
|
837
837
|
z: 14,
|
|
838
838
|
translateX: 12,
|
|
839
839
|
translateY: 13,
|
|
840
840
|
translateZ: 14,
|
|
841
|
-
scaleX:
|
|
842
|
-
scaleY:
|
|
843
|
-
scale: (e) => (
|
|
844
|
-
rotateX: (e) =>
|
|
845
|
-
rotateY: (e) =>
|
|
846
|
-
rotateZ:
|
|
847
|
-
rotate:
|
|
848
|
-
skewX: (e) =>
|
|
849
|
-
skewY: (e) =>
|
|
841
|
+
scaleX: Ot,
|
|
842
|
+
scaleY: Pt,
|
|
843
|
+
scale: (e) => (Ot(e) + Pt(e)) / 2,
|
|
844
|
+
rotateX: (e) => Ue(W(Math.atan2(e[6], e[5]))),
|
|
845
|
+
rotateY: (e) => Ue(W(Math.atan2(-e[2], e[0]))),
|
|
846
|
+
rotateZ: It,
|
|
847
|
+
rotate: It,
|
|
848
|
+
skewX: (e) => W(Math.atan(e[4])),
|
|
849
|
+
skewY: (e) => W(Math.atan(e[1])),
|
|
850
850
|
skew: (e) => (Math.abs(e[1]) + Math.abs(e[4])) / 2
|
|
851
851
|
};
|
|
852
|
-
function
|
|
852
|
+
function _e(e) {
|
|
853
853
|
return e.includes("scale") ? 1 : 0;
|
|
854
854
|
}
|
|
855
|
-
function
|
|
855
|
+
function je(e, t) {
|
|
856
856
|
if (!e || e === "none")
|
|
857
|
-
return
|
|
857
|
+
return _e(t);
|
|
858
858
|
const n = e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);
|
|
859
859
|
let s, r;
|
|
860
860
|
if (n)
|
|
861
|
-
s =
|
|
861
|
+
s = Cr, r = n;
|
|
862
862
|
else {
|
|
863
863
|
const a = e.match(/^matrix\(([-\d.e\s,]+)\)$/u);
|
|
864
|
-
s =
|
|
864
|
+
s = kr, r = a;
|
|
865
865
|
}
|
|
866
866
|
if (!r)
|
|
867
|
-
return
|
|
868
|
-
const i = s[t], o = r[1].split(",").map(
|
|
867
|
+
return _e(t);
|
|
868
|
+
const i = s[t], o = r[1].split(",").map(Fr);
|
|
869
869
|
return typeof i == "function" ? i(o) : o[i];
|
|
870
870
|
}
|
|
871
|
-
const
|
|
871
|
+
const Dr = (e, t) => {
|
|
872
872
|
const { transform: n = "none" } = getComputedStyle(e);
|
|
873
|
-
return
|
|
873
|
+
return je(n, t);
|
|
874
874
|
};
|
|
875
|
-
function
|
|
875
|
+
function Fr(e) {
|
|
876
876
|
return parseFloat(e.trim());
|
|
877
877
|
}
|
|
878
878
|
const ee = [
|
|
@@ -893,15 +893,15 @@ const ee = [
|
|
|
893
893
|
"skew",
|
|
894
894
|
"skewX",
|
|
895
895
|
"skewY"
|
|
896
|
-
], te = new Set(ee),
|
|
897
|
-
function
|
|
896
|
+
], te = new Set(ee), Nt = (e) => e === J || e === p, Lr = /* @__PURE__ */ new Set(["x", "y", "z"]), Ir = ee.filter((e) => !Lr.has(e));
|
|
897
|
+
function Or(e) {
|
|
898
898
|
const t = [];
|
|
899
|
-
return
|
|
899
|
+
return Ir.forEach((n) => {
|
|
900
900
|
const s = e.getValue(n);
|
|
901
901
|
s !== void 0 && (t.push([n, s.get()]), s.set(n.startsWith("scale") ? 1 : 0));
|
|
902
902
|
}), t;
|
|
903
903
|
}
|
|
904
|
-
const
|
|
904
|
+
const H = {
|
|
905
905
|
// Dimensions
|
|
906
906
|
width: ({ x: e }, { paddingLeft: t = "0", paddingRight: n = "0" }) => e.max - e.min - parseFloat(t) - parseFloat(n),
|
|
907
907
|
height: ({ y: e }, { paddingTop: t = "0", paddingBottom: n = "0" }) => e.max - e.min - parseFloat(t) - parseFloat(n),
|
|
@@ -910,18 +910,18 @@ const W = {
|
|
|
910
910
|
bottom: ({ y: e }, { top: t }) => parseFloat(t) + (e.max - e.min),
|
|
911
911
|
right: ({ x: e }, { left: t }) => parseFloat(t) + (e.max - e.min),
|
|
912
912
|
// Transform
|
|
913
|
-
x: (e, { transform: t }) =>
|
|
914
|
-
y: (e, { transform: t }) =>
|
|
913
|
+
x: (e, { transform: t }) => je(t, "x"),
|
|
914
|
+
y: (e, { transform: t }) => je(t, "y")
|
|
915
915
|
};
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
const
|
|
919
|
-
let
|
|
920
|
-
function
|
|
921
|
-
if (
|
|
922
|
-
const e = Array.from(
|
|
916
|
+
H.translateX = H.x;
|
|
917
|
+
H.translateY = H.y;
|
|
918
|
+
const U = /* @__PURE__ */ new Set();
|
|
919
|
+
let Ge = !1, ze = !1, Ye = !1;
|
|
920
|
+
function _n() {
|
|
921
|
+
if (ze) {
|
|
922
|
+
const e = Array.from(U).filter((s) => s.needsMeasurement), t = new Set(e.map((s) => s.element)), n = /* @__PURE__ */ new Map();
|
|
923
923
|
t.forEach((s) => {
|
|
924
|
-
const r =
|
|
924
|
+
const r = Or(s);
|
|
925
925
|
r.length && (n.set(s, r), s.render());
|
|
926
926
|
}), e.forEach((s) => s.measureInitialState()), t.forEach((s) => {
|
|
927
927
|
s.render();
|
|
@@ -933,22 +933,22 @@ function Xn() {
|
|
|
933
933
|
s.suspendedScrollY !== void 0 && window.scrollTo(0, s.suspendedScrollY);
|
|
934
934
|
});
|
|
935
935
|
}
|
|
936
|
-
|
|
936
|
+
ze = !1, Ge = !1, U.forEach((e) => e.complete(Ye)), U.clear();
|
|
937
937
|
}
|
|
938
|
-
function
|
|
939
|
-
|
|
940
|
-
e.readKeyframes(), e.needsMeasurement && (
|
|
938
|
+
function jn() {
|
|
939
|
+
U.forEach((e) => {
|
|
940
|
+
e.readKeyframes(), e.needsMeasurement && (ze = !0);
|
|
941
941
|
});
|
|
942
942
|
}
|
|
943
|
-
function
|
|
944
|
-
|
|
943
|
+
function Pr() {
|
|
944
|
+
Ye = !0, jn(), _n(), Ye = !1;
|
|
945
945
|
}
|
|
946
|
-
class
|
|
946
|
+
class mt {
|
|
947
947
|
constructor(t, n, s, r, i, o = !1) {
|
|
948
948
|
this.state = "pending", this.isAsync = !1, this.needsMeasurement = !1, this.unresolvedKeyframes = [...t], this.onComplete = n, this.name = s, this.motionValue = r, this.element = i, this.isAsync = o;
|
|
949
949
|
}
|
|
950
950
|
scheduleResolve() {
|
|
951
|
-
this.state = "scheduled", this.isAsync ? (
|
|
951
|
+
this.state = "scheduled", this.isAsync ? (U.add(this), Ge || (Ge = !0, K.read(jn), K.resolveKeyframes(_n))) : (this.readKeyframes(), this.complete());
|
|
952
952
|
}
|
|
953
953
|
readKeyframes() {
|
|
954
954
|
const { unresolvedKeyframes: t, name: n, element: s, motionValue: r } = this;
|
|
@@ -962,7 +962,7 @@ class yt {
|
|
|
962
962
|
}
|
|
963
963
|
t[0] === void 0 && (t[0] = o), r && i === void 0 && r.set(t[0]);
|
|
964
964
|
}
|
|
965
|
-
|
|
965
|
+
Mr(t);
|
|
966
966
|
}
|
|
967
967
|
setFinalKeyframe() {
|
|
968
968
|
}
|
|
@@ -973,32 +973,32 @@ class yt {
|
|
|
973
973
|
measureEndState() {
|
|
974
974
|
}
|
|
975
975
|
complete(t = !1) {
|
|
976
|
-
this.state = "complete", this.onComplete(this.unresolvedKeyframes, this.finalKeyframe, t),
|
|
976
|
+
this.state = "complete", this.onComplete(this.unresolvedKeyframes, this.finalKeyframe, t), U.delete(this);
|
|
977
977
|
}
|
|
978
978
|
cancel() {
|
|
979
|
-
this.state === "scheduled" && (
|
|
979
|
+
this.state === "scheduled" && (U.delete(this), this.state = "pending");
|
|
980
980
|
}
|
|
981
981
|
resume() {
|
|
982
982
|
this.state === "pending" && this.scheduleResolve();
|
|
983
983
|
}
|
|
984
984
|
}
|
|
985
|
-
const
|
|
986
|
-
function
|
|
987
|
-
|
|
985
|
+
const Nr = (e) => e.startsWith("--");
|
|
986
|
+
function Rr(e, t, n) {
|
|
987
|
+
Nr(t) ? e.style.setProperty(t, n) : e.style[t] = n;
|
|
988
988
|
}
|
|
989
|
-
const
|
|
990
|
-
function
|
|
991
|
-
const n = /* @__PURE__ */
|
|
992
|
-
return () =>
|
|
989
|
+
const Kr = /* @__PURE__ */ tt(() => window.ScrollTimeline !== void 0), Br = {};
|
|
990
|
+
function $r(e, t) {
|
|
991
|
+
const n = /* @__PURE__ */ tt(e);
|
|
992
|
+
return () => Br[t] ?? n();
|
|
993
993
|
}
|
|
994
|
-
const
|
|
994
|
+
const Gn = /* @__PURE__ */ $r(() => {
|
|
995
995
|
try {
|
|
996
996
|
document.createElement("div").animate({ opacity: 0 }, { easing: "linear(0, 1)" });
|
|
997
997
|
} catch {
|
|
998
998
|
return !1;
|
|
999
999
|
}
|
|
1000
1000
|
return !0;
|
|
1001
|
-
}, "linearEasing"), oe = ([e, t, n, s]) => `cubic-bezier(${e}, ${t}, ${n}, ${s})`,
|
|
1001
|
+
}, "linearEasing"), oe = ([e, t, n, s]) => `cubic-bezier(${e}, ${t}, ${n}, ${s})`, Rt = {
|
|
1002
1002
|
linear: "linear",
|
|
1003
1003
|
ease: "ease",
|
|
1004
1004
|
easeIn: "ease-in",
|
|
@@ -1009,44 +1009,44 @@ const Jn = /* @__PURE__ */ jr(() => {
|
|
|
1009
1009
|
backIn: /* @__PURE__ */ oe([0.31, 0.01, 0.66, -0.59]),
|
|
1010
1010
|
backOut: /* @__PURE__ */ oe([0.33, 1.53, 0.69, 0.99])
|
|
1011
1011
|
};
|
|
1012
|
-
function
|
|
1012
|
+
function zn(e, t) {
|
|
1013
1013
|
if (e)
|
|
1014
|
-
return typeof e == "function" ?
|
|
1014
|
+
return typeof e == "function" ? Gn() ? Bn(e, t) : "ease-out" : kn(e) ? oe(e) : Array.isArray(e) ? e.map((n) => zn(n, t) || Rt.easeOut) : Rt[e];
|
|
1015
1015
|
}
|
|
1016
|
-
function
|
|
1017
|
-
const
|
|
1016
|
+
function qr(e, t, n, { delay: s = 0, duration: r = 300, repeat: i = 0, repeatType: o = "loop", ease: a = "easeOut", times: l } = {}, c = void 0) {
|
|
1017
|
+
const u = {
|
|
1018
1018
|
[t]: n
|
|
1019
1019
|
};
|
|
1020
|
-
l && (
|
|
1021
|
-
const
|
|
1022
|
-
Array.isArray(
|
|
1020
|
+
l && (u.offset = l);
|
|
1021
|
+
const f = zn(a, r);
|
|
1022
|
+
Array.isArray(f) && (u.easing = f);
|
|
1023
1023
|
const d = {
|
|
1024
1024
|
delay: s,
|
|
1025
1025
|
duration: r,
|
|
1026
|
-
easing: Array.isArray(
|
|
1026
|
+
easing: Array.isArray(f) ? "linear" : f,
|
|
1027
1027
|
fill: "both",
|
|
1028
1028
|
iterations: i + 1,
|
|
1029
1029
|
direction: o === "reverse" ? "alternate" : "normal"
|
|
1030
1030
|
};
|
|
1031
|
-
return
|
|
1031
|
+
return c && (d.pseudoElement = c), e.animate(u, d);
|
|
1032
1032
|
}
|
|
1033
|
-
function
|
|
1033
|
+
function pt(e) {
|
|
1034
1034
|
return typeof e == "function" && "applyToOptions" in e;
|
|
1035
1035
|
}
|
|
1036
|
-
function
|
|
1037
|
-
return
|
|
1036
|
+
function Wr({ type: e, ...t }) {
|
|
1037
|
+
return pt(e) && Gn() ? e.applyToOptions(t) : (t.duration ?? (t.duration = 300), t.ease ?? (t.ease = "easeOut"), t);
|
|
1038
1038
|
}
|
|
1039
|
-
class
|
|
1039
|
+
class Hr extends dt {
|
|
1040
1040
|
constructor(t) {
|
|
1041
1041
|
if (super(), this.finishedTime = null, this.isStopped = !1, !t)
|
|
1042
1042
|
return;
|
|
1043
1043
|
const { element: n, name: s, keyframes: r, pseudoElement: i, allowFlatten: o = !1, finalKeyframe: a, onComplete: l } = t;
|
|
1044
|
-
this.isPseudoElement = !!i, this.allowFlatten = o, this.options = t,
|
|
1045
|
-
const
|
|
1046
|
-
this.animation =
|
|
1044
|
+
this.isPseudoElement = !!i, this.allowFlatten = o, this.options = t, et(typeof t.type != "string");
|
|
1045
|
+
const c = Wr(t);
|
|
1046
|
+
this.animation = qr(n, s, r, c, i), c.autoplay === !1 && this.animation.pause(), this.animation.onfinish = () => {
|
|
1047
1047
|
if (this.finishedTime = this.time, !i) {
|
|
1048
|
-
const
|
|
1049
|
-
this.updateMotionValue ? this.updateMotionValue(
|
|
1048
|
+
const u = ft(r, this.options, a, this.speed);
|
|
1049
|
+
this.updateMotionValue ? this.updateMotionValue(u) : Rr(n, s, u), this.animation.cancel();
|
|
1050
1050
|
}
|
|
1051
1051
|
l?.(), this.notifyFinished();
|
|
1052
1052
|
};
|
|
@@ -1090,17 +1090,17 @@ class Yr extends pt {
|
|
|
1090
1090
|
}
|
|
1091
1091
|
get duration() {
|
|
1092
1092
|
const t = this.animation.effect?.getComputedTiming?.().duration || 0;
|
|
1093
|
-
return /* @__PURE__ */
|
|
1093
|
+
return /* @__PURE__ */ I(Number(t));
|
|
1094
1094
|
}
|
|
1095
1095
|
get iterationDuration() {
|
|
1096
1096
|
const { delay: t = 0 } = this.options || {};
|
|
1097
|
-
return this.duration + /* @__PURE__ */
|
|
1097
|
+
return this.duration + /* @__PURE__ */ I(t);
|
|
1098
1098
|
}
|
|
1099
1099
|
get time() {
|
|
1100
|
-
return /* @__PURE__ */
|
|
1100
|
+
return /* @__PURE__ */ I(Number(this.animation.currentTime) || 0);
|
|
1101
1101
|
}
|
|
1102
1102
|
set time(t) {
|
|
1103
|
-
this.finishedTime = null, this.animation.currentTime = /* @__PURE__ */
|
|
1103
|
+
this.finishedTime = null, this.animation.currentTime = /* @__PURE__ */ P(t);
|
|
1104
1104
|
}
|
|
1105
1105
|
/**
|
|
1106
1106
|
* The playback speed of the animation.
|
|
@@ -1125,24 +1125,24 @@ class Yr extends pt {
|
|
|
1125
1125
|
* Attaches a timeline to the animation, for instance the `ScrollTimeline`.
|
|
1126
1126
|
*/
|
|
1127
1127
|
attachTimeline({ timeline: t, observe: n }) {
|
|
1128
|
-
return this.allowFlatten && this.animation.effect?.updateTiming({ easing: "linear" }), this.animation.onfinish = null, t &&
|
|
1128
|
+
return this.allowFlatten && this.animation.effect?.updateTiming({ easing: "linear" }), this.animation.onfinish = null, t && Kr() ? (this.animation.timeline = t, Z) : n(this);
|
|
1129
1129
|
}
|
|
1130
1130
|
}
|
|
1131
|
-
const
|
|
1132
|
-
anticipate:
|
|
1133
|
-
backInOut:
|
|
1134
|
-
circInOut:
|
|
1131
|
+
const Yn = {
|
|
1132
|
+
anticipate: Sn,
|
|
1133
|
+
backInOut: vn,
|
|
1134
|
+
circInOut: xn
|
|
1135
1135
|
};
|
|
1136
|
-
function
|
|
1137
|
-
return e in
|
|
1136
|
+
function Ur(e) {
|
|
1137
|
+
return e in Yn;
|
|
1138
1138
|
}
|
|
1139
|
-
function
|
|
1140
|
-
typeof e.ease == "string" &&
|
|
1139
|
+
function _r(e) {
|
|
1140
|
+
typeof e.ease == "string" && Ur(e.ease) && (e.ease = Yn[e.ease]);
|
|
1141
1141
|
}
|
|
1142
|
-
const
|
|
1143
|
-
class
|
|
1142
|
+
const Kt = 10;
|
|
1143
|
+
class jr extends Hr {
|
|
1144
1144
|
constructor(t) {
|
|
1145
|
-
|
|
1145
|
+
_r(t), Un(t), super(t), t.startTime && (this.startTime = t.startTime), this.options = t;
|
|
1146
1146
|
}
|
|
1147
1147
|
/**
|
|
1148
1148
|
* WAAPI doesn't natively have any interruption capabilities.
|
|
@@ -1160,17 +1160,17 @@ class Jr extends Yr {
|
|
|
1160
1160
|
n.set(t);
|
|
1161
1161
|
return;
|
|
1162
1162
|
}
|
|
1163
|
-
const a = new
|
|
1163
|
+
const a = new ht({
|
|
1164
1164
|
...o,
|
|
1165
1165
|
autoplay: !1
|
|
1166
|
-
}), l = /* @__PURE__ */
|
|
1167
|
-
n.setWithVelocity(a.sample(l -
|
|
1166
|
+
}), l = /* @__PURE__ */ P(this.finishedTime ?? this.time);
|
|
1167
|
+
n.setWithVelocity(a.sample(l - Kt).value, a.sample(l).value, Kt), a.stop();
|
|
1168
1168
|
}
|
|
1169
1169
|
}
|
|
1170
|
-
const
|
|
1170
|
+
const Bt = (e, t) => t === "zIndex" ? !1 : !!(typeof e == "number" || Array.isArray(e) || typeof e == "string" && // It's animatable if we have a string
|
|
1171
1171
|
(Q.test(e) || e === "0") && // And it contains numbers and/or colors
|
|
1172
1172
|
!e.startsWith("url("));
|
|
1173
|
-
function
|
|
1173
|
+
function Gr(e) {
|
|
1174
1174
|
const t = e[0];
|
|
1175
1175
|
if (e.length === 1)
|
|
1176
1176
|
return !0;
|
|
@@ -1178,43 +1178,43 @@ function Qr(e) {
|
|
|
1178
1178
|
if (e[n] !== t)
|
|
1179
1179
|
return !0;
|
|
1180
1180
|
}
|
|
1181
|
-
function
|
|
1181
|
+
function zr(e, t, n, s) {
|
|
1182
1182
|
const r = e[0];
|
|
1183
1183
|
if (r === null)
|
|
1184
1184
|
return !1;
|
|
1185
1185
|
if (t === "display" || t === "visibility")
|
|
1186
1186
|
return !0;
|
|
1187
|
-
const i = e[e.length - 1], o =
|
|
1188
|
-
return !o || !a ? !1 :
|
|
1187
|
+
const i = e[e.length - 1], o = Bt(r, t), a = Bt(i, t);
|
|
1188
|
+
return !o || !a ? !1 : Gr(e) || (n === "spring" || pt(n)) && s;
|
|
1189
1189
|
}
|
|
1190
|
-
function
|
|
1190
|
+
function Xe(e) {
|
|
1191
1191
|
e.duration = 0, e.type = "keyframes";
|
|
1192
1192
|
}
|
|
1193
|
-
const
|
|
1193
|
+
const Yr = /* @__PURE__ */ new Set([
|
|
1194
1194
|
"opacity",
|
|
1195
1195
|
"clipPath",
|
|
1196
1196
|
"filter",
|
|
1197
1197
|
"transform"
|
|
1198
1198
|
// TODO: Could be re-enabled now we have support for linear() easing
|
|
1199
1199
|
// "background-color"
|
|
1200
|
-
]),
|
|
1201
|
-
function
|
|
1200
|
+
]), Xr = /* @__PURE__ */ tt(() => Object.hasOwnProperty.call(Element.prototype, "animate"));
|
|
1201
|
+
function Zr(e) {
|
|
1202
1202
|
const { motionValue: t, name: n, repeatDelay: s, repeatType: r, damping: i, type: o } = e;
|
|
1203
1203
|
if (!(t?.owner?.current instanceof HTMLElement))
|
|
1204
1204
|
return !1;
|
|
1205
|
-
const { onUpdate: l, transformTemplate:
|
|
1206
|
-
return
|
|
1205
|
+
const { onUpdate: l, transformTemplate: c } = t.owner.getProps();
|
|
1206
|
+
return Xr() && n && Yr.has(n) && (n !== "transform" || !c) && /**
|
|
1207
1207
|
* If we're outputting values to onUpdate then we can't use WAAPI as there's
|
|
1208
1208
|
* no way to read the value from WAAPI every frame.
|
|
1209
1209
|
*/
|
|
1210
1210
|
!l && !s && r !== "mirror" && i !== 0 && o !== "inertia";
|
|
1211
1211
|
}
|
|
1212
|
-
const
|
|
1213
|
-
class
|
|
1214
|
-
constructor({ autoplay: t = !0, delay: n = 0, type: s = "keyframes", repeat: r = 0, repeatDelay: i = 0, repeatType: o = "loop", keyframes: a, name: l, motionValue:
|
|
1212
|
+
const Jr = 40;
|
|
1213
|
+
class Qr extends dt {
|
|
1214
|
+
constructor({ autoplay: t = !0, delay: n = 0, type: s = "keyframes", repeat: r = 0, repeatDelay: i = 0, repeatType: o = "loop", keyframes: a, name: l, motionValue: c, element: u, ...f }) {
|
|
1215
1215
|
super(), this.stop = () => {
|
|
1216
1216
|
this._animation && (this._animation.stop(), this.stopTimeline?.()), this.keyframeResolver?.cancel();
|
|
1217
|
-
}, this.createdAt =
|
|
1217
|
+
}, this.createdAt = F.now();
|
|
1218
1218
|
const d = {
|
|
1219
1219
|
autoplay: t,
|
|
1220
1220
|
delay: n,
|
|
@@ -1223,25 +1223,25 @@ class ii extends pt {
|
|
|
1223
1223
|
repeatDelay: i,
|
|
1224
1224
|
repeatType: o,
|
|
1225
1225
|
name: l,
|
|
1226
|
-
motionValue:
|
|
1227
|
-
element:
|
|
1228
|
-
...
|
|
1229
|
-
}, h =
|
|
1230
|
-
this.keyframeResolver = new h(a, (m, y, T) => this.onKeyframesResolved(m, y, d, !T), l,
|
|
1226
|
+
motionValue: c,
|
|
1227
|
+
element: u,
|
|
1228
|
+
...f
|
|
1229
|
+
}, h = u?.KeyframeResolver || mt;
|
|
1230
|
+
this.keyframeResolver = new h(a, (m, y, T) => this.onKeyframesResolved(m, y, d, !T), l, c, u), this.keyframeResolver?.scheduleResolve();
|
|
1231
1231
|
}
|
|
1232
1232
|
onKeyframesResolved(t, n, s, r) {
|
|
1233
1233
|
this.keyframeResolver = void 0;
|
|
1234
|
-
const { name: i, type: o, velocity: a, delay: l, isHandoff:
|
|
1235
|
-
this.resolvedAt =
|
|
1234
|
+
const { name: i, type: o, velocity: a, delay: l, isHandoff: c, onUpdate: u } = s;
|
|
1235
|
+
this.resolvedAt = F.now(), zr(t, i, o, a) || ((R.instantAnimations || !l) && u?.(ft(t, s, n)), t[0] = t[t.length - 1], Xe(s), s.repeat = 0);
|
|
1236
1236
|
const d = {
|
|
1237
|
-
startTime: r ? this.resolvedAt ? this.resolvedAt - this.createdAt >
|
|
1237
|
+
startTime: r ? this.resolvedAt ? this.resolvedAt - this.createdAt > Jr ? this.resolvedAt : this.createdAt : this.createdAt : void 0,
|
|
1238
1238
|
finalKeyframe: n,
|
|
1239
1239
|
...s,
|
|
1240
1240
|
keyframes: t
|
|
1241
|
-
}, h = !
|
|
1241
|
+
}, h = !c && Zr(d) ? new jr({
|
|
1242
1242
|
...d,
|
|
1243
1243
|
element: d.motionValue.owner.current
|
|
1244
|
-
}) : new
|
|
1244
|
+
}) : new ht(d);
|
|
1245
1245
|
h.finished.then(() => this.notifyFinished()).catch(Z), this.pendingTimeline && (this.stopTimeline = h.attachTimeline(this.pendingTimeline), this.pendingTimeline = void 0), this._animation = h;
|
|
1246
1246
|
}
|
|
1247
1247
|
get finished() {
|
|
@@ -1252,7 +1252,7 @@ class ii extends pt {
|
|
|
1252
1252
|
});
|
|
1253
1253
|
}
|
|
1254
1254
|
get animation() {
|
|
1255
|
-
return this._animation || (this.keyframeResolver?.resume(),
|
|
1255
|
+
return this._animation || (this.keyframeResolver?.resume(), Pr()), this._animation;
|
|
1256
1256
|
}
|
|
1257
1257
|
get duration() {
|
|
1258
1258
|
return this.animation.duration;
|
|
@@ -1294,7 +1294,7 @@ class ii extends pt {
|
|
|
1294
1294
|
this._animation && this.animation.cancel(), this.keyframeResolver?.cancel();
|
|
1295
1295
|
}
|
|
1296
1296
|
}
|
|
1297
|
-
class
|
|
1297
|
+
class ei {
|
|
1298
1298
|
constructor(t) {
|
|
1299
1299
|
this.stop = () => this.runAll("stop"), this.animations = t.filter(Boolean);
|
|
1300
1300
|
}
|
|
@@ -1338,10 +1338,10 @@ class oi {
|
|
|
1338
1338
|
return this.getAll("startTime");
|
|
1339
1339
|
}
|
|
1340
1340
|
get duration() {
|
|
1341
|
-
return
|
|
1341
|
+
return $t(this.animations, "duration");
|
|
1342
1342
|
}
|
|
1343
1343
|
get iterationDuration() {
|
|
1344
|
-
return
|
|
1344
|
+
return $t(this.animations, "iterationDuration");
|
|
1345
1345
|
}
|
|
1346
1346
|
runAll(t) {
|
|
1347
1347
|
this.animations.forEach((n) => n[t]());
|
|
@@ -1359,7 +1359,7 @@ class oi {
|
|
|
1359
1359
|
this.runAll("complete");
|
|
1360
1360
|
}
|
|
1361
1361
|
}
|
|
1362
|
-
function
|
|
1362
|
+
function $t(e, t) {
|
|
1363
1363
|
let n = 0;
|
|
1364
1364
|
for (let s = 0; s < e.length; s++) {
|
|
1365
1365
|
const r = e[s][t];
|
|
@@ -1367,38 +1367,38 @@ function Wt(e, t) {
|
|
|
1367
1367
|
}
|
|
1368
1368
|
return n;
|
|
1369
1369
|
}
|
|
1370
|
-
class
|
|
1370
|
+
class ti extends ei {
|
|
1371
1371
|
then(t, n) {
|
|
1372
1372
|
return this.finished.finally(t).then(() => {
|
|
1373
1373
|
});
|
|
1374
1374
|
}
|
|
1375
1375
|
}
|
|
1376
|
-
const
|
|
1376
|
+
const ni = (
|
|
1377
1377
|
// eslint-disable-next-line redos-detector/no-unsafe-regex -- false positive, as it can match a lot of words
|
|
1378
1378
|
/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u
|
|
1379
1379
|
);
|
|
1380
|
-
function
|
|
1381
|
-
const t =
|
|
1380
|
+
function si(e) {
|
|
1381
|
+
const t = ni.exec(e);
|
|
1382
1382
|
if (!t)
|
|
1383
1383
|
return [,];
|
|
1384
1384
|
const [, n, s, r] = t;
|
|
1385
1385
|
return [`--${n ?? s}`, r];
|
|
1386
1386
|
}
|
|
1387
|
-
function
|
|
1388
|
-
const [s, r] =
|
|
1387
|
+
function Xn(e, t, n = 1) {
|
|
1388
|
+
const [s, r] = si(e);
|
|
1389
1389
|
if (!s)
|
|
1390
1390
|
return;
|
|
1391
1391
|
const i = window.getComputedStyle(t).getPropertyValue(s);
|
|
1392
1392
|
if (i) {
|
|
1393
1393
|
const o = i.trim();
|
|
1394
|
-
return
|
|
1394
|
+
return mn(o) ? parseFloat(o) : o;
|
|
1395
1395
|
}
|
|
1396
|
-
return
|
|
1396
|
+
return ot(r) ? Xn(r, t, n + 1) : r;
|
|
1397
1397
|
}
|
|
1398
|
-
function
|
|
1398
|
+
function Zn(e, t) {
|
|
1399
1399
|
return e?.[t] ?? e?.default ?? e;
|
|
1400
1400
|
}
|
|
1401
|
-
const
|
|
1401
|
+
const Jn = /* @__PURE__ */ new Set([
|
|
1402
1402
|
"width",
|
|
1403
1403
|
"height",
|
|
1404
1404
|
"top",
|
|
@@ -1406,46 +1406,46 @@ const ss = /* @__PURE__ */ new Set([
|
|
|
1406
1406
|
"right",
|
|
1407
1407
|
"bottom",
|
|
1408
1408
|
...ee
|
|
1409
|
-
]),
|
|
1409
|
+
]), ri = {
|
|
1410
1410
|
test: (e) => e === "auto",
|
|
1411
1411
|
parse: (e) => e
|
|
1412
|
-
},
|
|
1413
|
-
function
|
|
1414
|
-
return typeof e == "number" ? e === 0 : e !== null ? e === "none" || e === "0" ||
|
|
1412
|
+
}, Qn = (e) => (t) => t.test(e), es = [J, p, z, $, Xs, Ys, ri], qt = (e) => es.find(Qn(e));
|
|
1413
|
+
function ii(e) {
|
|
1414
|
+
return typeof e == "number" ? e === 0 : e !== null ? e === "none" || e === "0" || pn(e) : !0;
|
|
1415
1415
|
}
|
|
1416
|
-
const
|
|
1417
|
-
function
|
|
1416
|
+
const oi = /* @__PURE__ */ new Set(["brightness", "contrast", "saturate", "opacity"]);
|
|
1417
|
+
function ai(e) {
|
|
1418
1418
|
const [t, n] = e.slice(0, -1).split("(");
|
|
1419
1419
|
if (t === "drop-shadow")
|
|
1420
1420
|
return e;
|
|
1421
|
-
const [s] = n.match(
|
|
1421
|
+
const [s] = n.match(at) || [];
|
|
1422
1422
|
if (!s)
|
|
1423
1423
|
return e;
|
|
1424
1424
|
const r = n.replace(s, "");
|
|
1425
|
-
let i =
|
|
1425
|
+
let i = oi.has(t) ? 1 : 0;
|
|
1426
1426
|
return s !== n && (i *= 100), t + "(" + i + r + ")";
|
|
1427
1427
|
}
|
|
1428
|
-
const
|
|
1428
|
+
const li = /\b([a-z-]*)\(.*?\)/gu, Ze = {
|
|
1429
1429
|
...Q,
|
|
1430
1430
|
getAnimatableNone: (e) => {
|
|
1431
|
-
const t = e.match(
|
|
1432
|
-
return t ? t.map(
|
|
1431
|
+
const t = e.match(li);
|
|
1432
|
+
return t ? t.map(ai).join(" ") : e;
|
|
1433
1433
|
}
|
|
1434
|
-
},
|
|
1434
|
+
}, Wt = {
|
|
1435
1435
|
...J,
|
|
1436
1436
|
transform: Math.round
|
|
1437
|
-
},
|
|
1438
|
-
rotate:
|
|
1439
|
-
rotateX:
|
|
1440
|
-
rotateY:
|
|
1441
|
-
rotateZ:
|
|
1437
|
+
}, ui = {
|
|
1438
|
+
rotate: $,
|
|
1439
|
+
rotateX: $,
|
|
1440
|
+
rotateY: $,
|
|
1441
|
+
rotateZ: $,
|
|
1442
1442
|
scale: Te,
|
|
1443
1443
|
scaleX: Te,
|
|
1444
1444
|
scaleY: Te,
|
|
1445
1445
|
scaleZ: Te,
|
|
1446
|
-
skew:
|
|
1447
|
-
skewX:
|
|
1448
|
-
skewY:
|
|
1446
|
+
skew: $,
|
|
1447
|
+
skewX: $,
|
|
1448
|
+
skewY: $,
|
|
1449
1449
|
distance: p,
|
|
1450
1450
|
translateX: p,
|
|
1451
1451
|
translateY: p,
|
|
@@ -1455,11 +1455,11 @@ const mi = /\b([a-z-]*)\(.*?\)/gu, et = {
|
|
|
1455
1455
|
z: p,
|
|
1456
1456
|
perspective: p,
|
|
1457
1457
|
transformPerspective: p,
|
|
1458
|
-
opacity:
|
|
1459
|
-
originX:
|
|
1460
|
-
originY:
|
|
1458
|
+
opacity: ue,
|
|
1459
|
+
originX: kt,
|
|
1460
|
+
originY: kt,
|
|
1461
1461
|
originZ: p
|
|
1462
|
-
},
|
|
1462
|
+
}, gt = {
|
|
1463
1463
|
// Border props
|
|
1464
1464
|
borderWidth: p,
|
|
1465
1465
|
borderTopWidth: p,
|
|
@@ -1495,14 +1495,14 @@ const mi = /\b([a-z-]*)\(.*?\)/gu, et = {
|
|
|
1495
1495
|
// Misc
|
|
1496
1496
|
backgroundPositionX: p,
|
|
1497
1497
|
backgroundPositionY: p,
|
|
1498
|
-
...
|
|
1499
|
-
zIndex:
|
|
1498
|
+
...ui,
|
|
1499
|
+
zIndex: Wt,
|
|
1500
1500
|
// SVG
|
|
1501
|
-
fillOpacity:
|
|
1502
|
-
strokeOpacity:
|
|
1503
|
-
numOctaves:
|
|
1504
|
-
},
|
|
1505
|
-
...
|
|
1501
|
+
fillOpacity: ue,
|
|
1502
|
+
strokeOpacity: ue,
|
|
1503
|
+
numOctaves: Wt
|
|
1504
|
+
}, ci = {
|
|
1505
|
+
...gt,
|
|
1506
1506
|
// Color props
|
|
1507
1507
|
color: k,
|
|
1508
1508
|
backgroundColor: k,
|
|
@@ -1515,25 +1515,25 @@ const mi = /\b([a-z-]*)\(.*?\)/gu, et = {
|
|
|
1515
1515
|
borderRightColor: k,
|
|
1516
1516
|
borderBottomColor: k,
|
|
1517
1517
|
borderLeftColor: k,
|
|
1518
|
-
filter:
|
|
1519
|
-
WebkitFilter:
|
|
1520
|
-
},
|
|
1521
|
-
function
|
|
1522
|
-
let n =
|
|
1523
|
-
return n !==
|
|
1524
|
-
}
|
|
1525
|
-
const
|
|
1526
|
-
function
|
|
1518
|
+
filter: Ze,
|
|
1519
|
+
WebkitFilter: Ze
|
|
1520
|
+
}, ts = (e) => ci[e];
|
|
1521
|
+
function ns(e, t) {
|
|
1522
|
+
let n = ts(e);
|
|
1523
|
+
return n !== Ze && (n = Q), n.getAnimatableNone ? n.getAnimatableNone(t) : void 0;
|
|
1524
|
+
}
|
|
1525
|
+
const fi = /* @__PURE__ */ new Set(["auto", "none", "0"]);
|
|
1526
|
+
function di(e, t, n) {
|
|
1527
1527
|
let s = 0, r;
|
|
1528
1528
|
for (; s < e.length && !r; ) {
|
|
1529
1529
|
const i = e[s];
|
|
1530
|
-
typeof i == "string" && !
|
|
1530
|
+
typeof i == "string" && !fi.has(i) && ce(i).values.length && (r = e[s]), s++;
|
|
1531
1531
|
}
|
|
1532
1532
|
if (r && n)
|
|
1533
1533
|
for (const i of t)
|
|
1534
|
-
e[i] =
|
|
1534
|
+
e[i] = ns(n, r);
|
|
1535
1535
|
}
|
|
1536
|
-
class
|
|
1536
|
+
class hi extends mt {
|
|
1537
1537
|
constructor(t, n, s, r, i) {
|
|
1538
1538
|
super(t, n, s, r, i, !0);
|
|
1539
1539
|
}
|
|
@@ -1543,34 +1543,34 @@ class wi extends yt {
|
|
|
1543
1543
|
return;
|
|
1544
1544
|
super.readKeyframes();
|
|
1545
1545
|
for (let l = 0; l < t.length; l++) {
|
|
1546
|
-
let
|
|
1547
|
-
if (typeof
|
|
1548
|
-
const
|
|
1549
|
-
|
|
1546
|
+
let c = t[l];
|
|
1547
|
+
if (typeof c == "string" && (c = c.trim(), ot(c))) {
|
|
1548
|
+
const u = Xn(c, n.current);
|
|
1549
|
+
u !== void 0 && (t[l] = u), l === t.length - 1 && (this.finalKeyframe = c);
|
|
1550
1550
|
}
|
|
1551
1551
|
}
|
|
1552
|
-
if (this.resolveNoneKeyframes(), !
|
|
1552
|
+
if (this.resolveNoneKeyframes(), !Jn.has(s) || t.length !== 2)
|
|
1553
1553
|
return;
|
|
1554
|
-
const [r, i] = t, o =
|
|
1554
|
+
const [r, i] = t, o = qt(r), a = qt(i);
|
|
1555
1555
|
if (o !== a)
|
|
1556
|
-
if (
|
|
1556
|
+
if (Nt(o) && Nt(a))
|
|
1557
1557
|
for (let l = 0; l < t.length; l++) {
|
|
1558
|
-
const
|
|
1559
|
-
typeof
|
|
1558
|
+
const c = t[l];
|
|
1559
|
+
typeof c == "string" && (t[l] = parseFloat(c));
|
|
1560
1560
|
}
|
|
1561
|
-
else
|
|
1561
|
+
else H[s] && (this.needsMeasurement = !0);
|
|
1562
1562
|
}
|
|
1563
1563
|
resolveNoneKeyframes() {
|
|
1564
1564
|
const { unresolvedKeyframes: t, name: n } = this, s = [];
|
|
1565
1565
|
for (let r = 0; r < t.length; r++)
|
|
1566
|
-
(t[r] === null ||
|
|
1567
|
-
s.length &&
|
|
1566
|
+
(t[r] === null || ii(t[r])) && s.push(r);
|
|
1567
|
+
s.length && di(t, s, n);
|
|
1568
1568
|
}
|
|
1569
1569
|
measureInitialState() {
|
|
1570
1570
|
const { element: t, unresolvedKeyframes: n, name: s } = this;
|
|
1571
1571
|
if (!t || !t.current)
|
|
1572
1572
|
return;
|
|
1573
|
-
s === "height" && (this.suspendedScrollY = window.pageYOffset), this.measuredOrigin =
|
|
1573
|
+
s === "height" && (this.suspendedScrollY = window.pageYOffset), this.measuredOrigin = H[s](t.measureViewportBox(), window.getComputedStyle(t.current)), n[0] = this.measuredOrigin;
|
|
1574
1574
|
const r = n[n.length - 1];
|
|
1575
1575
|
r !== void 0 && t.getValue(s, r).jump(r, !1);
|
|
1576
1576
|
}
|
|
@@ -1581,12 +1581,12 @@ class wi extends yt {
|
|
|
1581
1581
|
const r = t.getValue(n);
|
|
1582
1582
|
r && r.jump(this.measuredOrigin, !1);
|
|
1583
1583
|
const i = s.length - 1, o = s[i];
|
|
1584
|
-
s[i] =
|
|
1584
|
+
s[i] = H[n](t.measureViewportBox(), window.getComputedStyle(t.current)), o !== null && this.finalKeyframe === void 0 && (this.finalKeyframe = o), this.removedTransforms?.length && this.removedTransforms.forEach(([a, l]) => {
|
|
1585
1585
|
t.getValue(a).set(l);
|
|
1586
1586
|
}), this.resolveNoneKeyframes();
|
|
1587
1587
|
}
|
|
1588
1588
|
}
|
|
1589
|
-
function
|
|
1589
|
+
function mi(e, t, n) {
|
|
1590
1590
|
if (e instanceof EventTarget)
|
|
1591
1591
|
return [e];
|
|
1592
1592
|
if (typeof e == "string") {
|
|
@@ -1596,8 +1596,8 @@ function Ti(e, t, n) {
|
|
|
1596
1596
|
}
|
|
1597
1597
|
return Array.from(e);
|
|
1598
1598
|
}
|
|
1599
|
-
const
|
|
1600
|
-
class
|
|
1599
|
+
const ss = (e, t) => t && typeof e == "number" ? t.transform(e) : e, Ht = 30, pi = (e) => !isNaN(parseFloat(e));
|
|
1600
|
+
class gi {
|
|
1601
1601
|
/**
|
|
1602
1602
|
* @param init - The initiating value
|
|
1603
1603
|
* @param config - Optional configuration options
|
|
@@ -1606,14 +1606,14 @@ class Ai {
|
|
|
1606
1606
|
*/
|
|
1607
1607
|
constructor(t, n = {}) {
|
|
1608
1608
|
this.canTrackVelocity = null, this.events = {}, this.updateAndNotify = (s) => {
|
|
1609
|
-
const r =
|
|
1609
|
+
const r = F.now();
|
|
1610
1610
|
if (this.updatedAt !== r && this.setPrevFrameValue(), this.prev = this.current, this.setCurrent(s), this.current !== this.prev && (this.events.change?.notify(this.current), this.dependents))
|
|
1611
1611
|
for (const i of this.dependents)
|
|
1612
1612
|
i.dirty();
|
|
1613
1613
|
}, this.hasAnimated = !1, this.setCurrent(t), this.owner = n.owner;
|
|
1614
1614
|
}
|
|
1615
1615
|
setCurrent(t) {
|
|
1616
|
-
this.current = t, this.updatedAt =
|
|
1616
|
+
this.current = t, this.updatedAt = F.now(), this.canTrackVelocity === null && t !== void 0 && (this.canTrackVelocity = pi(this.current));
|
|
1617
1617
|
}
|
|
1618
1618
|
setPrevFrameValue(t = this.current) {
|
|
1619
1619
|
this.prevFrameValue = t, this.prevUpdatedAt = this.updatedAt;
|
|
@@ -1662,7 +1662,7 @@ class Ai {
|
|
|
1662
1662
|
return this.on("change", t);
|
|
1663
1663
|
}
|
|
1664
1664
|
on(t, n) {
|
|
1665
|
-
this.events[t] || (this.events[t] = new
|
|
1665
|
+
this.events[t] || (this.events[t] = new gn());
|
|
1666
1666
|
const s = this.events[t].add(n);
|
|
1667
1667
|
return t === "change" ? () => {
|
|
1668
1668
|
s(), K.read(() => {
|
|
@@ -1741,11 +1741,11 @@ class Ai {
|
|
|
1741
1741
|
* @public
|
|
1742
1742
|
*/
|
|
1743
1743
|
getVelocity() {
|
|
1744
|
-
const t =
|
|
1745
|
-
if (!this.canTrackVelocity || this.prevFrameValue === void 0 || t - this.updatedAt >
|
|
1744
|
+
const t = F.now();
|
|
1745
|
+
if (!this.canTrackVelocity || this.prevFrameValue === void 0 || t - this.updatedAt > Ht)
|
|
1746
1746
|
return 0;
|
|
1747
|
-
const n = Math.min(this.updatedAt - this.prevUpdatedAt,
|
|
1748
|
-
return
|
|
1747
|
+
const n = Math.min(this.updatedAt - this.prevUpdatedAt, Ht);
|
|
1748
|
+
return yn(parseFloat(this.current) - parseFloat(this.prevFrameValue), n);
|
|
1749
1749
|
}
|
|
1750
1750
|
/**
|
|
1751
1751
|
* Registers a new animation to control this `MotionValue`. Only one
|
|
@@ -1797,124 +1797,124 @@ class Ai {
|
|
|
1797
1797
|
}
|
|
1798
1798
|
}
|
|
1799
1799
|
function fe(e, t) {
|
|
1800
|
-
return new
|
|
1800
|
+
return new gi(e, t);
|
|
1801
1801
|
}
|
|
1802
|
-
const { schedule:
|
|
1803
|
-
function
|
|
1804
|
-
return
|
|
1802
|
+
const { schedule: yi } = /* @__PURE__ */ Cn(queueMicrotask, !1);
|
|
1803
|
+
function rs(e) {
|
|
1804
|
+
return Cs(e) && "ownerSVGElement" in e;
|
|
1805
1805
|
}
|
|
1806
|
-
function
|
|
1807
|
-
return
|
|
1806
|
+
function bi(e) {
|
|
1807
|
+
return rs(e) && e.tagName === "svg";
|
|
1808
1808
|
}
|
|
1809
|
-
const C = (e) => !!(e && e.getVelocity),
|
|
1810
|
-
function
|
|
1809
|
+
const C = (e) => !!(e && e.getVelocity), wi = [...es, k, Q], Ti = (e) => wi.find(Qn(e));
|
|
1810
|
+
function yt(e) {
|
|
1811
1811
|
return typeof e == "object" && !Array.isArray(e);
|
|
1812
1812
|
}
|
|
1813
|
-
function
|
|
1814
|
-
return typeof e == "string" &&
|
|
1813
|
+
function is(e, t, n, s) {
|
|
1814
|
+
return typeof e == "string" && yt(t) ? mi(e, n, s) : e instanceof NodeList ? Array.from(e) : Array.isArray(e) ? e : [e];
|
|
1815
1815
|
}
|
|
1816
|
-
function
|
|
1816
|
+
function Ai(e, t, n) {
|
|
1817
1817
|
return e * (t + 1);
|
|
1818
1818
|
}
|
|
1819
|
-
function
|
|
1819
|
+
function Ut(e, t, n, s) {
|
|
1820
1820
|
return typeof t == "number" ? t : t.startsWith("-") || t.startsWith("+") ? Math.max(0, e + parseFloat(t)) : t === "<" ? n : t.startsWith("<") ? Math.max(0, n + parseFloat(t.slice(1))) : s.get(t) ?? e;
|
|
1821
1821
|
}
|
|
1822
|
-
function
|
|
1822
|
+
function vi(e, t, n) {
|
|
1823
1823
|
for (let s = 0; s < e.length; s++) {
|
|
1824
1824
|
const r = e[s];
|
|
1825
|
-
r.at > t && r.at < n && (
|
|
1825
|
+
r.at > t && r.at < n && (hn(e, r), s--);
|
|
1826
1826
|
}
|
|
1827
1827
|
}
|
|
1828
|
-
function
|
|
1829
|
-
|
|
1828
|
+
function Si(e, t, n, s, r, i) {
|
|
1829
|
+
vi(e, r, i);
|
|
1830
1830
|
for (let o = 0; o < t.length; o++)
|
|
1831
1831
|
e.push({
|
|
1832
1832
|
value: t[o],
|
|
1833
1833
|
at: pe(r, i, s[o]),
|
|
1834
|
-
easing:
|
|
1834
|
+
easing: Mn(n, o)
|
|
1835
1835
|
});
|
|
1836
1836
|
}
|
|
1837
|
-
function
|
|
1837
|
+
function xi(e, t) {
|
|
1838
1838
|
for (let n = 0; n < e.length; n++)
|
|
1839
1839
|
e[n] = e[n] / (t + 1);
|
|
1840
1840
|
}
|
|
1841
|
-
function
|
|
1841
|
+
function Ei(e, t) {
|
|
1842
1842
|
return e.at === t.at ? e.value === null ? 1 : t.value === null ? -1 : 0 : e.at - t.at;
|
|
1843
1843
|
}
|
|
1844
|
-
const
|
|
1845
|
-
function
|
|
1846
|
-
const i = t.duration || 0.3, o = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), l = {},
|
|
1847
|
-
let
|
|
1844
|
+
const Vi = "easeInOut";
|
|
1845
|
+
function Mi(e, { defaultTransition: t = {}, ...n } = {}, s, r) {
|
|
1846
|
+
const i = t.duration || 0.3, o = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), l = {}, c = /* @__PURE__ */ new Map();
|
|
1847
|
+
let u = 0, f = 0, d = 0;
|
|
1848
1848
|
for (let h = 0; h < e.length; h++) {
|
|
1849
1849
|
const m = e[h];
|
|
1850
1850
|
if (typeof m == "string") {
|
|
1851
|
-
|
|
1851
|
+
c.set(m, f);
|
|
1852
1852
|
continue;
|
|
1853
1853
|
} else if (!Array.isArray(m)) {
|
|
1854
|
-
|
|
1854
|
+
c.set(m.name, Ut(f, m.at, u, c));
|
|
1855
1855
|
continue;
|
|
1856
1856
|
}
|
|
1857
1857
|
let [y, T, b = {}] = m;
|
|
1858
|
-
b.at !== void 0 && (
|
|
1858
|
+
b.at !== void 0 && (f = Ut(f, b.at, u, c));
|
|
1859
1859
|
let x = 0;
|
|
1860
|
-
const
|
|
1861
|
-
const E =
|
|
1862
|
-
let { ease: B = t.ease || "easeOut", duration:
|
|
1863
|
-
const
|
|
1864
|
-
if (
|
|
1860
|
+
const A = (S, g, v, V = 0, w = 0) => {
|
|
1861
|
+
const E = ki(S), { delay: D = 0, times: O = Hn(E), type: Ce = "keyframes", repeat: ge, repeatType: ga, repeatDelay: ya = 0, ...Ms } = g;
|
|
1862
|
+
let { ease: B = t.ease || "easeOut", duration: N } = g;
|
|
1863
|
+
const At = typeof D == "function" ? D(V, w) : D, vt = E.length, St = pt(Ce) ? Ce : r?.[Ce || "keyframes"];
|
|
1864
|
+
if (vt <= 2 && St) {
|
|
1865
1865
|
let ne = 100;
|
|
1866
|
-
if (
|
|
1866
|
+
if (vt === 2 && Fi(E)) {
|
|
1867
1867
|
const se = E[1] - E[0];
|
|
1868
1868
|
ne = Math.abs(se);
|
|
1869
1869
|
}
|
|
1870
|
-
const ye = { ...
|
|
1871
|
-
|
|
1872
|
-
const be =
|
|
1873
|
-
B = be.ease,
|
|
1870
|
+
const ye = { ...Ms };
|
|
1871
|
+
N !== void 0 && (ye.duration = /* @__PURE__ */ P(N));
|
|
1872
|
+
const be = $n(ye, ne, St);
|
|
1873
|
+
B = be.ease, N = be.duration;
|
|
1874
1874
|
}
|
|
1875
|
-
|
|
1876
|
-
const
|
|
1877
|
-
|
|
1878
|
-
const
|
|
1879
|
-
if (
|
|
1880
|
-
|
|
1881
|
-
const ne = [...E], ye = [...
|
|
1875
|
+
N ?? (N = i);
|
|
1876
|
+
const xt = f + At;
|
|
1877
|
+
O.length === 1 && O[0] === 0 && (O[1] = 1);
|
|
1878
|
+
const Et = O.length - E.length;
|
|
1879
|
+
if (Et > 0 && Wn(O, Et), E.length === 1 && E.unshift(null), ge) {
|
|
1880
|
+
N = Ai(N, ge);
|
|
1881
|
+
const ne = [...E], ye = [...O];
|
|
1882
1882
|
B = Array.isArray(B) ? [...B] : [B];
|
|
1883
1883
|
const be = [...B];
|
|
1884
1884
|
for (let se = 0; se < ge; se++) {
|
|
1885
1885
|
E.push(...ne);
|
|
1886
1886
|
for (let re = 0; re < ne.length; re++)
|
|
1887
|
-
|
|
1887
|
+
O.push(ye[re] + (se + 1)), B.push(re === 0 ? "linear" : Mn(be, re - 1));
|
|
1888
1888
|
}
|
|
1889
|
-
|
|
1889
|
+
xi(O, ge);
|
|
1890
1890
|
}
|
|
1891
|
-
const
|
|
1892
|
-
|
|
1891
|
+
const Vt = xt + N;
|
|
1892
|
+
Si(v, E, B, O, xt, Vt), x = Math.max(At + N, x), d = Math.max(Vt, d);
|
|
1893
1893
|
};
|
|
1894
1894
|
if (C(y)) {
|
|
1895
|
-
const S =
|
|
1896
|
-
|
|
1895
|
+
const S = _t(y, a);
|
|
1896
|
+
A(T, b, jt("default", S));
|
|
1897
1897
|
} else {
|
|
1898
|
-
const S =
|
|
1899
|
-
for (let
|
|
1898
|
+
const S = is(y, T, s, l), g = S.length;
|
|
1899
|
+
for (let v = 0; v < g; v++) {
|
|
1900
1900
|
T = T, b = b;
|
|
1901
|
-
const V = S[
|
|
1901
|
+
const V = S[v], w = _t(V, a);
|
|
1902
1902
|
for (const E in T)
|
|
1903
|
-
|
|
1903
|
+
A(T[E], Ci(b, E), jt(E, w), v, g);
|
|
1904
1904
|
}
|
|
1905
1905
|
}
|
|
1906
|
-
|
|
1906
|
+
u = f, f += x;
|
|
1907
1907
|
}
|
|
1908
1908
|
return a.forEach((h, m) => {
|
|
1909
1909
|
for (const y in h) {
|
|
1910
1910
|
const T = h[y];
|
|
1911
|
-
T.sort(
|
|
1912
|
-
const b = [], x = [],
|
|
1911
|
+
T.sort(Ei);
|
|
1912
|
+
const b = [], x = [], A = [];
|
|
1913
1913
|
for (let g = 0; g < T.length; g++) {
|
|
1914
|
-
const { at:
|
|
1915
|
-
b.push(V), x.push(/* @__PURE__ */
|
|
1914
|
+
const { at: v, value: V, easing: w } = T[g];
|
|
1915
|
+
b.push(V), x.push(/* @__PURE__ */ st(0, d, v)), A.push(w || "easeOut");
|
|
1916
1916
|
}
|
|
1917
|
-
x[0] !== 0 && (x.unshift(0), b.unshift(b[0]),
|
|
1917
|
+
x[0] !== 0 && (x.unshift(0), b.unshift(b[0]), A.unshift(Vi)), x[x.length - 1] !== 1 && (x.push(1), b.push(null)), o.has(m) || o.set(m, {
|
|
1918
1918
|
keyframes: {},
|
|
1919
1919
|
transition: {}
|
|
1920
1920
|
});
|
|
@@ -1922,117 +1922,117 @@ function Fi(e, { defaultTransition: t = {}, ...n } = {}, s, r) {
|
|
|
1922
1922
|
S.keyframes[y] = b, S.transition[y] = {
|
|
1923
1923
|
...t,
|
|
1924
1924
|
duration: d,
|
|
1925
|
-
ease:
|
|
1925
|
+
ease: A,
|
|
1926
1926
|
times: x,
|
|
1927
1927
|
...n
|
|
1928
1928
|
};
|
|
1929
1929
|
}
|
|
1930
1930
|
}), o;
|
|
1931
1931
|
}
|
|
1932
|
-
function
|
|
1932
|
+
function _t(e, t) {
|
|
1933
1933
|
return !t.has(e) && t.set(e, {}), t.get(e);
|
|
1934
1934
|
}
|
|
1935
|
-
function
|
|
1935
|
+
function jt(e, t) {
|
|
1936
1936
|
return t[e] || (t[e] = []), t[e];
|
|
1937
1937
|
}
|
|
1938
|
-
function
|
|
1938
|
+
function ki(e) {
|
|
1939
1939
|
return Array.isArray(e) ? e : [e];
|
|
1940
1940
|
}
|
|
1941
|
-
function
|
|
1941
|
+
function Ci(e, t) {
|
|
1942
1942
|
return e && e[t] ? {
|
|
1943
1943
|
...e,
|
|
1944
1944
|
...e[t]
|
|
1945
1945
|
} : { ...e };
|
|
1946
1946
|
}
|
|
1947
|
-
const
|
|
1948
|
-
function
|
|
1947
|
+
const Di = (e) => typeof e == "number", Fi = (e) => e.every(Di), de = /* @__PURE__ */ new WeakMap(), Li = (e) => Array.isArray(e);
|
|
1948
|
+
function Gt(e) {
|
|
1949
1949
|
const t = [{}, {}];
|
|
1950
1950
|
return e?.values.forEach((n, s) => {
|
|
1951
1951
|
t[0][s] = n.get(), t[1][s] = n.getVelocity();
|
|
1952
1952
|
}), t;
|
|
1953
1953
|
}
|
|
1954
|
-
function
|
|
1954
|
+
function os(e, t, n, s) {
|
|
1955
1955
|
if (typeof t == "function") {
|
|
1956
|
-
const [r, i] =
|
|
1956
|
+
const [r, i] = Gt(s);
|
|
1957
1957
|
t = t(n !== void 0 ? n : e.custom, r, i);
|
|
1958
1958
|
}
|
|
1959
1959
|
if (typeof t == "string" && (t = e.variants && e.variants[t]), typeof t == "function") {
|
|
1960
|
-
const [r, i] =
|
|
1960
|
+
const [r, i] = Gt(s);
|
|
1961
1961
|
t = t(n !== void 0 ? n : e.custom, r, i);
|
|
1962
1962
|
}
|
|
1963
1963
|
return t;
|
|
1964
1964
|
}
|
|
1965
|
-
function
|
|
1965
|
+
function Ii(e, t, n) {
|
|
1966
1966
|
const s = e.getProps();
|
|
1967
|
-
return
|
|
1967
|
+
return os(s, t, s.custom, e);
|
|
1968
1968
|
}
|
|
1969
|
-
function
|
|
1969
|
+
function Oi(e, t, n) {
|
|
1970
1970
|
e.hasValue(t) ? e.getValue(t).set(n) : e.addValue(t, fe(n));
|
|
1971
1971
|
}
|
|
1972
|
-
function
|
|
1973
|
-
return
|
|
1972
|
+
function Pi(e) {
|
|
1973
|
+
return Li(e) ? e[e.length - 1] || 0 : e;
|
|
1974
1974
|
}
|
|
1975
|
-
function
|
|
1976
|
-
const n =
|
|
1975
|
+
function Ni(e, t) {
|
|
1976
|
+
const n = Ii(e, t);
|
|
1977
1977
|
let { transitionEnd: s = {}, transition: r = {}, ...i } = n || {};
|
|
1978
1978
|
i = { ...i, ...s };
|
|
1979
1979
|
for (const o in i) {
|
|
1980
|
-
const a =
|
|
1981
|
-
|
|
1980
|
+
const a = Pi(i[o]);
|
|
1981
|
+
Oi(e, o, a);
|
|
1982
1982
|
}
|
|
1983
1983
|
}
|
|
1984
|
-
function
|
|
1984
|
+
function Ri(e) {
|
|
1985
1985
|
return !!(C(e) && e.add);
|
|
1986
1986
|
}
|
|
1987
|
-
function
|
|
1987
|
+
function Ki(e, t) {
|
|
1988
1988
|
const n = e.getValue("willChange");
|
|
1989
|
-
if (
|
|
1989
|
+
if (Ri(n))
|
|
1990
1990
|
return n.add(t);
|
|
1991
|
-
if (!n &&
|
|
1992
|
-
const s = new
|
|
1991
|
+
if (!n && R.WillChange) {
|
|
1992
|
+
const s = new R.WillChange("auto");
|
|
1993
1993
|
e.addValue("willChange", s), s.add(t);
|
|
1994
1994
|
}
|
|
1995
1995
|
}
|
|
1996
|
-
const
|
|
1997
|
-
function
|
|
1998
|
-
return e.props[
|
|
1996
|
+
const bt = (e) => e.replace(/([a-z])([A-Z])/gu, "$1-$2").toLowerCase(), Bi = "framerAppearId", $i = "data-" + bt(Bi);
|
|
1997
|
+
function qi(e) {
|
|
1998
|
+
return e.props[$i];
|
|
1999
1999
|
}
|
|
2000
|
-
const
|
|
2001
|
-
function
|
|
2002
|
-
const r = e.filter(
|
|
2000
|
+
const Wi = (e) => e !== null;
|
|
2001
|
+
function Hi(e, { repeat: t, repeatType: n = "loop" }, s) {
|
|
2002
|
+
const r = e.filter(Wi), i = t && n !== "loop" && t % 2 === 1 ? 0 : r.length - 1;
|
|
2003
2003
|
return r[i];
|
|
2004
2004
|
}
|
|
2005
|
-
const
|
|
2005
|
+
const Ui = {
|
|
2006
2006
|
type: "spring",
|
|
2007
2007
|
stiffness: 500,
|
|
2008
2008
|
damping: 25,
|
|
2009
2009
|
restSpeed: 10
|
|
2010
|
-
},
|
|
2010
|
+
}, _i = (e) => ({
|
|
2011
2011
|
type: "spring",
|
|
2012
2012
|
stiffness: 550,
|
|
2013
2013
|
damping: e === 0 ? 2 * Math.sqrt(550) : 30,
|
|
2014
2014
|
restSpeed: 10
|
|
2015
|
-
}),
|
|
2015
|
+
}), ji = {
|
|
2016
2016
|
type: "keyframes",
|
|
2017
2017
|
duration: 0.8
|
|
2018
|
-
},
|
|
2018
|
+
}, Gi = {
|
|
2019
2019
|
type: "keyframes",
|
|
2020
2020
|
ease: [0.25, 0.1, 0.35, 1],
|
|
2021
2021
|
duration: 0.3
|
|
2022
|
-
},
|
|
2023
|
-
function
|
|
2024
|
-
return !!Object.keys(
|
|
2025
|
-
}
|
|
2026
|
-
const
|
|
2027
|
-
const a =
|
|
2028
|
-
let { elapsed:
|
|
2029
|
-
|
|
2030
|
-
const
|
|
2022
|
+
}, zi = (e, { keyframes: t }) => t.length > 2 ? ji : te.has(e) ? e.startsWith("scale") ? _i(t[1]) : Ui : Gi;
|
|
2023
|
+
function Yi({ when: e, delay: t, delayChildren: n, staggerChildren: s, staggerDirection: r, repeat: i, repeatType: o, repeatDelay: a, from: l, elapsed: c, ...u }) {
|
|
2024
|
+
return !!Object.keys(u).length;
|
|
2025
|
+
}
|
|
2026
|
+
const as = (e, t, n, s = {}, r, i) => (o) => {
|
|
2027
|
+
const a = Zn(s, e) || {}, l = a.delay || s.delay || 0;
|
|
2028
|
+
let { elapsed: c = 0 } = s;
|
|
2029
|
+
c = c - /* @__PURE__ */ P(l);
|
|
2030
|
+
const u = {
|
|
2031
2031
|
keyframes: Array.isArray(n) ? n : [null, n],
|
|
2032
2032
|
ease: "easeOut",
|
|
2033
2033
|
velocity: t.getVelocity(),
|
|
2034
2034
|
...a,
|
|
2035
|
-
delay: -
|
|
2035
|
+
delay: -c,
|
|
2036
2036
|
onUpdate: (d) => {
|
|
2037
2037
|
t.set(d), a.onUpdate && a.onUpdate(d);
|
|
2038
2038
|
},
|
|
@@ -2043,62 +2043,62 @@ const ds = (e, t, n, s = {}, r, i) => (o) => {
|
|
|
2043
2043
|
motionValue: t,
|
|
2044
2044
|
element: i ? void 0 : r
|
|
2045
2045
|
};
|
|
2046
|
-
|
|
2047
|
-
let
|
|
2048
|
-
if ((
|
|
2049
|
-
const d =
|
|
2046
|
+
Yi(a) || Object.assign(u, zi(e, u)), u.duration && (u.duration = /* @__PURE__ */ P(u.duration)), u.repeatDelay && (u.repeatDelay = /* @__PURE__ */ P(u.repeatDelay)), u.from !== void 0 && (u.keyframes[0] = u.from);
|
|
2047
|
+
let f = !1;
|
|
2048
|
+
if ((u.type === !1 || u.duration === 0 && !u.repeatDelay) && (Xe(u), u.delay === 0 && (f = !0)), (R.instantAnimations || R.skipAnimations) && (f = !0, Xe(u), u.delay = 0), u.allowFlatten = !a.type && !a.ease, f && !i && t.get() !== void 0) {
|
|
2049
|
+
const d = Hi(u.keyframes, a);
|
|
2050
2050
|
if (d !== void 0) {
|
|
2051
2051
|
K.update(() => {
|
|
2052
|
-
|
|
2052
|
+
u.onUpdate(d), u.onComplete();
|
|
2053
2053
|
});
|
|
2054
2054
|
return;
|
|
2055
2055
|
}
|
|
2056
2056
|
}
|
|
2057
|
-
return a.isSync ? new
|
|
2057
|
+
return a.isSync ? new ht(u) : new Qr(u);
|
|
2058
2058
|
};
|
|
2059
|
-
function
|
|
2059
|
+
function Xi({ protectedKeys: e, needsAnimating: t }, n) {
|
|
2060
2060
|
const s = e.hasOwnProperty(n) && t[n] !== !0;
|
|
2061
2061
|
return t[n] = !1, s;
|
|
2062
2062
|
}
|
|
2063
|
-
function
|
|
2063
|
+
function Zi(e, t, { delay: n = 0, transitionOverride: s, type: r } = {}) {
|
|
2064
2064
|
let { transition: i = e.getDefaultTransition(), transitionEnd: o, ...a } = t;
|
|
2065
2065
|
s && (i = s);
|
|
2066
|
-
const l = [],
|
|
2067
|
-
for (const
|
|
2068
|
-
const
|
|
2069
|
-
if (d === void 0 ||
|
|
2066
|
+
const l = [], c = r && e.animationState && e.animationState.getState()[r];
|
|
2067
|
+
for (const u in a) {
|
|
2068
|
+
const f = e.getValue(u, e.latestValues[u] ?? null), d = a[u];
|
|
2069
|
+
if (d === void 0 || c && Xi(c, u))
|
|
2070
2070
|
continue;
|
|
2071
2071
|
const h = {
|
|
2072
2072
|
delay: n,
|
|
2073
|
-
...
|
|
2074
|
-
}, m =
|
|
2075
|
-
if (m !== void 0 && !
|
|
2073
|
+
...Zn(i || {}, u)
|
|
2074
|
+
}, m = f.get();
|
|
2075
|
+
if (m !== void 0 && !f.isAnimating && !Array.isArray(d) && d === m && !h.velocity)
|
|
2076
2076
|
continue;
|
|
2077
2077
|
let y = !1;
|
|
2078
2078
|
if (window.MotionHandoffAnimation) {
|
|
2079
|
-
const b =
|
|
2079
|
+
const b = qi(e);
|
|
2080
2080
|
if (b) {
|
|
2081
|
-
const x = window.MotionHandoffAnimation(b,
|
|
2081
|
+
const x = window.MotionHandoffAnimation(b, u, K);
|
|
2082
2082
|
x !== null && (h.startTime = x, y = !0);
|
|
2083
2083
|
}
|
|
2084
2084
|
}
|
|
2085
|
-
|
|
2086
|
-
const T =
|
|
2085
|
+
Ki(e, u), f.start(as(u, f, d, e.shouldReduceMotion && Jn.has(u) ? { type: !1 } : h, e, y));
|
|
2086
|
+
const T = f.animation;
|
|
2087
2087
|
T && l.push(T);
|
|
2088
2088
|
}
|
|
2089
2089
|
return o && Promise.all(l).then(() => {
|
|
2090
2090
|
K.update(() => {
|
|
2091
|
-
o &&
|
|
2091
|
+
o && Ni(e, o);
|
|
2092
2092
|
});
|
|
2093
2093
|
}), l;
|
|
2094
2094
|
}
|
|
2095
|
-
function
|
|
2095
|
+
function Ji({ top: e, left: t, right: n, bottom: s }) {
|
|
2096
2096
|
return {
|
|
2097
2097
|
x: { min: t, max: n },
|
|
2098
2098
|
y: { min: e, max: s }
|
|
2099
2099
|
};
|
|
2100
2100
|
}
|
|
2101
|
-
function
|
|
2101
|
+
function Qi(e, t) {
|
|
2102
2102
|
if (!t)
|
|
2103
2103
|
return e;
|
|
2104
2104
|
const n = t({ x: e.left, y: e.top }), s = t({ x: e.right, y: e.bottom });
|
|
@@ -2109,10 +2109,10 @@ function io(e, t) {
|
|
|
2109
2109
|
right: s.x
|
|
2110
2110
|
};
|
|
2111
2111
|
}
|
|
2112
|
-
function
|
|
2113
|
-
return
|
|
2112
|
+
function eo(e, t) {
|
|
2113
|
+
return Ji(Qi(e.getBoundingClientRect(), t));
|
|
2114
2114
|
}
|
|
2115
|
-
const
|
|
2115
|
+
const zt = {
|
|
2116
2116
|
animation: [
|
|
2117
2117
|
"animate",
|
|
2118
2118
|
"variants",
|
|
@@ -2131,30 +2131,30 @@ const Zt = {
|
|
|
2131
2131
|
pan: ["onPan", "onPanStart", "onPanSessionStart", "onPanEnd"],
|
|
2132
2132
|
inView: ["whileInView", "onViewportEnter", "onViewportLeave"],
|
|
2133
2133
|
layout: ["layout", "layoutId"]
|
|
2134
|
-
},
|
|
2135
|
-
for (const e in
|
|
2136
|
-
|
|
2137
|
-
isEnabled: (t) =>
|
|
2134
|
+
}, Je = {};
|
|
2135
|
+
for (const e in zt)
|
|
2136
|
+
Je[e] = {
|
|
2137
|
+
isEnabled: (t) => zt[e].some((n) => !!t[n])
|
|
2138
2138
|
};
|
|
2139
|
-
const
|
|
2140
|
-
x:
|
|
2141
|
-
y:
|
|
2142
|
-
}),
|
|
2143
|
-
function
|
|
2144
|
-
if (
|
|
2139
|
+
const Yt = () => ({ min: 0, max: 0 }), wt = () => ({
|
|
2140
|
+
x: Yt(),
|
|
2141
|
+
y: Yt()
|
|
2142
|
+
}), to = typeof window < "u", Qe = { current: null }, ls = { current: !1 };
|
|
2143
|
+
function no() {
|
|
2144
|
+
if (ls.current = !0, !!to)
|
|
2145
2145
|
if (window.matchMedia) {
|
|
2146
|
-
const e = window.matchMedia("(prefers-reduced-motion)"), t = () =>
|
|
2146
|
+
const e = window.matchMedia("(prefers-reduced-motion)"), t = () => Qe.current = e.matches;
|
|
2147
2147
|
e.addEventListener("change", t), t();
|
|
2148
2148
|
} else
|
|
2149
|
-
|
|
2149
|
+
Qe.current = !1;
|
|
2150
2150
|
}
|
|
2151
|
-
function
|
|
2151
|
+
function so(e) {
|
|
2152
2152
|
return e !== null && typeof e == "object" && typeof e.start == "function";
|
|
2153
2153
|
}
|
|
2154
|
-
function
|
|
2154
|
+
function ro(e) {
|
|
2155
2155
|
return typeof e == "string" || Array.isArray(e);
|
|
2156
2156
|
}
|
|
2157
|
-
const
|
|
2157
|
+
const io = [
|
|
2158
2158
|
"animate",
|
|
2159
2159
|
"whileInView",
|
|
2160
2160
|
"whileFocus",
|
|
@@ -2162,14 +2162,14 @@ const fo = [
|
|
|
2162
2162
|
"whileTap",
|
|
2163
2163
|
"whileDrag",
|
|
2164
2164
|
"exit"
|
|
2165
|
-
],
|
|
2166
|
-
function
|
|
2167
|
-
return
|
|
2165
|
+
], oo = ["initial", ...io];
|
|
2166
|
+
function us(e) {
|
|
2167
|
+
return so(e.animate) || oo.some((t) => ro(e[t]));
|
|
2168
2168
|
}
|
|
2169
|
-
function
|
|
2170
|
-
return !!(
|
|
2169
|
+
function ao(e) {
|
|
2170
|
+
return !!(us(e) || e.variants);
|
|
2171
2171
|
}
|
|
2172
|
-
function
|
|
2172
|
+
function lo(e, t, n) {
|
|
2173
2173
|
for (const s in t) {
|
|
2174
2174
|
const r = t[s], i = n[s];
|
|
2175
2175
|
if (C(r))
|
|
@@ -2189,7 +2189,7 @@ function po(e, t, n) {
|
|
|
2189
2189
|
t[s] === void 0 && e.removeValue(s);
|
|
2190
2190
|
return t;
|
|
2191
2191
|
}
|
|
2192
|
-
const
|
|
2192
|
+
const Xt = [
|
|
2193
2193
|
"AnimationStart",
|
|
2194
2194
|
"AnimationComplete",
|
|
2195
2195
|
"Update",
|
|
@@ -2198,7 +2198,7 @@ const Qt = [
|
|
|
2198
2198
|
"LayoutAnimationStart",
|
|
2199
2199
|
"LayoutAnimationComplete"
|
|
2200
2200
|
];
|
|
2201
|
-
class
|
|
2201
|
+
class cs {
|
|
2202
2202
|
/**
|
|
2203
2203
|
* This method takes React props and returns found MotionValues. For example, HTML
|
|
2204
2204
|
* MotionValues will be found within the style prop, whereas for Three.js within attribute arrays.
|
|
@@ -2210,25 +2210,25 @@ class ps {
|
|
|
2210
2210
|
return {};
|
|
2211
2211
|
}
|
|
2212
2212
|
constructor({ parent: t, props: n, presenceContext: s, reducedMotionConfig: r, blockInitialAnimation: i, visualState: o }, a = {}) {
|
|
2213
|
-
this.current = null, this.children = /* @__PURE__ */ new Set(), this.isVariantNode = !1, this.isControllingVariants = !1, this.shouldReduceMotion = null, this.values = /* @__PURE__ */ new Map(), this.KeyframeResolver =
|
|
2213
|
+
this.current = null, this.children = /* @__PURE__ */ new Set(), this.isVariantNode = !1, this.isControllingVariants = !1, this.shouldReduceMotion = null, this.values = /* @__PURE__ */ new Map(), this.KeyframeResolver = mt, this.features = {}, this.valueSubscriptions = /* @__PURE__ */ new Map(), this.prevMotionValues = {}, this.events = {}, this.propEventSubscriptions = {}, this.notifyUpdate = () => this.notify("Update", this.latestValues), this.render = () => {
|
|
2214
2214
|
this.current && (this.triggerBuild(), this.renderInstance(this.current, this.renderState, this.props.style, this.projection));
|
|
2215
2215
|
}, this.renderScheduledAt = 0, this.scheduleRender = () => {
|
|
2216
|
-
const d =
|
|
2216
|
+
const d = F.now();
|
|
2217
2217
|
this.renderScheduledAt < d && (this.renderScheduledAt = d, K.render(this.render, !1, !0));
|
|
2218
2218
|
};
|
|
2219
|
-
const { latestValues: l, renderState:
|
|
2220
|
-
this.latestValues = l, this.baseTarget = { ...l }, this.initialValues = n.initial ? { ...l } : {}, this.renderState =
|
|
2221
|
-
const { willChange:
|
|
2222
|
-
for (const d in
|
|
2223
|
-
const h =
|
|
2219
|
+
const { latestValues: l, renderState: c } = o;
|
|
2220
|
+
this.latestValues = l, this.baseTarget = { ...l }, this.initialValues = n.initial ? { ...l } : {}, this.renderState = c, this.parent = t, this.props = n, this.presenceContext = s, this.depth = t ? t.depth + 1 : 0, this.reducedMotionConfig = r, this.options = a, this.blockInitialAnimation = !!i, this.isControllingVariants = us(n), this.isVariantNode = ao(n), this.isVariantNode && (this.variantChildren = /* @__PURE__ */ new Set()), this.manuallyAnimateOnMount = !!(t && t.current);
|
|
2221
|
+
const { willChange: u, ...f } = this.scrapeMotionValuesFromProps(n, {}, this);
|
|
2222
|
+
for (const d in f) {
|
|
2223
|
+
const h = f[d];
|
|
2224
2224
|
l[d] !== void 0 && C(h) && h.set(l[d]);
|
|
2225
2225
|
}
|
|
2226
2226
|
}
|
|
2227
2227
|
mount(t) {
|
|
2228
|
-
this.current = t, de.set(t, this), this.projection && !this.projection.instance && this.projection.mount(t), this.parent && this.isVariantNode && !this.isControllingVariants && (this.removeFromVariantTree = this.parent.addVariantChild(this)), this.values.forEach((n, s) => this.bindToMotionValue(s, n)),
|
|
2228
|
+
this.current = t, de.set(t, this), this.projection && !this.projection.instance && this.projection.mount(t), this.parent && this.isVariantNode && !this.isControllingVariants && (this.removeFromVariantTree = this.parent.addVariantChild(this)), this.values.forEach((n, s) => this.bindToMotionValue(s, n)), ls.current || no(), this.shouldReduceMotion = this.reducedMotionConfig === "never" ? !1 : this.reducedMotionConfig === "always" ? !0 : Qe.current, this.parent?.addChild(this), this.update(this.props, this.presenceContext);
|
|
2229
2229
|
}
|
|
2230
2230
|
unmount() {
|
|
2231
|
-
this.projection && this.projection.unmount(),
|
|
2231
|
+
this.projection && this.projection.unmount(), Ke(this.notifyUpdate), Ke(this.render), this.valueSubscriptions.forEach((t) => t()), this.valueSubscriptions.clear(), this.removeFromVariantTree && this.removeFromVariantTree(), this.parent?.removeChild(this);
|
|
2232
2232
|
for (const t in this.events)
|
|
2233
2233
|
this.events[t].clear();
|
|
2234
2234
|
for (const t in this.features) {
|
|
@@ -2260,8 +2260,8 @@ class ps {
|
|
|
2260
2260
|
}
|
|
2261
2261
|
updateFeatures() {
|
|
2262
2262
|
let t = "animation";
|
|
2263
|
-
for (t in
|
|
2264
|
-
const n =
|
|
2263
|
+
for (t in Je) {
|
|
2264
|
+
const n = Je[t];
|
|
2265
2265
|
if (!n)
|
|
2266
2266
|
continue;
|
|
2267
2267
|
const { isEnabled: s, Feature: r } = n;
|
|
@@ -2280,7 +2280,7 @@ class ps {
|
|
|
2280
2280
|
* removed with a re-render to work.
|
|
2281
2281
|
*/
|
|
2282
2282
|
measureViewportBox() {
|
|
2283
|
-
return this.current ? this.measureInstanceViewportBox(this.current, this.props) :
|
|
2283
|
+
return this.current ? this.measureInstanceViewportBox(this.current, this.props) : wt();
|
|
2284
2284
|
}
|
|
2285
2285
|
getStaticValue(t) {
|
|
2286
2286
|
return this.latestValues[t];
|
|
@@ -2294,13 +2294,13 @@ class ps {
|
|
|
2294
2294
|
*/
|
|
2295
2295
|
update(t, n) {
|
|
2296
2296
|
(t.transformTemplate || this.props.transformTemplate) && this.scheduleRender(), this.prevProps = this.props, this.props = t, this.prevPresenceContext = this.presenceContext, this.presenceContext = n;
|
|
2297
|
-
for (let s = 0; s <
|
|
2298
|
-
const r =
|
|
2297
|
+
for (let s = 0; s < Xt.length; s++) {
|
|
2298
|
+
const r = Xt[s];
|
|
2299
2299
|
this.propEventSubscriptions[r] && (this.propEventSubscriptions[r](), delete this.propEventSubscriptions[r]);
|
|
2300
2300
|
const i = "on" + r, o = t[i];
|
|
2301
2301
|
o && (this.propEventSubscriptions[r] = this.on(r, o));
|
|
2302
2302
|
}
|
|
2303
|
-
this.prevMotionValues =
|
|
2303
|
+
this.prevMotionValues = lo(this, this.scrapeMotionValuesFromProps(t, this.prevProps, this), this.prevMotionValues), this.handleChildMotionValue && this.handleChildMotionValue();
|
|
2304
2304
|
}
|
|
2305
2305
|
getProps() {
|
|
2306
2306
|
return this.props;
|
|
@@ -2365,7 +2365,7 @@ class ps {
|
|
|
2365
2365
|
*/
|
|
2366
2366
|
readValue(t, n) {
|
|
2367
2367
|
let s = this.latestValues[t] !== void 0 || !this.current ? this.latestValues[t] : this.getBaseTargetFromProps(this.props, t) ?? this.readValueFromInstance(this.current, t, this.options);
|
|
2368
|
-
return s != null && (typeof s == "string" && (
|
|
2368
|
+
return s != null && (typeof s == "string" && (mn(s) || pn(s)) ? s = parseFloat(s) : !Ti(s) && Q.test(n) && (s = ns(t, n)), this.setBaseTarget(t, C(s) ? s.get() : s)), C(s) ? s.get() : s;
|
|
2369
2369
|
}
|
|
2370
2370
|
/**
|
|
2371
2371
|
* Set the base target to later animate back to. This is currently
|
|
@@ -2382,7 +2382,7 @@ class ps {
|
|
|
2382
2382
|
const { initial: n } = this.props;
|
|
2383
2383
|
let s;
|
|
2384
2384
|
if (typeof n == "string" || typeof n == "object") {
|
|
2385
|
-
const i =
|
|
2385
|
+
const i = os(this.props, n, this.presenceContext?.custom);
|
|
2386
2386
|
i && (s = i[t]);
|
|
2387
2387
|
}
|
|
2388
2388
|
if (n && s !== void 0)
|
|
@@ -2391,18 +2391,18 @@ class ps {
|
|
|
2391
2391
|
return r !== void 0 && !C(r) ? r : this.initialValues[t] !== void 0 && s === void 0 ? void 0 : this.baseTarget[t];
|
|
2392
2392
|
}
|
|
2393
2393
|
on(t, n) {
|
|
2394
|
-
return this.events[t] || (this.events[t] = new
|
|
2394
|
+
return this.events[t] || (this.events[t] = new gn()), this.events[t].add(n);
|
|
2395
2395
|
}
|
|
2396
2396
|
notify(t, ...n) {
|
|
2397
2397
|
this.events[t] && this.events[t].notify(...n);
|
|
2398
2398
|
}
|
|
2399
2399
|
scheduleRenderMicrotask() {
|
|
2400
|
-
|
|
2400
|
+
yi.render(this.render);
|
|
2401
2401
|
}
|
|
2402
2402
|
}
|
|
2403
|
-
class
|
|
2403
|
+
class fs extends cs {
|
|
2404
2404
|
constructor() {
|
|
2405
|
-
super(...arguments), this.KeyframeResolver =
|
|
2405
|
+
super(...arguments), this.KeyframeResolver = hi;
|
|
2406
2406
|
}
|
|
2407
2407
|
sortInstanceNodePosition(t, n) {
|
|
2408
2408
|
return t.compareDocumentPosition(n) & 2 ? 1 : -1;
|
|
@@ -2421,53 +2421,53 @@ class gs extends ps {
|
|
|
2421
2421
|
}));
|
|
2422
2422
|
}
|
|
2423
2423
|
}
|
|
2424
|
-
const
|
|
2424
|
+
const uo = {
|
|
2425
2425
|
x: "translateX",
|
|
2426
2426
|
y: "translateY",
|
|
2427
2427
|
z: "translateZ",
|
|
2428
2428
|
transformPerspective: "perspective"
|
|
2429
|
-
},
|
|
2430
|
-
function
|
|
2429
|
+
}, co = ee.length;
|
|
2430
|
+
function fo(e, t, n) {
|
|
2431
2431
|
let s = "", r = !0;
|
|
2432
|
-
for (let i = 0; i <
|
|
2432
|
+
for (let i = 0; i < co; i++) {
|
|
2433
2433
|
const o = ee[i], a = e[o];
|
|
2434
2434
|
if (a === void 0)
|
|
2435
2435
|
continue;
|
|
2436
2436
|
let l = !0;
|
|
2437
2437
|
if (typeof a == "number" ? l = a === (o.startsWith("scale") ? 1 : 0) : l = parseFloat(a) === 0, !l || n) {
|
|
2438
|
-
const
|
|
2438
|
+
const c = ss(a, gt[o]);
|
|
2439
2439
|
if (!l) {
|
|
2440
2440
|
r = !1;
|
|
2441
|
-
const
|
|
2442
|
-
s += `${
|
|
2441
|
+
const u = uo[o] || o;
|
|
2442
|
+
s += `${u}(${c}) `;
|
|
2443
2443
|
}
|
|
2444
|
-
n && (t[o] =
|
|
2444
|
+
n && (t[o] = c);
|
|
2445
2445
|
}
|
|
2446
2446
|
}
|
|
2447
2447
|
return s = s.trim(), n ? s = n(t, r ? "" : s) : r && (s = "none"), s;
|
|
2448
2448
|
}
|
|
2449
|
-
function
|
|
2449
|
+
function ds(e, t, n) {
|
|
2450
2450
|
const { style: s, vars: r, transformOrigin: i } = e;
|
|
2451
2451
|
let o = !1, a = !1;
|
|
2452
2452
|
for (const l in t) {
|
|
2453
|
-
const
|
|
2453
|
+
const c = t[l];
|
|
2454
2454
|
if (te.has(l)) {
|
|
2455
2455
|
o = !0;
|
|
2456
2456
|
continue;
|
|
2457
|
-
} else if (
|
|
2458
|
-
r[l] =
|
|
2457
|
+
} else if (Fn(l)) {
|
|
2458
|
+
r[l] = c;
|
|
2459
2459
|
continue;
|
|
2460
2460
|
} else {
|
|
2461
|
-
const
|
|
2462
|
-
l.startsWith("origin") ? (a = !0, i[l] =
|
|
2461
|
+
const u = ss(c, gt[l]);
|
|
2462
|
+
l.startsWith("origin") ? (a = !0, i[l] = u) : s[l] = u;
|
|
2463
2463
|
}
|
|
2464
2464
|
}
|
|
2465
|
-
if (t.transform || (o || n ? s.transform =
|
|
2466
|
-
const { originX: l = "50%", originY:
|
|
2467
|
-
s.transformOrigin = `${l} ${
|
|
2465
|
+
if (t.transform || (o || n ? s.transform = fo(t, e.transform, n) : s.transform && (s.transform = "none")), a) {
|
|
2466
|
+
const { originX: l = "50%", originY: c = "50%", originZ: u = 0 } = i;
|
|
2467
|
+
s.transformOrigin = `${l} ${c} ${u}`;
|
|
2468
2468
|
}
|
|
2469
2469
|
}
|
|
2470
|
-
function
|
|
2470
|
+
function hs(e, { style: t, vars: n }, s, r) {
|
|
2471
2471
|
const i = e.style;
|
|
2472
2472
|
let o;
|
|
2473
2473
|
for (o in t)
|
|
@@ -2476,50 +2476,50 @@ function bs(e, { style: t, vars: n }, s, r) {
|
|
|
2476
2476
|
for (o in n)
|
|
2477
2477
|
i.setProperty(o, n[o]);
|
|
2478
2478
|
}
|
|
2479
|
-
const
|
|
2480
|
-
function
|
|
2481
|
-
return te.has(e) || e.startsWith("origin") || (t || n !== void 0) && (!!
|
|
2479
|
+
const ho = {};
|
|
2480
|
+
function mo(e, { layout: t, layoutId: n }) {
|
|
2481
|
+
return te.has(e) || e.startsWith("origin") || (t || n !== void 0) && (!!ho[e] || e === "opacity");
|
|
2482
2482
|
}
|
|
2483
|
-
function
|
|
2483
|
+
function ms(e, t, n) {
|
|
2484
2484
|
const { style: s } = e, r = {};
|
|
2485
2485
|
for (const i in s)
|
|
2486
|
-
(C(s[i]) || t.style && C(t.style[i]) ||
|
|
2486
|
+
(C(s[i]) || t.style && C(t.style[i]) || mo(i, e) || n?.getValue(i)?.liveStyle !== void 0) && (r[i] = s[i]);
|
|
2487
2487
|
return r;
|
|
2488
2488
|
}
|
|
2489
|
-
function
|
|
2489
|
+
function po(e) {
|
|
2490
2490
|
return window.getComputedStyle(e);
|
|
2491
2491
|
}
|
|
2492
|
-
class
|
|
2492
|
+
class go extends fs {
|
|
2493
2493
|
constructor() {
|
|
2494
|
-
super(...arguments), this.type = "html", this.renderInstance =
|
|
2494
|
+
super(...arguments), this.type = "html", this.renderInstance = hs;
|
|
2495
2495
|
}
|
|
2496
2496
|
readValueFromInstance(t, n) {
|
|
2497
2497
|
if (te.has(n))
|
|
2498
|
-
return this.projection?.isProjecting ?
|
|
2498
|
+
return this.projection?.isProjecting ? _e(n) : Dr(t, n);
|
|
2499
2499
|
{
|
|
2500
|
-
const s =
|
|
2500
|
+
const s = po(t), r = (Fn(n) ? s.getPropertyValue(n) : s[n]) || 0;
|
|
2501
2501
|
return typeof r == "string" ? r.trim() : r;
|
|
2502
2502
|
}
|
|
2503
2503
|
}
|
|
2504
2504
|
measureInstanceViewportBox(t, { transformPagePoint: n }) {
|
|
2505
|
-
return
|
|
2505
|
+
return eo(t, n);
|
|
2506
2506
|
}
|
|
2507
2507
|
build(t, n, s) {
|
|
2508
|
-
|
|
2508
|
+
ds(t, n, s.transformTemplate);
|
|
2509
2509
|
}
|
|
2510
2510
|
scrapeMotionValuesFromProps(t, n, s) {
|
|
2511
|
-
return
|
|
2511
|
+
return ms(t, n, s);
|
|
2512
2512
|
}
|
|
2513
2513
|
}
|
|
2514
|
-
function
|
|
2514
|
+
function yo(e, t) {
|
|
2515
2515
|
return e in t;
|
|
2516
2516
|
}
|
|
2517
|
-
class
|
|
2517
|
+
class bo extends cs {
|
|
2518
2518
|
constructor() {
|
|
2519
2519
|
super(...arguments), this.type = "object";
|
|
2520
2520
|
}
|
|
2521
2521
|
readValueFromInstance(t, n) {
|
|
2522
|
-
if (
|
|
2522
|
+
if (yo(n, t)) {
|
|
2523
2523
|
const s = t[n];
|
|
2524
2524
|
if (typeof s == "string" || typeof s == "number")
|
|
2525
2525
|
return s;
|
|
@@ -2531,7 +2531,7 @@ class xo extends ps {
|
|
|
2531
2531
|
delete n.output[t];
|
|
2532
2532
|
}
|
|
2533
2533
|
measureInstanceViewportBox() {
|
|
2534
|
-
return
|
|
2534
|
+
return wt();
|
|
2535
2535
|
}
|
|
2536
2536
|
build(t, n) {
|
|
2537
2537
|
Object.assign(t.output, n);
|
|
@@ -2543,21 +2543,21 @@ class xo extends ps {
|
|
|
2543
2543
|
return 0;
|
|
2544
2544
|
}
|
|
2545
2545
|
}
|
|
2546
|
-
const
|
|
2546
|
+
const wo = {
|
|
2547
2547
|
offset: "stroke-dashoffset",
|
|
2548
2548
|
array: "stroke-dasharray"
|
|
2549
|
-
},
|
|
2549
|
+
}, To = {
|
|
2550
2550
|
offset: "strokeDashoffset",
|
|
2551
2551
|
array: "strokeDasharray"
|
|
2552
2552
|
};
|
|
2553
|
-
function
|
|
2553
|
+
function Ao(e, t, n = 1, s = 0, r = !0) {
|
|
2554
2554
|
e.pathLength = 1;
|
|
2555
|
-
const i = r ?
|
|
2555
|
+
const i = r ? wo : To;
|
|
2556
2556
|
e[i.offset] = p.transform(-s);
|
|
2557
2557
|
const o = p.transform(t), a = p.transform(n);
|
|
2558
2558
|
e[i.array] = `${o} ${a}`;
|
|
2559
2559
|
}
|
|
2560
|
-
function
|
|
2560
|
+
function vo(e, {
|
|
2561
2561
|
attrX: t,
|
|
2562
2562
|
attrY: n,
|
|
2563
2563
|
attrScale: s,
|
|
@@ -2566,16 +2566,16 @@ function ko(e, {
|
|
|
2566
2566
|
pathOffset: o = 0,
|
|
2567
2567
|
// This is object creation, which we try to avoid per-frame.
|
|
2568
2568
|
...a
|
|
2569
|
-
}, l,
|
|
2570
|
-
if (
|
|
2569
|
+
}, l, c, u) {
|
|
2570
|
+
if (ds(e, a, c), l) {
|
|
2571
2571
|
e.style.viewBox && (e.attrs.viewBox = e.style.viewBox);
|
|
2572
2572
|
return;
|
|
2573
2573
|
}
|
|
2574
2574
|
e.attrs = e.style, e.style = {};
|
|
2575
|
-
const { attrs:
|
|
2576
|
-
|
|
2575
|
+
const { attrs: f, style: d } = e;
|
|
2576
|
+
f.transform && (d.transform = f.transform, delete f.transform), (d.transform || f.transformOrigin) && (d.transformOrigin = f.transformOrigin ?? "50% 50%", delete f.transformOrigin), d.transform && (d.transformBox = u?.transformBox ?? "fill-box", delete f.transformBox), t !== void 0 && (f.x = t), n !== void 0 && (f.y = n), s !== void 0 && (f.scale = s), r !== void 0 && Ao(f, r, i, o, !1);
|
|
2577
2577
|
}
|
|
2578
|
-
const
|
|
2578
|
+
const ps = /* @__PURE__ */ new Set([
|
|
2579
2579
|
"baseFrequency",
|
|
2580
2580
|
"diffuseConstant",
|
|
2581
2581
|
"kernelMatrix",
|
|
@@ -2599,14 +2599,14 @@ const Ts = /* @__PURE__ */ new Set([
|
|
|
2599
2599
|
"startOffset",
|
|
2600
2600
|
"textLength",
|
|
2601
2601
|
"lengthAdjust"
|
|
2602
|
-
]),
|
|
2603
|
-
function
|
|
2604
|
-
|
|
2602
|
+
]), So = (e) => typeof e == "string" && e.toLowerCase() === "svg";
|
|
2603
|
+
function xo(e, t, n, s) {
|
|
2604
|
+
hs(e, t, void 0, s);
|
|
2605
2605
|
for (const r in t.attrs)
|
|
2606
|
-
e.setAttribute(
|
|
2606
|
+
e.setAttribute(ps.has(r) ? r : bt(r), t.attrs[r]);
|
|
2607
2607
|
}
|
|
2608
|
-
function
|
|
2609
|
-
const s =
|
|
2608
|
+
function Eo(e, t, n) {
|
|
2609
|
+
const s = ms(e, t, n);
|
|
2610
2610
|
for (const r in e)
|
|
2611
2611
|
if (C(e[r]) || C(t[r])) {
|
|
2612
2612
|
const i = ee.indexOf(r) !== -1 ? "attr" + r.charAt(0).toUpperCase() + r.substring(1) : r;
|
|
@@ -2614,34 +2614,34 @@ function Io(e, t, n) {
|
|
|
2614
2614
|
}
|
|
2615
2615
|
return s;
|
|
2616
2616
|
}
|
|
2617
|
-
class
|
|
2617
|
+
class Vo extends fs {
|
|
2618
2618
|
constructor() {
|
|
2619
|
-
super(...arguments), this.type = "svg", this.isSVGTag = !1, this.measureInstanceViewportBox =
|
|
2619
|
+
super(...arguments), this.type = "svg", this.isSVGTag = !1, this.measureInstanceViewportBox = wt;
|
|
2620
2620
|
}
|
|
2621
2621
|
getBaseTargetFromProps(t, n) {
|
|
2622
2622
|
return t[n];
|
|
2623
2623
|
}
|
|
2624
2624
|
readValueFromInstance(t, n) {
|
|
2625
2625
|
if (te.has(n)) {
|
|
2626
|
-
const s =
|
|
2626
|
+
const s = ts(n);
|
|
2627
2627
|
return s && s.default || 0;
|
|
2628
2628
|
}
|
|
2629
|
-
return n =
|
|
2629
|
+
return n = ps.has(n) ? n : bt(n), t.getAttribute(n);
|
|
2630
2630
|
}
|
|
2631
2631
|
scrapeMotionValuesFromProps(t, n, s) {
|
|
2632
|
-
return
|
|
2632
|
+
return Eo(t, n, s);
|
|
2633
2633
|
}
|
|
2634
2634
|
build(t, n, s) {
|
|
2635
|
-
|
|
2635
|
+
vo(t, n, this.isSVGTag, s.transformTemplate, s.style);
|
|
2636
2636
|
}
|
|
2637
2637
|
renderInstance(t, n, s, r) {
|
|
2638
|
-
|
|
2638
|
+
xo(t, n, s, r);
|
|
2639
2639
|
}
|
|
2640
2640
|
mount(t) {
|
|
2641
|
-
this.isSVGTag =
|
|
2641
|
+
this.isSVGTag = So(t.tagName), super.mount(t);
|
|
2642
2642
|
}
|
|
2643
2643
|
}
|
|
2644
|
-
function
|
|
2644
|
+
function Mo(e) {
|
|
2645
2645
|
const t = {
|
|
2646
2646
|
presenceContext: null,
|
|
2647
2647
|
props: {},
|
|
@@ -2655,10 +2655,10 @@ function Fo(e) {
|
|
|
2655
2655
|
},
|
|
2656
2656
|
latestValues: {}
|
|
2657
2657
|
}
|
|
2658
|
-
}, n =
|
|
2658
|
+
}, n = rs(e) && !bi(e) ? new Vo(t) : new go(t);
|
|
2659
2659
|
n.mount(e), de.set(e, n);
|
|
2660
2660
|
}
|
|
2661
|
-
function
|
|
2661
|
+
function ko(e) {
|
|
2662
2662
|
const t = {
|
|
2663
2663
|
presenceContext: null,
|
|
2664
2664
|
props: {},
|
|
@@ -2668,56 +2668,56 @@ function Po(e) {
|
|
|
2668
2668
|
},
|
|
2669
2669
|
latestValues: {}
|
|
2670
2670
|
}
|
|
2671
|
-
}, n = new
|
|
2671
|
+
}, n = new bo(t);
|
|
2672
2672
|
n.mount(e), de.set(e, n);
|
|
2673
2673
|
}
|
|
2674
|
-
function
|
|
2674
|
+
function Co(e, t, n) {
|
|
2675
2675
|
const s = C(e) ? e : fe(e);
|
|
2676
|
-
return s.start(
|
|
2676
|
+
return s.start(as("", s, t, n)), s.animation;
|
|
2677
2677
|
}
|
|
2678
|
-
function
|
|
2679
|
-
return C(e) || typeof e == "number" || typeof e == "string" && !
|
|
2678
|
+
function Do(e, t) {
|
|
2679
|
+
return C(e) || typeof e == "number" || typeof e == "string" && !yt(t);
|
|
2680
2680
|
}
|
|
2681
|
-
function
|
|
2681
|
+
function gs(e, t, n, s) {
|
|
2682
2682
|
const r = [];
|
|
2683
|
-
if (
|
|
2684
|
-
r.push(
|
|
2683
|
+
if (Do(e, t))
|
|
2684
|
+
r.push(Co(e, yt(t) && t.default || t, n && (n.default || n)));
|
|
2685
2685
|
else {
|
|
2686
|
-
const i =
|
|
2686
|
+
const i = is(e, t, s), o = i.length;
|
|
2687
2687
|
for (let a = 0; a < o; a++) {
|
|
2688
|
-
const l = i[a],
|
|
2689
|
-
de.has(l) ||
|
|
2690
|
-
const
|
|
2691
|
-
"delay" in
|
|
2688
|
+
const l = i[a], c = l instanceof Element ? Mo : ko;
|
|
2689
|
+
de.has(l) || c(l);
|
|
2690
|
+
const u = de.get(l), f = { ...n };
|
|
2691
|
+
"delay" in f && typeof f.delay == "function" && (f.delay = f.delay(a, o)), r.push(...Zi(u, { ...t, transition: f }, {}));
|
|
2692
2692
|
}
|
|
2693
2693
|
}
|
|
2694
2694
|
return r;
|
|
2695
2695
|
}
|
|
2696
|
-
function
|
|
2696
|
+
function Fo(e, t, n) {
|
|
2697
2697
|
const s = [];
|
|
2698
|
-
return
|
|
2699
|
-
s.push(...
|
|
2698
|
+
return Mi(e, t, n, { spring: X }).forEach(({ keyframes: i, transition: o }, a) => {
|
|
2699
|
+
s.push(...gs(a, i, o));
|
|
2700
2700
|
}), s;
|
|
2701
2701
|
}
|
|
2702
|
-
function
|
|
2702
|
+
function Lo(e) {
|
|
2703
2703
|
return Array.isArray(e) && e.some(Array.isArray);
|
|
2704
2704
|
}
|
|
2705
|
-
function
|
|
2705
|
+
function Io(e) {
|
|
2706
2706
|
function t(n, s, r) {
|
|
2707
2707
|
let i = [], o;
|
|
2708
|
-
if (
|
|
2709
|
-
i =
|
|
2708
|
+
if (Lo(n))
|
|
2709
|
+
i = Fo(n, s, e);
|
|
2710
2710
|
else {
|
|
2711
|
-
const { onComplete: l, ...
|
|
2712
|
-
typeof l == "function" && (o = l), i =
|
|
2711
|
+
const { onComplete: l, ...c } = r || {};
|
|
2712
|
+
typeof l == "function" && (o = l), i = gs(n, s, c, e);
|
|
2713
2713
|
}
|
|
2714
|
-
const a = new
|
|
2714
|
+
const a = new ti(i);
|
|
2715
2715
|
return o && a.finished.then(o), a;
|
|
2716
2716
|
}
|
|
2717
2717
|
return t;
|
|
2718
2718
|
}
|
|
2719
|
-
const L =
|
|
2720
|
-
function
|
|
2719
|
+
const L = Io();
|
|
2720
|
+
function Oo(e) {
|
|
2721
2721
|
return new Worker(
|
|
2722
2722
|
"" + new URL("assets/worker-DbYry4sK.js", import.meta.url).href,
|
|
2723
2723
|
{
|
|
@@ -2725,30 +2725,30 @@ function qo(e) {
|
|
|
2725
2725
|
}
|
|
2726
2726
|
);
|
|
2727
2727
|
}
|
|
2728
|
-
const Oe = /* @__PURE__ */ new Map(),
|
|
2729
|
-
worker: new
|
|
2728
|
+
const Oe = /* @__PURE__ */ new Map(), Zt = "data-highlighted", Jt = Array.from({ length: 5 }, () => ({
|
|
2729
|
+
worker: new Oo(),
|
|
2730
2730
|
isBusy: !1
|
|
2731
2731
|
}));
|
|
2732
|
-
function
|
|
2732
|
+
function Po() {
|
|
2733
2733
|
return new Promise((e) => {
|
|
2734
|
-
const t =
|
|
2734
|
+
const t = Jt.find((s) => !s.isBusy);
|
|
2735
2735
|
t && (t.isBusy = !0, e(t));
|
|
2736
2736
|
const n = setInterval(() => {
|
|
2737
|
-
const s =
|
|
2737
|
+
const s = Jt.find((r) => !r.isBusy);
|
|
2738
2738
|
s && (s.isBusy = !0, clearInterval(n), e(s));
|
|
2739
2739
|
}, Math.random() * 100);
|
|
2740
2740
|
});
|
|
2741
2741
|
}
|
|
2742
|
-
async function
|
|
2743
|
-
const n = await
|
|
2742
|
+
async function No(e, t) {
|
|
2743
|
+
const n = await Po();
|
|
2744
2744
|
return n.isBusy = !0, new Promise((s) => {
|
|
2745
2745
|
n.worker.onmessage = (r) => {
|
|
2746
2746
|
n.isBusy = !1, s(r.data);
|
|
2747
2747
|
}, n.worker.postMessage({ lang: e, text: t });
|
|
2748
2748
|
});
|
|
2749
2749
|
}
|
|
2750
|
-
async function
|
|
2751
|
-
if (e.getAttribute(
|
|
2750
|
+
async function Ro(e, t) {
|
|
2751
|
+
if (e.getAttribute(Zt) === "true")
|
|
2752
2752
|
return;
|
|
2753
2753
|
let s = e.getAttribute("data-source-code");
|
|
2754
2754
|
if (!s)
|
|
@@ -2757,15 +2757,15 @@ async function Wo(e, t) {
|
|
|
2757
2757
|
s = decodeURIComponent(s).trim();
|
|
2758
2758
|
let i = "";
|
|
2759
2759
|
const o = `${r}:::${s}`;
|
|
2760
|
-
Oe.has(o) ? i = Oe.get(o) : (i = await
|
|
2760
|
+
Oe.has(o) ? i = Oe.get(o) : (i = await No(r, s), Oe.set(o, i)), e.insertAdjacentHTML("beforeend", i), e.setAttribute(Zt, "true");
|
|
2761
2761
|
}
|
|
2762
|
-
const
|
|
2763
|
-
function
|
|
2762
|
+
const Qt = () => window.matchMedia("(max-width: 768px)").matches;
|
|
2763
|
+
function ys(e, t) {
|
|
2764
2764
|
let n;
|
|
2765
2765
|
const s = async (o, a) => {
|
|
2766
2766
|
if (!e.open)
|
|
2767
2767
|
return;
|
|
2768
|
-
const l =
|
|
2768
|
+
const l = Qt();
|
|
2769
2769
|
o?.(l), l ? (L(e, { opacity: 0, y: [0, 250] }, { duration: 0.3, ease: "easeOut" }), await L(t, { opacity: 0 }, { duration: 0.3, ease: "easeOut" })) : (L(e, { opacity: 0, scale: [1, 0.98] }, { duration: 0.3, ease: "easeOut" }), await L(t, { opacity: 0 }, { duration: 0.3, ease: "linear" }).then(() => t.style.display = "none")), a?.(l), e.close(), n && n.abort();
|
|
2770
2770
|
};
|
|
2771
2771
|
async function r(o) {
|
|
@@ -2777,16 +2777,16 @@ function As(e, t) {
|
|
|
2777
2777
|
return { show: async (o, a) => {
|
|
2778
2778
|
n = new AbortController();
|
|
2779
2779
|
const l = window.scrollY;
|
|
2780
|
-
e.showModal(), await new Promise((
|
|
2781
|
-
const
|
|
2782
|
-
o?.(
|
|
2780
|
+
e.showModal(), await new Promise((u) => setTimeout(u, 50)), window.scrollTo(0, l), setTimeout(() => window.scrollTo(0, l), 0), setTimeout(() => window.scrollTo(0, l), 50), t.style.display = "block";
|
|
2781
|
+
const c = Qt();
|
|
2782
|
+
o?.(c), c ? (e.style.overflowY = "hidden", L(e, { opacity: [0, 1], y: [250, 0] }, { duration: 0.3, ease: "easeOut" }), await L(t, { opacity: [0, 1] }, { duration: 0.3, ease: "easeOut" }), e.style.overflowY = "auto") : (L(e, { opacity: [0, 1], scale: [0.98, 1] }, { duration: 0.3, ease: "easeOut" }), L(t, { opacity: [0, 1] }, { duration: 0.3, ease: "easeOut" })), a?.(c), setTimeout(() => document.addEventListener("click", r, {
|
|
2783
2783
|
signal: n?.signal
|
|
2784
|
-
}), 0), e.addEventListener("keydown", async (
|
|
2785
|
-
|
|
2784
|
+
}), 0), e.addEventListener("keydown", async (u) => {
|
|
2785
|
+
u.key === "Escape" && (u.preventDefault(), await s());
|
|
2786
2786
|
}, { signal: n?.signal });
|
|
2787
2787
|
}, close: s };
|
|
2788
2788
|
}
|
|
2789
|
-
class
|
|
2789
|
+
class Ko extends EventTarget {
|
|
2790
2790
|
#e;
|
|
2791
2791
|
constructor(t) {
|
|
2792
2792
|
super(), this.#e = t;
|
|
@@ -2807,67 +2807,15 @@ class _o extends EventTarget {
|
|
|
2807
2807
|
return String(this.#e);
|
|
2808
2808
|
}
|
|
2809
2809
|
}
|
|
2810
|
-
const
|
|
2811
|
-
function
|
|
2812
|
-
const t =
|
|
2810
|
+
const Bo = (e) => new Ko(e);
|
|
2811
|
+
function $o(e) {
|
|
2812
|
+
const t = Bo(!1);
|
|
2813
2813
|
return new ResizeObserver(() => {
|
|
2814
2814
|
const n = e.scrollHeight > e.clientHeight;
|
|
2815
2815
|
t.value !== n && (t.value = n);
|
|
2816
2816
|
}).observe(e), { $isOverflowingVertically: t };
|
|
2817
2817
|
}
|
|
2818
|
-
|
|
2819
|
-
async function zo(e) {
|
|
2820
|
-
const t = (n) => {
|
|
2821
|
-
const s = n.contentWindow?.document;
|
|
2822
|
-
if (!s)
|
|
2823
|
-
return !1;
|
|
2824
|
-
const r = s.body && s.body.children.length > 0, i = s.readyState === "complete";
|
|
2825
|
-
return r && i && s.body.children.length > 0;
|
|
2826
|
-
};
|
|
2827
|
-
await Promise.allSettled(
|
|
2828
|
-
e.map((n) => new Promise((s) => {
|
|
2829
|
-
const r = setInterval(() => {
|
|
2830
|
-
if (t(n))
|
|
2831
|
-
return clearInterval(r), s();
|
|
2832
|
-
}, 100);
|
|
2833
|
-
setTimeout(() => (clearInterval(r), s()), Go);
|
|
2834
|
-
}))
|
|
2835
|
-
);
|
|
2836
|
-
}
|
|
2837
|
-
function Re(e) {
|
|
2838
|
-
const t = e.contentWindow?.document;
|
|
2839
|
-
if (!t)
|
|
2840
|
-
throw new Error("iFrame was not fully loaded yet");
|
|
2841
|
-
e.style.height = "0px", e.offsetHeight;
|
|
2842
|
-
const n = Math.max(
|
|
2843
|
-
t.documentElement.scrollHeight,
|
|
2844
|
-
t.body.scrollHeight,
|
|
2845
|
-
t.documentElement.offsetHeight,
|
|
2846
|
-
t.body.offsetHeight,
|
|
2847
|
-
t.documentElement.clientHeight,
|
|
2848
|
-
t.body.clientHeight
|
|
2849
|
-
);
|
|
2850
|
-
e.style.height = `${n}px`;
|
|
2851
|
-
}
|
|
2852
|
-
function Ss() {
|
|
2853
|
-
document.body.classList.add("js-loaded");
|
|
2854
|
-
}
|
|
2855
|
-
const Yo = async (e) => {
|
|
2856
|
-
if (await zo(e), e.forEach((t) => {
|
|
2857
|
-
Re(t);
|
|
2858
|
-
const n = t.contentWindow;
|
|
2859
|
-
if (!n)
|
|
2860
|
-
return;
|
|
2861
|
-
new ResizeObserver(() => Re(t)).observe(n.document.body);
|
|
2862
|
-
}), window.addEventListener("resize", () => {
|
|
2863
|
-
e.forEach((t) => Re(t));
|
|
2864
|
-
}), window.location.hash) {
|
|
2865
|
-
const t = document.querySelector(window.location.hash);
|
|
2866
|
-
t && (await new Promise((n) => setTimeout(n, 200)), t.scrollIntoView());
|
|
2867
|
-
}
|
|
2868
|
-
Ss();
|
|
2869
|
-
};
|
|
2870
|
-
function Xo(e = 500) {
|
|
2818
|
+
function qo(e = 500) {
|
|
2871
2819
|
function t() {
|
|
2872
2820
|
return performance.getEntriesByType("resource").filter(
|
|
2873
2821
|
(r) => performance.now() - r.responseEnd < e
|
|
@@ -2880,17 +2828,17 @@ function Xo(e = 500) {
|
|
|
2880
2828
|
s();
|
|
2881
2829
|
});
|
|
2882
2830
|
}
|
|
2883
|
-
function
|
|
2831
|
+
function Wo(e) {
|
|
2884
2832
|
e.forEach((t) => {
|
|
2885
2833
|
const n = t.querySelectorAll('[role="tab"]'), s = Array.from(t.querySelectorAll('[role="tabpanel"]')), r = t.querySelector(".tab-trigger-background");
|
|
2886
2834
|
if (!r)
|
|
2887
2835
|
throw new Error("No tab trigger background found");
|
|
2888
|
-
const i = (l,
|
|
2889
|
-
const
|
|
2890
|
-
if (
|
|
2836
|
+
const i = (l, c) => {
|
|
2837
|
+
const u = l.offsetWidth;
|
|
2838
|
+
if (c) {
|
|
2891
2839
|
const d = l === n[0] ? l.offsetLeft : l.offsetLeft + 1;
|
|
2892
2840
|
L(r, {
|
|
2893
|
-
width:
|
|
2841
|
+
width: u,
|
|
2894
2842
|
x: `${d}px`
|
|
2895
2843
|
}, {
|
|
2896
2844
|
duration: 0.3,
|
|
@@ -2899,84 +2847,42 @@ function Zo(e) {
|
|
|
2899
2847
|
bounce: 0.1
|
|
2900
2848
|
});
|
|
2901
2849
|
} else
|
|
2902
|
-
r.style.width = `${
|
|
2850
|
+
r.style.width = `${u}px`, r.style.transform = "translateX(2px)";
|
|
2903
2851
|
}, o = n[0];
|
|
2904
2852
|
i(o, !1), n.forEach((l) => l.addEventListener("click", () => {
|
|
2905
|
-
n.forEach((
|
|
2906
|
-
const
|
|
2907
|
-
|
|
2908
|
-
const
|
|
2909
|
-
|
|
2853
|
+
n.forEach((c) => {
|
|
2854
|
+
const u = c === l;
|
|
2855
|
+
c.setAttribute("aria-selected", u.toString());
|
|
2856
|
+
const f = s.find((d) => d.getAttribute("aria-labelledby") === c.id);
|
|
2857
|
+
f?.setAttribute("tab-index", u ? "0" : "-1"), f?.classList.toggle("hidden", !u), u && i(l, !0);
|
|
2910
2858
|
});
|
|
2911
2859
|
})), window.innerWidth < 768 || n.forEach((l) => {
|
|
2912
|
-
const
|
|
2913
|
-
if (!
|
|
2860
|
+
const c = s.find((d) => d.getAttribute("aria-labelledby") === l.id);
|
|
2861
|
+
if (!c)
|
|
2914
2862
|
throw new Error(`No content found for trigger ${l.id}`);
|
|
2915
|
-
const
|
|
2916
|
-
if (!
|
|
2863
|
+
const u = c.querySelector("iframe");
|
|
2864
|
+
if (!u || u.loading !== "lazy")
|
|
2917
2865
|
return;
|
|
2918
|
-
const
|
|
2919
|
-
if (
|
|
2920
|
-
const h =
|
|
2866
|
+
const f = () => {
|
|
2867
|
+
if (u.src.includes("embed.figma.com")) {
|
|
2868
|
+
const h = u.cloneNode(!0);
|
|
2921
2869
|
h.loading = "eager", h.style.position = "absolute", h.style.opacity = "0", h.style.pointerEvents = "none", h.style.left = "-9999px", h.inert = !0, h.tabIndex = -1, h.addEventListener("load", () => {
|
|
2922
|
-
|
|
2870
|
+
u.replaceWith(h), h.style.position = "", h.style.opacity = "", h.style.pointerEvents = "", h.style.left = "", h.inert = !1, h.tabIndex = 0;
|
|
2923
2871
|
}), document.body.appendChild(h);
|
|
2924
2872
|
} else
|
|
2925
|
-
|
|
2873
|
+
u.loading = "eager";
|
|
2926
2874
|
};
|
|
2927
|
-
|
|
2875
|
+
qo().then(f);
|
|
2928
2876
|
});
|
|
2929
2877
|
});
|
|
2930
2878
|
}
|
|
2931
|
-
|
|
2932
|
-
normal: "theme-normal",
|
|
2933
|
-
light: "theme-light",
|
|
2934
|
-
dark: "theme-dark"
|
|
2935
|
-
}, Jo = (e) => {
|
|
2936
|
-
const t = window.matchMedia("(prefers-color-scheme: dark)");
|
|
2937
|
-
function n() {
|
|
2938
|
-
const o = localStorage.getItem(Ne);
|
|
2939
|
-
return o || localStorage.setItem(Ne, "normal"), o;
|
|
2940
|
-
}
|
|
2941
|
-
function s() {
|
|
2942
|
-
const o = n();
|
|
2943
|
-
let a = ve[o];
|
|
2944
|
-
o === "normal" && t.matches && (a = ve.dark);
|
|
2945
|
-
const l = (u) => {
|
|
2946
|
-
Object.values(ve).forEach((d) => u.classList.remove(d)), u.classList.remove("dark");
|
|
2947
|
-
}, f = (u) => {
|
|
2948
|
-
u.classList.add(a), a === ve.dark && u.classList.add("dark");
|
|
2949
|
-
};
|
|
2950
|
-
l(e), f(e);
|
|
2951
|
-
const c = document.querySelectorAll("iframe");
|
|
2952
|
-
c && c.forEach((u) => {
|
|
2953
|
-
l(u), f(u);
|
|
2954
|
-
}), l(document.body), f(document.body), Array.from(document.querySelectorAll("iframe")).filter((u) => u.src.includes("embed.figma.com")).forEach((u) => {
|
|
2955
|
-
const d = new URL(u.src);
|
|
2956
|
-
o === "normal" ? d.searchParams.set("theme", "system") : d.searchParams.set("theme", o), u.src = d.href;
|
|
2957
|
-
});
|
|
2958
|
-
}
|
|
2959
|
-
t.addEventListener("change", () => {
|
|
2960
|
-
n() === "normal" && s();
|
|
2961
|
-
}), s(), e.addEventListener("change", () => {
|
|
2962
|
-
const o = e.querySelector('input[name="theme"]:checked');
|
|
2963
|
-
if (!o)
|
|
2964
|
-
throw new Error("No selected theme found");
|
|
2965
|
-
const a = o.value;
|
|
2966
|
-
localStorage.setItem(Ne, a), s();
|
|
2967
|
-
});
|
|
2968
|
-
const r = n(), i = e.querySelector(`input[value="${r}"]`);
|
|
2969
|
-
if (!i)
|
|
2970
|
-
throw new Error("No current theme input found");
|
|
2971
|
-
i.checked = !0;
|
|
2972
|
-
};
|
|
2973
|
-
function sn(e, t, n, s) {
|
|
2879
|
+
function en(e, t, n, s) {
|
|
2974
2880
|
return t.navigator.platform.indexOf("Mac") === 0 && !e.includes("meta+ctrl") ? e.replace(n, s) : e;
|
|
2975
2881
|
}
|
|
2976
|
-
function
|
|
2882
|
+
function Ho() {
|
|
2977
2883
|
return [
|
|
2978
|
-
(e, t) =>
|
|
2979
|
-
(e, t) =>
|
|
2884
|
+
(e, t) => en(e, t, "meta", "ctrl"),
|
|
2885
|
+
(e, t) => en(e, t, "ctrl", "meta")
|
|
2980
2886
|
];
|
|
2981
2887
|
}
|
|
2982
2888
|
function j(e, t) {
|
|
@@ -2986,15 +2892,15 @@ function Ae(e) {
|
|
|
2986
2892
|
let t = e.closest('[focusgroup]:not([focusgroup="none"])');
|
|
2987
2893
|
if (t) return t;
|
|
2988
2894
|
}
|
|
2989
|
-
function
|
|
2895
|
+
function ve(e) {
|
|
2990
2896
|
if (e.hasAttribute("focusgroup"))
|
|
2991
2897
|
return [...e.querySelectorAll('*:not([focusgroup="none"])')].filter((n) => n.role === "button" || n.type === "button" || n.role === "checkbox" || n.type === "checkbox");
|
|
2992
2898
|
}
|
|
2993
|
-
function
|
|
2899
|
+
function Uo(e) {
|
|
2994
2900
|
let t = e.getAttribute("focusgroup");
|
|
2995
2901
|
if (t !== null) return !t.split(" ").includes("block");
|
|
2996
2902
|
}
|
|
2997
|
-
function
|
|
2903
|
+
function _o() {
|
|
2998
2904
|
return (e) => {
|
|
2999
2905
|
let t = !1;
|
|
3000
2906
|
function n(a) {
|
|
@@ -3003,8 +2909,8 @@ function ta() {
|
|
|
3003
2909
|
s();
|
|
3004
2910
|
return;
|
|
3005
2911
|
}
|
|
3006
|
-
let
|
|
3007
|
-
|
|
2912
|
+
let c = ve(l), u = Array.from(c).indexOf(a.target), f = "ArrowDown", d = "ArrowUp";
|
|
2913
|
+
Uo(l) && (e.document.dir === "rtl" ? (f = "ArrowLeft", d = "ArrowRight") : (f = "ArrowRight", d = "ArrowLeft")), a.key === f ? (a.preventDefault(), c[u + 1] ? j(a.target, c[u + 1]) : l.getAttribute("focusgroup").includes("wrap") && j(a.target, c[0])) : a.key === d ? (a.preventDefault(), c[u - 1] ? j(a.target, c[u - 1]) : l.getAttribute("focusgroup").includes("wrap") && j(a.target, c[c.length - 1])) : a.key === "Home" ? (a.preventDefault(), j(a.target, c[0])) : a.key === "End" && (a.preventDefault(), j(a.target, c[c.length - 1]));
|
|
3008
2914
|
}
|
|
3009
2915
|
function s() {
|
|
3010
2916
|
t = !1, e.removeEventListener("keydown", n);
|
|
@@ -3013,26 +2919,26 @@ function ta() {
|
|
|
3013
2919
|
let l = Ae(a.target);
|
|
3014
2920
|
if (l) {
|
|
3015
2921
|
t || (t = !0, e.addEventListener("keydown", n));
|
|
3016
|
-
let
|
|
3017
|
-
|
|
3018
|
-
|
|
3019
|
-
}) : (
|
|
3020
|
-
(
|
|
3021
|
-
),
|
|
2922
|
+
let c = ve(l);
|
|
2923
|
+
c.some((u) => u.getAttribute("tabindex") === "0") ? c.forEach((u) => {
|
|
2924
|
+
u !== a.target && u.setAttribute("tabindex", -1);
|
|
2925
|
+
}) : (c.forEach(
|
|
2926
|
+
(u, f) => u.setAttribute("tabindex", f === 0 ? 0 : -1)
|
|
2927
|
+
), c[0]?.focus());
|
|
3022
2928
|
} else t && s();
|
|
3023
2929
|
}
|
|
3024
2930
|
function i(a) {
|
|
3025
2931
|
let l = Ae(a.target);
|
|
3026
|
-
l?.getAttribute("focusgroup")?.includes("no-memory") &&
|
|
3027
|
-
|
|
2932
|
+
l?.getAttribute("focusgroup")?.includes("no-memory") && ve(l).forEach((u, f) => {
|
|
2933
|
+
u.setAttribute("tabindex", f === 0 ? 0 : -1);
|
|
3028
2934
|
}), (!a.relatedTarget || a.relatedTarget === e.document) && s();
|
|
3029
2935
|
}
|
|
3030
2936
|
function o(a) {
|
|
3031
2937
|
let l = Ae(a.target);
|
|
3032
2938
|
if (l) {
|
|
3033
|
-
let
|
|
3034
|
-
for (let
|
|
3035
|
-
|
|
2939
|
+
let c = ve(l);
|
|
2940
|
+
for (let u of c)
|
|
2941
|
+
u !== a.target && u.setAttribute("tabindex", -1);
|
|
3036
2942
|
a.target.setAttribute("tabindex", 0);
|
|
3037
2943
|
}
|
|
3038
2944
|
}
|
|
@@ -3041,7 +2947,7 @@ function ta() {
|
|
|
3041
2947
|
};
|
|
3042
2948
|
};
|
|
3043
2949
|
}
|
|
3044
|
-
let
|
|
2950
|
+
let jo = {
|
|
3045
2951
|
button: ["toolbar"],
|
|
3046
2952
|
checkbox: ["toolbar"],
|
|
3047
2953
|
menuitem: ["menu", "menubar"],
|
|
@@ -3051,20 +2957,20 @@ let na = {
|
|
|
3051
2957
|
function ie(e, t) {
|
|
3052
2958
|
t.tabIndex = 0, t.focus(), e.tabIndex = -1;
|
|
3053
2959
|
}
|
|
3054
|
-
function
|
|
2960
|
+
function Pe(e) {
|
|
3055
2961
|
let t = e.role || e.type || e.tagName;
|
|
3056
2962
|
if (!t) return null;
|
|
3057
|
-
let n =
|
|
2963
|
+
let n = jo[t.toLowerCase()];
|
|
3058
2964
|
if (!n) return null;
|
|
3059
2965
|
for (let s of n) {
|
|
3060
2966
|
let r = e.closest(`[role=${s}]`);
|
|
3061
2967
|
if (r) return r;
|
|
3062
2968
|
}
|
|
3063
2969
|
}
|
|
3064
|
-
function
|
|
3065
|
-
return t.role === "toolbar" ?
|
|
2970
|
+
function Ne(e, t) {
|
|
2971
|
+
return t.role === "toolbar" ? zo(t) : t.querySelectorAll(`[role=${e.role}]`);
|
|
3066
2972
|
}
|
|
3067
|
-
function
|
|
2973
|
+
function Go(e, t) {
|
|
3068
2974
|
return Array.from(e).filter((n) => {
|
|
3069
2975
|
let s = n.parentElement;
|
|
3070
2976
|
for (; s && s !== t; ) {
|
|
@@ -3075,70 +2981,70 @@ function sa(e, t) {
|
|
|
3075
2981
|
return !0;
|
|
3076
2982
|
});
|
|
3077
2983
|
}
|
|
3078
|
-
function
|
|
2984
|
+
function zo(e) {
|
|
3079
2985
|
return [...e.querySelectorAll("*")].filter((n) => n.role === "button" || n.type === "button" || n.role === "checkbox" || n.type === "checkbox");
|
|
3080
2986
|
}
|
|
3081
|
-
function
|
|
2987
|
+
function Yo(e) {
|
|
3082
2988
|
let t = e.getAttribute("aria-orientation");
|
|
3083
2989
|
if (t === "vertical") return !1;
|
|
3084
2990
|
if (t === "horizontal") return !0;
|
|
3085
2991
|
let n = e.role;
|
|
3086
2992
|
return n === "menubar" || n === "tablist" || n === "toolbar";
|
|
3087
2993
|
}
|
|
3088
|
-
function
|
|
2994
|
+
function Xo(e) {
|
|
3089
2995
|
return (t) => {
|
|
3090
2996
|
let n = !1, s = 300, r = 0, i = "";
|
|
3091
|
-
function o(
|
|
3092
|
-
let d =
|
|
2997
|
+
function o(f) {
|
|
2998
|
+
let d = Pe(f.target);
|
|
3093
2999
|
if (!d) {
|
|
3094
3000
|
a();
|
|
3095
3001
|
return;
|
|
3096
3002
|
}
|
|
3097
|
-
let h =
|
|
3098
|
-
if (
|
|
3099
|
-
|
|
3100
|
-
else if (
|
|
3101
|
-
|
|
3102
|
-
else if (
|
|
3103
|
-
|
|
3104
|
-
else if (
|
|
3105
|
-
|
|
3106
|
-
else if (
|
|
3107
|
-
|
|
3108
|
-
let x = Array.from(h).find((
|
|
3109
|
-
x && (
|
|
3003
|
+
let h = Ne(f.target, d), m = Go(h, d), y = Array.from(m).indexOf(f.target), T = "ArrowDown", b = "ArrowUp";
|
|
3004
|
+
if (Yo(d) && (t.document.dir === "rtl" ? (T = "ArrowLeft", b = "ArrowRight") : (T = "ArrowRight", b = "ArrowLeft")), f.key === T)
|
|
3005
|
+
f.preventDefault(), ie(f.target, m[y + 1] || m[0]);
|
|
3006
|
+
else if (f.key === b)
|
|
3007
|
+
f.preventDefault(), ie(f.target, m[y - 1] || m[m.length - 1]);
|
|
3008
|
+
else if (f.key === "Home")
|
|
3009
|
+
f.preventDefault(), ie(f.target, m[0]);
|
|
3010
|
+
else if (f.key === "End")
|
|
3011
|
+
f.preventDefault(), ie(f.target, m[m.length - 1]);
|
|
3012
|
+
else if (f.key.length === 1 && d.role !== "tablist") {
|
|
3013
|
+
f.timeStamp - r <= s ? i += f.key.toLowerCase() : i = f.key.toLowerCase(), r = f.timeStamp;
|
|
3014
|
+
let x = Array.from(h).find((A) => A.textContent?.trim()?.toLowerCase()?.startsWith(i));
|
|
3015
|
+
x && (f.preventDefault(), ie(f.target, x));
|
|
3110
3016
|
}
|
|
3111
3017
|
}
|
|
3112
3018
|
function a() {
|
|
3113
3019
|
n = !1, t.removeEventListener("keydown", o);
|
|
3114
3020
|
}
|
|
3115
|
-
function l(
|
|
3116
|
-
let d =
|
|
3021
|
+
function l(f) {
|
|
3022
|
+
let d = Pe(f.target);
|
|
3117
3023
|
if (d) {
|
|
3118
3024
|
n || (n = !0, t.addEventListener("keydown", o));
|
|
3119
|
-
let h =
|
|
3025
|
+
let h = Ne(f.target, d);
|
|
3120
3026
|
for (let m of h)
|
|
3121
|
-
m !==
|
|
3027
|
+
m !== f.target && m.setAttribute("tabindex", -1);
|
|
3122
3028
|
} else n && a();
|
|
3123
3029
|
}
|
|
3124
|
-
function f
|
|
3125
|
-
(!
|
|
3030
|
+
function c(f) {
|
|
3031
|
+
(!f.relatedTarget || f.relatedTarget === t.document) && a();
|
|
3126
3032
|
}
|
|
3127
|
-
function
|
|
3128
|
-
let d =
|
|
3033
|
+
function u(f) {
|
|
3034
|
+
let d = Pe(f.target);
|
|
3129
3035
|
if (d) {
|
|
3130
|
-
let h =
|
|
3036
|
+
let h = Ne(f.target, d);
|
|
3131
3037
|
for (let m of h)
|
|
3132
|
-
m !==
|
|
3133
|
-
|
|
3038
|
+
m !== f.target && m.setAttribute("tabindex", -1);
|
|
3039
|
+
f.target.setAttribute("tabindex", 0);
|
|
3134
3040
|
}
|
|
3135
3041
|
}
|
|
3136
|
-
return t.addEventListener("click",
|
|
3137
|
-
a(), t.removeEventListener("click",
|
|
3042
|
+
return t.addEventListener("click", u), t.addEventListener("focusin", l), t.addEventListener("focusout", c), () => {
|
|
3043
|
+
a(), t.removeEventListener("click", u), t.removeEventListener("focusin", l), t.removeEventListener("focusout", c);
|
|
3138
3044
|
};
|
|
3139
3045
|
};
|
|
3140
3046
|
}
|
|
3141
|
-
function
|
|
3047
|
+
function Zo() {
|
|
3142
3048
|
return (e) => {
|
|
3143
3049
|
let t, n;
|
|
3144
3050
|
function s(i) {
|
|
@@ -3158,28 +3064,28 @@ function aa() {
|
|
|
3158
3064
|
};
|
|
3159
3065
|
};
|
|
3160
3066
|
}
|
|
3161
|
-
let
|
|
3067
|
+
let Jo = /^[^\x00-\x7F]$/, Qo = {
|
|
3162
3068
|
checkbox: !0,
|
|
3163
3069
|
file: !0,
|
|
3164
3070
|
radio: !0
|
|
3165
|
-
},
|
|
3071
|
+
}, ea = {
|
|
3166
3072
|
button: !0,
|
|
3167
3073
|
reset: !0,
|
|
3168
3074
|
submit: !0
|
|
3169
|
-
},
|
|
3075
|
+
}, ta = {
|
|
3170
3076
|
" ": "space",
|
|
3171
3077
|
"+": "plus"
|
|
3172
3078
|
};
|
|
3173
|
-
function
|
|
3079
|
+
function bs(e, t) {
|
|
3174
3080
|
if (t.tagName !== "BODY" && e !== t)
|
|
3175
|
-
return t.hasAttribute("data-keyux-ignore-hotkeys") || t.getAttribute("aria-hidden") === "true" || t.hasAttribute("inert") ? !0 :
|
|
3081
|
+
return t.hasAttribute("data-keyux-ignore-hotkeys") || t.getAttribute("aria-hidden") === "true" || t.hasAttribute("inert") ? !0 : bs(e, t.parentNode);
|
|
3176
3082
|
}
|
|
3177
|
-
function
|
|
3083
|
+
function tn(e, t) {
|
|
3178
3084
|
for (let n of t)
|
|
3179
|
-
if (!
|
|
3085
|
+
if (!bs(e, n))
|
|
3180
3086
|
return n;
|
|
3181
3087
|
}
|
|
3182
|
-
function
|
|
3088
|
+
function nn(e, t, n) {
|
|
3183
3089
|
let s = t;
|
|
3184
3090
|
for (let [a] of n)
|
|
3185
3091
|
if (s = a(s, e), !s) return !1;
|
|
@@ -3191,34 +3097,34 @@ function on(e, t, n) {
|
|
|
3191
3097
|
if (l) return l;
|
|
3192
3098
|
}
|
|
3193
3099
|
}
|
|
3194
|
-
return
|
|
3100
|
+
return tn(
|
|
3195
3101
|
i,
|
|
3196
3102
|
i.querySelectorAll(`[aria-keyshortcuts="${s}" i]`)
|
|
3197
|
-
) ||
|
|
3103
|
+
) || tn(
|
|
3198
3104
|
r,
|
|
3199
3105
|
r.querySelectorAll(`[aria-keyshortcuts="${s}" i]`)
|
|
3200
3106
|
);
|
|
3201
3107
|
}
|
|
3202
|
-
function
|
|
3108
|
+
function na(e, t, n) {
|
|
3203
3109
|
let s = "";
|
|
3204
3110
|
e.metaKey && (s += "meta+"), e.ctrlKey && (s += "ctrl+"), e.altKey && (s += "alt+"), e.shiftKey && (s += "shift+");
|
|
3205
3111
|
let r = s;
|
|
3206
|
-
r +=
|
|
3207
|
-
let i =
|
|
3208
|
-
if (!i && (e.key.length > 1 ||
|
|
3112
|
+
r += ta[e.key] ?? e.key.toLowerCase();
|
|
3113
|
+
let i = nn(t, r, n);
|
|
3114
|
+
if (!i && (e.key.length > 1 || Jo.test(e.key)) && /^(Key.|Digit\d)$/.test(e.code)) {
|
|
3209
3115
|
let o = e.code.replace(/^Key|^Digit/, "").toLowerCase();
|
|
3210
|
-
i =
|
|
3116
|
+
i = nn(t, s + o, n);
|
|
3211
3117
|
}
|
|
3212
3118
|
return i;
|
|
3213
3119
|
}
|
|
3214
|
-
function
|
|
3120
|
+
function sa(e = []) {
|
|
3215
3121
|
return (t) => {
|
|
3216
3122
|
function n(s) {
|
|
3217
|
-
let r = s.ctrlKey || s.metaKey || s.altKey, i = s.target.isContentEditable || s.target.tagName === "TEXTAREA" || s.target.tagName === "INPUT" && !
|
|
3123
|
+
let r = s.ctrlKey || s.metaKey || s.altKey, i = s.target.isContentEditable || s.target.tagName === "TEXTAREA" || s.target.tagName === "INPUT" && !Qo[s.target.type], o = s.target.role === "menuitem";
|
|
3218
3124
|
if (!r && (i || o))
|
|
3219
3125
|
return;
|
|
3220
|
-
let a =
|
|
3221
|
-
a && (a.tagName === "TEXTAREA" || a.tagName === "INPUT" && !
|
|
3126
|
+
let a = na(s, t, e);
|
|
3127
|
+
a && (a.tagName === "TEXTAREA" || a.tagName === "INPUT" && !ea[a.type] ? setTimeout(() => {
|
|
3222
3128
|
a.focus();
|
|
3223
3129
|
}) : a.click());
|
|
3224
3130
|
}
|
|
@@ -3227,12 +3133,12 @@ function ha(e = []) {
|
|
|
3227
3133
|
};
|
|
3228
3134
|
};
|
|
3229
3135
|
}
|
|
3230
|
-
function
|
|
3136
|
+
function ra() {
|
|
3231
3137
|
return (e) => {
|
|
3232
3138
|
let t = [];
|
|
3233
3139
|
function n(l) {
|
|
3234
|
-
let
|
|
3235
|
-
|
|
3140
|
+
let c = e.document.activeElement;
|
|
3141
|
+
c && c !== e.document.body && t.push(new WeakRef(c)), l.focus({ focusVisible: !0 });
|
|
3236
3142
|
}
|
|
3237
3143
|
function s() {
|
|
3238
3144
|
let l = t.pop();
|
|
@@ -3240,26 +3146,26 @@ function ma() {
|
|
|
3240
3146
|
e.document.activeElement.blur();
|
|
3241
3147
|
return;
|
|
3242
3148
|
}
|
|
3243
|
-
let
|
|
3244
|
-
|
|
3149
|
+
let c = l.deref();
|
|
3150
|
+
c && c.isConnected ? c.focus() : s();
|
|
3245
3151
|
}
|
|
3246
3152
|
let r = 0, i;
|
|
3247
3153
|
function o(l) {
|
|
3248
3154
|
clearInterval(i);
|
|
3249
|
-
let
|
|
3155
|
+
let c = l.getAttribute("aria-controls");
|
|
3250
3156
|
i = setInterval(() => {
|
|
3251
3157
|
if (r++ > 50) {
|
|
3252
3158
|
clearInterval(i);
|
|
3253
3159
|
return;
|
|
3254
3160
|
}
|
|
3255
|
-
let
|
|
3256
|
-
if (
|
|
3257
|
-
let
|
|
3161
|
+
let u = e.document.getElementById(c);
|
|
3162
|
+
if (u) {
|
|
3163
|
+
let f = u.querySelector(
|
|
3258
3164
|
'a, button, select, textarea, input:not([type=radio]), [type=radio]:checked, [tabindex]:not([tabindex="-1"])'
|
|
3259
3165
|
);
|
|
3260
|
-
|
|
3166
|
+
f && (clearInterval(i), u.dispatchEvent(
|
|
3261
3167
|
new e.CustomEvent("keyuxJump", { bubbles: !0 })
|
|
3262
|
-
), n(
|
|
3168
|
+
), n(f));
|
|
3263
3169
|
}
|
|
3264
3170
|
}, 50);
|
|
3265
3171
|
}
|
|
@@ -3271,25 +3177,25 @@ function ma() {
|
|
|
3271
3177
|
};
|
|
3272
3178
|
};
|
|
3273
3179
|
}
|
|
3274
|
-
function
|
|
3180
|
+
function ia(e, t) {
|
|
3275
3181
|
let n = t.map((s) => s(e));
|
|
3276
3182
|
return () => {
|
|
3277
3183
|
n.forEach((s) => s());
|
|
3278
3184
|
};
|
|
3279
3185
|
}
|
|
3280
|
-
const
|
|
3281
|
-
|
|
3282
|
-
|
|
3283
|
-
|
|
3284
|
-
|
|
3285
|
-
|
|
3286
|
-
|
|
3186
|
+
const oa = Ho();
|
|
3187
|
+
ia(window, [
|
|
3188
|
+
sa([oa]),
|
|
3189
|
+
Xo(),
|
|
3190
|
+
_o(),
|
|
3191
|
+
ra(),
|
|
3192
|
+
Zo()
|
|
3287
3193
|
]);
|
|
3288
|
-
function
|
|
3194
|
+
function aa() {
|
|
3289
3195
|
const e = navigator.userAgent.toLowerCase();
|
|
3290
3196
|
return e.includes("mac") ? "mac" : e.includes("linux") ? "linux" : e.includes("win") ? "windows" : "unknown";
|
|
3291
3197
|
}
|
|
3292
|
-
function
|
|
3198
|
+
function la() {
|
|
3293
3199
|
const e = document.querySelectorAll("iframe"), t = document.querySelector("#styleguide-previous"), n = document.querySelector("#styleguide-next"), s = (r) => {
|
|
3294
3200
|
const i = document.activeElement instanceof HTMLButtonElement, o = document.activeElement instanceof HTMLInputElement, a = document.activeElement instanceof HTMLTextAreaElement;
|
|
3295
3201
|
i || o || a || r.metaKey || r.ctrlKey || (t && r.key === "ArrowLeft" && (r.preventDefault(), t.click()), n && r.key === "ArrowRight" && (r.preventDefault(), n.click()));
|
|
@@ -3299,7 +3205,7 @@ function ba() {
|
|
|
3299
3205
|
i && i.addEventListener("keydown", s);
|
|
3300
3206
|
}), window.addEventListener("keydown", s);
|
|
3301
3207
|
}
|
|
3302
|
-
function
|
|
3208
|
+
function ua() {
|
|
3303
3209
|
const e = document.querySelectorAll("iframe"), t = (n) => {
|
|
3304
3210
|
n.key === "k" && (n.metaKey || n.ctrlKey) && (n.preventDefault(), window.dispatchEvent(new Event("styleguideOpenSearch")));
|
|
3305
3211
|
};
|
|
@@ -3308,13 +3214,13 @@ function wa() {
|
|
|
3308
3214
|
s && s.addEventListener("keydown", t);
|
|
3309
3215
|
}), window.addEventListener("keydown", t);
|
|
3310
3216
|
}
|
|
3311
|
-
const
|
|
3312
|
-
document.body.setAttribute("data-os",
|
|
3313
|
-
const
|
|
3314
|
-
document.body.setAttribute("data-is-mobile", String(
|
|
3315
|
-
|
|
3316
|
-
|
|
3317
|
-
function
|
|
3217
|
+
const ca = aa();
|
|
3218
|
+
document.body.setAttribute("data-os", ca);
|
|
3219
|
+
const fa = "ontouchstart" in window || navigator.maxTouchPoints > 0;
|
|
3220
|
+
document.body.setAttribute("data-is-mobile", String(fa));
|
|
3221
|
+
la();
|
|
3222
|
+
ua();
|
|
3223
|
+
function da() {
|
|
3318
3224
|
const e = document.querySelector("header");
|
|
3319
3225
|
if (!e)
|
|
3320
3226
|
throw new Error("No header found");
|
|
@@ -3323,7 +3229,7 @@ function Aa() {
|
|
|
3323
3229
|
document.documentElement.style.setProperty("--header-height", `${t()}px`);
|
|
3324
3230
|
});
|
|
3325
3231
|
}
|
|
3326
|
-
function
|
|
3232
|
+
function ha() {
|
|
3327
3233
|
const e = document.querySelector("aside");
|
|
3328
3234
|
if (!e)
|
|
3329
3235
|
throw new Error("No aside menu found");
|
|
@@ -3340,92 +3246,88 @@ function Sa() {
|
|
|
3340
3246
|
}
|
|
3341
3247
|
window.addEventListener("resize", t), t();
|
|
3342
3248
|
}
|
|
3343
|
-
|
|
3344
|
-
|
|
3345
|
-
const
|
|
3346
|
-
if (!
|
|
3249
|
+
da();
|
|
3250
|
+
ha();
|
|
3251
|
+
const ws = document.querySelector("#search-dialog");
|
|
3252
|
+
if (!ws)
|
|
3347
3253
|
throw new Error("No search dialog found");
|
|
3348
|
-
const
|
|
3349
|
-
if (!
|
|
3254
|
+
const Ts = document.querySelector(".dialog-backdrop");
|
|
3255
|
+
if (!Ts)
|
|
3350
3256
|
throw new Error("No dialog backdrop found");
|
|
3351
|
-
const
|
|
3352
|
-
if (
|
|
3257
|
+
const Tt = document.querySelectorAll("[data-open-search]");
|
|
3258
|
+
if (Tt.length === 0)
|
|
3353
3259
|
throw new Error("No open search buttons found");
|
|
3354
3260
|
const Y = document.querySelector("#search-input");
|
|
3355
3261
|
if (!Y)
|
|
3356
3262
|
throw new Error("No search input found");
|
|
3357
|
-
const
|
|
3358
|
-
if (!
|
|
3263
|
+
const As = document.querySelector("#search-list");
|
|
3264
|
+
if (!As)
|
|
3359
3265
|
throw new Error("No search list found");
|
|
3360
|
-
const
|
|
3361
|
-
if (!
|
|
3266
|
+
const vs = document.querySelectorAll(".search-category__item--active");
|
|
3267
|
+
if (!vs)
|
|
3362
3268
|
throw new Error("No search results found");
|
|
3363
|
-
const
|
|
3364
|
-
if (!
|
|
3269
|
+
const Ss = document.querySelector("#search-no-results");
|
|
3270
|
+
if (!Ss)
|
|
3365
3271
|
throw new Error("No search no results element found");
|
|
3366
|
-
const { show:
|
|
3367
|
-
async function
|
|
3368
|
-
await
|
|
3272
|
+
const { show: ma } = ys(ws, Ts);
|
|
3273
|
+
async function xs() {
|
|
3274
|
+
await ma(
|
|
3369
3275
|
(e) => {
|
|
3370
3276
|
e && Y.setAttribute("inert", "");
|
|
3371
3277
|
},
|
|
3372
3278
|
(e) => {
|
|
3373
|
-
e && Y.removeAttribute("inert"),
|
|
3279
|
+
e && Y.removeAttribute("inert"), Tt.forEach((t) => t.ariaExpanded = "true"), Y.ariaExpanded = "true", Es();
|
|
3374
3280
|
}
|
|
3375
3281
|
);
|
|
3376
3282
|
}
|
|
3377
|
-
function
|
|
3283
|
+
function Es() {
|
|
3378
3284
|
const e = Y.value.toLowerCase().trim();
|
|
3379
3285
|
let t = !1;
|
|
3380
|
-
|
|
3286
|
+
vs.forEach((n) => {
|
|
3381
3287
|
let s;
|
|
3382
3288
|
const r = n.getAttribute("data-search-keywords")?.split(",") || [];
|
|
3383
3289
|
r.length > 0 ? s = r.some((i) => i.toLowerCase().includes(e)) : s = (n.textContent?.toLowerCase() ?? "")?.includes(e), n.classList.toggle("search-category__item--active", s), s && (t = !0);
|
|
3384
|
-
}),
|
|
3385
|
-
}
|
|
3386
|
-
Y.addEventListener("input",
|
|
3387
|
-
|
|
3388
|
-
window.addEventListener("styleguideOpenSearch",
|
|
3389
|
-
const
|
|
3390
|
-
|
|
3391
|
-
const ln = document.querySelector(".theme-select");
|
|
3392
|
-
ln && Jo(ln);
|
|
3393
|
-
const Ea = document.querySelectorAll(".styleguide-section");
|
|
3394
|
-
Ea.forEach((e) => {
|
|
3290
|
+
}), As.classList.toggle("hidden", !t), Ss.classList.toggle("hidden", t);
|
|
3291
|
+
}
|
|
3292
|
+
Y.addEventListener("input", Es);
|
|
3293
|
+
Tt.forEach((e) => e.addEventListener("click", xs));
|
|
3294
|
+
window.addEventListener("styleguideOpenSearch", xs);
|
|
3295
|
+
const pa = document.querySelectorAll(".styleguide-section");
|
|
3296
|
+
pa.forEach((e) => {
|
|
3395
3297
|
new ResizeObserver(() => {
|
|
3396
3298
|
const t = e.scrollHeight > 600;
|
|
3397
3299
|
e.classList.toggle("styleguide-section--large", t);
|
|
3398
3300
|
}).observe(e);
|
|
3399
3301
|
});
|
|
3400
|
-
const
|
|
3401
|
-
|
|
3402
|
-
const
|
|
3403
|
-
|
|
3302
|
+
const sn = document.querySelectorAll(".tabs");
|
|
3303
|
+
sn.length > 0 && Wo(sn);
|
|
3304
|
+
const rn = document.querySelectorAll("details:has(.code-highlight)");
|
|
3305
|
+
rn.length > 0 && rn.forEach((e) => {
|
|
3404
3306
|
const t = e.querySelector(".code-highlight");
|
|
3405
3307
|
if (!t)
|
|
3406
3308
|
throw new Error("No code element found");
|
|
3407
|
-
|
|
3309
|
+
Ro(t).catch(console.error);
|
|
3408
3310
|
});
|
|
3409
|
-
const
|
|
3410
|
-
|
|
3411
|
-
const { auditCode: e } = await import("./html-validator-
|
|
3412
|
-
|
|
3413
|
-
|
|
3311
|
+
const Se = document.querySelectorAll("[data-code-audit-iframe]"), Re = document.querySelector("#code-audit-dialog"), on = document.querySelector(".dialog-backdrop");
|
|
3312
|
+
Se.length > 0 && Re && on && (async () => {
|
|
3313
|
+
const { auditCode: e } = await import("./html-validator-M0X8x6ag.js"), { show: t, close: n } = ys(Re, on);
|
|
3314
|
+
Se.forEach((s) => s.addEventListener("click", async () => {
|
|
3315
|
+
Se.forEach((r) => r.setAttribute("aria-expanded", "false")), s.setAttribute("disabled", ""), await e(s, Re, n), s.removeAttribute("disabled"), s.setAttribute("aria-expanded", "true"), await t(
|
|
3414
3316
|
void 0,
|
|
3415
3317
|
() => {
|
|
3416
|
-
|
|
3318
|
+
Se.forEach((r) => {
|
|
3417
3319
|
r.setAttribute("aria-expanded", "false");
|
|
3418
3320
|
});
|
|
3419
3321
|
}
|
|
3420
3322
|
);
|
|
3421
3323
|
}));
|
|
3422
3324
|
})();
|
|
3423
|
-
const
|
|
3424
|
-
|
|
3425
|
-
const
|
|
3426
|
-
|
|
3427
|
-
const
|
|
3428
|
-
|
|
3325
|
+
const an = document.querySelector("#icon-search-input"), ln = document.querySelector("#icon-search-input-reset"), un = document.querySelector("#icon-search-list");
|
|
3326
|
+
an && un && ln && import("./icons-IQYIngUi.js").then(({ default: e }) => e(an, un, ln)).catch(console.error);
|
|
3327
|
+
const Vs = "data-clipboard-value", cn = document.querySelectorAll(`button[${Vs}]`);
|
|
3328
|
+
cn.length > 0 && import("./clipboard-CQ7U7_P0.js").then(({ default: e }) => e(cn, Vs)).catch(console.error);
|
|
3329
|
+
const fn = document.querySelectorAll(".markdown-container-folded");
|
|
3330
|
+
fn.length > 0 && fn.forEach((e) => {
|
|
3429
3331
|
const t = e.querySelector(".markdown-container");
|
|
3430
3332
|
if (!t)
|
|
3431
3333
|
throw new Error("No markdown container found");
|
|
@@ -3435,7 +3337,7 @@ gn.length > 0 && gn.forEach((e) => {
|
|
|
3435
3337
|
const s = e.querySelector(".markdown-show-more");
|
|
3436
3338
|
if (!s)
|
|
3437
3339
|
throw new Error("No show more button found");
|
|
3438
|
-
const { $isOverflowingVertically: r } =
|
|
3340
|
+
const { $isOverflowingVertically: r } = $o(e), i = () => {
|
|
3439
3341
|
const a = t.scrollHeight > t.clientHeight;
|
|
3440
3342
|
n.classList.toggle("hidden", !a);
|
|
3441
3343
|
};
|
|
@@ -3453,17 +3355,17 @@ gn.length > 0 && gn.forEach((e) => {
|
|
|
3453
3355
|
}, { duration: 0.5 }).then(() => n.classList.add("hidden"));
|
|
3454
3356
|
});
|
|
3455
3357
|
});
|
|
3456
|
-
let
|
|
3358
|
+
let xe;
|
|
3457
3359
|
window.addEventListener("scroll", () => {
|
|
3458
|
-
|
|
3360
|
+
xe && (clearTimeout(xe), xe = void 0), document.body.classList.contains("is-scrolling") || document.body.classList.add("is-scrolling"), xe = setTimeout(() => {
|
|
3459
3361
|
document.body.classList.remove("is-scrolling");
|
|
3460
3362
|
}, 250);
|
|
3461
3363
|
});
|
|
3462
|
-
const
|
|
3463
|
-
|
|
3364
|
+
const dn = document.querySelector(".editor-select");
|
|
3365
|
+
dn && import("./editor-select-Bzw7rF0M.js").then(({ default: e }) => e(dn)).catch(console.error);
|
|
3464
3366
|
export {
|
|
3465
3367
|
L as a,
|
|
3466
|
-
|
|
3467
|
-
|
|
3368
|
+
Bo as b,
|
|
3369
|
+
Ro as h,
|
|
3468
3370
|
X as s
|
|
3469
3371
|
};
|