framer-motion 7.2.1 → 7.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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 r=n(e),i=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,d=c?e.useLayoutEffect:e.useEffect,h=e.createContext({strict:!1});function f(t){return"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}function p(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=>p(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||p(e)?e:void 0,animate:p(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 w=t=>({isEnabled:e=>t.some(t=>!!e[t])}),E={measureLayout:w(["layout","layoutId","drag"]),animation:w(["animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView"]),exit:w(["exit"]),drag:w(["drag","dragControls"]),focus:w(["whileFocus"]),hover:w(["whileHover","onHoverStart","onHoverEnd"]),tap:w(["whileTap","onTap","onTapStart","onTapCancel"]),pan:w(["onPan","onPanStart","onPanSessionStart","onPanEnd"]),inView:w(["whileInView","onViewportEnter","onViewportLeave"])};function S(t){for(const e in t)"projectionNodeConstructor"===e?E.projectionNodeConstructor=t[e]:E[e].Component=t[e]}function A(t){const n=e.useRef(null);return null===n.current&&(n.current=t()),n.current}const P={hasAnimatedSinceResize:!0,hasEverUpdated:!1};let T=1;const C=e.createContext({});class V extends r.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({});function R({preloadedFeatures:t,createVisualElement:n,projectionNodeConstructor:o,useRender:r,useVisualState:p,Component:m}){return t&&S(t),e.forwardRef((function(g,v){const y={...e.useContext(s),...g,layoutId:L(g)},{isStatic:b}=y;let w=null;const S=x(g),C=b?void 0:A(()=>{if(P.hasEverUpdated)return T++}),R=p(g,b);if(!b&&c){S.visualElement=function(t,n,o,r){const i=l(),a=e.useContext(h),c=e.useContext(u),f=e.useContext(s).reducedMotion,p=e.useRef(void 0);r=r||a.renderer,!p.current&&r&&(p.current=r(t,{visualState:n,parent:i,props:o,presenceId:c?c.id:void 0,blockInitialAnimation:!!c&&!1===c.initial,reducedMotionConfig:f}));const m=p.current;return d(()=>{m&&m.syncRender()}),e.useEffect(()=>{m&&m.animationState&&m.animationState.animateChanges()}),d(()=>()=>m&&m.notifyUnmount(),[]),m}(m,R,y,n);const r=e.useContext(h).strict,i=e.useContext(M);S.visualElement&&(w=S.visualElement.loadFeatures(g,r,t,C,o||E.projectionNodeConstructor,i))}return i.createElement(V,{visualElement:S.visualElement,props:y},w,i.createElement(a.Provider,{value:S},r(m,g,C,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):f(o)&&(o.current=e))},[n])}(R,S.visualElement,v),R,b,S.visualElement)))}))}function L({layoutId:t}){const n=e.useContext(C).id;return n&&void 0!==t?n+"-"+t:t}function O(t){function e(e,n={}){return R(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 k=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","svg","switch","symbol","text","tspan","use","view"];function D(t){return"string"==typeof t&&!t.includes("-")&&!!(k.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","skew","skewX","skewY"],B=new Set(I);function U(t,{layout:e,layoutId:n}){return B.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!j[t]||"opacity"===t)}const z=t=>void 0!==t&&!!t.getVelocity,N={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},W=(t,e)=>I.indexOf(t)-I.indexOf(e);function H(t){return t.startsWith("--")}const $=(t,e)=>e&&"number"==typeof t?e.transform(t):t,Y=(t,e)=>n=>Math.max(Math.min(n,e),t),X=t=>t%1?Number(t.toFixed(5)):t,G=/(-)?([\d]*\.?[\d])+/g,q=/(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,Z=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function K(t){return"string"==typeof t}const _={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},J=Object.assign(Object.assign({},_),{transform:Y(0,1)}),Q=Object.assign(Object.assign({},_),{default:1}),tt=t=>({test:e=>K(e)&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),et=tt("deg"),nt=tt("%"),ot=tt("px"),rt=tt("vh"),it=tt("vw"),st=Object.assign(Object.assign({},nt),{parse:t=>nt.parse(t)/100,transform:t=>nt.transform(100*t)}),at=(t,e)=>n=>Boolean(K(n)&&Z.test(n)&&n.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(n,e)),lt=(t,e,n)=>o=>{if(!K(o))return o;const[r,i,s,a]=o.match(G);return{[t]:parseFloat(r),[e]:parseFloat(i),[n]:parseFloat(s),alpha:void 0!==a?parseFloat(a):1}},ut={test:at("hsl","hue"),parse:lt("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:o=1})=>"hsla("+Math.round(t)+", "+nt.transform(X(e))+", "+nt.transform(X(n))+", "+X(J.transform(o))+")"},ct=Y(0,255),dt=Object.assign(Object.assign({},_),{transform:t=>Math.round(ct(t))}),ht={test:at("rgb","red"),parse:lt("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:o=1})=>"rgba("+dt.transform(t)+", "+dt.transform(e)+", "+dt.transform(n)+", "+X(J.transform(o))+")"};const ft={test:at("#"),parse:function(t){let e="",n="",o="",r="";return t.length>5?(e=t.substr(1,2),n=t.substr(3,2),o=t.substr(5,2),r=t.substr(7,2)):(e=t.substr(1,1),n=t.substr(2,1),o=t.substr(3,1),r=t.substr(4,1),e+=e,n+=n,o+=o,r+=r),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(o,16),alpha:r?parseInt(r,16)/255:1}},transform:ht.transform},pt={test:t=>ht.test(t)||ft.test(t)||ut.test(t),parse:t=>ht.test(t)?ht.parse(t):ut.test(t)?ut.parse(t):ft.parse(t),transform:t=>K(t)?t:t.hasOwnProperty("red")?ht.transform(t):ut.transform(t)};function mt(t){"number"==typeof t&&(t=""+t);const e=[];let n=0;const o=t.match(q);o&&(n=o.length,t=t.replace(q,"${c}"),e.push(...o.map(pt.parse)));const r=t.match(G);return r&&(t=t.replace(G,"${n}"),e.push(...r.map(_.parse))),{values:e,numColors:n,tokenised:t}}function gt(t){return mt(t).values}function vt(t){const{values:e,numColors:n,tokenised:o}=mt(t),r=e.length;return t=>{let e=o;for(let o=0;o<r;o++)e=e.replace(o<n?"${c}":"${n}",o<n?pt.transform(t[o]):X(t[o]));return e}}const yt=t=>"number"==typeof t?0:t;const xt={test:function(t){var e,n,o,r;return isNaN(t)&&K(t)&&(null!==(n=null===(e=t.match(G))||void 0===e?void 0:e.length)&&void 0!==n?n:0)+(null!==(r=null===(o=t.match(q))||void 0===o?void 0:o.length)&&void 0!==r?r:0)>0},parse:gt,createTransformer:vt,getAnimatableNone:function(t){const e=gt(t);return vt(t)(e.map(yt))}},bt=new Set(["brightness","contrast","saturate","opacity"]);function wt(t){let[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[o]=n.match(G)||[];if(!o)return t;const r=n.replace(o,"");let i=bt.has(e)?1:0;return o!==n&&(i*=100),e+"("+i+r+")"}const Et=/([a-z-]*)\(.*?\)/g,St=Object.assign(Object.assign({},xt),{getAnimatableNone:t=>{const e=t.match(Et);return e?e.map(wt).join(" "):t}}),At={..._,transform:Math.round},Pt={borderWidth:ot,borderTopWidth:ot,borderRightWidth:ot,borderBottomWidth:ot,borderLeftWidth:ot,borderRadius:ot,radius:ot,borderTopLeftRadius:ot,borderTopRightRadius:ot,borderBottomRightRadius:ot,borderBottomLeftRadius:ot,width:ot,maxWidth:ot,height:ot,maxHeight:ot,size:ot,top:ot,right:ot,bottom:ot,left:ot,padding:ot,paddingTop:ot,paddingRight:ot,paddingBottom:ot,paddingLeft:ot,margin:ot,marginTop:ot,marginRight:ot,marginBottom:ot,marginLeft:ot,rotate:et,rotateX:et,rotateY:et,rotateZ:et,scale:Q,scaleX:Q,scaleY:Q,scaleZ:Q,skew:et,skewX:et,skewY:et,distance:ot,translateX:ot,translateY:ot,translateZ:ot,x:ot,y:ot,z:ot,perspective:ot,transformPerspective:ot,opacity:J,originX:st,originY:st,originZ:ot,zIndex:At,fillOpacity:J,strokeOpacity:J,numOctaves:At};function Tt(t,e,n,o){const{style:r,vars:i,transform:s,transformKeys:a,transformOrigin:l}=t;a.length=0;let u=!1,c=!1,d=!0;for(const t in e){const n=e[t];if(H(t)){i[t]=n;continue}const o=Pt[t],h=$(n,o);if(B.has(t)){if(u=!0,s[t]=h,a.push(t),!d)continue;n!==(o.default||0)&&(d=!1)}else t.startsWith("origin")?(c=!0,l[t]=h):r[t]=h}if(u||o?r.transform=function({transform:t,transformKeys:e},{enableHardwareAcceleration:n=!0,allowTransformNone:o=!0},r,i){let s="";e.sort(W);for(const n of e)s+=`${N[n]||n}(${t[n]}) `;return n&&!t.z&&(s+="translateZ(0)"),s=s.trim(),i?s=i(t,r?"":s):o&&r&&(s="none"),s}(t,n,d,o):!e.transform&&r.transform&&(r.transform="none"),c){const{originX:t="50%",originY:e="50%",originZ:n=0}=l;r.transformOrigin=`${t} ${e} ${n}`}}const Ct=()=>({style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}});function Vt(t,e,n){for(const o in e)z(e[o])||U(o,n)||(t[o]=e[o])}function Mt(t,n,o){const r={};return Vt(r,t.style||{},t),Object.assign(r,function({transformTemplate:t},n,o){return e.useMemo(()=>{const e={style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}};return Tt(e,n,{enableHardwareAcceleration:!o},t),Object.assign({},e.vars,e.style)},[n])}(t,n,o)),t.transformValues?t.transformValues(r):r}function Rt(t,e,n){const o={},r=Mt(t,e,n);return t.drag&&!1!==t.dragListener&&(o.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=!0===t.drag?"none":"pan-"+("x"===t.drag?"y":"x")),o.style=r,o}const Lt=new Set(["initial","style","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 Ot(t){return Lt.has(t)}let kt=t=>!Ot(t);function Dt(t){t&&(kt=e=>e.startsWith("on")?!Ot(e):t(e))}try{Dt(require("@emotion/is-prop-valid").default)}catch(t){}function jt(t,e,n){const o={};for(const r in t)(kt(r)||!0===n&&Ot(r)||!e&&!Ot(r)||t.draggable&&r.startsWith("onDrag"))&&(o[r]=t[r]);return o}function Ft(t,e,n){return"string"==typeof t?t:ot.transform(e+n*t)}const It={offset:"stroke-dashoffset",array:"stroke-dasharray"},Bt={offset:"strokeDashoffset",array:"strokeDasharray"};function Ut(t,{attrX:e,attrY:n,originX:o,originY:r,pathLength:i,pathSpacing:s=1,pathOffset:a=0,...l},u,c){Tt(t,l,u,c),t.attrs=t.style,t.style={};const{attrs:d,style:h,dimensions:f}=t;d.transform&&(f&&(h.transform=d.transform),delete d.transform),f&&(void 0!==o||void 0!==r||h.transform)&&(h.transformOrigin=function(t,e,n){return`${Ft(e,t.x,t.width)} ${Ft(n,t.y,t.height)}`}(f,void 0!==o?o:.5,void 0!==r?r:.5)),void 0!==e&&(d.x=e),void 0!==n&&(d.y=n),void 0!==i&&function(t,e,n=1,o=0,r=!0){t.pathLength=1;const i=r?It:Bt;t[i.offset]=ot.transform(-o);const s=ot.transform(e),a=ot.transform(n);t[i.array]=`${s} ${a}`}(d,i,s,a,!1)}const zt=()=>({style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{},attrs:{}});function Nt(t,n){const o=e.useMemo(()=>{const e={style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{},attrs:{}};return Ut(e,n,{enableHardwareAcceleration:!1},t.transformTemplate),{...e.attrs,style:{...e.style}}},[n]);if(t.style){const e={};Vt(e,t.style,t),o.style={...e,...o.style}}return o}function Wt(t=!1){return(n,o,r,i,{latestValues:s},a)=>{const l=(D(n)?Nt:Rt)(o,s,a),u={...jt(o,"string"==typeof n,t),...l,ref:i};return r&&(u["data-projection-id"]=r),e.createElement(n,u)}}const Ht=t=>t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();function $t(t,{style:e,vars:n},o,r){Object.assign(t.style,e,r&&r.getProjectionStyles(o));for(const e in n)t.style.setProperty(e,n[e])}const Yt=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength"]);function Xt(t,e,n,o){$t(t,e,void 0,o);for(const n in e.attrs)t.setAttribute(Yt.has(n)?n:Ht(n),e.attrs[n])}function Gt(t){const{style:e}=t,n={};for(const o in e)(z(e[o])||U(o,t))&&(n[o]=e[o]);return n}function qt(t){const e=Gt(t);for(const n in t)if(z(t[n])){e["x"===n||"y"===n?"attr"+n.toUpperCase():n]=t[n]}return e}function Zt(t,e,n,o={},r={}){return"function"==typeof e&&(e=e(void 0!==n?n:t.custom,o,r)),"string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e&&(e=e(void 0!==n?n:t.custom,o,r)),e}const Kt=t=>Array.isArray(t),_t=t=>Kt(t)?t[t.length-1]||0:t;function Jt(t){const e=z(t)?t.get():t;return n=e,Boolean(n&&"object"==typeof n&&n.mix&&n.toValue)?e.toValue():e;var n}const Qt=t=>(n,o)=>{const r=e.useContext(a),i=e.useContext(u),s=()=>function({scrapeMotionValuesFromProps:t,createRenderState:e,onMount:n},o,r,i){const s={latestValues:te(o,r,i,t),renderState:e()};return n&&(s.mount=t=>n(o,t,s)),s}(t,n,r,i);return o?s():A(s)};function te(t,e,n,o){const r={},i=o(t);for(const t in i)r[t]=Jt(i[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 d=c?a:s;if(d&&"boolean"!=typeof d&&!m(d)){(Array.isArray(d)?d:[d]).forEach(e=>{const n=Zt(t,e);if(!n)return;const{transitionEnd:o,transition:i,...s}=n;for(const t in s){let e=s[t];if(Array.isArray(e)){e=e[c?e.length-1:0]}null!==e&&(r[t]=e)}for(const t in o)r[t]=o[t]})}return r}const ee={useVisualState:Qt({scrapeMotionValuesFromProps:qt,createRenderState:zt,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}}Ut(n,o,{enableHardwareAcceleration:!1},t.transformTemplate),Xt(e,n)}})},ne={useVisualState:Qt({scrapeMotionValuesFromProps:Gt,createRenderState:Ct})};function oe(t,{forwardMotionProps:e=!1},n,o,r){return{...D(t)?ee:ne,preloadedFeatures:n,useRender:Wt(e),createVisualElement:o,projectionNodeConstructor:r,Component:t}}var re;function ie(t,e,n,o={passive:!0}){return t.addEventListener(e,n,o),()=>t.removeEventListener(e,n)}function se(t,n,o,r){e.useEffect(()=>{const e=t.current;if(o&&e)return ie(e,n,o,r)},[t,n,o,r])}function ae(t){return"undefined"!=typeof PointerEvent&&t instanceof PointerEvent?!("mouse"!==t.pointerType):t instanceof MouseEvent}function le(t){return!!t.touches}t.AnimationType=void 0,(re=t.AnimationType||(t.AnimationType={})).Animate="animate",re.Hover="whileHover",re.Tap="whileTap",re.Drag="whileDrag",re.Focus="whileFocus",re.InView="whileInView",re.Exit="exit";const ue={pageX:0,pageY:0};function ce(t,e="page"){const n=t.touches[0]||t.changedTouches[0]||ue;return{x:n[e+"X"],y:n[e+"Y"]}}function de(t,e="page"){return{x:t[e+"X"],y:t[e+"Y"]}}function he(t,e="page"){return{point:le(t)?ce(t,e):de(t,e)}}const fe=(t,e=!1)=>{const n=e=>t(e,he(e));return e?(o=n,t=>{const e=t instanceof MouseEvent;(!e||e&&0===t.button)&&o(t)}):n;var o},pe={pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointercancel:"mousecancel",pointerover:"mouseover",pointerout:"mouseout",pointerenter:"mouseenter",pointerleave:"mouseleave"},me={pointerdown:"touchstart",pointermove:"touchmove",pointerup:"touchend",pointercancel:"touchcancel"};function ge(t){return c&&null===window.onpointerdown?t:c&&null===window.ontouchstart?me[t]:c&&null===window.onmousedown?pe[t]:t}function ve(t,e,n,o){return ie(t,ge(e),fe(n,"pointerdown"===e),o)}function ye(t,e,n,o){return se(t,ge(e),n&&fe(n,"pointerdown"===e),o)}function xe(t){let e=null;return()=>{const n=()=>{e=null};return null===e&&(e=t,n)}}const be=xe("dragHorizontal"),we=xe("dragVertical");function Ee(t){let e=!1;if("y"===t)e=we();else if("x"===t)e=be();else{const t=be(),n=we();t&&n?e=()=>{t(),n()}:(t&&t(),n&&n())}return e}function Se(){const t=Ee(!0);return!t||(t(),!1)}function Ae(e,n,o){return(r,i)=>{ae(r)&&!Se()&&(e.animationState&&e.animationState.setActive(t.AnimationType.Hover,n),o&&o(r,i))}}const Pe=(t,e)=>!!e&&(t===e||Pe(t,e.parentElement));function Te(t){return e.useEffect(()=>()=>t(),[])}function Ce(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 r=0;for(o=Object.getOwnPropertySymbols(t);r<o.length;r++)e.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(t,o[r])&&(n[o[r]]=t[o[r]])}return n}const Ve=(t,e,n)=>Math.min(Math.max(n,t),e);function Me({duration:t=800,bounce:e=.25,velocity:n=0,mass:o=1}){let r,i,s=1-e;s=Ve(.05,1,s),t=Ve(.01,10,t/1e3),s<1?(r=e=>{const o=e*s,r=o*t;return.001-(o-n)/Re(e,s)*Math.exp(-r)},i=e=>{const o=e*s*t,i=o*n+n,a=Math.pow(s,2)*Math.pow(e,2)*t,l=Math.exp(-o),u=Re(Math.pow(e,2),s);return(.001-r(e)>0?-1:1)*((i-a)*l)/u}):(r=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,i=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}(r,i,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 Re(t,e){return t*Math.sqrt(1-e*e)}const Le=["duration","bounce"],Oe=["stiffness","damping","mass"];function ke(t,e){return e.some(e=>void 0!==t[e])}function De(t){var{from:e=0,to:n=1,restSpeed:o=2,restDelta:r}=t,i=Ce(t,["from","to","restSpeed","restDelta"]);const s={done:!1,value:e};let{stiffness:a,damping:l,mass:u,velocity:c,duration:d,isResolvedFromDuration:h}=function(t){let e=Object.assign({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},t);if(!ke(t,Oe)&&ke(t,Le)){const n=Me(t);e=Object.assign(Object.assign(Object.assign({},e),n),{velocity:0,mass:1}),e.isResolvedFromDuration=!0}return e}(i),f=je,p=je;function m(){const t=c?-c/1e3:0,o=n-e,i=l/(2*Math.sqrt(a*u)),s=Math.sqrt(a/u)/1e3;if(void 0===r&&(r=Math.min(Math.abs(n-e)/100,.4)),i<1){const e=Re(s,i);f=r=>{const a=Math.exp(-i*s*r);return n-a*((t+i*s*o)/e*Math.sin(e*r)+o*Math.cos(e*r))},p=n=>{const r=Math.exp(-i*s*n);return i*s*r*(Math.sin(e*n)*(t+i*s*o)/e+o*Math.cos(e*n))-r*(Math.cos(e*n)*(t+i*s*o)-e*o*Math.sin(e*n))}}else if(1===i)f=e=>n-Math.exp(-s*e)*(o+(t+s*o)*e);else{const e=s*Math.sqrt(i*i-1);f=r=>{const a=Math.exp(-i*s*r),l=Math.min(e*r,300);return n-a*((t+i*s*o)*Math.sinh(l)+e*o*Math.cosh(l))/e}}}return m(),{next:t=>{const e=f(t);if(h)s.done=t>=d;else{const i=1e3*p(t),a=Math.abs(i)<=o,l=Math.abs(n-e)<=r;s.done=a&&l}return s.value=s.done?n:e,s},flipTarget:()=>{c=-c,[e,n]=[n,e],m()}}}De.needsInterpolation=(t,e)=>"string"==typeof t||"string"==typeof e;const je=t=>0,Fe=(t,e,n)=>{const o=e-t;return 0===o?1:(n-t)/o},Ie=(t,e,n)=>-n*t+n*e+t;function Be(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 Ue({hue:t,saturation:e,lightness:n,alpha:o}){t/=360,n/=100;let r=0,i=0,s=0;if(e/=100){const o=n<.5?n*(1+e):n+e-n*e,a=2*n-o;r=Be(a,o,t+1/3),i=Be(a,o,t),s=Be(a,o,t-1/3)}else r=i=s=n;return{red:Math.round(255*r),green:Math.round(255*i),blue:Math.round(255*s),alpha:o}}const ze=(t,e,n)=>{const o=t*t,r=e*e;return Math.sqrt(Math.max(0,n*(r-o)+o))},Ne=[ft,ht,ut],We=t=>Ne.find(e=>e.test(t)),He=(t,e)=>{let n=We(t),o=We(e),r=n.parse(t),i=o.parse(e);n===ut&&(r=Ue(r),n=ht),o===ut&&(i=Ue(i),o=ht);const s=Object.assign({},r);return t=>{for(const e in s)"alpha"!==e&&(s[e]=ze(r[e],i[e],t));return s.alpha=Ie(r.alpha,i.alpha,t),n.transform(s)}},$e=t=>"number"==typeof t,Ye=(t,e)=>n=>e(t(n)),Xe=(...t)=>t.reduce(Ye);function Ge(t,e){return $e(t)?n=>Ie(t,e,n):pt.test(t)?He(t,e):_e(t,e)}const qe=(t,e)=>{const n=[...t],o=n.length,r=t.map((t,n)=>Ge(t,e[n]));return t=>{for(let e=0;e<o;e++)n[e]=r[e](t);return n}},Ze=(t,e)=>{const n=Object.assign(Object.assign({},t),e),o={};for(const r in n)void 0!==t[r]&&void 0!==e[r]&&(o[r]=Ge(t[r],e[r]));return t=>{for(const e in o)n[e]=o[e](t);return n}};function Ke(t){const e=xt.parse(t),n=e.length;let o=0,r=0,i=0;for(let t=0;t<n;t++)o||"number"==typeof e[t]?o++:void 0!==e[t].hue?i++:r++;return{parsed:e,numNumbers:o,numRGB:r,numHSL:i}}const _e=(t,e)=>{const n=xt.createTransformer(e),o=Ke(t),r=Ke(e);return o.numHSL===r.numHSL&&o.numRGB===r.numRGB&&o.numNumbers>=r.numNumbers?Xe(qe(o.parsed,r.parsed),n):n=>""+(n>0?e:t)},Je=(t,e)=>n=>Ie(t,e,n);function Qe(t,e,n){const o=[],r=n||("number"==typeof(i=t[0])?Je:"string"==typeof i?pt.test(i)?He:_e:Array.isArray(i)?qe:"object"==typeof i?Ze:void 0);var i;const s=t.length-1;for(let n=0;n<s;n++){let i=r(t[n],t[n+1]);if(e){const t=Array.isArray(e)?e[n]:e;i=Xe(t,i)}o.push(i)}return o}function tn(t,e,{clamp:n=!0,ease:o,mixer:r}={}){const i=t.length;e.length,!o||!Array.isArray(o)||o.length,t[0]>t[i-1]&&(t=[].concat(t),e=[].concat(e),t.reverse(),e.reverse());const s=Qe(e,o,r),a=2===i?function([t,e],[n]){return o=>n(Fe(t,e,o))}(t,s):function(t,e){const n=t.length,o=n-1;return r=>{let i=0,s=!1;if(r<=t[0]?s=!0:r>=t[o]&&(i=o-1,s=!0),!s){let e=1;for(;e<n&&!(t[e]>r||e===o);e++);i=e-1}const a=Fe(t[i],t[i+1],r);return e[i](a)}}(t,s);return n?e=>a(Ve(t[0],t[i-1],e)):a}const en=t=>e=>1-t(1-e),nn=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,on=t=>e=>e*e*((t+1)*e-t),rn=t=>t,sn=(an=2,t=>Math.pow(t,an));var an;const ln=en(sn),un=nn(sn),cn=t=>1-Math.sin(Math.acos(t)),dn=en(cn),hn=nn(dn),fn=on(1.525),pn=en(fn),mn=nn(fn),gn=(t=>{const e=on(t);return t=>(t*=2)<1?.5*e(t):.5*(2-Math.pow(2,-10*(t-1)))})(1.525),vn=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},yn=en(vn);function xn(t,e){return t.map(()=>e||un).splice(0,t.length-1)}function bn({from:t=0,to:e=1,ease:n,offset:o,duration:r=300}){const i={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),r);function l(){return tn(a,s,{ease:Array.isArray(n)?n:xn(s,n)})}let u=l();return{next:t=>(i.value=u(t),i.done=t>=r,i),flipTarget:()=>{s.reverse(),u=l()}}}const wn={keyframes:bn,spring:De,decay:function({velocity:t=0,from:e=0,power:n=.8,timeConstant:o=350,restDelta:r=.5,modifyTarget:i}){const s={done:!1,value:e};let a=n*t;const l=e+a,u=void 0===i?l:i(l);return u!==l&&(a=u-e),{next:t=>{const e=-a*Math.exp(-t/o);return s.done=!(e>r||e<-r),s.value=s.done?u:u+e,s},flipTarget:()=>{}}}};const En="undefined"!=typeof performance?()=>performance.now():()=>Date.now(),Sn="undefined"!=typeof window?t=>window.requestAnimationFrame(t):t=>setTimeout(()=>t(En()),1/60*1e3);let An=!0,Pn=!1,Tn=!1;const Cn={delta:0,timestamp:0},Vn=["read","update","preRender","render","postRender"],Mn=Vn.reduce((t,e)=>(t[e]=function(t){let e=[],n=[],o=0,r=!1,i=!1;const s=new WeakSet,a={schedule:(t,i=!1,a=!1)=>{const l=a&&r,u=l?e:n;return i&&s.add(t),-1===u.indexOf(t)&&(u.push(t),l&&r&&(o=e.length)),t},cancel:t=>{const e=n.indexOf(t);-1!==e&&n.splice(e,1),s.delete(t)},process:l=>{if(r)i=!0;else{if(r=!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())}r=!1,i&&(i=!1,a.process(l))}}};return a}(()=>Pn=!0),t),{}),Rn=Vn.reduce((t,e)=>{const n=Mn[e];return t[e]=(t,e=!1,o=!1)=>(Pn||jn(),n.schedule(t,e,o)),t},{}),Ln=Vn.reduce((t,e)=>(t[e]=Mn[e].cancel,t),{}),On=Vn.reduce((t,e)=>(t[e]=()=>Mn[e].process(Cn),t),{}),kn=t=>Mn[t].process(Cn),Dn=t=>{Pn=!1,Cn.delta=An?1/60*1e3:Math.max(Math.min(t-Cn.timestamp,40),1),Cn.timestamp=t,Tn=!0,Vn.forEach(kn),Tn=!1,Pn&&(An=!1,Sn(Dn))},jn=()=>{Pn=!0,An=!0,Tn||Sn(Dn)},Fn=()=>Cn;function In(t,e,n=0){return t-e-n}const Bn=t=>{const e=({delta:e})=>t(e);return{start:()=>Rn.update(e,!0),stop:()=>Ln.update(e)}};function Un(t){var e,n,{from:o,autoplay:r=!0,driver:i=Bn,elapsed:s=0,repeat:a=0,repeatType:l="loop",repeatDelay:u=0,onPlay:c,onStop:d,onComplete:h,onRepeat:f,onUpdate:p}=t,m=Ce(t,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]);let g,v,y,{to:x}=m,b=0,w=m.duration,E=!1,S=!0;const A=function(t){if(Array.isArray(t.to))return bn;if(wn[t.type])return wn[t.type];const e=new Set(Object.keys(t));return e.has("ease")||e.has("duration")&&!e.has("dampingRatio")?bn:e.has("dampingRatio")||e.has("stiffness")||e.has("mass")||e.has("damping")||e.has("restSpeed")||e.has("restDelta")?De:bn}(m);(null===(n=(e=A).needsInterpolation)||void 0===n?void 0:n.call(e,o,x))&&(y=tn([0,100],[o,x],{clamp:!1}),o=0,x=100);const P=A(Object.assign(Object.assign({},m),{from:o,to:x}));function T(){b++,"reverse"===l?(S=b%2==0,s=function(t,e,n=0,o=!0){return o?In(e+-t,e,n):e-(t-e)+n}(s,w,u,S)):(s=In(s,w,u),"mirror"===l&&P.flipTarget()),E=!1,f&&f()}function C(t){if(S||(t=-t),s+=t,!E){const t=P.next(Math.max(0,s));v=t.value,y&&(v=y(v)),E=S?t.done:s<=0}null==p||p(v),E&&(0===b&&(null!=w||(w=s)),b<a?function(t,e,n,o){return o?t>=e+n:t<=-n}(s,w,u,S)&&T():(g.stop(),h&&h()))}return r&&(null==c||c(),g=i(C),g.start()),{stop:()=>{null==d||d(),g.stop()}}}function zn(t,e){return e?t*(1e3/e):0}const Nn=t=>t.hasOwnProperty("x")&&t.hasOwnProperty("y"),Wn=t=>Nn(t)&&t.hasOwnProperty("z"),Hn=(t,e)=>Math.abs(t-e);function $n(t,e){if($e(t)&&$e(e))return Hn(t,e);if(Nn(t)&&Nn(e)){const n=Hn(t.x,e.x),o=Hn(t.y,e.y),r=Wn(t)&&Wn(e)?Hn(t.z,e.z):0;return Math.sqrt(Math.pow(n,2)+Math.pow(o,2)+Math.pow(r,2))}}const Yn=(t,e)=>1-3*e+3*t,Xn=(t,e)=>3*e-6*t,Gn=t=>3*t,qn=(t,e,n)=>((Yn(e,n)*t+Xn(e,n))*t+Gn(e))*t,Zn=(t,e,n)=>3*Yn(e,n)*t*t+2*Xn(e,n)*t+Gn(e);function Kn(t,e,n,o){if(t===e&&n===o)return rn;const r=new Float32Array(11);for(let e=0;e<11;++e)r[e]=qn(.1*e,t,n);function i(e){let o=0,i=1;for(;10!==i&&r[i]<=e;++i)o+=.1;--i;const s=o+.1*((e-r[i])/(r[i+1]-r[i])),a=Zn(s,t,n);return a>=.001?function(t,e,n,o){for(let r=0;r<8;++r){const r=Zn(e,n,o);if(0===r)return e;e-=(qn(e,n,o)-t)/r}return e}(e,s,t,n):0===a?s:function(t,e,n,o,r){let i,s,a=0;do{s=e+(n-e)/2,i=qn(s,o,r)-t,i>0?n=s:e=s}while(Math.abs(i)>1e-7&&++a<10);return s}(e,o,o+.1,t,n)}return t=>0===t||1===t?t:qn(i(t),e,o)}const _n=("undefined"==typeof process||process.env,"production"),Jn=new Set;function Qn(t,e,n){t||Jn.has(e)||(console.warn(e),n&&console.warn(n),Jn.add(e))}const to=new WeakMap,eo=new WeakMap,no=t=>{const e=to.get(t.target);e&&e(t)},oo=t=>{t.forEach(no)};function ro(t,e,n){const o=function({root:t,...e}){const n=t||document;eo.has(n)||eo.set(n,{});const o=eo.get(n),r=JSON.stringify(e);return o[r]||(o[r]=new IntersectionObserver(oo,{root:t,...e})),o[r]}(e);return to.set(t,n),o.observe(t),()=>{to.delete(t),o.unobserve(t)}}const io={some:0,all:1};function so(n,o,r,{root:i,margin:s,amount:a="some",once:l}){e.useEffect(()=>{if(!n)return;const e={root:null==i?void 0:i.current,rootMargin:s,threshold:"number"==typeof a?a:io[a]};return ro(r.getInstance(),e,e=>{const{isIntersecting:n}=e;if(o.isInView===n)return;if(o.isInView=n,l&&!n&&o.hasEnteredView)return;n&&(o.hasEnteredView=!0),r.animationState&&r.animationState.setActive(t.AnimationType.InView,n);const i=r.getProps(),s=n?i.onViewportEnter:i.onViewportLeave;s&&s(e)})},[n,i,s,a])}function ao(n,o,r,{fallback:i=!0}){e.useEffect(()=>{n&&i&&("production"!==_n&&Qn(!1,"IntersectionObserver not available on this device. whileInView animations will trigger on mount."),requestAnimationFrame(()=>{o.hasEnteredView=!0;const{onViewportEnter:e}=r.getProps();e&&e(null),r.animationState&&r.animationState.setActive(t.AnimationType.InView,!0)}))},[n])}const lo=t=>e=>(t(e),null),uo={inView:lo((function({visualElement:t,whileInView:n,onViewportEnter:o,onViewportLeave:r,viewport:i={}}){const s=e.useRef({hasEnteredView:!1,isInView:!1});let a=Boolean(n||o||r);i.once&&s.current.hasEnteredView&&(a=!1),("undefined"==typeof IntersectionObserver?ao:so)(a,s.current,t,i)})),tap:lo((function({onTap:n,onTapStart:o,onTapCancel:r,whileTap:i,visualElement:s}){const a=n||o||r||i,l=e.useRef(!1),u=e.useRef(null),c={passive:!(o||n||r||m)};function d(){u.current&&u.current(),u.current=null}function h(){return d(),l.current=!1,s.animationState&&s.animationState.setActive(t.AnimationType.Tap,!1),!Se()}function f(t,e){h()&&(Pe(s.getInstance(),t.target)?n&&n(t,e):r&&r(t,e))}function p(t,e){h()&&r&&r(t,e)}function m(e,n){d(),l.current||(l.current=!0,u.current=Xe(ve(window,"pointerup",f,c),ve(window,"pointercancel",p,c)),s.animationState&&s.animationState.setActive(t.AnimationType.Tap,!0),o&&o(e,n))}ye(s,"pointerdown",a?m:void 0,c),Te(d)})),focus:lo((function({whileFocus:e,visualElement:n}){const{animationState:o}=n;se(n,"focus",e?()=>{o&&o.setActive(t.AnimationType.Focus,!0)}:void 0),se(n,"blur",e?()=>{o&&o.setActive(t.AnimationType.Focus,!1)}:void 0)})),hover:lo((function({onHoverStart:t,onHoverEnd:e,whileHover:n,visualElement:o}){ye(o,"pointerenter",t||n?Ae(o,!0,t):void 0,{passive:!t}),ye(o,"pointerleave",e||n?Ae(o,!1,e):void 0,{passive:!e})}))};function co(){const t=e.useContext(u);if(null===t)return[!0,null];const{isPresent:n,onExitComplete:o,register:r}=t,i=e.useId();e.useEffect(()=>r(i),[]);return!n&&o?[!1,()=>o&&o(i)]:[!0]}function ho(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 fo=t=>1e3*t,po={linear:rn,easeIn:sn,easeInOut:un,easeOut:ln,circIn:cn,circInOut:hn,circOut:dn,backIn:fn,backInOut:mn,backOut:pn,anticipate:gn,bounceIn:yn,bounceInOut:t=>t<.5?.5*(1-vn(1-2*t)):.5*vn(2*t-1)+.5,bounceOut:vn},mo=t=>{if(Array.isArray(t)){t.length;const[e,n,o,r]=t;return Kn(e,n,o,r)}return"string"==typeof t?po[t]:t},go=(t,e)=>"zIndex"!==t&&(!("number"!=typeof e&&!Array.isArray(e))||!("string"!=typeof e||!xt.test(e)||e.startsWith("url("))),vo=()=>({type:"spring",stiffness:500,damping:25,restSpeed:10}),yo=t=>({type:"spring",stiffness:550,damping:0===t?2*Math.sqrt(550):30,restSpeed:10}),xo=()=>({type:"keyframes",ease:"linear",duration:.3}),bo=t=>({type:"keyframes",duration:.8,values:t}),wo={x:vo,y:vo,z:vo,rotate:vo,rotateX:vo,rotateY:vo,rotateZ:vo,scaleX:yo,scaleY:yo,scale:yo,opacity:xo,backgroundColor:xo,color:xo,default:yo},Eo=(t,e)=>{let n;return n=Kt(e)?bo:wo[t]||wo.default,{to:e,...n(e)}},So={...Pt,color:pt,backgroundColor:pt,outlineColor:pt,fill:pt,stroke:pt,borderColor:pt,borderTopColor:pt,borderRightColor:pt,borderBottomColor:pt,borderLeftColor:pt,filter:St,WebkitFilter:St},Ao=t=>So[t];function Po(t,e){var n;let o=Ao(t);return o!==St&&(o=xt),null===(n=o.getAnimatableNone)||void 0===n?void 0:n.call(o,e)}const To={current:!1};function Co({ease:t,times:e,yoyo:n,flip:o,loop:r,...i}){const s={...i};return e&&(s.offset=e),i.duration&&(s.duration=fo(i.duration)),i.repeatDelay&&(s.repeatDelay=fo(i.repeatDelay)),t&&(s.ease=(t=>Array.isArray(t)&&"number"!=typeof t[0])(t)?t.map(mo):mo(t)),"tween"===i.type&&(s.type="keyframes"),(n||r||o)&&(n?s.repeatType="reverse":r?s.repeatType="loop":o&&(s.repeatType="mirror"),s.repeat=r||n||o||i.repeat),"spring"!==i.type&&(s.type="keyframes"),s}function Vo(t,e,n){return Array.isArray(e.to)&&void 0===t.duration&&(t.duration=.8),function(t){Array.isArray(t.to)&&null===t.to[0]&&(t.to=[...t.to],t.to[0]=t.from)}(e),function({when:t,delay:e,delayChildren:n,staggerChildren:o,staggerDirection:r,repeat:i,repeatType:s,repeatDelay:a,from:l,...u}){return!!Object.keys(u).length}(t)||(t={...t,...Eo(n,e.to)}),{...e,...Co(t)}}function Mo(t,e,n,o,r){const i=Oo(o,t)||{};let s=void 0!==i.from?i.from:e.get();const a=go(t,n);"none"===s&&a&&"string"==typeof n?s=Po(t,n):Ro(s)&&"string"==typeof n?s=Lo(n):!Array.isArray(n)&&Ro(n)&&"string"==typeof s&&(n=Lo(s));return go(t,s)&&a&&!1!==i.type?function(){const o={from:s,to:n,velocity:e.getVelocity(),onComplete:r,onUpdate:t=>e.set(t)};return"inertia"===i.type||"decay"===i.type?function({from:t=0,velocity:e=0,min:n,max:o,power:r=.8,timeConstant:i=750,bounceStiffness:s=500,bounceDamping:a=10,restDelta:l=1,modifyTarget:u,driver:c,onUpdate:d,onComplete:h,onStop:f}){let p;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==p||p.stop(),p=Un(Object.assign(Object.assign({},t),{driver:c,onUpdate:e=>{var n;null==d||d(e),null===(n=t.onUpdate)||void 0===n||n.call(t,e)},onComplete:h,onStop:f}))}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=r*e+t;void 0!==u&&(o=u(o));const s=g(o),a=s===n?-1:1;let c,d;const h=t=>{c=d,d=t,e=zn(t-c,Fn().delta),(1===a&&t>s||-1===a&&t<s)&&y({from:t,to:s,velocity:e})};v({type:"decay",from:t,velocity:e,timeConstant:i,power:r,restDelta:l,modifyTarget:u,onUpdate:m(o)?h:void 0})}return{stop:()=>null==p?void 0:p.stop()}}({...o,...i}):Un({...Vo(i,o,t),onUpdate:t=>{o.onUpdate(t),i.onUpdate&&i.onUpdate(t)},onComplete:()=>{o.onComplete(),i.onComplete&&i.onComplete()}})}:function(){const t=_t(n);return e.set(t),r(),i.onUpdate&&i.onUpdate(t),i.onComplete&&i.onComplete(),{stop:()=>{}}}}function Ro(t){return 0===t||"string"==typeof t&&0===parseFloat(t)&&-1===t.indexOf(" ")}function Lo(t){return"number"==typeof t?0:Po("",t)}function Oo(t,e){return t[e]||t.default||t}function ko(t,e,n,o={}){return To.current&&(o={type:!1}),e.start(r=>{let i,s;const a=Mo(t,e,n,o,r),l=function(t,e){var n,o;return null!==(o=null!==(n=(Oo(t,e)||{}).delay)&&void 0!==n?n:t.delay)&&void 0!==o?o:0}(o,t),u=()=>s=a();return l?i=window.setTimeout(u,fo(l)):u(),()=>{clearTimeout(i),s&&s.stop()}})}const Do=t=>/^0[^.\s]+$/.test(t);function jo(t,e){-1===t.indexOf(e)&&t.push(e)}function Fo(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class Io{constructor(){this.subscriptions=[]}add(t){return jo(this.subscriptions,t),()=>Fo(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 r=0;r<o;r++){const o=this.subscriptions[r];o&&o(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}class Bo{constructor(t){var e;this.version="7.2.1",this.timeDelta=0,this.lastUpdated=0,this.updateSubscribers=new Io,this.velocityUpdateSubscribers=new Io,this.renderSubscribers=new Io,this.canTrackVelocity=!1,this.updateAndNotify=(t,e=!0)=>{this.prev=this.current,this.current=t;const{delta:n,timestamp:o}=Fn();this.lastUpdated!==o&&(this.timeDelta=n,this.lastUpdated=o,Rn.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=()=>Rn.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?zn(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 Uo(t){return new Bo(t)}const zo=t=>e=>e.test(t),No=[_,ot,nt,et,it,rt,{test:t=>"auto"===t,parse:t=>t}],Wo=t=>No.find(zo(t)),Ho=[...No,pt,xt],$o=t=>Ho.find(zo(t));function Yo(t,e,n){const o=t.getProps();return Zt(o,e,void 0!==n?n:o.custom,function(t){const e={};return t.forEachValue((t,n)=>e[n]=t.get()),e}(t),function(t){const e={};return t.forEachValue((t,n)=>e[n]=t.getVelocity()),e}(t))}function Xo(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Uo(n))}function Go(t,e){const n=Yo(t,e);let{transitionEnd:o={},transition:r={},...i}=n?t.makeTargetAnimatable(n,!1):{};i={...i,...o};for(const e in i){Xo(t,e,_t(i[e]))}}function qo(t,e){[...e].reverse().forEach(n=>{var o;const r=t.getVariant(n);r&&Go(t,r),null===(o=t.variantChildren)||void 0===o||o.forEach(t=>{qo(t,e)})})}function Zo(t,e,n){var o,r;const i=Object.keys(e).filter(e=>!t.hasValue(e)),s=i.length;if(s)for(let a=0;a<s;a++){const s=i[a],l=e[s];let u=null;Array.isArray(l)&&(u=l[0]),null===u&&(u=null!==(r=null!==(o=n[s])&&void 0!==o?o:t.readValue(s))&&void 0!==r?r:e[s]),null!=u&&("string"==typeof u&&(/^\-?\d*\.?\d+$/.test(u)||Do(u))?u=parseFloat(u):!$o(u)&&xt.test(l)&&(u=Po(s,l)),t.addValue(s,Uo(u)),void 0===n[s]&&(n[s]=u),t.setBaseTarget(s,u))}}function Ko(t,e){if(!e)return;return(e[t]||e.default||e).from}function _o(t,e,n){var o;const r={};for(const i in t){const t=Ko(i,e);r[i]=void 0!==t?t:null===(o=n.getValue(i))||void 0===o?void 0:o.get()}return r}function Jo(t){return Boolean(z(t)&&t.add)}function Qo(t,e,n={}){let o;if(t.notifyAnimationStart(e),Array.isArray(e)){const r=e.map(e=>tr(t,e,n));o=Promise.all(r)}else if("string"==typeof e)o=tr(t,e,n);else{const r="function"==typeof e?Yo(t,e,n.custom):e;o=er(t,r,n)}return o.then(()=>t.notifyAnimationComplete(e))}function tr(t,e,n={}){var o;const r=Yo(t,e,n.custom);let{transition:i=t.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);const s=r?()=>er(t,r,n):()=>Promise.resolve(),a=(null===(o=t.variantChildren)||void 0===o?void 0:o.size)?(o=0)=>{const{delayChildren:r=0,staggerChildren:s,staggerDirection:a}=i;return function(t,e,n=0,o=0,r=1,i){const s=[],a=(t.variantChildren.size-1)*o,l=1===r?(t=0)=>t*o:(t=0)=>a-t*o;return Array.from(t.variantChildren).sort(nr).forEach((t,o)=>{s.push(tr(t,e,{...i,delay:n+l(o)}).then(()=>t.notifyAnimationComplete(e)))}),Promise.all(s)}(t,e,r+o,s,a,n)}:()=>Promise.resolve(),{when:l}=i;if(l){const[t,e]="beforeChildren"===l?[s,a]:[a,s];return t().then(e)}return Promise.all([s(),a(n.delay)])}function er(t,e,{delay:n=0,transitionOverride:o,type:r}={}){var i;let{transition:s=t.getDefaultTransition(),transitionEnd:a,...l}=t.makeTargetAnimatable(e);const u=t.getValue("willChange");o&&(s=o);const c=[],d=r&&(null===(i=t.animationState)||void 0===i?void 0:i.getState()[r]);for(const e in l){const o=t.getValue(e),r=l[e];if(!o||void 0===r||d&&or(d,e))continue;let i={delay:n,...s};t.shouldReduceMotion&&B.has(e)&&(i={...i,type:!1,delay:0});let a=ko(e,o,r,i);Jo(u)&&(u.add(e),a=a.then(()=>u.remove(e))),c.push(a)}return Promise.all(c).then(()=>{a&&Go(t,a)})}function nr(t,e){return t.sortNodePosition(e)}function or({protectedKeys:t,needsAnimating:e},n){const o=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,o}const rr=[t.AnimationType.Animate,t.AnimationType.InView,t.AnimationType.Focus,t.AnimationType.Hover,t.AnimationType.Tap,t.AnimationType.Drag,t.AnimationType.Exit],ir=[...rr].reverse(),sr=rr.length;function ar(e){let n=function(t){return e=>Promise.all(e.map(({animation:e,options:n})=>Qo(t,e,n)))}(e);const o={[t.AnimationType.Animate]:ur(!0),[t.AnimationType.InView]:ur(),[t.AnimationType.Hover]:ur(),[t.AnimationType.Tap]:ur(),[t.AnimationType.Drag]:ur(),[t.AnimationType.Focus]:ur(),[t.AnimationType.Exit]:ur()};let r=!0;const i=(t,n)=>{const o=Yo(e,n);if(o){const{transition:e,transitionEnd:n,...r}=o;t={...t,...r,...n}}return t};function s(t,s){var a;const l=e.getProps(),u=e.getVariantContext(!0)||{},c=[],d=new Set;let h={},f=1/0;for(let n=0;n<sr;n++){const g=ir[n],v=o[g],y=null!==(a=l[g])&&void 0!==a?a:u[g],x=p(y),b=g===s?v.isActive:null;!1===b&&(f=n);let w=y===u[g]&&y!==l[g]&&x;if(w&&r&&e.manuallyAnimateOnMount&&(w=!1),v.protectedKeys={...h},!v.isActive&&null===b||!y&&!v.prevProp||m(y)||"boolean"==typeof y)continue;const E=lr(v.prevProp,y);let S=E||g===s&&v.isActive&&!w&&x||n>f&&x;const A=Array.isArray(y)?y:[y];let P=A.reduce(i,{});!1===b&&(P={});const{prevResolvedValues:T={}}=v,C={...T,...P},V=t=>{S=!0,d.delete(t),v.needsAnimating[t]=!0};for(const t in C){const e=P[t],n=T[t];h.hasOwnProperty(t)||(e!==n?Kt(e)&&Kt(n)?!ho(e,n)||E?V(t):v.protectedKeys[t]=!0:void 0!==e?V(t):d.add(t):void 0!==e&&d.has(t)?V(t):v.protectedKeys[t]=!0)}v.prevProp=y,v.prevResolvedValues=P,v.isActive&&(h={...h,...P}),r&&e.blockInitialAnimation&&(S=!1),S&&!w&&c.push(...A.map(e=>({animation:e,options:{type:g,...t}})))}if(d.size){const t={};d.forEach(n=>{const o=e.getBaseTarget(n);void 0!==o&&(t[n]=o)}),c.push({animation:t})}let g=Boolean(c.length);return r&&!1===l.initial&&!e.manuallyAnimateOnMount&&(g=!1),r=!1,g?n(c):Promise.resolve()}return{animateChanges:s,setActive:function(t,n,r){var i;if(o[t].isActive===n)return Promise.resolve();null===(i=e.variantChildren)||void 0===i||i.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(r,t);for(const t in o)o[t].protectedKeys={};return a},setAnimateFunction:function(t){n=t(e)},getState:()=>o}}function lr(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!ho(e,t)}function ur(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}const cr={animation:lo(({visualElement:t,animate:n})=>{t.animationState||(t.animationState=ar(t)),m(n)&&e.useEffect(()=>n.subscribe(t),[n])}),exit:lo(n=>{const{custom:o,visualElement:r}=n,[i,s]=co(),a=e.useContext(u);e.useEffect(()=>{r.isPresent=i;const e=r.animationState&&r.animationState.setActive(t.AnimationType.Exit,!i,{custom:a&&a.custom||o});e&&!i&&e.then(s)},[i])})};class dr{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=pr(this.lastMoveEventInfo,this.history),e=null!==this.startEvent,n=$n(t.offset,{x:0,y:0})>=3;if(!e&&!n)return;const{point:o}=t,{timestamp:r}=Fn();this.history.push({...o,timestamp:r});const{onStart:i,onMove:s}=this.handlers;e||(i&&i(this.lastMoveEvent,t),this.startEvent=this.lastMoveEvent),s&&s(this.lastMoveEvent,t)},this.handlePointerMove=(t,e)=>{this.lastMoveEvent=t,this.lastMoveEventInfo=hr(e,this.transformPagePoint),ae(t)&&0===t.buttons?this.handlePointerUp(t,e):Rn.update(this.updatePoint,!0)},this.handlePointerUp=(t,e)=>{this.end();const{onEnd:n,onSessionEnd:o}=this.handlers,r=pr(hr(e,this.transformPagePoint),this.history);this.startEvent&&n&&n(t,r),o&&o(t,r)},le(t)&&t.touches.length>1)return;this.handlers=e,this.transformPagePoint=n;const o=hr(he(t),this.transformPagePoint),{point:r}=o,{timestamp:i}=Fn();this.history=[{...r,timestamp:i}];const{onSessionStart:s}=e;s&&s(t,pr(o,this.history)),this.removeListeners=Xe(ve(window,"pointermove",this.handlePointerMove),ve(window,"pointerup",this.handlePointerUp),ve(window,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Ln.update(this.updatePoint)}}function hr(t,e){return e?{point:e(t.point)}:t}function fr(t,e){return{x:t.x-e.x,y:t.y-e.y}}function pr({point:t},e){return{point:t,delta:fr(t,gr(e)),offset:fr(t,mr(e)),velocity:vr(e,.1)}}function mr(t){return t[0]}function gr(t){return t[t.length-1]}function vr(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,o=null;const r=gr(t);for(;n>=0&&(o=t[n],!(r.timestamp-o.timestamp>fo(e)));)n--;if(!o)return{x:0,y:0};const i=(r.timestamp-o.timestamp)/1e3;if(0===i)return{x:0,y:0};const s={x:(r.x-o.x)/i,y:(r.y-o.y)/i};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}function yr(t){return t.max-t.min}function xr(t,e=0,n=.01){return $n(t,e)<n}function br(t,e,n,o=.5){t.origin=o,t.originPoint=Ie(e.min,e.max,t.origin),t.scale=yr(n)/yr(e),(xr(t.scale,1,1e-4)||isNaN(t.scale))&&(t.scale=1),t.translate=Ie(n.min,n.max,t.origin)-t.originPoint,(xr(t.translate)||isNaN(t.translate))&&(t.translate=0)}function wr(t,e,n,o){br(t.x,e.x,n.x,null==o?void 0:o.originX),br(t.y,e.y,n.y,null==o?void 0:o.originY)}function Er(t,e,n){t.min=n.min+e.min,t.max=t.min+yr(e)}function Sr(t,e,n){t.min=e.min-n.min,t.max=t.min+yr(e)}function Ar(t,e,n){Sr(t.x,e.x,n.x),Sr(t.y,e.y,n.y)}function Pr(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 Tr(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 Cr=.35;function Vr(t,e,n){return{min:Mr(t,e),max:Mr(t,n)}}function Mr(t,e){var n;return"number"==typeof t?t:null!==(n=t[e])&&void 0!==n?n:0}const Rr=()=>({x:{min:0,max:0},y:{min:0,max:0}});function Lr(t){return[t("x"),t("y")]}function Or({top:t,left:e,right:n,bottom:o}){return{x:{min:e,max:n},y:{min:t,max:o}}}function kr(t){return void 0===t||1===t}function Dr({scale:t,scaleX:e,scaleY:n}){return!kr(t)||!kr(e)||!kr(n)}function jr(t){return Dr(t)||Fr(t.x)||Fr(t.y)||t.z||t.rotate||t.rotateX||t.rotateY}function Fr(t){return t&&"0%"!==t}function Ir(t,e,n){return n+e*(t-n)}function Br(t,e,n,o,r){return void 0!==r&&(t=Ir(t,r,o)),Ir(t,n,o)+e}function Ur(t,e=0,n=1,o,r){t.min=Br(t.min,e,n,o,r),t.max=Br(t.max,e,n,o,r)}function zr(t,{x:e,y:n}){Ur(t.x,e.translate,e.scale,e.originPoint),Ur(t.y,n.translate,n.scale,n.originPoint)}function Nr(t,e){t.min=t.min+e,t.max=t.max+e}function Wr(t,e,[n,o,r]){const i=void 0!==e[r]?e[r]:.5,s=Ie(t.min,t.max,i);Ur(t,e[n],e[o],s,e.scale)}const Hr=["x","scaleX","originX"],$r=["y","scaleY","originY"];function Yr(t,e){Wr(t.x,e,Hr),Wr(t.y,e,$r)}function Xr(t,e){return Or(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 Gr=new WeakMap;class qr{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 dr(e,{onSessionStart:t=>{this.stopAnimation(),n&&this.snapToCursor(he(t,"page").point)},onStart:(e,n)=>{var o;const{drag:r,dragPropagation:i,onDragStart:s}=this.getProps();(!r||i||(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=Ee(r),this.openGlobalLock))&&(this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Lr(t=>{var e,n;let o=this.getAxisMotionValue(t).get()||0;if(nt.test(o)){const r=null===(n=null===(e=this.visualElement.projection)||void 0===e?void 0:e.layout)||void 0===n?void 0:n.actual[t];if(r){o=yr(r)*(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:r,onDrag:i}=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==r||r(this.currentDirection)));this.updateAxis("x",e.point,s),this.updateAxis("y",e.point,s),this.visualElement.syncRender(),null==i||i(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:r}=this.getProps();null==r||r(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||!Zr(t,o,this.currentDirection))return;const r=this.getAxisMotionValue(t);let i=this.originPoint[t]+n[t];this.constraints&&this.constraints[t]&&(i=function(t,{min:e,max:n},o){return void 0!==e&&t<e?t=o?Ie(e,t,o.min):Math.max(t,e):void 0!==n&&t>n&&(t=o?Ie(n,t,o.max):Math.min(t,n)),t}(i,this.constraints[t],this.elastic[t])),r.set(i)}resolveConstraints(){const{dragConstraints:t,dragElastic:e}=this.getProps(),{layout:n}=this.visualElement.projection||{},o=this.constraints;t&&f(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!n)&&function(t,{top:e,left:n,bottom:o,right:r}){return{x:Pr(t.x,n,r),y:Pr(t.y,e,o)}}(n.actual,t),this.elastic=function(t=Cr){return!1===t?t=0:!0===t&&(t=Cr),{x:Vr(t,"left","right"),y:Vr(t,"top","bottom")}}(e),o!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&Lr(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.actual[t],this.constraints[t]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:e}=this.getProps();if(!t||!f(t))return!1;const n=t.current,{projection:o}=this.visualElement;if(!o||!o.layout)return!1;const r=function(t,e,n){const o=Xr(t,n),{scroll:r}=e;return r&&(Nr(o.x,r.x),Nr(o.y,r.y)),o}(n,o.root,this.visualElement.getTransformPagePoint());let i=function(t,e){return{x:Tr(t.x,e.x),y:Tr(t.y,e.y)}}(o.layout.actual,r);if(e){const t=e(function({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}(i));this.hasMutatedConstraints=!!t,t&&(i=Or(t))}return i}startAnimation(t){const{drag:e,dragMomentum:n,dragElastic:o,dragTransition:r,dragSnapToOrigin:i,onDragTransitionEnd:s}=this.getProps(),a=this.constraints||{},l=Lr(s=>{var l;if(!Zr(s,e,this.currentDirection))return;let u=null!==(l=null==a?void 0:a[s])&&void 0!==l?l:{};i&&(u={min:0,max:0});const c=o?200:1e6,d=o?40:1e7,h={type:"inertia",velocity:n?t[s]:0,bounceStiffness:c,bounceDamping:d,timeConstant:750,restDelta:1,restSpeed:10,...r,...u};return this.startAxisValueAnimation(s,h)});return Promise.all(l).then(s)}startAxisValueAnimation(t,e){return ko(t,this.getAxisMotionValue(t),0,e)}stopAnimation(){Lr(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){var e,n;const o="_drag"+t.toUpperCase(),r=this.visualElement.getProps()[o];return r||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){Lr(e=>{const{drag:n}=this.getProps();if(!Zr(e,n,this.currentDirection))return;const{projection:o}=this.visualElement,r=this.getAxisMotionValue(e);if(o&&o.layout){const{min:n,max:i}=o.layout.actual[e];r.set(t[e]-Ie(n,i,.5))}})}scalePositionWithinConstraints(){var t;const{drag:e,dragConstraints:n}=this.getProps(),{projection:o}=this.visualElement;if(!f(n)||!o||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};Lr(t=>{const e=this.getAxisMotionValue(t);if(e){const n=e.get();r[t]=function(t,e){let n=.5;const o=yr(t),r=yr(e);return r>o?n=Fe(e.min,e.max-o,t.min):o>r&&(n=Fe(t.min,t.max-r,e.min)),Ve(0,1,n)}({min:n,max:n},this.constraints[t])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.getInstance().style.transform=i?i({},""):"none",null===(t=o.root)||void 0===t||t.updateScroll(),o.updateLayout(),this.resolveConstraints(),Lr(t=>{if(!Zr(t,e,null))return;const n=this.getAxisMotionValue(t),{min:o,max:i}=this.constraints[t];n.set(Ie(o,i,r[t]))})}addListeners(){var t;Gr.set(this.visualElement,this);const e=ve(this.visualElement.getInstance(),"pointerdown",t=>{const{drag:e,dragListener:n=!0}=this.getProps();e&&n&&this.start(t)}),n=()=>{const{dragConstraints:t}=this.getProps();f(t)&&(this.constraints=this.resolveRefConstraints())},{projection:o}=this.visualElement,r=o.addEventListener("measure",n);o&&!o.layout&&(null===(t=o.root)||void 0===t||t.updateScroll(),o.updateLayout()),n();const i=ie(window,"resize",()=>this.scalePositionWithinConstraints()),s=o.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e})=>{this.isDragging&&e&&(Lr(e=>{const n=this.getAxisMotionValue(e);n&&(this.originPoint[e]+=t[e].translate,n.set(n.get()+t[e].translate))}),this.visualElement.syncRender())});return()=>{i(),e(),r(),null==s||s()}}getProps(){const t=this.visualElement.getProps(),{drag:e=!1,dragDirectionLock:n=!1,dragPropagation:o=!1,dragConstraints:r=!1,dragElastic:i=Cr,dragMomentum:s=!0}=t;return{...t,drag:e,dragDirectionLock:n,dragPropagation:o,dragConstraints:r,dragElastic:i,dragMomentum:s}}}function Zr(t,e,n){return!(!0!==e&&e!==t||null!==n&&n!==t)}const Kr={pan:lo((function({onPan:t,onPanStart:n,onPanEnd:o,onPanSessionStart:r,visualElement:i}){const a=t||n||o||r,l=e.useRef(null),{transformPagePoint:u}=e.useContext(s),c={onSessionStart:r,onStart:n,onMove:t,onEnd:(t,e)=>{l.current=null,o&&o(t,e)}};e.useEffect(()=>{null!==l.current&&l.current.updateHandlers(c)}),ye(i,"pointerdown",a&&function(t){l.current=new dr(t,c,{transformPagePoint:u})}),Te(()=>l.current&&l.current.end())})),drag:lo((function(t){const{dragControls:n,visualElement:o}=t,r=A(()=>new qr(o));e.useEffect(()=>n&&n.subscribe(r),[r,n]),e.useEffect(()=>r.addListeners(),[r])}))},_r={current:null},Jr={current:!1};function Qr(){if(Jr.current=!0,c)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>_r.current=t.matches;t.addListener(e),e()}else _r.current=!1}const ti=["LayoutMeasure","BeforeLayoutMeasure","LayoutUpdate","ViewportBoxUpdate","Update","Render","AnimationComplete","LayoutAnimationComplete","AnimationStart","LayoutAnimationStart","SetAxisTarget","Unmount"];const ei=Object.keys(E),ni=ei.length,oi=({treeType:t="",build:n,getBaseTarget:o,makeTargetAnimatable:r,measureViewportBox:i,render:s,readValueFromInstance:a,removeValueFromRenderState:l,sortNodePosition:u,scrapeMotionValuesFromProps:c})=>({parent:d,props:h,presenceId:m,blockInitialAnimation:g,visualState:x,reducedMotionConfig:b},w={})=>{let S=!1;const{latestValues:A,renderState:P}=x;let T;const C=function(){const t=ti.map(()=>new Io),e={},n={clearAllListeners:()=>t.forEach(t=>t.clear()),updatePropListeners:t=>{ti.forEach(o=>{var r;const i="on"+o,s=t[i];null===(r=e[o])||void 0===r||r.call(e),s&&(e[o]=n[i](s))})}};return t.forEach((t,e)=>{n["on"+ti[e]]=e=>t.add(e),n["notify"+ti[e]]=(...e)=>t.notify(...e)}),n}(),V=new Map,M=new Map;let R={};const L={...A};let O;function k(){T&&S&&(D(),s(T,P,h.style,W.projection))}function D(){n(W,P,A,w,h)}function j(){C.notifyUpdate(A)}function F(t,e){const n=e.onChange(e=>{A[t]=e,h.onUpdate&&Rn.update(j,!1,!0)}),o=e.onRenderRequest(W.scheduleRender);M.set(t,()=>{n(),o()})}const{willChange:I,...B}=c(h);for(const t in B){const e=B[t];void 0!==A[t]&&z(e)&&(e.set(A[t],!1),Jo(I)&&I.add(t))}const U=v(h),N=y(h),W={treeType:t,current:null,depth:d?d.depth+1:0,parent:d,children:new Set,presenceId:m,shouldReduceMotion:null,variantChildren:N?new Set:void 0,isVisible:void 0,manuallyAnimateOnMount:Boolean(null==d?void 0:d.isMounted()),blockInitialAnimation:g,isMounted:()=>Boolean(T),mount(t){S=!0,T=W.current=t,W.projection&&W.projection.mount(t),N&&d&&!U&&(O=null==d?void 0:d.addVariantChild(W)),V.forEach((t,e)=>F(e,t)),Jr.current||Qr(),W.shouldReduceMotion="never"!==b&&("always"===b||_r.current),null==d||d.children.add(W),W.setProps(h)},unmount(){var t;null===(t=W.projection)||void 0===t||t.unmount(),Ln.update(j),Ln.render(k),M.forEach(t=>t()),null==O||O(),null==d||d.children.delete(W),C.clearAllListeners(),T=void 0,S=!1},loadFeatures(t,n,o,r,i,s){const a=[];for(let n=0;n<ni;n++){const o=ei[n],{isEnabled:r,Component:i}=E[o];r(h)&&i&&a.push(e.createElement(i,{key:o,...t,visualElement:W}))}if(!W.projection&&i){W.projection=new i(r,W.getLatestValues(),d&&d.projection);const{layoutId:e,layout:n,drag:o,dragConstraints:a,layoutScroll:l}=t;W.projection.setOptions({layoutId:e,layout:n,alwaysMeasureLayout:Boolean(o)||a&&f(a),visualElement:W,scheduleRender:()=>W.scheduleRender(),animationType:"string"==typeof n?n:"both",initialPromotionConfig:s,layoutScroll:l})}return a},addVariantChild(t){var e;const n=W.getClosestVariantNode();if(n)return null===(e=n.variantChildren)||void 0===e||e.add(t),()=>n.variantChildren.delete(t)},sortNodePosition:e=>u&&t===e.treeType?u(W.getInstance(),e.getInstance()):0,getClosestVariantNode:()=>N?W:null==d?void 0:d.getClosestVariantNode(),getLayoutId:()=>h.layoutId,getInstance:()=>T,getStaticValue:t=>A[t],setStaticValue:(t,e)=>A[t]=e,getLatestValues:()=>A,setVisibility(t){W.isVisible!==t&&(W.isVisible=t,W.scheduleRender())},makeTargetAnimatable:(t,e=!0)=>r(W,t,h,e),measureViewportBox:()=>i(T,h),addValue(t,e){W.hasValue(t)&&W.removeValue(t),V.set(t,e),A[t]=e.get(),F(t,e)},removeValue(t){var e;V.delete(t),null===(e=M.get(t))||void 0===e||e(),M.delete(t),delete A[t],l(t,P)},hasValue:t=>V.has(t),getValue(t,e){let n=V.get(t);return void 0===n&&void 0!==e&&(n=Uo(e),W.addValue(t,n)),n},forEachValue:t=>V.forEach(t),readValue:t=>void 0!==A[t]?A[t]:a(T,t,w),setBaseTarget(t,e){L[t]=e},getBaseTarget(t){if(o){const e=o(h,t);if(void 0!==e&&!z(e))return e}return L[t]},...C,build:()=>(D(),P),scheduleRender(){Rn.render(k,!1,!0)},syncRender:k,setProps(t){(t.transformTemplate||h.transformTemplate)&&W.scheduleRender(),h=t,C.updatePropListeners(t),R=function(t,e,n){const{willChange:o}=e;for(const r in e){const i=e[r],s=n[r];if(z(i))t.addValue(r,i),Jo(o)&&o.add(r);else if(z(s))t.addValue(r,Uo(i)),Jo(o)&&o.remove(r);else if(s!==i)if(t.hasValue(r)){const e=t.getValue(r);!e.hasAnimated&&e.set(i)}else{const e=t.getStaticValue(r);t.addValue(r,Uo(void 0!==e?e:i))}}for(const o in n)void 0===e[o]&&t.removeValue(o);return e}(W,c(h),R)},getProps:()=>h,getVariant:t=>{var e;return null===(e=h.variants)||void 0===e?void 0:e[t]},getDefaultTransition:()=>h.transition,getTransformPagePoint:()=>h.transformPagePoint,getVariantContext(t=!1){if(t)return null==d?void 0:d.getVariantContext();if(!U){const t=(null==d?void 0:d.getVariantContext())||{};return void 0!==h.initial&&(t.initial=h.initial),t}const e={};for(let t=0;t<ii;t++){const n=ri[t],o=h[n];(p(o)||!1===o)&&(e[n]=o)}return e}};return W},ri=["initial",...rr],ii=ri.length;function si(t){return"string"==typeof t&&t.startsWith("var(--")}const ai=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function li(t,e,n=1){const[o,r]=function(t){const e=ai.exec(t);if(!e)return[,];const[,n,o]=e;return[n,o]}(t);if(!o)return;const i=window.getComputedStyle(e).getPropertyValue(o);return i?i.trim():si(r)?li(r,e,n+1):r}const ui=new Set(["width","height","top","left","right","bottom","x","y"]),ci=t=>ui.has(t),di=(t,e)=>{t.set(e,!1),t.set(e)},hi=t=>t===_||t===ot;var fi;!function(t){t.width="width",t.height="height",t.left="left",t.right="right",t.top="top",t.bottom="bottom"}(fi||(fi={}));const pi=(t,e)=>parseFloat(t.split(", ")[e]),mi=(t,e)=>(n,{transform:o})=>{if("none"===o||!o)return 0;const r=o.match(/^matrix3d\((.+)\)$/);if(r)return pi(r[1],e);{const e=o.match(/^matrix\((.+)\)$/);return e?pi(e[1],t):0}},gi=new Set(["x","y","z"]),vi=I.filter(t=>!gi.has(t));const yi={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:mi(4,13),y:mi(5,14)},xi=(t,e,n={},o={})=>{e={...e},o={...o};const r=Object.keys(e).filter(ci);let i=[],s=!1;const a=[];if(r.forEach(r=>{const l=t.getValue(r);if(!t.hasValue(r))return;let u=n[r],c=Wo(u);const d=e[r];let h;if(Kt(d)){const t=d.length,e=null===d[0]?1:0;u=d[e],c=Wo(u);for(let n=e;n<t;n++)h?Wo(d[n]):h=Wo(d[n])}else h=Wo(d);if(c!==h)if(hi(c)&&hi(h)){const t=l.get();"string"==typeof t&&l.set(parseFloat(t)),"string"==typeof d?e[r]=parseFloat(d):Array.isArray(d)&&h===ot&&(e[r]=d.map(parseFloat))}else(null==c?void 0:c.transform)&&(null==h?void 0:h.transform)&&(0===u||0===d)?0===u?l.set(h.transform(u)):e[r]=c.transform(d):(s||(i=function(t){const e=[];return vi.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.syncRender(),e}(t),s=!0),a.push(r),o[r]=void 0!==o[r]?o[r]:e[r],di(l,d))}),a.length){const n=a.indexOf("height")>=0?window.pageYOffset:null,r=((t,e,n)=>{const o=e.measureViewportBox(),r=e.getInstance(),i=getComputedStyle(r),{display:s}=i,a={};"none"===s&&e.setStaticValue("display",t.display||"block"),n.forEach(t=>{a[t]=yi[t](o,i)}),e.syncRender();const l=e.measureViewportBox();return n.forEach(n=>{const o=e.getValue(n);di(o,a[n]),t[n]=yi[n](l,i)}),t})(e,t,a);return i.length&&i.forEach(([e,n])=>{t.getValue(e).set(n)}),t.syncRender(),c&&null!==n&&window.scrollTo({top:n}),{target:r,transitionEnd:o}}return{target:e,transitionEnd:o}};function bi(t,e,n,o){return(t=>Object.keys(t).some(ci))(e)?xi(t,e,n,o):{target:e,transitionEnd:o}}const wi=(t,e,n,o)=>{const r=function(t,{...e},n){const o=t.getInstance();if(!(o instanceof Element))return{target:e,transitionEnd:n};n&&(n={...n}),t.forEachValue(t=>{const e=t.get();if(!si(e))return;const n=li(e,o);n&&t.set(n)});for(const t in e){const r=e[t];if(!si(r))continue;const i=li(r,o);i&&(e[t]=i,n&&void 0===n[t]&&(n[t]=r))}return{target:e,transitionEnd:n}}(t,e,o);return bi(t,e=r.target,n,o=r.transitionEnd)};const Ei={treeType:"dom",readValueFromInstance(t,e){if(B.has(e)){const t=Ao(e);return t&&t.default||0}{const o=(n=t,window.getComputedStyle(n)),r=(H(e)?o.getPropertyValue(e):o[e])||0;return"string"==typeof r?r.trim():r}var n},sortNodePosition:(t,e)=>2&t.compareDocumentPosition(e)?1:-1,getBaseTarget(t,e){var n;return null===(n=t.style)||void 0===n?void 0:n[e]},measureViewportBox:(t,{transformPagePoint:e})=>Xr(t,e),resetTransform(t,e,n){const{transformTemplate:o}=n;e.style.transform=o?o({},""):"none",t.scheduleRender()},restoreTransform(t,e){t.style.transform=e.style.transform},removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]},makeTargetAnimatable(t,{transition:e,transitionEnd:n,...o},{transformValues:r},i=!0){let s=_o(o,e||{},t);if(r&&(n&&(n=r(n)),o&&(o=r(o)),s&&(s=r(s))),i){Zo(t,o,s);const e=wi(t,o,s,n);n=e.transitionEnd,o=e.target}return{transition:e,transitionEnd:n,...o}},scrapeMotionValuesFromProps:Gt,build(t,e,n,o,r){void 0!==t.isVisible&&(e.style.visibility=t.isVisible?"visible":"hidden"),Tt(e,n,o,r.transformTemplate)},render:$t},Si=oi(Ei),Ai=oi({...Ei,getBaseTarget:(t,e)=>t[e],readValueFromInstance(t,e){var n;return B.has(e)?(null===(n=Ao(e))||void 0===n?void 0:n.default)||0:(e=Yt.has(e)?e:Ht(e),t.getAttribute(e))},scrapeMotionValuesFromProps:qt,build(t,e,n,o,r){Ut(e,n,o,r.transformTemplate)},render:Xt}),Pi=(t,e)=>D(t)?Ai(e,{enableHardwareAcceleration:!1}):Si(e,{enableHardwareAcceleration:!0});function Ti(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Ci={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!ot.test(t))return t;t=parseFloat(t)}return`${Ti(t,e.target.x)}% ${Ti(t,e.target.y)}%`}},Vi={correct:(t,{treeScale:e,projectionDelta:n})=>{const o=t,r=t.includes("var("),i=[];r&&(t=t.replace(ai,t=>(i.push(t),"_$css")));const s=xt.parse(t);if(s.length>5)return o;const a=xt.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 d=Ie(u,c,.5);"number"==typeof s[2+l]&&(s[2+l]/=d),"number"==typeof s[3+l]&&(s[3+l]/=d);let h=a(s);if(r){let t=0;h=h.replace("_$css",()=>{const e=i[t];return t++,e})}return h}};class Mi extends r.default.Component{componentDidMount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n,layoutId:o}=this.props,{projection:r}=t;F(Ri),r&&(e.group&&e.group.add(r),n&&n.register&&o&&n.register(r),r.root.didUpdate(),r.addEventListener("animationComplete",()=>{this.safeToRemove()}),r.setOptions({...r.options,onExitComplete:()=>this.safeToRemove()})),P.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:e,visualElement:n,drag:o,isPresent:r}=this.props,i=n.projection;return i?(i.isPresent=r,o||t.layoutDependency!==e||void 0===e?i.willUpdate():this.safeToRemove(),t.isPresent!==r&&(r?i.promote():i.relegate()||Rn.postRender(()=>{var t;(null===(t=i.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 Ri={borderRadius:{...Ci,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Ci,borderTopRightRadius:Ci,borderBottomLeftRadius:Ci,borderBottomRightRadius:Ci,boxShadow:Vi},Li={measureLayout:function(t){const[n,o]=co(),i=e.useContext(C);return r.default.createElement(Mi,{...t,layoutGroup:i,switchLayoutGroup:e.useContext(M),isPresent:n,safeToRemove:o})}};function Oi(t,e,n={}){const o=z(t)?t:Uo(t);return ko("",o,e,n),{stop:()=>o.stop(),isAnimating:()=>o.isAnimating()}}const ki=["TopLeft","TopRight","BottomLeft","BottomRight"],Di=ki.length,ji=t=>"string"==typeof t?parseFloat(t):t,Fi=t=>"number"==typeof t||ot.test(t);function Ii(t,e){var n;return null!==(n=t[e])&&void 0!==n?n:t.borderRadius}const Bi=zi(0,.5,dn),Ui=zi(.5,.95,rn);function zi(t,e,n){return o=>o<t?0:o>e?1:n(Fe(t,e,o))}function Ni(t,e){t.min=e.min,t.max=e.max}function Wi(t,e){Ni(t.x,e.x),Ni(t.y,e.y)}function Hi(t,e,n,o,r){return t=Ir(t-=e,1/n,o),void 0!==r&&(t=Ir(t,1/r,o)),t}function $i(t,e,[n,o,r],i,s){!function(t,e=0,n=1,o=.5,r,i=t,s=t){if(nt.test(e)){e=parseFloat(e);e=Ie(s.min,s.max,e/100)-s.min}if("number"!=typeof e)return;let a=Ie(i.min,i.max,o);t===i&&(a-=e),t.min=Hi(t.min,e,n,a,r),t.max=Hi(t.max,e,n,a,r)}(t,e[n],e[o],e[r],e.scale,i,s)}const Yi=["x","scaleX","originX"],Xi=["y","scaleY","originY"];function Gi(t,e,n,o){$i(t.x,e,Yi,null==n?void 0:n.x,null==o?void 0:o.x),$i(t.y,e,Xi,null==n?void 0:n.y,null==o?void 0:o.y)}function qi(t){return 0===t.translate&&1===t.scale}function Zi(t){return qi(t.x)&&qi(t.y)}function Ki(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}class _i{constructor(){this.members=[]}add(t){jo(this.members,t),t.scheduleRender()}remove(t){if(Fo(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,t.snapshot.isShared=!0),(null===(n=t.root)||void 0===n?void 0:n.isUpdating)&&(t.isLayoutDirty=!0);const{crossfade:r}=t.options;!1===r&&o.hide()}}exitAnimationComplete(){this.members.forEach(t=>{var e,n,o,r,i;null===(n=(e=t.options).onExitComplete)||void 0===n||n.call(e),null===(i=null===(o=t.resumingFrom)||void 0===o?void 0:(r=o.options).onExitComplete)||void 0===i||i.call(r)})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function Ji(t,e,n){let o=`translate3d(${t.x.translate/e.x}px, ${t.y.translate/e.y}px, 0) `;if(o+=`scale(${1/e.x}, ${1/e.y}) `,n){const{rotate:t,rotateX:e,rotateY:r}=n;t&&(o+=`rotate(${t}deg) `),e&&(o+=`rotateX(${e}deg) `),r&&(o+=`rotateY(${r}deg) `)}return o+=`scale(${t.x.scale*e.x}, ${t.y.scale*e.y})`,"translate3d(0px, 0px, 0) scale(1, 1) scale(1, 1)"===o?"none":o}const Qi=(t,e)=>t.depth-e.depth;class ts{constructor(){this.children=[],this.isDirty=!1}add(t){jo(this.children,t),this.isDirty=!0}remove(t){Fo(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Qi),this.isDirty=!1,this.children.forEach(t)}}const es=["","X","Y","Z"];function ns({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:o,resetTransform:r}){return class{constructor(t,n={},o=(null==e?void 0:e())){this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!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(us),this.nodes.forEach(cs)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.id=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 ts)}addEventListener(t,e){return this.eventHandlers.has(t)||this.eventHandlers.set(t,new Io),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:r,layout:i,visualElement:s}=this.options;if(s&&!s.getInstance()&&s.mount(e),this.root.nodes.add(this),null===(o=this.parent)||void 0===o||o.children.add(this),this.id&&this.root.potentialNodes.delete(this.id),n&&(i||r)&&(this.isLayoutDirty=!0),t){let n;const o=()=>this.root.updateBlockedByResize=!1;t(e,()=>{this.root.updateBlockedByResize=!0,clearTimeout(n),n=window.setTimeout(o,250),P.hasAnimatedSinceResize&&(P.hasAnimatedSinceResize=!1,this.nodes.forEach(ls))})}r&&this.root.registerSharedNode(r,this),!1!==this.options.animate&&s&&(r||i)&&this.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e,hasRelativeTargetChanged:n,layout:o})=>{var r,i,a,l,u;if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const c=null!==(i=null!==(r=this.options.transition)&&void 0!==r?r:s.getDefaultTransition())&&void 0!==i?i:gs,{onLayoutAnimationStart:d,onLayoutAnimationComplete:h}=s.getProps(),f=!this.targetLayout||!Ki(this.targetLayout,o)||n,p=!e&&n;if((null===(a=this.resumeFrom)||void 0===a?void 0:a.instance)||p||e&&(f||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(t,p);const e={...Oo(c,"layout"),onPlay:d,onComplete:h};s.shouldReduceMotion&&(e.delay=0,e.type=!1),this.startAnimation(e)}else e||0!==this.animationProgress||this.finishAnimation(),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,Ln.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(ds))}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()}const{layoutId:r,layout:i}=this.options;if(void 0===r&&!i)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(ss);this.isUpdating&&(this.isUpdating=!1,this.potentialNodes.size&&(this.potentialNodes.forEach(vs),this.potentialNodes.clear()),this.nodes.forEach(as),this.nodes.forEach(os),this.nodes.forEach(rs),this.clearAllSnapshots(),On.update(),On.preRender(),On.render())}clearAllSnapshots(){this.nodes.forEach(is),this.sharedNodes.forEach(hs)}scheduleUpdateProjection(){Rn.preRender(this.updateProjection,!1,!0)}scheduleCheckAfterUnmount(){Rn.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){if(this.snapshot||!this.instance)return;const t=this.measure(),e=this.removeTransform(this.removeElementScroll(t));xs(e),this.snapshot={measured:t,layout:e,latestValues:{}}}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.measure();xs(e);const n=this.layout;this.layout={measured:e,actual:this.removeElementScroll(e)},this.layoutCorrected={x:{min:0,max:0},y:{min:0,max:0}},this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.actual),null===(t=this.options.visualElement)||void 0===t||t.notifyLayoutMeasure(this.layout.actual,null==n?void 0:n.actual)}updateScroll(){this.options.layoutScroll&&this.instance&&(this.isScrollRoot=o(this.instance),this.scroll=n(this.instance))}resetTransform(){var t;if(!r)return;const e=this.isLayoutDirty||this.shouldResetTransform,n=this.projectionDelta&&!Zi(this.projectionDelta),o=null===(t=this.options.visualElement)||void 0===t?void 0:t.getProps().transformTemplate,i=null==o?void 0:o(this.latestValues,""),s=i!==this.prevTransformTemplateValue;e&&(n||jr(this.latestValues)||s)&&(r(this.instance,i),this.shouldResetTransform=!1,this.scheduleRender())}measure(){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&&(Nr(e.x,n.x),Nr(e.y,n.y)),e}removeElementScroll(t){const e={x:{min:0,max:0},y:{min:0,max:0}};Wi(e,t);for(let n=0;n<this.path.length;n++){const o=this.path[n],{scroll:r,options:i,isScrollRoot:s}=o;if(o!==this.root&&r&&i.layoutScroll){if(s){Wi(e,t);const{scroll:n}=this.root;n&&(Nr(e.x,-n.x),Nr(e.y,-n.y))}Nr(e.x,r.x),Nr(e.y,r.y)}}return e}applyTransform(t,e=!1){const n={x:{min:0,max:0},y:{min:0,max:0}};Wi(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&&Yr(n,{x:-o.scroll.x,y:-o.scroll.y}),jr(o.latestValues)&&Yr(n,o.latestValues)}return jr(this.latestValues)&&Yr(n,this.latestValues),n}removeTransform(t){var e;const n={x:{min:0,max:0},y:{min:0,max:0}};Wi(n,t);for(let t=0;t<this.path.length;t++){const o=this.path[t];if(!o.instance)continue;if(!jr(o.latestValues))continue;Dr(o.latestValues)&&o.updateSnapshot();const r={x:{min:0,max:0},y:{min:0,max:0}};Wi(r,o.measure()),Gi(n,o.latestValues,null===(e=o.snapshot)||void 0===e?void 0:e.layout,r)}return jr(this.latestValues)&&Gi(n,this.latestValues),n}setTargetDelta(t){this.targetDelta=t,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{layout:e,layoutId:n}=this.options;var o,r,i;this.layout&&(e||n)&&(this.targetDelta||this.relativeTarget||(this.relativeParent=this.getClosestProjectingParent(),this.relativeParent&&this.relativeParent.layout&&(this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},Ar(this.relativeTargetOrigin,this.layout.actual,this.relativeParent.layout.actual),Wi(this.relativeTarget,this.relativeTargetOrigin))),(this.relativeTarget||this.targetDelta)&&(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)?(o=this.target,r=this.relativeTarget,i=this.relativeParent.target,Er(o.x,r.x,i.x),Er(o.y,r.y,i.y)):this.targetDelta?(Boolean(this.resumingFrom)?this.target=this.applyTransform(this.layout.actual):Wi(this.target,this.layout.actual),zr(this.target,this.targetDelta)):Wi(this.target,this.layout.actual),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.relativeParent=this.getClosestProjectingParent(),this.relativeParent&&Boolean(this.relativeParent.resumingFrom)===Boolean(this.resumingFrom)&&!this.relativeParent.options.layoutScroll&&this.relativeParent.target&&(this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},Ar(this.relativeTargetOrigin,this.target,this.relativeParent.target),Wi(this.relativeTarget,this.relativeTargetOrigin)))))}getClosestProjectingParent(){if(this.parent&&!jr(this.parent.latestValues))return(this.parent.relativeTarget||this.parent.targetDelta)&&this.parent.layout?this.parent:this.parent.getClosestProjectingParent()}calcProjection(){var t;const{layout:e,layoutId:n}=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||!e&&!n)return;const o=this.getLead();Wi(this.layoutCorrected,this.layout.actual),function(t,e,n,o=!1){var r,i;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===(i=null===(r=a.instance)||void 0===r?void 0:r.style)||void 0===i?void 0:i.display)&&(o&&a.options.layoutScroll&&a.scroll&&a!==a.root&&Yr(t,{x:-a.scroll.x,y:-a.scroll.y}),l&&(e.x*=l.x.scale,e.y*=l.y.scale,zr(t,l)),o&&jr(a.latestValues)&&Yr(t,a.latestValues))}(this.layoutCorrected,this.treeScale,this.path,Boolean(this.resumingFrom)||this!==o);const{target:r}=o;if(!r)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 i=this.treeScale.x,s=this.treeScale.y,a=this.projectionTransform;wr(this.projectionDelta,this.layoutCorrected,r,this.latestValues),this.projectionTransform=Ji(this.projectionDelta,this.treeScale),this.projectionTransform===a&&this.treeScale.x===i&&this.treeScale.y===s||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",r))}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;const o=this.snapshot,r=(null==o?void 0:o.latestValues)||{},i={...this.latestValues},s={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 a={x:{min:0,max:0},y:{min:0,max:0}},l=null==o?void 0:o.isShared,u=((null===(n=this.getStack())||void 0===n?void 0:n.members.length)||0)<=1,c=Boolean(l&&!u&&!0===this.options.crossfade&&!this.path.some(ms));this.animationProgress=0,this.mixTargetDelta=e=>{var n;const o=e/1e3;var d,h,f,p;fs(s.x,t.x,o),fs(s.y,t.y,o),this.setTargetDelta(s),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&(null===(n=this.relativeParent)||void 0===n?void 0:n.layout)&&(Ar(a,this.layout.actual,this.relativeParent.layout.actual),d=this.relativeTarget,h=this.relativeTargetOrigin,f=a,p=o,ps(d.x,h.x,f.x,p),ps(d.y,h.y,f.y,p)),l&&(this.animationValues=i,function(t,e,n,o,r,i){var s,a,l,u;r?(t.opacity=Ie(0,null!==(s=n.opacity)&&void 0!==s?s:1,Bi(o)),t.opacityExit=Ie(null!==(a=e.opacity)&&void 0!==a?a:1,0,Ui(o))):i&&(t.opacity=Ie(null!==(l=e.opacity)&&void 0!==l?l:1,null!==(u=n.opacity)&&void 0!==u?u:1,o));for(let r=0;r<Di;r++){const i=`border${ki[r]}Radius`;let s=Ii(e,i),a=Ii(n,i);if(void 0===s&&void 0===a)continue;s||(s=0),a||(a=0);0===s||0===a||Fi(s)===Fi(a)?(t[i]=Math.max(Ie(ji(s),ji(a),o),0),(nt.test(a)||nt.test(s))&&(t[i]+="%")):t[i]=a}(e.rotate||n.rotate)&&(t.rotate=Ie(e.rotate||0,n.rotate||0,o))}(i,r,this.latestValues,o,c,u)),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&&(Ln.update(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Rn.update(()=>{P.hasAnimatedSinceResize=!0,this.currentAnimation=Oi(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{targetWithTransforms:t,target:e,layout:n,latestValues:o}=this.getLead();t&&e&&n&&(Wi(t,e),Yr(t,o),wr(this.projectionDeltaWithTransform,this.layoutCorrected,t,o))}registerSharedNode(t,e){var n,o,r;this.sharedNodes.has(t)||this.sharedNodes.set(t,new _i);this.sharedNodes.get(t).add(e),e.promote({transition:null===(n=e.options.initialPromotionConfig)||void 0===n?void 0:n.transition,preserveFollowOpacity:null===(r=null===(o=e.options.initialPromotionConfig)||void 0===o?void 0:o.shouldPreserveFollowOpacity)||void 0===r?void 0:r.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 n={};for(let o=0;o<es.length;o++){const r="rotate"+es[o];t.getStaticValue(r)&&(e=!0,n[r]=t.getStaticValue(r),t.setStaticValue(r,0))}if(e){null==t||t.syncRender();for(const e in n)t.setStaticValue(e,n[e]);t.scheduleRender()}}getProjectionStyles(t={}){var e,n,o;const r={};if(!this.instance||this.isSVG)return r;if(!this.isVisible)return{visibility:"hidden"};r.visibility="";const i=null===(e=this.options.visualElement)||void 0===e?void 0:e.getProps().transformTemplate;if(this.needsReset)return this.needsReset=!1,r.opacity="",r.pointerEvents=Jt(t.pointerEvents)||"",r.transform=i?i(this.latestValues,""):"none",r;const s=this.getLead();if(!this.projectionDelta||!this.layout||!s.target){const e={};return this.options.layoutId&&(e.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,e.pointerEvents=Jt(t.pointerEvents)||""),this.hasProjected&&!jr(this.latestValues)&&(e.transform=i?i({},""):"none",this.hasProjected=!1),e}const a=s.animationValues||s.latestValues;this.applyTransformsToTarget(),r.transform=Ji(this.projectionDeltaWithTransform,this.treeScale,a),i&&(r.transform=i(a,r.transform));const{x:l,y:u}=this.projectionDelta;r.transformOrigin=`${100*l.origin}% ${100*u.origin}% 0`,s.animationValues?r.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:r.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++)r[n[e]]=o}else r[t]=o}return this.options.layoutId&&(r.pointerEvents=s===this?Jt(t.pointerEvents)||"":"none"),r}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(ss),this.root.sharedNodes.clear()}}}function os(t){t.updateLayout()}function rs(t){var e,n,o;const r=(null===(e=t.resumeFrom)||void 0===e?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&r&&t.hasListeners("didUpdate")){const{actual:e,measured:n}=t.layout;"size"===t.options.animationType?Lr(t=>{const n=r.isShared?r.measured[t]:r.layout[t],o=yr(n);n.min=e[t].min,n.max=n.min+o}):"position"===t.options.animationType&&Lr(t=>{const n=r.isShared?r.measured[t]:r.layout[t],o=yr(e[t]);n.max=n.min+o});const o={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};wr(o,e,r.layout);const i={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};r.isShared?wr(i,t.applyTransform(n,!0),r.measured):wr(i,e,r.layout);const s=!Zi(o);let a=!1;if(!t.resumeFrom&&(t.relativeParent=t.getClosestProjectingParent(),t.relativeParent&&!t.relativeParent.resumeFrom)){const{snapshot:n,layout:o}=t.relativeParent;if(n&&o){const t={x:{min:0,max:0},y:{min:0,max:0}};Ar(t,r.layout,n.layout);const i={x:{min:0,max:0},y:{min:0,max:0}};Ar(i,e,o.actual),Ki(t,i)||(a=!0)}}t.notifyListeners("didUpdate",{layout:e,snapshot:r,delta:i,layoutDelta:o,hasLayoutChanged:s,hasRelativeTargetChanged:a})}else t.isLead()&&(null===(o=(n=t.options).onExitComplete)||void 0===o||o.call(n));t.options.transition=void 0}function is(t){t.clearSnapshot()}function ss(t){t.clearMeasurements()}function as(t){const{visualElement:e}=t.options;(null==e?void 0:e.getProps().onBeforeLayoutMeasure)&&e.notifyBeforeLayoutMeasure(),t.resetTransform()}function ls(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0}function us(t){t.resolveTargetDelta()}function cs(t){t.calcProjection()}function ds(t){t.resetRotation()}function hs(t){t.removeLeadSnapshot()}function fs(t,e,n){t.translate=Ie(e.translate,0,n),t.scale=Ie(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function ps(t,e,n,o){t.min=Ie(e.min,n.min,o),t.max=Ie(e.max,n.max,o)}function ms(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}const gs={duration:.45,ease:[.4,0,.1,1]};function vs(t,e){let n=t.root;for(let e=t.path.length-1;e>=0;e--)if(Boolean(t.path[e].instance)){n=t.path[e];break}const o=(n&&n!==t.root?n.instance:document).querySelector(`[data-projection-id="${e}"]`);o&&t.mount(o,!0)}function ys(t){t.min=Math.round(t.min),t.max=Math.round(t.max)}function xs(t){ys(t.x),ys(t.y)}const bs=ns({attachResizeListener:(t,e)=>ie(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),ws={current:void 0},Es=ns({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!ws.current){const t=new bs(0,{});t.mount(window),t.setOptions({layoutScroll:!0}),ws.current=t}return ws.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)}),Ss={...cr,...uo,...Kr,...Li},As=O((t,e)=>oe(t,e,Ss,Pi,Es));const Ps=O(oe);function Ts(){const t=e.useRef(!1);return d(()=>(t.current=!0,()=>{t.current=!1}),[]),t}function Cs(){const t=Ts(),[n,o]=e.useState(0),r=e.useCallback(()=>{t.current&&o(n+1)},[n]);return[e.useCallback(()=>Rn.postRender(r),[r]),n]}class Vs extends i.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 Ms({children:t,isPresent:n}){const o=e.useId(),r=e.useRef(null),s=e.useRef({width:0,height:0,top:0,left:0});return e.useInsertionEffect(()=>{const{width:t,height:e,top:i,left:a}=s.current;if(n||!r.current||!t||!e)return;r.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: ${i}px !important;\n left: ${a}px !important;\n }\n `),()=>{document.head.removeChild(l)}},[n]),i.createElement(Vs,{isPresent:n,childRef:r,sizeRef:s},i.cloneElement(t,{ref:r}))}const Rs=({children:t,initial:n,isPresent:o,onExitComplete:r,custom:s,presenceAffectsLayout:a,mode:l})=>{const c=A(Ls),d=e.useId(),h=e.useMemo(()=>({id:d,initial:n,isPresent:o,custom:s,onExitComplete:t=>{c.set(t,!0);for(const t of c.values())if(!t)return;r&&r()},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]),i.useEffect(()=>{!o&&!c.size&&r&&r()},[o]),"popLayout"===l&&(t=i.createElement(Ms,{isPresent:o},t)),i.createElement(u.Provider,{value:h},t)};function Ls(){return new Map}const Os=t=>t.key||"";const ks=e.createContext(null),Ds=t=>!t.isLayoutDirty&&t.willUpdate(!1);function js(){const t=new Set,e=new WeakMap,n=()=>t.forEach(Ds);return{add:o=>{t.add(o),e.set(o,o.addEventListener("willUpdate",n))},remove:o=>{var r;t.delete(o),null===(r=e.get(o))||void 0===r||r(),e.delete(o),n()},dirty:n}}const Fs=t=>!0===t,Is=({children:t,id:n,inheritId:o,inherit:r=!0})=>{void 0!==o&&(r=o);const s=e.useContext(C),a=e.useContext(ks),[l,u]=Cs(),c=e.useRef(null),d=s.id||a;null===c.current&&((t=>Fs(!0===t)||"id"===t)(r)&&d&&(n=n?d+"-"+n:d),c.current={id:n,group:Fs(r)&&s.group||js()});const h=e.useMemo(()=>({...c.current,forceRender:l}),[u]);return i.createElement(C.Provider,{value:h},t)};let Bs=0;function Us(t){return"function"==typeof t}const zs=e.createContext(null);const Ns=e.forwardRef((function({children:t,as:n="ul",axis:o="y",onReorder:r,values:s,...a},l){const u=A(()=>As(n)),c=[],d=e.useRef(!1),h={axis:o,registerItem:(t,e)=>{e&&-1===c.findIndex(e=>t===e.value)&&(c.push({value:t,layout:e[o]}),c.sort(Hs))},updateOrder:(t,e,n)=>{if(d.current)return;const o=function(t,e,n,o){if(!o)return t;const r=t.findIndex(t=>t.value===e);if(-1===r)return t;const i=o>0?1:-1,s=t[r+i];if(!s)return t;const a=t[r],l=s.layout,u=Ie(l.min,l.max,.5);return 1===i&&a.layout.max+n>u||-1===i&&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,[r]=t.splice(e,1);t.splice(o,0,r)}return t}(t,r,r+i):t}(c,t,e,n);c!==o&&(d.current=!0,r(o.map(Ws).filter(t=>-1!==s.indexOf(t))))}};return e.useEffect(()=>{d.current=!1}),i.createElement(u,{...a,ref:l},i.createElement(zs.Provider,{value:h},t))}));function Ws(t){return t.value}function Hs(t,e){return t.layout.min-e.layout.min}function $s(t){const n=A(()=>Uo(t)),{isStatic:o}=e.useContext(s);if(o){const[,o]=e.useState(t);e.useEffect(()=>n.onChange(o),[])}return n}function Ys(...t){const e=!Array.isArray(t[0]),n=e?0:-1,o=t[0+n],r=t[1+n],i=t[2+n],s=t[3+n],a=tn(r,i,{mixer:(l=i[0],(t=>"object"==typeof t&&t.mix)(l)?l.mix:void 0),...s});var l;return e?a(o):a}function Xs(t,e){const n=$s(e()),o=()=>n.set(e());return o(),function(t,e){d(()=>{const n=t.map(t=>t.onChange(e));return()=>n.forEach(t=>t())})}(t,()=>Rn.update(o,!1,!0)),n}function Gs(t,e,n,o){const r="function"==typeof e?e:Ys(e,n,o);return Array.isArray(t)?qs(t,r):qs([t],([t])=>r(t))}function qs(t,e){const n=A(()=>[]);return Xs(t,()=>{n.length=0;const o=t.length;for(let e=0;e<o;e++)n[e]=t[e].get();return e(n)})}function Zs(t,e=0){return z(t)?t:$s(e)}const Ks={Group:Ns,Item:e.forwardRef((function({children:t,style:n={},value:o,as:r="li",onDrag:s,layout:a=!0,...l},u){const c=A(()=>As(r)),d=e.useContext(zs),h={x:Zs(n.x),y:Zs(n.y)},f=Gs([h.x,h.y],([t,e])=>t||e?1:"unset"),p=e.useRef(null),{axis:m,registerItem:g,updateOrder:v}=d;return e.useEffect(()=>{g(o,p.current)},[d]),i.createElement(c,{drag:m,...l,dragSnapToOrigin:!0,style:{...n,x:h.x,y:h.y,zIndex:f},layout:a,onDrag:(t,e)=>{const{velocity:n}=e;n[m]&&v(o,h[m].get(),n[m]),s&&s(t,e)},onLayoutMeasure:t=>{p.current=t},ref:u},t)}))},_s={renderer:Pi,...cr,...uo},Js={..._s,...Kr,...Li,projectionNodeConstructor:Es};const Qs=t=>"number"==typeof t;function ta(t,e){return(t=>Array.isArray(t)&&!Qs(t[0]))(t)?t[((t,e,n)=>{const o=e-t;return((n-t)%o+o)%o+t})(0,t.length,e)]:t}const ea=(t,e,n)=>-n*t+n*e+t,na=t=>t,oa=(t,e,n)=>e-t==0?1:(n-t)/(e-t);function ra(t,e){const n=t[t.length-1];for(let o=1;o<=e;o++){const r=oa(0,e,o);t.push(ea(n,1,r))}}function ia(t){const e=[0];return ra(e,t-1),e}function sa(t,e=ia(t.length),n=na){const o=t.length,r=o-e.length;return r>0&&ra(e,r),r=>{let i=0;for(;i<o-2&&!(r<e[i+1]);i++);let s=(a=0,l=1,u=oa(e[i],e[i+1],r),Math.min(Math.max(u,a),l));var a,l,u;return s=ta(n,i)(s),ea(t[i],t[i+1],s)}}const aa=t=>"function"==typeof t,la=t=>"string"==typeof t;function ua(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 ca={any:0,all:1};const da=new WeakMap;let ha;function fa({target:t,contentRect:e,borderBoxSize:n}){var o;null===(o=da.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 pa(t){t.forEach(fa)}function ma(t,e){ha||"undefined"!=typeof ResizeObserver&&(ha=new ResizeObserver(pa));const n=ua(t);return n.forEach(t=>{let n=da.get(t);n||(n=new Set,da.set(t,n)),n.add(e),null==ha||ha.observe(t)}),()=>{n.forEach(t=>{const n=da.get(t);null==n||n.delete(e),(null==n?void 0:n.size)||null==ha||ha.unobserve(t)})}}const ga=new Set;let va;function ya(t){return ga.add(t),va||(va=()=>{const t={width:window.innerWidth,height:window.innerHeight},e={target:window,size:t,contentSize:t};ga.forEach(t=>t(e))},window.addEventListener("resize",va)),()=>{ga.delete(t),!ga.size&&va&&(va=void 0)}}const xa={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}};function ba(t,e,n,o){const r=n[e],{length:i,position:s}=xa[e],a=r.current,l=n.time;r.current=t["scroll"+s],r.scrollLength=t["scroll"+i]-t["client"+i],r.offset.length=0,r.offset[0]=0,r.offset[1]=r.scrollLength,r.progress=oa(0,r.scrollLength,r.current);const u=o-l;var c,d;r.velocity=u>50?0:(c=r.current-a,(d=u)?c*(1e3/d):0)}const wa={Enter:[[0,1],[1,1]],Exit:[[0,0],[1,0]],Any:[[1,0],[0,1]],All:[[0,0],[1,1]]},Ea={start:0,center:.5,end:1};function Sa(t,e,n=0){let o=0;if(void 0!==Ea[t]&&(t=Ea[t]),la(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 Qs(t)&&(o=e*t),n+o}const Aa=[0,0];function Pa(t,e,n,o){let r=Array.isArray(t)?t:Aa,i=0,s=0;return Qs(t)?r=[t,t]:la(t)&&(r=(t=t.trim()).includes(" ")?t.split(" "):[t,Ea[t]?t:"0"]),i=Sa(r[0],n,o),s=Sa(r[1],e),i-s}const Ta={x:0,y:0};function Ca(t,e,n){let{offset:o=wa.All}=n;const{target:r=t,axis:i="y"}=n,s="y"===i?"height":"width",a=r!==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}(r,t):Ta,l=r===t?{width:t.scrollWidth,height:t.scrollHeight}:{width:r.clientWidth,height:r.clientHeight},u={width:t.clientWidth,height:t.clientHeight};e[i].offset.length=0;let c=!e[i].interpolate;const d=o.length;for(let t=0;t<d;t++){const n=Pa(o[t],u[s],l[s],a[i]);c||n===e[i].interpolatorOffsets[t]||(c=!0),e[i].offset[t]=n}c&&(e[i].interpolate=sa(ia(d),e[i].offset),e[i].interpolatorOffsets=[...e[i].offset]),e[i].progress=e[i].interpolate(e[i].current)}function Va(t,e,n,o={}){const r=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){ba(t,"x",e,n),ba(t,"y",e,n),e.time=n}(t,n,e),(o.offset||o.target)&&Ca(t,n,o)},notify:aa(e)?()=>e(n):Ma(e,n[r])}}function Ma(t,e){return t.pause(),t.forEachNative((t,{easing:e})=>{var n,o;if(t.updateDuration)e||(t.easing=na),t.updateDuration(1);else{const r={duration:1e3};e||(r.easing="linear"),null===(o=null===(n=t.effect)||void 0===n?void 0:n.updateTiming)||void 0===o||o.call(n,r)}}),()=>{t.currentTime=e.progress}}const Ra=new WeakMap,La=new WeakMap,Oa=new WeakMap,ka=t=>t===document.documentElement?window:t;function Da(t,e={}){var{container:n=document.documentElement}=e,o=Ce(e,["container"]);let r=Oa.get(n);r||(r=new Set,Oa.set(n,r));const i=Va(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(r.add(i),!Ra.has(n)){const t=()=>{const t=performance.now();for(const t of r)t.measure();for(const e of r)e.update(t);for(const t of r)t.notify()};Ra.set(n,t);const e=ka(n);window.addEventListener("resize",t,{passive:!0}),n!==document.documentElement&&La.set(n,function(t,e){return aa(t)?ya(t):ma(t,e)}(n,t)),e.addEventListener("scroll",t,{passive:!0})}const s=Ra.get(n),a=requestAnimationFrame(s);return()=>{var e;"function"!=typeof t&&t.stop(),cancelAnimationFrame(a);const o=Oa.get(n);if(!o)return;if(o.delete(i),o.size)return;const r=Ra.get(n);Ra.delete(n),r&&(ka(n).removeEventListener("scroll",r),null===(e=La.get(n))||void 0===e||e(),window.removeEventListener("resize",r))}}const ja=()=>({scrollX:Uo(0),scrollY:Uo(0),scrollXProgress:Uo(0),scrollYProgress:Uo(0)});function Fa({container:t,target:e,...n}={}){const o=A(ja);return d(()=>Da(({x:t,y:e})=>{o.scrollX.set(t.current),o.scrollXProgress.set(t.progress),o.scrollY.set(e.current),o.scrollYProgress.set(e.progress)},{...n,container:(null==t?void 0:t.current)||void 0,target:(null==e?void 0:e.current)||void 0}),[]),o}function Ia(t){const n=e.useRef(0),{isStatic:o}=e.useContext(s);e.useEffect(()=>{if(o)return;const e=({timestamp:e})=>{n.current||(n.current=e),t(e-n.current)};return Rn.update(e,!0),()=>Ln.update(e)},[t])}class Ba extends Bo{constructor(){super(...arguments),this.members=[],this.transforms=new Set}add(t){let e;B.has(t)?(this.transforms.add(t),e="transform"):t.startsWith("origin")||H(t)||"willChange"===t||(e=Ht(t)),e&&(jo(this.members,e),this.update())}remove(t){B.has(t)?(this.transforms.delete(t),this.transforms.size||Fo(this.members,"transform")):Fo(this.members,Ht(t)),this.update()}update(){this.set(this.members.length?this.members.join(", "):"auto")}}function Ua(){!Jr.current&&Qr();const[t]=e.useState(_r.current);return t}function za(){let t=!1;const e=[],n=new Set,o={subscribe:t=>(n.add(t),()=>{n.delete(t)}),start(o,r){if(t){const t=[];return n.forEach(e=>{t.push(Qo(e,o,{transitionOverride:r}))}),Promise.all(t)}return new Promise(t=>{e.push({animation:[o,r],resolve:t})})},set:t=>n.forEach(e=>{!function(t,e){Array.isArray(e)?qo(t,e):"string"==typeof e?qo(t,[e]):Go(t,e)}(e,t)}),stop(){n.forEach(t=>{!function(t){t.forEachValue(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 Na(){const t=A(za);return e.useEffect(t.mount,[]),t}const Wa=Na;class Ha{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 Ha;function Ya(){return Xa}function Xa(t){ws.current&&(ws.current.isUpdating=!1,ws.current.blockUpdate(),t&&t())}const Ga=()=>({}),qa=oi({build(){},measureViewportBox:Rr,resetTransform(){},restoreTransform(){},removeValueFromRenderState(){},render(){},scrapeMotionValuesFromProps:Ga,readValueFromInstance:(t,e,n)=>n.initialState[e]||0,makeTargetAnimatable:(t,{transition:e,transitionEnd:n,...o})=>(Zo(t,o,_o(o,e||{},t)),{transition:e,transitionEnd:n,...o})}),Za=Qt({scrapeMotionValuesFromProps:Ga,createRenderState:Ga});const Ka=t=>t>.001?1/t:1e5;t.AnimatePresence=({children:t,custom:n,initial:o=!0,onExitComplete:r,exitBeforeEnter:s,presenceAffectsLayout:a=!0,mode:l="sync"})=>{s&&(l="wait",Qn(!1,"Replace exitBeforeEnter with mode='wait'"));let[u]=Cs();const c=e.useContext(C).forceRender;c&&(u=c);const h=Ts(),f=function(t){const n=[];return e.Children.forEach(t,t=>{e.isValidElement(t)&&n.push(t)}),n}(t);let p=f;const m=new Set,g=e.useRef(p),v=e.useRef(new Map).current,y=e.useRef(!0);if(d(()=>{y.current=!1,function(t,e){t.forEach(t=>{const n=Os(t);e.set(n,t)})}(f,v),g.current=p}),Te(()=>{y.current=!0,v.clear(),m.clear()}),y.current)return i.createElement(i.Fragment,null,p.map(t=>i.createElement(Rs,{key:Os(t),isPresent:!0,initial:!!o&&void 0,presenceAffectsLayout:a,mode:l},t)));p=[...p];const x=g.current.map(Os),b=f.map(Os),w=x.length;for(let t=0;t<w;t++){const e=x[t];-1===b.indexOf(e)&&m.add(e)}return"wait"===l&&m.size&&(p=[]),m.forEach(t=>{if(-1!==b.indexOf(t))return;const e=v.get(t);if(!e)return;const o=x.indexOf(t);p.splice(o,0,i.createElement(Rs,{key:Os(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=f,!1===h.current)return;u(),r&&r()}},custom:n,presenceAffectsLayout:a,mode:l},e))}),p=p.map(t=>{const e=t.key;return m.has(e)?t:i.createElement(Rs,{key:Os(t),isPresent:!0,presenceAffectsLayout:a,mode:l},t)}),"production"!==_n&&"wait"===l&&p.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.'),i.createElement(i.Fragment,null,m.size?p:p.map(t=>e.cloneElement(t)))},t.AnimateSharedLayout=({children:t})=>(i.useEffect(()=>{},[]),i.createElement(Is,{id:A(()=>"asl-"+Bs++)},t)),t.DeprecatedLayoutGroupContext=ks,t.DragControls=Ha,t.FlatTree=ts,t.LayoutGroup=Is,t.LayoutGroupContext=C,t.LazyMotion=function({children:t,features:n,strict:o=!1}){const[,r]=e.useState(!Us(n)),s=e.useRef(void 0);if(!Us(n)){const{renderer:t,...e}=n;s.current=t,S(e)}return e.useEffect(()=>{Us(n)&&n().then(({renderer:t,...e})=>{S(e),s.current=t,r(!0)})},[]),i.createElement(h.Provider,{value:{renderer:s.current,strict:o}},t)},t.MotionConfig=function({children:t,isValidProp:n,...o}){n&&Dt(n),(o={...e.useContext(s),...o}).isStatic=A(()=>o.isStatic);const r=e.useMemo(()=>o,[JSON.stringify(o.transition),o.transformPagePoint,o.reducedMotion]);return i.createElement(s.Provider,{value:r},t)},t.MotionConfigContext=s,t.MotionContext=a,t.MotionValue=Bo,t.PresenceContext=u,t.Reorder=Ks,t.SwitchLayoutGroupContext=M,t.addPointerEvent=ve,t.addScaleCorrector=F,t.animate=Oi,t.animateVisualElement=Qo,t.animationControls=za,t.animations=cr,t.calcLength=yr,t.checkTargetForNewValues=Zo,t.createBox=Rr,t.createDomMotionComponent=function(t){return R(oe(t,{forwardMotionProps:!1},Ss,Pi,Es))},t.createMotionComponent=R,t.domAnimation=_s,t.domMax=Js,t.filterProps=jt,t.isBrowser=c,t.isDragActive=Se,t.isMotionValue=z,t.isValidMotionProp=Ot,t.m=Ps,t.makeUseVisualState=Qt,t.motion=As,t.motionValue=Uo,t.resolveMotionValue=Jt,t.transform=Ys,t.useAnimation=Wa,t.useAnimationControls=Na,t.useAnimationFrame=Ia,t.useCycle=function(...t){const n=e.useRef(0),[o,r]=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,r(t[n.current])},[t.length,...t])]},t.useDeprecatedAnimatedState=function(t){const[n,o]=e.useState(t),r=Za({},!1),i=A(()=>qa({props:{},visualState:r},{initialState:t}));return e.useEffect(()=>(i.mount({}),i.unmount),[i]),e.useEffect(()=>{i.setProps({onUpdate:t=>{o({...t})}})},[o,i]),[n,A(()=>t=>Qo(i,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:Gs(e,Ka),scaleY:Gs(n,Ka)}},t.useDomEvent=se,t.useDragControls=function(){return A($a)},t.useElementScroll=function(t){return Qn(!1,"useElementScroll is deprecated. Convert to useScroll({ container: ref })."),Fa({container:t})},t.useForceUpdate=Cs,t.useInView=function(t,{root:n,margin:o,amount:r,once:i=!1}={}){const[s,a]=e.useState(!1);return e.useEffect(()=>{if(!t.current||i&&s)return;const e={root:n&&n.current||void 0,margin:o,amount:"some"===r?"any":r};return function(t,e,{root:n,margin:o,amount:r="any"}={}){if("undefined"==typeof IntersectionObserver)return()=>{};const i=ua(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);aa(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 r?r:ca[r]});return i.forEach(t=>a.observe(t)),()=>a.disconnect()}(t.current,()=>(a(!0),i?void 0:()=>a(!1)),e)},[n,t,o,i]),s},t.useInstantLayoutTransition=Ya,t.useInstantTransition=function(){const[t,n]=Cs(),o=Ya();return e.useEffect(()=>{Rn.postRender(()=>Rn.postRender(()=>To.current=!1))},[n]),e=>{o(()=>{To.current=!0,t(),e()})}},t.useIsPresent=function(){return null===(t=e.useContext(u))||t.isPresent;var t},t.useIsomorphicLayoutEffect=d,t.useMotionTemplate=function(t,...e){const n=t.length;return Xs(e,(function(){let o="";for(let r=0;r<n;r++){o+=t[r];e[r]&&(o+=e[r].get())}return o}))},t.useMotionValue=$s,t.usePresence=co,t.useReducedMotion=Ua,t.useReducedMotionConfig=function(){const t=Ua(),{reducedMotion:n}=e.useContext(s);return"never"!==n&&("always"===n||t)},t.useResetProjection=function(){return i.useCallback(()=>{const t=ws.current;t&&t.resetTree()},[])},t.useScroll=Fa,t.useSpring=function(t,n={}){const{isStatic:o}=e.useContext(s),r=e.useRef(null),i=$s(z(t)?t.get():t);return e.useMemo(()=>i.attach((t,e)=>o?e(t):(r.current&&r.current.stop(),r.current=Un({from:i.get(),to:t,velocity:i.getVelocity(),...n,onUpdate:e}),i.get())),[JSON.stringify(n)]),function(t,e){d(()=>{if(z(t))return t.onChange(e)},[e])}(t,t=>i.set(parseFloat(t))),i},t.useTime=function(){const t=$s(0);return Ia(e=>t.set(e)),t},t.useTransform=Gs,t.useUnmountEffect=Te,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 Qn(!1,"useViewportScroll is deprecated. Convert to useScroll()."),Fa()},t.useVisualElementContext=l,t.useWillChange=function(){return A(()=>new Ba("auto"))},t.visualElement=oi,t.wrapHandler=fe,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 r=n(e),i=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,d=c?e.useLayoutEffect:e.useEffect,h=e.createContext({strict:!1});function f(t){return"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}function m(t){return"string"==typeof t||Array.isArray(t)}function p(t){return"object"==typeof t&&"function"==typeof t.start}const g=["initial","animate","exit","whileHover","whileDrag","whileTap","whileFocus","whileInView"];function y(t){return p(t.animate)||g.some(e=>m(t[e]))}function v(t){return Boolean(y(t)||t.variants)}function x(t){const{initial:n,animate:o}=function(t,e){if(y(t)){const{initial:e,animate:n}=t;return{initial:!1===e||m(e)?e:void 0,animate:m(n)?n:void 0}}return!1!==t.inherit?e:{}}(t,e.useContext(a));return e.useMemo(()=>({initial:n,animate:o}),[b(n),b(o)])}function b(t){return Array.isArray(t)?t.join(" "):t}const w=t=>({isEnabled:e=>t.some(t=>!!e[t])}),E={measureLayout:w(["layout","layoutId","drag"]),animation:w(["animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView"]),exit:w(["exit"]),drag:w(["drag","dragControls"]),focus:w(["whileFocus"]),hover:w(["whileHover","onHoverStart","onHoverEnd"]),tap:w(["whileTap","onTap","onTapStart","onTapCancel"]),pan:w(["onPan","onPanStart","onPanSessionStart","onPanEnd"]),inView:w(["whileInView","onViewportEnter","onViewportLeave"])};function S(t){for(const e in t)"projectionNodeConstructor"===e?E.projectionNodeConstructor=t[e]:E[e].Component=t[e]}function A(t){const n=e.useRef(null);return null===n.current&&(n.current=t()),n.current}const P={hasAnimatedSinceResize:!0,hasEverUpdated:!1};let T=1;const C=e.createContext({});class V extends r.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:r,useVisualState:m,Component:p}){t&&S(t);const g=e.forwardRef((function(g,y){const v={...e.useContext(s),...g,layoutId:O(g)},{isStatic:b}=v;let w=null;const S=x(g),C=b?void 0:A(()=>{if(P.hasEverUpdated)return T++}),R=m(g,b);if(!b&&c){S.visualElement=function(t,n,o,r){const i=l(),a=e.useContext(h),c=e.useContext(u),f=e.useContext(s).reducedMotion,m=e.useRef(void 0);r=r||a.renderer,!m.current&&r&&(m.current=r(t,{visualState:n,parent:i,props:o,presenceId:c?c.id:void 0,blockInitialAnimation:!!c&&!1===c.initial,reducedMotionConfig:f}));const p=m.current;return d(()=>{p&&p.syncRender()}),e.useEffect(()=>{p&&p.animationState&&p.animationState.animateChanges()}),d(()=>()=>p&&p.notifyUnmount(),[]),p}(p,R,v,n);const r=e.useContext(h).strict,i=e.useContext(M);S.visualElement&&(w=S.visualElement.loadFeatures(g,r,t,C,o||E.projectionNodeConstructor,i))}return i.createElement(V,{visualElement:S.visualElement,props:v},w,i.createElement(a.Provider,{value:S},r(p,g,C,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):f(o)&&(o.current=e))},[n])}(R,S.visualElement,y),R,b,S.visualElement)))}));return g[R]=p,g}function O({layoutId:t}){const n=e.useContext(C).id;return n&&void 0!==t?n+"-"+t:t}function k(t){function e(e,n={}){return L(t(e,n))}if("undefined"==typeof Proxy)return e;const n=new Map;return new Proxy(e,{get:(t,o)=>(n.has(o)||n.set(o,e(o)),n.get(o))})}const D=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","svg","switch","symbol","text","tspan","use","view"];function j(t){return"string"==typeof t&&!t.includes("-")&&!!(D.indexOf(t)>-1||/[A-Z]/.test(t))}const F={};function I(t){Object.assign(F,t)}const B=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],U=new Set(B);function z(t,{layout:e,layoutId:n}){return U.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!F[t]||"opacity"===t)}const N=t=>void 0!==t&&!!t.getVelocity,W={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},H=(t,e)=>B.indexOf(t)-B.indexOf(e);function $(t){return t.startsWith("--")}const Y=(t,e)=>e&&"number"==typeof t?e.transform(t):t,X=(t,e)=>n=>Math.max(Math.min(n,e),t),G=t=>t%1?Number(t.toFixed(5)):t,q=/(-)?([\d]*\.?[\d])+/g,Z=/(#[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,K=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function _(t){return"string"==typeof t}const J={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},Q=Object.assign(Object.assign({},J),{transform:X(0,1)}),tt=Object.assign(Object.assign({},J),{default:1}),et=t=>({test:e=>_(e)&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),nt=et("deg"),ot=et("%"),rt=et("px"),it=et("vh"),st=et("vw"),at=Object.assign(Object.assign({},ot),{parse:t=>ot.parse(t)/100,transform:t=>ot.transform(100*t)}),lt=(t,e)=>n=>Boolean(_(n)&&K.test(n)&&n.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(n,e)),ut=(t,e,n)=>o=>{if(!_(o))return o;const[r,i,s,a]=o.match(q);return{[t]:parseFloat(r),[e]:parseFloat(i),[n]:parseFloat(s),alpha:void 0!==a?parseFloat(a):1}},ct={test:lt("hsl","hue"),parse:ut("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:o=1})=>"hsla("+Math.round(t)+", "+ot.transform(G(e))+", "+ot.transform(G(n))+", "+G(Q.transform(o))+")"},dt=X(0,255),ht=Object.assign(Object.assign({},J),{transform:t=>Math.round(dt(t))}),ft={test:lt("rgb","red"),parse:ut("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:o=1})=>"rgba("+ht.transform(t)+", "+ht.transform(e)+", "+ht.transform(n)+", "+G(Q.transform(o))+")"};const mt={test:lt("#"),parse:function(t){let e="",n="",o="",r="";return t.length>5?(e=t.substr(1,2),n=t.substr(3,2),o=t.substr(5,2),r=t.substr(7,2)):(e=t.substr(1,1),n=t.substr(2,1),o=t.substr(3,1),r=t.substr(4,1),e+=e,n+=n,o+=o,r+=r),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(o,16),alpha:r?parseInt(r,16)/255:1}},transform:ft.transform},pt={test:t=>ft.test(t)||mt.test(t)||ct.test(t),parse:t=>ft.test(t)?ft.parse(t):ct.test(t)?ct.parse(t):mt.parse(t),transform:t=>_(t)?t:t.hasOwnProperty("red")?ft.transform(t):ct.transform(t)};function gt(t){"number"==typeof t&&(t=""+t);const e=[];let n=0;const o=t.match(Z);o&&(n=o.length,t=t.replace(Z,"${c}"),e.push(...o.map(pt.parse)));const r=t.match(q);return r&&(t=t.replace(q,"${n}"),e.push(...r.map(J.parse))),{values:e,numColors:n,tokenised:t}}function yt(t){return gt(t).values}function vt(t){const{values:e,numColors:n,tokenised:o}=gt(t),r=e.length;return t=>{let e=o;for(let o=0;o<r;o++)e=e.replace(o<n?"${c}":"${n}",o<n?pt.transform(t[o]):G(t[o]));return e}}const xt=t=>"number"==typeof t?0:t;const bt={test:function(t){var e,n,o,r;return isNaN(t)&&_(t)&&(null!==(n=null===(e=t.match(q))||void 0===e?void 0:e.length)&&void 0!==n?n:0)+(null!==(r=null===(o=t.match(Z))||void 0===o?void 0:o.length)&&void 0!==r?r:0)>0},parse:yt,createTransformer:vt,getAnimatableNone:function(t){const e=yt(t);return vt(t)(e.map(xt))}},wt=new Set(["brightness","contrast","saturate","opacity"]);function Et(t){let[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[o]=n.match(q)||[];if(!o)return t;const r=n.replace(o,"");let i=wt.has(e)?1:0;return o!==n&&(i*=100),e+"("+i+r+")"}const St=/([a-z-]*)\(.*?\)/g,At=Object.assign(Object.assign({},bt),{getAnimatableNone:t=>{const e=t.match(St);return e?e.map(Et).join(" "):t}}),Pt={...J,transform:Math.round},Tt={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:nt,rotateX:nt,rotateY:nt,rotateZ:nt,scale:tt,scaleX:tt,scaleY:tt,scaleZ:tt,skew:nt,skewX:nt,skewY:nt,distance:rt,translateX:rt,translateY:rt,translateZ:rt,x:rt,y:rt,z:rt,perspective:rt,transformPerspective:rt,opacity:Q,originX:at,originY:at,originZ:rt,zIndex:Pt,fillOpacity:Q,strokeOpacity:Q,numOctaves:Pt};function Ct(t,e,n,o){const{style:r,vars:i,transform:s,transformKeys:a,transformOrigin:l}=t;a.length=0;let u=!1,c=!1,d=!0;for(const t in e){const n=e[t];if($(t)){i[t]=n;continue}const o=Tt[t],h=Y(n,o);if(U.has(t)){if(u=!0,s[t]=h,a.push(t),!d)continue;n!==(o.default||0)&&(d=!1)}else t.startsWith("origin")?(c=!0,l[t]=h):r[t]=h}if(u||o?r.transform=function({transform:t,transformKeys:e},{enableHardwareAcceleration:n=!0,allowTransformNone:o=!0},r,i){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(),i?s=i(t,r?"":s):o&&r&&(s="none"),s}(t,n,d,o):!e.transform&&r.transform&&(r.transform="none"),c){const{originX:t="50%",originY:e="50%",originZ:n=0}=l;r.transformOrigin=`${t} ${e} ${n}`}}const Vt=()=>({style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}});function Mt(t,e,n){for(const o in e)N(e[o])||z(o,n)||(t[o]=e[o])}function Rt(t,n,o){const r={};return Mt(r,t.style||{},t),Object.assign(r,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(r):r}function Lt(t,e,n){const o={},r=Rt(t,e,n);return t.drag&&!1!==t.dragListener&&(o.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=!0===t.drag?"none":"pan-"+("x"===t.drag?"y":"x")),o.style=r,o}const Ot=new Set(["initial","style","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 kt(t){return Ot.has(t)}let Dt=t=>!kt(t);function jt(t){t&&(Dt=e=>e.startsWith("on")?!kt(e):t(e))}try{jt(require("@emotion/is-prop-valid").default)}catch(t){}function Ft(t,e,n){const o={};for(const r in t)(Dt(r)||!0===n&&kt(r)||!e&&!kt(r)||t.draggable&&r.startsWith("onDrag"))&&(o[r]=t[r]);return o}function It(t,e,n){return"string"==typeof t?t:rt.transform(e+n*t)}const Bt={offset:"stroke-dashoffset",array:"stroke-dasharray"},Ut={offset:"strokeDashoffset",array:"strokeDasharray"};function zt(t,{attrX:e,attrY:n,originX:o,originY:r,pathLength:i,pathSpacing:s=1,pathOffset:a=0,...l},u,c){Ct(t,l,u,c),t.attrs=t.style,t.style={};const{attrs:d,style:h,dimensions:f}=t;d.transform&&(f&&(h.transform=d.transform),delete d.transform),f&&(void 0!==o||void 0!==r||h.transform)&&(h.transformOrigin=function(t,e,n){return`${It(e,t.x,t.width)} ${It(n,t.y,t.height)}`}(f,void 0!==o?o:.5,void 0!==r?r:.5)),void 0!==e&&(d.x=e),void 0!==n&&(d.y=n),void 0!==i&&function(t,e,n=1,o=0,r=!0){t.pathLength=1;const i=r?Bt:Ut;t[i.offset]=rt.transform(-o);const s=rt.transform(e),a=rt.transform(n);t[i.array]=`${s} ${a}`}(d,i,s,a,!1)}const Nt=()=>({style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{},attrs:{}});function Wt(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={};Mt(e,t.style,t),o.style={...e,...o.style}}return o}function Ht(t=!1){return(n,o,r,i,{latestValues:s},a)=>{const l=(j(n)?Wt:Lt)(o,s,a),u={...Ft(o,"string"==typeof n,t),...l,ref:i};return r&&(u["data-projection-id"]=r),e.createElement(n,u)}}const $t=t=>t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();function Yt(t,{style:e,vars:n},o,r){Object.assign(t.style,e,r&&r.getProjectionStyles(o));for(const e in n)t.style.setProperty(e,n[e])}const Xt=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength"]);function Gt(t,e,n,o){Yt(t,e,void 0,o);for(const n in e.attrs)t.setAttribute(Xt.has(n)?n:$t(n),e.attrs[n])}function qt(t){const{style:e}=t,n={};for(const o in e)(N(e[o])||z(o,t))&&(n[o]=e[o]);return n}function Zt(t){const e=qt(t);for(const n in t)if(N(t[n])){e["x"===n||"y"===n?"attr"+n.toUpperCase():n]=t[n]}return e}function Kt(t,e,n,o={},r={}){return"function"==typeof e&&(e=e(void 0!==n?n:t.custom,o,r)),"string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e&&(e=e(void 0!==n?n:t.custom,o,r)),e}const _t=t=>Array.isArray(t),Jt=t=>_t(t)?t[t.length-1]||0:t;function Qt(t){const e=N(t)?t.get():t;return n=e,Boolean(n&&"object"==typeof n&&n.mix&&n.toValue)?e.toValue():e;var n}const te=t=>(n,o)=>{const r=e.useContext(a),i=e.useContext(u),s=()=>function({scrapeMotionValuesFromProps:t,createRenderState:e,onMount:n},o,r,i){const s={latestValues:ee(o,r,i,t),renderState:e()};return n&&(s.mount=t=>n(o,t,s)),s}(t,n,r,i);return o?s():A(s)};function ee(t,e,n,o){const r={},i=o(t);for(const t in i)r[t]=Qt(i[t]);let{initial:s,animate:a}=t;const l=y(t),u=v(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 d=c?a:s;if(d&&"boolean"!=typeof d&&!p(d)){(Array.isArray(d)?d:[d]).forEach(e=>{const n=Kt(t,e);if(!n)return;const{transitionEnd:o,transition:i,...s}=n;for(const t in s){let e=s[t];if(Array.isArray(e)){e=e[c?e.length-1:0]}null!==e&&(r[t]=e)}for(const t in o)r[t]=o[t]})}return r}const ne={useVisualState:te({scrapeMotionValuesFromProps:Zt,createRenderState:Nt,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),Gt(e,n)}})},oe={useVisualState:te({scrapeMotionValuesFromProps:qt,createRenderState:Vt})};function re(t,{forwardMotionProps:e=!1},n,o,r){return{...j(t)?ne:oe,preloadedFeatures:n,useRender:Ht(e),createVisualElement:o,projectionNodeConstructor:r,Component:t}}var ie;function se(t,e,n,o={passive:!0}){return t.addEventListener(e,n,o),()=>t.removeEventListener(e,n)}function ae(t,n,o,r){e.useEffect(()=>{const e=t.current;if(o&&e)return se(e,n,o,r)},[t,n,o,r])}function le(t){return"undefined"!=typeof PointerEvent&&t instanceof PointerEvent?!("mouse"!==t.pointerType):t instanceof MouseEvent}function ue(t){return!!t.touches}t.AnimationType=void 0,(ie=t.AnimationType||(t.AnimationType={})).Animate="animate",ie.Hover="whileHover",ie.Tap="whileTap",ie.Drag="whileDrag",ie.Focus="whileFocus",ie.InView="whileInView",ie.Exit="exit";const ce={pageX:0,pageY:0};function de(t,e="page"){const n=t.touches[0]||t.changedTouches[0]||ce;return{x:n[e+"X"],y:n[e+"Y"]}}function he(t,e="page"){return{x:t[e+"X"],y:t[e+"Y"]}}function fe(t,e="page"){return{point:ue(t)?de(t,e):he(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},pe={pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointercancel:"mousecancel",pointerover:"mouseover",pointerout:"mouseout",pointerenter:"mouseenter",pointerleave:"mouseleave"},ge={pointerdown:"touchstart",pointermove:"touchmove",pointerup:"touchend",pointercancel:"touchcancel"};function ye(t){return c&&null===window.onpointerdown?t:c&&null===window.ontouchstart?ge[t]:c&&null===window.onmousedown?pe[t]:t}function ve(t,e,n,o){return se(t,ye(e),me(n,"pointerdown"===e),o)}function xe(t,e,n,o){return ae(t,ye(e),n&&me(n,"pointerdown"===e),o)}function be(t){let e=null;return()=>{const n=()=>{e=null};return null===e&&(e=t,n)}}const we=be("dragHorizontal"),Ee=be("dragVertical");function Se(t){let e=!1;if("y"===t)e=Ee();else if("x"===t)e=we();else{const t=we(),n=Ee();t&&n?e=()=>{t(),n()}:(t&&t(),n&&n())}return e}function Ae(){const t=Se(!0);return!t||(t(),!1)}function Pe(e,n,o){return(r,i)=>{le(r)&&!Ae()&&(e.animationState&&e.animationState.setActive(t.AnimationType.Hover,n),o&&o(r,i))}}const Te=(t,e)=>!!e&&(t===e||Te(t,e.parentElement));function Ce(t){return e.useEffect(()=>()=>t(),[])}function Ve(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 r=0;for(o=Object.getOwnPropertySymbols(t);r<o.length;r++)e.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(t,o[r])&&(n[o[r]]=t[o[r]])}return n}const Me=(t,e,n)=>Math.min(Math.max(n,t),e);function Re({duration:t=800,bounce:e=.25,velocity:n=0,mass:o=1}){let r,i,s=1-e;s=Me(.05,1,s),t=Me(.01,10,t/1e3),s<1?(r=e=>{const o=e*s,r=o*t;return.001-(o-n)/Le(e,s)*Math.exp(-r)},i=e=>{const o=e*s*t,i=o*n+n,a=Math.pow(s,2)*Math.pow(e,2)*t,l=Math.exp(-o),u=Le(Math.pow(e,2),s);return(.001-r(e)>0?-1:1)*((i-a)*l)/u}):(r=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,i=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}(r,i,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 Le(t,e){return t*Math.sqrt(1-e*e)}const Oe=["duration","bounce"],ke=["stiffness","damping","mass"];function De(t,e){return e.some(e=>void 0!==t[e])}function je(t){var{from:e=0,to:n=1,restSpeed:o=2,restDelta:r}=t,i=Ve(t,["from","to","restSpeed","restDelta"]);const s={done:!1,value:e};let{stiffness:a,damping:l,mass:u,velocity:c,duration:d,isResolvedFromDuration:h}=function(t){let e=Object.assign({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},t);if(!De(t,ke)&&De(t,Oe)){const n=Re(t);e=Object.assign(Object.assign(Object.assign({},e),n),{velocity:0,mass:1}),e.isResolvedFromDuration=!0}return e}(i),f=Fe,m=Fe;function p(){const t=c?-c/1e3:0,o=n-e,i=l/(2*Math.sqrt(a*u)),s=Math.sqrt(a/u)/1e3;if(void 0===r&&(r=Math.min(Math.abs(n-e)/100,.4)),i<1){const e=Le(s,i);f=r=>{const a=Math.exp(-i*s*r);return n-a*((t+i*s*o)/e*Math.sin(e*r)+o*Math.cos(e*r))},m=n=>{const r=Math.exp(-i*s*n);return i*s*r*(Math.sin(e*n)*(t+i*s*o)/e+o*Math.cos(e*n))-r*(Math.cos(e*n)*(t+i*s*o)-e*o*Math.sin(e*n))}}else if(1===i)f=e=>n-Math.exp(-s*e)*(o+(t+s*o)*e);else{const e=s*Math.sqrt(i*i-1);f=r=>{const a=Math.exp(-i*s*r),l=Math.min(e*r,300);return n-a*((t+i*s*o)*Math.sinh(l)+e*o*Math.cosh(l))/e}}}return p(),{next:t=>{const e=f(t);if(h)s.done=t>=d;else{const i=1e3*m(t),a=Math.abs(i)<=o,l=Math.abs(n-e)<=r;s.done=a&&l}return s.value=s.done?n:e,s},flipTarget:()=>{c=-c,[e,n]=[n,e],p()}}}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},Be=(t,e,n)=>-n*t+n*e+t;function Ue(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 r=0,i=0,s=0;if(e/=100){const o=n<.5?n*(1+e):n+e-n*e,a=2*n-o;r=Ue(a,o,t+1/3),i=Ue(a,o,t),s=Ue(a,o,t-1/3)}else r=i=s=n;return{red:Math.round(255*r),green:Math.round(255*i),blue:Math.round(255*s),alpha:o}}const Ne=(t,e,n)=>{const o=t*t,r=e*e;return Math.sqrt(Math.max(0,n*(r-o)+o))},We=[mt,ft,ct],He=t=>We.find(e=>e.test(t)),$e=(t,e)=>{let n=He(t),o=He(e),r=n.parse(t),i=o.parse(e);n===ct&&(r=ze(r),n=ft),o===ct&&(i=ze(i),o=ft);const s=Object.assign({},r);return t=>{for(const e in s)"alpha"!==e&&(s[e]=Ne(r[e],i[e],t));return s.alpha=Be(r.alpha,i.alpha,t),n.transform(s)}},Ye=t=>"number"==typeof t,Xe=(t,e)=>n=>e(t(n)),Ge=(...t)=>t.reduce(Xe);function qe(t,e){return Ye(t)?n=>Be(t,e,n):pt.test(t)?$e(t,e):Je(t,e)}const Ze=(t,e)=>{const n=[...t],o=n.length,r=t.map((t,n)=>qe(t,e[n]));return t=>{for(let e=0;e<o;e++)n[e]=r[e](t);return n}},Ke=(t,e)=>{const n=Object.assign(Object.assign({},t),e),o={};for(const r in n)void 0!==t[r]&&void 0!==e[r]&&(o[r]=qe(t[r],e[r]));return t=>{for(const e in o)n[e]=o[e](t);return n}};function _e(t){const e=bt.parse(t),n=e.length;let o=0,r=0,i=0;for(let t=0;t<n;t++)o||"number"==typeof e[t]?o++:void 0!==e[t].hue?i++:r++;return{parsed:e,numNumbers:o,numRGB:r,numHSL:i}}const Je=(t,e)=>{const n=bt.createTransformer(e),o=_e(t),r=_e(e);return o.numHSL===r.numHSL&&o.numRGB===r.numRGB&&o.numNumbers>=r.numNumbers?Ge(Ze(o.parsed,r.parsed),n):n=>""+(n>0?e:t)},Qe=(t,e)=>n=>Be(t,e,n);function tn(t,e,n){const o=[],r=n||("number"==typeof(i=t[0])?Qe:"string"==typeof i?pt.test(i)?$e:Je:Array.isArray(i)?Ze:"object"==typeof i?Ke:void 0);var i;const s=t.length-1;for(let n=0;n<s;n++){let i=r(t[n],t[n+1]);if(e){const t=Array.isArray(e)?e[n]:e;i=Ge(t,i)}o.push(i)}return o}function en(t,e,{clamp:n=!0,ease:o,mixer:r}={}){const i=t.length;e.length,!o||!Array.isArray(o)||o.length,t[0]>t[i-1]&&(t=[].concat(t),e=[].concat(e),t.reverse(),e.reverse());const s=tn(e,o,r),a=2===i?function([t,e],[n]){return o=>n(Ie(t,e,o))}(t,s):function(t,e){const n=t.length,o=n-1;return r=>{let i=0,s=!1;if(r<=t[0]?s=!0:r>=t[o]&&(i=o-1,s=!0),!s){let e=1;for(;e<n&&!(t[e]>r||e===o);e++);i=e-1}const a=Ie(t[i],t[i+1],r);return e[i](a)}}(t,s);return n?e=>a(Me(t[0],t[i-1],e)):a}const nn=t=>e=>1-t(1-e),on=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,rn=t=>e=>e*e*((t+1)*e-t),sn=t=>t,an=(ln=2,t=>Math.pow(t,ln));var ln;const un=nn(an),cn=on(an),dn=t=>1-Math.sin(Math.acos(t)),hn=nn(dn),fn=on(hn),mn=rn(1.525),pn=nn(mn),gn=on(mn),yn=(t=>{const e=rn(t);return t=>(t*=2)<1?.5*e(t):.5*(2-Math.pow(2,-10*(t-1)))})(1.525),vn=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},xn=nn(vn);function bn(t,e){return t.map(()=>e||cn).splice(0,t.length-1)}function wn({from:t=0,to:e=1,ease:n,offset:o,duration:r=300}){const i={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),r);function l(){return en(a,s,{ease:Array.isArray(n)?n:bn(s,n)})}let u=l();return{next:t=>(i.value=u(t),i.done=t>=r,i),flipTarget:()=>{s.reverse(),u=l()}}}const En={keyframes:wn,spring:je,decay:function({velocity:t=0,from:e=0,power:n=.8,timeConstant:o=350,restDelta:r=.5,modifyTarget:i}){const s={done:!1,value:e};let a=n*t;const l=e+a,u=void 0===i?l:i(l);return u!==l&&(a=u-e),{next:t=>{const e=-a*Math.exp(-t/o);return s.done=!(e>r||e<-r),s.value=s.done?u:u+e,s},flipTarget:()=>{}}}};const Sn="undefined"!=typeof performance?()=>performance.now():()=>Date.now(),An="undefined"!=typeof window?t=>window.requestAnimationFrame(t):t=>setTimeout(()=>t(Sn()),1/60*1e3);let Pn=!0,Tn=!1,Cn=!1;const Vn={delta:0,timestamp:0},Mn=["read","update","preRender","render","postRender"],Rn=Mn.reduce((t,e)=>(t[e]=function(t){let e=[],n=[],o=0,r=!1,i=!1;const s=new WeakSet,a={schedule:(t,i=!1,a=!1)=>{const l=a&&r,u=l?e:n;return i&&s.add(t),-1===u.indexOf(t)&&(u.push(t),l&&r&&(o=e.length)),t},cancel:t=>{const e=n.indexOf(t);-1!==e&&n.splice(e,1),s.delete(t)},process:l=>{if(r)i=!0;else{if(r=!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())}r=!1,i&&(i=!1,a.process(l))}}};return a}(()=>Tn=!0),t),{}),Ln=Mn.reduce((t,e)=>{const n=Rn[e];return t[e]=(t,e=!1,o=!1)=>(Tn||Fn(),n.schedule(t,e,o)),t},{}),On=Mn.reduce((t,e)=>(t[e]=Rn[e].cancel,t),{}),kn=Mn.reduce((t,e)=>(t[e]=()=>Rn[e].process(Vn),t),{}),Dn=t=>Rn[t].process(Vn),jn=t=>{Tn=!1,Vn.delta=Pn?1/60*1e3:Math.max(Math.min(t-Vn.timestamp,40),1),Vn.timestamp=t,Cn=!0,Mn.forEach(Dn),Cn=!1,Tn&&(Pn=!1,An(jn))},Fn=()=>{Tn=!0,Pn=!0,Cn||An(jn)},In=()=>Vn;function Bn(t,e,n=0){return t-e-n}const Un=t=>{const e=({delta:e})=>t(e);return{start:()=>Ln.update(e,!0),stop:()=>On.update(e)}};function zn(t){var e,n,{from:o,autoplay:r=!0,driver:i=Un,elapsed:s=0,repeat:a=0,repeatType:l="loop",repeatDelay:u=0,onPlay:c,onStop:d,onComplete:h,onRepeat:f,onUpdate:m}=t,p=Ve(t,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]);let g,y,v,{to:x}=p,b=0,w=p.duration,E=!1,S=!0;const A=function(t){if(Array.isArray(t.to))return wn;if(En[t.type])return En[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}(p);(null===(n=(e=A).needsInterpolation)||void 0===n?void 0:n.call(e,o,x))&&(v=en([0,100],[o,x],{clamp:!1}),o=0,x=100);const P=A(Object.assign(Object.assign({},p),{from:o,to:x}));function T(){b++,"reverse"===l?(S=b%2==0,s=function(t,e,n=0,o=!0){return o?Bn(e+-t,e,n):e-(t-e)+n}(s,w,u,S)):(s=Bn(s,w,u),"mirror"===l&&P.flipTarget()),E=!1,f&&f()}function C(t){if(S||(t=-t),s+=t,!E){const t=P.next(Math.max(0,s));y=t.value,v&&(y=v(y)),E=S?t.done:s<=0}null==m||m(y),E&&(0===b&&(null!=w||(w=s)),b<a?function(t,e,n,o){return o?t>=e+n:t<=-n}(s,w,u,S)&&T():(g.stop(),h&&h()))}return r&&(null==c||c(),g=i(C),g.start()),{stop:()=>{null==d||d(),g.stop()}}}function Nn(t,e){return e?t*(1e3/e):0}const Wn=t=>t.hasOwnProperty("x")&&t.hasOwnProperty("y"),Hn=t=>Wn(t)&&t.hasOwnProperty("z"),$n=(t,e)=>Math.abs(t-e);function Yn(t,e){if(Ye(t)&&Ye(e))return $n(t,e);if(Wn(t)&&Wn(e)){const n=$n(t.x,e.x),o=$n(t.y,e.y),r=Hn(t)&&Hn(e)?$n(t.z,e.z):0;return Math.sqrt(Math.pow(n,2)+Math.pow(o,2)+Math.pow(r,2))}}const Xn=(t,e)=>1-3*e+3*t,Gn=(t,e)=>3*e-6*t,qn=t=>3*t,Zn=(t,e,n)=>((Xn(e,n)*t+Gn(e,n))*t+qn(e))*t,Kn=(t,e,n)=>3*Xn(e,n)*t*t+2*Gn(e,n)*t+qn(e);function _n(t,e,n,o){if(t===e&&n===o)return sn;const r=new Float32Array(11);for(let e=0;e<11;++e)r[e]=Zn(.1*e,t,n);function i(e){let o=0,i=1;for(;10!==i&&r[i]<=e;++i)o+=.1;--i;const s=o+.1*((e-r[i])/(r[i+1]-r[i])),a=Kn(s,t,n);return a>=.001?function(t,e,n,o){for(let r=0;r<8;++r){const r=Kn(e,n,o);if(0===r)return e;e-=(Zn(e,n,o)-t)/r}return e}(e,s,t,n):0===a?s:function(t,e,n,o,r){let i,s,a=0;do{s=e+(n-e)/2,i=Zn(s,o,r)-t,i>0?n=s:e=s}while(Math.abs(i)>1e-7&&++a<10);return s}(e,o,o+.1,t,n)}return t=>0===t||1===t?t:Zn(i(t),e,o)}const Jn=("undefined"==typeof process||process.env,"production"),Qn=new Set;function to(t,e,n){t||Qn.has(e)||(console.warn(e),n&&console.warn(n),Qn.add(e))}const eo=new WeakMap,no=new WeakMap,oo=t=>{const e=eo.get(t.target);e&&e(t)},ro=t=>{t.forEach(oo)};function io(t,e,n){const o=function({root:t,...e}){const n=t||document;no.has(n)||no.set(n,{});const o=no.get(n),r=JSON.stringify(e);return o[r]||(o[r]=new IntersectionObserver(ro,{root:t,...e})),o[r]}(e);return eo.set(t,n),o.observe(t),()=>{eo.delete(t),o.unobserve(t)}}const so={some:0,all:1};function ao(n,o,r,{root:i,margin:s,amount:a="some",once:l}){e.useEffect(()=>{if(!n)return;const e={root:null==i?void 0:i.current,rootMargin:s,threshold:"number"==typeof a?a:so[a]};return io(r.getInstance(),e,e=>{const{isIntersecting:n}=e;if(o.isInView===n)return;if(o.isInView=n,l&&!n&&o.hasEnteredView)return;n&&(o.hasEnteredView=!0),r.animationState&&r.animationState.setActive(t.AnimationType.InView,n);const i=r.getProps(),s=n?i.onViewportEnter:i.onViewportLeave;s&&s(e)})},[n,i,s,a])}function lo(n,o,r,{fallback:i=!0}){e.useEffect(()=>{n&&i&&("production"!==Jn&&to(!1,"IntersectionObserver not available on this device. whileInView animations will trigger on mount."),requestAnimationFrame(()=>{o.hasEnteredView=!0;const{onViewportEnter:e}=r.getProps();e&&e(null),r.animationState&&r.animationState.setActive(t.AnimationType.InView,!0)}))},[n])}const uo=t=>e=>(t(e),null),co={inView:uo((function({visualElement:t,whileInView:n,onViewportEnter:o,onViewportLeave:r,viewport:i={}}){const s=e.useRef({hasEnteredView:!1,isInView:!1});let a=Boolean(n||o||r);i.once&&s.current.hasEnteredView&&(a=!1),("undefined"==typeof IntersectionObserver?lo:ao)(a,s.current,t,i)})),tap:uo((function({onTap:n,onTapStart:o,onTapCancel:r,whileTap:i,visualElement:s}){const a=n||o||r||i,l=e.useRef(!1),u=e.useRef(null),c={passive:!(o||n||r||p)};function d(){u.current&&u.current(),u.current=null}function h(){return d(),l.current=!1,s.animationState&&s.animationState.setActive(t.AnimationType.Tap,!1),!Ae()}function f(t,e){h()&&(Te(s.getInstance(),t.target)?n&&n(t,e):r&&r(t,e))}function m(t,e){h()&&r&&r(t,e)}function p(e,n){d(),l.current||(l.current=!0,u.current=Ge(ve(window,"pointerup",f,c),ve(window,"pointercancel",m,c)),s.animationState&&s.animationState.setActive(t.AnimationType.Tap,!0),o&&o(e,n))}xe(s,"pointerdown",a?p:void 0,c),Ce(d)})),focus:uo((function({whileFocus:e,visualElement:n}){const{animationState:o}=n;ae(n,"focus",e?()=>{o&&o.setActive(t.AnimationType.Focus,!0)}:void 0),ae(n,"blur",e?()=>{o&&o.setActive(t.AnimationType.Focus,!1)}:void 0)})),hover:uo((function({onHoverStart:t,onHoverEnd:e,whileHover:n,visualElement:o}){xe(o,"pointerenter",t||n?Pe(o,!0,t):void 0,{passive:!t}),xe(o,"pointerleave",e||n?Pe(o,!1,e):void 0,{passive:!e})}))};function ho(){const t=e.useContext(u);if(null===t)return[!0,null];const{isPresent:n,onExitComplete:o,register:r}=t,i=e.useId();e.useEffect(()=>r(i),[]);return!n&&o?[!1,()=>o&&o(i)]:[!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,po={linear:sn,easeIn:an,easeInOut:cn,easeOut:un,circIn:dn,circInOut:fn,circOut:hn,backIn:mn,backInOut:gn,backOut:pn,anticipate:yn,bounceIn:xn,bounceInOut:t=>t<.5?.5*(1-vn(1-2*t)):.5*vn(2*t-1)+.5,bounceOut:vn},go=t=>{if(Array.isArray(t)){t.length;const[e,n,o,r]=t;return _n(e,n,o,r)}return"string"==typeof t?po[t]:t},yo=(t,e)=>"zIndex"!==t&&(!("number"!=typeof e&&!Array.isArray(e))||!("string"!=typeof e||!bt.test(e)||e.startsWith("url("))),vo=()=>({type:"spring",stiffness:500,damping:25,restSpeed:10}),xo=t=>({type:"spring",stiffness:550,damping:0===t?2*Math.sqrt(550):30,restSpeed:10}),bo=()=>({type:"keyframes",ease:"linear",duration:.3}),wo=t=>({type:"keyframes",duration:.8,values:t}),Eo={x:vo,y:vo,z:vo,rotate:vo,rotateX:vo,rotateY:vo,rotateZ:vo,scaleX:xo,scaleY:xo,scale:xo,opacity:bo,backgroundColor:bo,color:bo,default:xo},So=(t,e)=>{let n;return n=_t(e)?wo:Eo[t]||Eo.default,{to:e,...n(e)}},Ao={...Tt,color:pt,backgroundColor:pt,outlineColor:pt,fill:pt,stroke:pt,borderColor:pt,borderTopColor:pt,borderRightColor:pt,borderBottomColor:pt,borderLeftColor:pt,filter:At,WebkitFilter:At},Po=t=>Ao[t];function To(t,e){var n;let o=Po(t);return o!==At&&(o=bt),null===(n=o.getAnimatableNone)||void 0===n?void 0:n.call(o,e)}const Co={current:!1};function Vo({ease:t,times:e,yoyo:n,flip:o,loop:r,...i}){const s={...i};return e&&(s.offset=e),i.duration&&(s.duration=mo(i.duration)),i.repeatDelay&&(s.repeatDelay=mo(i.repeatDelay)),t&&(s.ease=(t=>Array.isArray(t)&&"number"!=typeof t[0])(t)?t.map(go):go(t)),"tween"===i.type&&(s.type="keyframes"),(n||r||o)&&(n?s.repeatType="reverse":r?s.repeatType="loop":o&&(s.repeatType="mirror"),s.repeat=r||n||o||i.repeat),"spring"!==i.type&&(s.type="keyframes"),s}function Mo(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:r,repeat:i,repeatType:s,repeatDelay:a,from:l,...u}){return!!Object.keys(u).length}(t)||(t={...t,...So(n,e.to)}),{...e,...Vo(t)}}function Ro(t,e,n,o,r){const i=ko(o,t)||{};let s=void 0!==i.from?i.from:e.get();const a=yo(t,n);"none"===s&&a&&"string"==typeof n?s=To(t,n):Lo(s)&&"string"==typeof n?s=Oo(n):!Array.isArray(n)&&Lo(n)&&"string"==typeof s&&(n=Oo(s));return yo(t,s)&&a&&!1!==i.type?function(){const o={from:s,to:n,velocity:e.getVelocity(),onComplete:r,onUpdate:t=>e.set(t)};return"inertia"===i.type||"decay"===i.type?function({from:t=0,velocity:e=0,min:n,max:o,power:r=.8,timeConstant:i=750,bounceStiffness:s=500,bounceDamping:a=10,restDelta:l=1,modifyTarget:u,driver:c,onUpdate:d,onComplete:h,onStop:f}){let m;function p(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 y(t){null==m||m.stop(),m=zn(Object.assign(Object.assign({},t),{driver:c,onUpdate:e=>{var n;null==d||d(e),null===(n=t.onUpdate)||void 0===n||n.call(t,e)},onComplete:h,onStop:f}))}function v(t){y(Object.assign({type:"spring",stiffness:s,damping:a,restDelta:l},t))}if(p(t))v({from:t,velocity:e,to:g(t)});else{let o=r*e+t;void 0!==u&&(o=u(o));const s=g(o),a=s===n?-1:1;let c,d;const h=t=>{c=d,d=t,e=Nn(t-c,In().delta),(1===a&&t>s||-1===a&&t<s)&&v({from:t,to:s,velocity:e})};y({type:"decay",from:t,velocity:e,timeConstant:i,power:r,restDelta:l,modifyTarget:u,onUpdate:p(o)?h:void 0})}return{stop:()=>null==m?void 0:m.stop()}}({...o,...i}):zn({...Mo(i,o,t),onUpdate:t=>{o.onUpdate(t),i.onUpdate&&i.onUpdate(t)},onComplete:()=>{o.onComplete(),i.onComplete&&i.onComplete()}})}:function(){const t=Jt(n);return e.set(t),r(),i.onUpdate&&i.onUpdate(t),i.onComplete&&i.onComplete(),{stop:()=>{}}}}function Lo(t){return 0===t||"string"==typeof t&&0===parseFloat(t)&&-1===t.indexOf(" ")}function Oo(t){return"number"==typeof t?0:To("",t)}function ko(t,e){return t[e]||t.default||t}function Do(t,e,n,o={}){return Co.current&&(o={type:!1}),e.start(r=>{let i,s;const a=Ro(t,e,n,o,r),l=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),u=()=>s=a();return l?i=window.setTimeout(u,mo(l)):u(),()=>{clearTimeout(i),s&&s.stop()}})}const jo=t=>/^0[^.\s]+$/.test(t);function Fo(t,e){-1===t.indexOf(e)&&t.push(e)}function Io(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class Bo{constructor(){this.subscriptions=[]}add(t){return Fo(this.subscriptions,t),()=>Io(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 r=0;r<o;r++){const o=this.subscriptions[r];o&&o(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}class Uo{constructor(t){var e;this.version="7.3.2",this.timeDelta=0,this.lastUpdated=0,this.updateSubscribers=new Bo,this.velocityUpdateSubscribers=new Bo,this.renderSubscribers=new Bo,this.canTrackVelocity=!1,this.updateAndNotify=(t,e=!0)=>{this.prev=this.current,this.current=t;const{delta:n,timestamp:o}=In();this.lastUpdated!==o&&(this.timeDelta=n,this.lastUpdated=o,Ln.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.updateSubscribers.notify(this.current),this.velocityUpdateSubscribers.getSize()&&this.velocityUpdateSubscribers.notify(this.getVelocity()),e&&this.renderSubscribers.notify(this.current)},this.scheduleVelocityCheck=()=>Ln.postRender(this.velocityCheck),this.velocityCheck=({timestamp:t})=>{t!==this.lastUpdated&&(this.prev=this.current,this.velocityUpdateSubscribers.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e)))}onChange(t){return this.updateSubscribers.add(t)}clearListeners(){this.updateSubscribers.clear()}onRenderRequest(t){return t(this.get()),this.renderSubscribers.add(t)}attach(t){this.passiveEffect=t}set(t,e=!0){e&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?Nn(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 zo(t){return new Uo(t)}const No=t=>e=>e.test(t),Wo=[J,rt,ot,nt,st,it,{test:t=>"auto"===t,parse:t=>t}],Ho=t=>Wo.find(No(t)),$o=[...Wo,pt,bt],Yo=t=>$o.find(No(t));function Xo(t,e,n){const o=t.getProps();return Kt(o,e,void 0!==n?n:o.custom,function(t){const e={};return t.forEachValue((t,n)=>e[n]=t.get()),e}(t),function(t){const e={};return t.forEachValue((t,n)=>e[n]=t.getVelocity()),e}(t))}function Go(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,zo(n))}function qo(t,e){const n=Xo(t,e);let{transitionEnd:o={},transition:r={},...i}=n?t.makeTargetAnimatable(n,!1):{};i={...i,...o};for(const e in i){Go(t,e,Jt(i[e]))}}function Zo(t,e){[...e].reverse().forEach(n=>{var o;const r=t.getVariant(n);r&&qo(t,r),null===(o=t.variantChildren)||void 0===o||o.forEach(t=>{Zo(t,e)})})}function Ko(t,e,n){var o,r;const i=Object.keys(e).filter(e=>!t.hasValue(e)),s=i.length;if(s)for(let a=0;a<s;a++){const s=i[a],l=e[s];let u=null;Array.isArray(l)&&(u=l[0]),null===u&&(u=null!==(r=null!==(o=n[s])&&void 0!==o?o:t.readValue(s))&&void 0!==r?r:e[s]),null!=u&&("string"==typeof u&&(/^\-?\d*\.?\d+$/.test(u)||jo(u))?u=parseFloat(u):!Yo(u)&&bt.test(l)&&(u=To(s,l)),t.addValue(s,zo(u)),void 0===n[s]&&(n[s]=u),t.setBaseTarget(s,u))}}function _o(t,e){if(!e)return;return(e[t]||e.default||e).from}function Jo(t,e,n){var o;const r={};for(const i in t){const t=_o(i,e);r[i]=void 0!==t?t:null===(o=n.getValue(i))||void 0===o?void 0:o.get()}return r}function Qo(t){return Boolean(N(t)&&t.add)}function tr(t,e,n={}){let o;if(t.notifyAnimationStart(e),Array.isArray(e)){const r=e.map(e=>er(t,e,n));o=Promise.all(r)}else if("string"==typeof e)o=er(t,e,n);else{const r="function"==typeof e?Xo(t,e,n.custom):e;o=nr(t,r,n)}return o.then(()=>t.notifyAnimationComplete(e))}function er(t,e,n={}){var o;const r=Xo(t,e,n.custom);let{transition:i=t.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);const s=r?()=>nr(t,r,n):()=>Promise.resolve(),a=(null===(o=t.variantChildren)||void 0===o?void 0:o.size)?(o=0)=>{const{delayChildren:r=0,staggerChildren:s,staggerDirection:a}=i;return function(t,e,n=0,o=0,r=1,i){const s=[],a=(t.variantChildren.size-1)*o,l=1===r?(t=0)=>t*o:(t=0)=>a-t*o;return Array.from(t.variantChildren).sort(or).forEach((t,o)=>{s.push(er(t,e,{...i,delay:n+l(o)}).then(()=>t.notifyAnimationComplete(e)))}),Promise.all(s)}(t,e,r+o,s,a,n)}:()=>Promise.resolve(),{when:l}=i;if(l){const[t,e]="beforeChildren"===l?[s,a]:[a,s];return t().then(e)}return Promise.all([s(),a(n.delay)])}function nr(t,e,{delay:n=0,transitionOverride:o,type:r}={}){var i;let{transition:s=t.getDefaultTransition(),transitionEnd:a,...l}=t.makeTargetAnimatable(e);const u=t.getValue("willChange");o&&(s=o);const c=[],d=r&&(null===(i=t.animationState)||void 0===i?void 0:i.getState()[r]);for(const e in l){const o=t.getValue(e),r=l[e];if(!o||void 0===r||d&&rr(d,e))continue;let i={delay:n,...s};t.shouldReduceMotion&&U.has(e)&&(i={...i,type:!1,delay:0});let a=Do(e,o,r,i);Qo(u)&&(u.add(e),a=a.then(()=>u.remove(e))),c.push(a)}return Promise.all(c).then(()=>{a&&qo(t,a)})}function or(t,e){return t.sortNodePosition(e)}function rr({protectedKeys:t,needsAnimating:e},n){const o=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,o}const ir=[t.AnimationType.Animate,t.AnimationType.InView,t.AnimationType.Focus,t.AnimationType.Hover,t.AnimationType.Tap,t.AnimationType.Drag,t.AnimationType.Exit],sr=[...ir].reverse(),ar=ir.length;function lr(e){let n=function(t){return e=>Promise.all(e.map(({animation:e,options:n})=>tr(t,e,n)))}(e);const o={[t.AnimationType.Animate]:cr(!0),[t.AnimationType.InView]:cr(),[t.AnimationType.Hover]:cr(),[t.AnimationType.Tap]:cr(),[t.AnimationType.Drag]:cr(),[t.AnimationType.Focus]:cr(),[t.AnimationType.Exit]:cr()};let r=!0;const i=(t,n)=>{const o=Xo(e,n);if(o){const{transition:e,transitionEnd:n,...r}=o;t={...t,...r,...n}}return t};function s(t,s){var a;const l=e.getProps(),u=e.getVariantContext(!0)||{},c=[],d=new Set;let h={},f=1/0;for(let n=0;n<ar;n++){const g=sr[n],y=o[g],v=null!==(a=l[g])&&void 0!==a?a:u[g],x=m(v),b=g===s?y.isActive:null;!1===b&&(f=n);let w=v===u[g]&&v!==l[g]&&x;if(w&&r&&e.manuallyAnimateOnMount&&(w=!1),y.protectedKeys={...h},!y.isActive&&null===b||!v&&!y.prevProp||p(v)||"boolean"==typeof v)continue;const E=ur(y.prevProp,v);let S=E||g===s&&y.isActive&&!w&&x||n>f&&x;const A=Array.isArray(v)?v:[v];let P=A.reduce(i,{});!1===b&&(P={});const{prevResolvedValues:T={}}=y,C={...T,...P},V=t=>{S=!0,d.delete(t),y.needsAnimating[t]=!0};for(const t in C){const e=P[t],n=T[t];h.hasOwnProperty(t)||(e!==n?_t(e)&&_t(n)?!fo(e,n)||E?V(t):y.protectedKeys[t]=!0:void 0!==e?V(t):d.add(t):void 0!==e&&d.has(t)?V(t):y.protectedKeys[t]=!0)}y.prevProp=v,y.prevResolvedValues=P,y.isActive&&(h={...h,...P}),r&&e.blockInitialAnimation&&(S=!1),S&&!w&&c.push(...A.map(e=>({animation:e,options:{type:g,...t}})))}if(d.size){const t={};d.forEach(n=>{const o=e.getBaseTarget(n);void 0!==o&&(t[n]=o)}),c.push({animation:t})}let g=Boolean(c.length);return r&&!1===l.initial&&!e.manuallyAnimateOnMount&&(g=!1),r=!1,g?n(c):Promise.resolve()}return{animateChanges:s,setActive:function(t,n,r){var i;if(o[t].isActive===n)return Promise.resolve();null===(i=e.variantChildren)||void 0===i||i.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(r,t);for(const t in o)o[t].protectedKeys={};return a},setAnimateFunction:function(t){n=t(e)},getState:()=>o}}function ur(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!fo(e,t)}function cr(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}const dr={animation:uo(({visualElement:t,animate:n})=>{t.animationState||(t.animationState=lr(t)),p(n)&&e.useEffect(()=>n.subscribe(t),[n])}),exit:uo(n=>{const{custom:o,visualElement:r}=n,[i,s]=ho(),a=e.useContext(u);e.useEffect(()=>{r.isPresent=i;const e=r.animationState&&r.animationState.setActive(t.AnimationType.Exit,!i,{custom:a&&a.custom||o});e&&!i&&e.then(s)},[i])})};class hr{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=pr(this.lastMoveEventInfo,this.history),e=null!==this.startEvent,n=Yn(t.offset,{x:0,y:0})>=3;if(!e&&!n)return;const{point:o}=t,{timestamp:r}=In();this.history.push({...o,timestamp:r});const{onStart:i,onMove:s}=this.handlers;e||(i&&i(this.lastMoveEvent,t),this.startEvent=this.lastMoveEvent),s&&s(this.lastMoveEvent,t)},this.handlePointerMove=(t,e)=>{this.lastMoveEvent=t,this.lastMoveEventInfo=fr(e,this.transformPagePoint),le(t)&&0===t.buttons?this.handlePointerUp(t,e):Ln.update(this.updatePoint,!0)},this.handlePointerUp=(t,e)=>{this.end();const{onEnd:n,onSessionEnd:o}=this.handlers,r=pr(fr(e,this.transformPagePoint),this.history);this.startEvent&&n&&n(t,r),o&&o(t,r)},ue(t)&&t.touches.length>1)return;this.handlers=e,this.transformPagePoint=n;const o=fr(fe(t),this.transformPagePoint),{point:r}=o,{timestamp:i}=In();this.history=[{...r,timestamp:i}];const{onSessionStart:s}=e;s&&s(t,pr(o,this.history)),this.removeListeners=Ge(ve(window,"pointermove",this.handlePointerMove),ve(window,"pointerup",this.handlePointerUp),ve(window,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),On.update(this.updatePoint)}}function fr(t,e){return e?{point:e(t.point)}:t}function mr(t,e){return{x:t.x-e.x,y:t.y-e.y}}function pr({point:t},e){return{point:t,delta:mr(t,yr(e)),offset:mr(t,gr(e)),velocity:vr(e,.1)}}function gr(t){return t[0]}function yr(t){return t[t.length-1]}function vr(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,o=null;const r=yr(t);for(;n>=0&&(o=t[n],!(r.timestamp-o.timestamp>mo(e)));)n--;if(!o)return{x:0,y:0};const i=(r.timestamp-o.timestamp)/1e3;if(0===i)return{x:0,y:0};const s={x:(r.x-o.x)/i,y:(r.y-o.y)/i};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}function xr(t){return t.max-t.min}function br(t,e=0,n=.01){return Yn(t,e)<n}function wr(t,e,n,o=.5){t.origin=o,t.originPoint=Be(e.min,e.max,t.origin),t.scale=xr(n)/xr(e),(br(t.scale,1,1e-4)||isNaN(t.scale))&&(t.scale=1),t.translate=Be(n.min,n.max,t.origin)-t.originPoint,(br(t.translate)||isNaN(t.translate))&&(t.translate=0)}function Er(t,e,n,o){wr(t.x,e.x,n.x,null==o?void 0:o.originX),wr(t.y,e.y,n.y,null==o?void 0:o.originY)}function Sr(t,e,n){t.min=n.min+e.min,t.max=t.min+xr(e)}function Ar(t,e,n){t.min=e.min-n.min,t.max=t.min+xr(e)}function Pr(t,e,n){Ar(t.x,e.x,n.x),Ar(t.y,e.y,n.y)}function Tr(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 Cr(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 Vr=.35;function Mr(t,e,n){return{min:Rr(t,e),max:Rr(t,n)}}function Rr(t,e){var n;return"number"==typeof t?t:null!==(n=t[e])&&void 0!==n?n:0}const Lr=()=>({x:{min:0,max:0},y:{min:0,max:0}});function Or(t){return[t("x"),t("y")]}function kr({top:t,left:e,right:n,bottom:o}){return{x:{min:e,max:n},y:{min:t,max:o}}}function Dr(t){return void 0===t||1===t}function jr({scale:t,scaleX:e,scaleY:n}){return!Dr(t)||!Dr(e)||!Dr(n)}function Fr(t){return jr(t)||Ir(t.x)||Ir(t.y)||t.z||t.rotate||t.rotateX||t.rotateY}function Ir(t){return t&&"0%"!==t}function Br(t,e,n){return n+e*(t-n)}function Ur(t,e,n,o,r){return void 0!==r&&(t=Br(t,r,o)),Br(t,n,o)+e}function zr(t,e=0,n=1,o,r){t.min=Ur(t.min,e,n,o,r),t.max=Ur(t.max,e,n,o,r)}function Nr(t,{x:e,y:n}){zr(t.x,e.translate,e.scale,e.originPoint),zr(t.y,n.translate,n.scale,n.originPoint)}function Wr(t,e){t.min=t.min+e,t.max=t.max+e}function Hr(t,e,[n,o,r]){const i=void 0!==e[r]?e[r]:.5,s=Be(t.min,t.max,i);zr(t,e[n],e[o],s,e.scale)}const $r=["x","scaleX","originX"],Yr=["y","scaleY","originY"];function Xr(t,e){Hr(t.x,e,$r),Hr(t.y,e,Yr)}function Gr(t,e){return kr(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 qr=new WeakMap;class Zr{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 hr(e,{onSessionStart:t=>{this.stopAnimation(),n&&this.snapToCursor(fe(t,"page").point)},onStart:(e,n)=>{var o;const{drag:r,dragPropagation:i,onDragStart:s}=this.getProps();(!r||i||(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=Se(r),this.openGlobalLock))&&(this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Or(t=>{var e,n;let o=this.getAxisMotionValue(t).get()||0;if(ot.test(o)){const r=null===(n=null===(e=this.visualElement.projection)||void 0===e?void 0:e.layout)||void 0===n?void 0:n.actual[t];if(r){o=xr(r)*(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:r,onDrag:i}=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==r||r(this.currentDirection)));this.updateAxis("x",e.point,s),this.updateAxis("y",e.point,s),this.visualElement.syncRender(),null==i||i(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:r}=this.getProps();null==r||r(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||!Kr(t,o,this.currentDirection))return;const r=this.getAxisMotionValue(t);let i=this.originPoint[t]+n[t];this.constraints&&this.constraints[t]&&(i=function(t,{min:e,max:n},o){return void 0!==e&&t<e?t=o?Be(e,t,o.min):Math.max(t,e):void 0!==n&&t>n&&(t=o?Be(n,t,o.max):Math.min(t,n)),t}(i,this.constraints[t],this.elastic[t])),r.set(i)}resolveConstraints(){const{dragConstraints:t,dragElastic:e}=this.getProps(),{layout:n}=this.visualElement.projection||{},o=this.constraints;t&&f(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!n)&&function(t,{top:e,left:n,bottom:o,right:r}){return{x:Tr(t.x,n,r),y:Tr(t.y,e,o)}}(n.actual,t),this.elastic=function(t=Vr){return!1===t?t=0:!0===t&&(t=Vr),{x:Mr(t,"left","right"),y:Mr(t,"top","bottom")}}(e),o!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&Or(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.actual[t],this.constraints[t]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:e}=this.getProps();if(!t||!f(t))return!1;const n=t.current,{projection:o}=this.visualElement;if(!o||!o.layout)return!1;const r=function(t,e,n){const o=Gr(t,n),{scroll:r}=e;return r&&(Wr(o.x,r.x),Wr(o.y,r.y)),o}(n,o.root,this.visualElement.getTransformPagePoint());let i=function(t,e){return{x:Cr(t.x,e.x),y:Cr(t.y,e.y)}}(o.layout.actual,r);if(e){const t=e(function({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}(i));this.hasMutatedConstraints=!!t,t&&(i=kr(t))}return i}startAnimation(t){const{drag:e,dragMomentum:n,dragElastic:o,dragTransition:r,dragSnapToOrigin:i,onDragTransitionEnd:s}=this.getProps(),a=this.constraints||{},l=Or(s=>{var l;if(!Kr(s,e,this.currentDirection))return;let u=null!==(l=null==a?void 0:a[s])&&void 0!==l?l:{};i&&(u={min:0,max:0});const c=o?200:1e6,d=o?40:1e7,h={type:"inertia",velocity:n?t[s]:0,bounceStiffness:c,bounceDamping:d,timeConstant:750,restDelta:1,restSpeed:10,...r,...u};return this.startAxisValueAnimation(s,h)});return Promise.all(l).then(s)}startAxisValueAnimation(t,e){return Do(t,this.getAxisMotionValue(t),0,e)}stopAnimation(){Or(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){var e,n;const o="_drag"+t.toUpperCase(),r=this.visualElement.getProps()[o];return r||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){Or(e=>{const{drag:n}=this.getProps();if(!Kr(e,n,this.currentDirection))return;const{projection:o}=this.visualElement,r=this.getAxisMotionValue(e);if(o&&o.layout){const{min:n,max:i}=o.layout.actual[e];r.set(t[e]-Be(n,i,.5))}})}scalePositionWithinConstraints(){var t;const{drag:e,dragConstraints:n}=this.getProps(),{projection:o}=this.visualElement;if(!f(n)||!o||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};Or(t=>{const e=this.getAxisMotionValue(t);if(e){const n=e.get();r[t]=function(t,e){let n=.5;const o=xr(t),r=xr(e);return r>o?n=Ie(e.min,e.max-o,t.min):o>r&&(n=Ie(t.min,t.max-r,e.min)),Me(0,1,n)}({min:n,max:n},this.constraints[t])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.getInstance().style.transform=i?i({},""):"none",null===(t=o.root)||void 0===t||t.updateScroll(),o.updateLayout(),this.resolveConstraints(),Or(t=>{if(!Kr(t,e,null))return;const n=this.getAxisMotionValue(t),{min:o,max:i}=this.constraints[t];n.set(Be(o,i,r[t]))})}addListeners(){var t;qr.set(this.visualElement,this);const e=ve(this.visualElement.getInstance(),"pointerdown",t=>{const{drag:e,dragListener:n=!0}=this.getProps();e&&n&&this.start(t)}),n=()=>{const{dragConstraints:t}=this.getProps();f(t)&&(this.constraints=this.resolveRefConstraints())},{projection:o}=this.visualElement,r=o.addEventListener("measure",n);o&&!o.layout&&(null===(t=o.root)||void 0===t||t.updateScroll(),o.updateLayout()),n();const i=se(window,"resize",()=>this.scalePositionWithinConstraints()),s=o.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e})=>{this.isDragging&&e&&(Or(e=>{const n=this.getAxisMotionValue(e);n&&(this.originPoint[e]+=t[e].translate,n.set(n.get()+t[e].translate))}),this.visualElement.syncRender())});return()=>{i(),e(),r(),null==s||s()}}getProps(){const t=this.visualElement.getProps(),{drag:e=!1,dragDirectionLock:n=!1,dragPropagation:o=!1,dragConstraints:r=!1,dragElastic:i=Vr,dragMomentum:s=!0}=t;return{...t,drag:e,dragDirectionLock:n,dragPropagation:o,dragConstraints:r,dragElastic:i,dragMomentum:s}}}function Kr(t,e,n){return!(!0!==e&&e!==t||null!==n&&n!==t)}const _r={pan:uo((function({onPan:t,onPanStart:n,onPanEnd:o,onPanSessionStart:r,visualElement:i}){const a=t||n||o||r,l=e.useRef(null),{transformPagePoint:u}=e.useContext(s),c={onSessionStart:r,onStart:n,onMove:t,onEnd:(t,e)=>{l.current=null,o&&o(t,e)}};e.useEffect(()=>{null!==l.current&&l.current.updateHandlers(c)}),xe(i,"pointerdown",a&&function(t){l.current=new hr(t,c,{transformPagePoint:u})}),Ce(()=>l.current&&l.current.end())})),drag:uo((function(t){const{dragControls:n,visualElement:o}=t,r=A(()=>new Zr(o));e.useEffect(()=>n&&n.subscribe(r),[r,n]),e.useEffect(()=>r.addListeners(),[r])}))},Jr={current:null},Qr={current:!1};function ti(){if(Qr.current=!0,c)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Jr.current=t.matches;t.addListener(e),e()}else Jr.current=!1}const ei=["LayoutMeasure","BeforeLayoutMeasure","LayoutUpdate","ViewportBoxUpdate","Update","Render","AnimationComplete","LayoutAnimationComplete","AnimationStart","LayoutAnimationStart","SetAxisTarget","Unmount"];const ni=Object.keys(E),oi=ni.length,ri=({treeType:t="",build:n,getBaseTarget:o,makeTargetAnimatable:r,measureViewportBox:i,render:s,readValueFromInstance:a,removeValueFromRenderState:l,sortNodePosition:u,scrapeMotionValuesFromProps:c})=>({parent:d,props:h,presenceId:p,blockInitialAnimation:g,visualState:x,reducedMotionConfig:b},w={})=>{let S=!1;const{latestValues:A,renderState:P}=x;let T;const C=function(){const t=ei.map(()=>new Bo),e={},n={clearAllListeners:()=>t.forEach(t=>t.clear()),updatePropListeners:t=>{ei.forEach(o=>{var r;const i="on"+o,s=t[i];null===(r=e[o])||void 0===r||r.call(e),s&&(e[o]=n[i](s))})}};return t.forEach((t,e)=>{n["on"+ei[e]]=e=>t.add(e),n["notify"+ei[e]]=(...e)=>t.notify(...e)}),n}(),V=new Map,M=new Map;let R={};const L={...A};let O;function k(){T&&S&&(D(),s(T,P,h.style,W.projection))}function D(){n(W,P,A,w,h)}function j(){C.notifyUpdate(A)}function F(t,e){const n=e.onChange(e=>{A[t]=e,h.onUpdate&&Ln.update(j,!1,!0)}),o=e.onRenderRequest(W.scheduleRender);M.set(t,()=>{n(),o()})}const{willChange:I,...B}=c(h);for(const t in B){const e=B[t];void 0!==A[t]&&N(e)&&(e.set(A[t],!1),Qo(I)&&I.add(t))}const U=y(h),z=v(h),W={treeType:t,current:null,depth:d?d.depth+1:0,parent:d,children:new Set,presenceId:p,shouldReduceMotion:null,variantChildren:z?new Set:void 0,isVisible:void 0,manuallyAnimateOnMount:Boolean(null==d?void 0:d.isMounted()),blockInitialAnimation:g,isMounted:()=>Boolean(T),mount(t){S=!0,T=W.current=t,W.projection&&W.projection.mount(t),z&&d&&!U&&(O=null==d?void 0:d.addVariantChild(W)),V.forEach((t,e)=>F(e,t)),Qr.current||ti(),W.shouldReduceMotion="never"!==b&&("always"===b||Jr.current),null==d||d.children.add(W),W.setProps(h)},unmount(){var t;null===(t=W.projection)||void 0===t||t.unmount(),On.update(j),On.render(k),M.forEach(t=>t()),null==O||O(),null==d||d.children.delete(W),C.clearAllListeners(),T=void 0,S=!1},loadFeatures(t,n,o,r,i,s){const a=[];for(let n=0;n<oi;n++){const o=ni[n],{isEnabled:r,Component:i}=E[o];r(h)&&i&&a.push(e.createElement(i,{key:o,...t,visualElement:W}))}if(!W.projection&&i){W.projection=new i(r,W.getLatestValues(),d&&d.projection);const{layoutId:e,layout:n,drag:o,dragConstraints:a,layoutScroll:l}=t;W.projection.setOptions({layoutId:e,layout:n,alwaysMeasureLayout:Boolean(o)||a&&f(a),visualElement:W,scheduleRender:()=>W.scheduleRender(),animationType:"string"==typeof n?n:"both",initialPromotionConfig:s,layoutScroll:l})}return a},addVariantChild(t){var e;const n=W.getClosestVariantNode();if(n)return null===(e=n.variantChildren)||void 0===e||e.add(t),()=>n.variantChildren.delete(t)},sortNodePosition:e=>u&&t===e.treeType?u(W.getInstance(),e.getInstance()):0,getClosestVariantNode:()=>z?W:null==d?void 0:d.getClosestVariantNode(),getLayoutId:()=>h.layoutId,getInstance:()=>T,getStaticValue:t=>A[t],setStaticValue:(t,e)=>A[t]=e,getLatestValues:()=>A,setVisibility(t){W.isVisible!==t&&(W.isVisible=t,W.scheduleRender())},makeTargetAnimatable:(t,e=!0)=>r(W,t,h,e),measureViewportBox:()=>i(T,h),addValue(t,e){W.hasValue(t)&&W.removeValue(t),V.set(t,e),A[t]=e.get(),F(t,e)},removeValue(t){var e;V.delete(t),null===(e=M.get(t))||void 0===e||e(),M.delete(t),delete A[t],l(t,P)},hasValue:t=>V.has(t),getValue(t,e){let n=V.get(t);return void 0===n&&void 0!==e&&(n=zo(e),W.addValue(t,n)),n},forEachValue:t=>V.forEach(t),readValue:t=>void 0!==A[t]?A[t]:a(T,t,w),setBaseTarget(t,e){L[t]=e},getBaseTarget(t){if(o){const e=o(h,t);if(void 0!==e&&!N(e))return e}return L[t]},...C,build:()=>(D(),P),scheduleRender(){Ln.render(k,!1,!0)},syncRender:k,setProps(t){(t.transformTemplate||h.transformTemplate)&&W.scheduleRender(),h=t,C.updatePropListeners(t),R=function(t,e,n){const{willChange:o}=e;for(const r in e){const i=e[r],s=n[r];if(N(i))t.addValue(r,i),Qo(o)&&o.add(r);else if(N(s))t.addValue(r,zo(i)),Qo(o)&&o.remove(r);else if(s!==i)if(t.hasValue(r)){const e=t.getValue(r);!e.hasAnimated&&e.set(i)}else{const e=t.getStaticValue(r);t.addValue(r,zo(void 0!==e?e:i))}}for(const o in n)void 0===e[o]&&t.removeValue(o);return e}(W,c(h),R)},getProps:()=>h,getVariant:t=>{var e;return null===(e=h.variants)||void 0===e?void 0:e[t]},getDefaultTransition:()=>h.transition,getTransformPagePoint:()=>h.transformPagePoint,getVariantContext(t=!1){if(t)return null==d?void 0:d.getVariantContext();if(!U){const t=(null==d?void 0:d.getVariantContext())||{};return void 0!==h.initial&&(t.initial=h.initial),t}const e={};for(let t=0;t<si;t++){const n=ii[t],o=h[n];(m(o)||!1===o)&&(e[n]=o)}return e}};return W},ii=["initial",...ir],si=ii.length;function ai(t){return"string"==typeof t&&t.startsWith("var(--")}const li=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function ui(t,e,n=1){const[o,r]=function(t){const e=li.exec(t);if(!e)return[,];const[,n,o]=e;return[n,o]}(t);if(!o)return;const i=window.getComputedStyle(e).getPropertyValue(o);return i?i.trim():ai(r)?ui(r,e,n+1):r}const ci=new Set(["width","height","top","left","right","bottom","x","y"]),di=t=>ci.has(t),hi=(t,e)=>{t.set(e,!1),t.set(e)},fi=t=>t===J||t===rt;var mi;!function(t){t.width="width",t.height="height",t.left="left",t.right="right",t.top="top",t.bottom="bottom"}(mi||(mi={}));const pi=(t,e)=>parseFloat(t.split(", ")[e]),gi=(t,e)=>(n,{transform:o})=>{if("none"===o||!o)return 0;const r=o.match(/^matrix3d\((.+)\)$/);if(r)return pi(r[1],e);{const e=o.match(/^matrix\((.+)\)$/);return e?pi(e[1],t):0}},yi=new Set(["x","y","z"]),vi=B.filter(t=>!yi.has(t));const xi={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:gi(4,13),y:gi(5,14)},bi=(t,e,n={},o={})=>{e={...e},o={...o};const r=Object.keys(e).filter(di);let i=[],s=!1;const a=[];if(r.forEach(r=>{const l=t.getValue(r);if(!t.hasValue(r))return;let u=n[r],c=Ho(u);const d=e[r];let h;if(_t(d)){const t=d.length,e=null===d[0]?1:0;u=d[e],c=Ho(u);for(let n=e;n<t;n++)h?Ho(d[n]):h=Ho(d[n])}else h=Ho(d);if(c!==h)if(fi(c)&&fi(h)){const t=l.get();"string"==typeof t&&l.set(parseFloat(t)),"string"==typeof d?e[r]=parseFloat(d):Array.isArray(d)&&h===rt&&(e[r]=d.map(parseFloat))}else(null==c?void 0:c.transform)&&(null==h?void 0:h.transform)&&(0===u||0===d)?0===u?l.set(h.transform(u)):e[r]=c.transform(d):(s||(i=function(t){const e=[];return vi.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.syncRender(),e}(t),s=!0),a.push(r),o[r]=void 0!==o[r]?o[r]:e[r],hi(l,d))}),a.length){const n=a.indexOf("height")>=0?window.pageYOffset:null,r=((t,e,n)=>{const o=e.measureViewportBox(),r=e.getInstance(),i=getComputedStyle(r),{display:s}=i,a={};"none"===s&&e.setStaticValue("display",t.display||"block"),n.forEach(t=>{a[t]=xi[t](o,i)}),e.syncRender();const l=e.measureViewportBox();return n.forEach(n=>{const o=e.getValue(n);hi(o,a[n]),t[n]=xi[n](l,i)}),t})(e,t,a);return i.length&&i.forEach(([e,n])=>{t.getValue(e).set(n)}),t.syncRender(),c&&null!==n&&window.scrollTo({top:n}),{target:r,transitionEnd:o}}return{target:e,transitionEnd:o}};function wi(t,e,n,o){return(t=>Object.keys(t).some(di))(e)?bi(t,e,n,o):{target:e,transitionEnd:o}}const Ei=(t,e,n,o)=>{const r=function(t,{...e},n){const o=t.getInstance();if(!(o instanceof Element))return{target:e,transitionEnd:n};n&&(n={...n}),t.forEachValue(t=>{const e=t.get();if(!ai(e))return;const n=ui(e,o);n&&t.set(n)});for(const t in e){const r=e[t];if(!ai(r))continue;const i=ui(r,o);i&&(e[t]=i,n&&void 0===n[t]&&(n[t]=r))}return{target:e,transitionEnd:n}}(t,e,o);return wi(t,e=r.target,n,o=r.transitionEnd)};const Si={treeType:"dom",readValueFromInstance(t,e){if(U.has(e)){const t=Po(e);return t&&t.default||0}{const o=(n=t,window.getComputedStyle(n)),r=($(e)?o.getPropertyValue(e):o[e])||0;return"string"==typeof r?r.trim():r}var n},sortNodePosition:(t,e)=>2&t.compareDocumentPosition(e)?1:-1,getBaseTarget(t,e){var n;return null===(n=t.style)||void 0===n?void 0:n[e]},measureViewportBox:(t,{transformPagePoint:e})=>Gr(t,e),resetTransform(t,e,n){const{transformTemplate:o}=n;e.style.transform=o?o({},""):"none",t.scheduleRender()},restoreTransform(t,e){t.style.transform=e.style.transform},removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]},makeTargetAnimatable(t,{transition:e,transitionEnd:n,...o},{transformValues:r},i=!0){let s=Jo(o,e||{},t);if(r&&(n&&(n=r(n)),o&&(o=r(o)),s&&(s=r(s))),i){Ko(t,o,s);const e=Ei(t,o,s,n);n=e.transitionEnd,o=e.target}return{transition:e,transitionEnd:n,...o}},scrapeMotionValuesFromProps:qt,build(t,e,n,o,r){void 0!==t.isVisible&&(e.style.visibility=t.isVisible?"visible":"hidden"),Ct(e,n,o,r.transformTemplate)},render:Yt},Ai=ri(Si),Pi=ri({...Si,getBaseTarget:(t,e)=>t[e],readValueFromInstance(t,e){var n;return U.has(e)?(null===(n=Po(e))||void 0===n?void 0:n.default)||0:(e=Xt.has(e)?e:$t(e),t.getAttribute(e))},scrapeMotionValuesFromProps:Zt,build(t,e,n,o,r){zt(e,n,o,r.transformTemplate)},render:Gt}),Ti=(t,e)=>j(t)?Pi(e,{enableHardwareAcceleration:!1}):Ai(e,{enableHardwareAcceleration:!0});function Ci(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Vi={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!rt.test(t))return t;t=parseFloat(t)}return`${Ci(t,e.target.x)}% ${Ci(t,e.target.y)}%`}},Mi={correct:(t,{treeScale:e,projectionDelta:n})=>{const o=t,r=t.includes("var("),i=[];r&&(t=t.replace(li,t=>(i.push(t),"_$css")));const s=bt.parse(t);if(s.length>5)return o;const a=bt.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 d=Be(u,c,.5);"number"==typeof s[2+l]&&(s[2+l]/=d),"number"==typeof s[3+l]&&(s[3+l]/=d);let h=a(s);if(r){let t=0;h=h.replace("_$css",()=>{const e=i[t];return t++,e})}return h}};class Ri extends r.default.Component{componentDidMount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n,layoutId:o}=this.props,{projection:r}=t;I(Li),r&&(e.group&&e.group.add(r),n&&n.register&&o&&n.register(r),r.root.didUpdate(),r.addEventListener("animationComplete",()=>{this.safeToRemove()}),r.setOptions({...r.options,onExitComplete:()=>this.safeToRemove()})),P.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:e,visualElement:n,drag:o,isPresent:r}=this.props,i=n.projection;return i?(i.isPresent=r,o||t.layoutDependency!==e||void 0===e?i.willUpdate():this.safeToRemove(),t.isPresent!==r&&(r?i.promote():i.relegate()||Ln.postRender(()=>{var t;(null===(t=i.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 Li={borderRadius:{...Vi,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Vi,borderTopRightRadius:Vi,borderBottomLeftRadius:Vi,borderBottomRightRadius:Vi,boxShadow:Mi},Oi={measureLayout:function(t){const[n,o]=ho(),i=e.useContext(C);return r.default.createElement(Ri,{...t,layoutGroup:i,switchLayoutGroup:e.useContext(M),isPresent:n,safeToRemove:o})}};function ki(t,e,n={}){const o=N(t)?t:zo(t);return Do("",o,e,n),{stop:()=>o.stop(),isAnimating:()=>o.isAnimating()}}const Di=["TopLeft","TopRight","BottomLeft","BottomRight"],ji=Di.length,Fi=t=>"string"==typeof t?parseFloat(t):t,Ii=t=>"number"==typeof t||rt.test(t);function Bi(t,e){var n;return null!==(n=t[e])&&void 0!==n?n:t.borderRadius}const Ui=Ni(0,.5,hn),zi=Ni(.5,.95,sn);function Ni(t,e,n){return o=>o<t?0:o>e?1:n(Ie(t,e,o))}function Wi(t,e){t.min=e.min,t.max=e.max}function Hi(t,e){Wi(t.x,e.x),Wi(t.y,e.y)}function $i(t,e,n,o,r){return t=Br(t-=e,1/n,o),void 0!==r&&(t=Br(t,1/r,o)),t}function Yi(t,e,[n,o,r],i,s){!function(t,e=0,n=1,o=.5,r,i=t,s=t){if(ot.test(e)){e=parseFloat(e);e=Be(s.min,s.max,e/100)-s.min}if("number"!=typeof e)return;let a=Be(i.min,i.max,o);t===i&&(a-=e),t.min=$i(t.min,e,n,a,r),t.max=$i(t.max,e,n,a,r)}(t,e[n],e[o],e[r],e.scale,i,s)}const Xi=["x","scaleX","originX"],Gi=["y","scaleY","originY"];function qi(t,e,n,o){Yi(t.x,e,Xi,null==n?void 0:n.x,null==o?void 0:o.x),Yi(t.y,e,Gi,null==n?void 0:n.y,null==o?void 0:o.y)}function Zi(t){return 0===t.translate&&1===t.scale}function Ki(t){return Zi(t.x)&&Zi(t.y)}function _i(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 Ji(t){return xr(t.x)/xr(t.y)}class Qi{constructor(){this.members=[]}add(t){Fo(this.members,t),t.scheduleRender()}remove(t){if(Io(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,t.snapshot.isShared=!0),(null===(n=t.root)||void 0===n?void 0:n.isUpdating)&&(t.isLayoutDirty=!0);const{crossfade:r}=t.options;!1===r&&o.hide()}}exitAnimationComplete(){this.members.forEach(t=>{var e,n,o,r,i;null===(n=(e=t.options).onExitComplete)||void 0===n||n.call(e),null===(i=null===(o=t.resumingFrom)||void 0===o?void 0:(r=o.options).onExitComplete)||void 0===i||i.call(r)})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function ts(t,e,n){let o=`translate3d(${t.x.translate/e.x}px, ${t.y.translate/e.y}px, 0) `;if(o+=`scale(${1/e.x}, ${1/e.y}) `,n){const{rotate:t,rotateX:e,rotateY:r}=n;t&&(o+=`rotate(${t}deg) `),e&&(o+=`rotateX(${e}deg) `),r&&(o+=`rotateY(${r}deg) `)}return o+=`scale(${t.x.scale*e.x}, ${t.y.scale*e.y})`,"translate3d(0px, 0px, 0) scale(1, 1) scale(1, 1)"===o?"none":o}const es=(t,e)=>t.depth-e.depth;class ns{constructor(){this.children=[],this.isDirty=!1}add(t){Fo(this.children,t),this.isDirty=!0}remove(t){Io(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(es),this.isDirty=!1,this.children.forEach(t)}}const os=["","X","Y","Z"];function rs({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:o,resetTransform:r}){return class{constructor(t,n={},o=(null==e?void 0:e())){this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!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(ds),this.nodes.forEach(hs)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.id=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 ns)}addEventListener(t,e){return this.eventHandlers.has(t)||this.eventHandlers.set(t,new Bo),this.eventHandlers.get(t).add(e)}notifyListeners(t,...e){const n=this.eventHandlers.get(t);null==n||n.notify(...e)}hasListeners(t){return this.eventHandlers.has(t)}registerPotentialNode(t,e){this.potentialNodes.set(t,e)}mount(e,n=!1){var o;if(this.instance)return;this.isSVG=e instanceof SVGElement&&"svg"!==e.tagName,this.instance=e;const{layoutId:r,layout:i,visualElement:s}=this.options;if(s&&!s.getInstance()&&s.mount(e),this.root.nodes.add(this),null===(o=this.parent)||void 0===o||o.children.add(this),this.id&&this.root.potentialNodes.delete(this.id),n&&(i||r)&&(this.isLayoutDirty=!0),t){let n;const o=()=>this.root.updateBlockedByResize=!1;t(e,()=>{this.root.updateBlockedByResize=!0,clearTimeout(n),n=window.setTimeout(o,250),P.hasAnimatedSinceResize&&(P.hasAnimatedSinceResize=!1,this.nodes.forEach(cs))})}r&&this.root.registerSharedNode(r,this),!1!==this.options.animate&&s&&(r||i)&&this.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e,hasRelativeTargetChanged:n,layout:o})=>{var r,i,a,l,u;if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const c=null!==(i=null!==(r=this.options.transition)&&void 0!==r?r:s.getDefaultTransition())&&void 0!==i?i:vs,{onLayoutAnimationStart:d,onLayoutAnimationComplete:h}=s.getProps(),f=!this.targetLayout||!_i(this.targetLayout,o)||n,m=!e&&n;if((null===(a=this.resumeFrom)||void 0===a?void 0:a.instance)||m||e&&(f||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(t,m);const e={...ko(c,"layout"),onPlay:d,onComplete:h};s.shouldReduceMotion&&(e.delay=0,e.type=!1),this.startAnimation(e)}else e||0!==this.animationProgress||this.finishAnimation(),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(fs))}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()}const{layoutId:r,layout:i}=this.options;if(void 0===r&&!i)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(ls);this.isUpdating&&(this.isUpdating=!1,this.potentialNodes.size&&(this.potentialNodes.forEach(xs),this.potentialNodes.clear()),this.nodes.forEach(us),this.nodes.forEach(is),this.nodes.forEach(ss),this.clearAllSnapshots(),kn.update(),kn.preRender(),kn.render())}clearAllSnapshots(){this.nodes.forEach(as),this.sharedNodes.forEach(ms)}scheduleUpdateProjection(){Ln.preRender(this.updateProjection,!1,!0)}scheduleCheckAfterUnmount(){Ln.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){if(this.snapshot||!this.instance)return;const t=this.measure(),e=this.removeTransform(this.removeElementScroll(t));ws(e),this.snapshot={measured:t,layout:e,latestValues:{}}}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.measure();ws(e);const n=this.layout;this.layout={measured:e,actual:this.removeElementScroll(e)},this.layoutCorrected={x:{min:0,max:0},y:{min:0,max:0}},this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.actual),null===(t=this.options.visualElement)||void 0===t||t.notifyLayoutMeasure(this.layout.actual,null==n?void 0:n.actual)}updateScroll(){this.options.layoutScroll&&this.instance&&(this.isScrollRoot=o(this.instance),this.scroll=n(this.instance))}resetTransform(){var t;if(!r)return;const e=this.isLayoutDirty||this.shouldResetTransform,n=this.projectionDelta&&!Ki(this.projectionDelta),o=null===(t=this.options.visualElement)||void 0===t?void 0:t.getProps().transformTemplate,i=null==o?void 0:o(this.latestValues,""),s=i!==this.prevTransformTemplateValue;e&&(n||Fr(this.latestValues)||s)&&(r(this.instance,i),this.shouldResetTransform=!1,this.scheduleRender())}measure(){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&&(Wr(e.x,n.x),Wr(e.y,n.y)),e}removeElementScroll(t){const e={x:{min:0,max:0},y:{min:0,max:0}};Hi(e,t);for(let n=0;n<this.path.length;n++){const o=this.path[n],{scroll:r,options:i,isScrollRoot:s}=o;if(o!==this.root&&r&&i.layoutScroll){if(s){Hi(e,t);const{scroll:n}=this.root;n&&(Wr(e.x,-n.x),Wr(e.y,-n.y))}Wr(e.x,r.x),Wr(e.y,r.y)}}return e}applyTransform(t,e=!1){const n={x:{min:0,max:0},y:{min:0,max:0}};Hi(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&&Xr(n,{x:-o.scroll.x,y:-o.scroll.y}),Fr(o.latestValues)&&Xr(n,o.latestValues)}return Fr(this.latestValues)&&Xr(n,this.latestValues),n}removeTransform(t){var e;const n={x:{min:0,max:0},y:{min:0,max:0}};Hi(n,t);for(let t=0;t<this.path.length;t++){const o=this.path[t];if(!o.instance)continue;if(!Fr(o.latestValues))continue;jr(o.latestValues)&&o.updateSnapshot();const r={x:{min:0,max:0},y:{min:0,max:0}};Hi(r,o.measure()),qi(n,o.latestValues,null===(e=o.snapshot)||void 0===e?void 0:e.layout,r)}return Fr(this.latestValues)&&qi(n,this.latestValues),n}setTargetDelta(t){this.targetDelta=t,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{layout:e,layoutId:n}=this.options;var o,r,i;this.layout&&(e||n)&&(this.targetDelta||this.relativeTarget||(this.relativeParent=this.getClosestProjectingParent(),this.relativeParent&&this.relativeParent.layout&&(this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},Pr(this.relativeTargetOrigin,this.layout.actual,this.relativeParent.layout.actual),Hi(this.relativeTarget,this.relativeTargetOrigin))),(this.relativeTarget||this.targetDelta)&&(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)?(o=this.target,r=this.relativeTarget,i=this.relativeParent.target,Sr(o.x,r.x,i.x),Sr(o.y,r.y,i.y)):this.targetDelta?(Boolean(this.resumingFrom)?this.target=this.applyTransform(this.layout.actual):Hi(this.target,this.layout.actual),Nr(this.target,this.targetDelta)):Hi(this.target,this.layout.actual),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.relativeParent=this.getClosestProjectingParent(),this.relativeParent&&Boolean(this.relativeParent.resumingFrom)===Boolean(this.resumingFrom)&&!this.relativeParent.options.layoutScroll&&this.relativeParent.target&&(this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},Pr(this.relativeTargetOrigin,this.target,this.relativeParent.target),Hi(this.relativeTarget,this.relativeTargetOrigin)))))}getClosestProjectingParent(){if(this.parent&&!Fr(this.parent.latestValues))return(this.parent.relativeTarget||this.parent.targetDelta)&&this.parent.layout?this.parent:this.parent.getClosestProjectingParent()}calcProjection(){var t;const{layout:e,layoutId:n}=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||!e&&!n)return;const o=this.getLead();Hi(this.layoutCorrected,this.layout.actual),function(t,e,n,o=!1){var r,i;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===(i=null===(r=a.instance)||void 0===r?void 0:r.style)||void 0===i?void 0:i.display)&&(o&&a.options.layoutScroll&&a.scroll&&a!==a.root&&Xr(t,{x:-a.scroll.x,y:-a.scroll.y}),l&&(e.x*=l.x.scale,e.y*=l.y.scale,Nr(t,l)),o&&Fr(a.latestValues)&&Xr(t,a.latestValues))}(this.layoutCorrected,this.treeScale,this.path,Boolean(this.resumingFrom)||this!==o);const{target:r}=o;if(!r)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 i=this.treeScale.x,s=this.treeScale.y,a=this.projectionTransform;Er(this.projectionDelta,this.layoutCorrected,r,this.latestValues),this.projectionTransform=ts(this.projectionDelta,this.treeScale),this.projectionTransform===a&&this.treeScale.x===i&&this.treeScale.y===s||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",r))}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;const o=this.snapshot,r=(null==o?void 0:o.latestValues)||{},i={...this.latestValues},s={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 a={x:{min:0,max:0},y:{min:0,max:0}},l=null==o?void 0:o.isShared,u=((null===(n=this.getStack())||void 0===n?void 0:n.members.length)||0)<=1,c=Boolean(l&&!u&&!0===this.options.crossfade&&!this.path.some(ys));this.animationProgress=0,this.mixTargetDelta=e=>{var n;const o=e/1e3;var d,h,f,m;ps(s.x,t.x,o),ps(s.y,t.y,o),this.setTargetDelta(s),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&(null===(n=this.relativeParent)||void 0===n?void 0:n.layout)&&(Pr(a,this.layout.actual,this.relativeParent.layout.actual),d=this.relativeTarget,h=this.relativeTargetOrigin,f=a,m=o,gs(d.x,h.x,f.x,m),gs(d.y,h.y,f.y,m)),l&&(this.animationValues=i,function(t,e,n,o,r,i){var s,a,l,u;r?(t.opacity=Be(0,null!==(s=n.opacity)&&void 0!==s?s:1,Ui(o)),t.opacityExit=Be(null!==(a=e.opacity)&&void 0!==a?a:1,0,zi(o))):i&&(t.opacity=Be(null!==(l=e.opacity)&&void 0!==l?l:1,null!==(u=n.opacity)&&void 0!==u?u:1,o));for(let r=0;r<ji;r++){const i=`border${Di[r]}Radius`;let s=Bi(e,i),a=Bi(n,i);if(void 0===s&&void 0===a)continue;s||(s=0),a||(a=0);0===s||0===a||Ii(s)===Ii(a)?(t[i]=Math.max(Be(Fi(s),Fi(a),o),0),(ot.test(a)||ot.test(s))&&(t[i]+="%")):t[i]=a}(e.rotate||n.rotate)&&(t.rotate=Be(e.rotate||0,n.rotate||0,o))}(i,r,this.latestValues,o,c,u)),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=Ln.update(()=>{P.hasAnimatedSinceResize=!0,this.currentAnimation=ki(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:r}=t;if(e&&n&&o){if(this!==t&&this.layout&&o&&Es(this.options.animationType,this.layout.actual,o.actual)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const e=xr(this.layout.actual.x);n.x.min=t.target.x.min,n.x.max=n.x.min+e;const o=xr(this.layout.actual.y);n.y.min=t.target.y.min,n.y.max=n.y.min+o}Hi(e,n),Xr(e,r),Er(this.projectionDeltaWithTransform,this.layoutCorrected,e,r)}}registerSharedNode(t,e){var n,o,r;this.sharedNodes.has(t)||this.sharedNodes.set(t,new Qi);this.sharedNodes.get(t).add(e),e.promote({transition:null===(n=e.options.initialPromotionConfig)||void 0===n?void 0:n.transition,preserveFollowOpacity:null===(r=null===(o=e.options.initialPromotionConfig)||void 0===o?void 0:o.shouldPreserveFollowOpacity)||void 0===r?void 0:r.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 n={};for(let o=0;o<os.length;o++){const r="rotate"+os[o];t.getStaticValue(r)&&(e=!0,n[r]=t.getStaticValue(r),t.setStaticValue(r,0))}if(e){null==t||t.syncRender();for(const e in n)t.setStaticValue(e,n[e]);t.scheduleRender()}}getProjectionStyles(t={}){var e,n,o;const r={};if(!this.instance||this.isSVG)return r;if(!this.isVisible)return{visibility:"hidden"};r.visibility="";const i=null===(e=this.options.visualElement)||void 0===e?void 0:e.getProps().transformTemplate;if(this.needsReset)return this.needsReset=!1,r.opacity="",r.pointerEvents=Qt(t.pointerEvents)||"",r.transform=i?i(this.latestValues,""):"none",r;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=Qt(t.pointerEvents)||""),this.hasProjected&&!Fr(this.latestValues)&&(e.transform=i?i({},""):"none",this.hasProjected=!1),e}const a=s.animationValues||s.latestValues;this.applyTransformsToTarget(),r.transform=ts(this.projectionDeltaWithTransform,this.treeScale,a),i&&(r.transform=i(a,r.transform));const{x:l,y:u}=this.projectionDelta;r.transformOrigin=`${100*l.origin}% ${100*u.origin}% 0`,s.animationValues?r.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:r.opacity=s===this?void 0!==a.opacity?a.opacity:"":void 0!==a.opacityExit?a.opacityExit:0;for(const t in F){if(void 0===a[t])continue;const{correct:e,applyTo:n}=F[t],o=e(a[t],s);if(n){const t=n.length;for(let e=0;e<t;e++)r[n[e]]=o}else r[t]=o}return this.options.layoutId&&(r.pointerEvents=s===this?Qt(t.pointerEvents)||"":"none"),r}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(ls),this.root.sharedNodes.clear()}}}function is(t){t.updateLayout()}function ss(t){var e,n,o;const r=(null===(e=t.resumeFrom)||void 0===e?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&r&&t.hasListeners("didUpdate")){const{actual:e,measured:n}=t.layout,{animationType:o}=t.options;"size"===o?Or(t=>{const n=r.isShared?r.measured[t]:r.layout[t],o=xr(n);n.min=e[t].min,n.max=n.min+o}):Es(o,r.layout,e)&&Or(t=>{const n=r.isShared?r.measured[t]:r.layout[t],o=xr(e[t]);n.max=n.min+o});const i={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};Er(i,e,r.layout);const s={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};r.isShared?Er(s,t.applyTransform(n,!0),r.measured):Er(s,e,r.layout);const a=!Ki(i);let l=!1;if(!t.resumeFrom&&(t.relativeParent=t.getClosestProjectingParent(),t.relativeParent&&!t.relativeParent.resumeFrom)){const{snapshot:n,layout:o}=t.relativeParent;if(n&&o){const t={x:{min:0,max:0},y:{min:0,max:0}};Pr(t,r.layout,n.layout);const i={x:{min:0,max:0},y:{min:0,max:0}};Pr(i,e,o.actual),_i(t,i)||(l=!0)}}t.notifyListeners("didUpdate",{layout:e,snapshot:r,delta:s,layoutDelta:i,hasLayoutChanged:a,hasRelativeTargetChanged:l})}else t.isLead()&&(null===(o=(n=t.options).onExitComplete)||void 0===o||o.call(n));t.options.transition=void 0}function as(t){t.clearSnapshot()}function ls(t){t.clearMeasurements()}function us(t){const{visualElement:e}=t.options;(null==e?void 0:e.getProps().onBeforeLayoutMeasure)&&e.notifyBeforeLayoutMeasure(),t.resetTransform()}function cs(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0}function ds(t){t.resolveTargetDelta()}function hs(t){t.calcProjection()}function fs(t){t.resetRotation()}function ms(t){t.removeLeadSnapshot()}function ps(t,e,n){t.translate=Be(e.translate,0,n),t.scale=Be(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function gs(t,e,n,o){t.min=Be(e.min,n.min,o),t.max=Be(e.max,n.max,o)}function ys(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}const vs={duration:.45,ease:[.4,0,.1,1]};function xs(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 bs(t){t.min=Math.round(t.min),t.max=Math.round(t.max)}function ws(t){bs(t.x),bs(t.y)}function Es(t,e,n){return"position"===t||"preserve-aspect"===t&&!function(t,e,n=.01){return Yn(t,e)<=n}(Ji(e),Ji(n))}const Ss=rs({attachResizeListener:(t,e)=>se(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),As={current:void 0},Ps=rs({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!As.current){const t=new Ss(0,{});t.mount(window),t.setOptions({layoutScroll:!0}),As.current=t}return As.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)}),Ts={...dr,...co,..._r,...Oi},Cs=k((t,e)=>re(t,e,Ts,Ti,Ps));const Vs=k(re);function Ms(){const t=e.useRef(!1);return d(()=>(t.current=!0,()=>{t.current=!1}),[]),t}function Rs(){const t=Ms(),[n,o]=e.useState(0),r=e.useCallback(()=>{t.current&&o(n+1)},[n]);return[e.useCallback(()=>Ln.postRender(r),[r]),n]}class Ls extends i.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 Os({children:t,isPresent:n}){const o=e.useId(),r=e.useRef(null),s=e.useRef({width:0,height:0,top:0,left:0});return e.useInsertionEffect(()=>{const{width:t,height:e,top:i,left:a}=s.current;if(n||!r.current||!t||!e)return;r.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: ${i}px !important;\n left: ${a}px !important;\n }\n `),()=>{document.head.removeChild(l)}},[n]),i.createElement(Ls,{isPresent:n,childRef:r,sizeRef:s},i.cloneElement(t,{ref:r}))}const ks=({children:t,initial:n,isPresent:o,onExitComplete:r,custom:s,presenceAffectsLayout:a,mode:l})=>{const c=A(Ds),d=e.useId(),h=e.useMemo(()=>({id:d,initial:n,isPresent:o,custom:s,onExitComplete:t=>{c.set(t,!0);for(const t of c.values())if(!t)return;r&&r()},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]),i.useEffect(()=>{!o&&!c.size&&r&&r()},[o]),"popLayout"===l&&(t=i.createElement(Os,{isPresent:o},t)),i.createElement(u.Provider,{value:h},t)};function Ds(){return new Map}const js=t=>t.key||"";const Fs=e.createContext(null),Is=t=>!t.isLayoutDirty&&t.willUpdate(!1);function Bs(){const t=new Set,e=new WeakMap,n=()=>t.forEach(Is);return{add:o=>{t.add(o),e.set(o,o.addEventListener("willUpdate",n))},remove:o=>{var r;t.delete(o),null===(r=e.get(o))||void 0===r||r(),e.delete(o),n()},dirty:n}}const Us=t=>!0===t,zs=({children:t,id:n,inheritId:o,inherit:r=!0})=>{void 0!==o&&(r=o);const s=e.useContext(C),a=e.useContext(Fs),[l,u]=Rs(),c=e.useRef(null),d=s.id||a;null===c.current&&((t=>Us(!0===t)||"id"===t)(r)&&d&&(n=n?d+"-"+n:d),c.current={id:n,group:Us(r)&&s.group||Bs()});const h=e.useMemo(()=>({...c.current,forceRender:l}),[u]);return i.createElement(C.Provider,{value:h},t)};let Ns=0;function Ws(t){return"function"==typeof t}const Hs=e.createContext(null);const $s=e.forwardRef((function({children:t,as:n="ul",axis:o="y",onReorder:r,values:s,...a},l){const u=A(()=>Cs(n)),c=[],d=e.useRef(!1),h={axis:o,registerItem:(t,e)=>{e&&-1===c.findIndex(e=>t===e.value)&&(c.push({value:t,layout:e[o]}),c.sort(Xs))},updateOrder:(t,e,n)=>{if(d.current)return;const o=function(t,e,n,o){if(!o)return t;const r=t.findIndex(t=>t.value===e);if(-1===r)return t;const i=o>0?1:-1,s=t[r+i];if(!s)return t;const a=t[r],l=s.layout,u=Be(l.min,l.max,.5);return 1===i&&a.layout.max+n>u||-1===i&&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,[r]=t.splice(e,1);t.splice(o,0,r)}return t}(t,r,r+i):t}(c,t,e,n);c!==o&&(d.current=!0,r(o.map(Ys).filter(t=>-1!==s.indexOf(t))))}};return e.useEffect(()=>{d.current=!1}),i.createElement(u,{...a,ref:l},i.createElement(Hs.Provider,{value:h},t))}));function Ys(t){return t.value}function Xs(t,e){return t.layout.min-e.layout.min}function Gs(t){const n=A(()=>zo(t)),{isStatic:o}=e.useContext(s);if(o){const[,o]=e.useState(t);e.useEffect(()=>n.onChange(o),[])}return n}function qs(...t){const e=!Array.isArray(t[0]),n=e?0:-1,o=t[0+n],r=t[1+n],i=t[2+n],s=t[3+n],a=en(r,i,{mixer:(l=i[0],(t=>"object"==typeof t&&t.mix)(l)?l.mix:void 0),...s});var l;return e?a(o):a}function Zs(t,e){const n=Gs(e()),o=()=>n.set(e());return o(),function(t,e){d(()=>{const n=t.map(t=>t.onChange(e));return()=>n.forEach(t=>t())})}(t,()=>Ln.update(o,!1,!0)),n}function Ks(t,e,n,o){const r="function"==typeof e?e:qs(e,n,o);return Array.isArray(t)?_s(t,r):_s([t],([t])=>r(t))}function _s(t,e){const n=A(()=>[]);return Zs(t,()=>{n.length=0;const o=t.length;for(let e=0;e<o;e++)n[e]=t[e].get();return e(n)})}function Js(t,e=0){return N(t)?t:Gs(e)}const Qs={Group:$s,Item:e.forwardRef((function({children:t,style:n={},value:o,as:r="li",onDrag:s,layout:a=!0,...l},u){const c=A(()=>Cs(r)),d=e.useContext(Hs),h={x:Js(n.x),y:Js(n.y)},f=Ks([h.x,h.y],([t,e])=>t||e?1:"unset"),m=e.useRef(null),{axis:p,registerItem:g,updateOrder:y}=d;return e.useEffect(()=>{g(o,m.current)},[d]),i.createElement(c,{drag:p,...l,dragSnapToOrigin:!0,style:{...n,x:h.x,y:h.y,zIndex:f},layout:a,onDrag:(t,e)=>{const{velocity:n}=e;n[p]&&y(o,h[p].get(),n[p]),s&&s(t,e)},onLayoutMeasure:t=>{m.current=t},ref:u},t)}))},ta={renderer:Ti,...dr,...co},ea={...ta,..._r,...Oi,projectionNodeConstructor:Ps};const na=t=>"number"==typeof t;function oa(t,e){return(t=>Array.isArray(t)&&!na(t[0]))(t)?t[((t,e,n)=>{const o=e-t;return((n-t)%o+o)%o+t})(0,t.length,e)]:t}const ra=(t,e,n)=>-n*t+n*e+t,ia=t=>t,sa=(t,e,n)=>e-t==0?1:(n-t)/(e-t);function aa(t,e){const n=t[t.length-1];for(let o=1;o<=e;o++){const r=sa(0,e,o);t.push(ra(n,1,r))}}function la(t){const e=[0];return aa(e,t-1),e}function ua(t,e=la(t.length),n=ia){const o=t.length,r=o-e.length;return r>0&&aa(e,r),r=>{let i=0;for(;i<o-2&&!(r<e[i+1]);i++);let s=(a=0,l=1,u=sa(e[i],e[i+1],r),Math.min(Math.max(u,a),l));var a,l,u;return s=oa(n,i)(s),ra(t[i],t[i+1],s)}}const ca=t=>"function"==typeof t,da=t=>"string"==typeof t;function ha(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 fa={any:0,all:1};const ma=new WeakMap;let pa;function ga({target:t,contentRect:e,borderBoxSize:n}){var o;null===(o=ma.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 ya(t){t.forEach(ga)}function va(t,e){pa||"undefined"!=typeof ResizeObserver&&(pa=new ResizeObserver(ya));const n=ha(t);return n.forEach(t=>{let n=ma.get(t);n||(n=new Set,ma.set(t,n)),n.add(e),null==pa||pa.observe(t)}),()=>{n.forEach(t=>{const n=ma.get(t);null==n||n.delete(e),(null==n?void 0:n.size)||null==pa||pa.unobserve(t)})}}const xa=new Set;let ba;function wa(t){return xa.add(t),ba||(ba=()=>{const t={width:window.innerWidth,height:window.innerHeight},e={target:window,size:t,contentSize:t};xa.forEach(t=>t(e))},window.addEventListener("resize",ba)),()=>{xa.delete(t),!xa.size&&ba&&(ba=void 0)}}const Ea={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}};function Sa(t,e,n,o){const r=n[e],{length:i,position:s}=Ea[e],a=r.current,l=n.time;r.current=t["scroll"+s],r.scrollLength=t["scroll"+i]-t["client"+i],r.offset.length=0,r.offset[0]=0,r.offset[1]=r.scrollLength,r.progress=sa(0,r.scrollLength,r.current);const u=o-l;var c,d;r.velocity=u>50?0:(c=r.current-a,(d=u)?c*(1e3/d):0)}const Aa={Enter:[[0,1],[1,1]],Exit:[[0,0],[1,0]],Any:[[1,0],[0,1]],All:[[0,0],[1,1]]},Pa={start:0,center:.5,end:1};function Ta(t,e,n=0){let o=0;if(void 0!==Pa[t]&&(t=Pa[t]),da(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 na(t)&&(o=e*t),n+o}const Ca=[0,0];function Va(t,e,n,o){let r=Array.isArray(t)?t:Ca,i=0,s=0;return na(t)?r=[t,t]:da(t)&&(r=(t=t.trim()).includes(" ")?t.split(" "):[t,Pa[t]?t:"0"]),i=Ta(r[0],n,o),s=Ta(r[1],e),i-s}const Ma={x:0,y:0};function Ra(t,e,n){let{offset:o=Aa.All}=n;const{target:r=t,axis:i="y"}=n,s="y"===i?"height":"width",a=r!==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}(r,t):Ma,l=r===t?{width:t.scrollWidth,height:t.scrollHeight}:{width:r.clientWidth,height:r.clientHeight},u={width:t.clientWidth,height:t.clientHeight};e[i].offset.length=0;let c=!e[i].interpolate;const d=o.length;for(let t=0;t<d;t++){const n=Va(o[t],u[s],l[s],a[i]);c||n===e[i].interpolatorOffsets[t]||(c=!0),e[i].offset[t]=n}c&&(e[i].interpolate=ua(la(d),e[i].offset),e[i].interpolatorOffsets=[...e[i].offset]),e[i].progress=e[i].interpolate(e[i].current)}function La(t,e,n,o={}){const r=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){Sa(t,"x",e,n),Sa(t,"y",e,n),e.time=n}(t,n,e),(o.offset||o.target)&&Ra(t,n,o)},notify:ca(e)?()=>e(n):Oa(e,n[r])}}function Oa(t,e){return t.pause(),t.forEachNative((t,{easing:e})=>{var n,o;if(t.updateDuration)e||(t.easing=ia),t.updateDuration(1);else{const r={duration:1e3};e||(r.easing="linear"),null===(o=null===(n=t.effect)||void 0===n?void 0:n.updateTiming)||void 0===o||o.call(n,r)}}),()=>{t.currentTime=e.progress}}const ka=new WeakMap,Da=new WeakMap,ja=new WeakMap,Fa=t=>t===document.documentElement?window:t;function Ia(t,e={}){var{container:n=document.documentElement}=e,o=Ve(e,["container"]);let r=ja.get(n);r||(r=new Set,ja.set(n,r));const i=La(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(r.add(i),!ka.has(n)){const t=()=>{const t=performance.now();for(const t of r)t.measure();for(const e of r)e.update(t);for(const t of r)t.notify()};ka.set(n,t);const e=Fa(n);window.addEventListener("resize",t,{passive:!0}),n!==document.documentElement&&Da.set(n,function(t,e){return ca(t)?wa(t):va(t,e)}(n,t)),e.addEventListener("scroll",t,{passive:!0})}const s=ka.get(n),a=requestAnimationFrame(s);return()=>{var e;"function"!=typeof t&&t.stop(),cancelAnimationFrame(a);const o=ja.get(n);if(!o)return;if(o.delete(i),o.size)return;const r=ka.get(n);ka.delete(n),r&&(Fa(n).removeEventListener("scroll",r),null===(e=Da.get(n))||void 0===e||e(),window.removeEventListener("resize",r))}}const Ba=()=>({scrollX:zo(0),scrollY:zo(0),scrollXProgress:zo(0),scrollYProgress:zo(0)});function Ua({container:t,target:e,...n}={}){const o=A(Ba);return d(()=>Ia(({x:t,y:e})=>{o.scrollX.set(t.current),o.scrollXProgress.set(t.progress),o.scrollY.set(e.current),o.scrollYProgress.set(e.progress)},{...n,container:(null==t?void 0:t.current)||void 0,target:(null==e?void 0:e.current)||void 0}),[]),o}function za(t){const n=e.useRef(0),{isStatic:o}=e.useContext(s);e.useEffect(()=>{if(o)return;const e=({timestamp:e})=>{n.current||(n.current=e),t(e-n.current)};return Ln.update(e,!0),()=>On.update(e)},[t])}class Na extends Uo{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")||$(t)||"willChange"===t||(e=$t(t)),e&&(Fo(this.members,e),this.update())}remove(t){U.has(t)?(this.transforms.delete(t),this.transforms.size||Io(this.members,"transform")):Io(this.members,$t(t)),this.update()}update(){this.set(this.members.length?this.members.join(", "):"auto")}}function Wa(){!Qr.current&&ti();const[t]=e.useState(Jr.current);return t}function Ha(){let t=!1;const e=[],n=new Set,o={subscribe:t=>(n.add(t),()=>{n.delete(t)}),start(o,r){if(t){const t=[];return n.forEach(e=>{t.push(tr(e,o,{transitionOverride:r}))}),Promise.all(t)}return new Promise(t=>{e.push({animation:[o,r],resolve:t})})},set:t=>n.forEach(e=>{!function(t,e){Array.isArray(e)?Zo(t,e):"string"==typeof e?Zo(t,[e]):qo(t,e)}(e,t)}),stop(){n.forEach(t=>{!function(t){t.forEachValue(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 $a(){const t=A(Ha);return e.useEffect(t.mount,[]),t}const Ya=$a;class Xa{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 Ga=()=>new Xa;function qa(t){return null!==t&&"object"==typeof t&&R in t}function Za(){return Ka}function Ka(t){As.current&&(As.current.isUpdating=!1,As.current.blockUpdate(),t&&t())}const _a=()=>({}),Ja=ri({build(){},measureViewportBox:Lr,resetTransform(){},restoreTransform(){},removeValueFromRenderState(){},render(){},scrapeMotionValuesFromProps:_a,readValueFromInstance:(t,e,n)=>n.initialState[e]||0,makeTargetAnimatable:(t,{transition:e,transitionEnd:n,...o})=>(Ko(t,o,Jo(o,e||{},t)),{transition:e,transitionEnd:n,...o})}),Qa=te({scrapeMotionValuesFromProps:_a,createRenderState:_a});const tl=t=>t>.001?1/t:1e5;t.AnimatePresence=({children:t,custom:n,initial:o=!0,onExitComplete:r,exitBeforeEnter:s,presenceAffectsLayout:a=!0,mode:l="sync"})=>{s&&(l="wait",to(!1,"Replace exitBeforeEnter with mode='wait'"));let[u]=Rs();const c=e.useContext(C).forceRender;c&&(u=c);const h=Ms(),f=function(t){const n=[];return e.Children.forEach(t,t=>{e.isValidElement(t)&&n.push(t)}),n}(t);let m=f;const p=new Set,g=e.useRef(m),y=e.useRef(new Map).current,v=e.useRef(!0);if(d(()=>{v.current=!1,function(t,e){t.forEach(t=>{const n=js(t);e.set(n,t)})}(f,y),g.current=m}),Ce(()=>{v.current=!0,y.clear(),p.clear()}),v.current)return i.createElement(i.Fragment,null,m.map(t=>i.createElement(ks,{key:js(t),isPresent:!0,initial:!!o&&void 0,presenceAffectsLayout:a,mode:l},t)));m=[...m];const x=g.current.map(js),b=f.map(js),w=x.length;for(let t=0;t<w;t++){const e=x[t];-1===b.indexOf(e)&&p.add(e)}return"wait"===l&&p.size&&(m=[]),p.forEach(t=>{if(-1!==b.indexOf(t))return;const e=y.get(t);if(!e)return;const o=x.indexOf(t);m.splice(o,0,i.createElement(ks,{key:js(e),isPresent:!1,onExitComplete:()=>{y.delete(t),p.delete(t);const e=g.current.findIndex(e=>e.key===t);if(g.current.splice(e,1),!p.size){if(g.current=f,!1===h.current)return;u(),r&&r()}},custom:n,presenceAffectsLayout:a,mode:l},e))}),m=m.map(t=>{const e=t.key;return p.has(e)?t:i.createElement(ks,{key:js(t),isPresent:!0,presenceAffectsLayout:a,mode:l},t)}),"production"!==Jn&&"wait"===l&&m.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.'),i.createElement(i.Fragment,null,p.size?m:m.map(t=>e.cloneElement(t)))},t.AnimateSharedLayout=({children:t})=>(i.useEffect(()=>{},[]),i.createElement(zs,{id:A(()=>"asl-"+Ns++)},t)),t.DeprecatedLayoutGroupContext=Fs,t.DragControls=Xa,t.FlatTree=ns,t.LayoutGroup=zs,t.LayoutGroupContext=C,t.LazyMotion=function({children:t,features:n,strict:o=!1}){const[,r]=e.useState(!Ws(n)),s=e.useRef(void 0);if(!Ws(n)){const{renderer:t,...e}=n;s.current=t,S(e)}return e.useEffect(()=>{Ws(n)&&n().then(({renderer:t,...e})=>{S(e),s.current=t,r(!0)})},[]),i.createElement(h.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=A(()=>o.isStatic);const r=e.useMemo(()=>o,[JSON.stringify(o.transition),o.transformPagePoint,o.reducedMotion]);return i.createElement(s.Provider,{value:r},t)},t.MotionConfigContext=s,t.MotionContext=a,t.MotionValue=Uo,t.PresenceContext=u,t.Reorder=Qs,t.SwitchLayoutGroupContext=M,t.addPointerEvent=ve,t.addScaleCorrector=I,t.animate=ki,t.animateVisualElement=tr,t.animationControls=Ha,t.animations=dr,t.calcLength=xr,t.checkTargetForNewValues=Ko,t.createBox=Lr,t.createDomMotionComponent=function(t){return L(re(t,{forwardMotionProps:!1},Ts,Ti,Ps))},t.createMotionComponent=L,t.domAnimation=ta,t.domMax=ea,t.filterProps=Ft,t.isBrowser=c,t.isDragActive=Ae,t.isMotionComponent=qa,t.isMotionValue=N,t.isValidMotionProp=kt,t.m=Vs,t.makeUseVisualState=te,t.motion=Cs,t.motionValue=zo,t.resolveMotionValue=Qt,t.transform=qs,t.unwrapMotionComponent=function(t){if(qa(t))return t[R]},t.useAnimation=Ya,t.useAnimationControls=$a,t.useAnimationFrame=za,t.useCycle=function(...t){const n=e.useRef(0),[o,r]=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,r(t[n.current])},[t.length,...t])]},t.useDeprecatedAnimatedState=function(t){const[n,o]=e.useState(t),r=Qa({},!1),i=A(()=>Ja({props:{},visualState:r},{initialState:t}));return e.useEffect(()=>(i.mount({}),i.unmount),[i]),e.useEffect(()=>{i.setProps({onUpdate:t=>{o({...t})}})},[o,i]),[n,A(()=>t=>tr(i,t))]},t.useDeprecatedInvertedScale=function(t){let e=Gs(1),n=Gs(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:Ks(e,tl),scaleY:Ks(n,tl)}},t.useDomEvent=ae,t.useDragControls=function(){return A(Ga)},t.useElementScroll=function(t){return to(!1,"useElementScroll is deprecated. Convert to useScroll({ container: ref })."),Ua({container:t})},t.useForceUpdate=Rs,t.useInView=function(t,{root:n,margin:o,amount:r,once:i=!1}={}){const[s,a]=e.useState(!1);return e.useEffect(()=>{if(!t.current||i&&s)return;const e={root:n&&n.current||void 0,margin:o,amount:"some"===r?"any":r};return function(t,e,{root:n,margin:o,amount:r="any"}={}){if("undefined"==typeof IntersectionObserver)return()=>{};const i=ha(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);ca(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 r?r:fa[r]});return i.forEach(t=>a.observe(t)),()=>a.disconnect()}(t.current,()=>(a(!0),i?void 0:()=>a(!1)),e)},[n,t,o,i]),s},t.useInstantLayoutTransition=Za,t.useInstantTransition=function(){const[t,n]=Rs(),o=Za();return e.useEffect(()=>{Ln.postRender(()=>Ln.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=d,t.useMotionTemplate=function(t,...e){const n=t.length;return Zs(e,(function(){let o="";for(let r=0;r<n;r++){o+=t[r];e[r]&&(o+=e[r].get())}return o}))},t.useMotionValue=Gs,t.usePresence=ho,t.useReducedMotion=Wa,t.useReducedMotionConfig=function(){const t=Wa(),{reducedMotion:n}=e.useContext(s);return"never"!==n&&("always"===n||t)},t.useResetProjection=function(){return i.useCallback(()=>{const t=As.current;t&&t.resetTree()},[])},t.useScroll=Ua,t.useSpring=function(t,n={}){const{isStatic:o}=e.useContext(s),r=e.useRef(null),i=Gs(N(t)?t.get():t);return e.useMemo(()=>i.attach((t,e)=>o?e(t):(r.current&&r.current.stop(),r.current=zn({from:i.get(),to:t,velocity:i.getVelocity(),...n,onUpdate:e}),i.get())),[JSON.stringify(n)]),function(t,e){d(()=>{if(N(t))return t.onChange(e)},[e])}(t,t=>i.set(parseFloat(t))),i},t.useTime=function(){const t=Gs(0);return za(e=>t.set(e)),t},t.useTransform=Ks,t.useUnmountEffect=Ce,t.useVelocity=function(t){const n=Gs(t.getVelocity());return e.useEffect(()=>t.velocityUpdateSubscribers.add(t=>{n.set(t)}),[t]),n},t.useViewportScroll=function(){return to(!1,"useViewportScroll is deprecated. Convert to useScroll()."),Ua()},t.useVisualElementContext=l,t.useWillChange=function(){return A(()=>new Na("auto"))},t.visualElement=ri,t.wrapHandler=me,Object.defineProperty(t,"__esModule",{value:!0})}));