@abhishekzambare/react-grid-dnd 0.0.8 → 0.0.11
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/README.md +0 -0
- package/Readme.md +171 -0
- package/dist/favicon.svg +0 -0
- package/dist/icons.svg +0 -0
- package/dist/react-grid-dnd.cjs +1 -0
- package/dist/react-grid-dnd.d.ts +2 -2
- package/dist/react-grid-dnd.js +2023 -2095
- package/package.json +21 -21
package/README.md
CHANGED
|
File without changes
|
package/Readme.md
ADDED
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
<img
|
|
3
|
+
max-width="300px"
|
|
4
|
+
alt="A demo showing views being swiped left and right."
|
|
5
|
+
src="https://raw.githubusercontent.com/bmcmahen/react-dnd-grid/master/demo.gif">
|
|
6
|
+
</div>
|
|
7
|
+
|
|
8
|
+
# react-grid-dnd
|
|
9
|
+
|
|
10
|
+
[](https://www.npmjs.com/package/react-dnd-grid)
|
|
11
|
+
[](https://twitter.com/intent/follow?screen_name=benmcmahen)
|
|
12
|
+
|
|
13
|
+
Grid style drag and drop, built with React. See a live example on [codesandbox](https://codesandbox.io/embed/gracious-wozniak-kj9w8). You can also see it in action [here](https://react-gesture-responder.netlify.com/).
|
|
14
|
+
|
|
15
|
+
## Features
|
|
16
|
+
|
|
17
|
+
- **Supports dragging between arbitrary number of lists**.
|
|
18
|
+
- **Built with [react-gesture-responder](https://github.com/bmcmahen/react-gesture-responder) to enable better control over gesture delegation.**
|
|
19
|
+
- **Disable drop targets or dragging altogether**
|
|
20
|
+
- **Animated with react-spring**
|
|
21
|
+
|
|
22
|
+
## Install
|
|
23
|
+
|
|
24
|
+
Install `react-grid-dnd` and `react-gesture-responder` using yarn or npm.
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
yarn add react-grid-dnd react-gesture-responder
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Usage
|
|
31
|
+
|
|
32
|
+
Because `GridItem` components are rendered with absolute positioning, you need to ensure that `GridDropZone` has a specified height or flex, like in the example below.
|
|
33
|
+
|
|
34
|
+
```jsx
|
|
35
|
+
import {
|
|
36
|
+
GridContextProvider,
|
|
37
|
+
GridDropZone,
|
|
38
|
+
GridItem,
|
|
39
|
+
swap,
|
|
40
|
+
} from "react-grid-dnd";
|
|
41
|
+
|
|
42
|
+
function Example() {
|
|
43
|
+
const [items, setItems] = React.useState([1, 2, 3, 4]); // supply your own state
|
|
44
|
+
|
|
45
|
+
// target id will only be set if dragging from one dropzone to another.
|
|
46
|
+
function onChange(sourceId, sourceIndex, targetIndex, targetId) {
|
|
47
|
+
const nextState = swap(items, sourceIndex, targetIndex);
|
|
48
|
+
setItems(nextState);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return (
|
|
52
|
+
<GridContextProvider onChange={onChange}>
|
|
53
|
+
<GridDropZone
|
|
54
|
+
id="items"
|
|
55
|
+
boxesPerRow={4}
|
|
56
|
+
rowHeight={100}
|
|
57
|
+
style={{ height: "400px" }}
|
|
58
|
+
>
|
|
59
|
+
{items.map((item) => (
|
|
60
|
+
<GridItem key={item}>
|
|
61
|
+
<div
|
|
62
|
+
style={{
|
|
63
|
+
width: "100%",
|
|
64
|
+
height: "100%",
|
|
65
|
+
}}
|
|
66
|
+
>
|
|
67
|
+
{item}
|
|
68
|
+
</div>
|
|
69
|
+
</GridItem>
|
|
70
|
+
))}
|
|
71
|
+
</GridDropZone>
|
|
72
|
+
</GridContextProvider>
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## Dragging between lists
|
|
78
|
+
|
|
79
|
+
You can see this example in action on [codesandbox](https://codesandbox.io/embed/gracious-wozniak-kj9w8).
|
|
80
|
+
|
|
81
|
+
```jsx
|
|
82
|
+
import {
|
|
83
|
+
GridContextProvider,
|
|
84
|
+
GridDropZone,
|
|
85
|
+
GridItem,
|
|
86
|
+
swap,
|
|
87
|
+
move,
|
|
88
|
+
} from "react-grid-dnd";
|
|
89
|
+
|
|
90
|
+
function App() {
|
|
91
|
+
const [items, setItems] = React.useState({
|
|
92
|
+
left: [
|
|
93
|
+
{ id: 1, name: "ben" },
|
|
94
|
+
{ id: 2, name: "joe" },
|
|
95
|
+
{ id: 3, name: "jason" },
|
|
96
|
+
{ id: 4, name: "chris" },
|
|
97
|
+
{ id: 5, name: "heather" },
|
|
98
|
+
{ id: 6, name: "Richard" },
|
|
99
|
+
],
|
|
100
|
+
right: [
|
|
101
|
+
{ id: 7, name: "george" },
|
|
102
|
+
{ id: 8, name: "rupert" },
|
|
103
|
+
{ id: 9, name: "alice" },
|
|
104
|
+
{ id: 10, name: "katherine" },
|
|
105
|
+
{ id: 11, name: "pam" },
|
|
106
|
+
{ id: 12, name: "katie" },
|
|
107
|
+
],
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
function onChange(sourceId, sourceIndex, targetIndex, targetId) {
|
|
111
|
+
if (targetId) {
|
|
112
|
+
const result = move(
|
|
113
|
+
items[sourceId],
|
|
114
|
+
items[targetId],
|
|
115
|
+
sourceIndex,
|
|
116
|
+
targetIndex,
|
|
117
|
+
);
|
|
118
|
+
return setItems({
|
|
119
|
+
...items,
|
|
120
|
+
[sourceId]: result[0],
|
|
121
|
+
[targetId]: result[1],
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
const result = swap(items[sourceId], sourceIndex, targetIndex);
|
|
126
|
+
return setItems({
|
|
127
|
+
...items,
|
|
128
|
+
[sourceId]: result,
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
return (
|
|
133
|
+
<GridContextProvider onChange={onChange}>
|
|
134
|
+
<div className="container">
|
|
135
|
+
<GridDropZone
|
|
136
|
+
className="dropzone left"
|
|
137
|
+
id="left"
|
|
138
|
+
boxesPerRow={4}
|
|
139
|
+
rowHeight={70}
|
|
140
|
+
>
|
|
141
|
+
{items.left.map((item) => (
|
|
142
|
+
<GridItem key={item.name}>
|
|
143
|
+
<div className="grid-item">
|
|
144
|
+
<div className="grid-item-content">
|
|
145
|
+
{item.name[0].toUpperCase()}
|
|
146
|
+
</div>
|
|
147
|
+
</div>
|
|
148
|
+
</GridItem>
|
|
149
|
+
))}
|
|
150
|
+
</GridDropZone>
|
|
151
|
+
<GridDropZone
|
|
152
|
+
className="dropzone right"
|
|
153
|
+
id="right"
|
|
154
|
+
boxesPerRow={4}
|
|
155
|
+
rowHeight={70}
|
|
156
|
+
>
|
|
157
|
+
{items.right.map((item) => (
|
|
158
|
+
<GridItem key={item.name}>
|
|
159
|
+
<div className="grid-item">
|
|
160
|
+
<div className="grid-item-content">
|
|
161
|
+
{item.name[0].toUpperCase()}
|
|
162
|
+
</div>
|
|
163
|
+
</div>
|
|
164
|
+
</GridItem>
|
|
165
|
+
))}
|
|
166
|
+
</GridDropZone>
|
|
167
|
+
</div>
|
|
168
|
+
</GridContextProvider>
|
|
169
|
+
);
|
|
170
|
+
}
|
|
171
|
+
```
|
package/dist/favicon.svg
CHANGED
|
File without changes
|
package/dist/icons.svg
CHANGED
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(e){throw n=[e],e}},s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,a)=>(a=n==null?{}:e(i(n)),c(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n)),u=e=>a.call(e,`module.exports`)?e[`module.exports`]:c(t({},`__esModule`,{value:!0}),e);let d=require("react");d=l(d,1);let f=require("react/jsx-runtime");function p(e,{boxesPerRow:t,rowHeight:n,columnWidth:r},i){let a=typeof i==`number`&&e>=i?e+1:e;return{xy:[a%t*r,Math.floor(a/t)*n]}}function m(e,t,n,r,i){let{xy:[a,o]}=p(e,t);return{xy:[a+n+(i?t.columnWidth/2:0),o+r+(i?t.rowHeight/2:0)]}}function h(e,t,{rowHeight:n,boxesPerRow:r,columnWidth:i},a){let o=Math.floor(t/n)*r+Math.floor(e/i);return o>=a?a:o}function g(e,t,n,r,i){let{xy:[a,o]}=m(e,t,r,i,!0);return h(a,o,t,n)}var _=()=>{throw Error(`Make sure that you have wrapped your drop zones with GridContext`)},v=(0,d.createContext)({register:_,remove:_,getActiveDropId:_,startTraverse:_,measureAll:_,traverse:null,endTraverse:_,onChange:_});function y({children:e,onChange:t}){let[n,r]=(0,d.useState)(null),i=(0,d.useRef)(new Map);function a(e,t){i.current.set(e,t)}function o(e){i.current.delete(e)}function s(e,t,n){let r=i.current.get(e);if(!r)return{x:t,y:n};let{left:a,top:o}=r;return{x:a+t,y:o+n}}function c(e,t,n){let r=i.current.get(e);if(r!=null){let{left:e,top:i}=r;return{x:t-e,y:n-i}}else return{x:t,y:n}}function l(e,t){let n=i.current.get(e),r=i.current.get(t);return n!=null&&r!=null?{x:r.left-n.left,y:r.top-n.top}:{x:0,y:0}}function u(e,t,n){let{x:r,y:a}=s(e,t,n);for(let[e,t]of i.current.entries())if(!t.disableDrop&&r>t.left&&r<t.right&&a>t.top&&a<t.bottom)return e;return null}function m(e,t,a,o,u){let{x:d,y:f}=s(e,a,o),{x:m,y:g}=c(t,d,f),_=i.current.get(t);if(_!=null){let{grid:i,count:a}=_,o=h(m+i.columnWidth/2,g+i.rowHeight/2,i,a),{xy:[s,c]}=p(o,i),{x:d,y:f}=l(e,t);(!n||!(n&&n.targetIndex!==o&&n.targetId!==t))&&r({rx:s+d,ry:c+f,tx:m,ty:g,sourceId:e,targetId:t,sourceIndex:u,targetIndex:o})}}function g(){r(null)}function _(e,i,a,o){n!=null&&r({...n,execute:!0}),t(e,i,a,o)}function y(){i.current.forEach(e=>{e.remeasure()})}return(0,f.jsx)(v,{value:{register:a,remove:o,getActiveDropId:u,startTraverse:m,traverse:n,measureAll:y,endTraverse:g,onChange:_},children:e})}var b=(function(){if(typeof Map<`u`)return Map;function e(e,t){var n=-1;return e.some(function(e,r){return e[0]===t?(n=r,!0):!1}),n}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(t){var n=e(this.__entries__,t),r=this.__entries__[n];return r&&r[1]},t.prototype.set=function(t,n){var r=e(this.__entries__,t);~r?this.__entries__[r][1]=n:this.__entries__.push([t,n])},t.prototype.delete=function(t){var n=this.__entries__,r=e(n,t);~r&&n.splice(r,1)},t.prototype.has=function(t){return!!~e(this.__entries__,t)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(e,t){t===void 0&&(t=null);for(var n=0,r=this.__entries__;n<r.length;n++){var i=r[n];e.call(t,i[1],i[0])}},t}()})(),x=typeof window<`u`&&typeof document<`u`&&window.document===document,S=(function(){return typeof global<`u`&&global.Math===Math?global:typeof self<`u`&&self.Math===Math?self:typeof window<`u`&&window.Math===Math?window:Function(`return this`)()})(),C=(function(){return typeof requestAnimationFrame==`function`?requestAnimationFrame.bind(S):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)}})(),w=2;function T(e,t){var n=!1,r=!1,i=0;function a(){n&&(n=!1,e()),r&&s()}function o(){C(a)}function s(){var e=Date.now();if(n){if(e-i<w)return;r=!0}else n=!0,r=!1,setTimeout(o,t);i=e}return s}var E=20,D=[`top`,`right`,`bottom`,`left`,`width`,`height`,`size`,`weight`],ee=typeof MutationObserver<`u`,O=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=T(this.refresh.bind(this),E)}return e.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_()},e.prototype.removeObserver=function(e){var t=this.observers_,n=t.indexOf(e);~n&&t.splice(n,1),!t.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},e.prototype.updateObservers_=function(){var e=this.observers_.filter(function(e){return e.gatherActive(),e.hasActive()});return e.forEach(function(e){return e.broadcastActive()}),e.length>0},e.prototype.connect_=function(){!x||this.connected_||(document.addEventListener(`transitionend`,this.onTransitionEnd_),window.addEventListener(`resize`,this.refresh),ee?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener(`DOMSubtreeModified`,this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){!x||!this.connected_||(document.removeEventListener(`transitionend`,this.onTransitionEnd_),window.removeEventListener(`resize`,this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener(`DOMSubtreeModified`,this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(e){var t=e.propertyName,n=t===void 0?``:t;D.some(function(e){return!!~n.indexOf(e)})&&this.refresh()},e.getInstance=function(){return this.instance_||=new e,this.instance_},e.instance_=null,e}(),k=(function(e,t){for(var n=0,r=Object.keys(t);n<r.length;n++){var i=r[n];Object.defineProperty(e,i,{value:t[i],enumerable:!1,writable:!1,configurable:!0})}return e}),A=(function(e){return e&&e.ownerDocument&&e.ownerDocument.defaultView||S}),te=de(0,0,0,0);function ne(e){return parseFloat(e)||0}function re(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce(function(t,n){var r=e[`border-`+n+`-width`];return t+ne(r)},0)}function ie(e){for(var t=[`top`,`right`,`bottom`,`left`],n={},r=0,i=t;r<i.length;r++){var a=i[r],o=e[`padding-`+a];n[a]=ne(o)}return n}function ae(e){var t=e.getBBox();return de(0,0,t.width,t.height)}function oe(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return te;var r=A(e).getComputedStyle(e),i=ie(r),a=i.left+i.right,o=i.top+i.bottom,s=ne(r.width),c=ne(r.height);if(r.boxSizing===`border-box`&&(Math.round(s+a)!==t&&(s-=re(r,`left`,`right`)+a),Math.round(c+o)!==n&&(c-=re(r,`top`,`bottom`)+o)),!ce(e)){var l=Math.round(s+a)-t,u=Math.round(c+o)-n;Math.abs(l)!==1&&(s-=l),Math.abs(u)!==1&&(c-=u)}return de(i.left,i.top,s,c)}var se=(function(){return typeof SVGGraphicsElement<`u`?function(e){return e instanceof A(e).SVGGraphicsElement}:function(e){return e instanceof A(e).SVGElement&&typeof e.getBBox==`function`}})();function ce(e){return e===A(e).document.documentElement}function le(e){return x?se(e)?ae(e):oe(e):te}function ue(e){var t=e.x,n=e.y,r=e.width,i=e.height,a=Object.create((typeof DOMRectReadOnly<`u`?DOMRectReadOnly:Object).prototype);return k(a,{x:t,y:n,width:r,height:i,top:n,right:t+r,bottom:i+n,left:t}),a}function de(e,t,n,r){return{x:e,y:t,width:n,height:r}}var fe=function(){function e(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=de(0,0,0,0),this.target=e}return e.prototype.isActive=function(){var e=le(this.target);return this.contentRect_=e,e.width!==this.broadcastWidth||e.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var e=this.contentRect_;return this.broadcastWidth=e.width,this.broadcastHeight=e.height,e},e}(),pe=function(){function e(e,t){var n=ue(t);k(this,{target:e,contentRect:n})}return e}(),me=function(){function e(e,t,n){if(this.activeObservations_=[],this.observations_=new b,typeof e!=`function`)throw TypeError(`The callback provided as parameter 1 is not a function.`);this.callback_=e,this.controller_=t,this.callbackCtx_=n}return e.prototype.observe=function(e){if(!arguments.length)throw TypeError(`1 argument required, but only 0 present.`);if(!(typeof Element>`u`||!(Element instanceof Object))){if(!(e instanceof A(e).Element))throw TypeError(`parameter 1 is not of type "Element".`);var t=this.observations_;t.has(e)||(t.set(e,new fe(e)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(e){if(!arguments.length)throw TypeError(`1 argument required, but only 0 present.`);if(!(typeof Element>`u`||!(Element instanceof Object))){if(!(e instanceof A(e).Element))throw TypeError(`parameter 1 is not of type "Element".`);var t=this.observations_;t.has(e)&&(t.delete(e),t.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach(function(t){t.isActive()&&e.activeObservations_.push(t)})},e.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,t=this.activeObservations_.map(function(e){return new pe(e.target,e.broadcastRect())});this.callback_.call(e,t,e),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),he=typeof WeakMap<`u`?new WeakMap:new b,ge=function(){function e(t){if(!(this instanceof e))throw TypeError(`Cannot call a class as a function.`);if(!arguments.length)throw TypeError(`1 argument required, but only 0 present.`);var n=new me(t,O.getInstance(),this);he.set(this,n)}return e}();[`observe`,`unobserve`,`disconnect`].forEach(function(e){ge.prototype[e]=function(){var t;return(t=he.get(this))[e].apply(t,arguments)}});var _e=(function(){return S.ResizeObserver===void 0?ge:S.ResizeObserver})();function ve(e){let[t,n]=d.useState({left:0,top:0,width:0,height:0,right:0,bottom:0}),[r]=d.useState(()=>new _e(([e])=>{n(e.target.getBoundingClientRect())}));d.useLayoutEffect(()=>(e.current&&r.observe(e.current),()=>r.disconnect()),[e,r]);function i(){e.current&&n(e.current.getBoundingClientRect())}return{bounds:t,remeasure:i}}function ye(e,t,n){let r=e[t],{length:i}=e,a=t-n;if(a>0)return[...e.slice(0,n),r,...e.slice(n,t),...e.slice(t+1,i)];if(a<0){let a=n+1;return[...e.slice(0,t),...e.slice(t+1,a),r,...e.slice(a,i)]}return e}var be=d.createContext(null);function xe({id:e,boxesPerRow:t,children:n,style:r,disableDrag:i=!1,disableDrop:a=!1,rowHeight:o,...s}){let{traverse:c,startTraverse:l,endTraverse:u,register:m,measureAll:h,onChange:_,remove:y,getActiveDropId:b}=d.useContext(v),x=d.useRef(null),{bounds:S,remeasure:C}=ve(x),[w,T]=d.useState(null),[E,D]=d.useState(null),ee=c&&!c.execute&&c.targetId===e?c.targetIndex:null,O={columnWidth:S.width/t,boxesPerRow:t,rowHeight:o},k=d.Children.count(n);d.useEffect(()=>{m(e,{top:S.top,bottom:S.bottom,left:S.left,right:S.right,width:S.width,height:S.height,count:k,grid:O,disableDrop:a,remeasure:C})},[k,a,S,e,O]),d.useEffect(()=>()=>y(e),[e]);let A=d.Children.map(n,(e,t)=>t);return(0,f.jsx)(`div`,{ref:x,style:{position:`relative`,...r},...s,children:O.columnWidth===0?null:d.Children.map(n,(t,n)=>{let r=c?.targetId===e&&c.targetIndex===n,a=p((E?ye(A&&A?.length>0?A:[],E.startIndex,E.targetIndex):A&&A?.length>0?A:[]).indexOf(n),O,ee);function o(t,r,i){if(!x.current)return;w!==n&&T(n);let a=b(e,r+O.columnWidth/2,i+O.rowHeight/2);a&&a!==e?l(e,a,r,i,n):u();let o=a===e?g(n,O,k,t.delta[0],t.delta[1]):k;o===n?E&&D(null):(E&&E.targetIndex!==o||!E)&&D({targetIndex:o,startIndex:n})}function s(t,r,i){let a=b(e,r+O.columnWidth/2,i+O.rowHeight/2)===e?g(n,O,k,t.delta[0],t.delta[1]):k;c?_(c.sourceId,c.sourceIndex,c.targetIndex,c.targetId):_(e,n,a),D(null),T(null)}function d(){h()}return(0,f.jsx)(be,{value:{top:a.xy[1],disableDrag:i,endTraverse:u,mountWithTraverseTarget:r?[c.tx,c.ty]:void 0,left:a.xy[0],i:n,onMove:o,onEnd:s,onStart:d,grid:O,dragging:n===w},children:t})})})}function Se(e,t,n,r){let i=Array.from(e),a=Array.from(t),[o]=i.splice(n,1);return a.splice(r,0,o),[i,a]}var Ce=(0,d.createContext)({});function we(e){let t=(0,d.useRef)(null);return t.current===null&&(t.current=e()),t.current}var Te=typeof window<`u`?d.useLayoutEffect:d.useEffect,Ee=(0,d.createContext)(null);function De(e,t){e.indexOf(t)===-1&&e.push(t)}function Oe(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}var j=(e,t,n)=>n>t?t:n<e?e:n;function ke(e,t){return t?`${e}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${t}`:e}var Ae=()=>{},M=()=>{};typeof process<`u`&&process.env.NODE_ENV!==`production`&&(Ae=(e,t,n)=>{!e&&typeof console<`u`&&console.warn(ke(t,n))},M=(e,t,n)=>{if(!e)throw Error(ke(t,n))});var je={},Me=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),Ne=e=>typeof e==`object`&&!!e,Pe=e=>/^0[^.\s]+$/u.test(e);function Fe(e){let t;return()=>(t===void 0&&(t=e()),t)}var N=e=>e,Ie=(...e)=>e.reduce((e,t)=>n=>t(e(n))),Le=(e,t,n)=>{let r=t-e;return r?(n-e)/r:1},Re=class{constructor(){this.subscriptions=[]}add(e){return De(this.subscriptions,e),()=>Oe(this.subscriptions,e)}notify(e,t,n){let r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](e,t,n);else for(let i=0;i<r;i++){let r=this.subscriptions[i];r&&r(e,t,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}},P=e=>e*1e3,F=e=>e/1e3,ze=(e,t)=>t?1e3/t*e:0,Be=new Set;function Ve(e,t,n){e||Be.has(t)||(console.warn(ke(t,n)),Be.add(t))}var He=(e,t,n)=>{let r=t-e;return((n-e)%r+r)%r+e},Ue=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,We=1e-7,Ge=12;function Ke(e,t,n,r,i){let a,o,s=0;do o=t+(n-t)/2,a=Ue(o,r,i)-e,a>0?n=o:t=o;while(Math.abs(a)>We&&++s<Ge);return o}function qe(e,t,n,r){if(e===t&&n===r)return N;let i=t=>Ke(t,0,1,e,n);return e=>e===0||e===1?e:Ue(i(e),t,r)}var Je=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Ye=e=>t=>1-e(1-t),Xe=qe(.33,1.53,.69,.99),Ze=Ye(Xe),Qe=Je(Ze),$e=e=>e>=1?1:(e*=2)<1?.5*Ze(e):.5*(2-2**(-10*(e-1))),et=e=>1-Math.sin(Math.acos(e)),tt=Ye(et),nt=Je(et),rt=qe(.42,0,1,1),it=qe(0,0,.58,1),at=qe(.42,0,.58,1),ot=e=>Array.isArray(e)&&typeof e[0]!=`number`;function st(e,t){return ot(e)?e[He(0,e.length,t)]:e}var ct=e=>Array.isArray(e)&&typeof e[0]==`number`,lt={linear:N,easeIn:rt,easeInOut:at,easeOut:it,circIn:et,circInOut:nt,circOut:tt,backIn:Ze,backInOut:Qe,backOut:Xe,anticipate:$e},ut=e=>typeof e==`string`,dt=e=>{if(ct(e)){M(e.length===4,`Cubic bezier arrays must contain four numerical values.`,`cubic-bezier-length`);let[t,n,r,i]=e;return qe(t,n,r,i)}else if(ut(e))return M(lt[e]!==void 0,`Invalid easing type '${e}'`,`invalid-easing-type`),lt[e];return e},ft=[`setup`,`read`,`resolveKeyframes`,`preUpdate`,`update`,`preRender`,`render`,`postRender`];function pt(e){let t=new Set,n=new Set,r=!1,i=!1,a=new WeakSet,o={delta:0,timestamp:0,isProcessing:!1};function s(t){a.has(t)&&(c.schedule(t),e()),t(o)}let c={schedule:(e,i=!1,o=!1)=>{let s=o&&r?t:n;return i&&a.add(e),s.add(e),e},cancel:e=>{n.delete(e),a.delete(e)},process:e=>{if(o=e,r){i=!0;return}r=!0;let a=t;t=n,n=a,t.forEach(s),t.clear(),r=!1,i&&(i=!1,c.process(e))}};return c}var mt=40;function ht(e,t){let n=!1,r=!0,i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=ft.reduce((e,t)=>(e[t]=pt(a),e),{}),{setup:s,read:c,resolveKeyframes:l,preUpdate:u,update:d,preRender:f,render:p,postRender:m}=o,h=()=>{let a=je.useManualTiming,o=a?i.timestamp:performance.now();n=!1,a||(i.delta=r?1e3/60:Math.max(Math.min(o-i.timestamp,mt),1)),i.timestamp=o,i.isProcessing=!0,s.process(i),c.process(i),l.process(i),u.process(i),d.process(i),f.process(i),p.process(i),m.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(h))},g=()=>{n=!0,r=!0,i.isProcessing||e(h)};return{schedule:ft.reduce((e,t)=>{let r=o[t];return e[t]=(e,t=!1,i=!1)=>(n||g(),r.schedule(e,t,i)),e},{}),cancel:e=>{for(let t=0;t<ft.length;t++)o[ft[t]].cancel(e)},state:i,steps:o}}var{schedule:I,cancel:gt,state:L,steps:_t}=ht(typeof requestAnimationFrame<`u`?requestAnimationFrame:N,!0),vt;function yt(){vt=void 0}var R={now:()=>(vt===void 0&&R.set(L.isProcessing||je.useManualTiming?L.timestamp:performance.now()),vt),set:e=>{vt=e,queueMicrotask(yt)}},bt=e=>t=>typeof t==`string`&&t.startsWith(e),xt=bt(`--`),St=bt(`var(--`),Ct=e=>St(e)?wt.test(e.split(`/*`)[0].trim()):!1,wt=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Tt(e){return typeof e==`string`&&e.split(`/*`)[0].includes(`var(--`)}var Et={test:e=>typeof e==`number`,parse:parseFloat,transform:e=>e},Dt={...Et,transform:e=>j(0,1,e)},Ot={...Et,default:1},kt=e=>Math.round(e*1e5)/1e5,At=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function jt(e){return e==null}var Mt=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Nt=(e,t)=>n=>!!(typeof n==`string`&&Mt.test(n)&&n.startsWith(e)||t&&!jt(n)&&Object.prototype.hasOwnProperty.call(n,t)),Pt=(e,t,n)=>r=>{if(typeof r!=`string`)return r;let[i,a,o,s]=r.match(At);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s===void 0?1:parseFloat(s)}},Ft=e=>j(0,255,e),It={...Et,transform:e=>Math.round(Ft(e))},Lt={test:Nt(`rgb`,`red`),parse:Pt(`red`,`green`,`blue`),transform:({red:e,green:t,blue:n,alpha:r=1})=>`rgba(`+It.transform(e)+`, `+It.transform(t)+`, `+It.transform(n)+`, `+kt(Dt.transform(r))+`)`};function Rt(e){let t=``,n=``,r=``,i=``;return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}var zt={test:Nt(`#`),parse:Rt,transform:Lt.transform},Bt=e=>({test:t=>typeof t==`string`&&t.endsWith(e)&&t.split(` `).length===1,parse:parseFloat,transform:t=>`${t}${e}`}),z=Bt(`deg`),B=Bt(`%`),V=Bt(`px`),Vt=Bt(`vh`),Ht=Bt(`vw`),Ut={...B,parse:e=>B.parse(e)/100,transform:e=>B.transform(e*100)},Wt={test:Nt(`hsl`,`hue`),parse:Pt(`hue`,`saturation`,`lightness`),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>`hsla(`+Math.round(e)+`, `+B.transform(kt(t))+`, `+B.transform(kt(n))+`, `+kt(Dt.transform(r))+`)`},H={test:e=>Lt.test(e)||zt.test(e)||Wt.test(e),parse:e=>Lt.test(e)?Lt.parse(e):Wt.test(e)?Wt.parse(e):zt.parse(e),transform:e=>typeof e==`string`?e:e.hasOwnProperty(`red`)?Lt.transform(e):Wt.transform(e),getAnimatableNone:e=>{let t=H.parse(e);return t.alpha=0,H.transform(t)}},Gt=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Kt(e){return isNaN(e)&&typeof e==`string`&&(e.match(At)?.length||0)+(e.match(Gt)?.length||0)>0}var qt=`number`,Jt=`color`,Yt=`var`,Xt=`var(`,Zt="${}",Qt=/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 $t(e){let t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[],a=0;return{values:n,split:t.replace(Qt,e=>(H.test(e)?(r.color.push(a),i.push(Jt),n.push(H.parse(e))):e.startsWith(Xt)?(r.var.push(a),i.push(Yt),n.push(e)):(r.number.push(a),i.push(qt),n.push(parseFloat(e))),++a,Zt)).split(Zt),indexes:r,types:i}}function en(e){return $t(e).values}function tn({split:e,types:t}){let n=e.length;return r=>{let i=``;for(let a=0;a<n;a++)if(i+=e[a],r[a]!==void 0){let e=t[a];e===qt?i+=kt(r[a]):e===Jt?i+=H.transform(r[a]):i+=r[a]}return i}}function nn(e){return tn($t(e))}var rn=e=>typeof e==`number`?0:H.test(e)?H.getAnimatableNone(e):e,an=(e,t)=>typeof e==`number`?t?.trim().endsWith(`/`)?e:0:rn(e);function on(e){let t=$t(e);return tn(t)(t.values.map((e,n)=>an(e,t.split[n])))}var U={test:Kt,parse:en,createTransformer:nn,getAnimatableNone:on};function sn(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function cn({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,o=0;if(!t)i=a=o=n;else{let r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;i=sn(s,r,e+1/3),a=sn(s,r,e),o=sn(s,r,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function ln(e,t){return n=>n>0?t:e}var W=(e,t,n)=>e+(t-e)*n,un=(e,t,n)=>{let r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},dn=[zt,Lt,Wt],fn=e=>dn.find(t=>t.test(e));function pn(e){let t=fn(e);if(Ae(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`,`color-not-animatable`),!t)return!1;let n=t.parse(e);return t===Wt&&(n=cn(n)),n}var mn=(e,t)=>{let n=pn(e),r=pn(t);if(!n||!r)return ln(e,t);let i={...n};return e=>(i.red=un(n.red,r.red,e),i.green=un(n.green,r.green,e),i.blue=un(n.blue,r.blue,e),i.alpha=W(n.alpha,r.alpha,e),Lt.transform(i))},hn=new Set([`none`,`hidden`]);function gn(e,t){return hn.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function _n(e,t){return n=>W(e,t,n)}function vn(e){return typeof e==`number`?_n:typeof e==`string`?Ct(e)?ln:H.test(e)?mn:Sn:Array.isArray(e)?yn:typeof e==`object`?H.test(e)?mn:bn:ln}function yn(e,t){let n=[...e],r=n.length,i=e.map((e,n)=>vn(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}}function bn(e,t){let n={...e,...t},r={};for(let i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=vn(e[i])(e[i],t[i]));return e=>{for(let t in r)n[t]=r[t](e);return n}}function xn(e,t){let n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){let a=t.types[i],o=e.indexes[a][r[a]];n[i]=e.values[o]??0,r[a]++}return n}var Sn=(e,t)=>{let n=U.createTransformer(t),r=$t(e),i=$t(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?hn.has(e)&&!i.values.length||hn.has(t)&&!r.values.length?gn(e,t):Ie(yn(xn(r,i),i.values),n):(Ae(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,`complex-values-different`),ln(e,t))};function Cn(e,t,n){return typeof e==`number`&&typeof t==`number`&&typeof n==`number`?W(e,t,n):vn(e)(e,t)}var wn=e=>{let t=({timestamp:t})=>e(t);return{start:(e=!0)=>I.update(t,e),stop:()=>gt(t),now:()=>L.isProcessing?L.timestamp:R.now()}},Tn=(e,t,n=10)=>{let r=``,i=Math.max(Math.round(t/n),2);for(let t=0;t<i;t++)r+=Math.round(e(t/(i-1))*1e4)/1e4+`, `;return`linear(${r.substring(0,r.length-2)})`},En=2e4;function Dn(e){let t=0,n=e.next(t);for(;!n.done&&t<2e4;)t+=50,n=e.next(t);return t>=2e4?1/0:t}function On(e,t=100,n){let r=n({...e,keyframes:[0,t]}),i=Math.min(Dn(r),En);return{type:`keyframes`,ease:e=>r.next(i*e).value/t,duration:F(i)}}var G={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function kn(e,t){return e*Math.sqrt(1-t*t)}var An=12;function jn(e,t,n){let r=n;for(let n=1;n<An;n++)r-=e(r)/t(r);return r}var Mn=.001;function Nn({duration:e=G.duration,bounce:t=G.bounce,velocity:n=G.velocity,mass:r=G.mass}){let i,a;Ae(e<=P(G.maxDuration),`Spring duration must be 10 seconds or less`,`spring-duration-limit`);let o=1-t;o=j(G.minDamping,G.maxDamping,o),e=j(G.minDuration,G.maxDuration,F(e)),o<1?(i=t=>{let r=t*o,i=r*e,a=r-n,s=kn(t,o),c=Math.exp(-i);return Mn-a/s*c},a=t=>{let r=t*o*e,a=r*n+n,s=o**2*t**2*e,c=Math.exp(-r),l=kn(t**2,o);return(-i(t)+Mn>0?-1:1)*((a-s)*c)/l}):(i=t=>-.001+Math.exp(-t*e)*((t-n)*e+1),a=t=>Math.exp(-t*e)*((n-t)*(e*e)));let s=5/e,c=jn(i,a,s);if(e=P(e),isNaN(c))return{stiffness:G.stiffness,damping:G.damping,duration:e};{let t=c**2*r;return{stiffness:t,damping:o*2*Math.sqrt(r*t),duration:e}}}var Pn=[`duration`,`bounce`],Fn=[`stiffness`,`damping`,`mass`];function In(e,t){return t.some(t=>e[t]!==void 0)}function Ln(e){let t={velocity:G.velocity,stiffness:G.stiffness,damping:G.damping,mass:G.mass,isResolvedFromDuration:!1,...e};if(!In(e,Fn)&&In(e,Pn))if(t.velocity=0,e.visualDuration){let n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,a=2*j(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:G.mass,stiffness:i,damping:a}}else{let n=Nn({...e,velocity:0});t={...t,...n,mass:G.mass},t.isResolvedFromDuration=!0}return t}function Rn(e=G.visualDuration,t=G.bounce){let n=typeof e==`object`?e:{visualDuration:e,keyframes:[0,1],bounce:t},{restSpeed:r,restDelta:i}=n,a=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],s={done:!1,value:a},{stiffness:c,damping:l,mass:u,duration:d,velocity:f,isResolvedFromDuration:p}=Ln({...n,velocity:-F(n.velocity||0)}),m=f||0,h=l/(2*Math.sqrt(c*u)),g=o-a,_=F(Math.sqrt(c/u)),v=Math.abs(g)<5;r||=v?G.restSpeed.granular:G.restSpeed.default,i||=v?G.restDelta.granular:G.restDelta.default;let y,b,x,S,C,w;if(h<1)x=kn(_,h),S=(m+h*_*g)/x,y=e=>{let t=Math.exp(-h*_*e);return o-t*(S*Math.sin(x*e)+g*Math.cos(x*e))},C=h*_*S+g*x,w=h*_*g-S*x,b=e=>Math.exp(-h*_*e)*(C*Math.sin(x*e)+w*Math.cos(x*e));else if(h===1){y=e=>o-Math.exp(-_*e)*(g+(m+_*g)*e);let e=m+_*g;b=t=>Math.exp(-_*t)*(_*e*t-m)}else{let e=_*Math.sqrt(h*h-1);y=t=>{let n=Math.exp(-h*_*t),r=Math.min(e*t,300);return o-n*((m+h*_*g)*Math.sinh(r)+e*g*Math.cosh(r))/e};let t=(m+h*_*g)/e,n=h*_*t-g*e,r=h*_*g-t*e;b=t=>{let i=Math.exp(-h*_*t),a=Math.min(e*t,300);return i*(n*Math.sinh(a)+r*Math.cosh(a))}}let T={calculatedDuration:p&&d||null,velocity:e=>P(b(e)),next:e=>{if(!p&&h<1){let t=Math.exp(-h*_*e),n=Math.sin(x*e),a=Math.cos(x*e),c=o-t*(S*n+g*a),l=P(t*(C*n+w*a));return s.done=Math.abs(l)<=r&&Math.abs(o-c)<=i,s.value=s.done?o:c,s}let t=y(e);if(p)s.done=e>=d;else{let n=P(b(e));s.done=Math.abs(n)<=r&&Math.abs(o-t)<=i}return s.value=s.done?o:t,s},toString:()=>{let e=Math.min(Dn(T),En),t=Tn(t=>T.next(e*t).value,e,30);return e+`ms `+t},toTransition:()=>{}};return T}Rn.applyToOptions=e=>{let t=On(e,100,Rn);return e.ease=t.ease,e.duration=P(t.duration),e.type=`keyframes`,e};var zn=5;function Bn(e,t,n){let r=Math.max(t-zn,0);return ze(n-e(r),t-r)}function Vn({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:s,max:c,restDelta:l=.5,restSpeed:u}){let d=e[0],f={done:!1,value:d},p=e=>s!==void 0&&e<s||c!==void 0&&e>c,m=e=>s===void 0?c:c===void 0||Math.abs(s-e)<Math.abs(c-e)?s:c,h=n*t,g=d+h,_=o===void 0?g:o(g);_!==g&&(h=_-d);let v=e=>-h*Math.exp(-e/r),y=e=>_+v(e),b=e=>{let t=v(e),n=y(e);f.done=Math.abs(t)<=l,f.value=f.done?_:n},x,S,C=e=>{p(f.value)&&(x=e,S=Rn({keyframes:[f.value,m(f.value)],velocity:Bn(y,e,f.value),damping:i,stiffness:a,restDelta:l,restSpeed:u}))};return C(0),{calculatedDuration:null,next:e=>{let t=!1;return!S&&x===void 0&&(t=!0,b(e),C(e)),x!==void 0&&e>=x?S.next(e-x):(!t&&b(e),f)}}}function Hn(e,t,n){let r=[],i=n||je.mix||Cn,a=e.length-1;for(let n=0;n<a;n++){let a=i(e[n],e[n+1]);t&&(a=Ie(Array.isArray(t)?t[n]||N:t,a)),r.push(a)}return r}function Un(e,t,{clamp:n=!0,ease:r,mixer:i}={}){let a=e.length;if(M(a===t.length,`Both input and output ranges must be the same length`,`range-length`),a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];let o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());let s=Hn(t,r,i),c=s.length,l=n=>{if(o&&n<e[0])return t[0];let r=0;if(c>1)for(;r<e.length-2&&!(n<e[r+1]);r++);let i=Le(e[r],e[r+1],n);return s[r](i)};return n?t=>l(j(e[0],e[a-1],t)):l}function Wn(e,t){let n=e[e.length-1];for(let r=1;r<=t;r++){let i=Le(0,t,r);e.push(W(n,1,i))}}function Gn(e){let t=[0];return Wn(t,e.length-1),t}function Kn(e,t){return e.map(e=>e*t)}function qn(e,t){return e.map(()=>t||at).splice(0,e.length-1)}function Jn({duration:e=300,keyframes:t,times:n,ease:r=`easeInOut`}){let i=ot(r)?r.map(dt):dt(r),a={done:!1,value:t[0]},o=Un(Kn(n&&n.length===t.length?n:Gn(t),e),t,{ease:Array.isArray(i)?i:qn(t,i)});return{calculatedDuration:e,next:t=>(a.value=o(t),a.done=t>=e,a)}}var Yn=e=>e!==null;function Xn(e,{repeat:t,repeatType:n=`loop`},r,i=1){let a=e.filter(Yn),o=i<0||t&&n!==`loop`&&t%2==1?0:a.length-1;return!o||r===void 0?a[o]:r}var Zn={decay:Vn,inertia:Vn,tween:Jn,keyframes:Jn,spring:Rn};function Qn(e){typeof e.type==`string`&&(e.type=Zn[e.type])}var $n=class{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,t){return this.finished.then(e,t)}},er=e=>e/100,tr=class extends $n{constructor(e){super(),this.state=`idle`,this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{let{motionValue:e}=this.options;e&&e.updatedAt!==R.now()&&this.tick(R.now()),this.isStopped=!0,this.state!==`idle`&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){let{options:e}=this;Qn(e);let{type:t=Jn,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=e,{keyframes:o}=e,s=t||Jn;process.env.NODE_ENV!==`production`&&s!==Jn&&M(o.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${o}`,`spring-two-frames`),s!==Jn&&typeof o[0]!=`number`&&(this.mixKeyframes=Ie(er,Cn(o[0],o[1])),o=[0,100]);let c=s({...e,keyframes:o});i===`mirror`&&(this.mirroredGenerator=s({...e,keyframes:[...o].reverse(),velocity:-a})),c.calculatedDuration===null&&(c.calculatedDuration=Dn(c));let{calculatedDuration:l}=c;this.calculatedDuration=l,this.resolvedDuration=l+r,this.totalDuration=this.resolvedDuration*(n+1)-r,this.generator=c}updateTime(e){let t=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime===null?this.currentTime=t:this.currentTime=this.holdTime}tick(e,t=!1){let{generator:n,totalDuration:r,mixKeyframes:i,mirroredGenerator:a,resolvedDuration:o,calculatedDuration:s}=this;if(this.startTime===null)return n.next(0);let{delay:c=0,keyframes:l,repeat:u,repeatType:d,repeatDelay:f,type:p,onUpdate:m,finalKeyframe:h}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);let g=this.currentTime-c*(this.playbackSpeed>=0?1:-1),_=this.playbackSpeed>=0?g<0:g>r;this.currentTime=Math.max(g,0),this.state===`finished`&&this.holdTime===null&&(this.currentTime=r);let v=this.currentTime,y=n;if(u){let e=Math.min(this.currentTime,r)/o,t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),n===1&&t--,t=Math.min(t,u+1),t%2&&(d===`reverse`?(n=1-n,f&&(n-=f/o)):d===`mirror`&&(y=a)),v=j(0,1,n)*o}let b;_?(this.delayState.value=l[0],b=this.delayState):b=y.next(v),i&&!_&&(b.value=i(b.value));let{done:x}=b;!_&&s!==null&&(x=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);let S=this.holdTime===null&&(this.state===`finished`||this.state===`running`&&x);return S&&p!==Vn&&(b.value=Xn(l,this.options,h,this.speed)),m&&m(b.value),S&&this.finish(),b}then(e,t){return this.finished.then(e,t)}get duration(){return F(this.calculatedDuration)}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+F(e)}get time(){return F(this.currentTime)}set time(e){e=P(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state=`paused`,this.holdTime=e,this.tick(e))}getGeneratorVelocity(){let e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);let t=this.generator.next(e).value;return Bn(e=>this.generator.next(e).value,e,t)}get speed(){return this.playbackSpeed}set speed(e){let t=this.playbackSpeed!==e;t&&this.driver&&this.updateTime(R.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=F(this.currentTime))}play(){if(this.isStopped)return;let{driver:e=wn,startTime:t}=this.options;this.driver||=e(e=>this.tick(e)),this.options.onPlay?.();let n=this.driver.now();this.state===`finished`?(this.updateFinished(),this.startTime=n):this.holdTime===null?this.startTime||=t??n:this.startTime=n-this.holdTime,this.state===`finished`&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state=`running`,this.driver.start()}pause(){this.state=`paused`,this.updateTime(R.now()),this.holdTime=this.currentTime}complete(){this.state!==`running`&&this.play(),this.state=`finished`,this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state=`finished`,this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state=`idle`,this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&=(this.driver.stop(),void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type=`keyframes`,this.options.ease=`linear`,this.initAnimation()),this.driver?.stop(),e.observe(this)}};function nr(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}var rr=e=>e*180/Math.PI,ir=e=>or(rr(Math.atan2(e[1],e[0]))),ar={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:ir,rotateZ:ir,skewX:e=>rr(Math.atan(e[1])),skewY:e=>rr(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},or=e=>(e%=360,e<0&&(e+=360),e),sr=ir,cr=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),lr=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),ur={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:cr,scaleY:lr,scale:e=>(cr(e)+lr(e))/2,rotateX:e=>or(rr(Math.atan2(e[6],e[5]))),rotateY:e=>or(rr(Math.atan2(-e[2],e[0]))),rotateZ:sr,rotate:sr,skewX:e=>rr(Math.atan(e[4])),skewY:e=>rr(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function dr(e){return+!!e.includes(`scale`)}function fr(e,t){if(!e||e===`none`)return dr(t);let n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),r,i;if(n)r=ur,i=n;else{let t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=ar,i=t}if(!i)return dr(t);let a=r[t],o=i[1].split(`,`).map(mr);return typeof a==`function`?a(o):o[a]}var pr=(e,t)=>{let{transform:n=`none`}=getComputedStyle(e);return fr(n,t)};function mr(e){return parseFloat(e.trim())}var hr=[`transformPerspective`,`x`,`y`,`z`,`translateX`,`translateY`,`translateZ`,`scale`,`scaleX`,`scaleY`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skew`,`skewX`,`skewY`],gr=new Set([...hr,`pathRotation`]),_r=e=>e===Et||e===V,vr=new Set([`x`,`y`,`z`]),yr=hr.filter(e=>!vr.has(e));function br(e){let t=[];return yr.forEach(n=>{let r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(+!!n.startsWith(`scale`)))}),t}var xr={width:({x:e},{paddingLeft:t=`0`,paddingRight:n=`0`,boxSizing:r})=>{let i=e.max-e.min;return r===`border-box`?i:i-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t=`0`,paddingBottom:n=`0`,boxSizing:r})=>{let i=e.max-e.min;return r===`border-box`?i:i-parseFloat(t)-parseFloat(n)},top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>fr(t,`x`),y:(e,{transform:t})=>fr(t,`y`)};xr.translateX=xr.x,xr.translateY=xr.y;var Sr=new Set,Cr=!1,wr=!1,Tr=!1;function Er(){if(wr){let e=Array.from(Sr).filter(e=>e.needsMeasurement),t=new Set(e.map(e=>e.element)),n=new Map;t.forEach(e=>{let t=br(e);t.length&&(n.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();let t=n.get(e);t&&t.forEach(([t,n])=>{e.getValue(t)?.set(n)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{e.suspendedScrollY!==void 0&&window.scrollTo(0,e.suspendedScrollY)})}wr=!1,Cr=!1,Sr.forEach(e=>e.complete(Tr)),Sr.clear()}function Dr(){Sr.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(wr=!0)})}function Or(){Tr=!0,Dr(),Er(),Tr=!1}var kr=class{constructor(e,t,n,r,i,a=!1){this.state=`pending`,this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=i,this.isAsync=a}scheduleResolve(){this.state=`scheduled`,this.isAsync?(Sr.add(this),Cr||(Cr=!0,I.read(Dr),I.resolveKeyframes(Er))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;if(e[0]===null){let i=r?.get(),a=e[e.length-1];if(i!==void 0)e[0]=i;else if(n&&t){let r=n.readValue(t,a);r!=null&&(e[0]=r)}e[0]===void 0&&(e[0]=a),r&&i===void 0&&r.set(e[0])}nr(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state=`complete`,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),Sr.delete(this)}cancel(){this.state===`scheduled`&&(Sr.delete(this),this.state=`pending`)}resume(){this.state===`pending`&&this.scheduleResolve()}},Ar=e=>e.startsWith(`--`);function jr(e,t,n){Ar(t)?e.style.setProperty(t,n):e.style[t]=n}var Mr={};function Nr(e,t){let n=Fe(e);return()=>Mr[t]??n()}var Pr=Nr(()=>window.ScrollTimeline!==void 0,`scrollTimeline`),Fr=Nr(()=>{try{document.createElement(`div`).animate({opacity:0},{easing:`linear(0, 1)`})}catch{return!1}return!0},`linearEasing`),Ir=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Lr={linear:`linear`,ease:`ease`,easeIn:`ease-in`,easeOut:`ease-out`,easeInOut:`ease-in-out`,circIn:Ir([0,.65,.55,1]),circOut:Ir([.55,0,1,.45]),backIn:Ir([.31,.01,.66,-.59]),backOut:Ir([.33,1.53,.69,.99])};function Rr(e,t){if(e)return typeof e==`function`?Fr()?Tn(e,t):`ease-out`:ct(e)?Ir(e):Array.isArray(e)?e.map(e=>Rr(e,t)||Lr.easeOut):Lr[e]}function zr(e,t,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:o=`loop`,ease:s=`easeOut`,times:c}={},l=void 0){let u={[t]:n};c&&(u.offset=c);let d=Rr(s,i);Array.isArray(d)&&(u.easing=d);let f={delay:r,duration:i,easing:Array.isArray(d)?`linear`:d,fill:`both`,iterations:a+1,direction:o===`reverse`?`alternate`:`normal`};return l&&(f.pseudoElement=l),e.animate(u,f)}function Br(e){return typeof e==`function`&&`applyToOptions`in e}function Vr({type:e,...t}){return Br(e)&&Fr()?e.applyToOptions(t):(t.duration??=300,t.ease??=`easeOut`,t)}var Hr=class extends $n{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;let{element:t,name:n,keyframes:r,pseudoElement:i,allowFlatten:a=!1,finalKeyframe:o,onComplete:s}=e;this.isPseudoElement=!!i,this.allowFlatten=a,this.options=e,M(typeof e.type!=`string`,`Mini animate() doesn't support "type" as a string.`,`mini-spring`);let c=Vr(e);this.animation=zr(t,n,r,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){let e=Xn(r,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(e),jr(t,n,e),this.animation.cancel()}s?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state===`finished`&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;let{state:e}=this;e===`idle`||e===`finished`||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){let e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){let e=this.animation.effect?.getComputedTiming?.().duration||0;return F(Number(e))}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+F(e)}get time(){return F(Number(this.animation.currentTime)||0)}set time(e){let t=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=P(e),t&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime===null?this.animation.playState:`finished`}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:t,rangeEnd:n,observe:r}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:`linear`}),this.animation.onfinish=null,e&&Pr()?(this.animation.timeline=e,t&&(this.animation.rangeStart=t),n&&(this.animation.rangeEnd=n),N):r(this)}},Ur={anticipate:$e,backInOut:Qe,circInOut:nt};function Wr(e){return e in Ur}function Gr(e){typeof e.ease==`string`&&Wr(e.ease)&&(e.ease=Ur[e.ease])}var Kr=10,qr=class extends Hr{constructor(e){Gr(e),Qn(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){let{motionValue:t,onUpdate:n,onComplete:r,element:i,...a}=this.options;if(!t)return;if(e!==void 0){t.set(e);return}let o=new tr({...a,autoplay:!1}),s=Math.max(Kr,R.now()-this.startTime),c=j(0,Kr,s-Kr),l=o.sample(s).value,{name:u}=this.options;i&&u&&jr(i,u,l),t.setWithVelocity(o.sample(Math.max(0,s-c)).value,l,c),o.stop()}},Jr=(e,t)=>t!==`zIndex`&&!!(typeof e==`number`||Array.isArray(e)||typeof e==`string`&&(U.test(e)||e===`0`)&&!e.startsWith(`url(`));function Yr(e){let t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function Xr(e,t,n,r){let i=e[0];if(i===null)return!1;if(t===`display`||t===`visibility`)return!0;let a=e[e.length-1],o=Jr(i,t),s=Jr(a,t);return Ae(o===s,`You are trying to animate ${t} from "${i}" to "${a}". "${o?a:i}" is not an animatable value.`,`value-not-animatable`),!o||!s?!1:Yr(e)||(n===`spring`||Br(n))&&r}function Zr(e){e.duration=0,e.type=`keyframes`}var Qr=new Set([`opacity`,`clipPath`,`filter`,`transform`]),$r=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function ei(e){for(let t=0;t<e.length;t++)if(typeof e[t]==`string`&&$r.test(e[t]))return!0;return!1}var ti=new Set([`color`,`backgroundColor`,`outlineColor`,`fill`,`stroke`,`borderColor`,`borderTopColor`,`borderRightColor`,`borderBottomColor`,`borderLeftColor`]),ni=Fe(()=>Object.hasOwnProperty.call(Element.prototype,`animate`));function ri(e){let{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o,keyframes:s}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;let{onUpdate:c,transformTemplate:l}=t.owner.getProps();return ni()&&n&&(Qr.has(n)||ti.has(n)&&ei(s))&&(n!==`transform`||!l)&&!c&&!r&&i!==`mirror`&&a!==0&&o!==`inertia`}var ii=40,ai=class extends $n{constructor({autoplay:e=!0,delay:t=0,type:n=`keyframes`,repeat:r=0,repeatDelay:i=0,repeatType:a=`loop`,keyframes:o,name:s,motionValue:c,element:l,...u}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=R.now();let d={autoplay:e,delay:t,type:n,repeat:r,repeatDelay:i,repeatType:a,name:s,motionValue:c,element:l,...u},f=l?.KeyframeResolver||kr;this.keyframeResolver=new f(o,(e,t,n)=>this.onKeyframesResolved(e,t,d,!n),s,c,l),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,n,r){this.keyframeResolver=void 0;let{name:i,type:a,velocity:o,delay:s,isHandoff:c,onUpdate:l}=n;this.resolvedAt=R.now();let u=!0;Xr(e,i,a,o)||(u=!1,(je.instantAnimations||!s)&&l?.(Xn(e,n,t)),e[0]=e[e.length-1],Zr(n),n.repeat=0);let d={startTime:r?this.resolvedAt&&this.resolvedAt-this.createdAt>ii?this.resolvedAt:this.createdAt:void 0,finalKeyframe:t,...n,keyframes:e},f=u&&!c&&ri(d),p=d.motionValue?.owner?.current,m;if(f)try{m=new qr({...d,element:p})}catch{m=new tr(d)}else m=new tr(d);m.finished.then(()=>{this.notifyFinished()}).catch(N),this.pendingTimeline&&=(this.stopTimeline=m.attachTimeline(this.pendingTimeline),void 0),this._animation=m}get finished(){return this._animation?this.animation.finished:this._finished}then(e,t){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),Or()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}},oi=class{constructor(e){this.stop=()=>this.runAll(`stop`),this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map(e=>e.finished))}getAll(e){return this.animations[0][e]}setAll(e,t){for(let n=0;n<this.animations.length;n++)this.animations[n][e]=t}attachTimeline(e){let t=this.animations.map(t=>t.attachTimeline(e));return()=>{t.forEach((e,t)=>{e&&e(),this.animations[t].stop()})}}get time(){return this.getAll(`time`)}set time(e){this.setAll(`time`,e)}get speed(){return this.getAll(`speed`)}set speed(e){this.setAll(`speed`,e)}get state(){return this.getAll(`state`)}get startTime(){return this.getAll(`startTime`)}get duration(){return si(this.animations,`duration`)}get iterationDuration(){return si(this.animations,`iterationDuration`)}runAll(e){this.animations.forEach(t=>t[e]())}play(){this.runAll(`play`)}pause(){this.runAll(`pause`)}cancel(){this.runAll(`cancel`)}complete(){this.runAll(`complete`)}};function si(e,t){let n=0;for(let r=0;r<e.length;r++){let i=e[r][t];i!==null&&i>n&&(n=i)}return n}var ci=class extends oi{then(e,t){return this.finished.finally(e).then(()=>{})}};function li(e,t,n,r=0,i=1){let a=Array.from(e).sort((e,t)=>e.sortNodePosition(t)).indexOf(t),o=e.size,s=(o-1)*r;return typeof n==`function`?n(a,o):i===1?a*r:s-a*r}var ui=30,di=e=>!isNaN(parseFloat(e)),fi={current:void 0},pi=class{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{let t=R.now();if(this.updatedAt!==t&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(let e of this.dependents)e.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=R.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=di(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return process.env.NODE_ENV!==`production`&&Ve(!1,`value.onChange(callback) is deprecated. Switch to value.on("change", callback).`),this.on(`change`,e)}on(e,t){this.events[e]||(this.events[e]=new Re);let n=this.events[e].add(t);return e===`change`?()=>{n(),I.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(let e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||=new Set,this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return fi.current&&fi.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let e=R.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>ui)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,ui);return ze(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),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.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}};function mi(e,t){return new pi(e,t)}function hi(e,t){if(e?.inherit&&t){let{inherit:n,...r}=e;return{...t,...r}}return e}function gi(e,t){let n=e?.[t]??e?.default??e;return n===e?n:hi(n,e)}var _i={type:`spring`,stiffness:500,damping:25,restSpeed:10},vi=e=>({type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),yi={type:`keyframes`,duration:.8},bi={type:`keyframes`,ease:[.25,.1,.35,1],duration:.3},xi=(e,{keyframes:t})=>t.length>2?yi:gr.has(e)?e.startsWith(`scale`)?vi(t[1]):_i:bi,Si=new Set([`when`,`delay`,`delayChildren`,`staggerChildren`,`staggerDirection`,`repeat`,`repeatType`,`repeatDelay`,`from`,`elapsed`]);function Ci(e){for(let t in e)if(!Si.has(t))return!0;return!1}var wi=(e,t,n,r={},i,a)=>o=>{let s=gi(r,e)||{},c=s.delay||r.delay||0,{elapsed:l=0}=r;l-=P(c);let u={keyframes:Array.isArray(n)?n:[null,n],ease:`easeOut`,velocity:t.getVelocity(),...s,delay:-l,onUpdate:e=>{t.set(e),s.onUpdate&&s.onUpdate(e)},onComplete:()=>{o(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:i};Ci(s)||Object.assign(u,xi(e,u)),u.duration&&=P(u.duration),u.repeatDelay&&=P(u.repeatDelay),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(Zr(u),u.delay===0&&(d=!0)),(je.instantAnimations||je.skipAnimations||i?.shouldSkipAnimations||s.skipAnimations)&&(d=!0,Zr(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!a&&t.get()!==void 0){let e=Xn(u.keyframes,s);if(e!==void 0){I.update(()=>{u.onUpdate(e),u.onComplete()});return}}return s.isSync?new tr(u):new ai(u)},Ti=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Ei(e){let t=Ti.exec(e);if(!t)return[,];let[,n,r,i]=t;return[`--${n??r}`,i]}var Di=4;function Oi(e,t,n=1){M(n<=Di,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,`max-css-var-depth`);let[r,i]=Ei(e);if(!r)return;let a=window.getComputedStyle(t).getPropertyValue(r);if(a){let e=a.trim();return Me(e)?parseFloat(e):e}return Ct(i)?Oi(i,t,n+1):i}function ki(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function Ai(e,t,n,r){if(typeof t==`function`){let[i,a]=ki(r);t=t(n===void 0?e.custom:n,i,a)}if(typeof t==`string`&&(t=e.variants&&e.variants[t]),typeof t==`function`){let[i,a]=ki(r);t=t(n===void 0?e.custom:n,i,a)}return t}function ji(e,t,n){let r=e.getProps();return Ai(r,t,n===void 0?r.custom:n,e)}var Mi=new Set([`width`,`height`,`top`,`left`,`right`,`bottom`,...hr]),Ni=e=>Array.isArray(e);function Pi(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,mi(n))}function Fi(e){return Ni(e)?e[e.length-1]||0:e}function Ii(e,t){let{transitionEnd:n={},transition:r={},...i}=ji(e,t)||{};i={...i,...n};for(let t in i)Pi(e,t,Fi(i[t]))}var K=e=>!!(e&&e.getVelocity);function Li(e){return!!(K(e)&&e.add)}function Ri(e,t){let n=e.getValue(`willChange`);if(Li(n))return n.add(t);if(!n&&je.WillChange){let n=new je.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}function zi(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}var Bi=`data-`+zi(`framerAppearId`);function Vi(e){return e.props[Bi]}function Hi({protectedKeys:e,needsAnimating:t},n){let r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function Ui(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:o,...s}=t,c=e.getDefaultTransition();a=a?hi(a,c):c;let l=a?.reduceMotion,u=a?.skipAnimations;r&&(a=r);let d=[],f=i&&e.animationState&&e.animationState.getState()[i],p=a?.path;p&&p.animateVisualElement(e,s,a,n,d);for(let t in s){let r=e.getValue(t,e.latestValues[t]??null),i=s[t];if(i===void 0||f&&Hi(f,t))continue;let o={delay:n,...gi(a||{},t)};u&&(o.skipAnimations=!0);let c=r.get();if(c!==void 0&&!r.isAnimating()&&!Array.isArray(i)&&i===c&&!o.velocity){I.update(()=>r.set(i));continue}let p=!1;if(window.MotionHandoffAnimation){let n=Vi(e);if(n){let e=window.MotionHandoffAnimation(n,t,I);e!==null&&(o.startTime=e,p=!0)}}Ri(e,t);let m=l??e.shouldReduceMotion;r.start(wi(t,r,i,m&&Mi.has(t)?{type:!1}:o,e,p));let h=r.animation;h&&d.push(h)}if(o){let t=()=>I.update(()=>{o&&Ii(e,o)});d.length?Promise.all(d).then(t):t()}return d}function Wi(e,t,n={}){let r=ji(e,t,n.type===`exit`?e.presenceContext?.custom:void 0),{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);let a=r?()=>Promise.all(Ui(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(r=0)=>{let{delayChildren:a=0,staggerChildren:o,staggerDirection:s}=i;return Gi(e,t,r,a,o,s,n)}:()=>Promise.resolve(),{when:s}=i;if(s){let[e,t]=s===`beforeChildren`?[a,o]:[o,a];return e().then(()=>t())}else return Promise.all([a(),o(n.delay)])}function Gi(e,t,n=0,r=0,i=0,a=1,o){let s=[];for(let c of e.variantChildren)c.notify(`AnimationStart`,t),s.push(Wi(c,t,{...o,delay:n+(typeof r==`function`?0:r)+li(e.variantChildren,c,r,i,a)}).then(()=>c.notify(`AnimationComplete`,t)));return Promise.all(s)}function Ki(e,t,n={}){e.notify(`AnimationStart`,t);let r;if(Array.isArray(t)){let i=t.map(t=>Wi(e,t,n));r=Promise.all(i)}else if(typeof t==`string`)r=Wi(e,t,n);else{let i=typeof t==`function`?ji(e,t,n.custom):t;r=Promise.all(Ui(e,i,n))}return r.then(()=>{e.notify(`AnimationComplete`,t)})}var qi={test:e=>e===`auto`,parse:e=>e},Ji=e=>t=>t.test(e),Yi=[Et,V,B,z,Ht,Vt,qi],Xi=e=>Yi.find(Ji(e));function Zi(e){return typeof e==`number`?e===0:e===null||e===`none`||e===`0`||Pe(e)}var Qi=new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function $i(e){let[t,n]=e.slice(0,-1).split(`(`);if(t===`drop-shadow`)return e;let[r]=n.match(At)||[];if(!r)return e;let i=n.replace(r,``),a=+!!Qi.has(t);return r!==n&&(a*=100),t+`(`+a+i+`)`}var ea=/\b([a-z-]*)\(.*?\)/gu,ta={...U,getAnimatableNone:e=>{let t=e.match(ea);return t?t.map($i).join(` `):e}},na={...U,getAnimatableNone:e=>{let t=U.parse(e);return U.createTransformer(e)(t.map(e=>typeof e==`number`?0:typeof e==`object`?{...e,alpha:1}:e))}},ra={...Et,transform:Math.round},ia={borderWidth:V,borderTopWidth:V,borderRightWidth:V,borderBottomWidth:V,borderLeftWidth:V,borderRadius:V,borderTopLeftRadius:V,borderTopRightRadius:V,borderBottomRightRadius:V,borderBottomLeftRadius:V,width:V,maxWidth:V,height:V,maxHeight:V,top:V,right:V,bottom:V,left:V,inset:V,insetBlock:V,insetBlockStart:V,insetBlockEnd:V,insetInline:V,insetInlineStart:V,insetInlineEnd:V,padding:V,paddingTop:V,paddingRight:V,paddingBottom:V,paddingLeft:V,paddingBlock:V,paddingBlockStart:V,paddingBlockEnd:V,paddingInline:V,paddingInlineStart:V,paddingInlineEnd:V,margin:V,marginTop:V,marginRight:V,marginBottom:V,marginLeft:V,marginBlock:V,marginBlockStart:V,marginBlockEnd:V,marginInline:V,marginInlineStart:V,marginInlineEnd:V,fontSize:V,backgroundPositionX:V,backgroundPositionY:V,rotate:z,pathRotation:z,rotateX:z,rotateY:z,rotateZ:z,scale:Ot,scaleX:Ot,scaleY:Ot,scaleZ:Ot,skew:z,skewX:z,skewY:z,distance:V,translateX:V,translateY:V,translateZ:V,x:V,y:V,z:V,perspective:V,transformPerspective:V,opacity:Dt,originX:Ut,originY:Ut,originZ:V,zIndex:ra,fillOpacity:Dt,strokeOpacity:Dt,numOctaves:ra},aa={...ia,color:H,backgroundColor:H,outlineColor:H,fill:H,stroke:H,borderColor:H,borderTopColor:H,borderRightColor:H,borderBottomColor:H,borderLeftColor:H,filter:ta,WebkitFilter:ta,mask:na,WebkitMask:na},oa=e=>aa[e],sa=new Set([ta,na]);function ca(e,t){let n=oa(e);return sa.has(n)||(n=U),n.getAnimatableNone?n.getAnimatableNone(t):void 0}var la=new Set([`auto`,`none`,`0`]);function ua(e,t,n){let r=0,i;for(;r<e.length&&!i;){let t=e[r];typeof t==`string`&&!la.has(t)&&$t(t).values.length&&(i=e[r]),r++}if(i&&n)for(let r of t)e[r]=ca(n,i)}var da=class extends kr{constructor(e,t,n,r,i){super(e,t,n,r,i,!0)}readKeyframes(){let{unresolvedKeyframes:e,element:t,name:n}=this;if(!t||!t.current)return;super.readKeyframes();for(let n=0;n<e.length;n++){let r=e[n];if(typeof r==`string`&&(r=r.trim(),Ct(r))){let i=Oi(r,t.current);i!==void 0&&(e[n]=i),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!Mi.has(n)||e.length!==2)return;let[r,i]=e,a=Xi(r),o=Xi(i);if(Tt(r)!==Tt(i)&&xr[n]){this.needsMeasurement=!0;return}if(a!==o)if(_r(a)&&_r(o))for(let t=0;t<e.length;t++){let n=e[t];typeof n==`string`&&(e[t]=parseFloat(n))}else xr[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)(e[t]===null||Zi(e[t]))&&n.push(t);n.length&&ua(e,n,t)}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:n}=this;if(!e||!e.current)return;n===`height`&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=xr[n](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;let r=t[t.length-1];r!==void 0&&e.getValue(n,r).jump(r,!1)}measureEndState(){let{element:e,name:t,unresolvedKeyframes:n}=this;if(!e||!e.current)return;let r=e.getValue(t);r&&r.jump(this.measuredOrigin,!1);let i=n.length-1,a=n[i];n[i]=xr[t](e.measureViewportBox(),window.getComputedStyle(e.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),this.removedTransforms?.length&&this.removedTransforms.forEach(([t,n])=>{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}},fa=[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomRightRadius`,`borderBottomLeftRadius`];function pa(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e==`string`){let r=document;t&&(r=t.current);let i=n?.[e]??r.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(e=>e!=null)}var ma=(e,t)=>t&&typeof e==`number`?t.transform(e):e;function ha(e){return Ne(e)&&`offsetHeight`in e&&!(`ownerSVGElement`in e)}var{schedule:ga,cancel:_a}=ht(queueMicrotask,!1),q={x:!1,y:!1};function va(){return q.x||q.y}function ya(e){return e===`x`||e===`y`?q[e]?null:(q[e]=!0,()=>{q[e]=!1}):q.x||q.y?null:(q.x=q.y=!0,()=>{q.x=q.y=!1})}function ba(e,t){let n=pa(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},()=>r.abort()]}function xa(e){return!(e.pointerType===`touch`||va())}function Sa(e,t,n={}){let[r,i,a]=ba(e,n);return r.forEach(e=>{let n=!1,r=!1,a,o=()=>{e.removeEventListener(`pointerleave`,u)},s=e=>{a&&=(a(e),void 0),o()},c=e=>{n=!1,window.removeEventListener(`pointerup`,c),window.removeEventListener(`pointercancel`,c),r&&(r=!1,s(e))},l=()=>{n=!0,window.addEventListener(`pointerup`,c,i),window.addEventListener(`pointercancel`,c,i)},u=e=>{if(e.pointerType!==`touch`){if(n){r=!0;return}s(e)}};e.addEventListener(`pointerenter`,n=>{if(!xa(n))return;r=!1;let o=t(e,n);typeof o==`function`&&(a=o,e.addEventListener(`pointerleave`,u,i))},i),e.addEventListener(`pointerdown`,l,i)}),a}var Ca=(e,t)=>t?e===t||Ca(e,t.parentElement):!1,wa=e=>e.pointerType===`mouse`?typeof e.button!=`number`||e.button<=0:e.isPrimary!==!1,Ta=new Set([`BUTTON`,`INPUT`,`SELECT`,`TEXTAREA`,`A`]);function Ea(e){return Ta.has(e.tagName)||e.isContentEditable===!0}var Da=new Set([`INPUT`,`SELECT`,`TEXTAREA`]);function Oa(e){return Da.has(e.tagName)||e.isContentEditable===!0}var ka=new WeakSet;function Aa(e){return t=>{t.key===`Enter`&&e(t)}}function ja(e,t){e.dispatchEvent(new PointerEvent(`pointer`+t,{isPrimary:!0,bubbles:!0}))}var Ma=(e,t)=>{let n=e.currentTarget;if(!n)return;let r=Aa(()=>{if(ka.has(n))return;ja(n,`down`);let e=Aa(()=>{ja(n,`up`)});n.addEventListener(`keyup`,e,t),n.addEventListener(`blur`,()=>ja(n,`cancel`),t)});n.addEventListener(`keydown`,r,t),n.addEventListener(`blur`,()=>n.removeEventListener(`keydown`,r),t)};function Na(e){return wa(e)&&!va()}var Pa=new WeakSet;function Fa(e,t,n={}){let[r,i,a]=ba(e,n),o=e=>{let r=e.currentTarget;if(!Na(e)||Pa.has(e))return;ka.add(r),n.stopPropagation&&Pa.add(e);let a=t(r,e),o={...i,capture:!0},s=(e,t)=>{window.removeEventListener(`pointerup`,c,o),window.removeEventListener(`pointercancel`,l,o),ka.has(r)&&ka.delete(r),Na(e)&&typeof a==`function`&&a(e,{success:t})},c=e=>{s(e,r===window||r===document||n.useGlobalTarget||Ca(r,e.target))},l=e=>{s(e,!1)};window.addEventListener(`pointerup`,c,o),window.addEventListener(`pointercancel`,l,o)};return r.forEach(e=>{(n.useGlobalTarget?window:e).addEventListener(`pointerdown`,o,i),ha(e)&&(e.addEventListener(`focus`,e=>Ma(e,i)),!Ea(e)&&!e.hasAttribute(`tabindex`)&&(e.tabIndex=0))}),a}function Ia(e){return Ne(e)&&`ownerSVGElement`in e}var La=new WeakMap,Ra,za=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+`Size`]:Ia(r)&&`getBBox`in r?r.getBBox()[t]:r[n],Ba=za(`inline`,`width`,`offsetWidth`),Va=za(`block`,`height`,`offsetHeight`);function Ha({target:e,borderBoxSize:t}){La.get(e)?.forEach(n=>{n(e,{get width(){return Ba(e,t)},get height(){return Va(e,t)}})})}function Ua(e){e.forEach(Ha)}function Wa(){typeof ResizeObserver>`u`||(Ra=new ResizeObserver(Ua))}function Ga(e,t){Ra||Wa();let n=pa(e);return n.forEach(e=>{let n=La.get(e);n||(n=new Set,La.set(e,n)),n.add(t),Ra?.observe(e)}),()=>{n.forEach(e=>{let n=La.get(e);n?.delete(t),n?.size||Ra?.unobserve(e)})}}var Ka=new Set,qa;function Ja(){qa=()=>{let e={get width(){return window.innerWidth},get height(){return window.innerHeight}};Ka.forEach(t=>t(e))},window.addEventListener(`resize`,qa)}function Ya(e){return Ka.add(e),qa||Ja(),()=>{Ka.delete(e),!Ka.size&&typeof qa==`function`&&(window.removeEventListener(`resize`,qa),qa=void 0)}}function Xa(e,t){return typeof e==`function`?Ya(e):Ga(e,t)}var Za={value:null,addProjectionMetrics:null};function Qa(e){return Ia(e)&&e.tagName===`svg`}var $a=[...Yi,H,U],eo=e=>$a.find(Ji(e)),to=()=>({translate:0,scale:1,origin:0,originPoint:0}),no=()=>({x:to(),y:to()}),ro=()=>({min:0,max:0}),J=()=>({x:ro(),y:ro()}),io=new WeakMap;function ao(e){return typeof e==`object`&&!!e&&typeof e.start==`function`}function oo(e){return typeof e==`string`||Array.isArray(e)}var so=[`animate`,`whileInView`,`whileFocus`,`whileHover`,`whileTap`,`whileDrag`,`exit`],co=[`initial`,...so];function lo(e){return ao(e.animate)||co.some(t=>oo(e[t]))}function uo(e){return!!(lo(e)||e.variants)}function fo(e,t,n){for(let r in t){let i=t[r],a=n[r];if(K(i))e.addValue(r,i);else if(K(a))e.addValue(r,mi(i,{owner:e}));else if(a!==i)if(e.hasValue(r)){let t=e.getValue(r);t.liveStyle===!0?t.jump(i):t.hasAnimated||t.set(i)}else{let t=e.getStaticValue(r);e.addValue(r,mi(t===void 0?i:t,{owner:e}))}}for(let r in n)t[r]===void 0&&e.removeValue(r);return t}var po={current:null},mo={current:!1},ho=typeof window<`u`;function go(){if(mo.current=!0,ho)if(window.matchMedia){let e=window.matchMedia(`(prefers-reduced-motion)`),t=()=>po.current=e.matches;e.addEventListener(`change`,t),t()}else po.current=!1}var _o=[`AnimationStart`,`AnimationComplete`,`Update`,`BeforeLayoutMeasure`,`LayoutMeasure`,`LayoutAnimationStart`,`LayoutAnimationComplete`],vo={};function yo(e){vo=e}function bo(){return vo}var xo=class{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,skipAnimations:i,blockInitialAnimation:a,visualState:o},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=kr,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,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=()=>{let e=R.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,I.render(this.render,!1,!0))};let{latestValues:c,renderState:l}=o;this.latestValues=c,this.baseTarget={...c},this.initialValues=t.initial?{...c}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.skipAnimationsConfig=i,this.options=s,this.blockInitialAnimation=!!a,this.isControllingVariants=lo(t),this.isVariantNode=uo(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);let{willChange:u,...d}=this.scrapeMotionValuesFromProps(t,{},this);for(let e in d){let t=d[e];c[e]!==void 0&&K(t)&&t.set(c[e])}}mount(e){if(this.hasBeenMounted)for(let e in this.initialValues)this.values.get(e)?.jump(this.initialValues[e]),this.latestValues[e]=this.initialValues[e];this.current=e,io.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),this.reducedMotionConfig===`never`?this.shouldReduceMotion=!1:this.reducedMotionConfig===`always`?this.shouldReduceMotion=!0:(mo.current||go(),this.shouldReduceMotion=po.current),process.env.NODE_ENV!==`production`&&Ve(this.shouldReduceMotion!==!0,`You have Reduced Motion enabled on your device. Animations may not appear as expected.`,`reduced-motion-disabled`),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),gt(this.notifyUpdate),gt(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(let e in this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??=new Set,this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,t){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),t.accelerate&&Qr.has(e)&&this.current instanceof HTMLElement){let{factory:n,keyframes:r,times:i,ease:a,duration:o}=t.accelerate,s=new Hr({element:this.current,name:e,keyframes:r,times:i,ease:a,duration:P(o)}),c=n(s);this.valueSubscriptions.set(e,()=>{c(),s.cancel()});return}let n=gr.has(e);n&&this.onBindTransform&&this.onBindTransform();let r=t.on(`change`,t=>{this.latestValues[e]=t,this.props.onUpdate&&I.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()}),i;typeof window<`u`&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),i&&i()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e=`animation`;for(e in vo){let t=vo[e];if(!t)continue;let{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){let t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):J()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t<_o.length;t++){let n=_o[t];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);let r=e[`on`+n];r&&(this.propEventSubscriptions[n]=this.on(n,r))}this.prevMotionValues=fo(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]: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(e){let t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){let n=this.values.get(e);t!==n&&(n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);let t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return n===void 0&&t!==void 0&&(n=mi(t===null?void 0:t,{owner:this}),this.addValue(e,n)),n}readValue(e,t){let n=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return n!=null&&(typeof n==`string`&&(Me(n)||Pe(n))?n=parseFloat(n):!eo(n)&&U.test(t)&&(n=ca(e,t)),this.setBaseTarget(e,K(n)?n.get():n)),K(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){let{initial:t}=this.props,n;if(typeof t==`string`||typeof t==`object`){let r=Ai(this.props,t,this.presenceContext?.custom);r&&(n=r[e])}if(t&&n!==void 0)return n;let r=this.getBaseTargetFromProps(this.props,e);return r!==void 0&&!K(r)?r:this.initialValues[e]!==void 0&&n===void 0?void 0:this.baseTarget[e]}on(e,t){return this.events[e]||(this.events[e]=new Re),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){ga.render(this.render)}},So=class extends xo{constructor(){super(...arguments),this.KeyframeResolver=da}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){let n=e.style;return n?n[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;K(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}},Co=class{constructor(e){this.isMounted=!1,this.node=e}update(){}};function wo({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function To({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Eo(e,t){if(!t)return e;let n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Do(e){return e===void 0||e===1}function Oo({scale:e,scaleX:t,scaleY:n}){return!Do(e)||!Do(t)||!Do(n)}function ko(e){return Oo(e)||Ao(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Ao(e){return jo(e.x)||jo(e.y)}function jo(e){return e&&e!==`0%`}function Mo(e,t,n){return n+t*(e-n)}function No(e,t,n,r,i){return i!==void 0&&(e=Mo(e,i,r)),Mo(e,n,r)+t}function Po(e,t=0,n=1,r,i){e.min=No(e.min,t,n,r,i),e.max=No(e.max,t,n,r,i)}function Fo(e,{x:t,y:n}){Po(e.x,t.translate,t.scale,t.originPoint),Po(e.y,n.translate,n.scale,n.originPoint)}var Io=.999999999999,Lo=1.0000000000001;function Ro(e,t,n,r=!1){let i=n.length;if(!i)return;t.x=t.y=1;let a,o;for(let s=0;s<i;s++){a=n[s],o=a.projectionDelta;let{visualElement:i}=a.options;i&&i.props.style&&i.props.style.display===`contents`||(r&&a.options.layoutScroll&&a.scroll&&a!==a.root&&(Y(e.x,-a.scroll.offset.x),Y(e.y,-a.scroll.offset.y)),o&&(t.x*=o.x.scale,t.y*=o.y.scale,Fo(e,o)),r&&ko(a.latestValues)&&Vo(e,a.latestValues,a.layout?.layoutBox))}t.x<Lo&&t.x>Io&&(t.x=1),t.y<Lo&&t.y>Io&&(t.y=1)}function Y(e,t){e.min+=t,e.max+=t}function zo(e,t,n,r,i=.5){Po(e,t,n,W(e.min,e.max,i),r)}function Bo(e,t){return typeof e==`string`?parseFloat(e)/100*(t.max-t.min):e}function Vo(e,t,n){let r=n??e;zo(e.x,Bo(t.x,r.x),t.scaleX,t.scale,t.originX),zo(e.y,Bo(t.y,r.y),t.scaleY,t.scale,t.originY)}function Ho(e,t){return wo(Eo(e.getBoundingClientRect(),t))}function Uo(e,t,n){let r=Ho(e,n),{scroll:i}=t;return i&&(Y(r.x,i.offset.x),Y(r.y,i.offset.y)),r}var Wo={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},Go=hr.length;function Ko(e,t,n){let r=``,i=!0;for(let a=0;a<Go;a++){let o=hr[a],s=e[o];if(s===void 0)continue;let c=!0;if(typeof s==`number`)c=s===+!!o.startsWith(`scale`);else{let e=parseFloat(s);c=o.startsWith(`scale`)?e===1:e===0}if(!c||n){let e=ma(s,ia[o]);if(!c){i=!1;let t=Wo[o]||o;r+=`${t}(${e}) `}n&&(t[o]=e)}}let a=e.pathRotation;return a&&(i=!1,r+=`rotate(${ma(a,ia.pathRotation)}) `),r=r.trim(),n?r=n(t,i?``:r):i&&(r=`none`),r}function qo(e,t,n){let{style:r,vars:i,transformOrigin:a}=e,o=!1,s=!1;for(let e in t){let n=t[e];if(gr.has(e)){o=!0;continue}else if(xt(e)){i[e]=n;continue}else{let t=ma(n,ia[e]);e.startsWith(`origin`)?(s=!0,a[e]=t):r[e]=t}}if(t.transform||(o||n?r.transform=Ko(t,e.transform,n):r.transform&&=`none`),s){let{originX:e=`50%`,originY:t=`50%`,originZ:n=0}=a;r.transformOrigin=`${e} ${t} ${n}`}}function Jo(e,{style:t,vars:n},r,i){let a=e.style,o;for(o in t)a[o]=t[o];for(o in i?.applyProjectionStyles(a,r),n)a.setProperty(o,n[o])}function Yo(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var Xo={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`)if(V.test(e))e=parseFloat(e);else return e;return`${Yo(e,t.target.x)}% ${Yo(e,t.target.y)}%`}},Zo={correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=U.parse(e);if(i.length>5)return r;let a=U.createTransformer(e),o=typeof i[0]==`number`?0:1,s=n.x.scale*t.x,c=n.y.scale*t.y;i[0+o]/=s,i[1+o]/=c;let l=W(s,c,.5);return typeof i[2+o]==`number`&&(i[2+o]/=l),typeof i[3+o]==`number`&&(i[3+o]/=l),a(i)}},Qo={borderRadius:{...Xo,applyTo:[...fa]},borderTopLeftRadius:Xo,borderTopRightRadius:Xo,borderBottomLeftRadius:Xo,borderBottomRightRadius:Xo,boxShadow:Zo};function $o(e,{layout:t,layoutId:n}){return gr.has(e)||e.startsWith(`origin`)||(t||n!==void 0)&&(!!Qo[e]||e===`opacity`)}function es(e,t,n){let r=e.style,i=t?.style,a={};if(!r)return a;for(let t in r)(K(r[t])||i&&K(i[t])||$o(t,e)||n?.getValue(t)?.liveStyle!==void 0)&&(a[t]=r[t]);return a}function ts(e){return window.getComputedStyle(e)}var ns=class extends So{constructor(){super(...arguments),this.type=`html`,this.renderInstance=Jo}readValueFromInstance(e,t){if(gr.has(t))return this.projection?.isProjecting?dr(t):pr(e,t);{let n=ts(e),r=(xt(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return Ho(e,t)}build(e,t,n){qo(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return es(e,t,n)}};function rs(e,t){return e in t}var is=class extends xo{constructor(){super(...arguments),this.type=`object`}readValueFromInstance(e,t){if(rs(t,e)){let n=e[t];if(typeof n==`string`||typeof n==`number`)return n}}getBaseTargetFromProps(){}removeValueFromRenderState(e,t){delete t.output[e]}measureInstanceViewportBox(){return J()}build(e,t){Object.assign(e.output,t)}renderInstance(e,{output:t}){Object.assign(e,t)}sortInstanceNodePosition(){return 0}},as={offset:`stroke-dashoffset`,array:`stroke-dasharray`},os={offset:`strokeDashoffset`,array:`strokeDasharray`};function ss(e,t,n=1,r=0,i=!0){e.pathLength=1;let a=i?as:os;e[a.offset]=`${-r}`,e[a.array]=`${t} ${n}`}var cs=[`offsetDistance`,`offsetPath`,`offsetRotate`,`offsetAnchor`];function ls(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},c,l,u){if(qo(e,s,l),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:d,style:f}=e;d.transform&&(f.transform=d.transform,delete d.transform),(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??`50% 50%`,delete d.transformOrigin),f.transform&&(f.transformBox=u?.transformBox??`fill-box`,delete d.transformBox);for(let e of cs)d[e]!==void 0&&(f[e]=d[e],delete d[e]);t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),i!==void 0&&ss(d,i,a,o,!1)}var us=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`]),ds=e=>typeof e==`string`&&e.toLowerCase()===`svg`;function fs(e,t,n,r){Jo(e,t,void 0,r);for(let n in t.attrs)e.setAttribute(us.has(n)?n:zi(n),t.attrs[n])}function ps(e,t,n){let r=es(e,t,n);for(let n in e)if(K(e[n])||K(t[n])){let t=hr.indexOf(n)===-1?n:`attr`+n.charAt(0).toUpperCase()+n.substring(1);r[t]=e[n]}return r}var ms=class extends So{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=J}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(gr.has(t)){let e=oa(t);return e&&e.default||0}return t=us.has(t)?t:zi(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return ps(e,t,n)}build(e,t,n){ls(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){fs(e,t,n,r)}mount(e){this.isSVGTag=ds(e.tagName),super.mount(e)}},hs=co.length;function gs(e){if(!e)return;if(!e.isControllingVariants){let t=e.parent&&gs(e.parent)||{};return e.props.initial!==void 0&&(t.initial=e.props.initial),t}let t={};for(let n=0;n<hs;n++){let r=co[n],i=e.props[r];(oo(i)||i===!1)&&(t[r]=i)}return t}function _s(e,t){if(!Array.isArray(t))return!1;let n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}var vs=[...so].reverse(),ys=so.length;function bs(e){return t=>Promise.all(t.map(({animation:t,options:n})=>Ki(e,t,n)))}function xs(e){let t=bs(e),n=ws(),r=!0,i=!1,a=t=>(n,r)=>{let i=ji(e,r,t===`exit`?e.presenceContext?.custom:void 0);if(i){let{transition:e,transitionEnd:t,...r}=i;n={...n,...r,...t}}return n};function o(n){t=n(e)}function s(o){let{props:s}=e,c=gs(e.parent)||{},l=[],u=new Set,d={},f=1/0;for(let t=0;t<ys;t++){let p=vs[t],m=n[p],h=s[p]===void 0?c[p]:s[p],g=oo(h),_=p===o?m.isActive:null;_===!1&&(f=t);let v=h===c[p]&&h!==s[p]&&g;if(v&&(r||i)&&e.manuallyAnimateOnMount&&(v=!1),m.protectedKeys={...d},!m.isActive&&_===null||!h&&!m.prevProp||ao(h)||typeof h==`boolean`)continue;if(p===`exit`&&m.isActive&&_!==!0){m.prevResolvedValues&&(d={...d,...m.prevResolvedValues});continue}let y=Ss(m.prevProp,h),b=y||p===o&&m.isActive&&!v&&g||t>f&&g,x=!1,S=Array.isArray(h)?h:[h],C=S.reduce(a(p),{});_===!1&&(C={});let{prevResolvedValues:w={}}=m,T={...w,...C},E=t=>{b=!0,u.has(t)&&(x=!0,u.delete(t)),m.needsAnimating[t]=!0;let n=e.getValue(t);n&&(n.liveStyle=!1)};for(let e in T){let t=C[e],n=w[e];if(d.hasOwnProperty(e))continue;let r=!1;r=Ni(t)&&Ni(n)?!_s(t,n)||y:t!==n,r?t==null?u.add(e):E(e):t!==void 0&&u.has(e)?E(e):m.protectedKeys[e]=!0}m.prevProp=h,m.prevResolvedValues=C,m.isActive&&(d={...d,...C}),(r||i)&&e.blockInitialAnimation&&(b=!1);let D=v&&y;b&&(!D||x)&&l.push(...S.map(t=>{let n={type:p};if(typeof t==`string`&&(r||i)&&!D&&e.manuallyAnimateOnMount&&e.parent){let{parent:r}=e,i=ji(r,t);if(r.enteringChildren&&i){let{delayChildren:t}=i.transition||{};n.delay=li(r.enteringChildren,e,t)}}return{animation:t,options:n}}))}if(u.size){let t={};if(typeof s.initial!=`boolean`){let n=ji(e,Array.isArray(s.initial)?s.initial[0]:s.initial);n&&n.transition&&(t.transition=n.transition)}u.forEach(n=>{let r=e.getBaseTarget(n),i=e.getValue(n);i&&(i.liveStyle=!0),t[n]=r??null}),l.push({animation:t})}let p=!!l.length;return r&&(s.initial===!1||s.initial===s.animate)&&!e.manuallyAnimateOnMount&&(p=!1),r=!1,i=!1,p?t(l):Promise.resolve()}function c(t,r){if(n[t].isActive===r)return Promise.resolve();e.variantChildren?.forEach(e=>e.animationState?.setActive(t,r)),n[t].isActive=r;let i=s(t);for(let e in n)n[e].protectedKeys={};return i}return{animateChanges:s,setActive:c,setAnimateFunction:o,getState:()=>n,reset:()=>{n=ws(),i=!0}}}function Ss(e,t){return typeof t==`string`?t!==e:Array.isArray(t)?!_s(t,e):!1}function Cs(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function ws(){return{animate:Cs(!0),whileInView:Cs(),whileHover:Cs(),whileTap:Cs(),whileDrag:Cs(),whileFocus:Cs(),exit:Cs()}}function Ts(e,t){e.min=t.min,e.max=t.max}function X(e,t){Ts(e.x,t.x),Ts(e.y,t.y)}function Es(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}var Ds=.9999,Os=1.0001,ks=-.01,As=.01;function Z(e){return e.max-e.min}function js(e,t,n){return Math.abs(e-t)<=n}function Ms(e,t,n,r=.5){e.origin=r,e.originPoint=W(t.min,t.max,e.origin),e.scale=Z(n)/Z(t),e.translate=W(n.min,n.max,e.origin)-e.originPoint,(e.scale>=Ds&&e.scale<=Os||isNaN(e.scale))&&(e.scale=1),(e.translate>=ks&&e.translate<=As||isNaN(e.translate))&&(e.translate=0)}function Ns(e,t,n,r){Ms(e.x,t.x,n.x,r?r.originX:void 0),Ms(e.y,t.y,n.y,r?r.originY:void 0)}function Ps(e,t,n,r=0){e.min=(r?W(n.min,n.max,r):n.min)+t.min,e.max=e.min+Z(t)}function Fs(e,t,n,r){Ps(e.x,t.x,n.x,r?.x),Ps(e.y,t.y,n.y,r?.y)}function Is(e,t,n,r=0){let i=r?W(n.min,n.max,r):n.min;e.min=t.min-i,e.max=e.min+Z(t)}function Ls(e,t,n,r){Is(e.x,t.x,n.x,r?.x),Is(e.y,t.y,n.y,r?.y)}function Rs(e,t,n,r,i){return e-=t,e=Mo(e,1/n,r),i!==void 0&&(e=Mo(e,1/i,r)),e}function zs(e,t=0,n=1,r=.5,i,a=e,o=e){if(B.test(t)&&(t=parseFloat(t),t=W(o.min,o.max,t/100)-o.min),typeof t!=`number`)return;let s=W(a.min,a.max,r);e===a&&(s-=t),e.min=Rs(e.min,t,n,s,i),e.max=Rs(e.max,t,n,s,i)}function Bs(e,t,[n,r,i],a,o){zs(e,t[n],t[r],t[i],t.scale,a,o)}var Vs=[`x`,`scaleX`,`originX`],Hs=[`y`,`scaleY`,`originY`];function Us(e,t,n,r){Bs(e.x,t,Vs,n?n.x:void 0,r?r.x:void 0),Bs(e.y,t,Hs,n?n.y:void 0,r?r.y:void 0)}function Ws(e){return e.translate===0&&e.scale===1}function Gs(e){return Ws(e.x)&&Ws(e.y)}function Ks(e,t){return e.min===t.min&&e.max===t.max}function qs(e,t){return Ks(e.x,t.x)&&Ks(e.y,t.y)}function Js(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Ys(e,t){return Js(e.x,t.x)&&Js(e.y,t.y)}function Xs(e){return Z(e.x)/Z(e.y)}function Zs(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function Q(e){return[e(`x`),e(`y`)]}function Qs(e,t,n){let r=``,i=e.x.translate/t.x,a=e.y.translate/t.y,o=n?.z||0;if((i||a||o)&&(r=`translate3d(${i}px, ${a}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){let{transformPerspective:e,rotate:t,pathRotation:i,rotateX:a,rotateY:o,skewX:s,skewY:c}=n;e&&(r=`perspective(${e}px) ${r}`),t&&(r+=`rotate(${t}deg) `),i&&(r+=`rotate(${i}deg) `),a&&(r+=`rotateX(${a}deg) `),o&&(r+=`rotateY(${o}deg) `),s&&(r+=`skewX(${s}deg) `),c&&(r+=`skewY(${c}deg) `)}let s=e.x.scale*t.x,c=e.y.scale*t.y;return(s!==1||c!==1)&&(r+=`scale(${s}, ${c})`),r||`none`}var $s=fa.length,ec=e=>typeof e==`string`?parseFloat(e):e,tc=e=>typeof e==`number`||V.test(e);function nc(e,t,n,r,i,a){i?(e.opacity=W(0,n.opacity??1,ic(r)),e.opacityExit=W(t.opacity??1,0,ac(r))):a&&(e.opacity=W(t.opacity??1,n.opacity??1,r));for(let i=0;i<$s;i++){let a=fa[i],o=rc(t,a),s=rc(n,a);o===void 0&&s===void 0||(o||=0,s||=0,o===0||s===0||tc(o)===tc(s)?(e[a]=Math.max(W(ec(o),ec(s),r),0),(B.test(s)||B.test(o))&&(e[a]+=`%`)):e[a]=s)}(t.rotate||n.rotate)&&(e.rotate=W(t.rotate||0,n.rotate||0,r))}function rc(e,t){return e[t]===void 0?e.borderRadius:e[t]}var ic=oc(0,.5,tt),ac=oc(.5,.95,N);function oc(e,t,n){return r=>r<e?0:r>t?1:n(Le(e,t,r))}function sc(e,t,n){let r=K(e)?e:mi(e);return r.start(wi(``,r,t,n)),r.animation}function cc(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}var lc=(e,t)=>e.depth-t.depth,uc=class{constructor(){this.children=[],this.isDirty=!1}add(e){De(this.children,e),this.isDirty=!0}remove(e){Oe(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(lc),this.isDirty=!1,this.children.forEach(e)}};function dc(e,t){let n=R.now(),r=({timestamp:i})=>{let a=i-n;a>=t&&(gt(r),e(a-t))};return I.setup(r,!0),()=>gt(r)}function fc(e){return K(e)?e.get():e}var pc=class{constructor(){this.members=[]}add(e){De(this.members,e);for(let t=this.members.length-1;t>=0;t--){let n=this.members[t];if(n===e||n===this.lead||n===this.prevLead)continue;let r=n.instance;(!r||r.isConnected===!1)&&!n.snapshot&&(Oe(this.members,n),n.unmount())}e.scheduleRender()}remove(e){if(Oe(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){for(let t=this.members.indexOf(e)-1;t>=0;t--){let e=this.members[t];if(e.isPresent!==!1&&e.instance?.isConnected!==!1)return this.promote(e),!0}return!1}promote(e,t){let n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.updateSnapshot(),e.scheduleRender();let{layoutDependency:r}=n.options,{layoutDependency:i}=e.options;(r===void 0||r!==i)&&(e.resumeFrom=n,t&&(n.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{e.options.onExitComplete?.(),e.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}},mc={hasAnimatedSinceResize:!0,hasEverUpdated:!1},hc={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},gc=[``,`X`,`Y`,`Z`],_c=1e3,vc=0;function yc(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function bc(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let n=Vi(t);if(window.MotionHasOptimisedAnimation(n,`transform`)){let{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,`transform`,I,!(t||r))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&bc(r)}function xc({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(e={},n=t?.()){this.id=vc++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Za.value&&(hc.nodes=hc.calculatedTargetDeltas=hc.calculatedProjections=0),this.nodes.forEach(wc),this.nodes.forEach(Nc),this.nodes.forEach(Pc),this.nodes.forEach(Tc),Za.addProjectionMetrics&&Za.addProjectionMetrics(hc)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new uc)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new Re),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){let n=this.eventHandlers.get(e);n&&n.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t){if(this.instance)return;this.isSVG=Ia(t)&&!Qa(t),this.instance=t;let{layoutId:n,layout:r,visualElement:i}=this.options;if(i&&!i.current&&i.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(r||n)&&(this.isLayoutDirty=!0),e){let n,r=0,i=()=>this.root.updateBlockedByResize=!1;I.read(()=>{r=window.innerWidth}),e(t,()=>{let e=window.innerWidth;e!==r&&(r=e,this.root.updateBlockedByResize=!0,n&&n(),n=dc(i,250),mc.hasAnimatedSinceResize&&(mc.hasAnimatedSinceResize=!1,this.nodes.forEach(Mc)))})}n&&this.root.registerSharedNode(n,this),this.options.animate!==!1&&i&&(n||r)&&this.addEventListener(`didUpdate`,({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:n,layout:r})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let a=this.options.transition||i.getDefaultTransition()||Vc,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=i.getProps(),c=!this.targetLayout||!Ys(this.targetLayout,r),l=!t&&n;if(this.options.layoutRoot||this.resumeFrom||l||t&&(c||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let t={...gi(a,`layout`),onPlay:o,onComplete:s};(i.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,l,t.path)}else t||Mc(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),gt(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Fc),this.animationId++)}getTransformTemplate(){let{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&bc(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){let t=this.path[e];t.shouldResetTransform=!0,(typeof t.latestValues.x==`string`||typeof t.latestValues.y==`string`)&&(t.isLayoutDirty=!0),t.updateScroll(`snapshot`),t.options.layoutRoot&&t.willUpdate(!1)}let{layoutId:t,layout:n}=this.options;if(t===void 0&&!n)return;let r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,``):void 0,this.updateSnapshot(),e&&this.notifyListeners(`willUpdate`)}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){let e=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),e&&this.nodes.forEach(Oc),this.nodes.forEach(Dc);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(kc);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Ac),this.nodes.forEach(jc),this.nodes.forEach(Sc),this.nodes.forEach(Cc)):this.nodes.forEach(kc),this.clearAllSnapshots();let e=R.now();L.delta=j(0,1e3/60,e-L.timestamp),L.timestamp=e,L.isProcessing=!0,_t.update.process(L),_t.preRender.process(L),_t.render.process(L),L.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,ga.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Ec),this.sharedNodes.forEach(Ic)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,I.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){I.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Z(this.snapshot.measuredBox.x)&&!Z(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e<this.path.length;e++)this.path[e].updateScroll();let e=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||=J(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners(`measure`,this.layout.layoutBox);let{visualElement:t}=this.options;t&&t.notify(`LayoutMeasure`,this.layout.layoutBox,e?e.layoutBox:void 0)}updateScroll(e=`measure`){let t=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t&&this.instance){let t=r(this.instance);this.scroll={animationId:this.root.animationId,phase:e,isRoot:t,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:t}}}resetTransform(){if(!i)return;let e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,t=this.projectionDelta&&!Gs(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,``):void 0,a=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||ko(this.latestValues)||a)&&(i(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){let t=this.measurePageBox(),n=this.removeElementScroll(t);return e&&(n=this.removeTransform(n)),Gc(n),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return J();let t=e.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(qc))){let{scroll:e}=this.root;e&&(Y(t.x,e.offset.x),Y(t.y,e.offset.y))}return t}removeElementScroll(e){let t=J();if(X(t,e),this.scroll?.wasRoot)return t;for(let n=0;n<this.path.length;n++){let r=this.path[n],{scroll:i,options:a}=r;r!==this.root&&i&&a.layoutScroll&&(i.wasRoot&&X(t,e),Y(t.x,i.offset.x),Y(t.y,i.offset.y))}return t}applyTransform(e,t=!1,n){let r=n||J();X(r,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];!t&&n.options.layoutScroll&&n.scroll&&n!==n.root&&(Y(r.x,-n.scroll.offset.x),Y(r.y,-n.scroll.offset.y)),ko(n.latestValues)&&Vo(r,n.latestValues,n.layout?.layoutBox)}return ko(this.latestValues)&&Vo(r,this.latestValues,this.layout?.layoutBox),r}removeTransform(e){let t=J();X(t,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];if(!ko(n.latestValues))continue;let r;n.instance&&(Oo(n.latestValues)&&n.updateSnapshot(),r=J(),X(r,n.measurePageBox())),Us(t,n.latestValues,n.snapshot?.layoutBox,r)}return ko(this.latestValues)&&Us(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:e.crossfade===void 0||e.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==L.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){let t=this.getLead();this.isProjectionDirty||=t.isProjectionDirty,this.isTransformDirty||=t.isTransformDirty,this.isSharedProjectionDirty||=t.isSharedProjectionDirty;let n=!!this.resumingFrom||this!==t;if(!(e||n&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:r,layoutId:i}=this.options;if(!this.layout||!(r||i))return;this.resolvedRelativeTargetAt=L.timestamp;let a=this.getClosestProjectingParent();a&&this.linkedParentVersion!==a.layoutVersion&&!a.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&a&&a.layout?this.createRelativeTarget(a,this.layout.layoutBox,a.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=J(),this.targetWithTransforms=J()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Fs(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):X(this.target,this.layout.layoutBox),Fo(this.target,this.targetDelta)):X(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&a&&!!a.resumingFrom==!!this.resumingFrom&&!a.options.layoutScroll&&a.target&&this.animationProgress!==1?this.createRelativeTarget(a,this.target,a.target):this.relativeParent=this.relativeTarget=void 0),Za.value&&hc.calculatedTargetDeltas++)}getClosestProjectingParent(){if(!(!this.parent||Oo(this.parent.latestValues)||Ao(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(e,t,n){this.relativeParent=e,this.linkedParentVersion=e.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=J(),this.relativeTargetOrigin=J(),Ls(this.relativeTargetOrigin,t,n,this.options.layoutAnchor||void 0),X(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){let e=this.getLead(),t=!!this.resumingFrom||this!==e,n=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(n=!1),t&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===L.timestamp&&(n=!1),n)return;let{layout:r,layoutId:i}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(r||i))return;X(this.layoutCorrected,this.layout.layoutBox);let a=this.treeScale.x,o=this.treeScale.y;Ro(this.layoutCorrected,this.treeScale,this.path,t),e.layout&&!e.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(e.target=e.layout.layoutBox,e.targetWithTransforms=J());let{target:s}=e;if(!s){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Es(this.prevProjectionDelta.x,this.projectionDelta.x),Es(this.prevProjectionDelta.y,this.projectionDelta.y)),Ns(this.projectionDelta,this.layoutCorrected,s,this.latestValues),(this.treeScale.x!==a||this.treeScale.y!==o||!Zs(this.projectionDelta.x,this.prevProjectionDelta.x)||!Zs(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners(`projectionUpdate`,s)),Za.value&&hc.calculatedProjections++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){if(this.options.visualElement?.scheduleRender(),e){let e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=no(),this.projectionDelta=no(),this.projectionDeltaWithTransform=no()}setAnimationOrigin(e,t=!1,n){let r=this.snapshot,i=r?r.latestValues:{},a={...this.latestValues},o=no();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let s=J(),c=(r?r.source:void 0)!==(this.layout?this.layout.source:void 0),l=this.getStack(),u=!l||l.members.length<=1,d=!!(c&&!u&&this.options.crossfade===!0&&!this.path.some(Bc));this.animationProgress=0;let f,p=n?.interpolateProjection(e);this.mixTargetDelta=t=>{let n=t/1e3,r=p?.(n);r?(o.x.translate=r.x,o.x.scale=W(e.x.scale,1,n),o.x.origin=e.x.origin,o.x.originPoint=e.x.originPoint,o.y.translate=r.y,o.y.scale=W(e.y.scale,1,n),o.y.origin=e.y.origin,o.y.originPoint=e.y.originPoint):(Lc(o.x,e.x,n),Lc(o.y,e.y,n)),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Ls(s,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),zc(this.relativeTarget,this.relativeTargetOrigin,s,n),f&&qs(this.relativeTarget,f)&&(this.isProjectionDirty=!1),f||=J(),X(f,this.relativeTarget)),c&&(this.animationValues=a,nc(a,i,this.latestValues,n,d,u)),r&&r.rotate!==void 0&&(this.animationValues||=a,this.animationValues.pathRotation=r.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners(`animationStart`),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&=(gt(this.pendingAnimation),void 0),this.pendingAnimation=I.update(()=>{mc.hasAnimatedSinceResize=!0,this.motionValue||=mi(0),this.motionValue.jump(0,!1),this.currentAnimation=sc(this.motionValue,[0,1e3],{...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onComplete:()=>{e.onComplete&&e.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners(`animationComplete`)}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(_c),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,target:n,layout:r,latestValues:i}=e;if(!(!t||!n||!r)){if(this!==e&&this.layout&&r&&Kc(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||J();let t=Z(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;let r=Z(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+r}X(t,n),Vo(t,i),Ns(this.projectionDeltaWithTransform,this.layoutCorrected,t,i)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new pc),this.sharedNodes.get(e).add(t);let n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){let e=this.getStack();return!e||e.lead===this}getLead(){let{layoutId:e}=this.options;return e&&this.getStack()?.lead||this}getPrevLead(){let{layoutId:e}=this.options;return e?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){let r=this.getStack();r&&r.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){let e=this.getStack();return e?e.relegate(this):!1}resetSkewAndRotation(){let{visualElement:e}=this.options;if(!e)return;let t=!1,{latestValues:n}=e;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(t=!0),!t)return;let r={};n.z&&yc(`z`,e,r,this.animationValues);for(let t=0;t<gc.length;t++)yc(`rotate${gc[t]}`,e,r,this.animationValues),yc(`skew${gc[t]}`,e,r,this.animationValues);e.render();for(let t in r)e.setStaticValue(t,r[t]),this.animationValues&&(this.animationValues[t]=r[t]);e.scheduleRender()}applyProjectionStyles(e,t){if(!this.instance||this.isSVG)return;if(!this.isVisible){e.visibility=`hidden`;return}let n=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,e.visibility=``,e.opacity=``,e.pointerEvents=fc(t?.pointerEvents)||``,e.transform=n?n(this.latestValues,``):`none`;return}let r=this.getLead();if(!this.projectionDelta||!this.layout||!r.target){this.options.layoutId&&(e.opacity=this.latestValues.opacity===void 0?1:this.latestValues.opacity,e.pointerEvents=fc(t?.pointerEvents)||``),this.hasProjected&&!ko(this.latestValues)&&(e.transform=n?n({},``):`none`,this.hasProjected=!1);return}e.visibility=``;let i=r.animationValues||r.latestValues;this.applyTransformsToTarget();let a=Qs(this.projectionDeltaWithTransform,this.treeScale,i);n&&(a=n(i,a)),e.transform=a;let{x:o,y:s}=this.projectionDelta;e.transformOrigin=`${o.origin*100}% ${s.origin*100}% 0`,r.animationValues?e.opacity=r===this?i.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:i.opacityExit:e.opacity=r===this?i.opacity===void 0?``:i.opacity:i.opacityExit===void 0?0:i.opacityExit;for(let t in Qo){if(i[t]===void 0)continue;let{correct:n,applyTo:o,isCSSVariable:s}=Qo[t],c=a===`none`?i[t]:n(i[t],r);if(o){let t=o.length;for(let n=0;n<t;n++)e[o[n]]=c}else s?this.options.visualElement.renderState.vars[t]=c:e[t]=c}this.options.layoutId&&(e.pointerEvents=r===this?fc(t?.pointerEvents)||``:`none`)}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(Dc),this.root.sharedNodes.clear()}}}function Sc(e){e.updateLayout()}function Cc(e){let t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners(`didUpdate`)){let{layoutBox:n,measuredBox:r}=e.layout,{animationType:i}=e.options,a=t.source!==e.layout.source;if(i===`size`)Q(e=>{let r=a?t.measuredBox[e]:t.layoutBox[e],i=Z(r);r.min=n[e].min,r.max=r.min+i});else if(i===`x`||i===`y`){let e=i===`x`?`y`:`x`;Ts(a?t.measuredBox[e]:t.layoutBox[e],n[e])}else Kc(i,t.layoutBox,n)&&Q(r=>{let i=a?t.measuredBox[r]:t.layoutBox[r],o=Z(n[r]);i.max=i.min+o,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[r].max=e.relativeTarget[r].min+o)});let o=no();Ns(o,n,t.layoutBox);let s=no();a?Ns(s,e.applyTransform(r,!0),t.measuredBox):Ns(s,n,t.layoutBox);let c=!Gs(o),l=!1;if(!e.resumeFrom){let r=e.getClosestProjectingParent();if(r&&!r.resumeFrom){let{snapshot:i,layout:a}=r;if(i&&a){let o=e.options.layoutAnchor||void 0,s=J();Ls(s,t.layoutBox,i.layoutBox,o);let c=J();Ls(c,n,a.layoutBox,o),Ys(s,c)||(l=!0),r.options.layoutRoot&&(e.relativeTarget=c,e.relativeTargetOrigin=s,e.relativeParent=r)}}}e.notifyListeners(`didUpdate`,{layout:n,snapshot:t,delta:s,layoutDelta:o,hasLayoutChanged:c,hasRelativeLayoutChanged:l})}else if(e.isLead()){let{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function wc(e){Za.value&&hc.nodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty),e.isTransformDirty||=e.parent.isTransformDirty)}function Tc(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Ec(e){e.clearSnapshot()}function Dc(e){e.clearMeasurements()}function Oc(e){e.isLayoutDirty=!0,e.updateLayout()}function kc(e){e.isLayoutDirty=!1}function Ac(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function jc(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify(`BeforeLayoutMeasure`),e.resetTransform()}function Mc(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Nc(e){e.resolveTargetDelta()}function Pc(e){e.calcProjection()}function Fc(e){e.resetSkewAndRotation()}function Ic(e){e.removeLeadSnapshot()}function Lc(e,t,n){e.translate=W(t.translate,0,n),e.scale=W(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Rc(e,t,n,r){e.min=W(t.min,n.min,r),e.max=W(t.max,n.max,r)}function zc(e,t,n,r){Rc(e.x,t.x,n.x,r),Rc(e.y,t.y,n.y,r)}function Bc(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}var Vc={duration:.45,ease:[.4,0,.1,1]},Hc=e=>typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Uc=Hc(`applewebkit/`)&&!Hc(`chrome/`)?Math.round:N;function Wc(e){e.min=Uc(e.min),e.max=Uc(e.max)}function Gc(e){Wc(e.x),Wc(e.y)}function Kc(e,t,n){return e===`position`||e===`preserve-aspect`&&!js(Xs(t),Xs(n),.2)}function qc(e){return e!==e.root&&e.scroll?.wasRoot}var Jc=xc({attachResizeListener:(e,t)=>cc(e,`resize`,t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),Yc={current:void 0},Xc=xc({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Yc.current){let e=new Jc({});e.mount(window),e.setOptions({layoutScroll:!0}),Yc.current=e}return Yc.current},resetTransform:(e,t)=>{e.style.transform=t===void 0?`none`:t},checkIsScrollRoot:e=>window.getComputedStyle(e).position===`fixed`}),Zc=(0,d.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:`never`});function Qc(e=!0){let t=(0,d.useContext)(Ee);if(t===null)return[!0,null];let{isPresent:n,onExitComplete:r,register:i}=t,a=(0,d.useId)();(0,d.useEffect)(()=>{if(e)return i(a)},[e]);let o=(0,d.useCallback)(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,o]:[!0]}var $c=(0,d.createContext)({strict:!1}),el={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`]},tl=!1;function nl(){if(tl)return;let e={};for(let t in el)e[t]={isEnabled:e=>el[t].some(t=>!!e[t])};yo(e),tl=!0}function rl(){return nl(),bo()}function il(e){let t=rl();for(let n in e)t[n]={...t[n],...e[n]};yo(t)}var al=new Set(`animate.exit.variants.initial.style.values.variants.transition.transformTemplate.custom.inherit.onBeforeLayoutMeasure.onAnimationStart.onAnimationComplete.onUpdate.onDragStart.onDrag.onDragEnd.onMeasureDragConstraints.onDirectionLock.onDragTransitionEnd._dragX._dragY.onHoverStart.onHoverEnd.onViewportEnter.onViewportLeave.globalTapTarget.propagate.ignoreStrict.viewport`.split(`.`));function ol(e){return e.startsWith(`while`)||e.startsWith(`drag`)&&e!==`draggable`||e.startsWith(`layout`)||e.startsWith(`onTap`)||e.startsWith(`onPan`)||e.startsWith(`onLayout`)||al.has(e)}var sl=s({default:()=>cl}),cl,ll=o((()=>{throw cl={},Error(`Could not resolve "@emotion/is-prop-valid" imported by "framer-motion". Is it installed?`)})),ul=e=>!ol(e);function dl(e){typeof e==`function`&&(ul=t=>t.startsWith(`on`)?!ol(t):e(t))}try{dl((ll(),u(sl)).default)}catch{}function fl(e,t,n){let r={};for(let i in e)i===`values`&&typeof e.values==`object`||K(e[i])||(ul(i)||n===!0&&ol(i)||!t&&!ol(i)||e.draggable&&i.startsWith(`onDrag`))&&(r[i]=e[i]);return r}var pl=(0,d.createContext)({});function ml(e,t){if(lo(e)){let{initial:t,animate:n}=e;return{initial:t===!1||oo(t)?t:void 0,animate:oo(n)?n:void 0}}return e.inherit===!1?{}:t}function hl(e){let{initial:t,animate:n}=ml(e,(0,d.useContext)(pl));return(0,d.useMemo)(()=>({initial:t,animate:n}),[gl(t),gl(n)])}function gl(e){return Array.isArray(e)?e.join(` `):e}var _l=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function vl(e,t,n){for(let r in t)!K(t[r])&&!$o(r,n)&&(e[r]=t[r])}function yl({transformTemplate:e},t){return(0,d.useMemo)(()=>{let n=_l();return qo(n,t,e),Object.assign({},n.vars,n.style)},[t])}function bl(e,t){let n=e.style||{},r={};return vl(r,n,e),Object.assign(r,yl(e,t)),r}function xl(e,t){let n={},r=bl(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout=`none`,r.touchAction=e.drag===!0?`none`:`pan-${e.drag===`x`?`y`:`x`}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}var Sl=()=>({..._l(),attrs:{}});function Cl(e,t,n,r){let i=(0,d.useMemo)(()=>{let n=Sl();return ls(n,t,ds(r),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let t={};vl(t,e.style,e),i.style={...t,...i.style}}return i}var wl=[`animate`,`circle`,`defs`,`desc`,`ellipse`,`g`,`image`,`line`,`filter`,`marker`,`mask`,`metadata`,`path`,`pattern`,`polygon`,`polyline`,`rect`,`stop`,`switch`,`symbol`,`svg`,`text`,`tspan`,`use`,`view`];function Tl(e){return typeof e!=`string`||e.includes(`-`)?!1:!!(wl.indexOf(e)>-1||/[A-Z]/u.test(e))}function El(e,t,n,{latestValues:r},i,a=!1,o){let s=(o??Tl(e)?Cl:xl)(t,r,i,e),c=fl(t,typeof e==`string`,a),l=e===d.Fragment?{}:{...c,...s,ref:n},{children:u}=t,f=(0,d.useMemo)(()=>K(u)?u.get():u,[u]);return(0,d.createElement)(e,{...l,children:f})}function Dl({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:Ol(n,r,i,e),renderState:t()}}function Ol(e,t,n,r){let i={},a=r(e,{});for(let e in a)i[e]=fc(a[e]);let{initial:o,animate:s}=e,c=lo(e),l=uo(e);t&&l&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),s===void 0&&(s=t.animate));let u=n?n.initial===!1:!1;u||=o===!1;let d=u?s:o;if(d&&typeof d!=`boolean`&&!ao(d)){let t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){let r=Ai(e,t[n]);if(r){let{transitionEnd:e,transition:t,...n}=r;for(let e in n){let t=n[e];if(Array.isArray(t)){let e=u?t.length-1:0;t=t[e]}t!==null&&(i[e]=t)}for(let t in e)i[t]=e[t]}}}return i}var kl=e=>(t,n)=>{let r=(0,d.useContext)(pl),i=(0,d.useContext)(Ee),a=()=>Dl(e,t,r,i);return n?a():we(a)},Al=kl({scrapeMotionValuesFromProps:es,createRenderState:_l}),jl=kl({scrapeMotionValuesFromProps:ps,createRenderState:Sl}),Ml=Symbol.for(`motionComponentSymbol`);function Nl(e,t,n){let r=(0,d.useRef)(n);(0,d.useInsertionEffect)(()=>{r.current=n});let i=(0,d.useRef)(null);return(0,d.useCallback)(n=>{n&&e.onMount?.(n),t&&(n?t.mount(n):t.unmount());let a=r.current;if(typeof a==`function`)if(n){let e=a(n);typeof e==`function`&&(i.current=e)}else i.current?(i.current(),i.current=null):a(n);else a&&(a.current=n)},[t])}var Pl=(0,d.createContext)({});function Fl(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function Il(e,t,n,r,i,a){let{visualElement:o}=(0,d.useContext)(pl),s=(0,d.useContext)($c),c=(0,d.useContext)(Ee),l=(0,d.useContext)(Zc),u=l.reducedMotion,f=l.skipAnimations,p=(0,d.useRef)(null),m=(0,d.useRef)(!1);r||=s.renderer,!p.current&&r&&(p.current=r(e,{visualState:t,parent:o,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u,skipAnimations:f,isSVG:a}),m.current&&p.current&&(p.current.manuallyAnimateOnMount=!0));let h=p.current,g=(0,d.useContext)(Pl);h&&!h.projection&&i&&(h.type===`html`||h.type===`svg`)&&Ll(p.current,n,i,g);let _=(0,d.useRef)(!1);(0,d.useInsertionEffect)(()=>{h&&_.current&&h.update(n,c)});let v=n[Bi],y=(0,d.useRef)(!!v&&typeof window<`u`&&!window.MotionHandoffIsComplete?.(v)&&window.MotionHasOptimisedAnimation?.(v));return Te(()=>{m.current=!0,h&&(_.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),h.scheduleRenderMicrotask(),y.current&&h.animationState&&h.animationState.animateChanges())}),(0,d.useEffect)(()=>{h&&(!y.current&&h.animationState&&h.animationState.animateChanges(),y.current&&=(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(v)}),!1),h.enteringChildren=void 0)}),h}function Ll(e,t,n,r){let{layoutId:i,layout:a,drag:o,dragConstraints:s,layoutScroll:c,layoutRoot:l,layoutAnchor:u,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t[`data-framer-portal-id`]?void 0:Rl(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||s&&Fl(s),visualElement:e,animationType:typeof a==`string`?a:`both`,initialPromotionConfig:r,crossfade:d,layoutScroll:c,layoutRoot:l,layoutAnchor:u})}function Rl(e){if(e)return e.options.allowProjection===!1?Rl(e.parent):e.projection}function zl(e,{forwardMotionProps:t=!1,type:n}={},r,i){r&&il(r);let a=n?n===`svg`:Tl(e),o=a?jl:Al;function s(n,s){let c,l={...(0,d.useContext)(Zc),...n,layoutId:Bl(n)},{isStatic:u}=l,p=hl(n),m=o(n,u);if(!u&&typeof window<`u`){Vl(l,r);let t=Hl(l);c=t.MeasureLayout,p.visualElement=Il(e,m,l,i,t.ProjectionNode,a)}return(0,f.jsxs)(pl.Provider,{value:p,children:[c&&p.visualElement?(0,f.jsx)(c,{visualElement:p.visualElement,...l}):null,El(e,n,Nl(m,p.visualElement,s),m,u,t,a)]})}s.displayName=`motion.${typeof e==`string`?e:`create(${e.displayName??e.name??``})`}`;let c=(0,d.forwardRef)(s);return c[Ml]=e,c}function Bl({layoutId:e}){let t=(0,d.useContext)(Ce).id;return t&&e!==void 0?t+`-`+e:e}function Vl(e,t){let n=(0,d.useContext)($c).strict;if(process.env.NODE_ENV!==`production`&&t&&n){let t="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";e.ignoreStrict?Ae(!1,t,`lazy-strict-mode`):M(!1,t,`lazy-strict-mode`)}}function Hl(e){let{drag:t,layout:n}=rl();if(!t&&!n)return{};let r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function Ul(e,t){if(typeof Proxy>`u`)return zl;let n=new Map,r=(n,r)=>zl(n,r,e,t);return new Proxy((e,t)=>(process.env.NODE_ENV!==`production`&&Ve(!1,`motion() is deprecated. Use motion.create() instead.`),r(e,t)),{get:(i,a)=>a===`create`?r:(n.has(a)||n.set(a,zl(a,void 0,e,t)),n.get(a))})}var Wl=(e,t)=>t.isSVG??Tl(e)?new ms(t):new ns(t,{allowProjection:e!==d.Fragment}),Gl=class extends Co{constructor(e){super(e),e.animationState||=xs(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();ao(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}},Kl=0,ql={animation:{Feature:Gl},exit:{Feature:class extends Co{constructor(){super(...arguments),this.id=Kl++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;let{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===n)return;if(e&&n===!1){if(this.isExitComplete){let{initial:e,custom:t}=this.node.getProps();if(typeof e==`string`||typeof e==`object`&&e&&!Array.isArray(e)){let n=ji(this.node,e,t);if(n){let{transition:e,transitionEnd:t,...r}=n;for(let e in r)this.node.getValue(e)?.jump(r[e])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive(`exit`,!1);this.isExitComplete=!1;return}let r=this.node.animationState.setActive(`exit`,!e);t&&!e&&r.then(()=>{this.isExitComplete=!0,t(this.id)})}mount(){let{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id))}unmount(){}}}};function Jl(e){return{point:{x:e.pageX,y:e.pageY}}}var Yl=e=>t=>wa(t)&&e(t,Jl(t));function Xl(e,t,n,r){return cc(e,t,Yl(n),r)}var Zl=({current:e})=>e?e.ownerDocument.defaultView:null,Ql=(e,t)=>Math.abs(e-t);function $l(e,t){let n=Ql(e.x,t.x),r=Ql(e.y,t.y);return Math.sqrt(n**2+r**2)}var eu=new Set([`auto`,`scroll`]),tu=class{constructor(e,t,{transformPagePoint:n,contextWindow:r=window,dragSnapToOrigin:i=!1,distanceThreshold:a=3,element:o}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=e=>{this.handleScroll(e.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=nu(this.lastRawMoveEventInfo,this.transformPagePoint));let e=iu(this.lastMoveEventInfo,this.history),t=this.startEvent!==null,n=$l(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;let{point:r}=e,{timestamp:i}=L;this.history.push({...r,timestamp:i});let{onStart:a,onMove:o}=this.handlers;t||(a&&a(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),o&&o(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastRawMoveEventInfo=t,this.lastMoveEventInfo=nu(t,this.transformPagePoint),I.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();let{onEnd:n,onSessionEnd:r,resumeAnimation:i}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&i&&i(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let a=iu(e.type===`pointercancel`?this.lastMoveEventInfo:nu(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,a),r&&r(e,a)},!wa(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=a,this.contextWindow=r||window;let s=nu(Jl(e),this.transformPagePoint),{point:c}=s,{timestamp:l}=L;this.history=[{...c,timestamp:l}];let{onSessionStart:u}=t;u&&u(e,iu(s,this.history));let d={passive:!0,capture:!0};this.removeListeners=Ie(Xl(this.contextWindow,`pointermove`,this.handlePointerMove,d),Xl(this.contextWindow,`pointerup`,this.handlePointerUp,d),Xl(this.contextWindow,`pointercancel`,this.handlePointerUp,d)),o&&this.startScrollTracking(o)}startScrollTracking(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);(eu.has(e.overflowX)||eu.has(e.overflowY))&&this.scrollPositions.set(t,{x:t.scrollLeft,y:t.scrollTop}),t=t.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.addEventListener(`scroll`,this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.removeEventListener(`scroll`,this.onWindowScroll)}}handleScroll(e){let t=this.scrollPositions.get(e);if(!t)return;let n=e===window,r=n?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},i={x:r.x-t.x,y:r.y-t.y};i.x===0&&i.y===0||(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(e,r),I.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),gt(this.updatePoint)}};function nu(e,t){return t?{point:t(e.point)}:e}function ru(e,t){return{x:e.x-t.x,y:e.y-t.y}}function iu({point:e},t){return{point:e,delta:ru(e,ou(t)),offset:ru(e,au(t)),velocity:su(t,.1)}}function au(e){return e[0]}function ou(e){return e[e.length-1]}function su(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=ou(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>P(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>P(t)*2&&(r=e[1]);let a=F(i.timestamp-r.timestamp);if(a===0)return{x:0,y:0};let o={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function cu(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?W(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?W(n,e,r.max):Math.min(e,n)),e}function lu(e,t,n){return{min:t===void 0?void 0:e.min+t,max:n===void 0?void 0:e.max+n-(e.max-e.min)}}function uu(e,{top:t,left:n,bottom:r,right:i}){return{x:lu(e.x,n,i),y:lu(e.y,t,r)}}function du(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function fu(e,t){return{x:du(e.x,t.x),y:du(e.y,t.y)}}function pu(e,t){let n=.5,r=Z(e),i=Z(t);return i>r?n=Le(t.min,t.max-r,e.min):r>i&&(n=Le(e.min,e.max-i,t.min)),j(0,1,n)}function mu(e,t){let n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}var hu=.35;function gu(e=hu){return e===!1?e=0:e===!0&&(e=hu),{x:_u(e,`left`,`right`),y:_u(e,`top`,`bottom`)}}function _u(e,t,n){return{min:vu(e,t),max:vu(e,n)}}function vu(e,t){return typeof e==`number`?e:e[t]||0}var yu=new WeakMap,bu=class{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=J(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:t=!1,distanceThreshold:n}={}){let{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;let i=e=>{t&&this.snapToCursor(Jl(e).point),this.stopAnimation()},a=(e,t)=>{let{drag:n,dragPropagation:r,onDragStart:i}=this.getProps();if(n&&!r&&(this.openDragLock&&this.openDragLock(),this.openDragLock=ya(n),!this.openDragLock))return;this.latestPointerEvent=e,this.latestPanInfo=t,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Q(e=>{let t=this.getAxisMotionValue(e).get()||0;if(B.test(t)){let{projection:n}=this.visualElement;if(n&&n.layout){let r=n.layout.layoutBox[e];r&&(t=Z(r)*(parseFloat(t)/100))}}this.originPoint[e]=t}),i&&I.update(()=>i(e,t),!1,!0),Ri(this.visualElement,`transform`);let{animationState:a}=this.visualElement;a&&a.setActive(`whileDrag`,!0)},o=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t;let{dragPropagation:n,dragDirectionLock:r,onDirectionLock:i,onDrag:a}=this.getProps();if(!n&&!this.openDragLock)return;let{offset:o}=t;if(r&&this.currentDirection===null){this.currentDirection=wu(o),this.currentDirection!==null&&i&&i(this.currentDirection);return}this.updateAxis(`x`,t.point,o),this.updateAxis(`y`,t.point,o),this.visualElement.render(),a&&I.update(()=>a(e,t),!1,!0)},s=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>{let{dragSnapToOrigin:e}=this.getProps();(e||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:l}=this.getProps();this.panSession=new tu(e,{onSessionStart:i,onStart:a,onMove:o,onSessionEnd:s,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,distanceThreshold:n,contextWindow:Zl(this.visualElement),element:this.visualElement.current})}stop(e,t){let n=e||this.latestPointerEvent,r=t||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!r||!n)return;let{velocity:a}=r;this.startAnimation(a);let{onDragEnd:o}=this.getProps();o&&I.postRender(()=>o(n,r))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();let{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive(`whileDrag`,!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,t,n){let{drag:r}=this.getProps();if(!n||!Cu(e,r,this.currentDirection))return;let i=this.getAxisMotionValue(e),a=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(a=cu(a,this.constraints[e],this.elastic[e])),i.set(a)}resolveConstraints(){let{dragConstraints:e,dragElastic:t}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;e&&Fl(e)?this.constraints||=this.resolveRefConstraints():e&&n?this.constraints=uu(n.layoutBox,e):this.constraints=!1,this.elastic=gu(t),r!==this.constraints&&!Fl(e)&&n&&this.constraints&&!this.hasMutatedConstraints&&Q(e=>{this.constraints!==!1&&this.getAxisMotionValue(e)&&(this.constraints[e]=mu(n.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!Fl(e))return!1;let n=e.current;M(n!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.",`drag-constraints-ref`);let{projection:r}=this.visualElement;if(!r||!r.layout)return!1;r.root&&(r.root.scroll=void 0,r.root.updateScroll());let i=Uo(n,r.root,this.visualElement.getTransformPagePoint()),a=fu(r.layout.layoutBox,i);if(t){let e=t(To(a));this.hasMutatedConstraints=!!e,e&&(a=wo(e))}return a}startAnimation(e){let{drag:t,dragMomentum:n,dragElastic:r,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),s=this.constraints||{},c=Q(o=>{if(!Cu(o,t,this.currentDirection))return;let c=s&&s[o]||{};(a===!0||a===o)&&(c={min:0,max:0});let l=r?200:1e6,u=r?40:1e7,d={type:`inertia`,velocity:n?e[o]:0,bounceStiffness:l,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...i,...c};return this.startAxisValueAnimation(o,d)});return Promise.all(c).then(o)}startAxisValueAnimation(e,t){let n=this.getAxisMotionValue(e);return Ri(this.visualElement,e),n.start(wi(e,n,0,t,this.visualElement,!1))}stopAnimation(){Q(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`;return this.visualElement.getProps()[t]||this.visualElement.getValue(e,this.visualElement.latestValues[e]??0)}snapToCursor(e){Q(t=>{let{drag:n}=this.getProps();if(!Cu(t,n,this.currentDirection))return;let{projection:r}=this.visualElement,i=this.getAxisMotionValue(t);if(r&&r.layout){let{min:n,max:a}=r.layout.layoutBox[t],o=i.get()||0;i.set(e[t]-W(n,a,.5)+o)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!Fl(t)||!n||!this.constraints)return;this.stopAnimation();let r={x:0,y:0};Q(e=>{let t=this.getAxisMotionValue(e);if(t&&this.constraints!==!1){let n=t.get();r[e]=pu({min:n,max:n},this.constraints[e])}});let{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},``):`none`,n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),Q(t=>{if(!Cu(t,e,null))return;let n=this.getAxisMotionValue(t),{min:i,max:a}=this.constraints[t];n.set(W(i,a,r[t]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;yu.set(this.visualElement,this);let e=this.visualElement.current,t=Xl(e,`pointerdown`,t=>{let{drag:n,dragListener:r=!0}=this.getProps(),i=t.target,a=i!==e&&Oa(i);n&&r&&!a&&this.start(t)}),n,r=()=>{let{dragConstraints:t}=this.getProps();Fl(t)&&t.current&&(this.constraints=this.resolveRefConstraints(),n||=Su(e,t.current,()=>this.scalePositionWithinConstraints()))},{projection:i}=this.visualElement,a=i.addEventListener(`measure`,r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),I.read(r);let o=cc(window,`resize`,()=>this.scalePositionWithinConstraints()),s=i.addEventListener(`didUpdate`,(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(Q(t=>{let n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))}),this.visualElement.render())}));return()=>{o(),t(),a(),s&&s(),n&&n()}}getProps(){let e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:i=!1,dragElastic:a=hu,dragMomentum:o=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:i,dragElastic:a,dragMomentum:o}}};function xu(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function Su(e,t,n){let r=Xa(e,xu(n)),i=Xa(t,xu(n));return()=>{r(),i()}}function Cu(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function wu(e,t=10){let n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}var Tu=class extends Co{constructor(e){super(e),this.removeGroupControls=N,this.removeListeners=N,this.controls=new bu(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||N}update(){let{dragControls:e}=this.node.getProps(),{dragControls:t}=this.node.prevProps||{};e!==t&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},Eu=e=>(t,n)=>{e&&I.update(()=>e(t,n),!1,!0)},Du=class extends Co{constructor(){super(...arguments),this.removePointerDownListener=N}onPointerDown(e){this.session=new tu(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Zl(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:Eu(e),onStart:Eu(t),onMove:Eu(n),onEnd:(e,t)=>{delete this.session,r&&I.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=Xl(this.node.current,`pointerdown`,e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}},Ou=!1,ku=class extends d.Component{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:i}=e;i&&(t.group&&t.group.add(i),n&&n.register&&r&&n.register(i),Ou&&i.root.didUpdate(),i.addEventListener(`animationComplete`,()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),mc.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,visualElement:n,drag:r,isPresent:i}=this.props,{projection:a}=n;return a?(a.isPresent=i,e.layoutDependency!==t&&a.setOptions({...a.options,layoutDependency:t}),Ou=!0,r||e.layoutDependency!==t||t===void 0||e.isPresent!==i?a.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?a.promote():a.relegate()||I.postRender(()=>{let e=a.getStack();(!e||!e.members.length)&&this.safeToRemove()})),null):null}componentDidUpdate(){let{visualElement:e,layoutAnchor:t}=this.props,{projection:n}=e;n&&(n.options.layoutAnchor=t,n.root.didUpdate(),ga.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;Ou=!0,r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){let{safeToRemove:e}=this.props;e&&e()}render(){return null}};function Au(e){let[t,n]=Qc(),r=(0,d.useContext)(Ce);return(0,f.jsx)(ku,{...e,layoutGroup:r,switchLayoutGroup:(0,d.useContext)(Pl),isPresent:t,safeToRemove:n})}var ju={pan:{Feature:Du},drag:{Feature:Tu,ProjectionNode:Xc,MeasureLayout:Au}};function Mu(e,t,n){let{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive(`whileHover`,n===`Start`);let i=r[`onHover`+n];i&&I.postRender(()=>i(t,Jl(t)))}var Nu=class extends Co{mount(){let{current:e}=this.node;e&&(this.unmount=Sa(e,(e,t)=>(Mu(this.node,t,`Start`),e=>Mu(this.node,e,`End`))))}unmount(){}},Pu=class extends Co{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(`:focus-visible`)}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive(`whileFocus`,!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive(`whileFocus`,!1),this.isActive=!1)}mount(){this.unmount=Ie(cc(this.node.current,`focus`,()=>this.onFocus()),cc(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}};function Fu(e,t,n){let{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive(`whileTap`,n===`Start`);let i=r[`onTap`+(n===`End`?``:n)];i&&I.postRender(()=>i(t,Jl(t)))}var Iu=class extends Co{mount(){let{current:e}=this.node;if(!e)return;let{globalTapTarget:t,propagate:n}=this.node.props;this.unmount=Fa(e,(e,t)=>(Fu(this.node,t,`Start`),(e,{success:t})=>Fu(this.node,e,t?`End`:`Cancel`)),{useGlobalTarget:t,stopPropagation:n?.tap===!1})}unmount(){}},Lu=new WeakMap,Ru=new WeakMap,zu=e=>{let t=Lu.get(e.target);t&&t(e)},Bu=e=>{e.forEach(zu)};function Vu({root:e,...t}){let n=e||document;Ru.has(n)||Ru.set(n,{});let r=Ru.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(Bu,{root:e,...t})),r[i]}function Hu(e,t,n){let r=Vu(t);return Lu.set(e,n),r.observe(e),()=>{Lu.delete(e),r.unobserve(e)}}var Uu={some:0,all:1},Wu=class extends Co{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();let{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r=`some`,once:i}=e,a={root:t?t.current:void 0,rootMargin:n,threshold:typeof r==`number`?r:Uu[r]},o=e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,i&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive(`whileInView`,t);let{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),a=t?n:r;a&&a(e)};this.stopObserver=Hu(this.node.current,a,o)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>`u`)return;let{props:e,prevProps:t}=this.node;[`amount`,`margin`,`root`].some(Gu(e,t))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}};function Gu({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}var Ku={inView:{Feature:Wu},tap:{Feature:Iu},focus:{Feature:Pu},hover:{Feature:Nu}},qu={layout:{ProjectionNode:Xc,MeasureLayout:Au}},Ju=Ul({...ql,...Ku,...ju,...qu},Wl);function Yu(e){let t=we(()=>mi(e)),{isStatic:n}=(0,d.useContext)(Zc);if(n){let[,n]=(0,d.useState)(e);(0,d.useEffect)(()=>t.on(`change`,n),[])}return t}function Xu(e){return typeof e==`object`&&!Array.isArray(e)}function Zu(e,t,n,r){return e==null?[]:typeof e==`string`&&Xu(t)?pa(e,n,r):e instanceof NodeList?Array.from(e):Array.isArray(e)?e.filter(e=>e!=null):[e]}function Qu(e,t,n){return e*(t+1)+n*t}function $u(e,t,n,r){return typeof t==`number`?t:t.startsWith(`-`)||t.startsWith(`+`)?Math.max(0,e+parseFloat(t)):t===`<`?n:t.startsWith(`<`)?Math.max(0,n+parseFloat(t.slice(1))):r.get(t)??e}function ed(e,t,n){for(let r=0;r<e.length;r++){let i=e[r];i.at>t&&i.at<n&&(Oe(e,i),r--)}}function td(e,t,n,r,i,a){ed(e,i,a);for(let o=0;o<t.length;o++)e.push({value:t[o],at:W(i,a,r[o]),easing:st(n,o)})}function nd(e,t,n=0){let r=t+1+t*n;for(let t=0;t<e.length;t++)e[t]=e[t]/r}function rd(e,t){return e.at===t.at?e.value===null?1:t.value===null?-1:0:e.at-t.at}var id=`easeInOut`,ad=20;function od(e,{defaultTransition:t={},...n}={},r,i){let a=t.duration||.3,o=new Map,s=new Map,c={},l=new Map,u=0,d=0,f=0;for(let n=0;n<e.length;n++){let o=e[n];if(typeof o==`string`){l.set(o,d);continue}else if(!Array.isArray(o)){l.set(o.name,$u(d,o.at,u,l));continue}let[p,m,h={}]=o;h.at!==void 0&&(d=$u(d,h.at,u,l));let g=0,_=(e,n,r,o=0,s=0)=>{let c=ld(e),{delay:l=0,times:u=Gn(c),type:p=t.type||`keyframes`,repeat:m,repeatType:h,repeatDelay:_=0,...v}=n,{ease:y=t.ease||`easeOut`,duration:b}=n,x=typeof l==`function`?l(o,s):l,S=c.length,C=Br(p)?p:i?.[p||`keyframes`];if(S<=2&&C){let e=100;if(S===2&&fd(c)){let t=c[1]-c[0];e=Math.abs(t)}let n={...t,...v};b!==void 0&&(n.duration=P(b));let r=On(n,e,C);y=r.ease,b=r.duration}b??=a;let w=d+x;u.length===1&&u[0]===0&&(u[1]=1);let T=u.length-c.length;if(T>0&&Wn(u,T),c.length===1&&c.unshift(null),m&&Ae(m<ad,`Sequence segments can't repeat ${m} times — ignoring repeat option. Use a value below ${ad} or apply repeat at the sequence level instead.`),m&&m<ad){let e=b>0?_/b:0;b=Qu(b,m,_);let t=[...c],n=[...u];y=Array.isArray(y)?[...y]:[y];let r=[...y],i=h===`reverse`||h===`mirror`,a=t,o=r;i&&(a=[...t].reverse(),h===`reverse`&&(o=[...r].reverse().map(e=>typeof e==`function`?Ye(e):e)));for(let s=0;s<m;s++){let l=i&&s%2==0,d=l?a:t,f=l?o:r,p=(s+1)*(1+e);e>0&&(c.push(c[c.length-1]),u.push(p),y.push(`linear`)),c.push(...d);for(let e=0;e<d.length;e++)u.push(n[e]+p),y.push(e===0?`linear`:st(f,e-1))}nd(u,m,e)}let E=w+b;td(r,c,y,u,w,E),g=Math.max(x+b,g),f=Math.max(E,f)};if(K(p)){let e=sd(p,s);_(m,h,cd(`default`,e))}else{let e=Zu(p,m,r,c),t=e.length;for(let n=0;n<t;n++){m=m,h=h;let r=e[n],i=sd(r,s);for(let e in m)_(m[e],ud(h,e),cd(e,i),n,t)}}u=d,d+=g}return s.forEach((e,r)=>{for(let i in e){let a=e[i];a.sort(rd);let s=[],c=[],l=[];for(let e=0;e<a.length;e++){let{at:t,value:n,easing:r}=a[e];s.push(n),c.push(Le(0,f,t)),l.push(r||`easeOut`)}c[0]!==0&&(c.unshift(0),s.unshift(s[0]),l.unshift(id)),c[c.length-1]!==1&&(c.push(1),s.push(null)),o.has(r)||o.set(r,{keyframes:{},transition:{}});let u=o.get(r);u.keyframes[i]=s;let{type:d,...p}=t;u.transition[i]={...p,duration:f,ease:l,times:c,...n}}}),o}function sd(e,t){return!t.has(e)&&t.set(e,{}),t.get(e)}function cd(e,t){return t[e]||(t[e]=[]),t[e]}function ld(e){return Array.isArray(e)?e:[e]}function ud(e,t){return e&&e[t]?{...e,...e[t]}:{...e}}var dd=e=>typeof e==`number`,fd=e=>e.every(dd);function pd(e){let t={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=Ia(e)&&!Qa(e)?new ms(t):new ns(t);n.mount(e),io.set(e,n)}function md(e){let t=new is({presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}});t.mount(e),io.set(e,t)}function hd(e,t){return K(e)||typeof e==`number`||typeof e==`string`&&!Xu(t)}function gd(e,t,n,r){let i=[];if(hd(e,t))i.push(sc(e,Xu(t)&&t.default||t,n&&(n.default||n)));else{if(e==null)return i;let a=Zu(e,t,r),o=a.length;M(!!o,`No valid elements provided.`,`no-valid-elements`);for(let e=0;e<o;e++){let r=a[e],s=r instanceof Element?pd:md;io.has(r)||s(r);let c=io.get(r),l={...n};`delay`in l&&typeof l.delay==`function`&&(l.delay=l.delay(e,o)),i.push(...Ui(c,{...t,transition:l},{}))}}return i}function _d(e,t,n){let r=[];return od(e.map(e=>{if(Array.isArray(e)&&typeof e[0]==`function`){let t=e[0],n=mi(0);return n.on(`change`,t),e.length===1?[n,[0,1]]:e.length===2?[n,[0,1],e[1]]:[n,e[1],e[2]]}return e}),t,n,{spring:Rn}).forEach(({keyframes:e,transition:t},n)=>{r.push(...gd(n,e,t))}),r}function vd(e){return Array.isArray(e)&&e.some(Array.isArray)}function yd(e={}){let{scope:t,reduceMotion:n,skipAnimations:r}=e;function i(e,i,a){let o=[],s,c={};if(n!==void 0&&(c.reduceMotion=n),r!==void 0&&(c.skipAnimations=r),vd(e)){let{onComplete:n,...r}=i||{};typeof n==`function`&&(s=n),o=_d(e,{...c,...r},t)}else{let{onComplete:n,...r}=a||{};typeof n==`function`&&(s=n),o=gd(e,i,{...c,...r},t)}let l=new ci(o);return s&&l.finished.then(s),t&&(t.animations.push(l),l.finished.then(()=>{Oe(t.animations,l)})),l}return i}var bd=yd(),xd=Ju,$=[];for(let e=0;e<256;++e)$.push((e+256).toString(16).slice(1));function Sd(e,t=0){return($[e[t+0]]+$[e[t+1]]+$[e[t+2]]+$[e[t+3]]+`-`+$[e[t+4]]+$[e[t+5]]+`-`+$[e[t+6]]+$[e[t+7]]+`-`+$[e[t+8]]+$[e[t+9]]+`-`+$[e[t+10]]+$[e[t+11]]+$[e[t+12]]+$[e[t+13]]+$[e[t+14]]+$[e[t+15]]).toLowerCase()}var Cd=new Uint8Array(16);function wd(){return crypto.getRandomValues(Cd)}function Td(e,t,n){return!t&&!e&&crypto.randomUUID?crypto.randomUUID():Ed(e,t,n)}function Ed(e,t,n){e||={};let r=e.random??e.rng?.()??wd();if(r.length<16)throw Error(`Random bytes length must be >= 16`);if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){if(n||=0,n<0||n+16>t.length)throw RangeError(`UUID byte range ${n}:${n+15} is out of buffer bounds`);for(let e=0;e<16;++e)t[n+e]=r[e];return t}return Sd(r)}var Dd={time:Date.now(),xy:[0,0],delta:[0,0],initial:[0,0],previous:[0,0],direction:[0,0],initialDirection:[0,0],local:[0,0],lastLocal:[0,0],velocity:0,distance:0},Od={enableMouse:!0};function kd(e={},t={}){let n=(0,d.useRef)(Dd),{uid:r,enableMouse:i}={...Od,...t},a=null,o=Td(),s=(0,d.useRef)(r||o),c=(0,d.useRef)(!1),l=(0,d.useRef)(e);(0,d.useEffect)(()=>{l.current=e},[e]);function u(e){a&&=(a.onTerminationRequest(e),a.onTerminate(e),null),f(e)}function f(e){a||(a={id:s.current,onTerminate:A,onTerminationRequest:k},T(e))}function p(){window.addEventListener(`mousemove`,te,!1),window.addEventListener(`mousemove`,ne,!0),window.addEventListener(`mouseup`,re)}function m(){window.removeEventListener(`mousemove`,te,!1),window.removeEventListener(`mousemove`,ne,!0),window.removeEventListener(`mouseup`,re)}function h(e){E(e),c.current=!0,S(e)&&f(e)}function g(e){E(e),c.current=!0,p(),x(e)&&f(e)}function _(){return a?.id===s.current}function v(e){c.current=!1,m(),_()&&(a=null,O(e))}function y(e){D(e),!_()&&w(e)&&u(e)}function b(e){if(_()){ee(e);return}C(e)&&u(e)}function x(e){return l.current.onStartShouldSet?l.current.onStartShouldSet(n.current,e):!1}function S(e){return l.current.onStartShouldSetCapture?l.current.onStartShouldSetCapture(n.current,e):!1}function C(e){return l.current.onMoveShouldSet?l.current.onMoveShouldSet(n.current,e):!1}function w(e){return l.current.onMoveShouldSetCapture?l.current.onMoveShouldSetCapture(n.current,e):!1}function T(e){l.current.onGrant&&l.current.onGrant(n.current,e)}function E(e){let{pageX:t,pageY:r}=e.touches?.[0]?e.touches[0]:e,i=n.current;n.current={...Dd,lastLocal:i.lastLocal||Dd.lastLocal,xy:[t,r],initial:[t,r],previous:[t,r],time:Date.now()}}function D(e){let{pageX:t,pageY:r}=e.touches?.[0]?e.touches[0]:e,i=n.current,a=Date.now(),o=t-i.xy[0],s=r-i.xy[1],c=t-i.initial[0],l=r-i.initial[1],u=Math.sqrt(c*c+l*l),d=Math.sqrt(o*o+s*s),f=1/(d||1),p=d/(a-i.time),m=i.initialDirection[0]!==0||i.initialDirection[1]!==0?i.initialDirection:[c*f,l*f];n.current={...n.current,time:a,xy:[t,r],initialDirection:m,delta:[c,l],local:[i.lastLocal[0]+t-i.initial[0],i.lastLocal[1]+r-i.initial[1]],velocity:a-i.time===0?i.velocity:p,distance:u,direction:[o*f,s*f],previous:i.xy}}function ee(e){c.current&&l.current.onMove&&l.current.onMove(n.current,e)}function O(e){let t=n.current;n.current={...n.current,lastLocal:t.local},l.current.onRelease&&l.current.onRelease(n.current,e),a=null}function k(e){return!l.current.onTerminationRequest||l.current.onTerminationRequest(n.current,e)}function A(e){let t=n.current;n.current={...n.current,lastLocal:t.local},l.current.onTerminate&&l.current.onTerminate(n.current,e)}function te(e){Id()&&b(e)}function ne(e){Id()&&y(e)}function re(e){Id()&&v(e)}(0,d.useEffect)(()=>m,[]);function ie(){a&&=(a.onTerminate(),null)}function ae(){return a}let oe={onTouchStart:g,onTouchEnd:v,onTouchMove:b,onTouchStartCapture:h,onTouchMoveCapture:y},se=i?{onMouseDown:e=>{Id()&&g(e)},onMouseDownCapture:e=>{Id()&&h(e)}}:{};return{bind:{...oe,...se},terminateCurrentResponder:ie,getCurrentResponder:ae}}var Ad=!!(typeof window<`u`&&document?.createElement(`div`)),jd=!1,Md=1e3,Nd=0;function Pd(){jd||Date.now()-Nd<Md||(jd=!0)}function Fd(){Nd=Date.now(),jd&&=!1}Ad&&(document.addEventListener(`touchstart`,Fd,!0),document.addEventListener(`touchmove`,Fd,!0),document.addEventListener(`mousemove`,Pd,!0));function Id(){return jd}function Ld({children:e,style:t,className:n,...r}){let i=(0,d.useContext)(be);if(!i)throw Error(`Unable to find GridItem context. Please ensure that GridItem is used as a child of GridDropZone`);let{top:a,disableDrag:o,endTraverse:s,onStart:c,mountWithTraverseTarget:l,left:u,onMove:p,onEnd:m,grid:h,dragging:g}=i,{columnWidth:_,rowHeight:v}=h,y=(0,d.useRef)(!1),b=(0,d.useRef)([u,a]),x=Yu(u),S=Yu(a),C=Yu(1),w=Yu(1),T=Yu(0);(0,d.useEffect)(()=>{if(l){let e=l;s(),x.set(e[0]),S.set(e[1]),C.set(1.1),w.set(.8),T.set(1)}else x.set(u),S.set(a),C.set(1),w.set(1),T.set(0)},[]);function E(e){let t=b.current[0]+e.delta[0],n=b.current[1]+e.delta[1];x.set(t),S.set(n),C.set(1.1),w.set(.8),T.set(1),p(e,t,n)}function D(e){let t=b.current[0]+e.delta[0],n=b.current[1]+e.delta[1];y.current=!1,m(e,t,n)}let{bind:ee}=kd({onMoveShouldSet:()=>o?!1:(c(),b.current=[u,a],y.current=!0,!0),onMove:E,onTerminationRequest:()=>!y.current,onTerminate:D,onRelease:D},{enableMouse:!0});(0,d.useEffect)(()=>{y.current||(bd(x,u,{duration:.25}),bd(S,a,{duration:.25}),bd(C,1,{duration:.25}),bd(w,1,{duration:.25}),T.set(0))},[u,a]);let O={className:`GridItem`+(g?` dragging`:``)+(o?` disabled`:``)+(n?` ${n}`:``),...ee,style:{cursor:o?`grab`:void 0,position:`absolute`,width:`${_}px`,height:`${v}px`,boxSizing:`border-box`,zIndex:T,opacity:w,x,y:S,scale:C,...t},...r};return(0,f.jsx)(xd.div,{...O,children:typeof e==`function`?e():e})}exports.GridContext=v,exports.GridContextProvider=y,exports.GridDropZone=xe,exports.GridItem=Ld,exports.move=Se,exports.swap=ye;
|
package/dist/react-grid-dnd.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Context } from 'react';
|
|
2
|
-
import { JSX } from 'react
|
|
2
|
+
import { JSX } from 'react';
|
|
3
3
|
import * as React_2 from 'react';
|
|
4
4
|
import { ReactNode } from 'react';
|
|
5
5
|
|
|
@@ -32,7 +32,7 @@ declare interface GridContextType {
|
|
|
32
32
|
onChange: (sourceId: string, sourceIndex: number, targetIndex: number, targetId?: string) => void;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
export declare function GridDropZone({ id, boxesPerRow, children, style, disableDrag, disableDrop, rowHeight, ...other }: GridDropZoneProps): JSX.Element;
|
|
35
|
+
export declare function GridDropZone({ id, boxesPerRow, children, style, disableDrag, disableDrop, rowHeight, ...other }: GridDropZoneProps): React_2.JSX.Element;
|
|
36
36
|
|
|
37
37
|
export declare interface GridDropZoneProps extends React_2.HTMLAttributes<HTMLDivElement> {
|
|
38
38
|
boxesPerRow: number;
|