@spear-ai/spectral 1.4.18 → 1.4.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/ButtonGroup/ButtonGroupButton.js +8 -8
- package/dist/InputGroup.d.ts +1 -1
- package/dist/Tabs.js +5 -10
- package/dist/Toggle.d.ts +2 -1
- package/dist/Toggle.js +25 -18
- package/dist/ToggleGroup.d.ts +3 -1
- package/dist/ToggleGroup.js +32 -32
- package/dist/Tray.js +282 -282
- package/dist/main.js +10 -10
- package/dist/styles/main.css +1 -1
- package/dist/utils/twUtils.js +530 -497
- package/package.json +38 -38
package/dist/Tray.js
CHANGED
|
@@ -67,11 +67,11 @@ import "./Icons/ZoomYIcon.js";
|
|
|
67
67
|
import { cn as rt } from "./utils/twUtils.js";
|
|
68
68
|
import { c as $r } from "./index-D29mdTf5.js";
|
|
69
69
|
import * as re from "react";
|
|
70
|
-
import { createContext as mt, useRef as
|
|
70
|
+
import { createContext as mt, useRef as $, useLayoutEffect as zr, useEffect as nt, useId as Ye, useContext as I, useInsertionEffect as Zi, useMemo as Y, useCallback as Ji, Children as Hr, isValidElement as _r, useState as Ae, Fragment as Qi, createElement as Gr, forwardRef as q, Component as Xr } from "react";
|
|
71
71
|
import { D as Pt } from "./index-jgQ7sgLl.js";
|
|
72
72
|
const qe = mt({});
|
|
73
73
|
function Ze(t) {
|
|
74
|
-
const e =
|
|
74
|
+
const e = $(null);
|
|
75
75
|
return e.current === null && (e.current = t()), e.current;
|
|
76
76
|
}
|
|
77
77
|
const Je = typeof window < "u", ts = Je ? zr : nt, oe = /* @__PURE__ */ mt(null);
|
|
@@ -105,7 +105,7 @@ function en(t) {
|
|
|
105
105
|
let e;
|
|
106
106
|
return () => (e === void 0 && (e = t()), e);
|
|
107
107
|
}
|
|
108
|
-
const
|
|
108
|
+
const z = /* @__NO_SIDE_EFFECTS__ */ (t) => t, Yr = (t, e) => (n) => e(t(n)), Kt = (...t) => t.reduce(Yr), Ft = /* @__NO_SIDE_EFFECTS__ */ (t, e, n) => {
|
|
109
109
|
const i = e - t;
|
|
110
110
|
return i === 0 ? 1 : (n - t) / i;
|
|
111
111
|
};
|
|
@@ -134,7 +134,7 @@ class nn {
|
|
|
134
134
|
this.subscriptions.length = 0;
|
|
135
135
|
}
|
|
136
136
|
}
|
|
137
|
-
const G = /* @__NO_SIDE_EFFECTS__ */ (t) => t * 1e3,
|
|
137
|
+
const G = /* @__NO_SIDE_EFFECTS__ */ (t) => t * 1e3, W = /* @__NO_SIDE_EFFECTS__ */ (t) => t / 1e3;
|
|
138
138
|
function ss(t, e) {
|
|
139
139
|
return e ? t * (1e3 / e) : 0;
|
|
140
140
|
}
|
|
@@ -150,14 +150,14 @@ function Jr(t, e, n, i, s) {
|
|
|
150
150
|
while (Math.abs(o) > qr && ++a < Zr);
|
|
151
151
|
return r;
|
|
152
152
|
}
|
|
153
|
-
function
|
|
153
|
+
function Wt(t, e, n, i) {
|
|
154
154
|
if (t === e && n === i)
|
|
155
|
-
return
|
|
155
|
+
return z;
|
|
156
156
|
const s = (o) => Jr(o, 0, 1, t, n);
|
|
157
157
|
return (o) => o === 0 || o === 1 ? o : rs(s(o), e, i);
|
|
158
158
|
}
|
|
159
|
-
const os = (t) => (e) => e <= 0.5 ? t(2 * e) / 2 : (2 - t(2 * (1 - e))) / 2, as = (t) => (e) => 1 - t(1 - e), ls = /* @__PURE__ */
|
|
160
|
-
linear:
|
|
159
|
+
const os = (t) => (e) => e <= 0.5 ? t(2 * e) / 2 : (2 - t(2 * (1 - e))) / 2, as = (t) => (e) => 1 - t(1 - e), ls = /* @__PURE__ */ Wt(0.33, 1.53, 0.69, 0.99), rn = /* @__PURE__ */ as(ls), cs = /* @__PURE__ */ os(rn), us = (t) => (t *= 2) < 1 ? 0.5 * rn(t) : 0.5 * (2 - Math.pow(2, -10 * (t - 1))), on = (t) => 1 - Math.sin(Math.acos(t)), hs = as(on), fs = os(on), Qr = /* @__PURE__ */ Wt(0.42, 0, 1, 1), to = /* @__PURE__ */ Wt(0, 0, 0.58, 1), ds = /* @__PURE__ */ Wt(0.42, 0, 0.58, 1), eo = (t) => Array.isArray(t) && typeof t[0] != "number", ms = (t) => Array.isArray(t) && typeof t[0] == "number", Fn = {
|
|
160
|
+
linear: z,
|
|
161
161
|
easeIn: Qr,
|
|
162
162
|
easeInOut: ds,
|
|
163
163
|
easeOut: to,
|
|
@@ -168,15 +168,15 @@ const os = (t) => (e) => e <= 0.5 ? t(2 * e) / 2 : (2 - t(2 * (1 - e))) / 2, as
|
|
|
168
168
|
backInOut: cs,
|
|
169
169
|
backOut: ls,
|
|
170
170
|
anticipate: us
|
|
171
|
-
}, no = (t) => typeof t == "string",
|
|
171
|
+
}, no = (t) => typeof t == "string", In = (t) => {
|
|
172
172
|
if (ms(t)) {
|
|
173
173
|
J(t.length === 4, "Cubic bezier arrays must contain four numerical values.", "cubic-bezier-length");
|
|
174
174
|
const [e, n, i, s] = t;
|
|
175
|
-
return
|
|
175
|
+
return Wt(e, n, i, s);
|
|
176
176
|
} else if (no(t))
|
|
177
177
|
return J(Fn[t] !== void 0, `Invalid easing type '${t}'`, "invalid-easing-type"), Fn[t];
|
|
178
178
|
return t;
|
|
179
|
-
},
|
|
179
|
+
}, Ht = [
|
|
180
180
|
"setup",
|
|
181
181
|
// Compute
|
|
182
182
|
"read",
|
|
@@ -239,29 +239,29 @@ function ps(t, e) {
|
|
|
239
239
|
delta: 0,
|
|
240
240
|
timestamp: 0,
|
|
241
241
|
isProcessing: !1
|
|
242
|
-
}, o = () => n = !0, r =
|
|
242
|
+
}, o = () => n = !0, r = Ht.reduce((y, P) => (y[P] = io(o), y), {}), { setup: a, read: l, resolveKeyframes: u, preUpdate: c, update: h, preRender: f, render: d, postRender: m } = r, g = () => {
|
|
243
243
|
const y = Q.useManualTiming ? s.timestamp : performance.now();
|
|
244
244
|
n = !1, Q.useManualTiming || (s.delta = i ? 1e3 / 60 : Math.max(Math.min(y - s.timestamp, so), 1)), s.timestamp = y, s.isProcessing = !0, a.process(s), l.process(s), u.process(s), c.process(s), h.process(s), f.process(s), d.process(s), m.process(s), s.isProcessing = !1, n && e && (i = !1, t(g));
|
|
245
245
|
}, v = () => {
|
|
246
246
|
n = !0, i = !0, s.isProcessing || t(g);
|
|
247
247
|
};
|
|
248
|
-
return { schedule:
|
|
248
|
+
return { schedule: Ht.reduce((y, P) => {
|
|
249
249
|
const x = r[P];
|
|
250
250
|
return y[P] = (S, A = !1, b = !1) => (n || v(), x.schedule(S, A, b)), y;
|
|
251
251
|
}, {}), cancel: (y) => {
|
|
252
|
-
for (let P = 0; P <
|
|
253
|
-
r[
|
|
252
|
+
for (let P = 0; P < Ht.length; P++)
|
|
253
|
+
r[Ht[P]].cancel(y);
|
|
254
254
|
}, state: s, steps: r };
|
|
255
255
|
}
|
|
256
|
-
const { schedule: C, cancel: it, state: F, steps: ue } = /* @__PURE__ */ ps(typeof requestAnimationFrame < "u" ? requestAnimationFrame :
|
|
257
|
-
let
|
|
256
|
+
const { schedule: C, cancel: it, state: F, steps: ue } = /* @__PURE__ */ ps(typeof requestAnimationFrame < "u" ? requestAnimationFrame : z, !0);
|
|
257
|
+
let Yt;
|
|
258
258
|
function ro() {
|
|
259
|
-
|
|
259
|
+
Yt = void 0;
|
|
260
260
|
}
|
|
261
261
|
const N = {
|
|
262
|
-
now: () => (
|
|
262
|
+
now: () => (Yt === void 0 && N.set(F.isProcessing || Q.useManualTiming ? F.timestamp : performance.now()), Yt),
|
|
263
263
|
set: (t) => {
|
|
264
|
-
|
|
264
|
+
Yt = t, queueMicrotask(ro);
|
|
265
265
|
}
|
|
266
266
|
}, gs = (t) => (e) => typeof e == "string" && e.startsWith(t), an = /* @__PURE__ */ gs("--"), oo = /* @__PURE__ */ gs("var(--"), ln = (t) => oo(t) ? ao.test(t.split("/*")[0].trim()) : !1, ao = /var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu, Ct = {
|
|
267
267
|
test: (t) => typeof t == "number",
|
|
@@ -270,7 +270,7 @@ const N = {
|
|
|
270
270
|
}, It = {
|
|
271
271
|
...Ct,
|
|
272
272
|
transform: (t) => Z(0, 1, t)
|
|
273
|
-
},
|
|
273
|
+
}, _t = {
|
|
274
274
|
...Ct,
|
|
275
275
|
default: 1
|
|
276
276
|
}, Lt = (t) => Math.round(t * 1e5) / 1e5, cn = /-?(?:\d+(?:\.\d+)?|\.\d+)/gu;
|
|
@@ -308,11 +308,11 @@ const Ce = {
|
|
|
308
308
|
test: /* @__PURE__ */ un("#"),
|
|
309
309
|
parse: ho,
|
|
310
310
|
transform: ut.transform
|
|
311
|
-
},
|
|
311
|
+
}, $t = /* @__NO_SIDE_EFFECTS__ */ (t) => ({
|
|
312
312
|
test: (e) => typeof e == "string" && e.endsWith(t) && e.split(" ").length === 1,
|
|
313
313
|
parse: parseFloat,
|
|
314
314
|
transform: (e) => `${e}${t}`
|
|
315
|
-
}), et = /* @__PURE__ */
|
|
315
|
+
}), et = /* @__PURE__ */ $t("deg"), X = /* @__PURE__ */ $t("%"), w = /* @__PURE__ */ $t("px"), fo = /* @__PURE__ */ $t("vh"), mo = /* @__PURE__ */ $t("vw"), On = {
|
|
316
316
|
...X,
|
|
317
317
|
parse: (t) => X.parse(t) / 100,
|
|
318
318
|
transform: (t) => X.transform(t * 100)
|
|
@@ -320,45 +320,45 @@ const Ce = {
|
|
|
320
320
|
test: /* @__PURE__ */ un("hsl", "hue"),
|
|
321
321
|
parse: /* @__PURE__ */ ys("hue", "saturation", "lightness"),
|
|
322
322
|
transform: ({ hue: t, saturation: e, lightness: n, alpha: i = 1 }) => "hsla(" + Math.round(t) + ", " + X.transform(Lt(e)) + ", " + X.transform(Lt(n)) + ", " + Lt(It.transform(i)) + ")"
|
|
323
|
-
},
|
|
323
|
+
}, L = {
|
|
324
324
|
test: (t) => ut.test(t) || Ce.test(t) || gt.test(t),
|
|
325
325
|
parse: (t) => ut.test(t) ? ut.parse(t) : gt.test(t) ? gt.parse(t) : Ce.parse(t),
|
|
326
326
|
transform: (t) => typeof t == "string" ? t : t.hasOwnProperty("red") ? ut.transform(t) : gt.transform(t),
|
|
327
327
|
getAnimatableNone: (t) => {
|
|
328
|
-
const e =
|
|
329
|
-
return e.alpha = 0,
|
|
328
|
+
const e = L.parse(t);
|
|
329
|
+
return e.alpha = 0, L.transform(e);
|
|
330
330
|
}
|
|
331
331
|
}, po = /(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;
|
|
332
332
|
function go(t) {
|
|
333
333
|
return isNaN(t) && typeof t == "string" && (t.match(cn)?.length || 0) + (t.match(po)?.length || 0) > 0;
|
|
334
334
|
}
|
|
335
335
|
const vs = "number", Ts = "color", yo = "var", vo = "var(", jn = "${}", To = /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;
|
|
336
|
-
function
|
|
336
|
+
function Ot(t) {
|
|
337
337
|
const e = t.toString(), n = [], i = {
|
|
338
338
|
color: [],
|
|
339
339
|
number: [],
|
|
340
340
|
var: []
|
|
341
341
|
}, s = [];
|
|
342
342
|
let o = 0;
|
|
343
|
-
const a = e.replace(To, (l) => (
|
|
343
|
+
const a = e.replace(To, (l) => (L.test(l) ? (i.color.push(o), s.push(Ts), n.push(L.parse(l))) : l.startsWith(vo) ? (i.var.push(o), s.push(yo), n.push(l)) : (i.number.push(o), s.push(vs), n.push(parseFloat(l))), ++o, jn)).split(jn);
|
|
344
344
|
return { values: n, split: a, indexes: i, types: s };
|
|
345
345
|
}
|
|
346
346
|
function xs(t) {
|
|
347
|
-
return
|
|
347
|
+
return Ot(t).values;
|
|
348
348
|
}
|
|
349
349
|
function ws(t) {
|
|
350
|
-
const { split: e, types: n } =
|
|
350
|
+
const { split: e, types: n } = Ot(t), i = e.length;
|
|
351
351
|
return (s) => {
|
|
352
352
|
let o = "";
|
|
353
353
|
for (let r = 0; r < i; r++)
|
|
354
354
|
if (o += e[r], s[r] !== void 0) {
|
|
355
355
|
const a = n[r];
|
|
356
|
-
a === vs ? o += Lt(s[r]) : a === Ts ? o +=
|
|
356
|
+
a === vs ? o += Lt(s[r]) : a === Ts ? o += L.transform(s[r]) : o += s[r];
|
|
357
357
|
}
|
|
358
358
|
return o;
|
|
359
359
|
};
|
|
360
360
|
}
|
|
361
|
-
const xo = (t) => typeof t == "number" ? 0 :
|
|
361
|
+
const xo = (t) => typeof t == "number" ? 0 : L.test(t) ? L.getAnimatableNone(t) : t;
|
|
362
362
|
function wo(t) {
|
|
363
363
|
const e = xs(t);
|
|
364
364
|
return ws(t)(e.map(xo));
|
|
@@ -388,7 +388,7 @@ function bo({ hue: t, saturation: e, lightness: n, alpha: i }) {
|
|
|
388
388
|
alpha: i
|
|
389
389
|
};
|
|
390
390
|
}
|
|
391
|
-
function
|
|
391
|
+
function Qt(t, e) {
|
|
392
392
|
return (n) => n > 0 ? e : t;
|
|
393
393
|
}
|
|
394
394
|
const M = (t, e, n) => t + (e - t) * n, de = (t, e, n) => {
|
|
@@ -405,7 +405,7 @@ function Nn(t) {
|
|
|
405
405
|
const Un = (t, e) => {
|
|
406
406
|
const n = Nn(t), i = Nn(e);
|
|
407
407
|
if (!n || !i)
|
|
408
|
-
return
|
|
408
|
+
return Qt(t, e);
|
|
409
409
|
const s = { ...n };
|
|
410
410
|
return (o) => (s.red = de(n.red, i.red, o), s.green = de(n.green, i.green, o), s.blue = de(n.blue, i.blue, o), s.alpha = M(n.alpha, i.alpha, o), ut.transform(s));
|
|
411
411
|
}, De = /* @__PURE__ */ new Set(["none", "hidden"]);
|
|
@@ -416,7 +416,7 @@ function Vo(t, e) {
|
|
|
416
416
|
return (n) => M(t, e, n);
|
|
417
417
|
}
|
|
418
418
|
function hn(t) {
|
|
419
|
-
return typeof t == "number" ? Vo : typeof t == "string" ? ln(t) ?
|
|
419
|
+
return typeof t == "number" ? Vo : typeof t == "string" ? ln(t) ? Qt : L.test(t) ? Un : Mo : Array.isArray(t) ? bs : typeof t == "object" ? L.test(t) ? Un : Co : Qt;
|
|
420
420
|
}
|
|
421
421
|
function bs(t, e) {
|
|
422
422
|
const n = [...t], i = n.length, s = t.map((o, r) => hn(o)(o, e[r]));
|
|
@@ -445,8 +445,8 @@ function Do(t, e) {
|
|
|
445
445
|
return n;
|
|
446
446
|
}
|
|
447
447
|
const Mo = (t, e) => {
|
|
448
|
-
const n = st.createTransformer(e), i =
|
|
449
|
-
return i.indexes.var.length === s.indexes.var.length && i.indexes.color.length === s.indexes.color.length && i.indexes.number.length >= s.indexes.number.length ? De.has(t) && !s.values.length || De.has(e) && !i.values.length ? Ao(t, e) :
|
|
448
|
+
const n = st.createTransformer(e), i = Ot(t), s = Ot(e);
|
|
449
|
+
return i.indexes.var.length === s.indexes.var.length && i.indexes.color.length === s.indexes.color.length && i.indexes.number.length >= s.indexes.number.length ? De.has(t) && !s.values.length || De.has(e) && !i.values.length ? Ao(t, e) : Kt(bs(Do(i, s), s.values), n) : (Vt(!0, `Complex values '${t}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`, "complex-values-different"), Qt(t, e));
|
|
450
450
|
};
|
|
451
451
|
function Ps(t, e, n) {
|
|
452
452
|
return typeof t == "number" && typeof e == "number" && typeof n == "number" ? M(t, e, n) : hn(t)(t, e);
|
|
@@ -468,21 +468,21 @@ const Eo = (t) => {
|
|
|
468
468
|
for (let o = 0; o < s; o++)
|
|
469
469
|
i += Math.round(t(o / (s - 1)) * 1e4) / 1e4 + ", ";
|
|
470
470
|
return `linear(${i.substring(0, i.length - 2)})`;
|
|
471
|
-
},
|
|
471
|
+
}, te = 2e4;
|
|
472
472
|
function fn(t) {
|
|
473
473
|
let e = 0;
|
|
474
474
|
const n = 50;
|
|
475
475
|
let i = t.next(e);
|
|
476
|
-
for (; !i.done && e <
|
|
476
|
+
for (; !i.done && e < te; )
|
|
477
477
|
e += n, i = t.next(e);
|
|
478
|
-
return e >=
|
|
478
|
+
return e >= te ? 1 / 0 : e;
|
|
479
479
|
}
|
|
480
480
|
function Ro(t, e = 100, n) {
|
|
481
|
-
const i = n({ ...t, keyframes: [0, e] }), s = Math.min(fn(i),
|
|
481
|
+
const i = n({ ...t, keyframes: [0, e] }), s = Math.min(fn(i), te);
|
|
482
482
|
return {
|
|
483
483
|
type: "keyframes",
|
|
484
484
|
ease: (o) => i.next(s * o).value / e,
|
|
485
|
-
duration: /* @__PURE__ */
|
|
485
|
+
duration: /* @__PURE__ */ W(s)
|
|
486
486
|
};
|
|
487
487
|
}
|
|
488
488
|
const Lo = 5;
|
|
@@ -523,7 +523,7 @@ function ko({ duration: t = D.duration, bounce: e = D.bounce, velocity: n = D.ve
|
|
|
523
523
|
let s, o;
|
|
524
524
|
Vt(t <= /* @__PURE__ */ G(D.maxDuration), "Spring duration must be 10 seconds or less", "spring-duration-limit");
|
|
525
525
|
let r = 1 - e;
|
|
526
|
-
r = Z(D.minDamping, D.maxDamping, r), t = Z(D.minDuration, D.maxDuration, /* @__PURE__ */
|
|
526
|
+
r = Z(D.minDamping, D.maxDamping, r), t = Z(D.minDuration, D.maxDuration, /* @__PURE__ */ W(t)), r < 1 ? (s = (u) => {
|
|
527
527
|
const c = u * r, h = c * t, f = c - n, d = Me(u, r), m = Math.exp(-h);
|
|
528
528
|
return me - f / d * m;
|
|
529
529
|
}, o = (u) => {
|
|
@@ -562,7 +562,7 @@ function Fo(t, e, n) {
|
|
|
562
562
|
function Me(t, e) {
|
|
563
563
|
return t * Math.sqrt(1 - e * e);
|
|
564
564
|
}
|
|
565
|
-
const
|
|
565
|
+
const Io = ["duration", "bounce"], Oo = ["stiffness", "damping", "mass"];
|
|
566
566
|
function Kn(t, e) {
|
|
567
567
|
return e.some((n) => t[n] !== void 0);
|
|
568
568
|
}
|
|
@@ -575,7 +575,7 @@ function jo(t) {
|
|
|
575
575
|
isResolvedFromDuration: !1,
|
|
576
576
|
...t
|
|
577
577
|
};
|
|
578
|
-
if (!Kn(t,
|
|
578
|
+
if (!Kn(t, Oo) && Kn(t, Io))
|
|
579
579
|
if (t.visualDuration) {
|
|
580
580
|
const n = t.visualDuration, i = 2 * Math.PI / (n * 1.2), s = i * i, o = 2 * Z(0.05, 1, 1 - (t.bounce || 0)) * Math.sqrt(s);
|
|
581
581
|
e = {
|
|
@@ -594,7 +594,7 @@ function jo(t) {
|
|
|
594
594
|
}
|
|
595
595
|
return e;
|
|
596
596
|
}
|
|
597
|
-
function
|
|
597
|
+
function ee(t = D.visualDuration, e = D.bounce) {
|
|
598
598
|
const n = typeof t != "object" ? {
|
|
599
599
|
visualDuration: t,
|
|
600
600
|
keyframes: [0, 1],
|
|
@@ -603,8 +603,8 @@ function ne(t = D.visualDuration, e = D.bounce) {
|
|
|
603
603
|
let { restSpeed: i, restDelta: s } = n;
|
|
604
604
|
const o = n.keyframes[0], r = n.keyframes[n.keyframes.length - 1], a = { done: !1, value: o }, { stiffness: l, damping: u, mass: c, duration: h, velocity: f, isResolvedFromDuration: d } = jo({
|
|
605
605
|
...n,
|
|
606
|
-
velocity: -/* @__PURE__ */
|
|
607
|
-
}), m = f || 0, g = u / (2 * Math.sqrt(l * c)), v = r - o, p = /* @__PURE__ */
|
|
606
|
+
velocity: -/* @__PURE__ */ W(n.velocity || 0)
|
|
607
|
+
}), m = f || 0, g = u / (2 * Math.sqrt(l * c)), v = r - o, p = /* @__PURE__ */ W(Math.sqrt(l / c)), T = Math.abs(v) < 5;
|
|
608
608
|
i || (i = T ? D.restSpeed.granular : D.restSpeed.default), s || (s = T ? D.restDelta.granular : D.restDelta.default);
|
|
609
609
|
let y;
|
|
610
610
|
if (g < 1) {
|
|
@@ -631,13 +631,13 @@ function ne(t = D.visualDuration, e = D.bounce) {
|
|
|
631
631
|
else {
|
|
632
632
|
let A = x === 0 ? m : 0;
|
|
633
633
|
g < 1 && (A = x === 0 ? /* @__PURE__ */ G(m) : As(y, x, S));
|
|
634
|
-
const b = Math.abs(A) <= i,
|
|
635
|
-
a.done = b &&
|
|
634
|
+
const b = Math.abs(A) <= i, R = Math.abs(r - S) <= s;
|
|
635
|
+
a.done = b && R;
|
|
636
636
|
}
|
|
637
637
|
return a.value = a.done ? r : S, a;
|
|
638
638
|
},
|
|
639
639
|
toString: () => {
|
|
640
|
-
const x = Math.min(fn(P),
|
|
640
|
+
const x = Math.min(fn(P), te), S = Ss((A) => P.next(x * A).value, x, 30);
|
|
641
641
|
return x + "ms " + S;
|
|
642
642
|
},
|
|
643
643
|
toTransition: () => {
|
|
@@ -645,8 +645,8 @@ function ne(t = D.visualDuration, e = D.bounce) {
|
|
|
645
645
|
};
|
|
646
646
|
return P;
|
|
647
647
|
}
|
|
648
|
-
|
|
649
|
-
const e = Ro(t, 100,
|
|
648
|
+
ee.applyToOptions = (t) => {
|
|
649
|
+
const e = Ro(t, 100, ee);
|
|
650
650
|
return t.ease = e.ease, t.duration = /* @__PURE__ */ G(e.duration), t.type = "keyframes", t;
|
|
651
651
|
};
|
|
652
652
|
function Ee({ keyframes: t, velocity: e = 0, power: n = 0.8, timeConstant: i = 325, bounceDamping: s = 10, bounceStiffness: o = 500, modifyTarget: r, min: a, max: l, restDelta: u = 0.5, restSpeed: c }) {
|
|
@@ -658,12 +658,12 @@ function Ee({ keyframes: t, velocity: e = 0, power: n = 0.8, timeConstant: i = 3
|
|
|
658
658
|
const v = h + g, p = r === void 0 ? v : r(v);
|
|
659
659
|
p !== v && (g = p - h);
|
|
660
660
|
const T = (b) => -g * Math.exp(-b / i), y = (b) => p + T(b), P = (b) => {
|
|
661
|
-
const
|
|
662
|
-
f.done = Math.abs(
|
|
661
|
+
const R = T(b), E = y(b);
|
|
662
|
+
f.done = Math.abs(R) <= u, f.value = f.done ? p : E;
|
|
663
663
|
};
|
|
664
664
|
let x, S;
|
|
665
665
|
const A = (b) => {
|
|
666
|
-
d(f.value) && (x = b, S =
|
|
666
|
+
d(f.value) && (x = b, S = ee({
|
|
667
667
|
keyframes: [f.value, m(f.value)],
|
|
668
668
|
velocity: As(y, b, f.value),
|
|
669
669
|
// TODO: This should be passing * 1000
|
|
@@ -676,8 +676,8 @@ function Ee({ keyframes: t, velocity: e = 0, power: n = 0.8, timeConstant: i = 3
|
|
|
676
676
|
return A(0), {
|
|
677
677
|
calculatedDuration: null,
|
|
678
678
|
next: (b) => {
|
|
679
|
-
let
|
|
680
|
-
return !S && x === void 0 && (
|
|
679
|
+
let R = !1;
|
|
680
|
+
return !S && x === void 0 && (R = !0, P(b), A(b)), x !== void 0 && b >= x ? S.next(b - x) : (!R && P(b), f);
|
|
681
681
|
}
|
|
682
682
|
};
|
|
683
683
|
}
|
|
@@ -686,8 +686,8 @@ function No(t, e, n) {
|
|
|
686
686
|
for (let r = 0; r < o; r++) {
|
|
687
687
|
let a = s(t[r], t[r + 1]);
|
|
688
688
|
if (e) {
|
|
689
|
-
const l = Array.isArray(e) ? e[r] ||
|
|
690
|
-
a =
|
|
689
|
+
const l = Array.isArray(e) ? e[r] || z : e;
|
|
690
|
+
a = Kt(l, a);
|
|
691
691
|
}
|
|
692
692
|
i.push(a);
|
|
693
693
|
}
|
|
@@ -708,7 +708,7 @@ function Uo(t, e, { clamp: n = !0, ease: i, mixer: s } = {}) {
|
|
|
708
708
|
if (l > 1)
|
|
709
709
|
for (; h < t.length - 2 && !(c < t[h + 1]); h++)
|
|
710
710
|
;
|
|
711
|
-
const f = /* @__PURE__ */
|
|
711
|
+
const f = /* @__PURE__ */ Ft(t[h], t[h + 1], c);
|
|
712
712
|
return a[h](f);
|
|
713
713
|
};
|
|
714
714
|
return n ? (c) => u(Z(t[0], t[o - 1], c)) : u;
|
|
@@ -716,7 +716,7 @@ function Uo(t, e, { clamp: n = !0, ease: i, mixer: s } = {}) {
|
|
|
716
716
|
function Ko(t, e) {
|
|
717
717
|
const n = t[t.length - 1];
|
|
718
718
|
for (let i = 1; i <= e; i++) {
|
|
719
|
-
const s = /* @__PURE__ */
|
|
719
|
+
const s = /* @__PURE__ */ Ft(0, e, i);
|
|
720
720
|
t.push(M(n, 1, s));
|
|
721
721
|
}
|
|
722
722
|
}
|
|
@@ -731,7 +731,7 @@ function zo(t, e) {
|
|
|
731
731
|
return t.map(() => e || ds).splice(0, t.length - 1);
|
|
732
732
|
}
|
|
733
733
|
function yt({ duration: t = 300, keyframes: e, times: n, ease: i = "easeInOut" }) {
|
|
734
|
-
const s = eo(i) ? i.map(
|
|
734
|
+
const s = eo(i) ? i.map(In) : In(i), o = {
|
|
735
735
|
done: !1,
|
|
736
736
|
value: e[0]
|
|
737
737
|
}, r = $o(
|
|
@@ -757,7 +757,7 @@ const _o = {
|
|
|
757
757
|
inertia: Ee,
|
|
758
758
|
tween: yt,
|
|
759
759
|
keyframes: yt,
|
|
760
|
-
spring:
|
|
760
|
+
spring: ee
|
|
761
761
|
};
|
|
762
762
|
function Vs(t) {
|
|
763
763
|
typeof t.type == "string" && (t.type = _o[t.type]);
|
|
@@ -800,7 +800,7 @@ class pn extends mn {
|
|
|
800
800
|
const { type: n = yt, repeat: i = 0, repeatDelay: s = 0, repeatType: o, velocity: r = 0 } = e;
|
|
801
801
|
let { keyframes: a } = e;
|
|
802
802
|
const l = n || yt;
|
|
803
|
-
process.env.NODE_ENV !== "production" && l !== yt && J(a.length <= 2, `Only two keyframes currently supported with spring and inertia animations. Trying to animate ${a}`, "spring-two-frames"), l !== yt && typeof a[0] != "number" && (this.mixKeyframes =
|
|
803
|
+
process.env.NODE_ENV !== "production" && l !== yt && J(a.length <= 2, `Only two keyframes currently supported with spring and inertia animations. Trying to animate ${a}`, "spring-two-frames"), l !== yt && typeof a[0] != "number" && (this.mixKeyframes = Kt(Go, Ps(a[0], a[1])), a = [0, 100]);
|
|
804
804
|
const u = l({ ...e, keyframes: a });
|
|
805
805
|
o === "mirror" && (this.mirroredGenerator = l({
|
|
806
806
|
...e,
|
|
@@ -825,8 +825,8 @@ class pn extends mn {
|
|
|
825
825
|
let y = this.currentTime, P = i;
|
|
826
826
|
if (h) {
|
|
827
827
|
const b = Math.min(this.currentTime, s) / a;
|
|
828
|
-
let
|
|
829
|
-
!E && b >= 1 && (E = 1), E === 1 &&
|
|
828
|
+
let R = Math.floor(b), E = b % 1;
|
|
829
|
+
!E && b >= 1 && (E = 1), E === 1 && R--, R = Math.min(R, h + 1), !!(R % 2) && (f === "reverse" ? (E = 1 - E, d && (E -= d / a)) : f === "mirror" && (P = r)), y = Z(0, 1, E) * a;
|
|
830
830
|
}
|
|
831
831
|
const x = T ? { done: !1, value: c[0] } : P.next(y);
|
|
832
832
|
o && (x.value = o(x.value));
|
|
@@ -844,14 +844,14 @@ class pn extends mn {
|
|
|
844
844
|
return this.finished.then(e, n);
|
|
845
845
|
}
|
|
846
846
|
get duration() {
|
|
847
|
-
return /* @__PURE__ */
|
|
847
|
+
return /* @__PURE__ */ W(this.calculatedDuration);
|
|
848
848
|
}
|
|
849
849
|
get iterationDuration() {
|
|
850
850
|
const { delay: e = 0 } = this.options || {};
|
|
851
|
-
return this.duration + /* @__PURE__ */
|
|
851
|
+
return this.duration + /* @__PURE__ */ W(e);
|
|
852
852
|
}
|
|
853
853
|
get time() {
|
|
854
|
-
return /* @__PURE__ */
|
|
854
|
+
return /* @__PURE__ */ W(this.currentTime);
|
|
855
855
|
}
|
|
856
856
|
set time(e) {
|
|
857
857
|
e = /* @__PURE__ */ G(e), this.currentTime = e, this.startTime === null || this.holdTime !== null || this.playbackSpeed === 0 ? this.holdTime = e : this.driver && (this.startTime = this.driver.now() - e / this.playbackSpeed), this.driver?.start(!1);
|
|
@@ -862,7 +862,7 @@ class pn extends mn {
|
|
|
862
862
|
set speed(e) {
|
|
863
863
|
this.updateTime(N.now());
|
|
864
864
|
const n = this.playbackSpeed !== e;
|
|
865
|
-
this.playbackSpeed = e, n && (this.time = /* @__PURE__ */
|
|
865
|
+
this.playbackSpeed = e, n && (this.time = /* @__PURE__ */ W(this.currentTime));
|
|
866
866
|
}
|
|
867
867
|
play() {
|
|
868
868
|
if (this.isStopped)
|
|
@@ -1002,9 +1002,9 @@ const ft = {
|
|
|
1002
1002
|
ft.translateX = ft.x;
|
|
1003
1003
|
ft.translateY = ft.y;
|
|
1004
1004
|
const dt = /* @__PURE__ */ new Set();
|
|
1005
|
-
let Fe = !1,
|
|
1005
|
+
let Fe = !1, Ie = !1, Oe = !1;
|
|
1006
1006
|
function Cs() {
|
|
1007
|
-
if (
|
|
1007
|
+
if (Ie) {
|
|
1008
1008
|
const t = Array.from(dt).filter((i) => i.needsMeasurement), e = new Set(t.map((i) => i.element)), n = /* @__PURE__ */ new Map();
|
|
1009
1009
|
e.forEach((i) => {
|
|
1010
1010
|
const s = ea(i);
|
|
@@ -1019,15 +1019,15 @@ function Cs() {
|
|
|
1019
1019
|
i.suspendedScrollY !== void 0 && window.scrollTo(0, i.suspendedScrollY);
|
|
1020
1020
|
});
|
|
1021
1021
|
}
|
|
1022
|
-
|
|
1022
|
+
Ie = !1, Fe = !1, dt.forEach((t) => t.complete(Oe)), dt.clear();
|
|
1023
1023
|
}
|
|
1024
1024
|
function Ds() {
|
|
1025
1025
|
dt.forEach((t) => {
|
|
1026
|
-
t.readKeyframes(), t.needsMeasurement && (
|
|
1026
|
+
t.readKeyframes(), t.needsMeasurement && (Ie = !0);
|
|
1027
1027
|
});
|
|
1028
1028
|
}
|
|
1029
1029
|
function na() {
|
|
1030
|
-
|
|
1030
|
+
Oe = !0, Ds(), Cs(), Oe = !1;
|
|
1031
1031
|
}
|
|
1032
1032
|
class gn {
|
|
1033
1033
|
constructor(e, n, i, s, o, r = !1) {
|
|
@@ -1176,14 +1176,14 @@ class ua extends mn {
|
|
|
1176
1176
|
}
|
|
1177
1177
|
get duration() {
|
|
1178
1178
|
const e = this.animation.effect?.getComputedTiming?.().duration || 0;
|
|
1179
|
-
return /* @__PURE__ */
|
|
1179
|
+
return /* @__PURE__ */ W(Number(e));
|
|
1180
1180
|
}
|
|
1181
1181
|
get iterationDuration() {
|
|
1182
1182
|
const { delay: e = 0 } = this.options || {};
|
|
1183
|
-
return this.duration + /* @__PURE__ */
|
|
1183
|
+
return this.duration + /* @__PURE__ */ W(e);
|
|
1184
1184
|
}
|
|
1185
1185
|
get time() {
|
|
1186
|
-
return /* @__PURE__ */
|
|
1186
|
+
return /* @__PURE__ */ W(Number(this.animation.currentTime) || 0);
|
|
1187
1187
|
}
|
|
1188
1188
|
set time(e) {
|
|
1189
1189
|
this.finishedTime = null, this.animation.currentTime = /* @__PURE__ */ G(e);
|
|
@@ -1211,7 +1211,7 @@ class ua extends mn {
|
|
|
1211
1211
|
* Attaches a timeline to the animation, for instance the `ScrollTimeline`.
|
|
1212
1212
|
*/
|
|
1213
1213
|
attachTimeline({ timeline: e, observe: n }) {
|
|
1214
|
-
return this.allowFlatten && this.animation.effect?.updateTiming({ easing: "linear" }), this.animation.onfinish = null, e && ra() ? (this.animation.timeline = e,
|
|
1214
|
+
return this.allowFlatten && this.animation.effect?.updateTiming({ easing: "linear" }), this.animation.onfinish = null, e && ra() ? (this.animation.timeline = e, z) : n(this);
|
|
1215
1215
|
}
|
|
1216
1216
|
}
|
|
1217
1217
|
const Ls = {
|
|
@@ -1328,7 +1328,7 @@ class xa extends mn {
|
|
|
1328
1328
|
...f,
|
|
1329
1329
|
element: f.motionValue.owner.current
|
|
1330
1330
|
}) : new pn(f);
|
|
1331
|
-
d.finished.then(() => this.notifyFinished()).catch(
|
|
1331
|
+
d.finished.then(() => this.notifyFinished()).catch(z), this.pendingTimeline && (this.stopTimeline = d.attachTimeline(this.pendingTimeline), this.pendingTimeline = void 0), this._animation = d;
|
|
1332
1332
|
}
|
|
1333
1333
|
get finished() {
|
|
1334
1334
|
return this._animation ? this.animation.finished : this._finished;
|
|
@@ -1418,7 +1418,7 @@ const Bs = /* @__PURE__ */ new Set([
|
|
|
1418
1418
|
]), Sa = {
|
|
1419
1419
|
test: (t) => t === "auto",
|
|
1420
1420
|
parse: (t) => t
|
|
1421
|
-
}, Fs = (t) => (e) => e.test(t),
|
|
1421
|
+
}, Fs = (t) => (e) => e.test(t), Is = [Ct, w, X, et, mo, fo, Sa], Yn = (t) => Is.find(Fs(t));
|
|
1422
1422
|
function Aa(t) {
|
|
1423
1423
|
return typeof t == "number" ? t === 0 : t !== null ? t === "none" || t === "0" || is(t) : !0;
|
|
1424
1424
|
}
|
|
@@ -1448,10 +1448,10 @@ const Da = /\b([a-z-]*)\(.*?\)/gu, Ne = {
|
|
|
1448
1448
|
rotateX: et,
|
|
1449
1449
|
rotateY: et,
|
|
1450
1450
|
rotateZ: et,
|
|
1451
|
-
scale:
|
|
1452
|
-
scaleX:
|
|
1453
|
-
scaleY:
|
|
1454
|
-
scaleZ:
|
|
1451
|
+
scale: _t,
|
|
1452
|
+
scaleX: _t,
|
|
1453
|
+
scaleY: _t,
|
|
1454
|
+
scaleZ: _t,
|
|
1455
1455
|
skew: et,
|
|
1456
1456
|
skewX: et,
|
|
1457
1457
|
skewY: et,
|
|
@@ -1465,8 +1465,8 @@ const Da = /\b([a-z-]*)\(.*?\)/gu, Ne = {
|
|
|
1465
1465
|
perspective: w,
|
|
1466
1466
|
transformPerspective: w,
|
|
1467
1467
|
opacity: It,
|
|
1468
|
-
originX:
|
|
1469
|
-
originY:
|
|
1468
|
+
originX: On,
|
|
1469
|
+
originY: On,
|
|
1470
1470
|
originZ: w
|
|
1471
1471
|
}, vn = {
|
|
1472
1472
|
// Border props
|
|
@@ -1513,22 +1513,22 @@ const Da = /\b([a-z-]*)\(.*?\)/gu, Ne = {
|
|
|
1513
1513
|
}, Ea = {
|
|
1514
1514
|
...vn,
|
|
1515
1515
|
// Color props
|
|
1516
|
-
color:
|
|
1517
|
-
backgroundColor:
|
|
1518
|
-
outlineColor:
|
|
1519
|
-
fill:
|
|
1520
|
-
stroke:
|
|
1516
|
+
color: L,
|
|
1517
|
+
backgroundColor: L,
|
|
1518
|
+
outlineColor: L,
|
|
1519
|
+
fill: L,
|
|
1520
|
+
stroke: L,
|
|
1521
1521
|
// Border props
|
|
1522
|
-
borderColor:
|
|
1523
|
-
borderTopColor:
|
|
1524
|
-
borderRightColor:
|
|
1525
|
-
borderBottomColor:
|
|
1526
|
-
borderLeftColor:
|
|
1522
|
+
borderColor: L,
|
|
1523
|
+
borderTopColor: L,
|
|
1524
|
+
borderRightColor: L,
|
|
1525
|
+
borderBottomColor: L,
|
|
1526
|
+
borderLeftColor: L,
|
|
1527
1527
|
filter: Ne,
|
|
1528
1528
|
WebkitFilter: Ne
|
|
1529
|
-
},
|
|
1529
|
+
}, Os = (t) => Ea[t];
|
|
1530
1530
|
function js(t, e) {
|
|
1531
|
-
let n =
|
|
1531
|
+
let n = Os(t);
|
|
1532
1532
|
return n !== Ne && (n = st), n.getAnimatableNone ? n.getAnimatableNone(e) : void 0;
|
|
1533
1533
|
}
|
|
1534
1534
|
const Ra = /* @__PURE__ */ new Set(["auto", "none", "0"]);
|
|
@@ -1536,7 +1536,7 @@ function La(t, e, n) {
|
|
|
1536
1536
|
let i = 0, s;
|
|
1537
1537
|
for (; i < t.length && !s; ) {
|
|
1538
1538
|
const o = t[i];
|
|
1539
|
-
typeof o == "string" && !Ra.has(o) &&
|
|
1539
|
+
typeof o == "string" && !Ra.has(o) && Ot(o).values.length && (s = t[i]), i++;
|
|
1540
1540
|
}
|
|
1541
1541
|
if (s && n)
|
|
1542
1542
|
for (const o of e)
|
|
@@ -1610,7 +1610,7 @@ function Us(t) {
|
|
|
1610
1610
|
return ns(t) && "offsetHeight" in t;
|
|
1611
1611
|
}
|
|
1612
1612
|
const Zn = 30, Fa = (t) => !isNaN(parseFloat(t));
|
|
1613
|
-
class
|
|
1613
|
+
class Ia {
|
|
1614
1614
|
/**
|
|
1615
1615
|
* @param init - The initiating value
|
|
1616
1616
|
* @param config - Optional configuration options
|
|
@@ -1810,7 +1810,7 @@ class Oa {
|
|
|
1810
1810
|
}
|
|
1811
1811
|
}
|
|
1812
1812
|
function St(t, e) {
|
|
1813
|
-
return new
|
|
1813
|
+
return new Ia(t, e);
|
|
1814
1814
|
}
|
|
1815
1815
|
const { schedule: Tn } = /* @__PURE__ */ ps(queueMicrotask, !1), _ = {
|
|
1816
1816
|
x: !1,
|
|
@@ -1819,7 +1819,7 @@ const { schedule: Tn } = /* @__PURE__ */ ps(queueMicrotask, !1), _ = {
|
|
|
1819
1819
|
function Ks() {
|
|
1820
1820
|
return _.x || _.y;
|
|
1821
1821
|
}
|
|
1822
|
-
function
|
|
1822
|
+
function Oa(t) {
|
|
1823
1823
|
return t === "x" || t === "y" ? _[t] ? null : (_[t] = !0, () => {
|
|
1824
1824
|
_[t] = !1;
|
|
1825
1825
|
}) : _.x || _.y ? null : (_.x = _.y = !0, () => {
|
|
@@ -1863,7 +1863,7 @@ const $s = (t, e) => e ? t === e ? !0 : $s(t, e.parentElement) : !1, xn = (t) =>
|
|
|
1863
1863
|
function Ua(t) {
|
|
1864
1864
|
return Na.has(t.tagName) || t.tabIndex !== -1;
|
|
1865
1865
|
}
|
|
1866
|
-
const
|
|
1866
|
+
const qt = /* @__PURE__ */ new WeakSet();
|
|
1867
1867
|
function Qn(t) {
|
|
1868
1868
|
return (e) => {
|
|
1869
1869
|
e.key === "Enter" && t(e);
|
|
@@ -1877,7 +1877,7 @@ const Ka = (t, e) => {
|
|
|
1877
1877
|
if (!n)
|
|
1878
1878
|
return;
|
|
1879
1879
|
const i = Qn(() => {
|
|
1880
|
-
if (
|
|
1880
|
+
if (qt.has(n))
|
|
1881
1881
|
return;
|
|
1882
1882
|
pe(n, "down");
|
|
1883
1883
|
const s = Qn(() => {
|
|
@@ -1895,9 +1895,9 @@ function Wa(t, e, n = {}) {
|
|
|
1895
1895
|
const l = a.currentTarget;
|
|
1896
1896
|
if (!ti(a))
|
|
1897
1897
|
return;
|
|
1898
|
-
|
|
1898
|
+
qt.add(l);
|
|
1899
1899
|
const u = e(l, a), c = (d, m) => {
|
|
1900
|
-
window.removeEventListener("pointerup", h), window.removeEventListener("pointercancel", f),
|
|
1900
|
+
window.removeEventListener("pointerup", h), window.removeEventListener("pointercancel", f), qt.has(l) && qt.delete(l), ti(d) && typeof u == "function" && u(d, { success: m });
|
|
1901
1901
|
}, h = (d) => {
|
|
1902
1902
|
c(d, l === window || l === document || n.useGlobalTarget || $s(l, d.target));
|
|
1903
1903
|
}, f = (d) => {
|
|
@@ -1915,7 +1915,7 @@ function zs(t) {
|
|
|
1915
1915
|
function $a(t) {
|
|
1916
1916
|
return zs(t) && t.tagName === "svg";
|
|
1917
1917
|
}
|
|
1918
|
-
const
|
|
1918
|
+
const O = (t) => !!(t && t.getVelocity), za = [...Is, L, st], Ha = (t) => za.find(Fs(t)), wn = mt({
|
|
1919
1919
|
transformPagePoint: (t) => t,
|
|
1920
1920
|
isStatic: !1,
|
|
1921
1921
|
reducedMotion: "never"
|
|
@@ -1963,13 +1963,13 @@ class Xa extends re.Component {
|
|
|
1963
1963
|
}
|
|
1964
1964
|
}
|
|
1965
1965
|
function Ya({ children: t, isPresent: e, anchorX: n, root: i }) {
|
|
1966
|
-
const s = Ye(), o =
|
|
1966
|
+
const s = Ye(), o = $(null), r = $({
|
|
1967
1967
|
width: 0,
|
|
1968
1968
|
height: 0,
|
|
1969
1969
|
top: 0,
|
|
1970
1970
|
left: 0,
|
|
1971
1971
|
right: 0
|
|
1972
|
-
}), { nonce: a } =
|
|
1972
|
+
}), { nonce: a } = I(wn), l = Ga(o, t?.ref);
|
|
1973
1973
|
return Zi(() => {
|
|
1974
1974
|
const { width: u, height: c, top: h, left: f, right: d } = r.current;
|
|
1975
1975
|
if (e || !o.current || !u || !c)
|
|
@@ -2018,7 +2018,7 @@ function Za() {
|
|
|
2018
2018
|
return /* @__PURE__ */ new Map();
|
|
2019
2019
|
}
|
|
2020
2020
|
function Hs(t = !0) {
|
|
2021
|
-
const e =
|
|
2021
|
+
const e = I(oe);
|
|
2022
2022
|
if (e === null)
|
|
2023
2023
|
return [!0, null];
|
|
2024
2024
|
const { isPresent: n, onExitComplete: i, register: s } = e, o = Ye();
|
|
@@ -2029,7 +2029,7 @@ function Hs(t = !0) {
|
|
|
2029
2029
|
const r = Ji(() => t && i && i(o), [o, i, t]);
|
|
2030
2030
|
return !n && i ? [!1, r] : [!0];
|
|
2031
2031
|
}
|
|
2032
|
-
const
|
|
2032
|
+
const Gt = (t) => t.key || "";
|
|
2033
2033
|
function ni(t) {
|
|
2034
2034
|
const e = [];
|
|
2035
2035
|
return Hr.forEach(t, (n) => {
|
|
@@ -2037,11 +2037,11 @@ function ni(t) {
|
|
|
2037
2037
|
}), e;
|
|
2038
2038
|
}
|
|
2039
2039
|
const Ja = ({ children: t, custom: e, initial: n = !0, onExitComplete: i, presenceAffectsLayout: s = !0, mode: o = "sync", propagate: r = !1, anchorX: a = "left", root: l }) => {
|
|
2040
|
-
const [u, c] = Hs(r), h = Y(() => ni(t), [t]), f = r && !u ? [] : h.map(
|
|
2040
|
+
const [u, c] = Hs(r), h = Y(() => ni(t), [t]), f = r && !u ? [] : h.map(Gt), d = $(!0), m = $(h), g = Ze(() => /* @__PURE__ */ new Map()), [v, p] = Ae(h), [T, y] = Ae(h);
|
|
2041
2041
|
ts(() => {
|
|
2042
2042
|
d.current = !1, m.current = h;
|
|
2043
2043
|
for (let S = 0; S < T.length; S++) {
|
|
2044
|
-
const A =
|
|
2044
|
+
const A = Gt(T[S]);
|
|
2045
2045
|
f.includes(A) ? g.delete(A) : g.get(A) !== !0 && g.set(A, !1);
|
|
2046
2046
|
}
|
|
2047
2047
|
}, [T, f.length, f.join("-")]);
|
|
@@ -2049,15 +2049,15 @@ const Ja = ({ children: t, custom: e, initial: n = !0, onExitComplete: i, presen
|
|
|
2049
2049
|
if (h !== v) {
|
|
2050
2050
|
let S = [...h];
|
|
2051
2051
|
for (let A = 0; A < T.length; A++) {
|
|
2052
|
-
const b = T[A],
|
|
2053
|
-
f.includes(
|
|
2052
|
+
const b = T[A], R = Gt(b);
|
|
2053
|
+
f.includes(R) || (S.splice(A, 0, b), P.push(b));
|
|
2054
2054
|
}
|
|
2055
2055
|
return o === "wait" && P.length && (S = P), y(ni(S)), p(h), null;
|
|
2056
2056
|
}
|
|
2057
2057
|
process.env.NODE_ENV !== "production" && o === "wait" && T.length > 1 && console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);
|
|
2058
|
-
const { forceRender: x } =
|
|
2058
|
+
const { forceRender: x } = I(qe);
|
|
2059
2059
|
return V(Kr, { children: T.map((S) => {
|
|
2060
|
-
const A =
|
|
2060
|
+
const A = Gt(S), b = r && !u ? !1 : h === T || f.includes(A), R = () => {
|
|
2061
2061
|
if (g.has(A))
|
|
2062
2062
|
g.set(A, !0);
|
|
2063
2063
|
else
|
|
@@ -2067,7 +2067,7 @@ const Ja = ({ children: t, custom: e, initial: n = !0, onExitComplete: i, presen
|
|
|
2067
2067
|
tt || (E = !1);
|
|
2068
2068
|
}), E && (x?.(), y(m.current), r && c?.(), i && i());
|
|
2069
2069
|
};
|
|
2070
|
-
return V(qa, { isPresent: b, initial: !d.current || n ? void 0 : !1, custom: e, presenceAffectsLayout: s, mode: o, root: l, onExitComplete: b ? void 0 :
|
|
2070
|
+
return V(qa, { isPresent: b, initial: !d.current || n ? void 0 : !1, custom: e, presenceAffectsLayout: s, mode: o, root: l, onExitComplete: b ? void 0 : R, anchorX: a, children: S }, A);
|
|
2071
2071
|
}) });
|
|
2072
2072
|
}, _s = mt({ strict: !1 }), ii = {
|
|
2073
2073
|
animation: [
|
|
@@ -2132,12 +2132,12 @@ const tl = /* @__PURE__ */ new Set([
|
|
|
2132
2132
|
"ignoreStrict",
|
|
2133
2133
|
"viewport"
|
|
2134
2134
|
]);
|
|
2135
|
-
function
|
|
2135
|
+
function ne(t) {
|
|
2136
2136
|
return t.startsWith("while") || t.startsWith("drag") && t !== "draggable" || t.startsWith("layout") || t.startsWith("onTap") || t.startsWith("onPan") || t.startsWith("onLayout") || tl.has(t);
|
|
2137
2137
|
}
|
|
2138
|
-
let Gs = (t) => !
|
|
2138
|
+
let Gs = (t) => !ne(t);
|
|
2139
2139
|
function el(t) {
|
|
2140
|
-
typeof t == "function" && (Gs = (e) => e.startsWith("on") ? !
|
|
2140
|
+
typeof t == "function" && (Gs = (e) => e.startsWith("on") ? !ne(e) : t(e));
|
|
2141
2141
|
}
|
|
2142
2142
|
try {
|
|
2143
2143
|
el(require("@emotion/is-prop-valid").default);
|
|
@@ -2146,7 +2146,7 @@ try {
|
|
|
2146
2146
|
function nl(t, e, n) {
|
|
2147
2147
|
const i = {};
|
|
2148
2148
|
for (const s in t)
|
|
2149
|
-
s === "values" && typeof t.values == "object" || (Gs(s) || n === !0 &&
|
|
2149
|
+
s === "values" && typeof t.values == "object" || (Gs(s) || n === !0 && ne(s) || !e && !ne(s) || // If trying to use native HTML drag events, forward drag listeners
|
|
2150
2150
|
t.draggable && s.startsWith("onDrag")) && (i[s] = t[s]);
|
|
2151
2151
|
return i;
|
|
2152
2152
|
}
|
|
@@ -2154,7 +2154,7 @@ const ae = /* @__PURE__ */ mt({});
|
|
|
2154
2154
|
function le(t) {
|
|
2155
2155
|
return t !== null && typeof t == "object" && typeof t.start == "function";
|
|
2156
2156
|
}
|
|
2157
|
-
function
|
|
2157
|
+
function jt(t) {
|
|
2158
2158
|
return typeof t == "string" || Array.isArray(t);
|
|
2159
2159
|
}
|
|
2160
2160
|
const bn = [
|
|
@@ -2167,7 +2167,7 @@ const bn = [
|
|
|
2167
2167
|
"exit"
|
|
2168
2168
|
], Pn = ["initial", ...bn];
|
|
2169
2169
|
function ce(t) {
|
|
2170
|
-
return le(t.animate) || Pn.some((e) =>
|
|
2170
|
+
return le(t.animate) || Pn.some((e) => jt(t[e]));
|
|
2171
2171
|
}
|
|
2172
2172
|
function Xs(t) {
|
|
2173
2173
|
return !!(ce(t) || t.variants);
|
|
@@ -2176,26 +2176,26 @@ function il(t, e) {
|
|
|
2176
2176
|
if (ce(t)) {
|
|
2177
2177
|
const { initial: n, animate: i } = t;
|
|
2178
2178
|
return {
|
|
2179
|
-
initial: n === !1 ||
|
|
2180
|
-
animate:
|
|
2179
|
+
initial: n === !1 || jt(n) ? n : void 0,
|
|
2180
|
+
animate: jt(i) ? i : void 0
|
|
2181
2181
|
};
|
|
2182
2182
|
}
|
|
2183
2183
|
return t.inherit !== !1 ? e : {};
|
|
2184
2184
|
}
|
|
2185
2185
|
function sl(t) {
|
|
2186
|
-
const { initial: e, animate: n } = il(t,
|
|
2186
|
+
const { initial: e, animate: n } = il(t, I(ae));
|
|
2187
2187
|
return Y(() => ({ initial: e, animate: n }), [si(e), si(n)]);
|
|
2188
2188
|
}
|
|
2189
2189
|
function si(t) {
|
|
2190
2190
|
return Array.isArray(t) ? t.join(" ") : t;
|
|
2191
2191
|
}
|
|
2192
|
-
const
|
|
2192
|
+
const Nt = {};
|
|
2193
2193
|
function rl(t) {
|
|
2194
2194
|
for (const e in t)
|
|
2195
|
-
|
|
2195
|
+
Nt[e] = t[e], an(e) && (Nt[e].isCSSVariable = !0);
|
|
2196
2196
|
}
|
|
2197
2197
|
function Ys(t, { layout: e, layoutId: n }) {
|
|
2198
|
-
return Mt.has(t) || t.startsWith("origin") || (e || n !== void 0) && (!!
|
|
2198
|
+
return Mt.has(t) || t.startsWith("origin") || (e || n !== void 0) && (!!Nt[t] || t === "opacity");
|
|
2199
2199
|
}
|
|
2200
2200
|
const ol = {
|
|
2201
2201
|
x: "translateX",
|
|
@@ -2251,7 +2251,7 @@ const An = () => ({
|
|
|
2251
2251
|
});
|
|
2252
2252
|
function qs(t, e, n) {
|
|
2253
2253
|
for (const i in e)
|
|
2254
|
-
!
|
|
2254
|
+
!O(e[i]) && !Ys(i, n) && (t[i] = e[i]);
|
|
2255
2255
|
}
|
|
2256
2256
|
function cl({ transformTemplate: t }, e) {
|
|
2257
2257
|
return Y(() => {
|
|
@@ -2365,7 +2365,7 @@ function Vn(t) {
|
|
|
2365
2365
|
);
|
|
2366
2366
|
}
|
|
2367
2367
|
function yl(t, e, n, { latestValues: i }, s, o = !1) {
|
|
2368
|
-
const a = (Vn(t) ? pl : hl)(e, i, s, t), l = nl(e, typeof t == "string", o), u = t !== Qi ? { ...l, ...a, ref: n } : {}, { children: c } = e, h = Y(() =>
|
|
2368
|
+
const a = (Vn(t) ? pl : hl)(e, i, s, t), l = nl(e, typeof t == "string", o), u = t !== Qi ? { ...l, ...a, ref: n } : {}, { children: c } = e, h = Y(() => O(c) ? c.get() : c, [c]);
|
|
2369
2369
|
return Gr(t, {
|
|
2370
2370
|
...u,
|
|
2371
2371
|
children: h
|
|
@@ -2388,8 +2388,8 @@ function Cn(t, e, n, i) {
|
|
|
2388
2388
|
}
|
|
2389
2389
|
return e;
|
|
2390
2390
|
}
|
|
2391
|
-
function
|
|
2392
|
-
return
|
|
2391
|
+
function Zt(t) {
|
|
2392
|
+
return O(t) ? t.get() : t;
|
|
2393
2393
|
}
|
|
2394
2394
|
function vl({ scrapeMotionValuesFromProps: t, createRenderState: e }, n, i, s) {
|
|
2395
2395
|
return {
|
|
@@ -2400,7 +2400,7 @@ function vl({ scrapeMotionValuesFromProps: t, createRenderState: e }, n, i, s) {
|
|
|
2400
2400
|
function Tl(t, e, n, i) {
|
|
2401
2401
|
const s = {}, o = i(t, {});
|
|
2402
2402
|
for (const f in o)
|
|
2403
|
-
s[f] =
|
|
2403
|
+
s[f] = Zt(o[f]);
|
|
2404
2404
|
let { initial: r, animate: a } = t;
|
|
2405
2405
|
const l = ce(t), u = Xs(t);
|
|
2406
2406
|
e && u && !l && t.inherit !== !1 && (r === void 0 && (r = e.initial), a === void 0 && (a = e.animate));
|
|
@@ -2429,13 +2429,13 @@ function Tl(t, e, n, i) {
|
|
|
2429
2429
|
return s;
|
|
2430
2430
|
}
|
|
2431
2431
|
const tr = (t) => (e, n) => {
|
|
2432
|
-
const i =
|
|
2432
|
+
const i = I(ae), s = I(oe), o = () => vl(t, e, i, s);
|
|
2433
2433
|
return n ? o() : Ze(o);
|
|
2434
2434
|
};
|
|
2435
2435
|
function Dn(t, e, n) {
|
|
2436
2436
|
const { style: i } = t, s = {};
|
|
2437
2437
|
for (const o in i)
|
|
2438
|
-
(
|
|
2438
|
+
(O(i[o]) || e.style && O(e.style[o]) || Ys(o, t) || n?.getValue(o)?.liveStyle !== void 0) && (s[o] = i[o]);
|
|
2439
2439
|
return s;
|
|
2440
2440
|
}
|
|
2441
2441
|
const xl = /* @__PURE__ */ tr({
|
|
@@ -2445,7 +2445,7 @@ const xl = /* @__PURE__ */ tr({
|
|
|
2445
2445
|
function er(t, e, n) {
|
|
2446
2446
|
const i = Dn(t, e, n);
|
|
2447
2447
|
for (const s in t)
|
|
2448
|
-
if (
|
|
2448
|
+
if (O(t[s]) || O(e[s])) {
|
|
2449
2449
|
const o = Dt.indexOf(s) !== -1 ? "attr" + s.charAt(0).toUpperCase() + s.substring(1) : s;
|
|
2450
2450
|
i[o] = t[s];
|
|
2451
2451
|
}
|
|
@@ -2472,7 +2472,7 @@ function Pl(t, e, n) {
|
|
|
2472
2472
|
}
|
|
2473
2473
|
const Mn = (t) => t.replace(/([a-z])([A-Z])/gu, "$1-$2").toLowerCase(), Sl = "framerAppearId", nr = "data-" + Mn(Sl), ir = mt({});
|
|
2474
2474
|
function Al(t, e, n, i, s) {
|
|
2475
|
-
const { visualElement: o } =
|
|
2475
|
+
const { visualElement: o } = I(ae), r = I(_s), a = I(oe), l = I(wn).reducedMotion, u = $(null);
|
|
2476
2476
|
i = i || r.renderer, !u.current && i && (u.current = i(t, {
|
|
2477
2477
|
visualState: e,
|
|
2478
2478
|
parent: o,
|
|
@@ -2481,13 +2481,13 @@ function Al(t, e, n, i, s) {
|
|
|
2481
2481
|
blockInitialAnimation: a ? a.initial === !1 : !1,
|
|
2482
2482
|
reducedMotionConfig: l
|
|
2483
2483
|
}));
|
|
2484
|
-
const c = u.current, h =
|
|
2484
|
+
const c = u.current, h = I(ir);
|
|
2485
2485
|
c && !c.projection && s && (c.type === "html" || c.type === "svg") && Vl(u.current, n, s, h);
|
|
2486
|
-
const f =
|
|
2486
|
+
const f = $(!1);
|
|
2487
2487
|
Zi(() => {
|
|
2488
2488
|
c && f.current && c.update(n, a);
|
|
2489
2489
|
});
|
|
2490
|
-
const d = n[nr], m =
|
|
2490
|
+
const d = n[nr], m = $(!!d && !window.MotionHandoffIsComplete?.(d) && window.MotionHasOptimisedAnimation?.(d));
|
|
2491
2491
|
return ts(() => {
|
|
2492
2492
|
c && (f.current = !0, window.MotionIsMounted = !0, c.updateFeatures(), c.scheduleRenderMicrotask(), m.current && c.animationState && c.animationState.animateChanges());
|
|
2493
2493
|
}), nt(() => {
|
|
@@ -2527,7 +2527,7 @@ function ge(t, { forwardMotionProps: e = !1 } = {}, n, i) {
|
|
|
2527
2527
|
function o(a, l) {
|
|
2528
2528
|
let u;
|
|
2529
2529
|
const c = {
|
|
2530
|
-
...
|
|
2530
|
+
...I(wn),
|
|
2531
2531
|
...a,
|
|
2532
2532
|
layoutId: Cl(a)
|
|
2533
2533
|
}, { isStatic: h } = c, f = sl(a), d = s(a, h);
|
|
@@ -2543,11 +2543,11 @@ function ge(t, { forwardMotionProps: e = !1 } = {}, n, i) {
|
|
|
2543
2543
|
return r[bl] = t, r;
|
|
2544
2544
|
}
|
|
2545
2545
|
function Cl({ layoutId: t }) {
|
|
2546
|
-
const e =
|
|
2546
|
+
const e = I(qe).id;
|
|
2547
2547
|
return e && t !== void 0 ? e + "-" + t : t;
|
|
2548
2548
|
}
|
|
2549
2549
|
function Dl(t, e) {
|
|
2550
|
-
const n =
|
|
2550
|
+
const n = I(_s).strict;
|
|
2551
2551
|
if (process.env.NODE_ENV !== "production" && e && n) {
|
|
2552
2552
|
const i = "You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";
|
|
2553
2553
|
t.ignoreStrict ? Vt(!1, i, "lazy-strict-mode") : J(!1, i, "lazy-strict-mode");
|
|
@@ -2611,12 +2611,12 @@ function or(t) {
|
|
|
2611
2611
|
function oi(t) {
|
|
2612
2612
|
return t && t !== "0%";
|
|
2613
2613
|
}
|
|
2614
|
-
function
|
|
2614
|
+
function ie(t, e, n) {
|
|
2615
2615
|
const i = t - n, s = e * i;
|
|
2616
2616
|
return n + s;
|
|
2617
2617
|
}
|
|
2618
2618
|
function ai(t, e, n, i, s) {
|
|
2619
|
-
return s !== void 0 && (t =
|
|
2619
|
+
return s !== void 0 && (t = ie(t, s, i)), ie(t, n, i) + e;
|
|
2620
2620
|
}
|
|
2621
2621
|
function Ke(t, e = 0, n = 1, i, s) {
|
|
2622
2622
|
t.min = ai(t.min, e, n, i, s), t.max = ai(t.max, e, n, i, s);
|
|
@@ -2666,7 +2666,7 @@ const hi = () => ({
|
|
|
2666
2666
|
}), wt = () => ({
|
|
2667
2667
|
x: hi(),
|
|
2668
2668
|
y: hi()
|
|
2669
|
-
}), fi = () => ({ min: 0, max: 0 }),
|
|
2669
|
+
}), fi = () => ({ min: 0, max: 0 }), k = () => ({
|
|
2670
2670
|
x: fi(),
|
|
2671
2671
|
y: fi()
|
|
2672
2672
|
}), We = { current: null }, cr = { current: !1 };
|
|
@@ -2678,13 +2678,13 @@ function Fl() {
|
|
|
2678
2678
|
} else
|
|
2679
2679
|
We.current = !1;
|
|
2680
2680
|
}
|
|
2681
|
-
const
|
|
2682
|
-
function
|
|
2681
|
+
const Il = /* @__PURE__ */ new WeakMap();
|
|
2682
|
+
function Ol(t, e, n) {
|
|
2683
2683
|
for (const i in e) {
|
|
2684
2684
|
const s = e[i], o = n[i];
|
|
2685
|
-
if (
|
|
2685
|
+
if (O(s))
|
|
2686
2686
|
t.addValue(i, s);
|
|
2687
|
-
else if (
|
|
2687
|
+
else if (O(o))
|
|
2688
2688
|
t.addValue(i, St(s, { owner: t }));
|
|
2689
2689
|
else if (o !== s)
|
|
2690
2690
|
if (t.hasValue(i)) {
|
|
@@ -2731,11 +2731,11 @@ class jl {
|
|
|
2731
2731
|
const { willChange: c, ...h } = this.scrapeMotionValuesFromProps(n, {}, this);
|
|
2732
2732
|
for (const f in h) {
|
|
2733
2733
|
const d = h[f];
|
|
2734
|
-
l[f] !== void 0 &&
|
|
2734
|
+
l[f] !== void 0 && O(d) && d.set(l[f]);
|
|
2735
2735
|
}
|
|
2736
2736
|
}
|
|
2737
2737
|
mount(e) {
|
|
2738
|
-
this.current = e,
|
|
2738
|
+
this.current = e, Il.set(e, this), this.projection && !this.projection.instance && this.projection.mount(e), this.parent && this.isVariantNode && !this.isControllingVariants && (this.removeFromVariantTree = this.parent.addVariantChild(this)), this.values.forEach((n, i) => this.bindToMotionValue(i, n)), cr.current || Fl(), this.shouldReduceMotion = this.reducedMotionConfig === "never" ? !1 : this.reducedMotionConfig === "always" ? !0 : We.current, process.env.NODE_ENV !== "production" && sn(this.shouldReduceMotion !== !0, "You have Reduced Motion enabled on your device. Animations may not appear as expected.", "reduced-motion-disabled"), this.parent?.addChild(this), this.update(this.props, this.presenceContext);
|
|
2739
2739
|
}
|
|
2740
2740
|
unmount() {
|
|
2741
2741
|
this.projection && this.projection.unmount(), it(this.notifyUpdate), it(this.render), this.valueSubscriptions.forEach((e) => e()), this.valueSubscriptions.clear(), this.removeFromVariantTree && this.removeFromVariantTree(), this.parent?.removeChild(this);
|
|
@@ -2790,7 +2790,7 @@ class jl {
|
|
|
2790
2790
|
* removed with a re-render to work.
|
|
2791
2791
|
*/
|
|
2792
2792
|
measureViewportBox() {
|
|
2793
|
-
return this.current ? this.measureInstanceViewportBox(this.current, this.props) :
|
|
2793
|
+
return this.current ? this.measureInstanceViewportBox(this.current, this.props) : k();
|
|
2794
2794
|
}
|
|
2795
2795
|
getStaticValue(e) {
|
|
2796
2796
|
return this.latestValues[e];
|
|
@@ -2810,7 +2810,7 @@ class jl {
|
|
|
2810
2810
|
const o = "on" + s, r = e[o];
|
|
2811
2811
|
r && (this.propEventSubscriptions[s] = this.on(s, r));
|
|
2812
2812
|
}
|
|
2813
|
-
this.prevMotionValues =
|
|
2813
|
+
this.prevMotionValues = Ol(this, this.scrapeMotionValuesFromProps(e, this.prevProps, this), this.prevMotionValues), this.handleChildMotionValue && this.handleChildMotionValue();
|
|
2814
2814
|
}
|
|
2815
2815
|
getProps() {
|
|
2816
2816
|
return this.props;
|
|
@@ -2875,7 +2875,7 @@ class jl {
|
|
|
2875
2875
|
*/
|
|
2876
2876
|
readValue(e, n) {
|
|
2877
2877
|
let i = this.latestValues[e] !== void 0 || !this.current ? this.latestValues[e] : this.getBaseTargetFromProps(this.props, e) ?? this.readValueFromInstance(this.current, e, this.options);
|
|
2878
|
-
return i != null && (typeof i == "string" && (es(i) || is(i)) ? i = parseFloat(i) : !Ha(i) && st.test(n) && (i = js(e, n)), this.setBaseTarget(e,
|
|
2878
|
+
return i != null && (typeof i == "string" && (es(i) || is(i)) ? i = parseFloat(i) : !Ha(i) && st.test(n) && (i = js(e, n)), this.setBaseTarget(e, O(i) ? i.get() : i)), O(i) ? i.get() : i;
|
|
2879
2879
|
}
|
|
2880
2880
|
/**
|
|
2881
2881
|
* Set the base target to later animate back to. This is currently
|
|
@@ -2898,7 +2898,7 @@ class jl {
|
|
|
2898
2898
|
if (n && i !== void 0)
|
|
2899
2899
|
return i;
|
|
2900
2900
|
const s = this.getBaseTargetFromProps(this.props, e);
|
|
2901
|
-
return s !== void 0 && !
|
|
2901
|
+
return s !== void 0 && !O(s) ? s : this.initialValues[e] !== void 0 && i === void 0 ? void 0 : this.baseTarget[e];
|
|
2902
2902
|
}
|
|
2903
2903
|
on(e, n) {
|
|
2904
2904
|
return this.events[e] || (this.events[e] = new nn()), this.events[e].add(n);
|
|
@@ -2926,7 +2926,7 @@ class ur extends jl {
|
|
|
2926
2926
|
handleChildMotionValue() {
|
|
2927
2927
|
this.childSubscription && (this.childSubscription(), delete this.childSubscription);
|
|
2928
2928
|
const { children: e } = this.props;
|
|
2929
|
-
|
|
2929
|
+
O(e) && (this.childSubscription = e.on("change", (n) => {
|
|
2930
2930
|
this.current && (this.current.textContent = `${n}`);
|
|
2931
2931
|
}));
|
|
2932
2932
|
}
|
|
@@ -2997,14 +2997,14 @@ function Kl(t, e, n, i) {
|
|
|
2997
2997
|
}
|
|
2998
2998
|
class Wl extends ur {
|
|
2999
2999
|
constructor() {
|
|
3000
|
-
super(...arguments), this.type = "svg", this.isSVGTag = !1, this.measureInstanceViewportBox =
|
|
3000
|
+
super(...arguments), this.type = "svg", this.isSVGTag = !1, this.measureInstanceViewportBox = k;
|
|
3001
3001
|
}
|
|
3002
3002
|
getBaseTargetFromProps(e, n) {
|
|
3003
3003
|
return e[n];
|
|
3004
3004
|
}
|
|
3005
3005
|
readValueFromInstance(e, n) {
|
|
3006
3006
|
if (Mt.has(n)) {
|
|
3007
|
-
const i =
|
|
3007
|
+
const i = Os(n);
|
|
3008
3008
|
return i && i.default || 0;
|
|
3009
3009
|
}
|
|
3010
3010
|
return n = fr.has(n) ? n : Mn(n), e.getAttribute(n);
|
|
@@ -3046,7 +3046,7 @@ function _l(t, e) {
|
|
|
3046
3046
|
}
|
|
3047
3047
|
}
|
|
3048
3048
|
function Gl(t) {
|
|
3049
|
-
return !!(
|
|
3049
|
+
return !!(O(t) && t.add);
|
|
3050
3050
|
}
|
|
3051
3051
|
function ze(t, e) {
|
|
3052
3052
|
const n = t.getValue("willChange");
|
|
@@ -3220,7 +3220,7 @@ function yr(t) {
|
|
|
3220
3220
|
const e = {};
|
|
3221
3221
|
for (let n = 0; n < rc; n++) {
|
|
3222
3222
|
const i = Pn[n], s = t.props[i];
|
|
3223
|
-
(
|
|
3223
|
+
(jt(s) || s === !1) && (e[i] = s);
|
|
3224
3224
|
}
|
|
3225
3225
|
return e;
|
|
3226
3226
|
}
|
|
@@ -3245,7 +3245,7 @@ function cc(t) {
|
|
|
3245
3245
|
const { props: u } = t, c = yr(t.parent) || {}, h = [], f = /* @__PURE__ */ new Set();
|
|
3246
3246
|
let d = {}, m = 1 / 0;
|
|
3247
3247
|
for (let v = 0; v < ac; v++) {
|
|
3248
|
-
const p = oc[v], T = n[p], y = u[p] !== void 0 ? u[p] : c[p], P =
|
|
3248
|
+
const p = oc[v], T = n[p], y = u[p] !== void 0 ? u[p] : c[p], P = jt(y), x = p === l ? T.isActive : null;
|
|
3249
3249
|
x === !1 && (m = v);
|
|
3250
3250
|
let S = y === c[p] && y !== u[p] && P;
|
|
3251
3251
|
if (S && i && t.manuallyAnimateOnMount && (S = !1), T.protectedKeys = { ...d }, // If it isn't active and hasn't *just* been set as inactive
|
|
@@ -3256,7 +3256,7 @@ function cc(t) {
|
|
|
3256
3256
|
const A = uc(T.prevProp, y);
|
|
3257
3257
|
let b = A || // If we're making this variant active, we want to always make it active
|
|
3258
3258
|
p === l && T.isActive && !S && P || // If we removed a higher-priority variant (i is in reverse order)
|
|
3259
|
-
v > m && P,
|
|
3259
|
+
v > m && P, R = !1;
|
|
3260
3260
|
const E = Array.isArray(y) ? y : [y];
|
|
3261
3261
|
let tt = E.reduce(s(p), {});
|
|
3262
3262
|
x === !1 && (tt = {});
|
|
@@ -3264,7 +3264,7 @@ function cc(t) {
|
|
|
3264
3264
|
...Rn,
|
|
3265
3265
|
...tt
|
|
3266
3266
|
}, Ln = (B) => {
|
|
3267
|
-
b = !0, f.has(B) && (
|
|
3267
|
+
b = !0, f.has(B) && (R = !0, f.delete(B)), T.needsAnimating[B] = !0;
|
|
3268
3268
|
const U = t.getValue(B);
|
|
3269
3269
|
U && (U.liveStyle = !1);
|
|
3270
3270
|
};
|
|
@@ -3277,7 +3277,7 @@ function cc(t) {
|
|
|
3277
3277
|
}
|
|
3278
3278
|
T.prevProp = y, T.prevResolvedValues = tt, T.isActive && (d = { ...d, ...tt }), i && t.blockInitialAnimation && (b = !1);
|
|
3279
3279
|
const kn = S && A;
|
|
3280
|
-
b && (!kn ||
|
|
3280
|
+
b && (!kn || R) && h.push(...E.map((B) => {
|
|
3281
3281
|
const U = { type: p };
|
|
3282
3282
|
if (typeof B == "string" && i && !kn && t.manuallyAnimateOnMount && t.parent) {
|
|
3283
3283
|
const { parent: at } = t, pt = bt(at, B);
|
|
@@ -3412,10 +3412,10 @@ const mc = {
|
|
|
3412
3412
|
Feature: dc
|
|
3413
3413
|
}
|
|
3414
3414
|
};
|
|
3415
|
-
function
|
|
3415
|
+
function Ut(t, e, n, i = { passive: !0 }) {
|
|
3416
3416
|
return t.addEventListener(e, n, i), () => t.removeEventListener(e, n);
|
|
3417
3417
|
}
|
|
3418
|
-
function
|
|
3418
|
+
function zt(t) {
|
|
3419
3419
|
return {
|
|
3420
3420
|
point: {
|
|
3421
3421
|
x: t.pageX,
|
|
@@ -3423,9 +3423,9 @@ function Ht(t) {
|
|
|
3423
3423
|
}
|
|
3424
3424
|
};
|
|
3425
3425
|
}
|
|
3426
|
-
const pc = (t) => (e) => xn(e) && t(e,
|
|
3426
|
+
const pc = (t) => (e) => xn(e) && t(e, zt(e));
|
|
3427
3427
|
function kt(t, e, n, i) {
|
|
3428
|
-
return
|
|
3428
|
+
return Ut(t, e, pc(n), i);
|
|
3429
3429
|
}
|
|
3430
3430
|
const vr = 1e-4, gc = 1 - vr, yc = 1 + vr, Tr = 0.01, vc = 0 - Tr, Tc = 0 + Tr;
|
|
3431
3431
|
function j(t) {
|
|
@@ -3449,10 +3449,10 @@ function wc(t, e, n) {
|
|
|
3449
3449
|
function yi(t, e, n) {
|
|
3450
3450
|
t.min = e.min - n.min, t.max = t.min + j(e);
|
|
3451
3451
|
}
|
|
3452
|
-
function
|
|
3452
|
+
function se(t, e, n) {
|
|
3453
3453
|
yi(t.x, e.x, n.x), yi(t.y, e.y, n.y);
|
|
3454
3454
|
}
|
|
3455
|
-
function
|
|
3455
|
+
function K(t) {
|
|
3456
3456
|
return [t("x"), t("y")];
|
|
3457
3457
|
}
|
|
3458
3458
|
const xr = ({ current: t }) => t ? t.ownerDocument.defaultView : null, vi = (t, e) => Math.abs(t - e);
|
|
@@ -3484,10 +3484,10 @@ class wr {
|
|
|
3484
3484
|
}, !xn(e))
|
|
3485
3485
|
return;
|
|
3486
3486
|
this.dragSnapToOrigin = o, this.handlers = n, this.transformPagePoint = i, this.distanceThreshold = r, this.contextWindow = s || window;
|
|
3487
|
-
const a =
|
|
3487
|
+
const a = zt(e), l = ve(a, this.transformPagePoint), { point: u } = l, { timestamp: c } = F;
|
|
3488
3488
|
this.history = [{ ...u, timestamp: c }];
|
|
3489
3489
|
const { onSessionStart: h } = n;
|
|
3490
|
-
h && h(e, Te(l, this.history)), this.removeListeners =
|
|
3490
|
+
h && h(e, Te(l, this.history)), this.removeListeners = Kt(kt(this.contextWindow, "pointermove", this.handlePointerMove), kt(this.contextWindow, "pointerup", this.handlePointerUp), kt(this.contextWindow, "pointercancel", this.handlePointerUp));
|
|
3491
3491
|
}
|
|
3492
3492
|
updateHandlers(e) {
|
|
3493
3493
|
this.handlers = e;
|
|
@@ -3525,7 +3525,7 @@ function Sc(t, e) {
|
|
|
3525
3525
|
n--;
|
|
3526
3526
|
if (!i)
|
|
3527
3527
|
return { x: 0, y: 0 };
|
|
3528
|
-
const o = /* @__PURE__ */
|
|
3528
|
+
const o = /* @__PURE__ */ W(s.timestamp - i.timestamp);
|
|
3529
3529
|
if (o === 0)
|
|
3530
3530
|
return { x: 0, y: 0 };
|
|
3531
3531
|
const r = {
|
|
@@ -3562,7 +3562,7 @@ function Cc(t, e) {
|
|
|
3562
3562
|
function Dc(t, e) {
|
|
3563
3563
|
let n = 0.5;
|
|
3564
3564
|
const i = j(t), s = j(e);
|
|
3565
|
-
return s > i ? n = /* @__PURE__ */
|
|
3565
|
+
return s > i ? n = /* @__PURE__ */ Ft(e.min, e.max - i, t.min) : i > s && (n = /* @__PURE__ */ Ft(t.min, t.max - s, e.min)), Z(0, 1, n);
|
|
3566
3566
|
}
|
|
3567
3567
|
function Mc(t, e) {
|
|
3568
3568
|
const n = {};
|
|
@@ -3587,7 +3587,7 @@ function Pi(t, e) {
|
|
|
3587
3587
|
const Rc = /* @__PURE__ */ new WeakMap();
|
|
3588
3588
|
class Lc {
|
|
3589
3589
|
constructor(e) {
|
|
3590
|
-
this.openDragLock = null, this.isDragging = !1, this.currentDirection = null, this.originPoint = { x: 0, y: 0 }, this.constraints = !1, this.hasMutatedConstraints = !1, this.elastic =
|
|
3590
|
+
this.openDragLock = null, this.isDragging = !1, this.currentDirection = null, this.originPoint = { x: 0, y: 0 }, this.constraints = !1, this.hasMutatedConstraints = !1, this.elastic = k(), this.latestPointerEvent = null, this.latestPanInfo = null, this.visualElement = e;
|
|
3591
3591
|
}
|
|
3592
3592
|
start(e, { snapToCursor: n = !1, distanceThreshold: i } = {}) {
|
|
3593
3593
|
const { presenceContext: s } = this.visualElement;
|
|
@@ -3595,12 +3595,12 @@ class Lc {
|
|
|
3595
3595
|
return;
|
|
3596
3596
|
const o = (h) => {
|
|
3597
3597
|
const { dragSnapToOrigin: f } = this.getProps();
|
|
3598
|
-
f ? this.pauseAnimation() : this.stopAnimation(), n && this.snapToCursor(
|
|
3598
|
+
f ? this.pauseAnimation() : this.stopAnimation(), n && this.snapToCursor(zt(h).point);
|
|
3599
3599
|
}, r = (h, f) => {
|
|
3600
3600
|
const { drag: d, dragPropagation: m, onDragStart: g } = this.getProps();
|
|
3601
|
-
if (d && !m && (this.openDragLock && this.openDragLock(), this.openDragLock =
|
|
3601
|
+
if (d && !m && (this.openDragLock && this.openDragLock(), this.openDragLock = Oa(d), !this.openDragLock))
|
|
3602
3602
|
return;
|
|
3603
|
-
this.latestPointerEvent = h, this.latestPanInfo = f, this.isDragging = !0, this.currentDirection = null, this.resolveConstraints(), this.visualElement.projection && (this.visualElement.projection.isAnimationBlocked = !0, this.visualElement.projection.target = void 0),
|
|
3603
|
+
this.latestPointerEvent = h, this.latestPanInfo = f, this.isDragging = !0, this.currentDirection = null, this.resolveConstraints(), this.visualElement.projection && (this.visualElement.projection.isAnimationBlocked = !0, this.visualElement.projection.target = void 0), K((p) => {
|
|
3604
3604
|
let T = this.getAxisMotionValue(p).get() || 0;
|
|
3605
3605
|
if (X.test(T)) {
|
|
3606
3606
|
const { projection: y } = this.visualElement;
|
|
@@ -3626,7 +3626,7 @@ class Lc {
|
|
|
3626
3626
|
this.updateAxis("x", f.point, p), this.updateAxis("y", f.point, p), this.visualElement.render(), v && v(h, f);
|
|
3627
3627
|
}, l = (h, f) => {
|
|
3628
3628
|
this.latestPointerEvent = h, this.latestPanInfo = f, this.stop(h, f), this.latestPointerEvent = null, this.latestPanInfo = null;
|
|
3629
|
-
}, u = () =>
|
|
3629
|
+
}, u = () => K((h) => this.getAnimationState(h) === "paused" && this.getAxisMotionValue(h).animation?.play()), { dragSnapToOrigin: c } = this.getProps();
|
|
3630
3630
|
this.panSession = new wr(e, {
|
|
3631
3631
|
onSessionStart: o,
|
|
3632
3632
|
onStart: r,
|
|
@@ -3664,7 +3664,7 @@ class Lc {
|
|
|
3664
3664
|
}
|
|
3665
3665
|
updateAxis(e, n, i) {
|
|
3666
3666
|
const { drag: s } = this.getProps();
|
|
3667
|
-
if (!i || !
|
|
3667
|
+
if (!i || !Xt(e, s, this.currentDirection))
|
|
3668
3668
|
return;
|
|
3669
3669
|
const o = this.getAxisMotionValue(e);
|
|
3670
3670
|
let r = this.originPoint[e] + i[e];
|
|
@@ -3672,7 +3672,7 @@ class Lc {
|
|
|
3672
3672
|
}
|
|
3673
3673
|
resolveConstraints() {
|
|
3674
3674
|
const { dragConstraints: e, dragElastic: n } = this.getProps(), i = this.visualElement.projection && !this.visualElement.projection.layout ? this.visualElement.projection.measure(!1) : this.visualElement.projection?.layout, s = this.constraints;
|
|
3675
|
-
e && vt(e) ? this.constraints || (this.constraints = this.resolveRefConstraints()) : e && i ? this.constraints = Vc(i.layoutBox, e) : this.constraints = !1, this.elastic = Ec(n), s !== this.constraints && i && this.constraints && !this.hasMutatedConstraints &&
|
|
3675
|
+
e && vt(e) ? this.constraints || (this.constraints = this.resolveRefConstraints()) : e && i ? this.constraints = Vc(i.layoutBox, e) : this.constraints = !1, this.elastic = Ec(n), s !== this.constraints && i && this.constraints && !this.hasMutatedConstraints && K((o) => {
|
|
3676
3676
|
this.constraints !== !1 && this.getAxisMotionValue(o) && (this.constraints[o] = Mc(i.layoutBox[o], this.constraints[o]));
|
|
3677
3677
|
});
|
|
3678
3678
|
}
|
|
@@ -3694,8 +3694,8 @@ class Lc {
|
|
|
3694
3694
|
return r;
|
|
3695
3695
|
}
|
|
3696
3696
|
startAnimation(e) {
|
|
3697
|
-
const { drag: n, dragMomentum: i, dragElastic: s, dragTransition: o, dragSnapToOrigin: r, onDragTransitionEnd: a } = this.getProps(), l = this.constraints || {}, u =
|
|
3698
|
-
if (!
|
|
3697
|
+
const { drag: n, dragMomentum: i, dragElastic: s, dragTransition: o, dragSnapToOrigin: r, onDragTransitionEnd: a } = this.getProps(), l = this.constraints || {}, u = K((c) => {
|
|
3698
|
+
if (!Xt(c, n, this.currentDirection))
|
|
3699
3699
|
return;
|
|
3700
3700
|
let h = l && l[c] || {};
|
|
3701
3701
|
r && (h = { min: 0, max: 0 });
|
|
@@ -3719,10 +3719,10 @@ class Lc {
|
|
|
3719
3719
|
return ze(this.visualElement, e), i.start(En(e, i, 0, n, this.visualElement, !1));
|
|
3720
3720
|
}
|
|
3721
3721
|
stopAnimation() {
|
|
3722
|
-
|
|
3722
|
+
K((e) => this.getAxisMotionValue(e).stop());
|
|
3723
3723
|
}
|
|
3724
3724
|
pauseAnimation() {
|
|
3725
|
-
|
|
3725
|
+
K((e) => this.getAxisMotionValue(e).animation?.pause());
|
|
3726
3726
|
}
|
|
3727
3727
|
getAnimationState(e) {
|
|
3728
3728
|
return this.getAxisMotionValue(e).animation?.state;
|
|
@@ -3738,9 +3738,9 @@ class Lc {
|
|
|
3738
3738
|
return s || this.visualElement.getValue(e, (i.initial ? i.initial[e] : void 0) || 0);
|
|
3739
3739
|
}
|
|
3740
3740
|
snapToCursor(e) {
|
|
3741
|
-
|
|
3741
|
+
K((n) => {
|
|
3742
3742
|
const { drag: i } = this.getProps();
|
|
3743
|
-
if (!
|
|
3743
|
+
if (!Xt(n, i, this.currentDirection))
|
|
3744
3744
|
return;
|
|
3745
3745
|
const { projection: s } = this.visualElement, o = this.getAxisMotionValue(n);
|
|
3746
3746
|
if (s && s.layout) {
|
|
@@ -3762,7 +3762,7 @@ class Lc {
|
|
|
3762
3762
|
return;
|
|
3763
3763
|
this.stopAnimation();
|
|
3764
3764
|
const s = { x: 0, y: 0 };
|
|
3765
|
-
|
|
3765
|
+
K((r) => {
|
|
3766
3766
|
const a = this.getAxisMotionValue(r);
|
|
3767
3767
|
if (a && this.constraints !== !1) {
|
|
3768
3768
|
const l = a.get();
|
|
@@ -3770,8 +3770,8 @@ class Lc {
|
|
|
3770
3770
|
}
|
|
3771
3771
|
});
|
|
3772
3772
|
const { transformTemplate: o } = this.visualElement.getProps();
|
|
3773
|
-
this.visualElement.current.style.transform = o ? o({}, "") : "none", i.root && i.root.updateScroll(), i.updateLayout(), this.resolveConstraints(),
|
|
3774
|
-
if (!
|
|
3773
|
+
this.visualElement.current.style.transform = o ? o({}, "") : "none", i.root && i.root.updateScroll(), i.updateLayout(), this.resolveConstraints(), K((r) => {
|
|
3774
|
+
if (!Xt(r, e, null))
|
|
3775
3775
|
return;
|
|
3776
3776
|
const a = this.getAxisMotionValue(r), { min: l, max: u } = this.constraints[r];
|
|
3777
3777
|
a.set(M(l, u, s[r]));
|
|
@@ -3789,8 +3789,8 @@ class Lc {
|
|
|
3789
3789
|
vt(l) && l.current && (this.constraints = this.resolveRefConstraints());
|
|
3790
3790
|
}, { projection: s } = this.visualElement, o = s.addEventListener("measure", i);
|
|
3791
3791
|
s && !s.layout && (s.root && s.root.updateScroll(), s.updateLayout()), C.read(i);
|
|
3792
|
-
const r =
|
|
3793
|
-
this.isDragging && u && (
|
|
3792
|
+
const r = Ut(window, "resize", () => this.scalePositionWithinConstraints()), a = s.addEventListener("didUpdate", (({ delta: l, hasLayoutChanged: u }) => {
|
|
3793
|
+
this.isDragging && u && (K((c) => {
|
|
3794
3794
|
const h = this.getAxisMotionValue(c);
|
|
3795
3795
|
h && (this.originPoint[c] += l[c].translate, h.set(h.get() + l[c].translate));
|
|
3796
3796
|
}), this.visualElement.render());
|
|
@@ -3812,7 +3812,7 @@ class Lc {
|
|
|
3812
3812
|
};
|
|
3813
3813
|
}
|
|
3814
3814
|
}
|
|
3815
|
-
function
|
|
3815
|
+
function Xt(t, e, n) {
|
|
3816
3816
|
return (e === !0 || e === t) && (n === null || n === t);
|
|
3817
3817
|
}
|
|
3818
3818
|
function kc(t, e = 10) {
|
|
@@ -3821,11 +3821,11 @@ function kc(t, e = 10) {
|
|
|
3821
3821
|
}
|
|
3822
3822
|
class Bc extends ot {
|
|
3823
3823
|
constructor(e) {
|
|
3824
|
-
super(e), this.removeGroupControls =
|
|
3824
|
+
super(e), this.removeGroupControls = z, this.removeListeners = z, this.controls = new Lc(e);
|
|
3825
3825
|
}
|
|
3826
3826
|
mount() {
|
|
3827
3827
|
const { dragControls: e } = this.node.getProps();
|
|
3828
|
-
e && (this.removeGroupControls = e.subscribe(this.controls)), this.removeListeners = this.controls.addListeners() ||
|
|
3828
|
+
e && (this.removeGroupControls = e.subscribe(this.controls)), this.removeListeners = this.controls.addListeners() || z;
|
|
3829
3829
|
}
|
|
3830
3830
|
unmount() {
|
|
3831
3831
|
this.removeGroupControls(), this.removeListeners();
|
|
@@ -3836,7 +3836,7 @@ const Si = (t) => (e, n) => {
|
|
|
3836
3836
|
};
|
|
3837
3837
|
class Fc extends ot {
|
|
3838
3838
|
constructor() {
|
|
3839
|
-
super(...arguments), this.removePointerDownListener =
|
|
3839
|
+
super(...arguments), this.removePointerDownListener = z;
|
|
3840
3840
|
}
|
|
3841
3841
|
onPointerDown(e) {
|
|
3842
3842
|
this.session = new wr(e, this.createPanHandlers(), {
|
|
@@ -3865,7 +3865,7 @@ class Fc extends ot {
|
|
|
3865
3865
|
this.removePointerDownListener(), this.session && this.session.end();
|
|
3866
3866
|
}
|
|
3867
3867
|
}
|
|
3868
|
-
const
|
|
3868
|
+
const Jt = {
|
|
3869
3869
|
/**
|
|
3870
3870
|
* Global flag as to whether the tree has animated since the last time
|
|
3871
3871
|
* we resized the window
|
|
@@ -3892,7 +3892,7 @@ const Et = {
|
|
|
3892
3892
|
const n = Ai(t, e.target.x), i = Ai(t, e.target.y);
|
|
3893
3893
|
return `${n}% ${i}%`;
|
|
3894
3894
|
}
|
|
3895
|
-
},
|
|
3895
|
+
}, Ic = {
|
|
3896
3896
|
correct: (t, { treeScale: e, projectionDelta: n }) => {
|
|
3897
3897
|
const i = t, s = st.parse(t);
|
|
3898
3898
|
if (s.length > 5)
|
|
@@ -3904,7 +3904,7 @@ const Et = {
|
|
|
3904
3904
|
}
|
|
3905
3905
|
};
|
|
3906
3906
|
let xe = !1;
|
|
3907
|
-
class
|
|
3907
|
+
class Oc extends Xr {
|
|
3908
3908
|
/**
|
|
3909
3909
|
* This only mounts projection nodes for components that
|
|
3910
3910
|
* need measuring, we might want to do it for all components
|
|
@@ -3917,7 +3917,7 @@ class Ic extends Xr {
|
|
|
3917
3917
|
}), o.setOptions({
|
|
3918
3918
|
...o.options,
|
|
3919
3919
|
onExitComplete: () => this.safeToRemove()
|
|
3920
|
-
})),
|
|
3920
|
+
})), Jt.hasEverUpdated = !0;
|
|
3921
3921
|
}
|
|
3922
3922
|
getSnapshotBeforeUpdate(e) {
|
|
3923
3923
|
const { layoutDependency: n, visualElement: i, drag: s, isPresent: o } = this.props, { projection: r } = i;
|
|
@@ -3945,8 +3945,8 @@ class Ic extends Xr {
|
|
|
3945
3945
|
}
|
|
3946
3946
|
}
|
|
3947
3947
|
function Pr(t) {
|
|
3948
|
-
const [e, n] = Hs(), i =
|
|
3949
|
-
return V(
|
|
3948
|
+
const [e, n] = Hs(), i = I(qe);
|
|
3949
|
+
return V(Oc, { ...t, layoutGroup: i, switchLayoutGroup: I(ir), isPresent: e, safeToRemove: n });
|
|
3950
3950
|
}
|
|
3951
3951
|
const jc = {
|
|
3952
3952
|
borderRadius: {
|
|
@@ -3962,10 +3962,10 @@ const jc = {
|
|
|
3962
3962
|
borderTopRightRadius: Et,
|
|
3963
3963
|
borderBottomLeftRadius: Et,
|
|
3964
3964
|
borderBottomRightRadius: Et,
|
|
3965
|
-
boxShadow:
|
|
3965
|
+
boxShadow: Ic
|
|
3966
3966
|
};
|
|
3967
3967
|
function Nc(t, e, n) {
|
|
3968
|
-
const i =
|
|
3968
|
+
const i = O(t) ? t : St(t);
|
|
3969
3969
|
return i.start(En("", i, e, n)), i.animation;
|
|
3970
3970
|
}
|
|
3971
3971
|
const Uc = (t, e) => t.depth - e.depth;
|
|
@@ -4005,21 +4005,21 @@ function zc(t, e, n, i, s, o) {
|
|
|
4005
4005
|
function Di(t, e) {
|
|
4006
4006
|
return t[e] !== void 0 ? t[e] : t.borderRadius;
|
|
4007
4007
|
}
|
|
4008
|
-
const Hc = /* @__PURE__ */ Ar(0, 0.5, hs), _c = /* @__PURE__ */ Ar(0.5, 0.95,
|
|
4008
|
+
const Hc = /* @__PURE__ */ Ar(0, 0.5, hs), _c = /* @__PURE__ */ Ar(0.5, 0.95, z);
|
|
4009
4009
|
function Ar(t, e, n) {
|
|
4010
|
-
return (i) => i < t ? 0 : i > e ? 1 : n(/* @__PURE__ */
|
|
4010
|
+
return (i) => i < t ? 0 : i > e ? 1 : n(/* @__PURE__ */ Ft(t, e, i));
|
|
4011
4011
|
}
|
|
4012
4012
|
function Mi(t, e) {
|
|
4013
4013
|
t.min = e.min, t.max = e.max;
|
|
4014
4014
|
}
|
|
4015
|
-
function
|
|
4015
|
+
function H(t, e) {
|
|
4016
4016
|
Mi(t.x, e.x), Mi(t.y, e.y);
|
|
4017
4017
|
}
|
|
4018
4018
|
function Ei(t, e) {
|
|
4019
4019
|
t.translate = e.translate, t.scale = e.scale, t.originPoint = e.originPoint, t.origin = e.origin;
|
|
4020
4020
|
}
|
|
4021
4021
|
function Ri(t, e, n, i, s) {
|
|
4022
|
-
return t -= e, t =
|
|
4022
|
+
return t -= e, t = ie(t, 1 / n, i), s !== void 0 && (t = ie(t, 1 / s, i)), t;
|
|
4023
4023
|
}
|
|
4024
4024
|
function Gc(t, e = 0, n = 1, i = 0.5, s, o = t, r = t) {
|
|
4025
4025
|
if (X.test(e) && (e = parseFloat(e), e = M(r.min, r.max, e / 100) - r.min), typeof e != "number")
|
|
@@ -4046,13 +4046,13 @@ function Fi(t, e) {
|
|
|
4046
4046
|
function qc(t, e) {
|
|
4047
4047
|
return Fi(t.x, e.x) && Fi(t.y, e.y);
|
|
4048
4048
|
}
|
|
4049
|
-
function
|
|
4049
|
+
function Ii(t, e) {
|
|
4050
4050
|
return Math.round(t.min) === Math.round(e.min) && Math.round(t.max) === Math.round(e.max);
|
|
4051
4051
|
}
|
|
4052
4052
|
function Cr(t, e) {
|
|
4053
|
-
return
|
|
4053
|
+
return Ii(t.x, e.x) && Ii(t.y, e.y);
|
|
4054
4054
|
}
|
|
4055
|
-
function
|
|
4055
|
+
function Oi(t) {
|
|
4056
4056
|
return j(t.x) / j(t.y);
|
|
4057
4057
|
}
|
|
4058
4058
|
function ji(t, e) {
|
|
@@ -4145,11 +4145,11 @@ function Dr(t) {
|
|
|
4145
4145
|
function Mr({ attachResizeListener: t, defaultParent: e, measureScroll: n, checkIsScrollRoot: i, resetTransform: s }) {
|
|
4146
4146
|
return class {
|
|
4147
4147
|
constructor(r = {}, a = e?.()) {
|
|
4148
|
-
this.id = tu++, this.animationId = 0, this.animationCommitId = 0, this.children = /* @__PURE__ */ new Set(), this.options = {}, this.isTreeAnimating = !1, this.isAnimationBlocked = !1, this.isLayoutDirty = !1, this.isProjectionDirty = !1, this.isSharedProjectionDirty = !1, this.isTransformDirty = !1, this.updateManuallyBlocked = !1, this.updateBlockedByResize = !1, this.isUpdating = !1, this.isSVG = !1, this.needsReset = !1, this.shouldResetTransform = !1, this.hasCheckedOptimisedAppear = !1, this.treeScale = { x: 1, y: 1 }, this.eventHandlers = /* @__PURE__ */ new Map(), this.hasTreeAnimated = !1, this.updateScheduled = !1, this.scheduleUpdate = () => this.update(), this.projectionUpdateScheduled = !1, this.checkUpdateFailed = () => {
|
|
4148
|
+
this.id = tu++, this.animationId = 0, this.animationCommitId = 0, this.children = /* @__PURE__ */ new Set(), this.options = {}, this.isTreeAnimating = !1, this.isAnimationBlocked = !1, this.isLayoutDirty = !1, this.isProjectionDirty = !1, this.isSharedProjectionDirty = !1, this.isTransformDirty = !1, this.updateManuallyBlocked = !1, this.updateBlockedByResize = !1, this.isUpdating = !1, this.isSVG = !1, this.needsReset = !1, this.shouldResetTransform = !1, this.hasCheckedOptimisedAppear = !1, this.treeScale = { x: 1, y: 1 }, this.eventHandlers = /* @__PURE__ */ new Map(), this.hasTreeAnimated = !1, this.layoutVersion = 0, this.updateScheduled = !1, this.scheduleUpdate = () => this.update(), this.projectionUpdateScheduled = !1, this.checkUpdateFailed = () => {
|
|
4149
4149
|
this.isUpdating && (this.isUpdating = !1, this.clearAllSnapshots());
|
|
4150
4150
|
}, this.updateProjection = () => {
|
|
4151
4151
|
this.projectionUpdateScheduled = !1, this.nodes.forEach(iu), this.nodes.forEach(au), this.nodes.forEach(lu), this.nodes.forEach(su);
|
|
4152
|
-
}, this.resolvedRelativeTargetAt = 0, this.hasProjected = !1, this.isVisible = !0, this.animationProgress = 0, this.sharedNodes = /* @__PURE__ */ new Map(), this.latestValues = r, this.root = a ? a.root || a : this, this.path = a ? [...a.path, a] : [], this.parent = a, this.depth = a ? a.depth + 1 : 0;
|
|
4152
|
+
}, this.resolvedRelativeTargetAt = 0, this.linkedParentVersion = 0, this.hasProjected = !1, this.isVisible = !0, this.animationProgress = 0, this.sharedNodes = /* @__PURE__ */ new Map(), this.latestValues = r, this.root = a ? a.root || a : this, this.path = a ? [...a.path, a] : [], this.parent = a, this.depth = a ? a.depth + 1 : 0;
|
|
4153
4153
|
for (let l = 0; l < this.path.length; l++)
|
|
4154
4154
|
this.path[l].shouldResetTransform = !0;
|
|
4155
4155
|
this.root === this && (this.nodes = new Kc());
|
|
@@ -4179,7 +4179,7 @@ function Mr({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
|
|
|
4179
4179
|
h = window.innerWidth;
|
|
4180
4180
|
}), t(r, () => {
|
|
4181
4181
|
const d = window.innerWidth;
|
|
4182
|
-
d !== h && (h = d, this.root.updateBlockedByResize = !0, c && c(), c = Wc(f, 250),
|
|
4182
|
+
d !== h && (h = d, this.root.updateBlockedByResize = !0, c && c(), c = Wc(f, 250), Jt.hasAnimatedSinceResize && (Jt.hasAnimatedSinceResize = !1, this.nodes.forEach(Ki)));
|
|
4183
4183
|
});
|
|
4184
4184
|
}
|
|
4185
4185
|
a && this.root.registerSharedNode(a, this), this.options.animate !== !1 && u && (a || l) && this.addEventListener("didUpdate", ({ delta: c, hasLayoutChanged: h, hasRelativeLayoutChanged: f, layout: d }) => {
|
|
@@ -4285,7 +4285,7 @@ function Mr({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
|
|
|
4285
4285
|
for (let l = 0; l < this.path.length; l++)
|
|
4286
4286
|
this.path[l].updateScroll();
|
|
4287
4287
|
const r = this.layout;
|
|
4288
|
-
this.layout = this.measure(!1), this.layoutCorrected =
|
|
4288
|
+
this.layout = this.measure(!1), this.layoutVersion++, this.layoutCorrected = k(), this.isLayoutDirty = !1, this.projectionDelta = void 0, this.notifyListeners("measure", this.layout.layoutBox);
|
|
4289
4289
|
const { visualElement: a } = this.options;
|
|
4290
4290
|
a && a.notify("LayoutMeasure", this.layout.layoutBox, r ? r.layoutBox : void 0);
|
|
4291
4291
|
}
|
|
@@ -4322,7 +4322,7 @@ function Mr({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
|
|
|
4322
4322
|
measurePageBox() {
|
|
4323
4323
|
const { visualElement: r } = this.options;
|
|
4324
4324
|
if (!r)
|
|
4325
|
-
return
|
|
4325
|
+
return k();
|
|
4326
4326
|
const a = r.measureViewportBox();
|
|
4327
4327
|
if (!(this.scroll?.wasRoot || this.path.some(pu))) {
|
|
4328
4328
|
const { scroll: u } = this.root;
|
|
@@ -4331,18 +4331,18 @@ function Mr({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
|
|
|
4331
4331
|
return a;
|
|
4332
4332
|
}
|
|
4333
4333
|
removeElementScroll(r) {
|
|
4334
|
-
const a =
|
|
4335
|
-
if (
|
|
4334
|
+
const a = k();
|
|
4335
|
+
if (H(a, r), this.scroll?.wasRoot)
|
|
4336
4336
|
return a;
|
|
4337
4337
|
for (let l = 0; l < this.path.length; l++) {
|
|
4338
4338
|
const u = this.path[l], { scroll: c, options: h } = u;
|
|
4339
|
-
u !== this.root && c && h.layoutScroll && (c.wasRoot &&
|
|
4339
|
+
u !== this.root && c && h.layoutScroll && (c.wasRoot && H(a, r), Tt(a.x, c.offset.x), Tt(a.y, c.offset.y));
|
|
4340
4340
|
}
|
|
4341
4341
|
return a;
|
|
4342
4342
|
}
|
|
4343
4343
|
applyTransform(r, a = !1) {
|
|
4344
|
-
const l =
|
|
4345
|
-
|
|
4344
|
+
const l = k();
|
|
4345
|
+
H(l, r);
|
|
4346
4346
|
for (let u = 0; u < this.path.length; u++) {
|
|
4347
4347
|
const c = this.path[u];
|
|
4348
4348
|
!a && c.options.layoutScroll && c.scroll && c !== c.root && xt(l, {
|
|
@@ -4353,15 +4353,15 @@ function Mr({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
|
|
|
4353
4353
|
return ct(this.latestValues) && xt(l, this.latestValues), l;
|
|
4354
4354
|
}
|
|
4355
4355
|
removeTransform(r) {
|
|
4356
|
-
const a =
|
|
4357
|
-
|
|
4356
|
+
const a = k();
|
|
4357
|
+
H(a, r);
|
|
4358
4358
|
for (let l = 0; l < this.path.length; l++) {
|
|
4359
4359
|
const u = this.path[l];
|
|
4360
4360
|
if (!u.instance || !ct(u.latestValues))
|
|
4361
4361
|
continue;
|
|
4362
4362
|
Ue(u.latestValues) && u.updateSnapshot();
|
|
4363
|
-
const c =
|
|
4364
|
-
|
|
4363
|
+
const c = k(), h = u.measurePageBox();
|
|
4364
|
+
H(c, h), ki(a, u.latestValues, u.snapshot ? u.snapshot.layoutBox : void 0, c);
|
|
4365
4365
|
}
|
|
4366
4366
|
return ct(this.latestValues) && ki(a, this.latestValues), a;
|
|
4367
4367
|
}
|
|
@@ -4388,17 +4388,11 @@ function Mr({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
|
|
|
4388
4388
|
if (!(r || l && this.isSharedProjectionDirty || this.isProjectionDirty || this.parent?.isProjectionDirty || this.attemptToResolveRelativeTarget || this.root.updateBlockedByResize))
|
|
4389
4389
|
return;
|
|
4390
4390
|
const { layout: c, layoutId: h } = this.options;
|
|
4391
|
-
if (!
|
|
4392
|
-
|
|
4393
|
-
|
|
4394
|
-
|
|
4395
|
-
|
|
4396
|
-
if (!(!this.relativeTarget && !this.targetDelta) && (this.target || (this.target = R(), this.targetWithTransforms = R()), this.relativeTarget && this.relativeTargetOrigin && this.relativeParent && this.relativeParent.target ? (this.forceRelativeParentToResolveTarget(), wc(this.target, this.relativeTarget, this.relativeParent.target)) : this.targetDelta ? (this.resumingFrom ? this.target = this.applyTransform(this.layout.layoutBox) : K(this.target, this.layout.layoutBox), ar(this.target, this.targetDelta)) : K(this.target, this.layout.layoutBox), this.attemptToResolveRelativeTarget)) {
|
|
4397
|
-
this.attemptToResolveRelativeTarget = !1;
|
|
4398
|
-
const f = this.getClosestProjectingParent();
|
|
4399
|
-
f && !!f.resumingFrom == !!this.resumingFrom && !f.options.layoutScroll && f.target && this.animationProgress !== 1 ? (this.relativeParent = f, this.forceRelativeParentToResolveTarget(), this.relativeTarget = R(), this.relativeTargetOrigin = R(), Ft(this.relativeTargetOrigin, this.target, f.target), K(this.relativeTarget, this.relativeTargetOrigin)) : this.relativeParent = this.relativeTarget = void 0;
|
|
4400
|
-
}
|
|
4401
|
-
}
|
|
4391
|
+
if (!this.layout || !(c || h))
|
|
4392
|
+
return;
|
|
4393
|
+
this.resolvedRelativeTargetAt = F.timestamp;
|
|
4394
|
+
const f = this.getClosestProjectingParent();
|
|
4395
|
+
f && this.linkedParentVersion !== f.layoutVersion && !f.options.layoutRoot && this.removeRelativeTarget(), !this.targetDelta && !this.relativeTarget && (f && f.layout ? this.createRelativeTarget(f, this.layout.layoutBox, f.layout.layoutBox) : this.removeRelativeTarget()), !(!this.relativeTarget && !this.targetDelta) && (this.target || (this.target = k(), this.targetWithTransforms = k()), this.relativeTarget && this.relativeTargetOrigin && this.relativeParent && this.relativeParent.target ? (this.forceRelativeParentToResolveTarget(), wc(this.target, this.relativeTarget, this.relativeParent.target)) : this.targetDelta ? (this.resumingFrom ? this.target = this.applyTransform(this.layout.layoutBox) : H(this.target, this.layout.layoutBox), ar(this.target, this.targetDelta)) : H(this.target, this.layout.layoutBox), this.attemptToResolveRelativeTarget && (this.attemptToResolveRelativeTarget = !1, f && !!f.resumingFrom == !!this.resumingFrom && !f.options.layoutScroll && f.target && this.animationProgress !== 1 ? this.createRelativeTarget(f, this.target, f.target) : this.relativeParent = this.relativeTarget = void 0));
|
|
4402
4396
|
}
|
|
4403
4397
|
getClosestProjectingParent() {
|
|
4404
4398
|
if (!(!this.parent || Ue(this.parent.latestValues) || or(this.parent.latestValues)))
|
|
@@ -4407,6 +4401,12 @@ function Mr({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
|
|
|
4407
4401
|
isProjecting() {
|
|
4408
4402
|
return !!((this.relativeTarget || this.targetDelta || this.options.layoutRoot) && this.layout);
|
|
4409
4403
|
}
|
|
4404
|
+
createRelativeTarget(r, a, l) {
|
|
4405
|
+
this.relativeParent = r, this.linkedParentVersion = r.layoutVersion, this.forceRelativeParentToResolveTarget(), this.relativeTarget = k(), this.relativeTargetOrigin = k(), se(this.relativeTargetOrigin, a, l), H(this.relativeTarget, this.relativeTargetOrigin);
|
|
4406
|
+
}
|
|
4407
|
+
removeRelativeTarget() {
|
|
4408
|
+
this.relativeParent = this.relativeTarget = void 0;
|
|
4409
|
+
}
|
|
4410
4410
|
calcProjection() {
|
|
4411
4411
|
const r = this.getLead(), a = !!this.resumingFrom || this !== r;
|
|
4412
4412
|
let l = !0;
|
|
@@ -4415,9 +4415,9 @@ function Mr({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
|
|
|
4415
4415
|
const { layout: u, layoutId: c } = this.options;
|
|
4416
4416
|
if (this.isTreeAnimating = !!(this.parent && this.parent.isTreeAnimating || this.currentAnimation || this.pendingAnimation), this.isTreeAnimating || (this.targetDelta = this.relativeTarget = void 0), !this.layout || !(u || c))
|
|
4417
4417
|
return;
|
|
4418
|
-
|
|
4418
|
+
H(this.layoutCorrected, this.layout.layoutBox);
|
|
4419
4419
|
const h = this.treeScale.x, f = this.treeScale.y;
|
|
4420
|
-
kl(this.layoutCorrected, this.treeScale, this.path, a), r.layout && !r.target && (this.treeScale.x !== 1 || this.treeScale.y !== 1) && (r.target = r.layout.layoutBox, r.targetWithTransforms =
|
|
4420
|
+
kl(this.layoutCorrected, this.treeScale, this.path, a), r.layout && !r.target && (this.treeScale.x !== 1 || this.treeScale.y !== 1) && (r.target = r.layout.layoutBox, r.targetWithTransforms = k());
|
|
4421
4421
|
const { target: d } = r;
|
|
4422
4422
|
if (!d) {
|
|
4423
4423
|
this.prevProjectionDelta && (this.createProjectionDeltas(), this.scheduleRender());
|
|
@@ -4444,17 +4444,17 @@ function Mr({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
|
|
|
4444
4444
|
setAnimationOrigin(r, a = !1) {
|
|
4445
4445
|
const l = this.snapshot, u = l ? l.latestValues : {}, c = { ...this.latestValues }, h = wt();
|
|
4446
4446
|
(!this.relativeParent || !this.relativeParent.options.layoutRoot) && (this.relativeTarget = this.relativeTargetOrigin = void 0), this.attemptToResolveRelativeTarget = !a;
|
|
4447
|
-
const f =
|
|
4447
|
+
const f = k(), d = l ? l.source : void 0, m = this.layout ? this.layout.source : void 0, g = d !== m, v = this.getStack(), p = !v || v.members.length <= 1, T = !!(g && !p && this.options.crossfade === !0 && !this.path.some(fu));
|
|
4448
4448
|
this.animationProgress = 0;
|
|
4449
4449
|
let y;
|
|
4450
4450
|
this.mixTargetDelta = (P) => {
|
|
4451
4451
|
const x = P / 1e3;
|
|
4452
|
-
Wi(h.x, r.x, x), Wi(h.y, r.y, x), this.setTargetDelta(h), this.relativeTarget && this.relativeTargetOrigin && this.layout && this.relativeParent && this.relativeParent.layout && (
|
|
4452
|
+
Wi(h.x, r.x, x), Wi(h.y, r.y, x), this.setTargetDelta(h), this.relativeTarget && this.relativeTargetOrigin && this.layout && this.relativeParent && this.relativeParent.layout && (se(f, this.layout.layoutBox, this.relativeParent.layout.layoutBox), hu(this.relativeTarget, this.relativeTargetOrigin, f, x), y && qc(this.relativeTarget, y) && (this.isProjectionDirty = !1), y || (y = k()), H(y, this.relativeTarget)), g && (this.animationValues = c, zc(c, u, this.latestValues, x, T, p)), this.root.scheduleUpdateProjection(), this.scheduleRender(), this.animationProgress = x;
|
|
4453
4453
|
}, this.mixTargetDelta(this.options.layoutRoot ? 1e3 : 0);
|
|
4454
4454
|
}
|
|
4455
4455
|
startAnimation(r) {
|
|
4456
4456
|
this.notifyListeners("animationStart"), this.currentAnimation?.stop(), this.resumingFrom?.currentAnimation?.stop(), this.pendingAnimation && (it(this.pendingAnimation), this.pendingAnimation = void 0), this.pendingAnimation = C.update(() => {
|
|
4457
|
-
|
|
4457
|
+
Jt.hasAnimatedSinceResize = !0, this.motionValue || (this.motionValue = St(0)), this.currentAnimation = Nc(this.motionValue, [0, 1e3], {
|
|
4458
4458
|
...r,
|
|
4459
4459
|
velocity: 0,
|
|
4460
4460
|
isSync: !0,
|
|
@@ -4482,13 +4482,13 @@ function Mr({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
|
|
|
4482
4482
|
let { targetWithTransforms: a, target: l, layout: u, latestValues: c } = r;
|
|
4483
4483
|
if (!(!a || !l || !u)) {
|
|
4484
4484
|
if (this !== r && this.layout && u && Er(this.options.animationType, this.layout.layoutBox, u.layoutBox)) {
|
|
4485
|
-
l = this.target ||
|
|
4485
|
+
l = this.target || k();
|
|
4486
4486
|
const h = j(this.layout.layoutBox.x);
|
|
4487
4487
|
l.x.min = r.target.x.min, l.x.max = l.x.min + h;
|
|
4488
4488
|
const f = j(this.layout.layoutBox.y);
|
|
4489
4489
|
l.y.min = r.target.y.min, l.y.max = l.y.min + f;
|
|
4490
4490
|
}
|
|
4491
|
-
|
|
4491
|
+
H(a, l), xt(a, c), Bt(this.projectionDeltaWithTransform, this.layoutCorrected, a, c);
|
|
4492
4492
|
}
|
|
4493
4493
|
}
|
|
4494
4494
|
registerSharedNode(r, a) {
|
|
@@ -4550,12 +4550,12 @@ function Mr({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
|
|
|
4550
4550
|
}
|
|
4551
4551
|
const l = this.getTransformTemplate();
|
|
4552
4552
|
if (this.needsReset) {
|
|
4553
|
-
this.needsReset = !1, r.visibility = "", r.opacity = "", r.pointerEvents =
|
|
4553
|
+
this.needsReset = !1, r.visibility = "", r.opacity = "", r.pointerEvents = Zt(a?.pointerEvents) || "", r.transform = l ? l(this.latestValues, "") : "none";
|
|
4554
4554
|
return;
|
|
4555
4555
|
}
|
|
4556
4556
|
const u = this.getLead();
|
|
4557
4557
|
if (!this.projectionDelta || !this.layout || !u.target) {
|
|
4558
|
-
this.options.layoutId && (r.opacity = this.latestValues.opacity !== void 0 ? this.latestValues.opacity : 1, r.pointerEvents =
|
|
4558
|
+
this.options.layoutId && (r.opacity = this.latestValues.opacity !== void 0 ? this.latestValues.opacity : 1, r.pointerEvents = Zt(a?.pointerEvents) || ""), this.hasProjected && !ct(this.latestValues) && (r.transform = l ? l({}, "") : "none", this.hasProjected = !1);
|
|
4559
4559
|
return;
|
|
4560
4560
|
}
|
|
4561
4561
|
r.visibility = "";
|
|
@@ -4565,10 +4565,10 @@ function Mr({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
|
|
|
4565
4565
|
l && (h = l(c, h)), r.transform = h;
|
|
4566
4566
|
const { x: f, y: d } = this.projectionDelta;
|
|
4567
4567
|
r.transformOrigin = `${f.origin * 100}% ${d.origin * 100}% 0`, u.animationValues ? r.opacity = u === this ? c.opacity ?? this.latestValues.opacity ?? 1 : this.preserveOpacity ? this.latestValues.opacity : c.opacityExit : r.opacity = u === this ? c.opacity !== void 0 ? c.opacity : "" : c.opacityExit !== void 0 ? c.opacityExit : 0;
|
|
4568
|
-
for (const m in
|
|
4568
|
+
for (const m in Nt) {
|
|
4569
4569
|
if (c[m] === void 0)
|
|
4570
4570
|
continue;
|
|
4571
|
-
const { correct: g, applyTo: v, isCSSVariable: p } =
|
|
4571
|
+
const { correct: g, applyTo: v, isCSSVariable: p } = Nt[m], T = h === "none" ? c[m] : g(c[m], u);
|
|
4572
4572
|
if (v) {
|
|
4573
4573
|
const y = v.length;
|
|
4574
4574
|
for (let P = 0; P < y; P++)
|
|
@@ -4576,7 +4576,7 @@ function Mr({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
|
|
|
4576
4576
|
} else
|
|
4577
4577
|
p ? this.options.visualElement.renderState.vars[m] = T : r[m] = T;
|
|
4578
4578
|
}
|
|
4579
|
-
this.options.layoutId && (r.pointerEvents = u === this ?
|
|
4579
|
+
this.options.layoutId && (r.pointerEvents = u === this ? Zt(a?.pointerEvents) || "" : "none");
|
|
4580
4580
|
}
|
|
4581
4581
|
clearSnapshot() {
|
|
4582
4582
|
this.resumeFrom = this.snapshot = void 0;
|
|
@@ -4594,10 +4594,10 @@ function nu(t) {
|
|
|
4594
4594
|
const e = t.resumeFrom?.snapshot || t.snapshot;
|
|
4595
4595
|
if (t.isLead() && t.layout && e && t.hasListeners("didUpdate")) {
|
|
4596
4596
|
const { layoutBox: n, measuredBox: i } = t.layout, { animationType: s } = t.options, o = e.source !== t.layout.source;
|
|
4597
|
-
s === "size" ?
|
|
4597
|
+
s === "size" ? K((c) => {
|
|
4598
4598
|
const h = o ? e.measuredBox[c] : e.layoutBox[c], f = j(h);
|
|
4599
4599
|
h.min = n[c].min, h.max = h.min + f;
|
|
4600
|
-
}) : Er(s, e.layoutBox, n) &&
|
|
4600
|
+
}) : Er(s, e.layoutBox, n) && K((c) => {
|
|
4601
4601
|
const h = o ? e.measuredBox[c] : e.layoutBox[c], f = j(n[c]);
|
|
4602
4602
|
h.max = h.min + f, t.relativeTarget && !t.currentAnimation && (t.isProjectionDirty = !0, t.relativeTarget[c].max = t.relativeTarget[c].min + f);
|
|
4603
4603
|
});
|
|
@@ -4612,10 +4612,10 @@ function nu(t) {
|
|
|
4612
4612
|
if (c && !c.resumeFrom) {
|
|
4613
4613
|
const { snapshot: h, layout: f } = c;
|
|
4614
4614
|
if (h && f) {
|
|
4615
|
-
const d =
|
|
4616
|
-
|
|
4617
|
-
const m =
|
|
4618
|
-
|
|
4615
|
+
const d = k();
|
|
4616
|
+
se(d, e.layoutBox, h.layoutBox);
|
|
4617
|
+
const m = k();
|
|
4618
|
+
se(m, n, f.layoutBox), Cr(d, m) || (u = !0), c.options.layoutRoot && (t.relativeTarget = m, t.relativeTargetOrigin = d, t.relativeParent = c);
|
|
4619
4619
|
}
|
|
4620
4620
|
}
|
|
4621
4621
|
}
|
|
@@ -4682,7 +4682,7 @@ function fu(t) {
|
|
|
4682
4682
|
const du = {
|
|
4683
4683
|
duration: 0.45,
|
|
4684
4684
|
ease: [0.4, 0, 0.1, 1]
|
|
4685
|
-
}, zi = (t) => typeof navigator < "u" && navigator.userAgent && navigator.userAgent.toLowerCase().includes(t), Hi = zi("applewebkit/") && !zi("chrome/") ? Math.round :
|
|
4685
|
+
}, zi = (t) => typeof navigator < "u" && navigator.userAgent && navigator.userAgent.toLowerCase().includes(t), Hi = zi("applewebkit/") && !zi("chrome/") ? Math.round : z;
|
|
4686
4686
|
function _i(t) {
|
|
4687
4687
|
t.min = Hi(t.min), t.max = Hi(t.max);
|
|
4688
4688
|
}
|
|
@@ -4690,13 +4690,13 @@ function mu(t) {
|
|
|
4690
4690
|
_i(t.x), _i(t.y);
|
|
4691
4691
|
}
|
|
4692
4692
|
function Er(t, e, n) {
|
|
4693
|
-
return t === "position" || t === "preserve-aspect" && !xc(
|
|
4693
|
+
return t === "position" || t === "preserve-aspect" && !xc(Oi(e), Oi(n), 0.2);
|
|
4694
4694
|
}
|
|
4695
4695
|
function pu(t) {
|
|
4696
4696
|
return t !== t.root && t.scroll?.wasRoot;
|
|
4697
4697
|
}
|
|
4698
4698
|
const gu = Mr({
|
|
4699
|
-
attachResizeListener: (t, e) =>
|
|
4699
|
+
attachResizeListener: (t, e) => Ut(t, "resize", e),
|
|
4700
4700
|
measureScroll: () => ({
|
|
4701
4701
|
x: document.documentElement.scrollLeft || document.body.scrollLeft,
|
|
4702
4702
|
y: document.documentElement.scrollTop || document.body.scrollTop
|
|
@@ -4734,7 +4734,7 @@ function Gi(t, e, n) {
|
|
|
4734
4734
|
const { props: i } = t;
|
|
4735
4735
|
t.animationState && i.whileHover && t.animationState.setActive("whileHover", n === "Start");
|
|
4736
4736
|
const s = "onHover" + n, o = i[s];
|
|
4737
|
-
o && C.postRender(() => o(e,
|
|
4737
|
+
o && C.postRender(() => o(e, zt(e)));
|
|
4738
4738
|
}
|
|
4739
4739
|
class vu extends ot {
|
|
4740
4740
|
mount() {
|
|
@@ -4761,7 +4761,7 @@ class Tu extends ot {
|
|
|
4761
4761
|
!this.isActive || !this.node.animationState || (this.node.animationState.setActive("whileFocus", !1), this.isActive = !1);
|
|
4762
4762
|
}
|
|
4763
4763
|
mount() {
|
|
4764
|
-
this.unmount =
|
|
4764
|
+
this.unmount = Kt(Ut(this.node.current, "focus", () => this.onFocus()), Ut(this.node.current, "blur", () => this.onBlur()));
|
|
4765
4765
|
}
|
|
4766
4766
|
unmount() {
|
|
4767
4767
|
}
|
|
@@ -4772,7 +4772,7 @@ function Xi(t, e, n) {
|
|
|
4772
4772
|
return;
|
|
4773
4773
|
t.animationState && i.whileTap && t.animationState.setActive("whileTap", n === "Start");
|
|
4774
4774
|
const s = "onTap" + (n === "End" ? "" : n), o = i[s];
|
|
4775
|
-
o && C.postRender(() => o(e,
|
|
4775
|
+
o && C.postRender(() => o(e, zt(e)));
|
|
4776
4776
|
}
|
|
4777
4777
|
class xu extends ot {
|
|
4778
4778
|
mount() {
|
|
@@ -4873,12 +4873,12 @@ function kr({ debounce: t, scroll: e, polyfill: n, offsetSize: i } = { debounce:
|
|
|
4873
4873
|
const s = n || (typeof window > "u" ? class {
|
|
4874
4874
|
} : window.ResizeObserver);
|
|
4875
4875
|
if (!s) throw new Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");
|
|
4876
|
-
const [o, r] = Ae({ left: 0, top: 0, width: 0, height: 0, bottom: 0, right: 0, x: 0, y: 0 }), a =
|
|
4876
|
+
const [o, r] = Ae({ left: 0, top: 0, width: 0, height: 0, bottom: 0, right: 0, x: 0, y: 0 }), a = $({ element: null, scrollContainers: null, resizeObserver: null, lastBounds: o, orientationHandler: null }), l = t ? typeof t == "number" ? t : t.scroll : null, u = t ? typeof t == "number" ? t : t.resize : null, c = $(!1);
|
|
4877
4877
|
nt(() => (c.current = !0, () => void (c.current = !1)));
|
|
4878
4878
|
const [h, f, d] = Y(() => {
|
|
4879
4879
|
const p = () => {
|
|
4880
4880
|
if (!a.current.element) return;
|
|
4881
|
-
const { left: T, top: y, width: P, height: x, bottom: S, right: A, x: b, y:
|
|
4881
|
+
const { left: T, top: y, width: P, height: x, bottom: S, right: A, x: b, y: R } = a.current.element.getBoundingClientRect(), E = { left: T, top: y, width: P, height: x, bottom: S, right: A, x: b, y: R };
|
|
4882
4882
|
a.current.element instanceof HTMLElement && i && (E.height = a.current.element.offsetHeight, E.width = a.current.element.offsetWidth), Object.freeze(E), c.current && !Bu(a.current.lastBounds, E) && r(a.current.lastBounds = E);
|
|
4883
4883
|
};
|
|
4884
4884
|
return [p, u ? Yi(p, u) : p, l ? Yi(p, l) : p];
|
|
@@ -4930,13 +4930,13 @@ const ku = ["x", "y", "top", "bottom", "left", "right", "width", "height"], Bu =
|
|
|
4930
4930
|
defaultVariants: {
|
|
4931
4931
|
size: "sm"
|
|
4932
4932
|
}
|
|
4933
|
-
}), Fr = mt(void 0),
|
|
4934
|
-
const t =
|
|
4933
|
+
}), Fr = mt(void 0), Ir = () => {
|
|
4934
|
+
const t = I(Fr);
|
|
4935
4935
|
if (!t)
|
|
4936
4936
|
throw new Error("Tray components must be used within Tray root");
|
|
4937
4937
|
return t;
|
|
4938
|
-
},
|
|
4939
|
-
const s =
|
|
4938
|
+
}, Iu = q(({ size: t = "sm", children: e, ...n }, i) => {
|
|
4939
|
+
const s = $("default"), o = Y(
|
|
4940
4940
|
() => ({
|
|
4941
4941
|
size: t,
|
|
4942
4942
|
animationKey: s.current,
|
|
@@ -4948,15 +4948,15 @@ const ku = ["x", "y", "top", "bottom", "left", "right", "width", "height"], Bu =
|
|
|
4948
4948
|
);
|
|
4949
4949
|
return /* @__PURE__ */ V(Fr.Provider, { value: o, children: /* @__PURE__ */ V(Pt.Root, { "data-testid": "spectral-tray", ...n, children: e }) });
|
|
4950
4950
|
});
|
|
4951
|
-
|
|
4952
|
-
const
|
|
4953
|
-
|
|
4954
|
-
const
|
|
4955
|
-
|
|
4951
|
+
Iu.displayName = "Tray";
|
|
4952
|
+
const Ou = q(({ className: t, ...e }, n) => /* @__PURE__ */ V(Pt.Trigger, { className: rt(t), "data-testid": "spectral-tray-trigger", "data-vaul-no-drag": "", ref: n, ...e }));
|
|
4953
|
+
Ou.displayName = "TrayTrigger";
|
|
4954
|
+
const Or = q(({ className: t, ...e }, n) => /* @__PURE__ */ V(Pt.Close, { asChild: !0, className: rt(t), "data-testid": "spectral-tray-close", "data-vaul-no-drag": "", ref: n, ...e, children: /* @__PURE__ */ V(qi, {}) }));
|
|
4955
|
+
Or.displayName = "TrayClose";
|
|
4956
4956
|
const jr = q(({ className: t, ...e }, n) => /* @__PURE__ */ V(Pt.Overlay, { className: rt("fixed inset-0 z-10 bg-overlay", t), ref: n, ...e }));
|
|
4957
4957
|
jr.displayName = "TrayOverlay";
|
|
4958
4958
|
const ju = q(({ className: t, size: e, children: n, ...i }, s) => {
|
|
4959
|
-
const { size: o } =
|
|
4959
|
+
const { size: o } = Ir(), r = e || o, [a, l] = kr();
|
|
4960
4960
|
return /* @__PURE__ */ Xe(Pt.Portal, { children: [
|
|
4961
4961
|
/* @__PURE__ */ V(jr, {}),
|
|
4962
4962
|
/* @__PURE__ */ V(Pt.Content, { asChild: !0, className: rt(Fu({ size: r }), t), "data-testid": "spectral-tray-content", ref: s, ...i, children: /* @__PURE__ */ V(
|
|
@@ -4977,7 +4977,7 @@ const ju = q(({ className: t, size: e, children: n, ...i }, s) => {
|
|
|
4977
4977
|
ju.displayName = "TrayContent";
|
|
4978
4978
|
const Nu = q(({ className: t, children: e, ...n }, i) => /* @__PURE__ */ Xe("div", { className: rt("flex flex-col space-y-1.5 text-start pb-4 relative", t), "data-testid": "spectral-tray-header", ref: i, ...n, children: [
|
|
4979
4979
|
e,
|
|
4980
|
-
/* @__PURE__ */ V(
|
|
4980
|
+
/* @__PURE__ */ V(Or, { className: "absolute text-neutral-400 right-[-14px] cursor-pointer hover:bg-level-four hover:text-neutral-100 hover:scale-110 rounded-full p-1 top-0 transition-colors z-10", children: /* @__PURE__ */ V(Wr, { icon: /* @__PURE__ */ V(qi, {}), label: "Close tray", shape: "circle" }) })
|
|
4981
4981
|
] }));
|
|
4982
4982
|
Nu.displayName = "TrayHeader";
|
|
4983
4983
|
const Uu = q(({ className: t, children: e, ...n }, i) => /* @__PURE__ */ V("h2", { className: rt("text-xl font-semibold text-text-primary", t), "data-testid": "spectral-tray-title", ref: i, ...n, children: e }));
|
|
@@ -4985,7 +4985,7 @@ Uu.displayName = "TrayTitle";
|
|
|
4985
4985
|
const Ku = q(({ className: t, ...e }, n) => /* @__PURE__ */ V("p", { className: rt("text-sm text-text-secondary", t), "data-testid": "spectral-tray-subtitle", ref: n, ...e }));
|
|
4986
4986
|
Ku.displayName = "TraySubtitle";
|
|
4987
4987
|
const Wu = q(({ className: t, children: e, animationKey: n, ...i }, s) => {
|
|
4988
|
-
const { animationKey: o } =
|
|
4988
|
+
const { animationKey: o } = Ir(), r = n !== void 0 ? n : o, a = $(null), [l, u] = kr(), c = Y(() => {
|
|
4989
4989
|
const h = u.height, f = a.current, d = 0.15, m = 0.27;
|
|
4990
4990
|
if (!a.current)
|
|
4991
4991
|
return a.current = h, d;
|
|
@@ -5010,12 +5010,12 @@ const Wu = q(({ className: t, children: e, animationKey: n, ...i }, s) => {
|
|
|
5010
5010
|
});
|
|
5011
5011
|
Wu.displayName = "TrayBody";
|
|
5012
5012
|
export {
|
|
5013
|
-
|
|
5013
|
+
Iu as Tray,
|
|
5014
5014
|
Wu as TrayBody,
|
|
5015
|
-
|
|
5015
|
+
Or as TrayClose,
|
|
5016
5016
|
ju as TrayContent,
|
|
5017
5017
|
Nu as TrayHeader,
|
|
5018
5018
|
Ku as TraySubtitle,
|
|
5019
5019
|
Uu as TrayTitle,
|
|
5020
|
-
|
|
5020
|
+
Ou as TrayTrigger
|
|
5021
5021
|
};
|