@ukpc-lib/react 0.1.8 → 0.1.9
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/components/GlobalMenu/components/MenuItem.d.ts +4 -1
- package/dist/components/GlobalMenu/index.d.ts +3 -3
- package/dist/components/index.cjs +4 -4
- package/dist/components/index.js +300 -299
- package/package.json +1 -1
- package/web-components-bundle/global-menu/index.cjs +7 -7
- package/web-components-bundle/global-menu/index.js +282 -280
package/dist/components/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as B, Fragment as Fi, jsx as w } from "react/jsx-runtime";
|
|
2
2
|
import * as D from "react";
|
|
3
|
-
import zi, { useState as
|
|
3
|
+
import zi, { useState as X, useRef as Et, useEffect as Xt, createContext as Dt, useLayoutEffect as Wi, useContext as z, useInsertionEffect as kr, useCallback as Cr, useMemo as be, forwardRef as Vr, createElement as _i, useId as Er } from "react";
|
|
4
4
|
import { C as Mr, g as Or, R as Dr, Q as Lr, p as Rr, l as Br } from "../interceptor.const-3d8c3adc.js";
|
|
5
5
|
import { a as lh, b as ch } from "../interceptor.const-3d8c3adc.js";
|
|
6
6
|
import { Link as Nr, useLocation as jr } from "react-router-dom";
|
|
@@ -154,7 +154,7 @@ function nh({
|
|
|
154
154
|
...i,
|
|
155
155
|
color: (o == null ? void 0 : o.color) || "black",
|
|
156
156
|
backgroundColor: (o == null ? void 0 : o.bgColor) || "black"
|
|
157
|
-
}, [l, c] =
|
|
157
|
+
}, [l, c] = X(!1), u = () => {
|
|
158
158
|
window.location.href = `${n}/authentication/logout?callbackUrl=${window.location.href}`;
|
|
159
159
|
};
|
|
160
160
|
return /* @__PURE__ */ B(Hi, { styles: [Gr], style: { zIndex: 1202 }, children: [
|
|
@@ -204,7 +204,7 @@ function Yr({
|
|
|
204
204
|
setShowConfirmModal: e,
|
|
205
205
|
primaryColor: n = "#009d4f"
|
|
206
206
|
}) {
|
|
207
|
-
const [i, s] =
|
|
207
|
+
const [i, s] = X(!1), o = Et(null), r = Et(null), [a, l] = X(!1), [c, u] = X(!1), h = {
|
|
208
208
|
backgroundColor: a ? n : "transparent"
|
|
209
209
|
}, d = {
|
|
210
210
|
backgroundColor: c ? n : "transparent"
|
|
@@ -332,29 +332,29 @@ function oe(t, e, n) {
|
|
|
332
332
|
if (typeof t != "function")
|
|
333
333
|
throw new TypeError(xo);
|
|
334
334
|
e = Mn(e) || 0, ue(n) && (u = !!n.leading, h = "maxWait" in n, o = h ? wo(Mn(n.maxWait) || 0, e) : o, d = "trailing" in n ? !!n.trailing : d);
|
|
335
|
-
function f(
|
|
335
|
+
function f(T) {
|
|
336
336
|
var k = i, P = s;
|
|
337
|
-
return i = s = void 0, c =
|
|
337
|
+
return i = s = void 0, c = T, r = t.apply(P, k), r;
|
|
338
338
|
}
|
|
339
|
-
function p(
|
|
340
|
-
return c =
|
|
339
|
+
function p(T) {
|
|
340
|
+
return c = T, a = setTimeout(y, e), u ? f(T) : r;
|
|
341
341
|
}
|
|
342
|
-
function m(
|
|
343
|
-
var k =
|
|
342
|
+
function m(T) {
|
|
343
|
+
var k = T - l, P = T - c, C = e - k;
|
|
344
344
|
return h ? So(C, o - P) : C;
|
|
345
345
|
}
|
|
346
|
-
function v(
|
|
347
|
-
var k =
|
|
346
|
+
function v(T) {
|
|
347
|
+
var k = T - l, P = T - c;
|
|
348
348
|
return l === void 0 || k >= e || k < 0 || h && P >= o;
|
|
349
349
|
}
|
|
350
350
|
function y() {
|
|
351
|
-
var
|
|
352
|
-
if (v(
|
|
353
|
-
return b(
|
|
354
|
-
a = setTimeout(y, m(
|
|
351
|
+
var T = Ve();
|
|
352
|
+
if (v(T))
|
|
353
|
+
return b(T);
|
|
354
|
+
a = setTimeout(y, m(T));
|
|
355
355
|
}
|
|
356
|
-
function b(
|
|
357
|
-
return a = void 0, d && i ? f(
|
|
356
|
+
function b(T) {
|
|
357
|
+
return a = void 0, d && i ? f(T) : (i = s = void 0, r);
|
|
358
358
|
}
|
|
359
359
|
function g() {
|
|
360
360
|
a !== void 0 && clearTimeout(a), c = 0, i = l = s = a = void 0;
|
|
@@ -362,9 +362,9 @@ function oe(t, e, n) {
|
|
|
362
362
|
function x() {
|
|
363
363
|
return a === void 0 ? r : b(Ve());
|
|
364
364
|
}
|
|
365
|
-
function
|
|
366
|
-
var
|
|
367
|
-
if (i = arguments, s = this, l =
|
|
365
|
+
function S() {
|
|
366
|
+
var T = Ve(), k = v(T);
|
|
367
|
+
if (i = arguments, s = this, l = T, k) {
|
|
368
368
|
if (a === void 0)
|
|
369
369
|
return p(l);
|
|
370
370
|
if (h)
|
|
@@ -372,7 +372,7 @@ function oe(t, e, n) {
|
|
|
372
372
|
}
|
|
373
373
|
return a === void 0 && (a = setTimeout(y, e)), r;
|
|
374
374
|
}
|
|
375
|
-
return
|
|
375
|
+
return S.cancel = g, S.flush = x, S;
|
|
376
376
|
}
|
|
377
377
|
var To = "Expected a function";
|
|
378
378
|
function Ao(t, e, n) {
|
|
@@ -462,7 +462,7 @@ var Co = /* @__PURE__ */ Object.freeze({
|
|
|
462
462
|
addClasses: Qi,
|
|
463
463
|
removeClasses: Zi,
|
|
464
464
|
classNamesToQuery: Ji
|
|
465
|
-
}),
|
|
465
|
+
}), it = qi, Ee = Ki, Vo = $i, st = Qi, rt = Zi, F = Ji, te = (
|
|
466
466
|
/** @class */
|
|
467
467
|
function() {
|
|
468
468
|
function t(e, n) {
|
|
@@ -473,18 +473,18 @@ var Co = /* @__PURE__ */ Object.freeze({
|
|
|
473
473
|
}, this.onStopScrolling = function() {
|
|
474
474
|
}, this.onMouseEntered = function() {
|
|
475
475
|
}, this.onScroll = function() {
|
|
476
|
-
var s =
|
|
477
|
-
i.scrollXTicking || (s.requestAnimationFrame(i.scrollX), i.scrollXTicking = !0), i.scrollYTicking || (s.requestAnimationFrame(i.scrollY), i.scrollYTicking = !0), i.isScrolling || (i.isScrolling = !0,
|
|
476
|
+
var s = it(i.el);
|
|
477
|
+
i.scrollXTicking || (s.requestAnimationFrame(i.scrollX), i.scrollXTicking = !0), i.scrollYTicking || (s.requestAnimationFrame(i.scrollY), i.scrollYTicking = !0), i.isScrolling || (i.isScrolling = !0, st(i.el, i.classNames.scrolling)), i.showScrollbar("x"), i.showScrollbar("y"), i.onStopScrolling();
|
|
478
478
|
}, this.scrollX = function() {
|
|
479
479
|
i.axis.x.isOverflowing && i.positionScrollbar("x"), i.scrollXTicking = !1;
|
|
480
480
|
}, this.scrollY = function() {
|
|
481
481
|
i.axis.y.isOverflowing && i.positionScrollbar("y"), i.scrollYTicking = !1;
|
|
482
482
|
}, this._onStopScrolling = function() {
|
|
483
|
-
|
|
483
|
+
rt(i.el, i.classNames.scrolling), i.options.autoHide && (i.hideScrollbar("x"), i.hideScrollbar("y")), i.isScrolling = !1;
|
|
484
484
|
}, this.onMouseEnter = function() {
|
|
485
|
-
i.isMouseEntering || (
|
|
485
|
+
i.isMouseEntering || (st(i.el, i.classNames.mouseEntered), i.showScrollbar("x"), i.showScrollbar("y"), i.isMouseEntering = !0), i.onMouseEntered();
|
|
486
486
|
}, this._onMouseEntered = function() {
|
|
487
|
-
|
|
487
|
+
rt(i.el, i.classNames.mouseEntered), i.options.autoHide && (i.hideScrollbar("x"), i.hideScrollbar("y")), i.isMouseEntering = !1;
|
|
488
488
|
}, this._onMouseMove = function(s) {
|
|
489
489
|
i.mouseX = s.clientX, i.mouseY = s.clientY, (i.axis.x.isOverflowing || i.axis.x.forceVisible) && i.onMouseMoveForAxis("x"), (i.axis.y.isOverflowing || i.axis.y.forceVisible) && i.onMouseMoveForAxis("y");
|
|
490
490
|
}, this.onMouseLeave = function() {
|
|
@@ -499,16 +499,16 @@ var Co = /* @__PURE__ */ Object.freeze({
|
|
|
499
499
|
}, this.drag = function(s) {
|
|
500
500
|
var o, r, a, l, c, u, h, d, f, p, m;
|
|
501
501
|
if (!(!i.draggedAxis || !i.contentWrapperEl)) {
|
|
502
|
-
var v, y = i.axis[i.draggedAxis].track, b = (r = (o = y.rect) === null || o === void 0 ? void 0 : o[i.axis[i.draggedAxis].sizeAttr]) !== null && r !== void 0 ? r : 0, g = i.axis[i.draggedAxis].scrollbar, x = (l = (a = i.contentWrapperEl) === null || a === void 0 ? void 0 : a[i.axis[i.draggedAxis].scrollSizeAttr]) !== null && l !== void 0 ? l : 0,
|
|
502
|
+
var v, y = i.axis[i.draggedAxis].track, b = (r = (o = y.rect) === null || o === void 0 ? void 0 : o[i.axis[i.draggedAxis].sizeAttr]) !== null && r !== void 0 ? r : 0, g = i.axis[i.draggedAxis].scrollbar, x = (l = (a = i.contentWrapperEl) === null || a === void 0 ? void 0 : a[i.axis[i.draggedAxis].scrollSizeAttr]) !== null && l !== void 0 ? l : 0, S = parseInt((u = (c = i.elStyles) === null || c === void 0 ? void 0 : c[i.axis[i.draggedAxis].sizeAttr]) !== null && u !== void 0 ? u : "0px", 10);
|
|
503
503
|
s.preventDefault(), s.stopPropagation(), i.draggedAxis === "y" ? v = s.pageY : v = s.pageX;
|
|
504
|
-
var
|
|
505
|
-
|
|
506
|
-
var k =
|
|
504
|
+
var T = v - ((d = (h = y.rect) === null || h === void 0 ? void 0 : h[i.axis[i.draggedAxis].offsetAttr]) !== null && d !== void 0 ? d : 0) - i.axis[i.draggedAxis].dragOffset;
|
|
505
|
+
T = i.draggedAxis === "x" && i.isRtl ? ((p = (f = y.rect) === null || f === void 0 ? void 0 : f[i.axis[i.draggedAxis].sizeAttr]) !== null && p !== void 0 ? p : 0) - g.size - T : T;
|
|
506
|
+
var k = T / (b - g.size), P = k * (x - S);
|
|
507
507
|
i.draggedAxis === "x" && i.isRtl && (P = !((m = t.getRtlHelpers()) === null || m === void 0) && m.isScrollingToNegative ? -P : P), i.contentWrapperEl[i.axis[i.draggedAxis].scrollOffsetAttr] = P;
|
|
508
508
|
}
|
|
509
509
|
}, this.onEndDrag = function(s) {
|
|
510
|
-
var o = Ee(i.el), r =
|
|
511
|
-
s.preventDefault(), s.stopPropagation(),
|
|
510
|
+
var o = Ee(i.el), r = it(i.el);
|
|
511
|
+
s.preventDefault(), s.stopPropagation(), rt(i.el, i.classNames.dragging), o.removeEventListener("mousemove", i.drag, !0), o.removeEventListener("mouseup", i.onEndDrag, !0), i.removePreventClickId = r.setTimeout(function() {
|
|
512
512
|
o.removeEventListener("click", i.preventClick, !0), o.removeEventListener("dblclick", i.preventClick, !0), i.removePreventClickId = null;
|
|
513
513
|
});
|
|
514
514
|
}, this.preventClick = function(s) {
|
|
@@ -569,7 +569,7 @@ var Co = /* @__PURE__ */ Object.freeze({
|
|
|
569
569
|
return Dn();
|
|
570
570
|
}
|
|
571
571
|
}, t.getOffset = function(e) {
|
|
572
|
-
var n = e.getBoundingClientRect(), i = Ee(e), s =
|
|
572
|
+
var n = e.getBoundingClientRect(), i = Ee(e), s = it(e);
|
|
573
573
|
return {
|
|
574
574
|
top: n.top + (s.pageYOffset || i.documentElement.scrollTop),
|
|
575
575
|
left: n.left + (s.pageXOffset || i.documentElement.scrollLeft)
|
|
@@ -578,9 +578,9 @@ var Co = /* @__PURE__ */ Object.freeze({
|
|
|
578
578
|
Xi && (this.initDOM(), this.rtlHelpers = t.getRtlHelpers(), this.scrollbarWidth = this.getScrollbarWidth(), this.recalculate(), this.initListeners());
|
|
579
579
|
}, t.prototype.initDOM = function() {
|
|
580
580
|
var e, n;
|
|
581
|
-
this.wrapperEl = this.el.querySelector(F(this.classNames.wrapper)), this.contentWrapperEl = this.options.scrollableNode || this.el.querySelector(F(this.classNames.contentWrapper)), this.contentEl = this.options.contentNode || this.el.querySelector(F(this.classNames.contentEl)), this.offsetEl = this.el.querySelector(F(this.classNames.offset)), this.maskEl = this.el.querySelector(F(this.classNames.mask)), this.placeholderEl = this.findChild(this.wrapperEl, F(this.classNames.placeholder)), this.heightAutoObserverWrapperEl = this.el.querySelector(F(this.classNames.heightAutoObserverWrapperEl)), this.heightAutoObserverEl = this.el.querySelector(F(this.classNames.heightAutoObserverEl)), this.axis.x.track.el = this.findChild(this.el, "".concat(F(this.classNames.track)).concat(F(this.classNames.horizontal))), this.axis.y.track.el = this.findChild(this.el, "".concat(F(this.classNames.track)).concat(F(this.classNames.vertical))), this.axis.x.scrollbar.el = ((e = this.axis.x.track.el) === null || e === void 0 ? void 0 : e.querySelector(F(this.classNames.scrollbar))) || null, this.axis.y.scrollbar.el = ((n = this.axis.y.track.el) === null || n === void 0 ? void 0 : n.querySelector(F(this.classNames.scrollbar))) || null, this.options.autoHide || (
|
|
581
|
+
this.wrapperEl = this.el.querySelector(F(this.classNames.wrapper)), this.contentWrapperEl = this.options.scrollableNode || this.el.querySelector(F(this.classNames.contentWrapper)), this.contentEl = this.options.contentNode || this.el.querySelector(F(this.classNames.contentEl)), this.offsetEl = this.el.querySelector(F(this.classNames.offset)), this.maskEl = this.el.querySelector(F(this.classNames.mask)), this.placeholderEl = this.findChild(this.wrapperEl, F(this.classNames.placeholder)), this.heightAutoObserverWrapperEl = this.el.querySelector(F(this.classNames.heightAutoObserverWrapperEl)), this.heightAutoObserverEl = this.el.querySelector(F(this.classNames.heightAutoObserverEl)), this.axis.x.track.el = this.findChild(this.el, "".concat(F(this.classNames.track)).concat(F(this.classNames.horizontal))), this.axis.y.track.el = this.findChild(this.el, "".concat(F(this.classNames.track)).concat(F(this.classNames.vertical))), this.axis.x.scrollbar.el = ((e = this.axis.x.track.el) === null || e === void 0 ? void 0 : e.querySelector(F(this.classNames.scrollbar))) || null, this.axis.y.scrollbar.el = ((n = this.axis.y.track.el) === null || n === void 0 ? void 0 : n.querySelector(F(this.classNames.scrollbar))) || null, this.options.autoHide || (st(this.axis.x.scrollbar.el, this.classNames.visible), st(this.axis.y.scrollbar.el, this.classNames.visible));
|
|
582
582
|
}, t.prototype.initListeners = function() {
|
|
583
|
-
var e = this, n, i =
|
|
583
|
+
var e = this, n, i = it(this.el);
|
|
584
584
|
if (this.el.addEventListener("mouseenter", this.onMouseEnter), this.el.addEventListener("pointerdown", this.onPointerEvent, !0), this.el.addEventListener("mousemove", this.onMouseMove), this.el.addEventListener("mouseleave", this.onMouseLeave), (n = this.contentWrapperEl) === null || n === void 0 || n.addEventListener("scroll", this.onScroll), i.addEventListener("resize", this.onWindowResize), !!this.contentEl) {
|
|
585
585
|
if (window.ResizeObserver) {
|
|
586
586
|
var s = !1, o = i.ResizeObserver || ResizeObserver;
|
|
@@ -604,7 +604,7 @@ var Co = /* @__PURE__ */ Object.freeze({
|
|
|
604
604
|
}
|
|
605
605
|
}, t.prototype.recalculate = function() {
|
|
606
606
|
if (!(!this.heightAutoObserverEl || !this.contentEl || !this.contentWrapperEl || !this.wrapperEl || !this.placeholderEl)) {
|
|
607
|
-
var e =
|
|
607
|
+
var e = it(this.el);
|
|
608
608
|
this.elStyles = e.getComputedStyle(this.el), this.isRtl = this.elStyles.direction === "rtl";
|
|
609
609
|
var n = this.contentEl.offsetWidth, i = this.heightAutoObserverEl.offsetHeight <= 1, s = this.heightAutoObserverEl.offsetWidth <= 1 || n > 0, o = this.contentWrapperEl.offsetWidth, r = this.elStyles.overflowX, a = this.elStyles.overflowY;
|
|
610
610
|
this.contentEl.style.padding = "".concat(this.elStyles.paddingTop, " ").concat(this.elStyles.paddingRight, " ").concat(this.elStyles.paddingBottom, " ").concat(this.elStyles.paddingLeft), this.wrapperEl.style.margin = "-".concat(this.elStyles.paddingTop, " -").concat(this.elStyles.paddingRight, " -").concat(this.elStyles.paddingBottom, " -").concat(this.elStyles.paddingLeft);
|
|
@@ -636,29 +636,29 @@ var Co = /* @__PURE__ */ Object.freeze({
|
|
|
636
636
|
var n = this.axis[e].track.el, i = this.axis[e].scrollbar.el;
|
|
637
637
|
!n || !i || !this.contentWrapperEl || (this.axis[e].isOverflowing || this.axis[e].forceVisible ? (n.style.visibility = "visible", this.contentWrapperEl.style[this.axis[e].overflowAttr] = "scroll", this.el.classList.add("".concat(this.classNames.scrollable, "-").concat(e))) : (n.style.visibility = "hidden", this.contentWrapperEl.style[this.axis[e].overflowAttr] = "hidden", this.el.classList.remove("".concat(this.classNames.scrollable, "-").concat(e))), this.axis[e].isOverflowing ? i.style.display = "block" : i.style.display = "none");
|
|
638
638
|
}, t.prototype.showScrollbar = function(e) {
|
|
639
|
-
e === void 0 && (e = "y"), this.axis[e].isOverflowing && !this.axis[e].scrollbar.isVisible && (
|
|
639
|
+
e === void 0 && (e = "y"), this.axis[e].isOverflowing && !this.axis[e].scrollbar.isVisible && (st(this.axis[e].scrollbar.el, this.classNames.visible), this.axis[e].scrollbar.isVisible = !0);
|
|
640
640
|
}, t.prototype.hideScrollbar = function(e) {
|
|
641
|
-
e === void 0 && (e = "y"), this.axis[e].isOverflowing && this.axis[e].scrollbar.isVisible && (
|
|
641
|
+
e === void 0 && (e = "y"), this.axis[e].isOverflowing && this.axis[e].scrollbar.isVisible && (rt(this.axis[e].scrollbar.el, this.classNames.visible), this.axis[e].scrollbar.isVisible = !1);
|
|
642
642
|
}, t.prototype.hideNativeScrollbar = function() {
|
|
643
643
|
this.offsetEl && (this.offsetEl.style[this.isRtl ? "left" : "right"] = this.axis.y.isOverflowing || this.axis.y.forceVisible ? "-".concat(this.scrollbarWidth, "px") : "0px", this.offsetEl.style.bottom = this.axis.x.isOverflowing || this.axis.x.forceVisible ? "-".concat(this.scrollbarWidth, "px") : "0px");
|
|
644
644
|
}, t.prototype.onMouseMoveForAxis = function(e) {
|
|
645
645
|
e === void 0 && (e = "y");
|
|
646
646
|
var n = this.axis[e];
|
|
647
|
-
!n.track.el || !n.scrollbar.el || (n.track.rect = n.track.el.getBoundingClientRect(), n.scrollbar.rect = n.scrollbar.el.getBoundingClientRect(), this.isWithinBounds(n.track.rect) ? (this.showScrollbar(e),
|
|
647
|
+
!n.track.el || !n.scrollbar.el || (n.track.rect = n.track.el.getBoundingClientRect(), n.scrollbar.rect = n.scrollbar.el.getBoundingClientRect(), this.isWithinBounds(n.track.rect) ? (this.showScrollbar(e), st(n.track.el, this.classNames.hover), this.isWithinBounds(n.scrollbar.rect) ? st(n.scrollbar.el, this.classNames.hover) : rt(n.scrollbar.el, this.classNames.hover)) : (rt(n.track.el, this.classNames.hover), this.options.autoHide && this.hideScrollbar(e)));
|
|
648
648
|
}, t.prototype.onMouseLeaveForAxis = function(e) {
|
|
649
|
-
e === void 0 && (e = "y"),
|
|
649
|
+
e === void 0 && (e = "y"), rt(this.axis[e].track.el, this.classNames.hover), rt(this.axis[e].scrollbar.el, this.classNames.hover), this.options.autoHide && this.hideScrollbar(e);
|
|
650
650
|
}, t.prototype.onDragStart = function(e, n) {
|
|
651
651
|
var i;
|
|
652
652
|
n === void 0 && (n = "y");
|
|
653
|
-
var s = Ee(this.el), o =
|
|
654
|
-
this.axis[n].dragOffset = a - (((i = r.rect) === null || i === void 0 ? void 0 : i[this.axis[n].offsetAttr]) || 0), this.draggedAxis = n,
|
|
653
|
+
var s = Ee(this.el), o = it(this.el), r = this.axis[n].scrollbar, a = n === "y" ? e.pageY : e.pageX;
|
|
654
|
+
this.axis[n].dragOffset = a - (((i = r.rect) === null || i === void 0 ? void 0 : i[this.axis[n].offsetAttr]) || 0), this.draggedAxis = n, st(this.el, this.classNames.dragging), s.addEventListener("mousemove", this.drag, !0), s.addEventListener("mouseup", this.onEndDrag, !0), this.removePreventClickId === null ? (s.addEventListener("click", this.preventClick, !0), s.addEventListener("dblclick", this.preventClick, !0)) : (o.clearTimeout(this.removePreventClickId), this.removePreventClickId = null);
|
|
655
655
|
}, t.prototype.onTrackClick = function(e, n) {
|
|
656
656
|
var i = this, s, o, r, a;
|
|
657
657
|
n === void 0 && (n = "y");
|
|
658
658
|
var l = this.axis[n];
|
|
659
659
|
if (!(!this.options.clickOnTrack || !l.scrollbar.el || !this.contentWrapperEl)) {
|
|
660
660
|
e.preventDefault();
|
|
661
|
-
var c =
|
|
661
|
+
var c = it(this.el);
|
|
662
662
|
this.axis[n].scrollbar.rect = l.scrollbar.el.getBoundingClientRect();
|
|
663
663
|
var u = this.axis[n].scrollbar, h = (o = (s = u.rect) === null || s === void 0 ? void 0 : s[this.axis[n].offsetAttr]) !== null && o !== void 0 ? o : 0, d = parseInt((a = (r = this.elStyles) === null || r === void 0 ? void 0 : r[this.axis[n].sizeAttr]) !== null && a !== void 0 ? a : "0px", 10), f = this.contentWrapperEl[this.axis[n].scrollOffsetAttr], p = n === "y" ? this.mouseY - h : this.mouseX - h, m = p < 0 ? -1 : 1, v = m === -1 ? f - d : f + d, y = 40, b = function() {
|
|
664
664
|
i.contentWrapperEl && (m === -1 ? f > v && (f -= y, i.contentWrapperEl[i.axis[n].scrollOffsetAttr] = f, c.requestAnimationFrame(b)) : f < v && (f += y, i.contentWrapperEl[i.axis[n].scrollOffsetAttr] = f, c.requestAnimationFrame(b)));
|
|
@@ -670,7 +670,7 @@ var Co = /* @__PURE__ */ Object.freeze({
|
|
|
670
670
|
}, t.prototype.getScrollElement = function() {
|
|
671
671
|
return this.contentWrapperEl;
|
|
672
672
|
}, t.prototype.removeListeners = function() {
|
|
673
|
-
var e =
|
|
673
|
+
var e = it(this.el);
|
|
674
674
|
this.el.removeEventListener("mouseenter", this.onMouseEnter), this.el.removeEventListener("pointerdown", this.onPointerEvent, !0), this.el.removeEventListener("mousemove", this.onMouseMove), this.el.removeEventListener("mouseleave", this.onMouseLeave), this.contentWrapperEl && this.contentWrapperEl.removeEventListener("scroll", this.onScroll), e.removeEventListener("resize", this.onWindowResize), this.mutationObserver && this.mutationObserver.disconnect(), this.resizeObserver && this.resizeObserver.disconnect(), this.onMouseMove.cancel(), this.onWindowResize.cancel(), this.onStopScrolling.cancel(), this.onMouseEntered.cancel();
|
|
675
675
|
}, t.prototype.unMount = function() {
|
|
676
676
|
this.removeListeners();
|
|
@@ -1020,9 +1020,9 @@ const qt = [
|
|
|
1020
1020
|
"skew",
|
|
1021
1021
|
"skewX",
|
|
1022
1022
|
"skewY"
|
|
1023
|
-
],
|
|
1023
|
+
], yt = new Set(qt);
|
|
1024
1024
|
function as(t, { layout: e, layoutId: n }) {
|
|
1025
|
-
return
|
|
1025
|
+
return yt.has(t) || t.startsWith("origin") || (e || n !== void 0) && (!!he[t] || t === "opacity");
|
|
1026
1026
|
}
|
|
1027
1027
|
const W = (t) => !!(t && t.getVelocity), Uo = {
|
|
1028
1028
|
x: "translateX",
|
|
@@ -1041,15 +1041,15 @@ function Go(t, { enableHardwareAcceleration: e = !0, allowTransformNone: n = !0
|
|
|
1041
1041
|
}
|
|
1042
1042
|
return e && !t.z && (o += "translateZ(0)"), o = o.trim(), s ? o = s(t, i ? "" : o) : n && i && (o = "none"), o;
|
|
1043
1043
|
}
|
|
1044
|
-
const ls = (t) => (e) => typeof e == "string" && e.startsWith(t), cs = ls("--"), _e = ls("var(--"), Yo = /var\s*\(\s*--[\w-]+(\s*,\s*(?:(?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)+)?\s*\)/g, Xo = (t, e) => e && typeof t == "number" ? e.transform(t) : t,
|
|
1044
|
+
const ls = (t) => (e) => typeof e == "string" && e.startsWith(t), cs = ls("--"), _e = ls("var(--"), Yo = /var\s*\(\s*--[\w-]+(\s*,\s*(?:(?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)+)?\s*\)/g, Xo = (t, e) => e && typeof t == "number" ? e.transform(t) : t, ut = (t, e, n) => Math.min(Math.max(n, t), e), bt = {
|
|
1045
1045
|
test: (t) => typeof t == "number",
|
|
1046
1046
|
parse: parseFloat,
|
|
1047
1047
|
transform: (t) => t
|
|
1048
1048
|
}, zt = {
|
|
1049
|
-
...
|
|
1050
|
-
transform: (t) =>
|
|
1049
|
+
...bt,
|
|
1050
|
+
transform: (t) => ut(0, 1, t)
|
|
1051
1051
|
}, ee = {
|
|
1052
|
-
...
|
|
1052
|
+
...bt,
|
|
1053
1053
|
default: 1
|
|
1054
1054
|
}, Wt = (t) => Math.round(t * 1e5) / 1e5, Ae = /(-)?([\d]*\.?[\d])+/g, us = /(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi, qo = /^(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;
|
|
1055
1055
|
function Kt(t) {
|
|
@@ -1059,12 +1059,12 @@ const $t = (t) => ({
|
|
|
1059
1059
|
test: (e) => Kt(e) && e.endsWith(t) && e.split(" ").length === 1,
|
|
1060
1060
|
parse: parseFloat,
|
|
1061
1061
|
transform: (e) => `${e}${t}`
|
|
1062
|
-
}),
|
|
1063
|
-
|
|
1064
|
-
parse: (t) =>
|
|
1065
|
-
transform: (t) =>
|
|
1062
|
+
}), ot = $t("deg"), K = $t("%"), A = $t("px"), Ko = $t("vh"), $o = $t("vw"), Bn = {
|
|
1063
|
+
...K,
|
|
1064
|
+
parse: (t) => K.parse(t) / 100,
|
|
1065
|
+
transform: (t) => K.transform(t * 100)
|
|
1066
1066
|
}, Nn = {
|
|
1067
|
-
...
|
|
1067
|
+
...bt,
|
|
1068
1068
|
transform: Math.round
|
|
1069
1069
|
}, hs = {
|
|
1070
1070
|
// Border props
|
|
@@ -1101,17 +1101,17 @@ const $t = (t) => ({
|
|
|
1101
1101
|
marginBottom: A,
|
|
1102
1102
|
marginLeft: A,
|
|
1103
1103
|
// Transform props
|
|
1104
|
-
rotate:
|
|
1105
|
-
rotateX:
|
|
1106
|
-
rotateY:
|
|
1107
|
-
rotateZ:
|
|
1104
|
+
rotate: ot,
|
|
1105
|
+
rotateX: ot,
|
|
1106
|
+
rotateY: ot,
|
|
1107
|
+
rotateZ: ot,
|
|
1108
1108
|
scale: ee,
|
|
1109
1109
|
scaleX: ee,
|
|
1110
1110
|
scaleY: ee,
|
|
1111
1111
|
scaleZ: ee,
|
|
1112
|
-
skew:
|
|
1113
|
-
skewX:
|
|
1114
|
-
skewY:
|
|
1112
|
+
skew: ot,
|
|
1113
|
+
skewX: ot,
|
|
1114
|
+
skewY: ot,
|
|
1115
1115
|
distance: A,
|
|
1116
1116
|
translateX: A,
|
|
1117
1117
|
translateY: A,
|
|
@@ -1142,7 +1142,7 @@ function an(t, e, n, i) {
|
|
|
1142
1142
|
continue;
|
|
1143
1143
|
}
|
|
1144
1144
|
const f = hs[h], p = Xo(d, f);
|
|
1145
|
-
if (
|
|
1145
|
+
if (yt.has(h)) {
|
|
1146
1146
|
if (l = !0, r[h] = p, !u)
|
|
1147
1147
|
continue;
|
|
1148
1148
|
d !== (f.default || 0) && (u = !1);
|
|
@@ -1477,7 +1477,7 @@ function ga(t, e) {
|
|
|
1477
1477
|
return h[d] = (p, m = !1, v = !1) => (n || l(), f.schedule(p, m, v)), h;
|
|
1478
1478
|
}, {}), cancel: (h) => ne.forEach((d) => o[d].cancel(h)), state: s, steps: o };
|
|
1479
1479
|
}
|
|
1480
|
-
const { schedule: V, cancel:
|
|
1480
|
+
const { schedule: V, cancel: et, state: N, steps: Me } = ga(typeof requestAnimationFrame < "u" ? requestAnimationFrame : O, !0), va = {
|
|
1481
1481
|
useVisualState: bs({
|
|
1482
1482
|
scrapeMotionValuesFromProps: ys,
|
|
1483
1483
|
createRenderState: ps,
|
|
@@ -1513,7 +1513,7 @@ function ba(t, { forwardMotionProps: e = !1 }, n, i) {
|
|
|
1513
1513
|
Component: t
|
|
1514
1514
|
};
|
|
1515
1515
|
}
|
|
1516
|
-
function
|
|
1516
|
+
function Z(t, e, n, i = { passive: !0 }) {
|
|
1517
1517
|
return t.addEventListener(e, n, i), () => t.removeEventListener(e, n);
|
|
1518
1518
|
}
|
|
1519
1519
|
const xs = (t) => t.pointerType === "mouse" ? typeof t.button != "number" || t.button <= 0 : t.isPrimary !== !1;
|
|
@@ -1526,10 +1526,10 @@ function Pe(t, e = "page") {
|
|
|
1526
1526
|
};
|
|
1527
1527
|
}
|
|
1528
1528
|
const xa = (t) => (e) => xs(e) && t(e, Pe(e));
|
|
1529
|
-
function
|
|
1530
|
-
return
|
|
1529
|
+
function J(t, e, n, i) {
|
|
1530
|
+
return Z(t, e, xa(n), i);
|
|
1531
1531
|
}
|
|
1532
|
-
const wa = (t, e) => (n) => e(t(n)),
|
|
1532
|
+
const wa = (t, e) => (n) => e(t(n)), lt = (...t) => t.reduce(wa);
|
|
1533
1533
|
function ws(t) {
|
|
1534
1534
|
let e = null;
|
|
1535
1535
|
return () => {
|
|
@@ -1558,7 +1558,7 @@ function Ts() {
|
|
|
1558
1558
|
const t = Ss(!0);
|
|
1559
1559
|
return t ? (t(), !1) : !0;
|
|
1560
1560
|
}
|
|
1561
|
-
class
|
|
1561
|
+
class dt {
|
|
1562
1562
|
constructor(e) {
|
|
1563
1563
|
this.isMounted = !1, this.node = e;
|
|
1564
1564
|
}
|
|
@@ -1572,18 +1572,18 @@ function Wn(t, e) {
|
|
|
1572
1572
|
const a = t.getProps();
|
|
1573
1573
|
t.animationState && a.whileHover && t.animationState.setActive("whileHover", e), a[i] && V.update(() => a[i](o, r));
|
|
1574
1574
|
};
|
|
1575
|
-
return
|
|
1575
|
+
return J(t.current, n, s, {
|
|
1576
1576
|
passive: !t.getProps()[i]
|
|
1577
1577
|
});
|
|
1578
1578
|
}
|
|
1579
|
-
class Sa extends
|
|
1579
|
+
class Sa extends dt {
|
|
1580
1580
|
mount() {
|
|
1581
|
-
this.unmount =
|
|
1581
|
+
this.unmount = lt(Wn(this.node, !0), Wn(this.node, !1));
|
|
1582
1582
|
}
|
|
1583
1583
|
unmount() {
|
|
1584
1584
|
}
|
|
1585
1585
|
}
|
|
1586
|
-
class Ta extends
|
|
1586
|
+
class Ta extends dt {
|
|
1587
1587
|
constructor() {
|
|
1588
1588
|
super(...arguments), this.isActive = !1;
|
|
1589
1589
|
}
|
|
@@ -1600,7 +1600,7 @@ class Ta extends ft {
|
|
|
1600
1600
|
!this.isActive || !this.node.animationState || (this.node.animationState.setActive("whileFocus", !1), this.isActive = !1);
|
|
1601
1601
|
}
|
|
1602
1602
|
mount() {
|
|
1603
|
-
this.unmount =
|
|
1603
|
+
this.unmount = lt(Z(this.node.current, "focus", () => this.onFocus()), Z(this.node.current, "blur", () => this.onBlur()));
|
|
1604
1604
|
}
|
|
1605
1605
|
unmount() {
|
|
1606
1606
|
}
|
|
@@ -1612,21 +1612,21 @@ function Oe(t, e) {
|
|
|
1612
1612
|
const n = new PointerEvent("pointer" + t);
|
|
1613
1613
|
e(n, Pe(n));
|
|
1614
1614
|
}
|
|
1615
|
-
class Aa extends
|
|
1615
|
+
class Aa extends dt {
|
|
1616
1616
|
constructor() {
|
|
1617
1617
|
super(...arguments), this.removeStartListeners = O, this.removeEndListeners = O, this.removeAccessibleListeners = O, this.startPointerPress = (e, n) => {
|
|
1618
1618
|
if (this.isPressing)
|
|
1619
1619
|
return;
|
|
1620
1620
|
this.removeEndListeners();
|
|
1621
|
-
const i = this.node.getProps(), o =
|
|
1621
|
+
const i = this.node.getProps(), o = J(window, "pointerup", (a, l) => {
|
|
1622
1622
|
if (!this.checkPressEnd())
|
|
1623
1623
|
return;
|
|
1624
1624
|
const { onTap: c, onTapCancel: u, globalTapTarget: h } = this.node.getProps();
|
|
1625
1625
|
V.update(() => {
|
|
1626
1626
|
!h && !As(this.node.current, a.target) ? u && u(a, l) : c && c(a, l);
|
|
1627
1627
|
});
|
|
1628
|
-
}, { passive: !(i.onTap || i.onPointerUp) }), r =
|
|
1629
|
-
this.removeEndListeners =
|
|
1628
|
+
}, { passive: !(i.onTap || i.onPointerUp) }), r = J(window, "pointercancel", (a, l) => this.cancelPress(a, l), { passive: !(i.onTapCancel || i.onPointerCancel) });
|
|
1629
|
+
this.removeEndListeners = lt(o, r), this.startPress(e, n);
|
|
1630
1630
|
}, this.startAccessiblePress = () => {
|
|
1631
1631
|
const e = (o) => {
|
|
1632
1632
|
if (o.key !== "Enter" || this.isPressing)
|
|
@@ -1637,13 +1637,13 @@ class Aa extends ft {
|
|
|
1637
1637
|
u && V.update(() => u(l, c));
|
|
1638
1638
|
});
|
|
1639
1639
|
};
|
|
1640
|
-
this.removeEndListeners(), this.removeEndListeners =
|
|
1640
|
+
this.removeEndListeners(), this.removeEndListeners = Z(this.node.current, "keyup", r), Oe("down", (a, l) => {
|
|
1641
1641
|
this.startPress(a, l);
|
|
1642
1642
|
});
|
|
1643
|
-
}, n =
|
|
1643
|
+
}, n = Z(this.node.current, "keydown", e), i = () => {
|
|
1644
1644
|
this.isPressing && Oe("cancel", (o, r) => this.cancelPress(o, r));
|
|
1645
|
-
}, s =
|
|
1646
|
-
this.removeAccessibleListeners =
|
|
1645
|
+
}, s = Z(this.node.current, "blur", i);
|
|
1646
|
+
this.removeAccessibleListeners = lt(n, s);
|
|
1647
1647
|
};
|
|
1648
1648
|
}
|
|
1649
1649
|
startPress(e, n) {
|
|
@@ -1661,8 +1661,8 @@ class Aa extends ft {
|
|
|
1661
1661
|
i && V.update(() => i(e, n));
|
|
1662
1662
|
}
|
|
1663
1663
|
mount() {
|
|
1664
|
-
const e = this.node.getProps(), n =
|
|
1665
|
-
this.removeStartListeners =
|
|
1664
|
+
const e = this.node.getProps(), n = J(e.globalTapTarget ? window : this.node.current, "pointerdown", this.startPointerPress, { passive: !(e.onTapStart || e.onPointerStart) }), i = Z(this.node.current, "focus", this.startAccessiblePress);
|
|
1665
|
+
this.removeStartListeners = lt(n, i);
|
|
1666
1666
|
}
|
|
1667
1667
|
unmount() {
|
|
1668
1668
|
this.removeStartListeners(), this.removeEndListeners(), this.removeAccessibleListeners();
|
|
@@ -1690,7 +1690,7 @@ const Ea = {
|
|
|
1690
1690
|
some: 0,
|
|
1691
1691
|
all: 1
|
|
1692
1692
|
};
|
|
1693
|
-
class Ma extends
|
|
1693
|
+
class Ma extends dt {
|
|
1694
1694
|
constructor() {
|
|
1695
1695
|
super(...arguments), this.hasEnteredView = !1, this.isInView = !1;
|
|
1696
1696
|
}
|
|
@@ -1762,14 +1762,14 @@ function ke(t, e, n) {
|
|
|
1762
1762
|
const i = t.getProps();
|
|
1763
1763
|
return dn(i, e, n !== void 0 ? n : i.custom, La(t), Ra(t));
|
|
1764
1764
|
}
|
|
1765
|
-
let Qt = O,
|
|
1765
|
+
let Qt = O, q = O;
|
|
1766
1766
|
process.env.NODE_ENV !== "production" && (Qt = (t, e) => {
|
|
1767
1767
|
!t && typeof console < "u" && console.warn(e);
|
|
1768
|
-
},
|
|
1768
|
+
}, q = (t, e) => {
|
|
1769
1769
|
if (!t)
|
|
1770
1770
|
throw new Error(e);
|
|
1771
1771
|
});
|
|
1772
|
-
const
|
|
1772
|
+
const ct = (t) => t * 1e3, tt = (t) => t / 1e3, Ba = {
|
|
1773
1773
|
current: !1
|
|
1774
1774
|
}, ks = (t) => Array.isArray(t) && typeof t[0] == "number";
|
|
1775
1775
|
function Cs(t) {
|
|
@@ -1835,11 +1835,11 @@ const Wa = Zt(0.42, 0, 1, 1), _a = Zt(0, 0, 0.58, 1), Os = Zt(0.42, 0, 0.58, 1),
|
|
|
1835
1835
|
anticipate: Ya
|
|
1836
1836
|
}, Un = (t) => {
|
|
1837
1837
|
if (Array.isArray(t)) {
|
|
1838
|
-
|
|
1838
|
+
q(t.length === 4, "Cubic bezier arrays must contain four numerical values.");
|
|
1839
1839
|
const [e, n, i, s] = t;
|
|
1840
1840
|
return Zt(e, n, i, s);
|
|
1841
1841
|
} else if (typeof t == "string")
|
|
1842
|
-
return
|
|
1842
|
+
return q(_n[t] !== void 0, `Invalid easing type '${t}'`), _n[t];
|
|
1843
1843
|
return t;
|
|
1844
1844
|
}, mn = (t, e) => (n) => !!(Kt(n) && qo.test(n) && n.startsWith(t) || e && Object.prototype.hasOwnProperty.call(n, e)), Ns = (t, e, n) => (i) => {
|
|
1845
1845
|
if (!Kt(i))
|
|
@@ -1851,10 +1851,10 @@ const Wa = Zt(0.42, 0, 1, 1), _a = Zt(0, 0, 0.58, 1), Os = Zt(0.42, 0, 0.58, 1),
|
|
|
1851
1851
|
[n]: parseFloat(r),
|
|
1852
1852
|
alpha: a !== void 0 ? parseFloat(a) : 1
|
|
1853
1853
|
};
|
|
1854
|
-
}, Xa = (t) =>
|
|
1855
|
-
...
|
|
1854
|
+
}, Xa = (t) => ut(0, 255, t), Le = {
|
|
1855
|
+
...bt,
|
|
1856
1856
|
transform: (t) => Math.round(Xa(t))
|
|
1857
|
-
},
|
|
1857
|
+
}, vt = {
|
|
1858
1858
|
test: mn("rgb", "red"),
|
|
1859
1859
|
parse: Ns("red", "green", "blue"),
|
|
1860
1860
|
transform: ({ red: t, green: e, blue: n, alpha: i = 1 }) => "rgba(" + Le.transform(t) + ", " + Le.transform(e) + ", " + Le.transform(n) + ", " + Wt(zt.transform(i)) + ")"
|
|
@@ -1871,15 +1871,15 @@ function qa(t) {
|
|
|
1871
1871
|
const He = {
|
|
1872
1872
|
test: mn("#"),
|
|
1873
1873
|
parse: qa,
|
|
1874
|
-
transform:
|
|
1874
|
+
transform: vt.transform
|
|
1875
1875
|
}, kt = {
|
|
1876
1876
|
test: mn("hsl", "hue"),
|
|
1877
1877
|
parse: Ns("hue", "saturation", "lightness"),
|
|
1878
|
-
transform: ({ hue: t, saturation: e, lightness: n, alpha: i = 1 }) => "hsla(" + Math.round(t) + ", " +
|
|
1878
|
+
transform: ({ hue: t, saturation: e, lightness: n, alpha: i = 1 }) => "hsla(" + Math.round(t) + ", " + K.transform(Wt(e)) + ", " + K.transform(Wt(n)) + ", " + Wt(zt.transform(i)) + ")"
|
|
1879
1879
|
}, I = {
|
|
1880
|
-
test: (t) =>
|
|
1881
|
-
parse: (t) =>
|
|
1882
|
-
transform: (t) => Kt(t) ? t : t.hasOwnProperty("red") ?
|
|
1880
|
+
test: (t) => vt.test(t) || He.test(t) || kt.test(t),
|
|
1881
|
+
parse: (t) => vt.test(t) ? vt.parse(t) : kt.test(t) ? kt.parse(t) : He.parse(t),
|
|
1882
|
+
transform: (t) => Kt(t) ? t : t.hasOwnProperty("red") ? vt.transform(t) : kt.transform(t)
|
|
1883
1883
|
}, M = (t, e, n) => -n * t + n * e + t;
|
|
1884
1884
|
function Re(t, e, n) {
|
|
1885
1885
|
return n < 0 && (n += 1), n > 1 && (n -= 1), n < 1 / 6 ? t + (e - t) * 6 * n : n < 1 / 2 ? e : n < 2 / 3 ? t + (e - t) * (2 / 3 - n) * 6 : t;
|
|
@@ -1903,16 +1903,16 @@ function Ka({ hue: t, saturation: e, lightness: n, alpha: i }) {
|
|
|
1903
1903
|
const Be = (t, e, n) => {
|
|
1904
1904
|
const i = t * t;
|
|
1905
1905
|
return Math.sqrt(Math.max(0, n * (e * e - i) + i));
|
|
1906
|
-
}, $a = [He,
|
|
1906
|
+
}, $a = [He, vt, kt], Qa = (t) => $a.find((e) => e.test(t));
|
|
1907
1907
|
function Hn(t) {
|
|
1908
1908
|
const e = Qa(t);
|
|
1909
|
-
|
|
1909
|
+
q(!!e, `'${t}' is not an animatable color. Use the equivalent color code instead.`);
|
|
1910
1910
|
let n = e.parse(t);
|
|
1911
1911
|
return e === kt && (n = Ka(n)), n;
|
|
1912
1912
|
}
|
|
1913
1913
|
const js = (t, e) => {
|
|
1914
1914
|
const n = Hn(t), i = Hn(e), s = { ...n };
|
|
1915
|
-
return (o) => (s.red = Be(n.red, i.red, o), s.green = Be(n.green, i.green, o), s.blue = Be(n.blue, i.blue, o), s.alpha = M(n.alpha, i.alpha, o),
|
|
1915
|
+
return (o) => (s.red = Be(n.red, i.red, o), s.green = Be(n.green, i.green, o), s.blue = Be(n.blue, i.blue, o), s.alpha = M(n.alpha, i.alpha, o), vt.transform(s));
|
|
1916
1916
|
};
|
|
1917
1917
|
function Za(t) {
|
|
1918
1918
|
var e, n;
|
|
@@ -1932,7 +1932,7 @@ const Is = {
|
|
|
1932
1932
|
regex: Ae,
|
|
1933
1933
|
countKey: "Numbers",
|
|
1934
1934
|
token: "${n}",
|
|
1935
|
-
parse:
|
|
1935
|
+
parse: bt.parse
|
|
1936
1936
|
};
|
|
1937
1937
|
function Ne(t, { regex: e, countKey: n, token: i, parse: s }) {
|
|
1938
1938
|
const o = t.tokenised.match(e);
|
|
@@ -1966,7 +1966,7 @@ function tl(t) {
|
|
|
1966
1966
|
const e = Ws(t);
|
|
1967
1967
|
return _s(t)(e.map(Ja));
|
|
1968
1968
|
}
|
|
1969
|
-
const
|
|
1969
|
+
const ht = {
|
|
1970
1970
|
test: Za,
|
|
1971
1971
|
parse: Ws,
|
|
1972
1972
|
createTransformer: _s,
|
|
@@ -1992,8 +1992,8 @@ const Gs = (t, e) => {
|
|
|
1992
1992
|
return n;
|
|
1993
1993
|
};
|
|
1994
1994
|
}, Ys = (t, e) => {
|
|
1995
|
-
const n =
|
|
1996
|
-
return i.numVars === s.numVars && i.numColors === s.numColors && i.numNumbers >= s.numNumbers ?
|
|
1995
|
+
const n = ht.createTransformer(e), i = pe(t), s = pe(e);
|
|
1996
|
+
return i.numVars === s.numVars && i.numColors === s.numColors && i.numNumbers >= s.numNumbers ? lt(Gs(i.values, s.values), n) : (Qt(!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.`), Us(t, e));
|
|
1997
1997
|
}, Yt = (t, e, n) => {
|
|
1998
1998
|
const i = e - t;
|
|
1999
1999
|
return i === 0 ? 1 : (n - t) / i;
|
|
@@ -2007,7 +2007,7 @@ function il(t, e, n) {
|
|
|
2007
2007
|
let a = s(t[r], t[r + 1]);
|
|
2008
2008
|
if (e) {
|
|
2009
2009
|
const l = Array.isArray(e) ? e[r] || O : e;
|
|
2010
|
-
a =
|
|
2010
|
+
a = lt(l, a);
|
|
2011
2011
|
}
|
|
2012
2012
|
i.push(a);
|
|
2013
2013
|
}
|
|
@@ -2015,7 +2015,7 @@ function il(t, e, n) {
|
|
|
2015
2015
|
}
|
|
2016
2016
|
function Xs(t, e, { clamp: n = !0, ease: i, mixer: s } = {}) {
|
|
2017
2017
|
const o = t.length;
|
|
2018
|
-
if (
|
|
2018
|
+
if (q(o === e.length, "Both input and output ranges must be the same length"), o === 1)
|
|
2019
2019
|
return () => e[0];
|
|
2020
2020
|
t[0] > t[o - 1] && (t = [...t].reverse(), e = [...e].reverse());
|
|
2021
2021
|
const r = il(e, i, s), a = r.length, l = (c) => {
|
|
@@ -2026,7 +2026,7 @@ function Xs(t, e, { clamp: n = !0, ease: i, mixer: s } = {}) {
|
|
|
2026
2026
|
const h = Yt(t[u], t[u + 1], c);
|
|
2027
2027
|
return r[u](h);
|
|
2028
2028
|
};
|
|
2029
|
-
return n ? (c) => l(
|
|
2029
|
+
return n ? (c) => l(ut(t[0], t[o - 1], c)) : l;
|
|
2030
2030
|
}
|
|
2031
2031
|
function sl(t, e) {
|
|
2032
2032
|
const n = t[t.length - 1];
|
|
@@ -2073,9 +2073,9 @@ function Ks(t, e, n) {
|
|
|
2073
2073
|
const je = 1e-3, cl = 0.01, Yn = 10, ul = 0.05, hl = 1;
|
|
2074
2074
|
function dl({ duration: t = 800, bounce: e = 0.25, velocity: n = 0, mass: i = 1 }) {
|
|
2075
2075
|
let s, o;
|
|
2076
|
-
Qt(t <=
|
|
2076
|
+
Qt(t <= ct(Yn), "Spring duration must be 10 seconds or less");
|
|
2077
2077
|
let r = 1 - e;
|
|
2078
|
-
r =
|
|
2078
|
+
r = ut(ul, hl, r), t = ut(cl, Yn, tt(t)), r < 1 ? (s = (c) => {
|
|
2079
2079
|
const u = c * r, h = u * t, d = u - n, f = Ge(c, r), p = Math.exp(-h);
|
|
2080
2080
|
return je - d / f * p;
|
|
2081
2081
|
}, o = (c) => {
|
|
@@ -2089,7 +2089,7 @@ function dl({ duration: t = 800, bounce: e = 0.25, velocity: n = 0, mass: i = 1
|
|
|
2089
2089
|
return u * h;
|
|
2090
2090
|
});
|
|
2091
2091
|
const a = 5 / t, l = pl(s, o, a);
|
|
2092
|
-
if (t =
|
|
2092
|
+
if (t = ct(t), isNaN(l))
|
|
2093
2093
|
return {
|
|
2094
2094
|
stiffness: 100,
|
|
2095
2095
|
damping: 10,
|
|
@@ -2140,23 +2140,23 @@ function vl(t) {
|
|
|
2140
2140
|
function $s({ keyframes: t, restDelta: e, restSpeed: n, ...i }) {
|
|
2141
2141
|
const s = t[0], o = t[t.length - 1], r = { done: !1, value: s }, { stiffness: a, damping: l, mass: c, duration: u, velocity: h, isResolvedFromDuration: d } = vl({
|
|
2142
2142
|
...i,
|
|
2143
|
-
velocity: -
|
|
2144
|
-
}), f = h || 0, p = l / (2 * Math.sqrt(a * c)), m = o - s, v =
|
|
2143
|
+
velocity: -tt(i.velocity || 0)
|
|
2144
|
+
}), f = h || 0, p = l / (2 * Math.sqrt(a * c)), m = o - s, v = tt(Math.sqrt(a / c)), y = Math.abs(m) < 5;
|
|
2145
2145
|
n || (n = y ? 0.01 : 2), e || (e = y ? 5e-3 : 0.5);
|
|
2146
2146
|
let b;
|
|
2147
2147
|
if (p < 1) {
|
|
2148
2148
|
const g = Ge(v, p);
|
|
2149
2149
|
b = (x) => {
|
|
2150
|
-
const
|
|
2151
|
-
return o -
|
|
2150
|
+
const S = Math.exp(-p * v * x);
|
|
2151
|
+
return o - S * ((f + p * v * m) / g * Math.sin(g * x) + m * Math.cos(g * x));
|
|
2152
2152
|
};
|
|
2153
2153
|
} else if (p === 1)
|
|
2154
2154
|
b = (g) => o - Math.exp(-v * g) * (m + (f + v * m) * g);
|
|
2155
2155
|
else {
|
|
2156
2156
|
const g = v * Math.sqrt(p * p - 1);
|
|
2157
2157
|
b = (x) => {
|
|
2158
|
-
const
|
|
2159
|
-
return o -
|
|
2158
|
+
const S = Math.exp(-p * v * x), T = Math.min(g * x, 300);
|
|
2159
|
+
return o - S * ((f + p * v * m) * Math.sinh(T) + g * m * Math.cosh(T)) / g;
|
|
2160
2160
|
};
|
|
2161
2161
|
}
|
|
2162
2162
|
return {
|
|
@@ -2166,10 +2166,10 @@ function $s({ keyframes: t, restDelta: e, restSpeed: n, ...i }) {
|
|
|
2166
2166
|
if (d)
|
|
2167
2167
|
r.done = g >= u;
|
|
2168
2168
|
else {
|
|
2169
|
-
let
|
|
2170
|
-
g !== 0 && (p < 1 ?
|
|
2171
|
-
const
|
|
2172
|
-
r.done =
|
|
2169
|
+
let S = f;
|
|
2170
|
+
g !== 0 && (p < 1 ? S = Ks(b, g, x) : S = 0);
|
|
2171
|
+
const T = Math.abs(S) <= n, k = Math.abs(o - x) <= e;
|
|
2172
|
+
r.done = T && k;
|
|
2173
2173
|
}
|
|
2174
2174
|
return r.value = r.done ? o : x, r;
|
|
2175
2175
|
}
|
|
@@ -2184,12 +2184,12 @@ function qn({ keyframes: t, velocity: e = 0, power: n = 0.8, timeConstant: i = 3
|
|
|
2184
2184
|
const v = h + m, y = r === void 0 ? v : r(v);
|
|
2185
2185
|
y !== v && (m = y - h);
|
|
2186
2186
|
const b = (P) => -m * Math.exp(-P / i), g = (P) => y + b(P), x = (P) => {
|
|
2187
|
-
const C = b(P),
|
|
2188
|
-
d.done = Math.abs(C) <= c, d.value = d.done ? y :
|
|
2187
|
+
const C = b(P), $ = g(P);
|
|
2188
|
+
d.done = Math.abs(C) <= c, d.value = d.done ? y : $;
|
|
2189
2189
|
};
|
|
2190
|
-
let
|
|
2190
|
+
let S, T;
|
|
2191
2191
|
const k = (P) => {
|
|
2192
|
-
f(d.value) && (
|
|
2192
|
+
f(d.value) && (S = P, T = $s({
|
|
2193
2193
|
keyframes: [d.value, p(d.value)],
|
|
2194
2194
|
velocity: Ks(g, P, d.value),
|
|
2195
2195
|
damping: s,
|
|
@@ -2202,7 +2202,7 @@ function qn({ keyframes: t, velocity: e = 0, power: n = 0.8, timeConstant: i = 3
|
|
|
2202
2202
|
calculatedDuration: null,
|
|
2203
2203
|
next: (P) => {
|
|
2204
2204
|
let C = !1;
|
|
2205
|
-
return !
|
|
2205
|
+
return !T && S === void 0 && (C = !0, x(P), k(P)), S !== void 0 && P > S ? T.next(P - S) : (!C && x(P), d);
|
|
2206
2206
|
}
|
|
2207
2207
|
};
|
|
2208
2208
|
}
|
|
@@ -2210,7 +2210,7 @@ const yl = (t) => {
|
|
|
2210
2210
|
const e = ({ timestamp: n }) => t(n);
|
|
2211
2211
|
return {
|
|
2212
2212
|
start: () => V.update(e, !0),
|
|
2213
|
-
stop: () =>
|
|
2213
|
+
stop: () => et(e),
|
|
2214
2214
|
/**
|
|
2215
2215
|
* If we're processing this frame we can use the
|
|
2216
2216
|
* framelocked timestamp to keep things in sync.
|
|
@@ -2244,44 +2244,44 @@ function ge({ autoplay: t = !0, delay: e = 0, driver: n = yl, keyframes: i, type
|
|
|
2244
2244
|
let b;
|
|
2245
2245
|
const g = bl[s] || me;
|
|
2246
2246
|
let x;
|
|
2247
|
-
g !== me && typeof i[0] != "number" && (process.env.NODE_ENV !== "production" &&
|
|
2247
|
+
g !== me && typeof i[0] != "number" && (process.env.NODE_ENV !== "production" && q(i.length === 2, `Only two keyframes currently supported with spring and inertia animations. Trying to animate ${i}`), x = Xs([0, 100], i, {
|
|
2248
2248
|
clamp: !1
|
|
2249
2249
|
}), i = [0, 100]);
|
|
2250
|
-
const
|
|
2251
|
-
let
|
|
2252
|
-
a === "mirror" && (
|
|
2250
|
+
const S = g({ ...d, keyframes: i });
|
|
2251
|
+
let T;
|
|
2252
|
+
a === "mirror" && (T = g({
|
|
2253
2253
|
...d,
|
|
2254
2254
|
keyframes: [...i].reverse(),
|
|
2255
2255
|
velocity: -(d.velocity || 0)
|
|
2256
2256
|
}));
|
|
2257
|
-
let k = "idle", P = null, C = null,
|
|
2258
|
-
|
|
2259
|
-
const { calculatedDuration:
|
|
2260
|
-
let
|
|
2261
|
-
|
|
2257
|
+
let k = "idle", P = null, C = null, $ = null;
|
|
2258
|
+
S.calculatedDuration === null && o && (S.calculatedDuration = $n(S));
|
|
2259
|
+
const { calculatedDuration: xt } = S;
|
|
2260
|
+
let Y = 1 / 0, Q = 1 / 0;
|
|
2261
|
+
xt !== null && (Y = xt + r, Q = Y * (o + 1) - r);
|
|
2262
2262
|
let j = 0;
|
|
2263
2263
|
const wt = (E) => {
|
|
2264
2264
|
if (C === null)
|
|
2265
2265
|
return;
|
|
2266
|
-
f > 0 && (C = Math.min(C, E)), f < 0 && (C = Math.min(E -
|
|
2267
|
-
const Rt = j - e * (f >= 0 ? 1 : -1), An = f >= 0 ? Rt < 0 : Rt >
|
|
2268
|
-
j = Math.max(Rt, 0), k === "finished" && P === null && (j =
|
|
2269
|
-
let Pn = j, kn =
|
|
2266
|
+
f > 0 && (C = Math.min(C, E)), f < 0 && (C = Math.min(E - Q / f, C)), P !== null ? j = P : j = Math.round(E - C) * f;
|
|
2267
|
+
const Rt = j - e * (f >= 0 ? 1 : -1), An = f >= 0 ? Rt < 0 : Rt > Q;
|
|
2268
|
+
j = Math.max(Rt, 0), k === "finished" && P === null && (j = Q);
|
|
2269
|
+
let Pn = j, kn = S;
|
|
2270
2270
|
if (o) {
|
|
2271
|
-
const Ce = Math.min(j,
|
|
2272
|
-
let Jt = Math.floor(Ce),
|
|
2273
|
-
!
|
|
2271
|
+
const Ce = Math.min(j, Q) / Y;
|
|
2272
|
+
let Jt = Math.floor(Ce), ft = Ce % 1;
|
|
2273
|
+
!ft && Ce >= 1 && (ft = 1), ft === 1 && Jt--, Jt = Math.min(Jt, o + 1), !!(Jt % 2) && (a === "reverse" ? (ft = 1 - ft, r && (ft -= r / Y)) : a === "mirror" && (kn = T)), Pn = ut(0, 1, ft) * Y;
|
|
2274
2274
|
}
|
|
2275
2275
|
const Bt = An ? { done: !1, value: i[0] } : kn.next(Pn);
|
|
2276
2276
|
x && (Bt.value = x(Bt.value));
|
|
2277
2277
|
let { done: Cn } = Bt;
|
|
2278
|
-
!An &&
|
|
2278
|
+
!An && xt !== null && (Cn = f >= 0 ? j >= Q : j <= 0);
|
|
2279
2279
|
const Pr = P === null && (k === "finished" || k === "running" && Cn);
|
|
2280
2280
|
return h && h(Bt.value), Pr && Lt(), Bt;
|
|
2281
2281
|
}, R = () => {
|
|
2282
2282
|
b && b.stop(), b = void 0;
|
|
2283
|
-
},
|
|
2284
|
-
k = "idle", R(), m(), y(), C =
|
|
2283
|
+
}, nt = () => {
|
|
2284
|
+
k = "idle", R(), m(), y(), C = $ = null;
|
|
2285
2285
|
}, Lt = () => {
|
|
2286
2286
|
k = "finished", u && u(), R(), m();
|
|
2287
2287
|
}, St = () => {
|
|
@@ -2289,7 +2289,7 @@ function ge({ autoplay: t = !0, delay: e = 0, driver: n = yl, keyframes: i, type
|
|
|
2289
2289
|
return;
|
|
2290
2290
|
b || (b = n(wt));
|
|
2291
2291
|
const E = b.now();
|
|
2292
|
-
l && l(), P !== null ? C = E - P : (!C || k === "finished") && (C = E), k === "finished" && y(),
|
|
2292
|
+
l && l(), P !== null ? C = E - P : (!C || k === "finished") && (C = E), k === "finished" && y(), $ = C, P = null, k = "running", b.start();
|
|
2293
2293
|
};
|
|
2294
2294
|
t && St();
|
|
2295
2295
|
const Tn = {
|
|
@@ -2297,20 +2297,20 @@ function ge({ autoplay: t = !0, delay: e = 0, driver: n = yl, keyframes: i, type
|
|
|
2297
2297
|
return v.then(E, Rt);
|
|
2298
2298
|
},
|
|
2299
2299
|
get time() {
|
|
2300
|
-
return
|
|
2300
|
+
return tt(j);
|
|
2301
2301
|
},
|
|
2302
2302
|
set time(E) {
|
|
2303
|
-
E =
|
|
2303
|
+
E = ct(E), j = E, P !== null || !b || f === 0 ? P = E : C = b.now() - E / f;
|
|
2304
2304
|
},
|
|
2305
2305
|
get duration() {
|
|
2306
|
-
const E =
|
|
2307
|
-
return
|
|
2306
|
+
const E = S.calculatedDuration === null ? $n(S) : S.calculatedDuration;
|
|
2307
|
+
return tt(E);
|
|
2308
2308
|
},
|
|
2309
2309
|
get speed() {
|
|
2310
2310
|
return f;
|
|
2311
2311
|
},
|
|
2312
2312
|
set speed(E) {
|
|
2313
|
-
E === f || !b || (f = E, Tn.time =
|
|
2313
|
+
E === f || !b || (f = E, Tn.time = tt(j));
|
|
2314
2314
|
},
|
|
2315
2315
|
get state() {
|
|
2316
2316
|
return k;
|
|
@@ -2320,10 +2320,10 @@ function ge({ autoplay: t = !0, delay: e = 0, driver: n = yl, keyframes: i, type
|
|
|
2320
2320
|
k = "paused", P = j;
|
|
2321
2321
|
},
|
|
2322
2322
|
stop: () => {
|
|
2323
|
-
p = !0, k !== "idle" && (k = "idle", c && c(),
|
|
2323
|
+
p = !0, k !== "idle" && (k = "idle", c && c(), nt());
|
|
2324
2324
|
},
|
|
2325
2325
|
cancel: () => {
|
|
2326
|
-
|
|
2326
|
+
$ !== null && wt($), nt();
|
|
2327
2327
|
},
|
|
2328
2328
|
complete: () => {
|
|
2329
2329
|
k = "finished";
|
|
@@ -2361,11 +2361,11 @@ function Pl(t, e, { onUpdate: n, onComplete: i, ...s }) {
|
|
|
2361
2361
|
delay: 0
|
|
2362
2362
|
});
|
|
2363
2363
|
let x = { done: !1, value: h[0] };
|
|
2364
|
-
const
|
|
2365
|
-
let
|
|
2366
|
-
for (; !x.done &&
|
|
2367
|
-
x = g.sample(
|
|
2368
|
-
p = void 0, h =
|
|
2364
|
+
const S = [];
|
|
2365
|
+
let T = 0;
|
|
2366
|
+
for (; !x.done && T < Tl; )
|
|
2367
|
+
x = g.sample(T), S.push(x.value), T += ie;
|
|
2368
|
+
p = void 0, h = S, d = T - ie, f = "linear";
|
|
2369
2369
|
}
|
|
2370
2370
|
const m = Na(t.owner.current, e, h, {
|
|
2371
2371
|
...s,
|
|
@@ -2395,10 +2395,10 @@ function Pl(t, e, { onUpdate: n, onComplete: i, ...s }) {
|
|
|
2395
2395
|
return m.timeline = g, m.onfinish = null, O;
|
|
2396
2396
|
},
|
|
2397
2397
|
get time() {
|
|
2398
|
-
return
|
|
2398
|
+
return tt(m.currentTime || 0);
|
|
2399
2399
|
},
|
|
2400
2400
|
set time(g) {
|
|
2401
|
-
m.currentTime =
|
|
2401
|
+
m.currentTime = ct(g);
|
|
2402
2402
|
},
|
|
2403
2403
|
get speed() {
|
|
2404
2404
|
return m.playbackRate;
|
|
@@ -2407,10 +2407,10 @@ function Pl(t, e, { onUpdate: n, onComplete: i, ...s }) {
|
|
|
2407
2407
|
m.playbackRate = g;
|
|
2408
2408
|
},
|
|
2409
2409
|
get duration() {
|
|
2410
|
-
return
|
|
2410
|
+
return tt(d);
|
|
2411
2411
|
},
|
|
2412
2412
|
play: () => {
|
|
2413
|
-
r || (m.play(),
|
|
2413
|
+
r || (m.play(), et(v));
|
|
2414
2414
|
},
|
|
2415
2415
|
pause: () => m.pause(),
|
|
2416
2416
|
stop: () => {
|
|
@@ -2468,8 +2468,8 @@ const Cl = {
|
|
|
2468
2468
|
type: "keyframes",
|
|
2469
2469
|
ease: [0.25, 0.1, 0.35, 1],
|
|
2470
2470
|
duration: 0.3
|
|
2471
|
-
}, Ol = (t, { keyframes: e }) => e.length > 2 ? El :
|
|
2472
|
-
(
|
|
2471
|
+
}, Ol = (t, { keyframes: e }) => e.length > 2 ? El : yt.has(t) ? t.startsWith("scale") ? Vl(e[1]) : Cl : Ml, Ye = (t, e) => t === "zIndex" ? !1 : !!(typeof e == "number" || Array.isArray(e) || typeof e == "string" && // It's animatable if we have a string
|
|
2472
|
+
(ht.test(e) || e === "0") && // And it contains numbers and/or colors
|
|
2473
2473
|
!e.startsWith("url(")), Dl = /* @__PURE__ */ new Set(["brightness", "contrast", "saturate", "opacity"]);
|
|
2474
2474
|
function Ll(t) {
|
|
2475
2475
|
const [e, n] = t.slice(0, -1).split("(");
|
|
@@ -2483,7 +2483,7 @@ function Ll(t) {
|
|
|
2483
2483
|
return i !== n && (o *= 100), e + "(" + o + s + ")";
|
|
2484
2484
|
}
|
|
2485
2485
|
const Rl = /([a-z-]*)\(.*?\)/g, Xe = {
|
|
2486
|
-
...
|
|
2486
|
+
...ht,
|
|
2487
2487
|
getAnimatableNone: (t) => {
|
|
2488
2488
|
const e = t.match(Rl);
|
|
2489
2489
|
return e ? e.map(Ll).join(" ") : t;
|
|
@@ -2507,7 +2507,7 @@ const Rl = /([a-z-]*)\(.*?\)/g, Xe = {
|
|
|
2507
2507
|
}, gn = (t) => Bl[t];
|
|
2508
2508
|
function Qs(t, e) {
|
|
2509
2509
|
let n = gn(t);
|
|
2510
|
-
return n !== Xe && (n =
|
|
2510
|
+
return n !== Xe && (n = ht), n.getAnimatableNone ? n.getAnimatableNone(e) : void 0;
|
|
2511
2511
|
}
|
|
2512
2512
|
const Zs = (t) => /^0[^.\s]+$/.test(t);
|
|
2513
2513
|
function Nl(t) {
|
|
@@ -2543,7 +2543,7 @@ const Fl = {
|
|
|
2543
2543
|
}, yn = (t, e, n, i = {}) => (s) => {
|
|
2544
2544
|
const o = vn(i, t) || {}, r = o.delay || i.delay || 0;
|
|
2545
2545
|
let { elapsed: a = 0 } = i;
|
|
2546
|
-
a = a -
|
|
2546
|
+
a = a - ct(r);
|
|
2547
2547
|
const l = jl(e, t, n, o), c = l[0], u = l[l.length - 1], h = Ye(t, c), d = Ye(t, u);
|
|
2548
2548
|
Qt(h === d, `You are trying to animate ${t} from "${c}" to "${u}". ${c} is not an animatable value - to enable this animation set ${c} to a value animatable to ${u} via the \`style\` property.`);
|
|
2549
2549
|
let f = {
|
|
@@ -2562,7 +2562,7 @@ const Fl = {
|
|
|
2562
2562
|
if (Il(o) || (f = {
|
|
2563
2563
|
...f,
|
|
2564
2564
|
...Ol(t, f)
|
|
2565
|
-
}), f.duration && (f.duration =
|
|
2565
|
+
}), f.duration && (f.duration = ct(f.duration)), f.repeatDelay && (f.repeatDelay = ct(f.repeatDelay)), !h || !d || Ba.current || o.type === !1 || Fl.skipAnimations)
|
|
2566
2566
|
return kl(f);
|
|
2567
2567
|
if (
|
|
2568
2568
|
/**
|
|
@@ -2819,7 +2819,7 @@ function Mt(t, e) {
|
|
|
2819
2819
|
const tr = (t) => (e) => e.test(t), _l = {
|
|
2820
2820
|
test: (t) => t === "auto",
|
|
2821
2821
|
parse: (t) => t
|
|
2822
|
-
}, er = [
|
|
2822
|
+
}, er = [bt, A, K, ot, $o, Ko, _l], jt = (t) => er.find(tr(t)), Ul = [...er, I, ht], Hl = (t) => Ul.find(tr(t));
|
|
2823
2823
|
function Gl(t, e, n) {
|
|
2824
2824
|
t.hasValue(e) ? t.getValue(e).set(n) : t.addValue(e, Mt(n));
|
|
2825
2825
|
}
|
|
@@ -2839,7 +2839,7 @@ function Xl(t, e, n) {
|
|
|
2839
2839
|
for (let a = 0; a < r; a++) {
|
|
2840
2840
|
const l = o[a], c = e[l];
|
|
2841
2841
|
let u = null;
|
|
2842
|
-
Array.isArray(c) && (u = c[0]), u === null && (u = (s = (i = n[l]) !== null && i !== void 0 ? i : t.readValue(l)) !== null && s !== void 0 ? s : e[l]), u != null && (typeof u == "string" && (Js(u) || Zs(u)) ? u = parseFloat(u) : !Hl(u) &&
|
|
2842
|
+
Array.isArray(c) && (u = c[0]), u === null && (u = (s = (i = n[l]) !== null && i !== void 0 ? i : t.readValue(l)) !== null && s !== void 0 ? s : e[l]), u != null && (typeof u == "string" && (Js(u) || Zs(u)) ? u = parseFloat(u) : !Hl(u) && ht.test(c) && (u = Qs(l, c)), t.addValue(l, Mt(u, { owner: t })), n[l] === void 0 && (n[l] = u), u !== null && t.setBaseTarget(l, u));
|
|
2843
2843
|
}
|
|
2844
2844
|
}
|
|
2845
2845
|
function ql(t, e) {
|
|
@@ -2895,7 +2895,7 @@ function nr(t, e, { delay: n = 0, transitionOverride: i, type: s } = {}) {
|
|
|
2895
2895
|
let m = !p.isHandoff && !Ql(d, f);
|
|
2896
2896
|
if (p.type === "spring" && (d.getVelocity() || p.velocity) && (m = !1), d.animation && (m = !1), m)
|
|
2897
2897
|
continue;
|
|
2898
|
-
d.start(yn(h, d, f, t.shouldReduceMotion &&
|
|
2898
|
+
d.start(yn(h, d, f, t.shouldReduceMotion && yt.has(h) ? { type: !1 } : p));
|
|
2899
2899
|
const v = d.animation;
|
|
2900
2900
|
ve(l) && (l.add(h), v.then(() => l.remove(h))), c.push(v);
|
|
2901
2901
|
}
|
|
@@ -2966,34 +2966,34 @@ function sc(t) {
|
|
|
2966
2966
|
const u = t.getProps(), h = t.getVariantContext(!0) || {}, d = [], f = /* @__PURE__ */ new Set();
|
|
2967
2967
|
let p = {}, m = 1 / 0;
|
|
2968
2968
|
for (let y = 0; y < nc; y++) {
|
|
2969
|
-
const b = ec[y], g = n[b], x = u[b] !== void 0 ? u[b] : h[b],
|
|
2970
|
-
|
|
2971
|
-
let k = x === h[b] && x !== u[b] &&
|
|
2969
|
+
const b = ec[y], g = n[b], x = u[b] !== void 0 ? u[b] : h[b], S = Ht(x), T = b === c ? g.isActive : null;
|
|
2970
|
+
T === !1 && (m = y);
|
|
2971
|
+
let k = x === h[b] && x !== u[b] && S;
|
|
2972
2972
|
if (k && i && t.manuallyAnimateOnMount && (k = !1), g.protectedKeys = { ...p }, // If it isn't active and hasn't *just* been set as inactive
|
|
2973
|
-
!g.isActive &&
|
|
2973
|
+
!g.isActive && T === null || // If we didn't and don't have any defined prop for this animation type
|
|
2974
2974
|
!x && !g.prevProp || // Or if the prop doesn't define an animation
|
|
2975
2975
|
Se(x) || typeof x == "boolean")
|
|
2976
2976
|
continue;
|
|
2977
2977
|
let C = rc(g.prevProp, x) || // If we're making this variant active, we want to always make it active
|
|
2978
|
-
b === c && g.isActive && !k &&
|
|
2979
|
-
y > m &&
|
|
2980
|
-
const
|
|
2981
|
-
let
|
|
2982
|
-
|
|
2983
|
-
const { prevResolvedValues:
|
|
2984
|
-
...
|
|
2985
|
-
...
|
|
2978
|
+
b === c && g.isActive && !k && S || // If we removed a higher-priority variant (i is in reverse order)
|
|
2979
|
+
y > m && S, $ = !1;
|
|
2980
|
+
const xt = Array.isArray(x) ? x : [x];
|
|
2981
|
+
let Y = xt.reduce(s, {});
|
|
2982
|
+
T === !1 && (Y = {});
|
|
2983
|
+
const { prevResolvedValues: Q = {} } = g, j = {
|
|
2984
|
+
...Q,
|
|
2985
|
+
...Y
|
|
2986
2986
|
}, wt = (R) => {
|
|
2987
|
-
C = !0, f.has(R) && (
|
|
2987
|
+
C = !0, f.has(R) && ($ = !0, f.delete(R)), g.needsAnimating[R] = !0;
|
|
2988
2988
|
};
|
|
2989
2989
|
for (const R in j) {
|
|
2990
|
-
const
|
|
2990
|
+
const nt = Y[R], Lt = Q[R];
|
|
2991
2991
|
if (p.hasOwnProperty(R))
|
|
2992
2992
|
continue;
|
|
2993
2993
|
let St = !1;
|
|
2994
|
-
fe(
|
|
2994
|
+
fe(nt) && fe(Lt) ? St = !Ps(nt, Lt) : St = nt !== Lt, St ? nt !== void 0 ? wt(R) : f.add(R) : nt !== void 0 && f.has(R) ? wt(R) : g.protectedKeys[R] = !0;
|
|
2995
2995
|
}
|
|
2996
|
-
g.prevProp = x, g.prevResolvedValues =
|
|
2996
|
+
g.prevProp = x, g.prevResolvedValues = Y, g.isActive && (p = { ...p, ...Y }), i && t.blockInitialAnimation && (C = !1), C && (!k || $) && d.push(...xt.map((R) => ({
|
|
2997
2997
|
animation: R,
|
|
2998
2998
|
options: { type: b, ...l }
|
|
2999
2999
|
})));
|
|
@@ -3031,7 +3031,7 @@ function sc(t) {
|
|
|
3031
3031
|
function rc(t, e) {
|
|
3032
3032
|
return typeof e == "string" ? e !== t : Array.isArray(e) ? !Ps(e, t) : !1;
|
|
3033
3033
|
}
|
|
3034
|
-
function
|
|
3034
|
+
function pt(t = !1) {
|
|
3035
3035
|
return {
|
|
3036
3036
|
isActive: t,
|
|
3037
3037
|
protectedKeys: {},
|
|
@@ -3041,16 +3041,16 @@ function mt(t = !1) {
|
|
|
3041
3041
|
}
|
|
3042
3042
|
function oc() {
|
|
3043
3043
|
return {
|
|
3044
|
-
animate:
|
|
3045
|
-
whileInView:
|
|
3046
|
-
whileHover:
|
|
3047
|
-
whileTap:
|
|
3048
|
-
whileDrag:
|
|
3049
|
-
whileFocus:
|
|
3050
|
-
exit:
|
|
3044
|
+
animate: pt(!0),
|
|
3045
|
+
whileInView: pt(),
|
|
3046
|
+
whileHover: pt(),
|
|
3047
|
+
whileTap: pt(),
|
|
3048
|
+
whileDrag: pt(),
|
|
3049
|
+
whileFocus: pt(),
|
|
3050
|
+
exit: pt()
|
|
3051
3051
|
};
|
|
3052
3052
|
}
|
|
3053
|
-
class ac extends
|
|
3053
|
+
class ac extends dt {
|
|
3054
3054
|
/**
|
|
3055
3055
|
* We dynamically generate the AnimationState manager as it contains a reference
|
|
3056
3056
|
* to the underlying animation library. We only want to load that if we load this,
|
|
@@ -3077,7 +3077,7 @@ class ac extends ft {
|
|
|
3077
3077
|
}
|
|
3078
3078
|
}
|
|
3079
3079
|
let lc = 0;
|
|
3080
|
-
class cc extends
|
|
3080
|
+
class cc extends dt {
|
|
3081
3081
|
constructor() {
|
|
3082
3082
|
super(...arguments), this.id = lc++;
|
|
3083
3083
|
}
|
|
@@ -3136,13 +3136,13 @@ class ir {
|
|
|
3136
3136
|
const r = Pe(e), a = Ie(r, this.transformPagePoint), { point: l } = a, { timestamp: c } = N;
|
|
3137
3137
|
this.history = [{ ...l, timestamp: c }];
|
|
3138
3138
|
const { onSessionStart: u } = n;
|
|
3139
|
-
u && u(e, Fe(a, this.history)), this.removeListeners =
|
|
3139
|
+
u && u(e, Fe(a, this.history)), this.removeListeners = lt(J(this.contextWindow, "pointermove", this.handlePointerMove), J(this.contextWindow, "pointerup", this.handlePointerUp), J(this.contextWindow, "pointercancel", this.handlePointerUp));
|
|
3140
3140
|
}
|
|
3141
3141
|
updateHandlers(e) {
|
|
3142
3142
|
this.handlers = e;
|
|
3143
3143
|
}
|
|
3144
3144
|
end() {
|
|
3145
|
-
this.removeListeners && this.removeListeners(),
|
|
3145
|
+
this.removeListeners && this.removeListeners(), et(this.updatePoint);
|
|
3146
3146
|
}
|
|
3147
3147
|
}
|
|
3148
3148
|
function Ie(t, e) {
|
|
@@ -3170,11 +3170,11 @@ function fc(t, e) {
|
|
|
3170
3170
|
return { x: 0, y: 0 };
|
|
3171
3171
|
let n = t.length - 1, i = null;
|
|
3172
3172
|
const s = sr(t);
|
|
3173
|
-
for (; n >= 0 && (i = t[n], !(s.timestamp - i.timestamp >
|
|
3173
|
+
for (; n >= 0 && (i = t[n], !(s.timestamp - i.timestamp > ct(e))); )
|
|
3174
3174
|
n--;
|
|
3175
3175
|
if (!i)
|
|
3176
3176
|
return { x: 0, y: 0 };
|
|
3177
|
-
const o =
|
|
3177
|
+
const o = tt(s.timestamp - i.timestamp);
|
|
3178
3178
|
if (o === 0)
|
|
3179
3179
|
return { x: 0, y: 0 };
|
|
3180
3180
|
const r = {
|
|
@@ -3235,7 +3235,7 @@ function vc(t, e) {
|
|
|
3235
3235
|
function yc(t, e) {
|
|
3236
3236
|
let n = 0.5;
|
|
3237
3237
|
const i = U(t), s = U(e);
|
|
3238
|
-
return s > i ? n = Yt(e.min, e.max - i, t.min) : i > s && (n = Yt(t.min, t.max - s, e.min)),
|
|
3238
|
+
return s > i ? n = Yt(e.min, e.max - i, t.min) : i > s && (n = Yt(t.min, t.max - s, e.min)), ut(0, 1, n);
|
|
3239
3239
|
}
|
|
3240
3240
|
function bc(t, e) {
|
|
3241
3241
|
const n = {};
|
|
@@ -3269,7 +3269,7 @@ const ai = () => ({
|
|
|
3269
3269
|
x: li(),
|
|
3270
3270
|
y: li()
|
|
3271
3271
|
});
|
|
3272
|
-
function
|
|
3272
|
+
function G(t) {
|
|
3273
3273
|
return [t("x"), t("y")];
|
|
3274
3274
|
}
|
|
3275
3275
|
function rr({ top: t, left: e, right: n, bottom: i }) {
|
|
@@ -3298,7 +3298,7 @@ function ze(t) {
|
|
|
3298
3298
|
function Qe({ scale: t, scaleX: e, scaleY: n }) {
|
|
3299
3299
|
return !ze(t) || !ze(e) || !ze(n);
|
|
3300
3300
|
}
|
|
3301
|
-
function
|
|
3301
|
+
function mt(t) {
|
|
3302
3302
|
return Qe(t) || or(t) || t.z || t.rotate || t.rotateX || t.rotateY;
|
|
3303
3303
|
}
|
|
3304
3304
|
function or(t) {
|
|
@@ -3332,14 +3332,14 @@ function Tc(t, e, n, i = !1) {
|
|
|
3332
3332
|
l && l.style && l.style.display === "contents" || (i && o.options.layoutScroll && o.scroll && o !== o.root && Vt(t, {
|
|
3333
3333
|
x: -o.scroll.offset.x,
|
|
3334
3334
|
y: -o.scroll.offset.y
|
|
3335
|
-
}), r && (e.x *= r.x.scale, e.y *= r.y.scale, ar(t, r)), i &&
|
|
3335
|
+
}), r && (e.x *= r.x.scale, e.y *= r.y.scale, ar(t, r)), i && mt(o.latestValues) && Vt(t, o.latestValues));
|
|
3336
3336
|
}
|
|
3337
3337
|
e.x = hi(e.x), e.y = hi(e.y);
|
|
3338
3338
|
}
|
|
3339
3339
|
function hi(t) {
|
|
3340
3340
|
return Number.isInteger(t) || t > 1.0000000000001 || t < 0.999999999999 ? t : 1;
|
|
3341
3341
|
}
|
|
3342
|
-
function
|
|
3342
|
+
function at(t, e) {
|
|
3343
3343
|
t.min = t.min + e, t.max = t.max + e;
|
|
3344
3344
|
}
|
|
3345
3345
|
function di(t, e, [n, i, s]) {
|
|
@@ -3355,7 +3355,7 @@ function lr(t, e) {
|
|
|
3355
3355
|
}
|
|
3356
3356
|
function kc(t, e, n) {
|
|
3357
3357
|
const i = lr(t, n), { scroll: s } = e;
|
|
3358
|
-
return s && (
|
|
3358
|
+
return s && (at(i.x, s.offset.x), at(i.y, s.offset.y)), i;
|
|
3359
3359
|
}
|
|
3360
3360
|
const cr = ({ current: t }) => t ? t.ownerDocument.defaultView : null, Cc = /* @__PURE__ */ new WeakMap();
|
|
3361
3361
|
class Vc {
|
|
@@ -3373,9 +3373,9 @@ class Vc {
|
|
|
3373
3373
|
const { drag: d, dragPropagation: f, onDragStart: p } = this.getProps();
|
|
3374
3374
|
if (d && !f && (this.openGlobalLock && this.openGlobalLock(), this.openGlobalLock = Ss(d), !this.openGlobalLock))
|
|
3375
3375
|
return;
|
|
3376
|
-
this.isDragging = !0, this.currentDirection = null, this.resolveConstraints(), this.visualElement.projection && (this.visualElement.projection.isAnimationBlocked = !0, this.visualElement.projection.target = void 0),
|
|
3376
|
+
this.isDragging = !0, this.currentDirection = null, this.resolveConstraints(), this.visualElement.projection && (this.visualElement.projection.isAnimationBlocked = !0, this.visualElement.projection.target = void 0), G((v) => {
|
|
3377
3377
|
let y = this.getAxisMotionValue(v).get() || 0;
|
|
3378
|
-
if (
|
|
3378
|
+
if (K.test(y)) {
|
|
3379
3379
|
const { projection: b } = this.visualElement;
|
|
3380
3380
|
if (b && b.layout) {
|
|
3381
3381
|
const g = b.layout.layoutBox[v];
|
|
@@ -3396,7 +3396,7 @@ class Vc {
|
|
|
3396
3396
|
return;
|
|
3397
3397
|
}
|
|
3398
3398
|
this.updateAxis("x", h.point, v), this.updateAxis("y", h.point, v), this.visualElement.render(), m && m(u, h);
|
|
3399
|
-
}, a = (u, h) => this.stop(u, h), l = () =>
|
|
3399
|
+
}, a = (u, h) => this.stop(u, h), l = () => G((u) => {
|
|
3400
3400
|
var h;
|
|
3401
3401
|
return this.getAnimationState(u) === "paused" && ((h = this.getAxisMotionValue(u).animation) === null || h === void 0 ? void 0 : h.play());
|
|
3402
3402
|
}), { dragSnapToOrigin: c } = this.getProps();
|
|
@@ -3439,7 +3439,7 @@ class Vc {
|
|
|
3439
3439
|
resolveConstraints() {
|
|
3440
3440
|
var e;
|
|
3441
3441
|
const { dragConstraints: n, dragElastic: i } = this.getProps(), s = this.visualElement.projection && !this.visualElement.projection.layout ? this.visualElement.projection.measure(!1) : (e = this.visualElement.projection) === null || e === void 0 ? void 0 : e.layout, o = this.constraints;
|
|
3442
|
-
n && Pt(n) ? this.constraints || (this.constraints = this.resolveRefConstraints()) : n && s ? this.constraints = gc(s.layoutBox, n) : this.constraints = !1, this.elastic = xc(i), o !== this.constraints && s && this.constraints && !this.hasMutatedConstraints &&
|
|
3442
|
+
n && Pt(n) ? this.constraints || (this.constraints = this.resolveRefConstraints()) : n && s ? this.constraints = gc(s.layoutBox, n) : this.constraints = !1, this.elastic = xc(i), o !== this.constraints && s && this.constraints && !this.hasMutatedConstraints && G((r) => {
|
|
3443
3443
|
this.getAxisMotionValue(r) && (this.constraints[r] = bc(s.layoutBox[r], this.constraints[r]));
|
|
3444
3444
|
});
|
|
3445
3445
|
}
|
|
@@ -3448,7 +3448,7 @@ class Vc {
|
|
|
3448
3448
|
if (!e || !Pt(e))
|
|
3449
3449
|
return !1;
|
|
3450
3450
|
const i = e.current;
|
|
3451
|
-
|
|
3451
|
+
q(i !== null, "If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");
|
|
3452
3452
|
const { projection: s } = this.visualElement;
|
|
3453
3453
|
if (!s || !s.layout)
|
|
3454
3454
|
return !1;
|
|
@@ -3461,7 +3461,7 @@ class Vc {
|
|
|
3461
3461
|
return r;
|
|
3462
3462
|
}
|
|
3463
3463
|
startAnimation(e) {
|
|
3464
|
-
const { drag: n, dragMomentum: i, dragElastic: s, dragTransition: o, dragSnapToOrigin: r, onDragTransitionEnd: a } = this.getProps(), l = this.constraints || {}, c =
|
|
3464
|
+
const { drag: n, dragMomentum: i, dragElastic: s, dragTransition: o, dragSnapToOrigin: r, onDragTransitionEnd: a } = this.getProps(), l = this.constraints || {}, c = G((u) => {
|
|
3465
3465
|
if (!se(u, n, this.currentDirection))
|
|
3466
3466
|
return;
|
|
3467
3467
|
let h = l && l[u] || {};
|
|
@@ -3486,10 +3486,10 @@ class Vc {
|
|
|
3486
3486
|
return i.start(yn(e, i, 0, n));
|
|
3487
3487
|
}
|
|
3488
3488
|
stopAnimation() {
|
|
3489
|
-
|
|
3489
|
+
G((e) => this.getAxisMotionValue(e).stop());
|
|
3490
3490
|
}
|
|
3491
3491
|
pauseAnimation() {
|
|
3492
|
-
|
|
3492
|
+
G((e) => {
|
|
3493
3493
|
var n;
|
|
3494
3494
|
return (n = this.getAxisMotionValue(e).animation) === null || n === void 0 ? void 0 : n.pause();
|
|
3495
3495
|
});
|
|
@@ -3509,7 +3509,7 @@ class Vc {
|
|
|
3509
3509
|
return s || this.visualElement.getValue(e, (i.initial ? i.initial[e] : void 0) || 0);
|
|
3510
3510
|
}
|
|
3511
3511
|
snapToCursor(e) {
|
|
3512
|
-
|
|
3512
|
+
G((n) => {
|
|
3513
3513
|
const { drag: i } = this.getProps();
|
|
3514
3514
|
if (!se(n, i, this.currentDirection))
|
|
3515
3515
|
return;
|
|
@@ -3533,7 +3533,7 @@ class Vc {
|
|
|
3533
3533
|
return;
|
|
3534
3534
|
this.stopAnimation();
|
|
3535
3535
|
const s = { x: 0, y: 0 };
|
|
3536
|
-
|
|
3536
|
+
G((r) => {
|
|
3537
3537
|
const a = this.getAxisMotionValue(r);
|
|
3538
3538
|
if (a) {
|
|
3539
3539
|
const l = a.get();
|
|
@@ -3541,7 +3541,7 @@ class Vc {
|
|
|
3541
3541
|
}
|
|
3542
3542
|
});
|
|
3543
3543
|
const { transformTemplate: o } = this.visualElement.getProps();
|
|
3544
|
-
this.visualElement.current.style.transform = o ? o({}, "") : "none", i.root && i.root.updateScroll(), i.updateLayout(), this.resolveConstraints(),
|
|
3544
|
+
this.visualElement.current.style.transform = o ? o({}, "") : "none", i.root && i.root.updateScroll(), i.updateLayout(), this.resolveConstraints(), G((r) => {
|
|
3545
3545
|
if (!se(r, e, null))
|
|
3546
3546
|
return;
|
|
3547
3547
|
const a = this.getAxisMotionValue(r), { min: l, max: c } = this.constraints[r];
|
|
@@ -3552,7 +3552,7 @@ class Vc {
|
|
|
3552
3552
|
if (!this.visualElement.current)
|
|
3553
3553
|
return;
|
|
3554
3554
|
Cc.set(this.visualElement, this);
|
|
3555
|
-
const e = this.visualElement.current, n =
|
|
3555
|
+
const e = this.visualElement.current, n = J(e, "pointerdown", (l) => {
|
|
3556
3556
|
const { drag: c, dragListener: u = !0 } = this.getProps();
|
|
3557
3557
|
c && u && this.start(l);
|
|
3558
3558
|
}), i = () => {
|
|
@@ -3560,8 +3560,8 @@ class Vc {
|
|
|
3560
3560
|
Pt(l) && (this.constraints = this.resolveRefConstraints());
|
|
3561
3561
|
}, { projection: s } = this.visualElement, o = s.addEventListener("measure", i);
|
|
3562
3562
|
s && !s.layout && (s.root && s.root.updateScroll(), s.updateLayout()), i();
|
|
3563
|
-
const r =
|
|
3564
|
-
this.isDragging && c && (
|
|
3563
|
+
const r = Z(window, "resize", () => this.scalePositionWithinConstraints()), a = s.addEventListener("didUpdate", ({ delta: l, hasLayoutChanged: c }) => {
|
|
3564
|
+
this.isDragging && c && (G((u) => {
|
|
3565
3565
|
const h = this.getAxisMotionValue(u);
|
|
3566
3566
|
h && (this.originPoint[u] += l[u].translate, h.set(h.get() + l[u].translate));
|
|
3567
3567
|
}), this.visualElement.render());
|
|
@@ -3590,7 +3590,7 @@ function Ec(t, e = 10) {
|
|
|
3590
3590
|
let n = null;
|
|
3591
3591
|
return Math.abs(t.y) > e ? n = "y" : Math.abs(t.x) > e && (n = "x"), n;
|
|
3592
3592
|
}
|
|
3593
|
-
class Mc extends
|
|
3593
|
+
class Mc extends dt {
|
|
3594
3594
|
constructor(e) {
|
|
3595
3595
|
super(e), this.removeGroupControls = O, this.removeListeners = O, this.controls = new Vc(e);
|
|
3596
3596
|
}
|
|
@@ -3605,7 +3605,7 @@ class Mc extends ft {
|
|
|
3605
3605
|
const fi = (t) => (e, n) => {
|
|
3606
3606
|
t && V.update(() => t(e, n));
|
|
3607
3607
|
};
|
|
3608
|
-
class Oc extends
|
|
3608
|
+
class Oc extends dt {
|
|
3609
3609
|
constructor() {
|
|
3610
3610
|
super(...arguments), this.removePointerDownListener = O;
|
|
3611
3611
|
}
|
|
@@ -3627,7 +3627,7 @@ class Oc extends ft {
|
|
|
3627
3627
|
};
|
|
3628
3628
|
}
|
|
3629
3629
|
mount() {
|
|
3630
|
-
this.removePointerDownListener =
|
|
3630
|
+
this.removePointerDownListener = J(this.node.current, "pointerdown", (e) => this.onPointerDown(e));
|
|
3631
3631
|
}
|
|
3632
3632
|
update() {
|
|
3633
3633
|
this.session && this.session.updateHandlers(this.createPanHandlers());
|
|
@@ -3672,10 +3672,10 @@ const It = {
|
|
|
3672
3672
|
}
|
|
3673
3673
|
}, Lc = {
|
|
3674
3674
|
correct: (t, { treeScale: e, projectionDelta: n }) => {
|
|
3675
|
-
const i = t, s =
|
|
3675
|
+
const i = t, s = ht.parse(t);
|
|
3676
3676
|
if (s.length > 5)
|
|
3677
3677
|
return i;
|
|
3678
|
-
const o =
|
|
3678
|
+
const o = ht.createTransformer(t), r = typeof s[0] != "number" ? 1 : 0, a = n.x.scale * e.x, l = n.y.scale * e.y;
|
|
3679
3679
|
s[0 + r] /= a, s[1 + r] /= l;
|
|
3680
3680
|
const c = M(a, l, 0.5);
|
|
3681
3681
|
return typeof s[2 + r] == "number" && (s[2 + r] /= c), typeof s[3 + r] == "number" && (s[3 + r] /= c), o(s);
|
|
@@ -3753,7 +3753,7 @@ function jc(t, e, n, i, s, o) {
|
|
|
3753
3753
|
let l = vi(e, a), c = vi(n, a);
|
|
3754
3754
|
if (l === void 0 && c === void 0)
|
|
3755
3755
|
continue;
|
|
3756
|
-
l || (l = 0), c || (c = 0), l === 0 || c === 0 || gi(l) === gi(c) ? (t[a] = Math.max(M(mi(l), mi(c), i), 0), (
|
|
3756
|
+
l || (l = 0), c || (c = 0), l === 0 || c === 0 || gi(l) === gi(c) ? (t[a] = Math.max(M(mi(l), mi(c), i), 0), (K.test(c) || K.test(l)) && (t[a] += "%")) : t[a] = c;
|
|
3757
3757
|
}
|
|
3758
3758
|
(e.rotate || n.rotate) && (t.rotate = M(e.rotate || 0, n.rotate || 0, i));
|
|
3759
3759
|
}
|
|
@@ -3767,14 +3767,14 @@ function dr(t, e, n) {
|
|
|
3767
3767
|
function yi(t, e) {
|
|
3768
3768
|
t.min = e.min, t.max = e.max;
|
|
3769
3769
|
}
|
|
3770
|
-
function
|
|
3770
|
+
function H(t, e) {
|
|
3771
3771
|
yi(t.x, e.x), yi(t.y, e.y);
|
|
3772
3772
|
}
|
|
3773
3773
|
function bi(t, e, n, i, s) {
|
|
3774
3774
|
return t -= e, t = ye(t, 1 / n, i), s !== void 0 && (t = ye(t, 1 / s, i)), t;
|
|
3775
3775
|
}
|
|
3776
3776
|
function zc(t, e = 0, n = 1, i = 0.5, s, o = t, r = t) {
|
|
3777
|
-
if (
|
|
3777
|
+
if (K.test(e) && (e = parseFloat(e), e = M(r.min, r.max, e / 100) - r.min), typeof e != "number")
|
|
3778
3778
|
return;
|
|
3779
3779
|
let a = M(o.min, o.max, i);
|
|
3780
3780
|
t === o && (a -= e), t.min = bi(t.min, e, n, a, s), t.max = bi(t.max, e, n, a, s);
|
|
@@ -3883,9 +3883,9 @@ class Yc {
|
|
|
3883
3883
|
function Xc(t, e) {
|
|
3884
3884
|
const n = performance.now(), i = ({ timestamp: s }) => {
|
|
3885
3885
|
const o = s - n;
|
|
3886
|
-
o >= e && (
|
|
3886
|
+
o >= e && (et(i), t(o - e));
|
|
3887
3887
|
};
|
|
3888
|
-
return V.read(i, !0), () =>
|
|
3888
|
+
return V.read(i, !0), () => et(i);
|
|
3889
3889
|
}
|
|
3890
3890
|
function qc(t) {
|
|
3891
3891
|
window.MotionDebug && window.MotionDebug.record(t);
|
|
@@ -3899,7 +3899,7 @@ function $c(t, e, n) {
|
|
|
3899
3899
|
}
|
|
3900
3900
|
const Pi = ["", "X", "Y", "Z"], Qc = { visibility: "hidden" }, ki = 1e3;
|
|
3901
3901
|
let Zc = 0;
|
|
3902
|
-
const
|
|
3902
|
+
const gt = {
|
|
3903
3903
|
type: "projectionFrame",
|
|
3904
3904
|
totalNodes: 0,
|
|
3905
3905
|
resolvedTargetDeltas: 0,
|
|
@@ -3911,7 +3911,7 @@ function mr({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
|
|
|
3911
3911
|
this.id = Zc++, this.animationId = 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.treeScale = { x: 1, y: 1 }, this.eventHandlers = /* @__PURE__ */ new Map(), this.hasTreeAnimated = !1, this.updateScheduled = !1, this.projectionUpdateScheduled = !1, this.checkUpdateFailed = () => {
|
|
3912
3912
|
this.isUpdating && (this.isUpdating = !1, this.clearAllSnapshots());
|
|
3913
3913
|
}, this.updateProjection = () => {
|
|
3914
|
-
this.projectionUpdateScheduled = !1,
|
|
3914
|
+
this.projectionUpdateScheduled = !1, gt.totalNodes = gt.resolvedTargetDeltas = gt.recalculatedProjection = 0, this.nodes.forEach(eu), this.nodes.forEach(ou), this.nodes.forEach(au), this.nodes.forEach(nu), qc(gt);
|
|
3915
3915
|
}, 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;
|
|
3916
3916
|
for (let l = 0; l < this.path.length; l++)
|
|
3917
3917
|
this.path[l].shouldResetTransform = !0;
|
|
@@ -3964,7 +3964,7 @@ function mr({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
|
|
|
3964
3964
|
unmount() {
|
|
3965
3965
|
this.options.layoutId && this.willUpdate(), this.root.nodes.remove(this);
|
|
3966
3966
|
const r = this.getStack();
|
|
3967
|
-
r && r.remove(this), this.parent && this.parent.children.delete(this), this.instance = void 0,
|
|
3967
|
+
r && r.remove(this), this.parent && this.parent.children.delete(this), this.instance = void 0, et(this.updateProjection);
|
|
3968
3968
|
}
|
|
3969
3969
|
// only on the root
|
|
3970
3970
|
blockUpdate() {
|
|
@@ -4012,7 +4012,7 @@ function mr({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
|
|
|
4012
4012
|
}
|
|
4013
4013
|
this.isUpdating || this.nodes.forEach(su), this.isUpdating = !1, this.nodes.forEach(ru), this.nodes.forEach(Jc), this.nodes.forEach(tu), this.clearAllSnapshots();
|
|
4014
4014
|
const a = performance.now();
|
|
4015
|
-
N.delta =
|
|
4015
|
+
N.delta = ut(0, 1e3 / 60, a - N.timestamp), N.timestamp = a, N.isProcessing = !0, Me.update.process(N), Me.preRender.process(N), Me.render.process(N), N.isProcessing = !1;
|
|
4016
4016
|
}
|
|
4017
4017
|
didUpdate() {
|
|
4018
4018
|
this.updateScheduled || (this.updateScheduled = !0, queueMicrotask(() => this.update()));
|
|
@@ -4058,7 +4058,7 @@ function mr({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
|
|
|
4058
4058
|
if (!s)
|
|
4059
4059
|
return;
|
|
4060
4060
|
const r = this.isLayoutDirty || this.shouldResetTransform, a = this.projectionDelta && !fr(this.projectionDelta), l = this.getTransformTemplate(), c = l ? l(this.latestValues, "") : void 0, u = c !== this.prevTransformTemplateValue;
|
|
4061
|
-
r && (a ||
|
|
4061
|
+
r && (a || mt(this.latestValues) || u) && (s(this.instance, c), this.shouldResetTransform = !1, this.scheduleRender());
|
|
4062
4062
|
}
|
|
4063
4063
|
measure(r = !0) {
|
|
4064
4064
|
const a = this.measurePageBox();
|
|
@@ -4076,48 +4076,48 @@ function mr({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
|
|
|
4076
4076
|
if (!r)
|
|
4077
4077
|
return L();
|
|
4078
4078
|
const a = r.measureViewportBox(), { scroll: l } = this.root;
|
|
4079
|
-
return l && (
|
|
4079
|
+
return l && (at(a.x, l.offset.x), at(a.y, l.offset.y)), a;
|
|
4080
4080
|
}
|
|
4081
4081
|
removeElementScroll(r) {
|
|
4082
4082
|
const a = L();
|
|
4083
|
-
|
|
4083
|
+
H(a, r);
|
|
4084
4084
|
for (let l = 0; l < this.path.length; l++) {
|
|
4085
4085
|
const c = this.path[l], { scroll: u, options: h } = c;
|
|
4086
4086
|
if (c !== this.root && u && h.layoutScroll) {
|
|
4087
4087
|
if (u.isRoot) {
|
|
4088
|
-
|
|
4088
|
+
H(a, r);
|
|
4089
4089
|
const { scroll: d } = this.root;
|
|
4090
|
-
d && (
|
|
4090
|
+
d && (at(a.x, -d.offset.x), at(a.y, -d.offset.y));
|
|
4091
4091
|
}
|
|
4092
|
-
|
|
4092
|
+
at(a.x, u.offset.x), at(a.y, u.offset.y);
|
|
4093
4093
|
}
|
|
4094
4094
|
}
|
|
4095
4095
|
return a;
|
|
4096
4096
|
}
|
|
4097
4097
|
applyTransform(r, a = !1) {
|
|
4098
4098
|
const l = L();
|
|
4099
|
-
|
|
4099
|
+
H(l, r);
|
|
4100
4100
|
for (let c = 0; c < this.path.length; c++) {
|
|
4101
4101
|
const u = this.path[c];
|
|
4102
4102
|
!a && u.options.layoutScroll && u.scroll && u !== u.root && Vt(l, {
|
|
4103
4103
|
x: -u.scroll.offset.x,
|
|
4104
4104
|
y: -u.scroll.offset.y
|
|
4105
|
-
}),
|
|
4105
|
+
}), mt(u.latestValues) && Vt(l, u.latestValues);
|
|
4106
4106
|
}
|
|
4107
|
-
return
|
|
4107
|
+
return mt(this.latestValues) && Vt(l, this.latestValues), l;
|
|
4108
4108
|
}
|
|
4109
4109
|
removeTransform(r) {
|
|
4110
4110
|
const a = L();
|
|
4111
|
-
|
|
4111
|
+
H(a, r);
|
|
4112
4112
|
for (let l = 0; l < this.path.length; l++) {
|
|
4113
4113
|
const c = this.path[l];
|
|
4114
|
-
if (!c.instance || !
|
|
4114
|
+
if (!c.instance || !mt(c.latestValues))
|
|
4115
4115
|
continue;
|
|
4116
4116
|
Qe(c.latestValues) && c.updateSnapshot();
|
|
4117
4117
|
const u = L(), h = c.measurePageBox();
|
|
4118
|
-
|
|
4118
|
+
H(u, h), wi(a, c.latestValues, c.snapshot ? c.snapshot.layoutBox : void 0, u);
|
|
4119
4119
|
}
|
|
4120
|
-
return
|
|
4120
|
+
return mt(this.latestValues) && wi(a, this.latestValues), a;
|
|
4121
4121
|
}
|
|
4122
4122
|
setTargetDelta(r) {
|
|
4123
4123
|
this.targetDelta = r, this.root.scheduleUpdateProjection(), this.isProjectionDirty = !0;
|
|
@@ -4146,15 +4146,15 @@ function mr({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
|
|
|
4146
4146
|
if (!(!this.layout || !(h || d))) {
|
|
4147
4147
|
if (this.resolvedRelativeTargetAt = N.timestamp, !this.targetDelta && !this.relativeTarget) {
|
|
4148
4148
|
const f = this.getClosestProjectingParent();
|
|
4149
|
-
f && f.layout && this.animationProgress !== 1 ? (this.relativeParent = f, this.forceRelativeParentToResolveTarget(), this.relativeTarget = L(), this.relativeTargetOrigin = L(), Ut(this.relativeTargetOrigin, this.layout.layoutBox, f.layout.layoutBox),
|
|
4149
|
+
f && f.layout && this.animationProgress !== 1 ? (this.relativeParent = f, this.forceRelativeParentToResolveTarget(), this.relativeTarget = L(), this.relativeTargetOrigin = L(), Ut(this.relativeTargetOrigin, this.layout.layoutBox, f.layout.layoutBox), H(this.relativeTarget, this.relativeTargetOrigin)) : this.relativeParent = this.relativeTarget = void 0;
|
|
4150
4150
|
}
|
|
4151
4151
|
if (!(!this.relativeTarget && !this.targetDelta)) {
|
|
4152
|
-
if (this.target || (this.target = L(), this.targetWithTransforms = L()), this.relativeTarget && this.relativeTargetOrigin && this.relativeParent && this.relativeParent.target ? (this.forceRelativeParentToResolveTarget(), pc(this.target, this.relativeTarget, this.relativeParent.target)) : this.targetDelta ? (this.resumingFrom ? this.target = this.applyTransform(this.layout.layoutBox) :
|
|
4152
|
+
if (this.target || (this.target = L(), this.targetWithTransforms = L()), this.relativeTarget && this.relativeTargetOrigin && this.relativeParent && this.relativeParent.target ? (this.forceRelativeParentToResolveTarget(), pc(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) {
|
|
4153
4153
|
this.attemptToResolveRelativeTarget = !1;
|
|
4154
4154
|
const f = this.getClosestProjectingParent();
|
|
4155
|
-
f && !!f.resumingFrom == !!this.resumingFrom && !f.options.layoutScroll && f.target && this.animationProgress !== 1 ? (this.relativeParent = f, this.forceRelativeParentToResolveTarget(), this.relativeTarget = L(), this.relativeTargetOrigin = L(), Ut(this.relativeTargetOrigin, this.target, f.target),
|
|
4155
|
+
f && !!f.resumingFrom == !!this.resumingFrom && !f.options.layoutScroll && f.target && this.animationProgress !== 1 ? (this.relativeParent = f, this.forceRelativeParentToResolveTarget(), this.relativeTarget = L(), this.relativeTargetOrigin = L(), Ut(this.relativeTargetOrigin, this.target, f.target), H(this.relativeTarget, this.relativeTargetOrigin)) : this.relativeParent = this.relativeTarget = void 0;
|
|
4156
4156
|
}
|
|
4157
|
-
|
|
4157
|
+
gt.resolvedTargetDeltas++;
|
|
4158
4158
|
}
|
|
4159
4159
|
}
|
|
4160
4160
|
}
|
|
@@ -4174,7 +4174,7 @@ function mr({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
|
|
|
4174
4174
|
const { layout: u, layoutId: h } = this.options;
|
|
4175
4175
|
if (this.isTreeAnimating = !!(this.parent && this.parent.isTreeAnimating || this.currentAnimation || this.pendingAnimation), this.isTreeAnimating || (this.targetDelta = this.relativeTarget = void 0), !this.layout || !(u || h))
|
|
4176
4176
|
return;
|
|
4177
|
-
|
|
4177
|
+
H(this.layoutCorrected, this.layout.layoutBox);
|
|
4178
4178
|
const d = this.treeScale.x, f = this.treeScale.y;
|
|
4179
4179
|
Tc(this.layoutCorrected, this.treeScale, this.path, l), a.layout && !a.target && (this.treeScale.x !== 1 || this.treeScale.y !== 1) && (a.target = a.layout.layoutBox);
|
|
4180
4180
|
const { target: p } = a;
|
|
@@ -4184,7 +4184,7 @@ function mr({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
|
|
|
4184
4184
|
}
|
|
4185
4185
|
this.projectionDelta || (this.projectionDelta = Ct(), this.projectionDeltaWithTransform = Ct());
|
|
4186
4186
|
const m = this.projectionTransform;
|
|
4187
|
-
_t(this.projectionDelta, this.layoutCorrected, p, this.latestValues), this.projectionTransform = Ai(this.projectionDelta, this.treeScale), (this.projectionTransform !== m || this.treeScale.x !== d || this.treeScale.y !== f) && (this.hasProjected = !0, this.scheduleRender(), this.notifyListeners("projectionUpdate", p)),
|
|
4187
|
+
_t(this.projectionDelta, this.layoutCorrected, p, this.latestValues), this.projectionTransform = Ai(this.projectionDelta, this.treeScale), (this.projectionTransform !== m || this.treeScale.x !== d || this.treeScale.y !== f) && (this.hasProjected = !0, this.scheduleRender(), this.notifyListeners("projectionUpdate", p)), gt.recalculatedProjection++;
|
|
4188
4188
|
}
|
|
4189
4189
|
hide() {
|
|
4190
4190
|
this.isVisible = !1;
|
|
@@ -4206,12 +4206,12 @@ function mr({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
|
|
|
4206
4206
|
this.animationProgress = 0;
|
|
4207
4207
|
let g;
|
|
4208
4208
|
this.mixTargetDelta = (x) => {
|
|
4209
|
-
const
|
|
4210
|
-
Ei(h.x, r.x,
|
|
4209
|
+
const S = x / 1e3;
|
|
4210
|
+
Ei(h.x, r.x, S), Ei(h.y, r.y, S), this.setTargetDelta(h), this.relativeTarget && this.relativeTargetOrigin && this.layout && this.relativeParent && this.relativeParent.layout && (Ut(d, this.layout.layoutBox, this.relativeParent.layout.layoutBox), uu(this.relativeTarget, this.relativeTargetOrigin, d, S), g && Uc(this.relativeTarget, g) && (this.isProjectionDirty = !1), g || (g = L()), H(g, this.relativeTarget)), m && (this.animationValues = u, jc(u, c, this.latestValues, S, b, y)), this.root.scheduleUpdateProjection(), this.scheduleRender(), this.animationProgress = S;
|
|
4211
4211
|
}, this.mixTargetDelta(this.options.layoutRoot ? 1e3 : 0);
|
|
4212
4212
|
}
|
|
4213
4213
|
startAnimation(r) {
|
|
4214
|
-
this.notifyListeners("animationStart"), this.currentAnimation && this.currentAnimation.stop(), this.resumingFrom && this.resumingFrom.currentAnimation && this.resumingFrom.currentAnimation.stop(), this.pendingAnimation && (
|
|
4214
|
+
this.notifyListeners("animationStart"), this.currentAnimation && this.currentAnimation.stop(), this.resumingFrom && this.resumingFrom.currentAnimation && this.resumingFrom.currentAnimation.stop(), this.pendingAnimation && (et(this.pendingAnimation), this.pendingAnimation = void 0), this.pendingAnimation = V.update(() => {
|
|
4215
4215
|
le.hasAnimatedSinceResize = !0, this.currentAnimation = $c(0, ki, {
|
|
4216
4216
|
...r,
|
|
4217
4217
|
onUpdate: (a) => {
|
|
@@ -4242,7 +4242,7 @@ function mr({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
|
|
|
4242
4242
|
const d = U(this.layout.layoutBox.y);
|
|
4243
4243
|
l.y.min = r.target.y.min, l.y.max = l.y.min + d;
|
|
4244
4244
|
}
|
|
4245
|
-
|
|
4245
|
+
H(a, l), Vt(a, u), _t(this.projectionDeltaWithTransform, this.layoutCorrected, a, u);
|
|
4246
4246
|
}
|
|
4247
4247
|
}
|
|
4248
4248
|
registerSharedNode(r, a) {
|
|
@@ -4312,7 +4312,7 @@ function mr({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
|
|
|
4312
4312
|
const h = this.getLead();
|
|
4313
4313
|
if (!this.projectionDelta || !this.layout || !h.target) {
|
|
4314
4314
|
const m = {};
|
|
4315
|
-
return this.options.layoutId && (m.opacity = this.latestValues.opacity !== void 0 ? this.latestValues.opacity : 1, m.pointerEvents = ae(r == null ? void 0 : r.pointerEvents) || ""), this.hasProjected && !
|
|
4315
|
+
return this.options.layoutId && (m.opacity = this.latestValues.opacity !== void 0 ? this.latestValues.opacity : 1, m.pointerEvents = ae(r == null ? void 0 : r.pointerEvents) || ""), this.hasProjected && !mt(this.latestValues) && (m.transform = u ? u({}, "") : "none", this.hasProjected = !1), m;
|
|
4316
4316
|
}
|
|
4317
4317
|
const d = h.animationValues || h.latestValues;
|
|
4318
4318
|
this.applyTransformsToTarget(), c.transform = Ai(this.projectionDeltaWithTransform, this.treeScale, d), u && (c.transform = u(d, c.transform));
|
|
@@ -4351,10 +4351,10 @@ function tu(t) {
|
|
|
4351
4351
|
const n = ((e = t.resumeFrom) === null || e === void 0 ? void 0 : e.snapshot) || t.snapshot;
|
|
4352
4352
|
if (t.isLead() && t.layout && n && t.hasListeners("didUpdate")) {
|
|
4353
4353
|
const { layoutBox: i, measuredBox: s } = t.layout, { animationType: o } = t.options, r = n.source !== t.layout.source;
|
|
4354
|
-
o === "size" ?
|
|
4354
|
+
o === "size" ? G((h) => {
|
|
4355
4355
|
const d = r ? n.measuredBox[h] : n.layoutBox[h], f = U(d);
|
|
4356
4356
|
d.min = i[h].min, d.max = d.min + f;
|
|
4357
|
-
}) : gr(o, n.layoutBox, i) &&
|
|
4357
|
+
}) : gr(o, n.layoutBox, i) && G((h) => {
|
|
4358
4358
|
const d = r ? n.measuredBox[h] : n.layoutBox[h], f = U(i[h]);
|
|
4359
4359
|
d.max = d.min + f, t.relativeTarget && !t.currentAnimation && (t.isProjectionDirty = !0, t.relativeTarget[h].max = t.relativeTarget[h].min + f);
|
|
4360
4360
|
});
|
|
@@ -4391,7 +4391,7 @@ function tu(t) {
|
|
|
4391
4391
|
t.options.transition = void 0;
|
|
4392
4392
|
}
|
|
4393
4393
|
function eu(t) {
|
|
4394
|
-
|
|
4394
|
+
gt.totalNodes++, t.parent && (t.isProjecting() || (t.isProjectionDirty = t.parent.isProjectionDirty), t.isSharedProjectionDirty || (t.isSharedProjectionDirty = !!(t.isProjectionDirty || t.parent.isProjectionDirty || t.parent.isSharedProjectionDirty)), t.isTransformDirty || (t.isTransformDirty = t.parent.isTransformDirty));
|
|
4395
4395
|
}
|
|
4396
4396
|
function nu(t) {
|
|
4397
4397
|
t.isProjectionDirty = t.isSharedProjectionDirty = t.isTransformDirty = !1;
|
|
@@ -4450,7 +4450,7 @@ function gr(t, e, n) {
|
|
|
4450
4450
|
return t === "position" || t === "preserve-aspect" && !Ke(Ti(e), Ti(n), 0.2);
|
|
4451
4451
|
}
|
|
4452
4452
|
const pu = mr({
|
|
4453
|
-
attachResizeListener: (t, e) =>
|
|
4453
|
+
attachResizeListener: (t, e) => Z(t, "resize", e),
|
|
4454
4454
|
measureScroll: () => ({
|
|
4455
4455
|
x: document.documentElement.scrollLeft || document.body.scrollLeft,
|
|
4456
4456
|
y: document.documentElement.scrollTop || document.body.scrollTop
|
|
@@ -4493,7 +4493,7 @@ function vu(t) {
|
|
|
4493
4493
|
}
|
|
4494
4494
|
const yu = 4;
|
|
4495
4495
|
function Je(t, e, n = 1) {
|
|
4496
|
-
|
|
4496
|
+
q(n <= yu, `Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`);
|
|
4497
4497
|
const [i, s] = vu(t);
|
|
4498
4498
|
if (!i)
|
|
4499
4499
|
return;
|
|
@@ -4535,7 +4535,7 @@ const xu = /* @__PURE__ */ new Set([
|
|
|
4535
4535
|
"y",
|
|
4536
4536
|
"translateX",
|
|
4537
4537
|
"translateY"
|
|
4538
|
-
]), yr = (t) => xu.has(t), wu = (t) => Object.keys(t).some(yr), re = (t) => t ===
|
|
4538
|
+
]), yr = (t) => xu.has(t), wu = (t) => Object.keys(t).some(yr), re = (t) => t === bt || t === A, Ri = (t, e) => parseFloat(t.split(", ")[e]), Bi = (t, e) => (n, { transform: i }) => {
|
|
4539
4539
|
if (i === "none" || !i)
|
|
4540
4540
|
return 0;
|
|
4541
4541
|
const s = i.match(/^matrix3d\((.+)\)$/);
|
|
@@ -4593,7 +4593,7 @@ const Pu = (t, e, n) => {
|
|
|
4593
4593
|
const p = d.length, m = d[0] === null ? 1 : 0;
|
|
4594
4594
|
u = d[m], h = jt(u);
|
|
4595
4595
|
for (let v = m; v < p && d[v] !== null; v++)
|
|
4596
|
-
f ?
|
|
4596
|
+
f ? q(jt(d[v]) === f, "All keyframes must be of the same type") : (f = jt(d[v]), q(f === h || re(h) && re(f), "Keyframes must be of the same dimension as the current value"));
|
|
4597
4597
|
} else
|
|
4598
4598
|
f = jt(d);
|
|
4599
4599
|
if (h !== f)
|
|
@@ -4682,7 +4682,7 @@ class Lu {
|
|
|
4682
4682
|
this.current = e, Ni.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)), br.current || Eu(), this.shouldReduceMotion = this.reducedMotionConfig === "never" ? !1 : this.reducedMotionConfig === "always" ? !0 : tn.current, process.env.NODE_ENV !== "production" && Sn(this.shouldReduceMotion !== !0, "You have Reduced Motion enabled on your device. Animations may not appear as expected."), this.parent && this.parent.children.add(this), this.update(this.props, this.presenceContext);
|
|
4683
4683
|
}
|
|
4684
4684
|
unmount() {
|
|
4685
|
-
Ni.delete(this.current), this.projection && this.projection.unmount(),
|
|
4685
|
+
Ni.delete(this.current), this.projection && this.projection.unmount(), et(this.notifyUpdate), et(this.render), this.valueSubscriptions.forEach((e) => e()), this.removeFromVariantTree && this.removeFromVariantTree(), this.parent && this.parent.children.delete(this);
|
|
4686
4686
|
for (const e in this.events)
|
|
4687
4687
|
this.events[e].clear();
|
|
4688
4688
|
for (const e in this.features)
|
|
@@ -4690,7 +4690,7 @@ class Lu {
|
|
|
4690
4690
|
this.current = null;
|
|
4691
4691
|
}
|
|
4692
4692
|
bindToMotionValue(e, n) {
|
|
4693
|
-
const i =
|
|
4693
|
+
const i = yt.has(e), s = n.on("change", (r) => {
|
|
4694
4694
|
this.latestValues[e] = r, this.props.onUpdate && V.update(this.notifyUpdate, !1, !0), i && this.projection && (this.projection.isTransformDirty = !0);
|
|
4695
4695
|
}), o = n.on("renderRequest", this.scheduleRender);
|
|
4696
4696
|
this.valueSubscriptions.set(e, () => {
|
|
@@ -4704,7 +4704,7 @@ class Lu {
|
|
|
4704
4704
|
let r, a;
|
|
4705
4705
|
if (process.env.NODE_ENV !== "production" && s && i) {
|
|
4706
4706
|
const l = "You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";
|
|
4707
|
-
n.ignoreStrict ? Qt(!1, l) :
|
|
4707
|
+
n.ignoreStrict ? Qt(!1, l) : q(!1, l);
|
|
4708
4708
|
}
|
|
4709
4709
|
for (let l = 0; l < Ou; l++) {
|
|
4710
4710
|
const c = xr[l], { isEnabled: u, Feature: h, ProjectionNode: d, MeasureLayout: f } = Gt[c];
|
|
@@ -4917,7 +4917,7 @@ class Bu extends wr {
|
|
|
4917
4917
|
super(...arguments), this.type = "html";
|
|
4918
4918
|
}
|
|
4919
4919
|
readValueFromInstance(e, n) {
|
|
4920
|
-
if (
|
|
4920
|
+
if (yt.has(n)) {
|
|
4921
4921
|
const i = gn(n);
|
|
4922
4922
|
return i && i.default || 0;
|
|
4923
4923
|
} else {
|
|
@@ -4953,7 +4953,7 @@ class Nu extends wr {
|
|
|
4953
4953
|
return e[n];
|
|
4954
4954
|
}
|
|
4955
4955
|
readValueFromInstance(e, n) {
|
|
4956
|
-
if (
|
|
4956
|
+
if (yt.has(n)) {
|
|
4957
4957
|
const i = gn(n);
|
|
4958
4958
|
return i && i.default || 0;
|
|
4959
4959
|
}
|
|
@@ -4987,7 +4987,7 @@ const ju = (t, e) => on(t) ? new Nu(e, { enableHardwareAcceleration: !1 }) : new
|
|
|
4987
4987
|
...Iu
|
|
4988
4988
|
}, Sr = /* @__PURE__ */ zo((t, e) => ba(t, e, Fu, ju));
|
|
4989
4989
|
function zu(t) {
|
|
4990
|
-
const { children: e, parentRef: n, onlyChild: i } = t, [s, o] =
|
|
4990
|
+
const { children: e, parentRef: n, onlyChild: i } = t, [s, o] = X({ top: 0, left: 0 });
|
|
4991
4991
|
return Wi(() => {
|
|
4992
4992
|
if (n.current) {
|
|
4993
4993
|
const r = n.current.getBoundingClientRect();
|
|
@@ -5033,33 +5033,33 @@ function Wu(t) {
|
|
|
5033
5033
|
);
|
|
5034
5034
|
}
|
|
5035
5035
|
function Tr({ item: t, level: e = 0, ...n }) {
|
|
5036
|
-
var
|
|
5037
|
-
const { isActive: i, isCollapsed: s, expanded: o, toggleExpand: r } = n, a = `level-${e}`, l = s ? "collapsed" : "expanded", c = i(t.id) ? "active" : "", u = (
|
|
5038
|
-
function m(
|
|
5039
|
-
var
|
|
5040
|
-
const { level:
|
|
5041
|
-
return !h || s &&
|
|
5036
|
+
var b;
|
|
5037
|
+
const { isActive: i, isCollapsed: s, expanded: o, toggleExpand: r } = n, a = `level-${e}`, l = s ? "collapsed" : "expanded", c = i(t.id) ? "active" : "", u = (g, x = a) => `${g} ${x} ${l} ${c}`, h = !!((b = t.children) != null && b.length), [d, f] = X(!1), p = Et();
|
|
5038
|
+
function m(g) {
|
|
5039
|
+
var k;
|
|
5040
|
+
const { level: x, hovered: S, parentRef: T } = g;
|
|
5041
|
+
return !h || s && x >= 2 && !S ? null : /* @__PURE__ */ w(
|
|
5042
5042
|
zu,
|
|
5043
5043
|
{
|
|
5044
|
-
parentRef:
|
|
5045
|
-
onlyChild: !s || s &&
|
|
5044
|
+
parentRef: T,
|
|
5045
|
+
onlyChild: !s || s && x < 2,
|
|
5046
5046
|
children: /* @__PURE__ */ w(
|
|
5047
5047
|
Sr.div,
|
|
5048
5048
|
{
|
|
5049
|
-
className: u("menu-item__dropdown", `level-${
|
|
5049
|
+
className: u("menu-item__dropdown", `level-${x}`),
|
|
5050
5050
|
initial: { height: s ? "auto" : 0 },
|
|
5051
5051
|
animate: {
|
|
5052
5052
|
height: s || o(t.id) ? "auto" : 0
|
|
5053
5053
|
},
|
|
5054
5054
|
transition: { duration: 0.2 },
|
|
5055
|
-
children: (
|
|
5055
|
+
children: (k = t.children) == null ? void 0 : k.map((P) => /* @__PURE__ */ _i(Tr, { ...n, key: P.id, item: P, level: x }))
|
|
5056
5056
|
},
|
|
5057
5057
|
+s
|
|
5058
5058
|
)
|
|
5059
5059
|
}
|
|
5060
5060
|
);
|
|
5061
5061
|
}
|
|
5062
|
-
const v =
|
|
5062
|
+
const v = t.path && n.replacePath ? n.replacePath(t.path) : t.path || "#", y = h ? "div" : Nr;
|
|
5063
5063
|
return /* @__PURE__ */ B(
|
|
5064
5064
|
"div",
|
|
5065
5065
|
{
|
|
@@ -5069,15 +5069,15 @@ function Tr({ item: t, level: e = 0, ...n }) {
|
|
|
5069
5069
|
onMouseLeave: () => s && f(!1),
|
|
5070
5070
|
children: [
|
|
5071
5071
|
/* @__PURE__ */ B(
|
|
5072
|
-
|
|
5072
|
+
y,
|
|
5073
5073
|
{
|
|
5074
|
-
...
|
|
5074
|
+
...y === "div" ? {} : { to: v },
|
|
5075
5075
|
style: {
|
|
5076
5076
|
paddingLeft: `${s ? "0.5rem" : `${e * 1}rem`}`
|
|
5077
5077
|
},
|
|
5078
5078
|
className: u("menu-item__link"),
|
|
5079
|
-
onClick: (
|
|
5080
|
-
h && (
|
|
5079
|
+
onClick: (g) => {
|
|
5080
|
+
h && (g.preventDefault(), s || r(t.id));
|
|
5081
5081
|
},
|
|
5082
5082
|
children: [
|
|
5083
5083
|
e !== 0 && /* @__PURE__ */ w(_u, { cls: u, item: t }),
|
|
@@ -5101,7 +5101,7 @@ function Tr({ item: t, level: e = 0, ...n }) {
|
|
|
5101
5101
|
}
|
|
5102
5102
|
function _u({ item: t, cls: e }) {
|
|
5103
5103
|
var r, a;
|
|
5104
|
-
const [n, i] =
|
|
5104
|
+
const [n, i] = X(!1), s = () => {
|
|
5105
5105
|
i(!0);
|
|
5106
5106
|
}, o = (r = t.icon) == null ? void 0 : r.endsWith(".svg");
|
|
5107
5107
|
return /* @__PURE__ */ w("div", { className: e("menu-item__icon"), children: n ? /* @__PURE__ */ w(
|
|
@@ -5227,7 +5227,7 @@ function rh(t) {
|
|
|
5227
5227
|
return /* @__PURE__ */ w(Hi, { styles: [Hu, Xu], style: { zIndex: 1200 }, children: /* @__PURE__ */ w(qu, { ...t }) });
|
|
5228
5228
|
}
|
|
5229
5229
|
function qu(t) {
|
|
5230
|
-
const { baseUrl: e, menuPath: n } = t, i = jr(), [s, o] =
|
|
5230
|
+
const { baseUrl: e, menuPath: n } = t, i = jr(), [s, o] = X([]), [r, a] = X(!1), l = (Ar(s, i.pathname) || []).filter((y) => y.parentKey !== 0), [c, u] = X({}), h = (y) => {
|
|
5231
5231
|
u({
|
|
5232
5232
|
...c,
|
|
5233
5233
|
[y]: !c[y]
|
|
@@ -5239,18 +5239,18 @@ function qu(t) {
|
|
|
5239
5239
|
(async () => {
|
|
5240
5240
|
const b = e + (n || "/global-menu-config/api/v1/menu-items/user"), g = await Fr.get(b, {
|
|
5241
5241
|
withCredentials: !0
|
|
5242
|
-
}).then((
|
|
5243
|
-
var
|
|
5242
|
+
}).then((S) => S.data).catch((S) => {
|
|
5243
|
+
var T, k;
|
|
5244
5244
|
Rr(
|
|
5245
|
-
((k = (
|
|
5245
|
+
((k = (T = S.response) == null ? void 0 : T.data) == null ? void 0 : k.errorMessage) || "Have error when get menu items"
|
|
5246
5246
|
);
|
|
5247
5247
|
}), x = {};
|
|
5248
|
-
g.forEach((
|
|
5249
|
-
|
|
5250
|
-
}), u(x), o(g.map((
|
|
5248
|
+
g.forEach((S) => {
|
|
5249
|
+
S.children && (x[S.id] = !0);
|
|
5250
|
+
}), u(x), o(g.map((S) => ({ ...S, parentKey: 0 })));
|
|
5251
5251
|
})();
|
|
5252
5252
|
}, [e, n]);
|
|
5253
|
-
const [f, p] =
|
|
5253
|
+
const [f, p] = X(!1), m = r ? "collapsed" : "expanded", v = (y) => `${y} ${m}`;
|
|
5254
5254
|
return /* @__PURE__ */ B("div", { className: v("side-bar"), children: [
|
|
5255
5255
|
/* @__PURE__ */ w("div", { className: v("side-bar__wrapper-toggle-btn"), children: /* @__PURE__ */ w(
|
|
5256
5256
|
"button",
|
|
@@ -5278,7 +5278,8 @@ function qu(t) {
|
|
|
5278
5278
|
isActive: (g) => l.some((x) => x.id === g),
|
|
5279
5279
|
isCollapsed: r,
|
|
5280
5280
|
expanded: (g) => c[g],
|
|
5281
|
-
toggleExpand: h
|
|
5281
|
+
toggleExpand: h,
|
|
5282
|
+
replacePath: t.replacePath
|
|
5282
5283
|
},
|
|
5283
5284
|
y.id
|
|
5284
5285
|
))
|