motion 12.4.11 → 12.4.13

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/cjs/index.js CHANGED
@@ -1628,7 +1628,7 @@ class MotionValue {
1628
1628
  * This will be replaced by the build step with the latest version number.
1629
1629
  * When MotionValues are provided to motion components, warn if versions are mixed.
1630
1630
  */
1631
- this.version = "12.4.11";
1631
+ this.version = "12.4.13";
1632
1632
  /**
1633
1633
  * Tracks whether this value can output a velocity. Currently this is only true
1634
1634
  * if the value is numerical, but we might be able to widen the scope here and support
@@ -2494,25 +2494,89 @@ function makeNoneKeyframesAnimatable(unresolvedKeyframes, noneKeyframeIndexes, n
2494
2494
  }
2495
2495
  }
2496
2496
 
2497
- const isNumOrPxType = (v) => v === number || v === px;
2498
- const getPosFromMatrix = (matrix, pos) => parseFloat(matrix.split(", ")[pos]);
2499
- const getTranslateFromMatrix = (pos2, pos3) => (_bbox, { transform }) => {
2500
- if (transform === "none" || !transform)
2501
- return 0;
2502
- const matrix3d = transform.match(/^matrix3d\((.+)\)$/u);
2503
- if (matrix3d) {
2504
- return getPosFromMatrix(matrix3d[1], pos3);
2497
+ const radToDeg = (rad) => (rad * 180) / Math.PI;
2498
+ const rotate = (v) => {
2499
+ const angle = radToDeg(Math.atan2(v[1], v[0]));
2500
+ return rebaseAngle(angle);
2501
+ };
2502
+ const matrix2dParsers = {
2503
+ x: 4,
2504
+ y: 5,
2505
+ translateX: 4,
2506
+ translateY: 5,
2507
+ scaleX: 0,
2508
+ scaleY: 3,
2509
+ scale: (v) => (Math.abs(v[0]) + Math.abs(v[3])) / 2,
2510
+ rotate,
2511
+ rotateZ: rotate,
2512
+ skewX: (v) => radToDeg(Math.atan(v[1])),
2513
+ skewY: (v) => radToDeg(Math.atan(v[2])),
2514
+ skew: (v) => (Math.abs(v[1]) + Math.abs(v[2])) / 2,
2515
+ };
2516
+ const rebaseAngle = (angle) => {
2517
+ angle = angle % 360;
2518
+ if (angle < 0)
2519
+ angle += 360;
2520
+ return angle;
2521
+ };
2522
+ const rotateZ = rotate;
2523
+ const scaleX = (v) => Math.sqrt(v[0] * v[0] + v[1] * v[1]);
2524
+ const scaleY = (v) => Math.sqrt(v[4] * v[4] + v[5] * v[5]);
2525
+ const matrix3dParsers = {
2526
+ x: 12,
2527
+ y: 13,
2528
+ z: 14,
2529
+ translateX: 12,
2530
+ translateY: 13,
2531
+ translateZ: 14,
2532
+ scaleX,
2533
+ scaleY,
2534
+ scale: (v) => (scaleX(v) + scaleY(v)) / 2,
2535
+ rotateX: (v) => rebaseAngle(radToDeg(Math.atan2(v[6], v[5]))),
2536
+ rotateY: (v) => rebaseAngle(radToDeg(Math.atan2(-v[2], v[0]))),
2537
+ rotateZ,
2538
+ rotate: rotateZ,
2539
+ skewX: (v) => radToDeg(Math.atan(v[4])),
2540
+ skewY: (v) => radToDeg(Math.atan(v[1])),
2541
+ skew: (v) => (Math.abs(v[1]) + Math.abs(v[4])) / 2,
2542
+ };
2543
+ function defaultTransformValue(name) {
2544
+ return name.includes("scale") ? 1 : 0;
2545
+ }
2546
+ function parseValueFromTransform(transform, name) {
2547
+ if (!transform || transform === "none") {
2548
+ return defaultTransformValue(name);
2505
2549
  }
2506
- else {
2507
- const matrix = transform.match(/^matrix\((.+)\)$/u);
2508
- if (matrix) {
2509
- return getPosFromMatrix(matrix[1], pos2);
2510
- }
2511
- else {
2512
- return 0;
2513
- }
2550
+ const matrix3dMatch = transform.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);
2551
+ let parsers;
2552
+ let match;
2553
+ if (matrix3dMatch) {
2554
+ parsers = matrix3dParsers;
2555
+ match = matrix3dMatch;
2514
2556
  }
2557
+ else {
2558
+ const matrix2dMatch = transform.match(/^matrix\(([-\d.e\s,]+)\)$/u);
2559
+ parsers = matrix2dParsers;
2560
+ match = matrix2dMatch;
2561
+ }
2562
+ if (!match) {
2563
+ return defaultTransformValue(name);
2564
+ }
2565
+ const valueParser = parsers[name];
2566
+ const values = match[1].split(",").map(convertTransformToNumber);
2567
+ return typeof valueParser === "function"
2568
+ ? valueParser(values)
2569
+ : values[valueParser];
2570
+ }
2571
+ const readTransformValue = (instance, name) => {
2572
+ const { transform = "none" } = getComputedStyle(instance);
2573
+ return parseValueFromTransform(transform, name);
2515
2574
  };
2575
+ function convertTransformToNumber(value) {
2576
+ return parseFloat(value.trim());
2577
+ }
2578
+
2579
+ const isNumOrPxType = (v) => v === number || v === px;
2516
2580
  const transformKeys = new Set(["x", "y", "z"]);
2517
2581
  const nonTranslationalTransformKeys = transformPropOrder.filter((key) => !transformKeys.has(key));
2518
2582
  function removeNonTranslationalTransform(visualElement) {
@@ -2535,8 +2599,8 @@ const positionalValues = {
2535
2599
  bottom: ({ y }, { top }) => parseFloat(top) + (y.max - y.min),
2536
2600
  right: ({ x }, { left }) => parseFloat(left) + (x.max - x.min),
2537
2601
  // Transform
2538
- x: getTranslateFromMatrix(4, 13),
2539
- y: getTranslateFromMatrix(5, 14),
2602
+ x: (_bbox, { transform }) => parseValueFromTransform(transform, "x"),
2603
+ y: (_bbox, { transform }) => parseValueFromTransform(transform, "y"),
2540
2604
  };
2541
2605
  // Alias translate longform names
2542
2606
  positionalValues.translateX = positionalValues.x;
@@ -4571,7 +4635,7 @@ function updateMotionValuesFromProps(element, next, prev) {
4571
4635
  * and warn against mismatches.
4572
4636
  */
4573
4637
  if (process.env.NODE_ENV === "development") {
4574
- warnOnce(nextValue.version === "12.4.11", `Attempting to mix Motion versions ${nextValue.version} with 12.4.11 may not work as expected.`);
4638
+ warnOnce(nextValue.version === "12.4.13", `Attempting to mix Motion versions ${nextValue.version} with 12.4.13 may not work as expected.`);
4575
4639
  }
4576
4640
  }
4577
4641
  else if (isMotionValue(prevValue)) {
@@ -5511,8 +5575,7 @@ class HTMLVisualElement extends DOMVisualElement {
5511
5575
  }
5512
5576
  readValueFromInstance(instance, key) {
5513
5577
  if (transformProps.has(key)) {
5514
- const defaultType = getDefaultValueType(key);
5515
- return defaultType ? defaultType.default || 0 : 0;
5578
+ return readTransformValue(instance, key);
5516
5579
  }
5517
5580
  else {
5518
5581
  const computedStyle = getComputedStyle$1(instance);
@@ -944,7 +944,7 @@ class MotionValue {
944
944
  * This will be replaced by the build step with the latest version number.
945
945
  * When MotionValues are provided to motion components, warn if versions are mixed.
946
946
  */
947
- this.version = "12.4.11";
947
+ this.version = "12.4.13";
948
948
  /**
949
949
  * Tracks whether this value can output a velocity. Currently this is only true
950
950
  * if the value is numerical, but we might be able to widen the scope here and support
@@ -1780,25 +1780,89 @@ function makeNoneKeyframesAnimatable(unresolvedKeyframes, noneKeyframeIndexes, n
1780
1780
  }
1781
1781
  }
1782
1782
 
1783
- const isNumOrPxType = (v) => v === number || v === px;
1784
- const getPosFromMatrix = (matrix, pos) => parseFloat(matrix.split(", ")[pos]);
1785
- const getTranslateFromMatrix = (pos2, pos3) => (_bbox, { transform }) => {
1786
- if (transform === "none" || !transform)
1787
- return 0;
1788
- const matrix3d = transform.match(/^matrix3d\((.+)\)$/u);
1789
- if (matrix3d) {
1790
- return getPosFromMatrix(matrix3d[1], pos3);
1783
+ const radToDeg = (rad) => (rad * 180) / Math.PI;
1784
+ const rotate = (v) => {
1785
+ const angle = radToDeg(Math.atan2(v[1], v[0]));
1786
+ return rebaseAngle(angle);
1787
+ };
1788
+ const matrix2dParsers = {
1789
+ x: 4,
1790
+ y: 5,
1791
+ translateX: 4,
1792
+ translateY: 5,
1793
+ scaleX: 0,
1794
+ scaleY: 3,
1795
+ scale: (v) => (Math.abs(v[0]) + Math.abs(v[3])) / 2,
1796
+ rotate,
1797
+ rotateZ: rotate,
1798
+ skewX: (v) => radToDeg(Math.atan(v[1])),
1799
+ skewY: (v) => radToDeg(Math.atan(v[2])),
1800
+ skew: (v) => (Math.abs(v[1]) + Math.abs(v[2])) / 2,
1801
+ };
1802
+ const rebaseAngle = (angle) => {
1803
+ angle = angle % 360;
1804
+ if (angle < 0)
1805
+ angle += 360;
1806
+ return angle;
1807
+ };
1808
+ const rotateZ = rotate;
1809
+ const scaleX = (v) => Math.sqrt(v[0] * v[0] + v[1] * v[1]);
1810
+ const scaleY = (v) => Math.sqrt(v[4] * v[4] + v[5] * v[5]);
1811
+ const matrix3dParsers = {
1812
+ x: 12,
1813
+ y: 13,
1814
+ z: 14,
1815
+ translateX: 12,
1816
+ translateY: 13,
1817
+ translateZ: 14,
1818
+ scaleX,
1819
+ scaleY,
1820
+ scale: (v) => (scaleX(v) + scaleY(v)) / 2,
1821
+ rotateX: (v) => rebaseAngle(radToDeg(Math.atan2(v[6], v[5]))),
1822
+ rotateY: (v) => rebaseAngle(radToDeg(Math.atan2(-v[2], v[0]))),
1823
+ rotateZ,
1824
+ rotate: rotateZ,
1825
+ skewX: (v) => radToDeg(Math.atan(v[4])),
1826
+ skewY: (v) => radToDeg(Math.atan(v[1])),
1827
+ skew: (v) => (Math.abs(v[1]) + Math.abs(v[4])) / 2,
1828
+ };
1829
+ function defaultTransformValue(name) {
1830
+ return name.includes("scale") ? 1 : 0;
1831
+ }
1832
+ function parseValueFromTransform(transform, name) {
1833
+ if (!transform || transform === "none") {
1834
+ return defaultTransformValue(name);
1791
1835
  }
1792
- else {
1793
- const matrix = transform.match(/^matrix\((.+)\)$/u);
1794
- if (matrix) {
1795
- return getPosFromMatrix(matrix[1], pos2);
1796
- }
1797
- else {
1798
- return 0;
1799
- }
1836
+ const matrix3dMatch = transform.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);
1837
+ let parsers;
1838
+ let match;
1839
+ if (matrix3dMatch) {
1840
+ parsers = matrix3dParsers;
1841
+ match = matrix3dMatch;
1800
1842
  }
1843
+ else {
1844
+ const matrix2dMatch = transform.match(/^matrix\(([-\d.e\s,]+)\)$/u);
1845
+ parsers = matrix2dParsers;
1846
+ match = matrix2dMatch;
1847
+ }
1848
+ if (!match) {
1849
+ return defaultTransformValue(name);
1850
+ }
1851
+ const valueParser = parsers[name];
1852
+ const values = match[1].split(",").map(convertTransformToNumber);
1853
+ return typeof valueParser === "function"
1854
+ ? valueParser(values)
1855
+ : values[valueParser];
1856
+ }
1857
+ const readTransformValue = (instance, name) => {
1858
+ const { transform = "none" } = getComputedStyle(instance);
1859
+ return parseValueFromTransform(transform, name);
1801
1860
  };
1861
+ function convertTransformToNumber(value) {
1862
+ return parseFloat(value.trim());
1863
+ }
1864
+
1865
+ const isNumOrPxType = (v) => v === number || v === px;
1802
1866
  const transformKeys = new Set(["x", "y", "z"]);
1803
1867
  const nonTranslationalTransformKeys = transformPropOrder.filter((key) => !transformKeys.has(key));
1804
1868
  function removeNonTranslationalTransform(visualElement) {
@@ -1821,8 +1885,8 @@ const positionalValues = {
1821
1885
  bottom: ({ y }, { top }) => parseFloat(top) + (y.max - y.min),
1822
1886
  right: ({ x }, { left }) => parseFloat(left) + (x.max - x.min),
1823
1887
  // Transform
1824
- x: getTranslateFromMatrix(4, 13),
1825
- y: getTranslateFromMatrix(5, 14),
1888
+ x: (_bbox, { transform }) => parseValueFromTransform(transform, "x"),
1889
+ y: (_bbox, { transform }) => parseValueFromTransform(transform, "y"),
1826
1890
  };
1827
1891
  // Alias translate longform names
1828
1892
  positionalValues.translateX = positionalValues.x;
@@ -4889,6 +4953,11 @@ function measurePageBox(element, rootProjectionNode, transformPagePoint) {
4889
4953
  return viewportBox;
4890
4954
  }
4891
4955
 
4956
+ // Fixes https://github.com/motiondivision/motion/issues/2270
4957
+ const getContextWindow = ({ current }) => {
4958
+ return current ? current.ownerDocument.defaultView : null;
4959
+ };
4960
+
4892
4961
  function isRefObject(ref) {
4893
4962
  return (ref &&
4894
4963
  typeof ref === "object" &&
@@ -4907,7 +4976,7 @@ function distance2D(a, b) {
4907
4976
  * @internal
4908
4977
  */
4909
4978
  class PanSession {
4910
- constructor(event, handlers, { transformPagePoint, dragSnapToOrigin = false } = {}) {
4979
+ constructor(event, handlers, { transformPagePoint, contextWindow, dragSnapToOrigin = false, } = {}) {
4911
4980
  /**
4912
4981
  * @internal
4913
4982
  */
@@ -4924,6 +4993,10 @@ class PanSession {
4924
4993
  * @internal
4925
4994
  */
4926
4995
  this.handlers = {};
4996
+ /**
4997
+ * @internal
4998
+ */
4999
+ this.contextWindow = window;
4927
5000
  this.updatePoint = () => {
4928
5001
  if (!(this.lastMoveEvent && this.lastMoveEventInfo))
4929
5002
  return;
@@ -4946,32 +5019,19 @@ class PanSession {
4946
5019
  onMove && onMove(this.lastMoveEvent, info);
4947
5020
  };
4948
5021
  this.handlePointerMove = (event, info) => {
4949
- this.index = getElementIndex(event.currentTarget);
4950
- if (event.target instanceof Element &&
4951
- event.target.hasPointerCapture &&
4952
- event.pointerId !== undefined) {
4953
- try {
4954
- if (!event.target.hasPointerCapture(event.pointerId)) {
4955
- return;
4956
- }
4957
- }
4958
- catch (e) { }
4959
- }
4960
5022
  this.lastMoveEvent = event;
4961
5023
  this.lastMoveEventInfo = transformPoint(info, this.transformPagePoint);
4962
5024
  // Throttle mouse move event to once per frame
4963
5025
  frame.update(this.updatePoint, true);
4964
5026
  };
4965
5027
  this.handlePointerUp = (event, info) => {
4966
- capturePointer(event, "release");
4967
5028
  this.end();
4968
5029
  const { onEnd, onSessionEnd, resumeAnimation } = this.handlers;
4969
5030
  if (this.dragSnapToOrigin)
4970
5031
  resumeAnimation && resumeAnimation();
4971
5032
  if (!(this.lastMoveEvent && this.lastMoveEventInfo))
4972
5033
  return;
4973
- const panInfo = getPanInfo(event.type === "pointercancel" ||
4974
- event.type === "lostpointercapture"
5034
+ const panInfo = getPanInfo(event.type === "pointercancel"
4975
5035
  ? this.lastMoveEventInfo
4976
5036
  : transformPoint(info, this.transformPagePoint), this.history);
4977
5037
  if (this.startEvent && onEnd) {
@@ -4985,6 +5045,7 @@ class PanSession {
4985
5045
  this.dragSnapToOrigin = dragSnapToOrigin;
4986
5046
  this.handlers = handlers;
4987
5047
  this.transformPagePoint = transformPagePoint;
5048
+ this.contextWindow = contextWindow || window;
4988
5049
  const info = extractEventInfo(event);
4989
5050
  const initialInfo = transformPoint(info, this.transformPagePoint);
4990
5051
  const { point } = initialInfo;
@@ -4993,20 +5054,7 @@ class PanSession {
4993
5054
  const { onSessionStart } = handlers;
4994
5055
  onSessionStart &&
4995
5056
  onSessionStart(event, getPanInfo(initialInfo, this.history));
4996
- capturePointer(event, "set");
4997
- this.removeListeners = pipe(addPointerEvent(event.currentTarget, "pointermove", this.handlePointerMove), addPointerEvent(event.currentTarget, "pointerup", this.handlePointerUp), addPointerEvent(event.currentTarget, "pointercancel", this.handlePointerUp), addPointerEvent(event.currentTarget, "lostpointercapture", (lostPointerEvent, lostPointerInfo) => {
4998
- const index = getElementIndex(lostPointerEvent.currentTarget);
4999
- /**
5000
- * If the pointer has lost capture because it's moved in the DOM
5001
- * then we need to re-capture it.
5002
- */
5003
- if (index !== this.index) {
5004
- capturePointer(lostPointerEvent, "set");
5005
- }
5006
- else {
5007
- this.handlePointerUp(lostPointerEvent, lostPointerInfo);
5008
- }
5009
- }));
5057
+ this.removeListeners = pipe(addPointerEvent(this.contextWindow, "pointermove", this.handlePointerMove), addPointerEvent(this.contextWindow, "pointerup", this.handlePointerUp), addPointerEvent(this.contextWindow, "pointercancel", this.handlePointerUp));
5010
5058
  }
5011
5059
  updateHandlers(handlers) {
5012
5060
  this.handlers = handlers;
@@ -5070,11 +5118,6 @@ function getVelocity(history, timeDelta) {
5070
5118
  }
5071
5119
  return currentVelocity;
5072
5120
  }
5073
- function getElementIndex(element) {
5074
- if (!element.parentNode)
5075
- return -1;
5076
- return Array.from(element.parentNode.children).indexOf(element);
5077
- }
5078
5121
 
5079
5122
  /**
5080
5123
  * Apply constraints to a point. These constraints are both physical along an
@@ -5331,6 +5374,7 @@ class VisualElementDragControls {
5331
5374
  }, {
5332
5375
  transformPagePoint: this.visualElement.getTransformPagePoint(),
5333
5376
  dragSnapToOrigin,
5377
+ contextWindow: getContextWindow(this.visualElement),
5334
5378
  });
5335
5379
  }
5336
5380
  stop(event, info) {
@@ -5696,6 +5740,7 @@ class PanGesture extends Feature {
5696
5740
  onPointerDown(pointerDownEvent) {
5697
5741
  this.session = new PanSession(pointerDownEvent, this.createPanHandlers(), {
5698
5742
  transformPagePoint: this.node.getTransformPagePoint(),
5743
+ contextWindow: getContextWindow(this.node),
5699
5744
  });
5700
5745
  }
5701
5746
  createPanHandlers() {
@@ -9334,7 +9379,7 @@ function updateMotionValuesFromProps(element, next, prev) {
9334
9379
  * and warn against mismatches.
9335
9380
  */
9336
9381
  if (process.env.NODE_ENV === "development") {
9337
- warnOnce(nextValue.version === "12.4.11", `Attempting to mix Motion versions ${nextValue.version} with 12.4.11 may not work as expected.`);
9382
+ warnOnce(nextValue.version === "12.4.13", `Attempting to mix Motion versions ${nextValue.version} with 12.4.13 may not work as expected.`);
9338
9383
  }
9339
9384
  }
9340
9385
  else if (isMotionValue(prevValue)) {
@@ -9869,7 +9914,7 @@ class DOMVisualElement extends VisualElement {
9869
9914
  }
9870
9915
  }
9871
9916
 
9872
- function getComputedStyle(element) {
9917
+ function getComputedStyle$1(element) {
9873
9918
  return window.getComputedStyle(element);
9874
9919
  }
9875
9920
  class HTMLVisualElement extends DOMVisualElement {
@@ -9880,11 +9925,10 @@ class HTMLVisualElement extends DOMVisualElement {
9880
9925
  }
9881
9926
  readValueFromInstance(instance, key) {
9882
9927
  if (transformProps.has(key)) {
9883
- const defaultType = getDefaultValueType(key);
9884
- return defaultType ? defaultType.default || 0 : 0;
9928
+ return readTransformValue(instance, key);
9885
9929
  }
9886
9930
  else {
9887
- const computedStyle = getComputedStyle(instance);
9931
+ const computedStyle = getComputedStyle$1(instance);
9888
9932
  const value = (isCSSVariableName(key)
9889
9933
  ? computedStyle.getPropertyValue(key)
9890
9934
  : computedStyle[key]) || 0;
@@ -9,6 +9,7 @@ import { calcLength } from '../../projection/geometry/delta-calc.mjs';
9
9
  import { createBox } from '../../projection/geometry/models.mjs';
10
10
  import { eachAxis } from '../../projection/utils/each-axis.mjs';
11
11
  import { measurePageBox } from '../../projection/utils/measure.mjs';
12
+ import { getContextWindow } from '../../utils/get-context-window.mjs';
12
13
  import { isRefObject } from '../../utils/is-ref-object.mjs';
13
14
  import { mixNumber } from '../../utils/mix/number.mjs';
14
15
  import { percent } from '../../value/types/numbers/units.mjs';
@@ -149,6 +150,7 @@ class VisualElementDragControls {
149
150
  }, {
150
151
  transformPagePoint: this.visualElement.getTransformPagePoint(),
151
152
  dragSnapToOrigin,
153
+ contextWindow: getContextWindow(this.visualElement),
152
154
  });
153
155
  }
154
156
  stop(event, info) {
@@ -1,6 +1,5 @@
1
1
  import '../../../../../motion-utils/dist/es/errors.mjs';
2
2
  import { secondsToMilliseconds, millisecondsToSeconds } from '../../../../../motion-utils/dist/es/time-conversion.mjs';
3
- import { capturePointer } from '../../../../../motion-dom/dist/es/gestures/utils/capture-pointer.mjs';
4
3
  import { isPrimaryPointer } from '../../../../../motion-dom/dist/es/gestures/utils/is-primary-pointer.mjs';
5
4
  import { addPointerEvent } from '../../events/add-pointer-event.mjs';
6
5
  import { extractEventInfo } from '../../events/event-info.mjs';
@@ -12,7 +11,7 @@ import { frame, cancelFrame, frameData } from '../../frameloop/frame.mjs';
12
11
  * @internal
13
12
  */
14
13
  class PanSession {
15
- constructor(event, handlers, { transformPagePoint, dragSnapToOrigin = false } = {}) {
14
+ constructor(event, handlers, { transformPagePoint, contextWindow, dragSnapToOrigin = false, } = {}) {
16
15
  /**
17
16
  * @internal
18
17
  */
@@ -29,6 +28,10 @@ class PanSession {
29
28
  * @internal
30
29
  */
31
30
  this.handlers = {};
31
+ /**
32
+ * @internal
33
+ */
34
+ this.contextWindow = window;
32
35
  this.updatePoint = () => {
33
36
  if (!(this.lastMoveEvent && this.lastMoveEventInfo))
34
37
  return;
@@ -51,32 +54,19 @@ class PanSession {
51
54
  onMove && onMove(this.lastMoveEvent, info);
52
55
  };
53
56
  this.handlePointerMove = (event, info) => {
54
- this.index = getElementIndex(event.currentTarget);
55
- if (event.target instanceof Element &&
56
- event.target.hasPointerCapture &&
57
- event.pointerId !== undefined) {
58
- try {
59
- if (!event.target.hasPointerCapture(event.pointerId)) {
60
- return;
61
- }
62
- }
63
- catch (e) { }
64
- }
65
57
  this.lastMoveEvent = event;
66
58
  this.lastMoveEventInfo = transformPoint(info, this.transformPagePoint);
67
59
  // Throttle mouse move event to once per frame
68
60
  frame.update(this.updatePoint, true);
69
61
  };
70
62
  this.handlePointerUp = (event, info) => {
71
- capturePointer(event, "release");
72
63
  this.end();
73
64
  const { onEnd, onSessionEnd, resumeAnimation } = this.handlers;
74
65
  if (this.dragSnapToOrigin)
75
66
  resumeAnimation && resumeAnimation();
76
67
  if (!(this.lastMoveEvent && this.lastMoveEventInfo))
77
68
  return;
78
- const panInfo = getPanInfo(event.type === "pointercancel" ||
79
- event.type === "lostpointercapture"
69
+ const panInfo = getPanInfo(event.type === "pointercancel"
80
70
  ? this.lastMoveEventInfo
81
71
  : transformPoint(info, this.transformPagePoint), this.history);
82
72
  if (this.startEvent && onEnd) {
@@ -90,6 +80,7 @@ class PanSession {
90
80
  this.dragSnapToOrigin = dragSnapToOrigin;
91
81
  this.handlers = handlers;
92
82
  this.transformPagePoint = transformPagePoint;
83
+ this.contextWindow = contextWindow || window;
93
84
  const info = extractEventInfo(event);
94
85
  const initialInfo = transformPoint(info, this.transformPagePoint);
95
86
  const { point } = initialInfo;
@@ -98,20 +89,7 @@ class PanSession {
98
89
  const { onSessionStart } = handlers;
99
90
  onSessionStart &&
100
91
  onSessionStart(event, getPanInfo(initialInfo, this.history));
101
- capturePointer(event, "set");
102
- this.removeListeners = pipe(addPointerEvent(event.currentTarget, "pointermove", this.handlePointerMove), addPointerEvent(event.currentTarget, "pointerup", this.handlePointerUp), addPointerEvent(event.currentTarget, "pointercancel", this.handlePointerUp), addPointerEvent(event.currentTarget, "lostpointercapture", (lostPointerEvent, lostPointerInfo) => {
103
- const index = getElementIndex(lostPointerEvent.currentTarget);
104
- /**
105
- * If the pointer has lost capture because it's moved in the DOM
106
- * then we need to re-capture it.
107
- */
108
- if (index !== this.index) {
109
- capturePointer(lostPointerEvent, "set");
110
- }
111
- else {
112
- this.handlePointerUp(lostPointerEvent, lostPointerInfo);
113
- }
114
- }));
92
+ this.removeListeners = pipe(addPointerEvent(this.contextWindow, "pointermove", this.handlePointerMove), addPointerEvent(this.contextWindow, "pointerup", this.handlePointerUp), addPointerEvent(this.contextWindow, "pointercancel", this.handlePointerUp));
115
93
  }
116
94
  updateHandlers(handlers) {
117
95
  this.handlers = handlers;
@@ -175,10 +153,5 @@ function getVelocity(history, timeDelta) {
175
153
  }
176
154
  return currentVelocity;
177
155
  }
178
- function getElementIndex(element) {
179
- if (!element.parentNode)
180
- return -1;
181
- return Array.from(element.parentNode.children).indexOf(element);
182
- }
183
156
 
184
157
  export { PanSession };
@@ -2,6 +2,7 @@ import '../../../../../motion-utils/dist/es/errors.mjs';
2
2
  import { noop } from '../../../../../motion-utils/dist/es/noop.mjs';
3
3
  import { addPointerEvent } from '../../events/add-pointer-event.mjs';
4
4
  import { Feature } from '../../motion/features/Feature.mjs';
5
+ import { getContextWindow } from '../../utils/get-context-window.mjs';
5
6
  import { PanSession } from './PanSession.mjs';
6
7
  import { frame } from '../../frameloop/frame.mjs';
7
8
 
@@ -18,6 +19,7 @@ class PanGesture extends Feature {
18
19
  onPointerDown(pointerDownEvent) {
19
20
  this.session = new PanSession(pointerDownEvent, this.createPanHandlers(), {
20
21
  transformPagePoint: this.node.getTransformPagePoint(),
22
+ contextWindow: getContextWindow(this.node),
21
23
  });
22
24
  }
23
25
  createPanHandlers() {
@@ -1,26 +1,9 @@
1
1
  import { number } from '../../../value/types/numbers/index.mjs';
2
2
  import { px } from '../../../value/types/numbers/units.mjs';
3
3
  import { transformPropOrder } from '../../html/utils/keys-transform.mjs';
4
+ import { parseValueFromTransform } from '../../html/utils/parse-transform.mjs';
4
5
 
5
6
  const isNumOrPxType = (v) => v === number || v === px;
6
- const getPosFromMatrix = (matrix, pos) => parseFloat(matrix.split(", ")[pos]);
7
- const getTranslateFromMatrix = (pos2, pos3) => (_bbox, { transform }) => {
8
- if (transform === "none" || !transform)
9
- return 0;
10
- const matrix3d = transform.match(/^matrix3d\((.+)\)$/u);
11
- if (matrix3d) {
12
- return getPosFromMatrix(matrix3d[1], pos3);
13
- }
14
- else {
15
- const matrix = transform.match(/^matrix\((.+)\)$/u);
16
- if (matrix) {
17
- return getPosFromMatrix(matrix[1], pos2);
18
- }
19
- else {
20
- return 0;
21
- }
22
- }
23
- };
24
7
  const transformKeys = new Set(["x", "y", "z"]);
25
8
  const nonTranslationalTransformKeys = transformPropOrder.filter((key) => !transformKeys.has(key));
26
9
  function removeNonTranslationalTransform(visualElement) {
@@ -43,8 +26,8 @@ const positionalValues = {
43
26
  bottom: ({ y }, { top }) => parseFloat(top) + (y.max - y.min),
44
27
  right: ({ x }, { left }) => parseFloat(left) + (x.max - x.min),
45
28
  // Transform
46
- x: getTranslateFromMatrix(4, 13),
47
- y: getTranslateFromMatrix(5, 14),
29
+ x: (_bbox, { transform }) => parseValueFromTransform(transform, "x"),
30
+ y: (_bbox, { transform }) => parseValueFromTransform(transform, "y"),
48
31
  };
49
32
  // Alias translate longform names
50
33
  positionalValues.translateX = positionalValues.x;
@@ -1,9 +1,9 @@
1
1
  import { measureViewportBox } from '../../projection/utils/measure.mjs';
2
2
  import { DOMVisualElement } from '../dom/DOMVisualElement.mjs';
3
3
  import { isCSSVariableName } from '../dom/utils/is-css-variable.mjs';
4
- import { getDefaultValueType } from '../dom/value-types/defaults.mjs';
5
4
  import { buildHTMLStyles } from './utils/build-styles.mjs';
6
5
  import { transformProps } from './utils/keys-transform.mjs';
6
+ import { readTransformValue } from './utils/parse-transform.mjs';
7
7
  import { renderHTML } from './utils/render.mjs';
8
8
  import { scrapeMotionValuesFromProps } from './utils/scrape-motion-values.mjs';
9
9
 
@@ -18,8 +18,7 @@ class HTMLVisualElement extends DOMVisualElement {
18
18
  }
19
19
  readValueFromInstance(instance, key) {
20
20
  if (transformProps.has(key)) {
21
- const defaultType = getDefaultValueType(key);
22
- return defaultType ? defaultType.default || 0 : 0;
21
+ return readTransformValue(instance, key);
23
22
  }
24
23
  else {
25
24
  const computedStyle = getComputedStyle(instance);
@@ -0,0 +1,83 @@
1
+ const radToDeg = (rad) => (rad * 180) / Math.PI;
2
+ const rotate = (v) => {
3
+ const angle = radToDeg(Math.atan2(v[1], v[0]));
4
+ return rebaseAngle(angle);
5
+ };
6
+ const matrix2dParsers = {
7
+ x: 4,
8
+ y: 5,
9
+ translateX: 4,
10
+ translateY: 5,
11
+ scaleX: 0,
12
+ scaleY: 3,
13
+ scale: (v) => (Math.abs(v[0]) + Math.abs(v[3])) / 2,
14
+ rotate,
15
+ rotateZ: rotate,
16
+ skewX: (v) => radToDeg(Math.atan(v[1])),
17
+ skewY: (v) => radToDeg(Math.atan(v[2])),
18
+ skew: (v) => (Math.abs(v[1]) + Math.abs(v[2])) / 2,
19
+ };
20
+ const rebaseAngle = (angle) => {
21
+ angle = angle % 360;
22
+ if (angle < 0)
23
+ angle += 360;
24
+ return angle;
25
+ };
26
+ const rotateZ = rotate;
27
+ const scaleX = (v) => Math.sqrt(v[0] * v[0] + v[1] * v[1]);
28
+ const scaleY = (v) => Math.sqrt(v[4] * v[4] + v[5] * v[5]);
29
+ const matrix3dParsers = {
30
+ x: 12,
31
+ y: 13,
32
+ z: 14,
33
+ translateX: 12,
34
+ translateY: 13,
35
+ translateZ: 14,
36
+ scaleX,
37
+ scaleY,
38
+ scale: (v) => (scaleX(v) + scaleY(v)) / 2,
39
+ rotateX: (v) => rebaseAngle(radToDeg(Math.atan2(v[6], v[5]))),
40
+ rotateY: (v) => rebaseAngle(radToDeg(Math.atan2(-v[2], v[0]))),
41
+ rotateZ,
42
+ rotate: rotateZ,
43
+ skewX: (v) => radToDeg(Math.atan(v[4])),
44
+ skewY: (v) => radToDeg(Math.atan(v[1])),
45
+ skew: (v) => (Math.abs(v[1]) + Math.abs(v[4])) / 2,
46
+ };
47
+ function defaultTransformValue(name) {
48
+ return name.includes("scale") ? 1 : 0;
49
+ }
50
+ function parseValueFromTransform(transform, name) {
51
+ if (!transform || transform === "none") {
52
+ return defaultTransformValue(name);
53
+ }
54
+ const matrix3dMatch = transform.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);
55
+ let parsers;
56
+ let match;
57
+ if (matrix3dMatch) {
58
+ parsers = matrix3dParsers;
59
+ match = matrix3dMatch;
60
+ }
61
+ else {
62
+ const matrix2dMatch = transform.match(/^matrix\(([-\d.e\s,]+)\)$/u);
63
+ parsers = matrix2dParsers;
64
+ match = matrix2dMatch;
65
+ }
66
+ if (!match) {
67
+ return defaultTransformValue(name);
68
+ }
69
+ const valueParser = parsers[name];
70
+ const values = match[1].split(",").map(convertTransformToNumber);
71
+ return typeof valueParser === "function"
72
+ ? valueParser(values)
73
+ : values[valueParser];
74
+ }
75
+ const readTransformValue = (instance, name) => {
76
+ const { transform = "none" } = getComputedStyle(instance);
77
+ return parseValueFromTransform(transform, name);
78
+ };
79
+ function convertTransformToNumber(value) {
80
+ return parseFloat(value.trim());
81
+ }
82
+
83
+ export { parseValueFromTransform, readTransformValue };
@@ -17,7 +17,7 @@ function updateMotionValuesFromProps(element, next, prev) {
17
17
  * and warn against mismatches.
18
18
  */
19
19
  if (process.env.NODE_ENV === "development") {
20
- warnOnce(nextValue.version === "12.4.11", `Attempting to mix Motion versions ${nextValue.version} with 12.4.11 may not work as expected.`);
20
+ warnOnce(nextValue.version === "12.4.13", `Attempting to mix Motion versions ${nextValue.version} with 12.4.13 may not work as expected.`);
21
21
  }
22
22
  }
23
23
  else if (isMotionValue(prevValue)) {
@@ -0,0 +1,6 @@
1
+ // Fixes https://github.com/motiondivision/motion/issues/2270
2
+ const getContextWindow = ({ current }) => {
3
+ return current ? current.ownerDocument.defaultView : null;
4
+ };
5
+
6
+ export { getContextWindow };
@@ -34,7 +34,7 @@ class MotionValue {
34
34
  * This will be replaced by the build step with the latest version number.
35
35
  * When MotionValues are provided to motion components, warn if versions are mixed.
36
36
  */
37
- this.version = "12.4.11";
37
+ this.version = "12.4.13";
38
38
  /**
39
39
  * Tracks whether this value can output a velocity. Currently this is only true
40
40
  * if the value is numerical, but we might be able to widen the scope here and support
@@ -1630,7 +1630,7 @@
1630
1630
  * This will be replaced by the build step with the latest version number.
1631
1631
  * When MotionValues are provided to motion components, warn if versions are mixed.
1632
1632
  */
1633
- this.version = "12.4.11";
1633
+ this.version = "12.4.13";
1634
1634
  /**
1635
1635
  * Tracks whether this value can output a velocity. Currently this is only true
1636
1636
  * if the value is numerical, but we might be able to widen the scope here and support
@@ -2496,25 +2496,89 @@
2496
2496
  }
2497
2497
  }
2498
2498
 
2499
- const isNumOrPxType = (v) => v === number || v === px;
2500
- const getPosFromMatrix = (matrix, pos) => parseFloat(matrix.split(", ")[pos]);
2501
- const getTranslateFromMatrix = (pos2, pos3) => (_bbox, { transform }) => {
2502
- if (transform === "none" || !transform)
2503
- return 0;
2504
- const matrix3d = transform.match(/^matrix3d\((.+)\)$/u);
2505
- if (matrix3d) {
2506
- return getPosFromMatrix(matrix3d[1], pos3);
2499
+ const radToDeg = (rad) => (rad * 180) / Math.PI;
2500
+ const rotate = (v) => {
2501
+ const angle = radToDeg(Math.atan2(v[1], v[0]));
2502
+ return rebaseAngle(angle);
2503
+ };
2504
+ const matrix2dParsers = {
2505
+ x: 4,
2506
+ y: 5,
2507
+ translateX: 4,
2508
+ translateY: 5,
2509
+ scaleX: 0,
2510
+ scaleY: 3,
2511
+ scale: (v) => (Math.abs(v[0]) + Math.abs(v[3])) / 2,
2512
+ rotate,
2513
+ rotateZ: rotate,
2514
+ skewX: (v) => radToDeg(Math.atan(v[1])),
2515
+ skewY: (v) => radToDeg(Math.atan(v[2])),
2516
+ skew: (v) => (Math.abs(v[1]) + Math.abs(v[2])) / 2,
2517
+ };
2518
+ const rebaseAngle = (angle) => {
2519
+ angle = angle % 360;
2520
+ if (angle < 0)
2521
+ angle += 360;
2522
+ return angle;
2523
+ };
2524
+ const rotateZ = rotate;
2525
+ const scaleX = (v) => Math.sqrt(v[0] * v[0] + v[1] * v[1]);
2526
+ const scaleY = (v) => Math.sqrt(v[4] * v[4] + v[5] * v[5]);
2527
+ const matrix3dParsers = {
2528
+ x: 12,
2529
+ y: 13,
2530
+ z: 14,
2531
+ translateX: 12,
2532
+ translateY: 13,
2533
+ translateZ: 14,
2534
+ scaleX,
2535
+ scaleY,
2536
+ scale: (v) => (scaleX(v) + scaleY(v)) / 2,
2537
+ rotateX: (v) => rebaseAngle(radToDeg(Math.atan2(v[6], v[5]))),
2538
+ rotateY: (v) => rebaseAngle(radToDeg(Math.atan2(-v[2], v[0]))),
2539
+ rotateZ,
2540
+ rotate: rotateZ,
2541
+ skewX: (v) => radToDeg(Math.atan(v[4])),
2542
+ skewY: (v) => radToDeg(Math.atan(v[1])),
2543
+ skew: (v) => (Math.abs(v[1]) + Math.abs(v[4])) / 2,
2544
+ };
2545
+ function defaultTransformValue(name) {
2546
+ return name.includes("scale") ? 1 : 0;
2547
+ }
2548
+ function parseValueFromTransform(transform, name) {
2549
+ if (!transform || transform === "none") {
2550
+ return defaultTransformValue(name);
2507
2551
  }
2508
- else {
2509
- const matrix = transform.match(/^matrix\((.+)\)$/u);
2510
- if (matrix) {
2511
- return getPosFromMatrix(matrix[1], pos2);
2512
- }
2513
- else {
2514
- return 0;
2515
- }
2552
+ const matrix3dMatch = transform.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);
2553
+ let parsers;
2554
+ let match;
2555
+ if (matrix3dMatch) {
2556
+ parsers = matrix3dParsers;
2557
+ match = matrix3dMatch;
2516
2558
  }
2559
+ else {
2560
+ const matrix2dMatch = transform.match(/^matrix\(([-\d.e\s,]+)\)$/u);
2561
+ parsers = matrix2dParsers;
2562
+ match = matrix2dMatch;
2563
+ }
2564
+ if (!match) {
2565
+ return defaultTransformValue(name);
2566
+ }
2567
+ const valueParser = parsers[name];
2568
+ const values = match[1].split(",").map(convertTransformToNumber);
2569
+ return typeof valueParser === "function"
2570
+ ? valueParser(values)
2571
+ : values[valueParser];
2572
+ }
2573
+ const readTransformValue = (instance, name) => {
2574
+ const { transform = "none" } = getComputedStyle(instance);
2575
+ return parseValueFromTransform(transform, name);
2517
2576
  };
2577
+ function convertTransformToNumber(value) {
2578
+ return parseFloat(value.trim());
2579
+ }
2580
+
2581
+ const isNumOrPxType = (v) => v === number || v === px;
2518
2582
  const transformKeys = new Set(["x", "y", "z"]);
2519
2583
  const nonTranslationalTransformKeys = transformPropOrder.filter((key) => !transformKeys.has(key));
2520
2584
  function removeNonTranslationalTransform(visualElement) {
@@ -2537,8 +2601,8 @@
2537
2601
  bottom: ({ y }, { top }) => parseFloat(top) + (y.max - y.min),
2538
2602
  right: ({ x }, { left }) => parseFloat(left) + (x.max - x.min),
2539
2603
  // Transform
2540
- x: getTranslateFromMatrix(4, 13),
2541
- y: getTranslateFromMatrix(5, 14),
2604
+ x: (_bbox, { transform }) => parseValueFromTransform(transform, "x"),
2605
+ y: (_bbox, { transform }) => parseValueFromTransform(transform, "y"),
2542
2606
  };
2543
2607
  // Alias translate longform names
2544
2608
  positionalValues.translateX = positionalValues.x;
@@ -4572,7 +4636,7 @@
4572
4636
  * and warn against mismatches.
4573
4637
  */
4574
4638
  {
4575
- warnOnce(nextValue.version === "12.4.11", `Attempting to mix Motion versions ${nextValue.version} with 12.4.11 may not work as expected.`);
4639
+ warnOnce(nextValue.version === "12.4.13", `Attempting to mix Motion versions ${nextValue.version} with 12.4.13 may not work as expected.`);
4576
4640
  }
4577
4641
  }
4578
4642
  else if (isMotionValue(prevValue)) {
@@ -5512,8 +5576,7 @@
5512
5576
  }
5513
5577
  readValueFromInstance(instance, key) {
5514
5578
  if (transformProps.has(key)) {
5515
- const defaultType = getDefaultValueType(key);
5516
- return defaultType ? defaultType.default || 0 : 0;
5579
+ return readTransformValue(instance, key);
5517
5580
  }
5518
5581
  else {
5519
5582
  const computedStyle = getComputedStyle$1(instance);
package/dist/motion.js CHANGED
@@ -1 +1 @@
1
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Motion={})}(this,(function(t){"use strict";const e=t=>t;let n=e;function s(t){let e;return()=>(void 0===e&&(e=t()),e)}const i=(t,e,n)=>{const s=e-t;return 0===s?1:(n-t)/s},r=t=>1e3*t,o=t=>t/1e3,a=s(()=>void 0!==window.ScrollTimeline);class l extends class{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>"finished"in t?t.finished:t))}getAll(t){return this.animations[0][t]}setAll(t,e){for(let n=0;n<this.animations.length;n++)this.animations[n][t]=e}attachTimeline(t,e){const n=this.animations.map(n=>a()&&n.attachTimeline?n.attachTimeline(t):"function"==typeof e?e(n):void 0);return()=>{n.forEach((t,e)=>{t&&t(),this.animations[e].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let e=0;e<this.animations.length;e++)t=Math.max(t,this.animations[e].duration);return t}runAll(t){this.animations.forEach(e=>e[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}{then(t,e){return Promise.all(this.animations).then(t).catch(e)}}function u(t,e){return t?t[e]||t.default||t:void 0}function c(t){let e=0;let n=t.next(e);for(;!n.done&&e<2e4;)e+=50,n=t.next(e);return e>=2e4?1/0:e}function h(t,e=100,n){const s=n({...t,keyframes:[0,e]}),i=Math.min(c(s),2e4);return{type:"keyframes",ease:t=>s.next(i*t).value/e,duration:o(i)}}function d(t){return"function"==typeof t}function p(t,e){t.timeline=e,t.onfinish=null}const f=t=>Array.isArray(t)&&"number"==typeof t[0],m={linearEasing:void 0};function g(t,e){const n=s(t);return()=>{var t;return null!==(t=m[e])&&void 0!==t?t:n()}}const v=g(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),y=(t,e,n=10)=>{let s="";const r=Math.max(Math.round(e/n),2);for(let e=0;e<r;e++)s+=t(i(0,r-1,e))+", ";return`linear(${s.substring(0,s.length-2)})`};function w(t){return Boolean("function"==typeof t&&v()||!t||"string"==typeof t&&(t in T||v())||f(t)||Array.isArray(t)&&t.every(w))}const b=([t,e,n,s])=>`cubic-bezier(${t}, ${e}, ${n}, ${s})`,T={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:b([0,.65,.55,1]),circOut:b([.55,0,1,.45]),backIn:b([.31,.01,.66,-.59]),backOut:b([.33,1.53,.69,.99])};const x=!1,S=!1;function A(){return x||S}function V(t,e,n){var s;if(t instanceof EventTarget)return[t];if("string"==typeof t){let i=document;e&&(i=e.current);const r=null!==(s=null==n?void 0:n[t])&&void 0!==s?s:i.querySelectorAll(t);return r?Array.from(r):[]}return Array.from(t)}function M(t,e){const n=V(t),s=new AbortController;return[n,{passive:!0,...e,signal:s.signal},()=>s.abort()]}function P(t){return!("touch"===t.pointerType||A())}function k(t,e){const n=e+"PointerCapture";if(t.target instanceof Element&&n in t.target&&void 0!==t.pointerId)try{t.target[n](t.pointerId)}catch(t){}}const E=(t,e)=>!!e&&(t===e||E(t,e.parentElement)),F=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);const C=new WeakSet;function O(t){return e=>{"Enter"===e.key&&t(e)}}function B(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}function I(t){return(t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary)(t)&&!A()}const L=(t,e,n)=>n>e?e:n<t?t:n;function R(t,e){return e?t*(1e3/e):0}function D(t,e,n){const s=Math.max(e-5,0);return R(n-t(s),e-s)}const W=100,N=10,K=1,j=0,z=800,U=.3,$=.3,H={granular:.01,default:2},Y={granular:.005,default:.5},X=.01,q=10,G=.05,Z=1;function _({duration:t=z,bounce:e=U,velocity:n=j,mass:s=K}){let i,a,l=1-e;l=L(G,Z,l),t=L(X,q,o(t)),l<1?(i=e=>{const s=e*l,i=s*t;return.001-(s-n)/J(e,l)*Math.exp(-i)},a=e=>{const s=e*l*t,r=s*n+n,o=Math.pow(l,2)*Math.pow(e,2)*t,a=Math.exp(-s),u=J(Math.pow(e,2),l);return(.001-i(e)>0?-1:1)*((r-o)*a)/u}):(i=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,a=e=>Math.exp(-e*t)*(t*t*(n-e)));const u=function(t,e,n){let s=n;for(let n=1;n<12;n++)s-=t(s)/e(s);return s}(i,a,5/t);if(t=r(t),isNaN(u))return{stiffness:W,damping:N,duration:t};{const e=Math.pow(u,2)*s;return{stiffness:e,damping:2*l*Math.sqrt(s*e),duration:t}}}function J(t,e){return t*Math.sqrt(1-e*e)}const Q=["duration","bounce"],tt=["stiffness","damping","mass"];function et(t,e){return e.some(e=>void 0!==t[e])}function nt(t=$,e=U){const n="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:s,restDelta:i}=n;const a=n.keyframes[0],l=n.keyframes[n.keyframes.length-1],u={done:!1,value:a},{stiffness:h,damping:d,mass:p,duration:f,velocity:m,isResolvedFromDuration:g}=function(t){let e={velocity:j,stiffness:W,damping:N,mass:K,isResolvedFromDuration:!1,...t};if(!et(t,tt)&&et(t,Q))if(t.visualDuration){const n=t.visualDuration,s=2*Math.PI/(1.2*n),i=s*s,r=2*L(.05,1,1-(t.bounce||0))*Math.sqrt(i);e={...e,mass:K,stiffness:i,damping:r}}else{const n=_(t);e={...e,...n,mass:K},e.isResolvedFromDuration=!0}return e}({...n,velocity:-o(n.velocity||0)}),v=m||0,w=d/(2*Math.sqrt(h*p)),b=l-a,T=o(Math.sqrt(h/p)),x=Math.abs(b)<5;let S;if(s||(s=x?H.granular:H.default),i||(i=x?Y.granular:Y.default),w<1){const t=J(T,w);S=e=>{const n=Math.exp(-w*T*e);return l-n*((v+w*T*b)/t*Math.sin(t*e)+b*Math.cos(t*e))}}else if(1===w)S=t=>l-Math.exp(-T*t)*(b+(v+T*b)*t);else{const t=T*Math.sqrt(w*w-1);S=e=>{const n=Math.exp(-w*T*e),s=Math.min(t*e,300);return l-n*((v+w*T*b)*Math.sinh(s)+t*b*Math.cosh(s))/t}}const A={calculatedDuration:g&&f||null,next:t=>{const e=S(t);if(g)u.done=t>=f;else{let n=0;w<1&&(n=0===t?r(v):D(S,t,e));const o=Math.abs(n)<=s,a=Math.abs(l-e)<=i;u.done=o&&a}return u.value=u.done?l:e,u},toString:()=>{const t=Math.min(c(A),2e4),e=y(e=>A.next(t*e).value,t,30);return t+"ms "+e}};return A}const st=(t,e,n)=>{const s=e-t;return((n-t)%s+s)%s+t},it=t=>Array.isArray(t)&&"number"!=typeof t[0];function rt(t,e){return it(t)?t[st(0,t.length,e)]:t}const ot=(t,e,n)=>t+(e-t)*n;function at(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const r=i(0,e,s);t.push(ot(n,1,r))}}function lt(t){const e=[0];return at(e,t.length-1),e}const ut=t=>Boolean(t&&t.getVelocity);function ct(t){return"object"==typeof t&&!Array.isArray(t)}function ht(t,e,n,s){return"string"==typeof t&&ct(e)?V(t,n,s):t instanceof NodeList?Array.from(t):Array.isArray(t)?t:[t]}function dt(t,e,n){return t*(e+1)}function pt(t,e,n,s){var i;return"number"==typeof e?e:e.startsWith("-")||e.startsWith("+")?Math.max(0,t+parseFloat(e)):"<"===e?n:null!==(i=s.get(e))&&void 0!==i?i:t}function ft(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}function mt(t,e,n,s,i,r){!function(t,e,n){for(let s=0;s<t.length;s++){const i=t[s];i.at>e&&i.at<n&&(ft(t,i),s--)}}(t,i,r);for(let o=0;o<e.length;o++)t.push({value:e[o],at:ot(i,r,s[o]),easing:rt(n,o)})}function gt(t,e){for(let n=0;n<t.length;n++)t[n]=t[n]/(e+1)}function vt(t,e){return t.at===e.at?null===t.value?1:null===e.value?-1:0:t.at-e.at}function yt(t,e){return!e.has(t)&&e.set(t,{}),e.get(t)}function wt(t,e){return e[t]||(e[t]=[]),e[t]}function bt(t){return Array.isArray(t)?t:[t]}function Tt(t,e){return t&&t[e]?{...t,...t[e]}:{...t}}const xt=t=>"number"==typeof t,St=t=>t.every(xt),At=new WeakMap,Vt=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Mt=new Set(Vt),Pt=new Set(["width","height","top","left","right","bottom",...Vt]),kt=t=>(t=>Array.isArray(t))(t)?t[t.length-1]||0:t,Et=!1,Ft=["read","resolveKeyframes","update","preRender","render","postRender"],Ct={value:null,addProjectionMetrics:null};const{schedule:Ot,cancel:Bt,state:It,steps:Lt}=function(t,e){let n=!1,s=!0;const i={delta:0,timestamp:0,isProcessing:!1},r=()=>n=!0,o=Ft.reduce((t,n)=>(t[n]=function(t,e){let n=new Set,s=new Set,i=!1,r=!1;const o=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1},l=0;function u(e){o.has(e)&&(c.schedule(e),t()),l++,e(a)}const c={schedule:(t,e=!1,r=!1)=>{const a=r&&i?n:s;return e&&o.add(t),a.has(t)||a.add(t),t},cancel:t=>{s.delete(t),o.delete(t)},process:t=>{a=t,i?r=!0:(i=!0,[n,s]=[s,n],n.forEach(u),e&&Ct.value&&Ct.value.frameloop[e].push(l),l=0,n.clear(),i=!1,r&&(r=!1,c.process(t)))}};return c}(r,e?n:void 0),t),{}),{read:a,resolveKeyframes:l,update:u,preRender:c,render:h,postRender:d}=o,p=()=>{const r=performance.now();n=!1,i.delta=s?1e3/60:Math.max(Math.min(r-i.timestamp,40),1),i.timestamp=r,i.isProcessing=!0,a.process(i),l.process(i),u.process(i),c.process(i),h.process(i),d.process(i),i.isProcessing=!1,n&&e&&(s=!1,t(p))};return{schedule:Ft.reduce((e,r)=>{const a=o[r];return e[r]=(e,r=!1,o=!1)=>(n||(n=!0,s=!0,i.isProcessing||t(p)),a.schedule(e,r,o)),e},{}),cancel:t=>{for(let e=0;e<Ft.length;e++)o[Ft[e]].cancel(t)},state:i,steps:o}}("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:e,!0);let Rt;function Dt(){Rt=void 0}const Wt={now:()=>(void 0===Rt&&Wt.set(It.isProcessing||Et?It.timestamp:performance.now()),Rt),set:t=>{Rt=t,queueMicrotask(Dt)}};class Nt{constructor(){this.subscriptions=[]}add(t){var e,n;return e=this.subscriptions,n=t,-1===e.indexOf(n)&&e.push(n),()=>ft(this.subscriptions,t)}notify(t,e,n){const s=this.subscriptions.length;if(s)if(1===s)this.subscriptions[0](t,e,n);else for(let i=0;i<s;i++){const s=this.subscriptions[i];s&&s(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}class Kt{constructor(t,e={}){this.version="12.4.11",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(t,e=!0)=>{const n=Wt.now();this.updatedAt!==n&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),e&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=Wt.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e))))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new Nt);const n=this.events[t].add(e);return"change"===t?()=>{n(),Ot.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t,e=!0){e&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,e)}setWithVelocity(t,e,n){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=Wt.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return R(parseFloat(this.current)-parseFloat(this.prevFrameValue),e)}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function jt(t,e){return new Kt(t,e)}function zt(t){const e=[{},{}];return null==t||t.values.forEach((t,n)=>{e[0][n]=t.get(),e[1][n]=t.getVelocity()}),e}function Ut(t,e,n,s){if("function"==typeof e){const[i,r]=zt(s);e=e(void 0!==n?n:t.custom,i,r)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){const[i,r]=zt(s);e=e(void 0!==n?n:t.custom,i,r)}return e}function $t(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,jt(n))}function Ht(t,e){const n=function(t,e,n){const s=t.getProps();return Ut(s,e,void 0!==n?n:s.custom,t)}(t,e);let{transitionEnd:s={},transition:i={},...r}=n||{};r={...r,...s};for(const e in r){$t(t,e,kt(r[e]))}}function Yt(t,e){const n=t.getValue("willChange");if(s=n,Boolean(ut(s)&&s.add))return n.add(e);var s}const Xt=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),qt="data-"+Xt("framerAppearId");function Gt(t){return t.props[qt]}const Zt=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function _t(t,n,s,i){if(t===n&&s===i)return e;const r=e=>function(t,e,n,s,i){let r,o,a=0;do{o=e+(n-e)/2,r=Zt(o,s,i)-t,r>0?n=o:e=o}while(Math.abs(r)>1e-7&&++a<12);return o}(e,0,1,t,s);return t=>0===t||1===t?t:Zt(r(t),n,i)}const Jt=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Qt=t=>e=>1-t(1-e),te=_t(.33,1.53,.69,.99),ee=Qt(te),ne=Jt(ee),se=t=>(t*=2)<1?.5*ee(t):.5*(2-Math.pow(2,-10*(t-1))),ie=t=>1-Math.sin(Math.acos(t)),re=Qt(ie),oe=Jt(ie),ae=t=>/^0[^.\s]+$/u.test(t);const le={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},ue={...le,transform:t=>L(0,1,t)},ce={...le,default:1},he=t=>Math.round(1e5*t)/1e5,de=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const pe=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,fe=(t,e)=>n=>Boolean("string"==typeof n&&pe.test(n)&&n.startsWith(t)||e&&!function(t){return null==t}(n)&&Object.prototype.hasOwnProperty.call(n,e)),me=(t,e,n)=>s=>{if("string"!=typeof s)return s;const[i,r,o,a]=s.match(de);return{[t]:parseFloat(i),[e]:parseFloat(r),[n]:parseFloat(o),alpha:void 0!==a?parseFloat(a):1}},ge={...le,transform:t=>Math.round((t=>L(0,255,t))(t))},ve={test:fe("rgb","red"),parse:me("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:s=1})=>"rgba("+ge.transform(t)+", "+ge.transform(e)+", "+ge.transform(n)+", "+he(ue.transform(s))+")"};const ye={test:fe("#"),parse:function(t){let e="",n="",s="",i="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),s=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),s=t.substring(3,4),i=t.substring(4,5),e+=e,n+=n,s+=s,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:i?parseInt(i,16)/255:1}},transform:ve.transform},we=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),be=we("deg"),Te=we("%"),xe=we("px"),Se=we("vh"),Ae=we("vw"),Ve={...Te,parse:t=>Te.parse(t)/100,transform:t=>Te.transform(100*t)},Me={test:fe("hsl","hue"),parse:me("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:s=1})=>"hsla("+Math.round(t)+", "+Te.transform(he(e))+", "+Te.transform(he(n))+", "+he(ue.transform(s))+")"},Pe={test:t=>ve.test(t)||ye.test(t)||Me.test(t),parse:t=>ve.test(t)?ve.parse(t):Me.test(t)?Me.parse(t):ye.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?ve.transform(t):Me.transform(t)},ke=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const Ee=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Fe(t){const e=t.toString(),n=[],s={color:[],number:[],var:[]},i=[];let r=0;const o=e.replace(Ee,t=>(Pe.test(t)?(s.color.push(r),i.push("color"),n.push(Pe.parse(t))):t.startsWith("var(")?(s.var.push(r),i.push("var"),n.push(t)):(s.number.push(r),i.push("number"),n.push(parseFloat(t))),++r,"${}")).split("${}");return{values:n,split:o,indexes:s,types:i}}function Ce(t){return Fe(t).values}function Oe(t){const{split:e,types:n}=Fe(t),s=e.length;return t=>{let i="";for(let r=0;r<s;r++)if(i+=e[r],void 0!==t[r]){const e=n[r];i+="number"===e?he(t[r]):"color"===e?Pe.transform(t[r]):t[r]}return i}}const Be=t=>"number"==typeof t?0:t;const Ie={test:function(t){var e,n;return isNaN(t)&&"string"==typeof t&&((null===(e=t.match(de))||void 0===e?void 0:e.length)||0)+((null===(n=t.match(ke))||void 0===n?void 0:n.length)||0)>0},parse:Ce,createTransformer:Oe,getAnimatableNone:function(t){const e=Ce(t);return Oe(t)(e.map(Be))}},Le=new Set(["brightness","contrast","saturate","opacity"]);function Re(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[s]=n.match(de)||[];if(!s)return t;const i=n.replace(s,"");let r=Le.has(e)?1:0;return s!==n&&(r*=100),e+"("+r+i+")"}const De=/\b([a-z-]*)\(.*?\)/gu,We={...Ie,getAnimatableNone:t=>{const e=t.match(De);return e?e.map(Re).join(" "):t}},Ne={borderWidth:xe,borderTopWidth:xe,borderRightWidth:xe,borderBottomWidth:xe,borderLeftWidth:xe,borderRadius:xe,radius:xe,borderTopLeftRadius:xe,borderTopRightRadius:xe,borderBottomRightRadius:xe,borderBottomLeftRadius:xe,width:xe,maxWidth:xe,height:xe,maxHeight:xe,top:xe,right:xe,bottom:xe,left:xe,padding:xe,paddingTop:xe,paddingRight:xe,paddingBottom:xe,paddingLeft:xe,margin:xe,marginTop:xe,marginRight:xe,marginBottom:xe,marginLeft:xe,backgroundPositionX:xe,backgroundPositionY:xe},Ke={rotate:be,rotateX:be,rotateY:be,rotateZ:be,scale:ce,scaleX:ce,scaleY:ce,scaleZ:ce,skew:be,skewX:be,skewY:be,distance:xe,translateX:xe,translateY:xe,translateZ:xe,x:xe,y:xe,z:xe,perspective:xe,transformPerspective:xe,opacity:ue,originX:Ve,originY:Ve,originZ:xe},je={...le,transform:Math.round},ze={...Ne,...Ke,zIndex:je,size:xe,fillOpacity:ue,strokeOpacity:ue,numOctaves:je},Ue={...ze,color:Pe,backgroundColor:Pe,outlineColor:Pe,fill:Pe,stroke:Pe,borderColor:Pe,borderTopColor:Pe,borderRightColor:Pe,borderBottomColor:Pe,borderLeftColor:Pe,filter:We,WebkitFilter:We},$e=t=>Ue[t];function He(t,e){let n=$e(t);return n!==We&&(n=Ie),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const Ye=new Set(["auto","none","0"]);const Xe=t=>t===le||t===xe,qe=(t,e)=>parseFloat(t.split(", ")[e]),Ge=(t,e)=>(n,{transform:s})=>{if("none"===s||!s)return 0;const i=s.match(/^matrix3d\((.+)\)$/u);if(i)return qe(i[1],e);{const e=s.match(/^matrix\((.+)\)$/u);return e?qe(e[1],t):0}},Ze=new Set(["x","y","z"]),_e=Vt.filter(t=>!Ze.has(t));const Je={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:Ge(4,13),y:Ge(5,14)};Je.translateX=Je.x,Je.translateY=Je.y;const Qe=new Set;let tn=!1,en=!1;function nn(){if(en){const t=Array.from(Qe).filter(t=>t.needsMeasurement),e=new Set(t.map(t=>t.element)),n=new Map;e.forEach(t=>{const e=function(t){const e=[];return _e.forEach(n=>{const s=t.getValue(n);void 0!==s&&(e.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),e}(t);e.length&&(n.set(t,e),t.render())}),t.forEach(t=>t.measureInitialState()),e.forEach(t=>{t.render();const e=n.get(t);e&&e.forEach(([e,n])=>{var s;null===(s=t.getValue(e))||void 0===s||s.set(n)})}),t.forEach(t=>t.measureEndState()),t.forEach(t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)})}en=!1,tn=!1,Qe.forEach(t=>t.complete()),Qe.clear()}function sn(){Qe.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(en=!0)})}class rn{constructor(t,e,n,s,i,r=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=n,this.motionValue=s,this.element=i,this.isAsync=r}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Qe.add(this),tn||(tn=!0,Ot.read(sn),Ot.resolveKeyframes(nn))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:n,motionValue:s}=this;for(let i=0;i<t.length;i++)if(null===t[i])if(0===i){const i=null==s?void 0:s.get(),r=t[t.length-1];if(void 0!==i)t[0]=i;else if(n&&e){const s=n.readValue(e,r);null!=s&&(t[0]=s)}void 0===t[0]&&(t[0]=r),s&&void 0===i&&s.set(t[0])}else t[i]=t[i-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),Qe.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Qe.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const on=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),an=t=>e=>"string"==typeof e&&e.startsWith(t),ln=an("--"),un=an("var(--"),cn=t=>!!un(t)&&hn.test(t.split("/*")[0].trim()),hn=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,dn=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function pn(t,e,n=1){const[s,i]=function(t){const e=dn.exec(t);if(!e)return[,];const[,n,s,i]=e;return["--"+(null!=n?n:s),i]}(t);if(!s)return;const r=window.getComputedStyle(e).getPropertyValue(s);if(r){const t=r.trim();return on(t)?parseFloat(t):t}return cn(i)?pn(i,e,n+1):i}const fn=t=>e=>e.test(t),mn=[le,xe,Te,be,Ae,Se,{test:t=>"auto"===t,parse:t=>t}],gn=t=>mn.find(fn(t));class vn extends rn{constructor(t,e,n,s,i){super(t,e,n,s,i,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:n}=this;if(!e||!e.current)return;super.readKeyframes();for(let n=0;n<t.length;n++){let s=t[n];if("string"==typeof s&&(s=s.trim(),cn(s))){const i=pn(s,e.current);void 0!==i&&(t[n]=i),n===t.length-1&&(this.finalKeyframe=s)}}if(this.resolveNoneKeyframes(),!Pt.has(n)||2!==t.length)return;const[s,i]=t,r=gn(s),o=gn(i);if(r!==o)if(Xe(r)&&Xe(o))for(let e=0;e<t.length;e++){const n=t[e];"string"==typeof n&&(t[e]=parseFloat(n))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:e}=this,n=[];for(let e=0;e<t.length;e++)("number"==typeof(s=t[e])?0===s:null===s||"none"===s||"0"===s||ae(s))&&n.push(e);var s;n.length&&function(t,e,n){let s=0,i=void 0;for(;s<t.length&&!i;){const e=t[s];"string"==typeof e&&!Ye.has(e)&&Fe(e).values.length&&(i=t[s]),s++}if(i&&n)for(const s of e)t[s]=He(n,i)}(t,n,e)}measureInitialState(){const{element:t,unresolvedKeyframes:e,name:n}=this;if(!t||!t.current)return;"height"===n&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Je[n](t.measureViewportBox(),window.getComputedStyle(t.current)),e[0]=this.measuredOrigin;const s=e[e.length-1];void 0!==s&&t.getValue(n,s).jump(s,!1)}measureEndState(){var t;const{element:e,name:n,unresolvedKeyframes:s}=this;if(!e||!e.current)return;const i=e.getValue(n);i&&i.jump(this.measuredOrigin,!1);const r=s.length-1,o=s[r];s[r]=Je[n](e.measureViewportBox(),window.getComputedStyle(e.current)),null!==o&&void 0===this.finalKeyframe&&(this.finalKeyframe=o),(null===(t=this.removedTransforms)||void 0===t?void 0:t.length)&&this.removedTransforms.forEach(([t,n])=>{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}}const yn=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!Ie.test(t)&&"0"!==t||t.startsWith("url(")));function wn(t,e,n,s){const i=t[0];if(null===i)return!1;if("display"===e||"visibility"===e)return!0;const r=t[t.length-1],o=yn(i,e),a=yn(r,e);return!(!o||!a)&&(function(t){const e=t[0];if(1===t.length)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}(t)||("spring"===n||d(n))&&s)}const bn=t=>null!==t;function Tn(t,{repeat:e,repeatType:n="loop"},s){const i=t.filter(bn),r=e&&"loop"!==n&&e%2==1?0:i.length-1;return r&&void 0!==s?s:i[r]}class xn{constructor({autoplay:t=!0,delay:e=0,type:n="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:r="loop",...o}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=Wt.now(),this.options={autoplay:t,delay:e,type:n,repeat:s,repeatDelay:i,repeatType:r,...o},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt}get resolved(){return this._resolved||this.hasAttemptedResolve||(sn(),nn()),this._resolved}onKeyframesResolved(t,e){this.resolvedAt=Wt.now(),this.hasAttemptedResolve=!0;const{name:n,type:s,velocity:i,delay:r,onComplete:o,onUpdate:a,isGenerator:l}=this.options;if(!l&&!wn(t,n,s,i)){if(!r)return a&&a(Tn(t,this.options,e)),o&&o(),void this.resolveFinishedPromise();this.options.duration=0}const u=this.initPlayback(t,e);!1!==u&&(this._resolved={keyframes:t,finalKeyframe:e,...u},this.onPostResolved())}onPostResolved(){}then(t,e){return this.currentFinishedPromise.then(t,e)}flatten(){this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear")}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}function Sn(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function An(t,e){return n=>n>0?e:t}const Vn=(t,e,n)=>{const s=t*t,i=n*(e*e-s)+s;return i<0?0:Math.sqrt(i)},Mn=[ye,ve,Me];function Pn(t){const e=(n=t,Mn.find(t=>t.test(n)));var n;if(!Boolean(e))return!1;let s=e.parse(t);return e===Me&&(s=function({hue:t,saturation:e,lightness:n,alpha:s}){t/=360,n/=100;let i=0,r=0,o=0;if(e/=100){const s=n<.5?n*(1+e):n+e-n*e,a=2*n-s;i=Sn(a,s,t+1/3),r=Sn(a,s,t),o=Sn(a,s,t-1/3)}else i=r=o=n;return{red:Math.round(255*i),green:Math.round(255*r),blue:Math.round(255*o),alpha:s}}(s)),s}const kn=(t,e)=>{const n=Pn(t),s=Pn(e);if(!n||!s)return An(t,e);const i={...n};return t=>(i.red=Vn(n.red,s.red,t),i.green=Vn(n.green,s.green,t),i.blue=Vn(n.blue,s.blue,t),i.alpha=ot(n.alpha,s.alpha,t),ve.transform(i))},En=(t,e)=>n=>e(t(n)),Fn=(...t)=>t.reduce(En),Cn=new Set(["none","hidden"]);function On(t,e){return n=>ot(t,e,n)}function Bn(t){return"number"==typeof t?On:"string"==typeof t?cn(t)?An:Pe.test(t)?kn:Rn:Array.isArray(t)?In:"object"==typeof t?Pe.test(t)?kn:Ln:An}function In(t,e){const n=[...t],s=n.length,i=t.map((t,n)=>Bn(t)(t,e[n]));return t=>{for(let e=0;e<s;e++)n[e]=i[e](t);return n}}function Ln(t,e){const n={...t,...e},s={};for(const i in n)void 0!==t[i]&&void 0!==e[i]&&(s[i]=Bn(t[i])(t[i],e[i]));return t=>{for(const e in s)n[e]=s[e](t);return n}}const Rn=(t,e)=>{const n=Ie.createTransformer(e),s=Fe(t),i=Fe(e);return s.indexes.var.length===i.indexes.var.length&&s.indexes.color.length===i.indexes.color.length&&s.indexes.number.length>=i.indexes.number.length?Cn.has(t)&&!i.values.length||Cn.has(e)&&!s.values.length?function(t,e){return Cn.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}(t,e):Fn(In(function(t,e){var n;const s=[],i={color:0,var:0,number:0};for(let r=0;r<e.values.length;r++){const o=e.types[r],a=t.indexes[o][i[o]],l=null!==(n=t.values[a])&&void 0!==n?n:0;s[r]=l,i[o]++}return s}(s,i),i.values),n):An(t,e)};function Dn(t,e,n){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n)return ot(t,e,n);return Bn(t)(t,e)}function Wn({keyframes:t,velocity:e=0,power:n=.8,timeConstant:s=325,bounceDamping:i=10,bounceStiffness:r=500,modifyTarget:o,min:a,max:l,restDelta:u=.5,restSpeed:c}){const h=t[0],d={done:!1,value:h},p=t=>void 0===a?l:void 0===l||Math.abs(a-t)<Math.abs(l-t)?a:l;let f=n*e;const m=h+f,g=void 0===o?m:o(m);g!==m&&(f=g-h);const v=t=>-f*Math.exp(-t/s),y=t=>g+v(t),w=t=>{const e=v(t),n=y(t);d.done=Math.abs(e)<=u,d.value=d.done?g:n};let b,T;const x=t=>{var e;(e=d.value,void 0!==a&&e<a||void 0!==l&&e>l)&&(b=t,T=nt({keyframes:[d.value,p(d.value)],velocity:D(y,t,d.value),damping:i,stiffness:r,restDelta:u,restSpeed:c}))};return x(0),{calculatedDuration:null,next:t=>{let e=!1;return T||void 0!==b||(e=!0,w(t),x(t)),void 0!==b&&t>=b?T.next(t-b):(!e&&w(t),d)}}}const Nn=_t(.42,0,1,1),Kn=_t(0,0,.58,1),jn=_t(.42,0,.58,1),zn={linear:e,easeIn:Nn,easeInOut:jn,easeOut:Kn,circIn:ie,circInOut:oe,circOut:re,backIn:ee,backInOut:ne,backOut:te,anticipate:se},Un=t=>{if(f(t)){n(4===t.length);const[e,s,i,r]=t;return _t(e,s,i,r)}return"string"==typeof t?zn[t]:t};function $n(t,s,{clamp:r=!0,ease:o,mixer:a}={}){const l=t.length;if(n(l===s.length),1===l)return()=>s[0];if(2===l&&s[0]===s[1])return()=>s[1];const u=t[0]===t[1];t[0]>t[l-1]&&(t=[...t].reverse(),s=[...s].reverse());const c=function(t,n,s){const i=[],r=s||Dn,o=t.length-1;for(let s=0;s<o;s++){let o=r(t[s],t[s+1]);if(n){const t=Array.isArray(n)?n[s]||e:n;o=Fn(t,o)}i.push(o)}return i}(s,o,a),h=c.length,d=e=>{if(u&&e<t[0])return s[0];let n=0;if(h>1)for(;n<t.length-2&&!(e<t[n+1]);n++);const r=i(t[n],t[n+1],e);return c[n](r)};return r?e=>d(L(t[0],t[l-1],e)):d}function Hn({duration:t=300,keyframes:e,times:n,ease:s="easeInOut"}){const i=it(s)?s.map(Un):Un(s),r={done:!1,value:e[0]},o=$n(function(t,e){return t.map(t=>t*e)}(n&&n.length===e.length?n:lt(e),t),e,{ease:Array.isArray(i)?i:(a=e,l=i,a.map(()=>l||jn).splice(0,a.length-1))});var a,l;return{calculatedDuration:t,next:e=>(r.value=o(e),r.done=e>=t,r)}}const Yn=t=>{const e=({timestamp:e})=>t(e);return{start:()=>Ot.update(e,!0),stop:()=>Bt(e),now:()=>It.isProcessing?It.timestamp:Wt.now()}},Xn={decay:Wn,inertia:Wn,tween:Hn,keyframes:Hn,spring:nt},qn=t=>t/100;class Gn extends xn{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.teardown();const{onStop:t}=this.options;t&&t()};const{name:e,motionValue:n,element:s,keyframes:i}=this.options,r=(null==s?void 0:s.KeyframeResolver)||rn;this.resolver=new r(i,(t,e)=>this.onKeyframesResolved(t,e),e,n,s),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:e="keyframes",repeat:n=0,repeatDelay:s=0,repeatType:i,velocity:r=0}=this.options,o=d(e)?e:Xn[e]||Hn;let a,l;o!==Hn&&"number"!=typeof t[0]&&(a=Fn(qn,Dn(t[0],t[1])),t=[0,100]);const u=o({...this.options,keyframes:t});"mirror"===i&&(l=o({...this.options,keyframes:[...t].reverse(),velocity:-r})),null===u.calculatedDuration&&(u.calculatedDuration=c(u));const{calculatedDuration:h}=u,p=h+s;return{generator:u,mirroredGenerator:l,mapPercentToKeyframes:a,calculatedDuration:h,resolvedDuration:p,totalDuration:p*(n+1)-s}}onPostResolved(){const{autoplay:t=!0}=this.options;this.play(),"paused"!==this.pendingPlayState&&t?this.state=this.pendingPlayState:this.pause()}tick(t,e=!1){const{resolved:n}=this;if(!n){const{keyframes:t}=this.options;return{done:!0,value:t[t.length-1]}}const{finalKeyframe:s,generator:i,mirroredGenerator:r,mapPercentToKeyframes:o,keyframes:a,calculatedDuration:l,totalDuration:u,resolvedDuration:c}=n;if(null===this.startTime)return i.next(0);const{delay:h,repeat:d,repeatType:p,repeatDelay:f,onUpdate:m}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-u/this.speed,this.startTime)),e?this.currentTime=t:null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const g=this.currentTime-h*(this.speed>=0?1:-1),v=this.speed>=0?g<0:g>u;this.currentTime=Math.max(g,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=u);let y=this.currentTime,w=i;if(d){const t=Math.min(this.currentTime,u)/c;let e=Math.floor(t),n=t%1;!n&&t>=1&&(n=1),1===n&&e--,e=Math.min(e,d+1);Boolean(e%2)&&("reverse"===p?(n=1-n,f&&(n-=f/c)):"mirror"===p&&(w=r)),y=L(0,1,n)*c}const b=v?{done:!1,value:a[0]}:w.next(y);o&&(b.value=o(b.value));let{done:T}=b;v||null===l||(T=this.speed>=0?this.currentTime>=u:this.currentTime<=0);const x=null===this.holdTime&&("finished"===this.state||"running"===this.state&&T);return x&&void 0!==s&&(b.value=Tn(a,this.options,s)),m&&m(b.value),x&&this.finish(),b}get duration(){const{resolved:t}=this;return t?o(t.calculatedDuration):0}get time(){return o(this.currentTime)}set time(t){t=r(t),this.currentTime=t,null!==this.holdTime||0===this.speed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const e=this.playbackSpeed!==t;this.playbackSpeed=t,e&&(this.time=o(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved)return void(this.pendingPlayState="running");if(this.isStopped)return;const{driver:t=Yn,onPlay:e,startTime:n}=this.options;this.driver||(this.driver=t(t=>this.tick(t))),e&&e();const s=this.driver.now();null!==this.holdTime?this.startTime=s-this.holdTime:this.startTime?"finished"===this.state&&(this.startTime=s):this.startTime=null!=n?n:this.calcStartTime(),"finished"===this.state&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;this._resolved?(this.state="paused",this.holdTime=null!==(t=this.currentTime)&&void 0!==t?t:0):this.pendingPlayState="paused"}complete(){"running"!==this.state&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){null!==this.cancelTime&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}}const Zn=new Set(["opacity","clipPath","filter","transform"]);function _n(t,e,n,{delay:s=0,duration:i=300,repeat:r=0,repeatType:o="loop",ease:a="easeInOut",times:l}={}){const u={[e]:n};l&&(u.offset=l);const c=function t(e,n){return e?"function"==typeof e&&v()?y(e,n):f(e)?b(e):Array.isArray(e)?e.map(e=>t(e,n)||T.easeOut):T[e]:void 0}(a,i);Array.isArray(c)&&(u.easing=c);return t.animate(u,{delay:s,duration:i,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:r+1,direction:"reverse"===o?"alternate":"normal"})}const Jn=s(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));const Qn={anticipate:se,backInOut:ne,circInOut:oe};class ts extends xn{constructor(t){super(t);const{name:e,motionValue:n,element:s,keyframes:i}=this.options;this.resolver=new vn(i,(t,e)=>this.onKeyframesResolved(t,e),e,n,s),this.resolver.scheduleResolve()}initPlayback(t,e){let{duration:n=300,times:s,ease:i,type:r,motionValue:o,name:a,startTime:l}=this.options;if(!o.owner||!o.owner.current)return!1;var u;if("string"==typeof i&&v()&&i in Qn&&(i=Qn[i]),d((u=this.options).type)||"spring"===u.type||!w(u.ease)){const{onComplete:e,onUpdate:o,motionValue:a,element:l,...u}=this.options,c=function(t,e){const n=new Gn({...e,keyframes:t,repeat:0,delay:0,isGenerator:!0});let s={done:!1,value:t[0]};const i=[];let r=0;for(;!s.done&&r<2e4;)s=n.sample(r),i.push(s.value),r+=10;return{times:void 0,keyframes:i,duration:r-10,ease:"linear"}}(t,u);1===(t=c.keyframes).length&&(t[1]=t[0]),n=c.duration,s=c.times,i=c.ease,r="keyframes"}const c=_n(o.owner.current,a,t,{...this.options,duration:n,times:s,ease:i});return c.startTime=null!=l?l:this.calcStartTime(),this.pendingTimeline?(p(c,this.pendingTimeline),this.pendingTimeline=void 0):c.onfinish=()=>{const{onComplete:n}=this.options;o.set(Tn(t,this.options,e)),n&&n(),this.cancel(),this.resolveFinishedPromise()},{animation:c,duration:n,times:s,type:r,ease:i,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:e}=t;return o(e)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:e}=t;return o(e.currentTime||0)}set time(t){const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.currentTime=r(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:e}=t;return e.playbackRate}set speed(t){const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:e}=t;return e.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:e}=t;return e.startTime}attachTimeline(t){if(this._resolved){const{resolved:n}=this;if(!n)return e;const{animation:s}=n;p(s,t)}else this.pendingTimeline=t;return e}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:e}=t;"finished"===e.playState&&this.updateFinishedPromise(),e.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:e}=t;e.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:e,keyframes:n,duration:s,type:i,ease:o,times:a}=t;if("idle"===e.playState||"finished"===e.playState)return;if(this.time){const{motionValue:t,onUpdate:e,onComplete:l,element:u,...c}=this.options,h=new Gn({...c,keyframes:n,duration:s,type:i,ease:o,times:a,isGenerator:!0}),d=r(this.time);t.setWithVelocity(h.sample(d-10).value,h.sample(d).value,10)}const{onStop:l}=this.options;l&&l(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:e,name:n,repeatDelay:s,repeatType:i,damping:r,type:o}=t;if(!(e&&e.owner&&e.owner.current instanceof HTMLElement))return!1;const{onUpdate:a,transformTemplate:l}=e.owner.getProps();return Jn()&&n&&Zn.has(n)&&!a&&!l&&!s&&"mirror"!==i&&0!==r&&"inertia"!==o}}const es={type:"spring",stiffness:500,damping:25,restSpeed:10},ns={type:"keyframes",duration:.8},ss={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},is=(t,{keyframes:e})=>e.length>2?ns:Mt.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:es:ss;const rs=(t,e,n,s={},i,o)=>a=>{const c=u(s,t)||{},h=c.delay||s.delay||0;let{elapsed:d=0}=s;d-=r(h);let p={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...c,delay:-d,onUpdate:t=>{e.set(t),c.onUpdate&&c.onUpdate(t)},onComplete:()=>{a(),c.onComplete&&c.onComplete()},name:t,motionValue:e,element:o?void 0:i};(function({when:t,delay:e,delayChildren:n,staggerChildren:s,staggerDirection:i,repeat:r,repeatType:o,repeatDelay:a,from:l,elapsed:u,...c}){return!!Object.keys(c).length})(c)||(p={...p,...is(t,p)}),p.duration&&(p.duration=r(p.duration)),p.repeatDelay&&(p.repeatDelay=r(p.repeatDelay)),void 0!==p.from&&(p.keyframes[0]=p.from);let f=!1;if((!1===p.type||0===p.duration&&!p.repeatDelay)&&(p.duration=0,0===p.delay&&(f=!0)),p.allowFlatten=!c.type&&!c.ease,f&&!o&&void 0!==e.get()){const t=Tn(p.keyframes,c);if(void 0!==t)return Ot.update(()=>{p.onUpdate(t),p.onComplete()}),new l([])}return!o&&ts.supports(p)?new ts(p):new Gn(p)};function os({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,s}function as(t,e,{delay:n=0,transitionOverride:s,type:i}={}){var r;let{transition:o=t.getDefaultTransition(),transitionEnd:a,...l}=e;s&&(o=s);const c=[],h=i&&t.animationState&&t.animationState.getState()[i];for(const e in l){const s=t.getValue(e,null!==(r=t.latestValues[e])&&void 0!==r?r:null),i=l[e];if(void 0===i||h&&os(h,e))continue;const a={delay:n,...u(o||{},e)};let d=!1;if(window.MotionHandoffAnimation){const n=Gt(t);if(n){const t=window.MotionHandoffAnimation(n,e,Ot);null!==t&&(a.startTime=t,d=!0)}}Yt(t,e),s.start(rs(e,s,i,t.shouldReduceMotion&&Pt.has(e)?{type:!1}:a,t,d));const p=s.animation;p&&c.push(p)}return a&&Promise.all(c).then(()=>{Ot.update(()=>{a&&Ht(t,a)})}),c}const ls=()=>({x:{min:0,max:0},y:{min:0,max:0}}),us={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},cs={};for(const t in us)cs[t]={isEnabled:e=>us[t].some(t=>!!e[t])};const hs="undefined"!=typeof window,ds={current:null},ps={current:!1};const fs=[...mn,Pe,Ie];const ms=["initial","animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"];function gs(t){return null!==(e=t.animate)&&"object"==typeof e&&"function"==typeof e.start||ms.some(e=>function(t){return"string"==typeof t||Array.isArray(t)}(t[e]));var e}const vs=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class ys{scrapeMotionValuesFromProps(t,e,n){return{}}constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:s,blockInitialAnimation:i,visualState:r},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=rn,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const t=Wt.now();this.renderScheduledAt<t&&(this.renderScheduledAt=t,Ot.render(this.render,!1,!0))};const{latestValues:a,renderState:l,onUpdate:u}=r;this.onUpdate=u,this.latestValues=a,this.baseTarget={...a},this.initialValues=e.initial?{...a}:{},this.renderState=l,this.parent=t,this.props=e,this.presenceContext=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.options=o,this.blockInitialAnimation=Boolean(i),this.isControllingVariants=gs(e),this.isVariantNode=function(t){return Boolean(gs(t)||t.variants)}(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:c,...h}=this.scrapeMotionValuesFromProps(e,{},this);for(const t in h){const e=h[t];void 0!==a[t]&&ut(e)&&e.set(a[t],!1)}}mount(t){this.current=t,At.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((t,e)=>this.bindToMotionValue(e,t)),ps.current||function(){if(ps.current=!0,hs)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>ds.current=t.matches;t.addListener(e),e()}else ds.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||ds.current),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),Bt(this.notifyUpdate),Bt(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}bindToMotionValue(t,e){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const n=Mt.has(t);n&&this.onBindTransform&&this.onBindTransform();const s=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&Ot.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0)}),i=e.on("renderRequest",this.scheduleRender);let r;window.MotionCheckAppearSync&&(r=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,()=>{s(),i(),r&&r(),e.owner&&e.stop()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}updateFeatures(){let t="animation";for(t in cs){const e=cs[t];if(!e)continue;const{isEnabled:n,Feature:s}=e;if(!this.features[t]&&s&&n(this.props)&&(this.features[t]=new s(this)),this.features[t]){const e=this.features[t];e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;e<vs.length;e++){const n=vs[e];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);const s=t["on"+n];s&&(this.propEventSubscriptions[n]=this.on(n,s))}this.prevMotionValues=function(t,e,n){for(const s in e){const i=e[s],r=n[s];if(ut(i))t.addValue(s,i);else if(ut(r))t.addValue(s,jt(i,{owner:t}));else if(r!==i)if(t.hasValue(s)){const e=t.getValue(s);!0===e.liveStyle?e.jump(i):e.hasAnimated||e.set(i)}else{const e=t.getStaticValue(s);t.addValue(s,jt(void 0!==e?e:i,{owner:t}))}}for(const s in n)void 0===e[s]&&t.removeValue(s);return e}(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const e=this.getClosestVariantNode();if(e)return e.variantChildren&&e.variantChildren.add(t),()=>e.variantChildren.delete(t)}addValue(t,e){const n=this.values.get(t);e!==n&&(n&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e),this.latestValues[t]=e.get())}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return void 0===n&&void 0!==e&&(n=jt(null===e?void 0:e,{owner:this}),this.addValue(t,n)),n}readValue(t,e){var n;let s=void 0===this.latestValues[t]&&this.current?null!==(n=this.getBaseTargetFromProps(this.props,t))&&void 0!==n?n:this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];var i;return null!=s&&("string"==typeof s&&(on(s)||ae(s))?s=parseFloat(s):(i=s,!fs.find(fn(i))&&Ie.test(e)&&(s=He(t,e))),this.setBaseTarget(t,ut(s)?s.get():s)),ut(s)?s.get():s}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){var e;const{initial:n}=this.props;let s;if("string"==typeof n||"object"==typeof n){const i=Ut(this.props,n,null===(e=this.presenceContext)||void 0===e?void 0:e.custom);i&&(s=i[t])}if(n&&void 0!==s)return s;const i=this.getBaseTargetFromProps(this.props,t);return void 0===i||ut(i)?void 0!==this.initialValues[t]&&void 0===s?void 0:this.baseTarget[t]:i}on(t,e){return this.events[t]||(this.events[t]=new Nt),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}}class ws extends ys{constructor(){super(...arguments),this.KeyframeResolver=vn}sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){return t.style?t.style[e]:void 0}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;ut(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=""+t)}))}}const bs=(t,e)=>e&&"number"==typeof t?e.transform(t):t,Ts={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},xs=Vt.length;function Ss(t,e,n){const{style:s,vars:i,transformOrigin:r}=t;let o=!1,a=!1;for(const t in e){const n=e[t];if(Mt.has(t))o=!0;else if(ln(t))i[t]=n;else{const e=bs(n,ze[t]);t.startsWith("origin")?(a=!0,r[t]=e):s[t]=e}}if(e.transform||(o||n?s.transform=function(t,e,n){let s="",i=!0;for(let r=0;r<xs;r++){const o=Vt[r],a=t[o];if(void 0===a)continue;let l=!0;if(l="number"==typeof a?a===(o.startsWith("scale")?1:0):0===parseFloat(a),!l||n){const t=bs(a,ze[o]);if(!l){i=!1;s+=`${Ts[o]||o}(${t}) `}n&&(e[o]=t)}}return s=s.trim(),n?s=n(e,i?"":s):i&&(s="none"),s}(e,t.transform,n):s.transform&&(s.transform="none")),a){const{originX:t="50%",originY:e="50%",originZ:n=0}=r;s.transformOrigin=`${t} ${e} ${n}`}}const As={offset:"stroke-dashoffset",array:"stroke-dasharray"},Vs={offset:"strokeDashoffset",array:"strokeDasharray"};function Ms(t,e,n){return"string"==typeof t?t:xe.transform(e+n*t)}function Ps(t,{attrX:e,attrY:n,attrScale:s,originX:i,originY:r,pathLength:o,pathSpacing:a=1,pathOffset:l=0,...u},c,h){if(Ss(t,u,h),c)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:d,style:p,dimensions:f}=t;d.transform&&(f&&(p.transform=d.transform),delete d.transform),f&&(void 0!==i||void 0!==r||p.transform)&&(p.transformOrigin=function(t,e,n){return`${Ms(e,t.x,t.width)} ${Ms(n,t.y,t.height)}`}(f,void 0!==i?i:.5,void 0!==r?r:.5)),void 0!==e&&(d.x=e),void 0!==n&&(d.y=n),void 0!==s&&(d.scale=s),void 0!==o&&function(t,e,n=1,s=0,i=!0){t.pathLength=1;const r=i?As:Vs;t[r.offset]=xe.transform(-s);const o=xe.transform(e),a=xe.transform(n);t[r.array]=`${o} ${a}`}(d,o,a,l,!1)}const ks=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function Es(t,{style:e,vars:n},s,i){Object.assign(t.style,e,i&&i.getProjectionStyles(s));for(const e in n)t.style.setProperty(e,n[e])}const Fs={};function Cs(t,{layout:e,layoutId:n}){return Mt.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!Fs[t]||"opacity"===t)}function Os(t,e,n){var s;const{style:i}=t,r={};for(const o in i)(ut(i[o])||e.style&&ut(e.style[o])||Cs(o,t)||void 0!==(null===(s=null==n?void 0:n.getValue(o))||void 0===s?void 0:s.liveStyle))&&(r[o]=i[o]);return r}class Bs extends ws{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=ls,this.updateDimensions=()=>{this.current&&!this.renderState.dimensions&&function(t,e){try{e.dimensions="function"==typeof t.getBBox?t.getBBox():t.getBoundingClientRect()}catch(t){e.dimensions={x:0,y:0,width:0,height:0}}}(this.current,this.renderState)}}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(Mt.has(e)){const t=$e(e);return t&&t.default||0}return e=ks.has(e)?e:Xt(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,n){return function(t,e,n){const s=Os(t,e,n);for(const n in t)if(ut(t[n])||ut(e[n])){s[-1!==Vt.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=t[n]}return s}(t,e,n)}onBindTransform(){this.current&&!this.renderState.dimensions&&Ot.postRender(this.updateDimensions)}build(t,e,n){Ps(t,e,this.isSVGTag,n.transformTemplate)}renderInstance(t,e,n,s){!function(t,e,n,s){Es(t,e,void 0,s);for(const n in e.attrs)t.setAttribute(ks.has(n)?n:Xt(n),e.attrs[n])}(t,e,0,s)}mount(t){var e;this.isSVGTag="string"==typeof(e=t.tagName)&&"svg"===e.toLowerCase(),super.mount(t)}}class Is extends ws{constructor(){super(...arguments),this.type="html",this.renderInstance=Es}readValueFromInstance(t,e){if(Mt.has(e)){const t=$e(e);return t&&t.default||0}{const s=(n=t,window.getComputedStyle(n)),i=(ln(e)?s.getPropertyValue(e):s[e])||0;return"string"==typeof i?i.trim():i}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return function(t,e){return function({top:t,left:e,right:n,bottom:s}){return{x:{min:e,max:n},y:{min:t,max:s}}}(function(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),s=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}(t.getBoundingClientRect(),e))}(t,e)}build(t,e,n){Ss(t,e,n.transformTemplate)}scrapeMotionValuesFromProps(t,e,n){return Os(t,e,n)}}class Ls extends ys{constructor(){super(...arguments),this.type="object"}readValueFromInstance(t,e){if(function(t,e){return t in e}(e,t)){const n=t[e];if("string"==typeof n||"number"==typeof n)return n}}getBaseTargetFromProps(){}removeValueFromRenderState(t,e){delete e.output[t]}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}build(t,e){Object.assign(t.output,e)}renderInstance(t,{output:e}){Object.assign(t,e)}sortInstanceNodePosition(){return 0}}function Rs(t){const e={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=function(t){return t instanceof SVGElement&&"svg"!==t.tagName}(t)?new Bs(e):new Is(e);n.mount(t),At.set(t,n)}function Ds(t){const e=new Ls({presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}});e.mount(t),At.set(t,e)}function Ws(t,e,n,s){const i=[];if(function(t,e){return ut(t)||"number"==typeof t||"string"==typeof t&&!ct(e)}(t,e))i.push(function(t,e,n){const s=ut(t)?t:jt(t);return s.start(rs("",s,e,n)),s.animation}(t,ct(e)&&e.default||e,n&&n.default||n));else{const r=ht(t,e,s),o=r.length;for(let t=0;t<o;t++){const s=r[t],a=s instanceof Element?Rs:Ds;At.has(s)||a(s);const l=At.get(s),u={...n};"delay"in u&&"function"==typeof u.delay&&(u.delay=u.delay(t,o)),i.push(...as(l,{...e,transition:u},{}))}}return i}function Ns(t,e,n){const s=[];return function(t,{defaultTransition:e={},...n}={},s,o){const a=e.duration||.3,l=new Map,u=new Map,c={},p=new Map;let f=0,m=0,g=0;for(let n=0;n<t.length;n++){const i=t[n];if("string"==typeof i){p.set(i,m);continue}if(!Array.isArray(i)){p.set(i.name,pt(m,i.at,f,p));continue}let[l,v,y={}]=i;void 0!==y.at&&(m=pt(m,y.at,f,p));let w=0;const b=(t,n,s,i=0,l=0)=>{const u=bt(t),{delay:c=0,times:p=lt(u),type:f="keyframes",repeat:v,repeatType:y,repeatDelay:b=0,...T}=n;let{ease:x=e.ease||"easeOut",duration:S}=n;const A="function"==typeof c?c(i,l):c,V=u.length,M=d(f)?f:null==o?void 0:o[f];if(V<=2&&M){let t=100;if(2===V&&St(u)){const e=u[1]-u[0];t=Math.abs(e)}const e={...T};void 0!==S&&(e.duration=r(S));const n=h(e,t,M);x=n.ease,S=n.duration}null!=S||(S=a);const P=m+A;1===p.length&&0===p[0]&&(p[1]=1);const k=p.length-u.length;if(k>0&&at(p,k),1===u.length&&u.unshift(null),v){S=dt(S,v);const t=[...u],e=[...p];x=Array.isArray(x)?[...x]:[x];const n=[...x];for(let s=0;s<v;s++){u.push(...t);for(let i=0;i<t.length;i++)p.push(e[i]+(s+1)),x.push(0===i?"linear":rt(n,i-1))}gt(p,v)}const E=P+S;mt(s,u,x,p,P,E),w=Math.max(A+S,w),g=Math.max(E,g)};if(ut(l)){b(v,y,wt("default",yt(l,u)))}else{const t=ht(l,v,s,c),e=t.length;for(let n=0;n<e;n++){v=v,y=y;const s=yt(t[n],u);for(const t in v)b(v[t],Tt(y,t),wt(t,s),n,e)}}f=m,m+=w}return u.forEach((t,s)=>{for(const r in t){const o=t[r];o.sort(vt);const a=[],u=[],c=[];for(let t=0;t<o.length;t++){const{at:e,value:n,easing:s}=o[t];a.push(n),u.push(i(0,g,e)),c.push(s||"easeOut")}0!==u[0]&&(u.unshift(0),a.unshift(a[0]),c.unshift("easeInOut")),1!==u[u.length-1]&&(u.push(1),a.push(null)),l.has(s)||l.set(s,{keyframes:{},transition:{}});const h=l.get(s);h.keyframes[r]=a,h.transition[r]={...e,duration:g,ease:c,times:u,...n}}}),l}(t,e,n,{spring:nt}).forEach(({keyframes:t,transition:e},n)=>{s.push(...Ws(n,t,e))}),s}function Ks(t){return function(e,n,s){let i=[];var r;r=e,i=Array.isArray(r)&&r.some(Array.isArray)?Ns(e,n,t):Ws(e,n,s,t);const o=new l(i);return t&&t.animations.push(o),o}}const js=Ks();function zs(t,e,n){t.style.setProperty(e,n)}function Us(t,e,n){t.style[e]=n}const $s=s(()=>{try{document.createElement("div").animate({opacity:[1]})}catch(t){return!1}return!0}),Hs=new WeakMap;function Ys(t){const e=Hs.get(t)||new Map;return Hs.set(t,e),Hs.get(t)}class Xs extends class{constructor(t){this.animation=t}get duration(){var t,e,n;const s=(null===(e=null===(t=this.animation)||void 0===t?void 0:t.effect)||void 0===e?void 0:e.getComputedTiming().duration)||(null===(n=this.options)||void 0===n?void 0:n.duration)||300;return o(Number(s))}get time(){var t;return this.animation?o((null===(t=this.animation)||void 0===t?void 0:t.currentTime)||0):0}set time(t){this.animation&&(this.animation.currentTime=r(t))}get speed(){return this.animation?this.animation.playbackRate:1}set speed(t){this.animation&&(this.animation.playbackRate=t)}get state(){return this.animation?this.animation.playState:"finished"}get startTime(){return this.animation?this.animation.startTime:null}get finished(){return this.animation?this.animation.finished:Promise.resolve()}play(){this.animation&&this.animation.play()}pause(){this.animation&&this.animation.pause()}stop(){this.animation&&"idle"!==this.state&&"finished"!==this.state&&(this.animation.commitStyles&&this.animation.commitStyles(),this.cancel())}flatten(){var t,e;this.animation&&(null===(t=this.options)||void 0===t?void 0:t.allowFlatten)&&(null===(e=this.animation.effect)||void 0===e||e.updateTiming({easing:"linear"}))}attachTimeline(t){return this.animation&&p(this.animation,t),e}complete(){this.animation&&this.animation.finish()}cancel(){try{this.animation&&this.animation.cancel()}catch(t){}}}{constructor(t,e,s,i){const o=e.startsWith("--");n("string"!=typeof i.type);const a=Ys(t).get(e);a&&a.stop();if(Array.isArray(s)||(s=[s]),function(t,e,n){for(let s=0;s<e.length;s++)null===e[s]&&(e[s]=0===s?n():e[s-1]),"number"==typeof e[s]&&Ne[t]&&(e[s]=Ne[t].transform(e[s]));!$s()&&e.length<2&&e.unshift(n())}(e,s,()=>e.startsWith("--")?t.style.getPropertyValue(e):window.getComputedStyle(t)[e]),d(i.type)){const t=h(i,100,i.type);i.ease=v()?t.ease:"easeOut",i.duration=r(t.duration),i.type="keyframes"}else i.ease=i.ease||"easeOut";const l=()=>{this.setValue(t,e,Tn(s,i)),this.cancel(),this.resolveFinishedPromise()},u=()=>{this.setValue=o?zs:Us,this.options=i,this.updateFinishedPromise(),this.removeAnimation=()=>{const n=Hs.get(t);n&&n.delete(e)}};Jn()?(super(_n(t,e,s,i)),u(),!1===i.autoplay&&this.animation.pause(),this.animation.onfinish=l,Ys(t).set(e,this)):(super(),u(),l())}then(t,e){return this.currentFinishedPromise.then(t,e)}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}play(){"finished"===this.state&&this.updateFinishedPromise(),super.play()}cancel(){this.removeAnimation(),super.cancel()}}const qs=(t=>function(e,n,s){return new l(function(t,e,n,s){const i=V(t,s),o=i.length,a=[];for(let t=0;t<o;t++){const s=i[t],l={...n};"function"==typeof l.delay&&(l.delay=l.delay(t,o));for(const t in e){const n=e[t],i={...u(l,t)};i.duration=i.duration?r(i.duration):i.duration,i.delay=r(i.delay||0),i.allowFlatten=!l.type&&!l.ease,a.push(new Xs(s,t,n,i))}}return a}(e,n,s,t))})();function Gs(t,e){let n;const s=()=>{const{currentTime:s}=e,i=(null===s?0:s.value)/100;n!==i&&t(i),n=i};return Ot.update(s,!0),()=>Bt(s)}const Zs=new WeakMap;let _s;function Js({target:t,contentRect:e,borderBoxSize:n}){var s;null===(s=Zs.get(t))||void 0===s||s.forEach(s=>{s({target:t,contentSize:e,get size(){return function(t,e){if(e){const{inlineSize:t,blockSize:n}=e[0];return{width:t,height:n}}return t instanceof SVGElement&&"getBBox"in t?t.getBBox():{width:t.offsetWidth,height:t.offsetHeight}}(t,n)}})})}function Qs(t){t.forEach(Js)}function ti(t,e){_s||"undefined"!=typeof ResizeObserver&&(_s=new ResizeObserver(Qs));const n=V(t);return n.forEach(t=>{let n=Zs.get(t);n||(n=new Set,Zs.set(t,n)),n.add(e),null==_s||_s.observe(t)}),()=>{n.forEach(t=>{const n=Zs.get(t);null==n||n.delete(e),(null==n?void 0:n.size)||null==_s||_s.unobserve(t)})}}const ei=new Set;let ni;function si(t){return ei.add(t),ni||(ni=()=>{const t={width:window.innerWidth,height:window.innerHeight},e={target:window,size:t,contentSize:t};ei.forEach(t=>t(e))},window.addEventListener("resize",ni)),()=>{ei.delete(t),!ei.size&&ni&&(ni=void 0)}}const ii={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}};function ri(t,e,n,s){const r=n[e],{length:o,position:a}=ii[e],l=r.current,u=n.time;r.current=t["scroll"+a],r.scrollLength=t["scroll"+o]-t["client"+o],r.offset.length=0,r.offset[0]=0,r.offset[1]=r.scrollLength,r.progress=i(0,r.scrollLength,r.current);const c=s-u;r.velocity=c>50?0:R(r.current-l,c)}const oi={start:0,center:.5,end:1};function ai(t,e,n=0){let s=0;if(t in oi&&(t=oi[t]),"string"==typeof t){const e=parseFloat(t);t.endsWith("px")?s=e:t.endsWith("%")?t=e/100:t.endsWith("vw")?s=e/100*document.documentElement.clientWidth:t.endsWith("vh")?s=e/100*document.documentElement.clientHeight:t=e}return"number"==typeof t&&(s=e*t),n+s}const li=[0,0];function ui(t,e,n,s){let i=Array.isArray(t)?t:li,r=0,o=0;return"number"==typeof t?i=[t,t]:"string"==typeof t&&(i=(t=t.trim()).includes(" ")?t.split(" "):[t,oi[t]?t:"0"]),r=ai(i[0],n,s),o=ai(i[1],e),r-o}const ci={Enter:[[0,1],[1,1]],Exit:[[0,0],[1,0]],Any:[[1,0],[0,1]],All:[[0,0],[1,1]]},hi={x:0,y:0};function di(t,e,n){const{offset:s=ci.All}=n,{target:i=t,axis:r="y"}=n,o="y"===r?"height":"width",a=i!==t?function(t,e){const n={x:0,y:0};let s=t;for(;s&&s!==e;)if(s instanceof HTMLElement)n.x+=s.offsetLeft,n.y+=s.offsetTop,s=s.offsetParent;else if("svg"===s.tagName){const t=s.getBoundingClientRect();s=s.parentElement;const e=s.getBoundingClientRect();n.x+=t.left-e.left,n.y+=t.top-e.top}else{if(!(s instanceof SVGGraphicsElement))break;{const{x:t,y:e}=s.getBBox();n.x+=t,n.y+=e;let i=null,r=s.parentNode;for(;!i;)"svg"===r.tagName&&(i=r),r=s.parentNode;s=i}}return n}(i,t):hi,l=i===t?{width:t.scrollWidth,height:t.scrollHeight}:function(t){return"getBBox"in t&&"svg"!==t.tagName?t.getBBox():{width:t.clientWidth,height:t.clientHeight}}(i),u={width:t.clientWidth,height:t.clientHeight};e[r].offset.length=0;let c=!e[r].interpolate;const h=s.length;for(let t=0;t<h;t++){const n=ui(s[t],u[o],l[o],a[r]);c||n===e[r].interpolatorOffsets[t]||(c=!0),e[r].offset[t]=n}c&&(e[r].interpolate=$n(e[r].offset,lt(s),{clamp:!1}),e[r].interpolatorOffsets=[...e[r].offset]),e[r].progress=L(0,1,e[r].interpolate(e[r].current))}function pi(t,e,n,s={}){return{measure:()=>function(t,e=t,n){if(n.x.targetOffset=0,n.y.targetOffset=0,e!==t){let s=e;for(;s&&s!==t;)n.x.targetOffset+=s.offsetLeft,n.y.targetOffset+=s.offsetTop,s=s.offsetParent}n.x.targetLength=e===t?e.scrollWidth:e.clientWidth,n.y.targetLength=e===t?e.scrollHeight:e.clientHeight,n.x.containerLength=t.clientWidth,n.y.containerLength=t.clientHeight}(t,s.target,n),update:e=>{!function(t,e,n){ri(t,"x",e,n),ri(t,"y",e,n),e.time=n}(t,n,e),(s.offset||s.target)&&di(t,n,s)},notify:()=>e(n)}}const fi=new WeakMap,mi=new WeakMap,gi=new WeakMap,vi=t=>t===document.documentElement?window:t;function yi(t,{container:e=document.documentElement,...n}={}){let s=gi.get(e);s||(s=new Set,gi.set(e,s));const i=pi(e,t,{time:0,x:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0},y:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0}},n);if(s.add(i),!fi.has(e)){const t=()=>{for(const t of s)t.measure()},n=()=>{for(const t of s)t.update(It.timestamp)},i=()=>{for(const t of s)t.notify()},a=()=>{Ot.read(t,!1,!0),Ot.read(n,!1,!0),Ot.update(i,!1,!0)};fi.set(e,a);const l=vi(e);window.addEventListener("resize",a,{passive:!0}),e!==document.documentElement&&mi.set(e,(o=a,"function"==typeof(r=e)?si(r):ti(r,o))),l.addEventListener("scroll",a,{passive:!0})}var r,o;const a=fi.get(e);return Ot.read(a,!1,!0),()=>{var t;Bt(a);const n=gi.get(e);if(!n)return;if(n.delete(i),n.size)return;const s=fi.get(e);fi.delete(e),s&&(vi(e).removeEventListener("scroll",s),null===(t=mi.get(e))||void 0===t||t(),window.removeEventListener("resize",s))}}const wi=new Map;function bi({source:t,container:e=document.documentElement,axis:n="y"}={}){t&&(e=t),wi.has(e)||wi.set(e,{});const s=wi.get(e);return s[n]||(s[n]=a()?new ScrollTimeline({source:e,axis:n}):function({source:t,container:e,axis:n="y"}){t&&(e=t);const s={value:0},i=yi(t=>{s.value=100*t[n].progress},{container:e,axis:n});return{currentTime:s,cancel:i}}({source:e,axis:n})),s[n]}function Ti(t){return t&&(t.target||t.offset)}const xi={some:0,all:1};const Si=(t,e)=>Math.abs(t-e);const Ai=Ot,Vi=Ft.reduce((t,e)=>(t[e]=t=>Bt(t),t),{});t.MotionValue=Kt,t.animate=js,t.animateMini=qs,t.anticipate=se,t.backIn=ee,t.backInOut=ne,t.backOut=te,t.cancelFrame=Bt,t.cancelSync=Vi,t.circIn=ie,t.circInOut=oe,t.circOut=re,t.clamp=L,t.createScopedAnimate=Ks,t.cubicBezier=_t,t.delay=function(t,e){return function(t,e){const n=Wt.now(),s=({timestamp:i})=>{const r=i-n;r>=e&&(Bt(s),t(r-e))};return Ot.read(s,!0),()=>Bt(s)}(t,r(e))},t.distance=Si,t.distance2D=function(t,e){const n=Si(t.x,e.x),s=Si(t.y,e.y);return Math.sqrt(n**2+s**2)},t.easeIn=Nn,t.easeInOut=jn,t.easeOut=Kn,t.frame=Ot,t.frameData=It,t.frameSteps=Lt,t.hover=function(t,e,n={}){const[s,i,r]=M(t,n),o=t=>{if(!P(t))return;const{target:n}=t,s=e(n,t);if("function"!=typeof s||!n)return;const r=t=>{P(t)&&(s(t),n.removeEventListener("pointerleave",r))};n.addEventListener("pointerleave",r,i)};return s.forEach(t=>{t.addEventListener("pointerenter",o,i)}),r},t.inView=function(t,e,{root:n,margin:s,amount:i="some"}={}){const r=V(t),o=new WeakMap,a=new IntersectionObserver(t=>{t.forEach(t=>{const n=o.get(t.target);if(t.isIntersecting!==Boolean(n))if(t.isIntersecting){const n=e(t.target,t);"function"==typeof n?o.set(t.target,n):a.unobserve(t.target)}else"function"==typeof n&&(n(t),o.delete(t.target))})},{root:n,rootMargin:s,threshold:"number"==typeof i?i:xi[i]});return r.forEach(t=>a.observe(t)),()=>a.disconnect()},t.inertia=Wn,t.interpolate=$n,t.invariant=n,t.isDragActive=A,t.keyframes=Hn,t.mirrorEasing=Jt,t.mix=Dn,t.motionValue=jt,t.noop=e,t.pipe=Fn,t.press=function(t,e,n={}){const[s,i,r]=M(t,n),o=t=>{const n=t.currentTarget;if(!n||!I(t)||C.has(n))return;C.add(n),k(t,"set");const s=e(n,t),r=(t,e)=>{n.removeEventListener("pointerup",o),n.removeEventListener("pointercancel",a),k(t,"release"),I(t)&&C.has(n)&&(C.delete(n),"function"==typeof s&&s(t,{success:e}))},o=t=>{const e=!!t.isTrusted&&(s=t,i=n instanceof Element?n.getBoundingClientRect():{left:0,top:0,right:window.innerWidth,bottom:window.innerHeight},s.clientX<i.left||s.clientX>i.right||s.clientY<i.top||s.clientY>i.bottom);var s,i;r(t,!e&&(!(n instanceof Element)||E(n,t.target)))},a=t=>{r(t,!1)};n.addEventListener("pointerup",o,i),n.addEventListener("pointercancel",a,i),n.addEventListener("lostpointercapture",a,i)};return s.forEach(t=>{let e=!1;var s;(t=n.useGlobalTarget?window:t)instanceof HTMLElement&&(e=!0,s=t,F.has(s.tagName)||-1!==s.tabIndex||null!==t.getAttribute("tabindex")||(t.tabIndex=0)),t.addEventListener("pointerdown",o,i),e&&t.addEventListener("focus",t=>((t,e)=>{const n=t.currentTarget;if(!n)return;const s=O(()=>{if(C.has(n))return;B(n,"down");const t=O(()=>{B(n,"up")});n.addEventListener("keyup",t,e),n.addEventListener("blur",()=>B(n,"cancel"),e)});n.addEventListener("keydown",s,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",s),e)})(t,i),i)}),r},t.progress=i,t.reverseEasing=Qt,t.scroll=function(t,{axis:n="y",...s}={}){const i={axis:n,...s};return"function"==typeof t?function(t,e){return function(t){return 2===t.length}(t)||Ti(e)?yi(n=>{t(n[e.axis].progress,n)},e):Gs(t,bi(e))}(t,i):function(t,n){if(t.flatten(),Ti(n))return t.pause(),yi(e=>{t.time=t.duration*e[n.axis].progress},n);{const s=bi(n);return t.attachTimeline?t.attachTimeline(s,t=>(t.pause(),Gs(e=>{t.time=t.duration*e},s))):e}}(t,i)},t.scrollInfo=yi,t.spring=nt,t.stagger=function(t=.1,{startDelay:e=0,from:n=0,ease:s}={}){return(i,r)=>{const o="number"==typeof n?n:function(t,e){if("first"===t)return 0;{const n=e-1;return"last"===t?n:n/2}}(n,r),a=Math.abs(o-i);let l=t*a;if(s){const e=r*t;l=Un(s)(l/e)*e}return e+l}},t.steps=function(t,e="end"){return n=>{const s=(n="end"===e?Math.min(n,.999):Math.max(n,.001))*t,i="end"===e?Math.floor(s):Math.ceil(s);return L(0,1,i/t)}},t.sync=Ai,t.time=Wt,t.transform=function(...t){const e=!Array.isArray(t[0]),n=e?0:-1,s=t[0+n],i=t[1+n],r=t[2+n],o=t[3+n],a=$n(i,r,{mixer:(l=r[0],(t=>t&&"object"==typeof t&&t.mix)(l)?l.mix:void 0),...o});var l;return e?a(s):a},t.wrap=st}));
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Motion={})}(this,(function(t){"use strict";const e=t=>t;let n=e;function s(t){let e;return()=>(void 0===e&&(e=t()),e)}const i=(t,e,n)=>{const s=e-t;return 0===s?1:(n-t)/s},r=t=>1e3*t,o=t=>t/1e3,a=s(()=>void 0!==window.ScrollTimeline);class l extends class{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>"finished"in t?t.finished:t))}getAll(t){return this.animations[0][t]}setAll(t,e){for(let n=0;n<this.animations.length;n++)this.animations[n][t]=e}attachTimeline(t,e){const n=this.animations.map(n=>a()&&n.attachTimeline?n.attachTimeline(t):"function"==typeof e?e(n):void 0);return()=>{n.forEach((t,e)=>{t&&t(),this.animations[e].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let e=0;e<this.animations.length;e++)t=Math.max(t,this.animations[e].duration);return t}runAll(t){this.animations.forEach(e=>e[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}{then(t,e){return Promise.all(this.animations).then(t).catch(e)}}function u(t,e){return t?t[e]||t.default||t:void 0}function c(t){let e=0;let n=t.next(e);for(;!n.done&&e<2e4;)e+=50,n=t.next(e);return e>=2e4?1/0:e}function h(t,e=100,n){const s=n({...t,keyframes:[0,e]}),i=Math.min(c(s),2e4);return{type:"keyframes",ease:t=>s.next(i*t).value/e,duration:o(i)}}function d(t){return"function"==typeof t}function p(t,e){t.timeline=e,t.onfinish=null}const f=t=>Array.isArray(t)&&"number"==typeof t[0],m={linearEasing:void 0};function g(t,e){const n=s(t);return()=>{var t;return null!==(t=m[e])&&void 0!==t?t:n()}}const v=g(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),y=(t,e,n=10)=>{let s="";const r=Math.max(Math.round(e/n),2);for(let e=0;e<r;e++)s+=t(i(0,r-1,e))+", ";return`linear(${s.substring(0,s.length-2)})`};function w(t){return Boolean("function"==typeof t&&v()||!t||"string"==typeof t&&(t in T||v())||f(t)||Array.isArray(t)&&t.every(w))}const b=([t,e,n,s])=>`cubic-bezier(${t}, ${e}, ${n}, ${s})`,T={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:b([0,.65,.55,1]),circOut:b([.55,0,1,.45]),backIn:b([.31,.01,.66,-.59]),backOut:b([.33,1.53,.69,.99])};const x=!1,S=!1;function M(){return x||S}function A(t,e,n){var s;if(t instanceof EventTarget)return[t];if("string"==typeof t){let i=document;e&&(i=e.current);const r=null!==(s=null==n?void 0:n[t])&&void 0!==s?s:i.querySelectorAll(t);return r?Array.from(r):[]}return Array.from(t)}function V(t,e){const n=A(t),s=new AbortController;return[n,{passive:!0,...e,signal:s.signal},()=>s.abort()]}function k(t){return!("touch"===t.pointerType||M())}function P(t,e){const n=e+"PointerCapture";if(t.target instanceof Element&&n in t.target&&void 0!==t.pointerId)try{t.target[n](t.pointerId)}catch(t){}}const E=(t,e)=>!!e&&(t===e||E(t,e.parentElement)),C=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);const F=new WeakSet;function O(t){return e=>{"Enter"===e.key&&t(e)}}function B(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}function I(t){return(t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary)(t)&&!M()}const L=(t,e,n)=>n>e?e:n<t?t:n;function R(t,e){return e?t*(1e3/e):0}function D(t,e,n){const s=Math.max(e-5,0);return R(n-t(s),e-s)}const W=100,N=10,K=1,j=0,z=800,Y=.3,U=.3,X={granular:.01,default:2},$={granular:.005,default:.5},H=.01,q=10,G=.05,Z=1;function _({duration:t=z,bounce:e=Y,velocity:n=j,mass:s=K}){let i,a,l=1-e;l=L(G,Z,l),t=L(H,q,o(t)),l<1?(i=e=>{const s=e*l,i=s*t;return.001-(s-n)/J(e,l)*Math.exp(-i)},a=e=>{const s=e*l*t,r=s*n+n,o=Math.pow(l,2)*Math.pow(e,2)*t,a=Math.exp(-s),u=J(Math.pow(e,2),l);return(.001-i(e)>0?-1:1)*((r-o)*a)/u}):(i=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,a=e=>Math.exp(-e*t)*(t*t*(n-e)));const u=function(t,e,n){let s=n;for(let n=1;n<12;n++)s-=t(s)/e(s);return s}(i,a,5/t);if(t=r(t),isNaN(u))return{stiffness:W,damping:N,duration:t};{const e=Math.pow(u,2)*s;return{stiffness:e,damping:2*l*Math.sqrt(s*e),duration:t}}}function J(t,e){return t*Math.sqrt(1-e*e)}const Q=["duration","bounce"],tt=["stiffness","damping","mass"];function et(t,e){return e.some(e=>void 0!==t[e])}function nt(t=U,e=Y){const n="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:s,restDelta:i}=n;const a=n.keyframes[0],l=n.keyframes[n.keyframes.length-1],u={done:!1,value:a},{stiffness:h,damping:d,mass:p,duration:f,velocity:m,isResolvedFromDuration:g}=function(t){let e={velocity:j,stiffness:W,damping:N,mass:K,isResolvedFromDuration:!1,...t};if(!et(t,tt)&&et(t,Q))if(t.visualDuration){const n=t.visualDuration,s=2*Math.PI/(1.2*n),i=s*s,r=2*L(.05,1,1-(t.bounce||0))*Math.sqrt(i);e={...e,mass:K,stiffness:i,damping:r}}else{const n=_(t);e={...e,...n,mass:K},e.isResolvedFromDuration=!0}return e}({...n,velocity:-o(n.velocity||0)}),v=m||0,w=d/(2*Math.sqrt(h*p)),b=l-a,T=o(Math.sqrt(h/p)),x=Math.abs(b)<5;let S;if(s||(s=x?X.granular:X.default),i||(i=x?$.granular:$.default),w<1){const t=J(T,w);S=e=>{const n=Math.exp(-w*T*e);return l-n*((v+w*T*b)/t*Math.sin(t*e)+b*Math.cos(t*e))}}else if(1===w)S=t=>l-Math.exp(-T*t)*(b+(v+T*b)*t);else{const t=T*Math.sqrt(w*w-1);S=e=>{const n=Math.exp(-w*T*e),s=Math.min(t*e,300);return l-n*((v+w*T*b)*Math.sinh(s)+t*b*Math.cosh(s))/t}}const M={calculatedDuration:g&&f||null,next:t=>{const e=S(t);if(g)u.done=t>=f;else{let n=0;w<1&&(n=0===t?r(v):D(S,t,e));const o=Math.abs(n)<=s,a=Math.abs(l-e)<=i;u.done=o&&a}return u.value=u.done?l:e,u},toString:()=>{const t=Math.min(c(M),2e4),e=y(e=>M.next(t*e).value,t,30);return t+"ms "+e}};return M}const st=(t,e,n)=>{const s=e-t;return((n-t)%s+s)%s+t},it=t=>Array.isArray(t)&&"number"!=typeof t[0];function rt(t,e){return it(t)?t[st(0,t.length,e)]:t}const ot=(t,e,n)=>t+(e-t)*n;function at(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const r=i(0,e,s);t.push(ot(n,1,r))}}function lt(t){const e=[0];return at(e,t.length-1),e}const ut=t=>Boolean(t&&t.getVelocity);function ct(t){return"object"==typeof t&&!Array.isArray(t)}function ht(t,e,n,s){return"string"==typeof t&&ct(e)?A(t,n,s):t instanceof NodeList?Array.from(t):Array.isArray(t)?t:[t]}function dt(t,e,n){return t*(e+1)}function pt(t,e,n,s){var i;return"number"==typeof e?e:e.startsWith("-")||e.startsWith("+")?Math.max(0,t+parseFloat(e)):"<"===e?n:null!==(i=s.get(e))&&void 0!==i?i:t}function ft(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}function mt(t,e,n,s,i,r){!function(t,e,n){for(let s=0;s<t.length;s++){const i=t[s];i.at>e&&i.at<n&&(ft(t,i),s--)}}(t,i,r);for(let o=0;o<e.length;o++)t.push({value:e[o],at:ot(i,r,s[o]),easing:rt(n,o)})}function gt(t,e){for(let n=0;n<t.length;n++)t[n]=t[n]/(e+1)}function vt(t,e){return t.at===e.at?null===t.value?1:null===e.value?-1:0:t.at-e.at}function yt(t,e){return!e.has(t)&&e.set(t,{}),e.get(t)}function wt(t,e){return e[t]||(e[t]=[]),e[t]}function bt(t){return Array.isArray(t)?t:[t]}function Tt(t,e){return t&&t[e]?{...t,...t[e]}:{...t}}const xt=t=>"number"==typeof t,St=t=>t.every(xt),Mt=new WeakMap,At=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Vt=new Set(At),kt=new Set(["width","height","top","left","right","bottom",...At]),Pt=t=>(t=>Array.isArray(t))(t)?t[t.length-1]||0:t,Et=!1,Ct=["read","resolveKeyframes","update","preRender","render","postRender"],Ft={value:null,addProjectionMetrics:null};const{schedule:Ot,cancel:Bt,state:It,steps:Lt}=function(t,e){let n=!1,s=!0;const i={delta:0,timestamp:0,isProcessing:!1},r=()=>n=!0,o=Ct.reduce((t,n)=>(t[n]=function(t,e){let n=new Set,s=new Set,i=!1,r=!1;const o=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1},l=0;function u(e){o.has(e)&&(c.schedule(e),t()),l++,e(a)}const c={schedule:(t,e=!1,r=!1)=>{const a=r&&i?n:s;return e&&o.add(t),a.has(t)||a.add(t),t},cancel:t=>{s.delete(t),o.delete(t)},process:t=>{a=t,i?r=!0:(i=!0,[n,s]=[s,n],n.forEach(u),e&&Ft.value&&Ft.value.frameloop[e].push(l),l=0,n.clear(),i=!1,r&&(r=!1,c.process(t)))}};return c}(r,e?n:void 0),t),{}),{read:a,resolveKeyframes:l,update:u,preRender:c,render:h,postRender:d}=o,p=()=>{const r=performance.now();n=!1,i.delta=s?1e3/60:Math.max(Math.min(r-i.timestamp,40),1),i.timestamp=r,i.isProcessing=!0,a.process(i),l.process(i),u.process(i),c.process(i),h.process(i),d.process(i),i.isProcessing=!1,n&&e&&(s=!1,t(p))};return{schedule:Ct.reduce((e,r)=>{const a=o[r];return e[r]=(e,r=!1,o=!1)=>(n||(n=!0,s=!0,i.isProcessing||t(p)),a.schedule(e,r,o)),e},{}),cancel:t=>{for(let e=0;e<Ct.length;e++)o[Ct[e]].cancel(t)},state:i,steps:o}}("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:e,!0);let Rt;function Dt(){Rt=void 0}const Wt={now:()=>(void 0===Rt&&Wt.set(It.isProcessing||Et?It.timestamp:performance.now()),Rt),set:t=>{Rt=t,queueMicrotask(Dt)}};class Nt{constructor(){this.subscriptions=[]}add(t){var e,n;return e=this.subscriptions,n=t,-1===e.indexOf(n)&&e.push(n),()=>ft(this.subscriptions,t)}notify(t,e,n){const s=this.subscriptions.length;if(s)if(1===s)this.subscriptions[0](t,e,n);else for(let i=0;i<s;i++){const s=this.subscriptions[i];s&&s(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}class Kt{constructor(t,e={}){this.version="12.4.13",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(t,e=!0)=>{const n=Wt.now();this.updatedAt!==n&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),e&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=Wt.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e))))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new Nt);const n=this.events[t].add(e);return"change"===t?()=>{n(),Ot.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t,e=!0){e&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,e)}setWithVelocity(t,e,n){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=Wt.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return R(parseFloat(this.current)-parseFloat(this.prevFrameValue),e)}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function jt(t,e){return new Kt(t,e)}function zt(t){const e=[{},{}];return null==t||t.values.forEach((t,n)=>{e[0][n]=t.get(),e[1][n]=t.getVelocity()}),e}function Yt(t,e,n,s){if("function"==typeof e){const[i,r]=zt(s);e=e(void 0!==n?n:t.custom,i,r)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){const[i,r]=zt(s);e=e(void 0!==n?n:t.custom,i,r)}return e}function Ut(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,jt(n))}function Xt(t,e){const n=function(t,e,n){const s=t.getProps();return Yt(s,e,void 0!==n?n:s.custom,t)}(t,e);let{transitionEnd:s={},transition:i={},...r}=n||{};r={...r,...s};for(const e in r){Ut(t,e,Pt(r[e]))}}function $t(t,e){const n=t.getValue("willChange");if(s=n,Boolean(ut(s)&&s.add))return n.add(e);var s}const Ht=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),qt="data-"+Ht("framerAppearId");function Gt(t){return t.props[qt]}const Zt=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function _t(t,n,s,i){if(t===n&&s===i)return e;const r=e=>function(t,e,n,s,i){let r,o,a=0;do{o=e+(n-e)/2,r=Zt(o,s,i)-t,r>0?n=o:e=o}while(Math.abs(r)>1e-7&&++a<12);return o}(e,0,1,t,s);return t=>0===t||1===t?t:Zt(r(t),n,i)}const Jt=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Qt=t=>e=>1-t(1-e),te=_t(.33,1.53,.69,.99),ee=Qt(te),ne=Jt(ee),se=t=>(t*=2)<1?.5*ee(t):.5*(2-Math.pow(2,-10*(t-1))),ie=t=>1-Math.sin(Math.acos(t)),re=Qt(ie),oe=Jt(ie),ae=t=>/^0[^.\s]+$/u.test(t);const le={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},ue={...le,transform:t=>L(0,1,t)},ce={...le,default:1},he=t=>Math.round(1e5*t)/1e5,de=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const pe=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,fe=(t,e)=>n=>Boolean("string"==typeof n&&pe.test(n)&&n.startsWith(t)||e&&!function(t){return null==t}(n)&&Object.prototype.hasOwnProperty.call(n,e)),me=(t,e,n)=>s=>{if("string"!=typeof s)return s;const[i,r,o,a]=s.match(de);return{[t]:parseFloat(i),[e]:parseFloat(r),[n]:parseFloat(o),alpha:void 0!==a?parseFloat(a):1}},ge={...le,transform:t=>Math.round((t=>L(0,255,t))(t))},ve={test:fe("rgb","red"),parse:me("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:s=1})=>"rgba("+ge.transform(t)+", "+ge.transform(e)+", "+ge.transform(n)+", "+he(ue.transform(s))+")"};const ye={test:fe("#"),parse:function(t){let e="",n="",s="",i="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),s=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),s=t.substring(3,4),i=t.substring(4,5),e+=e,n+=n,s+=s,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:i?parseInt(i,16)/255:1}},transform:ve.transform},we=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),be=we("deg"),Te=we("%"),xe=we("px"),Se=we("vh"),Me=we("vw"),Ae={...Te,parse:t=>Te.parse(t)/100,transform:t=>Te.transform(100*t)},Ve={test:fe("hsl","hue"),parse:me("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:s=1})=>"hsla("+Math.round(t)+", "+Te.transform(he(e))+", "+Te.transform(he(n))+", "+he(ue.transform(s))+")"},ke={test:t=>ve.test(t)||ye.test(t)||Ve.test(t),parse:t=>ve.test(t)?ve.parse(t):Ve.test(t)?Ve.parse(t):ye.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?ve.transform(t):Ve.transform(t)},Pe=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const Ee=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Ce(t){const e=t.toString(),n=[],s={color:[],number:[],var:[]},i=[];let r=0;const o=e.replace(Ee,t=>(ke.test(t)?(s.color.push(r),i.push("color"),n.push(ke.parse(t))):t.startsWith("var(")?(s.var.push(r),i.push("var"),n.push(t)):(s.number.push(r),i.push("number"),n.push(parseFloat(t))),++r,"${}")).split("${}");return{values:n,split:o,indexes:s,types:i}}function Fe(t){return Ce(t).values}function Oe(t){const{split:e,types:n}=Ce(t),s=e.length;return t=>{let i="";for(let r=0;r<s;r++)if(i+=e[r],void 0!==t[r]){const e=n[r];i+="number"===e?he(t[r]):"color"===e?ke.transform(t[r]):t[r]}return i}}const Be=t=>"number"==typeof t?0:t;const Ie={test:function(t){var e,n;return isNaN(t)&&"string"==typeof t&&((null===(e=t.match(de))||void 0===e?void 0:e.length)||0)+((null===(n=t.match(Pe))||void 0===n?void 0:n.length)||0)>0},parse:Fe,createTransformer:Oe,getAnimatableNone:function(t){const e=Fe(t);return Oe(t)(e.map(Be))}},Le=new Set(["brightness","contrast","saturate","opacity"]);function Re(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[s]=n.match(de)||[];if(!s)return t;const i=n.replace(s,"");let r=Le.has(e)?1:0;return s!==n&&(r*=100),e+"("+r+i+")"}const De=/\b([a-z-]*)\(.*?\)/gu,We={...Ie,getAnimatableNone:t=>{const e=t.match(De);return e?e.map(Re).join(" "):t}},Ne={borderWidth:xe,borderTopWidth:xe,borderRightWidth:xe,borderBottomWidth:xe,borderLeftWidth:xe,borderRadius:xe,radius:xe,borderTopLeftRadius:xe,borderTopRightRadius:xe,borderBottomRightRadius:xe,borderBottomLeftRadius:xe,width:xe,maxWidth:xe,height:xe,maxHeight:xe,top:xe,right:xe,bottom:xe,left:xe,padding:xe,paddingTop:xe,paddingRight:xe,paddingBottom:xe,paddingLeft:xe,margin:xe,marginTop:xe,marginRight:xe,marginBottom:xe,marginLeft:xe,backgroundPositionX:xe,backgroundPositionY:xe},Ke={rotate:be,rotateX:be,rotateY:be,rotateZ:be,scale:ce,scaleX:ce,scaleY:ce,scaleZ:ce,skew:be,skewX:be,skewY:be,distance:xe,translateX:xe,translateY:xe,translateZ:xe,x:xe,y:xe,z:xe,perspective:xe,transformPerspective:xe,opacity:ue,originX:Ae,originY:Ae,originZ:xe},je={...le,transform:Math.round},ze={...Ne,...Ke,zIndex:je,size:xe,fillOpacity:ue,strokeOpacity:ue,numOctaves:je},Ye={...ze,color:ke,backgroundColor:ke,outlineColor:ke,fill:ke,stroke:ke,borderColor:ke,borderTopColor:ke,borderRightColor:ke,borderBottomColor:ke,borderLeftColor:ke,filter:We,WebkitFilter:We},Ue=t=>Ye[t];function Xe(t,e){let n=Ue(t);return n!==We&&(n=Ie),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const $e=new Set(["auto","none","0"]);const He=t=>180*t/Math.PI,qe=t=>{const e=He(Math.atan2(t[1],t[0]));return Ze(e)},Ge={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:qe,rotateZ:qe,skewX:t=>He(Math.atan(t[1])),skewY:t=>He(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Ze=t=>((t%=360)<0&&(t+=360),t),_e=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),Je=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),Qe={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:_e,scaleY:Je,scale:t=>(_e(t)+Je(t))/2,rotateX:t=>Ze(He(Math.atan2(t[6],t[5]))),rotateY:t=>Ze(He(Math.atan2(-t[2],t[0]))),rotateZ:qe,rotate:qe,skewX:t=>He(Math.atan(t[4])),skewY:t=>He(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function tn(t){return t.includes("scale")?1:0}function en(t,e){if(!t||"none"===t)return tn(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,i;if(n)s=Qe,i=n;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=Ge,i=e}if(!i)return tn(e);const r=s[e],o=i[1].split(",").map(nn);return"function"==typeof r?r(o):o[r]}function nn(t){return parseFloat(t.trim())}const sn=t=>t===le||t===xe,rn=new Set(["x","y","z"]),on=At.filter(t=>!rn.has(t));const an={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>en(e,"x"),y:(t,{transform:e})=>en(e,"y")};an.translateX=an.x,an.translateY=an.y;const ln=new Set;let un=!1,cn=!1;function hn(){if(cn){const t=Array.from(ln).filter(t=>t.needsMeasurement),e=new Set(t.map(t=>t.element)),n=new Map;e.forEach(t=>{const e=function(t){const e=[];return on.forEach(n=>{const s=t.getValue(n);void 0!==s&&(e.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),e}(t);e.length&&(n.set(t,e),t.render())}),t.forEach(t=>t.measureInitialState()),e.forEach(t=>{t.render();const e=n.get(t);e&&e.forEach(([e,n])=>{var s;null===(s=t.getValue(e))||void 0===s||s.set(n)})}),t.forEach(t=>t.measureEndState()),t.forEach(t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)})}cn=!1,un=!1,ln.forEach(t=>t.complete()),ln.clear()}function dn(){ln.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(cn=!0)})}class pn{constructor(t,e,n,s,i,r=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=n,this.motionValue=s,this.element=i,this.isAsync=r}scheduleResolve(){this.isScheduled=!0,this.isAsync?(ln.add(this),un||(un=!0,Ot.read(dn),Ot.resolveKeyframes(hn))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:n,motionValue:s}=this;for(let i=0;i<t.length;i++)if(null===t[i])if(0===i){const i=null==s?void 0:s.get(),r=t[t.length-1];if(void 0!==i)t[0]=i;else if(n&&e){const s=n.readValue(e,r);null!=s&&(t[0]=s)}void 0===t[0]&&(t[0]=r),s&&void 0===i&&s.set(t[0])}else t[i]=t[i-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),ln.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,ln.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const fn=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),mn=t=>e=>"string"==typeof e&&e.startsWith(t),gn=mn("--"),vn=mn("var(--"),yn=t=>!!vn(t)&&wn.test(t.split("/*")[0].trim()),wn=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,bn=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Tn(t,e,n=1){const[s,i]=function(t){const e=bn.exec(t);if(!e)return[,];const[,n,s,i]=e;return["--"+(null!=n?n:s),i]}(t);if(!s)return;const r=window.getComputedStyle(e).getPropertyValue(s);if(r){const t=r.trim();return fn(t)?parseFloat(t):t}return yn(i)?Tn(i,e,n+1):i}const xn=t=>e=>e.test(t),Sn=[le,xe,Te,be,Me,Se,{test:t=>"auto"===t,parse:t=>t}],Mn=t=>Sn.find(xn(t));class An extends pn{constructor(t,e,n,s,i){super(t,e,n,s,i,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:n}=this;if(!e||!e.current)return;super.readKeyframes();for(let n=0;n<t.length;n++){let s=t[n];if("string"==typeof s&&(s=s.trim(),yn(s))){const i=Tn(s,e.current);void 0!==i&&(t[n]=i),n===t.length-1&&(this.finalKeyframe=s)}}if(this.resolveNoneKeyframes(),!kt.has(n)||2!==t.length)return;const[s,i]=t,r=Mn(s),o=Mn(i);if(r!==o)if(sn(r)&&sn(o))for(let e=0;e<t.length;e++){const n=t[e];"string"==typeof n&&(t[e]=parseFloat(n))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:e}=this,n=[];for(let e=0;e<t.length;e++)("number"==typeof(s=t[e])?0===s:null===s||"none"===s||"0"===s||ae(s))&&n.push(e);var s;n.length&&function(t,e,n){let s=0,i=void 0;for(;s<t.length&&!i;){const e=t[s];"string"==typeof e&&!$e.has(e)&&Ce(e).values.length&&(i=t[s]),s++}if(i&&n)for(const s of e)t[s]=Xe(n,i)}(t,n,e)}measureInitialState(){const{element:t,unresolvedKeyframes:e,name:n}=this;if(!t||!t.current)return;"height"===n&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=an[n](t.measureViewportBox(),window.getComputedStyle(t.current)),e[0]=this.measuredOrigin;const s=e[e.length-1];void 0!==s&&t.getValue(n,s).jump(s,!1)}measureEndState(){var t;const{element:e,name:n,unresolvedKeyframes:s}=this;if(!e||!e.current)return;const i=e.getValue(n);i&&i.jump(this.measuredOrigin,!1);const r=s.length-1,o=s[r];s[r]=an[n](e.measureViewportBox(),window.getComputedStyle(e.current)),null!==o&&void 0===this.finalKeyframe&&(this.finalKeyframe=o),(null===(t=this.removedTransforms)||void 0===t?void 0:t.length)&&this.removedTransforms.forEach(([t,n])=>{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}}const Vn=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!Ie.test(t)&&"0"!==t||t.startsWith("url(")));function kn(t,e,n,s){const i=t[0];if(null===i)return!1;if("display"===e||"visibility"===e)return!0;const r=t[t.length-1],o=Vn(i,e),a=Vn(r,e);return!(!o||!a)&&(function(t){const e=t[0];if(1===t.length)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}(t)||("spring"===n||d(n))&&s)}const Pn=t=>null!==t;function En(t,{repeat:e,repeatType:n="loop"},s){const i=t.filter(Pn),r=e&&"loop"!==n&&e%2==1?0:i.length-1;return r&&void 0!==s?s:i[r]}class Cn{constructor({autoplay:t=!0,delay:e=0,type:n="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:r="loop",...o}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=Wt.now(),this.options={autoplay:t,delay:e,type:n,repeat:s,repeatDelay:i,repeatType:r,...o},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt}get resolved(){return this._resolved||this.hasAttemptedResolve||(dn(),hn()),this._resolved}onKeyframesResolved(t,e){this.resolvedAt=Wt.now(),this.hasAttemptedResolve=!0;const{name:n,type:s,velocity:i,delay:r,onComplete:o,onUpdate:a,isGenerator:l}=this.options;if(!l&&!kn(t,n,s,i)){if(!r)return a&&a(En(t,this.options,e)),o&&o(),void this.resolveFinishedPromise();this.options.duration=0}const u=this.initPlayback(t,e);!1!==u&&(this._resolved={keyframes:t,finalKeyframe:e,...u},this.onPostResolved())}onPostResolved(){}then(t,e){return this.currentFinishedPromise.then(t,e)}flatten(){this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear")}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}function Fn(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function On(t,e){return n=>n>0?e:t}const Bn=(t,e,n)=>{const s=t*t,i=n*(e*e-s)+s;return i<0?0:Math.sqrt(i)},In=[ye,ve,Ve];function Ln(t){const e=(n=t,In.find(t=>t.test(n)));var n;if(!Boolean(e))return!1;let s=e.parse(t);return e===Ve&&(s=function({hue:t,saturation:e,lightness:n,alpha:s}){t/=360,n/=100;let i=0,r=0,o=0;if(e/=100){const s=n<.5?n*(1+e):n+e-n*e,a=2*n-s;i=Fn(a,s,t+1/3),r=Fn(a,s,t),o=Fn(a,s,t-1/3)}else i=r=o=n;return{red:Math.round(255*i),green:Math.round(255*r),blue:Math.round(255*o),alpha:s}}(s)),s}const Rn=(t,e)=>{const n=Ln(t),s=Ln(e);if(!n||!s)return On(t,e);const i={...n};return t=>(i.red=Bn(n.red,s.red,t),i.green=Bn(n.green,s.green,t),i.blue=Bn(n.blue,s.blue,t),i.alpha=ot(n.alpha,s.alpha,t),ve.transform(i))},Dn=(t,e)=>n=>e(t(n)),Wn=(...t)=>t.reduce(Dn),Nn=new Set(["none","hidden"]);function Kn(t,e){return n=>ot(t,e,n)}function jn(t){return"number"==typeof t?Kn:"string"==typeof t?yn(t)?On:ke.test(t)?Rn:Un:Array.isArray(t)?zn:"object"==typeof t?ke.test(t)?Rn:Yn:On}function zn(t,e){const n=[...t],s=n.length,i=t.map((t,n)=>jn(t)(t,e[n]));return t=>{for(let e=0;e<s;e++)n[e]=i[e](t);return n}}function Yn(t,e){const n={...t,...e},s={};for(const i in n)void 0!==t[i]&&void 0!==e[i]&&(s[i]=jn(t[i])(t[i],e[i]));return t=>{for(const e in s)n[e]=s[e](t);return n}}const Un=(t,e)=>{const n=Ie.createTransformer(e),s=Ce(t),i=Ce(e);return s.indexes.var.length===i.indexes.var.length&&s.indexes.color.length===i.indexes.color.length&&s.indexes.number.length>=i.indexes.number.length?Nn.has(t)&&!i.values.length||Nn.has(e)&&!s.values.length?function(t,e){return Nn.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}(t,e):Wn(zn(function(t,e){var n;const s=[],i={color:0,var:0,number:0};for(let r=0;r<e.values.length;r++){const o=e.types[r],a=t.indexes[o][i[o]],l=null!==(n=t.values[a])&&void 0!==n?n:0;s[r]=l,i[o]++}return s}(s,i),i.values),n):On(t,e)};function Xn(t,e,n){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n)return ot(t,e,n);return jn(t)(t,e)}function $n({keyframes:t,velocity:e=0,power:n=.8,timeConstant:s=325,bounceDamping:i=10,bounceStiffness:r=500,modifyTarget:o,min:a,max:l,restDelta:u=.5,restSpeed:c}){const h=t[0],d={done:!1,value:h},p=t=>void 0===a?l:void 0===l||Math.abs(a-t)<Math.abs(l-t)?a:l;let f=n*e;const m=h+f,g=void 0===o?m:o(m);g!==m&&(f=g-h);const v=t=>-f*Math.exp(-t/s),y=t=>g+v(t),w=t=>{const e=v(t),n=y(t);d.done=Math.abs(e)<=u,d.value=d.done?g:n};let b,T;const x=t=>{var e;(e=d.value,void 0!==a&&e<a||void 0!==l&&e>l)&&(b=t,T=nt({keyframes:[d.value,p(d.value)],velocity:D(y,t,d.value),damping:i,stiffness:r,restDelta:u,restSpeed:c}))};return x(0),{calculatedDuration:null,next:t=>{let e=!1;return T||void 0!==b||(e=!0,w(t),x(t)),void 0!==b&&t>=b?T.next(t-b):(!e&&w(t),d)}}}const Hn=_t(.42,0,1,1),qn=_t(0,0,.58,1),Gn=_t(.42,0,.58,1),Zn={linear:e,easeIn:Hn,easeInOut:Gn,easeOut:qn,circIn:ie,circInOut:oe,circOut:re,backIn:ee,backInOut:ne,backOut:te,anticipate:se},_n=t=>{if(f(t)){n(4===t.length);const[e,s,i,r]=t;return _t(e,s,i,r)}return"string"==typeof t?Zn[t]:t};function Jn(t,s,{clamp:r=!0,ease:o,mixer:a}={}){const l=t.length;if(n(l===s.length),1===l)return()=>s[0];if(2===l&&s[0]===s[1])return()=>s[1];const u=t[0]===t[1];t[0]>t[l-1]&&(t=[...t].reverse(),s=[...s].reverse());const c=function(t,n,s){const i=[],r=s||Xn,o=t.length-1;for(let s=0;s<o;s++){let o=r(t[s],t[s+1]);if(n){const t=Array.isArray(n)?n[s]||e:n;o=Wn(t,o)}i.push(o)}return i}(s,o,a),h=c.length,d=e=>{if(u&&e<t[0])return s[0];let n=0;if(h>1)for(;n<t.length-2&&!(e<t[n+1]);n++);const r=i(t[n],t[n+1],e);return c[n](r)};return r?e=>d(L(t[0],t[l-1],e)):d}function Qn({duration:t=300,keyframes:e,times:n,ease:s="easeInOut"}){const i=it(s)?s.map(_n):_n(s),r={done:!1,value:e[0]},o=Jn(function(t,e){return t.map(t=>t*e)}(n&&n.length===e.length?n:lt(e),t),e,{ease:Array.isArray(i)?i:(a=e,l=i,a.map(()=>l||Gn).splice(0,a.length-1))});var a,l;return{calculatedDuration:t,next:e=>(r.value=o(e),r.done=e>=t,r)}}const ts=t=>{const e=({timestamp:e})=>t(e);return{start:()=>Ot.update(e,!0),stop:()=>Bt(e),now:()=>It.isProcessing?It.timestamp:Wt.now()}},es={decay:$n,inertia:$n,tween:Qn,keyframes:Qn,spring:nt},ns=t=>t/100;class ss extends Cn{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.teardown();const{onStop:t}=this.options;t&&t()};const{name:e,motionValue:n,element:s,keyframes:i}=this.options,r=(null==s?void 0:s.KeyframeResolver)||pn;this.resolver=new r(i,(t,e)=>this.onKeyframesResolved(t,e),e,n,s),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:e="keyframes",repeat:n=0,repeatDelay:s=0,repeatType:i,velocity:r=0}=this.options,o=d(e)?e:es[e]||Qn;let a,l;o!==Qn&&"number"!=typeof t[0]&&(a=Wn(ns,Xn(t[0],t[1])),t=[0,100]);const u=o({...this.options,keyframes:t});"mirror"===i&&(l=o({...this.options,keyframes:[...t].reverse(),velocity:-r})),null===u.calculatedDuration&&(u.calculatedDuration=c(u));const{calculatedDuration:h}=u,p=h+s;return{generator:u,mirroredGenerator:l,mapPercentToKeyframes:a,calculatedDuration:h,resolvedDuration:p,totalDuration:p*(n+1)-s}}onPostResolved(){const{autoplay:t=!0}=this.options;this.play(),"paused"!==this.pendingPlayState&&t?this.state=this.pendingPlayState:this.pause()}tick(t,e=!1){const{resolved:n}=this;if(!n){const{keyframes:t}=this.options;return{done:!0,value:t[t.length-1]}}const{finalKeyframe:s,generator:i,mirroredGenerator:r,mapPercentToKeyframes:o,keyframes:a,calculatedDuration:l,totalDuration:u,resolvedDuration:c}=n;if(null===this.startTime)return i.next(0);const{delay:h,repeat:d,repeatType:p,repeatDelay:f,onUpdate:m}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-u/this.speed,this.startTime)),e?this.currentTime=t:null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const g=this.currentTime-h*(this.speed>=0?1:-1),v=this.speed>=0?g<0:g>u;this.currentTime=Math.max(g,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=u);let y=this.currentTime,w=i;if(d){const t=Math.min(this.currentTime,u)/c;let e=Math.floor(t),n=t%1;!n&&t>=1&&(n=1),1===n&&e--,e=Math.min(e,d+1);Boolean(e%2)&&("reverse"===p?(n=1-n,f&&(n-=f/c)):"mirror"===p&&(w=r)),y=L(0,1,n)*c}const b=v?{done:!1,value:a[0]}:w.next(y);o&&(b.value=o(b.value));let{done:T}=b;v||null===l||(T=this.speed>=0?this.currentTime>=u:this.currentTime<=0);const x=null===this.holdTime&&("finished"===this.state||"running"===this.state&&T);return x&&void 0!==s&&(b.value=En(a,this.options,s)),m&&m(b.value),x&&this.finish(),b}get duration(){const{resolved:t}=this;return t?o(t.calculatedDuration):0}get time(){return o(this.currentTime)}set time(t){t=r(t),this.currentTime=t,null!==this.holdTime||0===this.speed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const e=this.playbackSpeed!==t;this.playbackSpeed=t,e&&(this.time=o(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved)return void(this.pendingPlayState="running");if(this.isStopped)return;const{driver:t=ts,onPlay:e,startTime:n}=this.options;this.driver||(this.driver=t(t=>this.tick(t))),e&&e();const s=this.driver.now();null!==this.holdTime?this.startTime=s-this.holdTime:this.startTime?"finished"===this.state&&(this.startTime=s):this.startTime=null!=n?n:this.calcStartTime(),"finished"===this.state&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;this._resolved?(this.state="paused",this.holdTime=null!==(t=this.currentTime)&&void 0!==t?t:0):this.pendingPlayState="paused"}complete(){"running"!==this.state&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){null!==this.cancelTime&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}}const is=new Set(["opacity","clipPath","filter","transform"]);function rs(t,e,n,{delay:s=0,duration:i=300,repeat:r=0,repeatType:o="loop",ease:a="easeInOut",times:l}={}){const u={[e]:n};l&&(u.offset=l);const c=function t(e,n){return e?"function"==typeof e&&v()?y(e,n):f(e)?b(e):Array.isArray(e)?e.map(e=>t(e,n)||T.easeOut):T[e]:void 0}(a,i);Array.isArray(c)&&(u.easing=c);return t.animate(u,{delay:s,duration:i,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:r+1,direction:"reverse"===o?"alternate":"normal"})}const os=s(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));const as={anticipate:se,backInOut:ne,circInOut:oe};class ls extends Cn{constructor(t){super(t);const{name:e,motionValue:n,element:s,keyframes:i}=this.options;this.resolver=new An(i,(t,e)=>this.onKeyframesResolved(t,e),e,n,s),this.resolver.scheduleResolve()}initPlayback(t,e){let{duration:n=300,times:s,ease:i,type:r,motionValue:o,name:a,startTime:l}=this.options;if(!o.owner||!o.owner.current)return!1;var u;if("string"==typeof i&&v()&&i in as&&(i=as[i]),d((u=this.options).type)||"spring"===u.type||!w(u.ease)){const{onComplete:e,onUpdate:o,motionValue:a,element:l,...u}=this.options,c=function(t,e){const n=new ss({...e,keyframes:t,repeat:0,delay:0,isGenerator:!0});let s={done:!1,value:t[0]};const i=[];let r=0;for(;!s.done&&r<2e4;)s=n.sample(r),i.push(s.value),r+=10;return{times:void 0,keyframes:i,duration:r-10,ease:"linear"}}(t,u);1===(t=c.keyframes).length&&(t[1]=t[0]),n=c.duration,s=c.times,i=c.ease,r="keyframes"}const c=rs(o.owner.current,a,t,{...this.options,duration:n,times:s,ease:i});return c.startTime=null!=l?l:this.calcStartTime(),this.pendingTimeline?(p(c,this.pendingTimeline),this.pendingTimeline=void 0):c.onfinish=()=>{const{onComplete:n}=this.options;o.set(En(t,this.options,e)),n&&n(),this.cancel(),this.resolveFinishedPromise()},{animation:c,duration:n,times:s,type:r,ease:i,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:e}=t;return o(e)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:e}=t;return o(e.currentTime||0)}set time(t){const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.currentTime=r(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:e}=t;return e.playbackRate}set speed(t){const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:e}=t;return e.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:e}=t;return e.startTime}attachTimeline(t){if(this._resolved){const{resolved:n}=this;if(!n)return e;const{animation:s}=n;p(s,t)}else this.pendingTimeline=t;return e}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:e}=t;"finished"===e.playState&&this.updateFinishedPromise(),e.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:e}=t;e.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:e,keyframes:n,duration:s,type:i,ease:o,times:a}=t;if("idle"===e.playState||"finished"===e.playState)return;if(this.time){const{motionValue:t,onUpdate:e,onComplete:l,element:u,...c}=this.options,h=new ss({...c,keyframes:n,duration:s,type:i,ease:o,times:a,isGenerator:!0}),d=r(this.time);t.setWithVelocity(h.sample(d-10).value,h.sample(d).value,10)}const{onStop:l}=this.options;l&&l(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:e,name:n,repeatDelay:s,repeatType:i,damping:r,type:o}=t;if(!(e&&e.owner&&e.owner.current instanceof HTMLElement))return!1;const{onUpdate:a,transformTemplate:l}=e.owner.getProps();return os()&&n&&is.has(n)&&!a&&!l&&!s&&"mirror"!==i&&0!==r&&"inertia"!==o}}const us={type:"spring",stiffness:500,damping:25,restSpeed:10},cs={type:"keyframes",duration:.8},hs={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},ds=(t,{keyframes:e})=>e.length>2?cs:Vt.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:us:hs;const ps=(t,e,n,s={},i,o)=>a=>{const c=u(s,t)||{},h=c.delay||s.delay||0;let{elapsed:d=0}=s;d-=r(h);let p={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...c,delay:-d,onUpdate:t=>{e.set(t),c.onUpdate&&c.onUpdate(t)},onComplete:()=>{a(),c.onComplete&&c.onComplete()},name:t,motionValue:e,element:o?void 0:i};(function({when:t,delay:e,delayChildren:n,staggerChildren:s,staggerDirection:i,repeat:r,repeatType:o,repeatDelay:a,from:l,elapsed:u,...c}){return!!Object.keys(c).length})(c)||(p={...p,...ds(t,p)}),p.duration&&(p.duration=r(p.duration)),p.repeatDelay&&(p.repeatDelay=r(p.repeatDelay)),void 0!==p.from&&(p.keyframes[0]=p.from);let f=!1;if((!1===p.type||0===p.duration&&!p.repeatDelay)&&(p.duration=0,0===p.delay&&(f=!0)),p.allowFlatten=!c.type&&!c.ease,f&&!o&&void 0!==e.get()){const t=En(p.keyframes,c);if(void 0!==t)return Ot.update(()=>{p.onUpdate(t),p.onComplete()}),new l([])}return!o&&ls.supports(p)?new ls(p):new ss(p)};function fs({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,s}function ms(t,e,{delay:n=0,transitionOverride:s,type:i}={}){var r;let{transition:o=t.getDefaultTransition(),transitionEnd:a,...l}=e;s&&(o=s);const c=[],h=i&&t.animationState&&t.animationState.getState()[i];for(const e in l){const s=t.getValue(e,null!==(r=t.latestValues[e])&&void 0!==r?r:null),i=l[e];if(void 0===i||h&&fs(h,e))continue;const a={delay:n,...u(o||{},e)};let d=!1;if(window.MotionHandoffAnimation){const n=Gt(t);if(n){const t=window.MotionHandoffAnimation(n,e,Ot);null!==t&&(a.startTime=t,d=!0)}}$t(t,e),s.start(ps(e,s,i,t.shouldReduceMotion&&kt.has(e)?{type:!1}:a,t,d));const p=s.animation;p&&c.push(p)}return a&&Promise.all(c).then(()=>{Ot.update(()=>{a&&Xt(t,a)})}),c}const gs=()=>({x:{min:0,max:0},y:{min:0,max:0}}),vs={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},ys={};for(const t in vs)ys[t]={isEnabled:e=>vs[t].some(t=>!!e[t])};const ws="undefined"!=typeof window,bs={current:null},Ts={current:!1};const xs=[...Sn,ke,Ie];const Ss=["initial","animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"];function Ms(t){return null!==(e=t.animate)&&"object"==typeof e&&"function"==typeof e.start||Ss.some(e=>function(t){return"string"==typeof t||Array.isArray(t)}(t[e]));var e}const As=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Vs{scrapeMotionValuesFromProps(t,e,n){return{}}constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:s,blockInitialAnimation:i,visualState:r},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=pn,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const t=Wt.now();this.renderScheduledAt<t&&(this.renderScheduledAt=t,Ot.render(this.render,!1,!0))};const{latestValues:a,renderState:l,onUpdate:u}=r;this.onUpdate=u,this.latestValues=a,this.baseTarget={...a},this.initialValues=e.initial?{...a}:{},this.renderState=l,this.parent=t,this.props=e,this.presenceContext=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.options=o,this.blockInitialAnimation=Boolean(i),this.isControllingVariants=Ms(e),this.isVariantNode=function(t){return Boolean(Ms(t)||t.variants)}(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:c,...h}=this.scrapeMotionValuesFromProps(e,{},this);for(const t in h){const e=h[t];void 0!==a[t]&&ut(e)&&e.set(a[t],!1)}}mount(t){this.current=t,Mt.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((t,e)=>this.bindToMotionValue(e,t)),Ts.current||function(){if(Ts.current=!0,ws)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>bs.current=t.matches;t.addListener(e),e()}else bs.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||bs.current),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),Bt(this.notifyUpdate),Bt(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}bindToMotionValue(t,e){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const n=Vt.has(t);n&&this.onBindTransform&&this.onBindTransform();const s=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&Ot.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0)}),i=e.on("renderRequest",this.scheduleRender);let r;window.MotionCheckAppearSync&&(r=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,()=>{s(),i(),r&&r(),e.owner&&e.stop()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}updateFeatures(){let t="animation";for(t in ys){const e=ys[t];if(!e)continue;const{isEnabled:n,Feature:s}=e;if(!this.features[t]&&s&&n(this.props)&&(this.features[t]=new s(this)),this.features[t]){const e=this.features[t];e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;e<As.length;e++){const n=As[e];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);const s=t["on"+n];s&&(this.propEventSubscriptions[n]=this.on(n,s))}this.prevMotionValues=function(t,e,n){for(const s in e){const i=e[s],r=n[s];if(ut(i))t.addValue(s,i);else if(ut(r))t.addValue(s,jt(i,{owner:t}));else if(r!==i)if(t.hasValue(s)){const e=t.getValue(s);!0===e.liveStyle?e.jump(i):e.hasAnimated||e.set(i)}else{const e=t.getStaticValue(s);t.addValue(s,jt(void 0!==e?e:i,{owner:t}))}}for(const s in n)void 0===e[s]&&t.removeValue(s);return e}(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const e=this.getClosestVariantNode();if(e)return e.variantChildren&&e.variantChildren.add(t),()=>e.variantChildren.delete(t)}addValue(t,e){const n=this.values.get(t);e!==n&&(n&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e),this.latestValues[t]=e.get())}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return void 0===n&&void 0!==e&&(n=jt(null===e?void 0:e,{owner:this}),this.addValue(t,n)),n}readValue(t,e){var n;let s=void 0===this.latestValues[t]&&this.current?null!==(n=this.getBaseTargetFromProps(this.props,t))&&void 0!==n?n:this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];var i;return null!=s&&("string"==typeof s&&(fn(s)||ae(s))?s=parseFloat(s):(i=s,!xs.find(xn(i))&&Ie.test(e)&&(s=Xe(t,e))),this.setBaseTarget(t,ut(s)?s.get():s)),ut(s)?s.get():s}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){var e;const{initial:n}=this.props;let s;if("string"==typeof n||"object"==typeof n){const i=Yt(this.props,n,null===(e=this.presenceContext)||void 0===e?void 0:e.custom);i&&(s=i[t])}if(n&&void 0!==s)return s;const i=this.getBaseTargetFromProps(this.props,t);return void 0===i||ut(i)?void 0!==this.initialValues[t]&&void 0===s?void 0:this.baseTarget[t]:i}on(t,e){return this.events[t]||(this.events[t]=new Nt),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}}class ks extends Vs{constructor(){super(...arguments),this.KeyframeResolver=An}sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){return t.style?t.style[e]:void 0}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;ut(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=""+t)}))}}const Ps=(t,e)=>e&&"number"==typeof t?e.transform(t):t,Es={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Cs=At.length;function Fs(t,e,n){const{style:s,vars:i,transformOrigin:r}=t;let o=!1,a=!1;for(const t in e){const n=e[t];if(Vt.has(t))o=!0;else if(gn(t))i[t]=n;else{const e=Ps(n,ze[t]);t.startsWith("origin")?(a=!0,r[t]=e):s[t]=e}}if(e.transform||(o||n?s.transform=function(t,e,n){let s="",i=!0;for(let r=0;r<Cs;r++){const o=At[r],a=t[o];if(void 0===a)continue;let l=!0;if(l="number"==typeof a?a===(o.startsWith("scale")?1:0):0===parseFloat(a),!l||n){const t=Ps(a,ze[o]);if(!l){i=!1;s+=`${Es[o]||o}(${t}) `}n&&(e[o]=t)}}return s=s.trim(),n?s=n(e,i?"":s):i&&(s="none"),s}(e,t.transform,n):s.transform&&(s.transform="none")),a){const{originX:t="50%",originY:e="50%",originZ:n=0}=r;s.transformOrigin=`${t} ${e} ${n}`}}const Os={offset:"stroke-dashoffset",array:"stroke-dasharray"},Bs={offset:"strokeDashoffset",array:"strokeDasharray"};function Is(t,e,n){return"string"==typeof t?t:xe.transform(e+n*t)}function Ls(t,{attrX:e,attrY:n,attrScale:s,originX:i,originY:r,pathLength:o,pathSpacing:a=1,pathOffset:l=0,...u},c,h){if(Fs(t,u,h),c)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:d,style:p,dimensions:f}=t;d.transform&&(f&&(p.transform=d.transform),delete d.transform),f&&(void 0!==i||void 0!==r||p.transform)&&(p.transformOrigin=function(t,e,n){return`${Is(e,t.x,t.width)} ${Is(n,t.y,t.height)}`}(f,void 0!==i?i:.5,void 0!==r?r:.5)),void 0!==e&&(d.x=e),void 0!==n&&(d.y=n),void 0!==s&&(d.scale=s),void 0!==o&&function(t,e,n=1,s=0,i=!0){t.pathLength=1;const r=i?Os:Bs;t[r.offset]=xe.transform(-s);const o=xe.transform(e),a=xe.transform(n);t[r.array]=`${o} ${a}`}(d,o,a,l,!1)}const Rs=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function Ds(t,{style:e,vars:n},s,i){Object.assign(t.style,e,i&&i.getProjectionStyles(s));for(const e in n)t.style.setProperty(e,n[e])}const Ws={};function Ns(t,{layout:e,layoutId:n}){return Vt.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!Ws[t]||"opacity"===t)}function Ks(t,e,n){var s;const{style:i}=t,r={};for(const o in i)(ut(i[o])||e.style&&ut(e.style[o])||Ns(o,t)||void 0!==(null===(s=null==n?void 0:n.getValue(o))||void 0===s?void 0:s.liveStyle))&&(r[o]=i[o]);return r}class js extends ks{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=gs,this.updateDimensions=()=>{this.current&&!this.renderState.dimensions&&function(t,e){try{e.dimensions="function"==typeof t.getBBox?t.getBBox():t.getBoundingClientRect()}catch(t){e.dimensions={x:0,y:0,width:0,height:0}}}(this.current,this.renderState)}}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(Vt.has(e)){const t=Ue(e);return t&&t.default||0}return e=Rs.has(e)?e:Ht(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,n){return function(t,e,n){const s=Ks(t,e,n);for(const n in t)if(ut(t[n])||ut(e[n])){s[-1!==At.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=t[n]}return s}(t,e,n)}onBindTransform(){this.current&&!this.renderState.dimensions&&Ot.postRender(this.updateDimensions)}build(t,e,n){Ls(t,e,this.isSVGTag,n.transformTemplate)}renderInstance(t,e,n,s){!function(t,e,n,s){Ds(t,e,void 0,s);for(const n in e.attrs)t.setAttribute(Rs.has(n)?n:Ht(n),e.attrs[n])}(t,e,0,s)}mount(t){var e;this.isSVGTag="string"==typeof(e=t.tagName)&&"svg"===e.toLowerCase(),super.mount(t)}}class zs extends ks{constructor(){super(...arguments),this.type="html",this.renderInstance=Ds}readValueFromInstance(t,e){if(Vt.has(e))return((t,e)=>{const{transform:n="none"}=getComputedStyle(t);return en(n,e)})(t,e);{const s=(n=t,window.getComputedStyle(n)),i=(gn(e)?s.getPropertyValue(e):s[e])||0;return"string"==typeof i?i.trim():i}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return function(t,e){return function({top:t,left:e,right:n,bottom:s}){return{x:{min:e,max:n},y:{min:t,max:s}}}(function(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),s=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}(t.getBoundingClientRect(),e))}(t,e)}build(t,e,n){Fs(t,e,n.transformTemplate)}scrapeMotionValuesFromProps(t,e,n){return Ks(t,e,n)}}class Ys extends Vs{constructor(){super(...arguments),this.type="object"}readValueFromInstance(t,e){if(function(t,e){return t in e}(e,t)){const n=t[e];if("string"==typeof n||"number"==typeof n)return n}}getBaseTargetFromProps(){}removeValueFromRenderState(t,e){delete e.output[t]}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}build(t,e){Object.assign(t.output,e)}renderInstance(t,{output:e}){Object.assign(t,e)}sortInstanceNodePosition(){return 0}}function Us(t){const e={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=function(t){return t instanceof SVGElement&&"svg"!==t.tagName}(t)?new js(e):new zs(e);n.mount(t),Mt.set(t,n)}function Xs(t){const e=new Ys({presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}});e.mount(t),Mt.set(t,e)}function $s(t,e,n,s){const i=[];if(function(t,e){return ut(t)||"number"==typeof t||"string"==typeof t&&!ct(e)}(t,e))i.push(function(t,e,n){const s=ut(t)?t:jt(t);return s.start(ps("",s,e,n)),s.animation}(t,ct(e)&&e.default||e,n&&n.default||n));else{const r=ht(t,e,s),o=r.length;for(let t=0;t<o;t++){const s=r[t],a=s instanceof Element?Us:Xs;Mt.has(s)||a(s);const l=Mt.get(s),u={...n};"delay"in u&&"function"==typeof u.delay&&(u.delay=u.delay(t,o)),i.push(...ms(l,{...e,transition:u},{}))}}return i}function Hs(t,e,n){const s=[];return function(t,{defaultTransition:e={},...n}={},s,o){const a=e.duration||.3,l=new Map,u=new Map,c={},p=new Map;let f=0,m=0,g=0;for(let n=0;n<t.length;n++){const i=t[n];if("string"==typeof i){p.set(i,m);continue}if(!Array.isArray(i)){p.set(i.name,pt(m,i.at,f,p));continue}let[l,v,y={}]=i;void 0!==y.at&&(m=pt(m,y.at,f,p));let w=0;const b=(t,n,s,i=0,l=0)=>{const u=bt(t),{delay:c=0,times:p=lt(u),type:f="keyframes",repeat:v,repeatType:y,repeatDelay:b=0,...T}=n;let{ease:x=e.ease||"easeOut",duration:S}=n;const M="function"==typeof c?c(i,l):c,A=u.length,V=d(f)?f:null==o?void 0:o[f];if(A<=2&&V){let t=100;if(2===A&&St(u)){const e=u[1]-u[0];t=Math.abs(e)}const e={...T};void 0!==S&&(e.duration=r(S));const n=h(e,t,V);x=n.ease,S=n.duration}null!=S||(S=a);const k=m+M;1===p.length&&0===p[0]&&(p[1]=1);const P=p.length-u.length;if(P>0&&at(p,P),1===u.length&&u.unshift(null),v){S=dt(S,v);const t=[...u],e=[...p];x=Array.isArray(x)?[...x]:[x];const n=[...x];for(let s=0;s<v;s++){u.push(...t);for(let i=0;i<t.length;i++)p.push(e[i]+(s+1)),x.push(0===i?"linear":rt(n,i-1))}gt(p,v)}const E=k+S;mt(s,u,x,p,k,E),w=Math.max(M+S,w),g=Math.max(E,g)};if(ut(l)){b(v,y,wt("default",yt(l,u)))}else{const t=ht(l,v,s,c),e=t.length;for(let n=0;n<e;n++){v=v,y=y;const s=yt(t[n],u);for(const t in v)b(v[t],Tt(y,t),wt(t,s),n,e)}}f=m,m+=w}return u.forEach((t,s)=>{for(const r in t){const o=t[r];o.sort(vt);const a=[],u=[],c=[];for(let t=0;t<o.length;t++){const{at:e,value:n,easing:s}=o[t];a.push(n),u.push(i(0,g,e)),c.push(s||"easeOut")}0!==u[0]&&(u.unshift(0),a.unshift(a[0]),c.unshift("easeInOut")),1!==u[u.length-1]&&(u.push(1),a.push(null)),l.has(s)||l.set(s,{keyframes:{},transition:{}});const h=l.get(s);h.keyframes[r]=a,h.transition[r]={...e,duration:g,ease:c,times:u,...n}}}),l}(t,e,n,{spring:nt}).forEach(({keyframes:t,transition:e},n)=>{s.push(...$s(n,t,e))}),s}function qs(t){return function(e,n,s){let i=[];var r;r=e,i=Array.isArray(r)&&r.some(Array.isArray)?Hs(e,n,t):$s(e,n,s,t);const o=new l(i);return t&&t.animations.push(o),o}}const Gs=qs();function Zs(t,e,n){t.style.setProperty(e,n)}function _s(t,e,n){t.style[e]=n}const Js=s(()=>{try{document.createElement("div").animate({opacity:[1]})}catch(t){return!1}return!0}),Qs=new WeakMap;function ti(t){const e=Qs.get(t)||new Map;return Qs.set(t,e),Qs.get(t)}class ei extends class{constructor(t){this.animation=t}get duration(){var t,e,n;const s=(null===(e=null===(t=this.animation)||void 0===t?void 0:t.effect)||void 0===e?void 0:e.getComputedTiming().duration)||(null===(n=this.options)||void 0===n?void 0:n.duration)||300;return o(Number(s))}get time(){var t;return this.animation?o((null===(t=this.animation)||void 0===t?void 0:t.currentTime)||0):0}set time(t){this.animation&&(this.animation.currentTime=r(t))}get speed(){return this.animation?this.animation.playbackRate:1}set speed(t){this.animation&&(this.animation.playbackRate=t)}get state(){return this.animation?this.animation.playState:"finished"}get startTime(){return this.animation?this.animation.startTime:null}get finished(){return this.animation?this.animation.finished:Promise.resolve()}play(){this.animation&&this.animation.play()}pause(){this.animation&&this.animation.pause()}stop(){this.animation&&"idle"!==this.state&&"finished"!==this.state&&(this.animation.commitStyles&&this.animation.commitStyles(),this.cancel())}flatten(){var t,e;this.animation&&(null===(t=this.options)||void 0===t?void 0:t.allowFlatten)&&(null===(e=this.animation.effect)||void 0===e||e.updateTiming({easing:"linear"}))}attachTimeline(t){return this.animation&&p(this.animation,t),e}complete(){this.animation&&this.animation.finish()}cancel(){try{this.animation&&this.animation.cancel()}catch(t){}}}{constructor(t,e,s,i){const o=e.startsWith("--");n("string"!=typeof i.type);const a=ti(t).get(e);a&&a.stop();if(Array.isArray(s)||(s=[s]),function(t,e,n){for(let s=0;s<e.length;s++)null===e[s]&&(e[s]=0===s?n():e[s-1]),"number"==typeof e[s]&&Ne[t]&&(e[s]=Ne[t].transform(e[s]));!Js()&&e.length<2&&e.unshift(n())}(e,s,()=>e.startsWith("--")?t.style.getPropertyValue(e):window.getComputedStyle(t)[e]),d(i.type)){const t=h(i,100,i.type);i.ease=v()?t.ease:"easeOut",i.duration=r(t.duration),i.type="keyframes"}else i.ease=i.ease||"easeOut";const l=()=>{this.setValue(t,e,En(s,i)),this.cancel(),this.resolveFinishedPromise()},u=()=>{this.setValue=o?Zs:_s,this.options=i,this.updateFinishedPromise(),this.removeAnimation=()=>{const n=Qs.get(t);n&&n.delete(e)}};os()?(super(rs(t,e,s,i)),u(),!1===i.autoplay&&this.animation.pause(),this.animation.onfinish=l,ti(t).set(e,this)):(super(),u(),l())}then(t,e){return this.currentFinishedPromise.then(t,e)}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}play(){"finished"===this.state&&this.updateFinishedPromise(),super.play()}cancel(){this.removeAnimation(),super.cancel()}}const ni=(t=>function(e,n,s){return new l(function(t,e,n,s){const i=A(t,s),o=i.length,a=[];for(let t=0;t<o;t++){const s=i[t],l={...n};"function"==typeof l.delay&&(l.delay=l.delay(t,o));for(const t in e){const n=e[t],i={...u(l,t)};i.duration=i.duration?r(i.duration):i.duration,i.delay=r(i.delay||0),i.allowFlatten=!l.type&&!l.ease,a.push(new ei(s,t,n,i))}}return a}(e,n,s,t))})();function si(t,e){let n;const s=()=>{const{currentTime:s}=e,i=(null===s?0:s.value)/100;n!==i&&t(i),n=i};return Ot.update(s,!0),()=>Bt(s)}const ii=new WeakMap;let ri;function oi({target:t,contentRect:e,borderBoxSize:n}){var s;null===(s=ii.get(t))||void 0===s||s.forEach(s=>{s({target:t,contentSize:e,get size(){return function(t,e){if(e){const{inlineSize:t,blockSize:n}=e[0];return{width:t,height:n}}return t instanceof SVGElement&&"getBBox"in t?t.getBBox():{width:t.offsetWidth,height:t.offsetHeight}}(t,n)}})})}function ai(t){t.forEach(oi)}function li(t,e){ri||"undefined"!=typeof ResizeObserver&&(ri=new ResizeObserver(ai));const n=A(t);return n.forEach(t=>{let n=ii.get(t);n||(n=new Set,ii.set(t,n)),n.add(e),null==ri||ri.observe(t)}),()=>{n.forEach(t=>{const n=ii.get(t);null==n||n.delete(e),(null==n?void 0:n.size)||null==ri||ri.unobserve(t)})}}const ui=new Set;let ci;function hi(t){return ui.add(t),ci||(ci=()=>{const t={width:window.innerWidth,height:window.innerHeight},e={target:window,size:t,contentSize:t};ui.forEach(t=>t(e))},window.addEventListener("resize",ci)),()=>{ui.delete(t),!ui.size&&ci&&(ci=void 0)}}const di={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}};function pi(t,e,n,s){const r=n[e],{length:o,position:a}=di[e],l=r.current,u=n.time;r.current=t["scroll"+a],r.scrollLength=t["scroll"+o]-t["client"+o],r.offset.length=0,r.offset[0]=0,r.offset[1]=r.scrollLength,r.progress=i(0,r.scrollLength,r.current);const c=s-u;r.velocity=c>50?0:R(r.current-l,c)}const fi={start:0,center:.5,end:1};function mi(t,e,n=0){let s=0;if(t in fi&&(t=fi[t]),"string"==typeof t){const e=parseFloat(t);t.endsWith("px")?s=e:t.endsWith("%")?t=e/100:t.endsWith("vw")?s=e/100*document.documentElement.clientWidth:t.endsWith("vh")?s=e/100*document.documentElement.clientHeight:t=e}return"number"==typeof t&&(s=e*t),n+s}const gi=[0,0];function vi(t,e,n,s){let i=Array.isArray(t)?t:gi,r=0,o=0;return"number"==typeof t?i=[t,t]:"string"==typeof t&&(i=(t=t.trim()).includes(" ")?t.split(" "):[t,fi[t]?t:"0"]),r=mi(i[0],n,s),o=mi(i[1],e),r-o}const yi={Enter:[[0,1],[1,1]],Exit:[[0,0],[1,0]],Any:[[1,0],[0,1]],All:[[0,0],[1,1]]},wi={x:0,y:0};function bi(t,e,n){const{offset:s=yi.All}=n,{target:i=t,axis:r="y"}=n,o="y"===r?"height":"width",a=i!==t?function(t,e){const n={x:0,y:0};let s=t;for(;s&&s!==e;)if(s instanceof HTMLElement)n.x+=s.offsetLeft,n.y+=s.offsetTop,s=s.offsetParent;else if("svg"===s.tagName){const t=s.getBoundingClientRect();s=s.parentElement;const e=s.getBoundingClientRect();n.x+=t.left-e.left,n.y+=t.top-e.top}else{if(!(s instanceof SVGGraphicsElement))break;{const{x:t,y:e}=s.getBBox();n.x+=t,n.y+=e;let i=null,r=s.parentNode;for(;!i;)"svg"===r.tagName&&(i=r),r=s.parentNode;s=i}}return n}(i,t):wi,l=i===t?{width:t.scrollWidth,height:t.scrollHeight}:function(t){return"getBBox"in t&&"svg"!==t.tagName?t.getBBox():{width:t.clientWidth,height:t.clientHeight}}(i),u={width:t.clientWidth,height:t.clientHeight};e[r].offset.length=0;let c=!e[r].interpolate;const h=s.length;for(let t=0;t<h;t++){const n=vi(s[t],u[o],l[o],a[r]);c||n===e[r].interpolatorOffsets[t]||(c=!0),e[r].offset[t]=n}c&&(e[r].interpolate=Jn(e[r].offset,lt(s),{clamp:!1}),e[r].interpolatorOffsets=[...e[r].offset]),e[r].progress=L(0,1,e[r].interpolate(e[r].current))}function Ti(t,e,n,s={}){return{measure:()=>function(t,e=t,n){if(n.x.targetOffset=0,n.y.targetOffset=0,e!==t){let s=e;for(;s&&s!==t;)n.x.targetOffset+=s.offsetLeft,n.y.targetOffset+=s.offsetTop,s=s.offsetParent}n.x.targetLength=e===t?e.scrollWidth:e.clientWidth,n.y.targetLength=e===t?e.scrollHeight:e.clientHeight,n.x.containerLength=t.clientWidth,n.y.containerLength=t.clientHeight}(t,s.target,n),update:e=>{!function(t,e,n){pi(t,"x",e,n),pi(t,"y",e,n),e.time=n}(t,n,e),(s.offset||s.target)&&bi(t,n,s)},notify:()=>e(n)}}const xi=new WeakMap,Si=new WeakMap,Mi=new WeakMap,Ai=t=>t===document.documentElement?window:t;function Vi(t,{container:e=document.documentElement,...n}={}){let s=Mi.get(e);s||(s=new Set,Mi.set(e,s));const i=Ti(e,t,{time:0,x:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0},y:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0}},n);if(s.add(i),!xi.has(e)){const t=()=>{for(const t of s)t.measure()},n=()=>{for(const t of s)t.update(It.timestamp)},i=()=>{for(const t of s)t.notify()},a=()=>{Ot.read(t,!1,!0),Ot.read(n,!1,!0),Ot.update(i,!1,!0)};xi.set(e,a);const l=Ai(e);window.addEventListener("resize",a,{passive:!0}),e!==document.documentElement&&Si.set(e,(o=a,"function"==typeof(r=e)?hi(r):li(r,o))),l.addEventListener("scroll",a,{passive:!0})}var r,o;const a=xi.get(e);return Ot.read(a,!1,!0),()=>{var t;Bt(a);const n=Mi.get(e);if(!n)return;if(n.delete(i),n.size)return;const s=xi.get(e);xi.delete(e),s&&(Ai(e).removeEventListener("scroll",s),null===(t=Si.get(e))||void 0===t||t(),window.removeEventListener("resize",s))}}const ki=new Map;function Pi({source:t,container:e=document.documentElement,axis:n="y"}={}){t&&(e=t),ki.has(e)||ki.set(e,{});const s=ki.get(e);return s[n]||(s[n]=a()?new ScrollTimeline({source:e,axis:n}):function({source:t,container:e,axis:n="y"}){t&&(e=t);const s={value:0},i=Vi(t=>{s.value=100*t[n].progress},{container:e,axis:n});return{currentTime:s,cancel:i}}({source:e,axis:n})),s[n]}function Ei(t){return t&&(t.target||t.offset)}const Ci={some:0,all:1};const Fi=(t,e)=>Math.abs(t-e);const Oi=Ot,Bi=Ct.reduce((t,e)=>(t[e]=t=>Bt(t),t),{});t.MotionValue=Kt,t.animate=Gs,t.animateMini=ni,t.anticipate=se,t.backIn=ee,t.backInOut=ne,t.backOut=te,t.cancelFrame=Bt,t.cancelSync=Bi,t.circIn=ie,t.circInOut=oe,t.circOut=re,t.clamp=L,t.createScopedAnimate=qs,t.cubicBezier=_t,t.delay=function(t,e){return function(t,e){const n=Wt.now(),s=({timestamp:i})=>{const r=i-n;r>=e&&(Bt(s),t(r-e))};return Ot.read(s,!0),()=>Bt(s)}(t,r(e))},t.distance=Fi,t.distance2D=function(t,e){const n=Fi(t.x,e.x),s=Fi(t.y,e.y);return Math.sqrt(n**2+s**2)},t.easeIn=Hn,t.easeInOut=Gn,t.easeOut=qn,t.frame=Ot,t.frameData=It,t.frameSteps=Lt,t.hover=function(t,e,n={}){const[s,i,r]=V(t,n),o=t=>{if(!k(t))return;const{target:n}=t,s=e(n,t);if("function"!=typeof s||!n)return;const r=t=>{k(t)&&(s(t),n.removeEventListener("pointerleave",r))};n.addEventListener("pointerleave",r,i)};return s.forEach(t=>{t.addEventListener("pointerenter",o,i)}),r},t.inView=function(t,e,{root:n,margin:s,amount:i="some"}={}){const r=A(t),o=new WeakMap,a=new IntersectionObserver(t=>{t.forEach(t=>{const n=o.get(t.target);if(t.isIntersecting!==Boolean(n))if(t.isIntersecting){const n=e(t.target,t);"function"==typeof n?o.set(t.target,n):a.unobserve(t.target)}else"function"==typeof n&&(n(t),o.delete(t.target))})},{root:n,rootMargin:s,threshold:"number"==typeof i?i:Ci[i]});return r.forEach(t=>a.observe(t)),()=>a.disconnect()},t.inertia=$n,t.interpolate=Jn,t.invariant=n,t.isDragActive=M,t.keyframes=Qn,t.mirrorEasing=Jt,t.mix=Xn,t.motionValue=jt,t.noop=e,t.pipe=Wn,t.press=function(t,e,n={}){const[s,i,r]=V(t,n),o=t=>{const n=t.currentTarget;if(!n||!I(t)||F.has(n))return;F.add(n),P(t,"set");const s=e(n,t),r=(t,e)=>{n.removeEventListener("pointerup",o),n.removeEventListener("pointercancel",a),P(t,"release"),I(t)&&F.has(n)&&(F.delete(n),"function"==typeof s&&s(t,{success:e}))},o=t=>{const e=!!t.isTrusted&&(s=t,i=n instanceof Element?n.getBoundingClientRect():{left:0,top:0,right:window.innerWidth,bottom:window.innerHeight},s.clientX<i.left||s.clientX>i.right||s.clientY<i.top||s.clientY>i.bottom);var s,i;r(t,!e&&(!(n instanceof Element)||E(n,t.target)))},a=t=>{r(t,!1)};n.addEventListener("pointerup",o,i),n.addEventListener("pointercancel",a,i),n.addEventListener("lostpointercapture",a,i)};return s.forEach(t=>{let e=!1;var s;(t=n.useGlobalTarget?window:t)instanceof HTMLElement&&(e=!0,s=t,C.has(s.tagName)||-1!==s.tabIndex||null!==t.getAttribute("tabindex")||(t.tabIndex=0)),t.addEventListener("pointerdown",o,i),e&&t.addEventListener("focus",t=>((t,e)=>{const n=t.currentTarget;if(!n)return;const s=O(()=>{if(F.has(n))return;B(n,"down");const t=O(()=>{B(n,"up")});n.addEventListener("keyup",t,e),n.addEventListener("blur",()=>B(n,"cancel"),e)});n.addEventListener("keydown",s,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",s),e)})(t,i),i)}),r},t.progress=i,t.reverseEasing=Qt,t.scroll=function(t,{axis:n="y",...s}={}){const i={axis:n,...s};return"function"==typeof t?function(t,e){return function(t){return 2===t.length}(t)||Ei(e)?Vi(n=>{t(n[e.axis].progress,n)},e):si(t,Pi(e))}(t,i):function(t,n){if(t.flatten(),Ei(n))return t.pause(),Vi(e=>{t.time=t.duration*e[n.axis].progress},n);{const s=Pi(n);return t.attachTimeline?t.attachTimeline(s,t=>(t.pause(),si(e=>{t.time=t.duration*e},s))):e}}(t,i)},t.scrollInfo=Vi,t.spring=nt,t.stagger=function(t=.1,{startDelay:e=0,from:n=0,ease:s}={}){return(i,r)=>{const o="number"==typeof n?n:function(t,e){if("first"===t)return 0;{const n=e-1;return"last"===t?n:n/2}}(n,r),a=Math.abs(o-i);let l=t*a;if(s){const e=r*t;l=_n(s)(l/e)*e}return e+l}},t.steps=function(t,e="end"){return n=>{const s=(n="end"===e?Math.min(n,.999):Math.max(n,.001))*t,i="end"===e?Math.floor(s):Math.ceil(s);return L(0,1,i/t)}},t.sync=Oi,t.time=Wt,t.transform=function(...t){const e=!Array.isArray(t[0]),n=e?0:-1,s=t[0+n],i=t[1+n],r=t[2+n],o=t[3+n],a=Jn(i,r,{mixer:(l=r[0],(t=>t&&"object"==typeof t&&t.mix)(l)?l.mix:void 0),...o});var l;return e?a(s):a},t.wrap=st}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "motion",
3
- "version": "12.4.11",
3
+ "version": "12.4.13",
4
4
  "description": "An animation library for JavaScript and React.",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/es/motion/lib/index.mjs",
@@ -76,7 +76,7 @@
76
76
  "postpublish": "git push --tags"
77
77
  },
78
78
  "dependencies": {
79
- "framer-motion": "^12.4.11",
79
+ "framer-motion": "^12.4.13",
80
80
  "tslib": "^2.4.0"
81
81
  },
82
82
  "peerDependencies": {
@@ -95,5 +95,5 @@
95
95
  "optional": true
96
96
  }
97
97
  },
98
- "gitHead": "9316ca820205fedca95a4db2fc0c9f81df77d80c"
98
+ "gitHead": "ac0bc2f6003a20face739983390102b033d291df"
99
99
  }