framer-motion.js 141 KB

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){var e=Object.create(null);return t&&Object.keys(t).forEach((function(n){if("default"!==n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}})),e.default=t,Object.freeze(e)}var i=n(e),s=React,o=Symbol.for("react.element"),r=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,u=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function c(t,e,n){var i,s={},r=null,c=null;for(i in void 0!==n&&(r=""+n),void 0!==e.key&&(r=""+e.key),void 0!==e.ref&&(c=e.ref),e)a.call(e,i)&&!l.hasOwnProperty(i)&&(s[i]=e[i]);if(t&&t.defaultProps)for(i in e=t.defaultProps)void 0===s[i]&&(s[i]=e[i]);return{$$typeof:o,type:t,key:r,ref:c,props:s,_owner:u.current}}const h=r,d=c,p=c,m=e.createContext({});function f(t){const n=e.useRef(null);return null===n.current&&(n.current=t()),n.current}const g="undefined"!=typeof window,y=g?e.useLayoutEffect:e.useEffect,v=e.createContext(null),x=e.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});class w extends i.Component{getSnapshotBeforeUpdate(t){const e=this.props.childRef.current;if(e&&t.isPresent&&!this.props.isPresent){const t=e.offsetParent,n=t instanceof HTMLElement&&t.offsetWidth||0,i=this.props.sizeRef.current;i.height=e.offsetHeight||0,i.width=e.offsetWidth||0,i.top=e.offsetTop,i.left=e.offsetLeft,i.right=n-i.width-i.left}return null}componentDidUpdate(){}render(){return this.props.children}}function P({children:t,isPresent:n,anchorX:s}){const o=e.useId(),r=e.useRef(null),a=e.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:u}=e.useContext(x);return e.useInsertionEffect((()=>{const{width:t,height:e,top:i,left:l,right:c}=a.current;if(n||!r.current||!t||!e)return;const h="left"===s?`left: ${l}`:`right: ${c}`;r.current.dataset.motionPopId=o;const d=document.createElement("style");return u&&(d.nonce=u),document.head.appendChild(d),d.sheet&&d.sheet.insertRule(`\n [data-motion-pop-id="${o}"] {\n position: absolute !important;\n width: ${t}px !important;\n height: ${e}px !important;\n ${h}px !important;\n top: ${i}px !important;\n }\n `),()=>{document.head.removeChild(d)}}),[n]),d(w,{isPresent:n,childRef:r,sizeRef:a,children:i.cloneElement(t,{ref:r})})}const T=({children:t,initial:n,isPresent:s,onExitComplete:o,custom:r,presenceAffectsLayout:a,mode:u,anchorX:l})=>{const c=f(S),h=e.useId(),p=e.useCallback((t=>{c.set(t,!0);for(const t of c.values())if(!t)return;o&&o()}),[c,o]),m=e.useMemo((()=>({id:h,initial:n,isPresent:s,custom:r,onExitComplete:p,register:t=>(c.set(t,!1),()=>c.delete(t))})),a?[Math.random(),p]:[s,p]);return e.useMemo((()=>{c.forEach(((t,e)=>c.set(e,!1)))}),[s]),i.useEffect((()=>{!s&&!c.size&&o&&o()}),[s]),"popLayout"===u&&(t=d(P,{isPresent:s,anchorX:l,children:t})),d(v.Provider,{value:m,children:t})};function S(){return new Map}function b(t=!0){const n=e.useContext(v);if(null===n)return[!0,null];const{isPresent:i,onExitComplete:s,register:o}=n,r=e.useId();e.useEffect((()=>{if(t)return o(r)}),[t]);const a=e.useCallback((()=>t&&s&&s(r)),[r,s,t]);return!i&&s?[!1,a]:[!0]}const A=t=>t.key||"";function E(t){const n=[];return e.Children.forEach(t,(t=>{e.isValidElement(t)&&n.push(t)})),n}const M=e.createContext(null);function C(t,e){-1===t.indexOf(e)&&t.push(e)}function V(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}let R=()=>{};const k={skipAnimations:!1,useManualTiming:!1};function D(t){let e;return()=>(void 0===e&&(e=t()),e)}const L=t=>t,B=(t,e,n)=>{const i=e-t;return 0===i?1:(n-t)/i};class O{constructor(){this.subscriptions=[]}add(t){return C(this.subscriptions,t),()=>V(this.subscriptions,t)}notify(t,e,n){const i=this.subscriptions.length;if(i)if(1===i)this.subscriptions[0](t,e,n);else for(let s=0;s<i;s++){const i=this.subscriptions[s];i&&i(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const F=t=>1e3*t,j=t=>t/1e3;function I(t,e){return e?t*(1e3/e):0}const U=D((()=>void 0!==window.ScrollTimeline));class W{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map((t=>t.finished)))}getAll(t){return this.animations[0][t]}setAll(t,e){for(let n=0;n<this.animations.length;n++)this.animations[n][t]=e}attachTimeline(t,e){const n=this.animations.map((n=>U()&&n.attachTimeline?n.attachTimeline(t):"function"==typeof e?e(n):void 0));return()=>{n.forEach(((t,e)=>{t&&t(),this.animations[e].stop()}))}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let e=0;e<this.animations.length;e++)t=Math.max(t,this.animations[e].duration);return t}runAll(t){this.animations.forEach((e=>e[t]()))}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class N extends W{then(t,e){return this.finished.finally(t).then((()=>{}))}}const $=t=>t.startsWith("--"),z=(t,e,n)=>{$(e)?t.style.setProperty(e,n):t.style[e]=n},H=(t,e)=>$(e)?t.style.getPropertyValue(e):t.style[e],X=t=>null!==t;const Y=D((()=>{try{document.createElement("div").animate({opacity:[1]})}catch(t){return!1}return!0})),K=new Set(["borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderRadius","radius","borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius","width","maxWidth","height","maxHeight","top","right","bottom","left","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","margin","marginTop","marginRight","marginBottom","marginLeft","backgroundPositionX","backgroundPositionY"]);const G={value:null,addProjectionMetrics:null},_=t=>Array.isArray(t)&&"number"==typeof t[0],q={};function Z(t,e){const n=D(t);return()=>q[e]??n()}const J=Z((()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0}),"linearEasing"),Q=(t,e,n=10)=>{let i="";const s=Math.max(Math.round(e/n),2);for(let e=0;e<s;e++)i+=t(e/(s-1))+", ";return`linear(${i.substring(0,i.length-2)})`},tt=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,et={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:tt([0,.65,.55,1]),circOut:tt([.55,0,1,.45]),backIn:tt([.31,.01,.66,-.59]),backOut:tt([.33,1.53,.69,.99])};function nt(t,e){return t?"function"==typeof t&&J()?Q(t,e):_(t)?tt(t):Array.isArray(t)?t.map((t=>nt(t,e)||et.easeOut)):et[t]:void 0}function it(t,e,n,{delay:i=0,duration:s=300,repeat:o=0,repeatType:r="loop",ease:a="easeInOut",times:u}={},l=void 0){const c={[e]:n};u&&(c.offset=u);const h=nt(a,s);Array.isArray(h)&&(c.easing=h);return t.animate(c,{delay:i,duration:s,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:o+1,direction:"reverse"===r?"alternate":"normal",pseudoElement:l})}function st(t){return"function"==typeof t&&"applyToOptions"in t}const ot=new WeakMap;class rt{constructor(t){if("animation"in t)return void(this.animation=t.animation);const{element:e,name:n,keyframes:i,pseudoElement:s,allowFlatten:o=!1}=t;let{transition:r}=t;this.isPseudoElement=Boolean(s),this.allowFlatten=o;const a=function(t){const e=ot.get(t)||new Map;return ot.set(t,e),e}(e),u=((t,e)=>`${t}:${e}`)(n,s||""),l=a.get(u);l&&l.stop();const c=function(t,e,n,i){Array.isArray(n)||(n=[n]);for(let s=0;s<n.length;s++)null===n[s]&&(n[s]=0!==s||i?n[s-1]:H(t,e)),"number"==typeof n[s]&&K.has(e)&&(n[s]=n[s]+"px");return!i&&!Y()&&n.length<2&&n.unshift(H(t,e)),n}(e,n,i,s);r.type,r=function({type:t,...e}){return st(t)?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}(r),this.animation=it(e,n,c,r,s),!1===r.autoplay&&this.animation.pause(),this.removeAnimation=()=>a.delete(u),this.animation.onfinish=()=>{s||(z(e,n,function(t,{repeat:e,repeatType:n="loop"},i){const s=t.filter(X),o=e&&"loop"!==n&&e%2==1?0:s.length-1;return o&&void 0!==i?i:s[o]}(c,r)),this.cancel())},a.set(u,this)}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.finish()}cancel(){try{this.animation.cancel()}catch(t){}this.removeAnimation()}stop(){const{state:t}=this;"idle"!==t&&"finished"!==t&&(this.commitStyles(),this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming().duration||0;return j(Number(t))}get time(){return j(Number(this.animation.currentTime)||0)}set time(t){this.animation.currentTime=F(t)}get speed(){return this.animation.playbackRate}set speed(t){this.animation.playbackRate=t}get state(){return this.animation.playState}get startTime(){return Number(this.animation.startTime)}get finished(){return this.animation.finished}flatten(){this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"})}attachTimeline(t){return this.animation.timeline=t,this.animation.onfinish=null,L}then(t,e){return this.finished.then(t).catch(e)}}function at(t,e){return t?.[e]??t?.default??t}const ut=2e4;function lt(t){let e=0;let n=t.next(e);for(;!n.done&&e<ut;)e+=50,n=t.next(e);return e>=ut?1/0:e}function ct(t,e=100,n){const i=n({...t,keyframes:[0,e]}),s=Math.min(lt(i),ut);return{type:"keyframes",ease:t=>i.next(s*t).value/e,duration:j(s)}}function ht(t){return Boolean("function"==typeof t&&J()||!t||"string"==typeof t&&(t in et||J())||_(t)||Array.isArray(t)&&t.every(ht))}function dt(t,e){t.timeline=e,t.onfinish=null}const pt=["read","resolveKeyframes","update","preRender","render","postRender"];function mt(t,e){let n=!1,i=!0;const s={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,r=pt.reduce(((t,n)=>(t[n]=function(t,e){let n=new Set,i=new Set,s=!1,o=!1;const r=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1},u=0;function l(e){r.has(e)&&(c.schedule(e),t()),u++,e(a)}const c={schedule:(t,e=!1,o=!1)=>{const a=o&&s?n:i;return e&&r.add(t),a.has(t)||a.add(t),t},cancel:t=>{i.delete(t),r.delete(t)},process:t=>{a=t,s?o=!0:(s=!0,[n,i]=[i,n],n.forEach(l),e&&G.value&&G.value.frameloop[e].push(u),u=0,n.clear(),s=!1,o&&(o=!1,c.process(t)))}};return c}(o,e?n:void 0),t)),{}),{read:a,resolveKeyframes:u,update:l,preRender:c,render:h,postRender:d}=r,p=()=>{const o=k.useManualTiming?s.timestamp:performance.now();n=!1,k.useManualTiming||(s.delta=i?1e3/60:Math.max(Math.min(o-s.timestamp,40),1)),s.timestamp=o,s.isProcessing=!0,a.process(s),u.process(s),l.process(s),c.process(s),h.process(s),d.process(s),s.isProcessing=!1,n&&e&&(i=!1,t(p))};return{schedule:pt.reduce(((e,o)=>{const a=r[o];return e[o]=(e,o=!1,r=!1)=>(n||(n=!0,i=!0,s.isProcessing||t(p)),a.schedule(e,o,r)),e}),{}),cancel:t=>{for(let e=0;e<pt.length;e++)r[pt[e]].cancel(t)},state:s,steps:r}}const{schedule:ft,cancel:gt}=mt(queueMicrotask,!1),{schedule:yt,cancel:vt,state:xt,steps:wt}=mt("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:L,!0);let Pt;function Tt(){Pt=void 0}const St={now:()=>(void 0===Pt&&St.set(xt.isProcessing||k.useManualTiming?xt.timestamp:performance.now()),Pt),set:t=>{Pt=t,queueMicrotask(Tt)}},bt={x:!1,y:!1};function At(){return bt.x||bt.y}function Et(t,e,n){if(t instanceof EventTarget)return[t];if("string"==typeof t){let i=document;e&&(i=e.current);const s=n?.[t]??i.querySelectorAll(t);return s?Array.from(s):[]}return Array.from(t)}function Mt(t,e){const n=Et(t),i=new AbortController;return[n,{passive:!0,...e,signal:i.signal},()=>i.abort()]}function Ct(t){return!("touch"===t.pointerType||At())}function Vt(t,e,n={}){const[i,s,o]=Mt(t,n),r=t=>{if(!Ct(t))return;const{target:n}=t,i=e(n,t);if("function"!=typeof i||!n)return;const o=t=>{Ct(t)&&(i(t),n.removeEventListener("pointerleave",o))};n.addEventListener("pointerleave",o,s)};return i.forEach((t=>{t.addEventListener("pointerenter",r,s)})),o}const Rt=(t,e)=>!!e&&(t===e||Rt(t,e.parentElement)),kt=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary,Dt=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);const Lt=new WeakSet;function Bt(t){return e=>{"Enter"===e.key&&t(e)}}function Ot(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}function Ft(t){return kt(t)&&!At()}function jt(t,e,n={}){const[i,s,o]=Mt(t,n),r=t=>{const i=t.currentTarget;if(!Ft(t)||Lt.has(i))return;Lt.add(i);const o=e(i,t),r=(t,e)=>{window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",u),Ft(t)&&Lt.has(i)&&(Lt.delete(i),"function"==typeof o&&o(t,{success:e}))},a=t=>{r(t,i===window||i===document||n.useGlobalTarget||Rt(i,t.target))},u=t=>{r(t,!1)};window.addEventListener("pointerup",a,s),window.addEventListener("pointercancel",u,s)};return i.forEach((t=>{var e;(n.useGlobalTarget?window:t).addEventListener("pointerdown",r,s),t instanceof HTMLElement&&(t.addEventListener("focus",(t=>((t,e)=>{const n=t.currentTarget;if(!n)return;const i=Bt((()=>{if(Lt.has(n))return;Ot(n,"down");const t=Bt((()=>{Ot(n,"up")}));n.addEventListener("keyup",t,e),n.addEventListener("blur",(()=>Ot(n,"cancel")),e)}));n.addEventListener("keydown",i,e),n.addEventListener("blur",(()=>n.removeEventListener("keydown",i)),e)})(t,s))),e=t,Dt.has(e.tagName)||-1!==e.tabIndex||t.hasAttribute("tabindex")||(t.tabIndex=0))})),o}const It={current:void 0};class Ut{constructor(t,e={}){this.version="12.7.3",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(t,e=!0)=>{const n=St.now();this.updatedAt!==n&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),e&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=St.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e))))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new O);const n=this.events[t].add(e);return"change"===t?()=>{n(),yt.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=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return It.current&&It.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const t=St.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return I(parseFloat(this.current)-parseFloat(this.prevFrameValue),e)}start(t){return this.stop(),new Promise((e=>{this.hasAnimated=!0,this.animation=t(e),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(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Wt(t,e){return new Ut(t,e)}const Nt=yt,$t=pt.reduce(((t,e)=>(t[e]=t=>vt(t),t)),{}),zt=(t,e,n)=>t+(e-t)*n;function Ht(t){return t.max-t.min}function Xt(t,e,n,i=.5){t.origin=i,t.originPoint=zt(e.min,e.max,t.origin),t.scale=Ht(n)/Ht(e),t.translate=zt(n.min,n.max,t.origin)-t.originPoint,(t.scale>=.9999&&t.scale<=1.0001||isNaN(t.scale))&&(t.scale=1),(t.translate>=-.01&&t.translate<=.01||isNaN(t.translate))&&(t.translate=0)}function Yt(t,e,n,i){Xt(t.x,e.x,n.x,i?i.originX:void 0),Xt(t.y,e.y,n.y,i?i.originY:void 0)}function Kt(t,e,n){t.min=n.min+e.min,t.max=t.min+Ht(e)}function Gt(t,e,n){t.min=e.min-n.min,t.max=t.min+Ht(e)}function _t(t,e,n){Gt(t.x,e.x,n.x),Gt(t.y,e.y,n.y)}const qt=t=>!t.isLayoutDirty&&t.willUpdate(!1);function Zt(){const t=new Set,e=new WeakMap,n=()=>t.forEach(qt);return{add:i=>{t.add(i),e.set(i,i.addEventListener("willUpdate",n))},remove:i=>{t.delete(i);const s=e.get(i);s&&(s(),e.delete(i)),n()},dirty:n}}const Jt=t=>Boolean(t&&t.getVelocity),Qt={current:!1},te=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function ee(t,e,n,i){if(t===e&&n===i)return L;const s=e=>function(t,e,n,i,s){let o,r,a=0;do{r=e+(n-e)/2,o=te(r,i,s)-t,o>0?n=r:e=r}while(Math.abs(o)>1e-7&&++a<12);return r}(e,0,1,t,n);return t=>0===t||1===t?t:te(s(t),e,i)}const ne=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,ie=t=>e=>1-t(1-e),se=ee(.33,1.53,.69,.99),oe=ie(se),re=ne(oe),ae=t=>(t*=2)<1?.5*oe(t):.5*(2-Math.pow(2,-10*(t-1))),ue=t=>1-Math.sin(Math.acos(t)),le=ie(ue),ce=ne(ue),he=t=>/^0[^.\s]+$/u.test(t);const de=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],pe=new Set(de),me=new Set(["width","height","top","left","right","bottom",...de]),fe=(t,e,n)=>n>e?e:n<t?t:n,ge={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},ye={...ge,transform:t=>fe(0,1,t)},ve={...ge,default:1},xe=t=>Math.round(1e5*t)/1e5,we=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const Pe=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Te=(t,e)=>n=>Boolean("string"==typeof n&&Pe.test(n)&&n.startsWith(t)||e&&!function(t){return null==t}(n)&&Object.prototype.hasOwnProperty.call(n,e)),Se=(t,e,n)=>i=>{if("string"!=typeof i)return i;const[s,o,r,a]=i.match(we);return{[t]:parseFloat(s),[e]:parseFloat(o),[n]:parseFloat(r),alpha:void 0!==a?parseFloat(a):1}},be={...ge,transform:t=>Math.round((t=>fe(0,255,t))(t))},Ae={test:Te("rgb","red"),parse:Se("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:i=1})=>"rgba("+be.transform(t)+", "+be.transform(e)+", "+be.transform(n)+", "+xe(ye.transform(i))+")"};const Ee={test:Te("#"),parse:function(t){let e="",n="",i="",s="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),i=t.substring(5,7),s=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),i=t.substring(3,4),s=t.substring(4,5),e+=e,n+=n,i+=i,s+=s),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:s?parseInt(s,16)/255:1}},transform:Ae.transform},Me=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),Ce=Me("deg"),Ve=Me("%"),Re=Me("px"),ke=Me("vh"),De=Me("vw"),Le={...Ve,parse:t=>Ve.parse(t)/100,transform:t=>Ve.transform(100*t)},Be={test:Te("hsl","hue"),parse:Se("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:i=1})=>"hsla("+Math.round(t)+", "+Ve.transform(xe(e))+", "+Ve.transform(xe(n))+", "+xe(ye.transform(i))+")"},Oe={test:t=>Ae.test(t)||Ee.test(t)||Be.test(t),parse:t=>Ae.test(t)?Ae.parse(t):Be.test(t)?Be.parse(t):Ee.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?Ae.transform(t):Be.transform(t)},Fe=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const je="number",Ie="color",Ue=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function We(t){const e=t.toString(),n=[],i={color:[],number:[],var:[]},s=[];let o=0;const r=e.replace(Ue,(t=>(Oe.test(t)?(i.color.push(o),s.push(Ie),n.push(Oe.parse(t))):t.startsWith("var(")?(i.var.push(o),s.push("var"),n.push(t)):(i.number.push(o),s.push(je),n.push(parseFloat(t))),++o,"${}"))).split("${}");return{values:n,split:r,indexes:i,types:s}}function Ne(t){return We(t).values}function $e(t){const{split:e,types:n}=We(t),i=e.length;return t=>{let s="";for(let o=0;o<i;o++)if(s+=e[o],void 0!==t[o]){const e=n[o];s+=e===je?xe(t[o]):e===Ie?Oe.transform(t[o]):t[o]}return s}}const ze=t=>"number"==typeof t?0:t;const He={test:function(t){return isNaN(t)&&"string"==typeof t&&(t.match(we)?.length||0)+(t.match(Fe)?.length||0)>0},parse:Ne,createTransformer:$e,getAnimatableNone:function(t){const e=Ne(t);return $e(t)(e.map(ze))}},Xe=new Set(["brightness","contrast","saturate","opacity"]);function Ye(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[i]=n.match(we)||[];if(!i)return t;const s=n.replace(i,"");let o=Xe.has(e)?1:0;return i!==n&&(o*=100),e+"("+o+s+")"}const Ke=/\b([a-z-]*)\(.*?\)/gu,Ge={...He,getAnimatableNone:t=>{const e=t.match(Ke);return e?e.map(Ye).join(" "):t}},_e={borderWidth:Re,borderTopWidth:Re,borderRightWidth:Re,borderBottomWidth:Re,borderLeftWidth:Re,borderRadius:Re,radius:Re,borderTopLeftRadius:Re,borderTopRightRadius:Re,borderBottomRightRadius:Re,borderBottomLeftRadius:Re,width:Re,maxWidth:Re,height:Re,maxHeight:Re,top:Re,right:Re,bottom:Re,left:Re,padding:Re,paddingTop:Re,paddingRight:Re,paddingBottom:Re,paddingLeft:Re,margin:Re,marginTop:Re,marginRight:Re,marginBottom:Re,marginLeft:Re,backgroundPositionX:Re,backgroundPositionY:Re},qe={rotate:Ce,rotateX:Ce,rotateY:Ce,rotateZ:Ce,scale:ve,scaleX:ve,scaleY:ve,scaleZ:ve,skew:Ce,skewX:Ce,skewY:Ce,distance:Re,translateX:Re,translateY:Re,translateZ:Re,x:Re,y:Re,z:Re,perspective:Re,transformPerspective:Re,opacity:ye,originX:Le,originY:Le,originZ:Re},Ze={...ge,transform:Math.round},Je={..._e,...qe,zIndex:Ze,size:Re,fillOpacity:ye,strokeOpacity:ye,numOctaves:Ze},Qe={...Je,color:Oe,backgroundColor:Oe,outlineColor:Oe,fill:Oe,stroke:Oe,borderColor:Oe,borderTopColor:Oe,borderRightColor:Oe,borderBottomColor:Oe,borderLeftColor:Oe,filter:Ge,WebkitFilter:Ge},tn=t=>Qe[t];function en(t,e){let n=tn(t);return n!==Ge&&(n=He),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const nn=new Set(["auto","none","0"]);const sn=t=>180*t/Math.PI,on=t=>{const e=sn(Math.atan2(t[1],t[0]));return an(e)},rn={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:on,rotateZ:on,skewX:t=>sn(Math.atan(t[1])),skewY:t=>sn(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},an=t=>((t%=360)<0&&(t+=360),t),un=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),ln=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),cn={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:un,scaleY:ln,scale:t=>(un(t)+ln(t))/2,rotateX:t=>an(sn(Math.atan2(t[6],t[5]))),rotateY:t=>an(sn(Math.atan2(-t[2],t[0]))),rotateZ:on,rotate:on,skewX:t=>sn(Math.atan(t[4])),skewY:t=>sn(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function hn(t){return t.includes("scale")?1:0}function dn(t,e){if(!t||"none"===t)return hn(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let i,s;if(n)i=cn,s=n;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=rn,s=e}if(!s)return hn(e);const o=i[e],r=s[1].split(",").map(pn);return"function"==typeof o?o(r):r[o]}function pn(t){return parseFloat(t.trim())}const mn=t=>t===ge||t===Re,fn=new Set(["x","y","z"]),gn=de.filter((t=>!fn.has(t)));const yn={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:(t,{transform:e})=>dn(e,"x"),y:(t,{transform:e})=>dn(e,"y")};yn.translateX=yn.x,yn.translateY=yn.y;const vn=new Set;let xn=!1,wn=!1;function Pn(){if(wn){const t=Array.from(vn).filter((t=>t.needsMeasurement)),e=new Set(t.map((t=>t.element))),n=new Map;e.forEach((t=>{const e=function(t){const e=[];return gn.forEach((n=>{const i=t.getValue(n);void 0!==i&&(e.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))})),e}(t);e.length&&(n.set(t,e),t.render())})),t.forEach((t=>t.measureInitialState())),e.forEach((t=>{t.render();const e=n.get(t);e&&e.forEach((([e,n])=>{t.getValue(e)?.set(n)}))})),t.forEach((t=>t.measureEndState())),t.forEach((t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)}))}wn=!1,xn=!1,vn.forEach((t=>t.complete())),vn.clear()}function Tn(){vn.forEach((t=>{t.readKeyframes(),t.needsMeasurement&&(wn=!0)}))}class Sn{constructor(t,e,n,i,s,o=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=n,this.motionValue=i,this.element=s,this.isAsync=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(vn.add(this),xn||(xn=!0,yt.read(Tn),yt.resolveKeyframes(Pn))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:n,motionValue:i}=this;for(let s=0;s<t.length;s++)if(null===t[s])if(0===s){const s=i?.get(),o=t[t.length-1];if(void 0!==s)t[0]=s;else if(n&&e){const i=n.readValue(e,o);null!=i&&(t[0]=i)}void 0===t[0]&&(t[0]=o),i&&void 0===s&&i.set(t[0])}else t[s]=t[s-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),vn.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,vn.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const bn=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),An=t=>e=>"string"==typeof e&&e.startsWith(t),En=An("--"),Mn=An("var(--"),Cn=t=>!!Mn(t)&&Vn.test(t.split("/*")[0].trim()),Vn=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Rn=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function kn(t,e,n=1){const[i,s]=function(t){const e=Rn.exec(t);if(!e)return[,];const[,n,i,s]=e;return[`--${n??i}`,s]}(t);if(!i)return;const o=window.getComputedStyle(e).getPropertyValue(i);if(o){const t=o.trim();return bn(t)?parseFloat(t):t}return Cn(s)?kn(s,e,n+1):s}const Dn=t=>e=>e.test(t),Ln=[ge,Re,Ve,Ce,De,ke,{test:t=>"auto"===t,parse:t=>t}],Bn=t=>Ln.find(Dn(t));class On extends Sn{constructor(t,e,n,i,s){super(t,e,n,i,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:n}=this;if(!e||!e.current)return;super.readKeyframes();for(let n=0;n<t.length;n++){let i=t[n];if("string"==typeof i&&(i=i.trim(),Cn(i))){const s=kn(i,e.current);void 0!==s&&(t[n]=s),n===t.length-1&&(this.finalKeyframe=i)}}if(this.resolveNoneKeyframes(),!me.has(n)||2!==t.length)return;const[i,s]=t,o=Bn(i),r=Bn(s);if(o!==r)if(mn(o)&&mn(r))for(let e=0;e<t.length;e++){const n=t[e];"string"==typeof n&&(t[e]=parseFloat(n))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:e}=this,n=[];for(let e=0;e<t.length;e++)("number"==typeof(i=t[e])?0===i:null===i||"none"===i||"0"===i||he(i))&&n.push(e);var i;n.length&&function(t,e,n){let i,s=0;for(;s<t.length&&!i;){const e=t[s];"string"==typeof e&&!nn.has(e)&&We(e).values.length&&(i=t[s]),s++}if(i&&n)for(const s of e)t[s]=en(n,i)}(t,n,e)}measureInitialState(){const{element:t,unresolvedKeyframes:e,name:n}=this;if(!t||!t.current)return;"height"===n&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=yn[n](t.measureViewportBox(),window.getComputedStyle(t.current)),e[0]=this.measuredOrigin;const i=e[e.length-1];void 0!==i&&t.getValue(n,i).jump(i,!1)}measureEndState(){const{element:t,name:e,unresolvedKeyframes:n}=this;if(!t||!t.current)return;const i=t.getValue(e);i&&i.jump(this.measuredOrigin,!1);const s=n.length-1,o=n[s];n[s]=yn[e](t.measureViewportBox(),window.getComputedStyle(t.current)),null!==o&&void 0===this.finalKeyframe&&(this.finalKeyframe=o),this.removedTransforms?.length&&this.removedTransforms.forEach((([e,n])=>{t.getValue(e).set(n)})),this.resolveNoneKeyframes()}}const Fn=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!He.test(t)&&"0"!==t||t.startsWith("url(")));function jn(t,e,n,i){const s=t[0];if(null===s)return!1;if("display"===e||"visibility"===e)return!0;const o=t[t.length-1],r=Fn(s,e),a=Fn(o,e);return!(!r||!a)&&(function(t){const e=t[0];if(1===t.length)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}(t)||("spring"===n||st(n))&&i)}const In=t=>null!==t;function Un(t,{repeat:e,repeatType:n="loop"},i){const s=t.filter(In),o=e&&"loop"!==n&&e%2==1?0:s.length-1;return o&&void 0!==i?i:s[o]}class Wn{constructor({autoplay:t=!0,delay:e=0,type:n="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:o="loop",...r}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=St.now(),this.options={autoplay:t,delay:e,type:n,repeat:i,repeatDelay:s,repeatType:o,...r},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt}get resolved(){return this._resolved||this.hasAttemptedResolve||(Tn(),Pn()),this._resolved}onKeyframesResolved(t,e){this.resolvedAt=St.now(),this.hasAttemptedResolve=!0;const{name:n,type:i,velocity:s,delay:o,onComplete:r,onUpdate:a,isGenerator:u}=this.options;if(!u&&!jn(t,n,i,s)){if(Qt.current||!o)return a&&a(Un(t,this.options,e)),r&&r(),void this.resolveFinishedPromise();this.options.duration=0}const l=this.initPlayback(t,e);!1!==l&&(this._resolved={keyframes:t,finalKeyframe:e,...l},this.onPostResolved())}onPostResolved(){}then(t,e){return this.currentFinishedPromise.then(t,e)}flatten(){this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear")}updateFinishedPromise(){this.currentFinishedPromise=new Promise((t=>{this.resolveFinishedPromise=t}))}}function Nn(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function $n(t,e){return n=>n>0?e:t}const zn=(t,e,n)=>{const i=t*t,s=n*(e*e-i)+i;return s<0?0:Math.sqrt(s)},Hn=[Ee,Ae,Be];function Xn(t){const e=(n=t,Hn.find((t=>t.test(n))));var n;if(!Boolean(e))return!1;let i=e.parse(t);return e===Be&&(i=function({hue:t,saturation:e,lightness:n,alpha:i}){t/=360,n/=100;let s=0,o=0,r=0;if(e/=100){const i=n<.5?n*(1+e):n+e-n*e,a=2*n-i;s=Nn(a,i,t+1/3),o=Nn(a,i,t),r=Nn(a,i,t-1/3)}else s=o=r=n;return{red:Math.round(255*s),green:Math.round(255*o),blue:Math.round(255*r),alpha:i}}(i)),i}const Yn=(t,e)=>{const n=Xn(t),i=Xn(e);if(!n||!i)return $n(t,e);const s={...n};return t=>(s.red=zn(n.red,i.red,t),s.green=zn(n.green,i.green,t),s.blue=zn(n.blue,i.blue,t),s.alpha=zt(n.alpha,i.alpha,t),Ae.transform(s))},Kn=(t,e)=>n=>e(t(n)),Gn=(...t)=>t.reduce(Kn),_n=new Set(["none","hidden"]);function qn(t,e){return n=>zt(t,e,n)}function Zn(t){return"number"==typeof t?qn:"string"==typeof t?Cn(t)?$n:Oe.test(t)?Yn:ti:Array.isArray(t)?Jn:"object"==typeof t?Oe.test(t)?Yn:Qn:$n}function Jn(t,e){const n=[...t],i=n.length,s=t.map(((t,n)=>Zn(t)(t,e[n])));return t=>{for(let e=0;e<i;e++)n[e]=s[e](t);return n}}function Qn(t,e){const n={...t,...e},i={};for(const s in n)void 0!==t[s]&&void 0!==e[s]&&(i[s]=Zn(t[s])(t[s],e[s]));return t=>{for(const e in i)n[e]=i[e](t);return n}}const ti=(t,e)=>{const n=He.createTransformer(e),i=We(t),s=We(e);return i.indexes.var.length===s.indexes.var.length&&i.indexes.color.length===s.indexes.color.length&&i.indexes.number.length>=s.indexes.number.length?_n.has(t)&&!s.values.length||_n.has(e)&&!i.values.length?function(t,e){return _n.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}(t,e):Gn(Jn(function(t,e){const n=[],i={color:0,var:0,number:0};for(let s=0;s<e.values.length;s++){const o=e.types[s],r=t.indexes[o][i[o]],a=t.values[r]??0;n[s]=a,i[o]++}return n}(i,s),s.values),n):$n(t,e)};function ei(t,e,n){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n)return zt(t,e,n);return Zn(t)(t,e)}function ni(t,e,n){const i=Math.max(e-5,0);return I(n-t(i),e-i)}const ii=100,si=10,oi=1,ri=0,ai=800,ui=.3,li=.3,ci={granular:.01,default:2},hi={granular:.005,default:.5},di=.01,pi=10,mi=.05,fi=1,gi=.001;function yi({duration:t=ai,bounce:e=ui,velocity:n=ri,mass:i=oi}){let s,o,r=1-e;r=fe(mi,fi,r),t=fe(di,pi,j(t)),r<1?(s=e=>{const i=e*r,s=i*t,o=i-n,a=xi(e,r),u=Math.exp(-s);return gi-o/a*u},o=e=>{const i=e*r*t,o=i*n+n,a=Math.pow(r,2)*Math.pow(e,2)*t,u=Math.exp(-i),l=xi(Math.pow(e,2),r);return(-s(e)+gi>0?-1:1)*((o-a)*u)/l}):(s=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,o=e=>Math.exp(-e*t)*(t*t*(n-e)));const a=function(t,e,n){let i=n;for(let n=1;n<vi;n++)i-=t(i)/e(i);return i}(s,o,5/t);if(t=F(t),isNaN(a))return{stiffness:ii,damping:si,duration:t};{const e=Math.pow(a,2)*i;return{stiffness:e,damping:2*r*Math.sqrt(i*e),duration:t}}}const vi=12;function xi(t,e){return t*Math.sqrt(1-e*e)}const wi=["duration","bounce"],Pi=["stiffness","damping","mass"];function Ti(t,e){return e.some((e=>void 0!==t[e]))}function Si(t=li,e=ui){const n="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:i,restDelta:s}=n;const o=n.keyframes[0],r=n.keyframes[n.keyframes.length-1],a={done:!1,value:o},{stiffness:u,damping:l,mass:c,duration:h,velocity:d,isResolvedFromDuration:p}=function(t){let e={velocity:ri,stiffness:ii,damping:si,mass:oi,isResolvedFromDuration:!1,...t};if(!Ti(t,Pi)&&Ti(t,wi))if(t.visualDuration){const n=t.visualDuration,i=2*Math.PI/(1.2*n),s=i*i,o=2*fe(.05,1,1-(t.bounce||0))*Math.sqrt(s);e={...e,mass:oi,stiffness:s,damping:o}}else{const n=yi(t);e={...e,...n,mass:oi},e.isResolvedFromDuration=!0}return e}({...n,velocity:-j(n.velocity||0)}),m=d||0,f=l/(2*Math.sqrt(u*c)),g=r-o,y=j(Math.sqrt(u/c)),v=Math.abs(g)<5;let x;if(i||(i=v?ci.granular:ci.default),s||(s=v?hi.granular:hi.default),f<1){const t=xi(y,f);x=e=>{const n=Math.exp(-f*y*e);return r-n*((m+f*y*g)/t*Math.sin(t*e)+g*Math.cos(t*e))}}else if(1===f)x=t=>r-Math.exp(-y*t)*(g+(m+y*g)*t);else{const t=y*Math.sqrt(f*f-1);x=e=>{const n=Math.exp(-f*y*e),i=Math.min(t*e,300);return r-n*((m+f*y*g)*Math.sinh(i)+t*g*Math.cosh(i))/t}}const w={calculatedDuration:p&&h||null,next:t=>{const e=x(t);if(p)a.done=t>=h;else{let n=0;f<1&&(n=0===t?F(m):ni(x,t,e));const o=Math.abs(n)<=i,u=Math.abs(r-e)<=s;a.done=o&&u}return a.value=a.done?r:e,a},toString:()=>{const t=Math.min(lt(w),ut),e=Q((e=>w.next(t*e).value),t,30);return t+"ms "+e},toTransition:()=>{}};return w}function bi({keyframes:t,velocity:e=0,power:n=.8,timeConstant:i=325,bounceDamping:s=10,bounceStiffness:o=500,modifyTarget:r,min:a,max:u,restDelta:l=.5,restSpeed:c}){const h=t[0],d={done:!1,value:h},p=t=>void 0===a?u:void 0===u||Math.abs(a-t)<Math.abs(u-t)?a:u;let m=n*e;const f=h+m,g=void 0===r?f:r(f);g!==f&&(m=g-h);const y=t=>-m*Math.exp(-t/i),v=t=>g+y(t),x=t=>{const e=y(t),n=v(t);d.done=Math.abs(e)<=l,d.value=d.done?g:n};let w,P;const T=t=>{var e;(e=d.value,void 0!==a&&e<a||void 0!==u&&e>u)&&(w=t,P=Si({keyframes:[d.value,p(d.value)],velocity:ni(v,t,d.value),damping:s,stiffness:o,restDelta:l,restSpeed:c}))};return T(0),{calculatedDuration:null,next:t=>{let e=!1;return P||void 0!==w||(e=!0,x(t),T(t)),void 0!==w&&t>=w?P.next(t-w):(!e&&x(t),d)}}}Si.applyToOptions=t=>{const e=ct(t,100,Si);return t.ease=J()?e.ease:"easeOut",t.duration=F(e.duration),t.type="keyframes",t};const Ai=ee(.42,0,1,1),Ei=ee(0,0,.58,1),Mi=ee(.42,0,.58,1),Ci=t=>Array.isArray(t)&&"number"!=typeof t[0],Vi={linear:L,easeIn:Ai,easeInOut:Mi,easeOut:Ei,circIn:ue,circInOut:ce,circOut:le,backIn:oe,backInOut:re,backOut:se,anticipate:ae},Ri=t=>{if(_(t)){t.length;const[e,n,i,s]=t;return ee(e,n,i,s)}return"string"==typeof t?Vi[t]:t};function ki(t,e,{clamp:n=!0,ease:i,mixer:s}={}){const o=t.length;if(e.length,1===o)return()=>e[0];if(2===o&&e[0]===e[1])return()=>e[1];const r=t[0]===t[1];t[0]>t[o-1]&&(t=[...t].reverse(),e=[...e].reverse());const a=function(t,e,n){const i=[],s=n||ei,o=t.length-1;for(let n=0;n<o;n++){let o=s(t[n],t[n+1]);if(e){const t=Array.isArray(e)?e[n]||L:e;o=Gn(t,o)}i.push(o)}return i}(e,i,s),u=a.length,l=n=>{if(r&&n<t[0])return e[0];let i=0;if(u>1)for(;i<t.length-2&&!(n<t[i+1]);i++);const s=B(t[i],t[i+1],n);return a[i](s)};return n?e=>l(fe(t[0],t[o-1],e)):l}function Di(t,e){const n=t[t.length-1];for(let i=1;i<=e;i++){const s=B(0,e,i);t.push(zt(n,1,s))}}function Li(t){const e=[0];return Di(e,t.length-1),e}function Bi({duration:t=300,keyframes:e,times:n,ease:i="easeInOut"}){const s=Ci(i)?i.map(Ri):Ri(i),o={done:!1,value:e[0]},r=function(t,e){return t.map((t=>t*e))}(n&&n.length===e.length?n:Li(e),t),a=ki(r,e,{ease:Array.isArray(s)?s:(u=e,l=s,u.map((()=>l||Mi)).splice(0,u.length-1))});var u,l;return{calculatedDuration:t,next:e=>(o.value=a(e),o.done=e>=t,o)}}const Oi=t=>{const e=({timestamp:e})=>t(e);return{start:()=>yt.update(e,!0),stop:()=>vt(e),now:()=>xt.isProcessing?xt.timestamp:St.now()}},Fi={decay:bi,inertia:bi,tween:Bi,keyframes:Bi,spring:Si},ji=t=>t/100;class Ii extends Wn{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.teardown();const{onStop:t}=this.options;t&&t()};const{name:e,motionValue:n,element:i,keyframes:s}=this.options,o=i?.KeyframeResolver||Sn;this.resolver=new o(s,((t,e)=>this.onKeyframesResolved(t,e)),e,n,i),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:e="keyframes",repeat:n=0,repeatDelay:i=0,repeatType:s,velocity:o=0}=this.options,r=st(e)?e:Fi[e]||Bi;let a,u;r!==Bi&&"number"!=typeof t[0]&&(a=Gn(ji,ei(t[0],t[1])),t=[0,100]);const l=r({...this.options,keyframes:t});"mirror"===s&&(u=r({...this.options,keyframes:[...t].reverse(),velocity:-o})),null===l.calculatedDuration&&(l.calculatedDuration=lt(l));const{calculatedDuration:c}=l,h=c+i;return{generator:l,mirroredGenerator:u,mapPercentToKeyframes:a,calculatedDuration:c,resolvedDuration:h,totalDuration:h*(n+1)-i}}onPostResolved(){const{autoplay:t=!0}=this.options;this.play(),"paused"!==this.pendingPlayState&&t?this.state=this.pendingPlayState:this.pause()}tick(t,e=!1){const{resolved:n}=this;if(!n){const{keyframes:t}=this.options;return{done:!0,value:t[t.length-1]}}const{finalKeyframe:i,generator:s,mirroredGenerator:o,mapPercentToKeyframes:r,keyframes:a,calculatedDuration:u,totalDuration:l,resolvedDuration:c}=n;if(null===this.startTime)return s.next(0);const{delay:h,repeat:d,repeatType:p,repeatDelay:m,onUpdate:f}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-l/this.speed,this.startTime)),e?this.currentTime=t:null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const g=this.currentTime-h*(this.speed>=0?1:-1),y=this.speed>=0?g<0:g>l;this.currentTime=Math.max(g,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=l);let v=this.currentTime,x=s;if(d){const t=Math.min(this.currentTime,l)/c;let e=Math.floor(t),n=t%1;!n&&t>=1&&(n=1),1===n&&e--,e=Math.min(e,d+1);Boolean(e%2)&&("reverse"===p?(n=1-n,m&&(n-=m/c)):"mirror"===p&&(x=o)),v=fe(0,1,n)*c}const w=y?{done:!1,value:a[0]}:x.next(v);r&&(w.value=r(w.value));let{done:P}=w;y||null===u||(P=this.speed>=0?this.currentTime>=l:this.currentTime<=0);const T=null===this.holdTime&&("finished"===this.state||"running"===this.state&&P);return T&&void 0!==i&&(w.value=Un(a,this.options,i)),f&&f(w.value),T&&this.finish(),w}get duration(){const{resolved:t}=this;return t?j(t.calculatedDuration):0}get time(){return j(this.currentTime)}set time(t){t=F(t),this.currentTime=t,null!==this.holdTime||0===this.speed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const e=this.playbackSpeed!==t;this.playbackSpeed=t,e&&(this.time=j(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved)return void(this.pendingPlayState="running");if(this.isStopped)return;const{driver:t=Oi,onPlay:e,startTime:n}=this.options;this.driver||(this.driver=t((t=>this.tick(t)))),e&&e();const i=this.driver.now();null!==this.holdTime?this.startTime=i-this.holdTime:this.startTime?"finished"===this.state&&(this.startTime=i):this.startTime=n??this.calcStartTime(),"finished"===this.state&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){this._resolved?(this.state="paused",this.holdTime=this.currentTime??0):this.pendingPlayState="paused"}complete(){"running"!==this.state&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){null!==this.cancelTime&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}get finished(){return this.currentFinishedPromise}}function Ui(t){return new Ii(t)}const Wi=new Set(["opacity","clipPath","filter","transform"]),Ni=D((()=>Object.hasOwnProperty.call(Element.prototype,"animate")));const $i={anticipate:ae,backInOut:re,circInOut:ce};class zi extends Wn{constructor(t){super(t);const{name:e,motionValue:n,element:i,keyframes:s}=this.options;this.resolver=new On(s,((t,e)=>this.onKeyframesResolved(t,e)),e,n,i),this.resolver.scheduleResolve()}initPlayback(t,e){let{duration:n=300,times:i,ease:s,type:o,motionValue:r,name:a,startTime:u}=this.options;if(!r.owner||!r.owner.current)return!1;var l;if("string"==typeof s&&J()&&s in $i&&(s=$i[s]),st((l=this.options).type)||"spring"===l.type||!ht(l.ease)){const{onComplete:e,onUpdate:r,motionValue:a,element:u,...l}=this.options,c=function(t,e){const n=new Ii({...e,keyframes:t,repeat:0,delay:0,isGenerator:!0});let i={done:!1,value:t[0]};const s=[];let o=0;for(;!i.done&&o<2e4;)i=n.sample(o),s.push(i.value),o+=10;return{times:void 0,keyframes:s,duration:o-10,ease:"linear"}}(t,l);1===(t=c.keyframes).length&&(t[1]=t[0]),n=c.duration,i=c.times,s=c.ease,o="keyframes"}const c=it(r.owner.current,a,t,{...this.options,duration:n,times:i,ease:s});return c.startTime=u??this.calcStartTime(),this.pendingTimeline?(dt(c,this.pendingTimeline),this.pendingTimeline=void 0):c.onfinish=()=>{const{onComplete:n}=this.options;r.set(Un(t,this.options,e)),n&&n(),this.cancel(),this.resolveFinishedPromise()},{animation:c,duration:n,times:i,type:o,ease:s,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:e}=t;return j(e)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:e}=t;return j(e.currentTime||0)}set time(t){const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.currentTime=F(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:e}=t;return e.playbackRate}get finished(){return this.resolved.animation.finished}set speed(t){const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:e}=t;return e.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:e}=t;return e.startTime}attachTimeline(t){if(this._resolved){const{resolved:e}=this;if(!e)return L;const{animation:n}=e;dt(n,t)}else this.pendingTimeline=t;return L}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:e}=t;"finished"===e.playState&&this.updateFinishedPromise(),e.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:e}=t;e.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:e,keyframes:n,duration:i,type:s,ease:o,times:r}=t;if("idle"===e.playState||"finished"===e.playState)return;if(this.time){const{motionValue:t,onUpdate:e,onComplete:a,element:u,...l}=this.options,c=new Ii({...l,keyframes:n,duration:i,type:s,ease:o,times:r,isGenerator:!0}),h=F(this.time);t.setWithVelocity(c.sample(h-10).value,c.sample(h).value,10)}const{onStop:a}=this.options;a&&a(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:e,name:n,repeatDelay:i,repeatType:s,damping:o,type:r}=t;if(!(e&&e.owner&&e.owner.current instanceof HTMLElement))return!1;const{onUpdate:a,transformTemplate:u}=e.owner.getProps();return Ni()&&n&&Wi.has(n)&&("transform"!==n||!u)&&!a&&!i&&"mirror"!==s&&0!==o&&"inertia"!==r}}const Hi={type:"spring",stiffness:500,damping:25,restSpeed:10},Xi={type:"keyframes",duration:.8},Yi={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Ki=(t,{keyframes:e})=>e.length>2?Xi:pe.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:Hi:Yi;const Gi=(t,e,n,i={},s,o)=>r=>{const a=at(i,t)||{},u=a.delay||i.delay||0;let{elapsed:l=0}=i;l-=F(u);let c={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-l,onUpdate:t=>{e.set(t),a.onUpdate&&a.onUpdate(t)},onComplete:()=>{r(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:o?void 0:s};(function({when:t,delay:e,delayChildren:n,staggerChildren:i,staggerDirection:s,repeat:o,repeatType:r,repeatDelay:a,from:u,elapsed:l,...c}){return!!Object.keys(c).length})(a)||(c={...c,...Ki(t,c)}),c.duration&&(c.duration=F(c.duration)),c.repeatDelay&&(c.repeatDelay=F(c.repeatDelay)),void 0!==c.from&&(c.keyframes[0]=c.from);let h=!1;if((!1===c.type||0===c.duration&&!c.repeatDelay)&&(c.duration=0,0===c.delay&&(h=!0)),(Qt.current||k.skipAnimations)&&(h=!0,c.duration=0,c.delay=0),c.allowFlatten=!a.type&&!a.ease,h&&!o&&void 0!==e.get()){const t=Un(c.keyframes,a);if(void 0!==t)return yt.update((()=>{c.onUpdate(t),c.onComplete()})),new N([])}return!o&&zi.supports(c)?new zi(c):new Ii(c)};function _i(t,e,n){const i=Jt(t)?t:Wt(t);return i.start(Gi("",i,e,n)),i.animation}const qi=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Zi="framerAppearId",Ji="data-"+qi(Zi);function Qi(t){return t.props[Ji]}function ts(t){return t instanceof SVGElement&&"svg"!==t.tagName}const es=(t,e)=>t.depth-e.depth;class ns{constructor(){this.children=[],this.isDirty=!1}add(t){C(this.children,t),this.isDirty=!0}remove(t){V(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(es),this.isDirty=!1,this.children.forEach(t)}}function is(t,e){const n=St.now(),i=({timestamp:s})=>{const o=s-n;o>=e&&(vt(i),t(o-e))};return yt.read(i,!0),()=>vt(i)}const ss=t=>Array.isArray(t);function os(t){const e=Jt(t)?t.get():t;return n=e,Boolean(n&&"object"==typeof n&&n.mix&&n.toValue)?e.toValue():e;var n}const rs=["TopLeft","TopRight","BottomLeft","BottomRight"],as=rs.length,us=t=>"string"==typeof t?parseFloat(t):t,ls=t=>"number"==typeof t||Re.test(t);function cs(t,e){return void 0!==t[e]?t[e]:t.borderRadius}const hs=ps(0,.5,le),ds=ps(.5,.95,L);function ps(t,e,n){return i=>i<t?0:i>e?1:n(B(t,e,i))}function ms(t,e){t.min=e.min,t.max=e.max}function fs(t,e){ms(t.x,e.x),ms(t.y,e.y)}function gs(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function ys(t){return void 0===t||1===t}function vs({scale:t,scaleX:e,scaleY:n}){return!ys(t)||!ys(e)||!ys(n)}function xs(t){return vs(t)||ws(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function ws(t){return Ps(t.x)||Ps(t.y)}function Ps(t){return t&&"0%"!==t}function Ts(t,e,n){return n+e*(t-n)}function Ss(t,e,n,i,s){return void 0!==s&&(t=Ts(t,s,i)),Ts(t,n,i)+e}function bs(t,e=0,n=1,i,s){t.min=Ss(t.min,e,n,i,s),t.max=Ss(t.max,e,n,i,s)}function As(t,{x:e,y:n}){bs(t.x,e.translate,e.scale,e.originPoint),bs(t.y,n.translate,n.scale,n.originPoint)}const Es=.999999999999,Ms=1.0000000000001;function Cs(t,e){t.min=t.min+e,t.max=t.max+e}function Vs(t,e,n,i,s=.5){bs(t,e,n,zt(t.min,t.max,s),i)}function Rs(t,e){Vs(t.x,e.x,e.scaleX,e.scale,e.originX),Vs(t.y,e.y,e.scaleY,e.scale,e.originY)}function ks(t,e,n,i,s){return t=Ts(t-=e,1/n,i),void 0!==s&&(t=Ts(t,1/s,i)),t}function Ds(t,e,[n,i,s],o,r){!function(t,e=0,n=1,i=.5,s,o=t,r=t){Ve.test(e)&&(e=parseFloat(e),e=zt(r.min,r.max,e/100)-r.min);if("number"!=typeof e)return;let a=zt(o.min,o.max,i);t===o&&(a-=e),t.min=ks(t.min,e,n,a,s),t.max=ks(t.max,e,n,a,s)}(t,e[n],e[i],e[s],e.scale,o,r)}const Ls=["x","scaleX","originX"],Bs=["y","scaleY","originY"];function Os(t,e,n,i){Ds(t.x,e,Ls,n?n.x:void 0,i?i.x:void 0),Ds(t.y,e,Bs,n?n.y:void 0,i?i.y:void 0)}const Fs=()=>({x:{min:0,max:0},y:{min:0,max:0}});function js(t){return 0===t.translate&&1===t.scale}function Is(t){return js(t.x)&&js(t.y)}function Us(t,e){return t.min===e.min&&t.max===e.max}function Ws(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function Ns(t,e){return Ws(t.x,e.x)&&Ws(t.y,e.y)}function $s(t){return Ht(t.x)/Ht(t.y)}function zs(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}class Hs{constructor(){this.members=[]}add(t){C(this.members,t),t.scheduleRender()}remove(t){if(V(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const t=this.members[this.members.length-1];t&&this.promote(t)}}relegate(t){const e=this.members.findIndex((e=>t===e));if(0===e)return!1;let n;for(let t=e;t>=0;t--){const e=this.members[t];if(!1!==e.isPresent){n=e;break}}return!!n&&(this.promote(n),!0)}promote(t,e){const n=this.lead;if(t!==n&&(this.prevLead=n,this.lead=t,t.show(),n)){n.instance&&n.scheduleRender(),t.scheduleRender(),t.resumeFrom=n,e&&(t.resumeFrom.preserveOpacity=!0),n.snapshot&&(t.snapshot=n.snapshot,t.snapshot.latestValues=n.animationValues||n.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:i}=t.options;!1===i&&n.hide()}}exitAnimationComplete(){this.members.forEach((t=>{const{options:e,resumingFrom:n}=t;e.onExitComplete&&e.onExitComplete(),n&&n.options.onExitComplete&&n.options.onExitComplete()}))}scheduleRender(){this.members.forEach((t=>{t.instance&&t.scheduleRender(!1)}))}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}const Xs={};function Ys(t){for(const e in t)Xs[e]=t[e],En(e)&&(Xs[e].isCSSVariable=!0)}function Ks(t){return[t("x"),t("y")]}const Gs={hasAnimatedSinceResize:!0,hasEverUpdated:!1},_s=["","X","Y","Z"],qs={visibility:"hidden"};let Zs=0;function Js(t,e,n,i){const{latestValues:s}=e;s[t]&&(n[t]=s[t],e.setStaticValue(t,0),i&&(i[t]=0))}function Qs(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=Qi(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:e,layoutId:i}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",yt,!(e||i))}const{parent:i}=t;i&&!i.hasCheckedOptimisedAppear&&Qs(i)}function to({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:i,resetTransform:s}){return class{constructor(t={},n=e?.()){this.id=Zs++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(io),this.nodes.forEach(co),this.nodes.forEach(ho),this.nodes.forEach(so)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=t,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let t=0;t<this.path.length;t++)this.path[t].shouldResetTransform=!0;this.root===this&&(this.nodes=new ns)}addEventListener(t,e){return this.eventHandlers.has(t)||this.eventHandlers.set(t,new O),this.eventHandlers.get(t).add(e)}notifyListeners(t,...e){const n=this.eventHandlers.get(t);n&&n.notify(...e)}hasListeners(t){return this.eventHandlers.has(t)}mount(e,n=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=ts(e),this.instance=e;const{layoutId:i,layout:s,visualElement:o}=this.options;if(o&&!o.current&&o.mount(e),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),n&&(s||i)&&(this.isLayoutDirty=!0),t){let n;const i=()=>this.root.updateBlockedByResize=!1;t(e,(()=>{this.root.updateBlockedByResize=!0,n&&n(),n=is(i,250),Gs.hasAnimatedSinceResize&&(Gs.hasAnimatedSinceResize=!1,this.nodes.forEach(lo))}))}i&&this.root.registerSharedNode(i,this),!1!==this.options.animate&&o&&(i||s)&&this.addEventListener("didUpdate",(({delta:t,hasLayoutChanged:e,hasRelativeLayoutChanged:n,layout:i})=>{if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const s=this.options.transition||o.getDefaultTransition()||vo,{onLayoutAnimationStart:r,onLayoutAnimationComplete:a}=o.getProps(),u=!this.targetLayout||!Ns(this.targetLayout,i),l=!e&&n;if(this.options.layoutRoot||this.resumeFrom||l||e&&(u||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(t,l);const e={...at(s,"layout"),onPlay:r,onComplete:a};(o.shouldReduceMotion||this.options.layoutRoot)&&(e.delay=0,e.type=!1),this.startAnimation(e)}else e||lo(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=i}))}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const t=this.getStack();t&&t.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,vt(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(po),this.animationId++)}getTransformTemplate(){const{visualElement:t}=this.options;return t&&t.getProps().transformTemplate}willUpdate(t=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked())return void(this.options.onExitComplete&&this.options.onExitComplete());if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Qs(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let t=0;t<this.path.length;t++){const e=this.path[t];e.shouldResetTransform=!0,e.updateScroll("snapshot"),e.options.layoutRoot&&e.willUpdate(!1)}const{layoutId:e,layout:n}=this.options;if(void 0===e&&!n)return;const i=this.getTransformTemplate();this.prevTransformTemplateValue=i?i(this.latestValues,""):void 0,this.updateSnapshot(),t&&this.notifyListeners("willUpdate")}update(){this.updateScheduled=!1;if(this.isUpdateBlocked())return this.unblockUpdate(),this.clearAllSnapshots(),void this.nodes.forEach(ro);this.isUpdating||this.nodes.forEach(ao),this.isUpdating=!1,this.nodes.forEach(uo),this.nodes.forEach(eo),this.nodes.forEach(no),this.clearAllSnapshots();const t=St.now();xt.delta=fe(0,1e3/60,t-xt.timestamp),xt.timestamp=t,xt.isProcessing=!0,wt.update.process(xt),wt.preRender.process(xt),wt.render.process(xt),xt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,ft.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(oo),this.sharedNodes.forEach(mo)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,yt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){yt.postRender((()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()}))}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),!this.snapshot||Ht(this.snapshot.measuredBox.x)||Ht(this.snapshot.measuredBox.y)||(this.snapshot=void 0))}updateLayout(){if(!this.instance)return;if(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let t=0;t<this.path.length;t++){this.path[t].updateScroll()}const t=this.layout;this.layout=this.measure(!1),this.layoutCorrected={x:{min:0,max:0},y:{min:0,max:0}},this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:e}=this.options;e&&e.notify("LayoutMeasure",this.layout.layoutBox,t?t.layoutBox:void 0)}updateScroll(t="measure"){let e=Boolean(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===t&&(e=!1),e){const e=i(this.instance);this.scroll={animationId:this.root.animationId,phase:t,isRoot:e,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:e}}}resetTransform(){if(!s)return;const t=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,e=this.projectionDelta&&!Is(this.projectionDelta),n=this.getTransformTemplate(),i=n?n(this.latestValues,""):void 0,o=i!==this.prevTransformTemplateValue;t&&(e||xs(this.latestValues)||o)&&(s(this.instance,i),this.shouldResetTransform=!1,this.scheduleRender())}measure(t=!0){const e=this.measurePageBox();let n=this.removeElementScroll(e);var i;return t&&(n=this.removeTransform(n)),Po((i=n).x),Po(i.y),{animationId:this.root.animationId,measuredBox:e,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:t}=this.options;if(!t)return{x:{min:0,max:0},y:{min:0,max:0}};const e=t.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(So))){const{scroll:t}=this.root;t&&(Cs(e.x,t.offset.x),Cs(e.y,t.offset.y))}return e}removeElementScroll(t){const e={x:{min:0,max:0},y:{min:0,max:0}};if(fs(e,t),this.scroll?.wasRoot)return e;for(let n=0;n<this.path.length;n++){const i=this.path[n],{scroll:s,options:o}=i;i!==this.root&&s&&o.layoutScroll&&(s.wasRoot&&fs(e,t),Cs(e.x,s.offset.x),Cs(e.y,s.offset.y))}return e}applyTransform(t,e=!1){const n={x:{min:0,max:0},y:{min:0,max:0}};fs(n,t);for(let t=0;t<this.path.length;t++){const i=this.path[t];!e&&i.options.layoutScroll&&i.scroll&&i!==i.root&&Rs(n,{x:-i.scroll.offset.x,y:-i.scroll.offset.y}),xs(i.latestValues)&&Rs(n,i.latestValues)}return xs(this.latestValues)&&Rs(n,this.latestValues),n}removeTransform(t){const e={x:{min:0,max:0},y:{min:0,max:0}};fs(e,t);for(let t=0;t<this.path.length;t++){const n=this.path[t];if(!n.instance)continue;if(!xs(n.latestValues))continue;vs(n.latestValues)&&n.updateSnapshot();const i={x:{min:0,max:0},y:{min:0,max:0}};fs(i,n.measurePageBox()),Os(e,n.latestValues,n.snapshot?n.snapshot.layoutBox:void 0,i)}return xs(this.latestValues)&&Os(e,this.latestValues),e}setTargetDelta(t){this.targetDelta=t,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}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}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==xt.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(t=!1){const e=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=e.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=e.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=e.isSharedProjectionDirty);const n=Boolean(this.resumingFrom)||this!==e;if(!(t||n&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:i,layoutId:s}=this.options;if(this.layout&&(i||s)){if(this.resolvedRelativeTargetAt=xt.timestamp,!this.targetDelta&&!this.relativeTarget){const t=this.getClosestProjectingParent();t&&t.layout&&1!==this.animationProgress?(this.relativeParent=t,this.forceRelativeParentToResolveTarget(),this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},_t(this.relativeTargetOrigin,this.layout.layoutBox,t.layout.layoutBox),fs(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}var o,r,a;if(this.relativeTarget||this.targetDelta)if(this.target||(this.target={x:{min:0,max:0},y:{min:0,max:0}},this.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}}),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),o=this.target,r=this.relativeTarget,a=this.relativeParent.target,Kt(o.x,r.x,a.x),Kt(o.y,r.y,a.y)):this.targetDelta?(Boolean(this.resumingFrom)?this.target=this.applyTransform(this.layout.layoutBox):fs(this.target,this.layout.layoutBox),As(this.target,this.targetDelta)):fs(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&&1!==this.animationProgress?(this.relativeParent=t,this.forceRelativeParentToResolveTarget(),this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},_t(this.relativeTargetOrigin,this.target,t.target),fs(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(this.parent&&!vs(this.parent.latestValues)&&!ws(this.parent.latestValues))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return Boolean((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){const t=this.getLead(),e=Boolean(this.resumingFrom)||this!==t;let n=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(n=!1),e&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===xt.timestamp&&(n=!1),n)return;const{layout:i,layoutId:s}=this.options;if(this.isTreeAnimating=Boolean(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!i&&!s)return;fs(this.layoutCorrected,this.layout.layoutBox);const o=this.treeScale.x,r=this.treeScale.y;!function(t,e,n,i=!1){const s=n.length;if(!s)return;let o,r;e.x=e.y=1;for(let a=0;a<s;a++){o=n[a],r=o.projectionDelta;const{visualElement:s}=o.options;s&&s.props.style&&"contents"===s.props.style.display||(i&&o.options.layoutScroll&&o.scroll&&o!==o.root&&Rs(t,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),r&&(e.x*=r.x.scale,e.y*=r.y.scale,As(t,r)),i&&xs(o.latestValues)&&Rs(t,o.latestValues))}e.x<Ms&&e.x>Es&&(e.x=1),e.y<Ms&&e.y>Es&&(e.y=1)}(this.layoutCorrected,this.treeScale,this.path,e),!t.layout||t.target||1===this.treeScale.x&&1===this.treeScale.y||(t.target=t.layout.layoutBox,t.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}});const{target:a}=t;a?(this.projectionDelta&&this.prevProjectionDelta?(gs(this.prevProjectionDelta.x,this.projectionDelta.x),gs(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),Yt(this.projectionDelta,this.layoutCorrected,a,this.latestValues),this.treeScale.x===o&&this.treeScale.y===r&&zs(this.projectionDelta.x,this.prevProjectionDelta.x)&&zs(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",a))):this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender())}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(t=!0){if(this.options.visualElement?.scheduleRender(),t){const t=this.getStack();t&&t.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},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}}}setAnimationOrigin(t,e=!1){const n=this.snapshot,i=n?n.latestValues:{},s={...this.latestValues},o={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!e;const r={x:{min:0,max:0},y:{min:0,max:0}},a=(n?n.source:void 0)!==(this.layout?this.layout.source:void 0),u=this.getStack(),l=!u||u.members.length<=1,c=Boolean(a&&!l&&!0===this.options.crossfade&&!this.path.some(yo));let h;this.animationProgress=0,this.mixTargetDelta=e=>{const n=e/1e3;var u,d;fo(o.x,t.x,n),fo(o.y,t.y,n),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(_t(r,this.layout.layoutBox,this.relativeParent.layout.layoutBox),function(t,e,n,i){go(t.x,e.x,n.x,i),go(t.y,e.y,n.y,i)}(this.relativeTarget,this.relativeTargetOrigin,r,n),h&&(u=this.relativeTarget,d=h,Us(u.x,d.x)&&Us(u.y,d.y))&&(this.isProjectionDirty=!1),h||(h={x:{min:0,max:0},y:{min:0,max:0}}),fs(h,this.relativeTarget)),a&&(this.animationValues=s,function(t,e,n,i,s,o){s?(t.opacity=zt(0,n.opacity??1,hs(i)),t.opacityExit=zt(e.opacity??1,0,ds(i))):o&&(t.opacity=zt(e.opacity??1,n.opacity??1,i));for(let s=0;s<as;s++){const o=`border${rs[s]}Radius`;let r=cs(e,o),a=cs(n,o);void 0===r&&void 0===a||(r||(r=0),a||(a=0),0===r||0===a||ls(r)===ls(a)?(t[o]=Math.max(zt(us(r),us(a),i),0),(Ve.test(a)||Ve.test(r))&&(t[o]+="%")):t[o]=a)}(e.rotate||n.rotate)&&(t.rotate=zt(e.rotate||0,n.rotate||0,i))}(s,i,this.latestValues,n,c,l)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(t){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(vt(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=yt.update((()=>{Gs.hasAnimatedSinceResize=!0,this.currentAnimation=_i(0,1e3,{...t,onUpdate:e=>{this.mixTargetDelta(e),t.onUpdate&&t.onUpdate(e)},onStop:()=>{},onComplete:()=>{t.onComplete&&t.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0}))}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const t=this.getStack();t&&t.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const t=this.getLead();let{targetWithTransforms:e,target:n,layout:i,latestValues:s}=t;if(e&&n&&i){if(this!==t&&this.layout&&i&&To(this.options.animationType,this.layout.layoutBox,i.layoutBox)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const e=Ht(this.layout.layoutBox.x);n.x.min=t.target.x.min,n.x.max=n.x.min+e;const i=Ht(this.layout.layoutBox.y);n.y.min=t.target.y.min,n.y.max=n.y.min+i}fs(e,n),Rs(e,s),Yt(this.projectionDeltaWithTransform,this.layoutCorrected,e,s)}}registerSharedNode(t,e){this.sharedNodes.has(t)||this.sharedNodes.set(t,new Hs);this.sharedNodes.get(t).add(e);const n=e.options.initialPromotionConfig;e.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(e):void 0})}isLead(){const t=this.getStack();return!t||t.lead===this}getLead(){const{layoutId:t}=this.options;return t&&this.getStack()?.lead||this}getPrevLead(){const{layoutId:t}=this.options;return t?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:t}=this.options;if(t)return this.root.sharedNodes.get(t)}promote({needsReset:t,transition:e,preserveFollowOpacity:n}={}){const i=this.getStack();i&&i.promote(this,n),t&&(this.projectionDelta=void 0,this.needsReset=!0),e&&this.setOptions({transition:e})}relegate(){const t=this.getStack();return!!t&&t.relegate(this)}resetSkewAndRotation(){const{visualElement:t}=this.options;if(!t)return;let e=!1;const{latestValues:n}=t;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(e=!0),!e)return;const i={};n.z&&Js("z",t,i,this.animationValues);for(let e=0;e<_s.length;e++)Js(`rotate${_s[e]}`,t,i,this.animationValues),Js(`skew${_s[e]}`,t,i,this.animationValues);t.render();for(const e in i)t.setStaticValue(e,i[e]),this.animationValues&&(this.animationValues[e]=i[e]);t.scheduleRender()}getProjectionStyles(t){if(!this.instance||this.isSVG)return;if(!this.isVisible)return qs;const e={visibility:""},n=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,e.opacity="",e.pointerEvents=os(t?.pointerEvents)||"",e.transform=n?n(this.latestValues,""):"none",e;const i=this.getLead();if(!this.projectionDelta||!this.layout||!i.target){const e={};return this.options.layoutId&&(e.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,e.pointerEvents=os(t?.pointerEvents)||""),this.hasProjected&&!xs(this.latestValues)&&(e.transform=n?n({},""):"none",this.hasProjected=!1),e}const s=i.animationValues||i.latestValues;this.applyTransformsToTarget(),e.transform=function(t,e,n){let i="";const s=t.x.translate/e.x,o=t.y.translate/e.y,r=n?.z||0;if((s||o||r)&&(i=`translate3d(${s}px, ${o}px, ${r}px) `),1===e.x&&1===e.y||(i+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:t,rotate:e,rotateX:s,rotateY:o,skewX:r,skewY:a}=n;t&&(i=`perspective(${t}px) ${i}`),e&&(i+=`rotate(${e}deg) `),s&&(i+=`rotateX(${s}deg) `),o&&(i+=`rotateY(${o}deg) `),r&&(i+=`skewX(${r}deg) `),a&&(i+=`skewY(${a}deg) `)}const a=t.x.scale*e.x,u=t.y.scale*e.y;return 1===a&&1===u||(i+=`scale(${a}, ${u})`),i||"none"}(this.projectionDeltaWithTransform,this.treeScale,s),n&&(e.transform=n(s,e.transform));const{x:o,y:r}=this.projectionDelta;e.transformOrigin=`${100*o.origin}% ${100*r.origin}% 0`,i.animationValues?e.opacity=i===this?s.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:s.opacityExit:e.opacity=i===this?void 0!==s.opacity?s.opacity:"":void 0!==s.opacityExit?s.opacityExit:0;for(const t in Xs){if(void 0===s[t])continue;const{correct:n,applyTo:o,isCSSVariable:r}=Xs[t],a="none"===e.transform?s[t]:n(s[t],i);if(o){const t=o.length;for(let n=0;n<t;n++)e[o[n]]=a}else r?this.options.visualElement.renderState.vars[t]=a:e[t]=a}return this.options.layoutId&&(e.pointerEvents=i===this?os(t?.pointerEvents)||"":"none"),e}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach((t=>t.currentAnimation?.stop())),this.root.nodes.forEach(ro),this.root.sharedNodes.clear()}}}function eo(t){t.updateLayout()}function no(t){const e=t.resumeFrom?.snapshot||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:i}=t.layout,{animationType:s}=t.options,o=e.source!==t.layout.source;"size"===s?Ks((t=>{const i=o?e.measuredBox[t]:e.layoutBox[t],s=Ht(i);i.min=n[t].min,i.max=i.min+s})):To(s,e.layoutBox,n)&&Ks((i=>{const s=o?e.measuredBox[i]:e.layoutBox[i],r=Ht(n[i]);s.max=s.min+r,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[i].max=t.relativeTarget[i].min+r)}));const r={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};Yt(r,n,e.layoutBox);const a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};o?Yt(a,t.applyTransform(i,!0),e.measuredBox):Yt(a,n,e.layoutBox);const u=!Is(r);let l=!1;if(!t.resumeFrom){const i=t.getClosestProjectingParent();if(i&&!i.resumeFrom){const{snapshot:s,layout:o}=i;if(s&&o){const r={x:{min:0,max:0},y:{min:0,max:0}};_t(r,e.layoutBox,s.layoutBox);const a={x:{min:0,max:0},y:{min:0,max:0}};_t(a,n,o.layoutBox),Ns(r,a)||(l=!0),i.options.layoutRoot&&(t.relativeTarget=a,t.relativeTargetOrigin=r,t.relativeParent=i)}}}t.notifyListeners("didUpdate",{layout:n,snapshot:e,delta:a,layoutDelta:r,hasLayoutChanged:u,hasRelativeLayoutChanged:l})}else if(t.isLead()){const{onExitComplete:e}=t.options;e&&e()}t.options.transition=void 0}function io(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=Boolean(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function so(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function oo(t){t.clearSnapshot()}function ro(t){t.clearMeasurements()}function ao(t){t.isLayoutDirty=!1}function uo(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function lo(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function co(t){t.resolveTargetDelta()}function ho(t){t.calcProjection()}function po(t){t.resetSkewAndRotation()}function mo(t){t.removeLeadSnapshot()}function fo(t,e,n){t.translate=zt(e.translate,0,n),t.scale=zt(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function go(t,e,n,i){t.min=zt(e.min,n.min,i),t.max=zt(e.max,n.max,i)}function yo(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}const vo={duration:.45,ease:[.4,0,.1,1]},xo=t=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),wo=xo("applewebkit/")&&!xo("chrome/")?Math.round:L;function Po(t){t.min=wo(t.min),t.max=wo(t.max)}function To(t,e,n){return"position"===t||"preserve-aspect"===t&&(i=$s(e),s=$s(n),o=.2,!(Math.abs(i-s)<=o));var i,s,o}function So(t){return t!==t.root&&t.scroll?.wasRoot}function bo(t,e,n,i={passive:!0}){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n)}const Ao=to({attachResizeListener:(t,e)=>bo(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Eo={current:void 0},Mo=to({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Eo.current){const t=new Ao({});t.mount(window),t.setOptions({layoutScroll:!0}),Eo.current=t}return Eo.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)});function Co(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Vo={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!Re.test(t))return t;t=parseFloat(t)}return`${Co(t,e.target.x)}% ${Co(t,e.target.y)}%`}},Ro={correct:(t,{treeScale:e,projectionDelta:n})=>{const i=t,s=He.parse(t);if(s.length>5)return i;const o=He.createTransformer(t),r="number"!=typeof s[0]?1:0,a=n.x.scale*e.x,u=n.y.scale*e.y;s[0+r]/=a,s[1+r]/=u;const l=zt(a,u,.5);return"number"==typeof s[2+r]&&(s[2+r]/=l),"number"==typeof s[3+r]&&(s[3+r]/=l),o(s)}};function ko({top:t,left:e,right:n,bottom:i}){return{x:{min:e,max:n},y:{min:t,max:i}}}function Do(t,e){return ko(function(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),i=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}(t.getBoundingClientRect(),e))}const Lo={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Bo={};for(const t in Lo)Bo[t]={isEnabled:e=>Lo[t].some((t=>!!e[t]))};const Oo={current:null},Fo={current:!1};function jo(){if(Fo.current=!0,g)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Oo.current=t.matches;t.addListener(e),e()}else Oo.current=!1}const Io=[...Ln,Oe,He],Uo=new WeakMap;function Wo(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}function No(t){return"string"==typeof t||Array.isArray(t)}const $o=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],zo=["initial",...$o];function Ho(t){return Wo(t.animate)||zo.some((e=>No(t[e])))}function Xo(t){return Boolean(Ho(t)||t.variants)}function Yo(t){const e=[{},{}];return t?.values.forEach(((t,n)=>{e[0][n]=t.get(),e[1][n]=t.getVelocity()})),e}function Ko(t,e,n,i){if("function"==typeof e){const[s,o]=Yo(i);e=e(void 0!==n?n:t.custom,s,o)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){const[s,o]=Yo(i);e=e(void 0!==n?n:t.custom,s,o)}return e}const Go=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class _o{scrapeMotionValuesFromProps(t,e,n){return{}}constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:i,blockInitialAnimation:s,visualState:o},r={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Sn,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const t=St.now();this.renderScheduledAt<t&&(this.renderScheduledAt=t,yt.render(this.render,!1,!0))};const{latestValues:a,renderState:u,onUpdate:l}=o;this.onUpdate=l,this.latestValues=a,this.baseTarget={...a},this.initialValues=e.initial?{...a}:{},this.renderState=u,this.parent=t,this.props=e,this.presenceContext=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.options=r,this.blockInitialAnimation=Boolean(s),this.isControllingVariants=Ho(e),this.isVariantNode=Xo(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:c,...h}=this.scrapeMotionValuesFromProps(e,{},this);for(const t in h){const e=h[t];void 0!==a[t]&&Jt(e)&&e.set(a[t],!1)}}mount(t){this.current=t,Uo.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach(((t,e)=>this.bindToMotionValue(e,t))),Fo.current||jo(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||Oo.current),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),vt(this.notifyUpdate),vt(this.render),this.valueSubscriptions.forEach((t=>t())),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}bindToMotionValue(t,e){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const n=pe.has(t);n&&this.onBindTransform&&this.onBindTransform();const i=e.on("change",(e=>{this.latestValues[t]=e,this.props.onUpdate&&yt.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0)})),s=e.on("renderRequest",this.scheduleRender);let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,(()=>{i(),s(),o&&o(),e.owner&&e.stop()}))}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}updateFeatures(){let t="animation";for(t in Bo){const e=Bo[t];if(!e)continue;const{isEnabled:n,Feature:i}=e;if(!this.features[t]&&i&&n(this.props)&&(this.features[t]=new i(this)),this.features[t]){const e=this.features[t];e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,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}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;e<Go.length;e++){const n=Go[e];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);const i=t["on"+n];i&&(this.propEventSubscriptions[n]=this.on(n,i))}this.prevMotionValues=function(t,e,n){for(const i in e){const s=e[i],o=n[i];if(Jt(s))t.addValue(i,s);else if(Jt(o))t.addValue(i,Wt(s,{owner:t}));else if(o!==s)if(t.hasValue(i)){const e=t.getValue(i);!0===e.liveStyle?e.jump(s):e.hasAnimated||e.set(s)}else{const e=t.getStaticValue(i);t.addValue(i,Wt(void 0!==e?e:s,{owner:t}))}}for(const i in n)void 0===e[i]&&t.removeValue(i);return e}(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const e=this.getClosestVariantNode();if(e)return e.variantChildren&&e.variantChildren.add(t),()=>e.variantChildren.delete(t)}addValue(t,e){const n=this.values.get(t);e!==n&&(n&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e),this.latestValues[t]=e.get())}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return void 0===n&&void 0!==e&&(n=Wt(null===e?void 0:e,{owner:this}),this.addValue(t,n)),n}readValue(t,e){let n=void 0===this.latestValues[t]&&this.current?this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];var i;return null!=n&&("string"==typeof n&&(bn(n)||he(n))?n=parseFloat(n):(i=n,!Io.find(Dn(i))&&He.test(e)&&(n=en(t,e))),this.setBaseTarget(t,Jt(n)?n.get():n)),Jt(n)?n.get():n}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){const{initial:e}=this.props;let n;if("string"==typeof e||"object"==typeof e){const i=Ko(this.props,e,this.presenceContext?.custom);i&&(n=i[t])}if(e&&void 0!==n)return n;const i=this.getBaseTargetFromProps(this.props,t);return void 0===i||Jt(i)?void 0!==this.initialValues[t]&&void 0===n?void 0:this.baseTarget[t]:i}on(t,e){return this.events[t]||(this.events[t]=new O),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}}class qo extends _o{constructor(){super(...arguments),this.KeyframeResolver=On}sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){return t.style?t.style[e]:void 0}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Jt(t)&&(this.childSubscription=t.on("change",(t=>{this.current&&(this.current.textContent=`${t}`)})))}}const Zo=(t,e)=>e&&"number"==typeof t?e.transform(t):t,Jo={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Qo=de.length;function tr(t,e,n){let i="",s=!0;for(let o=0;o<Qo;o++){const r=de[o],a=t[r];if(void 0===a)continue;let u=!0;if(u="number"==typeof a?a===(r.startsWith("scale")?1:0):0===parseFloat(a),!u||n){const t=Zo(a,Je[r]);if(!u){s=!1;i+=`${Jo[r]||r}(${t}) `}n&&(e[r]=t)}}return i=i.trim(),n?i=n(e,s?"":i):s&&(i="none"),i}function er(t,e,n){const{style:i,vars:s,transformOrigin:o}=t;let r=!1,a=!1;for(const t in e){const n=e[t];if(pe.has(t))r=!0;else if(En(t))s[t]=n;else{const e=Zo(n,Je[t]);t.startsWith("origin")?(a=!0,o[t]=e):i[t]=e}}if(e.transform||(r||n?i.transform=tr(e,t.transform,n):i.transform&&(i.transform="none")),a){const{originX:t="50%",originY:e="50%",originZ:n=0}=o;i.transformOrigin=`${t} ${e} ${n}`}}function nr(t,{style:e,vars:n},i,s){Object.assign(t.style,e,s&&s.getProjectionStyles(i));for(const e in n)t.style.setProperty(e,n[e])}function ir(t,{layout:e,layoutId:n}){return pe.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!Xs[t]||"opacity"===t)}function sr(t,e,n){const{style:i}=t,s={};for(const o in i)(Jt(i[o])||e.style&&Jt(e.style[o])||ir(o,t)||void 0!==n?.getValue(o)?.liveStyle)&&(s[o]=i[o]);return s}class or extends qo{constructor(){super(...arguments),this.type="html",this.renderInstance=nr}readValueFromInstance(t,e){if(pe.has(e))return((t,e)=>{const{transform:n="none"}=getComputedStyle(t);return dn(n,e)})(t,e);{const i=(n=t,window.getComputedStyle(n)),s=(En(e)?i.getPropertyValue(e):i[e])||0;return"string"==typeof s?s.trim():s}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return Do(t,e)}build(t,e,n){er(t,e,n.transformTemplate)}scrapeMotionValuesFromProps(t,e,n){return sr(t,e,n)}}function rr(){const t=function(){const t=e.useRef(!1);return y((()=>(t.current=!0,()=>{t.current=!1})),[]),t}(),[n,i]=e.useState(0),s=e.useCallback((()=>{t.current&&i(n+1)}),[n]);return[e.useCallback((()=>yt.postRender(s)),[s]),n]}const ar=t=>!0===t,ur=({children:t,id:n,inherit:i=!0})=>{const s=e.useContext(m),o=e.useContext(M),[r,a]=rr(),u=e.useRef(null),l=s.id||o;null===u.current&&((t=>ar(!0===t)||"id"===t)(i)&&l&&(n=n?l+"-"+n:l),u.current={id:n,group:ar(i)&&s.group||Zt()});const c=e.useMemo((()=>({...u.current,forceRender:r})),[a]);return d(m.Provider,{value:c,children:t})},lr=e.createContext({strict:!1});function cr(t){for(const e in t)Bo[e]={...Bo[e],...t[e]}}function hr(t){return"function"==typeof t}const dr=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function pr(t){return t.startsWith("while")||t.startsWith("drag")&&"draggable"!==t||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||dr.has(t)}let mr=t=>!pr(t);function fr(t){t&&(mr=e=>e.startsWith("on")?!pr(e):t(e))}try{fr(require("@emotion/is-prop-valid").default)}catch{}function gr(t,e,n){const i={};for(const s in t)"values"===s&&"object"==typeof t.values||(mr(s)||!0===n&&pr(s)||!e&&!pr(s)||t.draggable&&s.startsWith("onDrag"))&&(i[s]=t[s]);return i}const yr=e.createContext(null);function vr(t){if("undefined"==typeof Proxy)return t;const e=new Map;return new Proxy(((...e)=>t(...e)),{get:(n,i)=>"create"===i?t:(e.has(i)||e.set(i,t(i)),e.get(i))})}function xr(t,e,n){const i=t.getProps();return Ko(i,e,void 0!==n?n:i.custom,t)}function wr(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Wt(n))}function Pr(t,e){const n=xr(t,e);let{transitionEnd:i={},transition:s={},...o}=n||{};o={...o,...i};for(const e in o){wr(t,e,(r=o[e],ss(r)?r[r.length-1]||0:r))}var r}function Tr(t,e){const n=t.getValue("willChange");if(i=n,Boolean(Jt(i)&&i.add))return n.add(e);if(!n&&k.WillChange){const n=new k.WillChange("auto");t.addValue("willChange",n),n.add(e)}var i}function Sr({protectedKeys:t,needsAnimating:e},n){const i=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,i}function br(t,e,{delay:n=0,transitionOverride:i,type:s}={}){let{transition:o=t.getDefaultTransition(),transitionEnd:r,...a}=e;i&&(o=i);const u=[],l=s&&t.animationState&&t.animationState.getState()[s];for(const e in a){const i=t.getValue(e,t.latestValues[e]??null),s=a[e];if(void 0===s||l&&Sr(l,e))continue;const r={delay:n,...at(o||{},e)};let c=!1;if(window.MotionHandoffAnimation){const n=Qi(t);if(n){const t=window.MotionHandoffAnimation(n,e,yt);null!==t&&(r.startTime=t,c=!0)}}Tr(t,e),i.start(Gi(e,i,s,t.shouldReduceMotion&&me.has(e)?{type:!1}:r,t,c));const h=i.animation;h&&u.push(h)}return r&&Promise.all(u).then((()=>{yt.update((()=>{r&&Pr(t,r)}))})),u}function Ar(t,e,n={}){const i=xr(t,e,"exit"===n.type?t.presenceContext?.custom:void 0);let{transition:s=t.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(s=n.transitionOverride);const o=i?()=>Promise.all(br(t,i,n)):()=>Promise.resolve(),r=t.variantChildren&&t.variantChildren.size?(i=0)=>{const{delayChildren:o=0,staggerChildren:r,staggerDirection:a}=s;return function(t,e,n=0,i=0,s=1,o){const r=[],a=(t.variantChildren.size-1)*i,u=1===s?(t=0)=>t*i:(t=0)=>a-t*i;return Array.from(t.variantChildren).sort(Er).forEach(((t,i)=>{t.notify("AnimationStart",e),r.push(Ar(t,e,{...o,delay:n+u(i)}).then((()=>t.notify("AnimationComplete",e))))})),Promise.all(r)}(t,e,o+i,r,a,n)}:()=>Promise.resolve(),{when:a}=s;if(a){const[t,e]="beforeChildren"===a?[o,r]:[r,o];return t().then((()=>e()))}return Promise.all([o(),r(n.delay)])}function Er(t,e){return t.sortNodePosition(e)}function Mr(t,e,n={}){let i;if(t.notify("AnimationStart",e),Array.isArray(e)){const s=e.map((e=>Ar(t,e,n)));i=Promise.all(s)}else if("string"==typeof e)i=Ar(t,e,n);else{const s="function"==typeof e?xr(t,e,n.custom):e;i=Promise.all(br(t,s,n))}return i.then((()=>{t.notify("AnimationComplete",e)}))}function Cr(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let i=0;i<n;i++)if(e[i]!==t[i])return!1;return!0}const Vr=zo.length;function Rr(t){if(!t)return;if(!t.isControllingVariants){const e=t.parent&&Rr(t.parent)||{};return void 0!==t.props.initial&&(e.initial=t.props.initial),e}const e={};for(let n=0;n<Vr;n++){const i=zo[n],s=t.props[i];(No(s)||!1===s)&&(e[i]=s)}return e}const kr=[...$o].reverse(),Dr=$o.length;function Lr(t){let e=function(t){return e=>Promise.all(e.map((({animation:e,options:n})=>Mr(t,e,n))))}(t),n=Fr(),i=!0;const s=e=>(n,i)=>{const s=xr(t,i,"exit"===e?t.presenceContext?.custom:void 0);if(s){const{transition:t,transitionEnd:e,...i}=s;n={...n,...i,...e}}return n};function o(o){const{props:r}=t,a=Rr(t.parent)||{},u=[],l=new Set;let c={},h=1/0;for(let e=0;e<Dr;e++){const d=kr[e],p=n[d],m=void 0!==r[d]?r[d]:a[d],f=No(m),g=d===o?p.isActive:null;!1===g&&(h=e);let y=m===a[d]&&m!==r[d]&&f;if(y&&i&&t.manuallyAnimateOnMount&&(y=!1),p.protectedKeys={...c},!p.isActive&&null===g||!m&&!p.prevProp||Wo(m)||"boolean"==typeof m)continue;const v=Br(p.prevProp,m);let x=v||d===o&&p.isActive&&!y&&f||e>h&&f,w=!1;const P=Array.isArray(m)?m:[m];let T=P.reduce(s(d),{});!1===g&&(T={});const{prevResolvedValues:S={}}=p,b={...S,...T},A=e=>{x=!0,l.has(e)&&(w=!0,l.delete(e)),p.needsAnimating[e]=!0;const n=t.getValue(e);n&&(n.liveStyle=!1)};for(const t in b){const e=T[t],n=S[t];if(c.hasOwnProperty(t))continue;let i=!1;i=ss(e)&&ss(n)?!Cr(e,n):e!==n,i?null!=e?A(t):l.add(t):void 0!==e&&l.has(t)?A(t):p.protectedKeys[t]=!0}p.prevProp=m,p.prevResolvedValues=T,p.isActive&&(c={...c,...T}),i&&t.blockInitialAnimation&&(x=!1);x&&(!(y&&v)||w)&&u.push(...P.map((t=>({animation:t,options:{type:d}}))))}if(l.size){const e={};if("boolean"!=typeof r.initial){const n=xr(t,Array.isArray(r.initial)?r.initial[0]:r.initial);n&&n.transition&&(e.transition=n.transition)}l.forEach((n=>{const i=t.getBaseTarget(n),s=t.getValue(n);s&&(s.liveStyle=!0),e[n]=i??null})),u.push({animation:e})}let d=Boolean(u.length);return!i||!1!==r.initial&&r.initial!==r.animate||t.manuallyAnimateOnMount||(d=!1),i=!1,d?e(u):Promise.resolve()}return{animateChanges:o,setActive:function(e,i){if(n[e].isActive===i)return Promise.resolve();t.variantChildren?.forEach((t=>t.animationState?.setActive(e,i))),n[e].isActive=i;const s=o(e);for(const t in n)n[t].protectedKeys={};return s},setAnimateFunction:function(n){e=n(t)},getState:()=>n,reset:()=>{n=Fr(),i=!0}}}function Br(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!Cr(e,t)}function Or(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Fr(){return{animate:Or(!0),whileInView:Or(),whileHover:Or(),whileTap:Or(),whileDrag:Or(),whileFocus:Or(),exit:Or()}}class jr{constructor(t){this.isMounted=!1,this.node=t}update(){}}let Ir=0;const Ur={animation:{Feature:class extends jr{constructor(t){super(t),t.animationState||(t.animationState=Lr(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Wo(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:e}=this.node.prevProps||{};t!==e&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}},exit:{Feature:class extends jr{constructor(){super(...arguments),this.id=Ir++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:e}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===n)return;const i=this.node.animationState.setActive("exit",!t);e&&!t&&i.then((()=>{e(this.id)}))}mount(){const{register:t,onExitComplete:e}=this.node.presenceContext||{};e&&e(this.id),t&&(this.unmount=t(this.id))}unmount(){}}}};function Wr(t){return{point:{x:t.pageX,y:t.pageY}}}const Nr=t=>e=>kt(e)&&t(e,Wr(e));function $r(t,e,n,i){return bo(t,e,Nr(n),i)}const zr=({current:t})=>t?t.ownerDocument.defaultView:null;function Hr(t){return t&&"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}const Xr=(t,e)=>Math.abs(t-e);function Yr(t,e){const n=Xr(t.x,e.x),i=Xr(t.y,e.y);return Math.sqrt(n**2+i**2)}class Kr{constructor(t,e,{transformPagePoint:n,contextWindow:i,dragSnapToOrigin:s=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!this.lastMoveEvent||!this.lastMoveEventInfo)return;const t=qr(this.lastMoveEventInfo,this.history),e=null!==this.startEvent,n=Yr(t.offset,{x:0,y:0})>=3;if(!e&&!n)return;const{point:i}=t,{timestamp:s}=xt;this.history.push({...i,timestamp:s});const{onStart:o,onMove:r}=this.handlers;e||(o&&o(this.lastMoveEvent,t),this.startEvent=this.lastMoveEvent),r&&r(this.lastMoveEvent,t)},this.handlePointerMove=(t,e)=>{this.lastMoveEvent=t,this.lastMoveEventInfo=Gr(e,this.transformPagePoint),yt.update(this.updatePoint,!0)},this.handlePointerUp=(t,e)=>{this.end();const{onEnd:n,onSessionEnd:i,resumeAnimation:s}=this.handlers;if(this.dragSnapToOrigin&&s&&s(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const o=qr("pointercancel"===t.type?this.lastMoveEventInfo:Gr(e,this.transformPagePoint),this.history);this.startEvent&&n&&n(t,o),i&&i(t,o)},!kt(t))return;this.dragSnapToOrigin=s,this.handlers=e,this.transformPagePoint=n,this.contextWindow=i||window;const o=Gr(Wr(t),this.transformPagePoint),{point:r}=o,{timestamp:a}=xt;this.history=[{...r,timestamp:a}];const{onSessionStart:u}=e;u&&u(t,qr(o,this.history)),this.removeListeners=Gn($r(this.contextWindow,"pointermove",this.handlePointerMove),$r(this.contextWindow,"pointerup",this.handlePointerUp),$r(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),vt(this.updatePoint)}}function Gr(t,e){return e?{point:e(t.point)}:t}function _r(t,e){return{x:t.x-e.x,y:t.y-e.y}}function qr({point:t},e){return{point:t,delta:_r(t,Jr(e)),offset:_r(t,Zr(e)),velocity:Qr(e,.1)}}function Zr(t){return t[0]}function Jr(t){return t[t.length-1]}function Qr(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,i=null;const s=Jr(t);for(;n>=0&&(i=t[n],!(s.timestamp-i.timestamp>F(e)));)n--;if(!i)return{x:0,y:0};const o=j(s.timestamp-i.timestamp);if(0===o)return{x:0,y:0};const r={x:(s.x-i.x)/o,y:(s.y-i.y)/o};return r.x===1/0&&(r.x=0),r.y===1/0&&(r.y=0),r}function ta(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 ea(t,e){let n=e.min-t.min,i=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,i]=[i,n]),{min:n,max:i}}const na=.35;function ia(t,e,n){return{min:sa(t,e),max:sa(t,n)}}function sa(t,e){return"number"==typeof t?t:t[e]||0}const oa=new WeakMap;class ra{constructor(t){this.openDragLock=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(t,{snapToCursor:e=!1}={}){const{presenceContext:n}=this.visualElement;if(n&&!1===n.isPresent)return;const{dragSnapToOrigin:i}=this.getProps();this.panSession=new Kr(t,{onSessionStart:t=>{const{dragSnapToOrigin:n}=this.getProps();n?this.pauseAnimation():this.stopAnimation(),e&&this.snapToCursor(Wr(t).point)},onStart:(t,e)=>{const{drag:n,dragPropagation:i,onDragStart:s}=this.getProps();if(n&&!i&&(this.openDragLock&&this.openDragLock(),this.openDragLock="x"===(o=n)||"y"===o?bt[o]?null:(bt[o]=!0,()=>{bt[o]=!1}):bt.x||bt.y?null:(bt.x=bt.y=!0,()=>{bt.x=bt.y=!1}),!this.openDragLock))return;var o;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Ks((t=>{let e=this.getAxisMotionValue(t).get()||0;if(Ve.test(e)){const{projection:n}=this.visualElement;if(n&&n.layout){const i=n.layout.layoutBox[t];if(i){e=Ht(i)*(parseFloat(e)/100)}}}this.originPoint[t]=e})),s&&yt.postRender((()=>s(t,e))),Tr(this.visualElement,"transform");const{animationState:r}=this.visualElement;r&&r.setActive("whileDrag",!0)},onMove:(t,e)=>{const{dragPropagation:n,dragDirectionLock:i,onDirectionLock:s,onDrag:o}=this.getProps();if(!n&&!this.openDragLock)return;const{offset:r}=e;if(i&&null===this.currentDirection)return this.currentDirection=function(t,e=10){let n=null;Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x");return n}(r),void(null!==this.currentDirection&&s&&s(this.currentDirection));this.updateAxis("x",e.point,r),this.updateAxis("y",e.point,r),this.visualElement.render(),o&&o(t,e)},onSessionEnd:(t,e)=>this.stop(t,e),resumeAnimation:()=>Ks((t=>"paused"===this.getAnimationState(t)&&this.getAxisMotionValue(t).animation?.play()))},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:i,contextWindow:zr(this.visualElement)})}stop(t,e){const n=this.isDragging;if(this.cancel(),!n)return;const{velocity:i}=e;this.startAnimation(i);const{onDragEnd:s}=this.getProps();s&&yt.postRender((()=>s(t,e)))}cancel(){this.isDragging=!1;const{projection:t,animationState:e}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),e&&e.setActive("whileDrag",!1)}updateAxis(t,e,n){const{drag:i}=this.getProps();if(!n||!aa(t,i,this.currentDirection))return;const s=this.getAxisMotionValue(t);let o=this.originPoint[t]+n[t];this.constraints&&this.constraints[t]&&(o=function(t,{min:e,max:n},i){return void 0!==e&&t<e?t=i?zt(e,t,i.min):Math.max(t,e):void 0!==n&&t>n&&(t=i?zt(n,t,i.max):Math.min(t,n)),t}(o,this.constraints[t],this.elastic[t])),s.set(o)}resolveConstraints(){const{dragConstraints:t,dragElastic:e}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,i=this.constraints;t&&Hr(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!n)&&function(t,{top:e,left:n,bottom:i,right:s}){return{x:ta(t.x,n,s),y:ta(t.y,e,i)}}(n.layoutBox,t),this.elastic=function(t=na){return!1===t?t=0:!0===t&&(t=na),{x:ia(t,"left","right"),y:ia(t,"top","bottom")}}(e),i!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&Ks((t=>{!1!==this.constraints&&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||!Hr(t))return!1;const n=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const s=function(t,e,n){const i=Do(t,n),{scroll:s}=e;return s&&(Cs(i.x,s.offset.x),Cs(i.y,s.offset.y)),i}(n,i.root,this.visualElement.getTransformPagePoint());let o=function(t,e){return{x:ea(t.x,e.x),y:ea(t.y,e.y)}}(i.layout.layoutBox,s);if(e){const t=e(function({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}(o));this.hasMutatedConstraints=!!t,t&&(o=ko(t))}return o}startAnimation(t){const{drag:e,dragMomentum:n,dragElastic:i,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:r}=this.getProps(),a=this.constraints||{},u=Ks((r=>{if(!aa(r,e,this.currentDirection))return;let u=a&&a[r]||{};o&&(u={min:0,max:0});const l=i?200:1e6,c=i?40:1e7,h={type:"inertia",velocity:n?t[r]:0,bounceStiffness:l,bounceDamping:c,timeConstant:750,restDelta:1,restSpeed:10,...s,...u};return this.startAxisValueAnimation(r,h)}));return Promise.all(u).then(r)}startAxisValueAnimation(t,e){const n=this.getAxisMotionValue(t);return Tr(this.visualElement,t),n.start(Gi(t,n,0,e,this.visualElement,!1))}stopAnimation(){Ks((t=>this.getAxisMotionValue(t).stop()))}pauseAnimation(){Ks((t=>this.getAxisMotionValue(t).animation?.pause()))}getAnimationState(t){return this.getAxisMotionValue(t).animation?.state}getAxisMotionValue(t){const e=`_drag${t.toUpperCase()}`,n=this.visualElement.getProps(),i=n[e];return i||this.visualElement.getValue(t,(n.initial?n.initial[t]:void 0)||0)}snapToCursor(t){Ks((e=>{const{drag:n}=this.getProps();if(!aa(e,n,this.currentDirection))return;const{projection:i}=this.visualElement,s=this.getAxisMotionValue(e);if(i&&i.layout){const{min:n,max:o}=i.layout.layoutBox[e];s.set(t[e]-zt(n,o,.5))}}))}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:e}=this.getProps(),{projection:n}=this.visualElement;if(!Hr(e)||!n||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Ks((t=>{const e=this.getAxisMotionValue(t);if(e&&!1!==this.constraints){const n=e.get();i[t]=function(t,e){let n=.5;const i=Ht(t),s=Ht(e);return s>i?n=B(e.min,e.max-i,t.min):i>s&&(n=B(t.min,t.max-s,e.min)),fe(0,1,n)}({min:n,max:n},this.constraints[t])}}));const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.resolveConstraints(),Ks((e=>{if(!aa(e,t,null))return;const n=this.getAxisMotionValue(e),{min:s,max:o}=this.constraints[e];n.set(zt(s,o,i[e]))}))}addListeners(){if(!this.visualElement.current)return;oa.set(this.visualElement,this);const t=$r(this.visualElement.current,"pointerdown",(t=>{const{drag:e,dragListener:n=!0}=this.getProps();e&&n&&this.start(t)})),e=()=>{const{dragConstraints:t}=this.getProps();Hr(t)&&t.current&&(this.constraints=this.resolveRefConstraints())},{projection:n}=this.visualElement,i=n.addEventListener("measure",e);n&&!n.layout&&(n.root&&n.root.updateScroll(),n.updateLayout()),yt.read(e);const s=bo(window,"resize",(()=>this.scalePositionWithinConstraints())),o=n.addEventListener("didUpdate",(({delta:t,hasLayoutChanged:e})=>{this.isDragging&&e&&(Ks((e=>{const n=this.getAxisMotionValue(e);n&&(this.originPoint[e]+=t[e].translate,n.set(n.get()+t[e].translate))})),this.visualElement.render())}));return()=>{s(),t(),i(),o&&o()}}getProps(){const t=this.visualElement.getProps(),{drag:e=!1,dragDirectionLock:n=!1,dragPropagation:i=!1,dragConstraints:s=!1,dragElastic:o=na,dragMomentum:r=!0}=t;return{...t,drag:e,dragDirectionLock:n,dragPropagation:i,dragConstraints:s,dragElastic:o,dragMomentum:r}}}function aa(t,e,n){return!(!0!==e&&e!==t||null!==n&&n!==t)}const ua=t=>(e,n)=>{t&&yt.postRender((()=>t(e,n)))};const la=e.createContext({});class ca extends e.Component{componentDidMount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n,layoutId:i}=this.props,{projection:s}=t;Ys(da),s&&(e.group&&e.group.add(s),n&&n.register&&i&&n.register(s),s.root.didUpdate(),s.addEventListener("animationComplete",(()=>{this.safeToRemove()})),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),Gs.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:e,visualElement:n,drag:i,isPresent:s}=this.props,o=n.projection;return o?(o.isPresent=s,i||t.layoutDependency!==e||void 0===e||t.isPresent!==s?o.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?o.promote():o.relegate()||yt.postRender((()=>{const t=o.getStack();t&&t.members.length||this.safeToRemove()}))),null):null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),ft.postRender((()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()})))}componentWillUnmount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n}=this.props,{projection:i}=t;i&&(i.scheduleCheckAfterUnmount(),e&&e.group&&e.group.remove(i),n&&n.deregister&&n.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function ha(t){const[n,i]=b(),s=e.useContext(m);return d(ca,{...t,layoutGroup:s,switchLayoutGroup:e.useContext(la),isPresent:n,safeToRemove:i})}const da={borderRadius:{...Vo,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Vo,borderTopRightRadius:Vo,borderBottomLeftRadius:Vo,borderBottomRightRadius:Vo,boxShadow:Ro},pa={pan:{Feature:class extends jr{constructor(){super(...arguments),this.removePointerDownListener=L}onPointerDown(t){this.session=new Kr(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:zr(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:e,onPan:n,onPanEnd:i}=this.node.getProps();return{onSessionStart:ua(t),onStart:ua(e),onMove:n,onEnd:(t,e)=>{delete this.session,i&&yt.postRender((()=>i(t,e)))}}}mount(){this.removePointerDownListener=$r(this.node.current,"pointerdown",(t=>this.onPointerDown(t)))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}},drag:{Feature:class extends jr{constructor(t){super(t),this.removeGroupControls=L,this.removeListeners=L,this.controls=new ra(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||L}unmount(){this.removeGroupControls(),this.removeListeners()}},ProjectionNode:Mo,MeasureLayout:ha}};function ma(t,e,n){const{props:i}=t;t.animationState&&i.whileHover&&t.animationState.setActive("whileHover","Start"===n);const s=i["onHover"+n];s&&yt.postRender((()=>s(e,Wr(e))))}function fa(t,e,n){const{props:i}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&i.whileTap&&t.animationState.setActive("whileTap","Start"===n);const s=i["onTap"+("End"===n?"":n)];s&&yt.postRender((()=>s(e,Wr(e))))}const ga=new WeakMap,ya=new WeakMap,va=t=>{const e=ga.get(t.target);e&&e(t)},xa=t=>{t.forEach(va)};function wa(t,e,n){const i=function({root:t,...e}){const n=t||document;ya.has(n)||ya.set(n,{});const i=ya.get(n),s=JSON.stringify(e);return i[s]||(i[s]=new IntersectionObserver(xa,{root:t,...e})),i[s]}(e);return ga.set(t,n),i.observe(t),()=>{ga.delete(t),i.unobserve(t)}}const Pa={some:0,all:1};const Ta={inView:{Feature:class extends jr{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:e,margin:n,amount:i="some",once:s}=t,o={root:e?e.current:void 0,rootMargin:n,threshold:"number"==typeof i?i:Pa[i]};return wa(this.node.current,o,(t=>{const{isIntersecting:e}=t;if(this.isInView===e)return;if(this.isInView=e,s&&!e&&this.hasEnteredView)return;e&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",e);const{onViewportEnter:n,onViewportLeave:i}=this.node.getProps(),o=e?n:i;o&&o(t)}))}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;const{props:t,prevProps:e}=this.node;["amount","margin","root"].some(function({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}(t,e))&&this.startObserver()}unmount(){}}},tap:{Feature:class extends jr{mount(){const{current:t}=this.node;t&&(this.unmount=jt(t,((t,e)=>(fa(this.node,e,"Start"),(t,{success:e})=>fa(this.node,t,e?"End":"Cancel"))),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}},focus:{Feature:class extends jr{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch(e){t=!0}t&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Gn(bo(this.node.current,"focus",(()=>this.onFocus())),bo(this.node.current,"blur",(()=>this.onBlur())))}unmount(){}}},hover:{Feature:class extends jr{mount(){const{current:t}=this.node;t&&(this.unmount=Vt(t,((t,e)=>(ma(this.node,e,"Start"),t=>ma(this.node,t,"End")))))}unmount(){}}}},Sa={layout:{ProjectionNode:Mo,MeasureLayout:ha}},ba=e.createContext({});function Aa(t){const{initial:n,animate:i}=function(t,e){if(Ho(t)){const{initial:e,animate:n}=t;return{initial:!1===e||No(e)?e:void 0,animate:No(n)?n:void 0}}return!1!==t.inherit?e:{}}(t,e.useContext(ba));return e.useMemo((()=>({initial:n,animate:i})),[Ea(n),Ea(i)])}function Ea(t){return Array.isArray(t)?t.join(" "):t}const Ma=Symbol.for("motionComponentSymbol");function Ca(t,n,i){return e.useCallback((e=>{e&&t.onMount&&t.onMount(e),n&&(e?n.mount(e):n.unmount()),i&&("function"==typeof i?i(e):Hr(i)&&(i.current=e))}),[n])}function Va(t,n,i,s,o){const{visualElement:r}=e.useContext(ba),a=e.useContext(lr),u=e.useContext(v),l=e.useContext(x).reducedMotion,c=e.useRef(null);s=s||a.renderer,!c.current&&s&&(c.current=s(t,{visualState:n,parent:r,props:i,presenceContext:u,blockInitialAnimation:!!u&&!1===u.initial,reducedMotionConfig:l}));const h=c.current,d=e.useContext(la);!h||h.projection||!o||"html"!==h.type&&"svg"!==h.type||function(t,e,n,i){const{layoutId:s,layout:o,drag:r,dragConstraints:a,layoutScroll:u,layoutRoot:l,layoutCrossfade:c}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:Ra(t.parent)),t.projection.setOptions({layoutId:s,layout:o,alwaysMeasureLayout:Boolean(r)||a&&Hr(a),visualElement:t,animationType:"string"==typeof o?o:"both",initialPromotionConfig:i,crossfade:c,layoutScroll:u,layoutRoot:l})}(c.current,i,o,d);const p=e.useRef(!1);e.useInsertionEffect((()=>{h&&p.current&&h.update(i,u)}));const m=i[Ji],f=e.useRef(Boolean(m)&&!window.MotionHandoffIsComplete?.(m)&&window.MotionHasOptimisedAnimation?.(m));return y((()=>{h&&(p.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),ft.render(h.render),f.current&&h.animationState&&h.animationState.animateChanges())})),e.useEffect((()=>{h&&(!f.current&&h.animationState&&h.animationState.animateChanges(),f.current&&(queueMicrotask((()=>{window.MotionHandoffMarkAsComplete?.(m)})),f.current=!1))})),h}function Ra(t){if(t)return!1!==t.options.allowProjection?t.projection:Ra(t.parent)}function ka({preloadedFeatures:t,createVisualElement:n,useRender:i,useVisualState:s,Component:o}){function r(t,r){let a;const u={...e.useContext(x),...t,layoutId:Da(t)},{isStatic:l}=u,c=Aa(t),h=s(t,l);if(!l&&g){e.useContext(lr).strict;const t=function(t){const{drag:e,layout:n}=Bo;if(!e&&!n)return{};const i={...e,...n};return{MeasureLayout:e?.isEnabled(t)||n?.isEnabled(t)?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}(u);a=t.MeasureLayout,c.visualElement=Va(o,h,u,n,t.ProjectionNode)}return p(ba.Provider,{value:c,children:[a&&c.visualElement?d(a,{visualElement:c.visualElement,...u}):null,i(o,t,Ca(h,c.visualElement,r),h,l,c.visualElement)]})}t&&cr(t),r.displayName=`motion.${"string"==typeof o?o:`create(${o.displayName??o.name??""})`}`;const a=e.forwardRef(r);return a[Ma]=o,a}function Da({layoutId:t}){const n=e.useContext(m).id;return n&&void 0!==t?n+"-"+t:t}const La=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Ba(t,e,n){for(const i in e)Jt(e[i])||ir(i,n)||(t[i]=e[i])}function Oa(t,n){const i={};return Ba(i,t.style||{},t),Object.assign(i,function({transformTemplate:t},n){return e.useMemo((()=>{const e={style:{},transform:{},transformOrigin:{},vars:{}};return er(e,n,t),Object.assign({},e.vars,e.style)}),[n])}(t,n)),i}function Fa(t,e){const n={},i=Oa(t,e);return t.drag&&!1!==t.dragListener&&(n.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=!0===t.drag?"none":"pan-"+("x"===t.drag?"y":"x")),void 0===t.tabIndex&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=i,n}const ja=["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 Ia(t){return"string"==typeof t&&!t.includes("-")&&!!(ja.indexOf(t)>-1||/[A-Z]/u.test(t))}const Ua={offset:"stroke-dashoffset",array:"stroke-dasharray"},Wa={offset:"strokeDashoffset",array:"strokeDasharray"};function Na(t,e,n){return"string"==typeof t?t:Re.transform(e+n*t)}function $a(t,{attrX:e,attrY:n,attrScale:i,originX:s,originY:o,pathLength:r,pathSpacing:a=1,pathOffset:u=0,...l},c,h){if(er(t,l,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:m}=t;d.transform&&(m&&(p.transform=d.transform),delete d.transform),m&&(void 0!==s||void 0!==o||p.transform)&&(p.transformOrigin=function(t,e,n){return`${Na(e,t.x,t.width)} ${Na(n,t.y,t.height)}`}(m,void 0!==s?s:.5,void 0!==o?o:.5)),void 0!==e&&(d.x=e),void 0!==n&&(d.y=n),void 0!==i&&(d.scale=i),void 0!==r&&function(t,e,n=1,i=0,s=!0){t.pathLength=1;const o=s?Ua:Wa;t[o.offset]=Re.transform(-i);const r=Re.transform(e),a=Re.transform(n);t[o.array]=`${r} ${a}`}(d,r,a,u,!1)}const za=()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}}),Ha=t=>"string"==typeof t&&"svg"===t.toLowerCase();function Xa(t,n,i,s){const o=e.useMemo((()=>{const e={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};return $a(e,n,Ha(s),t.transformTemplate),{...e.attrs,style:{...e.style}}}),[n]);if(t.style){const e={};Ba(e,t.style,t),o.style={...e,...o.style}}return o}function Ya(t=!1){return(n,i,s,{latestValues:o},r)=>{const a=(Ia(n)?Xa:Fa)(i,o,r,n),u=gr(i,"string"==typeof n,t),l=n!==e.Fragment?{...u,...a,ref:s}:{},{children:c}=i,h=e.useMemo((()=>Jt(c)?c.get():c),[c]);return e.createElement(n,{...l,children:h})}}const Ka=t=>(n,i)=>{const s=e.useContext(ba),o=e.useContext(v),r=()=>function({scrapeMotionValuesFromProps:t,createRenderState:e,onUpdate:n},i,s,o){const r={latestValues:Ga(i,s,o,t),renderState:e()};return n&&(r.onMount=t=>n({props:i,current:t,...r}),r.onUpdate=t=>n(t)),r}(t,n,s,o);return i?r():f(r)};function Ga(t,e,n,i){const s={},o=i(t,{});for(const t in o)s[t]=os(o[t]);let{initial:r,animate:a}=t;const u=Ho(t),l=Xo(t);e&&l&&!u&&!1!==t.inherit&&(void 0===r&&(r=e.initial),void 0===a&&(a=e.animate));let c=!!n&&!1===n.initial;c=c||!1===r;const h=c?a:r;if(h&&"boolean"!=typeof h&&!Wo(h)){const e=Array.isArray(h)?h:[h];for(let n=0;n<e.length;n++){const i=Ko(t,e[n]);if(i){const{transitionEnd:t,transition:e,...n}=i;for(const t in n){let e=n[t];if(Array.isArray(e)){e=e[c?e.length-1:0]}null!==e&&(s[t]=e)}for(const e in t)s[e]=t[e]}}}return s}const _a={useVisualState:Ka({scrapeMotionValuesFromProps:sr,createRenderState:La})};function qa(t,e){try{e.dimensions="function"==typeof t.getBBox?t.getBBox():t.getBoundingClientRect()}catch(t){e.dimensions={x:0,y:0,width:0,height:0}}}const Za=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 Ja(t,e,n,i){nr(t,e,void 0,i);for(const n in e.attrs)t.setAttribute(Za.has(n)?n:qi(n),e.attrs[n])}function Qa(t,e,n){const i=sr(t,e,n);for(const n in t)if(Jt(t[n])||Jt(e[n])){i[-1!==de.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=t[n]}return i}const tu=["x","y","width","height","cx","cy","r"],eu={useVisualState:Ka({scrapeMotionValuesFromProps:Qa,createRenderState:za,onUpdate:({props:t,prevProps:e,current:n,renderState:i,latestValues:s})=>{if(!n)return;let o=!!t.drag;if(!o)for(const t in s)if(pe.has(t)){o=!0;break}if(!o)return;let r=!e;if(e)for(let n=0;n<tu.length;n++){const i=tu[n];t[i]!==e[i]&&(r=!0)}r&&yt.read((()=>{qa(n,i),yt.render((()=>{$a(i,s,Ha(n.tagName),t.transformTemplate),Ja(n,i)}))}))}})};function nu(t,e){return function(n,{forwardMotionProps:i}={forwardMotionProps:!1}){return ka({...Ia(n)?eu:_a,preloadedFeatures:t,useRender:Ya(i),createVisualElement:e,Component:n})}}class iu extends qo{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Fs,this.updateDimensions=()=>{this.current&&!this.renderState.dimensions&&qa(this.current,this.renderState)}}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(pe.has(e)){const t=tn(e);return t&&t.default||0}return e=Za.has(e)?e:qi(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,n){return Qa(t,e,n)}onBindTransform(){this.current&&!this.renderState.dimensions&&yt.postRender(this.updateDimensions)}build(t,e,n){$a(t,e,this.isSVGTag,n.transformTemplate)}renderInstance(t,e,n,i){Ja(t,e,0,i)}mount(t){this.isSVGTag=Ha(t.tagName),super.mount(t)}}const su=(t,n)=>Ia(t)?new iu(n):new or(n,{allowProjection:t!==e.Fragment}),ou=vr(nu({...Ur,...Ta,...pa,...Sa},su));function ru({children:t,as:n="ul",axis:i="y",onReorder:s,values:o,...r},a){const u=f((()=>ou[n])),l=[],c=e.useRef(!1),h={axis:i,registerItem:(t,e)=>{const n=l.findIndex((e=>t===e.value));-1!==n?l[n].layout=e[i]:l.push({value:t,layout:e[i]}),l.sort(lu)},updateOrder:(t,e,n)=>{if(c.current)return;const i=function(t,e,n,i){if(!i)return t;const s=t.findIndex((t=>t.value===e));if(-1===s)return t;const o=i>0?1:-1,r=t[s+o];if(!r)return t;const a=t[s],u=r.layout,l=zt(u.min,u.max,.5);return 1===o&&a.layout.max+n>l||-1===o&&a.layout.min+n<l?function([...t],e,n){const i=e<0?t.length+e:e;if(i>=0&&i<t.length){const i=n<0?t.length+n:n,[s]=t.splice(e,1);t.splice(i,0,s)}return t}(t,s,s+o):t}(l,t,e,n);l!==i&&(c.current=!0,s(i.map(uu).filter((t=>-1!==o.indexOf(t)))))}};return e.useEffect((()=>{c.current=!1})),d(u,{...r,ref:a,ignoreStrict:!0,children:d(yr.Provider,{value:h,children:t})})}const au=e.forwardRef(ru);function uu(t){return t.value}function lu(t,e){return t.layout.min-e.layout.min}function cu(t){const n=f((()=>Wt(t))),{isStatic:i}=e.useContext(x);if(i){const[,i]=e.useState(t);e.useEffect((()=>n.on("change",i)),[])}return n}function hu(...t){const e=!Array.isArray(t[0]),n=e?0:-1,i=t[0+n],s=t[1+n],o=t[2+n],r=t[3+n],a=ki(s,o,{mixer:(u=o[0],(t=>t&&"object"==typeof t&&t.mix)(u)?u.mix:void 0),...r});var u;return e?a(i):a}function du(t,e){const n=cu(e()),i=()=>n.set(e());return i(),y((()=>{const e=()=>yt.preRender(i,!1,!0),n=t.map((t=>t.on("change",e)));return()=>{n.forEach((t=>t())),vt(i)}})),n}function pu(t,e,n,i){if("function"==typeof t)return function(t){It.current=[],t();const e=du(It.current,t);return It.current=void 0,e}(t);const s="function"==typeof e?e:hu(e,n,i);return Array.isArray(t)?mu(t,s):mu([t],(([t])=>s(t)))}function mu(t,e){const n=f((()=>[]));return du(t,(()=>{n.length=0;const i=t.length;for(let e=0;e<i;e++)n[e]=t[e].get();return e(n)}))}function fu(t,e=0){return Jt(t)?t:cu(e)}function gu({children:t,style:n={},value:i,as:s="li",onDrag:o,layout:r=!0,...a},u){const l=f((()=>ou[s])),c=e.useContext(yr),h={x:fu(n.x),y:fu(n.y)},p=pu([h.x,h.y],(([t,e])=>t||e?1:"unset")),{axis:m,registerItem:g,updateOrder:y}=c;return d(l,{drag:m,...a,dragSnapToOrigin:!0,style:{...n,x:h.x,y:h.y,zIndex:p},layout:r,onDrag:(t,e)=>{const{velocity:n}=e;n[m]&&y(i,h[m].get(),n[m]),o&&o(t,e)},onLayoutMeasure:t=>g(i,t),ref:u,ignoreStrict:!0,children:t})}const yu=e.forwardRef(gu);var vu=Object.freeze({__proto__:null,Group:au,Item:yu});const xu=(t,e,n)=>{const i=e-t;return((n-t)%i+i)%i+t};function wu(t,e){return Ci(t)?t[xu(0,t.length,e)]:t}function Pu(t){return"object"==typeof t&&!Array.isArray(t)}function Tu(t,e,n,i){return"string"==typeof t&&Pu(e)?Et(t,n,i):t instanceof NodeList?Array.from(t):Array.isArray(t)?t:[t]}function Su(t,e,n){return t*(e+1)}function bu(t,e,n,i){return"number"==typeof e?e:e.startsWith("-")||e.startsWith("+")?Math.max(0,t+parseFloat(e)):"<"===e?n:i.get(e)??t}function Au(t,e,n,i,s,o){!function(t,e,n){for(let i=0;i<t.length;i++){const s=t[i];s.at>e&&s.at<n&&(V(t,s),i--)}}(t,s,o);for(let r=0;r<e.length;r++)t.push({value:e[r],at:zt(s,o,i[r]),easing:wu(n,r)})}function Eu(t,e){for(let n=0;n<t.length;n++)t[n]=t[n]/(e+1)}function Mu(t,e){return t.at===e.at?null===t.value?1:null===e.value?-1:0:t.at-e.at}function Cu(t,e){return!e.has(t)&&e.set(t,{}),e.get(t)}function Vu(t,e){return e[t]||(e[t]=[]),e[t]}function Ru(t){return Array.isArray(t)?t:[t]}function ku(t,e){return t&&t[e]?{...t,...t[e]}:{...t}}const Du=t=>"number"==typeof t,Lu=t=>t.every(Du);class Bu extends _o{constructor(){super(...arguments),this.type="object"}readValueFromInstance(t,e){if(function(t,e){return t in e}(e,t)){const n=t[e];if("string"==typeof n||"number"==typeof n)return n}}getBaseTargetFromProps(){}removeValueFromRenderState(t,e){delete e.output[t]}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}build(t,e){Object.assign(t.output,e)}renderInstance(t,{output:e}){Object.assign(t,e)}sortInstanceNodePosition(){return 0}}function Ou(t){const e={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=ts(t)?new iu(e):new or(e);n.mount(t),Uo.set(t,n)}function Fu(t){const e=new Bu({presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}});e.mount(t),Uo.set(t,e)}function ju(t,e,n,i){const s=[];if(function(t,e){return Jt(t)||"number"==typeof t||"string"==typeof t&&!Pu(e)}(t,e))s.push(_i(t,Pu(e)&&e.default||e,n&&n.default||n));else{const o=Tu(t,e,i),r=o.length;for(let t=0;t<r;t++){const i=o[t],a=i instanceof Element?Ou:Fu;Uo.has(i)||a(i);const u=Uo.get(i),l={...n};"delay"in l&&"function"==typeof l.delay&&(l.delay=l.delay(t,r)),s.push(...br(u,{...e,transition:l},{}))}}return s}function Iu(t,e,n){const i=[],s=function(t,{defaultTransition:e={},...n}={},i,s){const o=e.duration||.3,r=new Map,a=new Map,u={},l=new Map;let c=0,h=0,d=0;for(let n=0;n<t.length;n++){const r=t[n];if("string"==typeof r){l.set(r,h);continue}if(!Array.isArray(r)){l.set(r.name,bu(h,r.at,c,l));continue}let[p,m,f={}]=r;void 0!==f.at&&(h=bu(h,f.at,c,l));let g=0;const y=(t,n,i,r=0,a=0)=>{const u=Ru(t),{delay:l=0,times:c=Li(u),type:p="keyframes",repeat:m,repeatType:f,repeatDelay:y=0,...v}=n;let{ease:x=e.ease||"easeOut",duration:w}=n;const P="function"==typeof l?l(r,a):l,T=u.length,S=st(p)?p:s?.[p];if(T<=2&&S){let t=100;if(2===T&&Lu(u)){const e=u[1]-u[0];t=Math.abs(e)}const e={...v};void 0!==w&&(e.duration=F(w));const n=ct(e,t,S);x=n.ease,w=n.duration}w??(w=o);const b=h+P;1===c.length&&0===c[0]&&(c[1]=1);const A=c.length-u.length;if(A>0&&Di(c,A),1===u.length&&u.unshift(null),m){w=Su(w,m);const t=[...u],e=[...c];x=Array.isArray(x)?[...x]:[x];const n=[...x];for(let i=0;i<m;i++){u.push(...t);for(let s=0;s<t.length;s++)c.push(e[s]+(i+1)),x.push(0===s?"linear":wu(n,s-1))}Eu(c,m)}const E=b+w;Au(i,u,x,c,b,E),g=Math.max(P+w,g),d=Math.max(E,d)};if(Jt(p))y(m,f,Vu("default",Cu(p,a)));else{const t=Tu(p,m,i,u),e=t.length;for(let n=0;n<e;n++){const i=Cu(t[n],a);for(const t in m)y(m[t],ku(f,t),Vu(t,i),n,e)}}c=h,h+=g}return a.forEach(((t,i)=>{for(const s in t){const o=t[s];o.sort(Mu);const a=[],u=[],l=[];for(let t=0;t<o.length;t++){const{at:e,value:n,easing:i}=o[t];a.push(n),u.push(B(0,d,e)),l.push(i||"easeOut")}0!==u[0]&&(u.unshift(0),a.unshift(a[0]),l.unshift("easeInOut")),1!==u[u.length-1]&&(u.push(1),a.push(null)),r.has(i)||r.set(i,{keyframes:{},transition:{}});const c=r.get(i);c.keyframes[s]=a,c.transition[s]={...e,duration:d,ease:l,times:u,...n}}})),r}(t,e,n,{spring:Si});return s.forEach((({keyframes:t,transition:e},n)=>{i.push(...ju(n,t,e))})),i}function Uu(t){return function(e,n,i){let s=[];var o;o=e,s=Array.isArray(o)&&o.some(Array.isArray)?Iu(e,n,t):ju(e,n,i,t);const r=new N(s);return t&&t.animations.push(r),r}}const Wu=Uu();const Nu=t=>function(e,n,i){return new N(function(t,e,n,i){const s=Et(t,i),o=s.length,r=[];for(let t=0;t<o;t++){const i=s[t],a={...n};"function"==typeof a.delay&&(a.delay=a.delay(t,o));for(const t in e){const n=e[t],s={...at(a,t)};s.duration&&(s.duration=F(s.duration)),s.delay&&(s.delay=F(s.delay)),r.push(new rt({element:i,name:t,keyframes:n,transition:s,allowFlatten:!a.type&&!a.ease}))}}return r}(e,n,i,t))},$u=Nu();function zu(t,e){let n;const i=()=>{const{currentTime:i}=e,s=(null===i?0:i.value)/100;n!==s&&t(s),n=s};return yt.update(i,!0),()=>vt(i)}const Hu=new WeakMap;let Xu;function Yu({target:t,contentRect:e,borderBoxSize:n}){Hu.get(t)?.forEach((i=>{i({target:t,contentSize:e,get size(){return function(t,e){if(e){const{inlineSize:t,blockSize:n}=e[0];return{width:t,height:n}}return t instanceof SVGElement&&"getBBox"in t?t.getBBox():{width:t.offsetWidth,height:t.offsetHeight}}(t,n)}})}))}function Ku(t){t.forEach(Yu)}function Gu(t,e){Xu||"undefined"!=typeof ResizeObserver&&(Xu=new ResizeObserver(Ku));const n=Et(t);return n.forEach((t=>{let n=Hu.get(t);n||(n=new Set,Hu.set(t,n)),n.add(e),Xu?.observe(t)})),()=>{n.forEach((t=>{const n=Hu.get(t);n?.delete(e),n?.size||Xu?.unobserve(t)}))}}const _u=new Set;let qu;function Zu(t){return _u.add(t),qu||(qu=()=>{const t={width:window.innerWidth,height:window.innerHeight},e={target:window,size:t,contentSize:t};_u.forEach((t=>t(e)))},window.addEventListener("resize",qu)),()=>{_u.delete(t),!_u.size&&qu&&(qu=void 0)}}const Ju={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}};function Qu(t,e,n,i){const s=n[e],{length:o,position:r}=Ju[e],a=s.current,u=n.time;s.current=t[`scroll${r}`],s.scrollLength=t[`scroll${o}`]-t[`client${o}`],s.offset.length=0,s.offset[0]=0,s.offset[1]=s.scrollLength,s.progress=B(0,s.scrollLength,s.current);const l=i-u;s.velocity=l>50?0:I(s.current-a,l)}const tl={start:0,center:.5,end:1};function el(t,e,n=0){let i=0;if(t in tl&&(t=tl[t]),"string"==typeof t){const e=parseFloat(t);t.endsWith("px")?i=e:t.endsWith("%")?t=e/100:t.endsWith("vw")?i=e/100*document.documentElement.clientWidth:t.endsWith("vh")?i=e/100*document.documentElement.clientHeight:t=e}return"number"==typeof t&&(i=e*t),n+i}const nl=[0,0];function il(t,e,n,i){let s=Array.isArray(t)?t:nl,o=0,r=0;return"number"==typeof t?s=[t,t]:"string"==typeof t&&(s=(t=t.trim()).includes(" ")?t.split(" "):[t,tl[t]?t:"0"]),o=el(s[0],n,i),r=el(s[1],e),o-r}const sl={Enter:[[0,1],[1,1]],Exit:[[0,0],[1,0]],Any:[[1,0],[0,1]],All:[[0,0],[1,1]]},ol={x:0,y:0};function rl(t,e,n){const{offset:i=sl.All}=n,{target:s=t,axis:o="y"}=n,r="y"===o?"height":"width",a=s!==t?function(t,e){const n={x:0,y:0};let i=t;for(;i&&i!==e;)if(i instanceof HTMLElement)n.x+=i.offsetLeft,n.y+=i.offsetTop,i=i.offsetParent;else if("svg"===i.tagName){const t=i.getBoundingClientRect();i=i.parentElement;const e=i.getBoundingClientRect();n.x+=t.left-e.left,n.y+=t.top-e.top}else{if(!(i instanceof SVGGraphicsElement))break;{const{x:t,y:e}=i.getBBox();n.x+=t,n.y+=e;let s=null,o=i.parentNode;for(;!s;)"svg"===o.tagName&&(s=o),o=i.parentNode;i=s}}return n}(s,t):ol,u=s===t?{width:t.scrollWidth,height:t.scrollHeight}:function(t){return"getBBox"in t&&"svg"!==t.tagName?t.getBBox():{width:t.clientWidth,height:t.clientHeight}}(s),l={width:t.clientWidth,height:t.clientHeight};e[o].offset.length=0;let c=!e[o].interpolate;const h=i.length;for(let t=0;t<h;t++){const n=il(i[t],l[r],u[r],a[o]);c||n===e[o].interpolatorOffsets[t]||(c=!0),e[o].offset[t]=n}c&&(e[o].interpolate=ki(e[o].offset,Li(i),{clamp:!1}),e[o].interpolatorOffsets=[...e[o].offset]),e[o].progress=fe(0,1,e[o].interpolate(e[o].current))}function al(t,e,n,i={}){return{measure:()=>function(t,e=t,n){if(n.x.targetOffset=0,n.y.targetOffset=0,e!==t){let i=e;for(;i&&i!==t;)n.x.targetOffset+=i.offsetLeft,n.y.targetOffset+=i.offsetTop,i=i.offsetParent}n.x.targetLength=e===t?e.scrollWidth:e.clientWidth,n.y.targetLength=e===t?e.scrollHeight:e.clientHeight,n.x.containerLength=t.clientWidth,n.y.containerLength=t.clientHeight}(t,i.target,n),update:e=>{!function(t,e,n){Qu(t,"x",e,n),Qu(t,"y",e,n),e.time=n}(t,n,e),(i.offset||i.target)&&rl(t,n,i)},notify:()=>e(n)}}const ul=new WeakMap,ll=new WeakMap,cl=new WeakMap,hl=t=>t===document.documentElement?window:t;function dl(t,{container:e=document.documentElement,...n}={}){let i=cl.get(e);i||(i=new Set,cl.set(e,i));const s=al(e,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}},n);if(i.add(s),!ul.has(e)){const t=()=>{for(const t of i)t.measure()},n=()=>{for(const t of i)t.update(xt.timestamp)},s=()=>{for(const t of i)t.notify()},a=()=>{yt.read(t,!1,!0),yt.read(n,!1,!0),yt.update(s,!1,!0)};ul.set(e,a);const u=hl(e);window.addEventListener("resize",a,{passive:!0}),e!==document.documentElement&&ll.set(e,(r=a,"function"==typeof(o=e)?Zu(o):Gu(o,r))),u.addEventListener("scroll",a,{passive:!0})}var o,r;const a=ul.get(e);return yt.read(a,!1,!0),()=>{vt(a);const t=cl.get(e);if(!t)return;if(t.delete(s),t.size)return;const n=ul.get(e);ul.delete(e),n&&(hl(e).removeEventListener("scroll",n),ll.get(e)?.(),window.removeEventListener("resize",n))}}const pl=new Map;function ml({source:t,container:e=document.documentElement,axis:n="y"}={}){t&&(e=t),pl.has(e)||pl.set(e,{});const i=pl.get(e);return i[n]||(i[n]=U()?new ScrollTimeline({source:e,axis:n}):function({source:t,container:e,axis:n="y"}){t&&(e=t);const i={value:0},s=dl((t=>{i.value=100*t[n].progress}),{container:e,axis:n});return{currentTime:i,cancel:s}}({source:e,axis:n})),i[n]}function fl(t){return t&&(t.target||t.offset)}function gl(t,{axis:e="y",...n}={}){const i={axis:e,...n};return"function"==typeof t?function(t,e){return function(t){return 2===t.length}(t)||fl(e)?dl((n=>{t(n[e.axis].progress,n)}),e):zu(t,ml(e))}(t,i):function(t,e){if(t.flatten(),fl(e))return t.pause(),dl((n=>{t.time=t.duration*n[e.axis].progress}),e);{const n=ml(e);return t.attachTimeline?t.attachTimeline(n,(t=>(t.pause(),zu((e=>{t.time=t.duration*e}),n)))):L}}(t,i)}const yl={some:0,all:1};function vl(t,e,{root:n,margin:i,amount:s="some"}={}){const o=Et(t),r=new WeakMap,a=new IntersectionObserver((t=>{t.forEach((t=>{const n=r.get(t.target);if(t.isIntersecting!==Boolean(n))if(t.isIntersecting){const n=e(t.target,t);"function"==typeof n?r.set(t.target,n):a.unobserve(t.target)}else"function"==typeof n&&(n(t),r.delete(t.target))}))}),{root:n,rootMargin:i,threshold:"number"==typeof s?s:yl[s]});return o.forEach((t=>a.observe(t))),()=>a.disconnect()}const xl=vr(nu());function wl(t){return e.useEffect((()=>()=>t()),[])}const Pl={renderer:su,...Ur,...Ta},Tl={...Pl,...pa,...Sa},Sl={renderer:su,...Ur};function bl(t,n,i){e.useInsertionEffect((()=>t.on(n,i)),[t,n,i])}function Al(t,e){Boolean(!e||e.current)}const El=()=>({scrollX:Wt(0),scrollY:Wt(0),scrollXProgress:Wt(0),scrollYProgress:Wt(0)});function Ml({container:t,target:n,layoutEffect:i=!0,...s}={}){const o=f(El);return(i?y:e.useEffect)((()=>(Al(0,n),Al(0,t),gl(((t,{x:e,y:n})=>{o.scrollX.set(e.current),o.scrollXProgress.set(e.progress),o.scrollY.set(n.current),o.scrollYProgress.set(n.progress)}),{...s,container:t?.current||void 0,target:n?.current||void 0}))),[t,n,JSON.stringify(s.offset)]),o}function Cl(t,e){return e?t+e:t}function Vl(t){return"number"==typeof t?t:parseFloat(t)}function Rl(t){const n=e.useRef(0),{isStatic:i}=e.useContext(x);e.useEffect((()=>{if(i)return;const e=({timestamp:e,delta:i})=>{n.current||(n.current=e),t(e-n.current,i)};return yt.update(e,!0),()=>vt(e)}),[t])}class kl extends Ut{constructor(){super(...arguments),this.values=[]}add(t){const e=function(t){return pe.has(t)?"transform":Wi.has(t)?qi(t):void 0}(t);e&&(C(this.values,e),this.update())}update(){this.set(this.values.length?this.values.join(", "):"auto")}}function Dl(){!Fo.current&&jo();const[t]=e.useState(Oo.current);return t}function Ll(t,e){[...e].reverse().forEach((n=>{const i=t.getVariant(n);i&&Pr(t,i),t.variantChildren&&t.variantChildren.forEach((t=>{Ll(t,e)}))}))}function Bl(){const t=new Set,e={subscribe:e=>(t.add(e),()=>{t.delete(e)}),start(e,n){const i=[];return t.forEach((t=>{i.push(Mr(t,e,{transitionOverride:n}))})),Promise.all(i)},set:e=>t.forEach((t=>{!function(t,e){Array.isArray(e)?Ll(t,e):"string"==typeof e?Ll(t,[e]):Pr(t,e)}(t,e)})),stop(){t.forEach((t=>{!function(t){t.values.forEach((t=>t.stop()))}(t)}))},mount:()=>()=>{e.stop()}};return e}function Ol(){const t=f(Bl);return y(t.mount,[]),t}const Fl=Ol;class jl{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 Il=()=>new jl;function Ul(t){return null!==t&&"object"==typeof t&&Ma in t}function Wl(){return Nl}function Nl(t){Eo.current&&(Eo.current.isUpdating=!1,Eo.current.blockUpdate(),t&&t())}const $l=new Map,zl=new Map,Hl=(t,e)=>`${t}: ${pe.has(e)?"transform":e}`;function Xl(t,e,n){const i=Hl(t,e),s=$l.get(i);if(!s)return null;const{animation:o,startTime:r}=s;function a(){window.MotionCancelOptimisedAnimation?.(t,e,n)}return o.onfinish=a,null===r||window.MotionHandoffIsComplete?.(t)?(a(),null):r}let Yl,Kl;const Gl=new Set;function _l(){Gl.forEach((t=>{t.animation.play(),t.animation.startTime=t.startTime})),Gl.clear()}const ql=()=>({});class Zl extends _o{constructor(){super(...arguments),this.measureInstanceViewportBox=Fs}build(){}resetTransform(){}restoreTransform(){}removeValueFromRenderState(){}renderInstance(){}scrapeMotionValuesFromProps(){return{}}getBaseTargetFromProps(){}readValueFromInstance(t,e,n){return n.initialState[e]||0}sortInstanceNodePosition(){return 0}}const Jl=Ka({scrapeMotionValuesFromProps:ql,createRenderState:ql});let Ql=0;const tc=t=>t>.001?1/t:1e5;t.AcceleratedAnimation=zi,t.AnimatePresence=({children:t,custom:n,initial:i=!0,onExitComplete:s,presenceAffectsLayout:o=!0,mode:r="sync",propagate:a=!1,anchorX:u="left"})=>{const[l,c]=b(a),p=e.useMemo((()=>E(t)),[t]),g=a&&!l?[]:p.map(A),v=e.useRef(!0),x=e.useRef(p),w=f((()=>new Map)),[P,S]=e.useState(p),[M,C]=e.useState(p);y((()=>{v.current=!1,x.current=p;for(let t=0;t<M.length;t++){const e=A(M[t]);g.includes(e)?w.delete(e):!0!==w.get(e)&&w.set(e,!1)}}),[M,g.length,g.join("-")]);const V=[];if(p!==P){let t=[...p];for(let e=0;e<M.length;e++){const n=M[e],i=A(n);g.includes(i)||(t.splice(e,0,n),V.push(n))}return"wait"===r&&V.length&&(t=V),C(E(t)),S(p),null}const{forceRender:R}=e.useContext(m);return d(h,{children:M.map((t=>{const e=A(t),h=!(a&&!l)&&(p===M||g.includes(e));return d(T,{isPresent:h,initial:!(v.current&&!i)&&void 0,custom:n,presenceAffectsLayout:o,mode:r,onExitComplete:h?void 0:()=>{if(!w.has(e))return;w.set(e,!0);let t=!0;w.forEach((e=>{e||(t=!1)})),t&&(R?.(),C(x.current),a&&c?.(),s&&s())},anchorX:u,children:t},e)}))})},t.AnimateSharedLayout=({children:t})=>(i.useEffect((()=>{}),[]),d(ur,{id:f((()=>"asl-"+Ql++)),children:t})),t.DeprecatedLayoutGroupContext=M,t.DragControls=jl,t.FlatTree=ns,t.LayoutGroup=ur,t.LayoutGroupContext=m,t.LazyMotion=function({children:t,features:n,strict:i=!1}){const[,s]=e.useState(!hr(n)),o=e.useRef(void 0);if(!hr(n)){const{renderer:t,...e}=n;o.current=t,cr(e)}return e.useEffect((()=>{hr(n)&&n().then((({renderer:t,...e})=>{cr(e),o.current=t,s(!0)}))}),[]),d(lr.Provider,{value:{renderer:o.current,strict:i},children:t})},t.MotionConfig=function({children:t,isValidProp:n,...i}){n&&fr(n),(i={...e.useContext(x),...i}).isStatic=f((()=>i.isStatic));const s=e.useMemo((()=>i),[JSON.stringify(i.transition),i.transformPagePoint,i.reducedMotion]);return d(x.Provider,{value:s,children:t})},t.MotionConfigContext=x,t.MotionContext=ba,t.MotionGlobalConfig=k,t.MotionValue=Ut,t.PresenceContext=v,t.Reorder=vu,t.SwitchLayoutGroupContext=la,t.VisualElement=_o,t.WillChangeMotionValue=kl,t.addPointerEvent=$r,t.addPointerInfo=Nr,t.addScaleCorrector=Ys,t.animate=Wu,t.animateMini=$u,t.animateValue=Ui,t.animateVisualElement=Mr,t.animationControls=Bl,t.animations=Ur,t.anticipate=ae,t.backIn=oe,t.backInOut=re,t.backOut=se,t.buildTransform=tr,t.calcLength=Ht,t.cancelFrame=vt,t.cancelSync=$t,t.circIn=ue,t.circInOut=ce,t.circOut=le,t.clamp=fe,t.color=Oe,t.complex=He,t.createBox=Fs,t.createRendererMotionComponent=ka,t.createScopedAnimate=Uu,t.cubicBezier=ee,t.delay=is,t.disableInstantTransitions=function(){Qt.current=!1},t.distance=Xr,t.distance2D=Yr,t.domAnimation=Pl,t.domMax=Tl,t.domMin=Sl,t.easeIn=Ai,t.easeInOut=Mi,t.easeOut=Ei,t.filterProps=gr,t.findSpring=yi,t.frame=yt,t.frameData=xt,t.hover=Vt,t.inView=vl,t.inertia=bi,t.interpolate=ki,t.invariant=R,t.isBrowser=g,t.isDragActive=At,t.isMotionComponent=Ul,t.isMotionValue=Jt,t.isValidMotionProp=pr,t.keyframes=Bi,t.m=xl,t.makeUseVisualState=Ka,t.mirrorEasing=ne,t.mix=ei,t.motion=ou,t.motionValue=Wt,t.noop=L,t.optimizedAppearDataAttribute=Ji,t.pipe=Gn,t.press=jt,t.progress=B,t.px=Re,t.resolveMotionValue=os,t.reverseEasing=ie,t.scroll=gl,t.scrollInfo=dl,t.spring=Si,t.stagger=function(t=.1,{startDelay:e=0,from:n=0,ease:i}={}){return(s,o)=>{const r="number"==typeof n?n:function(t,e){if("first"===t)return 0;{const n=e-1;return"last"===t?n:n/2}}(n,o),a=Math.abs(r-s);let u=t*a;if(i){const e=o*t;u=Ri(i)(u/e)*e}return e+u}},t.startOptimizedAppearAnimation=function(t,e,n,i,s){if(window.MotionIsMounted)return;const o=t.dataset[Zi];if(!o)return;window.MotionHandoffAnimation=Xl;const r=Hl(o,e);Kl||(Kl=it(t,e,[n[0],n[0]],{duration:1e4,ease:"linear"}),$l.set(r,{animation:Kl,startTime:null}),window.MotionHandoffAnimation=Xl,window.MotionHasOptimisedAnimation=(t,e)=>{if(!t)return!1;if(!e)return zl.has(t);const n=Hl(t,e);return Boolean($l.get(n))},window.MotionHandoffMarkAsComplete=t=>{zl.has(t)&&zl.set(t,!0)},window.MotionHandoffIsComplete=t=>!0===zl.get(t),window.MotionCancelOptimisedAnimation=(t,e,n,i)=>{const s=Hl(t,e),o=$l.get(s);o&&(n&&void 0===i?n.postRender((()=>{n.postRender((()=>{o.animation.cancel()}))})):o.animation.cancel(),n&&i?(Gl.add(o),n.render(_l)):($l.delete(s),$l.size||(window.MotionCancelOptimisedAnimation=void 0)))},window.MotionCheckAppearSync=(t,e,n)=>{const i=Qi(t);if(!i)return;const s=window.MotionHasOptimisedAnimation?.(i,e),o=t.props.values?.[e];if(!s||!o)return;const r=n.on("change",(t=>{o.get()!==t&&(window.MotionCancelOptimisedAnimation?.(i,e),r())}));return r});const a=()=>{Kl.cancel();const o=it(t,e,n,i);void 0===Yl&&(Yl=performance.now()),o.startTime=Yl,$l.set(r,{animation:o,startTime:Yl}),s&&s(o)};zl.set(o,!1),Kl.ready?Kl.ready.then(a).catch(L):a()},t.steps=function(t,e="end"){return n=>{const i=(n="end"===e?Math.min(n,.999):Math.max(n,.001))*t,s="end"===e?Math.floor(i):Math.ceil(i);return fe(0,1,s/t)}},t.sync=Nt,t.time=St,t.transform=hu,t.unwrapMotionComponent=function(t){if(Ul(t))return t[Ma]},t.useAnimate=function(){const t=f((()=>({current:null,animations:[]}))),e=f((()=>Uu(t)));return wl((()=>{t.animations.forEach((t=>t.stop()))})),[t,e]},t.useAnimateMini=function(){const t=f((()=>({current:null,animations:[]}))),e=f((()=>Nu(t)));return wl((()=>{t.animations.forEach((t=>t.stop()))})),[t,e]},t.useAnimation=Fl,t.useAnimationControls=Ol,t.useAnimationFrame=Rl,t.useCycle=function(...t){const n=e.useRef(0),[i,s]=e.useState(t[n.current]);return[i,e.useCallback((e=>{n.current="number"!=typeof e?xu(0,t.length,n.current+1):e,s(t[n.current])}),[t.length,...t])]},t.useDeprecatedAnimatedState=function(t){const[n,i]=e.useState(t),s=Jl({},!1),o=f((()=>new Zl({props:{onUpdate:t=>{i({...t})}},visualState:s,presenceContext:null},{initialState:t})));return e.useLayoutEffect((()=>(o.mount({}),()=>o.unmount())),[o]),[n,f((()=>t=>Mr(o,t)))]},t.useDeprecatedInvertedScale=function(t){let n=cu(1),i=cu(1);const{visualElement:s}=e.useContext(ba);return t?(n=t.scaleX||n,i=t.scaleY||i):s&&(n=s.getValue("scaleX",1),i=s.getValue("scaleY",1)),{scaleX:pu(n,tc),scaleY:pu(i,tc)}},t.useDomEvent=function(t,n,i,s){e.useEffect((()=>{const e=t.current;if(i&&e)return bo(e,n,i,s)}),[t,n,i,s])},t.useDragControls=function(){return f(Il)},t.useElementScroll=function(t){return Ml({container:t})},t.useForceUpdate=rr,t.useInView=function(t,{root:n,margin:i,amount:s,once:o=!1,initial:r=!1}={}){const[a,u]=e.useState(r);return e.useEffect((()=>{if(!t.current||o&&a)return;const e={root:n&&n.current||void 0,margin:i,amount:s};return vl(t.current,(()=>(u(!0),o?void 0:()=>u(!1))),e)}),[n,t,i,o,s]),a},t.useInstantLayoutTransition=Wl,t.useInstantTransition=function(){const[t,n]=rr(),i=Wl(),s=e.useRef(-1);return e.useEffect((()=>{yt.postRender((()=>yt.postRender((()=>{n===s.current&&(Qt.current=!1)}))))}),[n]),e=>{i((()=>{Qt.current=!0,t(),e(),s.current=n+1}))}},t.useIsPresent=function(){return null===(t=e.useContext(v))||t.isPresent;var t},t.useIsomorphicLayoutEffect=y,t.useMotionTemplate=function(t,...e){const n=t.length;return du(e.filter(Jt),(function(){let i="";for(let s=0;s<n;s++){i+=t[s];const n=e[s];n&&(i+=Jt(n)?n.get():n)}return i}))},t.useMotionValue=cu,t.useMotionValueEvent=bl,t.usePresence=b,t.usePresenceData=function(){const t=e.useContext(v);return t?t.custom:void 0},t.useReducedMotion=Dl,t.useReducedMotionConfig=function(){const t=Dl(),{reducedMotion:n}=e.useContext(x);return"never"!==n&&("always"===n||t)},t.useResetProjection=function(){return e.useCallback((()=>{const t=Eo.current;t&&t.resetTree()}),[])},t.useScroll=Ml,t.useSpring=function(t,n={}){const{isStatic:i}=e.useContext(x),s=e.useRef(null),o=f((()=>Jt(t)?t.get():t)),r=f((()=>"string"==typeof o?o.replace(/[\d.-]/g,""):void 0)),a=cu(o),u=e.useRef(o),l=e.useRef(L),c=()=>{h(),s.current=Ui({keyframes:[Vl(a.get()),Vl(u.current)],velocity:a.getVelocity(),type:"spring",restDelta:.001,restSpeed:.01,...n,onUpdate:l.current})},h=()=>{s.current&&s.current.stop()};return e.useInsertionEffect((()=>a.attach(((t,e)=>i?e(t):(u.current=t,l.current=t=>e(Cl(t,r)),yt.postRender(c),a.get())),h)),[JSON.stringify(n)]),y((()=>{if(Jt(t))return t.on("change",(t=>a.set(Cl(t,r))))}),[a,r]),a},t.useTime=function(){const t=cu(0);return Rl((e=>t.set(e))),t},t.useTransform=pu,t.useUnmountEffect=wl,t.useVelocity=function(t){const e=cu(t.getVelocity()),n=()=>{const i=t.getVelocity();e.set(i),i&&yt.update(n)};return bl(t,"change",(()=>{yt.update(n,!1,!0)})),e},t.useViewportScroll=function(){return Ml()},t.useWillChange=function(){return f((()=>new kl("auto")))},t.visualElementStore=Uo,t.wrap=xu}));