framer-motion 8.5.2 → 8.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +16 -9
- package/dist/es/animation/optimized-appear/handoff.mjs +11 -4
- package/dist/es/animation/optimized-appear/start.mjs +4 -3
- package/dist/es/render/utils/motion-values.mjs +1 -1
- package/dist/es/value/index.mjs +1 -1
- package/dist/framer-motion.dev.js +16 -9
- package/dist/framer-motion.js +1 -1
- package/dist/projection.dev.js +2 -2
- package/dist/size-rollup-dom-animation.js +1 -1
- package/dist/size-rollup-dom-max.js +1 -1
- package/dist/size-rollup-motion.js +1 -1
- package/package.json +2 -2
package/dist/framer-motion.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Motion={},t.React)}(this,(function(t,e){"use strict";function n(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}function o(t){if(t&&t.__esModule)return t;var e=Object.create(null);return t&&Object.keys(t).forEach((function(n){if("default"!==n){var o=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,o.get?o:{enumerable:!0,get:function(){return t[n]}})}})),e.default=t,Object.freeze(e)}var i=n(e),r=o(e);const s=e.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),a=e.createContext({});function l(){return e.useContext(a).visualElement}const u=e.createContext(null),c="undefined"!=typeof document,h=c?e.useLayoutEffect:e.useEffect,d=e.createContext({strict:!1});function p(t){return"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}function f(t){return"string"==typeof t||Array.isArray(t)}function m(t){return"object"==typeof t&&"function"==typeof t.start}const g=["initial","animate","exit","whileHover","whileDrag","whileTap","whileFocus","whileInView"];function y(t){return m(t.animate)||g.some(e=>f(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||f(e)?e:void 0,animate:f(n)?n:void 0}}return!1!==t.inherit?e:{}}(t,e.useContext(a));return e.useMemo(()=>({initial:n,animate:o}),[E(n),E(o)])}function E(t){return Array.isArray(t)?t.join(" "):t}const w=t=>({isEnabled:e=>t.some(t=>!!e[t])}),T={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 b(t){for(const e in t)"projectionNodeConstructor"===e?T.projectionNodeConstructor=t[e]:T[e].Component=t[e]}function P(t){const n=e.useRef(null);return null===n.current&&(n.current=t()),n.current}const A={hasAnimatedSinceResize:!0,hasEverUpdated:!1};let S=1;const V=e.createContext({});class C extends i.default.Component{getSnapshotBeforeUpdate(){const{visualElement:t,props:e}=this.props;return t&&t.setProps(e),null}componentDidUpdate(){}render(){return this.props.children}}const M=e.createContext({}),R=Symbol.for("motionComponentSymbol");function L({preloadedFeatures:t,createVisualElement:n,projectionNodeConstructor:o,useRender:i,useVisualState:f,Component:m}){t&&b(t);const g=e.forwardRef((function(g,y){const v={...e.useContext(s),...g,layoutId:D(g)},{isStatic:E}=v;let w=null;const b=x(g),V=E?void 0:P(()=>{if(A.hasEverUpdated)return S++}),R=f(g,E);if(!E&&c){b.visualElement=function(t,n,o,i){const r=l(),a=e.useContext(d),c=e.useContext(u),p=e.useContext(s).reducedMotion,f=e.useRef();i=i||a.renderer,!f.current&&i&&(f.current=i(t,{visualState:n,parent:r,props:o,presenceId:c?c.id:void 0,blockInitialAnimation:!!c&&!1===c.initial,reducedMotionConfig:p}));const m=f.current;return h(()=>{m&&m.render()}),(window.HandoffAppearAnimations?h:e.useEffect)(()=>{m&&m.animationState&&m.animationState.animateChanges()}),m}(m,R,v,n);const i=e.useContext(d).strict,r=e.useContext(M);b.visualElement&&(w=b.visualElement.loadFeatures(v,i,t,V,o||T.projectionNodeConstructor,r))}return r.createElement(C,{visualElement:b.visualElement,props:v},w,r.createElement(a.Provider,{value:b},i(m,g,V,function(t,n,o){return e.useCallback(e=>{e&&t.mount&&t.mount(e),n&&(e?n.mount(e):n.unmount()),o&&("function"==typeof o?o(e):p(o)&&(o.current=e))},[n])}(R,b.visualElement,y),R,E,b.visualElement)))}));return g[R]=m,g}function D({layoutId:t}){const n=e.useContext(V).id;return n&&void 0!==t?n+"-"+t:t}function k(t){function e(e,n={}){return L(t(e,n))}if("undefined"==typeof Proxy)return e;const n=new Map;return new Proxy(e,{get:(t,o)=>(n.has(o)||n.set(o,e(o)),n.get(o))})}const B=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function I(t){return"string"==typeof t&&!t.includes("-")&&!!(B.indexOf(t)>-1||/[A-Z]/.test(t))}const O={};function j(t){Object.assign(O,t)}const F=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],U=new Set(F);function N(t,{layout:e,layoutId:n}){return U.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!O[t]||"opacity"===t)}const z=t=>!!(null==t?void 0:t.getVelocity),W={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},H=(t,e)=>F.indexOf(t)-F.indexOf(e);function $({transform:t,transformKeys:e},{enableHardwareAcceleration:n=!0,allowTransformNone:o=!0},i,r){let s="";e.sort(H);for(const n of e)s+=`${W[n]||n}(${t[n]}) `;return n&&!t.z&&(s+="translateZ(0)"),s=s.trim(),r?s=r(t,i?"":s):o&&i&&(s="none"),s}function Y(t){return t.startsWith("--")}const X=(t,e)=>e&&"number"==typeof t?e.transform(t):t,G=(t,e,n)=>Math.min(Math.max(n,t),e),q={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},Z={...q,transform:t=>G(0,1,t)},K={...q,default:1},_=t=>Math.round(1e5*t)/1e5,J=/(-)?([\d]*\.?[\d])+/g,Q=/(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,tt=/^(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function et(t){return"string"==typeof t}const nt=t=>({test:e=>et(e)&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),ot=nt("deg"),it=nt("%"),rt=nt("px"),st=nt("vh"),at=nt("vw"),lt={...it,parse:t=>it.parse(t)/100,transform:t=>it.transform(100*t)},ut={...q,transform:Math.round},ct={borderWidth:rt,borderTopWidth:rt,borderRightWidth:rt,borderBottomWidth:rt,borderLeftWidth:rt,borderRadius:rt,radius:rt,borderTopLeftRadius:rt,borderTopRightRadius:rt,borderBottomRightRadius:rt,borderBottomLeftRadius:rt,width:rt,maxWidth:rt,height:rt,maxHeight:rt,size:rt,top:rt,right:rt,bottom:rt,left:rt,padding:rt,paddingTop:rt,paddingRight:rt,paddingBottom:rt,paddingLeft:rt,margin:rt,marginTop:rt,marginRight:rt,marginBottom:rt,marginLeft:rt,rotate:ot,rotateX:ot,rotateY:ot,rotateZ:ot,scale:K,scaleX:K,scaleY:K,scaleZ:K,skew:ot,skewX:ot,skewY:ot,distance:rt,translateX:rt,translateY:rt,translateZ:rt,x:rt,y:rt,z:rt,perspective:rt,transformPerspective:rt,opacity:Z,originX:lt,originY:lt,originZ:rt,zIndex:ut,fillOpacity:Z,strokeOpacity:Z,numOctaves:ut};function ht(t,e,n,o){const{style:i,vars:r,transform:s,transformKeys:a,transformOrigin:l}=t;a.length=0;let u=!1,c=!1,h=!0;for(const t in e){const n=e[t];if(Y(t)){r[t]=n;continue}const o=ct[t],d=X(n,o);if(U.has(t)){if(u=!0,s[t]=d,a.push(t),!h)continue;n!==(o.default||0)&&(h=!1)}else t.startsWith("origin")?(c=!0,l[t]=d):i[t]=d}if(e.transform||(u||o?i.transform=$(t,n,h,o):i.transform&&(i.transform="none")),c){const{originX:t="50%",originY:e="50%",originZ:n=0}=l;i.transformOrigin=`${t} ${e} ${n}`}}const dt=()=>({style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}});function pt(t,e,n){for(const o in e)z(e[o])||N(o,n)||(t[o]=e[o])}function ft(t,n,o){const i={};return pt(i,t.style||{},t),Object.assign(i,function({transformTemplate:t},n,o){return e.useMemo(()=>{const e={style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}};return ht(e,n,{enableHardwareAcceleration:!o},t),Object.assign({},e.vars,e.style)},[n])}(t,n,o)),t.transformValues?t.transformValues(i):i}function mt(t,e,n){const o={},i=ft(t,e,n);return t.drag&&!1!==t.dragListener&&(o.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=!0===t.drag?"none":"pan-"+("x"===t.drag?"y":"x")),o.style=i,o}const gt=new Set(["initial","style","values","variants","transition","transformTemplate","transformValues","custom","inherit","layout","layoutId","layoutDependency","layoutScroll","layoutRoot","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","whileInView","onViewportEnter","onViewportLeave","viewport","whileTap","onTap","onTapStart","onTapCancel","animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView","onPan","onPanStart","onPanSessionStart","onPanEnd"]);function yt(t){return gt.has(t)}let vt=t=>!yt(t);function xt(t){t&&(vt=e=>e.startsWith("on")?!yt(e):t(e))}try{xt(require("@emotion/is-prop-valid").default)}catch(t){}function Et(t,e,n){const o={};for(const i in t)"values"===i&&"object"==typeof t.values||(vt(i)||!0===n&&yt(i)||!e&&!yt(i)||t.draggable&&i.startsWith("onDrag"))&&(o[i]=t[i]);return o}function wt(t,e,n){return"string"==typeof t?t:rt.transform(e+n*t)}const Tt={offset:"stroke-dashoffset",array:"stroke-dasharray"},bt={offset:"strokeDashoffset",array:"strokeDasharray"};function Pt(t,{attrX:e,attrY:n,originX:o,originY:i,pathLength:r,pathSpacing:s=1,pathOffset:a=0,...l},u,c,h){if(ht(t,l,u,h),c)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:d,style:p,dimensions:f}=t;d.transform&&(f&&(p.transform=d.transform),delete d.transform),f&&(void 0!==o||void 0!==i||p.transform)&&(p.transformOrigin=function(t,e,n){return`${wt(e,t.x,t.width)} ${wt(n,t.y,t.height)}`}(f,void 0!==o?o:.5,void 0!==i?i:.5)),void 0!==e&&(d.x=e),void 0!==n&&(d.y=n),void 0!==r&&function(t,e,n=1,o=0,i=!0){t.pathLength=1;const r=i?Tt:bt;t[r.offset]=rt.transform(-o);const s=rt.transform(e),a=rt.transform(n);t[r.array]=`${s} ${a}`}(d,r,s,a,!1)}const At=()=>({style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{},attrs:{}}),St=t=>"string"==typeof t&&"svg"===t.toLowerCase();function Vt(t,n,o,i){const r=e.useMemo(()=>{const e={style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{},attrs:{}};return Pt(e,n,{enableHardwareAcceleration:!1},St(i),t.transformTemplate),{...e.attrs,style:{...e.style}}},[n]);if(t.style){const e={};pt(e,t.style,t),r.style={...e,...r.style}}return r}function Ct(t=!1){return(n,o,i,r,{latestValues:s},a)=>{const l=(I(n)?Vt:mt)(o,s,a,n),u={...Et(o,"string"==typeof n,t),...l,ref:r},{children:c}=o,h=e.useMemo(()=>z(c)?c.get():c,[c]);return i&&(u["data-projection-id"]=i),e.createElement(n,{...u,children:h})}}const Mt=t=>t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();function Rt(t,{style:e,vars:n},o,i){Object.assign(t.style,e,i&&i.getProjectionStyles(o));for(const e in n)t.style.setProperty(e,n[e])}const Lt=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function Dt(t,e,n,o){Rt(t,e,void 0,o);for(const n in e.attrs)t.setAttribute(Lt.has(n)?n:Mt(n),e.attrs[n])}function kt(t,e){const{style:n}=t,o={};for(const i in n)(z(n[i])||e.style&&z(e.style[i])||N(i,t))&&(o[i]=n[i]);return o}function Bt(t,e){const n=kt(t,e);for(const o in t)if(z(t[o])||z(e[o])){n["x"===o||"y"===o?"attr"+o.toUpperCase():o]=t[o]}return n}function It(t,e,n,o={},i={}){return"function"==typeof e&&(e=e(void 0!==n?n:t.custom,o,i)),"string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e&&(e=e(void 0!==n?n:t.custom,o,i)),e}const Ot=t=>Array.isArray(t);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 Ft=t=>(n,o)=>{const i=e.useContext(a),r=e.useContext(u),s=()=>function({scrapeMotionValuesFromProps:t,createRenderState:e,onMount:n},o,i,r){const s={latestValues:Ut(o,i,r,t),renderState:e()};return n&&(s.mount=t=>n(o,t,s)),s}(t,n,i,r);return o?s():P(s)};function Ut(t,e,n,o){const i={},r=o(t,{});for(const t in r)i[t]=jt(r[t]);let{initial:s,animate:a}=t;const l=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 h=c?a:s;if(h&&"boolean"!=typeof h&&!m(h)){(Array.isArray(h)?h:[h]).forEach(e=>{const n=It(t,e);if(!n)return;const{transitionEnd:o,transition:r,...s}=n;for(const t in s){let e=s[t];if(Array.isArray(e)){e=e[c?e.length-1:0]}null!==e&&(i[t]=e)}for(const t in o)i[t]=o[t]})}return i}const Nt={useVisualState:Ft({scrapeMotionValuesFromProps:Bt,createRenderState:At,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}}Pt(n,o,{enableHardwareAcceleration:!1},St(e.tagName),t.transformTemplate),Dt(e,n)}})},zt={useVisualState:Ft({scrapeMotionValuesFromProps:kt,createRenderState:dt})};function Wt(t,{forwardMotionProps:e=!1},n,o,i){return{...I(t)?Nt:zt,preloadedFeatures:n,useRender:Ct(e),createVisualElement:o,projectionNodeConstructor:i,Component:t}}var Ht;function $t(t,e,n,o={passive:!0}){return t.addEventListener(e,n,o),()=>t.removeEventListener(e,n)}function Yt(t,n,o,i){e.useEffect(()=>{const e=t.current;if(o&&e)return $t(e,n,o,i)},[t,n,o,i])}t.AnimationType=void 0,(Ht=t.AnimationType||(t.AnimationType={})).Animate="animate",Ht.Hover="whileHover",Ht.Tap="whileTap",Ht.Drag="whileDrag",Ht.Focus="whileFocus",Ht.InView="whileInView",Ht.Exit="exit";const Xt=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary;function Gt(t,e="page"){return{point:{x:t[e+"X"],y:t[e+"Y"]}}}const qt=t=>e=>Xt(e)&&t(e,Gt(e));function Zt(t,e,n,o){return $t(t,e,qt(n),o)}function Kt(t,e,n,o){return Yt(t,e,n&&qt(n),o)}function _t(t){let e=null;return()=>{const n=()=>{e=null};return null===e&&(e=t,n)}}const Jt=_t("dragHorizontal"),Qt=_t("dragVertical");function te(t){let e=!1;if("y"===t)e=Qt();else if("x"===t)e=Jt();else{const t=Jt(),n=Qt();t&&n?e=()=>{t(),n()}:(t&&t(),n&&n())}return e}function ee(){const t=te(!0);return!t||(t(),!1)}function ne(e,n,o,i){return(r,s)=>{"touch"===r.type||ee()||(o&&e.animationState&&e.animationState.setActive(t.AnimationType.Hover,n),i&&i(r,s))}}const oe=(t,e)=>!!e&&(t===e||oe(t,e.parentElement));function ie(t){return e.useEffect(()=>()=>t(),[])}const re=(t,e)=>n=>e(t(n)),se=(...t)=>t.reduce(re);const ae=new WeakMap,le=new WeakMap,ue=t=>{const e=ae.get(t.target);e&&e(t)},ce=t=>{t.forEach(ue)};function he(t,e,n){const o=function({root:t,...e}){const n=t||document;le.has(n)||le.set(n,{});const o=le.get(n),i=JSON.stringify(e);return o[i]||(o[i]=new IntersectionObserver(ce,{root:t,...e})),o[i]}(e);return ae.set(t,n),o.observe(t),()=>{ae.delete(t),o.unobserve(t)}}const de={some:0,all:1};function pe(n,o,i,{root:r,margin:s,amount:a="some",once:l}){e.useEffect(()=>{if(!n||!i.current)return;const e={root:null==r?void 0:r.current,rootMargin:s,threshold:"number"==typeof a?a:de[a]};return he(i.current,e,e=>{const{isIntersecting:n}=e;if(o.isInView===n)return;if(o.isInView=n,l&&!n&&o.hasEnteredView)return;n&&(o.hasEnteredView=!0),i.animationState&&i.animationState.setActive(t.AnimationType.InView,n);const r=i.getProps(),s=n?r.onViewportEnter:r.onViewportLeave;s&&s(e)})},[n,r,s,a])}function fe(n,o,i,{fallback:r=!0}){e.useEffect(()=>{n&&r&&requestAnimationFrame(()=>{o.hasEnteredView=!0;const{onViewportEnter:e}=i.getProps();e&&e(null),i.animationState&&i.animationState.setActive(t.AnimationType.InView,!0)})},[n])}const me=t=>e=>(t(e),null),ge={inView:me((function({visualElement:t,whileInView:n,onViewportEnter:o,onViewportLeave:i,viewport:r={}}){const s=e.useRef({hasEnteredView:!1,isInView:!1});let a=Boolean(n||o||i);r.once&&s.current.hasEnteredView&&(a=!1),("undefined"==typeof IntersectionObserver?fe:pe)(a,s.current,t,r)})),tap:me((function({onTap:n,onTapStart:o,onTapCancel:i,whileTap:r,visualElement:s,...a}){const l=n||o||i||r,u=e.useRef(!1),c=e.useRef(null),h={passive:!(o||n||i||a.onPointerDown)};function d(){c.current&&c.current(),c.current=null}function p(){d(),u.current=!1;return s.getProps().whileTap&&s.animationState&&s.animationState.setActive(t.AnimationType.Tap,!1),!ee()}function f(t,e){var n,o,i,r;p()&&(oe(s.current,t.target)?null===(r=(i=s.getProps()).onTap)||void 0===r||r.call(i,t,e):null===(o=(n=s.getProps()).onTapCancel)||void 0===o||o.call(n,t,e))}function m(t,e){var n,o;p()&&(null===(o=(n=s.getProps()).onTapCancel)||void 0===o||o.call(n,t,e))}const g=e.useCallback((e,n)=>{var o;if(d(),u.current)return;u.current=!0,c.current=se(Zt(window,"pointerup",f,h),Zt(window,"pointercancel",m,h));const i=s.getProps();i.whileTap&&s.animationState&&s.animationState.setActive(t.AnimationType.Tap,!0),null===(o=i.onTapStart)||void 0===o||o.call(i,e,n)},[Boolean(o),s]);Kt(s,"pointerdown",l?g:void 0,h),ie(d)})),focus:me((function({whileFocus:n,visualElement:o}){const{animationState:i}=o,r=e.useCallback(()=>{i&&i.setActive(t.AnimationType.Focus,!0)},[i]),s=e.useCallback(()=>{i&&i.setActive(t.AnimationType.Focus,!1)},[i]);Yt(o,"focus",n?r:void 0),Yt(o,"blur",n?s:void 0)})),hover:me((function({onHoverStart:t,onHoverEnd:n,whileHover:o,visualElement:i}){Kt(i,"pointerenter",e.useMemo(()=>t||o?ne(i,!0,Boolean(o),t):void 0,[t,Boolean(o),i]),{passive:!t}),Kt(i,"pointerleave",e.useMemo(()=>n||o?ne(i,!1,Boolean(o),n):void 0,[t,Boolean(o),i]),{passive:!n})}))};function ye(){const t=e.useContext(u);if(null===t)return[!0,null];const{isPresent:n,onExitComplete:o,register:i}=t,r=e.useId();e.useEffect(()=>i(r),[]);return!n&&o?[!1,()=>o&&o(r)]:[!0]}function ve(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 xe=t=>/^0[^.\s]+$/.test(t),Ee={delta:0,timestamp:0},we="undefined"!=typeof performance?()=>performance.now():()=>Date.now(),Te="undefined"!=typeof window?t=>window.requestAnimationFrame(t):t=>setTimeout(()=>t(we()),1/60*1e3);let be=!0,Pe=!1,Ae=!1;const Se=["read","update","preRender","render","postRender"],Ve=Se.reduce((t,e)=>(t[e]=function(t){let e=[],n=[],o=0,i=!1,r=!1;const s=new WeakSet,a={schedule:(t,r=!1,a=!1)=>{const l=a&&i,u=l?e:n;return r&&s.add(t),-1===u.indexOf(t)&&(u.push(t),l&&i&&(o=e.length)),t},cancel:t=>{const e=n.indexOf(t);-1!==e&&n.splice(e,1),s.delete(t)},process:l=>{if(i)r=!0;else{if(i=!0,[e,n]=[n,e],n.length=0,o=e.length,o)for(let n=0;n<o;n++){const o=e[n];o(l),s.has(o)&&(a.schedule(o),t())}i=!1,r&&(r=!1,a.process(l))}}};return a}(()=>Pe=!0),t),{}),Ce=Se.reduce((t,e)=>{const n=Ve[e];return t[e]=(t,e=!1,o=!1)=>(Pe||ke(),n.schedule(t,e,o)),t},{}),Me=Se.reduce((t,e)=>(t[e]=Ve[e].cancel,t),{}),Re=Se.reduce((t,e)=>(t[e]=()=>Ve[e].process(Ee),t),{}),Le=t=>Ve[t].process(Ee),De=t=>{Pe=!1,Ee.delta=be?1/60*1e3:Math.max(Math.min(t-Ee.timestamp,40),1),Ee.timestamp=t,Ae=!0,Se.forEach(Le),Ae=!1,Pe&&(be=!1,Te(De))},ke=()=>{Pe=!0,be=!0,Ae||Te(De)};function Be(t,e){-1===t.indexOf(e)&&t.push(e)}function Ie(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class Oe{constructor(){this.subscriptions=[]}add(t){return Be(this.subscriptions,t),()=>Ie(this.subscriptions,t)}notify(t,e,n){const o=this.subscriptions.length;if(o)if(1===o)this.subscriptions[0](t,e,n);else for(let i=0;i<o;i++){const o=this.subscriptions[i];o&&o(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function je(t,e){return e?t*(1e3/e):0}class Fe{constructor(t,e={}){var n;this.version="8.5.2",this.timeDelta=0,this.lastUpdated=0,this.canTrackVelocity=!1,this.events={},this.updateAndNotify=(t,e=!0)=>{this.prev=this.current,this.current=t;const{delta:n,timestamp:o}=Ee;this.lastUpdated!==o&&(this.timeDelta=n,this.lastUpdated=o,Ce.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.events.change&&this.events.change.notify(this.current),this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()),e&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.scheduleVelocityCheck=()=>Ce.postRender(this.velocityCheck),this.velocityCheck=({timestamp:t})=>{t!==this.lastUpdated&&(this.prev=this.current,this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=(n=this.current,!isNaN(parseFloat(n))),this.owner=e.owner}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new Oe);const n=this.events[t].add(e);return"change"===t?()=>{n(),Ce.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t,e=!0){e&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,e)}setWithVelocity(t,e,n){this.set(e),this.prev=t,this.timeDelta=n}jump(t){this.updateAndNotify(t),this.prev=t,this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?je(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e)||null,this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){this.animation=null}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Ue(t,e){return new Fe(t,e)}const Ne=(t,e)=>n=>Boolean(et(n)&&tt.test(n)&&n.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(n,e)),ze=(t,e,n)=>o=>{if(!et(o))return o;const[i,r,s,a]=o.match(J);return{[t]:parseFloat(i),[e]:parseFloat(r),[n]:parseFloat(s),alpha:void 0!==a?parseFloat(a):1}},We={...q,transform:t=>Math.round((t=>G(0,255,t))(t))},He={test:Ne("rgb","red"),parse:ze("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:o=1})=>"rgba("+We.transform(t)+", "+We.transform(e)+", "+We.transform(n)+", "+_(Z.transform(o))+")"};const $e={test:Ne("#"),parse:function(t){let e="",n="",o="",i="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),o=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),o=t.substring(3,4),i=t.substring(4,5),e+=e,n+=n,o+=o,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(o,16),alpha:i?parseInt(i,16)/255:1}},transform:He.transform},Ye={test:Ne("hsl","hue"),parse:ze("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:o=1})=>"hsla("+Math.round(t)+", "+it.transform(_(e))+", "+it.transform(_(n))+", "+_(Z.transform(o))+")"},Xe={test:t=>He.test(t)||$e.test(t)||Ye.test(t),parse:t=>He.test(t)?He.parse(t):Ye.test(t)?Ye.parse(t):$e.parse(t),transform:t=>et(t)?t:t.hasOwnProperty("red")?He.transform(t):Ye.transform(t)};function Ge(t){"number"==typeof t&&(t=""+t);const e=[];let n=0,o=0;const i=t.match(Q);i&&(n=i.length,t=t.replace(Q,"${c}"),e.push(...i.map(Xe.parse)));const r=t.match(J);return r&&(o=r.length,t=t.replace(J,"${n}"),e.push(...r.map(q.parse))),{values:e,numColors:n,numNumbers:o,tokenised:t}}function qe(t){return Ge(t).values}function Ze(t){const{values:e,numColors:n,tokenised:o}=Ge(t),i=e.length;return t=>{let e=o;for(let o=0;o<i;o++)e=e.replace(o<n?"${c}":"${n}",o<n?Xe.transform(t[o]):_(t[o]));return e}}const Ke=t=>"number"==typeof t?0:t;const _e={test:function(t){var e,n;return isNaN(t)&&et(t)&&((null===(e=t.match(J))||void 0===e?void 0:e.length)||0)+((null===(n=t.match(Q))||void 0===n?void 0:n.length)||0)>0},parse:qe,createTransformer:Ze,getAnimatableNone:function(t){const e=qe(t);return Ze(t)(e.map(Ke))}},Je=new Set(["brightness","contrast","saturate","opacity"]);function Qe(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[o]=n.match(J)||[];if(!o)return t;const i=n.replace(o,"");let r=Je.has(e)?1:0;return o!==n&&(r*=100),e+"("+r+i+")"}const tn=/([a-z-]*)\(.*?\)/g,en={..._e,getAnimatableNone:t=>{const e=t.match(tn);return e?e.map(Qe).join(" "):t}},nn={...ct,color:Xe,backgroundColor:Xe,outlineColor:Xe,fill:Xe,stroke:Xe,borderColor:Xe,borderTopColor:Xe,borderRightColor:Xe,borderBottomColor:Xe,borderLeftColor:Xe,filter:en,WebkitFilter:en},on=t=>nn[t];function rn(t,e){var n;let o=on(t);return o!==en&&(o=_e),null===(n=o.getAnimatableNone)||void 0===n?void 0:n.call(o,e)}const sn=t=>e=>e.test(t),an=[q,rt,it,ot,at,st,{test:t=>"auto"===t,parse:t=>t}],ln=t=>an.find(sn(t)),un=[...an,Xe,_e],cn=t=>un.find(sn(t));function hn(t,e,n){const o=t.getProps();return It(o,e,void 0!==n?n:o.custom,function(t){const e={};return t.values.forEach((t,n)=>e[n]=t.get()),e}(t),function(t){const e={};return t.values.forEach((t,n)=>e[n]=t.getVelocity()),e}(t))}function dn(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Ue(n))}function pn(t,e){const n=hn(t,e);let{transitionEnd:o={},transition:i={},...r}=n?t.makeTargetAnimatable(n,!1):{};r={...r,...o};for(const e in r){dn(t,e,(s=r[e],Ot(s)?s[s.length-1]||0:s))}var s}function fn(t,e){[...e].reverse().forEach(n=>{var o;const i=t.getVariant(n);i&&pn(t,i),null===(o=t.variantChildren)||void 0===o||o.forEach(t=>{fn(t,e)})})}function mn(t,e,n){var o,i;const r=Object.keys(e).filter(e=>!t.hasValue(e)),s=r.length;if(s)for(let a=0;a<s;a++){const s=r[a],l=e[s];let u=null;Array.isArray(l)&&(u=l[0]),null===u&&(u=null!==(i=null!==(o=n[s])&&void 0!==o?o:t.readValue(s))&&void 0!==i?i:e[s]),null!=u&&("string"==typeof u&&(/^\-?\d*\.?\d+$/.test(u)||xe(u))?u=parseFloat(u):!cn(u)&&_e.test(l)&&(u=rn(s,l)),t.addValue(s,Ue(u,{owner:t})),void 0===n[s]&&(n[s]=u),null!==u&&t.setBaseTarget(s,u))}}function gn(t,e){if(!e)return;return(e[t]||e.default||e).from}function yn(t,e,n){var o;const i={};for(const r in t){const t=gn(r,e);i[r]=void 0!==t?t:null===(o=n.getValue(r))||void 0===o?void 0:o.get()}return i}function vn(t){return Boolean(z(t)&&t.add)}const xn="data-"+Mt("framerAppearId");const En=t=>1e3*t,wn={current:!1},Tn=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,bn=t=>e=>1-t(1-e),Pn=t=>t*t,An=bn(Pn),Sn=Tn(Pn),Vn=(t,e,n)=>-n*t+n*e+t;function Cn(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}const Mn=(t,e,n)=>{const o=t*t;return Math.sqrt(Math.max(0,n*(e*e-o)+o))},Rn=[$e,He,Ye];function Ln(t){const e=(n=t,Rn.find(t=>t.test(n)));var n;let o=e.parse(t);return e===Ye&&(o=function({hue:t,saturation:e,lightness:n,alpha:o}){t/=360,n/=100;let i=0,r=0,s=0;if(e/=100){const o=n<.5?n*(1+e):n+e-n*e,a=2*n-o;i=Cn(a,o,t+1/3),r=Cn(a,o,t),s=Cn(a,o,t-1/3)}else i=r=s=n;return{red:Math.round(255*i),green:Math.round(255*r),blue:Math.round(255*s),alpha:o}}(o)),o}const Dn=(t,e)=>{const n=Ln(t),o=Ln(e),i={...n};return t=>(i.red=Mn(n.red,o.red,t),i.green=Mn(n.green,o.green,t),i.blue=Mn(n.blue,o.blue,t),i.alpha=Vn(n.alpha,o.alpha,t),He.transform(i))};function kn(t,e){return"number"==typeof t?n=>Vn(t,e,n):Xe.test(t)?Dn(t,e):On(t,e)}const Bn=(t,e)=>{const n=[...t],o=n.length,i=t.map((t,n)=>kn(t,e[n]));return t=>{for(let e=0;e<o;e++)n[e]=i[e](t);return n}},In=(t,e)=>{const n={...t,...e},o={};for(const i in n)void 0!==t[i]&&void 0!==e[i]&&(o[i]=kn(t[i],e[i]));return t=>{for(const e in o)n[e]=o[e](t);return n}},On=(t,e)=>{const n=_e.createTransformer(e),o=Ge(t),i=Ge(e);return o.numColors===i.numColors&&o.numNumbers>=i.numNumbers?se(Bn(o.values,i.values),n):n=>""+(n>0?e:t)},jn=(t,e,n)=>{const o=e-t;return 0===o?1:(n-t)/o},Fn=(t,e)=>n=>Vn(t,e,n);function Un(t,e,n){const o=[],i=n||("number"==typeof(r=t[0])?Fn:"string"==typeof r?Xe.test(r)?Dn:On:Array.isArray(r)?Bn:"object"==typeof r?In:Fn);var r;const s=t.length-1;for(let n=0;n<s;n++){let r=i(t[n],t[n+1]);if(e){const t=Array.isArray(e)?e[n]:e;r=se(t,r)}o.push(r)}return o}function Nn(t,e,{clamp:n=!0,ease:o,mixer:i}={}){const r=t.length;e.length,!o||!Array.isArray(o)||o.length,t[0]>t[r-1]&&(t=[...t].reverse(),e=[...e].reverse());const s=Un(e,o,i),a=s.length,l=e=>{let n=0;if(a>1)for(;n<t.length-2&&!(e<t[n+1]);n++);const o=jn(t[n],t[n+1],e);return s[n](o)};return n?e=>l(G(t[0],t[r-1],e)):l}const zn=t=>t,Wn=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function Hn(t,e,n,o){if(t===e&&n===o)return zn;const i=e=>function(t,e,n,o,i){let r,s,a=0;do{s=e+(n-e)/2,r=Wn(s,o,i)-t,r>0?n=s:e=s}while(Math.abs(r)>1e-7&&++a<12);return s}(e,0,1,t,n);return t=>0===t||1===t?t:Wn(i(t),e,o)}const $n=t=>1-Math.sin(Math.acos(t)),Yn=bn($n),Xn=Tn(Yn),Gn=Hn(.33,1.53,.69,.99),qn=bn(Gn),Zn=Tn(qn),Kn=t=>(t*=2)<1?.5*qn(t):.5*(2-Math.pow(2,-10*(t-1))),_n={linear:zn,easeIn:Pn,easeInOut:Sn,easeOut:An,circIn:$n,circInOut:Xn,circOut:Yn,backIn:qn,backInOut:Zn,backOut:Gn,anticipate:Kn},Jn=t=>{if(Array.isArray(t)){t.length;const[e,n,o,i]=t;return Hn(e,n,o,i)}return"string"==typeof t?_n[t]:t};function Qn({keyframes:t,ease:e=Sn,times:n,duration:o=300}){t=[...t];const i=(t=>Array.isArray(t)&&"number"!=typeof t[0])(e)?e.map(Jn):Jn(e),r={done:!1,value:t[0]},s=function(t,e){return t.map(t=>t*e)}(n&&n.length===t.length?n:function(t){const e=t.length;return t.map((t,n)=>0!==n?n/(e-1):0)}(t),o);function a(){return Nn(s,t,{ease:Array.isArray(i)?i:(e=t,n=i,e.map(()=>n||Sn).splice(0,e.length-1))});var e,n}let l=a();return{next:t=>(r.value=l(t),r.done=t>=o,r),flipTarget:()=>{t.reverse(),l=a()}}}function to({duration:t=800,bounce:e=.25,velocity:n=0,mass:o=1}){let i,r,s=1-e;s=G(.05,1,s),t=G(.01,10,t/1e3),s<1?(i=e=>{const o=e*s,i=o*t;return.001-(o-n)/eo(e,s)*Math.exp(-i)},r=e=>{const o=e*s*t,r=o*n+n,a=Math.pow(s,2)*Math.pow(e,2)*t,l=Math.exp(-o),u=eo(Math.pow(e,2),s);return(.001-i(e)>0?-1:1)*((r-a)*l)/u}):(i=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,r=e=>Math.exp(-e*t)*(t*t*(n-e)));const a=function(t,e,n){let o=n;for(let n=1;n<12;n++)o-=t(o)/e(o);return o}(i,r,5/t);if(t*=1e3,isNaN(a))return{stiffness:100,damping:10,duration:t};{const e=Math.pow(a,2)*o;return{stiffness:e,damping:2*s*Math.sqrt(o*e),duration:t}}}function eo(t,e){return t*Math.sqrt(1-e*e)}const no=["duration","bounce"],oo=["stiffness","damping","mass"];function io(t,e){return e.some(e=>void 0!==t[e])}function ro({keyframes:t,restDelta:e,restSpeed:n,...o}){let i=t[0],r=t[t.length-1];const s={done:!1,value:i},{stiffness:a,damping:l,mass:u,velocity:c,duration:h,isResolvedFromDuration:d}=function(t){let e={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...t};if(!io(t,oo)&&io(t,no)){const n=to(t);e={...e,...n,velocity:0,mass:1},e.isResolvedFromDuration=!0}return e}(o);let p=so,f=c?-c/1e3:0;const m=l/(2*Math.sqrt(a*u));function g(){const t=r-i,o=Math.sqrt(a/u)/1e3,s=Math.abs(t)<5;if(n||(n=s?.01:2),e||(e=s?.005:.5),m<1){const e=eo(o,m);p=n=>{const i=Math.exp(-m*o*n);return r-i*((f+m*o*t)/e*Math.sin(e*n)+t*Math.cos(e*n))}}else if(1===m)p=e=>r-Math.exp(-o*e)*(t+(f+o*t)*e);else{const e=o*Math.sqrt(m*m-1);p=n=>{const i=Math.exp(-m*o*n),s=Math.min(e*n,300);return r-i*((f+m*o*t)*Math.sinh(s)+e*t*Math.cosh(s))/e}}}return g(),{next:t=>{const o=p(t);if(d)s.done=t>=h;else{let i=f;if(0!==t)if(m<1){const e=Math.max(0,t-5);i=je(o-p(e),t-e)}else i=0;const a=Math.abs(i)<=n,l=Math.abs(r-o)<=e;s.done=a&&l}return s.value=s.done?r:o,s},flipTarget:()=>{f=-f,[i,r]=[r,i],g()}}}ro.needsInterpolation=(t,e)=>"string"==typeof t||"string"==typeof e;const so=t=>0;const ao={decay:function({keyframes:t=[0],velocity:e=0,power:n=.8,timeConstant:o=350,restDelta:i=.5,modifyTarget:r}){const s=t[0],a={done:!1,value:s};let l=n*e;const u=s+l,c=void 0===r?u:r(u);return c!==u&&(l=c-s),{next:t=>{const e=-l*Math.exp(-t/o);return a.done=!(e>i||e<-i),a.value=a.done?c:c+e,a},flipTarget:()=>{}}},keyframes:Qn,tween:Qn,spring:ro};function lo(t,e,n=0){return t-e-n}const uo=t=>{const e=({delta:e})=>t(e);return{start:()=>Ce.update(e,!0),stop:()=>Me.update(e)}};function co({duration:t,driver:e=uo,elapsed:n=0,repeat:o=0,repeatType:i="loop",repeatDelay:r=0,keyframes:s,autoplay:a=!0,onPlay:l,onStop:u,onComplete:c,onRepeat:h,onUpdate:d,type:p="keyframes",...f}){var m,g;const y=n;let v,x,E=0,w=t,T=!1,b=!0;const P=ao[s.length>2?"keyframes":p]||Qn,A=s[0],S=s[s.length-1];let V={done:!1,value:A};(null===(g=(m=P).needsInterpolation)||void 0===g?void 0:g.call(m,A,S))&&(x=Nn([0,100],[A,S],{clamp:!1}),s=[0,100]);const C=P({...f,duration:t,keyframes:s});function M(){E++,"reverse"===i?(b=E%2==0,n=function(t,e=0,n=0,o=!0){return o?lo(e+-t,e,n):e-(t-e)+n}(n,w,r,b)):(n=lo(n,w,r),"mirror"===i&&C.flipTarget()),T=!1,h&&h()}function R(t){b||(t=-t),n+=t,T||(V=C.next(Math.max(0,n)),x&&(V.value=x(V.value)),T=b?V.done:n<=0),d&&d(V.value),T&&(0===E&&(w=void 0!==w?w:n),E<o?function(t,e,n,o){return o?t>=e+n:t<=-n}(n,w,r,b)&&M():(v&&v.stop(),c&&c()))}return a&&(l&&l(),v=e(R),v.start()),{stop:()=>{u&&u(),v&&v.stop()},set currentTime(t){n=y,R(t)},sample:e=>{n=y;const o=t&&"number"==typeof t?Math.max(.5*t,50):50;let i=0;for(R(0);i<=e;){const t=e-i;R(Math.min(t,o)),i+=o}return V}}}const ho=([t,e,n,o])=>`cubic-bezier(${t}, ${e}, ${n}, ${o})`,po={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:ho([0,.65,.55,1]),circOut:ho([.55,0,1,.45]),backIn:ho([.31,.01,.66,-.59]),backOut:ho([.33,1.53,.69,.99])};function fo(t){if(t)return Array.isArray(t)?ho(t):po[t]}function mo(t,e,n,{delay:o=0,duration:i,repeat:r=0,repeatType:s="loop",ease:a,times:l}={}){return t.animate({[e]:n,offset:l},{delay:o,duration:i,easing:fo(a),fill:"both",iterations:r+1,direction:"reverse"===s?"alternate":"normal"})}const go={waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate")},yo={},vo={};for(const t in go)vo[t]=()=>(void 0===yo[t]&&(yo[t]=go[t]()),yo[t]);const xo=new Set(["opacity"]);function Eo(t,e,{onUpdate:n,onComplete:o,...i}){if(!(vo.waapi()&&xo.has(e)&&!i.repeatDelay&&"mirror"!==i.repeatType&&0!==i.damping))return!1;let{keyframes:r,duration:s=300,elapsed:a=0,ease:l}=i;if("spring"===i.type||!(!(u=i.ease)||Array.isArray(u)||"string"==typeof u&&po[u])){if(i.repeat===1/0)return;const t=co({...i,elapsed:0});let e={done:!1,value:r[0]};const n=[];let o=0;for(;!e.done&&o<2e4;)e=t.sample(o),n.push(e.value),o+=10;r=n,s=o-10,l="linear"}var u;const c=mo(t.owner.current,e,r,{...i,delay:-a,duration:s,ease:l});return c.onfinish=()=>{t.set(function(t,{repeat:e,repeatType:n="loop"}){return t[e&&"loop"!==n&&e%2==1?0:t.length-1]}(r,i)),o&&o()},{get currentTime(){return c.currentTime||0},set currentTime(t){c.currentTime=t},stop:()=>{const{currentTime:e}=c;if(e){const n=co({...i,autoplay:!1});t.setWithVelocity(n.sample(e-10).value,n.sample(e).value,10)}Ce.update(()=>c.cancel())}}}function wo(t,e){const n=performance.now(),o=({timestamp:i})=>{const r=i-n;r>=e&&(Me.read(o),t(r-e))};return Ce.read(o,!0),()=>Me.read(o)}function To({keyframes:t,elapsed:e,onUpdate:n,onComplete:o}){const i=()=>{n&&n(t[t.length-1]),o&&o()};return e?{stop:wo(i,-e)}:i()}const bo=()=>({type:"spring",stiffness:500,damping:25,restSpeed:10}),Po=t=>({type:"spring",stiffness:550,damping:0===t?2*Math.sqrt(550):30,restSpeed:10}),Ao=()=>({type:"keyframes",ease:"linear",duration:.3}),So={type:"keyframes",duration:.8},Vo={x:bo,y:bo,z:bo,rotate:bo,rotateX:bo,rotateY:bo,rotateZ:bo,scaleX:Po,scaleY:Po,scale:Po,opacity:Ao,backgroundColor:Ao,color:Ao,default:Po},Co=(t,{keyframes:e})=>{if(e.length>2)return So;return(Vo[t]||Vo.default)(e[1])},Mo=(t,e)=>"zIndex"!==t&&(!("number"!=typeof e&&!Array.isArray(e))||!("string"!=typeof e||!_e.test(e)||e.startsWith("url(")));function Ro(t){return 0===t||"string"==typeof t&&0===parseFloat(t)&&-1===t.indexOf(" ")}function Lo(t){return"number"==typeof t?0:rn("",t)}function Do(t,e){return t[e]||t.default||t}const ko=(t,e,n,o={})=>i=>{const r=Do(o,t)||{},s=r.delay||o.delay||0;let{elapsed:a=0}=o;a-=En(s);const l=function(t,e,n,o){const i=Mo(e,n);let r=void 0!==o.from?o.from:t.get();return"none"===r&&i&&"string"==typeof n?r=rn(e,n):Ro(r)&&"string"==typeof n?r=Lo(n):!Array.isArray(n)&&Ro(n)&&"string"==typeof r&&(n=Lo(r)),Array.isArray(n)?(null===n[0]&&(n[0]=r),n):[r,n]}(e,t,n,r),u=l[0],c=l[l.length-1],h=Mo(t,u),d=Mo(t,c);let p={keyframes:l,velocity:e.getVelocity(),...r,elapsed:a,onUpdate:t=>{e.set(t),r.onUpdate&&r.onUpdate(t)},onComplete:()=>{i(),r.onComplete&&r.onComplete()}};if(!h||!d||wn.current||!1===r.type)return To(p);if("inertia"===r.type)return function({keyframes:t,velocity:e=0,min:n,max:o,power:i=.8,timeConstant:r=750,bounceStiffness:s=500,bounceDamping:a=10,restDelta:l=1,modifyTarget:u,driver:c,onUpdate:h,onComplete:d,onStop:p}){const f=t[0];let m;function g(t){return void 0!==n&&t<n||void 0!==o&&t>o}function y(t){return void 0===n?o:void 0===o||Math.abs(n-t)<Math.abs(o-t)?n:o}function v(t){null==m||m.stop(),m=co({keyframes:[0,1],velocity:0,...t,driver:c,onUpdate:e=>{var n;null==h||h(e),null===(n=t.onUpdate)||void 0===n||n.call(t,e)},onComplete:d,onStop:p})}function x(t){v({type:"spring",stiffness:s,damping:a,restDelta:l,...t})}if(g(f))x({velocity:e,keyframes:[f,y(f)]});else{let t=i*e+f;void 0!==u&&(t=u(t));const o=y(t),s=o===n?-1:1;let a,c;const h=t=>{a=c,c=t,e=je(t-a,Ee.delta),(1===s&&t>o||-1===s&&t<o)&&x({keyframes:[t,o],velocity:e})};v({type:"decay",keyframes:[f,0],velocity:e,timeConstant:r,power:i,restDelta:l,modifyTarget:u,onUpdate:g(t)?h:void 0})}return{stop:()=>null==m?void 0:m.stop()}}(p);(function({when:t,delay:e,delayChildren:n,staggerChildren:o,staggerDirection:i,repeat:r,repeatType:s,repeatDelay:a,from:l,elapsed:u,...c}){return!!Object.keys(c).length})(r)||(p={...p,...Co(t,p)}),p.duration&&(p.duration=En(p.duration)),p.repeatDelay&&(p.repeatDelay=En(p.repeatDelay));const f=e.owner,m=f&&f.current;if(f&&m instanceof HTMLElement&&!(null==f?void 0:f.getProps().onUpdate)){const n=Eo(e,t,p);if(n)return n}return co(p)};function Bo(t,e,n={}){let o;if(t.notify("AnimationStart",e),Array.isArray(e)){const i=e.map(e=>Io(t,e,n));o=Promise.all(i)}else if("string"==typeof e)o=Io(t,e,n);else{const i="function"==typeof e?hn(t,e,n.custom):e;o=Oo(t,i,n)}return o.then(()=>t.notify("AnimationComplete",e))}function Io(t,e,n={}){var o;const i=hn(t,e,n.custom);let{transition:r=t.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(r=n.transitionOverride);const s=i?()=>Oo(t,i,n):()=>Promise.resolve(),a=(null===(o=t.variantChildren)||void 0===o?void 0:o.size)?(o=0)=>{const{delayChildren:i=0,staggerChildren:s,staggerDirection:a}=r;return function(t,e,n=0,o=0,i=1,r){const s=[],a=(t.variantChildren.size-1)*o,l=1===i?(t=0)=>t*o:(t=0)=>a-t*o;return Array.from(t.variantChildren).sort(jo).forEach((t,o)=>{t.notify("AnimationStart",e),s.push(Io(t,e,{...r,delay:n+l(o)}).then(()=>t.notify("AnimationComplete",e)))}),Promise.all(s)}(t,e,i+o,s,a,n)}:()=>Promise.resolve(),{when:l}=r;if(l){const[t,e]="beforeChildren"===l?[s,a]:[a,s];return t().then(e)}return Promise.all([s(),a(n.delay)])}function Oo(t,e,{delay:n=0,transitionOverride:o,type:i}={}){var r;let{transition:s=t.getDefaultTransition(),transitionEnd:a,...l}=t.makeTargetAnimatable(e);const u=t.getValue("willChange");o&&(s=o);const c=[],h=i&&(null===(r=t.animationState)||void 0===r?void 0:r.getState()[i]);for(const e in l){const o=t.getValue(e),i=l[e];if(!o||void 0===i||h&&Fo(h,e))continue;const r={delay:n,elapsed:0,...s};if(window.HandoffAppearAnimations&&!o.hasAnimated){const n=t.getProps()[xn];n&&(r.elapsed=window.HandoffAppearAnimations(n,e,o,Ce))}let a=o.start(ko(e,o,i,t.shouldReduceMotion&&U.has(e)?{type:!1}:r));vn(u)&&(u.add(e),a=a.then(()=>u.remove(e))),c.push(a)}return Promise.all(c).then(()=>{a&&pn(t,a)})}function jo(t,e){return t.sortNodePosition(e)}function Fo({protectedKeys:t,needsAnimating:e},n){const o=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,o}const Uo=[t.AnimationType.Animate,t.AnimationType.InView,t.AnimationType.Focus,t.AnimationType.Hover,t.AnimationType.Tap,t.AnimationType.Drag,t.AnimationType.Exit],No=[...Uo].reverse(),zo=Uo.length;function Wo(e){let n=function(t){return e=>Promise.all(e.map(({animation:e,options:n})=>Bo(t,e,n)))}(e);const o={[t.AnimationType.Animate]:$o(!0),[t.AnimationType.InView]:$o(),[t.AnimationType.Hover]:$o(),[t.AnimationType.Tap]:$o(),[t.AnimationType.Drag]:$o(),[t.AnimationType.Focus]:$o(),[t.AnimationType.Exit]:$o()};let i=!0;const r=(t,n)=>{const o=hn(e,n);if(o){const{transition:e,transitionEnd:n,...i}=o;t={...t,...i,...n}}return t};function s(t,s){const a=e.getProps(),l=e.getVariantContext(!0)||{},u=[],c=new Set;let h={},d=1/0;for(let n=0;n<zo;n++){const p=No[n],g=o[p],y=void 0!==a[p]?a[p]:l[p],v=f(y),x=p===s?g.isActive:null;!1===x&&(d=n);let E=y===l[p]&&y!==a[p]&&v;if(E&&i&&e.manuallyAnimateOnMount&&(E=!1),g.protectedKeys={...h},!g.isActive&&null===x||!y&&!g.prevProp||m(y)||"boolean"==typeof y)continue;const w=Ho(g.prevProp,y);let T=w||p===s&&g.isActive&&!E&&v||n>d&&v;const b=Array.isArray(y)?y:[y];let P=b.reduce(r,{});!1===x&&(P={});const{prevResolvedValues:A={}}=g,S={...A,...P},V=t=>{T=!0,c.delete(t),g.needsAnimating[t]=!0};for(const t in S){const e=P[t],n=A[t];h.hasOwnProperty(t)||(e!==n?Ot(e)&&Ot(n)?!ve(e,n)||w?V(t):g.protectedKeys[t]=!0:void 0!==e?V(t):c.add(t):void 0!==e&&c.has(t)?V(t):g.protectedKeys[t]=!0)}g.prevProp=y,g.prevResolvedValues=P,g.isActive&&(h={...h,...P}),i&&e.blockInitialAnimation&&(T=!1),T&&!E&&u.push(...b.map(e=>({animation:e,options:{type:p,...t}})))}if(c.size){const t={};c.forEach(n=>{const o=e.getBaseTarget(n);void 0!==o&&(t[n]=o)}),u.push({animation:t})}let p=Boolean(u.length);return i&&!1===a.initial&&!e.manuallyAnimateOnMount&&(p=!1),i=!1,p?n(u):Promise.resolve()}return{animateChanges:s,setActive:function(t,n,i){var r;if(o[t].isActive===n)return Promise.resolve();null===(r=e.variantChildren)||void 0===r||r.forEach(e=>{var o;return null===(o=e.animationState)||void 0===o?void 0:o.setActive(t,n)}),o[t].isActive=n;const a=s(i,t);for(const t in o)o[t].protectedKeys={};return a},setAnimateFunction:function(t){n=t(e)},getState:()=>o}}function Ho(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!ve(e,t)}function $o(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}const Yo={animation:me(({visualElement:t,animate:n})=>{t.animationState||(t.animationState=Wo(t)),m(n)&&e.useEffect(()=>n.subscribe(t),[n])}),exit:me(n=>{const{custom:o,visualElement:i}=n,[r,s]=ye(),a=e.useContext(u);e.useEffect(()=>{i.isPresent=r;const e=i.animationState&&i.animationState.setActive(t.AnimationType.Exit,!r,{custom:a&&a.custom||o});e&&!r&&e.then(s)},[r])})},Xo=(t,e)=>Math.abs(t-e);function Go(t,e){const n=Xo(t.x,e.x),o=Xo(t.y,e.y);return Math.sqrt(n**2+o**2)}class qo{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=_o(this.lastMoveEventInfo,this.history),e=null!==this.startEvent,n=Go(t.offset,{x:0,y:0})>=3;if(!e&&!n)return;const{point:o}=t,{timestamp:i}=Ee;this.history.push({...o,timestamp:i});const{onStart:r,onMove:s}=this.handlers;e||(r&&r(this.lastMoveEvent,t),this.startEvent=this.lastMoveEvent),s&&s(this.lastMoveEvent,t)},this.handlePointerMove=(t,e)=>{this.lastMoveEvent=t,this.lastMoveEventInfo=Zo(e,this.transformPagePoint),Ce.update(this.updatePoint,!0)},this.handlePointerUp=(t,e)=>{if(this.end(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const{onEnd:n,onSessionEnd:o}=this.handlers,i=_o("pointercancel"===t.type?this.lastMoveEventInfo:Zo(e,this.transformPagePoint),this.history);this.startEvent&&n&&n(t,i),o&&o(t,i)},!Xt(t))return;this.handlers=e,this.transformPagePoint=n;const o=Zo(Gt(t),this.transformPagePoint),{point:i}=o,{timestamp:r}=Ee;this.history=[{...i,timestamp:r}];const{onSessionStart:s}=e;s&&s(t,_o(o,this.history)),this.removeListeners=se(Zt(window,"pointermove",this.handlePointerMove),Zt(window,"pointerup",this.handlePointerUp),Zt(window,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Me.update(this.updatePoint)}}function Zo(t,e){return e?{point:e(t.point)}:t}function Ko(t,e){return{x:t.x-e.x,y:t.y-e.y}}function _o({point:t},e){return{point:t,delta:Ko(t,Qo(e)),offset:Ko(t,Jo(e)),velocity:ti(e,.1)}}function Jo(t){return t[0]}function Qo(t){return t[t.length-1]}function ti(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,o=null;const i=Qo(t);for(;n>=0&&(o=t[n],!(i.timestamp-o.timestamp>En(e)));)n--;if(!o)return{x:0,y:0};const r=(i.timestamp-o.timestamp)/1e3;if(0===r)return{x:0,y:0};const s={x:(i.x-o.x)/r,y:(i.y-o.y)/r};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}function ei(t){return t.max-t.min}function ni(t,e=0,n=.01){return Math.abs(t-e)<=n}function oi(t,e,n,o=.5){t.origin=o,t.originPoint=Vn(e.min,e.max,t.origin),t.scale=ei(n)/ei(e),(ni(t.scale,1,1e-4)||isNaN(t.scale))&&(t.scale=1),t.translate=Vn(n.min,n.max,t.origin)-t.originPoint,(ni(t.translate)||isNaN(t.translate))&&(t.translate=0)}function ii(t,e,n,o){oi(t.x,e.x,n.x,null==o?void 0:o.originX),oi(t.y,e.y,n.y,null==o?void 0:o.originY)}function ri(t,e,n){t.min=n.min+e.min,t.max=t.min+ei(e)}function si(t,e,n){t.min=e.min-n.min,t.max=t.min+ei(e)}function ai(t,e,n){si(t.x,e.x,n.x),si(t.y,e.y,n.y)}function li(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 ui(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 ci=.35;function hi(t,e,n){return{min:di(t,e),max:di(t,n)}}function di(t,e){return"number"==typeof t?t:t[e]||0}const pi=()=>({x:{min:0,max:0},y:{min:0,max:0}});function fi(t){return[t("x"),t("y")]}function mi({top:t,left:e,right:n,bottom:o}){return{x:{min:e,max:n},y:{min:t,max:o}}}function gi(t){return void 0===t||1===t}function yi({scale:t,scaleX:e,scaleY:n}){return!gi(t)||!gi(e)||!gi(n)}function vi(t){return yi(t)||xi(t)||t.z||t.rotate||t.rotateX||t.rotateY}function xi(t){return Ei(t.x)||Ei(t.y)}function Ei(t){return t&&"0%"!==t}function wi(t,e,n){return n+e*(t-n)}function Ti(t,e,n,o,i){return void 0!==i&&(t=wi(t,i,o)),wi(t,n,o)+e}function bi(t,e=0,n=1,o,i){t.min=Ti(t.min,e,n,o,i),t.max=Ti(t.max,e,n,o,i)}function Pi(t,{x:e,y:n}){bi(t.x,e.translate,e.scale,e.originPoint),bi(t.y,n.translate,n.scale,n.originPoint)}function Ai(t){return Number.isInteger(t)||t>1.0000000000001||t<.999999999999?t:1}function Si(t,e){t.min=t.min+e,t.max=t.max+e}function Vi(t,e,[n,o,i]){const r=void 0!==e[i]?e[i]:.5,s=Vn(t.min,t.max,r);bi(t,e[n],e[o],s,e.scale)}const Ci=["x","scaleX","originX"],Mi=["y","scaleY","originY"];function Ri(t,e){Vi(t.x,e,Ci),Vi(t.y,e,Mi)}function Li(t,e){return mi(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 Di=new WeakMap;class ki{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 qo(e,{onSessionStart:t=>{this.stopAnimation(),n&&this.snapToCursor(Gt(t,"page").point)},onStart:(e,n)=>{var o;const{drag:i,dragPropagation:r,onDragStart:s}=this.getProps();(!i||r||(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=te(i),this.openGlobalLock))&&(this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),fi(t=>{var e,n;let o=this.getAxisMotionValue(t).get()||0;if(it.test(o)){const i=null===(n=null===(e=this.visualElement.projection)||void 0===e?void 0:e.layout)||void 0===n?void 0:n.layoutBox[t];if(i){o=ei(i)*(parseFloat(o)/100)}}this.originPoint[t]=o}),null==s||s(e,n),null===(o=this.visualElement.animationState)||void 0===o||o.setActive(t.AnimationType.Drag,!0))},onMove:(t,e)=>{const{dragPropagation:n,dragDirectionLock:o,onDirectionLock:i,onDrag:r}=this.getProps();if(!n&&!this.openGlobalLock)return;const{offset:s}=e;if(o&&null===this.currentDirection)return this.currentDirection=function(t,e=10){let n=null;Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x");return n}(s),void(null!==this.currentDirection&&(null==i||i(this.currentDirection)));this.updateAxis("x",e.point,s),this.updateAxis("y",e.point,s),this.visualElement.render(),null==r||r(t,e)},onSessionEnd:(t,e)=>this.stop(t,e)},{transformPagePoint:this.visualElement.getTransformPagePoint()})}stop(t,e){const n=this.isDragging;if(this.cancel(),!n)return;const{velocity:o}=e;this.startAnimation(o);const{onDragEnd:i}=this.getProps();null==i||i(t,e)}cancel(){var e,n;this.isDragging=!1,this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!1),null===(e=this.panSession)||void 0===e||e.end(),this.panSession=void 0;const{dragPropagation:o}=this.getProps();!o&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),null===(n=this.visualElement.animationState)||void 0===n||n.setActive(t.AnimationType.Drag,!1)}updateAxis(t,e,n){const{drag:o}=this.getProps();if(!n||!Bi(t,o,this.currentDirection))return;const i=this.getAxisMotionValue(t);let r=this.originPoint[t]+n[t];this.constraints&&this.constraints[t]&&(r=function(t,{min:e,max:n},o){return void 0!==e&&t<e?t=o?Vn(e,t,o.min):Math.max(t,e):void 0!==n&&t>n&&(t=o?Vn(n,t,o.max):Math.min(t,n)),t}(r,this.constraints[t],this.elastic[t])),i.set(r)}resolveConstraints(){const{dragConstraints:t,dragElastic:e}=this.getProps(),{layout:n}=this.visualElement.projection||{},o=this.constraints;t&&p(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!n)&&function(t,{top:e,left:n,bottom:o,right:i}){return{x:li(t.x,n,i),y:li(t.y,e,o)}}(n.layoutBox,t),this.elastic=function(t=ci){return!1===t?t=0:!0===t&&(t=ci),{x:hi(t,"left","right"),y:hi(t,"top","bottom")}}(e),o!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&fi(t=>{this.getAxisMotionValue(t)&&(this.constraints[t]=function(t,e){const n={};return void 0!==e.min&&(n.min=e.min-t.min),void 0!==e.max&&(n.max=e.max-t.min),n}(n.layoutBox[t],this.constraints[t]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:e}=this.getProps();if(!t||!p(t))return!1;const n=t.current,{projection:o}=this.visualElement;if(!o||!o.layout)return!1;const i=function(t,e,n){const o=Li(t,n),{scroll:i}=e;return i&&(Si(o.x,i.offset.x),Si(o.y,i.offset.y)),o}(n,o.root,this.visualElement.getTransformPagePoint());let r=function(t,e){return{x:ui(t.x,e.x),y:ui(t.y,e.y)}}(o.layout.layoutBox,i);if(e){const t=e(function({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}(r));this.hasMutatedConstraints=!!t,t&&(r=mi(t))}return r}startAnimation(t){const{drag:e,dragMomentum:n,dragElastic:o,dragTransition:i,dragSnapToOrigin:r,onDragTransitionEnd:s}=this.getProps(),a=this.constraints||{},l=fi(s=>{if(!Bi(s,e,this.currentDirection))return;let l=(null==a?void 0:a[s])||{};r&&(l={min:0,max:0});const u=o?200:1e6,c=o?40:1e7,h={type:"inertia",velocity:n?t[s]:0,bounceStiffness:u,bounceDamping:c,timeConstant:750,restDelta:1,restSpeed:10,...i,...l};return this.startAxisValueAnimation(s,h)});return Promise.all(l).then(s)}startAxisValueAnimation(t,e){const n=this.getAxisMotionValue(t);return n.start(ko(t,n,0,e))}stopAnimation(){fi(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){var e;const n="_drag"+t.toUpperCase(),o=this.visualElement.getProps()[n];return o||this.visualElement.getValue(t,(null===(e=this.visualElement.getProps().initial)||void 0===e?void 0:e[t])||0)}snapToCursor(t){fi(e=>{const{drag:n}=this.getProps();if(!Bi(e,n,this.currentDirection))return;const{projection:o}=this.visualElement,i=this.getAxisMotionValue(e);if(o&&o.layout){const{min:n,max:r}=o.layout.layoutBox[e];i.set(t[e]-Vn(n,r,.5))}})}scalePositionWithinConstraints(){var t;if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:o}=this.visualElement;if(!p(n)||!o||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};fi(t=>{const e=this.getAxisMotionValue(t);if(e){const n=e.get();i[t]=function(t,e){let n=.5;const o=ei(t),i=ei(e);return i>o?n=jn(e.min,e.max-o,t.min):o>i&&(n=jn(t.min,t.max-i,e.min)),G(0,1,n)}({min:n,max:n},this.constraints[t])}});const{transformTemplate:r}=this.visualElement.getProps();this.visualElement.current.style.transform=r?r({},""):"none",null===(t=o.root)||void 0===t||t.updateScroll(),o.updateLayout(),this.resolveConstraints(),fi(t=>{if(!Bi(t,e,null))return;const n=this.getAxisMotionValue(t),{min:o,max:r}=this.constraints[t];n.set(Vn(o,r,i[t]))})}addListeners(){var t;if(!this.visualElement.current)return;Di.set(this.visualElement,this);const e=Zt(this.visualElement.current,"pointerdown",t=>{const{drag:e,dragListener:n=!0}=this.getProps();e&&n&&this.start(t)}),n=()=>{const{dragConstraints:t}=this.getProps();p(t)&&(this.constraints=this.resolveRefConstraints())},{projection:o}=this.visualElement,i=o.addEventListener("measure",n);o&&!o.layout&&(null===(t=o.root)||void 0===t||t.updateScroll(),o.updateLayout()),n();const r=$t(window,"resize",()=>this.scalePositionWithinConstraints()),s=o.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e})=>{this.isDragging&&e&&(fi(e=>{const n=this.getAxisMotionValue(e);n&&(this.originPoint[e]+=t[e].translate,n.set(n.get()+t[e].translate))}),this.visualElement.render())});return()=>{r(),e(),i(),null==s||s()}}getProps(){const t=this.visualElement.getProps(),{drag:e=!1,dragDirectionLock:n=!1,dragPropagation:o=!1,dragConstraints:i=!1,dragElastic:r=ci,dragMomentum:s=!0}=t;return{...t,drag:e,dragDirectionLock:n,dragPropagation:o,dragConstraints:i,dragElastic:r,dragMomentum:s}}}function Bi(t,e,n){return!(!0!==e&&e!==t||null!==n&&n!==t)}const Ii={pan:me((function({onPan:t,onPanStart:n,onPanEnd:o,onPanSessionStart:i,visualElement:r}){const a=t||n||o||i,l=e.useRef(null),{transformPagePoint:u}=e.useContext(s),c={onSessionStart:i,onStart:n,onMove:t,onEnd:(t,e)=>{l.current=null,o&&o(t,e)}};e.useEffect(()=>{null!==l.current&&l.current.updateHandlers(c)}),Kt(r,"pointerdown",a&&function(t){l.current=new qo(t,c,{transformPagePoint:u})}),ie(()=>l.current&&l.current.end())})),drag:me((function(t){const{dragControls:n,visualElement:o}=t,i=P(()=>new ki(o));e.useEffect(()=>n&&n.subscribe(i),[i,n]),e.useEffect(()=>i.addListeners(),[i])}))};function Oi(t){return"string"==typeof t&&t.startsWith("var(--")}const ji=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function Fi(t,e,n=1){const[o,i]=function(t){const e=ji.exec(t);if(!e)return[,];const[,n,o]=e;return[n,o]}(t);if(!o)return;const r=window.getComputedStyle(e).getPropertyValue(o);return r?r.trim():Oi(i)?Fi(i,e,n+1):i}const Ui=new Set(["width","height","top","left","right","bottom","x","y"]),Ni=t=>Ui.has(t),zi=t=>t===q||t===rt;var Wi;!function(t){t.width="width",t.height="height",t.left="left",t.right="right",t.top="top",t.bottom="bottom"}(Wi||(Wi={}));const Hi=(t,e)=>parseFloat(t.split(", ")[e]),$i=(t,e)=>(n,{transform:o})=>{if("none"===o||!o)return 0;const i=o.match(/^matrix3d\((.+)\)$/);if(i)return Hi(i[1],e);{const e=o.match(/^matrix\((.+)\)$/);return e?Hi(e[1],t):0}},Yi=new Set(["x","y","z"]),Xi=F.filter(t=>!Yi.has(t));const Gi={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:$i(4,13),y:$i(5,14)},qi=(t,e,n={},o={})=>{e={...e},o={...o};const i=Object.keys(e).filter(Ni);let r=[],s=!1;const a=[];if(i.forEach(i=>{const l=t.getValue(i);if(!t.hasValue(i))return;let u=n[i],c=ln(u);const h=e[i];let d;if(Ot(h)){const t=h.length,e=null===h[0]?1:0;u=h[e],c=ln(u);for(let n=e;n<t;n++)d?ln(h[n]):d=ln(h[n])}else d=ln(h);if(c!==d)if(zi(c)&&zi(d)){const t=l.get();"string"==typeof t&&l.set(parseFloat(t)),"string"==typeof h?e[i]=parseFloat(h):Array.isArray(h)&&d===rt&&(e[i]=h.map(parseFloat))}else(null==c?void 0:c.transform)&&(null==d?void 0:d.transform)&&(0===u||0===h)?0===u?l.set(d.transform(u)):e[i]=c.transform(h):(s||(r=function(t){const e=[];return Xi.forEach(n=>{const o=t.getValue(n);void 0!==o&&(e.push([n,o.get()]),o.set(n.startsWith("scale")?1:0))}),e.length&&t.render(),e}(t),s=!0),a.push(i),o[i]=void 0!==o[i]?o[i]:e[i],l.jump(h))}),a.length){const n=a.indexOf("height")>=0?window.pageYOffset:null,i=((t,e,n)=>{const o=e.measureViewportBox(),i=e.current,r=getComputedStyle(i),{display:s}=r,a={};"none"===s&&e.setStaticValue("display",t.display||"block"),n.forEach(t=>{a[t]=Gi[t](o,r)}),e.render();const l=e.measureViewportBox();return n.forEach(n=>{const o=e.getValue(n);o&&o.jump(a[n]),t[n]=Gi[n](l,r)}),t})(e,t,a);return r.length&&r.forEach(([e,n])=>{t.getValue(e).set(n)}),t.render(),c&&null!==n&&window.scrollTo({top:n}),{target:i,transitionEnd:o}}return{target:e,transitionEnd:o}};function Zi(t,e,n,o){return(t=>Object.keys(t).some(Ni))(e)?qi(t,e,n,o):{target:e,transitionEnd:o}}const Ki=(t,e,n,o)=>{const i=function(t,{...e},n){const o=t.current;if(!(o instanceof Element))return{target:e,transitionEnd:n};n&&(n={...n}),t.values.forEach(t=>{const e=t.get();if(!Oi(e))return;const n=Fi(e,o);n&&t.set(n)});for(const t in e){const i=e[t];if(!Oi(i))continue;const r=Fi(i,o);r&&(e[t]=r,n&&void 0===n[t]&&(n[t]=i))}return{target:e,transitionEnd:n}}(t,e,o);return Zi(t,e=i.target,n,o=i.transitionEnd)},_i={current:null},Ji={current:!1};function Qi(){if(Ji.current=!0,c)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>_i.current=t.matches;t.addListener(e),e()}else _i.current=!1}const tr=Object.keys(T),er=tr.length,nr=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class or{constructor({parent:t,props:e,reducedMotionConfig:n,visualState:o},i={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.isPresent=!0,this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.scheduleRender=()=>Ce.render(this.render,!1,!0);const{latestValues:r,renderState:s}=o;this.latestValues=r,this.baseTarget={...r},this.initialValues=e.initial?{...r}:{},this.renderState=s,this.parent=t,this.props=e,this.depth=t?t.depth+1:0,this.reducedMotionConfig=n,this.options=i,this.isControllingVariants=y(e),this.isVariantNode=v(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:a,...l}=this.scrapeMotionValuesFromProps(e,{});for(const t in l){const e=l[t];void 0!==r[t]&&z(e)&&(e.set(r[t],!1),vn(a)&&a.add(t))}}scrapeMotionValuesFromProps(t,e){return{}}mount(t){var e;this.current=t,this.projection&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=null===(e=this.parent)||void 0===e?void 0:e.addVariantChild(this)),this.values.forEach((t,e)=>this.bindToMotionValue(e,t)),Ji.current||Qi(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||_i.current),this.parent&&this.parent.children.add(this),this.setProps(this.props)}unmount(){var t,e,n;null===(t=this.projection)||void 0===t||t.unmount(),Me.update(this.notifyUpdate),Me.render(this.render),this.valueSubscriptions.forEach(t=>t()),null===(e=this.removeFromVariantTree)||void 0===e||e.call(this),null===(n=this.parent)||void 0===n||n.children.delete(this);for(const t in this.events)this.events[t].clear();this.current=null}bindToMotionValue(t,e){const n=U.has(t),o=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&Ce.update(this.notifyUpdate,!1,!0),n&&this.projection&&(this.projection.isTransformDirty=!0)}),i=e.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(t,()=>{o(),i()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}loadFeatures({children:t,...n},o,i,r,s,a){const l=[];for(let t=0;t<er;t++){const o=tr[t],{isEnabled:i,Component:r}=T[o];i(n)&&r&&l.push(e.createElement(r,{key:o,...n,visualElement:this}))}if(!this.projection&&s){this.projection=new s(r,this.latestValues,this.parent&&this.parent.projection);const{layoutId:t,layout:e,drag:o,dragConstraints:i,layoutScroll:l,layoutRoot:u}=n;this.projection.setOptions({layoutId:t,layout:e,alwaysMeasureLayout:Boolean(o)||i&&p(i),visualElement:this,scheduleRender:()=>this.scheduleRender(),animationType:"string"==typeof e?e:"both",initialPromotionConfig:a,layoutScroll:l,layoutRoot:u})}return l}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}makeTargetAnimatable(t,e=!0){return this.makeTargetAnimatableFromInstance(t,this.props,e)}setProps(t){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender();const e=this.props;this.props=t;for(let e=0;e<nr.length;e++){const n=nr[e];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);const o=t["on"+n];o&&(this.propEventSubscriptions[n]=this.on(n,o))}this.prevMotionValues=function(t,e,n){const{willChange:o}=e;for(const i in e){const r=e[i],s=n[i];if(z(r))t.addValue(i,r),vn(o)&&o.add(i);else if(z(s))t.addValue(i,Ue(r,{owner:t})),vn(o)&&o.remove(i);else if(s!==r)if(t.hasValue(i)){const e=t.getValue(i);!e.hasAnimated&&e.set(r)}else{const e=t.getStaticValue(i);t.addValue(i,Ue(void 0!==e?e:r,{owner:t}))}}for(const o in n)void 0===e[o]&&t.removeValue(o);return e}(this,this.scrapeMotionValuesFromProps(t,e),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){var e;return null===(e=this.props.variants)||void 0===e?void 0:e[t]}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){var t;return this.isVariantNode?this:null===(t=this.parent)||void 0===t?void 0:t.getClosestVariantNode()}getVariantContext(t=!1){var e,n;if(t)return null===(e=this.parent)||void 0===e?void 0:e.getVariantContext();if(!this.isControllingVariants){const t=(null===(n=this.parent)||void 0===n?void 0:n.getVariantContext())||{};return void 0!==this.props.initial&&(t.initial=this.props.initial),t}const o={};for(let t=0;t<rr;t++){const e=ir[t],n=this.props[e];(f(n)||!1===n)&&(o[e]=n)}return o}addVariantChild(t){var e;const n=this.getClosestVariantNode();if(n)return null===(e=n.variantChildren)||void 0===e||e.add(t),()=>n.variantChildren.delete(t)}addValue(t,e){e!==this.values.get(t)&&(this.removeValue(t),this.bindToMotionValue(t,e)),this.values.set(t,e),this.latestValues[t]=e.get()}removeValue(t){var e;this.values.delete(t),null===(e=this.valueSubscriptions.get(t))||void 0===e||e(),this.valueSubscriptions.delete(t),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return void 0===n&&void 0!==e&&(n=Ue(e,{owner:this}),this.addValue(t,n)),n}readValue(t){return void 0===this.latestValues[t]&&this.current?this.readValueFromInstance(this.current,t,this.options):this.latestValues[t]}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){var e;const{initial:n}=this.props,o="string"==typeof n||"object"==typeof n?null===(e=It(this.props,n))||void 0===e?void 0:e[t]:void 0;if(n&&void 0!==o)return o;const i=this.getBaseTargetFromProps(this.props,t);return void 0===i||z(i)?void 0!==this.initialValues[t]&&void 0===o?void 0:this.baseTarget[t]:i}on(t,e){return this.events[t]||(this.events[t]=new Oe),this.events[t].add(e)}notify(t,...e){var n;null===(n=this.events[t])||void 0===n||n.notify(...e)}}const ir=["initial",...Uo],rr=ir.length;class sr extends or{sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){var n;return null===(n=t.style)||void 0===n?void 0:n[e]}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}makeTargetAnimatableFromInstance({transition:t,transitionEnd:e,...n},{transformValues:o},i){let r=yn(n,t||{},this);if(o&&(e&&(e=o(e)),n&&(n=o(n)),r&&(r=o(r))),i){mn(this,n,r);const t=Ki(this,n,r,e);e=t.transitionEnd,n=t.target}return{transition:t,transitionEnd:e,...n}}}class ar extends sr{readValueFromInstance(t,e){if(U.has(e)){const t=on(e);return t&&t.default||0}{const o=(n=t,window.getComputedStyle(n)),i=(Y(e)?o.getPropertyValue(e):o[e])||0;return"string"==typeof i?i.trim():i}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return Li(t,e)}build(t,e,n,o){ht(t,e,n,o.transformTemplate)}scrapeMotionValuesFromProps(t,e){return kt(t,e)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;z(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=""+t)}))}renderInstance(t,e,n,o){Rt(t,e,n,o)}}class lr extends sr{constructor(){super(...arguments),this.isSVGTag=!1}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){var n;return U.has(e)?(null===(n=on(e))||void 0===n?void 0:n.default)||0:(e=Lt.has(e)?e:Mt(e),t.getAttribute(e))}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}scrapeMotionValuesFromProps(t,e){return Bt(t,e)}build(t,e,n,o){Pt(t,e,n,this.isSVGTag,o.transformTemplate)}renderInstance(t,e,n,o){Dt(t,e,0,o)}mount(t){this.isSVGTag=St(t.tagName),super.mount(t)}}const ur=(t,e)=>I(t)?new lr(e,{enableHardwareAcceleration:!1}):new ar(e,{enableHardwareAcceleration:!0});function cr(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const hr={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!rt.test(t))return t;t=parseFloat(t)}return`${cr(t,e.target.x)}% ${cr(t,e.target.y)}%`}},dr={correct:(t,{treeScale:e,projectionDelta:n})=>{const o=t,i=t.includes("var("),r=[];i&&(t=t.replace(ji,t=>(r.push(t),"_$css")));const s=_e.parse(t);if(s.length>5)return o;const a=_e.createTransformer(t),l="number"!=typeof s[0]?1:0,u=n.x.scale*e.x,c=n.y.scale*e.y;s[0+l]/=u,s[1+l]/=c;const h=Vn(u,c,.5);"number"==typeof s[2+l]&&(s[2+l]/=h),"number"==typeof s[3+l]&&(s[3+l]/=h);let d=a(s);if(i){let t=0;d=d.replace("_$css",()=>{const e=r[t];return t++,e})}return d}};class pr extends i.default.Component{componentDidMount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n,layoutId:o}=this.props,{projection:i}=t;j(fr),i&&(e.group&&e.group.add(i),n&&n.register&&o&&n.register(i),i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,onExitComplete:()=>this.safeToRemove()})),A.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:e,visualElement:n,drag:o,isPresent:i}=this.props,r=n.projection;return r?(r.isPresent=i,o||t.layoutDependency!==e||void 0===e?r.willUpdate():this.safeToRemove(),t.isPresent!==i&&(i?r.promote():r.relegate()||Ce.postRender(()=>{var t;(null===(t=r.getStack())||void 0===t?void 0:t.members.length)||this.safeToRemove()})),null):null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),!t.currentAnimation&&t.isLead()&&this.safeToRemove())}componentWillUnmount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n}=this.props,{projection:o}=t;o&&(o.scheduleCheckAfterUnmount(),(null==e?void 0:e.group)&&e.group.remove(o),(null==n?void 0:n.deregister)&&n.deregister(o))}safeToRemove(){const{safeToRemove:t}=this.props;null==t||t()}render(){return null}}const fr={borderRadius:{...hr,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:hr,borderTopRightRadius:hr,borderBottomLeftRadius:hr,borderBottomRightRadius:hr,boxShadow:dr},mr={measureLayout:function(t){const[n,o]=ye(),r=e.useContext(V);return i.default.createElement(pr,{...t,layoutGroup:r,switchLayoutGroup:e.useContext(M),isPresent:n,safeToRemove:o})}};function gr(t,e,n={}){const o=z(t)?t:Ue(t);return o.start(ko("",o,e,n)),{stop:()=>o.stop(),isAnimating:()=>o.isAnimating()}}const yr=["TopLeft","TopRight","BottomLeft","BottomRight"],vr=yr.length,xr=t=>"string"==typeof t?parseFloat(t):t,Er=t=>"number"==typeof t||rt.test(t);function wr(t,e){return void 0!==t[e]?t[e]:t.borderRadius}const Tr=Pr(0,.5,Yn),br=Pr(.5,.95,zn);function Pr(t,e,n){return o=>o<t?0:o>e?1:n(jn(t,e,o))}function Ar(t,e){t.min=e.min,t.max=e.max}function Sr(t,e){Ar(t.x,e.x),Ar(t.y,e.y)}function Vr(t,e,n,o,i){return t=wi(t-=e,1/n,o),void 0!==i&&(t=wi(t,1/i,o)),t}function Cr(t,e,[n,o,i],r,s){!function(t,e=0,n=1,o=.5,i,r=t,s=t){if(it.test(e)){e=parseFloat(e);e=Vn(s.min,s.max,e/100)-s.min}if("number"!=typeof e)return;let a=Vn(r.min,r.max,o);t===r&&(a-=e),t.min=Vr(t.min,e,n,a,i),t.max=Vr(t.max,e,n,a,i)}(t,e[n],e[o],e[i],e.scale,r,s)}const Mr=["x","scaleX","originX"],Rr=["y","scaleY","originY"];function Lr(t,e,n,o){Cr(t.x,e,Mr,null==n?void 0:n.x,null==o?void 0:o.x),Cr(t.y,e,Rr,null==n?void 0:n.y,null==o?void 0:o.y)}function Dr(t){return 0===t.translate&&1===t.scale}function kr(t){return Dr(t.x)&&Dr(t.y)}function Br(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 Ir(t){return ei(t.x)/ei(t.y)}class Or{constructor(){this.members=[]}add(t){Be(this.members,t),t.scheduleRender()}remove(t){if(Ie(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const t=this.members[this.members.length-1];t&&this.promote(t)}}relegate(t){const e=this.members.findIndex(e=>t===e);if(0===e)return!1;let n;for(let t=e;t>=0;t--){const e=this.members[t];if(!1!==e.isPresent){n=e;break}}return!!n&&(this.promote(n),!0)}promote(t,e){var n;const o=this.lead;if(t!==o&&(this.prevLead=o,this.lead=t,t.show(),o)){o.instance&&o.scheduleRender(),t.scheduleRender(),t.resumeFrom=o,e&&(t.resumeFrom.preserveOpacity=!0),o.snapshot&&(t.snapshot=o.snapshot,t.snapshot.latestValues=o.animationValues||o.latestValues),(null===(n=t.root)||void 0===n?void 0:n.isUpdating)&&(t.isLayoutDirty=!0);const{crossfade:i}=t.options;!1===i&&o.hide()}}exitAnimationComplete(){this.members.forEach(t=>{var e,n,o,i,r;null===(n=(e=t.options).onExitComplete)||void 0===n||n.call(e),null===(r=null===(o=t.resumingFrom)||void 0===o?void 0:(i=o.options).onExitComplete)||void 0===r||r.call(i)})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function jr(t,e,n){let o="";const i=t.x.translate/e.x,r=t.y.translate/e.y;if((i||r)&&(o=`translate3d(${i}px, ${r}px, 0) `),1===e.x&&1===e.y||(o+=`scale(${1/e.x}, ${1/e.y}) `),n){const{rotate:t,rotateX:e,rotateY:i}=n;t&&(o+=`rotate(${t}deg) `),e&&(o+=`rotateX(${e}deg) `),i&&(o+=`rotateY(${i}deg) `)}const s=t.x.scale*e.x,a=t.y.scale*e.y;return 1===s&&1===a||(o+=`scale(${s}, ${a})`),o||"none"}const Fr=(t,e)=>t.depth-e.depth;class Ur{constructor(){this.children=[],this.isDirty=!1}add(t){Be(this.children,t),this.isDirty=!0}remove(t){Ie(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Fr),this.isDirty=!1,this.children.forEach(t)}}const Nr=["","X","Y","Z"];let zr=0;function Wr({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:o,resetTransform:i}){return class{constructor(t,n={},o=(null==e?void 0:e())){this.id=zr++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isTransformDirty=!1,this.isProjectionDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.potentialNodes=new Map,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.nodes.forEach(Yr),this.nodes.forEach(Kr),this.nodes.forEach(_r)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.elementId=t,this.latestValues=n,this.root=o?o.root||o:this,this.path=o?[...o.path,o]:[],this.parent=o,this.depth=o?o.depth+1:0,t&&this.root.registerPotentialNode(t,this);for(let t=0;t<this.path.length;t++)this.path[t].shouldResetTransform=!0;this.root===this&&(this.nodes=new Ur)}addEventListener(t,e){return this.eventHandlers.has(t)||this.eventHandlers.set(t,new Oe),this.eventHandlers.get(t).add(e)}notifyListeners(t,...e){const n=this.eventHandlers.get(t);null==n||n.notify(...e)}hasListeners(t){return this.eventHandlers.has(t)}registerPotentialNode(t,e){this.potentialNodes.set(t,e)}mount(e,n=!1){var o;if(this.instance)return;this.isSVG=e instanceof SVGElement&&"svg"!==e.tagName,this.instance=e;const{layoutId:i,layout:r,visualElement:s}=this.options;if(s&&!s.current&&s.mount(e),this.root.nodes.add(this),null===(o=this.parent)||void 0===o||o.children.add(this),this.elementId&&this.root.potentialNodes.delete(this.elementId),n&&(r||i)&&(this.isLayoutDirty=!0),t){let n;const o=()=>this.root.updateBlockedByResize=!1;t(e,()=>{this.root.updateBlockedByResize=!0,n&&n(),n=wo(o,250),A.hasAnimatedSinceResize&&(A.hasAnimatedSinceResize=!1,this.nodes.forEach(Zr))})}i&&this.root.registerSharedNode(i,this),!1!==this.options.animate&&s&&(i||r)&&this.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e,hasRelativeTargetChanged:n,layout:o})=>{var i,r,a,l,u;if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const c=null!==(r=null!==(i=this.options.transition)&&void 0!==i?i:s.getDefaultTransition())&&void 0!==r?r:os,{onLayoutAnimationStart:h,onLayoutAnimationComplete:d}=s.getProps(),p=!this.targetLayout||!Br(this.targetLayout,o)||n,f=!e&&n;if(this.options.layoutRoot||(null===(a=this.resumeFrom)||void 0===a?void 0:a.instance)||f||e&&(p||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(t,f);const e={...Do(c,"layout"),onPlay:h,onComplete:d};(s.shouldReduceMotion||this.options.layoutRoot)&&(e.delay=0,e.type=!1),this.startAnimation(e)}else e||0!==this.animationProgress||Zr(this),this.isLead()&&(null===(u=(l=this.options).onExitComplete)||void 0===u||u.call(l));this.targetLayout=o})}unmount(){var t,e;this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this),null===(t=this.getStack())||void 0===t||t.remove(this),null===(e=this.parent)||void 0===e||e.children.delete(this),this.instance=void 0,Me.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(Jr),this.animationId++)}getTransformTemplate(){var t;return null===(t=this.options.visualElement)||void 0===t?void 0:t.getProps().transformTemplate}willUpdate(t=!0){var e,n,o;if(this.root.isUpdateBlocked())return void(null===(n=(e=this.options).onExitComplete)||void 0===n||n.call(e));if(!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let t=0;t<this.path.length;t++){const e=this.path[t];e.shouldResetTransform=!0,e.updateScroll("snapshot"),e.options.layoutRoot&&e.willUpdate(!1)}const{layoutId:i,layout:r}=this.options;(void 0!==i||r)&&(this.prevTransformTemplateValue=null===(o=this.getTransformTemplate())||void 0===o?void 0:o(this.latestValues,""),this.updateSnapshot(),t&&this.notifyListeners("willUpdate"))}didUpdate(){if(this.isUpdateBlocked())return this.unblockUpdate(),this.clearAllSnapshots(),void this.nodes.forEach(Gr);this.isUpdating&&(this.isUpdating=!1,this.potentialNodes.size&&(this.potentialNodes.forEach(is),this.potentialNodes.clear()),this.nodes.forEach(qr),this.nodes.forEach(Hr),this.nodes.forEach($r),this.clearAllSnapshots(),Re.update(),Re.preRender(),Re.render())}clearAllSnapshots(){this.nodes.forEach(Xr),this.sharedNodes.forEach(Qr)}scheduleUpdateProjection(){Ce.preRender(this.updateProjection,!1,!0)}scheduleCheckAfterUnmount(){Ce.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure())}updateLayout(){var t;if(!this.instance)return;if(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let t=0;t<this.path.length;t++){this.path[t].updateScroll()}const e=this.layout;this.layout=this.measure(!1),this.layoutCorrected={x:{min:0,max:0},y:{min:0,max:0}},this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox),null===(t=this.options.visualElement)||void 0===t||t.notify("LayoutMeasure",this.layout.layoutBox,null==e?void 0:e.layoutBox)}updateScroll(t="measure"){let e=Boolean(this.options.layoutScroll&&this.instance);this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===t&&(e=!1),e&&(this.scroll={animationId:this.root.animationId,phase:t,isRoot:o(this.instance),offset:n(this.instance)})}resetTransform(){var t;if(!i)return;const e=this.isLayoutDirty||this.shouldResetTransform,n=this.projectionDelta&&!kr(this.projectionDelta),o=null===(t=this.getTransformTemplate())||void 0===t?void 0:t(this.latestValues,""),r=o!==this.prevTransformTemplateValue;e&&(n||vi(this.latestValues)||r)&&(i(this.instance,o),this.shouldResetTransform=!1,this.scheduleRender())}measure(t=!0){const e=this.measurePageBox();let n=this.removeElementScroll(e);var o;return t&&(n=this.removeTransform(n)),rs((o=n).x),rs(o.y),{animationId:this.root.animationId,measuredBox:e,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:t}=this.options;if(!t)return{x:{min:0,max:0},y:{min:0,max:0}};const e=t.measureViewportBox(),{scroll:n}=this.root;return n&&(Si(e.x,n.offset.x),Si(e.y,n.offset.y)),e}removeElementScroll(t){const e={x:{min:0,max:0},y:{min:0,max:0}};Sr(e,t);for(let n=0;n<this.path.length;n++){const o=this.path[n],{scroll:i,options:r}=o;if(o!==this.root&&i&&r.layoutScroll){if(i.isRoot){Sr(e,t);const{scroll:n}=this.root;n&&(Si(e.x,-n.offset.x),Si(e.y,-n.offset.y))}Si(e.x,i.offset.x),Si(e.y,i.offset.y)}}return e}applyTransform(t,e=!1){const n={x:{min:0,max:0},y:{min:0,max:0}};Sr(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&&Ri(n,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),vi(o.latestValues)&&Ri(n,o.latestValues)}return vi(this.latestValues)&&Ri(n,this.latestValues),n}removeTransform(t){var e;const n={x:{min:0,max:0},y:{min:0,max:0}};Sr(n,t);for(let t=0;t<this.path.length;t++){const o=this.path[t];if(!o.instance)continue;if(!vi(o.latestValues))continue;yi(o.latestValues)&&o.updateSnapshot();const i={x:{min:0,max:0},y:{min:0,max:0}};Sr(i,o.measurePageBox()),Lr(n,o.latestValues,null===(e=o.snapshot)||void 0===e?void 0:e.layoutBox,i)}return vi(this.latestValues)&&Lr(n,this.latestValues),n}setTargetDelta(t){this.targetDelta=t,this.isProjectionDirty=!0,this.root.scheduleUpdateProjection()}setOptions(t){this.options={...this.options,...t,crossfade:void 0===t.crossfade||t.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}resolveTargetDelta(){var t;const e=this.getLead();if(this.isProjectionDirty||(this.isProjectionDirty=e.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=e.isTransformDirty),!this.isProjectionDirty&&!this.attemptToResolveRelativeTarget)return;const{layout:n,layoutId:o}=this.options;if(this.layout&&(n||o)){if(!this.targetDelta&&!this.relativeTarget){const t=this.getClosestProjectingParent();t&&t.layout?(this.relativeParent=t,this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},ai(this.relativeTargetOrigin,this.layout.layoutBox,t.layout.layoutBox),Sr(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}var i,r,s;if(this.relativeTarget||this.targetDelta)if(this.target||(this.target={x:{min:0,max:0},y:{min:0,max:0}},this.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}}),this.relativeTarget&&this.relativeTargetOrigin&&(null===(t=this.relativeParent)||void 0===t?void 0:t.target)?(i=this.target,r=this.relativeTarget,s=this.relativeParent.target,ri(i.x,r.x,s.x),ri(i.y,r.y,s.y)):this.targetDelta?(Boolean(this.resumingFrom)?this.target=this.applyTransform(this.layout.layoutBox):Sr(this.target,this.layout.layoutBox),Pi(this.target,this.targetDelta)):Sr(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const t=this.getClosestProjectingParent();t&&Boolean(t.resumingFrom)===Boolean(this.resumingFrom)&&!t.options.layoutScroll&&t.target?(this.relativeParent=t,this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},ai(this.relativeTargetOrigin,this.target,t.target),Sr(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(this.parent&&!yi(this.parent.latestValues)&&!xi(this.parent.latestValues))return(this.parent.relativeTarget||this.parent.targetDelta||this.parent.options.layoutRoot)&&this.parent.layout?this.parent:this.parent.getClosestProjectingParent()}calcProjection(){var t;const{isProjectionDirty:e,isTransformDirty:n}=this;this.isProjectionDirty=this.isTransformDirty=!1;const o=this.getLead(),i=Boolean(this.resumingFrom)||this!==o;let r=!0;if(e&&(r=!1),i&&n&&(r=!1),r)return;const{layout:s,layoutId:a}=this.options;if(this.isTreeAnimating=Boolean((null===(t=this.parent)||void 0===t?void 0:t.isTreeAnimating)||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!s&&!a)return;Sr(this.layoutCorrected,this.layout.layoutBox),function(t,e,n,o=!1){var i,r;const s=n.length;if(!s)return;let a,l;e.x=e.y=1;for(let u=0;u<s;u++)a=n[u],l=a.projectionDelta,"contents"!==(null===(r=null===(i=a.instance)||void 0===i?void 0:i.style)||void 0===r?void 0:r.display)&&(o&&a.options.layoutScroll&&a.scroll&&a!==a.root&&Ri(t,{x:-a.scroll.offset.x,y:-a.scroll.offset.y}),l&&(e.x*=l.x.scale,e.y*=l.y.scale,Pi(t,l)),o&&vi(a.latestValues)&&Ri(t,a.latestValues));e.x=Ai(e.x),e.y=Ai(e.y)}(this.layoutCorrected,this.treeScale,this.path,i);const{target:l}=o;if(!l)return;this.projectionDelta||(this.projectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDeltaWithTransform={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}});const u=this.treeScale.x,c=this.treeScale.y,h=this.projectionTransform;ii(this.projectionDelta,this.layoutCorrected,l,this.latestValues),this.projectionTransform=jr(this.projectionDelta,this.treeScale),this.projectionTransform===h&&this.treeScale.x===u&&this.treeScale.y===c||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",l))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(t=!0){var e,n,o;null===(n=(e=this.options).scheduleRender)||void 0===n||n.call(e),t&&(null===(o=this.getStack())||void 0===o||o.scheduleRender()),this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}setAnimationOrigin(t,e=!1){var n,o;const i=this.snapshot,r=(null==i?void 0:i.latestValues)||{},s={...this.latestValues},a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!e;const l={x:{min:0,max:0},y:{min:0,max:0}},u=(null==i?void 0:i.source)!==(null===(n=this.layout)||void 0===n?void 0:n.source),c=((null===(o=this.getStack())||void 0===o?void 0:o.members.length)||0)<=1,h=Boolean(u&&!c&&!0===this.options.crossfade&&!this.path.some(ns));this.animationProgress=0,this.mixTargetDelta=e=>{var n;const o=e/1e3;var i,d,p,f;ts(a.x,t.x,o),ts(a.y,t.y,o),this.setTargetDelta(a),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&(null===(n=this.relativeParent)||void 0===n?void 0:n.layout)&&(ai(l,this.layout.layoutBox,this.relativeParent.layout.layoutBox),i=this.relativeTarget,d=this.relativeTargetOrigin,p=l,f=o,es(i.x,d.x,p.x,f),es(i.y,d.y,p.y,f)),u&&(this.animationValues=s,function(t,e,n,o,i,r){i?(t.opacity=Vn(0,void 0!==n.opacity?n.opacity:1,Tr(o)),t.opacityExit=Vn(void 0!==e.opacity?e.opacity:1,0,br(o))):r&&(t.opacity=Vn(void 0!==e.opacity?e.opacity:1,void 0!==n.opacity?n.opacity:1,o));for(let i=0;i<vr;i++){const r=`border${yr[i]}Radius`;let s=wr(e,r),a=wr(n,r);if(void 0===s&&void 0===a)continue;s||(s=0),a||(a=0);0===s||0===a||Er(s)===Er(a)?(t[r]=Math.max(Vn(xr(s),xr(a),o),0),(it.test(a)||it.test(s))&&(t[r]+="%")):t[r]=a}(e.rotate||n.rotate)&&(t.rotate=Vn(e.rotate||0,n.rotate||0,o))}(s,r,this.latestValues,o,h,c)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=o},this.mixTargetDelta(this.options.layoutRoot?1e3: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&&(Me.update(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Ce.update(()=>{A.hasAnimatedSinceResize=!0,this.currentAnimation=gr(0,1e3,{...t,onUpdate:e=>{var n;this.mixTargetDelta(e),null===(n=t.onUpdate)||void 0===n||n.call(t,e)},onComplete:()=>{var e;null===(e=t.onComplete)||void 0===e||e.call(t),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){var t;this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0),null===(t=this.getStack())||void 0===t||t.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){var t;this.currentAnimation&&(null===(t=this.mixTargetDelta)||void 0===t||t.call(this,1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const t=this.getLead();let{targetWithTransforms:e,target:n,layout:o,latestValues:i}=t;if(e&&n&&o){if(this!==t&&this.layout&&o&&ss(this.options.animationType,this.layout.layoutBox,o.layoutBox)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const e=ei(this.layout.layoutBox.x);n.x.min=t.target.x.min,n.x.max=n.x.min+e;const o=ei(this.layout.layoutBox.y);n.y.min=t.target.y.min,n.y.max=n.y.min+o}Sr(e,n),Ri(e,i),ii(this.projectionDeltaWithTransform,this.layoutCorrected,e,i)}}registerSharedNode(t,e){var n,o,i;this.sharedNodes.has(t)||this.sharedNodes.set(t,new Or);this.sharedNodes.get(t).add(e),e.promote({transition:null===(n=e.options.initialPromotionConfig)||void 0===n?void 0:n.transition,preserveFollowOpacity:null===(i=null===(o=e.options.initialPromotionConfig)||void 0===o?void 0:o.shouldPreserveFollowOpacity)||void 0===i?void 0:i.call(o,e)})}isLead(){const t=this.getStack();return!t||t.lead===this}getLead(){var t;const{layoutId:e}=this.options;return e&&(null===(t=this.getStack())||void 0===t?void 0:t.lead)||this}getPrevLead(){var t;const{layoutId:e}=this.options;return e?null===(t=this.getStack())||void 0===t?void 0:t.prevLead:void 0}getStack(){const{layoutId:t}=this.options;if(t)return this.root.sharedNodes.get(t)}promote({needsReset:t,transition:e,preserveFollowOpacity:n}={}){const o=this.getStack();o&&o.promote(this,n),t&&(this.projectionDelta=void 0,this.needsReset=!0),e&&this.setOptions({transition:e})}relegate(){const t=this.getStack();return!!t&&t.relegate(this)}resetRotation(){const{visualElement:t}=this.options;if(!t)return;let e=!1;const{latestValues:n}=t;if((n.rotate||n.rotateX||n.rotateY||n.rotateZ)&&(e=!0),!e)return;const o={};for(let e=0;e<Nr.length;e++){const i="rotate"+Nr[e];n[i]&&(o[i]=n[i],t.setStaticValue(i,0))}null==t||t.render();for(const e in o)t.setStaticValue(e,o[e]);t.scheduleRender()}getProjectionStyles(t={}){var e,n;const o={};if(!this.instance||this.isSVG)return o;if(!this.isVisible)return{visibility:"hidden"};o.visibility="";const i=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,o.opacity="",o.pointerEvents=jt(t.pointerEvents)||"",o.transform=i?i(this.latestValues,""):"none",o;const r=this.getLead();if(!this.projectionDelta||!this.layout||!r.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&&!vi(this.latestValues)&&(e.transform=i?i({},""):"none",this.hasProjected=!1),e}const s=r.animationValues||r.latestValues;this.applyTransformsToTarget(),o.transform=jr(this.projectionDeltaWithTransform,this.treeScale,s),i&&(o.transform=i(s,o.transform));const{x:a,y:l}=this.projectionDelta;o.transformOrigin=`${100*a.origin}% ${100*l.origin}% 0`,r.animationValues?o.opacity=r===this?null!==(n=null!==(e=s.opacity)&&void 0!==e?e:this.latestValues.opacity)&&void 0!==n?n:1:this.preserveOpacity?this.latestValues.opacity:s.opacityExit:o.opacity=r===this?void 0!==s.opacity?s.opacity:"":void 0!==s.opacityExit?s.opacityExit:0;for(const t in O){if(void 0===s[t])continue;const{correct:e,applyTo:n}=O[t],i="none"===o.transform?s[t]:e(s[t],r);if(n){const t=n.length;for(let e=0;e<t;e++)o[n[e]]=i}else o[t]=i}return this.options.layoutId&&(o.pointerEvents=r===this?jt(t.pointerEvents)||"":"none"),o}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(Gr),this.root.sharedNodes.clear()}}}function Hr(t){t.updateLayout()}function $r(t){var e,n,o;const i=(null===(e=t.resumeFrom)||void 0===e?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&i&&t.hasListeners("didUpdate")){const{layoutBox:e,measuredBox:n}=t.layout,{animationType:o}=t.options,r=i.source!==t.layout.source;"size"===o?fi(t=>{const n=r?i.measuredBox[t]:i.layoutBox[t],o=ei(n);n.min=e[t].min,n.max=n.min+o}):ss(o,i.layoutBox,e)&&fi(t=>{const n=r?i.measuredBox[t]:i.layoutBox[t],o=ei(e[t]);n.max=n.min+o});const s={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};ii(s,e,i.layoutBox);const a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};r?ii(a,t.applyTransform(n,!0),i.measuredBox):ii(a,e,i.layoutBox);const l=!kr(s);let u=!1;if(!t.resumeFrom){const n=t.getClosestProjectingParent();if(n&&!n.resumeFrom){const{snapshot:o,layout:r}=n;if(o&&r){const s={x:{min:0,max:0},y:{min:0,max:0}};ai(s,i.layoutBox,o.layoutBox);const a={x:{min:0,max:0},y:{min:0,max:0}};ai(a,e,r.layoutBox),Br(s,a)||(u=!0),n.options.layoutRoot&&(t.relativeTarget=a,t.relativeTargetOrigin=s,t.relativeParent=n)}}}t.notifyListeners("didUpdate",{layout:e,snapshot:i,delta:a,layoutDelta:s,hasLayoutChanged:l,hasRelativeTargetChanged:u})}else t.isLead()&&(null===(o=(n=t.options).onExitComplete)||void 0===o||o.call(n));t.options.transition=void 0}function Yr(t){t.isProjectionDirty||(t.isProjectionDirty=Boolean(t.parent&&t.parent.isProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=Boolean(t.parent&&t.parent.isTransformDirty))}function Xr(t){t.clearSnapshot()}function Gr(t){t.clearMeasurements()}function qr(t){const{visualElement:e}=t.options;(null==e?void 0:e.getProps().onBeforeLayoutMeasure)&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Zr(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0}function Kr(t){t.resolveTargetDelta()}function _r(t){t.calcProjection()}function Jr(t){t.resetRotation()}function Qr(t){t.removeLeadSnapshot()}function ts(t,e,n){t.translate=Vn(e.translate,0,n),t.scale=Vn(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function es(t,e,n,o){t.min=Vn(e.min,n.min,o),t.max=Vn(e.max,n.max,o)}function ns(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}const os={duration:.45,ease:[.4,0,.1,1]};function is(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 rs(t){t.min=Math.round(t.min),t.max=Math.round(t.max)}function ss(t,e,n){return"position"===t||"preserve-aspect"===t&&!ni(Ir(e),Ir(n),.2)}const as=Wr({attachResizeListener:(t,e)=>$t(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),ls={current:void 0},us=Wr({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!ls.current){const t=new as(0,{});t.mount(window),t.setOptions({layoutScroll:!0}),ls.current=t}return ls.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)}),cs={...Yo,...ge,...Ii,...mr},hs=k((t,e)=>Wt(t,e,cs,ur,us));const ds=k(Wt);function ps(){const t=e.useRef(!1);return h(()=>(t.current=!0,()=>{t.current=!1}),[]),t}function fs(){const t=ps(),[n,o]=e.useState(0),i=e.useCallback(()=>{t.current&&o(n+1)},[n]);return[e.useCallback(()=>Ce.postRender(i),[i]),n]}class ms extends r.Component{getSnapshotBeforeUpdate(t){const e=this.props.childRef.current;if(e&&t.isPresent&&!this.props.isPresent){const t=this.props.sizeRef.current;t.height=e.offsetHeight||0,t.width=e.offsetWidth||0,t.top=e.offsetTop,t.left=e.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function gs({children:t,isPresent:n}){const o=e.useId(),i=e.useRef(null),s=e.useRef({width:0,height:0,top:0,left:0});return e.useInsertionEffect(()=>{const{width:t,height:e,top:r,left:a}=s.current;if(n||!i.current||!t||!e)return;i.current.dataset.motionPopId=o;const l=document.createElement("style");return document.head.appendChild(l),l.sheet&&l.sheet.insertRule(`\n [data-motion-pop-id="${o}"] {\n position: absolute !important;\n width: ${t}px !important;\n height: ${e}px !important;\n top: ${r}px !important;\n left: ${a}px !important;\n }\n `),()=>{document.head.removeChild(l)}},[n]),r.createElement(ms,{isPresent:n,childRef:i,sizeRef:s},r.cloneElement(t,{ref:i}))}const ys=({children:t,initial:n,isPresent:o,onExitComplete:i,custom:s,presenceAffectsLayout:a,mode:l})=>{const c=P(vs),h=e.useId(),d=e.useMemo(()=>({id:h,initial:n,isPresent:o,custom:s,onExitComplete:t=>{c.set(t,!0);for(const t of c.values())if(!t)return;i&&i()},register:t=>(c.set(t,!1),()=>c.delete(t))}),a?void 0:[o]);return e.useMemo(()=>{c.forEach((t,e)=>c.set(e,!1))},[o]),r.useEffect(()=>{!o&&!c.size&&i&&i()},[o]),"popLayout"===l&&(t=r.createElement(gs,{isPresent:o},t)),r.createElement(u.Provider,{value:d},t)};function vs(){return new Map}const xs=t=>t.key||"";const Es=e.createContext(null),ws=t=>!t.isLayoutDirty&&t.willUpdate(!1);function Ts(){const t=new Set,e=new WeakMap,n=()=>t.forEach(ws);return{add:o=>{t.add(o),e.set(o,o.addEventListener("willUpdate",n))},remove:o=>{var i;t.delete(o),null===(i=e.get(o))||void 0===i||i(),e.delete(o),n()},dirty:n}}const bs=t=>!0===t,Ps=({children:t,id:n,inheritId:o,inherit:i=!0})=>{void 0!==o&&(i=o);const s=e.useContext(V),a=e.useContext(Es),[l,u]=fs(),c=e.useRef(null),h=s.id||a;null===c.current&&((t=>bs(!0===t)||"id"===t)(i)&&h&&(n=n?h+"-"+n:h),c.current={id:n,group:bs(i)&&s.group||Ts()});const d=e.useMemo(()=>({...c.current,forceRender:l}),[u]);return r.createElement(V.Provider,{value:d},t)};let As=0;function Ss(t){return"function"==typeof t}const Vs=e.createContext(null);const Cs=e.forwardRef((function({children:t,as:n="ul",axis:o="y",onReorder:i,values:s,...a},l){const u=P(()=>hs(n)),c=[],h=e.useRef(!1),d={axis:o,registerItem:(t,e)=>{e&&-1===c.findIndex(e=>t===e.value)&&(c.push({value:t,layout:e[o]}),c.sort(Rs))},updateOrder:(t,e,n)=>{if(h.current)return;const o=function(t,e,n,o){if(!o)return t;const i=t.findIndex(t=>t.value===e);if(-1===i)return t;const r=o>0?1:-1,s=t[i+r];if(!s)return t;const a=t[i],l=s.layout,u=Vn(l.min,l.max,.5);return 1===r&&a.layout.max+n>u||-1===r&&a.layout.min+n<u?function([...t],e,n){const o=e<0?t.length+e:e;if(o>=0&&o<t.length){const o=n<0?t.length+n:n,[i]=t.splice(e,1);t.splice(o,0,i)}return t}(t,i,i+r):t}(c,t,e,n);c!==o&&(h.current=!0,i(o.map(Ms).filter(t=>-1!==s.indexOf(t))))}};return e.useEffect(()=>{h.current=!1}),r.createElement(u,{...a,ref:l},r.createElement(Vs.Provider,{value:d},t))}));function Ms(t){return t.value}function Rs(t,e){return t.layout.min-e.layout.min}function Ls(t){const n=P(()=>Ue(t)),{isStatic:o}=e.useContext(s);if(o){const[,o]=e.useState(t);e.useEffect(()=>n.on("change",o),[])}return n}function Ds(...t){const e=!Array.isArray(t[0]),n=e?0:-1,o=t[0+n],i=t[1+n],r=t[2+n],s=t[3+n],a=Nn(i,r,{mixer:(l=r[0],(t=>"object"==typeof t&&t.mix)(l)?l.mix:void 0),...s});var l;return e?a(o):a}function ks(t,e){const n=Ls(e()),o=()=>n.set(e());return o(),h(()=>{const e=()=>Ce.update(o,!1,!0),n=t.map(t=>t.on("change",e));return()=>{n.forEach(t=>t()),Me.update(o)}}),n}function Bs(t,e,n,o){const i="function"==typeof e?e:Ds(e,n,o);return Array.isArray(t)?Is(t,i):Is([t],([t])=>i(t))}function Is(t,e){const n=P(()=>[]);return ks(t,()=>{n.length=0;const o=t.length;for(let e=0;e<o;e++)n[e]=t[e].get();return e(n)})}function Os(t,e=0){return z(t)?t:Ls(e)}const js={Group:Cs,Item:e.forwardRef((function({children:t,style:n={},value:o,as:i="li",onDrag:s,layout:a=!0,...l},u){const c=P(()=>hs(i)),h=e.useContext(Vs),d={x:Os(n.x),y:Os(n.y)},p=Bs([d.x,d.y],([t,e])=>t||e?1:"unset"),f=e.useRef(null),{axis:m,registerItem:g,updateOrder:y}=h;return e.useEffect(()=>{g(o,f.current)},[h]),r.createElement(c,{drag:m,...l,dragSnapToOrigin:!0,style:{...n,x:d.x,y:d.y,zIndex:p},layout:a,onDrag:(t,e)=>{const{velocity:n}=e;n[m]&&y(o,d[m].get(),n[m]),s&&s(t,e)},onLayoutMeasure:t=>{f.current=t},ref:u},t)}))},Fs={renderer:ur,...Yo,...ge},Us={...Fs,...Ii,...mr,projectionNodeConstructor:us};const Ns=t=>"number"==typeof t;function zs(t,e){return(t=>Array.isArray(t)&&!Ns(t[0]))(t)?t[((t,e,n)=>{const o=e-t;return((n-t)%o+o)%o+t})(0,t.length,e)]:t}const Ws=(t,e,n)=>-n*t+n*e+t,Hs=t=>t,$s=(t,e,n)=>e-t==0?1:(n-t)/(e-t);function Ys(t,e){const n=t[t.length-1];for(let o=1;o<=e;o++){const i=$s(0,e,o);t.push(Ws(n,1,i))}}function Xs(t){const e=[0];return Ys(e,t-1),e}function Gs(t,e=Xs(t.length),n=Hs){const o=t.length,i=o-e.length;return i>0&&Ys(e,i),i=>{let r=0;for(;r<o-2&&!(i<e[r+1]);r++);let s=(a=0,l=1,u=$s(e[r],e[r+1],i),Math.min(Math.max(u,a),l));var a,l,u;return s=zs(n,r)(s),Ws(t[r],t[r+1],s)}}const qs=t=>"function"==typeof t,Zs=t=>"string"==typeof t;function Ks(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 _s={any:0,all:1};const Js=new WeakMap;let Qs;function ta({target:t,contentRect:e,borderBoxSize:n}){var o;null===(o=Js.get(t))||void 0===o||o.forEach(o=>{o({target:t,contentSize:e,get size(){return function(t,e){if(e){const{inlineSize:t,blockSize:n}=e[0];return{width:t,height:n}}return t instanceof SVGElement&&"getBBox"in t?t.getBBox():{width:t.offsetWidth,height:t.offsetHeight}}(t,n)}})})}function ea(t){t.forEach(ta)}function na(t,e){Qs||"undefined"!=typeof ResizeObserver&&(Qs=new ResizeObserver(ea));const n=Ks(t);return n.forEach(t=>{let n=Js.get(t);n||(n=new Set,Js.set(t,n)),n.add(e),null==Qs||Qs.observe(t)}),()=>{n.forEach(t=>{const n=Js.get(t);null==n||n.delete(e),(null==n?void 0:n.size)||null==Qs||Qs.unobserve(t)})}}const oa=new Set;let ia;function ra(t){return oa.add(t),ia||(ia=()=>{const t={width:window.innerWidth,height:window.innerHeight},e={target:window,size:t,contentSize:t};oa.forEach(t=>t(e))},window.addEventListener("resize",ia)),()=>{oa.delete(t),!oa.size&&ia&&(ia=void 0)}}const sa={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}};function aa(t,e,n,o){const i=n[e],{length:r,position:s}=sa[e],a=i.current,l=n.time;i.current=t["scroll"+s],i.scrollLength=t["scroll"+r]-t["client"+r],i.offset.length=0,i.offset[0]=0,i.offset[1]=i.scrollLength,i.progress=$s(0,i.scrollLength,i.current);const u=o-l;var c,h;i.velocity=u>50?0:(c=i.current-a,(h=u)?c*(1e3/h):0)}const la={Enter:[[0,1],[1,1]],Exit:[[0,0],[1,0]],Any:[[1,0],[0,1]],All:[[0,0],[1,1]]},ua={start:0,center:.5,end:1};function ca(t,e,n=0){let o=0;if(void 0!==ua[t]&&(t=ua[t]),Zs(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 Ns(t)&&(o=e*t),n+o}const ha=[0,0];function da(t,e,n,o){let i=Array.isArray(t)?t:ha,r=0,s=0;return Ns(t)?i=[t,t]:Zs(t)&&(i=(t=t.trim()).includes(" ")?t.split(" "):[t,ua[t]?t:"0"]),r=ca(i[0],n,o),s=ca(i[1],e),r-s}const pa={x:0,y:0};function fa(t,e,n){let{offset:o=la.All}=n;const{target:i=t,axis:r="y"}=n,s="y"===r?"height":"width",a=i!==t?function(t,e){let n={x:0,y:0},o=t;for(;o&&o!==e;)if(o instanceof HTMLElement)n.x+=o.offsetLeft,n.y+=o.offsetTop,o=o.offsetParent;else if(o instanceof SVGGraphicsElement&&"getBBox"in o){const{top:t,left:e}=o.getBBox();for(n.x+=e,n.y+=t;o&&"svg"!==o.tagName;)o=o.parentNode}return n}(i,t):pa,l=i===t?{width:t.scrollWidth,height:t.scrollHeight}:{width:i.clientWidth,height:i.clientHeight},u={width:t.clientWidth,height:t.clientHeight};e[r].offset.length=0;let c=!e[r].interpolate;const h=o.length;for(let t=0;t<h;t++){const n=da(o[t],u[s],l[s],a[r]);c||n===e[r].interpolatorOffsets[t]||(c=!0),e[r].offset[t]=n}c&&(e[r].interpolate=Gs(Xs(h),e[r].offset),e[r].interpolatorOffsets=[...e[r].offset]),e[r].progress=e[r].interpolate(e[r].current)}function ma(t,e,n,o={}){const i=o.axis||"y";return{measure:()=>function(t,e=t,n){if(n.x.targetOffset=0,n.y.targetOffset=0,e!==t){let o=e;for(;o&&o!=t;)n.x.targetOffset+=o.offsetLeft,n.y.targetOffset+=o.offsetTop,o=o.offsetParent}n.x.targetLength=e===t?e.scrollWidth:e.clientWidth,n.y.targetLength=e===t?e.scrollHeight:e.clientHeight,n.x.containerLength=t.clientWidth,n.y.containerLength=t.clientHeight}(t,o.target,n),update:e=>{!function(t,e,n){aa(t,"x",e,n),aa(t,"y",e,n),e.time=n}(t,n,e),(o.offset||o.target)&&fa(t,n,o)},notify:qs(e)?()=>e(n):ga(e,n[i])}}function ga(t,e){return t.pause(),t.forEachNative((t,{easing:e})=>{var n,o;if(t.updateDuration)e||(t.easing=Hs),t.updateDuration(1);else{const i={duration:1e3};e||(i.easing="linear"),null===(o=null===(n=t.effect)||void 0===n?void 0:n.updateTiming)||void 0===o||o.call(n,i)}}),()=>{t.currentTime=e.progress}}const ya=new WeakMap,va=new WeakMap,xa=new WeakMap,Ea=t=>t===document.documentElement?window:t;function wa(t,e={}){var{container:n=document.documentElement}=e,o=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(t);i<o.length;i++)e.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(t,o[i])&&(n[o[i]]=t[o[i]])}return n}(e,["container"]);let i=xa.get(n);i||(i=new Set,xa.set(n,i));const r=ma(n,t,{time:0,x:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0},y:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0}},o);if(i.add(r),!ya.has(n)){const t=()=>{const t=performance.now();for(const t of i)t.measure();for(const e of i)e.update(t);for(const t of i)t.notify()};ya.set(n,t);const e=Ea(n);window.addEventListener("resize",t,{passive:!0}),n!==document.documentElement&&va.set(n,(a=t,qs(s=n)?ra(s):na(s,a))),e.addEventListener("scroll",t,{passive:!0})}var s,a;const l=ya.get(n),u=requestAnimationFrame(l);return()=>{var e;"function"!=typeof t&&t.stop(),cancelAnimationFrame(u);const o=xa.get(n);if(!o)return;if(o.delete(r),o.size)return;const i=ya.get(n);ya.delete(n),i&&(Ea(n).removeEventListener("scroll",i),null===(e=va.get(n))||void 0===e||e(),window.removeEventListener("resize",i))}}function Ta(t,e){Boolean(!e||e.current)}const ba=()=>({scrollX:Ue(0),scrollY:Ue(0),scrollXProgress:Ue(0),scrollYProgress:Ue(0)});function Pa({container:t,target:n,layoutEffect:o=!0,...i}={}){const r=P(ba);return(o?h:e.useEffect)(()=>(Ta(0,n),Ta(0,t),wa(({x:t,y:e})=>{r.scrollX.set(t.current),r.scrollXProgress.set(t.progress),r.scrollY.set(e.current),r.scrollYProgress.set(e.progress)},{...i,container:(null==t?void 0:t.current)||void 0,target:(null==n?void 0:n.current)||void 0})),[]),r}function Aa(t){const n=e.useRef(0),{isStatic:o}=e.useContext(s);e.useEffect(()=>{if(o)return;const e=({timestamp:e,delta:o})=>{n.current||(n.current=e),t(e-n.current,o)};return Ce.update(e,!0),()=>Me.update(e)},[t])}class Sa extends Fe{constructor(){super(...arguments),this.members=[],this.transforms=new Set}add(t){let e;U.has(t)?(this.transforms.add(t),e="transform"):t.startsWith("origin")||Y(t)||"willChange"===t||(e=Mt(t)),e&&(Be(this.members,e),this.update())}remove(t){U.has(t)?(this.transforms.delete(t),this.transforms.size||Ie(this.members,"transform")):Ie(this.members,Mt(t)),this.update()}update(){this.set(this.members.length?this.members.join(", "):"auto")}}function Va(){!Ji.current&&Qi();const[t]=e.useState(_i.current);return t}function Ca(){const t=new Set,e={subscribe:e=>(t.add(e),()=>{t.delete(e)}),start(e,n){const o=[];return t.forEach(t=>{o.push(Bo(t,e,{transitionOverride:n}))}),Promise.all(o)},set:e=>t.forEach(t=>{!function(t,e){Array.isArray(e)?fn(t,e):"string"==typeof e?fn(t,[e]):pn(t,e)}(t,e)}),stop(){t.forEach(t=>{!function(t){t.values.forEach(t=>t.stop())}(t)})},mount:()=>()=>{e.stop()}};return e}function Ma(){const t=P(Ca);return h(t.mount,[]),t}const Ra=Ma,La=(t,e,n)=>{const o=e-t;return((n-t)%o+o)%o+t};class Da{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 ka=()=>new Da;function Ba(t){return null!==t&&"object"==typeof t&&R in t}function Ia(){return Oa}function Oa(t){ls.current&&(ls.current.isUpdating=!1,ls.current.blockUpdate(),t&&t())}const ja=(t,e)=>`${t}: ${e}`,Fa=new Map;function Ua(t,e,n,o){const i=ja(t,U.has(e)?"transform":e),{animation:r,ready:s}=Fa.get(i)||{};if(!r)return 0;const a=()=>{Fa.delete(i);try{r.cancel()}catch(t){}};if(s){const t=performance.now();return o.update(()=>{n.animation&&(n.animation.currentTime=performance.now()-t)}),o.render(a),r.currentTime||0}return a(),0}const Na=()=>({});class za extends or{build(){}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}resetTransform(){}restoreTransform(){}removeValueFromRenderState(){}renderInstance(){}scrapeMotionValuesFromProps(){return{}}getBaseTargetFromProps(){}readValueFromInstance(t,e,n){return n.initialState[e]||0}sortInstanceNodePosition(){return 0}makeTargetAnimatableFromInstance({transition:t,transitionEnd:e,...n}){return mn(this,n,yn(n,t||{},this)),{transition:t,transitionEnd:e,...n}}}const Wa=Ft({scrapeMotionValuesFromProps:Na,createRenderState:Na});const Ha=t=>t>.001?1/t:1e5;t.AnimatePresence=({children:t,custom:n,initial:o=!0,onExitComplete:i,exitBeforeEnter:s,presenceAffectsLayout:a=!0,mode:l="sync"})=>{s&&(l="wait");let[u]=fs();const c=e.useContext(V).forceRender;c&&(u=c);const d=ps(),p=function(t){const n=[];return e.Children.forEach(t,t=>{e.isValidElement(t)&&n.push(t)}),n}(t);let f=p;const m=new Set,g=e.useRef(f),y=e.useRef(new Map).current,v=e.useRef(!0);if(h(()=>{v.current=!1,function(t,e){t.forEach(t=>{const n=xs(t);e.set(n,t)})}(p,y),g.current=f}),ie(()=>{v.current=!0,y.clear(),m.clear()}),v.current)return r.createElement(r.Fragment,null,f.map(t=>r.createElement(ys,{key:xs(t),isPresent:!0,initial:!!o&&void 0,presenceAffectsLayout:a,mode:l},t)));f=[...f];const x=g.current.map(xs),E=p.map(xs),w=x.length;for(let t=0;t<w;t++){const e=x[t];-1===E.indexOf(e)&&m.add(e)}return"wait"===l&&m.size&&(f=[]),m.forEach(t=>{if(-1!==E.indexOf(t))return;const e=y.get(t);if(!e)return;const o=x.indexOf(t);f.splice(o,0,r.createElement(ys,{key:xs(e),isPresent:!1,onExitComplete:()=>{y.delete(t),m.delete(t);const e=g.current.findIndex(e=>e.key===t);if(g.current.splice(e,1),!m.size){if(g.current=p,!1===d.current)return;u(),i&&i()}},custom:n,presenceAffectsLayout:a,mode:l},e))}),f=f.map(t=>{const e=t.key;return m.has(e)?t:r.createElement(ys,{key:xs(t),isPresent:!0,presenceAffectsLayout:a,mode:l},t)}),r.createElement(r.Fragment,null,m.size?f:f.map(t=>e.cloneElement(t)))},t.AnimateSharedLayout=({children:t})=>(r.useEffect(()=>{},[]),r.createElement(Ps,{id:P(()=>"asl-"+As++)},t)),t.DeprecatedLayoutGroupContext=Es,t.DragControls=Da,t.FlatTree=Ur,t.LayoutGroup=Ps,t.LayoutGroupContext=V,t.LazyMotion=function({children:t,features:n,strict:o=!1}){const[,i]=e.useState(!Ss(n)),s=e.useRef(void 0);if(!Ss(n)){const{renderer:t,...e}=n;s.current=t,b(e)}return e.useEffect(()=>{Ss(n)&&n().then(({renderer:t,...e})=>{b(e),s.current=t,i(!0)})},[]),r.createElement(d.Provider,{value:{renderer:s.current,strict:o}},t)},t.MotionConfig=function({children:t,isValidProp:n,...o}){n&&xt(n),(o={...e.useContext(s),...o}).isStatic=P(()=>o.isStatic);const i=e.useMemo(()=>o,[JSON.stringify(o.transition),o.transformPagePoint,o.reducedMotion]);return r.createElement(s.Provider,{value:i},t)},t.MotionConfigContext=s,t.MotionContext=a,t.MotionValue=Fe,t.PresenceContext=u,t.Reorder=js,t.SwitchLayoutGroupContext=M,t.VisualElement=or,t.addPointerEvent=Zt,t.addPointerInfo=qt,t.addScaleCorrector=j,t.animate=gr,t.animateVisualElement=Bo,t.animationControls=Ca,t.animations=Yo,t.anticipate=Kn,t.backIn=qn,t.backInOut=Zn,t.backOut=Gn,t.buildTransform=$,t.calcLength=ei,t.checkTargetForNewValues=mn,t.circIn=$n,t.circInOut=Xn,t.circOut=Yn,t.clamp=G,t.createBox=pi,t.createDomMotionComponent=function(t){return L(Wt(t,{forwardMotionProps:!1},cs,ur,us))},t.createMotionComponent=L,t.cubicBezier=Hn,t.delay=wo,t.distance=Xo,t.distance2D=Go,t.domAnimation=Fs,t.domMax=Us,t.easeIn=Pn,t.easeInOut=Sn,t.easeOut=An,t.filterProps=Et,t.frameData=Ee,t.isBrowser=c,t.isDragActive=ee,t.isMotionComponent=Ba,t.isMotionValue=z,t.isValidMotionProp=yt,t.m=ds,t.makeUseVisualState=Ft,t.mix=Vn,t.motion=hs,t.motionValue=Ue,t.optimizedAppearDataAttribute=xn,t.pipe=se,t.resolveMotionValue=jt,t.spring=ro,t.startOptimizedAppearAnimation=function(t,e,n,o,i){const r=t.dataset.framerAppearId;if(!r)return;window.HandoffAppearAnimations=Ua;const s=ja(r,e),a=mo(t,e,[n[0],n[0]],{duration:1e4,ease:"linear"});Fa.set(s,{animation:a,ready:!1});const l=()=>{a.cancel();const r=mo(t,e,n,o);document.timeline&&(r.startTime=document.timeline.currentTime),Fa.set(s,{animation:r,ready:!0}),i&&i(r)};a.ready?a.ready.then(l):l()},t.sync=Ce,t.transform=Ds,t.unwrapMotionComponent=function(t){if(Ba(t))return t[R]},t.useAnimation=Ra,t.useAnimationControls=Ma,t.useAnimationFrame=Aa,t.useCycle=function(...t){const n=e.useRef(0),[o,i]=e.useState(t[n.current]);return[o,e.useCallback(e=>{n.current="number"!=typeof e?La(0,t.length,n.current+1):e,i(t[n.current])},[t.length,...t])]},t.useDeprecatedAnimatedState=function(t){const[n,o]=e.useState(t),i=Wa({},!1),r=P(()=>new za({props:{},visualState:i},{initialState:t}));return e.useEffect(()=>(r.mount({}),()=>r.unmount()),[r]),e.useEffect(()=>{r.setProps({onUpdate:t=>{o({...t})}})},[o,r]),[n,P(()=>t=>Bo(r,t))]},t.useDeprecatedInvertedScale=function(t){let e=Ls(1),n=Ls(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:Bs(e,Ha),scaleY:Bs(n,Ha)}},t.useDomEvent=Yt,t.useDragControls=function(){return P(ka)},t.useElementScroll=function(t){return Pa({container:t})},t.useForceUpdate=fs,t.useInView=function(t,{root:n,margin:o,amount:i,once:r=!1}={}){const[s,a]=e.useState(!1);return e.useEffect(()=>{if(!t.current||r&&s)return;const e={root:n&&n.current||void 0,margin:o,amount:"some"===i?"any":i};return function(t,e,{root:n,margin:o,amount:i="any"}={}){if("undefined"==typeof IntersectionObserver)return()=>{};const r=Ks(t),s=new WeakMap,a=new IntersectionObserver(t=>{t.forEach(t=>{const n=s.get(t.target);if(t.isIntersecting!==Boolean(n))if(t.isIntersecting){const n=e(t);qs(n)?s.set(t.target,n):a.unobserve(t.target)}else n&&(n(t),s.delete(t.target))})},{root:n,rootMargin:o,threshold:"number"==typeof i?i:_s[i]});return r.forEach(t=>a.observe(t)),()=>a.disconnect()}(t.current,()=>(a(!0),r?void 0:()=>a(!1)),e)},[n,t,o,r]),s},t.useInstantLayoutTransition=Ia,t.useInstantTransition=function(){const[t,n]=fs(),o=Ia();return e.useEffect(()=>{Ce.postRender(()=>Ce.postRender(()=>wn.current=!1))},[n]),e=>{o(()=>{wn.current=!0,t(),e()})}},t.useIsPresent=function(){return null===(t=e.useContext(u))||t.isPresent;var t},t.useIsomorphicLayoutEffect=h,t.useMotionTemplate=function(t,...e){const n=t.length;return ks(e.filter(z),(function(){let o="";for(let i=0;i<n;i++){o+=t[i];const n=e[i];n&&(o+=z(n)?n.get():n)}return o}))},t.useMotionValue=Ls,t.useMotionValueEvent=function(t,n,o){e.useInsertionEffect(()=>t.on(n,o),[t,n,o])},t.usePresence=ye,t.useReducedMotion=Va,t.useReducedMotionConfig=function(){const t=Va(),{reducedMotion:n}=e.useContext(s);return"never"!==n&&("always"===n||t)},t.useResetProjection=function(){return r.useCallback(()=>{const t=ls.current;t&&t.resetTree()},[])},t.useScroll=Pa,t.useSpring=function(t,n={}){const{isStatic:o}=e.useContext(s),i=e.useRef(null),r=Ls(z(t)?t.get():t),a=()=>{i.current&&i.current.stop()};return e.useInsertionEffect(()=>r.attach((t,e)=>o?e(t):(a(),i.current=co({keyframes:[r.get(),t],velocity:r.getVelocity(),type:"spring",...n,onUpdate:e}),r.get()),a),[JSON.stringify(n)]),h(()=>{if(z(t))return t.on("change",t=>r.set(parseFloat(t)))},[r]),r},t.useTime=function(){const t=Ls(0);return Aa(e=>t.set(e)),t},t.useTransform=Bs,t.useUnmountEffect=ie,t.useVelocity=function(t){const n=Ls(t.getVelocity());return e.useEffect(()=>t.on("velocityChange",t=>{n.set(t)}),[t]),n},t.useViewportScroll=function(){return Pa()},t.useVisualElementContext=l,t.useWillChange=function(){return P(()=>new Sa("auto"))},t.wrap=La,Object.defineProperty(t,"__esModule",{value:!0})}));
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Motion={},t.React)}(this,(function(t,e){"use strict";function n(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}function o(t){if(t&&t.__esModule)return t;var e=Object.create(null);return t&&Object.keys(t).forEach((function(n){if("default"!==n){var o=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,o.get?o:{enumerable:!0,get:function(){return t[n]}})}})),e.default=t,Object.freeze(e)}var i=n(e),r=o(e);const s=e.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),a=e.createContext({});function l(){return e.useContext(a).visualElement}const u=e.createContext(null),c="undefined"!=typeof document,h=c?e.useLayoutEffect:e.useEffect,d=e.createContext({strict:!1});function p(t){return"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}function f(t){return"string"==typeof t||Array.isArray(t)}function m(t){return"object"==typeof t&&"function"==typeof t.start}const g=["initial","animate","exit","whileHover","whileDrag","whileTap","whileFocus","whileInView"];function y(t){return m(t.animate)||g.some(e=>f(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||f(e)?e:void 0,animate:f(n)?n:void 0}}return!1!==t.inherit?e:{}}(t,e.useContext(a));return e.useMemo(()=>({initial:n,animate:o}),[E(n),E(o)])}function E(t){return Array.isArray(t)?t.join(" "):t}const w=t=>({isEnabled:e=>t.some(t=>!!e[t])}),T={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 b(t){for(const e in t)"projectionNodeConstructor"===e?T.projectionNodeConstructor=t[e]:T[e].Component=t[e]}function P(t){const n=e.useRef(null);return null===n.current&&(n.current=t()),n.current}const A={hasAnimatedSinceResize:!0,hasEverUpdated:!1};let S=1;const V=e.createContext({});class C extends i.default.Component{getSnapshotBeforeUpdate(){const{visualElement:t,props:e}=this.props;return t&&t.setProps(e),null}componentDidUpdate(){}render(){return this.props.children}}const M=e.createContext({}),R=Symbol.for("motionComponentSymbol");function L({preloadedFeatures:t,createVisualElement:n,projectionNodeConstructor:o,useRender:i,useVisualState:f,Component:m}){t&&b(t);const g=e.forwardRef((function(g,y){const v={...e.useContext(s),...g,layoutId:D(g)},{isStatic:E}=v;let w=null;const b=x(g),V=E?void 0:P(()=>{if(A.hasEverUpdated)return S++}),R=f(g,E);if(!E&&c){b.visualElement=function(t,n,o,i){const r=l(),a=e.useContext(d),c=e.useContext(u),p=e.useContext(s).reducedMotion,f=e.useRef();i=i||a.renderer,!f.current&&i&&(f.current=i(t,{visualState:n,parent:r,props:o,presenceId:c?c.id:void 0,blockInitialAnimation:!!c&&!1===c.initial,reducedMotionConfig:p}));const m=f.current;return h(()=>{m&&m.render()}),(window.HandoffAppearAnimations?h:e.useEffect)(()=>{m&&m.animationState&&m.animationState.animateChanges()}),m}(m,R,v,n);const i=e.useContext(d).strict,r=e.useContext(M);b.visualElement&&(w=b.visualElement.loadFeatures(v,i,t,V,o||T.projectionNodeConstructor,r))}return r.createElement(C,{visualElement:b.visualElement,props:v},w,r.createElement(a.Provider,{value:b},i(m,g,V,function(t,n,o){return e.useCallback(e=>{e&&t.mount&&t.mount(e),n&&(e?n.mount(e):n.unmount()),o&&("function"==typeof o?o(e):p(o)&&(o.current=e))},[n])}(R,b.visualElement,y),R,E,b.visualElement)))}));return g[R]=m,g}function D({layoutId:t}){const n=e.useContext(V).id;return n&&void 0!==t?n+"-"+t:t}function k(t){function e(e,n={}){return L(t(e,n))}if("undefined"==typeof Proxy)return e;const n=new Map;return new Proxy(e,{get:(t,o)=>(n.has(o)||n.set(o,e(o)),n.get(o))})}const B=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function I(t){return"string"==typeof t&&!t.includes("-")&&!!(B.indexOf(t)>-1||/[A-Z]/.test(t))}const O={};function j(t){Object.assign(O,t)}const F=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],U=new Set(F);function N(t,{layout:e,layoutId:n}){return U.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!O[t]||"opacity"===t)}const z=t=>!!(null==t?void 0:t.getVelocity),W={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},H=(t,e)=>F.indexOf(t)-F.indexOf(e);function $({transform:t,transformKeys:e},{enableHardwareAcceleration:n=!0,allowTransformNone:o=!0},i,r){let s="";e.sort(H);for(const n of e)s+=`${W[n]||n}(${t[n]}) `;return n&&!t.z&&(s+="translateZ(0)"),s=s.trim(),r?s=r(t,i?"":s):o&&i&&(s="none"),s}function Y(t){return t.startsWith("--")}const X=(t,e)=>e&&"number"==typeof t?e.transform(t):t,G=(t,e,n)=>Math.min(Math.max(n,t),e),q={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},Z={...q,transform:t=>G(0,1,t)},K={...q,default:1},_=t=>Math.round(1e5*t)/1e5,J=/(-)?([\d]*\.?[\d])+/g,Q=/(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,tt=/^(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function et(t){return"string"==typeof t}const nt=t=>({test:e=>et(e)&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),ot=nt("deg"),it=nt("%"),rt=nt("px"),st=nt("vh"),at=nt("vw"),lt={...it,parse:t=>it.parse(t)/100,transform:t=>it.transform(100*t)},ut={...q,transform:Math.round},ct={borderWidth:rt,borderTopWidth:rt,borderRightWidth:rt,borderBottomWidth:rt,borderLeftWidth:rt,borderRadius:rt,radius:rt,borderTopLeftRadius:rt,borderTopRightRadius:rt,borderBottomRightRadius:rt,borderBottomLeftRadius:rt,width:rt,maxWidth:rt,height:rt,maxHeight:rt,size:rt,top:rt,right:rt,bottom:rt,left:rt,padding:rt,paddingTop:rt,paddingRight:rt,paddingBottom:rt,paddingLeft:rt,margin:rt,marginTop:rt,marginRight:rt,marginBottom:rt,marginLeft:rt,rotate:ot,rotateX:ot,rotateY:ot,rotateZ:ot,scale:K,scaleX:K,scaleY:K,scaleZ:K,skew:ot,skewX:ot,skewY:ot,distance:rt,translateX:rt,translateY:rt,translateZ:rt,x:rt,y:rt,z:rt,perspective:rt,transformPerspective:rt,opacity:Z,originX:lt,originY:lt,originZ:rt,zIndex:ut,fillOpacity:Z,strokeOpacity:Z,numOctaves:ut};function ht(t,e,n,o){const{style:i,vars:r,transform:s,transformKeys:a,transformOrigin:l}=t;a.length=0;let u=!1,c=!1,h=!0;for(const t in e){const n=e[t];if(Y(t)){r[t]=n;continue}const o=ct[t],d=X(n,o);if(U.has(t)){if(u=!0,s[t]=d,a.push(t),!h)continue;n!==(o.default||0)&&(h=!1)}else t.startsWith("origin")?(c=!0,l[t]=d):i[t]=d}if(e.transform||(u||o?i.transform=$(t,n,h,o):i.transform&&(i.transform="none")),c){const{originX:t="50%",originY:e="50%",originZ:n=0}=l;i.transformOrigin=`${t} ${e} ${n}`}}const dt=()=>({style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}});function pt(t,e,n){for(const o in e)z(e[o])||N(o,n)||(t[o]=e[o])}function ft(t,n,o){const i={};return pt(i,t.style||{},t),Object.assign(i,function({transformTemplate:t},n,o){return e.useMemo(()=>{const e={style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}};return ht(e,n,{enableHardwareAcceleration:!o},t),Object.assign({},e.vars,e.style)},[n])}(t,n,o)),t.transformValues?t.transformValues(i):i}function mt(t,e,n){const o={},i=ft(t,e,n);return t.drag&&!1!==t.dragListener&&(o.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=!0===t.drag?"none":"pan-"+("x"===t.drag?"y":"x")),o.style=i,o}const gt=new Set(["initial","style","values","variants","transition","transformTemplate","transformValues","custom","inherit","layout","layoutId","layoutDependency","layoutScroll","layoutRoot","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","whileInView","onViewportEnter","onViewportLeave","viewport","whileTap","onTap","onTapStart","onTapCancel","animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView","onPan","onPanStart","onPanSessionStart","onPanEnd"]);function yt(t){return gt.has(t)}let vt=t=>!yt(t);function xt(t){t&&(vt=e=>e.startsWith("on")?!yt(e):t(e))}try{xt(require("@emotion/is-prop-valid").default)}catch(t){}function Et(t,e,n){const o={};for(const i in t)"values"===i&&"object"==typeof t.values||(vt(i)||!0===n&&yt(i)||!e&&!yt(i)||t.draggable&&i.startsWith("onDrag"))&&(o[i]=t[i]);return o}function wt(t,e,n){return"string"==typeof t?t:rt.transform(e+n*t)}const Tt={offset:"stroke-dashoffset",array:"stroke-dasharray"},bt={offset:"strokeDashoffset",array:"strokeDasharray"};function Pt(t,{attrX:e,attrY:n,originX:o,originY:i,pathLength:r,pathSpacing:s=1,pathOffset:a=0,...l},u,c,h){if(ht(t,l,u,h),c)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:d,style:p,dimensions:f}=t;d.transform&&(f&&(p.transform=d.transform),delete d.transform),f&&(void 0!==o||void 0!==i||p.transform)&&(p.transformOrigin=function(t,e,n){return`${wt(e,t.x,t.width)} ${wt(n,t.y,t.height)}`}(f,void 0!==o?o:.5,void 0!==i?i:.5)),void 0!==e&&(d.x=e),void 0!==n&&(d.y=n),void 0!==r&&function(t,e,n=1,o=0,i=!0){t.pathLength=1;const r=i?Tt:bt;t[r.offset]=rt.transform(-o);const s=rt.transform(e),a=rt.transform(n);t[r.array]=`${s} ${a}`}(d,r,s,a,!1)}const At=()=>({style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{},attrs:{}}),St=t=>"string"==typeof t&&"svg"===t.toLowerCase();function Vt(t,n,o,i){const r=e.useMemo(()=>{const e={style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{},attrs:{}};return Pt(e,n,{enableHardwareAcceleration:!1},St(i),t.transformTemplate),{...e.attrs,style:{...e.style}}},[n]);if(t.style){const e={};pt(e,t.style,t),r.style={...e,...r.style}}return r}function Ct(t=!1){return(n,o,i,r,{latestValues:s},a)=>{const l=(I(n)?Vt:mt)(o,s,a,n),u={...Et(o,"string"==typeof n,t),...l,ref:r},{children:c}=o,h=e.useMemo(()=>z(c)?c.get():c,[c]);return i&&(u["data-projection-id"]=i),e.createElement(n,{...u,children:h})}}const Mt=t=>t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();function Rt(t,{style:e,vars:n},o,i){Object.assign(t.style,e,i&&i.getProjectionStyles(o));for(const e in n)t.style.setProperty(e,n[e])}const Lt=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function Dt(t,e,n,o){Rt(t,e,void 0,o);for(const n in e.attrs)t.setAttribute(Lt.has(n)?n:Mt(n),e.attrs[n])}function kt(t,e){const{style:n}=t,o={};for(const i in n)(z(n[i])||e.style&&z(e.style[i])||N(i,t))&&(o[i]=n[i]);return o}function Bt(t,e){const n=kt(t,e);for(const o in t)if(z(t[o])||z(e[o])){n["x"===o||"y"===o?"attr"+o.toUpperCase():o]=t[o]}return n}function It(t,e,n,o={},i={}){return"function"==typeof e&&(e=e(void 0!==n?n:t.custom,o,i)),"string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e&&(e=e(void 0!==n?n:t.custom,o,i)),e}const Ot=t=>Array.isArray(t);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 Ft=t=>(n,o)=>{const i=e.useContext(a),r=e.useContext(u),s=()=>function({scrapeMotionValuesFromProps:t,createRenderState:e,onMount:n},o,i,r){const s={latestValues:Ut(o,i,r,t),renderState:e()};return n&&(s.mount=t=>n(o,t,s)),s}(t,n,i,r);return o?s():P(s)};function Ut(t,e,n,o){const i={},r=o(t,{});for(const t in r)i[t]=jt(r[t]);let{initial:s,animate:a}=t;const l=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 h=c?a:s;if(h&&"boolean"!=typeof h&&!m(h)){(Array.isArray(h)?h:[h]).forEach(e=>{const n=It(t,e);if(!n)return;const{transitionEnd:o,transition:r,...s}=n;for(const t in s){let e=s[t];if(Array.isArray(e)){e=e[c?e.length-1:0]}null!==e&&(i[t]=e)}for(const t in o)i[t]=o[t]})}return i}const Nt={useVisualState:Ft({scrapeMotionValuesFromProps:Bt,createRenderState:At,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}}Pt(n,o,{enableHardwareAcceleration:!1},St(e.tagName),t.transformTemplate),Dt(e,n)}})},zt={useVisualState:Ft({scrapeMotionValuesFromProps:kt,createRenderState:dt})};function Wt(t,{forwardMotionProps:e=!1},n,o,i){return{...I(t)?Nt:zt,preloadedFeatures:n,useRender:Ct(e),createVisualElement:o,projectionNodeConstructor:i,Component:t}}var Ht;function $t(t,e,n,o={passive:!0}){return t.addEventListener(e,n,o),()=>t.removeEventListener(e,n)}function Yt(t,n,o,i){e.useEffect(()=>{const e=t.current;if(o&&e)return $t(e,n,o,i)},[t,n,o,i])}t.AnimationType=void 0,(Ht=t.AnimationType||(t.AnimationType={})).Animate="animate",Ht.Hover="whileHover",Ht.Tap="whileTap",Ht.Drag="whileDrag",Ht.Focus="whileFocus",Ht.InView="whileInView",Ht.Exit="exit";const Xt=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary;function Gt(t,e="page"){return{point:{x:t[e+"X"],y:t[e+"Y"]}}}const qt=t=>e=>Xt(e)&&t(e,Gt(e));function Zt(t,e,n,o){return $t(t,e,qt(n),o)}function Kt(t,e,n,o){return Yt(t,e,n&&qt(n),o)}function _t(t){let e=null;return()=>{const n=()=>{e=null};return null===e&&(e=t,n)}}const Jt=_t("dragHorizontal"),Qt=_t("dragVertical");function te(t){let e=!1;if("y"===t)e=Qt();else if("x"===t)e=Jt();else{const t=Jt(),n=Qt();t&&n?e=()=>{t(),n()}:(t&&t(),n&&n())}return e}function ee(){const t=te(!0);return!t||(t(),!1)}function ne(e,n,o,i){return(r,s)=>{"touch"===r.type||ee()||(o&&e.animationState&&e.animationState.setActive(t.AnimationType.Hover,n),i&&i(r,s))}}const oe=(t,e)=>!!e&&(t===e||oe(t,e.parentElement));function ie(t){return e.useEffect(()=>()=>t(),[])}const re=(t,e)=>n=>e(t(n)),se=(...t)=>t.reduce(re);const ae=new WeakMap,le=new WeakMap,ue=t=>{const e=ae.get(t.target);e&&e(t)},ce=t=>{t.forEach(ue)};function he(t,e,n){const o=function({root:t,...e}){const n=t||document;le.has(n)||le.set(n,{});const o=le.get(n),i=JSON.stringify(e);return o[i]||(o[i]=new IntersectionObserver(ce,{root:t,...e})),o[i]}(e);return ae.set(t,n),o.observe(t),()=>{ae.delete(t),o.unobserve(t)}}const de={some:0,all:1};function pe(n,o,i,{root:r,margin:s,amount:a="some",once:l}){e.useEffect(()=>{if(!n||!i.current)return;const e={root:null==r?void 0:r.current,rootMargin:s,threshold:"number"==typeof a?a:de[a]};return he(i.current,e,e=>{const{isIntersecting:n}=e;if(o.isInView===n)return;if(o.isInView=n,l&&!n&&o.hasEnteredView)return;n&&(o.hasEnteredView=!0),i.animationState&&i.animationState.setActive(t.AnimationType.InView,n);const r=i.getProps(),s=n?r.onViewportEnter:r.onViewportLeave;s&&s(e)})},[n,r,s,a])}function fe(n,o,i,{fallback:r=!0}){e.useEffect(()=>{n&&r&&requestAnimationFrame(()=>{o.hasEnteredView=!0;const{onViewportEnter:e}=i.getProps();e&&e(null),i.animationState&&i.animationState.setActive(t.AnimationType.InView,!0)})},[n])}const me=t=>e=>(t(e),null),ge={inView:me((function({visualElement:t,whileInView:n,onViewportEnter:o,onViewportLeave:i,viewport:r={}}){const s=e.useRef({hasEnteredView:!1,isInView:!1});let a=Boolean(n||o||i);r.once&&s.current.hasEnteredView&&(a=!1),("undefined"==typeof IntersectionObserver?fe:pe)(a,s.current,t,r)})),tap:me((function({onTap:n,onTapStart:o,onTapCancel:i,whileTap:r,visualElement:s,...a}){const l=n||o||i||r,u=e.useRef(!1),c=e.useRef(null),h={passive:!(o||n||i||a.onPointerDown)};function d(){c.current&&c.current(),c.current=null}function p(){d(),u.current=!1;return s.getProps().whileTap&&s.animationState&&s.animationState.setActive(t.AnimationType.Tap,!1),!ee()}function f(t,e){var n,o,i,r;p()&&(oe(s.current,t.target)?null===(r=(i=s.getProps()).onTap)||void 0===r||r.call(i,t,e):null===(o=(n=s.getProps()).onTapCancel)||void 0===o||o.call(n,t,e))}function m(t,e){var n,o;p()&&(null===(o=(n=s.getProps()).onTapCancel)||void 0===o||o.call(n,t,e))}const g=e.useCallback((e,n)=>{var o;if(d(),u.current)return;u.current=!0,c.current=se(Zt(window,"pointerup",f,h),Zt(window,"pointercancel",m,h));const i=s.getProps();i.whileTap&&s.animationState&&s.animationState.setActive(t.AnimationType.Tap,!0),null===(o=i.onTapStart)||void 0===o||o.call(i,e,n)},[Boolean(o),s]);Kt(s,"pointerdown",l?g:void 0,h),ie(d)})),focus:me((function({whileFocus:n,visualElement:o}){const{animationState:i}=o,r=e.useCallback(()=>{i&&i.setActive(t.AnimationType.Focus,!0)},[i]),s=e.useCallback(()=>{i&&i.setActive(t.AnimationType.Focus,!1)},[i]);Yt(o,"focus",n?r:void 0),Yt(o,"blur",n?s:void 0)})),hover:me((function({onHoverStart:t,onHoverEnd:n,whileHover:o,visualElement:i}){Kt(i,"pointerenter",e.useMemo(()=>t||o?ne(i,!0,Boolean(o),t):void 0,[t,Boolean(o),i]),{passive:!t}),Kt(i,"pointerleave",e.useMemo(()=>n||o?ne(i,!1,Boolean(o),n):void 0,[t,Boolean(o),i]),{passive:!n})}))};function ye(){const t=e.useContext(u);if(null===t)return[!0,null];const{isPresent:n,onExitComplete:o,register:i}=t,r=e.useId();e.useEffect(()=>i(r),[]);return!n&&o?[!1,()=>o&&o(r)]:[!0]}function ve(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 xe=t=>/^0[^.\s]+$/.test(t),Ee={delta:0,timestamp:0},we="undefined"!=typeof performance?()=>performance.now():()=>Date.now(),Te="undefined"!=typeof window?t=>window.requestAnimationFrame(t):t=>setTimeout(()=>t(we()),1/60*1e3);let be=!0,Pe=!1,Ae=!1;const Se=["read","update","preRender","render","postRender"],Ve=Se.reduce((t,e)=>(t[e]=function(t){let e=[],n=[],o=0,i=!1,r=!1;const s=new WeakSet,a={schedule:(t,r=!1,a=!1)=>{const l=a&&i,u=l?e:n;return r&&s.add(t),-1===u.indexOf(t)&&(u.push(t),l&&i&&(o=e.length)),t},cancel:t=>{const e=n.indexOf(t);-1!==e&&n.splice(e,1),s.delete(t)},process:l=>{if(i)r=!0;else{if(i=!0,[e,n]=[n,e],n.length=0,o=e.length,o)for(let n=0;n<o;n++){const o=e[n];o(l),s.has(o)&&(a.schedule(o),t())}i=!1,r&&(r=!1,a.process(l))}}};return a}(()=>Pe=!0),t),{}),Ce=Se.reduce((t,e)=>{const n=Ve[e];return t[e]=(t,e=!1,o=!1)=>(Pe||ke(),n.schedule(t,e,o)),t},{}),Me=Se.reduce((t,e)=>(t[e]=Ve[e].cancel,t),{}),Re=Se.reduce((t,e)=>(t[e]=()=>Ve[e].process(Ee),t),{}),Le=t=>Ve[t].process(Ee),De=t=>{Pe=!1,Ee.delta=be?1/60*1e3:Math.max(Math.min(t-Ee.timestamp,40),1),Ee.timestamp=t,Ae=!0,Se.forEach(Le),Ae=!1,Pe&&(be=!1,Te(De))},ke=()=>{Pe=!0,be=!0,Ae||Te(De)};function Be(t,e){-1===t.indexOf(e)&&t.push(e)}function Ie(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class Oe{constructor(){this.subscriptions=[]}add(t){return Be(this.subscriptions,t),()=>Ie(this.subscriptions,t)}notify(t,e,n){const o=this.subscriptions.length;if(o)if(1===o)this.subscriptions[0](t,e,n);else for(let i=0;i<o;i++){const o=this.subscriptions[i];o&&o(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function je(t,e){return e?t*(1e3/e):0}class Fe{constructor(t,e={}){var n;this.version="8.5.3",this.timeDelta=0,this.lastUpdated=0,this.canTrackVelocity=!1,this.events={},this.updateAndNotify=(t,e=!0)=>{this.prev=this.current,this.current=t;const{delta:n,timestamp:o}=Ee;this.lastUpdated!==o&&(this.timeDelta=n,this.lastUpdated=o,Ce.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.events.change&&this.events.change.notify(this.current),this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()),e&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.scheduleVelocityCheck=()=>Ce.postRender(this.velocityCheck),this.velocityCheck=({timestamp:t})=>{t!==this.lastUpdated&&(this.prev=this.current,this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=(n=this.current,!isNaN(parseFloat(n))),this.owner=e.owner}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new Oe);const n=this.events[t].add(e);return"change"===t?()=>{n(),Ce.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t,e=!0){e&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,e)}setWithVelocity(t,e,n){this.set(e),this.prev=t,this.timeDelta=n}jump(t){this.updateAndNotify(t),this.prev=t,this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?je(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e)||null,this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){this.animation=null}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Ue(t,e){return new Fe(t,e)}const Ne=(t,e)=>n=>Boolean(et(n)&&tt.test(n)&&n.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(n,e)),ze=(t,e,n)=>o=>{if(!et(o))return o;const[i,r,s,a]=o.match(J);return{[t]:parseFloat(i),[e]:parseFloat(r),[n]:parseFloat(s),alpha:void 0!==a?parseFloat(a):1}},We={...q,transform:t=>Math.round((t=>G(0,255,t))(t))},He={test:Ne("rgb","red"),parse:ze("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:o=1})=>"rgba("+We.transform(t)+", "+We.transform(e)+", "+We.transform(n)+", "+_(Z.transform(o))+")"};const $e={test:Ne("#"),parse:function(t){let e="",n="",o="",i="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),o=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),o=t.substring(3,4),i=t.substring(4,5),e+=e,n+=n,o+=o,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(o,16),alpha:i?parseInt(i,16)/255:1}},transform:He.transform},Ye={test:Ne("hsl","hue"),parse:ze("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:o=1})=>"hsla("+Math.round(t)+", "+it.transform(_(e))+", "+it.transform(_(n))+", "+_(Z.transform(o))+")"},Xe={test:t=>He.test(t)||$e.test(t)||Ye.test(t),parse:t=>He.test(t)?He.parse(t):Ye.test(t)?Ye.parse(t):$e.parse(t),transform:t=>et(t)?t:t.hasOwnProperty("red")?He.transform(t):Ye.transform(t)};function Ge(t){"number"==typeof t&&(t=""+t);const e=[];let n=0,o=0;const i=t.match(Q);i&&(n=i.length,t=t.replace(Q,"${c}"),e.push(...i.map(Xe.parse)));const r=t.match(J);return r&&(o=r.length,t=t.replace(J,"${n}"),e.push(...r.map(q.parse))),{values:e,numColors:n,numNumbers:o,tokenised:t}}function qe(t){return Ge(t).values}function Ze(t){const{values:e,numColors:n,tokenised:o}=Ge(t),i=e.length;return t=>{let e=o;for(let o=0;o<i;o++)e=e.replace(o<n?"${c}":"${n}",o<n?Xe.transform(t[o]):_(t[o]));return e}}const Ke=t=>"number"==typeof t?0:t;const _e={test:function(t){var e,n;return isNaN(t)&&et(t)&&((null===(e=t.match(J))||void 0===e?void 0:e.length)||0)+((null===(n=t.match(Q))||void 0===n?void 0:n.length)||0)>0},parse:qe,createTransformer:Ze,getAnimatableNone:function(t){const e=qe(t);return Ze(t)(e.map(Ke))}},Je=new Set(["brightness","contrast","saturate","opacity"]);function Qe(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[o]=n.match(J)||[];if(!o)return t;const i=n.replace(o,"");let r=Je.has(e)?1:0;return o!==n&&(r*=100),e+"("+r+i+")"}const tn=/([a-z-]*)\(.*?\)/g,en={..._e,getAnimatableNone:t=>{const e=t.match(tn);return e?e.map(Qe).join(" "):t}},nn={...ct,color:Xe,backgroundColor:Xe,outlineColor:Xe,fill:Xe,stroke:Xe,borderColor:Xe,borderTopColor:Xe,borderRightColor:Xe,borderBottomColor:Xe,borderLeftColor:Xe,filter:en,WebkitFilter:en},on=t=>nn[t];function rn(t,e){var n;let o=on(t);return o!==en&&(o=_e),null===(n=o.getAnimatableNone)||void 0===n?void 0:n.call(o,e)}const sn=t=>e=>e.test(t),an=[q,rt,it,ot,at,st,{test:t=>"auto"===t,parse:t=>t}],ln=t=>an.find(sn(t)),un=[...an,Xe,_e],cn=t=>un.find(sn(t));function hn(t,e,n){const o=t.getProps();return It(o,e,void 0!==n?n:o.custom,function(t){const e={};return t.values.forEach((t,n)=>e[n]=t.get()),e}(t),function(t){const e={};return t.values.forEach((t,n)=>e[n]=t.getVelocity()),e}(t))}function dn(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Ue(n))}function pn(t,e){const n=hn(t,e);let{transitionEnd:o={},transition:i={},...r}=n?t.makeTargetAnimatable(n,!1):{};r={...r,...o};for(const e in r){dn(t,e,(s=r[e],Ot(s)?s[s.length-1]||0:s))}var s}function fn(t,e){[...e].reverse().forEach(n=>{var o;const i=t.getVariant(n);i&&pn(t,i),null===(o=t.variantChildren)||void 0===o||o.forEach(t=>{fn(t,e)})})}function mn(t,e,n){var o,i;const r=Object.keys(e).filter(e=>!t.hasValue(e)),s=r.length;if(s)for(let a=0;a<s;a++){const s=r[a],l=e[s];let u=null;Array.isArray(l)&&(u=l[0]),null===u&&(u=null!==(i=null!==(o=n[s])&&void 0!==o?o:t.readValue(s))&&void 0!==i?i:e[s]),null!=u&&("string"==typeof u&&(/^\-?\d*\.?\d+$/.test(u)||xe(u))?u=parseFloat(u):!cn(u)&&_e.test(l)&&(u=rn(s,l)),t.addValue(s,Ue(u,{owner:t})),void 0===n[s]&&(n[s]=u),null!==u&&t.setBaseTarget(s,u))}}function gn(t,e){if(!e)return;return(e[t]||e.default||e).from}function yn(t,e,n){var o;const i={};for(const r in t){const t=gn(r,e);i[r]=void 0!==t?t:null===(o=n.getValue(r))||void 0===o?void 0:o.get()}return i}function vn(t){return Boolean(z(t)&&t.add)}const xn="data-"+Mt("framerAppearId");const En=t=>1e3*t,wn={current:!1},Tn=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,bn=t=>e=>1-t(1-e),Pn=t=>t*t,An=bn(Pn),Sn=Tn(Pn),Vn=(t,e,n)=>-n*t+n*e+t;function Cn(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}const Mn=(t,e,n)=>{const o=t*t;return Math.sqrt(Math.max(0,n*(e*e-o)+o))},Rn=[$e,He,Ye];function Ln(t){const e=(n=t,Rn.find(t=>t.test(n)));var n;let o=e.parse(t);return e===Ye&&(o=function({hue:t,saturation:e,lightness:n,alpha:o}){t/=360,n/=100;let i=0,r=0,s=0;if(e/=100){const o=n<.5?n*(1+e):n+e-n*e,a=2*n-o;i=Cn(a,o,t+1/3),r=Cn(a,o,t),s=Cn(a,o,t-1/3)}else i=r=s=n;return{red:Math.round(255*i),green:Math.round(255*r),blue:Math.round(255*s),alpha:o}}(o)),o}const Dn=(t,e)=>{const n=Ln(t),o=Ln(e),i={...n};return t=>(i.red=Mn(n.red,o.red,t),i.green=Mn(n.green,o.green,t),i.blue=Mn(n.blue,o.blue,t),i.alpha=Vn(n.alpha,o.alpha,t),He.transform(i))};function kn(t,e){return"number"==typeof t?n=>Vn(t,e,n):Xe.test(t)?Dn(t,e):On(t,e)}const Bn=(t,e)=>{const n=[...t],o=n.length,i=t.map((t,n)=>kn(t,e[n]));return t=>{for(let e=0;e<o;e++)n[e]=i[e](t);return n}},In=(t,e)=>{const n={...t,...e},o={};for(const i in n)void 0!==t[i]&&void 0!==e[i]&&(o[i]=kn(t[i],e[i]));return t=>{for(const e in o)n[e]=o[e](t);return n}},On=(t,e)=>{const n=_e.createTransformer(e),o=Ge(t),i=Ge(e);return o.numColors===i.numColors&&o.numNumbers>=i.numNumbers?se(Bn(o.values,i.values),n):n=>""+(n>0?e:t)},jn=(t,e,n)=>{const o=e-t;return 0===o?1:(n-t)/o},Fn=(t,e)=>n=>Vn(t,e,n);function Un(t,e,n){const o=[],i=n||("number"==typeof(r=t[0])?Fn:"string"==typeof r?Xe.test(r)?Dn:On:Array.isArray(r)?Bn:"object"==typeof r?In:Fn);var r;const s=t.length-1;for(let n=0;n<s;n++){let r=i(t[n],t[n+1]);if(e){const t=Array.isArray(e)?e[n]:e;r=se(t,r)}o.push(r)}return o}function Nn(t,e,{clamp:n=!0,ease:o,mixer:i}={}){const r=t.length;e.length,!o||!Array.isArray(o)||o.length,t[0]>t[r-1]&&(t=[...t].reverse(),e=[...e].reverse());const s=Un(e,o,i),a=s.length,l=e=>{let n=0;if(a>1)for(;n<t.length-2&&!(e<t[n+1]);n++);const o=jn(t[n],t[n+1],e);return s[n](o)};return n?e=>l(G(t[0],t[r-1],e)):l}const zn=t=>t,Wn=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function Hn(t,e,n,o){if(t===e&&n===o)return zn;const i=e=>function(t,e,n,o,i){let r,s,a=0;do{s=e+(n-e)/2,r=Wn(s,o,i)-t,r>0?n=s:e=s}while(Math.abs(r)>1e-7&&++a<12);return s}(e,0,1,t,n);return t=>0===t||1===t?t:Wn(i(t),e,o)}const $n=t=>1-Math.sin(Math.acos(t)),Yn=bn($n),Xn=Tn(Yn),Gn=Hn(.33,1.53,.69,.99),qn=bn(Gn),Zn=Tn(qn),Kn=t=>(t*=2)<1?.5*qn(t):.5*(2-Math.pow(2,-10*(t-1))),_n={linear:zn,easeIn:Pn,easeInOut:Sn,easeOut:An,circIn:$n,circInOut:Xn,circOut:Yn,backIn:qn,backInOut:Zn,backOut:Gn,anticipate:Kn},Jn=t=>{if(Array.isArray(t)){t.length;const[e,n,o,i]=t;return Hn(e,n,o,i)}return"string"==typeof t?_n[t]:t};function Qn({keyframes:t,ease:e=Sn,times:n,duration:o=300}){t=[...t];const i=(t=>Array.isArray(t)&&"number"!=typeof t[0])(e)?e.map(Jn):Jn(e),r={done:!1,value:t[0]},s=function(t,e){return t.map(t=>t*e)}(n&&n.length===t.length?n:function(t){const e=t.length;return t.map((t,n)=>0!==n?n/(e-1):0)}(t),o);function a(){return Nn(s,t,{ease:Array.isArray(i)?i:(e=t,n=i,e.map(()=>n||Sn).splice(0,e.length-1))});var e,n}let l=a();return{next:t=>(r.value=l(t),r.done=t>=o,r),flipTarget:()=>{t.reverse(),l=a()}}}function to({duration:t=800,bounce:e=.25,velocity:n=0,mass:o=1}){let i,r,s=1-e;s=G(.05,1,s),t=G(.01,10,t/1e3),s<1?(i=e=>{const o=e*s,i=o*t;return.001-(o-n)/eo(e,s)*Math.exp(-i)},r=e=>{const o=e*s*t,r=o*n+n,a=Math.pow(s,2)*Math.pow(e,2)*t,l=Math.exp(-o),u=eo(Math.pow(e,2),s);return(.001-i(e)>0?-1:1)*((r-a)*l)/u}):(i=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,r=e=>Math.exp(-e*t)*(t*t*(n-e)));const a=function(t,e,n){let o=n;for(let n=1;n<12;n++)o-=t(o)/e(o);return o}(i,r,5/t);if(t*=1e3,isNaN(a))return{stiffness:100,damping:10,duration:t};{const e=Math.pow(a,2)*o;return{stiffness:e,damping:2*s*Math.sqrt(o*e),duration:t}}}function eo(t,e){return t*Math.sqrt(1-e*e)}const no=["duration","bounce"],oo=["stiffness","damping","mass"];function io(t,e){return e.some(e=>void 0!==t[e])}function ro({keyframes:t,restDelta:e,restSpeed:n,...o}){let i=t[0],r=t[t.length-1];const s={done:!1,value:i},{stiffness:a,damping:l,mass:u,velocity:c,duration:h,isResolvedFromDuration:d}=function(t){let e={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...t};if(!io(t,oo)&&io(t,no)){const n=to(t);e={...e,...n,velocity:0,mass:1},e.isResolvedFromDuration=!0}return e}(o);let p=so,f=c?-c/1e3:0;const m=l/(2*Math.sqrt(a*u));function g(){const t=r-i,o=Math.sqrt(a/u)/1e3,s=Math.abs(t)<5;if(n||(n=s?.01:2),e||(e=s?.005:.5),m<1){const e=eo(o,m);p=n=>{const i=Math.exp(-m*o*n);return r-i*((f+m*o*t)/e*Math.sin(e*n)+t*Math.cos(e*n))}}else if(1===m)p=e=>r-Math.exp(-o*e)*(t+(f+o*t)*e);else{const e=o*Math.sqrt(m*m-1);p=n=>{const i=Math.exp(-m*o*n),s=Math.min(e*n,300);return r-i*((f+m*o*t)*Math.sinh(s)+e*t*Math.cosh(s))/e}}}return g(),{next:t=>{const o=p(t);if(d)s.done=t>=h;else{let i=f;if(0!==t)if(m<1){const e=Math.max(0,t-5);i=je(o-p(e),t-e)}else i=0;const a=Math.abs(i)<=n,l=Math.abs(r-o)<=e;s.done=a&&l}return s.value=s.done?r:o,s},flipTarget:()=>{f=-f,[i,r]=[r,i],g()}}}ro.needsInterpolation=(t,e)=>"string"==typeof t||"string"==typeof e;const so=t=>0;const ao={decay:function({keyframes:t=[0],velocity:e=0,power:n=.8,timeConstant:o=350,restDelta:i=.5,modifyTarget:r}){const s=t[0],a={done:!1,value:s};let l=n*e;const u=s+l,c=void 0===r?u:r(u);return c!==u&&(l=c-s),{next:t=>{const e=-l*Math.exp(-t/o);return a.done=!(e>i||e<-i),a.value=a.done?c:c+e,a},flipTarget:()=>{}}},keyframes:Qn,tween:Qn,spring:ro};function lo(t,e,n=0){return t-e-n}const uo=t=>{const e=({delta:e})=>t(e);return{start:()=>Ce.update(e,!0),stop:()=>Me.update(e)}};function co({duration:t,driver:e=uo,elapsed:n=0,repeat:o=0,repeatType:i="loop",repeatDelay:r=0,keyframes:s,autoplay:a=!0,onPlay:l,onStop:u,onComplete:c,onRepeat:h,onUpdate:d,type:p="keyframes",...f}){var m,g;const y=n;let v,x,E=0,w=t,T=!1,b=!0;const P=ao[s.length>2?"keyframes":p]||Qn,A=s[0],S=s[s.length-1];let V={done:!1,value:A};(null===(g=(m=P).needsInterpolation)||void 0===g?void 0:g.call(m,A,S))&&(x=Nn([0,100],[A,S],{clamp:!1}),s=[0,100]);const C=P({...f,duration:t,keyframes:s});function M(){E++,"reverse"===i?(b=E%2==0,n=function(t,e=0,n=0,o=!0){return o?lo(e+-t,e,n):e-(t-e)+n}(n,w,r,b)):(n=lo(n,w,r),"mirror"===i&&C.flipTarget()),T=!1,h&&h()}function R(t){b||(t=-t),n+=t,T||(V=C.next(Math.max(0,n)),x&&(V.value=x(V.value)),T=b?V.done:n<=0),d&&d(V.value),T&&(0===E&&(w=void 0!==w?w:n),E<o?function(t,e,n,o){return o?t>=e+n:t<=-n}(n,w,r,b)&&M():(v&&v.stop(),c&&c()))}return a&&(l&&l(),v=e(R),v.start()),{stop:()=>{u&&u(),v&&v.stop()},set currentTime(t){n=y,R(t)},sample:e=>{n=y;const o=t&&"number"==typeof t?Math.max(.5*t,50):50;let i=0;for(R(0);i<=e;){const t=e-i;R(Math.min(t,o)),i+=o}return V}}}const ho=([t,e,n,o])=>`cubic-bezier(${t}, ${e}, ${n}, ${o})`,po={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:ho([0,.65,.55,1]),circOut:ho([.55,0,1,.45]),backIn:ho([.31,.01,.66,-.59]),backOut:ho([.33,1.53,.69,.99])};function fo(t){if(t)return Array.isArray(t)?ho(t):po[t]}function mo(t,e,n,{delay:o=0,duration:i,repeat:r=0,repeatType:s="loop",ease:a,times:l}={}){return t.animate({[e]:n,offset:l},{delay:o,duration:i,easing:fo(a),fill:"both",iterations:r+1,direction:"reverse"===s?"alternate":"normal"})}const go={waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate")},yo={},vo={};for(const t in go)vo[t]=()=>(void 0===yo[t]&&(yo[t]=go[t]()),yo[t]);const xo=new Set(["opacity"]);function Eo(t,e,{onUpdate:n,onComplete:o,...i}){if(!(vo.waapi()&&xo.has(e)&&!i.repeatDelay&&"mirror"!==i.repeatType&&0!==i.damping))return!1;let{keyframes:r,duration:s=300,elapsed:a=0,ease:l}=i;if("spring"===i.type||!(!(u=i.ease)||Array.isArray(u)||"string"==typeof u&&po[u])){if(i.repeat===1/0)return;const t=co({...i,elapsed:0});let e={done:!1,value:r[0]};const n=[];let o=0;for(;!e.done&&o<2e4;)e=t.sample(o),n.push(e.value),o+=10;r=n,s=o-10,l="linear"}var u;const c=mo(t.owner.current,e,r,{...i,delay:-a,duration:s,ease:l});return c.onfinish=()=>{t.set(function(t,{repeat:e,repeatType:n="loop"}){return t[e&&"loop"!==n&&e%2==1?0:t.length-1]}(r,i)),o&&o()},{get currentTime(){return c.currentTime||0},set currentTime(t){c.currentTime=t},stop:()=>{const{currentTime:e}=c;if(e){const n=co({...i,autoplay:!1});t.setWithVelocity(n.sample(e-10).value,n.sample(e).value,10)}Ce.update(()=>c.cancel())}}}function wo(t,e){const n=performance.now(),o=({timestamp:i})=>{const r=i-n;r>=e&&(Me.read(o),t(r-e))};return Ce.read(o,!0),()=>Me.read(o)}function To({keyframes:t,elapsed:e,onUpdate:n,onComplete:o}){const i=()=>{n&&n(t[t.length-1]),o&&o()};return e?{stop:wo(i,-e)}:i()}const bo=()=>({type:"spring",stiffness:500,damping:25,restSpeed:10}),Po=t=>({type:"spring",stiffness:550,damping:0===t?2*Math.sqrt(550):30,restSpeed:10}),Ao=()=>({type:"keyframes",ease:"linear",duration:.3}),So={type:"keyframes",duration:.8},Vo={x:bo,y:bo,z:bo,rotate:bo,rotateX:bo,rotateY:bo,rotateZ:bo,scaleX:Po,scaleY:Po,scale:Po,opacity:Ao,backgroundColor:Ao,color:Ao,default:Po},Co=(t,{keyframes:e})=>{if(e.length>2)return So;return(Vo[t]||Vo.default)(e[1])},Mo=(t,e)=>"zIndex"!==t&&(!("number"!=typeof e&&!Array.isArray(e))||!("string"!=typeof e||!_e.test(e)||e.startsWith("url(")));function Ro(t){return 0===t||"string"==typeof t&&0===parseFloat(t)&&-1===t.indexOf(" ")}function Lo(t){return"number"==typeof t?0:rn("",t)}function Do(t,e){return t[e]||t.default||t}const ko=(t,e,n,o={})=>i=>{const r=Do(o,t)||{},s=r.delay||o.delay||0;let{elapsed:a=0}=o;a-=En(s);const l=function(t,e,n,o){const i=Mo(e,n);let r=void 0!==o.from?o.from:t.get();return"none"===r&&i&&"string"==typeof n?r=rn(e,n):Ro(r)&&"string"==typeof n?r=Lo(n):!Array.isArray(n)&&Ro(n)&&"string"==typeof r&&(n=Lo(r)),Array.isArray(n)?(null===n[0]&&(n[0]=r),n):[r,n]}(e,t,n,r),u=l[0],c=l[l.length-1],h=Mo(t,u),d=Mo(t,c);let p={keyframes:l,velocity:e.getVelocity(),...r,elapsed:a,onUpdate:t=>{e.set(t),r.onUpdate&&r.onUpdate(t)},onComplete:()=>{i(),r.onComplete&&r.onComplete()}};if(!h||!d||wn.current||!1===r.type)return To(p);if("inertia"===r.type)return function({keyframes:t,velocity:e=0,min:n,max:o,power:i=.8,timeConstant:r=750,bounceStiffness:s=500,bounceDamping:a=10,restDelta:l=1,modifyTarget:u,driver:c,onUpdate:h,onComplete:d,onStop:p}){const f=t[0];let m;function g(t){return void 0!==n&&t<n||void 0!==o&&t>o}function y(t){return void 0===n?o:void 0===o||Math.abs(n-t)<Math.abs(o-t)?n:o}function v(t){null==m||m.stop(),m=co({keyframes:[0,1],velocity:0,...t,driver:c,onUpdate:e=>{var n;null==h||h(e),null===(n=t.onUpdate)||void 0===n||n.call(t,e)},onComplete:d,onStop:p})}function x(t){v({type:"spring",stiffness:s,damping:a,restDelta:l,...t})}if(g(f))x({velocity:e,keyframes:[f,y(f)]});else{let t=i*e+f;void 0!==u&&(t=u(t));const o=y(t),s=o===n?-1:1;let a,c;const h=t=>{a=c,c=t,e=je(t-a,Ee.delta),(1===s&&t>o||-1===s&&t<o)&&x({keyframes:[t,o],velocity:e})};v({type:"decay",keyframes:[f,0],velocity:e,timeConstant:r,power:i,restDelta:l,modifyTarget:u,onUpdate:g(t)?h:void 0})}return{stop:()=>null==m?void 0:m.stop()}}(p);(function({when:t,delay:e,delayChildren:n,staggerChildren:o,staggerDirection:i,repeat:r,repeatType:s,repeatDelay:a,from:l,elapsed:u,...c}){return!!Object.keys(c).length})(r)||(p={...p,...Co(t,p)}),p.duration&&(p.duration=En(p.duration)),p.repeatDelay&&(p.repeatDelay=En(p.repeatDelay));const f=e.owner,m=f&&f.current;if(f&&m instanceof HTMLElement&&!(null==f?void 0:f.getProps().onUpdate)){const n=Eo(e,t,p);if(n)return n}return co(p)};function Bo(t,e,n={}){let o;if(t.notify("AnimationStart",e),Array.isArray(e)){const i=e.map(e=>Io(t,e,n));o=Promise.all(i)}else if("string"==typeof e)o=Io(t,e,n);else{const i="function"==typeof e?hn(t,e,n.custom):e;o=Oo(t,i,n)}return o.then(()=>t.notify("AnimationComplete",e))}function Io(t,e,n={}){var o;const i=hn(t,e,n.custom);let{transition:r=t.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(r=n.transitionOverride);const s=i?()=>Oo(t,i,n):()=>Promise.resolve(),a=(null===(o=t.variantChildren)||void 0===o?void 0:o.size)?(o=0)=>{const{delayChildren:i=0,staggerChildren:s,staggerDirection:a}=r;return function(t,e,n=0,o=0,i=1,r){const s=[],a=(t.variantChildren.size-1)*o,l=1===i?(t=0)=>t*o:(t=0)=>a-t*o;return Array.from(t.variantChildren).sort(jo).forEach((t,o)=>{t.notify("AnimationStart",e),s.push(Io(t,e,{...r,delay:n+l(o)}).then(()=>t.notify("AnimationComplete",e)))}),Promise.all(s)}(t,e,i+o,s,a,n)}:()=>Promise.resolve(),{when:l}=r;if(l){const[t,e]="beforeChildren"===l?[s,a]:[a,s];return t().then(e)}return Promise.all([s(),a(n.delay)])}function Oo(t,e,{delay:n=0,transitionOverride:o,type:i}={}){var r;let{transition:s=t.getDefaultTransition(),transitionEnd:a,...l}=t.makeTargetAnimatable(e);const u=t.getValue("willChange");o&&(s=o);const c=[],h=i&&(null===(r=t.animationState)||void 0===r?void 0:r.getState()[i]);for(const e in l){const o=t.getValue(e),i=l[e];if(!o||void 0===i||h&&Fo(h,e))continue;const r={delay:n,elapsed:0,...s};if(window.HandoffAppearAnimations&&!o.hasAnimated){const n=t.getProps()[xn];n&&(r.elapsed=window.HandoffAppearAnimations(n,e,o,Ce))}let a=o.start(ko(e,o,i,t.shouldReduceMotion&&U.has(e)?{type:!1}:r));vn(u)&&(u.add(e),a=a.then(()=>u.remove(e))),c.push(a)}return Promise.all(c).then(()=>{a&&pn(t,a)})}function jo(t,e){return t.sortNodePosition(e)}function Fo({protectedKeys:t,needsAnimating:e},n){const o=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,o}const Uo=[t.AnimationType.Animate,t.AnimationType.InView,t.AnimationType.Focus,t.AnimationType.Hover,t.AnimationType.Tap,t.AnimationType.Drag,t.AnimationType.Exit],No=[...Uo].reverse(),zo=Uo.length;function Wo(e){let n=function(t){return e=>Promise.all(e.map(({animation:e,options:n})=>Bo(t,e,n)))}(e);const o={[t.AnimationType.Animate]:$o(!0),[t.AnimationType.InView]:$o(),[t.AnimationType.Hover]:$o(),[t.AnimationType.Tap]:$o(),[t.AnimationType.Drag]:$o(),[t.AnimationType.Focus]:$o(),[t.AnimationType.Exit]:$o()};let i=!0;const r=(t,n)=>{const o=hn(e,n);if(o){const{transition:e,transitionEnd:n,...i}=o;t={...t,...i,...n}}return t};function s(t,s){const a=e.getProps(),l=e.getVariantContext(!0)||{},u=[],c=new Set;let h={},d=1/0;for(let n=0;n<zo;n++){const p=No[n],g=o[p],y=void 0!==a[p]?a[p]:l[p],v=f(y),x=p===s?g.isActive:null;!1===x&&(d=n);let E=y===l[p]&&y!==a[p]&&v;if(E&&i&&e.manuallyAnimateOnMount&&(E=!1),g.protectedKeys={...h},!g.isActive&&null===x||!y&&!g.prevProp||m(y)||"boolean"==typeof y)continue;const w=Ho(g.prevProp,y);let T=w||p===s&&g.isActive&&!E&&v||n>d&&v;const b=Array.isArray(y)?y:[y];let P=b.reduce(r,{});!1===x&&(P={});const{prevResolvedValues:A={}}=g,S={...A,...P},V=t=>{T=!0,c.delete(t),g.needsAnimating[t]=!0};for(const t in S){const e=P[t],n=A[t];h.hasOwnProperty(t)||(e!==n?Ot(e)&&Ot(n)?!ve(e,n)||w?V(t):g.protectedKeys[t]=!0:void 0!==e?V(t):c.add(t):void 0!==e&&c.has(t)?V(t):g.protectedKeys[t]=!0)}g.prevProp=y,g.prevResolvedValues=P,g.isActive&&(h={...h,...P}),i&&e.blockInitialAnimation&&(T=!1),T&&!E&&u.push(...b.map(e=>({animation:e,options:{type:p,...t}})))}if(c.size){const t={};c.forEach(n=>{const o=e.getBaseTarget(n);void 0!==o&&(t[n]=o)}),u.push({animation:t})}let p=Boolean(u.length);return i&&!1===a.initial&&!e.manuallyAnimateOnMount&&(p=!1),i=!1,p?n(u):Promise.resolve()}return{animateChanges:s,setActive:function(t,n,i){var r;if(o[t].isActive===n)return Promise.resolve();null===(r=e.variantChildren)||void 0===r||r.forEach(e=>{var o;return null===(o=e.animationState)||void 0===o?void 0:o.setActive(t,n)}),o[t].isActive=n;const a=s(i,t);for(const t in o)o[t].protectedKeys={};return a},setAnimateFunction:function(t){n=t(e)},getState:()=>o}}function Ho(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!ve(e,t)}function $o(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}const Yo={animation:me(({visualElement:t,animate:n})=>{t.animationState||(t.animationState=Wo(t)),m(n)&&e.useEffect(()=>n.subscribe(t),[n])}),exit:me(n=>{const{custom:o,visualElement:i}=n,[r,s]=ye(),a=e.useContext(u);e.useEffect(()=>{i.isPresent=r;const e=i.animationState&&i.animationState.setActive(t.AnimationType.Exit,!r,{custom:a&&a.custom||o});e&&!r&&e.then(s)},[r])})},Xo=(t,e)=>Math.abs(t-e);function Go(t,e){const n=Xo(t.x,e.x),o=Xo(t.y,e.y);return Math.sqrt(n**2+o**2)}class qo{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=_o(this.lastMoveEventInfo,this.history),e=null!==this.startEvent,n=Go(t.offset,{x:0,y:0})>=3;if(!e&&!n)return;const{point:o}=t,{timestamp:i}=Ee;this.history.push({...o,timestamp:i});const{onStart:r,onMove:s}=this.handlers;e||(r&&r(this.lastMoveEvent,t),this.startEvent=this.lastMoveEvent),s&&s(this.lastMoveEvent,t)},this.handlePointerMove=(t,e)=>{this.lastMoveEvent=t,this.lastMoveEventInfo=Zo(e,this.transformPagePoint),Ce.update(this.updatePoint,!0)},this.handlePointerUp=(t,e)=>{if(this.end(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const{onEnd:n,onSessionEnd:o}=this.handlers,i=_o("pointercancel"===t.type?this.lastMoveEventInfo:Zo(e,this.transformPagePoint),this.history);this.startEvent&&n&&n(t,i),o&&o(t,i)},!Xt(t))return;this.handlers=e,this.transformPagePoint=n;const o=Zo(Gt(t),this.transformPagePoint),{point:i}=o,{timestamp:r}=Ee;this.history=[{...i,timestamp:r}];const{onSessionStart:s}=e;s&&s(t,_o(o,this.history)),this.removeListeners=se(Zt(window,"pointermove",this.handlePointerMove),Zt(window,"pointerup",this.handlePointerUp),Zt(window,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Me.update(this.updatePoint)}}function Zo(t,e){return e?{point:e(t.point)}:t}function Ko(t,e){return{x:t.x-e.x,y:t.y-e.y}}function _o({point:t},e){return{point:t,delta:Ko(t,Qo(e)),offset:Ko(t,Jo(e)),velocity:ti(e,.1)}}function Jo(t){return t[0]}function Qo(t){return t[t.length-1]}function ti(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,o=null;const i=Qo(t);for(;n>=0&&(o=t[n],!(i.timestamp-o.timestamp>En(e)));)n--;if(!o)return{x:0,y:0};const r=(i.timestamp-o.timestamp)/1e3;if(0===r)return{x:0,y:0};const s={x:(i.x-o.x)/r,y:(i.y-o.y)/r};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}function ei(t){return t.max-t.min}function ni(t,e=0,n=.01){return Math.abs(t-e)<=n}function oi(t,e,n,o=.5){t.origin=o,t.originPoint=Vn(e.min,e.max,t.origin),t.scale=ei(n)/ei(e),(ni(t.scale,1,1e-4)||isNaN(t.scale))&&(t.scale=1),t.translate=Vn(n.min,n.max,t.origin)-t.originPoint,(ni(t.translate)||isNaN(t.translate))&&(t.translate=0)}function ii(t,e,n,o){oi(t.x,e.x,n.x,null==o?void 0:o.originX),oi(t.y,e.y,n.y,null==o?void 0:o.originY)}function ri(t,e,n){t.min=n.min+e.min,t.max=t.min+ei(e)}function si(t,e,n){t.min=e.min-n.min,t.max=t.min+ei(e)}function ai(t,e,n){si(t.x,e.x,n.x),si(t.y,e.y,n.y)}function li(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 ui(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 ci=.35;function hi(t,e,n){return{min:di(t,e),max:di(t,n)}}function di(t,e){return"number"==typeof t?t:t[e]||0}const pi=()=>({x:{min:0,max:0},y:{min:0,max:0}});function fi(t){return[t("x"),t("y")]}function mi({top:t,left:e,right:n,bottom:o}){return{x:{min:e,max:n},y:{min:t,max:o}}}function gi(t){return void 0===t||1===t}function yi({scale:t,scaleX:e,scaleY:n}){return!gi(t)||!gi(e)||!gi(n)}function vi(t){return yi(t)||xi(t)||t.z||t.rotate||t.rotateX||t.rotateY}function xi(t){return Ei(t.x)||Ei(t.y)}function Ei(t){return t&&"0%"!==t}function wi(t,e,n){return n+e*(t-n)}function Ti(t,e,n,o,i){return void 0!==i&&(t=wi(t,i,o)),wi(t,n,o)+e}function bi(t,e=0,n=1,o,i){t.min=Ti(t.min,e,n,o,i),t.max=Ti(t.max,e,n,o,i)}function Pi(t,{x:e,y:n}){bi(t.x,e.translate,e.scale,e.originPoint),bi(t.y,n.translate,n.scale,n.originPoint)}function Ai(t){return Number.isInteger(t)||t>1.0000000000001||t<.999999999999?t:1}function Si(t,e){t.min=t.min+e,t.max=t.max+e}function Vi(t,e,[n,o,i]){const r=void 0!==e[i]?e[i]:.5,s=Vn(t.min,t.max,r);bi(t,e[n],e[o],s,e.scale)}const Ci=["x","scaleX","originX"],Mi=["y","scaleY","originY"];function Ri(t,e){Vi(t.x,e,Ci),Vi(t.y,e,Mi)}function Li(t,e){return mi(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 Di=new WeakMap;class ki{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 qo(e,{onSessionStart:t=>{this.stopAnimation(),n&&this.snapToCursor(Gt(t,"page").point)},onStart:(e,n)=>{var o;const{drag:i,dragPropagation:r,onDragStart:s}=this.getProps();(!i||r||(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=te(i),this.openGlobalLock))&&(this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),fi(t=>{var e,n;let o=this.getAxisMotionValue(t).get()||0;if(it.test(o)){const i=null===(n=null===(e=this.visualElement.projection)||void 0===e?void 0:e.layout)||void 0===n?void 0:n.layoutBox[t];if(i){o=ei(i)*(parseFloat(o)/100)}}this.originPoint[t]=o}),null==s||s(e,n),null===(o=this.visualElement.animationState)||void 0===o||o.setActive(t.AnimationType.Drag,!0))},onMove:(t,e)=>{const{dragPropagation:n,dragDirectionLock:o,onDirectionLock:i,onDrag:r}=this.getProps();if(!n&&!this.openGlobalLock)return;const{offset:s}=e;if(o&&null===this.currentDirection)return this.currentDirection=function(t,e=10){let n=null;Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x");return n}(s),void(null!==this.currentDirection&&(null==i||i(this.currentDirection)));this.updateAxis("x",e.point,s),this.updateAxis("y",e.point,s),this.visualElement.render(),null==r||r(t,e)},onSessionEnd:(t,e)=>this.stop(t,e)},{transformPagePoint:this.visualElement.getTransformPagePoint()})}stop(t,e){const n=this.isDragging;if(this.cancel(),!n)return;const{velocity:o}=e;this.startAnimation(o);const{onDragEnd:i}=this.getProps();null==i||i(t,e)}cancel(){var e,n;this.isDragging=!1,this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!1),null===(e=this.panSession)||void 0===e||e.end(),this.panSession=void 0;const{dragPropagation:o}=this.getProps();!o&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),null===(n=this.visualElement.animationState)||void 0===n||n.setActive(t.AnimationType.Drag,!1)}updateAxis(t,e,n){const{drag:o}=this.getProps();if(!n||!Bi(t,o,this.currentDirection))return;const i=this.getAxisMotionValue(t);let r=this.originPoint[t]+n[t];this.constraints&&this.constraints[t]&&(r=function(t,{min:e,max:n},o){return void 0!==e&&t<e?t=o?Vn(e,t,o.min):Math.max(t,e):void 0!==n&&t>n&&(t=o?Vn(n,t,o.max):Math.min(t,n)),t}(r,this.constraints[t],this.elastic[t])),i.set(r)}resolveConstraints(){const{dragConstraints:t,dragElastic:e}=this.getProps(),{layout:n}=this.visualElement.projection||{},o=this.constraints;t&&p(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!n)&&function(t,{top:e,left:n,bottom:o,right:i}){return{x:li(t.x,n,i),y:li(t.y,e,o)}}(n.layoutBox,t),this.elastic=function(t=ci){return!1===t?t=0:!0===t&&(t=ci),{x:hi(t,"left","right"),y:hi(t,"top","bottom")}}(e),o!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&fi(t=>{this.getAxisMotionValue(t)&&(this.constraints[t]=function(t,e){const n={};return void 0!==e.min&&(n.min=e.min-t.min),void 0!==e.max&&(n.max=e.max-t.min),n}(n.layoutBox[t],this.constraints[t]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:e}=this.getProps();if(!t||!p(t))return!1;const n=t.current,{projection:o}=this.visualElement;if(!o||!o.layout)return!1;const i=function(t,e,n){const o=Li(t,n),{scroll:i}=e;return i&&(Si(o.x,i.offset.x),Si(o.y,i.offset.y)),o}(n,o.root,this.visualElement.getTransformPagePoint());let r=function(t,e){return{x:ui(t.x,e.x),y:ui(t.y,e.y)}}(o.layout.layoutBox,i);if(e){const t=e(function({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}(r));this.hasMutatedConstraints=!!t,t&&(r=mi(t))}return r}startAnimation(t){const{drag:e,dragMomentum:n,dragElastic:o,dragTransition:i,dragSnapToOrigin:r,onDragTransitionEnd:s}=this.getProps(),a=this.constraints||{},l=fi(s=>{if(!Bi(s,e,this.currentDirection))return;let l=(null==a?void 0:a[s])||{};r&&(l={min:0,max:0});const u=o?200:1e6,c=o?40:1e7,h={type:"inertia",velocity:n?t[s]:0,bounceStiffness:u,bounceDamping:c,timeConstant:750,restDelta:1,restSpeed:10,...i,...l};return this.startAxisValueAnimation(s,h)});return Promise.all(l).then(s)}startAxisValueAnimation(t,e){const n=this.getAxisMotionValue(t);return n.start(ko(t,n,0,e))}stopAnimation(){fi(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){var e;const n="_drag"+t.toUpperCase(),o=this.visualElement.getProps()[n];return o||this.visualElement.getValue(t,(null===(e=this.visualElement.getProps().initial)||void 0===e?void 0:e[t])||0)}snapToCursor(t){fi(e=>{const{drag:n}=this.getProps();if(!Bi(e,n,this.currentDirection))return;const{projection:o}=this.visualElement,i=this.getAxisMotionValue(e);if(o&&o.layout){const{min:n,max:r}=o.layout.layoutBox[e];i.set(t[e]-Vn(n,r,.5))}})}scalePositionWithinConstraints(){var t;if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:o}=this.visualElement;if(!p(n)||!o||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};fi(t=>{const e=this.getAxisMotionValue(t);if(e){const n=e.get();i[t]=function(t,e){let n=.5;const o=ei(t),i=ei(e);return i>o?n=jn(e.min,e.max-o,t.min):o>i&&(n=jn(t.min,t.max-i,e.min)),G(0,1,n)}({min:n,max:n},this.constraints[t])}});const{transformTemplate:r}=this.visualElement.getProps();this.visualElement.current.style.transform=r?r({},""):"none",null===(t=o.root)||void 0===t||t.updateScroll(),o.updateLayout(),this.resolveConstraints(),fi(t=>{if(!Bi(t,e,null))return;const n=this.getAxisMotionValue(t),{min:o,max:r}=this.constraints[t];n.set(Vn(o,r,i[t]))})}addListeners(){var t;if(!this.visualElement.current)return;Di.set(this.visualElement,this);const e=Zt(this.visualElement.current,"pointerdown",t=>{const{drag:e,dragListener:n=!0}=this.getProps();e&&n&&this.start(t)}),n=()=>{const{dragConstraints:t}=this.getProps();p(t)&&(this.constraints=this.resolveRefConstraints())},{projection:o}=this.visualElement,i=o.addEventListener("measure",n);o&&!o.layout&&(null===(t=o.root)||void 0===t||t.updateScroll(),o.updateLayout()),n();const r=$t(window,"resize",()=>this.scalePositionWithinConstraints()),s=o.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e})=>{this.isDragging&&e&&(fi(e=>{const n=this.getAxisMotionValue(e);n&&(this.originPoint[e]+=t[e].translate,n.set(n.get()+t[e].translate))}),this.visualElement.render())});return()=>{r(),e(),i(),null==s||s()}}getProps(){const t=this.visualElement.getProps(),{drag:e=!1,dragDirectionLock:n=!1,dragPropagation:o=!1,dragConstraints:i=!1,dragElastic:r=ci,dragMomentum:s=!0}=t;return{...t,drag:e,dragDirectionLock:n,dragPropagation:o,dragConstraints:i,dragElastic:r,dragMomentum:s}}}function Bi(t,e,n){return!(!0!==e&&e!==t||null!==n&&n!==t)}const Ii={pan:me((function({onPan:t,onPanStart:n,onPanEnd:o,onPanSessionStart:i,visualElement:r}){const a=t||n||o||i,l=e.useRef(null),{transformPagePoint:u}=e.useContext(s),c={onSessionStart:i,onStart:n,onMove:t,onEnd:(t,e)=>{l.current=null,o&&o(t,e)}};e.useEffect(()=>{null!==l.current&&l.current.updateHandlers(c)}),Kt(r,"pointerdown",a&&function(t){l.current=new qo(t,c,{transformPagePoint:u})}),ie(()=>l.current&&l.current.end())})),drag:me((function(t){const{dragControls:n,visualElement:o}=t,i=P(()=>new ki(o));e.useEffect(()=>n&&n.subscribe(i),[i,n]),e.useEffect(()=>i.addListeners(),[i])}))};function Oi(t){return"string"==typeof t&&t.startsWith("var(--")}const ji=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function Fi(t,e,n=1){const[o,i]=function(t){const e=ji.exec(t);if(!e)return[,];const[,n,o]=e;return[n,o]}(t);if(!o)return;const r=window.getComputedStyle(e).getPropertyValue(o);return r?r.trim():Oi(i)?Fi(i,e,n+1):i}const Ui=new Set(["width","height","top","left","right","bottom","x","y"]),Ni=t=>Ui.has(t),zi=t=>t===q||t===rt;var Wi;!function(t){t.width="width",t.height="height",t.left="left",t.right="right",t.top="top",t.bottom="bottom"}(Wi||(Wi={}));const Hi=(t,e)=>parseFloat(t.split(", ")[e]),$i=(t,e)=>(n,{transform:o})=>{if("none"===o||!o)return 0;const i=o.match(/^matrix3d\((.+)\)$/);if(i)return Hi(i[1],e);{const e=o.match(/^matrix\((.+)\)$/);return e?Hi(e[1],t):0}},Yi=new Set(["x","y","z"]),Xi=F.filter(t=>!Yi.has(t));const Gi={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:$i(4,13),y:$i(5,14)},qi=(t,e,n={},o={})=>{e={...e},o={...o};const i=Object.keys(e).filter(Ni);let r=[],s=!1;const a=[];if(i.forEach(i=>{const l=t.getValue(i);if(!t.hasValue(i))return;let u=n[i],c=ln(u);const h=e[i];let d;if(Ot(h)){const t=h.length,e=null===h[0]?1:0;u=h[e],c=ln(u);for(let n=e;n<t;n++)d?ln(h[n]):d=ln(h[n])}else d=ln(h);if(c!==d)if(zi(c)&&zi(d)){const t=l.get();"string"==typeof t&&l.set(parseFloat(t)),"string"==typeof h?e[i]=parseFloat(h):Array.isArray(h)&&d===rt&&(e[i]=h.map(parseFloat))}else(null==c?void 0:c.transform)&&(null==d?void 0:d.transform)&&(0===u||0===h)?0===u?l.set(d.transform(u)):e[i]=c.transform(h):(s||(r=function(t){const e=[];return Xi.forEach(n=>{const o=t.getValue(n);void 0!==o&&(e.push([n,o.get()]),o.set(n.startsWith("scale")?1:0))}),e.length&&t.render(),e}(t),s=!0),a.push(i),o[i]=void 0!==o[i]?o[i]:e[i],l.jump(h))}),a.length){const n=a.indexOf("height")>=0?window.pageYOffset:null,i=((t,e,n)=>{const o=e.measureViewportBox(),i=e.current,r=getComputedStyle(i),{display:s}=r,a={};"none"===s&&e.setStaticValue("display",t.display||"block"),n.forEach(t=>{a[t]=Gi[t](o,r)}),e.render();const l=e.measureViewportBox();return n.forEach(n=>{const o=e.getValue(n);o&&o.jump(a[n]),t[n]=Gi[n](l,r)}),t})(e,t,a);return r.length&&r.forEach(([e,n])=>{t.getValue(e).set(n)}),t.render(),c&&null!==n&&window.scrollTo({top:n}),{target:i,transitionEnd:o}}return{target:e,transitionEnd:o}};function Zi(t,e,n,o){return(t=>Object.keys(t).some(Ni))(e)?qi(t,e,n,o):{target:e,transitionEnd:o}}const Ki=(t,e,n,o)=>{const i=function(t,{...e},n){const o=t.current;if(!(o instanceof Element))return{target:e,transitionEnd:n};n&&(n={...n}),t.values.forEach(t=>{const e=t.get();if(!Oi(e))return;const n=Fi(e,o);n&&t.set(n)});for(const t in e){const i=e[t];if(!Oi(i))continue;const r=Fi(i,o);r&&(e[t]=r,n&&void 0===n[t]&&(n[t]=i))}return{target:e,transitionEnd:n}}(t,e,o);return Zi(t,e=i.target,n,o=i.transitionEnd)},_i={current:null},Ji={current:!1};function Qi(){if(Ji.current=!0,c)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>_i.current=t.matches;t.addListener(e),e()}else _i.current=!1}const tr=Object.keys(T),er=tr.length,nr=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class or{constructor({parent:t,props:e,reducedMotionConfig:n,visualState:o},i={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.isPresent=!0,this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.scheduleRender=()=>Ce.render(this.render,!1,!0);const{latestValues:r,renderState:s}=o;this.latestValues=r,this.baseTarget={...r},this.initialValues=e.initial?{...r}:{},this.renderState=s,this.parent=t,this.props=e,this.depth=t?t.depth+1:0,this.reducedMotionConfig=n,this.options=i,this.isControllingVariants=y(e),this.isVariantNode=v(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:a,...l}=this.scrapeMotionValuesFromProps(e,{});for(const t in l){const e=l[t];void 0!==r[t]&&z(e)&&(e.set(r[t],!1),vn(a)&&a.add(t))}}scrapeMotionValuesFromProps(t,e){return{}}mount(t){var e;this.current=t,this.projection&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=null===(e=this.parent)||void 0===e?void 0:e.addVariantChild(this)),this.values.forEach((t,e)=>this.bindToMotionValue(e,t)),Ji.current||Qi(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||_i.current),this.parent&&this.parent.children.add(this),this.setProps(this.props)}unmount(){var t,e,n;null===(t=this.projection)||void 0===t||t.unmount(),Me.update(this.notifyUpdate),Me.render(this.render),this.valueSubscriptions.forEach(t=>t()),null===(e=this.removeFromVariantTree)||void 0===e||e.call(this),null===(n=this.parent)||void 0===n||n.children.delete(this);for(const t in this.events)this.events[t].clear();this.current=null}bindToMotionValue(t,e){const n=U.has(t),o=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&Ce.update(this.notifyUpdate,!1,!0),n&&this.projection&&(this.projection.isTransformDirty=!0)}),i=e.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(t,()=>{o(),i()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}loadFeatures({children:t,...n},o,i,r,s,a){const l=[];for(let t=0;t<er;t++){const o=tr[t],{isEnabled:i,Component:r}=T[o];i(n)&&r&&l.push(e.createElement(r,{key:o,...n,visualElement:this}))}if(!this.projection&&s){this.projection=new s(r,this.latestValues,this.parent&&this.parent.projection);const{layoutId:t,layout:e,drag:o,dragConstraints:i,layoutScroll:l,layoutRoot:u}=n;this.projection.setOptions({layoutId:t,layout:e,alwaysMeasureLayout:Boolean(o)||i&&p(i),visualElement:this,scheduleRender:()=>this.scheduleRender(),animationType:"string"==typeof e?e:"both",initialPromotionConfig:a,layoutScroll:l,layoutRoot:u})}return l}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}makeTargetAnimatable(t,e=!0){return this.makeTargetAnimatableFromInstance(t,this.props,e)}setProps(t){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender();const e=this.props;this.props=t;for(let e=0;e<nr.length;e++){const n=nr[e];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);const o=t["on"+n];o&&(this.propEventSubscriptions[n]=this.on(n,o))}this.prevMotionValues=function(t,e,n){const{willChange:o}=e;for(const i in e){const r=e[i],s=n[i];if(z(r))t.addValue(i,r),vn(o)&&o.add(i);else if(z(s))t.addValue(i,Ue(r,{owner:t})),vn(o)&&o.remove(i);else if(s!==r)if(t.hasValue(i)){const e=t.getValue(i);!e.hasAnimated&&e.set(r)}else{const e=t.getStaticValue(i);t.addValue(i,Ue(void 0!==e?e:r,{owner:t}))}}for(const o in n)void 0===e[o]&&t.removeValue(o);return e}(this,this.scrapeMotionValuesFromProps(t,e),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){var e;return null===(e=this.props.variants)||void 0===e?void 0:e[t]}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){var t;return this.isVariantNode?this:null===(t=this.parent)||void 0===t?void 0:t.getClosestVariantNode()}getVariantContext(t=!1){var e,n;if(t)return null===(e=this.parent)||void 0===e?void 0:e.getVariantContext();if(!this.isControllingVariants){const t=(null===(n=this.parent)||void 0===n?void 0:n.getVariantContext())||{};return void 0!==this.props.initial&&(t.initial=this.props.initial),t}const o={};for(let t=0;t<rr;t++){const e=ir[t],n=this.props[e];(f(n)||!1===n)&&(o[e]=n)}return o}addVariantChild(t){var e;const n=this.getClosestVariantNode();if(n)return null===(e=n.variantChildren)||void 0===e||e.add(t),()=>n.variantChildren.delete(t)}addValue(t,e){e!==this.values.get(t)&&(this.removeValue(t),this.bindToMotionValue(t,e)),this.values.set(t,e),this.latestValues[t]=e.get()}removeValue(t){var e;this.values.delete(t),null===(e=this.valueSubscriptions.get(t))||void 0===e||e(),this.valueSubscriptions.delete(t),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return void 0===n&&void 0!==e&&(n=Ue(e,{owner:this}),this.addValue(t,n)),n}readValue(t){return void 0===this.latestValues[t]&&this.current?this.readValueFromInstance(this.current,t,this.options):this.latestValues[t]}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){var e;const{initial:n}=this.props,o="string"==typeof n||"object"==typeof n?null===(e=It(this.props,n))||void 0===e?void 0:e[t]:void 0;if(n&&void 0!==o)return o;const i=this.getBaseTargetFromProps(this.props,t);return void 0===i||z(i)?void 0!==this.initialValues[t]&&void 0===o?void 0:this.baseTarget[t]:i}on(t,e){return this.events[t]||(this.events[t]=new Oe),this.events[t].add(e)}notify(t,...e){var n;null===(n=this.events[t])||void 0===n||n.notify(...e)}}const ir=["initial",...Uo],rr=ir.length;class sr extends or{sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){var n;return null===(n=t.style)||void 0===n?void 0:n[e]}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}makeTargetAnimatableFromInstance({transition:t,transitionEnd:e,...n},{transformValues:o},i){let r=yn(n,t||{},this);if(o&&(e&&(e=o(e)),n&&(n=o(n)),r&&(r=o(r))),i){mn(this,n,r);const t=Ki(this,n,r,e);e=t.transitionEnd,n=t.target}return{transition:t,transitionEnd:e,...n}}}class ar extends sr{readValueFromInstance(t,e){if(U.has(e)){const t=on(e);return t&&t.default||0}{const o=(n=t,window.getComputedStyle(n)),i=(Y(e)?o.getPropertyValue(e):o[e])||0;return"string"==typeof i?i.trim():i}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return Li(t,e)}build(t,e,n,o){ht(t,e,n,o.transformTemplate)}scrapeMotionValuesFromProps(t,e){return kt(t,e)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;z(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=""+t)}))}renderInstance(t,e,n,o){Rt(t,e,n,o)}}class lr extends sr{constructor(){super(...arguments),this.isSVGTag=!1}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){var n;return U.has(e)?(null===(n=on(e))||void 0===n?void 0:n.default)||0:(e=Lt.has(e)?e:Mt(e),t.getAttribute(e))}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}scrapeMotionValuesFromProps(t,e){return Bt(t,e)}build(t,e,n,o){Pt(t,e,n,this.isSVGTag,o.transformTemplate)}renderInstance(t,e,n,o){Dt(t,e,0,o)}mount(t){this.isSVGTag=St(t.tagName),super.mount(t)}}const ur=(t,e)=>I(t)?new lr(e,{enableHardwareAcceleration:!1}):new ar(e,{enableHardwareAcceleration:!0});function cr(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const hr={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!rt.test(t))return t;t=parseFloat(t)}return`${cr(t,e.target.x)}% ${cr(t,e.target.y)}%`}},dr={correct:(t,{treeScale:e,projectionDelta:n})=>{const o=t,i=t.includes("var("),r=[];i&&(t=t.replace(ji,t=>(r.push(t),"_$css")));const s=_e.parse(t);if(s.length>5)return o;const a=_e.createTransformer(t),l="number"!=typeof s[0]?1:0,u=n.x.scale*e.x,c=n.y.scale*e.y;s[0+l]/=u,s[1+l]/=c;const h=Vn(u,c,.5);"number"==typeof s[2+l]&&(s[2+l]/=h),"number"==typeof s[3+l]&&(s[3+l]/=h);let d=a(s);if(i){let t=0;d=d.replace("_$css",()=>{const e=r[t];return t++,e})}return d}};class pr extends i.default.Component{componentDidMount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n,layoutId:o}=this.props,{projection:i}=t;j(fr),i&&(e.group&&e.group.add(i),n&&n.register&&o&&n.register(i),i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,onExitComplete:()=>this.safeToRemove()})),A.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:e,visualElement:n,drag:o,isPresent:i}=this.props,r=n.projection;return r?(r.isPresent=i,o||t.layoutDependency!==e||void 0===e?r.willUpdate():this.safeToRemove(),t.isPresent!==i&&(i?r.promote():r.relegate()||Ce.postRender(()=>{var t;(null===(t=r.getStack())||void 0===t?void 0:t.members.length)||this.safeToRemove()})),null):null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),!t.currentAnimation&&t.isLead()&&this.safeToRemove())}componentWillUnmount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n}=this.props,{projection:o}=t;o&&(o.scheduleCheckAfterUnmount(),(null==e?void 0:e.group)&&e.group.remove(o),(null==n?void 0:n.deregister)&&n.deregister(o))}safeToRemove(){const{safeToRemove:t}=this.props;null==t||t()}render(){return null}}const fr={borderRadius:{...hr,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:hr,borderTopRightRadius:hr,borderBottomLeftRadius:hr,borderBottomRightRadius:hr,boxShadow:dr},mr={measureLayout:function(t){const[n,o]=ye(),r=e.useContext(V);return i.default.createElement(pr,{...t,layoutGroup:r,switchLayoutGroup:e.useContext(M),isPresent:n,safeToRemove:o})}};function gr(t,e,n={}){const o=z(t)?t:Ue(t);return o.start(ko("",o,e,n)),{stop:()=>o.stop(),isAnimating:()=>o.isAnimating()}}const yr=["TopLeft","TopRight","BottomLeft","BottomRight"],vr=yr.length,xr=t=>"string"==typeof t?parseFloat(t):t,Er=t=>"number"==typeof t||rt.test(t);function wr(t,e){return void 0!==t[e]?t[e]:t.borderRadius}const Tr=Pr(0,.5,Yn),br=Pr(.5,.95,zn);function Pr(t,e,n){return o=>o<t?0:o>e?1:n(jn(t,e,o))}function Ar(t,e){t.min=e.min,t.max=e.max}function Sr(t,e){Ar(t.x,e.x),Ar(t.y,e.y)}function Vr(t,e,n,o,i){return t=wi(t-=e,1/n,o),void 0!==i&&(t=wi(t,1/i,o)),t}function Cr(t,e,[n,o,i],r,s){!function(t,e=0,n=1,o=.5,i,r=t,s=t){if(it.test(e)){e=parseFloat(e);e=Vn(s.min,s.max,e/100)-s.min}if("number"!=typeof e)return;let a=Vn(r.min,r.max,o);t===r&&(a-=e),t.min=Vr(t.min,e,n,a,i),t.max=Vr(t.max,e,n,a,i)}(t,e[n],e[o],e[i],e.scale,r,s)}const Mr=["x","scaleX","originX"],Rr=["y","scaleY","originY"];function Lr(t,e,n,o){Cr(t.x,e,Mr,null==n?void 0:n.x,null==o?void 0:o.x),Cr(t.y,e,Rr,null==n?void 0:n.y,null==o?void 0:o.y)}function Dr(t){return 0===t.translate&&1===t.scale}function kr(t){return Dr(t.x)&&Dr(t.y)}function Br(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 Ir(t){return ei(t.x)/ei(t.y)}class Or{constructor(){this.members=[]}add(t){Be(this.members,t),t.scheduleRender()}remove(t){if(Ie(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const t=this.members[this.members.length-1];t&&this.promote(t)}}relegate(t){const e=this.members.findIndex(e=>t===e);if(0===e)return!1;let n;for(let t=e;t>=0;t--){const e=this.members[t];if(!1!==e.isPresent){n=e;break}}return!!n&&(this.promote(n),!0)}promote(t,e){var n;const o=this.lead;if(t!==o&&(this.prevLead=o,this.lead=t,t.show(),o)){o.instance&&o.scheduleRender(),t.scheduleRender(),t.resumeFrom=o,e&&(t.resumeFrom.preserveOpacity=!0),o.snapshot&&(t.snapshot=o.snapshot,t.snapshot.latestValues=o.animationValues||o.latestValues),(null===(n=t.root)||void 0===n?void 0:n.isUpdating)&&(t.isLayoutDirty=!0);const{crossfade:i}=t.options;!1===i&&o.hide()}}exitAnimationComplete(){this.members.forEach(t=>{var e,n,o,i,r;null===(n=(e=t.options).onExitComplete)||void 0===n||n.call(e),null===(r=null===(o=t.resumingFrom)||void 0===o?void 0:(i=o.options).onExitComplete)||void 0===r||r.call(i)})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function jr(t,e,n){let o="";const i=t.x.translate/e.x,r=t.y.translate/e.y;if((i||r)&&(o=`translate3d(${i}px, ${r}px, 0) `),1===e.x&&1===e.y||(o+=`scale(${1/e.x}, ${1/e.y}) `),n){const{rotate:t,rotateX:e,rotateY:i}=n;t&&(o+=`rotate(${t}deg) `),e&&(o+=`rotateX(${e}deg) `),i&&(o+=`rotateY(${i}deg) `)}const s=t.x.scale*e.x,a=t.y.scale*e.y;return 1===s&&1===a||(o+=`scale(${s}, ${a})`),o||"none"}const Fr=(t,e)=>t.depth-e.depth;class Ur{constructor(){this.children=[],this.isDirty=!1}add(t){Be(this.children,t),this.isDirty=!0}remove(t){Ie(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Fr),this.isDirty=!1,this.children.forEach(t)}}const Nr=["","X","Y","Z"];let zr=0;function Wr({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:o,resetTransform:i}){return class{constructor(t,n={},o=(null==e?void 0:e())){this.id=zr++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isTransformDirty=!1,this.isProjectionDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.potentialNodes=new Map,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.nodes.forEach(Yr),this.nodes.forEach(Kr),this.nodes.forEach(_r)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.elementId=t,this.latestValues=n,this.root=o?o.root||o:this,this.path=o?[...o.path,o]:[],this.parent=o,this.depth=o?o.depth+1:0,t&&this.root.registerPotentialNode(t,this);for(let t=0;t<this.path.length;t++)this.path[t].shouldResetTransform=!0;this.root===this&&(this.nodes=new Ur)}addEventListener(t,e){return this.eventHandlers.has(t)||this.eventHandlers.set(t,new Oe),this.eventHandlers.get(t).add(e)}notifyListeners(t,...e){const n=this.eventHandlers.get(t);null==n||n.notify(...e)}hasListeners(t){return this.eventHandlers.has(t)}registerPotentialNode(t,e){this.potentialNodes.set(t,e)}mount(e,n=!1){var o;if(this.instance)return;this.isSVG=e instanceof SVGElement&&"svg"!==e.tagName,this.instance=e;const{layoutId:i,layout:r,visualElement:s}=this.options;if(s&&!s.current&&s.mount(e),this.root.nodes.add(this),null===(o=this.parent)||void 0===o||o.children.add(this),this.elementId&&this.root.potentialNodes.delete(this.elementId),n&&(r||i)&&(this.isLayoutDirty=!0),t){let n;const o=()=>this.root.updateBlockedByResize=!1;t(e,()=>{this.root.updateBlockedByResize=!0,n&&n(),n=wo(o,250),A.hasAnimatedSinceResize&&(A.hasAnimatedSinceResize=!1,this.nodes.forEach(Zr))})}i&&this.root.registerSharedNode(i,this),!1!==this.options.animate&&s&&(i||r)&&this.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e,hasRelativeTargetChanged:n,layout:o})=>{var i,r,a,l,u;if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const c=null!==(r=null!==(i=this.options.transition)&&void 0!==i?i:s.getDefaultTransition())&&void 0!==r?r:os,{onLayoutAnimationStart:h,onLayoutAnimationComplete:d}=s.getProps(),p=!this.targetLayout||!Br(this.targetLayout,o)||n,f=!e&&n;if(this.options.layoutRoot||(null===(a=this.resumeFrom)||void 0===a?void 0:a.instance)||f||e&&(p||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(t,f);const e={...Do(c,"layout"),onPlay:h,onComplete:d};(s.shouldReduceMotion||this.options.layoutRoot)&&(e.delay=0,e.type=!1),this.startAnimation(e)}else e||0!==this.animationProgress||Zr(this),this.isLead()&&(null===(u=(l=this.options).onExitComplete)||void 0===u||u.call(l));this.targetLayout=o})}unmount(){var t,e;this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this),null===(t=this.getStack())||void 0===t||t.remove(this),null===(e=this.parent)||void 0===e||e.children.delete(this),this.instance=void 0,Me.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(Jr),this.animationId++)}getTransformTemplate(){var t;return null===(t=this.options.visualElement)||void 0===t?void 0:t.getProps().transformTemplate}willUpdate(t=!0){var e,n,o;if(this.root.isUpdateBlocked())return void(null===(n=(e=this.options).onExitComplete)||void 0===n||n.call(e));if(!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let t=0;t<this.path.length;t++){const e=this.path[t];e.shouldResetTransform=!0,e.updateScroll("snapshot"),e.options.layoutRoot&&e.willUpdate(!1)}const{layoutId:i,layout:r}=this.options;(void 0!==i||r)&&(this.prevTransformTemplateValue=null===(o=this.getTransformTemplate())||void 0===o?void 0:o(this.latestValues,""),this.updateSnapshot(),t&&this.notifyListeners("willUpdate"))}didUpdate(){if(this.isUpdateBlocked())return this.unblockUpdate(),this.clearAllSnapshots(),void this.nodes.forEach(Gr);this.isUpdating&&(this.isUpdating=!1,this.potentialNodes.size&&(this.potentialNodes.forEach(is),this.potentialNodes.clear()),this.nodes.forEach(qr),this.nodes.forEach(Hr),this.nodes.forEach($r),this.clearAllSnapshots(),Re.update(),Re.preRender(),Re.render())}clearAllSnapshots(){this.nodes.forEach(Xr),this.sharedNodes.forEach(Qr)}scheduleUpdateProjection(){Ce.preRender(this.updateProjection,!1,!0)}scheduleCheckAfterUnmount(){Ce.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure())}updateLayout(){var t;if(!this.instance)return;if(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let t=0;t<this.path.length;t++){this.path[t].updateScroll()}const e=this.layout;this.layout=this.measure(!1),this.layoutCorrected={x:{min:0,max:0},y:{min:0,max:0}},this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox),null===(t=this.options.visualElement)||void 0===t||t.notify("LayoutMeasure",this.layout.layoutBox,null==e?void 0:e.layoutBox)}updateScroll(t="measure"){let e=Boolean(this.options.layoutScroll&&this.instance);this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===t&&(e=!1),e&&(this.scroll={animationId:this.root.animationId,phase:t,isRoot:o(this.instance),offset:n(this.instance)})}resetTransform(){var t;if(!i)return;const e=this.isLayoutDirty||this.shouldResetTransform,n=this.projectionDelta&&!kr(this.projectionDelta),o=null===(t=this.getTransformTemplate())||void 0===t?void 0:t(this.latestValues,""),r=o!==this.prevTransformTemplateValue;e&&(n||vi(this.latestValues)||r)&&(i(this.instance,o),this.shouldResetTransform=!1,this.scheduleRender())}measure(t=!0){const e=this.measurePageBox();let n=this.removeElementScroll(e);var o;return t&&(n=this.removeTransform(n)),rs((o=n).x),rs(o.y),{animationId:this.root.animationId,measuredBox:e,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:t}=this.options;if(!t)return{x:{min:0,max:0},y:{min:0,max:0}};const e=t.measureViewportBox(),{scroll:n}=this.root;return n&&(Si(e.x,n.offset.x),Si(e.y,n.offset.y)),e}removeElementScroll(t){const e={x:{min:0,max:0},y:{min:0,max:0}};Sr(e,t);for(let n=0;n<this.path.length;n++){const o=this.path[n],{scroll:i,options:r}=o;if(o!==this.root&&i&&r.layoutScroll){if(i.isRoot){Sr(e,t);const{scroll:n}=this.root;n&&(Si(e.x,-n.offset.x),Si(e.y,-n.offset.y))}Si(e.x,i.offset.x),Si(e.y,i.offset.y)}}return e}applyTransform(t,e=!1){const n={x:{min:0,max:0},y:{min:0,max:0}};Sr(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&&Ri(n,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),vi(o.latestValues)&&Ri(n,o.latestValues)}return vi(this.latestValues)&&Ri(n,this.latestValues),n}removeTransform(t){var e;const n={x:{min:0,max:0},y:{min:0,max:0}};Sr(n,t);for(let t=0;t<this.path.length;t++){const o=this.path[t];if(!o.instance)continue;if(!vi(o.latestValues))continue;yi(o.latestValues)&&o.updateSnapshot();const i={x:{min:0,max:0},y:{min:0,max:0}};Sr(i,o.measurePageBox()),Lr(n,o.latestValues,null===(e=o.snapshot)||void 0===e?void 0:e.layoutBox,i)}return vi(this.latestValues)&&Lr(n,this.latestValues),n}setTargetDelta(t){this.targetDelta=t,this.isProjectionDirty=!0,this.root.scheduleUpdateProjection()}setOptions(t){this.options={...this.options,...t,crossfade:void 0===t.crossfade||t.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}resolveTargetDelta(){var t;const e=this.getLead();if(this.isProjectionDirty||(this.isProjectionDirty=e.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=e.isTransformDirty),!this.isProjectionDirty&&!this.attemptToResolveRelativeTarget)return;const{layout:n,layoutId:o}=this.options;if(this.layout&&(n||o)){if(!this.targetDelta&&!this.relativeTarget){const t=this.getClosestProjectingParent();t&&t.layout?(this.relativeParent=t,this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},ai(this.relativeTargetOrigin,this.layout.layoutBox,t.layout.layoutBox),Sr(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}var i,r,s;if(this.relativeTarget||this.targetDelta)if(this.target||(this.target={x:{min:0,max:0},y:{min:0,max:0}},this.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}}),this.relativeTarget&&this.relativeTargetOrigin&&(null===(t=this.relativeParent)||void 0===t?void 0:t.target)?(i=this.target,r=this.relativeTarget,s=this.relativeParent.target,ri(i.x,r.x,s.x),ri(i.y,r.y,s.y)):this.targetDelta?(Boolean(this.resumingFrom)?this.target=this.applyTransform(this.layout.layoutBox):Sr(this.target,this.layout.layoutBox),Pi(this.target,this.targetDelta)):Sr(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const t=this.getClosestProjectingParent();t&&Boolean(t.resumingFrom)===Boolean(this.resumingFrom)&&!t.options.layoutScroll&&t.target?(this.relativeParent=t,this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},ai(this.relativeTargetOrigin,this.target,t.target),Sr(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(this.parent&&!yi(this.parent.latestValues)&&!xi(this.parent.latestValues))return(this.parent.relativeTarget||this.parent.targetDelta||this.parent.options.layoutRoot)&&this.parent.layout?this.parent:this.parent.getClosestProjectingParent()}calcProjection(){var t;const{isProjectionDirty:e,isTransformDirty:n}=this;this.isProjectionDirty=this.isTransformDirty=!1;const o=this.getLead(),i=Boolean(this.resumingFrom)||this!==o;let r=!0;if(e&&(r=!1),i&&n&&(r=!1),r)return;const{layout:s,layoutId:a}=this.options;if(this.isTreeAnimating=Boolean((null===(t=this.parent)||void 0===t?void 0:t.isTreeAnimating)||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!s&&!a)return;Sr(this.layoutCorrected,this.layout.layoutBox),function(t,e,n,o=!1){var i,r;const s=n.length;if(!s)return;let a,l;e.x=e.y=1;for(let u=0;u<s;u++)a=n[u],l=a.projectionDelta,"contents"!==(null===(r=null===(i=a.instance)||void 0===i?void 0:i.style)||void 0===r?void 0:r.display)&&(o&&a.options.layoutScroll&&a.scroll&&a!==a.root&&Ri(t,{x:-a.scroll.offset.x,y:-a.scroll.offset.y}),l&&(e.x*=l.x.scale,e.y*=l.y.scale,Pi(t,l)),o&&vi(a.latestValues)&&Ri(t,a.latestValues));e.x=Ai(e.x),e.y=Ai(e.y)}(this.layoutCorrected,this.treeScale,this.path,i);const{target:l}=o;if(!l)return;this.projectionDelta||(this.projectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDeltaWithTransform={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}});const u=this.treeScale.x,c=this.treeScale.y,h=this.projectionTransform;ii(this.projectionDelta,this.layoutCorrected,l,this.latestValues),this.projectionTransform=jr(this.projectionDelta,this.treeScale),this.projectionTransform===h&&this.treeScale.x===u&&this.treeScale.y===c||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",l))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(t=!0){var e,n,o;null===(n=(e=this.options).scheduleRender)||void 0===n||n.call(e),t&&(null===(o=this.getStack())||void 0===o||o.scheduleRender()),this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}setAnimationOrigin(t,e=!1){var n,o;const i=this.snapshot,r=(null==i?void 0:i.latestValues)||{},s={...this.latestValues},a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!e;const l={x:{min:0,max:0},y:{min:0,max:0}},u=(null==i?void 0:i.source)!==(null===(n=this.layout)||void 0===n?void 0:n.source),c=((null===(o=this.getStack())||void 0===o?void 0:o.members.length)||0)<=1,h=Boolean(u&&!c&&!0===this.options.crossfade&&!this.path.some(ns));this.animationProgress=0,this.mixTargetDelta=e=>{var n;const o=e/1e3;var i,d,p,f;ts(a.x,t.x,o),ts(a.y,t.y,o),this.setTargetDelta(a),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&(null===(n=this.relativeParent)||void 0===n?void 0:n.layout)&&(ai(l,this.layout.layoutBox,this.relativeParent.layout.layoutBox),i=this.relativeTarget,d=this.relativeTargetOrigin,p=l,f=o,es(i.x,d.x,p.x,f),es(i.y,d.y,p.y,f)),u&&(this.animationValues=s,function(t,e,n,o,i,r){i?(t.opacity=Vn(0,void 0!==n.opacity?n.opacity:1,Tr(o)),t.opacityExit=Vn(void 0!==e.opacity?e.opacity:1,0,br(o))):r&&(t.opacity=Vn(void 0!==e.opacity?e.opacity:1,void 0!==n.opacity?n.opacity:1,o));for(let i=0;i<vr;i++){const r=`border${yr[i]}Radius`;let s=wr(e,r),a=wr(n,r);if(void 0===s&&void 0===a)continue;s||(s=0),a||(a=0);0===s||0===a||Er(s)===Er(a)?(t[r]=Math.max(Vn(xr(s),xr(a),o),0),(it.test(a)||it.test(s))&&(t[r]+="%")):t[r]=a}(e.rotate||n.rotate)&&(t.rotate=Vn(e.rotate||0,n.rotate||0,o))}(s,r,this.latestValues,o,h,c)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=o},this.mixTargetDelta(this.options.layoutRoot?1e3: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&&(Me.update(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Ce.update(()=>{A.hasAnimatedSinceResize=!0,this.currentAnimation=gr(0,1e3,{...t,onUpdate:e=>{var n;this.mixTargetDelta(e),null===(n=t.onUpdate)||void 0===n||n.call(t,e)},onComplete:()=>{var e;null===(e=t.onComplete)||void 0===e||e.call(t),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){var t;this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0),null===(t=this.getStack())||void 0===t||t.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){var t;this.currentAnimation&&(null===(t=this.mixTargetDelta)||void 0===t||t.call(this,1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const t=this.getLead();let{targetWithTransforms:e,target:n,layout:o,latestValues:i}=t;if(e&&n&&o){if(this!==t&&this.layout&&o&&ss(this.options.animationType,this.layout.layoutBox,o.layoutBox)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const e=ei(this.layout.layoutBox.x);n.x.min=t.target.x.min,n.x.max=n.x.min+e;const o=ei(this.layout.layoutBox.y);n.y.min=t.target.y.min,n.y.max=n.y.min+o}Sr(e,n),Ri(e,i),ii(this.projectionDeltaWithTransform,this.layoutCorrected,e,i)}}registerSharedNode(t,e){var n,o,i;this.sharedNodes.has(t)||this.sharedNodes.set(t,new Or);this.sharedNodes.get(t).add(e),e.promote({transition:null===(n=e.options.initialPromotionConfig)||void 0===n?void 0:n.transition,preserveFollowOpacity:null===(i=null===(o=e.options.initialPromotionConfig)||void 0===o?void 0:o.shouldPreserveFollowOpacity)||void 0===i?void 0:i.call(o,e)})}isLead(){const t=this.getStack();return!t||t.lead===this}getLead(){var t;const{layoutId:e}=this.options;return e&&(null===(t=this.getStack())||void 0===t?void 0:t.lead)||this}getPrevLead(){var t;const{layoutId:e}=this.options;return e?null===(t=this.getStack())||void 0===t?void 0:t.prevLead:void 0}getStack(){const{layoutId:t}=this.options;if(t)return this.root.sharedNodes.get(t)}promote({needsReset:t,transition:e,preserveFollowOpacity:n}={}){const o=this.getStack();o&&o.promote(this,n),t&&(this.projectionDelta=void 0,this.needsReset=!0),e&&this.setOptions({transition:e})}relegate(){const t=this.getStack();return!!t&&t.relegate(this)}resetRotation(){const{visualElement:t}=this.options;if(!t)return;let e=!1;const{latestValues:n}=t;if((n.rotate||n.rotateX||n.rotateY||n.rotateZ)&&(e=!0),!e)return;const o={};for(let e=0;e<Nr.length;e++){const i="rotate"+Nr[e];n[i]&&(o[i]=n[i],t.setStaticValue(i,0))}null==t||t.render();for(const e in o)t.setStaticValue(e,o[e]);t.scheduleRender()}getProjectionStyles(t={}){var e,n;const o={};if(!this.instance||this.isSVG)return o;if(!this.isVisible)return{visibility:"hidden"};o.visibility="";const i=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,o.opacity="",o.pointerEvents=jt(t.pointerEvents)||"",o.transform=i?i(this.latestValues,""):"none",o;const r=this.getLead();if(!this.projectionDelta||!this.layout||!r.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&&!vi(this.latestValues)&&(e.transform=i?i({},""):"none",this.hasProjected=!1),e}const s=r.animationValues||r.latestValues;this.applyTransformsToTarget(),o.transform=jr(this.projectionDeltaWithTransform,this.treeScale,s),i&&(o.transform=i(s,o.transform));const{x:a,y:l}=this.projectionDelta;o.transformOrigin=`${100*a.origin}% ${100*l.origin}% 0`,r.animationValues?o.opacity=r===this?null!==(n=null!==(e=s.opacity)&&void 0!==e?e:this.latestValues.opacity)&&void 0!==n?n:1:this.preserveOpacity?this.latestValues.opacity:s.opacityExit:o.opacity=r===this?void 0!==s.opacity?s.opacity:"":void 0!==s.opacityExit?s.opacityExit:0;for(const t in O){if(void 0===s[t])continue;const{correct:e,applyTo:n}=O[t],i="none"===o.transform?s[t]:e(s[t],r);if(n){const t=n.length;for(let e=0;e<t;e++)o[n[e]]=i}else o[t]=i}return this.options.layoutId&&(o.pointerEvents=r===this?jt(t.pointerEvents)||"":"none"),o}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(Gr),this.root.sharedNodes.clear()}}}function Hr(t){t.updateLayout()}function $r(t){var e,n,o;const i=(null===(e=t.resumeFrom)||void 0===e?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&i&&t.hasListeners("didUpdate")){const{layoutBox:e,measuredBox:n}=t.layout,{animationType:o}=t.options,r=i.source!==t.layout.source;"size"===o?fi(t=>{const n=r?i.measuredBox[t]:i.layoutBox[t],o=ei(n);n.min=e[t].min,n.max=n.min+o}):ss(o,i.layoutBox,e)&&fi(t=>{const n=r?i.measuredBox[t]:i.layoutBox[t],o=ei(e[t]);n.max=n.min+o});const s={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};ii(s,e,i.layoutBox);const a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};r?ii(a,t.applyTransform(n,!0),i.measuredBox):ii(a,e,i.layoutBox);const l=!kr(s);let u=!1;if(!t.resumeFrom){const n=t.getClosestProjectingParent();if(n&&!n.resumeFrom){const{snapshot:o,layout:r}=n;if(o&&r){const s={x:{min:0,max:0},y:{min:0,max:0}};ai(s,i.layoutBox,o.layoutBox);const a={x:{min:0,max:0},y:{min:0,max:0}};ai(a,e,r.layoutBox),Br(s,a)||(u=!0),n.options.layoutRoot&&(t.relativeTarget=a,t.relativeTargetOrigin=s,t.relativeParent=n)}}}t.notifyListeners("didUpdate",{layout:e,snapshot:i,delta:a,layoutDelta:s,hasLayoutChanged:l,hasRelativeTargetChanged:u})}else t.isLead()&&(null===(o=(n=t.options).onExitComplete)||void 0===o||o.call(n));t.options.transition=void 0}function Yr(t){t.isProjectionDirty||(t.isProjectionDirty=Boolean(t.parent&&t.parent.isProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=Boolean(t.parent&&t.parent.isTransformDirty))}function Xr(t){t.clearSnapshot()}function Gr(t){t.clearMeasurements()}function qr(t){const{visualElement:e}=t.options;(null==e?void 0:e.getProps().onBeforeLayoutMeasure)&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Zr(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0}function Kr(t){t.resolveTargetDelta()}function _r(t){t.calcProjection()}function Jr(t){t.resetRotation()}function Qr(t){t.removeLeadSnapshot()}function ts(t,e,n){t.translate=Vn(e.translate,0,n),t.scale=Vn(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function es(t,e,n,o){t.min=Vn(e.min,n.min,o),t.max=Vn(e.max,n.max,o)}function ns(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}const os={duration:.45,ease:[.4,0,.1,1]};function is(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 rs(t){t.min=Math.round(t.min),t.max=Math.round(t.max)}function ss(t,e,n){return"position"===t||"preserve-aspect"===t&&!ni(Ir(e),Ir(n),.2)}const as=Wr({attachResizeListener:(t,e)=>$t(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),ls={current:void 0},us=Wr({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!ls.current){const t=new as(0,{});t.mount(window),t.setOptions({layoutScroll:!0}),ls.current=t}return ls.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)}),cs={...Yo,...ge,...Ii,...mr},hs=k((t,e)=>Wt(t,e,cs,ur,us));const ds=k(Wt);function ps(){const t=e.useRef(!1);return h(()=>(t.current=!0,()=>{t.current=!1}),[]),t}function fs(){const t=ps(),[n,o]=e.useState(0),i=e.useCallback(()=>{t.current&&o(n+1)},[n]);return[e.useCallback(()=>Ce.postRender(i),[i]),n]}class ms extends r.Component{getSnapshotBeforeUpdate(t){const e=this.props.childRef.current;if(e&&t.isPresent&&!this.props.isPresent){const t=this.props.sizeRef.current;t.height=e.offsetHeight||0,t.width=e.offsetWidth||0,t.top=e.offsetTop,t.left=e.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function gs({children:t,isPresent:n}){const o=e.useId(),i=e.useRef(null),s=e.useRef({width:0,height:0,top:0,left:0});return e.useInsertionEffect(()=>{const{width:t,height:e,top:r,left:a}=s.current;if(n||!i.current||!t||!e)return;i.current.dataset.motionPopId=o;const l=document.createElement("style");return document.head.appendChild(l),l.sheet&&l.sheet.insertRule(`\n [data-motion-pop-id="${o}"] {\n position: absolute !important;\n width: ${t}px !important;\n height: ${e}px !important;\n top: ${r}px !important;\n left: ${a}px !important;\n }\n `),()=>{document.head.removeChild(l)}},[n]),r.createElement(ms,{isPresent:n,childRef:i,sizeRef:s},r.cloneElement(t,{ref:i}))}const ys=({children:t,initial:n,isPresent:o,onExitComplete:i,custom:s,presenceAffectsLayout:a,mode:l})=>{const c=P(vs),h=e.useId(),d=e.useMemo(()=>({id:h,initial:n,isPresent:o,custom:s,onExitComplete:t=>{c.set(t,!0);for(const t of c.values())if(!t)return;i&&i()},register:t=>(c.set(t,!1),()=>c.delete(t))}),a?void 0:[o]);return e.useMemo(()=>{c.forEach((t,e)=>c.set(e,!1))},[o]),r.useEffect(()=>{!o&&!c.size&&i&&i()},[o]),"popLayout"===l&&(t=r.createElement(gs,{isPresent:o},t)),r.createElement(u.Provider,{value:d},t)};function vs(){return new Map}const xs=t=>t.key||"";const Es=e.createContext(null),ws=t=>!t.isLayoutDirty&&t.willUpdate(!1);function Ts(){const t=new Set,e=new WeakMap,n=()=>t.forEach(ws);return{add:o=>{t.add(o),e.set(o,o.addEventListener("willUpdate",n))},remove:o=>{var i;t.delete(o),null===(i=e.get(o))||void 0===i||i(),e.delete(o),n()},dirty:n}}const bs=t=>!0===t,Ps=({children:t,id:n,inheritId:o,inherit:i=!0})=>{void 0!==o&&(i=o);const s=e.useContext(V),a=e.useContext(Es),[l,u]=fs(),c=e.useRef(null),h=s.id||a;null===c.current&&((t=>bs(!0===t)||"id"===t)(i)&&h&&(n=n?h+"-"+n:h),c.current={id:n,group:bs(i)&&s.group||Ts()});const d=e.useMemo(()=>({...c.current,forceRender:l}),[u]);return r.createElement(V.Provider,{value:d},t)};let As=0;function Ss(t){return"function"==typeof t}const Vs=e.createContext(null);const Cs=e.forwardRef((function({children:t,as:n="ul",axis:o="y",onReorder:i,values:s,...a},l){const u=P(()=>hs(n)),c=[],h=e.useRef(!1),d={axis:o,registerItem:(t,e)=>{e&&-1===c.findIndex(e=>t===e.value)&&(c.push({value:t,layout:e[o]}),c.sort(Rs))},updateOrder:(t,e,n)=>{if(h.current)return;const o=function(t,e,n,o){if(!o)return t;const i=t.findIndex(t=>t.value===e);if(-1===i)return t;const r=o>0?1:-1,s=t[i+r];if(!s)return t;const a=t[i],l=s.layout,u=Vn(l.min,l.max,.5);return 1===r&&a.layout.max+n>u||-1===r&&a.layout.min+n<u?function([...t],e,n){const o=e<0?t.length+e:e;if(o>=0&&o<t.length){const o=n<0?t.length+n:n,[i]=t.splice(e,1);t.splice(o,0,i)}return t}(t,i,i+r):t}(c,t,e,n);c!==o&&(h.current=!0,i(o.map(Ms).filter(t=>-1!==s.indexOf(t))))}};return e.useEffect(()=>{h.current=!1}),r.createElement(u,{...a,ref:l},r.createElement(Vs.Provider,{value:d},t))}));function Ms(t){return t.value}function Rs(t,e){return t.layout.min-e.layout.min}function Ls(t){const n=P(()=>Ue(t)),{isStatic:o}=e.useContext(s);if(o){const[,o]=e.useState(t);e.useEffect(()=>n.on("change",o),[])}return n}function Ds(...t){const e=!Array.isArray(t[0]),n=e?0:-1,o=t[0+n],i=t[1+n],r=t[2+n],s=t[3+n],a=Nn(i,r,{mixer:(l=r[0],(t=>"object"==typeof t&&t.mix)(l)?l.mix:void 0),...s});var l;return e?a(o):a}function ks(t,e){const n=Ls(e()),o=()=>n.set(e());return o(),h(()=>{const e=()=>Ce.update(o,!1,!0),n=t.map(t=>t.on("change",e));return()=>{n.forEach(t=>t()),Me.update(o)}}),n}function Bs(t,e,n,o){const i="function"==typeof e?e:Ds(e,n,o);return Array.isArray(t)?Is(t,i):Is([t],([t])=>i(t))}function Is(t,e){const n=P(()=>[]);return ks(t,()=>{n.length=0;const o=t.length;for(let e=0;e<o;e++)n[e]=t[e].get();return e(n)})}function Os(t,e=0){return z(t)?t:Ls(e)}const js={Group:Cs,Item:e.forwardRef((function({children:t,style:n={},value:o,as:i="li",onDrag:s,layout:a=!0,...l},u){const c=P(()=>hs(i)),h=e.useContext(Vs),d={x:Os(n.x),y:Os(n.y)},p=Bs([d.x,d.y],([t,e])=>t||e?1:"unset"),f=e.useRef(null),{axis:m,registerItem:g,updateOrder:y}=h;return e.useEffect(()=>{g(o,f.current)},[h]),r.createElement(c,{drag:m,...l,dragSnapToOrigin:!0,style:{...n,x:d.x,y:d.y,zIndex:p},layout:a,onDrag:(t,e)=>{const{velocity:n}=e;n[m]&&y(o,d[m].get(),n[m]),s&&s(t,e)},onLayoutMeasure:t=>{f.current=t},ref:u},t)}))},Fs={renderer:ur,...Yo,...ge},Us={...Fs,...Ii,...mr,projectionNodeConstructor:us};const Ns=t=>"number"==typeof t;function zs(t,e){return(t=>Array.isArray(t)&&!Ns(t[0]))(t)?t[((t,e,n)=>{const o=e-t;return((n-t)%o+o)%o+t})(0,t.length,e)]:t}const Ws=(t,e,n)=>-n*t+n*e+t,Hs=t=>t,$s=(t,e,n)=>e-t==0?1:(n-t)/(e-t);function Ys(t,e){const n=t[t.length-1];for(let o=1;o<=e;o++){const i=$s(0,e,o);t.push(Ws(n,1,i))}}function Xs(t){const e=[0];return Ys(e,t-1),e}function Gs(t,e=Xs(t.length),n=Hs){const o=t.length,i=o-e.length;return i>0&&Ys(e,i),i=>{let r=0;for(;r<o-2&&!(i<e[r+1]);r++);let s=(a=0,l=1,u=$s(e[r],e[r+1],i),Math.min(Math.max(u,a),l));var a,l,u;return s=zs(n,r)(s),Ws(t[r],t[r+1],s)}}const qs=t=>"function"==typeof t,Zs=t=>"string"==typeof t;function Ks(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 _s={any:0,all:1};const Js=new WeakMap;let Qs;function ta({target:t,contentRect:e,borderBoxSize:n}){var o;null===(o=Js.get(t))||void 0===o||o.forEach(o=>{o({target:t,contentSize:e,get size(){return function(t,e){if(e){const{inlineSize:t,blockSize:n}=e[0];return{width:t,height:n}}return t instanceof SVGElement&&"getBBox"in t?t.getBBox():{width:t.offsetWidth,height:t.offsetHeight}}(t,n)}})})}function ea(t){t.forEach(ta)}function na(t,e){Qs||"undefined"!=typeof ResizeObserver&&(Qs=new ResizeObserver(ea));const n=Ks(t);return n.forEach(t=>{let n=Js.get(t);n||(n=new Set,Js.set(t,n)),n.add(e),null==Qs||Qs.observe(t)}),()=>{n.forEach(t=>{const n=Js.get(t);null==n||n.delete(e),(null==n?void 0:n.size)||null==Qs||Qs.unobserve(t)})}}const oa=new Set;let ia;function ra(t){return oa.add(t),ia||(ia=()=>{const t={width:window.innerWidth,height:window.innerHeight},e={target:window,size:t,contentSize:t};oa.forEach(t=>t(e))},window.addEventListener("resize",ia)),()=>{oa.delete(t),!oa.size&&ia&&(ia=void 0)}}const sa={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}};function aa(t,e,n,o){const i=n[e],{length:r,position:s}=sa[e],a=i.current,l=n.time;i.current=t["scroll"+s],i.scrollLength=t["scroll"+r]-t["client"+r],i.offset.length=0,i.offset[0]=0,i.offset[1]=i.scrollLength,i.progress=$s(0,i.scrollLength,i.current);const u=o-l;var c,h;i.velocity=u>50?0:(c=i.current-a,(h=u)?c*(1e3/h):0)}const la={Enter:[[0,1],[1,1]],Exit:[[0,0],[1,0]],Any:[[1,0],[0,1]],All:[[0,0],[1,1]]},ua={start:0,center:.5,end:1};function ca(t,e,n=0){let o=0;if(void 0!==ua[t]&&(t=ua[t]),Zs(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 Ns(t)&&(o=e*t),n+o}const ha=[0,0];function da(t,e,n,o){let i=Array.isArray(t)?t:ha,r=0,s=0;return Ns(t)?i=[t,t]:Zs(t)&&(i=(t=t.trim()).includes(" ")?t.split(" "):[t,ua[t]?t:"0"]),r=ca(i[0],n,o),s=ca(i[1],e),r-s}const pa={x:0,y:0};function fa(t,e,n){let{offset:o=la.All}=n;const{target:i=t,axis:r="y"}=n,s="y"===r?"height":"width",a=i!==t?function(t,e){let n={x:0,y:0},o=t;for(;o&&o!==e;)if(o instanceof HTMLElement)n.x+=o.offsetLeft,n.y+=o.offsetTop,o=o.offsetParent;else if(o instanceof SVGGraphicsElement&&"getBBox"in o){const{top:t,left:e}=o.getBBox();for(n.x+=e,n.y+=t;o&&"svg"!==o.tagName;)o=o.parentNode}return n}(i,t):pa,l=i===t?{width:t.scrollWidth,height:t.scrollHeight}:{width:i.clientWidth,height:i.clientHeight},u={width:t.clientWidth,height:t.clientHeight};e[r].offset.length=0;let c=!e[r].interpolate;const h=o.length;for(let t=0;t<h;t++){const n=da(o[t],u[s],l[s],a[r]);c||n===e[r].interpolatorOffsets[t]||(c=!0),e[r].offset[t]=n}c&&(e[r].interpolate=Gs(Xs(h),e[r].offset),e[r].interpolatorOffsets=[...e[r].offset]),e[r].progress=e[r].interpolate(e[r].current)}function ma(t,e,n,o={}){const i=o.axis||"y";return{measure:()=>function(t,e=t,n){if(n.x.targetOffset=0,n.y.targetOffset=0,e!==t){let o=e;for(;o&&o!=t;)n.x.targetOffset+=o.offsetLeft,n.y.targetOffset+=o.offsetTop,o=o.offsetParent}n.x.targetLength=e===t?e.scrollWidth:e.clientWidth,n.y.targetLength=e===t?e.scrollHeight:e.clientHeight,n.x.containerLength=t.clientWidth,n.y.containerLength=t.clientHeight}(t,o.target,n),update:e=>{!function(t,e,n){aa(t,"x",e,n),aa(t,"y",e,n),e.time=n}(t,n,e),(o.offset||o.target)&&fa(t,n,o)},notify:qs(e)?()=>e(n):ga(e,n[i])}}function ga(t,e){return t.pause(),t.forEachNative((t,{easing:e})=>{var n,o;if(t.updateDuration)e||(t.easing=Hs),t.updateDuration(1);else{const i={duration:1e3};e||(i.easing="linear"),null===(o=null===(n=t.effect)||void 0===n?void 0:n.updateTiming)||void 0===o||o.call(n,i)}}),()=>{t.currentTime=e.progress}}const ya=new WeakMap,va=new WeakMap,xa=new WeakMap,Ea=t=>t===document.documentElement?window:t;function wa(t,e={}){var{container:n=document.documentElement}=e,o=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(t);i<o.length;i++)e.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(t,o[i])&&(n[o[i]]=t[o[i]])}return n}(e,["container"]);let i=xa.get(n);i||(i=new Set,xa.set(n,i));const r=ma(n,t,{time:0,x:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0},y:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0}},o);if(i.add(r),!ya.has(n)){const t=()=>{const t=performance.now();for(const t of i)t.measure();for(const e of i)e.update(t);for(const t of i)t.notify()};ya.set(n,t);const e=Ea(n);window.addEventListener("resize",t,{passive:!0}),n!==document.documentElement&&va.set(n,(a=t,qs(s=n)?ra(s):na(s,a))),e.addEventListener("scroll",t,{passive:!0})}var s,a;const l=ya.get(n),u=requestAnimationFrame(l);return()=>{var e;"function"!=typeof t&&t.stop(),cancelAnimationFrame(u);const o=xa.get(n);if(!o)return;if(o.delete(r),o.size)return;const i=ya.get(n);ya.delete(n),i&&(Ea(n).removeEventListener("scroll",i),null===(e=va.get(n))||void 0===e||e(),window.removeEventListener("resize",i))}}function Ta(t,e){Boolean(!e||e.current)}const ba=()=>({scrollX:Ue(0),scrollY:Ue(0),scrollXProgress:Ue(0),scrollYProgress:Ue(0)});function Pa({container:t,target:n,layoutEffect:o=!0,...i}={}){const r=P(ba);return(o?h:e.useEffect)(()=>(Ta(0,n),Ta(0,t),wa(({x:t,y:e})=>{r.scrollX.set(t.current),r.scrollXProgress.set(t.progress),r.scrollY.set(e.current),r.scrollYProgress.set(e.progress)},{...i,container:(null==t?void 0:t.current)||void 0,target:(null==n?void 0:n.current)||void 0})),[]),r}function Aa(t){const n=e.useRef(0),{isStatic:o}=e.useContext(s);e.useEffect(()=>{if(o)return;const e=({timestamp:e,delta:o})=>{n.current||(n.current=e),t(e-n.current,o)};return Ce.update(e,!0),()=>Me.update(e)},[t])}class Sa extends Fe{constructor(){super(...arguments),this.members=[],this.transforms=new Set}add(t){let e;U.has(t)?(this.transforms.add(t),e="transform"):t.startsWith("origin")||Y(t)||"willChange"===t||(e=Mt(t)),e&&(Be(this.members,e),this.update())}remove(t){U.has(t)?(this.transforms.delete(t),this.transforms.size||Ie(this.members,"transform")):Ie(this.members,Mt(t)),this.update()}update(){this.set(this.members.length?this.members.join(", "):"auto")}}function Va(){!Ji.current&&Qi();const[t]=e.useState(_i.current);return t}function Ca(){const t=new Set,e={subscribe:e=>(t.add(e),()=>{t.delete(e)}),start(e,n){const o=[];return t.forEach(t=>{o.push(Bo(t,e,{transitionOverride:n}))}),Promise.all(o)},set:e=>t.forEach(t=>{!function(t,e){Array.isArray(e)?fn(t,e):"string"==typeof e?fn(t,[e]):pn(t,e)}(t,e)}),stop(){t.forEach(t=>{!function(t){t.values.forEach(t=>t.stop())}(t)})},mount:()=>()=>{e.stop()}};return e}function Ma(){const t=P(Ca);return h(t.mount,[]),t}const Ra=Ma,La=(t,e,n)=>{const o=e-t;return((n-t)%o+o)%o+t};class Da{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 ka=()=>new Da;function Ba(t){return null!==t&&"object"==typeof t&&R in t}function Ia(){return Oa}function Oa(t){ls.current&&(ls.current.isUpdating=!1,ls.current.blockUpdate(),t&&t())}const ja=(t,e)=>`${t}: ${e}`,Fa=new Map;function Ua(t,e,n,o){const i=ja(t,U.has(e)?"transform":e),r=Fa.get(i);if(!r)return 0;const{animation:s,startTime:a}=r,l=()=>{Fa.delete(i);try{s.cancel()}catch(t){}};if(null!==a){const t=performance.now();return o.update(()=>{n.animation&&(n.animation.currentTime=performance.now()-t)}),o.render(l),t-a||0}return l(),0}const Na=()=>({});class za extends or{build(){}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}resetTransform(){}restoreTransform(){}removeValueFromRenderState(){}renderInstance(){}scrapeMotionValuesFromProps(){return{}}getBaseTargetFromProps(){}readValueFromInstance(t,e,n){return n.initialState[e]||0}sortInstanceNodePosition(){return 0}makeTargetAnimatableFromInstance({transition:t,transitionEnd:e,...n}){return mn(this,n,yn(n,t||{},this)),{transition:t,transitionEnd:e,...n}}}const Wa=Ft({scrapeMotionValuesFromProps:Na,createRenderState:Na});const Ha=t=>t>.001?1/t:1e5;t.AnimatePresence=({children:t,custom:n,initial:o=!0,onExitComplete:i,exitBeforeEnter:s,presenceAffectsLayout:a=!0,mode:l="sync"})=>{s&&(l="wait");let[u]=fs();const c=e.useContext(V).forceRender;c&&(u=c);const d=ps(),p=function(t){const n=[];return e.Children.forEach(t,t=>{e.isValidElement(t)&&n.push(t)}),n}(t);let f=p;const m=new Set,g=e.useRef(f),y=e.useRef(new Map).current,v=e.useRef(!0);if(h(()=>{v.current=!1,function(t,e){t.forEach(t=>{const n=xs(t);e.set(n,t)})}(p,y),g.current=f}),ie(()=>{v.current=!0,y.clear(),m.clear()}),v.current)return r.createElement(r.Fragment,null,f.map(t=>r.createElement(ys,{key:xs(t),isPresent:!0,initial:!!o&&void 0,presenceAffectsLayout:a,mode:l},t)));f=[...f];const x=g.current.map(xs),E=p.map(xs),w=x.length;for(let t=0;t<w;t++){const e=x[t];-1===E.indexOf(e)&&m.add(e)}return"wait"===l&&m.size&&(f=[]),m.forEach(t=>{if(-1!==E.indexOf(t))return;const e=y.get(t);if(!e)return;const o=x.indexOf(t);f.splice(o,0,r.createElement(ys,{key:xs(e),isPresent:!1,onExitComplete:()=>{y.delete(t),m.delete(t);const e=g.current.findIndex(e=>e.key===t);if(g.current.splice(e,1),!m.size){if(g.current=p,!1===d.current)return;u(),i&&i()}},custom:n,presenceAffectsLayout:a,mode:l},e))}),f=f.map(t=>{const e=t.key;return m.has(e)?t:r.createElement(ys,{key:xs(t),isPresent:!0,presenceAffectsLayout:a,mode:l},t)}),r.createElement(r.Fragment,null,m.size?f:f.map(t=>e.cloneElement(t)))},t.AnimateSharedLayout=({children:t})=>(r.useEffect(()=>{},[]),r.createElement(Ps,{id:P(()=>"asl-"+As++)},t)),t.DeprecatedLayoutGroupContext=Es,t.DragControls=Da,t.FlatTree=Ur,t.LayoutGroup=Ps,t.LayoutGroupContext=V,t.LazyMotion=function({children:t,features:n,strict:o=!1}){const[,i]=e.useState(!Ss(n)),s=e.useRef(void 0);if(!Ss(n)){const{renderer:t,...e}=n;s.current=t,b(e)}return e.useEffect(()=>{Ss(n)&&n().then(({renderer:t,...e})=>{b(e),s.current=t,i(!0)})},[]),r.createElement(d.Provider,{value:{renderer:s.current,strict:o}},t)},t.MotionConfig=function({children:t,isValidProp:n,...o}){n&&xt(n),(o={...e.useContext(s),...o}).isStatic=P(()=>o.isStatic);const i=e.useMemo(()=>o,[JSON.stringify(o.transition),o.transformPagePoint,o.reducedMotion]);return r.createElement(s.Provider,{value:i},t)},t.MotionConfigContext=s,t.MotionContext=a,t.MotionValue=Fe,t.PresenceContext=u,t.Reorder=js,t.SwitchLayoutGroupContext=M,t.VisualElement=or,t.addPointerEvent=Zt,t.addPointerInfo=qt,t.addScaleCorrector=j,t.animate=gr,t.animateVisualElement=Bo,t.animationControls=Ca,t.animations=Yo,t.anticipate=Kn,t.backIn=qn,t.backInOut=Zn,t.backOut=Gn,t.buildTransform=$,t.calcLength=ei,t.checkTargetForNewValues=mn,t.circIn=$n,t.circInOut=Xn,t.circOut=Yn,t.clamp=G,t.createBox=pi,t.createDomMotionComponent=function(t){return L(Wt(t,{forwardMotionProps:!1},cs,ur,us))},t.createMotionComponent=L,t.cubicBezier=Hn,t.delay=wo,t.distance=Xo,t.distance2D=Go,t.domAnimation=Fs,t.domMax=Us,t.easeIn=Pn,t.easeInOut=Sn,t.easeOut=An,t.filterProps=Et,t.frameData=Ee,t.isBrowser=c,t.isDragActive=ee,t.isMotionComponent=Ba,t.isMotionValue=z,t.isValidMotionProp=yt,t.m=ds,t.makeUseVisualState=Ft,t.mix=Vn,t.motion=hs,t.motionValue=Ue,t.optimizedAppearDataAttribute=xn,t.pipe=se,t.resolveMotionValue=jt,t.spring=ro,t.startOptimizedAppearAnimation=function(t,e,n,o,i){const r=t.dataset.framerAppearId;if(!r)return;window.HandoffAppearAnimations=Ua;const s=ja(r,e),a=mo(t,e,[n[0],n[0]],{duration:1e4,ease:"linear"});Fa.set(s,{animation:a,startTime:null});const l=()=>{a.cancel();const r=mo(t,e,n,o);document.timeline&&(r.startTime=document.timeline.currentTime),Fa.set(s,{animation:r,startTime:performance.now()}),i&&i(r)};a.ready?a.ready.then(l).catch(zn):l()},t.sync=Ce,t.transform=Ds,t.unwrapMotionComponent=function(t){if(Ba(t))return t[R]},t.useAnimation=Ra,t.useAnimationControls=Ma,t.useAnimationFrame=Aa,t.useCycle=function(...t){const n=e.useRef(0),[o,i]=e.useState(t[n.current]);return[o,e.useCallback(e=>{n.current="number"!=typeof e?La(0,t.length,n.current+1):e,i(t[n.current])},[t.length,...t])]},t.useDeprecatedAnimatedState=function(t){const[n,o]=e.useState(t),i=Wa({},!1),r=P(()=>new za({props:{},visualState:i},{initialState:t}));return e.useEffect(()=>(r.mount({}),()=>r.unmount()),[r]),e.useEffect(()=>{r.setProps({onUpdate:t=>{o({...t})}})},[o,r]),[n,P(()=>t=>Bo(r,t))]},t.useDeprecatedInvertedScale=function(t){let e=Ls(1),n=Ls(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:Bs(e,Ha),scaleY:Bs(n,Ha)}},t.useDomEvent=Yt,t.useDragControls=function(){return P(ka)},t.useElementScroll=function(t){return Pa({container:t})},t.useForceUpdate=fs,t.useInView=function(t,{root:n,margin:o,amount:i,once:r=!1}={}){const[s,a]=e.useState(!1);return e.useEffect(()=>{if(!t.current||r&&s)return;const e={root:n&&n.current||void 0,margin:o,amount:"some"===i?"any":i};return function(t,e,{root:n,margin:o,amount:i="any"}={}){if("undefined"==typeof IntersectionObserver)return()=>{};const r=Ks(t),s=new WeakMap,a=new IntersectionObserver(t=>{t.forEach(t=>{const n=s.get(t.target);if(t.isIntersecting!==Boolean(n))if(t.isIntersecting){const n=e(t);qs(n)?s.set(t.target,n):a.unobserve(t.target)}else n&&(n(t),s.delete(t.target))})},{root:n,rootMargin:o,threshold:"number"==typeof i?i:_s[i]});return r.forEach(t=>a.observe(t)),()=>a.disconnect()}(t.current,()=>(a(!0),r?void 0:()=>a(!1)),e)},[n,t,o,r]),s},t.useInstantLayoutTransition=Ia,t.useInstantTransition=function(){const[t,n]=fs(),o=Ia();return e.useEffect(()=>{Ce.postRender(()=>Ce.postRender(()=>wn.current=!1))},[n]),e=>{o(()=>{wn.current=!0,t(),e()})}},t.useIsPresent=function(){return null===(t=e.useContext(u))||t.isPresent;var t},t.useIsomorphicLayoutEffect=h,t.useMotionTemplate=function(t,...e){const n=t.length;return ks(e.filter(z),(function(){let o="";for(let i=0;i<n;i++){o+=t[i];const n=e[i];n&&(o+=z(n)?n.get():n)}return o}))},t.useMotionValue=Ls,t.useMotionValueEvent=function(t,n,o){e.useInsertionEffect(()=>t.on(n,o),[t,n,o])},t.usePresence=ye,t.useReducedMotion=Va,t.useReducedMotionConfig=function(){const t=Va(),{reducedMotion:n}=e.useContext(s);return"never"!==n&&("always"===n||t)},t.useResetProjection=function(){return r.useCallback(()=>{const t=ls.current;t&&t.resetTree()},[])},t.useScroll=Pa,t.useSpring=function(t,n={}){const{isStatic:o}=e.useContext(s),i=e.useRef(null),r=Ls(z(t)?t.get():t),a=()=>{i.current&&i.current.stop()};return e.useInsertionEffect(()=>r.attach((t,e)=>o?e(t):(a(),i.current=co({keyframes:[r.get(),t],velocity:r.getVelocity(),type:"spring",...n,onUpdate:e}),r.get()),a),[JSON.stringify(n)]),h(()=>{if(z(t))return t.on("change",t=>r.set(parseFloat(t)))},[r]),r},t.useTime=function(){const t=Ls(0);return Aa(e=>t.set(e)),t},t.useTransform=Bs,t.useUnmountEffect=ie,t.useVelocity=function(t){const n=Ls(t.getVelocity());return e.useEffect(()=>t.on("velocityChange",t=>{n.set(t)}),[t]),n},t.useViewportScroll=function(){return Pa()},t.useVisualElementContext=l,t.useWillChange=function(){return P(()=>new Sa("auto"))},t.wrap=La,Object.defineProperty(t,"__esModule",{value:!0})}));
|