/**
 * Bundled by jsDelivr using Rollup v4.62.2 and esbuild v0.28.1.
 * Original file: /npm/framer-motion@12.23.12/dist/es/dom.mjs
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
import{resolveElements as _,mixNumber as Qe,isMotionValue as V,defaultOffset as he,isGenerator as et,createGeneratorEasing as tt,fillOffset as nt,motionValue as N,transformProps as P,getValueTransition as Z,makeAnimationInstant as de,frame as b,JSAnimation as st,AsyncMotionValueAnimation as it,positionalKeys as rt,KeyframeResolver as ot,time as pe,cancelFrame as H,findValueType as at,complex as lt,getAnimatableNone as ut,microtask as ct,DOMKeyframesResolver as ft,transformPropOrder as X,getValueAsType as me,numberValueTypes as ge,isCSSVariableName as ye,defaultTransformValue as ht,readTransformValue as dt,px as Y,getDefaultValueType as pt,isSVGElement as mt,isSVGSVGElement as gt,spring as yt,GroupAnimationWithThen as Ve,getAnimationMap as Vt,animationMapKey as vt,getComputedStyle as ve,fillWildcards as St,applyPxDefaults as wt,NativeAnimation as Tt,isHTMLElement as xt,interpolate as At,resize as bt,frameData as Ct,supportsScrollTimeline as Mt,observeTimeline as Se}from"/npm/motion-dom@12.23.12/+esm";export*from"/npm/motion-dom@12.23.12/+esm";import{getEasingForSegment as we,removeItem as Te,progress as xe,secondsToMilliseconds as B,invariant as $,MotionGlobalConfig as z,isNumericalString as Bt,isZeroValueString as Et,SubscriptionManager as Pt,velocityPerSecond as Dt,clamp as Ot,noop as Ae}from"/npm/motion-utils@12.23.6/+esm";export*from"/npm/motion-utils@12.23.6/+esm";function q(t){return typeof t=="object"&&!Array.isArray(t)}function be(t,e,n,s){return typeof t=="string"&&q(e)?_(t,n,s):t instanceof NodeList?Array.from(t):Array.isArray(t)?t:[t]}function It(t,e,n){return t*(e+1)}function Ce(t,e,n,s){return typeof e=="number"?e:e.startsWith("-")||e.startsWith("+")?Math.max(0,t+parseFloat(e)):e==="<"?n:e.startsWith("<")?Math.max(0,n+parseFloat(e.slice(1))):s.get(e)??t}function Ft(t,e,n){for(let s=0;s<t.length;s++){const i=t[s];i.at>e&&i.at<n&&(Te(t,i),s--)}}function Lt(t,e,n,s,i,r){Ft(t,i,r);for(let o=0;o<e.length;o++)t.push({value:e[o],at:Qe(i,r,s[o]),easing:we(n,o)})}function Wt(t,e){for(let n=0;n<t.length;n++)t[n]=t[n]/(e+1)}function Nt(t,e){return t.at===e.at?t.value===null?1:e.value===null?-1:0:t.at-e.at}const Ht="easeInOut",Rt=20;function Kt(t,{defaultTransition:e={},...n}={},s,i){const r=e.duration||.3,o=new Map,l=new Map,u={},f=new Map;let a=0,c=0,h=0;for(let d=0;d<t.length;d++){const p=t[d];if(typeof p=="string"){f.set(p,c);continue}else if(!Array.isArray(p)){f.set(p.name,Ce(c,p.at,a,f));continue}let[S,m,g={}]=p;g.at!==void 0&&(c=Ce(c,g.at,a,f));let v=0;const E=(w,T,C,D=0,O=0)=>{const y=jt(w),{delay:U=0,times:x=he(y),type:k="keyframes",repeat:I,repeatType:vs,repeatDelay:Ss=0,...Je}=T;let{ease:M=e.ease||"easeOut",duration:A}=T;const oe=typeof U=="function"?U(D,O):U,ae=y.length,le=et(k)?k:i?.[k||"keyframes"];if(ae<=2&&le){let F=100;if(ae===2&&zt(y)){const L=y[1]-y[0];F=Math.abs(L)}const j={...Je};A!==void 0&&(j.duration=B(A));const G=tt(j,F,le);M=G.ease,A=G.duration}A??(A=r);const ue=c+oe;x.length===1&&x[0]===0&&(x[1]=1);const ce=x.length-y.length;if(ce>0&&nt(x,ce),y.length===1&&y.unshift(null),I){$(I<Rt,"Repeat count too high, must be less than 20","repeat-count-high"),A=It(A,I);const F=[...y],j=[...x];M=Array.isArray(M)?[...M]:[M];const G=[...M];for(let L=0;L<I;L++){y.push(...F);for(let W=0;W<F.length;W++)x.push(j[W]+(L+1)),M.push(W===0?"linear":we(G,W-1))}Wt(x,I)}const fe=ue+A;Lt(C,y,M,x,ue,fe),v=Math.max(oe+A,v),h=Math.max(fe,h)};if(V(S)){const w=Me(S,l);E(m,g,Be("default",w))}else{const w=be(S,m,s,u),T=w.length;for(let C=0;C<T;C++){m=m,g=g;const D=w[C],O=Me(D,l);for(const y in m)E(m[y],Gt(g,y),Be(y,O),C,T)}}a=c,c+=v}return l.forEach((d,p)=>{for(const S in d){const m=d[S];m.sort(Nt);const g=[],v=[],E=[];for(let T=0;T<m.length;T++){const{at:C,value:D,easing:O}=m[T];g.push(D),v.push(xe(0,h,C)),E.push(O||"easeOut")}v[0]!==0&&(v.unshift(0),g.unshift(g[0]),E.unshift(Ht)),v[v.length-1]!==1&&(v.push(1),g.push(null)),o.has(p)||o.set(p,{keyframes:{},transition:{}});const w=o.get(p);w.keyframes[S]=g,w.transition[S]={...e,duration:h,ease:E,times:v,...n}}}),o}function Me(t,e){return!e.has(t)&&e.set(t,{}),e.get(t)}function Be(t,e){return e[t]||(e[t]=[]),e[t]}function jt(t){return Array.isArray(t)?t:[t]}function Gt(t,e){return t&&t[e]?{...t,...t[e]}:{...t}}const $t=t=>typeof t=="number",zt=t=>t.every($t),R=new WeakMap,Ut=t=>Array.isArray(t);function Ee(t){const e=[{},{}];return t?.values.forEach((n,s)=>{e[0][s]=n.get(),e[1][s]=n.getVelocity()}),e}function Pe(t,e,n,s){if(typeof e=="function"){const[i,r]=Ee(s);e=e(n!==void 0?n:t.custom,i,r)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[i,r]=Ee(s);e=e(n!==void 0?n:t.custom,i,r)}return e}function kt(t,e,n){const s=t.getProps();return Pe(s,e,s.custom,t)}function _t(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,N(n))}function Zt(t){return Ut(t)?t[t.length-1]||0:t}function Xt(t,e){const n=kt(t,e);let{transitionEnd:s={},transition:i={},...r}=n||{};r={...r,...s};for(const o in r){const l=Zt(r[o]);_t(t,o,l)}}function Yt(t){return!!(V(t)&&t.add)}function qt(t,e){const n=t.getValue("willChange");if(Yt(n))return n.add(e);if(!n&&z.WillChange){const s=new z.WillChange("auto");t.addValue("willChange",s),s.add(e)}}const J=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Jt="framerAppearId",Qt="data-"+J(Jt);function en(t){return t.props[Qt]}const tn=t=>t!==null;function nn(t,{repeat:e,repeatType:n="loop"},s){const i=t.filter(tn),r=e&&n!=="loop"&&e%2===1?0:i.length-1;return!r||s===void 0?i[r]:s}const sn={type:"spring",stiffness:500,damping:25,restSpeed:10},rn=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),on={type:"keyframes",duration:.8},an={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},ln=(t,{keyframes:e})=>e.length>2?on:P.has(t)?t.startsWith("scale")?rn(e[1]):sn:an;function un({when:t,delay:e,delayChildren:n,staggerChildren:s,staggerDirection:i,repeat:r,repeatType:o,repeatDelay:l,from:u,elapsed:f,...a}){return!!Object.keys(a).length}const De=(t,e,n,s={},i,r)=>o=>{const l=Z(s,t)||{},u=l.delay||s.delay||0;let{elapsed:f=0}=s;f=f-B(u);const a={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...l,delay:-f,onUpdate:h=>{e.set(h),l.onUpdate&&l.onUpdate(h)},onComplete:()=>{o(),l.onComplete&&l.onComplete()},name:t,motionValue:e,element:r?void 0:i};un(l)||Object.assign(a,ln(t,a)),a.duration&&(a.duration=B(a.duration)),a.repeatDelay&&(a.repeatDelay=B(a.repeatDelay)),a.from!==void 0&&(a.keyframes[0]=a.from);let c=!1;if((a.type===!1||a.duration===0&&!a.repeatDelay)&&(de(a),a.delay===0&&(c=!0)),(z.instantAnimations||z.skipAnimations)&&(c=!0,de(a),a.delay=0),a.allowFlatten=!l.type&&!l.ease,c&&!r&&e.get()!==void 0){const h=nn(a.keyframes,l);if(h!==void 0){b.update(()=>{a.onUpdate(h),a.onComplete()});return}}return l.isSync?new st(a):new it(a)};function cn({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,s}function fn(t,e,{delay:n=0,transitionOverride:s,type:i}={}){let{transition:r=t.getDefaultTransition(),transitionEnd:o,...l}=e;s&&(r=s);const u=[],f=i&&t.animationState&&t.animationState.getState()[i];for(const a in l){const c=t.getValue(a,t.latestValues[a]??null),h=l[a];if(h===void 0||f&&cn(f,a))continue;const d={delay:n,...Z(r||{},a)},p=c.get();if(p!==void 0&&!c.isAnimating&&!Array.isArray(h)&&h===p&&!d.velocity)continue;let S=!1;if(window.MotionHandoffAnimation){const g=en(t);if(g){const v=window.MotionHandoffAnimation(g,a,b);v!==null&&(d.startTime=v,S=!0)}}qt(t,a),c.start(De(a,c,h,t.shouldReduceMotion&&rt.has(a)?{type:!1}:d,t,S));const m=c.animation;m&&u.push(m)}return o&&Promise.all(u).then(()=>{b.update(()=>{o&&Xt(t,o)})}),u}function hn({top:t,left:e,right:n,bottom:s}){return{x:{min:e,max:n},y:{min:t,max:s}}}function dn(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 pn(t,e){return hn(dn(t.getBoundingClientRect(),e))}const Oe={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"]},Q={};for(const t in Oe)Q[t]={isEnabled:e=>Oe[t].some(n=>!!e[n])};const Ie=()=>({min:0,max:0}),ee=()=>({x:Ie(),y:Ie()}),mn=typeof window<"u",te={current:null},Fe={current:!1};function gn(){if(Fe.current=!0,!!mn)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>te.current=t.matches;t.addEventListener("change",e),e()}else te.current=!1}function yn(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function Vn(t){return typeof t=="string"||Array.isArray(t)}const vn=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Sn=["initial",...vn];function Le(t){return yn(t.animate)||Sn.some(e=>Vn(t[e]))}function wn(t){return!!(Le(t)||t.variants)}function Tn(t,e,n){for(const s in e){const i=e[s],r=n[s];if(V(i))t.addValue(s,i);else if(V(r))t.addValue(s,N(i,{owner:t}));else if(r!==i)if(t.hasValue(s)){const o=t.getValue(s);o.liveStyle===!0?o.jump(i):o.hasAnimated||o.set(i)}else{const o=t.getStaticValue(s);t.addValue(s,N(o!==void 0?o:i,{owner:t}))}}for(const s in n)e[s]===void 0&&t.removeValue(s);return e}const We=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Ne{scrapeMotionValuesFromProps(e,n,s){return{}}constructor({parent:e,props:n,presenceContext:s,reducedMotionConfig:i,blockInitialAnimation:r,visualState:o},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=ot,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 h=pe.now();this.renderScheduledAt<h&&(this.renderScheduledAt=h,b.render(this.render,!1,!0))};const{latestValues:u,renderState:f}=o;this.latestValues=u,this.baseTarget={...u},this.initialValues=n.initial?{...u}:{},this.renderState=f,this.parent=e,this.props=n,this.presenceContext=s,this.depth=e?e.depth+1:0,this.reducedMotionConfig=i,this.options=l,this.blockInitialAnimation=!!r,this.isControllingVariants=Le(n),this.isVariantNode=wn(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:a,...c}=this.scrapeMotionValuesFromProps(n,{},this);for(const h in c){const d=c[h];u[h]!==void 0&&V(d)&&d.set(u[h])}}mount(e){this.current=e,R.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)),Fe.current||gn(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:te.current,this.parent?.addChild(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),H(this.notifyUpdate),H(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(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}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,n){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();const s=P.has(e);s&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",o=>{this.latestValues[e]=o,this.props.onUpdate&&b.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let r;window.MotionCheckAppearSync&&(r=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{i(),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 Q){const n=Q[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 r=this.features[e];r.isMounted?r.update():(r.mount(),r.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):ee()}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<We.length;s++){const i=We[s];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const r="on"+i,o=e[r];o&&(this.propEventSubscriptions[i]=this.on(i,o))}this.prevMotionValues=Tn(this,this.scrapeMotionValuesFromProps(e,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}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=N(n===null?void 0:n,{owner:this}),this.addValue(e,s)),s}readValue(e,n){let s=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return s!=null&&(typeof s=="string"&&(Bt(s)||Et(s))?s=parseFloat(s):!at(s)&&lt.test(n)&&(s=ut(e,n)),this.setBaseTarget(e,V(s)?s.get():s)),V(s)?s.get():s}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){const{initial:n}=this.props;let s;if(typeof n=="string"||typeof n=="object"){const r=Pe(this.props,n,this.presenceContext?.custom);r&&(s=r[e])}if(n&&s!==void 0)return s;const i=this.getBaseTargetFromProps(this.props,e);return i!==void 0&&!V(i)?i:this.initialValues[e]!==void 0&&s===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new Pt),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){ct.render(this.render)}}class He extends Ne{constructor(){super(...arguments),this.KeyframeResolver=ft}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;V(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}const xn={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},An=X.length;function bn(t,e,n){let s="",i=!0;for(let r=0;r<An;r++){const o=X[r],l=t[o];if(l===void 0)continue;let u=!0;if(typeof l=="number"?u=l===(o.startsWith("scale")?1:0):u=parseFloat(l)===0,!u||n){const f=me(l,ge[o]);if(!u){i=!1;const a=xn[o]||o;s+=`${a}(${f}) `}n&&(e[o]=f)}}return s=s.trim(),n?s=n(e,i?"":s):i&&(s="none"),s}function Re(t,e,n){const{style:s,vars:i,transformOrigin:r}=t;let o=!1,l=!1;for(const u in e){const f=e[u];if(P.has(u)){o=!0;continue}else if(ye(u)){i[u]=f;continue}else{const a=me(f,ge[u]);u.startsWith("origin")?(l=!0,r[u]=a):s[u]=a}}if(e.transform||(o||n?s.transform=bn(e,t.transform,n):s.transform&&(s.transform="none")),l){const{originX:u="50%",originY:f="50%",originZ:a=0}=r;s.transformOrigin=`${u} ${f} ${a}`}}function Ke(t,{style:e,vars:n},s,i){const r=t.style;let o;for(o in e)r[o]=e[o];i?.applyProjectionStyles(r,s);for(o in n)r.setProperty(o,n[o])}const Cn={};function Mn(t,{layout:e,layoutId:n}){return P.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!Cn[t]||t==="opacity")}function je(t,e,n){const{style:s}=t,i={};for(const r in s)(V(s[r])||e.style&&V(e.style[r])||Mn(r,t)||n?.getValue(r)?.liveStyle!==void 0)&&(i[r]=s[r]);return i}function Bn(t){return window.getComputedStyle(t)}class En extends He{constructor(){super(...arguments),this.type="html",this.renderInstance=Ke}readValueFromInstance(e,n){if(P.has(n))return this.projection?.isProjecting?ht(n):dt(e,n);{const s=Bn(e),i=(ye(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:n}){return pn(e,n)}build(e,n,s){Re(e,n,s.transformTemplate)}scrapeMotionValuesFromProps(e,n,s){return je(e,n,s)}}function Pn(t,e){return t in e}class Dn extends Ne{constructor(){super(...arguments),this.type="object"}readValueFromInstance(e,n){if(Pn(n,e)){const s=e[n];if(typeof s=="string"||typeof s=="number")return s}}getBaseTargetFromProps(){}removeValueFromRenderState(e,n){delete n.output[e]}measureInstanceViewportBox(){return ee()}build(e,n){Object.assign(e.output,n)}renderInstance(e,{output:n}){Object.assign(e,n)}sortInstanceNodePosition(){return 0}}const On={offset:"stroke-dashoffset",array:"stroke-dasharray"},In={offset:"strokeDashoffset",array:"strokeDasharray"};function Fn(t,e,n=1,s=0,i=!0){t.pathLength=1;const r=i?On:In;t[r.offset]=Y.transform(-s);const o=Y.transform(e),l=Y.transform(n);t[r.array]=`${o} ${l}`}function Ln(t,{attrX:e,attrY:n,attrScale:s,pathLength:i,pathSpacing:r=1,pathOffset:o=0,...l},u,f,a){if(Re(t,l,f),u){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:c,style:h}=t;c.transform&&(h.transform=c.transform,delete c.transform),(h.transform||c.transformOrigin)&&(h.transformOrigin=c.transformOrigin??"50% 50%",delete c.transformOrigin),h.transform&&(h.transformBox=a?.transformBox??"fill-box",delete c.transformBox),e!==void 0&&(c.x=e),n!==void 0&&(c.y=n),s!==void 0&&(c.scale=s),i!==void 0&&Fn(c,i,r,o,!1)}const Ge=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"]),Wn=t=>typeof t=="string"&&t.toLowerCase()==="svg";function Nn(t,e,n,s){Ke(t,e,void 0,s);for(const i in e.attrs)t.setAttribute(Ge.has(i)?i:J(i),e.attrs[i])}function Hn(t,e,n){const s=je(t,e,n);for(const i in t)if(V(t[i])||V(e[i])){const r=X.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;s[r]=t[i]}return s}class Rn extends He{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=ee}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(P.has(n)){const s=pt(n);return s&&s.default||0}return n=Ge.has(n)?n:J(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,s){return Hn(e,n,s)}build(e,n,s){Ln(e,n,this.isSVGTag,s.transformTemplate,s.style)}renderInstance(e,n,s,i){Nn(e,n,s,i)}mount(e){this.isSVGTag=Wn(e.tagName),super.mount(e)}}function Kn(t){const e={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=mt(t)&&!gt(t)?new Rn(e):new En(e);n.mount(t),R.set(t,n)}function jn(t){const e={presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}},n=new Dn(e);n.mount(t),R.set(t,n)}function Gn(t,e,n){const s=V(t)?t:N(t);return s.start(De("",s,e,n)),s.animation}function $n(t,e){return V(t)||typeof t=="number"||typeof t=="string"&&!q(e)}function $e(t,e,n,s){const i=[];if($n(t,e))i.push(Gn(t,q(e)&&e.default||e,n&&(n.default||n)));else{const r=be(t,e,s),o=r.length;$(!!o,"No valid elements provided.","no-valid-elements");for(let l=0;l<o;l++){const u=r[l];$(u!==null,"You're trying to perform an animation on null. Ensure that selectors are correctly finding elements and refs are correctly hydrated.","animate-null");const f=u instanceof Element?Kn:jn;R.has(u)||f(u);const a=R.get(u),c={...n};"delay"in c&&typeof c.delay=="function"&&(c.delay=c.delay(l,o)),i.push(...fn(a,{...e,transition:c},{}))}}return i}function zn(t,e,n){const s=[];return Kt(t,e,n,{spring:yt}).forEach(({keyframes:r,transition:o},l)=>{s.push(...$e(l,r,o))}),s}function Un(t){return Array.isArray(t)&&t.some(Array.isArray)}function ze(t){function e(n,s,i){let r=[];Un(n)?r=zn(n,s,t):r=$e(n,s,i,t);const o=new Ve(r);return t&&(t.animations.push(o),o.finished.then(()=>{Te(t.animations,o)})),o}return e}const kn=ze();function _n(t,e,n,s){const i=_(t,s),r=i.length;$(!!r,"No valid elements provided.","no-valid-elements");const o=[];for(let u=0;u<r;u++){const f=i[u],a={...n};typeof a.delay=="function"&&(a.delay=a.delay(u,r));for(const c in e){let h=e[c];Array.isArray(h)||(h=[h]);const d={...Z(a,c)};d.duration&&(d.duration=B(d.duration)),d.delay&&(d.delay=B(d.delay));const p=Vt(f),S=vt(c,d.pseudoElement||""),m=p.get(S);m&&m.stop(),o.push({map:p,key:S,unresolvedKeyframes:h,options:{...d,element:f,name:c,allowFlatten:!a.type&&!a.ease}})}}for(let u=0;u<o.length;u++){const{unresolvedKeyframes:f,options:a}=o[u],{element:c,name:h,pseudoElement:d}=a;!d&&f[0]===null&&(f[0]=ve(c,h)),St(f),wt(f,h),!d&&f.length<2&&f.unshift(ve(c,h)),a.keyframes=f}const l=[];for(let u=0;u<o.length;u++){const{map:f,key:a,options:c}=o[u],h=new Tt(c);f.set(a,h),h.finished.finally(()=>f.delete(a)),l.push(h)}return l}const Zn=t=>{function e(n,s,i){return new Ve(_n(n,s,i,t))}return e},Xn=Zn(),Yn=50,Ue=()=>({current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0}),qn=()=>({time:0,x:Ue(),y:Ue()}),Jn={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}};function ke(t,e,n,s){const i=n[e],{length:r,position:o}=Jn[e],l=i.current,u=n.time;i.current=t[`scroll${o}`],i.scrollLength=t[`scroll${r}`]-t[`client${r}`],i.offset.length=0,i.offset[0]=0,i.offset[1]=i.scrollLength,i.progress=xe(0,i.scrollLength,i.current);const f=s-u;i.velocity=f>Yn?0:Dt(i.current-l,f)}function Qn(t,e,n){ke(t,"x",e,n),ke(t,"y",e,n),e.time=n}function es(t,e){const n={x:0,y:0};let s=t;for(;s&&s!==e;)if(xt(s))n.x+=s.offsetLeft,n.y+=s.offsetTop,s=s.offsetParent;else if(s.tagName==="svg"){const i=s.getBoundingClientRect();s=s.parentElement;const r=s.getBoundingClientRect();n.x+=i.left-r.left,n.y+=i.top-r.top}else if(s instanceof SVGGraphicsElement){const{x:i,y:r}=s.getBBox();n.x+=i,n.y+=r;let o=null,l=s.parentNode;for(;!o;)l.tagName==="svg"&&(o=l),l=s.parentNode;s=o}else break;return n}const ne={start:0,center:.5,end:1};function _e(t,e,n=0){let s=0;if(t in ne&&(t=ne[t]),typeof t=="string"){const i=parseFloat(t);t.endsWith("px")?s=i:t.endsWith("%")?t=i/100:t.endsWith("vw")?s=i/100*document.documentElement.clientWidth:t.endsWith("vh")?s=i/100*document.documentElement.clientHeight:t=i}return typeof t=="number"&&(s=e*t),n+s}const ts=[0,0];function ns(t,e,n,s){let i=Array.isArray(t)?t:ts,r=0,o=0;return typeof t=="number"?i=[t,t]:typeof t=="string"&&(t=t.trim(),t.includes(" ")?i=t.split(" "):i=[t,ne[t]?t:"0"]),r=_e(i[0],n,s),o=_e(i[1],e),r-o}const ss={All:[[0,0],[1,1]]},is={x:0,y:0};function rs(t){return"getBBox"in t&&t.tagName!=="svg"?t.getBBox():{width:t.clientWidth,height:t.clientHeight}}function os(t,e,n){const{offset:s=ss.All}=n,{target:i=t,axis:r="y"}=n,o=r==="y"?"height":"width",l=i!==t?es(i,t):is,u=i===t?{width:t.scrollWidth,height:t.scrollHeight}:rs(i),f={width:t.clientWidth,height:t.clientHeight};e[r].offset.length=0;let a=!e[r].interpolate;const c=s.length;for(let h=0;h<c;h++){const d=ns(s[h],f[o],u[o],l[r]);!a&&d!==e[r].interpolatorOffsets[h]&&(a=!0),e[r].offset[h]=d}a&&(e[r].interpolate=At(e[r].offset,he(s),{clamp:!1}),e[r].interpolatorOffsets=[...e[r].offset]),e[r].progress=Ot(0,1,e[r].interpolate(e[r].current))}function as(t,e=t,n){if(n.x.targetOffset=0,n.y.targetOffset=0,e!==t){let s=e;for(;s&&s!==t;)n.x.targetOffset+=s.offsetLeft,n.y.targetOffset+=s.offsetTop,s=s.offsetParent}n.x.targetLength=e===t?e.scrollWidth:e.clientWidth,n.y.targetLength=e===t?e.scrollHeight:e.clientHeight,n.x.containerLength=t.clientWidth,n.y.containerLength=t.clientHeight}function ls(t,e,n,s={}){return{measure:i=>{as(t,s.target,n),Qn(t,n,i),(s.offset||s.target)&&os(t,n,s)},notify:()=>e(n)}}const K=new WeakMap,Ze=new WeakMap,se=new WeakMap,Xe=t=>t===document.scrollingElement?window:t;function ie(t,{container:e=document.scrollingElement,...n}={}){if(!e)return Ae;let s=se.get(e);s||(s=new Set,se.set(e,s));const i=qn(),r=ls(e,t,i,n);if(s.add(r),!K.has(e)){const l=()=>{for(const c of s)c.measure(Ct.timestamp);b.preUpdate(u)},u=()=>{for(const c of s)c.notify()},f=()=>b.read(l);K.set(e,f);const a=Xe(e);window.addEventListener("resize",f,{passive:!0}),e!==document.documentElement&&Ze.set(e,bt(e,f)),a.addEventListener("scroll",f,{passive:!0}),f()}const o=K.get(e);return b.read(o,!1,!0),()=>{H(o);const l=se.get(e);if(!l||(l.delete(r),l.size))return;const u=K.get(e);K.delete(e),u&&(Xe(e).removeEventListener("scroll",u),Ze.get(e)?.(),window.removeEventListener("resize",u))}}const Ye=new Map;function us(t){const e={value:0},n=ie(s=>{e.value=s[t.axis].progress*100},t);return{currentTime:e,cancel:n}}function qe({source:t,container:e,...n}){const{axis:s}=n;t&&(e=t);const i=Ye.get(e)??new Map;Ye.set(e,i);const r=n.target??"self",o=i.get(r)??{},l=s+(n.offset??[]).join(",");return o[l]||(o[l]=!n.target&&Mt()?new ScrollTimeline({source:e,axis:s}):us({container:e,...n})),o[l]}function cs(t,e){const n=qe(e);return t.attachTimeline({timeline:e.target?void 0:n,observe:s=>(s.pause(),Se(i=>{s.time=s.duration*i},n))})}function fs(t){return t.length===2}function hs(t,e){return fs(t)?ie(n=>{t(n[e.axis].progress,n)},e):Se(t,qe(e))}function ds(t,{axis:e="y",container:n=document.scrollingElement,...s}={}){if(!n)return Ae;const i={axis:e,container:n,...s};return typeof t=="function"?hs(t,i):cs(t,i)}const ps={some:0,all:1};function ms(t,e,{root:n,margin:s,amount:i="some"}={}){const r=_(t),o=new WeakMap,l=f=>{f.forEach(a=>{const c=o.get(a.target);if(a.isIntersecting!==!!c)if(a.isIntersecting){const h=e(a.target,a);typeof h=="function"?o.set(a.target,h):u.unobserve(a.target)}else typeof c=="function"&&(c(a),o.delete(a.target))})},u=new IntersectionObserver(l,{root:n,rootMargin:s,threshold:typeof i=="number"?i:ps[i]});return r.forEach(f=>u.observe(f)),()=>u.disconnect()}function gs(t,e){const n=pe.now(),s=({timestamp:i})=>{const r=i-n;r>=e&&(H(s),t(r-e))};return b.setup(s,!0),()=>H(s)}function ys(t,e){return gs(t,B(e))}const re=(t,e)=>Math.abs(t-e);function Vs(t,e){const n=re(t.x,e.x),s=re(t.y,e.y);return Math.sqrt(n**2+s**2)}export{kn as animate,Xn as animateMini,ze as createScopedAnimate,ys as delay,re as distance,Vs as distance2D,ms as inView,ds as scroll,ie as scrollInfo};
//# sourceMappingURL=/sm/8b1ba00284c48ff7748b9498507486438ff2f5104d1d5b87957efb1c9fa47242.map