framer-motion 9.0.3 → 9.0.4
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 +16 -17
- package/dist/es/render/html/utils/build-styles.mjs +2 -4
- package/dist/es/render/html/utils/build-transform.mjs +12 -10
- package/dist/es/render/html/utils/create-render-state.mjs +0 -1
- package/dist/es/render/utils/motion-values.mjs +1 -1
- package/dist/es/value/index.mjs +1 -1
- package/dist/framer-motion.dev.js +16 -17
- package/dist/framer-motion.js +1 -1
- package/dist/index.d.ts +1 -6
- package/dist/projection.dev.js +16 -16
- package/dist/size-rollup-dom-animation-assets.js +1 -1
- package/dist/size-rollup-dom-animation-m.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/package.json +7 -7
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 i(t){if(t&&t.__esModule)return t;var e=Object.create(null);return t&&Object.keys(t).forEach((function(n){if("default"!==n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}})),e.default=t,Object.freeze(e)}var o=i(e),s=n(e);const r=e.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),a=e.createContext({});function c(){return e.useContext(a).visualElement}const u=e.createContext(null),l="undefined"!=typeof document,h=l?e.useLayoutEffect:e.useEffect,d=e.createContext({strict:!1});function p(t){return"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}function m(t){return"string"==typeof t||Array.isArray(t)}function f(t){return"object"==typeof t&&"function"==typeof t.start}const g=["initial","animate","exit","whileHover","whileDrag","whileTap","whileFocus","whileInView"];function y(t){return f(t.animate)||g.some(e=>m(t[e]))}function v(t){return Boolean(y(t)||t.variants)}function x(t){const{initial:n,animate:i}=function(t,e){if(y(t)){const{initial:e,animate:n}=t;return{initial:!1===e||m(e)?e:void 0,animate:m(n)?n:void 0}}return!1!==t.inherit?e:{}}(t,e.useContext(a));return e.useMemo(()=>({initial:n,animate:i}),[P(n),P(i)])}function P(t){return Array.isArray(t)?t.join(" "):t}const E={animation:["animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},b={};for(const t in E)b[t]={isEnabled:e=>E[t].some(t=>!!e[t])};function w(t){for(const e in t)b[e]={...b[e],...t[e]}}function T(t){const n=e.useRef(null);return null===n.current&&(n.current=t()),n.current}const A={hasAnimatedSinceResize:!0,hasEverUpdated:!1};let S=1;const C=e.createContext({}),V=e.createContext({}),M=Symbol.for("motionComponentSymbol");function L({preloadedFeatures:t,createVisualElement:n,useRender:i,useVisualState:s,Component:m}){t&&w(t);const f=e.forwardRef((function(f,g){let y;const v={...e.useContext(r),...f,layoutId:R(f)},{isStatic:P}=v,E=x(f),b=P?void 0:T(()=>{if(A.hasEverUpdated)return S++}),w=s(f,P);if(!P&&l){E.visualElement=function(t,n,i,o){const s=c(),a=e.useContext(d),l=e.useContext(u),p=e.useContext(r).reducedMotion,m=e.useRef();o=o||a.renderer,!m.current&&o&&(m.current=o(t,{visualState:n,parent:s,props:i,presenceContext:l,blockInitialAnimation:!!l&&!1===l.initial,reducedMotionConfig:p}));const f=m.current;return e.useInsertionEffect(()=>{f&&f.update(i,l)}),h(()=>{f&&f.render()}),e.useEffect(()=>{f&&f.updateFeatures()}),(window.HandoffAppearAnimations?h:e.useEffect)(()=>{f&&f.animationState&&f.animationState.animateChanges()}),f}(m,w,v,n);const i=e.useContext(V),o=e.useContext(d).strict;E.visualElement&&(y=E.visualElement.loadFeatures(v,o,t,b,i))}return o.createElement(a.Provider,{value:E},y&&E.visualElement?o.createElement(y,{visualElement:E.visualElement,...v}):null,i(m,f,b,function(t,n,i){return e.useCallback(e=>{e&&t.mount&&t.mount(e),n&&(e?n.mount(e):n.unmount()),i&&("function"==typeof i?i(e):p(i)&&(i.current=e))},[n])}(w,E.visualElement,g),w,P,E.visualElement))}));return f[M]=m,f}function R({layoutId:t}){const n=e.useContext(C).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,i)=>(n.has(i)||n.set(i,e(i)),n.get(i))})}const D=["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 B(t){return"string"==typeof t&&!t.includes("-")&&!!(D.indexOf(t)>-1||/[A-Z]/.test(t))}const F={};function O(t){Object.assign(F,t)}const I=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],j=new Set(I);function U(t,{layout:e,layoutId:n}){return j.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!F[t]||"opacity"===t)}const N=t=>Boolean(t&&t.getVelocity),z={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},W=(t,e)=>I.indexOf(t)-I.indexOf(e);function H({transform:t,transformKeys:e},{enableHardwareAcceleration:n=!0,allowTransformNone:i=!0},o,s){let r="";e.sort(W);for(const n of e)r+=`${z[n]||n}(${t[n]}) `;return n&&!t.z&&(r+="translateZ(0)"),r=r.trim(),s?r=s(t,o?"":r):i&&o&&(r="none"),r}function $(t){return t.startsWith("--")}const Y=(t,e)=>e&&"number"==typeof t?e.transform(t):t,X=(t,e,n)=>Math.min(Math.max(n,t),e),G={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},q={...G,transform:t=>X(0,1,t)},Z={...G,default:1},K=t=>Math.round(1e5*t)/1e5,_=/(-)?([\d]*\.?[\d])+/g,J=/(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,Q=/^(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function tt(t){return"string"==typeof t}const et=t=>({test:e=>tt(e)&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),nt=et("deg"),it=et("%"),ot=et("px"),st=et("vh"),rt=et("vw"),at={...it,parse:t=>it.parse(t)/100,transform:t=>it.transform(100*t)},ct={...G,transform:Math.round},ut={borderWidth:ot,borderTopWidth:ot,borderRightWidth:ot,borderBottomWidth:ot,borderLeftWidth:ot,borderRadius:ot,radius:ot,borderTopLeftRadius:ot,borderTopRightRadius:ot,borderBottomRightRadius:ot,borderBottomLeftRadius:ot,width:ot,maxWidth:ot,height:ot,maxHeight:ot,size:ot,top:ot,right:ot,bottom:ot,left:ot,padding:ot,paddingTop:ot,paddingRight:ot,paddingBottom:ot,paddingLeft:ot,margin:ot,marginTop:ot,marginRight:ot,marginBottom:ot,marginLeft:ot,rotate:nt,rotateX:nt,rotateY:nt,rotateZ:nt,scale:Z,scaleX:Z,scaleY:Z,scaleZ:Z,skew:nt,skewX:nt,skewY:nt,distance:ot,translateX:ot,translateY:ot,translateZ:ot,x:ot,y:ot,z:ot,perspective:ot,transformPerspective:ot,opacity:q,originX:at,originY:at,originZ:ot,zIndex:ct,fillOpacity:q,strokeOpacity:q,numOctaves:ct};function lt(t,e,n,i){const{style:o,vars:s,transform:r,transformKeys:a,transformOrigin:c}=t;a.length=0;let u=!1,l=!1,h=!0;for(const t in e){const n=e[t];if($(t)){s[t]=n;continue}const i=ut[t],d=Y(n,i);if(j.has(t)){if(u=!0,r[t]=d,a.push(t),!h)continue;n!==(i.default||0)&&(h=!1)}else t.startsWith("origin")?(l=!0,c[t]=d):o[t]=d}if(e.transform||(u||i?o.transform=H(t,n,h,i):o.transform&&(o.transform="none")),l){const{originX:t="50%",originY:e="50%",originZ:n=0}=c;o.transformOrigin=`${t} ${e} ${n}`}}const ht=()=>({style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}});function dt(t,e,n){for(const i in e)N(e[i])||U(i,n)||(t[i]=e[i])}function pt(t,n,i){const o={};return dt(o,t.style||{},t),Object.assign(o,function({transformTemplate:t},n,i){return e.useMemo(()=>{const e={style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}};return lt(e,n,{enableHardwareAcceleration:!i},t),Object.assign({},e.vars,e.style)},[n])}(t,n,i)),t.transformValues?t.transformValues(o):o}function mt(t,e,n){const i={},o=pt(t,e,n);return t.drag&&!1!==t.dragListener&&(i.draggable=!1,o.userSelect=o.WebkitUserSelect=o.WebkitTouchCallout="none",o.touchAction=!0===t.drag?"none":"pan-"+("x"===t.drag?"y":"x")),void 0===t.tabIndex&&(t.onTap||t.onTapStart||t.whileTap)&&(i.tabIndex=0),i.style=o,i}const ft=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","transformValues","custom","inherit","onLayoutAnimationStart","onLayoutAnimationComplete","onLayoutMeasure","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","ignoreStrict","viewport"]);function gt(t){return t.startsWith("while")||t.startsWith("drag")&&"draggable"!==t||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||ft.has(t)}let yt=t=>!gt(t);function vt(t){t&&(yt=e=>e.startsWith("on")?!gt(e):t(e))}try{vt(require("@emotion/is-prop-valid").default)}catch(t){}function xt(t,e,n){const i={};for(const o in t)"values"===o&&"object"==typeof t.values||(yt(o)||!0===n&>(o)||!e&&!gt(o)||t.draggable&&o.startsWith("onDrag"))&&(i[o]=t[o]);return i}function Pt(t,e,n){return"string"==typeof t?t:ot.transform(e+n*t)}const Et={offset:"stroke-dashoffset",array:"stroke-dasharray"},bt={offset:"strokeDashoffset",array:"strokeDasharray"};function wt(t,{attrX:e,attrY:n,originX:i,originY:o,pathLength:s,pathSpacing:r=1,pathOffset:a=0,...c},u,l,h){if(lt(t,c,u,h),l)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:d,style:p,dimensions:m}=t;d.transform&&(m&&(p.transform=d.transform),delete d.transform),m&&(void 0!==i||void 0!==o||p.transform)&&(p.transformOrigin=function(t,e,n){return`${Pt(e,t.x,t.width)} ${Pt(n,t.y,t.height)}`}(m,void 0!==i?i:.5,void 0!==o?o:.5)),void 0!==e&&(d.x=e),void 0!==n&&(d.y=n),void 0!==s&&function(t,e,n=1,i=0,o=!0){t.pathLength=1;const s=o?Et:bt;t[s.offset]=ot.transform(-i);const r=ot.transform(e),a=ot.transform(n);t[s.array]=`${r} ${a}`}(d,s,r,a,!1)}const Tt=()=>({style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{},attrs:{}}),At=t=>"string"==typeof t&&"svg"===t.toLowerCase();function St(t,n,i,o){const s=e.useMemo(()=>{const e={style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{},attrs:{}};return wt(e,n,{enableHardwareAcceleration:!1},At(o),t.transformTemplate),{...e.attrs,style:{...e.style}}},[n]);if(t.style){const e={};dt(e,t.style,t),s.style={...e,...s.style}}return s}function Ct(t=!1){return(n,i,o,s,{latestValues:r},a)=>{const c=(B(n)?St:mt)(i,r,a,n),u={...xt(i,"string"==typeof n,t),...c,ref:s},{children:l}=i,h=e.useMemo(()=>N(l)?l.get():l,[l]);return o&&(u["data-projection-id"]=o),e.createElement(n,{...u,children:h})}}const Vt=t=>t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();function Mt(t,{style:e,vars:n},i,o){Object.assign(t.style,e,o&&o.getProjectionStyles(i));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 Rt(t,e,n,i){Mt(t,e,void 0,i);for(const n in e.attrs)t.setAttribute(Lt.has(n)?n:Vt(n),e.attrs[n])}function kt(t,e){const{style:n}=t,i={};for(const o in n)(N(n[o])||e.style&&N(e.style[o])||U(o,t))&&(i[o]=n[o]);return i}function Dt(t,e){const n=kt(t,e);for(const i in t)if(N(t[i])||N(e[i])){n["x"===i||"y"===i?"attr"+i.toUpperCase():i]=t[i]}return n}function Bt(t,e,n,i={},o={}){return"function"==typeof e&&(e=e(void 0!==n?n:t.custom,i,o)),"string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e&&(e=e(void 0!==n?n:t.custom,i,o)),e}const Ft=t=>Array.isArray(t);function Ot(t){const e=N(t)?t.get():t;return n=e,Boolean(n&&"object"==typeof n&&n.mix&&n.toValue)?e.toValue():e;var n}const It=t=>(n,i)=>{const o=e.useContext(a),s=e.useContext(u),r=()=>function({scrapeMotionValuesFromProps:t,createRenderState:e,onMount:n},i,o,s){const r={latestValues:jt(i,o,s,t),renderState:e()};return n&&(r.mount=t=>n(i,t,r)),r}(t,n,o,s);return i?r():T(r)};function jt(t,e,n,i){const o={},s=i(t,{});for(const t in s)o[t]=Ot(s[t]);let{initial:r,animate:a}=t;const c=y(t),u=v(t);e&&u&&!c&&!1!==t.inherit&&(void 0===r&&(r=e.initial),void 0===a&&(a=e.animate));let l=!!n&&!1===n.initial;l=l||!1===r;const h=l?a:r;if(h&&"boolean"!=typeof h&&!f(h)){(Array.isArray(h)?h:[h]).forEach(e=>{const n=Bt(t,e);if(!n)return;const{transitionEnd:i,transition:s,...r}=n;for(const t in r){let e=r[t];if(Array.isArray(e)){e=e[l?e.length-1:0]}null!==e&&(o[t]=e)}for(const t in i)o[t]=i[t]})}return o}const Ut={useVisualState:It({scrapeMotionValuesFromProps:Dt,createRenderState:Tt,onMount:(t,e,{renderState:n,latestValues:i})=>{try{n.dimensions="function"==typeof e.getBBox?e.getBBox():e.getBoundingClientRect()}catch(t){n.dimensions={x:0,y:0,width:0,height:0}}wt(n,i,{enableHardwareAcceleration:!1},At(e.tagName),t.transformTemplate),Rt(e,n)}})},Nt={useVisualState:It({scrapeMotionValuesFromProps:kt,createRenderState:ht})};function zt(t,{forwardMotionProps:e=!1},n,i){return{...B(t)?Ut:Nt,preloadedFeatures:n,useRender:Ct(e),createVisualElement:i,Component:t}}function Wt(t,e,n,i={passive:!0}){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n)}const Ht=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary;function $t(t,e="page"){return{point:{x:t[e+"X"],y:t[e+"Y"]}}}const Yt=t=>e=>Ht(e)&&t(e,$t(e));function Xt(t,e,n,i){return Wt(t,e,Yt(n),i)}var Gt;t.AnimationType=void 0,(Gt=t.AnimationType||(t.AnimationType={})).Animate="animate",Gt.Hover="whileHover",Gt.Tap="whileTap",Gt.Drag="whileDrag",Gt.Focus="whileFocus",Gt.InView="whileInView",Gt.Exit="exit";const qt=(t,e)=>n=>e(t(n)),Zt=(...t)=>t.reduce(qt);function Kt(t){let e=null;return()=>{const n=()=>{e=null};return null===e&&(e=t,n)}}const _t=Kt("dragHorizontal"),Jt=Kt("dragVertical");function Qt(t){let e=!1;if("y"===t)e=Jt();else if("x"===t)e=_t();else{const t=_t(),n=Jt();t&&n?e=()=>{t(),n()}:(t&&t(),n&&n())}return e}function te(){const t=Qt(!0);return!t||(t(),!1)}class ee{constructor(t){this.isMounted=!1,this.node=t}update(){}}function ne(e,n){const i="pointer"+(n?"enter":"leave"),o="onHover"+(n?"Start":"End");return Xt(e.current,i,(i,s)=>{if("touch"===i.type||te())return;const r=e.getProps();e.animationState&&r.whileHover&&e.animationState.setActive(t.AnimationType.Hover,n),r[o]&&r[o](i,s)},{passive:!e.getProps()[o]})}const ie=(t,e)=>!!e&&(t===e||ie(t,e.parentElement)),oe=t=>t;function se(t,e){if(!e)return;const n=new PointerEvent("pointer"+t);e(n,$t(n))}const re=new WeakMap,ae=new WeakMap,ce=t=>{const e=re.get(t.target);e&&e(t)},ue=t=>{t.forEach(ce)};function le(t,e,n){const i=function({root:t,...e}){const n=t||document;ae.has(n)||ae.set(n,{});const i=ae.get(n),o=JSON.stringify(e);return i[o]||(i[o]=new IntersectionObserver(ue,{root:t,...e})),i[o]}(e);return re.set(t,n),i.observe(t),()=>{re.delete(t),i.unobserve(t)}}const he={some:0,all:1};const de={inView:{Feature:class extends ee{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}viewportFallback(){requestAnimationFrame(()=>{this.hasEnteredView=!0;const{onViewportEnter:e}=this.node.getProps();e&&e(null),this.node.animationState&&this.node.animationState.setActive(t.AnimationType.InView,!0)})}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:n,margin:i,amount:o="some",once:s,fallback:r=!0}=e;if("undefined"==typeof IntersectionObserver)return void(r&&this.viewportFallback());const a={root:n?n.current:void 0,rootMargin:i,threshold:"number"==typeof o?o:he[o]};return le(this.node.current,a,e=>{const{isIntersecting:n}=e;if(this.isInView===n)return;if(this.isInView=n,s&&!n&&this.hasEnteredView)return;n&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive(t.AnimationType.InView,n);const{onViewportEnter:i,onViewportLeave:o}=this.node.getProps(),r=n?i:o;r&&r(e)})}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;const{props:t,prevProps:e}=this.node;["amount","margin","root"].some(function({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}(t,e))&&this.startObserver()}unmount(){}}},tap:{Feature:class extends ee{constructor(){super(...arguments),this.removeStartListeners=oe,this.removeEndListeners=oe,this.removeAccessibleListeners=oe,this.startPointerPress=(t,e)=>{if(this.removeEndListeners(),this.isPressing)return;const n=this.node.getProps(),i=Xt(window,"pointerup",(t,e)=>{if(!this.checkPressEnd())return;const{onTap:n,onTapCancel:i}=this.node.getProps();ie(this.node.current,t.target)?n&&n(t,e):i&&i(t,e)},{passive:!(n.onTap||n.onPointerUp)}),o=Xt(window,"pointercancel",(t,e)=>this.cancelPress(t,e),{passive:!(n.onTapCancel||n.onPointerCancel)});this.removeEndListeners=Zt(i,o),this.startPress(t,e)},this.startAccessiblePress=()=>{const t=Wt(this.node.current,"keydown",t=>{if("Enter"!==t.key||this.isPressing)return;this.removeEndListeners(),this.removeEndListeners=Wt(this.node.current,"keyup",t=>{"Enter"===t.key&&this.checkPressEnd()&&se("up",this.node.getProps().onTap)}),se("down",(t,e)=>{this.startPress(t,e)})}),e=Wt(this.node.current,"blur",()=>{this.isPressing&&se("cancel",(t,e)=>this.cancelPress(t,e))});this.removeAccessibleListeners=Zt(t,e)}}startPress(e,n){this.isPressing=!0;const{onTapStart:i,whileTap:o}=this.node.getProps();o&&this.node.animationState&&this.node.animationState.setActive(t.AnimationType.Tap,!0),i&&i(e,n)}checkPressEnd(){this.removeEndListeners(),this.isPressing=!1;return this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive(t.AnimationType.Tap,!1),!te()}cancelPress(t,e){if(!this.checkPressEnd())return;const{onTapCancel:n}=this.node.getProps();n&&n(t,e)}mount(){const t=this.node.getProps(),e=Xt(this.node.current,"pointerdown",this.startPointerPress,{passive:!(t.onTapStart||t.onPointerStart)}),n=Wt(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=Zt(e,n)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}},focus:{Feature:class extends ee{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch(t){e=!0}e&&this.node.animationState&&(this.node.animationState.setActive(t.AnimationType.Focus,!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive(t.AnimationType.Focus,!1),this.isActive=!1)}mount(){this.unmount=Zt(Wt(this.node.current,"focus",()=>this.onFocus()),Wt(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends ee{mount(){this.unmount=Zt(ne(this.node,!0),ne(this.node,!1))}unmount(){}}}};function pe(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let i=0;i<n;i++)if(e[i]!==t[i])return!1;return!0}const me=t=>/^0[^.\s]+$/.test(t),fe={delta:0,timestamp:0},ge="undefined"!=typeof performance?()=>performance.now():()=>Date.now(),ye="undefined"!=typeof window?t=>window.requestAnimationFrame(t):t=>setTimeout(()=>t(ge()),1/60*1e3);let ve=!0,xe=!1,Pe=!1;const Ee=["read","update","preRender","render","postRender"],be=Ee.reduce((t,e)=>(t[e]=function(t){let e=[],n=[],i=0,o=!1,s=!1;const r=new WeakSet,a={schedule:(t,s=!1,a=!1)=>{const c=a&&o,u=c?e:n;return s&&r.add(t),-1===u.indexOf(t)&&(u.push(t),c&&o&&(i=e.length)),t},cancel:t=>{const e=n.indexOf(t);-1!==e&&n.splice(e,1),r.delete(t)},process:c=>{if(o)s=!0;else{if(o=!0,[e,n]=[n,e],n.length=0,i=e.length,i)for(let n=0;n<i;n++){const i=e[n];i(c),r.has(i)&&(a.schedule(i),t())}o=!1,s&&(s=!1,a.process(c))}}};return a}(()=>xe=!0),t),{}),we=Ee.reduce((t,e)=>{const n=be[e];return t[e]=(t,e=!1,i=!1)=>(xe||Ve(),n.schedule(t,e,i)),t},{}),Te=Ee.reduce((t,e)=>(t[e]=be[e].cancel,t),{}),Ae=Ee.reduce((t,e)=>(t[e]=()=>be[e].process(fe),t),{}),Se=t=>be[t].process(fe),Ce=t=>{xe=!1,fe.delta=ve?1/60*1e3:Math.max(Math.min(t-fe.timestamp,40),1),fe.timestamp=t,Pe=!0,Ee.forEach(Se),Pe=!1,xe&&(ve=!1,ye(Ce))},Ve=()=>{xe=!0,ve=!0,Pe||ye(Ce)};function Me(t,e){-1===t.indexOf(e)&&t.push(e)}function Le(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class Re{constructor(){this.subscriptions=[]}add(t){return Me(this.subscriptions,t),()=>Le(this.subscriptions,t)}notify(t,e,n){const i=this.subscriptions.length;if(i)if(1===i)this.subscriptions[0](t,e,n);else for(let o=0;o<i;o++){const i=this.subscriptions[o];i&&i(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function ke(t,e){return e?t*(1e3/e):0}class De{constructor(t,e={}){var n;this.version="9.0.3",this.timeDelta=0,this.lastUpdated=0,this.canTrackVelocity=!1,this.events={},this.updateAndNotify=(t,e=!0)=>{this.prev=this.current,this.current=t;const{delta:n,timestamp:i}=fe;this.lastUpdated!==i&&(this.timeDelta=n,this.lastUpdated=i,we.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.events.change&&this.events.change.notify(this.current),this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()),e&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.scheduleVelocityCheck=()=>we.postRender(this.velocityCheck),this.velocityCheck=({timestamp:t})=>{t!==this.lastUpdated&&(this.prev=this.current,this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=(n=this.current,!isNaN(parseFloat(n))),this.owner=e.owner}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new Re);const n=this.events[t].add(e);return"change"===t?()=>{n(),we.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t,e=!0){e&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,e)}setWithVelocity(t,e,n){this.set(e),this.prev=t,this.timeDelta=n}jump(t){this.updateAndNotify(t),this.prev=t,this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?ke(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e)||null,this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){this.animation=null}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Be(t,e){return new De(t,e)}const Fe=(t,e)=>n=>Boolean(tt(n)&&Q.test(n)&&n.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(n,e)),Oe=(t,e,n)=>i=>{if(!tt(i))return i;const[o,s,r,a]=i.match(_);return{[t]:parseFloat(o),[e]:parseFloat(s),[n]:parseFloat(r),alpha:void 0!==a?parseFloat(a):1}},Ie={...G,transform:t=>Math.round((t=>X(0,255,t))(t))},je={test:Fe("rgb","red"),parse:Oe("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:i=1})=>"rgba("+Ie.transform(t)+", "+Ie.transform(e)+", "+Ie.transform(n)+", "+K(q.transform(i))+")"};const Ue={test:Fe("#"),parse:function(t){let e="",n="",i="",o="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),i=t.substring(5,7),o=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),i=t.substring(3,4),o=t.substring(4,5),e+=e,n+=n,i+=i,o+=o),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:o?parseInt(o,16)/255:1}},transform:je.transform},Ne={test:Fe("hsl","hue"),parse:Oe("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:i=1})=>"hsla("+Math.round(t)+", "+it.transform(K(e))+", "+it.transform(K(n))+", "+K(q.transform(i))+")"},ze={test:t=>je.test(t)||Ue.test(t)||Ne.test(t),parse:t=>je.test(t)?je.parse(t):Ne.test(t)?Ne.parse(t):Ue.parse(t),transform:t=>tt(t)?t:t.hasOwnProperty("red")?je.transform(t):Ne.transform(t)};function We(t){"number"==typeof t&&(t=""+t);const e=[];let n=0,i=0;const o=t.match(J);o&&(n=o.length,t=t.replace(J,"${c}"),e.push(...o.map(ze.parse)));const s=t.match(_);return s&&(i=s.length,t=t.replace(_,"${n}"),e.push(...s.map(G.parse))),{values:e,numColors:n,numNumbers:i,tokenised:t}}function He(t){return We(t).values}function $e(t){const{values:e,numColors:n,tokenised:i}=We(t),o=e.length;return t=>{let e=i;for(let i=0;i<o;i++)e=e.replace(i<n?"${c}":"${n}",i<n?ze.transform(t[i]):K(t[i]));return e}}const Ye=t=>"number"==typeof t?0:t;const Xe={test:function(t){var e,n;return isNaN(t)&&tt(t)&&((null===(e=t.match(_))||void 0===e?void 0:e.length)||0)+((null===(n=t.match(J))||void 0===n?void 0:n.length)||0)>0},parse:He,createTransformer:$e,getAnimatableNone:function(t){const e=He(t);return $e(t)(e.map(Ye))}},Ge=new Set(["brightness","contrast","saturate","opacity"]);function qe(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[i]=n.match(_)||[];if(!i)return t;const o=n.replace(i,"");let s=Ge.has(e)?1:0;return i!==n&&(s*=100),e+"("+s+o+")"}const Ze=/([a-z-]*)\(.*?\)/g,Ke={...Xe,getAnimatableNone:t=>{const e=t.match(Ze);return e?e.map(qe).join(" "):t}},_e={...ut,color:ze,backgroundColor:ze,outlineColor:ze,fill:ze,stroke:ze,borderColor:ze,borderTopColor:ze,borderRightColor:ze,borderBottomColor:ze,borderLeftColor:ze,filter:Ke,WebkitFilter:Ke},Je=t=>_e[t];function Qe(t,e){let n=Je(t);return n!==Ke&&(n=Xe),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const tn=t=>e=>e.test(t),en=[G,ot,it,nt,rt,st,{test:t=>"auto"===t,parse:t=>t}],nn=t=>en.find(tn(t)),on=[...en,ze,Xe],sn=t=>on.find(tn(t));function rn(t,e,n){const i=t.getProps();return Bt(i,e,void 0!==n?n:i.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 an(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Be(n))}function cn(t,e){const n=rn(t,e);let{transitionEnd:i={},transition:o={},...s}=n?t.makeTargetAnimatable(n,!1):{};s={...s,...i};for(const e in s){an(t,e,(r=s[e],Ft(r)?r[r.length-1]||0:r))}var r}function un(t,e){[...e].reverse().forEach(n=>{const i=t.getVariant(n);i&&cn(t,i),t.variantChildren&&t.variantChildren.forEach(t=>{un(t,e)})})}function ln(t,e,n){var i,o;const s=Object.keys(e).filter(e=>!t.hasValue(e)),r=s.length;if(r)for(let a=0;a<r;a++){const r=s[a],c=e[r];let u=null;Array.isArray(c)&&(u=c[0]),null===u&&(u=null!==(o=null!==(i=n[r])&&void 0!==i?i:t.readValue(r))&&void 0!==o?o:e[r]),null!=u&&("string"==typeof u&&(/^\-?\d*\.?\d+$/.test(u)||me(u))?u=parseFloat(u):!sn(u)&&Xe.test(c)&&(u=Qe(r,c)),t.addValue(r,Be(u,{owner:t})),void 0===n[r]&&(n[r]=u),null!==u&&t.setBaseTarget(r,u))}}function hn(t,e){if(!e)return;return(e[t]||e.default||e).from}function dn(t,e,n){const i={};for(const o in t){const t=hn(o,e);if(void 0!==t)i[o]=t;else{const t=n.getValue(o);t&&(i[o]=t.get())}}return i}function pn(t){return Boolean(N(t)&&t.add)}const mn="data-"+Vt("framerAppearId");const fn=t=>1e3*t,gn={current:!1},yn=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,vn=t=>e=>1-t(1-e),xn=t=>t*t,Pn=vn(xn),En=yn(xn),bn=(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 Tn=(t,e,n)=>{const i=t*t;return Math.sqrt(Math.max(0,n*(e*e-i)+i))},An=[Ue,je,Ne];function Sn(t){const e=(n=t,An.find(t=>t.test(n)));var n;let i=e.parse(t);return e===Ne&&(i=function({hue:t,saturation:e,lightness:n,alpha:i}){t/=360,n/=100;let o=0,s=0,r=0;if(e/=100){const i=n<.5?n*(1+e):n+e-n*e,a=2*n-i;o=wn(a,i,t+1/3),s=wn(a,i,t),r=wn(a,i,t-1/3)}else o=s=r=n;return{red:Math.round(255*o),green:Math.round(255*s),blue:Math.round(255*r),alpha:i}}(i)),i}const Cn=(t,e)=>{const n=Sn(t),i=Sn(e),o={...n};return t=>(o.red=Tn(n.red,i.red,t),o.green=Tn(n.green,i.green,t),o.blue=Tn(n.blue,i.blue,t),o.alpha=bn(n.alpha,i.alpha,t),je.transform(o))};function Vn(t,e){return"number"==typeof t?n=>bn(t,e,n):ze.test(t)?Cn(t,e):Rn(t,e)}const Mn=(t,e)=>{const n=[...t],i=n.length,o=t.map((t,n)=>Vn(t,e[n]));return t=>{for(let e=0;e<i;e++)n[e]=o[e](t);return n}},Ln=(t,e)=>{const n={...t,...e},i={};for(const o in n)void 0!==t[o]&&void 0!==e[o]&&(i[o]=Vn(t[o],e[o]));return t=>{for(const e in i)n[e]=i[e](t);return n}},Rn=(t,e)=>{const n=Xe.createTransformer(e),i=We(t),o=We(e);return i.numColors===o.numColors&&i.numNumbers>=o.numNumbers?Zt(Mn(i.values,o.values),n):n=>""+(n>0?e:t)},kn=(t,e,n)=>{const i=e-t;return 0===i?1:(n-t)/i},Dn=(t,e)=>n=>bn(t,e,n);function Bn(t,e,n){const i=[],o=n||("number"==typeof(s=t[0])?Dn:"string"==typeof s?ze.test(s)?Cn:Rn:Array.isArray(s)?Mn:"object"==typeof s?Ln:Dn);var s;const r=t.length-1;for(let n=0;n<r;n++){let s=o(t[n],t[n+1]);if(e){const t=Array.isArray(e)?e[n]:e;s=Zt(t,s)}i.push(s)}return i}function Fn(t,e,{clamp:n=!0,ease:i,mixer:o}={}){const s=t.length;e.length,!i||!Array.isArray(i)||i.length,t[0]>t[s-1]&&(t=[...t].reverse(),e=[...e].reverse());const r=Bn(e,i,o),a=r.length,c=e=>{let n=0;if(a>1)for(;n<t.length-2&&!(e<t[n+1]);n++);const i=kn(t[n],t[n+1],e);return r[n](i)};return n?e=>c(X(t[0],t[s-1],e)):c}const On=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function In(t,e,n,i){if(t===e&&n===i)return oe;const o=e=>function(t,e,n,i,o){let s,r,a=0;do{r=e+(n-e)/2,s=On(r,i,o)-t,s>0?n=r:e=r}while(Math.abs(s)>1e-7&&++a<12);return r}(e,0,1,t,n);return t=>0===t||1===t?t:On(o(t),e,i)}const jn=t=>1-Math.sin(Math.acos(t)),Un=vn(jn),Nn=yn(Un),zn=In(.33,1.53,.69,.99),Wn=vn(zn),Hn=yn(Wn),$n=t=>(t*=2)<1?.5*Wn(t):.5*(2-Math.pow(2,-10*(t-1))),Yn={linear:oe,easeIn:xn,easeInOut:En,easeOut:Pn,circIn:jn,circInOut:Nn,circOut:Un,backIn:Wn,backInOut:Hn,backOut:zn,anticipate:$n},Xn=t=>{if(Array.isArray(t)){t.length;const[e,n,i,o]=t;return In(e,n,i,o)}return"string"==typeof t?Yn[t]:t};function Gn({keyframes:t,ease:e=En,times:n,duration:i=300}){t=[...t];const o=(t=>Array.isArray(t)&&"number"!=typeof t[0])(e)?e.map(Xn):Xn(e),s={done:!1,value:t[0]},r=function(t,e){return t.map(t=>t*e)}(n&&n.length===t.length?n:function(t){const e=t.length;return t.map((t,n)=>0!==n?n/(e-1):0)}(t),i);function a(){return Fn(r,t,{ease:Array.isArray(o)?o:(e=t,n=o,e.map(()=>n||En).splice(0,e.length-1))});var e,n}let c=a();return{next:t=>(s.value=c(t),s.done=t>=i,s),flipTarget:()=>{t.reverse(),c=a()}}}function qn({duration:t=800,bounce:e=.25,velocity:n=0,mass:i=1}){let o,s,r=1-e;r=X(.05,1,r),t=X(.01,10,t/1e3),r<1?(o=e=>{const i=e*r,o=i*t;return.001-(i-n)/Zn(e,r)*Math.exp(-o)},s=e=>{const i=e*r*t,s=i*n+n,a=Math.pow(r,2)*Math.pow(e,2)*t,c=Math.exp(-i),u=Zn(Math.pow(e,2),r);return(.001-o(e)>0?-1:1)*((s-a)*c)/u}):(o=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,s=e=>Math.exp(-e*t)*(t*t*(n-e)));const a=function(t,e,n){let i=n;for(let n=1;n<12;n++)i-=t(i)/e(i);return i}(o,s,5/t);if(t*=1e3,isNaN(a))return{stiffness:100,damping:10,duration:t};{const e=Math.pow(a,2)*i;return{stiffness:e,damping:2*r*Math.sqrt(i*e),duration:t}}}function Zn(t,e){return t*Math.sqrt(1-e*e)}const Kn=["duration","bounce"],_n=["stiffness","damping","mass"];function Jn(t,e){return e.some(e=>void 0!==t[e])}function Qn({keyframes:t,restDelta:e,restSpeed:n,...i}){let o=t[0],s=t[t.length-1];const r={done:!1,value:o},{stiffness:a,damping:c,mass:u,velocity:l,duration:h,isResolvedFromDuration:d}=function(t){let e={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...t};if(!Jn(t,_n)&&Jn(t,Kn)){const n=qn(t);e={...e,...n,velocity:0,mass:1},e.isResolvedFromDuration=!0}return e}(i);let p=ti,m=l?-l/1e3:0;const f=c/(2*Math.sqrt(a*u));function g(){const t=s-o,i=Math.sqrt(a/u)/1e3,r=Math.abs(t)<5;if(n||(n=r?.01:2),e||(e=r?.005:.5),f<1){const e=Zn(i,f);p=n=>{const o=Math.exp(-f*i*n);return s-o*((m+f*i*t)/e*Math.sin(e*n)+t*Math.cos(e*n))}}else if(1===f)p=e=>s-Math.exp(-i*e)*(t+(m+i*t)*e);else{const e=i*Math.sqrt(f*f-1);p=n=>{const o=Math.exp(-f*i*n),r=Math.min(e*n,300);return s-o*((m+f*i*t)*Math.sinh(r)+e*t*Math.cosh(r))/e}}}return g(),{next:t=>{const i=p(t);if(d)r.done=t>=h;else{let o=m;if(0!==t)if(f<1){const e=Math.max(0,t-5);o=ke(i-p(e),t-e)}else o=0;const a=Math.abs(o)<=n,c=Math.abs(s-i)<=e;r.done=a&&c}return r.value=r.done?s:i,r},flipTarget:()=>{m=-m,[o,s]=[s,o],g()}}}Qn.needsInterpolation=(t,e)=>"string"==typeof t||"string"==typeof e;const ti=t=>0;const ei={decay:function({keyframes:t=[0],velocity:e=0,power:n=.8,timeConstant:i=350,restDelta:o=.5,modifyTarget:s}){const r=t[0],a={done:!1,value:r};let c=n*e;const u=r+c,l=void 0===s?u:s(u);return l!==u&&(c=l-r),{next:t=>{const e=-c*Math.exp(-t/i);return a.done=!(e>o||e<-o),a.value=a.done?l:l+e,a},flipTarget:()=>{}}},keyframes:Gn,tween:Gn,spring:Qn};function ni(t,e,n=0){return t-e-n}const ii=t=>{const e=({delta:e})=>t(e);return{start:()=>we.update(e,!0),stop:()=>Te.update(e)}};function oi({duration:t,driver:e=ii,elapsed:n=0,repeat:i=0,repeatType:o="loop",repeatDelay:s=0,keyframes:r,autoplay:a=!0,onPlay:c,onStop:u,onComplete:l,onRepeat:h,onUpdate:d,type:p="keyframes",...m}){const f=n;let g,y,v=0,x=t,P=!1,E=!0;const b=ei[r.length>2?"keyframes":p]||Gn,w=r[0],T=r[r.length-1];let A={done:!1,value:w};const{needsInterpolation:S}=b;S&&S(w,T)&&(y=Fn([0,100],[w,T],{clamp:!1}),r=[0,100]);const C=b({...m,duration:t,keyframes:r});function V(){v++,"reverse"===o?(E=v%2==0,n=function(t,e=0,n=0,i=!0){return i?ni(e+-t,e,n):e-(t-e)+n}(n,x,s,E)):(n=ni(n,x,s),"mirror"===o&&C.flipTarget()),P=!1,h&&h()}function M(t){E||(t=-t),n+=t,P||(A=C.next(Math.max(0,n)),y&&(A.value=y(A.value)),P=E?A.done:n<=0),d&&d(A.value),P&&(0===v&&(x=void 0!==x?x:n),v<i?function(t,e,n,i){return i?t>=e+n:t<=-n}(n,x,s,E)&&V():(g&&g.stop(),l&&l()))}return a&&(c&&c(),g=e(M),g.start()),{stop:()=>{u&&u(),g&&g.stop()},set currentTime(t){n=f,M(t)},sample:e=>{n=f;const i=t&&"number"==typeof t?Math.max(.5*t,50):50;let o=0;for(M(0);o<=e;){const t=e-o;M(Math.min(t,i)),o+=i}return A}}}const si=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,ri={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:si([0,.65,.55,1]),circOut:si([.55,0,1,.45]),backIn:si([.31,.01,.66,-.59]),backOut:si([.33,1.53,.69,.99])};function ai(t){if(t)return Array.isArray(t)?si(t):ri[t]}function ci(t,e,n,{delay:i=0,duration:o,repeat:s=0,repeatType:r="loop",ease:a,times:c}={}){return t.animate({[e]:n,offset:c},{delay:i,duration:o,easing:ai(a),fill:"both",iterations:s+1,direction:"reverse"===r?"alternate":"normal"})}const ui={waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate")},li={},hi={};for(const t in ui)hi[t]=()=>(void 0===li[t]&&(li[t]=ui[t]()),li[t]);const di=new Set(["opacity"]);function pi(t,e,{onUpdate:n,onComplete:i,...o}){if(!(hi.waapi()&&di.has(e)&&!o.repeatDelay&&"mirror"!==o.repeatType&&0!==o.damping))return!1;let{keyframes:s,duration:r=300,elapsed:a=0,ease:c}=o;if("spring"===o.type||!(!(u=o.ease)||Array.isArray(u)||"string"==typeof u&&ri[u])){if(o.repeat===1/0)return;const t=oi({...o,elapsed:0});let e={done:!1,value:s[0]};const n=[];let i=0;for(;!e.done&&i<2e4;)e=t.sample(i),n.push(e.value),i+=10;s=n,r=i-10,c="linear"}var u;const l=ci(t.owner.current,e,s,{...o,delay:-a,duration:r,ease:c});return l.onfinish=()=>{t.set(function(t,{repeat:e,repeatType:n="loop"}){return t[e&&"loop"!==n&&e%2==1?0:t.length-1]}(s,o)),we.update(()=>l.cancel()),i&&i()},{get currentTime(){return l.currentTime||0},set currentTime(t){l.currentTime=t},stop:()=>{const{currentTime:e}=l;if(e){const n=oi({...o,autoplay:!1});t.setWithVelocity(n.sample(e-10).value,n.sample(e).value,10)}we.update(()=>l.cancel())}}}function mi(t,e){const n=performance.now(),i=({timestamp:o})=>{const s=o-n;s>=e&&(Te.read(i),t(s-e))};return we.read(i,!0),()=>Te.read(i)}function fi({keyframes:t,elapsed:e,onUpdate:n,onComplete:i}){const o=()=>{n&&n(t[t.length-1]),i&&i()};return e?{stop:mi(o,-e)}:o()}const gi=()=>({type:"spring",stiffness:500,damping:25,restSpeed:10}),yi=t=>({type:"spring",stiffness:550,damping:0===t?2*Math.sqrt(550):30,restSpeed:10}),vi=()=>({type:"keyframes",ease:"linear",duration:.3}),xi={type:"keyframes",duration:.8},Pi={x:gi,y:gi,z:gi,rotate:gi,rotateX:gi,rotateY:gi,rotateZ:gi,scaleX:yi,scaleY:yi,scale:yi,opacity:vi,backgroundColor:vi,color:vi,default:yi},Ei=(t,{keyframes:e})=>{if(e.length>2)return xi;return(Pi[t]||Pi.default)(e[1])},bi=(t,e)=>"zIndex"!==t&&(!("number"!=typeof e&&!Array.isArray(e))||!("string"!=typeof e||!Xe.test(e)||e.startsWith("url(")));function wi(t){return 0===t||"string"==typeof t&&0===parseFloat(t)&&-1===t.indexOf(" ")}function Ti(t){return"number"==typeof t?0:Qe("",t)}function Ai(t,e){return t[e]||t.default||t}const Si=(t,e,n,i={})=>o=>{const s=Ai(i,t)||{},r=s.delay||i.delay||0;let{elapsed:a=0}=i;a-=fn(r);const c=function(t,e,n,i){const o=bi(e,n);let s=void 0!==i.from?i.from:t.get();return"none"===s&&o&&"string"==typeof n?s=Qe(e,n):wi(s)&&"string"==typeof n?s=Ti(n):!Array.isArray(n)&&wi(n)&&"string"==typeof s&&(n=Ti(s)),Array.isArray(n)?(null===n[0]&&(n[0]=s),n):[s,n]}(e,t,n,s),u=c[0],l=c[c.length-1],h=bi(t,u),d=bi(t,l);let p={keyframes:c,velocity:e.getVelocity(),...s,elapsed:a,onUpdate:t=>{e.set(t),s.onUpdate&&s.onUpdate(t)},onComplete:()=>{o(),s.onComplete&&s.onComplete()}};if(!h||!d||gn.current||!1===s.type)return fi(p);if("inertia"===s.type)return function({keyframes:t,velocity:e=0,min:n,max:i,power:o=.8,timeConstant:s=750,bounceStiffness:r=500,bounceDamping:a=10,restDelta:c=1,modifyTarget:u,driver:l,onUpdate:h,onComplete:d,onStop:p}){const m=t[0];let f;function g(t){return void 0!==n&&t<n||void 0!==i&&t>i}function y(t){return void 0===n?i:void 0===i||Math.abs(n-t)<Math.abs(i-t)?n:i}function v(t){f&&f.stop(),f=oi({keyframes:[0,1],velocity:0,...t,driver:l,onUpdate:e=>{h&&h(e),t.onUpdate&&t.onUpdate(e)},onComplete:d,onStop:p})}function x(t){v({type:"spring",stiffness:r,damping:a,restDelta:c,...t})}if(g(m))x({velocity:e,keyframes:[m,y(m)]});else{let t=o*e+m;void 0!==u&&(t=u(t));const i=y(t),r=i===n?-1:1;let a,l;const h=t=>{a=l,l=t,e=ke(t-a,fe.delta),(1===r&&t>i||-1===r&&t<i)&&x({keyframes:[t,i],velocity:e})};v({type:"decay",keyframes:[m,0],velocity:e,timeConstant:s,power:o,restDelta:c,modifyTarget:u,onUpdate:g(t)?h:void 0})}return{stop:()=>f&&f.stop()}}(p);if(function({when:t,delay:e,delayChildren:n,staggerChildren:i,staggerDirection:o,repeat:s,repeatType:r,repeatDelay:a,from:c,elapsed:u,...l}){return!!Object.keys(l).length}(s)||(p={...p,...Ei(t,p)}),p.duration&&(p.duration=fn(p.duration)),p.repeatDelay&&(p.repeatDelay=fn(p.repeatDelay)),e.owner&&e.owner.current instanceof HTMLElement&&!e.owner.getProps().onUpdate){const n=pi(e,t,p);if(n)return n}return oi(p)};function Ci(t,e,n={}){let i;if(t.notify("AnimationStart",e),Array.isArray(e)){const o=e.map(e=>Vi(t,e,n));i=Promise.all(o)}else if("string"==typeof e)i=Vi(t,e,n);else{const o="function"==typeof e?rn(t,e,n.custom):e;i=Mi(t,o,n)}return i.then(()=>t.notify("AnimationComplete",e))}function Vi(t,e,n={}){const i=rn(t,e,n.custom);let{transition:o=t.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(o=n.transitionOverride);const s=i?()=>Mi(t,i,n):()=>Promise.resolve(),r=t.variantChildren&&t.variantChildren.size?(i=0)=>{const{delayChildren:s=0,staggerChildren:r,staggerDirection:a}=o;return function(t,e,n=0,i=0,o=1,s){const r=[],a=(t.variantChildren.size-1)*i,c=1===o?(t=0)=>t*i:(t=0)=>a-t*i;return Array.from(t.variantChildren).sort(Li).forEach((t,i)=>{t.notify("AnimationStart",e),r.push(Vi(t,e,{...s,delay:n+c(i)}).then(()=>t.notify("AnimationComplete",e)))}),Promise.all(r)}(t,e,s+i,r,a,n)}:()=>Promise.resolve(),{when:a}=o;if(a){const[t,e]="beforeChildren"===a?[s,r]:[r,s];return t().then(e)}return Promise.all([s(),r(n.delay)])}function Mi(t,e,{delay:n=0,transitionOverride:i,type:o}={}){let{transition:s=t.getDefaultTransition(),transitionEnd:r,...a}=t.makeTargetAnimatable(e);const c=t.getValue("willChange");i&&(s=i);const u=[],l=o&&t.animationState&&t.animationState.getState()[o];for(const e in a){const i=t.getValue(e),o=a[e];if(!i||void 0===o||l&&Ri(l,e))continue;const r={delay:n,elapsed:0,...s};if(window.HandoffAppearAnimations&&!i.hasAnimated){const n=t.getProps()[mn];n&&(r.elapsed=window.HandoffAppearAnimations(n,e,i,we))}let h=i.start(Si(e,i,o,t.shouldReduceMotion&&j.has(e)?{type:!1}:r));pn(c)&&(c.add(e),h=h.then(()=>c.remove(e))),u.push(h)}return Promise.all(u).then(()=>{r&&cn(t,r)})}function Li(t,e){return t.sortNodePosition(e)}function Ri({protectedKeys:t,needsAnimating:e},n){const i=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,i}const ki=[t.AnimationType.Animate,t.AnimationType.InView,t.AnimationType.Focus,t.AnimationType.Hover,t.AnimationType.Tap,t.AnimationType.Drag,t.AnimationType.Exit],Di=[...ki].reverse(),Bi=ki.length;function Fi(e){let n=function(t){return e=>Promise.all(e.map(({animation:e,options:n})=>Ci(t,e,n)))}(e);const i={[t.AnimationType.Animate]:Ii(!0),[t.AnimationType.InView]:Ii(),[t.AnimationType.Hover]:Ii(),[t.AnimationType.Tap]:Ii(),[t.AnimationType.Drag]:Ii(),[t.AnimationType.Focus]:Ii(),[t.AnimationType.Exit]:Ii()};let o=!0;const s=(t,n)=>{const i=rn(e,n);if(i){const{transition:e,transitionEnd:n,...o}=i;t={...t,...o,...n}}return t};function r(t,r){const a=e.getProps(),c=e.getVariantContext(!0)||{},u=[],l=new Set;let h={},d=1/0;for(let n=0;n<Bi;n++){const p=Di[n],g=i[p],y=void 0!==a[p]?a[p]:c[p],v=m(y),x=p===r?g.isActive:null;!1===x&&(d=n);let P=y===c[p]&&y!==a[p]&&v;if(P&&o&&e.manuallyAnimateOnMount&&(P=!1),g.protectedKeys={...h},!g.isActive&&null===x||!y&&!g.prevProp||f(y)||"boolean"==typeof y)continue;const E=Oi(g.prevProp,y);let b=E||p===r&&g.isActive&&!P&&v||n>d&&v;const w=Array.isArray(y)?y:[y];let T=w.reduce(s,{});!1===x&&(T={});const{prevResolvedValues:A={}}=g,S={...A,...T},C=t=>{b=!0,l.delete(t),g.needsAnimating[t]=!0};for(const t in S){const e=T[t],n=A[t];h.hasOwnProperty(t)||(e!==n?Ft(e)&&Ft(n)?!pe(e,n)||E?C(t):g.protectedKeys[t]=!0:void 0!==e?C(t):l.add(t):void 0!==e&&l.has(t)?C(t):g.protectedKeys[t]=!0)}g.prevProp=y,g.prevResolvedValues=T,g.isActive&&(h={...h,...T}),o&&e.blockInitialAnimation&&(b=!1),b&&!P&&u.push(...w.map(e=>({animation:e,options:{type:p,...t}})))}if(l.size){const t={};l.forEach(n=>{const i=e.getBaseTarget(n);void 0!==i&&(t[n]=i)}),u.push({animation:t})}let p=Boolean(u.length);return o&&!1===a.initial&&!e.manuallyAnimateOnMount&&(p=!1),o=!1,p?n(u):Promise.resolve()}return{animateChanges:r,setActive:function(t,n,o){if(i[t].isActive===n)return Promise.resolve();e.variantChildren&&e.variantChildren.forEach(e=>{e.animationState&&e.animationState.setActive(t,n)}),i[t].isActive=n;const s=r(o,t);for(const t in i)i[t].protectedKeys={};return s},setAnimateFunction:function(t){n=t(e)},getState:()=>i}}function Oi(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!pe(e,t)}function Ii(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}let ji=0;const Ui={animation:{Feature:class extends ee{constructor(t){super(t),t.animationState||(t.animationState=Fi(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();this.unmount(),f(t)&&(this.unmount=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:e}=this.node.prevProps||{};t!==e&&this.updateAnimationControlsSubscription()}unmount(){}}},exit:{Feature:class extends ee{constructor(){super(...arguments),this.id=ji++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n,custom:i}=this.node.presenceContext,{isPresent:o}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===o)return;const s=this.node.animationState.setActive(t.AnimationType.Exit,!e,{custom:null!=i?i:this.node.getProps().custom});n&&!e&&s.then(()=>n(this.id))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}}},Ni=(t,e)=>Math.abs(t-e);function zi(t,e){const n=Ni(t.x,e.x),i=Ni(t.y,e.y);return Math.sqrt(n**2+i**2)}class Wi{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=Yi(this.lastMoveEventInfo,this.history),e=null!==this.startEvent,n=zi(t.offset,{x:0,y:0})>=3;if(!e&&!n)return;const{point:i}=t,{timestamp:o}=fe;this.history.push({...i,timestamp:o});const{onStart:s,onMove:r}=this.handlers;e||(s&&s(this.lastMoveEvent,t),this.startEvent=this.lastMoveEvent),r&&r(this.lastMoveEvent,t)},this.handlePointerMove=(t,e)=>{this.lastMoveEvent=t,this.lastMoveEventInfo=Hi(e,this.transformPagePoint),we.update(this.updatePoint,!0)},this.handlePointerUp=(t,e)=>{if(this.end(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const{onEnd:n,onSessionEnd:i}=this.handlers,o=Yi("pointercancel"===t.type?this.lastMoveEventInfo:Hi(e,this.transformPagePoint),this.history);this.startEvent&&n&&n(t,o),i&&i(t,o)},!Ht(t))return;this.handlers=e,this.transformPagePoint=n;const i=Hi($t(t),this.transformPagePoint),{point:o}=i,{timestamp:s}=fe;this.history=[{...o,timestamp:s}];const{onSessionStart:r}=e;r&&r(t,Yi(i,this.history)),this.removeListeners=Zt(Xt(window,"pointermove",this.handlePointerMove),Xt(window,"pointerup",this.handlePointerUp),Xt(window,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Te.update(this.updatePoint)}}function Hi(t,e){return e?{point:e(t.point)}:t}function $i(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Yi({point:t},e){return{point:t,delta:$i(t,Gi(e)),offset:$i(t,Xi(e)),velocity:qi(e,.1)}}function Xi(t){return t[0]}function Gi(t){return t[t.length-1]}function qi(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,i=null;const o=Gi(t);for(;n>=0&&(i=t[n],!(o.timestamp-i.timestamp>fn(e)));)n--;if(!i)return{x:0,y:0};const s=(o.timestamp-i.timestamp)/1e3;if(0===s)return{x:0,y:0};const r={x:(o.x-i.x)/s,y:(o.y-i.y)/s};return r.x===1/0&&(r.x=0),r.y===1/0&&(r.y=0),r}function Zi(t){return t.max-t.min}function Ki(t,e=0,n=.01){return Math.abs(t-e)<=n}function _i(t,e,n,i=.5){t.origin=i,t.originPoint=bn(e.min,e.max,t.origin),t.scale=Zi(n)/Zi(e),(Ki(t.scale,1,1e-4)||isNaN(t.scale))&&(t.scale=1),t.translate=bn(n.min,n.max,t.origin)-t.originPoint,(Ki(t.translate)||isNaN(t.translate))&&(t.translate=0)}function Ji(t,e,n,i){_i(t.x,e.x,n.x,i?i.originX:void 0),_i(t.y,e.y,n.y,i?i.originY:void 0)}function Qi(t,e,n){t.min=n.min+e.min,t.max=t.min+Zi(e)}function to(t,e,n){t.min=e.min-n.min,t.max=t.min+Zi(e)}function eo(t,e,n){to(t.x,e.x,n.x),to(t.y,e.y,n.y)}function no(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 io(t,e){let n=e.min-t.min,i=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,i]=[i,n]),{min:n,max:i}}const oo=.35;function so(t,e,n){return{min:ro(t,e),max:ro(t,n)}}function ro(t,e){return"number"==typeof t?t:t[e]||0}const ao=()=>({x:{min:0,max:0},y:{min:0,max:0}});function co(t){return[t("x"),t("y")]}function uo({top:t,left:e,right:n,bottom:i}){return{x:{min:e,max:n},y:{min:t,max:i}}}function lo(t){return void 0===t||1===t}function ho({scale:t,scaleX:e,scaleY:n}){return!lo(t)||!lo(e)||!lo(n)}function po(t){return ho(t)||mo(t)||t.z||t.rotate||t.rotateX||t.rotateY}function mo(t){return fo(t.x)||fo(t.y)}function fo(t){return t&&"0%"!==t}function go(t,e,n){return n+e*(t-n)}function yo(t,e,n,i,o){return void 0!==o&&(t=go(t,o,i)),go(t,n,i)+e}function vo(t,e=0,n=1,i,o){t.min=yo(t.min,e,n,i,o),t.max=yo(t.max,e,n,i,o)}function xo(t,{x:e,y:n}){vo(t.x,e.translate,e.scale,e.originPoint),vo(t.y,n.translate,n.scale,n.originPoint)}function Po(t){return Number.isInteger(t)||t>1.0000000000001||t<.999999999999?t:1}function Eo(t,e){t.min=t.min+e,t.max=t.max+e}function bo(t,e,[n,i,o]){const s=void 0!==e[o]?e[o]:.5,r=bn(t.min,t.max,s);vo(t,e[n],e[i],r,e.scale)}const wo=["x","scaleX","originX"],To=["y","scaleY","originY"];function Ao(t,e){bo(t.x,e,wo),bo(t.y,e,To)}function So(t,e){return uo(function(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),i=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}(t.getBoundingClientRect(),e))}const Co=new WeakMap;class Vo{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}={}){const{presenceContext:i}=this.visualElement;if(i&&!1===i.isPresent)return;this.panSession=new Wi(e,{onSessionStart:t=>{this.stopAnimation(),n&&this.snapToCursor($t(t,"page").point)},onStart:(e,n)=>{const{drag:i,dragPropagation:o,onDragStart:s}=this.getProps();if(i&&!o&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=Qt(i),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),co(t=>{let e=this.getAxisMotionValue(t).get()||0;if(it.test(e)){const{projection:n}=this.visualElement;if(n&&n.layout){const i=n.layout.layoutBox[t];if(i){e=Zi(i)*(parseFloat(e)/100)}}}this.originPoint[t]=e}),s&&s(e,n);const{animationState:r}=this.visualElement;r&&r.setActive(t.AnimationType.Drag,!0)},onMove:(t,e)=>{const{dragPropagation:n,dragDirectionLock:i,onDirectionLock:o,onDrag:s}=this.getProps();if(!n&&!this.openGlobalLock)return;const{offset:r}=e;if(i&&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}(r),void(null!==this.currentDirection&&o&&o(this.currentDirection));this.updateAxis("x",e.point,r),this.updateAxis("y",e.point,r),this.visualElement.render(),s&&s(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:i}=e;this.startAnimation(i);const{onDragEnd:o}=this.getProps();o&&o(t,e)}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:i}=this.getProps();!i&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),n&&n.setActive(t.AnimationType.Drag,!1)}updateAxis(t,e,n){const{drag:i}=this.getProps();if(!n||!Mo(t,i,this.currentDirection))return;const o=this.getAxisMotionValue(t);let s=this.originPoint[t]+n[t];this.constraints&&this.constraints[t]&&(s=function(t,{min:e,max:n},i){return void 0!==e&&t<e?t=i?bn(e,t,i.min):Math.max(t,e):void 0!==n&&t>n&&(t=i?bn(n,t,i.max):Math.min(t,n)),t}(s,this.constraints[t],this.elastic[t])),o.set(s)}resolveConstraints(){const{dragConstraints:t,dragElastic:e}=this.getProps(),{layout:n}=this.visualElement.projection||{},i=this.constraints;t&&p(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!n)&&function(t,{top:e,left:n,bottom:i,right:o}){return{x:no(t.x,n,o),y:no(t.y,e,i)}}(n.layoutBox,t),this.elastic=function(t=oo){return!1===t?t=0:!0===t&&(t=oo),{x:so(t,"left","right"),y:so(t,"top","bottom")}}(e),i!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&co(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:i}=this.visualElement;if(!i||!i.layout)return!1;const o=function(t,e,n){const i=So(t,n),{scroll:o}=e;return o&&(Eo(i.x,o.offset.x),Eo(i.y,o.offset.y)),i}(n,i.root,this.visualElement.getTransformPagePoint());let s=function(t,e){return{x:io(t.x,e.x),y:io(t.y,e.y)}}(i.layout.layoutBox,o);if(e){const t=e(function({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}(s));this.hasMutatedConstraints=!!t,t&&(s=uo(t))}return s}startAnimation(t){const{drag:e,dragMomentum:n,dragElastic:i,dragTransition:o,dragSnapToOrigin:s,onDragTransitionEnd:r}=this.getProps(),a=this.constraints||{},c=co(r=>{if(!Mo(r,e,this.currentDirection))return;let c=a&&a[r]||{};s&&(c={min:0,max:0});const u=i?200:1e6,l=i?40:1e7,h={type:"inertia",velocity:n?t[r]:0,bounceStiffness:u,bounceDamping:l,timeConstant:750,restDelta:1,restSpeed:10,...o,...c};return this.startAxisValueAnimation(r,h)});return Promise.all(c).then(r)}startAxisValueAnimation(t,e){const n=this.getAxisMotionValue(t);return n.start(Si(t,n,0,e))}stopAnimation(){co(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const e="_drag"+t.toUpperCase(),n=this.visualElement.getProps(),i=n[e];return i||this.visualElement.getValue(t,(n.initial?n.initial[t]:void 0)||0)}snapToCursor(t){co(e=>{const{drag:n}=this.getProps();if(!Mo(e,n,this.currentDirection))return;const{projection:i}=this.visualElement,o=this.getAxisMotionValue(e);if(i&&i.layout){const{min:n,max:s}=i.layout.layoutBox[e];o.set(t[e]-bn(n,s,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:e}=this.getProps(),{projection:n}=this.visualElement;if(!p(e)||!n||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};co(t=>{const e=this.getAxisMotionValue(t);if(e){const n=e.get();i[t]=function(t,e){let n=.5;const i=Zi(t),o=Zi(e);return o>i?n=kn(e.min,e.max-i,t.min):i>o&&(n=kn(t.min,t.max-o,e.min)),X(0,1,n)}({min:n,max:n},this.constraints[t])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.resolveConstraints(),co(e=>{if(!Mo(e,t,null))return;const n=this.getAxisMotionValue(e),{min:o,max:s}=this.constraints[e];n.set(bn(o,s,i[e]))})}addListeners(){if(!this.visualElement.current)return;Co.set(this.visualElement,this);const t=Xt(this.visualElement.current,"pointerdown",t=>{const{drag:e,dragListener:n=!0}=this.getProps();e&&n&&this.start(t)}),e=()=>{const{dragConstraints:t}=this.getProps();p(t)&&(this.constraints=this.resolveRefConstraints())},{projection:n}=this.visualElement,i=n.addEventListener("measure",e);n&&!n.layout&&(n.root&&n.root.updateScroll(),n.updateLayout()),e();const o=Wt(window,"resize",()=>this.scalePositionWithinConstraints()),s=n.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e})=>{this.isDragging&&e&&(co(e=>{const n=this.getAxisMotionValue(e);n&&(this.originPoint[e]+=t[e].translate,n.set(n.get()+t[e].translate))}),this.visualElement.render())});return()=>{o(),t(),i(),s&&s()}}getProps(){const t=this.visualElement.getProps(),{drag:e=!1,dragDirectionLock:n=!1,dragPropagation:i=!1,dragConstraints:o=!1,dragElastic:s=oo,dragMomentum:r=!0}=t;return{...t,drag:e,dragDirectionLock:n,dragPropagation:i,dragConstraints:o,dragElastic:s,dragMomentum:r}}}function Mo(t,e,n){return!(!0!==e&&e!==t||null!==n&&n!==t)}function Lo(t,e,n={}){const i=N(t)?t:Be(t);return i.start(Si("",i,e,n)),{stop:()=>i.stop(),isAnimating:()=>i.isAnimating()}}const Ro=["TopLeft","TopRight","BottomLeft","BottomRight"],ko=Ro.length,Do=t=>"string"==typeof t?parseFloat(t):t,Bo=t=>"number"==typeof t||ot.test(t);function Fo(t,e){return void 0!==t[e]?t[e]:t.borderRadius}const Oo=jo(0,.5,Un),Io=jo(.5,.95,oe);function jo(t,e,n){return i=>i<t?0:i>e?1:n(kn(t,e,i))}function Uo(t,e){t.min=e.min,t.max=e.max}function No(t,e){Uo(t.x,e.x),Uo(t.y,e.y)}function zo(t,e,n,i,o){return t=go(t-=e,1/n,i),void 0!==o&&(t=go(t,1/o,i)),t}function Wo(t,e,[n,i,o],s,r){!function(t,e=0,n=1,i=.5,o,s=t,r=t){if(it.test(e)){e=parseFloat(e);e=bn(r.min,r.max,e/100)-r.min}if("number"!=typeof e)return;let a=bn(s.min,s.max,i);t===s&&(a-=e),t.min=zo(t.min,e,n,a,o),t.max=zo(t.max,e,n,a,o)}(t,e[n],e[i],e[o],e.scale,s,r)}const Ho=["x","scaleX","originX"],$o=["y","scaleY","originY"];function Yo(t,e,n,i){Wo(t.x,e,Ho,n?n.x:void 0,i?i.x:void 0),Wo(t.y,e,$o,n?n.y:void 0,i?i.y:void 0)}function Xo(t){return 0===t.translate&&1===t.scale}function Go(t){return Xo(t.x)&&Xo(t.y)}function qo(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 Zo(t){return Zi(t.x)/Zi(t.y)}class Ko{constructor(){this.members=[]}add(t){Me(this.members,t),t.scheduleRender()}remove(t){if(Le(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){const n=this.lead;if(t!==n&&(this.prevLead=n,this.lead=t,t.show(),n)){n.instance&&n.scheduleRender(),t.scheduleRender(),t.resumeFrom=n,e&&(t.resumeFrom.preserveOpacity=!0),n.snapshot&&(t.snapshot=n.snapshot,t.snapshot.latestValues=n.animationValues||n.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:i}=t.options;!1===i&&n.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:e,resumingFrom:n}=t;e.onExitComplete&&e.onExitComplete(),n&&n.options.onExitComplete&&n.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function _o(t,e,n){let i="";const o=t.x.translate/e.x,s=t.y.translate/e.y;if((o||s)&&(i=`translate3d(${o}px, ${s}px, 0) `),1===e.x&&1===e.y||(i+=`scale(${1/e.x}, ${1/e.y}) `),n){const{rotate:t,rotateX:e,rotateY:o}=n;t&&(i+=`rotate(${t}deg) `),e&&(i+=`rotateX(${e}deg) `),o&&(i+=`rotateY(${o}deg) `)}const r=t.x.scale*e.x,a=t.y.scale*e.y;return 1===r&&1===a||(i+=`scale(${r}, ${a})`),i||"none"}const Jo=(t,e)=>t.depth-e.depth;class Qo{constructor(){this.children=[],this.isDirty=!1}add(t){Me(this.children,t),this.isDirty=!0}remove(t){Le(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Jo),this.isDirty=!1,this.children.forEach(t)}}const ts=["","X","Y","Z"];let es=0;function ns({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:i,resetTransform:o}){return class{constructor(t,n={},i=(null==e?void 0:e())){this.id=es++,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(ss),this.nodes.forEach(ls),this.nodes.forEach(hs)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.elementId=t,this.latestValues=n,this.root=i?i.root||i:this,this.path=i?[...i.path,i]:[],this.parent=i,this.depth=i?i.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 Qo)}addEventListener(t,e){return this.eventHandlers.has(t)||this.eventHandlers.set(t,new Re),this.eventHandlers.get(t).add(e)}notifyListeners(t,...e){const n=this.eventHandlers.get(t);n&&n.notify(...e)}hasListeners(t){return this.eventHandlers.has(t)}registerPotentialNode(t,e){this.potentialNodes.set(t,e)}mount(e,n=!1){if(this.instance)return;this.isSVG=e instanceof SVGElement&&"svg"!==e.tagName,this.instance=e;const{layoutId:i,layout:o,visualElement:s}=this.options;if(s&&!s.current&&s.mount(e),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.elementId&&this.root.potentialNodes.delete(this.elementId),n&&(o||i)&&(this.isLayoutDirty=!0),t){let n;const i=()=>this.root.updateBlockedByResize=!1;t(e,()=>{this.root.updateBlockedByResize=!0,n&&n(),n=mi(i,250),A.hasAnimatedSinceResize&&(A.hasAnimatedSinceResize=!1,this.nodes.forEach(us))})}i&&this.root.registerSharedNode(i,this),!1!==this.options.animate&&s&&(i||o)&&this.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e,hasRelativeTargetChanged:n,layout:i})=>{if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const o=this.options.transition||s.getDefaultTransition()||ys,{onLayoutAnimationStart:r,onLayoutAnimationComplete:a}=s.getProps(),c=!this.targetLayout||!qo(this.targetLayout,i)||n,u=!e&&n;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||u||e&&(c||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(t,u);const e={...Ai(o,"layout"),onPlay:r,onComplete:a};(s.shouldReduceMotion||this.options.layoutRoot)&&(e.delay=0,e.type=!1),this.startAnimation(e)}else e||0!==this.animationProgress||us(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=i})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const t=this.getStack();t&&t.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Te.preRender(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(ds),this.animationId++)}getTransformTemplate(){const{visualElement:t}=this.options;return t&&t.getProps().transformTemplate}willUpdate(t=!0){if(this.root.isUpdateBlocked())return void(this.options.onExitComplete&&this.options.onExitComplete());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"),e.options.layoutRoot&&e.willUpdate(!1)}const{layoutId:e,layout:n}=this.options;if(void 0===e&&!n)return;const i=this.getTransformTemplate();this.prevTransformTemplateValue=i?i(this.latestValues,""):void 0,this.updateSnapshot(),t&&this.notifyListeners("willUpdate")}didUpdate(){if(this.isUpdateBlocked())return this.unblockUpdate(),this.clearAllSnapshots(),void this.nodes.forEach(as);this.isUpdating&&(this.isUpdating=!1,this.potentialNodes.size&&(this.potentialNodes.forEach(vs),this.potentialNodes.clear()),this.nodes.forEach(cs),this.nodes.forEach(is),this.nodes.forEach(os),this.clearAllSnapshots(),Ae.update(),Ae.preRender(),Ae.render())}clearAllSnapshots(){this.nodes.forEach(rs),this.sharedNodes.forEach(ps)}scheduleUpdateProjection(){we.preRender(this.updateProjection,!1,!0)}scheduleCheckAfterUnmount(){we.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure())}updateLayout(){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 t=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);const{visualElement:e}=this.options;e&&e.notify("LayoutMeasure",this.layout.layoutBox,t?t.layoutBox:void 0)}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:i(this.instance),offset:n(this.instance)})}resetTransform(){if(!o)return;const t=this.isLayoutDirty||this.shouldResetTransform,e=this.projectionDelta&&!Go(this.projectionDelta),n=this.getTransformTemplate(),i=n?n(this.latestValues,""):void 0,s=i!==this.prevTransformTemplateValue;t&&(e||po(this.latestValues)||s)&&(o(this.instance,i),this.shouldResetTransform=!1,this.scheduleRender())}measure(t=!0){const e=this.measurePageBox();let n=this.removeElementScroll(e);var i;return t&&(n=this.removeTransform(n)),xs((i=n).x),xs(i.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&&(Eo(e.x,n.offset.x),Eo(e.y,n.offset.y)),e}removeElementScroll(t){const e={x:{min:0,max:0},y:{min:0,max:0}};No(e,t);for(let n=0;n<this.path.length;n++){const i=this.path[n],{scroll:o,options:s}=i;if(i!==this.root&&o&&s.layoutScroll){if(o.isRoot){No(e,t);const{scroll:n}=this.root;n&&(Eo(e.x,-n.offset.x),Eo(e.y,-n.offset.y))}Eo(e.x,o.offset.x),Eo(e.y,o.offset.y)}}return e}applyTransform(t,e=!1){const n={x:{min:0,max:0},y:{min:0,max:0}};No(n,t);for(let t=0;t<this.path.length;t++){const i=this.path[t];!e&&i.options.layoutScroll&&i.scroll&&i!==i.root&&Ao(n,{x:-i.scroll.offset.x,y:-i.scroll.offset.y}),po(i.latestValues)&&Ao(n,i.latestValues)}return po(this.latestValues)&&Ao(n,this.latestValues),n}removeTransform(t){const e={x:{min:0,max:0},y:{min:0,max:0}};No(e,t);for(let t=0;t<this.path.length;t++){const n=this.path[t];if(!n.instance)continue;if(!po(n.latestValues))continue;ho(n.latestValues)&&n.updateSnapshot();const i={x:{min:0,max:0},y:{min:0,max:0}};No(i,n.measurePageBox()),Yo(e,n.latestValues,n.snapshot?n.snapshot.layoutBox:void 0,i)}return po(this.latestValues)&&Yo(e,this.latestValues),e}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(){const t=this.getLead();if(this.isProjectionDirty||(this.isProjectionDirty=t.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=t.isTransformDirty),!this.isProjectionDirty&&!this.attemptToResolveRelativeTarget)return;const{layout:e,layoutId:n}=this.options;if(this.layout&&(e||n)){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}},eo(this.relativeTargetOrigin,this.layout.layoutBox,t.layout.layoutBox),No(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}var i,o,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&&this.relativeParent&&this.relativeParent.target?(i=this.target,o=this.relativeTarget,s=this.relativeParent.target,Qi(i.x,o.x,s.x),Qi(i.y,o.y,s.y)):this.targetDelta?(Boolean(this.resumingFrom)?this.target=this.applyTransform(this.layout.layoutBox):No(this.target,this.layout.layoutBox),xo(this.target,this.targetDelta)):No(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}},eo(this.relativeTargetOrigin,this.target,t.target),No(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(this.parent&&!ho(this.parent.latestValues)&&!mo(this.parent.latestValues))return(this.parent.relativeTarget||this.parent.targetDelta||this.parent.options.layoutRoot)&&this.parent.layout?this.parent:this.parent.getClosestProjectingParent()}calcProjection(){const{isProjectionDirty:t,isTransformDirty:e}=this;this.isProjectionDirty=this.isTransformDirty=!1;const n=this.getLead(),i=Boolean(this.resumingFrom)||this!==n;let o=!0;if(t&&(o=!1),i&&e&&(o=!1),o)return;const{layout:s,layoutId:r}=this.options;if(this.isTreeAnimating=Boolean(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!s&&!r)return;No(this.layoutCorrected,this.layout.layoutBox),function(t,e,n,i=!1){const o=n.length;if(!o)return;let s,r;e.x=e.y=1;for(let a=0;a<o;a++){s=n[a],r=s.projectionDelta;const o=s.instance;o&&o.style&&"contents"===o.style.display||(i&&s.options.layoutScroll&&s.scroll&&s!==s.root&&Ao(t,{x:-s.scroll.offset.x,y:-s.scroll.offset.y}),r&&(e.x*=r.x.scale,e.y*=r.y.scale,xo(t,r)),i&&po(s.latestValues)&&Ao(t,s.latestValues))}e.x=Po(e.x),e.y=Po(e.y)}(this.layoutCorrected,this.treeScale,this.path,i);const{target:a}=n;if(!a)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 c=this.treeScale.x,u=this.treeScale.y,l=this.projectionTransform;Ji(this.projectionDelta,this.layoutCorrected,a,this.latestValues),this.projectionTransform=_o(this.projectionDelta,this.treeScale),this.projectionTransform===l&&this.treeScale.x===c&&this.treeScale.y===u||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",a))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(t=!0){if(this.options.scheduleRender&&this.options.scheduleRender(),t){const t=this.getStack();t&&t.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}setAnimationOrigin(t,e=!1){const n=this.snapshot,i=n?n.latestValues:{},o={...this.latestValues},s={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!e;const r={x:{min:0,max:0},y:{min:0,max:0}},a=(n?n.source:void 0)!==(this.layout?this.layout.source:void 0),c=this.getStack(),u=!c||c.members.length<=1,l=Boolean(a&&!u&&!0===this.options.crossfade&&!this.path.some(gs));this.animationProgress=0,this.mixTargetDelta=e=>{const n=e/1e3;var c,h,d,p;ms(s.x,t.x,n),ms(s.y,t.y,n),this.setTargetDelta(s),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(eo(r,this.layout.layoutBox,this.relativeParent.layout.layoutBox),c=this.relativeTarget,h=this.relativeTargetOrigin,d=r,p=n,fs(c.x,h.x,d.x,p),fs(c.y,h.y,d.y,p)),a&&(this.animationValues=o,function(t,e,n,i,o,s){o?(t.opacity=bn(0,void 0!==n.opacity?n.opacity:1,Oo(i)),t.opacityExit=bn(void 0!==e.opacity?e.opacity:1,0,Io(i))):s&&(t.opacity=bn(void 0!==e.opacity?e.opacity:1,void 0!==n.opacity?n.opacity:1,i));for(let o=0;o<ko;o++){const s=`border${Ro[o]}Radius`;let r=Fo(e,s),a=Fo(n,s);if(void 0===r&&void 0===a)continue;r||(r=0),a||(a=0);0===r||0===a||Bo(r)===Bo(a)?(t[s]=Math.max(bn(Do(r),Do(a),i),0),(it.test(a)||it.test(r))&&(t[s]+="%")):t[s]=a}(e.rotate||n.rotate)&&(t.rotate=bn(e.rotate||0,n.rotate||0,i))}(o,i,this.latestValues,n,l,u)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(t){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(Te.update(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=we.update(()=>{A.hasAnimatedSinceResize=!0,this.currentAnimation=Lo(0,1e3,{...t,onUpdate:e=>{this.mixTargetDelta(e),t.onUpdate&&t.onUpdate(e)},onComplete:()=>{t.onComplete&&t.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const t=this.getStack();t&&t.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const t=this.getLead();let{targetWithTransforms:e,target:n,layout:i,latestValues:o}=t;if(e&&n&&i){if(this!==t&&this.layout&&i&&Ps(this.options.animationType,this.layout.layoutBox,i.layoutBox)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const e=Zi(this.layout.layoutBox.x);n.x.min=t.target.x.min,n.x.max=n.x.min+e;const i=Zi(this.layout.layoutBox.y);n.y.min=t.target.y.min,n.y.max=n.y.min+i}No(e,n),Ao(e,o),Ji(this.projectionDeltaWithTransform,this.layoutCorrected,e,o)}}registerSharedNode(t,e){this.sharedNodes.has(t)||this.sharedNodes.set(t,new Ko);this.sharedNodes.get(t).add(e);const n=e.options.initialPromotionConfig;e.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(e):void 0})}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 i=this.getStack();i&&i.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 i={};for(let e=0;e<ts.length;e++){const o="rotate"+ts[e];n[o]&&(i[o]=n[o],t.setStaticValue(o,0))}t.render();for(const e in i)t.setStaticValue(e,i[e]);t.scheduleRender()}getProjectionStyles(t={}){var e,n;const i={};if(!this.instance||this.isSVG)return i;if(!this.isVisible)return{visibility:"hidden"};i.visibility="";const o=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,i.opacity="",i.pointerEvents=Ot(t.pointerEvents)||"",i.transform=o?o(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=Ot(t.pointerEvents)||""),this.hasProjected&&!po(this.latestValues)&&(e.transform=o?o({},""):"none",this.hasProjected=!1),e}const r=s.animationValues||s.latestValues;this.applyTransformsToTarget(),i.transform=_o(this.projectionDeltaWithTransform,this.treeScale,r),o&&(i.transform=o(r,i.transform));const{x:a,y:c}=this.projectionDelta;i.transformOrigin=`${100*a.origin}% ${100*c.origin}% 0`,s.animationValues?i.opacity=s===this?null!==(n=null!==(e=r.opacity)&&void 0!==e?e:this.latestValues.opacity)&&void 0!==n?n:1:this.preserveOpacity?this.latestValues.opacity:r.opacityExit:i.opacity=s===this?void 0!==r.opacity?r.opacity:"":void 0!==r.opacityExit?r.opacityExit:0;for(const t in F){if(void 0===r[t])continue;const{correct:e,applyTo:n}=F[t],o="none"===i.transform?r[t]:e(r[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?Ot(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(as),this.root.sharedNodes.clear()}}}function is(t){t.updateLayout()}function os(t){var e;const n=(null===(e=t.resumeFrom)||void 0===e?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&n&&t.hasListeners("didUpdate")){const{layoutBox:e,measuredBox:i}=t.layout,{animationType:o}=t.options,s=n.source!==t.layout.source;"size"===o?co(t=>{const i=s?n.measuredBox[t]:n.layoutBox[t],o=Zi(i);i.min=e[t].min,i.max=i.min+o}):Ps(o,n.layoutBox,e)&&co(t=>{const i=s?n.measuredBox[t]:n.layoutBox[t],o=Zi(e[t]);i.max=i.min+o});const r={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};Ji(r,e,n.layoutBox);const a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};s?Ji(a,t.applyTransform(i,!0),n.measuredBox):Ji(a,e,n.layoutBox);const c=!Go(r);let u=!1;if(!t.resumeFrom){const i=t.getClosestProjectingParent();if(i&&!i.resumeFrom){const{snapshot:o,layout:s}=i;if(o&&s){const r={x:{min:0,max:0},y:{min:0,max:0}};eo(r,n.layoutBox,o.layoutBox);const a={x:{min:0,max:0},y:{min:0,max:0}};eo(a,e,s.layoutBox),qo(r,a)||(u=!0),i.options.layoutRoot&&(t.relativeTarget=a,t.relativeTargetOrigin=r,t.relativeParent=i)}}}t.notifyListeners("didUpdate",{layout:e,snapshot:n,delta:a,layoutDelta:r,hasLayoutChanged:c,hasRelativeTargetChanged:u})}else if(t.isLead()){const{onExitComplete:e}=t.options;e&&e()}t.options.transition=void 0}function ss(t){t.isProjectionDirty||(t.isProjectionDirty=Boolean(t.parent&&t.parent.isProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=Boolean(t.parent&&t.parent.isTransformDirty))}function rs(t){t.clearSnapshot()}function as(t){t.clearMeasurements()}function cs(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function us(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0}function ls(t){t.resolveTargetDelta()}function hs(t){t.calcProjection()}function ds(t){t.resetRotation()}function ps(t){t.removeLeadSnapshot()}function ms(t,e,n){t.translate=bn(e.translate,0,n),t.scale=bn(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function fs(t,e,n,i){t.min=bn(e.min,n.min,i),t.max=bn(e.max,n.max,i)}function gs(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}const ys={duration:.45,ease:[.4,0,.1,1]};function vs(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 i=(n&&n!==t.root?n.instance:document).querySelector(`[data-projection-id="${e}"]`);i&&t.mount(i,!0)}function xs(t){t.min=Math.round(t.min),t.max=Math.round(t.max)}function Ps(t,e,n){return"position"===t||"preserve-aspect"===t&&!Ki(Zo(e),Zo(n),.2)}const Es=ns({attachResizeListener:(t,e)=>Wt(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),bs={current:void 0},ws=ns({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!bs.current){const t=new Es(0,{});t.mount(window),t.setOptions({layoutScroll:!0}),bs.current=t}return bs.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)}),Ts=t=>!t.isLayoutDirty&&t.willUpdate(!1);function As(){const t=new Set,e=new WeakMap,n=()=>t.forEach(Ts);return{add:i=>{t.add(i),e.set(i,i.addEventListener("willUpdate",n))},remove:i=>{t.delete(i);const o=e.get(i);o&&(o(),e.delete(i)),n()},dirty:n}}function Ss(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Cs={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!ot.test(t))return t;t=parseFloat(t)}return`${Ss(t,e.target.x)}% ${Ss(t,e.target.y)}%`}};function Vs(t){return"string"==typeof t&&t.startsWith("var(--")}const Ms=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function Ls(t,e,n=1){const[i,o]=function(t){const e=Ms.exec(t);if(!e)return[,];const[,n,i]=e;return[n,i]}(t);if(!i)return;const s=window.getComputedStyle(e).getPropertyValue(i);return s?s.trim():Vs(o)?Ls(o,e,n+1):o}const Rs={correct:(t,{treeScale:e,projectionDelta:n})=>{const i=t,o=t.includes("var("),s=[];o&&(t=t.replace(Ms,t=>(s.push(t),"_$css")));const r=Xe.parse(t);if(r.length>5)return i;const a=Xe.createTransformer(t),c="number"!=typeof r[0]?1:0,u=n.x.scale*e.x,l=n.y.scale*e.y;r[0+c]/=u,r[1+c]/=l;const h=bn(u,l,.5);"number"==typeof r[2+c]&&(r[2+c]/=h),"number"==typeof r[3+c]&&(r[3+c]/=h);let d=a(r);if(o){let t=0;d=d.replace("_$css",()=>{const e=s[t];return t++,e})}return d}},ks=new Set(["width","height","top","left","right","bottom","x","y"]),Ds=t=>ks.has(t),Bs=t=>t===G||t===ot;var Fs;!function(t){t.width="width",t.height="height",t.left="left",t.right="right",t.top="top",t.bottom="bottom"}(Fs||(Fs={}));const Os=(t,e)=>parseFloat(t.split(", ")[e]),Is=(t,e)=>(n,{transform:i})=>{if("none"===i||!i)return 0;const o=i.match(/^matrix3d\((.+)\)$/);if(o)return Os(o[1],e);{const e=i.match(/^matrix\((.+)\)$/);return e?Os(e[1],t):0}},js=new Set(["x","y","z"]),Us=I.filter(t=>!js.has(t));const Ns={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:Is(4,13),y:Is(5,14)},zs=(t,e,n={},i={})=>{e={...e},i={...i};const o=Object.keys(e).filter(Ds);let s=[],r=!1;const a=[];if(o.forEach(o=>{const c=t.getValue(o);if(!t.hasValue(o))return;let u=n[o],l=nn(u);const h=e[o];let d;if(Ft(h)){const t=h.length,e=null===h[0]?1:0;u=h[e],l=nn(u);for(let n=e;n<t;n++)d?nn(h[n]):d=nn(h[n])}else d=nn(h);if(l!==d)if(Bs(l)&&Bs(d)){const t=c.get();"string"==typeof t&&c.set(parseFloat(t)),"string"==typeof h?e[o]=parseFloat(h):Array.isArray(h)&&d===ot&&(e[o]=h.map(parseFloat))}else(null==l?void 0:l.transform)&&(null==d?void 0:d.transform)&&(0===u||0===h)?0===u?c.set(d.transform(u)):e[o]=l.transform(h):(r||(s=function(t){const e=[];return Us.forEach(n=>{const i=t.getValue(n);void 0!==i&&(e.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),e.length&&t.render(),e}(t),r=!0),a.push(o),i[o]=void 0!==i[o]?i[o]:e[o],c.jump(h))}),a.length){const n=a.indexOf("height")>=0?window.pageYOffset:null,o=((t,e,n)=>{const i=e.measureViewportBox(),o=e.current,s=getComputedStyle(o),{display:r}=s,a={};"none"===r&&e.setStaticValue("display",t.display||"block"),n.forEach(t=>{a[t]=Ns[t](i,s)}),e.render();const c=e.measureViewportBox();return n.forEach(n=>{const i=e.getValue(n);i&&i.jump(a[n]),t[n]=Ns[n](c,s)}),t})(e,t,a);return s.length&&s.forEach(([e,n])=>{t.getValue(e).set(n)}),t.render(),l&&null!==n&&window.scrollTo({top:n}),{target:o,transitionEnd:i}}return{target:e,transitionEnd:i}};function Ws(t,e,n,i){return(t=>Object.keys(t).some(Ds))(e)?zs(t,e,n,i):{target:e,transitionEnd:i}}const Hs=(t,e,n,i)=>{const o=function(t,{...e},n){const i=t.current;if(!(i instanceof Element))return{target:e,transitionEnd:n};n&&(n={...n}),t.values.forEach(t=>{const e=t.get();if(!Vs(e))return;const n=Ls(e,i);n&&t.set(n)});for(const t in e){const o=e[t];if(!Vs(o))continue;const s=Ls(o,i);s&&(e[t]=s,n&&void 0===n[t]&&(n[t]=o))}return{target:e,transitionEnd:n}}(t,e,i);return Ws(t,e=o.target,n,i=o.transitionEnd)},$s={current:null},Ys={current:!1};function Xs(){if(Ys.current=!0,l)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>$s.current=t.matches;t.addListener(e),e()}else $s.current=!1}const Gs=Object.keys(b),qs=Gs.length,Zs=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Ks{constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:i,visualState:o},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.scheduleRender=()=>we.render(this.render,!1,!0);const{latestValues:r,renderState:a}=o;this.latestValues=r,this.baseTarget={...r},this.initialValues=e.initial?{...r}:{},this.renderState=a,this.parent=t,this.props=e,this.presenceContext=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.options=s,this.isControllingVariants=y(e),this.isVariantNode=v(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:c,...u}=this.scrapeMotionValuesFromProps(e,{});for(const t in u){const e=u[t];void 0!==r[t]&&N(e)&&(e.set(r[t],!1),pn(c)&&c.add(t))}}scrapeMotionValuesFromProps(t,e){return{}}mount(t){this.current=t,this.projection&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((t,e)=>this.bindToMotionValue(e,t)),Ys.current||Xs(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||$s.current),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),Te.update(this.notifyUpdate),Te.render(this.render),this.valueSubscriptions.forEach(t=>t()),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features)this.features[t].unmount();this.current=null}bindToMotionValue(t,e){const n=j.has(t),i=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&we.update(this.notifyUpdate,!1,!0),n&&this.projection&&(this.projection.isTransformDirty=!0)}),o=e.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(t,()=>{i(),o()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}loadFeatures({children:t,...e},n,i,o,s){let r,a;for(let t=0;t<qs;t++){const n=Gs[t],{isEnabled:i,Feature:o,ProjectionNode:s,MeasureLayout:c}=b[n];s&&(r=s),i(e)&&(!this.features[n]&&o&&(this.features[n]=new o(this)),c&&(a=c))}if(!this.projection&&r){this.projection=new r(o,this.latestValues,this.parent&&this.parent.projection);const{layoutId:t,layout:n,drag:i,dragConstraints:a,layoutScroll:c,layoutRoot:u}=e;this.projection.setOptions({layoutId:t,layout:n,alwaysMeasureLayout:Boolean(i)||a&&p(a),visualElement:this,scheduleRender:()=>this.scheduleRender(),animationType:"string"==typeof n?n:"both",initialPromotionConfig:s,layoutScroll:c,layoutRoot:u})}return a}updateFeatures(){for(const t in this.features){const e=this.features[t];e.isMounted?e.update(this.props,this.prevProps):(e.mount(),e.isMounted=!0)}}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)}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;e<Zs.length;e++){const n=Zs[e];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);const i=t["on"+n];i&&(this.propEventSubscriptions[n]=this.on(n,i))}this.prevMotionValues=function(t,e,n){const{willChange:i}=e;for(const o in e){const s=e[o],r=n[o];if(N(s))t.addValue(o,s),pn(i)&&i.add(o);else if(N(r))t.addValue(o,Be(s,{owner:t})),pn(i)&&i.remove(o);else if(r!==s)if(t.hasValue(o)){const e=t.getValue(o);!e.hasAnimated&&e.set(s)}else{const e=t.getStaticValue(o);t.addValue(o,Be(void 0!==e?e:s,{owner:t}))}}for(const i in n)void 0===e[i]&&t.removeValue(i);return e}(this,this.scrapeMotionValuesFromProps(t,this.prevProps),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}getVariantContext(t=!1){if(t)return this.parent?this.parent.getVariantContext():void 0;if(!this.isControllingVariants){const t=this.parent&&this.parent.getVariantContext()||{};return void 0!==this.props.initial&&(t.initial=this.props.initial),t}const e={};for(let t=0;t<Js;t++){const n=_s[t],i=this.props[n];(m(i)||!1===i)&&(e[n]=i)}return e}addVariantChild(t){const e=this.getClosestVariantNode();if(e)return e.variantChildren&&e.variantChildren.add(t),()=>e.variantChildren.delete(t)}addValue(t,e){e!==this.values.get(t)&&(this.removeValue(t),this.bindToMotionValue(t,e)),this.values.set(t,e),this.latestValues[t]=e.get()}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return void 0===n&&void 0!==e&&(n=Be(e,{owner:this}),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,i="string"==typeof n||"object"==typeof n?null===(e=Bt(this.props,n))||void 0===e?void 0:e[t]:void 0;if(n&&void 0!==i)return i;const o=this.getBaseTargetFromProps(this.props,t);return void 0===o||N(o)?void 0!==this.initialValues[t]&&void 0===i?void 0:this.baseTarget[t]:o}on(t,e){return this.events[t]||(this.events[t]=new Re),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}}const _s=["initial",...ki],Js=_s.length;class Qs extends Ks{sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){return t.style?t.style[e]:void 0}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}makeTargetAnimatableFromInstance({transition:t,transitionEnd:e,...n},{transformValues:i},o){let s=dn(n,t||{},this);if(i&&(e&&(e=i(e)),n&&(n=i(n)),s&&(s=i(s))),o){ln(this,n,s);const t=Hs(this,n,s,e);e=t.transitionEnd,n=t.target}return{transition:t,transitionEnd:e,...n}}}class tr extends Qs{readValueFromInstance(t,e){if(j.has(e)){const t=Je(e);return t&&t.default||0}{const i=(n=t,window.getComputedStyle(n)),o=($(e)?i.getPropertyValue(e):i[e])||0;return"string"==typeof o?o.trim():o}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return So(t,e)}build(t,e,n,i){lt(t,e,n,i.transformTemplate)}scrapeMotionValuesFromProps(t,e){return kt(t,e)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;N(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=""+t)}))}renderInstance(t,e,n,i){Mt(t,e,n,i)}}function er(){const t=e.useContext(u);if(null===t)return[!0,null];const{isPresent:n,onExitComplete:i,register:o}=t,s=e.useId();e.useEffect(()=>o(s),[]);return!n&&i?[!1,()=>i&&i(s)]:[!0]}class nr extends s.default.Component{componentDidMount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n,layoutId:i}=this.props,{projection:o}=t;O(or),o&&(e.group&&e.group.add(o),n&&n.register&&i&&n.register(o),o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),A.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:e,visualElement:n,drag:i,isPresent:o}=this.props,s=n.projection;return s?(s.isPresent=o,i||t.layoutDependency!==e||void 0===e?s.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?s.promote():s.relegate()||we.postRender(()=>{const t=s.getStack();t&&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:i}=t;i&&(i.scheduleCheckAfterUnmount(),e&&e.group&&e.group.remove(i),n&&n.deregister&&n.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function ir(t){const[n,i]=er(),o=e.useContext(C);return s.default.createElement(nr,{...t,layoutGroup:o,switchLayoutGroup:e.useContext(V),isPresent:n,safeToRemove:i})}const or={borderRadius:{...Cs,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Cs,borderTopRightRadius:Cs,borderBottomLeftRadius:Cs,borderBottomRightRadius:Cs,boxShadow:Rs},sr={pan:{Feature:class extends ee{constructor(){super(...arguments),this.removePointerDownListener=oe}onPointerDown(t){this.session=new Wi(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint()})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:e,onPan:n,onPanEnd:i}=this.node.getProps();return{onSessionStart:t,onStart:e,onMove:n,onEnd:(t,e)=>{delete this.session,i&&i(t,e)}}}mount(){this.removePointerDownListener=Xt(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}},drag:{Feature:class extends ee{constructor(t){super(t),this.removeGroupControls=oe,this.removeListeners=oe,this.controls=new Vo(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||oe}unmount(){this.removeGroupControls(),this.removeListeners()}},ProjectionNode:ws,MeasureLayout:ir}};class rr extends Qs{constructor(){super(...arguments),this.isSVGTag=!1}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(j.has(e)){const t=Je(e);return t&&t.default||0}return e=Lt.has(e)?e:Vt(e),t.getAttribute(e)}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}scrapeMotionValuesFromProps(t,e){return Dt(t,e)}build(t,e,n,i){wt(t,e,n,this.isSVGTag,i.transformTemplate)}renderInstance(t,e,n,i){Rt(t,e,0,i)}mount(t){this.isSVGTag=At(t.tagName),super.mount(t)}}const ar=(t,e)=>B(t)?new rr(e,{enableHardwareAcceleration:!1}):new tr(e,{enableHardwareAcceleration:!0}),cr={layout:{ProjectionNode:ws,MeasureLayout:ir}},ur={...Ui,...de,...sr,...cr},lr=k((t,e)=>zt(t,e,ur,ar));const hr=k(zt);function dr(){const t=e.useRef(!1);return h(()=>(t.current=!0,()=>{t.current=!1}),[]),t}function pr(){const t=dr(),[n,i]=e.useState(0),o=e.useCallback(()=>{t.current&&i(n+1)},[n]);return[e.useCallback(()=>we.postRender(o),[o]),n]}class mr extends o.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 fr({children:t,isPresent:n}){const i=e.useId(),s=e.useRef(null),r=e.useRef({width:0,height:0,top:0,left:0});return e.useInsertionEffect(()=>{const{width:t,height:e,top:o,left:a}=r.current;if(n||!s.current||!t||!e)return;s.current.dataset.motionPopId=i;const c=document.createElement("style");return document.head.appendChild(c),c.sheet&&c.sheet.insertRule(`\n [data-motion-pop-id="${i}"] {\n position: absolute !important;\n width: ${t}px !important;\n height: ${e}px !important;\n top: ${o}px !important;\n left: ${a}px !important;\n }\n `),()=>{document.head.removeChild(c)}},[n]),o.createElement(mr,{isPresent:n,childRef:s,sizeRef:r},o.cloneElement(t,{ref:s}))}const gr=({children:t,initial:n,isPresent:i,onExitComplete:s,custom:r,presenceAffectsLayout:a,mode:c})=>{const l=T(yr),h=e.useId(),d=e.useMemo(()=>({id:h,initial:n,isPresent:i,custom:r,onExitComplete:t=>{l.set(t,!0);for(const t of l.values())if(!t)return;s&&s()},register:t=>(l.set(t,!1),()=>l.delete(t))}),a?void 0:[i]);return e.useMemo(()=>{l.forEach((t,e)=>l.set(e,!1))},[i]),o.useEffect(()=>{!i&&!l.size&&s&&s()},[i]),"popLayout"===c&&(t=o.createElement(fr,{isPresent:i},t)),o.createElement(u.Provider,{value:d},t)};function yr(){return new Map}function vr(t){return e.useEffect(()=>()=>t(),[])}const xr=t=>t.key||"";const Pr=e.createContext(null),Er=t=>!0===t,br=({children:t,id:n,inheritId:i,inherit:s=!0})=>{void 0!==i&&(s=i);const r=e.useContext(C),a=e.useContext(Pr),[c,u]=pr(),l=e.useRef(null),h=r.id||a;null===l.current&&((t=>Er(!0===t)||"id"===t)(s)&&h&&(n=n?h+"-"+n:h),l.current={id:n,group:Er(s)&&r.group||As()});const d=e.useMemo(()=>({...l.current,forceRender:c}),[u]);return o.createElement(C.Provider,{value:d},t)};let wr=0;function Tr(t){return"function"==typeof t}const Ar=e.createContext(null);const Sr=e.forwardRef((function({children:t,as:n="ul",axis:i="y",onReorder:s,values:r,...a},c){const u=T(()=>lr(n)),l=[],h=e.useRef(!1),d={axis:i,registerItem:(t,e)=>{e&&-1===l.findIndex(e=>t===e.value)&&(l.push({value:t,layout:e[i]}),l.sort(Vr))},updateOrder:(t,e,n)=>{if(h.current)return;const i=function(t,e,n,i){if(!i)return t;const o=t.findIndex(t=>t.value===e);if(-1===o)return t;const s=i>0?1:-1,r=t[o+s];if(!r)return t;const a=t[o],c=r.layout,u=bn(c.min,c.max,.5);return 1===s&&a.layout.max+n>u||-1===s&&a.layout.min+n<u?function([...t],e,n){const i=e<0?t.length+e:e;if(i>=0&&i<t.length){const i=n<0?t.length+n:n,[o]=t.splice(e,1);t.splice(i,0,o)}return t}(t,o,o+s):t}(l,t,e,n);l!==i&&(h.current=!0,s(i.map(Cr).filter(t=>-1!==r.indexOf(t))))}};return e.useEffect(()=>{h.current=!1}),o.createElement(u,{...a,ref:c,ignoreStrict:!0},o.createElement(Ar.Provider,{value:d},t))}));function Cr(t){return t.value}function Vr(t,e){return t.layout.min-e.layout.min}function Mr(t){const n=T(()=>Be(t)),{isStatic:i}=e.useContext(r);if(i){const[,i]=e.useState(t);e.useEffect(()=>n.on("change",i),[])}return n}function Lr(...t){const e=!Array.isArray(t[0]),n=e?0:-1,i=t[0+n],o=t[1+n],s=t[2+n],r=t[3+n],a=Fn(o,s,{mixer:(c=s[0],(t=>"object"==typeof t&&t.mix)(c)?c.mix:void 0),...r});var c;return e?a(i):a}function Rr(t,e){const n=Mr(e()),i=()=>n.set(e());return i(),h(()=>{const e=()=>we.update(i,!1,!0),n=t.map(t=>t.on("change",e));return()=>{n.forEach(t=>t()),Te.update(i)}}),n}function kr(t,e,n,i){const o="function"==typeof e?e:Lr(e,n,i);return Array.isArray(t)?Dr(t,o):Dr([t],([t])=>o(t))}function Dr(t,e){const n=T(()=>[]);return Rr(t,()=>{n.length=0;const i=t.length;for(let e=0;e<i;e++)n[e]=t[e].get();return e(n)})}function Br(t,e=0){return N(t)?t:Mr(e)}const Fr={Group:Sr,Item:e.forwardRef((function({children:t,style:n={},value:i,as:s="li",onDrag:r,layout:a=!0,...c},u){const l=T(()=>lr(s)),h=e.useContext(Ar),d={x:Br(n.x),y:Br(n.y)},p=kr([d.x,d.y],([t,e])=>t||e?1:"unset"),m=e.useRef(null),{axis:f,registerItem:g,updateOrder:y}=h;return e.useEffect(()=>{g(i,m.current)},[h]),o.createElement(l,{drag:f,...c,dragSnapToOrigin:!0,style:{...n,x:d.x,y:d.y,zIndex:p},layout:a,onDrag:(t,e)=>{const{velocity:n}=e;n[f]&&y(i,d[f].get(),n[f]),r&&r(t,e)},onLayoutMeasure:t=>{m.current=t},ref:u,ignoreStrict:!0},t)}))},Or={renderer:ar,...Ui,...de},Ir={...Or,...sr,...cr};const jr=t=>"number"==typeof t;function Ur(t,e){return(t=>Array.isArray(t)&&!jr(t[0]))(t)?t[((t,e,n)=>{const i=e-t;return((n-t)%i+i)%i+t})(0,t.length,e)]:t}const Nr=(t,e,n)=>-n*t+n*e+t,zr=t=>t,Wr=(t,e,n)=>e-t==0?1:(n-t)/(e-t);function Hr(t,e){const n=t[t.length-1];for(let i=1;i<=e;i++){const o=Wr(0,e,i);t.push(Nr(n,1,o))}}function $r(t){const e=[0];return Hr(e,t-1),e}function Yr(t,e=$r(t.length),n=zr){const i=t.length,o=i-e.length;return o>0&&Hr(e,o),o=>{let s=0;for(;s<i-2&&!(o<e[s+1]);s++);let r=(a=0,c=1,u=Wr(e[s],e[s+1],o),Math.min(Math.max(u,a),c));var a,c,u;return r=Ur(n,s)(r),Nr(t[s],t[s+1],r)}}const Xr=t=>"function"==typeof t,Gr=t=>"string"==typeof t;function qr(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 Zr={any:0,all:1};const Kr=new WeakMap;let _r;function Jr({target:t,contentRect:e,borderBoxSize:n}){var i;null===(i=Kr.get(t))||void 0===i||i.forEach(i=>{i({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 Qr(t){t.forEach(Jr)}function ta(t,e){_r||"undefined"!=typeof ResizeObserver&&(_r=new ResizeObserver(Qr));const n=qr(t);return n.forEach(t=>{let n=Kr.get(t);n||(n=new Set,Kr.set(t,n)),n.add(e),null==_r||_r.observe(t)}),()=>{n.forEach(t=>{const n=Kr.get(t);null==n||n.delete(e),(null==n?void 0:n.size)||null==_r||_r.unobserve(t)})}}const ea=new Set;let na;function ia(t){return ea.add(t),na||(na=()=>{const t={width:window.innerWidth,height:window.innerHeight},e={target:window,size:t,contentSize:t};ea.forEach(t=>t(e))},window.addEventListener("resize",na)),()=>{ea.delete(t),!ea.size&&na&&(na=void 0)}}const oa={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}};function sa(t,e,n,i){const o=n[e],{length:s,position:r}=oa[e],a=o.current,c=n.time;o.current=t["scroll"+r],o.scrollLength=t["scroll"+s]-t["client"+s],o.offset.length=0,o.offset[0]=0,o.offset[1]=o.scrollLength,o.progress=Wr(0,o.scrollLength,o.current);const u=i-c;var l,h;o.velocity=u>50?0:(l=o.current-a,(h=u)?l*(1e3/h):0)}const ra={Enter:[[0,1],[1,1]],Exit:[[0,0],[1,0]],Any:[[1,0],[0,1]],All:[[0,0],[1,1]]},aa={start:0,center:.5,end:1};function ca(t,e,n=0){let i=0;if(void 0!==aa[t]&&(t=aa[t]),Gr(t)){const e=parseFloat(t);t.endsWith("px")?i=e:t.endsWith("%")?t=e/100:t.endsWith("vw")?i=e/100*document.documentElement.clientWidth:t.endsWith("vh")?i=e/100*document.documentElement.clientHeight:t=e}return jr(t)&&(i=e*t),n+i}const ua=[0,0];function la(t,e,n,i){let o=Array.isArray(t)?t:ua,s=0,r=0;return jr(t)?o=[t,t]:Gr(t)&&(o=(t=t.trim()).includes(" ")?t.split(" "):[t,aa[t]?t:"0"]),s=ca(o[0],n,i),r=ca(o[1],e),s-r}const ha={x:0,y:0};function da(t,e,n){let{offset:i=ra.All}=n;const{target:o=t,axis:s="y"}=n,r="y"===s?"height":"width",a=o!==t?function(t,e){let n={x:0,y:0},i=t;for(;i&&i!==e;)if(i instanceof HTMLElement)n.x+=i.offsetLeft,n.y+=i.offsetTop,i=i.offsetParent;else if(i instanceof SVGGraphicsElement&&"getBBox"in i){const{top:t,left:e}=i.getBBox();for(n.x+=e,n.y+=t;i&&"svg"!==i.tagName;)i=i.parentNode}return n}(o,t):ha,c=o===t?{width:t.scrollWidth,height:t.scrollHeight}:{width:o.clientWidth,height:o.clientHeight},u={width:t.clientWidth,height:t.clientHeight};e[s].offset.length=0;let l=!e[s].interpolate;const h=i.length;for(let t=0;t<h;t++){const n=la(i[t],u[r],c[r],a[s]);l||n===e[s].interpolatorOffsets[t]||(l=!0),e[s].offset[t]=n}l&&(e[s].interpolate=Yr($r(h),e[s].offset),e[s].interpolatorOffsets=[...e[s].offset]),e[s].progress=e[s].interpolate(e[s].current)}function pa(t,e,n,i={}){const o=i.axis||"y";return{measure:()=>function(t,e=t,n){if(n.x.targetOffset=0,n.y.targetOffset=0,e!==t){let i=e;for(;i&&i!=t;)n.x.targetOffset+=i.offsetLeft,n.y.targetOffset+=i.offsetTop,i=i.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,i.target,n),update:e=>{!function(t,e,n){sa(t,"x",e,n),sa(t,"y",e,n),e.time=n}(t,n,e),(i.offset||i.target)&&da(t,n,i)},notify:Xr(e)?()=>e(n):ma(e,n[o])}}function ma(t,e){return t.pause(),t.forEachNative((t,{easing:e})=>{var n,i;if(t.updateDuration)e||(t.easing=zr),t.updateDuration(1);else{const o={duration:1e3};e||(o.easing="linear"),null===(i=null===(n=t.effect)||void 0===n?void 0:n.updateTiming)||void 0===i||i.call(n,o)}}),()=>{t.currentTime=e.progress}}const fa=new WeakMap,ga=new WeakMap,ya=new WeakMap,va=t=>t===document.documentElement?window:t;function xa(t,e={}){var{container:n=document.documentElement}=e,i=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(t);o<i.length;o++)e.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(t,i[o])&&(n[i[o]]=t[i[o]])}return n}(e,["container"]);let o=ya.get(n);o||(o=new Set,ya.set(n,o));const s=pa(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}},i);if(o.add(s),!fa.has(n)){const t=()=>{const t=performance.now();for(const t of o)t.measure();for(const e of o)e.update(t);for(const t of o)t.notify()};fa.set(n,t);const e=va(n);window.addEventListener("resize",t,{passive:!0}),n!==document.documentElement&&ga.set(n,(a=t,Xr(r=n)?ia(r):ta(r,a))),e.addEventListener("scroll",t,{passive:!0})}var r,a;const c=fa.get(n),u=requestAnimationFrame(c);return()=>{var e;"function"!=typeof t&&t.stop(),cancelAnimationFrame(u);const i=ya.get(n);if(!i)return;if(i.delete(s),i.size)return;const o=fa.get(n);fa.delete(n),o&&(va(n).removeEventListener("scroll",o),null===(e=ga.get(n))||void 0===e||e(),window.removeEventListener("resize",o))}}function Pa(t,e){Boolean(!e||e.current)}const Ea=()=>({scrollX:Be(0),scrollY:Be(0),scrollXProgress:Be(0),scrollYProgress:Be(0)});function ba({container:t,target:n,layoutEffect:i=!0,...o}={}){const s=T(Ea);return(i?h:e.useEffect)(()=>(Pa(0,n),Pa(0,t),xa(({x:t,y:e})=>{s.scrollX.set(t.current),s.scrollXProgress.set(t.progress),s.scrollY.set(e.current),s.scrollYProgress.set(e.progress)},{...o,container:(null==t?void 0:t.current)||void 0,target:(null==n?void 0:n.current)||void 0})),[]),s}function wa(t){const n=e.useRef(0),{isStatic:i}=e.useContext(r);e.useEffect(()=>{if(i)return;const e=({timestamp:e,delta:i})=>{n.current||(n.current=e),t(e-n.current,i)};return we.update(e,!0),()=>Te.update(e)},[t])}class Ta extends De{constructor(){super(...arguments),this.members=[],this.transforms=new Set}add(t){let e;j.has(t)?(this.transforms.add(t),e="transform"):t.startsWith("origin")||$(t)||"willChange"===t||(e=Vt(t)),e&&(Me(this.members,e),this.update())}remove(t){j.has(t)?(this.transforms.delete(t),this.transforms.size||Le(this.members,"transform")):Le(this.members,Vt(t)),this.update()}update(){this.set(this.members.length?this.members.join(", "):"auto")}}function Aa(){!Ys.current&&Xs();const[t]=e.useState($s.current);return t}function Sa(){const t=new Set,e={subscribe:e=>(t.add(e),()=>{t.delete(e)}),start(e,n){const i=[];return t.forEach(t=>{i.push(Ci(t,e,{transitionOverride:n}))}),Promise.all(i)},set:e=>t.forEach(t=>{!function(t,e){Array.isArray(e)?un(t,e):"string"==typeof e?un(t,[e]):cn(t,e)}(t,e)}),stop(){t.forEach(t=>{!function(t){t.values.forEach(t=>t.stop())}(t)})},mount:()=>()=>{e.stop()}};return e}function Ca(){const t=T(Sa);return h(t.mount,[]),t}const Va=Ca,Ma=(t,e,n)=>{const i=e-t;return((n-t)%i+i)%i+t};class La{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 Ra=()=>new La;function ka(t){return null!==t&&"object"==typeof t&&M in t}function Da(){return Ba}function Ba(t){bs.current&&(bs.current.isUpdating=!1,bs.current.blockUpdate(),t&&t())}const Fa=(t,e)=>`${t}: ${e}`,Oa=new Map;function Ia(t,e,n,i){const o=Fa(t,j.has(e)?"transform":e),s=Oa.get(o);if(!s)return 0;const{animation:r,startTime:a}=s,c=()=>{Oa.delete(o);try{r.cancel()}catch(t){}};if(null!==a){const t=performance.now();return i.update(()=>{n.animation&&(n.animation.currentTime=performance.now()-t)}),i.render(c),t-a||0}return c(),0}const ja=()=>({});class Ua extends Ks{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 ln(this,n,dn(n,t||{},this)),{transition:t,transitionEnd:e,...n}}}const Na=It({scrapeMotionValuesFromProps:ja,createRenderState:ja});const za=t=>t>.001?1/t:1e5;t.AnimatePresence=({children:t,custom:n,initial:i=!0,onExitComplete:s,exitBeforeEnter:r,presenceAffectsLayout:a=!0,mode:c="sync"})=>{r&&(c="wait");let[u]=pr();const l=e.useContext(C).forceRender;l&&(u=l);const d=dr(),p=function(t){const n=[];return e.Children.forEach(t,t=>{e.isValidElement(t)&&n.push(t)}),n}(t);let m=p;const f=new Set,g=e.useRef(m),y=e.useRef(new Map).current,v=e.useRef(!0);if(h(()=>{v.current=!1,function(t,e){t.forEach(t=>{const n=xr(t);e.set(n,t)})}(p,y),g.current=m}),vr(()=>{v.current=!0,y.clear(),f.clear()}),v.current)return o.createElement(o.Fragment,null,m.map(t=>o.createElement(gr,{key:xr(t),isPresent:!0,initial:!!i&&void 0,presenceAffectsLayout:a,mode:c},t)));m=[...m];const x=g.current.map(xr),P=p.map(xr),E=x.length;for(let t=0;t<E;t++){const e=x[t];-1===P.indexOf(e)&&f.add(e)}return"wait"===c&&f.size&&(m=[]),f.forEach(t=>{if(-1!==P.indexOf(t))return;const e=y.get(t);if(!e)return;const i=x.indexOf(t);m.splice(i,0,o.createElement(gr,{key:xr(e),isPresent:!1,onExitComplete:()=>{y.delete(t),f.delete(t);const e=g.current.findIndex(e=>e.key===t);if(g.current.splice(e,1),!f.size){if(g.current=p,!1===d.current)return;u(),s&&s()}},custom:n,presenceAffectsLayout:a,mode:c},e))}),m=m.map(t=>{const e=t.key;return f.has(e)?t:o.createElement(gr,{key:xr(t),isPresent:!0,presenceAffectsLayout:a,mode:c},t)}),o.createElement(o.Fragment,null,f.size?m:m.map(t=>e.cloneElement(t)))},t.AnimateSharedLayout=({children:t})=>(o.useEffect(()=>{},[]),o.createElement(br,{id:T(()=>"asl-"+wr++)},t)),t.DeprecatedLayoutGroupContext=Pr,t.DragControls=La,t.FlatTree=Qo,t.LayoutGroup=br,t.LayoutGroupContext=C,t.LazyMotion=function({children:t,features:n,strict:i=!1}){const[,s]=e.useState(!Tr(n)),r=e.useRef(void 0);if(!Tr(n)){const{renderer:t,...e}=n;r.current=t,w(e)}return e.useEffect(()=>{Tr(n)&&n().then(({renderer:t,...e})=>{w(e),r.current=t,s(!0)})},[]),o.createElement(d.Provider,{value:{renderer:r.current,strict:i}},t)},t.MotionConfig=function({children:t,isValidProp:n,...i}){n&&vt(n),(i={...e.useContext(r),...i}).isStatic=T(()=>i.isStatic);const s=e.useMemo(()=>i,[JSON.stringify(i.transition),i.transformPagePoint,i.reducedMotion]);return o.createElement(r.Provider,{value:s},t)},t.MotionConfigContext=r,t.MotionContext=a,t.MotionValue=De,t.PresenceContext=u,t.Reorder=Fr,t.SwitchLayoutGroupContext=V,t.VisualElement=Ks,t.addPointerEvent=Xt,t.addPointerInfo=Yt,t.addScaleCorrector=O,t.animate=Lo,t.animateVisualElement=Ci,t.animationControls=Sa,t.animations=Ui,t.anticipate=$n,t.backIn=Wn,t.backInOut=Hn,t.backOut=zn,t.buildTransform=H,t.calcLength=Zi,t.checkTargetForNewValues=ln,t.circIn=jn,t.circInOut=Nn,t.circOut=Un,t.clamp=X,t.createBox=ao,t.createDomMotionComponent=function(t){return L(zt(t,{forwardMotionProps:!1},ur,ar))},t.createMotionComponent=L,t.cubicBezier=In,t.delay=mi,t.distance=Ni,t.distance2D=zi,t.domAnimation=Or,t.domMax=Ir,t.easeIn=xn,t.easeInOut=En,t.easeOut=Pn,t.filterProps=xt,t.frameData=fe,t.isBrowser=l,t.isDragActive=te,t.isMotionComponent=ka,t.isMotionValue=N,t.isValidMotionProp=gt,t.m=hr,t.makeUseVisualState=It,t.mix=bn,t.motion=lr,t.motionValue=Be,t.optimizedAppearDataAttribute=mn,t.pipe=Zt,t.resolveMotionValue=Ot,t.spring=Qn,t.startOptimizedAppearAnimation=function(t,e,n,i,o){const s=t.dataset.framerAppearId;if(!s)return;window.HandoffAppearAnimations=Ia;const r=Fa(s,e),a=ci(t,e,[n[0],n[0]],{duration:1e4,ease:"linear"});Oa.set(r,{animation:a,startTime:null});const c=()=>{a.cancel();const s=ci(t,e,n,i);document.timeline&&(s.startTime=document.timeline.currentTime),Oa.set(r,{animation:s,startTime:performance.now()}),o&&o(s)};a.ready?a.ready.then(c).catch(oe):c()},t.sync=we,t.transform=Lr,t.unwrapMotionComponent=function(t){if(ka(t))return t[M]},t.useAnimation=Va,t.useAnimationControls=Ca,t.useAnimationFrame=wa,t.useCycle=function(...t){const n=e.useRef(0),[i,o]=e.useState(t[n.current]);return[i,e.useCallback(e=>{n.current="number"!=typeof e?Ma(0,t.length,n.current+1):e,o(t[n.current])},[t.length,...t])]},t.useDeprecatedAnimatedState=function(t){const[n,i]=e.useState(t),o=Na({},!1),s=T(()=>new Ua({props:{},visualState:o,presenceContext:null},{initialState:t}));return e.useEffect(()=>(s.mount({}),()=>s.unmount()),[s]),e.useEffect(()=>{s.update({onUpdate:t=>{i({...t})}},null)},[i,s]),[n,T(()=>t=>Ci(s,t))]},t.useDeprecatedInvertedScale=function(t){let e=Mr(1),n=Mr(1);const i=c();return t?(e=t.scaleX||e,n=t.scaleY||n):i&&(e=i.getValue("scaleX",1),n=i.getValue("scaleY",1)),{scaleX:kr(e,za),scaleY:kr(n,za)}},t.useDomEvent=function(t,n,i,o){e.useEffect(()=>{const e=t.current;if(i&&e)return Wt(e,n,i,o)},[t,n,i,o])},t.useDragControls=function(){return T(Ra)},t.useElementScroll=function(t){return ba({container:t})},t.useForceUpdate=pr,t.useInView=function(t,{root:n,margin:i,amount:o,once:s=!1}={}){const[r,a]=e.useState(!1);return e.useEffect(()=>{if(!t.current||s&&r)return;const e={root:n&&n.current||void 0,margin:i,amount:"some"===o?"any":o};return function(t,e,{root:n,margin:i,amount:o="any"}={}){if("undefined"==typeof IntersectionObserver)return()=>{};const s=qr(t),r=new WeakMap,a=new IntersectionObserver(t=>{t.forEach(t=>{const n=r.get(t.target);if(t.isIntersecting!==Boolean(n))if(t.isIntersecting){const n=e(t);Xr(n)?r.set(t.target,n):a.unobserve(t.target)}else n&&(n(t),r.delete(t.target))})},{root:n,rootMargin:i,threshold:"number"==typeof o?o:Zr[o]});return s.forEach(t=>a.observe(t)),()=>a.disconnect()}(t.current,()=>(a(!0),s?void 0:()=>a(!1)),e)},[n,t,i,s]),r},t.useInstantLayoutTransition=Da,t.useInstantTransition=function(){const[t,n]=pr(),i=Da();return e.useEffect(()=>{we.postRender(()=>we.postRender(()=>gn.current=!1))},[n]),e=>{i(()=>{gn.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 Rr(e.filter(N),(function(){let i="";for(let o=0;o<n;o++){i+=t[o];const n=e[o];n&&(i+=N(n)?n.get():n)}return i}))},t.useMotionValue=Mr,t.useMotionValueEvent=function(t,n,i){e.useInsertionEffect(()=>t.on(n,i),[t,n,i])},t.usePresence=er,t.useReducedMotion=Aa,t.useReducedMotionConfig=function(){const t=Aa(),{reducedMotion:n}=e.useContext(r);return"never"!==n&&("always"===n||t)},t.useResetProjection=function(){return o.useCallback(()=>{const t=bs.current;t&&t.resetTree()},[])},t.useScroll=ba,t.useSpring=function(t,n={}){const{isStatic:i}=e.useContext(r),o=e.useRef(null),s=Mr(N(t)?t.get():t),a=()=>{o.current&&o.current.stop()};return e.useInsertionEffect(()=>s.attach((t,e)=>i?e(t):(a(),o.current=oi({keyframes:[s.get(),t],velocity:s.getVelocity(),type:"spring",...n,onUpdate:e}),s.get()),a),[JSON.stringify(n)]),h(()=>{if(N(t))return t.on("change",t=>s.set(parseFloat(t)))},[s]),s},t.useTime=function(){const t=Mr(0);return wa(e=>t.set(e)),t},t.useTransform=kr,t.useUnmountEffect=vr,t.useVelocity=function(t){const n=Mr(t.getVelocity());return e.useEffect(()=>t.on("velocityChange",t=>{n.set(t)}),[t]),n},t.useViewportScroll=function(){return ba()},t.useVisualElementContext=c,t.useWillChange=function(){return T(()=>new Ta("auto"))},t.wrap=Ma,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 i(t){if(t&&t.__esModule)return t;var e=Object.create(null);return t&&Object.keys(t).forEach((function(n){if("default"!==n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}})),e.default=t,Object.freeze(e)}var o=i(e),s=n(e);const r=e.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),a=e.createContext({});function c(){return e.useContext(a).visualElement}const u=e.createContext(null),l="undefined"!=typeof document,h=l?e.useLayoutEffect:e.useEffect,d=e.createContext({strict:!1});function p(t){return"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}function m(t){return"string"==typeof t||Array.isArray(t)}function f(t){return"object"==typeof t&&"function"==typeof t.start}const g=["initial","animate","exit","whileHover","whileDrag","whileTap","whileFocus","whileInView"];function y(t){return f(t.animate)||g.some(e=>m(t[e]))}function v(t){return Boolean(y(t)||t.variants)}function x(t){const{initial:n,animate:i}=function(t,e){if(y(t)){const{initial:e,animate:n}=t;return{initial:!1===e||m(e)?e:void 0,animate:m(n)?n:void 0}}return!1!==t.inherit?e:{}}(t,e.useContext(a));return e.useMemo(()=>({initial:n,animate:i}),[P(n),P(i)])}function P(t){return Array.isArray(t)?t.join(" "):t}const E={animation:["animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},b={};for(const t in E)b[t]={isEnabled:e=>E[t].some(t=>!!e[t])};function w(t){for(const e in t)b[e]={...b[e],...t[e]}}function T(t){const n=e.useRef(null);return null===n.current&&(n.current=t()),n.current}const A={hasAnimatedSinceResize:!0,hasEverUpdated:!1};let S=1;const C=e.createContext({}),V=e.createContext({}),M=Symbol.for("motionComponentSymbol");function L({preloadedFeatures:t,createVisualElement:n,useRender:i,useVisualState:s,Component:m}){t&&w(t);const f=e.forwardRef((function(f,g){let y;const v={...e.useContext(r),...f,layoutId:R(f)},{isStatic:P}=v,E=x(f),b=P?void 0:T(()=>{if(A.hasEverUpdated)return S++}),w=s(f,P);if(!P&&l){E.visualElement=function(t,n,i,o){const s=c(),a=e.useContext(d),l=e.useContext(u),p=e.useContext(r).reducedMotion,m=e.useRef();o=o||a.renderer,!m.current&&o&&(m.current=o(t,{visualState:n,parent:s,props:i,presenceContext:l,blockInitialAnimation:!!l&&!1===l.initial,reducedMotionConfig:p}));const f=m.current;return e.useInsertionEffect(()=>{f&&f.update(i,l)}),h(()=>{f&&f.render()}),e.useEffect(()=>{f&&f.updateFeatures()}),(window.HandoffAppearAnimations?h:e.useEffect)(()=>{f&&f.animationState&&f.animationState.animateChanges()}),f}(m,w,v,n);const i=e.useContext(V),o=e.useContext(d).strict;E.visualElement&&(y=E.visualElement.loadFeatures(v,o,t,b,i))}return o.createElement(a.Provider,{value:E},y&&E.visualElement?o.createElement(y,{visualElement:E.visualElement,...v}):null,i(m,f,b,function(t,n,i){return e.useCallback(e=>{e&&t.mount&&t.mount(e),n&&(e?n.mount(e):n.unmount()),i&&("function"==typeof i?i(e):p(i)&&(i.current=e))},[n])}(w,E.visualElement,g),w,P,E.visualElement))}));return f[M]=m,f}function R({layoutId:t}){const n=e.useContext(C).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,i)=>(n.has(i)||n.set(i,e(i)),n.get(i))})}const D=["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 B(t){return"string"==typeof t&&!t.includes("-")&&!!(D.indexOf(t)>-1||/[A-Z]/.test(t))}const F={};function O(t){Object.assign(F,t)}const I=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],j=new Set(I);function U(t,{layout:e,layoutId:n}){return j.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!F[t]||"opacity"===t)}const N=t=>Boolean(t&&t.getVelocity),z={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},W=I.length;function H(t,{enableHardwareAcceleration:e=!0,allowTransformNone:n=!0},i,o){let s="";for(let e=0;e<W;e++){const n=I[e];if(void 0!==t[n]){s+=`${z[n]||n}(${t[n]}) `}}return e&&!t.z&&(s+="translateZ(0)"),s=s.trim(),o?s=o(t,i?"":s):n&&i&&(s="none"),s}function $(t){return t.startsWith("--")}const Y=(t,e)=>e&&"number"==typeof t?e.transform(t):t,X=(t,e,n)=>Math.min(Math.max(n,t),e),G={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},q={...G,transform:t=>X(0,1,t)},Z={...G,default:1},_=t=>Math.round(1e5*t)/1e5,K=/(-)?([\d]*\.?[\d])+/g,J=/(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,Q=/^(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function tt(t){return"string"==typeof t}const et=t=>({test:e=>tt(e)&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),nt=et("deg"),it=et("%"),ot=et("px"),st=et("vh"),rt=et("vw"),at={...it,parse:t=>it.parse(t)/100,transform:t=>it.transform(100*t)},ct={...G,transform:Math.round},ut={borderWidth:ot,borderTopWidth:ot,borderRightWidth:ot,borderBottomWidth:ot,borderLeftWidth:ot,borderRadius:ot,radius:ot,borderTopLeftRadius:ot,borderTopRightRadius:ot,borderBottomRightRadius:ot,borderBottomLeftRadius:ot,width:ot,maxWidth:ot,height:ot,maxHeight:ot,size:ot,top:ot,right:ot,bottom:ot,left:ot,padding:ot,paddingTop:ot,paddingRight:ot,paddingBottom:ot,paddingLeft:ot,margin:ot,marginTop:ot,marginRight:ot,marginBottom:ot,marginLeft:ot,rotate:nt,rotateX:nt,rotateY:nt,rotateZ:nt,scale:Z,scaleX:Z,scaleY:Z,scaleZ:Z,skew:nt,skewX:nt,skewY:nt,distance:ot,translateX:ot,translateY:ot,translateZ:ot,x:ot,y:ot,z:ot,perspective:ot,transformPerspective:ot,opacity:q,originX:at,originY:at,originZ:ot,zIndex:ct,fillOpacity:q,strokeOpacity:q,numOctaves:ct};function lt(t,e,n,i){const{style:o,vars:s,transform:r,transformOrigin:a}=t;let c=!1,u=!1,l=!0;for(const t in e){const n=e[t];if($(t)){s[t]=n;continue}const i=ut[t],h=Y(n,i);if(j.has(t)){if(c=!0,r[t]=h,!l)continue;n!==(i.default||0)&&(l=!1)}else t.startsWith("origin")?(u=!0,a[t]=h):o[t]=h}if(e.transform||(c||i?o.transform=H(t.transform,n,l,i):o.transform&&(o.transform="none")),u){const{originX:t="50%",originY:e="50%",originZ:n=0}=a;o.transformOrigin=`${t} ${e} ${n}`}}const ht=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function dt(t,e,n){for(const i in e)N(e[i])||U(i,n)||(t[i]=e[i])}function pt(t,n,i){const o={};return dt(o,t.style||{},t),Object.assign(o,function({transformTemplate:t},n,i){return e.useMemo(()=>{const e={style:{},transform:{},transformOrigin:{},vars:{}};return lt(e,n,{enableHardwareAcceleration:!i},t),Object.assign({},e.vars,e.style)},[n])}(t,n,i)),t.transformValues?t.transformValues(o):o}function mt(t,e,n){const i={},o=pt(t,e,n);return t.drag&&!1!==t.dragListener&&(i.draggable=!1,o.userSelect=o.WebkitUserSelect=o.WebkitTouchCallout="none",o.touchAction=!0===t.drag?"none":"pan-"+("x"===t.drag?"y":"x")),void 0===t.tabIndex&&(t.onTap||t.onTapStart||t.whileTap)&&(i.tabIndex=0),i.style=o,i}const ft=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","transformValues","custom","inherit","onLayoutAnimationStart","onLayoutAnimationComplete","onLayoutMeasure","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","ignoreStrict","viewport"]);function gt(t){return t.startsWith("while")||t.startsWith("drag")&&"draggable"!==t||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||ft.has(t)}let yt=t=>!gt(t);function vt(t){t&&(yt=e=>e.startsWith("on")?!gt(e):t(e))}try{vt(require("@emotion/is-prop-valid").default)}catch(t){}function xt(t,e,n){const i={};for(const o in t)"values"===o&&"object"==typeof t.values||(yt(o)||!0===n&>(o)||!e&&!gt(o)||t.draggable&&o.startsWith("onDrag"))&&(i[o]=t[o]);return i}function Pt(t,e,n){return"string"==typeof t?t:ot.transform(e+n*t)}const Et={offset:"stroke-dashoffset",array:"stroke-dasharray"},bt={offset:"strokeDashoffset",array:"strokeDasharray"};function wt(t,{attrX:e,attrY:n,originX:i,originY:o,pathLength:s,pathSpacing:r=1,pathOffset:a=0,...c},u,l,h){if(lt(t,c,u,h),l)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:d,style:p,dimensions:m}=t;d.transform&&(m&&(p.transform=d.transform),delete d.transform),m&&(void 0!==i||void 0!==o||p.transform)&&(p.transformOrigin=function(t,e,n){return`${Pt(e,t.x,t.width)} ${Pt(n,t.y,t.height)}`}(m,void 0!==i?i:.5,void 0!==o?o:.5)),void 0!==e&&(d.x=e),void 0!==n&&(d.y=n),void 0!==s&&function(t,e,n=1,i=0,o=!0){t.pathLength=1;const s=o?Et:bt;t[s.offset]=ot.transform(-i);const r=ot.transform(e),a=ot.transform(n);t[s.array]=`${r} ${a}`}(d,s,r,a,!1)}const Tt=()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}}),At=t=>"string"==typeof t&&"svg"===t.toLowerCase();function St(t,n,i,o){const s=e.useMemo(()=>{const e={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};return wt(e,n,{enableHardwareAcceleration:!1},At(o),t.transformTemplate),{...e.attrs,style:{...e.style}}},[n]);if(t.style){const e={};dt(e,t.style,t),s.style={...e,...s.style}}return s}function Ct(t=!1){return(n,i,o,s,{latestValues:r},a)=>{const c=(B(n)?St:mt)(i,r,a,n),u={...xt(i,"string"==typeof n,t),...c,ref:s},{children:l}=i,h=e.useMemo(()=>N(l)?l.get():l,[l]);return o&&(u["data-projection-id"]=o),e.createElement(n,{...u,children:h})}}const Vt=t=>t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();function Mt(t,{style:e,vars:n},i,o){Object.assign(t.style,e,o&&o.getProjectionStyles(i));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 Rt(t,e,n,i){Mt(t,e,void 0,i);for(const n in e.attrs)t.setAttribute(Lt.has(n)?n:Vt(n),e.attrs[n])}function kt(t,e){const{style:n}=t,i={};for(const o in n)(N(n[o])||e.style&&N(e.style[o])||U(o,t))&&(i[o]=n[o]);return i}function Dt(t,e){const n=kt(t,e);for(const i in t)if(N(t[i])||N(e[i])){n["x"===i||"y"===i?"attr"+i.toUpperCase():i]=t[i]}return n}function Bt(t,e,n,i={},o={}){return"function"==typeof e&&(e=e(void 0!==n?n:t.custom,i,o)),"string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e&&(e=e(void 0!==n?n:t.custom,i,o)),e}const Ft=t=>Array.isArray(t);function Ot(t){const e=N(t)?t.get():t;return n=e,Boolean(n&&"object"==typeof n&&n.mix&&n.toValue)?e.toValue():e;var n}const It=t=>(n,i)=>{const o=e.useContext(a),s=e.useContext(u),r=()=>function({scrapeMotionValuesFromProps:t,createRenderState:e,onMount:n},i,o,s){const r={latestValues:jt(i,o,s,t),renderState:e()};return n&&(r.mount=t=>n(i,t,r)),r}(t,n,o,s);return i?r():T(r)};function jt(t,e,n,i){const o={},s=i(t,{});for(const t in s)o[t]=Ot(s[t]);let{initial:r,animate:a}=t;const c=y(t),u=v(t);e&&u&&!c&&!1!==t.inherit&&(void 0===r&&(r=e.initial),void 0===a&&(a=e.animate));let l=!!n&&!1===n.initial;l=l||!1===r;const h=l?a:r;if(h&&"boolean"!=typeof h&&!f(h)){(Array.isArray(h)?h:[h]).forEach(e=>{const n=Bt(t,e);if(!n)return;const{transitionEnd:i,transition:s,...r}=n;for(const t in r){let e=r[t];if(Array.isArray(e)){e=e[l?e.length-1:0]}null!==e&&(o[t]=e)}for(const t in i)o[t]=i[t]})}return o}const Ut={useVisualState:It({scrapeMotionValuesFromProps:Dt,createRenderState:Tt,onMount:(t,e,{renderState:n,latestValues:i})=>{try{n.dimensions="function"==typeof e.getBBox?e.getBBox():e.getBoundingClientRect()}catch(t){n.dimensions={x:0,y:0,width:0,height:0}}wt(n,i,{enableHardwareAcceleration:!1},At(e.tagName),t.transformTemplate),Rt(e,n)}})},Nt={useVisualState:It({scrapeMotionValuesFromProps:kt,createRenderState:ht})};function zt(t,{forwardMotionProps:e=!1},n,i){return{...B(t)?Ut:Nt,preloadedFeatures:n,useRender:Ct(e),createVisualElement:i,Component:t}}function Wt(t,e,n,i={passive:!0}){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n)}const Ht=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary;function $t(t,e="page"){return{point:{x:t[e+"X"],y:t[e+"Y"]}}}const Yt=t=>e=>Ht(e)&&t(e,$t(e));function Xt(t,e,n,i){return Wt(t,e,Yt(n),i)}var Gt;t.AnimationType=void 0,(Gt=t.AnimationType||(t.AnimationType={})).Animate="animate",Gt.Hover="whileHover",Gt.Tap="whileTap",Gt.Drag="whileDrag",Gt.Focus="whileFocus",Gt.InView="whileInView",Gt.Exit="exit";const qt=(t,e)=>n=>e(t(n)),Zt=(...t)=>t.reduce(qt);function _t(t){let e=null;return()=>{const n=()=>{e=null};return null===e&&(e=t,n)}}const Kt=_t("dragHorizontal"),Jt=_t("dragVertical");function Qt(t){let e=!1;if("y"===t)e=Jt();else if("x"===t)e=Kt();else{const t=Kt(),n=Jt();t&&n?e=()=>{t(),n()}:(t&&t(),n&&n())}return e}function te(){const t=Qt(!0);return!t||(t(),!1)}class ee{constructor(t){this.isMounted=!1,this.node=t}update(){}}function ne(e,n){const i="pointer"+(n?"enter":"leave"),o="onHover"+(n?"Start":"End");return Xt(e.current,i,(i,s)=>{if("touch"===i.type||te())return;const r=e.getProps();e.animationState&&r.whileHover&&e.animationState.setActive(t.AnimationType.Hover,n),r[o]&&r[o](i,s)},{passive:!e.getProps()[o]})}const ie=(t,e)=>!!e&&(t===e||ie(t,e.parentElement)),oe=t=>t;function se(t,e){if(!e)return;const n=new PointerEvent("pointer"+t);e(n,$t(n))}const re=new WeakMap,ae=new WeakMap,ce=t=>{const e=re.get(t.target);e&&e(t)},ue=t=>{t.forEach(ce)};function le(t,e,n){const i=function({root:t,...e}){const n=t||document;ae.has(n)||ae.set(n,{});const i=ae.get(n),o=JSON.stringify(e);return i[o]||(i[o]=new IntersectionObserver(ue,{root:t,...e})),i[o]}(e);return re.set(t,n),i.observe(t),()=>{re.delete(t),i.unobserve(t)}}const he={some:0,all:1};const de={inView:{Feature:class extends ee{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}viewportFallback(){requestAnimationFrame(()=>{this.hasEnteredView=!0;const{onViewportEnter:e}=this.node.getProps();e&&e(null),this.node.animationState&&this.node.animationState.setActive(t.AnimationType.InView,!0)})}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:n,margin:i,amount:o="some",once:s,fallback:r=!0}=e;if("undefined"==typeof IntersectionObserver)return void(r&&this.viewportFallback());const a={root:n?n.current:void 0,rootMargin:i,threshold:"number"==typeof o?o:he[o]};return le(this.node.current,a,e=>{const{isIntersecting:n}=e;if(this.isInView===n)return;if(this.isInView=n,s&&!n&&this.hasEnteredView)return;n&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive(t.AnimationType.InView,n);const{onViewportEnter:i,onViewportLeave:o}=this.node.getProps(),r=n?i:o;r&&r(e)})}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;const{props:t,prevProps:e}=this.node;["amount","margin","root"].some(function({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}(t,e))&&this.startObserver()}unmount(){}}},tap:{Feature:class extends ee{constructor(){super(...arguments),this.removeStartListeners=oe,this.removeEndListeners=oe,this.removeAccessibleListeners=oe,this.startPointerPress=(t,e)=>{if(this.removeEndListeners(),this.isPressing)return;const n=this.node.getProps(),i=Xt(window,"pointerup",(t,e)=>{if(!this.checkPressEnd())return;const{onTap:n,onTapCancel:i}=this.node.getProps();ie(this.node.current,t.target)?n&&n(t,e):i&&i(t,e)},{passive:!(n.onTap||n.onPointerUp)}),o=Xt(window,"pointercancel",(t,e)=>this.cancelPress(t,e),{passive:!(n.onTapCancel||n.onPointerCancel)});this.removeEndListeners=Zt(i,o),this.startPress(t,e)},this.startAccessiblePress=()=>{const t=Wt(this.node.current,"keydown",t=>{if("Enter"!==t.key||this.isPressing)return;this.removeEndListeners(),this.removeEndListeners=Wt(this.node.current,"keyup",t=>{"Enter"===t.key&&this.checkPressEnd()&&se("up",this.node.getProps().onTap)}),se("down",(t,e)=>{this.startPress(t,e)})}),e=Wt(this.node.current,"blur",()=>{this.isPressing&&se("cancel",(t,e)=>this.cancelPress(t,e))});this.removeAccessibleListeners=Zt(t,e)}}startPress(e,n){this.isPressing=!0;const{onTapStart:i,whileTap:o}=this.node.getProps();o&&this.node.animationState&&this.node.animationState.setActive(t.AnimationType.Tap,!0),i&&i(e,n)}checkPressEnd(){this.removeEndListeners(),this.isPressing=!1;return this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive(t.AnimationType.Tap,!1),!te()}cancelPress(t,e){if(!this.checkPressEnd())return;const{onTapCancel:n}=this.node.getProps();n&&n(t,e)}mount(){const t=this.node.getProps(),e=Xt(this.node.current,"pointerdown",this.startPointerPress,{passive:!(t.onTapStart||t.onPointerStart)}),n=Wt(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=Zt(e,n)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}},focus:{Feature:class extends ee{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch(t){e=!0}e&&this.node.animationState&&(this.node.animationState.setActive(t.AnimationType.Focus,!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive(t.AnimationType.Focus,!1),this.isActive=!1)}mount(){this.unmount=Zt(Wt(this.node.current,"focus",()=>this.onFocus()),Wt(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends ee{mount(){this.unmount=Zt(ne(this.node,!0),ne(this.node,!1))}unmount(){}}}};function pe(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let i=0;i<n;i++)if(e[i]!==t[i])return!1;return!0}const me=t=>/^0[^.\s]+$/.test(t),fe={delta:0,timestamp:0},ge="undefined"!=typeof performance?()=>performance.now():()=>Date.now(),ye="undefined"!=typeof window?t=>window.requestAnimationFrame(t):t=>setTimeout(()=>t(ge()),1/60*1e3);let ve=!0,xe=!1,Pe=!1;const Ee=["read","update","preRender","render","postRender"],be=Ee.reduce((t,e)=>(t[e]=function(t){let e=[],n=[],i=0,o=!1,s=!1;const r=new WeakSet,a={schedule:(t,s=!1,a=!1)=>{const c=a&&o,u=c?e:n;return s&&r.add(t),-1===u.indexOf(t)&&(u.push(t),c&&o&&(i=e.length)),t},cancel:t=>{const e=n.indexOf(t);-1!==e&&n.splice(e,1),r.delete(t)},process:c=>{if(o)s=!0;else{if(o=!0,[e,n]=[n,e],n.length=0,i=e.length,i)for(let n=0;n<i;n++){const i=e[n];i(c),r.has(i)&&(a.schedule(i),t())}o=!1,s&&(s=!1,a.process(c))}}};return a}(()=>xe=!0),t),{}),we=Ee.reduce((t,e)=>{const n=be[e];return t[e]=(t,e=!1,i=!1)=>(xe||Ve(),n.schedule(t,e,i)),t},{}),Te=Ee.reduce((t,e)=>(t[e]=be[e].cancel,t),{}),Ae=Ee.reduce((t,e)=>(t[e]=()=>be[e].process(fe),t),{}),Se=t=>be[t].process(fe),Ce=t=>{xe=!1,fe.delta=ve?1/60*1e3:Math.max(Math.min(t-fe.timestamp,40),1),fe.timestamp=t,Pe=!0,Ee.forEach(Se),Pe=!1,xe&&(ve=!1,ye(Ce))},Ve=()=>{xe=!0,ve=!0,Pe||ye(Ce)};function Me(t,e){-1===t.indexOf(e)&&t.push(e)}function Le(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class Re{constructor(){this.subscriptions=[]}add(t){return Me(this.subscriptions,t),()=>Le(this.subscriptions,t)}notify(t,e,n){const i=this.subscriptions.length;if(i)if(1===i)this.subscriptions[0](t,e,n);else for(let o=0;o<i;o++){const i=this.subscriptions[o];i&&i(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function ke(t,e){return e?t*(1e3/e):0}class De{constructor(t,e={}){var n;this.version="9.0.4",this.timeDelta=0,this.lastUpdated=0,this.canTrackVelocity=!1,this.events={},this.updateAndNotify=(t,e=!0)=>{this.prev=this.current,this.current=t;const{delta:n,timestamp:i}=fe;this.lastUpdated!==i&&(this.timeDelta=n,this.lastUpdated=i,we.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.events.change&&this.events.change.notify(this.current),this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()),e&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.scheduleVelocityCheck=()=>we.postRender(this.velocityCheck),this.velocityCheck=({timestamp:t})=>{t!==this.lastUpdated&&(this.prev=this.current,this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=(n=this.current,!isNaN(parseFloat(n))),this.owner=e.owner}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new Re);const n=this.events[t].add(e);return"change"===t?()=>{n(),we.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t,e=!0){e&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,e)}setWithVelocity(t,e,n){this.set(e),this.prev=t,this.timeDelta=n}jump(t){this.updateAndNotify(t),this.prev=t,this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?ke(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e)||null,this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){this.animation=null}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Be(t,e){return new De(t,e)}const Fe=(t,e)=>n=>Boolean(tt(n)&&Q.test(n)&&n.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(n,e)),Oe=(t,e,n)=>i=>{if(!tt(i))return i;const[o,s,r,a]=i.match(K);return{[t]:parseFloat(o),[e]:parseFloat(s),[n]:parseFloat(r),alpha:void 0!==a?parseFloat(a):1}},Ie={...G,transform:t=>Math.round((t=>X(0,255,t))(t))},je={test:Fe("rgb","red"),parse:Oe("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:i=1})=>"rgba("+Ie.transform(t)+", "+Ie.transform(e)+", "+Ie.transform(n)+", "+_(q.transform(i))+")"};const Ue={test:Fe("#"),parse:function(t){let e="",n="",i="",o="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),i=t.substring(5,7),o=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),i=t.substring(3,4),o=t.substring(4,5),e+=e,n+=n,i+=i,o+=o),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:o?parseInt(o,16)/255:1}},transform:je.transform},Ne={test:Fe("hsl","hue"),parse:Oe("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:i=1})=>"hsla("+Math.round(t)+", "+it.transform(_(e))+", "+it.transform(_(n))+", "+_(q.transform(i))+")"},ze={test:t=>je.test(t)||Ue.test(t)||Ne.test(t),parse:t=>je.test(t)?je.parse(t):Ne.test(t)?Ne.parse(t):Ue.parse(t),transform:t=>tt(t)?t:t.hasOwnProperty("red")?je.transform(t):Ne.transform(t)};function We(t){"number"==typeof t&&(t=""+t);const e=[];let n=0,i=0;const o=t.match(J);o&&(n=o.length,t=t.replace(J,"${c}"),e.push(...o.map(ze.parse)));const s=t.match(K);return s&&(i=s.length,t=t.replace(K,"${n}"),e.push(...s.map(G.parse))),{values:e,numColors:n,numNumbers:i,tokenised:t}}function He(t){return We(t).values}function $e(t){const{values:e,numColors:n,tokenised:i}=We(t),o=e.length;return t=>{let e=i;for(let i=0;i<o;i++)e=e.replace(i<n?"${c}":"${n}",i<n?ze.transform(t[i]):_(t[i]));return e}}const Ye=t=>"number"==typeof t?0:t;const Xe={test:function(t){var e,n;return isNaN(t)&&tt(t)&&((null===(e=t.match(K))||void 0===e?void 0:e.length)||0)+((null===(n=t.match(J))||void 0===n?void 0:n.length)||0)>0},parse:He,createTransformer:$e,getAnimatableNone:function(t){const e=He(t);return $e(t)(e.map(Ye))}},Ge=new Set(["brightness","contrast","saturate","opacity"]);function qe(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[i]=n.match(K)||[];if(!i)return t;const o=n.replace(i,"");let s=Ge.has(e)?1:0;return i!==n&&(s*=100),e+"("+s+o+")"}const Ze=/([a-z-]*)\(.*?\)/g,_e={...Xe,getAnimatableNone:t=>{const e=t.match(Ze);return e?e.map(qe).join(" "):t}},Ke={...ut,color:ze,backgroundColor:ze,outlineColor:ze,fill:ze,stroke:ze,borderColor:ze,borderTopColor:ze,borderRightColor:ze,borderBottomColor:ze,borderLeftColor:ze,filter:_e,WebkitFilter:_e},Je=t=>Ke[t];function Qe(t,e){let n=Je(t);return n!==_e&&(n=Xe),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const tn=t=>e=>e.test(t),en=[G,ot,it,nt,rt,st,{test:t=>"auto"===t,parse:t=>t}],nn=t=>en.find(tn(t)),on=[...en,ze,Xe],sn=t=>on.find(tn(t));function rn(t,e,n){const i=t.getProps();return Bt(i,e,void 0!==n?n:i.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 an(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Be(n))}function cn(t,e){const n=rn(t,e);let{transitionEnd:i={},transition:o={},...s}=n?t.makeTargetAnimatable(n,!1):{};s={...s,...i};for(const e in s){an(t,e,(r=s[e],Ft(r)?r[r.length-1]||0:r))}var r}function un(t,e){[...e].reverse().forEach(n=>{const i=t.getVariant(n);i&&cn(t,i),t.variantChildren&&t.variantChildren.forEach(t=>{un(t,e)})})}function ln(t,e,n){var i,o;const s=Object.keys(e).filter(e=>!t.hasValue(e)),r=s.length;if(r)for(let a=0;a<r;a++){const r=s[a],c=e[r];let u=null;Array.isArray(c)&&(u=c[0]),null===u&&(u=null!==(o=null!==(i=n[r])&&void 0!==i?i:t.readValue(r))&&void 0!==o?o:e[r]),null!=u&&("string"==typeof u&&(/^\-?\d*\.?\d+$/.test(u)||me(u))?u=parseFloat(u):!sn(u)&&Xe.test(c)&&(u=Qe(r,c)),t.addValue(r,Be(u,{owner:t})),void 0===n[r]&&(n[r]=u),null!==u&&t.setBaseTarget(r,u))}}function hn(t,e){if(!e)return;return(e[t]||e.default||e).from}function dn(t,e,n){const i={};for(const o in t){const t=hn(o,e);if(void 0!==t)i[o]=t;else{const t=n.getValue(o);t&&(i[o]=t.get())}}return i}function pn(t){return Boolean(N(t)&&t.add)}const mn="data-"+Vt("framerAppearId");const fn=t=>1e3*t,gn={current:!1},yn=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,vn=t=>e=>1-t(1-e),xn=t=>t*t,Pn=vn(xn),En=yn(xn),bn=(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 Tn=(t,e,n)=>{const i=t*t;return Math.sqrt(Math.max(0,n*(e*e-i)+i))},An=[Ue,je,Ne];function Sn(t){const e=(n=t,An.find(t=>t.test(n)));var n;let i=e.parse(t);return e===Ne&&(i=function({hue:t,saturation:e,lightness:n,alpha:i}){t/=360,n/=100;let o=0,s=0,r=0;if(e/=100){const i=n<.5?n*(1+e):n+e-n*e,a=2*n-i;o=wn(a,i,t+1/3),s=wn(a,i,t),r=wn(a,i,t-1/3)}else o=s=r=n;return{red:Math.round(255*o),green:Math.round(255*s),blue:Math.round(255*r),alpha:i}}(i)),i}const Cn=(t,e)=>{const n=Sn(t),i=Sn(e),o={...n};return t=>(o.red=Tn(n.red,i.red,t),o.green=Tn(n.green,i.green,t),o.blue=Tn(n.blue,i.blue,t),o.alpha=bn(n.alpha,i.alpha,t),je.transform(o))};function Vn(t,e){return"number"==typeof t?n=>bn(t,e,n):ze.test(t)?Cn(t,e):Rn(t,e)}const Mn=(t,e)=>{const n=[...t],i=n.length,o=t.map((t,n)=>Vn(t,e[n]));return t=>{for(let e=0;e<i;e++)n[e]=o[e](t);return n}},Ln=(t,e)=>{const n={...t,...e},i={};for(const o in n)void 0!==t[o]&&void 0!==e[o]&&(i[o]=Vn(t[o],e[o]));return t=>{for(const e in i)n[e]=i[e](t);return n}},Rn=(t,e)=>{const n=Xe.createTransformer(e),i=We(t),o=We(e);return i.numColors===o.numColors&&i.numNumbers>=o.numNumbers?Zt(Mn(i.values,o.values),n):n=>""+(n>0?e:t)},kn=(t,e,n)=>{const i=e-t;return 0===i?1:(n-t)/i},Dn=(t,e)=>n=>bn(t,e,n);function Bn(t,e,n){const i=[],o=n||("number"==typeof(s=t[0])?Dn:"string"==typeof s?ze.test(s)?Cn:Rn:Array.isArray(s)?Mn:"object"==typeof s?Ln:Dn);var s;const r=t.length-1;for(let n=0;n<r;n++){let s=o(t[n],t[n+1]);if(e){const t=Array.isArray(e)?e[n]:e;s=Zt(t,s)}i.push(s)}return i}function Fn(t,e,{clamp:n=!0,ease:i,mixer:o}={}){const s=t.length;e.length,!i||!Array.isArray(i)||i.length,t[0]>t[s-1]&&(t=[...t].reverse(),e=[...e].reverse());const r=Bn(e,i,o),a=r.length,c=e=>{let n=0;if(a>1)for(;n<t.length-2&&!(e<t[n+1]);n++);const i=kn(t[n],t[n+1],e);return r[n](i)};return n?e=>c(X(t[0],t[s-1],e)):c}const On=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function In(t,e,n,i){if(t===e&&n===i)return oe;const o=e=>function(t,e,n,i,o){let s,r,a=0;do{r=e+(n-e)/2,s=On(r,i,o)-t,s>0?n=r:e=r}while(Math.abs(s)>1e-7&&++a<12);return r}(e,0,1,t,n);return t=>0===t||1===t?t:On(o(t),e,i)}const jn=t=>1-Math.sin(Math.acos(t)),Un=vn(jn),Nn=yn(Un),zn=In(.33,1.53,.69,.99),Wn=vn(zn),Hn=yn(Wn),$n=t=>(t*=2)<1?.5*Wn(t):.5*(2-Math.pow(2,-10*(t-1))),Yn={linear:oe,easeIn:xn,easeInOut:En,easeOut:Pn,circIn:jn,circInOut:Nn,circOut:Un,backIn:Wn,backInOut:Hn,backOut:zn,anticipate:$n},Xn=t=>{if(Array.isArray(t)){t.length;const[e,n,i,o]=t;return In(e,n,i,o)}return"string"==typeof t?Yn[t]:t};function Gn({keyframes:t,ease:e=En,times:n,duration:i=300}){t=[...t];const o=(t=>Array.isArray(t)&&"number"!=typeof t[0])(e)?e.map(Xn):Xn(e),s={done:!1,value:t[0]},r=function(t,e){return t.map(t=>t*e)}(n&&n.length===t.length?n:function(t){const e=t.length;return t.map((t,n)=>0!==n?n/(e-1):0)}(t),i);function a(){return Fn(r,t,{ease:Array.isArray(o)?o:(e=t,n=o,e.map(()=>n||En).splice(0,e.length-1))});var e,n}let c=a();return{next:t=>(s.value=c(t),s.done=t>=i,s),flipTarget:()=>{t.reverse(),c=a()}}}function qn({duration:t=800,bounce:e=.25,velocity:n=0,mass:i=1}){let o,s,r=1-e;r=X(.05,1,r),t=X(.01,10,t/1e3),r<1?(o=e=>{const i=e*r,o=i*t;return.001-(i-n)/Zn(e,r)*Math.exp(-o)},s=e=>{const i=e*r*t,s=i*n+n,a=Math.pow(r,2)*Math.pow(e,2)*t,c=Math.exp(-i),u=Zn(Math.pow(e,2),r);return(.001-o(e)>0?-1:1)*((s-a)*c)/u}):(o=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,s=e=>Math.exp(-e*t)*(t*t*(n-e)));const a=function(t,e,n){let i=n;for(let n=1;n<12;n++)i-=t(i)/e(i);return i}(o,s,5/t);if(t*=1e3,isNaN(a))return{stiffness:100,damping:10,duration:t};{const e=Math.pow(a,2)*i;return{stiffness:e,damping:2*r*Math.sqrt(i*e),duration:t}}}function Zn(t,e){return t*Math.sqrt(1-e*e)}const _n=["duration","bounce"],Kn=["stiffness","damping","mass"];function Jn(t,e){return e.some(e=>void 0!==t[e])}function Qn({keyframes:t,restDelta:e,restSpeed:n,...i}){let o=t[0],s=t[t.length-1];const r={done:!1,value:o},{stiffness:a,damping:c,mass:u,velocity:l,duration:h,isResolvedFromDuration:d}=function(t){let e={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...t};if(!Jn(t,Kn)&&Jn(t,_n)){const n=qn(t);e={...e,...n,velocity:0,mass:1},e.isResolvedFromDuration=!0}return e}(i);let p=ti,m=l?-l/1e3:0;const f=c/(2*Math.sqrt(a*u));function g(){const t=s-o,i=Math.sqrt(a/u)/1e3,r=Math.abs(t)<5;if(n||(n=r?.01:2),e||(e=r?.005:.5),f<1){const e=Zn(i,f);p=n=>{const o=Math.exp(-f*i*n);return s-o*((m+f*i*t)/e*Math.sin(e*n)+t*Math.cos(e*n))}}else if(1===f)p=e=>s-Math.exp(-i*e)*(t+(m+i*t)*e);else{const e=i*Math.sqrt(f*f-1);p=n=>{const o=Math.exp(-f*i*n),r=Math.min(e*n,300);return s-o*((m+f*i*t)*Math.sinh(r)+e*t*Math.cosh(r))/e}}}return g(),{next:t=>{const i=p(t);if(d)r.done=t>=h;else{let o=m;if(0!==t)if(f<1){const e=Math.max(0,t-5);o=ke(i-p(e),t-e)}else o=0;const a=Math.abs(o)<=n,c=Math.abs(s-i)<=e;r.done=a&&c}return r.value=r.done?s:i,r},flipTarget:()=>{m=-m,[o,s]=[s,o],g()}}}Qn.needsInterpolation=(t,e)=>"string"==typeof t||"string"==typeof e;const ti=t=>0;const ei={decay:function({keyframes:t=[0],velocity:e=0,power:n=.8,timeConstant:i=350,restDelta:o=.5,modifyTarget:s}){const r=t[0],a={done:!1,value:r};let c=n*e;const u=r+c,l=void 0===s?u:s(u);return l!==u&&(c=l-r),{next:t=>{const e=-c*Math.exp(-t/i);return a.done=!(e>o||e<-o),a.value=a.done?l:l+e,a},flipTarget:()=>{}}},keyframes:Gn,tween:Gn,spring:Qn};function ni(t,e,n=0){return t-e-n}const ii=t=>{const e=({delta:e})=>t(e);return{start:()=>we.update(e,!0),stop:()=>Te.update(e)}};function oi({duration:t,driver:e=ii,elapsed:n=0,repeat:i=0,repeatType:o="loop",repeatDelay:s=0,keyframes:r,autoplay:a=!0,onPlay:c,onStop:u,onComplete:l,onRepeat:h,onUpdate:d,type:p="keyframes",...m}){const f=n;let g,y,v=0,x=t,P=!1,E=!0;const b=ei[r.length>2?"keyframes":p]||Gn,w=r[0],T=r[r.length-1];let A={done:!1,value:w};const{needsInterpolation:S}=b;S&&S(w,T)&&(y=Fn([0,100],[w,T],{clamp:!1}),r=[0,100]);const C=b({...m,duration:t,keyframes:r});function V(){v++,"reverse"===o?(E=v%2==0,n=function(t,e=0,n=0,i=!0){return i?ni(e+-t,e,n):e-(t-e)+n}(n,x,s,E)):(n=ni(n,x,s),"mirror"===o&&C.flipTarget()),P=!1,h&&h()}function M(t){E||(t=-t),n+=t,P||(A=C.next(Math.max(0,n)),y&&(A.value=y(A.value)),P=E?A.done:n<=0),d&&d(A.value),P&&(0===v&&(x=void 0!==x?x:n),v<i?function(t,e,n,i){return i?t>=e+n:t<=-n}(n,x,s,E)&&V():(g&&g.stop(),l&&l()))}return a&&(c&&c(),g=e(M),g.start()),{stop:()=>{u&&u(),g&&g.stop()},set currentTime(t){n=f,M(t)},sample:e=>{n=f;const i=t&&"number"==typeof t?Math.max(.5*t,50):50;let o=0;for(M(0);o<=e;){const t=e-o;M(Math.min(t,i)),o+=i}return A}}}const si=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,ri={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:si([0,.65,.55,1]),circOut:si([.55,0,1,.45]),backIn:si([.31,.01,.66,-.59]),backOut:si([.33,1.53,.69,.99])};function ai(t){if(t)return Array.isArray(t)?si(t):ri[t]}function ci(t,e,n,{delay:i=0,duration:o,repeat:s=0,repeatType:r="loop",ease:a,times:c}={}){return t.animate({[e]:n,offset:c},{delay:i,duration:o,easing:ai(a),fill:"both",iterations:s+1,direction:"reverse"===r?"alternate":"normal"})}const ui={waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate")},li={},hi={};for(const t in ui)hi[t]=()=>(void 0===li[t]&&(li[t]=ui[t]()),li[t]);const di=new Set(["opacity"]);function pi(t,e,{onUpdate:n,onComplete:i,...o}){if(!(hi.waapi()&&di.has(e)&&!o.repeatDelay&&"mirror"!==o.repeatType&&0!==o.damping))return!1;let{keyframes:s,duration:r=300,elapsed:a=0,ease:c}=o;if("spring"===o.type||!(!(u=o.ease)||Array.isArray(u)||"string"==typeof u&&ri[u])){if(o.repeat===1/0)return;const t=oi({...o,elapsed:0});let e={done:!1,value:s[0]};const n=[];let i=0;for(;!e.done&&i<2e4;)e=t.sample(i),n.push(e.value),i+=10;s=n,r=i-10,c="linear"}var u;const l=ci(t.owner.current,e,s,{...o,delay:-a,duration:r,ease:c});return l.onfinish=()=>{t.set(function(t,{repeat:e,repeatType:n="loop"}){return t[e&&"loop"!==n&&e%2==1?0:t.length-1]}(s,o)),we.update(()=>l.cancel()),i&&i()},{get currentTime(){return l.currentTime||0},set currentTime(t){l.currentTime=t},stop:()=>{const{currentTime:e}=l;if(e){const n=oi({...o,autoplay:!1});t.setWithVelocity(n.sample(e-10).value,n.sample(e).value,10)}we.update(()=>l.cancel())}}}function mi(t,e){const n=performance.now(),i=({timestamp:o})=>{const s=o-n;s>=e&&(Te.read(i),t(s-e))};return we.read(i,!0),()=>Te.read(i)}function fi({keyframes:t,elapsed:e,onUpdate:n,onComplete:i}){const o=()=>{n&&n(t[t.length-1]),i&&i()};return e?{stop:mi(o,-e)}:o()}const gi=()=>({type:"spring",stiffness:500,damping:25,restSpeed:10}),yi=t=>({type:"spring",stiffness:550,damping:0===t?2*Math.sqrt(550):30,restSpeed:10}),vi=()=>({type:"keyframes",ease:"linear",duration:.3}),xi={type:"keyframes",duration:.8},Pi={x:gi,y:gi,z:gi,rotate:gi,rotateX:gi,rotateY:gi,rotateZ:gi,scaleX:yi,scaleY:yi,scale:yi,opacity:vi,backgroundColor:vi,color:vi,default:yi},Ei=(t,{keyframes:e})=>{if(e.length>2)return xi;return(Pi[t]||Pi.default)(e[1])},bi=(t,e)=>"zIndex"!==t&&(!("number"!=typeof e&&!Array.isArray(e))||!("string"!=typeof e||!Xe.test(e)||e.startsWith("url(")));function wi(t){return 0===t||"string"==typeof t&&0===parseFloat(t)&&-1===t.indexOf(" ")}function Ti(t){return"number"==typeof t?0:Qe("",t)}function Ai(t,e){return t[e]||t.default||t}const Si=(t,e,n,i={})=>o=>{const s=Ai(i,t)||{},r=s.delay||i.delay||0;let{elapsed:a=0}=i;a-=fn(r);const c=function(t,e,n,i){const o=bi(e,n);let s=void 0!==i.from?i.from:t.get();return"none"===s&&o&&"string"==typeof n?s=Qe(e,n):wi(s)&&"string"==typeof n?s=Ti(n):!Array.isArray(n)&&wi(n)&&"string"==typeof s&&(n=Ti(s)),Array.isArray(n)?(null===n[0]&&(n[0]=s),n):[s,n]}(e,t,n,s),u=c[0],l=c[c.length-1],h=bi(t,u),d=bi(t,l);let p={keyframes:c,velocity:e.getVelocity(),...s,elapsed:a,onUpdate:t=>{e.set(t),s.onUpdate&&s.onUpdate(t)},onComplete:()=>{o(),s.onComplete&&s.onComplete()}};if(!h||!d||gn.current||!1===s.type)return fi(p);if("inertia"===s.type)return function({keyframes:t,velocity:e=0,min:n,max:i,power:o=.8,timeConstant:s=750,bounceStiffness:r=500,bounceDamping:a=10,restDelta:c=1,modifyTarget:u,driver:l,onUpdate:h,onComplete:d,onStop:p}){const m=t[0];let f;function g(t){return void 0!==n&&t<n||void 0!==i&&t>i}function y(t){return void 0===n?i:void 0===i||Math.abs(n-t)<Math.abs(i-t)?n:i}function v(t){f&&f.stop(),f=oi({keyframes:[0,1],velocity:0,...t,driver:l,onUpdate:e=>{h&&h(e),t.onUpdate&&t.onUpdate(e)},onComplete:d,onStop:p})}function x(t){v({type:"spring",stiffness:r,damping:a,restDelta:c,...t})}if(g(m))x({velocity:e,keyframes:[m,y(m)]});else{let t=o*e+m;void 0!==u&&(t=u(t));const i=y(t),r=i===n?-1:1;let a,l;const h=t=>{a=l,l=t,e=ke(t-a,fe.delta),(1===r&&t>i||-1===r&&t<i)&&x({keyframes:[t,i],velocity:e})};v({type:"decay",keyframes:[m,0],velocity:e,timeConstant:s,power:o,restDelta:c,modifyTarget:u,onUpdate:g(t)?h:void 0})}return{stop:()=>f&&f.stop()}}(p);if(function({when:t,delay:e,delayChildren:n,staggerChildren:i,staggerDirection:o,repeat:s,repeatType:r,repeatDelay:a,from:c,elapsed:u,...l}){return!!Object.keys(l).length}(s)||(p={...p,...Ei(t,p)}),p.duration&&(p.duration=fn(p.duration)),p.repeatDelay&&(p.repeatDelay=fn(p.repeatDelay)),e.owner&&e.owner.current instanceof HTMLElement&&!e.owner.getProps().onUpdate){const n=pi(e,t,p);if(n)return n}return oi(p)};function Ci(t,e,n={}){let i;if(t.notify("AnimationStart",e),Array.isArray(e)){const o=e.map(e=>Vi(t,e,n));i=Promise.all(o)}else if("string"==typeof e)i=Vi(t,e,n);else{const o="function"==typeof e?rn(t,e,n.custom):e;i=Mi(t,o,n)}return i.then(()=>t.notify("AnimationComplete",e))}function Vi(t,e,n={}){const i=rn(t,e,n.custom);let{transition:o=t.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(o=n.transitionOverride);const s=i?()=>Mi(t,i,n):()=>Promise.resolve(),r=t.variantChildren&&t.variantChildren.size?(i=0)=>{const{delayChildren:s=0,staggerChildren:r,staggerDirection:a}=o;return function(t,e,n=0,i=0,o=1,s){const r=[],a=(t.variantChildren.size-1)*i,c=1===o?(t=0)=>t*i:(t=0)=>a-t*i;return Array.from(t.variantChildren).sort(Li).forEach((t,i)=>{t.notify("AnimationStart",e),r.push(Vi(t,e,{...s,delay:n+c(i)}).then(()=>t.notify("AnimationComplete",e)))}),Promise.all(r)}(t,e,s+i,r,a,n)}:()=>Promise.resolve(),{when:a}=o;if(a){const[t,e]="beforeChildren"===a?[s,r]:[r,s];return t().then(e)}return Promise.all([s(),r(n.delay)])}function Mi(t,e,{delay:n=0,transitionOverride:i,type:o}={}){let{transition:s=t.getDefaultTransition(),transitionEnd:r,...a}=t.makeTargetAnimatable(e);const c=t.getValue("willChange");i&&(s=i);const u=[],l=o&&t.animationState&&t.animationState.getState()[o];for(const e in a){const i=t.getValue(e),o=a[e];if(!i||void 0===o||l&&Ri(l,e))continue;const r={delay:n,elapsed:0,...s};if(window.HandoffAppearAnimations&&!i.hasAnimated){const n=t.getProps()[mn];n&&(r.elapsed=window.HandoffAppearAnimations(n,e,i,we))}let h=i.start(Si(e,i,o,t.shouldReduceMotion&&j.has(e)?{type:!1}:r));pn(c)&&(c.add(e),h=h.then(()=>c.remove(e))),u.push(h)}return Promise.all(u).then(()=>{r&&cn(t,r)})}function Li(t,e){return t.sortNodePosition(e)}function Ri({protectedKeys:t,needsAnimating:e},n){const i=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,i}const ki=[t.AnimationType.Animate,t.AnimationType.InView,t.AnimationType.Focus,t.AnimationType.Hover,t.AnimationType.Tap,t.AnimationType.Drag,t.AnimationType.Exit],Di=[...ki].reverse(),Bi=ki.length;function Fi(e){let n=function(t){return e=>Promise.all(e.map(({animation:e,options:n})=>Ci(t,e,n)))}(e);const i={[t.AnimationType.Animate]:Ii(!0),[t.AnimationType.InView]:Ii(),[t.AnimationType.Hover]:Ii(),[t.AnimationType.Tap]:Ii(),[t.AnimationType.Drag]:Ii(),[t.AnimationType.Focus]:Ii(),[t.AnimationType.Exit]:Ii()};let o=!0;const s=(t,n)=>{const i=rn(e,n);if(i){const{transition:e,transitionEnd:n,...o}=i;t={...t,...o,...n}}return t};function r(t,r){const a=e.getProps(),c=e.getVariantContext(!0)||{},u=[],l=new Set;let h={},d=1/0;for(let n=0;n<Bi;n++){const p=Di[n],g=i[p],y=void 0!==a[p]?a[p]:c[p],v=m(y),x=p===r?g.isActive:null;!1===x&&(d=n);let P=y===c[p]&&y!==a[p]&&v;if(P&&o&&e.manuallyAnimateOnMount&&(P=!1),g.protectedKeys={...h},!g.isActive&&null===x||!y&&!g.prevProp||f(y)||"boolean"==typeof y)continue;const E=Oi(g.prevProp,y);let b=E||p===r&&g.isActive&&!P&&v||n>d&&v;const w=Array.isArray(y)?y:[y];let T=w.reduce(s,{});!1===x&&(T={});const{prevResolvedValues:A={}}=g,S={...A,...T},C=t=>{b=!0,l.delete(t),g.needsAnimating[t]=!0};for(const t in S){const e=T[t],n=A[t];h.hasOwnProperty(t)||(e!==n?Ft(e)&&Ft(n)?!pe(e,n)||E?C(t):g.protectedKeys[t]=!0:void 0!==e?C(t):l.add(t):void 0!==e&&l.has(t)?C(t):g.protectedKeys[t]=!0)}g.prevProp=y,g.prevResolvedValues=T,g.isActive&&(h={...h,...T}),o&&e.blockInitialAnimation&&(b=!1),b&&!P&&u.push(...w.map(e=>({animation:e,options:{type:p,...t}})))}if(l.size){const t={};l.forEach(n=>{const i=e.getBaseTarget(n);void 0!==i&&(t[n]=i)}),u.push({animation:t})}let p=Boolean(u.length);return o&&!1===a.initial&&!e.manuallyAnimateOnMount&&(p=!1),o=!1,p?n(u):Promise.resolve()}return{animateChanges:r,setActive:function(t,n,o){if(i[t].isActive===n)return Promise.resolve();e.variantChildren&&e.variantChildren.forEach(e=>{e.animationState&&e.animationState.setActive(t,n)}),i[t].isActive=n;const s=r(o,t);for(const t in i)i[t].protectedKeys={};return s},setAnimateFunction:function(t){n=t(e)},getState:()=>i}}function Oi(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!pe(e,t)}function Ii(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}let ji=0;const Ui={animation:{Feature:class extends ee{constructor(t){super(t),t.animationState||(t.animationState=Fi(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();this.unmount(),f(t)&&(this.unmount=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:e}=this.node.prevProps||{};t!==e&&this.updateAnimationControlsSubscription()}unmount(){}}},exit:{Feature:class extends ee{constructor(){super(...arguments),this.id=ji++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n,custom:i}=this.node.presenceContext,{isPresent:o}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===o)return;const s=this.node.animationState.setActive(t.AnimationType.Exit,!e,{custom:null!=i?i:this.node.getProps().custom});n&&!e&&s.then(()=>n(this.id))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}}},Ni=(t,e)=>Math.abs(t-e);function zi(t,e){const n=Ni(t.x,e.x),i=Ni(t.y,e.y);return Math.sqrt(n**2+i**2)}class Wi{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=Yi(this.lastMoveEventInfo,this.history),e=null!==this.startEvent,n=zi(t.offset,{x:0,y:0})>=3;if(!e&&!n)return;const{point:i}=t,{timestamp:o}=fe;this.history.push({...i,timestamp:o});const{onStart:s,onMove:r}=this.handlers;e||(s&&s(this.lastMoveEvent,t),this.startEvent=this.lastMoveEvent),r&&r(this.lastMoveEvent,t)},this.handlePointerMove=(t,e)=>{this.lastMoveEvent=t,this.lastMoveEventInfo=Hi(e,this.transformPagePoint),we.update(this.updatePoint,!0)},this.handlePointerUp=(t,e)=>{if(this.end(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const{onEnd:n,onSessionEnd:i}=this.handlers,o=Yi("pointercancel"===t.type?this.lastMoveEventInfo:Hi(e,this.transformPagePoint),this.history);this.startEvent&&n&&n(t,o),i&&i(t,o)},!Ht(t))return;this.handlers=e,this.transformPagePoint=n;const i=Hi($t(t),this.transformPagePoint),{point:o}=i,{timestamp:s}=fe;this.history=[{...o,timestamp:s}];const{onSessionStart:r}=e;r&&r(t,Yi(i,this.history)),this.removeListeners=Zt(Xt(window,"pointermove",this.handlePointerMove),Xt(window,"pointerup",this.handlePointerUp),Xt(window,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Te.update(this.updatePoint)}}function Hi(t,e){return e?{point:e(t.point)}:t}function $i(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Yi({point:t},e){return{point:t,delta:$i(t,Gi(e)),offset:$i(t,Xi(e)),velocity:qi(e,.1)}}function Xi(t){return t[0]}function Gi(t){return t[t.length-1]}function qi(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,i=null;const o=Gi(t);for(;n>=0&&(i=t[n],!(o.timestamp-i.timestamp>fn(e)));)n--;if(!i)return{x:0,y:0};const s=(o.timestamp-i.timestamp)/1e3;if(0===s)return{x:0,y:0};const r={x:(o.x-i.x)/s,y:(o.y-i.y)/s};return r.x===1/0&&(r.x=0),r.y===1/0&&(r.y=0),r}function Zi(t){return t.max-t.min}function _i(t,e=0,n=.01){return Math.abs(t-e)<=n}function Ki(t,e,n,i=.5){t.origin=i,t.originPoint=bn(e.min,e.max,t.origin),t.scale=Zi(n)/Zi(e),(_i(t.scale,1,1e-4)||isNaN(t.scale))&&(t.scale=1),t.translate=bn(n.min,n.max,t.origin)-t.originPoint,(_i(t.translate)||isNaN(t.translate))&&(t.translate=0)}function Ji(t,e,n,i){Ki(t.x,e.x,n.x,i?i.originX:void 0),Ki(t.y,e.y,n.y,i?i.originY:void 0)}function Qi(t,e,n){t.min=n.min+e.min,t.max=t.min+Zi(e)}function to(t,e,n){t.min=e.min-n.min,t.max=t.min+Zi(e)}function eo(t,e,n){to(t.x,e.x,n.x),to(t.y,e.y,n.y)}function no(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 io(t,e){let n=e.min-t.min,i=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,i]=[i,n]),{min:n,max:i}}const oo=.35;function so(t,e,n){return{min:ro(t,e),max:ro(t,n)}}function ro(t,e){return"number"==typeof t?t:t[e]||0}const ao=()=>({x:{min:0,max:0},y:{min:0,max:0}});function co(t){return[t("x"),t("y")]}function uo({top:t,left:e,right:n,bottom:i}){return{x:{min:e,max:n},y:{min:t,max:i}}}function lo(t){return void 0===t||1===t}function ho({scale:t,scaleX:e,scaleY:n}){return!lo(t)||!lo(e)||!lo(n)}function po(t){return ho(t)||mo(t)||t.z||t.rotate||t.rotateX||t.rotateY}function mo(t){return fo(t.x)||fo(t.y)}function fo(t){return t&&"0%"!==t}function go(t,e,n){return n+e*(t-n)}function yo(t,e,n,i,o){return void 0!==o&&(t=go(t,o,i)),go(t,n,i)+e}function vo(t,e=0,n=1,i,o){t.min=yo(t.min,e,n,i,o),t.max=yo(t.max,e,n,i,o)}function xo(t,{x:e,y:n}){vo(t.x,e.translate,e.scale,e.originPoint),vo(t.y,n.translate,n.scale,n.originPoint)}function Po(t){return Number.isInteger(t)||t>1.0000000000001||t<.999999999999?t:1}function Eo(t,e){t.min=t.min+e,t.max=t.max+e}function bo(t,e,[n,i,o]){const s=void 0!==e[o]?e[o]:.5,r=bn(t.min,t.max,s);vo(t,e[n],e[i],r,e.scale)}const wo=["x","scaleX","originX"],To=["y","scaleY","originY"];function Ao(t,e){bo(t.x,e,wo),bo(t.y,e,To)}function So(t,e){return uo(function(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),i=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}(t.getBoundingClientRect(),e))}const Co=new WeakMap;class Vo{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}={}){const{presenceContext:i}=this.visualElement;if(i&&!1===i.isPresent)return;this.panSession=new Wi(e,{onSessionStart:t=>{this.stopAnimation(),n&&this.snapToCursor($t(t,"page").point)},onStart:(e,n)=>{const{drag:i,dragPropagation:o,onDragStart:s}=this.getProps();if(i&&!o&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=Qt(i),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),co(t=>{let e=this.getAxisMotionValue(t).get()||0;if(it.test(e)){const{projection:n}=this.visualElement;if(n&&n.layout){const i=n.layout.layoutBox[t];if(i){e=Zi(i)*(parseFloat(e)/100)}}}this.originPoint[t]=e}),s&&s(e,n);const{animationState:r}=this.visualElement;r&&r.setActive(t.AnimationType.Drag,!0)},onMove:(t,e)=>{const{dragPropagation:n,dragDirectionLock:i,onDirectionLock:o,onDrag:s}=this.getProps();if(!n&&!this.openGlobalLock)return;const{offset:r}=e;if(i&&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}(r),void(null!==this.currentDirection&&o&&o(this.currentDirection));this.updateAxis("x",e.point,r),this.updateAxis("y",e.point,r),this.visualElement.render(),s&&s(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:i}=e;this.startAnimation(i);const{onDragEnd:o}=this.getProps();o&&o(t,e)}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:i}=this.getProps();!i&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),n&&n.setActive(t.AnimationType.Drag,!1)}updateAxis(t,e,n){const{drag:i}=this.getProps();if(!n||!Mo(t,i,this.currentDirection))return;const o=this.getAxisMotionValue(t);let s=this.originPoint[t]+n[t];this.constraints&&this.constraints[t]&&(s=function(t,{min:e,max:n},i){return void 0!==e&&t<e?t=i?bn(e,t,i.min):Math.max(t,e):void 0!==n&&t>n&&(t=i?bn(n,t,i.max):Math.min(t,n)),t}(s,this.constraints[t],this.elastic[t])),o.set(s)}resolveConstraints(){const{dragConstraints:t,dragElastic:e}=this.getProps(),{layout:n}=this.visualElement.projection||{},i=this.constraints;t&&p(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!n)&&function(t,{top:e,left:n,bottom:i,right:o}){return{x:no(t.x,n,o),y:no(t.y,e,i)}}(n.layoutBox,t),this.elastic=function(t=oo){return!1===t?t=0:!0===t&&(t=oo),{x:so(t,"left","right"),y:so(t,"top","bottom")}}(e),i!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&co(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:i}=this.visualElement;if(!i||!i.layout)return!1;const o=function(t,e,n){const i=So(t,n),{scroll:o}=e;return o&&(Eo(i.x,o.offset.x),Eo(i.y,o.offset.y)),i}(n,i.root,this.visualElement.getTransformPagePoint());let s=function(t,e){return{x:io(t.x,e.x),y:io(t.y,e.y)}}(i.layout.layoutBox,o);if(e){const t=e(function({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}(s));this.hasMutatedConstraints=!!t,t&&(s=uo(t))}return s}startAnimation(t){const{drag:e,dragMomentum:n,dragElastic:i,dragTransition:o,dragSnapToOrigin:s,onDragTransitionEnd:r}=this.getProps(),a=this.constraints||{},c=co(r=>{if(!Mo(r,e,this.currentDirection))return;let c=a&&a[r]||{};s&&(c={min:0,max:0});const u=i?200:1e6,l=i?40:1e7,h={type:"inertia",velocity:n?t[r]:0,bounceStiffness:u,bounceDamping:l,timeConstant:750,restDelta:1,restSpeed:10,...o,...c};return this.startAxisValueAnimation(r,h)});return Promise.all(c).then(r)}startAxisValueAnimation(t,e){const n=this.getAxisMotionValue(t);return n.start(Si(t,n,0,e))}stopAnimation(){co(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const e="_drag"+t.toUpperCase(),n=this.visualElement.getProps(),i=n[e];return i||this.visualElement.getValue(t,(n.initial?n.initial[t]:void 0)||0)}snapToCursor(t){co(e=>{const{drag:n}=this.getProps();if(!Mo(e,n,this.currentDirection))return;const{projection:i}=this.visualElement,o=this.getAxisMotionValue(e);if(i&&i.layout){const{min:n,max:s}=i.layout.layoutBox[e];o.set(t[e]-bn(n,s,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:e}=this.getProps(),{projection:n}=this.visualElement;if(!p(e)||!n||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};co(t=>{const e=this.getAxisMotionValue(t);if(e){const n=e.get();i[t]=function(t,e){let n=.5;const i=Zi(t),o=Zi(e);return o>i?n=kn(e.min,e.max-i,t.min):i>o&&(n=kn(t.min,t.max-o,e.min)),X(0,1,n)}({min:n,max:n},this.constraints[t])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.resolveConstraints(),co(e=>{if(!Mo(e,t,null))return;const n=this.getAxisMotionValue(e),{min:o,max:s}=this.constraints[e];n.set(bn(o,s,i[e]))})}addListeners(){if(!this.visualElement.current)return;Co.set(this.visualElement,this);const t=Xt(this.visualElement.current,"pointerdown",t=>{const{drag:e,dragListener:n=!0}=this.getProps();e&&n&&this.start(t)}),e=()=>{const{dragConstraints:t}=this.getProps();p(t)&&(this.constraints=this.resolveRefConstraints())},{projection:n}=this.visualElement,i=n.addEventListener("measure",e);n&&!n.layout&&(n.root&&n.root.updateScroll(),n.updateLayout()),e();const o=Wt(window,"resize",()=>this.scalePositionWithinConstraints()),s=n.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e})=>{this.isDragging&&e&&(co(e=>{const n=this.getAxisMotionValue(e);n&&(this.originPoint[e]+=t[e].translate,n.set(n.get()+t[e].translate))}),this.visualElement.render())});return()=>{o(),t(),i(),s&&s()}}getProps(){const t=this.visualElement.getProps(),{drag:e=!1,dragDirectionLock:n=!1,dragPropagation:i=!1,dragConstraints:o=!1,dragElastic:s=oo,dragMomentum:r=!0}=t;return{...t,drag:e,dragDirectionLock:n,dragPropagation:i,dragConstraints:o,dragElastic:s,dragMomentum:r}}}function Mo(t,e,n){return!(!0!==e&&e!==t||null!==n&&n!==t)}function Lo(t,e,n={}){const i=N(t)?t:Be(t);return i.start(Si("",i,e,n)),{stop:()=>i.stop(),isAnimating:()=>i.isAnimating()}}const Ro=["TopLeft","TopRight","BottomLeft","BottomRight"],ko=Ro.length,Do=t=>"string"==typeof t?parseFloat(t):t,Bo=t=>"number"==typeof t||ot.test(t);function Fo(t,e){return void 0!==t[e]?t[e]:t.borderRadius}const Oo=jo(0,.5,Un),Io=jo(.5,.95,oe);function jo(t,e,n){return i=>i<t?0:i>e?1:n(kn(t,e,i))}function Uo(t,e){t.min=e.min,t.max=e.max}function No(t,e){Uo(t.x,e.x),Uo(t.y,e.y)}function zo(t,e,n,i,o){return t=go(t-=e,1/n,i),void 0!==o&&(t=go(t,1/o,i)),t}function Wo(t,e,[n,i,o],s,r){!function(t,e=0,n=1,i=.5,o,s=t,r=t){if(it.test(e)){e=parseFloat(e);e=bn(r.min,r.max,e/100)-r.min}if("number"!=typeof e)return;let a=bn(s.min,s.max,i);t===s&&(a-=e),t.min=zo(t.min,e,n,a,o),t.max=zo(t.max,e,n,a,o)}(t,e[n],e[i],e[o],e.scale,s,r)}const Ho=["x","scaleX","originX"],$o=["y","scaleY","originY"];function Yo(t,e,n,i){Wo(t.x,e,Ho,n?n.x:void 0,i?i.x:void 0),Wo(t.y,e,$o,n?n.y:void 0,i?i.y:void 0)}function Xo(t){return 0===t.translate&&1===t.scale}function Go(t){return Xo(t.x)&&Xo(t.y)}function qo(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 Zo(t){return Zi(t.x)/Zi(t.y)}class _o{constructor(){this.members=[]}add(t){Me(this.members,t),t.scheduleRender()}remove(t){if(Le(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){const n=this.lead;if(t!==n&&(this.prevLead=n,this.lead=t,t.show(),n)){n.instance&&n.scheduleRender(),t.scheduleRender(),t.resumeFrom=n,e&&(t.resumeFrom.preserveOpacity=!0),n.snapshot&&(t.snapshot=n.snapshot,t.snapshot.latestValues=n.animationValues||n.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:i}=t.options;!1===i&&n.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:e,resumingFrom:n}=t;e.onExitComplete&&e.onExitComplete(),n&&n.options.onExitComplete&&n.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function Ko(t,e,n){let i="";const o=t.x.translate/e.x,s=t.y.translate/e.y;if((o||s)&&(i=`translate3d(${o}px, ${s}px, 0) `),1===e.x&&1===e.y||(i+=`scale(${1/e.x}, ${1/e.y}) `),n){const{rotate:t,rotateX:e,rotateY:o}=n;t&&(i+=`rotate(${t}deg) `),e&&(i+=`rotateX(${e}deg) `),o&&(i+=`rotateY(${o}deg) `)}const r=t.x.scale*e.x,a=t.y.scale*e.y;return 1===r&&1===a||(i+=`scale(${r}, ${a})`),i||"none"}const Jo=(t,e)=>t.depth-e.depth;class Qo{constructor(){this.children=[],this.isDirty=!1}add(t){Me(this.children,t),this.isDirty=!0}remove(t){Le(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Jo),this.isDirty=!1,this.children.forEach(t)}}const ts=["","X","Y","Z"];let es=0;function ns({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:i,resetTransform:o}){return class{constructor(t,n={},i=(null==e?void 0:e())){this.id=es++,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(ss),this.nodes.forEach(ls),this.nodes.forEach(hs)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.elementId=t,this.latestValues=n,this.root=i?i.root||i:this,this.path=i?[...i.path,i]:[],this.parent=i,this.depth=i?i.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 Qo)}addEventListener(t,e){return this.eventHandlers.has(t)||this.eventHandlers.set(t,new Re),this.eventHandlers.get(t).add(e)}notifyListeners(t,...e){const n=this.eventHandlers.get(t);n&&n.notify(...e)}hasListeners(t){return this.eventHandlers.has(t)}registerPotentialNode(t,e){this.potentialNodes.set(t,e)}mount(e,n=!1){if(this.instance)return;this.isSVG=e instanceof SVGElement&&"svg"!==e.tagName,this.instance=e;const{layoutId:i,layout:o,visualElement:s}=this.options;if(s&&!s.current&&s.mount(e),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.elementId&&this.root.potentialNodes.delete(this.elementId),n&&(o||i)&&(this.isLayoutDirty=!0),t){let n;const i=()=>this.root.updateBlockedByResize=!1;t(e,()=>{this.root.updateBlockedByResize=!0,n&&n(),n=mi(i,250),A.hasAnimatedSinceResize&&(A.hasAnimatedSinceResize=!1,this.nodes.forEach(us))})}i&&this.root.registerSharedNode(i,this),!1!==this.options.animate&&s&&(i||o)&&this.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e,hasRelativeTargetChanged:n,layout:i})=>{if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const o=this.options.transition||s.getDefaultTransition()||ys,{onLayoutAnimationStart:r,onLayoutAnimationComplete:a}=s.getProps(),c=!this.targetLayout||!qo(this.targetLayout,i)||n,u=!e&&n;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||u||e&&(c||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(t,u);const e={...Ai(o,"layout"),onPlay:r,onComplete:a};(s.shouldReduceMotion||this.options.layoutRoot)&&(e.delay=0,e.type=!1),this.startAnimation(e)}else e||0!==this.animationProgress||us(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=i})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const t=this.getStack();t&&t.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Te.preRender(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(ds),this.animationId++)}getTransformTemplate(){const{visualElement:t}=this.options;return t&&t.getProps().transformTemplate}willUpdate(t=!0){if(this.root.isUpdateBlocked())return void(this.options.onExitComplete&&this.options.onExitComplete());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"),e.options.layoutRoot&&e.willUpdate(!1)}const{layoutId:e,layout:n}=this.options;if(void 0===e&&!n)return;const i=this.getTransformTemplate();this.prevTransformTemplateValue=i?i(this.latestValues,""):void 0,this.updateSnapshot(),t&&this.notifyListeners("willUpdate")}didUpdate(){if(this.isUpdateBlocked())return this.unblockUpdate(),this.clearAllSnapshots(),void this.nodes.forEach(as);this.isUpdating&&(this.isUpdating=!1,this.potentialNodes.size&&(this.potentialNodes.forEach(vs),this.potentialNodes.clear()),this.nodes.forEach(cs),this.nodes.forEach(is),this.nodes.forEach(os),this.clearAllSnapshots(),Ae.update(),Ae.preRender(),Ae.render())}clearAllSnapshots(){this.nodes.forEach(rs),this.sharedNodes.forEach(ps)}scheduleUpdateProjection(){we.preRender(this.updateProjection,!1,!0)}scheduleCheckAfterUnmount(){we.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure())}updateLayout(){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 t=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);const{visualElement:e}=this.options;e&&e.notify("LayoutMeasure",this.layout.layoutBox,t?t.layoutBox:void 0)}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:i(this.instance),offset:n(this.instance)})}resetTransform(){if(!o)return;const t=this.isLayoutDirty||this.shouldResetTransform,e=this.projectionDelta&&!Go(this.projectionDelta),n=this.getTransformTemplate(),i=n?n(this.latestValues,""):void 0,s=i!==this.prevTransformTemplateValue;t&&(e||po(this.latestValues)||s)&&(o(this.instance,i),this.shouldResetTransform=!1,this.scheduleRender())}measure(t=!0){const e=this.measurePageBox();let n=this.removeElementScroll(e);var i;return t&&(n=this.removeTransform(n)),xs((i=n).x),xs(i.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&&(Eo(e.x,n.offset.x),Eo(e.y,n.offset.y)),e}removeElementScroll(t){const e={x:{min:0,max:0},y:{min:0,max:0}};No(e,t);for(let n=0;n<this.path.length;n++){const i=this.path[n],{scroll:o,options:s}=i;if(i!==this.root&&o&&s.layoutScroll){if(o.isRoot){No(e,t);const{scroll:n}=this.root;n&&(Eo(e.x,-n.offset.x),Eo(e.y,-n.offset.y))}Eo(e.x,o.offset.x),Eo(e.y,o.offset.y)}}return e}applyTransform(t,e=!1){const n={x:{min:0,max:0},y:{min:0,max:0}};No(n,t);for(let t=0;t<this.path.length;t++){const i=this.path[t];!e&&i.options.layoutScroll&&i.scroll&&i!==i.root&&Ao(n,{x:-i.scroll.offset.x,y:-i.scroll.offset.y}),po(i.latestValues)&&Ao(n,i.latestValues)}return po(this.latestValues)&&Ao(n,this.latestValues),n}removeTransform(t){const e={x:{min:0,max:0},y:{min:0,max:0}};No(e,t);for(let t=0;t<this.path.length;t++){const n=this.path[t];if(!n.instance)continue;if(!po(n.latestValues))continue;ho(n.latestValues)&&n.updateSnapshot();const i={x:{min:0,max:0},y:{min:0,max:0}};No(i,n.measurePageBox()),Yo(e,n.latestValues,n.snapshot?n.snapshot.layoutBox:void 0,i)}return po(this.latestValues)&&Yo(e,this.latestValues),e}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(){const t=this.getLead();if(this.isProjectionDirty||(this.isProjectionDirty=t.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=t.isTransformDirty),!this.isProjectionDirty&&!this.attemptToResolveRelativeTarget)return;const{layout:e,layoutId:n}=this.options;if(this.layout&&(e||n)){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}},eo(this.relativeTargetOrigin,this.layout.layoutBox,t.layout.layoutBox),No(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}var i,o,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&&this.relativeParent&&this.relativeParent.target?(i=this.target,o=this.relativeTarget,s=this.relativeParent.target,Qi(i.x,o.x,s.x),Qi(i.y,o.y,s.y)):this.targetDelta?(Boolean(this.resumingFrom)?this.target=this.applyTransform(this.layout.layoutBox):No(this.target,this.layout.layoutBox),xo(this.target,this.targetDelta)):No(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}},eo(this.relativeTargetOrigin,this.target,t.target),No(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(this.parent&&!ho(this.parent.latestValues)&&!mo(this.parent.latestValues))return(this.parent.relativeTarget||this.parent.targetDelta||this.parent.options.layoutRoot)&&this.parent.layout?this.parent:this.parent.getClosestProjectingParent()}calcProjection(){const{isProjectionDirty:t,isTransformDirty:e}=this;this.isProjectionDirty=this.isTransformDirty=!1;const n=this.getLead(),i=Boolean(this.resumingFrom)||this!==n;let o=!0;if(t&&(o=!1),i&&e&&(o=!1),o)return;const{layout:s,layoutId:r}=this.options;if(this.isTreeAnimating=Boolean(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!s&&!r)return;No(this.layoutCorrected,this.layout.layoutBox),function(t,e,n,i=!1){const o=n.length;if(!o)return;let s,r;e.x=e.y=1;for(let a=0;a<o;a++){s=n[a],r=s.projectionDelta;const o=s.instance;o&&o.style&&"contents"===o.style.display||(i&&s.options.layoutScroll&&s.scroll&&s!==s.root&&Ao(t,{x:-s.scroll.offset.x,y:-s.scroll.offset.y}),r&&(e.x*=r.x.scale,e.y*=r.y.scale,xo(t,r)),i&&po(s.latestValues)&&Ao(t,s.latestValues))}e.x=Po(e.x),e.y=Po(e.y)}(this.layoutCorrected,this.treeScale,this.path,i);const{target:a}=n;if(!a)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 c=this.treeScale.x,u=this.treeScale.y,l=this.projectionTransform;Ji(this.projectionDelta,this.layoutCorrected,a,this.latestValues),this.projectionTransform=Ko(this.projectionDelta,this.treeScale),this.projectionTransform===l&&this.treeScale.x===c&&this.treeScale.y===u||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",a))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(t=!0){if(this.options.scheduleRender&&this.options.scheduleRender(),t){const t=this.getStack();t&&t.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}setAnimationOrigin(t,e=!1){const n=this.snapshot,i=n?n.latestValues:{},o={...this.latestValues},s={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!e;const r={x:{min:0,max:0},y:{min:0,max:0}},a=(n?n.source:void 0)!==(this.layout?this.layout.source:void 0),c=this.getStack(),u=!c||c.members.length<=1,l=Boolean(a&&!u&&!0===this.options.crossfade&&!this.path.some(gs));this.animationProgress=0,this.mixTargetDelta=e=>{const n=e/1e3;var c,h,d,p;ms(s.x,t.x,n),ms(s.y,t.y,n),this.setTargetDelta(s),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(eo(r,this.layout.layoutBox,this.relativeParent.layout.layoutBox),c=this.relativeTarget,h=this.relativeTargetOrigin,d=r,p=n,fs(c.x,h.x,d.x,p),fs(c.y,h.y,d.y,p)),a&&(this.animationValues=o,function(t,e,n,i,o,s){o?(t.opacity=bn(0,void 0!==n.opacity?n.opacity:1,Oo(i)),t.opacityExit=bn(void 0!==e.opacity?e.opacity:1,0,Io(i))):s&&(t.opacity=bn(void 0!==e.opacity?e.opacity:1,void 0!==n.opacity?n.opacity:1,i));for(let o=0;o<ko;o++){const s=`border${Ro[o]}Radius`;let r=Fo(e,s),a=Fo(n,s);if(void 0===r&&void 0===a)continue;r||(r=0),a||(a=0);0===r||0===a||Bo(r)===Bo(a)?(t[s]=Math.max(bn(Do(r),Do(a),i),0),(it.test(a)||it.test(r))&&(t[s]+="%")):t[s]=a}(e.rotate||n.rotate)&&(t.rotate=bn(e.rotate||0,n.rotate||0,i))}(o,i,this.latestValues,n,l,u)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(t){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(Te.update(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=we.update(()=>{A.hasAnimatedSinceResize=!0,this.currentAnimation=Lo(0,1e3,{...t,onUpdate:e=>{this.mixTargetDelta(e),t.onUpdate&&t.onUpdate(e)},onComplete:()=>{t.onComplete&&t.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const t=this.getStack();t&&t.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const t=this.getLead();let{targetWithTransforms:e,target:n,layout:i,latestValues:o}=t;if(e&&n&&i){if(this!==t&&this.layout&&i&&Ps(this.options.animationType,this.layout.layoutBox,i.layoutBox)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const e=Zi(this.layout.layoutBox.x);n.x.min=t.target.x.min,n.x.max=n.x.min+e;const i=Zi(this.layout.layoutBox.y);n.y.min=t.target.y.min,n.y.max=n.y.min+i}No(e,n),Ao(e,o),Ji(this.projectionDeltaWithTransform,this.layoutCorrected,e,o)}}registerSharedNode(t,e){this.sharedNodes.has(t)||this.sharedNodes.set(t,new _o);this.sharedNodes.get(t).add(e);const n=e.options.initialPromotionConfig;e.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(e):void 0})}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 i=this.getStack();i&&i.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 i={};for(let e=0;e<ts.length;e++){const o="rotate"+ts[e];n[o]&&(i[o]=n[o],t.setStaticValue(o,0))}t.render();for(const e in i)t.setStaticValue(e,i[e]);t.scheduleRender()}getProjectionStyles(t={}){var e,n;const i={};if(!this.instance||this.isSVG)return i;if(!this.isVisible)return{visibility:"hidden"};i.visibility="";const o=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,i.opacity="",i.pointerEvents=Ot(t.pointerEvents)||"",i.transform=o?o(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=Ot(t.pointerEvents)||""),this.hasProjected&&!po(this.latestValues)&&(e.transform=o?o({},""):"none",this.hasProjected=!1),e}const r=s.animationValues||s.latestValues;this.applyTransformsToTarget(),i.transform=Ko(this.projectionDeltaWithTransform,this.treeScale,r),o&&(i.transform=o(r,i.transform));const{x:a,y:c}=this.projectionDelta;i.transformOrigin=`${100*a.origin}% ${100*c.origin}% 0`,s.animationValues?i.opacity=s===this?null!==(n=null!==(e=r.opacity)&&void 0!==e?e:this.latestValues.opacity)&&void 0!==n?n:1:this.preserveOpacity?this.latestValues.opacity:r.opacityExit:i.opacity=s===this?void 0!==r.opacity?r.opacity:"":void 0!==r.opacityExit?r.opacityExit:0;for(const t in F){if(void 0===r[t])continue;const{correct:e,applyTo:n}=F[t],o="none"===i.transform?r[t]:e(r[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?Ot(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(as),this.root.sharedNodes.clear()}}}function is(t){t.updateLayout()}function os(t){var e;const n=(null===(e=t.resumeFrom)||void 0===e?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&n&&t.hasListeners("didUpdate")){const{layoutBox:e,measuredBox:i}=t.layout,{animationType:o}=t.options,s=n.source!==t.layout.source;"size"===o?co(t=>{const i=s?n.measuredBox[t]:n.layoutBox[t],o=Zi(i);i.min=e[t].min,i.max=i.min+o}):Ps(o,n.layoutBox,e)&&co(t=>{const i=s?n.measuredBox[t]:n.layoutBox[t],o=Zi(e[t]);i.max=i.min+o});const r={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};Ji(r,e,n.layoutBox);const a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};s?Ji(a,t.applyTransform(i,!0),n.measuredBox):Ji(a,e,n.layoutBox);const c=!Go(r);let u=!1;if(!t.resumeFrom){const i=t.getClosestProjectingParent();if(i&&!i.resumeFrom){const{snapshot:o,layout:s}=i;if(o&&s){const r={x:{min:0,max:0},y:{min:0,max:0}};eo(r,n.layoutBox,o.layoutBox);const a={x:{min:0,max:0},y:{min:0,max:0}};eo(a,e,s.layoutBox),qo(r,a)||(u=!0),i.options.layoutRoot&&(t.relativeTarget=a,t.relativeTargetOrigin=r,t.relativeParent=i)}}}t.notifyListeners("didUpdate",{layout:e,snapshot:n,delta:a,layoutDelta:r,hasLayoutChanged:c,hasRelativeTargetChanged:u})}else if(t.isLead()){const{onExitComplete:e}=t.options;e&&e()}t.options.transition=void 0}function ss(t){t.isProjectionDirty||(t.isProjectionDirty=Boolean(t.parent&&t.parent.isProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=Boolean(t.parent&&t.parent.isTransformDirty))}function rs(t){t.clearSnapshot()}function as(t){t.clearMeasurements()}function cs(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function us(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0}function ls(t){t.resolveTargetDelta()}function hs(t){t.calcProjection()}function ds(t){t.resetRotation()}function ps(t){t.removeLeadSnapshot()}function ms(t,e,n){t.translate=bn(e.translate,0,n),t.scale=bn(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function fs(t,e,n,i){t.min=bn(e.min,n.min,i),t.max=bn(e.max,n.max,i)}function gs(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}const ys={duration:.45,ease:[.4,0,.1,1]};function vs(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 i=(n&&n!==t.root?n.instance:document).querySelector(`[data-projection-id="${e}"]`);i&&t.mount(i,!0)}function xs(t){t.min=Math.round(t.min),t.max=Math.round(t.max)}function Ps(t,e,n){return"position"===t||"preserve-aspect"===t&&!_i(Zo(e),Zo(n),.2)}const Es=ns({attachResizeListener:(t,e)=>Wt(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),bs={current:void 0},ws=ns({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!bs.current){const t=new Es(0,{});t.mount(window),t.setOptions({layoutScroll:!0}),bs.current=t}return bs.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)}),Ts=t=>!t.isLayoutDirty&&t.willUpdate(!1);function As(){const t=new Set,e=new WeakMap,n=()=>t.forEach(Ts);return{add:i=>{t.add(i),e.set(i,i.addEventListener("willUpdate",n))},remove:i=>{t.delete(i);const o=e.get(i);o&&(o(),e.delete(i)),n()},dirty:n}}function Ss(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Cs={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!ot.test(t))return t;t=parseFloat(t)}return`${Ss(t,e.target.x)}% ${Ss(t,e.target.y)}%`}};function Vs(t){return"string"==typeof t&&t.startsWith("var(--")}const Ms=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function Ls(t,e,n=1){const[i,o]=function(t){const e=Ms.exec(t);if(!e)return[,];const[,n,i]=e;return[n,i]}(t);if(!i)return;const s=window.getComputedStyle(e).getPropertyValue(i);return s?s.trim():Vs(o)?Ls(o,e,n+1):o}const Rs={correct:(t,{treeScale:e,projectionDelta:n})=>{const i=t,o=t.includes("var("),s=[];o&&(t=t.replace(Ms,t=>(s.push(t),"_$css")));const r=Xe.parse(t);if(r.length>5)return i;const a=Xe.createTransformer(t),c="number"!=typeof r[0]?1:0,u=n.x.scale*e.x,l=n.y.scale*e.y;r[0+c]/=u,r[1+c]/=l;const h=bn(u,l,.5);"number"==typeof r[2+c]&&(r[2+c]/=h),"number"==typeof r[3+c]&&(r[3+c]/=h);let d=a(r);if(o){let t=0;d=d.replace("_$css",()=>{const e=s[t];return t++,e})}return d}},ks=new Set(["width","height","top","left","right","bottom","x","y"]),Ds=t=>ks.has(t),Bs=t=>t===G||t===ot;var Fs;!function(t){t.width="width",t.height="height",t.left="left",t.right="right",t.top="top",t.bottom="bottom"}(Fs||(Fs={}));const Os=(t,e)=>parseFloat(t.split(", ")[e]),Is=(t,e)=>(n,{transform:i})=>{if("none"===i||!i)return 0;const o=i.match(/^matrix3d\((.+)\)$/);if(o)return Os(o[1],e);{const e=i.match(/^matrix\((.+)\)$/);return e?Os(e[1],t):0}},js=new Set(["x","y","z"]),Us=I.filter(t=>!js.has(t));const Ns={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:Is(4,13),y:Is(5,14)},zs=(t,e,n={},i={})=>{e={...e},i={...i};const o=Object.keys(e).filter(Ds);let s=[],r=!1;const a=[];if(o.forEach(o=>{const c=t.getValue(o);if(!t.hasValue(o))return;let u=n[o],l=nn(u);const h=e[o];let d;if(Ft(h)){const t=h.length,e=null===h[0]?1:0;u=h[e],l=nn(u);for(let n=e;n<t;n++)d?nn(h[n]):d=nn(h[n])}else d=nn(h);if(l!==d)if(Bs(l)&&Bs(d)){const t=c.get();"string"==typeof t&&c.set(parseFloat(t)),"string"==typeof h?e[o]=parseFloat(h):Array.isArray(h)&&d===ot&&(e[o]=h.map(parseFloat))}else(null==l?void 0:l.transform)&&(null==d?void 0:d.transform)&&(0===u||0===h)?0===u?c.set(d.transform(u)):e[o]=l.transform(h):(r||(s=function(t){const e=[];return Us.forEach(n=>{const i=t.getValue(n);void 0!==i&&(e.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),e.length&&t.render(),e}(t),r=!0),a.push(o),i[o]=void 0!==i[o]?i[o]:e[o],c.jump(h))}),a.length){const n=a.indexOf("height")>=0?window.pageYOffset:null,o=((t,e,n)=>{const i=e.measureViewportBox(),o=e.current,s=getComputedStyle(o),{display:r}=s,a={};"none"===r&&e.setStaticValue("display",t.display||"block"),n.forEach(t=>{a[t]=Ns[t](i,s)}),e.render();const c=e.measureViewportBox();return n.forEach(n=>{const i=e.getValue(n);i&&i.jump(a[n]),t[n]=Ns[n](c,s)}),t})(e,t,a);return s.length&&s.forEach(([e,n])=>{t.getValue(e).set(n)}),t.render(),l&&null!==n&&window.scrollTo({top:n}),{target:o,transitionEnd:i}}return{target:e,transitionEnd:i}};function Ws(t,e,n,i){return(t=>Object.keys(t).some(Ds))(e)?zs(t,e,n,i):{target:e,transitionEnd:i}}const Hs=(t,e,n,i)=>{const o=function(t,{...e},n){const i=t.current;if(!(i instanceof Element))return{target:e,transitionEnd:n};n&&(n={...n}),t.values.forEach(t=>{const e=t.get();if(!Vs(e))return;const n=Ls(e,i);n&&t.set(n)});for(const t in e){const o=e[t];if(!Vs(o))continue;const s=Ls(o,i);s&&(e[t]=s,n&&void 0===n[t]&&(n[t]=o))}return{target:e,transitionEnd:n}}(t,e,i);return Ws(t,e=o.target,n,i=o.transitionEnd)},$s={current:null},Ys={current:!1};function Xs(){if(Ys.current=!0,l)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>$s.current=t.matches;t.addListener(e),e()}else $s.current=!1}const Gs=Object.keys(b),qs=Gs.length,Zs=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class _s{constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:i,visualState:o},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.scheduleRender=()=>we.render(this.render,!1,!0);const{latestValues:r,renderState:a}=o;this.latestValues=r,this.baseTarget={...r},this.initialValues=e.initial?{...r}:{},this.renderState=a,this.parent=t,this.props=e,this.presenceContext=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.options=s,this.isControllingVariants=y(e),this.isVariantNode=v(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:c,...u}=this.scrapeMotionValuesFromProps(e,{});for(const t in u){const e=u[t];void 0!==r[t]&&N(e)&&(e.set(r[t],!1),pn(c)&&c.add(t))}}scrapeMotionValuesFromProps(t,e){return{}}mount(t){this.current=t,this.projection&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((t,e)=>this.bindToMotionValue(e,t)),Ys.current||Xs(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||$s.current),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),Te.update(this.notifyUpdate),Te.render(this.render),this.valueSubscriptions.forEach(t=>t()),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features)this.features[t].unmount();this.current=null}bindToMotionValue(t,e){const n=j.has(t),i=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&we.update(this.notifyUpdate,!1,!0),n&&this.projection&&(this.projection.isTransformDirty=!0)}),o=e.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(t,()=>{i(),o()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}loadFeatures({children:t,...e},n,i,o,s){let r,a;for(let t=0;t<qs;t++){const n=Gs[t],{isEnabled:i,Feature:o,ProjectionNode:s,MeasureLayout:c}=b[n];s&&(r=s),i(e)&&(!this.features[n]&&o&&(this.features[n]=new o(this)),c&&(a=c))}if(!this.projection&&r){this.projection=new r(o,this.latestValues,this.parent&&this.parent.projection);const{layoutId:t,layout:n,drag:i,dragConstraints:a,layoutScroll:c,layoutRoot:u}=e;this.projection.setOptions({layoutId:t,layout:n,alwaysMeasureLayout:Boolean(i)||a&&p(a),visualElement:this,scheduleRender:()=>this.scheduleRender(),animationType:"string"==typeof n?n:"both",initialPromotionConfig:s,layoutScroll:c,layoutRoot:u})}return a}updateFeatures(){for(const t in this.features){const e=this.features[t];e.isMounted?e.update(this.props,this.prevProps):(e.mount(),e.isMounted=!0)}}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)}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;e<Zs.length;e++){const n=Zs[e];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);const i=t["on"+n];i&&(this.propEventSubscriptions[n]=this.on(n,i))}this.prevMotionValues=function(t,e,n){const{willChange:i}=e;for(const o in e){const s=e[o],r=n[o];if(N(s))t.addValue(o,s),pn(i)&&i.add(o);else if(N(r))t.addValue(o,Be(s,{owner:t})),pn(i)&&i.remove(o);else if(r!==s)if(t.hasValue(o)){const e=t.getValue(o);!e.hasAnimated&&e.set(s)}else{const e=t.getStaticValue(o);t.addValue(o,Be(void 0!==e?e:s,{owner:t}))}}for(const i in n)void 0===e[i]&&t.removeValue(i);return e}(this,this.scrapeMotionValuesFromProps(t,this.prevProps),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}getVariantContext(t=!1){if(t)return this.parent?this.parent.getVariantContext():void 0;if(!this.isControllingVariants){const t=this.parent&&this.parent.getVariantContext()||{};return void 0!==this.props.initial&&(t.initial=this.props.initial),t}const e={};for(let t=0;t<Js;t++){const n=Ks[t],i=this.props[n];(m(i)||!1===i)&&(e[n]=i)}return e}addVariantChild(t){const e=this.getClosestVariantNode();if(e)return e.variantChildren&&e.variantChildren.add(t),()=>e.variantChildren.delete(t)}addValue(t,e){e!==this.values.get(t)&&(this.removeValue(t),this.bindToMotionValue(t,e)),this.values.set(t,e),this.latestValues[t]=e.get()}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return void 0===n&&void 0!==e&&(n=Be(e,{owner:this}),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,i="string"==typeof n||"object"==typeof n?null===(e=Bt(this.props,n))||void 0===e?void 0:e[t]:void 0;if(n&&void 0!==i)return i;const o=this.getBaseTargetFromProps(this.props,t);return void 0===o||N(o)?void 0!==this.initialValues[t]&&void 0===i?void 0:this.baseTarget[t]:o}on(t,e){return this.events[t]||(this.events[t]=new Re),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}}const Ks=["initial",...ki],Js=Ks.length;class Qs extends _s{sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){return t.style?t.style[e]:void 0}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}makeTargetAnimatableFromInstance({transition:t,transitionEnd:e,...n},{transformValues:i},o){let s=dn(n,t||{},this);if(i&&(e&&(e=i(e)),n&&(n=i(n)),s&&(s=i(s))),o){ln(this,n,s);const t=Hs(this,n,s,e);e=t.transitionEnd,n=t.target}return{transition:t,transitionEnd:e,...n}}}class tr extends Qs{readValueFromInstance(t,e){if(j.has(e)){const t=Je(e);return t&&t.default||0}{const i=(n=t,window.getComputedStyle(n)),o=($(e)?i.getPropertyValue(e):i[e])||0;return"string"==typeof o?o.trim():o}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return So(t,e)}build(t,e,n,i){lt(t,e,n,i.transformTemplate)}scrapeMotionValuesFromProps(t,e){return kt(t,e)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;N(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=""+t)}))}renderInstance(t,e,n,i){Mt(t,e,n,i)}}function er(){const t=e.useContext(u);if(null===t)return[!0,null];const{isPresent:n,onExitComplete:i,register:o}=t,s=e.useId();e.useEffect(()=>o(s),[]);return!n&&i?[!1,()=>i&&i(s)]:[!0]}class nr extends s.default.Component{componentDidMount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n,layoutId:i}=this.props,{projection:o}=t;O(or),o&&(e.group&&e.group.add(o),n&&n.register&&i&&n.register(o),o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),A.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:e,visualElement:n,drag:i,isPresent:o}=this.props,s=n.projection;return s?(s.isPresent=o,i||t.layoutDependency!==e||void 0===e?s.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?s.promote():s.relegate()||we.postRender(()=>{const t=s.getStack();t&&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:i}=t;i&&(i.scheduleCheckAfterUnmount(),e&&e.group&&e.group.remove(i),n&&n.deregister&&n.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function ir(t){const[n,i]=er(),o=e.useContext(C);return s.default.createElement(nr,{...t,layoutGroup:o,switchLayoutGroup:e.useContext(V),isPresent:n,safeToRemove:i})}const or={borderRadius:{...Cs,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Cs,borderTopRightRadius:Cs,borderBottomLeftRadius:Cs,borderBottomRightRadius:Cs,boxShadow:Rs},sr={pan:{Feature:class extends ee{constructor(){super(...arguments),this.removePointerDownListener=oe}onPointerDown(t){this.session=new Wi(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint()})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:e,onPan:n,onPanEnd:i}=this.node.getProps();return{onSessionStart:t,onStart:e,onMove:n,onEnd:(t,e)=>{delete this.session,i&&i(t,e)}}}mount(){this.removePointerDownListener=Xt(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}},drag:{Feature:class extends ee{constructor(t){super(t),this.removeGroupControls=oe,this.removeListeners=oe,this.controls=new Vo(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||oe}unmount(){this.removeGroupControls(),this.removeListeners()}},ProjectionNode:ws,MeasureLayout:ir}};class rr extends Qs{constructor(){super(...arguments),this.isSVGTag=!1}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(j.has(e)){const t=Je(e);return t&&t.default||0}return e=Lt.has(e)?e:Vt(e),t.getAttribute(e)}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}scrapeMotionValuesFromProps(t,e){return Dt(t,e)}build(t,e,n,i){wt(t,e,n,this.isSVGTag,i.transformTemplate)}renderInstance(t,e,n,i){Rt(t,e,0,i)}mount(t){this.isSVGTag=At(t.tagName),super.mount(t)}}const ar=(t,e)=>B(t)?new rr(e,{enableHardwareAcceleration:!1}):new tr(e,{enableHardwareAcceleration:!0}),cr={layout:{ProjectionNode:ws,MeasureLayout:ir}},ur={...Ui,...de,...sr,...cr},lr=k((t,e)=>zt(t,e,ur,ar));const hr=k(zt);function dr(){const t=e.useRef(!1);return h(()=>(t.current=!0,()=>{t.current=!1}),[]),t}function pr(){const t=dr(),[n,i]=e.useState(0),o=e.useCallback(()=>{t.current&&i(n+1)},[n]);return[e.useCallback(()=>we.postRender(o),[o]),n]}class mr extends o.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 fr({children:t,isPresent:n}){const i=e.useId(),s=e.useRef(null),r=e.useRef({width:0,height:0,top:0,left:0});return e.useInsertionEffect(()=>{const{width:t,height:e,top:o,left:a}=r.current;if(n||!s.current||!t||!e)return;s.current.dataset.motionPopId=i;const c=document.createElement("style");return document.head.appendChild(c),c.sheet&&c.sheet.insertRule(`\n [data-motion-pop-id="${i}"] {\n position: absolute !important;\n width: ${t}px !important;\n height: ${e}px !important;\n top: ${o}px !important;\n left: ${a}px !important;\n }\n `),()=>{document.head.removeChild(c)}},[n]),o.createElement(mr,{isPresent:n,childRef:s,sizeRef:r},o.cloneElement(t,{ref:s}))}const gr=({children:t,initial:n,isPresent:i,onExitComplete:s,custom:r,presenceAffectsLayout:a,mode:c})=>{const l=T(yr),h=e.useId(),d=e.useMemo(()=>({id:h,initial:n,isPresent:i,custom:r,onExitComplete:t=>{l.set(t,!0);for(const t of l.values())if(!t)return;s&&s()},register:t=>(l.set(t,!1),()=>l.delete(t))}),a?void 0:[i]);return e.useMemo(()=>{l.forEach((t,e)=>l.set(e,!1))},[i]),o.useEffect(()=>{!i&&!l.size&&s&&s()},[i]),"popLayout"===c&&(t=o.createElement(fr,{isPresent:i},t)),o.createElement(u.Provider,{value:d},t)};function yr(){return new Map}function vr(t){return e.useEffect(()=>()=>t(),[])}const xr=t=>t.key||"";const Pr=e.createContext(null),Er=t=>!0===t,br=({children:t,id:n,inheritId:i,inherit:s=!0})=>{void 0!==i&&(s=i);const r=e.useContext(C),a=e.useContext(Pr),[c,u]=pr(),l=e.useRef(null),h=r.id||a;null===l.current&&((t=>Er(!0===t)||"id"===t)(s)&&h&&(n=n?h+"-"+n:h),l.current={id:n,group:Er(s)&&r.group||As()});const d=e.useMemo(()=>({...l.current,forceRender:c}),[u]);return o.createElement(C.Provider,{value:d},t)};let wr=0;function Tr(t){return"function"==typeof t}const Ar=e.createContext(null);const Sr=e.forwardRef((function({children:t,as:n="ul",axis:i="y",onReorder:s,values:r,...a},c){const u=T(()=>lr(n)),l=[],h=e.useRef(!1),d={axis:i,registerItem:(t,e)=>{e&&-1===l.findIndex(e=>t===e.value)&&(l.push({value:t,layout:e[i]}),l.sort(Vr))},updateOrder:(t,e,n)=>{if(h.current)return;const i=function(t,e,n,i){if(!i)return t;const o=t.findIndex(t=>t.value===e);if(-1===o)return t;const s=i>0?1:-1,r=t[o+s];if(!r)return t;const a=t[o],c=r.layout,u=bn(c.min,c.max,.5);return 1===s&&a.layout.max+n>u||-1===s&&a.layout.min+n<u?function([...t],e,n){const i=e<0?t.length+e:e;if(i>=0&&i<t.length){const i=n<0?t.length+n:n,[o]=t.splice(e,1);t.splice(i,0,o)}return t}(t,o,o+s):t}(l,t,e,n);l!==i&&(h.current=!0,s(i.map(Cr).filter(t=>-1!==r.indexOf(t))))}};return e.useEffect(()=>{h.current=!1}),o.createElement(u,{...a,ref:c,ignoreStrict:!0},o.createElement(Ar.Provider,{value:d},t))}));function Cr(t){return t.value}function Vr(t,e){return t.layout.min-e.layout.min}function Mr(t){const n=T(()=>Be(t)),{isStatic:i}=e.useContext(r);if(i){const[,i]=e.useState(t);e.useEffect(()=>n.on("change",i),[])}return n}function Lr(...t){const e=!Array.isArray(t[0]),n=e?0:-1,i=t[0+n],o=t[1+n],s=t[2+n],r=t[3+n],a=Fn(o,s,{mixer:(c=s[0],(t=>"object"==typeof t&&t.mix)(c)?c.mix:void 0),...r});var c;return e?a(i):a}function Rr(t,e){const n=Mr(e()),i=()=>n.set(e());return i(),h(()=>{const e=()=>we.update(i,!1,!0),n=t.map(t=>t.on("change",e));return()=>{n.forEach(t=>t()),Te.update(i)}}),n}function kr(t,e,n,i){const o="function"==typeof e?e:Lr(e,n,i);return Array.isArray(t)?Dr(t,o):Dr([t],([t])=>o(t))}function Dr(t,e){const n=T(()=>[]);return Rr(t,()=>{n.length=0;const i=t.length;for(let e=0;e<i;e++)n[e]=t[e].get();return e(n)})}function Br(t,e=0){return N(t)?t:Mr(e)}const Fr={Group:Sr,Item:e.forwardRef((function({children:t,style:n={},value:i,as:s="li",onDrag:r,layout:a=!0,...c},u){const l=T(()=>lr(s)),h=e.useContext(Ar),d={x:Br(n.x),y:Br(n.y)},p=kr([d.x,d.y],([t,e])=>t||e?1:"unset"),m=e.useRef(null),{axis:f,registerItem:g,updateOrder:y}=h;return e.useEffect(()=>{g(i,m.current)},[h]),o.createElement(l,{drag:f,...c,dragSnapToOrigin:!0,style:{...n,x:d.x,y:d.y,zIndex:p},layout:a,onDrag:(t,e)=>{const{velocity:n}=e;n[f]&&y(i,d[f].get(),n[f]),r&&r(t,e)},onLayoutMeasure:t=>{m.current=t},ref:u,ignoreStrict:!0},t)}))},Or={renderer:ar,...Ui,...de},Ir={...Or,...sr,...cr};const jr=t=>"number"==typeof t;function Ur(t,e){return(t=>Array.isArray(t)&&!jr(t[0]))(t)?t[((t,e,n)=>{const i=e-t;return((n-t)%i+i)%i+t})(0,t.length,e)]:t}const Nr=(t,e,n)=>-n*t+n*e+t,zr=t=>t,Wr=(t,e,n)=>e-t==0?1:(n-t)/(e-t);function Hr(t,e){const n=t[t.length-1];for(let i=1;i<=e;i++){const o=Wr(0,e,i);t.push(Nr(n,1,o))}}function $r(t){const e=[0];return Hr(e,t-1),e}function Yr(t,e=$r(t.length),n=zr){const i=t.length,o=i-e.length;return o>0&&Hr(e,o),o=>{let s=0;for(;s<i-2&&!(o<e[s+1]);s++);let r=(a=0,c=1,u=Wr(e[s],e[s+1],o),Math.min(Math.max(u,a),c));var a,c,u;return r=Ur(n,s)(r),Nr(t[s],t[s+1],r)}}const Xr=t=>"function"==typeof t,Gr=t=>"string"==typeof t;function qr(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 Zr={any:0,all:1};const _r=new WeakMap;let Kr;function Jr({target:t,contentRect:e,borderBoxSize:n}){var i;null===(i=_r.get(t))||void 0===i||i.forEach(i=>{i({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 Qr(t){t.forEach(Jr)}function ta(t,e){Kr||"undefined"!=typeof ResizeObserver&&(Kr=new ResizeObserver(Qr));const n=qr(t);return n.forEach(t=>{let n=_r.get(t);n||(n=new Set,_r.set(t,n)),n.add(e),null==Kr||Kr.observe(t)}),()=>{n.forEach(t=>{const n=_r.get(t);null==n||n.delete(e),(null==n?void 0:n.size)||null==Kr||Kr.unobserve(t)})}}const ea=new Set;let na;function ia(t){return ea.add(t),na||(na=()=>{const t={width:window.innerWidth,height:window.innerHeight},e={target:window,size:t,contentSize:t};ea.forEach(t=>t(e))},window.addEventListener("resize",na)),()=>{ea.delete(t),!ea.size&&na&&(na=void 0)}}const oa={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}};function sa(t,e,n,i){const o=n[e],{length:s,position:r}=oa[e],a=o.current,c=n.time;o.current=t["scroll"+r],o.scrollLength=t["scroll"+s]-t["client"+s],o.offset.length=0,o.offset[0]=0,o.offset[1]=o.scrollLength,o.progress=Wr(0,o.scrollLength,o.current);const u=i-c;var l,h;o.velocity=u>50?0:(l=o.current-a,(h=u)?l*(1e3/h):0)}const ra={Enter:[[0,1],[1,1]],Exit:[[0,0],[1,0]],Any:[[1,0],[0,1]],All:[[0,0],[1,1]]},aa={start:0,center:.5,end:1};function ca(t,e,n=0){let i=0;if(void 0!==aa[t]&&(t=aa[t]),Gr(t)){const e=parseFloat(t);t.endsWith("px")?i=e:t.endsWith("%")?t=e/100:t.endsWith("vw")?i=e/100*document.documentElement.clientWidth:t.endsWith("vh")?i=e/100*document.documentElement.clientHeight:t=e}return jr(t)&&(i=e*t),n+i}const ua=[0,0];function la(t,e,n,i){let o=Array.isArray(t)?t:ua,s=0,r=0;return jr(t)?o=[t,t]:Gr(t)&&(o=(t=t.trim()).includes(" ")?t.split(" "):[t,aa[t]?t:"0"]),s=ca(o[0],n,i),r=ca(o[1],e),s-r}const ha={x:0,y:0};function da(t,e,n){let{offset:i=ra.All}=n;const{target:o=t,axis:s="y"}=n,r="y"===s?"height":"width",a=o!==t?function(t,e){let n={x:0,y:0},i=t;for(;i&&i!==e;)if(i instanceof HTMLElement)n.x+=i.offsetLeft,n.y+=i.offsetTop,i=i.offsetParent;else if(i instanceof SVGGraphicsElement&&"getBBox"in i){const{top:t,left:e}=i.getBBox();for(n.x+=e,n.y+=t;i&&"svg"!==i.tagName;)i=i.parentNode}return n}(o,t):ha,c=o===t?{width:t.scrollWidth,height:t.scrollHeight}:{width:o.clientWidth,height:o.clientHeight},u={width:t.clientWidth,height:t.clientHeight};e[s].offset.length=0;let l=!e[s].interpolate;const h=i.length;for(let t=0;t<h;t++){const n=la(i[t],u[r],c[r],a[s]);l||n===e[s].interpolatorOffsets[t]||(l=!0),e[s].offset[t]=n}l&&(e[s].interpolate=Yr($r(h),e[s].offset),e[s].interpolatorOffsets=[...e[s].offset]),e[s].progress=e[s].interpolate(e[s].current)}function pa(t,e,n,i={}){const o=i.axis||"y";return{measure:()=>function(t,e=t,n){if(n.x.targetOffset=0,n.y.targetOffset=0,e!==t){let i=e;for(;i&&i!=t;)n.x.targetOffset+=i.offsetLeft,n.y.targetOffset+=i.offsetTop,i=i.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,i.target,n),update:e=>{!function(t,e,n){sa(t,"x",e,n),sa(t,"y",e,n),e.time=n}(t,n,e),(i.offset||i.target)&&da(t,n,i)},notify:Xr(e)?()=>e(n):ma(e,n[o])}}function ma(t,e){return t.pause(),t.forEachNative((t,{easing:e})=>{var n,i;if(t.updateDuration)e||(t.easing=zr),t.updateDuration(1);else{const o={duration:1e3};e||(o.easing="linear"),null===(i=null===(n=t.effect)||void 0===n?void 0:n.updateTiming)||void 0===i||i.call(n,o)}}),()=>{t.currentTime=e.progress}}const fa=new WeakMap,ga=new WeakMap,ya=new WeakMap,va=t=>t===document.documentElement?window:t;function xa(t,e={}){var{container:n=document.documentElement}=e,i=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(t);o<i.length;o++)e.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(t,i[o])&&(n[i[o]]=t[i[o]])}return n}(e,["container"]);let o=ya.get(n);o||(o=new Set,ya.set(n,o));const s=pa(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}},i);if(o.add(s),!fa.has(n)){const t=()=>{const t=performance.now();for(const t of o)t.measure();for(const e of o)e.update(t);for(const t of o)t.notify()};fa.set(n,t);const e=va(n);window.addEventListener("resize",t,{passive:!0}),n!==document.documentElement&&ga.set(n,(a=t,Xr(r=n)?ia(r):ta(r,a))),e.addEventListener("scroll",t,{passive:!0})}var r,a;const c=fa.get(n),u=requestAnimationFrame(c);return()=>{var e;"function"!=typeof t&&t.stop(),cancelAnimationFrame(u);const i=ya.get(n);if(!i)return;if(i.delete(s),i.size)return;const o=fa.get(n);fa.delete(n),o&&(va(n).removeEventListener("scroll",o),null===(e=ga.get(n))||void 0===e||e(),window.removeEventListener("resize",o))}}function Pa(t,e){Boolean(!e||e.current)}const Ea=()=>({scrollX:Be(0),scrollY:Be(0),scrollXProgress:Be(0),scrollYProgress:Be(0)});function ba({container:t,target:n,layoutEffect:i=!0,...o}={}){const s=T(Ea);return(i?h:e.useEffect)(()=>(Pa(0,n),Pa(0,t),xa(({x:t,y:e})=>{s.scrollX.set(t.current),s.scrollXProgress.set(t.progress),s.scrollY.set(e.current),s.scrollYProgress.set(e.progress)},{...o,container:(null==t?void 0:t.current)||void 0,target:(null==n?void 0:n.current)||void 0})),[]),s}function wa(t){const n=e.useRef(0),{isStatic:i}=e.useContext(r);e.useEffect(()=>{if(i)return;const e=({timestamp:e,delta:i})=>{n.current||(n.current=e),t(e-n.current,i)};return we.update(e,!0),()=>Te.update(e)},[t])}class Ta extends De{constructor(){super(...arguments),this.members=[],this.transforms=new Set}add(t){let e;j.has(t)?(this.transforms.add(t),e="transform"):t.startsWith("origin")||$(t)||"willChange"===t||(e=Vt(t)),e&&(Me(this.members,e),this.update())}remove(t){j.has(t)?(this.transforms.delete(t),this.transforms.size||Le(this.members,"transform")):Le(this.members,Vt(t)),this.update()}update(){this.set(this.members.length?this.members.join(", "):"auto")}}function Aa(){!Ys.current&&Xs();const[t]=e.useState($s.current);return t}function Sa(){const t=new Set,e={subscribe:e=>(t.add(e),()=>{t.delete(e)}),start(e,n){const i=[];return t.forEach(t=>{i.push(Ci(t,e,{transitionOverride:n}))}),Promise.all(i)},set:e=>t.forEach(t=>{!function(t,e){Array.isArray(e)?un(t,e):"string"==typeof e?un(t,[e]):cn(t,e)}(t,e)}),stop(){t.forEach(t=>{!function(t){t.values.forEach(t=>t.stop())}(t)})},mount:()=>()=>{e.stop()}};return e}function Ca(){const t=T(Sa);return h(t.mount,[]),t}const Va=Ca,Ma=(t,e,n)=>{const i=e-t;return((n-t)%i+i)%i+t};class La{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 Ra=()=>new La;function ka(t){return null!==t&&"object"==typeof t&&M in t}function Da(){return Ba}function Ba(t){bs.current&&(bs.current.isUpdating=!1,bs.current.blockUpdate(),t&&t())}const Fa=(t,e)=>`${t}: ${e}`,Oa=new Map;function Ia(t,e,n,i){const o=Fa(t,j.has(e)?"transform":e),s=Oa.get(o);if(!s)return 0;const{animation:r,startTime:a}=s,c=()=>{Oa.delete(o);try{r.cancel()}catch(t){}};if(null!==a){const t=performance.now();return i.update(()=>{n.animation&&(n.animation.currentTime=performance.now()-t)}),i.render(c),t-a||0}return c(),0}const ja=()=>({});class Ua extends _s{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 ln(this,n,dn(n,t||{},this)),{transition:t,transitionEnd:e,...n}}}const Na=It({scrapeMotionValuesFromProps:ja,createRenderState:ja});const za=t=>t>.001?1/t:1e5;t.AnimatePresence=({children:t,custom:n,initial:i=!0,onExitComplete:s,exitBeforeEnter:r,presenceAffectsLayout:a=!0,mode:c="sync"})=>{r&&(c="wait");let[u]=pr();const l=e.useContext(C).forceRender;l&&(u=l);const d=dr(),p=function(t){const n=[];return e.Children.forEach(t,t=>{e.isValidElement(t)&&n.push(t)}),n}(t);let m=p;const f=new Set,g=e.useRef(m),y=e.useRef(new Map).current,v=e.useRef(!0);if(h(()=>{v.current=!1,function(t,e){t.forEach(t=>{const n=xr(t);e.set(n,t)})}(p,y),g.current=m}),vr(()=>{v.current=!0,y.clear(),f.clear()}),v.current)return o.createElement(o.Fragment,null,m.map(t=>o.createElement(gr,{key:xr(t),isPresent:!0,initial:!!i&&void 0,presenceAffectsLayout:a,mode:c},t)));m=[...m];const x=g.current.map(xr),P=p.map(xr),E=x.length;for(let t=0;t<E;t++){const e=x[t];-1===P.indexOf(e)&&f.add(e)}return"wait"===c&&f.size&&(m=[]),f.forEach(t=>{if(-1!==P.indexOf(t))return;const e=y.get(t);if(!e)return;const i=x.indexOf(t);m.splice(i,0,o.createElement(gr,{key:xr(e),isPresent:!1,onExitComplete:()=>{y.delete(t),f.delete(t);const e=g.current.findIndex(e=>e.key===t);if(g.current.splice(e,1),!f.size){if(g.current=p,!1===d.current)return;u(),s&&s()}},custom:n,presenceAffectsLayout:a,mode:c},e))}),m=m.map(t=>{const e=t.key;return f.has(e)?t:o.createElement(gr,{key:xr(t),isPresent:!0,presenceAffectsLayout:a,mode:c},t)}),o.createElement(o.Fragment,null,f.size?m:m.map(t=>e.cloneElement(t)))},t.AnimateSharedLayout=({children:t})=>(o.useEffect(()=>{},[]),o.createElement(br,{id:T(()=>"asl-"+wr++)},t)),t.DeprecatedLayoutGroupContext=Pr,t.DragControls=La,t.FlatTree=Qo,t.LayoutGroup=br,t.LayoutGroupContext=C,t.LazyMotion=function({children:t,features:n,strict:i=!1}){const[,s]=e.useState(!Tr(n)),r=e.useRef(void 0);if(!Tr(n)){const{renderer:t,...e}=n;r.current=t,w(e)}return e.useEffect(()=>{Tr(n)&&n().then(({renderer:t,...e})=>{w(e),r.current=t,s(!0)})},[]),o.createElement(d.Provider,{value:{renderer:r.current,strict:i}},t)},t.MotionConfig=function({children:t,isValidProp:n,...i}){n&&vt(n),(i={...e.useContext(r),...i}).isStatic=T(()=>i.isStatic);const s=e.useMemo(()=>i,[JSON.stringify(i.transition),i.transformPagePoint,i.reducedMotion]);return o.createElement(r.Provider,{value:s},t)},t.MotionConfigContext=r,t.MotionContext=a,t.MotionValue=De,t.PresenceContext=u,t.Reorder=Fr,t.SwitchLayoutGroupContext=V,t.VisualElement=_s,t.addPointerEvent=Xt,t.addPointerInfo=Yt,t.addScaleCorrector=O,t.animate=Lo,t.animateVisualElement=Ci,t.animationControls=Sa,t.animations=Ui,t.anticipate=$n,t.backIn=Wn,t.backInOut=Hn,t.backOut=zn,t.buildTransform=H,t.calcLength=Zi,t.checkTargetForNewValues=ln,t.circIn=jn,t.circInOut=Nn,t.circOut=Un,t.clamp=X,t.createBox=ao,t.createDomMotionComponent=function(t){return L(zt(t,{forwardMotionProps:!1},ur,ar))},t.createMotionComponent=L,t.cubicBezier=In,t.delay=mi,t.distance=Ni,t.distance2D=zi,t.domAnimation=Or,t.domMax=Ir,t.easeIn=xn,t.easeInOut=En,t.easeOut=Pn,t.filterProps=xt,t.frameData=fe,t.isBrowser=l,t.isDragActive=te,t.isMotionComponent=ka,t.isMotionValue=N,t.isValidMotionProp=gt,t.m=hr,t.makeUseVisualState=It,t.mix=bn,t.motion=lr,t.motionValue=Be,t.optimizedAppearDataAttribute=mn,t.pipe=Zt,t.resolveMotionValue=Ot,t.spring=Qn,t.startOptimizedAppearAnimation=function(t,e,n,i,o){const s=t.dataset.framerAppearId;if(!s)return;window.HandoffAppearAnimations=Ia;const r=Fa(s,e),a=ci(t,e,[n[0],n[0]],{duration:1e4,ease:"linear"});Oa.set(r,{animation:a,startTime:null});const c=()=>{a.cancel();const s=ci(t,e,n,i);document.timeline&&(s.startTime=document.timeline.currentTime),Oa.set(r,{animation:s,startTime:performance.now()}),o&&o(s)};a.ready?a.ready.then(c).catch(oe):c()},t.sync=we,t.transform=Lr,t.unwrapMotionComponent=function(t){if(ka(t))return t[M]},t.useAnimation=Va,t.useAnimationControls=Ca,t.useAnimationFrame=wa,t.useCycle=function(...t){const n=e.useRef(0),[i,o]=e.useState(t[n.current]);return[i,e.useCallback(e=>{n.current="number"!=typeof e?Ma(0,t.length,n.current+1):e,o(t[n.current])},[t.length,...t])]},t.useDeprecatedAnimatedState=function(t){const[n,i]=e.useState(t),o=Na({},!1),s=T(()=>new Ua({props:{},visualState:o,presenceContext:null},{initialState:t}));return e.useEffect(()=>(s.mount({}),()=>s.unmount()),[s]),e.useEffect(()=>{s.update({onUpdate:t=>{i({...t})}},null)},[i,s]),[n,T(()=>t=>Ci(s,t))]},t.useDeprecatedInvertedScale=function(t){let e=Mr(1),n=Mr(1);const i=c();return t?(e=t.scaleX||e,n=t.scaleY||n):i&&(e=i.getValue("scaleX",1),n=i.getValue("scaleY",1)),{scaleX:kr(e,za),scaleY:kr(n,za)}},t.useDomEvent=function(t,n,i,o){e.useEffect(()=>{const e=t.current;if(i&&e)return Wt(e,n,i,o)},[t,n,i,o])},t.useDragControls=function(){return T(Ra)},t.useElementScroll=function(t){return ba({container:t})},t.useForceUpdate=pr,t.useInView=function(t,{root:n,margin:i,amount:o,once:s=!1}={}){const[r,a]=e.useState(!1);return e.useEffect(()=>{if(!t.current||s&&r)return;const e={root:n&&n.current||void 0,margin:i,amount:"some"===o?"any":o};return function(t,e,{root:n,margin:i,amount:o="any"}={}){if("undefined"==typeof IntersectionObserver)return()=>{};const s=qr(t),r=new WeakMap,a=new IntersectionObserver(t=>{t.forEach(t=>{const n=r.get(t.target);if(t.isIntersecting!==Boolean(n))if(t.isIntersecting){const n=e(t);Xr(n)?r.set(t.target,n):a.unobserve(t.target)}else n&&(n(t),r.delete(t.target))})},{root:n,rootMargin:i,threshold:"number"==typeof o?o:Zr[o]});return s.forEach(t=>a.observe(t)),()=>a.disconnect()}(t.current,()=>(a(!0),s?void 0:()=>a(!1)),e)},[n,t,i,s]),r},t.useInstantLayoutTransition=Da,t.useInstantTransition=function(){const[t,n]=pr(),i=Da();return e.useEffect(()=>{we.postRender(()=>we.postRender(()=>gn.current=!1))},[n]),e=>{i(()=>{gn.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 Rr(e.filter(N),(function(){let i="";for(let o=0;o<n;o++){i+=t[o];const n=e[o];n&&(i+=N(n)?n.get():n)}return i}))},t.useMotionValue=Mr,t.useMotionValueEvent=function(t,n,i){e.useInsertionEffect(()=>t.on(n,i),[t,n,i])},t.usePresence=er,t.useReducedMotion=Aa,t.useReducedMotionConfig=function(){const t=Aa(),{reducedMotion:n}=e.useContext(r);return"never"!==n&&("always"===n||t)},t.useResetProjection=function(){return o.useCallback(()=>{const t=bs.current;t&&t.resetTree()},[])},t.useScroll=ba,t.useSpring=function(t,n={}){const{isStatic:i}=e.useContext(r),o=e.useRef(null),s=Mr(N(t)?t.get():t),a=()=>{o.current&&o.current.stop()};return e.useInsertionEffect(()=>s.attach((t,e)=>i?e(t):(a(),o.current=oi({keyframes:[s.get(),t],velocity:s.getVelocity(),type:"spring",...n,onUpdate:e}),s.get()),a),[JSON.stringify(n)]),h(()=>{if(N(t))return t.on("change",t=>s.set(parseFloat(t)))},[s]),s},t.useTime=function(){const t=Mr(0);return wa(e=>t.set(e)),t},t.useTransform=kr,t.useUnmountEffect=vr,t.useVelocity=function(t){const n=Mr(t.getVelocity());return e.useEffect(()=>t.on("velocityChange",t=>{n.set(t)}),[t]),n},t.useViewportScroll=function(){return ba()},t.useVisualElementContext=c,t.useWillChange=function(){return T(()=>new Ta("auto"))},t.wrap=Ma,Object.defineProperty(t,"__esModule",{value:!0})}));
|