react-ui-animate 3.0.0-rc.2 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/README.md +68 -30
  2. package/dist/animation/animationType.d.ts +16 -0
  3. package/dist/animation/helpers/index.d.ts +2 -0
  4. package/dist/animation/helpers/isDefined.d.ts +1 -0
  5. package/dist/animation/{lib/index.d.ts → index.d.ts} +3 -1
  6. package/dist/animation/{lib/interpolation.d.ts → interpolation.d.ts} +4 -3
  7. package/dist/animation/{lib/modules → modules}/AnimatedBlock.d.ts +2 -2
  8. package/dist/animation/{lib/modules → modules}/AnimatedImage.d.ts +2 -2
  9. package/dist/animation/{lib/modules → modules}/AnimatedInline.d.ts +2 -2
  10. package/dist/animation/{lib/modules → modules}/MountedBlock.d.ts +3 -2
  11. package/dist/animation/{lib/modules → modules}/ScrollableBlock.d.ts +2 -3
  12. package/dist/animation/{lib/modules → modules}/TransitionBlock.d.ts +2 -3
  13. package/dist/animation/{lib/useAnimatedValue.d.ts → useAnimatedValue.d.ts} +7 -2
  14. package/dist/animation/{lib/useMountedValue.d.ts → useMountedValue.d.ts} +1 -1
  15. package/dist/animation/withFunctions.d.ts +63 -0
  16. package/dist/index.d.ts +6 -6
  17. package/dist/index.js +1 -1
  18. package/dist/index.js.map +1 -1
  19. package/package.json +4 -1
  20. package/dist/animation/core/controllers/Animation.d.ts +0 -16
  21. package/dist/animation/core/controllers/FluidValue.d.ts +0 -32
  22. package/dist/animation/core/controllers/RequestAnimationFrame.d.ts +0 -8
  23. package/dist/animation/core/controllers/SpringAnimation.d.ts +0 -41
  24. package/dist/animation/core/controllers/TimingAnimation.d.ts +0 -35
  25. package/dist/animation/core/easing/Bezier.d.ts +0 -8
  26. package/dist/animation/core/easing/Easing.d.ts +0 -40
  27. package/dist/animation/core/helpers/camelCaseToKebabCase.d.ts +0 -8
  28. package/dist/animation/core/helpers/getCleanProps.d.ts +0 -10
  29. package/dist/animation/core/helpers/getCssValue.d.ts +0 -8
  30. package/dist/animation/core/helpers/index.d.ts +0 -5
  31. package/dist/animation/core/helpers/isDefined.d.ts +0 -12
  32. package/dist/animation/core/helpers/isFluidValue.d.ts +0 -10
  33. package/dist/animation/core/index.d.ts +0 -11
  34. package/dist/animation/core/interpolation/Colors.d.ts +0 -25
  35. package/dist/animation/core/interpolation/Interpolation.d.ts +0 -80
  36. package/dist/animation/core/interpolation/__tests__/Colors.test.d.ts +0 -1
  37. package/dist/animation/core/react/fluid.d.ts +0 -6
  38. package/dist/animation/core/react/makeFluid.d.ts +0 -30
  39. package/dist/animation/core/react/transforms.d.ts +0 -6
  40. package/dist/animation/core/react/useFluidValue.d.ts +0 -9
  41. package/dist/animation/core/react/useMount.d.ts +0 -20
  42. package/dist/animation/lib/animationType.d.ts +0 -15
  43. package/dist/animation/lib/getInitialConfig.d.ts +0 -3
  44. package/dist/utils/index.d.ts +0 -1
  45. /package/dist/{utils → animation/helpers}/delay.d.ts +0 -0
  46. /package/dist/animation/{lib/modules → modules}/index.d.ts +0 -0
package/README.md CHANGED
@@ -2,114 +2,152 @@
2
2
 
3
3
  [![npm version](https://badge.fury.io/js/react-ui-animate.svg)](https://badge.fury.io/js/react-ui-animate)
4
4
 
5
- > React library for gestures and animation
5
+ > Create smooth animations and interactive gestures in React applications effortlessly.
6
6
 
7
7
  ### Install
8
8
 
9
- Install with npm:
9
+ You can install react-ui-animate via npm or yarn:
10
10
 
11
11
  ```sh
12
12
  npm i react-ui-animate
13
13
  ```
14
14
 
15
- or
16
- Install with yarn:
17
-
18
15
  ```sh
19
16
  yarn add react-ui-animate
20
17
  ```
21
18
 
22
19
  ### Getting Started
23
20
 
24
- `react-ui-animate` provides lots of easy to use APIs to create smooth animations and gestures.
21
+ The `react-ui-animate` library provides a straightforward way to add animations and gestures to your React components. Here’s how you can get started quickly:
25
22
 
26
23
  ```javascript
27
- import { AnimatedBlock, useAnimatedValue } from "react-ui-animate";
24
+ import { AnimatedBlock, useAnimatedValue } from 'react-ui-animate';
28
25
 
29
26
  export default function () {
30
- const opacity = useAnimatedValue(0); // It initializes opacity object with value 0.
27
+ // Initialize an animated opacity value
28
+ const opacity = useAnimatedValue(0);
31
29
 
32
30
  return (
33
31
  <div>
34
- {/* AnimatedBlock component can read useAnimatedValue() */}
32
+ {/* AnimatedBlock component uses the animated opacity value */}
35
33
  <AnimatedBlock
36
34
  style={{
37
35
  opacity: opacity.value, // using opacity with value property
38
36
  width: 100,
39
37
  padding: 20,
40
- background: "#39F",
38
+ background: '#39F',
41
39
  }}
42
40
  >
43
41
  ANIMATED
44
42
  </AnimatedBlock>
45
43
 
46
- {/* Assigning value to 1 auto animates from initialized value 0 to 1 smoothly */}
44
+ {/* Clicking the button changes the opacity smoothly to 1 */}
47
45
  <button onClick={() => (opacity.value = 1)}>Animate Me</button>
48
46
  </div>
49
47
  );
50
48
  }
51
49
  ```
52
50
 
53
- Animates opacity from 0 to 1.
51
+ In this example, clicking the "Animate Me" button smoothly changes the opacity of the animated block from 0 to 1.
52
+
53
+ ### Key Features
54
54
 
55
55
  #### `useAnimatedValue()`
56
56
 
57
- `useAnimatedValue()` is very flexible and powerful hook that lets you define animated values. It accepts a value and returns a node with same value on `value` property. Whenever `value` property is assigned to another value, it auto animates from one value to another.
57
+ The `useAnimatedValue()` hook is central to creating animations. It initializes an animated value and allows you to seamlessly update it to create dynamic effects.
58
58
 
59
59
  ```javascript
60
- const opacity = useAnimatedValue(0); // initialize with 0 opacity
60
+ const opacity = useAnimatedValue(0); // Start with opacity set to 0
61
61
 
62
- ...
62
+ // Use in style
63
63
  style={{
64
- opacity: opacity.value // access with `.value`
64
+ opacity: opacity.value, // Access the animated opacity value
65
65
  }}
66
- ...
67
66
 
68
- ...
69
- onClick={() => opacity.value = 1} // Assignment
70
- ...
67
+ // Update the value on user interaction
68
+ onClick={() => (opacity.value = 1)} // Changes the opacity to 1
71
69
  ```
72
70
 
73
71
  #### `AnimatedBlock`
74
72
 
75
- `AnimatedBlock` is a `div` component which can accept the animation node from `useAnimatedValue()` hook.
73
+ `AnimatedBlock` is a special component designed to work with `useAnimatedValue()`. It simplifies animating elements by directly using animated values.
76
74
 
77
75
  ```javascript
78
- const width = useAnimatedValue(100);
76
+ const width = useAnimatedValue(100); // Start with a width of 100
79
77
 
80
78
  <AnimatedBlock
81
79
  style={{
82
80
  width: width.value,
83
81
  height: 100,
84
- backgroundColor: "#39f",
82
+ backgroundColor: '#39f',
85
83
  }}
86
84
  />;
87
85
  ```
88
86
 
89
87
  #### `interpolate`
90
88
 
91
- The `interpolate()` function allows animated node value to map from input ranges to different output ranges. By default, it will extrapolate the curve beyond the ranges given, but you can also have it clamp the output value.
89
+ The `interpolate()` function is useful for mapping values from one range to another, enabling more complex animations.
92
90
 
93
91
  ```javascript
94
- import { useAnimatedValue, AnimatedBlock, interpolate } from "react-ui-animate";
92
+ import { useAnimatedValue, AnimatedBlock, interpolate } from 'react-ui-animate';
95
93
 
96
- const width = useAnimatedValue(100);
94
+ const width = useAnimatedValue(100); // Start with a width of 100
97
95
 
98
96
  <AnimatedBlock
99
97
  style={{
100
98
  width: width.value,
101
99
  height: 100,
102
- backgroundColor: interpolate(width.value, [100, 200], ["red", "blue"]),
100
+ backgroundColor: interpolate(width.value, [100, 200], ['red', 'blue']),
103
101
  }}
104
102
  />;
105
103
  ```
106
104
 
107
- `backgroundColor` is interpolated from input range `[100, 200]` to output range `["red", "blue"]`. So, when the width changes from 100 to 200, `backgroundColor` will change from `red` to `blue`.
105
+ In this example, as the width changes from 100 to 200, the background color smoothly transitions from red to blue.
106
+
107
+ ### Gestures
108
+
109
+ The `react-ui-animate` library also provides several hooks for handling different types of gestures:
110
+
111
+ 1. `useDrag`: Handles drag gestures on elements.
112
+ 2. `useMouseMove`: Handles mouse movements.
113
+ 3. `useScroll`: Handles scrolling of the document.
114
+ 4. `useWheel`: Handles wheel rotation gestures.
115
+ 5. `useGesture`: Handles combinations of various gestures.
116
+
117
+ **Example**: `useDrag`
118
+
119
+ Here’s an example of using the useDrag hook to enable drag gestures:
120
+
121
+ ```jsx
122
+ import { useAnimatedValue, AnimatedBlock, useDrag } from 'react-ui-animate';
123
+
124
+ export const Draggable = () => {
125
+ const translateX = useAnimatedValue(0);
126
+
127
+ const bind = useDrag(function ({ down, movementX }) {
128
+ translateX.value = down ? movementX : 0;
129
+ });
130
+
131
+ return (
132
+ <AnimatedBlock
133
+ {...bind()}
134
+ style={{
135
+ width: 100,
136
+ height: 100,
137
+ backgroundColor: '#3399ff',
138
+ translateX: translateX.value, // Use translateX with animated value
139
+ }}
140
+ />
141
+ );
142
+ };
143
+ ```
144
+
145
+ In this example, the blue block can be dragged horizontally by clicking and dragging.
108
146
 
109
147
  ## Documentation
110
148
 
111
- The official documentation are now published at http://react-ui-animate.js.org/
149
+ For detailed documentation and examples, visit the official [react-ui-animate documentation](http://react-ui-animate.js.org/).
112
150
 
113
151
  ## License
114
152
 
115
- MIT
153
+ This library is licensed under the MIT License.
@@ -0,0 +1,16 @@
1
+ import { FluidValueConfig } from '@raidipesh78/re-motion';
2
+ export declare const AnimationConfigUtils: {
3
+ ELASTIC: FluidValueConfig;
4
+ BOUNCE: FluidValueConfig;
5
+ EASE: FluidValueConfig;
6
+ STIFF: FluidValueConfig;
7
+ WOOBLE: FluidValueConfig;
8
+ EASE_IN: FluidValueConfig;
9
+ EASE_OUT: FluidValueConfig;
10
+ EASE_IN_OUT: FluidValueConfig;
11
+ POWER1: FluidValueConfig;
12
+ POWER2: FluidValueConfig;
13
+ POWER3: FluidValueConfig;
14
+ POWER4: FluidValueConfig;
15
+ LINEAR: FluidValueConfig;
16
+ };
@@ -0,0 +1,2 @@
1
+ export * from './isDefined';
2
+ export * from './delay';
@@ -0,0 +1 @@
1
+ export declare const isDefined: <T>(value: T) => value is NonNullable<T>;
@@ -1,5 +1,7 @@
1
1
  export { interpolate, bInterpolate } from './interpolation';
2
2
  export { AnimatedBlock, AnimatedImage, AnimatedInline, MountedBlock, ScrollableBlock, TransitionBlock, } from './modules';
3
3
  export { useAnimatedValue, UseAnimatedValueConfig } from './useAnimatedValue';
4
- export { useMountedValue } from './useMountedValue';
4
+ export { useMountedValue, UseMountedValueConfig } from './useMountedValue';
5
5
  export { AnimationConfigUtils } from './animationType';
6
+ export { withSpring, withTiming, withSequence, withDelay, } from './withFunctions';
7
+ export { delay } from './helpers';
@@ -1,4 +1,5 @@
1
- import { ExtrapolateConfig, FluidValue } from '../core';
1
+ import { ExtrapolateConfig, FluidValue } from '@raidipesh78/re-motion';
2
+ import { ValueType } from './useAnimatedValue';
2
3
  /**
3
4
  * Maps the input range to the given output range using the specified extrapolation configuration.
4
5
  * The function ensures that the value is either a number or a FluidValue.
@@ -10,7 +11,7 @@ import { ExtrapolateConfig, FluidValue } from '../core';
10
11
  * @returns - The interpolated value, which will be a number or FluidValue.
11
12
  * @throws - Will throw an error if the value is not a number or FluidValue.
12
13
  */
13
- export declare function interpolate(value: FluidValue | number | string | undefined, inputRange: Array<number>, outputRange: Array<number | string>, extrapolateConfig?: ExtrapolateConfig): any;
14
+ export declare function interpolate(value: FluidValue | ValueType | number, inputRange: Array<number>, outputRange: Array<number | string>, extrapolateConfig?: ExtrapolateConfig): any;
14
15
  /**
15
16
  * A shorthand function for interpolate that maps the input range [0, 1] to the given [minOutput, maxOutput].
16
17
  * The function ensures that the value is either a number or a FluidValue.
@@ -22,4 +23,4 @@ export declare function interpolate(value: FluidValue | number | string | undefi
22
23
  * @returns - The interpolated value, which will be a number or FluidValue.
23
24
  * @throws - Will throw an error if the value is not a number or FluidValue.
24
25
  */
25
- export declare function bInterpolate(value: FluidValue | number | string | undefined, minOutput: number | string, maxOutput: number | string, extrapolateConfig?: ExtrapolateConfig): any;
26
+ export declare function bInterpolate(value: FluidValue | ValueType | number, minOutput: number | string, maxOutput: number | string, extrapolateConfig?: ExtrapolateConfig): any;
@@ -3,6 +3,6 @@
3
3
  * which can accept `AnimatedValue`. It also exposes some extra style properties like
4
4
  * translateX, translateY, rotateX, rotateY, scaleX, etc.
5
5
  */
6
- export declare const AnimatedBlock: import("react").ForwardRefExoticComponent<Omit<import("../../core/types/fluid").FluidHTMLAttributes<"div"> & import("../../core/types/fluid").FluidSVGAttributes<"div">, "style"> & {
7
- style?: import("../../core/types/fluid").FluidCSSProperties;
6
+ export declare const AnimatedBlock: import("react").ForwardRefExoticComponent<Omit<import("@raidipesh78/re-motion/dist/types/fluid").FluidHTMLAttributes<"div"> & import("@raidipesh78/re-motion/dist/types/fluid").FluidSVGAttributes<"div">, "style"> & {
7
+ style?: import("@raidipesh78/re-motion/dist/types/fluid").FluidCSSProperties | undefined;
8
8
  } & import("react").RefAttributes<unknown>>;
@@ -3,6 +3,6 @@
3
3
  * which can accept `AnimatedValue`. It also exposes some extra style properties like
4
4
  * translateX, translateY, rotateX, rotateY, scaleX, etc.
5
5
  */
6
- export declare const AnimatedImage: import("react").ForwardRefExoticComponent<Omit<import("../../core/types/fluid").FluidHTMLAttributes<"img"> & import("../../core/types/fluid").FluidSVGAttributes<"img">, "style"> & {
7
- style?: import("../../core/types/fluid").FluidCSSProperties;
6
+ export declare const AnimatedImage: import("react").ForwardRefExoticComponent<Omit<import("@raidipesh78/re-motion/dist/types/fluid").FluidHTMLAttributes<"img"> & import("@raidipesh78/re-motion/dist/types/fluid").FluidSVGAttributes<"img">, "style"> & {
7
+ style?: import("@raidipesh78/re-motion/dist/types/fluid").FluidCSSProperties | undefined;
8
8
  } & import("react").RefAttributes<unknown>>;
@@ -3,6 +3,6 @@
3
3
  * which can accept `AnimatedValue`. It also exposes some extra style properties like
4
4
  * translateX, translateY, rotateX, rotateY, scaleX, etc.
5
5
  */
6
- export declare const AnimatedInline: import("react").ForwardRefExoticComponent<Omit<import("../../core/types/fluid").FluidHTMLAttributes<"span"> & import("../../core/types/fluid").FluidSVGAttributes<"span">, "style"> & {
7
- style?: import("../../core/types/fluid").FluidCSSProperties;
6
+ export declare const AnimatedInline: import("react").ForwardRefExoticComponent<Omit<import("@raidipesh78/re-motion/dist/types/fluid").FluidHTMLAttributes<"span"> & import("@raidipesh78/re-motion/dist/types/fluid").FluidSVGAttributes<"span">, "style"> & {
7
+ style?: import("@raidipesh78/re-motion/dist/types/fluid").FluidCSSProperties | undefined;
8
8
  } & import("react").RefAttributes<unknown>>;
@@ -1,11 +1,12 @@
1
1
  import * as React from 'react';
2
- import { FluidValue, FluidValueConfig } from '../../core';
2
+ import type { FluidValueConfig } from '@raidipesh78/re-motion';
3
+ import { ValueType } from '../useAnimatedValue';
3
4
  interface MountedValueConfig extends FluidValueConfig {
4
5
  }
5
6
  interface MountedBlockProps {
6
7
  state: boolean;
7
8
  children: (animation: {
8
- value: FluidValue;
9
+ value: ValueType;
9
10
  }) => React.ReactNode;
10
11
  from?: number;
11
12
  enter?: number;
@@ -1,9 +1,8 @@
1
1
  import * as React from 'react';
2
- import { UseAnimatedValueConfig } from '../useAnimatedValue';
3
- import { FluidValue } from '../../core';
2
+ import { UseAnimatedValueConfig, ValueType } from '../useAnimatedValue';
4
3
  interface ScrollableBlockProps {
5
4
  children?: (animation: {
6
- value?: FluidValue | string | number;
5
+ value: ValueType;
7
6
  }) => React.ReactNode;
8
7
  direction?: 'single' | 'both';
9
8
  threshold?: number;
@@ -1,10 +1,9 @@
1
1
  import * as React from 'react';
2
- import { UseAnimatedValueConfig } from '../useAnimatedValue';
3
- import { FluidValue } from '../../core';
2
+ import { UseAnimatedValueConfig, ValueType } from '../useAnimatedValue';
4
3
  interface TransitionBlockProps {
5
4
  state: boolean;
6
5
  children: (animation: {
7
- value?: FluidValue | string | number;
6
+ value: ValueType;
8
7
  }) => React.ReactNode;
9
8
  config?: UseAnimatedValueConfig;
10
9
  }
@@ -1,7 +1,12 @@
1
- import { FluidValueConfig, FluidValue } from '../core';
1
+ import { FluidValueConfig } from '@raidipesh78/re-motion';
2
2
  type Length = number | string;
3
3
  export interface UseAnimatedValueConfig extends FluidValueConfig {
4
4
  }
5
+ type AssignValue = {
6
+ toValue: Length;
7
+ config?: UseAnimatedValueConfig;
8
+ };
9
+ export type ValueType = Length | AssignValue | ((update: (next: AssignValue) => Promise<any>) => void);
5
10
  /**
6
11
  * `useAnimatedValue` returns an animation value with `.value` and `.currentValue` property which is
7
12
  * initialized when passed to argument (`initialValue`). The retured value persist until the lifetime of
@@ -11,7 +16,7 @@ export interface UseAnimatedValueConfig extends FluidValueConfig {
11
16
  * @param { UseAnimatedValueConfig } config - Animation configuration object.
12
17
  */
13
18
  export declare function useAnimatedValue(initialValue: Length, config?: UseAnimatedValueConfig): {
14
- value: FluidValue | string | number | undefined;
19
+ value: ValueType;
15
20
  currentValue: number | string;
16
21
  };
17
22
  export {};
@@ -1,4 +1,4 @@
1
- import { UseMountConfig, FluidValue } from '../core';
1
+ import { UseMountConfig, FluidValue } from '@raidipesh78/re-motion';
2
2
  export interface UseMountedValueConfig extends UseMountConfig {
3
3
  }
4
4
  /**
@@ -0,0 +1,63 @@
1
+ import type { FluidValueConfig, Length } from '@raidipesh78/re-motion';
2
+ interface WithSpringConfig extends Pick<FluidValueConfig, 'mass' | 'friction' | 'tension'> {
3
+ }
4
+ /**
5
+ * Creates a spring animation configuration.
6
+ * @param {Length} toValue - The target value of the animation.
7
+ * @param {WithSpringConfig} [config=AnimationConfigUtils.ELASTIC] - Optional spring configuration.
8
+ * @returns {{ toValue: Length; config: WithSpringConfig }}
9
+ */
10
+ export declare const withSpring: (toValue: Length, config?: WithSpringConfig) => {
11
+ toValue: Length;
12
+ config: WithSpringConfig;
13
+ };
14
+ interface WithTimingConfig extends Pick<FluidValueConfig, 'duration' | 'easing'> {
15
+ }
16
+ /**
17
+ * Creates a timing animation configuration.
18
+ * @param {Length} toValue - The target value of the animation.
19
+ * @param {WithTimingConfig} [config={ duration: 250 }] - Optional timing configuration.
20
+ * @returns {{ toValue: Length; config: WithTimingConfig }}
21
+ */
22
+ export declare const withTiming: (toValue: Length, config?: WithTimingConfig) => {
23
+ toValue: Length;
24
+ config: WithTimingConfig;
25
+ };
26
+ /**
27
+ * Creates a sequence of animations that run one after another.
28
+ * @param {Array<{ toValue: Length; config?: FluidValueConfig }>} configs - An array of animation configurations.
29
+ * @returns {Function} An async function that runs the animations in sequence.
30
+ */
31
+ export declare const withSequence: ([...configs]: Array<{
32
+ toValue: Length;
33
+ config?: FluidValueConfig;
34
+ }>) => (next: (arg: {
35
+ toValue: Length;
36
+ config?: FluidValueConfig;
37
+ }) => void) => Promise<void>;
38
+ /**
39
+ * Adds a delay before the given animation.
40
+ * @param {number} delay - The delay in milliseconds.
41
+ * @param {{ toValue: Length; config?: FluidValueConfig }} animation - The animation configuration ( withTiming | withSpring )
42
+ * @returns {{ toValue: Length; config: FluidValueConfig }} The updated animation configuration with delay.
43
+ */
44
+ export declare const withDelay: (delay: number, animation: {
45
+ toValue: Length;
46
+ config?: FluidValueConfig;
47
+ }) => {
48
+ config: {
49
+ delay: number;
50
+ mass?: number;
51
+ tension?: number;
52
+ friction?: number;
53
+ duration?: number;
54
+ easing?: import("@raidipesh78/re-motion/dist/types/common").Fn<number, number>;
55
+ immediate?: boolean;
56
+ restDistance?: number;
57
+ onChange?: import("@raidipesh78/re-motion/dist/types/common").Fn<number, void>;
58
+ onRest?: import("@raidipesh78/re-motion/dist/types/common").Fn<import("@raidipesh78/re-motion/dist/types/animation").ResultType, void>;
59
+ onStart?: import("@raidipesh78/re-motion/dist/types/common").Fn<number, void>;
60
+ };
61
+ toValue: Length;
62
+ };
63
+ export {};
package/dist/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
- export { Easing, makeFluid, fluid } from './animation/core';
2
- export { AnimatedBlock, AnimatedImage, AnimatedInline, AnimationConfigUtils, MountedBlock, ScrollableBlock, TransitionBlock, } from './animation/lib';
3
- export { bInterpolate, interpolate } from './animation/lib';
4
- export { useAnimatedValue, useMountedValue } from './animation/lib';
5
- export { delay } from './utils';
1
+ export { Easing, makeFluid, fluid } from '@raidipesh78/re-motion';
2
+ export { AnimatedBlock, AnimatedImage, AnimatedInline, AnimationConfigUtils, MountedBlock, ScrollableBlock, TransitionBlock, } from './animation';
3
+ export { bInterpolate, interpolate } from './animation';
4
+ export { useAnimatedValue, useMountedValue } from './animation';
5
+ export { withSpring, withTiming, withSequence, withDelay, delay, } from './animation';
6
6
  export { useMeasure, useOutsideClick, useWindowDimension } from './hooks';
7
7
  export { useDrag, useGesture, useMouseMove, useScroll, useWheel, } from './gestures/hooks';
8
8
  export { bin, clamp, mix, rubberClamp, move, snapTo } from './gestures/helpers';
9
- export type { UseAnimatedValueConfig } from './animation/lib';
9
+ export type { UseAnimatedValueConfig, UseMountedValueConfig, } from './animation';
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- var e=require("react"),t=require("react/jsx-runtime");function n(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var i=n(e),r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)};function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var a=function(){return a=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},a.apply(this,arguments)};function s(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n}function f(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],i=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function u(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,r,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(i=o.next()).done;)a.push(i.value)}catch(e){r={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return a}function l(e,t,n){if(n||2===arguments.length)for(var i,r=0,o=t.length;r<o;r++)!i&&r in t||(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var c=function(){function e(){}return e.prototype._debounceOnEnd=function(e){var t=this._onEnd,n=this._onRest;this._onEnd=null,this._onRest=null,n&&n(e),t&&t(e)},e.prototype.stop=function(){},e}(),h={current:function(e){return window.requestAnimationFrame(e)},inject:function(e){h.current=e}},d={current:function(e){return window.cancelAnimationFrame(e)},inject:function(e){d.current=e}},p=function(e){function t(t){var n,i,r,o,a,s,f=t.initialPosition,u=t.config,l=e.call(this)||this;return l._overshootClamping=!1,l._initialVelocity=0,l._lastVelocity=0,l._startPosition=f,l._position=l._startPosition,l._restDisplacementThreshold=null!==(n=null==u?void 0:u.restDistance)&&void 0!==n?n:.001,l._restSpeedThreshold=null!==(i=null==u?void 0:u.restDistance)&&void 0!==i?i:.001,l._mass=null!==(r=null==u?void 0:u.mass)&&void 0!==r?r:1,l._tension=null!==(o=null==u?void 0:u.tension)&&void 0!==o?o:170,l._friction=null!==(a=null==u?void 0:u.friction)&&void 0!==a?a:26,l._delay=null!==(s=null==u?void 0:u.delay)&&void 0!==s?s:0,l._onRest=null==u?void 0:u.onRest,l._onChange=null==u?void 0:u.onChange,l}return o(t,e),t.prototype.onChange=function(e){this._onFrame(e),this._lastPosition!==e&&this._onChange&&this._onChange(e),this._lastPosition=e},t.prototype.onUpdate=function(){var e=this,t=Date.now(),n=Math.min(t-this._lastTime,64);this._lastTime=t;var i=this._friction,r=this._mass,o=this._tension,a=-this._lastVelocity,s=this._toValue-this._position,f=i/(2*Math.sqrt(o*r)),u=Math.sqrt(o/r),l=u*Math.sqrt(1-Math.pow(f,2)),c=n/1e3,d=Math.sin(l*c),p=Math.cos(l*c),m=Math.exp(-f*u*c),v=m*(d*((a+f*u*s)/l)+s*p),y=this._toValue-v,g=f*u*v-m*(p*(a+f*u*s)-l*s*d),b=Math.exp(-u*c),_=this._toValue-b*(s+(a+u*s)*c),w=b*(a*(c*u-1)+c*s*u*u);this.onChange(this._position);var x=Math.abs(this._lastVelocity)<this._restSpeedThreshold,E=0===this._tension||Math.abs(this._toValue-this._position)<this._restDisplacementThreshold;if(f<1?(this._position=y,this._lastVelocity=g):(this._position=_,this._lastVelocity=w),e._overshootClamping&&0!==e._tension&&(e._position<e._toValue?e._position>e._toValue:e._position<e._toValue)||x&&E)return 0!==this._tension&&(this._lastVelocity=0,this._position=this._toValue,this.onChange(this._position)),this._lastTime=0,void this._debounceOnEnd({finished:!0,value:this._toValue});this._animationFrame=h.current(this.onUpdate.bind(this))},t.prototype.stop=function(){this._active=!1,clearTimeout(this._timeout),d.current(this._animationFrame),this._debounceOnEnd({finished:!1,value:this._position})},t.prototype.set=function(e){this.stop(),this._position=e,this._lastTime=0,this._lastVelocity=0,this.onChange(e)},t.prototype.start=function(e){var n=this,i=e.toValue,r=e.onFrame,o=e.previousAnimation,a=e.onEnd,s=function(){n._onFrame=r,n._active=!0,n._toValue=i,n._onEnd=a;var e=Date.now();o instanceof t?(n._lastVelocity=o._lastVelocity||n._lastVelocity||0,n._lastTime=o._lastTime||e):n._lastTime=e,n._animationFrame=h.current(n.onUpdate.bind(n))};0!==this._delay?this._timeout=setTimeout((function(){return s()}),this._delay):s()},t}(c),m=4,v=1e-7,y=10,g=.1,b="function"==typeof Float32Array;function _(e,t){return 1-3*t+3*e}function w(e,t){return 3*t-6*e}function x(e){return 3*e}function E(e,t,n){return((_(t,n)*e+w(t,n))*e+x(t))*e}function k(e,t,n){return 3*_(t,n)*e*e+2*w(t,n)*e+x(t)}function M(e){return e}function T(e,t,n,i){if(!(0<=e&&e<=1&&0<=n&&n<=1))throw new Error("bezier x values must be in [0, 1] range");if(e===t&&n===i)return M;for(var r=b?new Float32Array(11):new Array(11),o=0;o<11;++o)r[o]=E(o*g,e,n);function a(t){for(var i=0,o=1;10!==o&&r[o]<=t;++o)i+=g;--o;var a=i+(t-r[o])/(r[o+1]-r[o])*g,s=k(a,e,n);return s>=.001?function(e,t,n,i){for(var r=0;r<m;++r){var o=k(t,n,i);if(0===o)return t;t-=(E(t,n,i)-e)/o}return t}(t,a,e,n):0===s?a:function(e,t,n,i,r){var o,a,s=0;do{(o=E(a=t+(n-t)/2,i,r)-e)>0?n=a:t=a}while(Math.abs(o)>v&&++s<y);return a}(t,i,i+g,e,n)}return function(e){return 0===e||1===e?e:E(a(e),t,i)}}var I=function(){function e(){}return e.step0=function(e){return e>0?1:0},e.step1=function(e){return e>=1?1:0},e.linear=function(e){return e},e.ease=function(e){return O(e)},e.quad=function(e){return e*e},e.cubic=function(e){return e*e*e},e.poly=function(e){return function(t){return Math.pow(t,e)}},e.sin=function(e){return 1-Math.cos(e*Math.PI/2)},e.circle=function(e){return 1-Math.sqrt(1-e*e)},e.exp=function(e){return Math.pow(2,10*(e-1))},e.elastic=function(e){void 0===e&&(e=1);var t=e*Math.PI;return function(e){return 1-Math.pow(Math.cos(e*Math.PI/2),3)*Math.cos(e*t)}},e.back=function(e){return void 0===e&&(e=1.70158),function(t){return t*t*((e+1)*t-e)}},e.bounce=function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},e.bezier=function(e,t,n,i){return T(e,t,n,i)},e.in=function(e){return e},e.out=function(e){return function(t){return 1-e(1-t)}},e.inOut=function(e){return function(t){return t<.5?e(2*t)/2:1-e(2*(1-t))/2}},e}(),O=I.bezier(.42,0,1,1),C=function(e){function t(t){var n,i,r,o=t.initialPosition,a=t.config,s=e.call(this)||this;return s._fromValue=o,s._position=s._fromValue,s._easing=null!==(n=null==a?void 0:a.easing)&&void 0!==n?n:I.linear,s._duration=null!==(i=null==a?void 0:a.duration)&&void 0!==i?i:500,s._tempDuration=s._duration,(null==a?void 0:a.immediate)&&(s._duration=0),s._delay=null!==(r=null==a?void 0:a.delay)&&void 0!==r?r:0,s._onRest=null==a?void 0:a.onRest,s._onChange=null==a?void 0:a.onChange,s}return o(t,e),t.prototype.onChange=function(e){this._onFrame(e),this._lastPosition!==e&&this._onChange&&this._onChange(e),this._lastPosition=e},t.prototype.onUpdate=function(){var e=Date.now()-this._startTime;if(e>=this._duration)return this._startTime=0,this._position=this._toValue,this.onChange(this._position),void this._debounceOnEnd({finished:!0,value:this._position});var t=this._easing(e/this._duration);this._position=this._fromValue+(this._toValue-this._fromValue)*t,this.onChange(this._position),this._animationFrame=h.current(this.onUpdate.bind(this))},t.prototype.stop=function(){this._active=!1,clearTimeout(this._timeout),d.current(this._animationFrame),this._debounceOnEnd({finished:!1,value:this._position})},t.prototype.set=function(e){this.stop(),this._position=e,this.onChange(e)},t.prototype.start=function(e){var n=this,i=e.toValue,r=e.onFrame,o=e.previousAnimation,a=e.onEnd,s=function(){if(n._onFrame=r,n._active=!0,n._onEnd=a,n._toValue=i,o&&o instanceof t&&o._toValue===i&&o._startTime)n._startTime=o._startTime,n._fromValue=o._fromValue;else{var e=Date.now();n._startTime=e,n._fromValue=n._position}n._animationFrame=h.current(n.onUpdate.bind(n))};0!==this._delay?this._timeout=setTimeout((function(){return s()}),this._delay):s()},t}(c),V=/[+-]?\d+(\.\d+)?|[\s]?\.\d+|#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})/gi,S=/#[a-f\d]{3,}|transparent|aliceblue|antiquewhite|aqua|aquamarine|azure|beige|bisque|black|blanchedalmond|blue|blueviolet|brown|burlywood|burntsienna|cadetblue|chartreuse|chocolate|coral|cornflowerblue|cornsilk|crimson|cyan|darkblue|darkcyan|darkgoldenrod|darkgray|darkgreen|darkgrey|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|green|greenyellow|grey|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|lightsteelblue|lightyellow|lime|limegreen|linen|magenta|maroon|mediumaquamarine|mediumblue|mediumorchid|mediumpurple|mediumseagreen|mediumslateblue|mediumspringgreen|mediumturquoise|mediumvioletred|midnightblue|mintcream|mistyrose|moccasin|navajowhite|navy|oldlace|olive|olivedrab|orange|orangered|orchid|palegoldenrod|palegreen|paleturquoise|palevioletred|papayawhip|peachpuff|peru|pink|plum|powderblue|purple|rebeccapurple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silver|skyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen/gi,L={transparent:"#00000000",aliceblue:"#f0f8ffff",antiquewhite:"#faebd7ff",aqua:"#00ffffff",aquamarine:"#7fffd4ff",azure:"#f0ffffff",beige:"#f5f5dcff",bisque:"#ffe4c4ff",black:"#000000ff",blanchedalmond:"#ffebcdff",blue:"#0000ffff",blueviolet:"#8a2be2ff",brown:"#a52a2aff",burlywood:"#deb887ff",burntsienna:"#ea7e5dff",cadetblue:"#5f9ea0ff",chartreuse:"#7fff00ff",chocolate:"#d2691eff",coral:"#ff7f50ff",cornflowerblue:"#6495edff",cornsilk:"#fff8dcff",crimson:"#dc143cff",cyan:"#00ffffff",darkblue:"#00008bff",darkcyan:"#008b8bff",darkgoldenrod:"#b8860bff",darkgray:"#a9a9a9ff",darkgreen:"#006400ff",darkgrey:"#a9a9a9ff",darkkhaki:"#bdb76bff",darkmagenta:"#8b008bff",darkolivegreen:"#556b2fff",darkorange:"#ff8c00ff",darkorchid:"#9932ccff",darkred:"#8b0000ff",darksalmon:"#e9967aff",darkseagreen:"#8fbc8fff",darkslateblue:"#483d8bff",darkslategray:"#2f4f4fff",darkslategrey:"#2f4f4fff",darkturquoise:"#00ced1ff",darkviolet:"#9400d3ff",deeppink:"#ff1493ff",deepskyblue:"#00bfffff",dimgray:"#696969ff",dimgrey:"#696969ff",dodgerblue:"#1e90ffff",firebrick:"#b22222ff",floralwhite:"#fffaf0ff",forestgreen:"#228b22ff",fuchsia:"#ff00ffff",gainsboro:"#dcdcdcff",ghostwhite:"#f8f8ffff",gold:"#ffd700ff",goldenrod:"#daa520ff",gray:"#808080ff",green:"#008000ff",greenyellow:"#adff2fff",grey:"#808080ff",honeydew:"#f0fff0ff",hotpink:"#ff69b4ff",indianred:"#cd5c5cff",indigo:"#4b0082ff",ivory:"#fffff0ff",khaki:"#f0e68cff",lavender:"#e6e6faff",lavenderblush:"#fff0f5ff",lawngreen:"#7cfc00ff",lemonchiffon:"#fffacdff",lightblue:"#add8e6ff",lightcoral:"#f08080ff",lightcyan:"#e0ffffff",lightgoldenrodyellow:"#fafad2ff",lightgray:"#d3d3d3ff",lightgreen:"#90ee90ff",lightgrey:"#d3d3d3ff",lightpink:"#ffb6c1ff",lightsalmon:"#ffa07aff",lightseagreen:"#20b2aaff",lightskyblue:"#87cefaff",lightslategray:"#778899ff",lightslategrey:"#778899ff",lightsteelblue:"#b0c4deff",lightyellow:"#ffffe0ff",lime:"#00ff00ff",limegreen:"#32cd32ff",linen:"#faf0e6ff",magenta:"#ff00ffff",maroon:"#800000ff",mediumaquamarine:"#66cdaaff",mediumblue:"#0000cdff",mediumorchid:"#ba55d3ff",mediumpurple:"#9370dbff",mediumseagreen:"#3cb371ff",mediumslateblue:"#7b68eeff",mediumspringgreen:"#00fa9aff",mediumturquoise:"#48d1ccff",mediumvioletred:"#c71585ff",midnightblue:"#191970ff",mintcream:"#f5fffaff",mistyrose:"#ffe4e1ff",moccasin:"#ffe4b5ff",navajowhite:"#ffdeadff",navy:"#000080ff",oldlace:"#fdf5e6ff",olive:"#808000ff",olivedrab:"#6b8e23ff",orange:"#ffa500ff",orangered:"#ff4500ff",orchid:"#da70d6ff",palegoldenrod:"#eee8aaff",palegreen:"#98fb98ff",paleturquoise:"#afeeeeff",palevioletred:"#db7093ff",papayawhip:"#ffefd5ff",peachpuff:"#ffdab9ff",peru:"#cd853fff",pink:"#ffc0cbff",plum:"#dda0ddff",powderblue:"#b0e0e6ff",purple:"#800080ff",rebeccapurple:"#663399ff",red:"#ff0000ff",rosybrown:"#bc8f8fff",royalblue:"#4169e1ff",saddlebrown:"#8b4513ff",salmon:"#fa8072ff",sandybrown:"#f4a460ff",seagreen:"#2e8b57ff",seashell:"#fff5eeff",sienna:"#a0522dff",silver:"#c0c0c0ff",skyblue:"#87ceebff",slateblue:"#6a5acdff",slategray:"#708090ff",slategrey:"#708090ff",snow:"#fffafaff",springgreen:"#00ff7fff",steelblue:"#4682b4ff",tan:"#d2b48cff",teal:"#008080ff",thistle:"#d8bfd8ff",tomato:"#ff6347ff",turquoise:"#40e0d0ff",violet:"#ee82eeff",wheat:"#f5deb3ff",white:"#ffffffff",whitesmoke:"#f5f5f5ff",yellow:"#ffff00ff",yellowgreen:"#9acd32ff"};function A(e){var t=function(e){return e.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(function(e,t,n,i){return"#"+t+t+n+n+i+i}))}(e),n=function(e){return 7===e.length?e+"FF":e}(t),i=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(n);return{r:parseInt(i[1],16),g:parseInt(i[2],16),b:parseInt(i[3],16),a:parseInt(i[4],16)/255}}function Y(e){var t=e.r,n=e.g,i=e.b,r=e.a;return"#"+(256|t).toString(16).slice(1)+(256|n).toString(16).slice(1)+(256|i).toString(16).slice(1)+(255*r|256).toString(16).slice(1)}var R=function(e){return null!=e},D=function(e){return R(e)&&"object"==typeof e&&"_subscribe"in e},F=["borderImageOutset","borderImageSlice","borderImageWidth","fontWeight","lineHeight","opacity","orphans","tabSize","widows","zIndex","zoom","fillOpacity","floodOpacity","stopOpacity","strokeDasharray","strokeDashoffset","strokeMiterlimit","strokeOpacity","strokeWidth","animationIterationCount","boxFlex","boxFlexGroup","boxOrdinalGroup","columnCount","flex","flexGrow","flexPositive","flexShrink","flexNegative","flexOrder","gridRow","gridColumn","order","lineClamp"];var P=function(e,t,n,i){var r=u(t,4),o=r[0],a=r[1],s=r[2],f=r[3],l=e;if(l<o){if("identity"===n)return l;"clamp"===n&&(l=o)}if(l>a){if("identity"===i)return l;"clamp"===i&&(l=a)}return s===f?s:o===a?e<=o?s:f:(o===-1/0?l=-l:a===1/0?l-=o:l=(l-o)/(a-o),s===-1/0?l=-l:f===1/0?l+=s:l=l*(f-s)+s,l)},j=function(e,t,n){var i=t.length,r=[];e<t[0]?r=[t[0],t[1],n[0],n[1]]:e>t[i-1]&&(r=[t[i-2],t[i-1],n[i-2],n[i-1]]);for(var o=1;o<i;++o)if(e<=t[o]){r=[t[o-1],t[o],n[o-1],n[o]];break}return r},X=function(e,t,n,i){var r=u(t,4),o=r[0],a=r[1],s=r[2],f=r[3];if(s.length===f.length)return s.map((function(t,r){return"string"==typeof t?function(e,t){var n=u(t,4),i=n[0],r=n[1],o=n[2],a=n[3],s=A(o),f=A(a);return Y({r:P(e,[i,r,s.r,f.r],"clamp","clamp"),g:P(e,[i,r,s.g,f.g],"clamp","clamp"),b:P(e,[i,r,s.b,f.b],"clamp","clamp"),a:P(e,[i,r,s.a,f.a],"clamp","clamp")})}(e,[o,a,t,f[r]]):P(e,[o,a,t,f[r]],n,i)}));throw new Error("Array length doesn't match")},q=function(e){return e.replace(V,"$")},W=function(e){return e.match(V).map((function(e){return-1!==e.indexOf("#")?e:Number(e)}))},z=function(e,t){return q(e).trim().replace(/\s/g,"")===q(t).trim().replace(/\s/g,"")},U=function(e){return e.replace(S,(function(e){if(-1!==e.indexOf("#"))return Y(A(e));if(Object.prototype.hasOwnProperty.call(L,e))return L[e];throw new Error("String cannot be parsed!")}))};function B(e,t,n,i){var r,o,a=null==i?void 0:i.extrapolate,s=null==i?void 0:i.extrapolateLeft,l=null==i?void 0:i.extrapolateRight,c=j(e,t,n),h="extend";void 0!==s?h=s:void 0!==a&&(h=a);var d="extend";if(void 0!==l?d=l:void 0!==a&&(d=a),n.length){if("number"==typeof n[0])return P(e,c,h,d);if(Array.isArray(n[0]))return X(e,c,h,d);var p=u(c,4),m=p[0],v=p[1],y=p[2],g=p[3],b=U(y),_=U(g),w=q(b);if(z(b,_)){var x=W(b),E=W(_),k=X(e,[m,v,x,E],h,d);try{for(var M=f(k),T=M.next();!T.done;T=M.next()){var I=T.value;w=w.replace("$",I)}}catch(e){r={error:e}}finally{try{T&&!T.done&&(o=M.return)&&o.call(M)}finally{if(r)throw r.error}}return w}throw new Error("Output range doesn't match string format!")}throw new Error("Output range cannot be Empty")}var G=function(e,t,n,i){if(D(e))return function(e,t,n,i){return a(a({},e),{isInterpolation:!0,interpolationConfig:{inputRange:t,outputRange:n,extrapolateConfig:i}})}(e,t,n,i);if("number"==typeof e)return B(e,t,n,i);throw new Error("'".concat(typeof e,"' cannot be interpolated!"))};var N=["translate","translateX","translateY","translateZ","scale","scaleX","scaleY","scaleZ","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"];function H(e){var t=e.match(/(-)?(\d+.)?\d+/g),n=e.match(/px|rem|em|ex|%|cm|mm|in|pt|pc|ch|vh|vw|vmin|vmax/);return{value:Number(t),unit:n&&n[0]}}function Z(e,t){var n=function(e,t){var n,i=H(String(t)).value,r=H(String(t)).unit;return r?{value:i,unit:r}:(e.includes("translate")||e.includes("perspective")?n="px":e.includes("scale")?n="":(e.includes("rotate")||e.includes("skew"))&&(n="deg"),{value:t,unit:n})}(e,t);if(e.includes("X")||e.includes("Y")||e.includes("Z")||e.includes("perspective")||e.includes("rotate")||e.includes("skew"))return"".concat(e,"(").concat(n.value).concat(n.unit,")");if(e.includes("translate")||e.indexOf("scale"))return"".concat(e,"(").concat(n.value).concat(n.unit,", ").concat(n.value).concat(n.unit,")");throw new Error("Error! Property '".concat(e,"' cannot be transformed"))}function $(t){return e.forwardRef((function(n,i){var r=e.useRef(null),o=e.useRef({}),f=e.useMemo((function(){var e=n.style,t=s(n,["style"]),i=K("style",e),r=K("props",t);return{fluids:l(l([],u(i.fluids),!1),u(r.fluids),!1),nonFluids:l(l([],u(i.nonFluids),!1),u(r.nonFluids),!1)}}),[n]),c=f.fluids,h=f.nonFluids,d=function(e){var t,n=e.isTransform,i=e.propertyType,a=e.property,s=e.value;r.current&&("style"===i?n?(o.current[a]=s,r.current.style.transform=(t=o.current,Object.entries(t).map((function(e){var t=u(e,2);return Z(t[0],t[1])})).reduce((function(e,t){return e+" ".concat(t)}),"").trim())):r.current.style[a]=function(e,t){return"number"==typeof t?F.includes(e)?t:t+"px":t}(a,s):"props"===i&&r.current.setAttribute(a.replace(/([A-Z])/g,(function(e){return"-"+e.toLowerCase()})),s))};return e.useLayoutEffect((function(){h.forEach((function(e){var t=e.isTransform,n=e.property,i=e.propertyType,r=e.value;return d({isTransform:t,property:n,propertyType:i,value:r})}))}),[h]),e.useLayoutEffect((function(){var e=[];return c.forEach((function(t){var n,i=t.value,r=t.propertyType,o=t.property,s=t.isTransform,f=i._subscribe,u=i._value,l=i._currentValue,c=i._config,h=[],m=(n=c,function(e,t){var i=a(a({},n),t);return new(R(null==i?void 0:i.duration)||(null==i?void 0:i.immediate)?C:p)({initialPosition:e,config:i})}),v=null,y=function(e){l.current=e;var t=i.isInterpolation&&i.interpolationConfig?B(e,i.interpolationConfig.inputRange,i.interpolationConfig.outputRange,i.interpolationConfig.extrapolateConfig):e;d({isTransform:s,propertyType:r,property:o,value:t})};v=m("string"==typeof u?0:u),d({isTransform:s,propertyType:r,property:o,value:u});var g=f((function(e,t,n){if(function(e,t){if(typeof e!=typeof t)return!1;if("number"==typeof t)return!0;if("string"==typeof e){var n=U(e),i=U(t);return n!==i&&q(n)===q(i)}return!1}(u,e)){var a=v;a._value!==e&&(v.stop(),v=m(a._position,t),(null==t?void 0:t.onStart)&&t.onStart(a._position),"string"==typeof e&&(h.includes(u)||h.push(u),h.includes(e)||h.push(e),i.isInterpolation=!0,i.interpolationConfig={inputRange:h.map((function(e,t){return t})),outputRange:h}),v.start({toValue:"string"==typeof e?h.indexOf(e):e,onFrame:y,previousAnimation:a,onEnd:n}))}else{if(typeof e!=typeof u)throw new Error("Cannot assign ".concat(typeof e," to animated ").concat(typeof u));d({isTransform:s,propertyType:r,property:o,value:e})}}),o,Date.now());e.push(g)})),function(){e.forEach((function(e){return e()}))}}),[]),e.createElement(t,a(a({},function(e){e.style;var t=s(e,["style"]);return Object.fromEntries(Object.entries(t).filter((function(e){var t=u(e,2);t[0];var n=t[1];return!D(n)})))}(n)),{ref:J(r,i)}))}))}function J(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){e.forEach((function(e){e&&("function"!=typeof e?"current"in e&&(e.current=t):e(t))}))}}function K(e,t){return void 0===t&&(t={}),Object.entries(t).reduce((function(t,n){var i,r=u(n,2),o=r[0],a=r[1],s="style"===e&&(i=o,N.includes(i));return D(a)?t.fluids.push({isTransform:s,property:o,propertyType:e,value:a}):t.nonFluids.push({isTransform:s,property:o,propertyType:e,value:a}),t}),{fluids:[],nonFluids:[]})}var Q={};["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noindex","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","small","source","span","strong","style","sub","summary","sup","table","template","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","svg","animate","animateMotion","animateTransform","circle","clipPath","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","foreignObject","g","image","line","linearGradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","switch","symbol","text","textPath","tspan","use","view"].forEach((function(e){Q[e]=$(e)}));var ee=function(){function e(e,t){var n=this;this._subscriptions=new Map,this._subscribe=function(e,t,i){var r,o,a=function(i){if(i.property===t)return n._subscriptions.set(i,e),{value:function(){return n._subscriptions.delete(i)}}};try{for(var s=f(n._subscriptions.keys()),u=s.next();!u.done;u=s.next()){var l=a(u.value);if("object"==typeof l)return l.value}}catch(e){r={error:e}}finally{try{u&&!u.done&&(o=s.return)&&o.call(s)}finally{if(r)throw r.error}}return n._subscriptions.set({uuid:i,property:t},e),function(){return n._subscriptions.delete({uuid:i,property:t})}},this._value=e,this._currentValue={current:e},this._config=t,this.get=function(){return n._currentValue.current}}return e.prototype.setValue=function(e,t,n){var i,r,o=this;if("function"!=typeof e)try{for(var a=f(this._subscriptions.keys()),s=a.next();!s.done;s=a.next()){var u=s.value,l=this._subscriptions.get(u);l&&l(e,t,n)}}catch(e){i={error:e}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}else e((function(e,i){var r=new Promise((function(r){var a,s;try{for(var u=f(o._subscriptions.keys()),l=u.next();!l.done;l=u.next()){var c=l.value,h=o._subscriptions.get(c);h&&h(e,null!=i?i:t,(function(t){t.finished&&r(e),n&&n(t)}))}}catch(e){a={error:e}}finally{try{l&&!l.done&&(s=u.return)&&s.call(u)}finally{if(a)throw a.error}}}));return r}))},e}(),te=function(t,n){var i=e.useMemo((function(){return new ee(t,n)}),[]),r=e.useCallback((function(e,t,n){i.setValue(e,t,n)}),[]);return[i,r]};var ne=$("div"),ie=$("span"),re=$("img");function oe(t,n){var i=function(t,n){var i=u(e.useState(!1),2),r=i[0],o=i[1],a=e.useRef(n).current,s=a.from,f=a.enter,l=a.exit,c=a.config,h=a.enterConfig,d=a.exitConfig,p=u(te(s,c),2),m=p[0],v=p[1];return e.useLayoutEffect((function(){t?(o(!0),queueMicrotask((function(){return v(f,h)}))):v(l,d,(function(e){e.finished&&o(!1)}))}),[t]),function(e){return e(m,r)}}(t,n);return function(e){return i((function(t,n){return e({value:t},n)}))}}var ae=function(e){switch(e){case"elastic":return{mass:1,friction:18,tension:250};case"stiff":return{mass:1,friction:18,tension:350};case"wooble":return{mass:1,friction:8,tension:250};case"bounce":return{duration:500,easing:I.bounce};case"power1":return{duration:500,easing:I.bezier(.17,.42,.51,.97)};case"power2":return{duration:500,easing:I.bezier(.07,.11,.13,1)};case"power3":return{duration:500,easing:I.bezier(.09,.7,.16,1.04)};case"power4":return{duration:500,easing:I.bezier(.05,.54,0,1.03)};case"linear":return{duration:500,easing:I.linear};case"easein":return{duration:500,easing:I.in(I.ease)};case"easeout":return{duration:500,easing:I.out(I.ease)};case"easeinout":return{duration:500,easing:I.inOut(I.ease)};default:return{mass:1,friction:34,tension:290}}},se={ELASTIC:ae("elastic"),BOUNCE:ae("bounce"),EASE:ae("ease"),STIFF:ae("stiff"),WOOBLE:ae("wooble"),EASE_IN:ae("easein"),EASE_OUT:ae("easeout"),EASE_IN_OUT:ae("easeinout"),POWER1:ae("power1"),POWER2:ae("power2"),POWER3:ae("power3"),POWER4:ae("power4"),LINEAR:ae("linear")};function fe(e,t){var n=u(te(e,a(a({},se.EASE),t)),2),i=n[0],r=n[1],o={value:i,currentValue:i.get()};return new Proxy(o,{set:function(e,t,n){if("value"===t)return"number"!=typeof n&&"string"!=typeof n||r(n),!0;throw new Error("You cannot set any other property to animation node.")},get:function(e,t){if("value"===t)return i;if("currentValue"===t)return i.get();throw new Error("You cannot access any other property from animation node.")}})}function ue(e){return e?1:0}function le(e,t,n){return Math.min(Math.max(e,t),n)}function ce(e,t,n){return 0===t||Math.abs(t)===1/0?function(e,t){return Math.pow(e,5*t)}(e,n):e*t*n/(t+n*e)}function he(e,t){var n=new Map;return t.forEach((function(t){var i=u(t,3),r=i[0],o=i[1],a=i[2],s=void 0!==a&&a;n.set(r,function(e,t,n,i){return void 0===i&&(i=!1),e.forEach((function(e){e.addEventListener(t,n,i)})),function(){e.forEach((function(e){e.removeEventListener(t,n,i)}))}}(e,r,o,s))})),function(e){var t,i;try{for(var r=f(n.entries()),o=r.next();!o.done;o=r.next()){var a=u(o.value,2),s=a[0],l=a[1];if(!e)return void l();-1!==e.indexOf(s)&&l()}}catch(e){t={error:e}}finally{try{o&&!o.done&&(i=r.return)&&i.call(r)}finally{if(t)throw t.error}}}}var de=function(e,t){return{x:e,y:t}},pe=function(){function e(){this.lastTimeStamp=Date.now(),this.isActive=!1,this.targetElements=[]}return e.prototype._initEvents=function(){},e.prototype._cancelEvents=function(){this._subscribe&&this._subscribe()},e.prototype.applyCallback=function(e){this.callback=e},e.prototype.applyGesture=function(e){var t=this,n=e.targetElement,i=e.targetElements,r=e.callback,o=e.config;return this.targetElement=n,this.targetElements=i.map((function(e){return e.current})),this.callback=r,this.config=o,this._initEvents(),function(){return t._subscribe&&t._subscribe()}},e._VELOCITY_LIMIT=20,e}(),me=function(e){function t(){var t=e.apply(this,l([],u(arguments),!1))||this;return t.movementStart=de(0,0),t.initialMovement=de(0,0),t.movement=de(0,0),t.previousMovement=de(0,0),t.translation=de(0,0),t.offset=de(0,0),t.velocity=de(0,0),t}return o(t,e),t.prototype._initEvents=function(){(this.targetElement||this.targetElements.length>0)&&(this._subscribe=he([window],[["mousedown",this.pointerDown.bind(this)],["mousemove",this.pointerMove.bind(this)],["mouseup",this.pointerUp.bind(this)],["touchstart",this.pointerDown.bind(this),{passive:!1}],["touchmove",this.pointerMove.bind(this),{passive:!1}],["touchend",this.pointerUp.bind(this)]]))},t.prototype._cancelEvents=function(){this._subscribe&&this._subscribe(["mousedown","mousemove","touchstart","touchmove"])},t.prototype._handleCallback=function(){var e=this;this.callback&&this.callback({args:[this.currentIndex],down:this.isActive,movementX:this.movement.x,movementY:this.movement.y,offsetX:this.translation.x,offsetY:this.translation.y,velocityX:this.velocity.x,velocityY:this.velocity.y,distanceX:Math.abs(this.movement.x),distanceY:Math.abs(this.movement.y),directionX:Math.sign(this.movement.x),directionY:Math.sign(this.movement.y),cancel:function(){e._cancelEvents()}})},t.prototype.pointerDown=function(e){var t;"touchstart"===e.type?this.movementStart={x:e.touches[0].clientX,y:e.touches[0].clientY}:this.movementStart={x:e.clientX,y:e.clientY},this.movement={x:0,y:0},this.offset={x:this.translation.x,y:this.translation.y},this.previousMovement={x:0,y:0},this.velocity={x:0,y:0};var n=this.targetElements.find((function(t){return t===e.target}));if(e.target===this.targetElement||n){this.isActive=!0,e.preventDefault(),n&&(this.currentIndex=this.targetElements.indexOf(n));var i=(null===(t=this.config)||void 0===t?void 0:t.initial)&&this.config.initial(),r=null==i?void 0:i.movementX,o=null==i?void 0:i.movementY;this.initialMovement={x:null!=r?r:0,y:null!=o?o:0},this.movement={x:this.initialMovement.x,y:this.initialMovement.y},this.previousMovement={x:this.initialMovement.x,y:this.initialMovement.y},this._handleCallback()}},t.prototype.pointerMove=function(e){if(this.isActive){e.preventDefault();var t=Date.now(),n=le(t-this.lastTimeStamp,.1,64);this.lastTimeStamp=t;var i=n/1e3;"touchmove"===e.type?this.movement={x:this.initialMovement.x+(e.touches[0].clientX-this.movementStart.x),y:this.initialMovement.y+(e.touches[0].clientY-this.movementStart.y)}:this.movement={x:this.initialMovement.x+(e.clientX-this.movementStart.x),y:this.initialMovement.y+(e.clientY-this.movementStart.y)},this.translation={x:this.offset.x+this.movement.x,y:this.offset.y+this.movement.y},this.velocity={x:le((this.movement.x-this.previousMovement.x)/i/1e3,-1*pe._VELOCITY_LIMIT,pe._VELOCITY_LIMIT),y:le((this.movement.y-this.previousMovement.y)/i/1e3,-1*pe._VELOCITY_LIMIT,pe._VELOCITY_LIMIT)},this.previousMovement={x:this.movement.x,y:this.movement.y},this._handleCallback()}},t.prototype.pointerUp=function(){this.isActive&&(this.isActive=!1,this._handleCallback(),this._cancelEvents(),this._initEvents())},t}(pe),ve=function(e){function t(){var t=e.apply(this,l([],u(arguments),!1))||this;return t.movement=de(0,0),t.previousMovement=de(0,0),t.velocity=de(0,0),t.direction=de(0,0),t}return o(t,e),t.prototype._initEvents=function(){this.targetElement?this._subscribe=he([this.targetElement],[["mousemove",this.onMouseMove.bind(this)]]):this.targetElements.length>0?this._subscribe=he(this.targetElements,[["mousemove",this.onMouseMove.bind(this)]]):this._subscribe=he([window],[["mousemove",this.onMouseMove.bind(this)]])},t.prototype._handleCallback=function(){var e;this.callback&&this.callback({args:[this.currentIndex],event:this.event,isMoving:this.isActive,target:null===(e=this.event)||void 0===e?void 0:e.target,mouseX:this.movement.x,mouseY:this.movement.y,velocityX:this.velocity.x,velocityY:this.velocity.y,directionX:this.direction.x,directionY:this.direction.y})},t.prototype.onMouseMove=function(e){var t=this,n=this.targetElements.find((function(t){return t===e.target}));n&&(this.currentIndex=this.targetElements.indexOf(n)),this.event=e;var i=Date.now(),r=Math.min(i-this.lastTimeStamp,64);this.lastTimeStamp=i;var o=r/1e3,a=e.clientX,s=e.clientY;this.movement={x:a,y:s},-1!==this.isActiveID&&(this.isActive=!0,clearTimeout(this.isActiveID)),this.isActiveID=setTimeout((function(){t.isActive=!1,t.direction={x:0,y:0},t.velocity={x:0,y:0},t._handleCallback()}),250);var f=this.movement.x-this.previousMovement.x,u=this.movement.y-this.previousMovement.y;this.direction={x:Math.sign(f),y:Math.sign(u)},this.velocity={x:le(f/o/1e3,-1*pe._VELOCITY_LIMIT,pe._VELOCITY_LIMIT),y:le(u/o/1e3,-1*pe._VELOCITY_LIMIT,pe._VELOCITY_LIMIT)},this.previousMovement={x:this.movement.x,y:this.movement.y},this._handleCallback()},t}(pe),ye=function(e){function t(){var t=e.apply(this,l([],u(arguments),!1))||this;return t.movement=de(0,0),t.previousMovement=de(0,0),t.direction=de(0,0),t.velocity=de(0,0),t}return o(t,e),t.prototype._initEvents=function(){this.targetElement?this._subscribe=he([this.targetElement],[["scroll",this.scrollElementListener.bind(this)]]):this._subscribe=he([window],[["scroll",this.scrollListener.bind(this)]])},t.prototype._handleCallback=function(){this.callback&&this.callback({isScrolling:this.isActive,scrollX:this.movement.x,scrollY:this.movement.y,velocityX:this.velocity.x,velocityY:this.velocity.y,directionX:this.direction.x,directionY:this.direction.y})},t.prototype.onScroll=function(e){var t=this,n=e.x,i=e.y,r=Date.now(),o=Math.min(r-this.lastTimeStamp,64);this.lastTimeStamp=r;var a=o/1e3;this.movement={x:n,y:i},-1!==this.isActiveID&&(this.isActive=!0,clearTimeout(this.isActiveID)),this.isActiveID=setTimeout((function(){t.isActive=!1,t.direction={x:0,y:0},t.velocity={x:0,y:0},t._handleCallback()}),250);var s=this.movement.x-this.previousMovement.x,f=this.movement.y-this.previousMovement.y;this.direction={x:Math.sign(s),y:Math.sign(f)},this.velocity={x:le(s/a/1e3,-1*pe._VELOCITY_LIMIT,pe._VELOCITY_LIMIT),y:le(f/a/1e3,-1*pe._VELOCITY_LIMIT,pe._VELOCITY_LIMIT)},this.previousMovement={x:this.movement.x,y:this.movement.y},this._handleCallback()},t.prototype.scrollListener=function(){var e=window.pageYOffset,t=window.pageXOffset;this.onScroll({x:t,y:e})},t.prototype.scrollElementListener=function(){var e,t,n=(null===(e=this.targetElement)||void 0===e?void 0:e.scrollLeft)||0,i=(null===(t=this.targetElement)||void 0===t?void 0:t.scrollTop)||0;this.onScroll({x:n,y:i})},t}(pe),ge=function(e){function t(){var t=e.apply(this,l([],u(arguments),!1))||this;return t.movement=de(0,0),t.previousMovement=de(0,0),t.direction=de(0,0),t.velocity=de(0,0),t.delta=de(0,0),t.offset=de(0,0),t.translation=de(0,0),t}return o(t,e),t.prototype._initEvents=function(){this.targetElement&&(this._subscribe=he([this.targetElement],[["wheel",this.onWheel.bind(this)]]))},t.prototype._handleCallback=function(){this.callback&&this.callback({target:this.targetElement,isWheeling:this.isActive,deltaX:this.delta.x,deltaY:this.delta.y,directionX:this.direction.x,directionY:this.direction.y,movementX:this.movement.x,movementY:this.movement.y,offsetX:this.offset.x,offsetY:this.offset.y,velocityX:this.velocity.x,velocityY:this.velocity.y})},t.prototype.onWheel=function(e){var t=this,n=e.deltaX,i=e.deltaY,r=e.deltaMode,o=Date.now(),a=Math.min(o-this.lastTimeStamp,64);this.lastTimeStamp=o;var s=a/1e3;this.isActive=!0,-1!==this.isActiveID&&(this.isActive=!0,clearTimeout(this.isActiveID)),this.isActiveID=setTimeout((function(){t.isActive=!1,t.translation={x:t.offset.x,y:t.offset.y},t._handleCallback(),t.velocity={x:0,y:0},t.movement={x:0,y:0}}),200),1===r?(n*=40,i*=40):2===r&&(n*=800,i*=800),this.delta={x:n,y:i},this.movement={x:this.movement.x+n,y:this.movement.y+i},this.offset={x:this.translation.x+this.movement.x,y:this.translation.y+this.movement.y};var f=this.movement.x-this.previousMovement.x,u=this.movement.y-this.previousMovement.y;this.direction={x:Math.sign(f),y:Math.sign(u)},this.velocity={x:le(f/s/1e3,-1*pe._VELOCITY_LIMIT,pe._VELOCITY_LIMIT),y:le(u/s/1e3,-1*pe._VELOCITY_LIMIT,pe._VELOCITY_LIMIT)},this.previousMovement={x:this.movement.x,y:this.movement.y},this._handleCallback()},t}(pe),be=function(e){var t=i.useRef(),n=i.useRef([]),r=i.useRef(new Map).current;return i.useEffect((function(){var t,n;try{for(var i=f(r.entries()),o=i.next();!o.done;o=i.next()){var a=u(o.value,2)[1],s=a.keyIndex,l=a.gesture,c=u(e[s],3)[2];l.applyCallback(c)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}}),[e]),i.useEffect((function(){return e.forEach((function(e,i){var o=u(e,4),a=o[0],s=o[1],f=o[2],l=o[3];r.set(a,{keyIndex:i,gesture:s,unsubscribe:s.applyGesture({targetElement:t.current,targetElements:n.current,callback:f,config:l})})})),function(){var e,t;try{for(var n=f(r.entries()),i=n.next();!i.done;i=n.next()){var o=u(i.value,2)[1].unsubscribe;o&&o()}}catch(t){e={error:t}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}}}),[]),function(e){return null==e?{ref:t}:(n.current[e]=n.current[e]||i.createRef(),{ref:n.current[e]})}};exports.AnimatedBlock=ne,exports.AnimatedImage=re,exports.AnimatedInline=ie,exports.AnimationConfigUtils=se,exports.Easing=I,exports.MountedBlock=function(e){var n=e.state,i=e.children,r=e.from,o=void 0===r?0:r,a=e.enter,s=void 0===a?1:a,f=e.exit,u=oe(n,{from:o,enter:s,exit:void 0===f?0:f,config:e.config,enterConfig:e.enterConfig,exitConfig:e.exitConfig});return t.jsx(t.Fragment,{children:u((function(e,t){return t&&i(e)}))})},exports.ScrollableBlock=function(e){var n=e.children,r=e.direction,o=void 0===r?"single":r,a=e.animationConfig,s=e.threshold,f=void 0===s?.2:s,l=i.useRef(null),c=fe(0,a);return i.useEffect((function(){var e=l.current,t=new IntersectionObserver((function(e){u(e,1)[0].isIntersecting?c.value=1:"both"===o&&(c.value=0)}),{root:null,threshold:f});return e&&t.observe(e),function(){e&&t.unobserve(e)}}),[]),t.jsx("div",{ref:l,children:n&&n({value:c.value})})},exports.TransitionBlock=function(e){var n=e.state,i=e.children,r=e.config,o=fe(ue(n),r);return t.jsx(t.Fragment,{children:i({value:o.value})})},exports.bInterpolate=function(e,t,n,i){if(!R(e)||"number"!=typeof e||!D(e))throw new Error("Invalid ".concat(e," type for interpolate function. Expected number or FluidValue."));return G(e,[0,1],[t,n],i)},exports.bin=ue,exports.clamp=le,exports.delay=function(e){return new Promise((function(t){setTimeout((function(){return t(null)}),e)}))},exports.fluid=Q,exports.interpolate=function(e,t,n,i){if(!R(e)||"number"!=typeof e||!D(e))throw new Error("Invalid ".concat(e," type for interpolate function. Expected number or FluidValue."));return G(e,t,n,i)},exports.makeFluid=$,exports.mix=function(e,t,n){return t*(1-e)+n*e},exports.move=function(e,t,n){var i=e[t],r=e.length,o=t-n;if(o>0)return l(l(l(l([],u(e.slice(0,n)),!1),[i],!1),u(e.slice(n,t)),!1),u(e.slice(t+1,r)),!1);if(o<0){var a=n+1;return l(l(l(l([],u(e.slice(0,t)),!1),u(e.slice(t+1,a)),!1),[i],!1),u(e.slice(a,r)),!1)}return e},exports.rubberClamp=function(e,t,n,i){return void 0===i&&(i=.15),0===i?le(e,t,n):e<t?-ce(t-e,n-t,i)+t:e>n?+ce(e-n,n-t,i)+n:e},exports.snapTo=function(e,t,n){var i=e+.2*t,r=function(e){return Math.abs(e-i)},o=n.map(r),a=Math.min.apply(Math,l([],u(o),!1));return n.reduce((function(e,t){return r(t)===a?t:e}))},exports.useAnimatedValue=fe,exports.useDrag=function(e,t){var n=i.useRef(new me).current;return be([["drag",n,e,t]])},exports.useGesture=function(e){var t=e.onDrag,n=e.onWheel,r=e.onScroll,o=e.onMouseMove,a=i.useRef(new me).current,s=i.useRef(new ge).current,f=i.useRef(new ye).current,u=i.useRef(new ve).current;return be([["drag",a,t],["wheel",s,n],["scroll",f,r],["move",u,o]])},exports.useMeasure=function(t,n){var i=e.useRef(null),r=e.useRef([]),o=e.useRef(t);return e.useEffect((function(){return o.current=t,function(){o.current=function(){return!1}}}),n),e.useEffect((function(){var e=i.current||document.documentElement,t=r.current,n=new ResizeObserver((function(t){var n=u(t,1)[0].target.getBoundingClientRect(),i=n.left,r=n.top,a=n.width,s=n.height,f=window.pageXOffset,l=window.pageYOffset;if(o){if(e===document.documentElement)return;o.current({left:i+f,top:r+l,width:a,height:s,vLeft:i,vTop:r})}})),a=new ResizeObserver((function(e){var t=[],n=[],i=[],r=[],a=[],s=[];e.forEach((function(e){var o=e.target.getBoundingClientRect(),f=o.left,u=o.top,l=o.width,c=o.height,h=f+window.pageXOffset,d=u+window.pageYOffset;t.push(h),n.push(d),i.push(l),r.push(c),a.push(f),s.push(u)})),o&&o.current({left:t,top:n,width:i,height:r,vLeft:a,vTop:s})}));return e&&(e===document.documentElement&&t.length>0?t.forEach((function(e){a.observe(e.current)})):n.observe(e)),function(){e&&(e===document.documentElement&&t.length>0?t.forEach((function(e){a.unobserve(e.current)})):n.unobserve(e))}}),[]),function(t){return null==t?{ref:i}:(r.current[t]=r.current[t]||e.createRef(),{ref:r.current[t]})}},exports.useMountedValue=oe,exports.useMouseMove=function(e){var t=i.useRef(new ve).current;return be([["move",t,e]])},exports.useOutsideClick=function(t,n,i){var r=e.useRef();r.current||(r.current=n),e.useEffect((function(){return r.current=n,function(){r.current=function(){return!1}}}),i),e.useEffect((function(){var e=he([document],[["click",function(e){var n;(null===(n=null==t?void 0:t.current)||void 0===n?void 0:n.contains(e.target))||r.current&&r.current(e)}]]);return function(){return e&&e()}}),[])},exports.useScroll=function(e){var t=i.useRef(new ye).current;return be([["scroll",t,e]])},exports.useWheel=function(e){var t=i.useRef(new ge).current;return be([["wheel",t,e]])},exports.useWindowDimension=function(t,n){var i=e.useRef({width:0,height:0,innerWidth:0,innerHeight:0}),r=e.useRef(t);e.useEffect((function(){return r.current=t,function(){r.current=function(){return!1}}}),n),e.useEffect((function(){var e=new ResizeObserver((function(e){var t=u(e,1)[0].target,n=t.clientWidth,o=t.clientHeight,s=window.innerWidth,f=window.innerHeight;i.current={width:n,height:o,innerWidth:s,innerHeight:f},r&&r.current(a({},i.current))}));return e.observe(document.documentElement),function(){return e.unobserve(document.documentElement)}}),[])};
1
+ var t=require("@raidipesh78/re-motion"),e=require("react/jsx-runtime"),n=require("react");function i(t){var e=Object.create(null);return t&&Object.keys(t).forEach((function(n){if("default"!==n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}})),e.default=t,Object.freeze(e)}var r=i(n),o=function(t){return null!=t};function s(e){if(!o(e)||"number"!=typeof e&&!t.isFluidValue(e))throw console.log(e),new Error("Invalid ".concat(e," type for interpolate function. Expected number or FluidValue."));return e}var u=t.makeFluid("div"),a=t.makeFluid("span"),c=t.makeFluid("img");function l(e,n){var i=t.useMount(e,n);return function(t){return i((function(e,n){return t({value:e},n)}))}}var h=function(t,e){return h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},h(t,e)};function f(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}h(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var v=function(){return v=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},v.apply(this,arguments)};function m(t,e,n,i){return new(n||(n=Promise))((function(r,o){function s(t){try{a(i.next(t))}catch(t){o(t)}}function u(t){try{a(i.throw(t))}catch(t){o(t)}}function a(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,u)}a((i=i.apply(t,e||[])).next())}))}function p(t,e){var n,i,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(u){return function(a){return function(u){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(s=0)),s;)try{if(n=1,i&&(r=2&u[0]?i.return:u[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,u[1])).done)return r;switch(i=0,r&&(u=[2&u[0],r.value]),u[0]){case 0:case 1:r=u;break;case 4:return s.label++,{value:u[1],done:!1};case 5:s.label++,i=u[1],u=[0];continue;case 7:u=s.ops.pop(),s.trys.pop();continue;default:if(!(r=s.trys,(r=r.length>0&&r[r.length-1])||6!==u[0]&&2!==u[0])){s=0;continue}if(3===u[0]&&(!r||u[1]>r[0]&&u[1]<r[3])){s.label=u[1];break}if(6===u[0]&&s.label<r[1]){s.label=r[1],r=u;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(u);break}r[2]&&s.ops.pop(),s.trys.pop();continue}u=e.call(t,s)}catch(t){u=[6,t],i=0}finally{n=r=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,a])}}}function y(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],i=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function d(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var i,r,o=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(i=o.next()).done;)s.push(i.value)}catch(t){r={error:t}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return s}function x(t,e,n){if(n||2===arguments.length)for(var i,r=0,o=e.length;r<o;r++)!i&&r in e||(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))}"function"==typeof SuppressedError&&SuppressedError;var g=function(e){switch(e){case"elastic":return{mass:1,friction:18,tension:250};case"stiff":return{mass:1,friction:18,tension:350};case"wooble":return{mass:1,friction:8,tension:250};case"bounce":return{duration:500,easing:t.Easing.bounce};case"power1":return{duration:500,easing:t.Easing.bezier(.17,.42,.51,.97)};case"power2":return{duration:500,easing:t.Easing.bezier(.07,.11,.13,1)};case"power3":return{duration:500,easing:t.Easing.bezier(.09,.7,.16,1.04)};case"power4":return{duration:500,easing:t.Easing.bezier(.05,.54,0,1.03)};case"linear":return{duration:500,easing:t.Easing.linear};case"easein":return{duration:500,easing:t.Easing.in(t.Easing.ease)};case"easeout":return{duration:500,easing:t.Easing.out(t.Easing.ease)};case"easeinout":return{duration:500,easing:t.Easing.inOut(t.Easing.ease)};default:return{mass:1,friction:34,tension:290}}},b={ELASTIC:g("elastic"),BOUNCE:g("bounce"),EASE:g("ease"),STIFF:g("stiff"),WOOBLE:g("wooble"),EASE_IN:g("easein"),EASE_OUT:g("easeout"),EASE_IN_OUT:g("easeinout"),POWER1:g("power1"),POWER2:g("power2"),POWER3:g("power3"),POWER4:g("power4"),LINEAR:g("linear")};function E(e,n){var i=d(t.useFluidValue(e,v(v({},b.EASE),n)),2),r=i[0],o=i[1],s={value:r,currentValue:r.get()};return new Proxy(s,{set:function(t,e,n){if("value"===e)return"number"==typeof n||"string"==typeof n?o({toValue:n}):"object"!=typeof n&&"function"!=typeof n||o(n),!0;throw new Error("You cannot set any other property to animation node.")},get:function(t,e){if("value"===e)return r;if("currentValue"===e)return r.get();throw new Error("You cannot access any other property from animation node.")}})}function w(t){return t?1:0}function M(t,e,n){return Math.min(Math.max(t,e),n)}function _(t,e,n){return 0===e||Math.abs(e)===1/0?function(t,e){return Math.pow(t,5*e)}(t,n):t*e*n/(e+n*t)}function I(t,e){var n=new Map;return e.forEach((function(e){var i=d(e,3),r=i[0],o=i[1],s=i[2],u=void 0!==s&&s;n.set(r,function(t,e,n,i){return void 0===i&&(i=!1),t.forEach((function(t){t.addEventListener(e,n,i)})),function(){t.forEach((function(t){t.removeEventListener(e,n,i)}))}}(t,r,o,u))})),function(t){var e,i;try{for(var r=y(n.entries()),o=r.next();!o.done;o=r.next()){var s=d(o.value,2),u=s[0],a=s[1];if(!t)return void a();-1!==t.indexOf(u)&&a()}}catch(t){e={error:t}}finally{try{o&&!o.done&&(i=r.return)&&i.call(r)}finally{if(e)throw e.error}}}}var T=function(t,e){return{x:t,y:e}},O=function(){function t(){this.lastTimeStamp=Date.now(),this.isActive=!1,this.targetElements=[]}return t.prototype._initEvents=function(){},t.prototype._cancelEvents=function(){this._subscribe&&this._subscribe()},t.prototype.applyCallback=function(t){this.callback=t},t.prototype.applyGesture=function(t){var e=this,n=t.targetElement,i=t.targetElements,r=t.callback,o=t.config;return this.targetElement=n,this.targetElements=i.map((function(t){return t.current})),this.callback=r,this.config=o,this._initEvents(),function(){return e._subscribe&&e._subscribe()}},t._VELOCITY_LIMIT=20,t}(),L=function(t){function e(){var e=t.apply(this,x([],d(arguments),!1))||this;return e.movementStart=T(0,0),e.initialMovement=T(0,0),e.movement=T(0,0),e.previousMovement=T(0,0),e.translation=T(0,0),e.offset=T(0,0),e.velocity=T(0,0),e}return f(e,t),e.prototype._initEvents=function(){(this.targetElement||this.targetElements.length>0)&&(this._subscribe=I([window],[["mousedown",this.pointerDown.bind(this)],["mousemove",this.pointerMove.bind(this)],["mouseup",this.pointerUp.bind(this)],["touchstart",this.pointerDown.bind(this),{passive:!1}],["touchmove",this.pointerMove.bind(this),{passive:!1}],["touchend",this.pointerUp.bind(this)]]))},e.prototype._cancelEvents=function(){this._subscribe&&this._subscribe(["mousedown","mousemove","touchstart","touchmove"])},e.prototype._handleCallback=function(){var t=this;this.callback&&this.callback({args:[this.currentIndex],down:this.isActive,movementX:this.movement.x,movementY:this.movement.y,offsetX:this.translation.x,offsetY:this.translation.y,velocityX:this.velocity.x,velocityY:this.velocity.y,distanceX:Math.abs(this.movement.x),distanceY:Math.abs(this.movement.y),directionX:Math.sign(this.movement.x),directionY:Math.sign(this.movement.y),cancel:function(){t._cancelEvents()}})},e.prototype.pointerDown=function(t){var e;"touchstart"===t.type?this.movementStart={x:t.touches[0].clientX,y:t.touches[0].clientY}:this.movementStart={x:t.clientX,y:t.clientY},this.movement={x:0,y:0},this.offset={x:this.translation.x,y:this.translation.y},this.previousMovement={x:0,y:0},this.velocity={x:0,y:0};var n=this.targetElements.find((function(e){return e===t.target}));if(t.target===this.targetElement||n){this.isActive=!0,t.preventDefault(),n&&(this.currentIndex=this.targetElements.indexOf(n));var i=(null===(e=this.config)||void 0===e?void 0:e.initial)&&this.config.initial(),r=null==i?void 0:i.movementX,o=null==i?void 0:i.movementY;this.initialMovement={x:null!=r?r:0,y:null!=o?o:0},this.movement={x:this.initialMovement.x,y:this.initialMovement.y},this.previousMovement={x:this.initialMovement.x,y:this.initialMovement.y},this._handleCallback()}},e.prototype.pointerMove=function(t){if(this.isActive){t.preventDefault();var e=Date.now(),n=M(e-this.lastTimeStamp,.1,64);this.lastTimeStamp=e;var i=n/1e3;"touchmove"===t.type?this.movement={x:this.initialMovement.x+(t.touches[0].clientX-this.movementStart.x),y:this.initialMovement.y+(t.touches[0].clientY-this.movementStart.y)}:this.movement={x:this.initialMovement.x+(t.clientX-this.movementStart.x),y:this.initialMovement.y+(t.clientY-this.movementStart.y)},this.translation={x:this.offset.x+this.movement.x,y:this.offset.y+this.movement.y},this.velocity={x:M((this.movement.x-this.previousMovement.x)/i/1e3,-1*O._VELOCITY_LIMIT,O._VELOCITY_LIMIT),y:M((this.movement.y-this.previousMovement.y)/i/1e3,-1*O._VELOCITY_LIMIT,O._VELOCITY_LIMIT)},this.previousMovement={x:this.movement.x,y:this.movement.y},this._handleCallback()}},e.prototype.pointerUp=function(){this.isActive&&(this.isActive=!1,this._handleCallback(),this._cancelEvents(),this._initEvents())},e}(O),C=function(t){function e(){var e=t.apply(this,x([],d(arguments),!1))||this;return e.movement=T(0,0),e.previousMovement=T(0,0),e.velocity=T(0,0),e.direction=T(0,0),e}return f(e,t),e.prototype._initEvents=function(){this.targetElement?this._subscribe=I([this.targetElement],[["mousemove",this.onMouseMove.bind(this)]]):this.targetElements.length>0?this._subscribe=I(this.targetElements,[["mousemove",this.onMouseMove.bind(this)]]):this._subscribe=I([window],[["mousemove",this.onMouseMove.bind(this)]])},e.prototype._handleCallback=function(){var t;this.callback&&this.callback({args:[this.currentIndex],event:this.event,isMoving:this.isActive,target:null===(t=this.event)||void 0===t?void 0:t.target,mouseX:this.movement.x,mouseY:this.movement.y,velocityX:this.velocity.x,velocityY:this.velocity.y,directionX:this.direction.x,directionY:this.direction.y})},e.prototype.onMouseMove=function(t){var e=this,n=this.targetElements.find((function(e){return e===t.target}));n&&(this.currentIndex=this.targetElements.indexOf(n)),this.event=t;var i=Date.now(),r=Math.min(i-this.lastTimeStamp,64);this.lastTimeStamp=i;var o=r/1e3,s=t.clientX,u=t.clientY;this.movement={x:s,y:u},-1!==this.isActiveID&&(this.isActive=!0,clearTimeout(this.isActiveID)),this.isActiveID=setTimeout((function(){e.isActive=!1,e.direction={x:0,y:0},e.velocity={x:0,y:0},e._handleCallback()}),250);var a=this.movement.x-this.previousMovement.x,c=this.movement.y-this.previousMovement.y;this.direction={x:Math.sign(a),y:Math.sign(c)},this.velocity={x:M(a/o/1e3,-1*O._VELOCITY_LIMIT,O._VELOCITY_LIMIT),y:M(c/o/1e3,-1*O._VELOCITY_LIMIT,O._VELOCITY_LIMIT)},this.previousMovement={x:this.movement.x,y:this.movement.y},this._handleCallback()},e}(O),k=function(t){function e(){var e=t.apply(this,x([],d(arguments),!1))||this;return e.movement=T(0,0),e.previousMovement=T(0,0),e.direction=T(0,0),e.velocity=T(0,0),e}return f(e,t),e.prototype._initEvents=function(){this.targetElement?this._subscribe=I([this.targetElement],[["scroll",this.scrollElementListener.bind(this)]]):this._subscribe=I([window],[["scroll",this.scrollListener.bind(this)]])},e.prototype._handleCallback=function(){this.callback&&this.callback({isScrolling:this.isActive,scrollX:this.movement.x,scrollY:this.movement.y,velocityX:this.velocity.x,velocityY:this.velocity.y,directionX:this.direction.x,directionY:this.direction.y})},e.prototype.onScroll=function(t){var e=this,n=t.x,i=t.y,r=Date.now(),o=Math.min(r-this.lastTimeStamp,64);this.lastTimeStamp=r;var s=o/1e3;this.movement={x:n,y:i},-1!==this.isActiveID&&(this.isActive=!0,clearTimeout(this.isActiveID)),this.isActiveID=setTimeout((function(){e.isActive=!1,e.direction={x:0,y:0},e.velocity={x:0,y:0},e._handleCallback()}),250);var u=this.movement.x-this.previousMovement.x,a=this.movement.y-this.previousMovement.y;this.direction={x:Math.sign(u),y:Math.sign(a)},this.velocity={x:M(u/s/1e3,-1*O._VELOCITY_LIMIT,O._VELOCITY_LIMIT),y:M(a/s/1e3,-1*O._VELOCITY_LIMIT,O._VELOCITY_LIMIT)},this.previousMovement={x:this.movement.x,y:this.movement.y},this._handleCallback()},e.prototype.scrollListener=function(){var t=window.pageYOffset,e=window.pageXOffset;this.onScroll({x:e,y:t})},e.prototype.scrollElementListener=function(){var t,e,n=(null===(t=this.targetElement)||void 0===t?void 0:t.scrollLeft)||0,i=(null===(e=this.targetElement)||void 0===e?void 0:e.scrollTop)||0;this.onScroll({x:n,y:i})},e}(O),Y=function(t){function e(){var e=t.apply(this,x([],d(arguments),!1))||this;return e.movement=T(0,0),e.previousMovement=T(0,0),e.direction=T(0,0),e.velocity=T(0,0),e.delta=T(0,0),e.offset=T(0,0),e.translation=T(0,0),e}return f(e,t),e.prototype._initEvents=function(){this.targetElement&&(this._subscribe=I([this.targetElement],[["wheel",this.onWheel.bind(this)]]))},e.prototype._handleCallback=function(){this.callback&&this.callback({target:this.targetElement,isWheeling:this.isActive,deltaX:this.delta.x,deltaY:this.delta.y,directionX:this.direction.x,directionY:this.direction.y,movementX:this.movement.x,movementY:this.movement.y,offsetX:this.offset.x,offsetY:this.offset.y,velocityX:this.velocity.x,velocityY:this.velocity.y})},e.prototype.onWheel=function(t){var e=this,n=t.deltaX,i=t.deltaY,r=t.deltaMode,o=Date.now(),s=Math.min(o-this.lastTimeStamp,64);this.lastTimeStamp=o;var u=s/1e3;this.isActive=!0,-1!==this.isActiveID&&(this.isActive=!0,clearTimeout(this.isActiveID)),this.isActiveID=setTimeout((function(){e.isActive=!1,e.translation={x:e.offset.x,y:e.offset.y},e._handleCallback(),e.velocity={x:0,y:0},e.movement={x:0,y:0}}),200),1===r?(n*=40,i*=40):2===r&&(n*=800,i*=800),this.delta={x:n,y:i},this.movement={x:this.movement.x+n,y:this.movement.y+i},this.offset={x:this.translation.x+this.movement.x,y:this.translation.y+this.movement.y};var a=this.movement.x-this.previousMovement.x,c=this.movement.y-this.previousMovement.y;this.direction={x:Math.sign(a),y:Math.sign(c)},this.velocity={x:M(a/u/1e3,-1*O._VELOCITY_LIMIT,O._VELOCITY_LIMIT),y:M(c/u/1e3,-1*O._VELOCITY_LIMIT,O._VELOCITY_LIMIT)},this.previousMovement={x:this.movement.x,y:this.movement.y},this._handleCallback()},e}(O),S=function(t){var e=r.useRef(),n=r.useRef([]),i=r.useRef(new Map).current;return r.useEffect((function(){var e,n;try{for(var r=y(i.entries()),o=r.next();!o.done;o=r.next()){var s=d(o.value,2)[1],u=s.keyIndex,a=s.gesture,c=d(t[u],3)[2];a.applyCallback(c)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}}),[t]),r.useEffect((function(){return t.forEach((function(t,r){var o=d(t,4),s=o[0],u=o[1],a=o[2],c=o[3];i.set(s,{keyIndex:r,gesture:u,unsubscribe:u.applyGesture({targetElement:e.current,targetElements:n.current,callback:a,config:c})})})),function(){var t,e;try{for(var n=y(i.entries()),r=n.next();!r.done;r=n.next()){var o=d(r.value,2)[1].unsubscribe;o&&o()}}catch(e){t={error:e}}finally{try{r&&!r.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}}}),[]),function(t){return null==t?{ref:e}:(n.current[t]=n.current[t]||r.createRef(),{ref:n.current[t]})}};Object.defineProperty(exports,"Easing",{enumerable:!0,get:function(){return t.Easing}}),Object.defineProperty(exports,"fluid",{enumerable:!0,get:function(){return t.fluid}}),Object.defineProperty(exports,"makeFluid",{enumerable:!0,get:function(){return t.makeFluid}}),exports.AnimatedBlock=u,exports.AnimatedImage=c,exports.AnimatedInline=a,exports.AnimationConfigUtils=b,exports.MountedBlock=function(t){var n=t.state,i=t.children,r=t.from,o=void 0===r?0:r,s=t.enter,u=void 0===s?1:s,a=t.exit,c=l(n,{from:o,enter:u,exit:void 0===a?0:a,config:t.config,enterConfig:t.enterConfig,exitConfig:t.exitConfig});return e.jsx(e.Fragment,{children:c((function(t,e){return e&&i({value:t.value})}))})},exports.ScrollableBlock=function(t){var n=t.children,i=t.direction,o=void 0===i?"single":i,s=t.animationConfig,u=t.threshold,a=void 0===u?.2:u,c=r.useRef(null),l=E(0,s);return r.useEffect((function(){var t=c.current,e=new IntersectionObserver((function(t){d(t,1)[0].isIntersecting?l.value=1:"both"===o&&(l.value=0)}),{root:null,threshold:a});return t&&e.observe(t),function(){t&&e.unobserve(t)}}),[]),e.jsx("div",{ref:c,children:n&&n({value:l.value})})},exports.TransitionBlock=function(t){var n=t.state,i=t.children,r=t.config,o=E(w(n),r);return e.jsx(e.Fragment,{children:i({value:o.value})})},exports.bInterpolate=function(e,n,i,r){var o=s(e);return t.interpolate(o,[0,1],[n,i],r)},exports.bin=w,exports.clamp=M,exports.delay=function(t){return new Promise((function(e){setTimeout((function(){return e(null)}),t)}))},exports.interpolate=function(e,n,i,r){var o=s(e);return t.interpolate(o,n,i,r)},exports.mix=function(t,e,n){return e*(1-t)+n*t},exports.move=function(t,e,n){var i=t[e],r=t.length,o=e-n;if(o>0)return x(x(x(x([],d(t.slice(0,n)),!1),[i],!1),d(t.slice(n,e)),!1),d(t.slice(e+1,r)),!1);if(o<0){var s=n+1;return x(x(x(x([],d(t.slice(0,e)),!1),d(t.slice(e+1,s)),!1),[i],!1),d(t.slice(s,r)),!1)}return t},exports.rubberClamp=function(t,e,n,i){return void 0===i&&(i=.15),0===i?M(t,e,n):t<e?-_(e-t,n-e,i)+e:t>n?+_(t-n,n-e,i)+n:t},exports.snapTo=function(t,e,n){var i=t+.2*e,r=function(t){return Math.abs(t-i)},o=n.map(r),s=Math.min.apply(Math,x([],d(o),!1));return n.reduce((function(t,e){return r(e)===s?e:t}))},exports.useAnimatedValue=E,exports.useDrag=function(t,e){var n=r.useRef(new L).current;return S([["drag",n,t,e]])},exports.useGesture=function(t){var e=t.onDrag,n=t.onWheel,i=t.onScroll,o=t.onMouseMove,s=r.useRef(new L).current,u=r.useRef(new Y).current,a=r.useRef(new k).current,c=r.useRef(new C).current;return S([["drag",s,e],["wheel",u,n],["scroll",a,i],["move",c,o]])},exports.useMeasure=function(t,e){var i=n.useRef(null),r=n.useRef([]),o=n.useRef(t);return n.useEffect((function(){return o.current=t,function(){o.current=function(){return!1}}}),e),n.useEffect((function(){var t=i.current||document.documentElement,e=r.current,n=new ResizeObserver((function(e){var n=d(e,1)[0].target.getBoundingClientRect(),i=n.left,r=n.top,s=n.width,u=n.height,a=window.pageXOffset,c=window.pageYOffset;if(o){if(t===document.documentElement)return;o.current({left:i+a,top:r+c,width:s,height:u,vLeft:i,vTop:r})}})),s=new ResizeObserver((function(t){var e=[],n=[],i=[],r=[],s=[],u=[];t.forEach((function(t){var o=t.target.getBoundingClientRect(),a=o.left,c=o.top,l=o.width,h=o.height,f=a+window.pageXOffset,v=c+window.pageYOffset;e.push(f),n.push(v),i.push(l),r.push(h),s.push(a),u.push(c)})),o&&o.current({left:e,top:n,width:i,height:r,vLeft:s,vTop:u})}));return t&&(t===document.documentElement&&e.length>0?e.forEach((function(t){s.observe(t.current)})):n.observe(t)),function(){t&&(t===document.documentElement&&e.length>0?e.forEach((function(t){s.unobserve(t.current)})):n.unobserve(t))}}),[]),function(t){return null==t?{ref:i}:(r.current[t]=r.current[t]||n.createRef(),{ref:r.current[t]})}},exports.useMountedValue=l,exports.useMouseMove=function(t){var e=r.useRef(new C).current;return S([["move",e,t]])},exports.useOutsideClick=function(t,e,i){var r=n.useRef();r.current||(r.current=e),n.useEffect((function(){return r.current=e,function(){r.current=function(){return!1}}}),i),n.useEffect((function(){var e=I([document],[["click",function(e){var n;(null===(n=null==t?void 0:t.current)||void 0===n?void 0:n.contains(e.target))||r.current&&r.current(e)}]]);return function(){return e&&e()}}),[])},exports.useScroll=function(t){var e=r.useRef(new k).current;return S([["scroll",e,t]])},exports.useWheel=function(t){var e=r.useRef(new Y).current;return S([["wheel",e,t]])},exports.useWindowDimension=function(t,e){var i=n.useRef({width:0,height:0,innerWidth:0,innerHeight:0}),r=n.useRef(t);n.useEffect((function(){return r.current=t,function(){r.current=function(){return!1}}}),e),n.useEffect((function(){var t=new ResizeObserver((function(t){var e=d(t,1)[0].target,n=e.clientWidth,o=e.clientHeight,s=window.innerWidth,u=window.innerHeight;i.current={width:n,height:o,innerWidth:s,innerHeight:u},r&&r.current(v({},i.current))}));return t.observe(document.documentElement),function(){return t.unobserve(document.documentElement)}}),[])},exports.withDelay=function(t,e){return v(v({},e),{config:v(v({},e.config),{delay:t})})},exports.withSequence=function(t){var e=d(t).slice(0);return function(t){return m(void 0,void 0,void 0,(function(){var n,i,r,o,s,u;return p(this,(function(a){switch(a.label){case 0:a.trys.push([0,5,6,7]),n=y(e),i=n.next(),a.label=1;case 1:return i.done?[3,4]:(r=i.value,[4,t(r)]);case 2:a.sent(),a.label=3;case 3:return i=n.next(),[3,1];case 4:return[3,7];case 5:return o=a.sent(),s={error:o},[3,7];case 6:try{i&&!i.done&&(u=n.return)&&u.call(n)}finally{if(s)throw s.error}return[7];case 7:return[2]}}))}))}},exports.withSpring=function(t,e){return void 0===e&&(e=b.ELASTIC),{toValue:t,config:e}},exports.withTiming=function(t,e){return void 0===e&&(e={duration:250}),{toValue:t,config:e}};
2
2
  //# sourceMappingURL=index.js.map