framer-motion 7.7.0 → 7.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +549 -174
- package/dist/es/animation/legacy-popmotion/index.mjs +5 -3
- package/dist/es/animation/legacy-popmotion/inertia.mjs +2 -2
- package/dist/es/animation/utils/is-animatable.mjs +1 -1
- package/dist/es/animation/utils/transitions.mjs +5 -2
- package/dist/es/frameloop/create-render-step.mjs +88 -0
- package/dist/es/frameloop/data.mjs +6 -0
- package/dist/es/frameloop/index.mjs +59 -0
- package/dist/es/frameloop/on-next-frame.mjs +12 -0
- package/dist/es/gestures/PanSession.mjs +4 -3
- package/dist/es/gestures/drag/VisualElementDragControls.mjs +4 -5
- package/dist/es/gestures/drag/utils/constraints.mjs +1 -2
- package/dist/es/motion/features/layout/MeasureLayout.mjs +1 -1
- package/dist/es/projection/animation/mix-values.mjs +7 -8
- package/dist/es/projection/geometry/delta-remove.mjs +1 -1
- package/dist/es/projection/node/create-projection-node.mjs +1 -1
- package/dist/es/projection/styles/scale-border-radius.mjs +1 -1
- package/dist/es/projection/styles/scale-box-shadow.mjs +1 -1
- package/dist/es/render/VisualElement.mjs +1 -1
- package/dist/es/render/dom/utils/unit-conversion.mjs +2 -1
- package/dist/es/render/dom/value-types/animatable-none.mjs +2 -1
- package/dist/es/render/dom/value-types/defaults.mjs +2 -1
- package/dist/es/render/dom/value-types/dimensions.mjs +2 -1
- package/dist/es/render/dom/value-types/find.mjs +2 -1
- package/dist/es/render/dom/value-types/number.mjs +2 -1
- package/dist/es/render/dom/value-types/type-int.mjs +1 -1
- package/dist/es/render/svg/utils/path.mjs +1 -1
- package/dist/es/render/svg/utils/transform-origin.mjs +1 -1
- package/dist/es/render/utils/animation-state.mjs +1 -2
- package/dist/es/render/utils/motion-values.mjs +1 -1
- package/dist/es/render/utils/setters.mjs +1 -1
- package/dist/es/utils/delay.mjs +1 -1
- package/dist/es/utils/interpolate.mjs +1 -1
- package/dist/es/utils/mix-color.mjs +4 -1
- package/dist/es/utils/mix-complex.mjs +5 -24
- package/dist/es/utils/use-animation-frame.mjs +1 -1
- package/dist/es/utils/use-force-update.mjs +1 -1
- package/dist/es/utils/use-instant-transition.mjs +1 -1
- package/dist/es/value/index.mjs +4 -3
- package/dist/es/value/types/color/hex.mjs +40 -0
- package/dist/es/value/types/color/hsla.mjs +22 -0
- package/dist/es/value/types/color/index.mjs +28 -0
- package/dist/es/value/types/color/rgba.mjs +25 -0
- package/dist/es/value/types/color/utils.mjs +23 -0
- package/dist/es/value/types/complex/filter.mjs +30 -0
- package/dist/es/value/types/complex/index.mjs +61 -0
- package/dist/es/value/types/numbers/index.mjs +17 -0
- package/dist/es/value/types/numbers/units.mjs +19 -0
- package/dist/es/value/types/utils.mjs +15 -0
- package/dist/es/value/use-combine-values.mjs +1 -1
- package/dist/framer-motion.dev.js +304 -249
- package/dist/framer-motion.js +1 -1
- package/dist/index.d.ts +7 -2
- package/dist/projection.dev.js +5455 -5397
- package/dist/size-rollup-dom-animation-assets.js +1 -1
- package/dist/size-rollup-dom-animation.js +1 -1
- package/dist/size-rollup-dom-max-assets.js +1 -1
- package/dist/size-rollup-dom-max.js +1 -1
- package/dist/size-rollup-m.js +1 -1
- package/dist/size-rollup-motion.js +1 -1
- package/dist/size-webpack-dom-animation.js +1 -1
- package/dist/size-webpack-dom-max.js +1 -1
- package/dist/size-webpack-m.js +1 -1
- package/dist/three-entry.d.ts +7 -2
- package/package.json +9 -11
package/dist/framer-motion.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Motion={},t.React)}(this,(function(t,e){"use strict";function n(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}function o(t){if(t&&t.__esModule)return t;var e=Object.create(null);return t&&Object.keys(t).forEach((function(n){if("default"!==n){var o=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,o.get?o:{enumerable:!0,get:function(){return t[n]}})}})),e.default=t,Object.freeze(e)}var i=n(e),r=o(e);const s=e.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),a=e.createContext({});function l(){return e.useContext(a).visualElement}const u=e.createContext(null),c="undefined"!=typeof document,h=c?e.useLayoutEffect:e.useEffect,d=e.createContext({strict:!1});function p(t){return"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}function f(t){return"string"==typeof t||Array.isArray(t)}function m(t){return"object"==typeof t&&"function"==typeof t.start}const g=["initial","animate","exit","whileHover","whileDrag","whileTap","whileFocus","whileInView"];function v(t){return m(t.animate)||g.some(e=>f(t[e]))}function y(t){return Boolean(v(t)||t.variants)}function x(t){const{initial:n,animate:o}=function(t,e){if(v(t)){const{initial:e,animate:n}=t;return{initial:!1===e||f(e)?e:void 0,animate:f(n)?n:void 0}}return!1!==t.inherit?e:{}}(t,e.useContext(a));return e.useMemo(()=>({initial:n,animate:o}),[b(n),b(o)])}function b(t){return Array.isArray(t)?t.join(" "):t}const E=t=>({isEnabled:e=>t.some(t=>!!e[t])}),w={measureLayout:E(["layout","layoutId","drag"]),animation:E(["animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView"]),exit:E(["exit"]),drag:E(["drag","dragControls"]),focus:E(["whileFocus"]),hover:E(["whileHover","onHoverStart","onHoverEnd"]),tap:E(["whileTap","onTap","onTapStart","onTapCancel"]),pan:E(["onPan","onPanStart","onPanSessionStart","onPanEnd"]),inView:E(["whileInView","onViewportEnter","onViewportLeave"])};function P(t){for(const e in t)"projectionNodeConstructor"===e?w.projectionNodeConstructor=t[e]:w[e].Component=t[e]}function S(t){const n=e.useRef(null);return null===n.current&&(n.current=t()),n.current}const T={hasAnimatedSinceResize:!0,hasEverUpdated:!1};let A=1;const V=e.createContext({});class C extends i.default.Component{getSnapshotBeforeUpdate(){const{visualElement:t,props:e}=this.props;return t&&t.setProps(e),null}componentDidUpdate(){}render(){return this.props.children}}const M=e.createContext({}),R=Symbol.for("motionComponentSymbol");function L({preloadedFeatures:t,createVisualElement:n,projectionNodeConstructor:o,useRender:i,useVisualState:f,Component:m}){t&&P(t);const g=e.forwardRef((function(g,v){const y={...e.useContext(s),...g,layoutId:D(g)},{isStatic:b}=y;let E=null;const P=x(g),V=b?void 0:S(()=>{if(T.hasEverUpdated)return A++}),R=f(g,b);if(!b&&c){P.visualElement=function(t,n,o,i){const r=l(),a=e.useContext(d),c=e.useContext(u),p=e.useContext(s).reducedMotion,f=e.useRef();i=i||a.renderer,!f.current&&i&&(f.current=i(t,{visualState:n,parent:r,props:o,presenceId:c?c.id:void 0,blockInitialAnimation:!!c&&!1===c.initial,reducedMotionConfig:p}));const m=f.current;return h(()=>{m&&m.render()}),e.useEffect(()=>{m&&m.animationState&&m.animationState.animateChanges()}),h(()=>()=>m&&m.notify("Unmount"),[]),m}(m,R,y,n);const i=e.useContext(d).strict,r=e.useContext(M);P.visualElement&&(E=P.visualElement.loadFeatures(y,i,t,V,o||w.projectionNodeConstructor,r))}return r.createElement(C,{visualElement:P.visualElement,props:y},E,r.createElement(a.Provider,{value:P},i(m,g,V,function(t,n,o){return e.useCallback(e=>{e&&t.mount&&t.mount(e),n&&(e?n.mount(e):n.unmount()),o&&("function"==typeof o?o(e):p(o)&&(o.current=e))},[n])}(R,P.visualElement,v),R,b,P.visualElement)))}));return g[R]=m,g}function D({layoutId:t}){const n=e.useContext(V).id;return n&&void 0!==t?n+"-"+t:t}function k(t){function e(e,n={}){return L(t(e,n))}if("undefined"==typeof Proxy)return e;const n=new Map;return new Proxy(e,{get:(t,o)=>(n.has(o)||n.set(o,e(o)),n.get(o))})}const B=["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 O(t){return"string"==typeof t&&!t.includes("-")&&!!(B.indexOf(t)>-1||/[A-Z]/.test(t))}const j={};function F(t){Object.assign(j,t)}const I=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],U=new Set(I);function N(t,{layout:e,layoutId:n}){return U.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!j[t]||"opacity"===t)}const z=t=>!!(null==t?void 0:t.getVelocity),W={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},H=(t,e)=>I.indexOf(t)-I.indexOf(e);function $({transform:t,transformKeys:e},{enableHardwareAcceleration:n=!0,allowTransformNone:o=!0},i,r){let s="";e.sort(H);for(const n of e)s+=`${W[n]||n}(${t[n]}) `;return n&&!t.z&&(s+="translateZ(0)"),s=s.trim(),r?s=r(t,i?"":s):o&&i&&(s="none"),s}function Y(t){return t.startsWith("--")}const X=(t,e)=>e&&"number"==typeof t?e.transform(t):t,G=(t,e)=>n=>Math.max(Math.min(n,e),t),q=t=>t%1?Number(t.toFixed(5)):t,Z=/(-)?([\d]*\.?[\d])+/g,K=/(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,_=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function J(t){return"string"==typeof t}const Q={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},tt=Object.assign(Object.assign({},Q),{transform:G(0,1)}),et=Object.assign(Object.assign({},Q),{default:1}),nt=t=>({test:e=>J(e)&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),ot=nt("deg"),it=nt("%"),rt=nt("px"),st=nt("vh"),at=nt("vw"),lt=Object.assign(Object.assign({},it),{parse:t=>it.parse(t)/100,transform:t=>it.transform(100*t)}),ut=(t,e)=>n=>Boolean(J(n)&&_.test(n)&&n.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(n,e)),ct=(t,e,n)=>o=>{if(!J(o))return o;const[i,r,s,a]=o.match(Z);return{[t]:parseFloat(i),[e]:parseFloat(r),[n]:parseFloat(s),alpha:void 0!==a?parseFloat(a):1}},ht={test:ut("hsl","hue"),parse:ct("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:o=1})=>"hsla("+Math.round(t)+", "+it.transform(q(e))+", "+it.transform(q(n))+", "+q(tt.transform(o))+")"},dt=G(0,255),pt=Object.assign(Object.assign({},Q),{transform:t=>Math.round(dt(t))}),ft={test:ut("rgb","red"),parse:ct("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:o=1})=>"rgba("+pt.transform(t)+", "+pt.transform(e)+", "+pt.transform(n)+", "+q(tt.transform(o))+")"};const mt={test:ut("#"),parse:function(t){let e="",n="",o="",i="";return t.length>5?(e=t.substr(1,2),n=t.substr(3,2),o=t.substr(5,2),i=t.substr(7,2)):(e=t.substr(1,1),n=t.substr(2,1),o=t.substr(3,1),i=t.substr(4,1),e+=e,n+=n,o+=o,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(o,16),alpha:i?parseInt(i,16)/255:1}},transform:ft.transform},gt={test:t=>ft.test(t)||mt.test(t)||ht.test(t),parse:t=>ft.test(t)?ft.parse(t):ht.test(t)?ht.parse(t):mt.parse(t),transform:t=>J(t)?t:t.hasOwnProperty("red")?ft.transform(t):ht.transform(t)};function vt(t){"number"==typeof t&&(t=""+t);const e=[];let n=0;const o=t.match(K);o&&(n=o.length,t=t.replace(K,"${c}"),e.push(...o.map(gt.parse)));const i=t.match(Z);return i&&(t=t.replace(Z,"${n}"),e.push(...i.map(Q.parse))),{values:e,numColors:n,tokenised:t}}function yt(t){return vt(t).values}function xt(t){const{values:e,numColors:n,tokenised:o}=vt(t),i=e.length;return t=>{let e=o;for(let o=0;o<i;o++)e=e.replace(o<n?"${c}":"${n}",o<n?gt.transform(t[o]):q(t[o]));return e}}const bt=t=>"number"==typeof t?0:t;const Et={test:function(t){var e,n,o,i;return isNaN(t)&&J(t)&&(null!==(n=null===(e=t.match(Z))||void 0===e?void 0:e.length)&&void 0!==n?n:0)+(null!==(i=null===(o=t.match(K))||void 0===o?void 0:o.length)&&void 0!==i?i:0)>0},parse:yt,createTransformer:xt,getAnimatableNone:function(t){const e=yt(t);return xt(t)(e.map(bt))}},wt=new Set(["brightness","contrast","saturate","opacity"]);function Pt(t){let[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[o]=n.match(Z)||[];if(!o)return t;const i=n.replace(o,"");let r=wt.has(e)?1:0;return o!==n&&(r*=100),e+"("+r+i+")"}const St=/([a-z-]*)\(.*?\)/g,Tt=Object.assign(Object.assign({},Et),{getAnimatableNone:t=>{const e=t.match(St);return e?e.map(Pt).join(" "):t}}),At={...Q,transform:Math.round},Vt={borderWidth:rt,borderTopWidth:rt,borderRightWidth:rt,borderBottomWidth:rt,borderLeftWidth:rt,borderRadius:rt,radius:rt,borderTopLeftRadius:rt,borderTopRightRadius:rt,borderBottomRightRadius:rt,borderBottomLeftRadius:rt,width:rt,maxWidth:rt,height:rt,maxHeight:rt,size:rt,top:rt,right:rt,bottom:rt,left:rt,padding:rt,paddingTop:rt,paddingRight:rt,paddingBottom:rt,paddingLeft:rt,margin:rt,marginTop:rt,marginRight:rt,marginBottom:rt,marginLeft:rt,rotate:ot,rotateX:ot,rotateY:ot,rotateZ:ot,scale:et,scaleX:et,scaleY:et,scaleZ:et,skew:ot,skewX:ot,skewY:ot,distance:rt,translateX:rt,translateY:rt,translateZ:rt,x:rt,y:rt,z:rt,perspective:rt,transformPerspective:rt,opacity:tt,originX:lt,originY:lt,originZ:rt,zIndex:At,fillOpacity:tt,strokeOpacity:tt,numOctaves:At};function Ct(t,e,n,o){const{style:i,vars:r,transform:s,transformKeys:a,transformOrigin:l}=t;a.length=0;let u=!1,c=!1,h=!0;for(const t in e){const n=e[t];if(Y(t)){r[t]=n;continue}const o=Vt[t],d=X(n,o);if(U.has(t)){if(u=!0,s[t]=d,a.push(t),!h)continue;n!==(o.default||0)&&(h=!1)}else t.startsWith("origin")?(c=!0,l[t]=d):i[t]=d}if(e.transform||(u||o?i.transform=$(t,n,h,o):i.transform&&(i.transform="none")),c){const{originX:t="50%",originY:e="50%",originZ:n=0}=l;i.transformOrigin=`${t} ${e} ${n}`}}const Mt=()=>({style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}});function Rt(t,e,n){for(const o in e)z(e[o])||N(o,n)||(t[o]=e[o])}function Lt(t,n,o){const i={};return Rt(i,t.style||{},t),Object.assign(i,function({transformTemplate:t},n,o){return e.useMemo(()=>{const e={style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}};return Ct(e,n,{enableHardwareAcceleration:!o},t),Object.assign({},e.vars,e.style)},[n])}(t,n,o)),t.transformValues?t.transformValues(i):i}function Dt(t,e,n){const o={},i=Lt(t,e,n);return t.drag&&!1!==t.dragListener&&(o.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=!0===t.drag?"none":"pan-"+("x"===t.drag?"y":"x")),o.style=i,o}const kt=new Set(["initial","style","values","variants","transition","transformTemplate","transformValues","custom","inherit","layout","layoutId","layoutDependency","onLayoutAnimationStart","onLayoutAnimationComplete","onLayoutMeasure","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","drag","dragControls","dragListener","dragConstraints","dragDirectionLock","dragSnapToOrigin","_dragX","_dragY","dragElastic","dragMomentum","dragPropagation","dragTransition","onHoverStart","onHoverEnd","layoutScroll","whileInView","onViewportEnter","onViewportLeave","viewport","whileTap","onTap","onTapStart","onTapCancel","animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView","onPan","onPanStart","onPanSessionStart","onPanEnd"]);function Bt(t){return kt.has(t)}let Ot=t=>!Bt(t);function jt(t){t&&(Ot=e=>e.startsWith("on")?!Bt(e):t(e))}try{jt(require("@emotion/is-prop-valid").default)}catch(t){}function Ft(t,e,n){const o={};for(const i in t)(Ot(i)||!0===n&&Bt(i)||!e&&!Bt(i)||t.draggable&&i.startsWith("onDrag"))&&(o[i]=t[i]);return o}function It(t,e,n){return"string"==typeof t?t:rt.transform(e+n*t)}const Ut={offset:"stroke-dashoffset",array:"stroke-dasharray"},Nt={offset:"strokeDashoffset",array:"strokeDasharray"};function zt(t,{attrX:e,attrY:n,originX:o,originY:i,pathLength:r,pathSpacing:s=1,pathOffset:a=0,...l},u,c,h){if(Ct(t,l,u,h),c)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:d,style:p,dimensions:f}=t;d.transform&&(f&&(p.transform=d.transform),delete d.transform),f&&(void 0!==o||void 0!==i||p.transform)&&(p.transformOrigin=function(t,e,n){return`${It(e,t.x,t.width)} ${It(n,t.y,t.height)}`}(f,void 0!==o?o:.5,void 0!==i?i:.5)),void 0!==e&&(d.x=e),void 0!==n&&(d.y=n),void 0!==r&&function(t,e,n=1,o=0,i=!0){t.pathLength=1;const r=i?Ut:Nt;t[r.offset]=rt.transform(-o);const s=rt.transform(e),a=rt.transform(n);t[r.array]=`${s} ${a}`}(d,r,s,a,!1)}const Wt=()=>({style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{},attrs:{}}),Ht=t=>"string"==typeof t&&"svg"===t.toLowerCase();function $t(t,n,o,i){const r=e.useMemo(()=>{const e={style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{},attrs:{}};return zt(e,n,{enableHardwareAcceleration:!1},Ht(i),t.transformTemplate),{...e.attrs,style:{...e.style}}},[n]);if(t.style){const e={};Rt(e,t.style,t),r.style={...e,...r.style}}return r}function Yt(t=!1){return(n,o,i,r,{latestValues:s},a)=>{const l=(O(n)?$t:Dt)(o,s,a,n),u={...Ft(o,"string"==typeof n,t),...l,ref:r};return i&&(u["data-projection-id"]=i),e.createElement(n,u)}}const Xt=t=>t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();function Gt(t,{style:e,vars:n},o,i){Object.assign(t.style,e,i&&i.getProjectionStyles(o));for(const e in n)t.style.setProperty(e,n[e])}const qt=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function Zt(t,e,n,o){Gt(t,e,void 0,o);for(const n in e.attrs)t.setAttribute(qt.has(n)?n:Xt(n),e.attrs[n])}function Kt(t){const{style:e}=t,n={};for(const o in e)(z(e[o])||N(o,t))&&(n[o]=e[o]);return n}function _t(t){const e=Kt(t);for(const n in t)if(z(t[n])){e["x"===n||"y"===n?"attr"+n.toUpperCase():n]=t[n]}return e}function Jt(t,e,n,o={},i={}){return"function"==typeof e&&(e=e(void 0!==n?n:t.custom,o,i)),"string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e&&(e=e(void 0!==n?n:t.custom,o,i)),e}const Qt=t=>Array.isArray(t),te=t=>Qt(t)?t[t.length-1]||0:t;function ee(t){const e=z(t)?t.get():t;return n=e,Boolean(n&&"object"==typeof n&&n.mix&&n.toValue)?e.toValue():e;var n}const ne=t=>(n,o)=>{const i=e.useContext(a),r=e.useContext(u),s=()=>function({scrapeMotionValuesFromProps:t,createRenderState:e,onMount:n},o,i,r){const s={latestValues:oe(o,i,r,t),renderState:e()};return n&&(s.mount=t=>n(o,t,s)),s}(t,n,i,r);return o?s():S(s)};function oe(t,e,n,o){const i={},r=o(t);for(const t in r)i[t]=ee(r[t]);let{initial:s,animate:a}=t;const l=v(t),u=y(t);e&&u&&!l&&!1!==t.inherit&&(void 0===s&&(s=e.initial),void 0===a&&(a=e.animate));let c=!!n&&!1===n.initial;c=c||!1===s;const h=c?a:s;if(h&&"boolean"!=typeof h&&!m(h)){(Array.isArray(h)?h:[h]).forEach(e=>{const n=Jt(t,e);if(!n)return;const{transitionEnd:o,transition:r,...s}=n;for(const t in s){let e=s[t];if(Array.isArray(e)){e=e[c?e.length-1:0]}null!==e&&(i[t]=e)}for(const t in o)i[t]=o[t]})}return i}const ie={useVisualState:ne({scrapeMotionValuesFromProps:_t,createRenderState:Wt,onMount:(t,e,{renderState:n,latestValues:o})=>{try{n.dimensions="function"==typeof e.getBBox?e.getBBox():e.getBoundingClientRect()}catch(t){n.dimensions={x:0,y:0,width:0,height:0}}zt(n,o,{enableHardwareAcceleration:!1},Ht(e.tagName),t.transformTemplate),Zt(e,n)}})},re={useVisualState:ne({scrapeMotionValuesFromProps:Kt,createRenderState:Mt})};function se(t,{forwardMotionProps:e=!1},n,o,i){return{...O(t)?ie:re,preloadedFeatures:n,useRender:Yt(e),createVisualElement:o,projectionNodeConstructor:i,Component:t}}var ae;function le(t,e,n,o={passive:!0}){return t.addEventListener(e,n,o),()=>t.removeEventListener(e,n)}function ue(t,n,o,i){e.useEffect(()=>{const e=t.current;if(o&&e)return le(e,n,o,i)},[t,n,o,i])}function ce(t){return"undefined"!=typeof PointerEvent&&t instanceof PointerEvent?!("mouse"!==t.pointerType):t instanceof MouseEvent}function he(t){return!!t.touches}t.AnimationType=void 0,(ae=t.AnimationType||(t.AnimationType={})).Animate="animate",ae.Hover="whileHover",ae.Tap="whileTap",ae.Drag="whileDrag",ae.Focus="whileFocus",ae.InView="whileInView",ae.Exit="exit";const de={pageX:0,pageY:0};function pe(t,e="page"){const n=t.touches[0]||t.changedTouches[0]||de;return{x:n[e+"X"],y:n[e+"Y"]}}function fe(t,e="page"){return{x:t[e+"X"],y:t[e+"Y"]}}function me(t,e="page"){return{point:he(t)?pe(t,e):fe(t,e)}}const ge=(t,e=!1)=>{const n=e=>t(e,me(e));return e?(o=n,t=>{const e=t instanceof MouseEvent;(!e||e&&0===t.button)&&o(t)}):n;var o},ve={pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointercancel:"mousecancel",pointerover:"mouseover",pointerout:"mouseout",pointerenter:"mouseenter",pointerleave:"mouseleave"},ye={pointerdown:"touchstart",pointermove:"touchmove",pointerup:"touchend",pointercancel:"touchcancel"};function xe(t){return c&&null===window.onpointerdown?t:c&&null===window.ontouchstart?ye[t]:c&&null===window.onmousedown?ve[t]:t}function be(t,e,n,o){return le(t,xe(e),ge(n,"pointerdown"===e),o)}function Ee(t,e,n,o){return ue(t,xe(e),n&&ge(n,"pointerdown"===e),o)}function we(t){let e=null;return()=>{const n=()=>{e=null};return null===e&&(e=t,n)}}const Pe=we("dragHorizontal"),Se=we("dragVertical");function Te(t){let e=!1;if("y"===t)e=Se();else if("x"===t)e=Pe();else{const t=Pe(),n=Se();t&&n?e=()=>{t(),n()}:(t&&t(),n&&n())}return e}function Ae(){const t=Te(!0);return!t||(t(),!1)}function Ve(e,n,o){return(i,r)=>{ce(i)&&!Ae()&&(e.animationState&&e.animationState.setActive(t.AnimationType.Hover,n),o&&o(i,r))}}const Ce=(t,e)=>!!e&&(t===e||Ce(t,e.parentElement));function Me(t){return e.useEffect(()=>()=>t(),[])}const Re=(t,e)=>n=>e(t(n)),Le=(...t)=>t.reduce(Re);const De=("undefined"==typeof process||process.env,"production"),ke=new Set;function Be(t,e,n){t||ke.has(e)||(console.warn(e),n&&console.warn(n),ke.add(e))}const Oe=new WeakMap,je=new WeakMap,Fe=t=>{const e=Oe.get(t.target);e&&e(t)},Ie=t=>{t.forEach(Fe)};function Ue(t,e,n){const o=function({root:t,...e}){const n=t||document;je.has(n)||je.set(n,{});const o=je.get(n),i=JSON.stringify(e);return o[i]||(o[i]=new IntersectionObserver(Ie,{root:t,...e})),o[i]}(e);return Oe.set(t,n),o.observe(t),()=>{Oe.delete(t),o.unobserve(t)}}const Ne={some:0,all:1};function ze(n,o,i,{root:r,margin:s,amount:a="some",once:l}){e.useEffect(()=>{if(!n||!i.current)return;const e={root:null==r?void 0:r.current,rootMargin:s,threshold:"number"==typeof a?a:Ne[a]};return Ue(i.current,e,e=>{const{isIntersecting:n}=e;if(o.isInView===n)return;if(o.isInView=n,l&&!n&&o.hasEnteredView)return;n&&(o.hasEnteredView=!0),i.animationState&&i.animationState.setActive(t.AnimationType.InView,n);const r=i.getProps(),s=n?r.onViewportEnter:r.onViewportLeave;s&&s(e)})},[n,r,s,a])}function We(n,o,i,{fallback:r=!0}){e.useEffect(()=>{n&&r&&("production"!==De&&Be(!1,"IntersectionObserver not available on this device. whileInView animations will trigger on mount."),requestAnimationFrame(()=>{o.hasEnteredView=!0;const{onViewportEnter:e}=i.getProps();e&&e(null),i.animationState&&i.animationState.setActive(t.AnimationType.InView,!0)}))},[n])}const He=t=>e=>(t(e),null),$e={inView:He((function({visualElement:t,whileInView:n,onViewportEnter:o,onViewportLeave:i,viewport:r={}}){const s=e.useRef({hasEnteredView:!1,isInView:!1});let a=Boolean(n||o||i);r.once&&s.current.hasEnteredView&&(a=!1),("undefined"==typeof IntersectionObserver?We:ze)(a,s.current,t,r)})),tap:He((function({onTap:n,onTapStart:o,onTapCancel:i,whileTap:r,visualElement:s}){const a=n||o||i||r,l=e.useRef(!1),u=e.useRef(null),c={passive:!(o||n||i||m)};function h(){u.current&&u.current(),u.current=null}function d(){return h(),l.current=!1,s.animationState&&s.animationState.setActive(t.AnimationType.Tap,!1),!Ae()}function p(t,e){d()&&(Ce(s.current,t.target)?n&&n(t,e):i&&i(t,e))}function f(t,e){d()&&i&&i(t,e)}function m(e,n){h(),l.current||(l.current=!0,u.current=Le(be(window,"pointerup",p,c),be(window,"pointercancel",f,c)),s.animationState&&s.animationState.setActive(t.AnimationType.Tap,!0),o&&o(e,n))}Ee(s,"pointerdown",a?m:void 0,c),Me(h)})),focus:He((function({whileFocus:e,visualElement:n}){const{animationState:o}=n;ue(n,"focus",e?()=>{o&&o.setActive(t.AnimationType.Focus,!0)}:void 0),ue(n,"blur",e?()=>{o&&o.setActive(t.AnimationType.Focus,!1)}:void 0)})),hover:He((function({onHoverStart:t,onHoverEnd:e,whileHover:n,visualElement:o}){Ee(o,"pointerenter",t||n?Ve(o,!0,t):void 0,{passive:!t}),Ee(o,"pointerleave",e||n?Ve(o,!1,e):void 0,{passive:!e})}))};function Ye(){const t=e.useContext(u);if(null===t)return[!0,null];const{isPresent:n,onExitComplete:o,register:i}=t,r=e.useId();e.useEffect(()=>i(r),[]);return!n&&o?[!1,()=>o&&o(r)]:[!0]}function Xe(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let o=0;o<n;o++)if(e[o]!==t[o])return!1;return!0}const Ge=t=>1e3*t;const qe=t=>t,Ze=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function Ke(t,e,n,o){if(t===e&&n===o)return qe;const i=e=>function(t,e,n,o,i){let r,s,a=0;do{s=e+(n-e)/2,r=Ze(s,o,i)-t,r>0?n=s:e=s}while(Math.abs(r)>1e-7&&++a<12);return s}(e,0,1,t,n);return t=>0===t||1===t?t:Ze(i(t),e,o)}const _e=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Je=t=>e=>1-t(1-e),Qe=t=>t*t,tn=Je(Qe),en=_e(Qe),nn=t=>1-Math.sin(Math.acos(t)),on=Je(nn),rn=_e(on),sn=(t=1.525)=>e=>e*e*((t+1)*e-t),an=sn(),ln=Je(an),un=_e(an),cn=(t=>{const e=sn(t);return t=>(t*=2)<1?.5*e(t):.5*(2-Math.pow(2,-10*(t-1)))})(),hn={linear:qe,easeIn:Qe,easeInOut:en,easeOut:tn,circIn:nn,circInOut:rn,circOut:on,backIn:an,backInOut:un,backOut:ln,anticipate:cn},dn=t=>{if(Array.isArray(t)){t.length;const[e,n,o,i]=t;return Ke(e,n,o,i)}return"string"==typeof t?hn[t]:t},pn=(t,e)=>"zIndex"!==t&&(!("number"!=typeof e&&!Array.isArray(e))||!("string"!=typeof e||!Et.test(e)||e.startsWith("url("))),fn=()=>({type:"spring",stiffness:500,damping:25,restSpeed:10}),mn=t=>({type:"spring",stiffness:550,damping:0===t?2*Math.sqrt(550):30,restSpeed:10}),gn=()=>({type:"keyframes",ease:"linear",duration:.3}),vn=t=>({type:"keyframes",duration:.8,values:t}),yn={x:fn,y:fn,z:fn,rotate:fn,rotateX:fn,rotateY:fn,rotateZ:fn,scaleX:mn,scaleY:mn,scale:mn,opacity:gn,backgroundColor:gn,color:gn,default:mn},xn=(t,e)=>{let n;return n=Qt(e)?vn:yn[t]||yn.default,{to:e,...n(e)}},bn={...Vt,color:gt,backgroundColor:gt,outlineColor:gt,fill:gt,stroke:gt,borderColor:gt,borderTopColor:gt,borderRightColor:gt,borderBottomColor:gt,borderLeftColor:gt,filter:Tt,WebkitFilter:Tt},En=t=>bn[t];function wn(t,e){var n;let o=En(t);return o!==Tt&&(o=Et),null===(n=o.getAnimatableNone)||void 0===n?void 0:n.call(o,e)}const Pn={current:!1},Sn="undefined"!=typeof performance?()=>performance.now():()=>Date.now(),Tn="undefined"!=typeof window?t=>window.requestAnimationFrame(t):t=>setTimeout(()=>t(Sn()),1/60*1e3);let An=!0,Vn=!1,Cn=!1;const Mn={delta:0,timestamp:0},Rn=["read","update","preRender","render","postRender"],Ln=Rn.reduce((t,e)=>(t[e]=function(t){let e=[],n=[],o=0,i=!1,r=!1;const s=new WeakSet,a={schedule:(t,r=!1,a=!1)=>{const l=a&&i,u=l?e:n;return r&&s.add(t),-1===u.indexOf(t)&&(u.push(t),l&&i&&(o=e.length)),t},cancel:t=>{const e=n.indexOf(t);-1!==e&&n.splice(e,1),s.delete(t)},process:l=>{if(i)r=!0;else{if(i=!0,[e,n]=[n,e],n.length=0,o=e.length,o)for(let n=0;n<o;n++){const o=e[n];o(l),s.has(o)&&(a.schedule(o),t())}i=!1,r&&(r=!1,a.process(l))}}};return a}(()=>Vn=!0),t),{}),Dn=Rn.reduce((t,e)=>{const n=Ln[e];return t[e]=(t,e=!1,o=!1)=>(Vn||Fn(),n.schedule(t,e,o)),t},{}),kn=Rn.reduce((t,e)=>(t[e]=Ln[e].cancel,t),{}),Bn=Rn.reduce((t,e)=>(t[e]=()=>Ln[e].process(Mn),t),{}),On=t=>Ln[t].process(Mn),jn=t=>{Vn=!1,Mn.delta=An?1/60*1e3:Math.max(Math.min(t-Mn.timestamp,40),1),Mn.timestamp=t,Cn=!0,Rn.forEach(On),Cn=!1,Vn&&(An=!1,Tn(jn))},Fn=()=>{Vn=!0,An=!0,Cn||Tn(jn)},In=()=>Mn;function Un(t,e){const n=performance.now(),o=({timestamp:i})=>{const r=i-n;r>=e&&(kn.read(o),t(r-e))};return Dn.read(o,!0),()=>kn.read(o)}const Nn=(t,e,n)=>Math.min(Math.max(n,t),e),zn=(t,e,n)=>-n*t+n*e+t;function Wn(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}const Hn=(t,e,n)=>{const o=t*t;return Math.sqrt(Math.max(0,n*(e*e-o)+o))},$n=[mt,ft,ht];function Yn(t){const e=(n=t,$n.find(t=>t.test(n)));var n;let o=e.parse(t);return e===ht&&(o=function({hue:t,saturation:e,lightness:n,alpha:o}){t/=360,n/=100;let i=0,r=0,s=0;if(e/=100){const o=n<.5?n*(1+e):n+e-n*e,a=2*n-o;i=Wn(a,o,t+1/3),r=Wn(a,o,t),s=Wn(a,o,t-1/3)}else i=r=s=n;return{red:Math.round(255*i),green:Math.round(255*r),blue:Math.round(255*s),alpha:o}}(o)),o}const Xn=(t,e)=>{const n=Yn(t),o=Yn(e),i={...n};return t=>(i.red=Hn(n.red,o.red,t),i.green=Hn(n.green,o.green,t),i.blue=Hn(n.blue,o.blue,t),i.alpha=zn(n.alpha,o.alpha,t),ft.transform(i))};function Gn(t,e){return"number"==typeof t?n=>zn(t,e,n):gt.test(t)?Xn(t,e):_n(t,e)}const qn=(t,e)=>{const n=[...t],o=n.length,i=t.map((t,n)=>Gn(t,e[n]));return t=>{for(let e=0;e<o;e++)n[e]=i[e](t);return n}},Zn=(t,e)=>{const n={...t,...e},o={};for(const i in n)void 0!==t[i]&&void 0!==e[i]&&(o[i]=Gn(t[i],e[i]));return t=>{for(const e in o)n[e]=o[e](t);return n}};function Kn(t){const e=Et.parse(t),n=e.length;let o=0,i=0;for(let t=0;t<n;t++)o||"number"==typeof e[t]?o++:i++;return{parsed:e,numNumbers:o,numColors:i}}const _n=(t,e)=>{const n=Et.createTransformer(e),o=Kn(t),i=Kn(e);return o.numColors===i.numColors&&o.numNumbers>=i.numNumbers?Le(qn(o.parsed,i.parsed),n):n=>""+(n>0?e:t)},Jn=(t,e,n)=>{const o=e-t;return 0===o?1:(n-t)/o},Qn=(t,e)=>n=>zn(t,e,n);function to(t,e,n){const o=[],i=n||("number"==typeof(r=t[0])?Qn:"string"==typeof r?gt.test(r)?Xn:_n:Array.isArray(r)?qn:"object"==typeof r?Zn:Qn);var r;const s=t.length-1;for(let n=0;n<s;n++){let r=i(t[n],t[n+1]);if(e){const t=Array.isArray(e)?e[n]:e;r=Le(t,r)}o.push(r)}return o}function eo(t,e,{clamp:n=!0,ease:o,mixer:i}={}){const r=t.length;e.length,!o||!Array.isArray(o)||o.length,t[0]>t[r-1]&&(t=[...t].reverse(),e=[...e].reverse());const s=to(e,o,i),a=s.length,l=e=>{let n=0;if(a>1)for(;n<t.length-2&&!(e<t[n+1]);n++);const o=Jn(t[n],t[n+1],e);return s[n](o)};return n?e=>l(Nn(t[0],t[r-1],e)):l}function no(t,e){return t.map(()=>e||en).splice(0,t.length-1)}function oo({duration:t=800,bounce:e=.25,velocity:n=0,mass:o=1}){let i,r,s=1-e;s=Nn(.05,1,s),t=Nn(.01,10,t/1e3),s<1?(i=e=>{const o=e*s,i=o*t;return.001-(o-n)/io(e,s)*Math.exp(-i)},r=e=>{const o=e*s*t,r=o*n+n,a=Math.pow(s,2)*Math.pow(e,2)*t,l=Math.exp(-o),u=io(Math.pow(e,2),s);return(.001-i(e)>0?-1:1)*((r-a)*l)/u}):(i=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,r=e=>Math.exp(-e*t)*(t*t*(n-e)));const a=function(t,e,n){let o=n;for(let n=1;n<12;n++)o-=t(o)/e(o);return o}(i,r,5/t);if(t*=1e3,isNaN(a))return{stiffness:100,damping:10,duration:t};{const e=Math.pow(a,2)*o;return{stiffness:e,damping:2*s*Math.sqrt(o*e),duration:t}}}function io(t,e){return t*Math.sqrt(1-e*e)}const ro=["duration","bounce"],so=["stiffness","damping","mass"];function ao(t,e){return e.some(e=>void 0!==t[e])}function lo({from:t=0,to:e=1,restSpeed:n=2,restDelta:o=.01,...i}){const r={done:!1,value:t};let{stiffness:s,damping:a,mass:l,velocity:u,duration:c,isResolvedFromDuration:h}=function(t){let e={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...t};if(!ao(t,so)&&ao(t,ro)){const n=oo(t);e={...e,...n,velocity:0,mass:1},e.isResolvedFromDuration=!0}return e}(i),d=uo,p=uo;function f(){const n=u?-u/1e3:0,i=e-t,r=a/(2*Math.sqrt(s*l)),c=Math.sqrt(s/l)/1e3;if(void 0===o&&(o=Math.min(Math.abs(e-t)/100,.4)),r<1){const t=io(c,r);d=o=>{const s=Math.exp(-r*c*o);return e-s*((n+r*c*i)/t*Math.sin(t*o)+i*Math.cos(t*o))},p=e=>{const o=Math.exp(-r*c*e);return r*c*o*(Math.sin(t*e)*(n+r*c*i)/t+i*Math.cos(t*e))-o*(Math.cos(t*e)*(n+r*c*i)-t*i*Math.sin(t*e))}}else if(1===r)d=t=>e-Math.exp(-c*t)*(i+(n+c*i)*t);else{const t=c*Math.sqrt(r*r-1);d=o=>{const s=Math.exp(-r*c*o),a=Math.min(t*o,300);return e-s*((n+r*c*i)*Math.sinh(a)+t*i*Math.cosh(a))/t}}}return f(),{next:t=>{const i=d(t);if(h)r.done=t>=c;else{const s=1e3*p(t),a=Math.abs(s)<=n,l=Math.abs(e-i)<=o;r.done=a&&l}return r.value=r.done?e:i,r},flipTarget:()=>{u=-u,[t,e]=[e,t],f()}}}lo.needsInterpolation=(t,e)=>"string"==typeof t||"string"==typeof e;const uo=t=>0;const co={decay:function({velocity:t=0,from:e=0,power:n=.8,timeConstant:o=350,restDelta:i=.5,modifyTarget:r}){const s={done:!1,value:e};let a=n*t;const l=e+a,u=void 0===r?l:r(l);return u!==l&&(a=u-e),{next:t=>{const e=-a*Math.exp(-t/o);return s.done=!(e>i||e<-i),s.value=s.done?u:u+e,s},flipTarget:()=>{}}},keyframes:function({from:t=0,to:e=1,ease:n,offset:o,duration:i=300}){const r={done:!1,value:t},s=Array.isArray(e)?e:[t,e],a=function(t,e){return t.map(t=>t*e)}(o&&o.length===s.length?o:function(t){const e=t.length;return t.map((t,n)=>0!==n?n/(e-1):0)}(s),i);function l(){return eo(a,s,{ease:Array.isArray(n)?n:no(s,n)})}let u=l();return{next:t=>(r.value=u(t),r.done=t>=i,r),flipTarget:()=>{s.reverse(),u=l()}}},spring:lo};function ho(t,e,n=0){return t-e-n}const po=t=>{const e=({delta:e})=>t(e);return{start:()=>Dn.update(e,!0),stop:()=>kn.update(e)}};function fo({from:t,autoplay:e=!0,driver:n=po,elapsed:o=0,repeat:i=0,repeatType:r="loop",repeatDelay:s=0,onPlay:a,onStop:l,onComplete:u,onRepeat:c,onUpdate:h,type:d="keyframes",...p}){var f,m;let g,v,y,{to:x}=p,b=0,E=p.duration,w=!1,P=!0;const S=co[Array.isArray(x)?"keyframes":d];(null===(m=(f=S).needsInterpolation)||void 0===m?void 0:m.call(f,t,x))&&(y=eo([0,100],[t,x],{clamp:!1}),t=0,x=100);const T=S({...p,from:t,to:x});function A(){b++,"reverse"===r?(P=b%2==0,o=function(t,e=0,n=0,o=!0){return o?ho(e+-t,e,n):e-(t-e)+n}(o,E,s,P)):(o=ho(o,E,s),"mirror"===r&&T.flipTarget()),w=!1,c&&c()}function V(t){if(P||(t=-t),o+=t,!w){const t=T.next(Math.max(0,o));v=t.value,y&&(v=y(v)),w=P?t.done:o<=0}null==h||h(v),w&&(0===b&&(null!=E||(E=o)),b<i?function(t,e,n,o){return o?t>=e+n:t<=-n}(o,E,s,P)&&A():(g.stop(),u&&u()))}return e&&(null==a||a(),g=n(V),g.start()),{stop:()=>{null==l||l(),g.stop()}}}function mo(t,e){return e?t*(1e3/e):0}function go({ease:t,times:e,...n}){const o={...n};return e&&(o.offset=e),n.duration&&(o.duration=Ge(n.duration)),n.repeatDelay&&(o.repeatDelay=Ge(n.repeatDelay)),t&&(o.ease=(t=>Array.isArray(t)&&"number"!=typeof t[0])(t)?t.map(dn):dn(t)),"tween"===n.type&&(o.type="keyframes"),"spring"!==n.type&&(o.type="keyframes"),o}function vo(t,e,n){return Array.isArray(e.to)&&void 0===t.duration&&(t.duration=.8),function(t){Array.isArray(t.to)&&null===t.to[0]&&(t.to=[...t.to],t.to[0]=t.from)}(e),function({when:t,delay:e,delayChildren:n,staggerChildren:o,staggerDirection:i,repeat:r,repeatType:s,repeatDelay:a,from:l,...u}){return!!Object.keys(u).length}(t)||(t={...t,...xn(n,e.to)}),{...e,...go(t)}}function yo(t,e,n,o,i){const r=Eo(o,t)||{};let s=void 0!==r.from?r.from:e.get();const a=pn(t,n);"none"===s&&a&&"string"==typeof n?s=wn(t,n):xo(s)&&"string"==typeof n?s=bo(n):!Array.isArray(n)&&xo(n)&&"string"==typeof s&&(n=bo(s));return pn(t,s)&&a&&!1!==r.type?function(){const o={from:s,to:n,velocity:e.getVelocity(),onComplete:i,onUpdate:t=>e.set(t)};return"inertia"===r.type||"decay"===r.type?function({from:t=0,velocity:e=0,min:n,max:o,power:i=.8,timeConstant:r=750,bounceStiffness:s=500,bounceDamping:a=10,restDelta:l=1,modifyTarget:u,driver:c,onUpdate:h,onComplete:d,onStop:p}){let f;function m(t){return void 0!==n&&t<n||void 0!==o&&t>o}function g(t){return void 0===n?o:void 0===o||Math.abs(n-t)<Math.abs(o-t)?n:o}function v(t){null==f||f.stop(),f=fo({...t,driver:c,onUpdate:e=>{var n;null==h||h(e),null===(n=t.onUpdate)||void 0===n||n.call(t,e)},onComplete:d,onStop:p})}function y(t){v({type:"spring",stiffness:s,damping:a,restDelta:l,...t})}if(m(t))y({from:t,velocity:e,to:g(t)});else{let o=i*e+t;void 0!==u&&(o=u(o));const s=g(o),a=s===n?-1:1;let c,h;const d=t=>{c=h,h=t,e=mo(t-c,In().delta),(1===a&&t>s||-1===a&&t<s)&&y({from:t,to:s,velocity:e})};v({type:"decay",from:t,velocity:e,timeConstant:r,power:i,restDelta:l,modifyTarget:u,onUpdate:m(o)?d:void 0})}return{stop:()=>null==f?void 0:f.stop()}}({...o,...r}):fo({...vo(r,o,t),onUpdate:t=>{o.onUpdate(t),r.onUpdate&&r.onUpdate(t)},onComplete:()=>{o.onComplete(),r.onComplete&&r.onComplete()}})}:function(){const t=te(n);return e.set(t),i(),r.onUpdate&&r.onUpdate(t),r.onComplete&&r.onComplete(),{stop:()=>{}}}}function xo(t){return 0===t||"string"==typeof t&&0===parseFloat(t)&&-1===t.indexOf(" ")}function bo(t){return"number"==typeof t?0:wn("",t)}function Eo(t,e){return t[e]||t.default||t}function wo(t,e,n,o={}){return Pn.current&&(o={type:!1}),e.start(i=>{let r;const s=yo(t,e,n,o,i),a=function(t,e){var n,o;return null!==(o=null!==(n=(Eo(t,e)||{}).delay)&&void 0!==n?n:t.delay)&&void 0!==o?o:0}(o,t),l=()=>r=s();let u;return a?u=Un(l,Ge(a)):l(),()=>{u&&u(),r&&r.stop()}})}const Po=t=>/^0[^.\s]+$/.test(t);function So(t,e){-1===t.indexOf(e)&&t.push(e)}function To(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class Ao{constructor(){this.subscriptions=[]}add(t){return So(this.subscriptions,t),()=>To(this.subscriptions,t)}notify(t,e,n){const o=this.subscriptions.length;if(o)if(1===o)this.subscriptions[0](t,e,n);else for(let i=0;i<o;i++){const o=this.subscriptions[i];o&&o(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}class Vo{constructor(t){var e;this.version="7.7.0",this.timeDelta=0,this.lastUpdated=0,this.updateSubscribers=new Ao,this.velocityUpdateSubscribers=new Ao,this.renderSubscribers=new Ao,this.canTrackVelocity=!1,this.updateAndNotify=(t,e=!0)=>{this.prev=this.current,this.current=t;const{delta:n,timestamp:o}=In();this.lastUpdated!==o&&(this.timeDelta=n,this.lastUpdated=o,Dn.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.updateSubscribers.notify(this.current),this.velocityUpdateSubscribers.getSize()&&this.velocityUpdateSubscribers.notify(this.getVelocity()),e&&this.renderSubscribers.notify(this.current)},this.scheduleVelocityCheck=()=>Dn.postRender(this.velocityCheck),this.velocityCheck=({timestamp:t})=>{t!==this.lastUpdated&&(this.prev=this.current,this.velocityUpdateSubscribers.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e)))}onChange(t){return this.updateSubscribers.add(t)}clearListeners(){this.updateSubscribers.clear()}onRenderRequest(t){return t(this.get()),this.renderSubscribers.add(t)}attach(t){this.passiveEffect=t}set(t,e=!0){e&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?mo(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.stopAnimation=t(e)}).then(()=>this.clearAnimation())}stop(){this.stopAnimation&&this.stopAnimation(),this.clearAnimation()}isAnimating(){return!!this.stopAnimation}clearAnimation(){this.stopAnimation=null}destroy(){this.updateSubscribers.clear(),this.renderSubscribers.clear(),this.stop()}}function Co(t){return new Vo(t)}const Mo=t=>e=>e.test(t),Ro=[Q,rt,it,ot,at,st,{test:t=>"auto"===t,parse:t=>t}],Lo=t=>Ro.find(Mo(t)),Do=[...Ro,gt,Et],ko=t=>Do.find(Mo(t));function Bo(t,e,n){const o=t.getProps();return Jt(o,e,void 0!==n?n:o.custom,function(t){const e={};return t.values.forEach((t,n)=>e[n]=t.get()),e}(t),function(t){const e={};return t.values.forEach((t,n)=>e[n]=t.getVelocity()),e}(t))}function Oo(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Co(n))}function jo(t,e){const n=Bo(t,e);let{transitionEnd:o={},transition:i={},...r}=n?t.makeTargetAnimatable(n,!1):{};r={...r,...o};for(const e in r){Oo(t,e,te(r[e]))}}function Fo(t,e){[...e].reverse().forEach(n=>{var o;const i=t.getVariant(n);i&&jo(t,i),null===(o=t.variantChildren)||void 0===o||o.forEach(t=>{Fo(t,e)})})}function Io(t,e,n){var o,i;const r=Object.keys(e).filter(e=>!t.hasValue(e)),s=r.length;if(s)for(let a=0;a<s;a++){const s=r[a],l=e[s];let u=null;Array.isArray(l)&&(u=l[0]),null===u&&(u=null!==(i=null!==(o=n[s])&&void 0!==o?o:t.readValue(s))&&void 0!==i?i:e[s]),null!=u&&("string"==typeof u&&(/^\-?\d*\.?\d+$/.test(u)||Po(u))?u=parseFloat(u):!ko(u)&&Et.test(l)&&(u=wn(s,l)),t.addValue(s,Co(u)),void 0===n[s]&&(n[s]=u),null!==u&&t.setBaseTarget(s,u))}}function Uo(t,e){if(!e)return;return(e[t]||e.default||e).from}function No(t,e,n){var o;const i={};for(const r in t){const t=Uo(r,e);i[r]=void 0!==t?t:null===(o=n.getValue(r))||void 0===o?void 0:o.get()}return i}function zo(t){return Boolean(z(t)&&t.add)}function Wo(t,e,n={}){let o;if(t.notify("AnimationStart",e),Array.isArray(e)){const i=e.map(e=>Ho(t,e,n));o=Promise.all(i)}else if("string"==typeof e)o=Ho(t,e,n);else{const i="function"==typeof e?Bo(t,e,n.custom):e;o=$o(t,i,n)}return o.then(()=>t.notify("AnimationComplete",e))}function Ho(t,e,n={}){var o;const i=Bo(t,e,n.custom);let{transition:r=t.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(r=n.transitionOverride);const s=i?()=>$o(t,i,n):()=>Promise.resolve(),a=(null===(o=t.variantChildren)||void 0===o?void 0:o.size)?(o=0)=>{const{delayChildren:i=0,staggerChildren:s,staggerDirection:a}=r;return function(t,e,n=0,o=0,i=1,r){const s=[],a=(t.variantChildren.size-1)*o,l=1===i?(t=0)=>t*o:(t=0)=>a-t*o;return Array.from(t.variantChildren).sort(Yo).forEach((t,o)=>{s.push(Ho(t,e,{...r,delay:n+l(o)}).then(()=>t.notify("AnimationComplete",e)))}),Promise.all(s)}(t,e,i+o,s,a,n)}:()=>Promise.resolve(),{when:l}=r;if(l){const[t,e]="beforeChildren"===l?[s,a]:[a,s];return t().then(e)}return Promise.all([s(),a(n.delay)])}function $o(t,e,{delay:n=0,transitionOverride:o,type:i}={}){var r;let{transition:s=t.getDefaultTransition(),transitionEnd:a,...l}=t.makeTargetAnimatable(e);const u=t.getValue("willChange");o&&(s=o);const c=[],h=i&&(null===(r=t.animationState)||void 0===r?void 0:r.getState()[i]);for(const e in l){const o=t.getValue(e),i=l[e];if(!o||void 0===i||h&&Xo(h,e))continue;let r={delay:n,...s};t.shouldReduceMotion&&U.has(e)&&(r={...r,type:!1,delay:0});let a=wo(e,o,i,r);zo(u)&&(u.add(e),a=a.then(()=>u.remove(e))),c.push(a)}return Promise.all(c).then(()=>{a&&jo(t,a)})}function Yo(t,e){return t.sortNodePosition(e)}function Xo({protectedKeys:t,needsAnimating:e},n){const o=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,o}const Go=[t.AnimationType.Animate,t.AnimationType.InView,t.AnimationType.Focus,t.AnimationType.Hover,t.AnimationType.Tap,t.AnimationType.Drag,t.AnimationType.Exit],qo=[...Go].reverse(),Zo=Go.length;function Ko(e){let n=function(t){return e=>Promise.all(e.map(({animation:e,options:n})=>Wo(t,e,n)))}(e);const o={[t.AnimationType.Animate]:Jo(!0),[t.AnimationType.InView]:Jo(),[t.AnimationType.Hover]:Jo(),[t.AnimationType.Tap]:Jo(),[t.AnimationType.Drag]:Jo(),[t.AnimationType.Focus]:Jo(),[t.AnimationType.Exit]:Jo()};let i=!0;const r=(t,n)=>{const o=Bo(e,n);if(o){const{transition:e,transitionEnd:n,...i}=o;t={...t,...i,...n}}return t};function s(t,s){var a;const l=e.getProps(),u=e.getVariantContext(!0)||{},c=[],h=new Set;let d={},p=1/0;for(let n=0;n<Zo;n++){const g=qo[n],v=o[g],y=null!==(a=l[g])&&void 0!==a?a:u[g],x=f(y),b=g===s?v.isActive:null;!1===b&&(p=n);let E=y===u[g]&&y!==l[g]&&x;if(E&&i&&e.manuallyAnimateOnMount&&(E=!1),v.protectedKeys={...d},!v.isActive&&null===b||!y&&!v.prevProp||m(y)||"boolean"==typeof y)continue;const w=_o(v.prevProp,y);let P=w||g===s&&v.isActive&&!E&&x||n>p&&x;const S=Array.isArray(y)?y:[y];let T=S.reduce(r,{});!1===b&&(T={});const{prevResolvedValues:A={}}=v,V={...A,...T},C=t=>{P=!0,h.delete(t),v.needsAnimating[t]=!0};for(const t in V){const e=T[t],n=A[t];d.hasOwnProperty(t)||(e!==n?Qt(e)&&Qt(n)?!Xe(e,n)||w?C(t):v.protectedKeys[t]=!0:void 0!==e?C(t):h.add(t):void 0!==e&&h.has(t)?C(t):v.protectedKeys[t]=!0)}v.prevProp=y,v.prevResolvedValues=T,v.isActive&&(d={...d,...T}),i&&e.blockInitialAnimation&&(P=!1),P&&!E&&c.push(...S.map(e=>({animation:e,options:{type:g,...t}})))}if(h.size){const t={};h.forEach(n=>{const o=e.getBaseTarget(n);void 0!==o&&(t[n]=o)}),c.push({animation:t})}let g=Boolean(c.length);return i&&!1===l.initial&&!e.manuallyAnimateOnMount&&(g=!1),i=!1,g?n(c):Promise.resolve()}return{animateChanges:s,setActive:function(t,n,i){var r;if(o[t].isActive===n)return Promise.resolve();null===(r=e.variantChildren)||void 0===r||r.forEach(e=>{var o;return null===(o=e.animationState)||void 0===o?void 0:o.setActive(t,n)}),o[t].isActive=n;const a=s(i,t);for(const t in o)o[t].protectedKeys={};return a},setAnimateFunction:function(t){n=t(e)},getState:()=>o}}function _o(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!Xe(e,t)}function Jo(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}const Qo={animation:He(({visualElement:t,animate:n})=>{t.animationState||(t.animationState=Ko(t)),m(n)&&e.useEffect(()=>n.subscribe(t),[n])}),exit:He(n=>{const{custom:o,visualElement:i}=n,[r,s]=Ye(),a=e.useContext(u);e.useEffect(()=>{i.isPresent=r;const e=i.animationState&&i.animationState.setActive(t.AnimationType.Exit,!r,{custom:a&&a.custom||o});e&&!r&&e.then(s)},[r])})},ti=(t,e)=>Math.abs(t-e);function ei(t,e){const n=ti(t.x,e.x),o=ti(t.y,e.y);return Math.sqrt(n**2+o**2)}class ni{constructor(t,e,{transformPagePoint:n}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=()=>{if(!this.lastMoveEvent||!this.lastMoveEventInfo)return;const t=ri(this.lastMoveEventInfo,this.history),e=null!==this.startEvent,n=ei(t.offset,{x:0,y:0})>=3;if(!e&&!n)return;const{point:o}=t,{timestamp:i}=In();this.history.push({...o,timestamp:i});const{onStart:r,onMove:s}=this.handlers;e||(r&&r(this.lastMoveEvent,t),this.startEvent=this.lastMoveEvent),s&&s(this.lastMoveEvent,t)},this.handlePointerMove=(t,e)=>{this.lastMoveEvent=t,this.lastMoveEventInfo=oi(e,this.transformPagePoint),ce(t)&&0===t.buttons?this.handlePointerUp(t,e):Dn.update(this.updatePoint,!0)},this.handlePointerUp=(t,e)=>{this.end();const{onEnd:n,onSessionEnd:o}=this.handlers,i=ri(oi(e,this.transformPagePoint),this.history);this.startEvent&&n&&n(t,i),o&&o(t,i)},he(t)&&t.touches.length>1)return;this.handlers=e,this.transformPagePoint=n;const o=oi(me(t),this.transformPagePoint),{point:i}=o,{timestamp:r}=In();this.history=[{...i,timestamp:r}];const{onSessionStart:s}=e;s&&s(t,ri(o,this.history)),this.removeListeners=Le(be(window,"pointermove",this.handlePointerMove),be(window,"pointerup",this.handlePointerUp),be(window,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),kn.update(this.updatePoint)}}function oi(t,e){return e?{point:e(t.point)}:t}function ii(t,e){return{x:t.x-e.x,y:t.y-e.y}}function ri({point:t},e){return{point:t,delta:ii(t,ai(e)),offset:ii(t,si(e)),velocity:li(e,.1)}}function si(t){return t[0]}function ai(t){return t[t.length-1]}function li(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,o=null;const i=ai(t);for(;n>=0&&(o=t[n],!(i.timestamp-o.timestamp>Ge(e)));)n--;if(!o)return{x:0,y:0};const r=(i.timestamp-o.timestamp)/1e3;if(0===r)return{x:0,y:0};const s={x:(i.x-o.x)/r,y:(i.y-o.y)/r};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}function ui(t){return t.max-t.min}function ci(t,e=0,n=.01){return Math.abs(t-e)<=n}function hi(t,e,n,o=.5){t.origin=o,t.originPoint=zn(e.min,e.max,t.origin),t.scale=ui(n)/ui(e),(ci(t.scale,1,1e-4)||isNaN(t.scale))&&(t.scale=1),t.translate=zn(n.min,n.max,t.origin)-t.originPoint,(ci(t.translate)||isNaN(t.translate))&&(t.translate=0)}function di(t,e,n,o){hi(t.x,e.x,n.x,null==o?void 0:o.originX),hi(t.y,e.y,n.y,null==o?void 0:o.originY)}function pi(t,e,n){t.min=n.min+e.min,t.max=t.min+ui(e)}function fi(t,e,n){t.min=e.min-n.min,t.max=t.min+ui(e)}function mi(t,e,n){fi(t.x,e.x,n.x),fi(t.y,e.y,n.y)}function gi(t,e,n){return{min:void 0!==e?t.min+e:void 0,max:void 0!==n?t.max+n-(t.max-t.min):void 0}}function vi(t,e){let n=e.min-t.min,o=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,o]=[o,n]),{min:n,max:o}}const yi=.35;function xi(t,e,n){return{min:bi(t,e),max:bi(t,n)}}function bi(t,e){var n;return"number"==typeof t?t:null!==(n=t[e])&&void 0!==n?n:0}const Ei=()=>({x:{min:0,max:0},y:{min:0,max:0}});function wi(t){return[t("x"),t("y")]}function Pi({top:t,left:e,right:n,bottom:o}){return{x:{min:e,max:n},y:{min:t,max:o}}}function Si(t){return void 0===t||1===t}function Ti({scale:t,scaleX:e,scaleY:n}){return!Si(t)||!Si(e)||!Si(n)}function Ai(t){return Ti(t)||Vi(t)||t.z||t.rotate||t.rotateX||t.rotateY}function Vi(t){return Ci(t.x)||Ci(t.y)}function Ci(t){return t&&"0%"!==t}function Mi(t,e,n){return n+e*(t-n)}function Ri(t,e,n,o,i){return void 0!==i&&(t=Mi(t,i,o)),Mi(t,n,o)+e}function Li(t,e=0,n=1,o,i){t.min=Ri(t.min,e,n,o,i),t.max=Ri(t.max,e,n,o,i)}function Di(t,{x:e,y:n}){Li(t.x,e.translate,e.scale,e.originPoint),Li(t.y,n.translate,n.scale,n.originPoint)}function ki(t){return Number.isInteger(t)||t>1.0000000000001||t<.999999999999?t:1}function Bi(t,e){t.min=t.min+e,t.max=t.max+e}function Oi(t,e,[n,o,i]){const r=void 0!==e[i]?e[i]:.5,s=zn(t.min,t.max,r);Li(t,e[n],e[o],s,e.scale)}const ji=["x","scaleX","originX"],Fi=["y","scaleY","originY"];function Ii(t,e){Oi(t.x,e,ji),Oi(t.y,e,Fi)}function Ui(t,e){return Pi(function(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),o=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:o.y,right:o.x}}(t.getBoundingClientRect(),e))}const Ni=new WeakMap;class zi{constructor(t){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic={x:{min:0,max:0},y:{min:0,max:0}},this.visualElement=t}start(e,{snapToCursor:n=!1}={}){if(!1===this.visualElement.isPresent)return;this.panSession=new ni(e,{onSessionStart:t=>{this.stopAnimation(),n&&this.snapToCursor(me(t,"page").point)},onStart:(e,n)=>{var o;const{drag:i,dragPropagation:r,onDragStart:s}=this.getProps();(!i||r||(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=Te(i),this.openGlobalLock))&&(this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),wi(t=>{var e,n;let o=this.getAxisMotionValue(t).get()||0;if(it.test(o)){const i=null===(n=null===(e=this.visualElement.projection)||void 0===e?void 0:e.layout)||void 0===n?void 0:n.layoutBox[t];if(i){o=ui(i)*(parseFloat(o)/100)}}this.originPoint[t]=o}),null==s||s(e,n),null===(o=this.visualElement.animationState)||void 0===o||o.setActive(t.AnimationType.Drag,!0))},onMove:(t,e)=>{const{dragPropagation:n,dragDirectionLock:o,onDirectionLock:i,onDrag:r}=this.getProps();if(!n&&!this.openGlobalLock)return;const{offset:s}=e;if(o&&null===this.currentDirection)return this.currentDirection=function(t,e=10){let n=null;Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x");return n}(s),void(null!==this.currentDirection&&(null==i||i(this.currentDirection)));this.updateAxis("x",e.point,s),this.updateAxis("y",e.point,s),this.visualElement.render(),null==r||r(t,e)},onSessionEnd:(t,e)=>this.stop(t,e)},{transformPagePoint:this.visualElement.getTransformPagePoint()})}stop(t,e){const n=this.isDragging;if(this.cancel(),!n)return;const{velocity:o}=e;this.startAnimation(o);const{onDragEnd:i}=this.getProps();null==i||i(t,e)}cancel(){var e,n;this.isDragging=!1,this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!1),null===(e=this.panSession)||void 0===e||e.end(),this.panSession=void 0;const{dragPropagation:o}=this.getProps();!o&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),null===(n=this.visualElement.animationState)||void 0===n||n.setActive(t.AnimationType.Drag,!1)}updateAxis(t,e,n){const{drag:o}=this.getProps();if(!n||!Wi(t,o,this.currentDirection))return;const i=this.getAxisMotionValue(t);let r=this.originPoint[t]+n[t];this.constraints&&this.constraints[t]&&(r=function(t,{min:e,max:n},o){return void 0!==e&&t<e?t=o?zn(e,t,o.min):Math.max(t,e):void 0!==n&&t>n&&(t=o?zn(n,t,o.max):Math.min(t,n)),t}(r,this.constraints[t],this.elastic[t])),i.set(r)}resolveConstraints(){const{dragConstraints:t,dragElastic:e}=this.getProps(),{layout:n}=this.visualElement.projection||{},o=this.constraints;t&&p(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!n)&&function(t,{top:e,left:n,bottom:o,right:i}){return{x:gi(t.x,n,i),y:gi(t.y,e,o)}}(n.layoutBox,t),this.elastic=function(t=yi){return!1===t?t=0:!0===t&&(t=yi),{x:xi(t,"left","right"),y:xi(t,"top","bottom")}}(e),o!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&wi(t=>{this.getAxisMotionValue(t)&&(this.constraints[t]=function(t,e){const n={};return void 0!==e.min&&(n.min=e.min-t.min),void 0!==e.max&&(n.max=e.max-t.min),n}(n.layoutBox[t],this.constraints[t]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:e}=this.getProps();if(!t||!p(t))return!1;const n=t.current,{projection:o}=this.visualElement;if(!o||!o.layout)return!1;const i=function(t,e,n){const o=Ui(t,n),{scroll:i}=e;return i&&(Bi(o.x,i.offset.x),Bi(o.y,i.offset.y)),o}(n,o.root,this.visualElement.getTransformPagePoint());let r=function(t,e){return{x:vi(t.x,e.x),y:vi(t.y,e.y)}}(o.layout.layoutBox,i);if(e){const t=e(function({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}(r));this.hasMutatedConstraints=!!t,t&&(r=Pi(t))}return r}startAnimation(t){const{drag:e,dragMomentum:n,dragElastic:o,dragTransition:i,dragSnapToOrigin:r,onDragTransitionEnd:s}=this.getProps(),a=this.constraints||{},l=wi(s=>{var l;if(!Wi(s,e,this.currentDirection))return;let u=null!==(l=null==a?void 0:a[s])&&void 0!==l?l:{};r&&(u={min:0,max:0});const c=o?200:1e6,h=o?40:1e7,d={type:"inertia",velocity:n?t[s]:0,bounceStiffness:c,bounceDamping:h,timeConstant:750,restDelta:1,restSpeed:10,...i,...u};return this.startAxisValueAnimation(s,d)});return Promise.all(l).then(s)}startAxisValueAnimation(t,e){return wo(t,this.getAxisMotionValue(t),0,e)}stopAnimation(){wi(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){var e,n;const o="_drag"+t.toUpperCase(),i=this.visualElement.getProps()[o];return i||this.visualElement.getValue(t,null!==(n=null===(e=this.visualElement.getProps().initial)||void 0===e?void 0:e[t])&&void 0!==n?n:0)}snapToCursor(t){wi(e=>{const{drag:n}=this.getProps();if(!Wi(e,n,this.currentDirection))return;const{projection:o}=this.visualElement,i=this.getAxisMotionValue(e);if(o&&o.layout){const{min:n,max:r}=o.layout.layoutBox[e];i.set(t[e]-zn(n,r,.5))}})}scalePositionWithinConstraints(){var t;if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:o}=this.visualElement;if(!p(n)||!o||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};wi(t=>{const e=this.getAxisMotionValue(t);if(e){const n=e.get();i[t]=function(t,e){let n=.5;const o=ui(t),i=ui(e);return i>o?n=Jn(e.min,e.max-o,t.min):o>i&&(n=Jn(t.min,t.max-i,e.min)),Nn(0,1,n)}({min:n,max:n},this.constraints[t])}});const{transformTemplate:r}=this.visualElement.getProps();this.visualElement.current.style.transform=r?r({},""):"none",null===(t=o.root)||void 0===t||t.updateScroll(),o.updateLayout(),this.resolveConstraints(),wi(t=>{if(!Wi(t,e,null))return;const n=this.getAxisMotionValue(t),{min:o,max:r}=this.constraints[t];n.set(zn(o,r,i[t]))})}addListeners(){var t;if(!this.visualElement.current)return;Ni.set(this.visualElement,this);const e=be(this.visualElement.current,"pointerdown",t=>{const{drag:e,dragListener:n=!0}=this.getProps();e&&n&&this.start(t)}),n=()=>{const{dragConstraints:t}=this.getProps();p(t)&&(this.constraints=this.resolveRefConstraints())},{projection:o}=this.visualElement,i=o.addEventListener("measure",n);o&&!o.layout&&(null===(t=o.root)||void 0===t||t.updateScroll(),o.updateLayout()),n();const r=le(window,"resize",()=>this.scalePositionWithinConstraints()),s=o.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e})=>{this.isDragging&&e&&(wi(e=>{const n=this.getAxisMotionValue(e);n&&(this.originPoint[e]+=t[e].translate,n.set(n.get()+t[e].translate))}),this.visualElement.render())});return()=>{r(),e(),i(),null==s||s()}}getProps(){const t=this.visualElement.getProps(),{drag:e=!1,dragDirectionLock:n=!1,dragPropagation:o=!1,dragConstraints:i=!1,dragElastic:r=yi,dragMomentum:s=!0}=t;return{...t,drag:e,dragDirectionLock:n,dragPropagation:o,dragConstraints:i,dragElastic:r,dragMomentum:s}}}function Wi(t,e,n){return!(!0!==e&&e!==t||null!==n&&n!==t)}const Hi={pan:He((function({onPan:t,onPanStart:n,onPanEnd:o,onPanSessionStart:i,visualElement:r}){const a=t||n||o||i,l=e.useRef(null),{transformPagePoint:u}=e.useContext(s),c={onSessionStart:i,onStart:n,onMove:t,onEnd:(t,e)=>{l.current=null,o&&o(t,e)}};e.useEffect(()=>{null!==l.current&&l.current.updateHandlers(c)}),Ee(r,"pointerdown",a&&function(t){l.current=new ni(t,c,{transformPagePoint:u})}),Me(()=>l.current&&l.current.end())})),drag:He((function(t){const{dragControls:n,visualElement:o}=t,i=S(()=>new zi(o));e.useEffect(()=>n&&n.subscribe(i),[i,n]),e.useEffect(()=>i.addListeners(),[i])}))};function $i(t){return"string"==typeof t&&t.startsWith("var(--")}const Yi=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function Xi(t,e,n=1){const[o,i]=function(t){const e=Yi.exec(t);if(!e)return[,];const[,n,o]=e;return[n,o]}(t);if(!o)return;const r=window.getComputedStyle(e).getPropertyValue(o);return r?r.trim():$i(i)?Xi(i,e,n+1):i}const Gi=new Set(["width","height","top","left","right","bottom","x","y"]),qi=t=>Gi.has(t),Zi=(t,e)=>{t.set(e,!1),t.set(e)},Ki=t=>t===Q||t===rt;var _i;!function(t){t.width="width",t.height="height",t.left="left",t.right="right",t.top="top",t.bottom="bottom"}(_i||(_i={}));const Ji=(t,e)=>parseFloat(t.split(", ")[e]),Qi=(t,e)=>(n,{transform:o})=>{if("none"===o||!o)return 0;const i=o.match(/^matrix3d\((.+)\)$/);if(i)return Ji(i[1],e);{const e=o.match(/^matrix\((.+)\)$/);return e?Ji(e[1],t):0}},tr=new Set(["x","y","z"]),er=I.filter(t=>!tr.has(t));const nr={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:Qi(4,13),y:Qi(5,14)},or=(t,e,n={},o={})=>{e={...e},o={...o};const i=Object.keys(e).filter(qi);let r=[],s=!1;const a=[];if(i.forEach(i=>{const l=t.getValue(i);if(!t.hasValue(i))return;let u=n[i],c=Lo(u);const h=e[i];let d;if(Qt(h)){const t=h.length,e=null===h[0]?1:0;u=h[e],c=Lo(u);for(let n=e;n<t;n++)d?Lo(h[n]):d=Lo(h[n])}else d=Lo(h);if(c!==d)if(Ki(c)&&Ki(d)){const t=l.get();"string"==typeof t&&l.set(parseFloat(t)),"string"==typeof h?e[i]=parseFloat(h):Array.isArray(h)&&d===rt&&(e[i]=h.map(parseFloat))}else(null==c?void 0:c.transform)&&(null==d?void 0:d.transform)&&(0===u||0===h)?0===u?l.set(d.transform(u)):e[i]=c.transform(h):(s||(r=function(t){const e=[];return er.forEach(n=>{const o=t.getValue(n);void 0!==o&&(e.push([n,o.get()]),o.set(n.startsWith("scale")?1:0))}),e.length&&t.render(),e}(t),s=!0),a.push(i),o[i]=void 0!==o[i]?o[i]:e[i],Zi(l,h))}),a.length){const n=a.indexOf("height")>=0?window.pageYOffset:null,i=((t,e,n)=>{const o=e.measureViewportBox(),i=e.current,r=getComputedStyle(i),{display:s}=r,a={};"none"===s&&e.setStaticValue("display",t.display||"block"),n.forEach(t=>{a[t]=nr[t](o,r)}),e.render();const l=e.measureViewportBox();return n.forEach(n=>{const o=e.getValue(n);Zi(o,a[n]),t[n]=nr[n](l,r)}),t})(e,t,a);return r.length&&r.forEach(([e,n])=>{t.getValue(e).set(n)}),t.render(),c&&null!==n&&window.scrollTo({top:n}),{target:i,transitionEnd:o}}return{target:e,transitionEnd:o}};function ir(t,e,n,o){return(t=>Object.keys(t).some(qi))(e)?or(t,e,n,o):{target:e,transitionEnd:o}}const rr=(t,e,n,o)=>{const i=function(t,{...e},n){const o=t.current;if(!(o instanceof Element))return{target:e,transitionEnd:n};n&&(n={...n}),t.values.forEach(t=>{const e=t.get();if(!$i(e))return;const n=Xi(e,o);n&&t.set(n)});for(const t in e){const i=e[t];if(!$i(i))continue;const r=Xi(i,o);r&&(e[t]=r,n&&void 0===n[t]&&(n[t]=i))}return{target:e,transitionEnd:n}}(t,e,o);return ir(t,e=i.target,n,o=i.transitionEnd)},sr={current:null},ar={current:!1};function lr(){if(ar.current=!0,c)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>sr.current=t.matches;t.addListener(e),e()}else sr.current=!1}const ur=Object.keys(w),cr=ur.length,hr=["AnimationStart","AnimationComplete","Update","Unmount","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class dr{constructor({parent:t,props:e,reducedMotionConfig:n,visualState:o},i={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.isPresent=!0,this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.scheduleRender=()=>Dn.render(this.render,!1,!0);const{latestValues:r,renderState:s}=o;this.latestValues=r,this.baseTarget={...r},this.initialValues=e.initial?{...r}:{},this.renderState=s,this.parent=t,this.props=e,this.depth=t?t.depth+1:0,this.reducedMotionConfig=n,this.options=i,this.isControllingVariants=v(e),this.isVariantNode=y(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:a,...l}=this.scrapeMotionValuesFromProps(e);for(const t in l){const e=l[t];void 0!==r[t]&&z(e)&&(e.set(r[t],!1),zo(a)&&a.add(t))}}scrapeMotionValuesFromProps(t){return{}}mount(t){var e;this.current=t,this.projection&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=null===(e=this.parent)||void 0===e?void 0:e.addVariantChild(this)),this.values.forEach((t,e)=>this.bindToMotionValue(e,t)),ar.current||lr(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||sr.current),this.parent&&this.parent.children.add(this),this.setProps(this.props)}unmount(){var t,e,n;null===(t=this.projection)||void 0===t||t.unmount(),kn.update(this.notifyUpdate),kn.render(this.render),this.valueSubscriptions.forEach(t=>t()),null===(e=this.removeFromVariantTree)||void 0===e||e.call(this),null===(n=this.parent)||void 0===n||n.children.delete(this);for(const t in this.events)this.events[t].clear();this.current=null}bindToMotionValue(t,e){const n=U.has(t),o=e.onChange(e=>{this.latestValues[t]=e,this.props.onUpdate&&Dn.update(this.notifyUpdate,!1,!0),n&&this.projection&&(this.projection.isTransformDirty=!0)}),i=e.onRenderRequest(this.scheduleRender);this.valueSubscriptions.set(t,()=>{o(),i()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}loadFeatures(t,n,o,i,r,s){const a=[];for(let n=0;n<cr;n++){const o=ur[n],{isEnabled:i,Component:r}=w[o];i(t)&&r&&a.push(e.createElement(r,{key:o,...t,visualElement:this}))}if(!this.projection&&r){this.projection=new r(i,this.latestValues,this.parent&&this.parent.projection);const{layoutId:e,layout:n,drag:o,dragConstraints:a,layoutScroll:l}=t;this.projection.setOptions({layoutId:e,layout:n,alwaysMeasureLayout:Boolean(o)||a&&p(a),visualElement:this,scheduleRender:()=>this.scheduleRender(),animationType:"string"==typeof n?n:"both",initialPromotionConfig:s,layoutScroll:l})}return a}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}makeTargetAnimatable(t,e=!0){return this.makeTargetAnimatableFromInstance(t,this.props,e)}setProps(t){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.props=t;for(let e=0;e<hr.length;e++){const n=hr[e];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);const o=t["on"+n];o&&(this.propEventSubscriptions[n]=this.on(n,o))}this.prevMotionValues=function(t,e,n){const{willChange:o}=e;for(const i in e){const r=e[i],s=n[i];if(z(r))t.addValue(i,r),zo(o)&&o.add(i);else if(z(s))t.addValue(i,Co(r)),zo(o)&&o.remove(i);else if(s!==r)if(t.hasValue(i)){const e=t.getValue(i);!e.hasAnimated&&e.set(r)}else{const e=t.getStaticValue(i);t.addValue(i,Co(void 0!==e?e:r))}}for(const o in n)void 0===e[o]&&t.removeValue(o);return e}(this,this.scrapeMotionValuesFromProps(t),this.prevMotionValues)}getProps(){return this.props}getVariant(t){var e;return null===(e=this.props.variants)||void 0===e?void 0:e[t]}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){var t;return this.isVariantNode?this:null===(t=this.parent)||void 0===t?void 0:t.getClosestVariantNode()}getVariantContext(t=!1){var e,n;if(t)return null===(e=this.parent)||void 0===e?void 0:e.getVariantContext();if(!this.isControllingVariants){const t=(null===(n=this.parent)||void 0===n?void 0:n.getVariantContext())||{};return void 0!==this.props.initial&&(t.initial=this.props.initial),t}const o={};for(let t=0;t<fr;t++){const e=pr[t],n=this.props[e];(f(n)||!1===n)&&(o[e]=n)}return o}addVariantChild(t){var e;const n=this.getClosestVariantNode();if(n)return null===(e=n.variantChildren)||void 0===e||e.add(t),()=>n.variantChildren.delete(t)}addValue(t,e){this.hasValue(t)&&this.removeValue(t),this.values.set(t,e),this.latestValues[t]=e.get(),this.bindToMotionValue(t,e)}removeValue(t){var e;this.values.delete(t),null===(e=this.valueSubscriptions.get(t))||void 0===e||e(),this.valueSubscriptions.delete(t),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return void 0===n&&void 0!==e&&(n=Co(e),this.addValue(t,n)),n}readValue(t){return void 0===this.latestValues[t]&&this.current?this.readValueFromInstance(this.current,t,this.options):this.latestValues[t]}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){var e;const{initial:n}=this.props,o="string"==typeof n||"object"==typeof n?null===(e=Jt(this.props,n))||void 0===e?void 0:e[t]:void 0;if(n&&void 0!==o)return o;const i=this.getBaseTargetFromProps(this.props,t);return void 0===i||z(i)?void 0!==this.initialValues[t]&&void 0===o?void 0:this.baseTarget[t]:i}on(t,e){return this.events[t]||(this.events[t]=new Ao),this.events[t].add(e)}notify(t,...e){var n;null===(n=this.events[t])||void 0===n||n.notify(...e)}}const pr=["initial",...Go],fr=pr.length;class mr extends dr{sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){var n;return null===(n=t.style)||void 0===n?void 0:n[e]}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}makeTargetAnimatableFromInstance({transition:t,transitionEnd:e,...n},{transformValues:o},i){let r=No(n,t||{},this);if(o&&(e&&(e=o(e)),n&&(n=o(n)),r&&(r=o(r))),i){Io(this,n,r);const t=rr(this,n,r,e);e=t.transitionEnd,n=t.target}return{transition:t,transitionEnd:e,...n}}}class gr extends mr{readValueFromInstance(t,e){if(U.has(e)){const t=En(e);return t&&t.default||0}{const o=(n=t,window.getComputedStyle(n)),i=(Y(e)?o.getPropertyValue(e):o[e])||0;return"string"==typeof i?i.trim():i}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return Ui(t,e)}build(t,e,n,o){Ct(t,e,n,o.transformTemplate)}scrapeMotionValuesFromProps(t){return Kt(t)}renderInstance(t,e,n,o){Gt(t,e,n,o)}}class vr extends mr{constructor(){super(...arguments),this.isSVGTag=!1}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){var n;return U.has(e)?(null===(n=En(e))||void 0===n?void 0:n.default)||0:(e=qt.has(e)?e:Xt(e),t.getAttribute(e))}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}scrapeMotionValuesFromProps(t){return _t(t)}build(t,e,n,o){zt(t,e,n,this.isSVGTag,o.transformTemplate)}renderInstance(t,e,n,o){Zt(t,e,0,o)}mount(t){this.isSVGTag=Ht(t.tagName),super.mount(t)}}const yr=(t,e)=>O(t)?new vr(e,{enableHardwareAcceleration:!1}):new gr(e,{enableHardwareAcceleration:!0});function xr(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const br={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!rt.test(t))return t;t=parseFloat(t)}return`${xr(t,e.target.x)}% ${xr(t,e.target.y)}%`}},Er={correct:(t,{treeScale:e,projectionDelta:n})=>{const o=t,i=t.includes("var("),r=[];i&&(t=t.replace(Yi,t=>(r.push(t),"_$css")));const s=Et.parse(t);if(s.length>5)return o;const a=Et.createTransformer(t),l="number"!=typeof s[0]?1:0,u=n.x.scale*e.x,c=n.y.scale*e.y;s[0+l]/=u,s[1+l]/=c;const h=zn(u,c,.5);"number"==typeof s[2+l]&&(s[2+l]/=h),"number"==typeof s[3+l]&&(s[3+l]/=h);let d=a(s);if(i){let t=0;d=d.replace("_$css",()=>{const e=r[t];return t++,e})}return d}};class wr extends i.default.Component{componentDidMount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n,layoutId:o}=this.props,{projection:i}=t;F(Pr),i&&(e.group&&e.group.add(i),n&&n.register&&o&&n.register(i),i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,onExitComplete:()=>this.safeToRemove()})),T.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:e,visualElement:n,drag:o,isPresent:i}=this.props,r=n.projection;return r?(r.isPresent=i,o||t.layoutDependency!==e||void 0===e?r.willUpdate():this.safeToRemove(),t.isPresent!==i&&(i?r.promote():r.relegate()||Dn.postRender(()=>{var t;(null===(t=r.getStack())||void 0===t?void 0:t.members.length)||this.safeToRemove()})),null):null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),!t.currentAnimation&&t.isLead()&&this.safeToRemove())}componentWillUnmount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n}=this.props,{projection:o}=t;o&&(o.scheduleCheckAfterUnmount(),(null==e?void 0:e.group)&&e.group.remove(o),(null==n?void 0:n.deregister)&&n.deregister(o))}safeToRemove(){const{safeToRemove:t}=this.props;null==t||t()}render(){return null}}const Pr={borderRadius:{...br,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:br,borderTopRightRadius:br,borderBottomLeftRadius:br,borderBottomRightRadius:br,boxShadow:Er},Sr={measureLayout:function(t){const[n,o]=Ye(),r=e.useContext(V);return i.default.createElement(wr,{...t,layoutGroup:r,switchLayoutGroup:e.useContext(M),isPresent:n,safeToRemove:o})}};function Tr(t,e,n={}){const o=z(t)?t:Co(t);return wo("",o,e,n),{stop:()=>o.stop(),isAnimating:()=>o.isAnimating()}}const Ar=["TopLeft","TopRight","BottomLeft","BottomRight"],Vr=Ar.length,Cr=t=>"string"==typeof t?parseFloat(t):t,Mr=t=>"number"==typeof t||rt.test(t);function Rr(t,e){var n;return null!==(n=t[e])&&void 0!==n?n:t.borderRadius}const Lr=kr(0,.5,on),Dr=kr(.5,.95,qe);function kr(t,e,n){return o=>o<t?0:o>e?1:n(Jn(t,e,o))}function Br(t,e){t.min=e.min,t.max=e.max}function Or(t,e){Br(t.x,e.x),Br(t.y,e.y)}function jr(t,e,n,o,i){return t=Mi(t-=e,1/n,o),void 0!==i&&(t=Mi(t,1/i,o)),t}function Fr(t,e,[n,o,i],r,s){!function(t,e=0,n=1,o=.5,i,r=t,s=t){if(it.test(e)){e=parseFloat(e);e=zn(s.min,s.max,e/100)-s.min}if("number"!=typeof e)return;let a=zn(r.min,r.max,o);t===r&&(a-=e),t.min=jr(t.min,e,n,a,i),t.max=jr(t.max,e,n,a,i)}(t,e[n],e[o],e[i],e.scale,r,s)}const Ir=["x","scaleX","originX"],Ur=["y","scaleY","originY"];function Nr(t,e,n,o){Fr(t.x,e,Ir,null==n?void 0:n.x,null==o?void 0:o.x),Fr(t.y,e,Ur,null==n?void 0:n.y,null==o?void 0:o.y)}function zr(t){return 0===t.translate&&1===t.scale}function Wr(t){return zr(t.x)&&zr(t.y)}function Hr(t,e){return t.x.min===e.x.min&&t.x.max===e.x.max&&t.y.min===e.y.min&&t.y.max===e.y.max}function $r(t){return ui(t.x)/ui(t.y)}class Yr{constructor(){this.members=[]}add(t){So(this.members,t),t.scheduleRender()}remove(t){if(To(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const t=this.members[this.members.length-1];t&&this.promote(t)}}relegate(t){const e=this.members.findIndex(e=>t===e);if(0===e)return!1;let n;for(let t=e;t>=0;t--){const e=this.members[t];if(!1!==e.isPresent){n=e;break}}return!!n&&(this.promote(n),!0)}promote(t,e){var n;const o=this.lead;if(t!==o&&(this.prevLead=o,this.lead=t,t.show(),o)){o.instance&&o.scheduleRender(),t.scheduleRender(),t.resumeFrom=o,e&&(t.resumeFrom.preserveOpacity=!0),o.snapshot&&(t.snapshot=o.snapshot,t.snapshot.latestValues=o.animationValues||o.latestValues),(null===(n=t.root)||void 0===n?void 0:n.isUpdating)&&(t.isLayoutDirty=!0);const{crossfade:i}=t.options;!1===i&&o.hide()}}exitAnimationComplete(){this.members.forEach(t=>{var e,n,o,i,r;null===(n=(e=t.options).onExitComplete)||void 0===n||n.call(e),null===(r=null===(o=t.resumingFrom)||void 0===o?void 0:(i=o.options).onExitComplete)||void 0===r||r.call(i)})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function Xr(t,e,n){let o="";const i=t.x.translate/e.x,r=t.y.translate/e.y;if((i||r)&&(o=`translate3d(${i}px, ${r}px, 0) `),1===e.x&&1===e.y||(o+=`scale(${1/e.x}, ${1/e.y}) `),n){const{rotate:t,rotateX:e,rotateY:i}=n;t&&(o+=`rotate(${t}deg) `),e&&(o+=`rotateX(${e}deg) `),i&&(o+=`rotateY(${i}deg) `)}const s=t.x.scale*e.x,a=t.y.scale*e.y;return 1===s&&1===a||(o+=`scale(${s}, ${a})`),o||"none"}const Gr=(t,e)=>t.depth-e.depth;class qr{constructor(){this.children=[],this.isDirty=!1}add(t){So(this.children,t),this.isDirty=!0}remove(t){To(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Gr),this.isDirty=!1,this.children.forEach(t)}}const Zr=["","X","Y","Z"];let Kr=0;function _r({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:o,resetTransform:i}){return class{constructor(t,n={},o=(null==e?void 0:e())){this.id=Kr++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isTransformDirty=!1,this.isProjectionDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.potentialNodes=new Map,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.nodes.forEach(ts),this.nodes.forEach(rs),this.nodes.forEach(ss)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.elementId=t,this.latestValues=n,this.root=o?o.root||o:this,this.path=o?[...o.path,o]:[],this.parent=o,this.depth=o?o.depth+1:0,t&&this.root.registerPotentialNode(t,this);for(let t=0;t<this.path.length;t++)this.path[t].shouldResetTransform=!0;this.root===this&&(this.nodes=new qr)}addEventListener(t,e){return this.eventHandlers.has(t)||this.eventHandlers.set(t,new Ao),this.eventHandlers.get(t).add(e)}notifyListeners(t,...e){const n=this.eventHandlers.get(t);null==n||n.notify(...e)}hasListeners(t){return this.eventHandlers.has(t)}registerPotentialNode(t,e){this.potentialNodes.set(t,e)}mount(e,n=!1){var o;if(this.instance)return;this.isSVG=e instanceof SVGElement&&"svg"!==e.tagName,this.instance=e;const{layoutId:i,layout:r,visualElement:s}=this.options;if(s&&!s.current&&s.mount(e),this.root.nodes.add(this),null===(o=this.parent)||void 0===o||o.children.add(this),this.elementId&&this.root.potentialNodes.delete(this.elementId),n&&(r||i)&&(this.isLayoutDirty=!0),t){let n;const o=()=>this.root.updateBlockedByResize=!1;t(e,()=>{this.root.updateBlockedByResize=!0,n&&n(),n=Un(o,250),T.hasAnimatedSinceResize&&(T.hasAnimatedSinceResize=!1,this.nodes.forEach(is))})}i&&this.root.registerSharedNode(i,this),!1!==this.options.animate&&s&&(i||r)&&this.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e,hasRelativeTargetChanged:n,layout:o})=>{var i,r,a,l,u;if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const c=null!==(r=null!==(i=this.options.transition)&&void 0!==i?i:s.getDefaultTransition())&&void 0!==r?r:ds,{onLayoutAnimationStart:h,onLayoutAnimationComplete:d}=s.getProps(),p=!this.targetLayout||!Hr(this.targetLayout,o)||n,f=!e&&n;if((null===(a=this.resumeFrom)||void 0===a?void 0:a.instance)||f||e&&(p||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(t,f);const e={...Eo(c,"layout"),onPlay:h,onComplete:d};s.shouldReduceMotion&&(e.delay=0,e.type=!1),this.startAnimation(e)}else e||0!==this.animationProgress||is(this),this.isLead()&&(null===(u=(l=this.options).onExitComplete)||void 0===u||u.call(l));this.targetLayout=o})}unmount(){var t,e;this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this),null===(t=this.getStack())||void 0===t||t.remove(this),null===(e=this.parent)||void 0===e||e.children.delete(this),this.instance=void 0,kn.preRender(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){var t;return this.isAnimationBlocked||(null===(t=this.parent)||void 0===t?void 0:t.isTreeAnimationBlocked())||!1}startUpdate(){var t;this.isUpdateBlocked()||(this.isUpdating=!0,null===(t=this.nodes)||void 0===t||t.forEach(as),this.animationId++)}willUpdate(t=!0){var e,n,o;if(this.root.isUpdateBlocked())return void(null===(n=(e=this.options).onExitComplete)||void 0===n||n.call(e));if(!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let t=0;t<this.path.length;t++){const e=this.path[t];e.shouldResetTransform=!0,e.updateScroll("snapshot")}const{layoutId:i,layout:r}=this.options;if(void 0===i&&!r)return;const s=null===(o=this.options.visualElement)||void 0===o?void 0:o.getProps().transformTemplate;this.prevTransformTemplateValue=null==s?void 0:s(this.latestValues,""),this.updateSnapshot(),t&&this.notifyListeners("willUpdate")}didUpdate(){if(this.isUpdateBlocked())return this.unblockUpdate(),this.clearAllSnapshots(),void this.nodes.forEach(ns);this.isUpdating&&(this.isUpdating=!1,this.potentialNodes.size&&(this.potentialNodes.forEach(ps),this.potentialNodes.clear()),this.nodes.forEach(os),this.nodes.forEach(Jr),this.nodes.forEach(Qr),this.clearAllSnapshots(),Bn.update(),Bn.preRender(),Bn.render())}clearAllSnapshots(){this.nodes.forEach(es),this.sharedNodes.forEach(ls)}scheduleUpdateProjection(){Dn.preRender(this.updateProjection,!1,!0)}scheduleCheckAfterUnmount(){Dn.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure())}updateLayout(){var t;if(!this.instance)return;if(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let t=0;t<this.path.length;t++){this.path[t].updateScroll()}const e=this.layout;this.layout=this.measure(!1),this.layoutCorrected={x:{min:0,max:0},y:{min:0,max:0}},this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox),null===(t=this.options.visualElement)||void 0===t||t.notify("LayoutMeasure",this.layout.layoutBox,null==e?void 0:e.layoutBox)}updateScroll(t="measure"){let e=Boolean(this.options.layoutScroll&&this.instance);this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===t&&(e=!1),e&&(this.scroll={animationId:this.root.animationId,phase:t,isRoot:o(this.instance),offset:n(this.instance)})}resetTransform(){var t;if(!i)return;const e=this.isLayoutDirty||this.shouldResetTransform,n=this.projectionDelta&&!Wr(this.projectionDelta),o=null===(t=this.options.visualElement)||void 0===t?void 0:t.getProps().transformTemplate,r=null==o?void 0:o(this.latestValues,""),s=r!==this.prevTransformTemplateValue;e&&(n||Ai(this.latestValues)||s)&&(i(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(t=!0){const e=this.measurePageBox();let n=this.removeElementScroll(e);var o;return t&&(n=this.removeTransform(n)),fs((o=n).x),fs(o.y),{animationId:this.root.animationId,measuredBox:e,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:t}=this.options;if(!t)return{x:{min:0,max:0},y:{min:0,max:0}};const e=t.measureViewportBox(),{scroll:n}=this.root;return n&&(Bi(e.x,n.offset.x),Bi(e.y,n.offset.y)),e}removeElementScroll(t){const e={x:{min:0,max:0},y:{min:0,max:0}};Or(e,t);for(let n=0;n<this.path.length;n++){const o=this.path[n],{scroll:i,options:r}=o;if(o!==this.root&&i&&r.layoutScroll){if(i.isRoot){Or(e,t);const{scroll:n}=this.root;n&&(Bi(e.x,-n.offset.x),Bi(e.y,-n.offset.y))}Bi(e.x,i.offset.x),Bi(e.y,i.offset.y)}}return e}applyTransform(t,e=!1){const n={x:{min:0,max:0},y:{min:0,max:0}};Or(n,t);for(let t=0;t<this.path.length;t++){const o=this.path[t];!e&&o.options.layoutScroll&&o.scroll&&o!==o.root&&Ii(n,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),Ai(o.latestValues)&&Ii(n,o.latestValues)}return Ai(this.latestValues)&&Ii(n,this.latestValues),n}removeTransform(t){var e;const n={x:{min:0,max:0},y:{min:0,max:0}};Or(n,t);for(let t=0;t<this.path.length;t++){const o=this.path[t];if(!o.instance)continue;if(!Ai(o.latestValues))continue;Ti(o.latestValues)&&o.updateSnapshot();const i={x:{min:0,max:0},y:{min:0,max:0}};Or(i,o.measurePageBox()),Nr(n,o.latestValues,null===(e=o.snapshot)||void 0===e?void 0:e.layoutBox,i)}return Ai(this.latestValues)&&Nr(n,this.latestValues),n}setTargetDelta(t){this.targetDelta=t,this.isProjectionDirty=!0,this.root.scheduleUpdateProjection()}setOptions(t){this.options={...this.options,...t,crossfade:void 0===t.crossfade||t.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}resolveTargetDelta(){var t;const e=this.getLead();if(this.isProjectionDirty||(this.isProjectionDirty=e.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=e.isTransformDirty),!this.isProjectionDirty&&!this.attemptToResolveRelativeTarget)return;const{layout:n,layoutId:o}=this.options;if(this.layout&&(n||o)){if(!this.targetDelta&&!this.relativeTarget){const t=this.getClosestProjectingParent();t&&t.layout?(this.relativeParent=t,this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},mi(this.relativeTargetOrigin,this.layout.layoutBox,t.layout.layoutBox),Or(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}var i,r,s;if(this.relativeTarget||this.targetDelta)if(this.target||(this.target={x:{min:0,max:0},y:{min:0,max:0}},this.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}}),this.relativeTarget&&this.relativeTargetOrigin&&(null===(t=this.relativeParent)||void 0===t?void 0:t.target)?(i=this.target,r=this.relativeTarget,s=this.relativeParent.target,pi(i.x,r.x,s.x),pi(i.y,r.y,s.y)):this.targetDelta?(Boolean(this.resumingFrom)?this.target=this.applyTransform(this.layout.layoutBox):Or(this.target,this.layout.layoutBox),Di(this.target,this.targetDelta)):Or(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const t=this.getClosestProjectingParent();t&&Boolean(t.resumingFrom)===Boolean(this.resumingFrom)&&!t.options.layoutScroll&&t.target?(this.relativeParent=t,this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},mi(this.relativeTargetOrigin,this.target,t.target),Or(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(this.parent&&!Ti(this.parent.latestValues)&&!Vi(this.parent.latestValues))return(this.parent.relativeTarget||this.parent.targetDelta)&&this.parent.layout?this.parent:this.parent.getClosestProjectingParent()}calcProjection(){var t;const{isProjectionDirty:e,isTransformDirty:n}=this;this.isProjectionDirty=this.isTransformDirty=!1;const o=this.getLead(),i=Boolean(this.resumingFrom)||this!==o;let r=!0;if(e&&(r=!1),i&&n&&(r=!1),r)return;const{layout:s,layoutId:a}=this.options;if(this.isTreeAnimating=Boolean((null===(t=this.parent)||void 0===t?void 0:t.isTreeAnimating)||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!s&&!a)return;Or(this.layoutCorrected,this.layout.layoutBox),function(t,e,n,o=!1){var i,r;const s=n.length;if(!s)return;let a,l;e.x=e.y=1;for(let u=0;u<s;u++)a=n[u],l=a.projectionDelta,"contents"!==(null===(r=null===(i=a.instance)||void 0===i?void 0:i.style)||void 0===r?void 0:r.display)&&(o&&a.options.layoutScroll&&a.scroll&&a!==a.root&&Ii(t,{x:-a.scroll.offset.x,y:-a.scroll.offset.y}),l&&(e.x*=l.x.scale,e.y*=l.y.scale,Di(t,l)),o&&Ai(a.latestValues)&&Ii(t,a.latestValues));e.x=ki(e.x),e.y=ki(e.y)}(this.layoutCorrected,this.treeScale,this.path,i);const{target:l}=o;if(!l)return;this.projectionDelta||(this.projectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDeltaWithTransform={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}});const u=this.treeScale.x,c=this.treeScale.y,h=this.projectionTransform;di(this.projectionDelta,this.layoutCorrected,l,this.latestValues),this.projectionTransform=Xr(this.projectionDelta,this.treeScale),this.projectionTransform===h&&this.treeScale.x===u&&this.treeScale.y===c||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",l))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(t=!0){var e,n,o;null===(n=(e=this.options).scheduleRender)||void 0===n||n.call(e),t&&(null===(o=this.getStack())||void 0===o||o.scheduleRender()),this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}setAnimationOrigin(t,e=!1){var n,o;const i=this.snapshot,r=(null==i?void 0:i.latestValues)||{},s={...this.latestValues},a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};this.relativeTarget=this.relativeTargetOrigin=void 0,this.attemptToResolveRelativeTarget=!e;const l={x:{min:0,max:0},y:{min:0,max:0}},u=(null==i?void 0:i.source)!==(null===(n=this.layout)||void 0===n?void 0:n.source),c=((null===(o=this.getStack())||void 0===o?void 0:o.members.length)||0)<=1,h=Boolean(u&&!c&&!0===this.options.crossfade&&!this.path.some(hs));this.animationProgress=0,this.mixTargetDelta=e=>{var n;const o=e/1e3;var i,d,p,f;us(a.x,t.x,o),us(a.y,t.y,o),this.setTargetDelta(a),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&(null===(n=this.relativeParent)||void 0===n?void 0:n.layout)&&(mi(l,this.layout.layoutBox,this.relativeParent.layout.layoutBox),i=this.relativeTarget,d=this.relativeTargetOrigin,p=l,f=o,cs(i.x,d.x,p.x,f),cs(i.y,d.y,p.y,f)),u&&(this.animationValues=s,function(t,e,n,o,i,r){var s,a,l,u;i?(t.opacity=zn(0,null!==(s=n.opacity)&&void 0!==s?s:1,Lr(o)),t.opacityExit=zn(null!==(a=e.opacity)&&void 0!==a?a:1,0,Dr(o))):r&&(t.opacity=zn(null!==(l=e.opacity)&&void 0!==l?l:1,null!==(u=n.opacity)&&void 0!==u?u:1,o));for(let i=0;i<Vr;i++){const r=`border${Ar[i]}Radius`;let s=Rr(e,r),a=Rr(n,r);if(void 0===s&&void 0===a)continue;s||(s=0),a||(a=0);0===s||0===a||Mr(s)===Mr(a)?(t[r]=Math.max(zn(Cr(s),Cr(a),o),0),(it.test(a)||it.test(s))&&(t[r]+="%")):t[r]=a}(e.rotate||n.rotate)&&(t.rotate=zn(e.rotate||0,n.rotate||0,o))}(s,r,this.latestValues,o,h,c)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=o},this.mixTargetDelta(0)}startAnimation(t){var e,n;this.notifyListeners("animationStart"),null===(e=this.currentAnimation)||void 0===e||e.stop(),this.resumingFrom&&(null===(n=this.resumingFrom.currentAnimation)||void 0===n||n.stop()),this.pendingAnimation&&(kn.update(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Dn.update(()=>{T.hasAnimatedSinceResize=!0,this.currentAnimation=Tr(0,1e3,{...t,onUpdate:e=>{var n;this.mixTargetDelta(e),null===(n=t.onUpdate)||void 0===n||n.call(t,e)},onComplete:()=>{var e;null===(e=t.onComplete)||void 0===e||e.call(t),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){var t;this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0),null===(t=this.getStack())||void 0===t||t.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){var t;this.currentAnimation&&(null===(t=this.mixTargetDelta)||void 0===t||t.call(this,1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const t=this.getLead();let{targetWithTransforms:e,target:n,layout:o,latestValues:i}=t;if(e&&n&&o){if(this!==t&&this.layout&&o&&ms(this.options.animationType,this.layout.layoutBox,o.layoutBox)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const e=ui(this.layout.layoutBox.x);n.x.min=t.target.x.min,n.x.max=n.x.min+e;const o=ui(this.layout.layoutBox.y);n.y.min=t.target.y.min,n.y.max=n.y.min+o}Or(e,n),Ii(e,i),di(this.projectionDeltaWithTransform,this.layoutCorrected,e,i)}}registerSharedNode(t,e){var n,o,i;this.sharedNodes.has(t)||this.sharedNodes.set(t,new Yr);this.sharedNodes.get(t).add(e),e.promote({transition:null===(n=e.options.initialPromotionConfig)||void 0===n?void 0:n.transition,preserveFollowOpacity:null===(i=null===(o=e.options.initialPromotionConfig)||void 0===o?void 0:o.shouldPreserveFollowOpacity)||void 0===i?void 0:i.call(o,e)})}isLead(){const t=this.getStack();return!t||t.lead===this}getLead(){var t;const{layoutId:e}=this.options;return e&&(null===(t=this.getStack())||void 0===t?void 0:t.lead)||this}getPrevLead(){var t;const{layoutId:e}=this.options;return e?null===(t=this.getStack())||void 0===t?void 0:t.prevLead:void 0}getStack(){const{layoutId:t}=this.options;if(t)return this.root.sharedNodes.get(t)}promote({needsReset:t,transition:e,preserveFollowOpacity:n}={}){const o=this.getStack();o&&o.promote(this,n),t&&(this.projectionDelta=void 0,this.needsReset=!0),e&&this.setOptions({transition:e})}relegate(){const t=this.getStack();return!!t&&t.relegate(this)}resetRotation(){const{visualElement:t}=this.options;if(!t)return;let e=!1;const{latestValues:n}=t;if((n.rotate||n.rotateX||n.rotateY||n.rotateZ)&&(e=!0),!e)return;const o={};for(let e=0;e<Zr.length;e++){const i="rotate"+Zr[e];n[i]&&(o[i]=n[i],t.setStaticValue(i,0))}null==t||t.render();for(const e in o)t.setStaticValue(e,o[e]);t.scheduleRender()}getProjectionStyles(t={}){var e,n,o;const i={};if(!this.instance||this.isSVG)return i;if(!this.isVisible)return{visibility:"hidden"};i.visibility="";const r=null===(e=this.options.visualElement)||void 0===e?void 0:e.getProps().transformTemplate;if(this.needsReset)return this.needsReset=!1,i.opacity="",i.pointerEvents=ee(t.pointerEvents)||"",i.transform=r?r(this.latestValues,""):"none",i;const s=this.getLead();if(!this.projectionDelta||!this.layout||!s.target){const e={};return this.options.layoutId&&(e.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,e.pointerEvents=ee(t.pointerEvents)||""),this.hasProjected&&!Ai(this.latestValues)&&(e.transform=r?r({},""):"none",this.hasProjected=!1),e}const a=s.animationValues||s.latestValues;this.applyTransformsToTarget(),i.transform=Xr(this.projectionDeltaWithTransform,this.treeScale,a),r&&(i.transform=r(a,i.transform));const{x:l,y:u}=this.projectionDelta;i.transformOrigin=`${100*l.origin}% ${100*u.origin}% 0`,s.animationValues?i.opacity=s===this?null!==(o=null!==(n=a.opacity)&&void 0!==n?n:this.latestValues.opacity)&&void 0!==o?o:1:this.preserveOpacity?this.latestValues.opacity:a.opacityExit:i.opacity=s===this?void 0!==a.opacity?a.opacity:"":void 0!==a.opacityExit?a.opacityExit:0;for(const t in j){if(void 0===a[t])continue;const{correct:e,applyTo:n}=j[t],o=e(a[t],s);if(n){const t=n.length;for(let e=0;e<t;e++)i[n[e]]=o}else i[t]=o}return this.options.layoutId&&(i.pointerEvents=s===this?ee(t.pointerEvents)||"":"none"),i}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(t=>{var e;return null===(e=t.currentAnimation)||void 0===e?void 0:e.stop()}),this.root.nodes.forEach(ns),this.root.sharedNodes.clear()}}}function Jr(t){t.updateLayout()}function Qr(t){var e,n,o;const i=(null===(e=t.resumeFrom)||void 0===e?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&i&&t.hasListeners("didUpdate")){const{layoutBox:e,measuredBox:n}=t.layout,{animationType:o}=t.options,r=i.source!==t.layout.source;"size"===o?wi(t=>{const n=r?i.measuredBox[t]:i.layoutBox[t],o=ui(n);n.min=e[t].min,n.max=n.min+o}):ms(o,i.layoutBox,e)&&wi(t=>{const n=r?i.measuredBox[t]:i.layoutBox[t],o=ui(e[t]);n.max=n.min+o});const s={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};di(s,e,i.layoutBox);const a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};r?di(a,t.applyTransform(n,!0),i.measuredBox):di(a,e,i.layoutBox);const l=!Wr(s);let u=!1;if(!t.resumeFrom){const n=t.getClosestProjectingParent();if(n&&!n.resumeFrom){const{snapshot:t,layout:o}=n;if(t&&o){const n={x:{min:0,max:0},y:{min:0,max:0}};mi(n,i.layoutBox,t.layoutBox);const r={x:{min:0,max:0},y:{min:0,max:0}};mi(r,e,o.layoutBox),Hr(n,r)||(u=!0)}}}t.notifyListeners("didUpdate",{layout:e,snapshot:i,delta:a,layoutDelta:s,hasLayoutChanged:l,hasRelativeTargetChanged:u})}else t.isLead()&&(null===(o=(n=t.options).onExitComplete)||void 0===o||o.call(n));t.options.transition=void 0}function ts(t){t.isProjectionDirty||(t.isProjectionDirty=Boolean(t.parent&&t.parent.isProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=Boolean(t.parent&&t.parent.isTransformDirty))}function es(t){t.clearSnapshot()}function ns(t){t.clearMeasurements()}function os(t){const{visualElement:e}=t.options;(null==e?void 0:e.getProps().onBeforeLayoutMeasure)&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function is(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0}function rs(t){t.resolveTargetDelta()}function ss(t){t.calcProjection()}function as(t){t.resetRotation()}function ls(t){t.removeLeadSnapshot()}function us(t,e,n){t.translate=zn(e.translate,0,n),t.scale=zn(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function cs(t,e,n,o){t.min=zn(e.min,n.min,o),t.max=zn(e.max,n.max,o)}function hs(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}const ds={duration:.45,ease:[.4,0,.1,1]};function ps(t,e){let n=t.root;for(let e=t.path.length-1;e>=0;e--)if(Boolean(t.path[e].instance)){n=t.path[e];break}const o=(n&&n!==t.root?n.instance:document).querySelector(`[data-projection-id="${e}"]`);o&&t.mount(o,!0)}function fs(t){t.min=Math.round(t.min),t.max=Math.round(t.max)}function ms(t,e,n){return"position"===t||"preserve-aspect"===t&&!ci($r(e),$r(n),.2)}const gs=_r({attachResizeListener:(t,e)=>le(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),vs={current:void 0},ys=_r({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!vs.current){const t=new gs(0,{});t.mount(window),t.setOptions({layoutScroll:!0}),vs.current=t}return vs.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)}),xs={...Qo,...$e,...Hi,...Sr},bs=k((t,e)=>se(t,e,xs,yr,ys));const Es=k(se);function ws(){const t=e.useRef(!1);return h(()=>(t.current=!0,()=>{t.current=!1}),[]),t}function Ps(){const t=ws(),[n,o]=e.useState(0),i=e.useCallback(()=>{t.current&&o(n+1)},[n]);return[e.useCallback(()=>Dn.postRender(i),[i]),n]}class Ss extends r.Component{getSnapshotBeforeUpdate(t){const e=this.props.childRef.current;if(e&&t.isPresent&&!this.props.isPresent){const t=this.props.sizeRef.current;t.height=e.offsetHeight||0,t.width=e.offsetWidth||0,t.top=e.offsetTop,t.left=e.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function Ts({children:t,isPresent:n}){const o=e.useId(),i=e.useRef(null),s=e.useRef({width:0,height:0,top:0,left:0});return e.useInsertionEffect(()=>{const{width:t,height:e,top:r,left:a}=s.current;if(n||!i.current||!t||!e)return;i.current.dataset.motionPopId=o;const l=document.createElement("style");return document.head.appendChild(l),l.sheet&&l.sheet.insertRule(`\n [data-motion-pop-id="${o}"] {\n position: absolute !important;\n width: ${t}px !important;\n height: ${e}px !important;\n top: ${r}px !important;\n left: ${a}px !important;\n }\n `),()=>{document.head.removeChild(l)}},[n]),r.createElement(Ss,{isPresent:n,childRef:i,sizeRef:s},r.cloneElement(t,{ref:i}))}const As=({children:t,initial:n,isPresent:o,onExitComplete:i,custom:s,presenceAffectsLayout:a,mode:l})=>{const c=S(Vs),h=e.useId(),d=e.useMemo(()=>({id:h,initial:n,isPresent:o,custom:s,onExitComplete:t=>{c.set(t,!0);for(const t of c.values())if(!t)return;i&&i()},register:t=>(c.set(t,!1),()=>c.delete(t))}),a?void 0:[o]);return e.useMemo(()=>{c.forEach((t,e)=>c.set(e,!1))},[o]),r.useEffect(()=>{!o&&!c.size&&i&&i()},[o]),"popLayout"===l&&(t=r.createElement(Ts,{isPresent:o},t)),r.createElement(u.Provider,{value:d},t)};function Vs(){return new Map}const Cs=t=>t.key||"";const Ms=e.createContext(null),Rs=t=>!t.isLayoutDirty&&t.willUpdate(!1);function Ls(){const t=new Set,e=new WeakMap,n=()=>t.forEach(Rs);return{add:o=>{t.add(o),e.set(o,o.addEventListener("willUpdate",n))},remove:o=>{var i;t.delete(o),null===(i=e.get(o))||void 0===i||i(),e.delete(o),n()},dirty:n}}const Ds=t=>!0===t,ks=({children:t,id:n,inheritId:o,inherit:i=!0})=>{void 0!==o&&(i=o);const s=e.useContext(V),a=e.useContext(Ms),[l,u]=Ps(),c=e.useRef(null),h=s.id||a;null===c.current&&((t=>Ds(!0===t)||"id"===t)(i)&&h&&(n=n?h+"-"+n:h),c.current={id:n,group:Ds(i)&&s.group||Ls()});const d=e.useMemo(()=>({...c.current,forceRender:l}),[u]);return r.createElement(V.Provider,{value:d},t)};let Bs=0;function Os(t){return"function"==typeof t}const js=e.createContext(null);const Fs=e.forwardRef((function({children:t,as:n="ul",axis:o="y",onReorder:i,values:s,...a},l){const u=S(()=>bs(n)),c=[],h=e.useRef(!1),d={axis:o,registerItem:(t,e)=>{e&&-1===c.findIndex(e=>t===e.value)&&(c.push({value:t,layout:e[o]}),c.sort(Us))},updateOrder:(t,e,n)=>{if(h.current)return;const o=function(t,e,n,o){if(!o)return t;const i=t.findIndex(t=>t.value===e);if(-1===i)return t;const r=o>0?1:-1,s=t[i+r];if(!s)return t;const a=t[i],l=s.layout,u=zn(l.min,l.max,.5);return 1===r&&a.layout.max+n>u||-1===r&&a.layout.min+n<u?function([...t],e,n){const o=e<0?t.length+e:e;if(o>=0&&o<t.length){const o=n<0?t.length+n:n,[i]=t.splice(e,1);t.splice(o,0,i)}return t}(t,i,i+r):t}(c,t,e,n);c!==o&&(h.current=!0,i(o.map(Is).filter(t=>-1!==s.indexOf(t))))}};return e.useEffect(()=>{h.current=!1}),r.createElement(u,{...a,ref:l},r.createElement(js.Provider,{value:d},t))}));function Is(t){return t.value}function Us(t,e){return t.layout.min-e.layout.min}function Ns(t){const n=S(()=>Co(t)),{isStatic:o}=e.useContext(s);if(o){const[,o]=e.useState(t);e.useEffect(()=>n.onChange(o),[])}return n}function zs(...t){const e=!Array.isArray(t[0]),n=e?0:-1,o=t[0+n],i=t[1+n],r=t[2+n],s=t[3+n],a=eo(i,r,{mixer:(l=r[0],(t=>"object"==typeof t&&t.mix)(l)?l.mix:void 0),...s});var l;return e?a(o):a}function Ws(t,e){const n=Ns(e()),o=()=>n.set(e());return o(),function(t,e,n){h(()=>{const o=t.map(t=>t.onChange(e));return()=>{o.forEach(t=>t()),n()}})}(t,()=>Dn.update(o,!1,!0),()=>kn.update(o)),n}function Hs(t,e,n,o){const i="function"==typeof e?e:zs(e,n,o);return Array.isArray(t)?$s(t,i):$s([t],([t])=>i(t))}function $s(t,e){const n=S(()=>[]);return Ws(t,()=>{n.length=0;const o=t.length;for(let e=0;e<o;e++)n[e]=t[e].get();return e(n)})}function Ys(t,e=0){return z(t)?t:Ns(e)}const Xs={Group:Fs,Item:e.forwardRef((function({children:t,style:n={},value:o,as:i="li",onDrag:s,layout:a=!0,...l},u){const c=S(()=>bs(i)),h=e.useContext(js),d={x:Ys(n.x),y:Ys(n.y)},p=Hs([d.x,d.y],([t,e])=>t||e?1:"unset"),f=e.useRef(null),{axis:m,registerItem:g,updateOrder:v}=h;return e.useEffect(()=>{g(o,f.current)},[h]),r.createElement(c,{drag:m,...l,dragSnapToOrigin:!0,style:{...n,x:d.x,y:d.y,zIndex:p},layout:a,onDrag:(t,e)=>{const{velocity:n}=e;n[m]&&v(o,d[m].get(),n[m]),s&&s(t,e)},onLayoutMeasure:t=>{f.current=t},ref:u},t)}))},Gs={renderer:yr,...Qo,...$e},qs={...Gs,...Hi,...Sr,projectionNodeConstructor:ys};const Zs=t=>"number"==typeof t;function Ks(t,e){return(t=>Array.isArray(t)&&!Zs(t[0]))(t)?t[((t,e,n)=>{const o=e-t;return((n-t)%o+o)%o+t})(0,t.length,e)]:t}const _s=(t,e,n)=>-n*t+n*e+t,Js=t=>t,Qs=(t,e,n)=>e-t==0?1:(n-t)/(e-t);function ta(t,e){const n=t[t.length-1];for(let o=1;o<=e;o++){const i=Qs(0,e,o);t.push(_s(n,1,i))}}function ea(t){const e=[0];return ta(e,t-1),e}function na(t,e=ea(t.length),n=Js){const o=t.length,i=o-e.length;return i>0&&ta(e,i),i=>{let r=0;for(;r<o-2&&!(i<e[r+1]);r++);let s=(a=0,l=1,u=Qs(e[r],e[r+1],i),Math.min(Math.max(u,a),l));var a,l,u;return s=Ks(n,r)(s),_s(t[r],t[r+1],s)}}const oa=t=>"function"==typeof t,ia=t=>"string"==typeof t;function ra(t,e){var n;return"string"==typeof t?e?(null!==(n=e[t])&&void 0!==n||(e[t]=document.querySelectorAll(t)),t=e[t]):t=document.querySelectorAll(t):t instanceof Element&&(t=[t]),Array.from(t||[])}const sa={any:0,all:1};const aa=new WeakMap;let la;function ua({target:t,contentRect:e,borderBoxSize:n}){var o;null===(o=aa.get(t))||void 0===o||o.forEach(o=>{o({target:t,contentSize:e,get size(){return function(t,e){if(e){const{inlineSize:t,blockSize:n}=e[0];return{width:t,height:n}}return t instanceof SVGElement&&"getBBox"in t?t.getBBox():{width:t.offsetWidth,height:t.offsetHeight}}(t,n)}})})}function ca(t){t.forEach(ua)}function ha(t,e){la||"undefined"!=typeof ResizeObserver&&(la=new ResizeObserver(ca));const n=ra(t);return n.forEach(t=>{let n=aa.get(t);n||(n=new Set,aa.set(t,n)),n.add(e),null==la||la.observe(t)}),()=>{n.forEach(t=>{const n=aa.get(t);null==n||n.delete(e),(null==n?void 0:n.size)||null==la||la.unobserve(t)})}}const da=new Set;let pa;function fa(t){return da.add(t),pa||(pa=()=>{const t={width:window.innerWidth,height:window.innerHeight},e={target:window,size:t,contentSize:t};da.forEach(t=>t(e))},window.addEventListener("resize",pa)),()=>{da.delete(t),!da.size&&pa&&(pa=void 0)}}const ma={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}};function ga(t,e,n,o){const i=n[e],{length:r,position:s}=ma[e],a=i.current,l=n.time;i.current=t["scroll"+s],i.scrollLength=t["scroll"+r]-t["client"+r],i.offset.length=0,i.offset[0]=0,i.offset[1]=i.scrollLength,i.progress=Qs(0,i.scrollLength,i.current);const u=o-l;var c,h;i.velocity=u>50?0:(c=i.current-a,(h=u)?c*(1e3/h):0)}const va={Enter:[[0,1],[1,1]],Exit:[[0,0],[1,0]],Any:[[1,0],[0,1]],All:[[0,0],[1,1]]},ya={start:0,center:.5,end:1};function xa(t,e,n=0){let o=0;if(void 0!==ya[t]&&(t=ya[t]),ia(t)){const e=parseFloat(t);t.endsWith("px")?o=e:t.endsWith("%")?t=e/100:t.endsWith("vw")?o=e/100*document.documentElement.clientWidth:t.endsWith("vh")?o=e/100*document.documentElement.clientHeight:t=e}return Zs(t)&&(o=e*t),n+o}const ba=[0,0];function Ea(t,e,n,o){let i=Array.isArray(t)?t:ba,r=0,s=0;return Zs(t)?i=[t,t]:ia(t)&&(i=(t=t.trim()).includes(" ")?t.split(" "):[t,ya[t]?t:"0"]),r=xa(i[0],n,o),s=xa(i[1],e),r-s}const wa={x:0,y:0};function Pa(t,e,n){let{offset:o=va.All}=n;const{target:i=t,axis:r="y"}=n,s="y"===r?"height":"width",a=i!==t?function(t,e){let n={x:0,y:0},o=t;for(;o&&o!==e;)if(o instanceof HTMLElement)n.x+=o.offsetLeft,n.y+=o.offsetTop,o=o.offsetParent;else if(o instanceof SVGGraphicsElement&&"getBBox"in o){const{top:t,left:e}=o.getBBox();for(n.x+=e,n.y+=t;o&&"svg"!==o.tagName;)o=o.parentNode}return n}(i,t):wa,l=i===t?{width:t.scrollWidth,height:t.scrollHeight}:{width:i.clientWidth,height:i.clientHeight},u={width:t.clientWidth,height:t.clientHeight};e[r].offset.length=0;let c=!e[r].interpolate;const h=o.length;for(let t=0;t<h;t++){const n=Ea(o[t],u[s],l[s],a[r]);c||n===e[r].interpolatorOffsets[t]||(c=!0),e[r].offset[t]=n}c&&(e[r].interpolate=na(ea(h),e[r].offset),e[r].interpolatorOffsets=[...e[r].offset]),e[r].progress=e[r].interpolate(e[r].current)}function Sa(t,e,n,o={}){const i=o.axis||"y";return{measure:()=>function(t,e=t,n){if(n.x.targetOffset=0,n.y.targetOffset=0,e!==t){let o=e;for(;o&&o!=t;)n.x.targetOffset+=o.offsetLeft,n.y.targetOffset+=o.offsetTop,o=o.offsetParent}n.x.targetLength=e===t?e.scrollWidth:e.clientWidth,n.y.targetLength=e===t?e.scrollHeight:e.clientHeight,n.x.containerLength=t.clientWidth,n.y.containerLength=t.clientHeight}(t,o.target,n),update:e=>{!function(t,e,n){ga(t,"x",e,n),ga(t,"y",e,n),e.time=n}(t,n,e),(o.offset||o.target)&&Pa(t,n,o)},notify:oa(e)?()=>e(n):Ta(e,n[i])}}function Ta(t,e){return t.pause(),t.forEachNative((t,{easing:e})=>{var n,o;if(t.updateDuration)e||(t.easing=Js),t.updateDuration(1);else{const i={duration:1e3};e||(i.easing="linear"),null===(o=null===(n=t.effect)||void 0===n?void 0:n.updateTiming)||void 0===o||o.call(n,i)}}),()=>{t.currentTime=e.progress}}const Aa=new WeakMap,Va=new WeakMap,Ca=new WeakMap,Ma=t=>t===document.documentElement?window:t;function Ra(t,e={}){var{container:n=document.documentElement}=e,o=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(t);i<o.length;i++)e.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(t,o[i])&&(n[o[i]]=t[o[i]])}return n}(e,["container"]);let i=Ca.get(n);i||(i=new Set,Ca.set(n,i));const r=Sa(n,t,{time:0,x:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0},y:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0}},o);if(i.add(r),!Aa.has(n)){const t=()=>{const t=performance.now();for(const t of i)t.measure();for(const e of i)e.update(t);for(const t of i)t.notify()};Aa.set(n,t);const e=Ma(n);window.addEventListener("resize",t,{passive:!0}),n!==document.documentElement&&Va.set(n,(a=t,oa(s=n)?fa(s):ha(s,a))),e.addEventListener("scroll",t,{passive:!0})}var s,a;const l=Aa.get(n),u=requestAnimationFrame(l);return()=>{var e;"function"!=typeof t&&t.stop(),cancelAnimationFrame(u);const o=Ca.get(n);if(!o)return;if(o.delete(r),o.size)return;const i=Aa.get(n);Aa.delete(n),i&&(Ma(n).removeEventListener("scroll",i),null===(e=Va.get(n))||void 0===e||e(),window.removeEventListener("resize",i))}}const La=()=>({scrollX:Co(0),scrollY:Co(0),scrollXProgress:Co(0),scrollYProgress:Co(0)});function Da({container:t,target:n,layoutEffect:o=!0,...i}={}){const r=S(La);return(o?h:e.useEffect)(()=>Ra(({x:t,y:e})=>{r.scrollX.set(t.current),r.scrollXProgress.set(t.progress),r.scrollY.set(e.current),r.scrollYProgress.set(e.progress)},{...i,container:(null==t?void 0:t.current)||void 0,target:(null==n?void 0:n.current)||void 0}),[]),r}function ka(t){const n=e.useRef(0),{isStatic:o}=e.useContext(s);e.useEffect(()=>{if(o)return;const e=({timestamp:e,delta:o})=>{n.current||(n.current=e),t(e-n.current,o)};return Dn.update(e,!0),()=>kn.update(e)},[t])}class Ba extends Vo{constructor(){super(...arguments),this.members=[],this.transforms=new Set}add(t){let e;U.has(t)?(this.transforms.add(t),e="transform"):t.startsWith("origin")||Y(t)||"willChange"===t||(e=Xt(t)),e&&(So(this.members,e),this.update())}remove(t){U.has(t)?(this.transforms.delete(t),this.transforms.size||To(this.members,"transform")):To(this.members,Xt(t)),this.update()}update(){this.set(this.members.length?this.members.join(", "):"auto")}}function Oa(){!ar.current&&lr();const[t]=e.useState(sr.current);return t}function ja(){let t=!1;const e=[],n=new Set,o={subscribe:t=>(n.add(t),()=>{n.delete(t)}),start(o,i){if(t){const t=[];return n.forEach(e=>{t.push(Wo(e,o,{transitionOverride:i}))}),Promise.all(t)}return new Promise(t=>{e.push({animation:[o,i],resolve:t})})},set:t=>n.forEach(e=>{!function(t,e){Array.isArray(e)?Fo(t,e):"string"==typeof e?Fo(t,[e]):jo(t,e)}(e,t)}),stop(){n.forEach(t=>{!function(t){t.values.forEach(t=>t.stop())}(t)})},mount:()=>(t=!0,e.forEach(({animation:t,resolve:e})=>{o.start(...t).then(e)}),()=>{t=!1,o.stop()})};return o}function Fa(){const t=S(ja);return e.useEffect(t.mount,[]),t}const Ia=Fa,Ua=(t,e,n)=>{const o=e-t;return((n-t)%o+o)%o+t};class Na{constructor(){this.componentControls=new Set}subscribe(t){return this.componentControls.add(t),()=>this.componentControls.delete(t)}start(t,e){this.componentControls.forEach(n=>{n.start(t.nativeEvent||t,e)})}}const za=()=>new Na;function Wa(t){return null!==t&&"object"==typeof t&&R in t}function Ha(){return $a}function $a(t){vs.current&&(vs.current.isUpdating=!1,vs.current.blockUpdate(),t&&t())}const Ya=()=>({});class Xa extends dr{build(){}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}resetTransform(){}restoreTransform(){}removeValueFromRenderState(){}renderInstance(){}scrapeMotionValuesFromProps(){return{}}getBaseTargetFromProps(){}readValueFromInstance(t,e,n){return n.initialState[e]||0}sortInstanceNodePosition(){return 0}makeTargetAnimatableFromInstance({transition:t,transitionEnd:e,...n}){return Io(this,n,No(n,t||{},this)),{transition:t,transitionEnd:e,...n}}}const Ga=ne({scrapeMotionValuesFromProps:Ya,createRenderState:Ya});const qa=t=>t>.001?1/t:1e5;t.AnimatePresence=({children:t,custom:n,initial:o=!0,onExitComplete:i,exitBeforeEnter:s,presenceAffectsLayout:a=!0,mode:l="sync"})=>{s&&(l="wait",Be(!1,"Replace exitBeforeEnter with mode='wait'"));let[u]=Ps();const c=e.useContext(V).forceRender;c&&(u=c);const d=ws(),p=function(t){const n=[];return e.Children.forEach(t,t=>{e.isValidElement(t)&&n.push(t)}),n}(t);let f=p;const m=new Set,g=e.useRef(f),v=e.useRef(new Map).current,y=e.useRef(!0);if(h(()=>{y.current=!1,function(t,e){t.forEach(t=>{const n=Cs(t);e.set(n,t)})}(p,v),g.current=f}),Me(()=>{y.current=!0,v.clear(),m.clear()}),y.current)return r.createElement(r.Fragment,null,f.map(t=>r.createElement(As,{key:Cs(t),isPresent:!0,initial:!!o&&void 0,presenceAffectsLayout:a,mode:l},t)));f=[...f];const x=g.current.map(Cs),b=p.map(Cs),E=x.length;for(let t=0;t<E;t++){const e=x[t];-1===b.indexOf(e)&&m.add(e)}return"wait"===l&&m.size&&(f=[]),m.forEach(t=>{if(-1!==b.indexOf(t))return;const e=v.get(t);if(!e)return;const o=x.indexOf(t);f.splice(o,0,r.createElement(As,{key:Cs(e),isPresent:!1,onExitComplete:()=>{v.delete(t),m.delete(t);const e=g.current.findIndex(e=>e.key===t);if(g.current.splice(e,1),!m.size){if(g.current=p,!1===d.current)return;u(),i&&i()}},custom:n,presenceAffectsLayout:a,mode:l},e))}),f=f.map(t=>{const e=t.key;return m.has(e)?t:r.createElement(As,{key:Cs(t),isPresent:!0,presenceAffectsLayout:a,mode:l},t)}),"production"!==De&&"wait"===l&&f.length>1&&console.warn('You\'re attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.'),r.createElement(r.Fragment,null,m.size?f:f.map(t=>e.cloneElement(t)))},t.AnimateSharedLayout=({children:t})=>(r.useEffect(()=>{},[]),r.createElement(ks,{id:S(()=>"asl-"+Bs++)},t)),t.DeprecatedLayoutGroupContext=Ms,t.DragControls=Na,t.FlatTree=qr,t.LayoutGroup=ks,t.LayoutGroupContext=V,t.LazyMotion=function({children:t,features:n,strict:o=!1}){const[,i]=e.useState(!Os(n)),s=e.useRef(void 0);if(!Os(n)){const{renderer:t,...e}=n;s.current=t,P(e)}return e.useEffect(()=>{Os(n)&&n().then(({renderer:t,...e})=>{P(e),s.current=t,i(!0)})},[]),r.createElement(d.Provider,{value:{renderer:s.current,strict:o}},t)},t.MotionConfig=function({children:t,isValidProp:n,...o}){n&&jt(n),(o={...e.useContext(s),...o}).isStatic=S(()=>o.isStatic);const i=e.useMemo(()=>o,[JSON.stringify(o.transition),o.transformPagePoint,o.reducedMotion]);return r.createElement(s.Provider,{value:i},t)},t.MotionConfigContext=s,t.MotionContext=a,t.MotionValue=Vo,t.PresenceContext=u,t.Reorder=Xs,t.SwitchLayoutGroupContext=M,t.VisualElement=dr,t.addPointerEvent=be,t.addScaleCorrector=F,t.animate=Tr,t.animateVisualElement=Wo,t.animationControls=ja,t.animations=Qo,t.buildTransform=$,t.calcLength=ui,t.checkTargetForNewValues=Io,t.clamp=Nn,t.createBox=Ei,t.createDomMotionComponent=function(t){return L(se(t,{forwardMotionProps:!1},xs,yr,ys))},t.createMotionComponent=L,t.delay=Un,t.distance=ti,t.distance2D=ei,t.domAnimation=Gs,t.domMax=qs,t.filterProps=Ft,t.isBrowser=c,t.isDragActive=Ae,t.isMotionComponent=Wa,t.isMotionValue=z,t.isValidMotionProp=Bt,t.m=Es,t.makeUseVisualState=ne,t.mix=zn,t.motion=bs,t.motionValue=Co,t.pipe=Le,t.resolveMotionValue=ee,t.transform=zs,t.unwrapMotionComponent=function(t){if(Wa(t))return t[R]},t.useAnimation=Ia,t.useAnimationControls=Fa,t.useAnimationFrame=ka,t.useCycle=function(...t){const n=e.useRef(0),[o,i]=e.useState(t[n.current]);return[o,e.useCallback(e=>{n.current="number"!=typeof e?Ua(0,t.length,n.current+1):e,i(t[n.current])},[t.length,...t])]},t.useDeprecatedAnimatedState=function(t){const[n,o]=e.useState(t),i=Ga({},!1),r=S(()=>new Xa({props:{},visualState:i},{initialState:t}));return e.useEffect(()=>(r.mount({}),()=>r.unmount()),[r]),e.useEffect(()=>{r.setProps({onUpdate:t=>{o({...t})}})},[o,r]),[n,S(()=>t=>Wo(r,t))]},t.useDeprecatedInvertedScale=function(t){let e=Ns(1),n=Ns(1);const o=l();return t?(e=t.scaleX||e,n=t.scaleY||n):o&&(e=o.getValue("scaleX",1),n=o.getValue("scaleY",1)),{scaleX:Hs(e,qa),scaleY:Hs(n,qa)}},t.useDomEvent=ue,t.useDragControls=function(){return S(za)},t.useElementScroll=function(t){return Be(!1,"useElementScroll is deprecated. Convert to useScroll({ container: ref })."),Da({container:t})},t.useForceUpdate=Ps,t.useInView=function(t,{root:n,margin:o,amount:i,once:r=!1}={}){const[s,a]=e.useState(!1);return e.useEffect(()=>{if(!t.current||r&&s)return;const e={root:n&&n.current||void 0,margin:o,amount:"some"===i?"any":i};return function(t,e,{root:n,margin:o,amount:i="any"}={}){if("undefined"==typeof IntersectionObserver)return()=>{};const r=ra(t),s=new WeakMap,a=new IntersectionObserver(t=>{t.forEach(t=>{const n=s.get(t.target);if(t.isIntersecting!==Boolean(n))if(t.isIntersecting){const n=e(t);oa(n)?s.set(t.target,n):a.unobserve(t.target)}else n&&(n(t),s.delete(t.target))})},{root:n,rootMargin:o,threshold:"number"==typeof i?i:sa[i]});return r.forEach(t=>a.observe(t)),()=>a.disconnect()}(t.current,()=>(a(!0),r?void 0:()=>a(!1)),e)},[n,t,o,r]),s},t.useInstantLayoutTransition=Ha,t.useInstantTransition=function(){const[t,n]=Ps(),o=Ha();return e.useEffect(()=>{Dn.postRender(()=>Dn.postRender(()=>Pn.current=!1))},[n]),e=>{o(()=>{Pn.current=!0,t(),e()})}},t.useIsPresent=function(){return null===(t=e.useContext(u))||t.isPresent;var t},t.useIsomorphicLayoutEffect=h,t.useMotionTemplate=function(t,...e){const n=t.length;return Ws(e,(function(){let o="";for(let i=0;i<n;i++){o+=t[i];e[i]&&(o+=e[i].get())}return o}))},t.useMotionValue=Ns,t.usePresence=Ye,t.useReducedMotion=Oa,t.useReducedMotionConfig=function(){const t=Oa(),{reducedMotion:n}=e.useContext(s);return"never"!==n&&("always"===n||t)},t.useResetProjection=function(){return r.useCallback(()=>{const t=vs.current;t&&t.resetTree()},[])},t.useScroll=Da,t.useSpring=function(t,n={}){const{isStatic:o}=e.useContext(s),i=e.useRef(null),r=Ns(z(t)?t.get():t);return e.useMemo(()=>r.attach((t,e)=>o?e(t):(i.current&&i.current.stop(),i.current=fo({from:r.get(),to:t,velocity:r.getVelocity(),...n,onUpdate:e}),r.get())),[JSON.stringify(n)]),function(t,e){h(()=>{if(z(t))return e(t.get()),t.onChange(e)},[t,e])}(t,t=>r.set(parseFloat(t))),r},t.useTime=function(){const t=Ns(0);return ka(e=>t.set(e)),t},t.useTransform=Hs,t.useUnmountEffect=Me,t.useVelocity=function(t){const n=Ns(t.getVelocity());return e.useEffect(()=>t.velocityUpdateSubscribers.add(t=>{n.set(t)}),[t]),n},t.useViewportScroll=function(){return Be(!1,"useViewportScroll is deprecated. Convert to useScroll()."),Da()},t.useVisualElementContext=l,t.useWillChange=function(){return S(()=>new Ba("auto"))},t.wrap=Ua,t.wrapHandler=ge,Object.defineProperty(t,"__esModule",{value:!0})}));
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Motion={},t.React)}(this,(function(t,e){"use strict";function n(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}function o(t){if(t&&t.__esModule)return t;var e=Object.create(null);return t&&Object.keys(t).forEach((function(n){if("default"!==n){var o=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,o.get?o:{enumerable:!0,get:function(){return t[n]}})}})),e.default=t,Object.freeze(e)}var i=n(e),r=o(e);const s=e.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),a=e.createContext({});function l(){return e.useContext(a).visualElement}const u=e.createContext(null),c="undefined"!=typeof document,h=c?e.useLayoutEffect:e.useEffect,d=e.createContext({strict:!1});function p(t){return"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}function f(t){return"string"==typeof t||Array.isArray(t)}function m(t){return"object"==typeof t&&"function"==typeof t.start}const g=["initial","animate","exit","whileHover","whileDrag","whileTap","whileFocus","whileInView"];function v(t){return m(t.animate)||g.some(e=>f(t[e]))}function y(t){return Boolean(v(t)||t.variants)}function x(t){const{initial:n,animate:o}=function(t,e){if(v(t)){const{initial:e,animate:n}=t;return{initial:!1===e||f(e)?e:void 0,animate:f(n)?n:void 0}}return!1!==t.inherit?e:{}}(t,e.useContext(a));return e.useMemo(()=>({initial:n,animate:o}),[E(n),E(o)])}function E(t){return Array.isArray(t)?t.join(" "):t}const w=t=>({isEnabled:e=>t.some(t=>!!e[t])}),b={measureLayout:w(["layout","layoutId","drag"]),animation:w(["animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView"]),exit:w(["exit"]),drag:w(["drag","dragControls"]),focus:w(["whileFocus"]),hover:w(["whileHover","onHoverStart","onHoverEnd"]),tap:w(["whileTap","onTap","onTapStart","onTapCancel"]),pan:w(["onPan","onPanStart","onPanSessionStart","onPanEnd"]),inView:w(["whileInView","onViewportEnter","onViewportLeave"])};function P(t){for(const e in t)"projectionNodeConstructor"===e?b.projectionNodeConstructor=t[e]:b[e].Component=t[e]}function S(t){const n=e.useRef(null);return null===n.current&&(n.current=t()),n.current}const T={hasAnimatedSinceResize:!0,hasEverUpdated:!1};let A=1;const V=e.createContext({});class C extends i.default.Component{getSnapshotBeforeUpdate(){const{visualElement:t,props:e}=this.props;return t&&t.setProps(e),null}componentDidUpdate(){}render(){return this.props.children}}const M=e.createContext({}),R=Symbol.for("motionComponentSymbol");function L({preloadedFeatures:t,createVisualElement:n,projectionNodeConstructor:o,useRender:i,useVisualState:f,Component:m}){t&&P(t);const g=e.forwardRef((function(g,v){const y={...e.useContext(s),...g,layoutId:D(g)},{isStatic:E}=y;let w=null;const P=x(g),V=E?void 0:S(()=>{if(T.hasEverUpdated)return A++}),R=f(g,E);if(!E&&c){P.visualElement=function(t,n,o,i){const r=l(),a=e.useContext(d),c=e.useContext(u),p=e.useContext(s).reducedMotion,f=e.useRef();i=i||a.renderer,!f.current&&i&&(f.current=i(t,{visualState:n,parent:r,props:o,presenceId:c?c.id:void 0,blockInitialAnimation:!!c&&!1===c.initial,reducedMotionConfig:p}));const m=f.current;return h(()=>{m&&m.render()}),e.useEffect(()=>{m&&m.animationState&&m.animationState.animateChanges()}),h(()=>()=>m&&m.notify("Unmount"),[]),m}(m,R,y,n);const i=e.useContext(d).strict,r=e.useContext(M);P.visualElement&&(w=P.visualElement.loadFeatures(y,i,t,V,o||b.projectionNodeConstructor,r))}return r.createElement(C,{visualElement:P.visualElement,props:y},w,r.createElement(a.Provider,{value:P},i(m,g,V,function(t,n,o){return e.useCallback(e=>{e&&t.mount&&t.mount(e),n&&(e?n.mount(e):n.unmount()),o&&("function"==typeof o?o(e):p(o)&&(o.current=e))},[n])}(R,P.visualElement,v),R,E,P.visualElement)))}));return g[R]=m,g}function D({layoutId:t}){const n=e.useContext(V).id;return n&&void 0!==t?n+"-"+t:t}function k(t){function e(e,n={}){return L(t(e,n))}if("undefined"==typeof Proxy)return e;const n=new Map;return new Proxy(e,{get:(t,o)=>(n.has(o)||n.set(o,e(o)),n.get(o))})}const B=["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 F(t){return"string"==typeof t&&!t.includes("-")&&!!(B.indexOf(t)>-1||/[A-Z]/.test(t))}const O={};function I(t){Object.assign(O,t)}const j=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],U=new Set(j);function N(t,{layout:e,layoutId:n}){return U.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!O[t]||"opacity"===t)}const z=t=>!!(null==t?void 0:t.getVelocity),W={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},H=(t,e)=>j.indexOf(t)-j.indexOf(e);function $({transform:t,transformKeys:e},{enableHardwareAcceleration:n=!0,allowTransformNone:o=!0},i,r){let s="";e.sort(H);for(const n of e)s+=`${W[n]||n}(${t[n]}) `;return n&&!t.z&&(s+="translateZ(0)"),s=s.trim(),r?s=r(t,i?"":s):o&&i&&(s="none"),s}function Y(t){return t.startsWith("--")}const X=(t,e)=>e&&"number"==typeof t?e.transform(t):t,G=(t,e,n)=>Math.min(Math.max(n,t),e),q={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},Z={...q,transform:t=>G(0,1,t)},K={...q,default:1},_=t=>Math.round(1e5*t)/1e5,J=/(-)?([\d]*\.?[\d])+/g,Q=/(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,tt=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function et(t){return"string"==typeof t}const nt=t=>({test:e=>et(e)&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),ot=nt("deg"),it=nt("%"),rt=nt("px"),st=nt("vh"),at=nt("vw"),lt={...it,parse:t=>it.parse(t)/100,transform:t=>it.transform(100*t)},ut={...q,transform:Math.round},ct={borderWidth:rt,borderTopWidth:rt,borderRightWidth:rt,borderBottomWidth:rt,borderLeftWidth:rt,borderRadius:rt,radius:rt,borderTopLeftRadius:rt,borderTopRightRadius:rt,borderBottomRightRadius:rt,borderBottomLeftRadius:rt,width:rt,maxWidth:rt,height:rt,maxHeight:rt,size:rt,top:rt,right:rt,bottom:rt,left:rt,padding:rt,paddingTop:rt,paddingRight:rt,paddingBottom:rt,paddingLeft:rt,margin:rt,marginTop:rt,marginRight:rt,marginBottom:rt,marginLeft:rt,rotate:ot,rotateX:ot,rotateY:ot,rotateZ:ot,scale:K,scaleX:K,scaleY:K,scaleZ:K,skew:ot,skewX:ot,skewY:ot,distance:rt,translateX:rt,translateY:rt,translateZ:rt,x:rt,y:rt,z:rt,perspective:rt,transformPerspective:rt,opacity:Z,originX:lt,originY:lt,originZ:rt,zIndex:ut,fillOpacity:Z,strokeOpacity:Z,numOctaves:ut};function ht(t,e,n,o){const{style:i,vars:r,transform:s,transformKeys:a,transformOrigin:l}=t;a.length=0;let u=!1,c=!1,h=!0;for(const t in e){const n=e[t];if(Y(t)){r[t]=n;continue}const o=ct[t],d=X(n,o);if(U.has(t)){if(u=!0,s[t]=d,a.push(t),!h)continue;n!==(o.default||0)&&(h=!1)}else t.startsWith("origin")?(c=!0,l[t]=d):i[t]=d}if(e.transform||(u||o?i.transform=$(t,n,h,o):i.transform&&(i.transform="none")),c){const{originX:t="50%",originY:e="50%",originZ:n=0}=l;i.transformOrigin=`${t} ${e} ${n}`}}const dt=()=>({style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}});function pt(t,e,n){for(const o in e)z(e[o])||N(o,n)||(t[o]=e[o])}function ft(t,n,o){const i={};return pt(i,t.style||{},t),Object.assign(i,function({transformTemplate:t},n,o){return e.useMemo(()=>{const e={style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}};return ht(e,n,{enableHardwareAcceleration:!o},t),Object.assign({},e.vars,e.style)},[n])}(t,n,o)),t.transformValues?t.transformValues(i):i}function mt(t,e,n){const o={},i=ft(t,e,n);return t.drag&&!1!==t.dragListener&&(o.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=!0===t.drag?"none":"pan-"+("x"===t.drag?"y":"x")),o.style=i,o}const gt=new Set(["initial","style","values","variants","transition","transformTemplate","transformValues","custom","inherit","layout","layoutId","layoutDependency","onLayoutAnimationStart","onLayoutAnimationComplete","onLayoutMeasure","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","drag","dragControls","dragListener","dragConstraints","dragDirectionLock","dragSnapToOrigin","_dragX","_dragY","dragElastic","dragMomentum","dragPropagation","dragTransition","onHoverStart","onHoverEnd","layoutScroll","whileInView","onViewportEnter","onViewportLeave","viewport","whileTap","onTap","onTapStart","onTapCancel","animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView","onPan","onPanStart","onPanSessionStart","onPanEnd"]);function vt(t){return gt.has(t)}let yt=t=>!vt(t);function xt(t){t&&(yt=e=>e.startsWith("on")?!vt(e):t(e))}try{xt(require("@emotion/is-prop-valid").default)}catch(t){}function Et(t,e,n){const o={};for(const i in t)(yt(i)||!0===n&&vt(i)||!e&&!vt(i)||t.draggable&&i.startsWith("onDrag"))&&(o[i]=t[i]);return o}function wt(t,e,n){return"string"==typeof t?t:rt.transform(e+n*t)}const bt={offset:"stroke-dashoffset",array:"stroke-dasharray"},Pt={offset:"strokeDashoffset",array:"strokeDasharray"};function St(t,{attrX:e,attrY:n,originX:o,originY:i,pathLength:r,pathSpacing:s=1,pathOffset:a=0,...l},u,c,h){if(ht(t,l,u,h),c)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:d,style:p,dimensions:f}=t;d.transform&&(f&&(p.transform=d.transform),delete d.transform),f&&(void 0!==o||void 0!==i||p.transform)&&(p.transformOrigin=function(t,e,n){return`${wt(e,t.x,t.width)} ${wt(n,t.y,t.height)}`}(f,void 0!==o?o:.5,void 0!==i?i:.5)),void 0!==e&&(d.x=e),void 0!==n&&(d.y=n),void 0!==r&&function(t,e,n=1,o=0,i=!0){t.pathLength=1;const r=i?bt:Pt;t[r.offset]=rt.transform(-o);const s=rt.transform(e),a=rt.transform(n);t[r.array]=`${s} ${a}`}(d,r,s,a,!1)}const Tt=()=>({style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{},attrs:{}}),At=t=>"string"==typeof t&&"svg"===t.toLowerCase();function Vt(t,n,o,i){const r=e.useMemo(()=>{const e={style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{},attrs:{}};return St(e,n,{enableHardwareAcceleration:!1},At(i),t.transformTemplate),{...e.attrs,style:{...e.style}}},[n]);if(t.style){const e={};pt(e,t.style,t),r.style={...e,...r.style}}return r}function Ct(t=!1){return(n,o,i,r,{latestValues:s},a)=>{const l=(F(n)?Vt:mt)(o,s,a,n),u={...Et(o,"string"==typeof n,t),...l,ref:r};return i&&(u["data-projection-id"]=i),e.createElement(n,u)}}const Mt=t=>t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();function Rt(t,{style:e,vars:n},o,i){Object.assign(t.style,e,i&&i.getProjectionStyles(o));for(const e in n)t.style.setProperty(e,n[e])}const Lt=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function Dt(t,e,n,o){Rt(t,e,void 0,o);for(const n in e.attrs)t.setAttribute(Lt.has(n)?n:Mt(n),e.attrs[n])}function kt(t){const{style:e}=t,n={};for(const o in e)(z(e[o])||N(o,t))&&(n[o]=e[o]);return n}function Bt(t){const e=kt(t);for(const n in t)if(z(t[n])){e["x"===n||"y"===n?"attr"+n.toUpperCase():n]=t[n]}return e}function Ft(t,e,n,o={},i={}){return"function"==typeof e&&(e=e(void 0!==n?n:t.custom,o,i)),"string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e&&(e=e(void 0!==n?n:t.custom,o,i)),e}const Ot=t=>Array.isArray(t),It=t=>Ot(t)?t[t.length-1]||0:t;function jt(t){const e=z(t)?t.get():t;return n=e,Boolean(n&&"object"==typeof n&&n.mix&&n.toValue)?e.toValue():e;var n}const Ut=t=>(n,o)=>{const i=e.useContext(a),r=e.useContext(u),s=()=>function({scrapeMotionValuesFromProps:t,createRenderState:e,onMount:n},o,i,r){const s={latestValues:Nt(o,i,r,t),renderState:e()};return n&&(s.mount=t=>n(o,t,s)),s}(t,n,i,r);return o?s():S(s)};function Nt(t,e,n,o){const i={},r=o(t);for(const t in r)i[t]=jt(r[t]);let{initial:s,animate:a}=t;const l=v(t),u=y(t);e&&u&&!l&&!1!==t.inherit&&(void 0===s&&(s=e.initial),void 0===a&&(a=e.animate));let c=!!n&&!1===n.initial;c=c||!1===s;const h=c?a:s;if(h&&"boolean"!=typeof h&&!m(h)){(Array.isArray(h)?h:[h]).forEach(e=>{const n=Ft(t,e);if(!n)return;const{transitionEnd:o,transition:r,...s}=n;for(const t in s){let e=s[t];if(Array.isArray(e)){e=e[c?e.length-1:0]}null!==e&&(i[t]=e)}for(const t in o)i[t]=o[t]})}return i}const zt={useVisualState:Ut({scrapeMotionValuesFromProps:Bt,createRenderState:Tt,onMount:(t,e,{renderState:n,latestValues:o})=>{try{n.dimensions="function"==typeof e.getBBox?e.getBBox():e.getBoundingClientRect()}catch(t){n.dimensions={x:0,y:0,width:0,height:0}}St(n,o,{enableHardwareAcceleration:!1},At(e.tagName),t.transformTemplate),Dt(e,n)}})},Wt={useVisualState:Ut({scrapeMotionValuesFromProps:kt,createRenderState:dt})};function Ht(t,{forwardMotionProps:e=!1},n,o,i){return{...F(t)?zt:Wt,preloadedFeatures:n,useRender:Ct(e),createVisualElement:o,projectionNodeConstructor:i,Component:t}}var $t;function Yt(t,e,n,o={passive:!0}){return t.addEventListener(e,n,o),()=>t.removeEventListener(e,n)}function Xt(t,n,o,i){e.useEffect(()=>{const e=t.current;if(o&&e)return Yt(e,n,o,i)},[t,n,o,i])}function Gt(t){return"undefined"!=typeof PointerEvent&&t instanceof PointerEvent?!("mouse"!==t.pointerType):t instanceof MouseEvent}function qt(t){return!!t.touches}t.AnimationType=void 0,($t=t.AnimationType||(t.AnimationType={})).Animate="animate",$t.Hover="whileHover",$t.Tap="whileTap",$t.Drag="whileDrag",$t.Focus="whileFocus",$t.InView="whileInView",$t.Exit="exit";const Zt={pageX:0,pageY:0};function Kt(t,e="page"){const n=t.touches[0]||t.changedTouches[0]||Zt;return{x:n[e+"X"],y:n[e+"Y"]}}function _t(t,e="page"){return{x:t[e+"X"],y:t[e+"Y"]}}function Jt(t,e="page"){return{point:qt(t)?Kt(t,e):_t(t,e)}}const Qt=(t,e=!1)=>{const n=e=>t(e,Jt(e));return e?(o=n,t=>{const e=t instanceof MouseEvent;(!e||e&&0===t.button)&&o(t)}):n;var o},te={pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointercancel:"mousecancel",pointerover:"mouseover",pointerout:"mouseout",pointerenter:"mouseenter",pointerleave:"mouseleave"},ee={pointerdown:"touchstart",pointermove:"touchmove",pointerup:"touchend",pointercancel:"touchcancel"};function ne(t){return c&&null===window.onpointerdown?t:c&&null===window.ontouchstart?ee[t]:c&&null===window.onmousedown?te[t]:t}function oe(t,e,n,o){return Yt(t,ne(e),Qt(n,"pointerdown"===e),o)}function ie(t,e,n,o){return Xt(t,ne(e),n&&Qt(n,"pointerdown"===e),o)}function re(t){let e=null;return()=>{const n=()=>{e=null};return null===e&&(e=t,n)}}const se=re("dragHorizontal"),ae=re("dragVertical");function le(t){let e=!1;if("y"===t)e=ae();else if("x"===t)e=se();else{const t=se(),n=ae();t&&n?e=()=>{t(),n()}:(t&&t(),n&&n())}return e}function ue(){const t=le(!0);return!t||(t(),!1)}function ce(e,n,o){return(i,r)=>{Gt(i)&&!ue()&&(e.animationState&&e.animationState.setActive(t.AnimationType.Hover,n),o&&o(i,r))}}const he=(t,e)=>!!e&&(t===e||he(t,e.parentElement));function de(t){return e.useEffect(()=>()=>t(),[])}const pe=(t,e)=>n=>e(t(n)),fe=(...t)=>t.reduce(pe);const me=("undefined"==typeof process||process.env,"production"),ge=new Set;function ve(t,e,n){t||ge.has(e)||(console.warn(e),n&&console.warn(n),ge.add(e))}const ye=new WeakMap,xe=new WeakMap,Ee=t=>{const e=ye.get(t.target);e&&e(t)},we=t=>{t.forEach(Ee)};function be(t,e,n){const o=function({root:t,...e}){const n=t||document;xe.has(n)||xe.set(n,{});const o=xe.get(n),i=JSON.stringify(e);return o[i]||(o[i]=new IntersectionObserver(we,{root:t,...e})),o[i]}(e);return ye.set(t,n),o.observe(t),()=>{ye.delete(t),o.unobserve(t)}}const Pe={some:0,all:1};function Se(n,o,i,{root:r,margin:s,amount:a="some",once:l}){e.useEffect(()=>{if(!n||!i.current)return;const e={root:null==r?void 0:r.current,rootMargin:s,threshold:"number"==typeof a?a:Pe[a]};return be(i.current,e,e=>{const{isIntersecting:n}=e;if(o.isInView===n)return;if(o.isInView=n,l&&!n&&o.hasEnteredView)return;n&&(o.hasEnteredView=!0),i.animationState&&i.animationState.setActive(t.AnimationType.InView,n);const r=i.getProps(),s=n?r.onViewportEnter:r.onViewportLeave;s&&s(e)})},[n,r,s,a])}function Te(n,o,i,{fallback:r=!0}){e.useEffect(()=>{n&&r&&("production"!==me&&ve(!1,"IntersectionObserver not available on this device. whileInView animations will trigger on mount."),requestAnimationFrame(()=>{o.hasEnteredView=!0;const{onViewportEnter:e}=i.getProps();e&&e(null),i.animationState&&i.animationState.setActive(t.AnimationType.InView,!0)}))},[n])}const Ae=t=>e=>(t(e),null),Ve={inView:Ae((function({visualElement:t,whileInView:n,onViewportEnter:o,onViewportLeave:i,viewport:r={}}){const s=e.useRef({hasEnteredView:!1,isInView:!1});let a=Boolean(n||o||i);r.once&&s.current.hasEnteredView&&(a=!1),("undefined"==typeof IntersectionObserver?Te:Se)(a,s.current,t,r)})),tap:Ae((function({onTap:n,onTapStart:o,onTapCancel:i,whileTap:r,visualElement:s}){const a=n||o||i||r,l=e.useRef(!1),u=e.useRef(null),c={passive:!(o||n||i||m)};function h(){u.current&&u.current(),u.current=null}function d(){return h(),l.current=!1,s.animationState&&s.animationState.setActive(t.AnimationType.Tap,!1),!ue()}function p(t,e){d()&&(he(s.current,t.target)?n&&n(t,e):i&&i(t,e))}function f(t,e){d()&&i&&i(t,e)}function m(e,n){h(),l.current||(l.current=!0,u.current=fe(oe(window,"pointerup",p,c),oe(window,"pointercancel",f,c)),s.animationState&&s.animationState.setActive(t.AnimationType.Tap,!0),o&&o(e,n))}ie(s,"pointerdown",a?m:void 0,c),de(h)})),focus:Ae((function({whileFocus:e,visualElement:n}){const{animationState:o}=n;Xt(n,"focus",e?()=>{o&&o.setActive(t.AnimationType.Focus,!0)}:void 0),Xt(n,"blur",e?()=>{o&&o.setActive(t.AnimationType.Focus,!1)}:void 0)})),hover:Ae((function({onHoverStart:t,onHoverEnd:e,whileHover:n,visualElement:o}){ie(o,"pointerenter",t||n?ce(o,!0,t):void 0,{passive:!t}),ie(o,"pointerleave",e||n?ce(o,!1,e):void 0,{passive:!e})}))};function Ce(){const t=e.useContext(u);if(null===t)return[!0,null];const{isPresent:n,onExitComplete:o,register:i}=t,r=e.useId();e.useEffect(()=>i(r),[]);return!n&&o?[!1,()=>o&&o(r)]:[!0]}function Me(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let o=0;o<n;o++)if(e[o]!==t[o])return!1;return!0}const Re=t=>1e3*t;const Le=t=>t,De=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function ke(t,e,n,o){if(t===e&&n===o)return Le;const i=e=>function(t,e,n,o,i){let r,s,a=0;do{s=e+(n-e)/2,r=De(s,o,i)-t,r>0?n=s:e=s}while(Math.abs(r)>1e-7&&++a<12);return s}(e,0,1,t,n);return t=>0===t||1===t?t:De(i(t),e,o)}const Be=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Fe=t=>e=>1-t(1-e),Oe=t=>t*t,Ie=Fe(Oe),je=Be(Oe),Ue=t=>1-Math.sin(Math.acos(t)),Ne=Fe(Ue),ze=Be(Ne),We=(t=1.525)=>e=>e*e*((t+1)*e-t),He=We(),$e=Fe(He),Ye=Be(He),Xe=(t=>{const e=We(t);return t=>(t*=2)<1?.5*e(t):.5*(2-Math.pow(2,-10*(t-1)))})(),Ge={linear:Le,easeIn:Oe,easeInOut:je,easeOut:Ie,circIn:Ue,circInOut:ze,circOut:Ne,backIn:He,backInOut:Ye,backOut:$e,anticipate:Xe},qe=t=>{if(Array.isArray(t)){t.length;const[e,n,o,i]=t;return ke(e,n,o,i)}return"string"==typeof t?Ge[t]:t},Ze=(t,e)=>n=>Boolean(et(n)&&tt.test(n)&&n.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(n,e)),Ke=(t,e,n)=>o=>{if(!et(o))return o;const[i,r,s,a]=o.match(J);return{[t]:parseFloat(i),[e]:parseFloat(r),[n]:parseFloat(s),alpha:void 0!==a?parseFloat(a):1}},_e={...q,transform:t=>Math.round((t=>G(0,255,t))(t))},Je={test:Ze("rgb","red"),parse:Ke("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:o=1})=>"rgba("+_e.transform(t)+", "+_e.transform(e)+", "+_e.transform(n)+", "+_(Z.transform(o))+")"};const Qe={test:Ze("#"),parse:function(t){let e="",n="",o="",i="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),o=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),o=t.substring(3,4),i=t.substring(4,5),e+=e,n+=n,o+=o,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(o,16),alpha:i?parseInt(i,16)/255:1}},transform:Je.transform},tn={test:Ze("hsl","hue"),parse:Ke("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:o=1})=>"hsla("+Math.round(t)+", "+it.transform(_(e))+", "+it.transform(_(n))+", "+_(Z.transform(o))+")"},en={test:t=>Je.test(t)||Qe.test(t)||tn.test(t),parse:t=>Je.test(t)?Je.parse(t):tn.test(t)?tn.parse(t):Qe.parse(t),transform:t=>et(t)?t:t.hasOwnProperty("red")?Je.transform(t):tn.transform(t)};function nn(t){"number"==typeof t&&(t=""+t);const e=[];let n=0,o=0;const i=t.match(Q);i&&(n=i.length,t=t.replace(Q,"${c}"),e.push(...i.map(en.parse)));const r=t.match(J);return r&&(o=r.length,t=t.replace(J,"${n}"),e.push(...r.map(q.parse))),{values:e,numColors:n,numNumbers:o,tokenised:t}}function on(t){return nn(t).values}function rn(t){const{values:e,numColors:n,tokenised:o}=nn(t),i=e.length;return t=>{let e=o;for(let o=0;o<i;o++)e=e.replace(o<n?"${c}":"${n}",o<n?en.transform(t[o]):_(t[o]));return e}}const sn=t=>"number"==typeof t?0:t;const an={test:function(t){var e,n;return isNaN(t)&&et(t)&&((null===(e=t.match(J))||void 0===e?void 0:e.length)||0)+((null===(n=t.match(Q))||void 0===n?void 0:n.length)||0)>0},parse:on,createTransformer:rn,getAnimatableNone:function(t){const e=on(t);return rn(t)(e.map(sn))}},ln=(t,e)=>"zIndex"!==t&&(!("number"!=typeof e&&!Array.isArray(e))||!("string"!=typeof e||!an.test(e)||e.startsWith("url("))),un=()=>({type:"spring",stiffness:500,damping:25,restSpeed:10}),cn=t=>({type:"spring",stiffness:550,damping:0===t?2*Math.sqrt(550):30,restSpeed:10}),hn=()=>({type:"keyframes",ease:"linear",duration:.3}),dn=t=>({type:"keyframes",duration:.8,values:t}),pn={x:un,y:un,z:un,rotate:un,rotateX:un,rotateY:un,rotateZ:un,scaleX:cn,scaleY:cn,scale:cn,opacity:hn,backgroundColor:hn,color:hn,default:cn},fn=(t,e)=>{let n;return n=Ot(e)?dn:pn[t]||pn.default,{to:e,...n(e)}},mn=new Set(["brightness","contrast","saturate","opacity"]);function gn(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[o]=n.match(J)||[];if(!o)return t;const i=n.replace(o,"");let r=mn.has(e)?1:0;return o!==n&&(r*=100),e+"("+r+i+")"}const vn=/([a-z-]*)\(.*?\)/g,yn={...an,getAnimatableNone:t=>{const e=t.match(vn);return e?e.map(gn).join(" "):t}},xn={...ct,color:en,backgroundColor:en,outlineColor:en,fill:en,stroke:en,borderColor:en,borderTopColor:en,borderRightColor:en,borderBottomColor:en,borderLeftColor:en,filter:yn,WebkitFilter:yn},En=t=>xn[t];function wn(t,e){var n;let o=En(t);return o!==yn&&(o=an),null===(n=o.getAnimatableNone)||void 0===n?void 0:n.call(o,e)}const bn={current:!1},Pn="undefined"!=typeof performance?()=>performance.now():()=>Date.now(),Sn="undefined"!=typeof window?t=>window.requestAnimationFrame(t):t=>setTimeout(()=>t(Pn()),1/60*1e3);const Tn={delta:0,timestamp:0};let An=!0,Vn=!1,Cn=!1;const Mn=["read","update","preRender","render","postRender"],Rn=Mn.reduce((t,e)=>(t[e]=function(t){let e=[],n=[],o=0,i=!1,r=!1;const s=new WeakSet,a={schedule:(t,r=!1,a=!1)=>{const l=a&&i,u=l?e:n;return r&&s.add(t),-1===u.indexOf(t)&&(u.push(t),l&&i&&(o=e.length)),t},cancel:t=>{const e=n.indexOf(t);-1!==e&&n.splice(e,1),s.delete(t)},process:l=>{if(i)r=!0;else{if(i=!0,[e,n]=[n,e],n.length=0,o=e.length,o)for(let n=0;n<o;n++){const o=e[n];o(l),s.has(o)&&(a.schedule(o),t())}i=!1,r&&(r=!1,a.process(l))}}};return a}(()=>Vn=!0),t),{}),Ln=Mn.reduce((t,e)=>{const n=Rn[e];return t[e]=(t,e=!1,o=!1)=>(Vn||On(),n.schedule(t,e,o)),t},{}),Dn=Mn.reduce((t,e)=>(t[e]=Rn[e].cancel,t),{}),kn=Mn.reduce((t,e)=>(t[e]=()=>Rn[e].process(Tn),t),{}),Bn=t=>Rn[t].process(Tn),Fn=t=>{Vn=!1,Tn.delta=An?1/60*1e3:Math.max(Math.min(t-Tn.timestamp,40),1),Tn.timestamp=t,Cn=!0,Mn.forEach(Bn),Cn=!1,Vn&&(An=!1,Sn(Fn))},On=()=>{Vn=!0,An=!0,Cn||Sn(Fn)};function In(t,e){const n=performance.now(),o=({timestamp:i})=>{const r=i-n;r>=e&&(Dn.read(o),t(r-e))};return Ln.read(o,!0),()=>Dn.read(o)}const jn=(t,e,n)=>-n*t+n*e+t;function Un(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}const Nn=(t,e,n)=>{const o=t*t;return Math.sqrt(Math.max(0,n*(e*e-o)+o))},zn=[Qe,Je,tn];function Wn(t){const e=(n=t,zn.find(t=>t.test(n)));var n;let o=e.parse(t);return e===tn&&(o=function({hue:t,saturation:e,lightness:n,alpha:o}){t/=360,n/=100;let i=0,r=0,s=0;if(e/=100){const o=n<.5?n*(1+e):n+e-n*e,a=2*n-o;i=Un(a,o,t+1/3),r=Un(a,o,t),s=Un(a,o,t-1/3)}else i=r=s=n;return{red:Math.round(255*i),green:Math.round(255*r),blue:Math.round(255*s),alpha:o}}(o)),o}const Hn=(t,e)=>{const n=Wn(t),o=Wn(e),i={...n};return t=>(i.red=Nn(n.red,o.red,t),i.green=Nn(n.green,o.green,t),i.blue=Nn(n.blue,o.blue,t),i.alpha=jn(n.alpha,o.alpha,t),Je.transform(i))};function $n(t,e){return"number"==typeof t?n=>jn(t,e,n):en.test(t)?Hn(t,e):Gn(t,e)}const Yn=(t,e)=>{const n=[...t],o=n.length,i=t.map((t,n)=>$n(t,e[n]));return t=>{for(let e=0;e<o;e++)n[e]=i[e](t);return n}},Xn=(t,e)=>{const n={...t,...e},o={};for(const i in n)void 0!==t[i]&&void 0!==e[i]&&(o[i]=$n(t[i],e[i]));return t=>{for(const e in o)n[e]=o[e](t);return n}},Gn=(t,e)=>{const n=an.createTransformer(e),o=nn(t),i=nn(e);return o.numColors===i.numColors&&o.numNumbers>=i.numNumbers?fe(Yn(o.values,i.values),n):n=>""+(n>0?e:t)},qn=(t,e,n)=>{const o=e-t;return 0===o?1:(n-t)/o},Zn=(t,e)=>n=>jn(t,e,n);function Kn(t,e,n){const o=[],i=n||("number"==typeof(r=t[0])?Zn:"string"==typeof r?en.test(r)?Hn:Gn:Array.isArray(r)?Yn:"object"==typeof r?Xn:Zn);var r;const s=t.length-1;for(let n=0;n<s;n++){let r=i(t[n],t[n+1]);if(e){const t=Array.isArray(e)?e[n]:e;r=fe(t,r)}o.push(r)}return o}function _n(t,e,{clamp:n=!0,ease:o,mixer:i}={}){const r=t.length;e.length,!o||!Array.isArray(o)||o.length,t[0]>t[r-1]&&(t=[...t].reverse(),e=[...e].reverse());const s=Kn(e,o,i),a=s.length,l=e=>{let n=0;if(a>1)for(;n<t.length-2&&!(e<t[n+1]);n++);const o=qn(t[n],t[n+1],e);return s[n](o)};return n?e=>l(G(t[0],t[r-1],e)):l}function Jn(t,e){return t.map(()=>e||je).splice(0,t.length-1)}function Qn({duration:t=800,bounce:e=.25,velocity:n=0,mass:o=1}){let i,r,s=1-e;s=G(.05,1,s),t=G(.01,10,t/1e3),s<1?(i=e=>{const o=e*s,i=o*t;return.001-(o-n)/to(e,s)*Math.exp(-i)},r=e=>{const o=e*s*t,r=o*n+n,a=Math.pow(s,2)*Math.pow(e,2)*t,l=Math.exp(-o),u=to(Math.pow(e,2),s);return(.001-i(e)>0?-1:1)*((r-a)*l)/u}):(i=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,r=e=>Math.exp(-e*t)*(t*t*(n-e)));const a=function(t,e,n){let o=n;for(let n=1;n<12;n++)o-=t(o)/e(o);return o}(i,r,5/t);if(t*=1e3,isNaN(a))return{stiffness:100,damping:10,duration:t};{const e=Math.pow(a,2)*o;return{stiffness:e,damping:2*s*Math.sqrt(o*e),duration:t}}}function to(t,e){return t*Math.sqrt(1-e*e)}const eo=["duration","bounce"],no=["stiffness","damping","mass"];function oo(t,e){return e.some(e=>void 0!==t[e])}function io({from:t=0,to:e=1,restSpeed:n=2,restDelta:o=.01,...i}){const r={done:!1,value:t};let{stiffness:s,damping:a,mass:l,velocity:u,duration:c,isResolvedFromDuration:h}=function(t){let e={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...t};if(!oo(t,no)&&oo(t,eo)){const n=Qn(t);e={...e,...n,velocity:0,mass:1},e.isResolvedFromDuration=!0}return e}(i),d=ro,p=ro;function f(){const n=u?-u/1e3:0,i=e-t,r=a/(2*Math.sqrt(s*l)),c=Math.sqrt(s/l)/1e3;if(void 0===o&&(o=Math.min(Math.abs(e-t)/100,.4)),r<1){const t=to(c,r);d=o=>{const s=Math.exp(-r*c*o);return e-s*((n+r*c*i)/t*Math.sin(t*o)+i*Math.cos(t*o))},p=e=>{const o=Math.exp(-r*c*e);return r*c*o*(Math.sin(t*e)*(n+r*c*i)/t+i*Math.cos(t*e))-o*(Math.cos(t*e)*(n+r*c*i)-t*i*Math.sin(t*e))}}else if(1===r)d=t=>e-Math.exp(-c*t)*(i+(n+c*i)*t);else{const t=c*Math.sqrt(r*r-1);d=o=>{const s=Math.exp(-r*c*o),a=Math.min(t*o,300);return e-s*((n+r*c*i)*Math.sinh(a)+t*i*Math.cosh(a))/t}}}return f(),{next:t=>{const i=d(t);if(h)r.done=t>=c;else{const s=1e3*p(t),a=Math.abs(s)<=n,l=Math.abs(e-i)<=o;r.done=a&&l}return r.value=r.done?e:i,r},flipTarget:()=>{u=-u,[t,e]=[e,t],f()}}}io.needsInterpolation=(t,e)=>"string"==typeof t||"string"==typeof e;const ro=t=>0;const so={decay:function({velocity:t=0,from:e=0,power:n=.8,timeConstant:o=350,restDelta:i=.5,modifyTarget:r}){const s={done:!1,value:e};let a=n*t;const l=e+a,u=void 0===r?l:r(l);return u!==l&&(a=u-e),{next:t=>{const e=-a*Math.exp(-t/o);return s.done=!(e>i||e<-i),s.value=s.done?u:u+e,s},flipTarget:()=>{}}},keyframes:function({from:t=0,to:e=1,ease:n,offset:o,duration:i=300}){const r={done:!1,value:t},s=Array.isArray(e)?e:[t,e],a=function(t,e){return t.map(t=>t*e)}(o&&o.length===s.length?o:function(t){const e=t.length;return t.map((t,n)=>0!==n?n/(e-1):0)}(s),i);function l(){return _n(a,s,{ease:Array.isArray(n)?n:Jn(s,n)})}let u=l();return{next:t=>(r.value=u(t),r.done=t>=i,r),flipTarget:()=>{s.reverse(),u=l()}}},spring:io};function ao(t,e,n=0){return t-e-n}const lo=t=>{const e=({delta:e})=>t(e);return{start:()=>Ln.update(e,!0),stop:()=>Dn.update(e)}};function uo({from:t,autoplay:e=!0,driver:n=lo,elapsed:o=0,repeat:i=0,repeatType:r="loop",repeatDelay:s=0,onPlay:a,onStop:l,onComplete:u,onRepeat:c,onUpdate:h,type:d="keyframes",...p}){var f,m;let g,v,y,{to:x}=p,E=0,w=p.duration,b=!1,P=!0;const S=so[Array.isArray(x)?"keyframes":d];(null===(m=(f=S).needsInterpolation)||void 0===m?void 0:m.call(f,t,x))&&(y=_n([0,100],[t,x],{clamp:!1}),t=0,x=100);const T=S({...p,from:t,to:x});function A(){E++,"reverse"===r?(P=E%2==0,o=function(t,e=0,n=0,o=!0){return o?ao(e+-t,e,n):e-(t-e)+n}(o,w,s,P)):(o=ao(o,w,s),"mirror"===r&&T.flipTarget()),b=!1,c&&c()}function V(t){if(P||(t=-t),o+=t,!b){const t=T.next(Math.max(0,o));v=t.value,y&&(v=y(v)),b=P?t.done:o<=0}null==h||h(v),b&&(0===E&&(w=void 0!==w?w:o),E<i?function(t,e,n,o){return o?t>=e+n:t<=-n}(o,w,s,P)&&A():(g.stop(),u&&u()))}return e&&(null==a||a(),g=n(V),g.start()),{stop:()=>{null==l||l(),g.stop()}}}function co(t,e){return e?t*(1e3/e):0}function ho({ease:t,times:e,...n}){const o={...n};return e&&(o.offset=e),n.duration&&(o.duration=Re(n.duration)),n.repeatDelay&&(o.repeatDelay=Re(n.repeatDelay)),t&&(o.ease=(t=>Array.isArray(t)&&"number"!=typeof t[0])(t)?t.map(qe):qe(t)),"tween"===n.type&&(o.type="keyframes"),"spring"!==n.type&&(o.type="keyframes"),o}function po(t,e,n){return Array.isArray(e.to)&&void 0===t.duration&&(t.duration=.8),function(t){Array.isArray(t.to)&&null===t.to[0]&&(t.to=[...t.to],t.to[0]=t.from)}(e),function({when:t,delay:e,delayChildren:n,staggerChildren:o,staggerDirection:i,repeat:r,repeatType:s,repeatDelay:a,from:l,...u}){return!!Object.keys(u).length}(t)||(t={...t,...fn(n,e.to)}),{...e,...ho(t)}}function fo(t,e,n,o,i){const r=vo(o,t)||{};let s=void 0!==r.from?r.from:e.get();const a=ln(t,n);"none"===s&&a&&"string"==typeof n?s=wn(t,n):mo(s)&&"string"==typeof n?s=go(n):!Array.isArray(n)&&mo(n)&&"string"==typeof s&&(n=go(s));return ln(t,s)&&a&&!1!==r.type?function(){const o={from:s,to:n,velocity:e.getVelocity(),onComplete:i,onUpdate:t=>e.set(t)};return"inertia"===r.type||"decay"===r.type?function({from:t=0,velocity:e=0,min:n,max:o,power:i=.8,timeConstant:r=750,bounceStiffness:s=500,bounceDamping:a=10,restDelta:l=1,modifyTarget:u,driver:c,onUpdate:h,onComplete:d,onStop:p}){let f;function m(t){return void 0!==n&&t<n||void 0!==o&&t>o}function g(t){return void 0===n?o:void 0===o||Math.abs(n-t)<Math.abs(o-t)?n:o}function v(t){null==f||f.stop(),f=uo({...t,driver:c,onUpdate:e=>{var n;null==h||h(e),null===(n=t.onUpdate)||void 0===n||n.call(t,e)},onComplete:d,onStop:p})}function y(t){v({type:"spring",stiffness:s,damping:a,restDelta:l,...t})}if(m(t))y({from:t,velocity:e,to:g(t)});else{let o=i*e+t;void 0!==u&&(o=u(o));const s=g(o),a=s===n?-1:1;let c,h;const d=t=>{c=h,h=t,e=co(t-c,Tn.delta),(1===a&&t>s||-1===a&&t<s)&&y({from:t,to:s,velocity:e})};v({type:"decay",from:t,velocity:e,timeConstant:r,power:i,restDelta:l,modifyTarget:u,onUpdate:m(o)?d:void 0})}return{stop:()=>null==f?void 0:f.stop()}}({...o,...r}):uo({...po(r,o,t),onUpdate:t=>{o.onUpdate(t),r.onUpdate&&r.onUpdate(t)},onComplete:()=>{o.onComplete(),r.onComplete&&r.onComplete()}})}:function(){const t=It(n);return e.set(t),i(),r.onUpdate&&r.onUpdate(t),r.onComplete&&r.onComplete(),{stop:()=>{}}}}function mo(t){return 0===t||"string"==typeof t&&0===parseFloat(t)&&-1===t.indexOf(" ")}function go(t){return"number"==typeof t?0:wn("",t)}function vo(t,e){return t[e]||t.default||t}function yo(t,e,n,o={}){return bn.current&&(o={type:!1}),e.start(i=>{let r;const s=fo(t,e,n,o,i),a=function(t,e){const n=vo(t,e)||{};return void 0!==n.delay?n.delay:void 0!==t.delay?t.delay:0}(o,t),l=()=>r=s();let u;return a?u=In(l,Re(a)):l(),()=>{u&&u(),r&&r.stop()}})}const xo=t=>/^0[^.\s]+$/.test(t);function Eo(t,e){-1===t.indexOf(e)&&t.push(e)}function wo(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class bo{constructor(){this.subscriptions=[]}add(t){return Eo(this.subscriptions,t),()=>wo(this.subscriptions,t)}notify(t,e,n){const o=this.subscriptions.length;if(o)if(1===o)this.subscriptions[0](t,e,n);else for(let i=0;i<o;i++){const o=this.subscriptions[i];o&&o(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}class Po{constructor(t){var e;this.version="7.7.2",this.timeDelta=0,this.lastUpdated=0,this.updateSubscribers=new bo,this.velocityUpdateSubscribers=new bo,this.renderSubscribers=new bo,this.canTrackVelocity=!1,this.updateAndNotify=(t,e=!0)=>{this.prev=this.current,this.current=t;const{delta:n,timestamp:o}=Tn;this.lastUpdated!==o&&(this.timeDelta=n,this.lastUpdated=o,Ln.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.updateSubscribers.notify(this.current),this.velocityUpdateSubscribers.getSize()&&this.velocityUpdateSubscribers.notify(this.getVelocity()),e&&this.renderSubscribers.notify(this.current)},this.scheduleVelocityCheck=()=>Ln.postRender(this.velocityCheck),this.velocityCheck=({timestamp:t})=>{t!==this.lastUpdated&&(this.prev=this.current,this.velocityUpdateSubscribers.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e)))}onChange(t){return this.updateSubscribers.add(t)}clearListeners(){this.updateSubscribers.clear()}onRenderRequest(t){return t(this.get()),this.renderSubscribers.add(t)}attach(t){this.passiveEffect=t}set(t,e=!0){e&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?co(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.stopAnimation=t(e)}).then(()=>this.clearAnimation())}stop(){this.stopAnimation&&this.stopAnimation(),this.clearAnimation()}isAnimating(){return!!this.stopAnimation}clearAnimation(){this.stopAnimation=null}destroy(){this.updateSubscribers.clear(),this.renderSubscribers.clear(),this.stop()}}function So(t){return new Po(t)}const To=t=>e=>e.test(t),Ao=[q,rt,it,ot,at,st,{test:t=>"auto"===t,parse:t=>t}],Vo=t=>Ao.find(To(t)),Co=[...Ao,en,an],Mo=t=>Co.find(To(t));function Ro(t,e,n){const o=t.getProps();return Ft(o,e,void 0!==n?n:o.custom,function(t){const e={};return t.values.forEach((t,n)=>e[n]=t.get()),e}(t),function(t){const e={};return t.values.forEach((t,n)=>e[n]=t.getVelocity()),e}(t))}function Lo(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,So(n))}function Do(t,e){const n=Ro(t,e);let{transitionEnd:o={},transition:i={},...r}=n?t.makeTargetAnimatable(n,!1):{};r={...r,...o};for(const e in r){Lo(t,e,It(r[e]))}}function ko(t,e){[...e].reverse().forEach(n=>{var o;const i=t.getVariant(n);i&&Do(t,i),null===(o=t.variantChildren)||void 0===o||o.forEach(t=>{ko(t,e)})})}function Bo(t,e,n){var o,i;const r=Object.keys(e).filter(e=>!t.hasValue(e)),s=r.length;if(s)for(let a=0;a<s;a++){const s=r[a],l=e[s];let u=null;Array.isArray(l)&&(u=l[0]),null===u&&(u=null!==(i=null!==(o=n[s])&&void 0!==o?o:t.readValue(s))&&void 0!==i?i:e[s]),null!=u&&("string"==typeof u&&(/^\-?\d*\.?\d+$/.test(u)||xo(u))?u=parseFloat(u):!Mo(u)&&an.test(l)&&(u=wn(s,l)),t.addValue(s,So(u)),void 0===n[s]&&(n[s]=u),null!==u&&t.setBaseTarget(s,u))}}function Fo(t,e){if(!e)return;return(e[t]||e.default||e).from}function Oo(t,e,n){var o;const i={};for(const r in t){const t=Fo(r,e);i[r]=void 0!==t?t:null===(o=n.getValue(r))||void 0===o?void 0:o.get()}return i}function Io(t){return Boolean(z(t)&&t.add)}function jo(t,e,n={}){let o;if(t.notify("AnimationStart",e),Array.isArray(e)){const i=e.map(e=>Uo(t,e,n));o=Promise.all(i)}else if("string"==typeof e)o=Uo(t,e,n);else{const i="function"==typeof e?Ro(t,e,n.custom):e;o=No(t,i,n)}return o.then(()=>t.notify("AnimationComplete",e))}function Uo(t,e,n={}){var o;const i=Ro(t,e,n.custom);let{transition:r=t.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(r=n.transitionOverride);const s=i?()=>No(t,i,n):()=>Promise.resolve(),a=(null===(o=t.variantChildren)||void 0===o?void 0:o.size)?(o=0)=>{const{delayChildren:i=0,staggerChildren:s,staggerDirection:a}=r;return function(t,e,n=0,o=0,i=1,r){const s=[],a=(t.variantChildren.size-1)*o,l=1===i?(t=0)=>t*o:(t=0)=>a-t*o;return Array.from(t.variantChildren).sort(zo).forEach((t,o)=>{s.push(Uo(t,e,{...r,delay:n+l(o)}).then(()=>t.notify("AnimationComplete",e)))}),Promise.all(s)}(t,e,i+o,s,a,n)}:()=>Promise.resolve(),{when:l}=r;if(l){const[t,e]="beforeChildren"===l?[s,a]:[a,s];return t().then(e)}return Promise.all([s(),a(n.delay)])}function No(t,e,{delay:n=0,transitionOverride:o,type:i}={}){var r;let{transition:s=t.getDefaultTransition(),transitionEnd:a,...l}=t.makeTargetAnimatable(e);const u=t.getValue("willChange");o&&(s=o);const c=[],h=i&&(null===(r=t.animationState)||void 0===r?void 0:r.getState()[i]);for(const e in l){const o=t.getValue(e),i=l[e];if(!o||void 0===i||h&&Wo(h,e))continue;let r={delay:n,...s};t.shouldReduceMotion&&U.has(e)&&(r={...r,type:!1,delay:0});let a=yo(e,o,i,r);Io(u)&&(u.add(e),a=a.then(()=>u.remove(e))),c.push(a)}return Promise.all(c).then(()=>{a&&Do(t,a)})}function zo(t,e){return t.sortNodePosition(e)}function Wo({protectedKeys:t,needsAnimating:e},n){const o=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,o}const Ho=[t.AnimationType.Animate,t.AnimationType.InView,t.AnimationType.Focus,t.AnimationType.Hover,t.AnimationType.Tap,t.AnimationType.Drag,t.AnimationType.Exit],$o=[...Ho].reverse(),Yo=Ho.length;function Xo(e){let n=function(t){return e=>Promise.all(e.map(({animation:e,options:n})=>jo(t,e,n)))}(e);const o={[t.AnimationType.Animate]:qo(!0),[t.AnimationType.InView]:qo(),[t.AnimationType.Hover]:qo(),[t.AnimationType.Tap]:qo(),[t.AnimationType.Drag]:qo(),[t.AnimationType.Focus]:qo(),[t.AnimationType.Exit]:qo()};let i=!0;const r=(t,n)=>{const o=Ro(e,n);if(o){const{transition:e,transitionEnd:n,...i}=o;t={...t,...i,...n}}return t};function s(t,s){const a=e.getProps(),l=e.getVariantContext(!0)||{},u=[],c=new Set;let h={},d=1/0;for(let n=0;n<Yo;n++){const p=$o[n],g=o[p],v=void 0!==a[p]?a[p]:l[p],y=f(v),x=p===s?g.isActive:null;!1===x&&(d=n);let E=v===l[p]&&v!==a[p]&&y;if(E&&i&&e.manuallyAnimateOnMount&&(E=!1),g.protectedKeys={...h},!g.isActive&&null===x||!v&&!g.prevProp||m(v)||"boolean"==typeof v)continue;const w=Go(g.prevProp,v);let b=w||p===s&&g.isActive&&!E&&y||n>d&&y;const P=Array.isArray(v)?v:[v];let S=P.reduce(r,{});!1===x&&(S={});const{prevResolvedValues:T={}}=g,A={...T,...S},V=t=>{b=!0,c.delete(t),g.needsAnimating[t]=!0};for(const t in A){const e=S[t],n=T[t];h.hasOwnProperty(t)||(e!==n?Ot(e)&&Ot(n)?!Me(e,n)||w?V(t):g.protectedKeys[t]=!0:void 0!==e?V(t):c.add(t):void 0!==e&&c.has(t)?V(t):g.protectedKeys[t]=!0)}g.prevProp=v,g.prevResolvedValues=S,g.isActive&&(h={...h,...S}),i&&e.blockInitialAnimation&&(b=!1),b&&!E&&u.push(...P.map(e=>({animation:e,options:{type:p,...t}})))}if(c.size){const t={};c.forEach(n=>{const o=e.getBaseTarget(n);void 0!==o&&(t[n]=o)}),u.push({animation:t})}let p=Boolean(u.length);return i&&!1===a.initial&&!e.manuallyAnimateOnMount&&(p=!1),i=!1,p?n(u):Promise.resolve()}return{animateChanges:s,setActive:function(t,n,i){var r;if(o[t].isActive===n)return Promise.resolve();null===(r=e.variantChildren)||void 0===r||r.forEach(e=>{var o;return null===(o=e.animationState)||void 0===o?void 0:o.setActive(t,n)}),o[t].isActive=n;const a=s(i,t);for(const t in o)o[t].protectedKeys={};return a},setAnimateFunction:function(t){n=t(e)},getState:()=>o}}function Go(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!Me(e,t)}function qo(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}const Zo={animation:Ae(({visualElement:t,animate:n})=>{t.animationState||(t.animationState=Xo(t)),m(n)&&e.useEffect(()=>n.subscribe(t),[n])}),exit:Ae(n=>{const{custom:o,visualElement:i}=n,[r,s]=Ce(),a=e.useContext(u);e.useEffect(()=>{i.isPresent=r;const e=i.animationState&&i.animationState.setActive(t.AnimationType.Exit,!r,{custom:a&&a.custom||o});e&&!r&&e.then(s)},[r])})},Ko=(t,e)=>Math.abs(t-e);function _o(t,e){const n=Ko(t.x,e.x),o=Ko(t.y,e.y);return Math.sqrt(n**2+o**2)}class Jo{constructor(t,e,{transformPagePoint:n}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=()=>{if(!this.lastMoveEvent||!this.lastMoveEventInfo)return;const t=ei(this.lastMoveEventInfo,this.history),e=null!==this.startEvent,n=_o(t.offset,{x:0,y:0})>=3;if(!e&&!n)return;const{point:o}=t,{timestamp:i}=Tn;this.history.push({...o,timestamp:i});const{onStart:r,onMove:s}=this.handlers;e||(r&&r(this.lastMoveEvent,t),this.startEvent=this.lastMoveEvent),s&&s(this.lastMoveEvent,t)},this.handlePointerMove=(t,e)=>{this.lastMoveEvent=t,this.lastMoveEventInfo=Qo(e,this.transformPagePoint),Gt(t)&&0===t.buttons?this.handlePointerUp(t,e):Ln.update(this.updatePoint,!0)},this.handlePointerUp=(t,e)=>{this.end();const{onEnd:n,onSessionEnd:o}=this.handlers,i=ei(Qo(e,this.transformPagePoint),this.history);this.startEvent&&n&&n(t,i),o&&o(t,i)},qt(t)&&t.touches.length>1)return;this.handlers=e,this.transformPagePoint=n;const o=Qo(Jt(t),this.transformPagePoint),{point:i}=o,{timestamp:r}=Tn;this.history=[{...i,timestamp:r}];const{onSessionStart:s}=e;s&&s(t,ei(o,this.history)),this.removeListeners=fe(oe(window,"pointermove",this.handlePointerMove),oe(window,"pointerup",this.handlePointerUp),oe(window,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Dn.update(this.updatePoint)}}function Qo(t,e){return e?{point:e(t.point)}:t}function ti(t,e){return{x:t.x-e.x,y:t.y-e.y}}function ei({point:t},e){return{point:t,delta:ti(t,oi(e)),offset:ti(t,ni(e)),velocity:ii(e,.1)}}function ni(t){return t[0]}function oi(t){return t[t.length-1]}function ii(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,o=null;const i=oi(t);for(;n>=0&&(o=t[n],!(i.timestamp-o.timestamp>Re(e)));)n--;if(!o)return{x:0,y:0};const r=(i.timestamp-o.timestamp)/1e3;if(0===r)return{x:0,y:0};const s={x:(i.x-o.x)/r,y:(i.y-o.y)/r};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}function ri(t){return t.max-t.min}function si(t,e=0,n=.01){return Math.abs(t-e)<=n}function ai(t,e,n,o=.5){t.origin=o,t.originPoint=jn(e.min,e.max,t.origin),t.scale=ri(n)/ri(e),(si(t.scale,1,1e-4)||isNaN(t.scale))&&(t.scale=1),t.translate=jn(n.min,n.max,t.origin)-t.originPoint,(si(t.translate)||isNaN(t.translate))&&(t.translate=0)}function li(t,e,n,o){ai(t.x,e.x,n.x,null==o?void 0:o.originX),ai(t.y,e.y,n.y,null==o?void 0:o.originY)}function ui(t,e,n){t.min=n.min+e.min,t.max=t.min+ri(e)}function ci(t,e,n){t.min=e.min-n.min,t.max=t.min+ri(e)}function hi(t,e,n){ci(t.x,e.x,n.x),ci(t.y,e.y,n.y)}function di(t,e,n){return{min:void 0!==e?t.min+e:void 0,max:void 0!==n?t.max+n-(t.max-t.min):void 0}}function pi(t,e){let n=e.min-t.min,o=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,o]=[o,n]),{min:n,max:o}}const fi=.35;function mi(t,e,n){return{min:gi(t,e),max:gi(t,n)}}function gi(t,e){return"number"==typeof t?t:t[e]||0}const vi=()=>({x:{min:0,max:0},y:{min:0,max:0}});function yi(t){return[t("x"),t("y")]}function xi({top:t,left:e,right:n,bottom:o}){return{x:{min:e,max:n},y:{min:t,max:o}}}function Ei(t){return void 0===t||1===t}function wi({scale:t,scaleX:e,scaleY:n}){return!Ei(t)||!Ei(e)||!Ei(n)}function bi(t){return wi(t)||Pi(t)||t.z||t.rotate||t.rotateX||t.rotateY}function Pi(t){return Si(t.x)||Si(t.y)}function Si(t){return t&&"0%"!==t}function Ti(t,e,n){return n+e*(t-n)}function Ai(t,e,n,o,i){return void 0!==i&&(t=Ti(t,i,o)),Ti(t,n,o)+e}function Vi(t,e=0,n=1,o,i){t.min=Ai(t.min,e,n,o,i),t.max=Ai(t.max,e,n,o,i)}function Ci(t,{x:e,y:n}){Vi(t.x,e.translate,e.scale,e.originPoint),Vi(t.y,n.translate,n.scale,n.originPoint)}function Mi(t){return Number.isInteger(t)||t>1.0000000000001||t<.999999999999?t:1}function Ri(t,e){t.min=t.min+e,t.max=t.max+e}function Li(t,e,[n,o,i]){const r=void 0!==e[i]?e[i]:.5,s=jn(t.min,t.max,r);Vi(t,e[n],e[o],s,e.scale)}const Di=["x","scaleX","originX"],ki=["y","scaleY","originY"];function Bi(t,e){Li(t.x,e,Di),Li(t.y,e,ki)}function Fi(t,e){return xi(function(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),o=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:o.y,right:o.x}}(t.getBoundingClientRect(),e))}const Oi=new WeakMap;class Ii{constructor(t){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic={x:{min:0,max:0},y:{min:0,max:0}},this.visualElement=t}start(e,{snapToCursor:n=!1}={}){if(!1===this.visualElement.isPresent)return;this.panSession=new Jo(e,{onSessionStart:t=>{this.stopAnimation(),n&&this.snapToCursor(Jt(t,"page").point)},onStart:(e,n)=>{var o;const{drag:i,dragPropagation:r,onDragStart:s}=this.getProps();(!i||r||(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=le(i),this.openGlobalLock))&&(this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),yi(t=>{var e,n;let o=this.getAxisMotionValue(t).get()||0;if(it.test(o)){const i=null===(n=null===(e=this.visualElement.projection)||void 0===e?void 0:e.layout)||void 0===n?void 0:n.layoutBox[t];if(i){o=ri(i)*(parseFloat(o)/100)}}this.originPoint[t]=o}),null==s||s(e,n),null===(o=this.visualElement.animationState)||void 0===o||o.setActive(t.AnimationType.Drag,!0))},onMove:(t,e)=>{const{dragPropagation:n,dragDirectionLock:o,onDirectionLock:i,onDrag:r}=this.getProps();if(!n&&!this.openGlobalLock)return;const{offset:s}=e;if(o&&null===this.currentDirection)return this.currentDirection=function(t,e=10){let n=null;Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x");return n}(s),void(null!==this.currentDirection&&(null==i||i(this.currentDirection)));this.updateAxis("x",e.point,s),this.updateAxis("y",e.point,s),this.visualElement.render(),null==r||r(t,e)},onSessionEnd:(t,e)=>this.stop(t,e)},{transformPagePoint:this.visualElement.getTransformPagePoint()})}stop(t,e){const n=this.isDragging;if(this.cancel(),!n)return;const{velocity:o}=e;this.startAnimation(o);const{onDragEnd:i}=this.getProps();null==i||i(t,e)}cancel(){var e,n;this.isDragging=!1,this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!1),null===(e=this.panSession)||void 0===e||e.end(),this.panSession=void 0;const{dragPropagation:o}=this.getProps();!o&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),null===(n=this.visualElement.animationState)||void 0===n||n.setActive(t.AnimationType.Drag,!1)}updateAxis(t,e,n){const{drag:o}=this.getProps();if(!n||!ji(t,o,this.currentDirection))return;const i=this.getAxisMotionValue(t);let r=this.originPoint[t]+n[t];this.constraints&&this.constraints[t]&&(r=function(t,{min:e,max:n},o){return void 0!==e&&t<e?t=o?jn(e,t,o.min):Math.max(t,e):void 0!==n&&t>n&&(t=o?jn(n,t,o.max):Math.min(t,n)),t}(r,this.constraints[t],this.elastic[t])),i.set(r)}resolveConstraints(){const{dragConstraints:t,dragElastic:e}=this.getProps(),{layout:n}=this.visualElement.projection||{},o=this.constraints;t&&p(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!n)&&function(t,{top:e,left:n,bottom:o,right:i}){return{x:di(t.x,n,i),y:di(t.y,e,o)}}(n.layoutBox,t),this.elastic=function(t=fi){return!1===t?t=0:!0===t&&(t=fi),{x:mi(t,"left","right"),y:mi(t,"top","bottom")}}(e),o!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&yi(t=>{this.getAxisMotionValue(t)&&(this.constraints[t]=function(t,e){const n={};return void 0!==e.min&&(n.min=e.min-t.min),void 0!==e.max&&(n.max=e.max-t.min),n}(n.layoutBox[t],this.constraints[t]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:e}=this.getProps();if(!t||!p(t))return!1;const n=t.current,{projection:o}=this.visualElement;if(!o||!o.layout)return!1;const i=function(t,e,n){const o=Fi(t,n),{scroll:i}=e;return i&&(Ri(o.x,i.offset.x),Ri(o.y,i.offset.y)),o}(n,o.root,this.visualElement.getTransformPagePoint());let r=function(t,e){return{x:pi(t.x,e.x),y:pi(t.y,e.y)}}(o.layout.layoutBox,i);if(e){const t=e(function({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}(r));this.hasMutatedConstraints=!!t,t&&(r=xi(t))}return r}startAnimation(t){const{drag:e,dragMomentum:n,dragElastic:o,dragTransition:i,dragSnapToOrigin:r,onDragTransitionEnd:s}=this.getProps(),a=this.constraints||{},l=yi(s=>{if(!ji(s,e,this.currentDirection))return;let l=(null==a?void 0:a[s])||{};r&&(l={min:0,max:0});const u=o?200:1e6,c=o?40:1e7,h={type:"inertia",velocity:n?t[s]:0,bounceStiffness:u,bounceDamping:c,timeConstant:750,restDelta:1,restSpeed:10,...i,...l};return this.startAxisValueAnimation(s,h)});return Promise.all(l).then(s)}startAxisValueAnimation(t,e){return yo(t,this.getAxisMotionValue(t),0,e)}stopAnimation(){yi(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){var e;const n="_drag"+t.toUpperCase(),o=this.visualElement.getProps()[n];return o||this.visualElement.getValue(t,(null===(e=this.visualElement.getProps().initial)||void 0===e?void 0:e[t])||0)}snapToCursor(t){yi(e=>{const{drag:n}=this.getProps();if(!ji(e,n,this.currentDirection))return;const{projection:o}=this.visualElement,i=this.getAxisMotionValue(e);if(o&&o.layout){const{min:n,max:r}=o.layout.layoutBox[e];i.set(t[e]-jn(n,r,.5))}})}scalePositionWithinConstraints(){var t;if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:o}=this.visualElement;if(!p(n)||!o||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};yi(t=>{const e=this.getAxisMotionValue(t);if(e){const n=e.get();i[t]=function(t,e){let n=.5;const o=ri(t),i=ri(e);return i>o?n=qn(e.min,e.max-o,t.min):o>i&&(n=qn(t.min,t.max-i,e.min)),G(0,1,n)}({min:n,max:n},this.constraints[t])}});const{transformTemplate:r}=this.visualElement.getProps();this.visualElement.current.style.transform=r?r({},""):"none",null===(t=o.root)||void 0===t||t.updateScroll(),o.updateLayout(),this.resolveConstraints(),yi(t=>{if(!ji(t,e,null))return;const n=this.getAxisMotionValue(t),{min:o,max:r}=this.constraints[t];n.set(jn(o,r,i[t]))})}addListeners(){var t;if(!this.visualElement.current)return;Oi.set(this.visualElement,this);const e=oe(this.visualElement.current,"pointerdown",t=>{const{drag:e,dragListener:n=!0}=this.getProps();e&&n&&this.start(t)}),n=()=>{const{dragConstraints:t}=this.getProps();p(t)&&(this.constraints=this.resolveRefConstraints())},{projection:o}=this.visualElement,i=o.addEventListener("measure",n);o&&!o.layout&&(null===(t=o.root)||void 0===t||t.updateScroll(),o.updateLayout()),n();const r=Yt(window,"resize",()=>this.scalePositionWithinConstraints()),s=o.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e})=>{this.isDragging&&e&&(yi(e=>{const n=this.getAxisMotionValue(e);n&&(this.originPoint[e]+=t[e].translate,n.set(n.get()+t[e].translate))}),this.visualElement.render())});return()=>{r(),e(),i(),null==s||s()}}getProps(){const t=this.visualElement.getProps(),{drag:e=!1,dragDirectionLock:n=!1,dragPropagation:o=!1,dragConstraints:i=!1,dragElastic:r=fi,dragMomentum:s=!0}=t;return{...t,drag:e,dragDirectionLock:n,dragPropagation:o,dragConstraints:i,dragElastic:r,dragMomentum:s}}}function ji(t,e,n){return!(!0!==e&&e!==t||null!==n&&n!==t)}const Ui={pan:Ae((function({onPan:t,onPanStart:n,onPanEnd:o,onPanSessionStart:i,visualElement:r}){const a=t||n||o||i,l=e.useRef(null),{transformPagePoint:u}=e.useContext(s),c={onSessionStart:i,onStart:n,onMove:t,onEnd:(t,e)=>{l.current=null,o&&o(t,e)}};e.useEffect(()=>{null!==l.current&&l.current.updateHandlers(c)}),ie(r,"pointerdown",a&&function(t){l.current=new Jo(t,c,{transformPagePoint:u})}),de(()=>l.current&&l.current.end())})),drag:Ae((function(t){const{dragControls:n,visualElement:o}=t,i=S(()=>new Ii(o));e.useEffect(()=>n&&n.subscribe(i),[i,n]),e.useEffect(()=>i.addListeners(),[i])}))};function Ni(t){return"string"==typeof t&&t.startsWith("var(--")}const zi=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function Wi(t,e,n=1){const[o,i]=function(t){const e=zi.exec(t);if(!e)return[,];const[,n,o]=e;return[n,o]}(t);if(!o)return;const r=window.getComputedStyle(e).getPropertyValue(o);return r?r.trim():Ni(i)?Wi(i,e,n+1):i}const Hi=new Set(["width","height","top","left","right","bottom","x","y"]),$i=t=>Hi.has(t),Yi=(t,e)=>{t.set(e,!1),t.set(e)},Xi=t=>t===q||t===rt;var Gi;!function(t){t.width="width",t.height="height",t.left="left",t.right="right",t.top="top",t.bottom="bottom"}(Gi||(Gi={}));const qi=(t,e)=>parseFloat(t.split(", ")[e]),Zi=(t,e)=>(n,{transform:o})=>{if("none"===o||!o)return 0;const i=o.match(/^matrix3d\((.+)\)$/);if(i)return qi(i[1],e);{const e=o.match(/^matrix\((.+)\)$/);return e?qi(e[1],t):0}},Ki=new Set(["x","y","z"]),_i=j.filter(t=>!Ki.has(t));const Ji={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:Zi(4,13),y:Zi(5,14)},Qi=(t,e,n={},o={})=>{e={...e},o={...o};const i=Object.keys(e).filter($i);let r=[],s=!1;const a=[];if(i.forEach(i=>{const l=t.getValue(i);if(!t.hasValue(i))return;let u=n[i],c=Vo(u);const h=e[i];let d;if(Ot(h)){const t=h.length,e=null===h[0]?1:0;u=h[e],c=Vo(u);for(let n=e;n<t;n++)d?Vo(h[n]):d=Vo(h[n])}else d=Vo(h);if(c!==d)if(Xi(c)&&Xi(d)){const t=l.get();"string"==typeof t&&l.set(parseFloat(t)),"string"==typeof h?e[i]=parseFloat(h):Array.isArray(h)&&d===rt&&(e[i]=h.map(parseFloat))}else(null==c?void 0:c.transform)&&(null==d?void 0:d.transform)&&(0===u||0===h)?0===u?l.set(d.transform(u)):e[i]=c.transform(h):(s||(r=function(t){const e=[];return _i.forEach(n=>{const o=t.getValue(n);void 0!==o&&(e.push([n,o.get()]),o.set(n.startsWith("scale")?1:0))}),e.length&&t.render(),e}(t),s=!0),a.push(i),o[i]=void 0!==o[i]?o[i]:e[i],Yi(l,h))}),a.length){const n=a.indexOf("height")>=0?window.pageYOffset:null,i=((t,e,n)=>{const o=e.measureViewportBox(),i=e.current,r=getComputedStyle(i),{display:s}=r,a={};"none"===s&&e.setStaticValue("display",t.display||"block"),n.forEach(t=>{a[t]=Ji[t](o,r)}),e.render();const l=e.measureViewportBox();return n.forEach(n=>{const o=e.getValue(n);Yi(o,a[n]),t[n]=Ji[n](l,r)}),t})(e,t,a);return r.length&&r.forEach(([e,n])=>{t.getValue(e).set(n)}),t.render(),c&&null!==n&&window.scrollTo({top:n}),{target:i,transitionEnd:o}}return{target:e,transitionEnd:o}};function tr(t,e,n,o){return(t=>Object.keys(t).some($i))(e)?Qi(t,e,n,o):{target:e,transitionEnd:o}}const er=(t,e,n,o)=>{const i=function(t,{...e},n){const o=t.current;if(!(o instanceof Element))return{target:e,transitionEnd:n};n&&(n={...n}),t.values.forEach(t=>{const e=t.get();if(!Ni(e))return;const n=Wi(e,o);n&&t.set(n)});for(const t in e){const i=e[t];if(!Ni(i))continue;const r=Wi(i,o);r&&(e[t]=r,n&&void 0===n[t]&&(n[t]=i))}return{target:e,transitionEnd:n}}(t,e,o);return tr(t,e=i.target,n,o=i.transitionEnd)},nr={current:null},or={current:!1};function ir(){if(or.current=!0,c)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>nr.current=t.matches;t.addListener(e),e()}else nr.current=!1}const rr=Object.keys(b),sr=rr.length,ar=["AnimationStart","AnimationComplete","Update","Unmount","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class lr{constructor({parent:t,props:e,reducedMotionConfig:n,visualState:o},i={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.isPresent=!0,this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.scheduleRender=()=>Ln.render(this.render,!1,!0);const{latestValues:r,renderState:s}=o;this.latestValues=r,this.baseTarget={...r},this.initialValues=e.initial?{...r}:{},this.renderState=s,this.parent=t,this.props=e,this.depth=t?t.depth+1:0,this.reducedMotionConfig=n,this.options=i,this.isControllingVariants=v(e),this.isVariantNode=y(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:a,...l}=this.scrapeMotionValuesFromProps(e);for(const t in l){const e=l[t];void 0!==r[t]&&z(e)&&(e.set(r[t],!1),Io(a)&&a.add(t))}}scrapeMotionValuesFromProps(t){return{}}mount(t){var e;this.current=t,this.projection&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=null===(e=this.parent)||void 0===e?void 0:e.addVariantChild(this)),this.values.forEach((t,e)=>this.bindToMotionValue(e,t)),or.current||ir(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||nr.current),this.parent&&this.parent.children.add(this),this.setProps(this.props)}unmount(){var t,e,n;null===(t=this.projection)||void 0===t||t.unmount(),Dn.update(this.notifyUpdate),Dn.render(this.render),this.valueSubscriptions.forEach(t=>t()),null===(e=this.removeFromVariantTree)||void 0===e||e.call(this),null===(n=this.parent)||void 0===n||n.children.delete(this);for(const t in this.events)this.events[t].clear();this.current=null}bindToMotionValue(t,e){const n=U.has(t),o=e.onChange(e=>{this.latestValues[t]=e,this.props.onUpdate&&Ln.update(this.notifyUpdate,!1,!0),n&&this.projection&&(this.projection.isTransformDirty=!0)}),i=e.onRenderRequest(this.scheduleRender);this.valueSubscriptions.set(t,()=>{o(),i()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}loadFeatures(t,n,o,i,r,s){const a=[];for(let n=0;n<sr;n++){const o=rr[n],{isEnabled:i,Component:r}=b[o];i(t)&&r&&a.push(e.createElement(r,{key:o,...t,visualElement:this}))}if(!this.projection&&r){this.projection=new r(i,this.latestValues,this.parent&&this.parent.projection);const{layoutId:e,layout:n,drag:o,dragConstraints:a,layoutScroll:l}=t;this.projection.setOptions({layoutId:e,layout:n,alwaysMeasureLayout:Boolean(o)||a&&p(a),visualElement:this,scheduleRender:()=>this.scheduleRender(),animationType:"string"==typeof n?n:"both",initialPromotionConfig:s,layoutScroll:l})}return a}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}makeTargetAnimatable(t,e=!0){return this.makeTargetAnimatableFromInstance(t,this.props,e)}setProps(t){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.props=t;for(let e=0;e<ar.length;e++){const n=ar[e];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);const o=t["on"+n];o&&(this.propEventSubscriptions[n]=this.on(n,o))}this.prevMotionValues=function(t,e,n){const{willChange:o}=e;for(const i in e){const r=e[i],s=n[i];if(z(r))t.addValue(i,r),Io(o)&&o.add(i);else if(z(s))t.addValue(i,So(r)),Io(o)&&o.remove(i);else if(s!==r)if(t.hasValue(i)){const e=t.getValue(i);!e.hasAnimated&&e.set(r)}else{const e=t.getStaticValue(i);t.addValue(i,So(void 0!==e?e:r))}}for(const o in n)void 0===e[o]&&t.removeValue(o);return e}(this,this.scrapeMotionValuesFromProps(t),this.prevMotionValues)}getProps(){return this.props}getVariant(t){var e;return null===(e=this.props.variants)||void 0===e?void 0:e[t]}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){var t;return this.isVariantNode?this:null===(t=this.parent)||void 0===t?void 0:t.getClosestVariantNode()}getVariantContext(t=!1){var e,n;if(t)return null===(e=this.parent)||void 0===e?void 0:e.getVariantContext();if(!this.isControllingVariants){const t=(null===(n=this.parent)||void 0===n?void 0:n.getVariantContext())||{};return void 0!==this.props.initial&&(t.initial=this.props.initial),t}const o={};for(let t=0;t<cr;t++){const e=ur[t],n=this.props[e];(f(n)||!1===n)&&(o[e]=n)}return o}addVariantChild(t){var e;const n=this.getClosestVariantNode();if(n)return null===(e=n.variantChildren)||void 0===e||e.add(t),()=>n.variantChildren.delete(t)}addValue(t,e){this.hasValue(t)&&this.removeValue(t),this.values.set(t,e),this.latestValues[t]=e.get(),this.bindToMotionValue(t,e)}removeValue(t){var e;this.values.delete(t),null===(e=this.valueSubscriptions.get(t))||void 0===e||e(),this.valueSubscriptions.delete(t),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return void 0===n&&void 0!==e&&(n=So(e),this.addValue(t,n)),n}readValue(t){return void 0===this.latestValues[t]&&this.current?this.readValueFromInstance(this.current,t,this.options):this.latestValues[t]}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){var e;const{initial:n}=this.props,o="string"==typeof n||"object"==typeof n?null===(e=Ft(this.props,n))||void 0===e?void 0:e[t]:void 0;if(n&&void 0!==o)return o;const i=this.getBaseTargetFromProps(this.props,t);return void 0===i||z(i)?void 0!==this.initialValues[t]&&void 0===o?void 0:this.baseTarget[t]:i}on(t,e){return this.events[t]||(this.events[t]=new bo),this.events[t].add(e)}notify(t,...e){var n;null===(n=this.events[t])||void 0===n||n.notify(...e)}}const ur=["initial",...Ho],cr=ur.length;class hr extends lr{sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){var n;return null===(n=t.style)||void 0===n?void 0:n[e]}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}makeTargetAnimatableFromInstance({transition:t,transitionEnd:e,...n},{transformValues:o},i){let r=Oo(n,t||{},this);if(o&&(e&&(e=o(e)),n&&(n=o(n)),r&&(r=o(r))),i){Bo(this,n,r);const t=er(this,n,r,e);e=t.transitionEnd,n=t.target}return{transition:t,transitionEnd:e,...n}}}class dr extends hr{readValueFromInstance(t,e){if(U.has(e)){const t=En(e);return t&&t.default||0}{const o=(n=t,window.getComputedStyle(n)),i=(Y(e)?o.getPropertyValue(e):o[e])||0;return"string"==typeof i?i.trim():i}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return Fi(t,e)}build(t,e,n,o){ht(t,e,n,o.transformTemplate)}scrapeMotionValuesFromProps(t){return kt(t)}renderInstance(t,e,n,o){Rt(t,e,n,o)}}class pr extends hr{constructor(){super(...arguments),this.isSVGTag=!1}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){var n;return U.has(e)?(null===(n=En(e))||void 0===n?void 0:n.default)||0:(e=Lt.has(e)?e:Mt(e),t.getAttribute(e))}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}scrapeMotionValuesFromProps(t){return Bt(t)}build(t,e,n,o){St(t,e,n,this.isSVGTag,o.transformTemplate)}renderInstance(t,e,n,o){Dt(t,e,0,o)}mount(t){this.isSVGTag=At(t.tagName),super.mount(t)}}const fr=(t,e)=>F(t)?new pr(e,{enableHardwareAcceleration:!1}):new dr(e,{enableHardwareAcceleration:!0});function mr(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const gr={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!rt.test(t))return t;t=parseFloat(t)}return`${mr(t,e.target.x)}% ${mr(t,e.target.y)}%`}},vr={correct:(t,{treeScale:e,projectionDelta:n})=>{const o=t,i=t.includes("var("),r=[];i&&(t=t.replace(zi,t=>(r.push(t),"_$css")));const s=an.parse(t);if(s.length>5)return o;const a=an.createTransformer(t),l="number"!=typeof s[0]?1:0,u=n.x.scale*e.x,c=n.y.scale*e.y;s[0+l]/=u,s[1+l]/=c;const h=jn(u,c,.5);"number"==typeof s[2+l]&&(s[2+l]/=h),"number"==typeof s[3+l]&&(s[3+l]/=h);let d=a(s);if(i){let t=0;d=d.replace("_$css",()=>{const e=r[t];return t++,e})}return d}};class yr extends i.default.Component{componentDidMount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n,layoutId:o}=this.props,{projection:i}=t;I(xr),i&&(e.group&&e.group.add(i),n&&n.register&&o&&n.register(i),i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,onExitComplete:()=>this.safeToRemove()})),T.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:e,visualElement:n,drag:o,isPresent:i}=this.props,r=n.projection;return r?(r.isPresent=i,o||t.layoutDependency!==e||void 0===e?r.willUpdate():this.safeToRemove(),t.isPresent!==i&&(i?r.promote():r.relegate()||Ln.postRender(()=>{var t;(null===(t=r.getStack())||void 0===t?void 0:t.members.length)||this.safeToRemove()})),null):null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),!t.currentAnimation&&t.isLead()&&this.safeToRemove())}componentWillUnmount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n}=this.props,{projection:o}=t;o&&(o.scheduleCheckAfterUnmount(),(null==e?void 0:e.group)&&e.group.remove(o),(null==n?void 0:n.deregister)&&n.deregister(o))}safeToRemove(){const{safeToRemove:t}=this.props;null==t||t()}render(){return null}}const xr={borderRadius:{...gr,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:gr,borderTopRightRadius:gr,borderBottomLeftRadius:gr,borderBottomRightRadius:gr,boxShadow:vr},Er={measureLayout:function(t){const[n,o]=Ce(),r=e.useContext(V);return i.default.createElement(yr,{...t,layoutGroup:r,switchLayoutGroup:e.useContext(M),isPresent:n,safeToRemove:o})}};function wr(t,e,n={}){const o=z(t)?t:So(t);return yo("",o,e,n),{stop:()=>o.stop(),isAnimating:()=>o.isAnimating()}}const br=["TopLeft","TopRight","BottomLeft","BottomRight"],Pr=br.length,Sr=t=>"string"==typeof t?parseFloat(t):t,Tr=t=>"number"==typeof t||rt.test(t);function Ar(t,e){return void 0!==t[e]?t[e]:t.borderRadius}const Vr=Mr(0,.5,Ne),Cr=Mr(.5,.95,Le);function Mr(t,e,n){return o=>o<t?0:o>e?1:n(qn(t,e,o))}function Rr(t,e){t.min=e.min,t.max=e.max}function Lr(t,e){Rr(t.x,e.x),Rr(t.y,e.y)}function Dr(t,e,n,o,i){return t=Ti(t-=e,1/n,o),void 0!==i&&(t=Ti(t,1/i,o)),t}function kr(t,e,[n,o,i],r,s){!function(t,e=0,n=1,o=.5,i,r=t,s=t){if(it.test(e)){e=parseFloat(e);e=jn(s.min,s.max,e/100)-s.min}if("number"!=typeof e)return;let a=jn(r.min,r.max,o);t===r&&(a-=e),t.min=Dr(t.min,e,n,a,i),t.max=Dr(t.max,e,n,a,i)}(t,e[n],e[o],e[i],e.scale,r,s)}const Br=["x","scaleX","originX"],Fr=["y","scaleY","originY"];function Or(t,e,n,o){kr(t.x,e,Br,null==n?void 0:n.x,null==o?void 0:o.x),kr(t.y,e,Fr,null==n?void 0:n.y,null==o?void 0:o.y)}function Ir(t){return 0===t.translate&&1===t.scale}function jr(t){return Ir(t.x)&&Ir(t.y)}function Ur(t,e){return t.x.min===e.x.min&&t.x.max===e.x.max&&t.y.min===e.y.min&&t.y.max===e.y.max}function Nr(t){return ri(t.x)/ri(t.y)}class zr{constructor(){this.members=[]}add(t){Eo(this.members,t),t.scheduleRender()}remove(t){if(wo(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const t=this.members[this.members.length-1];t&&this.promote(t)}}relegate(t){const e=this.members.findIndex(e=>t===e);if(0===e)return!1;let n;for(let t=e;t>=0;t--){const e=this.members[t];if(!1!==e.isPresent){n=e;break}}return!!n&&(this.promote(n),!0)}promote(t,e){var n;const o=this.lead;if(t!==o&&(this.prevLead=o,this.lead=t,t.show(),o)){o.instance&&o.scheduleRender(),t.scheduleRender(),t.resumeFrom=o,e&&(t.resumeFrom.preserveOpacity=!0),o.snapshot&&(t.snapshot=o.snapshot,t.snapshot.latestValues=o.animationValues||o.latestValues),(null===(n=t.root)||void 0===n?void 0:n.isUpdating)&&(t.isLayoutDirty=!0);const{crossfade:i}=t.options;!1===i&&o.hide()}}exitAnimationComplete(){this.members.forEach(t=>{var e,n,o,i,r;null===(n=(e=t.options).onExitComplete)||void 0===n||n.call(e),null===(r=null===(o=t.resumingFrom)||void 0===o?void 0:(i=o.options).onExitComplete)||void 0===r||r.call(i)})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function Wr(t,e,n){let o="";const i=t.x.translate/e.x,r=t.y.translate/e.y;if((i||r)&&(o=`translate3d(${i}px, ${r}px, 0) `),1===e.x&&1===e.y||(o+=`scale(${1/e.x}, ${1/e.y}) `),n){const{rotate:t,rotateX:e,rotateY:i}=n;t&&(o+=`rotate(${t}deg) `),e&&(o+=`rotateX(${e}deg) `),i&&(o+=`rotateY(${i}deg) `)}const s=t.x.scale*e.x,a=t.y.scale*e.y;return 1===s&&1===a||(o+=`scale(${s}, ${a})`),o||"none"}const Hr=(t,e)=>t.depth-e.depth;class $r{constructor(){this.children=[],this.isDirty=!1}add(t){Eo(this.children,t),this.isDirty=!0}remove(t){wo(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Hr),this.isDirty=!1,this.children.forEach(t)}}const Yr=["","X","Y","Z"];let Xr=0;function Gr({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:o,resetTransform:i}){return class{constructor(t,n={},o=(null==e?void 0:e())){this.id=Xr++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isTransformDirty=!1,this.isProjectionDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.potentialNodes=new Map,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.nodes.forEach(Kr),this.nodes.forEach(es),this.nodes.forEach(ns)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.elementId=t,this.latestValues=n,this.root=o?o.root||o:this,this.path=o?[...o.path,o]:[],this.parent=o,this.depth=o?o.depth+1:0,t&&this.root.registerPotentialNode(t,this);for(let t=0;t<this.path.length;t++)this.path[t].shouldResetTransform=!0;this.root===this&&(this.nodes=new $r)}addEventListener(t,e){return this.eventHandlers.has(t)||this.eventHandlers.set(t,new bo),this.eventHandlers.get(t).add(e)}notifyListeners(t,...e){const n=this.eventHandlers.get(t);null==n||n.notify(...e)}hasListeners(t){return this.eventHandlers.has(t)}registerPotentialNode(t,e){this.potentialNodes.set(t,e)}mount(e,n=!1){var o;if(this.instance)return;this.isSVG=e instanceof SVGElement&&"svg"!==e.tagName,this.instance=e;const{layoutId:i,layout:r,visualElement:s}=this.options;if(s&&!s.current&&s.mount(e),this.root.nodes.add(this),null===(o=this.parent)||void 0===o||o.children.add(this),this.elementId&&this.root.potentialNodes.delete(this.elementId),n&&(r||i)&&(this.isLayoutDirty=!0),t){let n;const o=()=>this.root.updateBlockedByResize=!1;t(e,()=>{this.root.updateBlockedByResize=!0,n&&n(),n=In(o,250),T.hasAnimatedSinceResize&&(T.hasAnimatedSinceResize=!1,this.nodes.forEach(ts))})}i&&this.root.registerSharedNode(i,this),!1!==this.options.animate&&s&&(i||r)&&this.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e,hasRelativeTargetChanged:n,layout:o})=>{var i,r,a,l,u;if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const c=null!==(r=null!==(i=this.options.transition)&&void 0!==i?i:s.getDefaultTransition())&&void 0!==r?r:ls,{onLayoutAnimationStart:h,onLayoutAnimationComplete:d}=s.getProps(),p=!this.targetLayout||!Ur(this.targetLayout,o)||n,f=!e&&n;if((null===(a=this.resumeFrom)||void 0===a?void 0:a.instance)||f||e&&(p||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(t,f);const e={...vo(c,"layout"),onPlay:h,onComplete:d};s.shouldReduceMotion&&(e.delay=0,e.type=!1),this.startAnimation(e)}else e||0!==this.animationProgress||ts(this),this.isLead()&&(null===(u=(l=this.options).onExitComplete)||void 0===u||u.call(l));this.targetLayout=o})}unmount(){var t,e;this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this),null===(t=this.getStack())||void 0===t||t.remove(this),null===(e=this.parent)||void 0===e||e.children.delete(this),this.instance=void 0,Dn.preRender(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){var t;return this.isAnimationBlocked||(null===(t=this.parent)||void 0===t?void 0:t.isTreeAnimationBlocked())||!1}startUpdate(){var t;this.isUpdateBlocked()||(this.isUpdating=!0,null===(t=this.nodes)||void 0===t||t.forEach(os),this.animationId++)}willUpdate(t=!0){var e,n,o;if(this.root.isUpdateBlocked())return void(null===(n=(e=this.options).onExitComplete)||void 0===n||n.call(e));if(!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let t=0;t<this.path.length;t++){const e=this.path[t];e.shouldResetTransform=!0,e.updateScroll("snapshot")}const{layoutId:i,layout:r}=this.options;if(void 0===i&&!r)return;const s=null===(o=this.options.visualElement)||void 0===o?void 0:o.getProps().transformTemplate;this.prevTransformTemplateValue=null==s?void 0:s(this.latestValues,""),this.updateSnapshot(),t&&this.notifyListeners("willUpdate")}didUpdate(){if(this.isUpdateBlocked())return this.unblockUpdate(),this.clearAllSnapshots(),void this.nodes.forEach(Jr);this.isUpdating&&(this.isUpdating=!1,this.potentialNodes.size&&(this.potentialNodes.forEach(us),this.potentialNodes.clear()),this.nodes.forEach(Qr),this.nodes.forEach(qr),this.nodes.forEach(Zr),this.clearAllSnapshots(),kn.update(),kn.preRender(),kn.render())}clearAllSnapshots(){this.nodes.forEach(_r),this.sharedNodes.forEach(is)}scheduleUpdateProjection(){Ln.preRender(this.updateProjection,!1,!0)}scheduleCheckAfterUnmount(){Ln.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure())}updateLayout(){var t;if(!this.instance)return;if(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let t=0;t<this.path.length;t++){this.path[t].updateScroll()}const e=this.layout;this.layout=this.measure(!1),this.layoutCorrected={x:{min:0,max:0},y:{min:0,max:0}},this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox),null===(t=this.options.visualElement)||void 0===t||t.notify("LayoutMeasure",this.layout.layoutBox,null==e?void 0:e.layoutBox)}updateScroll(t="measure"){let e=Boolean(this.options.layoutScroll&&this.instance);this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===t&&(e=!1),e&&(this.scroll={animationId:this.root.animationId,phase:t,isRoot:o(this.instance),offset:n(this.instance)})}resetTransform(){var t;if(!i)return;const e=this.isLayoutDirty||this.shouldResetTransform,n=this.projectionDelta&&!jr(this.projectionDelta),o=null===(t=this.options.visualElement)||void 0===t?void 0:t.getProps().transformTemplate,r=null==o?void 0:o(this.latestValues,""),s=r!==this.prevTransformTemplateValue;e&&(n||bi(this.latestValues)||s)&&(i(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(t=!0){const e=this.measurePageBox();let n=this.removeElementScroll(e);var o;return t&&(n=this.removeTransform(n)),cs((o=n).x),cs(o.y),{animationId:this.root.animationId,measuredBox:e,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:t}=this.options;if(!t)return{x:{min:0,max:0},y:{min:0,max:0}};const e=t.measureViewportBox(),{scroll:n}=this.root;return n&&(Ri(e.x,n.offset.x),Ri(e.y,n.offset.y)),e}removeElementScroll(t){const e={x:{min:0,max:0},y:{min:0,max:0}};Lr(e,t);for(let n=0;n<this.path.length;n++){const o=this.path[n],{scroll:i,options:r}=o;if(o!==this.root&&i&&r.layoutScroll){if(i.isRoot){Lr(e,t);const{scroll:n}=this.root;n&&(Ri(e.x,-n.offset.x),Ri(e.y,-n.offset.y))}Ri(e.x,i.offset.x),Ri(e.y,i.offset.y)}}return e}applyTransform(t,e=!1){const n={x:{min:0,max:0},y:{min:0,max:0}};Lr(n,t);for(let t=0;t<this.path.length;t++){const o=this.path[t];!e&&o.options.layoutScroll&&o.scroll&&o!==o.root&&Bi(n,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),bi(o.latestValues)&&Bi(n,o.latestValues)}return bi(this.latestValues)&&Bi(n,this.latestValues),n}removeTransform(t){var e;const n={x:{min:0,max:0},y:{min:0,max:0}};Lr(n,t);for(let t=0;t<this.path.length;t++){const o=this.path[t];if(!o.instance)continue;if(!bi(o.latestValues))continue;wi(o.latestValues)&&o.updateSnapshot();const i={x:{min:0,max:0},y:{min:0,max:0}};Lr(i,o.measurePageBox()),Or(n,o.latestValues,null===(e=o.snapshot)||void 0===e?void 0:e.layoutBox,i)}return bi(this.latestValues)&&Or(n,this.latestValues),n}setTargetDelta(t){this.targetDelta=t,this.isProjectionDirty=!0,this.root.scheduleUpdateProjection()}setOptions(t){this.options={...this.options,...t,crossfade:void 0===t.crossfade||t.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}resolveTargetDelta(){var t;const e=this.getLead();if(this.isProjectionDirty||(this.isProjectionDirty=e.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=e.isTransformDirty),!this.isProjectionDirty&&!this.attemptToResolveRelativeTarget)return;const{layout:n,layoutId:o}=this.options;if(this.layout&&(n||o)){if(!this.targetDelta&&!this.relativeTarget){const t=this.getClosestProjectingParent();t&&t.layout?(this.relativeParent=t,this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},hi(this.relativeTargetOrigin,this.layout.layoutBox,t.layout.layoutBox),Lr(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}var i,r,s;if(this.relativeTarget||this.targetDelta)if(this.target||(this.target={x:{min:0,max:0},y:{min:0,max:0}},this.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}}),this.relativeTarget&&this.relativeTargetOrigin&&(null===(t=this.relativeParent)||void 0===t?void 0:t.target)?(i=this.target,r=this.relativeTarget,s=this.relativeParent.target,ui(i.x,r.x,s.x),ui(i.y,r.y,s.y)):this.targetDelta?(Boolean(this.resumingFrom)?this.target=this.applyTransform(this.layout.layoutBox):Lr(this.target,this.layout.layoutBox),Ci(this.target,this.targetDelta)):Lr(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const t=this.getClosestProjectingParent();t&&Boolean(t.resumingFrom)===Boolean(this.resumingFrom)&&!t.options.layoutScroll&&t.target?(this.relativeParent=t,this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},hi(this.relativeTargetOrigin,this.target,t.target),Lr(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(this.parent&&!wi(this.parent.latestValues)&&!Pi(this.parent.latestValues))return(this.parent.relativeTarget||this.parent.targetDelta)&&this.parent.layout?this.parent:this.parent.getClosestProjectingParent()}calcProjection(){var t;const{isProjectionDirty:e,isTransformDirty:n}=this;this.isProjectionDirty=this.isTransformDirty=!1;const o=this.getLead(),i=Boolean(this.resumingFrom)||this!==o;let r=!0;if(e&&(r=!1),i&&n&&(r=!1),r)return;const{layout:s,layoutId:a}=this.options;if(this.isTreeAnimating=Boolean((null===(t=this.parent)||void 0===t?void 0:t.isTreeAnimating)||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!s&&!a)return;Lr(this.layoutCorrected,this.layout.layoutBox),function(t,e,n,o=!1){var i,r;const s=n.length;if(!s)return;let a,l;e.x=e.y=1;for(let u=0;u<s;u++)a=n[u],l=a.projectionDelta,"contents"!==(null===(r=null===(i=a.instance)||void 0===i?void 0:i.style)||void 0===r?void 0:r.display)&&(o&&a.options.layoutScroll&&a.scroll&&a!==a.root&&Bi(t,{x:-a.scroll.offset.x,y:-a.scroll.offset.y}),l&&(e.x*=l.x.scale,e.y*=l.y.scale,Ci(t,l)),o&&bi(a.latestValues)&&Bi(t,a.latestValues));e.x=Mi(e.x),e.y=Mi(e.y)}(this.layoutCorrected,this.treeScale,this.path,i);const{target:l}=o;if(!l)return;this.projectionDelta||(this.projectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDeltaWithTransform={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}});const u=this.treeScale.x,c=this.treeScale.y,h=this.projectionTransform;li(this.projectionDelta,this.layoutCorrected,l,this.latestValues),this.projectionTransform=Wr(this.projectionDelta,this.treeScale),this.projectionTransform===h&&this.treeScale.x===u&&this.treeScale.y===c||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",l))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(t=!0){var e,n,o;null===(n=(e=this.options).scheduleRender)||void 0===n||n.call(e),t&&(null===(o=this.getStack())||void 0===o||o.scheduleRender()),this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}setAnimationOrigin(t,e=!1){var n,o;const i=this.snapshot,r=(null==i?void 0:i.latestValues)||{},s={...this.latestValues},a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};this.relativeTarget=this.relativeTargetOrigin=void 0,this.attemptToResolveRelativeTarget=!e;const l={x:{min:0,max:0},y:{min:0,max:0}},u=(null==i?void 0:i.source)!==(null===(n=this.layout)||void 0===n?void 0:n.source),c=((null===(o=this.getStack())||void 0===o?void 0:o.members.length)||0)<=1,h=Boolean(u&&!c&&!0===this.options.crossfade&&!this.path.some(as));this.animationProgress=0,this.mixTargetDelta=e=>{var n;const o=e/1e3;var i,d,p,f;rs(a.x,t.x,o),rs(a.y,t.y,o),this.setTargetDelta(a),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&(null===(n=this.relativeParent)||void 0===n?void 0:n.layout)&&(hi(l,this.layout.layoutBox,this.relativeParent.layout.layoutBox),i=this.relativeTarget,d=this.relativeTargetOrigin,p=l,f=o,ss(i.x,d.x,p.x,f),ss(i.y,d.y,p.y,f)),u&&(this.animationValues=s,function(t,e,n,o,i,r){i?(t.opacity=jn(0,void 0!==n.opacity?n.opacity:1,Vr(o)),t.opacityExit=jn(void 0!==e.opacity?e.opacity:1,0,Cr(o))):r&&(t.opacity=jn(void 0!==e.opacity?e.opacity:1,void 0!==n.opacity?n.opacity:1,o));for(let i=0;i<Pr;i++){const r=`border${br[i]}Radius`;let s=Ar(e,r),a=Ar(n,r);if(void 0===s&&void 0===a)continue;s||(s=0),a||(a=0);0===s||0===a||Tr(s)===Tr(a)?(t[r]=Math.max(jn(Sr(s),Sr(a),o),0),(it.test(a)||it.test(s))&&(t[r]+="%")):t[r]=a}(e.rotate||n.rotate)&&(t.rotate=jn(e.rotate||0,n.rotate||0,o))}(s,r,this.latestValues,o,h,c)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=o},this.mixTargetDelta(0)}startAnimation(t){var e,n;this.notifyListeners("animationStart"),null===(e=this.currentAnimation)||void 0===e||e.stop(),this.resumingFrom&&(null===(n=this.resumingFrom.currentAnimation)||void 0===n||n.stop()),this.pendingAnimation&&(Dn.update(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Ln.update(()=>{T.hasAnimatedSinceResize=!0,this.currentAnimation=wr(0,1e3,{...t,onUpdate:e=>{var n;this.mixTargetDelta(e),null===(n=t.onUpdate)||void 0===n||n.call(t,e)},onComplete:()=>{var e;null===(e=t.onComplete)||void 0===e||e.call(t),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){var t;this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0),null===(t=this.getStack())||void 0===t||t.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){var t;this.currentAnimation&&(null===(t=this.mixTargetDelta)||void 0===t||t.call(this,1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const t=this.getLead();let{targetWithTransforms:e,target:n,layout:o,latestValues:i}=t;if(e&&n&&o){if(this!==t&&this.layout&&o&&hs(this.options.animationType,this.layout.layoutBox,o.layoutBox)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const e=ri(this.layout.layoutBox.x);n.x.min=t.target.x.min,n.x.max=n.x.min+e;const o=ri(this.layout.layoutBox.y);n.y.min=t.target.y.min,n.y.max=n.y.min+o}Lr(e,n),Bi(e,i),li(this.projectionDeltaWithTransform,this.layoutCorrected,e,i)}}registerSharedNode(t,e){var n,o,i;this.sharedNodes.has(t)||this.sharedNodes.set(t,new zr);this.sharedNodes.get(t).add(e),e.promote({transition:null===(n=e.options.initialPromotionConfig)||void 0===n?void 0:n.transition,preserveFollowOpacity:null===(i=null===(o=e.options.initialPromotionConfig)||void 0===o?void 0:o.shouldPreserveFollowOpacity)||void 0===i?void 0:i.call(o,e)})}isLead(){const t=this.getStack();return!t||t.lead===this}getLead(){var t;const{layoutId:e}=this.options;return e&&(null===(t=this.getStack())||void 0===t?void 0:t.lead)||this}getPrevLead(){var t;const{layoutId:e}=this.options;return e?null===(t=this.getStack())||void 0===t?void 0:t.prevLead:void 0}getStack(){const{layoutId:t}=this.options;if(t)return this.root.sharedNodes.get(t)}promote({needsReset:t,transition:e,preserveFollowOpacity:n}={}){const o=this.getStack();o&&o.promote(this,n),t&&(this.projectionDelta=void 0,this.needsReset=!0),e&&this.setOptions({transition:e})}relegate(){const t=this.getStack();return!!t&&t.relegate(this)}resetRotation(){const{visualElement:t}=this.options;if(!t)return;let e=!1;const{latestValues:n}=t;if((n.rotate||n.rotateX||n.rotateY||n.rotateZ)&&(e=!0),!e)return;const o={};for(let e=0;e<Yr.length;e++){const i="rotate"+Yr[e];n[i]&&(o[i]=n[i],t.setStaticValue(i,0))}null==t||t.render();for(const e in o)t.setStaticValue(e,o[e]);t.scheduleRender()}getProjectionStyles(t={}){var e,n,o;const i={};if(!this.instance||this.isSVG)return i;if(!this.isVisible)return{visibility:"hidden"};i.visibility="";const r=null===(e=this.options.visualElement)||void 0===e?void 0:e.getProps().transformTemplate;if(this.needsReset)return this.needsReset=!1,i.opacity="",i.pointerEvents=jt(t.pointerEvents)||"",i.transform=r?r(this.latestValues,""):"none",i;const s=this.getLead();if(!this.projectionDelta||!this.layout||!s.target){const e={};return this.options.layoutId&&(e.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,e.pointerEvents=jt(t.pointerEvents)||""),this.hasProjected&&!bi(this.latestValues)&&(e.transform=r?r({},""):"none",this.hasProjected=!1),e}const a=s.animationValues||s.latestValues;this.applyTransformsToTarget(),i.transform=Wr(this.projectionDeltaWithTransform,this.treeScale,a),r&&(i.transform=r(a,i.transform));const{x:l,y:u}=this.projectionDelta;i.transformOrigin=`${100*l.origin}% ${100*u.origin}% 0`,s.animationValues?i.opacity=s===this?null!==(o=null!==(n=a.opacity)&&void 0!==n?n:this.latestValues.opacity)&&void 0!==o?o:1:this.preserveOpacity?this.latestValues.opacity:a.opacityExit:i.opacity=s===this?void 0!==a.opacity?a.opacity:"":void 0!==a.opacityExit?a.opacityExit:0;for(const t in O){if(void 0===a[t])continue;const{correct:e,applyTo:n}=O[t],o=e(a[t],s);if(n){const t=n.length;for(let e=0;e<t;e++)i[n[e]]=o}else i[t]=o}return this.options.layoutId&&(i.pointerEvents=s===this?jt(t.pointerEvents)||"":"none"),i}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(t=>{var e;return null===(e=t.currentAnimation)||void 0===e?void 0:e.stop()}),this.root.nodes.forEach(Jr),this.root.sharedNodes.clear()}}}function qr(t){t.updateLayout()}function Zr(t){var e,n,o;const i=(null===(e=t.resumeFrom)||void 0===e?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&i&&t.hasListeners("didUpdate")){const{layoutBox:e,measuredBox:n}=t.layout,{animationType:o}=t.options,r=i.source!==t.layout.source;"size"===o?yi(t=>{const n=r?i.measuredBox[t]:i.layoutBox[t],o=ri(n);n.min=e[t].min,n.max=n.min+o}):hs(o,i.layoutBox,e)&&yi(t=>{const n=r?i.measuredBox[t]:i.layoutBox[t],o=ri(e[t]);n.max=n.min+o});const s={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};li(s,e,i.layoutBox);const a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};r?li(a,t.applyTransform(n,!0),i.measuredBox):li(a,e,i.layoutBox);const l=!jr(s);let u=!1;if(!t.resumeFrom){const n=t.getClosestProjectingParent();if(n&&!n.resumeFrom){const{snapshot:t,layout:o}=n;if(t&&o){const n={x:{min:0,max:0},y:{min:0,max:0}};hi(n,i.layoutBox,t.layoutBox);const r={x:{min:0,max:0},y:{min:0,max:0}};hi(r,e,o.layoutBox),Ur(n,r)||(u=!0)}}}t.notifyListeners("didUpdate",{layout:e,snapshot:i,delta:a,layoutDelta:s,hasLayoutChanged:l,hasRelativeTargetChanged:u})}else t.isLead()&&(null===(o=(n=t.options).onExitComplete)||void 0===o||o.call(n));t.options.transition=void 0}function Kr(t){t.isProjectionDirty||(t.isProjectionDirty=Boolean(t.parent&&t.parent.isProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=Boolean(t.parent&&t.parent.isTransformDirty))}function _r(t){t.clearSnapshot()}function Jr(t){t.clearMeasurements()}function Qr(t){const{visualElement:e}=t.options;(null==e?void 0:e.getProps().onBeforeLayoutMeasure)&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function ts(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0}function es(t){t.resolveTargetDelta()}function ns(t){t.calcProjection()}function os(t){t.resetRotation()}function is(t){t.removeLeadSnapshot()}function rs(t,e,n){t.translate=jn(e.translate,0,n),t.scale=jn(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function ss(t,e,n,o){t.min=jn(e.min,n.min,o),t.max=jn(e.max,n.max,o)}function as(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}const ls={duration:.45,ease:[.4,0,.1,1]};function us(t,e){let n=t.root;for(let e=t.path.length-1;e>=0;e--)if(Boolean(t.path[e].instance)){n=t.path[e];break}const o=(n&&n!==t.root?n.instance:document).querySelector(`[data-projection-id="${e}"]`);o&&t.mount(o,!0)}function cs(t){t.min=Math.round(t.min),t.max=Math.round(t.max)}function hs(t,e,n){return"position"===t||"preserve-aspect"===t&&!si(Nr(e),Nr(n),.2)}const ds=Gr({attachResizeListener:(t,e)=>Yt(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),ps={current:void 0},fs=Gr({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!ps.current){const t=new ds(0,{});t.mount(window),t.setOptions({layoutScroll:!0}),ps.current=t}return ps.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)}),ms={...Zo,...Ve,...Ui,...Er},gs=k((t,e)=>Ht(t,e,ms,fr,fs));const vs=k(Ht);function ys(){const t=e.useRef(!1);return h(()=>(t.current=!0,()=>{t.current=!1}),[]),t}function xs(){const t=ys(),[n,o]=e.useState(0),i=e.useCallback(()=>{t.current&&o(n+1)},[n]);return[e.useCallback(()=>Ln.postRender(i),[i]),n]}class Es extends r.Component{getSnapshotBeforeUpdate(t){const e=this.props.childRef.current;if(e&&t.isPresent&&!this.props.isPresent){const t=this.props.sizeRef.current;t.height=e.offsetHeight||0,t.width=e.offsetWidth||0,t.top=e.offsetTop,t.left=e.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function ws({children:t,isPresent:n}){const o=e.useId(),i=e.useRef(null),s=e.useRef({width:0,height:0,top:0,left:0});return e.useInsertionEffect(()=>{const{width:t,height:e,top:r,left:a}=s.current;if(n||!i.current||!t||!e)return;i.current.dataset.motionPopId=o;const l=document.createElement("style");return document.head.appendChild(l),l.sheet&&l.sheet.insertRule(`\n [data-motion-pop-id="${o}"] {\n position: absolute !important;\n width: ${t}px !important;\n height: ${e}px !important;\n top: ${r}px !important;\n left: ${a}px !important;\n }\n `),()=>{document.head.removeChild(l)}},[n]),r.createElement(Es,{isPresent:n,childRef:i,sizeRef:s},r.cloneElement(t,{ref:i}))}const bs=({children:t,initial:n,isPresent:o,onExitComplete:i,custom:s,presenceAffectsLayout:a,mode:l})=>{const c=S(Ps),h=e.useId(),d=e.useMemo(()=>({id:h,initial:n,isPresent:o,custom:s,onExitComplete:t=>{c.set(t,!0);for(const t of c.values())if(!t)return;i&&i()},register:t=>(c.set(t,!1),()=>c.delete(t))}),a?void 0:[o]);return e.useMemo(()=>{c.forEach((t,e)=>c.set(e,!1))},[o]),r.useEffect(()=>{!o&&!c.size&&i&&i()},[o]),"popLayout"===l&&(t=r.createElement(ws,{isPresent:o},t)),r.createElement(u.Provider,{value:d},t)};function Ps(){return new Map}const Ss=t=>t.key||"";const Ts=e.createContext(null),As=t=>!t.isLayoutDirty&&t.willUpdate(!1);function Vs(){const t=new Set,e=new WeakMap,n=()=>t.forEach(As);return{add:o=>{t.add(o),e.set(o,o.addEventListener("willUpdate",n))},remove:o=>{var i;t.delete(o),null===(i=e.get(o))||void 0===i||i(),e.delete(o),n()},dirty:n}}const Cs=t=>!0===t,Ms=({children:t,id:n,inheritId:o,inherit:i=!0})=>{void 0!==o&&(i=o);const s=e.useContext(V),a=e.useContext(Ts),[l,u]=xs(),c=e.useRef(null),h=s.id||a;null===c.current&&((t=>Cs(!0===t)||"id"===t)(i)&&h&&(n=n?h+"-"+n:h),c.current={id:n,group:Cs(i)&&s.group||Vs()});const d=e.useMemo(()=>({...c.current,forceRender:l}),[u]);return r.createElement(V.Provider,{value:d},t)};let Rs=0;function Ls(t){return"function"==typeof t}const Ds=e.createContext(null);const ks=e.forwardRef((function({children:t,as:n="ul",axis:o="y",onReorder:i,values:s,...a},l){const u=S(()=>gs(n)),c=[],h=e.useRef(!1),d={axis:o,registerItem:(t,e)=>{e&&-1===c.findIndex(e=>t===e.value)&&(c.push({value:t,layout:e[o]}),c.sort(Fs))},updateOrder:(t,e,n)=>{if(h.current)return;const o=function(t,e,n,o){if(!o)return t;const i=t.findIndex(t=>t.value===e);if(-1===i)return t;const r=o>0?1:-1,s=t[i+r];if(!s)return t;const a=t[i],l=s.layout,u=jn(l.min,l.max,.5);return 1===r&&a.layout.max+n>u||-1===r&&a.layout.min+n<u?function([...t],e,n){const o=e<0?t.length+e:e;if(o>=0&&o<t.length){const o=n<0?t.length+n:n,[i]=t.splice(e,1);t.splice(o,0,i)}return t}(t,i,i+r):t}(c,t,e,n);c!==o&&(h.current=!0,i(o.map(Bs).filter(t=>-1!==s.indexOf(t))))}};return e.useEffect(()=>{h.current=!1}),r.createElement(u,{...a,ref:l},r.createElement(Ds.Provider,{value:d},t))}));function Bs(t){return t.value}function Fs(t,e){return t.layout.min-e.layout.min}function Os(t){const n=S(()=>So(t)),{isStatic:o}=e.useContext(s);if(o){const[,o]=e.useState(t);e.useEffect(()=>n.onChange(o),[])}return n}function Is(...t){const e=!Array.isArray(t[0]),n=e?0:-1,o=t[0+n],i=t[1+n],r=t[2+n],s=t[3+n],a=_n(i,r,{mixer:(l=r[0],(t=>"object"==typeof t&&t.mix)(l)?l.mix:void 0),...s});var l;return e?a(o):a}function js(t,e){const n=Os(e()),o=()=>n.set(e());return o(),function(t,e,n){h(()=>{const o=t.map(t=>t.onChange(e));return()=>{o.forEach(t=>t()),n()}})}(t,()=>Ln.update(o,!1,!0),()=>Dn.update(o)),n}function Us(t,e,n,o){const i="function"==typeof e?e:Is(e,n,o);return Array.isArray(t)?Ns(t,i):Ns([t],([t])=>i(t))}function Ns(t,e){const n=S(()=>[]);return js(t,()=>{n.length=0;const o=t.length;for(let e=0;e<o;e++)n[e]=t[e].get();return e(n)})}function zs(t,e=0){return z(t)?t:Os(e)}const Ws={Group:ks,Item:e.forwardRef((function({children:t,style:n={},value:o,as:i="li",onDrag:s,layout:a=!0,...l},u){const c=S(()=>gs(i)),h=e.useContext(Ds),d={x:zs(n.x),y:zs(n.y)},p=Us([d.x,d.y],([t,e])=>t||e?1:"unset"),f=e.useRef(null),{axis:m,registerItem:g,updateOrder:v}=h;return e.useEffect(()=>{g(o,f.current)},[h]),r.createElement(c,{drag:m,...l,dragSnapToOrigin:!0,style:{...n,x:d.x,y:d.y,zIndex:p},layout:a,onDrag:(t,e)=>{const{velocity:n}=e;n[m]&&v(o,d[m].get(),n[m]),s&&s(t,e)},onLayoutMeasure:t=>{f.current=t},ref:u},t)}))},Hs={renderer:fr,...Zo,...Ve},$s={...Hs,...Ui,...Er,projectionNodeConstructor:fs};const Ys=t=>"number"==typeof t;function Xs(t,e){return(t=>Array.isArray(t)&&!Ys(t[0]))(t)?t[((t,e,n)=>{const o=e-t;return((n-t)%o+o)%o+t})(0,t.length,e)]:t}const Gs=(t,e,n)=>-n*t+n*e+t,qs=t=>t,Zs=(t,e,n)=>e-t==0?1:(n-t)/(e-t);function Ks(t,e){const n=t[t.length-1];for(let o=1;o<=e;o++){const i=Zs(0,e,o);t.push(Gs(n,1,i))}}function _s(t){const e=[0];return Ks(e,t-1),e}function Js(t,e=_s(t.length),n=qs){const o=t.length,i=o-e.length;return i>0&&Ks(e,i),i=>{let r=0;for(;r<o-2&&!(i<e[r+1]);r++);let s=(a=0,l=1,u=Zs(e[r],e[r+1],i),Math.min(Math.max(u,a),l));var a,l,u;return s=Xs(n,r)(s),Gs(t[r],t[r+1],s)}}const Qs=t=>"function"==typeof t,ta=t=>"string"==typeof t;function ea(t,e){var n;return"string"==typeof t?e?(null!==(n=e[t])&&void 0!==n||(e[t]=document.querySelectorAll(t)),t=e[t]):t=document.querySelectorAll(t):t instanceof Element&&(t=[t]),Array.from(t||[])}const na={any:0,all:1};const oa=new WeakMap;let ia;function ra({target:t,contentRect:e,borderBoxSize:n}){var o;null===(o=oa.get(t))||void 0===o||o.forEach(o=>{o({target:t,contentSize:e,get size(){return function(t,e){if(e){const{inlineSize:t,blockSize:n}=e[0];return{width:t,height:n}}return t instanceof SVGElement&&"getBBox"in t?t.getBBox():{width:t.offsetWidth,height:t.offsetHeight}}(t,n)}})})}function sa(t){t.forEach(ra)}function aa(t,e){ia||"undefined"!=typeof ResizeObserver&&(ia=new ResizeObserver(sa));const n=ea(t);return n.forEach(t=>{let n=oa.get(t);n||(n=new Set,oa.set(t,n)),n.add(e),null==ia||ia.observe(t)}),()=>{n.forEach(t=>{const n=oa.get(t);null==n||n.delete(e),(null==n?void 0:n.size)||null==ia||ia.unobserve(t)})}}const la=new Set;let ua;function ca(t){return la.add(t),ua||(ua=()=>{const t={width:window.innerWidth,height:window.innerHeight},e={target:window,size:t,contentSize:t};la.forEach(t=>t(e))},window.addEventListener("resize",ua)),()=>{la.delete(t),!la.size&&ua&&(ua=void 0)}}const ha={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}};function da(t,e,n,o){const i=n[e],{length:r,position:s}=ha[e],a=i.current,l=n.time;i.current=t["scroll"+s],i.scrollLength=t["scroll"+r]-t["client"+r],i.offset.length=0,i.offset[0]=0,i.offset[1]=i.scrollLength,i.progress=Zs(0,i.scrollLength,i.current);const u=o-l;var c,h;i.velocity=u>50?0:(c=i.current-a,(h=u)?c*(1e3/h):0)}const pa={Enter:[[0,1],[1,1]],Exit:[[0,0],[1,0]],Any:[[1,0],[0,1]],All:[[0,0],[1,1]]},fa={start:0,center:.5,end:1};function ma(t,e,n=0){let o=0;if(void 0!==fa[t]&&(t=fa[t]),ta(t)){const e=parseFloat(t);t.endsWith("px")?o=e:t.endsWith("%")?t=e/100:t.endsWith("vw")?o=e/100*document.documentElement.clientWidth:t.endsWith("vh")?o=e/100*document.documentElement.clientHeight:t=e}return Ys(t)&&(o=e*t),n+o}const ga=[0,0];function va(t,e,n,o){let i=Array.isArray(t)?t:ga,r=0,s=0;return Ys(t)?i=[t,t]:ta(t)&&(i=(t=t.trim()).includes(" ")?t.split(" "):[t,fa[t]?t:"0"]),r=ma(i[0],n,o),s=ma(i[1],e),r-s}const ya={x:0,y:0};function xa(t,e,n){let{offset:o=pa.All}=n;const{target:i=t,axis:r="y"}=n,s="y"===r?"height":"width",a=i!==t?function(t,e){let n={x:0,y:0},o=t;for(;o&&o!==e;)if(o instanceof HTMLElement)n.x+=o.offsetLeft,n.y+=o.offsetTop,o=o.offsetParent;else if(o instanceof SVGGraphicsElement&&"getBBox"in o){const{top:t,left:e}=o.getBBox();for(n.x+=e,n.y+=t;o&&"svg"!==o.tagName;)o=o.parentNode}return n}(i,t):ya,l=i===t?{width:t.scrollWidth,height:t.scrollHeight}:{width:i.clientWidth,height:i.clientHeight},u={width:t.clientWidth,height:t.clientHeight};e[r].offset.length=0;let c=!e[r].interpolate;const h=o.length;for(let t=0;t<h;t++){const n=va(o[t],u[s],l[s],a[r]);c||n===e[r].interpolatorOffsets[t]||(c=!0),e[r].offset[t]=n}c&&(e[r].interpolate=Js(_s(h),e[r].offset),e[r].interpolatorOffsets=[...e[r].offset]),e[r].progress=e[r].interpolate(e[r].current)}function Ea(t,e,n,o={}){const i=o.axis||"y";return{measure:()=>function(t,e=t,n){if(n.x.targetOffset=0,n.y.targetOffset=0,e!==t){let o=e;for(;o&&o!=t;)n.x.targetOffset+=o.offsetLeft,n.y.targetOffset+=o.offsetTop,o=o.offsetParent}n.x.targetLength=e===t?e.scrollWidth:e.clientWidth,n.y.targetLength=e===t?e.scrollHeight:e.clientHeight,n.x.containerLength=t.clientWidth,n.y.containerLength=t.clientHeight}(t,o.target,n),update:e=>{!function(t,e,n){da(t,"x",e,n),da(t,"y",e,n),e.time=n}(t,n,e),(o.offset||o.target)&&xa(t,n,o)},notify:Qs(e)?()=>e(n):wa(e,n[i])}}function wa(t,e){return t.pause(),t.forEachNative((t,{easing:e})=>{var n,o;if(t.updateDuration)e||(t.easing=qs),t.updateDuration(1);else{const i={duration:1e3};e||(i.easing="linear"),null===(o=null===(n=t.effect)||void 0===n?void 0:n.updateTiming)||void 0===o||o.call(n,i)}}),()=>{t.currentTime=e.progress}}const ba=new WeakMap,Pa=new WeakMap,Sa=new WeakMap,Ta=t=>t===document.documentElement?window:t;function Aa(t,e={}){var{container:n=document.documentElement}=e,o=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(t);i<o.length;i++)e.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(t,o[i])&&(n[o[i]]=t[o[i]])}return n}(e,["container"]);let i=Sa.get(n);i||(i=new Set,Sa.set(n,i));const r=Ea(n,t,{time:0,x:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0},y:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0}},o);if(i.add(r),!ba.has(n)){const t=()=>{const t=performance.now();for(const t of i)t.measure();for(const e of i)e.update(t);for(const t of i)t.notify()};ba.set(n,t);const e=Ta(n);window.addEventListener("resize",t,{passive:!0}),n!==document.documentElement&&Pa.set(n,(a=t,Qs(s=n)?ca(s):aa(s,a))),e.addEventListener("scroll",t,{passive:!0})}var s,a;const l=ba.get(n),u=requestAnimationFrame(l);return()=>{var e;"function"!=typeof t&&t.stop(),cancelAnimationFrame(u);const o=Sa.get(n);if(!o)return;if(o.delete(r),o.size)return;const i=ba.get(n);ba.delete(n),i&&(Ta(n).removeEventListener("scroll",i),null===(e=Pa.get(n))||void 0===e||e(),window.removeEventListener("resize",i))}}const Va=()=>({scrollX:So(0),scrollY:So(0),scrollXProgress:So(0),scrollYProgress:So(0)});function Ca({container:t,target:n,layoutEffect:o=!0,...i}={}){const r=S(Va);return(o?h:e.useEffect)(()=>Aa(({x:t,y:e})=>{r.scrollX.set(t.current),r.scrollXProgress.set(t.progress),r.scrollY.set(e.current),r.scrollYProgress.set(e.progress)},{...i,container:(null==t?void 0:t.current)||void 0,target:(null==n?void 0:n.current)||void 0}),[]),r}function Ma(t){const n=e.useRef(0),{isStatic:o}=e.useContext(s);e.useEffect(()=>{if(o)return;const e=({timestamp:e,delta:o})=>{n.current||(n.current=e),t(e-n.current,o)};return Ln.update(e,!0),()=>Dn.update(e)},[t])}class Ra extends Po{constructor(){super(...arguments),this.members=[],this.transforms=new Set}add(t){let e;U.has(t)?(this.transforms.add(t),e="transform"):t.startsWith("origin")||Y(t)||"willChange"===t||(e=Mt(t)),e&&(Eo(this.members,e),this.update())}remove(t){U.has(t)?(this.transforms.delete(t),this.transforms.size||wo(this.members,"transform")):wo(this.members,Mt(t)),this.update()}update(){this.set(this.members.length?this.members.join(", "):"auto")}}function La(){!or.current&&ir();const[t]=e.useState(nr.current);return t}function Da(){let t=!1;const e=[],n=new Set,o={subscribe:t=>(n.add(t),()=>{n.delete(t)}),start(o,i){if(t){const t=[];return n.forEach(e=>{t.push(jo(e,o,{transitionOverride:i}))}),Promise.all(t)}return new Promise(t=>{e.push({animation:[o,i],resolve:t})})},set:t=>n.forEach(e=>{!function(t,e){Array.isArray(e)?ko(t,e):"string"==typeof e?ko(t,[e]):Do(t,e)}(e,t)}),stop(){n.forEach(t=>{!function(t){t.values.forEach(t=>t.stop())}(t)})},mount:()=>(t=!0,e.forEach(({animation:t,resolve:e})=>{o.start(...t).then(e)}),()=>{t=!1,o.stop()})};return o}function ka(){const t=S(Da);return e.useEffect(t.mount,[]),t}const Ba=ka,Fa=(t,e,n)=>{const o=e-t;return((n-t)%o+o)%o+t};class Oa{constructor(){this.componentControls=new Set}subscribe(t){return this.componentControls.add(t),()=>this.componentControls.delete(t)}start(t,e){this.componentControls.forEach(n=>{n.start(t.nativeEvent||t,e)})}}const Ia=()=>new Oa;function ja(t){return null!==t&&"object"==typeof t&&R in t}function Ua(){return Na}function Na(t){ps.current&&(ps.current.isUpdating=!1,ps.current.blockUpdate(),t&&t())}const za=()=>({});class Wa extends lr{build(){}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}resetTransform(){}restoreTransform(){}removeValueFromRenderState(){}renderInstance(){}scrapeMotionValuesFromProps(){return{}}getBaseTargetFromProps(){}readValueFromInstance(t,e,n){return n.initialState[e]||0}sortInstanceNodePosition(){return 0}makeTargetAnimatableFromInstance({transition:t,transitionEnd:e,...n}){return Bo(this,n,Oo(n,t||{},this)),{transition:t,transitionEnd:e,...n}}}const Ha=Ut({scrapeMotionValuesFromProps:za,createRenderState:za});const $a=t=>t>.001?1/t:1e5;t.AnimatePresence=({children:t,custom:n,initial:o=!0,onExitComplete:i,exitBeforeEnter:s,presenceAffectsLayout:a=!0,mode:l="sync"})=>{s&&(l="wait",ve(!1,"Replace exitBeforeEnter with mode='wait'"));let[u]=xs();const c=e.useContext(V).forceRender;c&&(u=c);const d=ys(),p=function(t){const n=[];return e.Children.forEach(t,t=>{e.isValidElement(t)&&n.push(t)}),n}(t);let f=p;const m=new Set,g=e.useRef(f),v=e.useRef(new Map).current,y=e.useRef(!0);if(h(()=>{y.current=!1,function(t,e){t.forEach(t=>{const n=Ss(t);e.set(n,t)})}(p,v),g.current=f}),de(()=>{y.current=!0,v.clear(),m.clear()}),y.current)return r.createElement(r.Fragment,null,f.map(t=>r.createElement(bs,{key:Ss(t),isPresent:!0,initial:!!o&&void 0,presenceAffectsLayout:a,mode:l},t)));f=[...f];const x=g.current.map(Ss),E=p.map(Ss),w=x.length;for(let t=0;t<w;t++){const e=x[t];-1===E.indexOf(e)&&m.add(e)}return"wait"===l&&m.size&&(f=[]),m.forEach(t=>{if(-1!==E.indexOf(t))return;const e=v.get(t);if(!e)return;const o=x.indexOf(t);f.splice(o,0,r.createElement(bs,{key:Ss(e),isPresent:!1,onExitComplete:()=>{v.delete(t),m.delete(t);const e=g.current.findIndex(e=>e.key===t);if(g.current.splice(e,1),!m.size){if(g.current=p,!1===d.current)return;u(),i&&i()}},custom:n,presenceAffectsLayout:a,mode:l},e))}),f=f.map(t=>{const e=t.key;return m.has(e)?t:r.createElement(bs,{key:Ss(t),isPresent:!0,presenceAffectsLayout:a,mode:l},t)}),"production"!==me&&"wait"===l&&f.length>1&&console.warn('You\'re attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.'),r.createElement(r.Fragment,null,m.size?f:f.map(t=>e.cloneElement(t)))},t.AnimateSharedLayout=({children:t})=>(r.useEffect(()=>{},[]),r.createElement(Ms,{id:S(()=>"asl-"+Rs++)},t)),t.DeprecatedLayoutGroupContext=Ts,t.DragControls=Oa,t.FlatTree=$r,t.LayoutGroup=Ms,t.LayoutGroupContext=V,t.LazyMotion=function({children:t,features:n,strict:o=!1}){const[,i]=e.useState(!Ls(n)),s=e.useRef(void 0);if(!Ls(n)){const{renderer:t,...e}=n;s.current=t,P(e)}return e.useEffect(()=>{Ls(n)&&n().then(({renderer:t,...e})=>{P(e),s.current=t,i(!0)})},[]),r.createElement(d.Provider,{value:{renderer:s.current,strict:o}},t)},t.MotionConfig=function({children:t,isValidProp:n,...o}){n&&xt(n),(o={...e.useContext(s),...o}).isStatic=S(()=>o.isStatic);const i=e.useMemo(()=>o,[JSON.stringify(o.transition),o.transformPagePoint,o.reducedMotion]);return r.createElement(s.Provider,{value:i},t)},t.MotionConfigContext=s,t.MotionContext=a,t.MotionValue=Po,t.PresenceContext=u,t.Reorder=Ws,t.SwitchLayoutGroupContext=M,t.VisualElement=lr,t.addPointerEvent=oe,t.addScaleCorrector=I,t.animate=wr,t.animateVisualElement=jo,t.animationControls=Da,t.animations=Zo,t.buildTransform=$,t.calcLength=ri,t.checkTargetForNewValues=Bo,t.clamp=G,t.createBox=vi,t.createDomMotionComponent=function(t){return L(Ht(t,{forwardMotionProps:!1},ms,fr,fs))},t.createMotionComponent=L,t.delay=In,t.distance=Ko,t.distance2D=_o,t.domAnimation=Hs,t.domMax=$s,t.filterProps=Et,t.isBrowser=c,t.isDragActive=ue,t.isMotionComponent=ja,t.isMotionValue=z,t.isValidMotionProp=vt,t.m=vs,t.makeUseVisualState=Ut,t.mix=jn,t.motion=gs,t.motionValue=So,t.pipe=fe,t.resolveMotionValue=jt,t.transform=Is,t.unwrapMotionComponent=function(t){if(ja(t))return t[R]},t.useAnimation=Ba,t.useAnimationControls=ka,t.useAnimationFrame=Ma,t.useCycle=function(...t){const n=e.useRef(0),[o,i]=e.useState(t[n.current]);return[o,e.useCallback(e=>{n.current="number"!=typeof e?Fa(0,t.length,n.current+1):e,i(t[n.current])},[t.length,...t])]},t.useDeprecatedAnimatedState=function(t){const[n,o]=e.useState(t),i=Ha({},!1),r=S(()=>new Wa({props:{},visualState:i},{initialState:t}));return e.useEffect(()=>(r.mount({}),()=>r.unmount()),[r]),e.useEffect(()=>{r.setProps({onUpdate:t=>{o({...t})}})},[o,r]),[n,S(()=>t=>jo(r,t))]},t.useDeprecatedInvertedScale=function(t){let e=Os(1),n=Os(1);const o=l();return t?(e=t.scaleX||e,n=t.scaleY||n):o&&(e=o.getValue("scaleX",1),n=o.getValue("scaleY",1)),{scaleX:Us(e,$a),scaleY:Us(n,$a)}},t.useDomEvent=Xt,t.useDragControls=function(){return S(Ia)},t.useElementScroll=function(t){return ve(!1,"useElementScroll is deprecated. Convert to useScroll({ container: ref })."),Ca({container:t})},t.useForceUpdate=xs,t.useInView=function(t,{root:n,margin:o,amount:i,once:r=!1}={}){const[s,a]=e.useState(!1);return e.useEffect(()=>{if(!t.current||r&&s)return;const e={root:n&&n.current||void 0,margin:o,amount:"some"===i?"any":i};return function(t,e,{root:n,margin:o,amount:i="any"}={}){if("undefined"==typeof IntersectionObserver)return()=>{};const r=ea(t),s=new WeakMap,a=new IntersectionObserver(t=>{t.forEach(t=>{const n=s.get(t.target);if(t.isIntersecting!==Boolean(n))if(t.isIntersecting){const n=e(t);Qs(n)?s.set(t.target,n):a.unobserve(t.target)}else n&&(n(t),s.delete(t.target))})},{root:n,rootMargin:o,threshold:"number"==typeof i?i:na[i]});return r.forEach(t=>a.observe(t)),()=>a.disconnect()}(t.current,()=>(a(!0),r?void 0:()=>a(!1)),e)},[n,t,o,r]),s},t.useInstantLayoutTransition=Ua,t.useInstantTransition=function(){const[t,n]=xs(),o=Ua();return e.useEffect(()=>{Ln.postRender(()=>Ln.postRender(()=>bn.current=!1))},[n]),e=>{o(()=>{bn.current=!0,t(),e()})}},t.useIsPresent=function(){return null===(t=e.useContext(u))||t.isPresent;var t},t.useIsomorphicLayoutEffect=h,t.useMotionTemplate=function(t,...e){const n=t.length;return js(e,(function(){let o="";for(let i=0;i<n;i++){o+=t[i];e[i]&&(o+=e[i].get())}return o}))},t.useMotionValue=Os,t.usePresence=Ce,t.useReducedMotion=La,t.useReducedMotionConfig=function(){const t=La(),{reducedMotion:n}=e.useContext(s);return"never"!==n&&("always"===n||t)},t.useResetProjection=function(){return r.useCallback(()=>{const t=ps.current;t&&t.resetTree()},[])},t.useScroll=Ca,t.useSpring=function(t,n={}){const{isStatic:o}=e.useContext(s),i=e.useRef(null),r=Os(z(t)?t.get():t);return e.useMemo(()=>r.attach((t,e)=>o?e(t):(i.current&&i.current.stop(),i.current=uo({from:r.get(),to:t,velocity:r.getVelocity(),...n,onUpdate:e}),r.get())),[JSON.stringify(n)]),function(t,e){h(()=>{if(z(t))return e(t.get()),t.onChange(e)},[t,e])}(t,t=>r.set(parseFloat(t))),r},t.useTime=function(){const t=Os(0);return Ma(e=>t.set(e)),t},t.useTransform=Us,t.useUnmountEffect=de,t.useVelocity=function(t){const n=Os(t.getVelocity());return e.useEffect(()=>t.velocityUpdateSubscribers.add(t=>{n.set(t)}),[t]),n},t.useViewportScroll=function(){return ve(!1,"useViewportScroll is deprecated. Convert to useScroll()."),Ca()},t.useVisualElementContext=l,t.useWillChange=function(){return S(()=>new Ra("auto"))},t.wrap=Fa,t.wrapHandler=Qt,Object.defineProperty(t,"__esModule",{value:!0})}));
|