framer-motion 7.6.13 → 7.6.14

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.
@@ -1 +1 @@
1
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Motion={},t.React)}(this,(function(t,e){"use strict";function n(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}function o(t){if(t&&t.__esModule)return t;var e=Object.create(null);return t&&Object.keys(t).forEach((function(n){if("default"!==n){var o=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,o.get?o:{enumerable:!0,get:function(){return t[n]}})}})),e.default=t,Object.freeze(e)}var i=n(e),r=o(e);const s=e.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),a=e.createContext({});function l(){return e.useContext(a).visualElement}const u=e.createContext(null),c="undefined"!=typeof document,h=c?e.useLayoutEffect:e.useEffect,d=e.createContext({strict:!1});function p(t){return"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}function f(t){return"string"==typeof t||Array.isArray(t)}function m(t){return"object"==typeof t&&"function"==typeof t.start}const g=["initial","animate","exit","whileHover","whileDrag","whileTap","whileFocus","whileInView"];function v(t){return m(t.animate)||g.some(e=>f(t[e]))}function y(t){return Boolean(v(t)||t.variants)}function x(t){const{initial:n,animate:o}=function(t,e){if(v(t)){const{initial:e,animate:n}=t;return{initial:!1===e||f(e)?e:void 0,animate:f(n)?n:void 0}}return!1!==t.inherit?e:{}}(t,e.useContext(a));return e.useMemo(()=>({initial:n,animate:o}),[b(n),b(o)])}function b(t){return Array.isArray(t)?t.join(" "):t}const E=t=>({isEnabled:e=>t.some(t=>!!e[t])}),w={measureLayout:E(["layout","layoutId","drag"]),animation:E(["animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView"]),exit:E(["exit"]),drag:E(["drag","dragControls"]),focus:E(["whileFocus"]),hover:E(["whileHover","onHoverStart","onHoverEnd"]),tap:E(["whileTap","onTap","onTapStart","onTapCancel"]),pan:E(["onPan","onPanStart","onPanSessionStart","onPanEnd"]),inView:E(["whileInView","onViewportEnter","onViewportLeave"])};function P(t){for(const e in t)"projectionNodeConstructor"===e?w.projectionNodeConstructor=t[e]:w[e].Component=t[e]}function S(t){const n=e.useRef(null);return null===n.current&&(n.current=t()),n.current}const T={hasAnimatedSinceResize:!0,hasEverUpdated:!1};let A=1;const V=e.createContext({});class C extends i.default.Component{getSnapshotBeforeUpdate(){const{visualElement:t,props:e}=this.props;return t&&t.setProps(e),null}componentDidUpdate(){}render(){return this.props.children}}const M=e.createContext({}),R=Symbol.for("motionComponentSymbol");function L({preloadedFeatures:t,createVisualElement:n,projectionNodeConstructor:o,useRender:i,useVisualState:f,Component:m}){t&&P(t);const g=e.forwardRef((function(g,v){const y={...e.useContext(s),...g,layoutId:D(g)},{isStatic:b}=y;let E=null;const P=x(g),V=b?void 0:S(()=>{if(T.hasEverUpdated)return A++}),R=f(g,b);if(!b&&c){P.visualElement=function(t,n,o,i){const r=l(),a=e.useContext(d),c=e.useContext(u),p=e.useContext(s).reducedMotion,f=e.useRef();i=i||a.renderer,!f.current&&i&&(f.current=i(t,{visualState:n,parent:r,props:o,presenceId:c?c.id:void 0,blockInitialAnimation:!!c&&!1===c.initial,reducedMotionConfig:p}));const m=f.current;return h(()=>{m&&m.render()}),e.useEffect(()=>{m&&m.animationState&&m.animationState.animateChanges()}),h(()=>()=>m&&m.notify("Unmount"),[]),m}(m,R,y,n);const i=e.useContext(d).strict,r=e.useContext(M);P.visualElement&&(E=P.visualElement.loadFeatures(y,i,t,V,o||w.projectionNodeConstructor,r))}return r.createElement(C,{visualElement:P.visualElement,props:y},E,r.createElement(a.Provider,{value:P},i(m,g,V,function(t,n,o){return e.useCallback(e=>{e&&t.mount&&t.mount(e),n&&(e?n.mount(e):n.unmount()),o&&("function"==typeof o?o(e):p(o)&&(o.current=e))},[n])}(R,P.visualElement,v),R,b,P.visualElement)))}));return g[R]=m,g}function D({layoutId:t}){const n=e.useContext(V).id;return n&&void 0!==t?n+"-"+t:t}function O(t){function e(e,n={}){return L(t(e,n))}if("undefined"==typeof Proxy)return e;const n=new Map;return new Proxy(e,{get:(t,o)=>(n.has(o)||n.set(o,e(o)),n.get(o))})}const B=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","text","tspan","use","view"];function k(t){return"string"==typeof t&&!t.includes("-")&&!!(B.indexOf(t)>-1||/[A-Z]/.test(t))}const j={};function F(t){Object.assign(j,t)}const I=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],U=new Set(I);function N(t,{layout:e,layoutId:n}){return U.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!j[t]||"opacity"===t)}const z=t=>!!(null==t?void 0:t.getVelocity),W={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},H=(t,e)=>I.indexOf(t)-I.indexOf(e);function $({transform:t,transformKeys:e},{enableHardwareAcceleration:n=!0,allowTransformNone:o=!0},i,r){let s="";e.sort(H);for(const n of e)s+=`${W[n]||n}(${t[n]}) `;return n&&!t.z&&(s+="translateZ(0)"),s=s.trim(),r?s=r(t,i?"":s):o&&i&&(s="none"),s}function Y(t){return t.startsWith("--")}const X=(t,e)=>e&&"number"==typeof t?e.transform(t):t,G=(t,e)=>n=>Math.max(Math.min(n,e),t),q=t=>t%1?Number(t.toFixed(5)):t,Z=/(-)?([\d]*\.?[\d])+/g,K=/(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,_=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function J(t){return"string"==typeof t}const Q={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},tt=Object.assign(Object.assign({},Q),{transform:G(0,1)}),et=Object.assign(Object.assign({},Q),{default:1}),nt=t=>({test:e=>J(e)&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),ot=nt("deg"),it=nt("%"),rt=nt("px"),st=nt("vh"),at=nt("vw"),lt=Object.assign(Object.assign({},it),{parse:t=>it.parse(t)/100,transform:t=>it.transform(100*t)}),ut=(t,e)=>n=>Boolean(J(n)&&_.test(n)&&n.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(n,e)),ct=(t,e,n)=>o=>{if(!J(o))return o;const[i,r,s,a]=o.match(Z);return{[t]:parseFloat(i),[e]:parseFloat(r),[n]:parseFloat(s),alpha:void 0!==a?parseFloat(a):1}},ht={test:ut("hsl","hue"),parse:ct("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:o=1})=>"hsla("+Math.round(t)+", "+it.transform(q(e))+", "+it.transform(q(n))+", "+q(tt.transform(o))+")"},dt=G(0,255),pt=Object.assign(Object.assign({},Q),{transform:t=>Math.round(dt(t))}),ft={test:ut("rgb","red"),parse:ct("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:o=1})=>"rgba("+pt.transform(t)+", "+pt.transform(e)+", "+pt.transform(n)+", "+q(tt.transform(o))+")"};const mt={test:ut("#"),parse:function(t){let e="",n="",o="",i="";return t.length>5?(e=t.substr(1,2),n=t.substr(3,2),o=t.substr(5,2),i=t.substr(7,2)):(e=t.substr(1,1),n=t.substr(2,1),o=t.substr(3,1),i=t.substr(4,1),e+=e,n+=n,o+=o,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(o,16),alpha:i?parseInt(i,16)/255:1}},transform:ft.transform},gt={test:t=>ft.test(t)||mt.test(t)||ht.test(t),parse:t=>ft.test(t)?ft.parse(t):ht.test(t)?ht.parse(t):mt.parse(t),transform:t=>J(t)?t:t.hasOwnProperty("red")?ft.transform(t):ht.transform(t)};function vt(t){"number"==typeof t&&(t=""+t);const e=[];let n=0;const o=t.match(K);o&&(n=o.length,t=t.replace(K,"${c}"),e.push(...o.map(gt.parse)));const i=t.match(Z);return i&&(t=t.replace(Z,"${n}"),e.push(...i.map(Q.parse))),{values:e,numColors:n,tokenised:t}}function yt(t){return vt(t).values}function xt(t){const{values:e,numColors:n,tokenised:o}=vt(t),i=e.length;return t=>{let e=o;for(let o=0;o<i;o++)e=e.replace(o<n?"${c}":"${n}",o<n?gt.transform(t[o]):q(t[o]));return e}}const bt=t=>"number"==typeof t?0:t;const Et={test:function(t){var e,n,o,i;return isNaN(t)&&J(t)&&(null!==(n=null===(e=t.match(Z))||void 0===e?void 0:e.length)&&void 0!==n?n:0)+(null!==(i=null===(o=t.match(K))||void 0===o?void 0:o.length)&&void 0!==i?i:0)>0},parse:yt,createTransformer:xt,getAnimatableNone:function(t){const e=yt(t);return xt(t)(e.map(bt))}},wt=new Set(["brightness","contrast","saturate","opacity"]);function Pt(t){let[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[o]=n.match(Z)||[];if(!o)return t;const i=n.replace(o,"");let r=wt.has(e)?1:0;return o!==n&&(r*=100),e+"("+r+i+")"}const St=/([a-z-]*)\(.*?\)/g,Tt=Object.assign(Object.assign({},Et),{getAnimatableNone:t=>{const e=t.match(St);return e?e.map(Pt).join(" "):t}}),At={...Q,transform:Math.round},Vt={borderWidth:rt,borderTopWidth:rt,borderRightWidth:rt,borderBottomWidth:rt,borderLeftWidth:rt,borderRadius:rt,radius:rt,borderTopLeftRadius:rt,borderTopRightRadius:rt,borderBottomRightRadius:rt,borderBottomLeftRadius:rt,width:rt,maxWidth:rt,height:rt,maxHeight:rt,size:rt,top:rt,right:rt,bottom:rt,left:rt,padding:rt,paddingTop:rt,paddingRight:rt,paddingBottom:rt,paddingLeft:rt,margin:rt,marginTop:rt,marginRight:rt,marginBottom:rt,marginLeft:rt,rotate:ot,rotateX:ot,rotateY:ot,rotateZ:ot,scale:et,scaleX:et,scaleY:et,scaleZ:et,skew:ot,skewX:ot,skewY:ot,distance:rt,translateX:rt,translateY:rt,translateZ:rt,x:rt,y:rt,z:rt,perspective:rt,transformPerspective:rt,opacity:tt,originX:lt,originY:lt,originZ:rt,zIndex:At,fillOpacity:tt,strokeOpacity:tt,numOctaves:At};function Ct(t,e,n,o){const{style:i,vars:r,transform:s,transformKeys:a,transformOrigin:l}=t;a.length=0;let u=!1,c=!1,h=!0;for(const t in e){const n=e[t];if(Y(t)){r[t]=n;continue}const o=Vt[t],d=X(n,o);if(U.has(t)){if(u=!0,s[t]=d,a.push(t),!h)continue;n!==(o.default||0)&&(h=!1)}else t.startsWith("origin")?(c=!0,l[t]=d):i[t]=d}if(e.transform||(u||o?i.transform=$(t,n,h,o):i.transform&&(i.transform="none")),c){const{originX:t="50%",originY:e="50%",originZ:n=0}=l;i.transformOrigin=`${t} ${e} ${n}`}}const Mt=()=>({style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}});function Rt(t,e,n){for(const o in e)z(e[o])||N(o,n)||(t[o]=e[o])}function Lt(t,n,o){const i={};return Rt(i,t.style||{},t),Object.assign(i,function({transformTemplate:t},n,o){return e.useMemo(()=>{const e={style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}};return Ct(e,n,{enableHardwareAcceleration:!o},t),Object.assign({},e.vars,e.style)},[n])}(t,n,o)),t.transformValues?t.transformValues(i):i}function Dt(t,e,n){const o={},i=Lt(t,e,n);return t.drag&&!1!==t.dragListener&&(o.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=!0===t.drag?"none":"pan-"+("x"===t.drag?"y":"x")),o.style=i,o}const Ot=new Set(["initial","style","values","variants","transition","transformTemplate","transformValues","custom","inherit","layout","layoutId","layoutDependency","onLayoutAnimationStart","onLayoutAnimationComplete","onLayoutMeasure","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","drag","dragControls","dragListener","dragConstraints","dragDirectionLock","dragSnapToOrigin","_dragX","_dragY","dragElastic","dragMomentum","dragPropagation","dragTransition","onHoverStart","onHoverEnd","layoutScroll","whileInView","onViewportEnter","onViewportLeave","viewport","whileTap","onTap","onTapStart","onTapCancel","animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView","onPan","onPanStart","onPanSessionStart","onPanEnd"]);function Bt(t){return Ot.has(t)}let kt=t=>!Bt(t);function jt(t){t&&(kt=e=>e.startsWith("on")?!Bt(e):t(e))}try{jt(require("@emotion/is-prop-valid").default)}catch(t){}function Ft(t,e,n){const o={};for(const i in t)(kt(i)||!0===n&&Bt(i)||!e&&!Bt(i)||t.draggable&&i.startsWith("onDrag"))&&(o[i]=t[i]);return o}function It(t,e,n){return"string"==typeof t?t:rt.transform(e+n*t)}const Ut={offset:"stroke-dashoffset",array:"stroke-dasharray"},Nt={offset:"strokeDashoffset",array:"strokeDasharray"};function zt(t,{attrX:e,attrY:n,originX:o,originY:i,pathLength:r,pathSpacing:s=1,pathOffset:a=0,...l},u,c){Ct(t,l,u,c),t.attrs=t.style,t.style={};const{attrs:h,style:d,dimensions:p}=t;h.transform&&(p&&(d.transform=h.transform),delete h.transform),p&&(void 0!==o||void 0!==i||d.transform)&&(d.transformOrigin=function(t,e,n){return`${It(e,t.x,t.width)} ${It(n,t.y,t.height)}`}(p,void 0!==o?o:.5,void 0!==i?i:.5)),void 0!==e&&(h.x=e),void 0!==n&&(h.y=n),void 0!==r&&function(t,e,n=1,o=0,i=!0){t.pathLength=1;const r=i?Ut:Nt;t[r.offset]=rt.transform(-o);const s=rt.transform(e),a=rt.transform(n);t[r.array]=`${s} ${a}`}(h,r,s,a,!1)}const Wt=()=>({style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{},attrs:{}});function Ht(t,n){const o=e.useMemo(()=>{const e={style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{},attrs:{}};return zt(e,n,{enableHardwareAcceleration:!1},t.transformTemplate),{...e.attrs,style:{...e.style}}},[n]);if(t.style){const e={};Rt(e,t.style,t),o.style={...e,...o.style}}return o}function $t(t=!1){return(n,o,i,r,{latestValues:s},a)=>{const l=(k(n)?Ht:Dt)(o,s,a),u={...Ft(o,"string"==typeof n,t),...l,ref:r};return i&&(u["data-projection-id"]=i),e.createElement(n,u)}}const Yt=t=>t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();function Xt(t,{style:e,vars:n},o,i){Object.assign(t.style,e,i&&i.getProjectionStyles(o));for(const e in n)t.style.setProperty(e,n[e])}const Gt=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength"]);function qt(t,e,n,o){Xt(t,e,void 0,o);for(const n in e.attrs)t.setAttribute(Gt.has(n)?n:Yt(n),e.attrs[n])}function Zt(t){const{style:e}=t,n={};for(const o in e)(z(e[o])||N(o,t))&&(n[o]=e[o]);return n}function Kt(t){const e=Zt(t);for(const n in t)if(z(t[n])){e["x"===n||"y"===n?"attr"+n.toUpperCase():n]=t[n]}return e}function _t(t,e,n,o={},i={}){return"function"==typeof e&&(e=e(void 0!==n?n:t.custom,o,i)),"string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e&&(e=e(void 0!==n?n:t.custom,o,i)),e}const Jt=t=>Array.isArray(t),Qt=t=>Jt(t)?t[t.length-1]||0:t;function te(t){const e=z(t)?t.get():t;return n=e,Boolean(n&&"object"==typeof n&&n.mix&&n.toValue)?e.toValue():e;var n}const ee=t=>(n,o)=>{const i=e.useContext(a),r=e.useContext(u),s=()=>function({scrapeMotionValuesFromProps:t,createRenderState:e,onMount:n},o,i,r){const s={latestValues:ne(o,i,r,t),renderState:e()};return n&&(s.mount=t=>n(o,t,s)),s}(t,n,i,r);return o?s():S(s)};function ne(t,e,n,o){const i={},r=o(t);for(const t in r)i[t]=te(r[t]);let{initial:s,animate:a}=t;const l=v(t),u=y(t);e&&u&&!l&&!1!==t.inherit&&(void 0===s&&(s=e.initial),void 0===a&&(a=e.animate));let c=!!n&&!1===n.initial;c=c||!1===s;const h=c?a:s;if(h&&"boolean"!=typeof h&&!m(h)){(Array.isArray(h)?h:[h]).forEach(e=>{const n=_t(t,e);if(!n)return;const{transitionEnd:o,transition:r,...s}=n;for(const t in s){let e=s[t];if(Array.isArray(e)){e=e[c?e.length-1:0]}null!==e&&(i[t]=e)}for(const t in o)i[t]=o[t]})}return i}const oe={useVisualState:ee({scrapeMotionValuesFromProps:Kt,createRenderState:Wt,onMount:(t,e,{renderState:n,latestValues:o})=>{try{n.dimensions="function"==typeof e.getBBox?e.getBBox():e.getBoundingClientRect()}catch(t){n.dimensions={x:0,y:0,width:0,height:0}}zt(n,o,{enableHardwareAcceleration:!1},t.transformTemplate),qt(e,n)}})},ie={useVisualState:ee({scrapeMotionValuesFromProps:Zt,createRenderState:Mt})};function re(t,{forwardMotionProps:e=!1},n,o,i){return{...k(t)?oe:ie,preloadedFeatures:n,useRender:$t(e),createVisualElement:o,projectionNodeConstructor:i,Component:t}}var se;function ae(t,e,n,o={passive:!0}){return t.addEventListener(e,n,o),()=>t.removeEventListener(e,n)}function le(t,n,o,i){e.useEffect(()=>{const e=t.current;if(o&&e)return ae(e,n,o,i)},[t,n,o,i])}function ue(t){return"undefined"!=typeof PointerEvent&&t instanceof PointerEvent?!("mouse"!==t.pointerType):t instanceof MouseEvent}function ce(t){return!!t.touches}t.AnimationType=void 0,(se=t.AnimationType||(t.AnimationType={})).Animate="animate",se.Hover="whileHover",se.Tap="whileTap",se.Drag="whileDrag",se.Focus="whileFocus",se.InView="whileInView",se.Exit="exit";const he={pageX:0,pageY:0};function de(t,e="page"){const n=t.touches[0]||t.changedTouches[0]||he;return{x:n[e+"X"],y:n[e+"Y"]}}function pe(t,e="page"){return{x:t[e+"X"],y:t[e+"Y"]}}function fe(t,e="page"){return{point:ce(t)?de(t,e):pe(t,e)}}const me=(t,e=!1)=>{const n=e=>t(e,fe(e));return e?(o=n,t=>{const e=t instanceof MouseEvent;(!e||e&&0===t.button)&&o(t)}):n;var o},ge={pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointercancel:"mousecancel",pointerover:"mouseover",pointerout:"mouseout",pointerenter:"mouseenter",pointerleave:"mouseleave"},ve={pointerdown:"touchstart",pointermove:"touchmove",pointerup:"touchend",pointercancel:"touchcancel"};function ye(t){return c&&null===window.onpointerdown?t:c&&null===window.ontouchstart?ve[t]:c&&null===window.onmousedown?ge[t]:t}function xe(t,e,n,o){return ae(t,ye(e),me(n,"pointerdown"===e),o)}function be(t,e,n,o){return le(t,ye(e),n&&me(n,"pointerdown"===e),o)}function Ee(t){let e=null;return()=>{const n=()=>{e=null};return null===e&&(e=t,n)}}const we=Ee("dragHorizontal"),Pe=Ee("dragVertical");function Se(t){let e=!1;if("y"===t)e=Pe();else if("x"===t)e=we();else{const t=we(),n=Pe();t&&n?e=()=>{t(),n()}:(t&&t(),n&&n())}return e}function Te(){const t=Se(!0);return!t||(t(),!1)}function Ae(e,n,o){return(i,r)=>{ue(i)&&!Te()&&(e.animationState&&e.animationState.setActive(t.AnimationType.Hover,n),o&&o(i,r))}}const Ve=(t,e)=>!!e&&(t===e||Ve(t,e.parentElement));function Ce(t){return e.useEffect(()=>()=>t(),[])}function Me(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(t);i<o.length;i++)e.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(t,o[i])&&(n[o[i]]=t[o[i]])}return n}const Re=(t,e,n)=>Math.min(Math.max(n,t),e);function Le({duration:t=800,bounce:e=.25,velocity:n=0,mass:o=1}){let i,r,s=1-e;s=Re(.05,1,s),t=Re(.01,10,t/1e3),s<1?(i=e=>{const o=e*s,i=o*t;return.001-(o-n)/De(e,s)*Math.exp(-i)},r=e=>{const o=e*s*t,r=o*n+n,a=Math.pow(s,2)*Math.pow(e,2)*t,l=Math.exp(-o),u=De(Math.pow(e,2),s);return(.001-i(e)>0?-1:1)*((r-a)*l)/u}):(i=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,r=e=>Math.exp(-e*t)*(t*t*(n-e)));const a=function(t,e,n){let o=n;for(let n=1;n<12;n++)o-=t(o)/e(o);return o}(i,r,5/t);if(t*=1e3,isNaN(a))return{stiffness:100,damping:10,duration:t};{const e=Math.pow(a,2)*o;return{stiffness:e,damping:2*s*Math.sqrt(o*e),duration:t}}}function De(t,e){return t*Math.sqrt(1-e*e)}const Oe=["duration","bounce"],Be=["stiffness","damping","mass"];function ke(t,e){return e.some(e=>void 0!==t[e])}function je(t){var{from:e=0,to:n=1,restSpeed:o=2,restDelta:i}=t,r=Me(t,["from","to","restSpeed","restDelta"]);const s={done:!1,value:e};let{stiffness:a,damping:l,mass:u,velocity:c,duration:h,isResolvedFromDuration:d}=function(t){let e=Object.assign({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},t);if(!ke(t,Be)&&ke(t,Oe)){const n=Le(t);e=Object.assign(Object.assign(Object.assign({},e),n),{velocity:0,mass:1}),e.isResolvedFromDuration=!0}return e}(r),p=Fe,f=Fe;function m(){const t=c?-c/1e3:0,o=n-e,r=l/(2*Math.sqrt(a*u)),s=Math.sqrt(a/u)/1e3;if(void 0===i&&(i=Math.min(Math.abs(n-e)/100,.4)),r<1){const e=De(s,r);p=i=>{const a=Math.exp(-r*s*i);return n-a*((t+r*s*o)/e*Math.sin(e*i)+o*Math.cos(e*i))},f=n=>{const i=Math.exp(-r*s*n);return r*s*i*(Math.sin(e*n)*(t+r*s*o)/e+o*Math.cos(e*n))-i*(Math.cos(e*n)*(t+r*s*o)-e*o*Math.sin(e*n))}}else if(1===r)p=e=>n-Math.exp(-s*e)*(o+(t+s*o)*e);else{const e=s*Math.sqrt(r*r-1);p=i=>{const a=Math.exp(-r*s*i),l=Math.min(e*i,300);return n-a*((t+r*s*o)*Math.sinh(l)+e*o*Math.cosh(l))/e}}}return m(),{next:t=>{const e=p(t);if(d)s.done=t>=h;else{const r=1e3*f(t),a=Math.abs(r)<=o,l=Math.abs(n-e)<=i;s.done=a&&l}return s.value=s.done?n:e,s},flipTarget:()=>{c=-c,[e,n]=[n,e],m()}}}je.needsInterpolation=(t,e)=>"string"==typeof t||"string"==typeof e;const Fe=t=>0,Ie=(t,e,n)=>{const o=e-t;return 0===o?1:(n-t)/o},Ue=(t,e,n)=>-n*t+n*e+t;function Ne(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function ze({hue:t,saturation:e,lightness:n,alpha:o}){t/=360,n/=100;let i=0,r=0,s=0;if(e/=100){const o=n<.5?n*(1+e):n+e-n*e,a=2*n-o;i=Ne(a,o,t+1/3),r=Ne(a,o,t),s=Ne(a,o,t-1/3)}else i=r=s=n;return{red:Math.round(255*i),green:Math.round(255*r),blue:Math.round(255*s),alpha:o}}const We=(t,e,n)=>{const o=t*t,i=e*e;return Math.sqrt(Math.max(0,n*(i-o)+o))},He=[mt,ft,ht],$e=t=>He.find(e=>e.test(t)),Ye=(t,e)=>{let n=$e(t),o=$e(e),i=n.parse(t),r=o.parse(e);n===ht&&(i=ze(i),n=ft),o===ht&&(r=ze(r),o=ft);const s=Object.assign({},i);return t=>{for(const e in s)"alpha"!==e&&(s[e]=We(i[e],r[e],t));return s.alpha=Ue(i.alpha,r.alpha,t),n.transform(s)}},Xe=t=>"number"==typeof t,Ge=(t,e)=>n=>e(t(n)),qe=(...t)=>t.reduce(Ge);function Ze(t,e){return Xe(t)?n=>Ue(t,e,n):gt.test(t)?Ye(t,e):Qe(t,e)}const Ke=(t,e)=>{const n=[...t],o=n.length,i=t.map((t,n)=>Ze(t,e[n]));return t=>{for(let e=0;e<o;e++)n[e]=i[e](t);return n}},_e=(t,e)=>{const n=Object.assign(Object.assign({},t),e),o={};for(const i in n)void 0!==t[i]&&void 0!==e[i]&&(o[i]=Ze(t[i],e[i]));return t=>{for(const e in o)n[e]=o[e](t);return n}};function Je(t){const e=Et.parse(t),n=e.length;let o=0,i=0,r=0;for(let t=0;t<n;t++)o||"number"==typeof e[t]?o++:void 0!==e[t].hue?r++:i++;return{parsed:e,numNumbers:o,numRGB:i,numHSL:r}}const Qe=(t,e)=>{const n=Et.createTransformer(e),o=Je(t),i=Je(e);return o.numHSL===i.numHSL&&o.numRGB===i.numRGB&&o.numNumbers>=i.numNumbers?qe(Ke(o.parsed,i.parsed),n):n=>""+(n>0?e:t)},tn=(t,e)=>n=>Ue(t,e,n);function en(t,e,n){const o=[],i=n||("number"==typeof(r=t[0])?tn:"string"==typeof r?gt.test(r)?Ye:Qe:Array.isArray(r)?Ke:"object"==typeof r?_e:void 0);var r;const s=t.length-1;for(let n=0;n<s;n++){let r=i(t[n],t[n+1]);if(e){const t=Array.isArray(e)?e[n]:e;r=qe(t,r)}o.push(r)}return o}function nn(t,e,{clamp:n=!0,ease:o,mixer:i}={}){const r=t.length;e.length,!o||!Array.isArray(o)||o.length,t[0]>t[r-1]&&(t=[].concat(t),e=[].concat(e),t.reverse(),e.reverse());const s=en(e,o,i),a=2===r?function([t,e],[n]){return o=>n(Ie(t,e,o))}(t,s):function(t,e){const n=t.length,o=n-1;return i=>{let r=0,s=!1;if(i<=t[0]?s=!0:i>=t[o]&&(r=o-1,s=!0),!s){let e=1;for(;e<n&&!(t[e]>i||e===o);e++);r=e-1}const a=Ie(t[r],t[r+1],i);return e[r](a)}}(t,s);return n?e=>a(Re(t[0],t[r-1],e)):a}const on=t=>e=>1-t(1-e),rn=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,sn=t=>e=>e*e*((t+1)*e-t),an=t=>t,ln=(un=2,t=>Math.pow(t,un));var un;const cn=on(ln),hn=rn(ln),dn=t=>1-Math.sin(Math.acos(t)),pn=on(dn),fn=rn(pn),mn=sn(1.525),gn=on(mn),vn=rn(mn),yn=(t=>{const e=sn(t);return t=>(t*=2)<1?.5*e(t):.5*(2-Math.pow(2,-10*(t-1)))})(1.525),xn=t=>{if(1===t||0===t)return t;const e=t*t;return t<4/11?7.5625*e:t<8/11?9.075*e-9.9*t+3.4:t<.9?4356/361*e-35442/1805*t+16061/1805:10.8*t*t-20.52*t+10.72},bn=on(xn);function En(t,e){return t.map(()=>e||hn).splice(0,t.length-1)}function wn({from:t=0,to:e=1,ease:n,offset:o,duration:i=300}){const r={done:!1,value:t},s=Array.isArray(e)?e:[t,e],a=function(t,e){return t.map(t=>t*e)}(o&&o.length===s.length?o:function(t){const e=t.length;return t.map((t,n)=>0!==n?n/(e-1):0)}(s),i);function l(){return nn(a,s,{ease:Array.isArray(n)?n:En(s,n)})}let u=l();return{next:t=>(r.value=u(t),r.done=t>=i,r),flipTarget:()=>{s.reverse(),u=l()}}}const Pn={keyframes:wn,spring:je,decay:function({velocity:t=0,from:e=0,power:n=.8,timeConstant:o=350,restDelta:i=.5,modifyTarget:r}){const s={done:!1,value:e};let a=n*t;const l=e+a,u=void 0===r?l:r(l);return u!==l&&(a=u-e),{next:t=>{const e=-a*Math.exp(-t/o);return s.done=!(e>i||e<-i),s.value=s.done?u:u+e,s},flipTarget:()=>{}}}};const Sn="undefined"!=typeof performance?()=>performance.now():()=>Date.now(),Tn="undefined"!=typeof window?t=>window.requestAnimationFrame(t):t=>setTimeout(()=>t(Sn()),1/60*1e3);let An=!0,Vn=!1,Cn=!1;const Mn={delta:0,timestamp:0},Rn=["read","update","preRender","render","postRender"],Ln=Rn.reduce((t,e)=>(t[e]=function(t){let e=[],n=[],o=0,i=!1,r=!1;const s=new WeakSet,a={schedule:(t,r=!1,a=!1)=>{const l=a&&i,u=l?e:n;return r&&s.add(t),-1===u.indexOf(t)&&(u.push(t),l&&i&&(o=e.length)),t},cancel:t=>{const e=n.indexOf(t);-1!==e&&n.splice(e,1),s.delete(t)},process:l=>{if(i)r=!0;else{if(i=!0,[e,n]=[n,e],n.length=0,o=e.length,o)for(let n=0;n<o;n++){const o=e[n];o(l),s.has(o)&&(a.schedule(o),t())}i=!1,r&&(r=!1,a.process(l))}}};return a}(()=>Vn=!0),t),{}),Dn=Rn.reduce((t,e)=>{const n=Ln[e];return t[e]=(t,e=!1,o=!1)=>(Vn||Fn(),n.schedule(t,e,o)),t},{}),On=Rn.reduce((t,e)=>(t[e]=Ln[e].cancel,t),{}),Bn=Rn.reduce((t,e)=>(t[e]=()=>Ln[e].process(Mn),t),{}),kn=t=>Ln[t].process(Mn),jn=t=>{Vn=!1,Mn.delta=An?1/60*1e3:Math.max(Math.min(t-Mn.timestamp,40),1),Mn.timestamp=t,Cn=!0,Rn.forEach(kn),Cn=!1,Vn&&(An=!1,Tn(jn))},Fn=()=>{Vn=!0,An=!0,Cn||Tn(jn)},In=()=>Mn;function Un(t,e,n=0){return t-e-n}const Nn=t=>{const e=({delta:e})=>t(e);return{start:()=>Dn.update(e,!0),stop:()=>On.update(e)}};function zn(t){var e,n,{from:o,autoplay:i=!0,driver:r=Nn,elapsed:s=0,repeat:a=0,repeatType:l="loop",repeatDelay:u=0,onPlay:c,onStop:h,onComplete:d,onRepeat:p,onUpdate:f}=t,m=Me(t,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]);let g,v,y,{to:x}=m,b=0,E=m.duration,w=!1,P=!0;const S=function(t){if(Array.isArray(t.to))return wn;if(Pn[t.type])return Pn[t.type];const e=new Set(Object.keys(t));return e.has("ease")||e.has("duration")&&!e.has("dampingRatio")?wn:e.has("dampingRatio")||e.has("stiffness")||e.has("mass")||e.has("damping")||e.has("restSpeed")||e.has("restDelta")?je:wn}(m);(null===(n=(e=S).needsInterpolation)||void 0===n?void 0:n.call(e,o,x))&&(y=nn([0,100],[o,x],{clamp:!1}),o=0,x=100);const T=S(Object.assign(Object.assign({},m),{from:o,to:x}));function A(){b++,"reverse"===l?(P=b%2==0,s=function(t,e,n=0,o=!0){return o?Un(e+-t,e,n):e-(t-e)+n}(s,E,u,P)):(s=Un(s,E,u),"mirror"===l&&T.flipTarget()),w=!1,p&&p()}function V(t){if(P||(t=-t),s+=t,!w){const t=T.next(Math.max(0,s));v=t.value,y&&(v=y(v)),w=P?t.done:s<=0}null==f||f(v),w&&(0===b&&(null!=E||(E=s)),b<a?function(t,e,n,o){return o?t>=e+n:t<=-n}(s,E,u,P)&&A():(g.stop(),d&&d()))}return i&&(null==c||c(),g=r(V),g.start()),{stop:()=>{null==h||h(),g.stop()}}}function Wn(t,e){return e?t*(1e3/e):0}const Hn=t=>t.hasOwnProperty("x")&&t.hasOwnProperty("y"),$n=t=>Hn(t)&&t.hasOwnProperty("z"),Yn=(t,e)=>Math.abs(t-e);function Xn(t,e){if(Xe(t)&&Xe(e))return Yn(t,e);if(Hn(t)&&Hn(e)){const n=Yn(t.x,e.x),o=Yn(t.y,e.y),i=$n(t)&&$n(e)?Yn(t.z,e.z):0;return Math.sqrt(Math.pow(n,2)+Math.pow(o,2)+Math.pow(i,2))}}const Gn=(t,e)=>1-3*e+3*t,qn=(t,e)=>3*e-6*t,Zn=t=>3*t,Kn=(t,e,n)=>((Gn(e,n)*t+qn(e,n))*t+Zn(e))*t,_n=(t,e,n)=>3*Gn(e,n)*t*t+2*qn(e,n)*t+Zn(e);function Jn(t,e,n,o){if(t===e&&n===o)return an;const i=new Float32Array(11);for(let e=0;e<11;++e)i[e]=Kn(.1*e,t,n);function r(e){let o=0,r=1;for(;10!==r&&i[r]<=e;++r)o+=.1;--r;const s=o+.1*((e-i[r])/(i[r+1]-i[r])),a=_n(s,t,n);return a>=.001?function(t,e,n,o){for(let i=0;i<8;++i){const i=_n(e,n,o);if(0===i)return e;e-=(Kn(e,n,o)-t)/i}return e}(e,s,t,n):0===a?s:function(t,e,n,o,i){let r,s,a=0;do{s=e+(n-e)/2,r=Kn(s,o,i)-t,r>0?n=s:e=s}while(Math.abs(r)>1e-7&&++a<10);return s}(e,o,o+.1,t,n)}return t=>0===t||1===t?t:Kn(r(t),e,o)}const Qn=("undefined"==typeof process||process.env,"production"),to=new Set;function eo(t,e,n){t||to.has(e)||(console.warn(e),n&&console.warn(n),to.add(e))}const no=new WeakMap,oo=new WeakMap,io=t=>{const e=no.get(t.target);e&&e(t)},ro=t=>{t.forEach(io)};function so(t,e,n){const o=function({root:t,...e}){const n=t||document;oo.has(n)||oo.set(n,{});const o=oo.get(n),i=JSON.stringify(e);return o[i]||(o[i]=new IntersectionObserver(ro,{root:t,...e})),o[i]}(e);return no.set(t,n),o.observe(t),()=>{no.delete(t),o.unobserve(t)}}const ao={some:0,all:1};function lo(n,o,i,{root:r,margin:s,amount:a="some",once:l}){e.useEffect(()=>{if(!n||!i.current)return;const e={root:null==r?void 0:r.current,rootMargin:s,threshold:"number"==typeof a?a:ao[a]};return so(i.current,e,e=>{const{isIntersecting:n}=e;if(o.isInView===n)return;if(o.isInView=n,l&&!n&&o.hasEnteredView)return;n&&(o.hasEnteredView=!0),i.animationState&&i.animationState.setActive(t.AnimationType.InView,n);const r=i.getProps(),s=n?r.onViewportEnter:r.onViewportLeave;s&&s(e)})},[n,r,s,a])}function uo(n,o,i,{fallback:r=!0}){e.useEffect(()=>{n&&r&&("production"!==Qn&&eo(!1,"IntersectionObserver not available on this device. whileInView animations will trigger on mount."),requestAnimationFrame(()=>{o.hasEnteredView=!0;const{onViewportEnter:e}=i.getProps();e&&e(null),i.animationState&&i.animationState.setActive(t.AnimationType.InView,!0)}))},[n])}const co=t=>e=>(t(e),null),ho={inView:co((function({visualElement:t,whileInView:n,onViewportEnter:o,onViewportLeave:i,viewport:r={}}){const s=e.useRef({hasEnteredView:!1,isInView:!1});let a=Boolean(n||o||i);r.once&&s.current.hasEnteredView&&(a=!1),("undefined"==typeof IntersectionObserver?uo:lo)(a,s.current,t,r)})),tap:co((function({onTap:n,onTapStart:o,onTapCancel:i,whileTap:r,visualElement:s}){const a=n||o||i||r,l=e.useRef(!1),u=e.useRef(null),c={passive:!(o||n||i||m)};function h(){u.current&&u.current(),u.current=null}function d(){return h(),l.current=!1,s.animationState&&s.animationState.setActive(t.AnimationType.Tap,!1),!Te()}function p(t,e){d()&&(Ve(s.current,t.target)?n&&n(t,e):i&&i(t,e))}function f(t,e){d()&&i&&i(t,e)}function m(e,n){h(),l.current||(l.current=!0,u.current=qe(xe(window,"pointerup",p,c),xe(window,"pointercancel",f,c)),s.animationState&&s.animationState.setActive(t.AnimationType.Tap,!0),o&&o(e,n))}be(s,"pointerdown",a?m:void 0,c),Ce(h)})),focus:co((function({whileFocus:e,visualElement:n}){const{animationState:o}=n;le(n,"focus",e?()=>{o&&o.setActive(t.AnimationType.Focus,!0)}:void 0),le(n,"blur",e?()=>{o&&o.setActive(t.AnimationType.Focus,!1)}:void 0)})),hover:co((function({onHoverStart:t,onHoverEnd:e,whileHover:n,visualElement:o}){be(o,"pointerenter",t||n?Ae(o,!0,t):void 0,{passive:!t}),be(o,"pointerleave",e||n?Ae(o,!1,e):void 0,{passive:!e})}))};function po(){const t=e.useContext(u);if(null===t)return[!0,null];const{isPresent:n,onExitComplete:o,register:i}=t,r=e.useId();e.useEffect(()=>i(r),[]);return!n&&o?[!1,()=>o&&o(r)]:[!0]}function fo(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let o=0;o<n;o++)if(e[o]!==t[o])return!1;return!0}const mo=t=>1e3*t,go={linear:an,easeIn:ln,easeInOut:hn,easeOut:cn,circIn:dn,circInOut:fn,circOut:pn,backIn:mn,backInOut:vn,backOut:gn,anticipate:yn,bounceIn:bn,bounceInOut:t=>t<.5?.5*(1-xn(1-2*t)):.5*xn(2*t-1)+.5,bounceOut:xn},vo=t=>{if(Array.isArray(t)){t.length;const[e,n,o,i]=t;return Jn(e,n,o,i)}return"string"==typeof t?go[t]:t},yo=(t,e)=>"zIndex"!==t&&(!("number"!=typeof e&&!Array.isArray(e))||!("string"!=typeof e||!Et.test(e)||e.startsWith("url("))),xo=()=>({type:"spring",stiffness:500,damping:25,restSpeed:10}),bo=t=>({type:"spring",stiffness:550,damping:0===t?2*Math.sqrt(550):30,restSpeed:10}),Eo=()=>({type:"keyframes",ease:"linear",duration:.3}),wo=t=>({type:"keyframes",duration:.8,values:t}),Po={x:xo,y:xo,z:xo,rotate:xo,rotateX:xo,rotateY:xo,rotateZ:xo,scaleX:bo,scaleY:bo,scale:bo,opacity:Eo,backgroundColor:Eo,color:Eo,default:bo},So=(t,e)=>{let n;return n=Jt(e)?wo:Po[t]||Po.default,{to:e,...n(e)}},To={...Vt,color:gt,backgroundColor:gt,outlineColor:gt,fill:gt,stroke:gt,borderColor:gt,borderTopColor:gt,borderRightColor:gt,borderBottomColor:gt,borderLeftColor:gt,filter:Tt,WebkitFilter:Tt},Ao=t=>To[t];function Vo(t,e){var n;let o=Ao(t);return o!==Tt&&(o=Et),null===(n=o.getAnimatableNone)||void 0===n?void 0:n.call(o,e)}const Co={current:!1};function Mo(t,e){const n=performance.now(),o=({timestamp:i})=>{const r=i-n;r>=e&&(On.read(o),t(r-e))};return Dn.read(o,!0),()=>On.read(o)}function Ro({ease:t,times:e,yoyo:n,flip:o,loop:i,...r}){const s={...r};return e&&(s.offset=e),r.duration&&(s.duration=mo(r.duration)),r.repeatDelay&&(s.repeatDelay=mo(r.repeatDelay)),t&&(s.ease=(t=>Array.isArray(t)&&"number"!=typeof t[0])(t)?t.map(vo):vo(t)),"tween"===r.type&&(s.type="keyframes"),(n||i||o)&&(n?s.repeatType="reverse":i?s.repeatType="loop":o&&(s.repeatType="mirror"),s.repeat=i||n||o||r.repeat),"spring"!==r.type&&(s.type="keyframes"),s}function Lo(t,e,n){return Array.isArray(e.to)&&void 0===t.duration&&(t.duration=.8),function(t){Array.isArray(t.to)&&null===t.to[0]&&(t.to=[...t.to],t.to[0]=t.from)}(e),function({when:t,delay:e,delayChildren:n,staggerChildren:o,staggerDirection:i,repeat:r,repeatType:s,repeatDelay:a,from:l,...u}){return!!Object.keys(u).length}(t)||(t={...t,...So(n,e.to)}),{...e,...Ro(t)}}function Do(t,e,n,o,i){const r=ko(o,t)||{};let s=void 0!==r.from?r.from:e.get();const a=yo(t,n);"none"===s&&a&&"string"==typeof n?s=Vo(t,n):Oo(s)&&"string"==typeof n?s=Bo(n):!Array.isArray(n)&&Oo(n)&&"string"==typeof s&&(n=Bo(s));return yo(t,s)&&a&&!1!==r.type?function(){const o={from:s,to:n,velocity:e.getVelocity(),onComplete:i,onUpdate:t=>e.set(t)};return"inertia"===r.type||"decay"===r.type?function({from:t=0,velocity:e=0,min:n,max:o,power:i=.8,timeConstant:r=750,bounceStiffness:s=500,bounceDamping:a=10,restDelta:l=1,modifyTarget:u,driver:c,onUpdate:h,onComplete:d,onStop:p}){let f;function m(t){return void 0!==n&&t<n||void 0!==o&&t>o}function g(t){return void 0===n?o:void 0===o||Math.abs(n-t)<Math.abs(o-t)?n:o}function v(t){null==f||f.stop(),f=zn(Object.assign(Object.assign({},t),{driver:c,onUpdate:e=>{var n;null==h||h(e),null===(n=t.onUpdate)||void 0===n||n.call(t,e)},onComplete:d,onStop:p}))}function y(t){v(Object.assign({type:"spring",stiffness:s,damping:a,restDelta:l},t))}if(m(t))y({from:t,velocity:e,to:g(t)});else{let o=i*e+t;void 0!==u&&(o=u(o));const s=g(o),a=s===n?-1:1;let c,h;const d=t=>{c=h,h=t,e=Wn(t-c,In().delta),(1===a&&t>s||-1===a&&t<s)&&y({from:t,to:s,velocity:e})};v({type:"decay",from:t,velocity:e,timeConstant:r,power:i,restDelta:l,modifyTarget:u,onUpdate:m(o)?d:void 0})}return{stop:()=>null==f?void 0:f.stop()}}({...o,...r}):zn({...Lo(r,o,t),onUpdate:t=>{o.onUpdate(t),r.onUpdate&&r.onUpdate(t)},onComplete:()=>{o.onComplete(),r.onComplete&&r.onComplete()}})}:function(){const t=Qt(n);return e.set(t),i(),r.onUpdate&&r.onUpdate(t),r.onComplete&&r.onComplete(),{stop:()=>{}}}}function Oo(t){return 0===t||"string"==typeof t&&0===parseFloat(t)&&-1===t.indexOf(" ")}function Bo(t){return"number"==typeof t?0:Vo("",t)}function ko(t,e){return t[e]||t.default||t}function jo(t,e,n,o={}){return Co.current&&(o={type:!1}),e.start(i=>{let r;const s=Do(t,e,n,o,i),a=function(t,e){var n,o;return null!==(o=null!==(n=(ko(t,e)||{}).delay)&&void 0!==n?n:t.delay)&&void 0!==o?o:0}(o,t),l=()=>r=s();let u;return a?u=Mo(l,mo(a)):l(),()=>{u&&u(),r&&r.stop()}})}const Fo=t=>/^0[^.\s]+$/.test(t);function Io(t,e){-1===t.indexOf(e)&&t.push(e)}function Uo(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class No{constructor(){this.subscriptions=[]}add(t){return Io(this.subscriptions,t),()=>Uo(this.subscriptions,t)}notify(t,e,n){const o=this.subscriptions.length;if(o)if(1===o)this.subscriptions[0](t,e,n);else for(let i=0;i<o;i++){const o=this.subscriptions[i];o&&o(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}class zo{constructor(t){var e;this.version="7.6.13",this.timeDelta=0,this.lastUpdated=0,this.updateSubscribers=new No,this.velocityUpdateSubscribers=new No,this.renderSubscribers=new No,this.canTrackVelocity=!1,this.updateAndNotify=(t,e=!0)=>{this.prev=this.current,this.current=t;const{delta:n,timestamp:o}=In();this.lastUpdated!==o&&(this.timeDelta=n,this.lastUpdated=o,Dn.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.updateSubscribers.notify(this.current),this.velocityUpdateSubscribers.getSize()&&this.velocityUpdateSubscribers.notify(this.getVelocity()),e&&this.renderSubscribers.notify(this.current)},this.scheduleVelocityCheck=()=>Dn.postRender(this.velocityCheck),this.velocityCheck=({timestamp:t})=>{t!==this.lastUpdated&&(this.prev=this.current,this.velocityUpdateSubscribers.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e)))}onChange(t){return this.updateSubscribers.add(t)}clearListeners(){this.updateSubscribers.clear()}onRenderRequest(t){return t(this.get()),this.renderSubscribers.add(t)}attach(t){this.passiveEffect=t}set(t,e=!0){e&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?Wn(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.stopAnimation=t(e)}).then(()=>this.clearAnimation())}stop(){this.stopAnimation&&this.stopAnimation(),this.clearAnimation()}isAnimating(){return!!this.stopAnimation}clearAnimation(){this.stopAnimation=null}destroy(){this.updateSubscribers.clear(),this.renderSubscribers.clear(),this.stop()}}function Wo(t){return new zo(t)}const Ho=t=>e=>e.test(t),$o=[Q,rt,it,ot,at,st,{test:t=>"auto"===t,parse:t=>t}],Yo=t=>$o.find(Ho(t)),Xo=[...$o,gt,Et],Go=t=>Xo.find(Ho(t));function qo(t,e,n){const o=t.getProps();return _t(o,e,void 0!==n?n:o.custom,function(t){const e={};return t.values.forEach((t,n)=>e[n]=t.get()),e}(t),function(t){const e={};return t.values.forEach((t,n)=>e[n]=t.getVelocity()),e}(t))}function Zo(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Wo(n))}function Ko(t,e){const n=qo(t,e);let{transitionEnd:o={},transition:i={},...r}=n?t.makeTargetAnimatable(n,!1):{};r={...r,...o};for(const e in r){Zo(t,e,Qt(r[e]))}}function _o(t,e){[...e].reverse().forEach(n=>{var o;const i=t.getVariant(n);i&&Ko(t,i),null===(o=t.variantChildren)||void 0===o||o.forEach(t=>{_o(t,e)})})}function Jo(t,e,n){var o,i;const r=Object.keys(e).filter(e=>!t.hasValue(e)),s=r.length;if(s)for(let a=0;a<s;a++){const s=r[a],l=e[s];let u=null;Array.isArray(l)&&(u=l[0]),null===u&&(u=null!==(i=null!==(o=n[s])&&void 0!==o?o:t.readValue(s))&&void 0!==i?i:e[s]),null!=u&&("string"==typeof u&&(/^\-?\d*\.?\d+$/.test(u)||Fo(u))?u=parseFloat(u):!Go(u)&&Et.test(l)&&(u=Vo(s,l)),t.addValue(s,Wo(u)),void 0===n[s]&&(n[s]=u),null!==u&&t.setBaseTarget(s,u))}}function Qo(t,e){if(!e)return;return(e[t]||e.default||e).from}function ti(t,e,n){var o;const i={};for(const r in t){const t=Qo(r,e);i[r]=void 0!==t?t:null===(o=n.getValue(r))||void 0===o?void 0:o.get()}return i}function ei(t){return Boolean(z(t)&&t.add)}function ni(t,e,n={}){let o;if(t.notify("AnimationStart",e),Array.isArray(e)){const i=e.map(e=>oi(t,e,n));o=Promise.all(i)}else if("string"==typeof e)o=oi(t,e,n);else{const i="function"==typeof e?qo(t,e,n.custom):e;o=ii(t,i,n)}return o.then(()=>t.notify("AnimationComplete",e))}function oi(t,e,n={}){var o;const i=qo(t,e,n.custom);let{transition:r=t.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(r=n.transitionOverride);const s=i?()=>ii(t,i,n):()=>Promise.resolve(),a=(null===(o=t.variantChildren)||void 0===o?void 0:o.size)?(o=0)=>{const{delayChildren:i=0,staggerChildren:s,staggerDirection:a}=r;return function(t,e,n=0,o=0,i=1,r){const s=[],a=(t.variantChildren.size-1)*o,l=1===i?(t=0)=>t*o:(t=0)=>a-t*o;return Array.from(t.variantChildren).sort(ri).forEach((t,o)=>{s.push(oi(t,e,{...r,delay:n+l(o)}).then(()=>t.notify("AnimationComplete",e)))}),Promise.all(s)}(t,e,i+o,s,a,n)}:()=>Promise.resolve(),{when:l}=r;if(l){const[t,e]="beforeChildren"===l?[s,a]:[a,s];return t().then(e)}return Promise.all([s(),a(n.delay)])}function ii(t,e,{delay:n=0,transitionOverride:o,type:i}={}){var r;let{transition:s=t.getDefaultTransition(),transitionEnd:a,...l}=t.makeTargetAnimatable(e);const u=t.getValue("willChange");o&&(s=o);const c=[],h=i&&(null===(r=t.animationState)||void 0===r?void 0:r.getState()[i]);for(const e in l){const o=t.getValue(e),i=l[e];if(!o||void 0===i||h&&si(h,e))continue;let r={delay:n,...s};t.shouldReduceMotion&&U.has(e)&&(r={...r,type:!1,delay:0});let a=jo(e,o,i,r);ei(u)&&(u.add(e),a=a.then(()=>u.remove(e))),c.push(a)}return Promise.all(c).then(()=>{a&&Ko(t,a)})}function ri(t,e){return t.sortNodePosition(e)}function si({protectedKeys:t,needsAnimating:e},n){const o=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,o}const ai=[t.AnimationType.Animate,t.AnimationType.InView,t.AnimationType.Focus,t.AnimationType.Hover,t.AnimationType.Tap,t.AnimationType.Drag,t.AnimationType.Exit],li=[...ai].reverse(),ui=ai.length;function ci(e){let n=function(t){return e=>Promise.all(e.map(({animation:e,options:n})=>ni(t,e,n)))}(e);const o={[t.AnimationType.Animate]:di(!0),[t.AnimationType.InView]:di(),[t.AnimationType.Hover]:di(),[t.AnimationType.Tap]:di(),[t.AnimationType.Drag]:di(),[t.AnimationType.Focus]:di(),[t.AnimationType.Exit]:di()};let i=!0;const r=(t,n)=>{const o=qo(e,n);if(o){const{transition:e,transitionEnd:n,...i}=o;t={...t,...i,...n}}return t};function s(t,s){var a;const l=e.getProps(),u=e.getVariantContext(!0)||{},c=[],h=new Set;let d={},p=1/0;for(let n=0;n<ui;n++){const g=li[n],v=o[g],y=null!==(a=l[g])&&void 0!==a?a:u[g],x=f(y),b=g===s?v.isActive:null;!1===b&&(p=n);let E=y===u[g]&&y!==l[g]&&x;if(E&&i&&e.manuallyAnimateOnMount&&(E=!1),v.protectedKeys={...d},!v.isActive&&null===b||!y&&!v.prevProp||m(y)||"boolean"==typeof y)continue;const w=hi(v.prevProp,y);let P=w||g===s&&v.isActive&&!E&&x||n>p&&x;const S=Array.isArray(y)?y:[y];let T=S.reduce(r,{});!1===b&&(T={});const{prevResolvedValues:A={}}=v,V={...A,...T},C=t=>{P=!0,h.delete(t),v.needsAnimating[t]=!0};for(const t in V){const e=T[t],n=A[t];d.hasOwnProperty(t)||(e!==n?Jt(e)&&Jt(n)?!fo(e,n)||w?C(t):v.protectedKeys[t]=!0:void 0!==e?C(t):h.add(t):void 0!==e&&h.has(t)?C(t):v.protectedKeys[t]=!0)}v.prevProp=y,v.prevResolvedValues=T,v.isActive&&(d={...d,...T}),i&&e.blockInitialAnimation&&(P=!1),P&&!E&&c.push(...S.map(e=>({animation:e,options:{type:g,...t}})))}if(h.size){const t={};h.forEach(n=>{const o=e.getBaseTarget(n);void 0!==o&&(t[n]=o)}),c.push({animation:t})}let g=Boolean(c.length);return i&&!1===l.initial&&!e.manuallyAnimateOnMount&&(g=!1),i=!1,g?n(c):Promise.resolve()}return{animateChanges:s,setActive:function(t,n,i){var r;if(o[t].isActive===n)return Promise.resolve();null===(r=e.variantChildren)||void 0===r||r.forEach(e=>{var o;return null===(o=e.animationState)||void 0===o?void 0:o.setActive(t,n)}),o[t].isActive=n;const a=s(i,t);for(const t in o)o[t].protectedKeys={};return a},setAnimateFunction:function(t){n=t(e)},getState:()=>o}}function hi(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!fo(e,t)}function di(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}const pi={animation:co(({visualElement:t,animate:n})=>{t.animationState||(t.animationState=ci(t)),m(n)&&e.useEffect(()=>n.subscribe(t),[n])}),exit:co(n=>{const{custom:o,visualElement:i}=n,[r,s]=po(),a=e.useContext(u);e.useEffect(()=>{i.isPresent=r;const e=i.animationState&&i.animationState.setActive(t.AnimationType.Exit,!r,{custom:a&&a.custom||o});e&&!r&&e.then(s)},[r])})};class fi{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=vi(this.lastMoveEventInfo,this.history),e=null!==this.startEvent,n=Xn(t.offset,{x:0,y:0})>=3;if(!e&&!n)return;const{point:o}=t,{timestamp:i}=In();this.history.push({...o,timestamp:i});const{onStart:r,onMove:s}=this.handlers;e||(r&&r(this.lastMoveEvent,t),this.startEvent=this.lastMoveEvent),s&&s(this.lastMoveEvent,t)},this.handlePointerMove=(t,e)=>{this.lastMoveEvent=t,this.lastMoveEventInfo=mi(e,this.transformPagePoint),ue(t)&&0===t.buttons?this.handlePointerUp(t,e):Dn.update(this.updatePoint,!0)},this.handlePointerUp=(t,e)=>{this.end();const{onEnd:n,onSessionEnd:o}=this.handlers,i=vi(mi(e,this.transformPagePoint),this.history);this.startEvent&&n&&n(t,i),o&&o(t,i)},ce(t)&&t.touches.length>1)return;this.handlers=e,this.transformPagePoint=n;const o=mi(fe(t),this.transformPagePoint),{point:i}=o,{timestamp:r}=In();this.history=[{...i,timestamp:r}];const{onSessionStart:s}=e;s&&s(t,vi(o,this.history)),this.removeListeners=qe(xe(window,"pointermove",this.handlePointerMove),xe(window,"pointerup",this.handlePointerUp),xe(window,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),On.update(this.updatePoint)}}function mi(t,e){return e?{point:e(t.point)}:t}function gi(t,e){return{x:t.x-e.x,y:t.y-e.y}}function vi({point:t},e){return{point:t,delta:gi(t,xi(e)),offset:gi(t,yi(e)),velocity:bi(e,.1)}}function yi(t){return t[0]}function xi(t){return t[t.length-1]}function bi(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,o=null;const i=xi(t);for(;n>=0&&(o=t[n],!(i.timestamp-o.timestamp>mo(e)));)n--;if(!o)return{x:0,y:0};const r=(i.timestamp-o.timestamp)/1e3;if(0===r)return{x:0,y:0};const s={x:(i.x-o.x)/r,y:(i.y-o.y)/r};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}function Ei(t){return t.max-t.min}function wi(t,e=0,n=.01){return Xn(t,e)<n}function Pi(t,e,n,o=.5){t.origin=o,t.originPoint=Ue(e.min,e.max,t.origin),t.scale=Ei(n)/Ei(e),(wi(t.scale,1,1e-4)||isNaN(t.scale))&&(t.scale=1),t.translate=Ue(n.min,n.max,t.origin)-t.originPoint,(wi(t.translate)||isNaN(t.translate))&&(t.translate=0)}function Si(t,e,n,o){Pi(t.x,e.x,n.x,null==o?void 0:o.originX),Pi(t.y,e.y,n.y,null==o?void 0:o.originY)}function Ti(t,e,n){t.min=n.min+e.min,t.max=t.min+Ei(e)}function Ai(t,e,n){t.min=e.min-n.min,t.max=t.min+Ei(e)}function Vi(t,e,n){Ai(t.x,e.x,n.x),Ai(t.y,e.y,n.y)}function Ci(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 Mi(t,e){let n=e.min-t.min,o=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,o]=[o,n]),{min:n,max:o}}const Ri=.35;function Li(t,e,n){return{min:Di(t,e),max:Di(t,n)}}function Di(t,e){var n;return"number"==typeof t?t:null!==(n=t[e])&&void 0!==n?n:0}const Oi=()=>({x:{min:0,max:0},y:{min:0,max:0}});function Bi(t){return[t("x"),t("y")]}function ki({top:t,left:e,right:n,bottom:o}){return{x:{min:e,max:n},y:{min:t,max:o}}}function ji(t){return void 0===t||1===t}function Fi({scale:t,scaleX:e,scaleY:n}){return!ji(t)||!ji(e)||!ji(n)}function Ii(t){return Fi(t)||Ui(t)||t.z||t.rotate||t.rotateX||t.rotateY}function Ui(t){return Ni(t.x)||Ni(t.y)}function Ni(t){return t&&"0%"!==t}function zi(t,e,n){return n+e*(t-n)}function Wi(t,e,n,o,i){return void 0!==i&&(t=zi(t,i,o)),zi(t,n,o)+e}function Hi(t,e=0,n=1,o,i){t.min=Wi(t.min,e,n,o,i),t.max=Wi(t.max,e,n,o,i)}function $i(t,{x:e,y:n}){Hi(t.x,e.translate,e.scale,e.originPoint),Hi(t.y,n.translate,n.scale,n.originPoint)}function Yi(t,e){t.min=t.min+e,t.max=t.max+e}function Xi(t,e,[n,o,i]){const r=void 0!==e[i]?e[i]:.5,s=Ue(t.min,t.max,r);Hi(t,e[n],e[o],s,e.scale)}const Gi=["x","scaleX","originX"],qi=["y","scaleY","originY"];function Zi(t,e){Xi(t.x,e,Gi),Xi(t.y,e,qi)}function Ki(t,e){return ki(function(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),o=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:o.y,right:o.x}}(t.getBoundingClientRect(),e))}const _i=new WeakMap;class Ji{constructor(t){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic={x:{min:0,max:0},y:{min:0,max:0}},this.visualElement=t}start(e,{snapToCursor:n=!1}={}){if(!1===this.visualElement.isPresent)return;this.panSession=new fi(e,{onSessionStart:t=>{this.stopAnimation(),n&&this.snapToCursor(fe(t,"page").point)},onStart:(e,n)=>{var o;const{drag:i,dragPropagation:r,onDragStart:s}=this.getProps();(!i||r||(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=Se(i),this.openGlobalLock))&&(this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Bi(t=>{var e,n;let o=this.getAxisMotionValue(t).get()||0;if(it.test(o)){const i=null===(n=null===(e=this.visualElement.projection)||void 0===e?void 0:e.layout)||void 0===n?void 0:n.layoutBox[t];if(i){o=Ei(i)*(parseFloat(o)/100)}}this.originPoint[t]=o}),null==s||s(e,n),null===(o=this.visualElement.animationState)||void 0===o||o.setActive(t.AnimationType.Drag,!0))},onMove:(t,e)=>{const{dragPropagation:n,dragDirectionLock:o,onDirectionLock:i,onDrag:r}=this.getProps();if(!n&&!this.openGlobalLock)return;const{offset:s}=e;if(o&&null===this.currentDirection)return this.currentDirection=function(t,e=10){let n=null;Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x");return n}(s),void(null!==this.currentDirection&&(null==i||i(this.currentDirection)));this.updateAxis("x",e.point,s),this.updateAxis("y",e.point,s),this.visualElement.render(),null==r||r(t,e)},onSessionEnd:(t,e)=>this.stop(t,e)},{transformPagePoint:this.visualElement.getTransformPagePoint()})}stop(t,e){const n=this.isDragging;if(this.cancel(),!n)return;const{velocity:o}=e;this.startAnimation(o);const{onDragEnd:i}=this.getProps();null==i||i(t,e)}cancel(){var e,n;this.isDragging=!1,this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!1),null===(e=this.panSession)||void 0===e||e.end(),this.panSession=void 0;const{dragPropagation:o}=this.getProps();!o&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),null===(n=this.visualElement.animationState)||void 0===n||n.setActive(t.AnimationType.Drag,!1)}updateAxis(t,e,n){const{drag:o}=this.getProps();if(!n||!Qi(t,o,this.currentDirection))return;const i=this.getAxisMotionValue(t);let r=this.originPoint[t]+n[t];this.constraints&&this.constraints[t]&&(r=function(t,{min:e,max:n},o){return void 0!==e&&t<e?t=o?Ue(e,t,o.min):Math.max(t,e):void 0!==n&&t>n&&(t=o?Ue(n,t,o.max):Math.min(t,n)),t}(r,this.constraints[t],this.elastic[t])),i.set(r)}resolveConstraints(){const{dragConstraints:t,dragElastic:e}=this.getProps(),{layout:n}=this.visualElement.projection||{},o=this.constraints;t&&p(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!n)&&function(t,{top:e,left:n,bottom:o,right:i}){return{x:Ci(t.x,n,i),y:Ci(t.y,e,o)}}(n.layoutBox,t),this.elastic=function(t=Ri){return!1===t?t=0:!0===t&&(t=Ri),{x:Li(t,"left","right"),y:Li(t,"top","bottom")}}(e),o!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&Bi(t=>{this.getAxisMotionValue(t)&&(this.constraints[t]=function(t,e){const n={};return void 0!==e.min&&(n.min=e.min-t.min),void 0!==e.max&&(n.max=e.max-t.min),n}(n.layoutBox[t],this.constraints[t]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:e}=this.getProps();if(!t||!p(t))return!1;const n=t.current,{projection:o}=this.visualElement;if(!o||!o.layout)return!1;const i=function(t,e,n){const o=Ki(t,n),{scroll:i}=e;return i&&(Yi(o.x,i.offset.x),Yi(o.y,i.offset.y)),o}(n,o.root,this.visualElement.getTransformPagePoint());let r=function(t,e){return{x:Mi(t.x,e.x),y:Mi(t.y,e.y)}}(o.layout.layoutBox,i);if(e){const t=e(function({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}(r));this.hasMutatedConstraints=!!t,t&&(r=ki(t))}return r}startAnimation(t){const{drag:e,dragMomentum:n,dragElastic:o,dragTransition:i,dragSnapToOrigin:r,onDragTransitionEnd:s}=this.getProps(),a=this.constraints||{},l=Bi(s=>{var l;if(!Qi(s,e,this.currentDirection))return;let u=null!==(l=null==a?void 0:a[s])&&void 0!==l?l:{};r&&(u={min:0,max:0});const c=o?200:1e6,h=o?40:1e7,d={type:"inertia",velocity:n?t[s]:0,bounceStiffness:c,bounceDamping:h,timeConstant:750,restDelta:1,restSpeed:10,...i,...u};return this.startAxisValueAnimation(s,d)});return Promise.all(l).then(s)}startAxisValueAnimation(t,e){return jo(t,this.getAxisMotionValue(t),0,e)}stopAnimation(){Bi(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){var e,n;const o="_drag"+t.toUpperCase(),i=this.visualElement.getProps()[o];return i||this.visualElement.getValue(t,null!==(n=null===(e=this.visualElement.getProps().initial)||void 0===e?void 0:e[t])&&void 0!==n?n:0)}snapToCursor(t){Bi(e=>{const{drag:n}=this.getProps();if(!Qi(e,n,this.currentDirection))return;const{projection:o}=this.visualElement,i=this.getAxisMotionValue(e);if(o&&o.layout){const{min:n,max:r}=o.layout.layoutBox[e];i.set(t[e]-Ue(n,r,.5))}})}scalePositionWithinConstraints(){var t;if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:o}=this.visualElement;if(!p(n)||!o||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Bi(t=>{const e=this.getAxisMotionValue(t);if(e){const n=e.get();i[t]=function(t,e){let n=.5;const o=Ei(t),i=Ei(e);return i>o?n=Ie(e.min,e.max-o,t.min):o>i&&(n=Ie(t.min,t.max-i,e.min)),Re(0,1,n)}({min:n,max:n},this.constraints[t])}});const{transformTemplate:r}=this.visualElement.getProps();this.visualElement.current.style.transform=r?r({},""):"none",null===(t=o.root)||void 0===t||t.updateScroll(),o.updateLayout(),this.resolveConstraints(),Bi(t=>{if(!Qi(t,e,null))return;const n=this.getAxisMotionValue(t),{min:o,max:r}=this.constraints[t];n.set(Ue(o,r,i[t]))})}addListeners(){var t;if(!this.visualElement.current)return;_i.set(this.visualElement,this);const e=xe(this.visualElement.current,"pointerdown",t=>{const{drag:e,dragListener:n=!0}=this.getProps();e&&n&&this.start(t)}),n=()=>{const{dragConstraints:t}=this.getProps();p(t)&&(this.constraints=this.resolveRefConstraints())},{projection:o}=this.visualElement,i=o.addEventListener("measure",n);o&&!o.layout&&(null===(t=o.root)||void 0===t||t.updateScroll(),o.updateLayout()),n();const r=ae(window,"resize",()=>this.scalePositionWithinConstraints()),s=o.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e})=>{this.isDragging&&e&&(Bi(e=>{const n=this.getAxisMotionValue(e);n&&(this.originPoint[e]+=t[e].translate,n.set(n.get()+t[e].translate))}),this.visualElement.render())});return()=>{r(),e(),i(),null==s||s()}}getProps(){const t=this.visualElement.getProps(),{drag:e=!1,dragDirectionLock:n=!1,dragPropagation:o=!1,dragConstraints:i=!1,dragElastic:r=Ri,dragMomentum:s=!0}=t;return{...t,drag:e,dragDirectionLock:n,dragPropagation:o,dragConstraints:i,dragElastic:r,dragMomentum:s}}}function Qi(t,e,n){return!(!0!==e&&e!==t||null!==n&&n!==t)}const tr={pan:co((function({onPan:t,onPanStart:n,onPanEnd:o,onPanSessionStart:i,visualElement:r}){const a=t||n||o||i,l=e.useRef(null),{transformPagePoint:u}=e.useContext(s),c={onSessionStart:i,onStart:n,onMove:t,onEnd:(t,e)=>{l.current=null,o&&o(t,e)}};e.useEffect(()=>{null!==l.current&&l.current.updateHandlers(c)}),be(r,"pointerdown",a&&function(t){l.current=new fi(t,c,{transformPagePoint:u})}),Ce(()=>l.current&&l.current.end())})),drag:co((function(t){const{dragControls:n,visualElement:o}=t,i=S(()=>new Ji(o));e.useEffect(()=>n&&n.subscribe(i),[i,n]),e.useEffect(()=>i.addListeners(),[i])}))};function er(t){return"string"==typeof t&&t.startsWith("var(--")}const nr=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function or(t,e,n=1){const[o,i]=function(t){const e=nr.exec(t);if(!e)return[,];const[,n,o]=e;return[n,o]}(t);if(!o)return;const r=window.getComputedStyle(e).getPropertyValue(o);return r?r.trim():er(i)?or(i,e,n+1):i}const ir=new Set(["width","height","top","left","right","bottom","x","y"]),rr=t=>ir.has(t),sr=(t,e)=>{t.set(e,!1),t.set(e)},ar=t=>t===Q||t===rt;var lr;!function(t){t.width="width",t.height="height",t.left="left",t.right="right",t.top="top",t.bottom="bottom"}(lr||(lr={}));const ur=(t,e)=>parseFloat(t.split(", ")[e]),cr=(t,e)=>(n,{transform:o})=>{if("none"===o||!o)return 0;const i=o.match(/^matrix3d\((.+)\)$/);if(i)return ur(i[1],e);{const e=o.match(/^matrix\((.+)\)$/);return e?ur(e[1],t):0}},hr=new Set(["x","y","z"]),dr=I.filter(t=>!hr.has(t));const pr={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:cr(4,13),y:cr(5,14)},fr=(t,e,n={},o={})=>{e={...e},o={...o};const i=Object.keys(e).filter(rr);let r=[],s=!1;const a=[];if(i.forEach(i=>{const l=t.getValue(i);if(!t.hasValue(i))return;let u=n[i],c=Yo(u);const h=e[i];let d;if(Jt(h)){const t=h.length,e=null===h[0]?1:0;u=h[e],c=Yo(u);for(let n=e;n<t;n++)d?Yo(h[n]):d=Yo(h[n])}else d=Yo(h);if(c!==d)if(ar(c)&&ar(d)){const t=l.get();"string"==typeof t&&l.set(parseFloat(t)),"string"==typeof h?e[i]=parseFloat(h):Array.isArray(h)&&d===rt&&(e[i]=h.map(parseFloat))}else(null==c?void 0:c.transform)&&(null==d?void 0:d.transform)&&(0===u||0===h)?0===u?l.set(d.transform(u)):e[i]=c.transform(h):(s||(r=function(t){const e=[];return dr.forEach(n=>{const o=t.getValue(n);void 0!==o&&(e.push([n,o.get()]),o.set(n.startsWith("scale")?1:0))}),e.length&&t.render(),e}(t),s=!0),a.push(i),o[i]=void 0!==o[i]?o[i]:e[i],sr(l,h))}),a.length){const n=a.indexOf("height")>=0?window.pageYOffset:null,i=((t,e,n)=>{const o=e.measureViewportBox(),i=e.current,r=getComputedStyle(i),{display:s}=r,a={};"none"===s&&e.setStaticValue("display",t.display||"block"),n.forEach(t=>{a[t]=pr[t](o,r)}),e.render();const l=e.measureViewportBox();return n.forEach(n=>{const o=e.getValue(n);sr(o,a[n]),t[n]=pr[n](l,r)}),t})(e,t,a);return r.length&&r.forEach(([e,n])=>{t.getValue(e).set(n)}),t.render(),c&&null!==n&&window.scrollTo({top:n}),{target:i,transitionEnd:o}}return{target:e,transitionEnd:o}};function mr(t,e,n,o){return(t=>Object.keys(t).some(rr))(e)?fr(t,e,n,o):{target:e,transitionEnd:o}}const gr=(t,e,n,o)=>{const i=function(t,{...e},n){const o=t.current;if(!(o instanceof Element))return{target:e,transitionEnd:n};n&&(n={...n}),t.values.forEach(t=>{const e=t.get();if(!er(e))return;const n=or(e,o);n&&t.set(n)});for(const t in e){const i=e[t];if(!er(i))continue;const r=or(i,o);r&&(e[t]=r,n&&void 0===n[t]&&(n[t]=i))}return{target:e,transitionEnd:n}}(t,e,o);return mr(t,e=i.target,n,o=i.transitionEnd)},vr={current:null},yr={current:!1};function xr(){if(yr.current=!0,c)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>vr.current=t.matches;t.addListener(e),e()}else vr.current=!1}const br=Object.keys(w),Er=br.length,wr=["AnimationStart","AnimationComplete","Update","Unmount","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Pr{constructor({parent:t,props:e,reducedMotionConfig:n,visualState:o},i={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.isPresent=!0,this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.scheduleRender=()=>Dn.render(this.render,!1,!0);const{latestValues:r,renderState:s}=o;this.latestValues=r,this.baseTarget={...r},this.initialValues=e.initial?{...r}:{},this.renderState=s,this.parent=t,this.props=e,this.depth=t?t.depth+1:0,this.reducedMotionConfig=n,this.options=i,this.isControllingVariants=v(e),this.isVariantNode=y(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:a,...l}=this.scrapeMotionValuesFromProps(e);for(const t in l){const e=l[t];void 0!==r[t]&&z(e)&&(e.set(r[t],!1),ei(a)&&a.add(t))}if(e.values)for(const t in e.values){const n=e.values[t];void 0!==r[t]&&z(n)&&n.set(r[t])}}scrapeMotionValuesFromProps(t){return{}}mount(t){var e;this.current=t,this.projection&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=null===(e=this.parent)||void 0===e?void 0:e.addVariantChild(this)),this.values.forEach((t,e)=>this.bindToMotionValue(e,t)),yr.current||xr(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||vr.current),this.parent&&this.parent.children.add(this),this.setProps(this.props)}unmount(){var t,e,n;null===(t=this.projection)||void 0===t||t.unmount(),On.update(this.notifyUpdate),On.render(this.render),this.valueSubscriptions.forEach(t=>t()),null===(e=this.removeFromVariantTree)||void 0===e||e.call(this),null===(n=this.parent)||void 0===n||n.children.delete(this);for(const t in this.events)this.events[t].clear();this.current=null}bindToMotionValue(t,e){const n=U.has(t),o=e.onChange(e=>{this.latestValues[t]=e,this.props.onUpdate&&Dn.update(this.notifyUpdate,!1,!0),n&&this.projection&&(this.projection.isTransformDirty=!0)}),i=e.onRenderRequest(this.scheduleRender);this.valueSubscriptions.set(t,()=>{o(),i()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}loadFeatures(t,n,o,i,r,s){const a=[];for(let n=0;n<Er;n++){const o=br[n],{isEnabled:i,Component:r}=w[o];i(t)&&r&&a.push(e.createElement(r,{key:o,...t,visualElement:this}))}if(!this.projection&&r){this.projection=new r(i,this.latestValues,this.parent&&this.parent.projection);const{layoutId:e,layout:n,drag:o,dragConstraints:a,layoutScroll:l}=t;this.projection.setOptions({layoutId:e,layout:n,alwaysMeasureLayout:Boolean(o)||a&&p(a),visualElement:this,scheduleRender:()=>this.scheduleRender(),animationType:"string"==typeof n?n:"both",initialPromotionConfig:s,layoutScroll:l})}return a}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}makeTargetAnimatable(t,e=!0){return this.makeTargetAnimatableFromInstance(t,this.props,e)}setProps(t){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.props=t;for(let e=0;e<wr.length;e++){const n=wr[e];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);const o=t["on"+n];o&&(this.propEventSubscriptions[n]=this.on(n,o))}this.prevMotionValues=function(t,e,n){const{willChange:o}=e;for(const i in e){const r=e[i],s=n[i];if(z(r))t.addValue(i,r),ei(o)&&o.add(i);else if(z(s))t.addValue(i,Wo(r)),ei(o)&&o.remove(i);else if(s!==r)if(t.hasValue(i)){const e=t.getValue(i);!e.hasAnimated&&e.set(r)}else{const e=t.getStaticValue(i);t.addValue(i,Wo(void 0!==e?e:r))}}for(const o in n)void 0===e[o]&&t.removeValue(o);return e}(this,this.scrapeMotionValuesFromProps(t),this.prevMotionValues)}getProps(){return this.props}getVariant(t){var e;return null===(e=this.props.variants)||void 0===e?void 0:e[t]}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){var t;return this.isVariantNode?this:null===(t=this.parent)||void 0===t?void 0:t.getClosestVariantNode()}getVariantContext(t=!1){var e,n;if(t)return null===(e=this.parent)||void 0===e?void 0:e.getVariantContext();if(!this.isControllingVariants){const t=(null===(n=this.parent)||void 0===n?void 0:n.getVariantContext())||{};return void 0!==this.props.initial&&(t.initial=this.props.initial),t}const o={};for(let t=0;t<Tr;t++){const e=Sr[t],n=this.props[e];(f(n)||!1===n)&&(o[e]=n)}return o}addVariantChild(t){var e;const n=this.getClosestVariantNode();if(n)return null===(e=n.variantChildren)||void 0===e||e.add(t),()=>n.variantChildren.delete(t)}addValue(t,e){this.hasValue(t)&&this.removeValue(t),this.values.set(t,e),this.latestValues[t]=e.get(),this.bindToMotionValue(t,e)}removeValue(t){var e;this.values.delete(t),null===(e=this.valueSubscriptions.get(t))||void 0===e||e(),this.valueSubscriptions.delete(t),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return void 0===n&&void 0!==e&&(n=Wo(e),this.addValue(t,n)),n}readValue(t){return void 0===this.latestValues[t]&&this.current?this.readValueFromInstance(this.current,t,this.options):this.latestValues[t]}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){var e;const{initial:n}=this.props,o="string"==typeof n||"object"==typeof n?null===(e=_t(this.props,n))||void 0===e?void 0:e[t]:void 0;if(n&&void 0!==o)return o;const i=this.getBaseTargetFromProps(this.props,t);return void 0===i||z(i)?void 0!==this.initialValues[t]&&void 0===o?void 0:this.baseTarget[t]:i}on(t,e){return this.events[t]||(this.events[t]=new No),this.events[t].add(e)}notify(t,...e){var n;null===(n=this.events[t])||void 0===n||n.notify(...e)}}const Sr=["initial",...ai],Tr=Sr.length;class Ar extends Pr{sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){var n;return null===(n=t.style)||void 0===n?void 0:n[e]}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}makeTargetAnimatableFromInstance({transition:t,transitionEnd:e,...n},{transformValues:o},i){let r=ti(n,t||{},this);if(o&&(e&&(e=o(e)),n&&(n=o(n)),r&&(r=o(r))),i){Jo(this,n,r);const t=gr(this,n,r,e);e=t.transitionEnd,n=t.target}return{transition:t,transitionEnd:e,...n}}}class Vr extends Ar{readValueFromInstance(t,e){if(U.has(e)){const t=Ao(e);return t&&t.default||0}{const o=(n=t,window.getComputedStyle(n)),i=(Y(e)?o.getPropertyValue(e):o[e])||0;return"string"==typeof i?i.trim():i}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return Ki(t,e)}build(t,e,n,o){Ct(t,e,n,o.transformTemplate)}scrapeMotionValuesFromProps(t){return Zt(t)}renderInstance(t,e,n,o){Xt(t,e,n,o)}}class Cr extends Ar{getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){var n;return U.has(e)?(null===(n=Ao(e))||void 0===n?void 0:n.default)||0:(e=Gt.has(e)?e:Yt(e),t.getAttribute(e))}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}scrapeMotionValuesFromProps(t){return Kt(t)}build(t,e,n,o){zt(t,e,n,o.transformTemplate)}renderInstance(t,e,n,o){qt(t,e,0,o)}}const Mr=(t,e)=>k(t)?new Cr(e,{enableHardwareAcceleration:!1}):new Vr(e,{enableHardwareAcceleration:!0});function Rr(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Lr={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!rt.test(t))return t;t=parseFloat(t)}return`${Rr(t,e.target.x)}% ${Rr(t,e.target.y)}%`}},Dr={correct:(t,{treeScale:e,projectionDelta:n})=>{const o=t,i=t.includes("var("),r=[];i&&(t=t.replace(nr,t=>(r.push(t),"_$css")));const s=Et.parse(t);if(s.length>5)return o;const a=Et.createTransformer(t),l="number"!=typeof s[0]?1:0,u=n.x.scale*e.x,c=n.y.scale*e.y;s[0+l]/=u,s[1+l]/=c;const h=Ue(u,c,.5);"number"==typeof s[2+l]&&(s[2+l]/=h),"number"==typeof s[3+l]&&(s[3+l]/=h);let d=a(s);if(i){let t=0;d=d.replace("_$css",()=>{const e=r[t];return t++,e})}return d}};class Or extends i.default.Component{componentDidMount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n,layoutId:o}=this.props,{projection:i}=t;F(Br),i&&(e.group&&e.group.add(i),n&&n.register&&o&&n.register(i),i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,onExitComplete:()=>this.safeToRemove()})),T.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:e,visualElement:n,drag:o,isPresent:i}=this.props,r=n.projection;return r?(r.isPresent=i,o||t.layoutDependency!==e||void 0===e?r.willUpdate():this.safeToRemove(),t.isPresent!==i&&(i?r.promote():r.relegate()||Dn.postRender(()=>{var t;(null===(t=r.getStack())||void 0===t?void 0:t.members.length)||this.safeToRemove()})),null):null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),!t.currentAnimation&&t.isLead()&&this.safeToRemove())}componentWillUnmount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n}=this.props,{projection:o}=t;o&&(o.scheduleCheckAfterUnmount(),(null==e?void 0:e.group)&&e.group.remove(o),(null==n?void 0:n.deregister)&&n.deregister(o))}safeToRemove(){const{safeToRemove:t}=this.props;null==t||t()}render(){return null}}const Br={borderRadius:{...Lr,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Lr,borderTopRightRadius:Lr,borderBottomLeftRadius:Lr,borderBottomRightRadius:Lr,boxShadow:Dr},kr={measureLayout:function(t){const[n,o]=po(),r=e.useContext(V);return i.default.createElement(Or,{...t,layoutGroup:r,switchLayoutGroup:e.useContext(M),isPresent:n,safeToRemove:o})}};function jr(t,e,n={}){const o=z(t)?t:Wo(t);return jo("",o,e,n),{stop:()=>o.stop(),isAnimating:()=>o.isAnimating()}}const Fr=["TopLeft","TopRight","BottomLeft","BottomRight"],Ir=Fr.length,Ur=t=>"string"==typeof t?parseFloat(t):t,Nr=t=>"number"==typeof t||rt.test(t);function zr(t,e){var n;return null!==(n=t[e])&&void 0!==n?n:t.borderRadius}const Wr=$r(0,.5,pn),Hr=$r(.5,.95,an);function $r(t,e,n){return o=>o<t?0:o>e?1:n(Ie(t,e,o))}function Yr(t,e){t.min=e.min,t.max=e.max}function Xr(t,e){Yr(t.x,e.x),Yr(t.y,e.y)}function Gr(t,e,n,o,i){return t=zi(t-=e,1/n,o),void 0!==i&&(t=zi(t,1/i,o)),t}function qr(t,e,[n,o,i],r,s){!function(t,e=0,n=1,o=.5,i,r=t,s=t){if(it.test(e)){e=parseFloat(e);e=Ue(s.min,s.max,e/100)-s.min}if("number"!=typeof e)return;let a=Ue(r.min,r.max,o);t===r&&(a-=e),t.min=Gr(t.min,e,n,a,i),t.max=Gr(t.max,e,n,a,i)}(t,e[n],e[o],e[i],e.scale,r,s)}const Zr=["x","scaleX","originX"],Kr=["y","scaleY","originY"];function _r(t,e,n,o){qr(t.x,e,Zr,null==n?void 0:n.x,null==o?void 0:o.x),qr(t.y,e,Kr,null==n?void 0:n.y,null==o?void 0:o.y)}function Jr(t){return 0===t.translate&&1===t.scale}function Qr(t){return Jr(t.x)&&Jr(t.y)}function ts(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 es(t){return Ei(t.x)/Ei(t.y)}class ns{constructor(){this.members=[]}add(t){Io(this.members,t),t.scheduleRender()}remove(t){if(Uo(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const t=this.members[this.members.length-1];t&&this.promote(t)}}relegate(t){const e=this.members.findIndex(e=>t===e);if(0===e)return!1;let n;for(let t=e;t>=0;t--){const e=this.members[t];if(!1!==e.isPresent){n=e;break}}return!!n&&(this.promote(n),!0)}promote(t,e){var n;const o=this.lead;if(t!==o&&(this.prevLead=o,this.lead=t,t.show(),o)){o.instance&&o.scheduleRender(),t.scheduleRender(),t.resumeFrom=o,e&&(t.resumeFrom.preserveOpacity=!0),o.snapshot&&(t.snapshot=o.snapshot,t.snapshot.latestValues=o.animationValues||o.latestValues),(null===(n=t.root)||void 0===n?void 0:n.isUpdating)&&(t.isLayoutDirty=!0);const{crossfade:i}=t.options;!1===i&&o.hide()}}exitAnimationComplete(){this.members.forEach(t=>{var e,n,o,i,r;null===(n=(e=t.options).onExitComplete)||void 0===n||n.call(e),null===(r=null===(o=t.resumingFrom)||void 0===o?void 0:(i=o.options).onExitComplete)||void 0===r||r.call(i)})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function os(t,e,n){let o="";const i=t.x.translate/e.x,r=t.y.translate/e.y;if((i||r)&&(o=`translate3d(${i}px, ${r}px, 0) `),1===e.x&&1===e.y||(o+=`scale(${1/e.x}, ${1/e.y}) `),n){const{rotate:t,rotateX:e,rotateY:i}=n;t&&(o+=`rotate(${t}deg) `),e&&(o+=`rotateX(${e}deg) `),i&&(o+=`rotateY(${i}deg) `)}const s=t.x.scale*e.x,a=t.y.scale*e.y;return 1===s&&1===a||(o+=`scale(${s}, ${a})`),o||"none"}const is=(t,e)=>t.depth-e.depth;class rs{constructor(){this.children=[],this.isDirty=!1}add(t){Io(this.children,t),this.isDirty=!0}remove(t){Uo(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(is),this.isDirty=!1,this.children.forEach(t)}}const ss=["","X","Y","Z"];let as=0;function ls({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:o,resetTransform:i}){return class{constructor(t,n={},o=(null==e?void 0:e())){this.id=as++,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(hs),this.nodes.forEach(gs),this.nodes.forEach(vs)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.elementId=t,this.latestValues=n,this.root=o?o.root||o:this,this.path=o?[...o.path,o]:[],this.parent=o,this.depth=o?o.depth+1:0,t&&this.root.registerPotentialNode(t,this);for(let t=0;t<this.path.length;t++)this.path[t].shouldResetTransform=!0;this.root===this&&(this.nodes=new rs)}addEventListener(t,e){return this.eventHandlers.has(t)||this.eventHandlers.set(t,new No),this.eventHandlers.get(t).add(e)}notifyListeners(t,...e){const n=this.eventHandlers.get(t);null==n||n.notify(...e)}hasListeners(t){return this.eventHandlers.has(t)}registerPotentialNode(t,e){this.potentialNodes.set(t,e)}mount(e,n=!1){var o;if(this.instance)return;this.isSVG=e instanceof SVGElement&&"svg"!==e.tagName,this.instance=e;const{layoutId:i,layout:r,visualElement:s}=this.options;if(s&&!s.current&&s.mount(e),this.root.nodes.add(this),null===(o=this.parent)||void 0===o||o.children.add(this),this.elementId&&this.root.potentialNodes.delete(this.elementId),n&&(r||i)&&(this.isLayoutDirty=!0),t){let n;const o=()=>this.root.updateBlockedByResize=!1;t(e,()=>{this.root.updateBlockedByResize=!0,n&&n(),n=Mo(o,250),T.hasAnimatedSinceResize&&(T.hasAnimatedSinceResize=!1,this.nodes.forEach(ms))})}i&&this.root.registerSharedNode(i,this),!1!==this.options.animate&&s&&(i||r)&&this.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e,hasRelativeTargetChanged:n,layout:o})=>{var i,r,a,l,u;if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const c=null!==(r=null!==(i=this.options.transition)&&void 0!==i?i:s.getDefaultTransition())&&void 0!==r?r:Ps,{onLayoutAnimationStart:h,onLayoutAnimationComplete:d}=s.getProps(),p=!this.targetLayout||!ts(this.targetLayout,o)||n,f=!e&&n;if((null===(a=this.resumeFrom)||void 0===a?void 0:a.instance)||f||e&&(p||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(t,f);const e={...ko(c,"layout"),onPlay:h,onComplete:d};s.shouldReduceMotion&&(e.delay=0,e.type=!1),this.startAnimation(e)}else e||0!==this.animationProgress||ms(this),this.isLead()&&(null===(u=(l=this.options).onExitComplete)||void 0===u||u.call(l));this.targetLayout=o})}unmount(){var t,e;this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this),null===(t=this.getStack())||void 0===t||t.remove(this),null===(e=this.parent)||void 0===e||e.children.delete(this),this.instance=void 0,On.preRender(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){var t;return this.isAnimationBlocked||(null===(t=this.parent)||void 0===t?void 0:t.isTreeAnimationBlocked())||!1}startUpdate(){var t;this.isUpdateBlocked()||(this.isUpdating=!0,null===(t=this.nodes)||void 0===t||t.forEach(ys),this.animationId++)}willUpdate(t=!0){var e,n,o;if(this.root.isUpdateBlocked())return void(null===(n=(e=this.options).onExitComplete)||void 0===n||n.call(e));if(!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let t=0;t<this.path.length;t++){const e=this.path[t];e.shouldResetTransform=!0,e.updateScroll("snapshot")}const{layoutId:i,layout:r}=this.options;if(void 0===i&&!r)return;const s=null===(o=this.options.visualElement)||void 0===o?void 0:o.getProps().transformTemplate;this.prevTransformTemplateValue=null==s?void 0:s(this.latestValues,""),this.updateSnapshot(),t&&this.notifyListeners("willUpdate")}didUpdate(){if(this.isUpdateBlocked())return this.unblockUpdate(),this.clearAllSnapshots(),void this.nodes.forEach(ps);this.isUpdating&&(this.isUpdating=!1,this.potentialNodes.size&&(this.potentialNodes.forEach(Ss),this.potentialNodes.clear()),this.nodes.forEach(fs),this.nodes.forEach(us),this.nodes.forEach(cs),this.clearAllSnapshots(),Bn.update(),Bn.preRender(),Bn.render())}clearAllSnapshots(){this.nodes.forEach(ds),this.sharedNodes.forEach(xs)}scheduleUpdateProjection(){Dn.preRender(this.updateProjection,!1,!0)}scheduleCheckAfterUnmount(){Dn.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure())}updateLayout(){var t;if(!this.instance)return;if(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let t=0;t<this.path.length;t++){this.path[t].updateScroll()}const e=this.layout;this.layout=this.measure(!1),this.layoutCorrected={x:{min:0,max:0},y:{min:0,max:0}},this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox),null===(t=this.options.visualElement)||void 0===t||t.notify("LayoutMeasure",this.layout.layoutBox,null==e?void 0:e.layoutBox)}updateScroll(t="measure"){let e=Boolean(this.options.layoutScroll&&this.instance);this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===t&&(e=!1),e&&(this.scroll={animationId:this.root.animationId,phase:t,isRoot:o(this.instance),offset:n(this.instance)})}resetTransform(){var t;if(!i)return;const e=this.isLayoutDirty||this.shouldResetTransform,n=this.projectionDelta&&!Qr(this.projectionDelta),o=null===(t=this.options.visualElement)||void 0===t?void 0:t.getProps().transformTemplate,r=null==o?void 0:o(this.latestValues,""),s=r!==this.prevTransformTemplateValue;e&&(n||Ii(this.latestValues)||s)&&(i(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(t=!0){const e=this.measurePageBox();let n=this.removeElementScroll(e);var o;return t&&(n=this.removeTransform(n)),Ts((o=n).x),Ts(o.y),{animationId:this.root.animationId,measuredBox:e,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:t}=this.options;if(!t)return{x:{min:0,max:0},y:{min:0,max:0}};const e=t.measureViewportBox(),{scroll:n}=this.root;return n&&(Yi(e.x,n.offset.x),Yi(e.y,n.offset.y)),e}removeElementScroll(t){const e={x:{min:0,max:0},y:{min:0,max:0}};Xr(e,t);for(let n=0;n<this.path.length;n++){const o=this.path[n],{scroll:i,options:r}=o;if(o!==this.root&&i&&r.layoutScroll){if(i.isRoot){Xr(e,t);const{scroll:n}=this.root;n&&(Yi(e.x,-n.offset.x),Yi(e.y,-n.offset.y))}Yi(e.x,i.offset.x),Yi(e.y,i.offset.y)}}return e}applyTransform(t,e=!1){const n={x:{min:0,max:0},y:{min:0,max:0}};Xr(n,t);for(let t=0;t<this.path.length;t++){const o=this.path[t];!e&&o.options.layoutScroll&&o.scroll&&o!==o.root&&Zi(n,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),Ii(o.latestValues)&&Zi(n,o.latestValues)}return Ii(this.latestValues)&&Zi(n,this.latestValues),n}removeTransform(t){var e;const n={x:{min:0,max:0},y:{min:0,max:0}};Xr(n,t);for(let t=0;t<this.path.length;t++){const o=this.path[t];if(!o.instance)continue;if(!Ii(o.latestValues))continue;Fi(o.latestValues)&&o.updateSnapshot();const i={x:{min:0,max:0},y:{min:0,max:0}};Xr(i,o.measurePageBox()),_r(n,o.latestValues,null===(e=o.snapshot)||void 0===e?void 0:e.layoutBox,i)}return Ii(this.latestValues)&&_r(n,this.latestValues),n}setTargetDelta(t){this.targetDelta=t,this.isProjectionDirty=!0,this.root.scheduleUpdateProjection()}setOptions(t){this.options={...this.options,...t,crossfade:void 0===t.crossfade||t.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}resolveTargetDelta(){var t;const e=this.getLead();if(this.isProjectionDirty||(this.isProjectionDirty=e.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=e.isTransformDirty),!this.isProjectionDirty&&!this.attemptToResolveRelativeTarget)return;const{layout:n,layoutId:o}=this.options;if(this.layout&&(n||o)){if(!this.targetDelta&&!this.relativeTarget){const t=this.getClosestProjectingParent();t&&t.layout?(this.relativeParent=t,this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},Vi(this.relativeTargetOrigin,this.layout.layoutBox,t.layout.layoutBox),Xr(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}var i,r,s;if(this.relativeTarget||this.targetDelta)if(this.target||(this.target={x:{min:0,max:0},y:{min:0,max:0}},this.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}}),this.relativeTarget&&this.relativeTargetOrigin&&(null===(t=this.relativeParent)||void 0===t?void 0:t.target)?(i=this.target,r=this.relativeTarget,s=this.relativeParent.target,Ti(i.x,r.x,s.x),Ti(i.y,r.y,s.y)):this.targetDelta?(Boolean(this.resumingFrom)?this.target=this.applyTransform(this.layout.layoutBox):Xr(this.target,this.layout.layoutBox),$i(this.target,this.targetDelta)):Xr(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}},Vi(this.relativeTargetOrigin,this.target,t.target),Xr(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(this.parent&&!Fi(this.parent.latestValues)&&!Ui(this.parent.latestValues))return(this.parent.relativeTarget||this.parent.targetDelta)&&this.parent.layout?this.parent:this.parent.getClosestProjectingParent()}calcProjection(){var t;const{isProjectionDirty:e,isTransformDirty:n}=this;this.isProjectionDirty=this.isTransformDirty=!1;const o=this.getLead(),i=Boolean(this.resumingFrom)||this!==o;let r=!0;if(e&&(r=!1),i&&n&&(r=!1),r)return;const{layout:s,layoutId:a}=this.options;if(this.isTreeAnimating=Boolean((null===(t=this.parent)||void 0===t?void 0:t.isTreeAnimating)||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!s&&!a)return;Xr(this.layoutCorrected,this.layout.layoutBox),function(t,e,n,o=!1){var i,r;const s=n.length;if(!s)return;let a,l;e.x=e.y=1;for(let u=0;u<s;u++)a=n[u],l=a.projectionDelta,"contents"!==(null===(r=null===(i=a.instance)||void 0===i?void 0:i.style)||void 0===r?void 0:r.display)&&(o&&a.options.layoutScroll&&a.scroll&&a!==a.root&&Zi(t,{x:-a.scroll.offset.x,y:-a.scroll.offset.y}),l&&(e.x*=l.x.scale,e.y*=l.y.scale,$i(t,l)),o&&Ii(a.latestValues)&&Zi(t,a.latestValues))}(this.layoutCorrected,this.treeScale,this.path,i);const{target:l}=o;if(!l)return;this.projectionDelta||(this.projectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDeltaWithTransform={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}});const u=this.treeScale.x,c=this.treeScale.y,h=this.projectionTransform;Si(this.projectionDelta,this.layoutCorrected,l,this.latestValues),this.projectionTransform=os(this.projectionDelta,this.treeScale),this.projectionTransform===h&&this.treeScale.x===u&&this.treeScale.y===c||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",l))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(t=!0){var e,n,o;null===(n=(e=this.options).scheduleRender)||void 0===n||n.call(e),t&&(null===(o=this.getStack())||void 0===o||o.scheduleRender()),this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}setAnimationOrigin(t,e=!1){var n,o;const i=this.snapshot,r=(null==i?void 0:i.latestValues)||{},s={...this.latestValues},a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};this.relativeTarget=this.relativeTargetOrigin=void 0,this.attemptToResolveRelativeTarget=!e;const l={x:{min:0,max:0},y:{min:0,max:0}},u=(null==i?void 0:i.source)!==(null===(n=this.layout)||void 0===n?void 0:n.source),c=((null===(o=this.getStack())||void 0===o?void 0:o.members.length)||0)<=1,h=Boolean(u&&!c&&!0===this.options.crossfade&&!this.path.some(ws));this.animationProgress=0,this.mixTargetDelta=e=>{var n;const o=e/1e3;var i,d,p,f;bs(a.x,t.x,o),bs(a.y,t.y,o),this.setTargetDelta(a),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&(null===(n=this.relativeParent)||void 0===n?void 0:n.layout)&&(Vi(l,this.layout.layoutBox,this.relativeParent.layout.layoutBox),i=this.relativeTarget,d=this.relativeTargetOrigin,p=l,f=o,Es(i.x,d.x,p.x,f),Es(i.y,d.y,p.y,f)),u&&(this.animationValues=s,function(t,e,n,o,i,r){var s,a,l,u;i?(t.opacity=Ue(0,null!==(s=n.opacity)&&void 0!==s?s:1,Wr(o)),t.opacityExit=Ue(null!==(a=e.opacity)&&void 0!==a?a:1,0,Hr(o))):r&&(t.opacity=Ue(null!==(l=e.opacity)&&void 0!==l?l:1,null!==(u=n.opacity)&&void 0!==u?u:1,o));for(let i=0;i<Ir;i++){const r=`border${Fr[i]}Radius`;let s=zr(e,r),a=zr(n,r);if(void 0===s&&void 0===a)continue;s||(s=0),a||(a=0);0===s||0===a||Nr(s)===Nr(a)?(t[r]=Math.max(Ue(Ur(s),Ur(a),o),0),(it.test(a)||it.test(s))&&(t[r]+="%")):t[r]=a}(e.rotate||n.rotate)&&(t.rotate=Ue(e.rotate||0,n.rotate||0,o))}(s,r,this.latestValues,o,h,c)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=o},this.mixTargetDelta(0)}startAnimation(t){var e,n;this.notifyListeners("animationStart"),null===(e=this.currentAnimation)||void 0===e||e.stop(),this.resumingFrom&&(null===(n=this.resumingFrom.currentAnimation)||void 0===n||n.stop()),this.pendingAnimation&&(On.update(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Dn.update(()=>{T.hasAnimatedSinceResize=!0,this.currentAnimation=jr(0,1e3,{...t,onUpdate:e=>{var n;this.mixTargetDelta(e),null===(n=t.onUpdate)||void 0===n||n.call(t,e)},onComplete:()=>{var e;null===(e=t.onComplete)||void 0===e||e.call(t),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){var t;this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0),null===(t=this.getStack())||void 0===t||t.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){var t;this.currentAnimation&&(null===(t=this.mixTargetDelta)||void 0===t||t.call(this,1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const t=this.getLead();let{targetWithTransforms:e,target:n,layout:o,latestValues:i}=t;if(e&&n&&o){if(this!==t&&this.layout&&o&&As(this.options.animationType,this.layout.layoutBox,o.layoutBox)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const e=Ei(this.layout.layoutBox.x);n.x.min=t.target.x.min,n.x.max=n.x.min+e;const o=Ei(this.layout.layoutBox.y);n.y.min=t.target.y.min,n.y.max=n.y.min+o}Xr(e,n),Zi(e,i),Si(this.projectionDeltaWithTransform,this.layoutCorrected,e,i)}}registerSharedNode(t,e){var n,o,i;this.sharedNodes.has(t)||this.sharedNodes.set(t,new ns);this.sharedNodes.get(t).add(e),e.promote({transition:null===(n=e.options.initialPromotionConfig)||void 0===n?void 0:n.transition,preserveFollowOpacity:null===(i=null===(o=e.options.initialPromotionConfig)||void 0===o?void 0:o.shouldPreserveFollowOpacity)||void 0===i?void 0:i.call(o,e)})}isLead(){const t=this.getStack();return!t||t.lead===this}getLead(){var t;const{layoutId:e}=this.options;return e&&(null===(t=this.getStack())||void 0===t?void 0:t.lead)||this}getPrevLead(){var t;const{layoutId:e}=this.options;return e?null===(t=this.getStack())||void 0===t?void 0:t.prevLead:void 0}getStack(){const{layoutId:t}=this.options;if(t)return this.root.sharedNodes.get(t)}promote({needsReset:t,transition:e,preserveFollowOpacity:n}={}){const o=this.getStack();o&&o.promote(this,n),t&&(this.projectionDelta=void 0,this.needsReset=!0),e&&this.setOptions({transition:e})}relegate(){const t=this.getStack();return!!t&&t.relegate(this)}resetRotation(){const{visualElement:t}=this.options;if(!t)return;let e=!1;const{latestValues:n}=t;if((n.rotate||n.rotateX||n.rotateY||n.rotateZ)&&(e=!0),!e)return;const o={};for(let e=0;e<ss.length;e++){const i="rotate"+ss[e];n[i]&&(o[i]=n[i],t.setStaticValue(i,0))}null==t||t.render();for(const e in o)t.setStaticValue(e,o[e]);t.scheduleRender()}getProjectionStyles(t={}){var e,n,o;const i={};if(!this.instance||this.isSVG)return i;if(!this.isVisible)return{visibility:"hidden"};i.visibility="";const r=null===(e=this.options.visualElement)||void 0===e?void 0:e.getProps().transformTemplate;if(this.needsReset)return this.needsReset=!1,i.opacity="",i.pointerEvents=te(t.pointerEvents)||"",i.transform=r?r(this.latestValues,""):"none",i;const s=this.getLead();if(!this.projectionDelta||!this.layout||!s.target){const e={};return this.options.layoutId&&(e.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,e.pointerEvents=te(t.pointerEvents)||""),this.hasProjected&&!Ii(this.latestValues)&&(e.transform=r?r({},""):"none",this.hasProjected=!1),e}const a=s.animationValues||s.latestValues;this.applyTransformsToTarget(),i.transform=os(this.projectionDeltaWithTransform,this.treeScale,a),r&&(i.transform=r(a,i.transform));const{x:l,y:u}=this.projectionDelta;i.transformOrigin=`${100*l.origin}% ${100*u.origin}% 0`,s.animationValues?i.opacity=s===this?null!==(o=null!==(n=a.opacity)&&void 0!==n?n:this.latestValues.opacity)&&void 0!==o?o:1:this.preserveOpacity?this.latestValues.opacity:a.opacityExit:i.opacity=s===this?void 0!==a.opacity?a.opacity:"":void 0!==a.opacityExit?a.opacityExit:0;for(const t in j){if(void 0===a[t])continue;const{correct:e,applyTo:n}=j[t],o=e(a[t],s);if(n){const t=n.length;for(let e=0;e<t;e++)i[n[e]]=o}else i[t]=o}return this.options.layoutId&&(i.pointerEvents=s===this?te(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(ps),this.root.sharedNodes.clear()}}}function us(t){t.updateLayout()}function cs(t){var e,n,o;const i=(null===(e=t.resumeFrom)||void 0===e?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&i&&t.hasListeners("didUpdate")){const{layoutBox:e,measuredBox:n}=t.layout,{animationType:o}=t.options,r=i.source!==t.layout.source;"size"===o?Bi(t=>{const n=r?i.measuredBox[t]:i.layoutBox[t],o=Ei(n);n.min=e[t].min,n.max=n.min+o}):As(o,i.layoutBox,e)&&Bi(t=>{const n=r?i.measuredBox[t]:i.layoutBox[t],o=Ei(e[t]);n.max=n.min+o});const s={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};Si(s,e,i.layoutBox);const a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};r?Si(a,t.applyTransform(n,!0),i.measuredBox):Si(a,e,i.layoutBox);const l=!Qr(s);let u=!1;if(!t.resumeFrom){const n=t.getClosestProjectingParent();if(n&&!n.resumeFrom){const{snapshot:t,layout:o}=n;if(t&&o){const n={x:{min:0,max:0},y:{min:0,max:0}};Vi(n,i.layoutBox,t.layoutBox);const r={x:{min:0,max:0},y:{min:0,max:0}};Vi(r,e,o.layoutBox),ts(n,r)||(u=!0)}}}t.notifyListeners("didUpdate",{layout:e,snapshot:i,delta:a,layoutDelta:s,hasLayoutChanged:l,hasRelativeTargetChanged:u})}else t.isLead()&&(null===(o=(n=t.options).onExitComplete)||void 0===o||o.call(n));t.options.transition=void 0}function hs(t){t.isProjectionDirty||(t.isProjectionDirty=Boolean(t.parent&&t.parent.isProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=Boolean(t.parent&&t.parent.isTransformDirty))}function ds(t){t.clearSnapshot()}function ps(t){t.clearMeasurements()}function fs(t){const{visualElement:e}=t.options;(null==e?void 0:e.getProps().onBeforeLayoutMeasure)&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function ms(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0}function gs(t){t.resolveTargetDelta()}function vs(t){t.calcProjection()}function ys(t){t.resetRotation()}function xs(t){t.removeLeadSnapshot()}function bs(t,e,n){t.translate=Ue(e.translate,0,n),t.scale=Ue(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function Es(t,e,n,o){t.min=Ue(e.min,n.min,o),t.max=Ue(e.max,n.max,o)}function ws(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}const Ps={duration:.45,ease:[.4,0,.1,1]};function Ss(t,e){let n=t.root;for(let e=t.path.length-1;e>=0;e--)if(Boolean(t.path[e].instance)){n=t.path[e];break}const o=(n&&n!==t.root?n.instance:document).querySelector(`[data-projection-id="${e}"]`);o&&t.mount(o,!0)}function Ts(t){t.min=Math.round(t.min),t.max=Math.round(t.max)}function As(t,e,n){return"position"===t||"preserve-aspect"===t&&!function(t,e,n=.1){return Xn(t,e)<=n}(es(e),es(n),.2)}const Vs=ls({attachResizeListener:(t,e)=>ae(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Cs={current:void 0},Ms=ls({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Cs.current){const t=new Vs(0,{});t.mount(window),t.setOptions({layoutScroll:!0}),Cs.current=t}return Cs.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)}),Rs={...pi,...ho,...tr,...kr},Ls=O((t,e)=>re(t,e,Rs,Mr,Ms));const Ds=O(re);function Os(){const t=e.useRef(!1);return h(()=>(t.current=!0,()=>{t.current=!1}),[]),t}function Bs(){const t=Os(),[n,o]=e.useState(0),i=e.useCallback(()=>{t.current&&o(n+1)},[n]);return[e.useCallback(()=>Dn.postRender(i),[i]),n]}class ks extends r.Component{getSnapshotBeforeUpdate(t){const e=this.props.childRef.current;if(e&&t.isPresent&&!this.props.isPresent){const t=this.props.sizeRef.current;t.height=e.offsetHeight||0,t.width=e.offsetWidth||0,t.top=e.offsetTop,t.left=e.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function js({children:t,isPresent:n}){const o=e.useId(),i=e.useRef(null),s=e.useRef({width:0,height:0,top:0,left:0});return e.useInsertionEffect(()=>{const{width:t,height:e,top:r,left:a}=s.current;if(n||!i.current||!t||!e)return;i.current.dataset.motionPopId=o;const l=document.createElement("style");return document.head.appendChild(l),l.sheet&&l.sheet.insertRule(`\n [data-motion-pop-id="${o}"] {\n position: absolute !important;\n width: ${t}px !important;\n height: ${e}px !important;\n top: ${r}px !important;\n left: ${a}px !important;\n }\n `),()=>{document.head.removeChild(l)}},[n]),r.createElement(ks,{isPresent:n,childRef:i,sizeRef:s},r.cloneElement(t,{ref:i}))}const Fs=({children:t,initial:n,isPresent:o,onExitComplete:i,custom:s,presenceAffectsLayout:a,mode:l})=>{const c=S(Is),h=e.useId(),d=e.useMemo(()=>({id:h,initial:n,isPresent:o,custom:s,onExitComplete:t=>{c.set(t,!0);for(const t of c.values())if(!t)return;i&&i()},register:t=>(c.set(t,!1),()=>c.delete(t))}),a?void 0:[o]);return e.useMemo(()=>{c.forEach((t,e)=>c.set(e,!1))},[o]),r.useEffect(()=>{!o&&!c.size&&i&&i()},[o]),"popLayout"===l&&(t=r.createElement(js,{isPresent:o},t)),r.createElement(u.Provider,{value:d},t)};function Is(){return new Map}const Us=t=>t.key||"";const Ns=e.createContext(null),zs=t=>!t.isLayoutDirty&&t.willUpdate(!1);function Ws(){const t=new Set,e=new WeakMap,n=()=>t.forEach(zs);return{add:o=>{t.add(o),e.set(o,o.addEventListener("willUpdate",n))},remove:o=>{var i;t.delete(o),null===(i=e.get(o))||void 0===i||i(),e.delete(o),n()},dirty:n}}const Hs=t=>!0===t,$s=({children:t,id:n,inheritId:o,inherit:i=!0})=>{void 0!==o&&(i=o);const s=e.useContext(V),a=e.useContext(Ns),[l,u]=Bs(),c=e.useRef(null),h=s.id||a;null===c.current&&((t=>Hs(!0===t)||"id"===t)(i)&&h&&(n=n?h+"-"+n:h),c.current={id:n,group:Hs(i)&&s.group||Ws()});const d=e.useMemo(()=>({...c.current,forceRender:l}),[u]);return r.createElement(V.Provider,{value:d},t)};let Ys=0;function Xs(t){return"function"==typeof t}const Gs=e.createContext(null);const qs=e.forwardRef((function({children:t,as:n="ul",axis:o="y",onReorder:i,values:s,...a},l){const u=S(()=>Ls(n)),c=[],h=e.useRef(!1),d={axis:o,registerItem:(t,e)=>{e&&-1===c.findIndex(e=>t===e.value)&&(c.push({value:t,layout:e[o]}),c.sort(Ks))},updateOrder:(t,e,n)=>{if(h.current)return;const o=function(t,e,n,o){if(!o)return t;const i=t.findIndex(t=>t.value===e);if(-1===i)return t;const r=o>0?1:-1,s=t[i+r];if(!s)return t;const a=t[i],l=s.layout,u=Ue(l.min,l.max,.5);return 1===r&&a.layout.max+n>u||-1===r&&a.layout.min+n<u?function([...t],e,n){const o=e<0?t.length+e:e;if(o>=0&&o<t.length){const o=n<0?t.length+n:n,[i]=t.splice(e,1);t.splice(o,0,i)}return t}(t,i,i+r):t}(c,t,e,n);c!==o&&(h.current=!0,i(o.map(Zs).filter(t=>-1!==s.indexOf(t))))}};return e.useEffect(()=>{h.current=!1}),r.createElement(u,{...a,ref:l},r.createElement(Gs.Provider,{value:d},t))}));function Zs(t){return t.value}function Ks(t,e){return t.layout.min-e.layout.min}function _s(t){const n=S(()=>Wo(t)),{isStatic:o}=e.useContext(s);if(o){const[,o]=e.useState(t);e.useEffect(()=>n.onChange(o),[])}return n}function Js(...t){const e=!Array.isArray(t[0]),n=e?0:-1,o=t[0+n],i=t[1+n],r=t[2+n],s=t[3+n],a=nn(i,r,{mixer:(l=r[0],(t=>"object"==typeof t&&t.mix)(l)?l.mix:void 0),...s});var l;return e?a(o):a}function Qs(t,e){const n=_s(e()),o=()=>n.set(e());return o(),function(t,e,n){h(()=>{const o=t.map(t=>t.onChange(e));return()=>{o.forEach(t=>t()),n()}})}(t,()=>Dn.update(o,!1,!0),()=>On.update(o)),n}function ta(t,e,n,o){const i="function"==typeof e?e:Js(e,n,o);return Array.isArray(t)?ea(t,i):ea([t],([t])=>i(t))}function ea(t,e){const n=S(()=>[]);return Qs(t,()=>{n.length=0;const o=t.length;for(let e=0;e<o;e++)n[e]=t[e].get();return e(n)})}function na(t,e=0){return z(t)?t:_s(e)}const oa={Group:qs,Item:e.forwardRef((function({children:t,style:n={},value:o,as:i="li",onDrag:s,layout:a=!0,...l},u){const c=S(()=>Ls(i)),h=e.useContext(Gs),d={x:na(n.x),y:na(n.y)},p=ta([d.x,d.y],([t,e])=>t||e?1:"unset"),f=e.useRef(null),{axis:m,registerItem:g,updateOrder:v}=h;return e.useEffect(()=>{g(o,f.current)},[h]),r.createElement(c,{drag:m,...l,dragSnapToOrigin:!0,style:{...n,x:d.x,y:d.y,zIndex:p},layout:a,onDrag:(t,e)=>{const{velocity:n}=e;n[m]&&v(o,d[m].get(),n[m]),s&&s(t,e)},onLayoutMeasure:t=>{f.current=t},ref:u},t)}))},ia={renderer:Mr,...pi,...ho},ra={...ia,...tr,...kr,projectionNodeConstructor:Ms};const sa=t=>"number"==typeof t;function aa(t,e){return(t=>Array.isArray(t)&&!sa(t[0]))(t)?t[((t,e,n)=>{const o=e-t;return((n-t)%o+o)%o+t})(0,t.length,e)]:t}const la=(t,e,n)=>-n*t+n*e+t,ua=t=>t,ca=(t,e,n)=>e-t==0?1:(n-t)/(e-t);function ha(t,e){const n=t[t.length-1];for(let o=1;o<=e;o++){const i=ca(0,e,o);t.push(la(n,1,i))}}function da(t){const e=[0];return ha(e,t-1),e}function pa(t,e=da(t.length),n=ua){const o=t.length,i=o-e.length;return i>0&&ha(e,i),i=>{let r=0;for(;r<o-2&&!(i<e[r+1]);r++);let s=(a=0,l=1,u=ca(e[r],e[r+1],i),Math.min(Math.max(u,a),l));var a,l,u;return s=aa(n,r)(s),la(t[r],t[r+1],s)}}const fa=t=>"function"==typeof t,ma=t=>"string"==typeof t;function ga(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 va={any:0,all:1};const ya=new WeakMap;let xa;function ba({target:t,contentRect:e,borderBoxSize:n}){var o;null===(o=ya.get(t))||void 0===o||o.forEach(o=>{o({target:t,contentSize:e,get size(){return function(t,e){if(e){const{inlineSize:t,blockSize:n}=e[0];return{width:t,height:n}}return t instanceof SVGElement&&"getBBox"in t?t.getBBox():{width:t.offsetWidth,height:t.offsetHeight}}(t,n)}})})}function Ea(t){t.forEach(ba)}function wa(t,e){xa||"undefined"!=typeof ResizeObserver&&(xa=new ResizeObserver(Ea));const n=ga(t);return n.forEach(t=>{let n=ya.get(t);n||(n=new Set,ya.set(t,n)),n.add(e),null==xa||xa.observe(t)}),()=>{n.forEach(t=>{const n=ya.get(t);null==n||n.delete(e),(null==n?void 0:n.size)||null==xa||xa.unobserve(t)})}}const Pa=new Set;let Sa;function Ta(t){return Pa.add(t),Sa||(Sa=()=>{const t={width:window.innerWidth,height:window.innerHeight},e={target:window,size:t,contentSize:t};Pa.forEach(t=>t(e))},window.addEventListener("resize",Sa)),()=>{Pa.delete(t),!Pa.size&&Sa&&(Sa=void 0)}}const Aa={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}};function Va(t,e,n,o){const i=n[e],{length:r,position:s}=Aa[e],a=i.current,l=n.time;i.current=t["scroll"+s],i.scrollLength=t["scroll"+r]-t["client"+r],i.offset.length=0,i.offset[0]=0,i.offset[1]=i.scrollLength,i.progress=ca(0,i.scrollLength,i.current);const u=o-l;var c,h;i.velocity=u>50?0:(c=i.current-a,(h=u)?c*(1e3/h):0)}const Ca={Enter:[[0,1],[1,1]],Exit:[[0,0],[1,0]],Any:[[1,0],[0,1]],All:[[0,0],[1,1]]},Ma={start:0,center:.5,end:1};function Ra(t,e,n=0){let o=0;if(void 0!==Ma[t]&&(t=Ma[t]),ma(t)){const e=parseFloat(t);t.endsWith("px")?o=e:t.endsWith("%")?t=e/100:t.endsWith("vw")?o=e/100*document.documentElement.clientWidth:t.endsWith("vh")?o=e/100*document.documentElement.clientHeight:t=e}return sa(t)&&(o=e*t),n+o}const La=[0,0];function Da(t,e,n,o){let i=Array.isArray(t)?t:La,r=0,s=0;return sa(t)?i=[t,t]:ma(t)&&(i=(t=t.trim()).includes(" ")?t.split(" "):[t,Ma[t]?t:"0"]),r=Ra(i[0],n,o),s=Ra(i[1],e),r-s}const Oa={x:0,y:0};function Ba(t,e,n){let{offset:o=Ca.All}=n;const{target:i=t,axis:r="y"}=n,s="y"===r?"height":"width",a=i!==t?function(t,e){let n={x:0,y:0},o=t;for(;o&&o!==e;)if(o instanceof HTMLElement)n.x+=o.offsetLeft,n.y+=o.offsetTop,o=o.offsetParent;else if(o instanceof SVGGraphicsElement&&"getBBox"in o){const{top:t,left:e}=o.getBBox();for(n.x+=e,n.y+=t;o&&"svg"!==o.tagName;)o=o.parentNode}return n}(i,t):Oa,l=i===t?{width:t.scrollWidth,height:t.scrollHeight}:{width:i.clientWidth,height:i.clientHeight},u={width:t.clientWidth,height:t.clientHeight};e[r].offset.length=0;let c=!e[r].interpolate;const h=o.length;for(let t=0;t<h;t++){const n=Da(o[t],u[s],l[s],a[r]);c||n===e[r].interpolatorOffsets[t]||(c=!0),e[r].offset[t]=n}c&&(e[r].interpolate=pa(da(h),e[r].offset),e[r].interpolatorOffsets=[...e[r].offset]),e[r].progress=e[r].interpolate(e[r].current)}function ka(t,e,n,o={}){const i=o.axis||"y";return{measure:()=>function(t,e=t,n){if(n.x.targetOffset=0,n.y.targetOffset=0,e!==t){let o=e;for(;o&&o!=t;)n.x.targetOffset+=o.offsetLeft,n.y.targetOffset+=o.offsetTop,o=o.offsetParent}n.x.targetLength=e===t?e.scrollWidth:e.clientWidth,n.y.targetLength=e===t?e.scrollHeight:e.clientHeight,n.x.containerLength=t.clientWidth,n.y.containerLength=t.clientHeight}(t,o.target,n),update:e=>{!function(t,e,n){Va(t,"x",e,n),Va(t,"y",e,n),e.time=n}(t,n,e),(o.offset||o.target)&&Ba(t,n,o)},notify:fa(e)?()=>e(n):ja(e,n[i])}}function ja(t,e){return t.pause(),t.forEachNative((t,{easing:e})=>{var n,o;if(t.updateDuration)e||(t.easing=ua),t.updateDuration(1);else{const i={duration:1e3};e||(i.easing="linear"),null===(o=null===(n=t.effect)||void 0===n?void 0:n.updateTiming)||void 0===o||o.call(n,i)}}),()=>{t.currentTime=e.progress}}const Fa=new WeakMap,Ia=new WeakMap,Ua=new WeakMap,Na=t=>t===document.documentElement?window:t;function za(t,e={}){var{container:n=document.documentElement}=e,o=Me(e,["container"]);let i=Ua.get(n);i||(i=new Set,Ua.set(n,i));const r=ka(n,t,{time:0,x:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0},y:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0}},o);if(i.add(r),!Fa.has(n)){const t=()=>{const t=performance.now();for(const t of i)t.measure();for(const e of i)e.update(t);for(const t of i)t.notify()};Fa.set(n,t);const e=Na(n);window.addEventListener("resize",t,{passive:!0}),n!==document.documentElement&&Ia.set(n,function(t,e){return fa(t)?Ta(t):wa(t,e)}(n,t)),e.addEventListener("scroll",t,{passive:!0})}const s=Fa.get(n),a=requestAnimationFrame(s);return()=>{var e;"function"!=typeof t&&t.stop(),cancelAnimationFrame(a);const o=Ua.get(n);if(!o)return;if(o.delete(r),o.size)return;const i=Fa.get(n);Fa.delete(n),i&&(Na(n).removeEventListener("scroll",i),null===(e=Ia.get(n))||void 0===e||e(),window.removeEventListener("resize",i))}}const Wa=()=>({scrollX:Wo(0),scrollY:Wo(0),scrollXProgress:Wo(0),scrollYProgress:Wo(0)});function Ha({container:t,target:n,layoutEffect:o=!0,...i}={}){const r=S(Wa);return(o?h:e.useEffect)(()=>za(({x:t,y:e})=>{r.scrollX.set(t.current),r.scrollXProgress.set(t.progress),r.scrollY.set(e.current),r.scrollYProgress.set(e.progress)},{...i,container:(null==t?void 0:t.current)||void 0,target:(null==n?void 0:n.current)||void 0}),[]),r}function $a(t){const n=e.useRef(0),{isStatic:o}=e.useContext(s);e.useEffect(()=>{if(o)return;const e=({timestamp:e,delta:o})=>{n.current||(n.current=e),t(e-n.current,o)};return Dn.update(e,!0),()=>On.update(e)},[t])}class Ya extends zo{constructor(){super(...arguments),this.members=[],this.transforms=new Set}add(t){let e;U.has(t)?(this.transforms.add(t),e="transform"):t.startsWith("origin")||Y(t)||"willChange"===t||(e=Yt(t)),e&&(Io(this.members,e),this.update())}remove(t){U.has(t)?(this.transforms.delete(t),this.transforms.size||Uo(this.members,"transform")):Uo(this.members,Yt(t)),this.update()}update(){this.set(this.members.length?this.members.join(", "):"auto")}}function Xa(){!yr.current&&xr();const[t]=e.useState(vr.current);return t}function Ga(){let t=!1;const e=[],n=new Set,o={subscribe:t=>(n.add(t),()=>{n.delete(t)}),start(o,i){if(t){const t=[];return n.forEach(e=>{t.push(ni(e,o,{transitionOverride:i}))}),Promise.all(t)}return new Promise(t=>{e.push({animation:[o,i],resolve:t})})},set:t=>n.forEach(e=>{!function(t,e){Array.isArray(e)?_o(t,e):"string"==typeof e?_o(t,[e]):Ko(t,e)}(e,t)}),stop(){n.forEach(t=>{!function(t){t.values.forEach(t=>t.stop())}(t)})},mount:()=>(t=!0,e.forEach(({animation:t,resolve:e})=>{o.start(...t).then(e)}),()=>{t=!1,o.stop()})};return o}function qa(){const t=S(Ga);return e.useEffect(t.mount,[]),t}const Za=qa;class Ka{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 _a=()=>new Ka;function Ja(t){return null!==t&&"object"==typeof t&&R in t}function Qa(){return tl}function tl(t){Cs.current&&(Cs.current.isUpdating=!1,Cs.current.blockUpdate(),t&&t())}const el=()=>({});class nl extends Pr{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 Jo(this,n,ti(n,t||{},this)),{transition:t,transitionEnd:e,...n}}}const ol=ee({scrapeMotionValuesFromProps:el,createRenderState:el});const il=t=>t>.001?1/t:1e5;t.AnimatePresence=({children:t,custom:n,initial:o=!0,onExitComplete:i,exitBeforeEnter:s,presenceAffectsLayout:a=!0,mode:l="sync"})=>{s&&(l="wait",eo(!1,"Replace exitBeforeEnter with mode='wait'"));let[u]=Bs();const c=e.useContext(V).forceRender;c&&(u=c);const d=Os(),p=function(t){const n=[];return e.Children.forEach(t,t=>{e.isValidElement(t)&&n.push(t)}),n}(t);let f=p;const m=new Set,g=e.useRef(f),v=e.useRef(new Map).current,y=e.useRef(!0);if(h(()=>{y.current=!1,function(t,e){t.forEach(t=>{const n=Us(t);e.set(n,t)})}(p,v),g.current=f}),Ce(()=>{y.current=!0,v.clear(),m.clear()}),y.current)return r.createElement(r.Fragment,null,f.map(t=>r.createElement(Fs,{key:Us(t),isPresent:!0,initial:!!o&&void 0,presenceAffectsLayout:a,mode:l},t)));f=[...f];const x=g.current.map(Us),b=p.map(Us),E=x.length;for(let t=0;t<E;t++){const e=x[t];-1===b.indexOf(e)&&m.add(e)}return"wait"===l&&m.size&&(f=[]),m.forEach(t=>{if(-1!==b.indexOf(t))return;const e=v.get(t);if(!e)return;const o=x.indexOf(t);f.splice(o,0,r.createElement(Fs,{key:Us(e),isPresent:!1,onExitComplete:()=>{v.delete(t),m.delete(t);const e=g.current.findIndex(e=>e.key===t);if(g.current.splice(e,1),!m.size){if(g.current=p,!1===d.current)return;u(),i&&i()}},custom:n,presenceAffectsLayout:a,mode:l},e))}),f=f.map(t=>{const e=t.key;return m.has(e)?t:r.createElement(Fs,{key:Us(t),isPresent:!0,presenceAffectsLayout:a,mode:l},t)}),"production"!==Qn&&"wait"===l&&f.length>1&&console.warn('You\'re attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.'),r.createElement(r.Fragment,null,m.size?f:f.map(t=>e.cloneElement(t)))},t.AnimateSharedLayout=({children:t})=>(r.useEffect(()=>{},[]),r.createElement($s,{id:S(()=>"asl-"+Ys++)},t)),t.DeprecatedLayoutGroupContext=Ns,t.DragControls=Ka,t.FlatTree=rs,t.LayoutGroup=$s,t.LayoutGroupContext=V,t.LazyMotion=function({children:t,features:n,strict:o=!1}){const[,i]=e.useState(!Xs(n)),s=e.useRef(void 0);if(!Xs(n)){const{renderer:t,...e}=n;s.current=t,P(e)}return e.useEffect(()=>{Xs(n)&&n().then(({renderer:t,...e})=>{P(e),s.current=t,i(!0)})},[]),r.createElement(d.Provider,{value:{renderer:s.current,strict:o}},t)},t.MotionConfig=function({children:t,isValidProp:n,...o}){n&&jt(n),(o={...e.useContext(s),...o}).isStatic=S(()=>o.isStatic);const i=e.useMemo(()=>o,[JSON.stringify(o.transition),o.transformPagePoint,o.reducedMotion]);return r.createElement(s.Provider,{value:i},t)},t.MotionConfigContext=s,t.MotionContext=a,t.MotionValue=zo,t.PresenceContext=u,t.Reorder=oa,t.SwitchLayoutGroupContext=M,t.VisualElement=Pr,t.addPointerEvent=xe,t.addScaleCorrector=F,t.animate=jr,t.animateVisualElement=ni,t.animationControls=Ga,t.animations=pi,t.buildTransform=$,t.calcLength=Ei,t.checkTargetForNewValues=Jo,t.createBox=Oi,t.createDomMotionComponent=function(t){return L(re(t,{forwardMotionProps:!1},Rs,Mr,Ms))},t.createMotionComponent=L,t.delay=Mo,t.domAnimation=ia,t.domMax=ra,t.filterProps=Ft,t.isBrowser=c,t.isDragActive=Te,t.isMotionComponent=Ja,t.isMotionValue=z,t.isValidMotionProp=Bt,t.m=Ds,t.makeUseVisualState=ee,t.motion=Ls,t.motionValue=Wo,t.resolveMotionValue=te,t.transform=Js,t.unwrapMotionComponent=function(t){if(Ja(t))return t[R]},t.useAnimation=Za,t.useAnimationControls=qa,t.useAnimationFrame=$a,t.useCycle=function(...t){const n=e.useRef(0),[o,i]=e.useState(t[n.current]);return[o,e.useCallback(e=>{n.current="number"!=typeof e?((t,e,n)=>{const o=e-t;return((n-t)%o+o)%o+t})(0,t.length,n.current+1):e,i(t[n.current])},[t.length,...t])]},t.useDeprecatedAnimatedState=function(t){const[n,o]=e.useState(t),i=ol({},!1),r=S(()=>new nl({props:{},visualState:i},{initialState:t}));return e.useEffect(()=>(r.mount({}),()=>r.unmount()),[r]),e.useEffect(()=>{r.setProps({onUpdate:t=>{o({...t})}})},[o,r]),[n,S(()=>t=>ni(r,t))]},t.useDeprecatedInvertedScale=function(t){let e=_s(1),n=_s(1);const o=l();return t?(e=t.scaleX||e,n=t.scaleY||n):o&&(e=o.getValue("scaleX",1),n=o.getValue("scaleY",1)),{scaleX:ta(e,il),scaleY:ta(n,il)}},t.useDomEvent=le,t.useDragControls=function(){return S(_a)},t.useElementScroll=function(t){return eo(!1,"useElementScroll is deprecated. Convert to useScroll({ container: ref })."),Ha({container:t})},t.useForceUpdate=Bs,t.useInView=function(t,{root:n,margin:o,amount:i,once:r=!1}={}){const[s,a]=e.useState(!1);return e.useEffect(()=>{if(!t.current||r&&s)return;const e={root:n&&n.current||void 0,margin:o,amount:"some"===i?"any":i};return function(t,e,{root:n,margin:o,amount:i="any"}={}){if("undefined"==typeof IntersectionObserver)return()=>{};const r=ga(t),s=new WeakMap,a=new IntersectionObserver(t=>{t.forEach(t=>{const n=s.get(t.target);if(t.isIntersecting!==Boolean(n))if(t.isIntersecting){const n=e(t);fa(n)?s.set(t.target,n):a.unobserve(t.target)}else n&&(n(t),s.delete(t.target))})},{root:n,rootMargin:o,threshold:"number"==typeof i?i:va[i]});return r.forEach(t=>a.observe(t)),()=>a.disconnect()}(t.current,()=>(a(!0),r?void 0:()=>a(!1)),e)},[n,t,o,r]),s},t.useInstantLayoutTransition=Qa,t.useInstantTransition=function(){const[t,n]=Bs(),o=Qa();return e.useEffect(()=>{Dn.postRender(()=>Dn.postRender(()=>Co.current=!1))},[n]),e=>{o(()=>{Co.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 Qs(e,(function(){let o="";for(let i=0;i<n;i++){o+=t[i];e[i]&&(o+=e[i].get())}return o}))},t.useMotionValue=_s,t.usePresence=po,t.useReducedMotion=Xa,t.useReducedMotionConfig=function(){const t=Xa(),{reducedMotion:n}=e.useContext(s);return"never"!==n&&("always"===n||t)},t.useResetProjection=function(){return r.useCallback(()=>{const t=Cs.current;t&&t.resetTree()},[])},t.useScroll=Ha,t.useSpring=function(t,n={}){const{isStatic:o}=e.useContext(s),i=e.useRef(null),r=_s(z(t)?t.get():t);return e.useMemo(()=>r.attach((t,e)=>o?e(t):(i.current&&i.current.stop(),i.current=zn({from:r.get(),to:t,velocity:r.getVelocity(),...n,onUpdate:e}),r.get())),[JSON.stringify(n)]),function(t,e){h(()=>{if(z(t))return t.onChange(e)},[e])}(t,t=>r.set(parseFloat(t))),r},t.useTime=function(){const t=_s(0);return $a(e=>t.set(e)),t},t.useTransform=ta,t.useUnmountEffect=Ce,t.useVelocity=function(t){const n=_s(t.getVelocity());return e.useEffect(()=>t.velocityUpdateSubscribers.add(t=>{n.set(t)}),[t]),n},t.useViewportScroll=function(){return eo(!1,"useViewportScroll is deprecated. Convert to useScroll()."),Ha()},t.useVisualElementContext=l,t.useWillChange=function(){return S(()=>new Ya("auto"))},t.wrapHandler=me,Object.defineProperty(t,"__esModule",{value:!0})}));
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Motion={},t.React)}(this,(function(t,e){"use strict";function n(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}function o(t){if(t&&t.__esModule)return t;var e=Object.create(null);return t&&Object.keys(t).forEach((function(n){if("default"!==n){var o=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,o.get?o:{enumerable:!0,get:function(){return t[n]}})}})),e.default=t,Object.freeze(e)}var i=n(e),r=o(e);const s=e.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),a=e.createContext({});function l(){return e.useContext(a).visualElement}const u=e.createContext(null),c="undefined"!=typeof document,h=c?e.useLayoutEffect:e.useEffect,d=e.createContext({strict:!1});function p(t){return"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}function f(t){return"string"==typeof t||Array.isArray(t)}function m(t){return"object"==typeof t&&"function"==typeof t.start}const g=["initial","animate","exit","whileHover","whileDrag","whileTap","whileFocus","whileInView"];function v(t){return m(t.animate)||g.some(e=>f(t[e]))}function y(t){return Boolean(v(t)||t.variants)}function x(t){const{initial:n,animate:o}=function(t,e){if(v(t)){const{initial:e,animate:n}=t;return{initial:!1===e||f(e)?e:void 0,animate:f(n)?n:void 0}}return!1!==t.inherit?e:{}}(t,e.useContext(a));return e.useMemo(()=>({initial:n,animate:o}),[b(n),b(o)])}function b(t){return Array.isArray(t)?t.join(" "):t}const E=t=>({isEnabled:e=>t.some(t=>!!e[t])}),w={measureLayout:E(["layout","layoutId","drag"]),animation:E(["animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView"]),exit:E(["exit"]),drag:E(["drag","dragControls"]),focus:E(["whileFocus"]),hover:E(["whileHover","onHoverStart","onHoverEnd"]),tap:E(["whileTap","onTap","onTapStart","onTapCancel"]),pan:E(["onPan","onPanStart","onPanSessionStart","onPanEnd"]),inView:E(["whileInView","onViewportEnter","onViewportLeave"])};function P(t){for(const e in t)"projectionNodeConstructor"===e?w.projectionNodeConstructor=t[e]:w[e].Component=t[e]}function S(t){const n=e.useRef(null);return null===n.current&&(n.current=t()),n.current}const T={hasAnimatedSinceResize:!0,hasEverUpdated:!1};let A=1;const V=e.createContext({});class C extends i.default.Component{getSnapshotBeforeUpdate(){const{visualElement:t,props:e}=this.props;return t&&t.setProps(e),null}componentDidUpdate(){}render(){return this.props.children}}const M=e.createContext({}),R=Symbol.for("motionComponentSymbol");function L({preloadedFeatures:t,createVisualElement:n,projectionNodeConstructor:o,useRender:i,useVisualState:f,Component:m}){t&&P(t);const g=e.forwardRef((function(g,v){const y={...e.useContext(s),...g,layoutId:D(g)},{isStatic:b}=y;let E=null;const P=x(g),V=b?void 0:S(()=>{if(T.hasEverUpdated)return A++}),R=f(g,b);if(!b&&c){P.visualElement=function(t,n,o,i){const r=l(),a=e.useContext(d),c=e.useContext(u),p=e.useContext(s).reducedMotion,f=e.useRef();i=i||a.renderer,!f.current&&i&&(f.current=i(t,{visualState:n,parent:r,props:o,presenceId:c?c.id:void 0,blockInitialAnimation:!!c&&!1===c.initial,reducedMotionConfig:p}));const m=f.current;return h(()=>{m&&m.render()}),e.useEffect(()=>{m&&m.animationState&&m.animationState.animateChanges()}),h(()=>()=>m&&m.notify("Unmount"),[]),m}(m,R,y,n);const i=e.useContext(d).strict,r=e.useContext(M);P.visualElement&&(E=P.visualElement.loadFeatures(y,i,t,V,o||w.projectionNodeConstructor,r))}return r.createElement(C,{visualElement:P.visualElement,props:y},E,r.createElement(a.Provider,{value:P},i(m,g,V,function(t,n,o){return e.useCallback(e=>{e&&t.mount&&t.mount(e),n&&(e?n.mount(e):n.unmount()),o&&("function"==typeof o?o(e):p(o)&&(o.current=e))},[n])}(R,P.visualElement,v),R,b,P.visualElement)))}));return g[R]=m,g}function D({layoutId:t}){const n=e.useContext(V).id;return n&&void 0!==t?n+"-"+t:t}function O(t){function e(e,n={}){return L(t(e,n))}if("undefined"==typeof Proxy)return e;const n=new Map;return new Proxy(e,{get:(t,o)=>(n.has(o)||n.set(o,e(o)),n.get(o))})}const B=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","text","tspan","use","view"];function k(t){return"string"==typeof t&&!t.includes("-")&&!!(B.indexOf(t)>-1||/[A-Z]/.test(t))}const j={};function F(t){Object.assign(j,t)}const I=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],U=new Set(I);function N(t,{layout:e,layoutId:n}){return U.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!j[t]||"opacity"===t)}const z=t=>!!(null==t?void 0:t.getVelocity),W={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},H=(t,e)=>I.indexOf(t)-I.indexOf(e);function $({transform:t,transformKeys:e},{enableHardwareAcceleration:n=!0,allowTransformNone:o=!0},i,r){let s="";e.sort(H);for(const n of e)s+=`${W[n]||n}(${t[n]}) `;return n&&!t.z&&(s+="translateZ(0)"),s=s.trim(),r?s=r(t,i?"":s):o&&i&&(s="none"),s}function Y(t){return t.startsWith("--")}const X=(t,e)=>e&&"number"==typeof t?e.transform(t):t,G=(t,e)=>n=>Math.max(Math.min(n,e),t),q=t=>t%1?Number(t.toFixed(5)):t,Z=/(-)?([\d]*\.?[\d])+/g,K=/(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,_=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function J(t){return"string"==typeof t}const Q={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},tt=Object.assign(Object.assign({},Q),{transform:G(0,1)}),et=Object.assign(Object.assign({},Q),{default:1}),nt=t=>({test:e=>J(e)&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),ot=nt("deg"),it=nt("%"),rt=nt("px"),st=nt("vh"),at=nt("vw"),lt=Object.assign(Object.assign({},it),{parse:t=>it.parse(t)/100,transform:t=>it.transform(100*t)}),ut=(t,e)=>n=>Boolean(J(n)&&_.test(n)&&n.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(n,e)),ct=(t,e,n)=>o=>{if(!J(o))return o;const[i,r,s,a]=o.match(Z);return{[t]:parseFloat(i),[e]:parseFloat(r),[n]:parseFloat(s),alpha:void 0!==a?parseFloat(a):1}},ht={test:ut("hsl","hue"),parse:ct("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:o=1})=>"hsla("+Math.round(t)+", "+it.transform(q(e))+", "+it.transform(q(n))+", "+q(tt.transform(o))+")"},dt=G(0,255),pt=Object.assign(Object.assign({},Q),{transform:t=>Math.round(dt(t))}),ft={test:ut("rgb","red"),parse:ct("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:o=1})=>"rgba("+pt.transform(t)+", "+pt.transform(e)+", "+pt.transform(n)+", "+q(tt.transform(o))+")"};const mt={test:ut("#"),parse:function(t){let e="",n="",o="",i="";return t.length>5?(e=t.substr(1,2),n=t.substr(3,2),o=t.substr(5,2),i=t.substr(7,2)):(e=t.substr(1,1),n=t.substr(2,1),o=t.substr(3,1),i=t.substr(4,1),e+=e,n+=n,o+=o,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(o,16),alpha:i?parseInt(i,16)/255:1}},transform:ft.transform},gt={test:t=>ft.test(t)||mt.test(t)||ht.test(t),parse:t=>ft.test(t)?ft.parse(t):ht.test(t)?ht.parse(t):mt.parse(t),transform:t=>J(t)?t:t.hasOwnProperty("red")?ft.transform(t):ht.transform(t)};function vt(t){"number"==typeof t&&(t=""+t);const e=[];let n=0;const o=t.match(K);o&&(n=o.length,t=t.replace(K,"${c}"),e.push(...o.map(gt.parse)));const i=t.match(Z);return i&&(t=t.replace(Z,"${n}"),e.push(...i.map(Q.parse))),{values:e,numColors:n,tokenised:t}}function yt(t){return vt(t).values}function xt(t){const{values:e,numColors:n,tokenised:o}=vt(t),i=e.length;return t=>{let e=o;for(let o=0;o<i;o++)e=e.replace(o<n?"${c}":"${n}",o<n?gt.transform(t[o]):q(t[o]));return e}}const bt=t=>"number"==typeof t?0:t;const Et={test:function(t){var e,n,o,i;return isNaN(t)&&J(t)&&(null!==(n=null===(e=t.match(Z))||void 0===e?void 0:e.length)&&void 0!==n?n:0)+(null!==(i=null===(o=t.match(K))||void 0===o?void 0:o.length)&&void 0!==i?i:0)>0},parse:yt,createTransformer:xt,getAnimatableNone:function(t){const e=yt(t);return xt(t)(e.map(bt))}},wt=new Set(["brightness","contrast","saturate","opacity"]);function Pt(t){let[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[o]=n.match(Z)||[];if(!o)return t;const i=n.replace(o,"");let r=wt.has(e)?1:0;return o!==n&&(r*=100),e+"("+r+i+")"}const St=/([a-z-]*)\(.*?\)/g,Tt=Object.assign(Object.assign({},Et),{getAnimatableNone:t=>{const e=t.match(St);return e?e.map(Pt).join(" "):t}}),At={...Q,transform:Math.round},Vt={borderWidth:rt,borderTopWidth:rt,borderRightWidth:rt,borderBottomWidth:rt,borderLeftWidth:rt,borderRadius:rt,radius:rt,borderTopLeftRadius:rt,borderTopRightRadius:rt,borderBottomRightRadius:rt,borderBottomLeftRadius:rt,width:rt,maxWidth:rt,height:rt,maxHeight:rt,size:rt,top:rt,right:rt,bottom:rt,left:rt,padding:rt,paddingTop:rt,paddingRight:rt,paddingBottom:rt,paddingLeft:rt,margin:rt,marginTop:rt,marginRight:rt,marginBottom:rt,marginLeft:rt,rotate:ot,rotateX:ot,rotateY:ot,rotateZ:ot,scale:et,scaleX:et,scaleY:et,scaleZ:et,skew:ot,skewX:ot,skewY:ot,distance:rt,translateX:rt,translateY:rt,translateZ:rt,x:rt,y:rt,z:rt,perspective:rt,transformPerspective:rt,opacity:tt,originX:lt,originY:lt,originZ:rt,zIndex:At,fillOpacity:tt,strokeOpacity:tt,numOctaves:At};function Ct(t,e,n,o){const{style:i,vars:r,transform:s,transformKeys:a,transformOrigin:l}=t;a.length=0;let u=!1,c=!1,h=!0;for(const t in e){const n=e[t];if(Y(t)){r[t]=n;continue}const o=Vt[t],d=X(n,o);if(U.has(t)){if(u=!0,s[t]=d,a.push(t),!h)continue;n!==(o.default||0)&&(h=!1)}else t.startsWith("origin")?(c=!0,l[t]=d):i[t]=d}if(e.transform||(u||o?i.transform=$(t,n,h,o):i.transform&&(i.transform="none")),c){const{originX:t="50%",originY:e="50%",originZ:n=0}=l;i.transformOrigin=`${t} ${e} ${n}`}}const Mt=()=>({style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}});function Rt(t,e,n){for(const o in e)z(e[o])||N(o,n)||(t[o]=e[o])}function Lt(t,n,o){const i={};return Rt(i,t.style||{},t),Object.assign(i,function({transformTemplate:t},n,o){return e.useMemo(()=>{const e={style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}};return Ct(e,n,{enableHardwareAcceleration:!o},t),Object.assign({},e.vars,e.style)},[n])}(t,n,o)),t.transformValues?t.transformValues(i):i}function Dt(t,e,n){const o={},i=Lt(t,e,n);return t.drag&&!1!==t.dragListener&&(o.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=!0===t.drag?"none":"pan-"+("x"===t.drag?"y":"x")),o.style=i,o}const Ot=new Set(["initial","style","values","variants","transition","transformTemplate","transformValues","custom","inherit","layout","layoutId","layoutDependency","onLayoutAnimationStart","onLayoutAnimationComplete","onLayoutMeasure","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","drag","dragControls","dragListener","dragConstraints","dragDirectionLock","dragSnapToOrigin","_dragX","_dragY","dragElastic","dragMomentum","dragPropagation","dragTransition","onHoverStart","onHoverEnd","layoutScroll","whileInView","onViewportEnter","onViewportLeave","viewport","whileTap","onTap","onTapStart","onTapCancel","animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView","onPan","onPanStart","onPanSessionStart","onPanEnd"]);function Bt(t){return Ot.has(t)}let kt=t=>!Bt(t);function jt(t){t&&(kt=e=>e.startsWith("on")?!Bt(e):t(e))}try{jt(require("@emotion/is-prop-valid").default)}catch(t){}function Ft(t,e,n){const o={};for(const i in t)(kt(i)||!0===n&&Bt(i)||!e&&!Bt(i)||t.draggable&&i.startsWith("onDrag"))&&(o[i]=t[i]);return o}function It(t,e,n){return"string"==typeof t?t:rt.transform(e+n*t)}const Ut={offset:"stroke-dashoffset",array:"stroke-dasharray"},Nt={offset:"strokeDashoffset",array:"strokeDasharray"};function zt(t,{attrX:e,attrY:n,originX:o,originY:i,pathLength:r,pathSpacing:s=1,pathOffset:a=0,...l},u,c){Ct(t,l,u,c),t.attrs=t.style,t.style={};const{attrs:h,style:d,dimensions:p}=t;h.transform&&(p&&(d.transform=h.transform),delete h.transform),p&&(void 0!==o||void 0!==i||d.transform)&&(d.transformOrigin=function(t,e,n){return`${It(e,t.x,t.width)} ${It(n,t.y,t.height)}`}(p,void 0!==o?o:.5,void 0!==i?i:.5)),void 0!==e&&(h.x=e),void 0!==n&&(h.y=n),void 0!==r&&function(t,e,n=1,o=0,i=!0){t.pathLength=1;const r=i?Ut:Nt;t[r.offset]=rt.transform(-o);const s=rt.transform(e),a=rt.transform(n);t[r.array]=`${s} ${a}`}(h,r,s,a,!1)}const Wt=()=>({style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{},attrs:{}});function Ht(t,n){const o=e.useMemo(()=>{const e={style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{},attrs:{}};return zt(e,n,{enableHardwareAcceleration:!1},t.transformTemplate),{...e.attrs,style:{...e.style}}},[n]);if(t.style){const e={};Rt(e,t.style,t),o.style={...e,...o.style}}return o}function $t(t=!1){return(n,o,i,r,{latestValues:s},a)=>{const l=(k(n)?Ht:Dt)(o,s,a),u={...Ft(o,"string"==typeof n,t),...l,ref:r};return i&&(u["data-projection-id"]=i),e.createElement(n,u)}}const Yt=t=>t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();function Xt(t,{style:e,vars:n},o,i){Object.assign(t.style,e,i&&i.getProjectionStyles(o));for(const e in n)t.style.setProperty(e,n[e])}const Gt=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength"]);function qt(t,e,n,o){Xt(t,e,void 0,o);for(const n in e.attrs)t.setAttribute(Gt.has(n)?n:Yt(n),e.attrs[n])}function Zt(t){const{style:e}=t,n={};for(const o in e)(z(e[o])||N(o,t))&&(n[o]=e[o]);return n}function Kt(t){const e=Zt(t);for(const n in t)if(z(t[n])){e["x"===n||"y"===n?"attr"+n.toUpperCase():n]=t[n]}return e}function _t(t,e,n,o={},i={}){return"function"==typeof e&&(e=e(void 0!==n?n:t.custom,o,i)),"string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e&&(e=e(void 0!==n?n:t.custom,o,i)),e}const Jt=t=>Array.isArray(t),Qt=t=>Jt(t)?t[t.length-1]||0:t;function te(t){const e=z(t)?t.get():t;return n=e,Boolean(n&&"object"==typeof n&&n.mix&&n.toValue)?e.toValue():e;var n}const ee=t=>(n,o)=>{const i=e.useContext(a),r=e.useContext(u),s=()=>function({scrapeMotionValuesFromProps:t,createRenderState:e,onMount:n},o,i,r){const s={latestValues:ne(o,i,r,t),renderState:e()};return n&&(s.mount=t=>n(o,t,s)),s}(t,n,i,r);return o?s():S(s)};function ne(t,e,n,o){const i={},r=o(t);for(const t in r)i[t]=te(r[t]);let{initial:s,animate:a}=t;const l=v(t),u=y(t);e&&u&&!l&&!1!==t.inherit&&(void 0===s&&(s=e.initial),void 0===a&&(a=e.animate));let c=!!n&&!1===n.initial;c=c||!1===s;const h=c?a:s;if(h&&"boolean"!=typeof h&&!m(h)){(Array.isArray(h)?h:[h]).forEach(e=>{const n=_t(t,e);if(!n)return;const{transitionEnd:o,transition:r,...s}=n;for(const t in s){let e=s[t];if(Array.isArray(e)){e=e[c?e.length-1:0]}null!==e&&(i[t]=e)}for(const t in o)i[t]=o[t]})}return i}const oe={useVisualState:ee({scrapeMotionValuesFromProps:Kt,createRenderState:Wt,onMount:(t,e,{renderState:n,latestValues:o})=>{try{n.dimensions="function"==typeof e.getBBox?e.getBBox():e.getBoundingClientRect()}catch(t){n.dimensions={x:0,y:0,width:0,height:0}}zt(n,o,{enableHardwareAcceleration:!1},t.transformTemplate),qt(e,n)}})},ie={useVisualState:ee({scrapeMotionValuesFromProps:Zt,createRenderState:Mt})};function re(t,{forwardMotionProps:e=!1},n,o,i){return{...k(t)?oe:ie,preloadedFeatures:n,useRender:$t(e),createVisualElement:o,projectionNodeConstructor:i,Component:t}}var se;function ae(t,e,n,o={passive:!0}){return t.addEventListener(e,n,o),()=>t.removeEventListener(e,n)}function le(t,n,o,i){e.useEffect(()=>{const e=t.current;if(o&&e)return ae(e,n,o,i)},[t,n,o,i])}function ue(t){return"undefined"!=typeof PointerEvent&&t instanceof PointerEvent?!("mouse"!==t.pointerType):t instanceof MouseEvent}function ce(t){return!!t.touches}t.AnimationType=void 0,(se=t.AnimationType||(t.AnimationType={})).Animate="animate",se.Hover="whileHover",se.Tap="whileTap",se.Drag="whileDrag",se.Focus="whileFocus",se.InView="whileInView",se.Exit="exit";const he={pageX:0,pageY:0};function de(t,e="page"){const n=t.touches[0]||t.changedTouches[0]||he;return{x:n[e+"X"],y:n[e+"Y"]}}function pe(t,e="page"){return{x:t[e+"X"],y:t[e+"Y"]}}function fe(t,e="page"){return{point:ce(t)?de(t,e):pe(t,e)}}const me=(t,e=!1)=>{const n=e=>t(e,fe(e));return e?(o=n,t=>{const e=t instanceof MouseEvent;(!e||e&&0===t.button)&&o(t)}):n;var o},ge={pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointercancel:"mousecancel",pointerover:"mouseover",pointerout:"mouseout",pointerenter:"mouseenter",pointerleave:"mouseleave"},ve={pointerdown:"touchstart",pointermove:"touchmove",pointerup:"touchend",pointercancel:"touchcancel"};function ye(t){return c&&null===window.onpointerdown?t:c&&null===window.ontouchstart?ve[t]:c&&null===window.onmousedown?ge[t]:t}function xe(t,e,n,o){return ae(t,ye(e),me(n,"pointerdown"===e),o)}function be(t,e,n,o){return le(t,ye(e),n&&me(n,"pointerdown"===e),o)}function Ee(t){let e=null;return()=>{const n=()=>{e=null};return null===e&&(e=t,n)}}const we=Ee("dragHorizontal"),Pe=Ee("dragVertical");function Se(t){let e=!1;if("y"===t)e=Pe();else if("x"===t)e=we();else{const t=we(),n=Pe();t&&n?e=()=>{t(),n()}:(t&&t(),n&&n())}return e}function Te(){const t=Se(!0);return!t||(t(),!1)}function Ae(e,n,o){return(i,r)=>{ue(i)&&!Te()&&(e.animationState&&e.animationState.setActive(t.AnimationType.Hover,n),o&&o(i,r))}}const Ve=(t,e)=>!!e&&(t===e||Ve(t,e.parentElement));function Ce(t){return e.useEffect(()=>()=>t(),[])}function Me(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(t);i<o.length;i++)e.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(t,o[i])&&(n[o[i]]=t[o[i]])}return n}const Re=(t,e,n)=>Math.min(Math.max(n,t),e);function Le({duration:t=800,bounce:e=.25,velocity:n=0,mass:o=1}){let i,r,s=1-e;s=Re(.05,1,s),t=Re(.01,10,t/1e3),s<1?(i=e=>{const o=e*s,i=o*t;return.001-(o-n)/De(e,s)*Math.exp(-i)},r=e=>{const o=e*s*t,r=o*n+n,a=Math.pow(s,2)*Math.pow(e,2)*t,l=Math.exp(-o),u=De(Math.pow(e,2),s);return(.001-i(e)>0?-1:1)*((r-a)*l)/u}):(i=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,r=e=>Math.exp(-e*t)*(t*t*(n-e)));const a=function(t,e,n){let o=n;for(let n=1;n<12;n++)o-=t(o)/e(o);return o}(i,r,5/t);if(t*=1e3,isNaN(a))return{stiffness:100,damping:10,duration:t};{const e=Math.pow(a,2)*o;return{stiffness:e,damping:2*s*Math.sqrt(o*e),duration:t}}}function De(t,e){return t*Math.sqrt(1-e*e)}const Oe=["duration","bounce"],Be=["stiffness","damping","mass"];function ke(t,e){return e.some(e=>void 0!==t[e])}function je(t){var{from:e=0,to:n=1,restSpeed:o=2,restDelta:i}=t,r=Me(t,["from","to","restSpeed","restDelta"]);const s={done:!1,value:e};let{stiffness:a,damping:l,mass:u,velocity:c,duration:h,isResolvedFromDuration:d}=function(t){let e=Object.assign({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},t);if(!ke(t,Be)&&ke(t,Oe)){const n=Le(t);e=Object.assign(Object.assign(Object.assign({},e),n),{velocity:0,mass:1}),e.isResolvedFromDuration=!0}return e}(r),p=Fe,f=Fe;function m(){const t=c?-c/1e3:0,o=n-e,r=l/(2*Math.sqrt(a*u)),s=Math.sqrt(a/u)/1e3;if(void 0===i&&(i=Math.min(Math.abs(n-e)/100,.4)),r<1){const e=De(s,r);p=i=>{const a=Math.exp(-r*s*i);return n-a*((t+r*s*o)/e*Math.sin(e*i)+o*Math.cos(e*i))},f=n=>{const i=Math.exp(-r*s*n);return r*s*i*(Math.sin(e*n)*(t+r*s*o)/e+o*Math.cos(e*n))-i*(Math.cos(e*n)*(t+r*s*o)-e*o*Math.sin(e*n))}}else if(1===r)p=e=>n-Math.exp(-s*e)*(o+(t+s*o)*e);else{const e=s*Math.sqrt(r*r-1);p=i=>{const a=Math.exp(-r*s*i),l=Math.min(e*i,300);return n-a*((t+r*s*o)*Math.sinh(l)+e*o*Math.cosh(l))/e}}}return m(),{next:t=>{const e=p(t);if(d)s.done=t>=h;else{const r=1e3*f(t),a=Math.abs(r)<=o,l=Math.abs(n-e)<=i;s.done=a&&l}return s.value=s.done?n:e,s},flipTarget:()=>{c=-c,[e,n]=[n,e],m()}}}je.needsInterpolation=(t,e)=>"string"==typeof t||"string"==typeof e;const Fe=t=>0,Ie=(t,e,n)=>{const o=e-t;return 0===o?1:(n-t)/o},Ue=(t,e,n)=>-n*t+n*e+t;function Ne(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function ze({hue:t,saturation:e,lightness:n,alpha:o}){t/=360,n/=100;let i=0,r=0,s=0;if(e/=100){const o=n<.5?n*(1+e):n+e-n*e,a=2*n-o;i=Ne(a,o,t+1/3),r=Ne(a,o,t),s=Ne(a,o,t-1/3)}else i=r=s=n;return{red:Math.round(255*i),green:Math.round(255*r),blue:Math.round(255*s),alpha:o}}const We=(t,e,n)=>{const o=t*t,i=e*e;return Math.sqrt(Math.max(0,n*(i-o)+o))},He=[mt,ft,ht],$e=t=>He.find(e=>e.test(t)),Ye=(t,e)=>{let n=$e(t),o=$e(e),i=n.parse(t),r=o.parse(e);n===ht&&(i=ze(i),n=ft),o===ht&&(r=ze(r),o=ft);const s=Object.assign({},i);return t=>{for(const e in s)"alpha"!==e&&(s[e]=We(i[e],r[e],t));return s.alpha=Ue(i.alpha,r.alpha,t),n.transform(s)}},Xe=t=>"number"==typeof t,Ge=(t,e)=>n=>e(t(n)),qe=(...t)=>t.reduce(Ge);function Ze(t,e){return Xe(t)?n=>Ue(t,e,n):gt.test(t)?Ye(t,e):Qe(t,e)}const Ke=(t,e)=>{const n=[...t],o=n.length,i=t.map((t,n)=>Ze(t,e[n]));return t=>{for(let e=0;e<o;e++)n[e]=i[e](t);return n}},_e=(t,e)=>{const n=Object.assign(Object.assign({},t),e),o={};for(const i in n)void 0!==t[i]&&void 0!==e[i]&&(o[i]=Ze(t[i],e[i]));return t=>{for(const e in o)n[e]=o[e](t);return n}};function Je(t){const e=Et.parse(t),n=e.length;let o=0,i=0,r=0;for(let t=0;t<n;t++)o||"number"==typeof e[t]?o++:void 0!==e[t].hue?r++:i++;return{parsed:e,numNumbers:o,numRGB:i,numHSL:r}}const Qe=(t,e)=>{const n=Et.createTransformer(e),o=Je(t),i=Je(e);return o.numHSL===i.numHSL&&o.numRGB===i.numRGB&&o.numNumbers>=i.numNumbers?qe(Ke(o.parsed,i.parsed),n):n=>""+(n>0?e:t)},tn=(t,e)=>n=>Ue(t,e,n);function en(t,e,n){const o=[],i=n||("number"==typeof(r=t[0])?tn:"string"==typeof r?gt.test(r)?Ye:Qe:Array.isArray(r)?Ke:"object"==typeof r?_e:void 0);var r;const s=t.length-1;for(let n=0;n<s;n++){let r=i(t[n],t[n+1]);if(e){const t=Array.isArray(e)?e[n]:e;r=qe(t,r)}o.push(r)}return o}function nn(t,e,{clamp:n=!0,ease:o,mixer:i}={}){const r=t.length;e.length,!o||!Array.isArray(o)||o.length,t[0]>t[r-1]&&(t=[].concat(t),e=[].concat(e),t.reverse(),e.reverse());const s=en(e,o,i),a=2===r?function([t,e],[n]){return o=>n(Ie(t,e,o))}(t,s):function(t,e){const n=t.length,o=n-1;return i=>{let r=0,s=!1;if(i<=t[0]?s=!0:i>=t[o]&&(r=o-1,s=!0),!s){let e=1;for(;e<n&&!(t[e]>i||e===o);e++);r=e-1}const a=Ie(t[r],t[r+1],i);return e[r](a)}}(t,s);return n?e=>a(Re(t[0],t[r-1],e)):a}const on=t=>e=>1-t(1-e),rn=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,sn=t=>e=>e*e*((t+1)*e-t),an=t=>t,ln=(un=2,t=>Math.pow(t,un));var un;const cn=on(ln),hn=rn(ln),dn=t=>1-Math.sin(Math.acos(t)),pn=on(dn),fn=rn(pn),mn=sn(1.525),gn=on(mn),vn=rn(mn),yn=(t=>{const e=sn(t);return t=>(t*=2)<1?.5*e(t):.5*(2-Math.pow(2,-10*(t-1)))})(1.525),xn=t=>{if(1===t||0===t)return t;const e=t*t;return t<4/11?7.5625*e:t<8/11?9.075*e-9.9*t+3.4:t<.9?4356/361*e-35442/1805*t+16061/1805:10.8*t*t-20.52*t+10.72},bn=on(xn);function En(t,e){return t.map(()=>e||hn).splice(0,t.length-1)}function wn({from:t=0,to:e=1,ease:n,offset:o,duration:i=300}){const r={done:!1,value:t},s=Array.isArray(e)?e:[t,e],a=function(t,e){return t.map(t=>t*e)}(o&&o.length===s.length?o:function(t){const e=t.length;return t.map((t,n)=>0!==n?n/(e-1):0)}(s),i);function l(){return nn(a,s,{ease:Array.isArray(n)?n:En(s,n)})}let u=l();return{next:t=>(r.value=u(t),r.done=t>=i,r),flipTarget:()=>{s.reverse(),u=l()}}}const Pn={keyframes:wn,spring:je,decay:function({velocity:t=0,from:e=0,power:n=.8,timeConstant:o=350,restDelta:i=.5,modifyTarget:r}){const s={done:!1,value:e};let a=n*t;const l=e+a,u=void 0===r?l:r(l);return u!==l&&(a=u-e),{next:t=>{const e=-a*Math.exp(-t/o);return s.done=!(e>i||e<-i),s.value=s.done?u:u+e,s},flipTarget:()=>{}}}};const Sn="undefined"!=typeof performance?()=>performance.now():()=>Date.now(),Tn="undefined"!=typeof window?t=>window.requestAnimationFrame(t):t=>setTimeout(()=>t(Sn()),1/60*1e3);let An=!0,Vn=!1,Cn=!1;const Mn={delta:0,timestamp:0},Rn=["read","update","preRender","render","postRender"],Ln=Rn.reduce((t,e)=>(t[e]=function(t){let e=[],n=[],o=0,i=!1,r=!1;const s=new WeakSet,a={schedule:(t,r=!1,a=!1)=>{const l=a&&i,u=l?e:n;return r&&s.add(t),-1===u.indexOf(t)&&(u.push(t),l&&i&&(o=e.length)),t},cancel:t=>{const e=n.indexOf(t);-1!==e&&n.splice(e,1),s.delete(t)},process:l=>{if(i)r=!0;else{if(i=!0,[e,n]=[n,e],n.length=0,o=e.length,o)for(let n=0;n<o;n++){const o=e[n];o(l),s.has(o)&&(a.schedule(o),t())}i=!1,r&&(r=!1,a.process(l))}}};return a}(()=>Vn=!0),t),{}),Dn=Rn.reduce((t,e)=>{const n=Ln[e];return t[e]=(t,e=!1,o=!1)=>(Vn||Fn(),n.schedule(t,e,o)),t},{}),On=Rn.reduce((t,e)=>(t[e]=Ln[e].cancel,t),{}),Bn=Rn.reduce((t,e)=>(t[e]=()=>Ln[e].process(Mn),t),{}),kn=t=>Ln[t].process(Mn),jn=t=>{Vn=!1,Mn.delta=An?1/60*1e3:Math.max(Math.min(t-Mn.timestamp,40),1),Mn.timestamp=t,Cn=!0,Rn.forEach(kn),Cn=!1,Vn&&(An=!1,Tn(jn))},Fn=()=>{Vn=!0,An=!0,Cn||Tn(jn)},In=()=>Mn;function Un(t,e,n=0){return t-e-n}const Nn=t=>{const e=({delta:e})=>t(e);return{start:()=>Dn.update(e,!0),stop:()=>On.update(e)}};function zn(t){var e,n,{from:o,autoplay:i=!0,driver:r=Nn,elapsed:s=0,repeat:a=0,repeatType:l="loop",repeatDelay:u=0,onPlay:c,onStop:h,onComplete:d,onRepeat:p,onUpdate:f}=t,m=Me(t,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]);let g,v,y,{to:x}=m,b=0,E=m.duration,w=!1,P=!0;const S=function(t){if(Array.isArray(t.to))return wn;if(Pn[t.type])return Pn[t.type];const e=new Set(Object.keys(t));return e.has("ease")||e.has("duration")&&!e.has("dampingRatio")?wn:e.has("dampingRatio")||e.has("stiffness")||e.has("mass")||e.has("damping")||e.has("restSpeed")||e.has("restDelta")?je:wn}(m);(null===(n=(e=S).needsInterpolation)||void 0===n?void 0:n.call(e,o,x))&&(y=nn([0,100],[o,x],{clamp:!1}),o=0,x=100);const T=S(Object.assign(Object.assign({},m),{from:o,to:x}));function A(){b++,"reverse"===l?(P=b%2==0,s=function(t,e,n=0,o=!0){return o?Un(e+-t,e,n):e-(t-e)+n}(s,E,u,P)):(s=Un(s,E,u),"mirror"===l&&T.flipTarget()),w=!1,p&&p()}function V(t){if(P||(t=-t),s+=t,!w){const t=T.next(Math.max(0,s));v=t.value,y&&(v=y(v)),w=P?t.done:s<=0}null==f||f(v),w&&(0===b&&(null!=E||(E=s)),b<a?function(t,e,n,o){return o?t>=e+n:t<=-n}(s,E,u,P)&&A():(g.stop(),d&&d()))}return i&&(null==c||c(),g=r(V),g.start()),{stop:()=>{null==h||h(),g.stop()}}}function Wn(t,e){return e?t*(1e3/e):0}const Hn=t=>t.hasOwnProperty("x")&&t.hasOwnProperty("y"),$n=t=>Hn(t)&&t.hasOwnProperty("z"),Yn=(t,e)=>Math.abs(t-e);function Xn(t,e){if(Xe(t)&&Xe(e))return Yn(t,e);if(Hn(t)&&Hn(e)){const n=Yn(t.x,e.x),o=Yn(t.y,e.y),i=$n(t)&&$n(e)?Yn(t.z,e.z):0;return Math.sqrt(Math.pow(n,2)+Math.pow(o,2)+Math.pow(i,2))}}const Gn=(t,e)=>1-3*e+3*t,qn=(t,e)=>3*e-6*t,Zn=t=>3*t,Kn=(t,e,n)=>((Gn(e,n)*t+qn(e,n))*t+Zn(e))*t,_n=(t,e,n)=>3*Gn(e,n)*t*t+2*qn(e,n)*t+Zn(e);function Jn(t,e,n,o){if(t===e&&n===o)return an;const i=new Float32Array(11);for(let e=0;e<11;++e)i[e]=Kn(.1*e,t,n);function r(e){let o=0,r=1;for(;10!==r&&i[r]<=e;++r)o+=.1;--r;const s=o+.1*((e-i[r])/(i[r+1]-i[r])),a=_n(s,t,n);return a>=.001?function(t,e,n,o){for(let i=0;i<8;++i){const i=_n(e,n,o);if(0===i)return e;e-=(Kn(e,n,o)-t)/i}return e}(e,s,t,n):0===a?s:function(t,e,n,o,i){let r,s,a=0;do{s=e+(n-e)/2,r=Kn(s,o,i)-t,r>0?n=s:e=s}while(Math.abs(r)>1e-7&&++a<10);return s}(e,o,o+.1,t,n)}return t=>0===t||1===t?t:Kn(r(t),e,o)}const Qn=("undefined"==typeof process||process.env,"production"),to=new Set;function eo(t,e,n){t||to.has(e)||(console.warn(e),n&&console.warn(n),to.add(e))}const no=new WeakMap,oo=new WeakMap,io=t=>{const e=no.get(t.target);e&&e(t)},ro=t=>{t.forEach(io)};function so(t,e,n){const o=function({root:t,...e}){const n=t||document;oo.has(n)||oo.set(n,{});const o=oo.get(n),i=JSON.stringify(e);return o[i]||(o[i]=new IntersectionObserver(ro,{root:t,...e})),o[i]}(e);return no.set(t,n),o.observe(t),()=>{no.delete(t),o.unobserve(t)}}const ao={some:0,all:1};function lo(n,o,i,{root:r,margin:s,amount:a="some",once:l}){e.useEffect(()=>{if(!n||!i.current)return;const e={root:null==r?void 0:r.current,rootMargin:s,threshold:"number"==typeof a?a:ao[a]};return so(i.current,e,e=>{const{isIntersecting:n}=e;if(o.isInView===n)return;if(o.isInView=n,l&&!n&&o.hasEnteredView)return;n&&(o.hasEnteredView=!0),i.animationState&&i.animationState.setActive(t.AnimationType.InView,n);const r=i.getProps(),s=n?r.onViewportEnter:r.onViewportLeave;s&&s(e)})},[n,r,s,a])}function uo(n,o,i,{fallback:r=!0}){e.useEffect(()=>{n&&r&&("production"!==Qn&&eo(!1,"IntersectionObserver not available on this device. whileInView animations will trigger on mount."),requestAnimationFrame(()=>{o.hasEnteredView=!0;const{onViewportEnter:e}=i.getProps();e&&e(null),i.animationState&&i.animationState.setActive(t.AnimationType.InView,!0)}))},[n])}const co=t=>e=>(t(e),null),ho={inView:co((function({visualElement:t,whileInView:n,onViewportEnter:o,onViewportLeave:i,viewport:r={}}){const s=e.useRef({hasEnteredView:!1,isInView:!1});let a=Boolean(n||o||i);r.once&&s.current.hasEnteredView&&(a=!1),("undefined"==typeof IntersectionObserver?uo:lo)(a,s.current,t,r)})),tap:co((function({onTap:n,onTapStart:o,onTapCancel:i,whileTap:r,visualElement:s}){const a=n||o||i||r,l=e.useRef(!1),u=e.useRef(null),c={passive:!(o||n||i||m)};function h(){u.current&&u.current(),u.current=null}function d(){return h(),l.current=!1,s.animationState&&s.animationState.setActive(t.AnimationType.Tap,!1),!Te()}function p(t,e){d()&&(Ve(s.current,t.target)?n&&n(t,e):i&&i(t,e))}function f(t,e){d()&&i&&i(t,e)}function m(e,n){h(),l.current||(l.current=!0,u.current=qe(xe(window,"pointerup",p,c),xe(window,"pointercancel",f,c)),s.animationState&&s.animationState.setActive(t.AnimationType.Tap,!0),o&&o(e,n))}be(s,"pointerdown",a?m:void 0,c),Ce(h)})),focus:co((function({whileFocus:e,visualElement:n}){const{animationState:o}=n;le(n,"focus",e?()=>{o&&o.setActive(t.AnimationType.Focus,!0)}:void 0),le(n,"blur",e?()=>{o&&o.setActive(t.AnimationType.Focus,!1)}:void 0)})),hover:co((function({onHoverStart:t,onHoverEnd:e,whileHover:n,visualElement:o}){be(o,"pointerenter",t||n?Ae(o,!0,t):void 0,{passive:!t}),be(o,"pointerleave",e||n?Ae(o,!1,e):void 0,{passive:!e})}))};function po(){const t=e.useContext(u);if(null===t)return[!0,null];const{isPresent:n,onExitComplete:o,register:i}=t,r=e.useId();e.useEffect(()=>i(r),[]);return!n&&o?[!1,()=>o&&o(r)]:[!0]}function fo(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let o=0;o<n;o++)if(e[o]!==t[o])return!1;return!0}const mo=t=>1e3*t,go={linear:an,easeIn:ln,easeInOut:hn,easeOut:cn,circIn:dn,circInOut:fn,circOut:pn,backIn:mn,backInOut:vn,backOut:gn,anticipate:yn,bounceIn:bn,bounceInOut:t=>t<.5?.5*(1-xn(1-2*t)):.5*xn(2*t-1)+.5,bounceOut:xn},vo=t=>{if(Array.isArray(t)){t.length;const[e,n,o,i]=t;return Jn(e,n,o,i)}return"string"==typeof t?go[t]:t},yo=(t,e)=>"zIndex"!==t&&(!("number"!=typeof e&&!Array.isArray(e))||!("string"!=typeof e||!Et.test(e)||e.startsWith("url("))),xo=()=>({type:"spring",stiffness:500,damping:25,restSpeed:10}),bo=t=>({type:"spring",stiffness:550,damping:0===t?2*Math.sqrt(550):30,restSpeed:10}),Eo=()=>({type:"keyframes",ease:"linear",duration:.3}),wo=t=>({type:"keyframes",duration:.8,values:t}),Po={x:xo,y:xo,z:xo,rotate:xo,rotateX:xo,rotateY:xo,rotateZ:xo,scaleX:bo,scaleY:bo,scale:bo,opacity:Eo,backgroundColor:Eo,color:Eo,default:bo},So=(t,e)=>{let n;return n=Jt(e)?wo:Po[t]||Po.default,{to:e,...n(e)}},To={...Vt,color:gt,backgroundColor:gt,outlineColor:gt,fill:gt,stroke:gt,borderColor:gt,borderTopColor:gt,borderRightColor:gt,borderBottomColor:gt,borderLeftColor:gt,filter:Tt,WebkitFilter:Tt},Ao=t=>To[t];function Vo(t,e){var n;let o=Ao(t);return o!==Tt&&(o=Et),null===(n=o.getAnimatableNone)||void 0===n?void 0:n.call(o,e)}const Co={current:!1};function Mo(t,e){const n=performance.now(),o=({timestamp:i})=>{const r=i-n;r>=e&&(On.read(o),t(r-e))};return Dn.read(o,!0),()=>On.read(o)}function Ro({ease:t,times:e,yoyo:n,flip:o,loop:i,...r}){const s={...r};return e&&(s.offset=e),r.duration&&(s.duration=mo(r.duration)),r.repeatDelay&&(s.repeatDelay=mo(r.repeatDelay)),t&&(s.ease=(t=>Array.isArray(t)&&"number"!=typeof t[0])(t)?t.map(vo):vo(t)),"tween"===r.type&&(s.type="keyframes"),(n||i||o)&&(n?s.repeatType="reverse":i?s.repeatType="loop":o&&(s.repeatType="mirror"),s.repeat=i||n||o||r.repeat),"spring"!==r.type&&(s.type="keyframes"),s}function Lo(t,e,n){return Array.isArray(e.to)&&void 0===t.duration&&(t.duration=.8),function(t){Array.isArray(t.to)&&null===t.to[0]&&(t.to=[...t.to],t.to[0]=t.from)}(e),function({when:t,delay:e,delayChildren:n,staggerChildren:o,staggerDirection:i,repeat:r,repeatType:s,repeatDelay:a,from:l,...u}){return!!Object.keys(u).length}(t)||(t={...t,...So(n,e.to)}),{...e,...Ro(t)}}function Do(t,e,n,o,i){const r=ko(o,t)||{};let s=void 0!==r.from?r.from:e.get();const a=yo(t,n);"none"===s&&a&&"string"==typeof n?s=Vo(t,n):Oo(s)&&"string"==typeof n?s=Bo(n):!Array.isArray(n)&&Oo(n)&&"string"==typeof s&&(n=Bo(s));return yo(t,s)&&a&&!1!==r.type?function(){const o={from:s,to:n,velocity:e.getVelocity(),onComplete:i,onUpdate:t=>e.set(t)};return"inertia"===r.type||"decay"===r.type?function({from:t=0,velocity:e=0,min:n,max:o,power:i=.8,timeConstant:r=750,bounceStiffness:s=500,bounceDamping:a=10,restDelta:l=1,modifyTarget:u,driver:c,onUpdate:h,onComplete:d,onStop:p}){let f;function m(t){return void 0!==n&&t<n||void 0!==o&&t>o}function g(t){return void 0===n?o:void 0===o||Math.abs(n-t)<Math.abs(o-t)?n:o}function v(t){null==f||f.stop(),f=zn(Object.assign(Object.assign({},t),{driver:c,onUpdate:e=>{var n;null==h||h(e),null===(n=t.onUpdate)||void 0===n||n.call(t,e)},onComplete:d,onStop:p}))}function y(t){v(Object.assign({type:"spring",stiffness:s,damping:a,restDelta:l},t))}if(m(t))y({from:t,velocity:e,to:g(t)});else{let o=i*e+t;void 0!==u&&(o=u(o));const s=g(o),a=s===n?-1:1;let c,h;const d=t=>{c=h,h=t,e=Wn(t-c,In().delta),(1===a&&t>s||-1===a&&t<s)&&y({from:t,to:s,velocity:e})};v({type:"decay",from:t,velocity:e,timeConstant:r,power:i,restDelta:l,modifyTarget:u,onUpdate:m(o)?d:void 0})}return{stop:()=>null==f?void 0:f.stop()}}({...o,...r}):zn({...Lo(r,o,t),onUpdate:t=>{o.onUpdate(t),r.onUpdate&&r.onUpdate(t)},onComplete:()=>{o.onComplete(),r.onComplete&&r.onComplete()}})}:function(){const t=Qt(n);return e.set(t),i(),r.onUpdate&&r.onUpdate(t),r.onComplete&&r.onComplete(),{stop:()=>{}}}}function Oo(t){return 0===t||"string"==typeof t&&0===parseFloat(t)&&-1===t.indexOf(" ")}function Bo(t){return"number"==typeof t?0:Vo("",t)}function ko(t,e){return t[e]||t.default||t}function jo(t,e,n,o={}){return Co.current&&(o={type:!1}),e.start(i=>{let r;const s=Do(t,e,n,o,i),a=function(t,e){var n,o;return null!==(o=null!==(n=(ko(t,e)||{}).delay)&&void 0!==n?n:t.delay)&&void 0!==o?o:0}(o,t),l=()=>r=s();let u;return a?u=Mo(l,mo(a)):l(),()=>{u&&u(),r&&r.stop()}})}const Fo=t=>/^0[^.\s]+$/.test(t);function Io(t,e){-1===t.indexOf(e)&&t.push(e)}function Uo(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class No{constructor(){this.subscriptions=[]}add(t){return Io(this.subscriptions,t),()=>Uo(this.subscriptions,t)}notify(t,e,n){const o=this.subscriptions.length;if(o)if(1===o)this.subscriptions[0](t,e,n);else for(let i=0;i<o;i++){const o=this.subscriptions[i];o&&o(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}class zo{constructor(t){var e;this.version="7.6.14",this.timeDelta=0,this.lastUpdated=0,this.updateSubscribers=new No,this.velocityUpdateSubscribers=new No,this.renderSubscribers=new No,this.canTrackVelocity=!1,this.updateAndNotify=(t,e=!0)=>{this.prev=this.current,this.current=t;const{delta:n,timestamp:o}=In();this.lastUpdated!==o&&(this.timeDelta=n,this.lastUpdated=o,Dn.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.updateSubscribers.notify(this.current),this.velocityUpdateSubscribers.getSize()&&this.velocityUpdateSubscribers.notify(this.getVelocity()),e&&this.renderSubscribers.notify(this.current)},this.scheduleVelocityCheck=()=>Dn.postRender(this.velocityCheck),this.velocityCheck=({timestamp:t})=>{t!==this.lastUpdated&&(this.prev=this.current,this.velocityUpdateSubscribers.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e)))}onChange(t){return this.updateSubscribers.add(t)}clearListeners(){this.updateSubscribers.clear()}onRenderRequest(t){return t(this.get()),this.renderSubscribers.add(t)}attach(t){this.passiveEffect=t}set(t,e=!0){e&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?Wn(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.stopAnimation=t(e)}).then(()=>this.clearAnimation())}stop(){this.stopAnimation&&this.stopAnimation(),this.clearAnimation()}isAnimating(){return!!this.stopAnimation}clearAnimation(){this.stopAnimation=null}destroy(){this.updateSubscribers.clear(),this.renderSubscribers.clear(),this.stop()}}function Wo(t){return new zo(t)}const Ho=t=>e=>e.test(t),$o=[Q,rt,it,ot,at,st,{test:t=>"auto"===t,parse:t=>t}],Yo=t=>$o.find(Ho(t)),Xo=[...$o,gt,Et],Go=t=>Xo.find(Ho(t));function qo(t,e,n){const o=t.getProps();return _t(o,e,void 0!==n?n:o.custom,function(t){const e={};return t.values.forEach((t,n)=>e[n]=t.get()),e}(t),function(t){const e={};return t.values.forEach((t,n)=>e[n]=t.getVelocity()),e}(t))}function Zo(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Wo(n))}function Ko(t,e){const n=qo(t,e);let{transitionEnd:o={},transition:i={},...r}=n?t.makeTargetAnimatable(n,!1):{};r={...r,...o};for(const e in r){Zo(t,e,Qt(r[e]))}}function _o(t,e){[...e].reverse().forEach(n=>{var o;const i=t.getVariant(n);i&&Ko(t,i),null===(o=t.variantChildren)||void 0===o||o.forEach(t=>{_o(t,e)})})}function Jo(t,e,n){var o,i;const r=Object.keys(e).filter(e=>!t.hasValue(e)),s=r.length;if(s)for(let a=0;a<s;a++){const s=r[a],l=e[s];let u=null;Array.isArray(l)&&(u=l[0]),null===u&&(u=null!==(i=null!==(o=n[s])&&void 0!==o?o:t.readValue(s))&&void 0!==i?i:e[s]),null!=u&&("string"==typeof u&&(/^\-?\d*\.?\d+$/.test(u)||Fo(u))?u=parseFloat(u):!Go(u)&&Et.test(l)&&(u=Vo(s,l)),t.addValue(s,Wo(u)),void 0===n[s]&&(n[s]=u),null!==u&&t.setBaseTarget(s,u))}}function Qo(t,e){if(!e)return;return(e[t]||e.default||e).from}function ti(t,e,n){var o;const i={};for(const r in t){const t=Qo(r,e);i[r]=void 0!==t?t:null===(o=n.getValue(r))||void 0===o?void 0:o.get()}return i}function ei(t){return Boolean(z(t)&&t.add)}function ni(t,e,n={}){let o;if(t.notify("AnimationStart",e),Array.isArray(e)){const i=e.map(e=>oi(t,e,n));o=Promise.all(i)}else if("string"==typeof e)o=oi(t,e,n);else{const i="function"==typeof e?qo(t,e,n.custom):e;o=ii(t,i,n)}return o.then(()=>t.notify("AnimationComplete",e))}function oi(t,e,n={}){var o;const i=qo(t,e,n.custom);let{transition:r=t.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(r=n.transitionOverride);const s=i?()=>ii(t,i,n):()=>Promise.resolve(),a=(null===(o=t.variantChildren)||void 0===o?void 0:o.size)?(o=0)=>{const{delayChildren:i=0,staggerChildren:s,staggerDirection:a}=r;return function(t,e,n=0,o=0,i=1,r){const s=[],a=(t.variantChildren.size-1)*o,l=1===i?(t=0)=>t*o:(t=0)=>a-t*o;return Array.from(t.variantChildren).sort(ri).forEach((t,o)=>{s.push(oi(t,e,{...r,delay:n+l(o)}).then(()=>t.notify("AnimationComplete",e)))}),Promise.all(s)}(t,e,i+o,s,a,n)}:()=>Promise.resolve(),{when:l}=r;if(l){const[t,e]="beforeChildren"===l?[s,a]:[a,s];return t().then(e)}return Promise.all([s(),a(n.delay)])}function ii(t,e,{delay:n=0,transitionOverride:o,type:i}={}){var r;let{transition:s=t.getDefaultTransition(),transitionEnd:a,...l}=t.makeTargetAnimatable(e);const u=t.getValue("willChange");o&&(s=o);const c=[],h=i&&(null===(r=t.animationState)||void 0===r?void 0:r.getState()[i]);for(const e in l){const o=t.getValue(e),i=l[e];if(!o||void 0===i||h&&si(h,e))continue;let r={delay:n,...s};t.shouldReduceMotion&&U.has(e)&&(r={...r,type:!1,delay:0});let a=jo(e,o,i,r);ei(u)&&(u.add(e),a=a.then(()=>u.remove(e))),c.push(a)}return Promise.all(c).then(()=>{a&&Ko(t,a)})}function ri(t,e){return t.sortNodePosition(e)}function si({protectedKeys:t,needsAnimating:e},n){const o=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,o}const ai=[t.AnimationType.Animate,t.AnimationType.InView,t.AnimationType.Focus,t.AnimationType.Hover,t.AnimationType.Tap,t.AnimationType.Drag,t.AnimationType.Exit],li=[...ai].reverse(),ui=ai.length;function ci(e){let n=function(t){return e=>Promise.all(e.map(({animation:e,options:n})=>ni(t,e,n)))}(e);const o={[t.AnimationType.Animate]:di(!0),[t.AnimationType.InView]:di(),[t.AnimationType.Hover]:di(),[t.AnimationType.Tap]:di(),[t.AnimationType.Drag]:di(),[t.AnimationType.Focus]:di(),[t.AnimationType.Exit]:di()};let i=!0;const r=(t,n)=>{const o=qo(e,n);if(o){const{transition:e,transitionEnd:n,...i}=o;t={...t,...i,...n}}return t};function s(t,s){var a;const l=e.getProps(),u=e.getVariantContext(!0)||{},c=[],h=new Set;let d={},p=1/0;for(let n=0;n<ui;n++){const g=li[n],v=o[g],y=null!==(a=l[g])&&void 0!==a?a:u[g],x=f(y),b=g===s?v.isActive:null;!1===b&&(p=n);let E=y===u[g]&&y!==l[g]&&x;if(E&&i&&e.manuallyAnimateOnMount&&(E=!1),v.protectedKeys={...d},!v.isActive&&null===b||!y&&!v.prevProp||m(y)||"boolean"==typeof y)continue;const w=hi(v.prevProp,y);let P=w||g===s&&v.isActive&&!E&&x||n>p&&x;const S=Array.isArray(y)?y:[y];let T=S.reduce(r,{});!1===b&&(T={});const{prevResolvedValues:A={}}=v,V={...A,...T},C=t=>{P=!0,h.delete(t),v.needsAnimating[t]=!0};for(const t in V){const e=T[t],n=A[t];d.hasOwnProperty(t)||(e!==n?Jt(e)&&Jt(n)?!fo(e,n)||w?C(t):v.protectedKeys[t]=!0:void 0!==e?C(t):h.add(t):void 0!==e&&h.has(t)?C(t):v.protectedKeys[t]=!0)}v.prevProp=y,v.prevResolvedValues=T,v.isActive&&(d={...d,...T}),i&&e.blockInitialAnimation&&(P=!1),P&&!E&&c.push(...S.map(e=>({animation:e,options:{type:g,...t}})))}if(h.size){const t={};h.forEach(n=>{const o=e.getBaseTarget(n);void 0!==o&&(t[n]=o)}),c.push({animation:t})}let g=Boolean(c.length);return i&&!1===l.initial&&!e.manuallyAnimateOnMount&&(g=!1),i=!1,g?n(c):Promise.resolve()}return{animateChanges:s,setActive:function(t,n,i){var r;if(o[t].isActive===n)return Promise.resolve();null===(r=e.variantChildren)||void 0===r||r.forEach(e=>{var o;return null===(o=e.animationState)||void 0===o?void 0:o.setActive(t,n)}),o[t].isActive=n;const a=s(i,t);for(const t in o)o[t].protectedKeys={};return a},setAnimateFunction:function(t){n=t(e)},getState:()=>o}}function hi(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!fo(e,t)}function di(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}const pi={animation:co(({visualElement:t,animate:n})=>{t.animationState||(t.animationState=ci(t)),m(n)&&e.useEffect(()=>n.subscribe(t),[n])}),exit:co(n=>{const{custom:o,visualElement:i}=n,[r,s]=po(),a=e.useContext(u);e.useEffect(()=>{i.isPresent=r;const e=i.animationState&&i.animationState.setActive(t.AnimationType.Exit,!r,{custom:a&&a.custom||o});e&&!r&&e.then(s)},[r])})};class fi{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=vi(this.lastMoveEventInfo,this.history),e=null!==this.startEvent,n=Xn(t.offset,{x:0,y:0})>=3;if(!e&&!n)return;const{point:o}=t,{timestamp:i}=In();this.history.push({...o,timestamp:i});const{onStart:r,onMove:s}=this.handlers;e||(r&&r(this.lastMoveEvent,t),this.startEvent=this.lastMoveEvent),s&&s(this.lastMoveEvent,t)},this.handlePointerMove=(t,e)=>{this.lastMoveEvent=t,this.lastMoveEventInfo=mi(e,this.transformPagePoint),ue(t)&&0===t.buttons?this.handlePointerUp(t,e):Dn.update(this.updatePoint,!0)},this.handlePointerUp=(t,e)=>{this.end();const{onEnd:n,onSessionEnd:o}=this.handlers,i=vi(mi(e,this.transformPagePoint),this.history);this.startEvent&&n&&n(t,i),o&&o(t,i)},ce(t)&&t.touches.length>1)return;this.handlers=e,this.transformPagePoint=n;const o=mi(fe(t),this.transformPagePoint),{point:i}=o,{timestamp:r}=In();this.history=[{...i,timestamp:r}];const{onSessionStart:s}=e;s&&s(t,vi(o,this.history)),this.removeListeners=qe(xe(window,"pointermove",this.handlePointerMove),xe(window,"pointerup",this.handlePointerUp),xe(window,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),On.update(this.updatePoint)}}function mi(t,e){return e?{point:e(t.point)}:t}function gi(t,e){return{x:t.x-e.x,y:t.y-e.y}}function vi({point:t},e){return{point:t,delta:gi(t,xi(e)),offset:gi(t,yi(e)),velocity:bi(e,.1)}}function yi(t){return t[0]}function xi(t){return t[t.length-1]}function bi(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,o=null;const i=xi(t);for(;n>=0&&(o=t[n],!(i.timestamp-o.timestamp>mo(e)));)n--;if(!o)return{x:0,y:0};const r=(i.timestamp-o.timestamp)/1e3;if(0===r)return{x:0,y:0};const s={x:(i.x-o.x)/r,y:(i.y-o.y)/r};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}function Ei(t){return t.max-t.min}function wi(t,e=0,n=.01){return Xn(t,e)<n}function Pi(t,e,n,o=.5){t.origin=o,t.originPoint=Ue(e.min,e.max,t.origin),t.scale=Ei(n)/Ei(e),(wi(t.scale,1,1e-4)||isNaN(t.scale))&&(t.scale=1),t.translate=Ue(n.min,n.max,t.origin)-t.originPoint,(wi(t.translate)||isNaN(t.translate))&&(t.translate=0)}function Si(t,e,n,o){Pi(t.x,e.x,n.x,null==o?void 0:o.originX),Pi(t.y,e.y,n.y,null==o?void 0:o.originY)}function Ti(t,e,n){t.min=n.min+e.min,t.max=t.min+Ei(e)}function Ai(t,e,n){t.min=e.min-n.min,t.max=t.min+Ei(e)}function Vi(t,e,n){Ai(t.x,e.x,n.x),Ai(t.y,e.y,n.y)}function Ci(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 Mi(t,e){let n=e.min-t.min,o=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,o]=[o,n]),{min:n,max:o}}const Ri=.35;function Li(t,e,n){return{min:Di(t,e),max:Di(t,n)}}function Di(t,e){var n;return"number"==typeof t?t:null!==(n=t[e])&&void 0!==n?n:0}const Oi=()=>({x:{min:0,max:0},y:{min:0,max:0}});function Bi(t){return[t("x"),t("y")]}function ki({top:t,left:e,right:n,bottom:o}){return{x:{min:e,max:n},y:{min:t,max:o}}}function ji(t){return void 0===t||1===t}function Fi({scale:t,scaleX:e,scaleY:n}){return!ji(t)||!ji(e)||!ji(n)}function Ii(t){return Fi(t)||Ui(t)||t.z||t.rotate||t.rotateX||t.rotateY}function Ui(t){return Ni(t.x)||Ni(t.y)}function Ni(t){return t&&"0%"!==t}function zi(t,e,n){return n+e*(t-n)}function Wi(t,e,n,o,i){return void 0!==i&&(t=zi(t,i,o)),zi(t,n,o)+e}function Hi(t,e=0,n=1,o,i){t.min=Wi(t.min,e,n,o,i),t.max=Wi(t.max,e,n,o,i)}function $i(t,{x:e,y:n}){Hi(t.x,e.translate,e.scale,e.originPoint),Hi(t.y,n.translate,n.scale,n.originPoint)}function Yi(t,e){t.min=t.min+e,t.max=t.max+e}function Xi(t,e,[n,o,i]){const r=void 0!==e[i]?e[i]:.5,s=Ue(t.min,t.max,r);Hi(t,e[n],e[o],s,e.scale)}const Gi=["x","scaleX","originX"],qi=["y","scaleY","originY"];function Zi(t,e){Xi(t.x,e,Gi),Xi(t.y,e,qi)}function Ki(t,e){return ki(function(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),o=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:o.y,right:o.x}}(t.getBoundingClientRect(),e))}const _i=new WeakMap;class Ji{constructor(t){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic={x:{min:0,max:0},y:{min:0,max:0}},this.visualElement=t}start(e,{snapToCursor:n=!1}={}){if(!1===this.visualElement.isPresent)return;this.panSession=new fi(e,{onSessionStart:t=>{this.stopAnimation(),n&&this.snapToCursor(fe(t,"page").point)},onStart:(e,n)=>{var o;const{drag:i,dragPropagation:r,onDragStart:s}=this.getProps();(!i||r||(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=Se(i),this.openGlobalLock))&&(this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Bi(t=>{var e,n;let o=this.getAxisMotionValue(t).get()||0;if(it.test(o)){const i=null===(n=null===(e=this.visualElement.projection)||void 0===e?void 0:e.layout)||void 0===n?void 0:n.layoutBox[t];if(i){o=Ei(i)*(parseFloat(o)/100)}}this.originPoint[t]=o}),null==s||s(e,n),null===(o=this.visualElement.animationState)||void 0===o||o.setActive(t.AnimationType.Drag,!0))},onMove:(t,e)=>{const{dragPropagation:n,dragDirectionLock:o,onDirectionLock:i,onDrag:r}=this.getProps();if(!n&&!this.openGlobalLock)return;const{offset:s}=e;if(o&&null===this.currentDirection)return this.currentDirection=function(t,e=10){let n=null;Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x");return n}(s),void(null!==this.currentDirection&&(null==i||i(this.currentDirection)));this.updateAxis("x",e.point,s),this.updateAxis("y",e.point,s),this.visualElement.render(),null==r||r(t,e)},onSessionEnd:(t,e)=>this.stop(t,e)},{transformPagePoint:this.visualElement.getTransformPagePoint()})}stop(t,e){const n=this.isDragging;if(this.cancel(),!n)return;const{velocity:o}=e;this.startAnimation(o);const{onDragEnd:i}=this.getProps();null==i||i(t,e)}cancel(){var e,n;this.isDragging=!1,this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!1),null===(e=this.panSession)||void 0===e||e.end(),this.panSession=void 0;const{dragPropagation:o}=this.getProps();!o&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),null===(n=this.visualElement.animationState)||void 0===n||n.setActive(t.AnimationType.Drag,!1)}updateAxis(t,e,n){const{drag:o}=this.getProps();if(!n||!Qi(t,o,this.currentDirection))return;const i=this.getAxisMotionValue(t);let r=this.originPoint[t]+n[t];this.constraints&&this.constraints[t]&&(r=function(t,{min:e,max:n},o){return void 0!==e&&t<e?t=o?Ue(e,t,o.min):Math.max(t,e):void 0!==n&&t>n&&(t=o?Ue(n,t,o.max):Math.min(t,n)),t}(r,this.constraints[t],this.elastic[t])),i.set(r)}resolveConstraints(){const{dragConstraints:t,dragElastic:e}=this.getProps(),{layout:n}=this.visualElement.projection||{},o=this.constraints;t&&p(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!n)&&function(t,{top:e,left:n,bottom:o,right:i}){return{x:Ci(t.x,n,i),y:Ci(t.y,e,o)}}(n.layoutBox,t),this.elastic=function(t=Ri){return!1===t?t=0:!0===t&&(t=Ri),{x:Li(t,"left","right"),y:Li(t,"top","bottom")}}(e),o!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&Bi(t=>{this.getAxisMotionValue(t)&&(this.constraints[t]=function(t,e){const n={};return void 0!==e.min&&(n.min=e.min-t.min),void 0!==e.max&&(n.max=e.max-t.min),n}(n.layoutBox[t],this.constraints[t]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:e}=this.getProps();if(!t||!p(t))return!1;const n=t.current,{projection:o}=this.visualElement;if(!o||!o.layout)return!1;const i=function(t,e,n){const o=Ki(t,n),{scroll:i}=e;return i&&(Yi(o.x,i.offset.x),Yi(o.y,i.offset.y)),o}(n,o.root,this.visualElement.getTransformPagePoint());let r=function(t,e){return{x:Mi(t.x,e.x),y:Mi(t.y,e.y)}}(o.layout.layoutBox,i);if(e){const t=e(function({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}(r));this.hasMutatedConstraints=!!t,t&&(r=ki(t))}return r}startAnimation(t){const{drag:e,dragMomentum:n,dragElastic:o,dragTransition:i,dragSnapToOrigin:r,onDragTransitionEnd:s}=this.getProps(),a=this.constraints||{},l=Bi(s=>{var l;if(!Qi(s,e,this.currentDirection))return;let u=null!==(l=null==a?void 0:a[s])&&void 0!==l?l:{};r&&(u={min:0,max:0});const c=o?200:1e6,h=o?40:1e7,d={type:"inertia",velocity:n?t[s]:0,bounceStiffness:c,bounceDamping:h,timeConstant:750,restDelta:1,restSpeed:10,...i,...u};return this.startAxisValueAnimation(s,d)});return Promise.all(l).then(s)}startAxisValueAnimation(t,e){return jo(t,this.getAxisMotionValue(t),0,e)}stopAnimation(){Bi(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){var e,n;const o="_drag"+t.toUpperCase(),i=this.visualElement.getProps()[o];return i||this.visualElement.getValue(t,null!==(n=null===(e=this.visualElement.getProps().initial)||void 0===e?void 0:e[t])&&void 0!==n?n:0)}snapToCursor(t){Bi(e=>{const{drag:n}=this.getProps();if(!Qi(e,n,this.currentDirection))return;const{projection:o}=this.visualElement,i=this.getAxisMotionValue(e);if(o&&o.layout){const{min:n,max:r}=o.layout.layoutBox[e];i.set(t[e]-Ue(n,r,.5))}})}scalePositionWithinConstraints(){var t;if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:o}=this.visualElement;if(!p(n)||!o||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Bi(t=>{const e=this.getAxisMotionValue(t);if(e){const n=e.get();i[t]=function(t,e){let n=.5;const o=Ei(t),i=Ei(e);return i>o?n=Ie(e.min,e.max-o,t.min):o>i&&(n=Ie(t.min,t.max-i,e.min)),Re(0,1,n)}({min:n,max:n},this.constraints[t])}});const{transformTemplate:r}=this.visualElement.getProps();this.visualElement.current.style.transform=r?r({},""):"none",null===(t=o.root)||void 0===t||t.updateScroll(),o.updateLayout(),this.resolveConstraints(),Bi(t=>{if(!Qi(t,e,null))return;const n=this.getAxisMotionValue(t),{min:o,max:r}=this.constraints[t];n.set(Ue(o,r,i[t]))})}addListeners(){var t;if(!this.visualElement.current)return;_i.set(this.visualElement,this);const e=xe(this.visualElement.current,"pointerdown",t=>{const{drag:e,dragListener:n=!0}=this.getProps();e&&n&&this.start(t)}),n=()=>{const{dragConstraints:t}=this.getProps();p(t)&&(this.constraints=this.resolveRefConstraints())},{projection:o}=this.visualElement,i=o.addEventListener("measure",n);o&&!o.layout&&(null===(t=o.root)||void 0===t||t.updateScroll(),o.updateLayout()),n();const r=ae(window,"resize",()=>this.scalePositionWithinConstraints()),s=o.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e})=>{this.isDragging&&e&&(Bi(e=>{const n=this.getAxisMotionValue(e);n&&(this.originPoint[e]+=t[e].translate,n.set(n.get()+t[e].translate))}),this.visualElement.render())});return()=>{r(),e(),i(),null==s||s()}}getProps(){const t=this.visualElement.getProps(),{drag:e=!1,dragDirectionLock:n=!1,dragPropagation:o=!1,dragConstraints:i=!1,dragElastic:r=Ri,dragMomentum:s=!0}=t;return{...t,drag:e,dragDirectionLock:n,dragPropagation:o,dragConstraints:i,dragElastic:r,dragMomentum:s}}}function Qi(t,e,n){return!(!0!==e&&e!==t||null!==n&&n!==t)}const tr={pan:co((function({onPan:t,onPanStart:n,onPanEnd:o,onPanSessionStart:i,visualElement:r}){const a=t||n||o||i,l=e.useRef(null),{transformPagePoint:u}=e.useContext(s),c={onSessionStart:i,onStart:n,onMove:t,onEnd:(t,e)=>{l.current=null,o&&o(t,e)}};e.useEffect(()=>{null!==l.current&&l.current.updateHandlers(c)}),be(r,"pointerdown",a&&function(t){l.current=new fi(t,c,{transformPagePoint:u})}),Ce(()=>l.current&&l.current.end())})),drag:co((function(t){const{dragControls:n,visualElement:o}=t,i=S(()=>new Ji(o));e.useEffect(()=>n&&n.subscribe(i),[i,n]),e.useEffect(()=>i.addListeners(),[i])}))};function er(t){return"string"==typeof t&&t.startsWith("var(--")}const nr=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function or(t,e,n=1){const[o,i]=function(t){const e=nr.exec(t);if(!e)return[,];const[,n,o]=e;return[n,o]}(t);if(!o)return;const r=window.getComputedStyle(e).getPropertyValue(o);return r?r.trim():er(i)?or(i,e,n+1):i}const ir=new Set(["width","height","top","left","right","bottom","x","y"]),rr=t=>ir.has(t),sr=(t,e)=>{t.set(e,!1),t.set(e)},ar=t=>t===Q||t===rt;var lr;!function(t){t.width="width",t.height="height",t.left="left",t.right="right",t.top="top",t.bottom="bottom"}(lr||(lr={}));const ur=(t,e)=>parseFloat(t.split(", ")[e]),cr=(t,e)=>(n,{transform:o})=>{if("none"===o||!o)return 0;const i=o.match(/^matrix3d\((.+)\)$/);if(i)return ur(i[1],e);{const e=o.match(/^matrix\((.+)\)$/);return e?ur(e[1],t):0}},hr=new Set(["x","y","z"]),dr=I.filter(t=>!hr.has(t));const pr={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:cr(4,13),y:cr(5,14)},fr=(t,e,n={},o={})=>{e={...e},o={...o};const i=Object.keys(e).filter(rr);let r=[],s=!1;const a=[];if(i.forEach(i=>{const l=t.getValue(i);if(!t.hasValue(i))return;let u=n[i],c=Yo(u);const h=e[i];let d;if(Jt(h)){const t=h.length,e=null===h[0]?1:0;u=h[e],c=Yo(u);for(let n=e;n<t;n++)d?Yo(h[n]):d=Yo(h[n])}else d=Yo(h);if(c!==d)if(ar(c)&&ar(d)){const t=l.get();"string"==typeof t&&l.set(parseFloat(t)),"string"==typeof h?e[i]=parseFloat(h):Array.isArray(h)&&d===rt&&(e[i]=h.map(parseFloat))}else(null==c?void 0:c.transform)&&(null==d?void 0:d.transform)&&(0===u||0===h)?0===u?l.set(d.transform(u)):e[i]=c.transform(h):(s||(r=function(t){const e=[];return dr.forEach(n=>{const o=t.getValue(n);void 0!==o&&(e.push([n,o.get()]),o.set(n.startsWith("scale")?1:0))}),e.length&&t.render(),e}(t),s=!0),a.push(i),o[i]=void 0!==o[i]?o[i]:e[i],sr(l,h))}),a.length){const n=a.indexOf("height")>=0?window.pageYOffset:null,i=((t,e,n)=>{const o=e.measureViewportBox(),i=e.current,r=getComputedStyle(i),{display:s}=r,a={};"none"===s&&e.setStaticValue("display",t.display||"block"),n.forEach(t=>{a[t]=pr[t](o,r)}),e.render();const l=e.measureViewportBox();return n.forEach(n=>{const o=e.getValue(n);sr(o,a[n]),t[n]=pr[n](l,r)}),t})(e,t,a);return r.length&&r.forEach(([e,n])=>{t.getValue(e).set(n)}),t.render(),c&&null!==n&&window.scrollTo({top:n}),{target:i,transitionEnd:o}}return{target:e,transitionEnd:o}};function mr(t,e,n,o){return(t=>Object.keys(t).some(rr))(e)?fr(t,e,n,o):{target:e,transitionEnd:o}}const gr=(t,e,n,o)=>{const i=function(t,{...e},n){const o=t.current;if(!(o instanceof Element))return{target:e,transitionEnd:n};n&&(n={...n}),t.values.forEach(t=>{const e=t.get();if(!er(e))return;const n=or(e,o);n&&t.set(n)});for(const t in e){const i=e[t];if(!er(i))continue;const r=or(i,o);r&&(e[t]=r,n&&void 0===n[t]&&(n[t]=i))}return{target:e,transitionEnd:n}}(t,e,o);return mr(t,e=i.target,n,o=i.transitionEnd)},vr={current:null},yr={current:!1};function xr(){if(yr.current=!0,c)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>vr.current=t.matches;t.addListener(e),e()}else vr.current=!1}const br=Object.keys(w),Er=br.length,wr=["AnimationStart","AnimationComplete","Update","Unmount","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Pr{constructor({parent:t,props:e,reducedMotionConfig:n,visualState:o},i={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.isPresent=!0,this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.scheduleRender=()=>Dn.render(this.render,!1,!0);const{latestValues:r,renderState:s}=o;this.latestValues=r,this.baseTarget={...r},this.initialValues=e.initial?{...r}:{},this.renderState=s,this.parent=t,this.props=e,this.depth=t?t.depth+1:0,this.reducedMotionConfig=n,this.options=i,this.isControllingVariants=v(e),this.isVariantNode=y(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:a,...l}=this.scrapeMotionValuesFromProps(e);for(const t in l){const e=l[t];void 0!==r[t]&&z(e)&&(e.set(r[t],!1),ei(a)&&a.add(t))}}scrapeMotionValuesFromProps(t){return{}}mount(t){var e;this.current=t,this.projection&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=null===(e=this.parent)||void 0===e?void 0:e.addVariantChild(this)),this.values.forEach((t,e)=>this.bindToMotionValue(e,t)),yr.current||xr(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||vr.current),this.parent&&this.parent.children.add(this),this.setProps(this.props)}unmount(){var t,e,n;null===(t=this.projection)||void 0===t||t.unmount(),On.update(this.notifyUpdate),On.render(this.render),this.valueSubscriptions.forEach(t=>t()),null===(e=this.removeFromVariantTree)||void 0===e||e.call(this),null===(n=this.parent)||void 0===n||n.children.delete(this);for(const t in this.events)this.events[t].clear();this.current=null}bindToMotionValue(t,e){const n=U.has(t),o=e.onChange(e=>{this.latestValues[t]=e,this.props.onUpdate&&Dn.update(this.notifyUpdate,!1,!0),n&&this.projection&&(this.projection.isTransformDirty=!0)}),i=e.onRenderRequest(this.scheduleRender);this.valueSubscriptions.set(t,()=>{o(),i()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}loadFeatures(t,n,o,i,r,s){const a=[];for(let n=0;n<Er;n++){const o=br[n],{isEnabled:i,Component:r}=w[o];i(t)&&r&&a.push(e.createElement(r,{key:o,...t,visualElement:this}))}if(!this.projection&&r){this.projection=new r(i,this.latestValues,this.parent&&this.parent.projection);const{layoutId:e,layout:n,drag:o,dragConstraints:a,layoutScroll:l}=t;this.projection.setOptions({layoutId:e,layout:n,alwaysMeasureLayout:Boolean(o)||a&&p(a),visualElement:this,scheduleRender:()=>this.scheduleRender(),animationType:"string"==typeof n?n:"both",initialPromotionConfig:s,layoutScroll:l})}return a}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}makeTargetAnimatable(t,e=!0){return this.makeTargetAnimatableFromInstance(t,this.props,e)}setProps(t){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.props=t;for(let e=0;e<wr.length;e++){const n=wr[e];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);const o=t["on"+n];o&&(this.propEventSubscriptions[n]=this.on(n,o))}this.prevMotionValues=function(t,e,n){const{willChange:o}=e;for(const i in e){const r=e[i],s=n[i];if(z(r))t.addValue(i,r),ei(o)&&o.add(i);else if(z(s))t.addValue(i,Wo(r)),ei(o)&&o.remove(i);else if(s!==r)if(t.hasValue(i)){const e=t.getValue(i);!e.hasAnimated&&e.set(r)}else{const e=t.getStaticValue(i);t.addValue(i,Wo(void 0!==e?e:r))}}for(const o in n)void 0===e[o]&&t.removeValue(o);return e}(this,this.scrapeMotionValuesFromProps(t),this.prevMotionValues)}getProps(){return this.props}getVariant(t){var e;return null===(e=this.props.variants)||void 0===e?void 0:e[t]}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){var t;return this.isVariantNode?this:null===(t=this.parent)||void 0===t?void 0:t.getClosestVariantNode()}getVariantContext(t=!1){var e,n;if(t)return null===(e=this.parent)||void 0===e?void 0:e.getVariantContext();if(!this.isControllingVariants){const t=(null===(n=this.parent)||void 0===n?void 0:n.getVariantContext())||{};return void 0!==this.props.initial&&(t.initial=this.props.initial),t}const o={};for(let t=0;t<Tr;t++){const e=Sr[t],n=this.props[e];(f(n)||!1===n)&&(o[e]=n)}return o}addVariantChild(t){var e;const n=this.getClosestVariantNode();if(n)return null===(e=n.variantChildren)||void 0===e||e.add(t),()=>n.variantChildren.delete(t)}addValue(t,e){this.hasValue(t)&&this.removeValue(t),this.values.set(t,e),this.latestValues[t]=e.get(),this.bindToMotionValue(t,e)}removeValue(t){var e;this.values.delete(t),null===(e=this.valueSubscriptions.get(t))||void 0===e||e(),this.valueSubscriptions.delete(t),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return void 0===n&&void 0!==e&&(n=Wo(e),this.addValue(t,n)),n}readValue(t){return void 0===this.latestValues[t]&&this.current?this.readValueFromInstance(this.current,t,this.options):this.latestValues[t]}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){var e;const{initial:n}=this.props,o="string"==typeof n||"object"==typeof n?null===(e=_t(this.props,n))||void 0===e?void 0:e[t]:void 0;if(n&&void 0!==o)return o;const i=this.getBaseTargetFromProps(this.props,t);return void 0===i||z(i)?void 0!==this.initialValues[t]&&void 0===o?void 0:this.baseTarget[t]:i}on(t,e){return this.events[t]||(this.events[t]=new No),this.events[t].add(e)}notify(t,...e){var n;null===(n=this.events[t])||void 0===n||n.notify(...e)}}const Sr=["initial",...ai],Tr=Sr.length;class Ar extends Pr{sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){var n;return null===(n=t.style)||void 0===n?void 0:n[e]}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}makeTargetAnimatableFromInstance({transition:t,transitionEnd:e,...n},{transformValues:o},i){let r=ti(n,t||{},this);if(o&&(e&&(e=o(e)),n&&(n=o(n)),r&&(r=o(r))),i){Jo(this,n,r);const t=gr(this,n,r,e);e=t.transitionEnd,n=t.target}return{transition:t,transitionEnd:e,...n}}}class Vr extends Ar{readValueFromInstance(t,e){if(U.has(e)){const t=Ao(e);return t&&t.default||0}{const o=(n=t,window.getComputedStyle(n)),i=(Y(e)?o.getPropertyValue(e):o[e])||0;return"string"==typeof i?i.trim():i}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return Ki(t,e)}build(t,e,n,o){Ct(t,e,n,o.transformTemplate)}scrapeMotionValuesFromProps(t){return Zt(t)}renderInstance(t,e,n,o){Xt(t,e,n,o)}}class Cr extends Ar{getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){var n;return U.has(e)?(null===(n=Ao(e))||void 0===n?void 0:n.default)||0:(e=Gt.has(e)?e:Yt(e),t.getAttribute(e))}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}scrapeMotionValuesFromProps(t){return Kt(t)}build(t,e,n,o){zt(t,e,n,o.transformTemplate)}renderInstance(t,e,n,o){qt(t,e,0,o)}}const Mr=(t,e)=>k(t)?new Cr(e,{enableHardwareAcceleration:!1}):new Vr(e,{enableHardwareAcceleration:!0});function Rr(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Lr={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!rt.test(t))return t;t=parseFloat(t)}return`${Rr(t,e.target.x)}% ${Rr(t,e.target.y)}%`}},Dr={correct:(t,{treeScale:e,projectionDelta:n})=>{const o=t,i=t.includes("var("),r=[];i&&(t=t.replace(nr,t=>(r.push(t),"_$css")));const s=Et.parse(t);if(s.length>5)return o;const a=Et.createTransformer(t),l="number"!=typeof s[0]?1:0,u=n.x.scale*e.x,c=n.y.scale*e.y;s[0+l]/=u,s[1+l]/=c;const h=Ue(u,c,.5);"number"==typeof s[2+l]&&(s[2+l]/=h),"number"==typeof s[3+l]&&(s[3+l]/=h);let d=a(s);if(i){let t=0;d=d.replace("_$css",()=>{const e=r[t];return t++,e})}return d}};class Or extends i.default.Component{componentDidMount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n,layoutId:o}=this.props,{projection:i}=t;F(Br),i&&(e.group&&e.group.add(i),n&&n.register&&o&&n.register(i),i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,onExitComplete:()=>this.safeToRemove()})),T.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:e,visualElement:n,drag:o,isPresent:i}=this.props,r=n.projection;return r?(r.isPresent=i,o||t.layoutDependency!==e||void 0===e?r.willUpdate():this.safeToRemove(),t.isPresent!==i&&(i?r.promote():r.relegate()||Dn.postRender(()=>{var t;(null===(t=r.getStack())||void 0===t?void 0:t.members.length)||this.safeToRemove()})),null):null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),!t.currentAnimation&&t.isLead()&&this.safeToRemove())}componentWillUnmount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n}=this.props,{projection:o}=t;o&&(o.scheduleCheckAfterUnmount(),(null==e?void 0:e.group)&&e.group.remove(o),(null==n?void 0:n.deregister)&&n.deregister(o))}safeToRemove(){const{safeToRemove:t}=this.props;null==t||t()}render(){return null}}const Br={borderRadius:{...Lr,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Lr,borderTopRightRadius:Lr,borderBottomLeftRadius:Lr,borderBottomRightRadius:Lr,boxShadow:Dr},kr={measureLayout:function(t){const[n,o]=po(),r=e.useContext(V);return i.default.createElement(Or,{...t,layoutGroup:r,switchLayoutGroup:e.useContext(M),isPresent:n,safeToRemove:o})}};function jr(t,e,n={}){const o=z(t)?t:Wo(t);return jo("",o,e,n),{stop:()=>o.stop(),isAnimating:()=>o.isAnimating()}}const Fr=["TopLeft","TopRight","BottomLeft","BottomRight"],Ir=Fr.length,Ur=t=>"string"==typeof t?parseFloat(t):t,Nr=t=>"number"==typeof t||rt.test(t);function zr(t,e){var n;return null!==(n=t[e])&&void 0!==n?n:t.borderRadius}const Wr=$r(0,.5,pn),Hr=$r(.5,.95,an);function $r(t,e,n){return o=>o<t?0:o>e?1:n(Ie(t,e,o))}function Yr(t,e){t.min=e.min,t.max=e.max}function Xr(t,e){Yr(t.x,e.x),Yr(t.y,e.y)}function Gr(t,e,n,o,i){return t=zi(t-=e,1/n,o),void 0!==i&&(t=zi(t,1/i,o)),t}function qr(t,e,[n,o,i],r,s){!function(t,e=0,n=1,o=.5,i,r=t,s=t){if(it.test(e)){e=parseFloat(e);e=Ue(s.min,s.max,e/100)-s.min}if("number"!=typeof e)return;let a=Ue(r.min,r.max,o);t===r&&(a-=e),t.min=Gr(t.min,e,n,a,i),t.max=Gr(t.max,e,n,a,i)}(t,e[n],e[o],e[i],e.scale,r,s)}const Zr=["x","scaleX","originX"],Kr=["y","scaleY","originY"];function _r(t,e,n,o){qr(t.x,e,Zr,null==n?void 0:n.x,null==o?void 0:o.x),qr(t.y,e,Kr,null==n?void 0:n.y,null==o?void 0:o.y)}function Jr(t){return 0===t.translate&&1===t.scale}function Qr(t){return Jr(t.x)&&Jr(t.y)}function ts(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 es(t){return Ei(t.x)/Ei(t.y)}class ns{constructor(){this.members=[]}add(t){Io(this.members,t),t.scheduleRender()}remove(t){if(Uo(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const t=this.members[this.members.length-1];t&&this.promote(t)}}relegate(t){const e=this.members.findIndex(e=>t===e);if(0===e)return!1;let n;for(let t=e;t>=0;t--){const e=this.members[t];if(!1!==e.isPresent){n=e;break}}return!!n&&(this.promote(n),!0)}promote(t,e){var n;const o=this.lead;if(t!==o&&(this.prevLead=o,this.lead=t,t.show(),o)){o.instance&&o.scheduleRender(),t.scheduleRender(),t.resumeFrom=o,e&&(t.resumeFrom.preserveOpacity=!0),o.snapshot&&(t.snapshot=o.snapshot,t.snapshot.latestValues=o.animationValues||o.latestValues),(null===(n=t.root)||void 0===n?void 0:n.isUpdating)&&(t.isLayoutDirty=!0);const{crossfade:i}=t.options;!1===i&&o.hide()}}exitAnimationComplete(){this.members.forEach(t=>{var e,n,o,i,r;null===(n=(e=t.options).onExitComplete)||void 0===n||n.call(e),null===(r=null===(o=t.resumingFrom)||void 0===o?void 0:(i=o.options).onExitComplete)||void 0===r||r.call(i)})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function os(t,e,n){let o="";const i=t.x.translate/e.x,r=t.y.translate/e.y;if((i||r)&&(o=`translate3d(${i}px, ${r}px, 0) `),1===e.x&&1===e.y||(o+=`scale(${1/e.x}, ${1/e.y}) `),n){const{rotate:t,rotateX:e,rotateY:i}=n;t&&(o+=`rotate(${t}deg) `),e&&(o+=`rotateX(${e}deg) `),i&&(o+=`rotateY(${i}deg) `)}const s=t.x.scale*e.x,a=t.y.scale*e.y;return 1===s&&1===a||(o+=`scale(${s}, ${a})`),o||"none"}const is=(t,e)=>t.depth-e.depth;class rs{constructor(){this.children=[],this.isDirty=!1}add(t){Io(this.children,t),this.isDirty=!0}remove(t){Uo(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(is),this.isDirty=!1,this.children.forEach(t)}}const ss=["","X","Y","Z"];let as=0;function ls({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:o,resetTransform:i}){return class{constructor(t,n={},o=(null==e?void 0:e())){this.id=as++,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(hs),this.nodes.forEach(gs),this.nodes.forEach(vs)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.elementId=t,this.latestValues=n,this.root=o?o.root||o:this,this.path=o?[...o.path,o]:[],this.parent=o,this.depth=o?o.depth+1:0,t&&this.root.registerPotentialNode(t,this);for(let t=0;t<this.path.length;t++)this.path[t].shouldResetTransform=!0;this.root===this&&(this.nodes=new rs)}addEventListener(t,e){return this.eventHandlers.has(t)||this.eventHandlers.set(t,new No),this.eventHandlers.get(t).add(e)}notifyListeners(t,...e){const n=this.eventHandlers.get(t);null==n||n.notify(...e)}hasListeners(t){return this.eventHandlers.has(t)}registerPotentialNode(t,e){this.potentialNodes.set(t,e)}mount(e,n=!1){var o;if(this.instance)return;this.isSVG=e instanceof SVGElement&&"svg"!==e.tagName,this.instance=e;const{layoutId:i,layout:r,visualElement:s}=this.options;if(s&&!s.current&&s.mount(e),this.root.nodes.add(this),null===(o=this.parent)||void 0===o||o.children.add(this),this.elementId&&this.root.potentialNodes.delete(this.elementId),n&&(r||i)&&(this.isLayoutDirty=!0),t){let n;const o=()=>this.root.updateBlockedByResize=!1;t(e,()=>{this.root.updateBlockedByResize=!0,n&&n(),n=Mo(o,250),T.hasAnimatedSinceResize&&(T.hasAnimatedSinceResize=!1,this.nodes.forEach(ms))})}i&&this.root.registerSharedNode(i,this),!1!==this.options.animate&&s&&(i||r)&&this.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e,hasRelativeTargetChanged:n,layout:o})=>{var i,r,a,l,u;if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const c=null!==(r=null!==(i=this.options.transition)&&void 0!==i?i:s.getDefaultTransition())&&void 0!==r?r:Ps,{onLayoutAnimationStart:h,onLayoutAnimationComplete:d}=s.getProps(),p=!this.targetLayout||!ts(this.targetLayout,o)||n,f=!e&&n;if((null===(a=this.resumeFrom)||void 0===a?void 0:a.instance)||f||e&&(p||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(t,f);const e={...ko(c,"layout"),onPlay:h,onComplete:d};s.shouldReduceMotion&&(e.delay=0,e.type=!1),this.startAnimation(e)}else e||0!==this.animationProgress||ms(this),this.isLead()&&(null===(u=(l=this.options).onExitComplete)||void 0===u||u.call(l));this.targetLayout=o})}unmount(){var t,e;this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this),null===(t=this.getStack())||void 0===t||t.remove(this),null===(e=this.parent)||void 0===e||e.children.delete(this),this.instance=void 0,On.preRender(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){var t;return this.isAnimationBlocked||(null===(t=this.parent)||void 0===t?void 0:t.isTreeAnimationBlocked())||!1}startUpdate(){var t;this.isUpdateBlocked()||(this.isUpdating=!0,null===(t=this.nodes)||void 0===t||t.forEach(ys),this.animationId++)}willUpdate(t=!0){var e,n,o;if(this.root.isUpdateBlocked())return void(null===(n=(e=this.options).onExitComplete)||void 0===n||n.call(e));if(!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let t=0;t<this.path.length;t++){const e=this.path[t];e.shouldResetTransform=!0,e.updateScroll("snapshot")}const{layoutId:i,layout:r}=this.options;if(void 0===i&&!r)return;const s=null===(o=this.options.visualElement)||void 0===o?void 0:o.getProps().transformTemplate;this.prevTransformTemplateValue=null==s?void 0:s(this.latestValues,""),this.updateSnapshot(),t&&this.notifyListeners("willUpdate")}didUpdate(){if(this.isUpdateBlocked())return this.unblockUpdate(),this.clearAllSnapshots(),void this.nodes.forEach(ps);this.isUpdating&&(this.isUpdating=!1,this.potentialNodes.size&&(this.potentialNodes.forEach(Ss),this.potentialNodes.clear()),this.nodes.forEach(fs),this.nodes.forEach(us),this.nodes.forEach(cs),this.clearAllSnapshots(),Bn.update(),Bn.preRender(),Bn.render())}clearAllSnapshots(){this.nodes.forEach(ds),this.sharedNodes.forEach(xs)}scheduleUpdateProjection(){Dn.preRender(this.updateProjection,!1,!0)}scheduleCheckAfterUnmount(){Dn.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure())}updateLayout(){var t;if(!this.instance)return;if(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let t=0;t<this.path.length;t++){this.path[t].updateScroll()}const e=this.layout;this.layout=this.measure(!1),this.layoutCorrected={x:{min:0,max:0},y:{min:0,max:0}},this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox),null===(t=this.options.visualElement)||void 0===t||t.notify("LayoutMeasure",this.layout.layoutBox,null==e?void 0:e.layoutBox)}updateScroll(t="measure"){let e=Boolean(this.options.layoutScroll&&this.instance);this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===t&&(e=!1),e&&(this.scroll={animationId:this.root.animationId,phase:t,isRoot:o(this.instance),offset:n(this.instance)})}resetTransform(){var t;if(!i)return;const e=this.isLayoutDirty||this.shouldResetTransform,n=this.projectionDelta&&!Qr(this.projectionDelta),o=null===(t=this.options.visualElement)||void 0===t?void 0:t.getProps().transformTemplate,r=null==o?void 0:o(this.latestValues,""),s=r!==this.prevTransformTemplateValue;e&&(n||Ii(this.latestValues)||s)&&(i(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(t=!0){const e=this.measurePageBox();let n=this.removeElementScroll(e);var o;return t&&(n=this.removeTransform(n)),Ts((o=n).x),Ts(o.y),{animationId:this.root.animationId,measuredBox:e,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:t}=this.options;if(!t)return{x:{min:0,max:0},y:{min:0,max:0}};const e=t.measureViewportBox(),{scroll:n}=this.root;return n&&(Yi(e.x,n.offset.x),Yi(e.y,n.offset.y)),e}removeElementScroll(t){const e={x:{min:0,max:0},y:{min:0,max:0}};Xr(e,t);for(let n=0;n<this.path.length;n++){const o=this.path[n],{scroll:i,options:r}=o;if(o!==this.root&&i&&r.layoutScroll){if(i.isRoot){Xr(e,t);const{scroll:n}=this.root;n&&(Yi(e.x,-n.offset.x),Yi(e.y,-n.offset.y))}Yi(e.x,i.offset.x),Yi(e.y,i.offset.y)}}return e}applyTransform(t,e=!1){const n={x:{min:0,max:0},y:{min:0,max:0}};Xr(n,t);for(let t=0;t<this.path.length;t++){const o=this.path[t];!e&&o.options.layoutScroll&&o.scroll&&o!==o.root&&Zi(n,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),Ii(o.latestValues)&&Zi(n,o.latestValues)}return Ii(this.latestValues)&&Zi(n,this.latestValues),n}removeTransform(t){var e;const n={x:{min:0,max:0},y:{min:0,max:0}};Xr(n,t);for(let t=0;t<this.path.length;t++){const o=this.path[t];if(!o.instance)continue;if(!Ii(o.latestValues))continue;Fi(o.latestValues)&&o.updateSnapshot();const i={x:{min:0,max:0},y:{min:0,max:0}};Xr(i,o.measurePageBox()),_r(n,o.latestValues,null===(e=o.snapshot)||void 0===e?void 0:e.layoutBox,i)}return Ii(this.latestValues)&&_r(n,this.latestValues),n}setTargetDelta(t){this.targetDelta=t,this.isProjectionDirty=!0,this.root.scheduleUpdateProjection()}setOptions(t){this.options={...this.options,...t,crossfade:void 0===t.crossfade||t.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}resolveTargetDelta(){var t;const e=this.getLead();if(this.isProjectionDirty||(this.isProjectionDirty=e.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=e.isTransformDirty),!this.isProjectionDirty&&!this.attemptToResolveRelativeTarget)return;const{layout:n,layoutId:o}=this.options;if(this.layout&&(n||o)){if(!this.targetDelta&&!this.relativeTarget){const t=this.getClosestProjectingParent();t&&t.layout?(this.relativeParent=t,this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},Vi(this.relativeTargetOrigin,this.layout.layoutBox,t.layout.layoutBox),Xr(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}var i,r,s;if(this.relativeTarget||this.targetDelta)if(this.target||(this.target={x:{min:0,max:0},y:{min:0,max:0}},this.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}}),this.relativeTarget&&this.relativeTargetOrigin&&(null===(t=this.relativeParent)||void 0===t?void 0:t.target)?(i=this.target,r=this.relativeTarget,s=this.relativeParent.target,Ti(i.x,r.x,s.x),Ti(i.y,r.y,s.y)):this.targetDelta?(Boolean(this.resumingFrom)?this.target=this.applyTransform(this.layout.layoutBox):Xr(this.target,this.layout.layoutBox),$i(this.target,this.targetDelta)):Xr(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}},Vi(this.relativeTargetOrigin,this.target,t.target),Xr(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(this.parent&&!Fi(this.parent.latestValues)&&!Ui(this.parent.latestValues))return(this.parent.relativeTarget||this.parent.targetDelta)&&this.parent.layout?this.parent:this.parent.getClosestProjectingParent()}calcProjection(){var t;const{isProjectionDirty:e,isTransformDirty:n}=this;this.isProjectionDirty=this.isTransformDirty=!1;const o=this.getLead(),i=Boolean(this.resumingFrom)||this!==o;let r=!0;if(e&&(r=!1),i&&n&&(r=!1),r)return;const{layout:s,layoutId:a}=this.options;if(this.isTreeAnimating=Boolean((null===(t=this.parent)||void 0===t?void 0:t.isTreeAnimating)||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!s&&!a)return;Xr(this.layoutCorrected,this.layout.layoutBox),function(t,e,n,o=!1){var i,r;const s=n.length;if(!s)return;let a,l;e.x=e.y=1;for(let u=0;u<s;u++)a=n[u],l=a.projectionDelta,"contents"!==(null===(r=null===(i=a.instance)||void 0===i?void 0:i.style)||void 0===r?void 0:r.display)&&(o&&a.options.layoutScroll&&a.scroll&&a!==a.root&&Zi(t,{x:-a.scroll.offset.x,y:-a.scroll.offset.y}),l&&(e.x*=l.x.scale,e.y*=l.y.scale,$i(t,l)),o&&Ii(a.latestValues)&&Zi(t,a.latestValues))}(this.layoutCorrected,this.treeScale,this.path,i);const{target:l}=o;if(!l)return;this.projectionDelta||(this.projectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDeltaWithTransform={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}});const u=this.treeScale.x,c=this.treeScale.y,h=this.projectionTransform;Si(this.projectionDelta,this.layoutCorrected,l,this.latestValues),this.projectionTransform=os(this.projectionDelta,this.treeScale),this.projectionTransform===h&&this.treeScale.x===u&&this.treeScale.y===c||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",l))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(t=!0){var e,n,o;null===(n=(e=this.options).scheduleRender)||void 0===n||n.call(e),t&&(null===(o=this.getStack())||void 0===o||o.scheduleRender()),this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}setAnimationOrigin(t,e=!1){var n,o;const i=this.snapshot,r=(null==i?void 0:i.latestValues)||{},s={...this.latestValues},a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};this.relativeTarget=this.relativeTargetOrigin=void 0,this.attemptToResolveRelativeTarget=!e;const l={x:{min:0,max:0},y:{min:0,max:0}},u=(null==i?void 0:i.source)!==(null===(n=this.layout)||void 0===n?void 0:n.source),c=((null===(o=this.getStack())||void 0===o?void 0:o.members.length)||0)<=1,h=Boolean(u&&!c&&!0===this.options.crossfade&&!this.path.some(ws));this.animationProgress=0,this.mixTargetDelta=e=>{var n;const o=e/1e3;var i,d,p,f;bs(a.x,t.x,o),bs(a.y,t.y,o),this.setTargetDelta(a),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&(null===(n=this.relativeParent)||void 0===n?void 0:n.layout)&&(Vi(l,this.layout.layoutBox,this.relativeParent.layout.layoutBox),i=this.relativeTarget,d=this.relativeTargetOrigin,p=l,f=o,Es(i.x,d.x,p.x,f),Es(i.y,d.y,p.y,f)),u&&(this.animationValues=s,function(t,e,n,o,i,r){var s,a,l,u;i?(t.opacity=Ue(0,null!==(s=n.opacity)&&void 0!==s?s:1,Wr(o)),t.opacityExit=Ue(null!==(a=e.opacity)&&void 0!==a?a:1,0,Hr(o))):r&&(t.opacity=Ue(null!==(l=e.opacity)&&void 0!==l?l:1,null!==(u=n.opacity)&&void 0!==u?u:1,o));for(let i=0;i<Ir;i++){const r=`border${Fr[i]}Radius`;let s=zr(e,r),a=zr(n,r);if(void 0===s&&void 0===a)continue;s||(s=0),a||(a=0);0===s||0===a||Nr(s)===Nr(a)?(t[r]=Math.max(Ue(Ur(s),Ur(a),o),0),(it.test(a)||it.test(s))&&(t[r]+="%")):t[r]=a}(e.rotate||n.rotate)&&(t.rotate=Ue(e.rotate||0,n.rotate||0,o))}(s,r,this.latestValues,o,h,c)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=o},this.mixTargetDelta(0)}startAnimation(t){var e,n;this.notifyListeners("animationStart"),null===(e=this.currentAnimation)||void 0===e||e.stop(),this.resumingFrom&&(null===(n=this.resumingFrom.currentAnimation)||void 0===n||n.stop()),this.pendingAnimation&&(On.update(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Dn.update(()=>{T.hasAnimatedSinceResize=!0,this.currentAnimation=jr(0,1e3,{...t,onUpdate:e=>{var n;this.mixTargetDelta(e),null===(n=t.onUpdate)||void 0===n||n.call(t,e)},onComplete:()=>{var e;null===(e=t.onComplete)||void 0===e||e.call(t),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){var t;this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0),null===(t=this.getStack())||void 0===t||t.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){var t;this.currentAnimation&&(null===(t=this.mixTargetDelta)||void 0===t||t.call(this,1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const t=this.getLead();let{targetWithTransforms:e,target:n,layout:o,latestValues:i}=t;if(e&&n&&o){if(this!==t&&this.layout&&o&&As(this.options.animationType,this.layout.layoutBox,o.layoutBox)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const e=Ei(this.layout.layoutBox.x);n.x.min=t.target.x.min,n.x.max=n.x.min+e;const o=Ei(this.layout.layoutBox.y);n.y.min=t.target.y.min,n.y.max=n.y.min+o}Xr(e,n),Zi(e,i),Si(this.projectionDeltaWithTransform,this.layoutCorrected,e,i)}}registerSharedNode(t,e){var n,o,i;this.sharedNodes.has(t)||this.sharedNodes.set(t,new ns);this.sharedNodes.get(t).add(e),e.promote({transition:null===(n=e.options.initialPromotionConfig)||void 0===n?void 0:n.transition,preserveFollowOpacity:null===(i=null===(o=e.options.initialPromotionConfig)||void 0===o?void 0:o.shouldPreserveFollowOpacity)||void 0===i?void 0:i.call(o,e)})}isLead(){const t=this.getStack();return!t||t.lead===this}getLead(){var t;const{layoutId:e}=this.options;return e&&(null===(t=this.getStack())||void 0===t?void 0:t.lead)||this}getPrevLead(){var t;const{layoutId:e}=this.options;return e?null===(t=this.getStack())||void 0===t?void 0:t.prevLead:void 0}getStack(){const{layoutId:t}=this.options;if(t)return this.root.sharedNodes.get(t)}promote({needsReset:t,transition:e,preserveFollowOpacity:n}={}){const o=this.getStack();o&&o.promote(this,n),t&&(this.projectionDelta=void 0,this.needsReset=!0),e&&this.setOptions({transition:e})}relegate(){const t=this.getStack();return!!t&&t.relegate(this)}resetRotation(){const{visualElement:t}=this.options;if(!t)return;let e=!1;const{latestValues:n}=t;if((n.rotate||n.rotateX||n.rotateY||n.rotateZ)&&(e=!0),!e)return;const o={};for(let e=0;e<ss.length;e++){const i="rotate"+ss[e];n[i]&&(o[i]=n[i],t.setStaticValue(i,0))}null==t||t.render();for(const e in o)t.setStaticValue(e,o[e]);t.scheduleRender()}getProjectionStyles(t={}){var e,n,o;const i={};if(!this.instance||this.isSVG)return i;if(!this.isVisible)return{visibility:"hidden"};i.visibility="";const r=null===(e=this.options.visualElement)||void 0===e?void 0:e.getProps().transformTemplate;if(this.needsReset)return this.needsReset=!1,i.opacity="",i.pointerEvents=te(t.pointerEvents)||"",i.transform=r?r(this.latestValues,""):"none",i;const s=this.getLead();if(!this.projectionDelta||!this.layout||!s.target){const e={};return this.options.layoutId&&(e.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,e.pointerEvents=te(t.pointerEvents)||""),this.hasProjected&&!Ii(this.latestValues)&&(e.transform=r?r({},""):"none",this.hasProjected=!1),e}const a=s.animationValues||s.latestValues;this.applyTransformsToTarget(),i.transform=os(this.projectionDeltaWithTransform,this.treeScale,a),r&&(i.transform=r(a,i.transform));const{x:l,y:u}=this.projectionDelta;i.transformOrigin=`${100*l.origin}% ${100*u.origin}% 0`,s.animationValues?i.opacity=s===this?null!==(o=null!==(n=a.opacity)&&void 0!==n?n:this.latestValues.opacity)&&void 0!==o?o:1:this.preserveOpacity?this.latestValues.opacity:a.opacityExit:i.opacity=s===this?void 0!==a.opacity?a.opacity:"":void 0!==a.opacityExit?a.opacityExit:0;for(const t in j){if(void 0===a[t])continue;const{correct:e,applyTo:n}=j[t],o=e(a[t],s);if(n){const t=n.length;for(let e=0;e<t;e++)i[n[e]]=o}else i[t]=o}return this.options.layoutId&&(i.pointerEvents=s===this?te(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(ps),this.root.sharedNodes.clear()}}}function us(t){t.updateLayout()}function cs(t){var e,n,o;const i=(null===(e=t.resumeFrom)||void 0===e?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&i&&t.hasListeners("didUpdate")){const{layoutBox:e,measuredBox:n}=t.layout,{animationType:o}=t.options,r=i.source!==t.layout.source;"size"===o?Bi(t=>{const n=r?i.measuredBox[t]:i.layoutBox[t],o=Ei(n);n.min=e[t].min,n.max=n.min+o}):As(o,i.layoutBox,e)&&Bi(t=>{const n=r?i.measuredBox[t]:i.layoutBox[t],o=Ei(e[t]);n.max=n.min+o});const s={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};Si(s,e,i.layoutBox);const a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};r?Si(a,t.applyTransform(n,!0),i.measuredBox):Si(a,e,i.layoutBox);const l=!Qr(s);let u=!1;if(!t.resumeFrom){const n=t.getClosestProjectingParent();if(n&&!n.resumeFrom){const{snapshot:t,layout:o}=n;if(t&&o){const n={x:{min:0,max:0},y:{min:0,max:0}};Vi(n,i.layoutBox,t.layoutBox);const r={x:{min:0,max:0},y:{min:0,max:0}};Vi(r,e,o.layoutBox),ts(n,r)||(u=!0)}}}t.notifyListeners("didUpdate",{layout:e,snapshot:i,delta:a,layoutDelta:s,hasLayoutChanged:l,hasRelativeTargetChanged:u})}else t.isLead()&&(null===(o=(n=t.options).onExitComplete)||void 0===o||o.call(n));t.options.transition=void 0}function hs(t){t.isProjectionDirty||(t.isProjectionDirty=Boolean(t.parent&&t.parent.isProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=Boolean(t.parent&&t.parent.isTransformDirty))}function ds(t){t.clearSnapshot()}function ps(t){t.clearMeasurements()}function fs(t){const{visualElement:e}=t.options;(null==e?void 0:e.getProps().onBeforeLayoutMeasure)&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function ms(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0}function gs(t){t.resolveTargetDelta()}function vs(t){t.calcProjection()}function ys(t){t.resetRotation()}function xs(t){t.removeLeadSnapshot()}function bs(t,e,n){t.translate=Ue(e.translate,0,n),t.scale=Ue(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function Es(t,e,n,o){t.min=Ue(e.min,n.min,o),t.max=Ue(e.max,n.max,o)}function ws(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}const Ps={duration:.45,ease:[.4,0,.1,1]};function Ss(t,e){let n=t.root;for(let e=t.path.length-1;e>=0;e--)if(Boolean(t.path[e].instance)){n=t.path[e];break}const o=(n&&n!==t.root?n.instance:document).querySelector(`[data-projection-id="${e}"]`);o&&t.mount(o,!0)}function Ts(t){t.min=Math.round(t.min),t.max=Math.round(t.max)}function As(t,e,n){return"position"===t||"preserve-aspect"===t&&!function(t,e,n=.1){return Xn(t,e)<=n}(es(e),es(n),.2)}const Vs=ls({attachResizeListener:(t,e)=>ae(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Cs={current:void 0},Ms=ls({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Cs.current){const t=new Vs(0,{});t.mount(window),t.setOptions({layoutScroll:!0}),Cs.current=t}return Cs.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)}),Rs={...pi,...ho,...tr,...kr},Ls=O((t,e)=>re(t,e,Rs,Mr,Ms));const Ds=O(re);function Os(){const t=e.useRef(!1);return h(()=>(t.current=!0,()=>{t.current=!1}),[]),t}function Bs(){const t=Os(),[n,o]=e.useState(0),i=e.useCallback(()=>{t.current&&o(n+1)},[n]);return[e.useCallback(()=>Dn.postRender(i),[i]),n]}class ks extends r.Component{getSnapshotBeforeUpdate(t){const e=this.props.childRef.current;if(e&&t.isPresent&&!this.props.isPresent){const t=this.props.sizeRef.current;t.height=e.offsetHeight||0,t.width=e.offsetWidth||0,t.top=e.offsetTop,t.left=e.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function js({children:t,isPresent:n}){const o=e.useId(),i=e.useRef(null),s=e.useRef({width:0,height:0,top:0,left:0});return e.useInsertionEffect(()=>{const{width:t,height:e,top:r,left:a}=s.current;if(n||!i.current||!t||!e)return;i.current.dataset.motionPopId=o;const l=document.createElement("style");return document.head.appendChild(l),l.sheet&&l.sheet.insertRule(`\n [data-motion-pop-id="${o}"] {\n position: absolute !important;\n width: ${t}px !important;\n height: ${e}px !important;\n top: ${r}px !important;\n left: ${a}px !important;\n }\n `),()=>{document.head.removeChild(l)}},[n]),r.createElement(ks,{isPresent:n,childRef:i,sizeRef:s},r.cloneElement(t,{ref:i}))}const Fs=({children:t,initial:n,isPresent:o,onExitComplete:i,custom:s,presenceAffectsLayout:a,mode:l})=>{const c=S(Is),h=e.useId(),d=e.useMemo(()=>({id:h,initial:n,isPresent:o,custom:s,onExitComplete:t=>{c.set(t,!0);for(const t of c.values())if(!t)return;i&&i()},register:t=>(c.set(t,!1),()=>c.delete(t))}),a?void 0:[o]);return e.useMemo(()=>{c.forEach((t,e)=>c.set(e,!1))},[o]),r.useEffect(()=>{!o&&!c.size&&i&&i()},[o]),"popLayout"===l&&(t=r.createElement(js,{isPresent:o},t)),r.createElement(u.Provider,{value:d},t)};function Is(){return new Map}const Us=t=>t.key||"";const Ns=e.createContext(null),zs=t=>!t.isLayoutDirty&&t.willUpdate(!1);function Ws(){const t=new Set,e=new WeakMap,n=()=>t.forEach(zs);return{add:o=>{t.add(o),e.set(o,o.addEventListener("willUpdate",n))},remove:o=>{var i;t.delete(o),null===(i=e.get(o))||void 0===i||i(),e.delete(o),n()},dirty:n}}const Hs=t=>!0===t,$s=({children:t,id:n,inheritId:o,inherit:i=!0})=>{void 0!==o&&(i=o);const s=e.useContext(V),a=e.useContext(Ns),[l,u]=Bs(),c=e.useRef(null),h=s.id||a;null===c.current&&((t=>Hs(!0===t)||"id"===t)(i)&&h&&(n=n?h+"-"+n:h),c.current={id:n,group:Hs(i)&&s.group||Ws()});const d=e.useMemo(()=>({...c.current,forceRender:l}),[u]);return r.createElement(V.Provider,{value:d},t)};let Ys=0;function Xs(t){return"function"==typeof t}const Gs=e.createContext(null);const qs=e.forwardRef((function({children:t,as:n="ul",axis:o="y",onReorder:i,values:s,...a},l){const u=S(()=>Ls(n)),c=[],h=e.useRef(!1),d={axis:o,registerItem:(t,e)=>{e&&-1===c.findIndex(e=>t===e.value)&&(c.push({value:t,layout:e[o]}),c.sort(Ks))},updateOrder:(t,e,n)=>{if(h.current)return;const o=function(t,e,n,o){if(!o)return t;const i=t.findIndex(t=>t.value===e);if(-1===i)return t;const r=o>0?1:-1,s=t[i+r];if(!s)return t;const a=t[i],l=s.layout,u=Ue(l.min,l.max,.5);return 1===r&&a.layout.max+n>u||-1===r&&a.layout.min+n<u?function([...t],e,n){const o=e<0?t.length+e:e;if(o>=0&&o<t.length){const o=n<0?t.length+n:n,[i]=t.splice(e,1);t.splice(o,0,i)}return t}(t,i,i+r):t}(c,t,e,n);c!==o&&(h.current=!0,i(o.map(Zs).filter(t=>-1!==s.indexOf(t))))}};return e.useEffect(()=>{h.current=!1}),r.createElement(u,{...a,ref:l},r.createElement(Gs.Provider,{value:d},t))}));function Zs(t){return t.value}function Ks(t,e){return t.layout.min-e.layout.min}function _s(t){const n=S(()=>Wo(t)),{isStatic:o}=e.useContext(s);if(o){const[,o]=e.useState(t);e.useEffect(()=>n.onChange(o),[])}return n}function Js(...t){const e=!Array.isArray(t[0]),n=e?0:-1,o=t[0+n],i=t[1+n],r=t[2+n],s=t[3+n],a=nn(i,r,{mixer:(l=r[0],(t=>"object"==typeof t&&t.mix)(l)?l.mix:void 0),...s});var l;return e?a(o):a}function Qs(t,e){const n=_s(e()),o=()=>n.set(e());return o(),function(t,e,n){h(()=>{const o=t.map(t=>t.onChange(e));return()=>{o.forEach(t=>t()),n()}})}(t,()=>Dn.update(o,!1,!0),()=>On.update(o)),n}function ta(t,e,n,o){const i="function"==typeof e?e:Js(e,n,o);return Array.isArray(t)?ea(t,i):ea([t],([t])=>i(t))}function ea(t,e){const n=S(()=>[]);return Qs(t,()=>{n.length=0;const o=t.length;for(let e=0;e<o;e++)n[e]=t[e].get();return e(n)})}function na(t,e=0){return z(t)?t:_s(e)}const oa={Group:qs,Item:e.forwardRef((function({children:t,style:n={},value:o,as:i="li",onDrag:s,layout:a=!0,...l},u){const c=S(()=>Ls(i)),h=e.useContext(Gs),d={x:na(n.x),y:na(n.y)},p=ta([d.x,d.y],([t,e])=>t||e?1:"unset"),f=e.useRef(null),{axis:m,registerItem:g,updateOrder:v}=h;return e.useEffect(()=>{g(o,f.current)},[h]),r.createElement(c,{drag:m,...l,dragSnapToOrigin:!0,style:{...n,x:d.x,y:d.y,zIndex:p},layout:a,onDrag:(t,e)=>{const{velocity:n}=e;n[m]&&v(o,d[m].get(),n[m]),s&&s(t,e)},onLayoutMeasure:t=>{f.current=t},ref:u},t)}))},ia={renderer:Mr,...pi,...ho},ra={...ia,...tr,...kr,projectionNodeConstructor:Ms};const sa=t=>"number"==typeof t;function aa(t,e){return(t=>Array.isArray(t)&&!sa(t[0]))(t)?t[((t,e,n)=>{const o=e-t;return((n-t)%o+o)%o+t})(0,t.length,e)]:t}const la=(t,e,n)=>-n*t+n*e+t,ua=t=>t,ca=(t,e,n)=>e-t==0?1:(n-t)/(e-t);function ha(t,e){const n=t[t.length-1];for(let o=1;o<=e;o++){const i=ca(0,e,o);t.push(la(n,1,i))}}function da(t){const e=[0];return ha(e,t-1),e}function pa(t,e=da(t.length),n=ua){const o=t.length,i=o-e.length;return i>0&&ha(e,i),i=>{let r=0;for(;r<o-2&&!(i<e[r+1]);r++);let s=(a=0,l=1,u=ca(e[r],e[r+1],i),Math.min(Math.max(u,a),l));var a,l,u;return s=aa(n,r)(s),la(t[r],t[r+1],s)}}const fa=t=>"function"==typeof t,ma=t=>"string"==typeof t;function ga(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 va={any:0,all:1};const ya=new WeakMap;let xa;function ba({target:t,contentRect:e,borderBoxSize:n}){var o;null===(o=ya.get(t))||void 0===o||o.forEach(o=>{o({target:t,contentSize:e,get size(){return function(t,e){if(e){const{inlineSize:t,blockSize:n}=e[0];return{width:t,height:n}}return t instanceof SVGElement&&"getBBox"in t?t.getBBox():{width:t.offsetWidth,height:t.offsetHeight}}(t,n)}})})}function Ea(t){t.forEach(ba)}function wa(t,e){xa||"undefined"!=typeof ResizeObserver&&(xa=new ResizeObserver(Ea));const n=ga(t);return n.forEach(t=>{let n=ya.get(t);n||(n=new Set,ya.set(t,n)),n.add(e),null==xa||xa.observe(t)}),()=>{n.forEach(t=>{const n=ya.get(t);null==n||n.delete(e),(null==n?void 0:n.size)||null==xa||xa.unobserve(t)})}}const Pa=new Set;let Sa;function Ta(t){return Pa.add(t),Sa||(Sa=()=>{const t={width:window.innerWidth,height:window.innerHeight},e={target:window,size:t,contentSize:t};Pa.forEach(t=>t(e))},window.addEventListener("resize",Sa)),()=>{Pa.delete(t),!Pa.size&&Sa&&(Sa=void 0)}}const Aa={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}};function Va(t,e,n,o){const i=n[e],{length:r,position:s}=Aa[e],a=i.current,l=n.time;i.current=t["scroll"+s],i.scrollLength=t["scroll"+r]-t["client"+r],i.offset.length=0,i.offset[0]=0,i.offset[1]=i.scrollLength,i.progress=ca(0,i.scrollLength,i.current);const u=o-l;var c,h;i.velocity=u>50?0:(c=i.current-a,(h=u)?c*(1e3/h):0)}const Ca={Enter:[[0,1],[1,1]],Exit:[[0,0],[1,0]],Any:[[1,0],[0,1]],All:[[0,0],[1,1]]},Ma={start:0,center:.5,end:1};function Ra(t,e,n=0){let o=0;if(void 0!==Ma[t]&&(t=Ma[t]),ma(t)){const e=parseFloat(t);t.endsWith("px")?o=e:t.endsWith("%")?t=e/100:t.endsWith("vw")?o=e/100*document.documentElement.clientWidth:t.endsWith("vh")?o=e/100*document.documentElement.clientHeight:t=e}return sa(t)&&(o=e*t),n+o}const La=[0,0];function Da(t,e,n,o){let i=Array.isArray(t)?t:La,r=0,s=0;return sa(t)?i=[t,t]:ma(t)&&(i=(t=t.trim()).includes(" ")?t.split(" "):[t,Ma[t]?t:"0"]),r=Ra(i[0],n,o),s=Ra(i[1],e),r-s}const Oa={x:0,y:0};function Ba(t,e,n){let{offset:o=Ca.All}=n;const{target:i=t,axis:r="y"}=n,s="y"===r?"height":"width",a=i!==t?function(t,e){let n={x:0,y:0},o=t;for(;o&&o!==e;)if(o instanceof HTMLElement)n.x+=o.offsetLeft,n.y+=o.offsetTop,o=o.offsetParent;else if(o instanceof SVGGraphicsElement&&"getBBox"in o){const{top:t,left:e}=o.getBBox();for(n.x+=e,n.y+=t;o&&"svg"!==o.tagName;)o=o.parentNode}return n}(i,t):Oa,l=i===t?{width:t.scrollWidth,height:t.scrollHeight}:{width:i.clientWidth,height:i.clientHeight},u={width:t.clientWidth,height:t.clientHeight};e[r].offset.length=0;let c=!e[r].interpolate;const h=o.length;for(let t=0;t<h;t++){const n=Da(o[t],u[s],l[s],a[r]);c||n===e[r].interpolatorOffsets[t]||(c=!0),e[r].offset[t]=n}c&&(e[r].interpolate=pa(da(h),e[r].offset),e[r].interpolatorOffsets=[...e[r].offset]),e[r].progress=e[r].interpolate(e[r].current)}function ka(t,e,n,o={}){const i=o.axis||"y";return{measure:()=>function(t,e=t,n){if(n.x.targetOffset=0,n.y.targetOffset=0,e!==t){let o=e;for(;o&&o!=t;)n.x.targetOffset+=o.offsetLeft,n.y.targetOffset+=o.offsetTop,o=o.offsetParent}n.x.targetLength=e===t?e.scrollWidth:e.clientWidth,n.y.targetLength=e===t?e.scrollHeight:e.clientHeight,n.x.containerLength=t.clientWidth,n.y.containerLength=t.clientHeight}(t,o.target,n),update:e=>{!function(t,e,n){Va(t,"x",e,n),Va(t,"y",e,n),e.time=n}(t,n,e),(o.offset||o.target)&&Ba(t,n,o)},notify:fa(e)?()=>e(n):ja(e,n[i])}}function ja(t,e){return t.pause(),t.forEachNative((t,{easing:e})=>{var n,o;if(t.updateDuration)e||(t.easing=ua),t.updateDuration(1);else{const i={duration:1e3};e||(i.easing="linear"),null===(o=null===(n=t.effect)||void 0===n?void 0:n.updateTiming)||void 0===o||o.call(n,i)}}),()=>{t.currentTime=e.progress}}const Fa=new WeakMap,Ia=new WeakMap,Ua=new WeakMap,Na=t=>t===document.documentElement?window:t;function za(t,e={}){var{container:n=document.documentElement}=e,o=Me(e,["container"]);let i=Ua.get(n);i||(i=new Set,Ua.set(n,i));const r=ka(n,t,{time:0,x:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0},y:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0}},o);if(i.add(r),!Fa.has(n)){const t=()=>{const t=performance.now();for(const t of i)t.measure();for(const e of i)e.update(t);for(const t of i)t.notify()};Fa.set(n,t);const e=Na(n);window.addEventListener("resize",t,{passive:!0}),n!==document.documentElement&&Ia.set(n,function(t,e){return fa(t)?Ta(t):wa(t,e)}(n,t)),e.addEventListener("scroll",t,{passive:!0})}const s=Fa.get(n),a=requestAnimationFrame(s);return()=>{var e;"function"!=typeof t&&t.stop(),cancelAnimationFrame(a);const o=Ua.get(n);if(!o)return;if(o.delete(r),o.size)return;const i=Fa.get(n);Fa.delete(n),i&&(Na(n).removeEventListener("scroll",i),null===(e=Ia.get(n))||void 0===e||e(),window.removeEventListener("resize",i))}}const Wa=()=>({scrollX:Wo(0),scrollY:Wo(0),scrollXProgress:Wo(0),scrollYProgress:Wo(0)});function Ha({container:t,target:n,layoutEffect:o=!0,...i}={}){const r=S(Wa);return(o?h:e.useEffect)(()=>za(({x:t,y:e})=>{r.scrollX.set(t.current),r.scrollXProgress.set(t.progress),r.scrollY.set(e.current),r.scrollYProgress.set(e.progress)},{...i,container:(null==t?void 0:t.current)||void 0,target:(null==n?void 0:n.current)||void 0}),[]),r}function $a(t){const n=e.useRef(0),{isStatic:o}=e.useContext(s);e.useEffect(()=>{if(o)return;const e=({timestamp:e,delta:o})=>{n.current||(n.current=e),t(e-n.current,o)};return Dn.update(e,!0),()=>On.update(e)},[t])}class Ya extends zo{constructor(){super(...arguments),this.members=[],this.transforms=new Set}add(t){let e;U.has(t)?(this.transforms.add(t),e="transform"):t.startsWith("origin")||Y(t)||"willChange"===t||(e=Yt(t)),e&&(Io(this.members,e),this.update())}remove(t){U.has(t)?(this.transforms.delete(t),this.transforms.size||Uo(this.members,"transform")):Uo(this.members,Yt(t)),this.update()}update(){this.set(this.members.length?this.members.join(", "):"auto")}}function Xa(){!yr.current&&xr();const[t]=e.useState(vr.current);return t}function Ga(){let t=!1;const e=[],n=new Set,o={subscribe:t=>(n.add(t),()=>{n.delete(t)}),start(o,i){if(t){const t=[];return n.forEach(e=>{t.push(ni(e,o,{transitionOverride:i}))}),Promise.all(t)}return new Promise(t=>{e.push({animation:[o,i],resolve:t})})},set:t=>n.forEach(e=>{!function(t,e){Array.isArray(e)?_o(t,e):"string"==typeof e?_o(t,[e]):Ko(t,e)}(e,t)}),stop(){n.forEach(t=>{!function(t){t.values.forEach(t=>t.stop())}(t)})},mount:()=>(t=!0,e.forEach(({animation:t,resolve:e})=>{o.start(...t).then(e)}),()=>{t=!1,o.stop()})};return o}function qa(){const t=S(Ga);return e.useEffect(t.mount,[]),t}const Za=qa;class Ka{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 _a=()=>new Ka;function Ja(t){return null!==t&&"object"==typeof t&&R in t}function Qa(){return tl}function tl(t){Cs.current&&(Cs.current.isUpdating=!1,Cs.current.blockUpdate(),t&&t())}const el=()=>({});class nl extends Pr{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 Jo(this,n,ti(n,t||{},this)),{transition:t,transitionEnd:e,...n}}}const ol=ee({scrapeMotionValuesFromProps:el,createRenderState:el});const il=t=>t>.001?1/t:1e5;t.AnimatePresence=({children:t,custom:n,initial:o=!0,onExitComplete:i,exitBeforeEnter:s,presenceAffectsLayout:a=!0,mode:l="sync"})=>{s&&(l="wait",eo(!1,"Replace exitBeforeEnter with mode='wait'"));let[u]=Bs();const c=e.useContext(V).forceRender;c&&(u=c);const d=Os(),p=function(t){const n=[];return e.Children.forEach(t,t=>{e.isValidElement(t)&&n.push(t)}),n}(t);let f=p;const m=new Set,g=e.useRef(f),v=e.useRef(new Map).current,y=e.useRef(!0);if(h(()=>{y.current=!1,function(t,e){t.forEach(t=>{const n=Us(t);e.set(n,t)})}(p,v),g.current=f}),Ce(()=>{y.current=!0,v.clear(),m.clear()}),y.current)return r.createElement(r.Fragment,null,f.map(t=>r.createElement(Fs,{key:Us(t),isPresent:!0,initial:!!o&&void 0,presenceAffectsLayout:a,mode:l},t)));f=[...f];const x=g.current.map(Us),b=p.map(Us),E=x.length;for(let t=0;t<E;t++){const e=x[t];-1===b.indexOf(e)&&m.add(e)}return"wait"===l&&m.size&&(f=[]),m.forEach(t=>{if(-1!==b.indexOf(t))return;const e=v.get(t);if(!e)return;const o=x.indexOf(t);f.splice(o,0,r.createElement(Fs,{key:Us(e),isPresent:!1,onExitComplete:()=>{v.delete(t),m.delete(t);const e=g.current.findIndex(e=>e.key===t);if(g.current.splice(e,1),!m.size){if(g.current=p,!1===d.current)return;u(),i&&i()}},custom:n,presenceAffectsLayout:a,mode:l},e))}),f=f.map(t=>{const e=t.key;return m.has(e)?t:r.createElement(Fs,{key:Us(t),isPresent:!0,presenceAffectsLayout:a,mode:l},t)}),"production"!==Qn&&"wait"===l&&f.length>1&&console.warn('You\'re attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.'),r.createElement(r.Fragment,null,m.size?f:f.map(t=>e.cloneElement(t)))},t.AnimateSharedLayout=({children:t})=>(r.useEffect(()=>{},[]),r.createElement($s,{id:S(()=>"asl-"+Ys++)},t)),t.DeprecatedLayoutGroupContext=Ns,t.DragControls=Ka,t.FlatTree=rs,t.LayoutGroup=$s,t.LayoutGroupContext=V,t.LazyMotion=function({children:t,features:n,strict:o=!1}){const[,i]=e.useState(!Xs(n)),s=e.useRef(void 0);if(!Xs(n)){const{renderer:t,...e}=n;s.current=t,P(e)}return e.useEffect(()=>{Xs(n)&&n().then(({renderer:t,...e})=>{P(e),s.current=t,i(!0)})},[]),r.createElement(d.Provider,{value:{renderer:s.current,strict:o}},t)},t.MotionConfig=function({children:t,isValidProp:n,...o}){n&&jt(n),(o={...e.useContext(s),...o}).isStatic=S(()=>o.isStatic);const i=e.useMemo(()=>o,[JSON.stringify(o.transition),o.transformPagePoint,o.reducedMotion]);return r.createElement(s.Provider,{value:i},t)},t.MotionConfigContext=s,t.MotionContext=a,t.MotionValue=zo,t.PresenceContext=u,t.Reorder=oa,t.SwitchLayoutGroupContext=M,t.VisualElement=Pr,t.addPointerEvent=xe,t.addScaleCorrector=F,t.animate=jr,t.animateVisualElement=ni,t.animationControls=Ga,t.animations=pi,t.buildTransform=$,t.calcLength=Ei,t.checkTargetForNewValues=Jo,t.createBox=Oi,t.createDomMotionComponent=function(t){return L(re(t,{forwardMotionProps:!1},Rs,Mr,Ms))},t.createMotionComponent=L,t.delay=Mo,t.domAnimation=ia,t.domMax=ra,t.filterProps=Ft,t.isBrowser=c,t.isDragActive=Te,t.isMotionComponent=Ja,t.isMotionValue=z,t.isValidMotionProp=Bt,t.m=Ds,t.makeUseVisualState=ee,t.motion=Ls,t.motionValue=Wo,t.resolveMotionValue=te,t.transform=Js,t.unwrapMotionComponent=function(t){if(Ja(t))return t[R]},t.useAnimation=Za,t.useAnimationControls=qa,t.useAnimationFrame=$a,t.useCycle=function(...t){const n=e.useRef(0),[o,i]=e.useState(t[n.current]);return[o,e.useCallback(e=>{n.current="number"!=typeof e?((t,e,n)=>{const o=e-t;return((n-t)%o+o)%o+t})(0,t.length,n.current+1):e,i(t[n.current])},[t.length,...t])]},t.useDeprecatedAnimatedState=function(t){const[n,o]=e.useState(t),i=ol({},!1),r=S(()=>new nl({props:{},visualState:i},{initialState:t}));return e.useEffect(()=>(r.mount({}),()=>r.unmount()),[r]),e.useEffect(()=>{r.setProps({onUpdate:t=>{o({...t})}})},[o,r]),[n,S(()=>t=>ni(r,t))]},t.useDeprecatedInvertedScale=function(t){let e=_s(1),n=_s(1);const o=l();return t?(e=t.scaleX||e,n=t.scaleY||n):o&&(e=o.getValue("scaleX",1),n=o.getValue("scaleY",1)),{scaleX:ta(e,il),scaleY:ta(n,il)}},t.useDomEvent=le,t.useDragControls=function(){return S(_a)},t.useElementScroll=function(t){return eo(!1,"useElementScroll is deprecated. Convert to useScroll({ container: ref })."),Ha({container:t})},t.useForceUpdate=Bs,t.useInView=function(t,{root:n,margin:o,amount:i,once:r=!1}={}){const[s,a]=e.useState(!1);return e.useEffect(()=>{if(!t.current||r&&s)return;const e={root:n&&n.current||void 0,margin:o,amount:"some"===i?"any":i};return function(t,e,{root:n,margin:o,amount:i="any"}={}){if("undefined"==typeof IntersectionObserver)return()=>{};const r=ga(t),s=new WeakMap,a=new IntersectionObserver(t=>{t.forEach(t=>{const n=s.get(t.target);if(t.isIntersecting!==Boolean(n))if(t.isIntersecting){const n=e(t);fa(n)?s.set(t.target,n):a.unobserve(t.target)}else n&&(n(t),s.delete(t.target))})},{root:n,rootMargin:o,threshold:"number"==typeof i?i:va[i]});return r.forEach(t=>a.observe(t)),()=>a.disconnect()}(t.current,()=>(a(!0),r?void 0:()=>a(!1)),e)},[n,t,o,r]),s},t.useInstantLayoutTransition=Qa,t.useInstantTransition=function(){const[t,n]=Bs(),o=Qa();return e.useEffect(()=>{Dn.postRender(()=>Dn.postRender(()=>Co.current=!1))},[n]),e=>{o(()=>{Co.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 Qs(e,(function(){let o="";for(let i=0;i<n;i++){o+=t[i];e[i]&&(o+=e[i].get())}return o}))},t.useMotionValue=_s,t.usePresence=po,t.useReducedMotion=Xa,t.useReducedMotionConfig=function(){const t=Xa(),{reducedMotion:n}=e.useContext(s);return"never"!==n&&("always"===n||t)},t.useResetProjection=function(){return r.useCallback(()=>{const t=Cs.current;t&&t.resetTree()},[])},t.useScroll=Ha,t.useSpring=function(t,n={}){const{isStatic:o}=e.useContext(s),i=e.useRef(null),r=_s(z(t)?t.get():t);return e.useMemo(()=>r.attach((t,e)=>o?e(t):(i.current&&i.current.stop(),i.current=zn({from:r.get(),to:t,velocity:r.getVelocity(),...n,onUpdate:e}),r.get())),[JSON.stringify(n)]),function(t,e){h(()=>{if(z(t))return t.onChange(e)},[e])}(t,t=>r.set(parseFloat(t))),r},t.useTime=function(){const t=_s(0);return $a(e=>t.set(e)),t},t.useTransform=ta,t.useUnmountEffect=Ce,t.useVelocity=function(t){const n=_s(t.getVelocity());return e.useEffect(()=>t.velocityUpdateSubscribers.add(t=>{n.set(t)}),[t]),n},t.useViewportScroll=function(){return eo(!1,"useViewportScroll is deprecated. Convert to useScroll()."),Ha()},t.useVisualElementContext=l,t.useWillChange=function(){return S(()=>new Ya("auto"))},t.wrapHandler=me,Object.defineProperty(t,"__esModule",{value:!0})}));