/**
 * Bundled by jsDelivr using Rollup v4.62.2 and esbuild v0.28.1.
 * Original file: /npm/framer-motion@12.38.0/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 be,isMotionValue as se,defaultOffset as ie,isGenerator as He,createGeneratorEasing as Ie,fillOffset as Ce,isSVGElement as ke,isSVGSVGElement as Be,SVGVisualElement as Ne,HTMLVisualElement as Ke,visualElementStore as K,ObjectVisualElement as Pe,animateSingleValue as ze,animateTarget as Ge,motionValue as Fe,spring as $e,GroupAnimationWithThen as re,getValueTransition as Re,getAnimationMap as _e,animationMapKey as qe,getComputedStyle as oe,fillWildcards as Ue,applyPxDefaults as je,NativeAnimation as Xe,supportsViewTimeline as Je,supportsScrollTimeline as Qe,isHTMLElement as Ye,interpolate as Ze,resize as et,frame as P,cancelFrame as ae,frameData as tt,observeTimeline as le}from"/npm/motion-dom@12.38.0/+esm";export*from"/npm/motion-dom@12.38.0/+esm";import{delayInSeconds as tn}from"/npm/motion-dom@12.38.0/+esm";import{getEasingForSegment as ce,removeItem as fe,progress as ue,secondsToMilliseconds as R,invariant as _,velocityPerSecond as nt,clamp as st,noop as de}from"/npm/motion-utils@12.36.0/+esm";export*from"/npm/motion-utils@12.36.0/+esm";function q(e){return typeof e=="object"&&!Array.isArray(e)}function me(e,t,n,s){return e==null?[]:typeof e=="string"&&q(t)?$(e,n,s):e instanceof NodeList?Array.from(e):Array.isArray(e)?e.filter(i=>i!=null):[e]}function it(e,t,n){return e*(t+1)}function he(e,t,n,s){return typeof t=="number"?t:t.startsWith("-")||t.startsWith("+")?Math.max(0,e+parseFloat(t)):t==="<"?n:t.startsWith("<")?Math.max(0,n+parseFloat(t.slice(1))):s.get(t)??e}function rt(e,t,n){for(let s=0;s<e.length;s++){const i=e[s];i.at>t&&i.at<n&&(fe(e,i),s--)}}function ot(e,t,n,s,i,o){rt(e,i,o);for(let r=0;r<t.length;r++)e.push({value:t[r],at:be(i,o,s[r]),easing:ce(n,r)})}function at(e,t){for(let n=0;n<e.length;n++)e[n]=e[n]/(t+1)}function lt(e,t){return e.at===t.at?e.value===null?1:t.value===null?-1:0:e.at-t.at}const ct="easeInOut",ft=20;function ut(e,{defaultTransition:t={},...n}={},s,i){const o=t.duration||.3,r=new Map,f=new Map,l={},c=new Map;let a=0,u=0,d=0;for(let m=0;m<e.length;m++){const g=e[m];if(typeof g=="string"){c.set(g,u);continue}else if(!Array.isArray(g)){c.set(g.name,he(u,g.at,a,c));continue}let[E,p,y={}]=g;y.at!==void 0&&(u=he(u,y.at,a,c));let v=0;const M=(w,W,x,O=0,V=0)=>{const h=dt(w),{delay:D=0,times:S=ie(h),type:F=t.type||"keyframes",repeat:b,repeatType:jt,repeatDelay:Xt=0,...De}=W;let{ease:T=t.ease||"easeOut",duration:A}=W;const Q=typeof D=="function"?D(O,V):D,Y=h.length,Z=He(F)?F:i?.[F||"keyframes"];if(Y<=2&&Z){let H=100;if(Y===2&&gt(h)){const I=h[1]-h[0];H=Math.abs(I)}const B={...t,...De};A!==void 0&&(B.duration=R(A));const N=Ie(B,H,Z);T=N.ease,A=N.duration}A??(A=o);const ee=u+Q;S.length===1&&S[0]===0&&(S[1]=1);const te=S.length-h.length;if(te>0&&Ce(S,te),h.length===1&&h.unshift(null),b){_(b<ft,"Repeat count too high, must be less than 20","repeat-count-high"),A=it(A,b);const H=[...h],B=[...S];T=Array.isArray(T)?[...T]:[T];const N=[...T];for(let I=0;I<b;I++){h.push(...H);for(let C=0;C<H.length;C++)S.push(B[C]+(I+1)),T.push(C===0?"linear":ce(N,C-1))}at(S,b)}const ne=ee+A;ot(x,h,T,S,ee,ne),v=Math.max(Q+A,v),d=Math.max(ne,d)};if(se(E)){const w=ge(E,f);M(p,y,pe("default",w))}else{const w=me(E,p,s,l),W=w.length;for(let x=0;x<W;x++){p=p,y=y;const O=w[x],V=ge(O,f);for(const h in p)M(p[h],mt(y,h),pe(h,V),x,W)}}a=u,u+=v}return f.forEach((m,g)=>{for(const E in m){const p=m[E];p.sort(lt);const y=[],v=[],M=[];for(let O=0;O<p.length;O++){const{at:V,value:h,easing:D}=p[O];y.push(h),v.push(ue(0,d,V)),M.push(D||"easeOut")}v[0]!==0&&(v.unshift(0),y.unshift(y[0]),M.unshift(ct)),v[v.length-1]!==1&&(v.push(1),y.push(null)),r.has(g)||r.set(g,{keyframes:{},transition:{}});const w=r.get(g);w.keyframes[E]=y;const{type:W,...x}=t;w.transition[E]={...x,duration:d,ease:M,times:v,...n}}}),r}function ge(e,t){return!t.has(e)&&t.set(e,{}),t.get(e)}function pe(e,t){return t[e]||(t[e]=[]),t[e]}function dt(e){return Array.isArray(e)?e:[e]}function mt(e,t){return e&&e[t]?{...e,...e[t]}:{...e}}const ht=e=>typeof e=="number",gt=e=>e.every(ht);function pt(e){const t={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=ke(e)&&!Be(e)?new Ne(t):new Ke(t);n.mount(e),K.set(e,n)}function yt(e){const t={presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}},n=new Pe(t);n.mount(e),K.set(e,n)}function vt(e,t){return se(e)||typeof e=="number"||typeof e=="string"&&!q(t)}function ye(e,t,n,s){const i=[];if(vt(e,t))i.push(ze(e,q(t)&&t.default||t,n&&(n.default||n)));else{if(e==null)return i;const o=me(e,t,s),r=o.length;_(!!r,"No valid elements provided.","no-valid-elements");for(let f=0;f<r;f++){const l=o[f],c=l instanceof Element?pt:yt;K.has(l)||c(l);const a=K.get(l),u={...n};"delay"in u&&typeof u.delay=="function"&&(u.delay=u.delay(f,r)),i.push(...Ge(a,{...t,transition:u},{}))}}return i}function Et(e,t,n){const s=[],i=e.map(r=>{if(Array.isArray(r)&&typeof r[0]=="function"){const f=r[0],l=Fe(0);return l.on("change",f),r.length===1?[l,[0,1]]:r.length===2?[l,[0,1],r[1]]:[l,r[1],r[2]]}return r});return ut(i,t,n,{spring:$e}).forEach(({keyframes:r,transition:f},l)=>{s.push(...ye(l,r,f))}),s}function wt(e){return Array.isArray(e)&&e.some(Array.isArray)}function ve(e={}){const{scope:t,reduceMotion:n}=e;function s(i,o,r){let f=[],l;if(wt(i)){const{onComplete:a,...u}=o||{};typeof a=="function"&&(l=a),f=Et(i,n!==void 0?{reduceMotion:n,...u}:u,t)}else{const{onComplete:a,...u}=r||{};typeof a=="function"&&(l=a),f=ye(i,o,n!==void 0?{reduceMotion:n,...u}:u,t)}const c=new re(f);return l&&c.finished.then(l),t&&(t.animations.push(c),c.finished.then(()=>{fe(t.animations,c)})),c}return s}const St=ve();function At(e,t,n,s){if(e==null)return[];const i=$(e,s),o=i.length;_(!!o,"No valid elements provided.","no-valid-elements");const r=[];for(let l=0;l<o;l++){const c=i[l],a={...n};typeof a.delay=="function"&&(a.delay=a.delay(l,o));for(const u in t){let d=t[u];Array.isArray(d)||(d=[d]);const m={...Re(a,u)};m.duration&&(m.duration=R(m.duration)),m.delay&&(m.delay=R(m.delay));const g=_e(c),E=qe(u,m.pseudoElement||""),p=g.get(E);p&&p.stop(),r.push({map:g,key:E,unresolvedKeyframes:d,options:{...m,element:c,name:u,allowFlatten:!a.type&&!a.ease}})}}for(let l=0;l<r.length;l++){const{unresolvedKeyframes:c,options:a}=r[l],{element:u,name:d,pseudoElement:m}=a;!m&&c[0]===null&&(c[0]=oe(u,d)),Ue(c),je(c,d),!m&&c.length<2&&c.unshift(oe(u,d)),a.keyframes=c}const f=[];for(let l=0;l<r.length;l++){const{map:c,key:a,options:u}=r[l],d=new Xe(u);c.set(a,d),d.finished.finally(()=>c.delete(a)),f.push(d)}return f}const xt=e=>{function t(n,s,i){return new re(At(n,s,i,e))}return t},Tt=xt();function z(e){return typeof window>"u"?!1:e?Je():Qe()}const Ot=50,Ee=()=>({current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0}),Mt=()=>({time:0,x:Ee(),y:Ee()}),Wt={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}};function we(e,t,n,s){const i=n[t],{length:o,position:r}=Wt[t],f=i.current,l=n.time;i.current=Math.abs(e[`scroll${r}`]),i.scrollLength=e[`scroll${o}`]-e[`client${o}`],i.offset.length=0,i.offset[0]=0,i.offset[1]=i.scrollLength,i.progress=ue(0,i.scrollLength,i.current);const c=s-l;i.velocity=c>Ot?0:nt(i.current-f,c)}function Lt(e,t,n){we(e,"x",t,n),we(e,"y",t,n),t.time=n}function Vt(e,t){const n={x:0,y:0};let s=e;for(;s&&s!==t;)if(Ye(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 o=s.getBoundingClientRect();n.x+=i.left-o.left,n.y+=i.top-o.top}else if(s instanceof SVGGraphicsElement){const{x:i,y:o}=s.getBBox();n.x+=i,n.y+=o;let r=null,f=s.parentNode;for(;!r;)f.tagName==="svg"&&(r=f),f=s.parentNode;s=r}else break;return n}const U={start:0,center:.5,end:1};function Se(e,t,n=0){let s=0;if(e in U&&(e=U[e]),typeof e=="string"){const i=parseFloat(e);e.endsWith("px")?s=i:e.endsWith("%")?e=i/100:e.endsWith("vw")?s=i/100*document.documentElement.clientWidth:e.endsWith("vh")?s=i/100*document.documentElement.clientHeight:e=i}return typeof e=="number"&&(s=t*e),n+s}const Dt=[0,0];function bt(e,t,n,s){let i=Array.isArray(e)?e:Dt,o=0,r=0;return typeof e=="number"?i=[e,e]:typeof e=="string"&&(e=e.trim(),e.includes(" ")?i=e.split(" "):i=[e,U[e]?e:"0"]),o=Se(i[0],n,s),r=Se(i[1],t),o-r}const k={Enter:[[0,1],[1,1]],Exit:[[0,0],[1,0]],Any:[[1,0],[0,1]],All:[[0,0],[1,1]]},Ht={x:0,y:0};function It(e){return"getBBox"in e&&e.tagName!=="svg"?e.getBBox():{width:e.clientWidth,height:e.clientHeight}}function Ct(e,t,n){const{offset:s=k.All}=n,{target:i=e,axis:o="y"}=n,r=o==="y"?"height":"width",f=i!==e?Vt(i,e):Ht,l=i===e?{width:e.scrollWidth,height:e.scrollHeight}:It(i),c={width:e.clientWidth,height:e.clientHeight};t[o].offset.length=0;let a=!t[o].interpolate;const u=s.length;for(let d=0;d<u;d++){const m=bt(s[d],c[r],l[r],f[o]);!a&&m!==t[o].interpolatorOffsets[d]&&(a=!0),t[o].offset[d]=m}a&&(t[o].interpolate=Ze(t[o].offset,ie(s),{clamp:!1}),t[o].interpolatorOffsets=[...t[o].offset]),t[o].progress=st(0,1,t[o].interpolate(t[o].current))}function kt(e,t=e,n){if(n.x.targetOffset=0,n.y.targetOffset=0,t!==e){let s=t;for(;s&&s!==e;)n.x.targetOffset+=s.offsetLeft,n.y.targetOffset+=s.offsetTop,s=s.offsetParent}n.x.targetLength=t===e?t.scrollWidth:t.clientWidth,n.y.targetLength=t===e?t.scrollHeight:t.clientHeight,n.x.containerLength=e.clientWidth,n.y.containerLength=e.clientHeight}function Bt(e,t,n,s={}){return{measure:i=>{kt(e,s.target,n),Lt(e,n,i),(s.offset||s.target)&&Ct(e,n,s)},notify:()=>t(n)}}const L=new WeakMap,Ae=new WeakMap,j=new WeakMap,xe=new WeakMap,G=new WeakMap,Te=e=>e===document.scrollingElement?window:e;function X(e,{container:t=document.scrollingElement,trackContentSize:n=!1,...s}={}){if(!t)return de;let i=j.get(t);i||(i=new Set,j.set(t,i));const o=Mt(),r=Bt(t,e,o,s);if(i.add(r),!L.has(t)){const l=()=>{for(const d of i)d.measure(tt.timestamp);P.preUpdate(c)},c=()=>{for(const d of i)d.notify()},a=()=>P.read(l);L.set(t,a);const u=Te(t);window.addEventListener("resize",a),t!==document.documentElement&&Ae.set(t,et(t,a)),u.addEventListener("scroll",a),a()}if(n&&!G.has(t)){const l=L.get(t),c={width:t.scrollWidth,height:t.scrollHeight};xe.set(t,c);const a=()=>{const d=t.scrollWidth,m=t.scrollHeight;(c.width!==d||c.height!==m)&&(l(),c.width=d,c.height=m)},u=P.read(a,!0);G.set(t,u)}const f=L.get(t);return P.read(f,!1,!0),()=>{ae(f);const l=j.get(t);if(!l||(l.delete(r),l.size))return;const c=L.get(t);L.delete(t),c&&(Te(t).removeEventListener("scroll",c),Ae.get(t)?.(),window.removeEventListener("resize",c));const a=G.get(t);a&&(ae(a),G.delete(t)),xe.delete(t)}}const Nt=[[k.Enter,"entry"],[k.Exit,"exit"],[k.Any,"cover"],[k.All,"contain"]],Oe={start:0,end:1};function Kt(e){const t=e.trim().split(/\s+/);if(t.length!==2)return;const n=Oe[t[0]],s=Oe[t[1]];if(!(n===void 0||s===void 0))return[n,s]}function Pt(e){if(e.length!==2)return;const t=[];for(const n of e)if(Array.isArray(n))t.push(n);else if(typeof n=="string"){const s=Kt(n);if(!s)return;t.push(s)}else return;return t}function zt(e,t){const n=Pt(e);if(!n)return!1;for(let s=0;s<2;s++){const i=n[s],o=t[s];if(i[0]!==o[0]||i[1]!==o[1])return!1}return!0}function Me(e){if(!e)return{rangeStart:"contain 0%",rangeEnd:"contain 100%"};for(const[t,n]of Nt)if(zt(e,t))return{rangeStart:`${n} 0%`,rangeEnd:`${n} 100%`}}const We=new Map;function Le(e){const t={value:0},n=X(s=>{t.value=s[e.axis].progress*100},e);return{currentTime:t,cancel:n}}function Ve({source:e,container:t,...n}){const{axis:s}=n;e&&(t=e);let i=We.get(t);i||(i=new Map,We.set(t,i));const o=n.target??"self";let r=i.get(o);r||(r={},i.set(o,r));const f=s+(n.offset??[]).join(",");return r[f]||(n.target&&z(n.target)?Me(n.offset)?r[f]=new ViewTimeline({subject:n.target,axis:s}):r[f]=Le({container:t,...n}):z()?r[f]=new ScrollTimeline({source:t,axis:s}):r[f]=Le({container:t,...n})),r[f]}function Gt(e,t){const n=Ve(t),s=t.target?Me(t.offset):void 0,i=t.target?z(t.target)&&!!s:z();return e.attachTimeline({timeline:i?n:void 0,...s&&i&&{rangeStart:s.rangeStart,rangeEnd:s.rangeEnd},observe:o=>(o.pause(),le(r=>{o.time=o.iterationDuration*r},n))})}function Ft(e){return e.length===2}function $t(e,t){return Ft(e)?X(n=>{e(n[t.axis].progress,n)},t):le(e,Ve(t))}function Rt(e,{axis:t="y",container:n=document.scrollingElement,...s}={}){if(!n)return de;const i={axis:t,container:n,...s};return typeof e=="function"?$t(e,i):Gt(e,i)}const _t={some:0,all:1};function qt(e,t,{root:n,margin:s,amount:i="some"}={}){const o=$(e),r=new WeakMap,f=c=>{c.forEach(a=>{const u=r.get(a.target);if(a.isIntersecting!==!!u)if(a.isIntersecting){const d=t(a.target,a);typeof d=="function"?r.set(a.target,d):l.unobserve(a.target)}else typeof u=="function"&&(u(a),r.delete(a.target))})},l=new IntersectionObserver(f,{root:n,rootMargin:s,threshold:typeof i=="number"?i:_t[i]});return o.forEach(c=>l.observe(c)),()=>l.disconnect()}const J=(e,t)=>Math.abs(e-t);function Ut(e,t){const n=J(e.x,t.x),s=J(e.y,t.y);return Math.sqrt(n**2+s**2)}export{St as animate,Tt as animateMini,ve as createScopedAnimate,tn as delay,J as distance,Ut as distance2D,qt as inView,Rt as scroll,X as scrollInfo};
//# sourceMappingURL=/sm/5499947a54d0e24fb977f14b678fc9ab2267e1bad7656ddb418da73d316a97ff.map