mkA~(@^_^@)~PNG  IHDR Ÿ f Õ†C1 sRGB ®Îé gAMA ± üa pHYs à ÃÇo¨d GIDATx^íÜL”÷ð÷Yçªö("Bh_ò«®¸¢§q5kÖ*:þ0A­ºšÖ¥]VkJ¢M»¶f¸±8\k2íll£1]q®ÙÔ‚ÆT p0 import{j as ht,x as Bi,b as P}from"./index-DoU2MHKd.js";import{B as ki}from"./Box-COt46hbf.js";import{o as qt}from"./observer-B278D4P8.js";const eu=({...t})=>ht.jsx(ki,{...t,sx:{maxHeight:"30px",color:"primary.main",...t.sx},children:ht.jsx(Bi,{className:"spin",size:"30px"})}),nu=()=>({handleError:n=>{var o;const{message:s,data:i}=n;i&&((o=i.errors)==null?void 0:o.length)>0?Object.values(i.errors).forEach(r=>{qt.fire("fireToast",{type:"error",title:r[0]})}):s&&qt.fire("fireToast",{type:"error",title:s})},fireToast:n=>qt.fire("fireToast",n)}),cs=P.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),Wt=P.createContext({}),Ae=P.createContext(null),we=typeof document<"u",Oi=we?P.useLayoutEffect:P.useEffect,hs=P.createContext({strict:!1}),Ce=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),ji="framerAppearId",fs="data-"+Ce(ji),Ii={skipAnimations:!1,useManualTiming:!1};class en{constructor(){this.order=[],this.scheduled=new Set}add(e){if(!this.scheduled.has(e))return this.scheduled.add(e),this.order.push(e),!0}remove(e){const n=this.order.indexOf(e);n!==-1&&(this.order.splice(n,1),this.scheduled.delete(e))}clear(){this.order.length=0,this.scheduled.clear()}}function Ui(t){let e=new en,n=new en,s=0,i=!1,o=!1;const r=new WeakSet,a={schedule:(l,u=!1,c=!1)=>{const h=c&&i,f=h?e:n;return u&&r.add(l),f.add(l)&&h&&i&&(s=e.order.length),l},cancel:l=>{n.remove(l),r.delete(l)},process:l=>{if(i){o=!0;return}if(i=!0,[e,n]=[n,e],n.clear(),s=e.order.length,s)for(let u=0;u(h[f]=Ui(()=>n=!0),h),{}),r=h=>{o[h].process(i)},a=()=>{const h=performance.now();n=!1,i.delta=s?1e3/60:Math.max(Math.min(h-i.timestamp,Ni),1),i.timestamp=h,i.isProcessing=!0,Mt.forEach(r),i.isProcessing=!1,n&&e&&(s=!1,t(a))},l=()=>{n=!0,s=!0,i.isProcessing||t(a)};return{schedule:Mt.reduce((h,f)=>{const d=o[f];return h[f]=(m,p=!1,y=!1)=>(n||l(),d.schedule(m,p,y)),h},{}),cancel:h=>Mt.forEach(f=>o[f].cancel(h)),state:i,steps:o}}const{schedule:De,cancel:su}=ds(queueMicrotask,!1);function Ki(t,e,n,s){const{visualElement:i}=P.useContext(Wt),o=P.useContext(hs),r=P.useContext(Ae),a=P.useContext(cs).reducedMotion,l=P.useRef();s=s||o.renderer,!l.current&&s&&(l.current=s(t,{visualState:e,parent:i,props:n,presenceContext:r,blockInitialAnimation:r?r.initial===!1:!1,reducedMotionConfig:a}));const u=l.current;P.useInsertionEffect(()=>{u&&u.update(n,r)});const c=P.useRef(!!(n[fs]&&!window.HandoffComplete));return Oi(()=>{u&&(De.render(u.render),c.current&&u.animationState&&u.animationState.animateChanges())}),P.useEffect(()=>{u&&(u.updateFeatures(),!c.current&&u.animationState&&u.animationState.animateChanges(),c.current&&(c.current=!1,window.HandoffComplete=!0))}),u}function at(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function Wi(t,e,n){return P.useCallback(s=>{s&&t.mount&&t.mount(s),e&&(s?e.mount(s):e.unmount()),n&&(typeof n=="function"?n(s):at(n)&&(n.current=s))},[e])}function Tt(t){return typeof t=="string"||Array.isArray(t)}function Gt(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}const Me=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Re=["initial",...Me];function $t(t){return Gt(t.animate)||Re.some(e=>Tt(t[e]))}function ms(t){return!!($t(t)||t.variants)}function Gi(t,e){if($t(t)){const{initial:n,animate:s}=t;return{initial:n===!1||Tt(n)?n:void 0,animate:Tt(s)?s:void 0}}return t.inherit!==!1?e:{}}function $i(t){const{initial:e,animate:n}=Gi(t,P.useContext(Wt));return P.useMemo(()=>({initial:e,animate:n}),[nn(e),nn(n)])}function nn(t){return Array.isArray(t)?t.join(" "):t}const sn={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"]},Pt={};for(const t in sn)Pt[t]={isEnabled:e=>sn[t].some(n=>!!e[n])};function _i(t){for(const e in t)Pt[e]={...Pt[e],...t[e]}}const ps=P.createContext({}),gs=P.createContext({}),Hi=Symbol.for("motionComponentSymbol");function zi({preloadedFeatures:t,createVisualElement:e,useRender:n,useVisualState:s,Component:i}){t&&_i(t);function o(a,l){let u;const c={...P.useContext(cs),...a,layoutId:Yi(a)},{isStatic:h}=c,f=$i(a),d=s(a,h);if(!h&&we){f.visualElement=Ki(i,d,c,e);const m=P.useContext(gs),p=P.useContext(hs).strict;f.visualElement&&(u=f.visualElement.loadFeatures(c,p,t,m))}return ht.jsxs(Wt.Provider,{value:f,children:[u&&f.visualElement?ht.jsx(u,{visualElement:f.visualElement,...c}):null,n(i,a,Wi(d,f.visualElement,l),d,h,f.visualElement)]})}const r=P.forwardRef(o);return r[Hi]=i,r}function Yi({layoutId:t}){const e=P.useContext(ps).id;return e&&t!==void 0?e+"-"+t:t}function Xi(t){function e(s,i={}){return zi(t(s,i))}if(typeof Proxy>"u")return e;const n=new Map;return new Proxy(e,{get:(s,i)=>(n.has(i)||n.set(i,e(i)),n.get(i))})}const qi=["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 Ee(t){return typeof t!="string"||t.includes("-")?!1:!!(qi.indexOf(t)>-1||/[A-Z]/u.test(t))}const kt={};function Zi(t){Object.assign(kt,t)}const At=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],rt=new Set(At);function ys(t,{layout:e,layoutId:n}){return rt.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!kt[t]||t==="opacity")}const E=t=>!!(t&&t.getVelocity),Qi={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Ji=At.length;function tr(t,{enableHardwareAcceleration:e=!0,allowTransformNone:n=!0},s,i){let o="";for(let r=0;re=>typeof e=="string"&&e.startsWith(t),xs=vs("--"),er=vs("var(--"),Le=t=>er(t)?nr.test(t.split("/*")[0].trim()):!1,nr=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,sr=(t,e)=>e&&typeof t=="number"?e.transform(t):t,Z=(t,e,n)=>n>e?e:ntypeof t=="number",parse:parseFloat,transform:t=>t},gt={...dt,transform:t=>Z(0,1,t)},Rt={...dt,default:1},yt=t=>Math.round(t*1e5)/1e5,Fe=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu,ir=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,rr=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu;function wt(t){return typeof t=="string"}const Ct=t=>({test:e=>wt(e)&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),z=Ct("deg"),U=Ct("%"),x=Ct("px"),or=Ct("vh"),ar=Ct("vw"),rn={...U,parse:t=>U.parse(t)/100,transform:t=>U.transform(t*100)},on={...dt,transform:Math.round},Ts={borderWidth:x,borderTopWidth:x,borderRightWidth:x,borderBottomWidth:x,borderLeftWidth:x,borderRadius:x,radius:x,borderTopLeftRadius:x,borderTopRightRadius:x,borderBottomRightRadius:x,borderBottomLeftRadius:x,width:x,maxWidth:x,height:x,maxHeight:x,size:x,top:x,right:x,bottom:x,left:x,padding:x,paddingTop:x,paddingRight:x,paddingBottom:x,paddingLeft:x,margin:x,marginTop:x,marginRight:x,marginBottom:x,marginLeft:x,rotate:z,rotateX:z,rotateY:z,rotateZ:z,scale:Rt,scaleX:Rt,scaleY:Rt,scaleZ:Rt,skew:z,skewX:z,skewY:z,distance:x,translateX:x,translateY:x,translateZ:x,x,y:x,z:x,perspective:x,transformPerspective:x,opacity:gt,originX:rn,originY:rn,originZ:x,zIndex:on,backgroundPositionX:x,backgroundPositionY:x,fillOpacity:gt,strokeOpacity:gt,numOctaves:on};function Be(t,e,n,s){const{style:i,vars:o,transform:r,transformOrigin:a}=t;let l=!1,u=!1,c=!0;for(const h in e){const f=e[h];if(xs(h)){o[h]=f;continue}const d=Ts[h],m=sr(f,d);if(rt.has(h)){if(l=!0,r[h]=m,!c)continue;f!==(d.default||0)&&(c=!1)}else h.startsWith("origin")?(u=!0,a[h]=m):i[h]=m}if(e.transform||(l||s?i.transform=tr(t.transform,n,c,s):i.transform&&(i.transform="none")),u){const{originX:h="50%",originY:f="50%",originZ:d=0}=a;i.transformOrigin=`${h} ${f} ${d}`}}const ke=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Ps(t,e,n){for(const s in e)!E(e[s])&&!ys(s,n)&&(t[s]=e[s])}function lr({transformTemplate:t},e,n){return P.useMemo(()=>{const s=ke();return Be(s,e,{enableHardwareAcceleration:!n},t),Object.assign({},s.vars,s.style)},[e])}function ur(t,e,n){const s=t.style||{},i={};return Ps(i,s,t),Object.assign(i,lr(t,e,n)),i}function cr(t,e,n){const s={},i=ur(t,e,n);return t.drag&&t.dragListener!==!1&&(s.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(s.tabIndex=0),s.style=i,s}const hr=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 Ot(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||hr.has(t)}let bs=t=>!Ot(t);function fr(t){t&&(bs=e=>e.startsWith("on")?!Ot(e):t(e))}try{fr(require("@emotion/is-prop-valid").default)}catch{}function dr(t,e,n){const s={};for(const i in t)i==="values"&&typeof t.values=="object"||(bs(i)||n===!0&&Ot(i)||!e&&!Ot(i)||t.draggable&&i.startsWith("onDrag"))&&(s[i]=t[i]);return s}function an(t,e,n){return typeof t=="string"?t:x.transform(e+n*t)}function mr(t,e,n){const s=an(e,t.x,t.width),i=an(n,t.y,t.height);return`${s} ${i}`}const pr={offset:"stroke-dashoffset",array:"stroke-dasharray"},gr={offset:"strokeDashoffset",array:"strokeDasharray"};function yr(t,e,n=1,s=0,i=!0){t.pathLength=1;const o=i?pr:gr;t[o.offset]=x.transform(-s);const r=x.transform(e),a=x.transform(n);t[o.array]=`${r} ${a}`}function Oe(t,{attrX:e,attrY:n,attrScale:s,originX:i,originY:o,pathLength:r,pathSpacing:a=1,pathOffset:l=0,...u},c,h,f){if(Be(t,u,c,f),h){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:d,style:m,dimensions:p}=t;d.transform&&(p&&(m.transform=d.transform),delete d.transform),p&&(i!==void 0||o!==void 0||m.transform)&&(m.transformOrigin=mr(p,i!==void 0?i:.5,o!==void 0?o:.5)),e!==void 0&&(d.x=e),n!==void 0&&(d.y=n),s!==void 0&&(d.scale=s),r!==void 0&&yr(d,r,a,l,!1)}const Ss=()=>({...ke(),attrs:{}}),je=t=>typeof t=="string"&&t.toLowerCase()==="svg";function vr(t,e,n,s){const i=P.useMemo(()=>{const o=Ss();return Oe(o,e,{enableHardwareAcceleration:!1},je(s),t.transformTemplate),{...o.attrs,style:{...o.style}}},[e]);if(t.style){const o={};Ps(o,t.style,t),i.style={...o,...i.style}}return i}function xr(t=!1){return(n,s,i,{latestValues:o},r)=>{const l=(Ee(n)?vr:cr)(s,o,r,n),u=dr(s,typeof n=="string",t),c=n!==P.Fragment?{...u,...l,ref:i}:{},{children:h}=s,f=P.useMemo(()=>E(h)?h.get():h,[h]);return P.createElement(n,{...c,children:f})}}function Vs(t,{style:e,vars:n},s,i){Object.assign(t.style,e,i&&i.getProjectionStyles(s));for(const o in n)t.style.setProperty(o,n[o])}const As=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 ws(t,e,n,s){Vs(t,e,void 0,s);for(const i in e.attrs)t.setAttribute(As.has(i)?i:Ce(i),e.attrs[i])}function Ie(t,e,n){var s;const{style:i}=t,o={};for(const r in i)(E(i[r])||e.style&&E(e.style[r])||ys(r,t)||((s=n==null?void 0:n.getValue(r))===null||s===void 0?void 0:s.liveStyle)!==void 0)&&(o[r]=i[r]);return o}function Cs(t,e,n){const s=Ie(t,e,n);for(const i in t)if(E(t[i])||E(e[i])){const o=At.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;s[o]=t[i]}return s}function ln(t){const e=[{},{}];return t==null||t.values.forEach((n,s)=>{e[0][s]=n.get(),e[1][s]=n.getVelocity()}),e}function Ue(t,e,n,s){if(typeof e=="function"){const[i,o]=ln(s);e=e(n!==void 0?n:t.custom,i,o)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[i,o]=ln(s);e=e(n!==void 0?n:t.custom,i,o)}return e}function Tr(t){const e=P.useRef(null);return e.current===null&&(e.current=t()),e.current}const ce=t=>Array.isArray(t),Pr=t=>!!(t&&typeof t=="object"&&t.mix&&t.toValue),br=t=>ce(t)?t[t.length-1]||0:t;function Lt(t){const e=E(t)?t.get():t;return Pr(e)?e.toValue():e}function Sr({scrapeMotionValuesFromProps:t,createRenderState:e,onMount:n},s,i,o){const r={latestValues:Vr(s,i,o,t),renderState:e()};return n&&(r.mount=a=>n(s,a,r)),r}const Ds=t=>(e,n)=>{const s=P.useContext(Wt),i=P.useContext(Ae),o=()=>Sr(t,e,s,i);return n?o():Tr(o)};function Vr(t,e,n,s){const i={},o=s(t,{});for(const f in o)i[f]=Lt(o[f]);let{initial:r,animate:a}=t;const l=$t(t),u=ms(t);e&&u&&!l&&t.inherit!==!1&&(r===void 0&&(r=e.initial),a===void 0&&(a=e.animate));let c=n?n.initial===!1:!1;c=c||r===!1;const h=c?a:r;return h&&typeof h!="boolean"&&!Gt(h)&&(Array.isArray(h)?h:[h]).forEach(d=>{const m=Ue(t,d);if(!m)return;const{transitionEnd:p,transition:y,...v}=m;for(const T in v){let g=v[T];if(Array.isArray(g)){const b=c?g.length-1:0;g=g[b]}g!==null&&(i[T]=g)}for(const T in p)i[T]=p[T]}),i}const L=t=>t,{schedule:A,cancel:_,state:D,steps:Zt}=ds(typeof requestAnimationFrame<"u"?requestAnimationFrame:L,!0),Ar={useVisualState:Ds({scrapeMotionValuesFromProps:Cs,createRenderState:Ss,onMount:(t,e,{renderState:n,latestValues:s})=>{A.read(()=>{try{n.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{n.dimensions={x:0,y:0,width:0,height:0}}}),A.render(()=>{Oe(n,s,{enableHardwareAcceleration:!1},je(e.tagName),t.transformTemplate),ws(e,n)})}})},wr={useVisualState:Ds({scrapeMotionValuesFromProps:Ie,createRenderState:ke})};function Cr(t,{forwardMotionProps:e=!1},n,s){return{...Ee(t)?Ar:wr,preloadedFeatures:n,useRender:xr(e),createVisualElement:s,Component:t}}function K(t,e,n,s={passive:!0}){return t.addEventListener(e,n,s),()=>t.removeEventListener(e,n)}const Ms=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1;function _t(t,e="page"){return{point:{x:t[`${e}X`],y:t[`${e}Y`]}}}const Dr=t=>e=>Ms(e)&&t(e,_t(e));function W(t,e,n,s){return K(t,e,Dr(n),s)}const Mr=(t,e)=>n=>e(t(n)),G=(...t)=>t.reduce(Mr);function Rs(t){let e=null;return()=>{const n=()=>{e=null};return e===null?(e=t,n):!1}}const un=Rs("dragHorizontal"),cn=Rs("dragVertical");function Es(t){let e=!1;if(t==="y")e=cn();else if(t==="x")e=un();else{const n=un(),s=cn();n&&s?e=()=>{n(),s()}:(n&&n(),s&&s())}return e}function Ls(){const t=Es(!0);return t?(t(),!1):!0}class J{constructor(e){this.isMounted=!1,this.node=e}update(){}}function hn(t,e){const n=e?"pointerenter":"pointerleave",s=e?"onHoverStart":"onHoverEnd",i=(o,r)=>{if(o.pointerType==="touch"||Ls())return;const a=t.getProps();t.animationState&&a.whileHover&&t.animationState.setActive("whileHover",e);const l=a[s];l&&A.postRender(()=>l(o,r))};return W(t.current,n,i,{passive:!t.getProps()[s]})}class Rr extends J{mount(){this.unmount=G(hn(this.node,!0),hn(this.node,!1))}unmount(){}}class Er extends J{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!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=G(K(this.node.current,"focus",()=>this.onFocus()),K(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const Fs=(t,e)=>e?t===e?!0:Fs(t,e.parentElement):!1;function Qt(t,e){if(!e)return;const n=new PointerEvent("pointer"+t);e(n,_t(n))}class Lr extends J{constructor(){super(...arguments),this.removeStartListeners=L,this.removeEndListeners=L,this.removeAccessibleListeners=L,this.startPointerPress=(e,n)=>{if(this.isPressing)return;this.removeEndListeners();const s=this.node.getProps(),o=W(window,"pointerup",(a,l)=>{if(!this.checkPressEnd())return;const{onTap:u,onTapCancel:c,globalTapTarget:h}=this.node.getProps(),f=!h&&!Fs(this.node.current,a.target)?c:u;f&&A.update(()=>f(a,l))},{passive:!(s.onTap||s.onPointerUp)}),r=W(window,"pointercancel",(a,l)=>this.cancelPress(a,l),{passive:!(s.onTapCancel||s.onPointerCancel)});this.removeEndListeners=G(o,r),this.startPress(e,n)},this.startAccessiblePress=()=>{const e=o=>{if(o.key!=="Enter"||this.isPressing)return;const r=a=>{a.key!=="Enter"||!this.checkPressEnd()||Qt("up",(l,u)=>{const{onTap:c}=this.node.getProps();c&&A.postRender(()=>c(l,u))})};this.removeEndListeners(),this.removeEndListeners=K(this.node.current,"keyup",r),Qt("down",(a,l)=>{this.startPress(a,l)})},n=K(this.node.current,"keydown",e),s=()=>{this.isPressing&&Qt("cancel",(o,r)=>this.cancelPress(o,r))},i=K(this.node.current,"blur",s);this.removeAccessibleListeners=G(n,i)}}startPress(e,n){this.isPressing=!0;const{onTapStart:s,whileTap:i}=this.node.getProps();i&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),s&&A.postRender(()=>s(e,n))}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!Ls()}cancelPress(e,n){if(!this.checkPressEnd())return;const{onTapCancel:s}=this.node.getProps();s&&A.postRender(()=>s(e,n))}mount(){const e=this.node.getProps(),n=W(e.globalTapTarget?window:this.node.current,"pointerdown",this.startPointerPress,{passive:!(e.onTapStart||e.onPointerStart)}),s=K(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=G(n,s)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}const he=new WeakMap,Jt=new WeakMap,Fr=t=>{const e=he.get(t.target);e&&e(t)},Br=t=>{t.forEach(Fr)};function kr({root:t,...e}){const n=t||document;Jt.has(n)||Jt.set(n,{});const s=Jt.get(n),i=JSON.stringify(e);return s[i]||(s[i]=new IntersectionObserver(Br,{root:t,...e})),s[i]}function Or(t,e,n){const s=kr(e);return he.set(t,n),s.observe(t),()=>{he.delete(t),s.unobserve(t)}}const jr={some:0,all:1};class Ir extends J{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:n,margin:s,amount:i="some",once:o}=e,r={root:n?n.current:void 0,rootMargin:s,threshold:typeof i=="number"?i:jr[i]},a=l=>{const{isIntersecting:u}=l;if(this.isInView===u||(this.isInView=u,o&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:c,onViewportLeave:h}=this.node.getProps(),f=u?c:h;f&&f(l)};return Or(this.node.current,r,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(Ur(e,n))&&this.startObserver()}unmount(){}}function Ur({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const Nr={inView:{Feature:Ir},tap:{Feature:Lr},focus:{Feature:Er},hover:{Feature:Rr}};function Bs(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let s=0;st*1e3,$=t=>t/1e3,Kr={type:"spring",stiffness:500,damping:25,restSpeed:10},Wr=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),Gr={type:"keyframes",duration:.8},$r={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},_r=(t,{keyframes:e})=>e.length>2?Gr:rt.has(t)?t.startsWith("scale")?Wr(e[1]):Kr:$r;function Hr({when:t,delay:e,delayChildren:n,staggerChildren:s,staggerDirection:i,repeat:o,repeatType:r,repeatDelay:a,from:l,elapsed:u,...c}){return!!Object.keys(c).length}function Ne(t,e){return t[e]||t.default||t}const zr=t=>t!==null;function zt(t,{repeat:e,repeatType:n="loop"},s){const i=t.filter(zr),o=e&&n!=="loop"&&e%2===1?0:i.length-1;return!o||s===void 0?i[o]:s}let Ft;function Yr(){Ft=void 0}const q={now:()=>(Ft===void 0&&q.set(D.isProcessing||Ii.useManualTiming?D.timestamp:performance.now()),Ft),set:t=>{Ft=t,queueMicrotask(Yr)}},ks=t=>/^0[^.\s]+$/u.test(t);function Xr(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||ks(t):!0}let fe=L;const Os=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),qr=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Zr(t){const e=qr.exec(t);if(!e)return[,];const[,n,s,i]=e;return[`--${n??s}`,i]}function js(t,e,n=1){const[s,i]=Zr(t);if(!s)return;const o=window.getComputedStyle(e).getPropertyValue(s);if(o){const r=o.trim();return Os(r)?parseFloat(r):r}return Le(i)?js(i,e,n+1):i}const Qr=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),fn=t=>t===dt||t===x,dn=(t,e)=>parseFloat(t.split(", ")[e]),mn=(t,e)=>(n,{transform:s})=>{if(s==="none"||!s)return 0;const i=s.match(/^matrix3d\((.+)\)$/u);if(i)return dn(i[1],e);{const o=s.match(/^matrix\((.+)\)$/u);return o?dn(o[1],t):0}},Jr=new Set(["x","y","z"]),to=At.filter(t=>!Jr.has(t));function eo(t){const e=[];return to.forEach(n=>{const s=t.getValue(n);s!==void 0&&(e.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),e}const ft={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:mn(4,13),y:mn(5,14)};ft.translateX=ft.x;ft.translateY=ft.y;const Is=t=>e=>e.test(t),no={test:t=>t==="auto",parse:t=>t},Us=[dt,x,U,z,ar,or,no],pn=t=>Us.find(Is(t)),it=new Set;let de=!1,me=!1;function Ns(){if(me){const t=Array.from(it).filter(s=>s.needsMeasurement),e=new Set(t.map(s=>s.element)),n=new Map;e.forEach(s=>{const i=eo(s);i.length&&(n.set(s,i),s.render())}),t.forEach(s=>s.measureInitialState()),e.forEach(s=>{s.render();const i=n.get(s);i&&i.forEach(([o,r])=>{var a;(a=s.getValue(o))===null||a===void 0||a.set(r)})}),t.forEach(s=>s.measureEndState()),t.forEach(s=>{s.suspendedScrollY!==void 0&&window.scrollTo(0,s.suspendedScrollY)})}me=!1,de=!1,it.forEach(t=>t.complete()),it.clear()}function Ks(){it.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(me=!0)})}function so(){Ks(),Ns()}class Ke{constructor(e,n,s,i,o,r=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=s,this.motionValue=i,this.element=o,this.isAsync=r}scheduleResolve(){this.isScheduled=!0,this.isAsync?(it.add(this),de||(de=!0,A.read(Ks),A.resolveKeyframes(Ns))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:s,motionValue:i}=this;for(let o=0;on=>!!(wt(n)&&rr.test(n)&&n.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(n,e)),Ws=(t,e,n)=>s=>{if(!wt(s))return s;const[i,o,r,a]=s.match(Fe);return{[t]:parseFloat(i),[e]:parseFloat(o),[n]:parseFloat(r),alpha:a!==void 0?parseFloat(a):1}},io=t=>Z(0,255,t),te={...dt,transform:t=>Math.round(io(t))},st={test:We("rgb","red"),parse:Ws("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:s=1})=>"rgba("+te.transform(t)+", "+te.transform(e)+", "+te.transform(n)+", "+yt(gt.transform(s))+")"};function ro(t){let e="",n="",s="",i="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),s=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),s=t.substring(3,4),i=t.substring(4,5),e+=e,n+=n,s+=s,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:i?parseInt(i,16)/255:1}}const pe={test:We("#"),parse:ro,transform:st.transform},lt={test:We("hsl","hue"),parse:Ws("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:s=1})=>"hsla("+Math.round(t)+", "+U.transform(yt(e))+", "+U.transform(yt(n))+", "+yt(gt.transform(s))+")"},R={test:t=>st.test(t)||pe.test(t)||lt.test(t),parse:t=>st.test(t)?st.parse(t):lt.test(t)?lt.parse(t):pe.parse(t),transform:t=>wt(t)?t:t.hasOwnProperty("red")?st.transform(t):lt.transform(t)};function oo(t){var e,n;return isNaN(t)&&wt(t)&&(((e=t.match(Fe))===null||e===void 0?void 0:e.length)||0)+(((n=t.match(ir))===null||n===void 0?void 0:n.length)||0)>0}const Gs="number",$s="color",ao="var",lo="var(",gn="${}",uo=/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 bt(t){const e=t.toString(),n=[],s={color:[],number:[],var:[]},i=[];let o=0;const a=e.replace(uo,l=>(R.test(l)?(s.color.push(o),i.push($s),n.push(R.parse(l))):l.startsWith(lo)?(s.var.push(o),i.push(ao),n.push(l)):(s.number.push(o),i.push(Gs),n.push(parseFloat(l))),++o,gn)).split(gn);return{values:n,split:a,indexes:s,types:i}}function _s(t){return bt(t).values}function Hs(t){const{split:e,types:n}=bt(t),s=e.length;return i=>{let o="";for(let r=0;rtypeof t=="number"?0:t;function ho(t){const e=_s(t);return Hs(t)(e.map(co))}const Q={test:oo,parse:_s,createTransformer:Hs,getAnimatableNone:ho},fo=new Set(["brightness","contrast","saturate","opacity"]);function mo(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[s]=n.match(Fe)||[];if(!s)return t;const i=n.replace(s,"");let o=fo.has(e)?1:0;return s!==n&&(o*=100),e+"("+o+i+")"}const po=/\b([a-z-]*)\(.*?\)/gu,ge={...Q,getAnimatableNone:t=>{const e=t.match(po);return e?e.map(mo).join(" "):t}},go={...Ts,color:R,backgroundColor:R,outlineColor:R,fill:R,stroke:R,borderColor:R,borderTopColor:R,borderRightColor:R,borderBottomColor:R,borderLeftColor:R,filter:ge,WebkitFilter:ge},Ge=t=>go[t];function zs(t,e){let n=Ge(t);return n!==ge&&(n=Q),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const yo=new Set(["auto","none","0"]);function vo(t,e,n){let s=0,i;for(;s{n.getValue(l).set(u)}),this.resolveNoneKeyframes()}}function Xs(t){let e;return()=>(e===void 0&&(e=t()),e)}const yn=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(Q.test(t)||t==="0")&&!t.startsWith("url("));function xo(t){const e=t[0];if(t.length===1)return!0;for(let n=0;n{this.resolveFinishedPromise=e})}}function Zs(t,e){return e?t*(1e3/e):0}const Po=5;function Qs(t,e,n){const s=Math.max(e-Po,0);return Zs(n-t(s),e-s)}const ee=.001,bo=.01,So=10,Vo=.05,Ao=1;function wo({duration:t=800,bounce:e=.25,velocity:n=0,mass:s=1}){let i,o,r=1-e;r=Z(Vo,Ao,r),t=Z(bo,So,$(t)),r<1?(i=u=>{const c=u*r,h=c*t,f=c-n,d=ye(u,r),m=Math.exp(-h);return ee-f/d*m},o=u=>{const h=u*r*t,f=h*n+n,d=Math.pow(r,2)*Math.pow(u,2)*t,m=Math.exp(-h),p=ye(Math.pow(u,2),r);return(-i(u)+ee>0?-1:1)*((f-d)*m)/p}):(i=u=>{const c=Math.exp(-u*t),h=(u-n)*t+1;return-ee+c*h},o=u=>{const c=Math.exp(-u*t),h=(n-u)*(t*t);return c*h});const a=5/t,l=Do(i,o,a);if(t=X(t),isNaN(l))return{stiffness:100,damping:10,duration:t};{const u=Math.pow(l,2)*s;return{stiffness:u,damping:r*2*Math.sqrt(s*u),duration:t}}}const Co=12;function Do(t,e,n){let s=n;for(let i=1;it[n]!==void 0)}function Eo(t){let e={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...t};if(!vn(t,Ro)&&vn(t,Mo)){const n=wo(t);e={...e,...n,mass:1},e.isResolvedFromDuration=!0}return e}function Js({keyframes:t,restDelta:e,restSpeed:n,...s}){const i=t[0],o=t[t.length-1],r={done:!1,value:i},{stiffness:a,damping:l,mass:u,duration:c,velocity:h,isResolvedFromDuration:f}=Eo({...s,velocity:-$(s.velocity||0)}),d=h||0,m=l/(2*Math.sqrt(a*u)),p=o-i,y=$(Math.sqrt(a/u)),v=Math.abs(p)<5;n||(n=v?.01:2),e||(e=v?.005:.5);let T;if(m<1){const g=ye(y,m);T=b=>{const V=Math.exp(-m*y*b);return o-V*((d+m*y*p)/g*Math.sin(g*b)+p*Math.cos(g*b))}}else if(m===1)T=g=>o-Math.exp(-y*g)*(p+(d+y*p)*g);else{const g=y*Math.sqrt(m*m-1);T=b=>{const V=Math.exp(-m*y*b),M=Math.min(g*b,300);return o-V*((d+m*y*p)*Math.sinh(M)+g*p*Math.cosh(M))/g}}return{calculatedDuration:f&&c||null,next:g=>{const b=T(g);if(f)r.done=g>=c;else{let V=d;g!==0&&(m<1?V=Qs(T,g,b):V=0);const M=Math.abs(V)<=n,H=Math.abs(o-b)<=e;r.done=M&&H}return r.value=r.done?o:b,r}}}function xn({keyframes:t,velocity:e=0,power:n=.8,timeConstant:s=325,bounceDamping:i=10,bounceStiffness:o=500,modifyTarget:r,min:a,max:l,restDelta:u=.5,restSpeed:c}){const h=t[0],f={done:!1,value:h},d=S=>a!==void 0&&Sl,m=S=>a===void 0?l:l===void 0||Math.abs(a-S)-p*Math.exp(-S/s),g=S=>v+T(S),b=S=>{const k=T(S),O=g(S);f.done=Math.abs(k)<=u,f.value=f.done?v:O};let V,M;const H=S=>{d(f.value)&&(V=S,M=Js({keyframes:[f.value,m(f.value)],velocity:Qs(g,S,f.value),damping:i,stiffness:o,restDelta:u,restSpeed:c}))};return H(0),{calculatedDuration:null,next:S=>{let k=!1;return!M&&V===void 0&&(k=!0,b(S),H(S)),V!==void 0&&S>=V?M.next(S-V):(!k&&b(S),f)}}}const ti=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,Lo=1e-7,Fo=12;function Bo(t,e,n,s,i){let o,r,a=0;do r=e+(n-e)/2,o=ti(r,s,i)-t,o>0?n=r:e=r;while(Math.abs(o)>Lo&&++aBo(o,0,1,t,n);return o=>o===0||o===1?o:ti(i(o),e,s)}const ko=Dt(.42,0,1,1),Oo=Dt(0,0,.58,1),ei=Dt(.42,0,.58,1),jo=t=>Array.isArray(t)&&typeof t[0]!="number",ni=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,si=t=>e=>1-t(1-e),$e=t=>1-Math.sin(Math.acos(t)),ii=si($e),Io=ni($e),ri=Dt(.33,1.53,.69,.99),_e=si(ri),Uo=ni(_e),No=t=>(t*=2)<1?.5*_e(t):.5*(2-Math.pow(2,-10*(t-1))),Tn={linear:L,easeIn:ko,easeInOut:ei,easeOut:Oo,circIn:$e,circInOut:Io,circOut:ii,backIn:_e,backInOut:Uo,backOut:ri,anticipate:No},Pn=t=>{if(Array.isArray(t)){fe(t.length===4);const[e,n,s,i]=t;return Dt(e,n,s,i)}else if(typeof t=="string")return fe(Tn[t]!==void 0),Tn[t];return t},St=(t,e,n)=>{const s=e-t;return s===0?1:(n-t)/s},w=(t,e,n)=>t+(e-t)*n;function ne(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function Ko({hue:t,saturation:e,lightness:n,alpha:s}){t/=360,e/=100,n/=100;let i=0,o=0,r=0;if(!e)i=o=r=n;else{const a=n<.5?n*(1+e):n+e-n*e,l=2*n-a;i=ne(l,a,t+1/3),o=ne(l,a,t),r=ne(l,a,t-1/3)}return{red:Math.round(i*255),green:Math.round(o*255),blue:Math.round(r*255),alpha:s}}function jt(t,e){return n=>n>0?e:t}const se=(t,e,n)=>{const s=t*t,i=n*(e*e-s)+s;return i<0?0:Math.sqrt(i)},Wo=[pe,st,lt],Go=t=>Wo.find(e=>e.test(t));function bn(t){const e=Go(t);if(!e)return!1;let n=e.parse(t);return e===lt&&(n=Ko(n)),n}const Sn=(t,e)=>{const n=bn(t),s=bn(e);if(!n||!s)return jt(t,e);const i={...n};return o=>(i.red=se(n.red,s.red,o),i.green=se(n.green,s.green,o),i.blue=se(n.blue,s.blue,o),i.alpha=w(n.alpha,s.alpha,o),st.transform(i))},ve=new Set(["none","hidden"]);function $o(t,e){return ve.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function _o(t,e){return n=>w(t,e,n)}function He(t){return typeof t=="number"?_o:typeof t=="string"?Le(t)?jt:R.test(t)?Sn:Yo:Array.isArray(t)?oi:typeof t=="object"?R.test(t)?Sn:Ho:jt}function oi(t,e){const n=[...t],s=n.length,i=t.map((o,r)=>He(o)(o,e[r]));return o=>{for(let r=0;r{for(const o in s)n[o]=s[o](i);return n}}function zo(t,e){var n;const s=[],i={color:0,var:0,number:0};for(let o=0;o{const n=Q.createTransformer(e),s=bt(t),i=bt(e);return s.indexes.var.length===i.indexes.var.length&&s.indexes.color.length===i.indexes.color.length&&s.indexes.number.length>=i.indexes.number.length?ve.has(t)&&!i.values.length||ve.has(e)&&!s.values.length?$o(t,e):G(oi(zo(s,i),i.values),n):jt(t,e)};function ai(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?w(t,e,n):He(t)(t,e)}function Xo(t,e,n){const s=[],i=n||ai,o=t.length-1;for(let r=0;re[0];if(o===2&&t[0]===t[1])return()=>e[1];t[0]>t[o-1]&&(t=[...t].reverse(),e=[...e].reverse());const r=Xo(e,s,i),a=r.length,l=u=>{let c=0;if(a>1)for(;cl(Z(t[0],t[o-1],u)):l}function Zo(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const i=St(0,e,s);t.push(w(n,1,i))}}function Qo(t){const e=[0];return Zo(e,t.length-1),e}function Jo(t,e){return t.map(n=>n*e)}function ta(t,e){return t.map(()=>e||ei).splice(0,t.length-1)}function It({duration:t=300,keyframes:e,times:n,ease:s="easeInOut"}){const i=jo(s)?s.map(Pn):Pn(s),o={done:!1,value:e[0]},r=Jo(n&&n.length===e.length?n:Qo(e),t),a=qo(r,e,{ease:Array.isArray(i)?i:ta(e,i)});return{calculatedDuration:t,next:l=>(o.value=a(l),o.done=l>=t,o)}}const Vn=2e4;function ea(t){let e=0;const n=50;let s=t.next(e);for(;!s.done&&e=Vn?1/0:e}const na=t=>{const e=({timestamp:n})=>t(n);return{start:()=>A.update(e,!0),stop:()=>_(e),now:()=>D.isProcessing?D.timestamp:q.now()}},sa={decay:xn,inertia:xn,tween:It,keyframes:It,spring:Js},ia=t=>t/100;class ze extends qs{constructor({KeyframeResolver:e=Ke,...n}){super(n),this.holdTime=null,this.startTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:a}=this.options;a&&a()};const{name:s,motionValue:i,keyframes:o}=this.options,r=(a,l)=>this.onKeyframesResolved(a,l);s&&i&&i.owner?this.resolver=i.owner.resolveKeyframes(o,r,s,i):this.resolver=new e(o,r,s,i),this.resolver.scheduleResolve()}initPlayback(e){const{type:n="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:o,velocity:r=0}=this.options,a=sa[n]||It;let l,u;a!==It&&typeof e[0]!="number"&&(l=G(ia,ai(e[0],e[1])),e=[0,100]);const c=a({...this.options,keyframes:e});o==="mirror"&&(u=a({...this.options,keyframes:[...e].reverse(),velocity:-r})),c.calculatedDuration===null&&(c.calculatedDuration=ea(c));const{calculatedDuration:h}=c,f=h+i,d=f*(s+1)-i;return{generator:c,mirroredGenerator:u,mapPercentToKeyframes:l,calculatedDuration:h,resolvedDuration:f,totalDuration:d}}onPostResolved(){const{autoplay:e=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!e?this.pause():this.state=this.pendingPlayState}tick(e,n=!1){const{resolved:s}=this;if(!s){const{keyframes:S}=this.options;return{done:!0,value:S[S.length-1]}}const{finalKeyframe:i,generator:o,mirroredGenerator:r,mapPercentToKeyframes:a,keyframes:l,calculatedDuration:u,totalDuration:c,resolvedDuration:h}=s;if(this.startTime===null)return o.next(0);const{delay:f,repeat:d,repeatType:m,repeatDelay:p,onUpdate:y}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-c/this.speed,this.startTime)),n?this.currentTime=e:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(e-this.startTime)*this.speed;const v=this.currentTime-f*(this.speed>=0?1:-1),T=this.speed>=0?v<0:v>c;this.currentTime=Math.max(v,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=c);let g=this.currentTime,b=o;if(d){const S=Math.min(this.currentTime,c)/h;let k=Math.floor(S),O=S%1;!O&&S>=1&&(O=1),O===1&&k--,k=Math.min(k,d+1),!!(k%2)&&(m==="reverse"?(O=1-O,p&&(O-=p/h)):m==="mirror"&&(b=r)),g=Z(0,1,O)*h}const V=T?{done:!1,value:l[0]}:b.next(g);a&&(V.value=a(V.value));let{done:M}=V;!T&&u!==null&&(M=this.speed>=0?this.currentTime>=c:this.currentTime<=0);const H=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&M);return H&&i!==void 0&&(V.value=zt(l,this.options,i)),y&&y(V.value),H&&this.finish(),V}get duration(){const{resolved:e}=this;return e?$(e.calculatedDuration):0}get time(){return $(this.currentTime)}set time(e){e=X(e),this.currentTime=e,this.holdTime!==null||this.speed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.speed)}get speed(){return this.playbackSpeed}set speed(e){const n=this.playbackSpeed!==e;this.playbackSpeed=e,n&&(this.time=$(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:e=na,onPlay:n}=this.options;this.driver||(this.driver=e(i=>this.tick(i))),n&&n();const s=this.driver.now();this.holdTime!==null?this.startTime=s-this.holdTime:(!this.startTime||this.state==="finished")&&(this.startTime=s),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var e;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(e=this.currentTime)!==null&&e!==void 0?e:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:e}=this.options;e&&e()}cancel(){this.cancelTime!==null&&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(e){return this.startTime=0,this.tick(e,!0)}}const li=t=>Array.isArray(t)&&typeof t[0]=="number";function ui(t){return!!(!t||typeof t=="string"&&t in Ye||li(t)||Array.isArray(t)&&t.every(ui))}const pt=([t,e,n,s])=>`cubic-bezier(${t}, ${e}, ${n}, ${s})`,Ye={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:pt([0,.65,.55,1]),circOut:pt([.55,0,1,.45]),backIn:pt([.31,.01,.66,-.59]),backOut:pt([.33,1.53,.69,.99])};function ra(t){return ci(t)||Ye.easeOut}function ci(t){if(t)return li(t)?pt(t):Array.isArray(t)?t.map(ra):Ye[t]}function oa(t,e,n,{delay:s=0,duration:i=300,repeat:o=0,repeatType:r="loop",ease:a,times:l}={}){const u={[e]:n};l&&(u.offset=l);const c=ci(a);return Array.isArray(c)&&(u.easing=c),t.animate(u,{delay:s,duration:i,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:o+1,direction:r==="reverse"?"alternate":"normal"})}const aa=Xs(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),la=new Set(["opacity","clipPath","filter","transform"]),Ut=10,ua=2e4;function ca(t){return t.type==="spring"||t.name==="backgroundColor"||!ui(t.ease)}function ha(t,e){const n=new ze({...e,keyframes:t,repeat:0,delay:0,isGenerator:!0});let s={done:!1,value:t[0]};const i=[];let o=0;for(;!s.done&&othis.onKeyframesResolved(o,r),n,s),this.resolver.scheduleResolve()}initPlayback(e,n){var s;let{duration:i=300,times:o,ease:r,type:a,motionValue:l,name:u}=this.options;if(!(!((s=l.owner)===null||s===void 0)&&s.current))return!1;if(ca(this.options)){const{onComplete:h,onUpdate:f,motionValue:d,...m}=this.options,p=ha(e,m);e=p.keyframes,e.length===1&&(e[1]=e[0]),i=p.duration,o=p.times,r=p.ease,a="keyframes"}const c=oa(l.owner.current,u,e,{...this.options,duration:i,times:o,ease:r});return c.startTime=q.now(),this.pendingTimeline?(c.timeline=this.pendingTimeline,this.pendingTimeline=void 0):c.onfinish=()=>{const{onComplete:h}=this.options;l.set(zt(e,this.options,n)),h&&h(),this.cancel(),this.resolveFinishedPromise()},{animation:c,duration:i,times:o,type:a,ease:r,keyframes:e}}get duration(){const{resolved:e}=this;if(!e)return 0;const{duration:n}=e;return $(n)}get time(){const{resolved:e}=this;if(!e)return 0;const{animation:n}=e;return $(n.currentTime||0)}set time(e){const{resolved:n}=this;if(!n)return;const{animation:s}=n;s.currentTime=X(e)}get speed(){const{resolved:e}=this;if(!e)return 1;const{animation:n}=e;return n.playbackRate}set speed(e){const{resolved:n}=this;if(!n)return;const{animation:s}=n;s.playbackRate=e}get state(){const{resolved:e}=this;if(!e)return"idle";const{animation:n}=e;return n.playState}attachTimeline(e){if(!this._resolved)this.pendingTimeline=e;else{const{resolved:n}=this;if(!n)return L;const{animation:s}=n;s.timeline=e,s.onfinish=null}return L}play(){if(this.isStopped)return;const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;const{resolved:e}=this;if(!e)return;const{animation:n,keyframes:s,duration:i,type:o,ease:r,times:a}=e;if(!(n.playState==="idle"||n.playState==="finished")){if(this.time){const{motionValue:l,onUpdate:u,onComplete:c,...h}=this.options,f=new ze({...h,keyframes:s,duration:i,type:o,ease:r,times:a,isGenerator:!0}),d=X(this.time);l.setWithVelocity(f.sample(d-Ut).value,f.sample(d).value,Ut)}this.cancel()}}complete(){const{resolved:e}=this;e&&e.animation.finish()}cancel(){const{resolved:e}=this;e&&e.animation.cancel()}static supports(e){const{motionValue:n,name:s,repeatDelay:i,repeatType:o,damping:r,type:a}=e;return aa()&&s&&la.has(s)&&n&&n.owner&&n.owner.current instanceof HTMLElement&&!n.owner.getProps().onUpdate&&!i&&o!=="mirror"&&r!==0&&a!=="inertia"}}function fa(t,e){let n;const s=()=>{const{currentTime:i}=e,r=(i===null?0:i.value)/100;n!==r&&t(r),n=r};return A.update(s,!0),()=>_(s)}const da=Xs(()=>window.ScrollTimeline!==void 0);class ma{constructor(e){this.stop=()=>this.runAll("stop"),this.animations=e.filter(Boolean)}then(e,n){return Promise.all(this.animations).then(e).catch(n)}getAll(e){return this.animations[0][e]}setAll(e,n){for(let s=0;s{if(da()&&s.attachTimeline)s.attachTimeline(e);else return s.pause(),fa(i=>{s.time=s.duration*i},e)});return()=>{n.forEach((s,i)=>{s&&s(),this.animations[i].stop()})}}get time(){return this.getAll("time")}set time(e){this.setAll("time",e)}get speed(){return this.getAll("speed")}set speed(e){this.setAll("speed",e)}get duration(){let e=0;for(let n=0;nn[e]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}const Xe=(t,e,n,s={},i,o)=>r=>{const a=Ne(s,t)||{},l=a.delay||s.delay||0;let{elapsed:u=0}=s;u=u-X(l);let c={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-u,onUpdate:f=>{e.set(f),a.onUpdate&&a.onUpdate(f)},onComplete:()=>{r(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:o?void 0:i};Hr(a)||(c={...c,..._r(t,c)}),c.duration&&(c.duration=X(c.duration)),c.repeatDelay&&(c.repeatDelay=X(c.repeatDelay)),c.from!==void 0&&(c.keyframes[0]=c.from);let h=!1;if((c.type===!1||c.duration===0&&!c.repeatDelay)&&(c.duration=0,c.delay===0&&(h=!0)),h&&!o&&e.get()!==void 0){const f=zt(c.keyframes,a);if(f!==void 0)return A.update(()=>{c.onUpdate(f),c.onComplete()}),new ma([])}return!o&&An.supports(c)?new An(c):new ze(c)};function Nt(t){return!!(E(t)&&t.add)}function qe(t,e){t.indexOf(e)===-1&&t.push(e)}function Ze(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class Qe{constructor(){this.subscriptions=[]}add(e){return qe(this.subscriptions,e),()=>Ze(this.subscriptions,e)}notify(e,n,s){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](e,n,s);else for(let o=0;o!isNaN(parseFloat(t));class ga{constructor(e,n={}){this.version="11.2.10",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(s,i=!0)=>{const o=q.now();this.updatedAt!==o&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(s),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),i&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=q.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=pa(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new Qe);const s=this.events[e].add(n);return e==="change"?()=>{s(),A.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e,n=!0){!n||!this.passiveEffect?this.updateAndNotify(e,n):this.passiveEffect(e,this.updateAndNotify)}setWithVelocity(e,n,s){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-s}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=q.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>wn)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,wn);return Zs(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(n),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 Vt(t,e){return new ga(t,e)}function ya(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Vt(n))}function va(t,e){const n=Ht(t,e);let{transitionEnd:s={},transition:i={},...o}=n||{};o={...o,...s};for(const r in o){const a=br(o[r]);ya(t,r,a)}}function hi(t){return t.getProps()[fs]}function xa({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,s}function fi(t,e,{delay:n=0,transitionOverride:s,type:i}={}){var o;let{transition:r=t.getDefaultTransition(),transitionEnd:a,...l}=e;const u=t.getValue("willChange");s&&(r=s);const c=[],h=i&&t.animationState&&t.animationState.getState()[i];for(const f in l){const d=t.getValue(f,(o=t.latestValues[f])!==null&&o!==void 0?o:null),m=l[f];if(m===void 0||h&&xa(h,f))continue;const p={delay:n,elapsed:0,...Ne(r||{},f)};let y=!1;if(window.HandoffAppearAnimations){const T=hi(t);if(T){const g=window.HandoffAppearAnimations(T,f,d,A);g!==null&&(p.elapsed=g,y=!0)}}d.start(Xe(f,d,m,t.shouldReduceMotion&&rt.has(f)?{type:!1}:p,t,y));const v=d.animation;v&&(Nt(u)&&(u.add(f),v.then(()=>u.remove(f))),c.push(v))}return a&&Promise.all(c).then(()=>{A.update(()=>{a&&va(t,a)})}),c}function xe(t,e,n={}){var s;const i=Ht(t,e,n.type==="exit"?(s=t.presenceContext)===null||s===void 0?void 0:s.custom:void 0);let{transition:o=t.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(o=n.transitionOverride);const r=i?()=>Promise.all(fi(t,i,n)):()=>Promise.resolve(),a=t.variantChildren&&t.variantChildren.size?(u=0)=>{const{delayChildren:c=0,staggerChildren:h,staggerDirection:f}=o;return Ta(t,e,c+u,h,f,n)}:()=>Promise.resolve(),{when:l}=o;if(l){const[u,c]=l==="beforeChildren"?[r,a]:[a,r];return u().then(()=>c())}else return Promise.all([r(),a(n.delay)])}function Ta(t,e,n=0,s=0,i=1,o){const r=[],a=(t.variantChildren.size-1)*s,l=i===1?(u=0)=>u*s:(u=0)=>a-u*s;return Array.from(t.variantChildren).sort(Pa).forEach((u,c)=>{u.notify("AnimationStart",e),r.push(xe(u,e,{...o,delay:n+l(c)}).then(()=>u.notify("AnimationComplete",e)))}),Promise.all(r)}function Pa(t,e){return t.sortNodePosition(e)}function ba(t,e,n={}){t.notify("AnimationStart",e);let s;if(Array.isArray(e)){const i=e.map(o=>xe(t,o,n));s=Promise.all(i)}else if(typeof e=="string")s=xe(t,e,n);else{const i=typeof e=="function"?Ht(t,e,n.custom):e;s=Promise.all(fi(t,i,n))}return s.then(()=>{A.postRender(()=>{t.notify("AnimationComplete",e)})})}const Sa=[...Me].reverse(),Va=Me.length;function Aa(t){return e=>Promise.all(e.map(({animation:n,options:s})=>ba(t,n,s)))}function wa(t){let e=Aa(t);const n=Da();let s=!0;const i=l=>(u,c)=>{var h;const f=Ht(t,c,l==="exit"?(h=t.presenceContext)===null||h===void 0?void 0:h.custom:void 0);if(f){const{transition:d,transitionEnd:m,...p}=f;u={...u,...p,...m}}return u};function o(l){e=l(t)}function r(l){const u=t.getProps(),c=t.getVariantContext(!0)||{},h=[],f=new Set;let d={},m=1/0;for(let y=0;ym&&b,k=!1;const O=Array.isArray(g)?g:[g];let ot=O.reduce(i(v),{});V===!1&&(ot={});const{prevResolvedValues:Je={}}=T,Fi={...Je,...ot},tn=F=>{S=!0,f.has(F)&&(k=!0,f.delete(F)),T.needsAnimating[F]=!0;const N=t.getValue(F);N&&(N.liveStyle=!1)};for(const F in Fi){const N=ot[F],Yt=Je[F];if(d.hasOwnProperty(F))continue;let Xt=!1;ce(N)&&ce(Yt)?Xt=!Bs(N,Yt):Xt=N!==Yt,Xt?N!=null?tn(F):f.add(F):N!==void 0&&f.has(F)?tn(F):T.protectedKeys[F]=!0}T.prevProp=g,T.prevResolvedValues=ot,T.isActive&&(d={...d,...ot}),s&&t.blockInitialAnimation&&(S=!1),S&&(!M||k)&&h.push(...O.map(F=>({animation:F,options:{type:v}})))}if(f.size){const y={};f.forEach(v=>{const T=t.getBaseTarget(v),g=t.getValue(v);g&&(g.liveStyle=!0),y[v]=T??null}),h.push({animation:y})}let p=!!h.length;return s&&(u.initial===!1||u.initial===u.animate)&&!t.manuallyAnimateOnMount&&(p=!1),s=!1,p?e(h):Promise.resolve()}function a(l,u){var c;if(n[l].isActive===u)return Promise.resolve();(c=t.variantChildren)===null||c===void 0||c.forEach(f=>{var d;return(d=f.animationState)===null||d===void 0?void 0:d.setActive(l,u)}),n[l].isActive=u;const h=r(l);for(const f in n)n[f].protectedKeys={};return h}return{animateChanges:r,setActive:a,setAnimateFunction:o,getState:()=>n}}function Ca(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!Bs(e,t):!1}function tt(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Da(){return{animate:tt(!0),whileInView:tt(),whileHover:tt(),whileTap:tt(),whileDrag:tt(),whileFocus:tt(),exit:tt()}}class Ma extends J{constructor(e){super(e),e.animationState||(e.animationState=wa(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();this.unmount(),Gt(e)&&(this.unmount=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:n}=this.node.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){}}let Ra=0;class Ea extends J{constructor(){super(...arguments),this.id=Ra++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:s}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===s)return;const i=this.node.animationState.setActive("exit",!e);n&&!e&&i.then(()=>n(this.id))}mount(){const{register:e}=this.node.presenceContext||{};e&&(this.unmount=e(this.id))}unmount(){}}const La={animation:{Feature:Ma},exit:{Feature:Ea}},Cn=(t,e)=>Math.abs(t-e);function Fa(t,e){const n=Cn(t.x,e.x),s=Cn(t.y,e.y);return Math.sqrt(n**2+s**2)}class di{constructor(e,n,{transformPagePoint:s,contextWindow:i,dragSnapToOrigin:o=!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 h=re(this.lastMoveEventInfo,this.history),f=this.startEvent!==null,d=Fa(h.offset,{x:0,y:0})>=3;if(!f&&!d)return;const{point:m}=h,{timestamp:p}=D;this.history.push({...m,timestamp:p});const{onStart:y,onMove:v}=this.handlers;f||(y&&y(this.lastMoveEvent,h),this.startEvent=this.lastMoveEvent),v&&v(this.lastMoveEvent,h)},this.handlePointerMove=(h,f)=>{this.lastMoveEvent=h,this.lastMoveEventInfo=ie(f,this.transformPagePoint),A.update(this.updatePoint,!0)},this.handlePointerUp=(h,f)=>{this.end();const{onEnd:d,onSessionEnd:m,resumeAnimation:p}=this.handlers;if(this.dragSnapToOrigin&&p&&p(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const y=re(h.type==="pointercancel"?this.lastMoveEventInfo:ie(f,this.transformPagePoint),this.history);this.startEvent&&d&&d(h,y),m&&m(h,y)},!Ms(e))return;this.dragSnapToOrigin=o,this.handlers=n,this.transformPagePoint=s,this.contextWindow=i||window;const r=_t(e),a=ie(r,this.transformPagePoint),{point:l}=a,{timestamp:u}=D;this.history=[{...l,timestamp:u}];const{onSessionStart:c}=n;c&&c(e,re(a,this.history)),this.removeListeners=G(W(this.contextWindow,"pointermove",this.handlePointerMove),W(this.contextWindow,"pointerup",this.handlePointerUp),W(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),_(this.updatePoint)}}function ie(t,e){return e?{point:e(t.point)}:t}function Dn(t,e){return{x:t.x-e.x,y:t.y-e.y}}function re({point:t},e){return{point:t,delta:Dn(t,mi(e)),offset:Dn(t,Ba(e)),velocity:ka(e,.1)}}function Ba(t){return t[0]}function mi(t){return t[t.length-1]}function ka(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,s=null;const i=mi(t);for(;n>=0&&(s=t[n],!(i.timestamp-s.timestamp>X(e)));)n--;if(!s)return{x:0,y:0};const o=$(i.timestamp-s.timestamp);if(o===0)return{x:0,y:0};const r={x:(i.x-s.x)/o,y:(i.y-s.y)/o};return r.x===1/0&&(r.x=0),r.y===1/0&&(r.y=0),r}function B(t){return t.max-t.min}function Te(t,e=0,n=.01){return Math.abs(t-e)<=n}function Mn(t,e,n,s=.5){t.origin=s,t.originPoint=w(e.min,e.max,t.origin),t.scale=B(n)/B(e),(Te(t.scale,1,1e-4)||isNaN(t.scale))&&(t.scale=1),t.translate=w(n.min,n.max,t.origin)-t.originPoint,(Te(t.translate)||isNaN(t.translate))&&(t.translate=0)}function vt(t,e,n,s){Mn(t.x,e.x,n.x,s?s.originX:void 0),Mn(t.y,e.y,n.y,s?s.originY:void 0)}function Rn(t,e,n){t.min=n.min+e.min,t.max=t.min+B(e)}function Oa(t,e,n){Rn(t.x,e.x,n.x),Rn(t.y,e.y,n.y)}function En(t,e,n){t.min=e.min-n.min,t.max=t.min+B(e)}function xt(t,e,n){En(t.x,e.x,n.x),En(t.y,e.y,n.y)}function ja(t,{min:e,max:n},s){return e!==void 0&&tn&&(t=s?w(n,t,s.max):Math.min(t,n)),t}function Ln(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function Ia(t,{top:e,left:n,bottom:s,right:i}){return{x:Ln(t.x,n,i),y:Ln(t.y,e,s)}}function Fn(t,e){let n=e.min-t.min,s=e.max-t.max;return e.max-e.mins?n=St(e.min,e.max-s,t.min):s>i&&(n=St(t.min,t.max-i,e.min)),Z(0,1,n)}function Ka(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}const Pe=.35;function Wa(t=Pe){return t===!1?t=0:t===!0&&(t=Pe),{x:Bn(t,"left","right"),y:Bn(t,"top","bottom")}}function Bn(t,e,n){return{min:kn(t,e),max:kn(t,n)}}function kn(t,e){return typeof t=="number"?t:t[e]||0}const On=()=>({translate:0,scale:1,origin:0,originPoint:0}),ut=()=>({x:On(),y:On()}),jn=()=>({min:0,max:0}),C=()=>({x:jn(),y:jn()});function I(t){return[t("x"),t("y")]}function pi({top:t,left:e,right:n,bottom:s}){return{x:{min:e,max:n},y:{min:t,max:s}}}function Ga({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function $a(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),s=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}function oe(t){return t===void 0||t===1}function be({scale:t,scaleX:e,scaleY:n}){return!oe(t)||!oe(e)||!oe(n)}function et(t){return be(t)||gi(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function gi(t){return In(t.x)||In(t.y)}function In(t){return t&&t!=="0%"}function Kt(t,e,n){const s=t-n,i=e*s;return n+i}function Un(t,e,n,s,i){return i!==void 0&&(t=Kt(t,i,s)),Kt(t,n,s)+e}function Se(t,e=0,n=1,s,i){t.min=Un(t.min,e,n,s,i),t.max=Un(t.max,e,n,s,i)}function yi(t,{x:e,y:n}){Se(t.x,e.translate,e.scale,e.originPoint),Se(t.y,n.translate,n.scale,n.originPoint)}function _a(t,e,n,s=!1){const i=n.length;if(!i)return;e.x=e.y=1;let o,r;for(let a=0;a1.0000000000001||t<.999999999999?t:1}function Y(t,e){t.min=t.min+e,t.max=t.max+e}function Kn(t,e,[n,s,i]){const o=e[i]!==void 0?e[i]:.5,r=w(t.min,t.max,o);Se(t,e[n],e[s],r,e.scale)}const Ha=["x","scaleX","originX"],za=["y","scaleY","originY"];function ct(t,e){Kn(t.x,e,Ha),Kn(t.y,e,za)}function vi(t,e){return pi($a(t.getBoundingClientRect(),e))}function Ya(t,e,n){const s=vi(t,n),{scroll:i}=e;return i&&(Y(s.x,i.offset.x),Y(s.y,i.offset.y)),s}const xi=({current:t})=>t?t.ownerDocument.defaultView:null,Xa=new WeakMap;class qa{constructor(e){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=C(),this.visualElement=e}start(e,{snapToCursor:n=!1}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const i=c=>{const{dragSnapToOrigin:h}=this.getProps();h?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(_t(c,"page").point)},o=(c,h)=>{const{drag:f,dragPropagation:d,onDragStart:m}=this.getProps();if(f&&!d&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=Es(f),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),I(y=>{let v=this.getAxisMotionValue(y).get()||0;if(U.test(v)){const{projection:T}=this.visualElement;if(T&&T.layout){const g=T.layout.layoutBox[y];g&&(v=B(g)*(parseFloat(v)/100))}}this.originPoint[y]=v}),m&&A.postRender(()=>m(c,h));const{animationState:p}=this.visualElement;p&&p.setActive("whileDrag",!0)},r=(c,h)=>{const{dragPropagation:f,dragDirectionLock:d,onDirectionLock:m,onDrag:p}=this.getProps();if(!f&&!this.openGlobalLock)return;const{offset:y}=h;if(d&&this.currentDirection===null){this.currentDirection=Za(y),this.currentDirection!==null&&m&&m(this.currentDirection);return}this.updateAxis("x",h.point,y),this.updateAxis("y",h.point,y),this.visualElement.render(),p&&p(c,h)},a=(c,h)=>this.stop(c,h),l=()=>I(c=>{var h;return this.getAnimationState(c)==="paused"&&((h=this.getAxisMotionValue(c).animation)===null||h===void 0?void 0:h.play())}),{dragSnapToOrigin:u}=this.getProps();this.panSession=new di(e,{onSessionStart:i,onStart:o,onMove:r,onSessionEnd:a,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,contextWindow:xi(this.visualElement)})}stop(e,n){const s=this.isDragging;if(this.cancel(),!s)return;const{velocity:i}=n;this.startAnimation(i);const{onDragEnd:o}=this.getProps();o&&A.postRender(()=>o(e,n))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:s}=this.getProps();!s&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(e,n,s){const{drag:i}=this.getProps();if(!s||!Et(e,i,this.currentDirection))return;const o=this.getAxisMotionValue(e);let r=this.originPoint[e]+s[e];this.constraints&&this.constraints[e]&&(r=ja(r,this.constraints[e],this.elastic[e])),o.set(r)}resolveConstraints(){var e;const{dragConstraints:n,dragElastic:s}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(e=this.visualElement.projection)===null||e===void 0?void 0:e.layout,o=this.constraints;n&&at(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&i?this.constraints=Ia(i.layoutBox,n):this.constraints=!1,this.elastic=Wa(s),o!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&I(r=>{this.constraints!==!1&&this.getAxisMotionValue(r)&&(this.constraints[r]=Ka(i.layoutBox[r],this.constraints[r]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!at(e))return!1;const s=e.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const o=Ya(s,i.root,this.visualElement.getTransformPagePoint());let r=Ua(i.layout.layoutBox,o);if(n){const a=n(Ga(r));this.hasMutatedConstraints=!!a,a&&(r=pi(a))}return r}startAnimation(e){const{drag:n,dragMomentum:s,dragElastic:i,dragTransition:o,dragSnapToOrigin:r,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},u=I(c=>{if(!Et(c,n,this.currentDirection))return;let h=l&&l[c]||{};r&&(h={min:0,max:0});const f=i?200:1e6,d=i?40:1e7,m={type:"inertia",velocity:s?e[c]:0,bounceStiffness:f,bounceDamping:d,timeConstant:750,restDelta:1,restSpeed:10,...o,...h};return this.startAxisValueAnimation(c,m)});return Promise.all(u).then(a)}startAxisValueAnimation(e,n){const s=this.getAxisMotionValue(e);return s.start(Xe(e,s,0,n,this.visualElement))}stopAnimation(){I(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){I(e=>{var n;return(n=this.getAxisMotionValue(e).animation)===null||n===void 0?void 0:n.pause()})}getAnimationState(e){var n;return(n=this.getAxisMotionValue(e).animation)===null||n===void 0?void 0:n.state}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,s=this.visualElement.getProps(),i=s[n];return i||this.visualElement.getValue(e,(s.initial?s.initial[e]:void 0)||0)}snapToCursor(e){I(n=>{const{drag:s}=this.getProps();if(!Et(n,s,this.currentDirection))return;const{projection:i}=this.visualElement,o=this.getAxisMotionValue(n);if(i&&i.layout){const{min:r,max:a}=i.layout.layoutBox[n];o.set(e[n]-w(r,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:s}=this.visualElement;if(!at(n)||!s||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};I(r=>{const a=this.getAxisMotionValue(r);if(a&&this.constraints!==!1){const l=a.get();i[r]=Na({min:l,max:l},this.constraints[r])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",s.root&&s.root.updateScroll(),s.updateLayout(),this.resolveConstraints(),I(r=>{if(!Et(r,e,null))return;const a=this.getAxisMotionValue(r),{min:l,max:u}=this.constraints[r];a.set(w(l,u,i[r]))})}addListeners(){if(!this.visualElement.current)return;Xa.set(this.visualElement,this);const e=this.visualElement.current,n=W(e,"pointerdown",l=>{const{drag:u,dragListener:c=!0}=this.getProps();u&&c&&this.start(l)}),s=()=>{const{dragConstraints:l}=this.getProps();at(l)&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,o=i.addEventListener("measure",s);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),s();const r=K(window,"resize",()=>this.scalePositionWithinConstraints()),a=i.addEventListener("didUpdate",({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(I(c=>{const h=this.getAxisMotionValue(c);h&&(this.originPoint[c]+=l[c].translate,h.set(h.get()+l[c].translate))}),this.visualElement.render())});return()=>{r(),n(),o(),a&&a()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:s=!1,dragPropagation:i=!1,dragConstraints:o=!1,dragElastic:r=Pe,dragMomentum:a=!0}=e;return{...e,drag:n,dragDirectionLock:s,dragPropagation:i,dragConstraints:o,dragElastic:r,dragMomentum:a}}}function Et(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function Za(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class Qa extends J{constructor(e){super(e),this.removeGroupControls=L,this.removeListeners=L,this.controls=new qa(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||L}unmount(){this.removeGroupControls(),this.removeListeners()}}const Wn=t=>(e,n)=>{t&&A.postRender(()=>t(e,n))};class Ja extends J{constructor(){super(...arguments),this.removePointerDownListener=L}onPointerDown(e){this.session=new di(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:xi(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:s,onPanEnd:i}=this.node.getProps();return{onSessionStart:Wn(e),onStart:Wn(n),onMove:s,onEnd:(o,r)=>{delete this.session,i&&A.postRender(()=>i(o,r))}}}mount(){this.removePointerDownListener=W(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}function tl(){const t=P.useContext(Ae);if(t===null)return[!0,null];const{isPresent:e,onExitComplete:n,register:s}=t,i=P.useId();return P.useEffect(()=>s(i),[]),!e&&n?[!1,()=>n&&n(i)]:[!0]}const Bt={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Gn(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const mt={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(x.test(t))t=parseFloat(t);else return t;const n=Gn(t,e.target.x),s=Gn(t,e.target.y);return`${n}% ${s}%`}},el={correct:(t,{treeScale:e,projectionDelta:n})=>{const s=t,i=Q.parse(t);if(i.length>5)return s;const o=Q.createTransformer(t),r=typeof i[0]!="number"?1:0,a=n.x.scale*e.x,l=n.y.scale*e.y;i[0+r]/=a,i[1+r]/=l;const u=w(a,l,.5);return typeof i[2+r]=="number"&&(i[2+r]/=u),typeof i[3+r]=="number"&&(i[3+r]/=u),o(i)}};class nl extends P.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:s,layoutId:i}=this.props,{projection:o}=e;Zi(sl),o&&(n.group&&n.group.add(o),s&&s.register&&i&&s.register(o),o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),Bt.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:s,drag:i,isPresent:o}=this.props,r=s.projection;return r&&(r.isPresent=o,i||e.layoutDependency!==n||n===void 0?r.willUpdate():this.safeToRemove(),e.isPresent!==o&&(o?r.promote():r.relegate()||A.postRender(()=>{const a=r.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),De.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:s}=this.props,{projection:i}=e;i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),s&&s.deregister&&s.deregister(i))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function Ti(t){const[e,n]=tl(),s=P.useContext(ps);return ht.jsx(nl,{...t,layoutGroup:s,switchLayoutGroup:P.useContext(gs),isPresent:e,safeToRemove:n})}const sl={borderRadius:{...mt,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:mt,borderTopRightRadius:mt,borderBottomLeftRadius:mt,borderBottomRightRadius:mt,boxShadow:el},Pi=["TopLeft","TopRight","BottomLeft","BottomRight"],il=Pi.length,$n=t=>typeof t=="string"?parseFloat(t):t,_n=t=>typeof t=="number"||x.test(t);function rl(t,e,n,s,i,o){i?(t.opacity=w(0,n.opacity!==void 0?n.opacity:1,ol(s)),t.opacityExit=w(e.opacity!==void 0?e.opacity:1,0,al(s))):o&&(t.opacity=w(e.opacity!==void 0?e.opacity:1,n.opacity!==void 0?n.opacity:1,s));for(let r=0;rse?1:n(St(t,e,s))}function zn(t,e){t.min=e.min,t.max=e.max}function j(t,e){zn(t.x,e.x),zn(t.y,e.y)}function Yn(t,e,n,s,i){return t-=e,t=Kt(t,1/n,s),i!==void 0&&(t=Kt(t,1/i,s)),t}function ll(t,e=0,n=1,s=.5,i,o=t,r=t){if(U.test(e)&&(e=parseFloat(e),e=w(r.min,r.max,e/100)-r.min),typeof e!="number")return;let a=w(o.min,o.max,s);t===o&&(a-=e),t.min=Yn(t.min,e,n,a,i),t.max=Yn(t.max,e,n,a,i)}function Xn(t,e,[n,s,i],o,r){ll(t,e[n],e[s],e[i],e.scale,o,r)}const ul=["x","scaleX","originX"],cl=["y","scaleY","originY"];function qn(t,e,n,s){Xn(t.x,e,ul,n?n.x:void 0,s?s.x:void 0),Xn(t.y,e,cl,n?n.y:void 0,s?s.y:void 0)}function Zn(t){return t.translate===0&&t.scale===1}function Si(t){return Zn(t.x)&&Zn(t.y)}function hl(t,e){return t.x.min===e.x.min&&t.x.max===e.x.max&&t.y.min===e.y.min&&t.y.max===e.y.max}function Vi(t,e){return Math.round(t.x.min)===Math.round(e.x.min)&&Math.round(t.x.max)===Math.round(e.x.max)&&Math.round(t.y.min)===Math.round(e.y.min)&&Math.round(t.y.max)===Math.round(e.y.max)}function Qn(t){return B(t.x)/B(t.y)}class fl{constructor(){this.members=[]}add(e){qe(this.members,e),e.scheduleRender()}remove(e){if(Ze(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){const n=this.members.findIndex(i=>e===i);if(n===0)return!1;let s;for(let i=n;i>=0;i--){const o=this.members[i];if(o.isPresent!==!1){s=o;break}}return s?(this.promote(s),!0):!1}promote(e,n){const s=this.lead;if(e!==s&&(this.prevLead=s,this.lead=e,e.show(),s)){s.instance&&s.scheduleRender(),e.scheduleRender(),e.resumeFrom=s,n&&(e.resumeFrom.preserveOpacity=!0),s.snapshot&&(e.snapshot=s.snapshot,e.snapshot.latestValues=s.animationValues||s.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:i}=e.options;i===!1&&s.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:n,resumingFrom:s}=e;n.onExitComplete&&n.onExitComplete(),s&&s.options.onExitComplete&&s.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function Jn(t,e,n){let s="";const i=t.x.translate/e.x,o=t.y.translate/e.y,r=(n==null?void 0:n.z)||0;if((i||o||r)&&(s=`translate3d(${i}px, ${o}px, ${r}px) `),(e.x!==1||e.y!==1)&&(s+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:u,rotate:c,rotateX:h,rotateY:f,skewX:d,skewY:m}=n;u&&(s=`perspective(${u}px) ${s}`),c&&(s+=`rotate(${c}deg) `),h&&(s+=`rotateX(${h}deg) `),f&&(s+=`rotateY(${f}deg) `),d&&(s+=`skewX(${d}deg) `),m&&(s+=`skewY(${m}deg) `)}const a=t.x.scale*e.x,l=t.y.scale*e.y;return(a!==1||l!==1)&&(s+=`scale(${a}, ${l})`),s||"none"}const dl=(t,e)=>t.depth-e.depth;class ml{constructor(){this.children=[],this.isDirty=!1}add(e){qe(this.children,e),this.isDirty=!0}remove(e){Ze(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(dl),this.isDirty=!1,this.children.forEach(e)}}function pl(t,e){const n=q.now(),s=({timestamp:i})=>{const o=i-n;o>=e&&(_(s),t(o-e))};return A.read(s,!0),()=>_(s)}function gl(t){window.MotionDebug&&window.MotionDebug.record(t)}function yl(t){return t instanceof SVGElement&&t.tagName!=="svg"}function vl(t,e,n){const s=E(t)?t:Vt(t);return s.start(Xe("",s,e,n)),s.animation}const ae=["","X","Y","Z"],xl={visibility:"hidden"},ts=1e3;let Tl=0;const nt={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0};function le(t,e,n,s){const{latestValues:i}=e;i[t]&&(n[t]=i[t],e.setStaticValue(t,0),s&&(s[t]=0))}function Ai(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return!1;const{visualElement:e}=t.options;return e?hi(e)?!0:t.parent&&!t.parent.hasCheckedOptimisedAppear?Ai(t.parent):!1:!1}function wi({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:s,resetTransform:i}){return class{constructor(r={},a=e==null?void 0:e()){this.id=Tl++,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.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,nt.totalNodes=nt.resolvedTargetDeltas=nt.recalculatedProjection=0,this.nodes.forEach(Sl),this.nodes.forEach(Dl),this.nodes.forEach(Ml),this.nodes.forEach(Vl),gl(nt)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=r,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;lthis.root.updateBlockedByResize=!1;t(r,()=>{this.root.updateBlockedByResize=!0,h&&h(),h=pl(f,250),Bt.hasAnimatedSinceResize&&(Bt.hasAnimatedSinceResize=!1,this.nodes.forEach(ns))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&c&&(l||u)&&this.addEventListener("didUpdate",({delta:h,hasLayoutChanged:f,hasRelativeTargetChanged:d,layout:m})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const p=this.options.transition||c.getDefaultTransition()||Bl,{onLayoutAnimationStart:y,onLayoutAnimationComplete:v}=c.getProps(),T=!this.targetLayout||!Vi(this.targetLayout,m)||d,g=!f&&d;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||g||f&&(T||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(h,g);const b={...Ne(p,"layout"),onPlay:y,onComplete:v};(c.shouldReduceMotion||this.options.layoutRoot)&&(b.delay=0,b.type=!1),this.startAnimation(b)}else f||ns(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=m})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const r=this.getStack();r&&r.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,_(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(Rl),this.animationId++)}getTransformTemplate(){const{visualElement:r}=this.options;return r&&r.getProps().transformTemplate}willUpdate(r=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.HandoffCancelAllAnimations&&Ai(this)&&window.HandoffCancelAllAnimations(),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let c=0;cthis.update()))}clearAllSnapshots(){this.nodes.forEach(Al),this.sharedNodes.forEach(El)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,A.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){A.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l{const V=b/1e3;ss(h.x,r.x,V),ss(h.y,r.y,V),this.setTargetDelta(h),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(xt(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),Ll(this.relativeTarget,this.relativeTargetOrigin,f,V),g&&hl(this.relativeTarget,g)&&(this.isProjectionDirty=!1),g||(g=C()),j(g,this.relativeTarget)),p&&(this.animationValues=c,rl(c,u,this.latestValues,V,T,v)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=V},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(r){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(_(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=A.update(()=>{Bt.hasAnimatedSinceResize=!0,this.currentAnimation=vl(0,ts,{...r,onUpdate:a=>{this.mixTargetDelta(a),r.onUpdate&&r.onUpdate(a)},onComplete:()=>{r.onComplete&&r.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 r=this.getStack();r&&r.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(ts),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const r=this.getLead();let{targetWithTransforms:a,target:l,layout:u,latestValues:c}=r;if(!(!a||!l||!u)){if(this!==r&&this.layout&&u&&Ci(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||C();const h=B(this.layout.layoutBox.x);l.x.min=r.target.x.min,l.x.max=l.x.min+h;const f=B(this.layout.layoutBox.y);l.y.min=r.target.y.min,l.y.max=l.y.min+f}j(a,l),ct(a,c),vt(this.projectionDeltaWithTransform,this.layoutCorrected,a,c)}}registerSharedNode(r,a){this.sharedNodes.has(r)||this.sharedNodes.set(r,new fl),this.sharedNodes.get(r).add(a);const u=a.options.initialPromotionConfig;a.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(a):void 0})}isLead(){const r=this.getStack();return r?r.lead===this:!0}getLead(){var r;const{layoutId:a}=this.options;return a?((r=this.getStack())===null||r===void 0?void 0:r.lead)||this:this}getPrevLead(){var r;const{layoutId:a}=this.options;return a?(r=this.getStack())===null||r===void 0?void 0:r.prevLead:void 0}getStack(){const{layoutId:r}=this.options;if(r)return this.root.sharedNodes.get(r)}promote({needsReset:r,transition:a,preserveFollowOpacity:l}={}){const u=this.getStack();u&&u.promote(this,l),r&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const r=this.getStack();return r?r.relegate(this):!1}resetSkewAndRotation(){const{visualElement:r}=this.options;if(!r)return;let a=!1;const{latestValues:l}=r;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const u={};l.z&&le("z",r,u,this.animationValues);for(let c=0;c{var a;return(a=r.currentAnimation)===null||a===void 0?void 0:a.stop()}),this.root.nodes.forEach(es),this.root.sharedNodes.clear()}}}function Pl(t){t.updateLayout()}function bl(t){var e;const n=((e=t.resumeFrom)===null||e===void 0?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&n&&t.hasListeners("didUpdate")){const{layoutBox:s,measuredBox:i}=t.layout,{animationType:o}=t.options,r=n.source!==t.layout.source;o==="size"?I(h=>{const f=r?n.measuredBox[h]:n.layoutBox[h],d=B(f);f.min=s[h].min,f.max=f.min+d}):Ci(o,n.layoutBox,s)&&I(h=>{const f=r?n.measuredBox[h]:n.layoutBox[h],d=B(s[h]);f.max=f.min+d,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[h].max=t.relativeTarget[h].min+d)});const a=ut();vt(a,s,n.layoutBox);const l=ut();r?vt(l,t.applyTransform(i,!0),n.measuredBox):vt(l,s,n.layoutBox);const u=!Si(a);let c=!1;if(!t.resumeFrom){const h=t.getClosestProjectingParent();if(h&&!h.resumeFrom){const{snapshot:f,layout:d}=h;if(f&&d){const m=C();xt(m,n.layoutBox,f.layoutBox);const p=C();xt(p,s,d.layoutBox),Vi(m,p)||(c=!0),h.options.layoutRoot&&(t.relativeTarget=p,t.relativeTargetOrigin=m,t.relativeParent=h)}}}t.notifyListeners("didUpdate",{layout:s,snapshot:n,delta:l,layoutDelta:a,hasLayoutChanged:u,hasRelativeTargetChanged:c})}else if(t.isLead()){const{onExitComplete:s}=t.options;s&&s()}t.options.transition=void 0}function Sl(t){nt.totalNodes++,t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function Vl(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function Al(t){t.clearSnapshot()}function es(t){t.clearMeasurements()}function wl(t){t.isLayoutDirty=!1}function Cl(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function ns(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function Dl(t){t.resolveTargetDelta()}function Ml(t){t.calcProjection()}function Rl(t){t.resetSkewAndRotation()}function El(t){t.removeLeadSnapshot()}function ss(t,e,n){t.translate=w(e.translate,0,n),t.scale=w(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function is(t,e,n,s){t.min=w(e.min,n.min,s),t.max=w(e.max,n.max,s)}function Ll(t,e,n,s){is(t.x,e.x,n.x,s),is(t.y,e.y,n.y,s)}function Fl(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const Bl={duration:.45,ease:[.4,0,.1,1]},rs=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),os=rs("applewebkit/")&&!rs("chrome/")?Math.round:L;function as(t){t.min=os(t.min),t.max=os(t.max)}function kl(t){as(t.x),as(t.y)}function Ci(t,e,n){return t==="position"||t==="preserve-aspect"&&!Te(Qn(e),Qn(n),.2)}const Ol=wi({attachResizeListener:(t,e)=>K(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),ue={current:void 0},Di=wi({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!ue.current){const t=new Ol({});t.mount(window),t.setOptions({layoutScroll:!0}),ue.current=t}return ue.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),jl={pan:{Feature:Ja},drag:{Feature:Qa,ProjectionNode:Di,MeasureLayout:Ti}},Ve={current:null},Mi={current:!1};function Il(){if(Mi.current=!0,!!we)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Ve.current=t.matches;t.addListener(e),e()}else Ve.current=!1}function Ul(t,e,n){const{willChange:s}=e;for(const i in e){const o=e[i],r=n[i];if(E(o))t.addValue(i,o),Nt(s)&&s.add(i);else if(E(r))t.addValue(i,Vt(o,{owner:t})),Nt(s)&&s.remove(i);else if(r!==o)if(t.hasValue(i)){const a=t.getValue(i);a.liveStyle===!0?a.jump(o):a.hasAnimated||a.set(o)}else{const a=t.getStaticValue(i);t.addValue(i,Vt(a!==void 0?a:o,{owner:t}))}}for(const i in n)e[i]===void 0&&t.removeValue(i);return e}const ls=new WeakMap,Nl=[...Us,R,Q],Kl=t=>Nl.find(Is(t)),Ri=Object.keys(Pt),Wl=Ri.length,us=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],Gl=Re.length;function Ei(t){if(t)return t.options.allowProjection!==!1?t.projection:Ei(t.parent)}class $l{scrapeMotionValuesFromProps(e,n,s){return{}}constructor({parent:e,props:n,presenceContext:s,reducedMotionConfig:i,blockInitialAnimation:o,visualState:r},a={}){this.resolveKeyframes=(f,d,m,p)=>new this.KeyframeResolver(f,d,m,p,this),this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Ke,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.scheduleRender=()=>A.render(this.render,!1,!0);const{latestValues:l,renderState:u}=r;this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=u,this.parent=e,this.props=n,this.presenceContext=s,this.depth=e?e.depth+1:0,this.reducedMotionConfig=i,this.options=a,this.blockInitialAnimation=!!o,this.isControllingVariants=$t(n),this.isVariantNode=ms(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:c,...h}=this.scrapeMotionValuesFromProps(n,{},this);for(const f in h){const d=h[f];l[f]!==void 0&&E(d)&&(d.set(l[f],!1),Nt(c)&&c.add(f))}}mount(e){this.current=e,ls.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,s)=>this.bindToMotionValue(s,n)),Mi.current||Il(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Ve.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){var e;ls.delete(this.current),this.projection&&this.projection.unmount(),_(this.notifyUpdate),_(this.render),this.valueSubscriptions.forEach(n=>n()),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const n in this.events)this.events[n].clear();for(const n in this.features)(e=this.features[n])===null||e===void 0||e.unmount();this.current=null}bindToMotionValue(e,n){const s=rt.has(e),i=n.on("change",r=>{this.latestValues[e]=r,this.props.onUpdate&&A.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0)}),o=n.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(e,()=>{i(),o(),n.owner&&n.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}loadFeatures({children:e,...n},s,i,o){let r,a;for(let l=0;lthis.scheduleRender(),animationType:typeof u=="string"?u:"both",initialPromotionConfig:o,layoutScroll:f,layoutRoot:d})}return a}updateFeatures(){for(const e in this.features){const n=this.features[e];n.isMounted?n.update():(n.mount(),n.isMounted=!0)}}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):C()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let s=0;sn.variantChildren.delete(e)}addValue(e,n){const s=this.values.get(e);n!==s&&(s&&this.removeValue(e),this.bindToMotionValue(e,n),this.values.set(e,n),this.latestValues[e]=n.get())}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let s=this.values.get(e);return s===void 0&&n!==void 0&&(s=Vt(n===null?void 0:n,{owner:this}),this.addValue(e,s)),s}readValue(e,n){var s;let i=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:(s=this.getBaseTargetFromProps(this.props,e))!==null&&s!==void 0?s:this.readValueFromInstance(this.current,e,this.options);return i!=null&&(typeof i=="string"&&(Os(i)||ks(i))?i=parseFloat(i):!Kl(i)&&Q.test(n)&&(i=zs(e,n)),this.setBaseTarget(e,E(i)?i.get():i)),E(i)?i.get():i}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){var n;const{initial:s}=this.props;let i;if(typeof s=="string"||typeof s=="object"){const r=Ue(this.props,s,(n=this.presenceContext)===null||n===void 0?void 0:n.custom);r&&(i=r[e])}if(s&&i!==void 0)return i;const o=this.getBaseTargetFromProps(this.props,e);return o!==void 0&&!E(o)?o:this.initialValues[e]!==void 0&&i===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new Qe),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}}class Li extends $l{constructor(){super(...arguments),this.KeyframeResolver=Ys}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){return e.style?e.style[n]:void 0}removeValueFromRenderState(e,{vars:n,style:s}){delete n[e],delete s[e]}}function _l(t){return window.getComputedStyle(t)}class Hl extends Li{constructor(){super(...arguments),this.type="html"}readValueFromInstance(e,n){if(rt.has(n)){const s=Ge(n);return s&&s.default||0}else{const s=_l(e),i=(xs(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:n}){return vi(e,n)}build(e,n,s,i){Be(e,n,s,i.transformTemplate)}scrapeMotionValuesFromProps(e,n,s){return Ie(e,n,s)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;E(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}renderInstance(e,n,s,i){Vs(e,n,s,i)}}class zl extends Li{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(rt.has(n)){const s=Ge(n);return s&&s.default||0}return n=As.has(n)?n:Ce(n),e.getAttribute(n)}measureInstanceViewportBox(){return C()}scrapeMotionValuesFromProps(e,n,s){return Cs(e,n,s)}build(e,n,s,i){Oe(e,n,s,this.isSVGTag,i.transformTemplate)}renderInstance(e,n,s,i){ws(e,n,s,i)}mount(e){this.isSVGTag=je(e.tagName),super.mount(e)}}const Yl=(t,e)=>Ee(t)?new zl(e,{enableHardwareAcceleration:!1}):new Hl(e,{allowProjection:t!==P.Fragment,enableHardwareAcceleration:!0}),Xl={layout:{ProjectionNode:Di,MeasureLayout:Ti}},ql={...La,...Nr,...jl,...Xl},Zl=Xi((t,e)=>Cr(t,e,ql,Yl)),ru=({children:t})=>ht.jsx(Zl.div,{initial:{opacity:0,filter:"blur(1rem)"},animate:{opacity:1,filter:"blur(0)"},transition:{duration:.2},children:t});export{ru as B,eu as L,nu as u};