react-emotion-face 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,9 @@
1
+ (function(H,f){typeof exports=="object"&&typeof module<"u"?f(exports,require("react/jsx-runtime"),require("react")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react"],f):(H=typeof globalThis<"u"?globalThis:H||self,f(H.ReactEmotionFace={},H.ReactJSXRuntime,H.React))})(this,(function(H,f,x){"use strict";function dr(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const s=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,s.get?s:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const re=dr(x),oe=x.createContext({});function ae(t){const e=x.useRef(null);return e.current===null&&(e.current=t()),e.current}const jt=x.createContext(null),le=x.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});class fr extends re.Component{getSnapshotBeforeUpdate(e){const n=this.props.childRef.current;if(n&&e.isPresent&&!this.props.isPresent){const s=this.props.sizeRef.current;s.height=n.offsetHeight||0,s.width=n.offsetWidth||0,s.top=n.offsetTop,s.left=n.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function pr({children:t,isPresent:e}){const n=x.useId(),s=x.useRef(null),i=x.useRef({width:0,height:0,top:0,left:0}),{nonce:o}=x.useContext(le);return x.useInsertionEffect(()=>{const{width:r,height:a,top:l,left:c}=i.current;if(e||!s.current||!r||!a)return;s.current.dataset.motionPopId=n;const u=document.createElement("style");return o&&(u.nonce=o),document.head.appendChild(u),u.sheet&&u.sheet.insertRule(`
2
+ [data-motion-pop-id="${n}"] {
3
+ position: absolute !important;
4
+ width: ${r}px !important;
5
+ height: ${a}px !important;
6
+ top: ${l}px !important;
7
+ left: ${c}px !important;
8
+ }
9
+ `),()=>{document.head.removeChild(u)}},[e]),f.jsx(fr,{isPresent:e,childRef:s,sizeRef:i,children:re.cloneElement(t,{ref:s})})}const mr=({children:t,initial:e,isPresent:n,onExitComplete:s,custom:i,presenceAffectsLayout:o,mode:r})=>{const a=ae(gr),l=x.useId(),c=x.useCallback(h=>{a.set(h,!0);for(const d of a.values())if(!d)return;s&&s()},[a,s]),u=x.useMemo(()=>({id:l,initial:e,isPresent:n,custom:i,onExitComplete:c,register:h=>(a.set(h,!1),()=>a.delete(h))}),o?[Math.random(),c]:[n,c]);return x.useMemo(()=>{a.forEach((h,d)=>a.set(d,!1))},[n]),re.useEffect(()=>{!n&&!a.size&&s&&s()},[n]),r==="popLayout"&&(t=f.jsx(pr,{isPresent:n,children:t})),f.jsx(jt.Provider,{value:u,children:t})};function gr(){return new Map}function vn(t=!0){const e=x.useContext(jt);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:s,register:i}=e,o=x.useId();x.useEffect(()=>{t&&i(o)},[t]);const r=x.useCallback(()=>t&&s&&s(o),[o,s,t]);return!n&&s?[!1,r]:[!0]}const Nt=t=>t.key||"";function xn(t){const e=[];return x.Children.forEach(t,n=>{x.isValidElement(n)&&e.push(n)}),e}const ce=typeof window<"u",Sn=ce?x.useLayoutEffect:x.useEffect,Wt=({children:t,custom:e,initial:n=!0,onExitComplete:s,presenceAffectsLayout:i=!0,mode:o="sync",propagate:r=!1})=>{const[a,l]=vn(r),c=x.useMemo(()=>xn(t),[t]),u=r&&!a?[]:c.map(Nt),h=x.useRef(!0),d=x.useRef(c),p=ae(()=>new Map),[m,g]=x.useState(c),[v,y]=x.useState(c);Sn(()=>{h.current=!1,d.current=c;for(let A=0;A<v.length;A++){const S=Nt(v[A]);u.includes(S)?p.delete(S):p.get(S)!==!0&&p.set(S,!1)}},[v,u.length,u.join("-")]);const b=[];if(c!==m){let A=[...c];for(let S=0;S<v.length;S++){const C=v[S],E=Nt(C);u.includes(E)||(A.splice(S,0,C),b.push(C))}o==="wait"&&b.length&&(A=b),y(xn(A)),g(c);return}process.env.NODE_ENV!=="production"&&o==="wait"&&v.length>1&&console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);const{forceRender:T}=x.useContext(oe);return f.jsx(f.Fragment,{children:v.map(A=>{const S=Nt(A),C=r&&!a?!1:c===v||u.includes(S),E=()=>{if(p.has(S))p.set(S,!0);else return;let P=!0;p.forEach(O=>{O||(P=!1)}),P&&(T==null||T(),y(d.current),r&&(l==null||l()),s&&s())};return f.jsx(mr,{isPresent:C,initial:!h.current||n?void 0:!1,custom:C?void 0:e,presenceAffectsLayout:i,mode:o,onExitComplete:C?void 0:E,children:A},S)})})},j=t=>t;let lt=j,Q=j;process.env.NODE_ENV!=="production"&&(lt=(t,e)=>{!t&&typeof console<"u"&&console.warn(e)},Q=(t,e)=>{if(!t)throw new Error(e)});function ue(t){let e;return()=>(e===void 0&&(e=t()),e)}const ct=(t,e,n)=>{const s=e-t;return s===0?1:(n-t)/s},K=t=>t*1e3,q=t=>t/1e3,yr={useManualTiming:!1};function vr(t){let e=new Set,n=new Set,s=!1,i=!1;const o=new WeakSet;let r={delta:0,timestamp:0,isProcessing:!1};function a(c){o.has(c)&&(l.schedule(c),t()),c(r)}const l={schedule:(c,u=!1,h=!1)=>{const p=h&&s?e:n;return u&&o.add(c),p.has(c)||p.add(c),c},cancel:c=>{n.delete(c),o.delete(c)},process:c=>{if(r=c,s){i=!0;return}s=!0,[e,n]=[n,e],e.forEach(a),e.clear(),s=!1,i&&(i=!1,l.process(c))}};return l}const Ut=["read","resolveKeyframes","update","preRender","render","postRender"],xr=40;function bn(t,e){let n=!1,s=!0;const i={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,r=Ut.reduce((y,b)=>(y[b]=vr(o),y),{}),{read:a,resolveKeyframes:l,update:c,preRender:u,render:h,postRender:d}=r,p=()=>{const y=performance.now();n=!1,i.delta=s?1e3/60:Math.max(Math.min(y-i.timestamp,xr),1),i.timestamp=y,i.isProcessing=!0,a.process(i),l.process(i),c.process(i),u.process(i),h.process(i),d.process(i),i.isProcessing=!1,n&&e&&(s=!1,t(p))},m=()=>{n=!0,s=!0,i.isProcessing||t(p)};return{schedule:Ut.reduce((y,b)=>{const T=r[b];return y[b]=(A,S=!1,C=!1)=>(n||m(),T.schedule(A,S,C)),y},{}),cancel:y=>{for(let b=0;b<Ut.length;b++)r[Ut[b]].cancel(y)},state:i,steps:r}}const{schedule:V,cancel:Z,state:L,steps:he}=bn(typeof requestAnimationFrame<"u"?requestAnimationFrame:j,!0),Tn=x.createContext({strict:!1}),wn={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"]},ut={};for(const t in wn)ut[t]={isEnabled:e=>wn[t].some(n=>!!e[n])};function Sr(t){for(const e in t)ut[e]={...ut[e],...t[e]}}const br=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 $t(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||br.has(t)}let Pn=t=>!$t(t);function Tr(t){t&&(Pn=e=>e.startsWith("on")?!$t(e):t(e))}try{Tr(require("@emotion/is-prop-valid").default)}catch{}function wr(t,e,n){const s={};for(const i in t)i==="values"&&typeof t.values=="object"||(Pn(i)||n===!0&&$t(i)||!e&&!$t(i)||t.draggable&&i.startsWith("onDrag"))&&(s[i]=t[i]);return s}const An=new Set;function _t(t,e,n){t||An.has(e)||(console.warn(e),An.add(e))}function Pr(t){if(typeof Proxy>"u")return t;const e=new Map,n=(...s)=>(process.env.NODE_ENV!=="production"&&_t(!1,"motion() is deprecated. Use motion.create() instead."),t(...s));return new Proxy(n,{get:(s,i)=>i==="create"?t:(e.has(i)||e.set(i,t(i)),e.get(i))})}const Rt=x.createContext({});function St(t){return typeof t=="string"||Array.isArray(t)}function Kt(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}const de=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],fe=["initial",...de];function zt(t){return Kt(t.animate)||fe.some(e=>St(t[e]))}function Cn(t){return!!(zt(t)||t.variants)}function Ar(t,e){if(zt(t)){const{initial:n,animate:s}=t;return{initial:n===!1||St(n)?n:void 0,animate:St(s)?s:void 0}}return t.inherit!==!1?e:{}}function Cr(t){const{initial:e,animate:n}=Ar(t,x.useContext(Rt));return x.useMemo(()=>({initial:e,animate:n}),[Vn(e),Vn(n)])}function Vn(t){return Array.isArray(t)?t.join(" "):t}const Vr=Symbol.for("motionComponentSymbol");function ht(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function Mr(t,e,n){return x.useCallback(s=>{s&&t.onMount&&t.onMount(s),e&&(s?e.mount(s):e.unmount()),n&&(typeof n=="function"?n(s):ht(n)&&(n.current=s))},[e])}const pe=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Mn="data-"+pe("framerAppearId"),{schedule:me}=bn(queueMicrotask,!1),Dn=x.createContext({});function Dr(t,e,n,s,i){var o,r;const{visualElement:a}=x.useContext(Rt),l=x.useContext(Tn),c=x.useContext(jt),u=x.useContext(le).reducedMotion,h=x.useRef(null);s=s||l.renderer,!h.current&&s&&(h.current=s(t,{visualState:e,parent:a,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u}));const d=h.current,p=x.useContext(Dn);d&&!d.projection&&i&&(d.type==="html"||d.type==="svg")&&kr(h.current,n,i,p);const m=x.useRef(!1);x.useInsertionEffect(()=>{d&&m.current&&d.update(n,c)});const g=n[Mn],v=x.useRef(!!g&&!(!((o=window.MotionHandoffIsComplete)===null||o===void 0)&&o.call(window,g))&&((r=window.MotionHasOptimisedAnimation)===null||r===void 0?void 0:r.call(window,g)));return Sn(()=>{d&&(m.current=!0,window.MotionIsMounted=!0,d.updateFeatures(),me.render(d.render),v.current&&d.animationState&&d.animationState.animateChanges())}),x.useEffect(()=>{d&&(!v.current&&d.animationState&&d.animationState.animateChanges(),v.current&&(queueMicrotask(()=>{var y;(y=window.MotionHandoffMarkAsComplete)===null||y===void 0||y.call(window,g)}),v.current=!1))}),d}function kr(t,e,n,s){const{layoutId:i,layout:o,drag:r,dragConstraints:a,layoutScroll:l,layoutRoot:c}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:kn(t.parent)),t.projection.setOptions({layoutId:i,layout:o,alwaysMeasureLayout:!!r||a&&ht(a),visualElement:t,animationType:typeof o=="string"?o:"both",initialPromotionConfig:s,layoutScroll:l,layoutRoot:c})}function kn(t){if(t)return t.options.allowProjection!==!1?t.projection:kn(t.parent)}function Er({preloadedFeatures:t,createVisualElement:e,useRender:n,useVisualState:s,Component:i}){var o,r;t&&Sr(t);function a(c,u){let h;const d={...x.useContext(le),...c,layoutId:Lr(c)},{isStatic:p}=d,m=Cr(c),g=s(c,p);if(!p&&ce){Fr(d,t);const v=Br(d);h=v.MeasureLayout,m.visualElement=Dr(i,g,d,e,v.ProjectionNode)}return f.jsxs(Rt.Provider,{value:m,children:[h&&m.visualElement?f.jsx(h,{visualElement:m.visualElement,...d}):null,n(i,c,Mr(g,m.visualElement,u),g,p,m.visualElement)]})}a.displayName=`motion.${typeof i=="string"?i:`create(${(r=(o=i.displayName)!==null&&o!==void 0?o:i.name)!==null&&r!==void 0?r:""})`}`;const l=x.forwardRef(a);return l[Vr]=i,l}function Lr({layoutId:t}){const e=x.useContext(oe).id;return e&&t!==void 0?e+"-"+t:t}function Fr(t,e){const n=x.useContext(Tn).strict;if(process.env.NODE_ENV!=="production"&&e&&n){const s="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";t.ignoreStrict?lt(!1,s):Q(!1,s)}}function Br(t){const{drag:e,layout:n}=ut;if(!e&&!n)return{};const s={...e,...n};return{MeasureLayout:e!=null&&e.isEnabled(t)||n!=null&&n.isEnabled(t)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}const Or=["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 ge(t){return typeof t!="string"||t.includes("-")?!1:!!(Or.indexOf(t)>-1||/[A-Z]/u.test(t))}function En(t){const e=[{},{}];return t==null||t.values.forEach((n,s)=>{e[0][s]=n.get(),e[1][s]=n.getVelocity()}),e}function ye(t,e,n,s){if(typeof e=="function"){const[i,o]=En(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]=En(s);e=e(n!==void 0?n:t.custom,i,o)}return e}const ve=t=>Array.isArray(t),Ir=t=>!!(t&&typeof t=="object"&&t.mix&&t.toValue),jr=t=>ve(t)?t[t.length-1]||0:t,F=t=>!!(t&&t.getVelocity);function Gt(t){const e=F(t)?t.get():t;return Ir(e)?e.toValue():e}function Nr({scrapeMotionValuesFromProps:t,createRenderState:e,onUpdate:n},s,i,o){const r={latestValues:Wr(s,i,o,t),renderState:e()};return n&&(r.onMount=a=>n({props:s,current:a,...r}),r.onUpdate=a=>n(a)),r}const Ln=t=>(e,n)=>{const s=x.useContext(Rt),i=x.useContext(jt),o=()=>Nr(t,e,s,i);return n?o():ae(o)};function Wr(t,e,n,s){const i={},o=s(t,{});for(const d in o)i[d]=Gt(o[d]);let{initial:r,animate:a}=t;const l=zt(t),c=Cn(t);e&&c&&!l&&t.inherit!==!1&&(r===void 0&&(r=e.initial),a===void 0&&(a=e.animate));let u=n?n.initial===!1:!1;u=u||r===!1;const h=u?a:r;if(h&&typeof h!="boolean"&&!Kt(h)){const d=Array.isArray(h)?h:[h];for(let p=0;p<d.length;p++){const m=ye(t,d[p]);if(m){const{transitionEnd:g,transition:v,...y}=m;for(const b in y){let T=y[b];if(Array.isArray(T)){const A=u?T.length-1:0;T=T[A]}T!==null&&(i[b]=T)}for(const b in g)i[b]=g[b]}}}return i}const dt=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],nt=new Set(dt),Fn=t=>e=>typeof e=="string"&&e.startsWith(t),Bn=Fn("--"),Ur=Fn("var(--"),xe=t=>Ur(t)?$r.test(t.split("/*")[0].trim()):!1,$r=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,On=(t,e)=>e&&typeof t=="number"?e.transform(t):t,Y=(t,e,n)=>n>e?e:n<t?t:n,ft={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},bt={...ft,transform:t=>Y(0,1,t)},Ht={...ft,default:1},Tt=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),J=Tt("deg"),z=Tt("%"),w=Tt("px"),_r=Tt("vh"),Rr=Tt("vw"),In={...z,parse:t=>z.parse(t)/100,transform:t=>z.transform(t*100)},Kr={borderWidth:w,borderTopWidth:w,borderRightWidth:w,borderBottomWidth:w,borderLeftWidth:w,borderRadius:w,radius:w,borderTopLeftRadius:w,borderTopRightRadius:w,borderBottomRightRadius:w,borderBottomLeftRadius:w,width:w,maxWidth:w,height:w,maxHeight:w,top:w,right:w,bottom:w,left:w,padding:w,paddingTop:w,paddingRight:w,paddingBottom:w,paddingLeft:w,margin:w,marginTop:w,marginRight:w,marginBottom:w,marginLeft:w,backgroundPositionX:w,backgroundPositionY:w},zr={rotate:J,rotateX:J,rotateY:J,rotateZ:J,scale:Ht,scaleX:Ht,scaleY:Ht,scaleZ:Ht,skew:J,skewX:J,skewY:J,distance:w,translateX:w,translateY:w,translateZ:w,x:w,y:w,z:w,perspective:w,transformPerspective:w,opacity:bt,originX:In,originY:In,originZ:w},jn={...ft,transform:Math.round},Se={...Kr,...zr,zIndex:jn,size:w,fillOpacity:bt,strokeOpacity:bt,numOctaves:jn},Gr={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Hr=dt.length;function qr(t,e,n){let s="",i=!0;for(let o=0;o<Hr;o++){const r=dt[o],a=t[r];if(a===void 0)continue;let l=!0;if(typeof a=="number"?l=a===(r.startsWith("scale")?1:0):l=parseFloat(a)===0,!l||n){const c=On(a,Se[r]);if(!l){i=!1;const u=Gr[r]||r;s+=`${u}(${c}) `}n&&(e[r]=c)}}return s=s.trim(),n?s=n(e,i?"":s):i&&(s="none"),s}function be(t,e,n){const{style:s,vars:i,transformOrigin:o}=t;let r=!1,a=!1;for(const l in e){const c=e[l];if(nt.has(l)){r=!0;continue}else if(Bn(l)){i[l]=c;continue}else{const u=On(c,Se[l]);l.startsWith("origin")?(a=!0,o[l]=u):s[l]=u}}if(e.transform||(r||n?s.transform=qr(e,t.transform,n):s.transform&&(s.transform="none")),a){const{originX:l="50%",originY:c="50%",originZ:u=0}=o;s.transformOrigin=`${l} ${c} ${u}`}}const Yr={offset:"stroke-dashoffset",array:"stroke-dasharray"},Xr={offset:"strokeDashoffset",array:"strokeDasharray"};function Qr(t,e,n=1,s=0,i=!0){t.pathLength=1;const o=i?Yr:Xr;t[o.offset]=w.transform(-s);const r=w.transform(e),a=w.transform(n);t[o.array]=`${r} ${a}`}function Nn(t,e,n){return typeof t=="string"?t:w.transform(e+n*t)}function Zr(t,e,n){const s=Nn(e,t.x,t.width),i=Nn(n,t.y,t.height);return`${s} ${i}`}function Te(t,{attrX:e,attrY:n,attrScale:s,originX:i,originY:o,pathLength:r,pathSpacing:a=1,pathOffset:l=0,...c},u,h){if(be(t,c,h),u){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}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&&(i!==void 0||o!==void 0||p.transform)&&(p.transformOrigin=Zr(m,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&&Qr(d,r,a,l,!1)}const we=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),Wn=()=>({...we(),attrs:{}}),Pe=t=>typeof t=="string"&&t.toLowerCase()==="svg";function Un(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 $n=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 _n(t,e,n,s){Un(t,e,void 0,s);for(const i in e.attrs)t.setAttribute($n.has(i)?i:pe(i),e.attrs[i])}const qt={};function Jr(t){Object.assign(qt,t)}function Rn(t,{layout:e,layoutId:n}){return nt.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!qt[t]||t==="opacity")}function Ae(t,e,n){var s;const{style:i}=t,o={};for(const r in i)(F(i[r])||e.style&&F(e.style[r])||Rn(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 Kn(t,e,n){const s=Ae(t,e,n);for(const i in t)if(F(t[i])||F(e[i])){const o=dt.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;s[o]=t[i]}return s}function to(t,e){try{e.dimensions=typeof t.getBBox=="function"?t.getBBox():t.getBoundingClientRect()}catch{e.dimensions={x:0,y:0,width:0,height:0}}}const zn=["x","y","width","height","cx","cy","r"],eo={useVisualState:Ln({scrapeMotionValuesFromProps:Kn,createRenderState:Wn,onUpdate:({props:t,prevProps:e,current:n,renderState:s,latestValues:i})=>{if(!n)return;let o=!!t.drag;if(!o){for(const a in i)if(nt.has(a)){o=!0;break}}if(!o)return;let r=!e;if(e)for(let a=0;a<zn.length;a++){const l=zn[a];t[l]!==e[l]&&(r=!0)}r&&V.read(()=>{to(n,s),V.render(()=>{Te(s,i,Pe(n.tagName),t.transformTemplate),_n(n,s)})})}})},no={useVisualState:Ln({scrapeMotionValuesFromProps:Ae,createRenderState:we})};function Gn(t,e,n){for(const s in e)!F(e[s])&&!Rn(s,n)&&(t[s]=e[s])}function so({transformTemplate:t},e){return x.useMemo(()=>{const n=we();return be(n,e,t),Object.assign({},n.vars,n.style)},[e])}function io(t,e){const n=t.style||{},s={};return Gn(s,n,t),Object.assign(s,so(t,e)),s}function ro(t,e){const n={},s=io(t,e);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,s.userSelect=s.WebkitUserSelect=s.WebkitTouchCallout="none",s.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=s,n}function oo(t,e,n,s){const i=x.useMemo(()=>{const o=Wn();return Te(o,e,Pe(s),t.transformTemplate),{...o.attrs,style:{...o.style}}},[e]);if(t.style){const o={};Gn(o,t.style,t),i.style={...o,...i.style}}return i}function ao(t=!1){return(n,s,i,{latestValues:o},r)=>{const l=(ge(n)?oo:ro)(s,o,r,n),c=wr(s,typeof n=="string",t),u=n!==x.Fragment?{...c,...l,ref:i}:{},{children:h}=s,d=x.useMemo(()=>F(h)?h.get():h,[h]);return x.createElement(n,{...u,children:d})}}function lo(t,e){return function(s,{forwardMotionProps:i}={forwardMotionProps:!1}){const r={...ge(s)?eo:no,preloadedFeatures:t,useRender:ao(i),createVisualElement:e,Component:s};return Er(r)}}function Hn(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let s=0;s<n;s++)if(e[s]!==t[s])return!1;return!0}function Yt(t,e,n){const s=t.getProps();return ye(s,e,n!==void 0?n:s.custom,t)}const co=ue(()=>window.ScrollTimeline!==void 0);class uo{constructor(e){this.stop=()=>this.runAll("stop"),this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map(e=>"finished"in e?e.finished:e))}getAll(e){return this.animations[0][e]}setAll(e,n){for(let s=0;s<this.animations.length;s++)this.animations[s][e]=n}attachTimeline(e,n){const s=this.animations.map(i=>{if(co()&&i.attachTimeline)return i.attachTimeline(e);if(typeof n=="function")return n(i)});return()=>{s.forEach((i,o)=>{i&&i(),this.animations[o].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 startTime(){return this.getAll("startTime")}get duration(){let e=0;for(let n=0;n<this.animations.length;n++)e=Math.max(e,this.animations[n].duration);return e}runAll(e){this.animations.forEach(n=>n[e]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class ho extends uo{then(e,n){return Promise.all(this.animations).then(e).catch(n)}}function Ce(t,e){return t?t[e]||t.default||t:void 0}const Ve=2e4;function qn(t){let e=0;const n=50;let s=t.next(e);for(;!s.done&&e<Ve;)e+=n,s=t.next(e);return e>=Ve?1/0:e}function Me(t){return typeof t=="function"}function Yn(t,e){t.timeline=e,t.onfinish=null}const De=t=>Array.isArray(t)&&typeof t[0]=="number",fo={linearEasing:void 0};function po(t,e){const n=ue(t);return()=>{var s;return(s=fo[e])!==null&&s!==void 0?s:n()}}const Xt=po(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Xn=(t,e,n=10)=>{let s="";const i=Math.max(Math.round(e/n),2);for(let o=0;o<i;o++)s+=t(ct(0,i-1,o))+", ";return`linear(${s.substring(0,s.length-2)})`};function Qn(t){return!!(typeof t=="function"&&Xt()||!t||typeof t=="string"&&(t in ke||Xt())||De(t)||Array.isArray(t)&&t.every(Qn))}const wt=([t,e,n,s])=>`cubic-bezier(${t}, ${e}, ${n}, ${s})`,ke={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:wt([0,.65,.55,1]),circOut:wt([.55,0,1,.45]),backIn:wt([.31,.01,.66,-.59]),backOut:wt([.33,1.53,.69,.99])};function Zn(t,e){if(t)return typeof t=="function"&&Xt()?Xn(t,e):De(t)?wt(t):Array.isArray(t)?t.map(n=>Zn(n,e)||ke.easeOut):ke[t]}const R={x:!1,y:!1};function Jn(){return R.x||R.y}function mo(t,e,n){var s;if(t instanceof Element)return[t];if(typeof t=="string"){let i=document;const o=(s=void 0)!==null&&s!==void 0?s:i.querySelectorAll(t);return o?Array.from(o):[]}return Array.from(t)}function ts(t,e){const n=mo(t),s=new AbortController,i={passive:!0,...e,signal:s.signal};return[n,i,()=>s.abort()]}function es(t){return e=>{e.pointerType==="touch"||Jn()||t(e)}}function go(t,e,n={}){const[s,i,o]=ts(t,n),r=es(a=>{const{target:l}=a,c=e(a);if(typeof c!="function"||!l)return;const u=es(h=>{c(h),l.removeEventListener("pointerleave",u)});l.addEventListener("pointerleave",u,i)});return s.forEach(a=>{a.addEventListener("pointerenter",r,i)}),o}const ns=(t,e)=>e?t===e?!0:ns(t,e.parentElement):!1,Ee=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,yo=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function vo(t){return yo.has(t.tagName)||t.tabIndex!==-1}const Pt=new WeakSet;function ss(t){return e=>{e.key==="Enter"&&t(e)}}function Le(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const xo=(t,e)=>{const n=t.currentTarget;if(!n)return;const s=ss(()=>{if(Pt.has(n))return;Le(n,"down");const i=ss(()=>{Le(n,"up")}),o=()=>Le(n,"cancel");n.addEventListener("keyup",i,e),n.addEventListener("blur",o,e)});n.addEventListener("keydown",s,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",s),e)};function is(t){return Ee(t)&&!Jn()}function So(t,e,n={}){const[s,i,o]=ts(t,n),r=a=>{const l=a.currentTarget;if(!is(a)||Pt.has(l))return;Pt.add(l);const c=e(a),u=(p,m)=>{window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",d),!(!is(p)||!Pt.has(l))&&(Pt.delete(l),typeof c=="function"&&c(p,{success:m}))},h=p=>{u(p,n.useGlobalTarget||ns(l,p.target))},d=p=>{u(p,!1)};window.addEventListener("pointerup",h,i),window.addEventListener("pointercancel",d,i)};return s.forEach(a=>{!vo(a)&&a.getAttribute("tabindex")===null&&(a.tabIndex=0),(n.useGlobalTarget?window:a).addEventListener("pointerdown",r,i),a.addEventListener("focus",c=>xo(c,i),i)}),o}function bo(t){return t==="x"||t==="y"?R[t]?null:(R[t]=!0,()=>{R[t]=!1}):R.x||R.y?null:(R.x=R.y=!0,()=>{R.x=R.y=!1})}const rs=new Set(["width","height","top","left","right","bottom",...dt]);let Qt;function To(){Qt=void 0}const G={now:()=>(Qt===void 0&&G.set(L.isProcessing||yr.useManualTiming?L.timestamp:performance.now()),Qt),set:t=>{Qt=t,queueMicrotask(To)}};function Fe(t,e){t.indexOf(e)===-1&&t.push(e)}function Be(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class Oe{constructor(){this.subscriptions=[]}add(e){return Fe(this.subscriptions,e),()=>Be(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<i;o++){const r=this.subscriptions[o];r&&r(e,n,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function os(t,e){return e?t*(1e3/e):0}const as=30,wo=t=>!isNaN(parseFloat(t));class Po{constructor(e,n={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(s,i=!0)=>{const o=G.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=G.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=wo(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return process.env.NODE_ENV!=="production"&&_t(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new Oe);const s=this.events[e].add(n);return e==="change"?()=>{s(),V.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=G.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>as)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,as);return os(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 At(t,e){return new Po(t,e)}function Ao(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,At(n))}function Co(t,e){const n=Yt(t,e);let{transitionEnd:s={},transition:i={},...o}=n||{};o={...o,...s};for(const r in o){const a=jr(o[r]);Ao(t,r,a)}}function Vo(t){return!!(F(t)&&t.add)}function Ie(t,e){const n=t.getValue("willChange");if(Vo(n))return n.add(e)}function ls(t){return t.props[Mn]}const cs=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,Mo=1e-7,Do=12;function ko(t,e,n,s,i){let o,r,a=0;do r=e+(n-e)/2,o=cs(r,s,i)-t,o>0?n=r:e=r;while(Math.abs(o)>Mo&&++a<Do);return r}function Ct(t,e,n,s){if(t===e&&n===s)return j;const i=o=>ko(o,0,1,t,n);return o=>o===0||o===1?o:cs(i(o),e,s)}const us=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,hs=t=>e=>1-t(1-e),ds=Ct(.33,1.53,.69,.99),je=hs(ds),fs=us(je),ps=t=>(t*=2)<1?.5*je(t):.5*(2-Math.pow(2,-10*(t-1))),Ne=t=>1-Math.sin(Math.acos(t)),ms=hs(Ne),gs=us(Ne),ys=t=>/^0[^.\s]+$/u.test(t);function Eo(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||ys(t):!0}const Vt=t=>Math.round(t*1e5)/1e5,We=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Lo(t){return t==null}const Fo=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Ue=(t,e)=>n=>!!(typeof n=="string"&&Fo.test(n)&&n.startsWith(t)||e&&!Lo(n)&&Object.prototype.hasOwnProperty.call(n,e)),vs=(t,e,n)=>s=>{if(typeof s!="string")return s;const[i,o,r,a]=s.match(We);return{[t]:parseFloat(i),[e]:parseFloat(o),[n]:parseFloat(r),alpha:a!==void 0?parseFloat(a):1}},Bo=t=>Y(0,255,t),$e={...ft,transform:t=>Math.round(Bo(t))},st={test:Ue("rgb","red"),parse:vs("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:s=1})=>"rgba("+$e.transform(t)+", "+$e.transform(e)+", "+$e.transform(n)+", "+Vt(bt.transform(s))+")"};function Oo(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 _e={test:Ue("#"),parse:Oo,transform:st.transform},pt={test:Ue("hsl","hue"),parse:vs("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:s=1})=>"hsla("+Math.round(t)+", "+z.transform(Vt(e))+", "+z.transform(Vt(n))+", "+Vt(bt.transform(s))+")"},B={test:t=>st.test(t)||_e.test(t)||pt.test(t),parse:t=>st.test(t)?st.parse(t):pt.test(t)?pt.parse(t):_e.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?st.transform(t):pt.transform(t)},Io=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function jo(t){var e,n;return isNaN(t)&&typeof t=="string"&&(((e=t.match(We))===null||e===void 0?void 0:e.length)||0)+(((n=t.match(Io))===null||n===void 0?void 0:n.length)||0)>0}const xs="number",Ss="color",No="var",Wo="var(",bs="${}",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 Mt(t){const e=t.toString(),n=[],s={color:[],number:[],var:[]},i=[];let o=0;const a=e.replace(Uo,l=>(B.test(l)?(s.color.push(o),i.push(Ss),n.push(B.parse(l))):l.startsWith(Wo)?(s.var.push(o),i.push(No),n.push(l)):(s.number.push(o),i.push(xs),n.push(parseFloat(l))),++o,bs)).split(bs);return{values:n,split:a,indexes:s,types:i}}function Ts(t){return Mt(t).values}function ws(t){const{split:e,types:n}=Mt(t),s=e.length;return i=>{let o="";for(let r=0;r<s;r++)if(o+=e[r],i[r]!==void 0){const a=n[r];a===xs?o+=Vt(i[r]):a===Ss?o+=B.transform(i[r]):o+=i[r]}return o}}const $o=t=>typeof t=="number"?0:t;function _o(t){const e=Ts(t);return ws(t)(e.map($o))}const tt={test:jo,parse:Ts,createTransformer:ws,getAnimatableNone:_o},Ro=new Set(["brightness","contrast","saturate","opacity"]);function Ko(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[s]=n.match(We)||[];if(!s)return t;const i=n.replace(s,"");let o=Ro.has(e)?1:0;return s!==n&&(o*=100),e+"("+o+i+")"}const zo=/\b([a-z-]*)\(.*?\)/gu,Re={...tt,getAnimatableNone:t=>{const e=t.match(zo);return e?e.map(Ko).join(" "):t}},Go={...Se,color:B,backgroundColor:B,outlineColor:B,fill:B,stroke:B,borderColor:B,borderTopColor:B,borderRightColor:B,borderBottomColor:B,borderLeftColor:B,filter:Re,WebkitFilter:Re},Ke=t=>Go[t];function Ps(t,e){let n=Ke(t);return n!==Re&&(n=tt),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const Ho=new Set(["auto","none","0"]);function qo(t,e,n){let s=0,i;for(;s<t.length&&!i;){const o=t[s];typeof o=="string"&&!Ho.has(o)&&Mt(o).values.length&&(i=t[s]),s++}if(i&&n)for(const o of e)t[o]=Ps(n,i)}const As=t=>t===ft||t===w,Cs=(t,e)=>parseFloat(t.split(", ")[e]),Vs=(t,e)=>(n,{transform:s})=>{if(s==="none"||!s)return 0;const i=s.match(/^matrix3d\((.+)\)$/u);if(i)return Cs(i[1],e);{const o=s.match(/^matrix\((.+)\)$/u);return o?Cs(o[1],t):0}},Yo=new Set(["x","y","z"]),Xo=dt.filter(t=>!Yo.has(t));function Qo(t){const e=[];return Xo.forEach(n=>{const s=t.getValue(n);s!==void 0&&(e.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),e}const mt={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:Vs(4,13),y:Vs(5,14)};mt.translateX=mt.x,mt.translateY=mt.y;const it=new Set;let ze=!1,Ge=!1;function Ms(){if(Ge){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=Qo(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)})}Ge=!1,ze=!1,it.forEach(t=>t.complete()),it.clear()}function Ds(){it.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Ge=!0)})}function Zo(){Ds(),Ms()}class He{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),ze||(ze=!0,V.read(Ds),V.resolveKeyframes(Ms))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:s,motionValue:i}=this;for(let o=0;o<e.length;o++)if(e[o]===null)if(o===0){const r=i==null?void 0:i.get(),a=e[e.length-1];if(r!==void 0)e[0]=r;else if(s&&n){const l=s.readValue(n,a);l!=null&&(e[0]=l)}e[0]===void 0&&(e[0]=a),i&&r===void 0&&i.set(e[0])}else e[o]=e[o-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),it.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,it.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const ks=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),Jo=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function ta(t){const e=Jo.exec(t);if(!e)return[,];const[,n,s,i]=e;return[`--${n??s}`,i]}const ea=4;function Es(t,e,n=1){Q(n<=ea,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`);const[s,i]=ta(t);if(!s)return;const o=window.getComputedStyle(e).getPropertyValue(s);if(o){const r=o.trim();return ks(r)?parseFloat(r):r}return xe(i)?Es(i,e,n+1):i}const Ls=t=>e=>e.test(t),Fs=[ft,w,z,J,Rr,_r,{test:t=>t==="auto",parse:t=>t}],Bs=t=>Fs.find(Ls(t));class Os extends He{constructor(e,n,s,i,o){super(e,n,s,i,o,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:s}=this;if(!n||!n.current)return;super.readKeyframes();for(let l=0;l<e.length;l++){let c=e[l];if(typeof c=="string"&&(c=c.trim(),xe(c))){const u=Es(c,n.current);u!==void 0&&(e[l]=u),l===e.length-1&&(this.finalKeyframe=c)}}if(this.resolveNoneKeyframes(),!rs.has(s)||e.length!==2)return;const[i,o]=e,r=Bs(i),a=Bs(o);if(r!==a)if(As(r)&&As(a))for(let l=0;l<e.length;l++){const c=e[l];typeof c=="string"&&(e[l]=parseFloat(c))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,s=[];for(let i=0;i<e.length;i++)Eo(e[i])&&s.push(i);s.length&&qo(e,s,n)}measureInitialState(){const{element:e,unresolvedKeyframes:n,name:s}=this;if(!e||!e.current)return;s==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=mt[s](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&e.getValue(s,i).jump(i,!1)}measureEndState(){var e;const{element:n,name:s,unresolvedKeyframes:i}=this;if(!n||!n.current)return;const o=n.getValue(s);o&&o.jump(this.measuredOrigin,!1);const r=i.length-1,a=i[r];i[r]=mt[s](n.measureViewportBox(),window.getComputedStyle(n.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),!((e=this.removedTransforms)===null||e===void 0)&&e.length&&this.removedTransforms.forEach(([l,c])=>{n.getValue(l).set(c)}),this.resolveNoneKeyframes()}}const Is=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(tt.test(t)||t==="0")&&!t.startsWith("url("));function na(t){const e=t[0];if(t.length===1)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}function sa(t,e,n,s){const i=t[0];if(i===null)return!1;if(e==="display"||e==="visibility")return!0;const o=t[t.length-1],r=Is(i,e),a=Is(o,e);return lt(r===a,`You are trying to animate ${e} from "${i}" to "${o}". ${i} is not an animatable value - to enable this animation set ${i} to a value animatable to ${o} via the \`style\` property.`),!r||!a?!1:na(t)||(n==="spring"||Me(n))&&s}const ia=t=>t!==null;function Zt(t,{repeat:e,repeatType:n="loop"},s){const i=t.filter(ia),o=e&&n!=="loop"&&e%2===1?0:i.length-1;return!o||s===void 0?i[o]:s}const ra=40;class js{constructor({autoplay:e=!0,delay:n=0,type:s="keyframes",repeat:i=0,repeatDelay:o=0,repeatType:r="loop",...a}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=G.now(),this.options={autoplay:e,delay:n,type:s,repeat:i,repeatDelay:o,repeatType:r,...a},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>ra?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&Zo(),this._resolved}onKeyframesResolved(e,n){this.resolvedAt=G.now(),this.hasAttemptedResolve=!0;const{name:s,type:i,velocity:o,delay:r,onComplete:a,onUpdate:l,isGenerator:c}=this.options;if(!c&&!sa(e,s,i,o))if(r)this.options.duration=0;else{l&&l(Zt(e,this.options,n)),a&&a(),this.resolveFinishedPromise();return}const u=this.initPlayback(e,n);u!==!1&&(this._resolved={keyframes:e,finalKeyframe:n,...u},this.onPostResolved())}onPostResolved(){}then(e,n){return this.currentFinishedPromise.then(e,n)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(e=>{this.resolveFinishedPromise=e})}}const M=(t,e,n)=>t+(e-t)*n;function qe(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 oa({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=qe(l,a,t+1/3),o=qe(l,a,t),r=qe(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 Ye=(t,e,n)=>{const s=t*t,i=n*(e*e-s)+s;return i<0?0:Math.sqrt(i)},aa=[_e,st,pt],la=t=>aa.find(e=>e.test(t));function Ns(t){const e=la(t);if(lt(!!e,`'${t}' is not an animatable color. Use the equivalent color code instead.`),!e)return!1;let n=e.parse(t);return e===pt&&(n=oa(n)),n}const Ws=(t,e)=>{const n=Ns(t),s=Ns(e);if(!n||!s)return Jt(t,e);const i={...n};return o=>(i.red=Ye(n.red,s.red,o),i.green=Ye(n.green,s.green,o),i.blue=Ye(n.blue,s.blue,o),i.alpha=M(n.alpha,s.alpha,o),st.transform(i))},ca=(t,e)=>n=>e(t(n)),Dt=(...t)=>t.reduce(ca),Xe=new Set(["none","hidden"]);function ua(t,e){return Xe.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function ha(t,e){return n=>M(t,e,n)}function Qe(t){return typeof t=="number"?ha:typeof t=="string"?xe(t)?Jt:B.test(t)?Ws:pa:Array.isArray(t)?Us:typeof t=="object"?B.test(t)?Ws:da:Jt}function Us(t,e){const n=[...t],s=n.length,i=t.map((o,r)=>Qe(o)(o,e[r]));return o=>{for(let r=0;r<s;r++)n[r]=i[r](o);return n}}function da(t,e){const n={...t,...e},s={};for(const i in n)t[i]!==void 0&&e[i]!==void 0&&(s[i]=Qe(t[i])(t[i],e[i]));return i=>{for(const o in s)n[o]=s[o](i);return n}}function fa(t,e){var n;const s=[],i={color:0,var:0,number:0};for(let o=0;o<e.values.length;o++){const r=e.types[o],a=t.indexes[r][i[r]],l=(n=t.values[a])!==null&&n!==void 0?n:0;s[o]=l,i[r]++}return s}const pa=(t,e)=>{const n=tt.createTransformer(e),s=Mt(t),i=Mt(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?Xe.has(t)&&!i.values.length||Xe.has(e)&&!s.values.length?ua(t,e):Dt(Us(fa(s,i),i.values),n):(lt(!0,`Complex values '${t}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),Jt(t,e))};function $s(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?M(t,e,n):Qe(t)(t,e)}const ma=5;function _s(t,e,n){const s=Math.max(e-ma,0);return os(n-t(s),e-s)}const D={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},Ze=.001;function ga({duration:t=D.duration,bounce:e=D.bounce,velocity:n=D.velocity,mass:s=D.mass}){let i,o;lt(t<=K(D.maxDuration),"Spring duration must be 10 seconds or less");let r=1-e;r=Y(D.minDamping,D.maxDamping,r),t=Y(D.minDuration,D.maxDuration,q(t)),r<1?(i=c=>{const u=c*r,h=u*t,d=u-n,p=Je(c,r),m=Math.exp(-h);return Ze-d/p*m},o=c=>{const h=c*r*t,d=h*n+n,p=Math.pow(r,2)*Math.pow(c,2)*t,m=Math.exp(-h),g=Je(Math.pow(c,2),r);return(-i(c)+Ze>0?-1:1)*((d-p)*m)/g}):(i=c=>{const u=Math.exp(-c*t),h=(c-n)*t+1;return-Ze+u*h},o=c=>{const u=Math.exp(-c*t),h=(n-c)*(t*t);return u*h});const a=5/t,l=va(i,o,a);if(t=K(t),isNaN(l))return{stiffness:D.stiffness,damping:D.damping,duration:t};{const c=Math.pow(l,2)*s;return{stiffness:c,damping:r*2*Math.sqrt(s*c),duration:t}}}const ya=12;function va(t,e,n){let s=n;for(let i=1;i<ya;i++)s=s-t(s)/e(s);return s}function Je(t,e){return t*Math.sqrt(1-e*e)}const xa=["duration","bounce"],Sa=["stiffness","damping","mass"];function Rs(t,e){return e.some(n=>t[n]!==void 0)}function ba(t){let e={velocity:D.velocity,stiffness:D.stiffness,damping:D.damping,mass:D.mass,isResolvedFromDuration:!1,...t};if(!Rs(t,Sa)&&Rs(t,xa))if(t.visualDuration){const n=t.visualDuration,s=2*Math.PI/(n*1.2),i=s*s,o=2*Y(.05,1,1-(t.bounce||0))*Math.sqrt(i);e={...e,mass:D.mass,stiffness:i,damping:o}}else{const n=ga(t);e={...e,...n,mass:D.mass},e.isResolvedFromDuration=!0}return e}function Ks(t=D.visualDuration,e=D.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:s,restDelta:i}=n;const o=n.keyframes[0],r=n.keyframes[n.keyframes.length-1],a={done:!1,value:o},{stiffness:l,damping:c,mass:u,duration:h,velocity:d,isResolvedFromDuration:p}=ba({...n,velocity:-q(n.velocity||0)}),m=d||0,g=c/(2*Math.sqrt(l*u)),v=r-o,y=q(Math.sqrt(l/u)),b=Math.abs(v)<5;s||(s=b?D.restSpeed.granular:D.restSpeed.default),i||(i=b?D.restDelta.granular:D.restDelta.default);let T;if(g<1){const S=Je(y,g);T=C=>{const E=Math.exp(-g*y*C);return r-E*((m+g*y*v)/S*Math.sin(S*C)+v*Math.cos(S*C))}}else if(g===1)T=S=>r-Math.exp(-y*S)*(v+(m+y*v)*S);else{const S=y*Math.sqrt(g*g-1);T=C=>{const E=Math.exp(-g*y*C),P=Math.min(S*C,300);return r-E*((m+g*y*v)*Math.sinh(P)+S*v*Math.cosh(P))/S}}const A={calculatedDuration:p&&h||null,next:S=>{const C=T(S);if(p)a.done=S>=h;else{let E=0;g<1&&(E=S===0?K(m):_s(T,S,C));const P=Math.abs(E)<=s,O=Math.abs(r-C)<=i;a.done=P&&O}return a.value=a.done?r:C,a},toString:()=>{const S=Math.min(qn(A),Ve),C=Xn(E=>A.next(S*E).value,S,30);return S+"ms "+C}};return A}function zs({keyframes:t,velocity:e=0,power:n=.8,timeConstant:s=325,bounceDamping:i=10,bounceStiffness:o=500,modifyTarget:r,min:a,max:l,restDelta:c=.5,restSpeed:u}){const h=t[0],d={done:!1,value:h},p=P=>a!==void 0&&P<a||l!==void 0&&P>l,m=P=>a===void 0?l:l===void 0||Math.abs(a-P)<Math.abs(l-P)?a:l;let g=n*e;const v=h+g,y=r===void 0?v:r(v);y!==v&&(g=y-h);const b=P=>-g*Math.exp(-P/s),T=P=>y+b(P),A=P=>{const O=b(P),_=T(P);d.done=Math.abs(O)<=c,d.value=d.done?y:_};let S,C;const E=P=>{p(d.value)&&(S=P,C=Ks({keyframes:[d.value,m(d.value)],velocity:_s(T,P,d.value),damping:i,stiffness:o,restDelta:c,restSpeed:u}))};return E(0),{calculatedDuration:null,next:P=>{let O=!1;return!C&&S===void 0&&(O=!0,A(P),E(P)),S!==void 0&&P>=S?C.next(P-S):(!O&&A(P),d)}}}const Ta=Ct(.42,0,1,1),wa=Ct(0,0,.58,1),Gs=Ct(.42,0,.58,1),Pa=t=>Array.isArray(t)&&typeof t[0]!="number",Hs={linear:j,easeIn:Ta,easeInOut:Gs,easeOut:wa,circIn:Ne,circInOut:gs,circOut:ms,backIn:je,backInOut:fs,backOut:ds,anticipate:ps},qs=t=>{if(De(t)){Q(t.length===4,"Cubic bezier arrays must contain four numerical values.");const[e,n,s,i]=t;return Ct(e,n,s,i)}else if(typeof t=="string")return Q(Hs[t]!==void 0,`Invalid easing type '${t}'`),Hs[t];return t};function Aa(t,e,n){const s=[],i=n||$s,o=t.length-1;for(let r=0;r<o;r++){let a=i(t[r],t[r+1]);if(e){const l=Array.isArray(e)?e[r]||j:e;a=Dt(l,a)}s.push(a)}return s}function Ca(t,e,{clamp:n=!0,ease:s,mixer:i}={}){const o=t.length;if(Q(o===e.length,"Both input and output ranges must be the same length"),o===1)return()=>e[0];if(o===2&&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=Aa(e,s,i),l=a.length,c=u=>{if(r&&u<t[0])return e[0];let h=0;if(l>1)for(;h<t.length-2&&!(u<t[h+1]);h++);const d=ct(t[h],t[h+1],u);return a[h](d)};return n?u=>c(Y(t[0],t[o-1],u)):c}function Va(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const i=ct(0,e,s);t.push(M(n,1,i))}}function Ma(t){const e=[0];return Va(e,t.length-1),e}function Da(t,e){return t.map(n=>n*e)}function ka(t,e){return t.map(()=>e||Gs).splice(0,t.length-1)}function te({duration:t=300,keyframes:e,times:n,ease:s="easeInOut"}){const i=Pa(s)?s.map(qs):qs(s),o={done:!1,value:e[0]},r=Da(n&&n.length===e.length?n:Ma(e),t),a=Ca(r,e,{ease:Array.isArray(i)?i:ka(e,i)});return{calculatedDuration:t,next:l=>(o.value=a(l),o.done=l>=t,o)}}const Ea=t=>{const e=({timestamp:n})=>t(n);return{start:()=>V.update(e,!0),stop:()=>Z(e),now:()=>L.isProcessing?L.timestamp:G.now()}},La={decay:zs,inertia:zs,tween:te,keyframes:te,spring:Ks},Fa=t=>t/100;class tn extends js{constructor(e){super(e),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,this.state==="idle")return;this.teardown();const{onStop:l}=this.options;l&&l()};const{name:n,motionValue:s,element:i,keyframes:o}=this.options,r=(i==null?void 0:i.KeyframeResolver)||He,a=(l,c)=>this.onKeyframesResolved(l,c);this.resolver=new r(o,a,n,s,i),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(e){const{type:n="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:o,velocity:r=0}=this.options,a=Me(n)?n:La[n]||te;let l,c;a!==te&&typeof e[0]!="number"&&(process.env.NODE_ENV!=="production"&&Q(e.length===2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${e}`),l=Dt(Fa,$s(e[0],e[1])),e=[0,100]);const u=a({...this.options,keyframes:e});o==="mirror"&&(c=a({...this.options,keyframes:[...e].reverse(),velocity:-r})),u.calculatedDuration===null&&(u.calculatedDuration=qn(u));const{calculatedDuration:h}=u,d=h+i,p=d*(s+1)-i;return{generator:u,mirroredGenerator:c,mapPercentToKeyframes:l,calculatedDuration:h,resolvedDuration:d,totalDuration:p}}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:P}=this.options;return{done:!0,value:P[P.length-1]}}const{finalKeyframe:i,generator:o,mirroredGenerator:r,mapPercentToKeyframes:a,keyframes:l,calculatedDuration:c,totalDuration:u,resolvedDuration:h}=s;if(this.startTime===null)return o.next(0);const{delay:d,repeat:p,repeatType:m,repeatDelay:g,onUpdate:v}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-u/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 y=this.currentTime-d*(this.speed>=0?1:-1),b=this.speed>=0?y<0:y>u;this.currentTime=Math.max(y,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=u);let T=this.currentTime,A=o;if(p){const P=Math.min(this.currentTime,u)/h;let O=Math.floor(P),_=P%1;!_&&P>=1&&(_=1),_===1&&O--,O=Math.min(O,p+1),!!(O%2)&&(m==="reverse"?(_=1-_,g&&(_-=g/h)):m==="mirror"&&(A=r)),T=Y(0,1,_)*h}const S=b?{done:!1,value:l[0]}:A.next(T);a&&(S.value=a(S.value));let{done:C}=S;!b&&c!==null&&(C=this.speed>=0?this.currentTime>=u:this.currentTime<=0);const E=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&C);return E&&i!==void 0&&(S.value=Zt(l,this.options,i)),v&&v(S.value),E&&this.finish(),S}get duration(){const{resolved:e}=this;return e?q(e.calculatedDuration):0}get time(){return q(this.currentTime)}set time(e){e=K(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=q(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:e=Ea,onPlay:n,startTime:s}=this.options;this.driver||(this.driver=e(o=>this.tick(o))),n&&n();const i=this.driver.now();this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=i):this.startTime=s??this.calcStartTime(),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 Ba=new Set(["opacity","clipPath","filter","transform"]);function Oa(t,e,n,{delay:s=0,duration:i=300,repeat:o=0,repeatType:r="loop",ease:a="easeInOut",times:l}={}){const c={[e]:n};l&&(c.offset=l);const u=Zn(a,i);return Array.isArray(u)&&(c.easing=u),t.animate(c,{delay:s,duration:i,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:o+1,direction:r==="reverse"?"alternate":"normal"})}const Ia=ue(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),ee=10,ja=2e4;function Na(t){return Me(t.type)||t.type==="spring"||!Qn(t.ease)}function Wa(t,e){const n=new tn({...e,keyframes:t,repeat:0,delay:0,isGenerator:!0});let s={done:!1,value:t[0]};const i=[];let o=0;for(;!s.done&&o<ja;)s=n.sample(o),i.push(s.value),o+=ee;return{times:void 0,keyframes:i,duration:o-ee,ease:"linear"}}const Ys={anticipate:ps,backInOut:fs,circInOut:gs};function Ua(t){return t in Ys}class Xs extends js{constructor(e){super(e);const{name:n,motionValue:s,element:i,keyframes:o}=this.options;this.resolver=new Os(o,(r,a)=>this.onKeyframesResolved(r,a),n,s,i),this.resolver.scheduleResolve()}initPlayback(e,n){let{duration:s=300,times:i,ease:o,type:r,motionValue:a,name:l,startTime:c}=this.options;if(!a.owner||!a.owner.current)return!1;if(typeof o=="string"&&Xt()&&Ua(o)&&(o=Ys[o]),Na(this.options)){const{onComplete:h,onUpdate:d,motionValue:p,element:m,...g}=this.options,v=Wa(e,g);e=v.keyframes,e.length===1&&(e[1]=e[0]),s=v.duration,i=v.times,o=v.ease,r="keyframes"}const u=Oa(a.owner.current,l,e,{...this.options,duration:s,times:i,ease:o});return u.startTime=c??this.calcStartTime(),this.pendingTimeline?(Yn(u,this.pendingTimeline),this.pendingTimeline=void 0):u.onfinish=()=>{const{onComplete:h}=this.options;a.set(Zt(e,this.options,n)),h&&h(),this.cancel(),this.resolveFinishedPromise()},{animation:u,duration:s,times:i,type:r,ease:o,keyframes:e}}get duration(){const{resolved:e}=this;if(!e)return 0;const{duration:n}=e;return q(n)}get time(){const{resolved:e}=this;if(!e)return 0;const{animation:n}=e;return q(n.currentTime||0)}set time(e){const{resolved:n}=this;if(!n)return;const{animation:s}=n;s.currentTime=K(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}get startTime(){const{resolved:e}=this;if(!e)return null;const{animation:n}=e;return n.startTime}attachTimeline(e){if(!this._resolved)this.pendingTimeline=e;else{const{resolved:n}=this;if(!n)return j;const{animation:s}=n;Yn(s,e)}return j}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;this.resolveFinishedPromise(),this.updateFinishedPromise();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")return;if(this.time){const{motionValue:c,onUpdate:u,onComplete:h,element:d,...p}=this.options,m=new tn({...p,keyframes:s,duration:i,type:o,ease:r,times:a,isGenerator:!0}),g=K(this.time);c.setWithVelocity(m.sample(g-ee).value,m.sample(g).value,ee)}const{onStop:l}=this.options;l&&l(),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;if(!n||!n.owner||!(n.owner.current instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:c}=n.owner.getProps();return Ia()&&s&&Ba.has(s)&&!l&&!c&&!i&&o!=="mirror"&&r!==0&&a!=="inertia"}}const $a={type:"spring",stiffness:500,damping:25,restSpeed:10},_a=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),Ra={type:"keyframes",duration:.8},Ka={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},za=(t,{keyframes:e})=>e.length>2?Ra:nt.has(t)?t.startsWith("scale")?_a(e[1]):$a:Ka;function Ga({when:t,delay:e,delayChildren:n,staggerChildren:s,staggerDirection:i,repeat:o,repeatType:r,repeatDelay:a,from:l,elapsed:c,...u}){return!!Object.keys(u).length}const en=(t,e,n,s={},i,o)=>r=>{const a=Ce(s,t)||{},l=a.delay||s.delay||0;let{elapsed:c=0}=s;c=c-K(l);let u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-c,onUpdate:d=>{e.set(d),a.onUpdate&&a.onUpdate(d)},onComplete:()=>{r(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:o?void 0:i};Ga(a)||(u={...u,...za(t,u)}),u.duration&&(u.duration=K(u.duration)),u.repeatDelay&&(u.repeatDelay=K(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let h=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(u.duration=0,u.delay===0&&(h=!0)),h&&!o&&e.get()!==void 0){const d=Zt(u.keyframes,a);if(d!==void 0)return V.update(()=>{u.onUpdate(d),u.onComplete()}),new ho([])}return!o&&Xs.supports(u)?new Xs(u):new tn(u)};function Ha({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,s}function Qs(t,e,{delay:n=0,transitionOverride:s,type:i}={}){var o;let{transition:r=t.getDefaultTransition(),transitionEnd:a,...l}=e;s&&(r=s);const c=[],u=i&&t.animationState&&t.animationState.getState()[i];for(const h in l){const d=t.getValue(h,(o=t.latestValues[h])!==null&&o!==void 0?o:null),p=l[h];if(p===void 0||u&&Ha(u,h))continue;const m={delay:n,...Ce(r||{},h)};let g=!1;if(window.MotionHandoffAnimation){const y=ls(t);if(y){const b=window.MotionHandoffAnimation(y,h,V);b!==null&&(m.startTime=b,g=!0)}}Ie(t,h),d.start(en(h,d,p,t.shouldReduceMotion&&rs.has(h)?{type:!1}:m,t,g));const v=d.animation;v&&c.push(v)}return a&&Promise.all(c).then(()=>{V.update(()=>{a&&Co(t,a)})}),c}function nn(t,e,n={}){var s;const i=Yt(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(Qs(t,i,n)):()=>Promise.resolve(),a=t.variantChildren&&t.variantChildren.size?(c=0)=>{const{delayChildren:u=0,staggerChildren:h,staggerDirection:d}=o;return qa(t,e,u+c,h,d,n)}:()=>Promise.resolve(),{when:l}=o;if(l){const[c,u]=l==="beforeChildren"?[r,a]:[a,r];return c().then(()=>u())}else return Promise.all([r(),a(n.delay)])}function qa(t,e,n=0,s=0,i=1,o){const r=[],a=(t.variantChildren.size-1)*s,l=i===1?(c=0)=>c*s:(c=0)=>a-c*s;return Array.from(t.variantChildren).sort(Ya).forEach((c,u)=>{c.notify("AnimationStart",e),r.push(nn(c,e,{...o,delay:n+l(u)}).then(()=>c.notify("AnimationComplete",e)))}),Promise.all(r)}function Ya(t,e){return t.sortNodePosition(e)}function Xa(t,e,n={}){t.notify("AnimationStart",e);let s;if(Array.isArray(e)){const i=e.map(o=>nn(t,o,n));s=Promise.all(i)}else if(typeof e=="string")s=nn(t,e,n);else{const i=typeof e=="function"?Yt(t,e,n.custom):e;s=Promise.all(Qs(t,i,n))}return s.then(()=>{t.notify("AnimationComplete",e)})}const Qa=fe.length;function Zs(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?Zs(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<Qa;n++){const s=fe[n],i=t.props[s];(St(i)||i===!1)&&(e[s]=i)}return e}const Za=[...de].reverse(),Ja=de.length;function tl(t){return e=>Promise.all(e.map(({animation:n,options:s})=>Xa(t,n,s)))}function el(t){let e=tl(t),n=Js(),s=!0;const i=l=>(c,u)=>{var h;const d=Yt(t,u,l==="exit"?(h=t.presenceContext)===null||h===void 0?void 0:h.custom:void 0);if(d){const{transition:p,transitionEnd:m,...g}=d;c={...c,...g,...m}}return c};function o(l){e=l(t)}function r(l){const{props:c}=t,u=Zs(t.parent)||{},h=[],d=new Set;let p={},m=1/0;for(let v=0;v<Ja;v++){const y=Za[v],b=n[y],T=c[y]!==void 0?c[y]:u[y],A=St(T),S=y===l?b.isActive:null;S===!1&&(m=v);let C=T===u[y]&&T!==c[y]&&A;if(C&&s&&t.manuallyAnimateOnMount&&(C=!1),b.protectedKeys={...p},!b.isActive&&S===null||!T&&!b.prevProp||Kt(T)||typeof T=="boolean")continue;const E=nl(b.prevProp,T);let P=E||y===l&&b.isActive&&!C&&A||v>m&&A,O=!1;const _=Array.isArray(T)?T:[T];let xt=_.reduce(i(y),{});S===!1&&(xt={});const{prevResolvedValues:ur={}}=b,yu={...ur,...xt},hr=I=>{P=!0,d.has(I)&&(O=!0,d.delete(I)),b.needsAnimating[I]=!0;const X=t.getValue(I);X&&(X.liveStyle=!1)};for(const I in yu){const X=xt[I],gn=ur[I];if(p.hasOwnProperty(I))continue;let yn=!1;ve(X)&&ve(gn)?yn=!Hn(X,gn):yn=X!==gn,yn?X!=null?hr(I):d.add(I):X!==void 0&&d.has(I)?hr(I):b.protectedKeys[I]=!0}b.prevProp=T,b.prevResolvedValues=xt,b.isActive&&(p={...p,...xt}),s&&t.blockInitialAnimation&&(P=!1),P&&(!(C&&E)||O)&&h.push(..._.map(I=>({animation:I,options:{type:y}})))}if(d.size){const v={};d.forEach(y=>{const b=t.getBaseTarget(y),T=t.getValue(y);T&&(T.liveStyle=!0),v[y]=b??null}),h.push({animation:v})}let g=!!h.length;return s&&(c.initial===!1||c.initial===c.animate)&&!t.manuallyAnimateOnMount&&(g=!1),s=!1,g?e(h):Promise.resolve()}function a(l,c){var u;if(n[l].isActive===c)return Promise.resolve();(u=t.variantChildren)===null||u===void 0||u.forEach(d=>{var p;return(p=d.animationState)===null||p===void 0?void 0:p.setActive(l,c)}),n[l].isActive=c;const h=r(l);for(const d in n)n[d].protectedKeys={};return h}return{animateChanges:r,setActive:a,setAnimateFunction:o,getState:()=>n,reset:()=>{n=Js(),s=!0}}}function nl(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!Hn(e,t):!1}function rt(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Js(){return{animate:rt(!0),whileInView:rt(),whileHover:rt(),whileTap:rt(),whileDrag:rt(),whileFocus:rt(),exit:rt()}}class et{constructor(e){this.isMounted=!1,this.node=e}update(){}}class sl extends et{constructor(e){super(e),e.animationState||(e.animationState=el(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();Kt(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:n}=this.node.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){var e;this.node.animationState.reset(),(e=this.unmountControls)===null||e===void 0||e.call(this)}}let il=0;class rl extends et{constructor(){super(...arguments),this.id=il++}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 ol={animation:{Feature:sl},exit:{Feature:rl}};function kt(t,e,n,s={passive:!0}){return t.addEventListener(e,n,s),()=>t.removeEventListener(e,n)}function Et(t){return{point:{x:t.pageX,y:t.pageY}}}const al=t=>e=>Ee(e)&&t(e,Et(e));function Lt(t,e,n,s){return kt(t,e,al(n),s)}const ti=(t,e)=>Math.abs(t-e);function ll(t,e){const n=ti(t.x,e.x),s=ti(t.y,e.y);return Math.sqrt(n**2+s**2)}class ei{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=rn(this.lastMoveEventInfo,this.history),d=this.startEvent!==null,p=ll(h.offset,{x:0,y:0})>=3;if(!d&&!p)return;const{point:m}=h,{timestamp:g}=L;this.history.push({...m,timestamp:g});const{onStart:v,onMove:y}=this.handlers;d||(v&&v(this.lastMoveEvent,h),this.startEvent=this.lastMoveEvent),y&&y(this.lastMoveEvent,h)},this.handlePointerMove=(h,d)=>{this.lastMoveEvent=h,this.lastMoveEventInfo=sn(d,this.transformPagePoint),V.update(this.updatePoint,!0)},this.handlePointerUp=(h,d)=>{this.end();const{onEnd:p,onSessionEnd:m,resumeAnimation:g}=this.handlers;if(this.dragSnapToOrigin&&g&&g(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const v=rn(h.type==="pointercancel"?this.lastMoveEventInfo:sn(d,this.transformPagePoint),this.history);this.startEvent&&p&&p(h,v),m&&m(h,v)},!Ee(e))return;this.dragSnapToOrigin=o,this.handlers=n,this.transformPagePoint=s,this.contextWindow=i||window;const r=Et(e),a=sn(r,this.transformPagePoint),{point:l}=a,{timestamp:c}=L;this.history=[{...l,timestamp:c}];const{onSessionStart:u}=n;u&&u(e,rn(a,this.history)),this.removeListeners=Dt(Lt(this.contextWindow,"pointermove",this.handlePointerMove),Lt(this.contextWindow,"pointerup",this.handlePointerUp),Lt(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),Z(this.updatePoint)}}function sn(t,e){return e?{point:e(t.point)}:t}function ni(t,e){return{x:t.x-e.x,y:t.y-e.y}}function rn({point:t},e){return{point:t,delta:ni(t,si(e)),offset:ni(t,cl(e)),velocity:ul(e,.1)}}function cl(t){return t[0]}function si(t){return t[t.length-1]}function ul(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,s=null;const i=si(t);for(;n>=0&&(s=t[n],!(i.timestamp-s.timestamp>K(e)));)n--;if(!s)return{x:0,y:0};const o=q(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}const ii=1e-4,hl=1-ii,dl=1+ii,ri=.01,fl=0-ri,pl=0+ri;function N(t){return t.max-t.min}function ml(t,e,n){return Math.abs(t-e)<=n}function oi(t,e,n,s=.5){t.origin=s,t.originPoint=M(e.min,e.max,t.origin),t.scale=N(n)/N(e),t.translate=M(n.min,n.max,t.origin)-t.originPoint,(t.scale>=hl&&t.scale<=dl||isNaN(t.scale))&&(t.scale=1),(t.translate>=fl&&t.translate<=pl||isNaN(t.translate))&&(t.translate=0)}function Ft(t,e,n,s){oi(t.x,e.x,n.x,s?s.originX:void 0),oi(t.y,e.y,n.y,s?s.originY:void 0)}function ai(t,e,n){t.min=n.min+e.min,t.max=t.min+N(e)}function gl(t,e,n){ai(t.x,e.x,n.x),ai(t.y,e.y,n.y)}function li(t,e,n){t.min=e.min-n.min,t.max=t.min+N(e)}function Bt(t,e,n){li(t.x,e.x,n.x),li(t.y,e.y,n.y)}function yl(t,{min:e,max:n},s){return e!==void 0&&t<e?t=s?M(e,t,s.min):Math.max(t,e):n!==void 0&&t>n&&(t=s?M(n,t,s.max):Math.min(t,n)),t}function ci(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 vl(t,{top:e,left:n,bottom:s,right:i}){return{x:ci(t.x,n,i),y:ci(t.y,e,s)}}function ui(t,e){let n=e.min-t.min,s=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,s]=[s,n]),{min:n,max:s}}function xl(t,e){return{x:ui(t.x,e.x),y:ui(t.y,e.y)}}function Sl(t,e){let n=.5;const s=N(t),i=N(e);return i>s?n=ct(e.min,e.max-s,t.min):s>i&&(n=ct(t.min,t.max-i,e.min)),Y(0,1,n)}function bl(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 on=.35;function Tl(t=on){return t===!1?t=0:t===!0&&(t=on),{x:hi(t,"left","right"),y:hi(t,"top","bottom")}}function hi(t,e,n){return{min:di(t,e),max:di(t,n)}}function di(t,e){return typeof t=="number"?t:t[e]||0}const fi=()=>({translate:0,scale:1,origin:0,originPoint:0}),gt=()=>({x:fi(),y:fi()}),pi=()=>({min:0,max:0}),k=()=>({x:pi(),y:pi()});function U(t){return[t("x"),t("y")]}function mi({top:t,left:e,right:n,bottom:s}){return{x:{min:e,max:n},y:{min:t,max:s}}}function wl({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function Pl(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 an(t){return t===void 0||t===1}function ln({scale:t,scaleX:e,scaleY:n}){return!an(t)||!an(e)||!an(n)}function ot(t){return ln(t)||gi(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function gi(t){return yi(t.x)||yi(t.y)}function yi(t){return t&&t!=="0%"}function ne(t,e,n){const s=t-n,i=e*s;return n+i}function vi(t,e,n,s,i){return i!==void 0&&(t=ne(t,i,s)),ne(t,n,s)+e}function cn(t,e=0,n=1,s,i){t.min=vi(t.min,e,n,s,i),t.max=vi(t.max,e,n,s,i)}function xi(t,{x:e,y:n}){cn(t.x,e.translate,e.scale,e.originPoint),cn(t.y,n.translate,n.scale,n.originPoint)}const Si=.999999999999,bi=1.0000000000001;function Al(t,e,n,s=!1){const i=n.length;if(!i)return;e.x=e.y=1;let o,r;for(let a=0;a<i;a++){o=n[a],r=o.projectionDelta;const{visualElement:l}=o.options;l&&l.props.style&&l.props.style.display==="contents"||(s&&o.options.layoutScroll&&o.scroll&&o!==o.root&&vt(t,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),r&&(e.x*=r.x.scale,e.y*=r.y.scale,xi(t,r)),s&&ot(o.latestValues)&&vt(t,o.latestValues))}e.x<bi&&e.x>Si&&(e.x=1),e.y<bi&&e.y>Si&&(e.y=1)}function yt(t,e){t.min=t.min+e,t.max=t.max+e}function Ti(t,e,n,s,i=.5){const o=M(t.min,t.max,i);cn(t,e,n,o,s)}function vt(t,e){Ti(t.x,e.x,e.scaleX,e.scale,e.originX),Ti(t.y,e.y,e.scaleY,e.scale,e.originY)}function wi(t,e){return mi(Pl(t.getBoundingClientRect(),e))}function Cl(t,e,n){const s=wi(t,n),{scroll:i}=e;return i&&(yt(s.x,i.offset.x),yt(s.y,i.offset.y)),s}const Pi=({current:t})=>t?t.ownerDocument.defaultView:null,Vl=new WeakMap;class Ml{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=k(),this.visualElement=e}start(e,{snapToCursor:n=!1}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const i=u=>{const{dragSnapToOrigin:h}=this.getProps();h?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(Et(u).point)},o=(u,h)=>{const{drag:d,dragPropagation:p,onDragStart:m}=this.getProps();if(d&&!p&&(this.openDragLock&&this.openDragLock(),this.openDragLock=bo(d),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),U(v=>{let y=this.getAxisMotionValue(v).get()||0;if(z.test(y)){const{projection:b}=this.visualElement;if(b&&b.layout){const T=b.layout.layoutBox[v];T&&(y=N(T)*(parseFloat(y)/100))}}this.originPoint[v]=y}),m&&V.postRender(()=>m(u,h)),Ie(this.visualElement,"transform");const{animationState:g}=this.visualElement;g&&g.setActive("whileDrag",!0)},r=(u,h)=>{const{dragPropagation:d,dragDirectionLock:p,onDirectionLock:m,onDrag:g}=this.getProps();if(!d&&!this.openDragLock)return;const{offset:v}=h;if(p&&this.currentDirection===null){this.currentDirection=Dl(v),this.currentDirection!==null&&m&&m(this.currentDirection);return}this.updateAxis("x",h.point,v),this.updateAxis("y",h.point,v),this.visualElement.render(),g&&g(u,h)},a=(u,h)=>this.stop(u,h),l=()=>U(u=>{var h;return this.getAnimationState(u)==="paused"&&((h=this.getAxisMotionValue(u).animation)===null||h===void 0?void 0:h.play())}),{dragSnapToOrigin:c}=this.getProps();this.panSession=new ei(e,{onSessionStart:i,onStart:o,onMove:r,onSessionEnd:a,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,contextWindow:Pi(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&&V.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.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(e,n,s){const{drag:i}=this.getProps();if(!s||!se(e,i,this.currentDirection))return;const o=this.getAxisMotionValue(e);let r=this.originPoint[e]+s[e];this.constraints&&this.constraints[e]&&(r=yl(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&&ht(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&i?this.constraints=vl(i.layoutBox,n):this.constraints=!1,this.elastic=Tl(s),o!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&U(r=>{this.constraints!==!1&&this.getAxisMotionValue(r)&&(this.constraints[r]=bl(i.layoutBox[r],this.constraints[r]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!ht(e))return!1;const s=e.current;Q(s!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");const{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const o=Cl(s,i.root,this.visualElement.getTransformPagePoint());let r=xl(i.layout.layoutBox,o);if(n){const a=n(wl(r));this.hasMutatedConstraints=!!a,a&&(r=mi(a))}return r}startAnimation(e){const{drag:n,dragMomentum:s,dragElastic:i,dragTransition:o,dragSnapToOrigin:r,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},c=U(u=>{if(!se(u,n,this.currentDirection))return;let h=l&&l[u]||{};r&&(h={min:0,max:0});const d=i?200:1e6,p=i?40:1e7,m={type:"inertia",velocity:s?e[u]:0,bounceStiffness:d,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...o,...h};return this.startAxisValueAnimation(u,m)});return Promise.all(c).then(a)}startAxisValueAnimation(e,n){const s=this.getAxisMotionValue(e);return Ie(this.visualElement,e),s.start(en(e,s,0,n,this.visualElement,!1))}stopAnimation(){U(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){U(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){U(n=>{const{drag:s}=this.getProps();if(!se(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]-M(r,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:s}=this.visualElement;if(!ht(n)||!s||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};U(r=>{const a=this.getAxisMotionValue(r);if(a&&this.constraints!==!1){const l=a.get();i[r]=Sl({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(),U(r=>{if(!se(r,e,null))return;const a=this.getAxisMotionValue(r),{min:l,max:c}=this.constraints[r];a.set(M(l,c,i[r]))})}addListeners(){if(!this.visualElement.current)return;Vl.set(this.visualElement,this);const e=this.visualElement.current,n=Lt(e,"pointerdown",l=>{const{drag:c,dragListener:u=!0}=this.getProps();c&&u&&this.start(l)}),s=()=>{const{dragConstraints:l}=this.getProps();ht(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,o=i.addEventListener("measure",s);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),V.read(s);const r=kt(window,"resize",()=>this.scalePositionWithinConstraints()),a=i.addEventListener("didUpdate",(({delta:l,hasLayoutChanged:c})=>{this.isDragging&&c&&(U(u=>{const h=this.getAxisMotionValue(u);h&&(this.originPoint[u]+=l[u].translate,h.set(h.get()+l[u].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=on,dragMomentum:a=!0}=e;return{...e,drag:n,dragDirectionLock:s,dragPropagation:i,dragConstraints:o,dragElastic:r,dragMomentum:a}}}function se(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function Dl(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class kl extends et{constructor(e){super(e),this.removeGroupControls=j,this.removeListeners=j,this.controls=new Ml(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||j}unmount(){this.removeGroupControls(),this.removeListeners()}}const Ai=t=>(e,n)=>{t&&V.postRender(()=>t(e,n))};class El extends et{constructor(){super(...arguments),this.removePointerDownListener=j}onPointerDown(e){this.session=new ei(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Pi(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:s,onPanEnd:i}=this.node.getProps();return{onSessionStart:Ai(e),onStart:Ai(n),onMove:s,onEnd:(o,r)=>{delete this.session,i&&V.postRender(()=>i(o,r))}}}mount(){this.removePointerDownListener=Lt(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const ie={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Ci(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Ot={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(w.test(t))t=parseFloat(t);else return t;const n=Ci(t,e.target.x),s=Ci(t,e.target.y);return`${n}% ${s}%`}},Ll={correct:(t,{treeScale:e,projectionDelta:n})=>{const s=t,i=tt.parse(t);if(i.length>5)return s;const o=tt.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 c=M(a,l,.5);return typeof i[2+r]=="number"&&(i[2+r]/=c),typeof i[3+r]=="number"&&(i[3+r]/=c),o(i)}};class Fl extends x.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:s,layoutId:i}=this.props,{projection:o}=e;Jr(Bl),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()})),ie.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()||V.postRender(()=>{const a=r.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),me.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 Vi(t){const[e,n]=vn(),s=x.useContext(oe);return f.jsx(Fl,{...t,layoutGroup:s,switchLayoutGroup:x.useContext(Dn),isPresent:e,safeToRemove:n})}const Bl={borderRadius:{...Ot,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Ot,borderTopRightRadius:Ot,borderBottomLeftRadius:Ot,borderBottomRightRadius:Ot,boxShadow:Ll};function Ol(t,e,n){const s=F(t)?t:At(t);return s.start(en("",s,e,n)),s.animation}function Il(t){return t instanceof SVGElement&&t.tagName!=="svg"}const jl=(t,e)=>t.depth-e.depth;class Nl{constructor(){this.children=[],this.isDirty=!1}add(e){Fe(this.children,e),this.isDirty=!0}remove(e){Be(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(jl),this.isDirty=!1,this.children.forEach(e)}}function Wl(t,e){const n=G.now(),s=({timestamp:i})=>{const o=i-n;o>=e&&(Z(s),t(o-e))};return V.read(s,!0),()=>Z(s)}const Mi=["TopLeft","TopRight","BottomLeft","BottomRight"],Ul=Mi.length,Di=t=>typeof t=="string"?parseFloat(t):t,ki=t=>typeof t=="number"||w.test(t);function $l(t,e,n,s,i,o){i?(t.opacity=M(0,n.opacity!==void 0?n.opacity:1,_l(s)),t.opacityExit=M(e.opacity!==void 0?e.opacity:1,0,Rl(s))):o&&(t.opacity=M(e.opacity!==void 0?e.opacity:1,n.opacity!==void 0?n.opacity:1,s));for(let r=0;r<Ul;r++){const a=`border${Mi[r]}Radius`;let l=Ei(e,a),c=Ei(n,a);if(l===void 0&&c===void 0)continue;l||(l=0),c||(c=0),l===0||c===0||ki(l)===ki(c)?(t[a]=Math.max(M(Di(l),Di(c),s),0),(z.test(c)||z.test(l))&&(t[a]+="%")):t[a]=c}(e.rotate||n.rotate)&&(t.rotate=M(e.rotate||0,n.rotate||0,s))}function Ei(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const _l=Li(0,.5,ms),Rl=Li(.5,.95,j);function Li(t,e,n){return s=>s<t?0:s>e?1:n(ct(t,e,s))}function Fi(t,e){t.min=e.min,t.max=e.max}function $(t,e){Fi(t.x,e.x),Fi(t.y,e.y)}function Bi(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function Oi(t,e,n,s,i){return t-=e,t=ne(t,1/n,s),i!==void 0&&(t=ne(t,1/i,s)),t}function Kl(t,e=0,n=1,s=.5,i,o=t,r=t){if(z.test(e)&&(e=parseFloat(e),e=M(r.min,r.max,e/100)-r.min),typeof e!="number")return;let a=M(o.min,o.max,s);t===o&&(a-=e),t.min=Oi(t.min,e,n,a,i),t.max=Oi(t.max,e,n,a,i)}function Ii(t,e,[n,s,i],o,r){Kl(t,e[n],e[s],e[i],e.scale,o,r)}const zl=["x","scaleX","originX"],Gl=["y","scaleY","originY"];function ji(t,e,n,s){Ii(t.x,e,zl,n?n.x:void 0,s?s.x:void 0),Ii(t.y,e,Gl,n?n.y:void 0,s?s.y:void 0)}function Ni(t){return t.translate===0&&t.scale===1}function Wi(t){return Ni(t.x)&&Ni(t.y)}function Ui(t,e){return t.min===e.min&&t.max===e.max}function Hl(t,e){return Ui(t.x,e.x)&&Ui(t.y,e.y)}function $i(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function _i(t,e){return $i(t.x,e.x)&&$i(t.y,e.y)}function Ri(t){return N(t.x)/N(t.y)}function Ki(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}class ql{constructor(){this.members=[]}add(e){Fe(this.members,e),e.scheduleRender()}remove(e){if(Be(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 Yl(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:c,rotate:u,rotateX:h,rotateY:d,skewX:p,skewY:m}=n;c&&(s=`perspective(${c}px) ${s}`),u&&(s+=`rotate(${u}deg) `),h&&(s+=`rotateX(${h}deg) `),d&&(s+=`rotateY(${d}deg) `),p&&(s+=`skewX(${p}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 at={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},It=typeof window<"u"&&window.MotionDebug!==void 0,un=["","X","Y","Z"],Xl={visibility:"hidden"},zi=1e3;let Ql=0;function hn(t,e,n,s){const{latestValues:i}=e;i[t]&&(n[t]=i[t],e.setStaticValue(t,0),s&&(s[t]=0))}function Gi(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=ls(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:o}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",V,!(i||o))}const{parent:s}=t;s&&!s.hasCheckedOptimisedAppear&&Gi(s)}function Hi({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:s,resetTransform:i}){return class{constructor(r={},a=e==null?void 0:e()){this.id=Ql++,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,It&&(at.totalNodes=at.resolvedTargetDeltas=at.recalculatedProjection=0),this.nodes.forEach(tc),this.nodes.forEach(rc),this.nodes.forEach(oc),this.nodes.forEach(ec),It&&window.MotionDebug.record(at)},this.resolvedRelativeTargetAt=0,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;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new Nl)}addEventListener(r,a){return this.eventHandlers.has(r)||this.eventHandlers.set(r,new Oe),this.eventHandlers.get(r).add(a)}notifyListeners(r,...a){const l=this.eventHandlers.get(r);l&&l.notify(...a)}hasListeners(r){return this.eventHandlers.has(r)}mount(r,a=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=Il(r),this.instance=r;const{layoutId:l,layout:c,visualElement:u}=this.options;if(u&&!u.current&&u.mount(r),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),a&&(c||l)&&(this.isLayoutDirty=!0),t){let h;const d=()=>this.root.updateBlockedByResize=!1;t(r,()=>{this.root.updateBlockedByResize=!0,h&&h(),h=Wl(d,250),ie.hasAnimatedSinceResize&&(ie.hasAnimatedSinceResize=!1,this.nodes.forEach(Yi))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&u&&(l||c)&&this.addEventListener("didUpdate",({delta:h,hasLayoutChanged:d,hasRelativeTargetChanged:p,layout:m})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const g=this.options.transition||u.getDefaultTransition()||hc,{onLayoutAnimationStart:v,onLayoutAnimationComplete:y}=u.getProps(),b=!this.targetLayout||!_i(this.targetLayout,m)||p,T=!d&&p;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||T||d&&(b||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(h,T);const A={...Ce(g,"layout"),onPlay:v,onComplete:y};(u.shouldReduceMotion||this.options.layoutRoot)&&(A.delay=0,A.type=!1),this.startAnimation(A)}else d||Yi(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,Z(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(ac),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.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Gi(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const h=this.path[u];h.shouldResetTransform=!0,h.updateScroll("snapshot"),h.options.layoutRoot&&h.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const c=this.getTransformTemplate();this.prevTransformTemplateValue=c?c(this.latestValues,""):void 0,this.updateSnapshot(),r&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(qi);return}this.isUpdating||this.nodes.forEach(sc),this.isUpdating=!1,this.nodes.forEach(ic),this.nodes.forEach(Zl),this.nodes.forEach(Jl),this.clearAllSnapshots();const a=G.now();L.delta=Y(0,1e3/60,a-L.timestamp),L.timestamp=a,L.isProcessing=!0,he.update.process(L),he.preRender.process(L),he.render.process(L),L.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,me.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(nc),this.sharedNodes.forEach(lc)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,V.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){V.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<this.path.length;l++)this.path[l].updateScroll();const r=this.layout;this.layout=this.measure(!1),this.layoutCorrected=k(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,r?r.layoutBox:void 0)}updateScroll(r="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===r&&(a=!1),a){const l=s(this.instance);this.scroll={animationId:this.root.animationId,phase:r,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!i)return;const r=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!Wi(this.projectionDelta),l=this.getTransformTemplate(),c=l?l(this.latestValues,""):void 0,u=c!==this.prevTransformTemplateValue;r&&(a||ot(this.latestValues)||u)&&(i(this.instance,c),this.shouldResetTransform=!1,this.scheduleRender())}measure(r=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return r&&(l=this.removeTransform(l)),dc(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var r;const{visualElement:a}=this.options;if(!a)return k();const l=a.measureViewportBox();if(!(((r=this.scroll)===null||r===void 0?void 0:r.wasRoot)||this.path.some(fc))){const{scroll:u}=this.root;u&&(yt(l.x,u.offset.x),yt(l.y,u.offset.y))}return l}removeElementScroll(r){var a;const l=k();if($(l,r),!((a=this.scroll)===null||a===void 0)&&a.wasRoot)return l;for(let c=0;c<this.path.length;c++){const u=this.path[c],{scroll:h,options:d}=u;u!==this.root&&h&&d.layoutScroll&&(h.wasRoot&&$(l,r),yt(l.x,h.offset.x),yt(l.y,h.offset.y))}return l}applyTransform(r,a=!1){const l=k();$(l,r);for(let c=0;c<this.path.length;c++){const u=this.path[c];!a&&u.options.layoutScroll&&u.scroll&&u!==u.root&&vt(l,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),ot(u.latestValues)&&vt(l,u.latestValues)}return ot(this.latestValues)&&vt(l,this.latestValues),l}removeTransform(r){const a=k();$(a,r);for(let l=0;l<this.path.length;l++){const c=this.path[l];if(!c.instance||!ot(c.latestValues))continue;ln(c.latestValues)&&c.updateSnapshot();const u=k(),h=c.measurePageBox();$(u,h),ji(a,c.latestValues,c.snapshot?c.snapshot.layoutBox:void 0,u)}return ot(this.latestValues)&&ji(a,this.latestValues),a}setTargetDelta(r){this.targetDelta=r,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(r){this.options={...this.options,...r,crossfade:r.crossfade!==void 0?r.crossfade:!0}}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!==L.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(r=!1){var a;const l=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=l.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=l.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=l.isSharedProjectionDirty);const c=!!this.resumingFrom||this!==l;if(!(r||c&&this.isSharedProjectionDirty||this.isProjectionDirty||!((a=this.parent)===null||a===void 0)&&a.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:h,layoutId:d}=this.options;if(!(!this.layout||!(h||d))){if(this.resolvedRelativeTargetAt=L.timestamp,!this.targetDelta&&!this.relativeTarget){const p=this.getClosestProjectingParent();p&&p.layout&&this.animationProgress!==1?(this.relativeParent=p,this.forceRelativeParentToResolveTarget(),this.relativeTarget=k(),this.relativeTargetOrigin=k(),Bt(this.relativeTargetOrigin,this.layout.layoutBox,p.layout.layoutBox),$(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=k(),this.targetWithTransforms=k()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),gl(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):$(this.target,this.layout.layoutBox),xi(this.target,this.targetDelta)):$(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const p=this.getClosestProjectingParent();p&&!!p.resumingFrom==!!this.resumingFrom&&!p.options.layoutScroll&&p.target&&this.animationProgress!==1?(this.relativeParent=p,this.forceRelativeParentToResolveTarget(),this.relativeTarget=k(),this.relativeTargetOrigin=k(),Bt(this.relativeTargetOrigin,this.target,p.target),$(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}It&&at.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||ln(this.parent.latestValues)||gi(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var r;const a=this.getLead(),l=!!this.resumingFrom||this!==a;let c=!0;if((this.isProjectionDirty||!((r=this.parent)===null||r===void 0)&&r.isProjectionDirty)&&(c=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===L.timestamp&&(c=!1),c)return;const{layout:u,layoutId:h}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||h))return;$(this.layoutCorrected,this.layout.layoutBox);const d=this.treeScale.x,p=this.treeScale.y;Al(this.layoutCorrected,this.treeScale,this.path,l),a.layout&&!a.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(a.target=a.layout.layoutBox,a.targetWithTransforms=k());const{target:m}=a;if(!m){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Bi(this.prevProjectionDelta.x,this.projectionDelta.x),Bi(this.prevProjectionDelta.y,this.projectionDelta.y)),Ft(this.projectionDelta,this.layoutCorrected,m,this.latestValues),(this.treeScale.x!==d||this.treeScale.y!==p||!Ki(this.projectionDelta.x,this.prevProjectionDelta.x)||!Ki(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",m)),It&&at.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(r=!0){var a;if((a=this.options.visualElement)===null||a===void 0||a.scheduleRender(),r){const l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=gt(),this.projectionDelta=gt(),this.projectionDeltaWithTransform=gt()}setAnimationOrigin(r,a=!1){const l=this.snapshot,c=l?l.latestValues:{},u={...this.latestValues},h=gt();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const d=k(),p=l?l.source:void 0,m=this.layout?this.layout.source:void 0,g=p!==m,v=this.getStack(),y=!v||v.members.length<=1,b=!!(g&&!y&&this.options.crossfade===!0&&!this.path.some(uc));this.animationProgress=0;let T;this.mixTargetDelta=A=>{const S=A/1e3;Xi(h.x,r.x,S),Xi(h.y,r.y,S),this.setTargetDelta(h),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Bt(d,this.layout.layoutBox,this.relativeParent.layout.layoutBox),cc(this.relativeTarget,this.relativeTargetOrigin,d,S),T&&Hl(this.relativeTarget,T)&&(this.isProjectionDirty=!1),T||(T=k()),$(T,this.relativeTarget)),g&&(this.animationValues=u,$l(u,c,this.latestValues,S,b,y)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=S},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&&(Z(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=V.update(()=>{ie.hasAnimatedSinceResize=!0,this.currentAnimation=Ol(0,zi,{...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(zi),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const r=this.getLead();let{targetWithTransforms:a,target:l,layout:c,latestValues:u}=r;if(!(!a||!l||!c)){if(this!==r&&this.layout&&c&&er(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||k();const h=N(this.layout.layoutBox.x);l.x.min=r.target.x.min,l.x.max=l.x.min+h;const d=N(this.layout.layoutBox.y);l.y.min=r.target.y.min,l.y.max=l.y.min+d}$(a,l),vt(a,u),Ft(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(r,a){this.sharedNodes.has(r)||this.sharedNodes.set(r,new ql),this.sharedNodes.get(r).add(a);const c=a.options.initialPromotionConfig;a.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.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 c=this.getStack();c&&c.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 c={};l.z&&hn("z",r,c,this.animationValues);for(let u=0;u<un.length;u++)hn(`rotate${un[u]}`,r,c,this.animationValues),hn(`skew${un[u]}`,r,c,this.animationValues);r.render();for(const u in c)r.setStaticValue(u,c[u]),this.animationValues&&(this.animationValues[u]=c[u]);r.scheduleRender()}getProjectionStyles(r){var a,l;if(!this.instance||this.isSVG)return;if(!this.isVisible)return Xl;const c={visibility:""},u=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,c.opacity="",c.pointerEvents=Gt(r==null?void 0:r.pointerEvents)||"",c.transform=u?u(this.latestValues,""):"none",c;const h=this.getLead();if(!this.projectionDelta||!this.layout||!h.target){const g={};return this.options.layoutId&&(g.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,g.pointerEvents=Gt(r==null?void 0:r.pointerEvents)||""),this.hasProjected&&!ot(this.latestValues)&&(g.transform=u?u({},""):"none",this.hasProjected=!1),g}const d=h.animationValues||h.latestValues;this.applyTransformsToTarget(),c.transform=Yl(this.projectionDeltaWithTransform,this.treeScale,d),u&&(c.transform=u(d,c.transform));const{x:p,y:m}=this.projectionDelta;c.transformOrigin=`${p.origin*100}% ${m.origin*100}% 0`,h.animationValues?c.opacity=h===this?(l=(a=d.opacity)!==null&&a!==void 0?a:this.latestValues.opacity)!==null&&l!==void 0?l:1:this.preserveOpacity?this.latestValues.opacity:d.opacityExit:c.opacity=h===this?d.opacity!==void 0?d.opacity:"":d.opacityExit!==void 0?d.opacityExit:0;for(const g in qt){if(d[g]===void 0)continue;const{correct:v,applyTo:y}=qt[g],b=c.transform==="none"?d[g]:v(d[g],h);if(y){const T=y.length;for(let A=0;A<T;A++)c[y[A]]=b}else c[g]=b}return this.options.layoutId&&(c.pointerEvents=h===this?Gt(r==null?void 0:r.pointerEvents)||"":"none"),c}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(r=>{var a;return(a=r.currentAnimation)===null||a===void 0?void 0:a.stop()}),this.root.nodes.forEach(qi),this.root.sharedNodes.clear()}}}function Zl(t){t.updateLayout()}function Jl(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"?U(h=>{const d=r?n.measuredBox[h]:n.layoutBox[h],p=N(d);d.min=s[h].min,d.max=d.min+p}):er(o,n.layoutBox,s)&&U(h=>{const d=r?n.measuredBox[h]:n.layoutBox[h],p=N(s[h]);d.max=d.min+p,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[h].max=t.relativeTarget[h].min+p)});const a=gt();Ft(a,s,n.layoutBox);const l=gt();r?Ft(l,t.applyTransform(i,!0),n.measuredBox):Ft(l,s,n.layoutBox);const c=!Wi(a);let u=!1;if(!t.resumeFrom){const h=t.getClosestProjectingParent();if(h&&!h.resumeFrom){const{snapshot:d,layout:p}=h;if(d&&p){const m=k();Bt(m,n.layoutBox,d.layoutBox);const g=k();Bt(g,s,p.layoutBox),_i(m,g)||(u=!0),h.options.layoutRoot&&(t.relativeTarget=g,t.relativeTargetOrigin=m,t.relativeParent=h)}}}t.notifyListeners("didUpdate",{layout:s,snapshot:n,delta:l,layoutDelta:a,hasLayoutChanged:c,hasRelativeTargetChanged:u})}else if(t.isLead()){const{onExitComplete:s}=t.options;s&&s()}t.options.transition=void 0}function tc(t){It&&at.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 ec(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function nc(t){t.clearSnapshot()}function qi(t){t.clearMeasurements()}function sc(t){t.isLayoutDirty=!1}function ic(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Yi(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function rc(t){t.resolveTargetDelta()}function oc(t){t.calcProjection()}function ac(t){t.resetSkewAndRotation()}function lc(t){t.removeLeadSnapshot()}function Xi(t,e,n){t.translate=M(e.translate,0,n),t.scale=M(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function Qi(t,e,n,s){t.min=M(e.min,n.min,s),t.max=M(e.max,n.max,s)}function cc(t,e,n,s){Qi(t.x,e.x,n.x,s),Qi(t.y,e.y,n.y,s)}function uc(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const hc={duration:.45,ease:[.4,0,.1,1]},Zi=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Ji=Zi("applewebkit/")&&!Zi("chrome/")?Math.round:j;function tr(t){t.min=Ji(t.min),t.max=Ji(t.max)}function dc(t){tr(t.x),tr(t.y)}function er(t,e,n){return t==="position"||t==="preserve-aspect"&&!ml(Ri(e),Ri(n),.2)}function fc(t){var e;return t!==t.root&&((e=t.scroll)===null||e===void 0?void 0:e.wasRoot)}const pc=Hi({attachResizeListener:(t,e)=>kt(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),dn={current:void 0},nr=Hi({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!dn.current){const t=new pc({});t.mount(window),t.setOptions({layoutScroll:!0}),dn.current=t}return dn.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),mc={pan:{Feature:El},drag:{Feature:kl,ProjectionNode:nr,MeasureLayout:Vi}};function sr(t,e,n){const{props:s}=t;t.animationState&&s.whileHover&&t.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,o=s[i];o&&V.postRender(()=>o(e,Et(e)))}class gc extends et{mount(){const{current:e}=this.node;e&&(this.unmount=go(e,n=>(sr(this.node,n,"Start"),s=>sr(this.node,s,"End"))))}unmount(){}}class yc extends et{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=Dt(kt(this.node.current,"focus",()=>this.onFocus()),kt(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function ir(t,e,n){const{props:s}=t;t.animationState&&s.whileTap&&t.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),o=s[i];o&&V.postRender(()=>o(e,Et(e)))}class vc extends et{mount(){const{current:e}=this.node;e&&(this.unmount=So(e,n=>(ir(this.node,n,"Start"),(s,{success:i})=>ir(this.node,s,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const fn=new WeakMap,pn=new WeakMap,xc=t=>{const e=fn.get(t.target);e&&e(t)},Sc=t=>{t.forEach(xc)};function bc({root:t,...e}){const n=t||document;pn.has(n)||pn.set(n,{});const s=pn.get(n),i=JSON.stringify(e);return s[i]||(s[i]=new IntersectionObserver(Sc,{root:t,...e})),s[i]}function Tc(t,e,n){const s=bc(e);return fn.set(t,n),s.observe(t),()=>{fn.delete(t),s.unobserve(t)}}const wc={some:0,all:1};class Pc extends et{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:wc[i]},a=l=>{const{isIntersecting:c}=l;if(this.isInView===c||(this.isInView=c,o&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:u,onViewportLeave:h}=this.node.getProps(),d=c?u:h;d&&d(l)};return Tc(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(Ac(e,n))&&this.startObserver()}unmount(){}}function Ac({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const Cc={inView:{Feature:Pc},tap:{Feature:vc},focus:{Feature:yc},hover:{Feature:gc}},Vc={layout:{ProjectionNode:nr,MeasureLayout:Vi}},mn={current:null},rr={current:!1};function Mc(){if(rr.current=!0,!!ce)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>mn.current=t.matches;t.addListener(e),e()}else mn.current=!1}const Dc=[...Fs,B,tt],kc=t=>Dc.find(Ls(t)),or=new WeakMap;function Ec(t,e,n){for(const s in e){const i=e[s],o=n[s];if(F(i))t.addValue(s,i),process.env.NODE_ENV==="development"&&_t(i.version==="11.18.2",`Attempting to mix Motion versions ${i.version} with 11.18.2 may not work as expected.`);else if(F(o))t.addValue(s,At(i,{owner:t}));else if(o!==i)if(t.hasValue(s)){const r=t.getValue(s);r.liveStyle===!0?r.jump(i):r.hasAnimated||r.set(i)}else{const r=t.getStaticValue(s);t.addValue(s,At(r!==void 0?r:i,{owner:t}))}}for(const s in n)e[s]===void 0&&t.removeValue(s);return e}const ar=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Lc{scrapeMotionValuesFromProps(e,n,s){return{}}constructor({parent:e,props:n,presenceContext:s,reducedMotionConfig:i,blockInitialAnimation:o,visualState:r},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=He,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 p=G.now();this.renderScheduledAt<p&&(this.renderScheduledAt=p,V.render(this.render,!1,!0))};const{latestValues:l,renderState:c,onUpdate:u}=r;this.onUpdate=u,this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=c,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=zt(n),this.isVariantNode=Cn(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:h,...d}=this.scrapeMotionValuesFromProps(n,{},this);for(const p in d){const m=d[p];l[p]!==void 0&&F(m)&&m.set(l[p],!1)}}mount(e){this.current=e,or.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)),rr.current||Mc(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:mn.current,process.env.NODE_ENV!=="production"&&_t(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected."),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){or.delete(this.current),this.projection&&this.projection.unmount(),Z(this.notifyUpdate),Z(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const n=this.features[e];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(e,n){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();const s=nt.has(e),i=n.on("change",a=>{this.latestValues[e]=a,this.props.onUpdate&&V.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0)}),o=n.on("renderRequest",this.scheduleRender);let r;window.MotionCheckAppearSync&&(r=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{i(),o(),r&&r(),n.owner&&n.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in ut){const n=ut[e];if(!n)continue;const{isEnabled:s,Feature:i}=n;if(!this.features[e]&&i&&s(this.props)&&(this.features[e]=new i(this)),this.features[e]){const o=this.features[e];o.isMounted?o.update():(o.mount(),o.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):k()}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;s<ar.length;s++){const i=ar[s];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const o="on"+i,r=e[o];r&&(this.propEventSubscriptions[i]=this.on(i,r))}this.prevMotionValues=Ec(this,this.scrapeMotionValuesFromProps(e,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]: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(e){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(e),()=>n.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=At(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"&&(ks(i)||ys(i))?i=parseFloat(i):!kc(i)&&tt.test(n)&&(i=Ps(e,n)),this.setBaseTarget(e,F(i)?i.get():i)),F(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=ye(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&&!F(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 Oe),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}}class lr extends Lc{constructor(){super(...arguments),this.KeyframeResolver=Os}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]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;F(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function Fc(t){return window.getComputedStyle(t)}class Bc extends lr{constructor(){super(...arguments),this.type="html",this.renderInstance=Un}readValueFromInstance(e,n){if(nt.has(n)){const s=Ke(n);return s&&s.default||0}else{const s=Fc(e),i=(Bn(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:n}){return wi(e,n)}build(e,n,s){be(e,n,s.transformTemplate)}scrapeMotionValuesFromProps(e,n,s){return Ae(e,n,s)}}class Oc extends lr{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=k}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(nt.has(n)){const s=Ke(n);return s&&s.default||0}return n=$n.has(n)?n:pe(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,s){return Kn(e,n,s)}build(e,n,s){Te(e,n,this.isSVGTag,s.transformTemplate)}renderInstance(e,n,s,i){_n(e,n,s,i)}mount(e){this.isSVGTag=Pe(e.tagName),super.mount(e)}}const Ic=(t,e)=>ge(t)?new Oc(e):new Bc(e,{allowProjection:t!==x.Fragment}),jc=lo({...ol,...Cc,...mc,...Vc},Ic),W=Pr(jc),Nc={happy:{eyeShape:"normal",eyebrowShape:"normal",mouthShape:"smile",idleAnimation:{type:"breathe",duration:3},accessories:{},skinColor:"#FFD700"},sad:{eyeShape:"sad",eyebrowShape:"sad",mouthShape:"frown",idleAnimation:{type:"slow-breathe",duration:5},accessories:{tears:!0},skinColor:"#87CEEB"},angry:{eyeShape:"squint",eyebrowShape:"furrowed",mouthShape:"angry",idleAnimation:{type:"breathe",duration:2},accessories:{angerLines:!0},skinColor:"#FF6B6B"},mad:{eyeShape:"squint",eyebrowShape:"furrowed",mouthShape:"zigzag",idleAnimation:{type:"tremble",duration:.3},accessories:{angerLines:!0},skinColor:"#FF4500"},surprised:{eyeShape:"surprised",eyebrowShape:"raised",mouthShape:"surprised-o",idleAnimation:{type:"headBob",duration:1.5},accessories:{},skinColor:"#FFE4B5"},calm:{eyeShape:"closed",eyebrowShape:"normal",mouthShape:"smile",idleAnimation:{type:"breathe",duration:4},accessories:{},skinColor:"#98FB98"},sleepy:{eyeShape:"sleepy",eyebrowShape:"flat",mouthShape:"flat",idleAnimation:{type:"droop",duration:4},accessories:{zFloating:!0},skinColor:"#B0C4DE"},excited:{eyeShape:"wide",eyebrowShape:"lifted",mouthShape:"excited-open",idleAnimation:{type:"bounce",duration:.5},accessories:{sparkles:!0},skinColor:"#FFA500"},tired:{eyeShape:"sleepy",eyebrowShape:"sad",mouthShape:"tight",idleAnimation:{type:"slow-breathe",duration:6},accessories:{},skinColor:"#D3D3D3"},confused:{eyeShape:"normal",eyebrowShape:"asymmetric",mouthShape:"smirk",idleAnimation:{type:"headBob",duration:2},accessories:{questionMark:!0},skinColor:"#DDA0DD"},embarrassed:{eyeShape:"closed",eyebrowShape:"raised",mouthShape:"smile",idleAnimation:{type:"breathe",duration:3},accessories:{blush:!0},bodyTilt:5,skinColor:"#FFB6C1"},nervous:{eyeShape:"normal",eyebrowShape:"raised",mouthShape:"tight",idleAnimation:{type:"tremble",duration:.3},accessories:{sweatDrop:!0},skinColor:"#F0E68C"},proud:{eyeShape:"normal",eyebrowShape:"lifted",mouthShape:"smirk",idleAnimation:{type:"breathe",duration:3},accessories:{sparkles:!0},bodyTilt:-4,skinColor:"#FFD700"},disgusted:{eyeShape:"squint",eyebrowShape:"furrowed",mouthShape:"frown",idleAnimation:{type:"breathe",duration:3},accessories:{},skinColor:"#9ACD32"},bored:{eyeShape:"sleepy",eyebrowShape:"flat",mouthShape:"flat",idleAnimation:{type:"slow-breathe",duration:5},accessories:{},bodyTilt:6,skinColor:"#C0C0C0"},love:{eyeShape:"heart",eyebrowShape:"lifted",mouthShape:"smile",idleAnimation:{type:"pulse",duration:1},accessories:{heartsFloating:!0,blush:!0},skinColor:"#FF69B4"},silly:{eyeShape:"normal",eyebrowShape:"raised",mouthShape:"silly",idleAnimation:{type:"wiggle",duration:.8},accessories:{tongue:!0},skinColor:"#7FFF00"},determined:{eyeShape:"squint",eyebrowShape:"furrowed",mouthShape:"tight",idleAnimation:{type:"breathe",duration:2},accessories:{},bodyTilt:-2,skinColor:"#FF8C00"},shy:{eyeShape:"closed",eyebrowShape:"sad",mouthShape:"tight",idleAnimation:{type:"breathe",duration:3},accessories:{blush:!0},bodyTilt:8,skinColor:"#FFB6C1"},anxious:{eyeShape:"wide",eyebrowShape:"raised",mouthShape:"frown",idleAnimation:{type:"tremble",duration:.3},accessories:{sweatDrop:!0},skinColor:"#FFDAB9"}};function Wc({cx:t,cy:e,animated:n}){return f.jsxs("g",{className:n?"ef-eye-blink":"",style:{transformOrigin:`${t}px ${e}px`},children:[f.jsx("ellipse",{cx:t,cy:e,rx:9,ry:11,fill:"#333"}),f.jsx("circle",{cx:t+3,cy:e-3,r:2.5,fill:"white"})]})}function Uc({cx:t,cy:e}){return f.jsxs("g",{children:[f.jsx("ellipse",{cx:t,cy:e+2,rx:10,ry:5,fill:"#333"}),f.jsx("line",{x1:t-10,y1:e-3,x2:t+10,y2:e-3,stroke:"#333",strokeWidth:2.5,strokeLinecap:"round"})]})}function $c({cx:t,cy:e,animated:n}){return f.jsxs("g",{className:n?"ef-eye-blink":"",style:{transformOrigin:`${t}px ${e}px`},children:[f.jsx("circle",{cx:t,cy:e,r:13,fill:"#333"}),f.jsx("circle",{cx:t+4,cy:e-4,r:3.5,fill:"white"})]})}function _c({cx:t,cy:e,animated:n}){return f.jsxs("g",{className:n?"ef-eye-blink":"",style:{transformOrigin:`${t}px ${e}px`},children:[f.jsx("ellipse",{cx:t,cy:e+2,rx:9,ry:10,fill:"#333"}),f.jsx("circle",{cx:t+3,cy:e-2,r:2,fill:"white"})]})}function Rc({cx:t,cy:e}){return f.jsx("g",{children:f.jsx("path",{d:`M ${t} ${e+6} C ${t-10} ${e-2} ${t-14} ${e+8} ${t} ${e+14} C ${t+14} ${e+8} ${t+10} ${e-2} ${t} ${e+6} Z`,fill:"#FF4D6D",transform:"translate(0, -8)"})})}function Kc({cx:t,cy:e}){return f.jsx("g",{children:f.jsx("path",{d:`M ${t-10} ${e} Q ${t} ${e-6} ${t+10} ${e}`,stroke:"#333",strokeWidth:3,fill:"none",strokeLinecap:"round"})})}function zc({cx:t,cy:e,animated:n}){return f.jsxs("g",{className:n?"ef-eye-blink":"",style:{transformOrigin:`${t}px ${e}px`},children:[f.jsx("ellipse",{cx:t,cy:e+3,rx:9,ry:6,fill:"#333"}),f.jsx("line",{x1:t-9,y1:e-3,x2:t+9,y2:e-3,stroke:"#333",strokeWidth:2.5,strokeLinecap:"round"})]})}function Gc({cx:t,cy:e,animated:n}){return f.jsxs("g",{className:n?"ef-eye-blink":"",style:{transformOrigin:`${t}px ${e}px`},children:[f.jsx("circle",{cx:t,cy:e,r:12,fill:"white",stroke:"#333",strokeWidth:2}),f.jsx("circle",{cx:t,cy:e,r:8,fill:"#333"}),f.jsx("circle",{cx:t+3,cy:e-3,r:2.5,fill:"white"})]})}function Hc({shape:t,animated:e}){const n=[{cx:72,cy:82},{cx:128,cy:82}];return f.jsx(Wt,{mode:"wait",children:f.jsx(W.g,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},children:n.map(({cx:s,cy:i},o)=>{switch(t){case"sleepy":return f.jsx(Uc,{cx:s,cy:i},o);case"surprised":return f.jsx($c,{cx:s,cy:i,animated:e},o);case"sad":return f.jsx(_c,{cx:s,cy:i,animated:e},o);case"heart":return f.jsx(Rc,{cx:s,cy:i},o);case"closed":return f.jsx(Kc,{cx:s,cy:i},o);case"squint":return f.jsx(zc,{cx:s,cy:i,animated:e},o);case"wide":return f.jsx(Gc,{cx:s,cy:i,animated:e},o);default:return f.jsx(Wc,{cx:s,cy:i,animated:e},o)}})},t)})}function qc({shape:t}){const e="#333",s="round";switch(t){case"normal":return f.jsxs("g",{children:[f.jsx("path",{d:"M 60 62 Q 72 58 84 62",stroke:e,strokeWidth:3.5,fill:"none",strokeLinecap:s}),f.jsx("path",{d:"M 116 62 Q 128 58 140 62",stroke:e,strokeWidth:3.5,fill:"none",strokeLinecap:s})]});case"raised":return f.jsxs("g",{children:[f.jsx("path",{d:"M 60 56 Q 72 52 84 56",stroke:e,strokeWidth:3.5,fill:"none",strokeLinecap:s}),f.jsx("path",{d:"M 116 56 Q 128 52 140 56",stroke:e,strokeWidth:3.5,fill:"none",strokeLinecap:s})]});case"furrowed":return f.jsxs("g",{children:[f.jsx("path",{d:"M 60 62 Q 72 66 84 58",stroke:e,strokeWidth:3.5,fill:"none",strokeLinecap:s}),f.jsx("path",{d:"M 116 58 Q 128 66 140 62",stroke:e,strokeWidth:3.5,fill:"none",strokeLinecap:s})]});case"sad":return f.jsxs("g",{children:[f.jsx("path",{d:"M 60 60 Q 72 64 84 60",stroke:e,strokeWidth:3.5,fill:"none",strokeLinecap:s}),f.jsx("path",{d:"M 116 60 Q 128 64 140 60",stroke:e,strokeWidth:3.5,fill:"none",strokeLinecap:s})]});case"lifted":return f.jsxs("g",{children:[f.jsx("path",{d:"M 60 60 Q 72 54 84 58",stroke:e,strokeWidth:3.5,fill:"none",strokeLinecap:s}),f.jsx("path",{d:"M 116 58 Q 128 54 140 60",stroke:e,strokeWidth:3.5,fill:"none",strokeLinecap:s})]});case"flat":return f.jsxs("g",{children:[f.jsx("line",{x1:"60",y1:"62",x2:"84",y2:"62",stroke:e,strokeWidth:3.5,strokeLinecap:s}),f.jsx("line",{x1:"116",y1:"62",x2:"140",y2:"62",stroke:e,strokeWidth:3.5,strokeLinecap:s})]});case"asymmetric":return f.jsxs("g",{children:[f.jsx("path",{d:"M 60 56 Q 72 52 84 58",stroke:e,strokeWidth:3.5,fill:"none",strokeLinecap:s}),f.jsx("path",{d:"M 116 58 Q 128 66 140 60",stroke:e,strokeWidth:3.5,fill:"none",strokeLinecap:s})]});default:return f.jsxs("g",{children:[f.jsx("path",{d:"M 60 62 Q 72 58 84 62",stroke:e,strokeWidth:3.5,fill:"none",strokeLinecap:s}),f.jsx("path",{d:"M 116 62 Q 128 58 140 62",stroke:e,strokeWidth:3.5,fill:"none",strokeLinecap:s})]})}}const cr={smile:"M 72 118 Q 100 140 128 118",frown:"M 72 130 Q 100 112 128 130",angry:"M 72 124 Q 100 116 128 124",flat:"M 78 122 Q 100 122 122 122",tight:"M 78 122 Q 100 126 122 122",smirk:"M 78 122 Q 100 132 120 118"};function Yc({shape:t}){const e=cr[t]||cr.flat;return f.jsx(W.path,{d:e,animate:{d:e},transition:{type:"spring",stiffness:80,damping:15},stroke:"#333",strokeWidth:3.5,fill:"none",strokeLinecap:"round"})}function Xc(){return f.jsx("ellipse",{cx:100,cy:122,rx:14,ry:16,fill:"#333"})}function Qc(){return f.jsxs("g",{children:[f.jsx("path",{d:"M 68 114 Q 100 144 132 114",stroke:"#333",strokeWidth:3.5,fill:"#cc4444",strokeLinecap:"round"}),f.jsx("path",{d:"M 68 114 Q 100 144 132 114 Z",fill:"#cc4444"})]})}function Zc(){return f.jsxs("g",{children:[f.jsx("path",{d:"M 72 116 Q 100 138 128 116",stroke:"#333",strokeWidth:3.5,fill:"none",strokeLinecap:"round"}),f.jsx("ellipse",{cx:100,cy:134,rx:10,ry:8,fill:"#FF69B4",stroke:"#333",strokeWidth:2})]})}function Jc(){return f.jsx("polyline",{points:"72,128 84,118 96,128 108,118 120,128 128,122",stroke:"#333",strokeWidth:3.5,fill:"none",strokeLinecap:"round",strokeLinejoin:"round"})}const tu=new Set(["surprised-o","excited-open","silly","zigzag"]);function eu({shape:t}){return tu.has(t)?f.jsx(Wt,{mode:"wait",children:f.jsxs(W.g,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},transition:{duration:.2},style:{transformOrigin:"100px 122px"},children:[t==="surprised-o"&&f.jsx(Xc,{}),t==="excited-open"&&f.jsx(Qc,{}),t==="silly"&&f.jsx(Zc,{}),t==="zigzag"&&f.jsx(Jc,{})]},t)}):f.jsx(Yc,{shape:t})}function nu({color:t,tilt:e=0}){const n="#333";return f.jsxs("g",{transform:`rotate(${e}, 100, 160)`,style:{transformOrigin:"100px 160px"},children:[f.jsx("line",{x1:"100",y1:"155",x2:"100",y2:"175",stroke:n,strokeWidth:4,strokeLinecap:"round"}),f.jsx("line",{x1:"100",y1:"175",x2:"100",y2:"225",stroke:n,strokeWidth:4,strokeLinecap:"round"}),f.jsx("line",{x1:"100",y1:"185",x2:"70",y2:"215",stroke:n,strokeWidth:4,strokeLinecap:"round"}),f.jsx("line",{x1:"100",y1:"185",x2:"130",y2:"215",stroke:n,strokeWidth:4,strokeLinecap:"round"}),f.jsx("line",{x1:"100",y1:"225",x2:"78",y2:"265",stroke:n,strokeWidth:4,strokeLinecap:"round"}),f.jsx("line",{x1:"100",y1:"225",x2:"122",y2:"265",stroke:n,strokeWidth:4,strokeLinecap:"round"})]})}function su(){return f.jsxs("g",{children:[f.jsx("ellipse",{cx:62,cy:100,rx:14,ry:8,fill:"#FF9999",opacity:.6}),f.jsx("ellipse",{cx:138,cy:100,rx:14,ry:8,fill:"#FF9999",opacity:.6})]})}function iu({animated:t}){return f.jsxs("g",{children:[f.jsx("ellipse",{cx:68,cy:100,rx:4,ry:6,fill:"#4FC3F7",className:t?"ef-tear-1":""}),f.jsx("ellipse",{cx:132,cy:100,rx:4,ry:6,fill:"#4FC3F7",className:t?"ef-tear-2":""})]})}function ru({animated:t}){return f.jsxs("g",{children:[f.jsx("text",{x:145,y:65,fontSize:16,fontWeight:"bold",fill:"#9999CC",className:t?"ef-float-z-1":"",style:{userSelect:"none"},children:"Z"}),f.jsx("text",{x:155,y:50,fontSize:12,fontWeight:"bold",fill:"#9999CC",className:t?"ef-float-z-2":"",style:{userSelect:"none"},children:"z"}),f.jsx("text",{x:163,y:38,fontSize:9,fontWeight:"bold",fill:"#9999CC",className:t?"ef-float-z-3":"",style:{userSelect:"none"},children:"z"})]})}function ou({animated:t}){const e=[{x:148,y:65,size:12,cls:"ef-float-heart-1"},{x:160,y:50,size:9,cls:"ef-float-heart-2"},{x:138,y:45,size:7,cls:"ef-float-heart-3"}];return f.jsx("g",{children:e.map(({x:n,y:s,size:i,cls:o},r)=>f.jsx("text",{x:n,y:s,fontSize:i,fill:"#FF4D6D",className:t?o:"",style:{userSelect:"none"},children:"♥"},r))})}function au({animated:t}){return f.jsx("g",{className:t?"ef-sweat-drop":"",children:f.jsx("path",{d:"M 148 68 Q 152 60 156 68 Q 156 74 152 75 Q 148 74 148 68 Z",fill:"#87CEEB",stroke:"#6699CC",strokeWidth:1})})}function lu({animated:t}){const e=[{x:148,y:52,cls:"ef-sparkle-1"},{x:155,y:68,cls:"ef-sparkle-2"},{x:40,y:60,cls:"ef-sparkle-3"},{x:48,y:75,cls:"ef-sparkle-4"}];return f.jsx("g",{children:e.map(({x:n,y:s,cls:i},o)=>f.jsx("text",{x:n,y:s,fontSize:14,fill:"#FFD700",className:t?i:"",style:{userSelect:"none"},children:"✦"},o))})}function cu(){return f.jsxs("g",{className:"ef-anger-pulse",children:[f.jsx("path",{d:"M 42 52 L 50 44 L 58 52 L 50 60 Z",fill:"#FF4444",opacity:.85}),f.jsx("line",{x1:"46",y1:"48",x2:"54",y2:"56",stroke:"#CC0000",strokeWidth:2}),f.jsx("line",{x1:"54",y1:"48",x2:"46",y2:"56",stroke:"#CC0000",strokeWidth:2})]})}function uu(){return f.jsx("text",{x:148,y:62,fontSize:22,fontWeight:"bold",fill:"#666",style:{userSelect:"none"},children:"?"})}function hu({config:t,animated:e}){const{blush:n,tears:s,zFloating:i,heartsFloating:o,sweatDrop:r,sparkles:a,angerLines:l,questionMark:c}=t;return f.jsxs(Wt,{children:[n&&f.jsx(W.g,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},children:f.jsx(su,{})},"blush"),s&&f.jsx(W.g,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},children:f.jsx(iu,{animated:e})},"tears"),i&&f.jsx(W.g,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},children:f.jsx(ru,{animated:e})},"z"),o&&f.jsx(W.g,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},children:f.jsx(ou,{animated:e})},"hearts"),r&&f.jsx(W.g,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},children:f.jsx(au,{animated:e})},"sweat"),a&&f.jsx(W.g,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},children:f.jsx(lu,{animated:e})},"sparkles"),l&&f.jsx(W.g,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},children:f.jsx(cu,{})},"anger"),c&&f.jsx(W.g,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},children:f.jsx(uu,{})},"question")]})}function du(t,e){if(!e)return"";switch(t.idleAnimation.type){case"breathe":return"ef-breathe";case"slow-breathe":return"ef-slow-breathe";case"bounce":return"ef-bounce";case"droop":return"ef-droop";case"tremble":return"ef-tremble";case"wiggle":return"ef-wiggle";case"pulse":return"ef-pulse";case"headBob":return"ef-headBob";default:return""}}function fu({config:t,color:e,animated:n,showBody:s,size:i}){const o=du(t,n),r=s?"0 0 200 280":"0 20 200 160",a=s?i:i*.8;return f.jsx("svg",{width:i,height:a,viewBox:r,xmlns:"http://www.w3.org/2000/svg",style:{overflow:"visible",display:"block"},children:f.jsxs(W.g,{className:o,style:{transformOrigin:"100px 140px"},animate:n&&t.idleAnimation.type==="breathe"?{scale:[1,1.015,1]}:n&&t.idleAnimation.type==="slow-breathe"?{scale:[1,1.01,1]}:n&&t.idleAnimation.type==="bounce"?{y:[0,-12,-8,0]}:n&&t.idleAnimation.type==="pulse"?{scale:[1,1.06,1]}:n&&t.idleAnimation.type==="headBob"?{y:[0,-4,-2,0],rotate:[0,-2,2,0]}:void 0,transition:n?{duration:t.idleAnimation.duration||3,repeat:1/0,ease:"easeInOut"}:void 0,children:[f.jsx("circle",{cx:100,cy:90,r:70,fill:e,stroke:"#333",strokeWidth:3}),f.jsx(hu,{config:t.accessories,animated:n}),f.jsx(qc,{shape:t.eyebrowShape}),f.jsx(Hc,{shape:t.eyeShape,animated:n}),f.jsx(eu,{shape:t.mouthShape}),s&&f.jsx(nu,{color:e,tilt:t.bodyTilt||0})]})})}function pu({message:t,size:e}){return f.jsxs(W.div,{initial:{opacity:0,scale:.7,y:10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.8,y:-5},transition:{type:"spring",stiffness:300,damping:20},style:{position:"absolute",top:-e*.25,right:-e*.7,background:"white",border:"2.5px solid #333",borderRadius:14,padding:"8px 12px",maxWidth:e*1.2,minWidth:80,fontSize:Math.max(11,e*.09),fontFamily:'"Comic Sans MS", "Chalkboard SE", cursive',fontWeight:"bold",color:"#222",zIndex:10,lineHeight:1.3,whiteSpace:"pre-wrap",wordBreak:"break-word"},children:[t,f.jsx("div",{style:{position:"absolute",bottom:-16,left:18,width:0,height:0,borderLeft:"15px solid transparent",borderRight:"0px solid transparent",borderTop:"16px solid #333"}}),f.jsx("div",{style:{position:"absolute",bottom:-12,left:20,width:0,height:0,borderLeft:"12px solid transparent",borderRight:"0px solid transparent",borderTop:"13px solid white"}})]})}function mu({emotion:t,message:e,size:n=200,animated:s=!0,showBody:i=!0,color:o,onEmotionChange:r}){const a=Nc[t],l=o||a.skinColor||"#FFD700";return x.useEffect(()=>{r==null||r(t)},[t,r]),f.jsxs("div",{style:{position:"relative",display:"inline-block",width:n},children:[f.jsx(fu,{config:a,color:l,animated:s,showBody:i,size:n}),f.jsx(Wt,{children:e&&f.jsx(pu,{message:e,size:n},"bubble")})]})}const gu=["happy","sad","angry","mad","surprised","calm","sleepy","excited","tired","confused","embarrassed","nervous","proud","disgusted","bored","love","silly","determined","shy","anxious"];H.EMOTIONS=gu,H.EmotionFace=mu,Object.defineProperty(H,Symbol.toStringTag,{value:"Module"})}));
package/package.json ADDED
@@ -0,0 +1,43 @@
1
+ {
2
+ "name": "react-emotion-face",
3
+ "version": "1.0.0",
4
+ "description": "Animated cartoon emotion face React component library",
5
+ "main": "dist/react-emotion-face.umd.cjs",
6
+ "module": "dist/react-emotion-face.es.js",
7
+ "types": "dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/react-emotion-face.es.js",
12
+ "require": "./dist/react-emotion-face.umd.cjs"
13
+ },
14
+ "./styles": "./dist/style.css"
15
+ },
16
+ "files": ["dist"],
17
+ "scripts": {
18
+ "dev": "vite serve demo --config demo/vite.config.ts",
19
+ "build:lib": "vite build",
20
+ "build:demo": "vite build --config demo/vite.config.ts",
21
+ "build": "npm run build:lib && npm run build:demo",
22
+ "preview": "vite preview --config demo/vite.config.ts"
23
+ },
24
+ "peerDependencies": {
25
+ "react": ">=17",
26
+ "react-dom": ">=17"
27
+ },
28
+ "dependencies": {
29
+ "framer-motion": "^11.0.0"
30
+ },
31
+ "devDependencies": {
32
+ "@types/react": "^18.0.0",
33
+ "@types/react-dom": "^18.0.0",
34
+ "@vitejs/plugin-react": "^4.0.0",
35
+ "react": "^18.0.0",
36
+ "react-dom": "^18.0.0",
37
+ "typescript": "^5.0.0",
38
+ "vite": "^6.0.0",
39
+ "vite-plugin-dts": "^4.0.0"
40
+ },
41
+ "keywords": ["react", "emotion", "animation", "svg", "cartoon", "face"],
42
+ "license": "MIT"
43
+ }